sample-piral 0.14.3-beta.3303 → 0.14.4

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.
@@ -1864,14 +1864,13 @@ __webpack_require__.r(__webpack_exports__);
1864
1864
  /* harmony export */ "setRoute": () => (/* binding */ setRoute),
1865
1865
  /* harmony export */ "includeProvider": () => (/* binding */ includeProvider)
1866
1866
  /* harmony export */ });
1867
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../../../node_modules/react/index.js");
1868
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils */ "../../framework/piral-core/esm/utils/helpers.js");
1869
-
1867
+ /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ "../../framework/piral-core/esm/utils/helpers.js");
1868
+ /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils */ "../../framework/piral-core/esm/utils/state.js");
1870
1869
 
1871
1870
  function changeLayout(ctx, current) {
1872
1871
  ctx.dispatch(function (state) {
1873
1872
  return Object.assign(Object.assign({}, state), {
1874
- app: (0,_utils__WEBPACK_IMPORTED_MODULE_1__.withKey)(state.app, 'layout', current)
1873
+ app: (0,_utils__WEBPACK_IMPORTED_MODULE_0__.withKey)(state.app, 'layout', current)
1875
1874
  });
1876
1875
  });
1877
1876
  }
@@ -1889,10 +1888,10 @@ function initialize(ctx, loading, error, modules) {
1889
1888
  function injectPilet(ctx, pilet) {
1890
1889
  ctx.dispatch(function (state) {
1891
1890
  return Object.assign(Object.assign({}, state), {
1892
- modules: (0,_utils__WEBPACK_IMPORTED_MODULE_1__.replaceOrAddItem)(state.modules, pilet, function (m) {
1891
+ modules: (0,_utils__WEBPACK_IMPORTED_MODULE_0__.replaceOrAddItem)(state.modules, pilet, function (m) {
1893
1892
  return m.name === pilet.name;
1894
1893
  }),
1895
- registry: (0,_utils__WEBPACK_IMPORTED_MODULE_1__.removeNested)(state.registry, function (m) {
1894
+ registry: (0,_utils__WEBPACK_IMPORTED_MODULE_0__.removeNested)(state.registry, function (m) {
1896
1895
  return m.pilet === pilet.name;
1897
1896
  })
1898
1897
  });
@@ -1904,36 +1903,22 @@ function injectPilet(ctx, pilet) {
1904
1903
  function setComponent(ctx, name, component) {
1905
1904
  ctx.dispatch(function (state) {
1906
1905
  return Object.assign(Object.assign({}, state), {
1907
- components: (0,_utils__WEBPACK_IMPORTED_MODULE_1__.withKey)(state.components, name, component)
1906
+ components: (0,_utils__WEBPACK_IMPORTED_MODULE_0__.withKey)(state.components, name, component)
1908
1907
  });
1909
1908
  });
1910
1909
  }
1911
1910
  function setErrorComponent(ctx, type, component) {
1912
1911
  ctx.dispatch(function (state) {
1913
1912
  return Object.assign(Object.assign({}, state), {
1914
- errorComponents: (0,_utils__WEBPACK_IMPORTED_MODULE_1__.withKey)(state.errorComponents, type, component)
1913
+ errorComponents: (0,_utils__WEBPACK_IMPORTED_MODULE_0__.withKey)(state.errorComponents, type, component)
1915
1914
  });
1916
1915
  });
1917
1916
  }
1918
1917
  function setRoute(ctx, path, component) {
1919
- ctx.dispatch(function (state) {
1920
- return Object.assign(Object.assign({}, state), {
1921
- routes: (0,_utils__WEBPACK_IMPORTED_MODULE_1__.withKey)(state.routes, path, component)
1922
- });
1923
- });
1918
+ ctx.dispatch((0,_utils__WEBPACK_IMPORTED_MODULE_1__.withRoute)(path, component));
1924
1919
  }
1925
1920
  function includeProvider(ctx, provider) {
1926
- var wrapper = function wrapper(props) {
1927
- return /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.cloneElement)(provider, props);
1928
- };
1929
-
1930
- ctx.dispatch(function (state) {
1931
- return Object.assign(Object.assign({}, state), {
1932
- provider: !state.provider ? wrapper : function (props) {
1933
- return /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(state.provider, undefined, wrapper(props));
1934
- }
1935
- });
1936
- });
1921
+ ctx.dispatch((0,_utils__WEBPACK_IMPORTED_MODULE_1__.withProvider)(provider));
1937
1922
  }
1938
1923
 
1939
1924
  /***/ }),
@@ -1952,45 +1937,19 @@ __webpack_require__.r(__webpack_exports__);
1952
1937
  /* harmony export */ "registerExtension": () => (/* binding */ registerExtension),
1953
1938
  /* harmony export */ "unregisterExtension": () => (/* binding */ unregisterExtension)
1954
1939
  /* harmony export */ });
1955
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ "../../framework/piral-core/esm/utils/helpers.js");
1940
+ /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ "../../framework/piral-core/esm/utils/state.js");
1956
1941
 
1957
1942
  function registerPage(ctx, name, value) {
1958
- ctx.dispatch(function (state) {
1959
- return Object.assign(Object.assign({}, state), {
1960
- registry: Object.assign(Object.assign({}, state.registry), {
1961
- pages: (0,_utils__WEBPACK_IMPORTED_MODULE_0__.withKey)(state.registry.pages, name, value)
1962
- })
1963
- });
1964
- });
1943
+ ctx.dispatch((0,_utils__WEBPACK_IMPORTED_MODULE_0__.withPage)(name, value));
1965
1944
  }
1966
1945
  function unregisterPage(ctx, name) {
1967
- ctx.dispatch(function (state) {
1968
- return Object.assign(Object.assign({}, state), {
1969
- registry: Object.assign(Object.assign({}, state.registry), {
1970
- pages: (0,_utils__WEBPACK_IMPORTED_MODULE_0__.withoutKey)(state.registry.pages, name)
1971
- })
1972
- });
1973
- });
1946
+ ctx.dispatch((0,_utils__WEBPACK_IMPORTED_MODULE_0__.withoutPage)(name));
1974
1947
  }
1975
1948
  function registerExtension(ctx, name, value) {
1976
- ctx.dispatch(function (state) {
1977
- return Object.assign(Object.assign({}, state), {
1978
- registry: Object.assign(Object.assign({}, state.registry), {
1979
- extensions: (0,_utils__WEBPACK_IMPORTED_MODULE_0__.withKey)(state.registry.extensions, name, (0,_utils__WEBPACK_IMPORTED_MODULE_0__.appendItem)(state.registry.extensions[name], value))
1980
- })
1981
- });
1982
- });
1949
+ ctx.dispatch((0,_utils__WEBPACK_IMPORTED_MODULE_0__.withExtension)(name, value));
1983
1950
  }
1984
1951
  function unregisterExtension(ctx, name, reference) {
1985
- ctx.dispatch(function (state) {
1986
- return Object.assign(Object.assign({}, state), {
1987
- registry: Object.assign(Object.assign({}, state.registry), {
1988
- extensions: (0,_utils__WEBPACK_IMPORTED_MODULE_0__.withKey)(state.registry.extensions, name, (0,_utils__WEBPACK_IMPORTED_MODULE_0__.excludeOn)(state.registry.extensions[name], function (m) {
1989
- return m.reference === reference;
1990
- }))
1991
- })
1992
- });
1993
- });
1952
+ ctx.dispatch((0,_utils__WEBPACK_IMPORTED_MODULE_0__.withoutExtension)(name, reference));
1994
1953
  }
1995
1954
 
1996
1955
  /***/ }),
@@ -3186,7 +3145,7 @@ function createInstance() {
3186
3145
  var createApi = apiFactory(context, usedPlugins);
3187
3146
  var root = createApi({
3188
3147
  name: 'root',
3189
- version: "0.14.3-beta.3303" || 0,
3148
+ version: "0.14.4" || 0,
3190
3149
  spec: ''
3191
3150
  });
3192
3151
  var options = (0,_helpers__WEBPACK_IMPORTED_MODULE_5__.createPiletOptions)({
@@ -3605,10 +3564,19 @@ __webpack_require__.r(__webpack_exports__);
3605
3564
  /* harmony export */ "renderInDom": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_6__.renderInDom),
3606
3565
  /* harmony export */ "replaceOrAddItem": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_6__.replaceOrAddItem),
3607
3566
  /* harmony export */ "storage": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_6__.storage),
3567
+ /* harmony export */ "toExtension": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_6__.toExtension),
3608
3568
  /* harmony export */ "tryParseJson": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_6__.tryParseJson),
3609
3569
  /* harmony export */ "updateKey": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_6__.updateKey),
3570
+ /* harmony export */ "withAll": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_6__.withAll),
3571
+ /* harmony export */ "withExtension": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_6__.withExtension),
3610
3572
  /* harmony export */ "withKey": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_6__.withKey),
3611
- /* harmony export */ "withoutKey": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_6__.withoutKey)
3573
+ /* harmony export */ "withPage": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_6__.withPage),
3574
+ /* harmony export */ "withProvider": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_6__.withProvider),
3575
+ /* harmony export */ "withRootExtension": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_6__.withRootExtension),
3576
+ /* harmony export */ "withRoute": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_6__.withRoute),
3577
+ /* harmony export */ "withoutExtension": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_6__.withoutExtension),
3578
+ /* harmony export */ "withoutKey": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_6__.withoutKey),
3579
+ /* harmony export */ "withoutPage": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_6__.withoutPage)
3612
3580
  /* harmony export */ });
3613
3581
  /* harmony import */ var _createInstance__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./createInstance */ "../../framework/piral-core/esm/createInstance.js");
3614
3582
  /* harmony import */ var _Piral__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Piral */ "../../framework/piral-core/esm/Piral.js");
@@ -4465,6 +4433,27 @@ function getDataExpiration(expires) {
4465
4433
 
4466
4434
  /***/ }),
4467
4435
 
4436
+ /***/ "../../framework/piral-core/esm/utils/extension.js":
4437
+ /*!*********************************************************!*\
4438
+ !*** ../../framework/piral-core/esm/utils/extension.js ***!
4439
+ \*********************************************************/
4440
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4441
+
4442
+ "use strict";
4443
+ __webpack_require__.r(__webpack_exports__);
4444
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4445
+ /* harmony export */ "toExtension": () => (/* binding */ toExtension)
4446
+ /* harmony export */ });
4447
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../../../node_modules/react/index.js");
4448
+
4449
+ function toExtension(Component) {
4450
+ return function (props) {
4451
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(Component, Object.assign({}, props.params));
4452
+ };
4453
+ }
4454
+
4455
+ /***/ }),
4456
+
4468
4457
  /***/ "../../framework/piral-core/esm/utils/foreign.js":
4469
4458
  /*!*******************************************************!*\
4470
4459
  !*** ../../framework/piral-core/esm/utils/foreign.js ***!
@@ -4687,43 +4676,56 @@ __webpack_require__.r(__webpack_exports__);
4687
4676
  /* harmony export */ "createDataOptions": () => (/* reexport safe */ _data__WEBPACK_IMPORTED_MODULE_1__.createDataOptions),
4688
4677
  /* harmony export */ "createDataView": () => (/* reexport safe */ _data__WEBPACK_IMPORTED_MODULE_1__.createDataView),
4689
4678
  /* harmony export */ "getDataExpiration": () => (/* reexport safe */ _data__WEBPACK_IMPORTED_MODULE_1__.getDataExpiration),
4690
- /* harmony export */ "attachDomPortal": () => (/* reexport safe */ _foreign__WEBPACK_IMPORTED_MODULE_2__.attachDomPortal),
4691
- /* harmony export */ "changeDomPortal": () => (/* reexport safe */ _foreign__WEBPACK_IMPORTED_MODULE_2__.changeDomPortal),
4692
- /* harmony export */ "convertComponent": () => (/* reexport safe */ _foreign__WEBPACK_IMPORTED_MODULE_2__.convertComponent),
4693
- /* harmony export */ "renderInDom": () => (/* reexport safe */ _foreign__WEBPACK_IMPORTED_MODULE_2__.renderInDom),
4694
- /* harmony export */ "buildName": () => (/* reexport safe */ _guid__WEBPACK_IMPORTED_MODULE_3__.buildName),
4695
- /* harmony export */ "generateId": () => (/* reexport safe */ _guid__WEBPACK_IMPORTED_MODULE_3__.generateId),
4696
- /* harmony export */ "appendItem": () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_4__.appendItem),
4697
- /* harmony export */ "appendItems": () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_4__.appendItems),
4698
- /* harmony export */ "excludeItem": () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_4__.excludeItem),
4699
- /* harmony export */ "excludeOn": () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_4__.excludeOn),
4700
- /* harmony export */ "includeItem": () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_4__.includeItem),
4701
- /* harmony export */ "none": () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_4__.none),
4702
- /* harmony export */ "noop": () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_4__.noop),
4703
- /* harmony export */ "prependItem": () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_4__.prependItem),
4704
- /* harmony export */ "prependItems": () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_4__.prependItems),
4705
- /* harmony export */ "removeIndicator": () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_4__.removeIndicator),
4706
- /* harmony export */ "removeNested": () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_4__.removeNested),
4707
- /* harmony export */ "replaceOrAddItem": () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_4__.replaceOrAddItem),
4708
- /* harmony export */ "tryParseJson": () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_4__.tryParseJson),
4709
- /* harmony export */ "updateKey": () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_4__.updateKey),
4710
- /* harmony export */ "withKey": () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_4__.withKey),
4711
- /* harmony export */ "withoutKey": () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_4__.withoutKey),
4712
- /* harmony export */ "defaultBreakpoints": () => (/* reexport safe */ _media__WEBPACK_IMPORTED_MODULE_5__.defaultBreakpoints),
4713
- /* harmony export */ "defaultLayouts": () => (/* reexport safe */ _media__WEBPACK_IMPORTED_MODULE_5__.defaultLayouts),
4714
- /* harmony export */ "getCurrentLayout": () => (/* reexport safe */ _media__WEBPACK_IMPORTED_MODULE_5__.getCurrentLayout),
4715
- /* harmony export */ "defaultRender": () => (/* reexport safe */ _react__WEBPACK_IMPORTED_MODULE_6__.defaultRender),
4716
- /* harmony export */ "cookie": () => (/* reexport safe */ _storage__WEBPACK_IMPORTED_MODULE_7__.cookie),
4717
- /* harmony export */ "storage": () => (/* reexport safe */ _storage__WEBPACK_IMPORTED_MODULE_7__.storage)
4679
+ /* harmony export */ "toExtension": () => (/* reexport safe */ _extension__WEBPACK_IMPORTED_MODULE_2__.toExtension),
4680
+ /* harmony export */ "attachDomPortal": () => (/* reexport safe */ _foreign__WEBPACK_IMPORTED_MODULE_3__.attachDomPortal),
4681
+ /* harmony export */ "changeDomPortal": () => (/* reexport safe */ _foreign__WEBPACK_IMPORTED_MODULE_3__.changeDomPortal),
4682
+ /* harmony export */ "convertComponent": () => (/* reexport safe */ _foreign__WEBPACK_IMPORTED_MODULE_3__.convertComponent),
4683
+ /* harmony export */ "renderInDom": () => (/* reexport safe */ _foreign__WEBPACK_IMPORTED_MODULE_3__.renderInDom),
4684
+ /* harmony export */ "buildName": () => (/* reexport safe */ _guid__WEBPACK_IMPORTED_MODULE_4__.buildName),
4685
+ /* harmony export */ "generateId": () => (/* reexport safe */ _guid__WEBPACK_IMPORTED_MODULE_4__.generateId),
4686
+ /* harmony export */ "appendItem": () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_5__.appendItem),
4687
+ /* harmony export */ "appendItems": () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_5__.appendItems),
4688
+ /* harmony export */ "excludeItem": () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_5__.excludeItem),
4689
+ /* harmony export */ "excludeOn": () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_5__.excludeOn),
4690
+ /* harmony export */ "includeItem": () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_5__.includeItem),
4691
+ /* harmony export */ "none": () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_5__.none),
4692
+ /* harmony export */ "noop": () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_5__.noop),
4693
+ /* harmony export */ "prependItem": () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_5__.prependItem),
4694
+ /* harmony export */ "prependItems": () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_5__.prependItems),
4695
+ /* harmony export */ "removeIndicator": () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_5__.removeIndicator),
4696
+ /* harmony export */ "removeNested": () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_5__.removeNested),
4697
+ /* harmony export */ "replaceOrAddItem": () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_5__.replaceOrAddItem),
4698
+ /* harmony export */ "tryParseJson": () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_5__.tryParseJson),
4699
+ /* harmony export */ "updateKey": () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_5__.updateKey),
4700
+ /* harmony export */ "withKey": () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_5__.withKey),
4701
+ /* harmony export */ "withoutKey": () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_5__.withoutKey),
4702
+ /* harmony export */ "defaultBreakpoints": () => (/* reexport safe */ _media__WEBPACK_IMPORTED_MODULE_6__.defaultBreakpoints),
4703
+ /* harmony export */ "defaultLayouts": () => (/* reexport safe */ _media__WEBPACK_IMPORTED_MODULE_6__.defaultLayouts),
4704
+ /* harmony export */ "getCurrentLayout": () => (/* reexport safe */ _media__WEBPACK_IMPORTED_MODULE_6__.getCurrentLayout),
4705
+ /* harmony export */ "defaultRender": () => (/* reexport safe */ _react__WEBPACK_IMPORTED_MODULE_7__.defaultRender),
4706
+ /* harmony export */ "withAll": () => (/* reexport safe */ _state__WEBPACK_IMPORTED_MODULE_8__.withAll),
4707
+ /* harmony export */ "withExtension": () => (/* reexport safe */ _state__WEBPACK_IMPORTED_MODULE_8__.withExtension),
4708
+ /* harmony export */ "withPage": () => (/* reexport safe */ _state__WEBPACK_IMPORTED_MODULE_8__.withPage),
4709
+ /* harmony export */ "withProvider": () => (/* reexport safe */ _state__WEBPACK_IMPORTED_MODULE_8__.withProvider),
4710
+ /* harmony export */ "withRootExtension": () => (/* reexport safe */ _state__WEBPACK_IMPORTED_MODULE_8__.withRootExtension),
4711
+ /* harmony export */ "withRoute": () => (/* reexport safe */ _state__WEBPACK_IMPORTED_MODULE_8__.withRoute),
4712
+ /* harmony export */ "withoutExtension": () => (/* reexport safe */ _state__WEBPACK_IMPORTED_MODULE_8__.withoutExtension),
4713
+ /* harmony export */ "withoutPage": () => (/* reexport safe */ _state__WEBPACK_IMPORTED_MODULE_8__.withoutPage),
4714
+ /* harmony export */ "cookie": () => (/* reexport safe */ _storage__WEBPACK_IMPORTED_MODULE_9__.cookie),
4715
+ /* harmony export */ "storage": () => (/* reexport safe */ _storage__WEBPACK_IMPORTED_MODULE_9__.storage)
4718
4716
  /* harmony export */ });
4719
4717
  /* harmony import */ var _compare__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./compare */ "../../framework/piral-core/esm/utils/compare.js");
4720
4718
  /* harmony import */ var _data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./data */ "../../framework/piral-core/esm/utils/data.js");
4721
- /* harmony import */ var _foreign__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foreign */ "../../framework/piral-core/esm/utils/foreign.js");
4722
- /* harmony import */ var _guid__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./guid */ "../../framework/piral-core/esm/utils/guid.js");
4723
- /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./helpers */ "../../framework/piral-core/esm/utils/helpers.js");
4724
- /* harmony import */ var _media__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./media */ "../../framework/piral-core/esm/utils/media.js");
4725
- /* harmony import */ var _react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./react */ "../../framework/piral-core/esm/utils/react.js");
4726
- /* harmony import */ var _storage__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./storage */ "../../framework/piral-core/esm/utils/storage.js");
4719
+ /* harmony import */ var _extension__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./extension */ "../../framework/piral-core/esm/utils/extension.js");
4720
+ /* harmony import */ var _foreign__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foreign */ "../../framework/piral-core/esm/utils/foreign.js");
4721
+ /* harmony import */ var _guid__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./guid */ "../../framework/piral-core/esm/utils/guid.js");
4722
+ /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./helpers */ "../../framework/piral-core/esm/utils/helpers.js");
4723
+ /* harmony import */ var _media__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./media */ "../../framework/piral-core/esm/utils/media.js");
4724
+ /* harmony import */ var _react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./react */ "../../framework/piral-core/esm/utils/react.js");
4725
+ /* harmony import */ var _state__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./state */ "../../framework/piral-core/esm/utils/state.js");
4726
+ /* harmony import */ var _storage__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./storage */ "../../framework/piral-core/esm/utils/storage.js");
4727
+
4728
+
4727
4729
 
4728
4730
 
4729
4731
 
@@ -4792,6 +4794,180 @@ function defaultRender(children, key) {
4792
4794
 
4793
4795
  /***/ }),
4794
4796
 
4797
+ /***/ "../../framework/piral-core/esm/utils/state.js":
4798
+ /*!*****************************************************!*\
4799
+ !*** ../../framework/piral-core/esm/utils/state.js ***!
4800
+ \*****************************************************/
4801
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4802
+
4803
+ "use strict";
4804
+ __webpack_require__.r(__webpack_exports__);
4805
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4806
+ /* harmony export */ "withAll": () => (/* binding */ withAll),
4807
+ /* harmony export */ "withPage": () => (/* binding */ withPage),
4808
+ /* harmony export */ "withoutPage": () => (/* binding */ withoutPage),
4809
+ /* harmony export */ "withExtension": () => (/* binding */ withExtension),
4810
+ /* harmony export */ "withoutExtension": () => (/* binding */ withoutExtension),
4811
+ /* harmony export */ "withRootExtension": () => (/* binding */ withRootExtension),
4812
+ /* harmony export */ "withProvider": () => (/* binding */ withProvider),
4813
+ /* harmony export */ "withRoute": () => (/* binding */ withRoute)
4814
+ /* harmony export */ });
4815
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../../../node_modules/react/index.js");
4816
+ /* harmony import */ var _extension__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./extension */ "../../framework/piral-core/esm/utils/extension.js");
4817
+ /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers */ "../../framework/piral-core/esm/utils/helpers.js");
4818
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
4819
+
4820
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4821
+
4822
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
4823
+
4824
+
4825
+
4826
+
4827
+ /**
4828
+ * Returns a dispatcher that includes all mentioned dispatchers.
4829
+ * @param dispatchers The dispatchers to include.
4830
+ */
4831
+
4832
+ function withAll() {
4833
+ for (var _len = arguments.length, dispatchers = new Array(_len), _key = 0; _key < _len; _key++) {
4834
+ dispatchers[_key] = arguments[_key];
4835
+ }
4836
+
4837
+ return function (state) {
4838
+ var _iterator = _createForOfIteratorHelper(dispatchers),
4839
+ _step;
4840
+
4841
+ try {
4842
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
4843
+ var dispatcher = _step.value;
4844
+ state = dispatcher(state);
4845
+ }
4846
+ } catch (err) {
4847
+ _iterator.e(err);
4848
+ } finally {
4849
+ _iterator.f();
4850
+ }
4851
+
4852
+ return state;
4853
+ };
4854
+ }
4855
+ /**
4856
+ * Returns a dispatcher that adds a page registration.
4857
+ * @param name The path of the page to register.
4858
+ * @param value The value of the page to register.
4859
+ * @returns The dispatcher.
4860
+ */
4861
+
4862
+ function withPage(name, value) {
4863
+ return function (state) {
4864
+ return Object.assign(Object.assign({}, state), {
4865
+ registry: Object.assign(Object.assign({}, state.registry), {
4866
+ pages: (0,_helpers__WEBPACK_IMPORTED_MODULE_1__.withKey)(state.registry.pages, name, value)
4867
+ })
4868
+ });
4869
+ };
4870
+ }
4871
+ /**
4872
+ * Returns a dispatcher that removes a page registration.
4873
+ * @param name The path of the page to unregister.
4874
+ * @returns The dispatcher.
4875
+ */
4876
+
4877
+ function withoutPage(name) {
4878
+ return function (state) {
4879
+ return Object.assign(Object.assign({}, state), {
4880
+ registry: Object.assign(Object.assign({}, state.registry), {
4881
+ pages: (0,_helpers__WEBPACK_IMPORTED_MODULE_1__.withoutKey)(state.registry.pages, name)
4882
+ })
4883
+ });
4884
+ };
4885
+ }
4886
+ /**
4887
+ * Returns a dispatcher that adds an extension registration.
4888
+ * @param name The name of the extension to register.
4889
+ * @param value The value of the extension to register.
4890
+ * @returns The dispatcher.
4891
+ */
4892
+
4893
+ function withExtension(name, value) {
4894
+ return function (state) {
4895
+ return Object.assign(Object.assign({}, state), {
4896
+ registry: Object.assign(Object.assign({}, state.registry), {
4897
+ extensions: (0,_helpers__WEBPACK_IMPORTED_MODULE_1__.withKey)(state.registry.extensions, name, (0,_helpers__WEBPACK_IMPORTED_MODULE_1__.appendItem)(state.registry.extensions[name], value))
4898
+ })
4899
+ });
4900
+ };
4901
+ }
4902
+ /**
4903
+ * Returns a dispatcher that removes an extension registration.
4904
+ * @param name The name of the extension to unregister.
4905
+ * @param reference The reference for the extension.
4906
+ * @returns The dispatcher.
4907
+ */
4908
+
4909
+ function withoutExtension(name, reference) {
4910
+ return function (state) {
4911
+ return Object.assign(Object.assign({}, state), {
4912
+ registry: Object.assign(Object.assign({}, state.registry), {
4913
+ extensions: (0,_helpers__WEBPACK_IMPORTED_MODULE_1__.withKey)(state.registry.extensions, name, (0,_helpers__WEBPACK_IMPORTED_MODULE_1__.excludeOn)(state.registry.extensions[name], function (m) {
4914
+ return m.reference === reference;
4915
+ }))
4916
+ })
4917
+ });
4918
+ };
4919
+ }
4920
+ /**
4921
+ * Returns a dispatcher that adds an extension registration from the root (no Pilet API).
4922
+ * @param name The name of the extension to register.
4923
+ * @param component The extension's component to use.
4924
+ * @returns The dispatcher.
4925
+ */
4926
+
4927
+ function withRootExtension(name, component) {
4928
+ return withExtension(name, {
4929
+ component: (0,_extension__WEBPACK_IMPORTED_MODULE_2__.toExtension)(component),
4930
+ defaults: {},
4931
+ pilet: '',
4932
+ reference: component
4933
+ });
4934
+ }
4935
+ /**
4936
+ * Returns a dispatcher that adds another provider.
4937
+ * @param provider The provider to include.
4938
+ * @returns The dispatcher.
4939
+ */
4940
+
4941
+ function withProvider(provider) {
4942
+ var wrapper = function wrapper(props) {
4943
+ return /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.cloneElement)(provider, props);
4944
+ };
4945
+
4946
+ return function (state) {
4947
+ return Object.assign(Object.assign({}, state), {
4948
+ provider: !state.provider ? wrapper : function (props) {
4949
+ return /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(state.provider, undefined, wrapper(props));
4950
+ }
4951
+ });
4952
+ };
4953
+ }
4954
+ /**
4955
+ * Returns a dispatcher that registers another route.
4956
+ * @param path The path of the route to register.
4957
+ * @param component The component representing the route.
4958
+ * @returns The dispatcher.
4959
+ */
4960
+
4961
+ function withRoute(path, component) {
4962
+ return function (state) {
4963
+ return Object.assign(Object.assign({}, state), {
4964
+ routes: (0,_helpers__WEBPACK_IMPORTED_MODULE_1__.withKey)(state.routes, path, component)
4965
+ });
4966
+ };
4967
+ }
4968
+
4969
+ /***/ }),
4970
+
4795
4971
  /***/ "../../framework/piral-core/esm/utils/storage.js":
4796
4972
  /*!*******************************************************!*\
4797
4973
  !*** ../../framework/piral-core/esm/utils/storage.js ***!
@@ -5199,6 +5375,7 @@ __webpack_require__.r(__webpack_exports__);
5199
5375
  /* harmony export */ "renderInDom": () => (/* reexport safe */ piral_core__WEBPACK_IMPORTED_MODULE_0__.renderInDom),
5200
5376
  /* harmony export */ "replaceOrAddItem": () => (/* reexport safe */ piral_core__WEBPACK_IMPORTED_MODULE_0__.replaceOrAddItem),
5201
5377
  /* harmony export */ "storage": () => (/* reexport safe */ piral_core__WEBPACK_IMPORTED_MODULE_0__.storage),
5378
+ /* harmony export */ "toExtension": () => (/* reexport safe */ piral_core__WEBPACK_IMPORTED_MODULE_0__.toExtension),
5202
5379
  /* harmony export */ "tryParseJson": () => (/* reexport safe */ piral_core__WEBPACK_IMPORTED_MODULE_0__.tryParseJson),
5203
5380
  /* harmony export */ "updateKey": () => (/* reexport safe */ piral_core__WEBPACK_IMPORTED_MODULE_0__.updateKey),
5204
5381
  /* harmony export */ "useAction": () => (/* reexport safe */ piral_core__WEBPACK_IMPORTED_MODULE_0__.useAction),
@@ -5208,9 +5385,17 @@ __webpack_require__.r(__webpack_exports__);
5208
5385
  /* harmony export */ "useMedia": () => (/* reexport safe */ piral_core__WEBPACK_IMPORTED_MODULE_0__.useMedia),
5209
5386
  /* harmony export */ "useSetter": () => (/* reexport safe */ piral_core__WEBPACK_IMPORTED_MODULE_0__.useSetter),
5210
5387
  /* harmony export */ "useSharedData": () => (/* reexport safe */ piral_core__WEBPACK_IMPORTED_MODULE_0__.useSharedData),
5388
+ /* harmony export */ "withAll": () => (/* reexport safe */ piral_core__WEBPACK_IMPORTED_MODULE_0__.withAll),
5211
5389
  /* harmony export */ "withApi": () => (/* reexport safe */ piral_core__WEBPACK_IMPORTED_MODULE_0__.withApi),
5390
+ /* harmony export */ "withExtension": () => (/* reexport safe */ piral_core__WEBPACK_IMPORTED_MODULE_0__.withExtension),
5212
5391
  /* harmony export */ "withKey": () => (/* reexport safe */ piral_core__WEBPACK_IMPORTED_MODULE_0__.withKey),
5392
+ /* harmony export */ "withPage": () => (/* reexport safe */ piral_core__WEBPACK_IMPORTED_MODULE_0__.withPage),
5393
+ /* harmony export */ "withProvider": () => (/* reexport safe */ piral_core__WEBPACK_IMPORTED_MODULE_0__.withProvider),
5394
+ /* harmony export */ "withRootExtension": () => (/* reexport safe */ piral_core__WEBPACK_IMPORTED_MODULE_0__.withRootExtension),
5395
+ /* harmony export */ "withRoute": () => (/* reexport safe */ piral_core__WEBPACK_IMPORTED_MODULE_0__.withRoute),
5396
+ /* harmony export */ "withoutExtension": () => (/* reexport safe */ piral_core__WEBPACK_IMPORTED_MODULE_0__.withoutExtension),
5213
5397
  /* harmony export */ "withoutKey": () => (/* reexport safe */ piral_core__WEBPACK_IMPORTED_MODULE_0__.withoutKey),
5398
+ /* harmony export */ "withoutPage": () => (/* reexport safe */ piral_core__WEBPACK_IMPORTED_MODULE_0__.withoutPage),
5214
5399
  /* harmony export */ "Dashboard": () => (/* reexport safe */ piral_ext__WEBPACK_IMPORTED_MODULE_1__.Dashboard),
5215
5400
  /* harmony export */ "Languages": () => (/* reexport safe */ piral_ext__WEBPACK_IMPORTED_MODULE_1__.Languages),
5216
5401
  /* harmony export */ "Menu": () => (/* reexport safe */ piral_ext__WEBPACK_IMPORTED_MODULE_1__.Menu),
@@ -5649,10 +5834,12 @@ __webpack_require__.r(__webpack_exports__);
5649
5834
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5650
5835
  /* harmony export */ "createDashboardApi": () => (/* binding */ createDashboardApi)
5651
5836
  /* harmony export */ });
5652
- /* harmony import */ var _actions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./actions */ "../../plugins/piral-dashboard/esm/actions.js");
5653
- /* harmony import */ var piral_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! piral-core */ "../../framework/piral-core/esm/utils/guid.js");
5654
- /* harmony import */ var piral_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! piral-core */ "../../framework/piral-core/esm/state/withApi.js");
5655
- /* harmony import */ var _default__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./default */ "../../plugins/piral-dashboard/esm/default.js");
5837
+ /* harmony import */ var _actions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./actions */ "../../plugins/piral-dashboard/esm/actions.js");
5838
+ /* harmony import */ var piral_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! piral-core */ "../../framework/piral-core/esm/utils/state.js");
5839
+ /* harmony import */ var piral_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! piral-core */ "../../framework/piral-core/esm/utils/guid.js");
5840
+ /* harmony import */ var piral_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! piral-core */ "../../framework/piral-core/esm/state/withApi.js");
5841
+ /* harmony import */ var _default__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./default */ "../../plugins/piral-dashboard/esm/default.js");
5842
+ /* harmony import */ var _Dashboard__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Dashboard */ "../../plugins/piral-dashboard/esm/Dashboard.js");
5656
5843
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
5657
5844
 
5658
5845
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
@@ -5663,6 +5850,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
5663
5850
 
5664
5851
 
5665
5852
 
5853
+
5666
5854
  function getPreferences(defaultPreferences) {
5667
5855
  var customPreferences = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
5668
5856
  return Object.assign(Object.assign({}, defaultPreferences), customPreferences);
@@ -5694,6 +5882,20 @@ function getTiles(items, defaultPreferences) {
5694
5882
 
5695
5883
  return tiles;
5696
5884
  }
5885
+
5886
+ function withTiles(tiles) {
5887
+ return function (state) {
5888
+ return Object.assign(Object.assign({}, state), {
5889
+ components: Object.assign({
5890
+ DashboardTile: _default__WEBPACK_IMPORTED_MODULE_0__.DefaultTile,
5891
+ DashboardContainer: _default__WEBPACK_IMPORTED_MODULE_0__.DefaultContainer
5892
+ }, state.components),
5893
+ registry: Object.assign(Object.assign({}, state.registry), {
5894
+ tiles: tiles
5895
+ })
5896
+ });
5897
+ };
5898
+ }
5697
5899
  /**
5698
5900
  * Creates the Pilet API extension for activating dashboard support.
5699
5901
  */
@@ -5706,18 +5908,8 @@ function createDashboardApi() {
5706
5908
  _config$defaultPrefer = config.defaultPreferences,
5707
5909
  defaultPreferences = _config$defaultPrefer === void 0 ? {} : _config$defaultPrefer;
5708
5910
  return function (context) {
5709
- context.defineActions(_actions__WEBPACK_IMPORTED_MODULE_0__);
5710
- context.dispatch(function (state) {
5711
- return Object.assign(Object.assign({}, state), {
5712
- components: Object.assign({
5713
- DashboardTile: _default__WEBPACK_IMPORTED_MODULE_1__.DefaultTile,
5714
- DashboardContainer: _default__WEBPACK_IMPORTED_MODULE_1__.DefaultContainer
5715
- }, state.components),
5716
- registry: Object.assign(Object.assign({}, state.registry), {
5717
- tiles: getTiles(tiles, defaultPreferences)
5718
- })
5719
- });
5720
- });
5911
+ context.defineActions(_actions__WEBPACK_IMPORTED_MODULE_1__);
5912
+ context.dispatch((0,piral_core__WEBPACK_IMPORTED_MODULE_2__.withAll)(withTiles(getTiles(tiles, defaultPreferences)), (0,piral_core__WEBPACK_IMPORTED_MODULE_2__.withRootExtension)('piral-dashboard', _Dashboard__WEBPACK_IMPORTED_MODULE_3__.Dashboard)));
5721
5913
  return function (api, target) {
5722
5914
  var pilet = target.name;
5723
5915
  var next = 0;
@@ -5729,10 +5921,10 @@ function createDashboardApi() {
5729
5921
  name = next++;
5730
5922
  }
5731
5923
 
5732
- var id = (0,piral_core__WEBPACK_IMPORTED_MODULE_2__.buildName)(pilet, name);
5924
+ var id = (0,piral_core__WEBPACK_IMPORTED_MODULE_4__.buildName)(pilet, name);
5733
5925
  context.registerTile(id, {
5734
5926
  pilet: pilet,
5735
- component: (0,piral_core__WEBPACK_IMPORTED_MODULE_3__.withApi)(context, arg, api, 'tile'),
5927
+ component: (0,piral_core__WEBPACK_IMPORTED_MODULE_5__.withApi)(context, arg, api, 'tile'),
5736
5928
  preferences: getPreferences(defaultPreferences, preferences)
5737
5929
  });
5738
5930
  return function () {
@@ -5740,7 +5932,7 @@ function createDashboardApi() {
5740
5932
  };
5741
5933
  },
5742
5934
  unregisterTile: function unregisterTile(name) {
5743
- var id = (0,piral_core__WEBPACK_IMPORTED_MODULE_2__.buildName)(pilet, name);
5935
+ var id = (0,piral_core__WEBPACK_IMPORTED_MODULE_4__.buildName)(pilet, name);
5744
5936
  context.unregisterTile(id);
5745
5937
  }
5746
5938
  };
@@ -6426,10 +6618,12 @@ __webpack_require__.r(__webpack_exports__);
6426
6618
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6427
6619
  /* harmony export */ "createMenuApi": () => (/* binding */ createMenuApi)
6428
6620
  /* harmony export */ });
6429
- /* harmony import */ var _actions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./actions */ "../../plugins/piral-menu/esm/actions.js");
6430
- /* harmony import */ var piral_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! piral-core */ "../../framework/piral-core/esm/utils/guid.js");
6431
- /* harmony import */ var piral_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! piral-core */ "../../framework/piral-core/esm/state/withApi.js");
6432
- /* harmony import */ var _default__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./default */ "../../plugins/piral-menu/esm/default.js");
6621
+ /* harmony import */ var _actions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./actions */ "../../plugins/piral-menu/esm/actions.js");
6622
+ /* harmony import */ var piral_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! piral-core */ "../../framework/piral-core/esm/utils/state.js");
6623
+ /* harmony import */ var piral_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! piral-core */ "../../framework/piral-core/esm/utils/guid.js");
6624
+ /* harmony import */ var piral_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! piral-core */ "../../framework/piral-core/esm/state/withApi.js");
6625
+ /* harmony import */ var _default__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./default */ "../../plugins/piral-menu/esm/default.js");
6626
+ /* harmony import */ var _Menu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Menu */ "../../plugins/piral-menu/esm/Menu.js");
6433
6627
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
6434
6628
 
6435
6629
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
@@ -6440,6 +6634,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
6440
6634
 
6441
6635
 
6442
6636
 
6637
+
6443
6638
  function getSettings(defaultSettings) {
6444
6639
  var customSettings = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
6445
6640
  return Object.assign(Object.assign({
@@ -6473,6 +6668,20 @@ function getMenuItems(items, defaultSettings) {
6473
6668
 
6474
6669
  return menuItems;
6475
6670
  }
6671
+
6672
+ function withMenu(menuItems) {
6673
+ return function (state) {
6674
+ return Object.assign(Object.assign({}, state), {
6675
+ components: Object.assign({
6676
+ MenuContainer: _default__WEBPACK_IMPORTED_MODULE_0__.DefaultContainer,
6677
+ MenuItem: _default__WEBPACK_IMPORTED_MODULE_0__.DefaultItem
6678
+ }, state.components),
6679
+ registry: Object.assign(Object.assign({}, state.registry), {
6680
+ menuItems: menuItems
6681
+ })
6682
+ });
6683
+ };
6684
+ }
6476
6685
  /**
6477
6686
  * Creates new Pilet API extensions for integration of menu items.
6478
6687
  */
@@ -6485,18 +6694,8 @@ function createMenuApi() {
6485
6694
  _config$defaultSettin = config.defaultSettings,
6486
6695
  defaultSettings = _config$defaultSettin === void 0 ? {} : _config$defaultSettin;
6487
6696
  return function (context) {
6488
- context.defineActions(_actions__WEBPACK_IMPORTED_MODULE_0__);
6489
- context.dispatch(function (state) {
6490
- return Object.assign(Object.assign({}, state), {
6491
- components: Object.assign({
6492
- MenuContainer: _default__WEBPACK_IMPORTED_MODULE_1__.DefaultContainer,
6493
- MenuItem: _default__WEBPACK_IMPORTED_MODULE_1__.DefaultItem
6494
- }, state.components),
6495
- registry: Object.assign(Object.assign({}, state.registry), {
6496
- menuItems: getMenuItems(items, defaultSettings)
6497
- })
6498
- });
6499
- });
6697
+ context.defineActions(_actions__WEBPACK_IMPORTED_MODULE_1__);
6698
+ context.dispatch((0,piral_core__WEBPACK_IMPORTED_MODULE_2__.withAll)(withMenu(getMenuItems(items, defaultSettings)), (0,piral_core__WEBPACK_IMPORTED_MODULE_2__.withRootExtension)('piral-menu', _Menu__WEBPACK_IMPORTED_MODULE_3__.Menu)));
6500
6699
  return function (api, target) {
6501
6700
  var pilet = target.name;
6502
6701
  var next = 0;
@@ -6508,10 +6707,10 @@ function createMenuApi() {
6508
6707
  name = next++;
6509
6708
  }
6510
6709
 
6511
- var id = (0,piral_core__WEBPACK_IMPORTED_MODULE_2__.buildName)(pilet, name);
6710
+ var id = (0,piral_core__WEBPACK_IMPORTED_MODULE_4__.buildName)(pilet, name);
6512
6711
  context.registerMenuItem(id, {
6513
6712
  pilet: pilet,
6514
- component: (0,piral_core__WEBPACK_IMPORTED_MODULE_3__.withApi)(context, arg, api, 'menu'),
6713
+ component: (0,piral_core__WEBPACK_IMPORTED_MODULE_5__.withApi)(context, arg, api, 'menu'),
6515
6714
  settings: getSettings(defaultSettings, settings)
6516
6715
  });
6517
6716
  return function () {
@@ -6519,7 +6718,7 @@ function createMenuApi() {
6519
6718
  };
6520
6719
  },
6521
6720
  unregisterMenu: function unregisterMenu(name) {
6522
- var id = (0,piral_core__WEBPACK_IMPORTED_MODULE_2__.buildName)(pilet, name);
6721
+ var id = (0,piral_core__WEBPACK_IMPORTED_MODULE_4__.buildName)(pilet, name);
6523
6722
  context.unregisterMenuItem(id);
6524
6723
  }
6525
6724
  };
@@ -6755,10 +6954,12 @@ __webpack_require__.r(__webpack_exports__);
6755
6954
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6756
6955
  /* harmony export */ "createModalsApi": () => (/* binding */ createModalsApi)
6757
6956
  /* harmony export */ });
6758
- /* harmony import */ var _actions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./actions */ "../../plugins/piral-modals/esm/actions.js");
6759
- /* harmony import */ var piral_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! piral-core */ "../../framework/piral-core/esm/utils/guid.js");
6760
- /* harmony import */ var piral_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! piral-core */ "../../framework/piral-core/esm/state/withApi.js");
6761
- /* harmony import */ var _default__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./default */ "../../plugins/piral-modals/esm/default.js");
6957
+ /* harmony import */ var _actions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./actions */ "../../plugins/piral-modals/esm/actions.js");
6958
+ /* harmony import */ var piral_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! piral-core */ "../../framework/piral-core/esm/utils/state.js");
6959
+ /* harmony import */ var piral_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! piral-core */ "../../framework/piral-core/esm/utils/guid.js");
6960
+ /* harmony import */ var piral_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! piral-core */ "../../framework/piral-core/esm/state/withApi.js");
6961
+ /* harmony import */ var _default__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./default */ "../../plugins/piral-modals/esm/default.js");
6962
+ /* harmony import */ var _Modals__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Modals */ "../../plugins/piral-modals/esm/Modals.js");
6762
6963
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
6763
6964
 
6764
6965
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
@@ -6769,6 +6970,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
6769
6970
 
6770
6971
 
6771
6972
 
6973
+
6772
6974
  function getModalDialogs(dialogs) {
6773
6975
  var modals = {};
6774
6976
 
@@ -6796,6 +6998,21 @@ function getModalDialogs(dialogs) {
6796
6998
 
6797
6999
  return modals;
6798
7000
  }
7001
+
7002
+ function withModals(modals) {
7003
+ return function (state) {
7004
+ return Object.assign(Object.assign({}, state), {
7005
+ components: Object.assign({
7006
+ ModalsHost: _default__WEBPACK_IMPORTED_MODULE_0__.DefaultHost,
7007
+ ModalsDialog: _default__WEBPACK_IMPORTED_MODULE_0__.DefaultDialog
7008
+ }, state.components),
7009
+ registry: Object.assign(Object.assign({}, state.registry), {
7010
+ modals: modals
7011
+ }),
7012
+ modals: []
7013
+ });
7014
+ };
7015
+ }
6799
7016
  /**
6800
7017
  * Creates new Pilet API extensions for support modal dialogs.
6801
7018
  */
@@ -6810,24 +7027,13 @@ function createModalsApi() {
6810
7027
  return "".concat(name, "-").concat(~~(Math.random() * 10000));
6811
7028
  } : _config$selectId;
6812
7029
  return function (context) {
6813
- context.defineActions(_actions__WEBPACK_IMPORTED_MODULE_0__);
6814
- context.dispatch(function (state) {
6815
- return Object.assign(Object.assign({}, state), {
6816
- components: Object.assign({
6817
- ModalsHost: _default__WEBPACK_IMPORTED_MODULE_1__.DefaultHost,
6818
- ModalsDialog: _default__WEBPACK_IMPORTED_MODULE_1__.DefaultDialog
6819
- }, state.components),
6820
- registry: Object.assign(Object.assign({}, state.registry), {
6821
- modals: getModalDialogs(dialogs)
6822
- }),
6823
- modals: []
6824
- });
6825
- });
7030
+ context.defineActions(_actions__WEBPACK_IMPORTED_MODULE_1__);
7031
+ context.dispatch((0,piral_core__WEBPACK_IMPORTED_MODULE_2__.withAll)(withModals(getModalDialogs(dialogs)), (0,piral_core__WEBPACK_IMPORTED_MODULE_2__.withRootExtension)('piral-modals', _Modals__WEBPACK_IMPORTED_MODULE_3__.Modals)));
6826
7032
  return function (api, target) {
6827
7033
  var pilet = target.name;
6828
7034
  return {
6829
7035
  showModal: function showModal(simpleName, options) {
6830
- var name = (0,piral_core__WEBPACK_IMPORTED_MODULE_2__.buildName)(pilet, simpleName);
7036
+ var name = (0,piral_core__WEBPACK_IMPORTED_MODULE_4__.buildName)(pilet, simpleName);
6831
7037
  var dialog = {
6832
7038
  id: selectId(name),
6833
7039
  name: name,
@@ -6843,11 +7049,11 @@ function createModalsApi() {
6843
7049
  return dialog.close;
6844
7050
  },
6845
7051
  registerModal: function registerModal(name, arg, defaults) {
6846
- var id = (0,piral_core__WEBPACK_IMPORTED_MODULE_2__.buildName)(pilet, name);
7052
+ var id = (0,piral_core__WEBPACK_IMPORTED_MODULE_4__.buildName)(pilet, name);
6847
7053
  context.registerModal(id, {
6848
7054
  pilet: pilet,
6849
7055
  name: name,
6850
- component: (0,piral_core__WEBPACK_IMPORTED_MODULE_3__.withApi)(context, arg, api, 'modal'),
7056
+ component: (0,piral_core__WEBPACK_IMPORTED_MODULE_5__.withApi)(context, arg, api, 'modal'),
6851
7057
  defaults: defaults
6852
7058
  });
6853
7059
  return function () {
@@ -6855,7 +7061,7 @@ function createModalsApi() {
6855
7061
  };
6856
7062
  },
6857
7063
  unregisterModal: function unregisterModal(name) {
6858
- var id = (0,piral_core__WEBPACK_IMPORTED_MODULE_2__.buildName)(pilet, name);
7064
+ var id = (0,piral_core__WEBPACK_IMPORTED_MODULE_4__.buildName)(pilet, name);
6859
7065
  context.unregisterModal(id);
6860
7066
  }
6861
7067
  };
@@ -7022,11 +7228,13 @@ __webpack_require__.r(__webpack_exports__);
7022
7228
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7023
7229
  /* harmony export */ "createNotificationsApi": () => (/* binding */ createNotificationsApi)
7024
7230
  /* harmony export */ });
7025
- /* harmony import */ var _actions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./actions */ "../../plugins/piral-notifications/esm/actions.js");
7231
+ /* harmony import */ var _actions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./actions */ "../../plugins/piral-notifications/esm/actions.js");
7026
7232
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../../../node_modules/react/index.js");
7027
7233
  /* harmony import */ var piral_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! piral-core */ "../../framework/piral-core/esm/utils/react.js");
7028
- /* harmony import */ var piral_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! piral-core */ "../../framework/piral-core/esm/state/withApi.js");
7029
- /* harmony import */ var _default__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./default */ "../../plugins/piral-notifications/esm/default.js");
7234
+ /* harmony import */ var piral_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! piral-core */ "../../framework/piral-core/esm/utils/state.js");
7235
+ /* harmony import */ var piral_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! piral-core */ "../../framework/piral-core/esm/state/withApi.js");
7236
+ /* harmony import */ var _default__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./default */ "../../plugins/piral-notifications/esm/default.js");
7237
+ /* harmony import */ var _Notifications__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Notifications */ "../../plugins/piral-notifications/esm/Notifications.js");
7030
7238
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
7031
7239
 
7032
7240
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
@@ -7038,6 +7246,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
7038
7246
 
7039
7247
 
7040
7248
 
7249
+
7041
7250
  function isElement(element) {
7042
7251
  return /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.isValidElement)(element);
7043
7252
  }
@@ -7101,6 +7310,18 @@ function getNotifications(context, messages, defaultOptions) {
7101
7310
 
7102
7311
  return notifications;
7103
7312
  }
7313
+
7314
+ function withNotifications(notifications) {
7315
+ return function (state) {
7316
+ return Object.assign(Object.assign({}, state), {
7317
+ components: Object.assign({
7318
+ NotificationsHost: _default__WEBPACK_IMPORTED_MODULE_2__.DefaultHost,
7319
+ NotificationsToast: _default__WEBPACK_IMPORTED_MODULE_2__.DefaultToast
7320
+ }, state.components),
7321
+ notifications: notifications
7322
+ });
7323
+ };
7324
+ }
7104
7325
  /**
7105
7326
  * Creates new Pilet API extensions for showing notifications.
7106
7327
  */
@@ -7117,20 +7338,12 @@ function createNotificationsApi() {
7117
7338
  _config$messages = config.messages,
7118
7339
  messages = _config$messages === void 0 ? [] : _config$messages;
7119
7340
  return function (context) {
7120
- context.defineActions(_actions__WEBPACK_IMPORTED_MODULE_2__);
7121
- context.dispatch(function (state) {
7122
- return Object.assign(Object.assign({}, state), {
7123
- components: Object.assign({
7124
- NotificationsHost: _default__WEBPACK_IMPORTED_MODULE_3__.DefaultHost,
7125
- NotificationsToast: _default__WEBPACK_IMPORTED_MODULE_3__.DefaultToast
7126
- }, state.components),
7127
- notifications: getNotifications(context, messages, defaultOptions)
7128
- });
7129
- });
7341
+ context.defineActions(_actions__WEBPACK_IMPORTED_MODULE_3__);
7342
+ context.dispatch((0,piral_core__WEBPACK_IMPORTED_MODULE_4__.withAll)(withNotifications(getNotifications(context, messages, defaultOptions)), (0,piral_core__WEBPACK_IMPORTED_MODULE_4__.withRootExtension)('piral-notifications', _Notifications__WEBPACK_IMPORTED_MODULE_5__.Notifications)));
7130
7343
  return function (api) {
7131
7344
  return {
7132
7345
  showNotification: function showNotification(content, customOptions) {
7133
- var Component = typeof content === 'string' ? content : isElement(content) ? content : (0,piral_core__WEBPACK_IMPORTED_MODULE_4__.withApi)(context, content, api, 'extension');
7346
+ var Component = typeof content === 'string' ? content : isElement(content) ? content : (0,piral_core__WEBPACK_IMPORTED_MODULE_6__.withApi)(context, content, api, 'extension');
7134
7347
  var notification = createNotification(context, selectId(), Component, defaultOptions, customOptions);
7135
7348
  context.openNotification(notification);
7136
7349
  return notification.close;
@@ -7462,9 +7675,12 @@ __webpack_require__.r(__webpack_exports__);
7462
7675
  /* harmony import */ var piral_base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! piral-base */ "../../framework/piral-base/esm/utils.js");
7463
7676
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../../../node_modules/react/index.js");
7464
7677
  /* harmony import */ var piral_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! piral-core */ "../../framework/piral-core/esm/state/withApi.js");
7465
- /* harmony import */ var piral_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! piral-core */ "../../framework/piral-core/esm/utils/guid.js");
7466
- /* harmony import */ var _actions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./actions */ "../../plugins/piral-search/esm/actions.js");
7467
- /* harmony import */ var _default__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./default */ "../../plugins/piral-search/esm/default.js");
7678
+ /* harmony import */ var piral_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! piral-core */ "../../framework/piral-core/esm/utils/state.js");
7679
+ /* harmony import */ var piral_core__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! piral-core */ "../../framework/piral-core/esm/utils/guid.js");
7680
+ /* harmony import */ var _actions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./actions */ "../../plugins/piral-search/esm/actions.js");
7681
+ /* harmony import */ var _default__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./default */ "../../plugins/piral-search/esm/default.js");
7682
+ /* harmony import */ var _Search__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Search */ "../../plugins/piral-search/esm/Search.js");
7683
+ /* harmony import */ var _SearchInput__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./SearchInput */ "../../plugins/piral-search/esm/SearchInput.js");
7468
7684
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
7469
7685
 
7470
7686
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
@@ -7478,6 +7694,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
7478
7694
 
7479
7695
 
7480
7696
 
7697
+
7698
+
7481
7699
  function noop() {}
7482
7700
 
7483
7701
  function createSearchRegistration(pilet, search) {
@@ -7538,6 +7756,28 @@ function wrapResults(result, api, context) {
7538
7756
  return toChild(item, api, context);
7539
7757
  });
7540
7758
  }
7759
+
7760
+ function withSearch(searchProviders, query, items) {
7761
+ return function (state) {
7762
+ return Object.assign(Object.assign({}, state), {
7763
+ components: Object.assign({
7764
+ SearchContainer: _default__WEBPACK_IMPORTED_MODULE_4__.DefaultContainer,
7765
+ SearchInput: _default__WEBPACK_IMPORTED_MODULE_4__.DefaultInput,
7766
+ SearchResult: _default__WEBPACK_IMPORTED_MODULE_4__.DefaultResult
7767
+ }, state.components),
7768
+ registry: Object.assign(Object.assign({}, state.registry), {
7769
+ searchProviders: searchProviders
7770
+ }),
7771
+ search: {
7772
+ input: query,
7773
+ results: {
7774
+ loading: false,
7775
+ items: items
7776
+ }
7777
+ }
7778
+ });
7779
+ };
7780
+ }
7541
7781
  /**
7542
7782
  * Creates new Pilet API extensions for search and filtering.
7543
7783
  */
@@ -7555,26 +7795,8 @@ function createSearchApi() {
7555
7795
  actionConfig = (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__rest)(config, ["providers", "results", "query"]);
7556
7796
 
7557
7797
  return function (context) {
7558
- context.defineActions((0,_actions__WEBPACK_IMPORTED_MODULE_4__.createActions)(actionConfig));
7559
- context.dispatch(function (state) {
7560
- return Object.assign(Object.assign({}, state), {
7561
- components: Object.assign({
7562
- SearchContainer: _default__WEBPACK_IMPORTED_MODULE_5__.DefaultContainer,
7563
- SearchInput: _default__WEBPACK_IMPORTED_MODULE_5__.DefaultInput,
7564
- SearchResult: _default__WEBPACK_IMPORTED_MODULE_5__.DefaultResult
7565
- }, state.components),
7566
- registry: Object.assign(Object.assign({}, state.registry), {
7567
- searchProviders: getSearchProviders(providers)
7568
- }),
7569
- search: {
7570
- input: query,
7571
- results: {
7572
- loading: false,
7573
- items: results
7574
- }
7575
- }
7576
- });
7577
- });
7798
+ context.defineActions((0,_actions__WEBPACK_IMPORTED_MODULE_5__.createActions)(actionConfig));
7799
+ context.dispatch((0,piral_core__WEBPACK_IMPORTED_MODULE_6__.withAll)(withSearch(getSearchProviders(providers), query, results), (0,piral_core__WEBPACK_IMPORTED_MODULE_6__.withRootExtension)('piral-search', _Search__WEBPACK_IMPORTED_MODULE_7__.Search), (0,piral_core__WEBPACK_IMPORTED_MODULE_6__.withRootExtension)('piral-search-input', _SearchInput__WEBPACK_IMPORTED_MODULE_8__.SearchInput)));
7578
7800
  return function (api, target) {
7579
7801
  var pilet = target.name;
7580
7802
  var next = 0;
@@ -7586,7 +7808,7 @@ function createSearchApi() {
7586
7808
  name = next++;
7587
7809
  }
7588
7810
 
7589
- var id = (0,piral_core__WEBPACK_IMPORTED_MODULE_6__.buildName)(pilet, name);
7811
+ var id = (0,piral_core__WEBPACK_IMPORTED_MODULE_9__.buildName)(pilet, name);
7590
7812
  context.registerSearchProvider(id, createSearchRegistration(pilet, function (q) {
7591
7813
  return Promise.resolve(provider(q, api)).then(function (results) {
7592
7814
  return wrapResults(results, api, context);
@@ -7599,7 +7821,7 @@ function createSearchApi() {
7599
7821
  };
7600
7822
  },
7601
7823
  unregisterSearchProvider: function unregisterSearchProvider(name) {
7602
- var id = (0,piral_core__WEBPACK_IMPORTED_MODULE_6__.buildName)(pilet, name);
7824
+ var id = (0,piral_core__WEBPACK_IMPORTED_MODULE_9__.buildName)(pilet, name);
7603
7825
  context.unregisterSearchProvider(id);
7604
7826
  }
7605
7827
  };
@@ -8719,12 +8941,12 @@ function installPiralDebug(options) {
8719
8941
  debug: debugApiVersion,
8720
8942
  instance: {
8721
8943
  name: "sample-piral",
8722
- version: "0.14.3-beta.3303",
8944
+ version: "0.14.4",
8723
8945
  dependencies: "reactstrap,react,react-dom,react-router,react-router-dom,history,tslib,path-to-regexp,@libre/atom,@dbeining/react-atom"
8724
8946
  },
8725
8947
  build: {
8726
- date: "2021-11-26T01:19:30.603Z",
8727
- cli: "0.14.2",
8948
+ date: "2021-12-01T01:31:44.431Z",
8949
+ cli: "0.14.4",
8728
8950
  compat: "0.14"
8729
8951
  },
8730
8952
  pilets: {
@@ -80022,4 +80244,4 @@ var layout_1 = __webpack_require__(/*! ./layout */ "./src/layout.tsx");
80022
80244
 
80023
80245
  /******/ })()
80024
80246
  ;
80025
- //# sourceMappingURL=index.8f63eb.js.map
80247
+ //# sourceMappingURL=index.1449bd.js.map