xmlui 0.9.43 → 0.9.45

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 (43) hide show
  1. package/dist/lib/{index-ODN_c1bh.mjs → apiInterceptorWorker-DzZYVTsV.mjs} +1920 -1362
  2. package/dist/lib/{core-BZ7lCE9p.mjs → core-CvFpTAHi.mjs} +154 -154
  3. package/dist/lib/{index-ClyH3BAn.mjs → index-erPY1EdW.mjs} +8823 -8695
  4. package/dist/lib/index.css +1 -1
  5. package/dist/lib/language-server-web-worker.mjs +1 -1
  6. package/dist/lib/language-server.mjs +1 -1
  7. package/dist/lib/{metadata-utils-DI1nTN3y.mjs → metadata-utils-Cf8v_9Lr.mjs} +7 -7
  8. package/dist/lib/{server-common-C3t9MFME.mjs → server-common-kMTAr-QU.mjs} +210 -178
  9. package/dist/lib/{transform-BV--wKhF.mjs → transform-DU7v4c9h.mjs} +1193 -1158
  10. package/dist/lib/xmlui-parser.d.ts +10 -3
  11. package/dist/lib/xmlui-parser.mjs +31 -30
  12. package/dist/lib/{xmlui-serializer-D5UV-ftG.mjs → xmlui-serializer-B3OkRzrr.mjs} +9 -9
  13. package/dist/lib/xmlui.d.ts +72 -1
  14. package/dist/lib/xmlui.mjs +33 -27
  15. package/dist/metadata/style.css +1 -1
  16. package/dist/metadata/xmlui-metadata.mjs +4264 -4234
  17. package/dist/metadata/xmlui-metadata.umd.js +10 -10
  18. package/dist/scripts/package.json +5 -1
  19. package/dist/scripts/src/components/App/App.js +140 -27
  20. package/dist/scripts/src/components/App/AppNative.js +2 -1
  21. package/dist/scripts/src/components/App/IndexerContext.js +44 -0
  22. package/dist/scripts/src/components/App/SearchContext.js +35 -0
  23. package/dist/scripts/src/components/CodeBlock/CodeBlock.js +1 -0
  24. package/dist/scripts/src/components/CodeBlock/CodeBlockNative.js +42 -34
  25. package/dist/scripts/src/components/CodeBlock/highlight-code.js +18 -6
  26. package/dist/scripts/src/components/Markdown/MarkdownNative.js +63 -27
  27. package/dist/scripts/src/components/NestedApp/NestedApp.js +4 -3
  28. package/dist/scripts/src/components/NestedApp/NestedAppNative.js +61 -66
  29. package/dist/scripts/src/components/Table/TableNative.js +4 -4
  30. package/dist/scripts/src/components/TableOfContents/TableOfContents.js +9 -1
  31. package/dist/scripts/src/components/Text/Text.js +2 -2
  32. package/dist/scripts/src/components/TextBox/TextBoxNative.js +2 -1
  33. package/dist/scripts/src/components/Theme/ThemeNative.js +5 -0
  34. package/dist/scripts/src/components/ToneChangerButton/ToneChangerButton.js +1 -0
  35. package/dist/scripts/src/components-core/loader/DataLoader.js +9 -1
  36. package/dist/scripts/src/components-core/rendering/Container.js +7 -0
  37. package/dist/scripts/src/components-core/theming/ThemeProvider.js +1 -2
  38. package/dist/scripts/src/parsers/xmlui-parser/diagnostics.js +10 -4
  39. package/dist/scripts/src/parsers/xmlui-parser/parser.js +74 -30
  40. package/dist/standalone/xmlui-standalone.es.d.ts +132 -2
  41. package/dist/standalone/xmlui-standalone.umd.js +234 -223
  42. package/package.json +5 -1
  43. package/dist/lib/apiInterceptorWorker-D4BjYgiG.mjs +0 -563
@@ -116,43 +116,73 @@ function parseXmlUiMarkup(text) {
116
116
  function parseTag() {
117
117
  startNode();
118
118
  bump(syntax_kind_1.SyntaxKind.OpenNodeStart);
119
+ let errInName = false;
119
120
  let openTagName = undefined;
120
121
  if (at(syntax_kind_1.SyntaxKind.Identifier)) {
121
122
  openTagName = parseTagName();
122
123
  }
123
124
  else {
124
- error(diagnostics_1.Diag_Tag_Identifier_Expected);
125
- }
126
- parseAttrList();
127
- if (eat(syntax_kind_1.SyntaxKind.NodeClose)) {
128
- completeNode(syntax_kind_1.SyntaxKind.ElementNode);
129
- return;
130
- }
131
- else if (eat(syntax_kind_1.SyntaxKind.NodeEnd)) {
132
- parseContent();
133
- if (eat(syntax_kind_1.SyntaxKind.CloseNodeStart)) {
134
- if (at(syntax_kind_1.SyntaxKind.Identifier)) {
135
- const closeTagName = parseTagName();
136
- const namesMismatch = openTagName !== undefined && !(0, utils_1.tagNameNodesWithoutErrorsMatch)(openTagName, closeTagName, getText);
137
- if (namesMismatch) {
138
- error(MakeErr.tagNameMismatch(getText(openTagName), getText(closeTagName)));
139
- }
140
- }
141
- else {
142
- errRecover(diagnostics_1.Diag_Tag_Identifier_Expected, [syntax_kind_1.SyntaxKind.NodeEnd]);
143
- }
144
- if (!eat(syntax_kind_1.SyntaxKind.NodeEnd)) {
145
- error(diagnostics_1.Diag_End_Token_Expected);
125
+ errInName = true;
126
+ const errNode = errNodeUntil([syntax_kind_1.SyntaxKind.OpenNodeStart, syntax_kind_1.SyntaxKind.NodeEnd, syntax_kind_1.SyntaxKind.NodeClose, syntax_kind_1.SyntaxKind.CloseNodeStart, syntax_kind_1.SyntaxKind.CData, syntax_kind_1.SyntaxKind.Script]);
127
+ if (errNode) {
128
+ errorAt(diagnostics_1.Diag_Tag_Identifier_Expected, errNode.pos, errNode.end);
129
+ }
130
+ else {
131
+ error(diagnostics_1.Diag_Tag_Identifier_Expected);
132
+ }
133
+ }
134
+ if (!errInName) {
135
+ parseAttrList();
136
+ }
137
+ switch (peek().kind) {
138
+ case syntax_kind_1.SyntaxKind.NodeClose: {
139
+ bumpAny();
140
+ completeNode(syntax_kind_1.SyntaxKind.ElementNode);
141
+ return;
142
+ }
143
+ case syntax_kind_1.SyntaxKind.NodeEnd: {
144
+ bumpAny();
145
+ parseContent();
146
+ parseClosingTag(openTagName);
147
+ completeNode(syntax_kind_1.SyntaxKind.ElementNode);
148
+ return;
149
+ }
150
+ case syntax_kind_1.SyntaxKind.OpenNodeStart:
151
+ case syntax_kind_1.SyntaxKind.Script:
152
+ case syntax_kind_1.SyntaxKind.CData: {
153
+ completeNode(syntax_kind_1.SyntaxKind.ElementNode);
154
+ error(diagnostics_1.Diag_End_Or_Close_Token_Expected);
155
+ return;
156
+ }
157
+ case syntax_kind_1.SyntaxKind.CloseNodeStart: {
158
+ error(diagnostics_1.Diag_End_Or_Close_Token_Expected);
159
+ parseClosingTag(openTagName);
160
+ completeNode(syntax_kind_1.SyntaxKind.ElementNode);
161
+ return;
162
+ }
163
+ default: {
164
+ error(diagnostics_1.Diag_End_Or_Close_Token_Expected);
165
+ }
166
+ }
167
+ }
168
+ function parseClosingTag(openTagName) {
169
+ if (eat(syntax_kind_1.SyntaxKind.CloseNodeStart)) {
170
+ if (at(syntax_kind_1.SyntaxKind.Identifier)) {
171
+ const closeTagName = parseTagName();
172
+ const namesMismatch = openTagName !== undefined && !(0, utils_1.tagNameNodesWithoutErrorsMatch)(openTagName, closeTagName, getText);
173
+ if (namesMismatch) {
174
+ error(MakeErr.tagNameMismatch(getText(openTagName), getText(closeTagName)));
146
175
  }
147
176
  }
148
177
  else {
149
- error(diagnostics_1.Diag_CloseNodeStart_Token_Expected);
178
+ errRecover(diagnostics_1.Diag_Tag_Identifier_Expected, [syntax_kind_1.SyntaxKind.NodeEnd]);
179
+ }
180
+ if (!eat(syntax_kind_1.SyntaxKind.NodeEnd)) {
181
+ error(diagnostics_1.Diag_End_Token_Expected);
150
182
  }
151
- completeNode(syntax_kind_1.SyntaxKind.ElementNode);
152
- return;
153
183
  }
154
184
  else {
155
- error(diagnostics_1.Diag_End_Or_Close_Token_Expected);
185
+ error(diagnostics_1.Diag_CloseNodeStart_Token_Expected);
156
186
  }
157
187
  }
158
188
  function parseTagName() {
@@ -258,6 +288,17 @@ function parseXmlUiMarkup(text) {
258
288
  function atAnyOf(kinds) {
259
289
  return kinds.includes(peek().kind);
260
290
  }
291
+ function errNodeUntil(tokens) {
292
+ startNode();
293
+ advance(tokens);
294
+ if (node.children.length === 0) {
295
+ abandonNode();
296
+ return null;
297
+ }
298
+ else {
299
+ return completeNode(syntax_kind_1.SyntaxKind.ErrorNode);
300
+ }
301
+ }
261
302
  /**
262
303
  * report an error and skip the next token if it isn't in the recoveryTokens. EoF isn't skipped.
263
304
  * @param recoveryTokens the [FollowSet](https://www.geeksforgeeks.org/follow-set-in-syntax-analysis/) of the parsed InnerNode. These tokens (or the EoF token) won't be skipped
@@ -274,6 +315,10 @@ function parseXmlUiMarkup(text) {
274
315
  completeNode(syntax_kind_1.SyntaxKind.ErrorNode);
275
316
  return false;
276
317
  }
318
+ /** Bumps over the next token and marks it as an error node while adding an error to the error list*/
319
+ function errorAndBump(errCodeAndMsg) {
320
+ errRecover(errCodeAndMsg, []);
321
+ }
277
322
  function error({ code, message, category }) {
278
323
  const { pos, end } = peek();
279
324
  errors.push({
@@ -293,6 +338,9 @@ function parseXmlUiMarkup(text) {
293
338
  end,
294
339
  });
295
340
  }
341
+ function advance(to) {
342
+ for (let token = peek(); token.kind !== syntax_kind_1.SyntaxKind.EndOfFileToken && !to.includes(token.kind); bumpAny(), token = peek()) { }
343
+ }
296
344
  function peek(inContent = false) {
297
345
  if (peekedToken !== undefined) {
298
346
  return peekedToken;
@@ -482,10 +530,6 @@ function parseXmlUiMarkup(text) {
482
530
  }
483
531
  }
484
532
  }
485
- /** Bumps over the next token and marks it as an error node while adding an error to the error list*/
486
- function errorAndBump(errCodeAndMsg) {
487
- errRecover(errCodeAndMsg, []);
488
- }
489
533
  function abandonNode() {
490
534
  const parentNode = parents[parents.length - 1];
491
535
  parentNode.children.push(...node.children);
@@ -98,7 +98,13 @@ declare namespace all {
98
98
  builtInThemes,
99
99
  XmlUiHelper,
100
100
  Text_2 as Text,
101
- NestedApp
101
+ TextBox,
102
+ NestedApp,
103
+ VisuallyHidden,
104
+ LinkNative,
105
+ ToneChangerButton,
106
+ Logo,
107
+ useSearchContextContent
102
108
  }
103
109
  }
104
110
 
@@ -955,7 +961,60 @@ declare const _default: {
955
961
  ellipses?: boolean;
956
962
  style?: default_2.CSSProperties;
957
963
  }, "ref"> & default_2.RefAttributes<unknown>>;
964
+ TextBox: default_2.ForwardRefExoticComponent<{
965
+ id?: string;
966
+ type?: "search" | "text" | "password";
967
+ value?: string;
968
+ updateState?: UpdateStateFn;
969
+ initialValue?: string;
970
+ style?: default_2.CSSProperties;
971
+ maxLength?: number;
972
+ enabled?: boolean;
973
+ placeholder?: string;
974
+ validationStatus?: "none" | "error" | "warning" | "valid";
975
+ onDidChange?: (newValue: string) => void;
976
+ onFocus?: () => void;
977
+ onBlur?: () => void;
978
+ registerComponentApi?: all.RegisterComponentApiFn;
979
+ startText?: string;
980
+ startIcon?: string;
981
+ endText?: string;
982
+ endIcon?: string;
983
+ gap?: string;
984
+ autoFocus?: boolean;
985
+ readOnly?: boolean;
986
+ tabIndex?: number;
987
+ label?: string;
988
+ labelPosition?: string;
989
+ labelWidth?: string;
990
+ labelBreak?: boolean;
991
+ required?: boolean;
992
+ } & default_2.RefAttributes<HTMLDivElement>>;
958
993
  NestedApp: typeof all.NestedApp;
994
+ VisuallyHidden: ({ children, ...props }: {
995
+ children: default_2.ReactNode;
996
+ }) => default_3.JSX.Element;
997
+ LinkNative: default_2.ForwardRefExoticComponent<{
998
+ to: string | {
999
+ pathname: string;
1000
+ queryParams?: Record<string, any>;
1001
+ };
1002
+ children: default_2.ReactNode;
1003
+ icon?: string;
1004
+ active?: boolean;
1005
+ disabled?: boolean;
1006
+ onClick?: () => void;
1007
+ style?: default_2.CSSProperties;
1008
+ } & Partial<Pick<HTMLAnchorElement, "type" | "target" | "rel" | "download" | "ping" | "referrerPolicy" | "hreflang">> & default_2.RefAttributes<HTMLDivElement>>;
1009
+ ToneChangerButton: typeof all.ToneChangerButton;
1010
+ Logo: default_2.ForwardRefExoticComponent<{
1011
+ style?: default_2.CSSProperties;
1012
+ } & default_2.RefAttributes<HTMLImageElement>>;
1013
+ useSearchContextContent: () => Record<string, {
1014
+ path: string;
1015
+ title: string;
1016
+ content: string;
1017
+ }>;
959
1018
  };
960
1019
  export default _default;
961
1020
 
@@ -1026,7 +1085,7 @@ declare type EntrypointCompilation = CompilationUnit & {
1026
1085
  declare enum ErrCodes {
1027
1086
  onlyOneElem = "U002",
1028
1087
  expTagOpen = "U003",
1029
- expTagIdent = "U004",
1088
+ expTagName = "U004",
1030
1089
  expCloseStart = "U005",
1031
1090
  expEndOrClose = "U006",
1032
1091
  tagNameMismatch = "U007",
@@ -1036,6 +1095,7 @@ declare enum ErrCodes {
1036
1095
  expAttrValue = "U011",
1037
1096
  duplAttr = "U012",
1038
1097
  uppercaseAttr = "U013",
1098
+ tagNameExpAfterNamespace = "U014",
1039
1099
  invalidChar = "W001",
1040
1100
  untermStr = "W002",
1041
1101
  untermComment = "W007",
@@ -1297,6 +1357,19 @@ declare interface LetStatement extends ScripNodeBase {
1297
1357
  decls: VarDeclaration[];
1298
1358
  }
1299
1359
 
1360
+ declare const LinkNative: ForwardRefExoticComponent< {
1361
+ to: string | {
1362
+ pathname: string;
1363
+ queryParams?: Record<string, any>;
1364
+ };
1365
+ children: ReactNode;
1366
+ icon?: string;
1367
+ active?: boolean;
1368
+ disabled?: boolean;
1369
+ onClick?: () => void;
1370
+ style?: CSSProperties;
1371
+ } & Partial<Pick<HTMLAnchorElement, "type" | "target" | "rel" | "download" | "ping" | "referrerPolicy" | "hreflang">> & RefAttributes<HTMLDivElement>>;
1372
+
1300
1373
  declare type LITERAL = typeof T_LITERAL;
1301
1374
 
1302
1375
  declare interface Literal extends ExpressionBase {
@@ -1322,6 +1395,10 @@ declare type LoggedInUserDto = {
1322
1395
  permissions: Record<string, string>;
1323
1396
  };
1324
1397
 
1398
+ declare const Logo: ForwardRefExoticComponent< {
1399
+ style?: CSSProperties;
1400
+ } & RefAttributes<HTMLImageElement>>;
1401
+
1325
1402
  /**
1326
1403
  * This type represents the options to use for looking up actions.
1327
1404
  */
@@ -1533,6 +1610,36 @@ declare type Props_3 = {
1533
1610
  distributeEvenly?: boolean;
1534
1611
  };
1535
1612
 
1613
+ declare type Props_4 = {
1614
+ id?: string;
1615
+ type?: "text" | "password" | "search";
1616
+ value?: string;
1617
+ updateState?: UpdateStateFn;
1618
+ initialValue?: string;
1619
+ style?: CSSProperties;
1620
+ maxLength?: number;
1621
+ enabled?: boolean;
1622
+ placeholder?: string;
1623
+ validationStatus?: ValidationStatus;
1624
+ onDidChange?: (newValue: string) => void;
1625
+ onFocus?: () => void;
1626
+ onBlur?: () => void;
1627
+ registerComponentApi?: RegisterComponentApiFn;
1628
+ startText?: string;
1629
+ startIcon?: string;
1630
+ endText?: string;
1631
+ endIcon?: string;
1632
+ gap?: string;
1633
+ autoFocus?: boolean;
1634
+ readOnly?: boolean;
1635
+ tabIndex?: number;
1636
+ label?: string;
1637
+ labelPosition?: string;
1638
+ labelWidth?: string;
1639
+ labelBreak?: boolean;
1640
+ required?: boolean;
1641
+ };
1642
+
1536
1643
  declare type REACTIVE_VAR_DECLARATION = typeof T_REACTIVE_VAR_DECLARATION;
1537
1644
 
1538
1645
  declare interface ReactiveVarDeclaration extends ExpressionBase {
@@ -1640,6 +1747,12 @@ declare interface ScriptParserErrorMessage {
1640
1747
 
1641
1748
  declare type ScriptParsingErrorCodes = "W001" | "W002" | "W003" | "W004" | "W005" | "W006" | "W007" | "W008" | "W009" | "W010" | "W011" | "W012" | "W013" | "W014" | "W015" | "W016" | "W017" | "W018" | "W019" | "W020" | "W021" | "W022" | "W023" | "W024" | "W025" | "W026" | "W027" | "W028" | "W029" | "W030" | "W031";
1642
1749
 
1750
+ declare type SearchEntry = {
1751
+ path: string;
1752
+ title: string;
1753
+ content: string;
1754
+ };
1755
+
1643
1756
  declare type SEQUENCE_EXPRESSION = typeof T_SEQUENCE_EXPRESSION;
1644
1757
 
1645
1758
  declare interface SequenceExpression extends ExpressionBase {
@@ -1907,6 +2020,8 @@ declare interface TemplateLiteralExpression extends ExpressionBase {
1907
2020
 
1908
2021
  declare const Text_2: default_2.ForwardRefExoticComponent<Omit<TextProps, "ref"> & default_2.RefAttributes<unknown>>;
1909
2022
 
2023
+ declare const TextBox: default_2.ForwardRefExoticComponent<Props_4 & default_2.RefAttributes<HTMLDivElement>>;
2024
+
1910
2025
  declare type TextProps = {
1911
2026
  uid?: string;
1912
2027
  children?: default_2.ReactNode;
@@ -2136,6 +2251,11 @@ declare enum TokenType {
2136
2251
  From = 97
2137
2252
  }
2138
2253
 
2254
+ declare function ToneChangerButton({ lightToDarkIcon, darkToLightIcon }: {
2255
+ lightToDarkIcon?: string;
2256
+ darkToLightIcon?: string;
2257
+ }): JSX_2.Element;
2258
+
2139
2259
  declare type TrackContainerHeight = "auto" | "fixed";
2140
2260
 
2141
2261
  declare interface TreeNode {
@@ -2194,8 +2314,14 @@ declare function useDevTools(): {
2194
2314
 
2195
2315
  declare const useLogger: () => LogContextType;
2196
2316
 
2317
+ declare const useSearchContextContent: () => Record<string, SearchEntry>;
2318
+
2197
2319
  declare function useTheme(): ThemeScope;
2198
2320
 
2321
+ declare type ValidationStatus = (typeof validationStatusValues)[number];
2322
+
2323
+ declare const validationStatusValues: readonly ["none", "error", "warning", "valid"];
2324
+
2199
2325
  /**
2200
2326
  * This type represent the function that extracts the value from a component property
2201
2327
  */
@@ -2273,6 +2399,10 @@ declare interface VarStatement extends ScripNodeBase {
2273
2399
  decls: ReactiveVarDeclaration[];
2274
2400
  }
2275
2401
 
2402
+ declare const VisuallyHidden: ({ children, ...props }: {
2403
+ children: React.ReactNode;
2404
+ }) => JSX_2.Element;
2405
+
2276
2406
  declare type WHILE_STATEMENT = typeof T_WHILE_STATEMENT;
2277
2407
 
2278
2408
  declare interface WhileStatement extends ScripNodeBase {