xmlui 0.4.1 → 0.4.2-beta.1
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/{Pdf-49TqXRNN.mjs → Pdf-DY3dYAig.mjs} +1 -1
- package/dist/{Pdf-BH2vx5Qr.mjs → Pdf-DYj6pOR4.mjs} +1 -1
- package/dist/{apiInterceptorWorker-Bt5xchwi.mjs → apiInterceptorWorker-B_8SyVm7.mjs} +1 -1
- package/dist/{apiInterceptorWorker-BBlmEoWI.mjs → apiInterceptorWorker-CSMfMHnG.mjs} +1 -1
- package/dist/core-CiRlrzNN.mjs +5389 -0
- package/dist/core-TkN1rPOq.mjs +5390 -0
- package/dist/grammar.tmLanguage-Bgs-wS_O.mjs +636 -0
- package/dist/{index-D4lrwrU-.mjs → index-DFmApFOY.mjs} +12192 -12668
- package/dist/{index-standalone-OPhLIAuf.mjs → index-standalone-UVkKZMvh.mjs} +28299 -28777
- package/dist/index-standalone.css +1 -1
- package/dist/index.css +1 -1
- package/dist/{nivo-bar.es-DGyxXAiC.mjs → nivo-bar.es-tnCyX0Yr.mjs} +2 -2
- package/dist/{nivo-geo.es-xKJj5CIr.mjs → nivo-geo.es-BQ3VnkfD.mjs} +2 -2
- package/dist/{nivo-legends.es-Dp7DGs5k.mjs → nivo-legends.es-D-P_F-6G.mjs} +1 -1
- package/dist/{nivo-pie.es-BXZkJTQT.mjs → nivo-pie.es-Z4Ty7kQd.mjs} +2 -2
- package/dist/{react-apexcharts.min-ZKwRrO8G.mjs → react-apexcharts.min-DgtmaDk9.mjs} +1 -1
- package/dist/scripts/docs/syntax/grammar.tmLanguage.json +385 -0
- package/dist/scripts/docs/syntax/textMate/xmlui.json +629 -0
- package/dist/scripts/{bin → xmlui/bin}/vite-ueml-plugin.js +11 -16
- package/dist/scripts/{src → xmlui/src}/components/AppHeader/AppHeader.js +2 -2
- package/dist/scripts/{src → xmlui/src}/components/Avatar/Avatar.js +3 -3
- package/dist/scripts/{src → xmlui/src}/components/Button/Button.js +5 -3
- package/dist/scripts/xmlui/src/components/Card/Card.js +76 -0
- package/dist/scripts/{src → xmlui/src}/components/Chart/Chart.js +7 -6
- package/dist/scripts/{src → xmlui/src}/components/Combobox/Combobox.js +60 -22
- package/dist/scripts/{src → xmlui/src}/components/ComponentProvider.js +26 -6
- package/dist/scripts/{src → xmlui/src}/components/DropdownMenu/DropdownMenu.js +21 -14
- package/dist/scripts/{src → xmlui/src}/components/FlowLayout/FlowLayout.js +10 -9
- package/dist/scripts/xmlui/src/components/FormSection/FormSection.js +47 -0
- package/dist/scripts/{src → xmlui/src}/components/Heading/Heading.js +1 -1
- package/dist/scripts/{src → xmlui/src}/components/Icon/Icon.js +4 -3
- package/dist/scripts/xmlui/src/components/Icon/TrendingDownIcon.js +10 -0
- package/dist/scripts/xmlui/src/components/Icon/TrendingUpIcon.js +10 -0
- package/dist/scripts/xmlui/src/components/IconInfoCard/IconInfoCard.js +52 -0
- package/dist/scripts/{src → xmlui/src}/components/IconProvider.js +4 -1
- package/dist/scripts/{src → xmlui/src}/components/Image/Image.js +4 -4
- package/dist/scripts/{src → xmlui/src}/components/Link/Link.js +4 -4
- package/dist/scripts/{src → xmlui/src}/components/Map/Map.js +7 -1
- package/dist/scripts/{src → xmlui/src}/components/ModalDialog/ModalDialog.js +5 -1
- package/dist/scripts/{src → xmlui/src}/components/MultiCombobox/MultiCombobox.js +1 -1
- package/dist/scripts/{src → xmlui/src}/components/NavLink/NavLink.js +4 -3
- package/dist/scripts/{src → xmlui/src}/components/NavPanel/NavPanel.js +6 -4
- package/dist/scripts/xmlui/src/components/PageHeader/PageHeader.js +48 -0
- package/dist/scripts/{src → xmlui/src}/components/ProgressBar/ProgressBar.js +5 -4
- package/dist/scripts/{src → xmlui/src}/components/Table/Table.js +61 -51
- package/dist/scripts/xmlui/src/components/TableHeader/TableHeader.js +31 -0
- package/dist/scripts/{src → xmlui/src}/components/Text/Text.js +34 -13
- package/dist/scripts/{src → xmlui/src}/components/ThemeChanger/ThemeChanger.js +3 -24
- package/dist/scripts/{src → xmlui/src}/components/Toggle/Toggle.js +9 -8
- package/dist/scripts/xmlui/src/components/Toolbar/Toolbar.js +26 -0
- package/dist/scripts/xmlui/src/components/ToolbarButton/ToolbarButton.js +33 -0
- package/dist/scripts/xmlui/src/components/TrendLabel/TrendLabel.js +79 -0
- package/dist/scripts/{src → xmlui/src}/components-core/Component.js +8 -5
- package/dist/scripts/{src → xmlui/src}/components-core/ComponentDecorator.js +17 -3
- package/dist/scripts/xmlui/src/components-core/InspectorContext.js +176 -0
- package/dist/scripts/{src → xmlui/src}/components-core/RootComponent.js +8 -6
- package/dist/scripts/xmlui/src/components-core/XmluiCodeHighlighter.js +95 -0
- package/dist/scripts/{src → xmlui/src}/components-core/loader/DataLoader.js +14 -6
- package/dist/scripts/{src → xmlui/src}/components-core/script-runner/eval-tree-common.js +2 -7
- package/dist/scripts/{src → xmlui/src}/components-core/script-runner/process-statement-async.js +0 -59
- package/dist/scripts/{src → xmlui/src}/components-core/script-runner/process-statement-common.js +2 -2
- package/dist/scripts/{src → xmlui/src}/components-core/theming/ThemeProvider.js +4 -0
- package/dist/scripts/{src → xmlui/src}/components-core/theming/themes/root.js +20 -15
- package/dist/scripts/{src → xmlui/src}/components-core/theming/themes/theme-colors.js +164 -2
- package/dist/scripts/{src → xmlui/src}/components-core/theming/themes/xmlui.js +17 -1
- package/dist/scripts/xmlui/src/components-core/xmlui-parser.js +51 -0
- package/dist/scripts/{src → xmlui/src}/parsers/scripting/Parser.js +1 -1
- package/dist/scripts/{src → xmlui/src}/parsers/scripting/code-behind-collect.js +8 -4
- package/dist/scripts/{src/components-core/script-runner → xmlui/src/parsers/scripting}/modules.js +74 -6
- package/dist/scripts/{src/parsers/ueml → xmlui/src/parsers/xmlui-parser}/ParserError.js +1 -1
- package/dist/scripts/{src → xmlui/src}/parsers/xmlui-parser/parser.js +27 -20
- package/dist/scripts/{src → xmlui/src}/parsers/xmlui-parser/transform.js +113 -56
- package/dist/wasm-SPaT1zC5.mjs +5 -0
- package/dist/xmlui-C8fXVsN3.mjs +636 -0
- package/dist/xmlui-standalone.es.js +1 -1
- package/dist/xmlui-standalone.umd.js +289 -281
- package/dist/xmlui.es.d.ts +40 -21
- package/dist/xmlui.es.js +1 -1
- package/dist/xmlui.umd.js +124 -116
- package/package.json +12 -3
- package/dist/scripts/src/abstractions/BlockScope.js +0 -4
- package/dist/scripts/src/components/Card/Card.js +0 -65
- package/dist/scripts/src/components/FormSection/FormSection.js +0 -45
- package/dist/scripts/src/components-core/xmlui-parser.js +0 -52
- package/dist/scripts/src/parsers/ueml/UemlHelper.js +0 -579
- package/dist/scripts/src/parsers/ueml/UemlInputStream.js +0 -59
- package/dist/scripts/src/parsers/ueml/UemlLexer.js +0 -868
- package/dist/scripts/src/parsers/ueml/UemlParser.js +0 -1439
- package/dist/scripts/src/parsers/ueml/UemlToken.js +0 -24
- /package/dist/scripts/{bin → xmlui/bin}/bootstrap.js +0 -0
- /package/dist/scripts/{bin → xmlui/bin}/build.js +0 -0
- /package/dist/scripts/{bin → xmlui/bin}/index.js +0 -0
- /package/dist/scripts/{bin → xmlui/bin}/preview.js +0 -0
- /package/dist/scripts/{bin → xmlui/bin}/start.js +0 -0
- /package/dist/scripts/{bin → xmlui/bin}/viteConfig.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/abstractions/ActionDefs.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/abstractions/AppContextDefs.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/abstractions/ComponentDefs.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/abstractions/ComponentDescriptorDefs.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/abstractions/ContainerDefs.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/abstractions/FunctionDefs.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/abstractions/RendererDefs.js +0 -0
- /package/dist/scripts/{src/abstractions/scripting/ScriptParserError.js → xmlui/src/abstractions/scripting/BlockScope.js} +0 -0
- /package/dist/scripts/{src/components-core/script-runner → xmlui/src/abstractions/scripting}/LogicalThread.js +0 -0
- /package/dist/scripts/{src/components-core/script-runner → xmlui/src/abstractions/scripting}/LoopScope.js +0 -0
- /package/dist/scripts/{src/abstractions/scripting/ScriptingSourceTree.js → xmlui/src/abstractions/scripting/ScriptParserError.js} +0 -0
- /package/dist/scripts/{src/components-core/abstractions/ComponentRenderer.js → xmlui/src/abstractions/scripting/ScriptingSourceTree.js} +0 -0
- /package/dist/scripts/{src → xmlui/src}/abstractions/scripting/Token.js +0 -0
- /package/dist/scripts/{src/components-core/script-runner → xmlui/src/abstractions/scripting}/TryScope.js +0 -0
- /package/dist/scripts/{src/components-core/abstractions/LoaderRenderer.js → xmlui/src/abstractions/scripting/modules.js} +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/App/App.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/App/AppLayoutContext.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/App/AppStateContext.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/App/Sheet.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/AppState/AppState.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Badge/Badge.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/BarChart/BarChart.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Bookmark/Bookmark.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/ChangeListener/ChangeListener.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Checkbox/Checkbox.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/ContentSeparator/ContentSeparator.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/DatePicker/DatePicker.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/EmojiSelector/EmojiSelector.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/FileInput/FileInput.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/FileUploadDropZone/FileUploadDropZone.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Footer/Footer.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Form/Form.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Form/FormContext.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Form/formActions.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/FormItem/FormItem.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/FormItem/HelperText.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/FormItem/ItemWithLabel.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/FormItem/Validations.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/HoverCard/HoverCard.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/ApiIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/Attach.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/Binding.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/BoardIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/BoxIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/CheckIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/ChevronDownIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/ChevronLeft.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/ChevronRight.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/ChevronUpIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/CodeFileIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/CodeSandbox.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/CompactListIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/ContentCopyIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/DatabaseIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/DocFileIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/DocIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/DotMenuHorizontalIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/DotMenuIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/EmailIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/EmptyFolderIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/ErrorIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/ExpressionIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/FillPlusCricleIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/FilterIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/FolderIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/GlobeIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/HomeIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/HyperLinkIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/ImageFileIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/LinkIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/ListIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/LooseListIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/MoonIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/MoreOptionsIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/PDFIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/PenIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/PhoneIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/PhotoIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/PlusIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/SearchIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/ShareIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/SunIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/TrashIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/TxtIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/UnknownFileIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/UnlinkIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/UserIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/WarningIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/XlsIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/IconRegistryContext.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Input/InputAdornment.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Input/input-abstractions.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Items/Items.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/List/List.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Logo/Logo.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Map/world_countries.json +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Markdown/Markdown.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/ModalDialog/ConfirmationModalContextProvider.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/ModalDialog/Dialog.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/MultiSelect/MultiSelect.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/NavGroup/NavGroup.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/NoResult/NoResult.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/NumberBox/NumberBox.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Option/Option.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/PageMetaTitle/PageMetaTitle.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Pages/Pages.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Pdf/LazyPdf.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Pdf/Pdf.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/PieChart/PieChart.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/PositionedContainer/PositionedContainer.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Queue/Queue.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Queue/queueActions.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/RadioGroup/RadioGroup.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/RealTimeAdapter/RealTimeAdapter.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Redirect/Redirect.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Select/Select.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Select/SelectContext.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/SelectionStore/SelectionStore.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/SpaceFiller/SpaceFiller.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Spinner/Spinner.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Splitter/Splitter.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Splitter/utils.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Stack/Stack.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/StickyBox/StickyBox.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Switch/Switch.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Table/useRowSelection.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/TableColumnDef/TableColumnDef.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/TableColumnDef/TableContext.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Tabs/Tabs.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/TextArea/TextArea.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/TextArea/TextAreaResizable.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/TextArea/useComposedRef.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/TextBox/TextBox.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Theme/NotificationToast.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Theme/Theme.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Tree/TreeComponent.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/ValidationSummary/ValidationSummary.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/ViewComponentRegistryContext.js +0 -0
- /package/dist/scripts/{src/parsers/ueml/source-tree.js → xmlui/src/components/abstractions.js} +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/chart-color-schemes.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/component-utils.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/container-helpers.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/ApiBoundComponent.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/AppContext.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/ChildrenSlot.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/CompoundComponent.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/EngineError.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/ErrorBoundary.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/Fragment.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/InvalidComponent.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/LoaderComponent.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/RestApiProxy.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/RouteContext.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/ScrollContext.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/UnknownComponent.js +0 -0
- /package/dist/scripts/{src/components-core/abstractions/treeAbstractions.js → xmlui/src/components-core/abstractions/ComponentRenderer.js} +0 -0
- /package/dist/scripts/{src/components-core/interception/abstractions.js → xmlui/src/components-core/abstractions/LoaderRenderer.js} +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/abstractions/containers.js +0 -0
- /package/dist/scripts/{src/components/abstractions.js → xmlui/src/components-core/abstractions/treeAbstractions.js} +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/action/ApiAction.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/action/DownloadFileAction.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/action/NavigateAction.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/action/TimedAction.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/action/UploadAction.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/action/actions.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/appContext/date-functions.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/appContext/misc-utils.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/component-hooks.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/constants.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/container/Container.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/container/ContainerComponentDef.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/container/buildProxy.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/container/collectFnVarDeps.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/container/valueExtractor.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/descriptorHelper.js +0 -0
- /package/dist/scripts/{src/parsers/style-parser/source-tree.js → xmlui/src/components-core/interception/abstractions.js} +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/interception/useApiInterceptorContext.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/loader/ApiLoader.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/loader/ExternalDataLoader.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/loader/Loader.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/loader/MockLoaderRenderer.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/loader/PageableLoader.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/renderers.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/reportEngineError.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/script-runner/BindingTreeEvaluationContext.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/script-runner/ICustomOperations.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/script-runner/ParameterParser.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/script-runner/asyncProxy.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/script-runner/bannedFunctions.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/script-runner/custom-operations-registry.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/script-runner/custom-ui-data.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/script-runner/eval-tree-async.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/script-runner/eval-tree-sync.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/script-runner/process-statement-sync.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/script-runner/statement-queue.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/script-runner/visitors.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/theming/ThemeContext.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/theming/abstractions.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/theming/extendThemeUtils.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/theming/hvar.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/theming/themeVars.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/theming/themes/base-utils.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/theming/themes/palette.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/theming/themes/solid.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/theming/transformThemeVars.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/utils/DataLoaderQueryKeyGenerator.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/utils/LruCache.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/utils/actionUtils.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/utils/classnames.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/utils/css-utils.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/utils/date-utils.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/utils/extractParam.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/utils/hooks.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/utils/mergeProps.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/utils/misc.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/utils/statementUtils.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/utils/treeUtils.js +0 -0
- /package/dist/scripts/{src/parsers/scripting → xmlui/src/parsers/common}/InputStream.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/parsers/scripting/Lexer.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/parsers/scripting/ParserError.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/parsers/scripting/TokenTrait.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/parsers/scripting/tree-visitor.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/parsers/style-parser/StyleInputStream.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/parsers/style-parser/StyleLexer.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/parsers/style-parser/StyleParser.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/parsers/style-parser/errors.js +0 -0
- /package/dist/scripts/{src/parsers/ueml/ueml-tree.js → xmlui/src/parsers/style-parser/source-tree.js} +0 -0
- /package/dist/scripts/{src → xmlui/src}/parsers/style-parser/style-compiler.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/parsers/style-parser/tokens.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/parsers/xmlui-parser/CharacterCodes.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/parsers/xmlui-parser/diagnostics.js +0 -0
- /package/dist/scripts/{src/parsers/ueml → xmlui/src/parsers/xmlui-parser}/fileExtensions.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/parsers/xmlui-parser/scanner.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/parsers/xmlui-parser/syntax-kind.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/parsers/xmlui-parser/syntax-node.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/parsers/xmlui-parser/utils.js +0 -0
|
@@ -1,579 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UemlHelper = exports.onPrefixRegex = exports.UCRegex = exports.COMPOUND_COMP_ID = void 0;
|
|
4
|
-
exports.COMPOUND_COMP_ID = "Component";
|
|
5
|
-
exports.UCRegex = /^[A-Z]/;
|
|
6
|
-
exports.onPrefixRegex = /^on[A-Z]/;
|
|
7
|
-
const attrBreakRegex = /[\r\n<>'"&]/;
|
|
8
|
-
/**
|
|
9
|
-
* Helper class for UEML serialization and parsing
|
|
10
|
-
*/
|
|
11
|
-
class UemlHelper {
|
|
12
|
-
/**
|
|
13
|
-
* Serialize the specified XML fragment into a string
|
|
14
|
-
* @param xml XML fragment to serialize
|
|
15
|
-
* @param options Formatting options to use
|
|
16
|
-
*/
|
|
17
|
-
serialize(xml, options) {
|
|
18
|
-
const fragment = Array.isArray(xml) ? xml : [xml];
|
|
19
|
-
return serializeFragment(fragment, 0);
|
|
20
|
-
function serializeFragment(nodes, depth) {
|
|
21
|
-
return nodes.map((n) => serializeNode(n, depth)).join((options === null || options === void 0 ? void 0 : options.prettify) ? "\n" + getIndent(depth) : "");
|
|
22
|
-
}
|
|
23
|
-
function serializeNode(node, depth) {
|
|
24
|
-
switch (node.type) {
|
|
25
|
-
case "UemlComment":
|
|
26
|
-
return serializeXmlComment(node, depth);
|
|
27
|
-
case "UemlElement":
|
|
28
|
-
return serializeXmlElement(node, depth);
|
|
29
|
-
default:
|
|
30
|
-
return "";
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
function getIndent(depth) {
|
|
34
|
-
var _a;
|
|
35
|
-
return (options === null || options === void 0 ? void 0 : options.prettify) ? "".padEnd(((_a = options === null || options === void 0 ? void 0 : options.indents) !== null && _a !== void 0 ? _a : 2) * depth, " ") : "";
|
|
36
|
-
}
|
|
37
|
-
function serializeXmlComment(node, depth) {
|
|
38
|
-
return `${getIndent(depth)}<!--${node.text}-->`;
|
|
39
|
-
}
|
|
40
|
-
function serializeXmlElement(node, depth) {
|
|
41
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
42
|
-
let elementStr = `${getIndent(depth)}<${nodeName()}`;
|
|
43
|
-
const hasAttrs = ((_b = (_a = node.attributes) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) > 0;
|
|
44
|
-
const hasChildren = ((_d = (_c = node.childNodes) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0) > 0;
|
|
45
|
-
if (node.text || hasAttrs || hasChildren) {
|
|
46
|
-
// --- Indicate that the node has not yet been broken into multiple lines
|
|
47
|
-
if (hasAttrs) {
|
|
48
|
-
// --- Render attributes
|
|
49
|
-
const attrTexts = node.attributes.map((a) => serializeXmlAttribute(a));
|
|
50
|
-
if (!(options === null || options === void 0 ? void 0 : options.prettify)) {
|
|
51
|
-
elementStr += " " + attrTexts.join(" ");
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
// --- Check line overflow
|
|
55
|
-
const nodeLength = elementStr.length +
|
|
56
|
-
1 + // --- Space after
|
|
57
|
-
attrTexts.join(" ").length + // --- Attributes total length
|
|
58
|
-
(hasChildren ? 1 : ((_e = options === null || options === void 0 ? void 0 : options.useSpaceBeforeClose) !== null && _e !== void 0 ? _e : false) ? 3 : 2); // --- Closing token length
|
|
59
|
-
if (nodeLength > ((_f = options === null || options === void 0 ? void 0 : options.lineLength) !== null && _f !== void 0 ? _f : 80)) {
|
|
60
|
-
// --- Too long, break attributes into new lines
|
|
61
|
-
attrTexts.forEach((text) => {
|
|
62
|
-
elementStr += "\n" + getIndent(depth + 1) + text;
|
|
63
|
-
});
|
|
64
|
-
if ((_g = options === null || options === void 0 ? void 0 : options.breakClosingTag) !== null && _g !== void 0 ? _g : false) {
|
|
65
|
-
elementStr += "\n" + getIndent(depth);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
else {
|
|
69
|
-
// --- Attributes fit into the line
|
|
70
|
-
elementStr += " " + attrTexts.join(" ");
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
if (node.text || hasChildren) {
|
|
75
|
-
// --- Close the opening tag
|
|
76
|
-
elementStr += ">";
|
|
77
|
-
// --- Render the text
|
|
78
|
-
if (node.text) {
|
|
79
|
-
const textContents = node.preserveSpaces ? serializeQuotedText(node.text) : serializeText(node.text);
|
|
80
|
-
if ((options === null || options === void 0 ? void 0 : options.prettify) &&
|
|
81
|
-
elementStr.length + textContents.length + node.name.length + 3 > ((_h = options === null || options === void 0 ? void 0 : options.lineLength) !== null && _h !== void 0 ? _h : 80)) {
|
|
82
|
-
// --- break text
|
|
83
|
-
elementStr += "\n" + getIndent(depth + 1) + textContents + "\n";
|
|
84
|
-
}
|
|
85
|
-
else {
|
|
86
|
-
elementStr += textContents;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
// --- Render child nodes
|
|
90
|
-
if (hasChildren) {
|
|
91
|
-
const childrenTexts = node.childNodes.map((c) => serializeNode(c, depth + 1));
|
|
92
|
-
if (!(options === null || options === void 0 ? void 0 : options.prettify)) {
|
|
93
|
-
elementStr += childrenTexts.join("");
|
|
94
|
-
}
|
|
95
|
-
else {
|
|
96
|
-
childrenTexts.forEach((text) => {
|
|
97
|
-
elementStr += "\n" + text;
|
|
98
|
-
});
|
|
99
|
-
elementStr += "\n";
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
// --- Render the closing tag
|
|
103
|
-
elementStr += `${getIndent(depth)}</${node.name}>`;
|
|
104
|
-
}
|
|
105
|
-
else {
|
|
106
|
-
elementStr += (((_j = options === null || options === void 0 ? void 0 : options.useSpaceBeforeClose) !== null && _j !== void 0 ? _j : false) ? " " : "") + "/>";
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
else {
|
|
110
|
-
elementStr += (((_k = options === null || options === void 0 ? void 0 : options.useSpaceBeforeClose) !== null && _k !== void 0 ? _k : false) ? " " : "") + "/>";
|
|
111
|
-
if (node.text === "") {
|
|
112
|
-
elementStr += `""</${nodeName()}>`;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
return elementStr;
|
|
116
|
-
function nodeName() {
|
|
117
|
-
return node.namespace ? `${node.namespace}:${node.name}` : node.name;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
function serializeXmlAttribute(node) {
|
|
121
|
-
var _a;
|
|
122
|
-
// --- Handle valueless attributes
|
|
123
|
-
if (node.value === undefined || node.value === null) {
|
|
124
|
-
return `${nodeName()}`;
|
|
125
|
-
}
|
|
126
|
-
// --- Use quotes when required so
|
|
127
|
-
if (node.preserveSpaces) {
|
|
128
|
-
return `${nodeName()}=${serializeQuotedText(node.value)}`;
|
|
129
|
-
}
|
|
130
|
-
// --- Do the rest
|
|
131
|
-
const value = (_a = node.value) !== null && _a !== void 0 ? _a : "";
|
|
132
|
-
return `${nodeName()}=${serializeQuotedText(value)}`;
|
|
133
|
-
function nodeName() {
|
|
134
|
-
return node.namespace ? `${node.namespace}:${node.name}` : node.name;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
function serializeText(text) {
|
|
138
|
-
return (options === null || options === void 0 ? void 0 : options.useQuotes) || attrBreakRegex.test(text) ? serializeQuotedText(text) : text;
|
|
139
|
-
}
|
|
140
|
-
function serializeQuotedText(text) {
|
|
141
|
-
const containsQuote = text.indexOf("'") >= 0;
|
|
142
|
-
const containsDQuote = text.indexOf('"') >= 0;
|
|
143
|
-
if ((!containsQuote && !containsDQuote) || (containsQuote && !containsDQuote)) {
|
|
144
|
-
return `"${text.replaceAll("`", "\\`")}"`;
|
|
145
|
-
}
|
|
146
|
-
if (containsDQuote && !containsQuote) {
|
|
147
|
-
return `'${text.replaceAll("`", "\\`")}'`;
|
|
148
|
-
}
|
|
149
|
-
return `\`${text.replaceAll("`", "\\`")}\``;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
/**
|
|
153
|
-
* Transform the specified component definition into an UEML node
|
|
154
|
-
* @param def Component definitions
|
|
155
|
-
* @param options Transformation options
|
|
156
|
-
*/
|
|
157
|
-
transformComponentDefinition(def, options) {
|
|
158
|
-
return def.type
|
|
159
|
-
? this.transformSimpleComponentDefinition(def, options)
|
|
160
|
-
: this.transformCompoundComponentDefinition(def, options);
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Transform the specified object into an UEML nodes
|
|
164
|
-
* @param def Object definition
|
|
165
|
-
* @param options Transformation options
|
|
166
|
-
*/
|
|
167
|
-
transformObject(def, options) {
|
|
168
|
-
var _a;
|
|
169
|
-
const transformed = this.transformValue("Object", "", def, options);
|
|
170
|
-
if (!transformed) {
|
|
171
|
-
return null;
|
|
172
|
-
}
|
|
173
|
-
return (_a = transformed.childNodes) !== null && _a !== void 0 ? _a : [];
|
|
174
|
-
}
|
|
175
|
-
/**
|
|
176
|
-
* Transforms the specified simple component definition into an UEML node
|
|
177
|
-
* @param def Component definition
|
|
178
|
-
* @param options Transformation options
|
|
179
|
-
*/
|
|
180
|
-
transformSimpleComponentDefinition(def, options) {
|
|
181
|
-
const componentNode = {
|
|
182
|
-
type: "UemlElement",
|
|
183
|
-
name: def.type,
|
|
184
|
-
};
|
|
185
|
-
// --- Fundamental props
|
|
186
|
-
if (def.uid !== undefined) {
|
|
187
|
-
this.addProperty(componentNode, "id", def.uid, options);
|
|
188
|
-
}
|
|
189
|
-
if (def.testId !== undefined) {
|
|
190
|
-
this.addProperty(componentNode, "testId", def.testId, options);
|
|
191
|
-
}
|
|
192
|
-
if (def.when !== undefined) {
|
|
193
|
-
this.addProperty(componentNode, "when", def.when, options);
|
|
194
|
-
}
|
|
195
|
-
// --- Process vars
|
|
196
|
-
if (def.vars) {
|
|
197
|
-
Object.keys(def.vars).forEach((key) => {
|
|
198
|
-
var _a;
|
|
199
|
-
const varElement = this.transformValue("var", key, def.vars[key], options);
|
|
200
|
-
if (varElement === null)
|
|
201
|
-
return;
|
|
202
|
-
(_a = componentNode.childNodes) !== null && _a !== void 0 ? _a : (componentNode.childNodes = []);
|
|
203
|
-
componentNode.childNodes.push(varElement);
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
|
-
// --- Process properties
|
|
207
|
-
if (def.props) {
|
|
208
|
-
Object.keys(def.props).forEach((key) => {
|
|
209
|
-
var _a, _b, _c;
|
|
210
|
-
// --- Special serialization for component-aware props
|
|
211
|
-
const propValue = def.props[key];
|
|
212
|
-
if (key.endsWith("Template") && propValue.type) {
|
|
213
|
-
// --- Consider this property holds a component
|
|
214
|
-
(_a = componentNode.childNodes) !== null && _a !== void 0 ? _a : (componentNode.childNodes = []);
|
|
215
|
-
const propWrapper = {
|
|
216
|
-
type: "UemlElement",
|
|
217
|
-
name: "prop",
|
|
218
|
-
attributes: [
|
|
219
|
-
{
|
|
220
|
-
type: "UemlAttribute",
|
|
221
|
-
name: "name",
|
|
222
|
-
value: key,
|
|
223
|
-
},
|
|
224
|
-
],
|
|
225
|
-
};
|
|
226
|
-
this.addComponentElement(propWrapper, propValue);
|
|
227
|
-
componentNode.childNodes.push(propWrapper);
|
|
228
|
-
}
|
|
229
|
-
else {
|
|
230
|
-
// --- Undefined is not serialized
|
|
231
|
-
if (propValue === undefined) {
|
|
232
|
-
return;
|
|
233
|
-
}
|
|
234
|
-
// --- Handle null property value
|
|
235
|
-
if (propValue === null) {
|
|
236
|
-
const nullPropElement = {
|
|
237
|
-
type: "UemlElement",
|
|
238
|
-
name: "prop",
|
|
239
|
-
attributes: [
|
|
240
|
-
{
|
|
241
|
-
type: "UemlAttribute",
|
|
242
|
-
name: "name",
|
|
243
|
-
value: key,
|
|
244
|
-
},
|
|
245
|
-
],
|
|
246
|
-
};
|
|
247
|
-
(_b = componentNode.childNodes) !== null && _b !== void 0 ? _b : (componentNode.childNodes = []);
|
|
248
|
-
componentNode.childNodes.push(nullPropElement);
|
|
249
|
-
return;
|
|
250
|
-
}
|
|
251
|
-
// --- Extract prop if asked so, or if those are special, like "id", "when", or "testIs"
|
|
252
|
-
if (key === "id" || key === "when" || key === "testId" || (options === null || options === void 0 ? void 0 : options.extractProps)) {
|
|
253
|
-
const idPropElement = {
|
|
254
|
-
type: "UemlElement",
|
|
255
|
-
name: "prop",
|
|
256
|
-
};
|
|
257
|
-
this.addProperty(idPropElement, key, propValue, options);
|
|
258
|
-
(_c = componentNode.childNodes) !== null && _c !== void 0 ? _c : (componentNode.childNodes = []);
|
|
259
|
-
componentNode.childNodes.push(idPropElement);
|
|
260
|
-
return;
|
|
261
|
-
}
|
|
262
|
-
// --- Add property as the best according to the value
|
|
263
|
-
this.addProperty(componentNode, key, propValue, options);
|
|
264
|
-
}
|
|
265
|
-
});
|
|
266
|
-
}
|
|
267
|
-
// --- Process events
|
|
268
|
-
if (def.events) {
|
|
269
|
-
Object.keys(def.events).forEach((key) => {
|
|
270
|
-
var _a;
|
|
271
|
-
const eventElement = this.transformValue("event", key, def.events[key], options);
|
|
272
|
-
if (eventElement === null)
|
|
273
|
-
return;
|
|
274
|
-
(_a = componentNode.childNodes) !== null && _a !== void 0 ? _a : (componentNode.childNodes = []);
|
|
275
|
-
componentNode.childNodes.push(eventElement);
|
|
276
|
-
});
|
|
277
|
-
}
|
|
278
|
-
// --- Process loaders
|
|
279
|
-
if (def.loaders) {
|
|
280
|
-
this.addComponentList(componentNode, "loaders", def.loaders);
|
|
281
|
-
}
|
|
282
|
-
// --- Process APIs
|
|
283
|
-
if (def.api) {
|
|
284
|
-
Object.keys(def.api).forEach((key) => {
|
|
285
|
-
var _a;
|
|
286
|
-
const apiElement = this.transformValue("api", key, def.api[key], options);
|
|
287
|
-
if (apiElement === null)
|
|
288
|
-
return;
|
|
289
|
-
(_a = componentNode.childNodes) !== null && _a !== void 0 ? _a : (componentNode.childNodes = []);
|
|
290
|
-
componentNode.childNodes.push(apiElement);
|
|
291
|
-
});
|
|
292
|
-
}
|
|
293
|
-
// --- Process uses
|
|
294
|
-
if (def.uses) {
|
|
295
|
-
this.addList(componentNode, "uses", "", def.uses, options);
|
|
296
|
-
}
|
|
297
|
-
// --- Process children
|
|
298
|
-
if (def.children) {
|
|
299
|
-
if (typeof def.children === "string") {
|
|
300
|
-
this.addProperty(componentNode, "children", def.children, options);
|
|
301
|
-
}
|
|
302
|
-
else {
|
|
303
|
-
def.children.forEach((ch) => {
|
|
304
|
-
this.addComponentElement(componentNode, ch);
|
|
305
|
-
});
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
// --- Done
|
|
309
|
-
return componentNode;
|
|
310
|
-
}
|
|
311
|
-
/**
|
|
312
|
-
* Transforms the specified simple component definition into an Xml node
|
|
313
|
-
* @param def Compound component definition
|
|
314
|
-
* @param options Transformation options
|
|
315
|
-
*/
|
|
316
|
-
transformCompoundComponentDefinition(def, options) {
|
|
317
|
-
if (typeof def === "string") {
|
|
318
|
-
return {
|
|
319
|
-
type: "UemlElement",
|
|
320
|
-
name: def,
|
|
321
|
-
};
|
|
322
|
-
}
|
|
323
|
-
const nested = this.transformSimpleComponentDefinition(def.component, options);
|
|
324
|
-
const componentNode = {
|
|
325
|
-
type: "UemlElement",
|
|
326
|
-
name: exports.COMPOUND_COMP_ID,
|
|
327
|
-
attributes: [
|
|
328
|
-
{
|
|
329
|
-
type: "UemlAttribute",
|
|
330
|
-
name: "name",
|
|
331
|
-
value: def.name,
|
|
332
|
-
},
|
|
333
|
-
],
|
|
334
|
-
childNodes: Array.isArray(nested) ? [...nested] : [nested],
|
|
335
|
-
};
|
|
336
|
-
// --- Transform APIs
|
|
337
|
-
if (def.api) {
|
|
338
|
-
Object.keys(def.api).forEach((key) => {
|
|
339
|
-
var _a;
|
|
340
|
-
const apiElement = this.transformValue("api", key, def.api[key], options);
|
|
341
|
-
if (apiElement === null)
|
|
342
|
-
return;
|
|
343
|
-
(_a = componentNode.childNodes) !== null && _a !== void 0 ? _a : (componentNode.childNodes = []);
|
|
344
|
-
componentNode.childNodes.push(apiElement);
|
|
345
|
-
});
|
|
346
|
-
}
|
|
347
|
-
// --- Done
|
|
348
|
-
return componentNode;
|
|
349
|
-
}
|
|
350
|
-
/**
|
|
351
|
-
* Transforms a value into an UEML element
|
|
352
|
-
* @param nodeName Name of the value node
|
|
353
|
-
* @param name Optional (property) name
|
|
354
|
-
* @param value Value to transform
|
|
355
|
-
* @param options Transformation options
|
|
356
|
-
*/
|
|
357
|
-
transformValue(nodeName, name, value, options) {
|
|
358
|
-
var _a, _b, _c;
|
|
359
|
-
// --- Do not transform undefined elements
|
|
360
|
-
if (value === undefined)
|
|
361
|
-
return null;
|
|
362
|
-
// --- Prepare the node with the value
|
|
363
|
-
const valueNode = {
|
|
364
|
-
type: "UemlElement",
|
|
365
|
-
name: nodeName,
|
|
366
|
-
};
|
|
367
|
-
if (name) {
|
|
368
|
-
valueNode.attributes = [
|
|
369
|
-
{
|
|
370
|
-
type: "UemlAttribute",
|
|
371
|
-
name: "name",
|
|
372
|
-
value: name,
|
|
373
|
-
},
|
|
374
|
-
];
|
|
375
|
-
}
|
|
376
|
-
// --- Extend the node according to the specified value
|
|
377
|
-
// --- Null value: we're done
|
|
378
|
-
if (value === null) {
|
|
379
|
-
return valueNode;
|
|
380
|
-
}
|
|
381
|
-
// --- Simple value: use text or value attribute
|
|
382
|
-
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
383
|
-
const strValue = typeof value === "string" ? value.toString() : `{${value.toString()}}`;
|
|
384
|
-
const preserveSpaces = attrBreakRegex.test(strValue) || strValue.trim().length != strValue.length;
|
|
385
|
-
if (options === null || options === void 0 ? void 0 : options.preferTextToValue) {
|
|
386
|
-
valueNode.text = strValue;
|
|
387
|
-
valueNode.preserveSpaces = preserveSpaces;
|
|
388
|
-
}
|
|
389
|
-
else {
|
|
390
|
-
(_a = valueNode.attributes) !== null && _a !== void 0 ? _a : (valueNode.attributes = []);
|
|
391
|
-
valueNode.attributes.push({
|
|
392
|
-
type: "UemlAttribute",
|
|
393
|
-
name: "value",
|
|
394
|
-
value: strValue,
|
|
395
|
-
preserveSpaces,
|
|
396
|
-
});
|
|
397
|
-
}
|
|
398
|
-
return valueNode;
|
|
399
|
-
}
|
|
400
|
-
// --- Array value
|
|
401
|
-
if (Array.isArray(value)) {
|
|
402
|
-
if (value.length === 0) {
|
|
403
|
-
// --- Empty array
|
|
404
|
-
(_b = valueNode.attributes) !== null && _b !== void 0 ? _b : (valueNode.attributes = []);
|
|
405
|
-
valueNode.attributes.push({
|
|
406
|
-
type: "UemlAttribute",
|
|
407
|
-
name: "value",
|
|
408
|
-
value: "{[]}",
|
|
409
|
-
});
|
|
410
|
-
}
|
|
411
|
-
else {
|
|
412
|
-
value.forEach((item) => {
|
|
413
|
-
var _a;
|
|
414
|
-
const itemElement = this.transformValue("item", undefined, item, options);
|
|
415
|
-
if (!itemElement)
|
|
416
|
-
return;
|
|
417
|
-
(_a = valueNode.childNodes) !== null && _a !== void 0 ? _a : (valueNode.childNodes = []);
|
|
418
|
-
valueNode.childNodes.push(itemElement);
|
|
419
|
-
});
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
else if (typeof value === "object") {
|
|
423
|
-
const keys = Object.keys(value);
|
|
424
|
-
if (keys.length === 0) {
|
|
425
|
-
// --- Empty object
|
|
426
|
-
(_c = valueNode.attributes) !== null && _c !== void 0 ? _c : (valueNode.attributes = []);
|
|
427
|
-
valueNode.attributes.push({
|
|
428
|
-
type: "UemlAttribute",
|
|
429
|
-
name: "value",
|
|
430
|
-
value: "{{}}",
|
|
431
|
-
});
|
|
432
|
-
}
|
|
433
|
-
else {
|
|
434
|
-
keys.forEach((key) => {
|
|
435
|
-
var _a;
|
|
436
|
-
const fieldElement = this.transformValue("field", key, value[key], options);
|
|
437
|
-
if (!fieldElement)
|
|
438
|
-
return;
|
|
439
|
-
(_a = valueNode.childNodes) !== null && _a !== void 0 ? _a : (valueNode.childNodes = []);
|
|
440
|
-
valueNode.childNodes.push(fieldElement);
|
|
441
|
-
});
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
else {
|
|
445
|
-
throw new Error(`Cannot serialize '${typeof value}' value`);
|
|
446
|
-
}
|
|
447
|
-
return valueNode;
|
|
448
|
-
}
|
|
449
|
-
/**
|
|
450
|
-
* Transforms the specified simple component definition into an Xml node
|
|
451
|
-
* @param name Element name
|
|
452
|
-
* @param value Value to transform
|
|
453
|
-
* @param options Transformation options
|
|
454
|
-
*/
|
|
455
|
-
transformObjectValue(name, value, options) {
|
|
456
|
-
const componentNode = {
|
|
457
|
-
type: "UemlElement",
|
|
458
|
-
name: name,
|
|
459
|
-
};
|
|
460
|
-
if (value) {
|
|
461
|
-
Object.keys(value).forEach((key) => this.addProperty(componentNode, key, value[key], options));
|
|
462
|
-
}
|
|
463
|
-
return componentNode;
|
|
464
|
-
}
|
|
465
|
-
/**
|
|
466
|
-
* Add a property to the specified UEML element
|
|
467
|
-
* @param element XML element
|
|
468
|
-
* @param name Element name
|
|
469
|
-
* @param value Element value
|
|
470
|
-
* @param options Transformation options
|
|
471
|
-
*/
|
|
472
|
-
addProperty(element, name, value, options) {
|
|
473
|
-
var _a, _b, _c;
|
|
474
|
-
switch (typeof value) {
|
|
475
|
-
// --- We do not serialize undefined property values
|
|
476
|
-
case "undefined":
|
|
477
|
-
break;
|
|
478
|
-
case "string":
|
|
479
|
-
(_a = element.attributes) !== null && _a !== void 0 ? _a : (element.attributes = []);
|
|
480
|
-
element.attributes.push({
|
|
481
|
-
type: "UemlAttribute",
|
|
482
|
-
name,
|
|
483
|
-
value: value === null || value === void 0 ? void 0 : value.toString(),
|
|
484
|
-
preserveQuotes: (_b = options === null || options === void 0 ? void 0 : options.removeQuotes) !== null && _b !== void 0 ? _b : false,
|
|
485
|
-
preserveSpaces: attrBreakRegex.test(value.toString()),
|
|
486
|
-
});
|
|
487
|
-
break;
|
|
488
|
-
case "boolean":
|
|
489
|
-
case "number":
|
|
490
|
-
case "object":
|
|
491
|
-
const objElement = this.transformValue("prop", name, value, options);
|
|
492
|
-
if (objElement) {
|
|
493
|
-
(_c = element.childNodes) !== null && _c !== void 0 ? _c : (element.childNodes = []);
|
|
494
|
-
element.childNodes.push(objElement);
|
|
495
|
-
}
|
|
496
|
-
break;
|
|
497
|
-
default:
|
|
498
|
-
throw new Error(`'${typeof value}' transformation is not implemented yet`);
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
addComponentElement(element, component) {
|
|
502
|
-
var _a;
|
|
503
|
-
(_a = element.childNodes) !== null && _a !== void 0 ? _a : (element.childNodes = []);
|
|
504
|
-
const childDef = this.transformComponentDefinition(component);
|
|
505
|
-
if (Array.isArray(childDef)) {
|
|
506
|
-
element.childNodes.push(...childDef);
|
|
507
|
-
}
|
|
508
|
-
else {
|
|
509
|
-
element.childNodes.push(childDef);
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
/**
|
|
513
|
-
* Adds a list to the specified XML element
|
|
514
|
-
* @param element XML element
|
|
515
|
-
* @param name Name of the list (child in `element`)
|
|
516
|
-
* @param prefix Prefix to use for the list
|
|
517
|
-
* @param list List with items
|
|
518
|
-
* @param options Transformation options
|
|
519
|
-
*/
|
|
520
|
-
addList(element, name, prefix, list, options) {
|
|
521
|
-
var _a;
|
|
522
|
-
const nodeName = `${prefix ? prefix + "." : ""}${name}`;
|
|
523
|
-
(_a = element.childNodes) !== null && _a !== void 0 ? _a : (element.childNodes = []);
|
|
524
|
-
list.forEach((item) => {
|
|
525
|
-
if (typeof item === "string") {
|
|
526
|
-
// --- Special case, the item can be the text of an XML element
|
|
527
|
-
element.childNodes.push({
|
|
528
|
-
type: "UemlElement",
|
|
529
|
-
name: nodeName,
|
|
530
|
-
text: item,
|
|
531
|
-
preserveSpaces: attrBreakRegex.test(item) || item !== item.trim() || item === "",
|
|
532
|
-
});
|
|
533
|
-
}
|
|
534
|
-
else if (item === null) {
|
|
535
|
-
element.childNodes.push({
|
|
536
|
-
type: "UemlElement",
|
|
537
|
-
name: nodeName,
|
|
538
|
-
});
|
|
539
|
-
}
|
|
540
|
-
else {
|
|
541
|
-
const transformed = this.transformObjectValue(nodeName, item, options);
|
|
542
|
-
if (Array.isArray(transformed)) {
|
|
543
|
-
element.childNodes.push(...transformed);
|
|
544
|
-
}
|
|
545
|
-
else {
|
|
546
|
-
element.childNodes.push(transformed);
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
});
|
|
550
|
-
}
|
|
551
|
-
/**
|
|
552
|
-
* Adds a component list to the specified element
|
|
553
|
-
* @param element XML element
|
|
554
|
-
* @param name Name to use for the wrapper element
|
|
555
|
-
* @param list List with component items
|
|
556
|
-
* @private
|
|
557
|
-
*/
|
|
558
|
-
addComponentList(element, name, list) {
|
|
559
|
-
var _a;
|
|
560
|
-
const children = [];
|
|
561
|
-
list.forEach((item) => {
|
|
562
|
-
const fragment = this.transformSimpleComponentDefinition(item);
|
|
563
|
-
if (Array.isArray(fragment)) {
|
|
564
|
-
children.push(...fragment);
|
|
565
|
-
}
|
|
566
|
-
else {
|
|
567
|
-
children.push(fragment);
|
|
568
|
-
}
|
|
569
|
-
});
|
|
570
|
-
const listElement = {
|
|
571
|
-
type: "UemlElement",
|
|
572
|
-
name,
|
|
573
|
-
childNodes: children,
|
|
574
|
-
};
|
|
575
|
-
(_a = element.childNodes) !== null && _a !== void 0 ? _a : (element.childNodes = []);
|
|
576
|
-
element.childNodes.push(listElement);
|
|
577
|
-
}
|
|
578
|
-
}
|
|
579
|
-
exports.UemlHelper = UemlHelper;
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UemlInputStream = void 0;
|
|
4
|
-
// This class represents the input stream of the UEML parser
|
|
5
|
-
class UemlInputStream {
|
|
6
|
-
// Creates a stream that uses the specified source code
|
|
7
|
-
constructor(source) {
|
|
8
|
-
this.source = source;
|
|
9
|
-
// --- Current stream position
|
|
10
|
-
this._pos = 0;
|
|
11
|
-
// --- Current line number
|
|
12
|
-
this._line = 1;
|
|
13
|
-
// --- Current column number
|
|
14
|
-
this._column = 0;
|
|
15
|
-
}
|
|
16
|
-
// Gets the current position in the stream. Starts from 0.
|
|
17
|
-
get position() {
|
|
18
|
-
return this._pos;
|
|
19
|
-
}
|
|
20
|
-
// Gets the current line number. Starts from 1.
|
|
21
|
-
get line() {
|
|
22
|
-
return this._line;
|
|
23
|
-
}
|
|
24
|
-
// Gets the current column number. Starts from 0.
|
|
25
|
-
get column() {
|
|
26
|
-
return this._column;
|
|
27
|
-
}
|
|
28
|
-
// Peeks the next character in the stream. Returns null, if EOF; otherwise the current source code character
|
|
29
|
-
peek() {
|
|
30
|
-
return this.ahead(0);
|
|
31
|
-
}
|
|
32
|
-
// Looks ahead with `n` characters in the stream. Returns null, if EOF; otherwise the look-ahead character
|
|
33
|
-
ahead(n = 1) {
|
|
34
|
-
return this._pos + n > this.source.length - 1 ? null : this.source[this._pos + n];
|
|
35
|
-
}
|
|
36
|
-
// Gets the next character from the stream
|
|
37
|
-
get() {
|
|
38
|
-
// --- Check for EOF
|
|
39
|
-
if (this._pos >= this.source.length) {
|
|
40
|
-
return null;
|
|
41
|
-
}
|
|
42
|
-
// --- Get the char, and keep track of position
|
|
43
|
-
const ch = this.source[this._pos++];
|
|
44
|
-
if (ch === "\n") {
|
|
45
|
-
this._line++;
|
|
46
|
-
this._column = 0;
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
this._column++;
|
|
50
|
-
}
|
|
51
|
-
return ch;
|
|
52
|
-
}
|
|
53
|
-
// Gets the tail of the input stream
|
|
54
|
-
getTail(start) {
|
|
55
|
-
var _a, _b;
|
|
56
|
-
return (_b = (_a = this.source) === null || _a === void 0 ? void 0 : _a.substring(start)) !== null && _b !== void 0 ? _b : "";
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
exports.UemlInputStream = UemlInputStream;
|