@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
|
@@ -1,25 +0,0 @@
|
|
|
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;
|
|
@@ -1,33 +0,0 @@
|
|
|
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;
|
|
@@ -1,16 +0,0 @@
|
|
|
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(): {};
|
|
@@ -1,52 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
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>;
|
|
@@ -1,40 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { transformMarkup } from "@wavemaker-ai/react-codegen/transpiler";
|
|
2
|
-
import type { CustomExpressionComponent, TransformedMarkupInput } from "./parser";
|
|
3
|
-
import { parseCustomExpressionToJsx } from "./parser";
|
|
4
|
-
export type { CustomExpressionComponent, TransformedMarkupInput } from "./parser";
|
|
5
|
-
export { parseCustomExpressionToJsx } from "./parser";
|
|
6
|
-
/** Re-export for callers that need the same WaveMaker transpiler the table uses. */
|
|
7
|
-
export { transformMarkup };
|
|
8
|
-
/** Column-like objects that expose WaveMaker `customExpression` markup per field key. */
|
|
9
|
-
export type CustomExpressionColumnSource = Record<string, {
|
|
10
|
-
customExpression?: string | undefined;
|
|
11
|
-
}>;
|
|
12
|
-
/**
|
|
13
|
-
* WaveMaker transpiler often emits `(row) => …`. Normalize arrow params so the row cell
|
|
14
|
-
* binding stays consistent with compiled JSX.
|
|
15
|
-
*/
|
|
16
|
-
export declare function normalizeTransformedMarkupRowBinding(transformedMarkup: TransformedMarkupInput): TransformedMarkupInput;
|
|
17
|
-
/**
|
|
18
|
-
* Pass column custom-expression markup and get a row renderer for `customColumns` /
|
|
19
|
-
* `customExpressionColumns` state. Uses codegen `transformMarkup` unless overridden.
|
|
20
|
-
*/
|
|
21
|
-
export declare function compileCustomExpressionMarkup(markup: string, options: {
|
|
22
|
-
listener: unknown;
|
|
23
|
-
transformMarkup?: (markup: string) => TransformedMarkupInput;
|
|
24
|
-
parse?: typeof parseCustomExpressionToJsx;
|
|
25
|
-
}): Promise<CustomExpressionComponent>;
|
|
26
|
-
/**
|
|
27
|
-
* Stable fingerprint of all custom markup strings (sorted keys) — use for memo deps / merge dedupe.
|
|
28
|
-
*/
|
|
29
|
-
export declare function buildCustomExpressionSignature(columnSource: CustomExpressionColumnSource): string;
|
|
30
|
-
export type BuildCustomExpressionComponentsMapOptions = {
|
|
31
|
-
columnSource: CustomExpressionColumnSource;
|
|
32
|
-
/** Listener / fragment passed through to the parser (e.g. Studio listener). */
|
|
33
|
-
listener: unknown;
|
|
34
|
-
/** Defaults to `@wavemaker-ai/react-codegen/transpiler` `transformMarkup`. */
|
|
35
|
-
transformMarkup?: (markup: string) => TransformedMarkupInput;
|
|
36
|
-
/** Override for tests or alternate parsers. */
|
|
37
|
-
parseCustomExpressionToJsx?: typeof parseCustomExpressionToJsx;
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* Parses every column on `columnSource` that defines `customExpression` into render callables.
|
|
41
|
-
* Store the result in table `customColumns` (or any map of column id → row renderer).
|
|
42
|
-
*/
|
|
43
|
-
export declare function buildCustomExpressionComponentsMap(options: BuildCustomExpressionComponentsMapOptions): Promise<Record<string, CustomExpressionComponent>>;
|
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.buildCustomExpressionComponentsMap = buildCustomExpressionComponentsMap;
|
|
8
|
-
exports.buildCustomExpressionSignature = buildCustomExpressionSignature;
|
|
9
|
-
exports.compileCustomExpressionMarkup = compileCustomExpressionMarkup;
|
|
10
|
-
exports.normalizeTransformedMarkupRowBinding = normalizeTransformedMarkupRowBinding;
|
|
11
|
-
Object.defineProperty(exports, "parseCustomExpressionToJsx", {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
get: function get() {
|
|
14
|
-
return _parser.parseCustomExpressionToJsx;
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
Object.defineProperty(exports, "transformMarkup", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function get() {
|
|
20
|
-
return _transpiler.transformMarkup;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
24
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
25
|
-
var _transpiler = require("@wavemaker-ai/react-codegen/transpiler");
|
|
26
|
-
var _parser = require("./parser");
|
|
27
|
-
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
28
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
29
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } /** Re-export for callers that need the same WaveMaker transpiler the table uses. */
|
|
30
|
-
/** Column-like objects that expose WaveMaker `customExpression` markup per field key. */
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* WaveMaker transpiler often emits `(row) => …`. Normalize arrow params so the row cell
|
|
34
|
-
* binding stays consistent with compiled JSX.
|
|
35
|
-
*/
|
|
36
|
-
function normalizeTransformedMarkupRowBinding(transformedMarkup) {
|
|
37
|
-
transformedMarkup.markup = transformedMarkup.markup.replace(/\(([^)]*)\)\s*=>/g, function (_match, params) {
|
|
38
|
-
var cleaned = params.split(",").map(function (p) {
|
|
39
|
-
return p.trim();
|
|
40
|
-
}).filter(function (p) {
|
|
41
|
-
return p !== "row";
|
|
42
|
-
}).join(", ");
|
|
43
|
-
return "(".concat(cleaned, ") =>");
|
|
44
|
-
});
|
|
45
|
-
return transformedMarkup;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Pass column custom-expression markup and get a row renderer for `customColumns` /
|
|
50
|
-
* `customExpressionColumns` state. Uses codegen `transformMarkup` unless overridden.
|
|
51
|
-
*/
|
|
52
|
-
function compileCustomExpressionMarkup(_x, _x2) {
|
|
53
|
-
return _compileCustomExpressionMarkup.apply(this, arguments);
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Stable fingerprint of all custom markup strings (sorted keys) — use for memo deps / merge dedupe.
|
|
57
|
-
*/
|
|
58
|
-
function _compileCustomExpressionMarkup() {
|
|
59
|
-
_compileCustomExpressionMarkup = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(markup, options) {
|
|
60
|
-
var _options$parse, _options$transformMar;
|
|
61
|
-
var parse, tm, transformedMarkup;
|
|
62
|
-
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
63
|
-
while (1) switch (_context.prev = _context.next) {
|
|
64
|
-
case 0:
|
|
65
|
-
parse = (_options$parse = options.parse) !== null && _options$parse !== void 0 ? _options$parse : _parser.parseCustomExpressionToJsx;
|
|
66
|
-
tm = (_options$transformMar = options.transformMarkup) !== null && _options$transformMar !== void 0 ? _options$transformMar : _transpiler.transformMarkup;
|
|
67
|
-
transformedMarkup = normalizeTransformedMarkupRowBinding(tm(markup));
|
|
68
|
-
return _context.abrupt("return", parse(transformedMarkup, options.listener));
|
|
69
|
-
case 4:
|
|
70
|
-
case "end":
|
|
71
|
-
return _context.stop();
|
|
72
|
-
}
|
|
73
|
-
}, _callee);
|
|
74
|
-
}));
|
|
75
|
-
return _compileCustomExpressionMarkup.apply(this, arguments);
|
|
76
|
-
}
|
|
77
|
-
function buildCustomExpressionSignature(columnSource) {
|
|
78
|
-
try {
|
|
79
|
-
return Object.keys(columnSource).filter(function (key) {
|
|
80
|
-
var _columnSource$key;
|
|
81
|
-
return (_columnSource$key = columnSource[key]) === null || _columnSource$key === void 0 ? void 0 : _columnSource$key.customExpression;
|
|
82
|
-
}).map(function (key) {
|
|
83
|
-
return "".concat(key, "\0").concat(String(columnSource[key].customExpression));
|
|
84
|
-
}).sort().join("\x1F");
|
|
85
|
-
} catch (_unused) {
|
|
86
|
-
return "";
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Parses every column on `columnSource` that defines `customExpression` into render callables.
|
|
91
|
-
* Store the result in table `customColumns` (or any map of column id → row renderer).
|
|
92
|
-
*/
|
|
93
|
-
function buildCustomExpressionComponentsMap(_x3) {
|
|
94
|
-
return _buildCustomExpressionComponentsMap.apply(this, arguments);
|
|
95
|
-
}
|
|
96
|
-
function _buildCustomExpressionComponentsMap() {
|
|
97
|
-
_buildCustomExpressionComponentsMap = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3(options) {
|
|
98
|
-
var columnSource, transformMarkupOpt, listener, _options$parseCustomE, parseFn, tm, keys, results, out, _iterator, _step, _step$value, key, component;
|
|
99
|
-
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
100
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
101
|
-
case 0:
|
|
102
|
-
columnSource = options.columnSource, transformMarkupOpt = options.transformMarkup, listener = options.listener, _options$parseCustomE = options.parseCustomExpressionToJsx, parseFn = _options$parseCustomE === void 0 ? _parser.parseCustomExpressionToJsx : _options$parseCustomE;
|
|
103
|
-
tm = transformMarkupOpt !== null && transformMarkupOpt !== void 0 ? transformMarkupOpt : _transpiler.transformMarkup;
|
|
104
|
-
keys = Object.keys(columnSource).filter(function (key) {
|
|
105
|
-
return columnSource[key].customExpression;
|
|
106
|
-
});
|
|
107
|
-
if (!(keys.length === 0)) {
|
|
108
|
-
_context3.next = 5;
|
|
109
|
-
break;
|
|
110
|
-
}
|
|
111
|
-
return _context3.abrupt("return", {});
|
|
112
|
-
case 5:
|
|
113
|
-
_context3.next = 7;
|
|
114
|
-
return Promise.all(keys.map(/*#__PURE__*/function () {
|
|
115
|
-
var _ref = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(key) {
|
|
116
|
-
var transformedMarkup, component;
|
|
117
|
-
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
118
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
119
|
-
case 0:
|
|
120
|
-
transformedMarkup = normalizeTransformedMarkupRowBinding(tm(columnSource[key].customExpression));
|
|
121
|
-
_context2.next = 3;
|
|
122
|
-
return parseFn(transformedMarkup, listener);
|
|
123
|
-
case 3:
|
|
124
|
-
component = _context2.sent;
|
|
125
|
-
return _context2.abrupt("return", {
|
|
126
|
-
key: key,
|
|
127
|
-
component: component
|
|
128
|
-
});
|
|
129
|
-
case 5:
|
|
130
|
-
case "end":
|
|
131
|
-
return _context2.stop();
|
|
132
|
-
}
|
|
133
|
-
}, _callee2);
|
|
134
|
-
}));
|
|
135
|
-
return function (_x4) {
|
|
136
|
-
return _ref.apply(this, arguments);
|
|
137
|
-
};
|
|
138
|
-
}()));
|
|
139
|
-
case 7:
|
|
140
|
-
results = _context3.sent;
|
|
141
|
-
out = {};
|
|
142
|
-
_iterator = _createForOfIteratorHelper(results);
|
|
143
|
-
try {
|
|
144
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
145
|
-
_step$value = _step.value, key = _step$value.key, component = _step$value.component;
|
|
146
|
-
out[key] = component;
|
|
147
|
-
}
|
|
148
|
-
} catch (err) {
|
|
149
|
-
_iterator.e(err);
|
|
150
|
-
} finally {
|
|
151
|
-
_iterator.f();
|
|
152
|
-
}
|
|
153
|
-
return _context3.abrupt("return", out);
|
|
154
|
-
case 12:
|
|
155
|
-
case "end":
|
|
156
|
-
return _context3.stop();
|
|
157
|
-
}
|
|
158
|
-
}, _callee3);
|
|
159
|
-
}));
|
|
160
|
-
return _buildCustomExpressionComponentsMap.apply(this, arguments);
|
|
161
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
export interface TransformedMarkupInput {
|
|
3
|
-
markup: string;
|
|
4
|
-
components?: Record<string, unknown>;
|
|
5
|
-
partials?: string[];
|
|
6
|
-
prefabs?: string[];
|
|
7
|
-
imports: Array<{
|
|
8
|
-
name: string;
|
|
9
|
-
as?: string;
|
|
10
|
-
from: string;
|
|
11
|
-
lazy?: boolean;
|
|
12
|
-
}>;
|
|
13
|
-
}
|
|
14
|
-
export type CustomExpressionComponent = (rowData: any) => React.ReactNode;
|
|
15
|
-
export declare function parseCustomExpressionToJsx(transformedMarkup: TransformedMarkupInput, fragment: any): Promise<CustomExpressionComponent>;
|
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.parseCustomExpressionToJsx = parseCustomExpressionToJsx;
|
|
8
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
|
-
var _construct2 = _interopRequireDefault(require("@babel/runtime/helpers/construct"));
|
|
10
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
12
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
13
|
-
var _react = _interopRequireDefault(require("react"));
|
|
14
|
-
var _sucrase = require("sucrase");
|
|
15
|
-
var _registry = require("@wavemaker-ai/react-runtime/runtime-dynamic/registry");
|
|
16
|
-
var _util = require("@wavemaker-ai/react-runtime/core/util");
|
|
17
|
-
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
18
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
19
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
20
|
-
var UTIL_SCOPE = {
|
|
21
|
-
formatMessage: _util.formatMessage,
|
|
22
|
-
_get: _util._get,
|
|
23
|
-
toNumber: _util.toNumber
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
/** WaveMaker column expressions are often `(row) => <WmLabel … />`. Strip that so we compile JSX only (same idea as markup-transpiler wrapping fragment content). */
|
|
27
|
-
function stripLeadingArrow(markup) {
|
|
28
|
-
var trimmed = markup.trim();
|
|
29
|
-
var arrow = trimmed.match(/^\([^)]*\)\s*=>\s*/);
|
|
30
|
-
return arrow ? trimmed.slice(arrow[0].length).trim() : trimmed;
|
|
31
|
-
}
|
|
32
|
-
function extractMarkupComponents(markup) {
|
|
33
|
-
var matches = markup.match(/\bWm[A-Z]\w*/g);
|
|
34
|
-
return matches ? (0, _toConsumableArray2["default"])(new Set(matches)) : [];
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Align with runtime-dynamic `markup-transpiler` resolveScope: React, fragment,
|
|
39
|
-
* row (cell), Widgets/Variables from fragment, imported + inferred Wm* components, utils.
|
|
40
|
-
*/
|
|
41
|
-
function resolveCustomExpressionScope(imports, fragment, markupForInference) {
|
|
42
|
-
var fr = fragment;
|
|
43
|
-
var names = ["React", "fragment", "row", "Widgets", "Variables"];
|
|
44
|
-
var values = [_react["default"], fragment, undefined, fr === null || fr === void 0 ? void 0 : fr.Widgets, fr === null || fr === void 0 ? void 0 : fr.Variables];
|
|
45
|
-
var seen = new Set(names);
|
|
46
|
-
var _iterator = _createForOfIteratorHelper(imports),
|
|
47
|
-
_step;
|
|
48
|
-
try {
|
|
49
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
50
|
-
var importDef = _step.value;
|
|
51
|
-
var binding = importDef.as || importDef.name;
|
|
52
|
-
if (seen.has(binding)) continue;
|
|
53
|
-
var component = (0, _registry.getComponent)(importDef.name);
|
|
54
|
-
if (component) {
|
|
55
|
-
seen.add(binding);
|
|
56
|
-
names.push(binding);
|
|
57
|
-
values.push(component);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
} catch (err) {
|
|
61
|
-
_iterator.e(err);
|
|
62
|
-
} finally {
|
|
63
|
-
_iterator.f();
|
|
64
|
-
}
|
|
65
|
-
var _iterator2 = _createForOfIteratorHelper(extractMarkupComponents(markupForInference)),
|
|
66
|
-
_step2;
|
|
67
|
-
try {
|
|
68
|
-
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
69
|
-
var wmName = _step2.value;
|
|
70
|
-
if (seen.has(wmName)) continue;
|
|
71
|
-
var _component = (0, _registry.getComponent)(wmName);
|
|
72
|
-
if (_component) {
|
|
73
|
-
seen.add(wmName);
|
|
74
|
-
names.push(wmName);
|
|
75
|
-
values.push(_component);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
} catch (err) {
|
|
79
|
-
_iterator2.e(err);
|
|
80
|
-
} finally {
|
|
81
|
-
_iterator2.f();
|
|
82
|
-
}
|
|
83
|
-
for (var _i = 0, _Object$entries = Object.entries(UTIL_SCOPE); _i < _Object$entries.length; _i++) {
|
|
84
|
-
var _Object$entries$_i = (0, _slicedToArray2["default"])(_Object$entries[_i], 2),
|
|
85
|
-
name = _Object$entries$_i[0],
|
|
86
|
-
value = _Object$entries$_i[1];
|
|
87
|
-
if (!seen.has(name)) {
|
|
88
|
-
seen.add(name);
|
|
89
|
-
names.push(name);
|
|
90
|
-
values.push(value);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
return {
|
|
94
|
-
names: names,
|
|
95
|
-
values: values
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
function compileJsxToRenderBody(jsxWrapped) {
|
|
99
|
-
var result = (0, _sucrase.transform)(jsxWrapped, {
|
|
100
|
-
transforms: ["typescript", "jsx"],
|
|
101
|
-
jsxRuntime: "classic",
|
|
102
|
-
production: true
|
|
103
|
-
});
|
|
104
|
-
return result.code || "";
|
|
105
|
-
}
|
|
106
|
-
var cache = new Map();
|
|
107
|
-
function parseCustomExpressionToJsx(_x, _x2) {
|
|
108
|
-
return _parseCustomExpressionToJsx.apply(this, arguments);
|
|
109
|
-
}
|
|
110
|
-
function _parseCustomExpressionToJsx() {
|
|
111
|
-
_parseCustomExpressionToJsx = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(transformedMarkup, fragment) {
|
|
112
|
-
var markup, _transformedMarkup$im, imports, jsxInner, jsxWrapped, compiledCode, fallback, fullCode, _resolveCustomExpress, names, templateValues, rowIdx, fragmentIdx, widgetsIdx, variablesIdx, _fallback, renderFn, _fallback2, stopPropagation, renderComponent;
|
|
113
|
-
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
114
|
-
while (1) switch (_context.prev = _context.next) {
|
|
115
|
-
case 0:
|
|
116
|
-
markup = transformedMarkup.markup, _transformedMarkup$im = transformedMarkup.imports, imports = _transformedMarkup$im === void 0 ? [] : _transformedMarkup$im;
|
|
117
|
-
if (markup !== null && markup !== void 0 && markup.trim()) {
|
|
118
|
-
_context.next = 3;
|
|
119
|
-
break;
|
|
120
|
-
}
|
|
121
|
-
return _context.abrupt("return", function () {
|
|
122
|
-
return null;
|
|
123
|
-
});
|
|
124
|
-
case 3:
|
|
125
|
-
if (!cache.has(markup)) {
|
|
126
|
-
_context.next = 5;
|
|
127
|
-
break;
|
|
128
|
-
}
|
|
129
|
-
return _context.abrupt("return", cache.get(markup));
|
|
130
|
-
case 5:
|
|
131
|
-
jsxInner = stripLeadingArrow(markup);
|
|
132
|
-
jsxWrapped = "function __render__() { return (<React.Fragment>".concat(jsxInner.trim() || "null", "</React.Fragment>); }");
|
|
133
|
-
_context.prev = 7;
|
|
134
|
-
compiledCode = compileJsxToRenderBody(jsxWrapped);
|
|
135
|
-
_context.next = 17;
|
|
136
|
-
break;
|
|
137
|
-
case 11:
|
|
138
|
-
_context.prev = 11;
|
|
139
|
-
_context.t0 = _context["catch"](7);
|
|
140
|
-
console.error("[customExpressionParser] Sucrase transform failed:", _context.t0);
|
|
141
|
-
fallback = function fallback() {
|
|
142
|
-
return null;
|
|
143
|
-
};
|
|
144
|
-
cache.set(markup, fallback);
|
|
145
|
-
return _context.abrupt("return", fallback);
|
|
146
|
-
case 17:
|
|
147
|
-
compiledCode = compiledCode.replace(/^["']use strict["'];?\s*/, "").replace(/\/\*#__PURE__\*\//g, "");
|
|
148
|
-
fullCode = "".concat(compiledCode, "\nreturn __render__();");
|
|
149
|
-
_resolveCustomExpress = resolveCustomExpressionScope(imports, fragment, "".concat(markup, "\n").concat(jsxInner)), names = _resolveCustomExpress.names, templateValues = _resolveCustomExpress.values;
|
|
150
|
-
rowIdx = names.indexOf("row");
|
|
151
|
-
fragmentIdx = names.indexOf("fragment");
|
|
152
|
-
widgetsIdx = names.indexOf("Widgets");
|
|
153
|
-
variablesIdx = names.indexOf("Variables");
|
|
154
|
-
if (!(rowIdx < 0)) {
|
|
155
|
-
_context.next = 29;
|
|
156
|
-
break;
|
|
157
|
-
}
|
|
158
|
-
console.error("[customExpressionParser] Internal error: row not in scope");
|
|
159
|
-
_fallback = function _fallback() {
|
|
160
|
-
return null;
|
|
161
|
-
};
|
|
162
|
-
cache.set(markup, _fallback);
|
|
163
|
-
return _context.abrupt("return", _fallback);
|
|
164
|
-
case 29:
|
|
165
|
-
_context.prev = 29;
|
|
166
|
-
renderFn = (0, _construct2["default"])(Function, (0, _toConsumableArray2["default"])(names).concat([fullCode]));
|
|
167
|
-
_context.next = 39;
|
|
168
|
-
break;
|
|
169
|
-
case 33:
|
|
170
|
-
_context.prev = 33;
|
|
171
|
-
_context.t1 = _context["catch"](29);
|
|
172
|
-
console.error("[customExpressionParser] Function compilation failed:", _context.t1);
|
|
173
|
-
_fallback2 = function _fallback2() {
|
|
174
|
-
return null;
|
|
175
|
-
};
|
|
176
|
-
cache.set(markup, _fallback2);
|
|
177
|
-
return _context.abrupt("return", _fallback2);
|
|
178
|
-
case 39:
|
|
179
|
-
stopPropagation = function stopPropagation(e) {
|
|
180
|
-
return e.stopPropagation();
|
|
181
|
-
};
|
|
182
|
-
renderComponent = function renderComponent(rowData) {
|
|
183
|
-
try {
|
|
184
|
-
var args = templateValues.slice();
|
|
185
|
-
args[rowIdx] = rowData;
|
|
186
|
-
var fr = fragment;
|
|
187
|
-
if (fragmentIdx >= 0) args[fragmentIdx] = fragment;
|
|
188
|
-
if (widgetsIdx >= 0) args[widgetsIdx] = fr === null || fr === void 0 ? void 0 : fr.Widgets;
|
|
189
|
-
if (variablesIdx >= 0) args[variablesIdx] = fr === null || fr === void 0 ? void 0 : fr.Variables;
|
|
190
|
-
return /*#__PURE__*/_react["default"].createElement("span", {
|
|
191
|
-
className: "custom-expr-wrapper",
|
|
192
|
-
onClick: stopPropagation
|
|
193
|
-
}, renderFn.apply(void 0, (0, _toConsumableArray2["default"])(args)));
|
|
194
|
-
} catch (err) {
|
|
195
|
-
console.error("[customExpressionParser] Render error:", err);
|
|
196
|
-
return null;
|
|
197
|
-
}
|
|
198
|
-
};
|
|
199
|
-
cache.set(markup, renderComponent);
|
|
200
|
-
return _context.abrupt("return", renderComponent);
|
|
201
|
-
case 43:
|
|
202
|
-
case "end":
|
|
203
|
-
return _context.stop();
|
|
204
|
-
}
|
|
205
|
-
}, _callee, null, [[7, 11], [29, 33]]);
|
|
206
|
-
}));
|
|
207
|
-
return _parseCustomExpressionToJsx.apply(this, arguments);
|
|
208
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function layoutSizeUtil(el: HTMLElement, widget?: string, height?: string): void;
|
package/utils/layoutsize-util.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.layoutSizeUtil = layoutSizeUtil;
|
|
7
|
-
// alligening flexgrow, flexShrink,selfAlign and minWidth/minHeight to achieve the desired
|
|
8
|
-
// auto layout behavior based on parent flex context and provided value (fill/hug/number).
|
|
9
|
-
|
|
10
|
-
function applySize(el, key, nv) {
|
|
11
|
-
var parent = el.parentElement;
|
|
12
|
-
var parentStyle = parent ? getComputedStyle(parent) : null;
|
|
13
|
-
var isParentFlex = !!parentStyle && ["flex", "inline-flex"].includes(parentStyle.display);
|
|
14
|
-
var isMainAxis = false;
|
|
15
|
-
if (isParentFlex) {
|
|
16
|
-
var flexDir = parentStyle.flexDirection;
|
|
17
|
-
var isRow = ["row", "row-reverse"].includes(flexDir);
|
|
18
|
-
isMainAxis = key === "width" && isRow || key === "height" && !isRow;
|
|
19
|
-
}
|
|
20
|
-
var minKey = key === "width" ? "minWidth" : "minHeight";
|
|
21
|
-
if (nv === "fill") {
|
|
22
|
-
if (!isParentFlex) {
|
|
23
|
-
el.style[key] = "100%";
|
|
24
|
-
} else {
|
|
25
|
-
el.style[key] = "";
|
|
26
|
-
if (isMainAxis) {
|
|
27
|
-
el.style.flexGrow = "1";
|
|
28
|
-
el.style.flexShrink = "";
|
|
29
|
-
el.style[minKey] = "0";
|
|
30
|
-
} else {
|
|
31
|
-
el.style.alignSelf = "stretch";
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
} else {
|
|
35
|
-
if (nv === "hug") {
|
|
36
|
-
el.style[key] = "fit-content";
|
|
37
|
-
}
|
|
38
|
-
if (isParentFlex) {
|
|
39
|
-
if (isMainAxis) {
|
|
40
|
-
el.style.flexGrow = "";
|
|
41
|
-
el.style.flexShrink = "0";
|
|
42
|
-
el.style[minKey] = "";
|
|
43
|
-
} else {
|
|
44
|
-
el.style.alignSelf = "";
|
|
45
|
-
}
|
|
46
|
-
} else {
|
|
47
|
-
el.style.flexGrow = "";
|
|
48
|
-
el.style.flexShrink = "0";
|
|
49
|
-
el.style.alignSelf = "";
|
|
50
|
-
el.style[minKey] = "";
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
function layoutSizeUtil(el, widget, height) {
|
|
55
|
-
if (widget) applySize(el, "width", widget);
|
|
56
|
-
if (height) applySize(el, "height", height);
|
|
57
|
-
}
|