зеркало из https://github.com/mozilla/hubs.git
1 строка
19 KiB
JavaScript
1 строка
19 KiB
JavaScript
"use strict";(globalThis.webpackChunkhubs=globalThis.webpackChunkhubs||[]).push([[8132],{"./src/react-components/input/Button.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Lw:()=>CancelButton,VD:()=>ApplyButton,aT:()=>AcceptButton,aW:()=>NextButton,fY:()=>ContinueButton,um:()=>presets,zx:()=>Button});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),prop_types__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/prop-types/index.js"),prop_types__WEBPACK_IMPORTED_MODULE_5___default=__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_5__),classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),_Button_scss__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/react-components/input/Button.scss"),_TextInput_scss__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/react-components/input/TextInput.scss"),react_intl__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/react-intl/lib/src/components/message.js"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/react/jsx-runtime.js");const _excluded=["as","sm","lg","xl","thin","thick","preset","className","children"];function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}))),keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?ownKeys(Object(source),!0).forEach((function(key){_defineProperty(target,key,source[key])})):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach((function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))}))}return target}function _defineProperty(obj,key,value){return(key=function _toPropertyKey(arg){var key=function _toPrimitive(input,hint){if("object"!=typeof input||null===input)return input;var prim=input[Symbol.toPrimitive];if(void 0!==prim){var res=prim.call(input,hint||"default");if("object"!=typeof res)return res;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===hint?String:Number)(input)}(arg,"string");return"symbol"==typeof key?key:String(key)}(key))in obj?Object.defineProperty(obj,key,{value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _objectWithoutProperties(source,excluded){if(null==source)return{};var key,i,target=function _objectWithoutPropertiesLoose(source,excluded){if(null==source)return{};var key,i,target={},sourceKeys=Object.keys(source);for(i=0;i<sourceKeys.length;i++)key=sourceKeys[i],excluded.indexOf(key)>=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++)key=sourceSymbolKeys[i],excluded.indexOf(key)>=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}const presets=["transparent","basic","primary","accept","cancel","accent1","accent2","accent3","accent4","accent5","accent6","landing","signin","text"],Button=(0,react__WEBPACK_IMPORTED_MODULE_0__.memo)((0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(((_ref,ref)=>{let{as,sm,lg,xl,thin,thick,preset,className,children}=_ref,rest=_objectWithoutProperties(_ref,_excluded);const ButtonComponent=as,buttonProps="button"===ButtonComponent?{type:"button"}:{};return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(ButtonComponent,_objectSpread(_objectSpread(_objectSpread({className:classnames__WEBPACK_IMPORTED_MODULE_1___default()(_Button_scss__WEBPACK_IMPORTED_MODULE_2__.Z.button,_TextInput_scss__WEBPACK_IMPORTED_MODULE_3__.Z.button,_Button_scss__WEBPACK_IMPORTED_MODULE_2__.Z[preset],{[_Button_scss__WEBPACK_IMPORTED_MODULE_2__.Z.sm]:sm,[_Button_scss__WEBPACK_IMPORTED_MODULE_2__.Z.lg]:lg,[_Button_scss__WEBPACK_IMPORTED_MODULE_2__.Z.xl]:xl,[_Button_scss__WEBPACK_IMPORTED_MODULE_2__.Z.thin]:thin,[_Button_scss__WEBPACK_IMPORTED_MODULE_2__.Z.thick]:thick},className)},buttonProps),rest),{},{ref,children}))})));function NextButton(props){return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(Button,_objectSpread(_objectSpread({preset:"accept"},props),{},{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react_intl__WEBPACK_IMPORTED_MODULE_6__.Z,{id:"button.next",defaultMessage:"Next"})}))}function CancelButton(props){return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(Button,_objectSpread(_objectSpread({preset:"cancel"},props),{},{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react_intl__WEBPACK_IMPORTED_MODULE_6__.Z,{id:"button.cancel",defaultMessage:"Cancel"})}))}function ContinueButton(props){return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(Button,_objectSpread(_objectSpread({preset:"accept"},props),{},{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react_intl__WEBPACK_IMPORTED_MODULE_6__.Z,{id:"button.continue",defaultMessage:"Continue"})}))}function AcceptButton(props){return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(Button,_objectSpread(_objectSpread({preset:"accept"},props),{},{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react_intl__WEBPACK_IMPORTED_MODULE_6__.Z,{id:"button.accept",defaultMessage:"Accept"})}))}function ApplyButton(props){return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(Button,_objectSpread(_objectSpread({preset:"accept"},props),{},{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react_intl__WEBPACK_IMPORTED_MODULE_6__.Z,{id:"button.apply",defaultMessage:"Apply"})}))}Button.propTypes={as:prop_types__WEBPACK_IMPORTED_MODULE_5___default().elementType,preset:prop_types__WEBPACK_IMPORTED_MODULE_5___default().oneOf(presets),className:prop_types__WEBPACK_IMPORTED_MODULE_5___default().string,children:prop_types__WEBPACK_IMPORTED_MODULE_5___default().node,sm:prop_types__WEBPACK_IMPORTED_MODULE_5___default().bool,lg:prop_types__WEBPACK_IMPORTED_MODULE_5___default().bool,xl:prop_types__WEBPACK_IMPORTED_MODULE_5___default().bool,thin:prop_types__WEBPACK_IMPORTED_MODULE_5___default().bool,thick:prop_types__WEBPACK_IMPORTED_MODULE_5___default().bool},Button.defaultProps={as:"button",preset:"basic"},NextButton.displayName="NextButton",CancelButton.displayName="CancelButton",ContinueButton.displayName="ContinueButton",AcceptButton.displayName="AcceptButton",ApplyButton.displayName="ApplyButton",NextButton.__docgenInfo={description:"",methods:[],displayName:"NextButton"},CancelButton.__docgenInfo={description:"",methods:[],displayName:"CancelButton"},ContinueButton.__docgenInfo={description:"",methods:[],displayName:"ContinueButton"},AcceptButton.__docgenInfo={description:"",methods:[],displayName:"AcceptButton"},ApplyButton.__docgenInfo={description:"",methods:[],displayName:"ApplyButton"}},"./src/react-components/input/TextInput.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{o:()=>TextInput_TextInput});var _path,_path2,_path3,react=__webpack_require__("./node_modules/react/index.js"),prop_types=__webpack_require__("./node_modules/prop-types/index.js"),prop_types_default=__webpack_require__.n(prop_types),classnames=__webpack_require__("./node_modules/classnames/index.js"),classnames_default=__webpack_require__.n(classnames),TextInput=__webpack_require__("./src/react-components/input/TextInput.scss");function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends.apply(this,arguments)}const SvgWarning=_ref=>{let{title,titleId,...props}=_ref;return react.createElement("svg",_extends({width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":titleId},props),title?react.createElement("title",{id:titleId},title):null,_path||(_path=react.createElement("path",{d:"M3.343 17.43h13.314a1.25 1.25 0 0 0 1.1-1.842L11.102 3.223a1.25 1.25 0 0 0-2.202 0L2.242 15.588a1.25 1.25 0 0 0 1.1 1.842v0Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),_path2||(_path2=react.createElement("path",{d:"M9.776 7.632 10 12.398l.224-4.764a.225.225 0 0 0-.227-.234v0a.224.224 0 0 0-.221.232v0Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),_path3||(_path3=react.createElement("path",{d:"M10 15.517a.782.782 0 1 1 0-1.563.782.782 0 0 1 0 1.563Z",fill:"currentColor"})))};var Button=__webpack_require__("./src/react-components/input/Button.scss"),IconButton=__webpack_require__("./src/react-components/input/IconButton.scss"),dist_screenfull=__webpack_require__("./node_modules/screenfull/dist/screenfull.js"),screenfull_default=__webpack_require__.n(dist_screenfull);__webpack_require__("./src/utils/is-mobile.js");function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){return void reject(error)}info.done?resolve(value):Promise.resolve(value).then(_next,_throw)}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise((function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err)}_next(void 0)}))}}let hasEnteredFullScreenThisSession=!1;function _showFullScreenIfWasFullScreen(){return(_showFullScreenIfWasFullScreen=_asyncToGenerator((function*(){hasEnteredFullScreenThisSession&&!screenfull_default().isFullscreen&&(yield screenfull_default().request())}))).apply(this,arguments)}const{detect}=__webpack_require__("./node_modules/detect-browser/index.js"),browser=detect();let isExitingFullscreenDueToFocus=!1;function handleTextFieldBlur(){isExitingFullscreenDueToFocus?isExitingFullscreenDueToFocus=!1:function showFullScreenIfWasFullScreen(){return _showFullScreenIfWasFullScreen.apply(this,arguments)}()}var jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js");const _excluded=["id","disabled","invalid","className","beforeInput","afterInput","onFocus","onBlur","textInputStyles","as"];function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}))),keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?ownKeys(Object(source),!0).forEach((function(key){_defineProperty(target,key,source[key])})):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach((function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))}))}return target}function _defineProperty(obj,key,value){return(key=function _toPropertyKey(arg){var key=function _toPrimitive(input,hint){if("object"!=typeof input||null===input)return input;var prim=input[Symbol.toPrimitive];if(void 0!==prim){var res=prim.call(input,hint||"default");if("object"!=typeof res)return res;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===hint?String:Number)(input)}(arg,"string");return"symbol"==typeof key?key:String(key)}(key))in obj?Object.defineProperty(obj,key,{value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _objectWithoutProperties(source,excluded){if(null==source)return{};var key,i,target=function _objectWithoutPropertiesLoose(source,excluded){if(null==source)return{};var key,i,target={},sourceKeys=Object.keys(source);for(i=0;i<sourceKeys.length;i++)key=sourceKeys[i],excluded.indexOf(key)>=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++)key=sourceSymbolKeys[i],excluded.indexOf(key)>=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}const TextInput_TextInput=(0,react.memo)((0,react.forwardRef)(((_ref,ref)=>{let{id,disabled,invalid,className,beforeInput,afterInput,onFocus,onBlur,textInputStyles,as:InputElement}=_ref,rest=_objectWithoutProperties(_ref,_excluded);return(0,jsx_runtime.jsxs)("div",{className:classnames_default()(TextInput.Z.outerWrapper,Button.Z.inputGroup,IconButton.Z.inputGroup,{[TextInput.Z.invalid]:invalid,[TextInput.Z.disabled]:disabled},className),children:[(0,jsx_runtime.jsx)("div",{className:TextInput.Z.beforeInput,children:beforeInput}),(0,jsx_runtime.jsx)("div",{className:TextInput.Z.inputWrapper,children:(0,jsx_runtime.jsx)(InputElement,_objectSpread(_objectSpread({id,className:classnames_default()(TextInput.Z.textInput,textInputStyles),disabled,onFocus:e=>{!function handleTextFieldFocus(target){if(!window.AFRAME)return;const isMobile=AFRAME.utils.device.isMobile();screenfull_default().isFullscreen&&!AFRAME.utils.device.isMobileVR()&&"firefox"===browser.name&&(isExitingFullscreenDueToFocus=!0,screenfull_default().exit().then((()=>{target.focus()}))),isMobile||target.select()}(e.target),onFocus&&onFocus(e)},onBlur:e=>{handleTextFieldBlur(),onBlur&&onBlur(e)}},rest),{},{ref}))}),(0,jsx_runtime.jsxs)("div",{className:TextInput.Z.afterInput,children:[invalid&&(0,jsx_runtime.jsx)(SvgWarning,{className:TextInput.Z.invalidIcon}),afterInput]})]})})));TextInput_TextInput.propTypes={id:prop_types_default().string.isRequired,disabled:prop_types_default().bool,invalid:prop_types_default().bool,className:prop_types_default().string,onChange:prop_types_default().func,beforeInput:prop_types_default().node,afterInput:prop_types_default().node,onFocus:prop_types_default().func,onBlur:prop_types_default().func,textInputStyles:prop_types_default().string,as:prop_types_default().elementType},TextInput_TextInput.defaultProps={onChange:()=>{},as:"input"},TextInput_TextInput.displayName="TextInput"},"./src/react-components/input/TextInputField.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Y:()=>TextInputField});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),prop_types__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/prop-types/index.js"),prop_types__WEBPACK_IMPORTED_MODULE_5___default=__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_5__),_InputField__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/react-components/input/InputField.js"),_TextInput__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/react-components/input/TextInput.js"),_useId__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/react-components/input/useId.js"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/react/jsx-runtime.js");const _excluded=["className","error","description","inputClassName","label","fullWidth"];function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}))),keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?ownKeys(Object(source),!0).forEach((function(key){_defineProperty(target,key,source[key])})):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach((function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))}))}return target}function _defineProperty(obj,key,value){return(key=function _toPropertyKey(arg){var key=function _toPrimitive(input,hint){if("object"!=typeof input||null===input)return input;var prim=input[Symbol.toPrimitive];if(void 0!==prim){var res=prim.call(input,hint||"default");if("object"!=typeof res)return res;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===hint?String:Number)(input)}(arg,"string");return"symbol"==typeof key?key:String(key)}(key))in obj?Object.defineProperty(obj,key,{value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _objectWithoutProperties(source,excluded){if(null==source)return{};var key,i,target=function _objectWithoutPropertiesLoose(source,excluded){if(null==source)return{};var key,i,target={},sourceKeys=Object.keys(source);for(i=0;i<sourceKeys.length;i++)key=sourceKeys[i],excluded.indexOf(key)>=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++)key=sourceSymbolKeys[i],excluded.indexOf(key)>=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}const TextInputField=(0,react__WEBPACK_IMPORTED_MODULE_0__.memo)((0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(((_ref,ref)=>{let{className,error,description,inputClassName,label,fullWidth}=_ref,rest=_objectWithoutProperties(_ref,_excluded);const id=(0,_useId__WEBPACK_IMPORTED_MODULE_3__.M)(),labelId=(0,_useId__WEBPACK_IMPORTED_MODULE_3__.M)();return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_InputField__WEBPACK_IMPORTED_MODULE_1__.U,{id:labelId,htmlFor:id,className,label,error,description,fullWidth,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_TextInput__WEBPACK_IMPORTED_MODULE_2__.o,_objectSpread({id,ref,className:inputClassName},rest))})})));TextInputField.propTypes={className:prop_types__WEBPACK_IMPORTED_MODULE_5___default().string,label:prop_types__WEBPACK_IMPORTED_MODULE_5___default().node,error:prop_types__WEBPACK_IMPORTED_MODULE_5___default().node,description:prop_types__WEBPACK_IMPORTED_MODULE_5___default().node,labelClassName:prop_types__WEBPACK_IMPORTED_MODULE_5___default().string,inputClassName:prop_types__WEBPACK_IMPORTED_MODULE_5___default().string,fullWidth:prop_types__WEBPACK_IMPORTED_MODULE_5___default().bool}},"./src/react-components/input/useId.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{M:()=>useId});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js");const idPrefix="id_";let nextId=0;function useId(){const[id]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)((()=>idPrefix+nextId++));return id}}}]); |