@mirai/core 0.1.15 → 0.1.16
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.
|
@@ -19,12 +19,14 @@ var _default = () => {
|
|
|
19
19
|
}
|
|
20
20
|
} = (0, _dataSources.useStore)();
|
|
21
21
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_ui.InputSelect, {
|
|
22
|
+
name: "locale",
|
|
22
23
|
options: LOCALES,
|
|
23
24
|
value: locale,
|
|
24
25
|
onChange: value => set({
|
|
25
26
|
locale: value
|
|
26
27
|
})
|
|
27
28
|
}), /*#__PURE__*/_react.default.createElement(_ui.InputSelect, {
|
|
29
|
+
name: "currency",
|
|
28
30
|
options: CURRENCIES,
|
|
29
31
|
value: currency,
|
|
30
32
|
onChange: value => set({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Environment.js","names":["LOCALES","CURRENCIES","set","value","currency","locale","useStore"],"sources":["../../../src/components/__internal__/Environment.jsx"],"sourcesContent":["import { useStore } from '@mirai/data-sources';\nimport { InputSelect } from '@mirai/ui';\nimport React from 'react';\n\nconst LOCALES = ['es-ES', 'en-US', 'en-GB', 'ja-JP', 'de-DE', 'pt-PT'];\nconst CURRENCIES = ['EUR', 'USD', 'GBP', 'JPY'];\n\nexport default () => {\n const {\n set,\n value: { currency, locale },\n } = useStore();\n\n return (\n <>\n <InputSelect options={LOCALES} value={locale} onChange={(value) => set({ locale: value })} />\n <InputSelect
|
|
1
|
+
{"version":3,"file":"Environment.js","names":["LOCALES","CURRENCIES","set","value","currency","locale","useStore"],"sources":["../../../src/components/__internal__/Environment.jsx"],"sourcesContent":["import { useStore } from '@mirai/data-sources';\nimport { InputSelect } from '@mirai/ui';\nimport React from 'react';\n\nconst LOCALES = ['es-ES', 'en-US', 'en-GB', 'ja-JP', 'de-DE', 'pt-PT'];\nconst CURRENCIES = ['EUR', 'USD', 'GBP', 'JPY'];\n\nexport default () => {\n const {\n set,\n value: { currency, locale },\n } = useStore();\n\n return (\n <>\n <InputSelect name=\"locale\" options={LOCALES} value={locale} onChange={(value) => set({ locale: value })} />\n <InputSelect\n name=\"currency\"\n options={CURRENCIES}\n value={currency}\n onChange={(value) => set({ currency: value })}\n />\n </>\n );\n};\n"],"mappings":";;;;;;AAAA;AACA;AACA;AAA0B;AAE1B,MAAMA,OAAO,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC;AACtE,MAAMC,UAAU,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC;AAAC,eAEjC,MAAM;EACnB,MAAM;IACJC,GAAG;IACHC,KAAK,EAAE;MAAEC,QAAQ;MAAEC;IAAO;EAC5B,CAAC,GAAG,IAAAC,qBAAQ,GAAE;EAEd,oBACE,yEACE,6BAAC,eAAW;IAAC,IAAI,EAAC,QAAQ;IAAC,OAAO,EAAEN,OAAQ;IAAC,KAAK,EAAEK,MAAO;IAAC,QAAQ,EAAGF,KAAK,IAAKD,GAAG,CAAC;MAAEG,MAAM,EAAEF;IAAM,CAAC;EAAE,EAAG,eAC3G,6BAAC,eAAW;IACV,IAAI,EAAC,UAAU;IACf,OAAO,EAAEF,UAAW;IACpB,KAAK,EAAEG,QAAS;IAChB,QAAQ,EAAGD,KAAK,IAAKD,GAAG,CAAC;MAAEE,QAAQ,EAAED;IAAM,CAAC;EAAE,EAC9C,CACD;AAEP,CAAC;AAAA"}
|
package/build/index.js
CHANGED
|
@@ -10,15 +10,18 @@ var _helpers = require("./helpers");
|
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
11
|
/* eslint-disable no-console */
|
|
12
12
|
|
|
13
|
-
window.Mirai =
|
|
14
|
-
window.Mirai
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
window.Mirai = {
|
|
14
|
+
...window.Mirai,
|
|
15
|
+
environment: process && process.env && process.env.NODE_ENV || "production",
|
|
16
|
+
services: {
|
|
17
|
+
booking: process && process.env && process.env.SERVICE_BOOKING || "https://reservation-pre.mirai.com/XMAS/reservation",
|
|
18
|
+
club: process && process.env && process.env.SERVICE_CLUB || "https://api.mirai.com",
|
|
19
|
+
engine: process && process.env && process.env.SERVICE_ENGINE || "https://engine.mirai.com",
|
|
20
|
+
static: process && process.env && process.env.SERVICE_STATIC || "https://static.mirai.com",
|
|
21
|
+
user: process && process.env && process.env.SERVICE_USER || "https://api.mirai.com"
|
|
22
|
+
},
|
|
23
|
+
version: _package.version
|
|
20
24
|
};
|
|
21
|
-
window.Mirai.version = _package.version;
|
|
22
25
|
window.Mirai.core = async () => {
|
|
23
26
|
const isProduction = (process && process.env && process.env.NODE_ENV || "production") === 'production';
|
|
24
27
|
const isDevelopment = (process && process.env && process.env.NODE_ENV || "production") === 'development';
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["window","Mirai","environment","services","club","engine","static","user","version","core","isProduction","isDevelopment","console","log","name","urlParams","fetchUrlParams","location","search","substring","cookies","fetchCookies","COOKIE_CART","COOKIE_VALUES","session","fetchSession","env","loadEnvironment","undefined","instance","findInstance","components","findComponents","length","config","fetchConfig","theme","store","consolidateStore","ReactDOM","render","el"],"sources":["../src/index.js"],"sourcesContent":["/* eslint-disable no-console */\nimport { MetricsProvider, StoreProvider } from '@mirai/data-sources';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\n\nimport { name, version } from '../package.json';\nimport { Core } from './Core';\nimport { COOKIE_CART, COOKIE_VALUES } from './Core.definition';\nimport {\n consolidateStore,\n fetchConfig,\n fetchCookies,\n fetchSession,\n fetchUrlParams,\n findComponents,\n findInstance,\n loadEnvironment,\n theme,\n} from './helpers';\n\nwindow.Mirai = window.Mirai
|
|
1
|
+
{"version":3,"file":"index.js","names":["window","Mirai","environment","services","booking","club","engine","static","user","version","core","isProduction","isDevelopment","console","log","name","urlParams","fetchUrlParams","location","search","substring","cookies","fetchCookies","COOKIE_CART","COOKIE_VALUES","session","fetchSession","env","loadEnvironment","undefined","instance","findInstance","components","findComponents","length","config","fetchConfig","theme","store","consolidateStore","ReactDOM","render","el"],"sources":["../src/index.js"],"sourcesContent":["/* eslint-disable no-console */\nimport { MetricsProvider, StoreProvider } from '@mirai/data-sources';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\n\nimport { name, version } from '../package.json';\nimport { Core } from './Core';\nimport { COOKIE_CART, COOKIE_VALUES } from './Core.definition';\nimport {\n consolidateStore,\n fetchConfig,\n fetchCookies,\n fetchSession,\n fetchUrlParams,\n findComponents,\n findInstance,\n loadEnvironment,\n theme,\n} from './helpers';\n\nwindow.Mirai = {\n ...window.Mirai,\n environment: process.env.NODE_ENV,\n services: {\n booking: process.env.SERVICE_BOOKING,\n club: process.env.SERVICE_CLUB,\n engine: process.env.SERVICE_ENGINE,\n static: process.env.SERVICE_STATIC,\n user: process.env.SERVICE_USER,\n },\n version,\n};\n\nwindow.Mirai.core = async () => {\n const isProduction = process.env.NODE_ENV === 'production';\n const isDevelopment = process.env.NODE_ENV === 'development';\n\n console.log(`${isProduction ? '🟢' : isDevelopment ? '🟡' : '🔴'} ${name} v${version} [${process.env.NODE_ENV}]`);\n\n // 1. Fetch client-side dataSources\n const urlParams = fetchUrlParams(location.search.substring(1));\n const cookies = fetchCookies([COOKIE_CART, COOKIE_VALUES]);\n const session = fetchSession(urlParams);\n\n // 2. Analize environment\n const environment = urlParams.env && isProduction ? loadEnvironment(urlParams.env) : undefined;\n if (environment) return;\n\n // 3. Find instance\n const instance = findInstance();\n if (!instance) return;\n\n // 4. Find components\n const components = findComponents();\n if (!components.length) return;\n\n // 5. Analize id to fetch its config\n const config = await fetchConfig(instance);\n if (!config) return;\n\n // 6. Theming\n theme();\n\n // 7. Consolidate store\n const store = consolidateStore({ config, cookies, instance, session, urlParams });\n\n // 8. Render components\n ReactDOM.render(\n <React.StrictMode>\n <MetricsProvider token={process.env.METRICS}>\n <StoreProvider value={store}>\n <Core {...{ components }} />\n </StoreProvider>\n </MetricsProvider>\n </React.StrictMode>,\n instance.el,\n );\n};\n\nwindow.Mirai.core();\n"],"mappings":";;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAUmB;AAlBnB;;AAoBAA,MAAM,CAACC,KAAK,GAAG;EACb,GAAGD,MAAM,CAACC,KAAK;EACfC,WAAW,gEAAsB;EACjCC,QAAQ,EAAE;IACRC,OAAO,+GAA6B;IACpCC,IAAI,+EAA0B;IAC9BC,MAAM,oFAA4B;IAClCC,MAAM,oFAA4B;IAClCC,IAAI;EACN,CAAC;EACDC,OAAO,EAAPA;AACF,CAAC;AAEDT,MAAM,CAACC,KAAK,CAACS,IAAI,GAAG,YAAY;EAC9B,MAAMC,YAAY,GAAG,qEAAyB,YAAY;EAC1D,MAAMC,aAAa,GAAG,qEAAyB,aAAa;EAE5DC,OAAO,CAACC,GAAG,CAAE,GAAEH,YAAY,GAAG,IAAI,GAAGC,aAAa,GAAG,IAAI,GAAG,IAAK,IAAGG,aAAK,KAAIN,gBAAQ,KAAE,8DAAuB,GAAE,CAAC;;EAEjH;EACA,MAAMO,SAAS,GAAG,IAAAC,uBAAc,EAACC,QAAQ,CAACC,MAAM,CAACC,SAAS,CAAC,CAAC,CAAC,CAAC;EAC9D,MAAMC,OAAO,GAAG,IAAAC,qBAAY,EAAC,CAACC,kBAAW,EAAEC,oBAAa,CAAC,CAAC;EAC1D,MAAMC,OAAO,GAAG,IAAAC,qBAAY,EAACV,SAAS,CAAC;;EAEvC;EACA,MAAMd,WAAW,GAAGc,SAAS,CAACW,GAAG,IAAIhB,YAAY,GAAG,IAAAiB,wBAAe,EAACZ,SAAS,CAACW,GAAG,CAAC,GAAGE,SAAS;EAC9F,IAAI3B,WAAW,EAAE;;EAEjB;EACA,MAAM4B,QAAQ,GAAG,IAAAC,qBAAY,GAAE;EAC/B,IAAI,CAACD,QAAQ,EAAE;;EAEf;EACA,MAAME,UAAU,GAAG,IAAAC,uBAAc,GAAE;EACnC,IAAI,CAACD,UAAU,CAACE,MAAM,EAAE;;EAExB;EACA,MAAMC,MAAM,GAAG,MAAM,IAAAC,oBAAW,EAACN,QAAQ,CAAC;EAC1C,IAAI,CAACK,MAAM,EAAE;;EAEb;EACA,IAAAE,cAAK,GAAE;;EAEP;EACA,MAAMC,KAAK,GAAG,IAAAC,yBAAgB,EAAC;IAAEJ,MAAM;IAAEd,OAAO;IAAES,QAAQ;IAAEL,OAAO;IAAET;EAAU,CAAC,CAAC;;EAEjF;EACAwB,iBAAQ,CAACC,MAAM,eACb,6BAAC,cAAK,CAAC,UAAU,qBACf,6BAAC,4BAAe;IAAC,KAAK;EAAsB,gBAC1C,6BAAC,0BAAa;IAAC,KAAK,EAAEH;EAAM,gBAC1B,6BAAC,UAAI;IAAON;EAAU,EAAM,CACd,CACA,CACD,EACnBF,QAAQ,CAACY,EAAE,CACZ;AACH,CAAC;AAED1C,MAAM,CAACC,KAAK,CAACS,IAAI,EAAE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mirai/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.16",
|
|
4
4
|
"source": "src/index.js",
|
|
5
5
|
"repository": "https://gitlab.com/miraicorp/dev/frontend/core",
|
|
6
6
|
"author": "JΛVI <hello@soyjavi.com>",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"scripts": {
|
|
9
9
|
"setup": "rm -rf node_modules && rm -rf yarn.lock && yarn install --force",
|
|
10
10
|
"start": "rm -rf dist && parcel public/index.html --port 8080 --host local.mirai.com --open",
|
|
11
|
-
"serve": "
|
|
11
|
+
"serve": "serve dist -p 8080 -u -n",
|
|
12
12
|
"build": "node scripts/build.js",
|
|
13
13
|
"build:pro": "node scripts/bundle.js",
|
|
14
14
|
"build:dev": "node scripts/bundle.js development",
|
|
@@ -72,5 +72,8 @@
|
|
|
72
72
|
"cssModules": {
|
|
73
73
|
"dashedIdents": true
|
|
74
74
|
}
|
|
75
|
+
},
|
|
76
|
+
"@parcel/transformer-js": {
|
|
77
|
+
"inlineEnvironment": true
|
|
75
78
|
}
|
|
76
79
|
}
|
package/public/index.html
CHANGED
|
@@ -37,11 +37,12 @@
|
|
|
37
37
|
</div>
|
|
38
38
|
<div data-mirai-component="bookingQuery"></div>
|
|
39
39
|
<div data-mirai-component="environment"></div>
|
|
40
|
-
|
|
40
|
+
<div data-mirai-component="state"></div>
|
|
41
41
|
</nav>
|
|
42
42
|
</header>
|
|
43
43
|
|
|
44
44
|
<section class="finder">
|
|
45
|
+
<!-- This ones are not in our repository> -->
|
|
45
46
|
<div data-mirai-component="finder"></div>
|
|
46
47
|
</section>
|
|
47
48
|
|
|
@@ -85,9 +86,6 @@
|
|
|
85
86
|
|
|
86
87
|
<section class="wrapper">
|
|
87
88
|
<!-- <div data-mirai-component="ghost"></div> -->
|
|
88
|
-
|
|
89
|
-
<!-- This ones are not in our repository> -->
|
|
90
|
-
<div data-mirai-component="fi_nder" data-id="10030559"></div>
|
|
91
89
|
</section>
|
|
92
90
|
|
|
93
91
|
<footer>
|