sample-cross-fx 0.14.8-beta.3504 → 0.14.8-beta.3513
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/app/{index.b43df5.js → index.922e4d.js} +268 -116
- package/app/{index.b43df5.js.map → index.922e4d.js.map} +1 -1
- package/app/index.d.ts +4 -0
- package/app/index.html +1 -1
- package/app/index.js +1 -1
- package/files.tar +0 -0
- package/files_once.tar +0 -0
- package/package.json +1 -1
|
@@ -129479,8 +129479,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
129479
129479
|
/* harmony import */ var _createInstance__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./createInstance */ "../../framework/piral-core/esm/createInstance.js");
|
|
129480
129480
|
/* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./components */ "../../framework/piral-core/esm/components/ResponsiveLayout.js");
|
|
129481
129481
|
/* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./components */ "../../framework/piral-core/esm/components/Mediator.js");
|
|
129482
|
-
/* harmony import */ var
|
|
129483
|
-
/* harmony import */ var
|
|
129482
|
+
/* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./components */ "../../framework/piral-core/esm/components/PiralView.js");
|
|
129483
|
+
/* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./components */ "../../framework/piral-core/esm/components/PortalRenderer.js");
|
|
129484
|
+
/* harmony import */ var _RootListener__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./RootListener */ "../../framework/piral-core/esm/RootListener.js");
|
|
129485
|
+
|
|
129484
129486
|
|
|
129485
129487
|
|
|
129486
129488
|
|
|
@@ -129512,13 +129514,56 @@ const Piral = ({
|
|
|
129512
129514
|
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components__WEBPACK_IMPORTED_MODULE_4__.Mediator, {
|
|
129513
129515
|
options: instance.options,
|
|
129514
129516
|
key: instance.id
|
|
129515
|
-
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
|
129517
|
+
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_RootListener__WEBPACK_IMPORTED_MODULE_5__.RootListener, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components__WEBPACK_IMPORTED_MODULE_6__.PiralView, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components__WEBPACK_IMPORTED_MODULE_7__.PortalRenderer, {
|
|
129516
129518
|
id: "root"
|
|
129517
129519
|
}), children));
|
|
129518
129520
|
Piral.displayName = 'Piral';
|
|
129519
129521
|
|
|
129520
129522
|
/***/ }),
|
|
129521
129523
|
|
|
129524
|
+
/***/ "../../framework/piral-core/esm/RootListener.js":
|
|
129525
|
+
/*!******************************************************!*\
|
|
129526
|
+
!*** ../../framework/piral-core/esm/RootListener.js ***!
|
|
129527
|
+
\******************************************************/
|
|
129528
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
129529
|
+
|
|
129530
|
+
"use strict";
|
|
129531
|
+
__webpack_require__.r(__webpack_exports__);
|
|
129532
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
129533
|
+
/* harmony export */ "RootListener": () => (/* binding */ RootListener)
|
|
129534
|
+
/* harmony export */ });
|
|
129535
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../../../node_modules/react/index.js");
|
|
129536
|
+
/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! . */ "../../framework/piral-core/esm/hooks/globalState.js");
|
|
129537
|
+
/* harmony import */ var _modules__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./modules */ "../../framework/piral-core/esm/modules/element.js");
|
|
129538
|
+
|
|
129539
|
+
|
|
129540
|
+
|
|
129541
|
+
const RootListener = () => {
|
|
129542
|
+
const context = (0,___WEBPACK_IMPORTED_MODULE_1__.useGlobalStateContext)();
|
|
129543
|
+
react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect(() => {
|
|
129544
|
+
if (typeof document !== 'undefined') {
|
|
129545
|
+
const handler = ev => {
|
|
129546
|
+
ev.stopPropagation();
|
|
129547
|
+
const {
|
|
129548
|
+
target,
|
|
129549
|
+
props
|
|
129550
|
+
} = ev.detail;
|
|
129551
|
+
const [dispose, update] = (0,_modules__WEBPACK_IMPORTED_MODULE_2__.renderElement)(context, target, props);
|
|
129552
|
+
target.dispose = dispose;
|
|
129553
|
+
target.update = update;
|
|
129554
|
+
};
|
|
129555
|
+
|
|
129556
|
+
document.body.addEventListener('render-html', handler, false);
|
|
129557
|
+
return () => {
|
|
129558
|
+
document.body.removeEventListener('render-html', handler, false);
|
|
129559
|
+
};
|
|
129560
|
+
}
|
|
129561
|
+
}, [context]);
|
|
129562
|
+
return null;
|
|
129563
|
+
};
|
|
129564
|
+
|
|
129565
|
+
/***/ }),
|
|
129566
|
+
|
|
129522
129567
|
/***/ "../../framework/piral-core/esm/actions/app.js":
|
|
129523
129568
|
/*!*****************************************************!*\
|
|
129524
129569
|
!*** ../../framework/piral-core/esm/actions/app.js ***!
|
|
@@ -130021,7 +130066,8 @@ function ExtensionSlot(props) {
|
|
|
130021
130066
|
name,
|
|
130022
130067
|
render = _utils__WEBPACK_IMPORTED_MODULE_1__.defaultRender,
|
|
130023
130068
|
empty,
|
|
130024
|
-
params
|
|
130069
|
+
params,
|
|
130070
|
+
children
|
|
130025
130071
|
} = props;
|
|
130026
130072
|
const extensions = (0,_hooks__WEBPACK_IMPORTED_MODULE_2__.useGlobalState)(s => s.registry.extensions[name] || _utils__WEBPACK_IMPORTED_MODULE_3__.none);
|
|
130027
130073
|
return render(extensions.length === 0 && (0,piral_base__WEBPACK_IMPORTED_MODULE_4__.isfunc)(empty) ? [(0,_utils__WEBPACK_IMPORTED_MODULE_1__.defaultRender)(empty(), 'empty')] : extensions.map(({
|
|
@@ -130030,6 +130076,7 @@ function ExtensionSlot(props) {
|
|
|
130030
130076
|
defaults = {}
|
|
130031
130077
|
}, i) => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(Component, {
|
|
130032
130078
|
key: `${(reference === null || reference === void 0 ? void 0 : reference.displayName) || '_'}${i}`,
|
|
130079
|
+
children: children,
|
|
130033
130080
|
params: Object.assign(Object.assign({}, defaults), params || {})
|
|
130034
130081
|
})));
|
|
130035
130082
|
}
|
|
@@ -130764,7 +130811,7 @@ function createInstance(config = {}) {
|
|
|
130764
130811
|
const createApi = apiFactory(context, usedPlugins);
|
|
130765
130812
|
const root = createApi({
|
|
130766
130813
|
name: 'root',
|
|
130767
|
-
version: "0.14.8-beta.
|
|
130814
|
+
version: "0.14.8-beta.3513" || 0,
|
|
130768
130815
|
spec: ''
|
|
130769
130816
|
});
|
|
130770
130817
|
const options = (0,_helpers__WEBPACK_IMPORTED_MODULE_6__.createPiletOptions)({
|
|
@@ -131159,6 +131206,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
131159
131206
|
/* harmony export */ "noop": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_6__.noop),
|
|
131160
131207
|
/* harmony export */ "prependItem": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_6__.prependItem),
|
|
131161
131208
|
/* harmony export */ "prependItems": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_6__.prependItems),
|
|
131209
|
+
/* harmony export */ "reactifyContent": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_6__.reactifyContent),
|
|
131162
131210
|
/* harmony export */ "removeIndicator": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_6__.removeIndicator),
|
|
131163
131211
|
/* harmony export */ "removeNested": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_6__.removeNested),
|
|
131164
131212
|
/* harmony export */ "renderInDom": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_6__.renderInDom),
|
|
@@ -131205,102 +131253,59 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
131205
131253
|
"use strict";
|
|
131206
131254
|
__webpack_require__.r(__webpack_exports__);
|
|
131207
131255
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
131208
|
-
/* harmony export */ "createCoreApi": () => (/* binding */ createCoreApi),
|
|
131209
131256
|
/* harmony export */ "createExtenders": () => (/* binding */ createExtenders),
|
|
131210
131257
|
/* harmony export */ "defaultApiFactory": () => (/* binding */ defaultApiFactory)
|
|
131211
131258
|
/* harmony export */ });
|
|
131212
|
-
/* harmony import */ var
|
|
131213
|
-
/* harmony import */ var
|
|
131214
|
-
/* harmony import */ var
|
|
131215
|
-
/* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../components */ "../../framework/piral-core/esm/components/ExtensionSlot.js");
|
|
131216
|
-
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ "../../framework/piral-core/esm/utils/helpers.js");
|
|
131217
|
-
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils */ "../../framework/piral-core/esm/utils/foreign.js");
|
|
131218
|
-
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils */ "../../framework/piral-core/esm/utils/data.js");
|
|
131219
|
-
|
|
131220
|
-
|
|
131221
|
-
|
|
131222
|
-
|
|
131223
|
-
|
|
131224
|
-
if (typeof window !== 'undefined' && 'customElements' in window) {
|
|
131225
|
-
class PiralExtension extends HTMLElement {
|
|
131226
|
-
constructor() {
|
|
131227
|
-
super(...arguments);
|
|
131228
|
-
this.dispose = _utils__WEBPACK_IMPORTED_MODULE_0__.noop;
|
|
131229
|
-
this.update = _utils__WEBPACK_IMPORTED_MODULE_0__.noop;
|
|
131230
|
-
}
|
|
131231
|
-
|
|
131232
|
-
getProps() {
|
|
131233
|
-
const name = this.getAttribute('name');
|
|
131234
|
-
const params = (0,_utils__WEBPACK_IMPORTED_MODULE_0__.tryParseJson)(this.getAttribute('params'));
|
|
131235
|
-
return {
|
|
131236
|
-
name,
|
|
131237
|
-
params
|
|
131238
|
-
};
|
|
131239
|
-
}
|
|
131240
|
-
|
|
131241
|
-
connectedCallback() {
|
|
131242
|
-
if (this.isConnected) {
|
|
131243
|
-
this.dispatchEvent(new CustomEvent('render-html', {
|
|
131244
|
-
bubbles: true,
|
|
131245
|
-
detail: {
|
|
131246
|
-
target: this,
|
|
131247
|
-
props: this.getProps()
|
|
131248
|
-
}
|
|
131249
|
-
}));
|
|
131250
|
-
}
|
|
131251
|
-
}
|
|
131259
|
+
/* harmony import */ var piral_base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! piral-base */ "../../framework/piral-base/esm/utils.js");
|
|
131260
|
+
/* harmony import */ var piral_base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! piral-base */ "../../framework/piral-base/esm/api.js");
|
|
131261
|
+
/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./core */ "../../framework/piral-core/esm/modules/core.js");
|
|
131252
131262
|
|
|
131253
|
-
disconnectedCallback() {
|
|
131254
|
-
this.dispose();
|
|
131255
|
-
this.dispose = _utils__WEBPACK_IMPORTED_MODULE_0__.noop;
|
|
131256
|
-
this.update = _utils__WEBPACK_IMPORTED_MODULE_0__.noop;
|
|
131257
|
-
}
|
|
131258
131263
|
|
|
131259
|
-
|
|
131260
|
-
|
|
131261
|
-
|
|
131264
|
+
function createExtenders(context, apis) {
|
|
131265
|
+
const creators = [_core__WEBPACK_IMPORTED_MODULE_0__.createCoreApi, ...apis.filter(piral_base__WEBPACK_IMPORTED_MODULE_1__.isfunc)];
|
|
131266
|
+
return creators.map(c => {
|
|
131267
|
+
const ctx = c(context);
|
|
131262
131268
|
|
|
131263
|
-
|
|
131264
|
-
return
|
|
131269
|
+
if ((0,piral_base__WEBPACK_IMPORTED_MODULE_1__.isfunc)(ctx)) {
|
|
131270
|
+
return ctx;
|
|
131271
|
+
} else {
|
|
131272
|
+
return () => Object.assign({}, ctx);
|
|
131265
131273
|
}
|
|
131266
|
-
|
|
131267
|
-
|
|
131268
|
-
|
|
131269
|
-
|
|
131274
|
+
});
|
|
131275
|
+
}
|
|
131276
|
+
function defaultApiFactory(context, apis) {
|
|
131277
|
+
const extenders = createExtenders(context, apis);
|
|
131278
|
+
return target => {
|
|
131279
|
+
const api = (0,piral_base__WEBPACK_IMPORTED_MODULE_2__.initializeApi)(target, context);
|
|
131280
|
+
context.apis[target.name] = api;
|
|
131281
|
+
return (0,piral_base__WEBPACK_IMPORTED_MODULE_2__.mergeApis)(api, extenders, target);
|
|
131282
|
+
};
|
|
131270
131283
|
}
|
|
131271
131284
|
|
|
131272
|
-
|
|
131273
|
-
let [id, portal] = (0,_utils__WEBPACK_IMPORTED_MODULE_1__.renderInDom)(context, element, _components__WEBPACK_IMPORTED_MODULE_2__.ExtensionSlot, props);
|
|
131274
|
-
const evName = 'extension-props-changed';
|
|
131285
|
+
/***/ }),
|
|
131275
131286
|
|
|
131276
|
-
|
|
131287
|
+
/***/ "../../framework/piral-core/esm/modules/core.js":
|
|
131288
|
+
/*!******************************************************!*\
|
|
131289
|
+
!*** ../../framework/piral-core/esm/modules/core.js ***!
|
|
131290
|
+
\******************************************************/
|
|
131291
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
131277
131292
|
|
|
131278
|
-
|
|
131279
|
-
|
|
131280
|
-
|
|
131281
|
-
|
|
131293
|
+
"use strict";
|
|
131294
|
+
__webpack_require__.r(__webpack_exports__);
|
|
131295
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
131296
|
+
/* harmony export */ "createCoreApi": () => (/* binding */ createCoreApi)
|
|
131297
|
+
/* harmony export */ });
|
|
131298
|
+
/* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./element */ "../../framework/piral-core/esm/modules/element.js");
|
|
131299
|
+
/* harmony import */ var _state__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../state */ "../../framework/piral-core/esm/state/withApi.js");
|
|
131300
|
+
/* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../components */ "../../framework/piral-core/esm/components/ExtensionSlot.js");
|
|
131301
|
+
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ "../../framework/piral-core/esm/utils/data.js");
|
|
131282
131302
|
|
|
131283
|
-
const update = newProps => {
|
|
131284
|
-
[id, portal] = (0,_utils__WEBPACK_IMPORTED_MODULE_1__.changeDomPortal)(id, portal, context, element, _components__WEBPACK_IMPORTED_MODULE_2__.ExtensionSlot, newProps);
|
|
131285
|
-
};
|
|
131286
131303
|
|
|
131287
|
-
element.addEventListener(evName, handler);
|
|
131288
|
-
return [dispose, update];
|
|
131289
|
-
}
|
|
131290
131304
|
|
|
131291
|
-
function createCoreApi(context) {
|
|
131292
|
-
if (typeof document !== 'undefined') {
|
|
131293
|
-
document.body.addEventListener('render-html', ev => {
|
|
131294
|
-
ev.stopPropagation();
|
|
131295
|
-
const container = ev.detail.target;
|
|
131296
|
-
const [dispose, update] = render(context, container, ev.detail.props);
|
|
131297
|
-
container.dispose = dispose;
|
|
131298
|
-
container.update = update;
|
|
131299
|
-
}, false);
|
|
131300
|
-
}
|
|
131301
131305
|
|
|
131302
|
-
|
|
131303
|
-
|
|
131306
|
+
function createCoreApi(context) {
|
|
131307
|
+
return (api, meta) => {
|
|
131308
|
+
const pilet = meta.name;
|
|
131304
131309
|
return {
|
|
131305
131310
|
getData(name) {
|
|
131306
131311
|
return context.readDataValue(name);
|
|
@@ -131310,8 +131315,8 @@ function createCoreApi(context) {
|
|
|
131310
131315
|
const {
|
|
131311
131316
|
target = 'memory',
|
|
131312
131317
|
expires
|
|
131313
|
-
} = (0,
|
|
131314
|
-
const expiration = (0,
|
|
131318
|
+
} = (0,_utils__WEBPACK_IMPORTED_MODULE_0__.createDataOptions)(options);
|
|
131319
|
+
const expiration = (0,_utils__WEBPACK_IMPORTED_MODULE_0__.getDataExpiration)(expires);
|
|
131315
131320
|
return context.tryWriteDataItem(name, value, pilet, target, expiration);
|
|
131316
131321
|
},
|
|
131317
131322
|
|
|
@@ -131319,7 +131324,7 @@ function createCoreApi(context) {
|
|
|
131319
131324
|
context.registerPage(route, {
|
|
131320
131325
|
pilet,
|
|
131321
131326
|
meta,
|
|
131322
|
-
component: (0,
|
|
131327
|
+
component: (0,_state__WEBPACK_IMPORTED_MODULE_1__.withApi)(context, arg, api, 'page')
|
|
131323
131328
|
});
|
|
131324
131329
|
return () => api.unregisterPage(route);
|
|
131325
131330
|
},
|
|
@@ -131331,7 +131336,7 @@ function createCoreApi(context) {
|
|
|
131331
131336
|
registerExtension(name, arg, defaults) {
|
|
131332
131337
|
context.registerExtension(name, {
|
|
131333
131338
|
pilet,
|
|
131334
|
-
component: (0,
|
|
131339
|
+
component: (0,_state__WEBPACK_IMPORTED_MODULE_1__.withApi)(context, arg, api, 'extension'),
|
|
131335
131340
|
reference: arg,
|
|
131336
131341
|
defaults
|
|
131337
131342
|
});
|
|
@@ -131343,34 +131348,14 @@ function createCoreApi(context) {
|
|
|
131343
131348
|
},
|
|
131344
131349
|
|
|
131345
131350
|
renderHtmlExtension(element, props) {
|
|
131346
|
-
const [dispose] =
|
|
131351
|
+
const [dispose] = (0,_element__WEBPACK_IMPORTED_MODULE_2__.renderElement)(context, element, props);
|
|
131347
131352
|
return dispose;
|
|
131348
131353
|
},
|
|
131349
131354
|
|
|
131350
|
-
Extension:
|
|
131355
|
+
Extension: _components__WEBPACK_IMPORTED_MODULE_3__.ExtensionSlot
|
|
131351
131356
|
};
|
|
131352
131357
|
};
|
|
131353
131358
|
}
|
|
131354
|
-
function createExtenders(context, apis) {
|
|
131355
|
-
const creators = [createCoreApi, ...apis.filter(piral_base__WEBPACK_IMPORTED_MODULE_5__.isfunc)];
|
|
131356
|
-
return creators.map(c => {
|
|
131357
|
-
const ctx = c(context);
|
|
131358
|
-
|
|
131359
|
-
if ((0,piral_base__WEBPACK_IMPORTED_MODULE_5__.isfunc)(ctx)) {
|
|
131360
|
-
return ctx;
|
|
131361
|
-
} else {
|
|
131362
|
-
return () => Object.assign({}, ctx);
|
|
131363
|
-
}
|
|
131364
|
-
});
|
|
131365
|
-
}
|
|
131366
|
-
function defaultApiFactory(context, apis) {
|
|
131367
|
-
const extenders = createExtenders(context, apis);
|
|
131368
|
-
return target => {
|
|
131369
|
-
const api = (0,piral_base__WEBPACK_IMPORTED_MODULE_6__.initializeApi)(target, context);
|
|
131370
|
-
context.apis[target.name] = api;
|
|
131371
|
-
return (0,piral_base__WEBPACK_IMPORTED_MODULE_6__.mergeApis)(api, extenders, target);
|
|
131372
|
-
};
|
|
131373
|
-
}
|
|
131374
131359
|
|
|
131375
131360
|
/***/ }),
|
|
131376
131361
|
|
|
@@ -131445,6 +131430,125 @@ function defaultModuleRequester() {
|
|
|
131445
131430
|
|
|
131446
131431
|
/***/ }),
|
|
131447
131432
|
|
|
131433
|
+
/***/ "../../framework/piral-core/esm/modules/element.js":
|
|
131434
|
+
/*!*********************************************************!*\
|
|
131435
|
+
!*** ../../framework/piral-core/esm/modules/element.js ***!
|
|
131436
|
+
\*********************************************************/
|
|
131437
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
131438
|
+
|
|
131439
|
+
"use strict";
|
|
131440
|
+
__webpack_require__.r(__webpack_exports__);
|
|
131441
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
131442
|
+
/* harmony export */ "renderElement": () => (/* binding */ renderElement)
|
|
131443
|
+
/* harmony export */ });
|
|
131444
|
+
/* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../components */ "../../framework/piral-core/esm/components/ExtensionSlot.js");
|
|
131445
|
+
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ "../../framework/piral-core/esm/utils/helpers.js");
|
|
131446
|
+
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils */ "../../framework/piral-core/esm/utils/extension.js");
|
|
131447
|
+
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils */ "../../framework/piral-core/esm/utils/foreign.js");
|
|
131448
|
+
|
|
131449
|
+
|
|
131450
|
+
|
|
131451
|
+
if (typeof window !== 'undefined' && 'customElements' in window) {
|
|
131452
|
+
class PiralExtension extends HTMLElement {
|
|
131453
|
+
constructor() {
|
|
131454
|
+
super(...arguments);
|
|
131455
|
+
this.dispose = _utils__WEBPACK_IMPORTED_MODULE_0__.noop;
|
|
131456
|
+
this.update = _utils__WEBPACK_IMPORTED_MODULE_0__.noop;
|
|
131457
|
+
this.props = {
|
|
131458
|
+
name: this.getAttribute('name'),
|
|
131459
|
+
params: (0,_utils__WEBPACK_IMPORTED_MODULE_0__.tryParseJson)(this.getAttribute('params')),
|
|
131460
|
+
empty: undefined,
|
|
131461
|
+
children: (0,_utils__WEBPACK_IMPORTED_MODULE_1__.reactifyContent)(this.childNodes)
|
|
131462
|
+
};
|
|
131463
|
+
}
|
|
131464
|
+
|
|
131465
|
+
get params() {
|
|
131466
|
+
return this.props.params;
|
|
131467
|
+
}
|
|
131468
|
+
|
|
131469
|
+
set params(value) {
|
|
131470
|
+
this.props.params = value;
|
|
131471
|
+
this.update(this.props);
|
|
131472
|
+
}
|
|
131473
|
+
|
|
131474
|
+
get name() {
|
|
131475
|
+
return this.props.name;
|
|
131476
|
+
}
|
|
131477
|
+
|
|
131478
|
+
set name(value) {
|
|
131479
|
+
this.props.name = value;
|
|
131480
|
+
this.update(this.props);
|
|
131481
|
+
}
|
|
131482
|
+
|
|
131483
|
+
get empty() {
|
|
131484
|
+
return this.props.empty;
|
|
131485
|
+
}
|
|
131486
|
+
|
|
131487
|
+
set empty(value) {
|
|
131488
|
+
this.props.empty = value;
|
|
131489
|
+
this.update(this.props);
|
|
131490
|
+
}
|
|
131491
|
+
|
|
131492
|
+
connectedCallback() {
|
|
131493
|
+
if (this.isConnected) {
|
|
131494
|
+
this.dispatchEvent(new CustomEvent('render-html', {
|
|
131495
|
+
bubbles: true,
|
|
131496
|
+
detail: {
|
|
131497
|
+
target: this,
|
|
131498
|
+
props: this.props
|
|
131499
|
+
}
|
|
131500
|
+
}));
|
|
131501
|
+
}
|
|
131502
|
+
}
|
|
131503
|
+
|
|
131504
|
+
disconnectedCallback() {
|
|
131505
|
+
this.dispose();
|
|
131506
|
+
this.dispose = _utils__WEBPACK_IMPORTED_MODULE_0__.noop;
|
|
131507
|
+
this.update = _utils__WEBPACK_IMPORTED_MODULE_0__.noop;
|
|
131508
|
+
}
|
|
131509
|
+
|
|
131510
|
+
attributeChangedCallback(name, _, newValue) {
|
|
131511
|
+
switch (name) {
|
|
131512
|
+
case 'name':
|
|
131513
|
+
this.name = newValue;
|
|
131514
|
+
break;
|
|
131515
|
+
|
|
131516
|
+
case 'params':
|
|
131517
|
+
this.params = (0,_utils__WEBPACK_IMPORTED_MODULE_0__.tryParseJson)(newValue);
|
|
131518
|
+
break;
|
|
131519
|
+
}
|
|
131520
|
+
}
|
|
131521
|
+
|
|
131522
|
+
static get observedAttributes() {
|
|
131523
|
+
return ['name', 'params'];
|
|
131524
|
+
}
|
|
131525
|
+
|
|
131526
|
+
}
|
|
131527
|
+
|
|
131528
|
+
customElements.define('piral-extension', PiralExtension);
|
|
131529
|
+
}
|
|
131530
|
+
|
|
131531
|
+
function renderElement(context, element, props) {
|
|
131532
|
+
let [id, portal] = (0,_utils__WEBPACK_IMPORTED_MODULE_2__.renderInDom)(context, element, _components__WEBPACK_IMPORTED_MODULE_3__.ExtensionSlot, props);
|
|
131533
|
+
const evName = 'extension-props-changed';
|
|
131534
|
+
|
|
131535
|
+
const handler = ev => update(ev.detail);
|
|
131536
|
+
|
|
131537
|
+
const dispose = () => {
|
|
131538
|
+
context.hidePortal(id, portal);
|
|
131539
|
+
element.removeEventListener(evName, handler);
|
|
131540
|
+
};
|
|
131541
|
+
|
|
131542
|
+
const update = newProps => {
|
|
131543
|
+
[id, portal] = (0,_utils__WEBPACK_IMPORTED_MODULE_2__.changeDomPortal)(id, portal, context, element, _components__WEBPACK_IMPORTED_MODULE_3__.ExtensionSlot, newProps);
|
|
131544
|
+
};
|
|
131545
|
+
|
|
131546
|
+
element.addEventListener(evName, handler);
|
|
131547
|
+
return [dispose, update];
|
|
131548
|
+
}
|
|
131549
|
+
|
|
131550
|
+
/***/ }),
|
|
131551
|
+
|
|
131448
131552
|
/***/ "../../framework/piral-core/esm/state/createActions.js":
|
|
131449
131553
|
/*!*************************************************************!*\
|
|
131450
131554
|
!*** ../../framework/piral-core/esm/state/createActions.js ***!
|
|
@@ -131914,13 +132018,60 @@ function getDataExpiration(expires) {
|
|
|
131914
132018
|
"use strict";
|
|
131915
132019
|
__webpack_require__.r(__webpack_exports__);
|
|
131916
132020
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
131917
|
-
/* harmony export */ "toExtension": () => (/* binding */ toExtension)
|
|
132021
|
+
/* harmony export */ "toExtension": () => (/* binding */ toExtension),
|
|
132022
|
+
/* harmony export */ "reactifyContent": () => (/* binding */ reactifyContent)
|
|
131918
132023
|
/* harmony export */ });
|
|
131919
132024
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../../../node_modules/react/index.js");
|
|
131920
132025
|
|
|
132026
|
+
|
|
132027
|
+
function removeAll(nodes) {
|
|
132028
|
+
nodes.forEach(node => node.remove());
|
|
132029
|
+
}
|
|
132030
|
+
|
|
132031
|
+
const SlotCarrier = ({
|
|
132032
|
+
nodes
|
|
132033
|
+
}) => {
|
|
132034
|
+
const host = react__WEBPACK_IMPORTED_MODULE_0__.useRef();
|
|
132035
|
+
react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
|
|
132036
|
+
var _a;
|
|
132037
|
+
|
|
132038
|
+
(_a = host.current) === null || _a === void 0 ? void 0 : _a.append(...nodes);
|
|
132039
|
+
return () => removeAll(nodes);
|
|
132040
|
+
}, [nodes]);
|
|
132041
|
+
|
|
132042
|
+
if (nodes.length) {
|
|
132043
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("slot", {
|
|
132044
|
+
ref: host
|
|
132045
|
+
});
|
|
132046
|
+
}
|
|
132047
|
+
|
|
132048
|
+
return null;
|
|
132049
|
+
};
|
|
132050
|
+
/**
|
|
132051
|
+
* Transforms the given component to an extension component.
|
|
132052
|
+
* @param Component The component to transform.
|
|
132053
|
+
* @returns The extension component (receiving its props via params).
|
|
132054
|
+
*/
|
|
132055
|
+
|
|
132056
|
+
|
|
131921
132057
|
function toExtension(Component) {
|
|
131922
132058
|
return props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(Component, Object.assign({}, props.params));
|
|
131923
132059
|
}
|
|
132060
|
+
/**
|
|
132061
|
+
* Reactifies the list of child nodes to a React Node by removing the
|
|
132062
|
+
* nodes from the DOM and carrying it in a React Node, where it would be
|
|
132063
|
+
* attached at a slot.
|
|
132064
|
+
* @param childNodes The child nodes to reactify.
|
|
132065
|
+
* @returns The React Node.
|
|
132066
|
+
*/
|
|
132067
|
+
|
|
132068
|
+
function reactifyContent(childNodes) {
|
|
132069
|
+
const nodes = Array.prototype.filter.call(childNodes, Boolean);
|
|
132070
|
+
removeAll(nodes);
|
|
132071
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(SlotCarrier, {
|
|
132072
|
+
nodes: nodes
|
|
132073
|
+
});
|
|
132074
|
+
}
|
|
131924
132075
|
|
|
131925
132076
|
/***/ }),
|
|
131926
132077
|
|
|
@@ -132128,6 +132279,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
132128
132279
|
/* harmony export */ "createDataOptions": () => (/* reexport safe */ _data__WEBPACK_IMPORTED_MODULE_1__.createDataOptions),
|
|
132129
132280
|
/* harmony export */ "createDataView": () => (/* reexport safe */ _data__WEBPACK_IMPORTED_MODULE_1__.createDataView),
|
|
132130
132281
|
/* harmony export */ "getDataExpiration": () => (/* reexport safe */ _data__WEBPACK_IMPORTED_MODULE_1__.getDataExpiration),
|
|
132282
|
+
/* harmony export */ "reactifyContent": () => (/* reexport safe */ _extension__WEBPACK_IMPORTED_MODULE_2__.reactifyContent),
|
|
132131
132283
|
/* harmony export */ "toExtension": () => (/* reexport safe */ _extension__WEBPACK_IMPORTED_MODULE_2__.toExtension),
|
|
132132
132284
|
/* harmony export */ "attachDomPortal": () => (/* reexport safe */ _foreign__WEBPACK_IMPORTED_MODULE_3__.attachDomPortal),
|
|
132133
132285
|
/* harmony export */ "changeDomPortal": () => (/* reexport safe */ _foreign__WEBPACK_IMPORTED_MODULE_3__.changeDomPortal),
|
|
@@ -133201,11 +133353,11 @@ function installPiralDebug(options) {
|
|
|
133201
133353
|
debug: debugApiVersion,
|
|
133202
133354
|
instance: {
|
|
133203
133355
|
name: "sample-cross-fx",
|
|
133204
|
-
version: "0.14.8-beta.
|
|
133356
|
+
version: "0.14.8-beta.3513",
|
|
133205
133357
|
dependencies: "@angular/common,@angular/compiler,@angular/core,@angular/platform-browser,@angular/platform-browser-dynamic,@webcomponents/webcomponentsjs,angular,aurelia-framework,aurelia-templating-binding,aurelia-templating-resources,aurelia-pal-browser,aurelia-event-aggregator,aurelia-history-browser,hyperapp,inferno,inferno-create-element,mithril,lit-element,solid-js,solid-js/dom,preact,riot,rxjs,vue,zone.js,react,react-dom,react-router,react-router-dom,history,tslib,path-to-regexp,@libre/atom,@dbeining/react-atom"
|
|
133206
133358
|
},
|
|
133207
133359
|
build: {
|
|
133208
|
-
date: "2022-01-
|
|
133360
|
+
date: "2022-01-20T10:22:21.562Z",
|
|
133209
133361
|
cli: "0.14.7",
|
|
133210
133362
|
compat: "0.14"
|
|
133211
133363
|
},
|
|
@@ -255283,4 +255435,4 @@ const app = React.createElement(piral_core_1.Piral, {
|
|
|
255283
255435
|
|
|
255284
255436
|
/******/ })()
|
|
255285
255437
|
;
|
|
255286
|
-
//# sourceMappingURL=index.
|
|
255438
|
+
//# sourceMappingURL=index.922e4d.js.map
|