@mirai/core 0.1.65 → 0.1.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/Core.js +1 -0
- package/build/Core.js.map +1 -1
- package/package.json +1 -1
- package/site/deals/index.html +2 -2
package/build/Core.js
CHANGED
package/build/Core.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Core.js","names":["ghosts","Core","children","components","skeleton","isMobile","isDesktop","useDevice","value","currency","locale","DEFAULT_LOCALE","useStore","dictionary","setDictionary","useState","useEffect","next","ServiceDictionary","get","filter","desktop","mobile","map","index","el","component","props","getGhost","skeletonFallback","SKELETONS","React","createElement","ReactDOM","createPortal","COMPONENTS","process","env","NODE_ENV","undefined","ghost","propTypes","PropTypes","node","arrayOf","shape","oneOf","Object","keys","any","bool"],"sources":["../src/Core.jsx"],"sourcesContent":["import { useStore } from '@mirai/data-sources';\nimport { DEFAULT_LOCALE, LocaleProvider } from '@mirai/locale';\nimport { ServiceDictionary } from '@mirai/services';\nimport { useDevice } from '@mirai/ui';\nimport PropTypes from 'prop-types';\nimport React, { useEffect, useState, Suspense } from 'react';\nimport ReactDOM from 'react-dom';\n\nimport { COMPONENTS, SKELETONS } from './components';\nimport { getGhost } from './helpers';\n\nconst ghosts = {};\n\nconst Core = ({ children, components = [], skeleton = false }) => {\n const { isMobile, isDesktop } = useDevice();\n const {\n value: { currency, locale = DEFAULT_LOCALE },\n } = useStore();\n\n const [dictionary, setDictionary] = useState();\n\n useEffect(() => {\n (async () => {\n const next = await ServiceDictionary.get(locale);\n if (next) setDictionary(next);\n })();\n }, [locale]);\n\n return (\n <LocaleProvider {...{ currency, dictionary, locale }}>\n <>\n {components\n .filter(({ desktop, mobile }) => !(isMobile && mobile === 'false') && !(isDesktop && desktop === 'false'))\n .map(({ el, component, ...props }, index) => {\n if (!ghosts[index]) ghosts[index] = getGhost(el);\n const skeletonFallback = SKELETONS[component] ? React.createElement(SKELETONS[component]) : <></>;\n\n return ReactDOM.createPortal(\n skeleton ? (\n skeletonFallback\n ) : (\n <Suspense fallback={skeletonFallback}>\n {React.createElement(COMPONENTS[component], {\n ...props,\n ['data-testid']: process.env.NODE_ENV === 'production' ? component : undefined,\n ghost: ghosts[index],\n el,\n })}\n </Suspense>\n ),\n el,\n );\n })}\n </>\n {children}\n </LocaleProvider>\n );\n};\n\nCore.propTypes = {\n children: PropTypes.node,\n components: PropTypes.arrayOf(\n PropTypes.shape({\n component: PropTypes.oneOf(Object.keys(COMPONENTS)),\n el: PropTypes.any,\n }),\n ),\n skeleton: PropTypes.bool,\n};\n\nexport { Core };\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAqC;AAAA;AAAA;AAErC,MAAMA,MAAM,GAAG,CAAC,CAAC;AAEjB,MAAMC,IAAI,GAAG,QAAqD;EAAA,IAApD;IAAEC,QAAQ;IAAEC,UAAU,GAAG,EAAE;IAAEC,QAAQ,GAAG;EAAM,CAAC;EAC3D,MAAM;IAAEC,QAAQ;IAAEC;EAAU,CAAC,GAAG,IAAAC,aAAS,GAAE;EAC3C,MAAM;IACJC,KAAK,EAAE;MAAEC,QAAQ;MAAEC,MAAM,GAAGC;IAAe;EAC7C,CAAC,GAAG,IAAAC,qBAAQ,GAAE;EAEd,MAAM,CAACC,UAAU,EAAEC,aAAa,CAAC,GAAG,IAAAC,eAAQ,GAAE;EAE9C,IAAAC,gBAAS,EAAC,MAAM;IACd,CAAC,YAAY;MACX,MAAMC,IAAI,GAAG,MAAMC,2BAAiB,CAACC,GAAG,CAACT,MAAM,CAAC;MAChD,IAAIO,IAAI,EAAEH,aAAa,CAACG,IAAI,CAAC;IAC/B,CAAC,GAAG;EACN,CAAC,EAAE,CAACP,MAAM,CAAC,CAAC;EAEZ,oBACE,6BAAC,sBAAc;IAAOD,QAAQ;IAAEI,UAAU;IAAEH;EAAM,gBAChD,4DACGP,UAAU,CACRiB,MAAM,CAAC;IAAA,IAAC;MAAEC,OAAO;MAAEC;IAAO,CAAC;IAAA,OAAK,EAAEjB,QAAQ,IAAIiB,MAAM,KAAK,OAAO,CAAC,IAAI,EAAEhB,SAAS,IAAIe,OAAO,KAAK,OAAO,CAAC;EAAA,EAAC,CACzGE,GAAG,CAAC,QAA8BC,KAAK,KAAK;IAAA,IAAvC;MAAEC,EAAE;MAAEC,SAAS;MAAE,GAAGC;IAAM,CAAC;IAC/B,IAAI,CAAC3B,MAAM,CAACwB,KAAK,CAAC,EAAExB,MAAM,CAACwB,KAAK,CAAC,GAAG,IAAAI,iBAAQ,EAACH,EAAE,CAAC;IAChD,MAAMI,gBAAgB,GAAGC,qBAAS,CAACJ,SAAS,CAAC,gBAAGK,cAAK,CAACC,aAAa,CAACF,qBAAS,CAACJ,SAAS,CAAC,CAAC,gBAAG,2DAAK;IAEjG,oBAAOO,iBAAQ,CAACC,YAAY,CAC1B9B,QAAQ,GACNyB,gBAAgB,gBAEhB,6BAAC,eAAQ;MAAC,QAAQ,EAAEA;IAAiB,gBAClCE,cAAK,CAACC,aAAa,CAACG,sBAAU,CAACT,SAAS,CAAC,EAAE;MAC1C,GAAGC,KAAK;MACR,CAAC,aAAa,GAAGS,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,GAAGZ,SAAS,GAAGa,SAAS;MAC9EC,KAAK,EAAExC,MAAM,CAACwB,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"Core.js","names":["ghosts","Core","children","components","skeleton","isMobile","isDesktop","useDevice","value","currency","locale","DEFAULT_LOCALE","useStore","dictionary","setDictionary","useState","useEffect","next","ServiceDictionary","get","filter","desktop","mobile","map","index","el","component","props","getGhost","skeletonFallback","SKELETONS","React","createElement","ReactDOM","createPortal","COMPONENTS","process","env","NODE_ENV","undefined","ghost","propTypes","PropTypes","node","arrayOf","shape","oneOf","Object","keys","any","bool"],"sources":["../src/Core.jsx"],"sourcesContent":["import { useStore } from '@mirai/data-sources';\nimport { DEFAULT_LOCALE, LocaleProvider } from '@mirai/locale';\nimport { ServiceDictionary } from '@mirai/services';\nimport { useDevice } from '@mirai/ui';\nimport PropTypes from 'prop-types';\nimport React, { useEffect, useState, Suspense } from 'react';\nimport ReactDOM from 'react-dom';\n\nimport { COMPONENTS, SKELETONS } from './components';\nimport { getGhost } from './helpers';\n\nconst ghosts = {};\n\nconst Core = ({ children, components = [], skeleton = false }) => {\n const { isMobile, isDesktop } = useDevice();\n const {\n value: { currency, locale = DEFAULT_LOCALE },\n } = useStore();\n\n const [dictionary, setDictionary] = useState();\n\n useEffect(() => {\n (async () => {\n const next = await ServiceDictionary.get(locale);\n if (next) setDictionary(next);\n })();\n }, [locale]);\n\n return (\n <LocaleProvider {...{ currency, dictionary, locale }}>\n <>\n {components\n .filter(({ desktop, mobile }) => !(isMobile && mobile === 'false') && !(isDesktop && desktop === 'false'))\n .map(({ el, component, ...props }, index) => {\n if (!ghosts[index]) ghosts[index] = getGhost(el);\n const skeletonFallback = SKELETONS[component] ? React.createElement(SKELETONS[component]) : <></>;\n\n return ReactDOM.createPortal(\n skeleton ? (\n skeletonFallback\n ) : (\n <Suspense fallback={skeletonFallback}>\n {React.createElement(COMPONENTS[component], {\n ...props,\n ['data-testid']: process.env.NODE_ENV === 'production' ? component : undefined,\n ghost: ghosts[index],\n skeleton: skeletonFallback,\n el,\n })}\n </Suspense>\n ),\n el,\n );\n })}\n </>\n {children}\n </LocaleProvider>\n );\n};\n\nCore.propTypes = {\n children: PropTypes.node,\n components: PropTypes.arrayOf(\n PropTypes.shape({\n component: PropTypes.oneOf(Object.keys(COMPONENTS)),\n el: PropTypes.any,\n }),\n ),\n skeleton: PropTypes.bool,\n};\n\nexport { Core };\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAqC;AAAA;AAAA;AAErC,MAAMA,MAAM,GAAG,CAAC,CAAC;AAEjB,MAAMC,IAAI,GAAG,QAAqD;EAAA,IAApD;IAAEC,QAAQ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,GACNyB,gBAAgB,gBAEhB,6BAAC,eAAQ;MAAC,QAAQ,EAAEA;IAAiB,gBAClCE,cAAK,CAACC,aAAa,CAACG,sBAAU,CAACT,SAAS,CAAC,EAAE;MAC1C,GAAGC,KAAK;MACR,CAAC,aAAa,GAAGS,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,GAAGZ,SAAS,GAAGa,SAAS;MAC9EC,KAAK,EAAExC,MAAM,CAACwB,KAAK,CAAC;MACpBpB,QAAQ,EAAEyB,gBAAgB;MAC1BJ;IACF,CAAC,CAAC,CAEL,EACDA,EAAE,CACH;EACH,CAAC,CAAC,CACH,EACFvB,QAAQ,CACM;AAErB,CAAC;AAAC;AAEFD,IAAI,CAACwC,SAAS,GAAG;EACfvC,QAAQ,EAAEwC,kBAAS,CAACC,IAAI;EACxBxC,UAAU,EAAEuC,kBAAS,CAACE,OAAO,CAC3BF,kBAAS,CAACG,KAAK,CAAC;IACdnB,SAAS,EAAEgB,kBAAS,CAACI,KAAK,CAACC,MAAM,CAACC,IAAI,CAACb,sBAAU,CAAC,CAAC;IACnDV,EAAE,EAAEiB,kBAAS,CAACO;EAChB,CAAC,CAAC,CACH;EACD7C,QAAQ,EAAEsC,kBAAS,CAACQ;AACtB,CAAC"}
|
package/package.json
CHANGED
package/site/deals/index.html
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<link rel="stylesheet" href="{url}/site/customer.css" />
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
|
11
|
-
<div data-mirai-id="501404" data-hotel="
|
|
11
|
+
<div data-mirai-id="501404" data-hotel="88737419" data-type="chain" data-locale="en-GB" hidden></div>
|
|
12
12
|
|
|
13
13
|
<header>
|
|
14
14
|
<h1>@mirai/core</h1>
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
</header>
|
|
22
22
|
|
|
23
23
|
<section class="deals">
|
|
24
|
-
<div data-mirai-component="deals"></div>
|
|
24
|
+
<div data-mirai-component="deals" data-id="205800"></div>
|
|
25
25
|
</section>
|
|
26
26
|
|
|
27
27
|
<footer>Mirai Tech - Copyright, 2023</footer>
|