xmlui 0.8.6 → 0.9.1

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 (106) hide show
  1. package/dist/{apiInterceptorWorker-fLBfPj2T.mjs → apiInterceptorWorker-230V_-Ds.mjs} +1 -1
  2. package/dist/{index-wd8FRzuM.mjs → index-DUwwx3L4.mjs} +5864 -6108
  3. package/dist/index.css +274 -301
  4. package/dist/language-server.mjs +25 -1
  5. package/dist/{lint-B18Ko6Sy.mjs → lint-gX2osbkz.mjs} +920 -1120
  6. package/dist/scripts/bin/build.js +2 -2
  7. package/dist/scripts/bin/start.js +3 -9
  8. package/dist/scripts/bin/vite-xmlui-plugin.js +2 -2
  9. package/dist/scripts/bin/viteConfig.js +89 -63
  10. package/dist/scripts/src/abstractions/scripting/ScriptingSourceTreeExp.js +1 -2
  11. package/dist/scripts/src/components/Accordion/Accordion.js +6 -16
  12. package/dist/scripts/src/components/App/AppNative.js +8 -0
  13. package/dist/scripts/src/components/AppHeader/AppHeader.js +1 -5
  14. package/dist/scripts/src/components/AppHeader/AppHeaderNative.js +10 -4
  15. package/dist/scripts/src/components/AutoComplete/AutoComplete.js +13 -19
  16. package/dist/scripts/src/components/AutoComplete/AutoCompleteContext.js +2 -0
  17. package/dist/scripts/src/components/AutoComplete/AutoCompleteNative.js +7 -3
  18. package/dist/scripts/src/components/Avatar/Avatar.js +2 -9
  19. package/dist/scripts/src/components/Badge/Badge.js +2 -8
  20. package/dist/scripts/src/components/Button/Button.js +28 -60
  21. package/dist/scripts/src/components/Card/Card.js +1 -6
  22. package/dist/scripts/src/components/Checkbox/Checkbox.js +4 -12
  23. package/dist/scripts/src/components/ComponentProvider.js +4 -0
  24. package/dist/scripts/src/components/DatePicker/DatePicker.js +3 -10
  25. package/dist/scripts/src/components/DropdownMenu/DropdownMenu.js +1 -1
  26. package/dist/scripts/src/components/Form/Form.js +12 -28
  27. package/dist/scripts/src/components/Form/FormNative.js +9 -0
  28. package/dist/scripts/src/components/FormItem/HelperText.js +1 -1
  29. package/dist/scripts/src/components/FormItem/ItemWithLabel.js +2 -2
  30. package/dist/scripts/src/components/Heading/HeadingNative.js +0 -1
  31. package/dist/scripts/src/components/HtmlTags/HtmlTags.js +4 -19
  32. package/dist/scripts/src/components/IconProvider.js +2 -2
  33. package/dist/scripts/src/components/Link/Link.js +2 -8
  34. package/dist/scripts/src/components/Markdown/MarkdownNative.js +4 -4
  35. package/dist/scripts/src/components/ModalDialog/ModalDialog.js +1 -3
  36. package/dist/scripts/src/components/NavGroup/NavGroup.js +34 -3
  37. package/dist/scripts/src/components/NavGroup/NavGroupNative.js +24 -12
  38. package/dist/scripts/src/components/NavLink/NavLink.js +4 -11
  39. package/dist/scripts/src/components/NavPanel/NavPanel.js +1 -6
  40. package/dist/scripts/src/components/ProgressBar/ProgressBar.js +2 -8
  41. package/dist/scripts/src/components/RadioGroup/RadioGroup.js +4 -12
  42. package/dist/scripts/src/components/Select/Select.js +5 -13
  43. package/dist/scripts/src/components/Select/SelectNative.js +7 -3
  44. package/dist/scripts/src/components/Slider/Slider.js +2 -8
  45. package/dist/scripts/src/components/Spinner/Spinner.js +1 -6
  46. package/dist/scripts/src/components/SubNavPanel/SubNavPanel.js +22 -0
  47. package/dist/scripts/src/components/SubNavPanel/SubNavPanelNative.js +9 -0
  48. package/dist/scripts/src/components/Switch/Switch.js +6 -16
  49. package/dist/scripts/src/components/Table/Table.js +8 -17
  50. package/dist/scripts/src/components/TableOfContents/TableOfContents.js +4 -12
  51. package/dist/scripts/src/components/Tabs/Tabs.js +3 -10
  52. package/dist/scripts/src/components/Text/Text.js +10 -24
  53. package/dist/scripts/src/components/TextBox/TextBoxNative.js +1 -1
  54. package/dist/scripts/src/components/Theme/ThemeNative.js +1 -1
  55. package/dist/scripts/src/components/ValidationSummary/ValidationSummary.js +3 -3
  56. package/dist/scripts/src/components-core/DevTools.js +5 -4
  57. package/dist/scripts/src/components-core/RestApiProxy.js +7 -3
  58. package/dist/scripts/src/components-core/action/APICall.js +2 -1
  59. package/dist/scripts/src/components-core/rendering/Container.js +15 -11
  60. package/dist/scripts/src/components-core/rendering/StateContainer.js +3 -2
  61. package/dist/scripts/src/components-core/script-runner/BindingTreeEvaluationContext.js +0 -2
  62. package/dist/scripts/src/components-core/script-runner/ParameterParser.js +1 -1
  63. package/dist/scripts/src/components-core/script-runner/asyncProxy.js +11 -64
  64. package/dist/scripts/src/components-core/script-runner/eval-tree-async.js +196 -175
  65. package/dist/scripts/src/components-core/script-runner/eval-tree-common.js +173 -231
  66. package/dist/scripts/src/components-core/script-runner/eval-tree-sync.js +129 -100
  67. package/dist/scripts/src/components-core/script-runner/process-statement-async.js +170 -175
  68. package/dist/scripts/src/components-core/script-runner/process-statement-common.js +48 -33
  69. package/dist/scripts/src/components-core/script-runner/process-statement-sync.js +164 -170
  70. package/dist/scripts/src/components-core/script-runner/statement-queue.js +5 -4
  71. package/dist/scripts/src/components-core/script-runner/visitors.js +124 -116
  72. package/dist/scripts/src/components-core/theming/themes/palette.js +1 -0
  73. package/dist/scripts/src/components-core/theming/themes/root.js +300 -154
  74. package/dist/scripts/src/components-core/theming/themes/theme-colors.js +510 -510
  75. package/dist/scripts/src/components-core/theming/themes/xmlui.js +0 -1
  76. package/dist/scripts/src/components-core/theming/transformThemeVars.js +11 -11
  77. package/dist/scripts/src/components-core/utils/misc.js +13 -0
  78. package/dist/scripts/src/components-core/utils/statementUtils.js +56 -53
  79. package/dist/scripts/src/components-core/xmlui-parser.js +1 -1
  80. package/dist/scripts/src/parsers/scripting-exp/Lexer.js +1092 -0
  81. package/dist/scripts/src/parsers/scripting-exp/Parser.js +2635 -0
  82. package/dist/scripts/src/parsers/scripting-exp/ParserError.js +47 -0
  83. package/dist/scripts/src/parsers/scripting-exp/TokenTrait.js +109 -0
  84. package/dist/scripts/src/parsers/scripting-exp/TokenType.js +2 -4
  85. package/dist/scripts/src/parsers/scripting-exp/code-behind-collect.js +101 -0
  86. package/dist/scripts/src/parsers/scripting-exp/modules.js +107 -0
  87. package/dist/scripts/src/parsers/{scripting → scripting-exp}/tree-visitor.js +103 -107
  88. package/dist/scripts/src/parsers/xmlui-parser/transform.js +12 -12
  89. package/dist/style.css +245 -286
  90. package/dist/xmlui-metadata.mjs +2741 -2211
  91. package/dist/xmlui-metadata.umd.js +2740 -2212
  92. package/dist/xmlui-parser.d.ts +320 -232
  93. package/dist/xmlui-parser.mjs +19 -19
  94. package/dist/xmlui-standalone.umd.js +6770 -7220
  95. package/dist/xmlui.d.ts +322 -230
  96. package/dist/xmlui.mjs +1 -1
  97. package/package.json +10 -6
  98. package/dist/_commonjsHelpers-CcAunmGO.mjs +0 -33
  99. package/dist/scripts/src/components-core/script-runner/ICustomOperations.js +0 -34
  100. package/dist/scripts/src/components-core/script-runner/custom-operations-registry.js +0 -40
  101. package/dist/scripts/src/components-core/script-runner/custom-ui-data.js +0 -40
  102. package/dist/scripts/src/components-core/script-runner/syncProxy.js +0 -31
  103. package/dist/scripts/src/parsers/scripting/code-behind-collect.js +0 -153
  104. package/dist/scripts/src/parsers/scripting/modules.js +0 -284
  105. /package/dist/scripts/src/abstractions/scripting/{LogicalThread.js → LogicalThreadExp.js} +0 -0
  106. /package/dist/scripts/src/abstractions/scripting/{TryScope.js → TryScopeExp.js} +0 -0
package/dist/xmlui.d.ts CHANGED
@@ -28,6 +28,7 @@ declare interface ActionExecutionContext {
28
28
  * The state of the container that the action is executed in.
29
29
  */
30
30
  state: ContainerState;
31
+ getCurrentState: () => ContainerState;
31
32
  /**
32
33
  * The appContext object passed to the current app
33
34
  */
@@ -338,34 +339,43 @@ declare type AppWrapperProps = {
338
339
  sources?: Record<string, string>;
339
340
  };
340
341
 
342
+ declare type ARRAY_DESTRUCTURE = typeof T_ARRAY_DESTRUCTURE;
343
+
344
+ declare type ARRAY_LITERAL = typeof T_ARRAY_LITERAL;
345
+
341
346
  declare interface ArrayDestructure extends DestructureBase {
342
- type: "ADestr";
347
+ type: ARRAY_DESTRUCTURE;
343
348
  }
344
349
 
345
350
  declare interface ArrayLiteral extends ExpressionBase {
346
- type: "ALitE";
351
+ type: ARRAY_LITERAL;
347
352
  items: Expression[];
348
353
  loose?: boolean;
349
354
  }
350
355
 
356
+ declare type ARROW_EXPRESSION = typeof T_ARROW_EXPRESSION;
357
+
358
+ declare type ARROW_EXPRESSION_STATEMENT = typeof T_ARROW_EXPRESSION_STATEMENT;
359
+
351
360
  declare interface ArrowExpression extends ExpressionBase {
352
- type: "ArrowE";
361
+ type: ARROW_EXPRESSION;
353
362
  name?: string;
354
363
  args: Expression[];
355
364
  statement: Statement;
356
- closureContext?: BlockScope[];
357
365
  }
358
366
 
359
- declare interface ArrowExpressionStatement extends StatementBase {
360
- type: "ArrowS";
361
- expression: ArrowExpression;
367
+ declare interface ArrowExpressionStatement extends ScripNodeBase {
368
+ type: ARROW_EXPRESSION_STATEMENT;
369
+ expr: ArrowExpression;
362
370
  }
363
371
 
372
+ declare type ASSIGNMENT_EXPRESSION = typeof T_ASSIGNMENT_EXPRESSION;
373
+
364
374
  declare interface AssignmentExpression extends ExpressionBase {
365
- type: "AsgnE";
375
+ type: ASSIGNMENT_EXPRESSION;
366
376
  leftValue: Expression;
367
- operator: AssignmentSymbols;
368
- operand: Expression;
377
+ op: AssignmentSymbols;
378
+ expr: Expression;
369
379
  }
370
380
 
371
381
  declare type AssignmentSymbols = "=" | "+=" | "-=" | "**=" | "*=" | "/=" | "%=" | "<<=" | ">>=" | ">>>=" | "&=" | "^=" | "|=" | "&&=" | "||=" | "??=";
@@ -380,71 +390,28 @@ declare type AuthDefinition = {
380
390
  defaultLoggedInUser?: any;
381
391
  };
382
392
 
383
- declare interface BaseNode {
384
- /**
385
- * Node type discriminator
386
- */
387
- type: Node_2["type"];
388
- /**
389
- * Start position (inclusive) of the node
390
- */
391
- startPosition?: number;
392
- /**
393
- * End position (exclusive)
394
- */
395
- endPosition?: number;
396
- /**
397
- * Start line number of the start token of the node
398
- */
399
- startLine?: number;
400
- /**
401
- * End line number of the end token of the node
402
- */
403
- endLine?: number;
404
- /**
405
- * Start column number (inclusive) of the node
406
- */
407
- startColumn?: number;
408
- /**
409
- * End column number (exclusive) of the node
410
- */
411
- endColumn?: number;
412
- /**
413
- * The source code of the expression
414
- */
415
- source?: string;
416
- /**
417
- * The start token of the node
418
- */
419
- startToken?: Token;
420
- /**
421
- * The end token of the node
422
- */
423
- endToken?: Token;
424
- }
393
+ declare type BINARY_EXPRESSION = typeof T_BINARY_EXPRESSION;
425
394
 
426
395
  declare interface BinaryExpression extends ExpressionBase {
427
- type: "BinaryE";
428
- operator: BinaryOpSymbols;
396
+ type: BINARY_EXPRESSION;
397
+ op: BinaryOpSymbols;
429
398
  left: Expression;
430
399
  right: Expression;
431
400
  }
432
401
 
433
402
  declare type BinaryOpSymbols = "**" | "*" | "/" | "%" | "+" | "-" | "<<" | ">>" | ">>>" | "<" | "<=" | ">" | ">=" | "==" | "===" | "!=" | "!==" | "&" | "|" | "^" | "&&" | "||" | "??" | "in";
434
403
 
435
- declare type BlockScope = {
436
- vars: Record<string, any>;
437
- constVars?: Set<string>;
438
- returnValue?: any;
439
- };
404
+ declare type BLOCK_STATEMENT = typeof T_BLOCK_STATEMENT;
440
405
 
441
- declare interface BlockStatement extends StatementBase {
442
- type: "BlockS";
443
- statements: Statement[];
406
+ declare interface BlockStatement extends ScripNodeBase {
407
+ type: BLOCK_STATEMENT;
408
+ stmts: Statement[];
444
409
  }
445
410
 
446
- declare interface BreakStatement extends StatementBase {
447
- type: "BrkS";
411
+ declare type BREAK_STATEMENT = typeof T_BREAK_STATEMENT;
412
+
413
+ declare interface BreakStatement extends ScripNodeBase {
414
+ type: BREAK_STATEMENT;
448
415
  }
449
416
 
450
417
  export declare const Button: default_2.ForwardRefExoticComponent<{
@@ -478,9 +445,11 @@ declare type ButtonVariant = (typeof buttonVariantValues)[number];
478
445
 
479
446
  declare const buttonVariantValues: readonly ["solid", "outlined", "ghost"];
480
447
 
448
+ declare type CALCULATED_MEMBER_ACCESS_EXPRESSION = typeof T_CALCULATED_MEMBER_ACCESS_EXPRESSION;
449
+
481
450
  declare interface CalculatedMemberAccessExpression extends ExpressionBase {
482
- type: "CMembE";
483
- object: Expression;
451
+ type: CALCULATED_MEMBER_ACCESS_EXPRESSION;
452
+ obj: Expression;
484
453
  member: Expression;
485
454
  }
486
455
 
@@ -743,17 +712,20 @@ export declare interface CompoundComponentDef extends Scriptable {
743
712
  debug?: Record<string, any>;
744
713
  }
745
714
 
715
+ declare type CONDITIONAL_EXPRESSION = typeof T_CONDITIONAL_EXPRESSION;
716
+
746
717
  declare interface ConditionalExpression extends ExpressionBase {
747
- type: "CondE";
748
- condition: Expression;
749
- consequent: Expression;
750
- alternate: Expression;
718
+ type: CONDITIONAL_EXPRESSION;
719
+ cond: Expression;
720
+ thenE: Expression;
721
+ elseE: Expression;
751
722
  }
752
723
 
753
- declare interface ConstStatement extends StatementBase {
754
- type: "ConstS";
755
- declarations: VarDeclaration[];
756
- isExported?: boolean;
724
+ declare type CONST_STATEMENT = typeof T_CONST_STATEMENT;
725
+
726
+ declare interface ConstStatement extends ScripNodeBase {
727
+ type: CONST_STATEMENT;
728
+ decls: VarDeclaration[];
757
729
  }
758
730
 
759
731
  /**
@@ -762,8 +734,10 @@ declare interface ConstStatement extends StatementBase {
762
734
  */
763
735
  declare type ContainerState = Record<string | symbol, any>;
764
736
 
765
- declare interface ContinueStatement extends StatementBase {
766
- type: "ContS";
737
+ declare type CONTINUE_STATEMENT = typeof T_CONTINUE_STATEMENT;
738
+
739
+ declare interface ContinueStatement extends ScripNodeBase {
740
+ type: CONTINUE_STATEMENT;
767
741
  }
768
742
 
769
743
  /**
@@ -803,21 +777,25 @@ declare type DefaultThemeVars = Record<string | ThemeTone_2, string | Record<str
803
777
 
804
778
  declare type DefaultValueDescriptor = (string | ThemeIdDescriptor)[];
805
779
 
780
+ declare type DESTRUCTURE = typeof T_DESTRUCTURE;
781
+
806
782
  declare interface Destructure extends DestructureBase {
807
- type: "Destr";
808
- arrayDestruct?: ArrayDestructure[];
809
- objectDestruct?: ObjectDestructure[];
783
+ type: DESTRUCTURE;
784
+ aDestr?: ArrayDestructure[];
785
+ oDestr?: ObjectDestructure[];
810
786
  }
811
787
 
812
788
  declare interface DestructureBase extends ExpressionBase {
813
789
  id?: string;
814
- arrayDestruct?: ArrayDestructure[];
815
- objectDestruct?: ObjectDestructure[];
790
+ aDestr?: ArrayDestructure[];
791
+ oDestr?: ObjectDestructure[];
816
792
  }
817
793
 
818
- declare interface DoWhileStatement extends StatementBase {
819
- type: "DoWS";
820
- condition: Expression;
794
+ declare type DO_WHILE_STATEMENT = typeof T_DO_WHILE_STATEMENT;
795
+
796
+ declare interface DoWhileStatement extends ScripNodeBase {
797
+ type: DO_WHILE_STATEMENT;
798
+ cond: Expression;
821
799
  body: Statement;
822
800
  }
823
801
 
@@ -841,8 +819,10 @@ declare interface DynamicChildComponentDef extends ComponentDef {
841
819
  childToRender: ComponentDef;
842
820
  }
843
821
 
844
- declare interface EmptyStatement extends StatementBase {
845
- type: "EmptyS";
822
+ declare type EMPTY_STATEMENT = typeof T_EMPTY_STATEMENT;
823
+
824
+ declare interface EmptyStatement extends ScripNodeBase {
825
+ type: EMPTY_STATEMENT;
846
826
  }
847
827
 
848
828
  /**
@@ -880,18 +860,17 @@ export declare class ErrorBoundary extends default_2.Component<Props, State> {
880
860
  render(): string | number | boolean | Iterable<default_2.ReactNode> | JSX_2.Element;
881
861
  }
882
862
 
883
- declare type Expression = UnaryExpression | BinaryExpression | SequenceExpression | ConditionalExpression | FunctionInvocationExpression | MemberAccessExpression | CalculatedMemberAccessExpression | Identifier | Literal | ArrayLiteral | ObjectLiteral | SpreadExpression | AssignmentExpression | NoArgExpression | ArrowExpression | PrefixOpExpression | PostfixOpExpression | ReactiveVarDeclaration | VarDeclaration | Destructure | ObjectDestructure | ArrayDestructure | TemplateLiteralExpression;
863
+ declare type Expression = UnaryExpression | BinaryExpression | SequenceExpression | ConditionalExpression | FunctionInvocationExpression | MemberAccessExpression | CalculatedMemberAccessExpression | Identifier | TemplateLiteralExpression | Literal | ArrayLiteral | ObjectLiteral | SpreadExpression | AssignmentExpression | NoArgExpression | ArrowExpression | PrefixOpExpression | PostfixOpExpression | ReactiveVarDeclaration | VarDeclaration | Destructure | ObjectDestructure | ArrayDestructure | SwitchCase;
884
864
 
885
- declare interface ExpressionBase extends BaseNode {
886
- value?: any;
865
+ declare type EXPRESSION_STATEMENT = typeof T_EXPRESSION_STATEMENT;
866
+
867
+ declare interface ExpressionBase extends ScripNodeBase {
887
868
  parenthesized?: number;
888
- valueScope?: any;
889
- valueIndex?: string | number;
890
869
  }
891
870
 
892
- declare interface ExpressionStatement extends StatementBase {
893
- type: "ExprS";
894
- expression: Expression;
871
+ declare interface ExpressionStatement extends ScripNodeBase {
872
+ type: EXPRESSION_STATEMENT;
873
+ expr: Expression;
895
874
  }
896
875
 
897
876
  declare interface Extension {
@@ -968,50 +947,66 @@ declare type FontDef_2 = {
968
947
  src: string;
969
948
  } | string;
970
949
 
971
- declare interface ForInStatement extends StatementBase {
972
- type: "ForInS";
973
- varBinding: ForVarBinding;
974
- id: string;
975
- expression: Expression;
950
+ declare type FOR_IN_STATEMENT = typeof T_FOR_IN_STATEMENT;
951
+
952
+ declare type FOR_OF_STATEMENT = typeof T_FOR_OF_STATEMENT;
953
+
954
+ declare type FOR_STATEMENT = typeof T_FOR_STATEMENT;
955
+
956
+ declare interface ForInStatement extends ScripNodeBase {
957
+ type: FOR_IN_STATEMENT;
958
+ varB: ForVarBinding;
959
+ id: Identifier;
960
+ expr: Expression;
976
961
  body: Statement;
977
- keys?: string[];
978
- keyIndex?: number;
979
962
  }
980
963
 
981
- declare interface ForOfStatement extends StatementBase {
982
- type: "ForOfS";
983
- varBinding: ForVarBinding;
984
- id: string;
985
- expression: Expression;
964
+ declare interface ForOfStatement extends ScripNodeBase {
965
+ type: FOR_OF_STATEMENT;
966
+ varB: ForVarBinding;
967
+ id: Identifier;
968
+ expr: Expression;
986
969
  body: Statement;
987
- iterator?: any;
988
970
  }
989
971
 
990
- declare interface ForStatement extends StatementBase {
991
- type: "ForS";
972
+ declare interface ForStatement extends ScripNodeBase {
973
+ type: FOR_STATEMENT;
992
974
  init?: ExpressionStatement | LetStatement;
993
- condition?: Expression;
994
- update?: Expression;
975
+ cond?: Expression;
976
+ upd?: Expression;
995
977
  body: Statement;
996
978
  }
997
979
 
998
980
  declare type ForVarBinding = "let" | "const" | "none";
999
981
 
1000
- declare interface FunctionDeclaration extends StatementBase {
1001
- type: "FuncD";
1002
- name?: string;
982
+ declare type FUNCTION_DECLARATION = typeof T_FUNCTION_DECLARATION;
983
+
984
+ declare type FUNCTION_INVOCATION_EXPRESSION = typeof T_FUNCTION_INVOCATION_EXPRESSION;
985
+
986
+ declare interface FunctionDeclaration extends ScripNodeBase {
987
+ type: FUNCTION_DECLARATION;
988
+ id: Identifier;
1003
989
  args: Expression[];
1004
- statement: BlockStatement;
1005
- isExported?: boolean;
1006
- closureContext?: BlockScope[];
990
+ stmt: BlockStatement;
1007
991
  }
1008
992
 
1009
993
  declare interface FunctionInvocationExpression extends ExpressionBase {
1010
- type: "InvokeE";
1011
- object: Expression;
994
+ type: FUNCTION_INVOCATION_EXPRESSION;
995
+ obj: Expression;
1012
996
  arguments: Expression[];
1013
997
  }
1014
998
 
999
+ declare type GenericToken<T> = {
1000
+ text: string;
1001
+ type: T;
1002
+ startPosition: number;
1003
+ endPosition: number;
1004
+ startLine: number;
1005
+ endLine: number;
1006
+ startColumn: number;
1007
+ endColumn: number;
1008
+ };
1009
+
1015
1010
  export declare function getColor(varName: string, format?: "hex" | "rgb" | "hsl"): string;
1016
1011
 
1017
1012
  declare type GlobalProps = Record<string, any>;
@@ -1032,24 +1027,21 @@ declare type IconPosition = (typeof iconPositionValues)[number];
1032
1027
 
1033
1028
  declare const iconPositionValues: readonly ["start", "end"];
1034
1029
 
1030
+ declare type IDENTIFIER = typeof T_IDENTIFIER;
1031
+
1035
1032
  declare interface Identifier extends ExpressionBase {
1036
- type: "IdE";
1033
+ type: IDENTIFIER;
1037
1034
  name: string;
1038
1035
  isGlobal?: boolean;
1039
1036
  }
1040
1037
 
1041
- declare interface IfStatement extends StatementBase {
1042
- type: "IfS";
1043
- condition: Expression;
1044
- thenBranch: Statement;
1045
- elseBranch?: Statement;
1046
- }
1038
+ declare type IF_STATEMENT = typeof T_IF_STATEMENT;
1047
1039
 
1048
- declare interface ImportDeclaration extends StatementBase {
1049
- type: "ImportD";
1050
- imports: Record<string, string>;
1051
- moduleFile: string;
1052
- module?: ScriptModule | null;
1040
+ declare interface IfStatement extends ScripNodeBase {
1041
+ type: IF_STATEMENT;
1042
+ cond: Expression;
1043
+ thenB: Statement;
1044
+ elseB?: Statement;
1053
1045
  }
1054
1046
 
1055
1047
  declare type InterceptorOperationDef = {
@@ -1091,13 +1083,17 @@ declare type LayoutContext<T extends ComponentDef = ComponentDef> = {
1091
1083
  [key: string]: any;
1092
1084
  };
1093
1085
 
1094
- declare interface LetStatement extends StatementBase {
1095
- type: "LetS";
1096
- declarations: VarDeclaration[];
1086
+ declare type LET_STATEMENT = typeof T_LET_STATEMENT;
1087
+
1088
+ declare interface LetStatement extends ScripNodeBase {
1089
+ type: LET_STATEMENT;
1090
+ decls: VarDeclaration[];
1097
1091
  }
1098
1092
 
1093
+ declare type LITERAL = typeof T_LITERAL;
1094
+
1099
1095
  declare interface Literal extends ExpressionBase {
1100
- type: "LitE";
1096
+ type: LITERAL;
1101
1097
  value: any;
1102
1098
  }
1103
1099
 
@@ -1132,6 +1128,7 @@ declare type LookupActionOptions = {
1132
1128
  * This property declares the script code to use as a default for a particular event handler.
1133
1129
  */
1134
1130
  defaultHandler?: string;
1131
+ context?: any;
1135
1132
  };
1136
1133
 
1137
1134
  /**
@@ -1177,11 +1174,13 @@ declare type MediaSize = {
1177
1174
  sizeIndex: number;
1178
1175
  };
1179
1176
 
1177
+ declare type MEMBER_ACCESS_EXPRESSION = typeof T_MEMBER_ACCESS_EXPRESSION;
1178
+
1180
1179
  declare interface MemberAccessExpression extends ExpressionBase {
1181
- type: "MembE";
1182
- object: Expression;
1180
+ type: MEMBER_ACCESS_EXPRESSION;
1181
+ obj: Expression;
1183
1182
  member: string;
1184
- isOptional?: boolean;
1183
+ opt?: boolean;
1185
1184
  }
1186
1185
 
1187
1186
  declare type Message = ValueOrFunction<Renderable, Toast>;
@@ -1191,20 +1190,24 @@ declare type Message = ValueOrFunction<Renderable, Toast>;
1191
1190
  */
1192
1191
  declare type ModuleErrors = Record<string, ScriptParserErrorMessage[]>;
1193
1192
 
1193
+ declare type NO_ARG_EXPRESSION = typeof T_NO_ARG_EXPRESSION;
1194
+
1194
1195
  declare interface NoArgExpression extends ExpressionBase {
1195
- type: "NoArgE";
1196
+ type: NO_ARG_EXPRESSION;
1196
1197
  }
1197
1198
 
1198
- declare type Node_2 = Statement | Expression | SwitchCase;
1199
+ declare type OBJECT_DESTRUCTURE = typeof T_OBJECT_DESTRUCTURE;
1200
+
1201
+ declare type OBJECT_LITERAL = typeof T_OBJECT_LITERAL;
1199
1202
 
1200
1203
  declare interface ObjectDestructure extends DestructureBase {
1201
- type: "ODestr";
1204
+ type: OBJECT_DESTRUCTURE;
1202
1205
  id: string;
1203
1206
  alias?: string;
1204
1207
  }
1205
1208
 
1206
1209
  declare interface ObjectLiteral extends ExpressionBase {
1207
- type: "OLitE";
1210
+ type: OBJECT_LITERAL;
1208
1211
  props: (SpreadExpression | [Expression, Expression])[];
1209
1212
  }
1210
1213
 
@@ -1225,16 +1228,20 @@ declare interface ParentRenderContext {
1225
1228
  */
1226
1229
  export declare function parseScssVar(scssStr: any): any;
1227
1230
 
1231
+ declare type POSTFIX_OP_EXPRESSION = typeof T_POSTFIX_OP_EXPRESSION;
1232
+
1228
1233
  declare interface PostfixOpExpression extends ExpressionBase {
1229
- type: "PostfE";
1230
- operator: PrefixOpSymbol;
1231
- operand: Expression;
1234
+ type: POSTFIX_OP_EXPRESSION;
1235
+ op: PrefixOpSymbol;
1236
+ expr: Expression;
1232
1237
  }
1233
1238
 
1239
+ declare type PREFIX_OP_EXPRESSION = typeof T_PREFIX_OP_EXPRESSION;
1240
+
1234
1241
  declare interface PrefixOpExpression extends ExpressionBase {
1235
- type: "PrefE";
1236
- operator: PrefixOpSymbol;
1237
- operand: Expression;
1242
+ type: PREFIX_OP_EXPRESSION;
1243
+ op: PrefixOpSymbol;
1244
+ expr: Expression;
1238
1245
  }
1239
1246
 
1240
1247
  declare type PrefixOpSymbol = "++" | "--";
@@ -1270,10 +1277,12 @@ declare type Props_2 = {
1270
1277
  onMount?: any;
1271
1278
  };
1272
1279
 
1280
+ declare type REACTIVE_VAR_DECLARATION = typeof T_REACTIVE_VAR_DECLARATION;
1281
+
1273
1282
  declare interface ReactiveVarDeclaration extends ExpressionBase {
1274
- type: "RVarD";
1275
- id: string;
1276
- expression: Expression;
1283
+ type: REACTIVE_VAR_DECLARATION;
1284
+ id: Identifier;
1285
+ expr: Expression;
1277
1286
  }
1278
1287
 
1279
1288
  /**
@@ -1323,9 +1332,11 @@ export declare interface RendererContext<TMd extends ComponentMetadata = Compone
1323
1332
  layoutCss: CSSProperties;
1324
1333
  }
1325
1334
 
1326
- declare interface ReturnStatement extends StatementBase {
1327
- type: "RetS";
1328
- expression?: Expression;
1335
+ declare type RETURN_STATEMENT = typeof T_RETURN_STATEMENT;
1336
+
1337
+ declare interface ReturnStatement extends ScripNodeBase {
1338
+ type: RETURN_STATEMENT;
1339
+ expr?: Expression;
1329
1340
  }
1330
1341
 
1331
1342
  declare type SchemaDescriptor = {
@@ -1334,6 +1345,13 @@ declare type SchemaDescriptor = {
1334
1345
  dtos?: any;
1335
1346
  };
1336
1347
 
1348
+ declare interface ScripNodeBase {
1349
+ type: ScriptNode["type"];
1350
+ nodeId: number;
1351
+ startToken?: ScriptingToken;
1352
+ endToken?: ScriptingToken;
1353
+ }
1354
+
1337
1355
  /**
1338
1356
  * This interface holds the properties representing a scriptable component definition.
1339
1357
  */
@@ -1352,20 +1370,9 @@ declare interface Scriptable {
1352
1370
  scriptError?: any;
1353
1371
  }
1354
1372
 
1355
- /**
1356
- * Represents a parsed and resolved module
1357
- */
1358
- declare type ScriptModule = {
1359
- type: "ScriptModule";
1360
- name: string;
1361
- parent?: ScriptModule | null;
1362
- exports: Map<string, any>;
1363
- imports: Record<string, Record<string, any>>;
1364
- importedModules: ScriptModule[];
1365
- functions: Record<string, FunctionDeclaration>;
1366
- statements: Statement[];
1367
- executed: boolean;
1368
- };
1373
+ declare type ScriptingToken = GenericToken<TokenType>;
1374
+
1375
+ declare type ScriptNode = Statement | Expression;
1369
1376
 
1370
1377
  declare interface ScriptParserErrorMessage {
1371
1378
  code: ScriptParsingErrorCodes;
@@ -1377,9 +1384,11 @@ declare interface ScriptParserErrorMessage {
1377
1384
 
1378
1385
  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";
1379
1386
 
1387
+ declare type SEQUENCE_EXPRESSION = typeof T_SEQUENCE_EXPRESSION;
1388
+
1380
1389
  declare interface SequenceExpression extends ExpressionBase {
1381
- type: "SeqE";
1382
- expressions: Expression[];
1390
+ type: SEQUENCE_EXPRESSION;
1391
+ exprs: Expression[];
1383
1392
  loose?: boolean;
1384
1393
  }
1385
1394
 
@@ -1400,9 +1409,11 @@ declare type SplitterProps = {
1400
1409
  maxPrimarySize?: string;
1401
1410
  };
1402
1411
 
1412
+ declare type SPREAD_EXPRESSION = typeof T_SPREAD_EXPRESSION;
1413
+
1403
1414
  declare interface SpreadExpression extends ExpressionBase {
1404
- type: "SpreadE";
1405
- operand: Expression;
1415
+ type: SPREAD_EXPRESSION;
1416
+ expr: Expression;
1406
1417
  }
1407
1418
 
1408
1419
  export declare const Stack: ForwardRefExoticComponent<Props_2 & RefAttributes<any>>;
@@ -1495,25 +1506,21 @@ declare type State = {
1495
1506
  error: Error | null;
1496
1507
  };
1497
1508
 
1498
- declare type Statement = BlockStatement | EmptyStatement | ExpressionStatement | ArrowExpressionStatement | LetStatement | ConstStatement | VarStatement | IfStatement | ReturnStatement | BreakStatement | ContinueStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | ThrowStatement | TryStatement | SwitchStatement | FunctionDeclaration | ImportDeclaration;
1509
+ declare type Statement = BlockStatement | EmptyStatement | ExpressionStatement | ArrowExpressionStatement | LetStatement | ConstStatement | VarStatement | IfStatement | ReturnStatement | BreakStatement | ContinueStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | ThrowStatement | TryStatement | SwitchStatement | FunctionDeclaration;
1499
1510
 
1500
- declare interface StatementBase extends BaseNode {
1501
- guard?: boolean;
1502
- removeBlockScope?: boolean;
1503
- completeTryBlock?: boolean;
1504
- completeCatchBlock?: boolean;
1505
- completeFinallyBlock?: boolean;
1506
- }
1511
+ declare type SWITCH_CASE = typeof T_SWITCH_CASE;
1512
+
1513
+ declare type SWITCH_STATEMENT = typeof T_SWITCH_STATEMENT;
1507
1514
 
1508
- declare interface SwitchCase extends BaseNode {
1509
- type: "SwitchC";
1510
- caseExpression?: Expression;
1511
- statements?: Statement[];
1515
+ declare interface SwitchCase extends ExpressionBase {
1516
+ type: SWITCH_CASE;
1517
+ caseE?: Expression;
1518
+ stmts?: Statement[];
1512
1519
  }
1513
1520
 
1514
- declare interface SwitchStatement extends StatementBase {
1515
- type: "SwitchS";
1516
- expression: Expression;
1521
+ declare interface SwitchStatement extends ScripNodeBase {
1522
+ type: SWITCH_STATEMENT;
1523
+ expr: Expression;
1517
1524
  cases: SwitchCase[];
1518
1525
  }
1519
1526
 
@@ -1522,6 +1529,94 @@ declare interface SwitchStatement extends StatementBase {
1522
1529
  */
1523
1530
  declare type SyncFunction = (...args: any) => any;
1524
1531
 
1532
+ declare const T_ARRAY_DESTRUCTURE = 202;
1533
+
1534
+ declare const T_ARRAY_LITERAL = 110;
1535
+
1536
+ declare const T_ARROW_EXPRESSION = 115;
1537
+
1538
+ declare const T_ARROW_EXPRESSION_STATEMENT = 4;
1539
+
1540
+ declare const T_ASSIGNMENT_EXPRESSION = 113;
1541
+
1542
+ declare const T_BINARY_EXPRESSION = 101;
1543
+
1544
+ declare const T_BLOCK_STATEMENT = 1;
1545
+
1546
+ declare const T_BREAK_STATEMENT = 10;
1547
+
1548
+ declare const T_CALCULATED_MEMBER_ACCESS_EXPRESSION = 106;
1549
+
1550
+ declare const T_CONDITIONAL_EXPRESSION = 103;
1551
+
1552
+ declare const T_CONST_STATEMENT = 6;
1553
+
1554
+ declare const T_CONTINUE_STATEMENT = 11;
1555
+
1556
+ declare const T_DESTRUCTURE = 201;
1557
+
1558
+ declare const T_DO_WHILE_STATEMENT = 13;
1559
+
1560
+ declare const T_EMPTY_STATEMENT = 2;
1561
+
1562
+ declare const T_EXPRESSION_STATEMENT = 3;
1563
+
1564
+ declare const T_FOR_IN_STATEMENT = 15;
1565
+
1566
+ declare const T_FOR_OF_STATEMENT = 16;
1567
+
1568
+ declare const T_FOR_STATEMENT = 14;
1569
+
1570
+ declare const T_FUNCTION_DECLARATION = 20;
1571
+
1572
+ declare const T_FUNCTION_INVOCATION_EXPRESSION = 104;
1573
+
1574
+ declare const T_IDENTIFIER = 107;
1575
+
1576
+ declare const T_IF_STATEMENT = 8;
1577
+
1578
+ declare const T_LET_STATEMENT = 5;
1579
+
1580
+ declare const T_LITERAL = 109;
1581
+
1582
+ declare const T_MEMBER_ACCESS_EXPRESSION = 105;
1583
+
1584
+ declare const T_NO_ARG_EXPRESSION = 114;
1585
+
1586
+ declare const T_OBJECT_DESTRUCTURE = 203;
1587
+
1588
+ declare const T_OBJECT_LITERAL = 111;
1589
+
1590
+ declare const T_POSTFIX_OP_EXPRESSION = 117;
1591
+
1592
+ declare const T_PREFIX_OP_EXPRESSION = 116;
1593
+
1594
+ declare const T_REACTIVE_VAR_DECLARATION = 118;
1595
+
1596
+ declare const T_RETURN_STATEMENT = 9;
1597
+
1598
+ declare const T_SEQUENCE_EXPRESSION = 102;
1599
+
1600
+ declare const T_SPREAD_EXPRESSION = 112;
1601
+
1602
+ declare const T_SWITCH_CASE = 204;
1603
+
1604
+ declare const T_SWITCH_STATEMENT = 19;
1605
+
1606
+ declare const T_TEMPLATE_LITERAL_EXPRESSION = 108;
1607
+
1608
+ declare const T_THROW_STATEMENT = 17;
1609
+
1610
+ declare const T_TRY_STATEMENT = 18;
1611
+
1612
+ declare const T_UNARY_EXPRESSION = 100;
1613
+
1614
+ declare const T_VAR_DECLARATION = 200;
1615
+
1616
+ declare const T_VAR_STATEMENT = 7;
1617
+
1618
+ declare const T_WHILE_STATEMENT = 12;
1619
+
1525
1620
  declare type TableDescriptor = {
1526
1621
  name: string;
1527
1622
  fields?: Record<string, any>;
@@ -1529,8 +1624,10 @@ declare type TableDescriptor = {
1529
1624
  indexes?: Array<string>;
1530
1625
  };
1531
1626
 
1627
+ declare type TEMPLATE_LITERAL_EXPRESSION = typeof T_TEMPLATE_LITERAL_EXPRESSION;
1628
+
1532
1629
  declare interface TemplateLiteralExpression extends ExpressionBase {
1533
- type: "TempLitE";
1630
+ type: TEMPLATE_LITERAL_EXPRESSION;
1534
1631
  segments: (Literal | Expression)[];
1535
1632
  }
1536
1633
 
@@ -1668,9 +1765,11 @@ declare const ThemeToneKeys: readonly ["light", "dark"];
1668
1765
  */
1669
1766
  declare const ThemeToneKeys_2: readonly ["light", "dark"];
1670
1767
 
1671
- declare interface ThrowStatement extends StatementBase {
1672
- type: "ThrowS";
1673
- expression: Expression;
1768
+ declare type THROW_STATEMENT = typeof T_THROW_STATEMENT;
1769
+
1770
+ declare interface ThrowStatement extends ScripNodeBase {
1771
+ type: THROW_STATEMENT;
1772
+ expr: Expression;
1674
1773
  }
1675
1774
 
1676
1775
  declare type ToastHandler = (message: Message, options?: ToastOptions) => string;
@@ -1681,22 +1780,7 @@ declare type ToastHandler = (message: Message, options?: ToastOptions) => string
1681
1780
  */
1682
1781
  export declare function toCssVar(c: string | ThemeIdDescriptor): string;
1683
1782
 
1684
- declare type Token = {
1685
- readonly text: string;
1686
- readonly type: TokenType;
1687
- readonly location: TokenLocation;
1688
- };
1689
-
1690
- declare interface TokenLocation {
1691
- readonly startPosition: number;
1692
- readonly endPosition: number;
1693
- readonly startLine: number;
1694
- readonly endLine: number;
1695
- readonly startColumn: number;
1696
- readonly endColumn: number;
1697
- }
1698
-
1699
- declare const enum TokenType {
1783
+ declare enum TokenType {
1700
1784
  Eof = -1,
1701
1785
  Ws = -2,
1702
1786
  BlockComment = -3,
@@ -1797,10 +1881,8 @@ declare const enum TokenType {
1797
1881
  Default = 93,
1798
1882
  Delete = 94,
1799
1883
  Function = 95,
1800
- Export = 96,
1801
- Import = 97,
1802
- As = 98,
1803
- From = 99
1884
+ As = 96,
1885
+ From = 97
1804
1886
  }
1805
1887
 
1806
1888
  export declare interface TreeNode {
@@ -1816,18 +1898,22 @@ export declare interface TreeNode {
1816
1898
  [x: string]: any;
1817
1899
  }
1818
1900
 
1819
- declare interface TryStatement extends StatementBase {
1820
- type: "TryS";
1821
- tryBlock: BlockStatement;
1822
- catchBlock?: BlockStatement;
1823
- catchVariable?: string;
1824
- finallyBlock?: BlockStatement;
1901
+ declare type TRY_STATEMENT = typeof T_TRY_STATEMENT;
1902
+
1903
+ declare interface TryStatement extends ScripNodeBase {
1904
+ type: TRY_STATEMENT;
1905
+ tryB: BlockStatement;
1906
+ catchB?: BlockStatement;
1907
+ catchV?: Identifier;
1908
+ finallyB?: BlockStatement;
1825
1909
  }
1826
1910
 
1911
+ declare type UNARY_EXPRESSION = typeof T_UNARY_EXPRESSION;
1912
+
1827
1913
  declare interface UnaryExpression extends ExpressionBase {
1828
- type: "UnaryE";
1829
- operator: UnaryOpSymbols;
1830
- operand: Expression;
1914
+ type: UNARY_EXPRESSION;
1915
+ op: UnaryOpSymbols;
1916
+ expr: Expression;
1831
1917
  }
1832
1918
 
1833
1919
  declare type UnaryOpSymbols = "+" | "-" | "~" | "!" | "typeof" | "delete";
@@ -1902,22 +1988,28 @@ declare type ValueExtractor = {
1902
1988
  asSize(expression?: any): string;
1903
1989
  };
1904
1990
 
1991
+ declare type VAR_DECLARATION = typeof T_VAR_DECLARATION;
1992
+
1993
+ declare type VAR_STATEMENT = typeof T_VAR_STATEMENT;
1994
+
1905
1995
  declare interface VarDeclaration extends ExpressionBase {
1906
- type: "VarD";
1996
+ type: VAR_DECLARATION;
1907
1997
  id?: string;
1908
- arrayDestruct?: ArrayDestructure[];
1909
- objectDestruct?: ObjectDestructure[];
1910
- expression?: Expression;
1998
+ aDestr?: ArrayDestructure[];
1999
+ oDestr?: ObjectDestructure[];
2000
+ expr?: Expression;
1911
2001
  }
1912
2002
 
1913
- declare interface VarStatement extends StatementBase {
1914
- type: "VarS";
1915
- declarations: ReactiveVarDeclaration[];
2003
+ declare interface VarStatement extends ScripNodeBase {
2004
+ type: VAR_STATEMENT;
2005
+ decls: ReactiveVarDeclaration[];
1916
2006
  }
1917
2007
 
1918
- declare interface WhileStatement extends StatementBase {
1919
- type: "WhileS";
1920
- condition: Expression;
2008
+ declare type WHILE_STATEMENT = typeof T_WHILE_STATEMENT;
2009
+
2010
+ declare interface WhileStatement extends ScripNodeBase {
2011
+ type: WHILE_STATEMENT;
2012
+ cond: Expression;
1921
2013
  body: Statement;
1922
2014
  }
1923
2015