xmlui 0.4.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 (308) hide show
  1. package/dist/Pdf-DeGhSMXe.mjs +19537 -0
  2. package/dist/Pdf.css +1 -0
  3. package/dist/apiInterceptorWorker-CwuUhYyc.mjs +9229 -0
  4. package/dist/array-USo-Szhp.mjs +12 -0
  5. package/dist/index-C24dkfpd.mjs +1434 -0
  6. package/dist/index-ao27SnVp.mjs +145185 -0
  7. package/dist/index.css +1 -0
  8. package/dist/nivo-bar.es-CWh0ZlxB.mjs +1666 -0
  9. package/dist/nivo-geo.es-BTqNt5Db.mjs +1579 -0
  10. package/dist/nivo-legends.es-BuIxHGSU.mjs +6916 -0
  11. package/dist/nivo-pie.es-BvCBFA0L.mjs +700 -0
  12. package/dist/react-apexcharts.min-DqWuDOyO.mjs +8881 -0
  13. package/dist/scripts/bin/bootstrap.js +11 -0
  14. package/dist/scripts/bin/build.js +256 -0
  15. package/dist/scripts/bin/index.js +88 -0
  16. package/dist/scripts/bin/preview.js +27 -0
  17. package/dist/scripts/bin/start.js +41 -0
  18. package/dist/scripts/bin/vite-ueml-plugin.js +113 -0
  19. package/dist/scripts/bin/viteConfig.js +112 -0
  20. package/dist/scripts/src/abstractions/ActionDefs.js +2 -0
  21. package/dist/scripts/src/abstractions/AppContextDefs.js +2 -0
  22. package/dist/scripts/src/abstractions/BlockScope.js +4 -0
  23. package/dist/scripts/src/abstractions/ComponentDefs.js +2 -0
  24. package/dist/scripts/src/abstractions/ComponentDescriptorDefs.js +2 -0
  25. package/dist/scripts/src/abstractions/ContainerDefs.js +2 -0
  26. package/dist/scripts/src/abstractions/FunctionDefs.js +2 -0
  27. package/dist/scripts/src/abstractions/RendererDefs.js +2 -0
  28. package/dist/scripts/src/abstractions/scripting/ScriptParserError.js +2 -0
  29. package/dist/scripts/src/abstractions/scripting/ScriptingSourceTree.js +2 -0
  30. package/dist/scripts/src/abstractions/scripting/Token.js +110 -0
  31. package/dist/scripts/src/components/App/App.js +253 -0
  32. package/dist/scripts/src/components/App/AppLayoutContext.js +9 -0
  33. package/dist/scripts/src/components/App/AppStateContext.js +9 -0
  34. package/dist/scripts/src/components/App/Sheet.js +89 -0
  35. package/dist/scripts/src/components/AppHeader/AppHeader.js +121 -0
  36. package/dist/scripts/src/components/AppState/AppState.js +29 -0
  37. package/dist/scripts/src/components/Avatar/Avatar.js +81 -0
  38. package/dist/scripts/src/components/Badge/Badge.js +56 -0
  39. package/dist/scripts/src/components/BarChart/BarChart.js +199 -0
  40. package/dist/scripts/src/components/Bookmark/Bookmark.js +11 -0
  41. package/dist/scripts/src/components/Button/Button.js +196 -0
  42. package/dist/scripts/src/components/Card/Card.js +65 -0
  43. package/dist/scripts/src/components/ChangeListener/ChangeListener.js +43 -0
  44. package/dist/scripts/src/components/Chart/Chart.js +158 -0
  45. package/dist/scripts/src/components/Checkbox/Checkbox.js +43 -0
  46. package/dist/scripts/src/components/Combobox/Combobox.js +145 -0
  47. package/dist/scripts/src/components/ComponentProvider.js +357 -0
  48. package/dist/scripts/src/components/ContentSeparator/ContentSeparator.js +40 -0
  49. package/dist/scripts/src/components/DatePicker/DatePicker.js +196 -0
  50. package/dist/scripts/src/components/DropdownMenu/DropdownMenu.js +175 -0
  51. package/dist/scripts/src/components/EmojiSelector/EmojiSelector.js +56 -0
  52. package/dist/scripts/src/components/FileInput/FileInput.js +127 -0
  53. package/dist/scripts/src/components/FileUploadDropZone/FileUploadDropZone.js +106 -0
  54. package/dist/scripts/src/components/FlowLayout/FlowLayout.js +139 -0
  55. package/dist/scripts/src/components/Footer/Footer.js +42 -0
  56. package/dist/scripts/src/components/Form/Form.js +320 -0
  57. package/dist/scripts/src/components/Form/FormContext.js +9 -0
  58. package/dist/scripts/src/components/Form/formActions.js +86 -0
  59. package/dist/scripts/src/components/FormItem/FormItem.js +204 -0
  60. package/dist/scripts/src/components/FormItem/HelperText.js +27 -0
  61. package/dist/scripts/src/components/FormItem/ItemWithLabel.js +39 -0
  62. package/dist/scripts/src/components/FormItem/Validations.js +346 -0
  63. package/dist/scripts/src/components/FormSection/FormSection.js +45 -0
  64. package/dist/scripts/src/components/Heading/Heading.js +206 -0
  65. package/dist/scripts/src/components/HoverCard/HoverCard.js +45 -0
  66. package/dist/scripts/src/components/Icon/ApiIcon.js +10 -0
  67. package/dist/scripts/src/components/Icon/Attach.js +10 -0
  68. package/dist/scripts/src/components/Icon/Binding.js +11 -0
  69. package/dist/scripts/src/components/Icon/BoardIcon.js +7 -0
  70. package/dist/scripts/src/components/Icon/BoxIcon.js +10 -0
  71. package/dist/scripts/src/components/Icon/CheckIcon.js +7 -0
  72. package/dist/scripts/src/components/Icon/ChevronDownIcon.js +7 -0
  73. package/dist/scripts/src/components/Icon/ChevronLeft.js +7 -0
  74. package/dist/scripts/src/components/Icon/ChevronRight.js +7 -0
  75. package/dist/scripts/src/components/Icon/ChevronUpIcon.js +7 -0
  76. package/dist/scripts/src/components/Icon/CodeFileIcon.js +10 -0
  77. package/dist/scripts/src/components/Icon/CodeSandbox.js +10 -0
  78. package/dist/scripts/src/components/Icon/CompactListIcon.js +7 -0
  79. package/dist/scripts/src/components/Icon/ContentCopyIcon.js +7 -0
  80. package/dist/scripts/src/components/Icon/DatabaseIcon.js +11 -0
  81. package/dist/scripts/src/components/Icon/DocFileIcon.js +10 -0
  82. package/dist/scripts/src/components/Icon/DocIcon.js +10 -0
  83. package/dist/scripts/src/components/Icon/DotMenuHorizontalIcon.js +7 -0
  84. package/dist/scripts/src/components/Icon/DotMenuIcon.js +7 -0
  85. package/dist/scripts/src/components/Icon/EmailIcon.js +7 -0
  86. package/dist/scripts/src/components/Icon/EmptyFolderIcon.js +10 -0
  87. package/dist/scripts/src/components/Icon/ErrorIcon.js +7 -0
  88. package/dist/scripts/src/components/Icon/ExpressionIcon.js +10 -0
  89. package/dist/scripts/src/components/Icon/FillPlusCricleIcon.js +7 -0
  90. package/dist/scripts/src/components/Icon/FilterIcon.js +10 -0
  91. package/dist/scripts/src/components/Icon/FolderIcon.js +10 -0
  92. package/dist/scripts/src/components/Icon/GlobeIcon.js +7 -0
  93. package/dist/scripts/src/components/Icon/HomeIcon.js +7 -0
  94. package/dist/scripts/src/components/Icon/HyperLinkIcon.js +7 -0
  95. package/dist/scripts/src/components/Icon/Icon.js +101 -0
  96. package/dist/scripts/src/components/Icon/ImageFileIcon.js +10 -0
  97. package/dist/scripts/src/components/Icon/LinkIcon.js +7 -0
  98. package/dist/scripts/src/components/Icon/ListIcon.js +7 -0
  99. package/dist/scripts/src/components/Icon/LooseListIcon.js +7 -0
  100. package/dist/scripts/src/components/Icon/MoonIcon.js +10 -0
  101. package/dist/scripts/src/components/Icon/MoreOptionsIcon.js +7 -0
  102. package/dist/scripts/src/components/Icon/PDFIcon.js +10 -0
  103. package/dist/scripts/src/components/Icon/PenIcon.js +7 -0
  104. package/dist/scripts/src/components/Icon/PhoneIcon.js +7 -0
  105. package/dist/scripts/src/components/Icon/PhotoIcon.js +10 -0
  106. package/dist/scripts/src/components/Icon/PlusIcon.js +7 -0
  107. package/dist/scripts/src/components/Icon/SearchIcon.js +7 -0
  108. package/dist/scripts/src/components/Icon/ShareIcon.js +10 -0
  109. package/dist/scripts/src/components/Icon/SunIcon.js +10 -0
  110. package/dist/scripts/src/components/Icon/TrashIcon.js +7 -0
  111. package/dist/scripts/src/components/Icon/TxtIcon.js +10 -0
  112. package/dist/scripts/src/components/Icon/UnknownFileIcon.js +10 -0
  113. package/dist/scripts/src/components/Icon/UnlinkIcon.js +10 -0
  114. package/dist/scripts/src/components/Icon/UserIcon.js +7 -0
  115. package/dist/scripts/src/components/Icon/WarningIcon.js +7 -0
  116. package/dist/scripts/src/components/Icon/XlsIcon.js +10 -0
  117. package/dist/scripts/src/components/IconProvider.js +249 -0
  118. package/dist/scripts/src/components/IconRegistryContext.js +307 -0
  119. package/dist/scripts/src/components/Image/Image.js +34 -0
  120. package/dist/scripts/src/components/Input/InputAdornment.js +14 -0
  121. package/dist/scripts/src/components/Input/input-abstractions.js +44 -0
  122. package/dist/scripts/src/components/Items/Items.js +48 -0
  123. package/dist/scripts/src/components/Link/Link.js +72 -0
  124. package/dist/scripts/src/components/List/List.js +442 -0
  125. package/dist/scripts/src/components/Logo/Logo.js +25 -0
  126. package/dist/scripts/src/components/Map/Map.js +60 -0
  127. package/dist/scripts/src/components/Map/world_countries.json +45307 -0
  128. package/dist/scripts/src/components/Markdown/Markdown.js +120 -0
  129. package/dist/scripts/src/components/ModalDialog/ConfirmationModalContextProvider.js +106 -0
  130. package/dist/scripts/src/components/ModalDialog/Dialog.js +20 -0
  131. package/dist/scripts/src/components/ModalDialog/ModalDialog.js +145 -0
  132. package/dist/scripts/src/components/MultiCombobox/MultiCombobox.js +249 -0
  133. package/dist/scripts/src/components/MultiSelect/MultiSelect.js +192 -0
  134. package/dist/scripts/src/components/NavGroup/NavGroup.js +113 -0
  135. package/dist/scripts/src/components/NavLink/NavLink.js +115 -0
  136. package/dist/scripts/src/components/NavPanel/NavPanel.js +101 -0
  137. package/dist/scripts/src/components/NoResult/NoResult.js +39 -0
  138. package/dist/scripts/src/components/NumberBox/NumberBox.js +373 -0
  139. package/dist/scripts/src/components/Option/Option.js +41 -0
  140. package/dist/scripts/src/components/PageMetaTitle/PageMetaTitle.js +22 -0
  141. package/dist/scripts/src/components/Pages/Pages.js +74 -0
  142. package/dist/scripts/src/components/Pdf/LazyPdf.js +44 -0
  143. package/dist/scripts/src/components/Pdf/Pdf.js +19 -0
  144. package/dist/scripts/src/components/PieChart/PieChart.js +184 -0
  145. package/dist/scripts/src/components/PositionedContainer/PositionedContainer.js +29 -0
  146. package/dist/scripts/src/components/ProgressBar/ProgressBar.js +38 -0
  147. package/dist/scripts/src/components/Queue/Queue.js +286 -0
  148. package/dist/scripts/src/components/Queue/queueActions.js +87 -0
  149. package/dist/scripts/src/components/RadioGroup/RadioGroup.js +144 -0
  150. package/dist/scripts/src/components/RealTimeAdapter/RealTimeAdapter.js +147 -0
  151. package/dist/scripts/src/components/Redirect/Redirect.js +10 -0
  152. package/dist/scripts/src/components/Select/Select.js +139 -0
  153. package/dist/scripts/src/components/Select/SelectContext.js +45 -0
  154. package/dist/scripts/src/components/SelectionStore/SelectionStore.js +88 -0
  155. package/dist/scripts/src/components/SpaceFiller/SpaceFiller.js +22 -0
  156. package/dist/scripts/src/components/Spinner/Spinner.js +59 -0
  157. package/dist/scripts/src/components/Splitter/Splitter.js +205 -0
  158. package/dist/scripts/src/components/Splitter/utils.js +17 -0
  159. package/dist/scripts/src/components/Stack/Stack.js +117 -0
  160. package/dist/scripts/src/components/StickyBox/StickyBox.js +33 -0
  161. package/dist/scripts/src/components/Switch/Switch.js +50 -0
  162. package/dist/scripts/src/components/Table/Table.js +499 -0
  163. package/dist/scripts/src/components/Table/useRowSelection.js +169 -0
  164. package/dist/scripts/src/components/TableColumnDef/TableColumnDef.js +44 -0
  165. package/dist/scripts/src/components/TableColumnDef/TableContext.js +12 -0
  166. package/dist/scripts/src/components/Tabs/Tabs.js +85 -0
  167. package/dist/scripts/src/components/Text/Text.js +175 -0
  168. package/dist/scripts/src/components/TextArea/TextArea.js +194 -0
  169. package/dist/scripts/src/components/TextArea/TextAreaResizable.js +63 -0
  170. package/dist/scripts/src/components/TextArea/useComposedRef.js +50 -0
  171. package/dist/scripts/src/components/TextBox/TextBox.js +145 -0
  172. package/dist/scripts/src/components/Theme/NotificationToast.js +39 -0
  173. package/dist/scripts/src/components/Theme/Theme.js +153 -0
  174. package/dist/scripts/src/components/ThemeChanger/ThemeChanger.js +125 -0
  175. package/dist/scripts/src/components/Toggle/Toggle.js +88 -0
  176. package/dist/scripts/src/components/Tree/TreeComponent.js +79 -0
  177. package/dist/scripts/src/components/ValidationSummary/ValidationSummary.js +59 -0
  178. package/dist/scripts/src/components/ViewComponentRegistryContext.js +34 -0
  179. package/dist/scripts/src/components/abstractions.js +2 -0
  180. package/dist/scripts/src/components/chart-color-schemes.js +43 -0
  181. package/dist/scripts/src/components/component-utils.js +32 -0
  182. package/dist/scripts/src/components/container-helpers.js +18 -0
  183. package/dist/scripts/src/components-core/ApiBoundComponent.js +189 -0
  184. package/dist/scripts/src/components-core/AppContext.js +17 -0
  185. package/dist/scripts/src/components-core/ChildrenSlot.js +10 -0
  186. package/dist/scripts/src/components-core/Component.js +280 -0
  187. package/dist/scripts/src/components-core/ComponentDecorator.js +63 -0
  188. package/dist/scripts/src/components-core/CompoundComponent.js +132 -0
  189. package/dist/scripts/src/components-core/EngineError.js +91 -0
  190. package/dist/scripts/src/components-core/ErrorBoundary.js +58 -0
  191. package/dist/scripts/src/components-core/Fragment.js +14 -0
  192. package/dist/scripts/src/components-core/InvalidComponent.js +15 -0
  193. package/dist/scripts/src/components-core/LoaderComponent.js +78 -0
  194. package/dist/scripts/src/components-core/RestApiProxy.js +341 -0
  195. package/dist/scripts/src/components-core/RootComponent.js +272 -0
  196. package/dist/scripts/src/components-core/RouteContext.js +45 -0
  197. package/dist/scripts/src/components-core/ScrollContext.js +9 -0
  198. package/dist/scripts/src/components-core/UnknownComponent.js +15 -0
  199. package/dist/scripts/src/components-core/abstractions/ComponentRenderer.js +2 -0
  200. package/dist/scripts/src/components-core/abstractions/LoaderRenderer.js +2 -0
  201. package/dist/scripts/src/components-core/abstractions/containers.js +18 -0
  202. package/dist/scripts/src/components-core/abstractions/treeAbstractions.js +2 -0
  203. package/dist/scripts/src/components-core/action/ApiAction.js +276 -0
  204. package/dist/scripts/src/components-core/action/DownloadFileAction.js +80 -0
  205. package/dist/scripts/src/components-core/action/NavigateAction.js +20 -0
  206. package/dist/scripts/src/components-core/action/TimedAction.js +21 -0
  207. package/dist/scripts/src/components-core/action/UploadAction.js +88 -0
  208. package/dist/scripts/src/components-core/action/actions.js +15 -0
  209. package/dist/scripts/src/components-core/appContext/date-functions.js +19 -0
  210. package/dist/scripts/src/components-core/appContext/misc-utils.js +12 -0
  211. package/dist/scripts/src/components-core/component-hooks.js +25 -0
  212. package/dist/scripts/src/components-core/constants.js +18 -0
  213. package/dist/scripts/src/components-core/container/Container.js +1110 -0
  214. package/dist/scripts/src/components-core/container/ContainerComponentDef.js +16 -0
  215. package/dist/scripts/src/components-core/container/buildProxy.js +54 -0
  216. package/dist/scripts/src/components-core/container/collectFnVarDeps.js +26 -0
  217. package/dist/scripts/src/components-core/container/valueExtractor.js +195 -0
  218. package/dist/scripts/src/components-core/descriptorHelper.js +75 -0
  219. package/dist/scripts/src/components-core/interception/abstractions.js +2 -0
  220. package/dist/scripts/src/components-core/interception/useApiInterceptorContext.js +9 -0
  221. package/dist/scripts/src/components-core/loader/ApiLoader.js +46 -0
  222. package/dist/scripts/src/components-core/loader/DataLoader.js +160 -0
  223. package/dist/scripts/src/components-core/loader/ExternalDataLoader.js +52 -0
  224. package/dist/scripts/src/components-core/loader/Loader.js +115 -0
  225. package/dist/scripts/src/components-core/loader/MockLoaderRenderer.js +32 -0
  226. package/dist/scripts/src/components-core/loader/PageableLoader.js +240 -0
  227. package/dist/scripts/src/components-core/renderers.js +45 -0
  228. package/dist/scripts/src/components-core/reportEngineError.js +59 -0
  229. package/dist/scripts/src/components-core/script-runner/BindingTreeEvaluationContext.js +35 -0
  230. package/dist/scripts/src/components-core/script-runner/ICustomOperations.js +34 -0
  231. package/dist/scripts/src/components-core/script-runner/LogicalThread.js +2 -0
  232. package/dist/scripts/src/components-core/script-runner/LoopScope.js +2 -0
  233. package/dist/scripts/src/components-core/script-runner/ParameterParser.js +117 -0
  234. package/dist/scripts/src/components-core/script-runner/TryScope.js +2 -0
  235. package/dist/scripts/src/components-core/script-runner/asyncProxy.js +96 -0
  236. package/dist/scripts/src/components-core/script-runner/bannedFunctions.js +34 -0
  237. package/dist/scripts/src/components-core/script-runner/custom-operations-registry.js +40 -0
  238. package/dist/scripts/src/components-core/script-runner/custom-ui-data.js +40 -0
  239. package/dist/scripts/src/components-core/script-runner/eval-tree-async.js +551 -0
  240. package/dist/scripts/src/components-core/script-runner/eval-tree-common.js +498 -0
  241. package/dist/scripts/src/components-core/script-runner/eval-tree-sync.js +434 -0
  242. package/dist/scripts/src/components-core/script-runner/modules.js +250 -0
  243. package/dist/scripts/src/components-core/script-runner/process-statement-async.js +818 -0
  244. package/dist/scripts/src/components-core/script-runner/process-statement-common.js +193 -0
  245. package/dist/scripts/src/components-core/script-runner/process-statement-sync.js +740 -0
  246. package/dist/scripts/src/components-core/script-runner/statement-queue.js +62 -0
  247. package/dist/scripts/src/components-core/script-runner/visitors.js +352 -0
  248. package/dist/scripts/src/components-core/theming/ThemeContext.js +43 -0
  249. package/dist/scripts/src/components-core/theming/ThemeProvider.js +334 -0
  250. package/dist/scripts/src/components-core/theming/abstractions.js +11 -0
  251. package/dist/scripts/src/components-core/theming/extendThemeUtils.js +114 -0
  252. package/dist/scripts/src/components-core/theming/hvar.js +105 -0
  253. package/dist/scripts/src/components-core/theming/themeVars.js +62 -0
  254. package/dist/scripts/src/components-core/theming/themes/base-utils.js +31 -0
  255. package/dist/scripts/src/components-core/theming/themes/palette.js +53 -0
  256. package/dist/scripts/src/components-core/theming/themes/root.js +257 -0
  257. package/dist/scripts/src/components-core/theming/themes/solid.js +16 -0
  258. package/dist/scripts/src/components-core/theming/themes/theme-colors.js +407 -0
  259. package/dist/scripts/src/components-core/theming/themes/xmlui.js +32 -0
  260. package/dist/scripts/src/components-core/theming/transformThemeVars.js +286 -0
  261. package/dist/scripts/src/components-core/utils/DataLoaderQueryKeyGenerator.js +34 -0
  262. package/dist/scripts/src/components-core/utils/LruCache.js +184 -0
  263. package/dist/scripts/src/components-core/utils/actionUtils.js +32 -0
  264. package/dist/scripts/src/components-core/utils/classnames.js +58 -0
  265. package/dist/scripts/src/components-core/utils/css-utils.js +127 -0
  266. package/dist/scripts/src/components-core/utils/date-utils.js +78 -0
  267. package/dist/scripts/src/components-core/utils/extractParam.js +148 -0
  268. package/dist/scripts/src/components-core/utils/hooks.js +221 -0
  269. package/dist/scripts/src/components-core/utils/mergeProps.js +45 -0
  270. package/dist/scripts/src/components-core/utils/misc.js +460 -0
  271. package/dist/scripts/src/components-core/utils/statementUtils.js +205 -0
  272. package/dist/scripts/src/components-core/utils/treeUtils.js +48 -0
  273. package/dist/scripts/src/components-core/xmlui-parser.js +52 -0
  274. package/dist/scripts/src/parsers/scripting/InputStream.js +59 -0
  275. package/dist/scripts/src/parsers/scripting/Lexer.js +1028 -0
  276. package/dist/scripts/src/parsers/scripting/Parser.js +2647 -0
  277. package/dist/scripts/src/parsers/scripting/ParserError.js +46 -0
  278. package/dist/scripts/src/parsers/scripting/TokenTrait.js +109 -0
  279. package/dist/scripts/src/parsers/scripting/code-behind-collect.js +118 -0
  280. package/dist/scripts/src/parsers/scripting/tree-visitor.js +602 -0
  281. package/dist/scripts/src/parsers/style-parser/StyleInputStream.js +39 -0
  282. package/dist/scripts/src/parsers/style-parser/StyleLexer.js +621 -0
  283. package/dist/scripts/src/parsers/style-parser/StyleParser.js +1000 -0
  284. package/dist/scripts/src/parsers/style-parser/errors.js +37 -0
  285. package/dist/scripts/src/parsers/style-parser/source-tree.js +2 -0
  286. package/dist/scripts/src/parsers/style-parser/style-compiler.js +513 -0
  287. package/dist/scripts/src/parsers/style-parser/tokens.js +42 -0
  288. package/dist/scripts/src/parsers/ueml/ParserError.js +54 -0
  289. package/dist/scripts/src/parsers/ueml/UemlHelper.js +579 -0
  290. package/dist/scripts/src/parsers/ueml/UemlInputStream.js +59 -0
  291. package/dist/scripts/src/parsers/ueml/UemlLexer.js +868 -0
  292. package/dist/scripts/src/parsers/ueml/UemlParser.js +1439 -0
  293. package/dist/scripts/src/parsers/ueml/UemlToken.js +24 -0
  294. package/dist/scripts/src/parsers/ueml/fileExtensions.js +6 -0
  295. package/dist/scripts/src/parsers/ueml/source-tree.js +2 -0
  296. package/dist/scripts/src/parsers/ueml/ueml-tree.js +2 -0
  297. package/dist/scripts/src/parsers/xmlui-parser/CharacterCodes.js +136 -0
  298. package/dist/scripts/src/parsers/xmlui-parser/diagnostics.js +100 -0
  299. package/dist/scripts/src/parsers/xmlui-parser/parser.js +476 -0
  300. package/dist/scripts/src/parsers/xmlui-parser/scanner.js +415 -0
  301. package/dist/scripts/src/parsers/xmlui-parser/syntax-kind.js +106 -0
  302. package/dist/scripts/src/parsers/xmlui-parser/syntax-node.js +2 -0
  303. package/dist/scripts/src/parsers/xmlui-parser/transform.js +922 -0
  304. package/dist/scripts/src/parsers/xmlui-parser/utils.js +83 -0
  305. package/dist/xmlui.es.d.ts +1667 -0
  306. package/dist/xmlui.es.js +17 -0
  307. package/dist/xmlui.umd.js +1589 -0
  308. package/package.json +175 -0
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ require("ts-node").register({
4
+ transpileOnly: true,
5
+ esm: true,
6
+ compilerOptions: {
7
+ module: "commonjs",
8
+ esModuleInterop: true,
9
+ },
10
+ });
11
+ require("./index");
@@ -0,0 +1,256 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || function (mod) {
20
+ if (mod && mod.__esModule) return mod;
21
+ var result = {};
22
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
23
+ __setModuleDefault(result, mod);
24
+ return result;
25
+ };
26
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
27
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
28
+ return new (P || (P = Promise))(function (resolve, reject) {
29
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
30
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
31
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
32
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
33
+ });
34
+ };
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.build = void 0;
37
+ exports.removeLeadingSlashForPath = removeLeadingSlashForPath;
38
+ const promises_1 = require("fs/promises");
39
+ const dotenv = __importStar(require("dotenv"));
40
+ const fs_1 = require("fs");
41
+ const glob = __importStar(require("glob"));
42
+ const vite_1 = require("vite");
43
+ const viteConfig_1 = require("./viteConfig");
44
+ const fs = __importStar(require("node:fs"));
45
+ // --- Set up the configuration
46
+ dotenv.config({ path: `${process.cwd()}/.env` });
47
+ dotenv.config({ path: `${process.cwd()}/.env.local`, override: true });
48
+ function getExportedJsObjects(path) {
49
+ return __awaiter(this, void 0, void 0, function* () {
50
+ return yield new Promise((resolve, reject) => {
51
+ glob.glob(`${process.cwd()}/${path}`, (err, matches = []) => {
52
+ const modules = Promise.all(matches.map((file) => __awaiter(this, void 0, void 0, function* () {
53
+ return (yield Promise.resolve(`${file}`).then(s => __importStar(require(s)))).default;
54
+ })));
55
+ resolve(modules);
56
+ });
57
+ });
58
+ });
59
+ }
60
+ function convertResourcesDir(distRoot, flatDist, filePrefix) {
61
+ return __awaiter(this, void 0, void 0, function* () {
62
+ if (!flatDist) {
63
+ return undefined;
64
+ }
65
+ distRoot = distRoot.replaceAll("\\", "/");
66
+ const resourcesDir = `${distRoot}/resources`;
67
+ if (!(0, fs_1.existsSync)(resourcesDir)) {
68
+ return undefined;
69
+ }
70
+ const files = yield new Promise((resolve, reject) => {
71
+ glob.glob(`${resourcesDir}/**/*`, (err, matches = []) => {
72
+ resolve(matches);
73
+ });
74
+ });
75
+ const ret = {};
76
+ for (let i = 0; i < files.length; i++) {
77
+ const file = files[i];
78
+ if (fs.statSync(file).isDirectory()) {
79
+ continue;
80
+ }
81
+ const relativePath = file.replace(`${distRoot}/`, "");
82
+ const convertedResource = `${filePrefix}${relativePath.replaceAll("/", "_")}`;
83
+ yield (0, promises_1.cp)(file, `${distRoot}/${convertedResource}`);
84
+ ret[relativePath] = convertedResource;
85
+ }
86
+ return ret;
87
+ });
88
+ }
89
+ function removeLeadingSlashForPath(path) {
90
+ if (path.startsWith("/")) {
91
+ return path.substring(1);
92
+ }
93
+ return path;
94
+ }
95
+ const build = (_a) => __awaiter(void 0, [_a], void 0, function* ({ buildMode = "CONFIG_ONLY", flatDist = false, withMock = false, withHostingMetaFiles = false, withRelativeRoot = false, withLegacyParser = false, }) {
96
+ const flatDistUiPrefix = "ui_";
97
+ console.log("Building with options:", {
98
+ buildMode,
99
+ flatDist,
100
+ withMock,
101
+ withHostingMetaFiles,
102
+ withRelativeRoot,
103
+ withLegacyParser
104
+ });
105
+ yield (0, vite_1.build)(Object.assign(Object.assign({}, (0, viteConfig_1.getViteConfig)({
106
+ flatDist,
107
+ withRelativeRoot,
108
+ flatDistUiPrefix,
109
+ withLegacyParser,
110
+ })), { define: {
111
+ "process.env.VITE_BUILD_MODE": JSON.stringify(buildMode),
112
+ "process.env.VITE_DEV_MODE": false,
113
+ "process.env.VITE_MOCK_ENABLED": withMock,
114
+ "process.env.VITE_LEGACY_PARSER": withLegacyParser,
115
+ "process.env.VITE_APP_VERSION": JSON.stringify(process.env.VITE_APP_VERSION),
116
+ "process.env.VITE_USED_COMPONENTS_App": JSON.stringify(process.env.VITE_USED_COMPONENTS_App),
117
+ "process.env.VITE_USED_COMPONENTS_Chart": JSON.stringify(process.env.VITE_USED_COMPONENTS_Chart),
118
+ "process.env.VITE_USED_COMPONENTS_AppHeader": JSON.stringify(process.env.VITE_USED_COMPONENTS_AppHeader),
119
+ "process.env.VITE_USED_COMPONENTS_Stack": JSON.stringify(process.env.VITE_USED_COMPONENTS_Stack),
120
+ "process.env.VITE_USED_COMPONENTS_Link": JSON.stringify(process.env.VITE_USED_COMPONENTS_Link),
121
+ "process.env.VITE_USED_COMPONENTS_Text": JSON.stringify(process.env.VITE_USED_COMPONENTS_Text),
122
+ "process.env.VITE_USED_COMPONENTS_Button": JSON.stringify(process.env.VITE_USED_COMPONENTS_Button),
123
+ "process.env.VITE_USED_COMPONENTS_Card": JSON.stringify(process.env.VITE_USED_COMPONENTS_Card),
124
+ "process.env.VITE_USED_COMPONENTS_Image": JSON.stringify(process.env.VITE_USED_COMPONENTS_Image),
125
+ "process.env.VITE_USED_COMPONENTS_Footer": JSON.stringify(process.env.VITE_USED_COMPONENTS_Footer),
126
+ "process.env.VITE_USED_COMPONENTS_SpaceFiller": JSON.stringify(process.env.VITE_USED_COMPONENTS_SpaceFiller),
127
+ "process.env.VITE_USED_COMPONENTS_Pdf": JSON.stringify(process.env.VITE_USED_COMPONENTS_Pdf),
128
+ "process.env.VITE_USED_COMPONENTS_Textarea": JSON.stringify(process.env.VITE_USED_COMPONENTS_Textarea),
129
+ "process.env.VITE_USED_COMPONENTS_Logo": JSON.stringify(process.env.VITE_USED_COMPONENTS_Logo),
130
+ "process.env.VITE_USED_COMPONENTS_NavLink": JSON.stringify(process.env.VITE_USED_COMPONENTS_NavLink),
131
+ "process.env.VITE_USED_COMPONENTS_NavGroup": JSON.stringify(process.env.VITE_USED_COMPONENTS_NavGroup),
132
+ "process.env.VITE_USED_COMPONENTS_Form": JSON.stringify(process.env.VITE_USED_COMPONENTS_Form),
133
+ "process.env.VITE_USED_COMPONENTS_Tree": JSON.stringify(process.env.VITE_USED_COMPONENTS_Tree),
134
+ "process.env.VITE_USED_COMPONENTS_Checkbox": JSON.stringify(process.env.VITE_USED_COMPONENTS_Checkbox),
135
+ "process.env.VITE_USED_COMPONENTS_Switch": JSON.stringify(process.env.VITE_USED_COMPONENTS_Switch),
136
+ "process.env.VITE_USED_COMPONENTS_DotMenu": JSON.stringify(process.env.VITE_USED_COMPONENTS_DotMenu),
137
+ "process.env.VITE_USED_COMPONENTS_Heading": JSON.stringify(process.env.VITE_USED_COMPONENTS_Heading),
138
+ "process.env.VITE_USED_COMPONENTS_Fragment": JSON.stringify(process.env.VITE_USED_COMPONENTS_Fragment),
139
+ "process.env.VITE_USED_COMPONENTS_Table": JSON.stringify(process.env.VITE_USED_COMPONENTS_Table),
140
+ "process.env.VITE_USED_COMPONENTS_List": JSON.stringify(process.env.VITE_USED_COMPONENTS_List),
141
+ "process.env.VITE_USED_COMPONENTS_DateRangePicker": JSON.stringify(process.env.VITE_USED_COMPONENTS_DateRangePicker),
142
+ "process.env.VITE_USED_COMPONENTS_DatePicker": JSON.stringify(process.env.VITE_USED_COMPONENTS_DatePicker),
143
+ "process.env.VITE_USED_COMPONENTS_NavPanel": JSON.stringify(process.env.VITE_USED_COMPONENTS_NavPanel),
144
+ "process.env.VITE_USED_COMPONENTS_Pages": JSON.stringify(process.env.VITE_USED_COMPONENTS_Pages),
145
+ "process.env.VITE_USED_COMPONENTS_StickyBox": JSON.stringify(process.env.VITE_USED_COMPONENTS_StickyBox),
146
+ "process.env.VITE_USED_COMPONENTS_Badge": JSON.stringify(process.env.VITE_USED_COMPONENTS_Badge),
147
+ "process.env.VITE_USED_COMPONENTS_Avatar": JSON.stringify(process.env.VITE_USED_COMPONENTS_Avatar),
148
+ "process.env.VITE_USED_COMPONENTS_ContentSeparator": JSON.stringify(process.env.VITE_USED_COMPONENTS_ContentSeparator),
149
+ "process.env.VITE_USED_COMPONENTS_FlowLayout": JSON.stringify(process.env.VITE_USED_COMPONENTS_FlowLayout),
150
+ "process.env.VITE_USED_COMPONENTS_ModalDialog": JSON.stringify(process.env.VITE_USED_COMPONENTS_ModalDialog),
151
+ "process.env.VITE_USED_COMPONENTS_NoResult": JSON.stringify(process.env.VITE_USED_COMPONENTS_NoResult),
152
+ "process.env.VITE_USED_COMPONENTS_Option": JSON.stringify(process.env.VITE_USED_COMPONENTS_Option),
153
+ "process.env.VITE_USED_COMPONENTS_FileUploadDropZone": JSON.stringify(process.env.VITE_USED_COMPONENTS_FileUploadDropZone),
154
+ "process.env.VITE_USED_COMPONENTS_Icon": JSON.stringify(process.env.VITE_USED_COMPONENTS_Icon),
155
+ "process.env.VITE_USED_COMPONENTS_Items": JSON.stringify(process.env.VITE_USED_COMPONENTS_Items),
156
+ "process.env.VITE_USED_COMPONENTS_SelectionStore": JSON.stringify(process.env.VITE_USED_COMPONENTS_SelectionStore),
157
+ "process.env.VITE_INCLUDE_REST_COMPONENTS": JSON.stringify(process.env.VITE_INCLUDE_REST_COMPONENTS),
158
+ } }));
159
+ if (buildMode === "INLINE_ALL") {
160
+ return;
161
+ }
162
+ const distPath = "/dist";
163
+ const themesFolder = flatDist ? "" : "themes";
164
+ const componentsFolder = flatDist ? "" : "components";
165
+ const themesFolderPath = flatDist ? distPath : `${distPath}/${themesFolder}`;
166
+ const componentsFolderPath = flatDist ? distPath : `${distPath}/${componentsFolder}`;
167
+ function getThemeFileName(theme) {
168
+ return flatDist ? `${flatDistUiPrefix}theme_${theme.id}` : theme.id;
169
+ }
170
+ function getComponentFileName(component) {
171
+ return flatDist ? `${flatDistUiPrefix}component_${component.name}` : component.name;
172
+ }
173
+ function getEntrypointFileName() {
174
+ return flatDist ? `${flatDistUiPrefix}entrypoint` : `app`;
175
+ }
176
+ if (buildMode === "CONFIG_ONLY") {
177
+ let appDef;
178
+ try {
179
+ appDef = (yield Promise.resolve(`${process.cwd() + "/src/config"}`).then(s => __importStar(require(s)))).default;
180
+ }
181
+ catch (e) {
182
+ console.log("couldn't find config");
183
+ }
184
+ const themePaths = [];
185
+ const themes = yield getExportedJsObjects("/src/themes/**.*");
186
+ const fullDistPath = `${process.cwd()}${distPath}`;
187
+ if (themes) {
188
+ for (const theme of themes) {
189
+ if (!(0, fs_1.existsSync)(process.cwd() + themesFolderPath)) {
190
+ yield (0, promises_1.mkdir)(process.cwd() + themesFolderPath, { recursive: true });
191
+ }
192
+ yield (0, promises_1.writeFile)(`${process.cwd()}${themesFolderPath}/${getThemeFileName(theme)}.json`, JSON.stringify(theme, null, 4));
193
+ themePaths.push(removeLeadingSlashForPath(`${themesFolder}/${getThemeFileName(theme)}.json`));
194
+ }
195
+ }
196
+ const configJson = Object.assign(Object.assign({}, appDef), { resourceMap: yield convertResourcesDir(fullDistPath, flatDist, flatDistUiPrefix), themes: themePaths });
197
+ delete configJson["components"];
198
+ delete configJson["entryPoint"];
199
+ if (!withMock) {
200
+ delete configJson.apiInterceptor;
201
+ }
202
+ yield (0, promises_1.writeFile)(`${process.cwd()}${distPath}/config.json`, JSON.stringify(configJson, null, 4));
203
+ }
204
+ else if (buildMode === "ALL") {
205
+ // const componentPaths: string[] = [];
206
+ // const components = await getExportedJsObjects<CompoundComponentDef>("/src/components/**.*");
207
+ // if (components) {
208
+ // for (const component of components) {
209
+ // if (!existsSync(`${process.cwd()}${componentsFolderPath}`)) {
210
+ // await mkdir(`${process.cwd()}${componentsFolderPath}`, { recursive: true });
211
+ // }
212
+ // await writeFile(
213
+ // `${process.cwd()}${componentsFolderPath}/${getComponentFileName(component)}.json`,
214
+ // JSON.stringify(component, null, 4)
215
+ // );
216
+ // componentPaths.push(removeLeadingSlashForPath(`${componentsFolder}/${getComponentFileName(component)}.json`));
217
+ // }
218
+ // }
219
+ //
220
+ // await writeFile(
221
+ // `${process.cwd()}${distPath}/${getEntrypointFileName()}.json`,
222
+ // JSON.stringify(appDef.entryPoint, null, 4)
223
+ // );
224
+ //
225
+ // configJson = {
226
+ // ...configJson,
227
+ // entryPoint: `${getEntrypointFileName()}.json`,
228
+ // components: componentPaths,
229
+ // };
230
+ }
231
+ //TODO temp, we should enforce user(who writes the metadata)-added-resources to be put in the resources folder
232
+ if (flatDist) {
233
+ yield (0, promises_1.rm)(`${process.cwd()}${distPath}/resources`, { recursive: true, force: true });
234
+ }
235
+ if (!withMock) {
236
+ try {
237
+ yield (0, promises_1.rm)(`${process.cwd()}${distPath}/mockServiceWorker.js`);
238
+ }
239
+ catch (ignored) { }
240
+ }
241
+ if (!withHostingMetaFiles) {
242
+ try {
243
+ yield (0, promises_1.rm)(`${process.cwd()}${distPath}/serve.json`);
244
+ }
245
+ catch (ignored) { }
246
+ try {
247
+ yield (0, promises_1.rm)(`${process.cwd()}${distPath}/web.config`);
248
+ }
249
+ catch (ignored) { }
250
+ try {
251
+ yield (0, promises_1.rm)(`${process.cwd()}${distPath}/_redirects`);
252
+ }
253
+ catch (ignored) { }
254
+ }
255
+ });
256
+ exports.build = build;
@@ -0,0 +1,88 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5
+ return new (P || (P = Promise))(function (resolve, reject) {
6
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
7
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
8
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
9
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
10
+ });
11
+ };
12
+ var __importDefault = (this && this.__importDefault) || function (mod) {
13
+ return (mod && mod.__esModule) ? mod : { "default": mod };
14
+ };
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ const build_1 = require("./build");
17
+ const start_1 = require("./start");
18
+ const preview_1 = require("./preview");
19
+ const yargs_1 = require("yargs");
20
+ const adm_zip_1 = __importDefault(require("adm-zip"));
21
+ process.on("unhandledRejection", (err) => {
22
+ throw err;
23
+ });
24
+ const args = process.argv.slice(2);
25
+ const scriptIndex = args.findIndex((x) => x === "build" || x === "eject" || x === "start" || x === "test");
26
+ const script = scriptIndex === -1 ? args[0] : args[scriptIndex];
27
+ function zipDirectory(sourceDir_1) {
28
+ return __awaiter(this, arguments, void 0, function* (sourceDir, outPath = sourceDir) {
29
+ const zip = new adm_zip_1.default();
30
+ zip.addLocalFolder(sourceDir);
31
+ yield zip.writeZipPromise(outPath);
32
+ console.log(`Zip file created: ${outPath}`);
33
+ });
34
+ }
35
+ function zipDist() {
36
+ return __awaiter(this, void 0, void 0, function* () {
37
+ yield zipDirectory(process.cwd() + "/dist", `${process.cwd()}/ui.zip`);
38
+ });
39
+ }
40
+ function dedupeArg(arg) {
41
+ if (Array.isArray(arg)) {
42
+ return arg[arg.length - 1];
43
+ }
44
+ return arg;
45
+ }
46
+ function getBoolArg(arg, defaultValue) {
47
+ if (arg === undefined) {
48
+ return defaultValue;
49
+ }
50
+ return dedupeArg(arg) !== "false";
51
+ }
52
+ function getStringArg(arg, defaultValue) {
53
+ if (arg === undefined) {
54
+ return defaultValue;
55
+ }
56
+ return dedupeArg(arg);
57
+ }
58
+ switch (script) {
59
+ case "build": {
60
+ const { flatDist, prod, buildMode, withMock, withHostingMetaFiles, withRelativeRoot, withLegacyParser } = yargs_1.argv;
61
+ (0, build_1.build)({
62
+ buildMode: getStringArg(buildMode, prod ? "CONFIG_ONLY" : undefined),
63
+ withMock: getBoolArg(withMock, prod ? false : undefined),
64
+ withHostingMetaFiles: getBoolArg(withHostingMetaFiles, prod ? false : undefined),
65
+ withRelativeRoot: getBoolArg(withRelativeRoot, prod ? true : undefined),
66
+ flatDist: getBoolArg(flatDist, prod ? true : undefined),
67
+ withLegacyParser: getBoolArg(withLegacyParser),
68
+ });
69
+ break;
70
+ }
71
+ case "start": {
72
+ const { port, withMock, withLegacyParser } = yargs_1.argv;
73
+ (0, start_1.start)({ port, withMock: getBoolArg(withMock), withLegacyParser: getBoolArg(withLegacyParser) });
74
+ break;
75
+ }
76
+ case "preview": {
77
+ (0, preview_1.preview)();
78
+ break;
79
+ }
80
+ case "zip-dist": {
81
+ zipDist();
82
+ break;
83
+ }
84
+ default: {
85
+ console.log('Unknown script "' + script + '".');
86
+ console.log("Perhaps you need to update xmlui?");
87
+ }
88
+ }
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.preview = void 0;
13
+ const vite_1 = require("vite");
14
+ const viteConfig_1 = require("./viteConfig");
15
+ const preview = () => __awaiter(void 0, void 0, void 0, function* () {
16
+ try {
17
+ const server = yield (0, vite_1.preview)((0, viteConfig_1.getViteConfig)());
18
+ if (!server.httpServer) {
19
+ throw new Error("HTTP server not available");
20
+ }
21
+ server.printUrls();
22
+ }
23
+ catch (e) {
24
+ process.exit(1);
25
+ }
26
+ });
27
+ exports.preview = preview;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.start = void 0;
13
+ const vite_1 = require("vite");
14
+ const viteConfig_1 = require("./viteConfig");
15
+ const start = (_a) => __awaiter(void 0, [_a], void 0, function* ({ port, withMock = true, withLegacyParser = false }) {
16
+ console.log("Starting with options:", {
17
+ withMock,
18
+ withLegacyParser
19
+ });
20
+ try {
21
+ const server = yield (0, vite_1.createServer)(Object.assign(Object.assign({}, (0, viteConfig_1.getViteConfig)({ withLegacyParser })), { server: {
22
+ port,
23
+ }, define: {
24
+ 'process.env.VITE_BUILD_MODE': JSON.stringify("ALL"),
25
+ 'process.env.VITE_DEV_MODE': true,
26
+ 'process.env.VITE_MOCK_ENABLED': withMock,
27
+ "process.env.VITE_INCLUDE_ALL_COMPONENTS": JSON.stringify("true"),
28
+ "process.env.VITE_LEGACY_PARSER": withLegacyParser,
29
+ } }));
30
+ // server.
31
+ if (!server.httpServer) {
32
+ throw new Error("HTTP server not available");
33
+ }
34
+ yield server.listen();
35
+ server.printUrls();
36
+ }
37
+ catch (e) {
38
+ process.exit(1);
39
+ }
40
+ });
41
+ exports.start = start;
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
+ return new (P || (P = Promise))(function (resolve, reject) {
28
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
32
+ });
33
+ };
34
+ Object.defineProperty(exports, "__esModule", { value: true });
35
+ exports.default = viteUemlPlugin;
36
+ const pluginutils_1 = require("@rollup/pluginutils");
37
+ const code_behind_collect_1 = require("../src/parsers/scripting/code-behind-collect");
38
+ const fileExtensions_1 = require("../src/parsers/ueml/fileExtensions");
39
+ const BindingTreeEvaluationContext_1 = require("../src/components-core/script-runner/BindingTreeEvaluationContext");
40
+ const Parser_1 = require("../src/parsers/scripting/Parser");
41
+ const fs = __importStar(require("fs"));
42
+ const path = __importStar(require("path"));
43
+ const xmlui_parser_1 = require("../src/components-core/xmlui-parser");
44
+ const xmluiExtension = new RegExp(`.${fileExtensions_1.componentFileExtension}$`);
45
+ const xmluiScriptExtension = new RegExp(`.${fileExtensions_1.codeBehindFileExtension}$`);
46
+ const moduleScriptExtension = new RegExp(`.${fileExtensions_1.moduleFileExtension}$`);
47
+ /**
48
+ * Transform UEML files to JS objects.
49
+ */
50
+ function viteUemlPlugin(pluginOptions = {}) {
51
+ return {
52
+ name: "vite:transform-ueml",
53
+ // async resolveId(source, importer, options){
54
+ // console.log('resolveId', source, importer, options);
55
+ // return null;
56
+ // },
57
+ // async load(id, options){
58
+ // if (xmluiScriptExtension.test(id)) {
59
+ // console.log('load ', id, options);
60
+ // }
61
+ // return null;
62
+ // },
63
+ transform(code, id, options) {
64
+ return __awaiter(this, void 0, void 0, function* () {
65
+ const moduleResolver = (parentModule, moduleName) => {
66
+ // --- Try with .xmlui.xs extension, and then with .xs.
67
+ try {
68
+ const modulePath = path.resolve(path.dirname(id), `${moduleName}.${fileExtensions_1.codeBehindFileExtension}`);
69
+ return fs.readFileSync(modulePath, {
70
+ encoding: "utf8",
71
+ });
72
+ }
73
+ catch (_a) {
74
+ try {
75
+ return fs.readFileSync(path.resolve(path.dirname(id), `${moduleName}.${fileExtensions_1.moduleFileExtension}`), {
76
+ encoding: "utf8",
77
+ });
78
+ }
79
+ catch (err) {
80
+ throw err;
81
+ }
82
+ }
83
+ };
84
+ if (xmluiExtension.test(id)) {
85
+ const componentDef = (0, xmlui_parser_1.parseXmlUiMarkup)(code, moduleResolver, pluginOptions.withLegacyParser);
86
+ return {
87
+ code: (0, pluginutils_1.dataToEsm)(componentDef),
88
+ map: { mappings: "" },
89
+ };
90
+ }
91
+ if (xmluiScriptExtension.test(id) || moduleScriptExtension.test(id)) {
92
+ // --- We parse the module file to catch parsing errors
93
+ const parser = new Parser_1.Parser(code);
94
+ parser.parseStatements();
95
+ let evalContext = (0, BindingTreeEvaluationContext_1.createEvalContext)({});
96
+ let codeBehind = (0, code_behind_collect_1.collectCodeBehindFromSource)("Main", code, moduleResolver, evalContext);
97
+ (0, code_behind_collect_1.removeCodeBehindTokensFromTree)(codeBehind);
98
+ // TODO: Add error handling.
99
+ // Check, if codeBehind.moduleErrors is not empty (Record<string, ModuleErrors[]>); each module
100
+ // should be checked for errors and warnings. If there are errors, throw an error.
101
+ return {
102
+ code: (0, pluginutils_1.dataToEsm)(codeBehind),
103
+ map: { mappings: "" },
104
+ };
105
+ }
106
+ return null;
107
+ });
108
+ },
109
+ // async generateBundle(opts, bundle, isWrite){
110
+ // console.log('generate bundle', opts);
111
+ // }
112
+ };
113
+ }
@@ -0,0 +1,112 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.getViteConfig = getViteConfig;
30
+ const vite_1 = require("vite");
31
+ const plugin_react_1 = __importDefault(require("@vitejs/plugin-react"));
32
+ const vite_plugin_svgr_1 = __importDefault(require("vite-plugin-svgr"));
33
+ const vite_plugin_yaml_1 = __importDefault(require("@modyfi/vite-plugin-yaml"));
34
+ const vite_ueml_plugin_1 = __importDefault(require("./vite-ueml-plugin"));
35
+ const path = __importStar(require("path"));
36
+ function getViteConfig({ flatDist = false, withRelativeRoot = false, flatDistUiPrefix = "", withLegacyParser = false, } = {}) {
37
+ return (0, vite_1.defineConfig)({
38
+ plugins: [(0, plugin_react_1.default)(), (0, vite_plugin_svgr_1.default)(), (0, vite_plugin_yaml_1.default)(), (0, vite_ueml_plugin_1.default)({ withLegacyParser })],
39
+ resolve: {
40
+ alias: {
41
+ "@abstractions": path.resolve(__dirname, "../src/abstractions"),
42
+ "@core": path.resolve(__dirname, "../src/core"),
43
+ "@components-core": path.resolve(__dirname, "../src/components-core"),
44
+ "@components": path.resolve(__dirname, "../src/components"),
45
+ },
46
+ },
47
+ base: withRelativeRoot ? "" : undefined,
48
+ // experimental: {
49
+ // renderBuiltUrl: (filename, {type, hostType, hostId}) =>{
50
+ // if (type === 'asset') {
51
+ // // return { runtime: `window.__toCdnUrl(${JSON.stringify(filename)})` }
52
+ // return 'https://static.themohoz.com/xmlui/v0.31/' + filename
53
+ // } else {
54
+ // return { relative: true }
55
+ // }
56
+ // }
57
+ // },
58
+ build: {
59
+ rollupOptions: {
60
+ input: path.resolve(process.cwd(), "index.html"),
61
+ output: {
62
+ assetFileNames: (assetInfo) => {
63
+ var _a;
64
+ const extType = (_a = assetInfo.name) === null || _a === void 0 ? void 0 : _a.split(".").pop();
65
+ if (/png|jpe?g|svg|gif|tiff|bmp|ico/i.test(extType)) {
66
+ return flatDist
67
+ ? `${flatDistUiPrefix}internal_img_[name].[hash][extname]`
68
+ : `internal/img/[name].[hash][extname]`;
69
+ }
70
+ if (assetInfo.name === "index.css") {
71
+ return flatDist
72
+ ? `${flatDistUiPrefix}internal_[name].[hash][extname]`
73
+ : `internal/[name].[hash][extname]`;
74
+ }
75
+ return flatDist
76
+ ? `${flatDistUiPrefix}internal_chunks_[name].[hash][extname]`
77
+ : `internal/chunks/[name].[hash][extname]`;
78
+ },
79
+ chunkFileNames: flatDist
80
+ ? `${flatDistUiPrefix}internal_chunks_[name].[hash].js`
81
+ : "internal/chunks/[name].[hash].js",
82
+ entryFileNames: flatDist ? `${flatDistUiPrefix}internal_[name].[hash].js` : "internal/[name].[hash].js",
83
+ },
84
+ // treeshake: {
85
+ // preset: "recommended",
86
+ // moduleSideEffects: (id: string, external: boolean)=>{
87
+ // if(id.includes(path.resolve(process.cwd(), 'index.html'))){ //otherwise tree shaking doesn't work
88
+ // return true;
89
+ // }
90
+ // if(id.includes(path.resolve(process.cwd(), "src", 'main.tsx'))){ //otherwise tree shaking doesn't work
91
+ // return true;
92
+ // }
93
+ // return false;
94
+ // }
95
+ // }
96
+ // assetFileNames: (assetInfo) => {
97
+ // let extType = assetInfo.name?.split(".").pop();
98
+ // if (/png|jpe?g|svg|gif|tiff|bmp|ico/i.test(extType!)) {
99
+ // return `img/[name][extname]`;
100
+ // }
101
+ // if (assetInfo.name === "index.css") {
102
+ // return `[name][extname]`;
103
+ // }
104
+ // return `chunks/[name][extname]`;
105
+ // },
106
+ // chunkFileNames: "chunks/[name].js",
107
+ // entryFileNames: "[name].js",
108
+ // },
109
+ },
110
+ },
111
+ });
112
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ // TODO: It should be internal to the execution engine and not be part of the scripting
3
+ // source tree
4
+ Object.defineProperty(exports, "__esModule", { value: true });