xmlui 0.9.65 → 0.9.67

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 (113) hide show
  1. package/dist/lib/{apiInterceptorWorker-COjte0L0.mjs → apiInterceptorWorker-JRzJvZYD.mjs} +1 -1
  2. package/dist/lib/{index-E-Ytu3U3.mjs → index-CcvStYZ-.mjs} +17090 -27060
  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-CeJek2aP.mjs → metadata-utils-Bes0jMw3.mjs} +1 -1
  7. package/dist/lib/{server-common-Dtnes4sR.mjs → server-common-LUcdzTQs.mjs} +4471 -4526
  8. package/dist/lib/{transform--lQ60cbR.mjs → transform-C_5kSXBN.mjs} +31 -4
  9. package/dist/lib/xmlui-parser.d.ts +7 -0
  10. package/dist/lib/xmlui-parser.mjs +2 -2
  11. package/dist/lib/{xmlui-serializer-B1QY_Hg9.mjs → xmlui-serializer-jEIItW8v.mjs} +1 -1
  12. package/dist/lib/xmlui.d.ts +16 -29
  13. package/dist/lib/xmlui.mjs +2 -2
  14. package/dist/metadata/{apiInterceptorWorker-BK3aQR7T.mjs → apiInterceptorWorker-CkH3kF96.mjs} +1 -1
  15. package/dist/metadata/{collectedComponentMetadata-yjl6u0V8.mjs → collectedComponentMetadata-BarV5tXf.mjs} +17610 -26338
  16. package/dist/metadata/style.css +1 -1
  17. package/dist/metadata/xmlui-metadata.mjs +1 -1
  18. package/dist/metadata/xmlui-metadata.umd.js +127 -134
  19. package/dist/scripts/package.json +6 -3
  20. package/dist/scripts/src/components/APICall/APICall.js +9 -8
  21. package/dist/scripts/src/components/Accordion/AccordionItem.js +1 -0
  22. package/dist/scripts/src/components/App/AppNative.js +10 -7
  23. package/dist/scripts/src/components/App/LinkInfoContext.js +9 -0
  24. package/dist/scripts/src/components/AppState/AppState.js +1 -0
  25. package/dist/scripts/src/components/AutoComplete/AutoComplete.js +2 -2
  26. package/dist/scripts/src/components/Avatar/Avatar.js +1 -0
  27. package/dist/scripts/src/components/Avatar/AvatarNative.js +16 -11
  28. package/dist/scripts/src/components/Bookmark/Bookmark.js +1 -0
  29. package/dist/scripts/src/components/Breakout/Breakout.js +1 -0
  30. package/dist/scripts/src/components/Button/Button.js +1 -1
  31. package/dist/scripts/src/components/Card/Card.js +1 -0
  32. package/dist/scripts/src/components/Carousel/CarouselItem.js +3 -1
  33. package/dist/scripts/src/components/ChangeListener/ChangeListener.js +1 -0
  34. package/dist/scripts/src/components/Charts/BarChart/BarChart.js +1 -1
  35. package/dist/scripts/src/components/Charts/BarChart/BarChartNative.js +85 -7
  36. package/dist/scripts/src/components/Charts/DonutChart/DonutChart.js +1 -1
  37. package/dist/scripts/src/components/Charts/LabelList/LabelList.js +1 -1
  38. package/dist/scripts/src/components/Charts/Legend/Legend.js +1 -1
  39. package/dist/scripts/src/components/Charts/LineChart/LineChart.js +1 -1
  40. package/dist/scripts/src/components/Charts/LineChart/LineChartNative.js +69 -18
  41. package/dist/scripts/src/components/Charts/PieChart/PieChart.js +1 -1
  42. package/dist/scripts/src/components/Charts/PieChart/PieChartNative.js +2 -2
  43. package/dist/scripts/src/components/Checkbox/Checkbox.js +1 -3
  44. package/dist/scripts/src/components/CodeBlock/CodeBlock.js +3 -1
  45. package/dist/scripts/src/components/CodeBlock/CodeBlockNative.js +2 -25
  46. package/dist/scripts/src/components/CodeBlock/highlight-code.js +102 -69
  47. package/dist/scripts/src/components/ColorPicker/ColorPicker.js +1 -0
  48. package/dist/scripts/src/components/Column/Column.js +1 -0
  49. package/dist/scripts/src/components/ContentSeparator/ContentSeparator.js +1 -0
  50. package/dist/scripts/src/components/DropdownMenu/DropdownMenu.js +4 -0
  51. package/dist/scripts/src/components/ExpandableItem/ExpandableItem.js +1 -0
  52. package/dist/scripts/src/components/FileUploadDropZone/FileUploadDropZone.js +1 -0
  53. package/dist/scripts/src/components/FlowLayout/FlowLayout.js +1 -0
  54. package/dist/scripts/src/components/Footer/Footer.js +1 -0
  55. package/dist/scripts/src/components/FormItem/FormItem.js +1 -3
  56. package/dist/scripts/src/components/Heading/Heading.js +7 -0
  57. package/dist/scripts/src/components/HelloWorld/HelloWorld.js +1 -1
  58. package/dist/scripts/src/components/HtmlTags/HtmlTags.js +114 -100
  59. package/dist/scripts/src/components/Image/Image.js +1 -0
  60. package/dist/scripts/src/components/Items/Items.js +1 -0
  61. package/dist/scripts/src/components/Link/Link.js +1 -0
  62. package/dist/scripts/src/components/Logo/Logo.js +6 -1
  63. package/dist/scripts/src/components/Logo/LogoNative.js +3 -2
  64. package/dist/scripts/src/components/Markdown/Markdown.js +1 -0
  65. package/dist/scripts/src/components/ModalDialog/ModalDialog.js +1 -0
  66. package/dist/scripts/src/components/NavGroup/NavGroup.js +1 -0
  67. package/dist/scripts/src/components/NavLink/NavLink.js +1 -0
  68. package/dist/scripts/src/components/NavPanel/NavPanel.js +9 -2
  69. package/dist/scripts/src/components/NavPanel/NavPanelNative.js +10 -9
  70. package/dist/scripts/src/components/NestedApp/AppWithCodeView.js +1 -1
  71. package/dist/scripts/src/components/NestedApp/AppWithCodeViewNative.js +5 -14
  72. package/dist/scripts/src/components/NestedApp/NestedApp.js +1 -0
  73. package/dist/scripts/src/components/NestedApp/NestedAppNative.js +2 -1
  74. package/dist/scripts/src/components/NoResult/NoResult.js +1 -0
  75. package/dist/scripts/src/components/Option/Option.js +1 -0
  76. package/dist/scripts/src/components/PageMetaTitle/PageMetaTitle.js +1 -0
  77. package/dist/scripts/src/components/Pages/Pages.js +1 -0
  78. package/dist/scripts/src/components/Pages/PagesNative.js +2 -7
  79. package/dist/scripts/src/components/ProgressBar/ProgressBar.js +1 -0
  80. package/dist/scripts/src/components/Queue/Queue.js +1 -0
  81. package/dist/scripts/src/components/RadioGroup/RadioGroup.js +1 -0
  82. package/dist/scripts/src/components/RadioGroup/RadioGroupNative.js +6 -4
  83. package/dist/scripts/src/components/RadioGroup/RadioItem.js +5 -2
  84. package/dist/scripts/src/components/RadioGroup/RadioItemNative.js +11 -3
  85. package/dist/scripts/src/components/Redirect/Redirect.js +1 -0
  86. package/dist/scripts/src/components/Select/Select.js +2 -2
  87. package/dist/scripts/src/components/SpaceFiller/SpaceFiller.js +1 -0
  88. package/dist/scripts/src/components/Spinner/Spinner.js +1 -0
  89. package/dist/scripts/src/components/Splitter/Splitter.js +1 -0
  90. package/dist/scripts/src/components/Stack/Stack.js +1 -0
  91. package/dist/scripts/src/components/Switch/Switch.js +1 -0
  92. package/dist/scripts/src/components/Table/Table.js +1 -0
  93. package/dist/scripts/src/components/TableEditor/TableEditor.js +1 -1
  94. package/dist/scripts/src/components/TableOfContents/TableOfContents.js +1 -1
  95. package/dist/scripts/src/components/Tabs/TabItem.js +1 -0
  96. package/dist/scripts/src/components/Tabs/TabItemNative.js +1 -2
  97. package/dist/scripts/src/components/Tabs/Tabs.js +1 -5
  98. package/dist/scripts/src/components/Text/Text.js +1 -0
  99. package/dist/scripts/src/components/Theme/Theme.js +1 -0
  100. package/dist/scripts/src/components/Toggle/Toggle.js +1 -0
  101. package/dist/scripts/src/components/ValidationSummary/ValidationSummary.js +62 -3
  102. package/dist/scripts/src/components-core/Fragment.js +1 -0
  103. package/dist/scripts/src/components-core/XmluiCodeHighlighter.js +3 -1
  104. package/dist/scripts/src/components-core/loader/ApiLoader.js +1 -0
  105. package/dist/scripts/src/components-core/loader/DataLoader.js +1 -0
  106. package/dist/scripts/src/components-core/loader/ExternalDataLoader.js +1 -0
  107. package/dist/scripts/src/components-core/loader/MockLoaderRenderer.js +1 -0
  108. package/dist/scripts/src/components-core/rendering/StateContainer.js +11 -7
  109. package/dist/scripts/src/parsers/xmlui-parser/transform.js +28 -0
  110. package/dist/standalone/xmlui-standalone.es.d.ts +18 -29
  111. package/dist/standalone/xmlui-standalone.umd.js +243 -243
  112. package/package.json +6 -3
  113. package/dist/scripts/src/components/ValidationSummary/ValidationSummaryNative.js +0 -64
@@ -13,10 +13,10 @@ const renderers_1 = require("../../../components-core/renderers");
13
13
  const metadata_helpers_1 = require("../../metadata-helpers");
14
14
  const COMP = "PieChart";
15
15
  exports.PieChartMd = (0, metadata_helpers_1.createMetadata)({
16
+ status: "experimental",
16
17
  description: "`PieChart` visualizes proportional data as circular segments; each slice " +
17
18
  "represents a percentage of the whole. Note that the height of the component or " +
18
19
  "its parent needs to be set explicitly.",
19
- status: "experimental",
20
20
  docFolder: "Charts/PieChart",
21
21
  props: {
22
22
  data: {
@@ -41,10 +41,10 @@ exports.PieChart = PieChart;
41
41
  const jsx_runtime_1 = require("react/jsx-runtime");
42
42
  const recharts_1 = require("recharts");
43
43
  const PieChartNative_module_scss_1 = __importDefault(require("./PieChartNative.module.scss"));
44
- const xmlui_1 = require("xmlui");
45
44
  const react_1 = require("react");
46
45
  const ChartProvider_1 = __importStar(require("../utils/ChartProvider"));
47
46
  const TooltipContent_1 = require("../Tooltip/TooltipContent");
47
+ const ThemeContext_1 = require("../../../components-core/theming/ThemeContext");
48
48
  exports.defaultProps = {
49
49
  showLabel: true,
50
50
  showLabelList: false,
@@ -74,7 +74,7 @@ const renderActiveShape = (props) => {
74
74
  return ((0, jsx_runtime_1.jsxs)("g", { children: [(0, jsx_runtime_1.jsx)(recharts_1.Sector, { cx: cx, cy: cy, innerRadius: innerRadius, outerRadius: outerRadius + 10, startAngle: startAngle, endAngle: endAngle, fill: fill }), (0, jsx_runtime_1.jsx)(recharts_1.Sector, { cx: cx, cy: cy, startAngle: startAngle, endAngle: endAngle, innerRadius: outerRadius + 6, outerRadius: outerRadius + 10, fill: fill })] }));
75
75
  };
76
76
  function PieChart({ data, dataKey, nameKey, style, showLabel = exports.defaultProps.showLabel, showLabelList = exports.defaultProps.showLabelList, labelListPosition = exports.defaultProps.labelListPosition, innerRadius = exports.defaultProps.innerRadius, children, outerRadius = "60%", showLegend = exports.defaultProps.showLegend, }) {
77
- const { getThemeVar } = (0, xmlui_1.useTheme)();
77
+ const { getThemeVar } = (0, ThemeContext_1.useTheme)();
78
78
  const colorValues = (0, react_1.useMemo)(() => {
79
79
  return [
80
80
  getThemeVar("color-primary-500"),
@@ -31,9 +31,7 @@ exports.CheckboxMd = (0, metadata_helpers_1.createMetadata)({
31
31
  validationStatus: (0, metadata_helpers_1.dValidationStatus)(Toggle_1.defaultProps.validationStatus),
32
32
  description: (0, metadata_helpers_1.dInternal)(`(*** NOT IMPLEMENTED YET ***) This optional property displays an alternate description ` +
33
33
  `of the ${COMP} besides its label.`),
34
- inputTemplate: {
35
- description: "This property is used to define a custom checkbox input template",
36
- },
34
+ inputTemplate: (0, metadata_helpers_1.dComponent)("This property is used to define a custom checkbox input template"),
37
35
  },
38
36
  childrenAsTemplate: "inputTemplate",
39
37
  events: {
@@ -12,8 +12,8 @@ const CodeBlockNative_1 = require("./CodeBlockNative");
12
12
  const metadata_helpers_1 = require("../metadata-helpers");
13
13
  const COMP = "CodeBlock";
14
14
  exports.CodeBlockMd = (0, metadata_helpers_1.createMetadata)({
15
+ status: "stable",
15
16
  description: `The \`${COMP}\` component displays code with optional syntax highlighting and meta information.`,
16
- status: "in progress",
17
17
  props: {},
18
18
  themeVars: (0, themeVars_1.parseScssVar)(CodeBlock_module_scss_1.default.themeVars),
19
19
  defaultThemeVars: {
@@ -28,6 +28,8 @@ exports.CodeBlockMd = (0, metadata_helpers_1.createMetadata)({
28
28
  "borderRadius-CodeBlock": "$space-2",
29
29
  "boxShadow-CodeBlock": "none",
30
30
  "height-CodeBlock": "fit-content",
31
+ "paddingVertical-content-CodeBlock": "0",
32
+ "paddingHorizontal-content-CodeBlock": "0",
31
33
  dark: {
32
34
  "backgroundColor-CodeBlock-header": "$color-surface-200",
33
35
  "backgroundColor-CodeBlock": "$color-surface-50",
@@ -5,8 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.defaultProps = void 0;
7
7
  exports.CodeBlock = CodeBlock;
8
- exports.isBrowser = isBrowser;
9
- exports.decodeValue = decodeValue;
10
8
  exports.markdownCodeBlockParser = markdownCodeBlockParser;
11
9
  const jsx_runtime_1 = require("react/jsx-runtime");
12
10
  const CodeBlock_module_scss_1 = __importDefault(require("./CodeBlock.module.scss"));
@@ -30,27 +28,6 @@ function CodeBlock({ children, meta, textToCopy, style }) {
30
28
  react_hot_toast_1.default.success("Code copied!");
31
29
  } }) })] })] }));
32
30
  }
33
- /*
34
- * Check if global object window is defined
35
- */
36
- function isBrowser() {
37
- return typeof window !== 'undefined';
38
- }
39
- /*
40
- * Decode base64 value, returns string
41
- * @Params: string
42
- */
43
- function decodeValue(value) {
44
- if (!value) {
45
- return null;
46
- }
47
- const valueToString = value.toString();
48
- if (isBrowser()) {
49
- return window.btoa(valueToString);
50
- }
51
- const buff = Buffer.from(valueToString, 'ascii');
52
- return buff.toString('base64');
53
- }
54
31
  function markdownCodeBlockParser() {
55
32
  return function transformer(tree) {
56
33
  (0, unist_util_visit_1.visit)(tree, "code", visitor);
@@ -89,7 +66,7 @@ function markdownCodeBlockParser() {
89
66
  }
90
67
  if (item.startsWith("/") && item.endsWith("/")) {
91
68
  const unparsedSubstrings = acc[highlight_code_1.CodeHighlighterMetaKeys.highlightSubstrings.data];
92
- const newItemBase64 = decodeValue(item.substring(1, item.length - 1));
69
+ const newItemBase64 = (0, highlight_code_1.encodeToBase64)(item.substring(1, item.length - 1));
93
70
  if (!unparsedSubstrings) {
94
71
  acc[highlight_code_1.CodeHighlighterMetaKeys.highlightSubstrings.data] = newItemBase64;
95
72
  }
@@ -100,7 +77,7 @@ function markdownCodeBlockParser() {
100
77
  }
101
78
  if (item.startsWith("!/") && item.endsWith("/")) {
102
79
  const unparsedSubstrings = acc[highlight_code_1.CodeHighlighterMetaKeys.highlightSubstringsEmphasized.data];
103
- const newItemBase64 = decodeValue(item.substring(2, item.length - 1));
80
+ const newItemBase64 = (0, highlight_code_1.encodeToBase64)(item.substring(2, item.length - 1));
104
81
  if (!unparsedSubstrings) {
105
82
  acc[highlight_code_1.CodeHighlighterMetaKeys.highlightSubstringsEmphasized.data] = newItemBase64;
106
83
  }
@@ -12,22 +12,38 @@ var __rest = (this && this.__rest) || function (s, e) {
12
12
  };
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
14
  exports.CodeHighlighterMetaKeysData = exports.CodeHighlighterMetaKeys = void 0;
15
- exports.encodeValue = encodeValue;
15
+ exports.encodeToBase64 = encodeToBase64;
16
+ exports.decodeFromBase64 = decodeFromBase64;
16
17
  exports.parseMetaAndHighlightCode = parseMetaAndHighlightCode;
18
+ exports.transformCodeLines = transformCodeLines;
19
+ exports.extractMetaFromChildren = extractMetaFromChildren;
17
20
  exports.isCodeHighlighter = isCodeHighlighter;
18
21
  const react_1 = require("react");
19
22
  const highlightRowsClass = "codeBlockHighlightRow";
20
23
  const highlightSubstringsClass = "codeBlockHighlightString";
21
24
  const highlightSubstringsEmphasisClass = "codeBlockHighlightStringEmphasis";
22
- /*
23
- * Encode string, returns base64 value
24
- * @Params: string
25
+ /**
26
+ * Encode string to ASCII base64 value
25
27
  */
26
- function encodeValue(value) {
28
+ function encodeToBase64(value) {
27
29
  if (!value) {
28
30
  return null;
29
31
  }
30
- const valueToString = value.toString();
32
+ const valueToString = typeof value === "object" ? JSON.stringify(value) : value.toString();
33
+ if (typeof window !== 'undefined') {
34
+ return window.btoa(valueToString);
35
+ }
36
+ const buff = Buffer.from(valueToString, 'ascii');
37
+ return buff.toString('base64');
38
+ }
39
+ /**
40
+ * Decode base64 value to string
41
+ */
42
+ function decodeFromBase64(value) {
43
+ if (!value) {
44
+ return null;
45
+ }
46
+ const valueToString = typeof value === "object" ? JSON.stringify(value) : value.toString();
31
47
  if (typeof window !== "undefined") {
32
48
  return window.atob(valueToString);
33
49
  }
@@ -43,8 +59,12 @@ function encodeValue(value) {
43
59
  * @returns CSS class names for the codefence and the HTML string with highlighted code tokens
44
60
  */
45
61
  function parseMetaAndHighlightCode(node, codeHighlighter, themeTone) {
46
- const codeStr = mapTextContent(node);
47
- const meta = extractMetaFromChildren(node, exports.CodeHighlighterMetaKeysData, codeStr);
62
+ // parse
63
+ const rawCodeStr = getCodeStrFromNode(node);
64
+ const rawMeta = getCodeMetaFromNode(node, exports.CodeHighlighterMetaKeysData);
65
+ // map
66
+ const codeStr = transformCodeLines(rawCodeStr);
67
+ const meta = extractMetaFromChildren(rawMeta, codeStr);
48
68
  const { language } = meta, restMeta = __rest(meta, ["language"]);
49
69
  if (language && codeHighlighter.availableLangs.includes(language)) {
50
70
  // NOTE: Keep in mind, at this point, we are working with the markdown text
@@ -61,48 +81,19 @@ function parseMetaAndHighlightCode(node, codeHighlighter, themeTone) {
61
81
  }
62
82
  return null;
63
83
  }
64
- function mapTextContent(node) {
84
+ function getCodeStrFromNode(node) {
65
85
  if (typeof node === "string") {
66
- return transformCodeLines(node);
86
+ return node;
67
87
  }
68
88
  if ((0, react_1.isValidElement)(node) && node.props && node.props.children) {
69
89
  if (Array.isArray(node.props.children)) {
70
- return node.props.children.map(mapTextContent).join("");
90
+ return node.props.children.map(getCodeStrFromNode).join("");
71
91
  }
72
- return mapTextContent(node.props.children);
92
+ return getCodeStrFromNode(node.props.children);
73
93
  }
74
94
  return "";
75
- // ---
76
- function transformCodeLines(node) {
77
- const splitNode = node.split(/\r?\n/);
78
- for (let i = 0; i < splitNode.length; i++) {
79
- // Backslash before a codefence indicates an escaped codefence
80
- // -> don't render the backslash
81
- if (splitNode[i].startsWith("\\```")) {
82
- splitNode[i] = splitNode[i].replace("\\```", "```");
83
- }
84
- }
85
- // Remove empty lines from start and end
86
- let startTrimIdx = 0;
87
- let endTrimIdx = splitNode.length - 1;
88
- for (let i = 0; i < splitNode.length; i++) {
89
- if (splitNode[i].trim() !== "") {
90
- startTrimIdx = i;
91
- break;
92
- }
93
- }
94
- for (let i = splitNode.length - 1; i >= 0; i--) {
95
- if (splitNode[i].trim() !== "") {
96
- endTrimIdx = i;
97
- break;
98
- }
99
- }
100
- splitNode.splice(0, startTrimIdx);
101
- splitNode.splice(endTrimIdx + 1);
102
- return splitNode.join("\n");
103
- }
104
95
  }
105
- function extractMetaFromChildren(node, keys, code = "") {
96
+ function getCodeMetaFromNode(node, keys) {
106
97
  if (!node)
107
98
  return {};
108
99
  if (typeof node === "string")
@@ -117,27 +108,59 @@ function extractMetaFromChildren(node, keys, code = "") {
117
108
  node.props &&
118
109
  node.props.children &&
119
110
  typeof node.props.children === "string") {
120
- const meta = Object.entries(node.props)
111
+ return Object.entries(node.props)
121
112
  .filter(([key, _]) => keys.includes(key))
122
113
  .reduce((acc, [key, value]) => {
123
114
  acc[key] = value;
124
115
  return acc;
125
116
  }, {});
126
- return {
127
- [exports.CodeHighlighterMetaKeys.language.prop]: meta[exports.CodeHighlighterMetaKeys.language.data],
128
- [exports.CodeHighlighterMetaKeys.copy.prop]: parseBoolean(meta[exports.CodeHighlighterMetaKeys.copy.data]),
129
- [exports.CodeHighlighterMetaKeys.filename.prop]: meta[exports.CodeHighlighterMetaKeys.filename.data],
130
- // NOTE: Row numbers are disabled for now, because applying the highlight class removes the "numbered" class
131
- /* [CodeHighlighterMetaKeys.rowNumbers.prop]: parseBoolean(
132
- meta[CodeHighlighterMetaKeys.rowNumbers.data],
133
- ), */
134
- [exports.CodeHighlighterMetaKeys.highlightRows.prop]: parseRowHighlights(code, meta[exports.CodeHighlighterMetaKeys.highlightRows.data]),
135
- [exports.CodeHighlighterMetaKeys.highlightSubstrings.prop]: parseSubstringHighlights(code, meta[exports.CodeHighlighterMetaKeys.highlightSubstrings.data]),
136
- [exports.CodeHighlighterMetaKeys.highlightSubstringsEmphasized.prop]: parseSubstringHighlights(code, meta[exports.CodeHighlighterMetaKeys.highlightSubstringsEmphasized.data], true),
137
- };
138
117
  }
139
118
  return {};
140
119
  }
120
+ function transformCodeLines(node) {
121
+ const splitNode = node.split(/\r?\n/);
122
+ for (let i = 0; i < splitNode.length; i++) {
123
+ // Backslash before a codefence indicates an escaped codefence
124
+ // -> don't render the backslash
125
+ if (splitNode[i].startsWith("\\```")) {
126
+ splitNode[i] = splitNode[i].replace("\\```", "```");
127
+ }
128
+ }
129
+ // Remove empty lines from start and end
130
+ let startTrimIdx = 0;
131
+ let endTrimIdx = splitNode.length - 1;
132
+ for (let i = 0; i < splitNode.length; i++) {
133
+ if (splitNode[i].trim() !== "") {
134
+ startTrimIdx = i;
135
+ break;
136
+ }
137
+ }
138
+ for (let i = splitNode.length - 1; i >= 0; i--) {
139
+ if (splitNode[i].trim() !== "") {
140
+ endTrimIdx = i;
141
+ break;
142
+ }
143
+ }
144
+ splitNode.splice(0, startTrimIdx);
145
+ splitNode.splice(endTrimIdx + 1);
146
+ return splitNode.join("\n");
147
+ }
148
+ function extractMetaFromChildren(meta, code = "") {
149
+ if (!meta)
150
+ return {};
151
+ return {
152
+ // NOTE: Row numbers are disabled for now, because applying the highlight class removes the "numbered" class
153
+ /* [CodeHighlighterMetaKeys.rowNumbers.prop]: parseBoolean(
154
+ meta[CodeHighlighterMetaKeys.rowNumbers.data],
155
+ ), */
156
+ [exports.CodeHighlighterMetaKeys.language.prop]: meta[exports.CodeHighlighterMetaKeys.language.data],
157
+ [exports.CodeHighlighterMetaKeys.copy.prop]: parseBoolean(meta[exports.CodeHighlighterMetaKeys.copy.data]),
158
+ [exports.CodeHighlighterMetaKeys.filename.prop]: meta[exports.CodeHighlighterMetaKeys.filename.data],
159
+ [exports.CodeHighlighterMetaKeys.highlightRows.prop]: parseRowHighlights(code, meta[exports.CodeHighlighterMetaKeys.highlightRows.data]),
160
+ [exports.CodeHighlighterMetaKeys.highlightSubstrings.prop]: parseSubstringHighlights(code, meta[exports.CodeHighlighterMetaKeys.highlightSubstrings.data]),
161
+ [exports.CodeHighlighterMetaKeys.highlightSubstringsEmphasized.prop]: parseSubstringHighlights(code, meta[exports.CodeHighlighterMetaKeys.highlightSubstringsEmphasized.data], true),
162
+ };
163
+ }
141
164
  function parseBoolean(str) {
142
165
  if (str === "true")
143
166
  return true;
@@ -156,22 +179,28 @@ function parseRowHighlights(code, str) {
156
179
  .map((item) => {
157
180
  item = item.trim();
158
181
  const split = item.split("-");
159
- let start = 0;
160
- let end = 0;
182
+ let start = -1;
183
+ let end = -1;
161
184
  if (split.length === 0)
162
185
  return { start, end, properties: { class: highlightRowsClass } };
186
+ if (split.length > 2)
187
+ return { start, end, properties: { class: highlightRowsClass } };
188
+ if (split[0] === "")
189
+ return { start, end, properties: { class: highlightRowsClass } };
190
+ if (split[1] === "")
191
+ return { start, end, properties: { class: highlightRowsClass } };
192
+ start = 0;
193
+ end = 0;
163
194
  // Start Index
164
- const startIdx = parseAndValidate(split[0]) - 1;
165
- if (startIdx > 0) {
166
- start = getLineStartIndex(startIdx);
167
- }
195
+ const startIdx = validate(parse(split[0]));
196
+ start = getLineLengthIndex(startIdx);
168
197
  // End Index
169
- const endIdx = split.length === 1 ? startIdx : parseAndValidate(split[1]) - 1;
198
+ const endIdx = split.length === 1 ? startIdx : validate(parse(split[1]));
170
199
  let endLineLength = 0;
171
200
  if (endIdx >= 0 && codeLines[endIdx] !== undefined) {
172
201
  endLineLength = codeLines[endIdx].length;
173
202
  }
174
- end = getLineStartIndex(endIdx) + endLineLength;
203
+ end = getLineLengthIndex(endIdx) + endLineLength;
175
204
  return { start, end, properties: { class: highlightRowsClass } };
176
205
  })
177
206
  .filter((item) => {
@@ -181,17 +210,21 @@ function parseRowHighlights(code, str) {
181
210
  return false;
182
211
  return true;
183
212
  });
184
- function parseAndValidate(value) {
213
+ function parse(value) {
185
214
  const parsed = parseInt(value, 10);
186
215
  if (Number.isNaN(parsed))
187
216
  return -1;
188
- if (parsed <= 0)
189
- return -1;
190
- if (parsed > codeLines.length)
217
+ return parsed;
218
+ }
219
+ function validate(parsed) {
220
+ // correct for 0-indexed array
221
+ parsed -= 1;
222
+ // check bounds
223
+ if (parsed < 0 || parsed >= codeLines.length)
191
224
  return -1;
192
225
  return parsed;
193
226
  }
194
- function getLineStartIndex(lineNumber) {
227
+ function getLineLengthIndex(lineNumber) {
195
228
  if (lineNumber < 0)
196
229
  return -1;
197
230
  if (lineNumber === 0)
@@ -215,7 +248,7 @@ function parseSubstringHighlights(code, str, emphasized = false) {
215
248
  return [];
216
249
  return str
217
250
  .split(" ")
218
- .map((item) => encodeValue(item))
251
+ .map((item) => decodeFromBase64(item))
219
252
  .filter((item) => item.trim() !== "")
220
253
  .reduce((acc, item) => acc.concat(findAllNonOverlappingSubstrings(code, item)), []);
221
254
  function findAllNonOverlappingSubstrings(str, code) {
@@ -12,6 +12,7 @@ const themeVars_1 = require("../../components-core/theming/themeVars");
12
12
  const ColorPicker_module_scss_1 = __importDefault(require("./ColorPicker.module.scss"));
13
13
  const COMP = "ColorPicker";
14
14
  exports.ColorPickerMd = (0, metadata_helpers_1.createMetadata)({
15
+ status: "stable",
15
16
  description: "`ColorPicker` enables users to choose colors by specifying RGB, HSL, or HEX values.",
16
17
  props: {
17
18
  initialValue: (0, metadata_helpers_1.dInitialValue)(),
@@ -7,6 +7,7 @@ const metadata_helpers_1 = require("../metadata-helpers");
7
7
  const ColumnNative_1 = require("./ColumnNative");
8
8
  const COMP = "Column";
9
9
  exports.ColumnMd = (0, metadata_helpers_1.createMetadata)({
10
+ status: "stable",
10
11
  description: "`Column` defines the structure and behavior of individual table columns " +
11
12
  "within a [`Table`](/components/Table) component. Each Column controls data " +
12
13
  "binding, header display, sorting capabilities, sizing, and can contain any " +
@@ -13,6 +13,7 @@ const ContentSeparatorNative_1 = require("./ContentSeparatorNative");
13
13
  const metadata_helpers_1 = require("../metadata-helpers");
14
14
  const COMP = "ContentSeparator";
15
15
  exports.ContentSeparatorMd = (0, metadata_helpers_1.createMetadata)({
16
+ status: "stable",
16
17
  description: "`ContentSeparator` creates visual dividers between content sections using " +
17
18
  "horizontal or vertical lines. It's essential for improving readability by " +
18
19
  "breaking up dense content, separating list items, or creating clear boundaries " +
@@ -14,6 +14,7 @@ const IconNative_1 = require("../Icon/IconNative");
14
14
  const DropdownMenuNative_1 = require("./DropdownMenuNative");
15
15
  const DDMCOMP = "DropdownMenu";
16
16
  exports.DropdownMenuMd = (0, metadata_helpers_1.createMetadata)({
17
+ status: "stable",
17
18
  description: "`DropdownMenu` provides a space-efficient way to present multiple options or " +
18
19
  "actions through a collapsible interface. When clicked, the trigger button reveals " +
19
20
  "a menu that can include items, separators, and nested submenus, making it ideal " +
@@ -80,6 +81,7 @@ exports.dropdownMenuComponentRenderer = (0, renderers_1.createComponentRenderer)
80
81
  });
81
82
  const MICOMP = "MenuItem";
82
83
  exports.MenuItemMd = (0, metadata_helpers_1.createMetadata)({
84
+ status: "stable",
83
85
  description: "`MenuItem` represents individual clickable items within dropdown menus and other " +
84
86
  "menu components. Each menu item can display text, icons, and respond to clicks " +
85
87
  "with either navigation or custom actions, making it the building block for " +
@@ -146,6 +148,7 @@ exports.menuItemRenderer = (0, renderers_1.createComponentRenderer)(MICOMP, expo
146
148
  });
147
149
  const SMCOMP = "SubMenuItem";
148
150
  exports.SubMenuItemMd = (0, metadata_helpers_1.createMetadata)({
151
+ status: "stable",
149
152
  description: "`SubMenuItem` creates hierarchical menu structures by acting as both a menu " +
150
153
  "item and a container for nested menu items. When clicked or hovered, it reveals " +
151
154
  "a submenu containing additional [MenuItem](/components/MenuItem), " +
@@ -164,6 +167,7 @@ exports.subMenuItemRenderer = (0, renderers_1.createComponentRenderer)(SMCOMP, e
164
167
  });
165
168
  const MSEP = "MenuSeparator";
166
169
  exports.MenuSeparatorMd = (0, metadata_helpers_1.createMetadata)({
170
+ status: "stable",
167
171
  description: "`MenuSeparator` displays a separator line between menu items to group related " +
168
172
  "menu options within `DropdownMenu`.",
169
173
  docFolder: DDMCOMP,
@@ -13,6 +13,7 @@ const metadata_helpers_1 = require("../../components/metadata-helpers");
13
13
  const ExpandableItemNative_1 = require("./ExpandableItemNative");
14
14
  const COMP = "ExpandableItem";
15
15
  exports.ExpandableItemMd = (0, metadata_helpers_1.createMetadata)({
16
+ status: "stable",
16
17
  description: "`ExpandableItem` creates expandable/collapsible section, similar to the HTML " +
17
18
  "details disclosure element. When the user clicks on the `summary` the content " +
18
19
  "expands or collapses.",
@@ -12,6 +12,7 @@ const FileUploadDropZoneNative_1 = require("./FileUploadDropZoneNative");
12
12
  const metadata_helpers_1 = require("../metadata-helpers");
13
13
  const COMP = "FileUploadDropZone";
14
14
  exports.FileUploadDropZoneMd = (0, metadata_helpers_1.createMetadata)({
15
+ status: "stable",
15
16
  description: "`FileUploadDropZone` enables users to upload files by dragging and dropping " +
16
17
  "files from their local file system onto a designated area within the UI.",
17
18
  props: {
@@ -14,6 +14,7 @@ const FlowLayoutNative_1 = require("./FlowLayoutNative");
14
14
  const metadata_helpers_1 = require("../metadata-helpers");
15
15
  const COMP = "FlowLayout";
16
16
  exports.FlowLayoutMd = (0, metadata_helpers_1.createMetadata)({
17
+ status: "stable",
17
18
  description: "`FlowLayout` positions content in rows with automatic wrapping. When items " +
18
19
  "exceed the available horizontal space, they automatically wrap to a new line.",
19
20
  props: {
@@ -12,6 +12,7 @@ const FooterNative_1 = require("./FooterNative");
12
12
  const metadata_helpers_1 = require("../metadata-helpers");
13
13
  const COMP = "Footer";
14
14
  exports.FooterMd = (0, metadata_helpers_1.createMetadata)({
15
+ status: "stable",
15
16
  description: "`Footer` provides a designated area at the bottom of your application for " +
16
17
  "footer content such as branding, copyright notices, or utility controls like " +
17
18
  "theme toggles.",
@@ -157,9 +157,7 @@ exports.FormItemMd = (0, metadata_helpers_1.createMetadata)({
157
157
  availableValues: filteredValidationSeverityValues,
158
158
  defaultValue: "error",
159
159
  },
160
- inputTemplate: {
161
- description: "This property is used to define a custom input template.",
162
- },
160
+ inputTemplate: (0, metadata_helpers_1.dComponent)("This property is used to define a custom input template."),
163
161
  gap: {
164
162
  description: "This property defines the gap between the adornments and the input area.",
165
163
  valueType: "string",
@@ -44,6 +44,7 @@ const OMIT_FROM_TOC_DESC = {
44
44
  defaultValue: HeadingNative_1.defaultProps.omitFromToc,
45
45
  };
46
46
  exports.HeadingMd = (0, metadata_helpers_1.createMetadata)({
47
+ status: "stable",
47
48
  description: "`Heading` displays hierarchical text headings with semantic importance levels " +
48
49
  "from H1 to H6, following HTML heading standards. It provides text overflow " +
49
50
  "handling, anchor link generation, and integrates with " +
@@ -85,6 +86,7 @@ exports.HeadingMd = (0, metadata_helpers_1.createMetadata)({
85
86
  });
86
87
  const H1 = "H1";
87
88
  exports.H1Md = (0, metadata_helpers_1.createMetadata)({
89
+ status: "stable",
88
90
  description: LEVEL_DESC(1),
89
91
  specializedFrom: COMP,
90
92
  props: {
@@ -110,6 +112,7 @@ exports.H1Md = (0, metadata_helpers_1.createMetadata)({
110
112
  });
111
113
  const H2 = "H2";
112
114
  exports.H2Md = (0, metadata_helpers_1.createMetadata)({
115
+ status: "stable",
113
116
  description: LEVEL_DESC(2),
114
117
  specializedFrom: COMP,
115
118
  props: {
@@ -134,6 +137,7 @@ exports.H2Md = (0, metadata_helpers_1.createMetadata)({
134
137
  });
135
138
  const H3 = "H3";
136
139
  exports.H3Md = (0, metadata_helpers_1.createMetadata)({
140
+ status: "stable",
137
141
  description: LEVEL_DESC(3),
138
142
  specializedFrom: COMP,
139
143
  props: {
@@ -158,6 +162,7 @@ exports.H3Md = (0, metadata_helpers_1.createMetadata)({
158
162
  });
159
163
  const H4 = "H4";
160
164
  exports.H4Md = (0, metadata_helpers_1.createMetadata)({
165
+ status: "stable",
161
166
  description: LEVEL_DESC(4),
162
167
  specializedFrom: COMP,
163
168
  props: {
@@ -182,6 +187,7 @@ exports.H4Md = (0, metadata_helpers_1.createMetadata)({
182
187
  });
183
188
  const H5 = "H5";
184
189
  exports.H5Md = (0, metadata_helpers_1.createMetadata)({
190
+ status: "stable",
185
191
  description: LEVEL_DESC(5),
186
192
  specializedFrom: COMP,
187
193
  props: {
@@ -206,6 +212,7 @@ exports.H5Md = (0, metadata_helpers_1.createMetadata)({
206
212
  });
207
213
  const H6 = "H6";
208
214
  exports.H6Md = (0, metadata_helpers_1.createMetadata)({
215
+ status: "stable",
209
216
  description: LEVEL_DESC(6),
210
217
  specializedFrom: COMP,
211
218
  props: {
@@ -12,9 +12,9 @@ const metadata_helpers_1 = require("../metadata-helpers");
12
12
  const HelloWorldNative_1 = require("./HelloWorldNative");
13
13
  const COMP = "HelloWorld";
14
14
  exports.HelloWorldMd = (0, metadata_helpers_1.createMetadata)({
15
+ status: "experimental",
15
16
  description: "`HelloWorld` is a demonstration component that shows basic XMLUI patterns. " +
16
17
  "It displays a customizable greeting message with an interactive click counter.",
17
- status: "experimental",
18
18
  props: {
19
19
  id: {
20
20
  description: "The unique identifier for the component.",