xmlui 0.9.49 → 0.9.50

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.
Files changed (33) hide show
  1. package/dist/lib/{apiInterceptorWorker-jUcCYRz4.mjs → apiInterceptorWorker-B6XqwxPF.mjs} +1 -1
  2. package/dist/lib/{index-Cm7mLpy4.mjs → index-BpQ3DEFQ.mjs} +4226 -4200
  3. package/dist/lib/index.css +1 -1
  4. package/dist/lib/language-server-web-worker.mjs +1 -1
  5. package/dist/lib/language-server.mjs +1 -1
  6. package/dist/lib/{metadata-utils-DiiTyP_-.mjs → metadata-utils-QekhOD-W.mjs} +1 -1
  7. package/dist/lib/{server-common-DJ9dCJkg.mjs → server-common-D4BcRpEl.mjs} +4232 -4202
  8. package/dist/lib/{transform-DU7v4c9h.mjs → transform-DXcw0gGl.mjs} +429 -428
  9. package/dist/lib/xmlui-parser.d.ts +2 -0
  10. package/dist/lib/xmlui-parser.mjs +2 -2
  11. package/dist/lib/{xmlui-serializer-B3OkRzrr.mjs → xmlui-serializer-CAZCkpXP.mjs} +1 -1
  12. package/dist/lib/xmlui.d.ts +2 -0
  13. package/dist/lib/xmlui.mjs +2 -2
  14. package/dist/metadata/style.css +1 -1
  15. package/dist/metadata/xmlui-metadata.mjs +1550 -1525
  16. package/dist/metadata/xmlui-metadata.umd.js +4 -4
  17. package/dist/scripts/package.json +1 -1
  18. package/dist/scripts/src/components/App/App.js +1 -0
  19. package/dist/scripts/src/components/Checkbox/Checkbox.js +1 -0
  20. package/dist/scripts/src/components/DropdownMenu/DropdownMenu.js +3 -0
  21. package/dist/scripts/src/components/Footer/Footer.js +1 -0
  22. package/dist/scripts/src/components/FormItem/FormItem.js +7 -0
  23. package/dist/scripts/src/components/Heading/Heading.js +1 -0
  24. package/dist/scripts/src/components/Link/Link.js +7 -7
  25. package/dist/scripts/src/components/Markdown/Markdown.js +4 -0
  26. package/dist/scripts/src/components/Markdown/MarkdownNative.js +2 -2
  27. package/dist/scripts/src/components/NavPanel/NavPanel.js +1 -0
  28. package/dist/scripts/src/components/Switch/Switch.js +1 -0
  29. package/dist/scripts/src/components/Text/Text.js +3 -0
  30. package/dist/scripts/src/parsers/xmlui-parser/transform.js +8 -0
  31. package/dist/standalone/xmlui-standalone.es.d.ts +2 -0
  32. package/dist/standalone/xmlui-standalone.umd.js +196 -196
  33. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xmlui",
3
- "version": "0.9.49",
3
+ "version": "0.9.50",
4
4
  "sideEffects": false,
5
5
  "scripts": {
6
6
  "start-test-bed": "cd src/testing/infrastructure && xmlui start",
@@ -78,6 +78,7 @@ exports.AppMd = (0, ComponentDefs_1.createMetadata)({
78
78
  ready: (0, ComponentDefs_1.d)(`This event fires when the \`${COMP}\` component finishes rendering on the page.`),
79
79
  },
80
80
  themeVars: (0, themeVars_1.parseScssVar)(App_module_scss_1.default.themeVars),
81
+ limitThemeVarsToComponent: true,
81
82
  themeVarDescriptions: {
82
83
  "maxWidth-content-App": "This theme variable defines the maximum width of the main content. If the main " +
83
84
  "content is broader, the engine adds margins to keep the expected maximum size.",
@@ -46,6 +46,7 @@ exports.CheckboxMd = (0, ComponentDefs_1.createMetadata)({
46
46
  setValue: (0, metadata_helpers_1.dSetValueApi)(),
47
47
  },
48
48
  themeVars: (0, themeVars_1.parseScssVar)(Toggle_module_scss_1.default.themeVars),
49
+ limitThemeVarsToComponent: true,
49
50
  defaultThemeVars: {
50
51
  [`borderColor-checked-${COMP}-error`]: `$borderColor-${COMP}-error`,
51
52
  [`backgroundColor-checked-${COMP}-error`]: `$borderColor-${COMP}-error`,
@@ -63,6 +63,7 @@ exports.DropdownMenuMd = (0, ComponentDefs_1.createMetadata)({
63
63
  close: (0, ComponentDefs_1.d)(`This method command closes the dropdown.`),
64
64
  },
65
65
  themeVars: (0, themeVars_1.parseScssVar)(DropdownMenu_module_scss_1.default.themeVars),
66
+ limitThemeVarsToComponent: true,
66
67
  defaultThemeVars: {
67
68
  [`backgroundColor-${DDMCOMP}`]: "$color-surface-raised",
68
69
  [`minWidth-${DDMCOMP}`]: "160px",
@@ -107,6 +108,7 @@ exports.MenuItemMd = (0, ComponentDefs_1.createMetadata)({
107
108
  click: (0, metadata_helpers_1.dClick)(MICOMP),
108
109
  },
109
110
  themeVars: (0, themeVars_1.parseScssVar)(DropdownMenu_module_scss_1.default.themeVars),
111
+ limitThemeVarsToComponent: true,
110
112
  defaultThemeVars: {
111
113
  [`backgroundColor-${MICOMP}`]: "$backgroundColor-dropdown-item",
112
114
  [`color-${MICOMP}`]: "$textColor-primary",
@@ -155,6 +157,7 @@ exports.MenuSeparatorMd = (0, ComponentDefs_1.createMetadata)({
155
157
  description: "This component displays a separator line between menu items.",
156
158
  docFolder: DDMCOMP,
157
159
  themeVars: (0, themeVars_1.parseScssVar)(DropdownMenu_module_scss_1.default.themeVars),
160
+ limitThemeVarsToComponent: true,
158
161
  defaultThemeVars: {
159
162
  [`marginTop-${MSEP}`]: "$space-1",
160
163
  [`marginBottom-${MSEP}`]: "$space-1",
@@ -14,6 +14,7 @@ const COMP = "Footer";
14
14
  exports.FooterMd = (0, ComponentDefs_1.createMetadata)({
15
15
  description: `The \`${COMP}\` is a component that acts as a placeholder within \`App\`.`,
16
16
  themeVars: (0, themeVars_1.parseScssVar)(Footer_module_scss_1.default.themeVars),
17
+ limitThemeVarsToComponent: true,
17
18
  defaultThemeVars: {
18
19
  [`backgroundColor-${COMP}`]: "$backgroundColor-AppHeader",
19
20
  [`verticalAlign-${COMP}`]: "center",
@@ -158,6 +158,13 @@ exports.FormItemMd = (0, ComponentDefs_1.createMetadata)({
158
158
  events: {
159
159
  validate: (0, ComponentDefs_1.d)(`This event is used to define a custom validation function.`),
160
160
  },
161
+ apis: {
162
+ addItem: (0, ComponentDefs_1.d)("Adds a new item to the `FormItem` data where the particular form item holds " +
163
+ "a list. The function has a single parameter, the data to add to the `FormItem`. " +
164
+ "The new item is appended to the end of the list."),
165
+ removeItem: (0, ComponentDefs_1.d)("Removes the item specified by its index from the list held by the FormItem. " +
166
+ "The function has a single argument, the index to remove."),
167
+ },
161
168
  contextVars: {
162
169
  $value: (0, ComponentDefs_1.d)(`The context variable represents the current value of the \`${COMP}\`. It can be used in ` +
163
170
  `expressions and code snippets within the \`${COMP}\` instance.`),
@@ -57,6 +57,7 @@ exports.HeadingMd = (0, ComponentDefs_1.createMetadata)({
57
57
  omitFromToc: OMIT_FROM_TOC_DESC,
58
58
  },
59
59
  themeVars: (0, themeVars_1.parseScssVar)(Heading_module_scss_1.default.themeVars),
60
+ limitThemeVarsToComponent: true,
60
61
  defaultThemeVars: {
61
62
  [`fontFamily-${COMP}`]: "$fontFamily",
62
63
  [`textColor-${COMP}`]: "inherit",
@@ -40,12 +40,13 @@ exports.LinkMd = (0, ComponentDefs_1.createMetadata)({
40
40
  },
41
41
  defaultThemeVars: {
42
42
  [`border-${COMP}`]: "0px solid $borderColor",
43
- [`textColor-${COMP}--hover--active`]: `$textColor-${COMP}--active`,
44
- [`textDecorationColor-${COMP}--hover`]: "$color-primary-400",
43
+ [`textColor-${COMP}`]: "$color-primary-500",
44
+ [`textDecorationColor-${COMP}`]: "$color-primary-500",
45
45
  [`textColor-${COMP}--hover`]: `$color-primary-400`,
46
- [`textDecorationColor-${COMP}--active`]: "$color-primary-200",
47
- [`fontWeight-${COMP}--active`]: "$fontWeight-bold",
48
- [`textDecorationColor-${COMP}`]: "$color-primary-400",
46
+ [`textDecorationColor-${COMP}--hover`]: "$color-primary-400",
47
+ [`textColor-${COMP}--active`]: "$color-primary-400",
48
+ [`textDecorationColor-${COMP}--active`]: "$color-primary-400",
49
+ [`textColor-${COMP}--hover--active`]: `$textColor-${COMP}--active`,
49
50
  [`textUnderlineOffset-${COMP}`]: "$space-1",
50
51
  [`textDecorationLine-${COMP}`]: "underline",
51
52
  [`textDecorationStyle-${COMP}`]: "solid",
@@ -54,10 +55,9 @@ exports.LinkMd = (0, ComponentDefs_1.createMetadata)({
54
55
  [`outlineStyle-${COMP}--focus`]: "$outlineStyle--focus",
55
56
  [`outlineOffset-${COMP}--focus`]: "$outlineOffset--focus",
56
57
  [`fontSize-${COMP}`]: "inherit",
58
+ [`fontWeight-${COMP}--active`]: "$fontWeight-bold",
57
59
  [`gap-icon-${COMP}`]: "$gap-tight",
58
60
  [`padding-icon-${COMP}`]: "$space-0_5",
59
- [`textColor-${COMP}`]: "$color-primary-500",
60
- [`textColor-${COMP}--active`]: "$color-primary-500",
61
61
  },
62
62
  });
63
63
  /**
@@ -65,6 +65,10 @@ exports.MarkdownMd = (0, ComponentDefs_1.createMetadata)({
65
65
  "accentColor-Blockquote": "$color-surface-500",
66
66
  "marginTop-HtmlLi": "$space-2_5",
67
67
  "marginBottom-HtmlLi": "$space-2_5",
68
+ "marginTop-Image-markdown": "$space-4",
69
+ "marginBottom-Image-markdown": "$space-4",
70
+ "marginLeft-Image-markdown": "$space-0",
71
+ "marginRight-Image-markdown": "$space-0",
68
72
  light: {
69
73
  // --- No light-specific theme vars
70
74
  },
@@ -174,10 +174,10 @@ exports.Markdown = (0, react_1.memo)(function Markdown({ removeIndents = true, c
174
174
  // Apply styling based on whether image should be inline or block
175
175
  const imgStyle = Object.assign(Object.assign({}, (props.style || {})), { display: isInline ? "inline" : "block" });
176
176
  if (popOut) {
177
- return ((0, jsx_runtime_1.jsx)("a", { href: src, target: "_blank", rel: "noreferrer", children: (0, jsx_runtime_1.jsx)("img", Object.assign({ src: src, alt: alt, className: HtmlTags_module_scss_1.default.htmlImage, style: imgStyle }, props, { children: children })) }));
177
+ return ((0, jsx_runtime_1.jsx)("a", { href: src, target: "_blank", rel: "noreferrer", children: (0, jsx_runtime_1.jsx)("img", Object.assign({ src: src, alt: alt, style: imgStyle }, props, { children: children })) }));
178
178
  }
179
179
  else {
180
- return ((0, jsx_runtime_1.jsx)("img", Object.assign({ src: src, alt: alt, className: HtmlTags_module_scss_1.default.htmlImage, style: imgStyle }, props, { children: children })));
180
+ return ((0, jsx_runtime_1.jsx)("img", Object.assign({ src: src, alt: alt, style: imgStyle }, props, { children: children })));
181
181
  }
182
182
  },
183
183
  h1({ children }) {
@@ -19,6 +19,7 @@ exports.NavPanelMd = (0, ComponentDefs_1.createMetadata)({
19
19
  `\`vertical\` and \`vertical-sticky\` layout.`),
20
20
  },
21
21
  themeVars: (0, themeVars_1.parseScssVar)(NavPanel_module_scss_1.default.themeVars),
22
+ limitThemeVarsToComponent: true,
22
23
  defaultThemeVars: {
23
24
  [`backgroundColor-${COMP}`]: "$backgroundColor",
24
25
  [`border-${COMP}`]: '0px solid $borderColor',
@@ -41,6 +41,7 @@ exports.SwitchMd = (0, ComponentDefs_1.createMetadata)({
41
41
  setValue: (0, metadata_helpers_1.dSetValueApi)(),
42
42
  },
43
43
  themeVars: (0, themeVars_1.parseScssVar)(Toggle_module_scss_1.default.themeVars),
44
+ limitThemeVarsToComponent: true,
44
45
  defaultThemeVars: {
45
46
  [`borderColor-checked-${COMP}-error`]: `$borderColor-${COMP}-error`,
46
47
  [`backgroundColor-checked-${COMP}-error`]: `$borderColor-${COMP}-error`,
@@ -117,6 +117,9 @@ exports.TextMd = (0, ComponentDefs_1.createMetadata)({
117
117
  [`color-${COMP}-codefence`]: "$color-surface-900",
118
118
  [`color-${COMP}-subheading`]: "$textColor-secondary",
119
119
  [`color-${COMP}-secondary`]: "$textColor-secondary",
120
+ dark: {
121
+ [`backgroundColor-${COMP}-marked`]: "rgba($color-primary-400-rgb, .4)",
122
+ }
120
123
  },
121
124
  });
122
125
  exports.textComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.TextMd, ({ node, extractValue, layoutCss, renderChild }) => {
@@ -88,6 +88,7 @@ function nodeToComponentDef(node, originalGetText, fileId) {
88
88
  if (!exports.UCRegex.test(compoundName.value)) {
89
89
  reportError("T004");
90
90
  }
91
+ const codeBehind = attrs.find((attr) => attr.name === "codeBehind");
91
92
  // --- Get "method" attributes
92
93
  let api;
93
94
  const apiAttrs = attrs.filter((attr) => attr.startSegment === "method");
@@ -159,6 +160,9 @@ function nodeToComponentDef(node, originalGetText, fileId) {
159
160
  if (vars) {
160
161
  nestedComponent.vars = Object.assign(Object.assign({}, nestedComponent.vars), vars);
161
162
  }
163
+ if (codeBehind) {
164
+ component.codeBehind = codeBehind.value;
165
+ }
162
166
  nestedComponent.debug = {
163
167
  source: {
164
168
  start: element.start,
@@ -328,6 +332,10 @@ function nodeToComponentDef(node, originalGetText, fileId) {
328
332
  // --- We already processed name
329
333
  return;
330
334
  }
335
+ if (name === "codeBehind" && !startSegment) {
336
+ // --- We already processed codeBehind
337
+ return;
338
+ }
331
339
  // --- Compound components do not have any other attributable props
332
340
  if (!startSegment && name) {
333
341
  reportError("T021", name);
@@ -680,6 +680,7 @@ declare type ComponentMetadata<TProps extends Record<string, ComponentPropertyMe
680
680
  themeVarDescriptions?: Record<string, string>;
681
681
  defaultThemeVars?: DefaultThemeVars;
682
682
  toneSpecificThemeVars?: Record<string, Record<string, string>>;
683
+ limitThemeVarsToComponent?: boolean;
683
684
  allowArbitraryProps?: boolean;
684
685
  specializedFrom?: string;
685
686
  docFolder?: string;
@@ -801,6 +802,7 @@ declare interface CompoundComponentDef extends Scriptable {
801
802
  * belonging to the particular component definition.
802
803
  */
803
804
  debug?: Record<string, any>;
805
+ codeBehind?: string;
804
806
  }
805
807
 
806
808
  declare type CONDITIONAL_EXPRESSION = typeof T_CONDITIONAL_EXPRESSION;