xmlui 0.9.21 → 0.9.25

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 (102) hide show
  1. package/dist/apiInterceptorWorker-CFF3bC6o.mjs +818 -0
  2. package/dist/{index-B3CWFAxa.mjs → index-DtxDGaqF.mjs} +11942 -3291
  3. package/dist/index.css +1301 -564
  4. package/dist/language-server-web-worker.mjs +1 -1
  5. package/dist/language-server.mjs +1 -1
  6. package/dist/lint-CYAUfk0_.mjs +168 -0
  7. package/dist/metadata-utils-CCIMqe69.mjs +466 -0
  8. package/dist/scripts/package.json +252 -0
  9. package/dist/scripts/src/components/App/AppLayoutContext.js +0 -1
  10. package/dist/scripts/src/components/App/AppNative.js +21 -9
  11. package/dist/scripts/src/components/AppHeader/AppHeader.js +1 -1
  12. package/dist/scripts/src/components/AutoComplete/AutoComplete.js +5 -2
  13. package/dist/scripts/src/components/AutoComplete/AutoCompleteNative.js +13 -10
  14. package/dist/scripts/src/components/Bookmark/BookmarkNative.js +5 -1
  15. package/dist/scripts/src/components/CodeBlock/CodeBlock.js +31 -0
  16. package/dist/scripts/src/components/CodeBlock/CodeBlockNative.js +82 -0
  17. package/dist/scripts/src/components/ComponentProvider.js +5 -0
  18. package/dist/scripts/src/components/DatePicker/DatePickerNative.js +1 -0
  19. package/dist/scripts/src/components/Form/FormContext.js +5 -4
  20. package/dist/scripts/src/components/Form/FormNative.js +41 -43
  21. package/dist/scripts/src/components/Form/formActions.js +1 -1
  22. package/dist/scripts/src/components/FormItem/FormItem.js +6 -3
  23. package/dist/scripts/src/components/FormItem/FormItemNative.js +56 -15
  24. package/dist/scripts/src/components/FormItem/ItemWithLabel.js +1 -1
  25. package/dist/scripts/src/components/Heading/Heading.js +13 -0
  26. package/dist/scripts/src/components/Heading/HeadingNative.js +1 -1
  27. package/dist/scripts/src/components/HtmlTags/HtmlTags.js +7 -3
  28. package/dist/scripts/src/components/Icon/DarkToLightIcon.js +10 -0
  29. package/dist/scripts/src/components/Icon/LightToDark.js +10 -0
  30. package/dist/scripts/src/components/IconProvider.js +4 -0
  31. package/dist/scripts/src/components/Image/ImageNative.js +1 -1
  32. package/dist/scripts/src/components/Items/ItemsNative.js +8 -6
  33. package/dist/scripts/src/components/Link/Link.js +5 -5
  34. package/dist/scripts/src/components/List/ListNative.js +1 -1
  35. package/dist/scripts/src/components/Markdown/Markdown.js +52 -16
  36. package/dist/scripts/src/components/Markdown/MarkdownNative.js +34 -73
  37. package/dist/scripts/src/components/Markdown/highlight-code.js +160 -0
  38. package/dist/scripts/src/components/Markdown/parse-binding-expr.js +60 -0
  39. package/dist/scripts/src/components/Markdown/utils.js +282 -0
  40. package/dist/scripts/src/components/ModalDialog/ConfirmationModalContextProvider.js +116 -0
  41. package/dist/scripts/src/components/ModalDialog/Dialog.js +20 -0
  42. package/dist/scripts/src/components/NavGroup/NavGroupNative.js +4 -5
  43. package/dist/scripts/src/components/NestedApp/NestedApp.js +61 -0
  44. package/dist/scripts/src/components/NestedApp/NestedAppNative.js +125 -0
  45. package/dist/scripts/src/components/NestedApp/Tooltip.js +46 -0
  46. package/dist/scripts/src/components/NumberBox/NumberBox.js +4 -1
  47. package/dist/scripts/src/components/NumberBox/NumberBoxNative.js +2 -2
  48. package/dist/scripts/src/components/Option/Option.js +3 -2
  49. package/dist/scripts/src/components/Select/Select.js +5 -3
  50. package/dist/scripts/src/components/Select/SelectNative.js +53 -40
  51. package/dist/scripts/src/components/SelectionStore/SelectionStore.js +1 -1
  52. package/dist/scripts/src/components/Spinner/Spinner.js +0 -1
  53. package/dist/scripts/src/components/TableOfContents/TableOfContents.js +1 -0
  54. package/dist/scripts/src/components/Text/Text.js +12 -1
  55. package/dist/scripts/src/components/Text/TextNative.js +5 -1
  56. package/dist/scripts/src/components/TextBox/TextBox.js +6 -1
  57. package/dist/scripts/src/components/TextBox/TextBoxNative.js +2 -2
  58. package/dist/scripts/src/components/Theme/ThemeNative.js +7 -3
  59. package/dist/scripts/src/components/ToneChangerButton/ToneChangerButton.js +1 -3
  60. package/dist/scripts/src/components-core/RestApiProxy.js +10 -7
  61. package/dist/scripts/src/components-core/TableOfContentsContext.js +1 -1
  62. package/dist/scripts/src/components-core/appContext/date-functions.js +23 -0
  63. package/dist/scripts/src/components-core/appContext/math-function.js +27 -0
  64. package/dist/scripts/src/components-core/appContext/misc-utils.js +13 -0
  65. package/dist/scripts/src/components-core/interception/ApiInterceptor.js +199 -0
  66. package/dist/scripts/src/components-core/interception/ApiInterceptorProvider.js +94 -0
  67. package/dist/scripts/src/components-core/interception/Backend.js +128 -0
  68. package/dist/scripts/src/components-core/interception/Errors.js +129 -0
  69. package/dist/scripts/src/components-core/interception/InMemoryDb.js +41 -0
  70. package/dist/scripts/src/components-core/interception/IndexedDb.js +207 -0
  71. package/dist/scripts/src/components-core/interception/ReadonlyCollection.js +145 -0
  72. package/dist/scripts/src/components-core/interception/abstractions.js +2 -0
  73. package/dist/scripts/src/components-core/interception/apiInterceptorWorker.js +46 -0
  74. package/dist/scripts/src/components-core/interception/useApiInterceptorContext.js +9 -0
  75. package/dist/scripts/src/components-core/rendering/AppContent.js +336 -0
  76. package/dist/scripts/src/components-core/rendering/AppRoot.js +84 -0
  77. package/dist/scripts/src/components-core/rendering/AppWrapper.js +49 -0
  78. package/dist/scripts/src/components-core/rendering/ComponentAdapter.js +17 -7
  79. package/dist/scripts/src/components-core/rendering/Container.js +2 -1
  80. package/dist/scripts/src/components-core/theming/ThemeProvider.js +2 -7
  81. package/dist/scripts/src/components-core/theming/themes/root.js +1 -0
  82. package/dist/scripts/src/components-core/utils/date-utils.js +78 -0
  83. package/dist/scripts/src/components-core/utils/hooks.js +26 -0
  84. package/dist/scripts/src/components-core/utils/misc.js +1 -1
  85. package/dist/scripts/src/components-core/utils/request-params.js +70 -0
  86. package/dist/scripts/src/logging/LoggerContext.js +22 -0
  87. package/dist/scripts/src/logging/LoggerInitializer.js +14 -0
  88. package/dist/scripts/src/logging/LoggerService.js +60 -0
  89. package/dist/scripts/src/parsers/xmlui-parser/transform.js +7 -0
  90. package/dist/{server-common-DW5h7Q34.mjs → server-common-9TiLMTJj.mjs} +106 -98
  91. package/dist/style.css +3314 -2823
  92. package/dist/{lint-EcgF-9Wr.mjs → transform-DC0Gy6qw.mjs} +1246 -540
  93. package/dist/xmlui-metadata.mjs +2850 -2665
  94. package/dist/xmlui-metadata.umd.js +2850 -2665
  95. package/dist/xmlui-parser.d.ts +49 -4
  96. package/dist/xmlui-parser.mjs +49 -48
  97. package/dist/xmlui-standalone.umd.js +34674 -31457
  98. package/dist/xmlui.d.ts +3 -1
  99. package/dist/xmlui.mjs +10 -10
  100. package/package.json +3 -1
  101. package/dist/apiInterceptorWorker-7aKQ2rBj.mjs +0 -8447
  102. package/dist/parser-CBXS8ft2.mjs +0 -1196
@@ -1,4 +1,4 @@
1
- import { m as main, s as start } from "./server-common-DW5h7Q34.mjs";
1
+ import { m as main, s as start } from "./server-common-9TiLMTJj.mjs";
2
2
  var browser = main;
3
3
  const messageReader = new browser.BrowserMessageReader(self);
4
4
  messageReader.listen((message) => {
@@ -1,4 +1,4 @@
1
- import { m as main, s as start$1 } from "./server-common-DW5h7Q34.mjs";
1
+ import { m as main, s as start$1 } from "./server-common-9TiLMTJj.mjs";
2
2
  var node = main;
3
3
  function start() {
4
4
  const connection = node.createConnection(node.ProposedFeatures.all);
@@ -0,0 +1,168 @@
1
+ import { al as CORE_NAMESPACE_VALUE } from "./transform-DC0Gy6qw.mjs";
2
+ const componentFileExtension = "xmlui";
3
+ const codeBehindFileExtension = "xmlui.xs";
4
+ const moduleFileExtension = "xs";
5
+ var LintSeverity = /* @__PURE__ */ ((LintSeverity2) => {
6
+ LintSeverity2[LintSeverity2["Skip"] = 0] = "Skip";
7
+ LintSeverity2[LintSeverity2["Warning"] = 1] = "Warning";
8
+ LintSeverity2[LintSeverity2["Error"] = 2] = "Error";
9
+ return LintSeverity2;
10
+ })(LintSeverity || {});
11
+ var LintDiagKind = /* @__PURE__ */ ((LintDiagKind2) => {
12
+ LintDiagKind2[LintDiagKind2["UnrecognisedProp"] = 0] = "UnrecognisedProp";
13
+ return LintDiagKind2;
14
+ })(LintDiagKind || {});
15
+ function getLintSeverity(lintSeverityOption) {
16
+ if (!lintSeverityOption) {
17
+ return 1;
18
+ }
19
+ switch (lintSeverityOption.toLowerCase()) {
20
+ case "warning":
21
+ return 1;
22
+ case "error":
23
+ return 2;
24
+ case "skip":
25
+ return 0;
26
+ default:
27
+ console.warn(`Invalid lint severity option '${lintSeverityOption}'. Must be one of: 'warning', 'error', 'skip'. Defaulting to 'warning'.`);
28
+ return 1;
29
+ }
30
+ }
31
+ function lintApp({
32
+ appDef,
33
+ metadataProvider
34
+ }) {
35
+ const entryPointLints = {
36
+ componentName: "Main",
37
+ lints: lint({
38
+ component: appDef.entryPoint,
39
+ metadataProvider
40
+ })
41
+ };
42
+ const compoundCompLints = (appDef.components ?? []).map((c) => {
43
+ const lints = lint({
44
+ component: c,
45
+ metadataProvider
46
+ });
47
+ return { lints, componentName: c.name };
48
+ });
49
+ return [entryPointLints, ...compoundCompLints].filter((diags) => diags.lints.length > 0);
50
+ }
51
+ function printComponentLints(lintDiags) {
52
+ console.group(`Validation on '${lintDiags.componentName}':`);
53
+ lintDiags.lints.forEach(({ message }) => {
54
+ console.warn(message);
55
+ });
56
+ console.groupEnd();
57
+ }
58
+ function lintErrorsComponent(lints) {
59
+ function makeComponent() {
60
+ const errList = lints.map((lint2, idx) => {
61
+ return {
62
+ type: "VStack",
63
+ props: { gap: "0px" },
64
+ children: [
65
+ {
66
+ type: "VStack",
67
+ props: { "backgroundColor": "lightgrey", padding: "10px" },
68
+ children: [
69
+ {
70
+ type: "H2",
71
+ props: {
72
+ value: `#${idx + 1}: In component '${lint2.componentName}':`,
73
+ color: "$color-info"
74
+ }
75
+ },
76
+ {
77
+ type: "VStack",
78
+ children: lint2.lints.map(({ message }, msgIdx) => {
79
+ return {
80
+ type: "Text",
81
+ props: { value: `${idx + 1}.${msgIdx + 1}: ${message}`, fontWeight: "bold" }
82
+ };
83
+ })
84
+ }
85
+ ]
86
+ }
87
+ ]
88
+ };
89
+ });
90
+ const comp = {
91
+ type: "VStack",
92
+ props: { padding: "$padding-normal", gap: 0 },
93
+ children: [
94
+ {
95
+ type: "H1",
96
+ props: {
97
+ value: `Errors found while checking Xmlui markup`,
98
+ padding: "$padding-normal",
99
+ backgroundColor: "$color-error",
100
+ color: "white"
101
+ }
102
+ },
103
+ {
104
+ type: "VStack",
105
+ props: {
106
+ gap: "$gap-tight",
107
+ padding: "$padding-normal"
108
+ },
109
+ children: errList
110
+ }
111
+ ]
112
+ };
113
+ return comp;
114
+ }
115
+ return makeComponent();
116
+ }
117
+ function lint({
118
+ component,
119
+ metadataProvider
120
+ }) {
121
+ if ("component" in component) {
122
+ return lintHelp(component.component, metadataProvider, []);
123
+ }
124
+ return lintHelp(component, metadataProvider, []);
125
+ }
126
+ function lintHelp(component, metadataProvider, acc) {
127
+ const componentName = component.type.startsWith(CORE_NAMESPACE_VALUE) ? component.type.slice(CORE_NAMESPACE_VALUE.length + 1) : component.type;
128
+ const componentMdProvider = metadataProvider.getComponent(componentName);
129
+ if (componentMdProvider !== null && !componentMdProvider.allowArbitraryProps) {
130
+ lintAttrs(component, componentMdProvider, acc);
131
+ }
132
+ if (!component.children) {
133
+ return acc;
134
+ }
135
+ for (const child of component.children) {
136
+ lintHelp(child, metadataProvider, acc);
137
+ }
138
+ return acc;
139
+ }
140
+ function lintAttrs(component, metadataForCurrentComponent, diags) {
141
+ const invalidAttrNames = Object.keys(component.props ?? {}).filter((name) => !metadataForCurrentComponent.getAttr(name));
142
+ const invalidEvents = Object.keys(component.events ?? {}).filter((event) => !metadataForCurrentComponent.getEvent(event));
143
+ const invalidApis = Object.keys(component.api ?? {}).filter((api) => !metadataForCurrentComponent.getApi(api));
144
+ invalidAttrNames.push(...invalidEvents);
145
+ invalidAttrNames.push(...invalidApis);
146
+ for (const invalidAttrName of invalidAttrNames) {
147
+ diags.push(toUnrecognisedAttrDiag(component, invalidAttrName));
148
+ }
149
+ }
150
+ function toUnrecognisedAttrDiag(component, attr) {
151
+ return {
152
+ message: `Unrecognised property '${attr}' on component '${component.type}'.`,
153
+ kind: 0
154
+ /* UnrecognisedProp */
155
+ };
156
+ }
157
+ export {
158
+ LintSeverity as L,
159
+ codeBehindFileExtension as a,
160
+ lintErrorsComponent as b,
161
+ componentFileExtension as c,
162
+ LintDiagKind as d,
163
+ lint as e,
164
+ getLintSeverity as g,
165
+ lintApp as l,
166
+ moduleFileExtension as m,
167
+ printComponentLints as p
168
+ };
@@ -0,0 +1,466 @@
1
+ import { ak as onPrefixRegex, am as stripOnPrefix } from "./transform-DC0Gy6qw.mjs";
2
+ const LinkTargetMd = [
3
+ {
4
+ value: "_self",
5
+ description: "The link will open in the same frame as it was clicked."
6
+ },
7
+ {
8
+ value: "_blank",
9
+ description: "The link will open in a new window or tab."
10
+ },
11
+ {
12
+ value: "_parent",
13
+ description: "The link will open in the parent frame. If no parent, behaves as _self."
14
+ },
15
+ {
16
+ value: "_top",
17
+ description: "The topmost browsing context. The link will open in the full body of the window. If no ancestors, behaves as _self."
18
+ },
19
+ {
20
+ value: "_unfencedTop",
21
+ description: "Allows embedded fenced frames to navigate the top-level frame, i.e. traversing beyond the root of the fenced frame."
22
+ }
23
+ ];
24
+ const viewportSizeMd = [
25
+ {
26
+ value: "xs",
27
+ description: "Extra small devices (e.g., a small smartphone with low screen resolution)"
28
+ },
29
+ { value: "sm", description: "Small devices (e.g., a smartphone in landscape view)" },
30
+ { value: "md", description: "Medium devices (e.g., a tablet)" },
31
+ { value: "lg", description: "Large devices (e.g., a laptop)" },
32
+ { value: "xl", description: 'Extra large devices (e.g., a standard 20" monitor)' },
33
+ { value: "xxl", description: 'Extra extra large devices (e.g., a large 29" monitor)' }
34
+ ];
35
+ const viewportSizeNames = Object.keys(viewportSizeMd);
36
+ const sizeMd = [
37
+ { value: "xs", description: "Extra small button" },
38
+ { value: "sm", description: "Small button" },
39
+ { value: "md", description: "Medium button" },
40
+ { value: "lg", description: "Large button" }
41
+ ];
42
+ const sizeValues = Object.keys(sizeMd);
43
+ [...sizeValues];
44
+ const buttonThemeValues = ["attention", "primary", "secondary"];
45
+ const buttonThemeNames = [...buttonThemeValues];
46
+ const buttonThemeMd = [
47
+ { value: "attention", description: "Attention state theme color" },
48
+ { value: "primary", description: "Primary theme color" },
49
+ { value: "secondary", description: "Secondary theme color" }
50
+ ];
51
+ const buttonTypesMd = [
52
+ {
53
+ value: "button",
54
+ description: "Regular behavior that only executes logic if explicitly determined."
55
+ },
56
+ {
57
+ value: "submit",
58
+ description: "The button submits the form data to the server. This is the default for buttons in a Form or NativeForm component."
59
+ },
60
+ {
61
+ value: "reset",
62
+ description: "Resets all the controls to their initial values. Using it is ill advised for UX reasons."
63
+ }
64
+ ];
65
+ const buttonVariantValues = ["solid", "outlined", "ghost"];
66
+ const buttonVariantNames = [...buttonVariantValues];
67
+ const buttonVariantMd = [
68
+ { value: "solid", description: "A button with a border and a filled background." },
69
+ {
70
+ value: "outlined",
71
+ description: "The button is displayed with a border and a transparent background."
72
+ },
73
+ {
74
+ value: "ghost",
75
+ description: "A button with no border and fill. Only the label is visible; the background is colored when hovered or clicked."
76
+ }
77
+ ];
78
+ const alignmentOptionValues = ["start", "center", "end"];
79
+ [...alignmentOptionValues];
80
+ const alignmentOptionMd = [
81
+ { value: "center", description: "Place the content in the middle" },
82
+ {
83
+ value: "start",
84
+ description: "Justify the content to the left (to the right if in right-to-left)"
85
+ },
86
+ {
87
+ value: "end",
88
+ description: "Justify the content to the right (to the left if in right-to-left)"
89
+ }
90
+ ];
91
+ const orientationOptionMd = [
92
+ { value: "horizontal", description: "The component will fill the available space horizontally" },
93
+ { value: "vertical", description: "The component will fill the available space vertically" }
94
+ ];
95
+ const iconPositionValues = ["start", "end"];
96
+ const iconPositionNames = [...iconPositionValues];
97
+ const iconPositionMd = [
98
+ {
99
+ value: "start",
100
+ description: "The icon will appear at the start (left side when the left-to-right direction is set)"
101
+ },
102
+ {
103
+ value: "end",
104
+ description: "The icon will appear at the end (right side when the left-to-right direction is set)"
105
+ }
106
+ ];
107
+ const labelPositionMd = [
108
+ {
109
+ value: "start",
110
+ description: "The left side of the input (left-to-right) or the right side of the input (right-to-left)"
111
+ },
112
+ {
113
+ value: "end",
114
+ description: "The right side of the input (left-to-right) or the left side of the input (right-to-left)"
115
+ },
116
+ { value: "top", description: "The top of the input" },
117
+ { value: "bottom", description: "The bottom of the input" }
118
+ ];
119
+ const triggerPositionValues = ["start", "end"];
120
+ const triggerPositionNames = [...triggerPositionValues];
121
+ const validationStatusMd = [
122
+ // { value: "none", description: "No indicator" },
123
+ { value: "valid", description: "Visual indicator for an input that is accepted" },
124
+ { value: "warning", description: "Visual indicator for an input that produced a warning" },
125
+ { value: "error", description: "Visual indicator for an input that produced an error" }
126
+ ];
127
+ const scrollAnchoringValues = ["top", "bottom"];
128
+ [...scrollAnchoringValues];
129
+ const TextVariantElement = {
130
+ abbr: "abbr",
131
+ cite: "cite",
132
+ code: "code",
133
+ codefence: "pre",
134
+ deleted: "del",
135
+ inserted: "ins",
136
+ keyboard: "kbd",
137
+ marked: "mark",
138
+ sample: "samp",
139
+ sub: "sub",
140
+ sup: "sup",
141
+ var: "var",
142
+ mono: "pre",
143
+ strong: "strong",
144
+ em: "em",
145
+ title: "span",
146
+ subtitle: "span",
147
+ small: "span",
148
+ caption: "span",
149
+ placeholder: "span",
150
+ paragraph: "p",
151
+ subheading: "h6",
152
+ tableheading: "h6",
153
+ secondary: "span"
154
+ };
155
+ const variantOptionsMd = [
156
+ { value: "abbr", description: "Represents an abbreviation or acronym" },
157
+ { value: "caption", description: "Represents the caption (or title) of a table" },
158
+ { value: "cite", description: "Is used to mark up the title of a cited work" },
159
+ { value: "code", description: "Represents a line of code" },
160
+ {
161
+ value: "codefence",
162
+ description: "Handles the display of code blocks if combined with a `code` variant"
163
+ },
164
+ { value: "deleted", description: "Represents text that has been deleted" },
165
+ { value: "em", description: "Marks text to stress emphasis" },
166
+ {
167
+ value: "inserted",
168
+ description: "Represents a range of text that has been added to a document"
169
+ },
170
+ {
171
+ value: "keyboard",
172
+ description: "Represents a span of text denoting textual user input from a keyboard or voice input"
173
+ },
174
+ {
175
+ value: "marked",
176
+ description: "Represents text which is marked or highlighted for reference or notation"
177
+ },
178
+ { value: "mono", description: "Text using a mono style font family" },
179
+ { value: "paragraph", description: "Represents a paragraph" },
180
+ {
181
+ value: "placeholder",
182
+ description: "Text that is mostly used as the placeholder style in input controls"
183
+ },
184
+ { value: "sample", description: "Represents sample (or quoted) output from a computer program" },
185
+ { value: "secondary", description: "Represents a bit dimmed secondary text" },
186
+ { value: "small", description: "Represents side-comments and small print" },
187
+ { value: "sub", description: "Specifies inline text as subscript" },
188
+ { value: "strong", description: "Contents have strong importance" },
189
+ { value: "subheading", description: "Indicates that the text is the subtitle in a heading" },
190
+ {
191
+ value: "subtitle",
192
+ description: "Indicates that the text is the subtitle of some other content"
193
+ },
194
+ { value: "sup", description: "Specifies inline text as superscript" },
195
+ { value: "tableheading", description: "Indicates that the text is a table heading" },
196
+ { value: "title", description: "Indicates that the text is the title of some other content" },
197
+ { value: "var", description: "Represents the name of a variable in a mathematical expression" }
198
+ ];
199
+ const AbbreviationKeys = ["title"];
200
+ const InsertedKeys = ["cite", "dateTime"];
201
+ const VariantPropsKeys = [...AbbreviationKeys, ...InsertedKeys];
202
+ const httpMethodNames = [
203
+ "get",
204
+ "post",
205
+ "put",
206
+ "delete",
207
+ "patch",
208
+ "head",
209
+ "options",
210
+ "trace",
211
+ "connect"
212
+ ];
213
+ const layoutOptionKeys = [
214
+ "horizontalAlignment",
215
+ "verticalAlignment",
216
+ "orientation",
217
+ "width",
218
+ "minWidth",
219
+ "maxWidth",
220
+ "height",
221
+ "minHeight",
222
+ "maxHeight",
223
+ "gap",
224
+ "border",
225
+ "borderTop",
226
+ "borderRight",
227
+ "borderBottom",
228
+ "borderLeft",
229
+ "borderColor",
230
+ "borderStyle",
231
+ "borderWidth",
232
+ "borderHorizontal",
233
+ "borderVertical",
234
+ "borderRadius",
235
+ "radiusTopLeft",
236
+ "radiusTopRight",
237
+ "radiusBottomLeft",
238
+ "radiusBottomRight",
239
+ "padding",
240
+ "paddingHorizontal",
241
+ "paddingVertical",
242
+ "paddingTop",
243
+ "paddingRight",
244
+ "paddingBottom",
245
+ "paddingLeft",
246
+ "backgroundColor",
247
+ "background",
248
+ "boxShadow",
249
+ "direction",
250
+ "overflowX",
251
+ "overflowY",
252
+ "zIndex",
253
+ "color",
254
+ "fontFamily",
255
+ "fontSize",
256
+ "fontWeight",
257
+ "fontStyle",
258
+ "textDecoration",
259
+ "wrapContent",
260
+ "canShrink",
261
+ "margin",
262
+ "marginHorizontal",
263
+ "marginVertical",
264
+ "marginTop",
265
+ "marginRight",
266
+ "marginBottom",
267
+ "marginLeft",
268
+ "userSelect",
269
+ "letterSpacing",
270
+ "textTransform",
271
+ "lineHeight",
272
+ "opacity",
273
+ "cursor",
274
+ "textWrap",
275
+ "textAlign",
276
+ "textAlignLast",
277
+ "top",
278
+ "right",
279
+ "bottom",
280
+ "left",
281
+ "zoom",
282
+ "whiteSpace",
283
+ "textDecoration",
284
+ "textDecorationLine",
285
+ "textDecorationColor",
286
+ "textDecorationStyle",
287
+ "textDecorationThickness",
288
+ "textUnderlineOffset",
289
+ "outline",
290
+ "outlineWidth",
291
+ "outlineColor",
292
+ "outlineStyle",
293
+ "outlineOffset"
294
+ ];
295
+ class MetadataProvider {
296
+ constructor(metadataCollection) {
297
+ this.metadataCollection = metadataCollection;
298
+ }
299
+ componentNames() {
300
+ return Object.keys(this.metadataCollection);
301
+ }
302
+ getComponent(componentName) {
303
+ const providerData = this.metadataCollection[componentName];
304
+ if (!providerData) {
305
+ return null;
306
+ }
307
+ return new ComponentMetadataProvider(providerData);
308
+ }
309
+ }
310
+ class ComponentMetadataProvider {
311
+ constructor(metadata) {
312
+ this.metadata = metadata;
313
+ }
314
+ /**
315
+ * Retrieves the metadata for a given property, explicit or implicit.
316
+ * @param name The name of the property.
317
+ * @returns The metadata for the property, or `undefined` if not found.
318
+ */
319
+ getProp(name) {
320
+ return this.metadata.props[name] ?? implicitPropsMetadata[name];
321
+ }
322
+ getAttr(name) {
323
+ var _a, _b, _c;
324
+ if (onPrefixRegex.test(name)) {
325
+ const eventName = stripOnPrefix(name);
326
+ const event = (_a = this.metadata.events) == null ? void 0 : _a[eventName];
327
+ if (event) {
328
+ return event;
329
+ }
330
+ }
331
+ const explicitProp = (_b = this.metadata.props) == null ? void 0 : _b[name];
332
+ if (explicitProp) {
333
+ return explicitProp;
334
+ }
335
+ const api = (_c = this.metadata.apis) == null ? void 0 : _c[name];
336
+ if (api) {
337
+ return api;
338
+ }
339
+ const layout = layoutMdForKey(name);
340
+ if (layout) {
341
+ return layout;
342
+ }
343
+ return implicitPropsMetadata[name];
344
+ }
345
+ getAttrForKind({ name, kind }) {
346
+ switch (kind) {
347
+ case "api":
348
+ return this.metadata.apis[name];
349
+ case "event":
350
+ return this.metadata.events[name];
351
+ case "prop":
352
+ return this.metadata.props[name];
353
+ case "implicit":
354
+ return implicitPropsMetadata[name];
355
+ case "layout":
356
+ return layoutMdForKey(name);
357
+ }
358
+ }
359
+ getAllAttributes() {
360
+ const attrNames = [];
361
+ for (const key of Object.keys(this.metadata.props ?? {})) {
362
+ attrNames.push({ name: key, kind: "prop" });
363
+ }
364
+ for (const key of Object.keys(this.metadata.events ?? {})) {
365
+ attrNames.push({ name: key, kind: "event" });
366
+ }
367
+ for (const key of Object.keys(this.metadata.apis ?? {})) {
368
+ attrNames.push({ name: key, kind: "api" });
369
+ }
370
+ for (const layoutKey of layoutOptionKeys) {
371
+ attrNames.push({ name: layoutKey, kind: "layout" });
372
+ }
373
+ for (const implicitPropKey of Object.keys(implicitPropsMetadata)) {
374
+ attrNames.push({ name: implicitPropKey, kind: "implicit" });
375
+ }
376
+ return attrNames;
377
+ }
378
+ getEvent(name) {
379
+ var _a;
380
+ return (_a = this.metadata.events) == null ? void 0 : _a[name];
381
+ }
382
+ getApi(name) {
383
+ var _a;
384
+ return (_a = this.metadata.apis) == null ? void 0 : _a[name];
385
+ }
386
+ get events() {
387
+ return this.metadata.events;
388
+ }
389
+ get apis() {
390
+ return this.metadata.apis;
391
+ }
392
+ get contextVars() {
393
+ return this.metadata.contextVars;
394
+ }
395
+ get allowArbitraryProps() {
396
+ return this.metadata.allowArbitraryProps;
397
+ }
398
+ get shortDescription() {
399
+ return this.metadata.shortDescription;
400
+ }
401
+ getMetadata() {
402
+ return this.metadata;
403
+ }
404
+ }
405
+ function layoutMdForKey(name) {
406
+ const metadata = {
407
+ description: "Layout property. Not yet documented"
408
+ };
409
+ if (layoutOptionKeys.includes(name)) {
410
+ return metadata;
411
+ }
412
+ for (const size of viewportSizeMd) {
413
+ const suffix = "-" + size.value;
414
+ if (name.endsWith(suffix)) {
415
+ const nameWithoutSize = name.slice(0, -suffix.length);
416
+ if (layoutOptionKeys.includes(nameWithoutSize)) {
417
+ return metadata;
418
+ }
419
+ }
420
+ }
421
+ return null;
422
+ }
423
+ const implicitPropsMetadata = {
424
+ inspect: {
425
+ description: "Determines whether the component can be inspected or not",
426
+ defaultValue: false,
427
+ valueType: "boolean"
428
+ },
429
+ data: {
430
+ description: "Specifies the data source for a component. Can be a URL string (fetched automatically), a DataSource or an expression to evaluate. Changes to this property trigger UI updates once data is loaded."
431
+ },
432
+ when: {
433
+ description: "Specifies a condition that must be met for the component to be displayed",
434
+ defaultValue: true,
435
+ valueType: "boolean"
436
+ }
437
+ };
438
+ function addOnPrefix(name) {
439
+ return "on" + name[0].toUpperCase() + name.substring(1);
440
+ }
441
+ export {
442
+ LinkTargetMd as L,
443
+ MetadataProvider as M,
444
+ TextVariantElement as T,
445
+ VariantPropsKeys as V,
446
+ alignmentOptionValues as a,
447
+ alignmentOptionMd as b,
448
+ buttonTypesMd as c,
449
+ buttonThemeMd as d,
450
+ buttonVariantMd as e,
451
+ variantOptionsMd as f,
452
+ scrollAnchoringValues as g,
453
+ buttonThemeNames as h,
454
+ iconPositionMd as i,
455
+ iconPositionNames as j,
456
+ buttonVariantNames as k,
457
+ labelPositionMd as l,
458
+ httpMethodNames as m,
459
+ layoutOptionKeys as n,
460
+ orientationOptionMd as o,
461
+ viewportSizeNames as p,
462
+ addOnPrefix as q,
463
+ sizeMd as s,
464
+ triggerPositionNames as t,
465
+ validationStatusMd as v
466
+ };