You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
10 KiB

{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/objectWithoutPropertiesLoose\";\nvar _excluded = [\"animationType\", \"children\", \"onDismiss\", \"onRequestClose\", \"onShow\", \"transparent\", \"visible\"];\nimport * as React from 'react';\nimport ModalPortal from \"./ModalPortal\";\nimport ModalAnimation from \"./ModalAnimation\";\nimport ModalContent from \"./ModalContent\";\nimport ModalFocusTrap from \"./ModalFocusTrap\";\nvar uniqueModalIdentifier = 0;\nvar activeModalStack = [];\nvar activeModalListeners = {};\nfunction notifyActiveModalListeners() {\n if (activeModalStack.length === 0) {\n return;\n }\n var activeModalId = activeModalStack[activeModalStack.length - 1];\n activeModalStack.forEach(function (modalId) {\n if (modalId in activeModalListeners) {\n activeModalListeners[modalId](modalId === activeModalId);\n }\n });\n}\nfunction removeActiveModal(modalId) {\n if (modalId in activeModalListeners) {\n activeModalListeners[modalId](false);\n delete activeModalListeners[modalId];\n }\n var index = activeModalStack.indexOf(modalId);\n if (index !== -1) {\n activeModalStack.splice(index, 1);\n notifyActiveModalListeners();\n }\n}\nfunction addActiveModal(modalId, listener) {\n removeActiveModal(modalId);\n activeModalStack.push(modalId);\n activeModalListeners[modalId] = listener;\n notifyActiveModalListeners();\n}\nvar Modal = React.forwardRef(function (props, forwardedRef) {\n var animationType = props.animationType,\n children = props.children,\n onDismiss = props.onDismiss,\n onRequestClose = props.onRequestClose,\n onShow = props.onShow,\n transparent = props.transparent,\n _props$visible = props.visible,\n visible = _props$visible === void 0 ? true : _props$visible,\n rest = _objectWithoutPropertiesLoose(props, _excluded);\n var modalId = React.useMemo(function () {\n return uniqueModalIdentifier++;\n }, []);\n var _React$useState = React.useState(false),\n isActive = _React$useState[0],\n setIsActive = _React$useState[1];\n var onDismissCallback = React.useCallback(function () {\n removeActiveModal(modalId);\n if (onDismiss) {\n onDismiss();\n }\n }, [modalId, onDismiss]);\n var onShowCallback = React.useCallback(function () {\n addActiveModal(modalId, setIsActive);\n if (onShow) {\n onShow();\n }\n }, [modalId, onShow]);\n React.useEffect(function () {\n return function () {\n return removeActiveModal(modalId);\n };\n }, [modalId]);\n return React.createElement(ModalPortal, null, React.createElement(ModalAnimation, {\n animationType: animationType,\n onDismiss: onDismissCallback,\n onShow: onShowCallback,\n visible: visible\n }, React.createElement(ModalFocusTrap, {\n active: isActive\n }, React.createElement(ModalContent, _extends({}, rest, {\n active: isActive,\n onRequestClose: onRequestClose,\n ref: forwardedRef,\n transparent: transparent\n }), children))));\n});\nexport default Modal;","map":{"version":3,"names":["_extends","_objectWithoutPropertiesLoose","_excluded","React","ModalPortal","ModalAnimation","ModalContent","ModalFocusTrap","uniqueModalIdentifier","activeModalStack","activeModalListeners","notifyActiveModalListeners","length","activeModalId","forEach","modalId","removeActiveModal","index","indexOf","splice","addActiveModal","listener","push","Modal","forwardRef","props","forwardedRef","animationType","children","onDismiss","onRequestClose","onShow","transparent","_props$visible","visible","rest","useMemo","_React$useState","useState","isActive","setIsActive","onDismissCallback","useCallback","onShowCallback","useEffect","createElement","active","ref"],"sources":["/Users/thomaschazot/Documents/But2A/LaSuperMeteo/iut-expo-starter/node_modules/react-native-web/dist/exports/Modal/index.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/objectWithoutPropertiesLoose\";\nvar _excluded = [\"animationType\", \"children\", \"onDismiss\", \"onRequestClose\", \"onShow\", \"transparent\", \"visible\"];\n\n/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport * as React from 'react';\nimport ModalPortal from './ModalPortal';\nimport ModalAnimation from './ModalAnimation';\nimport ModalContent from './ModalContent';\nimport ModalFocusTrap from './ModalFocusTrap';\nvar uniqueModalIdentifier = 0;\nvar activeModalStack = [];\nvar activeModalListeners = {};\n\nfunction notifyActiveModalListeners() {\n if (activeModalStack.length === 0) {\n return;\n }\n\n var activeModalId = activeModalStack[activeModalStack.length - 1];\n activeModalStack.forEach(modalId => {\n if (modalId in activeModalListeners) {\n activeModalListeners[modalId](modalId === activeModalId);\n }\n });\n}\n\nfunction removeActiveModal(modalId) {\n if (modalId in activeModalListeners) {\n // Before removing this listener we should probably tell it\n // that it's no longer the active modal for sure.\n activeModalListeners[modalId](false);\n delete activeModalListeners[modalId];\n }\n\n var index = activeModalStack.indexOf(modalId);\n\n if (index !== -1) {\n activeModalStack.splice(index, 1);\n notifyActiveModalListeners();\n }\n}\n\nfunction addActiveModal(modalId, listener) {\n removeActiveModal(modalId);\n activeModalStack.push(modalId);\n activeModalListeners[modalId] = listener;\n notifyActiveModalListeners();\n}\n\nvar Modal = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {\n var animationType = props.animationType,\n children = props.children,\n onDismiss = props.onDismiss,\n onRequestClose = props.onRequestClose,\n onShow = props.onShow,\n transparent = props.transparent,\n _props$visible = props.visible,\n visible = _props$visible === void 0 ? true : _props$visible,\n rest = _objectWithoutPropertiesLoose(props, _excluded); // Set a unique model identifier so we can correctly route\n // dismissals and check the layering of modals.\n\n\n var modalId = React.useMemo(() => uniqueModalIdentifier++, []);\n\n var _React$useState = React.useState(false),\n isActive = _React$useState[0],\n setIsActive = _React$useState[1];\n\n var onDismissCallback = React.useCallback(() => {\n removeActiveModal(modalId);\n\n if (onDismiss) {\n onDismiss();\n }\n }, [modalId, onDismiss]);\n var onShowCallback = React.useCallback(() => {\n addActiveModal(modalId, setIsActive);\n\n if (onShow) {\n onShow();\n }\n }, [modalId, onShow]);\n React.useEffect(() => {\n return () => removeActiveModal(modalId);\n }, [modalId]);\n return /*#__PURE__*/React.createElement(ModalPortal, null, /*#__PURE__*/React.createElement(ModalAnimation, {\n animationType: animationType,\n onDismiss: onDismissCallback,\n onShow: onShowCallback,\n visible: visible\n }, /*#__PURE__*/React.createElement(ModalFocusTrap, {\n active: isActive\n }, /*#__PURE__*/React.createElement(ModalContent, _extends({}, rest, {\n active: isActive,\n onRequestClose: onRequestClose,\n ref: forwardedRef,\n transparent: transparent\n }), children))));\n});\nexport default Modal;"],"mappings":"AAAA,OAAOA,QAAQ,MAAM,gCAAgC;AACrD,OAAOC,6BAA6B,MAAM,qDAAqD;AAC/F,IAAIC,SAAS,GAAG,CAAC,eAAe,EAAE,UAAU,EAAE,WAAW,EAAE,gBAAgB,EAAE,QAAQ,EAAE,aAAa,EAAE,SAAS,CAAC;AAWhH,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,OAAOC,WAAW;AAClB,OAAOC,cAAc;AACrB,OAAOC,YAAY;AACnB,OAAOC,cAAc;AACrB,IAAIC,qBAAqB,GAAG,CAAC;AAC7B,IAAIC,gBAAgB,GAAG,EAAE;AACzB,IAAIC,oBAAoB,GAAG,CAAC,CAAC;AAE7B,SAASC,0BAA0B,GAAG;EACpC,IAAIF,gBAAgB,CAACG,MAAM,KAAK,CAAC,EAAE;IACjC;EACF;EAEA,IAAIC,aAAa,GAAGJ,gBAAgB,CAACA,gBAAgB,CAACG,MAAM,GAAG,CAAC,CAAC;EACjEH,gBAAgB,CAACK,OAAO,CAAC,UAAAC,OAAO,EAAI;IAClC,IAAIA,OAAO,IAAIL,oBAAoB,EAAE;MACnCA,oBAAoB,CAACK,OAAO,CAAC,CAACA,OAAO,KAAKF,aAAa,CAAC;IAC1D;EACF,CAAC,CAAC;AACJ;AAEA,SAASG,iBAAiB,CAACD,OAAO,EAAE;EAClC,IAAIA,OAAO,IAAIL,oBAAoB,EAAE;IAGnCA,oBAAoB,CAACK,OAAO,CAAC,CAAC,KAAK,CAAC;IACpC,OAAOL,oBAAoB,CAACK,OAAO,CAAC;EACtC;EAEA,IAAIE,KAAK,GAAGR,gBAAgB,CAACS,OAAO,CAACH,OAAO,CAAC;EAE7C,IAAIE,KAA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