This is page 135 of 175. Use http://codebase.md/xmlui-org/xmlui?lines=true&page={x} to view the full context. # Directory Structure ``` ├── .changeset │ ├── cold-items-taste.md │ ├── config.json │ ├── empty-spiders-dress.md │ ├── shy-windows-allow.md │ ├── sour-coins-read.md │ ├── tame-zebras-invite.md │ ├── twenty-jeans-watch.md │ └── warm-spies-melt.md ├── .eslintrc.cjs ├── .github │ ├── build-checklist.png │ ├── ISSUE_TEMPLATE │ │ ├── bug_report.md │ │ └── feature_request.md │ └── workflows │ ├── deploy-docs-optimized.yml │ ├── deploy-docs.yml │ ├── prepare-versions.yml │ ├── release-packages.yml │ ├── run-all-tests.yml │ └── run-smoke-tests.yml ├── .gitignore ├── .prettierrc.js ├── .vscode │ ├── launch.json │ └── settings.json ├── blog │ ├── .gitignore │ ├── .gitkeep │ ├── CHANGELOG.md │ ├── extensions.ts │ ├── index.html │ ├── index.ts │ ├── package.json │ ├── public │ │ ├── blog │ │ │ ├── images │ │ │ │ ├── blog-page-component.png │ │ │ │ ├── blog-scrabble.png │ │ │ │ ├── integrated-blog-search.png │ │ │ │ └── lorem-ipsum.png │ │ │ ├── lorem-ipsum.md │ │ │ ├── newest-post.md │ │ │ ├── older-post.md │ │ │ └── welcome-to-the-xmlui-blog.md │ │ ├── mockServiceWorker.js │ │ ├── resources │ │ │ ├── favicon.ico │ │ │ ├── files │ │ │ │ └── for-download │ │ │ │ └── xmlui │ │ │ │ └── xmlui-standalone.umd.js │ │ │ ├── github.svg │ │ │ ├── llms.txt │ │ │ ├── logo-dark.svg │ │ │ ├── logo.svg │ │ │ ├── pg-popout.svg │ │ │ └── xmlui-logo.svg │ │ ├── serve.json │ │ └── web.config │ ├── scripts │ │ ├── download-latest-xmlui.js │ │ ├── generate-rss.js │ │ ├── get-releases.js │ │ └── utils.js │ ├── src │ │ ├── components │ │ │ ├── BlogOverview.xmlui │ │ │ ├── BlogPage.xmlui │ │ │ └── PageNotFound.xmlui │ │ ├── config.ts │ │ ├── Main.xmlui │ │ └── themes │ │ ├── docs-theme.ts │ │ ├── earthtone.ts │ │ ├── xmlui-gray-on-default.ts │ │ ├── xmlui-green-on-default.ts │ │ └── xmlui-orange-on-default.ts │ └── tsconfig.json ├── CONTRIBUTING.md ├── docs │ ├── .gitignore │ ├── CHANGELOG.md │ ├── ComponentRefLinks.txt │ ├── content │ │ ├── _meta.json │ │ ├── components │ │ │ ├── _meta.json │ │ │ ├── _overview.md │ │ │ ├── APICall.md │ │ │ ├── App.md │ │ │ ├── AppHeader.md │ │ │ ├── AppState.md │ │ │ ├── AutoComplete.md │ │ │ ├── Avatar.md │ │ │ ├── Backdrop.md │ │ │ ├── Badge.md │ │ │ ├── BarChart.md │ │ │ ├── Bookmark.md │ │ │ ├── Breakout.md │ │ │ ├── Button.md │ │ │ ├── Card.md │ │ │ ├── Carousel.md │ │ │ ├── ChangeListener.md │ │ │ ├── Checkbox.md │ │ │ ├── CHStack.md │ │ │ ├── ColorPicker.md │ │ │ ├── Column.md │ │ │ ├── ContentSeparator.md │ │ │ ├── CVStack.md │ │ │ ├── DataSource.md │ │ │ ├── DateInput.md │ │ │ ├── DatePicker.md │ │ │ ├── DonutChart.md │ │ │ ├── DropdownMenu.md │ │ │ ├── EmojiSelector.md │ │ │ ├── ExpandableItem.md │ │ │ ├── FileInput.md │ │ │ ├── FileUploadDropZone.md │ │ │ ├── FlowLayout.md │ │ │ ├── Footer.md │ │ │ ├── Form.md │ │ │ ├── FormItem.md │ │ │ ├── FormSection.md │ │ │ ├── Fragment.md │ │ │ ├── H1.md │ │ │ ├── H2.md │ │ │ ├── H3.md │ │ │ ├── H4.md │ │ │ ├── H5.md │ │ │ ├── H6.md │ │ │ ├── Heading.md │ │ │ ├── HSplitter.md │ │ │ ├── HStack.md │ │ │ ├── Icon.md │ │ │ ├── IFrame.md │ │ │ ├── Image.md │ │ │ ├── Items.md │ │ │ ├── LabelList.md │ │ │ ├── Legend.md │ │ │ ├── LineChart.md │ │ │ ├── Link.md │ │ │ ├── List.md │ │ │ ├── Logo.md │ │ │ ├── Markdown.md │ │ │ ├── MenuItem.md │ │ │ ├── MenuSeparator.md │ │ │ ├── ModalDialog.md │ │ │ ├── NavGroup.md │ │ │ ├── NavLink.md │ │ │ ├── NavPanel.md │ │ │ ├── NoResult.md │ │ │ ├── NumberBox.md │ │ │ ├── Option.md │ │ │ ├── Page.md │ │ │ ├── PageMetaTitle.md │ │ │ ├── Pages.md │ │ │ ├── Pagination.md │ │ │ ├── PasswordInput.md │ │ │ ├── PieChart.md │ │ │ ├── ProgressBar.md │ │ │ ├── Queue.md │ │ │ ├── RadioGroup.md │ │ │ ├── RealTimeAdapter.md │ │ │ ├── Redirect.md │ │ │ ├── Select.md │ │ │ ├── Slider.md │ │ │ ├── Slot.md │ │ │ ├── SpaceFiller.md │ │ │ ├── Spinner.md │ │ │ ├── Splitter.md │ │ │ ├── Stack.md │ │ │ ├── StickyBox.md │ │ │ ├── SubMenuItem.md │ │ │ ├── Switch.md │ │ │ ├── TabItem.md │ │ │ ├── Table.md │ │ │ ├── TableOfContents.md │ │ │ ├── Tabs.md │ │ │ ├── Text.md │ │ │ ├── TextArea.md │ │ │ ├── TextBox.md │ │ │ ├── Theme.md │ │ │ ├── TimeInput.md │ │ │ ├── Timer.md │ │ │ ├── ToneChangerButton.md │ │ │ ├── ToneSwitch.md │ │ │ ├── Tooltip.md │ │ │ ├── Tree.md │ │ │ ├── VSplitter.md │ │ │ ├── VStack.md │ │ │ ├── xmlui-animations │ │ │ │ ├── _meta.json │ │ │ │ ├── _overview.md │ │ │ │ ├── Animation.md │ │ │ │ ├── FadeAnimation.md │ │ │ │ ├── FadeInAnimation.md │ │ │ │ ├── FadeOutAnimation.md │ │ │ │ ├── ScaleAnimation.md │ │ │ │ └── SlideInAnimation.md │ │ │ ├── xmlui-pdf │ │ │ │ ├── _meta.json │ │ │ │ ├── _overview.md │ │ │ │ └── Pdf.md │ │ │ ├── xmlui-spreadsheet │ │ │ │ ├── _meta.json │ │ │ │ ├── _overview.md │ │ │ │ └── Spreadsheet.md │ │ │ └── xmlui-website-blocks │ │ │ ├── _meta.json │ │ │ ├── _overview.md │ │ │ ├── Carousel.md │ │ │ ├── HelloMd.md │ │ │ ├── HeroSection.md │ │ │ └── ScrollToTop.md │ │ └── extensions │ │ ├── _meta.json │ │ ├── xmlui-animations │ │ │ ├── _meta.json │ │ │ ├── _overview.md │ │ │ ├── Animation.md │ │ │ ├── FadeAnimation.md │ │ │ ├── FadeInAnimation.md │ │ │ ├── FadeOutAnimation.md │ │ │ ├── ScaleAnimation.md │ │ │ └── SlideInAnimation.md │ │ └── xmlui-website-blocks │ │ ├── _meta.json │ │ ├── _overview.md │ │ ├── Carousel.md │ │ ├── HelloMd.md │ │ ├── HeroSection.md │ │ └── ScrollToTop.md │ ├── extensions.ts │ ├── index.html │ ├── index.ts │ ├── package.json │ ├── public │ │ ├── feed.rss │ │ ├── mockServiceWorker.js │ │ ├── pages │ │ │ ├── _meta.json │ │ │ ├── app-structure.md │ │ │ ├── build-editor-component.md │ │ │ ├── build-hello-world-component.md │ │ │ ├── components-intro.md │ │ │ ├── context-variables.md │ │ │ ├── forms.md │ │ │ ├── globals.md │ │ │ ├── glossary.md │ │ │ ├── helper-tags.md │ │ │ ├── hosted-deployment.md │ │ │ ├── howto │ │ │ │ ├── assign-a-complex-json-literal-to-a-component-variable.md │ │ │ │ ├── chain-a-refetch.md │ │ │ │ ├── debug-a-component.md │ │ │ │ ├── delay-a-datasource-until-another-datasource-is-ready.md │ │ │ │ ├── delegate-a-method.md │ │ │ │ ├── do-custom-form-validation.md │ │ │ │ ├── expose-a-method-from-a-component.md │ │ │ │ ├── filter-and-transform-data-from-an-api.md │ │ │ │ ├── group-items-in-list-by-a-property.md │ │ │ │ ├── handle-background-operations.md │ │ │ │ ├── hide-an-element-until-its-datasource-is-ready.md │ │ │ │ ├── make-a-set-of-equal-width-cards.md │ │ │ │ ├── make-a-table-responsive.md │ │ │ │ ├── modify-a-value-reported-in-a-column.md │ │ │ │ ├── paginate-a-list.md │ │ │ │ ├── pass-data-to-a-modal-dialog.md │ │ │ │ ├── react-to-button-click-not-keystrokes.md │ │ │ │ ├── set-the-initial-value-of-a-select-from-fetched-data.md │ │ │ │ ├── share-a-modaldialog-across-components.md │ │ │ │ ├── sync-selections-between-table-and-list-views.md │ │ │ │ ├── update-ui-optimistically.md │ │ │ │ ├── use-built-in-form-validation.md │ │ │ │ └── use-the-same-modaldialog-to-add-or-edit.md │ │ │ ├── howto.md │ │ │ ├── intro.md │ │ │ ├── layout.md │ │ │ ├── markup.md │ │ │ ├── mcp.md │ │ │ ├── modal-dialogs.md │ │ │ ├── news-and-reviews.md │ │ │ ├── reactive-intro.md │ │ │ ├── refactoring.md │ │ │ ├── routing-and-links.md │ │ │ ├── samples │ │ │ │ ├── color-palette.xmlui │ │ │ │ ├── color-values.xmlui │ │ │ │ ├── shadow-sizes.xmlui │ │ │ │ ├── spacing-sizes.xmlui │ │ │ │ ├── swatch.xmlui │ │ │ │ ├── theme-gallery-brief.xmlui │ │ │ │ └── theme-gallery.xmlui │ │ │ ├── scoping.md │ │ │ ├── scripting.md │ │ │ ├── styles-and-themes │ │ │ │ ├── common-units.md │ │ │ │ ├── layout-props.md │ │ │ │ ├── theme-variable-defaults.md │ │ │ │ ├── theme-variables.md │ │ │ │ └── themes.md │ │ │ ├── template-properties.md │ │ │ ├── test.md │ │ │ ├── tutorial-01.md │ │ │ ├── tutorial-02.md │ │ │ ├── tutorial-03.md │ │ │ ├── tutorial-04.md │ │ │ ├── tutorial-05.md │ │ │ ├── tutorial-06.md │ │ │ ├── tutorial-07.md │ │ │ ├── tutorial-08.md │ │ │ ├── tutorial-09.md │ │ │ ├── tutorial-10.md │ │ │ ├── tutorial-11.md │ │ │ ├── tutorial-12.md │ │ │ ├── universal-properties.md │ │ │ ├── user-defined-components.md │ │ │ ├── vscode.md │ │ │ ├── working-with-markdown.md │ │ │ ├── working-with-text.md │ │ │ ├── xmlui-animations │ │ │ │ ├── _meta.json │ │ │ │ ├── _overview.md │ │ │ │ ├── Animation.md │ │ │ │ ├── FadeAnimation.md │ │ │ │ ├── FadeInAnimation.md │ │ │ │ ├── FadeOutAnimation.md │ │ │ │ ├── ScaleAnimation.md │ │ │ │ └── SlideInAnimation.md │ │ │ ├── xmlui-charts │ │ │ │ ├── _meta.json │ │ │ │ ├── _overview.md │ │ │ │ ├── BarChart.md │ │ │ │ ├── DonutChart.md │ │ │ │ ├── LabelList.md │ │ │ │ ├── Legend.md │ │ │ │ ├── LineChart.md │ │ │ │ └── PieChart.md │ │ │ ├── xmlui-pdf │ │ │ │ ├── _meta.json │ │ │ │ ├── _overview.md │ │ │ │ └── Pdf.md │ │ │ └── xmlui-spreadsheet │ │ │ ├── _meta.json │ │ │ ├── _overview.md │ │ │ └── Spreadsheet.md │ │ ├── resources │ │ │ ├── devdocs │ │ │ │ ├── debug-proxy-object-2.png │ │ │ │ ├── debug-proxy-object.png │ │ │ │ ├── table_editor_01.png │ │ │ │ ├── table_editor_02.png │ │ │ │ ├── table_editor_03.png │ │ │ │ ├── table_editor_04.png │ │ │ │ ├── table_editor_05.png │ │ │ │ ├── table_editor_06.png │ │ │ │ ├── table_editor_07.png │ │ │ │ ├── table_editor_08.png │ │ │ │ ├── table_editor_09.png │ │ │ │ ├── table_editor_10.png │ │ │ │ ├── table_editor_11.png │ │ │ │ ├── table-editor-01.png │ │ │ │ ├── table-editor-02.png │ │ │ │ ├── table-editor-03.png │ │ │ │ ├── table-editor-04.png │ │ │ │ ├── table-editor-06.png │ │ │ │ ├── table-editor-07.png │ │ │ │ ├── table-editor-08.png │ │ │ │ ├── table-editor-09.png │ │ │ │ └── xmlui-rendering-of-tiptap-markdown.png │ │ │ ├── favicon.ico │ │ │ ├── files │ │ │ │ ├── clients.json │ │ │ │ ├── daily-revenue.json │ │ │ │ ├── dashboard-stats.json │ │ │ │ ├── demo.xmlui │ │ │ │ ├── demo.xmlui.xs │ │ │ │ ├── downloads │ │ │ │ │ └── downloads.json │ │ │ │ ├── for-download │ │ │ │ │ ├── index-with-api.html │ │ │ │ │ ├── index.html │ │ │ │ │ ├── mockApi.js │ │ │ │ │ ├── start-darwin.sh │ │ │ │ │ ├── start-linux.sh │ │ │ │ │ ├── start.bat │ │ │ │ │ └── xmlui │ │ │ │ │ └── xmlui-standalone.umd.js │ │ │ │ ├── getting-started │ │ │ │ │ ├── cl-tutorial-final.zip │ │ │ │ │ ├── cl-tutorial.zip │ │ │ │ │ ├── cl-tutorial2.zip │ │ │ │ │ ├── cl-tutorial3.zip │ │ │ │ │ ├── cl-tutorial4.zip │ │ │ │ │ ├── cl-tutorial5.zip │ │ │ │ │ ├── cl-tutorial6.zip │ │ │ │ │ ├── getting-started.zip │ │ │ │ │ ├── hello-xmlui.zip │ │ │ │ │ ├── xmlui-empty.zip │ │ │ │ │ └── xmlui-starter.zip │ │ │ │ ├── howto │ │ │ │ │ └── component-icons │ │ │ │ │ └── up-arrow.svg │ │ │ │ ├── invoices.json │ │ │ │ ├── monthly-status.json │ │ │ │ ├── news-and-reviews.json │ │ │ │ ├── products.json │ │ │ │ ├── releases.json │ │ │ │ ├── tutorials │ │ │ │ │ ├── datasource │ │ │ │ │ │ └── api.ts │ │ │ │ │ └── p2do │ │ │ │ │ ├── api.ts │ │ │ │ │ └── todo-logo.svg │ │ │ │ └── xmlui.json │ │ │ ├── github.svg │ │ │ ├── images │ │ │ │ ├── apiaction-tutorial │ │ │ │ │ ├── add-success.png │ │ │ │ │ ├── apiaction-param.png │ │ │ │ │ ├── change-completed.png │ │ │ │ │ ├── change-in-progress.png │ │ │ │ │ ├── confirm-delete.png │ │ │ │ │ ├── data-error.png │ │ │ │ │ ├── data-progress.png │ │ │ │ │ ├── data-success.png │ │ │ │ │ ├── display-1.png │ │ │ │ │ ├── item-deleted.png │ │ │ │ │ ├── item-updated.png │ │ │ │ │ ├── missing-api-key.png │ │ │ │ │ ├── new-item-added.png │ │ │ │ │ └── test-message.png │ │ │ │ ├── chat-api │ │ │ │ │ └── domain-model.svg │ │ │ │ ├── components │ │ │ │ │ ├── image │ │ │ │ │ │ └── breakfast.jpg │ │ │ │ │ ├── markdown │ │ │ │ │ │ └── colors.png │ │ │ │ │ └── modal │ │ │ │ │ ├── deep_link_dialog_1.jpg │ │ │ │ │ └── deep_link_dialog_2.jpg │ │ │ │ ├── create-apps │ │ │ │ │ ├── collapsed-vertical.png │ │ │ │ │ ├── using-forms-warning-dialog.png │ │ │ │ │ └── using-forms.png │ │ │ │ ├── datasource-tutorial │ │ │ │ │ ├── data-with-header.png │ │ │ │ │ ├── filtered-data.png │ │ │ │ │ ├── filtered-items.png │ │ │ │ │ ├── initial-page-items.png │ │ │ │ │ ├── list-items.png │ │ │ │ │ ├── next-page-items.png │ │ │ │ │ ├── no-data.png │ │ │ │ │ ├── pagination-1.jpg │ │ │ │ │ ├── pagination-1.png │ │ │ │ │ ├── polling-1.png │ │ │ │ │ ├── refetch-data.png │ │ │ │ │ ├── slow-loading.png │ │ │ │ │ ├── test-message.png │ │ │ │ │ ├── Thumbs.db │ │ │ │ │ ├── unconventional-data.png │ │ │ │ │ └── unfiltered-items.png │ │ │ │ ├── flower.jpg │ │ │ │ ├── get-started │ │ │ │ │ ├── add-new-contact.png │ │ │ │ │ ├── app-modified.png │ │ │ │ │ ├── app-start.png │ │ │ │ │ ├── app-with-boxes.png │ │ │ │ │ ├── app-with-toast.png │ │ │ │ │ ├── boilerplate-structure.png │ │ │ │ │ ├── cl-initial.png │ │ │ │ │ ├── cl-start.png │ │ │ │ │ ├── contact-counts.png │ │ │ │ │ ├── contact-dialog-title.png │ │ │ │ │ ├── contact-dialog.png │ │ │ │ │ ├── contact-menus.png │ │ │ │ │ ├── contact-predicates.png │ │ │ │ │ ├── context-menu.png │ │ │ │ │ ├── dashboard-numbers.png │ │ │ │ │ ├── default-contact-list.png │ │ │ │ │ ├── delete-contact.png │ │ │ │ │ ├── delete-task.png │ │ │ │ │ ├── detailed-template.png │ │ │ │ │ ├── edit-contact-details.png │ │ │ │ │ ├── edited-contact-saved.png │ │ │ │ │ ├── empty-sections.png │ │ │ │ │ ├── filter-completed.png │ │ │ │ │ ├── fullwidth-desktop.png │ │ │ │ │ ├── fullwidth-mobile.png │ │ │ │ │ ├── initial-table.png │ │ │ │ │ ├── items-and-badges.png │ │ │ │ │ ├── loading-message.png │ │ │ │ │ ├── new-contact-button.png │ │ │ │ │ ├── new-contact-saved.png │ │ │ │ │ ├── no-empty-sections.png │ │ │ │ │ ├── personal-todo-initial.png │ │ │ │ │ ├── piechart.png │ │ │ │ │ ├── review-today.png │ │ │ │ │ ├── rudimentary-dashboard.png │ │ │ │ │ ├── section-collapsed.png │ │ │ │ │ ├── sectioned-items.png │ │ │ │ │ ├── sections-ordered.png │ │ │ │ │ ├── spacex-list-with-links.png │ │ │ │ │ ├── spacex-list.png │ │ │ │ │ ├── start-personal-todo-1.png │ │ │ │ │ ├── submit-new-contact.png │ │ │ │ │ ├── submit-new-task.png │ │ │ │ │ ├── syntax-highlighting.png │ │ │ │ │ ├── table-with-badge.png │ │ │ │ │ ├── template-with-card.png │ │ │ │ │ ├── test-emulated-api.png │ │ │ │ │ ├── Thumbs.db │ │ │ │ │ ├── todo-logo.png │ │ │ │ │ └── xmlui-tools.png │ │ │ │ ├── HelloApp.png │ │ │ │ ├── HelloApp2.png │ │ │ │ ├── logos │ │ │ │ │ ├── xmlui1.svg │ │ │ │ │ ├── xmlui2.svg │ │ │ │ │ ├── xmlui3.svg │ │ │ │ │ ├── xmlui4.svg │ │ │ │ │ ├── xmlui5.svg │ │ │ │ │ ├── xmlui6.svg │ │ │ │ │ └── xmlui7.svg │ │ │ │ ├── pdf │ │ │ │ │ └── dummy-pdf.jpg │ │ │ │ ├── rendering-engine │ │ │ │ │ ├── AppEngine-flow.svg │ │ │ │ │ ├── Component.svg │ │ │ │ │ ├── CompoundComponent.svg │ │ │ │ │ ├── RootComponent.svg │ │ │ │ │ └── tree-with-containers.svg │ │ │ │ ├── reviewers-guide │ │ │ │ │ ├── AppEngine-flow.svg │ │ │ │ │ └── incbutton-in-action.png │ │ │ │ ├── tools │ │ │ │ │ └── boilerplate-structure.png │ │ │ │ ├── try.svg │ │ │ │ ├── tutorial │ │ │ │ │ ├── app-chat-history.png │ │ │ │ │ ├── app-content-placeholder.png │ │ │ │ │ ├── app-header-and-content.png │ │ │ │ │ ├── app-links-channel-selected.png │ │ │ │ │ ├── app-links-click.png │ │ │ │ │ ├── app-navigation.png │ │ │ │ │ ├── finished-ex01.png │ │ │ │ │ ├── finished-ex02.png │ │ │ │ │ ├── hello.png │ │ │ │ │ ├── splash-screen-advanced.png │ │ │ │ │ ├── splash-screen-after-click.png │ │ │ │ │ ├── splash-screen-centered.png │ │ │ │ │ ├── splash-screen-events.png │ │ │ │ │ ├── splash-screen-expression.png │ │ │ │ │ ├── splash-screen-reuse-after.png │ │ │ │ │ ├── splash-screen-reuse-before.png │ │ │ │ │ └── splash-screen.png │ │ │ │ └── tutorial-01.png │ │ │ ├── llms.txt │ │ │ ├── logo-dark.svg │ │ │ ├── logo.svg │ │ │ ├── pg-popout.svg │ │ │ └── xmlui-logo.svg │ │ ├── serve.json │ │ └── web.config │ ├── scripts │ │ ├── download-latest-xmlui.js │ │ ├── generate-rss.js │ │ ├── get-releases.js │ │ └── utils.js │ ├── src │ │ ├── components │ │ │ ├── BlogOverview.xmlui │ │ │ ├── BlogPage.xmlui │ │ │ ├── Boxes.xmlui │ │ │ ├── Breadcrumb.xmlui │ │ │ ├── ChangeLog.xmlui │ │ │ ├── ColorPalette.xmlui │ │ │ ├── DocumentLinks.xmlui │ │ │ ├── DocumentPage.xmlui │ │ │ ├── DocumentPageNoTOC.xmlui │ │ │ ├── Icons.xmlui │ │ │ ├── IncButton.xmlui │ │ │ ├── IncButton2.xmlui │ │ │ ├── NameValue.xmlui │ │ │ ├── PageNotFound.xmlui │ │ │ ├── PaletteItem.xmlui │ │ │ ├── Palettes.xmlui │ │ │ ├── SectionHeader.xmlui │ │ │ ├── TBD.xmlui │ │ │ ├── Test.xmlui │ │ │ ├── ThemesIntro.xmlui │ │ │ ├── ThousandThemes.xmlui │ │ │ ├── TubeStops.xmlui │ │ │ ├── TubeStops.xmlui.xs │ │ │ └── TwoColumnCode.xmlui │ │ ├── config.ts │ │ ├── Main.xmlui │ │ └── themes │ │ ├── docs-theme.ts │ │ ├── earthtone.ts │ │ ├── xmlui-gray-on-default.ts │ │ ├── xmlui-green-on-default.ts │ │ └── xmlui-orange-on-default.ts │ └── tsconfig.json ├── LICENSE ├── package-lock.json ├── package.json ├── packages │ ├── xmlui-animations │ │ ├── .gitignore │ │ ├── CHANGELOG.md │ │ ├── demo │ │ │ └── Main.xmlui │ │ ├── index.html │ │ ├── index.ts │ │ ├── meta │ │ │ └── componentsMetadata.ts │ │ ├── package.json │ │ ├── src │ │ │ ├── Animation.tsx │ │ │ ├── AnimationNative.tsx │ │ │ ├── FadeAnimation.tsx │ │ │ ├── FadeInAnimation.tsx │ │ │ ├── FadeOutAnimation.tsx │ │ │ ├── index.tsx │ │ │ ├── ScaleAnimation.tsx │ │ │ └── SlideInAnimation.tsx │ │ └── tsconfig.json │ ├── xmlui-devtools │ │ ├── .gitignore │ │ ├── CHANGELOG.md │ │ ├── demo │ │ │ └── Main.xmlui │ │ ├── index.html │ │ ├── index.ts │ │ ├── meta │ │ │ └── componentsMetadata.ts │ │ ├── package.json │ │ ├── src │ │ │ ├── devtools │ │ │ │ ├── DevTools.tsx │ │ │ │ ├── DevToolsNative.module.scss │ │ │ │ ├── DevToolsNative.tsx │ │ │ │ ├── ModalDialog.module.scss │ │ │ │ ├── ModalDialog.tsx │ │ │ │ ├── ModalVisibilityContext.tsx │ │ │ │ ├── Tooltip.module.scss │ │ │ │ ├── Tooltip.tsx │ │ │ │ └── utils.ts │ │ │ ├── editor │ │ │ │ └── Editor.tsx │ │ │ └── index.tsx │ │ ├── tsconfig.json │ │ └── vite.config-overrides.ts │ ├── xmlui-hello-world │ │ ├── .gitignore │ │ ├── index.ts │ │ ├── meta │ │ │ └── componentsMetadata.ts │ │ ├── package.json │ │ ├── src │ │ │ ├── HelloWorld.module.scss │ │ │ ├── HelloWorld.tsx │ │ │ ├── HelloWorldNative.tsx │ │ │ └── index.tsx │ │ └── tsconfig.json │ ├── xmlui-os-frames │ │ ├── .gitignore │ │ ├── demo │ │ │ └── Main.xmlui │ │ ├── index.html │ │ ├── index.ts │ │ ├── meta │ │ │ └── componentsMetadata.ts │ │ ├── package.json │ │ ├── src │ │ │ ├── index.tsx │ │ │ ├── IPhoneFrame.module.scss │ │ │ ├── IPhoneFrame.tsx │ │ │ ├── MacOSAppFrame.module.scss │ │ │ ├── MacOSAppFrame.tsx │ │ │ ├── WindowsAppFrame.module.scss │ │ │ └── WindowsAppFrame.tsx │ │ └── tsconfig.json │ ├── xmlui-pdf │ │ ├── .gitignore │ │ ├── CHANGELOG.md │ │ ├── demo │ │ │ ├── components │ │ │ │ └── Pdf.xmlui │ │ │ └── Main.xmlui │ │ ├── index.html │ │ ├── index.ts │ │ ├── meta │ │ │ └── componentsMetadata.ts │ │ ├── package.json │ │ ├── src │ │ │ ├── index.tsx │ │ │ ├── LazyPdfNative.tsx │ │ │ ├── Pdf.module.scss │ │ │ └── Pdf.tsx │ │ └── tsconfig.json │ ├── xmlui-playground │ │ ├── .gitignore │ │ ├── CHANGELOG.md │ │ ├── demo │ │ │ └── Main.xmlui │ │ ├── index.html │ │ ├── index.ts │ │ ├── meta │ │ │ └── componentsMetadata.ts │ │ ├── package.json │ │ ├── src │ │ │ ├── hooks │ │ │ │ ├── usePlayground.ts │ │ │ │ └── useToast.ts │ │ │ ├── index.tsx │ │ │ ├── playground │ │ │ │ ├── Box.module.scss │ │ │ │ ├── Box.tsx │ │ │ │ ├── CodeSelector.tsx │ │ │ │ ├── ConfirmationDialog.module.scss │ │ │ │ ├── ConfirmationDialog.tsx │ │ │ │ ├── Editor.tsx │ │ │ │ ├── Header.module.scss │ │ │ │ ├── Header.tsx │ │ │ │ ├── Playground.tsx │ │ │ │ ├── PlaygroundContent.module.scss │ │ │ │ ├── PlaygroundContent.tsx │ │ │ │ ├── PlaygroundNative.module.scss │ │ │ │ ├── PlaygroundNative.tsx │ │ │ │ ├── Preview.module.scss │ │ │ │ ├── Preview.tsx │ │ │ │ ├── Select.module.scss │ │ │ │ ├── StandalonePlayground.tsx │ │ │ │ ├── StandalonePlaygroundNative.module.scss │ │ │ │ ├── StandalonePlaygroundNative.tsx │ │ │ │ ├── ThemeSwitcher.module.scss │ │ │ │ ├── ThemeSwitcher.tsx │ │ │ │ ├── ToneSwitcher.tsx │ │ │ │ ├── Tooltip.module.scss │ │ │ │ ├── Tooltip.tsx │ │ │ │ └── utils.ts │ │ │ ├── providers │ │ │ │ ├── Toast.module.scss │ │ │ │ └── ToastProvider.tsx │ │ │ ├── state │ │ │ │ └── store.ts │ │ │ ├── themes │ │ │ │ └── theme.ts │ │ │ └── utils │ │ │ └── helpers.ts │ │ └── tsconfig.json │ ├── xmlui-search │ │ ├── .gitignore │ │ ├── CHANGELOG.md │ │ ├── demo │ │ │ └── Main.xmlui │ │ ├── index.html │ │ ├── index.ts │ │ ├── meta │ │ │ └── componentsMetadata.ts │ │ ├── package.json │ │ ├── src │ │ │ ├── index.tsx │ │ │ ├── Search.module.scss │ │ │ └── Search.tsx │ │ └── tsconfig.json │ ├── xmlui-spreadsheet │ │ ├── .gitignore │ │ ├── demo │ │ │ └── Main.xmlui │ │ ├── index.html │ │ ├── index.ts │ │ ├── meta │ │ │ └── componentsMetadata.ts │ │ ├── package.json │ │ ├── src │ │ │ ├── index.tsx │ │ │ ├── Spreadsheet.tsx │ │ │ └── SpreadsheetNative.tsx │ │ └── tsconfig.json │ └── xmlui-website-blocks │ ├── .gitignore │ ├── CHANGELOG.md │ ├── demo │ │ ├── components │ │ │ ├── HeroBackgroundBreakoutPage.xmlui │ │ │ ├── HeroBackgroundsPage.xmlui │ │ │ ├── HeroContentsPage.xmlui │ │ │ ├── HeroTextAlignPage.xmlui │ │ │ ├── HeroTextPage.xmlui │ │ │ └── HeroTonesPage.xmlui │ │ ├── Main.xmlui │ │ └── themes │ │ └── default.ts │ ├── index.html │ ├── index.ts │ ├── meta │ │ └── componentsMetadata.ts │ ├── package.json │ ├── public │ │ └── resources │ │ ├── building.jpg │ │ └── xmlui-logo.svg │ ├── src │ │ ├── Carousel │ │ │ ├── Carousel.module.scss │ │ │ ├── Carousel.tsx │ │ │ ├── CarouselContext.tsx │ │ │ └── CarouselNative.tsx │ │ ├── FancyButton │ │ │ ├── FancyButton.module.scss │ │ │ ├── FancyButton.tsx │ │ │ └── FancyButton.xmlui │ │ ├── Hello │ │ │ ├── Hello.tsx │ │ │ ├── Hello.xmlui │ │ │ └── Hello.xmlui.xs │ │ ├── HeroSection │ │ │ ├── HeroSection.module.scss │ │ │ ├── HeroSection.tsx │ │ │ └── HeroSectionNative.tsx │ │ ├── index.tsx │ │ ├── ScrollToTop │ │ │ ├── ScrollToTop.module.scss │ │ │ ├── ScrollToTop.tsx │ │ │ └── ScrollToTopNative.tsx │ │ └── vite-env.d.ts │ └── tsconfig.json ├── README.md ├── tools │ ├── codefence │ │ └── xmlui-code-fence-docs.md │ ├── create-app │ │ ├── .gitignore │ │ ├── CHANGELOG.md │ │ ├── create-app.ts │ │ ├── helpers │ │ │ ├── copy.ts │ │ │ ├── get-pkg-manager.ts │ │ │ ├── git.ts │ │ │ ├── install.ts │ │ │ ├── is-folder-empty.ts │ │ │ ├── is-writeable.ts │ │ │ ├── make-dir.ts │ │ │ └── validate-pkg.ts │ │ ├── index.ts │ │ ├── package.json │ │ ├── templates │ │ │ ├── default │ │ │ │ └── ts │ │ │ │ ├── gitignore │ │ │ │ ├── index.html │ │ │ │ ├── index.ts │ │ │ │ ├── public │ │ │ │ │ ├── mockServiceWorker.js │ │ │ │ │ ├── resources │ │ │ │ │ │ ├── favicon.ico │ │ │ │ │ │ └── xmlui-logo.svg │ │ │ │ │ └── serve.json │ │ │ │ └── src │ │ │ │ ├── components │ │ │ │ │ ├── ApiAware.xmlui │ │ │ │ │ ├── Home.xmlui │ │ │ │ │ ├── IncButton.xmlui │ │ │ │ │ └── PagePanel.xmlui │ │ │ │ ├── config.ts │ │ │ │ └── Main.xmlui │ │ │ ├── index.ts │ │ │ └── types.ts │ │ └── tsconfig.json │ ├── create-xmlui-hello-world │ │ ├── index.js │ │ └── package.json │ └── vscode │ ├── .gitignore │ ├── .vscode │ │ ├── launch.json │ │ └── tasks.json │ ├── .vscodeignore │ ├── build.sh │ ├── CHANGELOG.md │ ├── esbuild.js │ ├── eslint.config.mjs │ ├── formatter-docs.md │ ├── generate-test-sample.sh │ ├── LICENSE.md │ ├── package-lock.json │ ├── package.json │ ├── README.md │ ├── resources │ │ ├── xmlui-logo.png │ │ └── xmlui-markup-syntax-highlighting.png │ ├── src │ │ ├── extension.ts │ │ └── server.ts │ ├── syntaxes │ │ └── xmlui.tmLanguage.json │ ├── test-samples │ │ └── sample.xmlui │ ├── tsconfig.json │ └── tsconfig.tsbuildinfo ├── turbo.json └── xmlui ├── .gitignore ├── bin │ ├── bootstrap.js │ ├── build-lib.ts │ ├── build.ts │ ├── index.ts │ ├── preview.ts │ ├── start.ts │ ├── vite-xmlui-plugin.ts │ └── viteConfig.ts ├── CHANGELOG.md ├── conventions │ ├── component-qa-checklist.md │ ├── copilot-conventions.md │ ├── create-xmlui-components.md │ └── testing-conventions.md ├── dev-docs │ ├── accessibility.md │ ├── actions.md │ ├── AppRoot.md │ ├── component-apis.md │ ├── component-rendering.md │ ├── component-review-checklist.md │ ├── data-sources.md │ ├── e2e-summary.md │ ├── expression-evaluation.md │ ├── glossary.md │ ├── helper-components.md │ ├── index.md │ ├── loaders.md │ ├── next │ │ ├── component-dev-guide.md │ │ ├── configuration-management-enhancement-summary.md │ │ ├── documentation-scripts-refactoring-complete-summary.md │ │ ├── documentation-scripts-refactoring-plan.md │ │ ├── duplicate-pattern-extraction-summary.md │ │ ├── error-handling-standardization-summary.md │ │ ├── generating-component-reference.md │ │ ├── index.md │ │ ├── logging-consistency-implementation-summary.md │ │ ├── project-build.md │ │ ├── project-structure.md │ │ ├── theme-context.md │ │ ├── tiptap-design-considerations.md │ │ ├── working-with-code.md │ │ ├── xmlui-runtime-architecture │ │ └── xmlui-wcag-accessibility-report.md │ ├── react-fundamentals.md │ ├── release-method.md │ ├── rendering-fundamentals.md │ ├── reusable-components.md │ ├── standalone-apps.md │ ├── state-management.md │ └── xmlui-extensibility.xlsx ├── package.json ├── playwright.config.ts ├── scripts │ ├── coverage-only.js │ ├── e2e-test-summary.js │ ├── generate-docs │ │ ├── build-downloads-map.mjs │ │ ├── build-pages-map.mjs │ │ ├── components-config.json │ │ ├── configuration-management.mjs │ │ ├── constants.mjs │ │ ├── create-theme-files.mjs │ │ ├── DocsGenerator.mjs │ │ ├── error-handling.mjs │ │ ├── extensions-config.json │ │ ├── folders.mjs │ │ ├── generate-summary-files.mjs │ │ ├── get-docs.mjs │ │ ├── input-handler.mjs │ │ ├── logger.mjs │ │ ├── logging-standards.mjs │ │ ├── MetadataProcessor.mjs │ │ ├── pattern-utilities.mjs │ │ └── utils.mjs │ ├── get-langserver-metadata.mjs │ ├── inline-links.mjs │ └── README-e2e-summary.md ├── src │ ├── abstractions │ │ ├── _conventions.md │ │ ├── ActionDefs.ts │ │ ├── AppContextDefs.ts │ │ ├── ComponentDefs.ts │ │ ├── ContainerDefs.ts │ │ ├── ExtensionDefs.ts │ │ ├── FunctionDefs.ts │ │ ├── RendererDefs.ts │ │ ├── scripting │ │ │ ├── BlockScope.ts │ │ │ ├── Compilation.ts │ │ │ ├── LogicalThread.ts │ │ │ ├── LoopScope.ts │ │ │ ├── modules.ts │ │ │ ├── ScriptParserError.ts │ │ │ ├── Token.ts │ │ │ ├── TryScope.ts │ │ │ └── TryScopeExp.ts │ │ └── ThemingDefs.ts │ ├── components │ │ ├── _conventions.md │ │ ├── abstractions.ts │ │ ├── Accordion │ │ │ ├── Accordion.md │ │ │ ├── Accordion.module.scss │ │ │ ├── Accordion.spec.ts │ │ │ ├── Accordion.tsx │ │ │ ├── AccordionContext.tsx │ │ │ ├── AccordionItem.tsx │ │ │ ├── AccordionItemNative.tsx │ │ │ └── AccordionNative.tsx │ │ ├── Animation │ │ │ └── AnimationNative.tsx │ │ ├── APICall │ │ │ ├── APICall.md │ │ │ ├── APICall.spec.ts │ │ │ ├── APICall.tsx │ │ │ └── APICallNative.tsx │ │ ├── App │ │ │ ├── App.md │ │ │ ├── App.module.scss │ │ │ ├── App.spec.ts │ │ │ ├── App.tsx │ │ │ ├── AppLayoutContext.ts │ │ │ ├── AppNative.tsx │ │ │ ├── AppStateContext.ts │ │ │ ├── doc-resources │ │ │ │ ├── condensed-sticky.xmlui │ │ │ │ ├── condensed.xmlui │ │ │ │ ├── horizontal-sticky.xmlui │ │ │ │ ├── horizontal.xmlui │ │ │ │ ├── vertical-full-header.xmlui │ │ │ │ ├── vertical-sticky.xmlui │ │ │ │ └── vertical.xmlui │ │ │ ├── IndexerContext.ts │ │ │ ├── LinkInfoContext.ts │ │ │ ├── SearchContext.tsx │ │ │ ├── Sheet.module.scss │ │ │ └── Sheet.tsx │ │ ├── AppHeader │ │ │ ├── AppHeader.md │ │ │ ├── AppHeader.module.scss │ │ │ ├── AppHeader.spec.ts │ │ │ ├── AppHeader.tsx │ │ │ └── AppHeaderNative.tsx │ │ ├── AppState │ │ │ ├── AppState.md │ │ │ ├── AppState.spec.ts │ │ │ ├── AppState.tsx │ │ │ └── AppStateNative.tsx │ │ ├── AutoComplete │ │ │ ├── AutoComplete.md │ │ │ ├── AutoComplete.module.scss │ │ │ ├── AutoComplete.spec.ts │ │ │ ├── AutoComplete.tsx │ │ │ ├── AutoCompleteContext.tsx │ │ │ └── AutoCompleteNative.tsx │ │ ├── Avatar │ │ │ ├── Avatar.md │ │ │ ├── Avatar.module.scss │ │ │ ├── Avatar.spec.ts │ │ │ ├── Avatar.tsx │ │ │ └── AvatarNative.tsx │ │ ├── Backdrop │ │ │ ├── Backdrop.md │ │ │ ├── Backdrop.module.scss │ │ │ ├── Backdrop.spec.ts │ │ │ ├── Backdrop.tsx │ │ │ └── BackdropNative.tsx │ │ ├── Badge │ │ │ ├── Badge.md │ │ │ ├── Badge.module.scss │ │ │ ├── Badge.spec.ts │ │ │ ├── Badge.tsx │ │ │ └── BadgeNative.tsx │ │ ├── Bookmark │ │ │ ├── Bookmark.md │ │ │ ├── Bookmark.module.scss │ │ │ ├── Bookmark.spec.ts │ │ │ ├── Bookmark.tsx │ │ │ └── BookmarkNative.tsx │ │ ├── Breakout │ │ │ ├── Breakout.module.scss │ │ │ ├── Breakout.spec.ts │ │ │ ├── Breakout.tsx │ │ │ └── BreakoutNative.tsx │ │ ├── Button │ │ │ ├── Button-style.spec.ts │ │ │ ├── Button.md │ │ │ ├── Button.module.scss │ │ │ ├── Button.spec.ts │ │ │ ├── Button.tsx │ │ │ └── ButtonNative.tsx │ │ ├── Card │ │ │ ├── Card.md │ │ │ ├── Card.module.scss │ │ │ ├── Card.spec.ts │ │ │ ├── Card.tsx │ │ │ └── CardNative.tsx │ │ ├── Carousel │ │ │ ├── Carousel.md │ │ │ ├── Carousel.module.scss │ │ │ ├── Carousel.spec.ts │ │ │ ├── Carousel.tsx │ │ │ ├── CarouselContext.tsx │ │ │ ├── CarouselItem.tsx │ │ │ ├── CarouselItemNative.tsx │ │ │ └── CarouselNative.tsx │ │ ├── ChangeListener │ │ │ ├── ChangeListener.md │ │ │ ├── ChangeListener.spec.ts │ │ │ ├── ChangeListener.tsx │ │ │ └── ChangeListenerNative.tsx │ │ ├── chart-color-schemes.ts │ │ ├── Charts │ │ │ ├── AreaChart │ │ │ │ ├── AreaChart.md │ │ │ │ ├── AreaChart.spec.ts │ │ │ │ ├── AreaChart.tsx │ │ │ │ └── AreaChartNative.tsx │ │ │ ├── BarChart │ │ │ │ ├── BarChart.md │ │ │ │ ├── BarChart.module.scss │ │ │ │ ├── BarChart.spec.ts │ │ │ │ ├── BarChart.tsx │ │ │ │ └── BarChartNative.tsx │ │ │ ├── DonutChart │ │ │ │ ├── DonutChart.spec.ts │ │ │ │ └── DonutChart.tsx │ │ │ ├── LabelList │ │ │ │ ├── LabelList.spec.ts │ │ │ │ ├── LabelList.tsx │ │ │ │ ├── LabelListNative.module.scss │ │ │ │ └── LabelListNative.tsx │ │ │ ├── Legend │ │ │ │ ├── Legend.spec.ts │ │ │ │ ├── Legend.tsx │ │ │ │ └── LegendNative.tsx │ │ │ ├── LineChart │ │ │ │ ├── LineChart.md │ │ │ │ ├── LineChart.module.scss │ │ │ │ ├── LineChart.spec.ts │ │ │ │ ├── LineChart.tsx │ │ │ │ └── LineChartNative.tsx │ │ │ ├── PieChart │ │ │ │ ├── PieChart.md │ │ │ │ ├── PieChart.spec.ts │ │ │ │ ├── PieChart.tsx │ │ │ │ ├── PieChartNative.module.scss │ │ │ │ └── PieChartNative.tsx │ │ │ ├── RadarChart │ │ │ │ ├── RadarChart.md │ │ │ │ ├── RadarChart.spec.ts │ │ │ │ ├── RadarChart.tsx │ │ │ │ └── RadarChartNative.tsx │ │ │ ├── Tooltip │ │ │ │ ├── TooltipContent.module.scss │ │ │ │ ├── TooltipContent.spec.ts │ │ │ │ └── TooltipContent.tsx │ │ │ └── utils │ │ │ ├── abstractions.ts │ │ │ └── ChartProvider.tsx │ │ ├── Checkbox │ │ │ ├── Checkbox.md │ │ │ ├── Checkbox.spec.ts │ │ │ └── Checkbox.tsx │ │ ├── CodeBlock │ │ │ ├── CodeBlock.module.scss │ │ │ ├── CodeBlock.spec.ts │ │ │ ├── CodeBlock.tsx │ │ │ ├── CodeBlockNative.tsx │ │ │ └── highlight-code.ts │ │ ├── collectedComponentMetadata.ts │ │ ├── ColorPicker │ │ │ ├── ColorPicker.md │ │ │ ├── ColorPicker.module.scss │ │ │ ├── ColorPicker.spec.ts │ │ │ ├── ColorPicker.tsx │ │ │ └── ColorPickerNative.tsx │ │ ├── Column │ │ │ ├── Column.md │ │ │ ├── Column.tsx │ │ │ ├── ColumnNative.tsx │ │ │ ├── doc-resources │ │ │ │ └── list-component-data.js │ │ │ └── TableContext.tsx │ │ ├── component-utils.ts │ │ ├── ComponentProvider.tsx │ │ ├── ComponentRegistryContext.tsx │ │ ├── container-helpers.tsx │ │ ├── ContentSeparator │ │ │ ├── ContentSeparator.md │ │ │ ├── ContentSeparator.module.scss │ │ │ ├── ContentSeparator.spec.ts │ │ │ ├── ContentSeparator.tsx │ │ │ └── ContentSeparatorNative.tsx │ │ ├── DataSource │ │ │ ├── DataSource.md │ │ │ └── DataSource.tsx │ │ ├── DateInput │ │ │ ├── DateInput.md │ │ │ ├── DateInput.module.scss │ │ │ ├── DateInput.spec.ts │ │ │ ├── DateInput.tsx │ │ │ └── DateInputNative.tsx │ │ ├── DatePicker │ │ │ ├── DatePicker.md │ │ │ ├── DatePicker.module.scss │ │ │ ├── DatePicker.spec.ts │ │ │ ├── DatePicker.tsx │ │ │ └── DatePickerNative.tsx │ │ ├── DropdownMenu │ │ │ ├── DropdownMenu.md │ │ │ ├── DropdownMenu.module.scss │ │ │ ├── DropdownMenu.spec.ts │ │ │ ├── DropdownMenu.tsx │ │ │ ├── DropdownMenuNative.tsx │ │ │ ├── MenuItem.md │ │ │ └── SubMenuItem.md │ │ ├── EmojiSelector │ │ │ ├── EmojiSelector.md │ │ │ ├── EmojiSelector.spec.ts │ │ │ ├── EmojiSelector.tsx │ │ │ └── EmojiSelectorNative.tsx │ │ ├── ExpandableItem │ │ │ ├── ExpandableItem.module.scss │ │ │ ├── ExpandableItem.spec.ts │ │ │ ├── ExpandableItem.tsx │ │ │ └── ExpandableItemNative.tsx │ │ ├── FileInput │ │ │ ├── FileInput.md │ │ │ ├── FileInput.module.scss │ │ │ ├── FileInput.spec.ts │ │ │ ├── FileInput.tsx │ │ │ └── FileInputNative.tsx │ │ ├── FileUploadDropZone │ │ │ ├── FileUploadDropZone.md │ │ │ ├── FileUploadDropZone.module.scss │ │ │ ├── FileUploadDropZone.spec.ts │ │ │ ├── FileUploadDropZone.tsx │ │ │ └── FileUploadDropZoneNative.tsx │ │ ├── FlowLayout │ │ │ ├── FlowLayout.md │ │ │ ├── FlowLayout.module.scss │ │ │ ├── FlowLayout.spec.ts │ │ │ ├── FlowLayout.spec.ts-snapshots │ │ │ │ └── Edge-cases-boxShadow-is-not-clipped-1-non-smoke-darwin.png │ │ │ ├── FlowLayout.tsx │ │ │ └── FlowLayoutNative.tsx │ │ ├── Footer │ │ │ ├── Footer.md │ │ │ ├── Footer.module.scss │ │ │ ├── Footer.spec.ts │ │ │ ├── Footer.tsx │ │ │ └── FooterNative.tsx │ │ ├── Form │ │ │ ├── Form.md │ │ │ ├── Form.module.scss │ │ │ ├── Form.spec.ts │ │ │ ├── Form.tsx │ │ │ ├── formActions.ts │ │ │ ├── FormContext.ts │ │ │ └── FormNative.tsx │ │ ├── FormItem │ │ │ ├── FormItem.md │ │ │ ├── FormItem.module.scss │ │ │ ├── FormItem.spec.ts │ │ │ ├── FormItem.tsx │ │ │ ├── FormItemNative.tsx │ │ │ ├── HelperText.module.scss │ │ │ ├── HelperText.tsx │ │ │ ├── ItemWithLabel.tsx │ │ │ └── Validations.ts │ │ ├── FormSection │ │ │ ├── FormSection.md │ │ │ ├── FormSection.ts │ │ │ └── FormSection.xmlui │ │ ├── Fragment │ │ │ ├── Fragment.spec.ts │ │ │ └── Fragment.tsx │ │ ├── Heading │ │ │ ├── abstractions.ts │ │ │ ├── H1.md │ │ │ ├── H1.spec.ts │ │ │ ├── H2.md │ │ │ ├── H2.spec.ts │ │ │ ├── H3.md │ │ │ ├── H3.spec.ts │ │ │ ├── H4.md │ │ │ ├── H4.spec.ts │ │ │ ├── H5.md │ │ │ ├── H5.spec.ts │ │ │ ├── H6.md │ │ │ ├── H6.spec.ts │ │ │ ├── Heading.md │ │ │ ├── Heading.module.scss │ │ │ ├── Heading.spec.ts │ │ │ ├── Heading.tsx │ │ │ └── HeadingNative.tsx │ │ ├── HoverCard │ │ │ ├── HoverCard.tsx │ │ │ └── HovercardNative.tsx │ │ ├── HtmlTags │ │ │ ├── HtmlTags.module.scss │ │ │ ├── HtmlTags.spec.ts │ │ │ └── HtmlTags.tsx │ │ ├── Icon │ │ │ ├── AdmonitionDanger.tsx │ │ │ ├── AdmonitionInfo.tsx │ │ │ ├── AdmonitionNote.tsx │ │ │ ├── AdmonitionTip.tsx │ │ │ ├── AdmonitionWarning.tsx │ │ │ ├── ApiIcon.tsx │ │ │ ├── ArrowDropDown.module.scss │ │ │ ├── ArrowDropDown.tsx │ │ │ ├── ArrowDropUp.module.scss │ │ │ ├── ArrowDropUp.tsx │ │ │ ├── ArrowLeft.module.scss │ │ │ ├── ArrowLeft.tsx │ │ │ ├── ArrowRight.module.scss │ │ │ ├── ArrowRight.tsx │ │ │ ├── Attach.tsx │ │ │ ├── Binding.module.scss │ │ │ ├── Binding.tsx │ │ │ ├── BoardIcon.tsx │ │ │ ├── BoxIcon.tsx │ │ │ ├── CheckIcon.tsx │ │ │ ├── ChevronDownIcon.tsx │ │ │ ├── ChevronLeft.tsx │ │ │ ├── ChevronRight.tsx │ │ │ ├── ChevronUpIcon.tsx │ │ │ ├── CodeFileIcon.tsx │ │ │ ├── CodeSandbox.tsx │ │ │ ├── CompactListIcon.tsx │ │ │ ├── ContentCopyIcon.tsx │ │ │ ├── DarkToLightIcon.tsx │ │ │ ├── DatabaseIcon.module.scss │ │ │ ├── DatabaseIcon.tsx │ │ │ ├── DocFileIcon.tsx │ │ │ ├── DocIcon.tsx │ │ │ ├── DotMenuHorizontalIcon.tsx │ │ │ ├── DotMenuIcon.tsx │ │ │ ├── EmailIcon.tsx │ │ │ ├── EmptyFolderIcon.tsx │ │ │ ├── ErrorIcon.tsx │ │ │ ├── ExpressionIcon.tsx │ │ │ ├── FillPlusCricleIcon.tsx │ │ │ ├── FilterIcon.tsx │ │ │ ├── FolderIcon.tsx │ │ │ ├── GlobeIcon.tsx │ │ │ ├── HomeIcon.tsx │ │ │ ├── HyperLinkIcon.tsx │ │ │ ├── Icon.md │ │ │ ├── Icon.module.scss │ │ │ ├── Icon.spec.ts │ │ │ ├── Icon.tsx │ │ │ ├── IconNative.tsx │ │ │ ├── ImageFileIcon.tsx │ │ │ ├── Inspect.tsx │ │ │ ├── LightToDark.tsx │ │ │ ├── LinkIcon.tsx │ │ │ ├── ListIcon.tsx │ │ │ ├── LooseListIcon.tsx │ │ │ ├── MoonIcon.tsx │ │ │ ├── MoreOptionsIcon.tsx │ │ │ ├── NoSortIcon.tsx │ │ │ ├── PDFIcon.tsx │ │ │ ├── PenIcon.tsx │ │ │ ├── PhoneIcon.tsx │ │ │ ├── PhotoIcon.tsx │ │ │ ├── PlusIcon.tsx │ │ │ ├── SearchIcon.tsx │ │ │ ├── ShareIcon.tsx │ │ │ ├── SortAscendingIcon.tsx │ │ │ ├── SortDescendingIcon.tsx │ │ │ ├── StarsIcon.tsx │ │ │ ├── SunIcon.tsx │ │ │ ├── svg │ │ │ │ ├── admonition_danger.svg │ │ │ │ ├── admonition_info.svg │ │ │ │ ├── admonition_note.svg │ │ │ │ ├── admonition_tip.svg │ │ │ │ ├── admonition_warning.svg │ │ │ │ ├── api.svg │ │ │ │ ├── arrow-dropdown.svg │ │ │ │ ├── arrow-left.svg │ │ │ │ ├── arrow-right.svg │ │ │ │ ├── arrow-up.svg │ │ │ │ ├── attach.svg │ │ │ │ ├── binding.svg │ │ │ │ ├── box.svg │ │ │ │ ├── bulb.svg │ │ │ │ ├── code-file.svg │ │ │ │ ├── code-sandbox.svg │ │ │ │ ├── dark_to_light.svg │ │ │ │ ├── database.svg │ │ │ │ ├── doc.svg │ │ │ │ ├── empty-folder.svg │ │ │ │ ├── expression.svg │ │ │ │ ├── eye-closed.svg │ │ │ │ ├── eye-dark.svg │ │ │ │ ├── eye.svg │ │ │ │ ├── file-text.svg │ │ │ │ ├── filter.svg │ │ │ │ ├── folder.svg │ │ │ │ ├── img.svg │ │ │ │ ├── inspect.svg │ │ │ │ ├── light_to_dark.svg │ │ │ │ ├── moon.svg │ │ │ │ ├── pdf.svg │ │ │ │ ├── photo.svg │ │ │ │ ├── share.svg │ │ │ │ ├── stars.svg │ │ │ │ ├── sun.svg │ │ │ │ ├── trending-down.svg │ │ │ │ ├── trending-level.svg │ │ │ │ ├── trending-up.svg │ │ │ │ ├── txt.svg │ │ │ │ ├── unknown-file.svg │ │ │ │ ├── unlink.svg │ │ │ │ └── xls.svg │ │ │ ├── TableDeleteColumnIcon.tsx │ │ │ ├── TableDeleteRowIcon.tsx │ │ │ ├── TableInsertColumnIcon.tsx │ │ │ ├── TableInsertRowIcon.tsx │ │ │ ├── TrashIcon.tsx │ │ │ ├── TrendingDownIcon.tsx │ │ │ ├── TrendingLevelIcon.tsx │ │ │ ├── TrendingUpIcon.tsx │ │ │ ├── TxtIcon.tsx │ │ │ ├── UnknownFileIcon.tsx │ │ │ ├── UnlinkIcon.tsx │ │ │ ├── UserIcon.tsx │ │ │ ├── WarningIcon.tsx │ │ │ └── XlsIcon.tsx │ │ ├── IconProvider.tsx │ │ ├── IconRegistryContext.tsx │ │ ├── IFrame │ │ │ ├── IFrame.md │ │ │ ├── IFrame.module.scss │ │ │ ├── IFrame.spec.ts │ │ │ ├── IFrame.tsx │ │ │ └── IFrameNative.tsx │ │ ├── Image │ │ │ ├── Image.md │ │ │ ├── Image.module.scss │ │ │ ├── Image.spec.ts │ │ │ ├── Image.tsx │ │ │ └── ImageNative.tsx │ │ ├── Input │ │ │ ├── index.ts │ │ │ ├── InputAdornment.module.scss │ │ │ ├── InputAdornment.tsx │ │ │ ├── InputDivider.module.scss │ │ │ ├── InputDivider.tsx │ │ │ ├── InputLabel.module.scss │ │ │ ├── InputLabel.tsx │ │ │ ├── PartialInput.module.scss │ │ │ └── PartialInput.tsx │ │ ├── InspectButton │ │ │ ├── InspectButton.module.scss │ │ │ └── InspectButton.tsx │ │ ├── Items │ │ │ ├── Items.md │ │ │ ├── Items.spec.ts │ │ │ ├── Items.tsx │ │ │ └── ItemsNative.tsx │ │ ├── Link │ │ │ ├── Link.md │ │ │ ├── Link.module.scss │ │ │ ├── Link.spec.ts │ │ │ ├── Link.tsx │ │ │ └── LinkNative.tsx │ │ ├── List │ │ │ ├── doc-resources │ │ │ │ └── list-component-data.js │ │ │ ├── List.md │ │ │ ├── List.module.scss │ │ │ ├── List.spec.ts │ │ │ ├── List.tsx │ │ │ └── ListNative.tsx │ │ ├── Logo │ │ │ ├── doc-resources │ │ │ │ └── xmlui-logo.svg │ │ │ ├── Logo.md │ │ │ ├── Logo.tsx │ │ │ └── LogoNative.tsx │ │ ├── Markdown │ │ │ ├── CodeText.module.scss │ │ │ ├── CodeText.tsx │ │ │ ├── Markdown.md │ │ │ ├── Markdown.module.scss │ │ │ ├── Markdown.spec.ts │ │ │ ├── Markdown.tsx │ │ │ ├── MarkdownNative.tsx │ │ │ ├── parse-binding-expr.ts │ │ │ └── utils.ts │ │ ├── metadata-helpers.ts │ │ ├── ModalDialog │ │ │ ├── ConfirmationModalContextProvider.tsx │ │ │ ├── Dialog.module.scss │ │ │ ├── Dialog.tsx │ │ │ ├── ModalDialog.md │ │ │ ├── ModalDialog.module.scss │ │ │ ├── ModalDialog.spec.ts │ │ │ ├── ModalDialog.tsx │ │ │ ├── ModalDialogNative.tsx │ │ │ └── ModalVisibilityContext.tsx │ │ ├── NavGroup │ │ │ ├── NavGroup.md │ │ │ ├── NavGroup.module.scss │ │ │ ├── NavGroup.spec.ts │ │ │ ├── NavGroup.tsx │ │ │ ├── NavGroupContext.ts │ │ │ └── NavGroupNative.tsx │ │ ├── NavLink │ │ │ ├── NavLink.md │ │ │ ├── NavLink.module.scss │ │ │ ├── NavLink.spec.ts │ │ │ ├── NavLink.tsx │ │ │ └── NavLinkNative.tsx │ │ ├── NavPanel │ │ │ ├── NavPanel.md │ │ │ ├── NavPanel.module.scss │ │ │ ├── NavPanel.spec.ts │ │ │ ├── NavPanel.tsx │ │ │ └── NavPanelNative.tsx │ │ ├── NestedApp │ │ │ ├── AppWithCodeView.module.scss │ │ │ ├── AppWithCodeView.tsx │ │ │ ├── AppWithCodeViewNative.tsx │ │ │ ├── defaultProps.tsx │ │ │ ├── logo.svg │ │ │ ├── NestedApp.module.scss │ │ │ ├── NestedApp.tsx │ │ │ ├── NestedAppNative.tsx │ │ │ ├── Tooltip.module.scss │ │ │ ├── Tooltip.tsx │ │ │ └── utils.ts │ │ ├── NoResult │ │ │ ├── NoResult.md │ │ │ ├── NoResult.module.scss │ │ │ ├── NoResult.spec.ts │ │ │ ├── NoResult.tsx │ │ │ └── NoResultNative.tsx │ │ ├── NumberBox │ │ │ ├── numberbox-abstractions.ts │ │ │ ├── NumberBox.md │ │ │ ├── NumberBox.module.scss │ │ │ ├── NumberBox.spec.ts │ │ │ ├── NumberBox.tsx │ │ │ └── NumberBoxNative.tsx │ │ ├── Option │ │ │ ├── Option.md │ │ │ ├── Option.spec.ts │ │ │ ├── Option.tsx │ │ │ ├── OptionNative.tsx │ │ │ └── OptionTypeProvider.tsx │ │ ├── PageMetaTitle │ │ │ ├── PageMetaTilteNative.tsx │ │ │ ├── PageMetaTitle.md │ │ │ ├── PageMetaTitle.spec.ts │ │ │ └── PageMetaTitle.tsx │ │ ├── Pages │ │ │ ├── Page.md │ │ │ ├── Pages.md │ │ │ ├── Pages.module.scss │ │ │ ├── Pages.tsx │ │ │ └── PagesNative.tsx │ │ ├── Pagination │ │ │ ├── Pagination.md │ │ │ ├── Pagination.module.scss │ │ │ ├── Pagination.spec.ts │ │ │ ├── Pagination.tsx │ │ │ └── PaginationNative.tsx │ │ ├── PositionedContainer │ │ │ ├── PositionedContainer.module.scss │ │ │ ├── PositionedContainer.tsx │ │ │ └── PositionedContainerNative.tsx │ │ ├── ProfileMenu │ │ │ ├── ProfileMenu.module.scss │ │ │ └── ProfileMenu.tsx │ │ ├── ProgressBar │ │ │ ├── ProgressBar.md │ │ │ ├── ProgressBar.module.scss │ │ │ ├── ProgressBar.spec.ts │ │ │ ├── ProgressBar.tsx │ │ │ └── ProgressBarNative.tsx │ │ ├── Queue │ │ │ ├── Queue.md │ │ │ ├── Queue.spec.ts │ │ │ ├── Queue.tsx │ │ │ ├── queueActions.ts │ │ │ └── QueueNative.tsx │ │ ├── RadioGroup │ │ │ ├── RadioGroup.md │ │ │ ├── RadioGroup.module.scss │ │ │ ├── RadioGroup.spec.ts │ │ │ ├── RadioGroup.tsx │ │ │ ├── RadioGroupNative.tsx │ │ │ ├── RadioItem.tsx │ │ │ └── RadioItemNative.tsx │ │ ├── RealTimeAdapter │ │ │ ├── RealTimeAdapter.tsx │ │ │ └── RealTimeAdapterNative.tsx │ │ ├── Redirect │ │ │ ├── Redirect.md │ │ │ ├── Redirect.spec.ts │ │ │ └── Redirect.tsx │ │ ├── ResponsiveBar │ │ │ ├── README.md │ │ │ ├── ResponsiveBar.md │ │ │ ├── ResponsiveBar.module.scss │ │ │ ├── ResponsiveBar.spec.ts │ │ │ ├── ResponsiveBar.tsx │ │ │ └── ResponsiveBarNative.tsx │ │ ├── Select │ │ │ ├── HiddenOption.tsx │ │ │ ├── OptionContext.ts │ │ │ ├── Select.md │ │ │ ├── Select.module.scss │ │ │ ├── Select.spec.ts │ │ │ ├── Select.tsx │ │ │ ├── SelectContext.tsx │ │ │ └── SelectNative.tsx │ │ ├── SelectionStore │ │ │ ├── SelectionStore.md │ │ │ ├── SelectionStore.tsx │ │ │ └── SelectionStoreNative.tsx │ │ ├── Slider │ │ │ ├── Slider.md │ │ │ ├── Slider.module.scss │ │ │ ├── Slider.spec.ts │ │ │ ├── Slider.tsx │ │ │ └── SliderNative.tsx │ │ ├── Slot │ │ │ ├── Slot.md │ │ │ ├── Slot.spec.ts │ │ │ └── Slot.ts │ │ ├── SlotItem.tsx │ │ ├── SpaceFiller │ │ │ ├── SpaceFiller.md │ │ │ ├── SpaceFiller.module.scss │ │ │ ├── SpaceFiller.spec.ts │ │ │ ├── SpaceFiller.tsx │ │ │ └── SpaceFillerNative.tsx │ │ ├── Spinner │ │ │ ├── Spinner.md │ │ │ ├── Spinner.module.scss │ │ │ ├── Spinner.spec.ts │ │ │ ├── Spinner.tsx │ │ │ └── SpinnerNative.tsx │ │ ├── Splitter │ │ │ ├── HSplitter.md │ │ │ ├── HSplitter.spec.ts │ │ │ ├── Splitter.md │ │ │ ├── Splitter.module.scss │ │ │ ├── Splitter.spec.ts │ │ │ ├── Splitter.tsx │ │ │ ├── SplitterNative.tsx │ │ │ ├── utils.ts │ │ │ ├── VSplitter.md │ │ │ └── VSplitter.spec.ts │ │ ├── Stack │ │ │ ├── CHStack.md │ │ │ ├── CHStack.spec.ts │ │ │ ├── CVStack.md │ │ │ ├── CVStack.spec.ts │ │ │ ├── HStack.md │ │ │ ├── HStack.spec.ts │ │ │ ├── Stack.md │ │ │ ├── Stack.module.scss │ │ │ ├── Stack.spec.ts │ │ │ ├── Stack.tsx │ │ │ ├── StackNative.tsx │ │ │ ├── VStack.md │ │ │ └── VStack.spec.ts │ │ ├── StickyBox │ │ │ ├── StickyBox.md │ │ │ ├── StickyBox.module.scss │ │ │ ├── StickyBox.tsx │ │ │ └── StickyBoxNative.tsx │ │ ├── Switch │ │ │ ├── Switch.md │ │ │ ├── Switch.spec.ts │ │ │ └── Switch.tsx │ │ ├── Table │ │ │ ├── doc-resources │ │ │ │ └── list-component-data.js │ │ │ ├── react-table-config.d.ts │ │ │ ├── Table.md │ │ │ ├── Table.module.scss │ │ │ ├── Table.spec.ts │ │ │ ├── Table.tsx │ │ │ ├── TableNative.tsx │ │ │ └── useRowSelection.tsx │ │ ├── TableOfContents │ │ │ ├── TableOfContents.module.scss │ │ │ ├── TableOfContents.spec.ts │ │ │ ├── TableOfContents.tsx │ │ │ └── TableOfContentsNative.tsx │ │ ├── Tabs │ │ │ ├── TabContext.tsx │ │ │ ├── TabItem.md │ │ │ ├── TabItem.tsx │ │ │ ├── TabItemNative.tsx │ │ │ ├── Tabs.md │ │ │ ├── Tabs.module.scss │ │ │ ├── Tabs.spec.ts │ │ │ ├── Tabs.tsx │ │ │ └── TabsNative.tsx │ │ ├── Text │ │ │ ├── Text.md │ │ │ ├── Text.module.scss │ │ │ ├── Text.spec.ts │ │ │ ├── Text.tsx │ │ │ └── TextNative.tsx │ │ ├── TextArea │ │ │ ├── TextArea.md │ │ │ ├── TextArea.module.scss │ │ │ ├── TextArea.spec.ts │ │ │ ├── TextArea.tsx │ │ │ ├── TextAreaNative.tsx │ │ │ ├── TextAreaResizable.tsx │ │ │ └── useComposedRef.ts │ │ ├── TextBox │ │ │ ├── TextBox.md │ │ │ ├── TextBox.module.scss │ │ │ ├── TextBox.spec.ts │ │ │ ├── TextBox.tsx │ │ │ └── TextBoxNative.tsx │ │ ├── Theme │ │ │ ├── NotificationToast.tsx │ │ │ ├── Theme.md │ │ │ ├── Theme.module.scss │ │ │ ├── Theme.spec.ts │ │ │ ├── Theme.tsx │ │ │ └── ThemeNative.tsx │ │ ├── TimeInput │ │ │ ├── TimeInput.md │ │ │ ├── TimeInput.module.scss │ │ │ ├── TimeInput.spec.ts │ │ │ ├── TimeInput.tsx │ │ │ ├── TimeInputNative.tsx │ │ │ └── utils.ts │ │ ├── Timer │ │ │ ├── Timer.md │ │ │ ├── Timer.spec.ts │ │ │ ├── Timer.tsx │ │ │ └── TimerNative.tsx │ │ ├── Toggle │ │ │ ├── Toggle.module.scss │ │ │ └── Toggle.tsx │ │ ├── ToneChangerButton │ │ │ ├── ToneChangerButton.md │ │ │ ├── ToneChangerButton.spec.ts │ │ │ └── ToneChangerButton.tsx │ │ ├── ToneSwitch │ │ │ ├── ToneSwitch.md │ │ │ ├── ToneSwitch.module.scss │ │ │ ├── ToneSwitch.spec.ts │ │ │ ├── ToneSwitch.tsx │ │ │ └── ToneSwitchNative.tsx │ │ ├── Tooltip │ │ │ ├── Tooltip.md │ │ │ ├── Tooltip.module.scss │ │ │ ├── Tooltip.spec.ts │ │ │ ├── Tooltip.tsx │ │ │ └── TooltipNative.tsx │ │ ├── Tree │ │ │ ├── testData.ts │ │ │ ├── Tree-dynamic.spec.ts │ │ │ ├── Tree-icons.spec.ts │ │ │ ├── Tree.md │ │ │ ├── Tree.spec.ts │ │ │ ├── TreeComponent.module.scss │ │ │ ├── TreeComponent.tsx │ │ │ └── TreeNative.tsx │ │ ├── TreeDisplay │ │ │ ├── TreeDisplay.md │ │ │ ├── TreeDisplay.module.scss │ │ │ ├── TreeDisplay.tsx │ │ │ └── TreeDisplayNative.tsx │ │ ├── ValidationSummary │ │ │ ├── ValidationSummary.module.scss │ │ │ └── ValidationSummary.tsx │ │ └── VisuallyHidden.tsx │ ├── components-core │ │ ├── abstractions │ │ │ ├── ComponentRenderer.ts │ │ │ ├── LoaderRenderer.ts │ │ │ ├── standalone.ts │ │ │ └── treeAbstractions.ts │ │ ├── action │ │ │ ├── actions.ts │ │ │ ├── APICall.tsx │ │ │ ├── FileDownloadAction.tsx │ │ │ ├── FileUploadAction.tsx │ │ │ ├── NavigateAction.tsx │ │ │ └── TimedAction.tsx │ │ ├── ApiBoundComponent.tsx │ │ ├── appContext │ │ │ ├── date-functions.ts │ │ │ ├── math-function.ts │ │ │ └── misc-utils.ts │ │ ├── AppContext.tsx │ │ ├── behaviors │ │ │ ├── Behavior.tsx │ │ │ ├── BehaviorContext.tsx │ │ │ └── CoreBehaviors.tsx │ │ ├── component-hooks.ts │ │ ├── ComponentDecorator.tsx │ │ ├── ComponentViewer.tsx │ │ ├── CompoundComponent.tsx │ │ ├── constants.ts │ │ ├── DebugViewProvider.tsx │ │ ├── descriptorHelper.ts │ │ ├── devtools │ │ │ ├── InspectorDialog.module.scss │ │ │ ├── InspectorDialog.tsx │ │ │ └── InspectorDialogVisibilityContext.tsx │ │ ├── EngineError.ts │ │ ├── event-handlers.ts │ │ ├── InspectorButton.module.scss │ │ ├── InspectorContext.tsx │ │ ├── interception │ │ │ ├── abstractions.ts │ │ │ ├── ApiInterceptor.ts │ │ │ ├── ApiInterceptorProvider.tsx │ │ │ ├── apiInterceptorWorker.ts │ │ │ ├── Backend.ts │ │ │ ├── Errors.ts │ │ │ ├── IndexedDb.ts │ │ │ ├── initMock.ts │ │ │ ├── InMemoryDb.ts │ │ │ ├── ReadonlyCollection.ts │ │ │ └── useApiInterceptorContext.tsx │ │ ├── loader │ │ │ ├── ApiLoader.tsx │ │ │ ├── DataLoader.tsx │ │ │ ├── ExternalDataLoader.tsx │ │ │ ├── Loader.tsx │ │ │ ├── MockLoaderRenderer.tsx │ │ │ └── PageableLoader.tsx │ │ ├── LoaderComponent.tsx │ │ ├── markup-check.ts │ │ ├── parts.ts │ │ ├── renderers.ts │ │ ├── rendering │ │ │ ├── AppContent.tsx │ │ │ ├── AppRoot.tsx │ │ │ ├── AppWrapper.tsx │ │ │ ├── buildProxy.ts │ │ │ ├── collectFnVarDeps.ts │ │ │ ├── ComponentAdapter.tsx │ │ │ ├── ComponentWrapper.tsx │ │ │ ├── Container.tsx │ │ │ ├── containers.ts │ │ │ ├── ContainerWrapper.tsx │ │ │ ├── ErrorBoundary.module.scss │ │ │ ├── ErrorBoundary.tsx │ │ │ ├── InvalidComponent.module.scss │ │ │ ├── InvalidComponent.tsx │ │ │ ├── nodeUtils.ts │ │ │ ├── reducer.ts │ │ │ ├── renderChild.tsx │ │ │ ├── StandaloneComponent.tsx │ │ │ ├── StateContainer.tsx │ │ │ ├── UnknownComponent.module.scss │ │ │ ├── UnknownComponent.tsx │ │ │ └── valueExtractor.ts │ │ ├── reportEngineError.ts │ │ ├── RestApiProxy.ts │ │ ├── script-runner │ │ │ ├── asyncProxy.ts │ │ │ ├── AttributeValueParser.ts │ │ │ ├── bannedFunctions.ts │ │ │ ├── BindingTreeEvaluationContext.ts │ │ │ ├── eval-tree-async.ts │ │ │ ├── eval-tree-common.ts │ │ │ ├── eval-tree-sync.ts │ │ │ ├── ParameterParser.ts │ │ │ ├── process-statement-async.ts │ │ │ ├── process-statement-common.ts │ │ │ ├── process-statement-sync.ts │ │ │ ├── ScriptingSourceTree.ts │ │ │ ├── simplify-expression.ts │ │ │ ├── statement-queue.ts │ │ │ └── visitors.ts │ │ ├── StandaloneApp.tsx │ │ ├── StandaloneExtensionManager.ts │ │ ├── TableOfContentsContext.tsx │ │ ├── theming │ │ │ ├── _themes.scss │ │ │ ├── component-layout-resolver.ts │ │ │ ├── extendThemeUtils.ts │ │ │ ├── hvar.ts │ │ │ ├── layout-resolver.ts │ │ │ ├── parse-layout-props.ts │ │ │ ├── StyleContext.tsx │ │ │ ├── StyleRegistry.ts │ │ │ ├── ThemeContext.tsx │ │ │ ├── ThemeProvider.tsx │ │ │ ├── themes │ │ │ │ ├── base-utils.ts │ │ │ │ ├── palette.ts │ │ │ │ ├── root.ts │ │ │ │ ├── solid.ts │ │ │ │ ├── theme-colors.ts │ │ │ │ └── xmlui.ts │ │ │ ├── themeVars.module.scss │ │ │ ├── themeVars.ts │ │ │ ├── transformThemeVars.ts │ │ │ └── utils.ts │ │ ├── utils │ │ │ ├── actionUtils.ts │ │ │ ├── audio-utils.ts │ │ │ ├── compound-utils.ts │ │ │ ├── css-utils.ts │ │ │ ├── DataLoaderQueryKeyGenerator.ts │ │ │ ├── date-utils.ts │ │ │ ├── extractParam.ts │ │ │ ├── hooks.tsx │ │ │ ├── LruCache.ts │ │ │ ├── mergeProps.ts │ │ │ ├── misc.ts │ │ │ ├── request-params.ts │ │ │ ├── statementUtils.ts │ │ │ └── treeUtils.ts │ │ └── xmlui-parser.ts │ ├── index-standalone.ts │ ├── index.scss │ ├── index.ts │ ├── language-server │ │ ├── server-common.ts │ │ ├── server-web-worker.ts │ │ ├── server.ts │ │ ├── services │ │ │ ├── common │ │ │ │ ├── docs-generation.ts │ │ │ │ ├── lsp-utils.ts │ │ │ │ ├── metadata-utils.ts │ │ │ │ └── syntax-node-utilities.ts │ │ │ ├── completion.ts │ │ │ ├── diagnostic.ts │ │ │ ├── format.ts │ │ │ └── hover.ts │ │ └── xmlui-metadata-generated.mjs │ ├── logging │ │ ├── LoggerContext.tsx │ │ ├── LoggerInitializer.tsx │ │ ├── LoggerService.ts │ │ └── xmlui.ts │ ├── logo.svg │ ├── parsers │ │ ├── common │ │ │ ├── GenericToken.ts │ │ │ ├── InputStream.ts │ │ │ └── utils.ts │ │ ├── scripting │ │ │ ├── code-behind-collect.ts │ │ │ ├── Lexer.ts │ │ │ ├── modules.ts │ │ │ ├── Parser.ts │ │ │ ├── ParserError.ts │ │ │ ├── ScriptingNodeTypes.ts │ │ │ ├── TokenTrait.ts │ │ │ ├── TokenType.ts │ │ │ └── tree-visitor.ts │ │ ├── style-parser │ │ │ ├── errors.ts │ │ │ ├── source-tree.ts │ │ │ ├── StyleInputStream.ts │ │ │ ├── StyleLexer.ts │ │ │ ├── StyleParser.ts │ │ │ └── tokens.ts │ │ └── xmlui-parser │ │ ├── CharacterCodes.ts │ │ ├── diagnostics.ts │ │ ├── fileExtensions.ts │ │ ├── index.ts │ │ ├── lint.ts │ │ ├── parser.ts │ │ ├── ParserError.ts │ │ ├── scanner.ts │ │ ├── syntax-kind.ts │ │ ├── syntax-node.ts │ │ ├── transform.ts │ │ ├── utils.ts │ │ ├── xmlui-serializer.ts │ │ └── xmlui-tree.ts │ ├── react-app-env.d.ts │ ├── syntax │ │ ├── monaco │ │ │ ├── grammar.monacoLanguage.ts │ │ │ ├── index.ts │ │ │ ├── xmlui-dark.ts │ │ │ ├── xmlui-light.ts │ │ │ └── xmluiscript.monacoLanguage.ts │ │ └── textMate │ │ ├── index.ts │ │ ├── xmlui-dark.json │ │ ├── xmlui-light.json │ │ ├── xmlui.json │ │ └── xmlui.tmLanguage.json │ ├── testing │ │ ├── assertions.ts │ │ ├── component-test-helpers.ts │ │ ├── ComponentDrivers.ts │ │ ├── drivers │ │ │ ├── DateInputDriver.ts │ │ │ ├── ModalDialogDriver.ts │ │ │ ├── NumberBoxDriver.ts │ │ │ ├── TextBoxDriver.ts │ │ │ ├── TimeInputDriver.ts │ │ │ ├── TimerDriver.ts │ │ │ └── TreeDriver.ts │ │ ├── fixtures.ts │ │ ├── infrastructure │ │ │ ├── index.html │ │ │ ├── main.tsx │ │ │ ├── public │ │ │ │ ├── mockServiceWorker.js │ │ │ │ ├── resources │ │ │ │ │ ├── bell.svg │ │ │ │ │ ├── box.svg │ │ │ │ │ ├── doc.svg │ │ │ │ │ ├── eye.svg │ │ │ │ │ ├── flower-640x480.jpg │ │ │ │ │ ├── sun.svg │ │ │ │ │ ├── test-image-100x100.jpg │ │ │ │ │ └── txt.svg │ │ │ │ └── serve.json │ │ │ └── TestBed.tsx │ │ └── themed-app-test-helpers.ts │ └── vite-env.d.ts ├── tests │ ├── components │ │ ├── CodeBlock │ │ │ └── hightlight-code.test.ts │ │ ├── playground-pattern.test.ts │ │ └── Tree │ │ └── Tree-states.test.ts │ ├── components-core │ │ ├── abstractions │ │ │ └── treeAbstractions.test.ts │ │ ├── container │ │ │ └── buildProxy.test.ts │ │ ├── interception │ │ │ ├── orderBy.test.ts │ │ │ ├── ReadOnlyCollection.test.ts │ │ │ └── request-param-converter.test.ts │ │ ├── scripts-runner │ │ │ ├── AttributeValueParser.test.ts │ │ │ ├── eval-tree-arrow-async.test.ts │ │ │ ├── eval-tree-arrow.test.ts │ │ │ ├── eval-tree-func-decl-async.test.ts │ │ │ ├── eval-tree-func-decl.test.ts │ │ │ ├── eval-tree-pre-post.test.ts │ │ │ ├── eval-tree-regression.test.ts │ │ │ ├── eval-tree.test.ts │ │ │ ├── function-proxy.test.ts │ │ │ ├── parser-regression.test.ts │ │ │ ├── process-event.test.ts │ │ │ ├── process-function.test.ts │ │ │ ├── process-implicit-context.test.ts │ │ │ ├── process-statement-asgn.test.ts │ │ │ ├── process-statement-destruct.test.ts │ │ │ ├── process-statement-regs.test.ts │ │ │ ├── process-statement-sync.test.ts │ │ │ ├── process-statement.test.ts │ │ │ ├── process-switch-sync.test.ts │ │ │ ├── process-switch.test.ts │ │ │ ├── process-try-sync.test.ts │ │ │ ├── process-try.test.ts │ │ │ └── test-helpers.ts │ │ ├── test-metadata-handler.ts │ │ ├── theming │ │ │ ├── border-segments.test.ts │ │ │ ├── component-layout.resolver.test.ts │ │ │ ├── layout-property-parser.test.ts │ │ │ ├── layout-resolver.test.ts │ │ │ ├── layout-resolver2.test.ts │ │ │ ├── layout-vp-override.test.ts │ │ │ └── padding-segments.test.ts │ │ └── utils │ │ ├── date-utils.test.ts │ │ ├── format-human-elapsed-time.test.ts │ │ └── LruCache.test.ts │ ├── language-server │ │ ├── completion.test.ts │ │ ├── format.test.ts │ │ ├── hover.test.ts │ │ └── mockData.ts │ └── parsers │ ├── common │ │ └── input-stream.test.ts │ ├── markdown │ │ └── parse-binding-expression.test.ts │ ├── parameter-parser.test.ts │ ├── paremeter-parser.test.ts │ ├── scripting │ │ ├── eval-tree-arrow.test.ts │ │ ├── eval-tree-pre-post.test.ts │ │ ├── eval-tree.test.ts │ │ ├── function-proxy.test.ts │ │ ├── lexer-literals.test.ts │ │ ├── lexer-misc.test.ts │ │ ├── module-parse.test.ts │ │ ├── parser-arrow.test.ts │ │ ├── parser-assignments.test.ts │ │ ├── parser-binary.test.ts │ │ ├── parser-destructuring.test.ts │ │ ├── parser-errors.test.ts │ │ ├── parser-expressions.test.ts │ │ ├── parser-function.test.ts │ │ ├── parser-literals.test.ts │ │ ├── parser-primary.test.ts │ │ ├── parser-regex.test.ts │ │ ├── parser-statements.test.ts │ │ ├── parser-unary.test.ts │ │ ├── process-event.test.ts │ │ ├── process-implicit-context.test.ts │ │ ├── process-statement-asgn.test.ts │ │ ├── process-statement-destruct.test.ts │ │ ├── process-statement-regs.test.ts │ │ ├── process-statement-sync.test.ts │ │ ├── process-statement.test.ts │ │ ├── process-switch-sync.test.ts │ │ ├── process-switch.test.ts │ │ ├── process-try-sync.test.ts │ │ ├── process-try.test.ts │ │ ├── simplify-expression.test.ts │ │ ├── statement-hooks.test.ts │ │ └── test-helpers.ts │ ├── style-parser │ │ ├── generateHvarChain.test.ts │ │ ├── parseHVar.test.ts │ │ ├── parser.test.ts │ │ └── tokens.test.ts │ └── xmlui │ ├── lint.test.ts │ ├── parser.test.ts │ ├── scanner.test.ts │ ├── transform.attr.test.ts │ ├── transform.circular.test.ts │ ├── transform.element.test.ts │ ├── transform.errors.test.ts │ ├── transform.escape.test.ts │ ├── transform.regression.test.ts │ ├── transform.script.test.ts │ ├── transform.test.ts │ └── xmlui.ts ├── tests-e2e │ ├── api-bound-component-regression.spec.ts │ ├── api-call-as-extracted-component.spec.ts │ ├── assign-to-object-or-array-regression.spec.ts │ ├── binding-regression.spec.ts │ ├── children-as-template-context-vars.spec.ts │ ├── compound-component.spec.ts │ ├── context-vars-regression.spec.ts │ ├── data-bindings.spec.ts │ ├── datasource-and-api-usage-in-var.spec.ts │ ├── datasource-direct-binding.spec.ts │ ├── datasource-onLoaded-regression.spec.ts │ ├── modify-array-item-regression.spec.ts │ ├── namespaces.spec.ts │ ├── push-to-array-regression.spec.ts │ ├── screen-breakpoints.spec.ts │ ├── scripting.spec.ts │ ├── state-scope-in-pages.spec.ts │ └── state-var-scopes.spec.ts ├── tsconfig.bin.json ├── tsconfig.json ├── tsconfig.node.json ├── vite.config.ts └── vitest.config.ts ``` # Files -------------------------------------------------------------------------------- /xmlui/src/components-core/StandaloneApp.tsx: -------------------------------------------------------------------------------- ```typescript 1 | import type { ReactNode } from "react"; 2 | import { useEffect, useMemo, useRef, useState } from "react"; 3 | import type { Root } from "react-dom/client"; 4 | import ReactDOM from "react-dom/client"; 5 | import yaml from "js-yaml"; 6 | 7 | import type { StandaloneAppDescription, StandaloneJsonConfig } from "./abstractions/standalone"; 8 | import type { 9 | ComponentDef, 10 | ComponentLike, 11 | CompoundComponentDef, 12 | } from "../abstractions/ComponentDefs"; 13 | 14 | import "../index.scss"; 15 | import { AppRoot } from "./rendering/AppRoot"; 16 | import { normalizePath } from "./utils/misc"; 17 | import { ApiInterceptorProvider } from "./interception/ApiInterceptorProvider"; 18 | import { EMPTY_OBJECT } from "./constants"; 19 | import { 20 | errReportComponent, 21 | errReportMessage, 22 | errReportModuleErrors, 23 | errReportScriptError, 24 | xmlUiMarkupToComponent, 25 | } from "./xmlui-parser"; 26 | import { useIsomorphicLayoutEffect } from "./utils/hooks"; 27 | import { 28 | codeBehindFileExtension, 29 | componentFileExtension, 30 | } from "../parsers/xmlui-parser/fileExtensions"; 31 | import { Parser } from "../parsers/scripting/Parser"; 32 | import { 33 | collectCodeBehindFromSource, 34 | removeCodeBehindTokensFromTree, 35 | } from "../parsers/scripting/code-behind-collect"; 36 | import { ComponentRegistry } from "../components/ComponentProvider"; 37 | import { checkXmlUiMarkup } from "./markup-check"; 38 | import StandaloneExtensionManager from "./StandaloneExtensionManager"; 39 | import { builtInThemes } from "./theming/ThemeProvider"; 40 | import type { Extension } from "../abstractions/ExtensionDefs"; 41 | import { 42 | getLintSeverity, 43 | lintApp, 44 | lintErrorsComponent, 45 | LintSeverity, 46 | printComponentLints, 47 | } from "../parsers/xmlui-parser/lint"; 48 | import { collectedComponentMetadata } from "../components/collectedComponentMetadata"; 49 | import type { ThemeDefinition, ThemeTone } from "../abstractions/ThemingDefs"; 50 | import type { 51 | ComponentCompilation, 52 | ProjectCompilation, 53 | } from "../abstractions/scripting/Compilation"; 54 | import { MetadataProvider } from "../language-server/services/common/metadata-utils"; 55 | import type { CollectedDeclarations } from "./script-runner/ScriptingSourceTree"; 56 | 57 | const MAIN_FILE = "Main." + componentFileExtension; 58 | const MAIN_CODE_BEHIND_FILE = "Main." + codeBehindFileExtension; 59 | const CONFIG_FILE = "config.json"; 60 | 61 | const metadataProvider = new MetadataProvider(collectedComponentMetadata); 62 | 63 | // --- The properties of the standalone app 64 | type StandaloneAppProps = { 65 | // --- The standalone app description (the engine renders this definition) 66 | appDef?: StandaloneAppDescription; 67 | appGlobals?: Record<string, any>; 68 | 69 | // --- In E2E tests, we can decorate the components with test IDs 70 | decorateComponentsWithTestId?: boolean; 71 | 72 | // --- Debugging can be enabled or disabled 73 | debugEnabled?: boolean; 74 | 75 | // --- The runtime environment of the standalone app (for pre-compiled apps) 76 | runtime?: any; 77 | 78 | // --- The object responsible for managing the standalone components 79 | extensionManager?: StandaloneExtensionManager; 80 | 81 | // --- If true, the app waits for the API interceptor to be ready 82 | waitForApiInterceptor?: boolean; 83 | children?: ReactNode; 84 | }; 85 | 86 | /** 87 | * This React component represents a standalone app that implements a web 88 | * application with xmlui components. A StandaloneApp instance uses a 89 | * AppRoot wrapped into an ApiInterceptor. 90 | * 91 | * AppRoot is responsible for rendering the app (using an internal 92 | * representation); ApiInterceptor can emulate some backend functionality 93 | * running in the browser. 94 | */ 95 | function StandaloneApp({ 96 | appDef, 97 | appGlobals: globals, 98 | decorateComponentsWithTestId, 99 | debugEnabled = false, 100 | runtime, 101 | extensionManager, 102 | waitForApiInterceptor = false, 103 | children, 104 | }: StandaloneAppProps) { 105 | // --- Fetch all files constituting the standalone app, including components, 106 | // --- themes, and other artifacts. Display the app version numbers in the 107 | // --- console. 108 | const { standaloneApp, projectCompilation } = useStandalone(appDef, runtime, extensionManager); 109 | 110 | usePrintVersionNumber(standaloneApp); 111 | 112 | const { 113 | apiInterceptor, 114 | name, 115 | appGlobals, 116 | defaultTheme, 117 | defaultTone, 118 | resources, 119 | resourceMap, 120 | entryPoint, 121 | components, 122 | themes, 123 | sources, 124 | } = standaloneApp || {}; 125 | 126 | const globalProps = useMemo(() => { 127 | return { 128 | name: name, 129 | ...(appGlobals || {}), 130 | ...(globals || {}), 131 | }; 132 | }, [appGlobals, globals, name]); 133 | 134 | let contributes = useMemo(() => { 135 | return { 136 | compoundComponents: components, 137 | themes, 138 | }; 139 | }, [components, themes]); 140 | 141 | if (!standaloneApp) { 142 | // --- Problems found, the standalone app cannot run 143 | return null; 144 | } 145 | 146 | // --- The app may use a mocked API already defined in `window.XMLUI_MOCK_API` 147 | // --- or within the standalone app's definition, in `apiInterceptor`. 148 | const mockedApi = 149 | // @ts-ignore 150 | typeof window !== "undefined" && window.XMLUI_MOCK_API ? window.XMLUI_MOCK_API : apiInterceptor; 151 | 152 | // --- Components can be decorated with test IDs used in end-to-end tests. 153 | // --- This flag checks the environment if the app runs in E2E test mode. 154 | const shouldDecorateWithTestId = 155 | decorateComponentsWithTestId || 156 | // @ts-ignore 157 | (typeof window !== "undefined" ? window.XMLUI_MOCK_TEST_ID : false); 158 | 159 | // --- An app can turn off the default hash routing. 160 | const useHashBasedRouting = appGlobals?.useHashBasedRouting ?? true; 161 | 162 | return ( 163 | <ApiInterceptorProvider 164 | interceptor={mockedApi} 165 | useHashBasedRouting={useHashBasedRouting} 166 | waitForApiInterceptor={waitForApiInterceptor} 167 | > 168 | <AppRoot 169 | projectCompilation={projectCompilation} 170 | decorateComponentsWithTestId={shouldDecorateWithTestId} 171 | node={entryPoint!} 172 | standalone={true} 173 | debugEnabled={debugEnabled} 174 | // @ts-ignore 175 | routerBaseName={typeof window !== "undefined" ? window.__PUBLIC_PATH || "" : ""} 176 | globalProps={globalProps} 177 | defaultTheme={defaultTheme} 178 | defaultTone={defaultTone as ThemeTone} 179 | resources={resources} 180 | resourceMap={resourceMap} 181 | sources={sources} 182 | extensionManager={extensionManager} 183 | contributes={contributes} 184 | > 185 | {children} 186 | </AppRoot> 187 | </ApiInterceptorProvider> 188 | ); 189 | } 190 | 191 | // --- This type represents the parsed structure of a component markup of 192 | // --- code-behind file (for further processing) 193 | type ParsedResponse = { 194 | // --- The component definition (it may be a compound component) 195 | component?: ComponentDef | CompoundComponentDef; 196 | 197 | // --- The optional code-behind source code of the component 198 | codeBehind?: CollectedDeclarations; 199 | 200 | // --- The optional source code of the component (for debugging or learning purposes) 201 | src?: string; 202 | 203 | // --- The optional file name of the component (for debugging or learning purposes) 204 | file?: string; 205 | 206 | // --- The flag indicating if the component has errors 207 | hasError?: boolean; 208 | }; 209 | 210 | /** 211 | * This function parses the response of a fetch retrieving the contents of a 212 | * component markup file. 213 | * @param response The response coming from the fetch 214 | * @returns If parsing is successful, it returns the parsed response containing 215 | * the component definition. Otherwise, it returns a component definition that 216 | * displays the errors. 217 | */ 218 | async function parseComponentMarkupResponse(response: Response): Promise<ParsedResponse> { 219 | if (!response.ok) { 220 | throw new Error(`Failed to fetch ${response.url}`); 221 | } 222 | const code = await response.text(); 223 | const fileId = response.url; 224 | let { component, errors, erroneousCompoundComponentName } = xmlUiMarkupToComponent(code, fileId); 225 | if (errors.length > 0) { 226 | const compName = 227 | erroneousCompoundComponentName ?? 228 | response.url.substring( 229 | response.url.lastIndexOf("/") + 1, 230 | response.url.length - ".xmlui".length, 231 | ); 232 | component = errReportComponent(errors, fileId, compName); 233 | } 234 | return { 235 | component, 236 | src: code, 237 | file: fileId, 238 | hasError: errors.length > 0, 239 | }; 240 | } 241 | 242 | /** 243 | * This function parses the response of a fetch retrieving the contents of a 244 | * code-behind file. 245 | * @param response The response coming from the fetch 246 | * @returns If parsing is successful, it returns the parsed response containing 247 | * the code-behind declarations. Otherwise, it returns a component definition that 248 | * displays the errors. 249 | */ 250 | async function parseCodeBehindResponse(response: Response): Promise<ParsedResponse> { 251 | if (!response.ok) { 252 | throw new Error(`Failed to fetch ${response.url}`); 253 | } 254 | const code = await response.text(); 255 | const parser = new Parser(code); 256 | try { 257 | parser.parseStatements(); 258 | } catch (e) { 259 | console.error("Error parsing code behind", e); 260 | // throw new Error(`Failed to fetch ${response.url}`); 261 | if (parser.errors.length > 0) { 262 | return { 263 | component: errReportScriptError(parser.errors[0], response.url), 264 | file: response.url, 265 | hasError: true, 266 | }; 267 | } 268 | } 269 | 270 | try { 271 | const codeBehind = collectCodeBehindFromSource("Main", code); 272 | if (Object.keys(codeBehind.moduleErrors ?? {}).length > 0) { 273 | return { 274 | component: errReportModuleErrors(codeBehind.moduleErrors, response.url), 275 | file: response.url, 276 | hasError: true, 277 | }; 278 | } 279 | 280 | // --- Remove the code-behind tokens from the tree shrinking the tree 281 | removeCodeBehindTokensFromTree(codeBehind); 282 | return { 283 | src: code, 284 | codeBehind: codeBehind, 285 | file: response.url, 286 | }; 287 | } catch (e) { 288 | console.error("Error collecting code behind", e); 289 | } 290 | } 291 | 292 | // --- Tests is the given path matches the speified file name 293 | function matchesFileName(path: string, fileName: string) { 294 | return ( 295 | path.endsWith(`/${fileName}.ts`) || 296 | path.endsWith(`/${fileName}.js`) || 297 | path.endsWith(`/${fileName}.${componentFileExtension}`) || 298 | path.endsWith(`/${fileName}.${codeBehindFileExtension}`) 299 | ); 300 | } 301 | 302 | // --- Tests if the given path contains the specified folder 303 | function matchesFolder(path: string, folderName: string) { 304 | return path.includes(`/${folderName}/`); 305 | } 306 | 307 | /** 308 | * This function turns a collection of runtime file declarations into a standalone 309 | * app description. 310 | * @param runtime A hash object containing the runtime files. The keys are the file 311 | * paths and the values are the file contents. 312 | * @returns The standalone app description. 313 | * 314 | * When the standalone app is pre-compiled, each property in `runtime` holds such a 315 | * pre-compiled item. Otherwise, `runtime` is an empty object. 316 | * 317 | * While processing the files here, we can assume they are free from compilation 318 | * errors, as such errors would be observed in the compile phase. 319 | */ 320 | function resolveRuntime(runtime: Record<string, any>): { 321 | standaloneApp: StandaloneAppDescription; 322 | projectCompilation?: ProjectCompilation; 323 | } { 324 | // --- Collect the components and their sources. We pass the sources to the standalone app 325 | // --- so that it can be used for error display and debugging purposes. 326 | const projectCompilation: ProjectCompilation = { 327 | entrypoint: { 328 | filename: "", 329 | definition: null, 330 | dependencies: new Set(), 331 | }, 332 | components: [], 333 | themes: {}, 334 | }; 335 | const sources: Record<string, string> = {}; 336 | const componentsByFileName: Record<string, CompoundComponentDef> = {}; 337 | const codeBehindsByFileName: Record<string, CollectedDeclarations> = {}; 338 | const themes: Array<ThemeDefinition> = []; 339 | 340 | // --- Some working variables 341 | let config: StandaloneAppDescription | undefined; 342 | let entryPoint: ComponentDef | undefined; 343 | let entryPointCodeBehind: CollectedDeclarations | undefined; 344 | let apiInterceptor: any; 345 | 346 | // --- Process the runtime files 347 | for (const [key, value] of Object.entries(runtime)) { 348 | if (matchesFileName(key, "config")) { 349 | // --- We assume that the config file has a default export and this 350 | // --- export is the standalone app's configuration. 351 | config = value.default; 352 | } 353 | 354 | // --- We assume that the entry point is either named "Main" or "App". 355 | if (matchesFileName(key, "Main") || matchesFileName(key, "App")) { 356 | if (key.endsWith(codeBehindFileExtension)) { 357 | // --- "default" contains the functions and variables declared in the 358 | // --- code behind file. 359 | entryPointCodeBehind = value.default; 360 | projectCompilation.entrypoint.codeBehindSource = value.default.src; 361 | } else { 362 | projectCompilation.entrypoint.filename = key; 363 | // --- "default" contains the component definition, the file index, 364 | // --- and the source code. 365 | entryPoint = value.default.component; 366 | projectCompilation.entrypoint.definition = entryPoint; 367 | projectCompilation.entrypoint.markupSource = value.default.src; 368 | if (value.default.file) { 369 | // TODO: Remove this prop 370 | sources[value.default.file] = value.default.src; 371 | } 372 | } 373 | } 374 | 375 | // --- Use API emulation if available 376 | if (matchesFileName(key, "api")) { 377 | apiInterceptor = value.default; 378 | } 379 | 380 | // --- Collect the components and their code behinds 381 | if (matchesFolder(key, "components")) { 382 | if (key.endsWith(`.${codeBehindFileExtension}`)) { 383 | // --- "default" contains the functions and variables declared in the 384 | // --- component's code behind file. 385 | codeBehindsByFileName[key] = value.default; 386 | const componentCompilationForCodeBehind = projectCompilation.components.findLast( 387 | ({ filename }) => { 388 | const idxOfCodeBehindFileExtension = key.lastIndexOf(codeBehindFileExtension); 389 | const idxOfComponentFileExtension = filename.lastIndexOf(componentFileExtension); 390 | const extensionlessFilenamesMatch = 391 | filename.substring(0, idxOfComponentFileExtension) === 392 | key.substring(0, idxOfCodeBehindFileExtension); 393 | 394 | return extensionlessFilenamesMatch; 395 | }, 396 | ); 397 | 398 | componentCompilationForCodeBehind.codeBehindSource = value.default.src; 399 | } else { 400 | // --- "default" contains the component definition, the file index, 401 | // --- and the source code. 402 | componentsByFileName[key] = value.default.component; 403 | sources[value.default.file] = value.default.src; 404 | 405 | const componentCompilation: ComponentCompilation = { 406 | definition: value.default.component, 407 | filename: key, 408 | markupSource: value.default.src, 409 | dependencies: new Set(), 410 | }; 411 | projectCompilation.components.push(componentCompilation); 412 | } 413 | } 414 | 415 | // --- Collect the themes declared with the app 416 | if (matchesFolder(key, "themes")) { 417 | themes.push(value.default); 418 | } 419 | } 420 | 421 | // --- We have an entry point defined in the configuration file or in the main app file. 422 | const safeEntryPoint = config?.entryPoint || entryPoint; 423 | 424 | // --- We may have a code-behind file. If so, we merge the variables and functions 425 | const entryPointWithCodeBehind = { 426 | ...safeEntryPoint, 427 | vars: { 428 | ...entryPointCodeBehind?.vars, 429 | ...safeEntryPoint?.vars, 430 | }, 431 | functions: entryPointCodeBehind?.functions, 432 | scriptError: entryPointCodeBehind?.moduleErrors, 433 | } as ComponentLike; 434 | 435 | // --- Collect the component definition we pass to the rendering engine 436 | let components: Array<CompoundComponentDef> = []; 437 | if (config?.components) { 438 | // --- We have a list of components defined in the configuration file 439 | components = config.components; 440 | } else { 441 | // --- Use the components collected from the runtime files; merge the components 442 | // --- with their code behinds 443 | Object.entries(componentsByFileName).forEach(([key, compound]) => { 444 | const componentCodeBehind = codeBehindsByFileName[`${key}.xs`]; 445 | const componentWithCodeBehind = { 446 | ...compound, 447 | component: { 448 | ...compound.component, 449 | vars: { 450 | ...compound.component.vars, 451 | ...componentCodeBehind?.vars, 452 | }, 453 | functions: componentCodeBehind?.functions, 454 | scriptError: componentCodeBehind?.moduleErrors, 455 | }, 456 | }; 457 | components.push(componentWithCodeBehind); 458 | }); 459 | } 460 | 461 | // --- Done. 462 | return { 463 | standaloneApp: { 464 | ...config, 465 | entryPoint: entryPointWithCodeBehind, 466 | components, 467 | themes: config?.themes || themes, 468 | apiInterceptor: config?.apiInterceptor || apiInterceptor, 469 | sources, 470 | }, 471 | projectCompilation, 472 | }; 473 | } 474 | 475 | /** 476 | * Merges app definitions 477 | * @param resolvedRuntime Standalone app definition coming from the resolved runtime 478 | * @param standaloneAppDef Standalode app definition coming from the source 479 | * @returns Merged standalone app definition 480 | */ 481 | function mergeAppDefWithRuntime( 482 | resolvedRuntime: StandaloneAppDescription, 483 | standaloneAppDef: StandaloneAppDescription | undefined, 484 | ): StandaloneAppDescription { 485 | if (!standaloneAppDef) { 486 | return resolvedRuntime; 487 | } 488 | return { 489 | ...standaloneAppDef, 490 | entryPoint: standaloneAppDef.entryPoint || resolvedRuntime.entryPoint, 491 | components: standaloneAppDef.components || resolvedRuntime.components, 492 | themes: standaloneAppDef.themes || resolvedRuntime.themes, 493 | apiInterceptor: standaloneAppDef.apiInterceptor || resolvedRuntime.apiInterceptor, 494 | }; 495 | } 496 | 497 | function resolvePath(basePath: string, relativePath: string) { 498 | // Create a base URL. The 'http://dummy.com' is just a placeholder. 499 | const baseUrl = new URL(basePath, "http://dummy.com"); 500 | 501 | // Create a new URL by resolving the relative path against the base URL. 502 | const resolvedUrl = new URL(relativePath, baseUrl); 503 | 504 | // Return the pathname, removing the leading slash. 505 | return resolvedUrl.pathname.substring(1); 506 | } 507 | 508 | /** 509 | * Helper function to load theme files with support for both JSON and YAML formats. 510 | * First tries to load as JSON, if that fails, attempts to load as YAML. 511 | * @param url The URL to fetch the theme from 512 | * @returns A Promise resolving to the parsed theme definition 513 | */ 514 | async function loadThemeFile(url: string): Promise<ThemeDefinition> { 515 | // First try to load as JSON 516 | try { 517 | const response = await fetchWithoutCache(url); 518 | if (!response.ok) { 519 | // If the JSON file doesn't exist, try YAML immediately 520 | throw new Error(`Failed to fetch ${url}`); 521 | } 522 | 523 | // Get the content as text first 524 | const text = await response.text(); 525 | 526 | // Try to parse as JSON 527 | try { 528 | return JSON.parse(text); 529 | } catch (jsonParseError) { 530 | // If JSON parsing fails, it might be a YAML file with a .json extension 531 | // or we need to try the .yml version 532 | console.warn(`Failed to parse ${url} as JSON, attempting YAML parsing.`); 533 | try { 534 | return yaml.load(text) as ThemeDefinition; 535 | } catch (yamlParseError) { 536 | // If both JSON and YAML parsing fail for this file, try the .yml version 537 | throw jsonParseError; 538 | } 539 | } 540 | } catch (jsonError) { 541 | // If JSON file loading fails, try YAML 542 | const yamlUrl = url.replace(/\.json$/, ".yml"); 543 | try { 544 | const response = await fetchWithoutCache(yamlUrl); 545 | if (!response.ok) throw new Error(`Failed to fetch ${yamlUrl}`); 546 | const text = await response.text(); 547 | return yaml.load(text) as ThemeDefinition; 548 | } catch (yamlError) { 549 | console.error( 550 | `Failed to load theme file: ${url} (JSON error:`, 551 | jsonError, 552 | "YAML error:", 553 | yamlError, 554 | ")", 555 | ); 556 | throw new Error(`Failed to load theme file ${url} in either JSON or YAML format`); 557 | } 558 | } 559 | } 560 | 561 | /** 562 | * Fetch the up-to-date state of the source file 563 | * @param url The URL to fetch the source file from 564 | * @returns The source file contents response 565 | */ 566 | function fetchWithoutCache(url: string): Promise<Response> { 567 | return fetch(normalizePath(url), { 568 | headers: { 569 | "Cache-Control": "no-cache, no-store", 570 | }, 571 | }); 572 | } 573 | 574 | /** 575 | * Using its definition, this React hook prepares the runtime environment of a 576 | * standalone app. It runs every time an app source file changes. 577 | * @param standaloneAppDef The standalone app description 578 | * @param runtime The pre-compiled runtime environment 579 | * @returns The prepared StandaloneAppDescription if the collection is 580 | * successful; otherwise, null. 581 | */ 582 | function useStandalone( 583 | standaloneAppDef: StandaloneAppDescription | undefined, 584 | runtime: Record<string, any> = EMPTY_OBJECT, 585 | extensionManager?: StandaloneExtensionManager, 586 | ): { standaloneApp: StandaloneAppDescription | null; projectCompilation?: ProjectCompilation } { 587 | const [standaloneApp, setStandaloneApp] = useState<StandaloneAppDescription | null>(() => { 588 | // --- Initialize the standalone app 589 | const resolvedRuntime = resolveRuntime(runtime); 590 | const appDef = mergeAppDefWithRuntime(resolvedRuntime.standaloneApp, standaloneAppDef); 591 | 592 | // --- In dev mode or when the app is inlined (provided we do not use the standalone mode), 593 | // --- we must have the app definition available. 594 | if ( 595 | (process.env.VITE_DEV_MODE || process.env.VITE_BUILD_MODE === "INLINE_ALL") && 596 | !process.env.VITE_STANDALONE 597 | ) { 598 | if (!appDef) { 599 | throw new Error("couldn't find the application metadata"); 600 | } 601 | return appDef; 602 | } 603 | 604 | // --- No standalone app yet, we need to get that from the fetched source code 605 | return null; 606 | }); 607 | 608 | const [projectCompilation, setProjectCompilation] = useState<ProjectCompilation>(null); 609 | 610 | useIsomorphicLayoutEffect(() => { 611 | void (async function () { 612 | const resolvedRuntime = resolveRuntime(runtime); 613 | const appDef = mergeAppDefWithRuntime(resolvedRuntime.standaloneApp, standaloneAppDef); 614 | 615 | // --- In dev mode or when the app is inlined (provided we do not use the standalone mode), 616 | // --- we must have the app definition available. 617 | if ( 618 | (process.env.VITE_DEV_MODE || process.env.VITE_BUILD_MODE === "INLINE_ALL") && 619 | !process.env.VITE_STANDALONE 620 | ) { 621 | if (!appDef) { 622 | throw new Error("couldn't find the application metadata"); 623 | } 624 | const lintErrorComponent = processAppLinting(appDef, metadataProvider); 625 | if (lintErrorComponent) { 626 | appDef.entryPoint = lintErrorComponent; 627 | } 628 | 629 | discoverCompilationDependencies({ 630 | projectCompilation: resolvedRuntime.projectCompilation, 631 | extensionManager, 632 | }); 633 | setProjectCompilation(resolvedRuntime.projectCompilation); 634 | setStandaloneApp(appDef); 635 | return; 636 | } 637 | 638 | // --- In standalone mode, we must fetch the XMLUI app's source files, 639 | // --- compile them, and prepare the app's definition for the rendering 640 | // --- engine. 641 | if (process.env.VITE_BUILD_MODE === "CONFIG_ONLY") { 642 | // --- In config-only mode, we override the pre-compiled app definition 643 | // --- with elements from the configuration file. Note that we do not 644 | // --- check whether the config file's content is semantically valid. 645 | const configResponse = await fetchWithoutCache(CONFIG_FILE); 646 | const config: StandaloneJsonConfig = await configResponse.json(); 647 | 648 | const themePromises: Promise<ThemeDefinition>[] = []; 649 | config.themes?.forEach((theme) => { 650 | themePromises.push(loadThemeFile(theme)); 651 | }); 652 | const themes = await Promise.all(themePromises); 653 | 654 | const newAppDef = { 655 | ...appDef, 656 | name: config.name, 657 | appGlobals: config.appGlobals, 658 | defaultTheme: config.defaultTheme, 659 | resources: config.resources, 660 | resourceMap: config.resourceMap, 661 | themes, 662 | }; 663 | 664 | const lintErrorComponent = processAppLinting(newAppDef, metadataProvider); 665 | if (lintErrorComponent) { 666 | newAppDef.entryPoint = lintErrorComponent; 667 | } 668 | discoverCompilationDependencies({ 669 | projectCompilation: resolvedRuntime.projectCompilation, 670 | extensionManager, 671 | }); 672 | setProjectCompilation(resolvedRuntime.projectCompilation); 673 | setStandaloneApp(newAppDef); 674 | return; 675 | } 676 | 677 | // --- Fetch the main file 678 | const entryPointPromise = new Promise(async (resolve) => { 679 | try { 680 | const resp = await fetchWithoutCache(MAIN_FILE); 681 | if (resp.ok) { 682 | resolve(parseComponentMarkupResponse(resp)); 683 | } else { 684 | resolve({ 685 | component: errReportMessage(`Failed to load the main component (${MAIN_FILE})`), 686 | file: MAIN_FILE, 687 | hasError: true, 688 | }); 689 | } 690 | } catch (e) { 691 | resolve(null); 692 | } 693 | }) as any; 694 | 695 | // --- Fetch the configuration file (we do not check whether the content is semantically valid) 696 | let config: StandaloneJsonConfig = undefined; 697 | try { 698 | const configResponse = await fetchWithoutCache(CONFIG_FILE); 699 | config = await configResponse.json(); 700 | } catch (e) {} 701 | 702 | // --- Fetch the themes according to the configuration 703 | let themePromises: Promise<ThemeDefinition>[]; 704 | if ((config?.themes ?? []).length === 0 && config?.defaultTheme) { 705 | // --- Special case, we have only a single "defaultTheme" in the configuration 706 | const fetchDefaultTheme = loadThemeFile(`themes/${config?.defaultTheme}.json`); 707 | themePromises = [fetchDefaultTheme]; 708 | } else { 709 | // --- In any other case, we fetch all themes defined in the configuration 710 | themePromises = config?.themes?.map((themePath) => { 711 | return loadThemeFile(themePath); 712 | }); 713 | } 714 | // --- Fetch component files according to the configuration 715 | const componentPromises = config?.components?.map(async (componentPath) => { 716 | const value = await fetchWithoutCache(componentPath); 717 | if (componentPath.endsWith(`.${componentFileExtension}`)) { 718 | return await parseComponentMarkupResponse(value); 719 | } else { 720 | return await parseCodeBehindResponse(value); 721 | } 722 | }); 723 | 724 | // --- Let the promises resolve 725 | const [loadedEntryPoint, loadedComponents, themes] = await Promise.all([ 726 | entryPointPromise, 727 | Promise.all(componentPromises || []), 728 | Promise.all(themePromises || []), 729 | ]); 730 | 731 | // --- Collect the elements of the standalone app (and potential errors) 732 | const errorComponents: ComponentDef[] = []; 733 | 734 | // --- Check if the main component has errors 735 | if (loadedEntryPoint.hasError) { 736 | errorComponents.push(loadedEntryPoint!.component as ComponentDef); 737 | } 738 | 739 | let loadedEntryPointCodeBehind = null; 740 | if (loadedEntryPoint.component.props?.codeBehind !== undefined) { 741 | // --- We have a code-behind file for the main component 742 | loadedEntryPointCodeBehind = (await new Promise(async (resolve) => { 743 | try { 744 | const resp = await fetchWithoutCache( 745 | resolvePath( 746 | MAIN_FILE, 747 | loadedEntryPoint.component.props?.codeBehind || MAIN_CODE_BEHIND_FILE, 748 | ), 749 | ); 750 | const codeBehind = await parseCodeBehindResponse(resp); 751 | resolve(codeBehind.hasError ? codeBehind : codeBehind.codeBehind); 752 | } catch (e) { 753 | resolve(null); 754 | } 755 | })) as any; 756 | if (loadedEntryPointCodeBehind.hasError) { 757 | errorComponents.push(loadedEntryPointCodeBehind.component as ComponentDef); 758 | } 759 | } 760 | 761 | // --- Check if any of the components have markup errors 762 | loadedComponents.forEach((compWrapper) => { 763 | if (compWrapper.hasError) { 764 | errorComponents.push(compWrapper.component as ComponentDef); 765 | } 766 | }); 767 | 768 | // --- Collect the sources and code-behinds 769 | const sources: Record<string, string> = {}; 770 | const codeBehinds: any = {}; 771 | 772 | // --- The main component source 773 | if (loadedEntryPoint.file) { 774 | sources[loadedEntryPoint.file] = loadedEntryPoint.src; 775 | 776 | resolvedRuntime.projectCompilation.entrypoint.filename = MAIN_FILE; 777 | resolvedRuntime.projectCompilation.entrypoint.definition = loadedEntryPoint.component; 778 | resolvedRuntime.projectCompilation.entrypoint.markupSource = loadedEntryPoint.src; 779 | 780 | if (loadedEntryPointCodeBehind?.src !== undefined) { 781 | resolvedRuntime.projectCompilation.entrypoint.codeBehindSource = 782 | loadedEntryPointCodeBehind.src; 783 | } 784 | } 785 | 786 | // --- Components may have code-behind files 787 | loadedComponents.forEach((compWrapper) => { 788 | if (compWrapper?.file?.endsWith(`.${codeBehindFileExtension}`)) { 789 | codeBehinds[compWrapper.file] = compWrapper.codeBehind; 790 | } else { 791 | if (compWrapper.file) { 792 | sources[compWrapper.file] = compWrapper.src; 793 | // resolvedRuntime.projectCompilation.entrypoint.filename = MAIN_FILE; 794 | // resolvedRuntime.projectCompilation.entrypoint.definition = loadedEntryPoint.component; 795 | // resolvedRuntime.projectCompilation.entrypoint.markupSource = loadedEntryPoint.src; 796 | } 797 | } 798 | }); 799 | 800 | // --- Assemble the runtime for the main app file 801 | const entryPointWithCodeBehind = { 802 | ...loadedEntryPoint.component, 803 | vars: { 804 | ...loadedEntryPointCodeBehind?.vars, 805 | ...loadedEntryPoint.component.vars, 806 | }, 807 | functions: loadedEntryPointCodeBehind?.functions, 808 | scriptError: loadedEntryPointCodeBehind?.moduleErrors, 809 | }; 810 | 811 | const defaultTheme = (entryPointWithCodeBehind as ComponentDef).props?.defaultTheme; 812 | // --- We test whether the default theme is not from a binding 813 | // --- expression and is not a built-in theme already loaded. If so, 814 | // --- we load it from the `themes` folder. 815 | if (defaultTheme && typeof defaultTheme === "string" && !defaultTheme.includes("{")) { 816 | if ( 817 | !builtInThemes.find((theme) => theme.id === defaultTheme) && 818 | !themes.find((theme) => theme.id === defaultTheme) 819 | ) { 820 | themes.push(await loadThemeFile(`themes/${defaultTheme}.json`)); 821 | } 822 | } 823 | 824 | // --- Assemble the runtime for the components 825 | const componentsWithCodeBehinds = loadedComponents 826 | .filter((compWrapper) => !compWrapper?.file?.endsWith(".xmlui.xs")) 827 | .map((compWrapper) => { 828 | const componentCodeBehind = codeBehinds[compWrapper.file + ".xs"]; 829 | return { 830 | ...compWrapper.component, 831 | component: { 832 | ...(compWrapper.component as any).component, 833 | vars: { 834 | ...(compWrapper.component as any).component.vars, 835 | ...componentCodeBehind?.vars, 836 | }, 837 | functions: componentCodeBehind?.functions, 838 | scriptError: componentCodeBehind?.moduleErrors, 839 | }, 840 | }; 841 | }); 842 | 843 | // --- We may have components that are not in the configuration file. 844 | // --- We need to load them and their code-behinds. First, we collect 845 | // --- the components to load. 846 | let componentsToLoad = collectMissingComponents( 847 | entryPointWithCodeBehind, 848 | componentsWithCodeBehinds, 849 | undefined, 850 | extensionManager, 851 | ); 852 | 853 | // --- Try to load the components referenced in the markup, collect 854 | // --- those that failed 855 | const componentsFailedToLoad = new Set(); 856 | while (componentsToLoad.size > 0) { 857 | const componentPromises = [...componentsToLoad].map(async (componentPath) => { 858 | try { 859 | // --- Promises for the component markup files 860 | const componentPromise = fetchWithoutCache( 861 | `components/${componentPath}.${componentFileExtension}`, 862 | ); 863 | 864 | // --- Let the promises resolve 865 | const componentMarkup = await componentPromise; 866 | 867 | // --- Parse the component markup and check for errors 868 | const compWrapper = await parseComponentMarkupResponse(componentMarkup); 869 | if (compWrapper.hasError) { 870 | errorComponents.push(compWrapper.component as ComponentDef); 871 | } 872 | 873 | sources[compWrapper.file] = compWrapper.src; 874 | const compCompilation: ComponentCompilation = { 875 | dependencies: new Set(), 876 | filename: compWrapper.file, 877 | markupSource: compWrapper.src, 878 | definition: compWrapper.component as CompoundComponentDef, 879 | }; 880 | 881 | let componentCodeBehind = null; 882 | if ( 883 | "codeBehind" in compWrapper.component && 884 | compWrapper.component?.codeBehind !== undefined 885 | ) { 886 | // --- Promises for the component code-behind files 887 | componentCodeBehind = (await new Promise(async (resolve) => { 888 | try { 889 | const codeBehind = await fetchWithoutCache( 890 | resolvePath( 891 | `components/${componentPath}`, 892 | (compWrapper.component as CompoundComponentDef)?.codeBehind || 893 | `${componentPath}.${codeBehindFileExtension}`, 894 | ), 895 | ); 896 | const codeBehindWrapper = await parseCodeBehindResponse(codeBehind); 897 | if (codeBehindWrapper.hasError) { 898 | errorComponents.push(codeBehindWrapper.component as ComponentDef); 899 | } 900 | resolve( 901 | codeBehindWrapper.hasError 902 | ? (codeBehindWrapper.component as CompoundComponentDef) 903 | : codeBehindWrapper, 904 | ); 905 | } catch { 906 | resolve(null); 907 | } 908 | })) as Promise<CompoundComponentDef | ParsedResponse>; 909 | 910 | if (componentCodeBehind && "src" in componentCodeBehind) { 911 | compCompilation.codeBehindSource = componentCodeBehind.src; 912 | } 913 | } 914 | 915 | resolvedRuntime.projectCompilation.components.push(compCompilation); 916 | 917 | const compoundComp = { 918 | ...compWrapper.component, 919 | component: { 920 | ...(compWrapper.component as any).component, 921 | vars: { 922 | ...(compWrapper.component as any).component.vars, 923 | ...componentCodeBehind?.component?.vars, 924 | }, 925 | }, 926 | }; 927 | 928 | if (componentCodeBehind && "codeBehind" in componentCodeBehind) { 929 | compoundComp.component.functions = componentCodeBehind.codeBehind.functions; 930 | compoundComp.component.scriptError = componentCodeBehind.codeBehind.moduleErrors; 931 | } 932 | 933 | return compoundComp; 934 | } catch (e) { 935 | componentsFailedToLoad.add(componentPath); 936 | return null; 937 | } 938 | }); 939 | const componentWrappers = await Promise.all(componentPromises); 940 | componentsWithCodeBehinds.push(...componentWrappers.filter((comp) => !!comp)); 941 | componentsToLoad = collectMissingComponents( 942 | entryPointWithCodeBehind, 943 | componentsWithCodeBehinds, 944 | componentsFailedToLoad, 945 | extensionManager, 946 | ); 947 | } 948 | // --- Let's check for errors to display 949 | 950 | const newAppDef = { 951 | ...config, 952 | themes, 953 | sources, 954 | components: componentsWithCodeBehinds as any, 955 | entryPoint: entryPointWithCodeBehind, 956 | }; 957 | 958 | const lintErrorComponent = processAppLinting(newAppDef, metadataProvider); 959 | 960 | const errorComponent: ComponentDef | null = 961 | errorComponents.length > 0 962 | ? { 963 | type: "VStack", 964 | props: { gap: 0, padding: 0 }, 965 | children: errorComponents, 966 | } 967 | : null; 968 | if (errorComponent) { 969 | if (lintErrorComponent) { 970 | errorComponent.children!.push(lintErrorComponent); 971 | } 972 | newAppDef.entryPoint = errorComponent; 973 | } else if (lintErrorComponent) { 974 | newAppDef.entryPoint = lintErrorComponent; 975 | } 976 | 977 | discoverCompilationDependencies({ 978 | projectCompilation: resolvedRuntime.projectCompilation, 979 | extensionManager, 980 | }); 981 | 982 | setProjectCompilation(resolvedRuntime.projectCompilation); 983 | setStandaloneApp(newAppDef); 984 | })(); 985 | }, [runtime, standaloneAppDef]); 986 | return { standaloneApp, projectCompilation }; 987 | } 988 | 989 | /** 990 | * Collect the missing components referenced by any part of the app 991 | * @param entryPoint The app's main markup 992 | * @param components The component markups 993 | * @param componentsFailedToLoad The components that failed to load here 994 | * @returns The components that are still missing 995 | */ 996 | function collectMissingComponents( 997 | entryPoint: ComponentDef | CompoundComponentDef, 998 | components: any[], 999 | componentsFailedToLoad = new Set(), 1000 | extensionManager?: StandaloneExtensionManager, 1001 | ) { 1002 | // --- Add the discovered compound components to the registry 1003 | const componentRegistry = new ComponentRegistry( 1004 | { compoundComponents: components }, 1005 | extensionManager, 1006 | ); 1007 | 1008 | // --- Check the xmlui markup. This check will find all unloaded components 1009 | const result = checkXmlUiMarkup(entryPoint as ComponentDef, components, { 1010 | getComponentProps: (componentName) => { 1011 | return componentRegistry.lookupComponentRenderer(componentName)?.descriptor?.props; 1012 | }, 1013 | acceptArbitraryProps: () => { 1014 | return true; 1015 | }, 1016 | getComponentValidator: () => { 1017 | return null; 1018 | }, 1019 | getComponentEvents: () => { 1020 | return null; 1021 | }, 1022 | componentRegistered: (componentName) => { 1023 | return componentRegistry.hasComponent(componentName); 1024 | }, 1025 | }); 1026 | 1027 | componentRegistry.destroy(); 1028 | 1029 | // --- Collect all missing components. 1030 | // Omit the components that failed to load and the ones that are not in #app-ns namespace 1031 | return new Set( 1032 | result 1033 | .filter((r) => r.code === "M001") 1034 | .map((r) => r.args[0].replace("#app-ns.", "")) 1035 | .filter((comp) => !componentsFailedToLoad.has(comp) && !comp.includes(".")), 1036 | ); 1037 | } 1038 | 1039 | // --- This React hook logs the app's version number to the browser's console at startup 1040 | function usePrintVersionNumber(standaloneApp: StandaloneAppDescription | null) { 1041 | const logged = useRef(false); 1042 | useEffect(() => { 1043 | if (logged.current) { 1044 | return; 1045 | } 1046 | logged.current = true; 1047 | let log = `XMLUI version: ${process.env.VITE_XMLUI_VERSION || "dev"}`; 1048 | if (standaloneApp?.name) { 1049 | log += `; ${standaloneApp.name} version: ${process.env.VITE_APP_VERSION || "dev"}`; 1050 | } 1051 | console.log(log); 1052 | }, [standaloneApp?.name]); 1053 | } 1054 | 1055 | let contentRoot: Root | null = null; 1056 | 1057 | /** 1058 | * This function injects the StandaloneApp component into a React app. It looks 1059 | * up a component with the "root" id as the host of the standalone app. If such 1060 | * an element does not exist, it creates a `<div id="root">` element. 1061 | * @param runtime The app's runtime representation 1062 | * @param components The related component's runtime representation 1063 | * @returns The content's root element 1064 | */ 1065 | 1066 | export function startApp( 1067 | runtime: any, 1068 | extensions: Extension[] | Extension = [], 1069 | extensionManager: StandaloneExtensionManager = new StandaloneExtensionManager(), 1070 | ) { 1071 | extensionManager.registerExtension(extensions); 1072 | let rootElement: HTMLElement | null = document.getElementById("root"); 1073 | if (!rootElement) { 1074 | rootElement = document.createElement("div"); 1075 | rootElement.setAttribute("id", "root"); 1076 | document.body.appendChild(rootElement); 1077 | } 1078 | if (!contentRoot) { 1079 | contentRoot = ReactDOM.createRoot(rootElement); 1080 | } 1081 | contentRoot.render(<StandaloneApp runtime={runtime} extensionManager={extensionManager} />); 1082 | return contentRoot; 1083 | } 1084 | 1085 | export default StandaloneApp; 1086 | 1087 | function processAppLinting( 1088 | appDef: StandaloneAppDescription, 1089 | metadataProvider: MetadataProvider, 1090 | ): null | ComponentDef { 1091 | const lintSeverity = getLintSeverity(appDef.appGlobals?.lintSeverity); 1092 | 1093 | if (lintSeverity !== LintSeverity.Skip) { 1094 | const allComponentLints = lintApp({ 1095 | appDef, 1096 | metadataProvider, 1097 | }); 1098 | 1099 | if (allComponentLints.length > 0) { 1100 | if (lintSeverity === LintSeverity.Warning) { 1101 | allComponentLints.forEach(printComponentLints); 1102 | } else if (lintSeverity === LintSeverity.Error) { 1103 | return lintErrorsComponent(allComponentLints); 1104 | } 1105 | } 1106 | return null; 1107 | } 1108 | } 1109 | 1110 | function discoverCompilationDependencies({ 1111 | projectCompilation: { components, entrypoint }, 1112 | extensionManager, 1113 | }: { 1114 | projectCompilation: ProjectCompilation; 1115 | extensionManager?: StandaloneExtensionManager; 1116 | }) { 1117 | const registry = new ComponentRegistry({}, extensionManager); 1118 | 1119 | const entrypointDependencies = discoverDirectComponentDependencies( 1120 | entrypoint.definition, 1121 | registry, 1122 | ); 1123 | entrypoint.dependencies = entrypointDependencies; 1124 | 1125 | for (const componentCompilation of components) { 1126 | const compDependencies = discoverDirectComponentDependencies( 1127 | componentCompilation.definition.component, 1128 | registry, 1129 | ); 1130 | compDependencies.delete(componentCompilation.definition.name); 1131 | componentCompilation.dependencies = compDependencies; 1132 | } 1133 | 1134 | registry.destroy(); 1135 | } 1136 | 1137 | function discoverDirectComponentDependencies( 1138 | entrypoint: ComponentDef, 1139 | registry: ComponentRegistry, 1140 | ): Set<string> { 1141 | return discoverDirectComponentDependenciesHelp(entrypoint, registry, new Set<string>()); 1142 | } 1143 | 1144 | function discoverDirectComponentDependenciesHelp( 1145 | component: ComponentDef, 1146 | registry: ComponentRegistry, 1147 | deps: Set<string>, 1148 | ): Set<string> { 1149 | if (!component) { 1150 | return deps; 1151 | } 1152 | const compName = component.type; 1153 | if (!registry.hasComponent(compName)) { 1154 | deps.add(compName); 1155 | } 1156 | if (!component.children) { 1157 | return deps; 1158 | } 1159 | 1160 | for (const child of component.children) { 1161 | discoverDirectComponentDependenciesHelp(child, registry, deps); 1162 | } 1163 | 1164 | return deps; 1165 | } 1166 | ```