This is page 135 of 181. Use http://codebase.md/xmlui-org/xmlui/tools/vscode/resources/main.tsx?lines=true&page={x} to view the full context.
# Directory Structure
```
├── .changeset
│ └── config.json
├── .eslintrc.cjs
├── .github
│ ├── build-checklist.png
│ ├── ISSUE_TEMPLATE
│ │ ├── bug_report.md
│ │ └── feature_request.md
│ └── workflows
│ ├── deploy-blog.yml
│ ├── 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
│ ├── layout-changes.md
│ ├── 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
│ │ │ ├── rss.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
│ │ └── blog-theme.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
│ │ │ │ ├── make-navpanel-width-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
│ ├── mermaid.md
│ ├── testing-conventions.md
│ └── xmlui-in-a-nutshell.md
├── dev-docs
│ ├── accessibility.md
│ ├── build-system.md
│ ├── build-xmlui.md
│ ├── component-behaviors.md
│ ├── components-with-options.md
│ ├── containers.md
│ ├── data-operations.md
│ ├── glossary.md
│ ├── index.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
│ ├── standalone-app.md
│ ├── ud-components.md
│ └── xmlui-repo.md
├── 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
│ │ │ └── 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
│ │ │ ├── base64-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/parsers/xmlui-parser/transform.ts:
--------------------------------------------------------------------------------
```typescript
1 | import type { ComponentDef, CompoundComponentDef } from "../../abstractions/ComponentDefs";
2 | import { collectCodeBehindFromSource } from "../scripting/code-behind-collect";
3 | import { Node } from "./syntax-node";
4 | import type { ErrorCodes } from "./ParserError";
5 | import { SyntaxKind } from "./syntax-kind";
6 | import { ParserError, errorMessages } from "./ParserError";
7 | import { Parser } from "../scripting/Parser";
8 | import { CharacterCodes } from "./CharacterCodes";
9 | import type { GetText } from "./parser";
10 | import type { ParsedEventValue } from "../../abstractions/scripting/Compilation";
11 |
12 | export const COMPOUND_COMP_ID = "Component";
13 | export const UCRegex = /^[A-Z]/;
14 | export const onPrefixRegex = /^on[A-Z]/;
15 | const propAttrs = ["name", "value"];
16 |
17 | const CDATA_PREFIX_LEN = 9;
18 | const CDATA_POSTFIX_LEN = 3;
19 | const COMPONENT_NAMESPACE_SCHEME = "component-ns";
20 | const APP_NS_KEY = "app-ns";
21 | const APP_NS_VALUE = "#app-ns";
22 | const CORE_NS_KEY = "core-ns";
23 | export const CORE_NAMESPACE_VALUE = "#xmlui-core-ns";
24 |
25 | /** Nodes which got modified or added during transformation keep their own text,
26 | * since they are not present in the original source text */
27 | interface TransformNode extends Node {
28 | text?: string;
29 | }
30 |
31 | const HelperNode = {
32 | property: "property",
33 | event: "event",
34 | variable: "variable",
35 | loaders: "loaders",
36 | uses: "uses",
37 | method: "method",
38 | item: "item",
39 | field: "field",
40 | } as const;
41 |
42 | let lastParseId = 0;
43 |
44 | export function nodeToComponentDef(
45 | node: Node,
46 | originalGetText: GetText,
47 | fileId: string | number,
48 | ): ComponentDef | CompoundComponentDef | null {
49 | const getText = (node: TransformNode) => {
50 | return node.text ?? originalGetText(node);
51 | };
52 |
53 | const element = getTopLvlElement(node, getText);
54 | const preppedElement = prepNode(element);
55 | const usesStack: Map<string, string>[] = [];
56 | const namespaceStack: Map<string, string>[] = [];
57 | return transformTopLvlElement(usesStack, preppedElement);
58 |
59 | function transformTopLvlElement(
60 | usesStack: Map<string, string>[],
61 | node: Node,
62 | ): ComponentDef | CompoundComponentDef | null {
63 | const name = getNamespaceResolvedComponentName(node, getText, namespaceStack);
64 |
65 | if (name === COMPOUND_COMP_ID) {
66 | return collectCompoundComponent(node);
67 | }
68 |
69 | let component: ComponentDef = {
70 | type: name,
71 | debug: {
72 | source: {
73 | start: node.start,
74 | end: node.end,
75 | fileId,
76 | },
77 | },
78 | };
79 |
80 | // --- Done
81 | collectTraits(usesStack, component, node);
82 | return component;
83 | }
84 |
85 | function transformInnerElement(
86 | usesStack: Map<string, string>[],
87 | node: Node,
88 | ): ComponentDef | CompoundComponentDef | null {
89 | const name = getNamespaceResolvedComponentName(node, getText, namespaceStack);
90 |
91 | if (name === COMPOUND_COMP_ID) {
92 | reportError("T006");
93 | }
94 |
95 | let component: ComponentDef = {
96 | type: name,
97 | debug: {
98 | source: {
99 | start: node.start,
100 | end: node.end,
101 | fileId,
102 | },
103 | },
104 | };
105 |
106 | // --- Done
107 | collectTraits(usesStack, component, node);
108 | return component;
109 | }
110 |
111 | function collectCompoundComponent(node: Node) {
112 | const attrs = getAttributes(node).map(segmentAttr);
113 | // --- Validate component name
114 | const compoundName = attrs.find((attr) => attr.name === "name");
115 | if (!compoundName) {
116 | reportError("T003");
117 | }
118 | if (!UCRegex.test(compoundName.value)) {
119 | reportError("T004");
120 | }
121 |
122 | const codeBehind = attrs.find((attr) => attr.name === "codeBehind");
123 |
124 | // --- Get "method" attributes
125 | let api: Record<string, any> | undefined;
126 | const apiAttrs = attrs.filter((attr) => attr.startSegment === "method");
127 | if (apiAttrs.length > 0) {
128 | api = {};
129 | apiAttrs.forEach((attr) => {
130 | api![attr.name] = attr.value;
131 | });
132 | }
133 |
134 | // --- Get var attributes
135 | let vars: Record<string, any> | undefined;
136 | const varsAttrs = attrs.filter((attr) => attr.startSegment === "var");
137 | if (varsAttrs.length > 0) {
138 | vars = {};
139 | varsAttrs.forEach((attr) => {
140 | vars![attr.name] = attr.value;
141 | });
142 | }
143 |
144 | const children = getChildNodes(node);
145 |
146 | // --- Get the single component definition
147 | const nestedComponents = children.filter(
148 | (child) =>
149 | child.kind === SyntaxKind.ElementNode && !(getComponentName(child, getText) in HelperNode),
150 | );
151 | if (nestedComponents.length === 0) {
152 | nestedComponents.push(createTextNodeElement(""));
153 | }
154 |
155 | const nonVarHelperNodes: Node[] = [];
156 | const nestedVars: Node[] = [];
157 | for (let child of children) {
158 | if (child.kind === SyntaxKind.ElementNode) {
159 | const childName = getComponentName(child, getText);
160 | if (childName === HelperNode.variable) {
161 | nestedVars.push(child);
162 | } else if (childName in HelperNode) {
163 | nonVarHelperNodes.push(child);
164 | }
165 | }
166 | }
167 |
168 | // --- Should we wrap with a Fragment?
169 | let element: Node;
170 | if (nestedComponents.length > 1 || nestedVars.length > 0) {
171 | element = wrapWithFragment([...nestedVars, ...nestedComponents]);
172 | } else {
173 | element = nestedComponents[0];
174 | }
175 |
176 | namespaceStack.push(new Map());
177 | // --- Get collect namespace attributes
178 | const nsAttrs = attrs
179 | .filter((attr) => attr.namespace === "xmlns")
180 | .forEach((attr) => {
181 | addToNamespaces(namespaceStack, element, attr.unsegmentedName, attr.value);
182 | });
183 |
184 | let nestedComponent: ComponentDef = transformInnerElement(usesStack, element)! as ComponentDef;
185 | namespaceStack.pop();
186 |
187 | const component: CompoundComponentDef = {
188 | name: compoundName.value,
189 | component: nestedComponent,
190 | debug: {
191 | source: {
192 | start: node.start,
193 | end: node.end,
194 | fileId,
195 | },
196 | },
197 | };
198 |
199 | if (api) {
200 | component.api = api;
201 | }
202 | if (vars) {
203 | nestedComponent.vars = { ...nestedComponent.vars, ...vars };
204 | }
205 | if (codeBehind) {
206 | component.codeBehind = codeBehind.value;
207 | }
208 |
209 | nestedComponent.debug = {
210 | source: {
211 | start: element.start,
212 | end: element.end,
213 | fileId,
214 | },
215 | };
216 |
217 | const nodeClone: Node = withNewChildNodes(node, nonVarHelperNodes);
218 | collectTraits(usesStack, component, nodeClone);
219 | return component;
220 | }
221 |
222 | /**
223 | * Collects component traits from attributes and child elements
224 | * @param comp Component definition
225 | * @param element Component element
226 | */
227 | function collectTraits(
228 | usesStack: Map<string, string>[],
229 | comp: ComponentDef | CompoundComponentDef,
230 | element: Node,
231 | ): void {
232 | const isCompound = !isComponent(comp);
233 |
234 | const attributes = getAttributes(element);
235 |
236 | namespaceStack.push(new Map());
237 | // --- Process attributes
238 | attributes.forEach((attr: Node) => {
239 | // --- Process the attribute
240 | collectAttribute(comp, attr);
241 | });
242 | const childNodes = getChildNodes(element);
243 |
244 | // --- Process child nodes
245 | childNodes.forEach((child: Node) => {
246 | if (child.kind === SyntaxKind.Script) {
247 | if (getAttributes(child).length > 0) {
248 | reportError("T022");
249 | }
250 | const scriptText = getText(child);
251 | const scriptContent = scriptText.slice(
252 | scriptText.indexOf(">") + 1,
253 | scriptText.lastIndexOf("</"),
254 | );
255 |
256 | comp.script ??= "";
257 | if (comp.script.length > 0) {
258 | comp.script += "\n";
259 | }
260 | comp.script += scriptContent;
261 | return;
262 | }
263 |
264 | // --- Single text element, consider it a child name
265 | if (child.kind === SyntaxKind.TextNode && !isCompound) {
266 | comp.children = mergeValue(comp.children, getText(child));
267 | return;
268 | }
269 |
270 | const childName = getComponentName(child, getText);
271 | if (isCompound && child.kind === SyntaxKind.ElementNode && !(childName in HelperNode)) {
272 | // --- This is the single nested component definition of a compound component,
273 | // --- it is already processed
274 | return;
275 | }
276 |
277 | // --- Element name starts with an uppercase letter
278 | if (!(childName in HelperNode) && !isCompound) {
279 | // if (UCRegex.test(childName) && !isCompound) {
280 | // --- This must be a child component
281 | // maybe here or in the transformInnerElement function, after the compound comp check
282 | const childComponent = transformInnerElement(usesStack, child);
283 | if (childComponent) {
284 | if (!comp.children) {
285 | comp.children = [childComponent as ComponentDef];
286 | } else {
287 | if (typeof comp.children === "string") {
288 | comp.children = [comp.children as any, childComponent];
289 | } else if (Array.isArray(comp.children)) {
290 | comp.children.push(childComponent as any);
291 | }
292 | }
293 | }
294 | return;
295 | }
296 |
297 | // --- Element with a lowercase start letter, it must be some traits of the host component
298 | switch (childName) {
299 | case "property":
300 | collectElementHelper(
301 | usesStack,
302 | comp,
303 | child,
304 |
305 | (name) => (isComponent(comp) ? comp.props?.[name] : undefined),
306 | (name, value) => {
307 | if (!isComponent(comp)) return;
308 | comp.props ??= {};
309 | comp.props[name] = value;
310 | },
311 | );
312 | return;
313 |
314 | case "event":
315 | collectElementHelper(
316 | usesStack,
317 | comp,
318 | child,
319 |
320 | (name) => (isComponent(comp) ? comp.events?.[name] : undefined),
321 | (name, value) => {
322 | if (!isComponent(comp)) return;
323 | comp.events ??= {};
324 | comp.events[name] = parseEvent(value);
325 | },
326 | (name) => {
327 | if (onPrefixRegex.test(name)) {
328 | reportError("T008", name);
329 | }
330 | },
331 | );
332 | return;
333 |
334 | case HelperNode.variable:
335 | collectElementHelper(
336 | usesStack,
337 | comp,
338 | child,
339 |
340 | (name) => (isComponent(comp) ? comp.vars?.[name] : undefined),
341 | (name, value) => {
342 | if (!isComponent(comp)) return;
343 | comp.vars ??= {};
344 | comp.vars[name] = value;
345 | },
346 | );
347 | return;
348 |
349 | case "loaders":
350 | collectLoadersElements(usesStack, comp, child);
351 | return;
352 |
353 | case "uses":
354 | collectUsesElements(comp, child);
355 | return;
356 |
357 | case "method":
358 | collectElementHelper(
359 | usesStack,
360 | comp,
361 | child,
362 |
363 | (name) => (isComponent(comp) ? comp.api?.[name] : undefined),
364 | (name, value) => {
365 | comp.api ??= {};
366 | comp.api[name] = value;
367 | },
368 | );
369 | return;
370 |
371 | default:
372 | reportError("T009", childName);
373 | return;
374 | }
375 | });
376 |
377 | namespaceStack.pop();
378 |
379 | if (!comp.script || comp.script.trim().length === 0) {
380 | // --- No (or whitespace only) script
381 | return;
382 | }
383 |
384 | // --- Run the parse and collect on scripts
385 | const parser = new Parser(comp.script);
386 | try {
387 | // --- We parse the module file to catch parsing errors
388 | parser.parseStatements();
389 | comp.scriptCollected = collectCodeBehindFromSource("Main", comp.script);
390 | } catch (err) {
391 | if (parser.errors && parser.errors.length > 0) {
392 | const errMsg = parser.errors[0];
393 | throw new ParserError(`${errMsg.text} [${errMsg.line}: ${errMsg.column}]`, errMsg.code);
394 | } else {
395 | comp.scriptError = err;
396 | }
397 | }
398 |
399 | // --- We may have module parsing/execution errors
400 | const moduleErrors = comp.scriptCollected?.moduleErrors ?? {};
401 | if (Object.keys(moduleErrors).length > 0) {
402 | comp.scriptError = moduleErrors;
403 | }
404 | }
405 |
406 | function collectAttribute(comp: ComponentDef | CompoundComponentDef, attr: Node) {
407 | const { namespace, startSegment, name, value, unsegmentedName: nsKey } = segmentAttr(attr);
408 |
409 | if (namespace === "xmlns") {
410 | return addToNamespaces(namespaceStack, comp, nsKey, value);
411 | }
412 |
413 | const isCompound = !isComponent(comp);
414 | // --- Handle single-word attributes
415 | if (isCompound) {
416 | if (startSegment && startSegment !== "method" && startSegment !== "var") {
417 | reportError("T021");
418 | return;
419 | }
420 |
421 | if (name === "name" && !startSegment) {
422 | // --- We already processed name
423 | return;
424 | }
425 |
426 | if (name === "codeBehind" && !startSegment) {
427 | // --- We already processed codeBehind
428 | return;
429 | }
430 |
431 | // --- Compound components do not have any other attributable props
432 | if (!startSegment && name) {
433 | reportError("T021", name);
434 | }
435 | return;
436 | }
437 |
438 | // --- Recognize special attributes by component definition type
439 | switch (name) {
440 | case "id":
441 | comp.uid = value;
442 | return;
443 | case "testId":
444 | comp.testId = value;
445 | return;
446 | case "when":
447 | comp.when = value;
448 | return;
449 | case "uses":
450 | comp.uses = splitUsesValue(value);
451 | return;
452 | default:
453 | if (startSegment === "var") {
454 | comp.vars ??= {};
455 | comp.vars[name] = value;
456 | } else if (startSegment === "method") {
457 | comp.api ??= {};
458 | comp.api[name] = value;
459 | } else if (startSegment === "event") {
460 | comp.events ??= {};
461 | comp.events[name] = parseEvent(value);
462 | } else if (onPrefixRegex.test(name)) {
463 | comp.events ??= {};
464 | const eventName = name[2].toLowerCase() + name.substring(3);
465 | comp.events[eventName] = parseEvent(value);
466 | } else {
467 | comp.props ??= {};
468 | comp.props[name] = value;
469 | }
470 | return;
471 | }
472 | }
473 |
474 | function collectObjectOrArray(usesStack: Map<string, string>[], children?: Node[]): any {
475 | let result: any = null;
476 |
477 | // --- No children, it's a null object
478 | if (!children) return result;
479 | let nestedElementType: string | null = null;
480 |
481 | children.forEach((child) => {
482 | if (child.kind === SyntaxKind.TextNode) {
483 | result = mergeValue(result, getText(child));
484 | return;
485 | }
486 |
487 | if (child.kind !== SyntaxKind.ElementNode) return;
488 | const childName = getComponentName(child, getText);
489 | // --- The only element names we accept are "field" or "item"
490 | if (childName !== "field" && childName !== "item") {
491 | reportError("T016");
492 | return;
493 | }
494 |
495 | if (childName === "field") {
496 | if (!nestedElementType) {
497 | // --- First nested element is "field", so we have an object
498 | nestedElementType = childName;
499 | result = {};
500 | } else if (nestedElementType !== childName) {
501 | reportError("T017");
502 | return;
503 | }
504 | } else if (childName === "item") {
505 | if (!nestedElementType) {
506 | // --- First nested element is "item", so we have an array
507 | nestedElementType = childName;
508 | result = [];
509 | } else if (nestedElementType !== childName) {
510 | reportError("T017");
511 | return;
512 | }
513 | }
514 |
515 | // --- Get the field value
516 | let valueInfo = collectValue(usesStack, child, childName === "field");
517 | if (!valueInfo) {
518 | return null;
519 | }
520 |
521 | // --- Does the field have a value?
522 | if (nestedElementType === "field") {
523 | result[valueInfo.name!] = valueInfo.value;
524 | } else {
525 | result.push(valueInfo.value);
526 | }
527 | });
528 | return result;
529 | }
530 |
531 | function collectValue(
532 | usesStack: Map<string, string>[],
533 | element: Node,
534 | allowName = true,
535 | ): { name?: string; value: any } | null {
536 | const elementName = getComponentName(element, getText);
537 | // --- Accept only "name", "value"
538 | const childNodes = getChildNodes(element);
539 | const nestedComponents = childNodes.filter(
540 | (c) => c.kind === SyntaxKind.ElementNode && UCRegex.test(getComponentName(c, getText)),
541 | );
542 | const nestedElements = childNodes.filter(
543 | (c) => c.kind === SyntaxKind.ElementNode && !UCRegex.test(getComponentName(c, getText)),
544 | );
545 | const attributes = getAttributes(element).map(segmentAttr);
546 |
547 | const attrProps = attributes.filter((attr) => propAttrs.indexOf(attr.name) >= 0);
548 | if (attributes.length > attrProps.length) {
549 | reportError("T011", elementName);
550 | return null;
551 | }
552 |
553 | // --- Validate the "name" usage
554 | const nameAttr = attrProps.find((attr) => attr.name === "name");
555 | if (allowName) {
556 | if (!nameAttr?.value) {
557 | reportError("T012", elementName);
558 | return null;
559 | }
560 | } else {
561 | if (nameAttr) {
562 | reportError("T018", elementName);
563 | return null;
564 | }
565 | }
566 | const name = nameAttr?.value;
567 |
568 | // --- Get the value attribute
569 | const valueAttr = attrProps.find((attr) => attr.name === "value");
570 | if (valueAttr && valueAttr.value === undefined) {
571 | reportError("T019", elementName);
572 | return null;
573 | }
574 |
575 | // --- Let's handle a special case, when the value is a component definition
576 | if (name && nestedComponents.length >= 1) {
577 | if (nestedElements.length > 0) {
578 | reportError("T020");
579 | return null;
580 | }
581 | // --- We expect a component definition here!
582 | const nestedComps = nestedComponents.map((nc) => transformInnerElement(usesStack, nc));
583 | return {
584 | name,
585 | value: nestedComps.length === 1 ? nestedComps[0] : nestedComps,
586 | };
587 | }
588 |
589 | // --- At this point, all attributes are ok, let's get the value.
590 | let value = valueAttr?.value;
591 |
592 | if (value === null) {
593 | return null;
594 | }
595 |
596 | if (typeof value === "string") {
597 | return { name, value };
598 | }
599 |
600 | return { name, value: collectObjectOrArray(usesStack, childNodes) };
601 | }
602 |
603 | function collectLoadersElements(
604 | usesStack: Map<string, string>[],
605 | comp: ComponentDef | CompoundComponentDef,
606 | loaders: Node,
607 | ): void {
608 | if (!isComponent(comp)) {
609 | reportError("T009", "loaders");
610 | return;
611 | }
612 |
613 | const children = getChildNodes(loaders);
614 | //todo: this check seems not necesarry
615 | if (children.length === 0) {
616 | comp.loaders ??= [];
617 | }
618 |
619 | const hasAttribute = loaders.children?.some((c) => c.kind === SyntaxKind.AttributeListNode);
620 | if (hasAttribute) {
621 | reportError("T014", "attributes");
622 | return;
623 | }
624 |
625 | children.forEach((loader) => {
626 | // --- Test is not supported
627 | if (loader.kind === SyntaxKind.TextNode) {
628 | reportError("T010", "loader");
629 | return;
630 | }
631 |
632 | // todo: is this needed?
633 | // --- Just for the sake of being sure...
634 | // if (loader.type !== "Element") return;
635 |
636 | const loaderDef = transformInnerElement(usesStack, loader) as ComponentDef;
637 |
638 | // --- Get the uid value
639 | if (!loaderDef.uid) {
640 | reportError("T013");
641 | return;
642 | }
643 |
644 | // --- Check props that a loader must not have
645 | if ((loaderDef as any).vars) {
646 | reportError("T014", "vars");
647 | return;
648 | }
649 |
650 | if ((loaderDef as any).loaders) {
651 | reportError("T014", "loaders");
652 | return;
653 | }
654 |
655 | if ((loaderDef as any).uses) {
656 | reportError("T014", "uses");
657 | return;
658 | }
659 |
660 | // --- Store this loader
661 | comp.loaders ??= [];
662 | comp.loaders.push(loaderDef);
663 | });
664 | }
665 |
666 | function collectElementHelper(
667 | usesStack: Map<string, string>[],
668 | comp: ComponentDef | CompoundComponentDef,
669 | child: Node,
670 | getter: (name: string) => any,
671 | setter: (name: string, value: string) => void,
672 | nameValidator?: (name: string) => void,
673 | ): void {
674 | // --- Compound component do not have a uses
675 |
676 | // --- Get the value
677 | const valueInfo = collectValue(usesStack, child);
678 | if (!valueInfo) {
679 | return;
680 | }
681 |
682 | // --- Extra name validation, if required so
683 | nameValidator?.(valueInfo?.name ?? "");
684 |
685 | const name = valueInfo.name!;
686 | const value = valueInfo.value;
687 | if (valueInfo?.value !== undefined) {
688 | setter(name, mergeValue(getter(name), value));
689 | } else {
690 | // --- Consider the value to be null; check optional child items
691 | const children = getChildNodes(child);
692 | const itemValue = collectObjectOrArray(usesStack, children);
693 | let updatedValue = getter(name);
694 | updatedValue = mergeValue(updatedValue, itemValue);
695 | setter(name, updatedValue);
696 | }
697 | }
698 |
699 | function collectUsesElements(comp: ComponentDef | CompoundComponentDef, usesNode: Node): void {
700 | // --- Compound component do not have a uses
701 | if (!isComponent(comp)) {
702 | reportError("T009", "uses");
703 | return;
704 | }
705 |
706 | const attributes = getAttributes(usesNode).map(segmentAttr);
707 | const valueAttr = attributes.find((attr) => attr.name === "value");
708 | if (!valueAttr?.value || attributes.length !== 1) {
709 | reportError("T015", "uses");
710 | return;
711 | }
712 |
713 | // --- Extract the value
714 | const usesValues = splitUsesValue(valueAttr.value);
715 | if (comp.uses) {
716 | comp.uses.push(...usesValues);
717 | } else {
718 | comp.uses = usesValues;
719 | }
720 | }
721 |
722 | function segmentAttr(attr: Node): {
723 | namespace?: string;
724 | startSegment?: string;
725 | name?: string;
726 | value: string;
727 | unsegmentedName: string;
728 | } {
729 | let key = attr.children![0];
730 | const hasNamespace = key.children!.length === 3;
731 | let namespace: undefined | string;
732 | if (hasNamespace) {
733 | namespace = getText(key.children![0]);
734 | }
735 | let unsegmentedName = getText(key.children![key.children!.length - 1]);
736 | const segments = unsegmentedName.split(".");
737 | if (segments.length > 2) {
738 | reportError("T007", attr, key);
739 | }
740 |
741 | let name: string | undefined;
742 | let startSegment: string | undefined;
743 |
744 | if (segments.length === 2) {
745 | startSegment = segments[0];
746 | name = segments[1];
747 | if (name.trim() === "") {
748 | reportError("T007", attr, name);
749 | }
750 | } else {
751 | //TODO: remove asigning name when name === unsegmentedName. It is there for backwards compat
752 | name = unsegmentedName;
753 | }
754 | const valueText = getText(attr.children![2]);
755 | const value = valueText.substring(1, valueText.length - 1);
756 | return { namespace, startSegment, name, value, unsegmentedName };
757 | }
758 |
759 | function parseEscapeCharactersInAttrValues(attrs: Node[]) {
760 | for (let attr of attrs) {
761 | const attrValue = attr.children![attr.children!.length - 1] as TransformNode;
762 | const escapedText = tryEscapeEntities(getText(attrValue));
763 | if (escapedText !== null) {
764 | attrValue.text = escapedText;
765 | }
766 | }
767 | }
768 |
769 | function prepNode(node: Node): Node {
770 | const childNodes: TransformNode[] = getChildNodes(node);
771 | const tagName = getComponentName(node, getText);
772 | const hasComponentName = !(tagName in HelperNode);
773 | const shouldUseTextNodeElement = hasComponentName || tagName === "property";
774 | const shouldCollapseWhitespace = tagName !== "event" && tagName !== "method";
775 | const attrs = getAttributes(node);
776 |
777 | desugarKeyOnlyAttrs(attrs);
778 | parseEscapeCharactersInAttrValues(attrs);
779 | parseEscapeCharactersInContent(childNodes);
780 |
781 | mergeConsecutiveTexts(childNodes, shouldCollapseWhitespace);
782 | let shouldUseCData = false;
783 | let hasScriptChild = false;
784 |
785 | for (let i = 0; i < childNodes.length; ++i) {
786 | const child = childNodes[i];
787 | let newChild: TransformNode;
788 |
789 | if (child.kind == SyntaxKind.Script) {
790 | hasScriptChild = true;
791 | continue;
792 | }
793 | if (child.kind === SyntaxKind.ElementNode) {
794 | newChild = prepNode(child);
795 | childNodes[i] = newChild;
796 | continue;
797 | }
798 |
799 | let textValue = getText(child);
800 |
801 | if (child.kind === SyntaxKind.StringLiteral) {
802 | textValue = textValue.slice(1, -1);
803 | } else if (child.kind === SyntaxKind.CData) {
804 | shouldUseCData = true;
805 | } else if (child.kind === SyntaxKind.TextNode) {
806 | }
807 |
808 | if (shouldUseTextNodeElement) {
809 | if (shouldUseCData) {
810 | newChild = createTextNodeCDataElement(textValue);
811 | } else {
812 | newChild = createTextNodeElement(textValue);
813 | }
814 | } else {
815 | newChild = {
816 | kind: SyntaxKind.TextNode,
817 | text: textValue,
818 | } as TransformNode;
819 | }
820 | childNodes[i] = newChild;
821 | }
822 |
823 | const helperNodes = [];
824 | const otherNodes = [];
825 | let hasComponentChild = false;
826 | for (const child of childNodes) {
827 | if (child.kind === SyntaxKind.ElementNode) {
828 | let compName: string = getComponentName(child, getText) ?? undefined;
829 | if (compName in HelperNode) {
830 | helperNodes.push(child);
831 | continue;
832 | }
833 | hasComponentChild = true;
834 | }
835 | otherNodes.push(child);
836 | }
837 |
838 | if (hasScriptChild && hasComponentChild) {
839 | const fragment = wrapWithFragment(otherNodes);
840 | helperNodes.push(fragment);
841 | return withNewChildNodes(node, helperNodes);
842 | }
843 |
844 | return node;
845 | }
846 |
847 | function collapseWhitespace(childNodes: TransformNode[]) {
848 | for (let i = 0; i < childNodes.length; ++i) {
849 | if (
850 | childNodes[i].kind === SyntaxKind.StringLiteral ||
851 | childNodes[i].kind === SyntaxKind.TextNode
852 | ) {
853 | //the union is the same as \s , but took \u00a0 (non breaking space) out
854 | //source https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions/Cheatsheet
855 | const allSubsequentWsExceptNonBreakingSpace =
856 | /[\f\n\r\t\v\u0020\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/g;
857 | childNodes[i].text = getText(childNodes[i]).replace(
858 | allSubsequentWsExceptNonBreakingSpace,
859 | " ",
860 | );
861 | }
862 | }
863 | }
864 |
865 | function stripCDataWrapper(childNodes: TransformNode[]) {
866 | for (let i = 0; i < childNodes.length; ++i) {
867 | if (childNodes[i].kind === SyntaxKind.CData) {
868 | childNodes[i].text = getText(childNodes[i]).slice(CDATA_PREFIX_LEN, -CDATA_POSTFIX_LEN);
869 | }
870 | }
871 | }
872 |
873 | function parseEscapeCharactersInContent(childNodes: TransformNode[]) {
874 | for (let node of childNodes) {
875 | if (node.kind === SyntaxKind.StringLiteral || node.kind === SyntaxKind.TextNode) {
876 | const escapedText = tryEscapeEntities(getText(node));
877 | if (escapedText !== null) {
878 | node.text = escapedText;
879 | }
880 | }
881 | }
882 | }
883 |
884 | function tryEscapeEntities(text: string): string | null {
885 | let newText = "";
886 | let startOfSubstr = 0;
887 | for (let i = 0; i < text.length; ++i) {
888 | if (text.charCodeAt(i) === CharacterCodes.ampersand) {
889 | switch (text.charCodeAt(i + 1)) {
890 | //&a
891 | case CharacterCodes.a:
892 | switch (text.charCodeAt(i + 2)) {
893 | //am
894 | case CharacterCodes.m:
895 | //amp;
896 | if (
897 | text.charCodeAt(i + 3) === CharacterCodes.p &&
898 | text.charCodeAt(i + 4) === CharacterCodes.semicolon
899 | ) {
900 | newText = newText + text.substring(startOfSubstr, i) + "&";
901 | i += 4;
902 | startOfSubstr = i + 1;
903 | }
904 | break;
905 | //ap
906 | case CharacterCodes.p:
907 | //apos;
908 | if (
909 | text.charCodeAt(i + 3) === CharacterCodes.o &&
910 | text.charCodeAt(i + 4) === CharacterCodes.s &&
911 | text.charCodeAt(i + 5) === CharacterCodes.semicolon
912 | ) {
913 | newText = newText + text.substring(startOfSubstr, i) + "'";
914 | i += 5;
915 | startOfSubstr = i + 1;
916 | }
917 | break;
918 | }
919 | break;
920 | //&g
921 | case CharacterCodes.g:
922 | //\gt;
923 | if (
924 | text.charCodeAt(i + 2) === CharacterCodes.t &&
925 | text.charCodeAt(i + 3) === CharacterCodes.semicolon
926 | ) {
927 | newText = newText + text.substring(startOfSubstr, i) + ">";
928 | i += 3;
929 | startOfSubstr = i + 1;
930 | }
931 | break;
932 | //&l
933 | case CharacterCodes.l:
934 | //<
935 | if (
936 | text.charCodeAt(i + 2) === CharacterCodes.t &&
937 | text.charCodeAt(i + 3) === CharacterCodes.semicolon
938 | ) {
939 | newText = newText + text.substring(startOfSubstr, i) + "<";
940 | i += 3;
941 | startOfSubstr = i + 1;
942 | }
943 | break;
944 | //&q
945 | case CharacterCodes.q:
946 | //"
947 | if (
948 | text.charCodeAt(i + 2) === CharacterCodes.u &&
949 | text.charCodeAt(i + 3) === CharacterCodes.o &&
950 | text.charCodeAt(i + 4) === CharacterCodes.t &&
951 | text.charCodeAt(i + 5) === CharacterCodes.semicolon
952 | ) {
953 | newText = newText + text.substring(startOfSubstr, i) + '"';
954 | i += 5;
955 | startOfSubstr = i + 1;
956 | }
957 | break;
958 | //&n
959 | case CharacterCodes.n:
960 | //
961 | if (
962 | text.charCodeAt(i + 2) === CharacterCodes.b &&
963 | text.charCodeAt(i + 3) === CharacterCodes.s &&
964 | text.charCodeAt(i + 4) === CharacterCodes.p &&
965 | text.charCodeAt(i + 5) === CharacterCodes.semicolon
966 | ) {
967 | newText = newText + text.substring(startOfSubstr, i) + "\xa0";
968 | i += 5;
969 | startOfSubstr = i + 1;
970 | }
971 | break;
972 | }
973 | }
974 | }
975 | if (startOfSubstr === 0) {
976 | return null;
977 | }
978 | newText += text.substring(startOfSubstr);
979 | return newText;
980 | }
981 |
982 | function mergeConsecutiveTexts(childNodes: TransformNode[], shouldCollapseWs: boolean) {
983 | if (shouldCollapseWs) {
984 | collapseWhitespace(childNodes);
985 | }
986 | stripCDataWrapper(childNodes);
987 |
988 | for (let i = childNodes.length - 1; i > 0; --i) {
989 | const node = childNodes[i - 1];
990 | const nextNode = childNodes[i];
991 |
992 | if (node.kind === SyntaxKind.StringLiteral && nextNode.kind === SyntaxKind.CData) {
993 | childNodes[i - 1] = {
994 | kind: SyntaxKind.CData,
995 | text: getText(node).slice(1, -1) + getText(nextNode),
996 | } as TransformNode;
997 | childNodes.pop();
998 | } else if (node.kind === SyntaxKind.CData && nextNode.kind === SyntaxKind.StringLiteral) {
999 | childNodes[i - 1] = {
1000 | kind: SyntaxKind.CData,
1001 | text: getText(node) + getText(nextNode).slice(1, -1),
1002 | } as TransformNode;
1003 | childNodes.pop();
1004 | } else if (node.kind === SyntaxKind.CData && nextNode.kind === SyntaxKind.TextNode) {
1005 | childNodes[i - 1] = {
1006 | kind: SyntaxKind.CData,
1007 | text: getText(node) + getText(nextNode),
1008 | } as TransformNode;
1009 | childNodes.pop();
1010 | } else if (node.kind === SyntaxKind.CData && nextNode.kind === SyntaxKind.CData) {
1011 | childNodes[i - 1] = {
1012 | kind: SyntaxKind.CData,
1013 | text: getText(node) + getText(nextNode),
1014 | } as TransformNode;
1015 | childNodes.pop();
1016 | } else if (node.kind === SyntaxKind.TextNode && nextNode.kind === SyntaxKind.TextNode) {
1017 | if (getText(node).endsWith(" ") && getText(nextNode).startsWith(" ")) {
1018 | node.text = getText(node).trimEnd();
1019 | }
1020 | childNodes[i - 1] = {
1021 | kind: SyntaxKind.TextNode,
1022 | text: getText(node) + getText(nextNode),
1023 | } as TransformNode;
1024 | childNodes.pop();
1025 | } else if (node.kind === SyntaxKind.TextNode && nextNode.kind === SyntaxKind.CData) {
1026 | childNodes[i - 1] = {
1027 | kind: SyntaxKind.CData,
1028 | text: getText(node) + getText(nextNode),
1029 | } as TransformNode;
1030 | childNodes.pop();
1031 | }
1032 | }
1033 | }
1034 |
1035 | function parseEvent(value: any): any {
1036 | if (typeof value !== "string") {
1037 | // --- It must be a component definition in the event code
1038 | return value;
1039 | }
1040 |
1041 | // --- Parse the event code
1042 | const parser = new Parser(value);
1043 | try {
1044 | const statements = parser.parseStatements();
1045 | return {
1046 | __PARSED: true,
1047 | statements,
1048 | parseId: ++lastParseId,
1049 | // TODO: retrieve the event source code only in dev mode
1050 | source: value,
1051 | } as ParsedEventValue;
1052 | } catch {
1053 | if (parser.errors.length > 0) {
1054 | const errMsg = parser.errors[0];
1055 | throw new ParserError(`${errMsg.text} [${errMsg.line}: ${errMsg.column}]`, errMsg.code);
1056 | }
1057 | }
1058 | }
1059 | }
1060 |
1061 | function createTextNodeCDataElement(textValue: string): Node {
1062 | return {
1063 | kind: SyntaxKind.ElementNode,
1064 | children: [
1065 | { kind: SyntaxKind.OpenNodeStart },
1066 | {
1067 | kind: SyntaxKind.TagNameNode,
1068 | children: [{ kind: SyntaxKind.Identifier, text: "TextNodeCData" }],
1069 | },
1070 | {
1071 | kind: SyntaxKind.AttributeListNode,
1072 | children: [
1073 | {
1074 | kind: SyntaxKind.AttributeNode,
1075 | children: [
1076 | {
1077 | kind: SyntaxKind.AttributeKeyNode,
1078 | children: [{ kind: SyntaxKind.Identifier, text: "value" }],
1079 | },
1080 | { kind: SyntaxKind.Equal },
1081 | { kind: SyntaxKind.Identifier, text: `"${textValue}"` },
1082 | ],
1083 | },
1084 | ],
1085 | },
1086 | { kind: SyntaxKind.NodeClose },
1087 | ],
1088 | } as Node;
1089 | }
1090 |
1091 | function createTextNodeElement(textValue: string): Node {
1092 | return {
1093 | kind: SyntaxKind.ElementNode,
1094 | children: [
1095 | { kind: SyntaxKind.OpenNodeStart },
1096 | {
1097 | kind: SyntaxKind.TagNameNode,
1098 | children: [{ kind: SyntaxKind.Identifier, text: "TextNode" }],
1099 | },
1100 | {
1101 | kind: SyntaxKind.AttributeListNode,
1102 | children: [
1103 | {
1104 | kind: SyntaxKind.AttributeNode,
1105 | children: [
1106 | {
1107 | kind: SyntaxKind.AttributeKeyNode,
1108 | children: [{ kind: SyntaxKind.Identifier, text: "value" }],
1109 | },
1110 | { kind: SyntaxKind.Equal },
1111 | { kind: SyntaxKind.Identifier, text: `"${textValue}"` },
1112 | ],
1113 | },
1114 | ],
1115 | },
1116 | { kind: SyntaxKind.NodeClose },
1117 | ],
1118 | } as Node;
1119 | }
1120 |
1121 | /**
1122 | * Reports the specified error
1123 | * @param errorCode Error code
1124 | * @param options Error message options
1125 | */
1126 | function reportError(errorCode: ErrorCodes, ...options: any[]): void {
1127 | let errorText: string = errorMessages[errorCode] ?? "Unknown error";
1128 | if (options) {
1129 | options.forEach((o, idx) => (errorText = replace(errorText, `{${idx}}`, o.toString())));
1130 | }
1131 | throw new ParserError(errorText, errorCode);
1132 |
1133 | function replace(input: string, placeholder: string, replacement: string): string {
1134 | do {
1135 | input = input.replace(placeholder, replacement);
1136 | } while (input.includes(placeholder));
1137 | return input;
1138 | }
1139 | }
1140 |
1141 | function isComponent(obj: ComponentDef | CompoundComponentDef): obj is ComponentDef {
1142 | return (obj as any).type;
1143 | }
1144 |
1145 | function mergeValue(oldValue: any, itemValue: any): any {
1146 | if (oldValue) {
1147 | if (Array.isArray(oldValue)) {
1148 | if (typeof oldValue === "string") {
1149 | return [oldValue, itemValue];
1150 | } else {
1151 | oldValue.push(itemValue);
1152 | return oldValue;
1153 | }
1154 | } else {
1155 | return [oldValue, itemValue];
1156 | }
1157 | } else {
1158 | return itemValue;
1159 | }
1160 | }
1161 |
1162 | function wrapWithFragment(wrappedChildren: Node[]): TransformNode {
1163 | const nameNode = {
1164 | kind: SyntaxKind.TagNameNode,
1165 | children: [{ kind: SyntaxKind.Identifier, text: "Fragment" }],
1166 | };
1167 | return {
1168 | kind: SyntaxKind.ElementNode,
1169 | start: wrappedChildren[0].start,
1170 | pos: wrappedChildren[0].pos,
1171 | end: wrappedChildren[wrappedChildren.length - 1].end,
1172 | children: [
1173 | { kind: SyntaxKind.OpenNodeStart },
1174 | nameNode,
1175 | { kind: SyntaxKind.NodeEnd },
1176 | { kind: SyntaxKind.ContentListNode, children: wrappedChildren },
1177 | { kind: SyntaxKind.CloseNodeStart },
1178 | nameNode,
1179 | { kind: SyntaxKind.NodeEnd },
1180 | ],
1181 | } as TransformNode;
1182 | }
1183 |
1184 | function getAttributes(node: Node): Node[] {
1185 | return node.children?.find((c) => c.kind === SyntaxKind.AttributeListNode)?.children ?? [];
1186 | }
1187 |
1188 | function getChildNodes(node: Node): Node[] {
1189 | return node.children?.find((c) => c.kind === SyntaxKind.ContentListNode)?.children ?? [];
1190 | }
1191 |
1192 | function withNewChildNodes(node: Node, newChildren: Node[]) {
1193 | const childrenListIdx = node.children?.findIndex((c) => c.kind === SyntaxKind.ContentListNode);
1194 | if (childrenListIdx === undefined || childrenListIdx === -1) {
1195 | return node;
1196 | }
1197 | const contentListChild = node.children![childrenListIdx];
1198 | return new Node(node.kind, node.pos ?? 0, node.end ?? 0, node.triviaBefore, [
1199 | ...node.children!.slice(0, childrenListIdx),
1200 | new Node(
1201 | contentListChild.kind,
1202 | contentListChild.pos ?? 0,
1203 | contentListChild.end ?? 0,
1204 | undefined,
1205 | newChildren,
1206 | ),
1207 | ...node.children!.slice(childrenListIdx),
1208 | ]);
1209 | }
1210 |
1211 | function desugarKeyOnlyAttrs(attrs: Node[]) {
1212 | for (let attr of attrs) {
1213 | if (attr.children?.length === 1) {
1214 | const eq = {
1215 | kind: SyntaxKind.Equal,
1216 | } as Node;
1217 | const value = {
1218 | kind: SyntaxKind.StringLiteral,
1219 | text: '"true"',
1220 | } as TransformNode;
1221 | attr.children!.push(eq, value);
1222 | }
1223 | }
1224 | }
1225 |
1226 | function addToNamespaces(
1227 | namespaceStack: Map<string, string>[],
1228 | comp: any,
1229 | nsKey: string,
1230 | value: string,
1231 | ) {
1232 | let nsCommaSeparated = value.split(":");
1233 | if (nsCommaSeparated.length > 2) {
1234 | return reportError("T028", value, "Namespace cannot contain multiple ':' (colon).");
1235 | }
1236 |
1237 | let nsValue = value;
1238 | if (nsCommaSeparated.length === 2) {
1239 | if (nsCommaSeparated[0] != COMPONENT_NAMESPACE_SCHEME) {
1240 | return reportError("T029", value, COMPONENT_NAMESPACE_SCHEME);
1241 | }
1242 | nsValue = nsCommaSeparated[1];
1243 | }
1244 |
1245 | if (nsValue.includes("#")) {
1246 | return reportError("T028", nsValue, "Namespace cannot contain character '#'.");
1247 | }
1248 |
1249 | switch (nsValue) {
1250 | case COMPONENT_NAMESPACE_SCHEME:
1251 | nsValue = nsKey;
1252 | break;
1253 | case APP_NS_KEY:
1254 | nsValue = APP_NS_VALUE;
1255 | break;
1256 | case CORE_NS_KEY:
1257 | nsValue = CORE_NAMESPACE_VALUE;
1258 | break;
1259 | }
1260 |
1261 | const compNamespaces = namespaceStack[namespaceStack.length - 1];
1262 | if (compNamespaces.has(nsKey)) {
1263 | return reportError("T025", nsKey);
1264 | }
1265 | compNamespaces.set(nsKey, nsValue);
1266 | }
1267 |
1268 | function getTopLvlElement(node: Node, getText: GetText): Node {
1269 | // --- Check that the nodes contains exactly only a single component root element before the EoF token
1270 | if (node.children!.length !== 2) {
1271 | reportError("T001");
1272 | }
1273 |
1274 | // --- Ensure it's a component
1275 | const element = node.children![0];
1276 | if (element.kind !== SyntaxKind.ElementNode) {
1277 | reportError("T001");
1278 | }
1279 | return element;
1280 | }
1281 |
1282 | function getComponentName(node: Node, getText: GetText) {
1283 | const nameTokens = node.children!.find((c) => c.kind === SyntaxKind.TagNameNode)!.children!;
1284 | const name = getText(nameTokens.at(-1));
1285 | return name;
1286 | }
1287 |
1288 | function getNamespaceResolvedComponentName(
1289 | node: Node,
1290 | getText: GetText,
1291 | namespaceStack: Map<string, string>[],
1292 | ) {
1293 | const nameTokens = node.children!.find((c) => c.kind === SyntaxKind.TagNameNode)!.children!;
1294 | const name = getText(nameTokens.at(-1));
1295 |
1296 | if (nameTokens.length === 1) {
1297 | return name;
1298 | }
1299 |
1300 | const namespace = getText(nameTokens[0]);
1301 |
1302 | if (namespaceStack.length === 0) {
1303 | reportError("T026");
1304 | }
1305 |
1306 | let resolvedNamespace = undefined;
1307 | for (let i = namespaceStack.length - 1; i >= 0; --i) {
1308 | resolvedNamespace = namespaceStack[i].get(namespace);
1309 | if (resolvedNamespace !== undefined) {
1310 | break;
1311 | }
1312 | }
1313 | if (resolvedNamespace === undefined) {
1314 | reportError("T027", namespace);
1315 | }
1316 |
1317 | return resolvedNamespace + "." + name;
1318 | }
1319 |
1320 | /**
1321 | * @param name - The name of the event in camelCase, with "on" prefix.
1322 | */
1323 | export function stripOnPrefix(name: string) {
1324 | return name[2].toLowerCase() + name.substring(3);
1325 | }
1326 |
1327 | function splitUsesValue(value: string) {
1328 | return value.split(",").map((v) => v.trim());
1329 | }
1330 |
```