#
tokens: 38191/50000 1/1629 files (page 120/140)
lines: off (toggle) GitHub
raw markdown copy
This is page 120 of 140. Use http://codebase.md/xmlui-org/xmlui/mockApiDef.js?page={x} to view the full context.

# Directory Structure

```
├── .changeset
│   ├── config.json
│   └── cool-queens-look.md
├── .eslintrc.cjs
├── .github
│   ├── build-checklist.png
│   ├── ISSUE_TEMPLATE
│   │   ├── bug_report.md
│   │   └── feature_request.md
│   └── workflows
│       ├── deploy-blog.yml
│       ├── deploy-docs-optimized.yml
│       ├── deploy-docs.yml
│       ├── prepare-versions.yml
│       ├── release-packages.yml
│       ├── run-all-tests.yml
│       └── run-smoke-tests.yml
├── .gitignore
├── .prettierrc.js
├── .vscode
│   ├── launch.json
│   └── settings.json
├── blog
│   ├── .gitignore
│   ├── .gitkeep
│   ├── CHANGELOG.md
│   ├── extensions.ts
│   ├── index.html
│   ├── index.ts
│   ├── package.json
│   ├── public
│   │   ├── blog
│   │   │   ├── images
│   │   │   │   ├── blog-page-component.png
│   │   │   │   ├── blog-scrabble.png
│   │   │   │   ├── integrated-blog-search.png
│   │   │   │   └── lorem-ipsum.png
│   │   │   ├── lorem-ipsum.md
│   │   │   ├── newest-post.md
│   │   │   ├── older-post.md
│   │   │   └── welcome-to-the-xmlui-blog.md
│   │   ├── mockServiceWorker.js
│   │   ├── netlify.toml
│   │   ├── resources
│   │   │   ├── favicon.ico
│   │   │   ├── files
│   │   │   │   └── for-download
│   │   │   │       └── xmlui
│   │   │   │           └── xmlui-standalone.umd.js
│   │   │   ├── github.svg
│   │   │   ├── llms.txt
│   │   │   ├── logo-dark.svg
│   │   │   ├── logo.svg
│   │   │   ├── pg-popout.svg
│   │   │   └── xmlui-logo.svg
│   │   ├── serve.json
│   │   └── web.config
│   ├── scripts
│   │   ├── download-latest-xmlui.js
│   │   ├── generate-rss.js
│   │   ├── get-releases.js
│   │   └── utils.js
│   ├── src
│   │   ├── components
│   │   │   ├── BlogOverview.xmlui
│   │   │   ├── BlogPage.xmlui
│   │   │   ├── Debug.xmlui
│   │   │   └── PageNotFound.xmlui
│   │   ├── config.ts
│   │   ├── Main.xmlui
│   │   ├── Main.xmlui.xs
│   │   └── themes
│   │       ├── docs-theme.ts
│   │       ├── earthtone.ts
│   │       ├── xmlui-gray-on-default.ts
│   │       ├── xmlui-green-on-default.ts
│   │       └── xmlui-orange-on-default.ts
│   └── tsconfig.json
├── CONTRIBUTING.md
├── docs
│   ├── .gitignore
│   ├── CHANGELOG.md
│   ├── ComponentRefLinks.txt
│   ├── content
│   │   ├── _meta.json
│   │   ├── components
│   │   │   ├── _meta.json
│   │   │   ├── _overview.md
│   │   │   ├── APICall.md
│   │   │   ├── App.md
│   │   │   ├── AppHeader.md
│   │   │   ├── AppState.md
│   │   │   ├── AutoComplete.md
│   │   │   ├── Avatar.md
│   │   │   ├── Backdrop.md
│   │   │   ├── Badge.md
│   │   │   ├── BarChart.md
│   │   │   ├── Bookmark.md
│   │   │   ├── Breakout.md
│   │   │   ├── Button.md
│   │   │   ├── Card.md
│   │   │   ├── Carousel.md
│   │   │   ├── ChangeListener.md
│   │   │   ├── Checkbox.md
│   │   │   ├── CHStack.md
│   │   │   ├── ColorPicker.md
│   │   │   ├── Column.md
│   │   │   ├── ContentSeparator.md
│   │   │   ├── CVStack.md
│   │   │   ├── DataSource.md
│   │   │   ├── DateInput.md
│   │   │   ├── DatePicker.md
│   │   │   ├── DonutChart.md
│   │   │   ├── DropdownMenu.md
│   │   │   ├── EmojiSelector.md
│   │   │   ├── ExpandableItem.md
│   │   │   ├── FileInput.md
│   │   │   ├── FileUploadDropZone.md
│   │   │   ├── FlowLayout.md
│   │   │   ├── Footer.md
│   │   │   ├── Form.md
│   │   │   ├── FormItem.md
│   │   │   ├── FormSection.md
│   │   │   ├── Fragment.md
│   │   │   ├── H1.md
│   │   │   ├── H2.md
│   │   │   ├── H3.md
│   │   │   ├── H4.md
│   │   │   ├── H5.md
│   │   │   ├── H6.md
│   │   │   ├── Heading.md
│   │   │   ├── HSplitter.md
│   │   │   ├── HStack.md
│   │   │   ├── Icon.md
│   │   │   ├── IFrame.md
│   │   │   ├── Image.md
│   │   │   ├── Items.md
│   │   │   ├── LabelList.md
│   │   │   ├── Legend.md
│   │   │   ├── LineChart.md
│   │   │   ├── Link.md
│   │   │   ├── List.md
│   │   │   ├── Logo.md
│   │   │   ├── Markdown.md
│   │   │   ├── MenuItem.md
│   │   │   ├── MenuSeparator.md
│   │   │   ├── ModalDialog.md
│   │   │   ├── NavGroup.md
│   │   │   ├── NavLink.md
│   │   │   ├── NavPanel.md
│   │   │   ├── NoResult.md
│   │   │   ├── NumberBox.md
│   │   │   ├── Option.md
│   │   │   ├── Page.md
│   │   │   ├── PageMetaTitle.md
│   │   │   ├── Pages.md
│   │   │   ├── Pagination.md
│   │   │   ├── PasswordInput.md
│   │   │   ├── PieChart.md
│   │   │   ├── ProgressBar.md
│   │   │   ├── Queue.md
│   │   │   ├── RadioGroup.md
│   │   │   ├── RealTimeAdapter.md
│   │   │   ├── Redirect.md
│   │   │   ├── Select.md
│   │   │   ├── Slider.md
│   │   │   ├── Slot.md
│   │   │   ├── SpaceFiller.md
│   │   │   ├── Spinner.md
│   │   │   ├── Splitter.md
│   │   │   ├── Stack.md
│   │   │   ├── StickyBox.md
│   │   │   ├── SubMenuItem.md
│   │   │   ├── Switch.md
│   │   │   ├── TabItem.md
│   │   │   ├── Table.md
│   │   │   ├── TableOfContents.md
│   │   │   ├── Tabs.md
│   │   │   ├── Text.md
│   │   │   ├── TextArea.md
│   │   │   ├── TextBox.md
│   │   │   ├── Theme.md
│   │   │   ├── TimeInput.md
│   │   │   ├── Timer.md
│   │   │   ├── ToneChangerButton.md
│   │   │   ├── ToneSwitch.md
│   │   │   ├── Tooltip.md
│   │   │   ├── Tree.md
│   │   │   ├── VSplitter.md
│   │   │   ├── VStack.md
│   │   │   ├── xmlui-animations
│   │   │   │   ├── _meta.json
│   │   │   │   ├── _overview.md
│   │   │   │   ├── Animation.md
│   │   │   │   ├── FadeAnimation.md
│   │   │   │   ├── FadeInAnimation.md
│   │   │   │   ├── FadeOutAnimation.md
│   │   │   │   ├── ScaleAnimation.md
│   │   │   │   └── SlideInAnimation.md
│   │   │   ├── xmlui-pdf
│   │   │   │   ├── _meta.json
│   │   │   │   ├── _overview.md
│   │   │   │   └── Pdf.md
│   │   │   ├── xmlui-spreadsheet
│   │   │   │   ├── _meta.json
│   │   │   │   ├── _overview.md
│   │   │   │   └── Spreadsheet.md
│   │   │   └── xmlui-website-blocks
│   │   │       ├── _meta.json
│   │   │       ├── _overview.md
│   │   │       ├── Carousel.md
│   │   │       ├── HelloMd.md
│   │   │       ├── HeroSection.md
│   │   │       └── ScrollToTop.md
│   │   └── extensions
│   │       ├── _meta.json
│   │       ├── xmlui-animations
│   │       │   ├── _meta.json
│   │       │   ├── _overview.md
│   │       │   ├── Animation.md
│   │       │   ├── FadeAnimation.md
│   │       │   ├── FadeInAnimation.md
│   │       │   ├── FadeOutAnimation.md
│   │       │   ├── ScaleAnimation.md
│   │       │   └── SlideInAnimation.md
│   │       └── xmlui-website-blocks
│   │           ├── _meta.json
│   │           ├── _overview.md
│   │           ├── Carousel.md
│   │           ├── HelloMd.md
│   │           ├── HeroSection.md
│   │           └── ScrollToTop.md
│   ├── extensions.ts
│   ├── index.html
│   ├── index.ts
│   ├── package.json
│   ├── public
│   │   ├── feed.rss
│   │   ├── mockServiceWorker.js
│   │   ├── pages
│   │   │   ├── _meta.json
│   │   │   ├── app-structure.md
│   │   │   ├── build-editor-component.md
│   │   │   ├── build-hello-world-component.md
│   │   │   ├── components-intro.md
│   │   │   ├── context-variables.md
│   │   │   ├── forms.md
│   │   │   ├── globals.md
│   │   │   ├── glossary.md
│   │   │   ├── helper-tags.md
│   │   │   ├── hosted-deployment.md
│   │   │   ├── howto
│   │   │   │   ├── assign-a-complex-json-literal-to-a-component-variable.md
│   │   │   │   ├── chain-a-refetch.md
│   │   │   │   ├── debug-a-component.md
│   │   │   │   ├── delay-a-datasource-until-another-datasource-is-ready.md
│   │   │   │   ├── delegate-a-method.md
│   │   │   │   ├── do-custom-form-validation.md
│   │   │   │   ├── expose-a-method-from-a-component.md
│   │   │   │   ├── filter-and-transform-data-from-an-api.md
│   │   │   │   ├── group-items-in-list-by-a-property.md
│   │   │   │   ├── handle-background-operations.md
│   │   │   │   ├── hide-an-element-until-its-datasource-is-ready.md
│   │   │   │   ├── make-a-set-of-equal-width-cards.md
│   │   │   │   ├── make-a-table-responsive.md
│   │   │   │   ├── modify-a-value-reported-in-a-column.md
│   │   │   │   ├── paginate-a-list.md
│   │   │   │   ├── pass-data-to-a-modal-dialog.md
│   │   │   │   ├── react-to-button-click-not-keystrokes.md
│   │   │   │   ├── set-the-initial-value-of-a-select-from-fetched-data.md
│   │   │   │   ├── share-a-modaldialog-across-components.md
│   │   │   │   ├── sync-selections-between-table-and-list-views.md
│   │   │   │   ├── update-ui-optimistically.md
│   │   │   │   ├── use-built-in-form-validation.md
│   │   │   │   └── use-the-same-modaldialog-to-add-or-edit.md
│   │   │   ├── howto.md
│   │   │   ├── intro.md
│   │   │   ├── layout.md
│   │   │   ├── markup.md
│   │   │   ├── mcp.md
│   │   │   ├── modal-dialogs.md
│   │   │   ├── news-and-reviews.md
│   │   │   ├── reactive-intro.md
│   │   │   ├── refactoring.md
│   │   │   ├── routing-and-links.md
│   │   │   ├── samples
│   │   │   │   ├── color-palette.xmlui
│   │   │   │   ├── color-values.xmlui
│   │   │   │   ├── shadow-sizes.xmlui
│   │   │   │   ├── spacing-sizes.xmlui
│   │   │   │   ├── swatch.xmlui
│   │   │   │   ├── theme-gallery-brief.xmlui
│   │   │   │   └── theme-gallery.xmlui
│   │   │   ├── scoping.md
│   │   │   ├── scripting.md
│   │   │   ├── styles-and-themes
│   │   │   │   ├── common-units.md
│   │   │   │   ├── layout-props.md
│   │   │   │   ├── theme-variable-defaults.md
│   │   │   │   ├── theme-variables.md
│   │   │   │   └── themes.md
│   │   │   ├── template-properties.md
│   │   │   ├── test.md
│   │   │   ├── tutorial-01.md
│   │   │   ├── tutorial-02.md
│   │   │   ├── tutorial-03.md
│   │   │   ├── tutorial-04.md
│   │   │   ├── tutorial-05.md
│   │   │   ├── tutorial-06.md
│   │   │   ├── tutorial-07.md
│   │   │   ├── tutorial-08.md
│   │   │   ├── tutorial-09.md
│   │   │   ├── tutorial-10.md
│   │   │   ├── tutorial-11.md
│   │   │   ├── tutorial-12.md
│   │   │   ├── universal-properties.md
│   │   │   ├── user-defined-components.md
│   │   │   ├── vscode.md
│   │   │   ├── working-with-markdown.md
│   │   │   ├── working-with-text.md
│   │   │   ├── xmlui-animations
│   │   │   │   ├── _meta.json
│   │   │   │   ├── _overview.md
│   │   │   │   ├── Animation.md
│   │   │   │   ├── FadeAnimation.md
│   │   │   │   ├── FadeInAnimation.md
│   │   │   │   ├── FadeOutAnimation.md
│   │   │   │   ├── ScaleAnimation.md
│   │   │   │   └── SlideInAnimation.md
│   │   │   ├── xmlui-charts
│   │   │   │   ├── _meta.json
│   │   │   │   ├── _overview.md
│   │   │   │   ├── BarChart.md
│   │   │   │   ├── DonutChart.md
│   │   │   │   ├── LabelList.md
│   │   │   │   ├── Legend.md
│   │   │   │   ├── LineChart.md
│   │   │   │   └── PieChart.md
│   │   │   ├── xmlui-pdf
│   │   │   │   ├── _meta.json
│   │   │   │   ├── _overview.md
│   │   │   │   └── Pdf.md
│   │   │   └── xmlui-spreadsheet
│   │   │       ├── _meta.json
│   │   │       ├── _overview.md
│   │   │       └── Spreadsheet.md
│   │   ├── resources
│   │   │   ├── devdocs
│   │   │   │   ├── debug-proxy-object-2.png
│   │   │   │   ├── debug-proxy-object.png
│   │   │   │   ├── table_editor_01.png
│   │   │   │   ├── table_editor_02.png
│   │   │   │   ├── table_editor_03.png
│   │   │   │   ├── table_editor_04.png
│   │   │   │   ├── table_editor_05.png
│   │   │   │   ├── table_editor_06.png
│   │   │   │   ├── table_editor_07.png
│   │   │   │   ├── table_editor_08.png
│   │   │   │   ├── table_editor_09.png
│   │   │   │   ├── table_editor_10.png
│   │   │   │   ├── table_editor_11.png
│   │   │   │   ├── table-editor-01.png
│   │   │   │   ├── table-editor-02.png
│   │   │   │   ├── table-editor-03.png
│   │   │   │   ├── table-editor-04.png
│   │   │   │   ├── table-editor-06.png
│   │   │   │   ├── table-editor-07.png
│   │   │   │   ├── table-editor-08.png
│   │   │   │   ├── table-editor-09.png
│   │   │   │   └── xmlui-rendering-of-tiptap-markdown.png
│   │   │   ├── favicon.ico
│   │   │   ├── files
│   │   │   │   ├── clients.json
│   │   │   │   ├── daily-revenue.json
│   │   │   │   ├── dashboard-stats.json
│   │   │   │   ├── demo.xmlui
│   │   │   │   ├── demo.xmlui.xs
│   │   │   │   ├── downloads
│   │   │   │   │   └── downloads.json
│   │   │   │   ├── for-download
│   │   │   │   │   ├── index-with-api.html
│   │   │   │   │   ├── index.html
│   │   │   │   │   ├── mockApi.js
│   │   │   │   │   ├── start-darwin.sh
│   │   │   │   │   ├── start-linux.sh
│   │   │   │   │   ├── start.bat
│   │   │   │   │   └── xmlui
│   │   │   │   │       └── xmlui-standalone.umd.js
│   │   │   │   ├── getting-started
│   │   │   │   │   ├── cl-tutorial-final.zip
│   │   │   │   │   ├── cl-tutorial.zip
│   │   │   │   │   ├── cl-tutorial2.zip
│   │   │   │   │   ├── cl-tutorial3.zip
│   │   │   │   │   ├── cl-tutorial4.zip
│   │   │   │   │   ├── cl-tutorial5.zip
│   │   │   │   │   ├── cl-tutorial6.zip
│   │   │   │   │   ├── getting-started.zip
│   │   │   │   │   ├── hello-xmlui.zip
│   │   │   │   │   ├── xmlui-empty.zip
│   │   │   │   │   └── xmlui-starter.zip
│   │   │   │   ├── howto
│   │   │   │   │   └── component-icons
│   │   │   │   │       └── up-arrow.svg
│   │   │   │   ├── invoices.json
│   │   │   │   ├── monthly-status.json
│   │   │   │   ├── news-and-reviews.json
│   │   │   │   ├── products.json
│   │   │   │   ├── releases.json
│   │   │   │   ├── tutorials
│   │   │   │   │   ├── datasource
│   │   │   │   │   │   └── api.ts
│   │   │   │   │   └── p2do
│   │   │   │   │       ├── api.ts
│   │   │   │   │       └── todo-logo.svg
│   │   │   │   └── xmlui.json
│   │   │   ├── github.svg
│   │   │   ├── images
│   │   │   │   ├── apiaction-tutorial
│   │   │   │   │   ├── add-success.png
│   │   │   │   │   ├── apiaction-param.png
│   │   │   │   │   ├── change-completed.png
│   │   │   │   │   ├── change-in-progress.png
│   │   │   │   │   ├── confirm-delete.png
│   │   │   │   │   ├── data-error.png
│   │   │   │   │   ├── data-progress.png
│   │   │   │   │   ├── data-success.png
│   │   │   │   │   ├── display-1.png
│   │   │   │   │   ├── item-deleted.png
│   │   │   │   │   ├── item-updated.png
│   │   │   │   │   ├── missing-api-key.png
│   │   │   │   │   ├── new-item-added.png
│   │   │   │   │   └── test-message.png
│   │   │   │   ├── chat-api
│   │   │   │   │   └── domain-model.svg
│   │   │   │   ├── components
│   │   │   │   │   ├── image
│   │   │   │   │   │   └── breakfast.jpg
│   │   │   │   │   ├── markdown
│   │   │   │   │   │   └── colors.png
│   │   │   │   │   └── modal
│   │   │   │   │       ├── deep_link_dialog_1.jpg
│   │   │   │   │       └── deep_link_dialog_2.jpg
│   │   │   │   ├── create-apps
│   │   │   │   │   ├── collapsed-vertical.png
│   │   │   │   │   ├── using-forms-warning-dialog.png
│   │   │   │   │   └── using-forms.png
│   │   │   │   ├── datasource-tutorial
│   │   │   │   │   ├── data-with-header.png
│   │   │   │   │   ├── filtered-data.png
│   │   │   │   │   ├── filtered-items.png
│   │   │   │   │   ├── initial-page-items.png
│   │   │   │   │   ├── list-items.png
│   │   │   │   │   ├── next-page-items.png
│   │   │   │   │   ├── no-data.png
│   │   │   │   │   ├── pagination-1.jpg
│   │   │   │   │   ├── pagination-1.png
│   │   │   │   │   ├── polling-1.png
│   │   │   │   │   ├── refetch-data.png
│   │   │   │   │   ├── slow-loading.png
│   │   │   │   │   ├── test-message.png
│   │   │   │   │   ├── Thumbs.db
│   │   │   │   │   ├── unconventional-data.png
│   │   │   │   │   └── unfiltered-items.png
│   │   │   │   ├── flower.jpg
│   │   │   │   ├── get-started
│   │   │   │   │   ├── add-new-contact.png
│   │   │   │   │   ├── app-modified.png
│   │   │   │   │   ├── app-start.png
│   │   │   │   │   ├── app-with-boxes.png
│   │   │   │   │   ├── app-with-toast.png
│   │   │   │   │   ├── boilerplate-structure.png
│   │   │   │   │   ├── cl-initial.png
│   │   │   │   │   ├── cl-start.png
│   │   │   │   │   ├── contact-counts.png
│   │   │   │   │   ├── contact-dialog-title.png
│   │   │   │   │   ├── contact-dialog.png
│   │   │   │   │   ├── contact-menus.png
│   │   │   │   │   ├── contact-predicates.png
│   │   │   │   │   ├── context-menu.png
│   │   │   │   │   ├── dashboard-numbers.png
│   │   │   │   │   ├── default-contact-list.png
│   │   │   │   │   ├── delete-contact.png
│   │   │   │   │   ├── delete-task.png
│   │   │   │   │   ├── detailed-template.png
│   │   │   │   │   ├── edit-contact-details.png
│   │   │   │   │   ├── edited-contact-saved.png
│   │   │   │   │   ├── empty-sections.png
│   │   │   │   │   ├── filter-completed.png
│   │   │   │   │   ├── fullwidth-desktop.png
│   │   │   │   │   ├── fullwidth-mobile.png
│   │   │   │   │   ├── initial-table.png
│   │   │   │   │   ├── items-and-badges.png
│   │   │   │   │   ├── loading-message.png
│   │   │   │   │   ├── new-contact-button.png
│   │   │   │   │   ├── new-contact-saved.png
│   │   │   │   │   ├── no-empty-sections.png
│   │   │   │   │   ├── personal-todo-initial.png
│   │   │   │   │   ├── piechart.png
│   │   │   │   │   ├── review-today.png
│   │   │   │   │   ├── rudimentary-dashboard.png
│   │   │   │   │   ├── section-collapsed.png
│   │   │   │   │   ├── sectioned-items.png
│   │   │   │   │   ├── sections-ordered.png
│   │   │   │   │   ├── spacex-list-with-links.png
│   │   │   │   │   ├── spacex-list.png
│   │   │   │   │   ├── start-personal-todo-1.png
│   │   │   │   │   ├── submit-new-contact.png
│   │   │   │   │   ├── submit-new-task.png
│   │   │   │   │   ├── syntax-highlighting.png
│   │   │   │   │   ├── table-with-badge.png
│   │   │   │   │   ├── template-with-card.png
│   │   │   │   │   ├── test-emulated-api.png
│   │   │   │   │   ├── Thumbs.db
│   │   │   │   │   ├── todo-logo.png
│   │   │   │   │   └── xmlui-tools.png
│   │   │   │   ├── HelloApp.png
│   │   │   │   ├── HelloApp2.png
│   │   │   │   ├── logos
│   │   │   │   │   ├── xmlui1.svg
│   │   │   │   │   ├── xmlui2.svg
│   │   │   │   │   ├── xmlui3.svg
│   │   │   │   │   ├── xmlui4.svg
│   │   │   │   │   ├── xmlui5.svg
│   │   │   │   │   ├── xmlui6.svg
│   │   │   │   │   └── xmlui7.svg
│   │   │   │   ├── pdf
│   │   │   │   │   └── dummy-pdf.jpg
│   │   │   │   ├── rendering-engine
│   │   │   │   │   ├── AppEngine-flow.svg
│   │   │   │   │   ├── Component.svg
│   │   │   │   │   ├── CompoundComponent.svg
│   │   │   │   │   ├── RootComponent.svg
│   │   │   │   │   └── tree-with-containers.svg
│   │   │   │   ├── reviewers-guide
│   │   │   │   │   ├── AppEngine-flow.svg
│   │   │   │   │   └── incbutton-in-action.png
│   │   │   │   ├── tools
│   │   │   │   │   └── boilerplate-structure.png
│   │   │   │   ├── try.svg
│   │   │   │   ├── tutorial
│   │   │   │   │   ├── app-chat-history.png
│   │   │   │   │   ├── app-content-placeholder.png
│   │   │   │   │   ├── app-header-and-content.png
│   │   │   │   │   ├── app-links-channel-selected.png
│   │   │   │   │   ├── app-links-click.png
│   │   │   │   │   ├── app-navigation.png
│   │   │   │   │   ├── finished-ex01.png
│   │   │   │   │   ├── finished-ex02.png
│   │   │   │   │   ├── hello.png
│   │   │   │   │   ├── splash-screen-advanced.png
│   │   │   │   │   ├── splash-screen-after-click.png
│   │   │   │   │   ├── splash-screen-centered.png
│   │   │   │   │   ├── splash-screen-events.png
│   │   │   │   │   ├── splash-screen-expression.png
│   │   │   │   │   ├── splash-screen-reuse-after.png
│   │   │   │   │   ├── splash-screen-reuse-before.png
│   │   │   │   │   └── splash-screen.png
│   │   │   │   └── tutorial-01.png
│   │   │   ├── llms.txt
│   │   │   ├── logo-dark.svg
│   │   │   ├── logo.svg
│   │   │   ├── pg-popout.svg
│   │   │   └── xmlui-logo.svg
│   │   ├── serve.json
│   │   └── web.config
│   ├── scripts
│   │   ├── download-latest-xmlui.js
│   │   ├── generate-rss.js
│   │   ├── get-releases.js
│   │   └── utils.js
│   ├── src
│   │   ├── components
│   │   │   ├── BlogOverview.xmlui
│   │   │   ├── BlogPage.xmlui
│   │   │   ├── Boxes.xmlui
│   │   │   ├── Breadcrumb.xmlui
│   │   │   ├── ChangeLog.xmlui
│   │   │   ├── ColorPalette.xmlui
│   │   │   ├── DocumentLinks.xmlui
│   │   │   ├── DocumentPage.xmlui
│   │   │   ├── DocumentPageNoTOC.xmlui
│   │   │   ├── Icons.xmlui
│   │   │   ├── IncButton.xmlui
│   │   │   ├── IncButton2.xmlui
│   │   │   ├── NameValue.xmlui
│   │   │   ├── PageNotFound.xmlui
│   │   │   ├── PaletteItem.xmlui
│   │   │   ├── Palettes.xmlui
│   │   │   ├── SectionHeader.xmlui
│   │   │   ├── TBD.xmlui
│   │   │   ├── Test.xmlui
│   │   │   ├── ThemesIntro.xmlui
│   │   │   ├── ThousandThemes.xmlui
│   │   │   ├── TubeStops.xmlui
│   │   │   ├── TubeStops.xmlui.xs
│   │   │   └── TwoColumnCode.xmlui
│   │   ├── config.ts
│   │   ├── Main.xmlui
│   │   └── themes
│   │       ├── docs-theme.ts
│   │       ├── earthtone.ts
│   │       ├── xmlui-gray-on-default.ts
│   │       ├── xmlui-green-on-default.ts
│   │       └── xmlui-orange-on-default.ts
│   └── tsconfig.json
├── LICENSE
├── package-lock.json
├── package.json
├── packages
│   ├── xmlui-animations
│   │   ├── .gitignore
│   │   ├── CHANGELOG.md
│   │   ├── demo
│   │   │   └── Main.xmlui
│   │   ├── index.html
│   │   ├── index.ts
│   │   ├── meta
│   │   │   └── componentsMetadata.ts
│   │   ├── package.json
│   │   ├── src
│   │   │   ├── Animation.tsx
│   │   │   ├── AnimationNative.tsx
│   │   │   ├── FadeAnimation.tsx
│   │   │   ├── FadeInAnimation.tsx
│   │   │   ├── FadeOutAnimation.tsx
│   │   │   ├── index.tsx
│   │   │   ├── ScaleAnimation.tsx
│   │   │   └── SlideInAnimation.tsx
│   │   └── tsconfig.json
│   ├── xmlui-devtools
│   │   ├── .gitignore
│   │   ├── CHANGELOG.md
│   │   ├── demo
│   │   │   └── Main.xmlui
│   │   ├── index.html
│   │   ├── index.ts
│   │   ├── meta
│   │   │   └── componentsMetadata.ts
│   │   ├── package.json
│   │   ├── src
│   │   │   ├── devtools
│   │   │   │   ├── DevTools.tsx
│   │   │   │   ├── DevToolsNative.module.scss
│   │   │   │   ├── DevToolsNative.tsx
│   │   │   │   ├── ModalDialog.module.scss
│   │   │   │   ├── ModalDialog.tsx
│   │   │   │   ├── ModalVisibilityContext.tsx
│   │   │   │   ├── Tooltip.module.scss
│   │   │   │   ├── Tooltip.tsx
│   │   │   │   └── utils.ts
│   │   │   ├── editor
│   │   │   │   └── Editor.tsx
│   │   │   └── index.tsx
│   │   ├── tsconfig.json
│   │   └── vite.config-overrides.ts
│   ├── xmlui-hello-world
│   │   ├── .gitignore
│   │   ├── index.ts
│   │   ├── meta
│   │   │   └── componentsMetadata.ts
│   │   ├── package.json
│   │   ├── src
│   │   │   ├── HelloWorld.module.scss
│   │   │   ├── HelloWorld.tsx
│   │   │   ├── HelloWorldNative.tsx
│   │   │   └── index.tsx
│   │   └── tsconfig.json
│   ├── xmlui-os-frames
│   │   ├── .gitignore
│   │   ├── demo
│   │   │   └── Main.xmlui
│   │   ├── index.html
│   │   ├── index.ts
│   │   ├── meta
│   │   │   └── componentsMetadata.ts
│   │   ├── package.json
│   │   ├── src
│   │   │   ├── index.tsx
│   │   │   ├── IPhoneFrame.module.scss
│   │   │   ├── IPhoneFrame.tsx
│   │   │   ├── MacOSAppFrame.module.scss
│   │   │   ├── MacOSAppFrame.tsx
│   │   │   ├── WindowsAppFrame.module.scss
│   │   │   └── WindowsAppFrame.tsx
│   │   └── tsconfig.json
│   ├── xmlui-pdf
│   │   ├── .gitignore
│   │   ├── CHANGELOG.md
│   │   ├── demo
│   │   │   ├── components
│   │   │   │   └── Pdf.xmlui
│   │   │   └── Main.xmlui
│   │   ├── index.html
│   │   ├── index.ts
│   │   ├── meta
│   │   │   └── componentsMetadata.ts
│   │   ├── package.json
│   │   ├── src
│   │   │   ├── index.tsx
│   │   │   ├── LazyPdfNative.tsx
│   │   │   ├── Pdf.module.scss
│   │   │   └── Pdf.tsx
│   │   └── tsconfig.json
│   ├── xmlui-playground
│   │   ├── .gitignore
│   │   ├── CHANGELOG.md
│   │   ├── demo
│   │   │   └── Main.xmlui
│   │   ├── index.html
│   │   ├── index.ts
│   │   ├── meta
│   │   │   └── componentsMetadata.ts
│   │   ├── package.json
│   │   ├── src
│   │   │   ├── hooks
│   │   │   │   ├── usePlayground.ts
│   │   │   │   └── useToast.ts
│   │   │   ├── index.tsx
│   │   │   ├── playground
│   │   │   │   ├── Box.module.scss
│   │   │   │   ├── Box.tsx
│   │   │   │   ├── CodeSelector.tsx
│   │   │   │   ├── ConfirmationDialog.module.scss
│   │   │   │   ├── ConfirmationDialog.tsx
│   │   │   │   ├── Editor.tsx
│   │   │   │   ├── Header.module.scss
│   │   │   │   ├── Header.tsx
│   │   │   │   ├── Playground.tsx
│   │   │   │   ├── PlaygroundContent.module.scss
│   │   │   │   ├── PlaygroundContent.tsx
│   │   │   │   ├── PlaygroundNative.module.scss
│   │   │   │   ├── PlaygroundNative.tsx
│   │   │   │   ├── Preview.module.scss
│   │   │   │   ├── Preview.tsx
│   │   │   │   ├── Select.module.scss
│   │   │   │   ├── StandalonePlayground.tsx
│   │   │   │   ├── StandalonePlaygroundNative.module.scss
│   │   │   │   ├── StandalonePlaygroundNative.tsx
│   │   │   │   ├── ThemeSwitcher.module.scss
│   │   │   │   ├── ThemeSwitcher.tsx
│   │   │   │   ├── ToneSwitcher.tsx
│   │   │   │   ├── Tooltip.module.scss
│   │   │   │   ├── Tooltip.tsx
│   │   │   │   └── utils.ts
│   │   │   ├── providers
│   │   │   │   ├── Toast.module.scss
│   │   │   │   └── ToastProvider.tsx
│   │   │   ├── state
│   │   │   │   └── store.ts
│   │   │   ├── themes
│   │   │   │   └── theme.ts
│   │   │   └── utils
│   │   │       └── helpers.ts
│   │   └── tsconfig.json
│   ├── xmlui-search
│   │   ├── .gitignore
│   │   ├── CHANGELOG.md
│   │   ├── demo
│   │   │   └── Main.xmlui
│   │   ├── index.html
│   │   ├── index.ts
│   │   ├── meta
│   │   │   └── componentsMetadata.ts
│   │   ├── package.json
│   │   ├── src
│   │   │   ├── index.tsx
│   │   │   ├── Search.module.scss
│   │   │   └── Search.tsx
│   │   └── tsconfig.json
│   ├── xmlui-spreadsheet
│   │   ├── .gitignore
│   │   ├── demo
│   │   │   └── Main.xmlui
│   │   ├── index.html
│   │   ├── index.ts
│   │   ├── meta
│   │   │   └── componentsMetadata.ts
│   │   ├── package.json
│   │   ├── src
│   │   │   ├── index.tsx
│   │   │   ├── Spreadsheet.tsx
│   │   │   └── SpreadsheetNative.tsx
│   │   └── tsconfig.json
│   └── xmlui-website-blocks
│       ├── .gitignore
│       ├── CHANGELOG.md
│       ├── demo
│       │   ├── components
│       │   │   ├── HeroBackgroundBreakoutPage.xmlui
│       │   │   ├── HeroBackgroundsPage.xmlui
│       │   │   ├── HeroContentsPage.xmlui
│       │   │   ├── HeroTextAlignPage.xmlui
│       │   │   ├── HeroTextPage.xmlui
│       │   │   └── HeroTonesPage.xmlui
│       │   ├── Main.xmlui
│       │   └── themes
│       │       └── default.ts
│       ├── index.html
│       ├── index.ts
│       ├── meta
│       │   └── componentsMetadata.ts
│       ├── package.json
│       ├── public
│       │   └── resources
│       │       ├── building.jpg
│       │       └── xmlui-logo.svg
│       ├── src
│       │   ├── Carousel
│       │   │   ├── Carousel.module.scss
│       │   │   ├── Carousel.tsx
│       │   │   ├── CarouselContext.tsx
│       │   │   └── CarouselNative.tsx
│       │   ├── FancyButton
│       │   │   ├── FancyButton.module.scss
│       │   │   ├── FancyButton.tsx
│       │   │   └── FancyButton.xmlui
│       │   ├── Hello
│       │   │   ├── Hello.tsx
│       │   │   ├── Hello.xmlui
│       │   │   └── Hello.xmlui.xs
│       │   ├── HeroSection
│       │   │   ├── HeroSection.module.scss
│       │   │   ├── HeroSection.tsx
│       │   │   └── HeroSectionNative.tsx
│       │   ├── index.tsx
│       │   ├── ScrollToTop
│       │   │   ├── ScrollToTop.module.scss
│       │   │   ├── ScrollToTop.tsx
│       │   │   └── ScrollToTopNative.tsx
│       │   └── vite-env.d.ts
│       └── tsconfig.json
├── README.md
├── tools
│   ├── codefence
│   │   └── xmlui-code-fence-docs.md
│   ├── create-app
│   │   ├── .gitignore
│   │   ├── CHANGELOG.md
│   │   ├── create-app.ts
│   │   ├── helpers
│   │   │   ├── copy.ts
│   │   │   ├── get-pkg-manager.ts
│   │   │   ├── git.ts
│   │   │   ├── install.ts
│   │   │   ├── is-folder-empty.ts
│   │   │   ├── is-writeable.ts
│   │   │   ├── make-dir.ts
│   │   │   └── validate-pkg.ts
│   │   ├── index.ts
│   │   ├── package.json
│   │   ├── templates
│   │   │   ├── default
│   │   │   │   └── ts
│   │   │   │       ├── gitignore
│   │   │   │       ├── index.html
│   │   │   │       ├── index.ts
│   │   │   │       ├── public
│   │   │   │       │   ├── mockServiceWorker.js
│   │   │   │       │   ├── resources
│   │   │   │       │   │   ├── favicon.ico
│   │   │   │       │   │   └── xmlui-logo.svg
│   │   │   │       │   └── serve.json
│   │   │   │       └── src
│   │   │   │           ├── components
│   │   │   │           │   ├── ApiAware.xmlui
│   │   │   │           │   ├── Home.xmlui
│   │   │   │           │   ├── IncButton.xmlui
│   │   │   │           │   └── PagePanel.xmlui
│   │   │   │           ├── config.ts
│   │   │   │           └── Main.xmlui
│   │   │   ├── index.ts
│   │   │   └── types.ts
│   │   └── tsconfig.json
│   ├── create-xmlui-hello-world
│   │   ├── index.js
│   │   └── package.json
│   └── vscode
│       ├── .gitignore
│       ├── .vscode
│       │   ├── launch.json
│       │   └── tasks.json
│       ├── .vscodeignore
│       ├── build.sh
│       ├── CHANGELOG.md
│       ├── esbuild.js
│       ├── eslint.config.mjs
│       ├── formatter-docs.md
│       ├── generate-test-sample.sh
│       ├── LICENSE.md
│       ├── package-lock.json
│       ├── package.json
│       ├── README.md
│       ├── resources
│       │   ├── xmlui-logo.png
│       │   └── xmlui-markup-syntax-highlighting.png
│       ├── src
│       │   ├── extension.ts
│       │   └── server.ts
│       ├── syntaxes
│       │   └── xmlui.tmLanguage.json
│       ├── test-samples
│       │   └── sample.xmlui
│       ├── tsconfig.json
│       └── tsconfig.tsbuildinfo
├── turbo.json
└── xmlui
    ├── .gitignore
    ├── bin
    │   ├── bootstrap.js
    │   ├── build-lib.ts
    │   ├── build.ts
    │   ├── index.ts
    │   ├── preview.ts
    │   ├── start.ts
    │   ├── vite-xmlui-plugin.ts
    │   └── viteConfig.ts
    ├── CHANGELOG.md
    ├── conventions
    │   ├── component-qa-checklist.md
    │   ├── copilot-conventions.md
    │   ├── create-xmlui-components.md
    │   ├── mermaid.md
    │   ├── testing-conventions.md
    │   └── xmlui-in-a-nutshell.md
    ├── dev-docs
    │   ├── accessibility.md
    │   ├── build-system.md
    │   ├── build-xmlui.md
    │   ├── component-behaviors.md
    │   ├── containers.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
    │   ├── state-management.md
    │   └── xmlui-repo.md
    ├── package.json
    ├── playwright.config.ts
    ├── scripts
    │   ├── coverage-only.js
    │   ├── e2e-test-summary.js
    │   ├── generate-docs
    │   │   ├── build-downloads-map.mjs
    │   │   ├── build-pages-map.mjs
    │   │   ├── components-config.json
    │   │   ├── configuration-management.mjs
    │   │   ├── constants.mjs
    │   │   ├── create-theme-files.mjs
    │   │   ├── DocsGenerator.mjs
    │   │   ├── error-handling.mjs
    │   │   ├── extensions-config.json
    │   │   ├── folders.mjs
    │   │   ├── generate-summary-files.mjs
    │   │   ├── get-docs.mjs
    │   │   ├── input-handler.mjs
    │   │   ├── logger.mjs
    │   │   ├── logging-standards.mjs
    │   │   ├── MetadataProcessor.mjs
    │   │   ├── pattern-utilities.mjs
    │   │   └── utils.mjs
    │   ├── get-langserver-metadata.mjs
    │   ├── inline-links.mjs
    │   └── README-e2e-summary.md
    ├── src
    │   ├── abstractions
    │   │   ├── _conventions.md
    │   │   ├── ActionDefs.ts
    │   │   ├── AppContextDefs.ts
    │   │   ├── ComponentDefs.ts
    │   │   ├── ContainerDefs.ts
    │   │   ├── ExtensionDefs.ts
    │   │   ├── FunctionDefs.ts
    │   │   ├── RendererDefs.ts
    │   │   ├── scripting
    │   │   │   ├── BlockScope.ts
    │   │   │   ├── Compilation.ts
    │   │   │   ├── LogicalThread.ts
    │   │   │   ├── LoopScope.ts
    │   │   │   ├── modules.ts
    │   │   │   ├── ScriptParserError.ts
    │   │   │   ├── Token.ts
    │   │   │   ├── TryScope.ts
    │   │   │   └── TryScopeExp.ts
    │   │   └── ThemingDefs.ts
    │   ├── components
    │   │   ├── _conventions.md
    │   │   ├── abstractions.ts
    │   │   ├── Accordion
    │   │   │   ├── Accordion.md
    │   │   │   ├── Accordion.module.scss
    │   │   │   ├── Accordion.spec.ts
    │   │   │   ├── Accordion.tsx
    │   │   │   ├── AccordionContext.tsx
    │   │   │   ├── AccordionItem.tsx
    │   │   │   ├── AccordionItemNative.tsx
    │   │   │   └── AccordionNative.tsx
    │   │   ├── Animation
    │   │   │   └── AnimationNative.tsx
    │   │   ├── APICall
    │   │   │   ├── APICall.md
    │   │   │   ├── APICall.spec.ts
    │   │   │   ├── APICall.tsx
    │   │   │   └── APICallNative.tsx
    │   │   ├── App
    │   │   │   ├── App.md
    │   │   │   ├── App.module.scss
    │   │   │   ├── App.spec.ts
    │   │   │   ├── App.tsx
    │   │   │   ├── AppLayoutContext.ts
    │   │   │   ├── AppNative.tsx
    │   │   │   ├── AppStateContext.ts
    │   │   │   ├── doc-resources
    │   │   │   │   ├── condensed-sticky.xmlui
    │   │   │   │   ├── condensed.xmlui
    │   │   │   │   ├── horizontal-sticky.xmlui
    │   │   │   │   ├── horizontal.xmlui
    │   │   │   │   ├── vertical-full-header.xmlui
    │   │   │   │   ├── vertical-sticky.xmlui
    │   │   │   │   └── vertical.xmlui
    │   │   │   ├── IndexerContext.ts
    │   │   │   ├── LinkInfoContext.ts
    │   │   │   ├── SearchContext.tsx
    │   │   │   ├── Sheet.module.scss
    │   │   │   └── Sheet.tsx
    │   │   ├── AppHeader
    │   │   │   ├── AppHeader.md
    │   │   │   ├── AppHeader.module.scss
    │   │   │   ├── AppHeader.spec.ts
    │   │   │   ├── AppHeader.tsx
    │   │   │   └── AppHeaderNative.tsx
    │   │   ├── AppState
    │   │   │   ├── AppState.md
    │   │   │   ├── AppState.spec.ts
    │   │   │   ├── AppState.tsx
    │   │   │   └── AppStateNative.tsx
    │   │   ├── AutoComplete
    │   │   │   ├── AutoComplete.md
    │   │   │   ├── AutoComplete.module.scss
    │   │   │   ├── AutoComplete.spec.ts
    │   │   │   ├── AutoComplete.tsx
    │   │   │   ├── AutoCompleteContext.tsx
    │   │   │   └── AutoCompleteNative.tsx
    │   │   ├── Avatar
    │   │   │   ├── Avatar.md
    │   │   │   ├── Avatar.module.scss
    │   │   │   ├── Avatar.spec.ts
    │   │   │   ├── Avatar.tsx
    │   │   │   └── AvatarNative.tsx
    │   │   ├── Backdrop
    │   │   │   ├── Backdrop.md
    │   │   │   ├── Backdrop.module.scss
    │   │   │   ├── Backdrop.spec.ts
    │   │   │   ├── Backdrop.tsx
    │   │   │   └── BackdropNative.tsx
    │   │   ├── Badge
    │   │   │   ├── Badge.md
    │   │   │   ├── Badge.module.scss
    │   │   │   ├── Badge.spec.ts
    │   │   │   ├── Badge.tsx
    │   │   │   └── BadgeNative.tsx
    │   │   ├── Bookmark
    │   │   │   ├── Bookmark.md
    │   │   │   ├── Bookmark.module.scss
    │   │   │   ├── Bookmark.spec.ts
    │   │   │   ├── Bookmark.tsx
    │   │   │   └── BookmarkNative.tsx
    │   │   ├── Breakout
    │   │   │   ├── Breakout.module.scss
    │   │   │   ├── Breakout.spec.ts
    │   │   │   ├── Breakout.tsx
    │   │   │   └── BreakoutNative.tsx
    │   │   ├── Button
    │   │   │   ├── Button-style.spec.ts
    │   │   │   ├── Button.md
    │   │   │   ├── Button.module.scss
    │   │   │   ├── Button.spec.ts
    │   │   │   ├── Button.tsx
    │   │   │   └── ButtonNative.tsx
    │   │   ├── Card
    │   │   │   ├── Card.md
    │   │   │   ├── Card.module.scss
    │   │   │   ├── Card.spec.ts
    │   │   │   ├── Card.tsx
    │   │   │   └── CardNative.tsx
    │   │   ├── Carousel
    │   │   │   ├── Carousel.md
    │   │   │   ├── Carousel.module.scss
    │   │   │   ├── Carousel.spec.ts
    │   │   │   ├── Carousel.tsx
    │   │   │   ├── CarouselContext.tsx
    │   │   │   ├── CarouselItem.tsx
    │   │   │   ├── CarouselItemNative.tsx
    │   │   │   └── CarouselNative.tsx
    │   │   ├── ChangeListener
    │   │   │   ├── ChangeListener.md
    │   │   │   ├── ChangeListener.spec.ts
    │   │   │   ├── ChangeListener.tsx
    │   │   │   └── ChangeListenerNative.tsx
    │   │   ├── chart-color-schemes.ts
    │   │   ├── Charts
    │   │   │   ├── AreaChart
    │   │   │   │   ├── AreaChart.md
    │   │   │   │   ├── AreaChart.spec.ts
    │   │   │   │   ├── AreaChart.tsx
    │   │   │   │   └── AreaChartNative.tsx
    │   │   │   ├── BarChart
    │   │   │   │   ├── BarChart.md
    │   │   │   │   ├── BarChart.module.scss
    │   │   │   │   ├── BarChart.spec.ts
    │   │   │   │   ├── BarChart.tsx
    │   │   │   │   └── BarChartNative.tsx
    │   │   │   ├── DonutChart
    │   │   │   │   ├── DonutChart.spec.ts
    │   │   │   │   └── DonutChart.tsx
    │   │   │   ├── LabelList
    │   │   │   │   ├── LabelList.spec.ts
    │   │   │   │   ├── LabelList.tsx
    │   │   │   │   ├── LabelListNative.module.scss
    │   │   │   │   └── LabelListNative.tsx
    │   │   │   ├── Legend
    │   │   │   │   ├── Legend.spec.ts
    │   │   │   │   ├── Legend.tsx
    │   │   │   │   └── LegendNative.tsx
    │   │   │   ├── LineChart
    │   │   │   │   ├── LineChart.md
    │   │   │   │   ├── LineChart.module.scss
    │   │   │   │   ├── LineChart.spec.ts
    │   │   │   │   ├── LineChart.tsx
    │   │   │   │   └── LineChartNative.tsx
    │   │   │   ├── PieChart
    │   │   │   │   ├── PieChart.md
    │   │   │   │   ├── PieChart.spec.ts
    │   │   │   │   ├── PieChart.tsx
    │   │   │   │   ├── PieChartNative.module.scss
    │   │   │   │   └── PieChartNative.tsx
    │   │   │   ├── RadarChart
    │   │   │   │   ├── RadarChart.md
    │   │   │   │   ├── RadarChart.spec.ts
    │   │   │   │   ├── RadarChart.tsx
    │   │   │   │   └── RadarChartNative.tsx
    │   │   │   ├── Tooltip
    │   │   │   │   ├── TooltipContent.module.scss
    │   │   │   │   ├── TooltipContent.spec.ts
    │   │   │   │   └── TooltipContent.tsx
    │   │   │   └── utils
    │   │   │       ├── abstractions.ts
    │   │   │       └── ChartProvider.tsx
    │   │   ├── Checkbox
    │   │   │   ├── Checkbox.md
    │   │   │   ├── Checkbox.spec.ts
    │   │   │   └── Checkbox.tsx
    │   │   ├── CodeBlock
    │   │   │   ├── CodeBlock.module.scss
    │   │   │   ├── CodeBlock.spec.ts
    │   │   │   ├── CodeBlock.tsx
    │   │   │   ├── CodeBlockNative.tsx
    │   │   │   └── highlight-code.ts
    │   │   ├── collectedComponentMetadata.ts
    │   │   ├── ColorPicker
    │   │   │   ├── ColorPicker.md
    │   │   │   ├── ColorPicker.module.scss
    │   │   │   ├── ColorPicker.spec.ts
    │   │   │   ├── ColorPicker.tsx
    │   │   │   └── ColorPickerNative.tsx
    │   │   ├── Column
    │   │   │   ├── Column.md
    │   │   │   ├── Column.tsx
    │   │   │   ├── ColumnNative.tsx
    │   │   │   ├── doc-resources
    │   │   │   │   └── list-component-data.js
    │   │   │   └── TableContext.tsx
    │   │   ├── component-utils.ts
    │   │   ├── ComponentProvider.tsx
    │   │   ├── ComponentRegistryContext.tsx
    │   │   ├── container-helpers.tsx
    │   │   ├── ContentSeparator
    │   │   │   ├── ContentSeparator.md
    │   │   │   ├── ContentSeparator.module.scss
    │   │   │   ├── ContentSeparator.spec.ts
    │   │   │   ├── ContentSeparator.tsx
    │   │   │   └── ContentSeparatorNative.tsx
    │   │   ├── DataSource
    │   │   │   ├── DataSource.md
    │   │   │   └── DataSource.tsx
    │   │   ├── DateInput
    │   │   │   ├── DateInput.md
    │   │   │   ├── DateInput.module.scss
    │   │   │   ├── DateInput.spec.ts
    │   │   │   ├── DateInput.tsx
    │   │   │   └── DateInputNative.tsx
    │   │   ├── DatePicker
    │   │   │   ├── DatePicker.md
    │   │   │   ├── DatePicker.module.scss
    │   │   │   ├── DatePicker.spec.ts
    │   │   │   ├── DatePicker.tsx
    │   │   │   └── DatePickerNative.tsx
    │   │   ├── DropdownMenu
    │   │   │   ├── DropdownMenu.md
    │   │   │   ├── DropdownMenu.module.scss
    │   │   │   ├── DropdownMenu.spec.ts
    │   │   │   ├── DropdownMenu.tsx
    │   │   │   ├── DropdownMenuNative.tsx
    │   │   │   ├── MenuItem.md
    │   │   │   └── SubMenuItem.md
    │   │   ├── EmojiSelector
    │   │   │   ├── EmojiSelector.md
    │   │   │   ├── EmojiSelector.spec.ts
    │   │   │   ├── EmojiSelector.tsx
    │   │   │   └── EmojiSelectorNative.tsx
    │   │   ├── ExpandableItem
    │   │   │   ├── ExpandableItem.module.scss
    │   │   │   ├── ExpandableItem.spec.ts
    │   │   │   ├── ExpandableItem.tsx
    │   │   │   └── ExpandableItemNative.tsx
    │   │   ├── FileInput
    │   │   │   ├── FileInput.md
    │   │   │   ├── FileInput.module.scss
    │   │   │   ├── FileInput.spec.ts
    │   │   │   ├── FileInput.tsx
    │   │   │   └── FileInputNative.tsx
    │   │   ├── FileUploadDropZone
    │   │   │   ├── FileUploadDropZone.md
    │   │   │   ├── FileUploadDropZone.module.scss
    │   │   │   ├── FileUploadDropZone.spec.ts
    │   │   │   ├── FileUploadDropZone.tsx
    │   │   │   └── FileUploadDropZoneNative.tsx
    │   │   ├── FlowLayout
    │   │   │   ├── FlowLayout.md
    │   │   │   ├── FlowLayout.module.scss
    │   │   │   ├── FlowLayout.spec.ts
    │   │   │   ├── FlowLayout.spec.ts-snapshots
    │   │   │   │   └── Edge-cases-boxShadow-is-not-clipped-1-non-smoke-darwin.png
    │   │   │   ├── FlowLayout.tsx
    │   │   │   └── FlowLayoutNative.tsx
    │   │   ├── Footer
    │   │   │   ├── Footer.md
    │   │   │   ├── Footer.module.scss
    │   │   │   ├── Footer.spec.ts
    │   │   │   ├── Footer.tsx
    │   │   │   └── FooterNative.tsx
    │   │   ├── Form
    │   │   │   ├── Form.md
    │   │   │   ├── Form.module.scss
    │   │   │   ├── Form.spec.ts
    │   │   │   ├── Form.tsx
    │   │   │   ├── formActions.ts
    │   │   │   ├── FormContext.ts
    │   │   │   └── FormNative.tsx
    │   │   ├── FormItem
    │   │   │   ├── FormItem.md
    │   │   │   ├── FormItem.module.scss
    │   │   │   ├── FormItem.spec.ts
    │   │   │   ├── FormItem.tsx
    │   │   │   ├── FormItemNative.tsx
    │   │   │   ├── HelperText.module.scss
    │   │   │   ├── HelperText.tsx
    │   │   │   ├── ItemWithLabel.tsx
    │   │   │   └── Validations.ts
    │   │   ├── FormSection
    │   │   │   ├── FormSection.md
    │   │   │   ├── FormSection.ts
    │   │   │   └── FormSection.xmlui
    │   │   ├── Fragment
    │   │   │   ├── Fragment.spec.ts
    │   │   │   └── Fragment.tsx
    │   │   ├── Heading
    │   │   │   ├── abstractions.ts
    │   │   │   ├── H1.md
    │   │   │   ├── H1.spec.ts
    │   │   │   ├── H2.md
    │   │   │   ├── H2.spec.ts
    │   │   │   ├── H3.md
    │   │   │   ├── H3.spec.ts
    │   │   │   ├── H4.md
    │   │   │   ├── H4.spec.ts
    │   │   │   ├── H5.md
    │   │   │   ├── H5.spec.ts
    │   │   │   ├── H6.md
    │   │   │   ├── H6.spec.ts
    │   │   │   ├── Heading.md
    │   │   │   ├── Heading.module.scss
    │   │   │   ├── Heading.spec.ts
    │   │   │   ├── Heading.tsx
    │   │   │   └── HeadingNative.tsx
    │   │   ├── HoverCard
    │   │   │   ├── HoverCard.tsx
    │   │   │   └── HovercardNative.tsx
    │   │   ├── HtmlTags
    │   │   │   ├── HtmlTags.module.scss
    │   │   │   ├── HtmlTags.spec.ts
    │   │   │   └── HtmlTags.tsx
    │   │   ├── Icon
    │   │   │   ├── AdmonitionDanger.tsx
    │   │   │   ├── AdmonitionInfo.tsx
    │   │   │   ├── AdmonitionNote.tsx
    │   │   │   ├── AdmonitionTip.tsx
    │   │   │   ├── AdmonitionWarning.tsx
    │   │   │   ├── ApiIcon.tsx
    │   │   │   ├── ArrowDropDown.module.scss
    │   │   │   ├── ArrowDropDown.tsx
    │   │   │   ├── ArrowDropUp.module.scss
    │   │   │   ├── ArrowDropUp.tsx
    │   │   │   ├── ArrowLeft.module.scss
    │   │   │   ├── ArrowLeft.tsx
    │   │   │   ├── ArrowRight.module.scss
    │   │   │   ├── ArrowRight.tsx
    │   │   │   ├── Attach.tsx
    │   │   │   ├── Binding.module.scss
    │   │   │   ├── Binding.tsx
    │   │   │   ├── BoardIcon.tsx
    │   │   │   ├── BoxIcon.tsx
    │   │   │   ├── CheckIcon.tsx
    │   │   │   ├── ChevronDownIcon.tsx
    │   │   │   ├── ChevronLeft.tsx
    │   │   │   ├── ChevronRight.tsx
    │   │   │   ├── ChevronUpIcon.tsx
    │   │   │   ├── CodeFileIcon.tsx
    │   │   │   ├── CodeSandbox.tsx
    │   │   │   ├── CompactListIcon.tsx
    │   │   │   ├── ContentCopyIcon.tsx
    │   │   │   ├── DarkToLightIcon.tsx
    │   │   │   ├── DatabaseIcon.module.scss
    │   │   │   ├── DatabaseIcon.tsx
    │   │   │   ├── DocFileIcon.tsx
    │   │   │   ├── DocIcon.tsx
    │   │   │   ├── DotMenuHorizontalIcon.tsx
    │   │   │   ├── DotMenuIcon.tsx
    │   │   │   ├── EmailIcon.tsx
    │   │   │   ├── EmptyFolderIcon.tsx
    │   │   │   ├── ErrorIcon.tsx
    │   │   │   ├── ExpressionIcon.tsx
    │   │   │   ├── FillPlusCricleIcon.tsx
    │   │   │   ├── FilterIcon.tsx
    │   │   │   ├── FolderIcon.tsx
    │   │   │   ├── GlobeIcon.tsx
    │   │   │   ├── HomeIcon.tsx
    │   │   │   ├── HyperLinkIcon.tsx
    │   │   │   ├── Icon.md
    │   │   │   ├── Icon.module.scss
    │   │   │   ├── Icon.spec.ts
    │   │   │   ├── Icon.tsx
    │   │   │   ├── IconNative.tsx
    │   │   │   ├── ImageFileIcon.tsx
    │   │   │   ├── Inspect.tsx
    │   │   │   ├── LightToDark.tsx
    │   │   │   ├── LinkIcon.tsx
    │   │   │   ├── ListIcon.tsx
    │   │   │   ├── LooseListIcon.tsx
    │   │   │   ├── MoonIcon.tsx
    │   │   │   ├── MoreOptionsIcon.tsx
    │   │   │   ├── NoSortIcon.tsx
    │   │   │   ├── PDFIcon.tsx
    │   │   │   ├── PenIcon.tsx
    │   │   │   ├── PhoneIcon.tsx
    │   │   │   ├── PhotoIcon.tsx
    │   │   │   ├── PlusIcon.tsx
    │   │   │   ├── SearchIcon.tsx
    │   │   │   ├── ShareIcon.tsx
    │   │   │   ├── SortAscendingIcon.tsx
    │   │   │   ├── SortDescendingIcon.tsx
    │   │   │   ├── StarsIcon.tsx
    │   │   │   ├── SunIcon.tsx
    │   │   │   ├── svg
    │   │   │   │   ├── admonition_danger.svg
    │   │   │   │   ├── admonition_info.svg
    │   │   │   │   ├── admonition_note.svg
    │   │   │   │   ├── admonition_tip.svg
    │   │   │   │   ├── admonition_warning.svg
    │   │   │   │   ├── api.svg
    │   │   │   │   ├── arrow-dropdown.svg
    │   │   │   │   ├── arrow-left.svg
    │   │   │   │   ├── arrow-right.svg
    │   │   │   │   ├── arrow-up.svg
    │   │   │   │   ├── attach.svg
    │   │   │   │   ├── binding.svg
    │   │   │   │   ├── box.svg
    │   │   │   │   ├── bulb.svg
    │   │   │   │   ├── code-file.svg
    │   │   │   │   ├── code-sandbox.svg
    │   │   │   │   ├── dark_to_light.svg
    │   │   │   │   ├── database.svg
    │   │   │   │   ├── doc.svg
    │   │   │   │   ├── empty-folder.svg
    │   │   │   │   ├── expression.svg
    │   │   │   │   ├── eye-closed.svg
    │   │   │   │   ├── eye-dark.svg
    │   │   │   │   ├── eye.svg
    │   │   │   │   ├── file-text.svg
    │   │   │   │   ├── filter.svg
    │   │   │   │   ├── folder.svg
    │   │   │   │   ├── img.svg
    │   │   │   │   ├── inspect.svg
    │   │   │   │   ├── light_to_dark.svg
    │   │   │   │   ├── moon.svg
    │   │   │   │   ├── pdf.svg
    │   │   │   │   ├── photo.svg
    │   │   │   │   ├── share.svg
    │   │   │   │   ├── stars.svg
    │   │   │   │   ├── sun.svg
    │   │   │   │   ├── trending-down.svg
    │   │   │   │   ├── trending-level.svg
    │   │   │   │   ├── trending-up.svg
    │   │   │   │   ├── txt.svg
    │   │   │   │   ├── unknown-file.svg
    │   │   │   │   ├── unlink.svg
    │   │   │   │   └── xls.svg
    │   │   │   ├── TableDeleteColumnIcon.tsx
    │   │   │   ├── TableDeleteRowIcon.tsx
    │   │   │   ├── TableInsertColumnIcon.tsx
    │   │   │   ├── TableInsertRowIcon.tsx
    │   │   │   ├── TrashIcon.tsx
    │   │   │   ├── TrendingDownIcon.tsx
    │   │   │   ├── TrendingLevelIcon.tsx
    │   │   │   ├── TrendingUpIcon.tsx
    │   │   │   ├── TxtIcon.tsx
    │   │   │   ├── UnknownFileIcon.tsx
    │   │   │   ├── UnlinkIcon.tsx
    │   │   │   ├── UserIcon.tsx
    │   │   │   ├── WarningIcon.tsx
    │   │   │   └── XlsIcon.tsx
    │   │   ├── IconProvider.tsx
    │   │   ├── IconRegistryContext.tsx
    │   │   ├── IFrame
    │   │   │   ├── IFrame.md
    │   │   │   ├── IFrame.module.scss
    │   │   │   ├── IFrame.spec.ts
    │   │   │   ├── IFrame.tsx
    │   │   │   └── IFrameNative.tsx
    │   │   ├── Image
    │   │   │   ├── Image.md
    │   │   │   ├── Image.module.scss
    │   │   │   ├── Image.spec.ts
    │   │   │   ├── Image.tsx
    │   │   │   └── ImageNative.tsx
    │   │   ├── Input
    │   │   │   ├── index.ts
    │   │   │   ├── InputAdornment.module.scss
    │   │   │   ├── InputAdornment.tsx
    │   │   │   ├── InputDivider.module.scss
    │   │   │   ├── InputDivider.tsx
    │   │   │   ├── InputLabel.module.scss
    │   │   │   ├── InputLabel.tsx
    │   │   │   ├── PartialInput.module.scss
    │   │   │   └── PartialInput.tsx
    │   │   ├── InspectButton
    │   │   │   ├── InspectButton.module.scss
    │   │   │   └── InspectButton.tsx
    │   │   ├── Items
    │   │   │   ├── Items.md
    │   │   │   ├── Items.spec.ts
    │   │   │   ├── Items.tsx
    │   │   │   └── ItemsNative.tsx
    │   │   ├── Link
    │   │   │   ├── Link.md
    │   │   │   ├── Link.module.scss
    │   │   │   ├── Link.spec.ts
    │   │   │   ├── Link.tsx
    │   │   │   └── LinkNative.tsx
    │   │   ├── List
    │   │   │   ├── doc-resources
    │   │   │   │   └── list-component-data.js
    │   │   │   ├── List.md
    │   │   │   ├── List.module.scss
    │   │   │   ├── List.spec.ts
    │   │   │   ├── List.tsx
    │   │   │   └── ListNative.tsx
    │   │   ├── Logo
    │   │   │   ├── doc-resources
    │   │   │   │   └── xmlui-logo.svg
    │   │   │   ├── Logo.md
    │   │   │   ├── Logo.tsx
    │   │   │   └── LogoNative.tsx
    │   │   ├── Markdown
    │   │   │   ├── CodeText.module.scss
    │   │   │   ├── CodeText.tsx
    │   │   │   ├── Markdown.md
    │   │   │   ├── Markdown.module.scss
    │   │   │   ├── Markdown.spec.ts
    │   │   │   ├── Markdown.tsx
    │   │   │   ├── MarkdownNative.tsx
    │   │   │   ├── parse-binding-expr.ts
    │   │   │   └── utils.ts
    │   │   ├── metadata-helpers.ts
    │   │   ├── ModalDialog
    │   │   │   ├── ConfirmationModalContextProvider.tsx
    │   │   │   ├── Dialog.module.scss
    │   │   │   ├── Dialog.tsx
    │   │   │   ├── ModalDialog.md
    │   │   │   ├── ModalDialog.module.scss
    │   │   │   ├── ModalDialog.spec.ts
    │   │   │   ├── ModalDialog.tsx
    │   │   │   ├── ModalDialogNative.tsx
    │   │   │   └── ModalVisibilityContext.tsx
    │   │   ├── NavGroup
    │   │   │   ├── NavGroup.md
    │   │   │   ├── NavGroup.module.scss
    │   │   │   ├── NavGroup.spec.ts
    │   │   │   ├── NavGroup.tsx
    │   │   │   ├── NavGroupContext.ts
    │   │   │   └── NavGroupNative.tsx
    │   │   ├── NavLink
    │   │   │   ├── NavLink.md
    │   │   │   ├── NavLink.module.scss
    │   │   │   ├── NavLink.spec.ts
    │   │   │   ├── NavLink.tsx
    │   │   │   └── NavLinkNative.tsx
    │   │   ├── NavPanel
    │   │   │   ├── NavPanel.md
    │   │   │   ├── NavPanel.module.scss
    │   │   │   ├── NavPanel.spec.ts
    │   │   │   ├── NavPanel.tsx
    │   │   │   └── NavPanelNative.tsx
    │   │   ├── NestedApp
    │   │   │   ├── AppWithCodeView.module.scss
    │   │   │   ├── AppWithCodeView.tsx
    │   │   │   ├── AppWithCodeViewNative.tsx
    │   │   │   ├── defaultProps.tsx
    │   │   │   ├── logo.svg
    │   │   │   ├── NestedApp.module.scss
    │   │   │   ├── NestedApp.tsx
    │   │   │   ├── NestedAppNative.tsx
    │   │   │   ├── Tooltip.module.scss
    │   │   │   ├── Tooltip.tsx
    │   │   │   └── utils.ts
    │   │   ├── NoResult
    │   │   │   ├── NoResult.md
    │   │   │   ├── NoResult.module.scss
    │   │   │   ├── NoResult.spec.ts
    │   │   │   ├── NoResult.tsx
    │   │   │   └── NoResultNative.tsx
    │   │   ├── NumberBox
    │   │   │   ├── numberbox-abstractions.ts
    │   │   │   ├── NumberBox.md
    │   │   │   ├── NumberBox.module.scss
    │   │   │   ├── NumberBox.spec.ts
    │   │   │   ├── NumberBox.tsx
    │   │   │   └── NumberBoxNative.tsx
    │   │   ├── Option
    │   │   │   ├── Option.md
    │   │   │   ├── Option.spec.ts
    │   │   │   ├── Option.tsx
    │   │   │   ├── OptionNative.tsx
    │   │   │   └── OptionTypeProvider.tsx
    │   │   ├── PageMetaTitle
    │   │   │   ├── PageMetaTilteNative.tsx
    │   │   │   ├── PageMetaTitle.md
    │   │   │   ├── PageMetaTitle.spec.ts
    │   │   │   └── PageMetaTitle.tsx
    │   │   ├── Pages
    │   │   │   ├── Page.md
    │   │   │   ├── Pages.md
    │   │   │   ├── Pages.module.scss
    │   │   │   ├── Pages.tsx
    │   │   │   └── PagesNative.tsx
    │   │   ├── Pagination
    │   │   │   ├── Pagination.md
    │   │   │   ├── Pagination.module.scss
    │   │   │   ├── Pagination.spec.ts
    │   │   │   ├── Pagination.tsx
    │   │   │   └── PaginationNative.tsx
    │   │   ├── PositionedContainer
    │   │   │   ├── PositionedContainer.module.scss
    │   │   │   ├── PositionedContainer.tsx
    │   │   │   └── PositionedContainerNative.tsx
    │   │   ├── ProfileMenu
    │   │   │   ├── ProfileMenu.module.scss
    │   │   │   └── ProfileMenu.tsx
    │   │   ├── ProgressBar
    │   │   │   ├── ProgressBar.md
    │   │   │   ├── ProgressBar.module.scss
    │   │   │   ├── ProgressBar.spec.ts
    │   │   │   ├── ProgressBar.tsx
    │   │   │   └── ProgressBarNative.tsx
    │   │   ├── Queue
    │   │   │   ├── Queue.md
    │   │   │   ├── Queue.spec.ts
    │   │   │   ├── Queue.tsx
    │   │   │   ├── queueActions.ts
    │   │   │   └── QueueNative.tsx
    │   │   ├── RadioGroup
    │   │   │   ├── RadioGroup.md
    │   │   │   ├── RadioGroup.module.scss
    │   │   │   ├── RadioGroup.spec.ts
    │   │   │   ├── RadioGroup.tsx
    │   │   │   ├── RadioGroupNative.tsx
    │   │   │   ├── RadioItem.tsx
    │   │   │   └── RadioItemNative.tsx
    │   │   ├── RealTimeAdapter
    │   │   │   ├── RealTimeAdapter.tsx
    │   │   │   └── RealTimeAdapterNative.tsx
    │   │   ├── Redirect
    │   │   │   ├── Redirect.md
    │   │   │   ├── Redirect.spec.ts
    │   │   │   └── Redirect.tsx
    │   │   ├── ResponsiveBar
    │   │   │   ├── README.md
    │   │   │   ├── ResponsiveBar.md
    │   │   │   ├── ResponsiveBar.module.scss
    │   │   │   ├── ResponsiveBar.spec.ts
    │   │   │   ├── ResponsiveBar.tsx
    │   │   │   └── ResponsiveBarNative.tsx
    │   │   ├── Select
    │   │   │   ├── HiddenOption.tsx
    │   │   │   ├── MultiSelectOption.tsx
    │   │   │   ├── OptionContext.ts
    │   │   │   ├── Select.md
    │   │   │   ├── Select.module.scss
    │   │   │   ├── Select.spec.ts
    │   │   │   ├── Select.tsx
    │   │   │   ├── SelectContext.tsx
    │   │   │   ├── SelectNative.tsx
    │   │   │   ├── SelectOption.tsx
    │   │   │   └── SimpleSelect.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
    │   │   │   ├── compound-utils.ts
    │   │   │   ├── css-utils.ts
    │   │   │   ├── DataLoaderQueryKeyGenerator.ts
    │   │   │   ├── date-utils.ts
    │   │   │   ├── extractParam.ts
    │   │   │   ├── hooks.tsx
    │   │   │   ├── LruCache.ts
    │   │   │   ├── mergeProps.ts
    │   │   │   ├── misc.ts
    │   │   │   ├── request-params.ts
    │   │   │   ├── statementUtils.ts
    │   │   │   └── treeUtils.ts
    │   │   └── xmlui-parser.ts
    │   ├── index-standalone.ts
    │   ├── index.scss
    │   ├── index.ts
    │   ├── language-server
    │   │   ├── server-common.ts
    │   │   ├── server-web-worker.ts
    │   │   ├── server.ts
    │   │   ├── services
    │   │   │   ├── common
    │   │   │   │   ├── docs-generation.ts
    │   │   │   │   ├── lsp-utils.ts
    │   │   │   │   ├── metadata-utils.ts
    │   │   │   │   └── syntax-node-utilities.ts
    │   │   │   ├── completion.ts
    │   │   │   ├── diagnostic.ts
    │   │   │   ├── format.ts
    │   │   │   └── hover.ts
    │   │   └── xmlui-metadata-generated.mjs
    │   ├── logging
    │   │   ├── LoggerContext.tsx
    │   │   ├── LoggerInitializer.tsx
    │   │   ├── LoggerService.ts
    │   │   └── xmlui.ts
    │   ├── logo.svg
    │   ├── parsers
    │   │   ├── common
    │   │   │   ├── GenericToken.ts
    │   │   │   ├── InputStream.ts
    │   │   │   └── utils.ts
    │   │   ├── scripting
    │   │   │   ├── code-behind-collect.ts
    │   │   │   ├── Lexer.ts
    │   │   │   ├── modules.ts
    │   │   │   ├── Parser.ts
    │   │   │   ├── ParserError.ts
    │   │   │   ├── ScriptingNodeTypes.ts
    │   │   │   ├── TokenTrait.ts
    │   │   │   ├── TokenType.ts
    │   │   │   └── tree-visitor.ts
    │   │   ├── style-parser
    │   │   │   ├── errors.ts
    │   │   │   ├── source-tree.ts
    │   │   │   ├── StyleInputStream.ts
    │   │   │   ├── StyleLexer.ts
    │   │   │   ├── StyleParser.ts
    │   │   │   └── tokens.ts
    │   │   └── xmlui-parser
    │   │       ├── CharacterCodes.ts
    │   │       ├── diagnostics.ts
    │   │       ├── fileExtensions.ts
    │   │       ├── index.ts
    │   │       ├── lint.ts
    │   │       ├── parser.ts
    │   │       ├── ParserError.ts
    │   │       ├── scanner.ts
    │   │       ├── syntax-kind.ts
    │   │       ├── syntax-node.ts
    │   │       ├── transform.ts
    │   │       ├── utils.ts
    │   │       ├── xmlui-serializer.ts
    │   │       └── xmlui-tree.ts
    │   ├── react-app-env.d.ts
    │   ├── syntax
    │   │   ├── monaco
    │   │   │   ├── grammar.monacoLanguage.ts
    │   │   │   ├── index.ts
    │   │   │   ├── xmlui-dark.ts
    │   │   │   ├── xmlui-light.ts
    │   │   │   └── xmluiscript.monacoLanguage.ts
    │   │   └── textMate
    │   │       ├── index.ts
    │   │       ├── xmlui-dark.json
    │   │       ├── xmlui-light.json
    │   │       ├── xmlui.json
    │   │       └── xmlui.tmLanguage.json
    │   ├── testing
    │   │   ├── assertions.ts
    │   │   ├── component-test-helpers.ts
    │   │   ├── ComponentDrivers.ts
    │   │   ├── drivers
    │   │   │   ├── DateInputDriver.ts
    │   │   │   ├── ModalDialogDriver.ts
    │   │   │   ├── NumberBoxDriver.ts
    │   │   │   ├── TextBoxDriver.ts
    │   │   │   ├── TimeInputDriver.ts
    │   │   │   ├── TimerDriver.ts
    │   │   │   └── TreeDriver.ts
    │   │   ├── fixtures.ts
    │   │   ├── infrastructure
    │   │   │   ├── index.html
    │   │   │   ├── main.tsx
    │   │   │   ├── public
    │   │   │   │   ├── mockServiceWorker.js
    │   │   │   │   ├── resources
    │   │   │   │   │   ├── bell.svg
    │   │   │   │   │   ├── box.svg
    │   │   │   │   │   ├── doc.svg
    │   │   │   │   │   ├── eye.svg
    │   │   │   │   │   ├── flower-640x480.jpg
    │   │   │   │   │   ├── sun.svg
    │   │   │   │   │   ├── test-image-100x100.jpg
    │   │   │   │   │   └── txt.svg
    │   │   │   │   └── serve.json
    │   │   │   └── TestBed.tsx
    │   │   └── themed-app-test-helpers.ts
    │   └── vite-env.d.ts
    ├── tests
    │   ├── components
    │   │   ├── CodeBlock
    │   │   │   └── hightlight-code.test.ts
    │   │   ├── playground-pattern.test.ts
    │   │   └── Tree
    │   │       └── Tree-states.test.ts
    │   ├── components-core
    │   │   ├── abstractions
    │   │   │   └── treeAbstractions.test.ts
    │   │   ├── container
    │   │   │   └── buildProxy.test.ts
    │   │   ├── interception
    │   │   │   ├── orderBy.test.ts
    │   │   │   ├── ReadOnlyCollection.test.ts
    │   │   │   └── request-param-converter.test.ts
    │   │   ├── scripts-runner
    │   │   │   ├── AttributeValueParser.test.ts
    │   │   │   ├── eval-tree-arrow-async.test.ts
    │   │   │   ├── eval-tree-arrow.test.ts
    │   │   │   ├── eval-tree-func-decl-async.test.ts
    │   │   │   ├── eval-tree-func-decl.test.ts
    │   │   │   ├── eval-tree-pre-post.test.ts
    │   │   │   ├── eval-tree-regression.test.ts
    │   │   │   ├── eval-tree.test.ts
    │   │   │   ├── function-proxy.test.ts
    │   │   │   ├── parser-regression.test.ts
    │   │   │   ├── process-event.test.ts
    │   │   │   ├── process-function.test.ts
    │   │   │   ├── process-implicit-context.test.ts
    │   │   │   ├── process-statement-asgn.test.ts
    │   │   │   ├── process-statement-destruct.test.ts
    │   │   │   ├── process-statement-regs.test.ts
    │   │   │   ├── process-statement-sync.test.ts
    │   │   │   ├── process-statement.test.ts
    │   │   │   ├── process-switch-sync.test.ts
    │   │   │   ├── process-switch.test.ts
    │   │   │   ├── process-try-sync.test.ts
    │   │   │   ├── process-try.test.ts
    │   │   │   └── test-helpers.ts
    │   │   ├── test-metadata-handler.ts
    │   │   ├── theming
    │   │   │   ├── border-segments.test.ts
    │   │   │   ├── component-layout.resolver.test.ts
    │   │   │   ├── layout-property-parser.test.ts
    │   │   │   ├── layout-resolver.test.ts
    │   │   │   ├── layout-resolver2.test.ts
    │   │   │   ├── layout-vp-override.test.ts
    │   │   │   └── padding-segments.test.ts
    │   │   └── utils
    │   │       ├── date-utils.test.ts
    │   │       ├── format-human-elapsed-time.test.ts
    │   │       └── LruCache.test.ts
    │   ├── language-server
    │   │   ├── completion.test.ts
    │   │   ├── format.test.ts
    │   │   ├── hover.test.ts
    │   │   └── mockData.ts
    │   └── parsers
    │       ├── common
    │       │   └── input-stream.test.ts
    │       ├── markdown
    │       │   └── parse-binding-expression.test.ts
    │       ├── parameter-parser.test.ts
    │       ├── paremeter-parser.test.ts
    │       ├── scripting
    │       │   ├── eval-tree-arrow.test.ts
    │       │   ├── eval-tree-pre-post.test.ts
    │       │   ├── eval-tree.test.ts
    │       │   ├── function-proxy.test.ts
    │       │   ├── lexer-literals.test.ts
    │       │   ├── lexer-misc.test.ts
    │       │   ├── module-parse.test.ts
    │       │   ├── parser-arrow.test.ts
    │       │   ├── parser-assignments.test.ts
    │       │   ├── parser-binary.test.ts
    │       │   ├── parser-destructuring.test.ts
    │       │   ├── parser-errors.test.ts
    │       │   ├── parser-expressions.test.ts
    │       │   ├── parser-function.test.ts
    │       │   ├── parser-literals.test.ts
    │       │   ├── parser-primary.test.ts
    │       │   ├── parser-regex.test.ts
    │       │   ├── parser-statements.test.ts
    │       │   ├── parser-unary.test.ts
    │       │   ├── process-event.test.ts
    │       │   ├── process-implicit-context.test.ts
    │       │   ├── process-statement-asgn.test.ts
    │       │   ├── process-statement-destruct.test.ts
    │       │   ├── process-statement-regs.test.ts
    │       │   ├── process-statement-sync.test.ts
    │       │   ├── process-statement.test.ts
    │       │   ├── process-switch-sync.test.ts
    │       │   ├── process-switch.test.ts
    │       │   ├── process-try-sync.test.ts
    │       │   ├── process-try.test.ts
    │       │   ├── simplify-expression.test.ts
    │       │   ├── statement-hooks.test.ts
    │       │   └── test-helpers.ts
    │       ├── style-parser
    │       │   ├── generateHvarChain.test.ts
    │       │   ├── parseHVar.test.ts
    │       │   ├── parser.test.ts
    │       │   └── tokens.test.ts
    │       └── xmlui
    │           ├── lint.test.ts
    │           ├── parser.test.ts
    │           ├── scanner.test.ts
    │           ├── transform.attr.test.ts
    │           ├── transform.circular.test.ts
    │           ├── transform.element.test.ts
    │           ├── transform.errors.test.ts
    │           ├── transform.escape.test.ts
    │           ├── transform.regression.test.ts
    │           ├── transform.script.test.ts
    │           ├── transform.test.ts
    │           └── xmlui.ts
    ├── tests-e2e
    │   ├── api-bound-component-regression.spec.ts
    │   ├── api-call-as-extracted-component.spec.ts
    │   ├── assign-to-object-or-array-regression.spec.ts
    │   ├── binding-regression.spec.ts
    │   ├── children-as-template-context-vars.spec.ts
    │   ├── compound-component.spec.ts
    │   ├── context-vars-regression.spec.ts
    │   ├── data-bindings.spec.ts
    │   ├── datasource-and-api-usage-in-var.spec.ts
    │   ├── datasource-direct-binding.spec.ts
    │   ├── datasource-onLoaded-regression.spec.ts
    │   ├── modify-array-item-regression.spec.ts
    │   ├── namespaces.spec.ts
    │   ├── push-to-array-regression.spec.ts
    │   ├── screen-breakpoints.spec.ts
    │   ├── scripting.spec.ts
    │   ├── state-scope-in-pages.spec.ts
    │   └── state-var-scopes.spec.ts
    ├── tsconfig.bin.json
    ├── tsconfig.json
    ├── tsconfig.node.json
    ├── vite.config.ts
    └── vitest.config.ts
```

# Files

--------------------------------------------------------------------------------
/xmlui/src/components/Tree/TreeNative.tsx:
--------------------------------------------------------------------------------

```typescript
import { type ReactNode, memo, useCallback, useEffect, useMemo, useState, useRef } from "react";
import { Virtualizer, type VirtualizerHandle } from "virtua";
import classnames from "classnames";
import Icon from "../Icon/IconNative";
import { Spinner } from "../Spinner/SpinnerNative";

import styles from "./TreeComponent.module.scss";

import type {
  FlatTreeNode,
  TreeNode,
  UnPackedTreeData,
  TreeFieldConfig,
  TreeSelectionEvent,
  TreeDataFormat,
  DefaultExpansion,
  NodeLoadingState,
  FlatTreeNodeWithState,
} from "../../components-core/abstractions/treeAbstractions";
import { toFlatTree, flatToNative, hierarchyToNative } from "../../components-core/utils/treeUtils";

/**
 * Describes the data attached to a particular tree row
 */
interface RowContext {
  nodes: FlatTreeNode[];
  toggleNode: (node: FlatTreeNode) => void;
  selectedId: string | number | undefined;
  itemRenderer: (item: any) => ReactNode;
  itemClickExpands: boolean;
  onItemClick?: (item: FlatTreeNode) => void;
  onSelection: (node: FlatTreeNode) => void;
  focusedIndex: number;
  onKeyDown: (e: React.KeyboardEvent) => void;
  treeContainerRef: React.RefObject<HTMLDivElement>;
  iconCollapsed: string;
  iconExpanded: string;
  iconSize: string;
  animateExpand: boolean;
  expandRotation: number;
}

interface TreeRowProps {
  index: number;
  data: RowContext;
}

const TreeRow = memo(({ index, data }: TreeRowProps) => {
  const {
    nodes,
    toggleNode,
    selectedId,
    itemRenderer,
    itemClickExpands,
    onItemClick,
    onSelection,
    focusedIndex,
    treeContainerRef,
    iconCollapsed,
    iconExpanded,
    iconSize,
    animateExpand,
    expandRotation,
  } = data;
  const treeItem = nodes[index];
  const isFocused = focusedIndex === index && focusedIndex >= 0;

  // Use string comparison to handle type mismatches between selectedId and treeItem.key
  const isSelected = String(selectedId) === String(treeItem.key);

  const onToggleNode = useCallback(
    (e: React.MouseEvent) => {
      e.stopPropagation();
      // Prevent toggling if node is in loading state
      const nodeWithState = treeItem as FlatTreeNodeWithState;
      if (nodeWithState.loadingState === "loading") {
        return;
      }
      toggleNode(treeItem);
    },
    [toggleNode, treeItem],
  );

  const onItemMouseDownHandler = useCallback(
    (e: React.MouseEvent) => {
      // Handle selection immediately on mouse down for immediate visual feedback
      if (treeItem.selectable) {
        onSelection(treeItem);
        // Ensure tree container maintains focus after mouse selection
        setTimeout(() => {
          treeContainerRef.current?.focus();
        }, 0);
      }
    },
    [onSelection, treeItem, treeContainerRef],
  );

  const onItemClickHandler = useCallback(
    (e: React.MouseEvent) => {
      // Selection is already handled in onMouseDown, so we skip it here

      // Call optional onItemClick callback
      if (onItemClick) {
        onItemClick(treeItem);
      }

      // If itemClickExpands is enabled and item has children, also toggle
      // But prevent toggling if node is in loading state
      const nodeWithState = treeItem as FlatTreeNodeWithState;
      if (itemClickExpands && treeItem.hasChildren && nodeWithState.loadingState !== "loading") {
        toggleNode(treeItem);
      }
    },
    [onItemClick, itemClickExpands, treeItem, toggleNode],
  );

  // Get loading state for styling and interaction
  const nodeWithState = treeItem as FlatTreeNodeWithState;
  const isLoading = nodeWithState.loadingState === "loading";

  return (
    <div style={{ width: "100%", display: "flex" }}>
      <div
        className={classnames(styles.rowWrapper, {
          [styles.selected]: isSelected,
          [styles.focused]: isFocused,
        })}
        role="treeitem"
        aria-level={treeItem.depth + 1}
        aria-expanded={treeItem.hasChildren ? treeItem.isExpanded : undefined}
        aria-selected={isSelected}
        aria-label={treeItem.displayName}
        aria-busy={isLoading}
        tabIndex={isFocused ? 0 : -1}
      >
        <div
          onClick={onToggleNode}
          className={styles.gutter}
          style={{ cursor: isLoading ? "default" : "pointer" }}
        >
          <div style={{ width: treeItem.depth * 10 }} className={styles.depthPlaceholder} />
          <div
            className={classnames(styles.toggleWrapper, {
              [styles.expanded]: treeItem.isExpanded,
              [styles.hidden]: !treeItem.hasChildren,
            })}
          >
            {treeItem.hasChildren && (
              <>
                {/* Show loading spinner when node is loading */}
                {(treeItem as FlatTreeNodeWithState).loadingState === "loading" ? (
                  <Spinner delay={0} style={{ width: 24, height: 24 }} />
                ) : (
                  <Icon
                    name={
                      animateExpand
                        ? treeItem.iconCollapsed || iconCollapsed
                        : treeItem.isExpanded
                          ? treeItem.iconExpanded || iconExpanded
                          : treeItem.iconCollapsed || iconCollapsed
                    }
                    size={iconSize}
                    className={classnames(styles.toggleIcon, {
                      [styles.rotated]: animateExpand && treeItem.isExpanded,
                    })}
                    style={
                      animateExpand && treeItem.isExpanded
                        ? {
                            transform: `rotate(${expandRotation}deg)`,
                          }
                        : undefined
                    }
                  />
                )}
              </>
            )}
          </div>
        </div>
        <div
          className={styles.labelWrapper}
          onMouseDown={onItemMouseDownHandler}
          onClick={onItemClickHandler}
          style={{ cursor: "pointer" }}
        >
          {itemRenderer(treeItem)}
        </div>
      </div>
    </div>
  );
});

const emptyTreeData: UnPackedTreeData = {
  treeData: [],
  treeItemsById: {},
};

/**
 * Find all parent node IDs for a given node ID by traversing up the tree structure
 * @param nodeId The target node ID to find parents for
 * @param treeItemsById Map of all tree nodes by their ID
 * @returns Array of parent node IDs from immediate parent to root
 */
const findAllParentIds = (
  nodeId: string | number,
  treeItemsById: Record<string, TreeNode>,
): (string | number)[] => {
  const parentIds: (string | number)[] = [];
  const targetNode = treeItemsById[String(nodeId)];

  if (!targetNode) {
    return parentIds;
  }

  // Walk up the tree using parentIds property which contains the path from root to parent
  if (targetNode.parentIds && targetNode.parentIds.length > 0) {
    parentIds.push(...targetNode.parentIds);
  }

  return parentIds;
};

/**
 * Expand all parent paths for an array of node IDs to ensure they are visible
 * @param nodeIds Array of node IDs that should be expanded
 * @param treeItemsById Map of all tree nodes by their ID
 * @returns Array containing original node IDs plus all necessary parent IDs
 */
const expandParentPaths = (
  nodeIds: (string | number)[],
  treeItemsById: Record<string, TreeNode>,
): (string | number)[] => {
  const allExpandedIds = new Set<string | number>(nodeIds);

  // For each target node, find and add all its parent IDs
  nodeIds.forEach((nodeId) => {
    const parentIds = findAllParentIds(nodeId, treeItemsById);
    parentIds.forEach((parentId) => allExpandedIds.add(parentId));
  });

  return Array.from(allExpandedIds);
};

// Default props following XMLUI conventions
export const defaultProps = {
  dataFormat: "flat" as const,
  idField: "id",
  nameField: "name",
  iconField: "icon",
  iconExpandedField: "iconExpanded",
  iconCollapsedField: "iconCollapsed",
  parentIdField: "parentId",
  childrenField: "children",
  selectableField: "selectable",
  defaultExpanded: "none" as const,
  autoExpandToSelection: true,
  itemClickExpands: false,
  dynamicField: "dynamic",
  iconCollapsed: "chevronright",
  iconExpanded: "chevrondown",
  iconSize: "16",
  itemHeight: 32,
  animateExpand: false,
  expandRotation: 90,
};

interface TreeComponentProps {
  registerComponentApi?: (api: any) => void;
  data?: any; // Raw data in flat array or hierarchy format
  dataFormat?: TreeDataFormat;
  idField?: string;
  nameField?: string;
  iconField?: string;
  iconExpandedField?: string;
  iconCollapsedField?: string;
  parentIdField?: string;
  childrenField?: string;
  selectableField?: string;
  selectedValue?: string | number;
  selectedId?: string | number;
  defaultExpanded?: DefaultExpansion;
  autoExpandToSelection?: boolean;
  itemClickExpands?: boolean;
  dynamicField?: string;
  iconCollapsed?: string;
  iconExpanded?: string;
  iconSize?: string;
  itemHeight?: number;
  animateExpand?: boolean;
  expandRotation?: number;
  onItemClick?: (node: FlatTreeNode) => void;
  onSelectionChanged?: (event: TreeSelectionEvent) => void;
  onNodeExpanded?: (node: FlatTreeNode) => void;
  onNodeCollapsed?: (node: FlatTreeNode) => void;
  loadChildren?: (node: FlatTreeNode) => Promise<any[]>;
  itemRenderer: (item: any) => ReactNode;
  className?: string;
}

export const TreeComponent = memo((props: TreeComponentProps) => {
  const {
    registerComponentApi,
    data = emptyTreeData,
    dataFormat = defaultProps.dataFormat,
    idField = defaultProps.idField,
    nameField = defaultProps.nameField,
    iconField = defaultProps.iconField,
    iconExpandedField = defaultProps.iconExpandedField,
    iconCollapsedField = defaultProps.iconCollapsedField,
    parentIdField = defaultProps.parentIdField,
    childrenField = defaultProps.childrenField,
    selectableField = defaultProps.selectableField,
    selectedValue,
    selectedId,
    defaultExpanded = defaultProps.defaultExpanded,
    autoExpandToSelection = defaultProps.autoExpandToSelection,
    itemClickExpands = defaultProps.itemClickExpands,
    dynamicField = defaultProps.dynamicField,
    iconCollapsed = defaultProps.iconCollapsed,
    iconExpanded = defaultProps.iconExpanded,
    iconSize = defaultProps.iconSize,
    itemHeight = defaultProps.itemHeight,
    animateExpand = defaultProps.animateExpand,
    expandRotation = defaultProps.expandRotation,
    onItemClick,
    onSelectionChanged,
    onNodeExpanded,
    onNodeCollapsed,
    loadChildren,
    itemRenderer,
    className,
  } = props;
  // Internal selection state for uncontrolled usage
  // Initialize with selectedValue if provided and no onSelectionChanged handler (uncontrolled mode)
  const [internalSelectedId, setInternalSelectedId] = useState<string | number | undefined>(() => {
    return !onSelectionChanged && selectedValue ? selectedValue : undefined;
  });

  // Internal data state for API methods that modify the tree structure
  const [internalData, setInternalData] = useState<any>(undefined);
  const [dataRevision, setDataRevision] = useState(0);

  // Use internal data if available, otherwise use props data
  const effectiveData = internalData ?? data;

  // Helper function to update internal data and force re-render
  const updateInternalData = useCallback((updater: (prevData: any) => any) => {
    setInternalData(updater);
    setDataRevision((prev) => prev + 1);
  }, []);

  // Build field configuration
  const fieldConfig = useMemo<TreeFieldConfig>(
    () => ({
      idField: idField || "id",
      labelField: nameField || "name",
      iconField,
      iconExpandedField,
      iconCollapsedField,
      parentField: parentIdField,
      childrenField,
      selectableField,
      dynamicField,
    }),
    [
      idField,
      nameField,
      iconField,
      iconExpandedField,
      iconCollapsedField,
      parentIdField,
      childrenField,
      selectableField,
      dynamicField,
    ],
  );

  // Steps 3a & 3b: Transform data based on format
  // Enhanced data transformation pipeline with validation and error handling
  const transformedData = useMemo(() => {
    // Return empty data if no data provided
    if (!effectiveData) {
      return emptyTreeData;
    }

    try {
      if (dataFormat === "flat") {
        // Validation: Flat format requires array
        if (!Array.isArray(effectiveData)) {
          throw new Error(
            `TreeComponent: dataFormat='flat' requires array data, received: ${typeof effectiveData}`,
          );
        }

        // Validation: Check for required fields in sample data
        if (effectiveData.length > 0) {
          const sampleItem = effectiveData[0];
          if (typeof sampleItem !== "object" || sampleItem === null) {
            throw new Error("TreeComponent: Flat data items must be objects");
          }
          if (!(fieldConfig.idField in sampleItem)) {
            throw new Error(
              `TreeComponent: Required field '${fieldConfig.idField}' not found in flat data items`,
            );
          }
          if (!(fieldConfig.labelField in sampleItem)) {
            throw new Error(
              `TreeComponent: Required field '${fieldConfig.labelField}' not found in flat data items`,
            );
          }
        }

        return flatToNative(effectiveData, fieldConfig);
      } else if (dataFormat === "hierarchy") {
        // Validation: Hierarchy format requires object or array
        if (!effectiveData || typeof effectiveData !== "object") {
          throw new Error(
            `TreeComponent: dataFormat='hierarchy' requires object or array data, received: ${typeof effectiveData}`,
          );
        }

        // Validation: Check for required fields in hierarchy data
        const checkHierarchyData = (item: any): void => {
          if (typeof item !== "object" || item === null) {
            throw new Error("TreeComponent: Hierarchy data items must be objects");
          }
          if (!(fieldConfig.idField in item)) {
            throw new Error(
              `TreeComponent: Required field '${fieldConfig.idField}' not found in hierarchy data`,
            );
          }
          if (!(fieldConfig.labelField in item)) {
            throw new Error(
              `TreeComponent: Required field '${fieldConfig.labelField}' not found in hierarchy data`,
            );
          }
        };

        if (Array.isArray(effectiveData)) {
          if (effectiveData.length > 0) {
            checkHierarchyData(effectiveData[0]);
          }
        } else {
          checkHierarchyData(effectiveData);
        }

        return hierarchyToNative(effectiveData, fieldConfig);
      } else {
        throw new Error(
          `TreeComponent: Unsupported dataFormat '${dataFormat}'. Use 'flat' or 'hierarchy'.`,
        );
      }
    } catch (error) {
      // Return empty data on error to prevent crashes
      return emptyTreeData;
    }
  }, [effectiveData, dataFormat, fieldConfig, dataRevision]);

  const { treeData, treeItemsById } = transformedData;

  // Use selectedValue (source ID) directly since TreeNode.key is the source ID
  const mappedSelectedId = useMemo(() => {
    if (selectedValue) {
      // For flat/hierarchy formats, selectedValue is already the source ID (matches TreeNode.key)
      return selectedValue;
    }
    return selectedId;
  }, [selectedValue, selectedId]);

  // Determine if we're in controlled mode (has onSelectionChanged handler) or uncontrolled mode
  const isControlledMode = !!onSelectionChanged;

  // Use mapped selectedValue/selectedId if in controlled mode and provided,
  // otherwise use internal state (uncontrolled mode or controlled mode without selectedValue)
  const effectiveSelectedId =
    isControlledMode && mappedSelectedId !== undefined ? mappedSelectedId : internalSelectedId;

  // Initialize expanded IDs based on defaultExpanded prop
  const [expandedIds, setExpandedIds] = useState<(string | number)[]>(() => {
    // Helper function to check if a node is dynamic (should not be auto-expanded)
    const isDynamic = (node: TreeNode): boolean => {
      return !!(fieldConfig.dynamicField && node[fieldConfig.dynamicField]);
    };

    if (defaultExpanded === "first-level") {
      return treeData.filter((node) => !isDynamic(node)).map((node) => node.key);
    } else if (defaultExpanded === "all") {
      const allIds: (string | number)[] = [];
      const collectIds = (nodes: TreeNode[]) => {
        nodes.forEach((node) => {
          if (!isDynamic(node)) {
            allIds.push(node.key);
          }
          if (node.children) {
            collectIds(node.children);
          }
        });
      };
      collectIds(treeData);
      return allIds;
    } else if (Array.isArray(defaultExpanded)) {
      // Expand full paths to specified nodes by including all parent nodes
      // But exclude dynamic nodes from the expansion
      const expandedPaths = expandParentPaths(defaultExpanded, treeItemsById);
      return expandedPaths.filter((nodeId) => {
        const node = treeItemsById[String(nodeId)];
        return !node || !isDynamic(node);
      });
    }
    return [];
  });

  // Node loading states management for dynamic loading
  const [nodeStates, setNodeStates] = useState<Map<string | number, NodeLoadingState>>(new Map());

  // Helper functions for managing node loading states
  const getNodeState = useCallback(
    (nodeId: string | number): NodeLoadingState => {
      return nodeStates.get(nodeId) || "loaded";
    },
    [nodeStates],
  );

  const setNodeState = useCallback((nodeId: string | number, state: NodeLoadingState) => {
    setNodeStates((prev) => {
      const newStates = new Map(prev);
      newStates.set(nodeId, state);
      return newStates;
    });
  }, []);

  // Simplified focus management
  const [focusedIndex, setFocusedIndex] = useState<number>(-1);
  const treeContainerRef = useRef<HTMLDivElement>(null);
  const listRef = useRef<VirtualizerHandle>(null);

  const flatTreeData = useMemo(() => {
    return toFlatTree(treeData, expandedIds, fieldConfig.dynamicField, nodeStates);
  }, [expandedIds, treeData, fieldConfig.dynamicField, nodeStates]);

  // Tree node utilities for consistent ID mapping
  const findNodeById = useCallback(
    (nodeId: string | number): FlatTreeNode | null => {
      return flatTreeData.find((n) => String(n.key) === String(nodeId)) || null;
    },
    [flatTreeData],
  );

  const findNodeIndexById = useCallback(
    (nodeId: string | number): number => {
      return flatTreeData.findIndex((item) => String(item.key) === String(nodeId));
    },
    [flatTreeData],
  );

  // Tree validation utilities
  const nodeExists = useCallback(
    (nodeId: string | number): boolean => {
      return Object.values(treeItemsById).some((n) => String(n.key) === String(nodeId));
    },
    [treeItemsById],
  );

  /**
   * Centralized selection handler - handles all selection logic consistently
   * @param nodeId - The node key (source ID) to select, or undefined to clear selection
   */
  const setSelectedNodeById = useCallback(
    (nodeId: string | number | undefined) => {
      // Find the node if nodeId is provided
      const node = nodeId
        ? Object.values(treeItemsById).find((n) => String(n.key) === String(nodeId))
        : null;

      const nodeKey = node?.key;

      // Get previous selection for event
      const previousNode = effectiveSelectedId ? findNodeById(effectiveSelectedId) : null;

      // Always update internal state (this provides visual feedback)
      setInternalSelectedId(nodeKey);

      // Update focused index to match the selected item
      if (nodeKey) {
        const nodeIndex = flatTreeData.findIndex((item) => String(item.key) === String(nodeKey));
        if (nodeIndex >= 0) {
          setFocusedIndex(nodeIndex);
        }
      }

      // Fire selection event if handler is provided
      if (onSelectionChanged) {
        const newNode = node
          ? ({
              ...node,
              isExpanded: expandedIds.includes(node.key),
              depth: node.parentIds.length,
              hasChildren: !!(node.children && node.children.length > 0),
            } as FlatTreeNode)
          : null;

        onSelectionChanged({
          previousNode,
          newNode,
        });
      }
    },
    [
      treeItemsById,
      effectiveSelectedId,
      flatTreeData,
      expandedIds,
      onSelectionChanged,
      internalSelectedId,
    ],
  );

  // Simple tree API method implementations
  const getExpandedNodes = useCallback((): (string | number)[] => {
    return expandedIds;
  }, [expandedIds]);

  const getSelectedNode = useCallback(() => {
    if (!effectiveSelectedId) return null;
    return (
      Object.values(treeItemsById).find(
        (node) => String(node.key) === String(effectiveSelectedId),
      ) || null
    );
  }, [effectiveSelectedId, treeItemsById]);

  const getNodeById = useCallback(
    (nodeId: string | number) => {
      return Object.values(treeItemsById).find((n) => String(n.key) === String(nodeId)) || null;
    },
    [treeItemsById],
  );

  const clearSelection = useCallback(() => {
    setSelectedNodeById(undefined);
  }, [setSelectedNodeById]);

  // Initialize selection based on selectedValue prop - only on mount
  useEffect(() => {
    if (selectedValue !== undefined && !onSelectionChanged) {
      // Uncontrolled mode: set initial selection based on selectedValue
      setInternalSelectedId(selectedValue);
    }
  }, []); // Only run on mount

  /**
   * ensure the selected item's parents are expanded when selection changes
   */
  useEffect(() => {
    if (autoExpandToSelection && effectiveSelectedId) {
      // Find node by key (source ID) since treeItemsById is indexed by id
      const treeItem = Object.values(treeItemsById).find(
        (node) => node.key === effectiveSelectedId,
      );
      if (treeItem) {
        setExpandedIds((prev) => [...prev, ...treeItem.parentIds]);
      }
    }
  }, [autoExpandToSelection, effectiveSelectedId, treeItemsById]);

  const toggleNode = useCallback(
    async (node: FlatTreeNode) => {
      if (!node.isExpanded) {
        // Expanding the node
        setExpandedIds((prev) => [...prev, node.key]);

        // Always fire nodeDidExpand event
        if (onNodeExpanded) {
          onNodeExpanded({ ...node, isExpanded: true });
        }

        // Check if we need to load children dynamically
        const nodeWithState = node as FlatTreeNodeWithState;
        if (nodeWithState.loadingState === "unloaded" && loadChildren) {
          // Set loading state
          setNodeStates((prev) => new Map(prev).set(node.key, "loading"));

          // Immediately remove existing children so node appears empty while loading
          updateInternalData((prevData) => {
            const currentData = prevData ?? data;

            if (dataFormat === "flat" && Array.isArray(currentData)) {
              // Remove existing children of this node
              return currentData.filter(
                (item) => String(item[fieldConfig.parentField || "parentId"]) !== String(node.key),
              );
            } else if (dataFormat === "hierarchy" && Array.isArray(currentData)) {
              // For hierarchy format, clear children array
              const clearChildren = (nodes: any[]): any[] => {
                return nodes.map((n) => {
                  if (String(n[fieldConfig.idField || "id"]) === String(node.key)) {
                    return {
                      ...n,
                      [fieldConfig.childrenField || "children"]: [],
                    };
                  } else if (n[fieldConfig.childrenField || "children"]) {
                    return {
                      ...n,
                      [fieldConfig.childrenField || "children"]: clearChildren(
                        n[fieldConfig.childrenField || "children"],
                      ),
                    };
                  }
                  return n;
                });
              };
              return clearChildren(currentData);
            }

            return currentData;
          });

          try {
            // Load the children data
            const loadedData = await loadChildren({ ...node, isExpanded: true });

            // Update the tree data with loaded children
            if (loadedData && Array.isArray(loadedData) && loadedData.length > 0) {
              updateInternalData((prevData) => {
                const currentData = prevData ?? data;

                if (dataFormat === "flat" && Array.isArray(currentData)) {
                  // Replace existing children with newly loaded data

                  // Remove existing children of this node
                  const filteredData = currentData.filter(
                    (item) =>
                      String(item[fieldConfig.parentField || "parentId"]) !== String(node.key),
                  );

                  // Add new children
                  const newItems = loadedData.map((item) => ({
                    ...item,
                    [fieldConfig.parentField || "parentId"]: String(node.key),
                  }));

                  return [...filteredData, ...newItems];
                } else if (dataFormat === "hierarchy" && Array.isArray(currentData)) {
                  // For hierarchy format, we need to find the node and add children
                  const updateHierarchy = (nodes: any[]): any[] => {
                    return nodes.map((n) => {
                      if (String(n[fieldConfig.idField || "id"]) === String(node.key)) {
                        return {
                          ...n,
                          [fieldConfig.childrenField || "children"]: loadedData,
                        };
                      } else if (n[fieldConfig.childrenField || "children"]) {
                        return {
                          ...n,
                          [fieldConfig.childrenField || "children"]: updateHierarchy(
                            n[fieldConfig.childrenField || "children"],
                          ),
                        };
                      }
                      return n;
                    });
                  };
                  return updateHierarchy(currentData);
                }

                return currentData;
              });
            }

            // Set loaded state
            setNodeStates((prev) => new Map(prev).set(node.key, "loaded"));
          } catch (error) {
            console.error("Error loading tree node data:", error);
            // Set back to unloaded state on error
            setNodeStates((prev) => {
              const newMap = new Map(prev);
              newMap.delete(node.key);
              return newMap;
            });
            // Collapse the node since loading failed
            setExpandedIds((prev) => prev.filter((id) => id !== node.key));
          }
        }
      } else {
        // Collapsing the node
        setExpandedIds((prev) => prev.filter((id) => id !== node.key));

        // Fire nodeDidCollapse event
        if (onNodeCollapsed) {
          onNodeCollapsed({ ...node, isExpanded: false });
        }
      }
    },
    [onNodeExpanded, onNodeCollapsed, loadChildren, data, dataFormat, fieldConfig, setNodeStates],
  );

  // Simplified keyboard navigation handler
  const handleKeyDown = useCallback(
    (e: React.KeyboardEvent) => {
      if (flatTreeData.length === 0) return;

      const currentIndex = focusedIndex >= 0 ? focusedIndex : 0;
      let newIndex = currentIndex;
      let handled = false;

      switch (e.key) {
        case "ArrowDown":
          e.preventDefault();
          newIndex = Math.min(currentIndex + 1, flatTreeData.length - 1);
          handled = true;
          break;

        case "ArrowUp":
          e.preventDefault();
          newIndex = Math.max(currentIndex - 1, 0);
          handled = true;
          break;

        case "ArrowRight":
          e.preventDefault();
          if (currentIndex >= 0) {
            const currentNode = flatTreeData[currentIndex];
            if (currentNode.hasChildren && !currentNode.isExpanded) {
              // Expand node
              void toggleNode(currentNode);
            } else if (
              currentNode.hasChildren &&
              currentNode.isExpanded &&
              currentIndex + 1 < flatTreeData.length
            ) {
              // Move to first child
              newIndex = currentIndex + 1;
            }
          }
          handled = true;
          break;

        case "ArrowLeft":
          e.preventDefault();
          if (currentIndex >= 0) {
            const currentNode = flatTreeData[currentIndex];
            if (currentNode.hasChildren && currentNode.isExpanded) {
              // Collapse node
              void toggleNode(currentNode);
            } else if (currentNode.depth > 0) {
              // Move to parent - find previous node with smaller depth
              for (let i = currentIndex - 1; i >= 0; i--) {
                if (flatTreeData[i].depth < currentNode.depth) {
                  newIndex = i;
                  break;
                }
              }
            }
          }
          handled = true;
          break;

        case "Home":
          e.preventDefault();
          newIndex = 0;
          handled = true;
          break;

        case "End":
          e.preventDefault();
          newIndex = flatTreeData.length - 1;
          handled = true;
          break;

        case "Enter":
        case " ":
          e.preventDefault();
          if (currentIndex >= 0) {
            const currentNode = flatTreeData[currentIndex];
            // Handle selection
            if (currentNode.selectable) {
              setSelectedNodeById(currentNode.key);
              // Ensure focus stays on the current item after selection
              newIndex = currentIndex;
            }
            // Handle expansion for Enter key
            if (e.key === "Enter" && currentNode.hasChildren) {
              void toggleNode(currentNode);
            }
          }
          handled = true;
          break;
      }

      if (handled) {
        setFocusedIndex(newIndex);
      }
    },
    [focusedIndex, flatTreeData, toggleNode, setSelectedNodeById],
  );

  const itemData = useMemo(() => {
    return {
      nodes: flatTreeData,
      toggleNode,
      selectedId: effectiveSelectedId,
      itemRenderer,
      itemClickExpands,
      onItemClick,
      onSelection: (node: FlatTreeNode) => setSelectedNodeById(node.key),
      focusedIndex,
      onKeyDown: handleKeyDown,
      treeContainerRef,
      iconCollapsed,
      iconExpanded,
      iconSize,
      animateExpand,
      expandRotation,
    };
  }, [
    flatTreeData,
    toggleNode,
    effectiveSelectedId,
    itemRenderer,
    itemClickExpands,
    onItemClick,
    setSelectedNodeById,
    focusedIndex,
    handleKeyDown,
    iconCollapsed,
    iconExpanded,
    iconSize,
    animateExpand,
    expandRotation,
  ]);

  // Shared API implementation to avoid duplication between ref and component APIs
  const treeApiMethods = useMemo(() => {
    return {
      // Expansion methods
      expandAll: () => {
        const allIds: (string | number)[] = [];
        const collectIds = (nodes: TreeNode[]) => {
          nodes.forEach((node) => {
            allIds.push(node.key);
            if (node.children) {
              collectIds(node.children);
            }
          });
        };
        collectIds(treeData);
        setExpandedIds(allIds);
      },

      collapseAll: () => {
        setExpandedIds([]);
      },

      expandToLevel: (level: number) => {
        const levelIds: (string | number)[] = [];
        const collectIdsToLevel = (nodes: TreeNode[], currentLevel: number = 0) => {
          if (currentLevel >= level) return;
          nodes.forEach((node) => {
            levelIds.push(node.key);
            if (node.children && currentLevel < level - 1) {
              collectIdsToLevel(node.children, currentLevel + 1);
            }
          });
        };
        collectIdsToLevel(treeData);
        setExpandedIds(levelIds);
      },

      expandNode: async (nodeId: string | number) => {
        // nodeId is source ID, which matches TreeNode.key
        const wasExpanded = expandedIds.includes(nodeId);
        if (!wasExpanded) {
          setExpandedIds((prev) => [...prev, nodeId]);

          // Always fire nodeDidExpand event
          const node = getNodeById(nodeId);
          if (node && onNodeExpanded) {
            // Convert TreeNode to FlatTreeNode format for the event
            const flatNode: FlatTreeNode = {
              ...node,
              isExpanded: true,
              depth: node.parentIds.length,
              hasChildren: !!(node.children && node.children.length > 0),
            };
            onNodeExpanded(flatNode);
          }

          // Check if we need to load children dynamically
          if (node && loadChildren) {
            // Set loading state
            setNodeStates((prev) => new Map(prev).set(nodeId, "loading"));

            try {
              // Convert TreeNode to FlatTreeNode format for loadChildren
              const flatNode: FlatTreeNode = {
                ...node,
                isExpanded: true,
                depth: node.parentIds.length,
                hasChildren: !!(node.children && node.children.length > 0),
              };

              // Load the children data
              const loadedData = await loadChildren(flatNode);

              // Update the tree data with loaded children
              if (loadedData && Array.isArray(loadedData) && loadedData.length > 0) {
                updateInternalData((prevData) => {
                  const currentData = prevData ?? data;

                  if (dataFormat === "flat" && Array.isArray(currentData)) {
                    // Replace existing children with newly loaded data

                    // Remove existing children of this node
                    const filteredData = currentData.filter(
                      (item) =>
                        String(item[fieldConfig.parentField || "parentId"]) !== String(nodeId),
                    );

                    // Add new children
                    const newItems = loadedData.map((item) => ({
                      ...item,
                      [fieldConfig.parentField || "parentId"]: String(nodeId),
                    }));

                    return [...filteredData, ...newItems];
                  } else if (dataFormat === "hierarchy" && Array.isArray(currentData)) {
                    // For hierarchy format, we need to find the node and add children
                    const updateHierarchy = (nodes: any[]): any[] => {
                      return nodes.map((n) => {
                        if (String(n[fieldConfig.idField || "id"]) === String(nodeId)) {
                          return {
                            ...n,
                            [fieldConfig.childrenField || "children"]: loadedData,
                          };
                        } else if (n[fieldConfig.childrenField || "children"]) {
                          return {
                            ...n,
                            [fieldConfig.childrenField || "children"]: updateHierarchy(
                              n[fieldConfig.childrenField || "children"],
                            ),
                          };
                        }
                        return n;
                      });
                    };
                    return updateHierarchy(currentData);
                  }

                  return currentData;
                });
              }

              // Set loaded state
              setNodeStates((prev) => new Map(prev).set(nodeId, "loaded"));
            } catch (error) {
              console.error("Error loading tree node data:", error);
              // Set back to unloaded state on error
              setNodeStates((prev) => {
                const newMap = new Map(prev);
                newMap.delete(nodeId);
                return newMap;
              });
              // Collapse the node since loading failed
              setExpandedIds((prev) => prev.filter((id) => id !== nodeId));
            }
          }
        }
      },

      collapseNode: (nodeId: string | number) => {
        // nodeId is source ID, which matches TreeNode.key
        const wasExpanded = expandedIds.includes(nodeId);
        if (!wasExpanded) return; // Nothing to collapse

        // Find the node and collect all its descendants
        const nodeToCollapse = Object.values(treeItemsById).find(
          (n) => String(n.key) === String(nodeId),
        );
        if (nodeToCollapse) {
          const idsToRemove = new Set<string>();

          // Recursively collect all descendant IDs
          const collectDescendants = (treeNode: TreeNode) => {
            idsToRemove.add(String(treeNode.key));
            if (treeNode.children) {
              treeNode.children.forEach((child) => collectDescendants(child));
            }
          };

          collectDescendants(nodeToCollapse);

          // Remove all descendant IDs from expanded list
          setExpandedIds((prev) => prev.filter((id) => !idsToRemove.has(String(id))));

          // Fire nodeDidCollapse event
          if (nodeToCollapse && onNodeCollapsed) {
            // Convert to FlatTreeNode format for the event
            const flatNode: FlatTreeNode = {
              ...nodeToCollapse,
              isExpanded: false,
              depth: nodeToCollapse.parentIds.length,
              hasChildren: !!(nodeToCollapse.children && nodeToCollapse.children.length > 0),
            };
            onNodeCollapsed(flatNode);
          }
        }
      },

      // Selection methods
      selectNode: (nodeId: string | number) => {
        // Check if node exists before calling setSelectedNodeById
        if (nodeExists(nodeId)) {
          return setSelectedNodeById(nodeId);
        } else {
          return setSelectedNodeById(undefined);
        }
      },

      clearSelection,

      // Utility methods
      getNodeById,

      getExpandedNodes,

      getSelectedNode,

      scrollIntoView: (nodeId: string | number, options?: ScrollIntoViewOptions) => {
        // Find the target node
        const targetNode = Object.values(treeItemsById).find(
          (n) => String(n.key) === String(nodeId),
        );
        if (!targetNode) {
          return; // Node not found
        }

        // Collect all parent IDs that need to be expanded
        const parentsToExpand: (string | number)[] = [];
        const collectParents = (node: TreeNode) => {
          if (node.parentIds && node.parentIds.length > 0) {
            // Add all parent IDs to expansion list
            parentsToExpand.push(...node.parentIds);
          }
        };

        collectParents(targetNode);

        // Calculate the new expanded IDs including parents
        const newExpandedIds = [...new Set([...expandedIds, ...parentsToExpand])];

        // Expand all parent nodes if they aren't already expanded
        if (parentsToExpand.length > 0) {
          setExpandedIds(newExpandedIds);
        }

        // Use setTimeout to ensure DOM is updated after expansion state change
        setTimeout(() => {
          // Generate the flat tree data with the new expanded state to find the correct index
          const updatedFlatTreeData = toFlatTree(
            treeData,
            newExpandedIds,
            fieldConfig.dynamicField,
            nodeStates,
          );
          const nodeIndex = updatedFlatTreeData.findIndex(
            (item) => String(item.key) === String(nodeId),
          );

          if (nodeIndex >= 0 && listRef.current) {
            // Scroll to the item using virtua's scrollToIndex method
            listRef.current.scrollToIndex(nodeIndex, { align: "center" });
          }
        }, 0);
      },

      scrollToItem: (nodeId: string | number) => {
        // Simple scroll without expanding - just scroll to the item if it's visible
        const nodeIndex = findNodeIndexById(nodeId);

        if (nodeIndex >= 0 && listRef.current) {
          listRef.current.scrollToIndex(nodeIndex, { align: "center" });
        }
      },

      appendNode: (parentNodeId: string | number | undefined | null, nodeData: any) => {
        // Generate a new ID if not provided
        const nodeId = nodeData[fieldConfig.idField] || Date.now();

        // Create the new node with proper field mapping
        const newNode = {
          ...nodeData,
          [fieldConfig.idField]: nodeId,
        };

        // For flat data format, set the parent ID field
        if (dataFormat === "flat") {
          newNode[fieldConfig.parentField || "parentId"] = parentNodeId || null;
        }

        // Update the internal data state
        updateInternalData((prevData) => {
          const currentData = prevData ?? data;

          if (dataFormat === "flat") {
            // For flat format, just append to the array
            return Array.isArray(currentData) ? [...currentData, newNode] : [newNode];
          } else if (dataFormat === "hierarchy") {
            // For hierarchy format, we need to find the parent and add to its children
            const addToHierarchy = (nodes: any[]): any[] => {
              if (!parentNodeId) {
                // Add to root level
                return [...nodes, { ...newNode, [fieldConfig.childrenField || "children"]: [] }];
              }

              return nodes.map((node) => {
                if (node[fieldConfig.idField] === parentNodeId) {
                  const children = node[fieldConfig.childrenField || "children"] || [];
                  return {
                    ...node,
                    [fieldConfig.childrenField || "children"]: [
                      ...children,
                      { ...newNode, [fieldConfig.childrenField || "children"]: [] },
                    ],
                  };
                }

                // Recursively check children
                const childrenField = fieldConfig.childrenField || "children";
                if (node[childrenField] && Array.isArray(node[childrenField])) {
                  return {
                    ...node,
                    [childrenField]: addToHierarchy(node[childrenField]),
                  };
                }

                return node;
              });
            };

            if (Array.isArray(currentData)) {
              return addToHierarchy(currentData);
            } else {
              return currentData;
            }
          }

          return currentData;
        });
      },

      removeNode: (nodeId: string | number) => {
        // Helper function to recursively find and remove a node and its descendants
        const removeFromFlat = (data: any[]): any[] => {
          const nodeIdToRemove = String(nodeId);
          const fieldId = fieldConfig.idField || "id";
          const fieldParent = fieldConfig.parentField || "parentId";

          // First, collect all descendant IDs recursively
          const getDescendantIds = (parentId: string): string[] => {
            const descendants: string[] = [];
            for (const item of data) {
              if (String(item[fieldParent]) === parentId) {
                const itemId = String(item[fieldId]);
                descendants.push(itemId);
                descendants.push(...getDescendantIds(itemId));
              }
            }
            return descendants;
          };

          // Get all IDs to remove (node itself + all descendants)
          const idsToRemove = new Set([nodeIdToRemove, ...getDescendantIds(nodeIdToRemove)]);

          // Filter out all nodes with IDs in the removal set
          return data.filter((item) => !idsToRemove.has(String(item[fieldId])));
        };

        const removeFromHierarchy = (nodes: any[]): any[] => {
          const fieldId = fieldConfig.idField || "id";
          const fieldChildren = fieldConfig.childrenField || "children";

          return nodes.reduce((acc: any[], node: any) => {
            // If this is the node to remove, don't include it (and its descendants)
            if (String(node[fieldId]) === String(nodeId)) {
              return acc;
            }

            // Otherwise, include the node but recursively process its children
            const children = node[fieldChildren];
            if (children && Array.isArray(children)) {
              acc.push({
                ...node,
                [fieldChildren]: removeFromHierarchy(children),
              });
            } else {
              acc.push(node);
            }

            return acc;
          }, []);
        };

        // Update the internal data state
        setInternalData((prevData) => {
          const currentData = prevData ?? data;

          if (dataFormat === "flat" && Array.isArray(currentData)) {
            return removeFromFlat(currentData);
          } else if (dataFormat === "hierarchy" && Array.isArray(currentData)) {
            return removeFromHierarchy(currentData);
          }

          return currentData;
        });
      },

      removeChildren: (nodeId: string | number) => {
        // Helper function to remove only the children of a node in flat format
        const removeChildrenFromFlat = (data: any[]): any[] => {
          const parentNodeId = String(nodeId);
          const fieldId = fieldConfig.idField || "id";
          const fieldParent = fieldConfig.parentField || "parentId";

          // First, collect all descendant IDs recursively (but not the parent node itself)
          const getDescendantIds = (parentId: string): string[] => {
            const descendants: string[] = [];
            for (const item of data) {
              if (String(item[fieldParent]) === parentId) {
                const itemId = String(item[fieldId]);
                descendants.push(itemId);
                descendants.push(...getDescendantIds(itemId));
              }
            }
            return descendants;
          };

          // Get all descendant IDs to remove (children and their descendants)
          const idsToRemove = new Set(getDescendantIds(parentNodeId));

          // Filter out all descendant nodes but keep the parent node
          return data.filter((item) => !idsToRemove.has(String(item[fieldId])));
        };

        const removeChildrenFromHierarchy = (nodes: any[]): any[] => {
          const fieldId = fieldConfig.idField || "id";
          const fieldChildren = fieldConfig.childrenField || "children";

          return nodes.map((node: any) => {
            // If this is the target node, remove all its children
            if (String(node[fieldId]) === String(nodeId)) {
              return {
                ...node,
                [fieldChildren]: [],
              };
            }

            // Otherwise, recursively process children
            const children = node[fieldChildren];
            if (children && Array.isArray(children)) {
              return {
                ...node,
                [fieldChildren]: removeChildrenFromHierarchy(children),
              };
            }

            return node;
          });
        };

        // Update the internal data state
        setInternalData((prevData) => {
          const currentData = prevData ?? data;

          if (dataFormat === "flat" && Array.isArray(currentData)) {
            return removeChildrenFromFlat(currentData);
          } else if (dataFormat === "hierarchy" && Array.isArray(currentData)) {
            return removeChildrenFromHierarchy(currentData);
          }

          return currentData;
        });
      },

      insertNodeBefore: (beforeNodeId: string | number, nodeData: any) => {
        // Generate a new ID if not provided
        const nodeId = nodeData[fieldConfig.idField] || Date.now();

        // Create the new node with proper field mapping
        const newNode = {
          ...nodeData,
          [fieldConfig.idField]: nodeId,
        };

        // Helper function to insert before a node in flat format
        const insertBeforeInFlat = (data: any[]): any[] => {
          const beforeNodeIdStr = String(beforeNodeId);
          const fieldId = fieldConfig.idField || "id";
          const fieldParent = fieldConfig.parentField || "parentId";

          // Find the target node to get its parent
          const targetNode = data.find((item) => String(item[fieldId]) === beforeNodeIdStr);
          if (!targetNode) {
            // If target node not found, just append to root level
            return [...data, { ...newNode, [fieldParent]: null }];
          }

          // Set the same parent as the target node
          const parentId = targetNode[fieldParent];
          newNode[fieldParent] = parentId;

          // Find the index of the target node and insert before it
          const targetIndex = data.findIndex((item) => String(item[fieldId]) === beforeNodeIdStr);
          const result = [...data];
          result.splice(targetIndex, 0, newNode);
          return result;
        };

        const insertBeforeInHierarchy = (nodes: any[]): any[] => {
          const beforeNodeIdStr = String(beforeNodeId);
          const fieldId = fieldConfig.idField || "id";
          const fieldChildren = fieldConfig.childrenField || "children";

          // Check if the target node is at this level
          const targetIndex = nodes.findIndex((node) => String(node[fieldId]) === beforeNodeIdStr);
          if (targetIndex >= 0) {
            // Insert before the target node at this level
            const result = [...nodes];
            const nodeWithChildren = { ...newNode, [fieldChildren]: [] };
            result.splice(targetIndex, 0, nodeWithChildren);
            return result;
          }

          // Otherwise, recursively search in children
          return nodes.map((node: any) => {
            const children = node[fieldChildren];
            if (children && Array.isArray(children)) {
              const updatedChildren = insertBeforeInHierarchy(children);
              if (updatedChildren !== children) {
                return {
                  ...node,
                  [fieldChildren]: updatedChildren,
                };
              }
            }
            return node;
          });
        };

        // Update the internal data state
        setInternalData((prevData) => {
          const currentData = prevData ?? data;

          if (dataFormat === "flat" && Array.isArray(currentData)) {
            return insertBeforeInFlat(currentData);
          } else if (dataFormat === "hierarchy" && Array.isArray(currentData)) {
            return insertBeforeInHierarchy(currentData);
          }

          return currentData;
        });
      },

      insertNodeAfter: (afterNodeId: string | number, nodeData: any) => {
        // Generate a new ID if not provided
        const nodeId = nodeData[fieldConfig.idField] || Date.now();

        // Create the new node with proper field mapping
        const newNode = {
          ...nodeData,
          [fieldConfig.idField]: nodeId,
        };

        // Helper function to insert after a node in flat format
        const insertAfterInFlat = (data: any[]): any[] => {
          const afterNodeIdStr = String(afterNodeId);
          const fieldId = fieldConfig.idField || "id";
          const fieldParent = fieldConfig.parentField || "parentId";

          // Find the target node to get its parent
          const targetNode = data.find((item) => String(item[fieldId]) === afterNodeIdStr);
          if (!targetNode) {
            // If target node not found, just append to root level
            return [...data, { ...newNode, [fieldParent]: null }];
          }

          // Set the same parent as the target node
          const parentId = targetNode[fieldParent];
          newNode[fieldParent] = parentId;

          // Find the index of the target node and insert after it
          const targetIndex = data.findIndex((item) => String(item[fieldId]) === afterNodeIdStr);
          const result = [...data];
          result.splice(targetIndex + 1, 0, newNode);
          return result;
        };

        const insertAfterInHierarchy = (nodes: any[]): any[] => {
          const afterNodeIdStr = String(afterNodeId);
          const fieldId = fieldConfig.idField || "id";
          const fieldChildren = fieldConfig.childrenField || "children";

          // Check if the target node is at this level
          const targetIndex = nodes.findIndex((node) => String(node[fieldId]) === afterNodeIdStr);
          if (targetIndex >= 0) {
            // Insert after the target node at this level
            const result = [...nodes];
            const nodeWithChildren = { ...newNode, [fieldChildren]: [] };
            result.splice(targetIndex + 1, 0, nodeWithChildren);
            return result;
          }

          // Otherwise, recursively search in children
          return nodes.map((node: any) => {
            const children = node[fieldChildren];
            if (children && Array.isArray(children)) {
              const updatedChildren = insertAfterInHierarchy(children);
              if (updatedChildren !== children) {
                return {
                  ...node,
                  [fieldChildren]: updatedChildren,
                };
              }
            }
            return node;
          });
        };

        // Update the internal data state
        setInternalData((prevData) => {
          const currentData = prevData ?? data;

          if (dataFormat === "flat" && Array.isArray(currentData)) {
            return insertAfterInFlat(currentData);
          } else if (dataFormat === "hierarchy" && Array.isArray(currentData)) {
            return insertAfterInHierarchy(currentData);
          }

          return currentData;
        });
      },

      // Node state management methods

      getNodeLoadingState: (nodeId: string | number) => {
        return getNodeState(nodeId);
      },

      markNodeLoaded: (nodeId: string | number) => {
        setNodeState(nodeId, "loaded");
      },

      markNodeUnloaded: (nodeId: string | number) => {
        setNodeState(nodeId, "unloaded");
        treeApiMethods.collapseNode(nodeId);
      },
    };
  }, [
    treeData,
    treeItemsById,
    expandedIds,
    effectiveSelectedId,
    flatTreeData,
    onNodeExpanded,
    onNodeCollapsed,
    setSelectedNodeById,
    nodeExists,
    fieldConfig,
    dataFormat,
    data,
    setInternalData,
  ]);

  // Register component API methods for external access
  useEffect(() => {
    if (registerComponentApi) {
      registerComponentApi(treeApiMethods);
    }
  }, [registerComponentApi, treeApiMethods]);

  // Simplified focus management for the tree container
  const handleTreeFocus = useCallback(() => {
    if (flatTreeData.length > 0 && focusedIndex === -1) {
      // Initialize to selected item or first item on focus
      const selectedIndex = findNodeIndexById(effectiveSelectedId);
      const targetIndex = selectedIndex >= 0 ? selectedIndex : 0;
      setFocusedIndex(targetIndex);
    }
  }, [focusedIndex, flatTreeData, effectiveSelectedId]);

  const handleTreeBlur = useCallback((e: React.FocusEvent) => {
    // Check if focus is moving to another element within the tree
    const isMovingWithinTree = e.relatedTarget && e.currentTarget.contains(e.relatedTarget as Node);

    if (!isMovingWithinTree) {
      // Clear focus when tree loses focus completely
      setFocusedIndex(-1);
    }
  }, []);

  return (
    <div
      ref={treeContainerRef}
      className={classnames(styles.wrapper, className)}
      role="tree"
      aria-label="Tree navigation"
      aria-multiselectable="false"
      tabIndex={0}
      onFocus={handleTreeFocus}
      onBlur={handleTreeBlur}
      onKeyDown={handleKeyDown}
      style={{ height: "100%", overflow: "auto" }}
    >
      <Virtualizer ref={listRef}>
        {flatTreeData.map((node, index) => (
          <TreeRow key={node.key} index={index} data={itemData} />
        ))}
      </Virtualizer>
    </div>
  );
});

```
Page 120/140FirstPrevNextLast