This is page 116 of 186. Use http://codebase.md/xmlui-org/xmlui/%7Bnode.props.src?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-optimized.yml
│ ├── deploy-blog-swa.yml
│ ├── 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
│ ├── package.json
│ ├── public
│ │ ├── blog
│ │ │ ├── images
│ │ │ │ ├── an-advanced-codefence.gif
│ │ │ │ ├── an-advanced-codefence.mp4
│ │ │ │ ├── blog-page-component.png
│ │ │ │ ├── blog-scrabble.png
│ │ │ │ ├── codefence-runner.png
│ │ │ │ ├── integrated-blog-search.png
│ │ │ │ ├── lorem-ipsum.png
│ │ │ │ ├── playground-checkbox-source.png
│ │ │ │ ├── playground.png
│ │ │ │ ├── use-xmlui-mcp-to-find-a-howto.png
│ │ │ │ └── xmlui-demo-gallery.png
│ │ │ ├── introducing-xmlui.md
│ │ │ ├── lorem-ipsum.md
│ │ │ ├── newest-post.md
│ │ │ ├── older-post.md
│ │ │ ├── xmlui-playground.md
│ │ │ └── xmlui-powered-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
│ │ ├── staticwebapp.config.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
│ │ ├── FancyButton.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
│ │ │ │ ├── control-cache-invalidation.md
│ │ │ │ ├── debounce-user-input-for-api-calls.md
│ │ │ │ ├── debounce-with-changelistener.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
│ ├── tsconfig.json
│ ├── 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
│ ├── 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
│ │ └── 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
│ ├── 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
│ ├── 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
│ ├── 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
│ ├── 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
│ ├── xmlui-spreadsheet
│ │ ├── .gitignore
│ │ ├── demo
│ │ │ └── Main.xmlui
│ │ ├── index.html
│ │ ├── index.ts
│ │ ├── meta
│ │ │ └── componentsMetadata.ts
│ │ ├── package.json
│ │ └── src
│ │ ├── index.tsx
│ │ ├── Spreadsheet.tsx
│ │ └── SpreadsheetNative.tsx
│ └── 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.spec.ts
│ │ ├── HeroSection.tsx
│ │ └── HeroSectionNative.tsx
│ ├── index.tsx
│ ├── ScrollToTop
│ │ ├── ScrollToTop.module.scss
│ │ ├── ScrollToTop.tsx
│ │ └── ScrollToTopNative.tsx
│ └── vite-env.d.ts
├── playwright.config.ts
├── 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.cjs
│ ├── 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
│ ├── component-metadata.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
│ ├── theme-variables-refactoring.md
│ ├── ud-components.md
│ └── xmlui-repo.md
├── package.json
├── scripts
│ ├── coverage-only.js
│ ├── e2e-test-summary.js
│ ├── extract-component-metadata.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
│ ├── generate-metadata-markdown.js
│ ├── get-langserver-metadata.js
│ ├── 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.module.scss
│ │ │ │ ├── LabelList.spec.ts
│ │ │ │ ├── LabelList.tsx
│ │ │ │ └── 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.js
│ ├── 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
│ │ │ ├── index.ts
│ │ │ ├── ModalDialogDriver.ts
│ │ │ ├── NumberBoxDriver.ts
│ │ │ ├── TextBoxDriver.ts
│ │ │ ├── TimeInputDriver.ts
│ │ │ ├── TimerDriver.ts
│ │ │ └── TreeDriver.ts
│ │ ├── fixtures.ts
│ │ ├── index.ts
│ │ ├── infrastructure
│ │ │ ├── index.html
│ │ │ ├── main.tsx
│ │ │ ├── public
│ │ │ │ ├── mockServiceWorker.js
│ │ │ │ ├── resources
│ │ │ │ │ ├── bell.svg
│ │ │ │ │ ├── box.svg
│ │ │ │ │ ├── doc.svg
│ │ │ │ │ ├── eye.svg
│ │ │ │ │ ├── flower-640x480.jpg
│ │ │ │ │ ├── sun.svg
│ │ │ │ │ ├── test-image-100x100.jpg
│ │ │ │ │ └── txt.svg
│ │ │ │ └── serve.json
│ │ │ └── TestBed.tsx
│ │ └── themed-app-test-helpers.ts
│ └── vite-env.d.ts
├── tests
│ ├── components
│ │ ├── CodeBlock
│ │ │ └── hightlight-code.test.ts
│ │ ├── playground-pattern.test.ts
│ │ └── Tree
│ │ └── Tree-states.test.ts
│ ├── components-core
│ │ ├── abstractions
│ │ │ └── treeAbstractions.test.ts
│ │ ├── container
│ │ │ └── buildProxy.test.ts
│ │ ├── interception
│ │ │ ├── orderBy.test.ts
│ │ │ ├── ReadOnlyCollection.test.ts
│ │ │ └── request-param-converter.test.ts
│ │ ├── scripts-runner
│ │ │ ├── AttributeValueParser.test.ts
│ │ │ ├── eval-tree-arrow-async.test.ts
│ │ │ ├── eval-tree-arrow.test.ts
│ │ │ ├── eval-tree-func-decl-async.test.ts
│ │ │ ├── eval-tree-func-decl.test.ts
│ │ │ ├── eval-tree-pre-post.test.ts
│ │ │ ├── eval-tree-regression.test.ts
│ │ │ ├── eval-tree.test.ts
│ │ │ ├── function-proxy.test.ts
│ │ │ ├── parser-regression.test.ts
│ │ │ ├── process-event.test.ts
│ │ │ ├── process-function.test.ts
│ │ │ ├── process-implicit-context.test.ts
│ │ │ ├── process-statement-asgn.test.ts
│ │ │ ├── process-statement-destruct.test.ts
│ │ │ ├── process-statement-regs.test.ts
│ │ │ ├── process-statement-sync.test.ts
│ │ │ ├── process-statement.test.ts
│ │ │ ├── process-switch-sync.test.ts
│ │ │ ├── process-switch.test.ts
│ │ │ ├── process-try-sync.test.ts
│ │ │ ├── process-try.test.ts
│ │ │ └── test-helpers.ts
│ │ ├── test-metadata-handler.ts
│ │ ├── theming
│ │ │ ├── border-segments.test.ts
│ │ │ ├── component-layout.resolver.test.ts
│ │ │ ├── layout-property-parser.test.ts
│ │ │ ├── layout-resolver.test.ts
│ │ │ ├── layout-resolver2.test.ts
│ │ │ ├── layout-vp-override.test.ts
│ │ │ └── padding-segments.test.ts
│ │ └── utils
│ │ ├── date-utils.test.ts
│ │ ├── format-human-elapsed-time.test.ts
│ │ └── LruCache.test.ts
│ ├── language-server
│ │ ├── completion.test.ts
│ │ ├── format.test.ts
│ │ ├── hover.test.ts
│ │ └── mockData.ts
│ └── parsers
│ ├── common
│ │ └── input-stream.test.ts
│ ├── markdown
│ │ └── parse-binding-expression.test.ts
│ ├── parameter-parser.test.ts
│ ├── paremeter-parser.test.ts
│ ├── scripting
│ │ ├── eval-tree-arrow.test.ts
│ │ ├── eval-tree-pre-post.test.ts
│ │ ├── eval-tree.test.ts
│ │ ├── function-proxy.test.ts
│ │ ├── lexer-literals.test.ts
│ │ ├── lexer-misc.test.ts
│ │ ├── module-parse.test.ts
│ │ ├── parser-arrow.test.ts
│ │ ├── parser-assignments.test.ts
│ │ ├── parser-binary.test.ts
│ │ ├── parser-destructuring.test.ts
│ │ ├── parser-errors.test.ts
│ │ ├── parser-expressions.test.ts
│ │ ├── parser-function.test.ts
│ │ ├── parser-literals.test.ts
│ │ ├── parser-primary.test.ts
│ │ ├── parser-regex.test.ts
│ │ ├── parser-statements.test.ts
│ │ ├── parser-unary.test.ts
│ │ ├── process-event.test.ts
│ │ ├── process-implicit-context.test.ts
│ │ ├── process-statement-asgn.test.ts
│ │ ├── process-statement-destruct.test.ts
│ │ ├── process-statement-regs.test.ts
│ │ ├── process-statement-sync.test.ts
│ │ ├── process-statement.test.ts
│ │ ├── process-switch-sync.test.ts
│ │ ├── process-switch.test.ts
│ │ ├── process-try-sync.test.ts
│ │ ├── process-try.test.ts
│ │ ├── simplify-expression.test.ts
│ │ ├── statement-hooks.test.ts
│ │ └── test-helpers.ts
│ ├── style-parser
│ │ ├── generateHvarChain.test.ts
│ │ ├── parseHVar.test.ts
│ │ ├── parser.test.ts
│ │ └── tokens.test.ts
│ └── xmlui
│ ├── lint.test.ts
│ ├── parser.test.ts
│ ├── scanner.test.ts
│ ├── transform.attr.test.ts
│ ├── transform.circular.test.ts
│ ├── transform.element.test.ts
│ ├── transform.errors.test.ts
│ ├── transform.escape.test.ts
│ ├── transform.regression.test.ts
│ ├── transform.script.test.ts
│ ├── transform.test.ts
│ └── xmlui.ts
├── tests-e2e
│ ├── api-bound-component-regression.spec.ts
│ ├── api-call-as-extracted-component.spec.ts
│ ├── assign-to-object-or-array-regression.spec.ts
│ ├── binding-regression.spec.ts
│ ├── children-as-template-context-vars.spec.ts
│ ├── compound-component.spec.ts
│ ├── context-vars-regression.spec.ts
│ ├── data-bindings.spec.ts
│ ├── datasource-and-api-usage-in-var.spec.ts
│ ├── datasource-direct-binding.spec.ts
│ ├── datasource-onLoaded-regression.spec.ts
│ ├── modify-array-item-regression.spec.ts
│ ├── namespaces.spec.ts
│ ├── push-to-array-regression.spec.ts
│ ├── screen-breakpoints.spec.ts
│ ├── scripting.spec.ts
│ ├── state-scope-in-pages.spec.ts
│ └── state-var-scopes.spec.ts
├── tsconfig.bin.json
├── tsconfig.json
├── tsconfig.node.json
├── vite.config.ts
└── vitest.config.ts
```
# Files
--------------------------------------------------------------------------------
/xmlui/src/components-core/script-runner/process-statement-async.ts:
--------------------------------------------------------------------------------
```typescript
1 | import type { LoopScope } from "../../abstractions/scripting/LoopScope";
2 | import type { BlockScope } from "../../abstractions/scripting/BlockScope";
3 | import type { LogicalThread } from "../../abstractions/scripting/LogicalThread";
4 | import {
5 | T_ARROW_EXPRESSION_STATEMENT,
6 | T_ASSIGNMENT_EXPRESSION,
7 | T_BLOCK_STATEMENT,
8 | T_BREAK_STATEMENT,
9 | T_CONST_STATEMENT,
10 | T_CONTINUE_STATEMENT,
11 | T_DO_WHILE_STATEMENT,
12 | T_EMPTY_STATEMENT,
13 | T_EXPRESSION_STATEMENT,
14 | T_FOR_IN_STATEMENT,
15 | T_FOR_OF_STATEMENT,
16 | T_FOR_STATEMENT,
17 | T_FUNCTION_DECLARATION,
18 | T_IDENTIFIER,
19 | T_IF_STATEMENT,
20 | T_LET_STATEMENT,
21 | T_LITERAL,
22 | T_RETURN_STATEMENT,
23 | T_SWITCH_STATEMENT,
24 | T_THROW_STATEMENT,
25 | T_TRY_STATEMENT,
26 | T_VAR_STATEMENT,
27 | T_WHILE_STATEMENT,
28 | type ArrayDestructure,
29 | type AssignmentExpression,
30 | type Identifier,
31 | type Literal,
32 | type ObjectDestructure,
33 | type Statement,
34 | type VarDeclaration,
35 | } from "./ScriptingSourceTree";
36 | import { StatementExecutionError, ThrowStatementError } from "../EngineError";
37 | import { reportEngineError } from "../reportEngineError";
38 | import type {
39 | QueueInfo,
40 | StatementQueueItem,
41 | ProcessOutcome,
42 | StatementRunTimeInfo,
43 | StatementWithInfo} from "./statement-queue";
44 | import {
45 | StatementQueue,
46 | mapStatementsToQueueItems,
47 | mapToItem
48 | } from "./statement-queue";
49 | import { evalBindingAsync, executeArrowExpression } from "./eval-tree-async";
50 | import type { BindingTreeEvaluationContext } from "./BindingTreeEvaluationContext";
51 | import {
52 | ensureMainThread,
53 | innermostBlockScope,
54 | innermostLoopScope,
55 | createLoopScope,
56 | provideLoopBody,
57 | releaseLoopScope,
58 | provideTryBody,
59 | createTryScope,
60 | innermostTryScope,
61 | provideFinallyBody,
62 | provideCatchBody,
63 | provideFinallyErrorBody,
64 | hoistFunctionDeclarations,
65 | closing,
66 | toStatementItems,
67 | guard,
68 | } from "./process-statement-common";
69 | import { createXmlUiTreeNodeId } from "../../parsers/scripting/Parser";
70 |
71 | // --- Helper function to process the entire queue asynchronously
72 | export async function processStatementQueueAsync(
73 | statements: Statement[],
74 | evalContext: BindingTreeEvaluationContext,
75 | thread?: LogicalThread,
76 | ): Promise<QueueInfo> {
77 | if (!thread) {
78 | // --- Create the main thread for the queue
79 | thread = ensureMainThread(evalContext);
80 | }
81 |
82 | // --- Hoist function declarations to the top scope
83 | hoistFunctionDeclarations(thread, statements);
84 |
85 | // --- Fill the queue with items
86 | const queue = new StatementQueue();
87 | queue.push(mapStatementsToQueueItems(toStatementItems(statements)));
88 |
89 | // --- Prepare queue diagnostics information
90 | const diagInfo: QueueInfo = {
91 | processedStatements: 0,
92 | maxQueueLength: queue.length,
93 | unshiftedItems: 0,
94 | clearToLabels: 0,
95 | maxBlocks: 0,
96 | maxLoops: 0,
97 | };
98 |
99 | // --- Consume the queue
100 | let startTime = new Date().getTime();
101 | while (queue.length > 0 && !evalContext.cancellationToken?.cancelled) {
102 | // --- Allow time to break from infinite loops
103 | if (evalContext.timeout && new Date().getTime() - startTime > evalContext.timeout) {
104 | throw new Error("Script execution timeout");
105 | }
106 |
107 | // --- Process the first item
108 | const queueItem = queue.dequeue();
109 | thread.breakLabelValue = queue.length > 0 ? queue.peek()!.label : -1;
110 |
111 | let outcome: ProcessOutcome | undefined;
112 | try {
113 | // --- Sign that the statement is about to start
114 | await evalContext?.onStatementStarted?.(evalContext, queueItem!.statement);
115 |
116 | // --- Execute the statement
117 | outcome = await processStatementAsync(
118 | queueItem!.statement,
119 | queueItem?.execInfo ?? {},
120 | evalContext,
121 | thread,
122 | );
123 | } catch (err) {
124 | if (thread.tryBlocks && thread.tryBlocks.length > 0) {
125 | // --- We have a try block to handle this error
126 | const tryScope = thread.tryBlocks[thread.tryBlocks.length - 1];
127 |
128 | // --- Sign the error to raise. Next time the guarded try block will execute the catch block, if there is any
129 | tryScope.errorToThrow = err;
130 | tryScope.errorSource = tryScope.processingPhase;
131 | tryScope.processingPhase = "error";
132 |
133 | // --- Let's skip the remaining parts of the current block (try/catch/finally)
134 | outcome = {
135 | clearToLabel: tryScope.tryLabel,
136 | };
137 | } else {
138 | if (err instanceof ThrowStatementError) {
139 | reportEngineError(err);
140 | } else {
141 | // TODO: Provide source code information
142 | reportEngineError(
143 | new StatementExecutionError(err as any /* queueItem!.statement?.source */),
144 | err,
145 | );
146 | }
147 | }
148 | }
149 |
150 | // --- Modify the queue's content according to the outcome
151 | if (outcome) {
152 | if (outcome.toUnshift) {
153 | queue.unshift(outcome.toUnshift);
154 |
155 | diagInfo.unshiftedItems += outcome.toUnshift.length;
156 | }
157 | if (outcome.clearToLabel !== undefined) {
158 | queue.clearToLabel(outcome.clearToLabel);
159 |
160 | diagInfo.clearToLabels++;
161 | }
162 | }
163 |
164 | // --- Sign that the statement has been completed
165 | await evalContext?.onStatementCompleted?.(evalContext, queueItem!.statement);
166 |
167 | // --- Provide diagnostics
168 | if (queue.length > diagInfo.maxQueueLength) {
169 | diagInfo.maxQueueLength = queue.length;
170 | }
171 | if (thread.blocks && thread.blocks!.length > diagInfo.maxBlocks) {
172 | diagInfo.maxBlocks = thread.blocks!.length;
173 | }
174 | if (thread.loops && thread.loops.length > diagInfo.maxLoops) {
175 | diagInfo.maxLoops = thread.loops.length;
176 | }
177 | diagInfo.processedStatements++;
178 | }
179 |
180 | // --- Done.
181 | return diagInfo;
182 | }
183 |
184 | /**
185 | * Process the specified statement asynchronously
186 | * @param statement Statement to process
187 | * @param execInfo Execution information
188 | * @param evalContext Evaluation context used for processing
189 | * @param thread Logical thread to use for statement processing
190 | * @param onStatementCompleted
191 | * @returns Items to put back into the queue of statements
192 | */
193 | async function processStatementAsync(
194 | statement: Statement,
195 | execInfo: StatementRunTimeInfo,
196 | evalContext: BindingTreeEvaluationContext,
197 | thread: LogicalThread,
198 | ): Promise<ProcessOutcome> {
199 | // --- These items should be put in the statement queue after return
200 | let toUnshift: StatementQueueItem[] = [];
201 | let clearToLabel: number | undefined;
202 |
203 | // --- Process the statement according to its type
204 | switch (statement.type) {
205 | case T_FUNCTION_DECLARATION:
206 | // --- Function declarations are already hoisted, nothing to do
207 | break;
208 |
209 | case T_VAR_STATEMENT:
210 | if (thread !== evalContext.mainThread) {
211 | throw new Error("'var' declarations are not allowed within functions");
212 | }
213 | break;
214 |
215 | case T_EMPTY_STATEMENT:
216 | // --- Nothing to do
217 | break;
218 |
219 | case T_BLOCK_STATEMENT:
220 | // --- No statement, nothing to process
221 | if (statement.stmts.length === 0) break;
222 |
223 | // --- Create a new block scope
224 | thread.blocks ??= [];
225 | thread.blocks.push({ vars: {} });
226 |
227 | // --- Hoist function declarations to the innermost block scope
228 | hoistFunctionDeclarations(thread, statement.stmts);
229 |
230 | // --- Queue the block scope's body...
231 | toUnshift = mapStatementsToQueueItems([
232 | ...toStatementItems(statement.stmts),
233 | // --- ...and an empty statement to remove the block scope
234 | closing(),
235 | ]);
236 | break;
237 |
238 | case T_EXPRESSION_STATEMENT:
239 | // --- Just evaluate it
240 | const statementValue = await evalBindingAsync(
241 | statement.expr,
242 | evalContext,
243 | thread,
244 | );
245 | if (thread.blocks && thread.blocks.length !== 0) {
246 | thread.blocks[thread.blocks.length - 1].returnValue = statementValue;
247 | }
248 | break;
249 |
250 | case T_ARROW_EXPRESSION_STATEMENT:
251 | // --- Compile the arrow expression
252 | const arrowFuncValue = await executeArrowExpression(
253 | statement.expr,
254 | evalContext,
255 | thread,
256 | ...(evalContext.eventArgs ?? []),
257 | );
258 | if (thread.blocks && thread.blocks.length !== 0) {
259 | thread.blocks[thread.blocks.length - 1].returnValue = arrowFuncValue;
260 | }
261 | break;
262 |
263 | case T_LET_STATEMENT: {
264 | // --- Create a new variable in the innermost scope
265 | const block = innermostBlockScope(thread);
266 | if (!block) {
267 | throw new Error("Missing block scope");
268 | }
269 | await processDeclarationsAsync(block, evalContext, thread, statement.decls);
270 | break;
271 | }
272 |
273 | case T_CONST_STATEMENT: {
274 | // --- Create a new variable in the innermost scope
275 | const block = innermostBlockScope(thread);
276 | if (!block) {
277 | throw new Error("Missing block scope");
278 | }
279 | await processDeclarationsAsync(block, evalContext, thread, statement.decls, true);
280 | break;
281 | }
282 |
283 | case T_IF_STATEMENT:
284 | // --- Evaluate the condition
285 | const condition = !!(await evalBindingAsync(statement.cond, evalContext, thread));
286 | if (condition) {
287 | toUnshift = mapToItem(statement.thenB);
288 | } else if (statement.elseB) {
289 | toUnshift = mapToItem(statement.elseB);
290 | }
291 | break;
292 |
293 | case T_RETURN_STATEMENT: {
294 | // --- Check if return is valid here
295 | let blockScope = innermostBlockScope(thread);
296 | if (blockScope === undefined) {
297 | throw new Error("Return requires a block scope");
298 | }
299 |
300 | // --- Store the return value
301 | thread.returnValue = statement.expr
302 | ? await evalBindingAsync(statement.expr, evalContext, thread)
303 | : undefined;
304 |
305 | // --- Check for try blocks
306 | if ((thread.tryBlocks ?? []).length > 0) {
307 | // --- Mark the loop's try scope to exit with "return"
308 | const returnTryScope = thread.tryBlocks![0];
309 | returnTryScope.exitType = "return";
310 |
311 | // --- Remove the try/catch/finally block's scope
312 | if (returnTryScope.processingPhase !== "postFinally") {
313 | thread.blocks!.pop();
314 | }
315 |
316 | // --- Clear the last part of the try/catch/finally block
317 | const tryScope = innermostTryScope(thread);
318 | clearToLabel = tryScope.tryLabel;
319 | } else {
320 | // --- Delete the remaining part of the queue
321 | clearToLabel = -1;
322 | }
323 | break;
324 | }
325 |
326 | case T_WHILE_STATEMENT: {
327 | // --- Create or get the loop's scope (guard is falsy for the first execution)
328 | let loopScope = execInfo.guard ? innermostLoopScope(thread) : createLoopScope(thread);
329 |
330 | // --- Evaluate the loop condition
331 | const condition = !!(await evalBindingAsync(statement.cond, evalContext, thread));
332 | if (condition) {
333 | toUnshift = provideLoopBody(loopScope!, statement, thread.breakLabelValue);
334 | } else {
335 | // --- When the condition is not met, we're done.
336 | releaseLoopScope(thread);
337 | }
338 | break;
339 | }
340 |
341 | case T_DO_WHILE_STATEMENT: {
342 | if (!execInfo.guard) {
343 | // --- First loop execution (do-while is a post-test loop)
344 | toUnshift = provideLoopBody(createLoopScope(thread), statement, thread.breakLabelValue);
345 | break;
346 | }
347 |
348 | // --- Evaluate the loop condition
349 | const condition = !!(await evalBindingAsync(statement.cond, evalContext, thread));
350 | if (condition) {
351 | toUnshift = provideLoopBody(innermostLoopScope(thread), statement, thread.breakLabelValue);
352 | } else {
353 | // --- When the condition is not met, we're done.
354 | releaseLoopScope(thread);
355 | }
356 | break;
357 | }
358 |
359 | case T_CONTINUE_STATEMENT: {
360 | // --- Search for the innermost non-switch loop scope, release the switch scopes
361 | if (!thread.loops || thread.loops.length === 0) {
362 | throw new Error("Missing loop scope");
363 | }
364 |
365 | let loopScope: LoopScope | undefined;
366 | while (thread.loops.length > 0) {
367 | loopScope = innermostLoopScope(thread);
368 | if (!loopScope.isSwitch) {
369 | break;
370 | }
371 | thread.loops.pop();
372 | }
373 |
374 | if (!loopScope) {
375 | throw new Error("Missing loop scope");
376 | }
377 |
378 | if (
379 | loopScope.tryBlockDepth >= 0 &&
380 | loopScope.tryBlockDepth < (thread.tryBlocks ?? []).length
381 | ) {
382 | // --- Mark the loop's try scope to exit with "continue"
383 | for (let i = loopScope.tryBlockDepth; i < thread.tryBlocks!.length; i++) {
384 | thread.tryBlocks![loopScope.tryBlockDepth]!.exitType = "continue";
385 | }
386 |
387 | // --- Clear the last part of the try/catch/finally block
388 | const tryScope = innermostTryScope(thread);
389 | clearToLabel = tryScope.tryLabel;
390 | } else {
391 | clearToLabel = loopScope.continueLabel;
392 | releaseLoopScope(thread, false);
393 | }
394 | break;
395 | }
396 |
397 | case T_BREAK_STATEMENT: {
398 | const loopScope = innermostLoopScope(thread);
399 | if (loopScope === undefined) {
400 | throw new Error("Missing loop scope");
401 | }
402 |
403 | if (!!loopScope.isSwitch) {
404 | // --- Break is in a switch case
405 | clearToLabel = loopScope.breakLabel;
406 | break;
407 | }
408 |
409 | // --- Break is in a loop construct
410 | if (
411 | loopScope.tryBlockDepth >= 0 &&
412 | loopScope.tryBlockDepth < (thread.tryBlocks ?? []).length
413 | ) {
414 | // --- Mark the loop's try scope to exit with "break"
415 | for (let i = loopScope.tryBlockDepth; i < thread.tryBlocks!.length; i++) {
416 | thread.tryBlocks![loopScope.tryBlockDepth]!.exitType = "break";
417 | }
418 |
419 | // --- Clear the last part of the try/catch/finally block
420 | const tryScope = innermostTryScope(thread);
421 | clearToLabel = tryScope.tryLabel;
422 | } else {
423 | clearToLabel = loopScope.breakLabel;
424 | releaseLoopScope(thread);
425 | }
426 | break;
427 | }
428 |
429 | case T_FOR_STATEMENT:
430 | if (!execInfo.guard) {
431 | // --- Init the loop with a new scope
432 | createLoopScope(thread, 1);
433 |
434 | // --- Create a new block for the loop variables
435 | thread.blocks ??= [];
436 | thread.blocks.push({
437 | vars: {},
438 | });
439 |
440 | const guardStatement = guard(statement);
441 | if (statement.init) {
442 | // --- Unshift the initialization part and the guarded for-loop
443 | toUnshift = mapStatementsToQueueItems([{ statement: statement.init }, guardStatement]);
444 | } else {
445 | // --- No init, unshift only the guard statement
446 | toUnshift = mapStatementsToQueueItems([guardStatement]);
447 | }
448 | } else {
449 | // --- Initialization already done. Evaluate the condition
450 | if (!statement.cond || !!(await evalBindingAsync(statement.cond, evalContext, thread))) {
451 | // --- Stay in the loop, inject the body, the update expression, and the loop guard
452 | const loopScope = innermostLoopScope(thread);
453 |
454 | if (statement.upd) {
455 | const updateStmt: StatementWithInfo = {
456 | statement: {
457 | type: T_EXPRESSION_STATEMENT,
458 | nodeId: createXmlUiTreeNodeId(),
459 | expr: statement.upd,
460 | },
461 | };
462 | toUnshift = mapStatementsToQueueItems([
463 | { statement: statement.body },
464 | updateStmt,
465 | { statement, execInfo },
466 | ]);
467 | } else {
468 | toUnshift = mapStatementsToQueueItems([
469 | { statement: statement.body },
470 | { statement, execInfo },
471 | ]);
472 | }
473 | // --- The next queue label is for "break"
474 | loopScope.breakLabel = thread.breakLabelValue ?? -1;
475 |
476 | // --- The guard action's label is for "continue"
477 | loopScope.continueLabel = toUnshift[1].label;
478 | } else {
479 | // --- The condition is not met, we're done. Remove the loop's scope from the evaluation context
480 | releaseLoopScope(thread);
481 | }
482 | }
483 | break;
484 |
485 | case T_FOR_IN_STATEMENT:
486 | if (!execInfo.guard) {
487 | // --- Get the object keys
488 | const keyedObject = await evalBindingAsync(statement.expr, evalContext, thread);
489 | if (keyedObject == undefined) {
490 | // --- Nothing to do, no object to traverse
491 | break;
492 | }
493 |
494 | // --- Init the loop with a new scope
495 | createLoopScope(thread, 1);
496 |
497 | // --- Create a new block for the loop variables
498 | thread.blocks ??= [];
499 | thread.blocks.push({ vars: {} });
500 |
501 | toUnshift = mapStatementsToQueueItems([
502 | { statement, execInfo: { guard: true, keys: Object.keys(keyedObject), keyIndex: 0 } },
503 | ]);
504 | } else {
505 | // --- Just for the sake of extra safety
506 | if (execInfo.keyIndex === undefined || execInfo.keys === undefined) {
507 | throw new Error("Keys information expected in for..in loop");
508 | }
509 |
510 | // --- Any key left?
511 | if (execInfo.keyIndex < execInfo.keys.length) {
512 | // --- Set the binding variable to the next key
513 | const propValue = execInfo.keys[execInfo.keyIndex++];
514 | switch (statement.varB) {
515 | case "none": {
516 | const assigmentExpr: AssignmentExpression = {
517 | type: T_ASSIGNMENT_EXPRESSION,
518 | leftValue: {
519 | type: T_IDENTIFIER,
520 | name: statement.id.name,
521 | } as Identifier,
522 | op: "=",
523 | expr: {
524 | type: T_LITERAL,
525 | value: propValue,
526 | } as Literal,
527 | } as AssignmentExpression;
528 | await evalBindingAsync(assigmentExpr, evalContext, thread);
529 | break;
530 | }
531 |
532 | case "const":
533 | case "let":
534 | {
535 | // --- Create a new variable in the innermost scope
536 | const block = innermostBlockScope(thread);
537 | if (!block) {
538 | throw new Error("Missing block scope");
539 | }
540 | block.vars[statement.id.name] = propValue;
541 | if (statement.varB === "const") {
542 | block.constVars ??= new Set<string>();
543 | block.constVars.add(statement.id.name);
544 | }
545 | }
546 | break;
547 | }
548 |
549 | // --- Inject the loop body
550 | const loopScope = innermostLoopScope(thread);
551 | toUnshift = mapStatementsToQueueItems([
552 | { statement: statement.body },
553 | { statement, execInfo },
554 | ]);
555 |
556 | // --- The next queue label is for "break"
557 | loopScope.breakLabel = thread.breakLabelValue ?? -1;
558 |
559 | // --- The guard action's label is for "continue"
560 | loopScope.continueLabel = toUnshift[1].label;
561 | } else {
562 | // --- The condition is not met, we're done. Remove the loop's scope from the evaluation context
563 | releaseLoopScope(thread);
564 | }
565 | }
566 | break;
567 |
568 | case T_FOR_OF_STATEMENT:
569 | if (!execInfo.guard) {
570 | // --- Get the object keys
571 | const iteratorObject = await evalBindingAsync(statement.expr, evalContext, thread);
572 | if (iteratorObject == null || typeof iteratorObject[Symbol.iterator] !== "function") {
573 | // --- The object is not an iterator
574 | throw new Error("Object in for..of is not iterable");
575 | }
576 |
577 | // --- Init the loop with a new scope
578 | createLoopScope(thread, 1);
579 |
580 | // --- Create a new block for the loop variables
581 | thread.blocks ??= [];
582 | thread.blocks.push({ vars: {} });
583 |
584 | toUnshift = mapStatementsToQueueItems([
585 | { statement, execInfo: { guard: true, iterator: iteratorObject[Symbol.iterator]() } },
586 | ]);
587 | } else {
588 | // --- Just for the sake of extra safety
589 | if (execInfo.iterator === undefined) {
590 | throw new Error("Iterator expected in for..of loop");
591 | }
592 |
593 | // --- Any iteration left?
594 | const nextIteration = execInfo.iterator.next();
595 | if (nextIteration.done) {
596 | // --- The for..of loop is complete. Remove the loop's scope from the evaluation context
597 | releaseLoopScope(thread);
598 | break;
599 | }
600 |
601 | // --- Set the binding variable to the next key
602 | const propValue = nextIteration.value;
603 | switch (statement.varB) {
604 | case "none": {
605 | const assigmentExpr: AssignmentExpression = {
606 | type: T_ASSIGNMENT_EXPRESSION,
607 | leftValue: {
608 | type: T_IDENTIFIER,
609 | name: statement.id.name,
610 | } as Identifier,
611 | op: "=",
612 | expr: {
613 | type: T_LITERAL,
614 | value: propValue,
615 | } as Literal,
616 | } as AssignmentExpression;
617 | await evalBindingAsync(assigmentExpr, evalContext, thread);
618 | break;
619 | }
620 |
621 | case "const":
622 | case "let":
623 | {
624 | // --- Create a new variable in the innermost scope
625 | const block = innermostBlockScope(thread);
626 | if (!block) {
627 | throw new Error("Missing block scope");
628 | }
629 | block.vars[statement.id.name] = propValue;
630 | if (statement.varB === "const") {
631 | block.constVars ??= new Set<string>();
632 | block.constVars.add(statement.id.name);
633 | }
634 | }
635 | break;
636 | }
637 |
638 | // --- Inject the loop body
639 | const loopScope = innermostLoopScope(thread);
640 | toUnshift = mapStatementsToQueueItems([
641 | { statement: statement.body },
642 | { statement, execInfo },
643 | ]);
644 |
645 | // --- The next queue label is for "break"
646 | loopScope.breakLabel = thread.breakLabelValue ?? -1;
647 |
648 | // --- The guard action's label is for "continue"
649 | loopScope.continueLabel = toUnshift[1].label;
650 | }
651 | break;
652 |
653 | case T_THROW_STATEMENT: {
654 | throw new ThrowStatementError(await evalBindingAsync(statement.expr, evalContext, thread));
655 | }
656 |
657 | case T_TRY_STATEMENT: {
658 | if (!execInfo.guard) {
659 | // --- Execute the try block
660 | toUnshift = provideTryBody(thread, createTryScope(thread, statement));
661 | break;
662 | }
663 |
664 | // --- Evaluate try
665 | const tryScope = innermostTryScope(thread);
666 | switch (tryScope.processingPhase) {
667 | case "error":
668 | // --- There was an error we may handle with catch
669 | switch (tryScope.errorSource) {
670 | case "try":
671 | // --- Remove the "try" block's scope
672 | thread.blocks!.pop();
673 |
674 | // --- Go on with catch or finally
675 | if (statement.catchB) {
676 | if (tryScope.statement.catchV) {
677 | const block = innermostBlockScope(thread)!;
678 | block.vars[tryScope.statement.catchV.name] =
679 | tryScope.errorToThrow instanceof ThrowStatementError
680 | ? tryScope.errorToThrow.errorObject
681 | : tryScope.errorToThrow;
682 | }
683 | delete tryScope.errorToThrow;
684 | tryScope.processingPhase = "catch";
685 | toUnshift = provideCatchBody(thread, tryScope);
686 | } else if (tryScope.statement.finallyB) {
687 | // --- No catch, move on finally
688 | tryScope.processingPhase = "finally";
689 | toUnshift = provideFinallyBody(thread, tryScope);
690 | }
691 | break;
692 | case "catch":
693 | // --- Remove the "catch" block's scope
694 | thread.blocks!.pop();
695 |
696 | // --- Move to the finally block
697 | tryScope.processingPhase = "finally";
698 | toUnshift = provideFinallyBody(thread, tryScope);
699 | break;
700 | case "finally":
701 | // --- Remove the "finally" block's scope
702 | thread.blocks!.pop();
703 |
704 | // --- Move to the post finally execution
705 | tryScope.processingPhase = "postFinally";
706 | toUnshift = provideFinallyErrorBody(tryScope);
707 | break;
708 | }
709 | break;
710 | case "try":
711 | // --- We completed the try block successfully
712 | tryScope.processingPhase = "finally";
713 | if (statement.finallyB) {
714 | toUnshift = provideFinallyBody(thread, tryScope);
715 | }
716 | break;
717 | case "catch":
718 | // --- We completed the catch block successfully, remove the handled error
719 | tryScope.processingPhase = "finally";
720 | if (statement.finallyB) {
721 | toUnshift = provideFinallyBody(thread, tryScope);
722 | }
723 | break;
724 | case "finally":
725 | tryScope.processingPhase = "postFinally";
726 | toUnshift = provideFinallyErrorBody(tryScope);
727 | break;
728 |
729 | case "postFinally":
730 | // --- We completed the finally block successfully
731 | const innermostTry = thread.tryBlocks!.pop()!;
732 |
733 | // --- Is there any special exit type?
734 | switch (innermostTry.exitType) {
735 | case "break": {
736 | const loopScope = innermostLoopScope(thread);
737 | if (loopScope === undefined) {
738 | throw new Error("Missing loop scope");
739 | }
740 | releaseLoopScope(thread);
741 | clearToLabel = loopScope.breakLabel;
742 | break;
743 | }
744 | case "continue": {
745 | const loopScope = innermostLoopScope(thread);
746 | if (loopScope === undefined) {
747 | throw new Error("Missing loop scope");
748 | }
749 |
750 | clearToLabel = loopScope.continueLabel;
751 | releaseLoopScope(thread, false);
752 | break;
753 | }
754 | case "return":
755 | clearToLabel = -1;
756 | break;
757 | }
758 |
759 | // --- Should we raise an error?
760 | if (innermostTry.errorToThrow) {
761 | throw innermostTry.errorToThrow;
762 | }
763 | break;
764 | }
765 | break;
766 | }
767 |
768 | case T_SWITCH_STATEMENT: {
769 | // --- Create or get the loop's scope (guard is falsy for the first execution)
770 | if (execInfo.guard) {
771 | // --- Complete the switch
772 | releaseLoopScope(thread);
773 | } else {
774 | let loopScope = createLoopScope(thread);
775 | loopScope.isSwitch = true;
776 | thread.blocks!.push({ vars: {} });
777 |
778 | // --- Evaluate the switch value
779 | const switchValue = await evalBindingAsync(statement.expr, evalContext, thread);
780 |
781 | // --- Find the matching label
782 | let matchingIndex = -1;
783 | for (let i = 0; i < statement.cases.length; i++) {
784 | const currentCase = statement.cases[i];
785 |
786 | // --- Check for default case
787 | if (currentCase.caseE === undefined) {
788 | matchingIndex = i;
789 | break;
790 | }
791 |
792 | // --- Check for matching case
793 | const caseValue = await evalBindingAsync(currentCase.caseE, evalContext, thread);
794 | if (caseValue === switchValue) {
795 | matchingIndex = i;
796 | break;
797 | }
798 | }
799 |
800 | // --- Merge all statements from the matching label
801 | const statementFlow: Statement[] = [];
802 | if (matchingIndex >= 0) {
803 | for (let i = matchingIndex; i < statement.cases.length; i++) {
804 | statementFlow.push(...statement.cases[i].stmts!);
805 | }
806 | }
807 |
808 | // --- Queue the statement flow and the guard
809 | toUnshift = mapStatementsToQueueItems([
810 | ...toStatementItems(statementFlow),
811 | guard(statement),
812 | ]);
813 | loopScope.breakLabel = toUnshift[toUnshift.length - 1].label;
814 | }
815 | break;
816 | }
817 | }
818 |
819 | // --- The statement may remove the innermost scope
820 | if (execInfo.removeBlockScope) {
821 | if (thread.blocks && thread.blocks.length > 0) {
822 | thread.blocks.pop();
823 | }
824 | }
825 |
826 | // --- Done.
827 | return { toUnshift, clearToLabel };
828 | }
829 |
830 | /**
831 | * Funtion to process a visited ID
832 | */
833 | type IdDeclarationVisitor = (id: string) => void;
834 |
835 | // --- Process a variable declaration
836 | export async function processDeclarationsAsync(
837 | block: BlockScope,
838 | evalContext: BindingTreeEvaluationContext,
839 | thread: LogicalThread,
840 | declarations: VarDeclaration[],
841 | addConst = false,
842 | useValue = false,
843 | baseValue = undefined,
844 | ): Promise<void> {
845 | for (let i = 0; i < declarations.length; i++) {
846 | let value: any;
847 | const decl = declarations[i];
848 | if (useValue) {
849 | value = baseValue;
850 | } else if (decl.expr) {
851 | value = await evalBindingAsync(decl.expr, evalContext, thread);
852 | }
853 | visitDeclaration(block, decl, value, addConst);
854 | }
855 |
856 | // --- Visit a variable
857 | function visitDeclaration(
858 | block: BlockScope,
859 | decl: VarDeclaration,
860 | baseValue: any,
861 | addConst: boolean,
862 | ): void {
863 | // --- Process each declaration
864 | if (decl.id) {
865 | visitIdDeclaration(block, decl.id, baseValue, addConst);
866 | } else if (decl.aDestr) {
867 | visitArrayDestruct(block, decl.aDestr, baseValue, addConst);
868 | } else if (decl.oDestr) {
869 | visitObjectDestruct(block, decl.oDestr, baseValue, addConst);
870 | } else {
871 | throw new Error("Unknown declaration specifier");
872 | }
873 | }
874 |
875 | // --- Visits a single ID declaration
876 | function visitIdDeclaration(
877 | block: BlockScope,
878 | id: string,
879 | baseValue: any,
880 | addConst: boolean,
881 | ): void {
882 | if (block.vars[id]) {
883 | throw new Error(`Variable ${id} is already declared in the current scope.`);
884 | }
885 | block.vars[id] = baseValue;
886 | if (addConst) {
887 | block.constVars ??= new Set<string>();
888 | block.constVars.add(id);
889 | }
890 | }
891 |
892 | // --- Visits an array destructure declaration
893 | function visitArrayDestruct(
894 | block: BlockScope,
895 | arrayD: ArrayDestructure[],
896 | baseValue: any,
897 | addConst: boolean,
898 | ): void {
899 | for (let i = 0; i < arrayD.length; i++) {
900 | const arrDecl = arrayD[i];
901 | const value = baseValue?.[i];
902 | if (arrDecl.id) {
903 | visitIdDeclaration(block, arrDecl.id, value, addConst);
904 | } else if (arrDecl.aDestr) {
905 | visitArrayDestruct(block, arrDecl.aDestr, value, addConst);
906 | } else if (arrDecl.oDestr) {
907 | visitObjectDestruct(block, arrDecl.oDestr, value, addConst);
908 | }
909 | }
910 | }
911 |
912 | // --- Visits an object destructure declaration
913 | function visitObjectDestruct(
914 | block: BlockScope,
915 | objectD: ObjectDestructure[],
916 | baseValue: any,
917 | addConst: boolean,
918 | ): void {
919 | for (let i = 0; i < objectD.length; i++) {
920 | const objDecl = objectD[i];
921 | const value = baseValue?.[objDecl.id!];
922 | if (objDecl.aDestr) {
923 | visitArrayDestruct(block, objDecl.aDestr, value, addConst);
924 | } else if (objDecl.oDestr) {
925 | visitObjectDestruct(block, objDecl.oDestr, value, addConst);
926 | } else {
927 | visitIdDeclaration(block, objDecl.alias ?? objDecl.id!, value, addConst);
928 | }
929 | }
930 | }
931 | }
932 |
```
--------------------------------------------------------------------------------
/xmlui/src/components/Slider/Slider.spec.ts:
--------------------------------------------------------------------------------
```typescript
1 | /**
2 | * Testing Notes: the Driver needs to account for the correct positioning of the indicators on the slider
3 | */
4 |
5 | import { validationStatusValues } from "../abstractions";
6 | import { getBounds, SKIP_REASON } from "../../testing/component-test-helpers";
7 | import { expect, test } from "../../testing/fixtures";
8 |
9 | // =============================================================================
10 | // BASIC FUNCTIONALITY TESTS
11 | // =============================================================================
12 |
13 | test.describe("Basic Functionality", () => {
14 | test("component renders", async ({ initTestBed, page }) => {
15 | await initTestBed(`<Slider />`);
16 | await expect(page.getByRole("slider")).toBeVisible();
17 | });
18 |
19 | test("component renders with label", async ({ initTestBed, page }) => {
20 | await initTestBed(`<Slider label="Volume" />`);
21 | await expect(page.getByRole("slider")).toBeVisible();
22 | await expect(page.getByText("Volume")).toBeVisible();
23 | });
24 |
25 | test("sets initialValue of field", async ({ initTestBed, page }) => {
26 | await initTestBed(`
27 | <Fragment>
28 | <Slider id="slider" initialValue="5" />
29 | <Text testId="slider-value" value="{slider.value}" />
30 | </Fragment>`);
31 | await expect(page.getByTestId("slider-value")).toHaveText("5");
32 | });
33 |
34 | test("accepts empty as initialValue", async ({ initTestBed, page }) => {
35 | await initTestBed(`
36 | <Fragment>
37 | <Slider id="slider" initialValue="" />
38 | <Text testId="slider-value" value="{slider.value}" />
39 | </Fragment>`);
40 | await expect(page.getByTestId("slider-value")).toHaveText("0");
41 | });
42 |
43 | [
44 | { label: "int", value: 5, expected: "5" },
45 | { label: "float", value: 5.5, expected: "5.5" },
46 | ].forEach(({ label, value, expected }) => {
47 | test(`handles ${label} correctly`, async ({ initTestBed, page }) => {
48 | await initTestBed(`
49 | <Fragment>
50 | <Slider id="slider" initialValue="${JSON.stringify(value)}" />
51 | <Text testId="slider-value" value="{slider.value}" />
52 | </Fragment>`);
53 | await expect(page.getByTestId("slider-value")).toHaveText(expected);
54 | });
55 | });
56 |
57 | [
58 | { label: "string that resolves to int", value: "5", expected: "5" },
59 | { label: "string that resolves to float", value: "5.5", expected: "5.5" },
60 | ].forEach(({ label, value, expected }) => {
61 | test(`handles ${label} correctly`, async ({ initTestBed, page }) => {
62 | await initTestBed(`
63 | <Fragment>
64 | <Slider id="slider" initialValue="${value}" />
65 | <Text testId="slider-value" value="{slider.value}" />
66 | </Fragment>`);
67 | await expect(page.getByTestId("slider-value")).toHaveText(expected);
68 | });
69 | });
70 |
71 | [
72 | { label: "NaN", value: NaN },
73 | { label: "null", value: null },
74 | { label: "undefined", value: undefined },
75 | { label: "empty string", value: "" },
76 | { label: "string not resolving to number", value: "abc" },
77 | ].forEach(({ label, value }) => {
78 | test(`handles ${label} gracefully`, async ({ initTestBed, page }) => {
79 | await initTestBed(`
80 | <Fragment>
81 | <Slider id="slider" initialValue="${value}" />
82 | <Text testId="slider-value" value="{slider.value}" />
83 | </Fragment>`);
84 | await expect(page.getByTestId("slider-value")).toHaveText("0");
85 | });
86 | });
87 |
88 | test("minValue sets the lower bound", async ({ initTestBed, page }) => {
89 | await initTestBed(`
90 | <Fragment>
91 | <Slider id="slider" minValue="5" />
92 | <Text testId="slider-value" value="{slider.value}" />
93 | </Fragment>`);
94 | const slider = page.getByRole("slider");
95 | await expect(slider).toHaveAttribute("aria-valuemin", "5");
96 | });
97 |
98 | test("value cannot be lower than minValue", async ({ initTestBed, page }) => {
99 | await initTestBed(`
100 | <Fragment>
101 | <Slider id="slider" minValue="20" maxValue="30" initialValue="10" />
102 | <Text testId="slider-value" value="{slider.value}" />
103 | </Fragment>`);
104 | await expect(page.getByTestId("slider-value")).toHaveText("20");
105 | });
106 |
107 | test("maxValue sets the upper bound", async ({ initTestBed, page }) => {
108 | await initTestBed(`<Slider maxValue="50" />`);
109 | const slider = page.getByRole("slider");
110 | await expect(slider).toHaveAttribute("aria-valuemax", "50");
111 | });
112 |
113 | test("value cannot be larger than maxValue", async ({ initTestBed, page }) => {
114 | await initTestBed(`
115 | <Fragment>
116 | <Slider id="slider" maxValue="30" initialValue="40" />
117 | <Text testId="slider-value" value="{slider.value}" />
118 | </Fragment>`);
119 | await expect(page.getByTestId("slider-value")).toHaveText("30");
120 | });
121 |
122 | test("handles invalid minValue/maxValue gracefully", async ({ initTestBed, page }) => {
123 | await initTestBed(`<Slider minValue="invalid" maxValue="invalid" />`);
124 | const slider = page.getByRole("slider");
125 | await expect(slider).toHaveAttribute("aria-valuemin", "0");
126 | await expect(slider).toHaveAttribute("aria-valuemax", "10");
127 | });
128 |
129 | test("step defines increment value", async ({ initTestBed, page }) => {
130 | await initTestBed(`
131 | <Fragment>
132 | <Slider id="slider" step="2" initialValue="0" />
133 | <Text testId="slider-value" value="{slider.value}" />
134 | </Fragment>`);
135 | const slider = page.getByRole("slider");
136 | await slider.press("ArrowRight");
137 | await expect(page.getByTestId("slider-value")).toHaveText("2");
138 | });
139 |
140 | test("handles fractional step values", async ({ initTestBed, page }) => {
141 | await initTestBed(`
142 | <Fragment>
143 | <Slider id="slider" step="0.1" initialValue="0" />
144 | <Text testId="slider-value" value="{slider.value}" />
145 | </Fragment>`);
146 | const slider = page.getByRole("slider");
147 | await slider.press("ArrowRight");
148 | await expect(page.getByTestId("slider-value")).toHaveText("0.1");
149 | });
150 |
151 | test("component handles multiple thumbs", async ({ initTestBed, page }) => {
152 | await initTestBed(`<Slider initialValue="{[2, 4]}" />`);
153 | const thumbs = page.getByRole("slider");
154 | await expect(thumbs).toHaveCount(2);
155 | });
156 |
157 | test("all thumbs are interactable via mouse", async ({
158 | initTestBed,
159 | createSliderDriver,
160 | page,
161 | }) => {
162 | await initTestBed(`
163 | <Fragment>
164 | <Slider id="slider" initialValue="{[2, 4]}" minValue="0" maxValue="10" />
165 | <Text testId="sliderValue0">{slider.value[0]}</Text>
166 | <Text testId="sliderValue1">{slider.value[1]}</Text>
167 | </Fragment>
168 | `);
169 | const driver = await createSliderDriver("slider");
170 | await driver.dragThumbByMouse("start", 0);
171 | await driver.dragThumbByMouse("end", 1);
172 |
173 | await expect(page.getByTestId("sliderValue0")).toHaveText("0");
174 | await expect(page.getByTestId("sliderValue1")).toHaveText("10");
175 | });
176 |
177 | test("all thumbs are interactable via keyboard", async ({ initTestBed, createSliderDriver, page }) => {
178 | await initTestBed(`
179 | <Fragment>
180 | <Slider id="slider" initialValue="{[2, 4]}" minValue="0" maxValue="10" />
181 | <Text testId="sliderValue0">{slider.value[0]}</Text>
182 | <Text testId="sliderValue1">{slider.value[1]}</Text>
183 | </Fragment>
184 | `);
185 | const driver = await createSliderDriver("slider");
186 | await driver.stepThumbByKeyboard("ArrowLeft", 0);
187 | await driver.stepThumbByKeyboard("ArrowRight", 1);
188 | await expect(page.getByTestId("sliderValue0")).toHaveText("1");
189 | await expect(page.getByTestId("sliderValue1")).toHaveText("5");
190 | });
191 |
192 | test("minStepsBetweenThumbs maintains thumb separation", async ({ initTestBed, createSliderDriver, page }) => {
193 | await initTestBed(`
194 | <Fragment>
195 | <Slider id="slider" initialValue="{[0, 5]}" minStepsBetweenThumbs="3" minValue="0" maxValue="10" />
196 | <Text testId="sliderValue1">{slider.value[1]}</Text>
197 | </Fragment>
198 | `);
199 | const driver = await createSliderDriver("slider");
200 | await driver.stepThumbByKeyboard("ArrowLeft", 1, 3); // Try to move left by 3 steps
201 | await expect(page.getByTestId("sliderValue1")).toHaveText("3");
202 | });
203 |
204 | test("enabled=false disables control", async ({ initTestBed, page }) => {
205 | await initTestBed(`<Slider enabled="false" />`);
206 | await expect(page.getByRole("slider")).toBeDisabled();
207 | });
208 |
209 | test("readOnly prevents interaction", async ({ initTestBed, page, createSliderDriver }) => {
210 | await initTestBed(`
211 | <Fragment>
212 | <Slider id="mySlider" readOnly="true" />
213 | <Text testId="slider-value" value="{mySlider.value}" />
214 | </Fragment>`);
215 | const driver = await createSliderDriver("mySlider");
216 | await driver.dragThumbByMouse("end");
217 | await expect(page.getByTestId("slider-value")).toHaveText("0"); // Value should remain unchanged
218 | });
219 |
220 | test.fixme(
221 | "autoFocus focuses slider on mount",
222 | SKIP_REASON.XMLUI_BUG("autoFocus does not seem to work with radix-ui, need to double-check"),
223 | async ({ initTestBed, page }) => {
224 | await initTestBed(`<Slider autoFocus="true" />`);
225 | await expect(page.getByRole("slider")).toBeFocused();
226 | },
227 | );
228 |
229 | test("required shows visual indicator", async ({ initTestBed, page }) => {
230 | await initTestBed(`<Slider required="true" label="Required slider" />`);
231 | await expect(page.getByText("Required slider")).toContainText("*");
232 | });
233 |
234 | test("showValues=true displays current value", async ({ initTestBed, page }) => {
235 | await initTestBed(`<Slider showValues="true" initialValue="10" />`);
236 | await page.getByRole("slider").hover();
237 | await expect(page.getByText("10")).toBeVisible();
238 | });
239 |
240 | test("showValues=false hides current value", async ({ initTestBed, page }) => {
241 | await initTestBed(`<Slider showValues="false" initialValue="10" />`);
242 | await page.getByRole("slider").hover();
243 | await expect(page.getByText("10")).not.toBeVisible();
244 | });
245 |
246 | test("valueFormat customizes value display", async ({ initTestBed, page }) => {
247 | await initTestBed(
248 | `<Slider showValues="true" initialValue="10" valueFormat="{(v) => v + '%'}" />`,
249 | );
250 | await page.getByRole("slider").hover();
251 | await expect(page.getByText("10%")).toBeVisible();
252 | });
253 |
254 | test("handles array initialValue for range", async ({ initTestBed, page }) => {
255 | await initTestBed(`<Slider initialValue="{[2, 6]}" />`);
256 | const sliders = page.getByRole("slider");
257 |
258 | await sliders.first().hover();
259 | await expect(page.getByText("2")).toBeVisible();
260 | await expect(page.getByText("6")).toBeVisible();
261 | });
262 |
263 | test("maintains thumb order in range mode", async ({ initTestBed, page }) => {
264 | await initTestBed(`<Slider initialValue="{[6, 2]}" />`);
265 | const sliders = page.getByRole("slider");
266 | // Should auto-correct to [2, 6]
267 | await sliders.first().hover();
268 | await expect(page.getByText("2")).toBeVisible();
269 | await expect(page.getByText("6")).toBeVisible();
270 | });
271 | });
272 |
273 | // =============================================================================
274 | // ACCESSIBILITY TESTS
275 | // =============================================================================
276 |
277 | test.describe("Accessibility", () => {
278 | test("has correct ARIA role", async ({ initTestBed, page }) => {
279 | await initTestBed(`<Slider />`);
280 | await expect(page.getByRole("slider")).toBeVisible();
281 | });
282 | test("label is properly associated", async ({ initTestBed, page }) => {
283 | await initTestBed(`<Slider label="Volume Control" />`);
284 | await page.getByText("Volume Control").click();
285 | await expect(page.getByRole("slider")).toBeFocused();
286 | });
287 |
288 | test("supports keyboard navigation", async ({ initTestBed, page }) => {
289 | await initTestBed(`
290 | <Fragment>
291 | <Slider id="mySlider" initialValue="5" />
292 | <Text testId="slider-value">{mySlider.value}</Text>
293 | </Fragment>`);
294 | const slider = page.getByRole("slider");
295 | await slider.focus();
296 |
297 | await slider.press("ArrowRight");
298 | await expect(page.getByTestId("slider-value")).toHaveText("6");
299 |
300 | await slider.press("ArrowLeft");
301 | await expect(page.getByTestId("slider-value")).toHaveText("5");
302 | });
303 |
304 | test("supports Home/End key navigation", async ({ initTestBed, page }) => {
305 | await initTestBed(`
306 | <Fragment>
307 | <Slider id="mySlider" minValue="0" maxValue="100" initialValue="50" />
308 | <Text testId="slider-value">{mySlider.value}</Text>
309 | </Fragment>`);
310 | const slider = page.getByRole("slider");
311 | await slider.focus();
312 |
313 | await slider.press("Home");
314 | await expect(page.getByTestId("slider-value")).toHaveText("0");
315 |
316 | await slider.press("End");
317 | await expect(page.getByTestId("slider-value")).toHaveText("100");
318 | });
319 |
320 | test("disabled slider has proper ARIA attributes", async ({ initTestBed, page }) => {
321 | await initTestBed(`<Slider enabled="false" />`);
322 | await expect(page.locator("span").first()).toHaveAttribute("aria-disabled", "true");
323 | });
324 |
325 | test("required slider has proper ARIA attributes", async ({ initTestBed, page }) => {
326 | await initTestBed(`<Slider required="true" />`);
327 | await expect(page.getByRole("slider")).toHaveAttribute("aria-required", "true");
328 | });
329 |
330 | test("range slider has multiple slider roles", async ({ initTestBed, page }) => {
331 | await initTestBed(`<Slider initialValue="{[3, 5]}" />`);
332 | const sliders = page.getByRole("slider");
333 | await expect(sliders).toHaveCount(2);
334 | });
335 | });
336 |
337 | // =============================================================================
338 | // LABEL POSITIONING TESTS
339 | // =============================================================================
340 |
341 | test.describe("Label", () => {
342 | test("labelPosition=top positions label above slider", async ({ initTestBed, page }) => {
343 | await initTestBed(`<Slider label="test" labelPosition="top" />`);
344 |
345 | const { top: sliderTop } = await getBounds(page.getByRole("slider"));
346 | const { bottom: labelBottom } = await getBounds(page.getByText("test"));
347 |
348 | expect(labelBottom).toBeLessThan(sliderTop);
349 | });
350 |
351 | test("labelPosition=start positions label before slider", async ({ initTestBed, page }) => {
352 | await initTestBed(`<Slider label="test" labelPosition="start" />`);
353 |
354 | const { left: sliderLeft } = await getBounds(page.getByRole("slider"));
355 | const { right: labelRight } = await getBounds(page.getByText("test"));
356 |
357 | expect(labelRight).toBeLessThan(sliderLeft);
358 | });
359 |
360 | test("labelWidth applies custom label width", async ({ initTestBed, page }) => {
361 | const expected = 150;
362 | await initTestBed(`<Slider label="test label" labelWidth="${expected}px" />`);
363 | const { width } = await getBounds(page.getByText("test label"));
364 | expect(width).toEqual(expected);
365 | });
366 |
367 | test("labelBreak enables label line breaks", async ({ initTestBed, page }) => {
368 | const labelText = "Very long label text that should break";
369 | await initTestBed(`<Slider label="${labelText}" labelWidth="100px" labelBreak="true" />`);
370 | const label = page.getByText(labelText);
371 | const { height } = await getBounds(label);
372 | expect(height).toBeGreaterThan(20); // Assumes multi-line height
373 | });
374 |
375 | test("handles invalid labelPosition gracefully", async ({ initTestBed, page }) => {
376 | await initTestBed(`<Slider labelPosition="invalid" label="test" />`);
377 | await expect(page.getByRole("slider")).toBeVisible();
378 | await expect(page.getByText("test")).toBeVisible();
379 | });
380 | });
381 |
382 | // =============================================================================
383 | // EVENT HANDLING TESTS
384 | // =============================================================================
385 |
386 | test.describe("Event Handling", () => {
387 | test("didChange event fires on value change", async ({ initTestBed, page }) => {
388 | const { testStateDriver } = await initTestBed(`
389 | <Slider onDidChange="testState = 'changed'" initialValue="0" />
390 | `);
391 | const slider = page.getByRole("slider");
392 | await slider.focus();
393 | await slider.press("ArrowRight");
394 | await expect.poll(testStateDriver.testState).toEqual("changed");
395 | });
396 |
397 | test("didChange event passes new value", async ({ initTestBed, page }) => {
398 | const { testStateDriver } = await initTestBed(`
399 | <Slider onDidChange="arg => testState = arg" initialValue="1" />
400 | `);
401 | const slider = page.getByRole("slider");
402 | await slider.focus();
403 | await slider.press("ArrowRight");
404 | await expect.poll(testStateDriver.testState).toEqual(2);
405 | });
406 |
407 | test("gotFocus event fires on focus", async ({ initTestBed, page }) => {
408 | const { testStateDriver } = await initTestBed(`
409 | <Slider onGotFocus="testState = 'focused'" />
410 | `);
411 | await page.getByRole("slider").focus();
412 | await expect.poll(testStateDriver.testState).toEqual("focused");
413 | });
414 |
415 | test("gotFocus event fires on label click", async ({ initTestBed, page }) => {
416 | const { testStateDriver } = await initTestBed(`
417 | <Slider label="Volume" onGotFocus="testState = 'focused'" />
418 | `);
419 | await page.getByText("Volume").click();
420 | await expect.poll(testStateDriver.testState).toEqual("focused");
421 | });
422 |
423 | test("lostFocus event fires on blur", async ({ initTestBed, page }) => {
424 | const { testStateDriver } = await initTestBed(`
425 | <Slider onLostFocus="testState = 'blurred'" />
426 | `);
427 | const slider = page.getByRole("slider");
428 | await slider.focus();
429 | await slider.blur();
430 | await expect.poll(testStateDriver.testState).toEqual("blurred");
431 | });
432 |
433 | test("events do not fire when disabled", async ({ initTestBed, page }) => {
434 | const { testStateDriver } = await initTestBed(`
435 | <Slider enabled="false" onDidChange="testState = 'changed'" onGotFocus="testState = 'focused'" />
436 | `);
437 | const slider = page.getByRole("slider");
438 | await slider.focus();
439 | await slider.press("ArrowRight");
440 | await expect.poll(testStateDriver.testState).toEqual(null);
441 | });
442 | });
443 |
444 | // =============================================================================
445 | // API TESTS
446 | // =============================================================================
447 |
448 | test.describe("Api", () => {
449 | test("value API returns current state", async ({ initTestBed, page }) => {
450 | await initTestBed(`
451 | <Fragment>
452 | <Slider id="mySlider" initialValue="5" />
453 | <Text testId="value">{mySlider.value}</Text>
454 | </Fragment>
455 | `);
456 | await expect(page.getByTestId("value")).toHaveText("5");
457 | });
458 |
459 | test("value API returns state after change", async ({ initTestBed, page }) => {
460 | await initTestBed(`
461 | <Fragment>
462 | <Slider id="mySlider" initialValue="1" />
463 | <Text testId="value">{mySlider.value}</Text>
464 | </Fragment>
465 | `);
466 | const slider = page.getByRole("slider");
467 | await slider.focus();
468 | await slider.press("ArrowRight");
469 | await expect(page.getByTestId("value")).toHaveText("2");
470 | });
471 |
472 | test("setValue API updates state", async ({ initTestBed, page }) => {
473 | await initTestBed(`
474 | <Fragment>
475 | <Slider id="mySlider" />
476 | <Button testId="setBtn" onClick="mySlider.setValue(5)" label="{mySlider.value}" />
477 | </Fragment>
478 | `);
479 | await page.getByTestId("setBtn").click();
480 | await expect(page.getByTestId("setBtn")).toHaveText("5");
481 | });
482 |
483 | test("setValue API triggers events", async ({ initTestBed, page }) => {
484 | const { testStateDriver } = await initTestBed(`
485 | <Fragment>
486 | <Slider id="mySlider" onDidChange="testState = 'api-changed'" />
487 | <Button testId="setBtn" onClick="mySlider.setValue(75)" />
488 | </Fragment>
489 | `);
490 | await page.getByTestId("setBtn").click();
491 | await expect.poll(testStateDriver.testState).toEqual("api-changed");
492 | });
493 |
494 | test("focus API focuses the slider", async ({ initTestBed, page }) => {
495 | await initTestBed(`
496 | <Fragment>
497 | <Slider id="mySlider" />
498 | <Button testId="focusBtn" onClick="mySlider.focus()" />
499 | </Fragment>
500 | `);
501 | const slider = page.getByRole("slider");
502 | await expect(slider).not.toBeFocused();
503 |
504 | await page.getByTestId("focusBtn").click();
505 | await expect(slider).toBeFocused();
506 | });
507 |
508 | test("focus API does nothing when disabled", async ({ initTestBed, page }) => {
509 | await initTestBed(`
510 | <Fragment>
511 | <Slider id="mySlider" enabled="false" />
512 | <Button testId="focusBtn" onClick="mySlider.focus()" />
513 | </Fragment>
514 | `);
515 | await page.getByTestId("focusBtn").click();
516 | await expect(page.getByRole("slider")).not.toBeFocused();
517 | });
518 |
519 | test("setValue does not update when disabled", async ({ initTestBed, page }) => {
520 | await initTestBed(`
521 | <Fragment>
522 | <Slider id="mySlider" enabled="false" initialValue="5" />
523 | <Button testId="setBtn" onClick="mySlider.setValue(10)" label="{mySlider.value}" />
524 | </Fragment>
525 | `);
526 | await page.getByTestId("setBtn").click();
527 | await expect(page.getByTestId("setBtn")).toHaveText("5");
528 | });
529 |
530 | test("setValue handles invalid values gracefully", async ({ initTestBed, page }) => {
531 | await initTestBed(`
532 | <Fragment>
533 | <Slider id="mySlider" initialValue="5" minValue="0" />
534 | <Button testId="setBtn" onClick="mySlider.setValue('invalid')" label="{mySlider.value}" />
535 | </Fragment>
536 | `);
537 | await page.getByTestId("setBtn").click();
538 | await expect(page.getByTestId("setBtn")).toHaveText("0");
539 | });
540 | });
541 |
542 | // =============================================================================
543 | // THEME VARIABLE TESTS
544 | // =============================================================================
545 |
546 | test.describe("Theme Variables", () => {
547 | test("backgroundColor-track applies correctly", async ({ initTestBed, page }) => {
548 | await initTestBed(`<Slider testId="slider" />`, {
549 | testThemeVars: {
550 | "backgroundColor-track-Slider": "rgb(255, 0, 0)",
551 | },
552 | });
553 | const track = page.locator("[data-track]");
554 | await expect(track).toHaveCSS("background-color", "rgb(255, 0, 0)");
555 | });
556 |
557 | test("backgroundColor-range applies correctly", async ({ initTestBed, page }) => {
558 | await initTestBed(`<Slider testId="slider" initialValue="5" />`, {
559 | testThemeVars: {
560 | "backgroundColor-range-Slider": "rgb(0, 255, 0)",
561 | },
562 | });
563 | const range = page.locator("[data-range]");
564 | await expect(range).toHaveCSS("background-color", "rgb(0, 255, 0)");
565 | });
566 |
567 | test("backgroundColor-thumb applies correctly", async ({ initTestBed, page }) => {
568 | await initTestBed(`<Slider testId="slider" />`, {
569 | testThemeVars: {
570 | "backgroundColor-thumb-Slider": "rgb(0, 0, 255)",
571 | },
572 | });
573 | const thumb = page.getByRole("slider");
574 | await expect(thumb).toHaveCSS("background-color", "rgb(0, 0, 255)");
575 | });
576 |
577 | test("disabled theme variables apply when disabled", async ({ initTestBed, page }) => {
578 | await initTestBed(`<Slider testId="slider" enabled="false" />`, {
579 | testThemeVars: {
580 | "backgroundColor-track-Slider--disabled": "rgb(200, 200, 200)",
581 | },
582 | });
583 | const track = page.locator("[data-track]");
584 | await expect(track).toHaveCSS("background-color", "rgb(200, 200, 200)");
585 | });
586 |
587 | test("focus theme variables apply on focus", async ({ initTestBed, page }) => {
588 | await initTestBed(`<Slider testId="slider" />`, {
589 | testThemeVars: {
590 | "boxShadow-thumb-Slider--focus": "rgb(0, 123, 255) 0px 0px 10px 0px",
591 | },
592 | });
593 | const slider = page.getByRole("slider");
594 | await slider.focus();
595 | await expect(slider).toHaveCSS("box-shadow", "rgb(0, 123, 255) 0px 0px 10px 0px");
596 | });
597 |
598 | test("hover theme variables apply on hover", async ({ initTestBed, page }) => {
599 | await initTestBed(`<Slider testId="slider" />`, {
600 | testThemeVars: {
601 | "boxShadow-thumb-Slider--hover": "rgb(0, 0, 0) 0px 0px 5px 0px",
602 | },
603 | });
604 | const slider = page.getByRole("slider");
605 | await slider.hover();
606 | await expect(slider).toHaveCSS("box-shadow", "rgb(0, 0, 0) 0px 0px 5px 0px");
607 | });
608 | });
609 |
610 | // =============================================================================
611 | // VALIDATION TESTS
612 | // =============================================================================
613 |
614 | test.describe("Validation", () => {
615 | test("handles invalid validationStatus gracefully", async ({ initTestBed, page }) => {
616 | await initTestBed(`<Slider validationStatus="invalid" />`);
617 | await expect(page.getByRole("slider")).toBeVisible();
618 | });
619 |
620 | [
621 | { value: "--default", prop: "" },
622 | { value: "--warning", prop: 'validationStatus="warning"' },
623 | { value: "--error", prop: 'validationStatus="error"' },
624 | { value: "--success", prop: 'validationStatus="valid"' },
625 | ].forEach((variant) => {
626 | test(`applies correct borderRadius ${variant.value}`, async ({ initTestBed, page }) => {
627 | await initTestBed(`<Slider ${variant.prop} />`, {
628 | testThemeVars: { [`borderRadius-Slider${variant.value}`]: "12px" },
629 | });
630 | const sliderTrack = page.locator("[data-track]");
631 | await expect(sliderTrack).toHaveCSS("border-radius", "12px");
632 | });
633 |
634 | test(`applies correct borderColor ${variant.value}`, async ({ initTestBed, page }) => {
635 | await initTestBed(`<Slider ${variant.prop} />`, {
636 | testThemeVars: { [`borderColor-Slider${variant.value}`]: "rgb(255, 0, 0)" },
637 | });
638 | const sliderTrack = page.locator("[data-track]");
639 | await expect(sliderTrack).toHaveCSS("border-color", "rgb(255, 0, 0)");
640 | });
641 |
642 | test(`applies correct borderWidth ${variant.value}`, async ({ initTestBed, page }) => {
643 | await initTestBed(`<Slider testId="test" ${variant.prop} />`, {
644 | testThemeVars: { [`borderWidth-Slider${variant.value}`]: "1px" },
645 | });
646 | const sliderTrack = page.locator("[data-track]");
647 | await expect(sliderTrack).toHaveCSS("border-width", "1px");
648 | });
649 |
650 | test(`applies correct borderStyle ${variant.value}`, async ({ initTestBed, page }) => {
651 | await initTestBed(`<Slider ${variant.prop} />`, {
652 | testThemeVars: { [`borderStyle-Slider${variant.value}`]: "dashed" },
653 | });
654 | const sliderTrack = page.locator("[data-track]");
655 | await expect(sliderTrack).toHaveCSS("border-style", "dashed");
656 | });
657 |
658 | test(`applies correct boxShadow ${variant.value}`, async ({ initTestBed, page }) => {
659 | await initTestBed(`<Slider ${variant.prop} />`, {
660 | testThemeVars: {
661 | [`boxShadow-Slider${variant.value}`]: "0 2px 8px rgba(0, 0, 0, 0.1)",
662 | },
663 | });
664 | const sliderTrack = page.locator("[data-track]");
665 | await expect(sliderTrack).toHaveCSS(
666 | "box-shadow",
667 | "rgba(0, 0, 0, 0.1) 0px 2px 8px 0px",
668 | );
669 | });
670 |
671 | test(`applies correct borderColor on hover ${variant.value}`, async ({ initTestBed, page }) => {
672 | await initTestBed(`<Slider ${variant.prop} />`, {
673 | testThemeVars: { [`borderColor-Slider${variant.value}--hover`]: "rgb(0, 0, 0)" },
674 | });
675 | const sliderTrack = page.locator("[data-track]");
676 | await sliderTrack.hover();
677 | await expect(sliderTrack).toHaveCSS("border-color", "rgb(0, 0, 0)");
678 | });
679 |
680 | test(`applies correct boxShadow on hover ${variant.value}`, async ({ initTestBed, page }) => {
681 | await initTestBed(`<Slider ${variant.prop} />`, {
682 | testThemeVars: {
683 | [`boxShadow-Slider${variant.value}--hover`]: "0 2px 8px rgba(0, 0, 0, 0.1)",
684 | },
685 | });
686 | const sliderTrack = page.locator("[data-track]");
687 | await sliderTrack.hover();
688 | await expect(sliderTrack).toHaveCSS(
689 | "box-shadow",
690 | "rgba(0, 0, 0, 0.1) 0px 2px 8px 0px",
691 | );
692 | });
693 | });
694 | });
695 |
696 | // =============================================================================
697 | // EDGE CASE TESTS
698 | // =============================================================================
699 |
700 | test.describe("Edge Cases", () => {
701 | test("handles extremely large values", async ({ initTestBed, page }) => {
702 | await initTestBed(`
703 | <Fragment>
704 | <Slider id="mySlider" initialValue="${Number.MAX_SAFE_INTEGER}" maxValue="${Number.MAX_SAFE_INTEGER}" />
705 | <Text testId="slider-value" value="{mySlider.value}" />
706 | </Fragment>`);
707 | await expect(page.getByTestId("slider-value")).toHaveText(Number.MAX_SAFE_INTEGER.toString());
708 | });
709 |
710 | test("handles negative values", async ({ initTestBed, page }) => {
711 | await initTestBed(`
712 | <Fragment>
713 | <Slider id="mySlider" minValue="-100" maxValue="0" initialValue="-50" />
714 | <Text testId="slider-value" value="{mySlider.value}" />
715 | </Fragment>`);
716 | await expect(page.getByTestId("slider-value")).toHaveText("-50");
717 | });
718 |
719 | test("handles very small step values", async ({ initTestBed, page }) => {
720 | await initTestBed(`
721 | <Fragment>
722 | <Slider id="mySlider" step="0.000000001" initialValue="0" />
723 | <Text testId="slider-value" value="{mySlider.value}" />
724 | </Fragment>`);
725 | const slider = page.getByRole("slider");
726 | await slider.focus();
727 | await slider.press("ArrowRight");
728 | await expect(page.getByTestId("slider-value")).toHaveText((0.000000001).toExponential());
729 | });
730 |
731 | test("handles conflicting min/max values", async ({ initTestBed, page }) => {
732 | await initTestBed(`<Slider minValue="100" maxValue="50" />`);
733 | await expect(page.getByRole("slider")).toBeVisible();
734 | });
735 |
736 | test("handles zero step value", async ({ initTestBed, page }) => {
737 | await initTestBed(`<Slider step="0" />`);
738 | await expect(page.getByRole("slider")).toBeVisible();
739 | });
740 |
741 | test("handles range with identical values", async ({ initTestBed, page }) => {
742 | await initTestBed(`<Slider initialValue="{[50, 50]}" />`);
743 | const sliders = page.getByRole("slider");
744 | await expect(sliders).toHaveCount(2);
745 | });
746 | });
747 |
748 | // =============================================================================
749 | // VISUAL STATE TESTS
750 | // =============================================================================
751 |
752 | test("input has correct width in px", async ({ page, initTestBed }) => {
753 | await initTestBed(`<Slider width="200px" testId="test"/>`, {});
754 |
755 | const input = page.getByTestId("test");
756 | const { width } = await input.boundingBox();
757 | expect(width).toBe(200);
758 | });
759 |
760 | test("input with label has correct width in px", async ({ page, initTestBed }) => {
761 | await initTestBed(`<Slider width="200px" label="test" testId="test"/>`, {});
762 |
763 | const input = page.getByTestId("test");
764 | const { width } = await input.boundingBox();
765 | expect(width).toBe(200);
766 | });
767 |
768 | test("input has correct width in %", async ({ page, initTestBed }) => {
769 | await page.setViewportSize({ width: 400, height: 300});
770 | await initTestBed(`<Slider width="50%" testId="test"/>`, {});
771 |
772 | const input = page.getByTestId("test");
773 | const { width } = await input.boundingBox();
774 | expect(width).toBe(200);
775 | });
776 |
777 | test("input with label has correct width in %", async ({ page, initTestBed }) => {
778 | await page.setViewportSize({ width: 400, height: 300});
779 | await initTestBed(`<Slider width="50%" label="test" testId="test"/>`, {});
780 |
781 | const input = page.getByTestId("test");
782 | const { width } = await input.boundingBox();
783 | expect(width).toBe(200);
784 | });
```