xmlui 0.7.14 → 0.7.16

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 (393) hide show
  1. package/dist/{apiInterceptorWorker-FBzCR_-x.mjs → apiInterceptorWorker-21XItUaB.mjs} +1 -1
  2. package/dist/{grammar.tmLanguage-D3zpG8BQ.mjs → grammar.tmLanguage-Qpdanc5_.mjs} +6 -6
  3. package/dist/{index-rxu3P0l4.mjs → index-CFCUmuUo.mjs} +10368 -10074
  4. package/dist/index.css +1 -1
  5. package/dist/scripts/bin/build.js +17 -7
  6. package/dist/scripts/bin/vite-ueml-plugin.js +17 -7
  7. package/dist/scripts/bin/viteConfig.js +17 -7
  8. package/dist/scripts/package.json +209 -0
  9. package/dist/scripts/src/abstractions/scripting/ScriptingSourceTreeExp.js +51 -0
  10. package/dist/scripts/src/components/APICall/APICall.js +74 -0
  11. package/dist/scripts/src/components/APICall/APICallNative.js +31 -0
  12. package/dist/scripts/src/components/Accordion/Accordion.js +78 -0
  13. package/dist/scripts/src/components/Accordion/AccordionContext.js +20 -0
  14. package/dist/scripts/src/components/Accordion/AccordionItem.js +28 -0
  15. package/dist/scripts/src/components/Accordion/AccordionItemNative.js +79 -0
  16. package/dist/scripts/src/components/Accordion/AccordionNative.js +122 -0
  17. package/dist/scripts/src/components/Alert/Alert.js +42 -0
  18. package/dist/scripts/src/components/Alert/AlertNative.js +8 -0
  19. package/dist/scripts/src/components/Animation/Animation.js +59 -0
  20. package/dist/scripts/src/components/Animation/AnimationNative.js +75 -0
  21. package/dist/scripts/src/components/App/App.js +76 -0
  22. package/dist/scripts/src/components/App/AppLayoutContext.js +49 -0
  23. package/dist/scripts/src/components/App/AppNative.js +204 -0
  24. package/dist/scripts/src/components/App/AppStateContext.js +9 -0
  25. package/dist/scripts/src/components/App/Sheet.js +99 -0
  26. package/dist/scripts/src/components/AppHeader/AppHeader.js +59 -0
  27. package/dist/scripts/src/components/AppHeader/AppHeaderNative.js +58 -0
  28. package/dist/scripts/src/components/AppState/AppState.js +26 -0
  29. package/dist/scripts/src/components/AppState/AppStateNative.js +24 -0
  30. package/dist/scripts/src/components/AutoComplete/AutoComplete.js +83 -0
  31. package/dist/scripts/src/components/AutoComplete/AutoCompleteContext.js +16 -0
  32. package/dist/scripts/src/components/AutoComplete/AutoCompleteNative.js +225 -0
  33. package/dist/scripts/src/components/Avatar/Avatar.js +47 -0
  34. package/dist/scripts/src/components/Avatar/AvatarNative.js +40 -0
  35. package/dist/scripts/src/components/Backdrop/Backdrop.js +31 -0
  36. package/dist/scripts/src/components/Backdrop/BackdropNative.js +14 -0
  37. package/dist/scripts/src/components/Badge/Badge.js +58 -0
  38. package/dist/scripts/src/components/Badge/BadgeNative.js +22 -0
  39. package/dist/scripts/src/components/BarChart/BarChart.js +49 -0
  40. package/dist/scripts/src/components/BarChart/BarChartNative.js +176 -0
  41. package/dist/scripts/src/components/Bookmark/Bookmark.js +23 -0
  42. package/dist/scripts/src/components/Bookmark/BookmarkNative.js +24 -0
  43. package/dist/scripts/src/components/Breakout/Breakout.js +16 -0
  44. package/dist/scripts/src/components/Breakout/BreakoutNative.js +12 -0
  45. package/dist/scripts/src/components/Button/Button.js +142 -0
  46. package/dist/scripts/src/components/Button/ButtonNative.js +88 -0
  47. package/dist/scripts/src/components/ButtonGroup/ButtonGroup.js +41 -0
  48. package/dist/scripts/src/components/ButtonGroup/ButtonGroupNative.js +8 -0
  49. package/dist/scripts/src/components/Card/Card.js +57 -0
  50. package/dist/scripts/src/components/Card/CardNative.js +26 -0
  51. package/dist/scripts/src/components/Carousel/Carousel.js +68 -0
  52. package/dist/scripts/src/components/Carousel/CarouselItem.js +16 -0
  53. package/dist/scripts/src/components/Carousel/CarouselItemNative.js +13 -0
  54. package/dist/scripts/src/components/Carousel/CarouselNative.js +163 -0
  55. package/dist/scripts/src/components/ChangeListener/ChangeListener.js +24 -0
  56. package/dist/scripts/src/components/ChangeListener/ChangeListenerNative.js +26 -0
  57. package/dist/scripts/src/components/Chart/Chart.js +24 -0
  58. package/dist/scripts/src/components/Chart/ChartNative.js +165 -0
  59. package/dist/scripts/src/components/Checkbox/Checkbox.js +68 -0
  60. package/dist/scripts/src/components/Column/Column.js +34 -0
  61. package/dist/scripts/src/components/Column/ColumnNative.js +38 -0
  62. package/dist/scripts/src/components/Column/TableContext.js +12 -0
  63. package/dist/scripts/src/components/ComponentProvider.js +503 -0
  64. package/dist/scripts/src/components/ComponentRegistryContext.js +44 -0
  65. package/dist/scripts/src/components/ContentSeparator/ContentSeparator.js +38 -0
  66. package/dist/scripts/src/components/ContentSeparator/ContentSeparatorNative.js +16 -0
  67. package/dist/scripts/src/components/DatePicker/DatePicker.js +62 -0
  68. package/dist/scripts/src/components/DatePicker/DatePickerNative.js +196 -0
  69. package/dist/scripts/src/components/DropdownMenu/DropdownMenu.js +125 -0
  70. package/dist/scripts/src/components/DropdownMenu/DropdownMenuNative.js +95 -0
  71. package/dist/scripts/src/components/EmojiSelector/EmojiSelector.js +26 -0
  72. package/dist/scripts/src/components/EmojiSelector/EmojiSelectorNative.js +52 -0
  73. package/dist/scripts/src/components/FileInput/FileInput.js +64 -0
  74. package/dist/scripts/src/components/FileInput/FileInputNative.js +128 -0
  75. package/dist/scripts/src/components/FileUploadDropZone/FileUploadDropZone.js +46 -0
  76. package/dist/scripts/src/components/FileUploadDropZone/FileUploadDropZoneNative.js +112 -0
  77. package/dist/scripts/src/components/FlowLayout/FlowLayout.js +53 -0
  78. package/dist/scripts/src/components/FlowLayout/FlowLayoutNative.js +108 -0
  79. package/dist/scripts/src/components/Footer/Footer.js +35 -0
  80. package/dist/scripts/src/components/Footer/FooterNative.js +20 -0
  81. package/dist/scripts/src/components/Form/Form.js +89 -0
  82. package/dist/scripts/src/components/Form/FormContext.js +9 -0
  83. package/dist/scripts/src/components/Form/FormNative.js +317 -0
  84. package/dist/scripts/src/components/Form/formActions.js +114 -0
  85. package/dist/scripts/src/components/FormItem/FormItem.js +125 -0
  86. package/dist/scripts/src/components/FormItem/FormItemNative.js +157 -0
  87. package/dist/scripts/src/components/FormItem/HelperText.js +27 -0
  88. package/dist/scripts/src/components/FormItem/ItemWithLabel.js +40 -0
  89. package/dist/scripts/src/components/FormItem/Validations.js +351 -0
  90. package/dist/scripts/src/components/FormSection/FormSection.js +41 -0
  91. package/dist/scripts/src/components/Heading/Heading.js +258 -0
  92. package/dist/scripts/src/components/Heading/HeadingNative.js +47 -0
  93. package/dist/scripts/src/components/HoverCard/HoverCard.js +19 -0
  94. package/dist/scripts/src/components/HoverCard/HovercardNative.js +44 -0
  95. package/dist/scripts/src/components/Icon/ApiIcon.js +10 -0
  96. package/dist/scripts/src/components/Icon/Attach.js +10 -0
  97. package/dist/scripts/src/components/Icon/Binding.js +11 -0
  98. package/dist/scripts/src/components/Icon/BoardIcon.js +7 -0
  99. package/dist/scripts/src/components/Icon/BoxIcon.js +10 -0
  100. package/dist/scripts/src/components/Icon/CheckIcon.js +7 -0
  101. package/dist/scripts/src/components/Icon/ChevronLeft.js +7 -0
  102. package/dist/scripts/src/components/Icon/ChevronRight.js +7 -0
  103. package/dist/scripts/src/components/Icon/CodeFileIcon.js +10 -0
  104. package/dist/scripts/src/components/Icon/CodeSandbox.js +10 -0
  105. package/dist/scripts/src/components/Icon/CompactListIcon.js +7 -0
  106. package/dist/scripts/src/components/Icon/ContentCopyIcon.js +7 -0
  107. package/dist/scripts/src/components/Icon/DatabaseIcon.js +11 -0
  108. package/dist/scripts/src/components/Icon/DocFileIcon.js +10 -0
  109. package/dist/scripts/src/components/Icon/DocIcon.js +10 -0
  110. package/dist/scripts/src/components/Icon/DotMenuHorizontalIcon.js +7 -0
  111. package/dist/scripts/src/components/Icon/DotMenuIcon.js +7 -0
  112. package/dist/scripts/src/components/Icon/EmailIcon.js +7 -0
  113. package/dist/scripts/src/components/Icon/EmptyFolderIcon.js +10 -0
  114. package/dist/scripts/src/components/Icon/ErrorIcon.js +7 -0
  115. package/dist/scripts/src/components/Icon/ExpressionIcon.js +10 -0
  116. package/dist/scripts/src/components/Icon/FillPlusCricleIcon.js +7 -0
  117. package/dist/scripts/src/components/Icon/FilterIcon.js +10 -0
  118. package/dist/scripts/src/components/Icon/FolderIcon.js +10 -0
  119. package/dist/scripts/src/components/Icon/GlobeIcon.js +7 -0
  120. package/dist/scripts/src/components/Icon/HomeIcon.js +7 -0
  121. package/dist/scripts/src/components/Icon/HyperLinkIcon.js +7 -0
  122. package/dist/scripts/src/components/Icon/Icon.js +32 -0
  123. package/dist/scripts/src/components/Icon/IconNative.js +102 -0
  124. package/dist/scripts/src/components/Icon/ImageFileIcon.js +10 -0
  125. package/dist/scripts/src/components/Icon/LinkIcon.js +7 -0
  126. package/dist/scripts/src/components/Icon/ListIcon.js +7 -0
  127. package/dist/scripts/src/components/Icon/LooseListIcon.js +7 -0
  128. package/dist/scripts/src/components/Icon/MoonIcon.js +10 -0
  129. package/dist/scripts/src/components/Icon/MoreOptionsIcon.js +7 -0
  130. package/dist/scripts/src/components/Icon/NoSortIcon.js +8 -0
  131. package/dist/scripts/src/components/Icon/PDFIcon.js +10 -0
  132. package/dist/scripts/src/components/Icon/PenIcon.js +7 -0
  133. package/dist/scripts/src/components/Icon/PhoneIcon.js +7 -0
  134. package/dist/scripts/src/components/Icon/PhotoIcon.js +10 -0
  135. package/dist/scripts/src/components/Icon/PlusIcon.js +7 -0
  136. package/dist/scripts/src/components/Icon/SearchIcon.js +7 -0
  137. package/dist/scripts/src/components/Icon/ShareIcon.js +10 -0
  138. package/dist/scripts/src/components/Icon/SortAscendingIcon.js +8 -0
  139. package/dist/scripts/src/components/Icon/SortDescendingIcon.js +8 -0
  140. package/dist/scripts/src/components/Icon/SunIcon.js +10 -0
  141. package/dist/scripts/src/components/Icon/TrashIcon.js +7 -0
  142. package/dist/scripts/src/components/Icon/TrendingDownIcon.js +10 -0
  143. package/dist/scripts/src/components/Icon/TrendingLevelIcon.js +10 -0
  144. package/dist/scripts/src/components/Icon/TrendingUpIcon.js +10 -0
  145. package/dist/scripts/src/components/Icon/TxtIcon.js +10 -0
  146. package/dist/scripts/src/components/Icon/UnknownFileIcon.js +10 -0
  147. package/dist/scripts/src/components/Icon/UnlinkIcon.js +10 -0
  148. package/dist/scripts/src/components/Icon/UserIcon.js +7 -0
  149. package/dist/scripts/src/components/Icon/WarningIcon.js +7 -0
  150. package/dist/scripts/src/components/Icon/XlsIcon.js +10 -0
  151. package/dist/scripts/src/components/IconInfoCard/IconInfoCard.js +39 -0
  152. package/dist/scripts/src/components/IconProvider.js +264 -0
  153. package/dist/scripts/src/components/IconRegistryContext.js +317 -0
  154. package/dist/scripts/src/components/Image/Image.js +35 -0
  155. package/dist/scripts/src/components/Image/ImageNative.js +15 -0
  156. package/dist/scripts/src/components/Input/InputAdornment.js +14 -0
  157. package/dist/scripts/src/components/Items/Items.js +33 -0
  158. package/dist/scripts/src/components/Items/ItemsNative.js +29 -0
  159. package/dist/scripts/src/components/Link/Link.js +64 -0
  160. package/dist/scripts/src/components/Link/LinkNative.js +26 -0
  161. package/dist/scripts/src/components/List/List.js +81 -0
  162. package/dist/scripts/src/components/List/ListNative.js +425 -0
  163. package/dist/scripts/src/components/Logo/Logo.js +16 -0
  164. package/dist/scripts/src/components/Logo/LogoNative.js +15 -0
  165. package/dist/scripts/src/components/Map/Map.js +75 -0
  166. package/dist/scripts/src/components/Map/world_countries.json +45307 -0
  167. package/dist/scripts/src/components/Markdown/Markdown.js +45 -0
  168. package/dist/scripts/src/components/Markdown/MarkdownNative.js +107 -0
  169. package/dist/scripts/src/components/ModalDialog/ConfirmationModalContextProvider.js +116 -0
  170. package/dist/scripts/src/components/ModalDialog/Dialog.js +20 -0
  171. package/dist/scripts/src/components/ModalDialog/ModalDialog.js +64 -0
  172. package/dist/scripts/src/components/ModalDialog/ModalDialogNative.js +167 -0
  173. package/dist/scripts/src/components/ModalDialog/ModalVisibilityContext.js +60 -0
  174. package/dist/scripts/src/components/NavGroup/NavGroup.js +34 -0
  175. package/dist/scripts/src/components/NavGroup/NavGroupNative.js +91 -0
  176. package/dist/scripts/src/components/NavLink/NavLink.js +71 -0
  177. package/dist/scripts/src/components/NavLink/NavLinkNative.js +61 -0
  178. package/dist/scripts/src/components/NavPanel/NavPanel.js +31 -0
  179. package/dist/scripts/src/components/NavPanel/NavPanelNative.js +74 -0
  180. package/dist/scripts/src/components/NoResult/NoResult.js +38 -0
  181. package/dist/scripts/src/components/NoResult/NoResultNative.js +13 -0
  182. package/dist/scripts/src/components/NumberBox/NumberBox.js +61 -0
  183. package/dist/scripts/src/components/NumberBox/NumberBoxNative.js +336 -0
  184. package/dist/scripts/src/components/NumberBox/numberbox-abstractions.js +74 -0
  185. package/dist/scripts/src/components/OffCanvas/OffCanvas.js +57 -0
  186. package/dist/scripts/src/components/OffCanvas/OffCanvasNative.js +48 -0
  187. package/dist/scripts/src/components/Option/Option.js +33 -0
  188. package/dist/scripts/src/components/Option/OptionTypeProvider.js +16 -0
  189. package/dist/scripts/src/components/PageHeader/PageHeader.js +36 -0
  190. package/dist/scripts/src/components/PageMetaTitle/PageMetaTilteNative.js +9 -0
  191. package/dist/scripts/src/components/PageMetaTitle/PageMetaTitle.js +18 -0
  192. package/dist/scripts/src/components/Pages/Pages.js +33 -0
  193. package/dist/scripts/src/components/Pages/PagesNative.js +69 -0
  194. package/dist/scripts/src/components/PieChart/PieChart.js +45 -0
  195. package/dist/scripts/src/components/PieChart/PieChartNative.js +165 -0
  196. package/dist/scripts/src/components/PositionedContainer/PositionedContainer.js +24 -0
  197. package/dist/scripts/src/components/PositionedContainer/PositionedContainerNative.js +14 -0
  198. package/dist/scripts/src/components/ProgressBar/ProgressBar.js +36 -0
  199. package/dist/scripts/src/components/ProgressBar/ProgressBarNative.js +12 -0
  200. package/dist/scripts/src/components/Queue/Queue.js +71 -0
  201. package/dist/scripts/src/components/Queue/QueueNative.js +278 -0
  202. package/dist/scripts/src/components/Queue/queueActions.js +87 -0
  203. package/dist/scripts/src/components/RadioGroup/RadioGroup.js +68 -0
  204. package/dist/scripts/src/components/RadioGroup/RadioGroupNative.js +103 -0
  205. package/dist/scripts/src/components/Range/Range.js +56 -0
  206. package/dist/scripts/src/components/Range/RangeNative.js +8 -0
  207. package/dist/scripts/src/components/RealTimeAdapter/RealTimeAdapter.js +21 -0
  208. package/dist/scripts/src/components/RealTimeAdapter/RealTimeAdapterNative.js +131 -0
  209. package/dist/scripts/src/components/Redirect/Redirect.js +20 -0
  210. package/dist/scripts/src/components/Select/OptionContext.js +12 -0
  211. package/dist/scripts/src/components/Select/Select.js +98 -0
  212. package/dist/scripts/src/components/Select/SelectContext.js +9 -0
  213. package/dist/scripts/src/components/Select/SelectNative.js +213 -0
  214. package/dist/scripts/src/components/SelectionStore/SelectionStore.js +22 -0
  215. package/dist/scripts/src/components/SelectionStore/SelectionStoreNative.js +94 -0
  216. package/dist/scripts/src/components/Slider/Slider.js +54 -0
  217. package/dist/scripts/src/components/Slider/SliderNative.js +8 -0
  218. package/dist/scripts/src/components/SpaceFiller/SpaceFiller.js +19 -0
  219. package/dist/scripts/src/components/SpaceFiller/SpaceFillerNative.js +10 -0
  220. package/dist/scripts/src/components/Spinner/Spinner.js +42 -0
  221. package/dist/scripts/src/components/Spinner/SpinnerNative.js +32 -0
  222. package/dist/scripts/src/components/Splitter/Splitter.js +89 -0
  223. package/dist/scripts/src/components/Splitter/SplitterNative.js +159 -0
  224. package/dist/scripts/src/components/Splitter/utils.js +17 -0
  225. package/dist/scripts/src/components/Stack/Stack.js +110 -0
  226. package/dist/scripts/src/components/Stack/StackNative.js +39 -0
  227. package/dist/scripts/src/components/StateViewer/StateViewerNative.js +19 -0
  228. package/dist/scripts/src/components/StickyBox/StickyBox.js +30 -0
  229. package/dist/scripts/src/components/StickyBox/StickyBoxNative.js +15 -0
  230. package/dist/scripts/src/components/Switch/Switch.js +72 -0
  231. package/dist/scripts/src/components/Table/Table.js +184 -0
  232. package/dist/scripts/src/components/Table/TableNative.js +470 -0
  233. package/dist/scripts/src/components/Table/useRowSelection.js +245 -0
  234. package/dist/scripts/src/components/TableHeader/TableHeader.js +34 -0
  235. package/dist/scripts/src/components/TableOfContents/TableOfContents.js +74 -0
  236. package/dist/scripts/src/components/TableOfContents/TableOfContentsNative.js +56 -0
  237. package/dist/scripts/src/components/Tabs/TabContext.js +45 -0
  238. package/dist/scripts/src/components/Tabs/TabItem.js +20 -0
  239. package/dist/scripts/src/components/Tabs/TabItemNative.js +24 -0
  240. package/dist/scripts/src/components/Tabs/Tabs.js +55 -0
  241. package/dist/scripts/src/components/Tabs/TabsNative.js +72 -0
  242. package/dist/scripts/src/components/Text/Text.js +122 -0
  243. package/dist/scripts/src/components/Text/TextNative.js +124 -0
  244. package/dist/scripts/src/components/TextArea/TextArea.js +65 -0
  245. package/dist/scripts/src/components/TextArea/TextAreaNative.js +176 -0
  246. package/dist/scripts/src/components/TextArea/TextAreaResizable.js +73 -0
  247. package/dist/scripts/src/components/TextArea/useComposedRef.js +60 -0
  248. package/dist/scripts/src/components/TextBox/TextBox.js +85 -0
  249. package/dist/scripts/src/components/TextBox/TextBoxNative.js +109 -0
  250. package/dist/scripts/src/components/Theme/NotificationToast.js +50 -0
  251. package/dist/scripts/src/components/Theme/Theme.js +43 -0
  252. package/dist/scripts/src/components/Theme/ThemeNative.js +126 -0
  253. package/dist/scripts/src/components/ThemeChanger/ThemeChanger.js +115 -0
  254. package/dist/scripts/src/components/ThemeChanger/ToneChangerButton.js +28 -0
  255. package/dist/scripts/src/components/Toggle/Toggle.js +98 -0
  256. package/dist/scripts/src/components/Toolbar/Toolbar.js +32 -0
  257. package/dist/scripts/src/components/ToolbarButton/ToolbarButton.js +38 -0
  258. package/dist/scripts/src/components/Tree/TreeComponent.js +32 -0
  259. package/dist/scripts/src/components/Tree/TreeNative.js +69 -0
  260. package/dist/scripts/src/components/TrendLabel/TrendLabel.js +37 -0
  261. package/dist/scripts/src/components/ValidationSummary/ValidationSummary.js +59 -0
  262. package/dist/scripts/src/components/abstractions.js +151 -0
  263. package/dist/scripts/src/components/chart-color-schemes.js +43 -0
  264. package/dist/scripts/src/components/component-utils.js +17 -0
  265. package/dist/scripts/src/components/container-helpers.js +25 -0
  266. package/dist/scripts/src/components/metadata-helpers.js +245 -0
  267. package/dist/scripts/src/components/slot-helpers.js +22 -0
  268. package/dist/scripts/src/components-core/ApiBoundComponent.js +194 -0
  269. package/dist/scripts/src/components-core/AppContext.js +16 -0
  270. package/dist/scripts/src/components-core/AppRoot.js +424 -0
  271. package/dist/scripts/src/components-core/ComponentBed.js +325 -0
  272. package/dist/scripts/src/components-core/ComponentDecorator.js +90 -0
  273. package/dist/scripts/src/components-core/CompoundComponent.js +144 -0
  274. package/dist/scripts/src/components-core/DebugViewProvider.js +43 -0
  275. package/dist/scripts/src/components-core/EngineError.js +91 -0
  276. package/dist/scripts/src/components-core/ErrorBoundary.js +59 -0
  277. package/dist/scripts/src/components-core/Fragment.js +15 -0
  278. package/dist/scripts/src/components-core/InspectorContext.js +176 -0
  279. package/dist/scripts/src/components-core/InvalidComponent.js +17 -0
  280. package/dist/scripts/src/components-core/LoaderComponent.js +92 -0
  281. package/dist/scripts/src/components-core/RestApiProxy.js +354 -0
  282. package/dist/scripts/src/components-core/ScrollContext.js +11 -0
  283. package/dist/scripts/src/components-core/Slot.js +17 -0
  284. package/dist/scripts/src/components-core/StandaloneApp.js +589 -0
  285. package/dist/scripts/src/components-core/StandaloneComponentManager.js +51 -0
  286. package/dist/scripts/src/components-core/TableOfContentsContext.js +110 -0
  287. package/dist/scripts/src/components-core/UnknownComponent.js +15 -0
  288. package/dist/scripts/src/components-core/XmluiCodeHighlighter.js +110 -0
  289. package/dist/scripts/src/components-core/abstractions/ComponentRenderer.js +2 -0
  290. package/dist/scripts/src/components-core/abstractions/LoaderRenderer.js +2 -0
  291. package/dist/scripts/src/components-core/abstractions/containers.js +18 -0
  292. package/dist/scripts/src/components-core/abstractions/standalone.js +2 -0
  293. package/dist/scripts/src/components-core/abstractions/treeAbstractions.js +2 -0
  294. package/dist/scripts/src/components-core/action/APICall.js +283 -0
  295. package/dist/scripts/src/components-core/action/FileDownloadAction.js +80 -0
  296. package/dist/scripts/src/components-core/action/FileUploadAction.js +88 -0
  297. package/dist/scripts/src/components-core/action/NavigateAction.js +20 -0
  298. package/dist/scripts/src/components-core/action/TimedAction.js +21 -0
  299. package/dist/scripts/src/components-core/action/actions.js +15 -0
  300. package/dist/scripts/src/components-core/appContext/date-functions.js +19 -0
  301. package/dist/scripts/src/components-core/appContext/math-function.js +27 -0
  302. package/dist/scripts/src/components-core/appContext/misc-utils.js +12 -0
  303. package/dist/scripts/src/components-core/component-hooks.js +25 -0
  304. package/dist/scripts/src/components-core/constants.js +18 -0
  305. package/dist/scripts/src/components-core/container/Container.js +1241 -0
  306. package/dist/scripts/src/components-core/container/buildProxy.js +54 -0
  307. package/dist/scripts/src/components-core/container/collectFnVarDeps.js +49 -0
  308. package/dist/scripts/src/components-core/container/valueExtractor.js +205 -0
  309. package/dist/scripts/src/components-core/descriptorHelper.js +72 -0
  310. package/dist/scripts/src/components-core/interception/ApiInterceptor.js +198 -0
  311. package/dist/scripts/src/components-core/interception/ApiInterceptorProvider.js +94 -0
  312. package/dist/scripts/src/components-core/interception/Backend.js +129 -0
  313. package/dist/scripts/src/components-core/interception/Errors.js +129 -0
  314. package/dist/scripts/src/components-core/interception/InMemoryDb.js +41 -0
  315. package/dist/scripts/src/components-core/interception/IndexedDb.js +205 -0
  316. package/dist/scripts/src/components-core/interception/ReadonlyCollection.js +145 -0
  317. package/dist/scripts/src/components-core/interception/abstractions.js +2 -0
  318. package/dist/scripts/src/components-core/interception/apiInterceptorWorker.js +46 -0
  319. package/dist/scripts/src/components-core/interception/useApiInterceptorContext.js +9 -0
  320. package/dist/scripts/src/components-core/loader/ApiLoader.js +54 -0
  321. package/dist/scripts/src/components-core/loader/DataLoader.js +149 -0
  322. package/dist/scripts/src/components-core/loader/ExternalDataLoader.js +62 -0
  323. package/dist/scripts/src/components-core/loader/Loader.js +126 -0
  324. package/dist/scripts/src/components-core/loader/MockLoaderRenderer.js +40 -0
  325. package/dist/scripts/src/components-core/loader/PageableLoader.js +262 -0
  326. package/dist/scripts/src/components-core/markup-check.js +279 -0
  327. package/dist/scripts/src/components-core/renderers.js +45 -0
  328. package/dist/scripts/src/components-core/reportEngineError.js +62 -0
  329. package/dist/scripts/src/components-core/script-runner/BindingTreeEvaluationContext.js +35 -0
  330. package/dist/scripts/src/components-core/script-runner/ICustomOperations.js +34 -0
  331. package/dist/scripts/src/components-core/script-runner/ParameterParser.js +117 -0
  332. package/dist/scripts/src/components-core/script-runner/asyncProxy.js +149 -0
  333. package/dist/scripts/src/components-core/script-runner/bannedFunctions.js +34 -0
  334. package/dist/scripts/src/components-core/script-runner/custom-operations-registry.js +40 -0
  335. package/dist/scripts/src/components-core/script-runner/custom-ui-data.js +40 -0
  336. package/dist/scripts/src/components-core/script-runner/eval-tree-async.js +593 -0
  337. package/dist/scripts/src/components-core/script-runner/eval-tree-common.js +497 -0
  338. package/dist/scripts/src/components-core/script-runner/eval-tree-sync.js +482 -0
  339. package/dist/scripts/src/components-core/script-runner/process-statement-async.js +766 -0
  340. package/dist/scripts/src/components-core/script-runner/process-statement-common.js +193 -0
  341. package/dist/scripts/src/components-core/script-runner/process-statement-sync.js +752 -0
  342. package/dist/scripts/src/components-core/script-runner/statement-queue.js +62 -0
  343. package/dist/scripts/src/components-core/script-runner/syncProxy.js +31 -0
  344. package/dist/scripts/src/components-core/script-runner/visitors.js +361 -0
  345. package/dist/scripts/src/components-core/theming/ThemeContext.js +53 -0
  346. package/dist/scripts/src/components-core/theming/ThemeProvider.js +335 -0
  347. package/dist/scripts/src/components-core/theming/abstractions.js +11 -0
  348. package/dist/scripts/src/components-core/theming/extendThemeUtils.js +114 -0
  349. package/dist/scripts/src/components-core/theming/hvar.js +105 -0
  350. package/dist/scripts/src/components-core/theming/themeVars.js +62 -0
  351. package/dist/scripts/src/components-core/theming/themes/base-utils.js +31 -0
  352. package/dist/scripts/src/components-core/theming/themes/palette.js +55 -0
  353. package/dist/scripts/src/components-core/theming/themes/root.js +287 -0
  354. package/dist/scripts/src/components-core/theming/themes/solid.js +16 -0
  355. package/dist/scripts/src/components-core/theming/themes/theme-colors.js +561 -0
  356. package/dist/scripts/src/components-core/theming/themes/xmlui.js +58 -0
  357. package/dist/scripts/src/components-core/theming/transformThemeVars.js +300 -0
  358. package/dist/scripts/src/components-core/utils/DataLoaderQueryKeyGenerator.js +35 -0
  359. package/dist/scripts/src/components-core/utils/LruCache.js +184 -0
  360. package/dist/scripts/src/components-core/utils/actionUtils.js +32 -0
  361. package/dist/scripts/src/components-core/utils/classnames.js +58 -0
  362. package/dist/scripts/src/components-core/utils/compound-utils.js +11 -0
  363. package/dist/scripts/src/components-core/utils/css-utils.js +163 -0
  364. package/dist/scripts/src/components-core/utils/date-utils.js +78 -0
  365. package/dist/scripts/src/components-core/utils/extractParam.js +148 -0
  366. package/dist/scripts/src/components-core/utils/hooks.js +249 -0
  367. package/dist/scripts/src/components-core/utils/mergeProps.js +45 -0
  368. package/dist/scripts/src/components-core/utils/misc.js +472 -0
  369. package/dist/scripts/src/components-core/utils/request-params.js +70 -0
  370. package/dist/scripts/src/components-core/utils/statementUtils.js +221 -0
  371. package/dist/scripts/src/components-core/utils/treeUtils.js +48 -0
  372. package/dist/scripts/src/index.js +69 -0
  373. package/dist/scripts/src/parsers/common/GenericToken.js +2 -0
  374. package/dist/scripts/src/parsers/scripting-exp/TokenType.js +112 -0
  375. package/dist/scripts/src/parsers/style-parser/StyleInputStream.js +39 -0
  376. package/dist/scripts/src/parsers/style-parser/StyleLexer.js +623 -0
  377. package/dist/scripts/src/parsers/style-parser/StyleParser.js +1036 -0
  378. package/dist/scripts/src/parsers/style-parser/errors.js +37 -0
  379. package/dist/scripts/src/parsers/style-parser/source-tree.js +2 -0
  380. package/dist/scripts/src/parsers/style-parser/style-compiler.js +558 -0
  381. package/dist/scripts/src/parsers/style-parser/tokens.js +43 -0
  382. package/dist/scripts/src/parsers/xmlui-parser/ParserError.js +7 -0
  383. package/dist/scripts/src/parsers/xmlui-parser/transform.js +80 -32
  384. package/dist/scripts/src/syntax/grammar.tmLanguage.json +348 -0
  385. package/dist/scripts/src/syntax/textMate/xmlui.json +630 -0
  386. package/dist/style.css +1 -1
  387. package/dist/xmlui-metadata.mjs +2636 -2563
  388. package/dist/xmlui-metadata.umd.js +16 -16
  389. package/dist/xmlui-standalone.umd.js +186 -186
  390. package/dist/xmlui.d.ts +1868 -13
  391. package/dist/xmlui.mjs +1 -1
  392. package/package.json +5 -5
  393. package/dist/xmlui.umd.js +0 -293
@@ -0,0 +1,482 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.evalBindingExpression = evalBindingExpression;
4
+ exports.evalBinding = evalBinding;
5
+ exports.executeArrowExpressionSync = executeArrowExpressionSync;
6
+ const eval_tree_common_1 = require("./eval-tree-common");
7
+ const Parser_1 = require("../../parsers/scripting/Parser");
8
+ const process_statement_common_1 = require("./process-statement-common");
9
+ const process_statement_sync_1 = require("./process-statement-sync");
10
+ const bannedFunctions_1 = require("./bannedFunctions");
11
+ const syncProxy_1 = require("./syncProxy");
12
+ /**
13
+ * Evaluates the specified binding expression tree and retrieves the evaluated value
14
+ * @param source Binding tree expression
15
+ * @param evalContext Evaluation context
16
+ * @param thread The logical thread to use for evaluation
17
+ * This code uses the JavaScript semantics and errors when evaluating the code.
18
+ */
19
+ function evalBindingExpression(source, evalContext, thread) {
20
+ // --- Use the main thread by default
21
+ thread !== null && thread !== void 0 ? thread : (thread = evalContext.mainThread);
22
+ // --- Parse the source code
23
+ const wParser = new Parser_1.Parser(source);
24
+ const tree = wParser.parseExpr();
25
+ if (tree === null) {
26
+ // --- This should happen only when an expression is empty
27
+ return undefined;
28
+ }
29
+ // --- Check for expression termination
30
+ if (!wParser.isEof) {
31
+ throw new Error("Expression is not terminated properly");
32
+ }
33
+ // --- Ok, valid source, evaluate
34
+ return evalBinding(tree, evalContext, thread);
35
+ }
36
+ /**
37
+ * Evaluates a binding represented by the specified expression
38
+ * @param expr Expression to evaluate
39
+ * @param evalContext Evaluation context to use
40
+ * @param thread The logical thread to use for evaluation
41
+ */
42
+ function evalBinding(expr, evalContext, thread) {
43
+ const thisStack = [];
44
+ (0, process_statement_common_1.ensureMainThread)(evalContext);
45
+ thread !== null && thread !== void 0 ? thread : (thread = evalContext.mainThread);
46
+ return evalBindingExpressionTree(thisStack, expr, evalContext, thread !== null && thread !== void 0 ? thread : evalContext.mainThread);
47
+ }
48
+ /**
49
+ * Executes the specified arrow function
50
+ * @param expr Arrow function expression to run
51
+ * @param evalContext Evaluation context to use
52
+ * @param thread The logical thread to use for evaluation
53
+ * @param args Arguments of the arrow function to execute
54
+ */
55
+ function executeArrowExpressionSync(expr, evalContext, thread, ...args) {
56
+ // --- Just an extra safety check
57
+ if (expr.type !== "ArrowE") {
58
+ throw new Error("executeArrowExpression expects an 'ArrowExpression' object.");
59
+ }
60
+ // --- This is the evaluator that an arrow expression uses internally
61
+ const evaluator = evalBindingExpressionTree;
62
+ // --- Compiles the Arrow function to a JavaScript function
63
+ const nativeFunction = createArrowFunction(evaluator, expr);
64
+ // --- Run the compiled arrow function. Note, we have two prefix arguments:
65
+ // --- #1: The names of arrow function arguments
66
+ // --- #2: The evaluation context the arrow function runs in
67
+ // --- #others: The real arguments of the arrow function
68
+ return nativeFunction(expr.args, evalContext, thread !== null && thread !== void 0 ? thread : evalContext.mainThread, ...args);
69
+ }
70
+ /**
71
+ * Evaluates the specified binding expression tree and retrieves the evaluated value
72
+ * @param expr Binding tree expression
73
+ * @param thisStack Stack of "this" object to use with function calls
74
+ * @param evalContext Evaluation context
75
+ * @param thread The logical thread to use for evaluation
76
+ * This code uses the JavaScript semantics and errors when evaluating the code.
77
+ * We use `thisStack` to keep track of the partial results of the evaluation tree so that we can set
78
+ * the real `this` context when invoking a function.
79
+ */
80
+ function evalBindingExpressionTree(thisStack, expr, evalContext, thread) {
81
+ if (!evalContext.options) {
82
+ evalContext.options = { defaultToOptionalMemberAccess: true };
83
+ }
84
+ // --- Prepare evaluation
85
+ let customOp = null;
86
+ const evaluator = evalBindingExpressionTree;
87
+ // --- Reset the expression scope
88
+ expr.valueScope = expr.valueIndex = undefined;
89
+ // --- Process the expression according to its type
90
+ switch (expr.type) {
91
+ case "TempLitE":
92
+ return evalTemplateLiteral(evaluator, thisStack, expr, evalContext, thread);
93
+ case "LitE":
94
+ return (0, eval_tree_common_1.evalLiteral)(thisStack, expr);
95
+ case "IdE":
96
+ return (0, eval_tree_common_1.evalIdentifier)(thisStack, expr, evalContext, thread);
97
+ case "MembE":
98
+ return evalMemberAccess(evaluator, thisStack, expr, evalContext, thread);
99
+ case "CMembE":
100
+ return evalCalculatedMemberAccess(evaluator, thisStack, expr, evalContext, thread);
101
+ case "SeqE":
102
+ return evalSequence(evaluator, thisStack, expr, evalContext, thread);
103
+ case "ALitE":
104
+ return evalArrayLiteral(evaluator, thisStack, expr, evalContext, thread);
105
+ case "OLitE":
106
+ return evalObjectLiteral(evaluator, thisStack, expr, evalContext, thread);
107
+ case "UnaryE":
108
+ return evalUnary(evaluator, thisStack, customOp, expr, evalContext, thread);
109
+ case "BinaryE":
110
+ return evalBinary(evaluator, thisStack, customOp, expr, evalContext, thread);
111
+ case "CondE":
112
+ return evalConditional(evaluator, thisStack, expr, evalContext, thread);
113
+ case "AsgnE":
114
+ return evalAssignment(evaluator, thisStack, expr, evalContext, thread);
115
+ case "PrefE":
116
+ case "PostfE":
117
+ return evalPreOrPost(evaluator, thisStack, expr, evalContext, thread);
118
+ case "InvokeE":
119
+ // --- Special sync handling
120
+ const funcResult = evalFunctionInvocation(evaluator, thisStack, expr, evalContext, thread);
121
+ if ((0, eval_tree_common_1.isPromise)(funcResult)) {
122
+ throw new Error("Promises (async function calls) are not allowed in binding expressions.");
123
+ }
124
+ return funcResult;
125
+ case "ArrowE":
126
+ // --- Special sync handling
127
+ return (0, eval_tree_common_1.evalArrow)(thisStack, expr, thread);
128
+ case "SpreadE":
129
+ throw new Error("Cannot use spread expression (...) with the current intermediate value.");
130
+ default:
131
+ throw new Error(`Unknown expression tree node: ${expr.type}`);
132
+ }
133
+ }
134
+ function evalTemplateLiteral(evaluator, thisStack, expr, evalContext, thread) {
135
+ const segmentValues = expr.segments.map((s) => {
136
+ const evaledValue = evaluator(thisStack, s, evalContext, thread);
137
+ thisStack.pop();
138
+ return evaledValue;
139
+ });
140
+ return (0, eval_tree_common_1.evalTemplateLiteralCore)(segmentValues);
141
+ }
142
+ function evalMemberAccess(evaluator, thisStack, expr, evalContext, thread) {
143
+ const parentObj = evaluator(thisStack, expr.object, evalContext, thread);
144
+ return (0, eval_tree_common_1.evalMemberAccessCore)(parentObj, thisStack, expr, evalContext);
145
+ }
146
+ function evalCalculatedMemberAccess(evaluator, thisStack, expr, evalContext, thread) {
147
+ const parentObj = evaluator(thisStack, expr.object, evalContext, thread);
148
+ // --- At this point we definitely keep the parent object on `thisStack`, as it will be the context object
149
+ // --- of a FunctionInvocationExpression, if that follows the MemberAccess. Other operations would call
150
+ // --- `thisStack.pop()` to remove the result from the previous `evalBindingExpressionTree` call.
151
+ const memberObj = evaluator(thisStack, expr.member, evalContext, thread);
152
+ thisStack.pop();
153
+ return (0, eval_tree_common_1.evalCalculatedMemberAccessCore)(parentObj, memberObj, thisStack, expr, evalContext);
154
+ }
155
+ function evalSequence(evaluator, thisStack, expr, evalContext, thread) {
156
+ if (!expr.expressions || expr.expressions.length === 0) {
157
+ throw new Error(`Missing expression sequence`);
158
+ }
159
+ const result = expr.expressions.map((e) => {
160
+ const exprValue = evaluator(thisStack, e, evalContext, thread);
161
+ thisStack.pop();
162
+ return exprValue;
163
+ });
164
+ const lastObj = result[result.length - 1];
165
+ thisStack.push(lastObj);
166
+ return lastObj;
167
+ }
168
+ function evalArrayLiteral(evaluator, thisStack, expr, evalContext, thread) {
169
+ const arrayValue = [];
170
+ for (const item of expr.items) {
171
+ if (item.type === "SpreadE") {
172
+ const spreadArray = evaluator(thisStack, item.operand, evalContext, thread);
173
+ thisStack.pop();
174
+ if (!Array.isArray(spreadArray)) {
175
+ throw new Error("Spread operator within an array literal expects an array operand.");
176
+ }
177
+ arrayValue.push(...spreadArray);
178
+ }
179
+ else {
180
+ arrayValue.push(evaluator(thisStack, item, evalContext, thread));
181
+ thisStack.pop();
182
+ thisStack.push(arrayValue);
183
+ }
184
+ }
185
+ return arrayValue;
186
+ }
187
+ function evalObjectLiteral(evaluator, thisStack, expr, evalContext, thread) {
188
+ const objectHash = {};
189
+ for (const prop of expr.props) {
190
+ if (!Array.isArray(prop)) {
191
+ // --- We're using a spread expression
192
+ const spreadItems = evaluator(thisStack, prop.operand, evalContext, thread);
193
+ thisStack.pop();
194
+ if (Array.isArray(spreadItems)) {
195
+ // --- Spread of an array
196
+ for (let i = 0; i < spreadItems.length; i++) {
197
+ objectHash[i] = spreadItems[i];
198
+ }
199
+ }
200
+ else if (typeof spreadItems === "object") {
201
+ // --- Spread of a hash object
202
+ for (const [key, value] of Object.entries(spreadItems)) {
203
+ objectHash[key] = value;
204
+ }
205
+ }
206
+ continue;
207
+ }
208
+ // --- We're using key/[value] pairs
209
+ let key;
210
+ switch (prop[0].type) {
211
+ case "LitE":
212
+ key = prop[0].value;
213
+ break;
214
+ case "IdE":
215
+ key = prop[0].name;
216
+ break;
217
+ default:
218
+ key = evaluator(thisStack, prop[0], evalContext, thread);
219
+ thisStack.pop();
220
+ break;
221
+ }
222
+ objectHash[key] = evaluator(thisStack, prop[1], evalContext, thread);
223
+ thisStack.pop();
224
+ }
225
+ thisStack.push(objectHash);
226
+ return objectHash;
227
+ }
228
+ function evalUnary(evaluator, thisStack, customOp, expr, evalContext, thread) {
229
+ const operand = evaluator(thisStack, expr.operand, evalContext, thread);
230
+ thisStack.pop();
231
+ return (0, eval_tree_common_1.evalUnaryCore)(expr, operand, thisStack, customOp);
232
+ }
233
+ function evalBinary(evaluator, thisStack, customOp, expr, evalContext, thread) {
234
+ const l = evaluator(thisStack, expr.left, evalContext, thread);
235
+ thisStack.pop();
236
+ if (expr.operator === "&&" && !l) {
237
+ thisStack.push(l);
238
+ return l;
239
+ }
240
+ if (expr.operator === "||" && l) {
241
+ thisStack.push(l);
242
+ return l;
243
+ }
244
+ const r = evaluator(thisStack, expr.right, evalContext, thread);
245
+ thisStack.pop();
246
+ return (0, eval_tree_common_1.evalBinaryCore)(l, r, thisStack, customOp, expr.operator);
247
+ }
248
+ function evalConditional(evaluator, thisStack, expr, evalContext, thread) {
249
+ const condition = evaluator(thisStack, expr.condition, evalContext, thread);
250
+ thisStack.pop();
251
+ return evaluator(thisStack, condition ? expr.consequent : expr.alternate, evalContext, thread);
252
+ }
253
+ function evalAssignment(evaluator, thisStack, expr, evalContext, thread) {
254
+ const leftValue = expr.leftValue;
255
+ evaluator(thisStack, leftValue, evalContext, thread);
256
+ thisStack.pop();
257
+ const newValue = evaluator(thisStack, expr.operand, evalContext, thread);
258
+ thisStack.pop();
259
+ return (0, eval_tree_common_1.evalAssignmentCore)(leftValue, newValue, thisStack, expr, thread);
260
+ }
261
+ function evalPreOrPost(evaluator, thisStack, expr, evalContext, thread) {
262
+ const operand = expr.operand;
263
+ evaluator(thisStack, operand, evalContext, thread);
264
+ thisStack.pop();
265
+ return (0, eval_tree_common_1.evalPreOrPostCore)(operand, thisStack, expr, evalContext, thread);
266
+ }
267
+ function evalFunctionInvocation(evaluator, thisStack, expr, evalContext, thread) {
268
+ var _a, _b, _c, _d;
269
+ let functionObj;
270
+ let implicitContextObject = null;
271
+ // --- Check for contexted object
272
+ if (expr.object.type === "MembE" && expr.object.object.type === "IdE") {
273
+ const hostObject = evaluator(thisStack, expr.object.object, evalContext, thread);
274
+ functionObj = (0, eval_tree_common_1.evalMemberAccessCore)(hostObject, thisStack, expr.object, evalContext);
275
+ if (hostObject === null || hostObject === void 0 ? void 0 : hostObject._SUPPORT_IMPLICIT_CONTEXT) {
276
+ implicitContextObject = hostObject;
277
+ }
278
+ }
279
+ else {
280
+ // --- Get the object on which to invoke the function
281
+ functionObj = evaluator(thisStack, expr.object, evalContext, thread);
282
+ }
283
+ thisStack.pop();
284
+ // --- Keep function arguments here, we pass it to the function later
285
+ const functionArgs = [];
286
+ // --- The functionObj may be an ArrowExpression. In this care we need to create the invokable arrow function
287
+ if (functionObj === null || functionObj === void 0 ? void 0 : functionObj._ARROW_EXPR_) {
288
+ functionArgs.push(functionObj.args, evalContext, thread, ...expr.arguments.map((a) => (Object.assign(Object.assign({}, a), { _EXPRESSION_: true }))));
289
+ functionObj = createArrowFunction(evaluator, functionObj);
290
+ }
291
+ else if (expr.object.type === "ArrowE") {
292
+ // --- We delay evaluating expression values. We pass the argument names as the first parameter, and then
293
+ // --- all parameter expressions
294
+ functionArgs.push(expr.object.args, evalContext, thread, ...expr.arguments.map((a) => (Object.assign(Object.assign({}, a), { _EXPRESSION_: true }))));
295
+ }
296
+ else {
297
+ // --- We evaluate the argument values to pass to a JavaScript function
298
+ for (let i = 0; i < expr.arguments.length; i++) {
299
+ const arg = expr.arguments[i];
300
+ if (arg.type === "SpreadE") {
301
+ const funcArg = evaluator([], arg.operand, evalContext, thread);
302
+ if (!Array.isArray(funcArg)) {
303
+ throw new Error("Spread operator within a function invocation expects an array operand.");
304
+ }
305
+ functionArgs.push(...funcArg);
306
+ }
307
+ else {
308
+ if (arg.type === "ArrowE") {
309
+ const funcArg = createArrowFunction(evaluator, arg);
310
+ const wrappedFunc = (...args) => funcArg(arg.args, evalContext, thread, ...args);
311
+ functionArgs.push(wrappedFunc);
312
+ }
313
+ else {
314
+ const funcArg = evaluator([], arg, evalContext, thread);
315
+ if (funcArg === null || funcArg === void 0 ? void 0 : funcArg._ARROW_EXPR_) {
316
+ const wrappedFuncArg = createArrowFunction(evaluator, funcArg);
317
+ const wrappedFunc = (...args) => wrappedFuncArg(funcArg.args, evalContext, thread, ...args);
318
+ functionArgs.push(wrappedFunc);
319
+ }
320
+ else {
321
+ functionArgs.push(funcArg);
322
+ }
323
+ }
324
+ }
325
+ }
326
+ // --- We can pass implicit arguments to JavaScript function
327
+ if (implicitContextObject) {
328
+ // --- Let's obtain the implicit context
329
+ if (evalContext.implicitContextGetter) {
330
+ const implicitContext = evalContext.implicitContextGetter(implicitContextObject);
331
+ functionArgs.unshift(implicitContext);
332
+ }
333
+ else {
334
+ throw new Error("Cannot use implicitContextGetter, it is undefined");
335
+ }
336
+ }
337
+ }
338
+ // --- Check if the function is banned from running
339
+ const bannedInfo = (0, bannedFunctions_1.isBannedFunction)(functionObj);
340
+ if (bannedInfo.banned) {
341
+ throw new Error(`Function ${(_b = (_a = bannedInfo.func) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : "unknown"} is not allowed to call. ${(_c = bannedInfo === null || bannedInfo === void 0 ? void 0 : bannedInfo.help) !== null && _c !== void 0 ? _c : ""}`);
342
+ }
343
+ // --- We use context for "this"
344
+ const currentContext = thisStack.length > 0 ? thisStack.pop() : evalContext.localContext;
345
+ // --- We need to use proxies for JavaScript functions (such as Array.prototype.sort) using
346
+ // --- in-place changes on DataSource values
347
+ functionObj = (0, syncProxy_1.getSyncProxy)(functionObj, functionArgs, currentContext);
348
+ // --- Now, invoke the function
349
+ const value = ((_d = evalContext.options) === null || _d === void 0 ? void 0 : _d.defaultToOptionalMemberAccess)
350
+ ? functionObj === null || functionObj === void 0 ? void 0 : functionObj.call(currentContext, ...functionArgs)
351
+ : functionObj.call(currentContext, ...functionArgs);
352
+ thisStack.push(value);
353
+ return value;
354
+ }
355
+ function createArrowFunction(evaluator, expr) {
356
+ // --- Use this function, it evaluates the arrow function
357
+ return (...args) => {
358
+ var _a, _b;
359
+ // --- Prepare the variables to pass
360
+ const runTimeEvalContext = args[1];
361
+ const runtimeThread = args[2];
362
+ // --- Create the thread that runs the arrow function
363
+ const workingThread = {
364
+ parent: runtimeThread,
365
+ childThreads: [],
366
+ blocks: [{ vars: {} }],
367
+ loops: [],
368
+ breakLabelValue: -1,
369
+ closures: expr.closureContext,
370
+ };
371
+ runtimeThread.childThreads.push(workingThread);
372
+ // --- Create a block for a named arrow function
373
+ if (expr.name) {
374
+ const functionBlock = { vars: {} };
375
+ (_a = workingThread.blocks) !== null && _a !== void 0 ? _a : (workingThread.blocks = []);
376
+ workingThread.blocks.push(functionBlock);
377
+ functionBlock.vars[expr.name] = expr;
378
+ functionBlock.constVars = new Set([expr.name]);
379
+ }
380
+ // --- Assign argument values to names
381
+ const arrowBlock = { vars: {} };
382
+ (_b = workingThread.blocks) !== null && _b !== void 0 ? _b : (workingThread.blocks = []);
383
+ workingThread.blocks.push(arrowBlock);
384
+ const argSpecs = args[0];
385
+ let restFound = false;
386
+ for (let i = 0; i < argSpecs.length; i++) {
387
+ // --- Turn argument specification into processable variable declarations
388
+ const argSpec = argSpecs[i];
389
+ let decl;
390
+ switch (argSpec.type) {
391
+ case "IdE": {
392
+ decl = {
393
+ type: "VarD",
394
+ id: argSpec.name,
395
+ };
396
+ break;
397
+ }
398
+ case "Destr": {
399
+ decl = {
400
+ type: "VarD",
401
+ id: argSpec.id,
402
+ arrayDestruct: argSpec.arrayDestruct,
403
+ objectDestruct: argSpec.objectDestruct,
404
+ };
405
+ break;
406
+ }
407
+ case "SpreadE": {
408
+ restFound = true;
409
+ decl = {
410
+ type: "VarD",
411
+ id: argSpec.operand.name,
412
+ };
413
+ break;
414
+ }
415
+ default:
416
+ console.log(argSpec);
417
+ throw new Error("Unexpected arrow argument specification");
418
+ }
419
+ if (decl) {
420
+ if (restFound) {
421
+ // --- Get the rest of the arguments
422
+ const restArgs = args.slice(i + 3);
423
+ let argVals = [];
424
+ for (const arg of restArgs) {
425
+ if (arg === null || arg === void 0 ? void 0 : arg._EXPRESSION_) {
426
+ argVals.push(evaluator([], arg, runTimeEvalContext, runtimeThread));
427
+ }
428
+ else {
429
+ argVals.push(arg);
430
+ }
431
+ }
432
+ (0, process_statement_sync_1.processDeclarations)(arrowBlock, runTimeEvalContext, runtimeThread, [decl], false, true, argVals);
433
+ }
434
+ else {
435
+ // --- Get the actual value to work with
436
+ let argVal = args[i + 3];
437
+ if (argVal === null || argVal === void 0 ? void 0 : argVal._EXPRESSION_) {
438
+ argVal = evaluator([], argVal, runTimeEvalContext, runtimeThread);
439
+ }
440
+ (0, process_statement_sync_1.processDeclarations)(arrowBlock, runTimeEvalContext, runtimeThread, [decl], false, true, argVal);
441
+ }
442
+ }
443
+ }
444
+ // --- Evaluate the arrow expression body
445
+ let returnValue;
446
+ let statements;
447
+ switch (expr.statement.type) {
448
+ case "EmptyS":
449
+ statements = [];
450
+ break;
451
+ case "ExprS":
452
+ // --- Create a new thread for the call
453
+ statements = [
454
+ {
455
+ type: "RetS",
456
+ expression: expr.statement.expression,
457
+ },
458
+ ];
459
+ break;
460
+ case "BlockS":
461
+ // --- Create a new thread for the call
462
+ statements = expr.statement.statements;
463
+ break;
464
+ default:
465
+ throw new Error(`Arrow expression with a body of '${expr.statement.type}' is not supported yet.`);
466
+ }
467
+ // --- Process the statement with a new processor
468
+ (0, process_statement_sync_1.processStatementQueue)(statements, runTimeEvalContext, workingThread);
469
+ // --- Return value is in a return value slot
470
+ returnValue = workingThread.returnValue;
471
+ // --- Remove the current working thread
472
+ const workingIndex = runtimeThread.childThreads.indexOf(workingThread);
473
+ if (workingIndex < 0) {
474
+ throw new Error("Cannot find thread to remove.");
475
+ }
476
+ runtimeThread.childThreads.splice(workingIndex, 1);
477
+ // --- Remove the function level block
478
+ workingThread.blocks.pop();
479
+ // --- Return the function value
480
+ return returnValue;
481
+ };
482
+ }