xmlui 0.9.59 → 0.9.60
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/dist/lib/{apiInterceptorWorker-BYU_Trhx.mjs → apiInterceptorWorker-CNiXy9XE.mjs} +1 -1
- package/dist/lib/{index-JqY6G28u.mjs → index-B1V2vJWh.mjs} +12728 -13275
- package/dist/lib/index.css +1 -1
- package/dist/lib/language-server-web-worker.mjs +1 -1
- package/dist/lib/language-server.mjs +1 -1
- package/dist/lib/{metadata-utils-BXdiMJQN.mjs → metadata-utils-4EQ6kQIM.mjs} +31 -40
- package/dist/lib/{server-common-DGglaqCL.mjs → server-common-SNl_47nE.mjs} +858 -1450
- package/dist/lib/{transform-BboeJCuA.mjs → transform-CgRMkbb0.mjs} +733 -798
- package/dist/lib/xmlui-parser.d.ts +6 -31
- package/dist/lib/xmlui-parser.mjs +42 -49
- package/dist/lib/{xmlui-serializer-D0p6Hyum.mjs → xmlui-serializer-EDw51UFN.mjs} +1 -1
- package/dist/lib/xmlui.d.ts +6 -45
- package/dist/lib/xmlui.mjs +2 -2
- package/dist/metadata/{apiInterceptorWorker-CqXRCP46.mjs → apiInterceptorWorker-DsjW46f_.mjs} +1 -1
- package/dist/metadata/{collectedComponentMetadata-BA6d7xt-.mjs → collectedComponentMetadata-CBiI_eDf.mjs} +13515 -14148
- package/dist/metadata/style.css +1 -1
- package/dist/metadata/xmlui-metadata.mjs +1 -1
- package/dist/metadata/xmlui-metadata.umd.js +124 -124
- package/dist/scripts/package.json +5 -5
- package/dist/scripts/src/components/Accordion/Accordion.js +1 -1
- package/dist/scripts/src/components/App/App.js +1 -5
- package/dist/scripts/src/components/App/AppNative.js +1 -11
- package/dist/scripts/src/components/Card/Card.js +1 -1
- package/dist/scripts/src/components/Card/CardNative.js +1 -2
- package/dist/scripts/src/components/Charts/DonutChart/DonutChart.js +5 -6
- package/dist/scripts/src/components/Charts/PieChart/PieChart.js +7 -11
- package/dist/scripts/src/components/Charts/PieChart/PieChartNative.js +4 -9
- package/dist/scripts/src/components/CodeBlock/CodeBlock.js +1 -4
- package/dist/scripts/src/components/CodeBlock/CodeBlockNative.js +1 -1
- package/dist/scripts/src/components/ColorPicker/ColorPickerNative.js +2 -2
- package/dist/scripts/src/components/ComponentProvider.js +0 -4
- package/dist/scripts/src/components/ExpandableItem/ExpandableItem.js +3 -3
- package/dist/scripts/src/components/FlowLayout/FlowLayoutNative.js +6 -35
- package/dist/scripts/src/components/Footer/Footer.js +1 -2
- package/dist/scripts/src/components/Form/Form.js +0 -4
- package/dist/scripts/src/components/Form/FormNative.js +4 -12
- package/dist/scripts/src/components/FormItem/ItemWithLabel.js +1 -1
- package/dist/scripts/src/components/Link/LinkNative.js +1 -46
- package/dist/scripts/src/components/Markdown/Markdown.js +3 -3
- package/dist/scripts/src/components/Markdown/MarkdownNative.js +3 -2
- package/dist/scripts/src/components/Markdown/utils.js +12 -21
- package/dist/scripts/src/components/NavGroup/NavGroupContext.js +0 -1
- package/dist/scripts/src/components/NavGroup/NavGroupNative.js +2 -6
- package/dist/scripts/src/components/NavLink/NavLinkNative.js +9 -10
- package/dist/scripts/src/components/NavPanel/NavPanel.js +2 -3
- package/dist/scripts/src/components/NavPanel/NavPanelNative.js +3 -132
- package/dist/scripts/src/components/NestedApp/AppWithCodeView.js +3 -22
- package/dist/scripts/src/components/NestedApp/AppWithCodeViewNative.js +7 -66
- package/dist/scripts/src/components/NestedApp/NestedApp.js +7 -13
- package/dist/scripts/src/components/NestedApp/NestedAppNative.js +6 -8
- package/dist/scripts/src/components/Pages/Pages.js +4 -4
- package/dist/scripts/src/components/Pages/PagesNative.js +3 -8
- package/dist/scripts/src/components/RadioGroup/RadioGroup.js +11 -12
- package/dist/scripts/src/components/RadioGroup/RadioGroupNative.js +28 -13
- package/dist/scripts/src/components/Select/Select.js +1 -2
- package/dist/scripts/src/components/Select/SelectNative.js +1 -1
- package/dist/scripts/src/components/StickyBox/StickyBoxNative.js +0 -2
- package/dist/scripts/src/components/Switch/Switch.js +2 -6
- package/dist/scripts/src/components/Table/TableNative.js +2 -6
- package/dist/scripts/src/components/Table/useRowSelection.js +2 -6
- package/dist/scripts/src/components/Tabs/Tabs.js +2 -5
- package/dist/scripts/src/components/Text/Text.js +2 -2
- package/dist/scripts/src/components/TextBox/TextBox.js +1 -1
- package/dist/scripts/src/components/Theme/NotificationToast.js +0 -11
- package/dist/scripts/src/components/Theme/ThemeNative.js +4 -4
- package/dist/scripts/src/components/TreeDisplay/TreeDisplay.js +0 -2
- package/dist/scripts/src/components-core/Fragment.js +2 -5
- package/dist/scripts/src/components-core/RestApiProxy.js +7 -10
- package/dist/scripts/src/components-core/appContext/date-functions.js +0 -1
- package/dist/scripts/src/components-core/descriptorHelper.js +0 -9
- package/dist/scripts/src/components-core/interception/ApiInterceptorProvider.js +2 -2
- package/dist/scripts/src/components-core/rendering/AppContent.js +2 -6
- package/dist/scripts/src/components-core/rendering/AppRoot.js +2 -4
- package/dist/scripts/src/components-core/rendering/StateContainer.js +0 -6
- package/dist/scripts/src/components-core/theming/layout-resolver.js +0 -18
- package/dist/scripts/src/components-core/theming/themes/root.js +0 -3
- package/dist/scripts/src/components-core/utils/date-utils.js +0 -60
- package/dist/scripts/src/parsers/xmlui-parser/parser.js +39 -42
- package/dist/scripts/src/parsers/xmlui-parser/syntax-node.js +0 -65
- package/dist/scripts/src/parsers/xmlui-parser/transform.js +8 -10
- package/dist/scripts/src/parsers/xmlui-parser/utils.js +2 -1
- package/dist/standalone/xmlui-standalone.es.d.ts +6 -45
- package/dist/standalone/xmlui-standalone.umd.js +248 -248
- package/package.json +5 -5
- package/dist/scripts/src/components/HelloWorld/HelloWorld.js +0 -103
- package/dist/scripts/src/components/HelloWorld/HelloWorldNative.js +0 -92
|
@@ -23,17 +23,12 @@ const react_2 = require("@remix-run/react");
|
|
|
23
23
|
const classnames_1 = __importDefault(require("classnames"));
|
|
24
24
|
const constants_1 = require("../../components-core/constants");
|
|
25
25
|
const Pages_module_scss_1 = __importDefault(require("./Pages.module.scss"));
|
|
26
|
-
const AppLayoutContext_1 = require("../App/AppLayoutContext");
|
|
27
26
|
// Default props for Pages component
|
|
28
27
|
exports.defaultProps = {
|
|
29
|
-
|
|
28
|
+
defaultRoute: "/"
|
|
30
29
|
};
|
|
31
30
|
function RouteWrapper({ childRoute = constants_1.EMPTY_ARRAY, renderChild, layoutContext, style, uid, }) {
|
|
32
|
-
var _a;
|
|
33
31
|
const params = (0, react_2.useParams)();
|
|
34
|
-
const location = (0, react_2.useLocation)();
|
|
35
|
-
const appLayoutContext = (0, AppLayoutContext_1.useAppLayoutContext)();
|
|
36
|
-
const linkInfo = ((_a = appLayoutContext === null || appLayoutContext === void 0 ? void 0 : appLayoutContext.linkMap) === null || _a === void 0 ? void 0 : _a.get(location.pathname)) || {};
|
|
37
32
|
//we need to wrap the child route in a container to make sure the route params are available.
|
|
38
33
|
// we do this wrapping by providing an empty object to vars.
|
|
39
34
|
// this way it becomes an 'implicit' container (vars/state inside this container is propagated to the parent)
|
|
@@ -59,7 +54,7 @@ function RouteWrapper({ childRoute = constants_1.EMPTY_ARRAY, renderChild, layou
|
|
|
59
54
|
}, [style]);
|
|
60
55
|
return ((0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(Pages_module_scss_1.default.wrapper, "xmlui-page-root"), style: wrapperStyle, children: renderChild(wrappedWithContainer, layoutContext) }, JSON.stringify(params)));
|
|
61
56
|
}
|
|
62
|
-
function Pages({ node, renderChild, extractValue,
|
|
57
|
+
function Pages({ node, renderChild, extractValue, defaultRoute }) {
|
|
63
58
|
var _a;
|
|
64
59
|
const routes = [];
|
|
65
60
|
const restChildren = [];
|
|
@@ -73,5 +68,5 @@ function Pages({ node, renderChild, extractValue, fallbackPath }) {
|
|
|
73
68
|
});
|
|
74
69
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(react_2.Routes, { children: [routes.map((child, i) => {
|
|
75
70
|
return ((0, jsx_runtime_1.jsx)(react_2.Route, { path: extractValue(child.props.url), element: renderChild(child) }, i));
|
|
76
|
-
}), !!
|
|
71
|
+
}), !!defaultRoute && (0, jsx_runtime_1.jsx)(react_2.Route, { path: "*", element: (0, jsx_runtime_1.jsx)(react_2.Navigate, { to: defaultRoute, replace: true }) })] }), renderChild(restChildren)] }));
|
|
77
72
|
}
|
|
@@ -41,21 +41,20 @@ exports.RadioGroupMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
41
41
|
defaultThemeVars: {
|
|
42
42
|
[`gap-${RGOption}`]: "$space-1_5",
|
|
43
43
|
[`borderWidth-${RGOption}`]: "1px",
|
|
44
|
-
[`
|
|
44
|
+
[`backgroundColor-checked-${RGOption}-indicator`]: `$backgroundColor-primary`,
|
|
45
|
+
[`backgroundColor-checked-${RGOption}--disabled]`]: `$borderColor-${RGOption}--disabled`,
|
|
46
|
+
[`backgroundColor-checked-${RGOption}-error`]: `$borderColor-${RGOption}-error`,
|
|
47
|
+
[`backgroundColor-checked-${RGOption}-warning`]: `$borderColor-${RGOption}-warning`,
|
|
48
|
+
[`backgroundColor-checked-${RGOption}-success`]: `$borderColor-${RGOption}-success`,
|
|
49
|
+
[`fontSize-${RGOption}`]: "$fontSize-small",
|
|
50
|
+
[`fontWeight-${RGOption}`]: "$fontWeight-bold",
|
|
51
|
+
[`textColor-${RGOption}-error`]: `$borderColor-${RGOption}-error`,
|
|
52
|
+
[`textColor-${RGOption}-warning`]: `$borderColor-${RGOption}-warning`,
|
|
53
|
+
[`textColor-${RGOption}-success`]: `$borderColor-${RGOption}-success`,
|
|
54
|
+
[`backgroundColor-checked-${RGOption}-default`]: "$color-primary-500",
|
|
45
55
|
[`borderColor-${RGOption}-default`]: "$color-surface-500",
|
|
46
|
-
[`borderColor-checked-${RGOption}`]: "$color-primary-500",
|
|
47
56
|
[`borderColor-${RGOption}-default--hover`]: "$color-surface-700",
|
|
48
57
|
[`borderColor-${RGOption}-default--active`]: "$color-primary-500",
|
|
49
|
-
[`backgroundColor-${RGOption}--disabled`]: "$backgroundColor--disabled",
|
|
50
|
-
[`backgroundColor-checked-${RGOption}`]: "$color-primary-500",
|
|
51
|
-
[`backgroundColor-${RGOption}-checked--disabled`]: `$textColor--disabled`,
|
|
52
|
-
[`backgroundColor-checked-indicator-${RGOption}`]: `transparent`,
|
|
53
|
-
[`backgroundColor-${RGOption}-checked-indicator--disabled`]: `transparent`,
|
|
54
|
-
[`backgroundColor-checked-${RGOption}-error`]: `$borderColor-error`,
|
|
55
|
-
[`backgroundColor-checked-${RGOption}-warning`]: `$borderColor-warning`,
|
|
56
|
-
[`backgroundColor-checked-${RGOption}-success`]: `$borderColor-success`,
|
|
57
|
-
[`fontSize-${RGOption}`]: "$fontSize-small",
|
|
58
|
-
[`fontWeight-${RGOption}`]: "$fontWeight-bold",
|
|
59
58
|
},
|
|
60
59
|
});
|
|
61
60
|
exports.radioGroupRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.RadioGroupMd, ({ node, extractValue, layoutCss, state, updateState, lookupEventHandler, renderChild, registerComponentApi, }) => {
|
|
@@ -37,6 +37,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.RadioGroupOption = exports.RadioGroup = exports.defaultProps = void 0;
|
|
40
|
+
exports.useRadioGroupValue = useRadioGroupValue;
|
|
40
41
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
41
42
|
const react_1 = __importStar(require("react"));
|
|
42
43
|
const InnerRadioGroup = __importStar(require("@radix-ui/react-radio-group"));
|
|
@@ -53,9 +54,8 @@ exports.defaultProps = {
|
|
|
53
54
|
validationStatus: "none",
|
|
54
55
|
required: false,
|
|
55
56
|
};
|
|
56
|
-
const
|
|
57
|
+
const RadioGroupValidationStatusContext = (0, react_1.createContext)({
|
|
57
58
|
status: "none",
|
|
58
|
-
enabled: exports.defaultProps.enabled,
|
|
59
59
|
});
|
|
60
60
|
exports.RadioGroup = (0, react_1.forwardRef)(function RadioGroup({ id, value = exports.defaultProps.value, initialValue = exports.defaultProps.initialValue, enabled = exports.defaultProps.enabled, validationStatus = exports.defaultProps.validationStatus, label, labelPosition, labelWidth, labelBreak, required = exports.defaultProps.required, updateState = constants_1.noop, onDidChange = constants_1.noop, onFocus = constants_1.noop, onBlur = constants_1.noop, children, registerComponentApi, style, }, forwardedRef) {
|
|
61
61
|
const [focused, setFocused] = react_1.default.useState(false);
|
|
@@ -90,25 +90,40 @@ exports.RadioGroup = (0, react_1.forwardRef)(function RadioGroup({ id, value = e
|
|
|
90
90
|
});
|
|
91
91
|
}, [/* focus, */ registerComponentApi, setValue]);
|
|
92
92
|
const contextValue = (0, react_1.useMemo)(() => {
|
|
93
|
-
return { value, status: validationStatus
|
|
94
|
-
}, [value, validationStatus
|
|
95
|
-
return ((0, jsx_runtime_1.jsx)(ItemWithLabel_1.ItemWithLabel, { ref: forwardedRef, labelPosition: labelPosition, label: label, labelWidth: labelWidth, labelBreak: labelBreak, required: required, enabled: enabled, onFocus: onFocus, onBlur: onBlur, style: style, children: (0, jsx_runtime_1.jsx)(OptionTypeProvider_1.default, { Component: exports.RadioGroupOption, children: (0, jsx_runtime_1.jsx)(
|
|
93
|
+
return { value, status: validationStatus };
|
|
94
|
+
}, [value, validationStatus]);
|
|
95
|
+
return ((0, jsx_runtime_1.jsx)(ItemWithLabel_1.ItemWithLabel, { ref: forwardedRef, labelPosition: labelPosition, label: label, labelWidth: labelWidth, labelBreak: labelBreak, required: required, enabled: enabled, onFocus: onFocus, onBlur: onBlur, style: style, children: (0, jsx_runtime_1.jsx)(OptionTypeProvider_1.default, { Component: exports.RadioGroupOption, children: (0, jsx_runtime_1.jsx)(RadioGroupValidationStatusContext.Provider, { value: contextValue, children: (0, jsx_runtime_1.jsx)(InnerRadioGroup.Root, { id: id, onBlur: handleOnBlur, onFocus: handleOnFocus, onValueChange: onInputChange, value: value, disabled: !enabled, className: (0, classnames_1.default)(RadioGroup_module_scss_1.default.radioGroupContainer, {
|
|
96
96
|
[RadioGroup_module_scss_1.default.focused]: focused,
|
|
97
97
|
[RadioGroup_module_scss_1.default.disabled]: !enabled,
|
|
98
98
|
}), children: children }) }) }) }));
|
|
99
99
|
});
|
|
100
|
+
function useRadioGroupValue() {
|
|
101
|
+
const context = (0, react_1.useContext)(RadioGroupValidationStatusContext);
|
|
102
|
+
if (!context) {
|
|
103
|
+
throw new Error("useRadioGroupValue must be used within a RadioGroup");
|
|
104
|
+
}
|
|
105
|
+
const { value } = context;
|
|
106
|
+
const isChecked = (0, react_1.useCallback)((optionValue) => value === optionValue, [value]);
|
|
107
|
+
return {
|
|
108
|
+
value,
|
|
109
|
+
isChecked,
|
|
110
|
+
};
|
|
111
|
+
}
|
|
100
112
|
const RadioGroupOption = ({ value, label, enabled = true, optionRenderer, style, }) => {
|
|
101
113
|
const id = (0, react_1.useId)();
|
|
102
|
-
const
|
|
114
|
+
const validationContext = (0, react_1.useContext)(RadioGroupValidationStatusContext);
|
|
115
|
+
const { isChecked } = useRadioGroupValue();
|
|
103
116
|
const statusStyles = (0, react_1.useMemo)(() => ({
|
|
104
|
-
[RadioGroup_module_scss_1.default.disabled]:
|
|
105
|
-
[RadioGroup_module_scss_1.default.error]: value ===
|
|
106
|
-
[RadioGroup_module_scss_1.default.warning]: value ===
|
|
107
|
-
[RadioGroup_module_scss_1.default.valid]: value ===
|
|
108
|
-
}), [enabled,
|
|
109
|
-
const item = (0, react_1.useMemo)(() => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(InnerRadioGroup.Item, { className: (0, classnames_1.default)(RadioGroup_module_scss_1.default.radioOption, statusStyles
|
|
117
|
+
[RadioGroup_module_scss_1.default.disabled]: !enabled,
|
|
118
|
+
[RadioGroup_module_scss_1.default.error]: value === validationContext.value && validationContext.status === "error",
|
|
119
|
+
[RadioGroup_module_scss_1.default.warning]: value === validationContext.value && validationContext.status === "warning",
|
|
120
|
+
[RadioGroup_module_scss_1.default.valid]: value === validationContext.value && validationContext.status === "valid",
|
|
121
|
+
}), [enabled, validationContext.status, validationContext.value, value]);
|
|
122
|
+
const item = (0, react_1.useMemo)(() => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(InnerRadioGroup.Item, { className: (0, classnames_1.default)(RadioGroup_module_scss_1.default.radioOption, statusStyles, {
|
|
123
|
+
[RadioGroup_module_scss_1.default.checked]: isChecked(value),
|
|
124
|
+
}), value: value, disabled: !enabled, id: id, children: (0, jsx_runtime_1.jsx)(InnerRadioGroup.Indicator, { className: (0, classnames_1.default)(RadioGroup_module_scss_1.default.indicator, statusStyles) }) }), (0, jsx_runtime_1.jsx)("label", { htmlFor: id, className: (0, classnames_1.default)(RadioGroup_module_scss_1.default.label, statusStyles), children: label !== null && label !== void 0 ? label : value })] })), [enabled, id, label, statusStyles, value]);
|
|
110
125
|
return ((0, jsx_runtime_1.jsx)("div", { className: RadioGroup_module_scss_1.default.radioOptionContainer, style: style, children: optionRenderer ? ((0, jsx_runtime_1.jsxs)("label", { className: RadioGroup_module_scss_1.default.optionLabel, children: [(0, jsx_runtime_1.jsx)("div", { className: RadioGroup_module_scss_1.default.itemContainer, children: item }), optionRenderer({
|
|
111
|
-
$checked: value ===
|
|
126
|
+
$checked: value === validationContext.value,
|
|
112
127
|
})] })) : (item) }, id));
|
|
113
128
|
};
|
|
114
129
|
exports.RadioGroupOption = RadioGroupOption;
|
|
@@ -75,6 +75,7 @@ exports.SelectMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
75
75
|
[`borderRadius-menu-${COMP}`]: "$borderRadius",
|
|
76
76
|
[`borderWidth-menu-${COMP}`]: "1px",
|
|
77
77
|
[`borderColor-menu-${COMP}`]: "$borderColor",
|
|
78
|
+
[`minHeight-Input`]: "39px",
|
|
78
79
|
[`backgroundColor-${COMP}-badge`]: "$color-primary-500",
|
|
79
80
|
[`fontSize-${COMP}-badge`]: "$fontSize-small",
|
|
80
81
|
[`paddingHorizontal-${COMP}-badge`]: "$space-1",
|
|
@@ -90,8 +91,6 @@ exports.SelectMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
90
91
|
[`backgroundColor-item-${COMP}`]: "$backgroundColor-dropdown-item",
|
|
91
92
|
[`backgroundColor-item-${COMP}--hover`]: "$backgroundColor-dropdown-item--hover",
|
|
92
93
|
[`backgroundColor-item-${COMP}--active`]: "$backgroundColor-dropdown-item--active",
|
|
93
|
-
// Default borderColor-Input--disabled is too light so the disabled component is barely visible
|
|
94
|
-
[`borderColor-${COMP}--disabled`]: "initial",
|
|
95
94
|
},
|
|
96
95
|
});
|
|
97
96
|
exports.selectComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.SelectMd, ({ node, state, updateState, extractValue, renderChild, lookupEventHandler, layoutCss, registerComponentApi, }) => {
|
|
@@ -212,7 +212,7 @@ exports.Select = (0, react_1.forwardRef)(function Select({ id, initialValue, val
|
|
|
212
212
|
}, children: [searchable ? ((0, jsx_runtime_1.jsxs)("div", { className: Select_module_scss_1.default.commandInputContainer, children: [(0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "search" }), (0, jsx_runtime_1.jsx)(cmdk_1.CommandInput, { className: (0, classnames_1.default)(Select_module_scss_1.default.commandInput), placeholder: "Search..." })] })) : (
|
|
213
213
|
// https://github.com/pacocoursey/cmdk/issues/322#issuecomment-2444703817
|
|
214
214
|
(0, jsx_runtime_1.jsx)("button", { autoFocus: true, "aria-hidden": "true", className: Select_module_scss_1.default.srOnly })), (0, jsx_runtime_1.jsxs)(cmdk_1.CommandList, { className: Select_module_scss_1.default.commandList, children: [inProgress && ((0, jsx_runtime_1.jsx)("div", { className: Select_module_scss_1.default.loading, children: inProgressNotificationMessage })), Array.from(options).map(({ value, label, enabled, keywords }) => ((0, jsx_runtime_1.jsx)(exports.ComboboxOption, { readOnly: readOnly, value: value, label: label, enabled: enabled, keywords: keywords }, value))), !inProgress && (0, jsx_runtime_1.jsx)(cmdk_1.CommandEmpty, { children: emptyListNode })] })] }) }) }) }))] })) : ((0, jsx_runtime_1.jsx)(SimpleSelect, { readOnly: !!readOnly, ref: ref, value: value, options: options, onValueChange: toggleOption, id: inputId, style: style, onFocus: onFocus, onBlur: onBlur, enabled: enabled, validationStatus: validationStatus, triggerRef: setReferenceElement, autoFocus: autoFocus, placeholder: placeholder, height: dropdownHeight, children: options.size > 0
|
|
215
|
-
? Array.from(options).map((option
|
|
215
|
+
? Array.from(options).map((option) => ((0, jsx_runtime_1.jsx)(SelectOption, { value: option.value, label: option.label, enabled: option.enabled }, option.value)))
|
|
216
216
|
: emptyListNode })) }), children] }) }) }));
|
|
217
217
|
});
|
|
218
218
|
exports.ComboboxOption = (0, react_1.forwardRef)(function Combobox(option, forwardedRef) {
|
|
@@ -11,8 +11,6 @@ const classnames_1 = __importDefault(require("classnames"));
|
|
|
11
11
|
const react_sticky_el_1 = require("react-sticky-el");
|
|
12
12
|
const StickyBox_module_scss_1 = __importDefault(require("./StickyBox.module.scss"));
|
|
13
13
|
const hooks_1 = require("../../components-core/utils/hooks");
|
|
14
|
-
// --- NOTE: React.StrictMode produces error logs using this component. Deployed apps are okay.
|
|
15
|
-
// See here: https://github.com/gm0t/react-sticky-el/issues/82
|
|
16
14
|
// =====================================================================================================================
|
|
17
15
|
// React StickyBox component implementation
|
|
18
16
|
exports.defaultProps = {
|
|
@@ -47,18 +47,14 @@ exports.SwitchMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
47
47
|
[`backgroundColor-checked-${COMP}-warning`]: `$borderColor-${COMP}-warning`,
|
|
48
48
|
[`borderColor-checked-${COMP}-success`]: `$borderColor-${COMP}-success`,
|
|
49
49
|
[`backgroundColor-checked-${COMP}-success`]: `$borderColor-${COMP}-success`,
|
|
50
|
-
[`backgroundColor-${COMP}`]: "$
|
|
50
|
+
[`backgroundColor-${COMP}`]: "$backgroundColor-primary",
|
|
51
51
|
[`borderColor-${COMP}`]: "$color-surface-200",
|
|
52
52
|
[`borderWidth-${COMP}`]: "1px",
|
|
53
|
-
[`backgroundColor-indicator-${COMP}`]: "$color-surface-
|
|
54
|
-
[`backgroundColor-${COMP}-indicator--disabled`]: "$backgroundColor-primary",
|
|
53
|
+
[`backgroundColor-indicator-${COMP}`]: "$color-surface-200",
|
|
55
54
|
[`backgroundColor-indicator-checked-${COMP}`]: "$backgroundColor-primary",
|
|
56
55
|
[`borderColor-checked-${COMP}`]: "$color-primary-500",
|
|
57
56
|
[`backgroundColor-checked-${COMP}`]: "$color-primary-500",
|
|
58
57
|
[`backgroundColor-${COMP}--disabled`]: "$color-surface-200",
|
|
59
|
-
dark: {
|
|
60
|
-
[`backgroundColor-indicator-${COMP}`]: "$color-surface-500",
|
|
61
|
-
}
|
|
62
58
|
},
|
|
63
59
|
});
|
|
64
60
|
exports.switchComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.SwitchMd, ({ node, extractValue, layoutCss, updateState, state, lookupEventHandler, registerComponentApi, }) => {
|
|
@@ -106,7 +106,6 @@ exports.Table = (0, react_1.forwardRef)(({ data = exports.defaultProps.data, col
|
|
|
106
106
|
visibleItems,
|
|
107
107
|
rowsSelectable,
|
|
108
108
|
enableMultiRowSelection,
|
|
109
|
-
rowDisabledPredicate,
|
|
110
109
|
onSelectionDidChange,
|
|
111
110
|
});
|
|
112
111
|
// --- Create data with order information whenever the items in the table change
|
|
@@ -222,11 +221,8 @@ exports.Table = (0, react_1.forwardRef)(({ data = exports.defaultProps.data, col
|
|
|
222
221
|
}),
|
|
223
222
|
value: table.getIsAllRowsSelected(),
|
|
224
223
|
indeterminate: table.getIsSomeRowsSelected(),
|
|
225
|
-
onDidChange: () => {
|
|
226
|
-
|
|
227
|
-
.getRowModel()
|
|
228
|
-
.rows.every((row) => rowDisabledPredicate(row.original) || row.getIsSelected());
|
|
229
|
-
checkAllRows(!allSelected);
|
|
224
|
+
onDidChange: (checked) => {
|
|
225
|
+
checkAllRows(checked);
|
|
230
226
|
} })) : null,
|
|
231
227
|
cell: ({ row }) => ((0, jsx_runtime_1.jsx)(Toggle_1.Toggle, { className: Table_module_scss_1.default.checkBoxWrapper,
|
|
232
228
|
value: row.getIsSelected(),
|
|
@@ -7,7 +7,7 @@ const misc_1 = require("../../components-core/utils/misc");
|
|
|
7
7
|
const constants_1 = require("../../components-core/constants");
|
|
8
8
|
const hooks_1 = require("../../components-core/utils/hooks");
|
|
9
9
|
const SelectionStoreNative_1 = require("../SelectionStore/SelectionStoreNative");
|
|
10
|
-
function useRowSelection({ items = constants_1.EMPTY_ARRAY, visibleItems = items, rowsSelectable, enableMultiRowSelection,
|
|
10
|
+
function useRowSelection({ items = constants_1.EMPTY_ARRAY, visibleItems = items, rowsSelectable, enableMultiRowSelection, onSelectionDidChange, }) {
|
|
11
11
|
// --- The focused index in the row source (if there is any)
|
|
12
12
|
const [focusedIndex, setFocusedIndex] = (0, react_1.useState)(-1);
|
|
13
13
|
// --- The current selection interval
|
|
@@ -187,11 +187,7 @@ function useRowSelection({ items = constants_1.EMPTY_ARRAY, visibleItems = items
|
|
|
187
187
|
if (!enableMultiRowSelection && checked) {
|
|
188
188
|
return;
|
|
189
189
|
}
|
|
190
|
-
setSelectedRowIds(checked
|
|
191
|
-
? items
|
|
192
|
-
.filter((item) => (rowDisabledPredicate ? !rowDisabledPredicate(item) : true))
|
|
193
|
-
.map((item) => item[idKey])
|
|
194
|
-
: []);
|
|
190
|
+
setSelectedRowIds(checked ? items.map((item) => item[idKey]) : []);
|
|
195
191
|
});
|
|
196
192
|
/**
|
|
197
193
|
* This operation creates a hash object that indicates the selected status of selected row IDs
|
|
@@ -10,6 +10,7 @@ const ComponentDefs_1 = require("../../abstractions/ComponentDefs");
|
|
|
10
10
|
const themeVars_1 = require("../../components-core/theming/themeVars");
|
|
11
11
|
const renderers_1 = require("../../components-core/renderers");
|
|
12
12
|
const container_helpers_1 = require("../container-helpers");
|
|
13
|
+
const metadata_helpers_1 = require("../metadata-helpers");
|
|
13
14
|
const TabsNative_1 = require("./TabsNative");
|
|
14
15
|
const COMP = "Tabs";
|
|
15
16
|
exports.TabsMd = (0, ComponentDefs_1.createMetadata)({
|
|
@@ -29,11 +30,7 @@ exports.TabsMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
29
30
|
defaultValue: TabsNative_1.defaultProps.orientation,
|
|
30
31
|
valueType: "string",
|
|
31
32
|
},
|
|
32
|
-
tabTemplate:
|
|
33
|
-
description: `This property declares the template for the clickable tab area.`,
|
|
34
|
-
valueType: "ComponentDef",
|
|
35
|
-
isInternal: true,
|
|
36
|
-
},
|
|
33
|
+
tabTemplate: (0, metadata_helpers_1.dComponent)(`This property declares the template for the clickable tab area.`),
|
|
37
34
|
},
|
|
38
35
|
apis: {
|
|
39
36
|
next: (0, ComponentDefs_1.d)(`This method selects the next tab.`),
|
|
@@ -83,9 +83,9 @@ exports.TextMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
83
83
|
[`fontFamily-${COMP}-sample`]: "$fontFamily-monospace",
|
|
84
84
|
[`fontSize-${COMP}-sample`]: "$fontSize-small",
|
|
85
85
|
[`fontSize-${COMP}-sup`]: "$fontSize-smaller",
|
|
86
|
-
[`
|
|
86
|
+
[`verticalAlign-${COMP}-sup`]: "super",
|
|
87
87
|
[`fontSize-${COMP}-sub`]: "$fontSize-smaller",
|
|
88
|
-
[`
|
|
88
|
+
[`verticalAlign-${COMP}-sub`]: "sub",
|
|
89
89
|
[`fontStyle-${COMP}-var`]: "italic",
|
|
90
90
|
[`fontStyle-${COMP}-em`]: "italic",
|
|
91
91
|
[`fontFamily-${COMP}-mono`]: "$fontFamily-monospace",
|
|
@@ -64,7 +64,7 @@ exports.TextBoxMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
64
64
|
"borderColor-Input-error": "$borderColor-Input-default--error",
|
|
65
65
|
"borderColor-Input-warning": "$borderColor-Input-default--warning",
|
|
66
66
|
"borderColor-Input-success": "$borderColor-Input-default--success",
|
|
67
|
-
"
|
|
67
|
+
"color-placeholder-Input": "$textColor-subtitle",
|
|
68
68
|
"color-adornment-Input": "$textColor-subtitle",
|
|
69
69
|
"outlineColor-Input--focus": "$outlineColor--focus",
|
|
70
70
|
"outlineWidth-Input--focus": "$outlineWidth--focus",
|
|
@@ -35,7 +35,6 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.NotificationToast = void 0;
|
|
37
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
-
const react_1 = require("react");
|
|
39
38
|
const react_hot_toast_1 = __importStar(require("react-hot-toast"));
|
|
40
39
|
const TOASTER_CONTAINER_STYLE = {
|
|
41
40
|
top: 40,
|
|
@@ -45,17 +44,7 @@ const TOASTER_CONTAINER_STYLE = {
|
|
|
45
44
|
position: "absolute",
|
|
46
45
|
overflowY: "hidden",
|
|
47
46
|
};
|
|
48
|
-
let toasterMounted = false;
|
|
49
47
|
const NotificationToast = ({ toastDuration }) => {
|
|
50
|
-
const [shouldRender, setShouldRender] = (0, react_1.useState)(false);
|
|
51
|
-
(0, react_1.useEffect)(() => {
|
|
52
|
-
if (!toasterMounted) {
|
|
53
|
-
toasterMounted = true;
|
|
54
|
-
setShouldRender(true);
|
|
55
|
-
}
|
|
56
|
-
}, []);
|
|
57
|
-
if (!shouldRender)
|
|
58
|
-
return null;
|
|
59
48
|
return ((0, jsx_runtime_1.jsx)(react_hot_toast_1.Toaster, { position: "top-right", containerStyle: TOASTER_CONTAINER_STYLE, toastOptions: { style: { padding: "12px 16px" }, duration: toastDuration }, children: (t) => ((0, jsx_runtime_1.jsx)("div", { onClick: () => react_hot_toast_1.default.dismiss(t.id), children: (0, jsx_runtime_1.jsx)(react_hot_toast_1.ToastBar, { position: t.position, toast: t, style: { wordBreak: "break-word" }, children: ({ icon, message }) => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [icon, message] })) }) })) }));
|
|
60
49
|
};
|
|
61
50
|
exports.NotificationToast = NotificationToast;
|
|
@@ -46,7 +46,7 @@ function Theme({ id, isRoot = exports.defaultProps.isRoot, renderChild, node, to
|
|
|
46
46
|
var _a, _b, _c;
|
|
47
47
|
const themeToExtend = id ? themes.find((theme) => theme.id === id) : activeTheme;
|
|
48
48
|
if (!themeToExtend) {
|
|
49
|
-
throw new Error(
|
|
49
|
+
throw new Error("Theme not found");
|
|
50
50
|
}
|
|
51
51
|
const foundTheme = Object.assign(Object.assign({}, themeToExtend), { id: generatedId, tones: Object.assign(Object.assign({}, themeToExtend.tones), { [themeTone]: Object.assign(Object.assign({}, (_a = themeToExtend.tones) === null || _a === void 0 ? void 0 : _a[themeTone]), { themeVars: Object.assign(Object.assign({}, (_c = (_b = themeToExtend.tones) === null || _b === void 0 ? void 0 : _b[themeTone]) === null || _c === void 0 ? void 0 : _c.themeVars), themeVars) }) }) });
|
|
52
52
|
return foundTheme;
|
|
@@ -75,15 +75,15 @@ function Theme({ id, isRoot = exports.defaultProps.isRoot, renderChild, node, to
|
|
|
75
75
|
@media (min-width: calc(${maxWidthLandscapePhone} + 1px)) {
|
|
76
76
|
--screenSize: 2;
|
|
77
77
|
}
|
|
78
|
-
|
|
78
|
+
|
|
79
79
|
@media (min-width: calc(${maxWidthTablet} + 1px)) {
|
|
80
80
|
--screenSize: 3;
|
|
81
81
|
}
|
|
82
|
-
|
|
82
|
+
|
|
83
83
|
@media (min-width: calc(${maxWidthDesktop} + 1px)) {
|
|
84
84
|
--screenSize: 4;
|
|
85
85
|
}
|
|
86
|
-
|
|
86
|
+
|
|
87
87
|
@media (min-width: calc(${maxWidthLargeDesktop} + 1px)) {
|
|
88
88
|
--screenSize: 5;
|
|
89
89
|
}
|
|
@@ -40,8 +40,6 @@ exports.TreeDisplayMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
40
40
|
[`fontFamily-${COMP}`]: "$fontFamily-monospace",
|
|
41
41
|
[`color-${COMP}`]: "$textColor-primary",
|
|
42
42
|
[`color-connect-${COMP}`]: "$color-surface-200",
|
|
43
|
-
[`boxShadow-${COMP}`]: "none",
|
|
44
|
-
[`border-${COMP}`]: "0.5px solid $borderColor",
|
|
45
43
|
},
|
|
46
44
|
});
|
|
47
45
|
exports.treeDisplayComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.TreeDisplayMd, ({ node, extractValue, renderChild, layoutCss }) => {
|
|
@@ -7,12 +7,9 @@ const ComponentDefs_1 = require("../abstractions/ComponentDefs");
|
|
|
7
7
|
const renderers_1 = require("./renderers");
|
|
8
8
|
const COMP = "Fragment";
|
|
9
9
|
exports.FragmentMd = (0, ComponentDefs_1.createMetadata)({
|
|
10
|
-
description: "`Fragment` provides conditional rendering
|
|
11
|
-
"
|
|
10
|
+
description: "`Fragment` provides conditional rendering and grouping of components. It's often " +
|
|
11
|
+
"used to hide components until their dependent variables are available.",
|
|
12
12
|
opaque: true,
|
|
13
|
-
props: {
|
|
14
|
-
// Note: 'when' is a universal property defined in ComponentDefCore, no need to redefine it here
|
|
15
|
-
},
|
|
16
13
|
});
|
|
17
14
|
exports.fragmentComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.FragmentMd, ({ node, extractValue, renderChild, layoutContext }) => {
|
|
18
15
|
return ((0, jsx_runtime_1.jsx)(react_1.Fragment, { children: renderChild(node.children, layoutContext) }, extractValue(node.uid)));
|
|
@@ -51,8 +51,8 @@ const process_statement_sync_1 = require("./script-runner/process-statement-sync
|
|
|
51
51
|
function isAxiosResponse(response) {
|
|
52
52
|
return "data" in response;
|
|
53
53
|
}
|
|
54
|
-
function parseResponseJson(
|
|
55
|
-
return __awaiter(this,
|
|
54
|
+
function parseResponseJson(response) {
|
|
55
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
56
56
|
let resp;
|
|
57
57
|
if (isAxiosResponse(response)) {
|
|
58
58
|
resp = response.data;
|
|
@@ -66,9 +66,7 @@ function parseResponseJson(response_1) {
|
|
|
66
66
|
resp = yield response.clone().text();
|
|
67
67
|
}
|
|
68
68
|
catch (e) {
|
|
69
|
-
|
|
70
|
-
console.error("Failed to parse response as text or JSON", response.body);
|
|
71
|
-
}
|
|
69
|
+
console.error("Failed to parse response as text or JSON", response.body);
|
|
72
70
|
}
|
|
73
71
|
}
|
|
74
72
|
}
|
|
@@ -232,7 +230,6 @@ class RestApiProxy {
|
|
|
232
230
|
return value;
|
|
233
231
|
};
|
|
234
232
|
this.executeOperation = (_a) => __awaiter(this, [_a], void 0, function* ({ operation, contextParams, abortSignal, resolveBindingExpressions, relativePath = this.extractParam(resolveBindingExpressions, operation.url, contextParams), method = this.extractParam(resolveBindingExpressions, operation.method, contextParams), queryParams = this.extractParam(resolveBindingExpressions, operation.queryParams, contextParams), body = this.extractParam(resolveBindingExpressions, operation.body, contextParams, true), rawBody = this.extractParam(resolveBindingExpressions, operation.rawBody, contextParams), headers = this.extractParam(resolveBindingExpressions, operation.headers, contextParams), payloadType = this.extractParam(resolveBindingExpressions, operation.payloadType, contextParams) || "json", onUploadProgress, parseResponse = this.tryParseResponse, transactionId, }) {
|
|
235
|
-
var _b, _c, _d, _e, _f, _g;
|
|
236
233
|
const includeClientTxId = method && method !== "get" && !!transactionId;
|
|
237
234
|
const headersWithoutContentType = Object.assign(Object.assign({}, this.getHeaders()), { ["Content-Type"]: undefined });
|
|
238
235
|
const aggregatedHeaders = (0, lodash_es_1.omitBy)(Object.assign(Object.assign({}, (body ? this.getHeaders() : headersWithoutContentType)), headers), lodash_es_1.isUndefined);
|
|
@@ -281,7 +278,7 @@ class RestApiProxy {
|
|
|
281
278
|
data: options.body,
|
|
282
279
|
onUploadProgress,
|
|
283
280
|
});
|
|
284
|
-
return yield parseResponse(response
|
|
281
|
+
return yield parseResponse(response);
|
|
285
282
|
}
|
|
286
283
|
catch (error) {
|
|
287
284
|
if (axios.isAxiosError(error) && error.response) {
|
|
@@ -297,12 +294,12 @@ class RestApiProxy {
|
|
|
297
294
|
if (!response.clone().ok) {
|
|
298
295
|
throw yield this.raiseError(response);
|
|
299
296
|
}
|
|
300
|
-
const parsedResponse = yield parseResponse(response.clone()
|
|
297
|
+
const parsedResponse = yield parseResponse(response.clone());
|
|
301
298
|
return parsedResponse;
|
|
302
299
|
}
|
|
303
300
|
});
|
|
304
|
-
this.tryParseResponse = (
|
|
305
|
-
return yield parseResponseJson(response
|
|
301
|
+
this.tryParseResponse = (response) => __awaiter(this, void 0, void 0, function* () {
|
|
302
|
+
return yield parseResponseJson(response);
|
|
306
303
|
});
|
|
307
304
|
this.raiseError = (response) => __awaiter(this, void 0, void 0, function* () {
|
|
308
305
|
if ("config" in response) {
|
|
@@ -48,7 +48,7 @@ const react_1 = require("react");
|
|
|
48
48
|
const misc_1 = require("../utils/misc");
|
|
49
49
|
const useApiInterceptorContext_1 = require("./useApiInterceptorContext");
|
|
50
50
|
// This React component injects the API interceptor into the application's context
|
|
51
|
-
function ApiInterceptorProvider({ interceptor, children, apiWorker, useHashBasedRouting,
|
|
51
|
+
function ApiInterceptorProvider({ interceptor, children, apiWorker, useHashBasedRouting, }) {
|
|
52
52
|
const [initialized, setInitialized] = (0, react_1.useState)(!interceptor);
|
|
53
53
|
const [interceptorWorker, setInterceptorWorker] = (0, react_1.useState)(null);
|
|
54
54
|
// --- Whenever the interceptor changes, update the provider accordingly
|
|
@@ -94,5 +94,5 @@ function ApiInterceptorProvider({ interceptor, children, apiWorker, useHashBased
|
|
|
94
94
|
isMocked: (url) => interceptor !== undefined && !!process.env.VITE_MOCK_ENABLED,
|
|
95
95
|
};
|
|
96
96
|
}, [interceptorWorker, initialized, interceptor]);
|
|
97
|
-
return ((0, jsx_runtime_1.jsx)(useApiInterceptorContext_1.ApiInterceptorContext.Provider, { value: contextValue, children:
|
|
97
|
+
return ((0, jsx_runtime_1.jsx)(useApiInterceptorContext_1.ApiInterceptorContext.Provider, { value: contextValue, children: children }));
|
|
98
98
|
}
|
|
@@ -130,8 +130,8 @@ function AppContent({ rootContainer, routerBaseName, globalProps, standalone, tr
|
|
|
130
130
|
const isViewportTablet = (0, hooks_1.useMediaQuery)(`(min-width: ${maxWidthLandscapePhone}) and (max-width: ${maxWidthTabletLower})`);
|
|
131
131
|
const isViewportDesktop = (0, hooks_1.useMediaQuery)(`(min-width: ${maxWidthTablet}) and (max-width: ${maxWidthDesktopLower})`);
|
|
132
132
|
const isViewportLargeDesktop = (0, hooks_1.useMediaQuery)(`(min-width: ${maxWidthDesktop}) and (max-width: ${maxWidthLargeDesktopLower})`);
|
|
133
|
-
let vpSize;
|
|
134
|
-
let vpSizeIndex;
|
|
133
|
+
let vpSize = "xs";
|
|
134
|
+
let vpSizeIndex = 0;
|
|
135
135
|
const isViewportXlDesktop = (0, hooks_1.useMediaQuery)(`(min-width: ${maxWidthLargeDesktop})`);
|
|
136
136
|
if (isViewportXlDesktop) {
|
|
137
137
|
vpSize = "xxl";
|
|
@@ -153,10 +153,6 @@ function AppContent({ rootContainer, routerBaseName, globalProps, standalone, tr
|
|
|
153
153
|
vpSize = "sm";
|
|
154
154
|
vpSizeIndex = 1;
|
|
155
155
|
}
|
|
156
|
-
else if (isViewportPhone) {
|
|
157
|
-
vpSize = "xs";
|
|
158
|
-
vpSizeIndex = 0;
|
|
159
|
-
}
|
|
160
156
|
// --- Collect information about the current environment
|
|
161
157
|
const isInIFrame = (0, hooks_1.useIsInIFrame)();
|
|
162
158
|
const isWindowFocused = (0, hooks_1.useIsWindowFocused)();
|
|
@@ -27,7 +27,7 @@ exports.queryClient = new react_query_1.QueryClient({
|
|
|
27
27
|
* from either code-behind files or inlined markup expressions) and executes
|
|
28
28
|
* the app accordingly.
|
|
29
29
|
*/
|
|
30
|
-
function AppRoot({ apiInterceptor, contributes, node, decorateComponentsWithTestId, debugEnabled, defaultTheme, defaultTone, resources, globalProps, standalone, trackContainerHeight, routerBaseName, previewMode, resourceMap, sources, extensionManager, children, projectCompilation,
|
|
30
|
+
function AppRoot({ apiInterceptor, contributes, node, decorateComponentsWithTestId, debugEnabled, defaultTheme, defaultTone, resources, globalProps, standalone, trackContainerHeight, routerBaseName, previewMode, resourceMap, sources, extensionManager, children, projectCompilation, }) {
|
|
31
31
|
// --- Make sure, the root node is wrapped in a `Theme` component. Also,
|
|
32
32
|
// --- the root node must be wrapped in a `Container` component managing
|
|
33
33
|
// --- the app's top-level state.
|
|
@@ -54,11 +54,9 @@ function AppRoot({ apiInterceptor, contributes, node, decorateComponentsWithTest
|
|
|
54
54
|
}
|
|
55
55
|
// --- Start with an error-free state
|
|
56
56
|
(0, reportEngineError_1.resetErrors)();
|
|
57
|
-
// --- Add isNested to global props so it can be accessed throughout the app
|
|
58
|
-
const enhancedGlobalProps = (0, react_1.useMemo)(() => (Object.assign(Object.assign({}, globalProps), { isNested })), [globalProps, isNested]);
|
|
59
57
|
// --- Render the app providing a component registry (in which the engine finds a
|
|
60
58
|
// --- component definition by its name). Ensure the app has a context for debugging.
|
|
61
|
-
return ((0, jsx_runtime_1.jsx)(ComponentProvider_1.ComponentProvider, { contributes: contributes, extensionManager: extensionManager, children: (0, jsx_runtime_1.jsx)(DebugViewProvider_1.DebugViewProvider, { debugConfig: globalProps === null || globalProps === void 0 ? void 0 : globalProps.debug, children: (0, jsx_runtime_1.jsx)(AppWrapper_1.AppWrapper, { projectCompilation: projectCompilation, resourceMap: resourceMap, apiInterceptor: apiInterceptor, node: rootNode, contributes: contributes, resources: resources, routerBaseName: routerBaseName, decorateComponentsWithTestId: decorateComponentsWithTestId, debugEnabled: debugEnabled, defaultTheme: defaultTheme, defaultTone: defaultTone, globalProps:
|
|
59
|
+
return ((0, jsx_runtime_1.jsx)(ComponentProvider_1.ComponentProvider, { contributes: contributes, extensionManager: extensionManager, children: (0, jsx_runtime_1.jsx)(DebugViewProvider_1.DebugViewProvider, { debugConfig: globalProps === null || globalProps === void 0 ? void 0 : globalProps.debug, children: (0, jsx_runtime_1.jsx)(AppWrapper_1.AppWrapper, { projectCompilation: projectCompilation, resourceMap: resourceMap, apiInterceptor: apiInterceptor, node: rootNode, contributes: contributes, resources: resources, routerBaseName: routerBaseName, decorateComponentsWithTestId: decorateComponentsWithTestId, debugEnabled: debugEnabled, defaultTheme: defaultTheme, defaultTone: defaultTone, globalProps: globalProps, standalone: standalone, trackContainerHeight: trackContainerHeight, previewMode: previewMode, sources: sources, children: children }) }) }));
|
|
62
60
|
}
|
|
63
61
|
/**
|
|
64
62
|
*
|
|
@@ -37,7 +37,6 @@ const ParameterParser_1 = require("../script-runner/ParameterParser");
|
|
|
37
37
|
const eval_tree_sync_1 = require("../script-runner/eval-tree-sync");
|
|
38
38
|
const extractParam_1 = require("../utils/extractParam");
|
|
39
39
|
const misc_1 = require("../utils/misc");
|
|
40
|
-
const AppLayoutContext_1 = require("../../components/App/AppLayoutContext");
|
|
41
40
|
// A React component that wraps a view container into an error boundary
|
|
42
41
|
// (it's a named function inside the memo, this way it will be visible with that name in the react devtools)
|
|
43
42
|
exports.StateContainer = (0, react_1.memo)((0, react_1.forwardRef)(function StateContainer(_a, ref) {
|
|
@@ -146,8 +145,6 @@ exports.StateContainer = (0, react_1.memo)((0, react_1.forwardRef)(function Stat
|
|
|
146
145
|
const useRoutingParams = () => {
|
|
147
146
|
const [queryParams] = (0, react_2.useSearchParams)();
|
|
148
147
|
const routeParams = (0, react_2.useParams)();
|
|
149
|
-
const location = (0, react_2.useLocation)();
|
|
150
|
-
const appLayoutContext = (0, AppLayoutContext_1.useAppLayoutContext)();
|
|
151
148
|
const queryParamsMap = (0, react_1.useMemo)(() => {
|
|
152
149
|
const result = {};
|
|
153
150
|
for (const [key, value] of Array.from(queryParams.entries())) {
|
|
@@ -156,12 +153,9 @@ const useRoutingParams = () => {
|
|
|
156
153
|
return result;
|
|
157
154
|
}, [queryParams]);
|
|
158
155
|
return (0, react_1.useMemo)(() => {
|
|
159
|
-
var _a;
|
|
160
156
|
return {
|
|
161
|
-
$pathname: location.pathname,
|
|
162
157
|
$routeParams: routeParams,
|
|
163
158
|
$queryParams: queryParamsMap,
|
|
164
|
-
$linkInfo: ((_a = appLayoutContext === null || appLayoutContext === void 0 ? void 0 : appLayoutContext.linkMap) === null || _a === void 0 ? void 0 : _a.get(location.pathname)) || {},
|
|
165
159
|
};
|
|
166
160
|
}, [queryParamsMap, routeParams]);
|
|
167
161
|
};
|
|
@@ -111,15 +111,11 @@ function resolveLayoutProps(layoutProps = constants_1.EMPTY_OBJECT, layoutContex
|
|
|
111
111
|
collectCss("fontSize");
|
|
112
112
|
collectCss("fontWeight");
|
|
113
113
|
collectCss("fontStyle");
|
|
114
|
-
collectCss("fontVariant");
|
|
115
|
-
collectCss("lineBreak");
|
|
116
114
|
collectCss("textDecoration");
|
|
117
115
|
collectCss("textDecorationLine");
|
|
118
116
|
collectCss("textDecorationColor");
|
|
119
117
|
collectCss("textDecorationStyle");
|
|
120
118
|
collectCss("textDecorationThickness");
|
|
121
|
-
collectCss("textIndent");
|
|
122
|
-
collectCss("textShadow");
|
|
123
119
|
collectCss("textUnderlineOffset");
|
|
124
120
|
collectCss("userSelect");
|
|
125
121
|
collectCss("letterSpacing");
|
|
@@ -128,10 +124,6 @@ function resolveLayoutProps(layoutProps = constants_1.EMPTY_OBJECT, layoutContex
|
|
|
128
124
|
collectCss("textAlign");
|
|
129
125
|
collectCss("textAlignLast");
|
|
130
126
|
collectCss("textWrap");
|
|
131
|
-
collectCss("wordBreak");
|
|
132
|
-
collectCss("wordSpacing");
|
|
133
|
-
collectCss("wordWrap");
|
|
134
|
-
collectCss("writingMode");
|
|
135
127
|
// --- Other
|
|
136
128
|
collectCss("backgroundColor");
|
|
137
129
|
collectCss("background");
|
|
@@ -347,8 +339,6 @@ const layoutPatterns = {
|
|
|
347
339
|
fontSize: [],
|
|
348
340
|
fontWeight: [],
|
|
349
341
|
fontStyle: [booleanRegex],
|
|
350
|
-
fontVariant: [],
|
|
351
|
-
lineBreak: [],
|
|
352
342
|
textDecoration: [],
|
|
353
343
|
userSelect: [],
|
|
354
344
|
letterSpacing: [],
|
|
@@ -357,12 +347,6 @@ const layoutPatterns = {
|
|
|
357
347
|
textAlign: [],
|
|
358
348
|
textWrap: [],
|
|
359
349
|
textAlignLast: [],
|
|
360
|
-
textIndent: [],
|
|
361
|
-
textShadow: [],
|
|
362
|
-
wordBreak: [],
|
|
363
|
-
wordSpacing: [],
|
|
364
|
-
wordWrap: [],
|
|
365
|
-
writingMode: [],
|
|
366
350
|
// --- Content rendering
|
|
367
351
|
wrapContent: [],
|
|
368
352
|
canShrink: [],
|
|
@@ -381,6 +365,4 @@ const layoutPatterns = {
|
|
|
381
365
|
outlineColor: [],
|
|
382
366
|
outlineStyle: [],
|
|
383
367
|
outlineOffset: [],
|
|
384
|
-
// --- Animation
|
|
385
|
-
transition: [],
|
|
386
368
|
};
|
|
@@ -208,9 +208,6 @@ exports.RootThemeDefinition = {
|
|
|
208
208
|
"textColor-secondary": $colorSurface600,
|
|
209
209
|
// --- Input is an abstract component, so we define its default theme variables here
|
|
210
210
|
"backgroundColor-Input-default": $colorSurface0,
|
|
211
|
-
"backgroundColor-Input-success": $colorSurface0,
|
|
212
|
-
"backgroundColor-Input-warning": $colorSurface0,
|
|
213
|
-
"backgroundColor-Input-error": $colorSurface0,
|
|
214
211
|
"borderColor-Input-default": $colorSurface200,
|
|
215
212
|
"borderColor-Input-default--hover": $colorSurface600,
|
|
216
213
|
"borderColor-Input-default--focus": $colorSurface600,
|