xmlui 0.7.13 → 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.
- package/dist/{apiInterceptorWorker-BuZoKCP8.mjs → apiInterceptorWorker-yKpXImCG.mjs} +1 -1
- package/dist/{index-C8kHu1Bs.mjs → index-XNGGyvQ0.mjs} +9904 -9653
- package/dist/index.css +1 -1
- package/dist/scripts/bin/build.js +17 -7
- package/dist/scripts/bin/vite-ueml-plugin.js +17 -7
- package/dist/scripts/bin/viteConfig.js +17 -7
- package/dist/scripts/package.json +209 -0
- package/dist/scripts/src/abstractions/scripting/ScriptingSourceTreeExp.js +51 -0
- package/dist/scripts/src/components/APICall/APICall.js +74 -0
- package/dist/scripts/src/components/APICall/APICallNative.js +31 -0
- package/dist/scripts/src/components/Accordion/Accordion.js +78 -0
- package/dist/scripts/src/components/Accordion/AccordionContext.js +20 -0
- package/dist/scripts/src/components/Accordion/AccordionItem.js +28 -0
- package/dist/scripts/src/components/Accordion/AccordionItemNative.js +79 -0
- package/dist/scripts/src/components/Accordion/AccordionNative.js +122 -0
- package/dist/scripts/src/components/Alert/Alert.js +42 -0
- package/dist/scripts/src/components/Alert/AlertNative.js +8 -0
- package/dist/scripts/src/components/Animation/Animation.js +59 -0
- package/dist/scripts/src/components/Animation/AnimationNative.js +75 -0
- package/dist/scripts/src/components/App/App.js +76 -0
- package/dist/scripts/src/components/App/AppLayoutContext.js +49 -0
- package/dist/scripts/src/components/App/AppNative.js +204 -0
- package/dist/scripts/src/components/App/AppStateContext.js +9 -0
- package/dist/scripts/src/components/App/Sheet.js +99 -0
- package/dist/scripts/src/components/AppHeader/AppHeader.js +59 -0
- package/dist/scripts/src/components/AppHeader/AppHeaderNative.js +58 -0
- package/dist/scripts/src/components/AppState/AppState.js +26 -0
- package/dist/scripts/src/components/AppState/AppStateNative.js +24 -0
- package/dist/scripts/src/components/AutoComplete/AutoComplete.js +83 -0
- package/dist/scripts/src/components/AutoComplete/AutoCompleteContext.js +16 -0
- package/dist/scripts/src/components/AutoComplete/AutoCompleteNative.js +225 -0
- package/dist/scripts/src/components/Avatar/Avatar.js +47 -0
- package/dist/scripts/src/components/Avatar/AvatarNative.js +40 -0
- package/dist/scripts/src/components/Backdrop/Backdrop.js +31 -0
- package/dist/scripts/src/components/Backdrop/BackdropNative.js +14 -0
- package/dist/scripts/src/components/Badge/Badge.js +58 -0
- package/dist/scripts/src/components/Badge/BadgeNative.js +22 -0
- package/dist/scripts/src/components/BarChart/BarChart.js +49 -0
- package/dist/scripts/src/components/BarChart/BarChartNative.js +176 -0
- package/dist/scripts/src/components/Bookmark/Bookmark.js +23 -0
- package/dist/scripts/src/components/Bookmark/BookmarkNative.js +24 -0
- package/dist/scripts/src/components/Breakout/Breakout.js +16 -0
- package/dist/scripts/src/components/Breakout/BreakoutNative.js +12 -0
- package/dist/scripts/src/components/Button/Button.js +142 -0
- package/dist/scripts/src/components/Button/ButtonNative.js +88 -0
- package/dist/scripts/src/components/ButtonGroup/ButtonGroup.js +41 -0
- package/dist/scripts/src/components/ButtonGroup/ButtonGroupNative.js +8 -0
- package/dist/scripts/src/components/Card/Card.js +57 -0
- package/dist/scripts/src/components/Card/CardNative.js +26 -0
- package/dist/scripts/src/components/Carousel/Carousel.js +68 -0
- package/dist/scripts/src/components/Carousel/CarouselItem.js +16 -0
- package/dist/scripts/src/components/Carousel/CarouselItemNative.js +13 -0
- package/dist/scripts/src/components/Carousel/CarouselNative.js +163 -0
- package/dist/scripts/src/components/ChangeListener/ChangeListener.js +24 -0
- package/dist/scripts/src/components/ChangeListener/ChangeListenerNative.js +26 -0
- package/dist/scripts/src/components/Chart/Chart.js +24 -0
- package/dist/scripts/src/components/Chart/ChartNative.js +165 -0
- package/dist/scripts/src/components/Checkbox/Checkbox.js +68 -0
- package/dist/scripts/src/components/Column/Column.js +34 -0
- package/dist/scripts/src/components/Column/ColumnNative.js +38 -0
- package/dist/scripts/src/components/Column/TableContext.js +12 -0
- package/dist/scripts/src/components/ComponentProvider.js +503 -0
- package/dist/scripts/src/components/ComponentRegistryContext.js +44 -0
- package/dist/scripts/src/components/ContentSeparator/ContentSeparator.js +38 -0
- package/dist/scripts/src/components/ContentSeparator/ContentSeparatorNative.js +16 -0
- package/dist/scripts/src/components/DatePicker/DatePicker.js +62 -0
- package/dist/scripts/src/components/DatePicker/DatePickerNative.js +196 -0
- package/dist/scripts/src/components/DropdownMenu/DropdownMenu.js +125 -0
- package/dist/scripts/src/components/DropdownMenu/DropdownMenuNative.js +95 -0
- package/dist/scripts/src/components/EmojiSelector/EmojiSelector.js +26 -0
- package/dist/scripts/src/components/EmojiSelector/EmojiSelectorNative.js +52 -0
- package/dist/scripts/src/components/FileInput/FileInput.js +64 -0
- package/dist/scripts/src/components/FileInput/FileInputNative.js +128 -0
- package/dist/scripts/src/components/FileUploadDropZone/FileUploadDropZone.js +46 -0
- package/dist/scripts/src/components/FileUploadDropZone/FileUploadDropZoneNative.js +112 -0
- package/dist/scripts/src/components/FlowLayout/FlowLayout.js +53 -0
- package/dist/scripts/src/components/FlowLayout/FlowLayoutNative.js +108 -0
- package/dist/scripts/src/components/Footer/Footer.js +35 -0
- package/dist/scripts/src/components/Footer/FooterNative.js +20 -0
- package/dist/scripts/src/components/Form/Form.js +89 -0
- package/dist/scripts/src/components/Form/FormContext.js +9 -0
- package/dist/scripts/src/components/Form/FormNative.js +317 -0
- package/dist/scripts/src/components/Form/formActions.js +114 -0
- package/dist/scripts/src/components/FormItem/FormItem.js +125 -0
- package/dist/scripts/src/components/FormItem/FormItemNative.js +157 -0
- package/dist/scripts/src/components/FormItem/HelperText.js +27 -0
- package/dist/scripts/src/components/FormItem/ItemWithLabel.js +40 -0
- package/dist/scripts/src/components/FormItem/Validations.js +351 -0
- package/dist/scripts/src/components/FormSection/FormSection.js +41 -0
- package/dist/scripts/src/components/Heading/Heading.js +258 -0
- package/dist/scripts/src/components/Heading/HeadingNative.js +45 -0
- package/dist/scripts/src/components/HoverCard/HoverCard.js +19 -0
- package/dist/scripts/src/components/HoverCard/HovercardNative.js +44 -0
- package/dist/scripts/src/components/Icon/ApiIcon.js +10 -0
- package/dist/scripts/src/components/Icon/Attach.js +10 -0
- package/dist/scripts/src/components/Icon/Binding.js +11 -0
- package/dist/scripts/src/components/Icon/BoardIcon.js +7 -0
- package/dist/scripts/src/components/Icon/BoxIcon.js +10 -0
- package/dist/scripts/src/components/Icon/CheckIcon.js +7 -0
- package/dist/scripts/src/components/Icon/ChevronLeft.js +7 -0
- package/dist/scripts/src/components/Icon/ChevronRight.js +7 -0
- package/dist/scripts/src/components/Icon/CodeFileIcon.js +10 -0
- package/dist/scripts/src/components/Icon/CodeSandbox.js +10 -0
- package/dist/scripts/src/components/Icon/CompactListIcon.js +7 -0
- package/dist/scripts/src/components/Icon/ContentCopyIcon.js +7 -0
- package/dist/scripts/src/components/Icon/DatabaseIcon.js +11 -0
- package/dist/scripts/src/components/Icon/DocFileIcon.js +10 -0
- package/dist/scripts/src/components/Icon/DocIcon.js +10 -0
- package/dist/scripts/src/components/Icon/DotMenuHorizontalIcon.js +7 -0
- package/dist/scripts/src/components/Icon/DotMenuIcon.js +7 -0
- package/dist/scripts/src/components/Icon/EmailIcon.js +7 -0
- package/dist/scripts/src/components/Icon/EmptyFolderIcon.js +10 -0
- package/dist/scripts/src/components/Icon/ErrorIcon.js +7 -0
- package/dist/scripts/src/components/Icon/ExpressionIcon.js +10 -0
- package/dist/scripts/src/components/Icon/FillPlusCricleIcon.js +7 -0
- package/dist/scripts/src/components/Icon/FilterIcon.js +10 -0
- package/dist/scripts/src/components/Icon/FolderIcon.js +10 -0
- package/dist/scripts/src/components/Icon/GlobeIcon.js +7 -0
- package/dist/scripts/src/components/Icon/HomeIcon.js +7 -0
- package/dist/scripts/src/components/Icon/HyperLinkIcon.js +7 -0
- package/dist/scripts/src/components/Icon/Icon.js +32 -0
- package/dist/scripts/src/components/Icon/IconNative.js +102 -0
- package/dist/scripts/src/components/Icon/ImageFileIcon.js +10 -0
- package/dist/scripts/src/components/Icon/LinkIcon.js +7 -0
- package/dist/scripts/src/components/Icon/ListIcon.js +7 -0
- package/dist/scripts/src/components/Icon/LooseListIcon.js +7 -0
- package/dist/scripts/src/components/Icon/MoonIcon.js +10 -0
- package/dist/scripts/src/components/Icon/MoreOptionsIcon.js +7 -0
- package/dist/scripts/src/components/Icon/NoSortIcon.js +8 -0
- package/dist/scripts/src/components/Icon/PDFIcon.js +10 -0
- package/dist/scripts/src/components/Icon/PenIcon.js +7 -0
- package/dist/scripts/src/components/Icon/PhoneIcon.js +7 -0
- package/dist/scripts/src/components/Icon/PhotoIcon.js +10 -0
- package/dist/scripts/src/components/Icon/PlusIcon.js +7 -0
- package/dist/scripts/src/components/Icon/SearchIcon.js +7 -0
- package/dist/scripts/src/components/Icon/ShareIcon.js +10 -0
- package/dist/scripts/src/components/Icon/SortAscendingIcon.js +8 -0
- package/dist/scripts/src/components/Icon/SortDescendingIcon.js +8 -0
- package/dist/scripts/src/components/Icon/SunIcon.js +10 -0
- package/dist/scripts/src/components/Icon/TrashIcon.js +7 -0
- package/dist/scripts/src/components/Icon/TrendingDownIcon.js +10 -0
- package/dist/scripts/src/components/Icon/TrendingLevelIcon.js +10 -0
- package/dist/scripts/src/components/Icon/TrendingUpIcon.js +10 -0
- package/dist/scripts/src/components/Icon/TxtIcon.js +10 -0
- package/dist/scripts/src/components/Icon/UnknownFileIcon.js +10 -0
- package/dist/scripts/src/components/Icon/UnlinkIcon.js +10 -0
- package/dist/scripts/src/components/Icon/UserIcon.js +7 -0
- package/dist/scripts/src/components/Icon/WarningIcon.js +7 -0
- package/dist/scripts/src/components/Icon/XlsIcon.js +10 -0
- package/dist/scripts/src/components/IconInfoCard/IconInfoCard.js +39 -0
- package/dist/scripts/src/components/IconProvider.js +264 -0
- package/dist/scripts/src/components/IconRegistryContext.js +317 -0
- package/dist/scripts/src/components/Image/Image.js +35 -0
- package/dist/scripts/src/components/Image/ImageNative.js +15 -0
- package/dist/scripts/src/components/Input/InputAdornment.js +14 -0
- package/dist/scripts/src/components/Items/Items.js +33 -0
- package/dist/scripts/src/components/Items/ItemsNative.js +29 -0
- package/dist/scripts/src/components/Link/Link.js +64 -0
- package/dist/scripts/src/components/Link/LinkNative.js +26 -0
- package/dist/scripts/src/components/List/List.js +81 -0
- package/dist/scripts/src/components/List/ListNative.js +425 -0
- package/dist/scripts/src/components/Logo/Logo.js +16 -0
- package/dist/scripts/src/components/Logo/LogoNative.js +15 -0
- package/dist/scripts/src/components/Map/Map.js +75 -0
- package/dist/scripts/src/components/Map/world_countries.json +45307 -0
- package/dist/scripts/src/components/Markdown/Markdown.js +45 -0
- package/dist/scripts/src/components/Markdown/MarkdownNative.js +107 -0
- package/dist/scripts/src/components/ModalDialog/ConfirmationModalContextProvider.js +116 -0
- package/dist/scripts/src/components/ModalDialog/Dialog.js +20 -0
- package/dist/scripts/src/components/ModalDialog/ModalDialog.js +64 -0
- package/dist/scripts/src/components/ModalDialog/ModalDialogNative.js +167 -0
- package/dist/scripts/src/components/ModalDialog/ModalVisibilityContext.js +60 -0
- package/dist/scripts/src/components/NavGroup/NavGroup.js +34 -0
- package/dist/scripts/src/components/NavGroup/NavGroupNative.js +91 -0
- package/dist/scripts/src/components/NavLink/NavLink.js +71 -0
- package/dist/scripts/src/components/NavLink/NavLinkNative.js +61 -0
- package/dist/scripts/src/components/NavPanel/NavPanel.js +31 -0
- package/dist/scripts/src/components/NavPanel/NavPanelNative.js +74 -0
- package/dist/scripts/src/components/NoResult/NoResult.js +38 -0
- package/dist/scripts/src/components/NoResult/NoResultNative.js +13 -0
- package/dist/scripts/src/components/NumberBox/NumberBox.js +61 -0
- package/dist/scripts/src/components/NumberBox/NumberBoxNative.js +337 -0
- package/dist/scripts/src/components/NumberBox/numberbox-abstractions.js +74 -0
- package/dist/scripts/src/components/OffCanvas/OffCanvas.js +57 -0
- package/dist/scripts/src/components/OffCanvas/OffCanvasNative.js +48 -0
- package/dist/scripts/src/components/Option/Option.js +33 -0
- package/dist/scripts/src/components/Option/OptionTypeProvider.js +16 -0
- package/dist/scripts/src/components/PageHeader/PageHeader.js +36 -0
- package/dist/scripts/src/components/PageMetaTitle/PageMetaTilteNative.js +9 -0
- package/dist/scripts/src/components/PageMetaTitle/PageMetaTitle.js +18 -0
- package/dist/scripts/src/components/Pages/Pages.js +33 -0
- package/dist/scripts/src/components/Pages/PagesNative.js +69 -0
- package/dist/scripts/src/components/PieChart/PieChart.js +45 -0
- package/dist/scripts/src/components/PieChart/PieChartNative.js +165 -0
- package/dist/scripts/src/components/PositionedContainer/PositionedContainer.js +24 -0
- package/dist/scripts/src/components/PositionedContainer/PositionedContainerNative.js +14 -0
- package/dist/scripts/src/components/ProgressBar/ProgressBar.js +36 -0
- package/dist/scripts/src/components/ProgressBar/ProgressBarNative.js +12 -0
- package/dist/scripts/src/components/Queue/Queue.js +71 -0
- package/dist/scripts/src/components/Queue/QueueNative.js +278 -0
- package/dist/scripts/src/components/Queue/queueActions.js +87 -0
- package/dist/scripts/src/components/RadioGroup/RadioGroup.js +68 -0
- package/dist/scripts/src/components/RadioGroup/RadioGroupNative.js +104 -0
- package/dist/scripts/src/components/Range/Range.js +56 -0
- package/dist/scripts/src/components/Range/RangeNative.js +8 -0
- package/dist/scripts/src/components/RealTimeAdapter/RealTimeAdapter.js +21 -0
- package/dist/scripts/src/components/RealTimeAdapter/RealTimeAdapterNative.js +131 -0
- package/dist/scripts/src/components/Redirect/Redirect.js +20 -0
- package/dist/scripts/src/components/Select/OptionContext.js +12 -0
- package/dist/scripts/src/components/Select/Select.js +98 -0
- package/dist/scripts/src/components/Select/SelectContext.js +9 -0
- package/dist/scripts/src/components/Select/SelectNative.js +214 -0
- package/dist/scripts/src/components/SelectionStore/SelectionStore.js +22 -0
- package/dist/scripts/src/components/SelectionStore/SelectionStoreNative.js +94 -0
- package/dist/scripts/src/components/Slider/Slider.js +54 -0
- package/dist/scripts/src/components/Slider/SliderNative.js +8 -0
- package/dist/scripts/src/components/SpaceFiller/SpaceFiller.js +19 -0
- package/dist/scripts/src/components/SpaceFiller/SpaceFillerNative.js +10 -0
- package/dist/scripts/src/components/Spinner/Spinner.js +42 -0
- package/dist/scripts/src/components/Spinner/SpinnerNative.js +31 -0
- package/dist/scripts/src/components/Splitter/Splitter.js +89 -0
- package/dist/scripts/src/components/Splitter/SplitterNative.js +159 -0
- package/dist/scripts/src/components/Splitter/utils.js +17 -0
- package/dist/scripts/src/components/Stack/Stack.js +110 -0
- package/dist/scripts/src/components/Stack/StackNative.js +39 -0
- package/dist/scripts/src/components/StateViewer/StateViewerNative.js +19 -0
- package/dist/scripts/src/components/StickyBox/StickyBox.js +30 -0
- package/dist/scripts/src/components/StickyBox/StickyBoxNative.js +15 -0
- package/dist/scripts/src/components/Switch/Switch.js +72 -0
- package/dist/scripts/src/components/Table/Table.js +184 -0
- package/dist/scripts/src/components/Table/TableNative.js +470 -0
- package/dist/scripts/src/components/Table/useRowSelection.js +245 -0
- package/dist/scripts/src/components/TableHeader/TableHeader.js +34 -0
- package/dist/scripts/src/components/TableOfContents/TableOfContents.js +74 -0
- package/dist/scripts/src/components/TableOfContents/TableOfContentsNative.js +55 -0
- package/dist/scripts/src/components/Tabs/TabContext.js +45 -0
- package/dist/scripts/src/components/Tabs/TabItem.js +20 -0
- package/dist/scripts/src/components/Tabs/TabItemNative.js +24 -0
- package/dist/scripts/src/components/Tabs/Tabs.js +55 -0
- package/dist/scripts/src/components/Tabs/TabsNative.js +72 -0
- package/dist/scripts/src/components/Text/Text.js +122 -0
- package/dist/scripts/src/components/Text/TextNative.js +124 -0
- package/dist/scripts/src/components/TextArea/TextArea.js +65 -0
- package/dist/scripts/src/components/TextArea/TextAreaNative.js +176 -0
- package/dist/scripts/src/components/TextArea/TextAreaResizable.js +73 -0
- package/dist/scripts/src/components/TextArea/useComposedRef.js +60 -0
- package/dist/scripts/src/components/TextBox/TextBox.js +85 -0
- package/dist/scripts/src/components/TextBox/TextBoxNative.js +109 -0
- package/dist/scripts/src/components/Theme/NotificationToast.js +50 -0
- package/dist/scripts/src/components/Theme/Theme.js +43 -0
- package/dist/scripts/src/components/Theme/ThemeNative.js +126 -0
- package/dist/scripts/src/components/ThemeChanger/ThemeChanger.js +115 -0
- package/dist/scripts/src/components/ThemeChanger/ToneChangerButton.js +28 -0
- package/dist/scripts/src/components/Toggle/Toggle.js +99 -0
- package/dist/scripts/src/components/Toolbar/Toolbar.js +32 -0
- package/dist/scripts/src/components/ToolbarButton/ToolbarButton.js +38 -0
- package/dist/scripts/src/components/Tree/TreeComponent.js +32 -0
- package/dist/scripts/src/components/Tree/TreeNative.js +69 -0
- package/dist/scripts/src/components/TrendLabel/TrendLabel.js +37 -0
- package/dist/scripts/src/components/ValidationSummary/ValidationSummary.js +59 -0
- package/dist/scripts/src/components/abstractions.js +151 -0
- package/dist/scripts/src/components/chart-color-schemes.js +43 -0
- package/dist/scripts/src/components/component-utils.js +17 -0
- package/dist/scripts/src/components/container-helpers.js +25 -0
- package/dist/scripts/src/components/metadata-helpers.js +245 -0
- package/dist/scripts/src/components/slot-helpers.js +22 -0
- package/dist/scripts/src/components-core/ApiBoundComponent.js +194 -0
- package/dist/scripts/src/components-core/AppContext.js +16 -0
- package/dist/scripts/src/components-core/AppRoot.js +424 -0
- package/dist/scripts/src/components-core/ComponentBed.js +325 -0
- package/dist/scripts/src/components-core/ComponentDecorator.js +90 -0
- package/dist/scripts/src/components-core/CompoundComponent.js +144 -0
- package/dist/scripts/src/components-core/DebugViewProvider.js +43 -0
- package/dist/scripts/src/components-core/EngineError.js +91 -0
- package/dist/scripts/src/components-core/ErrorBoundary.js +59 -0
- package/dist/scripts/src/components-core/Fragment.js +15 -0
- package/dist/scripts/src/components-core/InspectorContext.js +176 -0
- package/dist/scripts/src/components-core/InvalidComponent.js +17 -0
- package/dist/scripts/src/components-core/LoaderComponent.js +92 -0
- package/dist/scripts/src/components-core/RestApiProxy.js +354 -0
- package/dist/scripts/src/components-core/ScrollContext.js +11 -0
- package/dist/scripts/src/components-core/Slot.js +17 -0
- package/dist/scripts/src/components-core/StandaloneApp.js +589 -0
- package/dist/scripts/src/components-core/StandaloneComponentManager.js +51 -0
- package/dist/scripts/src/components-core/TableOfContentsContext.js +110 -0
- package/dist/scripts/src/components-core/UnknownComponent.js +15 -0
- package/dist/scripts/src/components-core/XmluiCodeHighlighter.js +110 -0
- package/dist/scripts/src/components-core/abstractions/ComponentRenderer.js +2 -0
- package/dist/scripts/src/components-core/abstractions/LoaderRenderer.js +2 -0
- package/dist/scripts/src/components-core/abstractions/containers.js +18 -0
- package/dist/scripts/src/components-core/abstractions/standalone.js +2 -0
- package/dist/scripts/src/components-core/abstractions/treeAbstractions.js +2 -0
- package/dist/scripts/src/components-core/action/APICall.js +283 -0
- package/dist/scripts/src/components-core/action/FileDownloadAction.js +80 -0
- package/dist/scripts/src/components-core/action/FileUploadAction.js +88 -0
- package/dist/scripts/src/components-core/action/NavigateAction.js +20 -0
- package/dist/scripts/src/components-core/action/TimedAction.js +21 -0
- package/dist/scripts/src/components-core/action/actions.js +15 -0
- package/dist/scripts/src/components-core/appContext/date-functions.js +19 -0
- package/dist/scripts/src/components-core/appContext/math-function.js +27 -0
- package/dist/scripts/src/components-core/appContext/misc-utils.js +12 -0
- package/dist/scripts/src/components-core/component-hooks.js +25 -0
- package/dist/scripts/src/components-core/constants.js +18 -0
- package/dist/scripts/src/components-core/container/Container.js +1241 -0
- package/dist/scripts/src/components-core/container/buildProxy.js +54 -0
- package/dist/scripts/src/components-core/container/collectFnVarDeps.js +49 -0
- package/dist/scripts/src/components-core/container/valueExtractor.js +205 -0
- package/dist/scripts/src/components-core/descriptorHelper.js +72 -0
- package/dist/scripts/src/components-core/interception/ApiInterceptor.js +198 -0
- package/dist/scripts/src/components-core/interception/ApiInterceptorProvider.js +94 -0
- package/dist/scripts/src/components-core/interception/Backend.js +129 -0
- package/dist/scripts/src/components-core/interception/Errors.js +129 -0
- package/dist/scripts/src/components-core/interception/InMemoryDb.js +41 -0
- package/dist/scripts/src/components-core/interception/IndexedDb.js +205 -0
- package/dist/scripts/src/components-core/interception/ReadonlyCollection.js +145 -0
- package/dist/scripts/src/components-core/interception/abstractions.js +2 -0
- package/dist/scripts/src/components-core/interception/apiInterceptorWorker.js +46 -0
- package/dist/scripts/src/components-core/interception/useApiInterceptorContext.js +9 -0
- package/dist/scripts/src/components-core/loader/ApiLoader.js +54 -0
- package/dist/scripts/src/components-core/loader/DataLoader.js +149 -0
- package/dist/scripts/src/components-core/loader/ExternalDataLoader.js +62 -0
- package/dist/scripts/src/components-core/loader/Loader.js +126 -0
- package/dist/scripts/src/components-core/loader/MockLoaderRenderer.js +40 -0
- package/dist/scripts/src/components-core/loader/PageableLoader.js +262 -0
- package/dist/scripts/src/components-core/markup-check.js +279 -0
- package/dist/scripts/src/components-core/renderers.js +45 -0
- package/dist/scripts/src/components-core/reportEngineError.js +62 -0
- package/dist/scripts/src/components-core/script-runner/BindingTreeEvaluationContext.js +35 -0
- package/dist/scripts/src/components-core/script-runner/ICustomOperations.js +34 -0
- package/dist/scripts/src/components-core/script-runner/ParameterParser.js +117 -0
- package/dist/scripts/src/components-core/script-runner/asyncProxy.js +149 -0
- package/dist/scripts/src/components-core/script-runner/bannedFunctions.js +34 -0
- package/dist/scripts/src/components-core/script-runner/custom-operations-registry.js +40 -0
- package/dist/scripts/src/components-core/script-runner/custom-ui-data.js +40 -0
- package/dist/scripts/src/components-core/script-runner/eval-tree-async.js +593 -0
- package/dist/scripts/src/components-core/script-runner/eval-tree-common.js +497 -0
- package/dist/scripts/src/components-core/script-runner/eval-tree-sync.js +482 -0
- package/dist/scripts/src/components-core/script-runner/process-statement-async.js +766 -0
- package/dist/scripts/src/components-core/script-runner/process-statement-common.js +193 -0
- package/dist/scripts/src/components-core/script-runner/process-statement-sync.js +752 -0
- package/dist/scripts/src/components-core/script-runner/statement-queue.js +62 -0
- package/dist/scripts/src/components-core/script-runner/syncProxy.js +31 -0
- package/dist/scripts/src/components-core/script-runner/visitors.js +361 -0
- package/dist/scripts/src/components-core/theming/ThemeContext.js +53 -0
- package/dist/scripts/src/components-core/theming/ThemeProvider.js +335 -0
- package/dist/scripts/src/components-core/theming/abstractions.js +11 -0
- package/dist/scripts/src/components-core/theming/extendThemeUtils.js +114 -0
- package/dist/scripts/src/components-core/theming/hvar.js +105 -0
- package/dist/scripts/src/components-core/theming/themeVars.js +62 -0
- package/dist/scripts/src/components-core/theming/themes/base-utils.js +31 -0
- package/dist/scripts/src/components-core/theming/themes/palette.js +55 -0
- package/dist/scripts/src/components-core/theming/themes/root.js +287 -0
- package/dist/scripts/src/components-core/theming/themes/solid.js +16 -0
- package/dist/scripts/src/components-core/theming/themes/theme-colors.js +561 -0
- package/dist/scripts/src/components-core/theming/themes/xmlui.js +58 -0
- package/dist/scripts/src/components-core/theming/transformThemeVars.js +300 -0
- package/dist/scripts/src/components-core/utils/DataLoaderQueryKeyGenerator.js +35 -0
- package/dist/scripts/src/components-core/utils/LruCache.js +184 -0
- package/dist/scripts/src/components-core/utils/actionUtils.js +32 -0
- package/dist/scripts/src/components-core/utils/classnames.js +58 -0
- package/dist/scripts/src/components-core/utils/compound-utils.js +11 -0
- package/dist/scripts/src/components-core/utils/css-utils.js +163 -0
- package/dist/scripts/src/components-core/utils/date-utils.js +78 -0
- package/dist/scripts/src/components-core/utils/extractParam.js +148 -0
- package/dist/scripts/src/components-core/utils/hooks.js +249 -0
- package/dist/scripts/src/components-core/utils/mergeProps.js +45 -0
- package/dist/scripts/src/components-core/utils/misc.js +472 -0
- package/dist/scripts/src/components-core/utils/request-params.js +70 -0
- package/dist/scripts/src/components-core/utils/statementUtils.js +221 -0
- package/dist/scripts/src/components-core/utils/treeUtils.js +48 -0
- package/dist/scripts/src/index.js +69 -0
- package/dist/scripts/src/parsers/common/GenericToken.js +2 -0
- package/dist/scripts/src/parsers/scripting-exp/TokenType.js +112 -0
- package/dist/scripts/src/parsers/style-parser/StyleInputStream.js +39 -0
- package/dist/scripts/src/parsers/style-parser/StyleLexer.js +623 -0
- package/dist/scripts/src/parsers/style-parser/StyleParser.js +1036 -0
- package/dist/scripts/src/parsers/style-parser/errors.js +37 -0
- package/dist/scripts/src/parsers/style-parser/source-tree.js +2 -0
- package/dist/scripts/src/parsers/style-parser/style-compiler.js +558 -0
- package/dist/scripts/src/parsers/style-parser/tokens.js +43 -0
- package/dist/scripts/src/parsers/xmlui-parser/ParserError.js +7 -0
- package/dist/scripts/src/parsers/xmlui-parser/transform.js +80 -32
- package/dist/scripts/src/syntax/grammar.tmLanguage.json +328 -0
- package/dist/scripts/src/syntax/textMate/xmlui.json +630 -0
- package/dist/style.css +1 -1
- package/dist/xmlui-metadata.mjs +2676 -2608
- package/dist/xmlui-metadata.umd.js +16 -16
- package/dist/xmlui-standalone.umd.js +186 -186
- package/dist/xmlui.d.ts +1868 -13
- package/dist/xmlui.mjs +1 -1
- package/package.json +5 -5
- package/dist/xmlui.umd.js +0 -293
|
@@ -0,0 +1,262 @@
|
|
|
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.PageableLoader = PageableLoader;
|
|
46
|
+
const react_1 = require("react");
|
|
47
|
+
const react_query_1 = require("@tanstack/react-query");
|
|
48
|
+
const immer_1 = __importStar(require("immer"));
|
|
49
|
+
const extractParam_1 = require("@components-core/utils/extractParam");
|
|
50
|
+
const AppContext_1 = require("@components-core/AppContext");
|
|
51
|
+
const hooks_1 = require("@components-core/utils/hooks");
|
|
52
|
+
function PageableLoader({ state, loader, loaderFn, queryId, registerComponentApi, pollIntervalInSeconds, onLoaded, loaderInProgressChanged, loaderLoaded, loaderError, transformResult, }) {
|
|
53
|
+
const { uid } = loader;
|
|
54
|
+
const appContext = (0, AppContext_1.useAppContext)();
|
|
55
|
+
const queryKey = (0, react_1.useMemo)(() => (queryId ? queryId : [uid, (0, extractParam_1.extractParam)(state, loader.props, appContext)]), [appContext, loader.props, queryId, state, uid]);
|
|
56
|
+
const thizRef = (0, react_1.useRef)(queryKey);
|
|
57
|
+
const getPreviousPageParam = (0, react_1.useCallback)((firstPage) => {
|
|
58
|
+
let prevPageParam = undefined;
|
|
59
|
+
const prevPageSelector = loader.props.prevPageSelector;
|
|
60
|
+
if (prevPageSelector) {
|
|
61
|
+
prevPageParam = (0, extractParam_1.extractParam)({ $response: firstPage }, prevPageSelector.startsWith("{") ? prevPageSelector : `{$response.${prevPageSelector}}`);
|
|
62
|
+
}
|
|
63
|
+
if (!prevPageParam) {
|
|
64
|
+
return undefined;
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
prevPageParam: prevPageParam,
|
|
68
|
+
};
|
|
69
|
+
}, [loader.props.prevPageSelector]);
|
|
70
|
+
const getNextPageParam = (0, react_1.useCallback)((lastPage) => {
|
|
71
|
+
let nextPageParam = undefined;
|
|
72
|
+
const nextPageSelector = loader.props.nextPageSelector;
|
|
73
|
+
if (nextPageSelector) {
|
|
74
|
+
nextPageParam = (0, extractParam_1.extractParam)({ $response: lastPage }, nextPageSelector.startsWith("{") ? nextPageSelector : `{$response.${nextPageSelector}}`);
|
|
75
|
+
}
|
|
76
|
+
if (!nextPageParam) {
|
|
77
|
+
return undefined;
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
nextPageParam: nextPageParam,
|
|
81
|
+
};
|
|
82
|
+
}, [loader.props.nextPageSelector]);
|
|
83
|
+
const { data, status, error, hasNextPage, isFetchingNextPage, hasPreviousPage, isFetchingPreviousPage, isFetching, refetch, fetchPreviousPage, fetchNextPage, } = (0, react_query_1.useInfiniteQuery)({
|
|
84
|
+
queryKey,
|
|
85
|
+
queryFn: (0, react_1.useCallback)((_a) => __awaiter(this, [_a], void 0, function* ({ signal, pageParam }) {
|
|
86
|
+
return yield loaderFn(signal, pageParam);
|
|
87
|
+
}), [loaderFn]),
|
|
88
|
+
select: (0, react_1.useCallback)((data) => {
|
|
89
|
+
let result = [];
|
|
90
|
+
if (data) {
|
|
91
|
+
result = data.pages.flatMap((d) => d);
|
|
92
|
+
}
|
|
93
|
+
const resultSelector = loader.props.resultSelector;
|
|
94
|
+
if (resultSelector) {
|
|
95
|
+
result = (0, extractParam_1.extractParam)({ $response: result }, resultSelector.startsWith("{") ? resultSelector : `{$response.${resultSelector}}`);
|
|
96
|
+
}
|
|
97
|
+
return transformResult ? transformResult(result) : result;
|
|
98
|
+
}, [loader.props.resultSelector, transformResult]),
|
|
99
|
+
getPreviousPageParam: loader.props.prevPageSelector === undefined ? undefined : getPreviousPageParam,
|
|
100
|
+
getNextPageParam: loader.props.nextPageSelector === undefined ? undefined : getNextPageParam,
|
|
101
|
+
});
|
|
102
|
+
//TODO revisit
|
|
103
|
+
// //we clear all the pages, except the last one (it's suitable for the chat app, but for the other direction we'll have to leave the first page)
|
|
104
|
+
// // otherwise it'll keep it in the cache, and refetch all the pages when you come back
|
|
105
|
+
// // see more here: https://stackoverflow.com/questions/71286123/reactquery-useinfinitequery-refetching-issue
|
|
106
|
+
// // and here: https://tanstack.com/query/latest/docs/react/guides/infinite-queries?from=reactQueryV3&original=https%3A%2F%2Ftanstack.com%2Fquery%2Fv3%2Fdocs%2Fguides%2Finfinite-queries#what-happens-when-an-infinite-query-needs-to-be-refetched
|
|
107
|
+
(0, react_1.useEffect)(() => {
|
|
108
|
+
const queryKey = thizRef.current;
|
|
109
|
+
return () => {
|
|
110
|
+
var _a, _b;
|
|
111
|
+
(_a = appContext.queryClient) === null || _a === void 0 ? void 0 : _a.cancelQueries(queryKey);
|
|
112
|
+
(_b = appContext.queryClient) === null || _b === void 0 ? void 0 : _b.setQueryData(queryKey, (old) => {
|
|
113
|
+
if (!old) {
|
|
114
|
+
return old;
|
|
115
|
+
}
|
|
116
|
+
return (0, immer_1.default)(old, (draft) => {
|
|
117
|
+
draft.pages = draft.pages.length ? [draft.pages[draft.pages.length - 1]] : [];
|
|
118
|
+
// draft.pageParams = draft.pageParams.length ? [draft.pageParams[draft.pageParams.length - 1]] : [];
|
|
119
|
+
draft.pageParams = [];
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
loaderLoaded(undefined, undefined);
|
|
123
|
+
};
|
|
124
|
+
}, [appContext.queryClient, loaderLoaded, uid]);
|
|
125
|
+
const prevData = (0, hooks_1.usePrevious)(data);
|
|
126
|
+
const prevError = (0, hooks_1.usePrevious)(error);
|
|
127
|
+
(0, react_1.useLayoutEffect)(() => {
|
|
128
|
+
loaderInProgressChanged(isFetching); //TODO isFetchingPrevPage / nextPage
|
|
129
|
+
}, [isFetching, loaderInProgressChanged]);
|
|
130
|
+
const pageInfo = (0, react_1.useMemo)(() => {
|
|
131
|
+
return {
|
|
132
|
+
hasPrevPage: hasPreviousPage,
|
|
133
|
+
isFetchingPrevPage: isFetchingPreviousPage,
|
|
134
|
+
hasNextPage,
|
|
135
|
+
isFetchingNextPage,
|
|
136
|
+
};
|
|
137
|
+
}, [hasNextPage, hasPreviousPage, isFetchingNextPage, isFetchingPreviousPage]);
|
|
138
|
+
const prevPageInfo = (0, hooks_1.usePrevious)(pageInfo);
|
|
139
|
+
(0, react_1.useLayoutEffect)(() => {
|
|
140
|
+
// console.log("data changed", {
|
|
141
|
+
// status,
|
|
142
|
+
// data,
|
|
143
|
+
// pageInfo,
|
|
144
|
+
// });
|
|
145
|
+
if (status === "success" && (prevData !== data || prevPageInfo !== pageInfo)) {
|
|
146
|
+
loaderLoaded(data, pageInfo);
|
|
147
|
+
//we do this to push the onLoaded callback to the next event loop.
|
|
148
|
+
// It works, because useLayoutEffect will run synchronously after the render, and the onLoaded callback will have
|
|
149
|
+
// access to the latest loader value
|
|
150
|
+
setTimeout(() => {
|
|
151
|
+
onLoaded === null || onLoaded === void 0 ? void 0 : onLoaded(data);
|
|
152
|
+
}, 0);
|
|
153
|
+
}
|
|
154
|
+
else if (status === "error" && prevError !== error) {
|
|
155
|
+
loaderError(error);
|
|
156
|
+
}
|
|
157
|
+
}, [
|
|
158
|
+
data,
|
|
159
|
+
error,
|
|
160
|
+
loaderError,
|
|
161
|
+
loaderLoaded,
|
|
162
|
+
onLoaded,
|
|
163
|
+
pageInfo,
|
|
164
|
+
prevData,
|
|
165
|
+
prevError,
|
|
166
|
+
prevPageInfo,
|
|
167
|
+
status,
|
|
168
|
+
]);
|
|
169
|
+
(0, react_1.useEffect)(() => {
|
|
170
|
+
let intervalId;
|
|
171
|
+
if (pollIntervalInSeconds) {
|
|
172
|
+
intervalId = setInterval(() => {
|
|
173
|
+
refetch();
|
|
174
|
+
}, pollIntervalInSeconds * 1000);
|
|
175
|
+
}
|
|
176
|
+
return () => {
|
|
177
|
+
if (intervalId) {
|
|
178
|
+
clearInterval(intervalId);
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
}, [pollIntervalInSeconds, refetch]);
|
|
182
|
+
const fetchPrevPage = (0, react_1.useCallback)(() => {
|
|
183
|
+
return fetchPreviousPage();
|
|
184
|
+
}, [fetchPreviousPage]);
|
|
185
|
+
const stableFetchNextPage = (0, react_1.useCallback)(() => {
|
|
186
|
+
return fetchNextPage();
|
|
187
|
+
}, [fetchNextPage]);
|
|
188
|
+
(0, react_1.useEffect)(() => {
|
|
189
|
+
registerComponentApi({
|
|
190
|
+
fetchPrevPage,
|
|
191
|
+
fetchNextPage: stableFetchNextPage,
|
|
192
|
+
refetch,
|
|
193
|
+
update: (updater) => __awaiter(this, void 0, void 0, function* () {
|
|
194
|
+
var _a, _b;
|
|
195
|
+
const oldData = (_a = appContext.queryClient) === null || _a === void 0 ? void 0 : _a.getQueryData(queryId);
|
|
196
|
+
if (!oldData) {
|
|
197
|
+
//loader not loaded yet, we skip the update
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
const originalFlatItems = oldData.pages.flatMap((d) => d.result);
|
|
201
|
+
const draft = (0, immer_1.createDraft)(oldData);
|
|
202
|
+
const flatItems = [];
|
|
203
|
+
for (let i = 0; i < draft.pages.length; i++) {
|
|
204
|
+
const page = draft.pages[i];
|
|
205
|
+
yield updater(page.result);
|
|
206
|
+
flatItems.push(...page.result);
|
|
207
|
+
}
|
|
208
|
+
if (flatItems.length !== originalFlatItems.length) {
|
|
209
|
+
throw new Error("Use this method for update only. If you want to add or delete, call the addItem/deleteItem method.");
|
|
210
|
+
}
|
|
211
|
+
const newData = (0, immer_1.finishDraft)(draft);
|
|
212
|
+
// console.log("BEFORE: ", appContext.queryClient?.getQueryData(queryId!));
|
|
213
|
+
(_b = appContext.queryClient) === null || _b === void 0 ? void 0 : _b.setQueryData(queryId, newData);
|
|
214
|
+
// console.log("AFTER: ", appContext.queryClient?.getQueryData(queryId!));
|
|
215
|
+
}),
|
|
216
|
+
addItem: (element, indexToInsert) => __awaiter(this, void 0, void 0, function* () {
|
|
217
|
+
var _a, _b;
|
|
218
|
+
const oldData = (_a = appContext.queryClient) === null || _a === void 0 ? void 0 : _a.getQueryData(queryId);
|
|
219
|
+
const draft = (0, immer_1.createDraft)(oldData);
|
|
220
|
+
if (indexToInsert === undefined) {
|
|
221
|
+
draft.pages[draft.pages.length - 1].result.push(element);
|
|
222
|
+
}
|
|
223
|
+
else {
|
|
224
|
+
throw new Error("not implemented");
|
|
225
|
+
// TODO is should be something like this
|
|
226
|
+
// //find the pageIndex and itemIndex in that page
|
|
227
|
+
// let pageIndex = -1;
|
|
228
|
+
// let itemIndex = -1;
|
|
229
|
+
// let i = 0;
|
|
230
|
+
// oldData.pages.forEach((page, index)=>{
|
|
231
|
+
// i += page.result.length;
|
|
232
|
+
// if(i >= indexToInsert){
|
|
233
|
+
// pageIndex = index;
|
|
234
|
+
// itemIndex = i - indexToInsert;
|
|
235
|
+
// return;
|
|
236
|
+
// }
|
|
237
|
+
// });
|
|
238
|
+
// draft.pages[pageIndex].result.splice(itemIndex, 0, element);
|
|
239
|
+
}
|
|
240
|
+
const newData = (0, immer_1.finishDraft)(draft);
|
|
241
|
+
(_b = appContext.queryClient) === null || _b === void 0 ? void 0 : _b.setQueryData(queryId, newData);
|
|
242
|
+
}),
|
|
243
|
+
getItems: () => {
|
|
244
|
+
return data;
|
|
245
|
+
},
|
|
246
|
+
deleteItem: (element) => __awaiter(this, void 0, void 0, function* () {
|
|
247
|
+
throw new Error("not implemented");
|
|
248
|
+
}),
|
|
249
|
+
});
|
|
250
|
+
}, [
|
|
251
|
+
appContext.queryClient,
|
|
252
|
+
fetchPrevPage,
|
|
253
|
+
data,
|
|
254
|
+
loader.uid,
|
|
255
|
+
queryId,
|
|
256
|
+
queryKey,
|
|
257
|
+
refetch,
|
|
258
|
+
registerComponentApi,
|
|
259
|
+
stableFetchNextPage,
|
|
260
|
+
]);
|
|
261
|
+
return null;
|
|
262
|
+
}
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.checkXmlUiMarkup = checkXmlUiMarkup;
|
|
4
|
+
exports.visitComponent = visitComponent;
|
|
5
|
+
const ParameterParser_1 = require("./script-runner/ParameterParser");
|
|
6
|
+
const Parser_1 = require("../parsers/scripting/Parser");
|
|
7
|
+
const descriptorHelper_1 = require("./descriptorHelper");
|
|
8
|
+
const abstractions_1 = require("@components/abstractions");
|
|
9
|
+
/**
|
|
10
|
+
* This function checks the XMLUI markup for potential issues. It retrieves
|
|
11
|
+
* a list of errors and warnings.
|
|
12
|
+
* @param rootDef Root component definition
|
|
13
|
+
* @param components Components referenced in the XMLUI markup
|
|
14
|
+
* @param devMode Indicates if the check is performed in development mode
|
|
15
|
+
* @returns List of errors and warnings
|
|
16
|
+
*/
|
|
17
|
+
function checkXmlUiMarkup(rootDef, components, metadataHandler, devMode) {
|
|
18
|
+
const errorsCollected = [];
|
|
19
|
+
// --- Initialize the check
|
|
20
|
+
const continuation = {};
|
|
21
|
+
const componentIdsCollected = new Set();
|
|
22
|
+
const compoundIdsCollected = new Set();
|
|
23
|
+
// --- Visit the root component
|
|
24
|
+
if (rootDef) {
|
|
25
|
+
visitComponent(rootDef, null, componentDefVisitor, continuation, metadataHandler);
|
|
26
|
+
}
|
|
27
|
+
// --- Visit the compound components
|
|
28
|
+
if (!continuation.abort) {
|
|
29
|
+
for (const component of components) {
|
|
30
|
+
// --- Rule: Compound component name must be a valid JavaScript identifier
|
|
31
|
+
if (!isValidIdentifier(component.name)) {
|
|
32
|
+
reportError("M007", "Component", component.name);
|
|
33
|
+
}
|
|
34
|
+
// --- Rule: Compound component name cannot be 'Component'
|
|
35
|
+
if (component.name === "Component") {
|
|
36
|
+
reportError("M008", "Component", component.name);
|
|
37
|
+
}
|
|
38
|
+
// --- Rule: Compound component must not have the name of a registered component
|
|
39
|
+
if (metadataHandler.componentRegistered(component.name)) {
|
|
40
|
+
reportError("M009", "Component", component.name);
|
|
41
|
+
}
|
|
42
|
+
// --- Rule: Compound component name must be unique
|
|
43
|
+
if (compoundIdsCollected.has(component.name)) {
|
|
44
|
+
reportError("M010", "Component", component.name);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
compoundIdsCollected.add(component.name);
|
|
48
|
+
}
|
|
49
|
+
// --- Reset component ID scope
|
|
50
|
+
componentIdsCollected.clear();
|
|
51
|
+
// --- Visit the compount component's definition
|
|
52
|
+
visitComponent(component.component, null, componentDefVisitor, continuation, metadataHandler);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
// --- Done.
|
|
56
|
+
return errorsCollected;
|
|
57
|
+
// --- This visitor checks the rules for a particular component
|
|
58
|
+
function componentDefVisitor(def, parent, before, continuation) {
|
|
59
|
+
var _a, _b, _c, _d, _e;
|
|
60
|
+
// --- This is the visitor function to check a ComponentDef markup
|
|
61
|
+
if (!before) {
|
|
62
|
+
// --- Do not visit the component definition after its children have been visited
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
// --- Rule: Component name must be registered
|
|
66
|
+
if (!metadataHandler.componentRegistered(def.type)) {
|
|
67
|
+
reportError("M001", (_a = parent === null || parent === void 0 ? void 0 : parent.type) !== null && _a !== void 0 ? _a : "Root", def.type);
|
|
68
|
+
// continuation.cancel = true;
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
// --- Rule: an ID must be a valid JavaScript identifier
|
|
72
|
+
if (def.uid) {
|
|
73
|
+
if (!isValidIdentifier(def.uid)) {
|
|
74
|
+
reportError("M002", def.type, def.type, def.uid);
|
|
75
|
+
}
|
|
76
|
+
else if (componentIdsCollected.has(def.uid)) {
|
|
77
|
+
reportError("M003", def.type, def.uid);
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
componentIdsCollected.add(def.uid);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
// --- Check all props of the component
|
|
84
|
+
const propDescriptors = (_b = metadataHandler.getComponentProps(def.type)) !== null && _b !== void 0 ? _b : {};
|
|
85
|
+
const currentProps = (_c = def.props) !== null && _c !== void 0 ? _c : {};
|
|
86
|
+
for (const propName of Object.keys(currentProps)) {
|
|
87
|
+
const propDescriptor = propDescriptors[propName];
|
|
88
|
+
// --- Rule: The property must be defined in the component descriptor or be a layout option
|
|
89
|
+
// --- or the component must accept arbitrary properties
|
|
90
|
+
if (propDescriptor) {
|
|
91
|
+
// --- The property has a descriptor, so it is allowed.
|
|
92
|
+
// --- Rule: The property value must be parseable
|
|
93
|
+
const propValue = currentProps[propName];
|
|
94
|
+
if (typeof propValue === "string") {
|
|
95
|
+
try {
|
|
96
|
+
(0, ParameterParser_1.parseParameterString)(propValue);
|
|
97
|
+
}
|
|
98
|
+
catch (error) {
|
|
99
|
+
reportError("M006", def.type, propName, error.message);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
// --- The property has no descriptor.
|
|
105
|
+
const propParts = propName.split("-");
|
|
106
|
+
// --- Check for a layout property
|
|
107
|
+
const validProp =
|
|
108
|
+
// --- Layout property
|
|
109
|
+
(propParts.length === 1 && descriptorHelper_1.layoutOptionKeys.includes(propName)) ||
|
|
110
|
+
// --- Layout property with viewport size
|
|
111
|
+
(propParts.length === 2 &&
|
|
112
|
+
descriptorHelper_1.layoutOptionKeys.includes(propParts[0]) &&
|
|
113
|
+
abstractions_1.viewportSizeNames.includes(propParts[1])) ||
|
|
114
|
+
// --- Arbitrary property is allowed
|
|
115
|
+
metadataHandler.acceptArbitraryProps(def.type);
|
|
116
|
+
if (!validProp) {
|
|
117
|
+
// --- The component does not accept arbitrary properties and
|
|
118
|
+
// --- the property is not a layout option
|
|
119
|
+
reportError("M005", def.type, def.type, propName);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
// --- Check all events of the component
|
|
124
|
+
const eventDescriptors = (_d = metadataHandler.getComponentEvents(def.type)) !== null && _d !== void 0 ? _d : {};
|
|
125
|
+
const currentEvents = (_e = def.events) !== null && _e !== void 0 ? _e : {};
|
|
126
|
+
for (const eventName of Object.keys(currentEvents)) {
|
|
127
|
+
const eventDescriptor = eventDescriptors[eventName];
|
|
128
|
+
// --- Rule: The event must be defined in the component descriptor
|
|
129
|
+
if (eventDescriptor) {
|
|
130
|
+
// --- The event has a descriptor, so it is allowed.
|
|
131
|
+
const eventValue = currentEvents[eventName];
|
|
132
|
+
if (typeof eventValue === "string") {
|
|
133
|
+
// --- Rule: The event value must be parseable
|
|
134
|
+
const parser = new Parser_1.Parser(eventValue);
|
|
135
|
+
try {
|
|
136
|
+
parser.parseStatements();
|
|
137
|
+
if (parser.errors.length > 0) {
|
|
138
|
+
reportError("M012", def.type, eventName, parser.errors[0].text);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
catch (error) {
|
|
142
|
+
reportError("M012", def.type, eventName, error.message);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
reportError("M011", def.type, def.type, eventName);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
// --- Check the component validator
|
|
151
|
+
const componentValidator = metadataHandler.getComponentValidator(def.type);
|
|
152
|
+
if (componentValidator) {
|
|
153
|
+
const validationErrors = componentValidator(def, devMode);
|
|
154
|
+
if (validationErrors) {
|
|
155
|
+
if (Array.isArray(validationErrors)) {
|
|
156
|
+
for (const error of validationErrors) {
|
|
157
|
+
reportError("M013", def.type, error);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
reportError("M013", def.type, validationErrors);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Checks if a string is a valid JavaScript identifier.
|
|
168
|
+
* @param identifier The string to check.
|
|
169
|
+
* @returns True if the string is a valid identifier, false otherwise.
|
|
170
|
+
*/
|
|
171
|
+
function isValidIdentifier(identifier) {
|
|
172
|
+
const identifierRegex = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/;
|
|
173
|
+
return identifierRegex.test(identifier);
|
|
174
|
+
}
|
|
175
|
+
function reportError(code, name, ...args) {
|
|
176
|
+
_reportError(code, name, false, ...args);
|
|
177
|
+
}
|
|
178
|
+
function reportWarning(code, name, ...args) {
|
|
179
|
+
_reportError(code, name, true, ...args);
|
|
180
|
+
}
|
|
181
|
+
function _reportError(code, name, isWarning, ...args) {
|
|
182
|
+
var _a;
|
|
183
|
+
let errorText = (_a = errorMessages[code]) !== null && _a !== void 0 ? _a : "Unkonwn error";
|
|
184
|
+
if (args) {
|
|
185
|
+
args.forEach((a, idx) => (errorText = replace(errorText, `{${idx}}`, args[idx].toString())));
|
|
186
|
+
}
|
|
187
|
+
errorsCollected.push({ name, code, message: errorText, isWarning, args });
|
|
188
|
+
function replace(input, placeholder, replacement) {
|
|
189
|
+
do {
|
|
190
|
+
input = input.replace(placeholder, replacement);
|
|
191
|
+
} while (input.includes(placeholder));
|
|
192
|
+
return input;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
// --- This function visits a component, its nested components and children
|
|
197
|
+
function visitComponent(def, parent, visitor, continuation = {}, metadataHandler) {
|
|
198
|
+
var _a, _b, _c, _d;
|
|
199
|
+
// --- Visit the component (before)
|
|
200
|
+
visitor(def, parent, true, continuation);
|
|
201
|
+
if (continuation.abort || continuation.cancel) {
|
|
202
|
+
// --- Stop the visit
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
// --- Visit the properties with "ComponentDef" value
|
|
206
|
+
const propDescriptors = (_a = metadataHandler.getComponentProps(def.type)) !== null && _a !== void 0 ? _a : {};
|
|
207
|
+
const currentProps = (_b = def.props) !== null && _b !== void 0 ? _b : {};
|
|
208
|
+
for (const propName of Object.keys(currentProps)) {
|
|
209
|
+
const propDescriptor = propDescriptors[propName];
|
|
210
|
+
if (!propDescriptor) {
|
|
211
|
+
// --- No descriptor for the property, skip it
|
|
212
|
+
continue;
|
|
213
|
+
}
|
|
214
|
+
const propValue = currentProps[propName];
|
|
215
|
+
if (propDescriptor.type === "ComponentDef" && propValue.type) {
|
|
216
|
+
// --- This property holds a nested component, visit it
|
|
217
|
+
visitComponent(propValue, def, visitor, continuation, metadataHandler);
|
|
218
|
+
if (continuation.abort || continuation.cancel) {
|
|
219
|
+
// --- Stop the visit
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
// --- Visit events with nested components
|
|
225
|
+
const eventDescriptors = (_c = metadataHandler.getComponentEvents(def.type)) !== null && _c !== void 0 ? _c : {};
|
|
226
|
+
const currentEvents = (_d = def.events) !== null && _d !== void 0 ? _d : {};
|
|
227
|
+
for (const eventName of Object.keys(currentEvents)) {
|
|
228
|
+
const eventDescriptor = eventDescriptors[eventName];
|
|
229
|
+
if (!eventDescriptor) {
|
|
230
|
+
// --- No descriptor for the events, skip it
|
|
231
|
+
continue;
|
|
232
|
+
}
|
|
233
|
+
const eventValue = currentEvents[eventName];
|
|
234
|
+
if (typeof eventValue === "object" && eventValue.type) {
|
|
235
|
+
// --- This event holds a nested component, visit it
|
|
236
|
+
visitComponent(eventValue, def, visitor, continuation, metadataHandler);
|
|
237
|
+
if (continuation.abort) {
|
|
238
|
+
// --- Stop visiting this component
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
if (continuation.cancel) {
|
|
242
|
+
// --- Skip the remaining items
|
|
243
|
+
break;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
// --- Visit the component children
|
|
248
|
+
if (def.children) {
|
|
249
|
+
for (const child of def.children) {
|
|
250
|
+
visitComponent(child, def, visitor, continuation, metadataHandler);
|
|
251
|
+
if (continuation.abort) {
|
|
252
|
+
// --- Stop visiting this component
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
if (continuation.cancel) {
|
|
256
|
+
// --- Skip the remaining items
|
|
257
|
+
break;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
// --- Visit the component (after)
|
|
262
|
+
visitor(def, undefined, false, continuation);
|
|
263
|
+
}
|
|
264
|
+
// --- The error messages of error codes
|
|
265
|
+
const errorMessages = {
|
|
266
|
+
M001: "The component '{0}' is not registered",
|
|
267
|
+
M002: "The '{0}' element has an invalid id: '{1}'",
|
|
268
|
+
M003: "Invalid component identifier: '{0}'",
|
|
269
|
+
M004: "Duplicated component identifier: '{0}'",
|
|
270
|
+
M005: "The '{0}' element has an invalid property: '{1}'",
|
|
271
|
+
M006: "Parsing property value of '{0}' failed: {1}",
|
|
272
|
+
M007: "The name of a reusable component is invalid: '{0}'",
|
|
273
|
+
M008: "The name of a reusable component must not be '{0}', as it is a reserved name",
|
|
274
|
+
M009: "A reusable component cannot have the name of a registered component: '{0}'",
|
|
275
|
+
M010: "Duplicated reusable component name: '{0}'",
|
|
276
|
+
M011: "The '{0}' element has an invalid event: '{1}'",
|
|
277
|
+
M012: "Parsing event value of '{0}' failed: {1}",
|
|
278
|
+
M013: "Component validation failed: '{0}'",
|
|
279
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createComponentRenderer = createComponentRenderer;
|
|
4
|
+
exports.createPropHolderComponent = createPropHolderComponent;
|
|
5
|
+
exports.createLoaderRenderer = createLoaderRenderer;
|
|
6
|
+
/**
|
|
7
|
+
* This helper function creates a component renderer definition from its arguments.
|
|
8
|
+
* @param type The unique identifier of the component definition
|
|
9
|
+
* @param renderer The function that renders the component definition into a React node
|
|
10
|
+
* @param metadata Optional hints to help fix the rendering errors coming from invalid component property definitions
|
|
11
|
+
* @returns The view renderer definition composed of the arguments
|
|
12
|
+
*/
|
|
13
|
+
function createComponentRenderer(type, metadata, renderer) {
|
|
14
|
+
return {
|
|
15
|
+
type,
|
|
16
|
+
renderer,
|
|
17
|
+
metadata,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Create a non-visual component used for encapsulating property values
|
|
22
|
+
* @param type Component type
|
|
23
|
+
* @param metadata Component metadata
|
|
24
|
+
*/
|
|
25
|
+
function createPropHolderComponent(type, metadata) {
|
|
26
|
+
return createComponentRenderer(type, metadata, () => {
|
|
27
|
+
throw new Error("Prop holder component, shouldn't render");
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* AppEngine uses React as its UI framework to declare and render loaders. This type declares a function that renders
|
|
32
|
+
* a particular loader definition into its React representation.
|
|
33
|
+
*
|
|
34
|
+
* The type parameter of the function refers to the loader definition the function is about to render.
|
|
35
|
+
* @param type The unique ID of the loader
|
|
36
|
+
* @param renderer The function that renders the loader
|
|
37
|
+
* @param hints Optional hints to help fix the rendering errors coming from invalid component property definitions
|
|
38
|
+
*/
|
|
39
|
+
function createLoaderRenderer(type, renderer, hints) {
|
|
40
|
+
return {
|
|
41
|
+
type,
|
|
42
|
+
renderer,
|
|
43
|
+
hints,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAppErrors = getAppErrors;
|
|
4
|
+
exports.resetErrors = resetErrors;
|
|
5
|
+
exports.reportEngineError = reportEngineError;
|
|
6
|
+
const EngineError_1 = require("./EngineError");
|
|
7
|
+
const appErrors = [];
|
|
8
|
+
/**
|
|
9
|
+
* Get all errors collected during the last run
|
|
10
|
+
*/
|
|
11
|
+
function getAppErrors() {
|
|
12
|
+
return appErrors;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Use this function to reset the errors raised by the execution engine
|
|
16
|
+
*/
|
|
17
|
+
function resetErrors() {
|
|
18
|
+
appErrors.length = 0;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Use this function to report an error
|
|
22
|
+
* @param error Error or string describing the error to report
|
|
23
|
+
* @param errorToThrow The error to throw
|
|
24
|
+
*/
|
|
25
|
+
function reportEngineError(error, errorToThrow) {
|
|
26
|
+
var _a, _b;
|
|
27
|
+
// --- Wrap a string into an error
|
|
28
|
+
if (typeof error === "string") {
|
|
29
|
+
error = new Error(error);
|
|
30
|
+
}
|
|
31
|
+
let helperMessage = "";
|
|
32
|
+
let colors = [];
|
|
33
|
+
// --- Error-specific helper messages
|
|
34
|
+
if (error instanceof EngineError_1.ScriptParseError) {
|
|
35
|
+
let pos = ((_a = error === null || error === void 0 ? void 0 : error.position) !== null && _a !== void 0 ? _a : 0) - 1;
|
|
36
|
+
if (error.source) {
|
|
37
|
+
while (pos < error.source.length - 1 && error.source[pos] === " ") {
|
|
38
|
+
pos++;
|
|
39
|
+
}
|
|
40
|
+
helperMessage += `%c${error.message}%c\n\n`;
|
|
41
|
+
helperMessage += `${error.source.substring(0, pos)}%c${error.source[pos]}%c${(_b = error.source.substring(pos + 1)) !== null && _b !== void 0 ? _b : ""}\n\n`;
|
|
42
|
+
}
|
|
43
|
+
helperMessage += `%cThe error handler associated with the parsed code did not run.%c`;
|
|
44
|
+
colors = ["color: red", "color: inherited", "color: red", "color: inherited", "color: orange", "color: inherited"];
|
|
45
|
+
}
|
|
46
|
+
else if (error instanceof EngineError_1.StatementExecutionError) {
|
|
47
|
+
helperMessage += `%cError while executing code: ${error.message}%c`;
|
|
48
|
+
if (error.source) {
|
|
49
|
+
helperMessage += `\n\n${error.source}`;
|
|
50
|
+
}
|
|
51
|
+
colors = ["color: red", "color: inherited"];
|
|
52
|
+
}
|
|
53
|
+
else if (error instanceof EngineError_1.ThrowStatementError) {
|
|
54
|
+
helperMessage += `A 'throw' statement executed:\n\n%c${error.message}%c\n\n${error.errorObject}`;
|
|
55
|
+
colors = ["color: red", "color: inherited"];
|
|
56
|
+
}
|
|
57
|
+
if (helperMessage) {
|
|
58
|
+
console.log(helperMessage, ...colors);
|
|
59
|
+
}
|
|
60
|
+
appErrors.push({ error, helperMessage, colors });
|
|
61
|
+
throw errorToThrow !== null && errorToThrow !== void 0 ? errorToThrow : error;
|
|
62
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CancellationToken = void 0;
|
|
4
|
+
exports.createEvalContext = createEvalContext;
|
|
5
|
+
/**
|
|
6
|
+
* A token that signals the cancellation of an operation
|
|
7
|
+
*/
|
|
8
|
+
class CancellationToken {
|
|
9
|
+
constructor() {
|
|
10
|
+
this._cancelled = false;
|
|
11
|
+
}
|
|
12
|
+
get cancelled() {
|
|
13
|
+
return this._cancelled;
|
|
14
|
+
}
|
|
15
|
+
cancel() {
|
|
16
|
+
this._cancelled = true;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.CancellationToken = CancellationToken;
|
|
20
|
+
/**
|
|
21
|
+
* Creates an evaluation context with the given parts
|
|
22
|
+
* @param parts Parts of the evaluation context
|
|
23
|
+
* @returns New evaluation context
|
|
24
|
+
*/
|
|
25
|
+
function createEvalContext(parts) {
|
|
26
|
+
return Object.assign({
|
|
27
|
+
mainThread: {
|
|
28
|
+
childThreads: [],
|
|
29
|
+
blocks: [{ vars: {} }],
|
|
30
|
+
loops: [],
|
|
31
|
+
breakLabelValue: -1
|
|
32
|
+
},
|
|
33
|
+
localContext: {}
|
|
34
|
+
}, parts);
|
|
35
|
+
}
|