xmlui 0.7.14 → 0.7.15

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 (392) hide show
  1. package/dist/{apiInterceptorWorker-FBzCR_-x.mjs → apiInterceptorWorker-yKpXImCG.mjs} +1 -1
  2. package/dist/{index-rxu3P0l4.mjs → index-XNGGyvQ0.mjs} +9904 -9653
  3. package/dist/index.css +1 -1
  4. package/dist/scripts/bin/build.js +17 -7
  5. package/dist/scripts/bin/vite-ueml-plugin.js +17 -7
  6. package/dist/scripts/bin/viteConfig.js +17 -7
  7. package/dist/scripts/package.json +209 -0
  8. package/dist/scripts/src/abstractions/scripting/ScriptingSourceTreeExp.js +51 -0
  9. package/dist/scripts/src/components/APICall/APICall.js +74 -0
  10. package/dist/scripts/src/components/APICall/APICallNative.js +31 -0
  11. package/dist/scripts/src/components/Accordion/Accordion.js +78 -0
  12. package/dist/scripts/src/components/Accordion/AccordionContext.js +20 -0
  13. package/dist/scripts/src/components/Accordion/AccordionItem.js +28 -0
  14. package/dist/scripts/src/components/Accordion/AccordionItemNative.js +79 -0
  15. package/dist/scripts/src/components/Accordion/AccordionNative.js +122 -0
  16. package/dist/scripts/src/components/Alert/Alert.js +42 -0
  17. package/dist/scripts/src/components/Alert/AlertNative.js +8 -0
  18. package/dist/scripts/src/components/Animation/Animation.js +59 -0
  19. package/dist/scripts/src/components/Animation/AnimationNative.js +75 -0
  20. package/dist/scripts/src/components/App/App.js +76 -0
  21. package/dist/scripts/src/components/App/AppLayoutContext.js +49 -0
  22. package/dist/scripts/src/components/App/AppNative.js +204 -0
  23. package/dist/scripts/src/components/App/AppStateContext.js +9 -0
  24. package/dist/scripts/src/components/App/Sheet.js +99 -0
  25. package/dist/scripts/src/components/AppHeader/AppHeader.js +59 -0
  26. package/dist/scripts/src/components/AppHeader/AppHeaderNative.js +58 -0
  27. package/dist/scripts/src/components/AppState/AppState.js +26 -0
  28. package/dist/scripts/src/components/AppState/AppStateNative.js +24 -0
  29. package/dist/scripts/src/components/AutoComplete/AutoComplete.js +83 -0
  30. package/dist/scripts/src/components/AutoComplete/AutoCompleteContext.js +16 -0
  31. package/dist/scripts/src/components/AutoComplete/AutoCompleteNative.js +225 -0
  32. package/dist/scripts/src/components/Avatar/Avatar.js +47 -0
  33. package/dist/scripts/src/components/Avatar/AvatarNative.js +40 -0
  34. package/dist/scripts/src/components/Backdrop/Backdrop.js +31 -0
  35. package/dist/scripts/src/components/Backdrop/BackdropNative.js +14 -0
  36. package/dist/scripts/src/components/Badge/Badge.js +58 -0
  37. package/dist/scripts/src/components/Badge/BadgeNative.js +22 -0
  38. package/dist/scripts/src/components/BarChart/BarChart.js +49 -0
  39. package/dist/scripts/src/components/BarChart/BarChartNative.js +176 -0
  40. package/dist/scripts/src/components/Bookmark/Bookmark.js +23 -0
  41. package/dist/scripts/src/components/Bookmark/BookmarkNative.js +24 -0
  42. package/dist/scripts/src/components/Breakout/Breakout.js +16 -0
  43. package/dist/scripts/src/components/Breakout/BreakoutNative.js +12 -0
  44. package/dist/scripts/src/components/Button/Button.js +142 -0
  45. package/dist/scripts/src/components/Button/ButtonNative.js +88 -0
  46. package/dist/scripts/src/components/ButtonGroup/ButtonGroup.js +41 -0
  47. package/dist/scripts/src/components/ButtonGroup/ButtonGroupNative.js +8 -0
  48. package/dist/scripts/src/components/Card/Card.js +57 -0
  49. package/dist/scripts/src/components/Card/CardNative.js +26 -0
  50. package/dist/scripts/src/components/Carousel/Carousel.js +68 -0
  51. package/dist/scripts/src/components/Carousel/CarouselItem.js +16 -0
  52. package/dist/scripts/src/components/Carousel/CarouselItemNative.js +13 -0
  53. package/dist/scripts/src/components/Carousel/CarouselNative.js +163 -0
  54. package/dist/scripts/src/components/ChangeListener/ChangeListener.js +24 -0
  55. package/dist/scripts/src/components/ChangeListener/ChangeListenerNative.js +26 -0
  56. package/dist/scripts/src/components/Chart/Chart.js +24 -0
  57. package/dist/scripts/src/components/Chart/ChartNative.js +165 -0
  58. package/dist/scripts/src/components/Checkbox/Checkbox.js +68 -0
  59. package/dist/scripts/src/components/Column/Column.js +34 -0
  60. package/dist/scripts/src/components/Column/ColumnNative.js +38 -0
  61. package/dist/scripts/src/components/Column/TableContext.js +12 -0
  62. package/dist/scripts/src/components/ComponentProvider.js +503 -0
  63. package/dist/scripts/src/components/ComponentRegistryContext.js +44 -0
  64. package/dist/scripts/src/components/ContentSeparator/ContentSeparator.js +38 -0
  65. package/dist/scripts/src/components/ContentSeparator/ContentSeparatorNative.js +16 -0
  66. package/dist/scripts/src/components/DatePicker/DatePicker.js +62 -0
  67. package/dist/scripts/src/components/DatePicker/DatePickerNative.js +196 -0
  68. package/dist/scripts/src/components/DropdownMenu/DropdownMenu.js +125 -0
  69. package/dist/scripts/src/components/DropdownMenu/DropdownMenuNative.js +95 -0
  70. package/dist/scripts/src/components/EmojiSelector/EmojiSelector.js +26 -0
  71. package/dist/scripts/src/components/EmojiSelector/EmojiSelectorNative.js +52 -0
  72. package/dist/scripts/src/components/FileInput/FileInput.js +64 -0
  73. package/dist/scripts/src/components/FileInput/FileInputNative.js +128 -0
  74. package/dist/scripts/src/components/FileUploadDropZone/FileUploadDropZone.js +46 -0
  75. package/dist/scripts/src/components/FileUploadDropZone/FileUploadDropZoneNative.js +112 -0
  76. package/dist/scripts/src/components/FlowLayout/FlowLayout.js +53 -0
  77. package/dist/scripts/src/components/FlowLayout/FlowLayoutNative.js +108 -0
  78. package/dist/scripts/src/components/Footer/Footer.js +35 -0
  79. package/dist/scripts/src/components/Footer/FooterNative.js +20 -0
  80. package/dist/scripts/src/components/Form/Form.js +89 -0
  81. package/dist/scripts/src/components/Form/FormContext.js +9 -0
  82. package/dist/scripts/src/components/Form/FormNative.js +317 -0
  83. package/dist/scripts/src/components/Form/formActions.js +114 -0
  84. package/dist/scripts/src/components/FormItem/FormItem.js +125 -0
  85. package/dist/scripts/src/components/FormItem/FormItemNative.js +157 -0
  86. package/dist/scripts/src/components/FormItem/HelperText.js +27 -0
  87. package/dist/scripts/src/components/FormItem/ItemWithLabel.js +40 -0
  88. package/dist/scripts/src/components/FormItem/Validations.js +351 -0
  89. package/dist/scripts/src/components/FormSection/FormSection.js +41 -0
  90. package/dist/scripts/src/components/Heading/Heading.js +258 -0
  91. package/dist/scripts/src/components/Heading/HeadingNative.js +45 -0
  92. package/dist/scripts/src/components/HoverCard/HoverCard.js +19 -0
  93. package/dist/scripts/src/components/HoverCard/HovercardNative.js +44 -0
  94. package/dist/scripts/src/components/Icon/ApiIcon.js +10 -0
  95. package/dist/scripts/src/components/Icon/Attach.js +10 -0
  96. package/dist/scripts/src/components/Icon/Binding.js +11 -0
  97. package/dist/scripts/src/components/Icon/BoardIcon.js +7 -0
  98. package/dist/scripts/src/components/Icon/BoxIcon.js +10 -0
  99. package/dist/scripts/src/components/Icon/CheckIcon.js +7 -0
  100. package/dist/scripts/src/components/Icon/ChevronLeft.js +7 -0
  101. package/dist/scripts/src/components/Icon/ChevronRight.js +7 -0
  102. package/dist/scripts/src/components/Icon/CodeFileIcon.js +10 -0
  103. package/dist/scripts/src/components/Icon/CodeSandbox.js +10 -0
  104. package/dist/scripts/src/components/Icon/CompactListIcon.js +7 -0
  105. package/dist/scripts/src/components/Icon/ContentCopyIcon.js +7 -0
  106. package/dist/scripts/src/components/Icon/DatabaseIcon.js +11 -0
  107. package/dist/scripts/src/components/Icon/DocFileIcon.js +10 -0
  108. package/dist/scripts/src/components/Icon/DocIcon.js +10 -0
  109. package/dist/scripts/src/components/Icon/DotMenuHorizontalIcon.js +7 -0
  110. package/dist/scripts/src/components/Icon/DotMenuIcon.js +7 -0
  111. package/dist/scripts/src/components/Icon/EmailIcon.js +7 -0
  112. package/dist/scripts/src/components/Icon/EmptyFolderIcon.js +10 -0
  113. package/dist/scripts/src/components/Icon/ErrorIcon.js +7 -0
  114. package/dist/scripts/src/components/Icon/ExpressionIcon.js +10 -0
  115. package/dist/scripts/src/components/Icon/FillPlusCricleIcon.js +7 -0
  116. package/dist/scripts/src/components/Icon/FilterIcon.js +10 -0
  117. package/dist/scripts/src/components/Icon/FolderIcon.js +10 -0
  118. package/dist/scripts/src/components/Icon/GlobeIcon.js +7 -0
  119. package/dist/scripts/src/components/Icon/HomeIcon.js +7 -0
  120. package/dist/scripts/src/components/Icon/HyperLinkIcon.js +7 -0
  121. package/dist/scripts/src/components/Icon/Icon.js +32 -0
  122. package/dist/scripts/src/components/Icon/IconNative.js +102 -0
  123. package/dist/scripts/src/components/Icon/ImageFileIcon.js +10 -0
  124. package/dist/scripts/src/components/Icon/LinkIcon.js +7 -0
  125. package/dist/scripts/src/components/Icon/ListIcon.js +7 -0
  126. package/dist/scripts/src/components/Icon/LooseListIcon.js +7 -0
  127. package/dist/scripts/src/components/Icon/MoonIcon.js +10 -0
  128. package/dist/scripts/src/components/Icon/MoreOptionsIcon.js +7 -0
  129. package/dist/scripts/src/components/Icon/NoSortIcon.js +8 -0
  130. package/dist/scripts/src/components/Icon/PDFIcon.js +10 -0
  131. package/dist/scripts/src/components/Icon/PenIcon.js +7 -0
  132. package/dist/scripts/src/components/Icon/PhoneIcon.js +7 -0
  133. package/dist/scripts/src/components/Icon/PhotoIcon.js +10 -0
  134. package/dist/scripts/src/components/Icon/PlusIcon.js +7 -0
  135. package/dist/scripts/src/components/Icon/SearchIcon.js +7 -0
  136. package/dist/scripts/src/components/Icon/ShareIcon.js +10 -0
  137. package/dist/scripts/src/components/Icon/SortAscendingIcon.js +8 -0
  138. package/dist/scripts/src/components/Icon/SortDescendingIcon.js +8 -0
  139. package/dist/scripts/src/components/Icon/SunIcon.js +10 -0
  140. package/dist/scripts/src/components/Icon/TrashIcon.js +7 -0
  141. package/dist/scripts/src/components/Icon/TrendingDownIcon.js +10 -0
  142. package/dist/scripts/src/components/Icon/TrendingLevelIcon.js +10 -0
  143. package/dist/scripts/src/components/Icon/TrendingUpIcon.js +10 -0
  144. package/dist/scripts/src/components/Icon/TxtIcon.js +10 -0
  145. package/dist/scripts/src/components/Icon/UnknownFileIcon.js +10 -0
  146. package/dist/scripts/src/components/Icon/UnlinkIcon.js +10 -0
  147. package/dist/scripts/src/components/Icon/UserIcon.js +7 -0
  148. package/dist/scripts/src/components/Icon/WarningIcon.js +7 -0
  149. package/dist/scripts/src/components/Icon/XlsIcon.js +10 -0
  150. package/dist/scripts/src/components/IconInfoCard/IconInfoCard.js +39 -0
  151. package/dist/scripts/src/components/IconProvider.js +264 -0
  152. package/dist/scripts/src/components/IconRegistryContext.js +317 -0
  153. package/dist/scripts/src/components/Image/Image.js +35 -0
  154. package/dist/scripts/src/components/Image/ImageNative.js +15 -0
  155. package/dist/scripts/src/components/Input/InputAdornment.js +14 -0
  156. package/dist/scripts/src/components/Items/Items.js +33 -0
  157. package/dist/scripts/src/components/Items/ItemsNative.js +29 -0
  158. package/dist/scripts/src/components/Link/Link.js +64 -0
  159. package/dist/scripts/src/components/Link/LinkNative.js +26 -0
  160. package/dist/scripts/src/components/List/List.js +81 -0
  161. package/dist/scripts/src/components/List/ListNative.js +425 -0
  162. package/dist/scripts/src/components/Logo/Logo.js +16 -0
  163. package/dist/scripts/src/components/Logo/LogoNative.js +15 -0
  164. package/dist/scripts/src/components/Map/Map.js +75 -0
  165. package/dist/scripts/src/components/Map/world_countries.json +45307 -0
  166. package/dist/scripts/src/components/Markdown/Markdown.js +45 -0
  167. package/dist/scripts/src/components/Markdown/MarkdownNative.js +107 -0
  168. package/dist/scripts/src/components/ModalDialog/ConfirmationModalContextProvider.js +116 -0
  169. package/dist/scripts/src/components/ModalDialog/Dialog.js +20 -0
  170. package/dist/scripts/src/components/ModalDialog/ModalDialog.js +64 -0
  171. package/dist/scripts/src/components/ModalDialog/ModalDialogNative.js +167 -0
  172. package/dist/scripts/src/components/ModalDialog/ModalVisibilityContext.js +60 -0
  173. package/dist/scripts/src/components/NavGroup/NavGroup.js +34 -0
  174. package/dist/scripts/src/components/NavGroup/NavGroupNative.js +91 -0
  175. package/dist/scripts/src/components/NavLink/NavLink.js +71 -0
  176. package/dist/scripts/src/components/NavLink/NavLinkNative.js +61 -0
  177. package/dist/scripts/src/components/NavPanel/NavPanel.js +31 -0
  178. package/dist/scripts/src/components/NavPanel/NavPanelNative.js +74 -0
  179. package/dist/scripts/src/components/NoResult/NoResult.js +38 -0
  180. package/dist/scripts/src/components/NoResult/NoResultNative.js +13 -0
  181. package/dist/scripts/src/components/NumberBox/NumberBox.js +61 -0
  182. package/dist/scripts/src/components/NumberBox/NumberBoxNative.js +337 -0
  183. package/dist/scripts/src/components/NumberBox/numberbox-abstractions.js +74 -0
  184. package/dist/scripts/src/components/OffCanvas/OffCanvas.js +57 -0
  185. package/dist/scripts/src/components/OffCanvas/OffCanvasNative.js +48 -0
  186. package/dist/scripts/src/components/Option/Option.js +33 -0
  187. package/dist/scripts/src/components/Option/OptionTypeProvider.js +16 -0
  188. package/dist/scripts/src/components/PageHeader/PageHeader.js +36 -0
  189. package/dist/scripts/src/components/PageMetaTitle/PageMetaTilteNative.js +9 -0
  190. package/dist/scripts/src/components/PageMetaTitle/PageMetaTitle.js +18 -0
  191. package/dist/scripts/src/components/Pages/Pages.js +33 -0
  192. package/dist/scripts/src/components/Pages/PagesNative.js +69 -0
  193. package/dist/scripts/src/components/PieChart/PieChart.js +45 -0
  194. package/dist/scripts/src/components/PieChart/PieChartNative.js +165 -0
  195. package/dist/scripts/src/components/PositionedContainer/PositionedContainer.js +24 -0
  196. package/dist/scripts/src/components/PositionedContainer/PositionedContainerNative.js +14 -0
  197. package/dist/scripts/src/components/ProgressBar/ProgressBar.js +36 -0
  198. package/dist/scripts/src/components/ProgressBar/ProgressBarNative.js +12 -0
  199. package/dist/scripts/src/components/Queue/Queue.js +71 -0
  200. package/dist/scripts/src/components/Queue/QueueNative.js +278 -0
  201. package/dist/scripts/src/components/Queue/queueActions.js +87 -0
  202. package/dist/scripts/src/components/RadioGroup/RadioGroup.js +68 -0
  203. package/dist/scripts/src/components/RadioGroup/RadioGroupNative.js +104 -0
  204. package/dist/scripts/src/components/Range/Range.js +56 -0
  205. package/dist/scripts/src/components/Range/RangeNative.js +8 -0
  206. package/dist/scripts/src/components/RealTimeAdapter/RealTimeAdapter.js +21 -0
  207. package/dist/scripts/src/components/RealTimeAdapter/RealTimeAdapterNative.js +131 -0
  208. package/dist/scripts/src/components/Redirect/Redirect.js +20 -0
  209. package/dist/scripts/src/components/Select/OptionContext.js +12 -0
  210. package/dist/scripts/src/components/Select/Select.js +98 -0
  211. package/dist/scripts/src/components/Select/SelectContext.js +9 -0
  212. package/dist/scripts/src/components/Select/SelectNative.js +214 -0
  213. package/dist/scripts/src/components/SelectionStore/SelectionStore.js +22 -0
  214. package/dist/scripts/src/components/SelectionStore/SelectionStoreNative.js +94 -0
  215. package/dist/scripts/src/components/Slider/Slider.js +54 -0
  216. package/dist/scripts/src/components/Slider/SliderNative.js +8 -0
  217. package/dist/scripts/src/components/SpaceFiller/SpaceFiller.js +19 -0
  218. package/dist/scripts/src/components/SpaceFiller/SpaceFillerNative.js +10 -0
  219. package/dist/scripts/src/components/Spinner/Spinner.js +42 -0
  220. package/dist/scripts/src/components/Spinner/SpinnerNative.js +31 -0
  221. package/dist/scripts/src/components/Splitter/Splitter.js +89 -0
  222. package/dist/scripts/src/components/Splitter/SplitterNative.js +159 -0
  223. package/dist/scripts/src/components/Splitter/utils.js +17 -0
  224. package/dist/scripts/src/components/Stack/Stack.js +110 -0
  225. package/dist/scripts/src/components/Stack/StackNative.js +39 -0
  226. package/dist/scripts/src/components/StateViewer/StateViewerNative.js +19 -0
  227. package/dist/scripts/src/components/StickyBox/StickyBox.js +30 -0
  228. package/dist/scripts/src/components/StickyBox/StickyBoxNative.js +15 -0
  229. package/dist/scripts/src/components/Switch/Switch.js +72 -0
  230. package/dist/scripts/src/components/Table/Table.js +184 -0
  231. package/dist/scripts/src/components/Table/TableNative.js +470 -0
  232. package/dist/scripts/src/components/Table/useRowSelection.js +245 -0
  233. package/dist/scripts/src/components/TableHeader/TableHeader.js +34 -0
  234. package/dist/scripts/src/components/TableOfContents/TableOfContents.js +74 -0
  235. package/dist/scripts/src/components/TableOfContents/TableOfContentsNative.js +55 -0
  236. package/dist/scripts/src/components/Tabs/TabContext.js +45 -0
  237. package/dist/scripts/src/components/Tabs/TabItem.js +20 -0
  238. package/dist/scripts/src/components/Tabs/TabItemNative.js +24 -0
  239. package/dist/scripts/src/components/Tabs/Tabs.js +55 -0
  240. package/dist/scripts/src/components/Tabs/TabsNative.js +72 -0
  241. package/dist/scripts/src/components/Text/Text.js +122 -0
  242. package/dist/scripts/src/components/Text/TextNative.js +124 -0
  243. package/dist/scripts/src/components/TextArea/TextArea.js +65 -0
  244. package/dist/scripts/src/components/TextArea/TextAreaNative.js +176 -0
  245. package/dist/scripts/src/components/TextArea/TextAreaResizable.js +73 -0
  246. package/dist/scripts/src/components/TextArea/useComposedRef.js +60 -0
  247. package/dist/scripts/src/components/TextBox/TextBox.js +85 -0
  248. package/dist/scripts/src/components/TextBox/TextBoxNative.js +109 -0
  249. package/dist/scripts/src/components/Theme/NotificationToast.js +50 -0
  250. package/dist/scripts/src/components/Theme/Theme.js +43 -0
  251. package/dist/scripts/src/components/Theme/ThemeNative.js +126 -0
  252. package/dist/scripts/src/components/ThemeChanger/ThemeChanger.js +115 -0
  253. package/dist/scripts/src/components/ThemeChanger/ToneChangerButton.js +28 -0
  254. package/dist/scripts/src/components/Toggle/Toggle.js +99 -0
  255. package/dist/scripts/src/components/Toolbar/Toolbar.js +32 -0
  256. package/dist/scripts/src/components/ToolbarButton/ToolbarButton.js +38 -0
  257. package/dist/scripts/src/components/Tree/TreeComponent.js +32 -0
  258. package/dist/scripts/src/components/Tree/TreeNative.js +69 -0
  259. package/dist/scripts/src/components/TrendLabel/TrendLabel.js +37 -0
  260. package/dist/scripts/src/components/ValidationSummary/ValidationSummary.js +59 -0
  261. package/dist/scripts/src/components/abstractions.js +151 -0
  262. package/dist/scripts/src/components/chart-color-schemes.js +43 -0
  263. package/dist/scripts/src/components/component-utils.js +17 -0
  264. package/dist/scripts/src/components/container-helpers.js +25 -0
  265. package/dist/scripts/src/components/metadata-helpers.js +245 -0
  266. package/dist/scripts/src/components/slot-helpers.js +22 -0
  267. package/dist/scripts/src/components-core/ApiBoundComponent.js +194 -0
  268. package/dist/scripts/src/components-core/AppContext.js +16 -0
  269. package/dist/scripts/src/components-core/AppRoot.js +424 -0
  270. package/dist/scripts/src/components-core/ComponentBed.js +325 -0
  271. package/dist/scripts/src/components-core/ComponentDecorator.js +90 -0
  272. package/dist/scripts/src/components-core/CompoundComponent.js +144 -0
  273. package/dist/scripts/src/components-core/DebugViewProvider.js +43 -0
  274. package/dist/scripts/src/components-core/EngineError.js +91 -0
  275. package/dist/scripts/src/components-core/ErrorBoundary.js +59 -0
  276. package/dist/scripts/src/components-core/Fragment.js +15 -0
  277. package/dist/scripts/src/components-core/InspectorContext.js +176 -0
  278. package/dist/scripts/src/components-core/InvalidComponent.js +17 -0
  279. package/dist/scripts/src/components-core/LoaderComponent.js +92 -0
  280. package/dist/scripts/src/components-core/RestApiProxy.js +354 -0
  281. package/dist/scripts/src/components-core/ScrollContext.js +11 -0
  282. package/dist/scripts/src/components-core/Slot.js +17 -0
  283. package/dist/scripts/src/components-core/StandaloneApp.js +589 -0
  284. package/dist/scripts/src/components-core/StandaloneComponentManager.js +51 -0
  285. package/dist/scripts/src/components-core/TableOfContentsContext.js +110 -0
  286. package/dist/scripts/src/components-core/UnknownComponent.js +15 -0
  287. package/dist/scripts/src/components-core/XmluiCodeHighlighter.js +110 -0
  288. package/dist/scripts/src/components-core/abstractions/ComponentRenderer.js +2 -0
  289. package/dist/scripts/src/components-core/abstractions/LoaderRenderer.js +2 -0
  290. package/dist/scripts/src/components-core/abstractions/containers.js +18 -0
  291. package/dist/scripts/src/components-core/abstractions/standalone.js +2 -0
  292. package/dist/scripts/src/components-core/abstractions/treeAbstractions.js +2 -0
  293. package/dist/scripts/src/components-core/action/APICall.js +283 -0
  294. package/dist/scripts/src/components-core/action/FileDownloadAction.js +80 -0
  295. package/dist/scripts/src/components-core/action/FileUploadAction.js +88 -0
  296. package/dist/scripts/src/components-core/action/NavigateAction.js +20 -0
  297. package/dist/scripts/src/components-core/action/TimedAction.js +21 -0
  298. package/dist/scripts/src/components-core/action/actions.js +15 -0
  299. package/dist/scripts/src/components-core/appContext/date-functions.js +19 -0
  300. package/dist/scripts/src/components-core/appContext/math-function.js +27 -0
  301. package/dist/scripts/src/components-core/appContext/misc-utils.js +12 -0
  302. package/dist/scripts/src/components-core/component-hooks.js +25 -0
  303. package/dist/scripts/src/components-core/constants.js +18 -0
  304. package/dist/scripts/src/components-core/container/Container.js +1241 -0
  305. package/dist/scripts/src/components-core/container/buildProxy.js +54 -0
  306. package/dist/scripts/src/components-core/container/collectFnVarDeps.js +49 -0
  307. package/dist/scripts/src/components-core/container/valueExtractor.js +205 -0
  308. package/dist/scripts/src/components-core/descriptorHelper.js +72 -0
  309. package/dist/scripts/src/components-core/interception/ApiInterceptor.js +198 -0
  310. package/dist/scripts/src/components-core/interception/ApiInterceptorProvider.js +94 -0
  311. package/dist/scripts/src/components-core/interception/Backend.js +129 -0
  312. package/dist/scripts/src/components-core/interception/Errors.js +129 -0
  313. package/dist/scripts/src/components-core/interception/InMemoryDb.js +41 -0
  314. package/dist/scripts/src/components-core/interception/IndexedDb.js +205 -0
  315. package/dist/scripts/src/components-core/interception/ReadonlyCollection.js +145 -0
  316. package/dist/scripts/src/components-core/interception/abstractions.js +2 -0
  317. package/dist/scripts/src/components-core/interception/apiInterceptorWorker.js +46 -0
  318. package/dist/scripts/src/components-core/interception/useApiInterceptorContext.js +9 -0
  319. package/dist/scripts/src/components-core/loader/ApiLoader.js +54 -0
  320. package/dist/scripts/src/components-core/loader/DataLoader.js +149 -0
  321. package/dist/scripts/src/components-core/loader/ExternalDataLoader.js +62 -0
  322. package/dist/scripts/src/components-core/loader/Loader.js +126 -0
  323. package/dist/scripts/src/components-core/loader/MockLoaderRenderer.js +40 -0
  324. package/dist/scripts/src/components-core/loader/PageableLoader.js +262 -0
  325. package/dist/scripts/src/components-core/markup-check.js +279 -0
  326. package/dist/scripts/src/components-core/renderers.js +45 -0
  327. package/dist/scripts/src/components-core/reportEngineError.js +62 -0
  328. package/dist/scripts/src/components-core/script-runner/BindingTreeEvaluationContext.js +35 -0
  329. package/dist/scripts/src/components-core/script-runner/ICustomOperations.js +34 -0
  330. package/dist/scripts/src/components-core/script-runner/ParameterParser.js +117 -0
  331. package/dist/scripts/src/components-core/script-runner/asyncProxy.js +149 -0
  332. package/dist/scripts/src/components-core/script-runner/bannedFunctions.js +34 -0
  333. package/dist/scripts/src/components-core/script-runner/custom-operations-registry.js +40 -0
  334. package/dist/scripts/src/components-core/script-runner/custom-ui-data.js +40 -0
  335. package/dist/scripts/src/components-core/script-runner/eval-tree-async.js +593 -0
  336. package/dist/scripts/src/components-core/script-runner/eval-tree-common.js +497 -0
  337. package/dist/scripts/src/components-core/script-runner/eval-tree-sync.js +482 -0
  338. package/dist/scripts/src/components-core/script-runner/process-statement-async.js +766 -0
  339. package/dist/scripts/src/components-core/script-runner/process-statement-common.js +193 -0
  340. package/dist/scripts/src/components-core/script-runner/process-statement-sync.js +752 -0
  341. package/dist/scripts/src/components-core/script-runner/statement-queue.js +62 -0
  342. package/dist/scripts/src/components-core/script-runner/syncProxy.js +31 -0
  343. package/dist/scripts/src/components-core/script-runner/visitors.js +361 -0
  344. package/dist/scripts/src/components-core/theming/ThemeContext.js +53 -0
  345. package/dist/scripts/src/components-core/theming/ThemeProvider.js +335 -0
  346. package/dist/scripts/src/components-core/theming/abstractions.js +11 -0
  347. package/dist/scripts/src/components-core/theming/extendThemeUtils.js +114 -0
  348. package/dist/scripts/src/components-core/theming/hvar.js +105 -0
  349. package/dist/scripts/src/components-core/theming/themeVars.js +62 -0
  350. package/dist/scripts/src/components-core/theming/themes/base-utils.js +31 -0
  351. package/dist/scripts/src/components-core/theming/themes/palette.js +55 -0
  352. package/dist/scripts/src/components-core/theming/themes/root.js +287 -0
  353. package/dist/scripts/src/components-core/theming/themes/solid.js +16 -0
  354. package/dist/scripts/src/components-core/theming/themes/theme-colors.js +561 -0
  355. package/dist/scripts/src/components-core/theming/themes/xmlui.js +58 -0
  356. package/dist/scripts/src/components-core/theming/transformThemeVars.js +300 -0
  357. package/dist/scripts/src/components-core/utils/DataLoaderQueryKeyGenerator.js +35 -0
  358. package/dist/scripts/src/components-core/utils/LruCache.js +184 -0
  359. package/dist/scripts/src/components-core/utils/actionUtils.js +32 -0
  360. package/dist/scripts/src/components-core/utils/classnames.js +58 -0
  361. package/dist/scripts/src/components-core/utils/compound-utils.js +11 -0
  362. package/dist/scripts/src/components-core/utils/css-utils.js +163 -0
  363. package/dist/scripts/src/components-core/utils/date-utils.js +78 -0
  364. package/dist/scripts/src/components-core/utils/extractParam.js +148 -0
  365. package/dist/scripts/src/components-core/utils/hooks.js +249 -0
  366. package/dist/scripts/src/components-core/utils/mergeProps.js +45 -0
  367. package/dist/scripts/src/components-core/utils/misc.js +472 -0
  368. package/dist/scripts/src/components-core/utils/request-params.js +70 -0
  369. package/dist/scripts/src/components-core/utils/statementUtils.js +221 -0
  370. package/dist/scripts/src/components-core/utils/treeUtils.js +48 -0
  371. package/dist/scripts/src/index.js +69 -0
  372. package/dist/scripts/src/parsers/common/GenericToken.js +2 -0
  373. package/dist/scripts/src/parsers/scripting-exp/TokenType.js +112 -0
  374. package/dist/scripts/src/parsers/style-parser/StyleInputStream.js +39 -0
  375. package/dist/scripts/src/parsers/style-parser/StyleLexer.js +623 -0
  376. package/dist/scripts/src/parsers/style-parser/StyleParser.js +1036 -0
  377. package/dist/scripts/src/parsers/style-parser/errors.js +37 -0
  378. package/dist/scripts/src/parsers/style-parser/source-tree.js +2 -0
  379. package/dist/scripts/src/parsers/style-parser/style-compiler.js +558 -0
  380. package/dist/scripts/src/parsers/style-parser/tokens.js +43 -0
  381. package/dist/scripts/src/parsers/xmlui-parser/ParserError.js +7 -0
  382. package/dist/scripts/src/parsers/xmlui-parser/transform.js +80 -32
  383. package/dist/scripts/src/syntax/grammar.tmLanguage.json +328 -0
  384. package/dist/scripts/src/syntax/textMate/xmlui.json +630 -0
  385. package/dist/style.css +1 -1
  386. package/dist/xmlui-metadata.mjs +2669 -2601
  387. package/dist/xmlui-metadata.umd.js +16 -16
  388. package/dist/xmlui-standalone.umd.js +186 -186
  389. package/dist/xmlui.d.ts +1868 -13
  390. package/dist/xmlui.mjs +1 -1
  391. package/package.json +5 -5
  392. package/dist/xmlui.umd.js +0 -293
@@ -0,0 +1,335 @@
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 () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
36
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
37
+ return new (P || (P = Promise))(function (resolve, reject) {
38
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
39
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
40
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
41
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
42
+ });
43
+ };
44
+ Object.defineProperty(exports, "__esModule", { value: true });
45
+ exports.builtInThemes = void 0;
46
+ exports.useCompiledTheme = useCompiledTheme;
47
+ const jsx_runtime_1 = require("react/jsx-runtime");
48
+ const abstractions_1 = require("./abstractions");
49
+ const react_1 = require("react");
50
+ const transformThemeVars_1 = require("./transformThemeVars");
51
+ const misc_1 = require("@components-core/utils/misc");
52
+ const hvar_1 = require("@components-core/theming/hvar");
53
+ const ThemeContext_1 = require("@components-core/theming/ThemeContext");
54
+ const themeVars_1 = __importStar(require("@components-core/theming/themeVars"));
55
+ const constants_1 = require("@components-core/constants");
56
+ const extendThemeUtils_1 = require("@components-core/theming/extendThemeUtils");
57
+ const ComponentRegistryContext_1 = require("@components/ComponentRegistryContext");
58
+ const xmlui_1 = require("@components-core/theming/themes/xmlui");
59
+ const solid_1 = require("@components-core/theming/themes/solid");
60
+ const hooks_1 = require("@components-core/utils/hooks");
61
+ function useCompiledTheme(activeTheme, activeTone, themes = constants_1.EMPTY_ARRAY, resources = constants_1.EMPTY_OBJECT, resourceMap = constants_1.EMPTY_OBJECT) {
62
+ const componentRegistry = (0, ComponentRegistryContext_1.useComponentRegistry)();
63
+ const { componentThemeVars, componentDefaultThemeVars } = componentRegistry;
64
+ const themeDefChain = (0, react_1.useMemo)(() => {
65
+ if (activeTheme) {
66
+ return (0, extendThemeUtils_1.collectThemeChainByExtends)(activeTheme, themes, componentDefaultThemeVars);
67
+ }
68
+ return undefined;
69
+ }, [activeTheme, componentDefaultThemeVars, themes]);
70
+ const allResources = (0, react_1.useMemo)(() => {
71
+ let mergedResources = {};
72
+ themeDefChain === null || themeDefChain === void 0 ? void 0 : themeDefChain.forEach((theme) => {
73
+ var _a, _b;
74
+ mergedResources = Object.assign(Object.assign(Object.assign({}, mergedResources), theme.resources), (_b = (_a = theme.tones) === null || _a === void 0 ? void 0 : _a[activeTone]) === null || _b === void 0 ? void 0 : _b.resources);
75
+ });
76
+ return Object.assign(Object.assign({}, resources), mergedResources);
77
+ }, [themeDefChain, resources, activeTone]);
78
+ const allFonts = (0, react_1.useMemo)(() => {
79
+ const ret = [];
80
+ Object.entries(allResources).forEach(([key, value]) => {
81
+ if (key.startsWith("font.")) {
82
+ ret === null || ret === void 0 ? void 0 : ret.push(value);
83
+ }
84
+ });
85
+ return ret;
86
+ }, [allResources]);
87
+ const getResourceUrl = (0, react_1.useCallback)((resourceString) => {
88
+ let resourceUrl = resourceString;
89
+ if (resourceString === null || resourceString === void 0 ? void 0 : resourceString.startsWith("resource:")) {
90
+ const resourceName = resourceString === null || resourceString === void 0 ? void 0 : resourceString.replace("resource:", "");
91
+ resourceUrl = allResources[resourceName];
92
+ }
93
+ if (!resourceUrl) {
94
+ return resourceUrl;
95
+ }
96
+ if (resourceMap[resourceUrl]) {
97
+ return resourceMap[resourceUrl];
98
+ }
99
+ if (resourceUrl.startsWith("/") &&
100
+ resourceMap[resourceUrl.substring(1)]) {
101
+ return resourceMap[resourceUrl.substring(1)];
102
+ }
103
+ return (0, misc_1.normalizePath)(resourceUrl);
104
+ }, [allResources, resourceMap]);
105
+ const fontLinks = (0, react_1.useMemo)(() => {
106
+ return ((allFonts === null || allFonts === void 0 ? void 0 : allFonts.filter((theme) => typeof theme === "string")) ||
107
+ []);
108
+ }, [allFonts]);
109
+ const themeDefChainVars = (0, react_1.useMemo)(() => {
110
+ var _a, _b, _c;
111
+ if (!(themeDefChain === null || themeDefChain === void 0 ? void 0 : themeDefChain.length)) {
112
+ return [];
113
+ }
114
+ let mergedThemeVars = {};
115
+ themeDefChain === null || themeDefChain === void 0 ? void 0 : themeDefChain.forEach((theme) => {
116
+ var _a, _b, _c;
117
+ mergedThemeVars = Object.assign(Object.assign(Object.assign(Object.assign({}, mergedThemeVars), theme.themeVars), (_a = theme.themeVars) === null || _a === void 0 ? void 0 : _a[activeTone]), (_c = (_b = theme.tones) === null || _b === void 0 ? void 0 : _b[activeTone]) === null || _c === void 0 ? void 0 : _c.themeVars);
118
+ });
119
+ //we put the generated theme vars before the last item in the chain
120
+ return [
121
+ ...themeDefChain
122
+ .map((themeDef) => {
123
+ var _a, _b, _c;
124
+ return (Object.assign(Object.assign(Object.assign({}, themeDef.themeVars), (_a = themeDef.themeVars) === null || _a === void 0 ? void 0 : _a[activeTone]), (_c = (_b = themeDef.tones) === null || _b === void 0 ? void 0 : _b[activeTone]) === null || _c === void 0 ? void 0 : _c.themeVars));
125
+ })
126
+ .slice(0, themeDefChain.length - 1),
127
+ Object.assign(Object.assign(Object.assign(Object.assign({}, (0, transformThemeVars_1.generateBaseSpacings)(mergedThemeVars)), (0, transformThemeVars_1.generateBaseFontSizes)(mergedThemeVars)), (0, transformThemeVars_1.generateBaseTones)(mergedThemeVars)), (0, transformThemeVars_1.generateButtonTones)(mergedThemeVars)),
128
+ Object.assign({}, (0, extendThemeUtils_1.expandTheme)(Object.assign(Object.assign(Object.assign({}, themeDefChain[themeDefChain.length - 1].themeVars), (_a = themeDefChain[themeDefChain.length - 1].themeVars) === null || _a === void 0 ? void 0 : _a[activeTone]), (_c = (_b = themeDefChain[themeDefChain.length - 1].tones) === null || _b === void 0 ? void 0 : _b[activeTone]) === null || _c === void 0 ? void 0 : _c.themeVars))),
129
+ ];
130
+ }, [activeTone, themeDefChain]);
131
+ const allThemeVarsWithResolvedHierarchicalVars = (0, react_1.useMemo)(() => {
132
+ let mergedThemeVars = {};
133
+ themeDefChainVars === null || themeDefChainVars === void 0 ? void 0 : themeDefChainVars.forEach((theme) => {
134
+ mergedThemeVars = Object.assign(Object.assign({}, mergedThemeVars), theme);
135
+ });
136
+ const resolvedThemeVarsFromChains = {};
137
+ new Set([
138
+ ...Object.keys(themeVars_1.default.themeVars),
139
+ ...componentThemeVars,
140
+ ]).forEach((themeVar) => {
141
+ const result = (0, hvar_1.matchThemeVar)(themeVar, themeDefChainVars);
142
+ if (result &&
143
+ result.forValue &&
144
+ result.matchedValue &&
145
+ result.forValue !== result.matchedValue) {
146
+ resolvedThemeVarsFromChains[result.forValue] = `$${result.matchedValue}`;
147
+ }
148
+ });
149
+ return resolveThemeVarsWithCssVars(Object.assign(Object.assign({}, mergedThemeVars), resolvedThemeVarsFromChains));
150
+ }, [componentThemeVars, themeDefChainVars]);
151
+ const themeCssVars = (0, react_1.useMemo)(() => {
152
+ const ret = {};
153
+ Object.entries(allThemeVarsWithResolvedHierarchicalVars).forEach(([key, value]) => {
154
+ const themeKey = `--${themeVars_1.default.keyPrefix}-${key}`;
155
+ if (value) {
156
+ ret[themeKey] = value;
157
+ }
158
+ });
159
+ return ret;
160
+ }, [allThemeVarsWithResolvedHierarchicalVars]);
161
+ const getThemeVar = (0, react_1.useCallback)((varName) => {
162
+ return (0, transformThemeVars_1.resolveThemeVar)(varName, allThemeVarsWithResolvedHierarchicalVars);
163
+ }, [allThemeVarsWithResolvedHierarchicalVars]);
164
+ (0, react_1.useEffect)(() => {
165
+ allFonts.forEach((font) => __awaiter(this, void 0, void 0, function* () {
166
+ if (typeof font !== "string") {
167
+ const resolvedSrc = getResourceUrl(font.src);
168
+ let src = `url(${resolvedSrc})`;
169
+ if (font.format) {
170
+ src = `${src} format('${font.format}')`;
171
+ }
172
+ const ff = new FontFace(font.fontFamily, src, {
173
+ weight: font.fontWeight,
174
+ style: font.fontStyle,
175
+ display: font.fontDisplay,
176
+ });
177
+ try {
178
+ const loadedFontFace = yield ff.load();
179
+ document.fonts.add(loadedFontFace);
180
+ }
181
+ catch (e) {
182
+ console.error("loading fonts failed", e);
183
+ }
184
+ }
185
+ }));
186
+ }, [themeDefChain, getResourceUrl, allFonts]);
187
+ return {
188
+ getResourceUrl,
189
+ fontLinks,
190
+ allThemeVarsWithResolvedHierarchicalVars,
191
+ themeCssVars,
192
+ getThemeVar,
193
+ };
194
+ }
195
+ exports.builtInThemes = [
196
+ xmlui_1.XmlUiThemeDefinition,
197
+ xmlui_1.XmlUiGreenThemeDefinition,
198
+ xmlui_1.XmlUiGrayThemeDefinition,
199
+ xmlui_1.XmlUiOrangeThemeDefinition,
200
+ xmlui_1.XmlUiPurpleThemeDefinition,
201
+ xmlui_1.XmlUiCyanThemeDefinition,
202
+ xmlui_1.XmlUiRedThemeDefinition,
203
+ solid_1.SolidThemeDefinition,
204
+ ];
205
+ // theme-overriding properties change.
206
+ function ThemeProvider({ children, themes: custThemes = constants_1.EMPTY_ARRAY, defaultTheme = "xmlui", defaultTone = "light", resources = constants_1.EMPTY_OBJECT, resourceMap = constants_1.EMPTY_OBJECT, }) {
207
+ const [activeThemeTone, setActiveThemeTone] = (0, react_1.useState)(() => {
208
+ if (!defaultTone) {
209
+ return abstractions_1.ThemeToneKeys[0];
210
+ }
211
+ return defaultTone;
212
+ });
213
+ const themes = (0, react_1.useMemo)(() => {
214
+ return [...custThemes, ...exports.builtInThemes];
215
+ }, [custThemes]);
216
+ const availableThemeIds = (0, react_1.useMemo)(() => {
217
+ return [...new Set(themes.map((theme) => theme.id))];
218
+ }, [themes]);
219
+ const [activeThemeId, setActiveThemeId] = (0, react_1.useState)(() => {
220
+ if (!defaultTheme) {
221
+ return availableThemeIds[0];
222
+ }
223
+ return defaultTheme;
224
+ });
225
+ (0, hooks_1.useIsomorphicLayoutEffect)(() => {
226
+ //we sync the activeThemeId with the default theme (mostly for HMR)
227
+ if (defaultTheme && availableThemeIds.includes(defaultTheme)) {
228
+ setActiveThemeId(defaultTheme);
229
+ }
230
+ else {
231
+ setActiveThemeId(availableThemeIds[0]);
232
+ }
233
+ }, [availableThemeIds, defaultTheme]);
234
+ const activeTheme = (0, react_1.useMemo)(() => {
235
+ let foundTheme;
236
+ if (activeThemeId) {
237
+ foundTheme = themes.find((theme) => theme.id === activeThemeId);
238
+ }
239
+ if (!foundTheme) {
240
+ throw new Error(`Theme ${activeThemeId} not found, available themes: ${availableThemeIds}`);
241
+ }
242
+ return foundTheme;
243
+ }, [activeThemeId, availableThemeIds, themes]);
244
+ const { allThemeVarsWithResolvedHierarchicalVars, themeCssVars, getResourceUrl, getThemeVar, } = useCompiledTheme(activeTheme, activeThemeTone, themes, resources, resourceMap);
245
+ const [root, setRoot] = (0, react_1.useState)(typeof document === "undefined" ? undefined : document.body);
246
+ const themeValue = (0, react_1.useMemo)(() => {
247
+ const themeVal = {
248
+ root,
249
+ setRoot,
250
+ themes,
251
+ resources,
252
+ resourceMap,
253
+ activeThemeId,
254
+ activeThemeTone,
255
+ setActiveThemeId,
256
+ setActiveThemeTone,
257
+ availableThemeIds,
258
+ activeTheme,
259
+ toggleThemeTone: () => setActiveThemeTone(activeThemeTone === "light" ? "dark" : "light")
260
+ };
261
+ return themeVal;
262
+ }, [
263
+ activeTheme,
264
+ activeThemeId,
265
+ activeThemeTone,
266
+ availableThemeIds,
267
+ resourceMap,
268
+ resources,
269
+ root,
270
+ themes,
271
+ ]);
272
+ const currentThemeContextValue = (0, react_1.useMemo)(() => {
273
+ const themeVal = {
274
+ root,
275
+ activeThemeId,
276
+ activeThemeTone: activeThemeTone,
277
+ activeTheme,
278
+ themeStyles: themeCssVars,
279
+ themeVars: allThemeVarsWithResolvedHierarchicalVars,
280
+ getResourceUrl,
281
+ getThemeVar,
282
+ };
283
+ return themeVal;
284
+ }, [
285
+ activeTheme,
286
+ activeThemeId,
287
+ activeThemeTone,
288
+ allThemeVarsWithResolvedHierarchicalVars,
289
+ getResourceUrl,
290
+ getThemeVar,
291
+ root,
292
+ themeCssVars,
293
+ ]);
294
+ return ((0, jsx_runtime_1.jsx)(ThemeContext_1.ThemesContext.Provider, { value: themeValue, children: (0, jsx_runtime_1.jsx)(ThemeContext_1.ThemeContext.Provider, { value: currentThemeContextValue, children: children }) }));
295
+ }
296
+ function resolveThemeVarsWithCssVars(theme) {
297
+ if (!theme) {
298
+ return {};
299
+ }
300
+ const ret = {};
301
+ Object.keys(theme).forEach((key) => {
302
+ ret[key] = resolveThemeVarToCssVars(key, theme);
303
+ });
304
+ return ret;
305
+ function resolveThemeVarToCssVars(varName, theme) {
306
+ const value = theme[varName];
307
+ if (typeof value === "string" && value.includes("$")) {
308
+ return replaceThemeVar(value);
309
+ }
310
+ return value;
311
+ }
312
+ function replaceThemeVar(input) {
313
+ const regex = /\$([a-zA-Z0-9_-]+)/gi;
314
+ const matches = input.matchAll(regex);
315
+ //we go from 1, because result[1] is the whole stuff
316
+ if (matches) {
317
+ let ret = input;
318
+ for (const match of matches) {
319
+ const varName = match[1];
320
+ if (varName) {
321
+ ret = ret.replace(match[0], `var(${(0, themeVars_1.getVarKey)(varName)})`);
322
+ }
323
+ }
324
+ return ret;
325
+ }
326
+ // for (let i = 1; i < (result?.length || 0); i++) {
327
+ // const varName = result?.[i];
328
+ // if(varName){
329
+ // return input.replace(regex, `var(${getVarKey(varName)})`);
330
+ // }
331
+ // }
332
+ return input;
333
+ }
334
+ }
335
+ exports.default = ThemeProvider;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.INITIAL_THEME_TONE = exports.ThemeToneKeys = void 0;
4
+ /**
5
+ * Each theme can have a light or a dark tone.
6
+ */
7
+ exports.ThemeToneKeys = ["light", "dark"];
8
+ /**
9
+ * Initial theme tone value. Easier to modify if needed
10
+ */
11
+ exports.INITIAL_THEME_TONE = "light";
@@ -0,0 +1,114 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.collectThemeChainByExtends = collectThemeChainByExtends;
4
+ exports.expandTheme = expandTheme;
5
+ const lodash_es_1 = require("lodash-es");
6
+ const root_1 = require("@components-core/theming/themes/root");
7
+ function collectExtends(cTheme, allThemes) {
8
+ if (!cTheme) {
9
+ return [];
10
+ }
11
+ if (!cTheme.extends) {
12
+ return [];
13
+ }
14
+ const arrayExtends = typeof cTheme.extends === "string" ? [cTheme.extends] : cTheme.extends;
15
+ const ret = [];
16
+ arrayExtends.forEach((ext) => {
17
+ const parentTheme = allThemes.find((theme) => theme.id === ext);
18
+ if (parentTheme) {
19
+ ret.push(...collectExtends(parentTheme, allThemes));
20
+ ret.push(parentTheme);
21
+ }
22
+ });
23
+ return ret;
24
+ }
25
+ function collectThemeChainByExtends(customTheme, allThemes, componentDefaultThemeVars) {
26
+ const rootThemeVars = (0, lodash_es_1.cloneDeep)(root_1.RootThemeDefinition.themeVars) || {};
27
+ const rootTones = (0, lodash_es_1.cloneDeep)(root_1.RootThemeDefinition.tones) || {};
28
+ Object.entries(componentDefaultThemeVars).forEach(([key, value]) => {
29
+ if (typeof value === "string") {
30
+ rootThemeVars[key] = value;
31
+ }
32
+ else {
33
+ Object.entries(value).forEach(([themeVarKey, themeVarVal]) => {
34
+ if (!rootTones[key]) {
35
+ rootTones[key] = { themeVars: {} };
36
+ }
37
+ rootTones[key].themeVars = Object.assign(Object.assign({}, rootTones[key].themeVars), { [themeVarKey]: themeVarVal });
38
+ });
39
+ }
40
+ });
41
+ const root = {
42
+ id: "root",
43
+ themeVars: rootThemeVars,
44
+ resources: {},
45
+ tones: rootTones,
46
+ };
47
+ return [root, ...collectExtends(customTheme, allThemes), customTheme];
48
+ }
49
+ // --- Extends an existing theme with expanding theme variables
50
+ function expandTheme(newTheme) {
51
+ const result = {};
52
+ if (!newTheme) {
53
+ return result;
54
+ }
55
+ // --- Iterate through new theme variables
56
+ Object.keys(newTheme).forEach((key) => {
57
+ // --- Set the theme variable
58
+ result[key] = newTheme[key];
59
+ // --- Check for variables to extend
60
+ Object.keys(themeVariableExpansion).forEach((keyToCheck) => {
61
+ if (!key.startsWith(keyToCheck + "-"))
62
+ return;
63
+ // --- Candidate for extension
64
+ const varPart = key.substring(keyToCheck.length);
65
+ const keysToExtend = themeVariableExpansion[keyToCheck];
66
+ if (keysToExtend.some((kte) => key.startsWith(kte + "-")))
67
+ return;
68
+ keysToExtend.forEach((keyToExtend) => {
69
+ const fullKey = keyToExtend + varPart;
70
+ result[fullKey] = newTheme[key];
71
+ });
72
+ });
73
+ });
74
+ // --- Done.
75
+ return Object.assign(Object.assign({}, result), newTheme);
76
+ }
77
+ const themeVariableExpansion = {
78
+ padding: ["padding-horizontal", "padding-vertical", "padding-top", "padding-right", "padding-bottom", "padding-left"],
79
+ "padding-horizontal": ["padding-left", "padding-right"],
80
+ "padding-vertical": ["padding-top", "padding-bottom"],
81
+ border: ["border-horizontal", "border-vertical", "border-top", "border-right", "border-bottom", "border-left"],
82
+ "border-horizontal": ["border-left", "border-right"],
83
+ "border-vertical": ["border-top", "border-bottom"],
84
+ "color-border": [
85
+ "color-border-horizontal",
86
+ "color-border-vertical",
87
+ "color-border-top",
88
+ "color-border-right",
89
+ "color-border-bottom",
90
+ "color-border-left",
91
+ ],
92
+ "color-border-horizontal": ["color-border-left", "color-border-right"],
93
+ "color-border-vertical": ["color-border-top", "color-border-bottom"],
94
+ "thickness-border": [
95
+ "thickness-border-horizontal",
96
+ "thickness-border-vertical",
97
+ "thickness-border-top",
98
+ "thickness-border-right",
99
+ "thickness-border-bottom",
100
+ "thickness-border-left",
101
+ ],
102
+ "thickness-border-horizontal": ["thickness-border-left", "thickness-border-right"],
103
+ "thickness-border-vertical": ["thickness-border-top", "thickness-border-bottom"],
104
+ "style-border": [
105
+ "style-border-horizontal",
106
+ "style-border-vertical",
107
+ "style-border-top",
108
+ "style-border-right",
109
+ "style-border-bottom",
110
+ "style-border-left",
111
+ ],
112
+ "style-border-horizontal": ["style-border-left", "style-border-right"],
113
+ "style-border-vertical": ["style-border-top", "style-border-bottom"],
114
+ };
@@ -0,0 +1,105 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseHVar = parseHVar;
4
+ exports.matchThemeVar = matchThemeVar;
5
+ const parsedHVarCache = {};
6
+ //extremely dummy solution, will come back later
7
+ function parseHVar(input) {
8
+ if (parsedHVarCache[input] !== undefined) {
9
+ return parsedHVarCache[input];
10
+ }
11
+ // Split the input string into parts using regex
12
+ const parts = input.split(/-[A-Z]+/);
13
+ if (parts.length !== 2) {
14
+ parsedHVarCache[input] = null;
15
+ return parsedHVarCache[input];
16
+ }
17
+ const firstPart = parts[0];
18
+ const classessParts = firstPart.split(":");
19
+ const attribute = classessParts[classessParts.length - 1];
20
+ const classes = classessParts.length > 1 ? classessParts.slice(0, classessParts.length - 1) : [];
21
+ const secondPart = input.substring(firstPart.length + 1);
22
+ const [compName, ...rest] = secondPart.split("-");
23
+ const traitsAndStates = secondPart.substring(compName.length).split("--");
24
+ const states = [];
25
+ const traits = [];
26
+ traitsAndStates.forEach((part) => {
27
+ if (!part.includes("-") && part) {
28
+ states.push(part);
29
+ }
30
+ else {
31
+ part.split("-").forEach((trait) => {
32
+ if (trait) {
33
+ traits.push(trait);
34
+ }
35
+ });
36
+ }
37
+ });
38
+ parsedHVarCache[input] = {
39
+ classes: classes,
40
+ attribute: attribute,
41
+ component: compName,
42
+ traits: traits,
43
+ states: states,
44
+ };
45
+ return parsedHVarCache[input];
46
+ }
47
+ function createCombinations(arr = []) {
48
+ const stateCombinations = [];
49
+ for (let i = 1; i <= arr.length; i++) {
50
+ for (let j = 0; j <= arr.length - i; j++) {
51
+ stateCombinations.push(arr.slice(j, j + i));
52
+ }
53
+ }
54
+ return stateCombinations.sort((a, b) => b.length - a.length);
55
+ }
56
+ function matchThemeVar(themeVar, availableThemeVars = []) {
57
+ const hvar = parseHVar(themeVar);
58
+ if (!hvar) {
59
+ return;
60
+ }
61
+ const stateCombinations = createCombinations(hvar.states);
62
+ const traitCombinations = createCombinations(hvar.traits);
63
+ const sortedTraitCombinations = [];
64
+ traitCombinations.forEach((traitComb) => {
65
+ let result = "";
66
+ traitComb.forEach((t) => {
67
+ result = `${result}-${t}`;
68
+ });
69
+ sortedTraitCombinations.push(result);
70
+ });
71
+ sortedTraitCombinations.push("");
72
+ const sortedStateCombinations = [];
73
+ stateCombinations.forEach((stateComb) => {
74
+ let result = "";
75
+ stateComb.forEach((s) => {
76
+ result = `${result}--${s}`;
77
+ });
78
+ sortedStateCombinations.push(result);
79
+ });
80
+ sortedStateCombinations.push("");
81
+ const componentParts = [hvar.component, ...hvar.classes];
82
+ const from = [];
83
+ sortedStateCombinations.forEach((stateComb) => {
84
+ sortedTraitCombinations.forEach((traitComb) => {
85
+ componentParts.forEach((componentPart) => {
86
+ from.push(`${hvar.attribute}-${componentPart}${traitComb}${stateComb}`);
87
+ });
88
+ });
89
+ });
90
+ let matchedValue;
91
+ for (let i = availableThemeVars.length - 1; i >= 0; i--) {
92
+ const themeVars = availableThemeVars[i];
93
+ let foundValue = from.find((themeVar) => themeVars[themeVar] !== undefined);
94
+ if (foundValue) {
95
+ matchedValue = foundValue;
96
+ break;
97
+ }
98
+ }
99
+ const forValue = from[0];
100
+ return {
101
+ forValue: forValue,
102
+ matchedValue: matchedValue,
103
+ from: from,
104
+ };
105
+ }
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.parseScssVar = parseScssVar;
7
+ exports.getVarKey = getVarKey;
8
+ /**
9
+ * The sole purpose of this module is to provide an object with the available keys of theme SCSS variables and the
10
+ * prefix of the theme.
11
+ */
12
+ const themeVars_module_scss_1 = __importDefault(require("./themeVars.module.scss"));
13
+ /**
14
+ * This function extracts CSS variables from the specified SCSS input. It uses a hack to convert the CSS input to JSON
15
+ * and then calls a JSON parser to create the desired object.
16
+ * @param scssStr The scss input
17
+ */
18
+ function parseScssVar(scssStr) {
19
+ if (!scssStr || typeof scssStr !== typeof "") {
20
+ return scssStr;
21
+ }
22
+ // Lists and maps are surrounded by single quotes, e.g. "'[ \"string in list\", 5, \"5px\" ]'"
23
+ // Remove them if they exist so they can be parsed correctly.
24
+ let jsValue = scssStr.replace(/(^['"])|(['"]$)/g, "");
25
+ try {
26
+ // JSON-formatted string from within SCSS file
27
+ return JSON.parse(jsValue);
28
+ }
29
+ catch (errorParsingJsonGeneratedInUtilScssFile) {
30
+ try {
31
+ // Value was likely an SCSS literal string; attempt parsing it manually.
32
+ // Example: inspect($my-map) => '(num: 10, numWithUnits: 5px, str: hello, color: #fff, "keyAsStr": false, other: null)'
33
+ return JSON.parse(scssStr
34
+ .replace("(", "{")
35
+ .replace(")", "}")
36
+ // JSON values: convert any collection of word characters followed by a comma or bracket to a string
37
+ .replace(/: ?([^,}]+)([,}])/g, ': "$1"$2')
38
+ // JSON keys: space/bracket/comma as first character, not already a string, anything not colon or
39
+ // space (rules out JSON values), ended by colon
40
+ .replace(/([\s{,])(?!")([^:\s]+)+:/g, '$1"$2":'));
41
+ }
42
+ catch (errorParsingScssStringLiteral) {
43
+ return jsValue;
44
+ }
45
+ }
46
+ }
47
+ let keyPrefix = parseScssVar(themeVars_module_scss_1.default.keyPrefix) || "";
48
+ let vars = parseScssVar(themeVars_module_scss_1.default.themeVars);
49
+ /**
50
+ * Export the desired SCSS variables and prefix
51
+ */
52
+ const theme = {
53
+ keyPrefix: keyPrefix,
54
+ themeVars: vars,
55
+ };
56
+ function getVarKey(varName) {
57
+ if (keyPrefix) {
58
+ return `--${keyPrefix}-${varName}`;
59
+ }
60
+ return `--${varName}`;
61
+ }
62
+ exports.default = theme;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.paddingSubject = paddingSubject;
4
+ exports.borderSubject = borderSubject;
5
+ function paddingSubject(name, valueSpec) {
6
+ var _a, _b, _c, _d, _e, _f, _g;
7
+ return {
8
+ [`padding-left-${name}`]: (_a = valueSpec === null || valueSpec === void 0 ? void 0 : valueSpec.left) !== null && _a !== void 0 ? _a : `$padding-horizontal-${name}`,
9
+ [`padding-right-${name}`]: (_b = valueSpec === null || valueSpec === void 0 ? void 0 : valueSpec.right) !== null && _b !== void 0 ? _b : `$padding-horizontal-${name}`,
10
+ [`padding-top-${name}`]: (_c = valueSpec === null || valueSpec === void 0 ? void 0 : valueSpec.top) !== null && _c !== void 0 ? _c : `$padding-vertical-${name}`,
11
+ [`padding-bottom-${name}`]: (_d = valueSpec === null || valueSpec === void 0 ? void 0 : valueSpec.bottom) !== null && _d !== void 0 ? _d : `$padding-vertical-${name}`,
12
+ [`padding-horizontal-${name}`]: (_e = valueSpec === null || valueSpec === void 0 ? void 0 : valueSpec.horizontal) !== null && _e !== void 0 ? _e : "",
13
+ [`padding-vertical-${name}`]: (_f = valueSpec === null || valueSpec === void 0 ? void 0 : valueSpec.vertical) !== null && _f !== void 0 ? _f : "",
14
+ [`padding-${name}`]: (_g = valueSpec === null || valueSpec === void 0 ? void 0 : valueSpec.all) !== null && _g !== void 0 ? _g : `$padding-top-${name} $padding-right-${name} $padding-bottom-${name} $padding-left-${name}`,
15
+ };
16
+ }
17
+ function borderSubject(name, valueSpec) {
18
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
19
+ return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ [`radius-${name}`]: "$radius" }, borderEdgeSubject("left", (_b = (_a = valueSpec === null || valueSpec === void 0 ? void 0 : valueSpec.left) !== null && _a !== void 0 ? _a : valueSpec === null || valueSpec === void 0 ? void 0 : valueSpec.horizontal) !== null && _b !== void 0 ? _b : valueSpec === null || valueSpec === void 0 ? void 0 : valueSpec.all)), borderEdgeSubject("right", (_d = (_c = valueSpec === null || valueSpec === void 0 ? void 0 : valueSpec.right) !== null && _c !== void 0 ? _c : valueSpec === null || valueSpec === void 0 ? void 0 : valueSpec.horizontal) !== null && _d !== void 0 ? _d : valueSpec === null || valueSpec === void 0 ? void 0 : valueSpec.all)), borderEdgeSubject("top", (_f = (_e = valueSpec === null || valueSpec === void 0 ? void 0 : valueSpec.top) !== null && _e !== void 0 ? _e : valueSpec === null || valueSpec === void 0 ? void 0 : valueSpec.vertical) !== null && _f !== void 0 ? _f : valueSpec === null || valueSpec === void 0 ? void 0 : valueSpec.all)), borderEdgeSubject("bottom", (_h = (_g = valueSpec === null || valueSpec === void 0 ? void 0 : valueSpec.bottom) !== null && _g !== void 0 ? _g : valueSpec === null || valueSpec === void 0 ? void 0 : valueSpec.vertical) !== null && _h !== void 0 ? _h : valueSpec === null || valueSpec === void 0 ? void 0 : valueSpec.all)), borderEdgeSubject("horizontal", (_j = valueSpec === null || valueSpec === void 0 ? void 0 : valueSpec.horizontal) !== null && _j !== void 0 ? _j : valueSpec === null || valueSpec === void 0 ? void 0 : valueSpec.all)), borderEdgeSubject("vertical", (_k = valueSpec === null || valueSpec === void 0 ? void 0 : valueSpec.vertical) !== null && _k !== void 0 ? _k : valueSpec === null || valueSpec === void 0 ? void 0 : valueSpec.all)), { [`color-border-${name}`]: (_m = (_l = valueSpec === null || valueSpec === void 0 ? void 0 : valueSpec.all) === null || _l === void 0 ? void 0 : _l.color) !== null && _m !== void 0 ? _m : "", [`thickness-border-${name}`]: (_p = (_o = valueSpec === null || valueSpec === void 0 ? void 0 : valueSpec.all) === null || _o === void 0 ? void 0 : _o.thickness) !== null && _p !== void 0 ? _p : "", [`style-border-${name}`]: (_r = (_q = valueSpec === null || valueSpec === void 0 ? void 0 : valueSpec.all) === null || _q === void 0 ? void 0 : _q.style) !== null && _r !== void 0 ? _r : "", [`border-${name}`]: `${(_t = (_s = valueSpec === null || valueSpec === void 0 ? void 0 : valueSpec.all) === null || _s === void 0 ? void 0 : _s.thickness) !== null && _t !== void 0 ? _t : `$thickness-border-${name}`} ` +
20
+ `${(_v = (_u = valueSpec === null || valueSpec === void 0 ? void 0 : valueSpec.all) === null || _u === void 0 ? void 0 : _u.style) !== null && _v !== void 0 ? _v : `$style-border-${name}`} ` +
21
+ `${(_x = (_w = valueSpec === null || valueSpec === void 0 ? void 0 : valueSpec.all) === null || _w === void 0 ? void 0 : _w.color) !== null && _x !== void 0 ? _x : `$color-border-${name}`} ` });
22
+ function borderEdgeSubject(edge, edgeSpec) {
23
+ var _a, _b, _c, _d;
24
+ return {
25
+ [`color-border-${edge}-${name}`]: (_a = edgeSpec === null || edgeSpec === void 0 ? void 0 : edgeSpec.color) !== null && _a !== void 0 ? _a : "",
26
+ [`thickness-border-${edge}-${name}`]: (_b = edgeSpec === null || edgeSpec === void 0 ? void 0 : edgeSpec.thickness) !== null && _b !== void 0 ? _b : "",
27
+ [`style-border-${edge}-${name}`]: (_c = edgeSpec === null || edgeSpec === void 0 ? void 0 : edgeSpec.style) !== null && _c !== void 0 ? _c : "",
28
+ [`border-${edge}-${name}`]: (_d = edgeSpec === null || edgeSpec === void 0 ? void 0 : edgeSpec.all) !== null && _d !== void 0 ? _d : `$thickness-border-${edge}-${name} $style-border-${edge}-${name} $color-border-${edge}-${name}`,
29
+ };
30
+ }
31
+ }