@wavemaker-ai/react-runtime 1.0.0-rc.309 → 1.0.0-rc.647469
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/actions/navigation-action.js +5 -23
- package/components/advanced/carousel/index.d.ts +0 -1
- package/components/advanced/carousel/index.js +1 -2
- package/components/advanced/carousel/template.d.ts +0 -1
- package/components/advanced/carousel/template.js +1 -2
- package/components/advanced/login/index.d.ts +0 -1
- package/components/advanced/marquee/index.d.ts +0 -1
- package/components/advanced/marquee/index.js +1 -2
- package/components/basic/anchor/index.d.ts +0 -1
- package/components/basic/anchor/index.js +3 -4
- package/components/basic/audio/index.d.ts +0 -1
- package/components/basic/audio/index.js +2 -3
- package/components/basic/html/index.d.ts +0 -1
- package/components/basic/icon/index.d.ts +0 -1
- package/components/basic/icon/index.js +7 -4
- package/components/basic/iframe/iframe.utils.d.ts +1 -1
- package/components/basic/iframe/iframe.utils.js +4 -8
- package/components/basic/iframe/index.d.ts +0 -1
- package/components/basic/label/index.d.ts +0 -1
- package/components/basic/label/index.js +2 -3
- package/components/basic/message/index.js +1 -1
- package/components/basic/picture/index.d.ts +0 -1
- package/components/basic/picture/index.js +4 -3
- package/components/basic/progress-bar/index.d.ts +0 -1
- package/components/basic/progress-bar/index.js +1 -2
- package/components/basic/progress-circle/index.d.ts +0 -1
- package/components/basic/richtexteditor/index.d.ts +0 -2
- package/components/basic/search/index.d.ts +0 -3
- package/components/basic/search/index.js +4 -7
- package/components/basic/search/props.d.ts +0 -2
- package/components/basic/spinner/index.d.ts +0 -1
- package/components/basic/tile/index.d.ts +0 -1
- package/components/basic/tile/index.js +1 -2
- package/components/basic/tree/Components/TreeNodeComponent.js +5 -9
- package/components/basic/tree/index.d.ts +0 -1
- package/components/basic/tree/index.js +3 -14
- package/components/basic/tree/utils.d.ts +0 -2
- package/components/basic/tree/utils.js +1 -11
- package/components/basic/video/index.d.ts +0 -1
- package/components/basic/video/index.js +23 -40
- package/components/chart/index.d.ts +0 -1
- package/components/common/AppSpinner.js +5 -2
- package/components/container/accordion/accordion-pane/index.d.ts +0 -1
- package/components/container/accordion/accordion-pane/index.js +4 -1
- package/components/container/accordion/index.d.ts +0 -1
- package/components/container/index.d.ts +0 -3
- package/components/container/index.js +1 -6
- package/components/container/layout-grid/grid-column/index.d.ts +0 -1
- package/components/container/layout-grid/grid-row/index.d.ts +0 -1
- package/components/container/layout-grid/index.d.ts +0 -1
- package/components/container/layout-grid/index.js +8 -4
- package/components/container/linear-layout/index.d.ts +0 -1
- package/components/container/linear-layout/linear-layout-item/index.d.ts +0 -1
- package/components/container/panel/components/panel-header/index.js +6 -11
- package/components/container/panel/components/panel-header/props.d.ts +0 -5
- package/components/container/panel/index.d.ts +0 -1
- package/components/container/panel/index.js +1 -2
- package/components/container/props.d.ts +0 -2
- package/components/container/repeat-template/index.d.ts +1 -22
- package/components/container/repeat-template/index.js +1 -2
- package/components/container/tabs/index.d.ts +1 -3
- package/components/container/tabs/index.js +51 -102
- package/components/container/tabs/props.d.ts +0 -12
- package/components/container/tabs/tab-pane/index.d.ts +0 -1
- package/components/container/tabs/tab-pane/index.js +11 -28
- package/components/container/wizard/index.d.ts +0 -2
- package/components/container/wizard/wizard-step/index.d.ts +0 -1
- package/components/container/wizard/wizard-step/index.js +2 -2
- package/components/data/card/card-actions/index.d.ts +0 -1
- package/components/data/card/card-actions/index.js +5 -3
- package/components/data/card/card-content/index.d.ts +0 -1
- package/components/data/card/card-content/index.js +13 -3
- package/components/data/card/card-footer/index.d.ts +0 -1
- package/components/data/card/card-footer/index.js +5 -3
- package/components/data/card/index.d.ts +0 -1
- package/components/data/card/index.js +14 -3
- package/components/data/form/dynamic-fields/index.js +1 -7
- package/components/data/form/dynamic-fields/props.d.ts +0 -1
- package/components/data/form/form-action/index.d.ts +0 -2
- package/components/data/form/form-body/index.js +1 -2
- package/components/data/form/form-field/base-field.js +3 -4
- package/components/data/form/form-footer/index.js +1 -2
- package/components/data/list/components/ListItemWithTemplate.js +2 -4
- package/components/data/list/hooks/props.d.ts +2 -2
- package/components/data/list/hooks/useListEventHandlers.js +6 -6
- package/components/data/list/index.d.ts +0 -2
- package/components/data/list/index.js +4 -3
- package/components/data/list/props.d.ts +1 -2
- package/components/data/list/utils/list-widget-methods.d.ts +1 -2
- package/components/data/table/components/RowCells.d.ts +2 -16
- package/components/data/table/components/RowCells.js +24 -38
- package/components/data/table/components/TableBody.js +3 -11
- package/components/data/table/components/TableDataRow.d.ts +0 -3
- package/components/data/table/components/TableDataRow.js +3 -11
- package/components/data/table/components/TableHeader.js +4 -1
- package/components/data/table/hooks/index.d.ts +0 -1
- package/components/data/table/hooks/index.js +0 -12
- package/components/data/table/hooks/useDynamicColumns.js +1 -1
- package/components/data/table/hooks/useResponsiveColumns.d.ts +0 -1
- package/components/data/table/hooks/useRowSelection.d.ts +1 -1
- package/components/data/table/hooks/useRowSelection.js +5 -26
- package/components/data/table/hooks/useTableInitialization.js +1 -2
- package/components/data/table/index.d.ts +0 -4
- package/components/data/table/index.js +12 -77
- package/components/data/table/live-table/index.d.ts +0 -1
- package/components/data/table/props.d.ts +0 -7
- package/components/data/table/table-action/index.d.ts +0 -1
- package/components/data/table/table-column/index.d.ts +0 -1
- package/components/data/table/table-row/index.d.ts +0 -1
- package/components/data/table/table-row-action/index.d.ts +0 -1
- package/components/data/table/utils/buildSelectionColumns.js +1 -7
- package/components/data/table/utils/columnBuilder.js +1 -1
- package/components/data/table/utils/index.js +2 -2
- package/components/data/table/utils/renderDisplayCell.js +1 -1
- package/components/dialogs/alert-dialog/index.d.ts +0 -2
- package/components/dialogs/confirm-dialog/index.d.ts +0 -2
- package/components/dialogs/dialog/index.d.ts +0 -2
- package/components/dialogs/dialog/index.js +4 -2
- package/components/dialogs/dialog-actions/index.d.ts +0 -1
- package/components/dialogs/dialog-body/index.d.ts +0 -1
- package/components/dialogs/dialog-content/index.d.ts +0 -1
- package/components/dialogs/dialog-header/index.d.ts +0 -1
- package/components/dialogs/iframe-dialog/index.d.ts +0 -2
- package/components/dialogs/login-dialog/index.d.ts +0 -2
- package/components/dialogs/page-dialog/index.d.ts +0 -2
- package/components/form/button/index.d.ts +0 -1
- package/components/form/button/index.js +3 -4
- package/components/form/button-group/index.d.ts +0 -1
- package/components/form/button-group/index.js +1 -2
- package/components/input/calendar/index.d.ts +0 -2
- package/components/input/chips/index.d.ts +0 -2
- package/components/input/color-picker/index.d.ts +0 -2
- package/components/input/composite/index.d.ts +0 -1
- package/components/input/currency/index.d.ts +0 -2
- package/components/input/default/checkbox/index.d.ts +0 -2
- package/components/input/default/checkboxset/index.d.ts +0 -2
- package/components/input/default/radioset/index.d.ts +0 -2
- package/components/input/default/switch/index.d.ts +0 -2
- package/components/input/epoch/date/components/DatePickerPopover.js +29 -11
- package/components/input/epoch/date/index.d.ts +0 -1
- package/components/input/epoch/datetime/index.d.ts +0 -1
- package/components/input/epoch/datetime/index.js +25 -10
- package/components/input/epoch/datetime/styled.d.ts +78 -0
- package/components/input/epoch/datetime/styled.js +90 -0
- package/components/input/epoch/time/index.d.ts +0 -1
- package/components/input/epoch/time/index.js +1 -1
- package/components/input/epoch/time/utils.d.ts +17 -0
- package/components/input/epoch/time/utils.js +18 -1
- package/components/input/fileupload/index.d.ts +0 -1
- package/components/input/number/index.d.ts +0 -2
- package/components/input/rating/index.d.ts +0 -2
- package/components/input/rating/index.js +17 -14
- package/components/input/select/index.d.ts +0 -2
- package/components/input/select/index.js +4 -1
- package/components/input/slider/index.d.ts +0 -2
- package/components/input/slider/index.js +12 -13
- package/components/input/text/index.d.ts +0 -2
- package/components/input/text/index.js +14 -3
- package/components/input/textarea/index.d.ts +0 -2
- package/components/input/textarea/index.js +10 -7
- package/components/input/upload/index.d.ts +0 -2
- package/components/input/upload/index.js +5 -3
- package/components/layout/footer/index.js +1 -2
- package/components/layout/footer/props.d.ts +0 -1
- package/components/layout/header/index.js +1 -2
- package/components/layout/header/props.d.ts +0 -1
- package/components/layout/leftnav/index.js +1 -2
- package/components/layout/leftnav/props.d.ts +0 -1
- package/components/layout/rightnav/index.js +1 -2
- package/components/layout/rightnav/props.d.ts +0 -1
- package/components/layout/topnav/index.js +1 -2
- package/components/layout/topnav/props.d.ts +0 -1
- package/components/navbar/index.d.ts +0 -1
- package/components/navbar/index.js +1 -2
- package/components/navbar/nav/index.d.ts +0 -1
- package/components/navbar/nav-item/index.d.ts +0 -1
- package/components/navbar/nav-item/index.js +1 -2
- package/components/navigation/breadcrumb/index.d.ts +0 -1
- package/components/navigation/menu/index.d.ts +0 -1
- package/components/navigation/menu/index.js +4 -5
- package/components/navigation/popover/index.d.ts +1 -2
- package/components/navigation/popover/index.js +1 -1
- package/components/page/error-boundary/index.js +5 -5
- package/components/page/index.js +9 -13
- package/components/page/partial/index.d.ts +0 -1
- package/components/prefab/container/index.js +1 -2
- package/context/WidgetProvider.js +2 -2
- package/core/app.service.js +35 -40
- package/core/constants/events.js +0 -6
- package/core/constants/index.d.ts +1 -9
- package/core/constants/index.js +5 -32
- package/core/formatter/date-formatters.d.ts +1 -1
- package/core/formatter/date-formatters.js +13 -38
- package/core/formatter/types.d.ts +1 -1
- package/core/proxy-service.js +5 -15
- package/core/util/index.js +2 -3
- package/higherOrder/BaseApp.js +2 -2
- package/higherOrder/BasePage.d.ts +17 -0
- package/higherOrder/BasePage.js +104 -53
- package/higherOrder/BasePrefab.js +59 -69
- package/higherOrder/props.d.ts +0 -1
- package/higherOrder/withBaseWrapper.js +4 -3
- package/hooks/useAccess.js +0 -13
- package/mui-config/theme.js +4 -1
- package/package-lock.json +605 -2630
- package/package.json +4 -23
- package/store/middleware/navigationMiddleware.js +1 -1
- package/store/slices/appConfigSlice.js +8 -10
- package/store/slices/authSlice.js +32 -46
- package/tsconfig.declaration.tsbuildinfo +1 -1
- package/types/index.d.ts +0 -1
- package/utils/attr.js +14 -71
- package/utils/lib-error-skipper.d.ts +26 -4
- package/utils/lib-error-skipper.js +165 -41
- package/utils/style-utils.d.ts +0 -6
- package/utils/style-utils.js +1 -10
- package/variables/metadata.service.js +3 -2
- package/variables/model-variable.js +7 -10
- package/variables/service-variable.d.ts +0 -1
- package/variables/service-variable.js +6 -26
- package/actions/base-action.d.ts +0 -7
- package/actions/login-action.d.ts +0 -11
- package/actions/logout-action.d.ts +0 -10
- package/actions/navigation-action.d.ts +0 -35
- package/actions/notification-action.d.ts +0 -20
- package/actions/timer-action.d.ts +0 -27
- package/components/data/table/hooks/useCustomExpressionColumns.d.ts +0 -16
- package/components/data/table/hooks/useCustomExpressionColumns.js +0 -88
- package/core/security.service.d.ts +0 -12
- package/mui-config/theme-provider.d.ts +0 -3
- package/mui-config/theme.d.ts +0 -2
- package/runtime-dynamic/App.d.ts +0 -7
- package/runtime-dynamic/App.js +0 -144
- package/runtime-dynamic/app-initializer.d.ts +0 -15
- package/runtime-dynamic/app-initializer.js +0 -447
- package/runtime-dynamic/components/ErrorBoundary.d.ts +0 -18
- package/runtime-dynamic/components/ErrorBoundary.js +0 -93
- package/runtime-dynamic/components/PageWrapper.d.ts +0 -1
- package/runtime-dynamic/components/PageWrapper.js +0 -43
- package/runtime-dynamic/components/PrefabPreview.d.ts +0 -1
- package/runtime-dynamic/components/PrefabPreview.js +0 -84
- package/runtime-dynamic/components/partial-content.d.ts +0 -15
- package/runtime-dynamic/components/partial-content.js +0 -50
- package/runtime-dynamic/components/prefab-content.d.ts +0 -10
- package/runtime-dynamic/components/prefab-content.js +0 -31
- package/runtime-dynamic/components/use-dynamic-component.d.ts +0 -10
- package/runtime-dynamic/components/use-dynamic-component.js +0 -165
- package/runtime-dynamic/factories/build-base-page-like-component.d.ts +0 -8
- package/runtime-dynamic/factories/build-base-page-like-component.js +0 -59
- package/runtime-dynamic/factories/prefab-factory.d.ts +0 -3
- package/runtime-dynamic/factories/prefab-factory.js +0 -82
- package/runtime-dynamic/factories/startup-info.d.ts +0 -6
- package/runtime-dynamic/factories/startup-info.js +0 -28
- package/runtime-dynamic/factories/utils.d.ts +0 -23
- package/runtime-dynamic/factories/utils.js +0 -131
- package/runtime-dynamic/index.d.ts +0 -14
- package/runtime-dynamic/index.js +0 -191
- package/runtime-dynamic/main.d.ts +0 -2
- package/runtime-dynamic/main.js +0 -84
- package/runtime-dynamic/preview-mode.d.ts +0 -15
- package/runtime-dynamic/preview-mode.js +0 -31
- package/runtime-dynamic/preview-navigation.d.ts +0 -6
- package/runtime-dynamic/preview-navigation.js +0 -38
- package/runtime-dynamic/preview-resource-base.d.ts +0 -12
- package/runtime-dynamic/preview-resource-base.js +0 -65
- package/runtime-dynamic/registry/component-registry.d.ts +0 -3
- package/runtime-dynamic/registry/component-registry.js +0 -353
- package/runtime-dynamic/registry/custom-widget-registry.d.ts +0 -7
- package/runtime-dynamic/registry/custom-widget-registry.js +0 -18
- package/runtime-dynamic/registry/index.d.ts +0 -2
- package/runtime-dynamic/registry/index.js +0 -63
- package/runtime-dynamic/registry/store.d.ts +0 -9
- package/runtime-dynamic/registry/store.js +0 -26
- package/runtime-dynamic/routes.d.ts +0 -2
- package/runtime-dynamic/routes.js +0 -107
- package/runtime-dynamic/services/app-extension-provider.d.ts +0 -1
- package/runtime-dynamic/services/app-extension-provider.js +0 -45
- package/runtime-dynamic/services/cache.d.ts +0 -29
- package/runtime-dynamic/services/cache.js +0 -57
- package/runtime-dynamic/services/component-ref-provider.d.ts +0 -12
- package/runtime-dynamic/services/component-ref-provider.js +0 -149
- package/runtime-dynamic/services/css-scoping.d.ts +0 -2
- package/runtime-dynamic/services/css-scoping.js +0 -53
- package/runtime-dynamic/services/fragment-url.d.ts +0 -16
- package/runtime-dynamic/services/fragment-url.js +0 -74
- package/runtime-dynamic/services/index.d.ts +0 -10
- package/runtime-dynamic/services/index.js +0 -152
- package/runtime-dynamic/services/markup-transpiler.d.ts +0 -12
- package/runtime-dynamic/services/markup-transpiler.js +0 -250
- package/runtime-dynamic/services/prefab-resources.d.ts +0 -18
- package/runtime-dynamic/services/prefab-resources.js +0 -159
- package/runtime-dynamic/services/resource-manager.d.ts +0 -2
- package/runtime-dynamic/services/resource-manager.js +0 -66
- package/runtime-dynamic/services/script-executor.d.ts +0 -8
- package/runtime-dynamic/services/script-executor.js +0 -90
- package/runtime-dynamic/services/variable-factory.d.ts +0 -2
- package/runtime-dynamic/services/variable-factory.js +0 -260
- package/runtime-dynamic/services/variable-registry.d.ts +0 -12
- package/runtime-dynamic/services/variable-registry.js +0 -118
- package/runtime-dynamic/services/variable-transpiler.d.ts +0 -5
- package/runtime-dynamic/services/variable-transpiler.js +0 -159
- package/runtime-dynamic/shims/next-image.d.ts +0 -35
- package/runtime-dynamic/shims/next-image.js +0 -60
- package/runtime-dynamic/shims/next-link.d.ts +0 -25
- package/runtime-dynamic/shims/next-link.js +0 -33
- package/runtime-dynamic/shims/next-navigation.d.ts +0 -16
- package/runtime-dynamic/shims/next-navigation.js +0 -52
- package/runtime-dynamic/utils/index.d.ts +0 -9
- package/runtime-dynamic/utils/index.js +0 -40
- package/utils/custom-expression/index.d.ts +0 -43
- package/utils/custom-expression/index.js +0 -161
- package/utils/custom-expression/parser.d.ts +0 -15
- package/utils/custom-expression/parser.js +0 -208
- package/utils/layoutsize-util.d.ts +0 -1
- package/utils/layoutsize-util.js +0 -57
package/higherOrder/BasePage.js
CHANGED
|
@@ -6,7 +6,7 @@ var _typeof3 = require("@babel/runtime/helpers/typeof");
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", {
|
|
7
7
|
value: true
|
|
8
8
|
});
|
|
9
|
-
exports.withPageContext = exports["default"] = void 0;
|
|
9
|
+
exports.withPageContext = exports.usePageReady = exports["default"] = void 0;
|
|
10
10
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
11
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
12
12
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
@@ -35,7 +35,7 @@ var _formatters = _interopRequireDefault(require("../core/formatters"));
|
|
|
35
35
|
var _AppContext2 = require("../context/AppContext");
|
|
36
36
|
var _pageParamsUtil = require("../utils/page-params-util");
|
|
37
37
|
var _AppSpinnerProvider = require("../context/AppSpinnerProvider");
|
|
38
|
-
var _get = _interopRequireDefault(require("lodash
|
|
38
|
+
var _get = _interopRequireDefault(require("lodash/get"));
|
|
39
39
|
var _events = require("../core/constants/events");
|
|
40
40
|
var _libErrorSkipper = require("../utils/lib-error-skipper");
|
|
41
41
|
var _viewport = require("../store/viewport.service");
|
|
@@ -45,13 +45,51 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
45
45
|
var __jsx = _react["default"].createElement;
|
|
46
46
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
47
47
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
48
|
+
/**
|
|
49
|
+
* Module-level Maps for page ready signaling.
|
|
50
|
+
* Each component is tracked by its componentName, preventing conflicts between
|
|
51
|
+
* pages, partials, and prefabs.
|
|
52
|
+
*/
|
|
53
|
+
var pageReadyCallbacks = new Map();
|
|
54
|
+
var pageReadySignalled = new Set();
|
|
55
|
+
/**
|
|
56
|
+
* Hook to signal that a page component has rendered and is ready.
|
|
57
|
+
* Call this at the top of your page component to trigger startup operations.
|
|
58
|
+
*
|
|
59
|
+
* This ensures widgets have mounted and subscribed before variables are invoked.
|
|
60
|
+
*
|
|
61
|
+
* @param componentName - The unique name of the component (e.g., "ChooseAPlansGrid")
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* import { usePageReady } from '@wavemaker-ai/react-runtime/higherOrder/BasePage';
|
|
65
|
+
*
|
|
66
|
+
* const ChooseAPlansGridComponent = () => {
|
|
67
|
+
* usePageReady("ChooseAPlansGrid"); // Signal ready on mount
|
|
68
|
+
* return <WmPage>...</WmPage>;
|
|
69
|
+
* };
|
|
70
|
+
*/
|
|
71
|
+
var usePageReady = exports.usePageReady = function usePageReady(componentName) {
|
|
72
|
+
var signalledRef = (0, _react.useRef)(false);
|
|
73
|
+
(0, _react.useEffect)(function () {
|
|
74
|
+
if (!componentName || signalledRef.current) return;
|
|
75
|
+
signalledRef.current = true;
|
|
76
|
+
pageReadySignalled.add(componentName);
|
|
77
|
+
|
|
78
|
+
// Call callback if already registered (parent effect ran first)
|
|
79
|
+
var callback = pageReadyCallbacks.get(componentName);
|
|
80
|
+
if (callback) {
|
|
81
|
+
callback();
|
|
82
|
+
}
|
|
83
|
+
// Otherwise, the parent's effect will check pageReadySignalled and call handlePageReady
|
|
84
|
+
}, [componentName]);
|
|
85
|
+
};
|
|
48
86
|
var withPageContext = exports.withPageContext = function withPageContext(WrappedComponent, addPageScript, getVariables, componentInfo, prefabInfo) {
|
|
49
87
|
var PageContextComponent = function PageContextComponent(props) {
|
|
50
|
-
var
|
|
88
|
+
var _info$appConfig;
|
|
51
89
|
var dispatch = (0, _store.useAppDispatch)();
|
|
52
|
-
var
|
|
53
|
-
show =
|
|
54
|
-
hide =
|
|
90
|
+
var _useAppSpinner = (0, _AppSpinnerProvider.useAppSpinner)(),
|
|
91
|
+
show = _useAppSpinner.show,
|
|
92
|
+
hide = _useAppSpinner.hide;
|
|
55
93
|
var i18n = (0, _store.useAppSelector)(function (state) {
|
|
56
94
|
return state.i18n;
|
|
57
95
|
});
|
|
@@ -124,9 +162,6 @@ var withPageContext = exports.withPageContext = function withPageContext(Wrapped
|
|
|
124
162
|
var _useState4 = (0, _react.useState)(false),
|
|
125
163
|
isPageReady = _useState4[0],
|
|
126
164
|
setIsPageReady = _useState4[1];
|
|
127
|
-
var pageReady = (0, _react.useCallback)(function () {
|
|
128
|
-
setIsPageReady(true);
|
|
129
|
-
}, []);
|
|
130
165
|
|
|
131
166
|
// Initial page context state
|
|
132
167
|
var _useState5 = (0, _react.useState)(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
@@ -142,7 +177,6 @@ var withPageContext = exports.withPageContext = function withPageContext(Wrapped
|
|
|
142
177
|
toaster: _toast.toastService,
|
|
143
178
|
onContentReady: onContentReady,
|
|
144
179
|
onChange: updateWidgetState,
|
|
145
|
-
pageReady: pageReady,
|
|
146
180
|
App: {},
|
|
147
181
|
eval: appContext === null || appContext === void 0 ? void 0 : appContext.eval,
|
|
148
182
|
appLocale: (componentInfo === null || componentInfo === void 0 ? void 0 : componentInfo.appLocale) || i18n.appLocale || {},
|
|
@@ -157,8 +191,7 @@ var withPageContext = exports.withPageContext = function withPageContext(Wrapped
|
|
|
157
191
|
Viewport: _viewport.viewportService.getViewport(),
|
|
158
192
|
formatMessage: _util.formatMessage,
|
|
159
193
|
overriddenPropsRegistryRef: overriddenPropsRegistryRef.current,
|
|
160
|
-
layoutReady: layoutReady
|
|
161
|
-
activePageName: componentInfo === null || componentInfo === void 0 ? void 0 : componentInfo.componentName
|
|
194
|
+
layoutReady: layoutReady
|
|
162
195
|
})),
|
|
163
196
|
pageContext = _useState5[0],
|
|
164
197
|
setPageContext = _useState5[1];
|
|
@@ -199,11 +232,11 @@ var withPageContext = exports.withPageContext = function withPageContext(Wrapped
|
|
|
199
232
|
var paramValues = (0, _pageParamsUtil.extractPartialParamValues)(props.params || [], props);
|
|
200
233
|
|
|
201
234
|
// Update pageParams for each param key when prop values change
|
|
202
|
-
Object.entries(paramValues).forEach(function (
|
|
235
|
+
Object.entries(paramValues).forEach(function (_ref) {
|
|
203
236
|
var _pageProxyRef$current;
|
|
204
|
-
var
|
|
205
|
-
key =
|
|
206
|
-
newValue =
|
|
237
|
+
var _ref2 = (0, _slicedToArray2["default"])(_ref, 2),
|
|
238
|
+
key = _ref2[0],
|
|
239
|
+
newValue = _ref2[1];
|
|
207
240
|
if (!(0, _isEqual["default"])((_pageProxyRef$current = pageProxyRef.current.pageParams) === null || _pageProxyRef$current === void 0 ? void 0 : _pageProxyRef$current[key], newValue)) {
|
|
208
241
|
if (!pageProxyRef.current.pageParams) {
|
|
209
242
|
pageProxyRef.current.pageParams = {};
|
|
@@ -295,7 +328,7 @@ var withPageContext = exports.withPageContext = function withPageContext(Wrapped
|
|
|
295
328
|
// Set initialization flag
|
|
296
329
|
isInitializingRef.current = true;
|
|
297
330
|
var initializeComponent = /*#__PURE__*/function () {
|
|
298
|
-
var
|
|
331
|
+
var _ref3 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
299
332
|
var pageProxy, pageVariables, appVariables, APP_VARIABLES, _mergeVariablesAndAct, Variables, Actions, urlParams, newParams, localeFormats, _pageName;
|
|
300
333
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
301
334
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -347,7 +380,6 @@ var withPageContext = exports.withPageContext = function withPageContext(Wrapped
|
|
|
347
380
|
pageProxy.Variables = Variables;
|
|
348
381
|
pageProxy.Actions = Actions;
|
|
349
382
|
pageProxy.pageParams = _objectSpread({}, newParams);
|
|
350
|
-
pageProxy.pageReady = pageReady;
|
|
351
383
|
pageProxy.App = _objectSpread(_objectSpread({}, appProxy), initialAppConfig);
|
|
352
384
|
pageProxy.selectedLocale = i18n.selectedLocale || "en";
|
|
353
385
|
pageProxy.overriddenPropsRegistry = overriddenPropsRegistryRef.current;
|
|
@@ -393,7 +425,7 @@ var withPageContext = exports.withPageContext = function withPageContext(Wrapped
|
|
|
393
425
|
}, _callee);
|
|
394
426
|
}));
|
|
395
427
|
return function initializeComponent() {
|
|
396
|
-
return
|
|
428
|
+
return _ref3.apply(this, arguments);
|
|
397
429
|
};
|
|
398
430
|
}();
|
|
399
431
|
initializeComponent();
|
|
@@ -403,11 +435,11 @@ var withPageContext = exports.withPageContext = function withPageContext(Wrapped
|
|
|
403
435
|
var _overriddenPropsRegis;
|
|
404
436
|
// Cancel all pending page operations
|
|
405
437
|
if (pageProxyRef.current) {
|
|
406
|
-
var
|
|
407
|
-
|
|
408
|
-
Variables =
|
|
409
|
-
|
|
410
|
-
Actions =
|
|
438
|
+
var _ref4 = getVariables(pageProxyRef.current) || {},
|
|
439
|
+
_ref4$Variables = _ref4.Variables,
|
|
440
|
+
Variables = _ref4$Variables === void 0 ? {} : _ref4$Variables,
|
|
441
|
+
_ref4$Actions = _ref4.Actions,
|
|
442
|
+
Actions = _ref4$Actions === void 0 ? {} : _ref4$Actions;
|
|
411
443
|
|
|
412
444
|
// Cancel page variables
|
|
413
445
|
Object.values(Variables).forEach(function (variable) {
|
|
@@ -438,10 +470,10 @@ var withPageContext = exports.withPageContext = function withPageContext(Wrapped
|
|
|
438
470
|
// clearOverriddenProps();
|
|
439
471
|
|
|
440
472
|
// Unsubscribe from events
|
|
441
|
-
subscriptionsRef.current.forEach(function (
|
|
442
|
-
var variable =
|
|
443
|
-
event =
|
|
444
|
-
handler =
|
|
473
|
+
subscriptionsRef.current.forEach(function (_ref5) {
|
|
474
|
+
var variable = _ref5.variable,
|
|
475
|
+
event = _ref5.event,
|
|
476
|
+
handler = _ref5.handler;
|
|
445
477
|
if (variable !== null && variable !== void 0 && variable.unsubscribe) {
|
|
446
478
|
try {
|
|
447
479
|
variable.unsubscribe(event, handler);
|
|
@@ -462,11 +494,11 @@ var withPageContext = exports.withPageContext = function withPageContext(Wrapped
|
|
|
462
494
|
return;
|
|
463
495
|
}
|
|
464
496
|
try {
|
|
465
|
-
var
|
|
497
|
+
var _ref6 = getVariables(pageProxyRef.current) || {
|
|
466
498
|
Variables: {}
|
|
467
499
|
},
|
|
468
|
-
|
|
469
|
-
pageVars =
|
|
500
|
+
_ref6$Variables = _ref6.Variables,
|
|
501
|
+
pageVars = _ref6$Variables === void 0 ? {} : _ref6$Variables;
|
|
470
502
|
var pageVarNames = new Set(Object.keys(pageVars || {}));
|
|
471
503
|
subscribeAppVariablesIfNeeded(appContext.Variables || {}, pageVarNames);
|
|
472
504
|
appVarSubscriptionsDoneRef.current = true;
|
|
@@ -529,10 +561,10 @@ var withPageContext = exports.withPageContext = function withPageContext(Wrapped
|
|
|
529
561
|
};
|
|
530
562
|
|
|
531
563
|
// Set up subscriptions (avoid duplicates by name)
|
|
532
|
-
Object.entries(variables).forEach(function (
|
|
533
|
-
var
|
|
534
|
-
name =
|
|
535
|
-
variable =
|
|
564
|
+
Object.entries(variables).forEach(function (_ref7) {
|
|
565
|
+
var _ref8 = (0, _slicedToArray2["default"])(_ref7, 2),
|
|
566
|
+
name = _ref8[0],
|
|
567
|
+
variable = _ref8[1];
|
|
536
568
|
if (subscribedVariableNamesRef.current.has(name)) {
|
|
537
569
|
return;
|
|
538
570
|
}
|
|
@@ -556,10 +588,10 @@ var withPageContext = exports.withPageContext = function withPageContext(Wrapped
|
|
|
556
588
|
// Subscribe to app-level variables that are not shadowed by page variables
|
|
557
589
|
var subscribeAppVariablesIfNeeded = function subscribeAppVariablesIfNeeded(appVars, pageVarNames) {
|
|
558
590
|
var appVarsOnly = {};
|
|
559
|
-
Object.entries(appVars || {}).forEach(function (
|
|
560
|
-
var
|
|
561
|
-
name =
|
|
562
|
-
variable =
|
|
591
|
+
Object.entries(appVars || {}).forEach(function (_ref9) {
|
|
592
|
+
var _ref0 = (0, _slicedToArray2["default"])(_ref9, 2),
|
|
593
|
+
name = _ref0[0],
|
|
594
|
+
variable = _ref0[1];
|
|
563
595
|
if (!pageVarNames.has(name) && !subscribedVariableNamesRef.current.has(name)) {
|
|
564
596
|
appVarsOnly[name] = variable;
|
|
565
597
|
}
|
|
@@ -571,12 +603,12 @@ var withPageContext = exports.withPageContext = function withPageContext(Wrapped
|
|
|
571
603
|
|
|
572
604
|
// Execute startup operations
|
|
573
605
|
var executeStartupOperations = /*#__PURE__*/function () {
|
|
574
|
-
var
|
|
575
|
-
var
|
|
606
|
+
var _ref1 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(Variables, Actions) {
|
|
607
|
+
var _ref10, _ref10$startUpActions, startUpActions, _ref10$startUpVariabl, startUpVariables, variablePromises;
|
|
576
608
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
577
609
|
while (1) switch (_context2.prev = _context2.next) {
|
|
578
610
|
case 0:
|
|
579
|
-
|
|
611
|
+
_ref10 = componentInfo || {}, _ref10$startUpActions = _ref10.startUpActions, startUpActions = _ref10$startUpActions === void 0 ? [] : _ref10$startUpActions, _ref10$startUpVariabl = _ref10.startUpVariables, startUpVariables = _ref10$startUpVariabl === void 0 ? [] : _ref10$startUpVariabl; // Track startup operations
|
|
580
612
|
startUpVariables.forEach(function (name) {
|
|
581
613
|
return pendingStartupOpsRef.current.add(name);
|
|
582
614
|
});
|
|
@@ -637,7 +669,7 @@ var withPageContext = exports.withPageContext = function withPageContext(Wrapped
|
|
|
637
669
|
}, _callee2, null, [[5, 15]]);
|
|
638
670
|
}));
|
|
639
671
|
return function executeStartupOperations(_x, _x2) {
|
|
640
|
-
return
|
|
672
|
+
return _ref1.apply(this, arguments);
|
|
641
673
|
};
|
|
642
674
|
}();
|
|
643
675
|
function layoutReady() {
|
|
@@ -743,15 +775,12 @@ var withPageContext = exports.withPageContext = function withPageContext(Wrapped
|
|
|
743
775
|
(0, _react.useEffect)(function () {
|
|
744
776
|
var newAppLocale = (0, _merge["default"])({}, i18n.appLocale || {}, (prefabInfo === null || prefabInfo === void 0 ? void 0 : prefabInfo.appLocale) || {});
|
|
745
777
|
if (!(0, _isEqual["default"])(pageContext.appLocale, newAppLocale)) {
|
|
746
|
-
var _pageProxyRef$current3;
|
|
747
778
|
setPageContext(function (prev) {
|
|
748
779
|
return _objectSpread(_objectSpread({}, prev), {}, {
|
|
749
780
|
appLocale: newAppLocale
|
|
750
781
|
});
|
|
751
782
|
});
|
|
752
|
-
|
|
753
|
-
pageProxyRef.current.App.appLocale = newAppLocale;
|
|
754
|
-
}
|
|
783
|
+
pageProxyRef.current.App.appLocale = newAppLocale;
|
|
755
784
|
}
|
|
756
785
|
}, [i18n.appLocale]);
|
|
757
786
|
(0, _react.useEffect)(function () {
|
|
@@ -772,6 +801,12 @@ var withPageContext = exports.withPageContext = function withPageContext(Wrapped
|
|
|
772
801
|
}
|
|
773
802
|
}
|
|
774
803
|
}, [i18n.dateFormat, i18n.timeFormat, i18n.currencyCode]);
|
|
804
|
+
|
|
805
|
+
// Callback for when page component signals it's ready
|
|
806
|
+
// This is called by usePageReady() hook in the page component
|
|
807
|
+
var handlePageReady = (0, _react.useCallback)(function () {
|
|
808
|
+
setIsPageReady(true);
|
|
809
|
+
}, []);
|
|
775
810
|
var pageName = (appProxy === null || appProxy === void 0 ? void 0 : appProxy.activePageName) || "";
|
|
776
811
|
(0, _react.useEffect)(function () {
|
|
777
812
|
if ((componentInfo === null || componentInfo === void 0 ? void 0 : componentInfo.componentType) === "PARTIAL" && pageName) {
|
|
@@ -786,13 +821,30 @@ var withPageContext = exports.withPageContext = function withPageContext(Wrapped
|
|
|
786
821
|
}
|
|
787
822
|
}, [pageName]);
|
|
788
823
|
|
|
824
|
+
// Register the callback at module level so usePageReady() can call it
|
|
825
|
+
// Uses componentName as key to avoid conflicts between pages/partials/prefabs
|
|
826
|
+
var componentName = componentInfo === null || componentInfo === void 0 ? void 0 : componentInfo.componentName;
|
|
827
|
+
(0, _react.useEffect)(function () {
|
|
828
|
+
if (!componentName) return;
|
|
829
|
+
pageReadyCallbacks.set(componentName, handlePageReady);
|
|
830
|
+
|
|
831
|
+
// Check if child already signalled ready before this effect ran
|
|
832
|
+
if (pageReadySignalled.has(componentName)) {
|
|
833
|
+
handlePageReady();
|
|
834
|
+
}
|
|
835
|
+
return function () {
|
|
836
|
+
pageReadyCallbacks["delete"](componentName);
|
|
837
|
+
pageReadySignalled["delete"](componentName);
|
|
838
|
+
};
|
|
839
|
+
}, [componentName, handlePageReady]);
|
|
840
|
+
|
|
789
841
|
// Execute startup when both conditions are met:
|
|
790
842
|
// 1. Page is initialized (context ready)
|
|
791
|
-
// 2. Page component has
|
|
843
|
+
// 2. Page component has signaled ready (widgets have rendered and subscribed)
|
|
792
844
|
(0, _react.useEffect)(function () {
|
|
793
845
|
if (isInitialized && isPageReady && isMountedRef.current && !onStartupCompletedRef.current && pageProxyRef.current) {
|
|
794
846
|
var runStartup = /*#__PURE__*/function () {
|
|
795
|
-
var
|
|
847
|
+
var _ref11 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
|
796
848
|
var tabNameFromUrl, tabNameToSelect;
|
|
797
849
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
798
850
|
while (1) switch (_context3.prev = _context3.next) {
|
|
@@ -840,7 +892,7 @@ var withPageContext = exports.withPageContext = function withPageContext(Wrapped
|
|
|
840
892
|
}, _callee3);
|
|
841
893
|
}));
|
|
842
894
|
return function runStartup() {
|
|
843
|
-
return
|
|
895
|
+
return _ref11.apply(this, arguments);
|
|
844
896
|
};
|
|
845
897
|
}();
|
|
846
898
|
runStartup();
|
|
@@ -853,7 +905,6 @@ var withPageContext = exports.withPageContext = function withPageContext(Wrapped
|
|
|
853
905
|
}
|
|
854
906
|
}, [startupComplete, isLayoutReady]);
|
|
855
907
|
(0, _react.useEffect)(function () {
|
|
856
|
-
isMountedRef.current = true;
|
|
857
908
|
return function () {
|
|
858
909
|
isMountedRef.current = false;
|
|
859
910
|
// Cleanup viewport service when component unmounts
|
|
@@ -890,8 +941,8 @@ var withPageContext = exports.withPageContext = function withPageContext(Wrapped
|
|
|
890
941
|
if (pageContext.autoUpdateVariables && onStartupCompletedRef.current) {
|
|
891
942
|
var pageVariables = pageContext.Variables;
|
|
892
943
|
componentInfo === null || componentInfo === void 0 || componentInfo.autoUpdateVariables.forEach(function (value) {
|
|
893
|
-
var _pageVariables$value, _pageVariables$
|
|
894
|
-
(_pageVariables$value = pageVariables[value]) === null || _pageVariables$value === void 0
|
|
944
|
+
var _pageVariables$value, _pageVariables$value2;
|
|
945
|
+
((_pageVariables$value = pageVariables[value]) === null || _pageVariables$value === void 0 ? void 0 : _pageVariables$value.invokeOnParamChange) && ((_pageVariables$value2 = pageVariables[value]) === null || _pageVariables$value2 === void 0 ? void 0 : _pageVariables$value2.invokeOnParamChange());
|
|
895
946
|
});
|
|
896
947
|
}
|
|
897
948
|
|
|
@@ -36,8 +36,6 @@ var BasePrefab = exports.BasePrefab = function BasePrefab(WrappedComponent, addP
|
|
|
36
36
|
partials = _ref.partials,
|
|
37
37
|
componentType = _ref.componentType,
|
|
38
38
|
rest = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
39
|
-
/** When preview passes `prefabname=""` for app-context metadata, keep bundle identity from codegen. */
|
|
40
|
-
var bundleId = prefabname || (componentInfo === null || componentInfo === void 0 ? void 0 : componentInfo.componentName) || "";
|
|
41
39
|
var dispatch = (0, _store.useAppDispatch)();
|
|
42
40
|
var appConfig = (0, _store.useAppSelector)(function (state) {
|
|
43
41
|
return state.info.appConfig;
|
|
@@ -45,12 +43,9 @@ var BasePrefab = exports.BasePrefab = function BasePrefab(WrappedComponent, addP
|
|
|
45
43
|
var i18n = (0, _store.useAppSelector)(function (state) {
|
|
46
44
|
return state.i18n;
|
|
47
45
|
});
|
|
48
|
-
|
|
49
|
-
// Cached payload from getPrefabDefinitions (stored under `info.prefabs[prefabName]`)
|
|
46
|
+
// Get prefab definitions from state if available
|
|
50
47
|
var prefabDefinitions = (0, _store.useAppSelector)(function (state) {
|
|
51
|
-
|
|
52
|
-
var prefabs = (_state$info = state.info) === null || _state$info === void 0 ? void 0 : _state$info.prefabs;
|
|
53
|
-
return (_prefabs$prefabname = prefabs === null || prefabs === void 0 ? void 0 : prefabs[prefabname]) !== null && _prefabs$prefabname !== void 0 ? _prefabs$prefabname : null;
|
|
48
|
+
return state.info[prefabname] ? state.info[prefabname] : null;
|
|
54
49
|
});
|
|
55
50
|
var _useState = (0, _react.useState)(prefabDefinitions ? false : true),
|
|
56
51
|
loading = _useState[0],
|
|
@@ -59,61 +54,6 @@ var BasePrefab = exports.BasePrefab = function BasePrefab(WrappedComponent, addP
|
|
|
59
54
|
serviceDefs = _useState2[0],
|
|
60
55
|
setServiceDefs = _useState2[1];
|
|
61
56
|
var baseUrl = (appConfig === null || appConfig === void 0 ? void 0 : appConfig.url) || "";
|
|
62
|
-
var fetchServiceDefs = /*#__PURE__*/function () {
|
|
63
|
-
var _ref2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
64
|
-
var response;
|
|
65
|
-
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
66
|
-
while (1) switch (_context.prev = _context.next) {
|
|
67
|
-
case 0:
|
|
68
|
-
if (baseUrl) {
|
|
69
|
-
_context.next = 4;
|
|
70
|
-
break;
|
|
71
|
-
}
|
|
72
|
-
console.warn("Base URL is not available");
|
|
73
|
-
setLoading(false);
|
|
74
|
-
return _context.abrupt("return");
|
|
75
|
-
case 4:
|
|
76
|
-
_context.prev = 4;
|
|
77
|
-
isServiceDefsLoading.current = true;
|
|
78
|
-
// Dispatch Redux action to store in state
|
|
79
|
-
_context.next = 8;
|
|
80
|
-
return dispatch((0, _appConfigSlice.getPrefabDefinitions)({
|
|
81
|
-
prefabName: prefabname,
|
|
82
|
-
baseUrl: baseUrl,
|
|
83
|
-
pages: pages || []
|
|
84
|
-
})).unwrap();
|
|
85
|
-
case 8:
|
|
86
|
-
response = _context.sent;
|
|
87
|
-
setServiceDefs(response || {});
|
|
88
|
-
_metadata.metadataService.setMetadata((response === null || response === void 0 ? void 0 : response.serviceDefs) || {}, prefabname);
|
|
89
|
-
_appstore["default"].set("".concat(bundleId, "-partials"), {
|
|
90
|
-
partials: partials || []
|
|
91
|
-
});
|
|
92
|
-
// Call metadata service's load method to set metadata with correct base URL
|
|
93
|
-
// This is equivalent to Angular's this.$metadata.load(prefabName)
|
|
94
|
-
_context.next = 14;
|
|
95
|
-
return _metadata.metadataService.load(prefabname, baseUrl);
|
|
96
|
-
case 14:
|
|
97
|
-
_context.next = 19;
|
|
98
|
-
break;
|
|
99
|
-
case 16:
|
|
100
|
-
_context.prev = 16;
|
|
101
|
-
_context.t0 = _context["catch"](4);
|
|
102
|
-
console.error("Failed to fetch service definitions:", _context.t0);
|
|
103
|
-
case 19:
|
|
104
|
-
_context.prev = 19;
|
|
105
|
-
setLoading(false);
|
|
106
|
-
return _context.finish(19);
|
|
107
|
-
case 22:
|
|
108
|
-
case "end":
|
|
109
|
-
return _context.stop();
|
|
110
|
-
}
|
|
111
|
-
}, _callee, null, [[4, 16, 19, 22]]);
|
|
112
|
-
}));
|
|
113
|
-
return function fetchServiceDefs() {
|
|
114
|
-
return _ref2.apply(this, arguments);
|
|
115
|
-
};
|
|
116
|
-
}();
|
|
117
57
|
// Fetch service definitions when component mounts only if not already in state
|
|
118
58
|
(0, _react.useEffect)(function () {
|
|
119
59
|
// Skip fetching if we already have the definitions in state
|
|
@@ -122,12 +62,62 @@ var BasePrefab = exports.BasePrefab = function BasePrefab(WrappedComponent, addP
|
|
|
122
62
|
setLoading(false);
|
|
123
63
|
return;
|
|
124
64
|
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
65
|
+
var fetchServiceDefs = /*#__PURE__*/function () {
|
|
66
|
+
var _ref2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
67
|
+
var response;
|
|
68
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
69
|
+
while (1) switch (_context.prev = _context.next) {
|
|
70
|
+
case 0:
|
|
71
|
+
if (baseUrl) {
|
|
72
|
+
_context.next = 4;
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
console.warn("Base URL is not available");
|
|
76
|
+
setLoading(false);
|
|
77
|
+
return _context.abrupt("return");
|
|
78
|
+
case 4:
|
|
79
|
+
_context.prev = 4;
|
|
80
|
+
_context.next = 7;
|
|
81
|
+
return dispatch((0, _appConfigSlice.getPrefabDefinitions)({
|
|
82
|
+
prefabName: prefabname,
|
|
83
|
+
baseUrl: baseUrl,
|
|
84
|
+
pages: pages || []
|
|
85
|
+
})).unwrap();
|
|
86
|
+
case 7:
|
|
87
|
+
response = _context.sent;
|
|
88
|
+
setServiceDefs(response || {});
|
|
89
|
+
_metadata.metadataService.setMetadata((response === null || response === void 0 ? void 0 : response.serviceDefs) || {}, prefabname);
|
|
90
|
+
_appstore["default"].set("".concat(prefabname, "-partials"), {
|
|
91
|
+
partials: partials || []
|
|
92
|
+
});
|
|
93
|
+
// Call metadata service's load method to set metadata with correct base URL
|
|
94
|
+
// This is equivalent to Angular's this.$metadata.load(prefabName)
|
|
95
|
+
_context.next = 13;
|
|
96
|
+
return _metadata.metadataService.load(prefabname, baseUrl);
|
|
97
|
+
case 13:
|
|
98
|
+
_context.next = 18;
|
|
99
|
+
break;
|
|
100
|
+
case 15:
|
|
101
|
+
_context.prev = 15;
|
|
102
|
+
_context.t0 = _context["catch"](4);
|
|
103
|
+
console.error("Failed to fetch service definitions:", _context.t0);
|
|
104
|
+
case 18:
|
|
105
|
+
_context.prev = 18;
|
|
106
|
+
setLoading(false);
|
|
107
|
+
return _context.finish(18);
|
|
108
|
+
case 21:
|
|
109
|
+
case "end":
|
|
110
|
+
return _context.stop();
|
|
111
|
+
}
|
|
112
|
+
}, _callee, null, [[4, 15, 18, 21]]);
|
|
113
|
+
}));
|
|
114
|
+
return function fetchServiceDefs() {
|
|
115
|
+
return _ref2.apply(this, arguments);
|
|
116
|
+
};
|
|
117
|
+
}();
|
|
128
118
|
fetchServiceDefs();
|
|
129
119
|
}, [baseUrl, prefabname, dispatch, prefabDefinitions]);
|
|
130
|
-
if (prefabname
|
|
120
|
+
if (!prefabname) {
|
|
131
121
|
return null;
|
|
132
122
|
}
|
|
133
123
|
if (loading) {
|
|
@@ -138,7 +128,7 @@ var BasePrefab = exports.BasePrefab = function BasePrefab(WrappedComponent, addP
|
|
|
138
128
|
listener: {}
|
|
139
129
|
});
|
|
140
130
|
}
|
|
141
|
-
var appLocale = (0, _merge["default"])({}, (i18n === null || i18n === void 0 ? void 0 : i18n.appLocale) || {}, (i18n === null || i18n === void 0 || (_i18n$prefabMessages = i18n.prefabMessages) === null || _i18n$prefabMessages === void 0 ? void 0 : _i18n$prefabMessages[
|
|
131
|
+
var appLocale = (0, _merge["default"])({}, (i18n === null || i18n === void 0 ? void 0 : i18n.appLocale) || {}, (i18n === null || i18n === void 0 || (_i18n$prefabMessages = i18n.prefabMessages) === null || _i18n$prefabMessages === void 0 ? void 0 : _i18n$prefabMessages[prefabname]) || {});
|
|
142
132
|
var FragmentConsumer = function FragmentConsumer(fragmentProps) {
|
|
143
133
|
var combinedProps = _objectSpread(_objectSpread({}, props), fragmentProps);
|
|
144
134
|
return __jsx(WrappedComponent, combinedProps);
|
|
@@ -147,13 +137,13 @@ var BasePrefab = exports.BasePrefab = function BasePrefab(WrappedComponent, addP
|
|
|
147
137
|
// Apply BasePage HOC to our FragmentConsumer
|
|
148
138
|
var EnhancedComponent = (0, _BasePage["default"])(FragmentConsumer, addPageScript, getVariables, // @ts-expect-error
|
|
149
139
|
_objectSpread(_objectSpread({}, rest), {}, {
|
|
150
|
-
componentName:
|
|
140
|
+
componentName: prefabname,
|
|
151
141
|
componentType: componentType
|
|
152
142
|
}), _objectSpread({
|
|
153
143
|
serviceDefs: (serviceDefs === null || serviceDefs === void 0 ? void 0 : serviceDefs.serviceDefs) || {},
|
|
154
144
|
appLocale: appLocale,
|
|
155
145
|
prefab: true,
|
|
156
|
-
prefabName:
|
|
146
|
+
prefabName: prefabname,
|
|
157
147
|
name: props.name
|
|
158
148
|
}, props.outbound));
|
|
159
149
|
return __jsx(_react["default"].Fragment, null, __jsx(EnhancedComponent, props));
|
package/higherOrder/props.d.ts
CHANGED
|
@@ -82,7 +82,7 @@ var withBaseWrapper = exports.withBaseWrapper = function withBaseWrapper(Wrapped
|
|
|
82
82
|
var mergedState = _objectSpread({}, props);
|
|
83
83
|
var registry = pageContext === null || pageContext === void 0 ? void 0 : pageContext.overriddenPropsRegistry;
|
|
84
84
|
var widgetDatavalue = widget.datavalue;
|
|
85
|
-
var datavalue =
|
|
85
|
+
var datavalue = props.datavalue !== undefined ? props.datavalue : widgetDatavalue;
|
|
86
86
|
if (shouldMergeFromContext && registry !== null && registry !== void 0 && registry.isWidgetOverridden(name, componentWidgetId || "") && !props.formfield) {
|
|
87
87
|
// Apply widget-id specific overridden properties from the registry
|
|
88
88
|
var widgetOverrides = registry === null || registry === void 0 ? void 0 : registry.getWidgetOverrides(name, componentWidgetId || "");
|
|
@@ -111,10 +111,11 @@ var withBaseWrapper = exports.withBaseWrapper = function withBaseWrapper(Wrapped
|
|
|
111
111
|
});
|
|
112
112
|
}
|
|
113
113
|
} else if (shouldMergeFromContext) {
|
|
114
|
+
// For regular widgets (no widget-id or matching widget-id), merge with component props taking precedence
|
|
114
115
|
mergedState = _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, widget), props), props !== null && props !== void 0 && props.formfield ? {
|
|
115
116
|
datavalue: props.datavalue
|
|
116
|
-
} : {
|
|
117
|
-
datavalue: widgetDatavalue
|
|
117
|
+
} : widgetDatavalue !== undefined && props.datavalue === undefined && {
|
|
118
|
+
datavalue: widgetDatavalue
|
|
118
119
|
}), component === "WmFormField" && !props["value"] && {
|
|
119
120
|
value: datavalue,
|
|
120
121
|
datavalue: datavalue
|
package/hooks/useAccess.js
CHANGED
|
@@ -108,19 +108,6 @@ var useAccess = exports.useAccess = function useAccess(options) {
|
|
|
108
108
|
// Don't check multiple times
|
|
109
109
|
if (hasCheckedRef.current) return;
|
|
110
110
|
|
|
111
|
-
// Skip access check entirely when security is disabled
|
|
112
|
-
if (!isSecurityEnabled) {
|
|
113
|
-
var grantedState = {
|
|
114
|
-
hasAccess: true,
|
|
115
|
-
loading: false,
|
|
116
|
-
error: null
|
|
117
|
-
};
|
|
118
|
-
accessCache.set(cacheKey, grantedState);
|
|
119
|
-
setLocalState(grantedState);
|
|
120
|
-
hasCheckedRef.current = true;
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
111
|
// Check if we already have valid cached result
|
|
125
112
|
var cached = accessCache.get(cacheKey);
|
|
126
113
|
if (cached && !cached.loading) {
|
package/mui-config/theme.js
CHANGED