@wavemaker-ai/react-runtime 1.0.0-rc.647469 → 1.0.0-rc.647499
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/base-action.d.ts +7 -0
- package/actions/login-action.d.ts +11 -0
- package/actions/logout-action.d.ts +10 -0
- package/actions/navigation-action.d.ts +35 -0
- package/actions/navigation-action.js +23 -5
- package/actions/notification-action.d.ts +20 -0
- package/actions/timer-action.d.ts +27 -0
- package/components/advanced/carousel/index.d.ts +1 -0
- package/components/advanced/carousel/index.js +2 -1
- package/components/advanced/carousel/template.d.ts +1 -0
- package/components/advanced/carousel/template.js +2 -1
- package/components/advanced/login/index.d.ts +1 -0
- package/components/advanced/marquee/index.d.ts +1 -0
- package/components/advanced/marquee/index.js +2 -1
- package/components/basic/anchor/index.d.ts +1 -0
- package/components/basic/anchor/index.js +4 -3
- package/components/basic/audio/index.d.ts +1 -0
- package/components/basic/audio/index.js +3 -2
- package/components/basic/html/index.d.ts +1 -0
- package/components/basic/icon/index.d.ts +1 -0
- package/components/basic/icon/index.js +4 -7
- package/components/basic/iframe/iframe.utils.d.ts +1 -1
- package/components/basic/iframe/iframe.utils.js +8 -4
- package/components/basic/iframe/index.d.ts +1 -0
- package/components/basic/label/index.d.ts +1 -0
- package/components/basic/label/index.js +3 -2
- package/components/basic/message/index.js +1 -1
- package/components/basic/picture/index.d.ts +1 -0
- package/components/basic/picture/index.js +3 -4
- package/components/basic/progress-bar/index.d.ts +1 -0
- package/components/basic/progress-bar/index.js +2 -1
- package/components/basic/progress-circle/index.d.ts +1 -0
- package/components/basic/richtexteditor/index.d.ts +2 -0
- package/components/basic/search/index.d.ts +3 -0
- package/components/basic/search/index.js +7 -4
- package/components/basic/search/props.d.ts +2 -0
- package/components/basic/spinner/index.d.ts +1 -0
- package/components/basic/tile/index.d.ts +1 -0
- package/components/basic/tile/index.js +2 -1
- package/components/basic/tree/Components/TreeNodeComponent.js +9 -5
- package/components/basic/tree/index.d.ts +1 -0
- package/components/basic/tree/index.js +14 -3
- package/components/basic/tree/utils.d.ts +2 -0
- package/components/basic/tree/utils.js +11 -1
- package/components/basic/video/index.d.ts +1 -0
- package/components/basic/video/index.js +40 -23
- package/components/chart/index.d.ts +1 -0
- package/components/common/AppSpinner.js +2 -5
- package/components/container/accordion/accordion-pane/index.d.ts +1 -0
- package/components/container/accordion/accordion-pane/index.js +1 -4
- package/components/container/accordion/index.d.ts +1 -0
- package/components/container/index.d.ts +3 -0
- package/components/container/index.js +6 -1
- package/components/container/layout-grid/grid-column/index.d.ts +1 -0
- package/components/container/layout-grid/grid-row/index.d.ts +1 -0
- package/components/container/layout-grid/index.d.ts +1 -0
- package/components/container/layout-grid/index.js +4 -8
- package/components/container/linear-layout/index.d.ts +1 -0
- package/components/container/linear-layout/linear-layout-item/index.d.ts +1 -0
- package/components/container/panel/components/panel-header/index.js +11 -6
- package/components/container/panel/components/panel-header/props.d.ts +5 -0
- package/components/container/panel/index.d.ts +1 -0
- package/components/container/panel/index.js +2 -1
- package/components/container/props.d.ts +2 -0
- package/components/container/repeat-template/index.d.ts +22 -1
- package/components/container/repeat-template/index.js +2 -1
- package/components/container/tabs/index.d.ts +3 -1
- package/components/container/tabs/index.js +102 -51
- package/components/container/tabs/props.d.ts +12 -0
- package/components/container/tabs/tab-pane/index.d.ts +1 -0
- package/components/container/tabs/tab-pane/index.js +28 -11
- package/components/container/wizard/index.d.ts +2 -0
- package/components/container/wizard/wizard-step/index.d.ts +1 -0
- package/components/container/wizard/wizard-step/index.js +2 -2
- package/components/data/card/card-actions/index.d.ts +1 -0
- package/components/data/card/card-actions/index.js +3 -5
- package/components/data/card/card-content/index.d.ts +1 -0
- package/components/data/card/card-content/index.js +3 -13
- package/components/data/card/card-footer/index.d.ts +1 -0
- package/components/data/card/card-footer/index.js +3 -5
- package/components/data/card/index.d.ts +1 -0
- package/components/data/card/index.js +3 -14
- package/components/data/form/dynamic-fields/index.js +7 -1
- package/components/data/form/dynamic-fields/props.d.ts +1 -0
- package/components/data/form/form-action/index.d.ts +2 -0
- package/components/data/form/form-body/index.js +2 -1
- package/components/data/form/form-field/base-field.js +4 -3
- package/components/data/form/form-footer/index.js +2 -1
- package/components/data/list/components/ListItemWithTemplate.js +4 -2
- 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 +2 -0
- package/components/data/list/index.js +3 -4
- package/components/data/list/props.d.ts +2 -1
- package/components/data/list/utils/list-widget-methods.d.ts +2 -1
- package/components/data/table/components/RowCells.d.ts +16 -2
- package/components/data/table/components/RowCells.js +38 -24
- package/components/data/table/components/TableBody.js +11 -3
- package/components/data/table/components/TableDataRow.d.ts +3 -0
- package/components/data/table/components/TableDataRow.js +11 -3
- package/components/data/table/components/TableHeader.js +1 -4
- package/components/data/table/hooks/index.d.ts +1 -0
- package/components/data/table/hooks/index.js +12 -0
- package/components/data/table/hooks/useCustomExpressionColumns.d.ts +16 -0
- package/components/data/table/hooks/useCustomExpressionColumns.js +88 -0
- package/components/data/table/hooks/useDynamicColumns.js +1 -1
- package/components/data/table/hooks/useResponsiveColumns.d.ts +1 -0
- package/components/data/table/hooks/useRowSelection.d.ts +1 -1
- package/components/data/table/hooks/useRowSelection.js +26 -5
- package/components/data/table/hooks/useTableInitialization.js +2 -1
- package/components/data/table/index.d.ts +4 -0
- package/components/data/table/index.js +77 -12
- package/components/data/table/live-table/index.d.ts +1 -0
- package/components/data/table/props.d.ts +7 -0
- package/components/data/table/table-action/index.d.ts +1 -0
- package/components/data/table/table-column/index.d.ts +1 -0
- package/components/data/table/table-row/index.d.ts +1 -0
- package/components/data/table/table-row-action/index.d.ts +1 -0
- package/components/data/table/utils/buildSelectionColumns.js +7 -1
- 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 +2 -0
- package/components/dialogs/confirm-dialog/index.d.ts +2 -0
- package/components/dialogs/dialog/index.d.ts +2 -0
- package/components/dialogs/dialog/index.js +2 -4
- package/components/dialogs/dialog-actions/index.d.ts +1 -0
- package/components/dialogs/dialog-body/index.d.ts +1 -0
- package/components/dialogs/dialog-content/index.d.ts +1 -0
- package/components/dialogs/dialog-header/index.d.ts +1 -0
- package/components/dialogs/iframe-dialog/index.d.ts +2 -0
- package/components/dialogs/login-dialog/index.d.ts +2 -0
- package/components/dialogs/page-dialog/index.d.ts +2 -0
- package/components/form/button/index.d.ts +1 -0
- package/components/form/button/index.js +4 -3
- package/components/form/button-group/index.d.ts +1 -0
- package/components/form/button-group/index.js +2 -1
- package/components/input/calendar/index.d.ts +2 -0
- package/components/input/chips/index.d.ts +2 -0
- package/components/input/color-picker/index.d.ts +2 -0
- package/components/input/composite/index.d.ts +1 -0
- package/components/input/currency/index.d.ts +2 -0
- package/components/input/default/checkbox/index.d.ts +2 -0
- package/components/input/default/checkboxset/index.d.ts +2 -0
- package/components/input/default/radioset/index.d.ts +2 -0
- package/components/input/default/switch/index.d.ts +2 -0
- package/components/input/epoch/date/components/DatePickerPopover.js +11 -29
- package/components/input/epoch/date/index.d.ts +1 -0
- package/components/input/epoch/datetime/index.d.ts +1 -0
- package/components/input/epoch/datetime/index.js +10 -25
- package/components/input/epoch/time/index.d.ts +1 -0
- package/components/input/epoch/time/index.js +1 -1
- package/components/input/epoch/time/utils.d.ts +0 -17
- package/components/input/epoch/time/utils.js +1 -18
- package/components/input/fileupload/index.d.ts +1 -0
- package/components/input/number/index.d.ts +2 -0
- package/components/input/rating/index.d.ts +2 -0
- package/components/input/rating/index.js +14 -17
- package/components/input/select/index.d.ts +2 -0
- package/components/input/select/index.js +1 -4
- package/components/input/slider/index.d.ts +2 -0
- package/components/input/slider/index.js +13 -12
- package/components/input/text/index.d.ts +2 -0
- package/components/input/text/index.js +3 -14
- package/components/input/textarea/index.d.ts +2 -0
- package/components/input/textarea/index.js +7 -10
- package/components/input/upload/index.d.ts +2 -0
- package/components/input/upload/index.js +3 -5
- package/components/layout/footer/index.js +2 -1
- package/components/layout/footer/props.d.ts +1 -0
- package/components/layout/header/index.js +2 -1
- package/components/layout/header/props.d.ts +1 -0
- package/components/layout/leftnav/index.js +2 -1
- package/components/layout/leftnav/props.d.ts +1 -0
- package/components/layout/rightnav/index.js +2 -1
- package/components/layout/rightnav/props.d.ts +1 -0
- package/components/layout/topnav/index.js +2 -1
- package/components/layout/topnav/props.d.ts +1 -0
- package/components/navbar/index.d.ts +1 -0
- package/components/navbar/index.js +2 -1
- package/components/navbar/nav/index.d.ts +1 -0
- package/components/navbar/nav-item/index.d.ts +1 -0
- package/components/navbar/nav-item/index.js +2 -1
- package/components/navigation/breadcrumb/index.d.ts +1 -0
- package/components/navigation/menu/index.d.ts +1 -0
- package/components/navigation/menu/index.js +5 -4
- package/components/navigation/popover/index.d.ts +2 -1
- package/components/navigation/popover/index.js +1 -1
- package/components/page/error-boundary/index.js +5 -5
- package/components/page/index.js +13 -9
- package/components/page/partial/index.d.ts +1 -0
- package/components/prefab/container/index.js +2 -1
- package/context/WidgetProvider.js +2 -2
- package/core/app.service.js +40 -35
- package/core/constants/events.js +6 -0
- package/core/constants/index.d.ts +9 -1
- package/core/constants/index.js +32 -5
- package/core/formatter/date-formatters.d.ts +1 -1
- package/core/formatter/date-formatters.js +38 -13
- package/core/formatter/types.d.ts +1 -1
- package/core/proxy-service.js +15 -5
- package/core/security.service.d.ts +12 -0
- package/core/util/index.js +3 -2
- package/higherOrder/BaseApp.js +2 -2
- package/higherOrder/BasePage.d.ts +0 -17
- package/higherOrder/BasePage.js +53 -104
- package/higherOrder/BasePrefab.js +69 -59
- package/higherOrder/props.d.ts +1 -0
- package/higherOrder/withBaseWrapper.js +3 -4
- package/hooks/useAccess.js +13 -0
- package/mui-config/theme-provider.d.ts +3 -0
- package/mui-config/theme.d.ts +2 -0
- package/mui-config/theme.js +1 -4
- package/package-lock.json +2640 -615
- package/package.json +23 -4
- package/runtime-dynamic/App.d.ts +7 -0
- package/runtime-dynamic/App.js +144 -0
- package/runtime-dynamic/app-initializer.d.ts +15 -0
- package/runtime-dynamic/app-initializer.js +447 -0
- package/runtime-dynamic/components/ErrorBoundary.d.ts +18 -0
- package/runtime-dynamic/components/ErrorBoundary.js +93 -0
- package/runtime-dynamic/components/PageWrapper.d.ts +1 -0
- package/runtime-dynamic/components/PageWrapper.js +43 -0
- package/runtime-dynamic/components/PrefabPreview.d.ts +1 -0
- package/runtime-dynamic/components/PrefabPreview.js +84 -0
- package/runtime-dynamic/components/partial-content.d.ts +15 -0
- package/runtime-dynamic/components/partial-content.js +50 -0
- package/runtime-dynamic/components/prefab-content.d.ts +10 -0
- package/runtime-dynamic/components/prefab-content.js +31 -0
- package/runtime-dynamic/components/use-dynamic-component.d.ts +10 -0
- package/runtime-dynamic/components/use-dynamic-component.js +165 -0
- package/runtime-dynamic/factories/build-base-page-like-component.d.ts +8 -0
- package/runtime-dynamic/factories/build-base-page-like-component.js +59 -0
- package/runtime-dynamic/factories/prefab-factory.d.ts +3 -0
- package/runtime-dynamic/factories/prefab-factory.js +82 -0
- package/runtime-dynamic/factories/startup-info.d.ts +6 -0
- package/runtime-dynamic/factories/startup-info.js +28 -0
- package/runtime-dynamic/factories/utils.d.ts +23 -0
- package/runtime-dynamic/factories/utils.js +131 -0
- package/runtime-dynamic/index.d.ts +14 -0
- package/runtime-dynamic/index.js +191 -0
- package/runtime-dynamic/main.d.ts +2 -0
- package/runtime-dynamic/main.js +84 -0
- package/runtime-dynamic/preview-mode.d.ts +15 -0
- package/runtime-dynamic/preview-mode.js +31 -0
- package/runtime-dynamic/preview-navigation.d.ts +6 -0
- package/runtime-dynamic/preview-navigation.js +38 -0
- package/runtime-dynamic/preview-resource-base.d.ts +12 -0
- package/runtime-dynamic/preview-resource-base.js +65 -0
- package/runtime-dynamic/registry/component-registry.d.ts +3 -0
- package/runtime-dynamic/registry/component-registry.js +353 -0
- package/runtime-dynamic/registry/custom-widget-registry.d.ts +7 -0
- package/runtime-dynamic/registry/custom-widget-registry.js +18 -0
- package/runtime-dynamic/registry/index.d.ts +2 -0
- package/runtime-dynamic/registry/index.js +63 -0
- package/runtime-dynamic/registry/store.d.ts +9 -0
- package/runtime-dynamic/registry/store.js +26 -0
- package/runtime-dynamic/routes.d.ts +2 -0
- package/runtime-dynamic/routes.js +107 -0
- package/runtime-dynamic/services/app-extension-provider.d.ts +1 -0
- package/runtime-dynamic/services/app-extension-provider.js +45 -0
- package/runtime-dynamic/services/cache.d.ts +29 -0
- package/runtime-dynamic/services/cache.js +57 -0
- package/runtime-dynamic/services/component-ref-provider.d.ts +12 -0
- package/runtime-dynamic/services/component-ref-provider.js +149 -0
- package/runtime-dynamic/services/css-scoping.d.ts +2 -0
- package/runtime-dynamic/services/css-scoping.js +53 -0
- package/runtime-dynamic/services/fragment-url.d.ts +16 -0
- package/runtime-dynamic/services/fragment-url.js +74 -0
- package/runtime-dynamic/services/index.d.ts +10 -0
- package/runtime-dynamic/services/index.js +152 -0
- package/runtime-dynamic/services/markup-transpiler.d.ts +12 -0
- package/runtime-dynamic/services/markup-transpiler.js +250 -0
- package/runtime-dynamic/services/prefab-resources.d.ts +18 -0
- package/runtime-dynamic/services/prefab-resources.js +159 -0
- package/runtime-dynamic/services/resource-manager.d.ts +2 -0
- package/runtime-dynamic/services/resource-manager.js +66 -0
- package/runtime-dynamic/services/script-executor.d.ts +8 -0
- package/runtime-dynamic/services/script-executor.js +90 -0
- package/runtime-dynamic/services/variable-factory.d.ts +2 -0
- package/runtime-dynamic/services/variable-factory.js +260 -0
- package/runtime-dynamic/services/variable-registry.d.ts +12 -0
- package/runtime-dynamic/services/variable-registry.js +118 -0
- package/runtime-dynamic/services/variable-transpiler.d.ts +5 -0
- package/runtime-dynamic/services/variable-transpiler.js +159 -0
- package/runtime-dynamic/shims/next-image.d.ts +35 -0
- package/runtime-dynamic/shims/next-image.js +60 -0
- package/runtime-dynamic/shims/next-link.d.ts +25 -0
- package/runtime-dynamic/shims/next-link.js +33 -0
- package/runtime-dynamic/shims/next-navigation.d.ts +16 -0
- package/runtime-dynamic/shims/next-navigation.js +52 -0
- package/runtime-dynamic/utils/index.d.ts +9 -0
- package/runtime-dynamic/utils/index.js +40 -0
- package/store/middleware/navigationMiddleware.js +1 -1
- package/store/slices/appConfigSlice.js +10 -8
- package/store/slices/authSlice.js +46 -32
- package/tsconfig.declaration.tsbuildinfo +1 -1
- package/types/index.d.ts +1 -0
- package/utils/attr.js +71 -14
- package/utils/custom-expression/index.d.ts +43 -0
- package/utils/custom-expression/index.js +161 -0
- package/utils/custom-expression/parser.d.ts +15 -0
- package/utils/custom-expression/parser.js +208 -0
- package/utils/layoutsize-util.d.ts +1 -0
- package/utils/layoutsize-util.js +57 -0
- package/utils/lib-error-skipper.d.ts +4 -26
- package/utils/lib-error-skipper.js +41 -165
- package/utils/style-utils.d.ts +6 -0
- package/utils/style-utils.js +10 -1
- package/variables/metadata.service.js +2 -3
- package/variables/model-variable.js +10 -7
- package/variables/service-variable.d.ts +1 -0
- package/variables/service-variable.js +26 -6
- package/components/input/epoch/datetime/styled.d.ts +0 -78
- package/components/input/epoch/datetime/styled.js +0 -90
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shim for next/link in the dynamic preview runtime (non-Next.js).
|
|
3
|
+
* Renders a standard <a> element.
|
|
4
|
+
*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
interface LinkHref {
|
|
7
|
+
pathname?: string;
|
|
8
|
+
query?: Record<string, string>;
|
|
9
|
+
}
|
|
10
|
+
interface LinkProps {
|
|
11
|
+
href: string | LinkHref;
|
|
12
|
+
as?: string;
|
|
13
|
+
replace?: boolean;
|
|
14
|
+
scroll?: boolean;
|
|
15
|
+
shallow?: boolean;
|
|
16
|
+
prefetch?: boolean;
|
|
17
|
+
locale?: string;
|
|
18
|
+
children?: React.ReactNode;
|
|
19
|
+
className?: string;
|
|
20
|
+
style?: React.CSSProperties;
|
|
21
|
+
onClick?: (event: React.MouseEvent<HTMLAnchorElement>) => void;
|
|
22
|
+
[key: string]: unknown;
|
|
23
|
+
}
|
|
24
|
+
declare function NextLink({ href, children, replace: _replace, scroll: _scroll, shallow: _shallow, prefetch: _prefetch, locale: _locale, as: _as, ...rest }: LinkProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export default NextLink;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
10
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
|
+
var _react = _interopRequireDefault(require("react"));
|
|
12
|
+
var _excluded = ["href", "children", "replace", "scroll", "shallow", "prefetch", "locale", "as"];
|
|
13
|
+
/**
|
|
14
|
+
* Shim for next/link in the dynamic preview runtime (non-Next.js).
|
|
15
|
+
* Renders a standard <a> element.
|
|
16
|
+
*/
|
|
17
|
+
var __jsx = _react["default"].createElement;
|
|
18
|
+
function NextLink(_ref) {
|
|
19
|
+
var href = _ref.href,
|
|
20
|
+
children = _ref.children,
|
|
21
|
+
_replace = _ref.replace,
|
|
22
|
+
_scroll = _ref.scroll,
|
|
23
|
+
_shallow = _ref.shallow,
|
|
24
|
+
_prefetch = _ref.prefetch,
|
|
25
|
+
_locale = _ref.locale,
|
|
26
|
+
_as = _ref.as,
|
|
27
|
+
rest = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
28
|
+
var hrefStr = (0, _typeof2["default"])(href) === "object" ? "".concat(href.pathname || "/").concat(href.query ? "?" + new URLSearchParams(href.query).toString() : "") : href;
|
|
29
|
+
return __jsx("a", (0, _extends2["default"])({
|
|
30
|
+
href: hrefStr
|
|
31
|
+
}, rest), children);
|
|
32
|
+
}
|
|
33
|
+
var _default = exports["default"] = NextLink;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shim for next/navigation in the dynamic preview runtime (non-Next.js).
|
|
3
|
+
* Uses standard pathname-based routing (browser history API).
|
|
4
|
+
* Maps shared `react-pages` paths to the preview segment only (this bundle).
|
|
5
|
+
*/
|
|
6
|
+
export declare function useSearchParams(): URLSearchParams;
|
|
7
|
+
export declare function usePathname(): string;
|
|
8
|
+
export declare function useRouter(): {
|
|
9
|
+
push: (path: string) => void;
|
|
10
|
+
replace: (path: string) => void;
|
|
11
|
+
back: () => void;
|
|
12
|
+
forward: () => void;
|
|
13
|
+
refresh: () => void;
|
|
14
|
+
prefetch: () => void;
|
|
15
|
+
};
|
|
16
|
+
export declare function useParams(): {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useParams = useParams;
|
|
7
|
+
exports.usePathname = usePathname;
|
|
8
|
+
exports.useRouter = useRouter;
|
|
9
|
+
exports.useSearchParams = useSearchParams;
|
|
10
|
+
var _constants = require("@wavemaker-ai/react-runtime/core/constants");
|
|
11
|
+
/**
|
|
12
|
+
* Shim for next/navigation in the dynamic preview runtime (non-Next.js).
|
|
13
|
+
* Uses standard pathname-based routing (browser history API).
|
|
14
|
+
* Maps shared `react-pages` paths to the preview segment only (this bundle).
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
function normalizePath(path) {
|
|
18
|
+
return path.replace(new RegExp("/".concat(_constants.ROUTING_BASEPATH_PRODUCTION, "/"), "g"), "/".concat(_constants.PREVIEW_ROUTING_BASEPATH, "/"));
|
|
19
|
+
}
|
|
20
|
+
function useSearchParams() {
|
|
21
|
+
return new URLSearchParams(window.location.search);
|
|
22
|
+
}
|
|
23
|
+
function usePathname() {
|
|
24
|
+
return window.location.pathname;
|
|
25
|
+
}
|
|
26
|
+
function useRouter() {
|
|
27
|
+
return {
|
|
28
|
+
push: function push(path) {
|
|
29
|
+
var normalizedPath = normalizePath(path);
|
|
30
|
+
window.history.pushState(null, "", normalizedPath);
|
|
31
|
+
window.dispatchEvent(new PopStateEvent("popstate"));
|
|
32
|
+
},
|
|
33
|
+
replace: function replace(path) {
|
|
34
|
+
var normalizedPath = normalizePath(path);
|
|
35
|
+
window.history.replaceState(null, "", normalizedPath);
|
|
36
|
+
window.dispatchEvent(new PopStateEvent("popstate"));
|
|
37
|
+
},
|
|
38
|
+
back: function back() {
|
|
39
|
+
return window.history.back();
|
|
40
|
+
},
|
|
41
|
+
forward: function forward() {
|
|
42
|
+
return window.history.forward();
|
|
43
|
+
},
|
|
44
|
+
refresh: function refresh() {
|
|
45
|
+
return window.location.reload();
|
|
46
|
+
},
|
|
47
|
+
prefetch: function prefetch() {}
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
function useParams() {
|
|
51
|
+
return {};
|
|
52
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare function decodeURIComponentSafe(str: string): string;
|
|
2
|
+
export declare function parseJsonSafe(str: string): Record<string, unknown>;
|
|
3
|
+
export declare function getMetaContent(name: string): string;
|
|
4
|
+
/**
|
|
5
|
+
* Yields control back to the browser's main thread via setTimeout(0),
|
|
6
|
+
* allowing it to paint frames and handle user input between heavy
|
|
7
|
+
* compilation phases. Prevents long-task jank (>50ms) that degrades INP.
|
|
8
|
+
*/
|
|
9
|
+
export declare const yieldToMain: () => Promise<void>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.decodeURIComponentSafe = decodeURIComponentSafe;
|
|
7
|
+
exports.getMetaContent = getMetaContent;
|
|
8
|
+
exports.parseJsonSafe = parseJsonSafe;
|
|
9
|
+
exports.yieldToMain = void 0;
|
|
10
|
+
function decodeURIComponentSafe(str) {
|
|
11
|
+
if (!str) return "";
|
|
12
|
+
try {
|
|
13
|
+
return decodeURIComponent(str.replace(/\+/g, " "));
|
|
14
|
+
} catch (_unused) {
|
|
15
|
+
return str;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function parseJsonSafe(str) {
|
|
19
|
+
if (!str) return {};
|
|
20
|
+
try {
|
|
21
|
+
return JSON.parse(str);
|
|
22
|
+
} catch (_unused2) {
|
|
23
|
+
return {};
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function getMetaContent(name) {
|
|
27
|
+
var meta = document.querySelector("meta[name=\"".concat(name, "\"]"));
|
|
28
|
+
return (meta === null || meta === void 0 ? void 0 : meta.getAttribute("content")) || "";
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Yields control back to the browser's main thread via setTimeout(0),
|
|
33
|
+
* allowing it to paint frames and handle user input between heavy
|
|
34
|
+
* compilation phases. Prevents long-task jank (>50ms) that degrades INP.
|
|
35
|
+
*/
|
|
36
|
+
var yieldToMain = exports.yieldToMain = function yieldToMain() {
|
|
37
|
+
return new Promise(function (resolve) {
|
|
38
|
+
return setTimeout(resolve, 0);
|
|
39
|
+
});
|
|
40
|
+
};
|
|
@@ -27,7 +27,7 @@ var navigationMiddleware = exports.navigationMiddleware = function navigationMid
|
|
|
27
27
|
loginPage = ((_state$auth$securityC = state.auth.securityConfig) === null || _state$auth$securityC === void 0 || (_state$auth$securityC = _state$auth$securityC.loginConfig) === null || _state$auth$securityC === void 0 ? void 0 : _state$auth$securityC.pageName) || "Login";
|
|
28
28
|
if (router) {
|
|
29
29
|
store.dispatch((0, _authSlice.setPageLoading)(false));
|
|
30
|
-
router.push("/".concat(_constants.
|
|
30
|
+
router.push("/".concat((0, _constants.getActiveRoutingBasePath)(), "/").concat(loginPage));
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
return _context.abrupt("return", result);
|
|
@@ -49,17 +49,19 @@ var getServiceDefinitions = exports.getServiceDefinitions = (0, _toolkit.createA
|
|
|
49
49
|
}());
|
|
50
50
|
var getPrefabDefinitions = exports.getPrefabDefinitions = (0, _toolkit.createAsyncThunk)("appConfig/getPrefabDefinitions", /*#__PURE__*/function () {
|
|
51
51
|
var _ref5 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(_ref3, _ref4) {
|
|
52
|
-
var prefabName, baseUrl, pages, dispatch, rejectWithValue, _response$data, url, response, data;
|
|
52
|
+
var prefabName, baseUrl, pages, dispatch, rejectWithValue, _response$data, useRootServicedefs, url, response, data;
|
|
53
53
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
54
54
|
while (1) switch (_context2.prev = _context2.next) {
|
|
55
55
|
case 0:
|
|
56
56
|
prefabName = _ref3.prefabName, baseUrl = _ref3.baseUrl, pages = _ref3.pages;
|
|
57
57
|
dispatch = _ref4.dispatch, rejectWithValue = _ref4.rejectWithValue;
|
|
58
58
|
_context2.prev = 2;
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
// `""` and `__self__`: studio prefab preview — root `servicedefs` (metadata uses CONTEXT_APP).
|
|
60
|
+
useRootServicedefs = !prefabName || prefabName === "__self__";
|
|
61
|
+
url = useRootServicedefs ? "".concat(baseUrl !== null && baseUrl !== void 0 ? baseUrl : "", "/services/servicedefs").concat(baseUrl ? "" : ".json") : "".concat(baseUrl !== null && baseUrl !== void 0 ? baseUrl : "", "/services/prefabs/").concat(prefabName, "/servicedefs").concat(baseUrl ? "" : ".json");
|
|
62
|
+
_context2.next = 7;
|
|
61
63
|
return _axios["default"].get(url);
|
|
62
|
-
case
|
|
64
|
+
case 7:
|
|
63
65
|
response = _context2.sent;
|
|
64
66
|
data = {
|
|
65
67
|
serviceDefs: (response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.serviceDefs) || {},
|
|
@@ -71,15 +73,15 @@ var getPrefabDefinitions = exports.getPrefabDefinitions = (0, _toolkit.createAsy
|
|
|
71
73
|
data: data
|
|
72
74
|
}));
|
|
73
75
|
return _context2.abrupt("return", data);
|
|
74
|
-
case
|
|
75
|
-
_context2.prev =
|
|
76
|
+
case 13:
|
|
77
|
+
_context2.prev = 13;
|
|
76
78
|
_context2.t0 = _context2["catch"](2);
|
|
77
79
|
return _context2.abrupt("return", rejectWithValue("Failed to fetch prefab definitions"));
|
|
78
|
-
case
|
|
80
|
+
case 16:
|
|
79
81
|
case "end":
|
|
80
82
|
return _context2.stop();
|
|
81
83
|
}
|
|
82
|
-
}, _callee2, null, [[2,
|
|
84
|
+
}, _callee2, null, [[2, 13]]);
|
|
83
85
|
}));
|
|
84
86
|
return function (_x3, _x4) {
|
|
85
87
|
return _ref5.apply(this, arguments);
|
|
@@ -103,16 +103,21 @@ var loadSecurityInfo = exports.loadSecurityInfo = (0, _toolkit.createAsyncThunk)
|
|
|
103
103
|
return dispatch((0, _appConfigSlice.getServiceDefinitions)(baseURL)).unwrap();
|
|
104
104
|
case 18:
|
|
105
105
|
dispatch(setIsLoggedIn(true));
|
|
106
|
-
dispatch(setLandingPage(details.userInfo.landingPage));
|
|
107
106
|
|
|
108
107
|
// Clear access cache when user logs in (permissions might have changed)
|
|
109
108
|
(0, _useAccess.clearAccessCache)();
|
|
110
109
|
landingPage = details.userInfo.landingPage;
|
|
111
|
-
loginPage = (_secConfig$loginConfi = secConfig.loginConfig) === null || _secConfig$loginConfi === void 0 ? void 0 : _secConfig$loginConfi.pageName; //
|
|
110
|
+
loginPage = (_secConfig$loginConfi = secConfig.loginConfig) === null || _secConfig$loginConfi === void 0 ? void 0 : _secConfig$loginConfi.pageName; // Store the landing page as a full routable path so navigateToLandingPage
|
|
111
|
+
// can use it directly without accidentally producing a relative URL.
|
|
112
|
+
if (landingPage) {
|
|
113
|
+
dispatch(setLandingPage("/".concat((0, _constants.getActiveRoutingBasePath)(), "/").concat(landingPage)));
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// Extract the last segment of the pathname (the page name)
|
|
112
117
|
currentPageName = pathname.split("/").filter(Boolean).pop();
|
|
113
118
|
isOnLoginPage = currentPageName === loginPage;
|
|
114
119
|
if (router && landingPage && isOnLoginPage) {
|
|
115
|
-
router.push("/".concat(_constants.
|
|
120
|
+
router.push("/".concat((0, _constants.getActiveRoutingBasePath)(), "/").concat(landingPage));
|
|
116
121
|
}
|
|
117
122
|
_context.next = 30;
|
|
118
123
|
break;
|
|
@@ -135,31 +140,26 @@ var loadSecurityInfo = exports.loadSecurityInfo = (0, _toolkit.createAsyncThunk)
|
|
|
135
140
|
}
|
|
136
141
|
return _context.abrupt("return", Promise.resolve({}));
|
|
137
142
|
case 40:
|
|
138
|
-
_context.next = 42;
|
|
139
|
-
return dispatch(redirectToLogin({
|
|
140
|
-
securityConfig: secConfig
|
|
141
|
-
})).unwrap();
|
|
142
|
-
case 42:
|
|
143
143
|
return _context.abrupt("return", Promise.resolve({}));
|
|
144
|
-
case
|
|
145
|
-
_context.next =
|
|
144
|
+
case 41:
|
|
145
|
+
_context.next = 48;
|
|
146
146
|
break;
|
|
147
|
-
case
|
|
148
|
-
_context.prev =
|
|
147
|
+
case 43:
|
|
148
|
+
_context.prev = 43;
|
|
149
149
|
_context.t0 = _context["catch"](4);
|
|
150
|
-
_context.next =
|
|
150
|
+
_context.next = 47;
|
|
151
151
|
return dispatch(redirectToLogin({})).unwrap();
|
|
152
|
-
case
|
|
152
|
+
case 47:
|
|
153
153
|
throw _context.t0;
|
|
154
|
-
case
|
|
155
|
-
_context.prev =
|
|
154
|
+
case 48:
|
|
155
|
+
_context.prev = 48;
|
|
156
156
|
dispatch(setPageLoading(false));
|
|
157
|
-
return _context.finish(
|
|
158
|
-
case
|
|
157
|
+
return _context.finish(48);
|
|
158
|
+
case 51:
|
|
159
159
|
case "end":
|
|
160
160
|
return _context.stop();
|
|
161
161
|
}
|
|
162
|
-
}, _callee, null, [[4,
|
|
162
|
+
}, _callee, null, [[4, 43, 48, 51]]);
|
|
163
163
|
}));
|
|
164
164
|
return function (_x, _x2) {
|
|
165
165
|
return _ref2.apply(this, arguments);
|
|
@@ -182,7 +182,8 @@ var login = exports.login = (0, _toolkit.createAsyncThunk)("auth/login", /*#__PU
|
|
|
182
182
|
return _axios["default"].post("".concat(options.baseURL, "/j_spring_security_check"), payload, {
|
|
183
183
|
withCredentials: true,
|
|
184
184
|
headers: {
|
|
185
|
-
"Content-Type": "application/x-www-form-urlencoded"
|
|
185
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
|
186
|
+
"X-Requested-With": "XMLHttpRequest"
|
|
186
187
|
}
|
|
187
188
|
});
|
|
188
189
|
case 7:
|
|
@@ -223,11 +224,11 @@ var login = exports.login = (0, _toolkit.createAsyncThunk)("auth/login", /*#__PU
|
|
|
223
224
|
}());
|
|
224
225
|
var logout = exports.logout = (0, _toolkit.createAsyncThunk)("auth/logout", /*#__PURE__*/function () {
|
|
225
226
|
var _ref6 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3(options, _ref5) {
|
|
226
|
-
var dispatch, responseData, response, redirectURI;
|
|
227
|
+
var dispatch, getState, responseData, response, redirectURI, router, isPreview, _state$auth, state, loginPage;
|
|
227
228
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
228
229
|
while (1) switch (_context3.prev = _context3.next) {
|
|
229
230
|
case 0:
|
|
230
|
-
dispatch = _ref5.dispatch;
|
|
231
|
+
dispatch = _ref5.dispatch, getState = _ref5.getState;
|
|
231
232
|
responseData = null;
|
|
232
233
|
_context3.prev = 2;
|
|
233
234
|
_context3.next = 5;
|
|
@@ -261,14 +262,25 @@ var logout = exports.logout = (0, _toolkit.createAsyncThunk)("auth/logout", /*#_
|
|
|
261
262
|
|
|
262
263
|
// Clear access cache when user logs out
|
|
263
264
|
(0, _useAccess.clearAccessCache)();
|
|
265
|
+
|
|
266
|
+
// In preview mode the router is registered; navigate to the login page so
|
|
267
|
+
// the SPA reflects the logged-out state. In production the server-side
|
|
268
|
+
// redirect (window.location.href above) or Next.js routing handles this.
|
|
269
|
+
router = (0, _navigationMiddleware.getRouterInstance)();
|
|
270
|
+
isPreview = (0, _constants.getActiveRoutingBasePath)() === _constants.PREVIEW_ROUTING_BASEPATH;
|
|
271
|
+
if (router && isPreview) {
|
|
272
|
+
state = getState();
|
|
273
|
+
loginPage = ((_state$auth = state.auth) === null || _state$auth === void 0 || (_state$auth = _state$auth.securityConfig) === null || _state$auth === void 0 || (_state$auth = _state$auth.loginConfig) === null || _state$auth === void 0 ? void 0 : _state$auth.pageName) || "Login";
|
|
274
|
+
router.replace("/".concat(_constants.PREVIEW_ROUTING_BASEPATH, "/").concat(loginPage));
|
|
275
|
+
}
|
|
264
276
|
return _context3.finish(15);
|
|
265
|
-
case
|
|
277
|
+
case 25:
|
|
266
278
|
return _context3.abrupt("return", Promise.resolve(responseData));
|
|
267
|
-
case
|
|
279
|
+
case 26:
|
|
268
280
|
case "end":
|
|
269
281
|
return _context3.stop();
|
|
270
282
|
}
|
|
271
|
-
}, _callee3, null, [[2, 12, 15,
|
|
283
|
+
}, _callee3, null, [[2, 12, 15, 25]]);
|
|
272
284
|
}));
|
|
273
285
|
return function (_x5, _x6) {
|
|
274
286
|
return _ref6.apply(this, arguments);
|
|
@@ -391,25 +403,27 @@ var checkAccess = exports.checkAccess = (0, _toolkit.createAsyncThunk)("auth/che
|
|
|
391
403
|
}());
|
|
392
404
|
var navigateToLandingPage = exports.navigateToLandingPage = (0, _toolkit.createAsyncThunk)("auth/navigate/landingpage", /*#__PURE__*/function () {
|
|
393
405
|
var _ref13 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee6(_ref11, _ref12) {
|
|
394
|
-
var baseUrl, pageName, getState, dispatch, state, _state$
|
|
406
|
+
var baseUrl, pageName, getState, dispatch, state, _state$auth2, auth, redirectTo, landingPageToNavigate, _state$info, _auth$loggedInUser, homePage, userLandingPage, router;
|
|
395
407
|
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
|
396
408
|
while (1) switch (_context6.prev = _context6.next) {
|
|
397
409
|
case 0:
|
|
398
410
|
baseUrl = _ref11.baseUrl, pageName = _ref11.pageName;
|
|
399
411
|
getState = _ref12.getState, dispatch = _ref12.dispatch;
|
|
400
412
|
state = getState();
|
|
401
|
-
_state$
|
|
413
|
+
_state$auth2 = state.auth, auth = _state$auth2 === void 0 ? {} : _state$auth2;
|
|
402
414
|
redirectTo = (0, _app.getCurrentRouteQueryParam)("redirectTo"); // Priority: redirectTo param > stored landingPage > user's default landingPage > Main
|
|
403
415
|
if (redirectTo) {
|
|
404
416
|
// Use the redirectTo parameter from URL
|
|
405
|
-
landingPageToNavigate = "/".concat(_constants.
|
|
417
|
+
landingPageToNavigate = "/".concat((0, _constants.getActiveRoutingBasePath)(), "/").concat(redirectTo);
|
|
406
418
|
} else if (auth.landingPage) {
|
|
407
419
|
// Use stored landing page
|
|
408
420
|
landingPageToNavigate = auth.landingPage;
|
|
409
421
|
} else {
|
|
410
|
-
// Use user's default landing page or Main
|
|
422
|
+
// Use user's default landing page or Main. The landingPage from the server
|
|
423
|
+
// is a plain page name (e.g. "Main"), so always build the full routable path.
|
|
411
424
|
homePage = ((_state$info = state.info) === null || _state$info === void 0 || (_state$info = _state$info.appConfig) === null || _state$info === void 0 || (_state$info = _state$info.appProperties) === null || _state$info === void 0 ? void 0 : _state$info.homePage) || "Main";
|
|
412
|
-
|
|
425
|
+
userLandingPage = (_auth$loggedInUser = auth.loggedInUser) === null || _auth$loggedInUser === void 0 ? void 0 : _auth$loggedInUser.landingPage;
|
|
426
|
+
landingPageToNavigate = userLandingPage ? "/".concat((0, _constants.getActiveRoutingBasePath)(), "/").concat(userLandingPage) : "/".concat((0, _constants.getActiveRoutingBasePath)(), "/").concat(homePage);
|
|
413
427
|
}
|
|
414
428
|
router = (0, _navigationMiddleware.getRouterInstance)();
|
|
415
429
|
if (router) {
|
|
@@ -449,12 +463,12 @@ var redirectToLogin = exports.redirectToLogin = (0, _toolkit.createAsyncThunk)("
|
|
|
449
463
|
} else {
|
|
450
464
|
loginPage = (securityConfig === null || securityConfig === void 0 || (_securityConfig$login2 = securityConfig.loginConfig) === null || _securityConfig$login2 === void 0 ? void 0 : _securityConfig$login2.pageName) || "Login"; // Store landing page for post-login redirect
|
|
451
465
|
if (redirectTo && !redirectTo.startsWith("/" + loginPage)) {
|
|
452
|
-
setLandingPage("/".concat(_constants.
|
|
466
|
+
setLandingPage("/".concat((0, _constants.getActiveRoutingBasePath)(), "/").concat(redirectTo));
|
|
453
467
|
}
|
|
454
468
|
router = (0, _navigationMiddleware.getRouterInstance)();
|
|
455
469
|
if (router && !isPublicPage) {
|
|
456
470
|
// Build login URL with redirectTo query parameter
|
|
457
|
-
loginPath = "/".concat(_constants.
|
|
471
|
+
loginPath = "/".concat((0, _constants.getActiveRoutingBasePath)(), "/").concat(loginPage);
|
|
458
472
|
loginUrl = redirectTo && redirectTo.toLowerCase() !== homePage.toLowerCase() ? "".concat(loginPath, "?redirectTo=").concat(redirectTo) : loginPath;
|
|
459
473
|
router.push(loginUrl);
|
|
460
474
|
}
|