xmlui 0.8.6 → 0.9.0

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-B1u6prJM.mjs} +1 -1
  2. package/dist/{index-wd8FRzuM.mjs → index-CVvazA5D.mjs} +5849 -6109
  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 +177 -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 +6754 -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
@@ -49,18 +49,10 @@ exports.RadioGroupMd = (0, ComponentDefs_1.createMetadata)({
49
49
  [`textColor-${RGOption}-error`]: `$borderColor-${RGOption}-error`,
50
50
  [`textColor-${RGOption}-warning`]: `$borderColor-${RGOption}-warning`,
51
51
  [`textColor-${RGOption}-success`]: `$borderColor-${RGOption}-success`,
52
- light: {
53
- [`backgroundColor-checked-${RGOption}-default`]: "$color-primary-500",
54
- [`borderColor-${RGOption}-default`]: "$color-surface-500",
55
- [`borderColor-${RGOption}-default--hover`]: "$color-surface-700",
56
- [`borderColor-${RGOption}-default--active`]: "$color-primary-500",
57
- },
58
- dark: {
59
- [`backgroundColor-checked-${RGOption}-default`]: "$color-primary-500",
60
- [`borderColor-${RGOption}-default`]: "$color-surface-500",
61
- [`borderColor-${RGOption}-default--hover`]: "$color-surface-300",
62
- [`borderColor-${RGOption}-default--active`]: "$color-primary-400",
63
- },
52
+ [`backgroundColor-checked-${RGOption}-default`]: "$color-primary-500",
53
+ [`borderColor-${RGOption}-default`]: "$color-surface-500",
54
+ [`borderColor-${RGOption}-default--hover`]: "$color-surface-700",
55
+ [`borderColor-${RGOption}-default--active`]: "$color-primary-500",
64
56
  },
65
57
  });
66
58
  exports.radioGroupRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.RadioGroupMd, ({ node, extractValue, layoutCss, state, updateState, lookupEventHandler, renderChild, registerComponentApi, }) => {
@@ -54,7 +54,7 @@ exports.SelectMd = (0, ComponentDefs_1.createMetadata)({
54
54
  },
55
55
  themeVars: (0, themeVars_1.parseScssVar)(Select_module_scss_1.default.themeVars),
56
56
  defaultThemeVars: {
57
- [`backgroundColor-menu-${COMP}`]: "$backgroundColor-primary",
57
+ [`backgroundColor-menu-${COMP}`]: "$color-surface-raised",
58
58
  [`boxShadow-menu-${COMP}`]: "$boxShadow-md",
59
59
  [`borderRadius-menu-${COMP}`]: "$borderRadius",
60
60
  [`borderWidth-menu-${COMP}`]: "1px",
@@ -69,18 +69,10 @@ exports.SelectMd = (0, ComponentDefs_1.createMetadata)({
69
69
  [`paddingVertical-${COMP}-badge`]: "$space-1",
70
70
  [`opacity-text-item-${COMP}--disabled`]: "0.5",
71
71
  [`opacity-${COMP}--disabled`]: "0.5",
72
- light: {
73
- [`backgroundColor-${COMP}-badge--hover`]: "$color-primary-400",
74
- [`backgroundColor-${COMP}-badge--active`]: "$color-primary-500",
75
- [`textColor-item-${COMP}--disabled`]: "$color-surface-200",
76
- [`textColor-${COMP}-badge`]: "$color-surface-50",
77
- },
78
- dark: {
79
- [`backgroundColor-${COMP}-badge--hover`]: "$color-primary-600",
80
- [`backgroundColor-${COMP}-badge--active`]: "$color-primary-500",
81
- [`textColor-${COMP}-badge`]: "$color-surface-50",
82
- [`textColor-item-${COMP}--disabled`]: "$color-surface-800",
83
- },
72
+ [`backgroundColor-${COMP}-badge--hover`]: "$color-primary-400",
73
+ [`backgroundColor-${COMP}-badge--active`]: "$color-primary-500",
74
+ [`textColor-item-${COMP}--disabled`]: "$color-surface-200",
75
+ [`textColor-${COMP}-badge`]: "$color-surface-50",
84
76
  },
85
77
  });
86
78
  exports.selectComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.SelectMd, ({ node, state, updateState, extractValue, renderChild, lookupEventHandler, layoutCss, registerComponentApi, }) => {
@@ -182,9 +182,13 @@ exports.Select = (0, react_1.forwardRef)(function Select({ id, initialValue, val
182
182
  exports.ComboboxOption = (0, react_1.forwardRef)(function Combobox(option, forwardedRef) {
183
183
  const id = (0, react_1.useId)();
184
184
  const { label, value, enabled = true, keywords } = option;
185
- const { value: selectedValue, onChange, multi, optionLabelRenderer } = (0, SelectContext_1.useSelect)();
186
- const selected = Array.isArray(selectedValue) && multi ? selectedValue.includes(value) : selectedValue === value;
187
- return ((0, jsx_runtime_1.jsxs)(cmdk_1.CommandItem, { id: id, ref: forwardedRef, disabled: !enabled, value: value, className: Select_module_scss_1.default.multiComboboxOption, onSelect: () => {
185
+ const { value: selectedValue, onChange, multiSelect, optionLabelRenderer } = (0, SelectContext_1.useSelect)();
186
+ const selected = (0, react_1.useMemo)(() => {
187
+ return Array.isArray(selectedValue) && multiSelect
188
+ ? selectedValue.includes(value)
189
+ : selectedValue === value;
190
+ }, [selectedValue, value, multiSelect]);
191
+ return ((0, jsx_runtime_1.jsxs)(cmdk_1.CommandItem, { id: id, ref: forwardedRef, disabled: !enabled, value: `${value}`, className: Select_module_scss_1.default.multiComboboxOption, onSelect: () => {
188
192
  onChange(value);
189
193
  }, "data-state": selected ? "checked" : undefined, keywords: keywords, children: [optionLabelRenderer ? optionLabelRenderer({ label, value }) : label, selected && (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "checkmark" })] }, id));
190
194
  });
@@ -53,14 +53,8 @@ exports.SliderMd = (0, ComponentDefs_1.createMetadata)({
53
53
  [`borderColor-thumb-${COMP}`]: "$color-surface-50",
54
54
  [`backgroundColor-thumb-${COMP}`]: "$color-primary",
55
55
  [`boxShadow-thumb-${COMP}`]: "$boxShadow-md",
56
- light: {
57
- [`backgroundColor-track-${COMP}--disabled`]: "$color-surface-300",
58
- [`backgroundColor-range-${COMP}--disabled`]: "$color-surface-400",
59
- },
60
- dark: {
61
- [`backgroundColor-track-${COMP}--disabled`]: "$color-surface-600",
62
- [`backgroundColor-range-${COMP}--disabled`]: "$color-surface-800",
63
- },
56
+ [`backgroundColor-track-${COMP}--disabled`]: "$color-surface-300",
57
+ [`backgroundColor-range-${COMP}--disabled`]: "$color-surface-400",
64
58
  },
65
59
  });
66
60
  exports.sliderComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.SliderMd, ({ node, extractValue, lookupEventHandler, layoutCss, updateState, state, registerComponentApi, }) => {
@@ -31,12 +31,7 @@ exports.SpinnerMd = (0, ComponentDefs_1.createMetadata)({
31
31
  defaultThemeVars: {
32
32
  [`size-${COMP}`]: "$space-10",
33
33
  [`thickness-${COMP}`]: "$space-0_5",
34
- light: {
35
- [`borderColor-${COMP}`]: "$color-surface-400",
36
- },
37
- dark: {
38
- [`borderColor-${COMP}`]: "$color-surface-600",
39
- },
34
+ [`borderColor-${COMP}`]: "$color-surface-400",
40
35
  },
41
36
  });
42
37
  exports.spinnerComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.SpinnerMd, ({ node, layoutCss, extractValue }) => {
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.subNavPanelRenderer = exports.NavPanelMd = void 0;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const SubNavPanel_module_scss_1 = __importDefault(require("./SubNavPanel.module.scss"));
9
+ const ComponentDefs_1 = require("../../abstractions/ComponentDefs");
10
+ const renderers_1 = require("../../components-core/renderers");
11
+ const themeVars_1 = require("../../components-core/theming/themeVars");
12
+ const SubNavPanelNative_1 = require("./SubNavPanelNative");
13
+ const COMP = "SubNavPanel";
14
+ exports.NavPanelMd = (0, ComponentDefs_1.createMetadata)({
15
+ status: "experimental",
16
+ props: {},
17
+ themeVars: (0, themeVars_1.parseScssVar)(SubNavPanel_module_scss_1.default.themeVars),
18
+ defaultThemeVars: {},
19
+ });
20
+ exports.subNavPanelRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.NavPanelMd, ({ node, renderChild, layoutCss, layoutContext }) => {
21
+ return ((0, jsx_runtime_1.jsx)(SubNavPanelNative_1.SubNavPanel, { children: renderChild(node.children) }));
22
+ });
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SubNavPanel = SubNavPanel;
4
+ const react_dom_1 = require("react-dom");
5
+ const AppLayoutContext_1 = require("../App/AppLayoutContext");
6
+ function SubNavPanel(props) {
7
+ const { subNavPanelSlot } = (0, AppLayoutContext_1.useAppLayoutContext)();
8
+ return subNavPanelSlot ? (0, react_dom_1.createPortal)(props.children, subNavPanelSlot) : null;
9
+ }
@@ -48,22 +48,12 @@ exports.SwitchMd = (0, ComponentDefs_1.createMetadata)({
48
48
  [`backgroundColor-checked-${COMP}-warning`]: `$borderColor-${COMP}-warning`,
49
49
  [`borderColor-checked-${COMP}-success`]: `$borderColor-${COMP}-success`,
50
50
  [`backgroundColor-checked-${COMP}-success`]: `$borderColor-${COMP}-success`,
51
- light: {
52
- [`backgroundColor-${COMP}`]: "$color-surface-400",
53
- [`borderColor-${COMP}`]: "$color-surface-400",
54
- [`backgroundColor-indicator-${COMP}`]: "$backgroundColor-primary",
55
- [`borderColor-checked-${COMP}`]: "$color-primary-500",
56
- [`backgroundColor-checked-${COMP}`]: "$color-primary-500",
57
- [`backgroundColor-${COMP}--disabled`]: "$color-surface-200",
58
- },
59
- dark: {
60
- [`backgroundColor-${COMP}`]: "$color-surface-500",
61
- [`borderColor-${COMP}`]: "$color-surface-500",
62
- [`backgroundColor-indicator-${COMP}`]: "$backgroundColor-primary",
63
- [`borderColor-checked-${COMP}`]: "$color-primary-400",
64
- [`backgroundColor-checked-${COMP}`]: "$color-primary-400",
65
- [`backgroundColor-${COMP}--disabled`]: "$color-surface-800",
66
- },
51
+ [`backgroundColor-${COMP}`]: "$color-surface-400",
52
+ [`borderColor-${COMP}`]: "$color-surface-400",
53
+ [`backgroundColor-indicator-${COMP}`]: "$backgroundColor-primary",
54
+ [`borderColor-checked-${COMP}`]: "$color-primary-500",
55
+ [`backgroundColor-checked-${COMP}`]: "$color-primary-500",
56
+ [`backgroundColor-${COMP}--disabled`]: "$color-surface-200",
67
57
  },
68
58
  });
69
59
  exports.switchComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.SwitchMd, ({ node, extractValue, layoutCss, updateState, state, lookupEventHandler, registerComponentApi, }) => {
@@ -110,27 +110,18 @@ exports.TableMd = (0, ComponentDefs_1.createMetadata)({
110
110
  [`fontWeight-heading-${COMP}`]: "$fontWeight-bold",
111
111
  [`textTransform-heading-${COMP}`]: "uppercase",
112
112
  [`fontSize-row-${COMP}`]: "$fontSize-small",
113
- [`backgroundColor-${COMP}`]: "$backgroundColor",
114
- [`backgroundColor-row-${COMP}`]: "inherit",
113
+ // [`backgroundColor-${COMP}`]: "transparent",
114
+ // [`backgroundColor-row-${COMP}`]: "inherit",
115
115
  [`backgroundColor-selected-${COMP}--hover`]: `$backgroundColor-row-${COMP}--hover`,
116
116
  [`backgroundColor-pagination-${COMP}`]: `$backgroundColor-${COMP}`,
117
117
  [`outlineColor-heading-${COMP}--focus`]: "$outlineColor--focus",
118
118
  [`textColor-pagination-${COMP}`]: "$color-secondary",
119
- light: {
120
- [`backgroundColor-row-${COMP}--hover`]: "$color-primary-50",
121
- [`backgroundColor-selected-${COMP}`]: "$color-primary-100",
122
- [`backgroundColor-heading-${COMP}--hover`]: "$color-surface-200",
123
- [`backgroundColor-heading-${COMP}--active`]: "$color-surface-300",
124
- [`backgroundColor-heading-${COMP}`]: "$color-surface-100",
125
- [`textColor-heading-${COMP}`]: "$color-surface-500",
126
- },
127
- dark: {
128
- [`backgroundColor-row-${COMP}--hover`]: "$color-primary-900",
129
- [`backgroundColor-selected-${COMP}`]: "$color-primary-800",
130
- [`backgroundColor-heading-${COMP}--hover`]: "$color-surface-800",
131
- [`backgroundColor-heading-${COMP}`]: "$color-surface-950",
132
- [`backgroundColor-heading-${COMP}--active`]: "$color-surface-700",
133
- },
119
+ [`backgroundColor-row-${COMP}--hover`]: "$color-primary-50",
120
+ [`backgroundColor-selected-${COMP}`]: "$color-primary-100",
121
+ [`backgroundColor-heading-${COMP}--hover`]: "$color-surface-200",
122
+ [`backgroundColor-heading-${COMP}--active`]: "$color-surface-300",
123
+ [`backgroundColor-heading-${COMP}`]: "$color-surface-100",
124
+ [`textColor-heading-${COMP}`]: "$color-surface-500",
134
125
  },
135
126
  });
136
127
  const TableWithColumns = (0, react_1.forwardRef)(({ extractValue, node, renderChild, lookupEventHandler, lookupSyncCallback, layoutCss, registerComponentApi, }, ref) => {
@@ -65,18 +65,10 @@ exports.TableOfContentsMd = (0, ComponentDefs_1.createMetadata)({
65
65
  [`textTransform-${COMP}Item`]: "none",
66
66
  [`verticalAlign-${COMP}Item`]: "baseline",
67
67
  [`letterSpacing-${COMP}Item`]: "0",
68
- light: {
69
- [`color-${COMP}Item`]: "$textColor-primary",
70
- [`borderColor-${COMP}Item`]: "$borderColor",
71
- [`borderColor-${COMP}Item--active`]: "$color-primary-500",
72
- [`color-${COMP}Item--active`]: "$color-primary-500",
73
- },
74
- dark: {
75
- [`color-${COMP}Item`]: "$textColor-primary",
76
- [`borderColor-${COMP}Item`]: "$borderColor",
77
- [`borderColor-${COMP}Item--active`]: "$color-primary-500",
78
- [`color-${COMP}Item--active`]: "$textColor-secondary",
79
- },
68
+ [`color-${COMP}Item`]: "$textColor-primary",
69
+ [`borderColor-${COMP}Item`]: "$borderColor",
70
+ [`borderColor-${COMP}Item--active`]: "$color-primary-500",
71
+ [`color-${COMP}Item--active`]: "$color-primary-500",
80
72
  },
81
73
  });
82
74
  exports.tableOfContentsRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.TableOfContentsMd, ({ layoutCss, node, extractValue }) => {
@@ -40,16 +40,9 @@ exports.TabsMd = (0, ComponentDefs_1.createMetadata)({
40
40
  [`borderColor-active-${COMP}`]: "$color-primary",
41
41
  [`borderWidth-${COMP}`]: "2px",
42
42
  [`backgroundColor-trigger-${COMP}`]: "$backgroundColor-primary",
43
- light: {
44
- [`backgroundColor-trigger-${COMP}--hover`]: "$color-primary-50",
45
- [`backgroundColor-list-${COMP}`]: "$color-primary-50",
46
- [`textColor-trigger-${COMP}`]: "$color-primary-100",
47
- },
48
- dark: {
49
- [`backgroundColor-trigger-${COMP}--hover`]: "$color-primary-800",
50
- [`backgroundColor-list-${COMP}`]: "$color-primary-800",
51
- [`textColor-trigger-${COMP}`]: "$color-primary-100",
52
- },
43
+ [`backgroundColor-trigger-${COMP}--hover`]: "$color-primary-50",
44
+ [`backgroundColor-list-${COMP}`]: "$color-primary-50",
45
+ [`textColor-trigger-${COMP}`]: "$color-primary-100",
53
46
  },
54
47
  });
55
48
  exports.tabsComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.TabsMd, ({ extractValue, node, renderChild, layoutCss, registerComponentApi }) => {
@@ -100,30 +100,16 @@ exports.TextMd = (0, ComponentDefs_1.createMetadata)({
100
100
  [`marginBottom-${COMP}-tableheading`]: "$space-4",
101
101
  [`paddingHorizontal-${COMP}-tableheading`]: "$space-1",
102
102
  [`fontWeight-${COMP}-tableheading`]: "$fontWeight-bold",
103
- light: {
104
- [`backgroundColor-${COMP}-code`]: "$color-surface-100",
105
- [`borderColor-${COMP}-code`]: "$color-surface-200",
106
- [`backgroundColor-${COMP}-keyboard`]: "$color-surface-200",
107
- [`borderColor-${COMP}-keyboard`]: "$color-surface-300",
108
- [`backgroundColor-${COMP}-marked`]: "yellow",
109
- [`color-${COMP}-placeholder`]: "$color-surface-500",
110
- [`backgroundColor-${COMP}-codefence`]: "$color-primary-100",
111
- [`color-${COMP}-codefence`]: "$color-surface-900",
112
- [`color-${COMP}-subheading`]: "$textColor-secondary",
113
- [`color-${COMP}-secondary`]: "$textColor-secondary",
114
- },
115
- dark: {
116
- [`backgroundColor-${COMP}-code`]: "$color-surface-800",
117
- [`borderColor-${COMP}-code`]: "$color-surface-700",
118
- [`backgroundColor-${COMP}-keyboard`]: "$color-surface-800",
119
- [`borderColor-${COMP}-keyboard`]: "$color-surface-700",
120
- [`backgroundColor-${COMP}-marked`]: "orange",
121
- [`color-${COMP}-placeholder`]: "$color-surface-500",
122
- [`backgroundColor-${COMP}-codefence`]: "$color-primary-800",
123
- [`color-${COMP}-codefence`]: "$color-surface-200",
124
- [`color-${COMP}-subheading`]: "$textColor-secondary",
125
- [`color-${COMP}-secondary`]: "$textColor-secondary",
126
- },
103
+ [`backgroundColor-${COMP}-code`]: "$color-surface-100",
104
+ [`borderColor-${COMP}-code`]: "$color-surface-200",
105
+ [`backgroundColor-${COMP}-keyboard`]: "$color-surface-200",
106
+ [`borderColor-${COMP}-keyboard`]: "$color-surface-300",
107
+ [`backgroundColor-${COMP}-marked`]: "yellow",
108
+ [`color-${COMP}-placeholder`]: "$color-surface-500",
109
+ [`backgroundColor-${COMP}-codefence`]: "$color-primary-100",
110
+ [`color-${COMP}-codefence`]: "$color-surface-900",
111
+ [`color-${COMP}-subheading`]: "$textColor-secondary",
112
+ [`color-${COMP}-secondary`]: "$textColor-secondary",
127
113
  },
128
114
  });
129
115
  exports.textComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.TextMd, ({ node, extractValue, layoutCss, renderChild }) => {
@@ -96,7 +96,7 @@ exports.TextBox = (0, react_1.forwardRef)(function TextBox({ id, type = "text",
96
96
  setValue,
97
97
  });
98
98
  }, [focus, registerComponentApi, setValue]);
99
- return ((0, jsx_runtime_1.jsx)(ItemWithLabel_1.ItemWithLabel, { labelPosition: labelPosition, label: label, labelWidth: labelWidth, labelBreak: labelBreak, required: required, enabled: enabled, onFocus: onFocus, onBlur: onBlur, style: style, ref: ref, children: (0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(TextBox_module_scss_1.default.inputRoot, {
99
+ return ((0, jsx_runtime_1.jsx)(ItemWithLabel_1.ItemWithLabel, { labelPosition: labelPosition, label: label, labelWidth: labelWidth, labelBreak: labelBreak, required: required, enabled: enabled, style: style, ref: ref, children: (0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(TextBox_module_scss_1.default.inputRoot, {
100
100
  [TextBox_module_scss_1.default.disabled]: !enabled,
101
101
  [TextBox_module_scss_1.default.readOnly]: readOnly,
102
102
  [TextBox_module_scss_1.default.error]: validationStatus === "error",
@@ -122,7 +122,7 @@ function Theme({ id, isRoot = false, renderChild, node, tone, toastDuration = 50
122
122
  }, [devToolsEnabled, devToolsSide, devToolsSize]);
123
123
  if (isRoot) {
124
124
  const faviconUrl = getResourceUrl("resource:favicon") || "/resources/favicon.ico";
125
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(react_helmet_async_1.Helmet, { children: [!!faviconUrl && (0, jsx_runtime_1.jsx)("link", { rel: "icon", type: "image/svg+xml", href: faviconUrl }), fontLinks === null || fontLinks === void 0 ? void 0 : fontLinks.map((fontLink) => (0, jsx_runtime_1.jsx)("link", { href: fontLink, rel: "stylesheet" }, fontLink))] }), (0, jsx_runtime_1.jsx)("style", { children: `.${className} {${css}}` }), (0, jsx_runtime_1.jsxs)("div", { style: inspectStyle, id: "_ui-engine-theme-root", className: (0, classnames_1.default)(Theme_module_scss_1.default.baseRootComponent, className), ref: (el) => {
125
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(react_helmet_async_1.Helmet, { children: [!!faviconUrl && (0, jsx_runtime_1.jsx)("link", { rel: "icon", type: "image/svg+xml", href: faviconUrl }), fontLinks === null || fontLinks === void 0 ? void 0 : fontLinks.map((fontLink) => (0, jsx_runtime_1.jsx)("link", { href: fontLink, rel: "stylesheet" }, fontLink))] }), (0, jsx_runtime_1.jsx)("style", { type: "text/css", children: `:root {${css}}` }), (0, jsx_runtime_1.jsxs)("div", { style: inspectStyle, id: "_ui-engine-theme-root", className: (0, classnames_1.default)(Theme_module_scss_1.default.baseRootComponent), ref: (el) => {
126
126
  if (el) {
127
127
  setRoot(el);
128
128
  }
@@ -38,9 +38,9 @@ function ValidationSummary({ fieldValidationResults = constants_1.EMPTY_OBJECT,
38
38
  });
39
39
  return ret;
40
40
  }, [fieldValidationResults, generalValidationResults]);
41
- return ((0, jsx_runtime_1.jsxs)("div", { ref: animateContainerRef, className: ValidationSummary_module_scss_1.default.summaryContainer, children: [(0, jsx_runtime_1.jsx)(ValidationDisplay, { issues: groupedInvalidResults.warning, severity: "warning", heading: "Validation warnings" }), (0, jsx_runtime_1.jsx)(ValidationDisplay, { issues: groupedInvalidResults.error, severity: "error", heading: "Validation errors" })] }));
41
+ return ((0, jsx_runtime_1.jsxs)("div", { ref: animateContainerRef, className: ValidationSummary_module_scss_1.default.summaryContainer, "data-validation-summary": true, children: [(0, jsx_runtime_1.jsx)(ValidationDisplay, { issues: groupedInvalidResults.warning, severity: "warning", heading: "Validation warnings" }), (0, jsx_runtime_1.jsx)(ValidationDisplay, { issues: groupedInvalidResults.error, severity: "error", heading: "Validation errors" })] }));
42
42
  }
43
- const ValidationDisplay = ({ heading, issues = constants_1.EMPTY_ARRAY, severity = "error", onClose }) => {
43
+ const ValidationDisplay = ({ heading, issues = constants_1.EMPTY_ARRAY, severity = "error", onClose, }) => {
44
44
  const [animateContainerRef] = (0, react_2.useAutoAnimate)({ duration: 100 });
45
45
  if (issues.length === 0) {
46
46
  return null;
@@ -50,7 +50,7 @@ const ValidationDisplay = ({ heading, issues = constants_1.EMPTY_ARRAY, severity
50
50
  [ValidationSummary_module_scss_1.default.info]: severity === "info",
51
51
  [ValidationSummary_module_scss_1.default.warning]: severity === "warning",
52
52
  [ValidationSummary_module_scss_1.default.error]: severity === "error",
53
- }), style: { paddingTop: !onClose ? "0.5rem" : undefined }, children: [(0, jsx_runtime_1.jsxs)(StackNative_1.Stack, { orientation: "horizontal", verticalAlignment: "center", style: { gap: "0.5rem" }, children: [(0, jsx_runtime_1.jsx)(IconNative_1.Icon, { className: ValidationSummary_module_scss_1.default.heading, name: severity, size: "md" }), (0, jsx_runtime_1.jsx)("div", { className: ValidationSummary_module_scss_1.default.heading, children: (0, jsx_runtime_1.jsx)(TextNative_1.Text, { children: heading }) }), !!onClose && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(SpaceFillerNative_1.SpaceFiller, {}), (0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { onClick: onClose, variant: "ghost", themeColor: "secondary", icon: (0, jsx_runtime_1.jsx)(IconNative_1.Icon, { name: "close", size: "sm" }), orientation: "vertical" })] }))] }), (0, jsx_runtime_1.jsx)("ul", { ref: animateContainerRef, children: issues.map((issue, i) => ((0, jsx_runtime_1.jsx)(ValidationEntry, { issue: issue }, i))) })] }));
53
+ }), style: { paddingTop: !onClose ? "0.5rem" : undefined }, "data-validation-display-severity": severity, children: [(0, jsx_runtime_1.jsxs)(StackNative_1.Stack, { orientation: "horizontal", verticalAlignment: "center", style: { gap: "0.5rem" }, children: [(0, jsx_runtime_1.jsx)(IconNative_1.Icon, { className: ValidationSummary_module_scss_1.default.heading, name: severity, size: "md" }), (0, jsx_runtime_1.jsx)("div", { className: ValidationSummary_module_scss_1.default.heading, children: (0, jsx_runtime_1.jsx)(TextNative_1.Text, { children: heading }) }), !!onClose && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(SpaceFillerNative_1.SpaceFiller, {}), (0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { onClick: onClose, variant: "ghost", themeColor: "secondary", icon: (0, jsx_runtime_1.jsx)(IconNative_1.Icon, { name: "close", size: "sm" }), orientation: "vertical" })] }))] }), (0, jsx_runtime_1.jsx)("ul", { ref: animateContainerRef, children: issues.map((issue, i) => ((0, jsx_runtime_1.jsx)(ValidationEntry, { issue: issue }, i))) })] }));
54
54
  };
55
55
  // --- ValidationEntry
56
56
  const ValidationEntry = ({ issue }) => {
@@ -52,6 +52,7 @@ const bi_1 = require("react-icons/bi");
52
52
  const DropdownMenu = __importStar(require("@radix-ui/react-dropdown-menu"));
53
53
  const all_1 = require("react-icons/all");
54
54
  const hi2_1 = require("react-icons/hi2");
55
+ const IconNative_1 = __importDefault(require("../components/Icon/IconNative"));
55
56
  const DevTools = ({ setIsOpen, node }) => {
56
57
  var _a;
57
58
  const [side, setSide] = (0, react_2.useState)("bottom");
@@ -152,12 +153,12 @@ const DevTools = ({ setIsOpen, node }) => {
152
153
  height: ref.offsetHeight,
153
154
  });
154
155
  setPosition(position);
155
- }, bounds: "window", children: (0, jsx_runtime_1.jsxs)(react_tabs_1.Root, { defaultValue: "code", className: DevTools_module_scss_1.default.tabs, style: { width: "100%", height: "100%" }, children: [(0, jsx_runtime_1.jsxs)(react_tabs_1.List, { className: DevTools_module_scss_1.default.list, children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(react_tabs_1.Trigger, { value: "code", children: (0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { variant: "ghost", size: "xs", children: "Code" }) }), (0, jsx_runtime_1.jsx)(react_tabs_1.Trigger, { value: "console", children: (0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { variant: "ghost", size: "xs", children: "Console" }) })] }), (0, jsx_runtime_1.jsxs)("div", { className: DevTools_module_scss_1.default.actions, children: [(0, jsx_runtime_1.jsxs)(DropdownMenu.Root, { children: [(0, jsx_runtime_1.jsx)(DropdownMenu.Trigger, { children: (0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { variant: "ghost", size: "xs", children: (0, jsx_runtime_1.jsx)(all_1.HiOutlineDotsVertical, { color: "currentColor" }) }) }), (0, jsx_runtime_1.jsx)(DropdownMenu.Portal, { container: root, children: (0, jsx_runtime_1.jsx)(DropdownMenu.Content, { className: DevTools_module_scss_1.default.menu, children: (0, jsx_runtime_1.jsxs)(DropdownMenu.Item, { className: DevTools_module_scss_1.default.menuItem, children: ["Dock side", (0, jsx_runtime_1.jsxs)("div", { className: DevTools_module_scss_1.default.sideButtons, children: [(0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { style: { padding: 8 }, onClick: () => {
156
+ }, bounds: "window", children: (0, jsx_runtime_1.jsxs)(react_tabs_1.Root, { defaultValue: "code", className: DevTools_module_scss_1.default.tabs, style: { width: "100%", height: "100%" }, children: [(0, jsx_runtime_1.jsxs)(react_tabs_1.List, { className: DevTools_module_scss_1.default.list, children: [(0, jsx_runtime_1.jsxs)("div", { className: DevTools_module_scss_1.default.tabItems, children: [(0, jsx_runtime_1.jsx)(react_tabs_1.Trigger, { value: "code", children: (0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { variant: "ghost", size: "sm", children: "Code" }) }), (0, jsx_runtime_1.jsx)(react_tabs_1.Trigger, { value: "console", children: (0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { variant: "ghost", size: "sm", children: "Console" }) })] }), (0, jsx_runtime_1.jsxs)("div", { className: DevTools_module_scss_1.default.actions, children: [(0, jsx_runtime_1.jsxs)(DropdownMenu.Root, { children: [(0, jsx_runtime_1.jsx)(DropdownMenu.Trigger, { children: (0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { variant: "ghost", size: "xs", children: (0, jsx_runtime_1.jsx)(all_1.HiOutlineDotsVertical, { color: "currentColor" }) }) }), (0, jsx_runtime_1.jsx)(DropdownMenu.Portal, { container: root, children: (0, jsx_runtime_1.jsx)(DropdownMenu.Content, { className: DevTools_module_scss_1.default.menu, children: (0, jsx_runtime_1.jsxs)(DropdownMenu.Item, { className: DevTools_module_scss_1.default.menuItem, children: ["Dock side", (0, jsx_runtime_1.jsxs)("div", { className: DevTools_module_scss_1.default.sideButtons, children: [(0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { style: { padding: 8 }, onClick: () => {
156
157
  setSide("left");
157
- }, variant: "ghost", children: (0, jsx_runtime_1.jsx)(bi_1.BiDockLeft, { color: "currentColor" }) }), (0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { style: { padding: 8 }, onClick: () => {
158
+ }, variant: "ghost", children: (0, jsx_runtime_1.jsx)(bi_1.BiDockLeft, { color: "currentColor", size: 16 }) }), (0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { style: { padding: 8 }, onClick: () => {
158
159
  setSide("bottom");
159
- }, variant: "ghost", children: (0, jsx_runtime_1.jsx)(bi_1.BiDockBottom, { color: "currentColor" }) }), (0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { style: { padding: 8 }, onClick: () => {
160
+ }, variant: "ghost", children: (0, jsx_runtime_1.jsx)(bi_1.BiDockBottom, { color: "currentColor", size: 16 }) }), (0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { style: { padding: 8 }, onClick: () => {
160
161
  setSide("right");
161
- }, variant: "ghost", children: (0, jsx_runtime_1.jsx)(bi_1.BiDockRight, { color: "currentColor" }) })] })] }) }) })] }), (0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { onClick: () => setIsOpen(false), size: "xs", variant: "ghost", children: "Close" })] })] }), (0, jsx_runtime_1.jsxs)(react_tabs_1.Content, { value: "code", className: DevTools_module_scss_1.default.content, children: [(0, jsx_runtime_1.jsx)(XmluiCodeHighlighter_1.XmluiCodeHighlighter, { value: value }), (0, jsx_runtime_1.jsx)("div", { className: DevTools_module_scss_1.default.copyButton, children: (0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { onClick: copyToClipboard, variant: "solid", themeColor: "secondary", style: { padding: 8 }, size: "sm", children: copied ? ((0, jsx_runtime_1.jsx)(hi2_1.HiOutlineClipboardDocumentCheck, { size: 16 })) : ((0, jsx_runtime_1.jsx)(hi2_1.HiOutlineClipboardDocument, { size: 16 })) }) })] }), (0, jsx_runtime_1.jsx)(react_tabs_1.Content, { value: "console", className: DevTools_module_scss_1.default.content, children: "Debug console" })] }) }), root);
162
+ }, variant: "ghost", children: (0, jsx_runtime_1.jsx)(bi_1.BiDockRight, { color: "currentColor", size: 16 }) })] })] }) }) })] }), (0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { onClick: () => setIsOpen(false), size: "xs", variant: "ghost", icon: (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "close" }) })] })] }), (0, jsx_runtime_1.jsxs)(react_tabs_1.Content, { value: "code", className: DevTools_module_scss_1.default.content, children: [(0, jsx_runtime_1.jsx)(XmluiCodeHighlighter_1.XmluiCodeHighlighter, { value: value }), (0, jsx_runtime_1.jsx)("div", { className: DevTools_module_scss_1.default.copyButton, children: (0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { onClick: copyToClipboard, variant: "solid", themeColor: "secondary", style: { padding: 8 }, size: "sm", children: copied ? ((0, jsx_runtime_1.jsx)(hi2_1.HiOutlineClipboardDocumentCheck, { size: 16 })) : ((0, jsx_runtime_1.jsx)(hi2_1.HiOutlineClipboardDocument, { size: 16 })) }) })] }), (0, jsx_runtime_1.jsx)(react_tabs_1.Content, { value: "console", className: DevTools_module_scss_1.default.content, children: "Debug console" })] }) }), root);
162
163
  };
163
164
  exports.DevTools = DevTools;
@@ -43,6 +43,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
43
43
  };
44
44
  Object.defineProperty(exports, "__esModule", { value: true });
45
45
  const lodash_es_1 = require("lodash-es");
46
+ const ScriptingSourceTreeExp_1 = require("../abstractions/scripting/ScriptingSourceTreeExp");
46
47
  const extractParam_1 = require("./utils/extractParam");
47
48
  const misc_1 = require("./utils/misc");
48
49
  const EngineError_1 = require("./EngineError");
@@ -207,8 +208,8 @@ class RestApiProxy {
207
208
  };
208
209
  try {
209
210
  const arrowStmt = {
210
- type: "ArrowS",
211
- expression: value,
211
+ type: ScriptingSourceTreeExp_1.T_ARROW_EXPRESSION_STATEMENT,
212
+ expr: value,
212
213
  };
213
214
  (0, process_statement_sync_1.processStatementQueue)([arrowStmt], evalContext);
214
215
  if ((_b = (_a = evalContext.mainThread) === null || _a === void 0 ? void 0 : _a.blocks) === null || _b === void 0 ? void 0 : _b.length) {
@@ -322,10 +323,13 @@ class RestApiProxy {
322
323
  const conf = (appContext === null || appContext === void 0 ? void 0 : appContext.appGlobals) || { apiUrl: "" };
323
324
  const { apiUrl, errorResponseTransform } = conf;
324
325
  this.appContext = appContext;
326
+ const xsrfHeaders = {
327
+ "X-XSRF-TOKEN": (0, misc_1.readCookie)('XSRF-TOKEN')
328
+ };
325
329
  this.config = {
326
330
  apiUrl,
327
331
  errorResponseTransform,
328
- headers: Object.assign({}, (_a = appContext === null || appContext === void 0 ? void 0 : appContext.appGlobals) === null || _a === void 0 ? void 0 : _a.headers)
332
+ headers: Object.assign(Object.assign({}, (_a = appContext === null || appContext === void 0 ? void 0 : appContext.appGlobals) === null || _a === void 0 ? void 0 : _a.headers), xsrfHeaders)
329
333
  };
330
334
  }
331
335
  generateFullApiUrl(relativePath, queryParams) {
@@ -176,7 +176,7 @@ function updateQueriesWithOptimisticValue(_a) {
176
176
  });
177
177
  }
178
178
  function callApi(_a, _b) {
179
- return __awaiter(this, arguments, void 0, function* ({ state, appContext, lookupAction, uid: containerUid }, { confirmTitle, confirmMessage, confirmButtonLabel, params = {}, onBeforeRequest, onSuccess, onError, invalidates, updates, optimisticValue, payloadType, when, getOptimisticValue, inProgressNotificationMessage, completedNotificationMessage, errorNotificationMessage, uid: actionUid, onProgress,
179
+ return __awaiter(this, arguments, void 0, function* ({ state, appContext, lookupAction, getCurrentState }, { confirmTitle, confirmMessage, confirmButtonLabel, params = {}, onBeforeRequest, onSuccess, onError, invalidates, updates, optimisticValue, payloadType, when, getOptimisticValue, inProgressNotificationMessage, completedNotificationMessage, errorNotificationMessage, uid: actionUid, onProgress,
180
180
  //operation
181
181
  headers, url, queryParams, rawBody, method, body, }, { resolveBindingExpressions } = {}) {
182
182
  const uid = typeof actionUid === "symbol" ? actionUid : Symbol(actionUid);
@@ -237,6 +237,7 @@ function callApi(_a, _b) {
237
237
  });
238
238
  const onSuccessFn = lookupAction(onSuccess, uid, {
239
239
  eventName: "success",
240
+ context: getCurrentState()
240
241
  });
241
242
  yield (onSuccessFn === null || onSuccessFn === void 0 ? void 0 : onSuccessFn(result, stateContext["$param"]));
242
243
  updateQueriesWithResult(queryKeysToUpdate, optimisticValuesByQueryKeys, clientTxId, appContext.queryClient, result);
@@ -52,6 +52,7 @@ const react_2 = require("@remix-run/react");
52
52
  const lodash_es_1 = require("lodash-es");
53
53
  const react_compose_refs_1 = require("@radix-ui/react-compose-refs");
54
54
  const memoize_one_1 = __importDefault(require("memoize-one"));
55
+ const ScriptingSourceTreeExp_1 = require("../../abstractions/scripting/ScriptingSourceTreeExp");
55
56
  const containers_1 = require("../abstractions/containers");
56
57
  const AppContext_1 = require("../AppContext");
57
58
  const buildProxy_1 = require("../rendering/buildProxy");
@@ -114,7 +115,7 @@ exports.Container = (0, react_1.memo)((0, react_1.forwardRef)(function Container
114
115
  let changes = [];
115
116
  const getComponentStateClone = () => {
116
117
  changes.length = 0;
117
- const poj = (0, lodash_es_1.cloneDeep)(Object.assign({}, stateRef.current));
118
+ const poj = (0, lodash_es_1.cloneDeep)(Object.assign(Object.assign({}, stateRef.current), ((options === null || options === void 0 ? void 0 : options.context) || {})));
118
119
  poj["$this"] = stateRef.current[componentUid];
119
120
  return (0, buildProxy_1.buildProxy)(poj, (changeInfo) => {
120
121
  var _a;
@@ -134,6 +135,7 @@ exports.Container = (0, react_1.memo)((0, react_1.forwardRef)(function Container
134
135
  return {
135
136
  uid: componentUid,
136
137
  state: stateRef.current,
138
+ getCurrentState: () => stateRef.current,
137
139
  dispatch,
138
140
  appContext: evalAppContext,
139
141
  navigate,
@@ -161,8 +163,8 @@ exports.Container = (0, react_1.memo)((0, react_1.forwardRef)(function Container
161
163
  else {
162
164
  statements = [
163
165
  {
164
- type: "ArrowS",
165
- expression: (0, lodash_es_1.cloneDeep)(source), //TODO illesg (talk it through why we need to deep clone, it it's omitted, it gets slower every time we run it)
166
+ type: ScriptingSourceTreeExp_1.T_ARROW_EXPRESSION_STATEMENT,
167
+ expr: source, //TODO illesg (talk it through why we need to deep clone, it it's omitted, it gets slower every time we run it)
166
168
  },
167
169
  ];
168
170
  }
@@ -180,7 +182,7 @@ exports.Container = (0, react_1.memo)((0, react_1.forwardRef)(function Container
180
182
  });
181
183
  }
182
184
  let mainThreadBlockingRuns = 0;
183
- yield (0, process_statement_async_1.processStatementQueueAsync)(statements, evalContext, undefined, (evalContext) => __awaiter(this, void 0, void 0, function* () {
185
+ evalContext.onStatementCompleted = (evalContext) => __awaiter(this, void 0, void 0, function* () {
184
186
  if (changes.length) {
185
187
  mainThreadBlockingRuns = 0;
186
188
  changes.forEach((change) => {
@@ -231,7 +233,8 @@ exports.Container = (0, react_1.memo)((0, react_1.forwardRef)(function Container
231
233
  }
232
234
  }
233
235
  evalContext.localContext = getComponentStateClone();
234
- }));
236
+ });
237
+ yield (0, process_statement_async_1.processStatementQueueAsync)(statements, evalContext);
235
238
  if (canSignEventLifecycle()) {
236
239
  // --- Sign the event handler has successfully completed
237
240
  dispatch({
@@ -275,8 +278,8 @@ exports.Container = (0, react_1.memo)((0, react_1.forwardRef)(function Container
275
278
  };
276
279
  try {
277
280
  const arrowStmt = {
278
- type: "ArrowS",
279
- expression: arrowExpression,
281
+ type: ScriptingSourceTreeExp_1.T_ARROW_EXPRESSION_STATEMENT,
282
+ expr: arrowExpression,
280
283
  };
281
284
  (0, process_statement_sync_1.processStatementQueue)([arrowStmt], evalContext);
282
285
  if ((_b = (_a = evalContext.mainThread) === null || _a === void 0 ? void 0 : _a.blocks) === null || _b === void 0 ? void 0 : _b.length) {
@@ -291,7 +294,10 @@ exports.Container = (0, react_1.memo)((0, react_1.forwardRef)(function Container
291
294
  }, [appContext]);
292
295
  const getOrCreateEventHandlerFn = (0, misc_1.useEvent)((src, uid, options) => {
293
296
  var _a;
294
- const stringSrc = typeof src === "string" ? src : src.statement.source;
297
+ if (Array.isArray(src)) {
298
+ throw new Error("Multiple event handlers are not supported");
299
+ }
300
+ const stringSrc = typeof src === "string" ? src : src.statement.nodeId;
295
301
  const fnCacheKey = `${options === null || options === void 0 ? void 0 : options.eventName};${stringSrc}`;
296
302
  const handler = (...eventArgs) => {
297
303
  return runCodeAsync(src, uid, options, ...(0, lodash_es_1.cloneDeep)(eventArgs));
@@ -307,13 +313,11 @@ exports.Container = (0, react_1.memo)((0, react_1.forwardRef)(function Container
307
313
  });
308
314
  const getOrCreateSyncCallbackFn = (0, react_1.useCallback)((arrowExpression, uid) => {
309
315
  var _a;
310
- const fnCacheKey = `sync-callback-${arrowExpression.source}`;
316
+ const fnCacheKey = `sync-callback-${arrowExpression.nodeId}`;
311
317
  if (!((_a = fnsRef.current[uid]) === null || _a === void 0 ? void 0 : _a[fnCacheKey])) {
312
318
  fnsRef.current[uid] = fnsRef.current[uid] || {};
313
319
  fnsRef.current[uid][fnCacheKey] = (0, memoize_one_1.default)((arrowExpression) => {
314
- // console.log('busting sync callback cache', arrowExpression);
315
320
  return (...eventArgs) => {
316
- // console.log("calling sync callback", arrowExpression);
317
321
  return runCodeSync(arrowExpression, ...eventArgs);
318
322
  };
319
323
  });
@@ -11,6 +11,7 @@ const lodash_es_1 = require("lodash-es");
11
11
  const memoize_one_1 = __importDefault(require("memoize-one"));
12
12
  const react_2 = require("@remix-run/react");
13
13
  const containers_1 = require("../abstractions/containers");
14
+ const ScriptingSourceTreeExp_1 = require("../../abstractions/scripting/ScriptingSourceTreeExp");
14
15
  const constants_1 = require("../constants");
15
16
  const collectFnVarDeps_1 = require("../rendering/collectFnVarDeps");
16
17
  const reducer_1 = require("../rendering/reducer");
@@ -19,7 +20,7 @@ const ErrorBoundary_1 = require("../rendering/ErrorBoundary");
19
20
  const visitors_1 = require("../script-runner/visitors");
20
21
  const hooks_1 = require("../utils/hooks");
21
22
  const Container_1 = require("./Container");
22
- const code_behind_collect_1 = require("../../parsers/scripting/code-behind-collect");
23
+ const code_behind_collect_1 = require("../../parsers/scripting-exp/code-behind-collect");
23
24
  const AppContext_1 = require("../AppContext");
24
25
  const ParameterParser_1 = require("../script-runner/ParameterParser");
25
26
  const eval_tree_sync_1 = require("../script-runner/eval-tree-sync");
@@ -77,7 +78,7 @@ exports.StateContainer = (0, react_1.memo)((0, react_1.forwardRef)(function Stat
77
78
  const functionDeps = (0, react_1.useMemo)(() => {
78
79
  const fnDeps = {};
79
80
  Object.entries(varDefinitions).forEach(([key, value]) => {
80
- if (isParsedValue(value) && value.tree.type === "ArrowE") {
81
+ if (isParsedValue(value) && value.tree.type === ScriptingSourceTreeExp_1.T_ARROW_EXPRESSION) {
81
82
  fnDeps[key] = (0, visitors_1.collectVariableDependencies)(value.tree, referenceTrackedApi);
82
83
  }
83
84
  });
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CancellationToken = void 0;
4
3
  exports.createEvalContext = createEvalContext;
5
4
  /**
6
5
  * A token that signals the cancellation of an operation
@@ -16,7 +15,6 @@ class CancellationToken {
16
15
  this._cancelled = true;
17
16
  }
18
17
  }
19
- exports.CancellationToken = CancellationToken;
20
18
  /**
21
19
  * Creates an evaluation context with the given parts
22
20
  * @param parts Parts of the evaluation context
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.parseParameterString = parseParameterString;
4
- const Parser_1 = require("../../parsers/scripting/Parser");
4
+ const Parser_1 = require("../../parsers/scripting-exp/Parser");
5
5
  /**
6
6
  * This function parses a parameter string and splits them into string literal and binding expression sections
7
7
  * @param source String to parse