xmlui 0.7.32 → 0.7.34
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/{apiInterceptorWorker-iyzFS4kP.mjs → apiInterceptorWorker-DHDoRL37.mjs} +1 -1
- package/dist/{index-29eF52eI.mjs → index-B90aqc2f.mjs} +10337 -9968
- package/dist/index.css +1 -1
- package/dist/{lint-DgP_MIP6.mjs → lint-D3rXRbP1.mjs} +337 -337
- package/dist/scripts/bin/language-server.js +11 -0
- package/dist/scripts/src/abstractions/ComponentDefs.js +2 -1
- package/dist/scripts/src/components/Accordion/Accordion.js +5 -5
- package/dist/scripts/src/components/App/App.js +2 -2
- package/dist/scripts/src/components/App/AppNative.js +2 -2
- package/dist/scripts/src/components/AppHeader/AppHeader.js +6 -3
- package/dist/scripts/src/components/AutoComplete/AutoComplete.js +6 -6
- package/dist/scripts/src/components/Avatar/Avatar.js +3 -3
- package/dist/scripts/src/components/Badge/Badge.js +3 -3
- package/dist/scripts/src/components/Button/Button.js +15 -15
- package/dist/scripts/src/components/Button/ButtonNative.js +3 -2
- package/dist/scripts/src/components/Card/Card.js +2 -2
- package/dist/scripts/src/components/Carousel/Carousel.js +4 -1
- package/dist/scripts/src/components/ComponentProvider.js +8 -3
- package/dist/scripts/src/components/DatePicker/DatePicker.js +2 -2
- package/dist/scripts/src/components/DropdownMenu/DropdownMenu.js +10 -10
- package/dist/scripts/src/components/DropdownMenu/DropdownMenuNative.js +4 -5
- package/dist/scripts/src/components/Footer/Footer.js +1 -1
- package/dist/scripts/src/components/FormItem/FormItem.js +3 -3
- package/dist/scripts/src/components/Heading/Heading.js +21 -27
- package/dist/scripts/src/components/Heading/HeadingNative.js +2 -1
- package/dist/scripts/src/components/HtmlTags/HtmlTags.js +57 -20
- package/dist/scripts/src/components/Icon/Inspect.js +10 -0
- package/dist/scripts/src/components/IconProvider.js +3 -1
- package/dist/scripts/src/components/IconRegistryContext.js +243 -242
- package/dist/scripts/src/components/Link/Link.js +16 -13
- package/dist/scripts/src/components/Markdown/Markdown.js +3 -3
- package/dist/scripts/src/components/Markdown/MarkdownNative.js +73 -17
- package/dist/scripts/src/components/ModalDialog/ModalDialog.js +1 -1
- package/dist/scripts/src/components/NavGroup/NavGroup.js +2 -2
- package/dist/scripts/src/components/NavLink/NavLink.js +26 -23
- package/dist/scripts/src/components/NavPanel/NavPanel.js +6 -6
- package/dist/scripts/src/components/NoResult/NoResult.js +1 -1
- package/dist/scripts/src/components/OffCanvas/OffCanvas.js +4 -4
- package/dist/scripts/src/components/ProgressBar/ProgressBar.js +2 -2
- package/dist/scripts/src/components/RadioGroup/RadioGroup.js +2 -2
- package/dist/scripts/src/components/Select/Select.js +6 -6
- package/dist/scripts/src/components/Select/SelectNative.js +16 -15
- package/dist/scripts/src/components/Slider/Slider.js +1 -1
- package/dist/scripts/src/components/Table/Table.js +15 -15
- package/dist/scripts/src/components/TableOfContents/TableOfContents.js +21 -21
- package/dist/scripts/src/components/TableOfContents/TableOfContentsNative.js +2 -1
- package/dist/scripts/src/components/Text/Text.js +39 -40
- package/dist/scripts/src/components/TextBox/TextBox.js +6 -6
- package/dist/scripts/src/components/Theme/ThemeNative.js +1 -1
- package/dist/scripts/src/components-core/ComponentDecorator.js +23 -19
- package/dist/scripts/src/components-core/InspectorContext.js +2 -2
- package/dist/scripts/src/components-core/abstractions/standalone.js +2 -0
- package/dist/scripts/src/components-core/descriptorHelper.js +7 -7
- package/dist/scripts/src/components-core/interception/abstractions.js +2 -0
- package/dist/scripts/src/components-core/rendering/ComponentAdapter.js +2 -2
- package/dist/scripts/src/components-core/rendering/Container.js +21 -34
- package/dist/scripts/src/components-core/theming/layout-resolver.js +26 -26
- package/dist/scripts/src/components-core/theming/themes/base-utils.js +8 -8
- package/dist/scripts/src/components-core/theming/themes/root.js +39 -39
- package/dist/scripts/src/components-core/theming/themes/solid.js +2 -2
- package/dist/scripts/src/components-core/theming/themes/xmlui.js +2 -2
- package/dist/scripts/src/components-core/theming/transformThemeVars.js +37 -37
- package/dist/scripts/src/components-core/utils/hooks.js +2 -2
- package/dist/scripts/src/language-server/metadata.js +8206 -0
- package/dist/scripts/src/language-server/server.js +135 -0
- package/dist/scripts/src/language-server/services/completion.js +100 -0
- package/dist/scripts/src/language-server/services/hover.js +170 -0
- package/dist/scripts/src/language-server/services/syntax-node-utilities.js +22 -0
- package/dist/scripts/src/parsers/xmlui-parser/index.js +29 -0
- package/dist/scripts/src/parsers/xmlui-parser/lint.js +177 -0
- package/dist/scripts/src/parsers/xmlui-parser/xmlui-serializer.js +582 -0
- package/dist/scripts/src/parsers/xmlui-parser/xmlui-tree.js +2 -0
- package/dist/style.css +1 -1
- package/dist/xmlui-metadata.mjs +8066 -6905
- package/dist/xmlui-metadata.umd.js +11 -11
- package/dist/xmlui-parser.d.ts +1 -0
- package/dist/xmlui-parser.mjs +2 -2
- package/dist/xmlui-standalone.umd.js +165 -165
- package/dist/xmlui.d.ts +5 -3
- package/dist/xmlui.mjs +13 -12
- package/package.json +9 -4
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createMetadata = createMetadata;
|
|
4
4
|
exports.d = d;
|
|
5
|
-
function createMetadata({ description, shortDescription, specializedFrom, status, props, events, contextVars, apis, nonVisual, opaque, themeVars, defaultThemeVars, toneSpecificThemeVars, allowArbitraryProps, docFolder, isHtmlTag, }) {
|
|
5
|
+
function createMetadata({ description, shortDescription, specializedFrom, status, props, events, contextVars, apis, nonVisual, opaque, themeVars, themeVarDescriptions, defaultThemeVars, toneSpecificThemeVars, allowArbitraryProps, docFolder, isHtmlTag, }) {
|
|
6
6
|
return {
|
|
7
7
|
description,
|
|
8
8
|
shortDescription,
|
|
@@ -16,6 +16,7 @@ function createMetadata({ description, shortDescription, specializedFrom, status
|
|
|
16
16
|
opaque,
|
|
17
17
|
themeVars,
|
|
18
18
|
defaultThemeVars,
|
|
19
|
+
themeVarDescriptions,
|
|
19
20
|
toneSpecificThemeVars,
|
|
20
21
|
allowArbitraryProps,
|
|
21
22
|
docFolder,
|
|
@@ -61,12 +61,12 @@ exports.AccordionMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
61
61
|
},
|
|
62
62
|
themeVars: (0, themeVars_1.parseScssVar)(Accordion_module_scss_1.default.themeVars),
|
|
63
63
|
defaultThemeVars: {
|
|
64
|
-
[`
|
|
65
|
-
[`
|
|
64
|
+
[`paddingHorizontal-header-${COMP}`]: "$space-3",
|
|
65
|
+
[`paddingVertical-header-${COMP}`]: "$space-3",
|
|
66
66
|
[`align-vertical-header-${COMP}`]: "center",
|
|
67
|
-
[`
|
|
68
|
-
[`
|
|
69
|
-
[`
|
|
67
|
+
[`fontSize-header-${COMP}`]: "$fontSize-normal",
|
|
68
|
+
[`fontWeight-header-${COMP}`]: "$fontWeight-normal",
|
|
69
|
+
[`fontFamily-header-${COMP}`]: "$fontFamily",
|
|
70
70
|
[`border-${COMP}`]: "0px solid $color-border",
|
|
71
71
|
[`width-icon-${COMP}`]: "",
|
|
72
72
|
[`height-icon-${COMP}`]: "",
|
|
@@ -76,8 +76,8 @@ exports.AppMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
76
76
|
defaultThemeVars: {
|
|
77
77
|
[`width-navPanel-${COMP}`]: "$space-64",
|
|
78
78
|
[`max-content-width-${COMP}`]: "$max-content-width",
|
|
79
|
-
[`
|
|
80
|
-
[`
|
|
79
|
+
[`boxShadow-header-${COMP}`]: "$shadow-spread",
|
|
80
|
+
[`boxShadow-pages-${COMP}`]: "$shadow-spread",
|
|
81
81
|
[`scroll-padding-block-Pages`]: "$space-4",
|
|
82
82
|
light: {
|
|
83
83
|
// --- No light-specific theme vars
|
|
@@ -97,7 +97,7 @@ function App({ children, style, layout, loggedInUser, scrollWholePage, noScrollb
|
|
|
97
97
|
"--footer-height": !scrollWholePage ? 0 : footerHeight + "px",
|
|
98
98
|
"--header-abs-height": headerHeight + "px",
|
|
99
99
|
"--footer-abs-height": footerHeight + "px",
|
|
100
|
-
"--scrollbar-width": noScrollbarGutters ? 0 :
|
|
100
|
+
"--scrollbar-width": noScrollbarGutters ? 0 : scrollbarWidth + "px",
|
|
101
101
|
};
|
|
102
102
|
}, [footerHeight, headerHeight, noScrollbarGutters, scrollWholePage, scrollbarWidth]);
|
|
103
103
|
const [drawerVisible, setDrawerVisible] = (0, react_1.useState)(false);
|
|
@@ -105,7 +105,7 @@ function App({ children, style, layout, loggedInUser, scrollWholePage, noScrollb
|
|
|
105
105
|
const toggleDrawer = (0, react_1.useCallback)(() => {
|
|
106
106
|
setDrawerVisible((prev) => !prev);
|
|
107
107
|
}, []);
|
|
108
|
-
(0,
|
|
108
|
+
(0, hooks_1.useIsomorphicLayoutEffect)(() => {
|
|
109
109
|
var _a;
|
|
110
110
|
(_a = scrollContainerRef.current) === null || _a === void 0 ? void 0 : _a.scrollTo({
|
|
111
111
|
top: 0,
|
|
@@ -34,10 +34,13 @@ exports.AppHeaderMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
34
34
|
},
|
|
35
35
|
},
|
|
36
36
|
themeVars: (0, themeVars_1.parseScssVar)(AppHeader_module_scss_1.default.themeVars),
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
themeVarDescriptions: {
|
|
38
|
+
[`width-logo-${COMP}`]: "Sets the width of the displayed logo",
|
|
39
|
+
},
|
|
40
|
+
defaultThemeVars: Object.assign(Object.assign(Object.assign({ [`height-${COMP}`]: "$space-14", [`max-content-width-${COMP}`]: "$max-content-width-App", [`border-bottom-${COMP}`]: "1px solid $color-border" }, (0, base_utils_1.paddingSubject)(`logo-${COMP}`, { horizontal: "$space-0", vertical: "$space-4" })), (0, base_utils_1.paddingSubject)(COMP, { horizontal: "$space-4", vertical: "$space-0" })), { [`borderRadius-${COMP}`]: "0px", light: {
|
|
41
|
+
[`color-bg-${COMP}`]: "white",
|
|
39
42
|
}, dark: {
|
|
40
|
-
|
|
43
|
+
[`color-bg-${COMP}`]: "$color-surface-900",
|
|
41
44
|
} }),
|
|
42
45
|
});
|
|
43
46
|
exports.appHeaderComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.AppHeaderMd, ({ node, renderChild, layoutCss, layoutContext, extractValue }) => {
|
|
@@ -50,16 +50,16 @@ exports.AutoCompleteMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
50
50
|
themeVars: (0, themeVars_1.parseScssVar)(AutoComplete_module_scss_1.default.themeVars),
|
|
51
51
|
defaultThemeVars: {
|
|
52
52
|
[`color-bg-menu-${COMP}`]: "$color-bg-primary",
|
|
53
|
-
[`
|
|
54
|
-
[`
|
|
53
|
+
[`boxShadow-menu-${COMP}`]: "$shadow-md",
|
|
54
|
+
[`borderRadius-menu-${COMP}`]: "$borderRadius",
|
|
55
55
|
[`color-bg-item-${COMP}`]: "$color-bg-dropdown-item",
|
|
56
56
|
[`color-bg-item-${COMP}--hover`]: "$color-bg-dropdown-item--active",
|
|
57
57
|
[`color-bg-item-${COMP}--active`]: "$color-bg-dropdown-item--active",
|
|
58
|
-
[`
|
|
58
|
+
[`minHeight-Input`]: "39px",
|
|
59
59
|
[`color-bg-${COMP}-badge`]: "$color-primary-500",
|
|
60
|
-
[`
|
|
61
|
-
[`
|
|
62
|
-
[`
|
|
60
|
+
[`fontSize-${COMP}-badge`]: "$fontSize-small",
|
|
61
|
+
[`paddingHorizontal-${COMP}-badge`]: "$space-1",
|
|
62
|
+
[`paddingVertical-${COMP}-badge`]: "$space-1",
|
|
63
63
|
light: {
|
|
64
64
|
[`color-bg-${COMP}-badge--hover`]: "$color-primary-400",
|
|
65
65
|
[`color-bg-${COMP}-badge--active`]: "$color-primary-500",
|
|
@@ -35,10 +35,10 @@ exports.AvatarMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
35
35
|
},
|
|
36
36
|
themeVars: (0, themeVars_1.parseScssVar)(Avatar_module_scss_1.default.themeVars),
|
|
37
37
|
defaultThemeVars: {
|
|
38
|
-
[`
|
|
39
|
-
[`
|
|
38
|
+
[`borderRadius-${COMP}`]: "4px",
|
|
39
|
+
[`boxShadow-${COMP}`]: "inset 0 0 0 1px rgba(4,32,69,0.1)",
|
|
40
40
|
[`color-text-${COMP}`]: "$color-text-secondary",
|
|
41
|
-
[`
|
|
41
|
+
[`fontWeight-${COMP}`]: "$fontWeight-bold",
|
|
42
42
|
light: {
|
|
43
43
|
[`border-${COMP}`]: "0px solid $color-surface-400A80",
|
|
44
44
|
[`color-bg-${COMP}`]: "$color-surface-100",
|
|
@@ -46,9 +46,9 @@ exports.BadgeMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
46
46
|
[`padding-${COMP}`]: `$space-0_5 $space-2`,
|
|
47
47
|
[`border-${COMP}`]: `0px solid $color-border`,
|
|
48
48
|
[`padding-${COMP}-pill`]: `$space-0_5 $space-2`,
|
|
49
|
-
[`
|
|
50
|
-
[`
|
|
51
|
-
[`
|
|
49
|
+
[`borderRadius-${COMP}`]: "4px",
|
|
50
|
+
[`fontSize-${COMP}`]: "0.8em",
|
|
51
|
+
[`fontSize-${COMP}-pill`]: "0.8em",
|
|
52
52
|
light: {
|
|
53
53
|
[`color-bg-${COMP}`]: "rgba($color-secondary-500-rgb, .6)",
|
|
54
54
|
[`color-text-${COMP}`]: "white",
|
|
@@ -95,9 +95,9 @@ exports.ButtonMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
95
95
|
defaultThemeVars: {
|
|
96
96
|
[`width-${COMP}`]: "fit-content",
|
|
97
97
|
[`height-${COMP}`]: "fit-content",
|
|
98
|
-
[`
|
|
99
|
-
[`
|
|
100
|
-
[`
|
|
98
|
+
[`borderRadius-${COMP}`]: "$borderRadius",
|
|
99
|
+
[`fontSize-${COMP}`]: "$fontSize-small",
|
|
100
|
+
[`fontWeight-${COMP}`]: "$fontWeight-medium",
|
|
101
101
|
[`color-bg-${COMP}-primary`]: "$color-primary-500",
|
|
102
102
|
[`color-bg-${COMP}-attention`]: "$color-bg-attention",
|
|
103
103
|
[`color-border-${COMP}-attention`]: "$color-attention",
|
|
@@ -105,19 +105,19 @@ exports.ButtonMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
105
105
|
[`color-border-${COMP}--disabled`]: "$color-border--disabled",
|
|
106
106
|
[`style-border-${COMP}`]: "solid",
|
|
107
107
|
[`color-text-${COMP}--disabled`]: "$color-text--disabled",
|
|
108
|
-
[`
|
|
108
|
+
[`outlineColor-${COMP}--focus`]: "$outlineColor--focus",
|
|
109
109
|
[`thickness-border-${COMP}`]: "1px",
|
|
110
|
-
[`
|
|
111
|
-
[`
|
|
112
|
-
[`
|
|
113
|
-
[`
|
|
114
|
-
[`
|
|
115
|
-
[`
|
|
116
|
-
[`
|
|
117
|
-
[`
|
|
118
|
-
[`
|
|
119
|
-
[`
|
|
120
|
-
[`
|
|
110
|
+
[`outlineWidth-${COMP}--focus`]: "$outlineWidth--focus",
|
|
111
|
+
[`outlineStyle-${COMP}--focus`]: "$outlineStyle--focus",
|
|
112
|
+
[`outlineOffset-${COMP}--focus`]: "$outlineOffset--focus",
|
|
113
|
+
[`paddingHorizontal-${COMP}-xs`]: "$space-1",
|
|
114
|
+
[`paddingVertical-${COMP}-xs`]: "$space-0_5",
|
|
115
|
+
[`paddingHorizontal-${COMP}-sm`]: "$space-4",
|
|
116
|
+
[`paddingVertical-${COMP}-sm`]: "$space-2",
|
|
117
|
+
[`paddingHorizontal-${COMP}-md`]: "$space-4",
|
|
118
|
+
[`paddingVertical-${COMP}-md`]: "$space-3",
|
|
119
|
+
[`paddingHorizontal-${COMP}-lg`]: "$space-5",
|
|
120
|
+
[`paddingVertical-${COMP}-lg`]: "$space-4",
|
|
121
121
|
light: {
|
|
122
122
|
[`color-text-${COMP}`]: "$color-surface-950",
|
|
123
123
|
[`color-text-${COMP}-solid`]: "$color-surface-50",
|
|
@@ -52,6 +52,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
52
52
|
const react_1 = __importStar(require("react"));
|
|
53
53
|
const classnames_1 = __importDefault(require("classnames"));
|
|
54
54
|
const Button_module_scss_1 = __importDefault(require("./Button.module.scss"));
|
|
55
|
+
const react_compose_refs_1 = require("@radix-ui/react-compose-refs");
|
|
55
56
|
exports.propDefaults = {
|
|
56
57
|
type: "button",
|
|
57
58
|
iconPosition: "start",
|
|
@@ -64,7 +65,7 @@ exports.propDefaults = {
|
|
|
64
65
|
exports.Button = react_1.default.forwardRef(function Button(_a, ref) {
|
|
65
66
|
var { id, type = exports.propDefaults.type, icon, iconPosition = exports.propDefaults.iconPosition, contentPosition = exports.propDefaults.contentPosition, orientation = exports.propDefaults.orientation, variant = exports.propDefaults.variant, themeColor = exports.propDefaults.themeColor, size = exports.propDefaults.size, disabled, children, formId, onClick, onFocus, onBlur, style, gap, className, autoFocus } = _a, rest = __rest(_a, ["id", "type", "icon", "iconPosition", "contentPosition", "orientation", "variant", "themeColor", "size", "disabled", "children", "formId", "onClick", "onFocus", "onBlur", "style", "gap", "className", "autoFocus"]);
|
|
66
67
|
const innerRef = (0, react_1.useRef)(null);
|
|
67
|
-
(0,
|
|
68
|
+
const composedRef = ref ? (0, react_compose_refs_1.composeRefs)(ref, innerRef) : innerRef;
|
|
68
69
|
(0, react_1.useEffect)(() => {
|
|
69
70
|
if (autoFocus) {
|
|
70
71
|
setTimeout(() => {
|
|
@@ -74,7 +75,7 @@ exports.Button = react_1.default.forwardRef(function Button(_a, ref) {
|
|
|
74
75
|
}
|
|
75
76
|
}, [autoFocus]);
|
|
76
77
|
const iconToLeft = iconPosition === "start";
|
|
77
|
-
return ((0, jsx_runtime_1.jsxs)("button", Object.assign({}, rest, { id: id, type: type, ref:
|
|
78
|
+
return ((0, jsx_runtime_1.jsxs)("button", Object.assign({}, rest, { id: id, type: type, ref: composedRef, className: (0, classnames_1.default)(className, Button_module_scss_1.default.button, {
|
|
78
79
|
[Button_module_scss_1.default.buttonHorizontal]: orientation === "horizontal",
|
|
79
80
|
[Button_module_scss_1.default.buttonVertical]: orientation === "vertical",
|
|
80
81
|
[Button_module_scss_1.default.xs]: size === "xs",
|
|
@@ -55,8 +55,8 @@ exports.CardMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
55
55
|
defaultThemeVars: {
|
|
56
56
|
[`padding-${COMP}`]: "$space-4",
|
|
57
57
|
[`border-${COMP}`]: "1px solid $color-border",
|
|
58
|
-
[`
|
|
59
|
-
[`
|
|
58
|
+
[`borderRadius-${COMP}`]: "$borderRadius",
|
|
59
|
+
[`boxShadow-${COMP}`]: "none",
|
|
60
60
|
light: {
|
|
61
61
|
[`color-bg-${COMP}`]: "white",
|
|
62
62
|
},
|
|
@@ -90,6 +90,9 @@ exports.CarouselMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
90
90
|
scrollNext: (0, ComponentDefs_1.d)("This method scrolls the carousel to the next slide."),
|
|
91
91
|
},
|
|
92
92
|
themeVars: (0, themeVars_1.parseScssVar)(Carousel_module_scss_1.default.themeVars),
|
|
93
|
+
themeVarDescriptions: {
|
|
94
|
+
[`width-indicator-${COMP}`]: "Sets the width of the indicator.",
|
|
95
|
+
},
|
|
93
96
|
defaultThemeVars: {
|
|
94
97
|
[`color-bg-control-${COMP}`]: "$color-primary",
|
|
95
98
|
[`color-text-control-${COMP}`]: "$color-text",
|
|
@@ -109,7 +112,7 @@ exports.CarouselMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
109
112
|
[`height-indicator-${COMP}`]: "6px",
|
|
110
113
|
[`height-control-${COMP}`]: "36px",
|
|
111
114
|
[`width-control-${COMP}`]: "36px",
|
|
112
|
-
[`
|
|
115
|
+
[`borderRadius-control-${COMP}`]: "50%",
|
|
113
116
|
[`height-${COMP}`]: "100%",
|
|
114
117
|
[`width-${COMP}`]: "100%",
|
|
115
118
|
},
|
|
@@ -141,7 +141,8 @@ class ComponentRegistry {
|
|
|
141
141
|
// --- The pool of available loader renderers
|
|
142
142
|
this.loaders = new Map();
|
|
143
143
|
this.extensionRegistered = (extension) => {
|
|
144
|
-
|
|
144
|
+
var _a;
|
|
145
|
+
(_a = extension.components) === null || _a === void 0 ? void 0 : _a.forEach((c) => {
|
|
145
146
|
if ("type" in c) {
|
|
146
147
|
//we handle just the js components for now
|
|
147
148
|
this.registerComponentRenderer(c, extension.namespace);
|
|
@@ -168,8 +169,12 @@ class ComponentRegistry {
|
|
|
168
169
|
};
|
|
169
170
|
// --- Registers a renderable component using its renderer function
|
|
170
171
|
// --- and metadata
|
|
171
|
-
this.registerComponentRenderer = ({ type, renderer, metadata }, ...namespaces) => {
|
|
172
|
-
const component = {
|
|
172
|
+
this.registerComponentRenderer = ({ type, renderer, metadata, isCompoundComponent, }, ...namespaces) => {
|
|
173
|
+
const component = {
|
|
174
|
+
renderer,
|
|
175
|
+
descriptor: metadata,
|
|
176
|
+
isCompoundComponent,
|
|
177
|
+
};
|
|
173
178
|
namespaces.forEach((ns) => {
|
|
174
179
|
this.pool.set((ns ? ns + "." : "") + type, component);
|
|
175
180
|
});
|
|
@@ -108,8 +108,8 @@ exports.DatePickerMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
108
108
|
},
|
|
109
109
|
themeVars: (0, themeVars_1.parseScssVar)(DatePicker_module_scss_1.default.themeVars),
|
|
110
110
|
defaultThemeVars: {
|
|
111
|
-
[`
|
|
112
|
-
[`
|
|
111
|
+
[`boxShadow-menu-${COMP}`]: "$shadow-md",
|
|
112
|
+
[`borderRadius-menu-${COMP}`]: "$borderRadius",
|
|
113
113
|
[`color-text-value-${COMP}`]: "$color-text-primary",
|
|
114
114
|
light: {
|
|
115
115
|
[`color-bg-menu-${COMP}`]: "$color-surface-50",
|
|
@@ -63,10 +63,10 @@ exports.DropdownMenuMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
63
63
|
themeVars: (0, themeVars_1.parseScssVar)(DropdownMenu_module_scss_1.default.themeVars),
|
|
64
64
|
defaultThemeVars: {
|
|
65
65
|
[`color-bg-${DDMCOMP}`]: "$color-bg-primary",
|
|
66
|
-
[`
|
|
67
|
-
[`
|
|
66
|
+
[`minWidth-${DDMCOMP}`]: "160px",
|
|
67
|
+
[`boxShadow-${DDMCOMP}`]: "$shadow-xl",
|
|
68
68
|
[`style-border-${DDMCOMP}-content`]: "solid",
|
|
69
|
-
[`
|
|
69
|
+
[`borderRadius-${DDMCOMP}`]: "$borderRadius",
|
|
70
70
|
},
|
|
71
71
|
});
|
|
72
72
|
exports.dropdownMenuComponentRenderer = (0, renderers_1.createComponentRenderer)(DDMCOMP, exports.DropdownMenuMd, ({ node, extractValue, renderChild, registerComponentApi, layoutCss, lookupEventHandler }) => {
|
|
@@ -107,10 +107,10 @@ exports.MenuItemMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
107
107
|
defaultThemeVars: {
|
|
108
108
|
[`color-bg-${MICOMP}`]: "$color-bg-dropdown-item",
|
|
109
109
|
[`color-${MICOMP}`]: "$color-text-primary",
|
|
110
|
-
[`
|
|
111
|
-
[`
|
|
112
|
-
[`
|
|
113
|
-
[`
|
|
110
|
+
[`fontFamily-${MICOMP}`]: "$fontFamily",
|
|
111
|
+
[`fontSize-${MICOMP}`]: "$fontSize-small",
|
|
112
|
+
[`paddingVertical-${MICOMP}`]: "$space-2",
|
|
113
|
+
[`paddingHorizontal-${MICOMP}`]: "$space-3",
|
|
114
114
|
[`color-bg-${MICOMP}--hover`]: "$color-bg-dropdown-item--hover",
|
|
115
115
|
[`color-${MICOMP}--hover`]: "inherit",
|
|
116
116
|
[`gap-${MICOMP}`]: "$space-2",
|
|
@@ -152,12 +152,12 @@ exports.MenuSeparatorMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
152
152
|
docFolder: DDMCOMP,
|
|
153
153
|
themeVars: (0, themeVars_1.parseScssVar)(DropdownMenu_module_scss_1.default.themeVars),
|
|
154
154
|
defaultThemeVars: {
|
|
155
|
-
[`
|
|
156
|
-
[`
|
|
155
|
+
[`marginTop-${MSEP}`]: "$space-1",
|
|
156
|
+
[`marginBottom-${MSEP}`]: "$space-1",
|
|
157
157
|
[`width-${MSEP}`]: "100%",
|
|
158
158
|
[`height-${MSEP}`]: "1px",
|
|
159
159
|
[`color-${MSEP}`]: "$color-border-dropdown-item",
|
|
160
|
-
[`
|
|
160
|
+
[`marginHorizontal-${MSEP}`]: "12px",
|
|
161
161
|
},
|
|
162
162
|
});
|
|
163
163
|
exports.menuSeparatorRenderer = (0, renderers_1.createComponentRenderer)(MSEP, exports.MenuSeparatorMd, () => {
|
|
@@ -45,8 +45,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
45
45
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
46
46
|
};
|
|
47
47
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
-
exports.defaultMenuItemProps = exports.DropdownMenu = exports.defaultDropdownMenuProps = void 0;
|
|
49
|
-
exports.MenuItem = MenuItem;
|
|
48
|
+
exports.MenuItem = exports.defaultMenuItemProps = exports.DropdownMenu = exports.defaultDropdownMenuProps = void 0;
|
|
50
49
|
exports.SubMenuItem = SubMenuItem;
|
|
51
50
|
exports.MenuSeparator = MenuSeparator;
|
|
52
51
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
@@ -88,15 +87,15 @@ exports.defaultMenuItemProps = {
|
|
|
88
87
|
iconPosition: "start",
|
|
89
88
|
active: false,
|
|
90
89
|
};
|
|
91
|
-
function MenuItem({ children, onClick = constants_1.noop, label, style, icon, iconPosition = exports.defaultMenuItemProps.iconPosition, active = exports.defaultMenuItemProps.active, }) {
|
|
90
|
+
exports.MenuItem = (0, react_1.forwardRef)(function MenuItem({ children, onClick = constants_1.noop, label, style, icon, iconPosition = exports.defaultMenuItemProps.iconPosition, active = exports.defaultMenuItemProps.active, }, ref) {
|
|
92
91
|
const iconToStart = iconPosition === "start";
|
|
93
92
|
return ((0, jsx_runtime_1.jsxs)(ReactDropdownMenu.Item, { style: style, className: (0, classnames_1.default)(DropdownMenu_module_scss_1.default.DropdownMenuItem, {
|
|
94
93
|
[DropdownMenu_module_scss_1.default.active]: active,
|
|
95
94
|
}), onClick: (event) => {
|
|
96
95
|
event.stopPropagation();
|
|
97
96
|
onClick(event);
|
|
98
|
-
}, children: [iconToStart && icon, (0, jsx_runtime_1.jsx)("div", { className: DropdownMenu_module_scss_1.default.wrapper, children: label !== null && label !== void 0 ? label : children }), !iconToStart && icon] }));
|
|
99
|
-
}
|
|
97
|
+
}, ref: ref, children: [iconToStart && icon, (0, jsx_runtime_1.jsx)("div", { className: DropdownMenu_module_scss_1.default.wrapper, children: label !== null && label !== void 0 ? label : children }), !iconToStart && icon] }));
|
|
98
|
+
});
|
|
100
99
|
function SubMenuItem({ children, label, triggerTemplate }) {
|
|
101
100
|
const { root } = (0, ThemeContext_1.useTheme)();
|
|
102
101
|
return ((0, jsx_runtime_1.jsxs)(ReactDropdownMenu.Sub, { children: [(0, jsx_runtime_1.jsx)(ReactDropdownMenu.SubTrigger, { className: DropdownMenu_module_scss_1.default.DropdownMenuSubTrigger, asChild: true, children: triggerTemplate ? triggerTemplate : (0, jsx_runtime_1.jsx)("div", { children: label }) }), (0, jsx_runtime_1.jsx)(ReactDropdownMenu.Portal, { container: root, children: (0, jsx_runtime_1.jsx)(ReactDropdownMenu.SubContent, { className: DropdownMenu_module_scss_1.default.DropdownMenuSubContent, children: children }) })] }));
|
|
@@ -17,7 +17,7 @@ exports.FooterMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
17
17
|
defaultThemeVars: {
|
|
18
18
|
[`color-bg-${COMP}`]: "$color-bg-AppHeader",
|
|
19
19
|
[`align-vertical-${COMP}`]: "center",
|
|
20
|
-
[`
|
|
20
|
+
[`fontSize-${COMP}`]: "$fontSize-small",
|
|
21
21
|
[`color-text-${COMP}`]: "$color-text-secondary",
|
|
22
22
|
[`max-content-width-${COMP}`]: "$max-content-width",
|
|
23
23
|
[`border-${COMP}`]: `1px solid $color-border`,
|
|
@@ -165,10 +165,10 @@ exports.FormItemMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
165
165
|
themeVars: (0, themeVars_1.parseScssVar)(FormItem_module_scss_1.default.themeVars),
|
|
166
166
|
defaultThemeVars: {
|
|
167
167
|
"color-text-FormItemLabel": "$color-text-primary",
|
|
168
|
-
"
|
|
169
|
-
"
|
|
168
|
+
"fontSize-FormItemLabel": "$fontSize-small",
|
|
169
|
+
"fontWeight-FormItemLabel": "$fontWeight-medium",
|
|
170
170
|
"font-style-FormItemLabel": "normal",
|
|
171
|
-
"
|
|
171
|
+
"textTransform-FormItemLabel": "none",
|
|
172
172
|
"color-text-FormItemLabel-requiredMark": "$color-danger-400",
|
|
173
173
|
},
|
|
174
174
|
});
|
|
@@ -58,10 +58,10 @@ exports.HeadingMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
58
58
|
},
|
|
59
59
|
themeVars: (0, themeVars_1.parseScssVar)(Heading_module_scss_1.default.themeVars),
|
|
60
60
|
defaultThemeVars: {
|
|
61
|
-
[`
|
|
61
|
+
[`fontFamily-${COMP}`]: "$fontFamily",
|
|
62
62
|
[`color-text-${COMP}`]: "inherit",
|
|
63
|
-
[`
|
|
64
|
-
[`
|
|
63
|
+
[`fontWeight-${COMP}`]: "$fontWeight-bold",
|
|
64
|
+
[`letterSpacing-${COMP} `]: "0",
|
|
65
65
|
light: {
|
|
66
66
|
// --- No light-specific theme vars
|
|
67
67
|
},
|
|
@@ -81,10 +81,9 @@ exports.H1Md = (0, ComponentDefs_1.createMetadata)({
|
|
|
81
81
|
},
|
|
82
82
|
themeVars: (0, themeVars_1.parseScssVar)(Heading_module_scss_1.default.themeVars),
|
|
83
83
|
defaultThemeVars: {
|
|
84
|
-
|
|
85
|
-
[`
|
|
86
|
-
[`
|
|
87
|
-
[`margin-bottom-${H1}`]: "0",
|
|
84
|
+
[`fontSize-${H1}`]: "$fontSize-large",
|
|
85
|
+
[`marginTop-${H1}`]: "0",
|
|
86
|
+
[`marginBottom-${H1}`]: "0",
|
|
88
87
|
light: {
|
|
89
88
|
// --- No light-specific theme vars
|
|
90
89
|
},
|
|
@@ -104,10 +103,9 @@ exports.H2Md = (0, ComponentDefs_1.createMetadata)({
|
|
|
104
103
|
},
|
|
105
104
|
themeVars: (0, themeVars_1.parseScssVar)(Heading_module_scss_1.default.themeVars),
|
|
106
105
|
defaultThemeVars: {
|
|
107
|
-
|
|
108
|
-
[`
|
|
109
|
-
[`
|
|
110
|
-
[`margin-bottom-${H2}`]: "0",
|
|
106
|
+
[`fontSize-${H2}`]: "$fontSize-medium",
|
|
107
|
+
[`marginTop-${H2}`]: "0",
|
|
108
|
+
[`marginBottom-${H2}`]: "0",
|
|
111
109
|
light: {
|
|
112
110
|
// --- No light-specific theme vars
|
|
113
111
|
},
|
|
@@ -127,10 +125,9 @@ exports.H3Md = (0, ComponentDefs_1.createMetadata)({
|
|
|
127
125
|
},
|
|
128
126
|
themeVars: (0, themeVars_1.parseScssVar)(Heading_module_scss_1.default.themeVars),
|
|
129
127
|
defaultThemeVars: {
|
|
130
|
-
|
|
131
|
-
[`
|
|
132
|
-
[`
|
|
133
|
-
[`margin-bottom-${H3}`]: "0",
|
|
128
|
+
[`fontSize-${H3}`]: "$fontSize-normal",
|
|
129
|
+
[`marginTop-${H3}`]: "0",
|
|
130
|
+
[`marginBottom-${H3}`]: "0",
|
|
134
131
|
light: {
|
|
135
132
|
// --- No light-specific theme vars
|
|
136
133
|
},
|
|
@@ -150,10 +147,9 @@ exports.H4Md = (0, ComponentDefs_1.createMetadata)({
|
|
|
150
147
|
},
|
|
151
148
|
themeVars: (0, themeVars_1.parseScssVar)(Heading_module_scss_1.default.themeVars),
|
|
152
149
|
defaultThemeVars: {
|
|
153
|
-
|
|
154
|
-
[`
|
|
155
|
-
[`
|
|
156
|
-
[`margin-bottom-${H4}`]: "0",
|
|
150
|
+
[`fontSize-${H4}`]: "$fontSize-small",
|
|
151
|
+
[`marginTop-${H4}`]: "0",
|
|
152
|
+
[`marginBottom-${H4}`]: "0",
|
|
157
153
|
light: {
|
|
158
154
|
// --- No light-specific theme vars
|
|
159
155
|
},
|
|
@@ -173,10 +169,9 @@ exports.H5Md = (0, ComponentDefs_1.createMetadata)({
|
|
|
173
169
|
},
|
|
174
170
|
themeVars: (0, themeVars_1.parseScssVar)(Heading_module_scss_1.default.themeVars),
|
|
175
171
|
defaultThemeVars: {
|
|
176
|
-
|
|
177
|
-
[`
|
|
178
|
-
[`
|
|
179
|
-
[`margin-bottom-${H5}`]: "0",
|
|
172
|
+
[`fontSize-${H5}`]: "$fontSize-smaller",
|
|
173
|
+
[`marginTop-${H5}`]: "0",
|
|
174
|
+
[`marginBottom-${H5}`]: "0",
|
|
180
175
|
light: {
|
|
181
176
|
// --- No light-specific theme vars
|
|
182
177
|
},
|
|
@@ -196,10 +191,9 @@ exports.H6Md = (0, ComponentDefs_1.createMetadata)({
|
|
|
196
191
|
},
|
|
197
192
|
themeVars: (0, themeVars_1.parseScssVar)(Heading_module_scss_1.default.themeVars),
|
|
198
193
|
defaultThemeVars: {
|
|
199
|
-
|
|
200
|
-
[`
|
|
201
|
-
[`
|
|
202
|
-
[`margin-bottom-${H6}`]: "0",
|
|
194
|
+
[`fontSize-${H6}`]: "$fontSize-tiny",
|
|
195
|
+
[`marginTop-${H6}`]: "0",
|
|
196
|
+
[`marginBottom-${H6}`]: "0",
|
|
203
197
|
light: {
|
|
204
198
|
// --- No light-specific theme vars
|
|
205
199
|
},
|
|
@@ -22,6 +22,7 @@ const classnames_1 = __importDefault(require("classnames"));
|
|
|
22
22
|
const Heading_module_scss_1 = __importDefault(require("./Heading.module.scss"));
|
|
23
23
|
const css_utils_1 = require("../../components-core/utils/css-utils");
|
|
24
24
|
const TableOfContentsContext_1 = require("../../components-core/TableOfContentsContext");
|
|
25
|
+
const hooks_1 = require("../../components-core/utils/hooks");
|
|
25
26
|
const HeadingLevelKeys = ["h1", "h2", "h3", "h4", "h5", "h6"];
|
|
26
27
|
exports.defaultProps = {
|
|
27
28
|
level: "h1",
|
|
@@ -45,7 +46,7 @@ exports.Heading = (0, react_1.forwardRef)(function Heading(_a, forwardedRef) {
|
|
|
45
46
|
setAnchorId(newAnchorId || null);
|
|
46
47
|
}
|
|
47
48
|
}, [observeIntersection]);
|
|
48
|
-
(0,
|
|
49
|
+
(0, hooks_1.useIsomorphicLayoutEffect)(() => {
|
|
49
50
|
if (observeIntersection && elementRef.current && anchorId && !omitFromToc) {
|
|
50
51
|
return registerHeading === null || registerHeading === void 0 ? void 0 : registerHeading({
|
|
51
52
|
id: anchorId,
|