@variousjs/various 5.1.5 → 5.2.1
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/dist/index.dev.js +171 -254
- package/dist/index.dev.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/loader-dev.js +8 -2
- package/dist/loader-dev.js.map +1 -1
- package/dist/loader.js +1 -1
- package/dist/loader.js.map +1 -1
- package/dist/standalone.js +178 -265
- package/dist/standalone.js.map +1 -1
- package/index.d.ts +170 -78
- package/package.json +38 -33
- package/standalone.d.ts +27 -20
package/dist/standalone.js
CHANGED
|
@@ -2189,7 +2189,7 @@ var requirejs, require, define;
|
|
|
2189
2189
|
\***********************************************/
|
|
2190
2190
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
2191
2191
|
|
|
2192
|
-
!function(t,e){ true?module.exports=e(__webpack_require__(/*! react */ "react")):0}(self,
|
|
2192
|
+
!function(t,e){ true?module.exports=e(__webpack_require__(/*! react */ "react")):0}(self,t=>(()=>{"use strict";var e={17(t){t.exports=function t(e,r){if(e===r)return!0;if(e&&r&&"object"==typeof e&&"object"==typeof r){if(e.constructor!==r.constructor)return!1;var o,s,n;if(Array.isArray(e)){if((o=e.length)!=r.length)return!1;for(s=o;0!==s--;)if(!t(e[s],r[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if((o=(n=Object.keys(e)).length)!==Object.keys(r).length)return!1;for(s=o;0!==s--;)if(!Object.prototype.hasOwnProperty.call(r,n[s]))return!1;for(s=o;0!==s--;){var i=n[s];if(!t(e[i],r[i]))return!1}return!0}return e!=e&&r!=r}},232(t,e,r){r.d(e,{default:()=>u});var o=r(705),s=r(17),n=r.n(s);function i(t,e=new WeakMap){if("object"!=typeof t||null===t)return t;if(e.has(t))return e.get(t);const r=Array.isArray(t)?[]:{};e.set(t,r);const o=Reflect.ownKeys(t);for(const s of o)r[s]=i(t[s],e);return r}class u{constructor(){var t;(0,o.A)(this,"state",void 0),(0,o.A)(this,"listeners",void 0),(0,o.A)(this,"emits",void 0),(0,o.A)(this,"timer",void 0),(0,o.A)(this,"onStateChange",void 0),(0,o.A)(this,"getStore",void 0),(0,o.A)(this,"createStore",t=>{this.listeners=Reflect.ownKeys(t).reduce((e,r)=>{const o=r;return this.state[o]=t[o],{...e,[r]:[]}},{})}),(0,o.A)(this,"subscribe",t=>{const e={};return Reflect.ownKeys(t).forEach(r=>{const o=r;this.listeners[o]||(this.listeners[o]=[]),this.listeners[o].push(t[o]),e[o]=t[o]}),()=>{Reflect.ownKeys(e).forEach(t=>{const r=t;this.listeners[r]=this.listeners[r].filter(t=>t!==e[r])})}}),(0,o.A)(this,"emit",(t,e)=>{this.emits={...this.emits,...t},e?this.trigger():(clearTimeout(this.timer),this.timer=setTimeout(this.trigger))}),(0,o.A)(this,"dispatch",(t,...e)=>t({getStore:this.getStore,emit:t=>this.emit(t,!0)},...e)),(0,o.A)(this,"trigger",()=>{const t=this.emits,e=[],r=Reflect.ownKeys(t);for(let o=0;o<r.length;o+=1){const s=r[o];if(n()(this.state[s],t[s]))continue;const u=t[s],c=this.state[s];this.state[s]=i(t[s]),e.push({key:s,newValue:u,oldValue:c})}const o={};e.forEach(t=>{o[t.key]=[t.newValue,t.oldValue],this.listeners[t.key]&&this.listeners[t.key].forEach(e=>e(t.newValue,t.oldValue))}),e.length&&this.onStateChange(o),this.emits={},this.timer=void 0}),this.state={},this.listeners={},this.emits={},this.timer=void 0,this.onStateChange=()=>null,this.getStore=(t=this.state,function(e){return e?i(t[e]):t})}set onChange(t){this.onStateChange=t}}},438(e){e.exports=t},705(t,e,r){function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function s(t,e,r){return(e=function(t){var e=function(t){if("object"!=o(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==o(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}r.d(e,{A:()=>s})}},r={};function o(t){var s=r[t];if(void 0!==s)return s.exports;var n=r[t]={exports:{}};return e[t](n,n.exports,o),n.exports}o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},o.d=(t,e)=>{for(var r in e)o.o(e,r)&&!o.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var s={};o.d(s,{default:()=>l});var n=o(705),i=o(232),u=o(438),c=o.n(u);const a=["name","prototype","length","getDerivedStateFromProps","getDerivedStateFromError"];class f extends i.default{constructor(...t){super(...t),(0,n.A)(this,"connect",function(t){const{getStore:e,subscribe:r}=t;return function(...t){return function(o){class s extends u.Component{constructor(o){super(o),(0,n.A)(this,"unsubscribe",void 0),(0,n.A)(this,"state",{props:e()}),this.unsubscribe=r(t.reduce((t,r)=>({...t,[r]:()=>{this.setState({props:e()})}}),{}))}componentWillUnmount(){this.unsubscribe()}render(){const{props:t}=this.state,e={...t,...this.props};return c().createElement(o,e)}}return Reflect.ownKeys(o).forEach(t=>{const e=String(t);if(!a.includes(e)){const e=Object.getOwnPropertyDescriptor(o,t);e&&Object.defineProperty(s,t,e)}}),s}}}(this)),(0,n.A)(this,"useStore",function(t){const{getStore:e,subscribe:r}=t;return function(...t){const[o,s]=(0,u.useState)(e());return(0,u.useLayoutEffect)(()=>r(t.reduce((t,r)=>({...t,[r]:()=>{s(t=>({...t,[r]:e()[r]}))}}),{}))),o}}(this))}}const l=f;return s.default})());
|
|
2193
2193
|
//# sourceMappingURL=index.js.map
|
|
2194
2194
|
|
|
2195
2195
|
/***/ }),
|
|
@@ -2232,8 +2232,6 @@ const BASE_DEPENDENCIES = ['react', 'react-dom', '@variousjs/various', 'app'];
|
|
|
2232
2232
|
"use strict";
|
|
2233
2233
|
__webpack_require__.r(__webpack_exports__);
|
|
2234
2234
|
/* harmony import */ var _default_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./default-component */ "./src/core/default-component.tsx");
|
|
2235
|
-
/* harmony import */ var _helper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helper */ "./src/core/helper.ts");
|
|
2236
|
-
|
|
2237
2235
|
|
|
2238
2236
|
class Connector {
|
|
2239
2237
|
constructor() {
|
|
@@ -2250,16 +2248,14 @@ class Connector {
|
|
|
2250
2248
|
getMiddlewares() {
|
|
2251
2249
|
return this.middlewares;
|
|
2252
2250
|
}
|
|
2253
|
-
setI18nConfig(
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
...this.i18nConfigs[name],
|
|
2251
|
+
setI18nConfig(module, config) {
|
|
2252
|
+
this.i18nConfigs[module] = {
|
|
2253
|
+
...this.i18nConfigs[module],
|
|
2257
2254
|
...config
|
|
2258
2255
|
};
|
|
2259
2256
|
}
|
|
2260
|
-
getI18nConfig(
|
|
2261
|
-
|
|
2262
|
-
return this.i18nConfigs[name];
|
|
2257
|
+
getI18nConfig(module) {
|
|
2258
|
+
return this.i18nConfigs[module];
|
|
2263
2259
|
}
|
|
2264
2260
|
setGlobalI18nConfig(config) {
|
|
2265
2261
|
this.globalI18nConfig = {
|
|
@@ -2270,17 +2266,14 @@ class Connector {
|
|
|
2270
2266
|
getGlobalI18nConfig() {
|
|
2271
2267
|
return this.globalI18nConfig;
|
|
2272
2268
|
}
|
|
2273
|
-
setComponentActions(
|
|
2274
|
-
|
|
2275
|
-
this.componentActions[name] = actions;
|
|
2269
|
+
setComponentActions(module, actions) {
|
|
2270
|
+
this.componentActions[module] = actions;
|
|
2276
2271
|
}
|
|
2277
|
-
deleteComponentActions(
|
|
2278
|
-
|
|
2279
|
-
delete this.componentActions[name];
|
|
2272
|
+
deleteComponentActions(module) {
|
|
2273
|
+
delete this.componentActions[module];
|
|
2280
2274
|
}
|
|
2281
|
-
getComponentActions(
|
|
2282
|
-
|
|
2283
|
-
return this.componentActions[name];
|
|
2275
|
+
getComponentActions(module) {
|
|
2276
|
+
return this.componentActions[module];
|
|
2284
2277
|
}
|
|
2285
2278
|
setStoreActions(actions) {
|
|
2286
2279
|
this.storeActions = actions;
|
|
@@ -2324,13 +2317,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2324
2317
|
|
|
2325
2318
|
const createComponent = (config, storeKeys) => {
|
|
2326
2319
|
const {
|
|
2327
|
-
name,
|
|
2328
2320
|
module,
|
|
2329
2321
|
url,
|
|
2330
2322
|
type = 'react'
|
|
2331
2323
|
} = config;
|
|
2332
2324
|
const C = (type === 'vue3' ? _vue_component__WEBPACK_IMPORTED_MODULE_2__["default"] : _react_component__WEBPACK_IMPORTED_MODULE_1__["default"])({
|
|
2333
|
-
name,
|
|
2334
2325
|
module,
|
|
2335
2326
|
url,
|
|
2336
2327
|
watchKeys: storeKeys
|
|
@@ -2347,7 +2338,6 @@ const createComponent = (config, storeKeys) => {
|
|
|
2347
2338
|
$ref
|
|
2348
2339
|
};
|
|
2349
2340
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_error_boundary__WEBPACK_IMPORTED_MODULE_3__["default"], {
|
|
2350
|
-
name: name,
|
|
2351
2341
|
module: module,
|
|
2352
2342
|
url: url
|
|
2353
2343
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(C, nextProps));
|
|
@@ -2379,10 +2369,13 @@ const createModule = (config, logError = true) => {
|
|
|
2379
2369
|
const dependencies = (0,_store__WEBPACK_IMPORTED_MODULE_1__.getStore)(_config__WEBPACK_IMPORTED_MODULE_0__.DEPENDENCIES_KEY);
|
|
2380
2370
|
const middlewares = _connector__WEBPACK_IMPORTED_MODULE_2__["default"].getMiddlewares();
|
|
2381
2371
|
const {
|
|
2382
|
-
|
|
2383
|
-
module
|
|
2384
|
-
url
|
|
2372
|
+
url,
|
|
2373
|
+
module
|
|
2385
2374
|
} = config;
|
|
2375
|
+
const {
|
|
2376
|
+
name,
|
|
2377
|
+
entry
|
|
2378
|
+
} = (0,_helper__WEBPACK_IMPORTED_MODULE_3__.getModuleInfo)(module);
|
|
2386
2379
|
const loadStart = +new Date();
|
|
2387
2380
|
const logOnError = e => {
|
|
2388
2381
|
if (logError) {
|
|
@@ -2390,12 +2383,11 @@ const createModule = (config, logError = true) => {
|
|
|
2390
2383
|
}
|
|
2391
2384
|
};
|
|
2392
2385
|
if (url) {
|
|
2393
|
-
(0,_helper__WEBPACK_IMPORTED_MODULE_3__.resetDependencyConfig)(
|
|
2386
|
+
(0,_helper__WEBPACK_IMPORTED_MODULE_3__.resetDependencyConfig)(module, url);
|
|
2394
2387
|
}
|
|
2395
2388
|
return new Promise((resolve, reject) => {
|
|
2396
|
-
if (!url && !dependencies[name] && !(0,_helper__WEBPACK_IMPORTED_MODULE_3__.isModuleSpecified)(
|
|
2389
|
+
if (!url && !dependencies[name] && !(0,_helper__WEBPACK_IMPORTED_MODULE_3__.isModuleSpecified)(module)) {
|
|
2397
2390
|
const error = new _helper__WEBPACK_IMPORTED_MODULE_3__.VariousError({
|
|
2398
|
-
name,
|
|
2399
2391
|
module,
|
|
2400
2392
|
type: 'NOT_DEFINED',
|
|
2401
2393
|
originalError: new Error(`module "${name}" not defined`)
|
|
@@ -2407,34 +2399,31 @@ const createModule = (config, logError = true) => {
|
|
|
2407
2399
|
window.requirejs([name], C => {
|
|
2408
2400
|
const loadEnd = +new Date();
|
|
2409
2401
|
middlewares?.onLoad?.({
|
|
2410
|
-
name,
|
|
2411
2402
|
module,
|
|
2412
2403
|
loadStart,
|
|
2413
2404
|
loadEnd,
|
|
2414
|
-
beenLoaded: (0,_helper__WEBPACK_IMPORTED_MODULE_3__.isModuleLoaded)(
|
|
2405
|
+
beenLoaded: (0,_helper__WEBPACK_IMPORTED_MODULE_3__.isModuleLoaded)(module)
|
|
2415
2406
|
});
|
|
2416
2407
|
if (!C) {
|
|
2417
2408
|
const error = new _helper__WEBPACK_IMPORTED_MODULE_3__.VariousError({
|
|
2418
|
-
name,
|
|
2419
2409
|
module,
|
|
2420
2410
|
type: 'INVALID_MODULE',
|
|
2421
2411
|
originalError: new Error(`module "${name}" invalid`)
|
|
2422
2412
|
});
|
|
2423
|
-
(0,_helper__WEBPACK_IMPORTED_MODULE_3__.resetDependencyConfig)(
|
|
2413
|
+
(0,_helper__WEBPACK_IMPORTED_MODULE_3__.resetDependencyConfig)(module);
|
|
2424
2414
|
logOnError(error);
|
|
2425
2415
|
reject(error);
|
|
2426
2416
|
return;
|
|
2427
2417
|
}
|
|
2428
2418
|
const defaultModule = 'default' in C ? C.default : C;
|
|
2429
|
-
const actualModule = !
|
|
2430
|
-
if (actualModule === undefined &&
|
|
2419
|
+
const actualModule = !entry ? defaultModule : C[entry];
|
|
2420
|
+
if (actualModule === undefined && entry) {
|
|
2431
2421
|
const error = new _helper__WEBPACK_IMPORTED_MODULE_3__.VariousError({
|
|
2432
|
-
name,
|
|
2433
2422
|
module,
|
|
2434
2423
|
type: 'SUBMODULE_NOT_DEFINED',
|
|
2435
|
-
originalError: new Error(`submodule "${
|
|
2424
|
+
originalError: new Error(`submodule "${entry}" not defined`)
|
|
2436
2425
|
});
|
|
2437
|
-
(0,_helper__WEBPACK_IMPORTED_MODULE_3__.resetDependencyConfig)(
|
|
2426
|
+
(0,_helper__WEBPACK_IMPORTED_MODULE_3__.resetDependencyConfig)(module);
|
|
2438
2427
|
logOnError(error);
|
|
2439
2428
|
reject(error);
|
|
2440
2429
|
return;
|
|
@@ -2442,7 +2431,7 @@ const createModule = (config, logError = true) => {
|
|
|
2442
2431
|
resolve(actualModule);
|
|
2443
2432
|
}, e => {
|
|
2444
2433
|
const [requireModule] = e.requireModules;
|
|
2445
|
-
(0,_helper__WEBPACK_IMPORTED_MODULE_3__.resetDependencyConfig)(
|
|
2434
|
+
(0,_helper__WEBPACK_IMPORTED_MODULE_3__.resetDependencyConfig)(module, url);
|
|
2446
2435
|
(0,_helper__WEBPACK_IMPORTED_MODULE_3__.resetDependencyConfig)(requireModule);
|
|
2447
2436
|
let errorType = 'LOADING_ERROR';
|
|
2448
2437
|
if (requireModule !== name) {
|
|
@@ -2452,8 +2441,7 @@ const createModule = (config, logError = true) => {
|
|
|
2452
2441
|
errorType = requireModule === name ? 'SCRIPT_ERROR' : 'SUBMODULE_SCRIPT_ERROR';
|
|
2453
2442
|
}
|
|
2454
2443
|
const error = new _helper__WEBPACK_IMPORTED_MODULE_3__.VariousError({
|
|
2455
|
-
|
|
2456
|
-
module: requireModule === name ? undefined : requireModule,
|
|
2444
|
+
module: requireModule,
|
|
2457
2445
|
type: errorType,
|
|
2458
2446
|
originalError: e
|
|
2459
2447
|
});
|
|
@@ -2485,7 +2473,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2485
2473
|
|
|
2486
2474
|
|
|
2487
2475
|
const Fallback = props => {
|
|
2488
|
-
const className = (0,_helper__WEBPACK_IMPORTED_MODULE_1__.getClassNameWithModule)(props.$self, 'various-component-fallback');
|
|
2476
|
+
const className = (0,_helper__WEBPACK_IMPORTED_MODULE_1__.getClassNameWithModule)(props.$self.module, 'various-component-fallback');
|
|
2489
2477
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
|
2490
2478
|
className: className
|
|
2491
2479
|
}, "Loading");
|
|
@@ -2495,7 +2483,7 @@ const ErrorFallback = ({
|
|
|
2495
2483
|
$reload,
|
|
2496
2484
|
$self
|
|
2497
2485
|
}) => {
|
|
2498
|
-
const className = (0,_helper__WEBPACK_IMPORTED_MODULE_1__.getClassNameWithModule)($self, 'various-component-error_fallback');
|
|
2486
|
+
const className = (0,_helper__WEBPACK_IMPORTED_MODULE_1__.getClassNameWithModule)($self.module, 'various-component-error_fallback');
|
|
2499
2487
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
|
2500
2488
|
className: className
|
|
2501
2489
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("h3", null, $error.type), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", null, $error.message), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", {
|
|
@@ -2523,59 +2511,51 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2523
2511
|
|
|
2524
2512
|
|
|
2525
2513
|
|
|
2526
|
-
const createDispatch =
|
|
2514
|
+
const createDispatch = module => async function (params) {
|
|
2527
2515
|
const middlewares = _connector__WEBPACK_IMPORTED_MODULE_0__["default"].getMiddlewares();
|
|
2528
|
-
const logger = (0,_logger__WEBPACK_IMPORTED_MODULE_3__["default"])(
|
|
2516
|
+
const logger = (0,_logger__WEBPACK_IMPORTED_MODULE_3__["default"])(module);
|
|
2529
2517
|
let {
|
|
2530
|
-
name,
|
|
2531
|
-
module,
|
|
2532
2518
|
action,
|
|
2533
|
-
|
|
2519
|
+
payload,
|
|
2520
|
+
target
|
|
2534
2521
|
} = params;
|
|
2535
2522
|
if (middlewares?.onDispatch) {
|
|
2536
2523
|
const check = await middlewares.onDispatch({
|
|
2537
|
-
target
|
|
2538
|
-
name,
|
|
2539
|
-
module
|
|
2540
|
-
},
|
|
2524
|
+
target,
|
|
2541
2525
|
action,
|
|
2542
|
-
|
|
2543
|
-
trigger:
|
|
2526
|
+
payload,
|
|
2527
|
+
trigger: module
|
|
2544
2528
|
});
|
|
2545
2529
|
if (check === false) {
|
|
2546
2530
|
logger.warn('blocked by middleware', 'DISPATCH');
|
|
2547
2531
|
return Promise.resolve();
|
|
2548
2532
|
}
|
|
2549
2533
|
if (check !== true) {
|
|
2550
|
-
|
|
2551
|
-
module = check.target.module;
|
|
2534
|
+
target = check.target;
|
|
2552
2535
|
action = check.action;
|
|
2553
|
-
|
|
2536
|
+
payload = check.payload;
|
|
2554
2537
|
}
|
|
2555
2538
|
}
|
|
2556
|
-
if (
|
|
2539
|
+
if (target === 'app') {
|
|
2557
2540
|
const storeActions = _connector__WEBPACK_IMPORTED_MODULE_0__["default"].getStoreActions();
|
|
2558
2541
|
const storeAction = storeActions[action];
|
|
2559
2542
|
if (!storeAction) {
|
|
2560
2543
|
const errorMessage = `action "${action}" is not present`;
|
|
2561
2544
|
const error = new _helper__WEBPACK_IMPORTED_MODULE_2__.VariousError({
|
|
2562
|
-
|
|
2545
|
+
module,
|
|
2563
2546
|
type: 'DISPATCH',
|
|
2564
2547
|
originalError: new Error(errorMessage)
|
|
2565
2548
|
});
|
|
2566
2549
|
(0,_helper__WEBPACK_IMPORTED_MODULE_2__.onError)(error);
|
|
2567
2550
|
throw error;
|
|
2568
2551
|
}
|
|
2569
|
-
return (0,_store__WEBPACK_IMPORTED_MODULE_1__.dispatch)(storeAction,
|
|
2552
|
+
return (0,_store__WEBPACK_IMPORTED_MODULE_1__.dispatch)(storeAction, payload, module);
|
|
2570
2553
|
}
|
|
2571
|
-
const componentActions = _connector__WEBPACK_IMPORTED_MODULE_0__["default"].getComponentActions(
|
|
2572
|
-
name,
|
|
2573
|
-
module
|
|
2574
|
-
});
|
|
2554
|
+
const componentActions = _connector__WEBPACK_IMPORTED_MODULE_0__["default"].getComponentActions(target);
|
|
2575
2555
|
if (!componentActions) {
|
|
2576
2556
|
const errorMessage = 'component is not ready';
|
|
2577
2557
|
const error = new _helper__WEBPACK_IMPORTED_MODULE_2__.VariousError({
|
|
2578
|
-
|
|
2558
|
+
module,
|
|
2579
2559
|
type: 'DISPATCH',
|
|
2580
2560
|
originalError: new Error(errorMessage)
|
|
2581
2561
|
});
|
|
@@ -2586,14 +2566,17 @@ const createDispatch = moduleDefined => async function (params) {
|
|
|
2586
2566
|
if (!componentAction) {
|
|
2587
2567
|
const errorMessage = `action "${action}" is not present`;
|
|
2588
2568
|
const error = new _helper__WEBPACK_IMPORTED_MODULE_2__.VariousError({
|
|
2589
|
-
|
|
2569
|
+
module,
|
|
2590
2570
|
type: 'DISPATCH',
|
|
2591
2571
|
originalError: new Error(errorMessage)
|
|
2592
2572
|
});
|
|
2593
2573
|
(0,_helper__WEBPACK_IMPORTED_MODULE_2__.onError)(error);
|
|
2594
2574
|
throw error;
|
|
2595
2575
|
}
|
|
2596
|
-
return Promise.resolve(componentAction(
|
|
2576
|
+
return Promise.resolve(componentAction({
|
|
2577
|
+
payload,
|
|
2578
|
+
trigger: module
|
|
2579
|
+
}));
|
|
2597
2580
|
};
|
|
2598
2581
|
/* harmony default export */ __webpack_exports__["default"] = (createDispatch);
|
|
2599
2582
|
|
|
@@ -2623,13 +2606,11 @@ class ErrorBoundary extends react__WEBPACK_IMPORTED_MODULE_0__.Component {
|
|
|
2623
2606
|
};
|
|
2624
2607
|
componentDidCatch(e) {
|
|
2625
2608
|
const {
|
|
2626
|
-
name,
|
|
2627
2609
|
module
|
|
2628
2610
|
} = this.props;
|
|
2629
2611
|
const error = e instanceof _helper__WEBPACK_IMPORTED_MODULE_1__.VariousError ? e : new _helper__WEBPACK_IMPORTED_MODULE_1__.VariousError({
|
|
2630
|
-
name,
|
|
2631
2612
|
module,
|
|
2632
|
-
type:
|
|
2613
|
+
type: module === 'app' ? 'APP_ERROR' : 'SCRIPT_ERROR',
|
|
2633
2614
|
originalError: e
|
|
2634
2615
|
});
|
|
2635
2616
|
this.setState({
|
|
@@ -2637,11 +2618,8 @@ class ErrorBoundary extends react__WEBPACK_IMPORTED_MODULE_0__.Component {
|
|
|
2637
2618
|
});
|
|
2638
2619
|
this.error = error;
|
|
2639
2620
|
(0,_helper__WEBPACK_IMPORTED_MODULE_1__.onError)(error);
|
|
2640
|
-
(0,_helper__WEBPACK_IMPORTED_MODULE_1__.resetDependencyConfig)(
|
|
2641
|
-
(0,_helper__WEBPACK_IMPORTED_MODULE_1__.updateUnMountComponent)(
|
|
2642
|
-
name,
|
|
2643
|
-
module
|
|
2644
|
-
});
|
|
2621
|
+
(0,_helper__WEBPACK_IMPORTED_MODULE_1__.resetDependencyConfig)(module);
|
|
2622
|
+
(0,_helper__WEBPACK_IMPORTED_MODULE_1__.updateUnMountComponent)(module);
|
|
2645
2623
|
}
|
|
2646
2624
|
$self = (0,_helper__WEBPACK_IMPORTED_MODULE_1__.getSelfInfo)(this.props);
|
|
2647
2625
|
reload = () => {
|
|
@@ -2683,8 +2661,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2683
2661
|
/* harmony export */ defineDependencies: function() { return /* binding */ defineDependencies; },
|
|
2684
2662
|
/* harmony export */ getClassNameWithModule: function() { return /* binding */ getClassNameWithModule; },
|
|
2685
2663
|
/* harmony export */ getConfig: function() { return /* binding */ getConfig; },
|
|
2664
|
+
/* harmony export */ getModuleInfo: function() { return /* binding */ getModuleInfo; },
|
|
2686
2665
|
/* harmony export */ getMountedComponents: function() { return /* binding */ getMountedComponents; },
|
|
2687
|
-
/* harmony export */ getNameWithModule: function() { return /* binding */ getNameWithModule; },
|
|
2688
2666
|
/* harmony export */ getSelfInfo: function() { return /* binding */ getSelfInfo; },
|
|
2689
2667
|
/* harmony export */ isModuleLoaded: function() { return /* binding */ isModuleLoaded; },
|
|
2690
2668
|
/* harmony export */ isModuleSpecified: function() { return /* binding */ isModuleSpecified; },
|
|
@@ -2711,12 +2689,22 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2711
2689
|
|
|
2712
2690
|
|
|
2713
2691
|
const getUrlHash = url => `${url}?${+new Date()}`;
|
|
2714
|
-
const
|
|
2715
|
-
const
|
|
2692
|
+
const getModuleInfo = module => {
|
|
2693
|
+
const [name, entry] = module.split('.');
|
|
2694
|
+
return {
|
|
2695
|
+
name,
|
|
2696
|
+
entry
|
|
2697
|
+
};
|
|
2698
|
+
};
|
|
2699
|
+
const preloadModules = modules => new Promise((resolve, reject) => {
|
|
2700
|
+
const names = modules.map(m => getModuleInfo(m).name);
|
|
2716
2701
|
window.requirejs(names, resolve, reject);
|
|
2717
2702
|
});
|
|
2718
|
-
const removeLoadedModules =
|
|
2719
|
-
|
|
2703
|
+
const removeLoadedModules = modules => {
|
|
2704
|
+
modules.forEach(module => {
|
|
2705
|
+
const {
|
|
2706
|
+
name
|
|
2707
|
+
} = getModuleInfo(module);
|
|
2720
2708
|
if (!_config__WEBPACK_IMPORTED_MODULE_2__.BASE_DEPENDENCIES.includes(name)) {
|
|
2721
2709
|
window.requirejs.undef(name);
|
|
2722
2710
|
}
|
|
@@ -2741,18 +2729,27 @@ const defineDependencies = deps => {
|
|
|
2741
2729
|
}
|
|
2742
2730
|
}, true);
|
|
2743
2731
|
};
|
|
2744
|
-
const isModuleLoaded =
|
|
2745
|
-
const
|
|
2732
|
+
const isModuleLoaded = module => {
|
|
2733
|
+
const {
|
|
2734
|
+
name
|
|
2735
|
+
} = getModuleInfo(module);
|
|
2736
|
+
return window.requirejs.defined(name);
|
|
2737
|
+
};
|
|
2738
|
+
const isModuleSpecified = module => {
|
|
2739
|
+
const {
|
|
2740
|
+
name
|
|
2741
|
+
} = getModuleInfo(module);
|
|
2742
|
+
return window.requirejs.specified(name);
|
|
2743
|
+
};
|
|
2746
2744
|
const getMountedComponents = () => (0,_store__WEBPACK_IMPORTED_MODULE_0__.getStore)(_config__WEBPACK_IMPORTED_MODULE_2__.MOUNTED_COMPONENTS_KEY);
|
|
2747
2745
|
const onComponentMounted = (module, callback) => {
|
|
2748
2746
|
const modules = Array.isArray(module) ? module : [module];
|
|
2749
|
-
if (modules.every(m =>
|
|
2747
|
+
if (modules.every(m => getMountedComponents().includes(m))) {
|
|
2750
2748
|
callback();
|
|
2751
2749
|
}
|
|
2752
2750
|
const unSubscribe = (0,_store__WEBPACK_IMPORTED_MODULE_0__.subscribe)({
|
|
2753
2751
|
[_config__WEBPACK_IMPORTED_MODULE_2__.MOUNTED_COMPONENTS_KEY](value) {
|
|
2754
|
-
|
|
2755
|
-
if (modules.every(n => hasModule(mountedModules, n))) {
|
|
2752
|
+
if (modules.every(n => value.includes(n))) {
|
|
2756
2753
|
unSubscribe();
|
|
2757
2754
|
callback();
|
|
2758
2755
|
}
|
|
@@ -2760,7 +2757,10 @@ const onComponentMounted = (module, callback) => {
|
|
|
2760
2757
|
});
|
|
2761
2758
|
return unSubscribe;
|
|
2762
2759
|
};
|
|
2763
|
-
const resetDependencyConfig = (
|
|
2760
|
+
const resetDependencyConfig = (module, url) => {
|
|
2761
|
+
const {
|
|
2762
|
+
name
|
|
2763
|
+
} = getModuleInfo(module);
|
|
2764
2764
|
const dependencies = (0,_store__WEBPACK_IMPORTED_MODULE_0__.getStore)(_config__WEBPACK_IMPORTED_MODULE_2__.DEPENDENCIES_KEY);
|
|
2765
2765
|
|
|
2766
2766
|
// ignore multiple custom module url
|
|
@@ -2786,26 +2786,15 @@ const resetDependencyConfig = (name, url) => {
|
|
|
2786
2786
|
}
|
|
2787
2787
|
});
|
|
2788
2788
|
};
|
|
2789
|
-
const getNameWithModule = moduleDefined => {
|
|
2790
|
-
const {
|
|
2791
|
-
name,
|
|
2792
|
-
module
|
|
2793
|
-
} = moduleDefined;
|
|
2794
|
-
return module ? `${name}.${module}` : name;
|
|
2795
|
-
};
|
|
2796
2789
|
function getConfig() {
|
|
2797
2790
|
return (0,_store__WEBPACK_IMPORTED_MODULE_0__.getStore)(_config__WEBPACK_IMPORTED_MODULE_2__.CONFIG_KEY);
|
|
2798
2791
|
}
|
|
2799
2792
|
const onError = e => {
|
|
2800
2793
|
const {
|
|
2801
|
-
name,
|
|
2802
2794
|
module,
|
|
2803
2795
|
type
|
|
2804
2796
|
} = e;
|
|
2805
|
-
const logger = (0,_logger__WEBPACK_IMPORTED_MODULE_1__["default"])(
|
|
2806
|
-
name,
|
|
2807
|
-
module
|
|
2808
|
-
});
|
|
2797
|
+
const logger = (0,_logger__WEBPACK_IMPORTED_MODULE_1__["default"])(module);
|
|
2809
2798
|
logger.error(e, type);
|
|
2810
2799
|
};
|
|
2811
2800
|
class VariousError extends Error {
|
|
@@ -2814,17 +2803,16 @@ class VariousError extends Error {
|
|
|
2814
2803
|
this.type = data.type;
|
|
2815
2804
|
this.originalError = data.originalError;
|
|
2816
2805
|
this.module = data.module;
|
|
2817
|
-
this.name = data.name;
|
|
2818
2806
|
}
|
|
2819
2807
|
}
|
|
2820
|
-
function checkReactComponent(component,
|
|
2808
|
+
function checkReactComponent(component, module) {
|
|
2821
2809
|
return new Promise((reslove, reject) => {
|
|
2822
2810
|
if (component.$$typeof || component.prototype?.isReactComponent || typeof component === 'function') {
|
|
2823
2811
|
reslove();
|
|
2824
2812
|
return;
|
|
2825
2813
|
}
|
|
2826
2814
|
reject(new VariousError({
|
|
2827
|
-
|
|
2815
|
+
module,
|
|
2828
2816
|
originalError: new Error('not a valid React component'),
|
|
2829
2817
|
type: 'INVALID_COMPONENT'
|
|
2830
2818
|
}));
|
|
@@ -2833,7 +2821,7 @@ function checkReactComponent(component, moduleDefined) {
|
|
|
2833
2821
|
function isPromiseLike(value) {
|
|
2834
2822
|
return value != null && typeof value.then === 'function';
|
|
2835
2823
|
}
|
|
2836
|
-
function checkVueComponent(component,
|
|
2824
|
+
function checkVueComponent(component, module) {
|
|
2837
2825
|
const versionRegex = new RegExp(`^${_config__WEBPACK_IMPORTED_MODULE_2__.VUE_VERSION}\\.`);
|
|
2838
2826
|
return new Promise((resolve, reject) => {
|
|
2839
2827
|
window.requirejs(['vue'], Vue => {
|
|
@@ -2845,7 +2833,7 @@ function checkVueComponent(component, moduleDefined) {
|
|
|
2845
2833
|
return;
|
|
2846
2834
|
}
|
|
2847
2835
|
reject(new VariousError({
|
|
2848
|
-
|
|
2836
|
+
module,
|
|
2849
2837
|
originalError: new Error('not a valid Vue component'),
|
|
2850
2838
|
type: 'INVALID_COMPONENT'
|
|
2851
2839
|
}));
|
|
@@ -2855,7 +2843,6 @@ function checkVueComponent(component, moduleDefined) {
|
|
|
2855
2843
|
function parseComponentActions(params) {
|
|
2856
2844
|
const {
|
|
2857
2845
|
componentNode,
|
|
2858
|
-
name,
|
|
2859
2846
|
module,
|
|
2860
2847
|
type,
|
|
2861
2848
|
i18nUpdate
|
|
@@ -2881,66 +2868,51 @@ function parseComponentActions(params) {
|
|
|
2881
2868
|
actions[method] = componentNode[method];
|
|
2882
2869
|
});
|
|
2883
2870
|
if (i18nAction) {
|
|
2884
|
-
(0,_i18n__WEBPACK_IMPORTED_MODULE_5__.createI18nConfig)(i18nAction,
|
|
2885
|
-
name,
|
|
2886
|
-
module
|
|
2887
|
-
}, i18nUpdate);
|
|
2871
|
+
(0,_i18n__WEBPACK_IMPORTED_MODULE_5__.createI18nConfig)(i18nAction, module, i18nUpdate);
|
|
2888
2872
|
}
|
|
2889
|
-
_connector__WEBPACK_IMPORTED_MODULE_3__["default"].setComponentActions(
|
|
2890
|
-
name,
|
|
2891
|
-
module
|
|
2892
|
-
}, actions);
|
|
2873
|
+
_connector__WEBPACK_IMPORTED_MODULE_3__["default"].setComponentActions(module, actions);
|
|
2893
2874
|
if (onMessageAction) {
|
|
2894
|
-
return (0,_message__WEBPACK_IMPORTED_MODULE_4__.createOnMessage)(
|
|
2895
|
-
name,
|
|
2896
|
-
module
|
|
2897
|
-
}, onMessageAction);
|
|
2875
|
+
return (0,_message__WEBPACK_IMPORTED_MODULE_4__.createOnMessage)(module, onMessageAction);
|
|
2898
2876
|
}
|
|
2899
2877
|
return () => null;
|
|
2900
2878
|
}
|
|
2901
|
-
function updateMountedComponent(
|
|
2879
|
+
function updateMountedComponent(module) {
|
|
2902
2880
|
const mountedComponents = getMountedComponents();
|
|
2903
|
-
if (!
|
|
2904
|
-
mountedComponents.push(
|
|
2881
|
+
if (!mountedComponents.includes(module)) {
|
|
2882
|
+
mountedComponents.push(module);
|
|
2905
2883
|
}
|
|
2906
2884
|
(0,_store__WEBPACK_IMPORTED_MODULE_0__.emit)({
|
|
2907
2885
|
[_config__WEBPACK_IMPORTED_MODULE_2__.MOUNTED_COMPONENTS_KEY]: mountedComponents
|
|
2908
2886
|
}, true);
|
|
2909
2887
|
}
|
|
2910
|
-
function updateUnMountComponent(
|
|
2911
|
-
const {
|
|
2912
|
-
name,
|
|
2913
|
-
module
|
|
2914
|
-
} = moduleDefined;
|
|
2888
|
+
function updateUnMountComponent(module) {
|
|
2915
2889
|
let mountedComponents = getMountedComponents();
|
|
2916
|
-
mountedComponents = mountedComponents.filter(item => item
|
|
2890
|
+
mountedComponents = mountedComponents.filter(item => item !== module);
|
|
2917
2891
|
(0,_store__WEBPACK_IMPORTED_MODULE_0__.emit)({
|
|
2918
2892
|
[_config__WEBPACK_IMPORTED_MODULE_2__.MOUNTED_COMPONENTS_KEY]: mountedComponents
|
|
2919
2893
|
}, true);
|
|
2920
|
-
_connector__WEBPACK_IMPORTED_MODULE_3__["default"].deleteComponentActions(
|
|
2921
|
-
name,
|
|
2922
|
-
module
|
|
2923
|
-
});
|
|
2894
|
+
_connector__WEBPACK_IMPORTED_MODULE_3__["default"].deleteComponentActions(module);
|
|
2924
2895
|
}
|
|
2925
2896
|
function getSelfInfo(params) {
|
|
2926
2897
|
const {
|
|
2927
|
-
name,
|
|
2928
2898
|
module,
|
|
2929
2899
|
url
|
|
2930
2900
|
} = params;
|
|
2931
2901
|
const dependencies = (0,_store__WEBPACK_IMPORTED_MODULE_0__.getStore)(_config__WEBPACK_IMPORTED_MODULE_2__.DEPENDENCIES_KEY);
|
|
2902
|
+
const {
|
|
2903
|
+
name
|
|
2904
|
+
} = getModuleInfo(module);
|
|
2932
2905
|
return {
|
|
2933
|
-
name,
|
|
2934
2906
|
module,
|
|
2935
2907
|
url: url || dependencies[name]
|
|
2936
2908
|
};
|
|
2937
2909
|
}
|
|
2938
|
-
function getClassNameWithModule(
|
|
2910
|
+
function getClassNameWithModule(module, prefix) {
|
|
2939
2911
|
const {
|
|
2940
2912
|
name,
|
|
2941
|
-
|
|
2942
|
-
} =
|
|
2943
|
-
return `${prefix} ${[name,
|
|
2913
|
+
entry
|
|
2914
|
+
} = getModuleInfo(module);
|
|
2915
|
+
return `${prefix} ${[name, entry].filter(Boolean).join('-')}`;
|
|
2944
2916
|
}
|
|
2945
2917
|
|
|
2946
2918
|
/***/ }),
|
|
@@ -2963,21 +2935,21 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2963
2935
|
|
|
2964
2936
|
|
|
2965
2937
|
|
|
2966
|
-
function createI18nConfig(method,
|
|
2938
|
+
function createI18nConfig(method, module, callback) {
|
|
2967
2939
|
if (!method) {
|
|
2968
2940
|
return;
|
|
2969
2941
|
}
|
|
2970
2942
|
const i18nConfig = method();
|
|
2971
2943
|
if (!(0,_helper__WEBPACK_IMPORTED_MODULE_1__.isPromiseLike)(i18nConfig)) {
|
|
2972
|
-
if (
|
|
2973
|
-
_connector__WEBPACK_IMPORTED_MODULE_0__["default"].setI18nConfig(
|
|
2944
|
+
if (module) {
|
|
2945
|
+
_connector__WEBPACK_IMPORTED_MODULE_0__["default"].setI18nConfig(module, i18nConfig);
|
|
2974
2946
|
} else {
|
|
2975
2947
|
_connector__WEBPACK_IMPORTED_MODULE_0__["default"].setGlobalI18nConfig(i18nConfig);
|
|
2976
2948
|
}
|
|
2977
2949
|
return;
|
|
2978
2950
|
}
|
|
2979
|
-
if (
|
|
2980
|
-
_connector__WEBPACK_IMPORTED_MODULE_0__["default"].setI18nConfig(
|
|
2951
|
+
if (module) {
|
|
2952
|
+
_connector__WEBPACK_IMPORTED_MODULE_0__["default"].setI18nConfig(module, {
|
|
2981
2953
|
loading: true,
|
|
2982
2954
|
lngStoreKey: '',
|
|
2983
2955
|
resources: {}
|
|
@@ -2990,8 +2962,8 @@ function createI18nConfig(method, moduleDefined, callback) {
|
|
|
2990
2962
|
});
|
|
2991
2963
|
}
|
|
2992
2964
|
i18nConfig.then(res => {
|
|
2993
|
-
if (
|
|
2994
|
-
_connector__WEBPACK_IMPORTED_MODULE_0__["default"].setI18nConfig(
|
|
2965
|
+
if (module) {
|
|
2966
|
+
_connector__WEBPACK_IMPORTED_MODULE_0__["default"].setI18nConfig(module, {
|
|
2995
2967
|
...res,
|
|
2996
2968
|
loading: false
|
|
2997
2969
|
});
|
|
@@ -3011,23 +2983,22 @@ function createI18nConfig(method, moduleDefined, callback) {
|
|
|
3011
2983
|
});
|
|
3012
2984
|
}).catch(e => {
|
|
3013
2985
|
(0,_helper__WEBPACK_IMPORTED_MODULE_1__.onError)(new _helper__WEBPACK_IMPORTED_MODULE_1__.VariousError({
|
|
3014
|
-
|
|
3015
|
-
module: moduleDefined?.module,
|
|
2986
|
+
module: module || 'app',
|
|
3016
2987
|
type: 'I18N',
|
|
3017
2988
|
originalError: e
|
|
3018
2989
|
}));
|
|
3019
2990
|
});
|
|
3020
2991
|
}
|
|
3021
|
-
function createI18n(
|
|
2992
|
+
function createI18n(module, updater) {
|
|
3022
2993
|
const ctx = (key, params, defaultString) => {
|
|
3023
|
-
const i18nConfig = _connector__WEBPACK_IMPORTED_MODULE_0__["default"].getI18nConfig(
|
|
2994
|
+
const i18nConfig = _connector__WEBPACK_IMPORTED_MODULE_0__["default"].getI18nConfig(module) || _connector__WEBPACK_IMPORTED_MODULE_0__["default"].getGlobalI18nConfig();
|
|
3024
2995
|
let defaultText = defaultString;
|
|
3025
2996
|
if (defaultText === undefined) {
|
|
3026
2997
|
defaultText = typeof params === 'string' ? params : key;
|
|
3027
2998
|
}
|
|
3028
2999
|
if (!i18nConfig) {
|
|
3029
3000
|
(0,_helper__WEBPACK_IMPORTED_MODULE_1__.onError)(new _helper__WEBPACK_IMPORTED_MODULE_1__.VariousError({
|
|
3030
|
-
|
|
3001
|
+
module,
|
|
3031
3002
|
type: 'I18N',
|
|
3032
3003
|
originalError: new Error('config not exist')
|
|
3033
3004
|
}));
|
|
@@ -3043,7 +3014,7 @@ function createI18n(moduleDefined, updater) {
|
|
|
3043
3014
|
const locale = (0,_store__WEBPACK_IMPORTED_MODULE_2__.getStore)(lngStoreKey);
|
|
3044
3015
|
if (lngStoreKey === undefined || locale === undefined) {
|
|
3045
3016
|
(0,_helper__WEBPACK_IMPORTED_MODULE_1__.onError)(new _helper__WEBPACK_IMPORTED_MODULE_1__.VariousError({
|
|
3046
|
-
|
|
3017
|
+
module,
|
|
3047
3018
|
type: 'I18N',
|
|
3048
3019
|
originalError: new Error('locale key not defined')
|
|
3049
3020
|
}));
|
|
@@ -3052,7 +3023,7 @@ function createI18n(moduleDefined, updater) {
|
|
|
3052
3023
|
const resource = resources?.[locale];
|
|
3053
3024
|
if (!resource) {
|
|
3054
3025
|
(0,_helper__WEBPACK_IMPORTED_MODULE_1__.onError)(new _helper__WEBPACK_IMPORTED_MODULE_1__.VariousError({
|
|
3055
|
-
|
|
3026
|
+
module,
|
|
3056
3027
|
type: 'I18N',
|
|
3057
3028
|
originalError: new Error(`locale resource \`${locale}\` not exist`)
|
|
3058
3029
|
}));
|
|
@@ -3060,7 +3031,7 @@ function createI18n(moduleDefined, updater) {
|
|
|
3060
3031
|
}
|
|
3061
3032
|
if (!resource[key]) {
|
|
3062
3033
|
(0,_helper__WEBPACK_IMPORTED_MODULE_1__.onError)(new _helper__WEBPACK_IMPORTED_MODULE_1__.VariousError({
|
|
3063
|
-
|
|
3034
|
+
module,
|
|
3064
3035
|
type: 'I18N',
|
|
3065
3036
|
originalError: new Error(`locale key \`${key}\` not exist`)
|
|
3066
3037
|
}));
|
|
@@ -3080,7 +3051,7 @@ function createI18n(moduleDefined, updater) {
|
|
|
3080
3051
|
}, text);
|
|
3081
3052
|
};
|
|
3082
3053
|
ctx.update = (config, type) => {
|
|
3083
|
-
const i18nConfig = type === 'app' ? _connector__WEBPACK_IMPORTED_MODULE_0__["default"].getGlobalI18nConfig() : _connector__WEBPACK_IMPORTED_MODULE_0__["default"].getI18nConfig(
|
|
3054
|
+
const i18nConfig = type === 'app' ? _connector__WEBPACK_IMPORTED_MODULE_0__["default"].getGlobalI18nConfig() : _connector__WEBPACK_IMPORTED_MODULE_0__["default"].getI18nConfig(module);
|
|
3084
3055
|
const next = {
|
|
3085
3056
|
...i18nConfig,
|
|
3086
3057
|
...config
|
|
@@ -3088,7 +3059,7 @@ function createI18n(moduleDefined, updater) {
|
|
|
3088
3059
|
if (type === 'app') {
|
|
3089
3060
|
_connector__WEBPACK_IMPORTED_MODULE_0__["default"].setGlobalI18nConfig(next);
|
|
3090
3061
|
} else {
|
|
3091
|
-
_connector__WEBPACK_IMPORTED_MODULE_0__["default"].setI18nConfig(
|
|
3062
|
+
_connector__WEBPACK_IMPORTED_MODULE_0__["default"].setI18nConfig(module, next);
|
|
3092
3063
|
}
|
|
3093
3064
|
updater();
|
|
3094
3065
|
};
|
|
@@ -3115,6 +3086,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3115
3086
|
/* harmony export */ defineDependencies: function() { return /* reexport safe */ _helper__WEBPACK_IMPORTED_MODULE_11__.defineDependencies; },
|
|
3116
3087
|
/* harmony export */ getApp: function() { return /* binding */ getApp; },
|
|
3117
3088
|
/* harmony export */ getConfig: function() { return /* reexport safe */ _helper__WEBPACK_IMPORTED_MODULE_11__.getConfig; },
|
|
3089
|
+
/* harmony export */ getModuleInfo: function() { return /* reexport safe */ _helper__WEBPACK_IMPORTED_MODULE_11__.getModuleInfo; },
|
|
3118
3090
|
/* harmony export */ getMountedComponents: function() { return /* reexport safe */ _helper__WEBPACK_IMPORTED_MODULE_11__.getMountedComponents; },
|
|
3119
3091
|
/* harmony export */ getStore: function() { return /* reexport safe */ _store__WEBPACK_IMPORTED_MODULE_1__.getUserStore; },
|
|
3120
3092
|
/* harmony export */ isModuleLoaded: function() { return /* reexport safe */ _helper__WEBPACK_IMPORTED_MODULE_11__.isModuleLoaded; },
|
|
@@ -3159,7 +3131,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3159
3131
|
|
|
3160
3132
|
|
|
3161
3133
|
// eslint-disable-next-line no-undef
|
|
3162
|
-
const version = "5.1
|
|
3134
|
+
const version = "5.2.1";
|
|
3163
3135
|
const getApp = config => {
|
|
3164
3136
|
const {
|
|
3165
3137
|
dependencies,
|
|
@@ -3197,7 +3169,7 @@ const getApp = config => {
|
|
|
3197
3169
|
}
|
|
3198
3170
|
render() {
|
|
3199
3171
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_error_boundary__WEBPACK_IMPORTED_MODULE_6__["default"], {
|
|
3200
|
-
|
|
3172
|
+
module: "app",
|
|
3201
3173
|
url: dependencies.app
|
|
3202
3174
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Root, null));
|
|
3203
3175
|
}
|
|
@@ -3230,7 +3202,7 @@ const logger = args => {
|
|
|
3230
3202
|
error: 'red'
|
|
3231
3203
|
};
|
|
3232
3204
|
const color = colorMap[args.level];
|
|
3233
|
-
const params = [`%c ${
|
|
3205
|
+
const params = [`%c ${args.module} `, `background:${color};border:1px solid ${color};padding:1px;border-radius:2px 0 0 2px;color: #fff;`];
|
|
3234
3206
|
if (args.type) {
|
|
3235
3207
|
params[0] = `${params[0]}%c ${args.type} %c`;
|
|
3236
3208
|
params.push(`border:1px solid ${color};padding:1px;border-radius:0 2px 2px 0;color:${color};`, 'background:transparent');
|
|
@@ -3240,10 +3212,10 @@ const logger = args => {
|
|
|
3240
3212
|
}
|
|
3241
3213
|
window.console[args.level](...params, args.message);
|
|
3242
3214
|
};
|
|
3243
|
-
const createLogger =
|
|
3215
|
+
const createLogger = module => ({
|
|
3244
3216
|
info(message, type) {
|
|
3245
3217
|
logger({
|
|
3246
|
-
|
|
3218
|
+
module,
|
|
3247
3219
|
level: 'info',
|
|
3248
3220
|
type,
|
|
3249
3221
|
message
|
|
@@ -3251,7 +3223,7 @@ const createLogger = moduleDefined => ({
|
|
|
3251
3223
|
},
|
|
3252
3224
|
warn(message, type) {
|
|
3253
3225
|
logger({
|
|
3254
|
-
|
|
3226
|
+
module,
|
|
3255
3227
|
level: 'warn',
|
|
3256
3228
|
type,
|
|
3257
3229
|
message
|
|
@@ -3260,13 +3232,13 @@ const createLogger = moduleDefined => ({
|
|
|
3260
3232
|
error(message, type) {
|
|
3261
3233
|
const middlewares = _connector__WEBPACK_IMPORTED_MODULE_0__["default"].getMiddlewares();
|
|
3262
3234
|
const error = message instanceof _helper__WEBPACK_IMPORTED_MODULE_1__.VariousError ? message : new _helper__WEBPACK_IMPORTED_MODULE_1__.VariousError({
|
|
3263
|
-
|
|
3235
|
+
module,
|
|
3264
3236
|
type: type || 'unknow',
|
|
3265
3237
|
originalError: message instanceof Error ? message : new Error(message)
|
|
3266
3238
|
});
|
|
3267
3239
|
middlewares?.onError?.(error);
|
|
3268
3240
|
logger({
|
|
3269
|
-
|
|
3241
|
+
module,
|
|
3270
3242
|
level: 'error',
|
|
3271
3243
|
type,
|
|
3272
3244
|
message
|
|
@@ -3297,13 +3269,16 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3297
3269
|
|
|
3298
3270
|
|
|
3299
3271
|
|
|
3300
|
-
const createPostMessage =
|
|
3272
|
+
const createPostMessage = module => async ({
|
|
3273
|
+
event,
|
|
3274
|
+
payload
|
|
3275
|
+
}) => {
|
|
3301
3276
|
const middlewares = _connector__WEBPACK_IMPORTED_MODULE_0__["default"].getMiddlewares();
|
|
3302
|
-
const logger = (0,_logger__WEBPACK_IMPORTED_MODULE_1__["default"])(
|
|
3277
|
+
const logger = (0,_logger__WEBPACK_IMPORTED_MODULE_1__["default"])(module);
|
|
3303
3278
|
let next = {
|
|
3304
|
-
trigger:
|
|
3279
|
+
trigger: module,
|
|
3305
3280
|
event,
|
|
3306
|
-
|
|
3281
|
+
payload
|
|
3307
3282
|
};
|
|
3308
3283
|
if (middlewares?.onMessage) {
|
|
3309
3284
|
const check = await middlewares.onMessage(next);
|
|
@@ -3322,22 +3297,22 @@ const createPostMessage = moduleDefined => async (event, value) => {
|
|
|
3322
3297
|
[_config__WEBPACK_IMPORTED_MODULE_3__.MESSAGE_KEY]: {
|
|
3323
3298
|
timestamp: +new Date(),
|
|
3324
3299
|
event: next.event,
|
|
3325
|
-
trigger:
|
|
3326
|
-
|
|
3300
|
+
trigger: module,
|
|
3301
|
+
payload: next.payload
|
|
3327
3302
|
}
|
|
3328
3303
|
});
|
|
3329
3304
|
};
|
|
3330
|
-
const createOnMessage = (
|
|
3305
|
+
const createOnMessage = (module, onMessage) => (0,_store__WEBPACK_IMPORTED_MODULE_2__.subscribe)({
|
|
3331
3306
|
[_config__WEBPACK_IMPORTED_MODULE_3__.MESSAGE_KEY](v) {
|
|
3332
3307
|
const {
|
|
3333
3308
|
trigger,
|
|
3334
|
-
|
|
3309
|
+
payload,
|
|
3335
3310
|
event
|
|
3336
3311
|
} = v;
|
|
3337
|
-
if (
|
|
3312
|
+
if (module !== trigger) {
|
|
3338
3313
|
onMessage({
|
|
3339
3314
|
event,
|
|
3340
|
-
|
|
3315
|
+
payload,
|
|
3341
3316
|
trigger
|
|
3342
3317
|
});
|
|
3343
3318
|
}
|
|
@@ -3377,7 +3352,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3377
3352
|
|
|
3378
3353
|
function reactComponent(config) {
|
|
3379
3354
|
const {
|
|
3380
|
-
name,
|
|
3381
3355
|
module,
|
|
3382
3356
|
url,
|
|
3383
3357
|
watchKeys,
|
|
@@ -3400,36 +3374,22 @@ function reactComponent(config) {
|
|
|
3400
3374
|
this.ComponentNode = null;
|
|
3401
3375
|
this.isUnMounted = true;
|
|
3402
3376
|
this.unSubscribeMessage();
|
|
3403
|
-
(0,_helper__WEBPACK_IMPORTED_MODULE_2__.updateUnMountComponent)(
|
|
3404
|
-
name,
|
|
3405
|
-
module
|
|
3406
|
-
});
|
|
3377
|
+
(0,_helper__WEBPACK_IMPORTED_MODULE_2__.updateUnMountComponent)(module);
|
|
3407
3378
|
}
|
|
3408
3379
|
mountComponent = async () => {
|
|
3409
3380
|
try {
|
|
3410
3381
|
const componentNode = await (0,_create_module__WEBPACK_IMPORTED_MODULE_9__["default"])({
|
|
3411
|
-
name,
|
|
3412
3382
|
module,
|
|
3413
3383
|
url
|
|
3414
3384
|
}, false);
|
|
3415
3385
|
if (this.isUnMounted) {
|
|
3416
3386
|
return;
|
|
3417
3387
|
}
|
|
3418
|
-
await (0,_helper__WEBPACK_IMPORTED_MODULE_2__.checkReactComponent)(componentNode,
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
});
|
|
3422
|
-
componentNode.displayName = (0,_helper__WEBPACK_IMPORTED_MODULE_2__.getNameWithModule)({
|
|
3423
|
-
name,
|
|
3424
|
-
module
|
|
3425
|
-
});
|
|
3426
|
-
(0,_helper__WEBPACK_IMPORTED_MODULE_2__.updateMountedComponent)({
|
|
3427
|
-
name,
|
|
3428
|
-
module
|
|
3429
|
-
});
|
|
3388
|
+
await (0,_helper__WEBPACK_IMPORTED_MODULE_2__.checkReactComponent)(componentNode, module);
|
|
3389
|
+
componentNode.displayName = module;
|
|
3390
|
+
(0,_helper__WEBPACK_IMPORTED_MODULE_2__.updateMountedComponent)(module);
|
|
3430
3391
|
this.unSubscribeMessage = (0,_helper__WEBPACK_IMPORTED_MODULE_2__.parseComponentActions)({
|
|
3431
3392
|
componentNode,
|
|
3432
|
-
name,
|
|
3433
3393
|
module,
|
|
3434
3394
|
i18nUpdate: () => this.forceUpdate()
|
|
3435
3395
|
});
|
|
@@ -3449,24 +3409,11 @@ function reactComponent(config) {
|
|
|
3449
3409
|
});
|
|
3450
3410
|
}
|
|
3451
3411
|
};
|
|
3452
|
-
$postMessage = (0,_message__WEBPACK_IMPORTED_MODULE_5__.createPostMessage)(
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
$dispatch = (0,_dispatch__WEBPACK_IMPORTED_MODULE_6__["default"])({
|
|
3457
|
-
name,
|
|
3458
|
-
module
|
|
3459
|
-
});
|
|
3460
|
-
$t = (0,_i18n__WEBPACK_IMPORTED_MODULE_8__.createI18n)({
|
|
3461
|
-
name,
|
|
3462
|
-
module
|
|
3463
|
-
}, () => this.forceUpdate());
|
|
3464
|
-
$logger = (0,_logger__WEBPACK_IMPORTED_MODULE_7__["default"])({
|
|
3465
|
-
name,
|
|
3466
|
-
module
|
|
3467
|
-
});
|
|
3412
|
+
$postMessage = (0,_message__WEBPACK_IMPORTED_MODULE_5__.createPostMessage)(module);
|
|
3413
|
+
$dispatch = (0,_dispatch__WEBPACK_IMPORTED_MODULE_6__["default"])(module);
|
|
3414
|
+
$t = (0,_i18n__WEBPACK_IMPORTED_MODULE_8__.createI18n)(module, () => this.forceUpdate());
|
|
3415
|
+
$logger = (0,_logger__WEBPACK_IMPORTED_MODULE_7__["default"])(module);
|
|
3468
3416
|
$self = (0,_helper__WEBPACK_IMPORTED_MODULE_2__.getSelfInfo)({
|
|
3469
|
-
name,
|
|
3470
3417
|
module,
|
|
3471
3418
|
url
|
|
3472
3419
|
});
|
|
@@ -3487,7 +3434,7 @@ function reactComponent(config) {
|
|
|
3487
3434
|
throw this.error;
|
|
3488
3435
|
}
|
|
3489
3436
|
if (!componentReady) {
|
|
3490
|
-
if ($silent || (0,_helper__WEBPACK_IMPORTED_MODULE_2__.isModuleLoaded)(
|
|
3437
|
+
if ($silent || (0,_helper__WEBPACK_IMPORTED_MODULE_2__.isModuleLoaded)(module)) {
|
|
3491
3438
|
return null;
|
|
3492
3439
|
}
|
|
3493
3440
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(Fallback, {
|
|
@@ -3536,7 +3483,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3536
3483
|
|
|
3537
3484
|
|
|
3538
3485
|
const renderComponent = async ({
|
|
3539
|
-
name,
|
|
3540
3486
|
module,
|
|
3541
3487
|
url,
|
|
3542
3488
|
target,
|
|
@@ -3547,10 +3493,9 @@ const renderComponent = async ({
|
|
|
3547
3493
|
}) => {
|
|
3548
3494
|
try {
|
|
3549
3495
|
const ReactDOM = await (0,_create_module__WEBPACK_IMPORTED_MODULE_5__["default"])({
|
|
3550
|
-
|
|
3496
|
+
module: 'react-dom'
|
|
3551
3497
|
});
|
|
3552
3498
|
const C = (type === 'vue3' ? _vue_component__WEBPACK_IMPORTED_MODULE_2__["default"] : _react_component__WEBPACK_IMPORTED_MODULE_1__["default"])({
|
|
3553
|
-
name,
|
|
3554
3499
|
module,
|
|
3555
3500
|
url,
|
|
3556
3501
|
onMounted
|
|
@@ -3567,7 +3512,6 @@ const renderComponent = async ({
|
|
|
3567
3512
|
$ref
|
|
3568
3513
|
};
|
|
3569
3514
|
const node = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_error_boundary__WEBPACK_IMPORTED_MODULE_4__["default"], {
|
|
3570
|
-
name: name,
|
|
3571
3515
|
module: module,
|
|
3572
3516
|
url: url
|
|
3573
3517
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(C, nextProps));
|
|
@@ -3580,7 +3524,6 @@ const renderComponent = async ({
|
|
|
3580
3524
|
});
|
|
3581
3525
|
} catch (e) {
|
|
3582
3526
|
const error = new _helper__WEBPACK_IMPORTED_MODULE_3__.VariousError({
|
|
3583
|
-
name,
|
|
3584
3527
|
module,
|
|
3585
3528
|
type: 'SCRIPT_ERROR',
|
|
3586
3529
|
originalError: e
|
|
@@ -3664,7 +3607,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3664
3607
|
|
|
3665
3608
|
function vueComponent(config) {
|
|
3666
3609
|
const {
|
|
3667
|
-
name,
|
|
3668
3610
|
module,
|
|
3669
3611
|
url,
|
|
3670
3612
|
watchKeys,
|
|
@@ -3680,7 +3622,6 @@ function vueComponent(config) {
|
|
|
3680
3622
|
const isUnMountedRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(false);
|
|
3681
3623
|
const ComponentNodeRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
|
|
3682
3624
|
const selfRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)((0,_helper__WEBPACK_IMPORTED_MODULE_4__.getSelfInfo)({
|
|
3683
|
-
name,
|
|
3684
3625
|
module,
|
|
3685
3626
|
url
|
|
3686
3627
|
}));
|
|
@@ -3698,22 +3639,10 @@ function vueComponent(config) {
|
|
|
3698
3639
|
$componentProps
|
|
3699
3640
|
} = props;
|
|
3700
3641
|
const mountVue = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {
|
|
3701
|
-
const $logger = (0,_logger__WEBPACK_IMPORTED_MODULE_6__["default"])(
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
const $dispatch = (0,_dispatch__WEBPACK_IMPORTED_MODULE_5__["default"])({
|
|
3706
|
-
name,
|
|
3707
|
-
module
|
|
3708
|
-
});
|
|
3709
|
-
const $postMessage = (0,_message__WEBPACK_IMPORTED_MODULE_7__.createPostMessage)({
|
|
3710
|
-
name,
|
|
3711
|
-
module
|
|
3712
|
-
});
|
|
3713
|
-
const $t = (0,_i18n__WEBPACK_IMPORTED_MODULE_8__.createI18n)({
|
|
3714
|
-
name,
|
|
3715
|
-
module
|
|
3716
|
-
}, () => {
|
|
3642
|
+
const $logger = (0,_logger__WEBPACK_IMPORTED_MODULE_6__["default"])(module);
|
|
3643
|
+
const $dispatch = (0,_dispatch__WEBPACK_IMPORTED_MODULE_5__["default"])(module);
|
|
3644
|
+
const $postMessage = (0,_message__WEBPACK_IMPORTED_MODULE_7__.createPostMessage)(module);
|
|
3645
|
+
const $t = (0,_i18n__WEBPACK_IMPORTED_MODULE_8__.createI18n)(module, () => {
|
|
3717
3646
|
updateVueComponentRef.current?.();
|
|
3718
3647
|
});
|
|
3719
3648
|
propsReactiveRef.current = vueRef.current.ref({
|
|
@@ -3736,7 +3665,6 @@ function vueComponent(config) {
|
|
|
3736
3665
|
const error = e;
|
|
3737
3666
|
errorRef.current = error.message?.includes('https://react') ? new _helper__WEBPACK_IMPORTED_MODULE_4__.VariousError({
|
|
3738
3667
|
originalError: new Error('not a valid Vue component'),
|
|
3739
|
-
name,
|
|
3740
3668
|
module,
|
|
3741
3669
|
type: 'INVALID_COMPONENT'
|
|
3742
3670
|
}) : error;
|
|
@@ -3769,28 +3697,20 @@ function vueComponent(config) {
|
|
|
3769
3697
|
const mountComponent = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(async () => {
|
|
3770
3698
|
try {
|
|
3771
3699
|
const vue = await (0,_create_module__WEBPACK_IMPORTED_MODULE_2__["default"])({
|
|
3772
|
-
|
|
3700
|
+
module: 'vue'
|
|
3773
3701
|
});
|
|
3774
3702
|
vueRef.current = vue;
|
|
3775
3703
|
const componentNode = await (0,_create_module__WEBPACK_IMPORTED_MODULE_2__["default"])({
|
|
3776
|
-
name,
|
|
3777
3704
|
module,
|
|
3778
3705
|
url
|
|
3779
3706
|
}, false);
|
|
3780
3707
|
if (isUnMountedRef.current) {
|
|
3781
3708
|
return;
|
|
3782
3709
|
}
|
|
3783
|
-
await (0,_helper__WEBPACK_IMPORTED_MODULE_4__.checkVueComponent)(componentNode,
|
|
3784
|
-
|
|
3785
|
-
module
|
|
3786
|
-
});
|
|
3787
|
-
(0,_helper__WEBPACK_IMPORTED_MODULE_4__.updateMountedComponent)({
|
|
3788
|
-
name,
|
|
3789
|
-
module
|
|
3790
|
-
});
|
|
3710
|
+
await (0,_helper__WEBPACK_IMPORTED_MODULE_4__.checkVueComponent)(componentNode, module);
|
|
3711
|
+
(0,_helper__WEBPACK_IMPORTED_MODULE_4__.updateMountedComponent)(module);
|
|
3791
3712
|
unSubscribeMessageRef.current = (0,_helper__WEBPACK_IMPORTED_MODULE_4__.parseComponentActions)({
|
|
3792
3713
|
componentNode,
|
|
3793
|
-
name,
|
|
3794
3714
|
module,
|
|
3795
3715
|
type: 'vue3',
|
|
3796
3716
|
i18nUpdate() {
|
|
@@ -3817,10 +3737,7 @@ function vueComponent(config) {
|
|
|
3817
3737
|
errorRef.current = undefined;
|
|
3818
3738
|
ComponentNodeRef.current = undefined;
|
|
3819
3739
|
isUnMountedRef.current = true;
|
|
3820
|
-
(0,_helper__WEBPACK_IMPORTED_MODULE_4__.updateUnMountComponent)(
|
|
3821
|
-
name,
|
|
3822
|
-
module
|
|
3823
|
-
});
|
|
3740
|
+
(0,_helper__WEBPACK_IMPORTED_MODULE_4__.updateUnMountComponent)(module);
|
|
3824
3741
|
unMountVue.current?.();
|
|
3825
3742
|
unSubscribeMessageRef.current?.();
|
|
3826
3743
|
isVueMounted.current = false;
|
|
@@ -3849,21 +3766,15 @@ function vueComponent(config) {
|
|
|
3849
3766
|
if (isError) {
|
|
3850
3767
|
throw errorRef.current;
|
|
3851
3768
|
}
|
|
3852
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, !componentReady && !$silent && !(0,_helper__WEBPACK_IMPORTED_MODULE_4__.isModuleLoaded)(
|
|
3769
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, !componentReady && !$silent && !(0,_helper__WEBPACK_IMPORTED_MODULE_4__.isModuleLoaded)(module) ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Fallback, {
|
|
3853
3770
|
$self: selfRef.current,
|
|
3854
3771
|
$store: store
|
|
3855
3772
|
}) : null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
|
3856
|
-
className: (0,_helper__WEBPACK_IMPORTED_MODULE_4__.getClassNameWithModule)(
|
|
3857
|
-
name,
|
|
3858
|
-
module
|
|
3859
|
-
}, 'various-vue-component'),
|
|
3773
|
+
className: (0,_helper__WEBPACK_IMPORTED_MODULE_4__.getClassNameWithModule)(module, 'various-vue-component'),
|
|
3860
3774
|
ref: containerDivRef
|
|
3861
3775
|
}));
|
|
3862
3776
|
};
|
|
3863
|
-
V.displayName =
|
|
3864
|
-
name,
|
|
3865
|
-
module
|
|
3866
|
-
});
|
|
3777
|
+
V.displayName = module;
|
|
3867
3778
|
const VueComponent = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(V, props);
|
|
3868
3779
|
VueComponent.displayName = 'various-vue-component';
|
|
3869
3780
|
return VueComponent;
|
|
@@ -3927,19 +3838,19 @@ function defineModules(deps) {
|
|
|
3927
3838
|
const createAppConfig = config => {
|
|
3928
3839
|
const {
|
|
3929
3840
|
dependencies,
|
|
3930
|
-
|
|
3931
|
-
|
|
3841
|
+
ErrorFallback,
|
|
3842
|
+
Fallback,
|
|
3932
3843
|
store,
|
|
3933
3844
|
actions
|
|
3934
3845
|
} = config;
|
|
3935
3846
|
(0,_core_store__WEBPACK_IMPORTED_MODULE_1__.emit)({
|
|
3936
3847
|
[_core_config__WEBPACK_IMPORTED_MODULE_2__.STANDALONE_CONFIG_READY]: false
|
|
3937
3848
|
}, true);
|
|
3938
|
-
if (
|
|
3939
|
-
_core_connector__WEBPACK_IMPORTED_MODULE_3__["default"].setErrorFallbackComponent(
|
|
3849
|
+
if (ErrorFallback) {
|
|
3850
|
+
_core_connector__WEBPACK_IMPORTED_MODULE_3__["default"].setErrorFallbackComponent(ErrorFallback);
|
|
3940
3851
|
}
|
|
3941
|
-
if (
|
|
3942
|
-
_core_connector__WEBPACK_IMPORTED_MODULE_3__["default"].setFallbackComponent(
|
|
3852
|
+
if (Fallback) {
|
|
3853
|
+
_core_connector__WEBPACK_IMPORTED_MODULE_3__["default"].setFallbackComponent(Fallback);
|
|
3943
3854
|
}
|
|
3944
3855
|
if (actions) {
|
|
3945
3856
|
_core_connector__WEBPACK_IMPORTED_MODULE_3__["default"].setStoreActions(actions);
|
|
@@ -3979,6 +3890,12 @@ module.exports = require("react");
|
|
|
3979
3890
|
/******/ if (cachedModule !== undefined) {
|
|
3980
3891
|
/******/ return cachedModule.exports;
|
|
3981
3892
|
/******/ }
|
|
3893
|
+
/******/ // Check if module exists (development only)
|
|
3894
|
+
/******/ if (__webpack_modules__[moduleId] === undefined) {
|
|
3895
|
+
/******/ var e = new Error("Cannot find module '" + moduleId + "'");
|
|
3896
|
+
/******/ e.code = 'MODULE_NOT_FOUND';
|
|
3897
|
+
/******/ throw e;
|
|
3898
|
+
/******/ }
|
|
3982
3899
|
/******/ // Create a new module (and put it into the cache)
|
|
3983
3900
|
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
3984
3901
|
/******/ // no module.id needed
|
|
@@ -4085,7 +4002,6 @@ const Standalone = props => {
|
|
|
4085
4002
|
const {
|
|
4086
4003
|
dependencies,
|
|
4087
4004
|
url,
|
|
4088
|
-
name,
|
|
4089
4005
|
module,
|
|
4090
4006
|
type,
|
|
4091
4007
|
$componentProps,
|
|
@@ -4098,19 +4014,17 @@ const Standalone = props => {
|
|
|
4098
4014
|
(0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
|
|
4099
4015
|
(0,_helper__WEBPACK_IMPORTED_MODULE_6__.defineModules)(dependencies || {}).then(() => {
|
|
4100
4016
|
componentNode.current = (0,_core_create_component__WEBPACK_IMPORTED_MODULE_3__["default"])({
|
|
4101
|
-
name,
|
|
4102
4017
|
module,
|
|
4103
4018
|
url,
|
|
4104
4019
|
type
|
|
4105
4020
|
}, storeKeys);
|
|
4106
4021
|
setComponentReady(true);
|
|
4107
4022
|
});
|
|
4108
|
-
}, [
|
|
4023
|
+
}, [url, module, dependencies, type, storeKeys]);
|
|
4109
4024
|
if (!componentReady || store[_core_config__WEBPACK_IMPORTED_MODULE_8__.STANDALONE_CONFIG_READY] === false) {
|
|
4110
4025
|
const FallBack = _core_connector__WEBPACK_IMPORTED_MODULE_5__["default"].getFallbackComponent();
|
|
4111
4026
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(FallBack, {
|
|
4112
4027
|
$self: {
|
|
4113
|
-
name,
|
|
4114
4028
|
module,
|
|
4115
4029
|
url
|
|
4116
4030
|
},
|
|
@@ -4125,7 +4039,6 @@ const Standalone = props => {
|
|
|
4125
4039
|
Standalone.displayName = 'various-standalone';
|
|
4126
4040
|
const createComponent = args => {
|
|
4127
4041
|
const component = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_core_error_boundary__WEBPACK_IMPORTED_MODULE_4__["default"], {
|
|
4128
|
-
name: "standalone",
|
|
4129
4042
|
url: args.url,
|
|
4130
4043
|
module: args.module
|
|
4131
4044
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(Standalone, (0,_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
|