xmlui 0.9.90 → 0.9.93
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/{index-Bs4hp2dn.mjs → index-C4FeLQEv.mjs} +7988 -7791
- package/dist/lib/index.css +1 -1
- package/dist/lib/{initMock-DwAYhsKb.mjs → initMock-DwQKZ8T4.mjs} +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-DJhOKFL6.mjs → metadata-utils-PjrGUxZN.mjs} +47 -49
- package/dist/lib/{server-common-CIqrGYx-.mjs → server-common-BbjTO8TH.mjs} +4446 -4476
- package/dist/lib/{transform-bUuxPyao.mjs → transform-CDSgqN5L.mjs} +1240 -1202
- package/dist/lib/xmlui-parser.d.ts +3 -1
- package/dist/lib/xmlui-parser.mjs +2 -2
- package/dist/lib/{xmlui-serializer-BLFl30t9.mjs → xmlui-serializer-D6rtRMNI.mjs} +1 -1
- package/dist/lib/xmlui.d.ts +17 -12
- package/dist/lib/xmlui.mjs +2 -2
- package/dist/metadata/{collectedComponentMetadata-fh2ak2QN.mjs → collectedComponentMetadata-CTFECKPI.mjs} +8885 -8651
- package/dist/metadata/{initMock-8hLEm7iV.mjs → initMock-DUtrSCpH.mjs} +1 -1
- package/dist/metadata/style.css +1 -1
- package/dist/metadata/xmlui-metadata.mjs +1 -1
- package/dist/metadata/xmlui-metadata.umd.js +102 -98
- package/dist/scripts/package.json +2 -1
- package/dist/scripts/src/components/AutoComplete/AutoComplete.js +5 -2
- package/dist/scripts/src/components/AutoComplete/AutoCompleteContext.js +1 -2
- package/dist/scripts/src/components/AutoComplete/AutoCompleteNative.js +9 -12
- package/dist/scripts/src/components/Bookmark/Bookmark.js +1 -1
- package/dist/scripts/src/components/ComponentProvider.js +2 -2
- package/dist/scripts/src/{components-core → components/Fragment}/Fragment.js +2 -2
- package/dist/scripts/src/components/Option/Option.js +11 -11
- package/dist/scripts/src/components/Select/HiddenOption.js +2 -2
- package/dist/scripts/src/components/Select/Select.js +5 -9
- package/dist/scripts/src/components/Select/SelectNative.js +95 -45
- package/dist/scripts/src/{components-core → components/Slot}/Slot.js +2 -2
- package/dist/scripts/src/components/SlotItem.js +1 -0
- package/dist/scripts/src/components/Spinner/SpinnerNative.js +3 -4
- package/dist/scripts/src/components/Tabs/TabItem.js +12 -1
- package/dist/scripts/src/components/Tabs/TabItemNative.js +4 -3
- package/dist/scripts/src/components/Tabs/Tabs.js +1 -1
- package/dist/scripts/src/components/Tabs/TabsNative.js +22 -43
- package/dist/scripts/src/components/TextArea/TextArea.js +1 -2
- package/dist/scripts/src/components/Toggle/Toggle.js +34 -10
- package/dist/scripts/src/components/abstractions.js +25 -6
- package/dist/scripts/src/components/container-helpers.js +2 -1
- package/dist/scripts/src/components-core/rendering/ComponentAdapter.js +4 -5
- package/dist/scripts/src/components-core/rendering/ComponentWrapper.js +2 -1
- package/dist/scripts/src/components-core/xmlui-parser.js +365 -196
- package/dist/scripts/src/parsers/xmlui-parser/diagnostics.js +1 -1
- package/dist/scripts/src/parsers/xmlui-parser/parser.js +69 -1
- package/dist/standalone/xmlui-standalone.es.d.ts +18 -12
- package/dist/standalone/xmlui-standalone.umd.js +252 -248
- package/package.json +2 -1
- package/dist/scripts/src/abstractions/scripting/modules.js +0 -2
|
@@ -1,37 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
4
|
};
|
|
@@ -39,19 +6,29 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
39
6
|
exports.Tabs = exports.defaultProps = void 0;
|
|
40
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
41
8
|
const react_1 = require("react");
|
|
42
|
-
const
|
|
9
|
+
const react_tabs_1 = require("@radix-ui/react-tabs");
|
|
43
10
|
const Tabs_module_scss_1 = __importDefault(require("./Tabs.module.scss"));
|
|
44
11
|
const misc_1 = require("../../components-core/utils/misc");
|
|
45
|
-
const TabContext_1 = require("
|
|
12
|
+
const TabContext_1 = require("./TabContext");
|
|
46
13
|
const classnames_1 = __importDefault(require("classnames"));
|
|
47
14
|
exports.defaultProps = {
|
|
48
15
|
activeTab: 0,
|
|
49
16
|
orientation: "horizontal",
|
|
50
17
|
distributeEvenly: false,
|
|
51
18
|
};
|
|
52
|
-
exports.Tabs = (0, react_1.forwardRef)(function Tabs({ activeTab = exports.defaultProps.activeTab, orientation = exports.defaultProps.orientation, tabRenderer, style, children, registerComponentApi, className, distributeEvenly = exports.defaultProps.distributeEvenly, }, forwardedRef) {
|
|
19
|
+
exports.Tabs = (0, react_1.forwardRef)(function Tabs({ activeTab = exports.defaultProps.activeTab, orientation = exports.defaultProps.orientation, tabRenderer, style, children, id, registerComponentApi, className, distributeEvenly = exports.defaultProps.distributeEvenly, }, forwardedRef) {
|
|
53
20
|
const { tabItems, tabContextValue } = (0, TabContext_1.useTabContextValue)();
|
|
54
|
-
|
|
21
|
+
// Ensure activeTab is within valid bounds
|
|
22
|
+
const validActiveTab = (0, react_1.useMemo)(() => {
|
|
23
|
+
if (tabItems.length === 0)
|
|
24
|
+
return 0;
|
|
25
|
+
if (activeTab < 0)
|
|
26
|
+
return 0;
|
|
27
|
+
if (activeTab >= tabItems.length)
|
|
28
|
+
return 0; // Default to first tab if out of bounds
|
|
29
|
+
return activeTab;
|
|
30
|
+
}, [activeTab, tabItems.length]);
|
|
31
|
+
const [activeIndex, setActiveIndex] = (0, react_1.useState)(validActiveTab);
|
|
55
32
|
const currentTab = (0, react_1.useMemo)(() => {
|
|
56
33
|
var _a;
|
|
57
34
|
return (_a = tabItems[activeIndex]) === null || _a === void 0 ? void 0 : _a.id;
|
|
@@ -63,8 +40,8 @@ exports.Tabs = (0, react_1.forwardRef)(function Tabs({ activeTab = exports.defau
|
|
|
63
40
|
if (activeTab !== undefined) {
|
|
64
41
|
setActiveIndex(() => {
|
|
65
42
|
const maxIndex = tabItems.length - 1;
|
|
66
|
-
const newIndex = activeTab -
|
|
67
|
-
return newIndex < 0 ? 0 : newIndex > maxIndex ?
|
|
43
|
+
const newIndex = activeTab; // activeTab should be 0-based index
|
|
44
|
+
return newIndex < 0 ? 0 : newIndex > maxIndex ? 0 : newIndex; // Default to first tab (0) when out of bounds
|
|
68
45
|
});
|
|
69
46
|
}
|
|
70
47
|
}, [activeTab, tabItems.length]);
|
|
@@ -79,13 +56,15 @@ exports.Tabs = (0, react_1.forwardRef)(function Tabs({ activeTab = exports.defau
|
|
|
79
56
|
next,
|
|
80
57
|
});
|
|
81
58
|
}, [next, registerComponentApi]);
|
|
82
|
-
return ((0, jsx_runtime_1.jsx)(TabContext_1.TabContext.Provider, { value: tabContextValue, children: (0, jsx_runtime_1.jsxs)(
|
|
59
|
+
return ((0, jsx_runtime_1.jsx)(TabContext_1.TabContext.Provider, { value: tabContextValue, children: (0, jsx_runtime_1.jsxs)(react_tabs_1.Root, { id: id, ref: forwardedRef, className: (0, classnames_1.default)(Tabs_module_scss_1.default.tabs, className), value: `${currentTab}`, onValueChange: (tab) => {
|
|
83
60
|
const newIndex = tabItems.findIndex((item) => item.id === tab);
|
|
84
61
|
if (newIndex !== activeIndex) {
|
|
85
62
|
tabContextValue.setActiveTabId(tab);
|
|
86
63
|
setActiveIndex(newIndex);
|
|
87
64
|
}
|
|
88
|
-
}, orientation: orientation, style: style, children: [(0, jsx_runtime_1.jsxs)(
|
|
89
|
-
[Tabs_module_scss_1.default.distributeEvenly]: distributeEvenly
|
|
90
|
-
}), value: tab.id, children: tab.
|
|
65
|
+
}, orientation: orientation, style: style, children: [(0, jsx_runtime_1.jsxs)(react_tabs_1.List, { className: Tabs_module_scss_1.default.tabsList, children: [tabItems.map((tab) => tab.labelRenderer ? ((0, jsx_runtime_1.jsx)(react_tabs_1.Trigger, { role: "tab", className: (0, classnames_1.default)(Tabs_module_scss_1.default.tabTrigger, {
|
|
66
|
+
[Tabs_module_scss_1.default.distributeEvenly]: distributeEvenly,
|
|
67
|
+
}), value: tab.id, children: tab.labelRenderer(Object.assign(Object.assign({}, tab), { isActive: tab.id === currentTab })) }, tab.id)) : tabRenderer ? ((0, jsx_runtime_1.jsx)(react_tabs_1.Trigger, { value: tab.id, asChild: true, role: "tab", children: tabRenderer(Object.assign(Object.assign({}, tab), { isActive: tab.id === currentTab })) }, tab.id)) : ((0, jsx_runtime_1.jsx)(react_tabs_1.Trigger, { role: "tab", className: (0, classnames_1.default)(Tabs_module_scss_1.default.tabTrigger, {
|
|
68
|
+
[Tabs_module_scss_1.default.distributeEvenly]: distributeEvenly,
|
|
69
|
+
}), value: tab.id, children: tab.label }, tab.id))), !distributeEvenly && !tabRenderer && ((0, jsx_runtime_1.jsx)("div", { className: Tabs_module_scss_1.default.filler, "data-orientation": orientation }))] }), children] }) }));
|
|
91
70
|
});
|
|
@@ -85,6 +85,5 @@ exports.TextAreaMd = (0, metadata_helpers_1.createMetadata)({
|
|
|
85
85
|
themeVars: (0, themeVars_1.parseScssVar)(TextArea_module_scss_1.default.themeVars),
|
|
86
86
|
});
|
|
87
87
|
exports.textAreaComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.TextAreaMd, ({ node, extractValue, state, updateState, layoutCss, registerComponentApi, lookupEventHandler, }) => {
|
|
88
|
-
|
|
89
|
-
return ((0, jsx_runtime_1.jsx)(TextAreaNative_1.TextArea, { value: state === null || state === void 0 ? void 0 : state.value, initialValue: initialValue, updateState: updateState, autoFocus: extractValue.asOptionalBoolean(node.props.autoFocus), enabled: extractValue.asOptionalBoolean(node.props.enabled), placeholder: extractValue(node.props.placeholder), onDidChange: lookupEventHandler("didChange"), onFocus: lookupEventHandler("gotFocus"), onBlur: lookupEventHandler("lostFocus"), readOnly: extractValue.asOptionalBoolean(node.props.readOnly), resize: node.props.resize, enterSubmits: extractValue.asOptionalBoolean(node.props.enterSubmits), escResets: extractValue.asOptionalBoolean(node.props.escResets), style: layoutCss, registerComponentApi: registerComponentApi, maxRows: extractValue.asOptionalNumber(node.props.maxRows), minRows: extractValue.asOptionalNumber(node.props.minRows), maxLength: extractValue.asOptionalNumber(node.props.maxLength), rows: extractValue.asOptionalNumber(node.props.rows), autoSize: extractValue.asOptionalBoolean(node.props.autoSize), validationStatus: extractValue(node.props.validationStatus), label: extractValue(node.props.label), labelPosition: extractValue(node.props.labelPosition), labelWidth: extractValue(node.props.labelWidth), labelBreak: extractValue.asOptionalBoolean(node.props.labelBreak), required: extractValue.asOptionalBoolean(node.props.required) }, `${node.uid}-${initialValue}`));
|
|
88
|
+
return ((0, jsx_runtime_1.jsx)(TextAreaNative_1.TextArea, { value: state === null || state === void 0 ? void 0 : state.value, initialValue: extractValue(node.props.initialValue), updateState: updateState, autoFocus: extractValue.asOptionalBoolean(node.props.autoFocus), enabled: extractValue.asOptionalBoolean(node.props.enabled), placeholder: extractValue(node.props.placeholder), onDidChange: lookupEventHandler("didChange"), onFocus: lookupEventHandler("gotFocus"), onBlur: lookupEventHandler("lostFocus"), readOnly: extractValue.asOptionalBoolean(node.props.readOnly), resize: node.props.resize, enterSubmits: extractValue.asOptionalBoolean(node.props.enterSubmits), escResets: extractValue.asOptionalBoolean(node.props.escResets), style: layoutCss, registerComponentApi: registerComponentApi, maxRows: extractValue.asOptionalNumber(node.props.maxRows), minRows: extractValue.asOptionalNumber(node.props.minRows), maxLength: extractValue.asOptionalNumber(node.props.maxLength), rows: extractValue.asOptionalNumber(node.props.rows), autoSize: extractValue.asOptionalBoolean(node.props.autoSize), validationStatus: extractValue(node.props.validationStatus), label: extractValue(node.props.label), labelPosition: extractValue(node.props.labelPosition), labelWidth: extractValue(node.props.labelWidth), labelBreak: extractValue.asOptionalBoolean(node.props.labelBreak), required: extractValue.asOptionalBoolean(node.props.required) }));
|
|
90
89
|
});
|
|
@@ -57,8 +57,29 @@ exports.Toggle = (0, react_3.forwardRef)(function Toggle({ id, initialValue = ex
|
|
|
57
57
|
const generatedId = (0, react_1.useId)();
|
|
58
58
|
const inputId = id || generatedId;
|
|
59
59
|
const innerRef = react_3.default.useRef(null);
|
|
60
|
+
const transformToLegitValue = (inp) => {
|
|
61
|
+
if (typeof inp === "undefined" || inp === null) {
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
if (typeof inp === "boolean") {
|
|
65
|
+
return inp;
|
|
66
|
+
}
|
|
67
|
+
if (typeof inp === "number") {
|
|
68
|
+
return !isNaN(inp) && !!inp;
|
|
69
|
+
}
|
|
70
|
+
if (typeof inp === "string") {
|
|
71
|
+
return inp.trim() !== "" && inp.toLowerCase() !== "false";
|
|
72
|
+
}
|
|
73
|
+
if (Array.isArray(inp)) {
|
|
74
|
+
return inp.length > 0;
|
|
75
|
+
}
|
|
76
|
+
if (typeof inp === "object") {
|
|
77
|
+
return Object.keys(inp).length > 0;
|
|
78
|
+
}
|
|
79
|
+
return false;
|
|
80
|
+
};
|
|
60
81
|
(0, react_3.useEffect)(() => {
|
|
61
|
-
updateState({ value: initialValue }, { initial: true });
|
|
82
|
+
updateState({ value: transformToLegitValue(initialValue) }, { initial: true });
|
|
62
83
|
}, [initialValue, updateState]);
|
|
63
84
|
const updateValue = (0, react_3.useCallback)((value) => {
|
|
64
85
|
var _a;
|
|
@@ -95,7 +116,7 @@ exports.Toggle = (0, react_3.forwardRef)(function Toggle({ id, initialValue = ex
|
|
|
95
116
|
}
|
|
96
117
|
}, [focus, autoFocus]);
|
|
97
118
|
const setValue = (0, misc_1.useEvent)((newValue) => {
|
|
98
|
-
updateValue(newValue);
|
|
119
|
+
updateValue(transformToLegitValue(newValue));
|
|
99
120
|
});
|
|
100
121
|
(0, react_3.useEffect)(() => {
|
|
101
122
|
registerComponentApi === null || registerComponentApi === void 0 ? void 0 : registerComponentApi({
|
|
@@ -103,13 +124,16 @@ exports.Toggle = (0, react_3.forwardRef)(function Toggle({ id, initialValue = ex
|
|
|
103
124
|
setValue,
|
|
104
125
|
});
|
|
105
126
|
}, [focus, registerComponentApi, setValue]);
|
|
106
|
-
const input = (0, react_2.useMemo)(() =>
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
127
|
+
const input = (0, react_2.useMemo)(() => {
|
|
128
|
+
const legitValue = transformToLegitValue(value);
|
|
129
|
+
return ((0, jsx_runtime_1.jsx)("input", { id: inputId, ref: innerRef, type: "checkbox", role: variant, checked: legitValue, disabled: !enabled, required: required, readOnly: readOnly, "aria-readonly": readOnly, "aria-checked": indeterminate ? "mixed" : legitValue, "aria-required": required, "aria-disabled": !enabled, onChange: onInputChange, onFocus: handleOnFocus, onBlur: handleOnBlur, autoFocus: autoFocus, className: (0, classnames_1.default)(Toggle_module_scss_1.default.resetAppearance, className, {
|
|
130
|
+
[Toggle_module_scss_1.default.checkbox]: variant === "checkbox",
|
|
131
|
+
[Toggle_module_scss_1.default.switch]: variant === "switch",
|
|
132
|
+
[Toggle_module_scss_1.default.error]: validationStatus === "error",
|
|
133
|
+
[Toggle_module_scss_1.default.warning]: validationStatus === "warning",
|
|
134
|
+
[Toggle_module_scss_1.default.valid]: validationStatus === "valid",
|
|
135
|
+
}) }));
|
|
136
|
+
}, [
|
|
113
137
|
inputId,
|
|
114
138
|
className,
|
|
115
139
|
enabled,
|
|
@@ -125,7 +149,7 @@ exports.Toggle = (0, react_3.forwardRef)(function Toggle({ id, initialValue = ex
|
|
|
125
149
|
autoFocus,
|
|
126
150
|
]);
|
|
127
151
|
return ((0, jsx_runtime_1.jsx)(ItemWithLabel_1.ItemWithLabel, { ref: forwardedRef, id: inputId, label: label, style: style, labelPosition: labelPosition, labelWidth: labelWidth, labelBreak: labelBreak, required: required, enabled: enabled, isInputTemplateUsed: !!inputRenderer, shrinkToLabel: true, labelStyle: { pointerEvents: readOnly ? "none" : undefined }, children: inputRenderer ? ((0, jsx_runtime_1.jsxs)("label", { className: Toggle_module_scss_1.default.label, children: [(0, jsx_runtime_1.jsx)("div", { className: Toggle_module_scss_1.default.inputContainer, children: input }), inputRenderer({
|
|
128
|
-
$checked: value,
|
|
152
|
+
$checked: transformToLegitValue(value),
|
|
129
153
|
$setChecked: setValue,
|
|
130
154
|
})] })) : (input) }));
|
|
131
155
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.httpMethodNames = exports.VariantPropsKeys = exports.variantOptionsMd = exports.TextVariantElement = exports.orderingValues = exports.scrollAnchoringNames = exports.scrollAnchoringValues = exports.validationStatusMd = exports.validationStatusNames = exports.validationStatusValues = exports.triggerPositionNames = exports.labelPositionMd = exports.labelPositionNames = exports.labelPositionValues = exports.placementMd = exports.placementNames = exports.statusColorMd = exports.statusColorNames = exports.iconPositionMd = exports.iconPositionNames = exports.iconPositionValues = exports.orientationOptionMd = exports.orientationOptionNames = exports.alignmentOptionMd = exports.alignmentOptionNames = exports.alignmentOptionValues = exports.buttonAriaNames = exports.buttonVariantMd = exports.buttonVariantNames = exports.buttonVariantValues = exports.buttonTypesMd = exports.buttonTypeNames = exports.buttonTypeValues = exports.buttonThemeMd = exports.buttonThemeNames = exports.buttonThemeValues = exports.
|
|
3
|
+
exports.httpMethodNames = exports.VariantPropsKeys = exports.variantOptionsMd = exports.TextVariantElement = exports.orderingValues = exports.scrollAnchoringNames = exports.scrollAnchoringValues = exports.validationStatusMd = exports.validationStatusNames = exports.validationStatusValues = exports.triggerPositionNames = exports.labelPositionMd = exports.labelPositionNames = exports.labelPositionValues = exports.placementMd = exports.placementNames = exports.statusColorMd = exports.statusColorNames = exports.iconPositionMd = exports.iconPositionNames = exports.iconPositionValues = exports.orientationOptionMd = exports.orientationOptionNames = exports.alignmentOptionMd = exports.alignmentOptionNames = exports.alignmentOptionValues = exports.buttonAriaNames = exports.buttonVariantMd = exports.buttonVariantNames = exports.buttonVariantValues = exports.buttonTypesMd = exports.buttonTypeNames = exports.buttonTypeValues = exports.buttonThemeMd = exports.buttonThemeNames = exports.buttonThemeValues = exports.sizeMd = exports.sizeNames = exports.viewportSizeNames = exports.viewportSizeMd = exports.LinkTargetMd = exports.LinkTargetNames = void 0;
|
|
4
4
|
exports.LinkTargetNames = ["_self", "_blank", "_parent", "_top", "_unfencedTop"];
|
|
5
5
|
exports.LinkTargetMd = [
|
|
6
6
|
{
|
|
@@ -38,14 +38,14 @@ exports.viewportSizeMd = [
|
|
|
38
38
|
];
|
|
39
39
|
exports.viewportSizeNames = Object.keys(exports.viewportSizeMd);
|
|
40
40
|
// --- Available button sizes
|
|
41
|
+
exports.sizeNames = ["xs", "sm", "md", "lg"];
|
|
41
42
|
exports.sizeMd = [
|
|
42
|
-
{ value: "xs", description: "Extra small
|
|
43
|
-
{ value: "sm", description: "Small
|
|
44
|
-
{ value: "md", description: "Medium
|
|
45
|
-
{ value: "lg", description: "Large
|
|
43
|
+
{ value: "xs", description: "Extra small" },
|
|
44
|
+
{ value: "sm", description: "Small" },
|
|
45
|
+
{ value: "md", description: "Medium" },
|
|
46
|
+
{ value: "lg", description: "Large" },
|
|
46
47
|
];
|
|
47
48
|
const sizeValues = Object.keys(exports.sizeMd);
|
|
48
|
-
exports.sizeNames = [...sizeValues];
|
|
49
49
|
// --- Available button themes
|
|
50
50
|
exports.buttonThemeValues = ["attention", "primary", "secondary"];
|
|
51
51
|
exports.buttonThemeNames = [...exports.buttonThemeValues];
|
|
@@ -219,6 +219,25 @@ const TextVariantKeys = [
|
|
|
219
219
|
"tableheading", // use a H3 with some specific defaults
|
|
220
220
|
"secondary", // use a secondary text style
|
|
221
221
|
];
|
|
222
|
+
const TextVariantMapping = [
|
|
223
|
+
"abbr",
|
|
224
|
+
"cite",
|
|
225
|
+
"code",
|
|
226
|
+
"del",
|
|
227
|
+
"em",
|
|
228
|
+
"ins",
|
|
229
|
+
"kbd",
|
|
230
|
+
"mark",
|
|
231
|
+
"p",
|
|
232
|
+
"pre",
|
|
233
|
+
"samp",
|
|
234
|
+
"strong",
|
|
235
|
+
"sub",
|
|
236
|
+
"sup",
|
|
237
|
+
"var",
|
|
238
|
+
"h6",
|
|
239
|
+
"span",
|
|
240
|
+
];
|
|
222
241
|
exports.TextVariantElement = {
|
|
223
242
|
abbr: "abbr",
|
|
224
243
|
cite: "cite",
|
|
@@ -20,6 +20,7 @@ exports.MemoizedItem = (0, react_1.memo)(({ node, item, context, renderChild, la
|
|
|
20
20
|
contextVars: Object.assign({ [itemKey]: item, [contextKey]: context }, shallowMemoedContextVars),
|
|
21
21
|
children: Array.isArray(node) ? node : [node],
|
|
22
22
|
};
|
|
23
|
-
}, [context, item, node, shallowMemoedContextVars]);
|
|
23
|
+
}, [context, item, node, shallowMemoedContextVars, itemKey, contextKey]);
|
|
24
24
|
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: renderChild(nodeWithItem, layoutContext) });
|
|
25
25
|
});
|
|
26
|
+
exports.MemoizedItem.displayName = "MemoizedItem";
|
|
@@ -135,10 +135,6 @@ const ComponentAdapter = (0, react_1.forwardRef)(function ComponentAdapter(_a, r
|
|
|
135
135
|
// --- Obtain the component renderer and descriptor from the component registry
|
|
136
136
|
const componentRegistry = (0, ComponentRegistryContext_1.useComponentRegistry)();
|
|
137
137
|
const { renderer, descriptor, isCompoundComponent } = componentRegistry.lookupComponentRenderer(safeNode.type) || {};
|
|
138
|
-
// if (safeNode.type.startsWith("Component")) {
|
|
139
|
-
// console.log("renderer", renderer, safeNode.type);
|
|
140
|
-
// console.log("registry", componentRegistry.getRegisteredComponentKeys().length);
|
|
141
|
-
// }
|
|
142
138
|
// --- Obtain a function that can lookup an event handler, which is bound to a
|
|
143
139
|
// --- particular event of this component instance
|
|
144
140
|
const memoedLookupEventHandler = (0, react_1.useCallback)((eventName, actionOptions) => {
|
|
@@ -299,7 +295,10 @@ function slotRenderer({ node, extractValue, renderChild, lookupAction, layoutCon
|
|
|
299
295
|
// --- The slot is not named
|
|
300
296
|
if (!slotProps) {
|
|
301
297
|
// --- simply render the children from the parent
|
|
302
|
-
|
|
298
|
+
// --- The parent does not provide a template for the slot.
|
|
299
|
+
if (parentRenderContext.children) {
|
|
300
|
+
return parentRenderContext.renderChild(parentRenderContext.children, layoutContext);
|
|
301
|
+
}
|
|
303
302
|
}
|
|
304
303
|
else {
|
|
305
304
|
// --- The slot has properties; let's render the children with the slot properties
|
|
@@ -65,13 +65,14 @@ exports.ComponentWrapper = (0, react_1.memo)((0, react_1.forwardRef)(function Co
|
|
|
65
65
|
}
|
|
66
66
|
}));
|
|
67
67
|
function transformNodeWithChildrenAsTemplate(node, childrenAsTemplate) {
|
|
68
|
+
var _a;
|
|
68
69
|
if (!childrenAsTemplate) {
|
|
69
70
|
return node;
|
|
70
71
|
}
|
|
71
72
|
if (!node.children || node.children.length === 0) {
|
|
72
73
|
return node;
|
|
73
74
|
}
|
|
74
|
-
if (node.props[childrenAsTemplate]) {
|
|
75
|
+
if ((_a = node.props) === null || _a === void 0 ? void 0 : _a[childrenAsTemplate]) {
|
|
75
76
|
throw Error("'" + childrenAsTemplate + "' is already used as a property.");
|
|
76
77
|
}
|
|
77
78
|
return Object.assign(Object.assign({}, node), { props: Object.assign(Object.assign({}, node.props), { [childrenAsTemplate]: node.children }), children: constants_1.EMPTY_ARRAY });
|