xmlui 0.9.25 → 0.9.30
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-CFF3bC6o.mjs → lib/apiInterceptorWorker-D8UVXhKa.mjs} +1 -1
- package/dist/{index-DtxDGaqF.mjs → lib/index-BF7GNHsi.mjs} +307 -185
- package/dist/{index.css → lib/index.css} +266 -162
- package/dist/lib/language-server-web-worker.d.ts +655 -0
- package/dist/{language-server-web-worker.mjs → lib/language-server-web-worker.mjs} +1 -1
- package/dist/lib/language-server.d.ts +657 -0
- package/dist/{language-server.mjs → lib/language-server.mjs} +1 -1
- package/dist/{server-common-9TiLMTJj.mjs → lib/server-common-B0FCNpIT.mjs} +4255 -1594
- package/dist/{xmlui-parser.d.ts → lib/xmlui-parser.d.ts} +633 -0
- package/dist/{xmlui.d.ts → lib/xmlui.d.ts} +638 -0
- package/dist/{xmlui.mjs → lib/xmlui.mjs} +1 -1
- package/dist/{style.css → metadata/style.css} +252 -156
- package/dist/{xmlui-metadata.mjs → metadata/xmlui-metadata.mjs} +126 -102
- package/dist/{xmlui-metadata.umd.js → metadata/xmlui-metadata.umd.js} +126 -102
- package/dist/scripts/package.json +37 -44
- package/dist/scripts/src/components/Bookmark/BookmarkNative.js +2 -2
- package/dist/scripts/src/components/CodeBlock/CodeBlock.js +7 -3
- package/dist/scripts/src/components/CodeBlock/CodeBlockNative.js +23 -4
- package/dist/scripts/src/components/CodeBlock/highlight-code.js +203 -0
- package/dist/scripts/src/components/FormItem/FormItemNative.js +0 -1
- package/dist/scripts/src/components/Heading/Heading.js +3 -0
- package/dist/scripts/src/components/Heading/HeadingNative.js +1 -1
- package/dist/scripts/src/components/HtmlTags/HtmlTags.js +6 -6
- package/dist/scripts/src/components/Markdown/Markdown.js +5 -1
- package/dist/scripts/src/components/Markdown/MarkdownNative.js +41 -9
- package/dist/scripts/src/components/RadioGroup/RadioGroup.js +2 -1
- package/dist/scripts/src/components/RadioGroup/RadioGroupNative.js +17 -1
- package/dist/scripts/src/components/Switch/Switch.js +5 -3
- package/dist/scripts/src/components/Text/Text.js +4 -9
- package/dist/standalone/xmlui-standalone.es.d.ts +2812 -0
- package/dist/{xmlui-standalone.umd.js → standalone/xmlui-standalone.umd.js} +611 -379
- package/package.json +30 -34
- package/dist/language-server-web-worker.d.ts +0 -22
- package/dist/language-server.d.ts +0 -24
- /package/dist/{core-XLM8cuFP.mjs → lib/core-XLM8cuFP.mjs} +0 -0
- /package/dist/{grammar.tmLanguage-CiEHpsbo.mjs → lib/grammar.tmLanguage-CiEHpsbo.mjs} +0 -0
- /package/dist/{lint-CYAUfk0_.mjs → lib/lint-CYAUfk0_.mjs} +0 -0
- /package/dist/{metadata-utils-CCIMqe69.mjs → lib/metadata-utils-CCIMqe69.mjs} +0 -0
- /package/dist/{transform-DC0Gy6qw.mjs → lib/transform-DC0Gy6qw.mjs} +0 -0
- /package/dist/{wasm-DDgzZJey.mjs → lib/wasm-DDgzZJey.mjs} +0 -0
- /package/dist/{xmlui-h2uM9PUY.mjs → lib/xmlui-h2uM9PUY.mjs} +0 -0
- /package/dist/{xmlui-parser.mjs → lib/xmlui-parser.mjs} +0 -0
|
@@ -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 = 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"));
|
|
@@ -89,16 +90,31 @@ exports.RadioGroup = (0, react_1.forwardRef)(function RadioGroup({ id, value = "
|
|
|
89
90
|
[RadioGroup_module_scss_1.default.disabled]: !enabled,
|
|
90
91
|
}), children: children }) }) }) }));
|
|
91
92
|
});
|
|
93
|
+
function useRadioGroupValue() {
|
|
94
|
+
const context = (0, react_1.useContext)(RadioGroupValidationStatusContext);
|
|
95
|
+
if (!context) {
|
|
96
|
+
throw new Error("useRadioGroupValue must be used within a RadioGroup");
|
|
97
|
+
}
|
|
98
|
+
const { value } = context;
|
|
99
|
+
const isChecked = (0, react_1.useCallback)((optionValue) => value === optionValue, [value]);
|
|
100
|
+
return {
|
|
101
|
+
value,
|
|
102
|
+
isChecked,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
92
105
|
const RadioGroupOption = ({ value, label, enabled = true, optionRenderer, style, }) => {
|
|
93
106
|
const id = (0, react_1.useId)();
|
|
94
107
|
const validationContext = (0, react_1.useContext)(RadioGroupValidationStatusContext);
|
|
108
|
+
const { isChecked } = useRadioGroupValue();
|
|
95
109
|
const statusStyles = (0, react_1.useMemo)(() => ({
|
|
96
110
|
[RadioGroup_module_scss_1.default.disabled]: !enabled,
|
|
97
111
|
[RadioGroup_module_scss_1.default.error]: value === validationContext.value && validationContext.status === "error",
|
|
98
112
|
[RadioGroup_module_scss_1.default.warning]: value === validationContext.value && validationContext.status === "warning",
|
|
99
113
|
[RadioGroup_module_scss_1.default.valid]: value === validationContext.value && validationContext.status === "valid",
|
|
100
114
|
}), [enabled, validationContext.status, validationContext.value, value]);
|
|
101
|
-
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
|
|
115
|
+
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, {
|
|
116
|
+
[RadioGroup_module_scss_1.default.checked]: isChecked(value),
|
|
117
|
+
}), 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]);
|
|
102
118
|
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({
|
|
103
119
|
$checked: value === validationContext.value,
|
|
104
120
|
})] })) : (item) }, id));
|
|
@@ -48,9 +48,11 @@ exports.SwitchMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
48
48
|
[`backgroundColor-checked-${COMP}-warning`]: `$borderColor-${COMP}-warning`,
|
|
49
49
|
[`borderColor-checked-${COMP}-success`]: `$borderColor-${COMP}-success`,
|
|
50
50
|
[`backgroundColor-checked-${COMP}-success`]: `$borderColor-${COMP}-success`,
|
|
51
|
-
[`backgroundColor-${COMP}`]: "$
|
|
52
|
-
[`borderColor-${COMP}`]: "$color-surface-
|
|
53
|
-
[`
|
|
51
|
+
[`backgroundColor-${COMP}`]: "$backgroundColor-primary",
|
|
52
|
+
[`borderColor-${COMP}`]: "$color-surface-200",
|
|
53
|
+
[`borderWidth-${COMP}`]: "1px",
|
|
54
|
+
[`backgroundColor-indicator-${COMP}`]: "$color-surface-200",
|
|
55
|
+
[`backgroundColor-indicator-checked-${COMP}`]: "$backgroundColor-primary",
|
|
54
56
|
[`borderColor-checked-${COMP}`]: "$color-primary-500",
|
|
55
57
|
[`backgroundColor-checked-${COMP}`]: "$color-primary-500",
|
|
56
58
|
[`backgroundColor-${COMP}--disabled`]: "$color-surface-200",
|
|
@@ -69,8 +69,6 @@ exports.TextMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
69
69
|
[`borderStyle-${COMP}-code`]: "solid",
|
|
70
70
|
[`borderRadius-${COMP}-code`]: "4px",
|
|
71
71
|
[`paddingHorizontal-${COMP}-code`]: "$space-1",
|
|
72
|
-
[`marginLeft-${COMP}-code`]: "$space-1",
|
|
73
|
-
[`marginRight-${COMP}-code`]: "$space-1",
|
|
74
72
|
[`paddingBottom-${COMP}-code`]: "2px",
|
|
75
73
|
[`textDecorationLine-${COMP}-deleted`]: "line-through",
|
|
76
74
|
[`textDecorationLine-${COMP}-inserted`]: "underline",
|
|
@@ -86,6 +84,7 @@ exports.TextMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
86
84
|
[`fontSize-${COMP}-sub`]: "$fontSize-smaller",
|
|
87
85
|
[`verticalAlign-${COMP}-sub`]: "sub",
|
|
88
86
|
[`fontStyle-${COMP}-var`]: "italic",
|
|
87
|
+
[`fontStyle-${COMP}-em`]: "italic",
|
|
89
88
|
[`fontFamily-${COMP}-mono`]: "$fontFamily-monospace",
|
|
90
89
|
[`fontSize-${COMP}-title`]: "$fontSize-large",
|
|
91
90
|
[`fontSize-${COMP}-subtitle`]: "$fontSize-medium",
|
|
@@ -108,19 +107,15 @@ exports.TextMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
108
107
|
[`marginTop-${COMP}-markdown`]: "$space-3",
|
|
109
108
|
[`marginBottom-${COMP}-markdown`]: "$space-6",
|
|
110
109
|
[`fontSize-${COMP}-markdown`]: "$fontSize-normal",
|
|
111
|
-
[`backgroundColor-${COMP}-code`]: "$color-surface-100",
|
|
112
|
-
[`borderColor-${COMP}-code`]: "$color-surface-
|
|
113
|
-
[`backgroundColor-${COMP}-keyboard`]: "$color-surface-
|
|
110
|
+
[`backgroundColor-${COMP}-code`]: "rgba($color-surface-100-rgb, .4)",
|
|
111
|
+
[`borderColor-${COMP}-code`]: "$color-surface-300",
|
|
112
|
+
[`backgroundColor-${COMP}-keyboard`]: "rgba($color-surface-100-rgb, .4)",
|
|
114
113
|
[`borderColor-${COMP}-keyboard`]: "$color-surface-300",
|
|
115
114
|
[`backgroundColor-${COMP}-marked`]: "yellow",
|
|
116
115
|
[`color-${COMP}-placeholder`]: "$color-surface-500",
|
|
117
|
-
[`backgroundColor-${COMP}-codefence`]: "#f2f7fc",
|
|
118
116
|
[`color-${COMP}-codefence`]: "$color-surface-900",
|
|
119
117
|
[`color-${COMP}-subheading`]: "$textColor-secondary",
|
|
120
118
|
[`color-${COMP}-secondary`]: "$textColor-secondary",
|
|
121
|
-
dark: {
|
|
122
|
-
[`backgroundColor-${COMP}-codefence`]: "#112033",
|
|
123
|
-
}
|
|
124
119
|
},
|
|
125
120
|
});
|
|
126
121
|
exports.textComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.TextMd, ({ node, extractValue, layoutCss, renderChild }) => {
|