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
@@ -51,6 +51,8 @@ declare interface AssignmentExpression extends ExpressionBase {
51
51
 
52
52
  declare type AssignmentSymbols = "=" | "+=" | "-=" | "**=" | "*=" | "/=" | "%=" | "<<=" | ">>=" | ">>>=" | "&=" | "^=" | "|=" | "&&=" | "||=" | "??=";
53
53
 
54
+ declare type AttributeKind = "prop" | "event" | "api" | "implicit" | "layout";
55
+
54
56
  declare type AuthDefinition = {
55
57
  defaultLoggedInUser?: any;
56
58
  };
@@ -357,6 +359,30 @@ declare type ComponentMetadata<TProps extends Record<string, ComponentPropertyMe
357
359
  isHtmlTag?: boolean;
358
360
  };
359
361
 
362
+ declare type ComponentMetadataCollection = Record<string, RestrictedComponentMetadata>;
363
+
364
+ declare class ComponentMetadataProvider {
365
+ private readonly metadata;
366
+ constructor(metadata: RestrictedComponentMetadata);
367
+ /**
368
+ * Retrieves the metadata for a given property, explicit or implicit.
369
+ * @param name The name of the property.
370
+ * @returns The metadata for the property, or `undefined` if not found.
371
+ */
372
+ getProp(name: string): any;
373
+ getAttr(name: string): any;
374
+ getAttrForKind({ name, kind }: TaggedAttribute): any;
375
+ getAllAttributes(): TaggedAttribute[];
376
+ getEvent(name: string): any;
377
+ getApi(name: string): any;
378
+ get events(): Record<string, string>;
379
+ get apis(): Record<string, string>;
380
+ get contextVars(): Record<string, string>;
381
+ get allowArbitraryProps(): boolean;
382
+ get shortDescription(): string;
383
+ getMetadata(): RestrictedComponentMetadata;
384
+ }
385
+
360
386
  /**
361
387
  * Components have properties, events, context values, and exposed API
362
388
  * endpoints, each holding metadata the rendering engine uses at run time.
@@ -812,14 +838,14 @@ declare interface LetStatement extends ScripNodeBase {
812
838
  decls: VarDeclaration[];
813
839
  }
814
840
 
815
- export declare function lint({ component, metadataByComponent, }: {
841
+ export declare function lint({ component, metadataProvider, }: {
816
842
  component: CompoundComponentDef | ComponentDef;
817
- metadataByComponent: Record<string, ComponentMetadata>;
843
+ metadataProvider: MetadataProvider;
818
844
  }): LintDiagnostic[];
819
845
 
820
- export declare function lintApp({ appDef, metadataByComponent, }: {
846
+ export declare function lintApp({ appDef, metadataProvider, }: {
821
847
  appDef: StandaloneAppDescription;
822
- metadataByComponent: Record<string, ComponentMetadata>;
848
+ metadataProvider: MetadataProvider;
823
849
  }): ComponentLints[];
824
850
 
825
851
  export declare enum LintDiagKind {
@@ -855,6 +881,13 @@ declare interface MemberAccessExpression extends ExpressionBase {
855
881
  opt?: boolean;
856
882
  }
857
883
 
884
+ declare class MetadataProvider {
885
+ private readonly metadataCollection;
886
+ constructor(metadataCollection: ComponentMetadataCollection);
887
+ componentNames(): string[];
888
+ getComponent(componentName: string): ComponentMetadataProvider | null;
889
+ }
890
+
858
891
  /**
859
892
  * Represents a module error
860
893
  */
@@ -959,6 +992,8 @@ declare interface ReadonlyTextRange {
959
992
  readonly end: number;
960
993
  }
961
994
 
995
+ declare type RestrictedComponentMetadata = Pick<ComponentMetadata, "description" | "status" | "props" | "events" | "apis" | "contextVars" | "allowArbitraryProps" | "shortDescription">;
996
+
962
997
  declare type RETURN_STATEMENT = typeof T_RETURN_STATEMENT;
963
998
 
964
999
  declare interface ReturnStatement extends ScripNodeBase {
@@ -1065,6 +1100,11 @@ declare type StandaloneAppDescription = {
1065
1100
 
1066
1101
  declare type Statement = BlockStatement | EmptyStatement | ExpressionStatement | ArrowExpressionStatement | LetStatement | ConstStatement | VarStatement | IfStatement | ReturnStatement | BreakStatement | ContinueStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | ThrowStatement | TryStatement | SwitchStatement | FunctionDeclaration;
1067
1102
 
1103
+ /**
1104
+ * @param name - The name of the event in camelCase, with "on" prefix.
1105
+ */
1106
+ export declare function stripOnPrefix(name: string): string;
1107
+
1068
1108
  declare type SWITCH_CASE = typeof T_SWITCH_CASE;
1069
1109
 
1070
1110
  declare type SWITCH_STATEMENT = typeof T_SWITCH_STATEMENT;
@@ -1208,6 +1248,11 @@ declare type TableDescriptor = {
1208
1248
  indexes?: Array<string>;
1209
1249
  };
1210
1250
 
1251
+ declare type TaggedAttribute = {
1252
+ name: string;
1253
+ kind: AttributeKind;
1254
+ };
1255
+
1211
1256
  /** Disregards error nodes amongst the children of the 2 compared name node. (Those reported an error earlyer anyways)*/
1212
1257
  export declare function tagNameNodesWithoutErrorsMatch(name1: Node_2, name2: Node_2, getText: GetText): boolean;
1213
1258
 
@@ -1,6 +1,6 @@
1
- import { C, o, k, i, n, h, l, a, m, j, f, e, g, b, D, E, S, q, c, d, x, u, r, t, s, p, w, v } from "./parser-CBXS8ft2.mjs";
2
- import { ak as COMPOUND_COMP_ID } from "./lint-EcgF-9Wr.mjs";
3
- import { as, am, ae, ao, aq, ac, ab, ap, ad, an, af, ah, al, a5, ar, ag } from "./lint-EcgF-9Wr.mjs";
1
+ import { X as COMPOUND_COMP_ID } from "./transform-DC0Gy6qw.mjs";
2
+ import { al, Y, aa, a6, a4, a9, a3, a7, _, a8, a5, a1, a0, a2, $, Q, R, ac, S, aj, ae, N, Z, ad, ap, ai, af, ah, ag, O, ak, ab, am, ao, an } from "./transform-DC0Gy6qw.mjs";
3
+ import { d, L, a, c, g, e, l, b, m, p } from "./lint-CYAUfk0_.mjs";
4
4
  const attrBreakRegex = /[\r\n<>'"&]/;
5
5
  class XmlUiHelper {
6
6
  /**
@@ -12,7 +12,7 @@ class XmlUiHelper {
12
12
  const fragment = Array.isArray(xml) ? xml : [xml];
13
13
  return serializeFragment(fragment, 0);
14
14
  function serializeFragment(nodes, depth) {
15
- return nodes.map((n2) => serializeNode(n2, depth)).join((options == null ? void 0 : options.prettify) ? "\n" + getIndent(depth) : "");
15
+ return nodes.map((n) => serializeNode(n, depth)).join((options == null ? void 0 : options.prettify) ? "\n" + getIndent(depth) : "");
16
16
  }
17
17
  function serializeNode(node, depth) {
18
18
  switch (node.type) {
@@ -37,7 +37,7 @@ class XmlUiHelper {
37
37
  const hasChildren = (((_b = node.childNodes) == null ? void 0 : _b.length) ?? 0) > 0;
38
38
  if (node.text || hasAttrs || hasChildren) {
39
39
  if (hasAttrs) {
40
- const attrTexts = node.attributes.map((a2) => serializeXmlAttribute(a2));
40
+ const attrTexts = node.attributes.map((a10) => serializeXmlAttribute(a10));
41
41
  if (!(options == null ? void 0 : options.prettify)) {
42
42
  elementStr += " " + attrTexts.join(" ");
43
43
  } else {
@@ -493,49 +493,50 @@ class XmlUiHelper {
493
493
  }
494
494
  export {
495
495
  COMPOUND_COMP_ID,
496
- as as CORE_NAMESPACE_VALUE,
497
- C as CharacterCodes,
498
- o as Diag_Attr_Identifier_Expected,
499
- k as Diag_Attr_Value_Expected,
500
- i as Diag_CloseNodeStart_Token_Expected,
501
- n as Diag_End_Or_Close_Token_Expected,
502
- h as Diag_End_Token_Expected,
503
- l as Diag_Eq_Token_Expected,
504
- a as Diag_Invalid_Character,
505
- m as Diag_OpenNodeStart_Token_Expected,
506
- j as Diag_Tag_Identifier_Expected,
507
- f as Diag_Unterminated_CData,
508
- e as Diag_Unterminated_Comment,
509
- g as Diag_Unterminated_Script,
510
- b as Diag_Unterminated_String_Literal,
511
- D as DiagnosticCategory,
512
- E as ErrCodes,
513
- am as LintDiagKind,
514
- ae as LintSeverity,
515
- ao as ParserError,
496
+ al as CORE_NAMESPACE_VALUE,
497
+ Y as CharacterCodes,
498
+ aa as Diag_Attr_Identifier_Expected,
499
+ a6 as Diag_Attr_Value_Expected,
500
+ a4 as Diag_CloseNodeStart_Token_Expected,
501
+ a9 as Diag_End_Or_Close_Token_Expected,
502
+ a3 as Diag_End_Token_Expected,
503
+ a7 as Diag_Eq_Token_Expected,
504
+ _ as Diag_Invalid_Character,
505
+ a8 as Diag_OpenNodeStart_Token_Expected,
506
+ a5 as Diag_Tag_Identifier_Expected,
507
+ a1 as Diag_Unterminated_CData,
508
+ a0 as Diag_Unterminated_Comment,
509
+ a2 as Diag_Unterminated_Script,
510
+ $ as Diag_Unterminated_String_Literal,
511
+ Q as DiagnosticCategory,
512
+ R as ErrCodes,
513
+ d as LintDiagKind,
514
+ L as LintSeverity,
515
+ ac as ParserError,
516
516
  S as SyntaxKind,
517
- aq as UCRegex,
517
+ aj as UCRegex,
518
518
  XmlUiHelper,
519
- ac as codeBehindFileExtension,
520
- ab as componentFileExtension,
521
- q as createScanner,
522
- c as createXmlUiParser,
523
- d as diagnosticCategoryName,
524
- ap as errorMessages,
525
- x as findTokenAtPos,
526
- ad as getLintSeverity,
527
- u as getSyntaxKindStrRepr,
528
- r as isIdentifierStart,
529
- t as isInnerNode,
530
- s as isTrivia,
531
- an as lint,
532
- af as lintApp,
533
- ah as lintErrorsComponent,
534
- al as moduleFileExtension,
535
- a5 as nodeToComponentDef,
536
- ar as onPrefixRegex,
537
- p as parseXmlUiMarkup,
538
- ag as printComponentLints,
539
- w as tagNameNodesWithoutErrorsMatch,
540
- v as toDbgString
519
+ a as codeBehindFileExtension,
520
+ c as componentFileExtension,
521
+ ae as createScanner,
522
+ N as createXmlUiParser,
523
+ Z as diagnosticCategoryName,
524
+ ad as errorMessages,
525
+ ap as findTokenAtPos,
526
+ g as getLintSeverity,
527
+ ai as getSyntaxKindStrRepr,
528
+ af as isIdentifierStart,
529
+ ah as isInnerNode,
530
+ ag as isTrivia,
531
+ e as lint,
532
+ l as lintApp,
533
+ b as lintErrorsComponent,
534
+ m as moduleFileExtension,
535
+ O as nodeToComponentDef,
536
+ ak as onPrefixRegex,
537
+ ab as parseXmlUiMarkup,
538
+ p as printComponentLints,
539
+ am as stripOnPrefix,
540
+ ao as tagNameNodesWithoutErrorsMatch,
541
+ an as toDbgString
541
542
  };