#
tokens: 49944/50000 4/1631 files (page 83/189)
lines: on (toggle) GitHub
raw markdown copy reset
This is page 83 of 189. Use http://codebase.md/xmlui-org/xmlui/tools/vscode/resources/%7Bsrc%7D?lines=true&page={x} to view the full context.

# Directory Structure

```
├── .changeset
│   ├── config.json
│   ├── tender-llamas-dress.md
│   └── tricky-flies-pull.md
├── .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-swa.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
│   │           ├── HelloMd.md
│   │           ├── HeroSection.md
│   │           └── ScrollToTop.md
│   ├── extensions.ts
│   ├── index.html
│   ├── index.ts
│   ├── package.json
│   ├── public
│   │   ├── feed.rss
│   │   ├── mockServiceWorker.js
│   │   ├── pages
│   │   │   ├── _meta.json
│   │   │   ├── app-structure.md
│   │   │   ├── build-editor-component.md
│   │   │   ├── build-hello-world-component.md
│   │   │   ├── components-intro.md
│   │   │   ├── context-variables.md
│   │   │   ├── forms.md
│   │   │   ├── globals.md
│   │   │   ├── glossary.md
│   │   │   ├── helper-tags.md
│   │   │   ├── hosted-deployment.md
│   │   │   ├── howto
│   │   │   │   ├── assign-a-complex-json-literal-to-a-component-variable.md
│   │   │   │   ├── chain-a-refetch.md
│   │   │   │   ├── 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.module.scss
│   │       │   ├── 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.tsx
│   │       │   ├── StandalonePlayground.tsx
│   │       │   ├── StandalonePlaygroundNative.module.scss
│   │       │   ├── StandalonePlaygroundNative.tsx
│   │       │   ├── ThemeSwitcher.module.scss
│   │       │   ├── ThemeSwitcher.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
    │   │   │   └── test-padding.xmlui
    │   │   ├── 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.json
    ├── tsdown.config.ts
    ├── vite.config.ts
    └── vitest.config.ts
```

# Files

--------------------------------------------------------------------------------
/xmlui/src/components-core/rendering/ComponentAdapter.tsx:
--------------------------------------------------------------------------------

```typescript
  1 | import type { MutableRefObject, ReactElement, ReactNode } from "react";
  2 | import React, { cloneElement, forwardRef, useCallback, useEffect, useMemo, useRef } from "react";
  3 | import { isEmpty, isPlainObject } from "lodash-es";
  4 | import { composeRefs } from "@radix-ui/react-compose-refs";
  5 | 
  6 | import type { ParentRenderContext } from "../../abstractions/ComponentDefs";
  7 | import type {
  8 |   LayoutContext,
  9 |   LookupEventHandlerFn,
 10 |   RegisterComponentApiFn,
 11 |   RenderChildFn,
 12 |   RendererContext,
 13 | } from "../../abstractions/RendererDefs";
 14 | import type { LookupAsyncFn, LookupSyncFn } from "../../abstractions/ActionDefs";
 15 | 
 16 | import { extractParam } from "../utils/extractParam";
 17 | import { useTheme } from "../theming/ThemeContext";
 18 | import { useComponentStyle } from "../theming/StyleContext";
 19 | import { mergeProps } from "../utils/mergeProps";
 20 | import ComponentDecorator from "../ComponentDecorator";
 21 | import { createValueExtractor } from "../rendering/valueExtractor";
 22 | import { EMPTY_OBJECT } from "../constants";
 23 | import { useComponentRegistry } from "../../components/ComponentRegistryContext";
 24 | import { ApiBoundComponent } from "../ApiBoundComponent";
 25 | import { useReferenceTrackedApi, useShallowCompareMemoize } from "../utils/hooks";
 26 | import type { InnerRendererContext } from "../abstractions/ComponentRenderer";
 27 | import { ContainerActionKind } from "./containers";
 28 | import { useInspector } from "../InspectorContext";
 29 | import { SlotItem } from "../../components/SlotItem";
 30 | import { layoutOptionKeys } from "../descriptorHelper";
 31 | import { useMouseEventHandlers } from "../event-handlers";
 32 | import UnknownComponent from "./UnknownComponent";
 33 | import InvalidComponent from "./InvalidComponent";
 34 | import { resolveLayoutProps } from "../theming/layout-resolver";
 35 | 
 36 | // --- The available properties of Component
 37 | type Props = Omit<InnerRendererContext, "layoutContext"> & {
 38 |   layoutContextRef: MutableRefObject<LayoutContext | undefined>;
 39 |   onUnmount: (uid: symbol) => void;
 40 |   children?: ReactNode;
 41 | };
 42 | 
 43 | /**
 44 |  * This component's primary responsibility is to transform a particular component definition
 45 |  * into its React representation using the current rendering context.
 46 |  *
 47 |  * Its properties hold a transformed version of an `InnerRendererContext` (which describes the
 48 |  * current rendering context). The modified version uses a stable reference to the layout context
 49 |  * and provides a cleanup function (`onUnmount`) to call when the component is about to be disposed.
 50 |  */
 51 | const ComponentAdapter = forwardRef(function ComponentAdapter(
 52 |   {
 53 |     node,
 54 |     state,
 55 |     appContext,
 56 |     dispatch,
 57 |     lookupAction,
 58 |     lookupSyncCallback,
 59 |     renderChild,
 60 |     registerComponentApi,
 61 |     layoutContextRef,
 62 |     parentRenderContext,
 63 |     memoedVarsRef,
 64 |     onUnmount,
 65 |     uidInfoRef,
 66 |     children,
 67 |     ...rest
 68 |   }: Props,
 69 |   ref: React.ForwardedRef<any>,
 70 | ) {
 71 |   // --- Make sure the component definition has `props` and `events` properties
 72 |   // --- (even if they are empty)
 73 |   const safeNode = useMemo(() => {
 74 |     return {
 75 |       ...node,
 76 |       props: node.props || (EMPTY_OBJECT as Record<string, any>),
 77 |       events: node.events || (EMPTY_OBJECT as Record<string, any>),
 78 |     };
 79 |   }, [node]);
 80 | 
 81 |   // --- Each component receives a unique identifier
 82 |   const uid = useMemo(() => Symbol(safeNode.uid), [safeNode.uid]);
 83 | 
 84 |   // --- Takes care the component cleanup function is called when the component
 85 |   // --- is about to be disposed
 86 |   useEffect(() => {
 87 |     return () => {
 88 |       onUnmount(uid);
 89 |     };
 90 |   }, [onUnmount, uid]);
 91 | 
 92 |   // --- Obtain a function to register the component API
 93 |   const memoedRegisterComponentApi: RegisterComponentApiFn = useCallback(
 94 |     (api) => {
 95 |       registerComponentApi(uid, api);
 96 |     },
 97 |     [registerComponentApi, uid],
 98 |   );
 99 | 
100 |   // --- Obtain a function to update the component state
101 |   const memoedUpdateState = useCallback(
102 |     (componentState: any) => {
103 |       dispatch({
104 |         type: ContainerActionKind.COMPONENT_STATE_CHANGED,
105 |         payload: {
106 |           uid,
107 |           state: componentState,
108 |         },
109 |       });
110 |     },
111 |     [dispatch, uid],
112 |   );
113 | 
114 |   // --- Get the tracked APIs of the compomnent
115 |   const referenceTrackedApi = useReferenceTrackedApi(state);
116 | 
117 |   // --- Obtain a function to extract the value of a property (from an expression)
118 |   const valueExtractor = useMemo(() => {
119 |     return createValueExtractor(state, appContext, referenceTrackedApi, memoedVarsRef);
120 |   }, [appContext, memoedVarsRef, referenceTrackedApi, state]);
121 | 
122 |   // --- Obtain a function that can execute a script synchronously
123 |   const memoedLookupSyncCallback: LookupSyncFn = useCallback(
124 |     (action) => {
125 |       return lookupSyncCallback(valueExtractor(action), uid);
126 |     },
127 |     [lookupSyncCallback, uid, valueExtractor],
128 |   );
129 | 
130 |   // --- Obtain a function to lookup an action by its name, which is bound
131 |   // --- to this component instance
132 |   const memoedLookupAction: LookupAsyncFn = useCallback(
133 |     (action, actionOptions) => {
134 |       return lookupAction(action, uid, actionOptions);
135 |     },
136 |     [lookupAction, uid],
137 |   );
138 | 
139 |   // --- Obtain the component renderer and descriptor from the component registry
140 |   // --- Memoizes the renderChild function
141 |   const memoedRenderChild: RenderChildFn = useCallback(
142 |     (children, layoutContext, pRenderContext) => {
143 |       return renderChild(
144 |         children,
145 |         layoutContext,
146 |         pRenderContext || parentRenderContext,
147 |         uidInfoRef,
148 |       );
149 |     },
150 |     [renderChild, parentRenderContext, uidInfoRef],
151 |   );
152 | 
153 |   // --- Collect the API-bound properties and events of the component to determine
154 |   // --- if the component should be wrapped in an `ApiBoundComponent`
155 |   const apiBoundProps = useMemo(
156 |     () => getApiBoundItems(safeNode.props, "DataSource", "DataSourceRef"),
157 |     [safeNode.props],
158 |   );
159 |   const apiBoundEvents = useMemo(
160 |     () => getApiBoundItems(safeNode.events, "APICall", "FileDownload", "FileUpload"),
161 |     [safeNode.events],
162 |   );
163 |   const isApiBound = apiBoundProps.length > 0 || apiBoundEvents.length > 0;
164 | 
165 |   // --- Obtain the component renderer and descriptor from the component registry
166 |   const componentRegistry = useComponentRegistry();
167 |   const { renderer, descriptor, isCompoundComponent } =
168 |     componentRegistry.lookupComponentRenderer(safeNode.type) || {};
169 | 
170 |   // --- Obtain a function that can lookup an event handler, which is bound to a
171 |   // --- particular event of this component instance
172 |   const memoedLookupEventHandler: LookupEventHandlerFn = useCallback(
173 |     (eventName, actionOptions) => {
174 |       const action = safeNode.events?.[eventName] || actionOptions?.defaultHandler;
175 |       return lookupAction(action, uid, { eventName, ...actionOptions });
176 |     },
177 |     [lookupAction, safeNode.events, uid],
178 |   );
179 | 
180 |   // --- Set up the mouse event handlers for the component
181 |   const mouseEventHandlers = useMouseEventHandlers(
182 |     memoedLookupEventHandler,
183 |     descriptor?.nonVisual || isApiBound || isCompoundComponent,
184 |   );
185 | 
186 |   // --- Use the current theme to obtain resources and collect theme variables
187 |   const { getResourceUrl } = useTheme();
188 | 
189 |   // --- Obtain a function that can extract a resource URL from a logical URL
190 |   const extractResourceUrl = useCallback(
191 |     (url?: unknown) => {
192 |       const extractedUrl = valueExtractor(url);
193 |       if (typeof extractedUrl !== "string" || extractedUrl.trim() === "") {
194 |         console.warn(
195 |           `Component '${safeNode.type}': ` +
196 |             `the extracted resource URL is not a valid string: value ${extractedUrl}, type ${typeof extractedUrl}`,
197 |         );
198 |         return undefined;
199 |       }
200 |       return getResourceUrl(extractedUrl);
201 |     },
202 |     [getResourceUrl, valueExtractor, safeNode.type],
203 |   );
204 | 
205 |   // --- Collect and compile the layout property values
206 |   const { cssProps } = useMemo(() => {
207 |     const resolvedLayoutProps: Record<string, any> = {};
208 |     layoutOptionKeys.forEach((key) => {
209 |       if (safeNode.props && key in safeNode.props) {
210 |         resolvedLayoutProps[key] = valueExtractor(safeNode.props[key], true);
211 |       }
212 |     });
213 | 
214 |     // --- New layout property resolution
215 |     return resolveLayoutProps(resolvedLayoutProps, {
216 |       ...layoutContextRef?.current,
217 |       mediaSize: appContext.mediaSize,
218 |     });
219 | 
220 |     // --- Old layout property resolution
221 |     // return compileLayout(resolvedLayoutProps, themeVars, {
222 |     //   ...layoutContextRef?.current,
223 |     //   mediaSize: appContext.mediaSize,
224 |     // });
225 |   }, [appContext.mediaSize, layoutContextRef, safeNode.props, valueExtractor]);
226 | 
227 |   // const className = useComponentStyle(cssProps);
228 | 
229 |   // --- As compileLayout generates new cssProps and nonCssProps objects every time, we need to
230 |   // --- memoize them using shallow comparison to avoid unnecessary re-renders.
231 |   const stableLayoutCss = useShallowCompareMemoize(cssProps);
232 | 
233 |   const className = useComponentStyle(stableLayoutCss);
234 | 
235 |   const { inspectId, refreshInspection } = useInspector(safeNode, uid);
236 | 
237 |   // --- Extract context variables (keys starting with "$") from state
238 |   const contextVars = useMemo(() => {
239 |     const vars: Record<string, any> = {};
240 |     for (const key of Object.keys(state)) {
241 |       if (key.startsWith("$")) {
242 |         vars[key] = state[key];
243 |       }
244 |     }
245 |     return vars;
246 |   }, [state]);
247 | 
248 |   // --- Assemble the renderer context we pass down the rendering chain
249 |   const rendererContext: RendererContext<any> = {
250 |     node: safeNode,
251 |     state: state[uid] || EMPTY_OBJECT,
252 |     contextVars,
253 |     updateState: memoedUpdateState,
254 |     appContext,
255 |     extractValue: valueExtractor,
256 |     lookupEventHandler: memoedLookupEventHandler,
257 |     lookupAction: memoedLookupAction,
258 |     lookupSyncCallback: memoedLookupSyncCallback,
259 |     extractResourceUrl,
260 |     renderChild: memoedRenderChild,
261 |     registerComponentApi: memoedRegisterComponentApi,
262 |     className,
263 |     layoutContext: layoutContextRef?.current,
264 |     uid,
265 |   };
266 | 
267 |   // --- No special behavior, let's render the component according to its definition.
268 |   let renderedNode: ReactNode = null;
269 |   let renderingError = null;
270 | 
271 |   try {
272 |     if (safeNode.type === "Slot") {
273 |       // --- Transpose the children from the parent component to the slot in
274 |       // --- the compound component
275 |       renderedNode = slotRenderer(rendererContext, parentRenderContext);
276 |     } else {
277 |       if (!renderer) {
278 |         console.error(
279 |           `Component '${safeNode.type}' is not available. Did you forget to register it?`,
280 |         );
281 |         return <UnknownComponent message={`${safeNode.type}`} />;
282 |       }
283 | 
284 |       // --- Render the component using the renderer function obtained from the component registry
285 |       renderedNode = renderer(rendererContext);
286 |     }
287 | 
288 |     /**
289 |      * Apply any behaviors to the component.
290 |      */
291 |     const behaviors = componentRegistry.getBehaviors();
292 |     if (!isCompoundComponent) {
293 |       for (const behavior of behaviors) {
294 |         if (behavior.canAttach(rendererContext.node, descriptor)) {
295 |           renderedNode = behavior.attach(rendererContext, renderedNode, descriptor);
296 |         }
297 |       }
298 |     }
299 | 
300 |     // --- Components may have a `testId` property for E2E testing purposes. Inject the value of `testId`
301 |     // --- into the DOM object of the rendered React component.
302 |     if (
303 |       // --- The component has its "id" (internally, "uid") or "testId" property defined
304 |       ((appContext?.decorateComponentsWithTestId &&
305 |         (safeNode.uid !== undefined || safeNode.testId !== undefined)) ||
306 |         // --- The component has its "inspectId" property defined
307 |         inspectId !== undefined) &&
308 |       // // --- The app context indicates test mode
309 |       // --- The component is visual
310 |       descriptor?.nonVisual !== true &&
311 |       // --- The component is not opaque
312 |       descriptor?.opaque !== true
313 |     ) {
314 |       // --- Use `ComponentDecorator` to inject the `data-testid` attribute into the component.
315 |       const testId = safeNode.testId || safeNode.uid;
316 |       const resolvedUid = extractParam(state, testId, appContext, true);
317 |       renderedNode = (
318 |         <ComponentDecorator
319 |           attr={{ "data-testid": resolvedUid, "data-inspectId": inspectId }}
320 |           allowOnlyRefdChild={isCompoundComponent || safeNode.type === "ModalDialog"}
321 |           onTargetMounted={safeNode.type === "ModalDialog" ? refreshInspection : undefined}
322 |           ref={ref}
323 |         >
324 |           {cloneElement(
325 |             renderedNode as ReactElement,
326 |             {
327 |               ...mergeProps(
328 |                 { ...(renderedNode as ReactElement).props, ...mouseEventHandlers },
329 |                 rest,
330 |               ),
331 |             } as any,
332 |           )}
333 |         </ComponentDecorator>
334 |       );
335 |     }
336 | 
337 |     // --- API-bound components provide helpful behavior out of the box, such as transforming API-bound
338 |     // --- events and properties. This extra functionality is implemented in `ApiBoundComponent`.
339 |     if (isApiBound) {
340 |       return (
341 |         <ApiBoundComponent
342 |           uid={uid}
343 |           renderChild={memoedRenderChild}
344 |           node={safeNode}
345 |           key={safeNode.uid}
346 |           apiBoundEvents={apiBoundEvents}
347 |           apiBoundProps={apiBoundProps}
348 |           layoutContextRef={layoutContextRef}
349 |           parentRendererContext={parentRenderContext}
350 |         />
351 |       );
352 |     }
353 | 
354 |     // --- The current layout context may suggest to wrap the rendered node.
355 |     if (layoutContextRef.current?.wrapChild) {
356 |       renderedNode = layoutContextRef.current.wrapChild(rendererContext, renderedNode, descriptor);
357 |     }
358 |   } catch (e) {
359 |     // --- Mark the potential rendering error and display it
360 |     renderingError = (e as Error)?.message || "Internal error";
361 |     console.error(e);
362 |   }
363 | 
364 |   // --- The rendering process may result in errors. If so, we render an error message.
365 |   if (renderingError) {
366 |     return (
367 |       <InvalidComponent errors={[renderingError]} node={safeNode}>
368 |         {renderedNode}
369 |       </InvalidComponent>
370 |     );
371 |   }
372 | 
373 |   let nodeToRender: ReactNode = renderedNode;
374 |   // --- If we have a single React node with forwarded reference, or mouse events
375 |   // --- let's merge the "rest" properties with it.
376 |   if ((ref || !isEmpty(mouseEventHandlers)) && renderedNode && React.isValidElement(renderedNode)) {
377 |     // --- For radix UI/accessibility, read more here:
378 |     // --- https://www.radix-ui.com/primitives/docs/guides/composition
379 | 
380 |     const childrenArray = !children ? [] : Array.isArray(children) ? children : [children];
381 | 
382 |     const clonedRef =
383 |       renderedNode.type === React.Fragment
384 |         ? undefined
385 |         : ref
386 |           ? composeRefs(ref, (renderedNode as any).ref)
387 |           : (renderedNode as any).ref;
388 | 
389 |     nodeToRender = cloneElement(
390 |       renderedNode,
391 |       {
392 |         ref: clonedRef,
393 |         ...mergeProps(
394 |           {
395 |             ...renderedNode.props,
396 |             ...(renderedNode.type !== React.Fragment ? mouseEventHandlers : {}),
397 |           },
398 |           rest,
399 |         ),
400 |       } as any,
401 |       ...childrenArray,
402 |     );
403 |   } else {
404 |     // --- If the rendering resulted in multiple React nodes, wrap them in a fragment.
405 |     nodeToRender =
406 |       React.isValidElement(renderedNode) && !!children
407 |         ? cloneElement(renderedNode, null, children)
408 |         : renderedNode;
409 |   }
410 | 
411 |   return nodeToRender;
412 | });
413 | 
414 | /**
415 |  * This function renders the content of a slot. If the slot is named, it looks for a template
416 |  * in the parent component to render. If the template is not found, it renders the default content
417 |  * of the slot.
418 |  */
419 | function slotRenderer(
420 |   { node, extractValue, renderChild, lookupAction, layoutContext }: RendererContext<any>,
421 |   parentRenderContext?: ParentRenderContext,
422 | ) {
423 |   // --- Get the template name from the slot
424 |   const templateName = extractValue.asOptionalString(node.props.name);
425 |   if (templateName && !templateName.endsWith("Template")) {
426 |     return (
427 |       <InvalidComponent
428 |         node={node}
429 |         errors={[
430 |           `Slot name '${templateName}' is not valid. ` +
431 |             "A named slot should use a name ending with 'Template'.",
432 |         ]}
433 |       />
434 |     );
435 |   }
436 | 
437 |   let slotProps: any = null;
438 |   if (!isEmpty(node.props)) {
439 |     slotProps = {};
440 |     Object.keys(node.props).forEach((key) => {
441 |       if (key !== "name") {
442 |         let extractedValue = extractValue(node.props[key], true);
443 |         if (extractedValue?._ARROW_EXPR_) {
444 |           extractedValue = lookupAction(extractedValue);
445 |         }
446 |         slotProps[key] = extractedValue;
447 |       }
448 |     });
449 |   }
450 | 
451 |   if (parentRenderContext) {
452 |     // --- We may use a named slot to get the content from the parent
453 |     if (templateName === undefined) {
454 |       // --- The slot is not named
455 |       if (!slotProps) {
456 |         // --- simply render the children from the parent
457 |         // --- The parent does not provide a template for the slot.
458 |         if (parentRenderContext.children) {
459 |           return parentRenderContext.renderChild(parentRenderContext.children, layoutContext);
460 |         }
461 |       } else {
462 |         // --- The slot has properties; let's render the children with the slot properties
463 |         return (
464 |           <SlotItem
465 |             node={parentRenderContext.children}
466 |             renderChild={parentRenderContext.renderChild}
467 |             slotProps={slotProps}
468 |             layoutContext={layoutContext}
469 |           />
470 |         );
471 |       }
472 |     } else {
473 |       // --- We have a named slot with optional other properties; let's collect them
474 |       if (parentRenderContext.props[templateName]) {
475 |         // --- The parent provides a template to put into the slot. Let's use
476 |         // --- the parent's context to render the slot content.
477 |         return (
478 |           <SlotItem
479 |             node={parentRenderContext.props[templateName]}
480 |             renderChild={parentRenderContext.renderChild}
481 |             slotProps={slotProps}
482 |             layoutContext={layoutContext}
483 |           />
484 |         );
485 |       }
486 |     }
487 |   }
488 | 
489 |   // --- No parent context, render the default slot content
490 |   if (node.children && node.children.length > 0) {
491 |     // --- The parent does not provide a template for the slot. Let's render
492 |     // --- the slot's default children.
493 |     return (
494 |       <SlotItem
495 |         node={node.children}
496 |         renderChild={renderChild}
497 |         slotProps={slotProps ?? EMPTY_OBJECT}
498 |         layoutContext={layoutContext}
499 |       />
500 |     );
501 |   }
502 | 
503 |   // --- We do not render the named slots with names not ending with "Template"
504 |   return undefined;
505 | }
506 | 
507 | /**
508 |  * This function gets the API-bound component properties. A property is API-bound if its value is a
509 |  * component definition with one of the `type` values passed to this function.
510 |  * @param items Hash object of component properties
511 |  * @param type Types to consider as API-bound properties
512 |  * @returns List of API-bound property names
513 |  */
514 | function getApiBoundItems(items: Record<string, any> | undefined, ...type: string[]): string[] {
515 |   const ret: string[] = [];
516 |   if (!items) {
517 |     return ret;
518 |   }
519 |   const entries = Object.entries(items);
520 |   for (let i = 0; i < entries.length; i++) {
521 |     const [key, value] = entries[i];
522 |     if (isPlainObject(value) && type.includes(value.type)) {
523 |       ret.push(key);
524 |     }
525 |   }
526 |   return ret;
527 | }
528 | 
529 | export default ComponentAdapter;
530 | 
```

--------------------------------------------------------------------------------
/xmlui/tests/parsers/scripting/process-statement-destruct.test.ts:
--------------------------------------------------------------------------------

```typescript
  1 | import { describe, expect, it } from "vitest";
  2 | 
  3 | import { processStatementQueueAsync } from "../../../src/components-core/script-runner/process-statement-async";
  4 | import { createEvalContext, parseStatements } from "./test-helpers";
  5 | 
  6 | describe("Process statements - destructure", () => {
  7 |   it("let array destructure #1", async () => {
  8 |     // --- Arrange
  9 |     const source = "let [a, b] = [3, 6]; x = a; y = b;";
 10 |     const evalContext = createEvalContext({
 11 |       localContext: {
 12 |         x: 0,
 13 |         y: 0,
 14 |       },
 15 |     });
 16 |     const statements = parseStatements(source);
 17 | 
 18 |     // --- Act
 19 |     await processStatementQueueAsync(statements, evalContext);
 20 | 
 21 |     // --- Assert
 22 |     expect(evalContext.localContext.x).equal(3);
 23 |     expect(evalContext.localContext.y).equal(6);
 24 |   });
 25 | 
 26 |   it("let array destructure #2", async () => {
 27 |     // --- Arrange
 28 |     const source = "let [,a, b] = [3, 6, 8]; x = a; y = b;";
 29 |     const evalContext = createEvalContext({
 30 |       localContext: {
 31 |         x: 0,
 32 |         y: 0,
 33 |       },
 34 |     });
 35 |     const statements = parseStatements(source);
 36 | 
 37 |     // --- Act
 38 |     await processStatementQueueAsync(statements, evalContext);
 39 | 
 40 |     // --- Assert
 41 |     expect(evalContext.localContext.x).equal(6);
 42 |     expect(evalContext.localContext.y).equal(8);
 43 |   });
 44 | 
 45 |   it("let array destructure #3", async () => {
 46 |     // --- Arrange
 47 |     const source = "let [a, [b, c]] = [3, [6, 8]]; x = a; y = b; z = c;";
 48 |     const evalContext = createEvalContext({
 49 |       localContext: {
 50 |         x: 0,
 51 |         y: 0,
 52 |         z: 0,
 53 |       },
 54 |     });
 55 |     const statements = parseStatements(source);
 56 | 
 57 |     // --- Act
 58 |     await processStatementQueueAsync(statements, evalContext);
 59 | 
 60 |     // --- Assert
 61 |     expect(evalContext.localContext.x).equal(3);
 62 |     expect(evalContext.localContext.y).equal(6);
 63 |     expect(evalContext.localContext.z).equal(8);
 64 |   });
 65 | 
 66 |   it("let array destructure #4", async () => {
 67 |     // --- Arrange
 68 |     const source = "let [a, , [, b, c]] = [3, -11, [-1, 6, 8]]; x = a; y = b; z = c;";
 69 |     const evalContext = createEvalContext({
 70 |       localContext: {
 71 |         x: 0,
 72 |         y: 0,
 73 |         z: 0,
 74 |       },
 75 |     });
 76 |     const statements = parseStatements(source);
 77 | 
 78 |     // --- Act
 79 |     await processStatementQueueAsync(statements, evalContext);
 80 | 
 81 |     // --- Assert
 82 |     expect(evalContext.localContext.x).equal(3);
 83 |     expect(evalContext.localContext.y).equal(6);
 84 |     expect(evalContext.localContext.z).equal(8);
 85 |   });
 86 | 
 87 |   it("let object destructure #1", async () => {
 88 |     // --- Arrange
 89 |     const source = "let {a, b} = {a: 3, b: 6}; x = a; y = b;";
 90 |     const evalContext = createEvalContext({
 91 |       localContext: {
 92 |         x: 0,
 93 |         y: 0,
 94 |       },
 95 |     });
 96 |     const statements = parseStatements(source);
 97 | 
 98 |     // --- Act
 99 |     await processStatementQueueAsync(statements, evalContext);
100 | 
101 |     // --- Assert
102 |     expect(evalContext.localContext.x).equal(3);
103 |     expect(evalContext.localContext.y).equal(6);
104 |   });
105 | 
106 |   it("let object destructure #2", async () => {
107 |     // --- Arrange
108 |     const source = "let {a, qqq:b } = {a: 3, qqq: 6}; x = a; y = b;";
109 |     const evalContext = createEvalContext({
110 |       localContext: {
111 |         x: 0,
112 |         y: 0,
113 |       },
114 |     });
115 |     const statements = parseStatements(source);
116 | 
117 |     // --- Act
118 |     await processStatementQueueAsync(statements, evalContext);
119 | 
120 |     // --- Assert
121 |     expect(evalContext.localContext.x).equal(3);
122 |     expect(evalContext.localContext.y).equal(6);
123 |   });
124 | 
125 |   it("let object destructure #3", async () => {
126 |     // --- Arrange
127 |     const source = "let {a, qqq: {b, c}} = {a: 3, qqq: {b: 6, c: 8}}; x = a; y = b; z = c";
128 |     const evalContext = createEvalContext({
129 |       localContext: {
130 |         x: 0,
131 |         y: 0,
132 |         z: 0,
133 |       },
134 |     });
135 |     const statements = parseStatements(source);
136 | 
137 |     // --- Act
138 |     await processStatementQueueAsync(statements, evalContext);
139 | 
140 |     // --- Assert
141 |     expect(evalContext.localContext.x).equal(3);
142 |     expect(evalContext.localContext.y).equal(6);
143 |     expect(evalContext.localContext.z).equal(8);
144 |   });
145 | 
146 |   it("let object and array destructure #1", async () => {
147 |     // --- Arrange
148 |     const source = "let {a, qqq: [b, c]} = {a: 3, qqq: [6, 8] }; x = a; y = b; z = c";
149 |     const evalContext = createEvalContext({
150 |       localContext: {
151 |         x: 0,
152 |         y: 0,
153 |         z: 0,
154 |       },
155 |     });
156 |     const statements = parseStatements(source);
157 | 
158 |     // --- Act
159 |     await processStatementQueueAsync(statements, evalContext);
160 | 
161 |     // --- Assert
162 |     expect(evalContext.localContext.x).equal(3);
163 |     expect(evalContext.localContext.y).equal(6);
164 |     expect(evalContext.localContext.z).equal(8);
165 |   });
166 | 
167 |   it("let object and array destructure #2", async () => {
168 |     // --- Arrange
169 |     const source = "let {a, qqq: [b,,c]} = {a: 3, qqq: [6, -1, 8] }; x = a; y = b; z = c";
170 |     const evalContext = createEvalContext({
171 |       localContext: {
172 |         x: 0,
173 |         y: 0,
174 |         z: 0,
175 |       },
176 |     });
177 |     const statements = parseStatements(source);
178 | 
179 |     // --- Act
180 |     await processStatementQueueAsync(statements, evalContext);
181 | 
182 |     // --- Assert
183 |     expect(evalContext.localContext.x).equal(3);
184 |     expect(evalContext.localContext.y).equal(6);
185 |     expect(evalContext.localContext.z).equal(8);
186 |   });
187 | 
188 |   it("let object and array destructure #3", async () => {
189 |     // --- Arrange
190 |     const source = "let [a, {b, c}] = [3, {b: 6, c: 8}]; x = a; y = b; z = c";
191 |     const evalContext = createEvalContext({
192 |       localContext: {
193 |         x: 0,
194 |         y: 0,
195 |         z: 0,
196 |       },
197 |     });
198 |     const statements = parseStatements(source);
199 | 
200 |     // --- Act
201 |     await processStatementQueueAsync(statements, evalContext);
202 | 
203 |     // --- Assert
204 |     expect(evalContext.localContext.x).equal(3);
205 |     expect(evalContext.localContext.y).equal(6);
206 |     expect(evalContext.localContext.z).equal(8);
207 |   });
208 | 
209 |   it("let object and array destructure #3", async () => {
210 |     // --- Arrange
211 |     const source = "let [a, , {b, c}] = [3, -1, {b: 6, c: 8}]; x = a; y = b; z = c";
212 |     const evalContext = createEvalContext({
213 |       localContext: {
214 |         x: 0,
215 |         y: 0,
216 |         z: 0,
217 |       },
218 |     });
219 |     const statements = parseStatements(source);
220 | 
221 |     // --- Act
222 |     await processStatementQueueAsync(statements, evalContext);
223 | 
224 |     // --- Assert
225 |     expect(evalContext.localContext.x).equal(3);
226 |     expect(evalContext.localContext.y).equal(6);
227 |     expect(evalContext.localContext.z).equal(8);
228 |   });
229 | 
230 |   it("const array destructure #1", async () => {
231 |     // --- Arrange
232 |     const source = "const [a, b] = [3, 6]; x = a; y = b;";
233 |     const evalContext = createEvalContext({
234 |       localContext: {
235 |         x: 0,
236 |         y: 0,
237 |       },
238 |     });
239 |     const statements = parseStatements(source);
240 | 
241 |     // --- Act
242 |     await processStatementQueueAsync(statements, evalContext);
243 | 
244 |     // --- Assert
245 |     expect(evalContext.localContext.x).equal(3);
246 |     expect(evalContext.localContext.y).equal(6);
247 |   });
248 | 
249 |   it("const array destructure #2", async () => {
250 |     // --- Arrange
251 |     const source = "const [,a, b] = [3, 6, 8]; x = a; y = b;";
252 |     const evalContext = createEvalContext({
253 |       localContext: {
254 |         x: 0,
255 |         y: 0,
256 |       },
257 |     });
258 |     const statements = parseStatements(source);
259 | 
260 |     // --- Act
261 |     await processStatementQueueAsync(statements, evalContext);
262 | 
263 |     // --- Assert
264 |     expect(evalContext.localContext.x).equal(6);
265 |     expect(evalContext.localContext.y).equal(8);
266 |   });
267 | 
268 |   it("const array destructure #3", async () => {
269 |     // --- Arrange
270 |     const source = "const [a, [b, c]] = [3, [6, 8]]; x = a; y = b; z = c;";
271 |     const evalContext = createEvalContext({
272 |       localContext: {
273 |         x: 0,
274 |         y: 0,
275 |         z: 0,
276 |       },
277 |     });
278 |     const statements = parseStatements(source);
279 | 
280 |     // --- Act
281 |     await processStatementQueueAsync(statements, evalContext);
282 | 
283 |     // --- Assert
284 |     expect(evalContext.localContext.x).equal(3);
285 |     expect(evalContext.localContext.y).equal(6);
286 |     expect(evalContext.localContext.z).equal(8);
287 |   });
288 | 
289 |   it("const array destructure #4", async () => {
290 |     // --- Arrange
291 |     const source = "const [a, , [, b, c]] = [3, -11, [-1, 6, 8]]; x = a; y = b; z = c;";
292 |     const evalContext = createEvalContext({
293 |       localContext: {
294 |         x: 0,
295 |         y: 0,
296 |         z: 0,
297 |       },
298 |     });
299 |     const statements = parseStatements(source);
300 | 
301 |     // --- Act
302 |     await processStatementQueueAsync(statements, evalContext);
303 | 
304 |     // --- Assert
305 |     expect(evalContext.localContext.x).equal(3);
306 |     expect(evalContext.localContext.y).equal(6);
307 |     expect(evalContext.localContext.z).equal(8);
308 |   });
309 | 
310 |   it("const object destructure #1", async () => {
311 |     // --- Arrange
312 |     const source = "const {a, b} = {a: 3, b: 6}; x = a; y = b;";
313 |     const evalContext = createEvalContext({
314 |       localContext: {
315 |         x: 0,
316 |         y: 0,
317 |       },
318 |     });
319 |     const statements = parseStatements(source);
320 | 
321 |     // --- Act
322 |     await processStatementQueueAsync(statements, evalContext);
323 | 
324 |     // --- Assert
325 |     expect(evalContext.localContext.x).equal(3);
326 |     expect(evalContext.localContext.y).equal(6);
327 |   });
328 | 
329 |   it("const object destructure #2", async () => {
330 |     // --- Arrange
331 |     const source = "const {a, qqq:b } = {a: 3, qqq: 6}; x = a; y = b;";
332 |     const evalContext = createEvalContext({
333 |       localContext: {
334 |         x: 0,
335 |         y: 0,
336 |       },
337 |     });
338 |     const statements = parseStatements(source);
339 | 
340 |     // --- Act
341 |     await processStatementQueueAsync(statements, evalContext);
342 | 
343 |     // --- Assert
344 |     expect(evalContext.localContext.x).equal(3);
345 |     expect(evalContext.localContext.y).equal(6);
346 |   });
347 | 
348 |   it("const object destructure #3", async () => {
349 |     // --- Arrange
350 |     const source = "const {a, qqq: {b, c}} = {a: 3, qqq: {b: 6, c: 8}}; x = a; y = b; z = c";
351 |     const evalContext = createEvalContext({
352 |       localContext: {
353 |         x: 0,
354 |         y: 0,
355 |         z: 0,
356 |       },
357 |     });
358 |     const statements = parseStatements(source);
359 | 
360 |     // --- Act
361 |     await processStatementQueueAsync(statements, evalContext);
362 | 
363 |     // --- Assert
364 |     expect(evalContext.localContext.x).equal(3);
365 |     expect(evalContext.localContext.y).equal(6);
366 |     expect(evalContext.localContext.z).equal(8);
367 |   });
368 | 
369 |   it("const object and array destructure #1", async () => {
370 |     // --- Arrange
371 |     const source = "const {a, qqq: [b, c]} = {a: 3, qqq: [6, 8] }; x = a; y = b; z = c";
372 |     const evalContext = createEvalContext({
373 |       localContext: {
374 |         x: 0,
375 |         y: 0,
376 |         z: 0,
377 |       },
378 |     });
379 |     const statements = parseStatements(source);
380 | 
381 |     // --- Act
382 |     await processStatementQueueAsync(statements, evalContext);
383 | 
384 |     // --- Assert
385 |     expect(evalContext.localContext.x).equal(3);
386 |     expect(evalContext.localContext.y).equal(6);
387 |     expect(evalContext.localContext.z).equal(8);
388 |   });
389 | 
390 |   it("const object and array destructure #2", async () => {
391 |     // --- Arrange
392 |     const source = "const {a, qqq: [b,,c]} = {a: 3, qqq: [6, -1, 8] }; x = a; y = b; z = c";
393 |     const evalContext = createEvalContext({
394 |       localContext: {
395 |         x: 0,
396 |         y: 0,
397 |         z: 0,
398 |       },
399 |     });
400 |     const statements = parseStatements(source);
401 | 
402 |     // --- Act
403 |     await processStatementQueueAsync(statements, evalContext);
404 | 
405 |     // --- Assert
406 |     expect(evalContext.localContext.x).equal(3);
407 |     expect(evalContext.localContext.y).equal(6);
408 |     expect(evalContext.localContext.z).equal(8);
409 |   });
410 | 
411 |   it("const object and array destructure #3", async () => {
412 |     // --- Arrange
413 |     const source = "const [a, {b, c}] = [3, {b: 6, c: 8}]; x = a; y = b; z = c";
414 |     const evalContext = createEvalContext({
415 |       localContext: {
416 |         x: 0,
417 |         y: 0,
418 |         z: 0,
419 |       },
420 |     });
421 |     const statements = parseStatements(source);
422 | 
423 |     // --- Act
424 |     await processStatementQueueAsync(statements, evalContext);
425 | 
426 |     // --- Assert
427 |     expect(evalContext.localContext.x).equal(3);
428 |     expect(evalContext.localContext.y).equal(6);
429 |     expect(evalContext.localContext.z).equal(8);
430 |   });
431 | 
432 |   it("const object and array destructure #3", async () => {
433 |     // --- Arrange
434 |     const source = "const [a, , {b, c}] = [3, -1, {b: 6, c: 8}]; x = a; y = b; z = c";
435 |     const evalContext = createEvalContext({
436 |       localContext: {
437 |         x: 0,
438 |         y: 0,
439 |         z: 0,
440 |       },
441 |     });
442 |     const statements = parseStatements(source);
443 | 
444 |     // --- Act
445 |     await processStatementQueueAsync(statements, evalContext);
446 | 
447 |     // --- Assert
448 |     expect(evalContext.localContext.x).equal(3);
449 |     expect(evalContext.localContext.y).equal(6);
450 |     expect(evalContext.localContext.z).equal(8);
451 |   });
452 | 
453 |   it("arrow destructure #1", async () => {
454 |     // --- Arrange
455 |     const source = "const fn = ([a, b]) => { x = a; y = b}; fn([3, 6, 8])";
456 |     const evalContext = createEvalContext({
457 |       localContext: {
458 |         x: 0,
459 |         y: 0,
460 |       },
461 |     });
462 |     const statements = parseStatements(source);
463 | 
464 |     // --- Act
465 |     await processStatementQueueAsync(statements, evalContext);
466 | 
467 |     // --- Assert
468 |     expect(evalContext.localContext.x).equal(3);
469 |     expect(evalContext.localContext.y).equal(6);
470 |   });
471 | 
472 |   it("arrow destructure #2", async () => {
473 |     // --- Arrange
474 |     const source = "const fn = ([a, , b]) => { x = a; y = b}; fn([3, 6, 8])";
475 |     const evalContext = createEvalContext({
476 |       localContext: {
477 |         x: 0,
478 |         y: 0,
479 |       },
480 |     });
481 |     const statements = parseStatements(source);
482 | 
483 |     // --- Act
484 |     await processStatementQueueAsync(statements, evalContext);
485 | 
486 |     // --- Assert
487 |     expect(evalContext.localContext.x).equal(3);
488 |     expect(evalContext.localContext.y).equal(8);
489 |   });
490 | 
491 |   it("arrow destructure #3", async () => {
492 |     // --- Arrange
493 |     const source = "const fn = ([a, b]) => { x = a; y = b}; fn([3])";
494 |     const evalContext = createEvalContext({
495 |       localContext: {
496 |         x: 0,
497 |         y: 0,
498 |       },
499 |     });
500 |     const statements = parseStatements(source);
501 | 
502 |     // --- Act
503 |     await processStatementQueueAsync(statements, evalContext);
504 | 
505 |     // --- Assert
506 |     expect(evalContext.localContext.x).equal(3);
507 |     expect(evalContext.localContext.y).equal(undefined);
508 |   });
509 | 
510 |   it("arrow destructure #4", async () => {
511 |     // --- Arrange
512 |     const source = "const fn = ([a, , b]) => { x = a; y = b}; fn([3, 6])";
513 |     const evalContext = createEvalContext({
514 |       localContext: {
515 |         x: 0,
516 |         y: 0,
517 |       },
518 |     });
519 |     const statements = parseStatements(source);
520 | 
521 |     // --- Act
522 |     await processStatementQueueAsync(statements, evalContext);
523 | 
524 |     // --- Assert
525 |     expect(evalContext.localContext.x).equal(3);
526 |     expect(evalContext.localContext.y).equal(undefined);
527 |   });
528 | 
529 |   it("arrow destructure #5", async () => {
530 |     // --- Arrange
531 |     const source = "const fn = ([a, [b, c]]) => { x = a; y = b; z = c }; fn([3, [6, 8]])";
532 |     const evalContext = createEvalContext({
533 |       localContext: {
534 |         x: 0,
535 |         y: 0,
536 |         z: 0,
537 |       },
538 |     });
539 |     const statements = parseStatements(source);
540 | 
541 |     // --- Act
542 |     await processStatementQueueAsync(statements, evalContext);
543 | 
544 |     // --- Assert
545 |     expect(evalContext.localContext.x).equal(3);
546 |     expect(evalContext.localContext.y).equal(6);
547 |     expect(evalContext.localContext.z).equal(8);
548 |   });
549 | 
550 |   it("arrow destructure #6", async () => {
551 |     // --- Arrange
552 |     const source = "const fn = ({a, b}) => { x = a; y = b}; fn({a: 3, b: 6, v: 8})";
553 |     const evalContext = createEvalContext({
554 |       localContext: {
555 |         x: 0,
556 |         y: 0,
557 |       },
558 |     });
559 |     const statements = parseStatements(source);
560 | 
561 |     // --- Act
562 |     await processStatementQueueAsync(statements, evalContext);
563 | 
564 |     // --- Assert
565 |     expect(evalContext.localContext.x).equal(3);
566 |     expect(evalContext.localContext.y).equal(6);
567 |   });
568 | 
569 |   it("arrow destructure #7", async () => {
570 |     // --- Arrange
571 |     const source = "const fn = ({a, b}) => { x = a; y = b}; fn({a: 3, v: 8})";
572 |     const evalContext = createEvalContext({
573 |       localContext: {
574 |         x: 0,
575 |         y: 0,
576 |       },
577 |     });
578 |     const statements = parseStatements(source);
579 | 
580 |     // --- Act
581 |     await processStatementQueueAsync(statements, evalContext);
582 | 
583 |     // --- Assert
584 |     expect(evalContext.localContext.x).equal(3);
585 |     expect(evalContext.localContext.y).equal(undefined);
586 |   });
587 | 
588 |   it("arrow destructure #8", async () => {
589 |     // --- Arrange
590 |     const source = "const fn = ({a, q:b}) => { x = a; y = b}; fn({a: 3, q: 6, v: 8})";
591 |     const evalContext = createEvalContext({
592 |       localContext: {
593 |         x: 0,
594 |         y: 0,
595 |       },
596 |     });
597 |     const statements = parseStatements(source);
598 | 
599 |     // --- Act
600 |     await processStatementQueueAsync(statements, evalContext);
601 | 
602 |     // --- Assert
603 |     expect(evalContext.localContext.x).equal(3);
604 |     expect(evalContext.localContext.y).equal(6);
605 |   });
606 | 
607 |   it("arrow destructure #9", async () => {
608 |     // --- Arrange
609 |     const source =
610 |       "const fn = ({a, q: {b, c}}) => { x = a; y = b; z = c}; fn({a: 3, q: {b: 6, c: 8}})";
611 |     const evalContext = createEvalContext({
612 |       localContext: {
613 |         x: 0,
614 |         y: 0,
615 |         z: 0,
616 |       },
617 |     });
618 |     const statements = parseStatements(source);
619 | 
620 |     // --- Act
621 |     await processStatementQueueAsync(statements, evalContext);
622 | 
623 |     // --- Assert
624 |     expect(evalContext.localContext.x).equal(3);
625 |     expect(evalContext.localContext.y).equal(6);
626 |     expect(evalContext.localContext.z).equal(8);
627 |   });
628 | 
629 |   it("arrow destructure #10", async () => {
630 |     // --- Arrange
631 |     const source = "const fn = ({a, q:[b, c]}) => { x = a; y = b; z = c}; fn({a: 3, q: [6, 8]})";
632 |     const evalContext = createEvalContext({
633 |       localContext: {
634 |         x: 0,
635 |         y: 0,
636 |         z: 0,
637 |       },
638 |     });
639 |     const statements = parseStatements(source);
640 | 
641 |     // --- Act
642 |     await processStatementQueueAsync(statements, evalContext);
643 | 
644 |     // --- Assert
645 |     expect(evalContext.localContext.x).equal(3);
646 |     expect(evalContext.localContext.y).equal(6);
647 |     expect(evalContext.localContext.z).equal(8);
648 |   });
649 | 
650 |   it("arrow destructure #11", async () => {
651 |     // --- Arrange
652 |     const source =
653 |       "const fn = ({a, q:[b, , c]}) => { x = a; y = b; z = c}; fn({a: 3, q: [6, -1, 8]})";
654 |     const evalContext = createEvalContext({
655 |       localContext: {
656 |         x: 0,
657 |         y: 0,
658 |         z: 0,
659 |       },
660 |     });
661 |     const statements = parseStatements(source);
662 | 
663 |     // --- Act
664 |     await processStatementQueueAsync(statements, evalContext);
665 | 
666 |     // --- Assert
667 |     expect(evalContext.localContext.x).equal(3);
668 |     expect(evalContext.localContext.y).equal(6);
669 |     expect(evalContext.localContext.z).equal(8);
670 |   });
671 | 
672 |   it("arrow destructure #12", async () => {
673 |     // --- Arrange
674 |     const source = "const fn = ([a, {b, c}]) => { x = a; y = b; z = c}; fn([3, {b: 6, c: 8}])";
675 |     const evalContext = createEvalContext({
676 |       localContext: {
677 |         x: 0,
678 |         y: 0,
679 |         z: 0,
680 |       },
681 |     });
682 |     const statements = parseStatements(source);
683 | 
684 |     // --- Act
685 |     await processStatementQueueAsync(statements, evalContext);
686 | 
687 |     // --- Assert
688 |     expect(evalContext.localContext.x).equal(3);
689 |     expect(evalContext.localContext.y).equal(6);
690 |     expect(evalContext.localContext.z).equal(8);
691 |   });
692 | });
693 | 
```

--------------------------------------------------------------------------------
/xmlui/tests/components-core/scripts-runner/process-switch-sync.test.ts:
--------------------------------------------------------------------------------

```typescript
  1 | import { describe, expect, it, assert } from "vitest";
  2 | import {createEvalContext, parseStatements} from "./test-helpers";
  3 | import {processStatementQueue} from "../../../src/components-core/script-runner/process-statement-sync";
  4 | 
  5 | describe("Process switch statements (sync) (exp)", () => {
  6 |     it("no case", () => {
  7 |         // --- Arrange
  8 |         const source = `
  9 |             let x = 0;
 10 |             switch (x) {
 11 |             }
 12 |         `;
 13 |         const evalContext = createEvalContext({
 14 |         });
 15 |         const statements = parseStatements(source);
 16 | 
 17 |         // --- Act
 18 |         processStatementQueue(statements, evalContext);
 19 | 
 20 |         // --- Assert
 21 |         const thread = evalContext.mainThread!;
 22 |         expect(thread.blocks!.length).equal(1);
 23 |         expect(thread.blocks![0].vars.x).equal(0);
 24 |     });
 25 | 
 26 |     it("no matching case #1", () => {
 27 |         // --- Arrange
 28 |         const source = `
 29 |             let x = 0;
 30 |             let y = 0;
 31 |             switch (x) {
 32 |               case 3:
 33 |                 y++;
 34 |             }
 35 |         `;
 36 |         const evalContext = createEvalContext({
 37 |         });
 38 |         const statements = parseStatements(source);
 39 | 
 40 |         // --- Act
 41 |         processStatementQueue(statements, evalContext);
 42 | 
 43 |         // --- Assert
 44 |         const thread = evalContext.mainThread!;
 45 |         expect(thread.blocks!.length).equal(1);
 46 |         expect(thread.blocks![0].vars.y).equal(0);
 47 |     });
 48 | 
 49 |     it("no matching case #2", () => {
 50 |         // --- Arrange
 51 |         const source = `
 52 |             let x = 0;
 53 |             let y = 0;
 54 |             switch (x) {
 55 |               case 2:
 56 |                 y++;
 57 |                 break;
 58 |               case 3:
 59 |                 y++;
 60 |                 break;
 61 |             }
 62 |         `;
 63 |         const evalContext = createEvalContext({
 64 |         });
 65 |         const statements = parseStatements(source);
 66 | 
 67 |         // --- Act
 68 |         processStatementQueue(statements, evalContext);
 69 | 
 70 |         // --- Assert
 71 |         const thread = evalContext.mainThread!;
 72 |         expect(thread.blocks!.length).equal(1);
 73 |         expect(thread.blocks![0].vars.y).equal(0);
 74 |     });
 75 | 
 76 |     it("no matching case #3", () => {
 77 |         // --- Arrange
 78 |         const source = `
 79 |             let x = 0;
 80 |             let y = 0;
 81 |             switch (x) {
 82 |               case 1:
 83 |                 y++;
 84 |               case 2:
 85 |                 y++;
 86 |                 break;
 87 |               case 3:
 88 |                 y++;
 89 |                 break;
 90 |             }
 91 |         `;
 92 |         const evalContext = createEvalContext({
 93 |         });
 94 |         const statements = parseStatements(source);
 95 | 
 96 |         // --- Act
 97 |         processStatementQueue(statements, evalContext);
 98 | 
 99 |         // --- Assert
100 |         const thread = evalContext.mainThread!;
101 |         expect(thread.blocks!.length).equal(1);
102 |         expect(thread.blocks![0].vars.y).equal(0);
103 |     });
104 | 
105 |     it("matching case #1", () => {
106 |         // --- Arrange
107 |         const source = `
108 |             let x = 0;
109 |             let y = 0;
110 |             switch (x) {
111 |               case 0:
112 |                 y++;
113 |                 break;
114 |               case 1:
115 |                 y++;
116 |                 break;
117 |               case 2:
118 |                 y++;
119 |                 break;
120 |               case 3:
121 |                 y++;
122 |                 break;
123 |             }
124 |         `;
125 |         const evalContext = createEvalContext({
126 |         });
127 |         const statements = parseStatements(source);
128 | 
129 |         // --- Act
130 |         processStatementQueue(statements, evalContext);
131 | 
132 |         // --- Assert
133 |         const thread = evalContext.mainThread!;
134 |         expect(thread.blocks!.length).equal(1);
135 |         expect(thread.blocks![0].vars.y).equal(1);
136 |     });
137 | 
138 |     it("matching case #2", () => {
139 |         // --- Arrange
140 |         const source = `
141 |             let x = 0;
142 |             let y = 0;
143 |             switch (x) {
144 |               default:
145 |                 y++;
146 |                 break;  
147 |               case 1:
148 |                 y++;
149 |                 break;
150 |               case 2:
151 |                 y++;
152 |                 break;
153 |               case 3:
154 |                 y++;
155 |                 break;
156 |             }
157 |         `;
158 |         const evalContext = createEvalContext({
159 |         });
160 |         const statements = parseStatements(source);
161 | 
162 |         // --- Act
163 |         processStatementQueue(statements, evalContext);
164 | 
165 |         // --- Assert
166 |         const thread = evalContext.mainThread!;
167 |         expect(thread.blocks!.length).equal(1);
168 |         expect(thread.blocks![0].vars.y).equal(1);
169 |     });
170 | 
171 |     it("matching case #3", () => {
172 |         // --- Arrange
173 |         const source = `
174 |             let x = 0;
175 |             let y = 0;
176 |             switch (x) {
177 |               case 1:
178 |                 y++;
179 |                 break;
180 |               default:
181 |                 y++;
182 |                 break;  
183 |               case 2:
184 |                 y++;
185 |                 break;
186 |               case 3:
187 |                 y++;
188 |                 break;
189 |             }
190 |         `;
191 |         const evalContext = createEvalContext({
192 |         });
193 |         const statements = parseStatements(source);
194 | 
195 |         // --- Act
196 |         processStatementQueue(statements, evalContext);
197 | 
198 |         // --- Assert
199 |         const thread = evalContext.mainThread!;
200 |         expect(thread.blocks!.length).equal(1);
201 |         expect(thread.blocks![0].vars.y).equal(1);
202 |     });
203 | 
204 |     it("matching case #4", () => {
205 |         // --- Arrange
206 |         const source = `
207 |             let x = 0;
208 |             let y = 0;
209 |             switch (x) {
210 |               case 1:
211 |                 y++;
212 |                 break;
213 |               case 2:
214 |                 y++;
215 |                 break;
216 |               default:
217 |                 y++;
218 |                 break;  
219 |               case 3:
220 |                 y++;
221 |                 break;
222 |             }
223 |         `;
224 |         const evalContext = createEvalContext({
225 |         });
226 |         const statements = parseStatements(source);
227 | 
228 |         // --- Act
229 |         processStatementQueue(statements, evalContext);
230 | 
231 |         // --- Assert
232 |         const thread = evalContext.mainThread!;
233 |         expect(thread.blocks!.length).equal(1);
234 |         expect(thread.blocks![0].vars.y).equal(1);
235 |     });
236 | 
237 |     it("matching case #5", () => {
238 |         // --- Arrange
239 |         const source = `
240 |             let x = 0;
241 |             let y = 0;
242 |             switch (x) {
243 |               case 1:
244 |                 y++;
245 |                 break;
246 |               case 2:
247 |                 y++;
248 |                 break;
249 |               case 3:
250 |                 y++;
251 |                 break;
252 |               default:
253 |                 y++;
254 |                 break;  
255 |             }
256 |         `;
257 |         const evalContext = createEvalContext({
258 |         });
259 |         const statements = parseStatements(source);
260 | 
261 |         // --- Act
262 |         processStatementQueue(statements, evalContext);
263 | 
264 |         // --- Assert
265 |         const thread = evalContext.mainThread!;
266 |         expect(thread.blocks!.length).equal(1);
267 |         expect(thread.blocks![0].vars.y).equal(1);
268 |     });
269 | 
270 |     it("matching case, fall-through #1", () => {
271 |         // --- Arrange
272 |         const source = `
273 |             let x = 0;
274 |             let y = 0;
275 |             switch (x) {
276 |               case 0:
277 |                 y++;
278 |               case 1:
279 |                 y++;
280 |                 break;
281 |               case 2:
282 |                 y++;
283 |                 break;
284 |               case 3:
285 |                 y++;
286 |                 break;
287 |             }
288 |         `;
289 |         const evalContext = createEvalContext({
290 |         });
291 |         const statements = parseStatements(source);
292 | 
293 |         // --- Act
294 |         processStatementQueue(statements, evalContext);
295 | 
296 |         // --- Assert
297 |         const thread = evalContext.mainThread!;
298 |         expect(thread.blocks!.length).equal(1);
299 |         expect(thread.blocks![0].vars.y).equal(2);
300 |     });
301 | 
302 |     it("matching case, fall-through #2", () => {
303 |         // --- Arrange
304 |         const source = `
305 |             let x = 0;
306 |             let y = 0;
307 |             switch (x) {
308 |               case 0:
309 |                 y++;
310 |               case 1:
311 |                 y++;
312 |               case 2:
313 |                 y++;
314 |                 break;
315 |               case 3:
316 |                 y++;
317 |                 break;
318 |             }
319 |         `;
320 |         const evalContext = createEvalContext({
321 |         });
322 |         const statements = parseStatements(source);
323 | 
324 |         // --- Act
325 |         processStatementQueue(statements, evalContext);
326 | 
327 |         // --- Assert
328 |         const thread = evalContext.mainThread!;
329 |         expect(thread.blocks!.length).equal(1);
330 |         expect(thread.blocks![0].vars.y).equal(3);
331 |     });
332 | 
333 |     it("matching case, fall-through #3", () => {
334 |         // --- Arrange
335 |         const source = `
336 |             let x = 0;
337 |             let y = 0;
338 |             switch (x) {
339 |               case 0:
340 |                 y++;
341 |               case 1:
342 |                 y++;
343 |               case 2:
344 |                 y++;
345 |               case 3:
346 |                 y++;
347 |                 break;
348 |             }
349 |         `;
350 |         const evalContext = createEvalContext({
351 |         });
352 |         const statements = parseStatements(source);
353 | 
354 |         // --- Act
355 |         processStatementQueue(statements, evalContext);
356 | 
357 |         // --- Assert
358 |         const thread = evalContext.mainThread!;
359 |         expect(thread.blocks!.length).equal(1);
360 |         expect(thread.blocks![0].vars.y).equal(4);
361 |     });
362 | 
363 |     it("matching case, fall-through #4", () => {
364 |         // --- Arrange
365 |         const source = `
366 |             let x = 0;
367 |             let y = 0;
368 |             switch (x) {
369 |               case 0:
370 |                 y++;
371 |               case 1:
372 |                 y++;
373 |               case 2:
374 |                 y++;
375 |               case 3:
376 |                 y++;
377 |             }
378 |         `;
379 |         const evalContext = createEvalContext({
380 |         });
381 |         const statements = parseStatements(source);
382 | 
383 |         // --- Act
384 |         processStatementQueue(statements, evalContext);
385 | 
386 |         // --- Assert
387 |         const thread = evalContext.mainThread!;
388 |         expect(thread.blocks!.length).equal(1);
389 |         expect(thread.blocks![0].vars.y).equal(4);
390 |     });
391 | 
392 |     it("switch in loop #1", () => {
393 |         // --- Arrange
394 |         const source = `
395 |             let x = 0;
396 |             let y = 0;
397 |             while (x < 4) {
398 |               switch (x) {
399 |                 case 0:
400 |                   y++;
401 |                 case 1:
402 |                   y++;
403 |                 case 2:
404 |                   y++;
405 |                 case 3:
406 |                   y++;
407 |               }
408 |               x++;
409 |             }  
410 |         `;
411 |         const evalContext = createEvalContext({
412 |         });
413 |         const statements = parseStatements(source);
414 | 
415 |         // --- Act
416 |         processStatementQueue(statements, evalContext);
417 | 
418 |         // --- Assert
419 |         const thread = evalContext.mainThread!;
420 |         expect(thread.blocks!.length).equal(1);
421 |         expect(thread.blocks![0].vars.y).equal(10);
422 |     });
423 | 
424 |     it("switch in loop #2", () => {
425 |         // --- Arrange
426 |         const source = `
427 |             let x = 0;
428 |             let y = 0;
429 |             while (x < 4) {
430 |               switch (x) {
431 |                 case 0:
432 |                   y++;
433 |                 case 1:
434 |                   y++;
435 |                 case 2:
436 |                   y++;
437 |                 case 3:
438 |                   y++;
439 |               }
440 |               x++;
441 |               break;
442 |             }  
443 |         `;
444 |         const evalContext = createEvalContext({
445 |         });
446 |         const statements = parseStatements(source);
447 | 
448 |         // --- Act
449 |         processStatementQueue(statements, evalContext);
450 | 
451 |         // --- Assert
452 |         const thread = evalContext.mainThread!;
453 |         expect(thread.blocks!.length).equal(1);
454 |         expect(thread.blocks![0].vars.y).equal(4);
455 |     });
456 | 
457 |     it("switch in loop #3", () => {
458 |         // --- Arrange
459 |         const source = `
460 |             let x = 0;
461 |             let y = 0;
462 |             while (x < 4) {
463 |               switch (x) {
464 |                 case 0:
465 |                   y++;
466 |                   break;
467 |                 case 1:
468 |                   y++;
469 |                   break;
470 |                 case 2:
471 |                   y++;
472 |                   break;
473 |                 case 3:
474 |                   y++;
475 |                   break;
476 |               }
477 |               x++;
478 |             }  
479 |         `;
480 |         const evalContext = createEvalContext({
481 |         });
482 |         const statements = parseStatements(source);
483 | 
484 |         // --- Act
485 |         processStatementQueue(statements, evalContext);
486 | 
487 |         // --- Assert
488 |         const thread = evalContext.mainThread!;
489 |         expect(thread.blocks!.length).equal(1);
490 |         expect(thread.blocks![0].vars.y).equal(4);
491 |     });
492 | 
493 |     it("switch in loop #4", () => {
494 |         // --- Arrange
495 |         const source = `
496 |             let x = 0;
497 |             let y = 0;
498 |             while (x < 4) {
499 |               switch (x) {
500 |                 case 0:
501 |                   y++;
502 |                   break;
503 |                 case 1:
504 |                   y++;
505 |                   break;
506 |                 case 2:
507 |                   y++;
508 |                 case 3:
509 |                   y++;
510 |               }
511 |               x++;
512 |             }  
513 |         `;
514 |         const evalContext = createEvalContext({
515 |         });
516 |         const statements = parseStatements(source);
517 | 
518 |         // --- Act
519 |         processStatementQueue(statements, evalContext);
520 | 
521 |         // --- Assert
522 |         const thread = evalContext.mainThread!;
523 |         expect(thread.blocks!.length).equal(1);
524 |         expect(thread.blocks![0].vars.y).equal(5);
525 |     });
526 | 
527 |     it("switch in loop #5 (continue)", () => {
528 |         // --- Arrange
529 |         const source = `
530 |             let x = 0;
531 |             let y = 0;
532 |             while (x < 4) {
533 |               switch (x) {
534 |                 case 0:
535 |                   y++;
536 |                   break;
537 |                 case 1:
538 |                   y++;
539 |                   break;
540 |                 case 2:
541 |                   y++;
542 |                   x += 3;
543 |                   continue;
544 |                 case 3:
545 |                   y++;
546 |               }
547 |               x++;
548 |             }
549 |         `;
550 |         const evalContext = createEvalContext({
551 |         });
552 |         const statements = parseStatements(source);
553 | 
554 |         // --- Act
555 |         processStatementQueue(statements, evalContext);
556 | 
557 |         // --- Assert
558 |         const thread = evalContext.mainThread!;
559 |         expect(thread.blocks!.length).equal(1);
560 |         expect(thread.blocks![0].vars.y).equal(3);
561 |     });
562 | 
563 |     it("switch in loop #6 (return)", () => {
564 |         // --- Arrange
565 |         const source = `
566 |             let x = 0;
567 |             let y = 0;
568 |             while (x < 4) {
569 |               switch (x) {
570 |                 case 0:
571 |                   y++;
572 |                   break;
573 |                 case 1:
574 |                   y++;
575 |                   break;
576 |                 case 2:
577 |                   y++;
578 |                   x += 3;
579 |                   return;
580 |                 case 3:
581 |                   y++;
582 |               }
583 |               x++;
584 |             }
585 |         `;
586 |         const evalContext = createEvalContext({
587 |         });
588 |         const statements = parseStatements(source);
589 | 
590 |         // --- Act
591 |         processStatementQueue(statements, evalContext);
592 | 
593 |         // --- Assert
594 |         const thread = evalContext.mainThread!;
595 |         expect(thread.blocks![0].vars.y).equal(3);
596 |     });
597 | 
598 |     it("switch in loop #6 (return)", () => {
599 |         // --- Arrange
600 |         const source = `
601 |             let x = 0;
602 |             let y = 0;
603 |             while (x < 4) {
604 |               switch (x) {
605 |                 case 0:
606 |                   y++;
607 |                   break;
608 |                 case 1:
609 |                   y++;
610 |                   break;
611 |                 case 2:
612 |                   y++;
613 |                   x += 3;
614 |                   return;
615 |                 case 3:
616 |                   y++;
617 |               }
618 |               x++;
619 |             }
620 |         `;
621 |         const evalContext = createEvalContext({
622 |         });
623 |         const statements = parseStatements(source);
624 | 
625 |         // --- Act
626 |         processStatementQueue(statements, evalContext);
627 | 
628 |         // --- Assert
629 |         const thread = evalContext.mainThread!;
630 |         expect(thread.blocks![0].vars.y).equal(3);
631 |     });
632 | 
633 |     it("switch has its own scope", () => {
634 |         // --- Arrange
635 |         const source = `
636 |             let x = 0;
637 |             let y = 0;
638 |             let z = 0;
639 |             switch (x) {
640 |               case 0:
641 |                 let y = 3;
642 |                 z = y + 1;
643 |                 break;
644 |               case 1:
645 |                 y++;
646 |                 break;
647 |             }
648 |         `;
649 |         const evalContext = createEvalContext({
650 |         });
651 |         const statements = parseStatements(source);
652 | 
653 |         // --- Act
654 |         processStatementQueue(statements, evalContext);
655 |         
656 |         // --- Assert
657 |         const thread = evalContext.mainThread!;
658 |         expect(thread.blocks![0].vars.y).equal(0);
659 |         expect(thread.blocks![0].vars.z).equal(4);
660 |     });
661 | 
662 |     it("switch fails with multiple let", () => {
663 |         // --- Arrange
664 |         const source = `
665 |             let x = 0;
666 |             let y = 0;
667 |             switch (x) {
668 |               case 0:
669 |                 let z = 3;
670 |               case 1:
671 |                 let z = 4;
672 |                 y++;
673 |                 break;
674 |             }
675 |         `;
676 |         const evalContext = createEvalContext({
677 |         });
678 |         const statements = parseStatements(source);
679 | 
680 |         // --- Act/Assert
681 |         try {
682 |             processStatementQueue(statements, evalContext);
683 |         } catch (err: any) {
684 |             expect(err.toString().includes("already declared")).equal(true);
685 |             return;
686 |         }
687 |         assert.fail("Exception expected")
688 |     });
689 | 
690 |     it("switch fails with multiple const/let", () => {
691 |         // --- Arrange
692 |         const source = `
693 |             let x = 0;
694 |             let y = 0;
695 |             switch (x) {
696 |               case 0:
697 |                 let z = 3;
698 |               case 1:
699 |                 const z = 4;
700 |                 y++;
701 |                 break;
702 |             }
703 |         `;
704 |         const evalContext = createEvalContext({
705 |         });
706 |         const statements = parseStatements(source);
707 | 
708 |         // --- Act/Assert
709 |         try {
710 |             processStatementQueue(statements, evalContext);
711 |         } catch (err: any) {
712 |             expect(err.toString().includes("already declared")).equal(true);
713 |             return;
714 |         }
715 |         assert.fail("Exception expected")
716 |     });
717 | 
718 |     it("switch fails with multiple const", () => {
719 |         // --- Arrange
720 |         const source = `
721 |             let x = 0;
722 |             let y = 0;
723 |             switch (x) {
724 |               case 0:
725 |                 const z = 3;
726 |               case 1:
727 |                 const z = 4;
728 |                 y++;
729 |                 break;
730 |             }
731 |         `;
732 |         const evalContext = createEvalContext({
733 |         });
734 |         const statements = parseStatements(source);
735 | 
736 |         // --- Act/Assert
737 |         try {
738 |             processStatementQueue(statements, evalContext);
739 |         } catch (err: any) {
740 |             expect(err.toString().includes("already declared")).equal(true);
741 |             return;
742 |         }
743 |         assert.fail("Exception expected")
744 |     });
745 | });
```

--------------------------------------------------------------------------------
/xmlui/src/components-core/RestApiProxy.ts:
--------------------------------------------------------------------------------

```typescript
  1 | import type { AxiosResponse } from "axios";
  2 | import { isPlainObject, isUndefined, omitBy } from "lodash-es";
  3 | 
  4 | import type { AppContextObject } from "../abstractions/AppContextDefs";
  5 | import type { BindingTreeEvaluationContext } from "./script-runner/BindingTreeEvaluationContext";
  6 | import {
  7 |   T_ARROW_EXPRESSION_STATEMENT,
  8 |   type ArrowExpressionStatement,
  9 | } from "./script-runner/ScriptingSourceTree";
 10 | 
 11 | import { extractParam } from "./utils/extractParam";
 12 | import { randomUUID, readCookie } from "./utils/misc";
 13 | import { GenericBackendError } from "./EngineError";
 14 | import { processStatementQueue } from "./script-runner/process-statement-sync";
 15 | import type { ApiInterceptor } from "./interception/ApiInterceptor";
 16 | 
 17 | type OnProgressFn = (progressEvent: { loaded: number; total?: number; progress?: number }) => void;
 18 | 
 19 | interface FileChunk {
 20 |   blob: Blob;
 21 |   chunkStart: number;
 22 |   chunkEnd: number;
 23 | }
 24 | 
 25 | export type ApiOperationDef = {
 26 |   method: "get" | "post" | "put" | "delete" | "patch" | "head" | "options" | "trace" | "connect";
 27 |   url: string;
 28 |   rawBody?: any;
 29 |   body?: any;
 30 |   queryParams?: Record<string, any>;
 31 |   headers?: Record<string, any>;
 32 |   payloadType?: string;
 33 | };
 34 | 
 35 | export type UploadOperationDef = ApiOperationDef & {
 36 |   file: File;
 37 |   formParams?: Record<string, any>;
 38 |   asForm?: boolean;
 39 | };
 40 | 
 41 | export type DownloadOperationDef = ApiOperationDef & {
 42 |   fileName: string;
 43 | };
 44 | 
 45 | export type ApiActionOptions = {
 46 |   resolveBindingExpressions?: boolean;
 47 | };
 48 | 
 49 | interface RestAPIAdapterPropsV2 {
 50 |   apiUrl: string;
 51 |   headers?: Record<string, string>;
 52 |   errorResponseTransform?: string;
 53 | }
 54 | 
 55 | function isAxiosResponse(response: AxiosResponse | Response): response is AxiosResponse {
 56 |   return "data" in response;
 57 | }
 58 | 
 59 | function getContentType(response: AxiosResponse | Response): string {
 60 |   if (isAxiosResponse(response)) {
 61 |     return response.headers['content-type'] || response.headers['Content-Type'] || '';
 62 |   } else {
 63 |     return response.headers.get('content-type') || '';
 64 |   }
 65 | }
 66 | 
 67 | // --- Tests for the most common binary types
 68 | function isBinaryContentType(contentType: string): boolean {
 69 |   const binaryTypes = [
 70 |     // Images
 71 |     'image/',
 72 |     // Audio
 73 |     'audio/',
 74 |     // Video
 75 |     'video/',
 76 |     // Documents
 77 |     'application/pdf',
 78 |     'application/msword',
 79 |     'application/vnd.openxmlformats-officedocument.',
 80 |     'application/vnd.ms-excel',
 81 |     'application/vnd.ms-powerpoint',
 82 |     // Archives
 83 |     'application/zip',
 84 |     'application/x-rar-compressed',
 85 |     'application/x-tar',
 86 |     'application/gzip',
 87 |     'application/x-7z-compressed',
 88 |     // Other binary
 89 |     'application/octet-stream',
 90 |     'application/x-binary',
 91 |   ];
 92 |   
 93 |   return binaryTypes.some(type => contentType.toLowerCase().includes(type.toLowerCase()));
 94 | }
 95 | 
 96 | // --- Tests if a particular content type returns an ArrayBuffer
 97 | function shouldReturnAsArrayBuffer(contentType: string): boolean {
 98 |   const arrayBufferTypes = [
 99 |     'application/zip',
100 |     'application/x-rar-compressed',
101 |     'application/x-tar',
102 |     'application/gzip',
103 |     'application/x-7z-compressed',
104 |     'application/x-binary',
105 |   ];
106 |   
107 |   return arrayBufferTypes.some(type => contentType.toLowerCase().includes(type.toLowerCase()));
108 | }
109 | 
110 | async function parseResponseBody(response: AxiosResponse | Response, logError = false) {
111 |   let resp: any;
112 |   if (isAxiosResponse(response)) {
113 |     resp = response.data;
114 |   } else {
115 |     const contentType = getContentType(response);
116 |     
117 |     // Handle binary content types
118 |     if (isBinaryContentType(contentType)) {
119 |       try {
120 |         if (shouldReturnAsArrayBuffer(contentType)) {
121 |           resp = await response.clone().arrayBuffer();
122 |         } else {
123 |           resp = await response.clone().blob();
124 |         }
125 |       } catch (e) {
126 |         if (logError) {
127 |           console.error("Failed to parse binary response", e, contentType);
128 |         }
129 |         // Fallback to text if binary parsing fails
130 |         try {
131 |           resp = await response.clone().text();
132 |         } catch (textError) {
133 |           if (logError) {
134 |             console.error("Failed to parse response as text after binary parsing failed", textError);
135 |           }
136 |         }
137 |       }
138 |     } else {
139 |       // Handle text-based content types (JSON, text, etc.)
140 |       try {
141 |         resp = await response.clone().json();
142 |       } catch (e: any) {
143 |         try {
144 |           resp = await response.clone().text();
145 |         } catch (e) {
146 |           if (logError) {
147 |             console.error("Failed to parse response as text or JSON", response.body);
148 |           }
149 |         }
150 |       }
151 |     }
152 |   }
153 |   return resp;
154 | }
155 | 
156 | //TODO illesg unit test.....
157 | function appendFormFieldValue(
158 |   { key, value }: { key: string; value: any },
159 |   formData: FormData,
160 |   prevKey: string = key,
161 | ) {
162 |   if (value === undefined || value === null) {
163 |     return;
164 |   }
165 |   if (value instanceof File || value instanceof Blob) {
166 |     formData.append(key, value);
167 |     return;
168 |   }
169 |   if (Array.isArray(value)) {
170 |     value.forEach((val) => {
171 |       appendFormFieldValue({ key, value: val }, formData, prevKey);
172 |     });
173 |   } else if (isPlainObject(value)) {
174 |     Object.entries(value).forEach(([objKey, objVal]) => {
175 |       const concatenatedObjectKey = `${prevKey}.${objKey}`;
176 |       appendFormFieldValue(
177 |         {
178 |           key: concatenatedObjectKey,
179 |           value: objVal,
180 |         },
181 |         formData,
182 |         concatenatedObjectKey,
183 |       );
184 |     });
185 |   } else {
186 |     formData.append(key, value.toString());
187 |   }
188 | }
189 | 
190 | 
191 | const origin = (typeof window !== "undefined" && window.location?.href) || 'http://localhost';
192 | const originUrl = new URL(origin);
193 | function isURLSameOrigin(url: string): boolean {
194 |   const urlObj = new URL(url, origin);
195 | 
196 |   return (
197 |     originUrl.protocol === urlObj.protocol &&
198 |     originUrl.host === urlObj.host &&
199 |     originUrl.port === urlObj.port
200 |   );
201 |   
202 | }
203 | 
204 | export default class RestApiProxy {
205 |   private config: RestAPIAdapterPropsV2;
206 |   private appContext?: AppContextObject;
207 |   public apiInstance?: ApiInterceptor;
208 | 
209 |   constructor(appContext?: AppContextObject, apiInstance?: ApiInterceptor) {
210 |     const conf = appContext?.appGlobals || { apiUrl: "" };
211 |     const { apiUrl, errorResponseTransform } = conf;
212 |     this.appContext = appContext;
213 |     this.apiInstance = apiInstance;
214 | 
215 |     this.config = {
216 |       apiUrl,
217 |       errorResponseTransform,
218 |       headers: {
219 |         ...appContext?.appGlobals?.headers,
220 |       },
221 |     };
222 |   }
223 | 
224 |   public execute = async ({
225 |     abortSignal,
226 |     operation,
227 |     params,
228 |     parseOptions,
229 |     resolveBindingExpressions = false,
230 |     transactionId = randomUUID(),
231 |     onProgress,
232 |   }: {
233 |     abortSignal?: AbortSignal;
234 |     operation: ApiOperationDef;
235 |     params?: any;
236 |     parseOptions?: {
237 |       asBlob?: boolean;
238 |       asFile?: boolean;
239 |     };
240 |     transactionId?: string;
241 |     resolveBindingExpressions?: boolean;
242 |     onProgress?: OnProgressFn;
243 |   }): Promise<any> => {
244 |     return await this.executeOperation({
245 |       operation,
246 |       abortSignal,
247 |       contextParams: params,
248 |       resolveBindingExpressions,
249 |       parseResponse: parseOptions?.asFile
250 |         ? async (response) => {
251 |             //we can't access content-disposition header if it's a CORS request: The suggested workaround was adding Access-Control-Expose-Headers:Content-Disposition to the response header on the server.
252 |             // more info here: https://github.com/matthew-andrews/isomorphic-fetch/issues/67
253 |             let fileName = (operation as DownloadOperationDef).fileName || "unknown";
254 |             if (
255 |               response.headers &&
256 |               response.headers.get &&
257 |               typeof response.headers.get === "function"
258 |             ) {
259 |               const contentDisposition = response.headers.get("Content-Disposition")?.toString();
260 |               if (contentDisposition) {
261 |                 const fileNameMatch = contentDisposition.match(/filename="(.+)"/);
262 |                 if (fileNameMatch && fileNameMatch.length === 2) fileName = fileNameMatch[1];
263 |               }
264 |             }
265 |             return isAxiosResponse(response)
266 |               ? response.data
267 |               : new File([await response.clone().blob()], fileName);
268 |           }
269 |         : undefined,
270 |       transactionId,
271 |       onUploadProgress: onProgress,
272 |     });
273 |   };
274 | 
275 |   public upload = async ({
276 |     operation,
277 |     params = {},
278 |     chunk,
279 |     onUploadProgress,
280 |     abortSignal,
281 |     transactionId = randomUUID(),
282 |     resolveBindingExpressions = false,
283 |   }: {
284 |     abortSignal?: AbortSignal;
285 |     operation: UploadOperationDef;
286 |     params?: any;
287 |     chunk?: FileChunk;
288 |     onUploadProgress?: OnProgressFn;
289 |     transactionId?: string;
290 |     resolveBindingExpressions?: boolean;
291 |   }) => {
292 |     const { file, asForm, formParams } = this.extractParam(
293 |       resolveBindingExpressions,
294 |       operation,
295 |       params,
296 |     );
297 | 
298 |     const uploadParams = {
299 |       chunkStart: chunk?.chunkStart,
300 |       chunkEnd: chunk ? chunk?.chunkEnd - 1 : undefined,
301 |       chunkLength: chunk ? chunk?.chunkEnd - chunk?.chunkStart : undefined,
302 |       fileSize: file.size,
303 |       urlSafeName: encodeURIComponent(file.name),
304 |       fileName: file.name,
305 |     };
306 | 
307 |     const contextParams = { ...params, $uploadParams: uploadParams };
308 | 
309 |     if (asForm) {
310 |       const data = new FormData();
311 |       data.append(file.name, chunk?.blob || file);
312 |       if (formParams) {
313 |         Object.entries(this.extractParam(resolveBindingExpressions, formParams, params)).forEach(
314 |           ([key, value]) => {
315 |             data.append(key, value as string);
316 |           },
317 |         );
318 |       }
319 | 
320 |       return await this.executeOperation({
321 |         operation,
322 |         contextParams,
323 |         resolveBindingExpressions,
324 |         rawBody: data,
325 |         headers: {
326 |           ...this.extractParam(resolveBindingExpressions, operation.headers || {}, contextParams),
327 |           // https://muffinman.io/blog/uploading-files-using-fetch-multipart-form-data/
328 |           // the browser sets the content-type in this case
329 |           "Content-Type": undefined,
330 |         },
331 |         onUploadProgress,
332 |         abortSignal,
333 |         transactionId,
334 |       });
335 |     }
336 | 
337 |     return new Promise((resolve, reject) => {
338 |       const reader = new FileReader();
339 |       reader.readAsArrayBuffer(chunk?.blob || file);
340 |       reader.onload = async (evt) => {
341 |         try {
342 |           if (evt.target === null) {
343 |             reject();
344 |             return;
345 |           }
346 |           resolve(
347 |             await this.executeOperation({
348 |               operation,
349 |               contextParams,
350 |               resolveBindingExpressions,
351 |               rawBody: evt.target.result,
352 |               headers: {
353 |                 ...this.extractParam(
354 |                   resolveBindingExpressions,
355 |                   operation.headers || {},
356 |                   contextParams,
357 |                 ),
358 |                 "Content-Type": file.type,
359 |               },
360 |               onUploadProgress,
361 |               abortSignal,
362 |               transactionId,
363 |             }),
364 |           );
365 |         } catch (e) {
366 |           reject(e);
367 |         }
368 |       };
369 |       reader.onerror = () => {
370 |         reject();
371 |       };
372 |     });
373 |   };
374 | 
375 |   public resolveUrl = ({
376 |     operation,
377 |     params = {},
378 |     resolveBindingExpressions = false,
379 |   }: {
380 |     operation: ApiOperationDef;
381 |     params?: any;
382 |     resolveBindingExpressions?: boolean;
383 |   }) => {
384 |     return this.generateFullApiUrl(
385 |       this.extractParam(resolveBindingExpressions, operation.url, params),
386 |       this.extractParam(resolveBindingExpressions, operation.queryParams, params),
387 |     );
388 |   };
389 | 
390 |   private extractParam = (
391 |     resolveAsBindingExpression: boolean,
392 |     value: any,
393 |     params = {},
394 |     strict?: boolean,
395 |   ) => {
396 |     const localContext = { $adapterConfig: this.config, ...params };
397 |     if (resolveAsBindingExpression) {
398 |       return extractParam(localContext, value, this.appContext, strict);
399 |     }
400 |     if (value?._ARROW_EXPR_) {
401 |       //TODO illesg review, this whole processstatement is because of the chunked uploads (headers as function)
402 |       const evalContext: BindingTreeEvaluationContext = {
403 |         eventArgs: [localContext],
404 |       };
405 |       try {
406 |         const arrowStmt = {
407 |           type: T_ARROW_EXPRESSION_STATEMENT,
408 |           expr: value,
409 |         } as ArrowExpressionStatement;
410 | 
411 |         processStatementQueue([arrowStmt], evalContext);
412 | 
413 |         if (evalContext.mainThread?.blocks?.length) {
414 |           return evalContext.mainThread.blocks[evalContext.mainThread.blocks.length - 1]
415 |             .returnValue;
416 |         }
417 |         return undefined;
418 |       } catch (e) {
419 |         console.error(e);
420 |         return undefined;
421 |       }
422 |     }
423 |     return value;
424 |   };
425 | 
426 |   private executeOperation = async ({
427 |     operation,
428 |     contextParams,
429 |     abortSignal,
430 |     resolveBindingExpressions,
431 |     relativePath = this.extractParam(resolveBindingExpressions, operation.url, contextParams),
432 |     method = this.extractParam(resolveBindingExpressions, operation.method, contextParams),
433 |     queryParams = this.extractParam(
434 |       resolveBindingExpressions,
435 |       operation.queryParams,
436 |       contextParams,
437 |     ),
438 |     body = this.extractParam(resolveBindingExpressions, operation.body, contextParams, true),
439 |     rawBody = this.extractParam(resolveBindingExpressions, operation.rawBody, contextParams),
440 |     headers = this.extractParam(resolveBindingExpressions, operation.headers, contextParams),
441 |     payloadType = this.extractParam(
442 |       resolveBindingExpressions,
443 |       operation.payloadType,
444 |       contextParams,
445 |     ) || "json",
446 |     onUploadProgress,
447 |     parseResponse = this.tryParseResponse,
448 |     transactionId,
449 |   }: {
450 |     operation: ApiOperationDef;
451 |     abortSignal?: AbortSignal;
452 |     relativePath?: string;
453 |     method?: string;
454 |     queryParams?: Record<string, any>;
455 |     contextParams?: Record<string, any>;
456 |     body?: any;
457 |     rawBody?: any;
458 |     headers?: Record<string, string>;
459 |     payloadType?: "form" | "multipart-form" | "json";
460 |     onUploadProgress?: OnProgressFn;
461 |     parseResponse?: (response: Response | AxiosResponse, logError: boolean) => any;
462 |     transactionId: string;
463 |     resolveBindingExpressions: boolean;
464 |   }) => {
465 |     const includeClientTxId = method && method !== "get" && !!transactionId;
466 |     const headersWithoutContentType = { ...this.getHeaders(), ["Content-Type"]: undefined };
467 |     let url = this.generateFullApiUrl(relativePath, queryParams);
468 |     const hasBody = body !== undefined;
469 | 
470 |     const aggregatedHeaders = omitBy(
471 |       { ...(hasBody ? this.getHeaders() : headersWithoutContentType), ...headers },
472 |       isUndefined,
473 |     ) as Record<string, string>;
474 |     if (includeClientTxId) {
475 |       aggregatedHeaders["x-ue-client-tx-id"] = transactionId;
476 |     }
477 | 
478 |     if (this.appContext.appGlobals?.withXSRFToken !== false && isURLSameOrigin(url)) {
479 |       const xsrfToken = readCookie("XSRF-TOKEN");
480 |       if(xsrfToken) {
481 |         aggregatedHeaders["X-XSRF-TOKEN"] = xsrfToken;
482 |       }
483 |     }
484 | 
485 |     let requestBody;
486 |     if (rawBody !== undefined) {
487 |       requestBody = rawBody;
488 |     } else {
489 |       if (payloadType === "multipart-form" || payloadType === "form") {
490 |         const formData = new FormData();
491 |         Object.entries(body).forEach(([key, value]) => {
492 |           appendFormFieldValue({ key, value }, formData);
493 |         });
494 |         if (payloadType === "multipart-form") {
495 |           requestBody = formData;
496 |           // https://muffinman.io/blog/uploading-files-using-fetch-multipart-form-data/
497 |           // the browser sets the content-type in this case
498 |           delete aggregatedHeaders["Content-Type"];
499 |         } else {
500 |           requestBody = new URLSearchParams(formData as any).toString();
501 |           aggregatedHeaders["Content-Type"] = "application/x-www-form-urlencoded";
502 |         }
503 |       } else {
504 |         requestBody = hasBody ? JSON.stringify(body) : undefined;
505 |       }
506 |     }
507 | 
508 |     const options: RequestInit = {
509 |       method: method,
510 |       headers: aggregatedHeaders,
511 |       signal: abortSignal,
512 |       body: requestBody,
513 |     };
514 |     if (onUploadProgress) {
515 |       console.log("Falling back to axios. Reason: onUploadProgress specified");
516 |       const axios = (await import("axios")).default;
517 |       try {
518 |         const response = await axios.request({
519 |           url: url,
520 |           method: options.method,
521 |           headers: aggregatedHeaders,
522 |           data: options.body,
523 |           onUploadProgress,
524 |         });
525 |         return await parseResponse(
526 |           response,
527 |           this.appContext?.appGlobals?.logRestApiErrors ?? false,
528 |         );
529 |       } catch (error) {
530 |         if (axios.isAxiosError(error) && error.response) {
531 |           throw await this.raiseError(error.response);
532 |         } else {
533 |           throw error;
534 |         }
535 |       }
536 |     } else {
537 |       let response: any;
538 |       if (this.apiInstance && this.apiInstance.hasMockForRequest(url, options)) {
539 |         response = await this.apiInstance.executeMockedFetch(url, options);
540 |       } else {
541 |         response = await fetch(url, options);
542 |       }
543 |       if (!response.clone().ok) {
544 |         throw await this.raiseError(response);
545 |       }
546 |       const parsedResponse = await parseResponse(
547 |         response.clone(),
548 |         this.appContext?.appGlobals?.logRestApiErrors ?? false,
549 |       );
550 |       return parsedResponse;
551 |     }
552 |   };
553 | 
554 |   private tryParseResponse = async (response: Response | AxiosResponse, logError = false) => {
555 |     return await parseResponseBody(response, logError);
556 |   };
557 | 
558 |   private generateFullApiUrl(relativePath: string, queryParams: Record<string, any> | undefined) {
559 |     let queryString = "";
560 |     if (queryParams) {
561 |       const params = new URLSearchParams();
562 |       Object.entries(queryParams).forEach(([key, value]) => {
563 |         if (Array.isArray(value)) {
564 |           value.forEach((item) => {
565 |             params.append(key, item);
566 |           });
567 |         } else if (value !== undefined) {
568 |           params.append(key, value);
569 |         }
570 |       });
571 |       queryString = `?${params}`;
572 |     }
573 |     if (relativePath.startsWith("http://") || relativePath.startsWith("https://")) {
574 |       return `${relativePath}${queryString}`;
575 |     }
576 |     //TODO check if autoEncode is enabled
577 |     return `${this.config.apiUrl || ""}${relativePath}${queryString}`;
578 |   }
579 | 
580 |   private raiseError = async (response: Response | AxiosResponse) => {
581 |     if ("config" in response) {
582 |       //poor man's axios response type guard
583 |       try {
584 |         return new GenericBackendError(
585 |           this.config.errorResponseTransform
586 |             ? this.extractParam(true, this.config.errorResponseTransform, {
587 |                 $response: response.data,
588 |               })
589 |             : response.data,
590 |           response.status,
591 |         );
592 |       } catch {}
593 |     } else {
594 |       try {
595 |         const respObject = await response.json();
596 |         return new GenericBackendError(
597 |           this.config.errorResponseTransform
598 |             ? this.extractParam(true, this.config.errorResponseTransform, { $response: respObject })
599 |             : respObject,
600 |           response.status,
601 |         );
602 |       } catch {
603 |         return new GenericBackendError("<No error description>", response.status);
604 |       }
605 |     }
606 | 
607 |     return new Error(
608 |       `[!] Server responded with an error: ${response.status} - ${response.statusText}`,
609 |     );
610 |   };
611 | 
612 |   private getHeaders = (): Record<string, string> => {
613 |     return {
614 |       ["Content-Type" as string]: "application/json; charset=UTF-8",
615 |       ...(this.config.headers ?? {}),
616 |     };
617 |   };
618 | }
619 | 
```
Page 83/189FirstPrevNextLast