@restio/ui 0.0.7-SNAPSHOT → 0.0.9-SNAPSHOT
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/anchored-overlay/anchored-overlay-types.d.ts +1 -1
- package/dist/components/anchored-overlay/anchored-overlay-types.js +2 -0
- package/dist/components/anchored-overlay/anchored-overlay-types.js.map +1 -0
- package/dist/components/anchored-overlay/anchored-overlay.d.ts +2 -2
- package/dist/components/anchored-overlay/anchored-overlay.js +67 -0
- package/dist/components/anchored-overlay/anchored-overlay.js.map +1 -0
- package/dist/components/banner/banner-types.d.ts +1 -1
- package/dist/components/banner/banner-types.js +2 -0
- package/dist/components/banner/banner-types.js.map +1 -0
- package/dist/components/banner/banner.d.ts +2 -2
- package/dist/components/banner/banner.js +29 -0
- package/dist/components/banner/banner.js.map +1 -0
- package/dist/components/button/button-types.d.ts +1 -1
- package/dist/components/button/button-types.js +2 -0
- package/dist/components/button/button-types.js.map +1 -0
- package/dist/components/button/button.d.ts +2 -2
- package/dist/components/button/button.js +20 -0
- package/dist/components/button/button.js.map +1 -0
- package/dist/components/button-group/button-group-types.js +2 -0
- package/dist/components/button-group/button-group-types.js.map +1 -0
- package/dist/components/button-group/button-group.d.ts +2 -2
- package/dist/components/button-group/button-group.js +16 -0
- package/dist/components/button-group/button-group.js.map +1 -0
- package/dist/components/checkbox/checkbox-types.d.ts +1 -1
- package/dist/components/checkbox/checkbox-types.js +2 -0
- package/dist/components/checkbox/checkbox-types.js.map +1 -0
- package/dist/components/checkbox/checkbox.d.ts +2 -2
- package/dist/components/checkbox/checkbox.js +19 -0
- package/dist/components/checkbox/checkbox.js.map +1 -0
- package/dist/components/code-block/code-block.d.ts +1 -1
- package/dist/components/code-block/code-block.js +9 -0
- package/dist/components/code-block/code-block.js.map +1 -0
- package/dist/components/file-upload/file-upload-types.d.ts +1 -1
- package/dist/components/file-upload/file-upload-types.js +2 -0
- package/dist/components/file-upload/file-upload-types.js.map +1 -0
- package/dist/components/file-upload/file-upload-utils.js +10 -0
- package/dist/components/file-upload/file-upload-utils.js.map +1 -0
- package/dist/components/file-upload/file-upload.d.ts +2 -2
- package/dist/components/file-upload/file-upload.js +106 -0
- package/dist/components/file-upload/file-upload.js.map +1 -0
- package/dist/components/graph/graph-types.js +2 -0
- package/dist/components/graph/graph-types.js.map +1 -0
- package/dist/components/graph/graph.d.ts +1 -1
- package/dist/components/graph/graph.js +21 -0
- package/dist/components/graph/graph.js.map +1 -0
- package/dist/components/input/date/date-calendar.d.ts +2 -2
- package/dist/components/input/date/date-calendar.js +114 -0
- package/dist/components/input/date/date-calendar.js.map +1 -0
- package/dist/components/input/date/date-input-field.d.ts +2 -2
- package/dist/components/input/date/date-input-field.js +61 -0
- package/dist/components/input/date/date-input-field.js.map +1 -0
- package/dist/components/input/date/date-picker.d.ts +2 -2
- package/dist/components/input/date/date-picker.js +35 -0
- package/dist/components/input/date/date-picker.js.map +1 -0
- package/dist/components/input/date/date-range-input-field.d.ts +2 -2
- package/dist/components/input/date/date-range-input-field.js +90 -0
- package/dist/components/input/date/date-range-input-field.js.map +1 -0
- package/dist/components/input/date/date-range-picker.d.ts +2 -2
- package/dist/components/input/date/date-range-picker.js +74 -0
- package/dist/components/input/date/date-range-picker.js.map +1 -0
- package/dist/components/input/date/date-shortcuts.d.ts +2 -2
- package/dist/components/input/date/date-shortcuts.js +47 -0
- package/dist/components/input/date/date-shortcuts.js.map +1 -0
- package/dist/components/input/date/date-types.d.ts +1 -1
- package/dist/components/input/date/date-types.js +2 -0
- package/dist/components/input/date/date-types.js.map +1 -0
- package/dist/components/input/date/date-utils.d.ts +1 -1
- package/dist/components/input/date/date-utils.js +203 -0
- package/dist/components/input/date/date-utils.js.map +1 -0
- package/dist/components/input/input-types.js +2 -0
- package/dist/components/input/input-types.js.map +1 -0
- package/dist/components/input/input.d.ts +2 -2
- package/dist/components/input/input.js +14 -0
- package/dist/components/input/input.js.map +1 -0
- package/dist/components/input/number/input-number-types.d.ts +1 -1
- package/dist/components/input/number/input-number-types.js +2 -0
- package/dist/components/input/number/input-number-types.js.map +1 -0
- package/dist/components/input/number/input-number.d.ts +2 -2
- package/dist/components/input/number/input-number.js +11 -0
- package/dist/components/input/number/input-number.js.map +1 -0
- package/dist/components/input/text/input-text-types.d.ts +1 -1
- package/dist/components/input/text/input-text-types.js +2 -0
- package/dist/components/input/text/input-text-types.js.map +1 -0
- package/dist/components/input/text/input-text.d.ts +2 -2
- package/dist/components/input/text/input-text.js +8 -0
- package/dist/components/input/text/input-text.js.map +1 -0
- package/dist/components/kbd/kbd-types.js +2 -0
- package/dist/components/kbd/kbd-types.js.map +1 -0
- package/dist/components/kbd/kbd.d.ts +2 -2
- package/dist/components/kbd/kbd.js +12 -0
- package/dist/components/kbd/kbd.js.map +1 -0
- package/dist/components/kbd-group/kbd-group-types.js +2 -0
- package/dist/components/kbd-group/kbd-group-types.js.map +1 -0
- package/dist/components/kbd-group/kbd-group.d.ts +2 -2
- package/dist/components/kbd-group/kbd-group.js +15 -0
- package/dist/components/kbd-group/kbd-group.js.map +1 -0
- package/dist/components/list/list-types.d.ts +1 -1
- package/dist/components/list/list-types.js +2 -0
- package/dist/components/list/list-types.js.map +1 -0
- package/dist/components/list/list-utils.d.ts +4 -4
- package/dist/components/list/list-utils.js +73 -0
- package/dist/components/list/list-utils.js.map +1 -0
- package/dist/components/list/list.d.ts +1 -1
- package/dist/components/list/list.d.ts.map +1 -1
- package/dist/components/list/list.js +68 -0
- package/dist/components/list/list.js.map +1 -0
- package/dist/components/menu/anchored-navigation-menu.d.ts +3 -3
- package/dist/components/menu/anchored-navigation-menu.js +48 -0
- package/dist/components/menu/anchored-navigation-menu.js.map +1 -0
- package/dist/components/menu/menu-assets.d.ts +1 -1
- package/dist/components/menu/menu-assets.js +35 -0
- package/dist/components/menu/menu-assets.js.map +1 -0
- package/dist/components/menu/menu-types.d.ts +2 -2
- package/dist/components/menu/menu-types.js +2 -0
- package/dist/components/menu/menu-types.js.map +1 -0
- package/dist/components/menu/menu.d.ts +2 -2
- package/dist/components/menu/menu.js +86 -0
- package/dist/components/menu/menu.js.map +1 -0
- package/dist/components/otp/otp-types.js +2 -0
- package/dist/components/otp/otp-types.js.map +1 -0
- package/dist/components/otp/otp-utils.js +22 -0
- package/dist/components/otp/otp-utils.js.map +1 -0
- package/dist/components/otp/otp.d.ts +3 -2
- package/dist/components/otp/otp.js +85 -0
- package/dist/components/otp/otp.js.map +1 -0
- package/dist/components/select/select-types.d.ts +1 -1
- package/dist/components/select/select-types.js +2 -0
- package/dist/components/select/select-types.js.map +1 -0
- package/dist/components/select/select.d.ts +2 -2
- package/dist/components/select/select.js +52 -0
- package/dist/components/select/select.js.map +1 -0
- package/dist/components/tag/tag-types.d.ts +1 -1
- package/dist/components/tag/tag-types.js +2 -0
- package/dist/components/tag/tag-types.js.map +1 -0
- package/dist/components/tag/tag.d.ts +2 -2
- package/dist/components/tag/tag.js +16 -0
- package/dist/components/tag/tag.js.map +1 -0
- package/dist/components/textarea/textarea-types.d.ts +2 -2
- package/dist/components/textarea/textarea-types.js +2 -0
- package/dist/components/textarea/textarea-types.js.map +1 -0
- package/dist/components/textarea/textarea.d.ts +2 -2
- package/dist/components/textarea/textarea.js +19 -0
- package/dist/components/textarea/textarea.js.map +1 -0
- package/dist/components/toast-group/toast-group-types.d.ts +1 -1
- package/dist/components/toast-group/toast-group-types.js +2 -0
- package/dist/components/toast-group/toast-group-types.js.map +1 -0
- package/dist/components/toast-group/toast-group.d.ts +2 -2
- package/dist/components/toast-group/toast-group.js +25 -0
- package/dist/components/toast-group/toast-group.js.map +1 -0
- package/dist/components/typography/typography-types.d.ts +1 -1
- package/dist/components/typography/typography-types.js +11 -0
- package/dist/components/typography/typography-types.js.map +1 -0
- package/dist/components/typography/typography.d.ts +2 -2
- package/dist/components/typography/typography.js +17 -0
- package/dist/components/typography/typography.js.map +1 -0
- package/dist/custom-components/chat/chat-types.d.ts +1 -1
- package/dist/custom-components/chat/chat-types.js +2 -0
- package/dist/custom-components/chat/chat-types.js.map +1 -0
- package/dist/custom-components/chat/chat.d.ts +1 -1
- package/dist/custom-components/chat/chat.js +14 -0
- package/dist/custom-components/chat/chat.js.map +1 -0
- package/dist/custom-components/layout/layout-types.js +2 -0
- package/dist/custom-components/layout/layout-types.js.map +1 -0
- package/dist/custom-components/layout/layout.d.ts +2 -2
- package/dist/custom-components/layout/layout.js +46 -0
- package/dist/custom-components/layout/layout.js.map +1 -0
- package/dist/custom-components/layout-builder/layout-builder-constants.js +25 -0
- package/dist/custom-components/layout-builder/layout-builder-constants.js.map +1 -0
- package/dist/custom-components/layout-builder/layout-builder-schema.js +169 -0
- package/dist/custom-components/layout-builder/layout-builder-schema.js.map +1 -0
- package/dist/custom-components/layout-builder/layout-builder-templates.js +206 -0
- package/dist/custom-components/layout-builder/layout-builder-templates.js.map +1 -0
- package/dist/custom-components/layout-builder/layout-builder-types.js +2 -0
- package/dist/custom-components/layout-builder/layout-builder-types.js.map +1 -0
- package/dist/custom-components/layout-builder/layout-builder-utils.js +251 -0
- package/dist/custom-components/layout-builder/layout-builder-utils.js.map +1 -0
- package/dist/custom-components/layout-builder/layout-builder-validation.d.ts +8 -2
- package/dist/custom-components/layout-builder/layout-builder-validation.js +445 -0
- package/dist/custom-components/layout-builder/layout-builder-validation.js.map +1 -0
- package/dist/custom-components/layout-builder/layout-builder.d.ts +2 -2
- package/dist/custom-components/layout-builder/layout-builder.js +908 -0
- package/dist/custom-components/layout-builder/layout-builder.js.map +1 -0
- package/dist/custom-components/layout-builder/layout-json-editor-types.d.ts +1 -1
- package/dist/custom-components/layout-builder/layout-json-editor-types.js +2 -0
- package/dist/custom-components/layout-builder/layout-json-editor-types.js.map +1 -0
- package/dist/custom-components/layout-builder/layout-json-editor.d.ts +2 -2
- package/dist/custom-components/layout-builder/layout-json-editor.js +103 -0
- package/dist/custom-components/layout-builder/layout-json-editor.js.map +1 -0
- package/dist/custom-components/layout-builder/stories/hooks/useHistory.js +100 -0
- package/dist/custom-components/layout-builder/stories/hooks/useHistory.js.map +1 -0
- package/dist/custom-components/markdown/markdown-types.d.ts +3 -3
- package/dist/custom-components/markdown/markdown-types.js +2 -0
- package/dist/custom-components/markdown/markdown-types.js.map +1 -0
- package/dist/custom-components/markdown/markdown-utils.js +10 -0
- package/dist/custom-components/markdown/markdown-utils.js.map +1 -0
- package/dist/custom-components/markdown/markdown.d.ts +2 -2
- package/dist/custom-components/markdown/markdown.js +39 -0
- package/dist/custom-components/markdown/markdown.js.map +1 -0
- package/dist/custom-components/mindmap/index.d.ts +2 -2
- package/dist/custom-components/mindmap/index.js +2 -0
- package/dist/custom-components/mindmap/index.js.map +1 -0
- package/dist/custom-components/mindmap/mind-tree-types.d.ts +1 -1
- package/dist/custom-components/mindmap/mind-tree-types.js +2 -0
- package/dist/custom-components/mindmap/mind-tree-types.js.map +1 -0
- package/dist/custom-components/mindmap/mind-tree.d.ts +1 -1
- package/dist/custom-components/mindmap/mind-tree.js +201 -0
- package/dist/custom-components/mindmap/mind-tree.js.map +1 -0
- package/dist/custom-components/mindmap/reingold-tilford-algorithm.d.ts +1 -1
- package/dist/custom-components/mindmap/reingold-tilford-algorithm.js +277 -0
- package/dist/custom-components/mindmap/reingold-tilford-algorithm.js.map +1 -0
- package/dist/custom-components/shortcut-tooltip/shortcut-tooltip-types.js +2 -0
- package/dist/custom-components/shortcut-tooltip/shortcut-tooltip-types.js.map +1 -0
- package/dist/custom-components/shortcut-tooltip/shortcut-tooltip.d.ts +2 -2
- package/dist/custom-components/shortcut-tooltip/shortcut-tooltip.js +32 -0
- package/dist/custom-components/shortcut-tooltip/shortcut-tooltip.js.map +1 -0
- package/dist/custom-components/timeline/skeleton/timeline-skeleton.d.ts +1 -1
- package/dist/custom-components/timeline/skeleton/timeline-skeleton.js +19 -0
- package/dist/custom-components/timeline/skeleton/timeline-skeleton.js.map +1 -0
- package/dist/custom-components/timeline/timeline-types.js +2 -0
- package/dist/custom-components/timeline/timeline-types.js.map +1 -0
- package/dist/custom-components/timeline/timeline.d.ts +2 -2
- package/dist/custom-components/timeline/timeline.js +64 -0
- package/dist/custom-components/timeline/timeline.js.map +1 -0
- package/dist/custom-components/workflow/layout/workflow-edge.d.ts +1 -1
- package/dist/custom-components/workflow/layout/workflow-edge.js +31 -0
- package/dist/custom-components/workflow/layout/workflow-edge.js.map +1 -0
- package/dist/custom-components/workflow/layout/workflow-layout-types.d.ts +1 -1
- package/dist/custom-components/workflow/layout/workflow-layout-types.js +2 -0
- package/dist/custom-components/workflow/layout/workflow-layout-types.js.map +1 -0
- package/dist/custom-components/workflow/layout/workflow-layout.d.ts +2 -2
- package/dist/custom-components/workflow/layout/workflow-layout.js +284 -0
- package/dist/custom-components/workflow/layout/workflow-layout.js.map +1 -0
- package/dist/custom-components/workflow/node/workflow-node.d.ts +1 -1
- package/dist/custom-components/workflow/node/workflow-node.js +22 -0
- package/dist/custom-components/workflow/node/workflow-node.js.map +1 -0
- package/dist/custom-components/workflow/panel/workflow-panel-types.d.ts +1 -1
- package/dist/custom-components/workflow/panel/workflow-panel-types.js +2 -0
- package/dist/custom-components/workflow/panel/workflow-panel-types.js.map +1 -0
- package/dist/custom-components/workflow/panel/workflow-panel.d.ts +1 -1
- package/dist/custom-components/workflow/panel/workflow-panel.js +53 -0
- package/dist/custom-components/workflow/panel/workflow-panel.js.map +1 -0
- package/dist/custom-components/workflow/toolbar/workflow-toolbar-types.js +2 -0
- package/dist/custom-components/workflow/toolbar/workflow-toolbar-types.js.map +1 -0
- package/dist/custom-components/workflow/toolbar/workflow-toolbar.d.ts +1 -1
- package/dist/custom-components/workflow/toolbar/workflow-toolbar.js +19 -0
- package/dist/custom-components/workflow/toolbar/workflow-toolbar.js.map +1 -0
- package/dist/custom-components/workflow/utils/workflow-validation.d.ts +2 -2
- package/dist/custom-components/workflow/utils/workflow-validation.js +257 -0
- package/dist/custom-components/workflow/utils/workflow-validation.js.map +1 -0
- package/dist/custom-components/workflow/workflow-types.d.ts +3 -3
- package/dist/custom-components/workflow/workflow-types.js +2 -0
- package/dist/custom-components/workflow/workflow-types.js.map +1 -0
- package/dist/custom-components/workflow/workflow.d.ts +1 -1
- package/dist/custom-components/workflow/workflow.js +125 -0
- package/dist/custom-components/workflow/workflow.js.map +1 -0
- package/dist/data-components/assets/data-components-asset.js +2 -0
- package/dist/data-components/assets/data-components-asset.js.map +1 -0
- package/dist/data-components/calendar/calendar-types.d.ts +1 -1
- package/dist/data-components/calendar/calendar-types.js +2 -0
- package/dist/data-components/calendar/calendar-types.js.map +1 -0
- package/dist/data-components/calendar/calendar-utils.js +2 -0
- package/dist/data-components/calendar/calendar-utils.js.map +1 -0
- package/dist/data-components/calendar/calendar.d.ts +1 -1
- package/dist/data-components/calendar/calendar.js +78 -0
- package/dist/data-components/calendar/calendar.js.map +1 -0
- package/dist/data-components/cell/cell-switch.d.ts +1 -1
- package/dist/data-components/cell/cell-switch.js +68 -0
- package/dist/data-components/cell/cell-switch.js.map +1 -0
- package/dist/data-components/cell/cell-types.d.ts +2 -2
- package/dist/data-components/cell/cell-types.js +2 -0
- package/dist/data-components/cell/cell-types.js.map +1 -0
- package/dist/data-components/cell/cell-utils.js +60 -0
- package/dist/data-components/cell/cell-utils.js.map +1 -0
- package/dist/data-components/cell/cell.d.ts +1 -1
- package/dist/data-components/cell/cell.js +63 -0
- package/dist/data-components/cell/cell.js.map +1 -0
- package/dist/data-components/chart/chart-types.d.ts +1 -1
- package/dist/data-components/chart/chart-types.js +2 -0
- package/dist/data-components/chart/chart-types.js.map +1 -0
- package/dist/data-components/chart/chart.d.ts +1 -1
- package/dist/data-components/chart/chart.js +121 -0
- package/dist/data-components/chart/chart.js.map +1 -0
- package/dist/data-components/chart/sankey/sankeyChart.d.ts +1 -1
- package/dist/data-components/chart/sankey/sankeyChart.js +111 -0
- package/dist/data-components/chart/sankey/sankeyChart.js.map +1 -0
- package/dist/data-components/data-structure/data-structure-utils.d.ts +1 -1
- package/dist/data-components/data-structure/data-structure-utils.js +28 -0
- package/dist/data-components/data-structure/data-structure-utils.js.map +1 -0
- package/dist/data-components/data-structure/data-structure.d.ts +1 -1
- package/dist/data-components/data-structure/data-structure.js +2 -0
- package/dist/data-components/data-structure/data-structure.js.map +1 -0
- package/dist/data-components/data-structure/stories-assets.d.ts +5 -1
- package/dist/data-components/data-structure/stories-assets.js +199 -0
- package/dist/data-components/data-structure/stories-assets.js.map +1 -0
- package/dist/data-components/form/form-types.d.ts +2 -2
- package/dist/data-components/form/form-types.js +2 -0
- package/dist/data-components/form/form-types.js.map +1 -0
- package/dist/data-components/form/form.d.ts +1 -1
- package/dist/data-components/form/form.js +124 -0
- package/dist/data-components/form/form.js.map +1 -0
- package/dist/data-components/table-grid/aggregation/aggregation-utils.js +31 -0
- package/dist/data-components/table-grid/aggregation/aggregation-utils.js.map +1 -0
- package/dist/data-components/table-grid/ai-assistant/ai-assistant-executor.d.ts +1 -1
- package/dist/data-components/table-grid/ai-assistant/ai-assistant-executor.js +264 -0
- package/dist/data-components/table-grid/ai-assistant/ai-assistant-executor.js.map +1 -0
- package/dist/data-components/table-grid/ai-assistant/ai-assistant-mock.d.ts +1 -1
- package/dist/data-components/table-grid/ai-assistant/ai-assistant-mock.js +306 -0
- package/dist/data-components/table-grid/ai-assistant/ai-assistant-mock.js.map +1 -0
- package/dist/data-components/table-grid/ai-assistant/ai-assistant-panel-types.d.ts +1 -1
- package/dist/data-components/table-grid/ai-assistant/ai-assistant-panel-types.js +2 -0
- package/dist/data-components/table-grid/ai-assistant/ai-assistant-panel-types.js.map +1 -0
- package/dist/data-components/table-grid/ai-assistant/ai-assistant-panel.d.ts +1 -1
- package/dist/data-components/table-grid/ai-assistant/ai-assistant-panel.js +33 -0
- package/dist/data-components/table-grid/ai-assistant/ai-assistant-panel.js.map +1 -0
- package/dist/data-components/table-grid/ai-assistant/ai-assistant-schema.d.ts +2 -2
- package/dist/data-components/table-grid/ai-assistant/ai-assistant-schema.js +59 -0
- package/dist/data-components/table-grid/ai-assistant/ai-assistant-schema.js.map +1 -0
- package/dist/data-components/table-grid/ai-assistant/ai-assistant-tools.d.ts +1 -1
- package/dist/data-components/table-grid/ai-assistant/ai-assistant-tools.js +167 -0
- package/dist/data-components/table-grid/ai-assistant/ai-assistant-tools.js.map +1 -0
- package/dist/data-components/table-grid/ai-assistant/ai-assistant-types.d.ts +1 -1
- package/dist/data-components/table-grid/ai-assistant/ai-assistant-types.js +2 -0
- package/dist/data-components/table-grid/ai-assistant/ai-assistant-types.js.map +1 -0
- package/dist/data-components/table-grid/ai-assistant/ai-assistant-validator.d.ts +2 -2
- package/dist/data-components/table-grid/ai-assistant/ai-assistant-validator.js +157 -0
- package/dist/data-components/table-grid/ai-assistant/ai-assistant-validator.js.map +1 -0
- package/dist/data-components/table-grid/external-functionalities/import/csv/autoDetect.js +27 -0
- package/dist/data-components/table-grid/external-functionalities/import/csv/autoDetect.js.map +1 -0
- package/dist/data-components/table-grid/external-functionalities/import/csv/createDataStructureFromFile.d.ts +1 -1
- package/dist/data-components/table-grid/external-functionalities/import/csv/createDataStructureFromFile.js +21 -0
- package/dist/data-components/table-grid/external-functionalities/import/csv/createDataStructureFromFile.js.map +1 -0
- package/dist/data-components/table-grid/external-functionalities/import/csv/csvToObj.js +21 -0
- package/dist/data-components/table-grid/external-functionalities/import/csv/csvToObj.js.map +1 -0
- package/dist/data-components/table-grid/external-functionalities/import/csv/detectDelimeter.js +12 -0
- package/dist/data-components/table-grid/external-functionalities/import/csv/detectDelimeter.js.map +1 -0
- package/dist/data-components/table-grid/external-functionalities/import/csv/index.d.ts +6 -6
- package/dist/data-components/table-grid/external-functionalities/import/csv/index.js +7 -0
- package/dist/data-components/table-grid/external-functionalities/import/csv/index.js.map +1 -0
- package/dist/data-components/table-grid/external-functionalities/import/csv/inferColumns.d.ts +1 -1
- package/dist/data-components/table-grid/external-functionalities/import/csv/inferColumns.js +15 -0
- package/dist/data-components/table-grid/external-functionalities/import/csv/inferColumns.js.map +1 -0
- package/dist/data-components/table-grid/external-functionalities/import/csv/parseDelimeted.js +50 -0
- package/dist/data-components/table-grid/external-functionalities/import/csv/parseDelimeted.js.map +1 -0
- package/dist/data-components/table-grid/footer/table-grid-footer-types.d.ts +1 -1
- package/dist/data-components/table-grid/footer/table-grid-footer-types.js +2 -0
- package/dist/data-components/table-grid/footer/table-grid-footer-types.js.map +1 -0
- package/dist/data-components/table-grid/footer/table-grid-footer.d.ts +1 -1
- package/dist/data-components/table-grid/footer/table-grid-footer.js +47 -0
- package/dist/data-components/table-grid/footer/table-grid-footer.js.map +1 -0
- package/dist/data-components/table-grid/formula/evaluator.js +91 -0
- package/dist/data-components/table-grid/formula/evaluator.js.map +1 -0
- package/dist/data-components/table-grid/formula/formula-builder-types.d.ts +1 -1
- package/dist/data-components/table-grid/formula/formula-builder-types.js +2 -0
- package/dist/data-components/table-grid/formula/formula-builder-types.js.map +1 -0
- package/dist/data-components/table-grid/formula/formula-builder.d.ts +1 -1
- package/dist/data-components/table-grid/formula/formula-builder.js +47 -0
- package/dist/data-components/table-grid/formula/formula-builder.js.map +1 -0
- package/dist/data-components/table-grid/formula/formula.test.js +50 -0
- package/dist/data-components/table-grid/formula/formula.test.js.map +1 -0
- package/dist/data-components/table-grid/formula/index.js +40 -0
- package/dist/data-components/table-grid/formula/index.js.map +1 -0
- package/dist/data-components/table-grid/formula/parser.js +179 -0
- package/dist/data-components/table-grid/formula/parser.js.map +1 -0
- package/dist/data-components/table-grid/formula/tokenizer.js +140 -0
- package/dist/data-components/table-grid/formula/tokenizer.js.map +1 -0
- package/dist/data-components/table-grid/formula/types.js +2 -0
- package/dist/data-components/table-grid/formula/types.js.map +1 -0
- package/dist/data-components/table-grid/header/grouping/group-panel-types.d.ts +1 -1
- package/dist/data-components/table-grid/header/grouping/group-panel-types.js +2 -0
- package/dist/data-components/table-grid/header/grouping/group-panel-types.js.map +1 -0
- package/dist/data-components/table-grid/header/grouping/group-panel.d.ts +1 -1
- package/dist/data-components/table-grid/header/grouping/group-panel.js +91 -0
- package/dist/data-components/table-grid/header/grouping/group-panel.js.map +1 -0
- package/dist/data-components/table-grid/header/table-grid-column-menu.d.ts +1 -1
- package/dist/data-components/table-grid/header/table-grid-column-menu.js +84 -0
- package/dist/data-components/table-grid/header/table-grid-column-menu.js.map +1 -0
- package/dist/data-components/table-grid/header/table-grid-header-types.d.ts +1 -1
- package/dist/data-components/table-grid/header/table-grid-header-types.js +2 -0
- package/dist/data-components/table-grid/header/table-grid-header-types.js.map +1 -0
- package/dist/data-components/table-grid/header/table-grid-header.d.ts +1 -1
- package/dist/data-components/table-grid/header/table-grid-header.js +148 -0
- package/dist/data-components/table-grid/header/table-grid-header.js.map +1 -0
- package/dist/data-components/table-grid/hooks/use-table.d.ts +1 -1
- package/dist/data-components/table-grid/hooks/use-table.js +18 -0
- package/dist/data-components/table-grid/hooks/use-table.js.map +1 -0
- package/dist/data-components/table-grid/pinning/pinning-utils.d.ts +1 -1
- package/dist/data-components/table-grid/pinning/pinning-utils.js +70 -0
- package/dist/data-components/table-grid/pinning/pinning-utils.js.map +1 -0
- package/dist/data-components/table-grid/pivot/pivot-config-panel-types.d.ts +2 -2
- package/dist/data-components/table-grid/pivot/pivot-config-panel-types.js +2 -0
- package/dist/data-components/table-grid/pivot/pivot-config-panel-types.js.map +1 -0
- package/dist/data-components/table-grid/pivot/pivot-config-panel.d.ts +1 -1
- package/dist/data-components/table-grid/pivot/pivot-config-panel.js +89 -0
- package/dist/data-components/table-grid/pivot/pivot-config-panel.js.map +1 -0
- package/dist/data-components/table-grid/pivot/pivot-table.d.ts +1 -1
- package/dist/data-components/table-grid/pivot/pivot-table.js +26 -0
- package/dist/data-components/table-grid/pivot/pivot-table.js.map +1 -0
- package/dist/data-components/table-grid/pivot/pivot-types.d.ts +1 -1
- package/dist/data-components/table-grid/pivot/pivot-types.js +2 -0
- package/dist/data-components/table-grid/pivot/pivot-types.js.map +1 -0
- package/dist/data-components/table-grid/pivot/pivot-utils.d.ts +2 -2
- package/dist/data-components/table-grid/pivot/pivot-utils.js +150 -0
- package/dist/data-components/table-grid/pivot/pivot-utils.js.map +1 -0
- package/dist/data-components/table-grid/row/table-grid-row-types.d.ts +3 -1
- package/dist/data-components/table-grid/row/table-grid-row-types.d.ts.map +1 -1
- package/dist/data-components/table-grid/row/table-grid-row-types.js +2 -0
- package/dist/data-components/table-grid/row/table-grid-row-types.js.map +1 -0
- package/dist/data-components/table-grid/row/table-grid-row-utils.d.ts +2 -2
- package/dist/data-components/table-grid/row/table-grid-row-utils.js +35 -0
- package/dist/data-components/table-grid/row/table-grid-row-utils.js.map +1 -0
- package/dist/data-components/table-grid/row/table-grid-row.d.ts +2 -2
- package/dist/data-components/table-grid/row/table-grid-row.d.ts.map +1 -1
- package/dist/data-components/table-grid/row/table-grid-row.js +68 -0
- package/dist/data-components/table-grid/row/table-grid-row.js.map +1 -0
- package/dist/data-components/table-grid/selection/selection-types.js +2 -0
- package/dist/data-components/table-grid/selection/selection-types.js.map +1 -0
- package/dist/data-components/table-grid/selection/selection-utils.d.ts +2 -2
- package/dist/data-components/table-grid/selection/selection-utils.js +136 -0
- package/dist/data-components/table-grid/selection/selection-utils.js.map +1 -0
- package/dist/data-components/table-grid/sidebar/table-grid-sidebar-types.js +2 -0
- package/dist/data-components/table-grid/sidebar/table-grid-sidebar-types.js.map +1 -0
- package/dist/data-components/table-grid/sidebar/table-grid-sidebar.d.ts +1 -1
- package/dist/data-components/table-grid/sidebar/table-grid-sidebar.js +7 -0
- package/dist/data-components/table-grid/sidebar/table-grid-sidebar.js.map +1 -0
- package/dist/data-components/table-grid/sorting/sorting.d.ts +1 -1
- package/dist/data-components/table-grid/sorting/sorting.js +45 -0
- package/dist/data-components/table-grid/sorting/sorting.js.map +1 -0
- package/dist/data-components/table-grid/table-context/table-context-types.d.ts +2 -2
- package/dist/data-components/table-grid/table-context/table-context-types.js +2 -0
- package/dist/data-components/table-grid/table-context/table-context-types.js.map +1 -0
- package/dist/data-components/table-grid/table-context/table-context.d.ts +2 -2
- package/dist/data-components/table-grid/table-context/table-context.js +4 -0
- package/dist/data-components/table-grid/table-context/table-context.js.map +1 -0
- package/dist/data-components/table-grid/table-grid-context.d.ts +2 -2
- package/dist/data-components/table-grid/table-grid-context.d.ts.map +1 -1
- package/dist/data-components/table-grid/table-grid-context.js +258 -0
- package/dist/data-components/table-grid/table-grid-context.js.map +1 -0
- package/dist/data-components/table-grid/table-grid-types.d.ts +9 -7
- package/dist/data-components/table-grid/table-grid-types.d.ts.map +1 -1
- package/dist/data-components/table-grid/table-grid-types.js +2 -0
- package/dist/data-components/table-grid/table-grid-types.js.map +1 -0
- package/dist/data-components/table-grid/table-grid.d.ts +1 -1
- package/dist/data-components/table-grid/table-grid.d.ts.map +1 -1
- package/dist/data-components/table-grid/table-grid.js +144 -0
- package/dist/data-components/table-grid/table-grid.js.map +1 -0
- package/dist/data-components/table-grid/table-utils.d.ts +1 -1
- package/dist/data-components/table-grid/table-utils.js +116 -0
- package/dist/data-components/table-grid/table-utils.js.map +1 -0
- package/dist/experimental-components/contribution-heatmap/contribution-heatmap-types.js +2 -0
- package/dist/experimental-components/contribution-heatmap/contribution-heatmap-types.js.map +1 -0
- package/dist/experimental-components/contribution-heatmap/contribution-heatmap-utils.d.ts +1 -1
- package/dist/experimental-components/contribution-heatmap/contribution-heatmap-utils.js +61 -0
- package/dist/experimental-components/contribution-heatmap/contribution-heatmap-utils.js.map +1 -0
- package/dist/experimental-components/contribution-heatmap/contribution-heatmap.d.ts +2 -2
- package/dist/experimental-components/contribution-heatmap/contribution-heatmap.js +23 -0
- package/dist/experimental-components/contribution-heatmap/contribution-heatmap.js.map +1 -0
- package/dist/experimental-components/filter-builder/filter-builder-types.d.ts +1 -1
- package/dist/experimental-components/filter-builder/filter-builder-types.js +2 -0
- package/dist/experimental-components/filter-builder/filter-builder-types.js.map +1 -0
- package/dist/experimental-components/filter-builder/filter-builder.d.ts +3 -2
- package/dist/experimental-components/filter-builder/filter-builder.js +139 -0
- package/dist/experimental-components/filter-builder/filter-builder.js.map +1 -0
- package/dist/framework-components/appbar/appbar-assets.js +5 -0
- package/dist/framework-components/appbar/appbar-assets.js.map +1 -0
- package/dist/framework-components/appbar/appbar-types.d.ts +1 -1
- package/dist/framework-components/appbar/appbar-types.js +2 -0
- package/dist/framework-components/appbar/appbar-types.js.map +1 -0
- package/dist/framework-components/appbar/appbar.d.ts +2 -2
- package/dist/framework-components/appbar/appbar.js +36 -0
- package/dist/framework-components/appbar/appbar.js.map +1 -0
- package/dist/framework-components/breadcrumbs/breadcrumbs-types.js +2 -0
- package/dist/framework-components/breadcrumbs/breadcrumbs-types.js.map +1 -0
- package/dist/framework-components/breadcrumbs/breadcrumbs.d.ts +2 -2
- package/dist/framework-components/breadcrumbs/breadcrumbs.js +31 -0
- package/dist/framework-components/breadcrumbs/breadcrumbs.js.map +1 -0
- package/dist/framework-components/drawer/drawer-types.d.ts +2 -2
- package/dist/framework-components/drawer/drawer-types.js +2 -0
- package/dist/framework-components/drawer/drawer-types.js.map +1 -0
- package/dist/framework-components/drawer/drawer.d.ts +2 -2
- package/dist/framework-components/drawer/drawer.js +10 -0
- package/dist/framework-components/drawer/drawer.js.map +1 -0
- package/dist/framework-components/scaffold/scaffold-context.d.ts +2 -2
- package/dist/framework-components/scaffold/scaffold-context.js +10 -0
- package/dist/framework-components/scaffold/scaffold-context.js.map +1 -0
- package/dist/framework-components/scaffold/scaffold-types.d.ts +1 -1
- package/dist/framework-components/scaffold/scaffold-types.js +2 -0
- package/dist/framework-components/scaffold/scaffold-types.js.map +1 -0
- package/dist/framework-components/scaffold/scaffold.d.ts +2 -2
- package/dist/framework-components/scaffold/scaffold.js +76 -0
- package/dist/framework-components/scaffold/scaffold.js.map +1 -0
- package/dist/framework-components/sidebar/sidebar-assets.js +4 -0
- package/dist/framework-components/sidebar/sidebar-assets.js.map +1 -0
- package/dist/framework-components/sidebar/sidebar-context.d.ts +2 -2
- package/dist/framework-components/sidebar/sidebar-context.js +9 -0
- package/dist/framework-components/sidebar/sidebar-context.js.map +1 -0
- package/dist/framework-components/sidebar/sidebar-logo/sidebar-logo-types.js +2 -0
- package/dist/framework-components/sidebar/sidebar-logo/sidebar-logo-types.js.map +1 -0
- package/dist/framework-components/sidebar/sidebar-logo/sidebar-logo.d.ts +1 -1
- package/dist/framework-components/sidebar/sidebar-logo/sidebar-logo.js +12 -0
- package/dist/framework-components/sidebar/sidebar-logo/sidebar-logo.js.map +1 -0
- package/dist/framework-components/sidebar/sidebar-types.d.ts +1 -1
- package/dist/framework-components/sidebar/sidebar-types.js +2 -0
- package/dist/framework-components/sidebar/sidebar-types.js.map +1 -0
- package/dist/framework-components/sidebar/sidebar.d.ts +3 -3
- package/dist/framework-components/sidebar/sidebar.js +42 -0
- package/dist/framework-components/sidebar/sidebar.js.map +1 -0
- package/dist/hooks/useDynamicVirtualList.d.ts +76 -0
- package/dist/hooks/useDynamicVirtualList.d.ts.map +1 -0
- package/dist/hooks/useDynamicVirtualList.js +208 -0
- package/dist/hooks/useDynamicVirtualList.js.map +1 -0
- package/dist/hooks/useFixedVirtualList.d.ts +35 -0
- package/dist/hooks/useFixedVirtualList.d.ts.map +1 -0
- package/dist/hooks/useFixedVirtualList.js +64 -0
- package/dist/hooks/useFixedVirtualList.js.map +1 -0
- package/dist/hooks/useShortcut.d.ts +1 -1
- package/dist/hooks/useShortcut.js +86 -0
- package/dist/hooks/useShortcut.js.map +1 -0
- package/dist/hooks/useTour/useTour-context-internal.d.ts +2 -2
- package/dist/hooks/useTour/useTour-context-internal.js +7 -0
- package/dist/hooks/useTour/useTour-context-internal.js.map +1 -0
- package/dist/hooks/useTour/useTour-context.d.ts +3 -3
- package/dist/hooks/useTour/useTour-context.js +54 -0
- package/dist/hooks/useTour/useTour-context.js.map +1 -0
- package/dist/hooks/useTour/useTour-types.d.ts +1 -1
- package/dist/hooks/useTour/useTour-types.js +2 -0
- package/dist/hooks/useTour/useTour-types.js.map +1 -0
- package/dist/hooks/useTour/useTour.d.ts +1 -1
- package/dist/hooks/useTour/useTour.js +408 -0
- package/dist/hooks/useTour/useTour.js.map +1 -0
- package/dist/hooks/useVirtualListScroll.d.ts +1 -1
- package/dist/hooks/useVirtualListScroll.js +79 -0
- package/dist/hooks/useVirtualListScroll.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +63 -0
- package/dist/index.js.map +1 -0
- package/dist/providers/ai-assistant/ai-assistant-prompts.d.ts +1 -1
- package/dist/providers/ai-assistant/ai-assistant-prompts.js +98 -0
- package/dist/providers/ai-assistant/ai-assistant-prompts.js.map +1 -0
- package/dist/providers/ai-assistant/ai-assistant-types.js +5 -0
- package/dist/providers/ai-assistant/ai-assistant-types.js.map +1 -0
- package/dist/providers/ai-assistant/ai-assistant-validator.d.ts +1 -1
- package/dist/providers/ai-assistant/ai-assistant-validator.js +74 -0
- package/dist/providers/ai-assistant/ai-assistant-validator.js.map +1 -0
- package/dist/providers/ai-assistant/ai-chat-panel-types.d.ts +1 -1
- package/dist/providers/ai-assistant/ai-chat-panel-types.js +2 -0
- package/dist/providers/ai-assistant/ai-chat-panel-types.js.map +1 -0
- package/dist/providers/ai-assistant/ai-chat-panel.d.ts +1 -1
- package/dist/providers/ai-assistant/ai-chat-panel.js +111 -0
- package/dist/providers/ai-assistant/ai-chat-panel.js.map +1 -0
- package/dist/providers/shortcut/shortcut-context.d.ts +2 -2
- package/dist/providers/shortcut/shortcut-context.js +7 -0
- package/dist/providers/shortcut/shortcut-context.js.map +1 -0
- package/dist/providers/shortcut/shortcut-provider.d.ts +1 -1
- package/dist/providers/shortcut/shortcut-provider.js +267 -0
- package/dist/providers/shortcut/shortcut-provider.js.map +1 -0
- package/dist/providers/theme/index.js +2 -0
- package/dist/providers/theme/index.js.map +1 -0
- package/dist/providers/theme/theme-provider-types.js +2 -0
- package/dist/providers/theme/theme-provider-types.js.map +1 -0
- package/dist/providers/theme/themeProvider.d.ts +2 -2
- package/dist/providers/theme/themeProvider.js +17 -0
- package/dist/providers/theme/themeProvider.js.map +1 -0
- package/dist/test/vitest.utils.js +2 -0
- package/dist/test/vitest.utils.js.map +1 -0
- package/dist/types/global-types.js +10 -0
- package/dist/types/global-types.js.map +1 -0
- package/dist/types/storybook-types.js +2 -0
- package/dist/types/storybook-types.js.map +1 -0
- package/dist/utility-components/avatar/avatar-types.d.ts +1 -1
- package/dist/utility-components/avatar/avatar-types.js +2 -0
- package/dist/utility-components/avatar/avatar-types.js.map +1 -0
- package/dist/utility-components/avatar/avatar.d.ts +2 -2
- package/dist/utility-components/avatar/avatar.js +10 -0
- package/dist/utility-components/avatar/avatar.js.map +1 -0
- package/dist/utility-components/chip/chip-types.d.ts +2 -2
- package/dist/utility-components/chip/chip-types.js +2 -0
- package/dist/utility-components/chip/chip-types.js.map +1 -0
- package/dist/utility-components/chip/chip.d.ts +2 -2
- package/dist/utility-components/chip/chip.js +11 -0
- package/dist/utility-components/chip/chip.js.map +1 -0
- package/dist/utility-components/helper-text/helper-text-types.d.ts +1 -1
- package/dist/utility-components/helper-text/helper-text-types.js +2 -0
- package/dist/utility-components/helper-text/helper-text-types.js.map +1 -0
- package/dist/utility-components/helper-text/helper-text.d.ts +1 -1
- package/dist/utility-components/helper-text/helper-text.js +12 -0
- package/dist/utility-components/helper-text/helper-text.js.map +1 -0
- package/dist/utility-components/icon/icon-assets.js +95 -0
- package/dist/utility-components/icon/icon-assets.js.map +1 -0
- package/dist/utility-components/icon/icon-types.d.ts +1 -1
- package/dist/utility-components/icon/icon-types.js +2 -0
- package/dist/utility-components/icon/icon-types.js.map +1 -0
- package/dist/utility-components/icon/icon.d.ts +2 -2
- package/dist/utility-components/icon/icon.js +28 -0
- package/dist/utility-components/icon/icon.js.map +1 -0
- package/dist/utility-components/label/label-types.js +2 -0
- package/dist/utility-components/label/label-types.js.map +1 -0
- package/dist/utility-components/label/label.d.ts +1 -1
- package/dist/utility-components/label/label.js +10 -0
- package/dist/utility-components/label/label.js.map +1 -0
- package/dist/utility-components/overlay-panel/overlay-panel-types.js +2 -0
- package/dist/utility-components/overlay-panel/overlay-panel-types.js.map +1 -0
- package/dist/utility-components/overlay-panel/overlay-panel.d.ts +2 -2
- package/dist/utility-components/overlay-panel/overlay-panel.js +98 -0
- package/dist/utility-components/overlay-panel/overlay-panel.js.map +1 -0
- package/dist/utility-components/overlay-panel/use-focus-trap.d.ts +1 -1
- package/dist/utility-components/overlay-panel/use-focus-trap.js +61 -0
- package/dist/utility-components/overlay-panel/use-focus-trap.js.map +1 -0
- package/dist/utility-components/skeleton/skeleton-types.js +2 -0
- package/dist/utility-components/skeleton/skeleton-types.js.map +1 -0
- package/dist/utility-components/skeleton/skeleton.d.ts +2 -2
- package/dist/utility-components/skeleton/skeleton.js +14 -0
- package/dist/utility-components/skeleton/skeleton.js.map +1 -0
- package/dist/utility-components/stack/stack-types.js +2 -0
- package/dist/utility-components/stack/stack-types.js.map +1 -0
- package/dist/utility-components/stack/stack.d.ts +2 -2
- package/dist/utility-components/stack/stack.js +12 -0
- package/dist/utility-components/stack/stack.js.map +1 -0
- package/dist/utility-components/toast/toast-types.d.ts +1 -1
- package/dist/utility-components/toast/toast-types.js +2 -0
- package/dist/utility-components/toast/toast-types.js.map +1 -0
- package/dist/utility-components/toast/toast.d.ts +2 -2
- package/dist/utility-components/toast/toast.js +21 -0
- package/dist/utility-components/toast/toast.js.map +1 -0
- package/dist/utils/general.d.ts +1 -1
- package/dist/utils/general.js +27 -0
- package/dist/utils/general.js.map +1 -0
- package/dist/utils/shortcut-utils.js +164 -0
- package/dist/utils/shortcut-utils.js.map +1 -0
- package/package.json +1 -1
- package/dist/assets/svg/alert.svg +0 -1
- package/dist/assets/svg/arrow-down-up.svg +0 -1
- package/dist/assets/svg/arrow-down.svg +0 -1
- package/dist/assets/svg/arrow-left.svg +0 -1
- package/dist/assets/svg/arrow-right.svg +0 -1
- package/dist/assets/svg/arrow-up.svg +0 -1
- package/dist/assets/svg/arrow_drop_down.svg +0 -1
- package/dist/assets/svg/calendar.svg +0 -1
- package/dist/assets/svg/check.svg +0 -1
- package/dist/assets/svg/chevron-down.svg +0 -1
- package/dist/assets/svg/chevron-right.svg +0 -1
- package/dist/assets/svg/clipboard.svg +0 -1
- package/dist/assets/svg/close.svg +0 -1
- package/dist/assets/svg/copy.svg +0 -1
- package/dist/assets/svg/cursor.svg +0 -1
- package/dist/assets/svg/cut.svg +0 -1
- package/dist/assets/svg/delete.svg +0 -1
- package/dist/assets/svg/dock-left-arrow.svg +0 -1
- package/dist/assets/svg/dock-right-arrow.svg +0 -1
- package/dist/assets/svg/document-outline.svg +0 -1
- package/dist/assets/svg/download.svg +0 -1
- package/dist/assets/svg/drag.svg +0 -1
- package/dist/assets/svg/error.svg +0 -1
- package/dist/assets/svg/expand-right.svg +0 -1
- package/dist/assets/svg/expand.svg +0 -1
- package/dist/assets/svg/eye.svg +0 -1
- package/dist/assets/svg/fullscreen.svg +0 -1
- package/dist/assets/svg/gear.svg +0 -1
- package/dist/assets/svg/groups.svg +0 -1
- package/dist/assets/svg/help.svg +0 -1
- package/dist/assets/svg/info.svg +0 -1
- package/dist/assets/svg/logo.svg +0 -9
- package/dist/assets/svg/menu.svg +0 -1
- package/dist/assets/svg/message-bubble-question-mark.svg +0 -1
- package/dist/assets/svg/pencil.svg +0 -1
- package/dist/assets/svg/plus.svg +0 -1
- package/dist/assets/svg/restio.svg +0 -5
- package/dist/assets/svg/search.svg +0 -1
- package/dist/assets/svg/send.svg +0 -1
- package/dist/assets/svg/shrink-right.svg +0 -1
- package/dist/assets/svg/sidebar.svg +0 -1
- package/dist/assets/svg/terminal.svg +0 -1
- package/dist/assets/svg/timer.svg +0 -1
- package/dist/assets/svg/warning.svg +0 -1
- package/dist/assets/svg/zoom-minus.svg +0 -1
- package/dist/assets/svg/zoom-plus.svg +0 -1
- package/dist/restio-ui.cjs.js +0 -109
- package/dist/restio-ui.es.js +0 -34377
- package/dist/ui.css +0 -2
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React, { useState, useRef, useCallback, useMemo } from "react";
|
|
3
|
+
import { ReingoldTilfordLayout } from "./reingold-tilford-algorithm";
|
|
4
|
+
import styles from "./mind-tree.module.css";
|
|
5
|
+
import { Button } from "../../components/button/button";
|
|
6
|
+
import Typography from "../../components/typography/typography";
|
|
7
|
+
export function MindTree({ data, width = 800, height = 600, nodeSpacing = 80, levelSpacing = 100, nodeWidth = 120, nodeHeight = 40, interactive = true, renderNode, renderLink, onNodeClick, onNodeToggle, layoutType = "hierarchical", className, }) {
|
|
8
|
+
const [collapsedNodes, setCollapsedNodes] = useState(new Set());
|
|
9
|
+
const [transform, setTransform] = useState({ x: 0, y: 0, scale: 1 });
|
|
10
|
+
const [isDragging, setIsDragging] = useState(false);
|
|
11
|
+
const [dragStart, setDragStart] = useState({ x: 0, y: 0 });
|
|
12
|
+
const svgRef = useRef(null);
|
|
13
|
+
// Predefined zoom levels for better UX
|
|
14
|
+
const zoomLevels = useMemo(() => [0.25, 0.5, 0.75, 1, 1.25, 1.5, 2, 3], []);
|
|
15
|
+
const currentZoomIndex = zoomLevels.findIndex((level) => Math.abs(level - transform.scale) < 0.01) ??
|
|
16
|
+
zoomLevels.reduce((closest, level, index) => (Math.abs(level - transform.scale) < Math.abs(zoomLevels[closest] - transform.scale) ? index : closest), 0);
|
|
17
|
+
// Calculate layout using Reingold-Tilford algorithm (always process all nodes)
|
|
18
|
+
const layout = useMemo(() => {
|
|
19
|
+
const algorithm = new ReingoldTilfordLayout({
|
|
20
|
+
siblingSpacing: nodeSpacing,
|
|
21
|
+
levelSpacing: levelSpacing,
|
|
22
|
+
nodeWidth: nodeWidth,
|
|
23
|
+
nodeHeight: nodeHeight,
|
|
24
|
+
layoutType: layoutType,
|
|
25
|
+
});
|
|
26
|
+
return algorithm.layout(data);
|
|
27
|
+
}, [data, nodeSpacing, levelSpacing, nodeWidth, nodeHeight, layoutType]);
|
|
28
|
+
// Calculate which nodes should be visible based on collapsed ancestors
|
|
29
|
+
const visibleNodes = useMemo(() => {
|
|
30
|
+
if (!layout)
|
|
31
|
+
return new Set();
|
|
32
|
+
const visible = new Set();
|
|
33
|
+
function checkVisibility(node) {
|
|
34
|
+
// Root is always visible
|
|
35
|
+
if (!node.parent) {
|
|
36
|
+
visible.add(node.id);
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
// Node is visible if parent is visible and not collapsed
|
|
40
|
+
const parentVisible = visible.has(node.parent.id);
|
|
41
|
+
const parentCollapsed = collapsedNodes.has(node.parent.id);
|
|
42
|
+
if (parentVisible && !parentCollapsed) {
|
|
43
|
+
visible.add(node.id);
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
// Traverse nodes in depth-first order to ensure parents are processed first
|
|
49
|
+
function traverse(node) {
|
|
50
|
+
checkVisibility(node);
|
|
51
|
+
if (node.children) {
|
|
52
|
+
node.children.forEach(traverse);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
traverse(layout.root);
|
|
56
|
+
return visible;
|
|
57
|
+
}, [layout, collapsedNodes]);
|
|
58
|
+
// Handle node toggle (collapse/expand)
|
|
59
|
+
const handleNodeToggle = useCallback((node) => {
|
|
60
|
+
if (!node.children || node.children.length === 0)
|
|
61
|
+
return;
|
|
62
|
+
setCollapsedNodes((prev) => {
|
|
63
|
+
const newSet = new Set(prev);
|
|
64
|
+
if (newSet.has(node.id)) {
|
|
65
|
+
newSet.delete(node.id);
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
newSet.add(node.id);
|
|
69
|
+
}
|
|
70
|
+
return newSet;
|
|
71
|
+
});
|
|
72
|
+
onNodeToggle?.(node);
|
|
73
|
+
}, [onNodeToggle]);
|
|
74
|
+
// Handle node click
|
|
75
|
+
const handleNodeClick = useCallback((node) => {
|
|
76
|
+
onNodeClick?.(node);
|
|
77
|
+
}, [onNodeClick]);
|
|
78
|
+
// Pan and zoom handlers
|
|
79
|
+
const handleMouseDown = useCallback((e) => {
|
|
80
|
+
if (!interactive)
|
|
81
|
+
return;
|
|
82
|
+
setIsDragging(true);
|
|
83
|
+
setDragStart({ x: e.clientX - transform.x, y: e.clientY - transform.y });
|
|
84
|
+
}, [interactive, transform]);
|
|
85
|
+
const handleMouseMove = useCallback((e) => {
|
|
86
|
+
if (!isDragging || !interactive)
|
|
87
|
+
return;
|
|
88
|
+
setTransform((prev) => ({
|
|
89
|
+
...prev,
|
|
90
|
+
x: e.clientX - dragStart.x,
|
|
91
|
+
y: e.clientY - dragStart.y,
|
|
92
|
+
}));
|
|
93
|
+
}, [isDragging, interactive, dragStart]);
|
|
94
|
+
const handleMouseUp = useCallback(() => {
|
|
95
|
+
setIsDragging(false);
|
|
96
|
+
}, []);
|
|
97
|
+
const handleWheel = useCallback((e) => {
|
|
98
|
+
if (!interactive)
|
|
99
|
+
return;
|
|
100
|
+
e.preventDefault();
|
|
101
|
+
const delta = e.deltaY > 0 ? 0.9 : 1.1;
|
|
102
|
+
const newScale = Math.max(0.1, Math.min(3, transform.scale * delta));
|
|
103
|
+
setTransform((prev) => ({
|
|
104
|
+
...prev,
|
|
105
|
+
scale: newScale,
|
|
106
|
+
}));
|
|
107
|
+
}, [interactive, transform.scale]);
|
|
108
|
+
// Add wheel event listener with { passive: false } to allow preventDefault
|
|
109
|
+
React.useEffect(() => {
|
|
110
|
+
const svgElement = svgRef.current;
|
|
111
|
+
if (!svgElement)
|
|
112
|
+
return;
|
|
113
|
+
const wheelHandler = (e) => handleWheel(e);
|
|
114
|
+
svgElement.addEventListener("wheel", wheelHandler, { passive: false });
|
|
115
|
+
return () => {
|
|
116
|
+
svgElement.removeEventListener("wheel", wheelHandler);
|
|
117
|
+
};
|
|
118
|
+
}, [handleWheel]);
|
|
119
|
+
// Control functions with discrete zoom levels
|
|
120
|
+
const zoomIn = useCallback(() => {
|
|
121
|
+
const nextIndex = Math.min(zoomLevels.length - 1, currentZoomIndex + 1);
|
|
122
|
+
setTransform((prev) => ({
|
|
123
|
+
...prev,
|
|
124
|
+
scale: zoomLevels[nextIndex],
|
|
125
|
+
}));
|
|
126
|
+
}, [currentZoomIndex, zoomLevels]);
|
|
127
|
+
const zoomOut = useCallback(() => {
|
|
128
|
+
const prevIndex = Math.max(0, currentZoomIndex - 1);
|
|
129
|
+
setTransform((prev) => ({
|
|
130
|
+
...prev,
|
|
131
|
+
scale: zoomLevels[prevIndex],
|
|
132
|
+
}));
|
|
133
|
+
}, [currentZoomIndex, zoomLevels]);
|
|
134
|
+
const resetView = useCallback(() => {
|
|
135
|
+
setTransform({ x: 0, y: 0, scale: 1 });
|
|
136
|
+
}, []);
|
|
137
|
+
const fitToView = useCallback(() => {
|
|
138
|
+
if (!layout || !svgRef.current)
|
|
139
|
+
return;
|
|
140
|
+
const padding = 50;
|
|
141
|
+
const scaleX = (width - padding * 2) / layout.width;
|
|
142
|
+
const scaleY = (height - padding * 2) / layout.height;
|
|
143
|
+
const scale = Math.min(scaleX, scaleY, 1);
|
|
144
|
+
const x = (width - layout.width * scale) / 2;
|
|
145
|
+
const y = (height - layout.height * scale) / 2;
|
|
146
|
+
setTransform({ x, y, scale });
|
|
147
|
+
}, [layout, width, height]);
|
|
148
|
+
// Auto-fit on initial render
|
|
149
|
+
// useEffect(() => {
|
|
150
|
+
// if (layout) {
|
|
151
|
+
// fitToView();
|
|
152
|
+
// }
|
|
153
|
+
// }, [layout, fitToView]);
|
|
154
|
+
// Helper function to find original node data
|
|
155
|
+
const findOriginalNode = useCallback((rootNode, id) => {
|
|
156
|
+
function findNode(node, targetId) {
|
|
157
|
+
if (node.id === targetId)
|
|
158
|
+
return node;
|
|
159
|
+
if (node.children) {
|
|
160
|
+
for (const child of node.children) {
|
|
161
|
+
const found = findNode(child, targetId);
|
|
162
|
+
if (found)
|
|
163
|
+
return found;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
return null;
|
|
167
|
+
}
|
|
168
|
+
return findNode(rootNode, id);
|
|
169
|
+
}, []);
|
|
170
|
+
// Default node renderer
|
|
171
|
+
const defaultNodeRenderer = useCallback((node, isRoot) => {
|
|
172
|
+
// Check original data for children (not layout children which might be filtered)
|
|
173
|
+
const originalNode = findOriginalNode(data, node.id);
|
|
174
|
+
const hasChildren = originalNode?.children && originalNode.children.length > 0;
|
|
175
|
+
const isCollapsed = collapsedNodes.has(node.id);
|
|
176
|
+
return (_jsxs("g", { className: styles["rst-mind-tree-node"], children: [_jsx("rect", { className: `${styles["rst-mind-tree-node-rect"]} ${isRoot ? styles.root : ""}`, x: -nodeWidth / 2, y: -nodeHeight / 2, width: nodeWidth, height: nodeHeight, onClick: () => handleNodeClick(node) }), _jsx("text", { className: `${styles["rst-mind-tree-node-text"]} ${isRoot ? styles.root : ""}`, onClick: () => handleNodeClick(node), children: node.id }), hasChildren && (_jsxs("g", { className: styles["rst-mind-tree-expand-button"], transform: `translate(${nodeWidth / 2 - 10}, 0)`, onClick: (e) => {
|
|
177
|
+
e.stopPropagation();
|
|
178
|
+
handleNodeToggle(node);
|
|
179
|
+
}, children: [_jsx("circle", { className: styles["rst-mind-tree-expand-button-circle"], r: "8" }), _jsx("text", { className: styles["rst-mind-tree-expand-button-text"], children: isCollapsed ? "+" : "−" })] }))] }));
|
|
180
|
+
}, [findOriginalNode, data, collapsedNodes, nodeWidth, nodeHeight, handleNodeClick, handleNodeToggle]);
|
|
181
|
+
// Default link renderer
|
|
182
|
+
const defaultLinkRenderer = useCallback((source, target) => {
|
|
183
|
+
const sourceX = source.x;
|
|
184
|
+
const sourceY = source.y + nodeHeight / 2;
|
|
185
|
+
const targetX = target.x;
|
|
186
|
+
const targetY = target.y - nodeHeight / 2;
|
|
187
|
+
// Curved link path
|
|
188
|
+
const midY = sourceY + (targetY - sourceY) / 2;
|
|
189
|
+
const path = `M ${sourceX},${sourceY}
|
|
190
|
+
C ${sourceX},${midY} ${targetX},${midY} ${targetX},${targetY}`;
|
|
191
|
+
return _jsx("path", { className: styles["rst-mind-tree-link"], d: path }, `${source.id}-${target.id}`);
|
|
192
|
+
}, [nodeHeight]);
|
|
193
|
+
if (!layout)
|
|
194
|
+
return null;
|
|
195
|
+
return (_jsxs("div", { className: `${styles["rst-mind-tree"]} ${className || ""}`, children: [_jsx("svg", { ref: svgRef, className: styles["rst-mind-tree-svg"], width: width, height: height, onMouseDown: handleMouseDown, onMouseMove: handleMouseMove, onMouseUp: handleMouseUp, onMouseLeave: handleMouseUp, style: { cursor: isDragging ? "grabbing" : "grab" }, children: _jsxs("g", { className: styles["rst-mind-tree-container"], transform: `translate(${transform.x}, ${transform.y}) scale(${transform.scale})`, children: [_jsx("g", { children: layout.nodes.map((node) => node.children
|
|
196
|
+
?.filter((child) => visibleNodes.has(node.id) && visibleNodes.has(child.id))
|
|
197
|
+
.map((child) => (renderLink ? renderLink(node, child) : defaultLinkRenderer(node, child))) || []) }), _jsx("g", { children: layout.nodes
|
|
198
|
+
.filter((node) => visibleNodes.has(node.id))
|
|
199
|
+
.map((node) => (_jsx("g", { transform: `translate(${node.x}, ${node.y})`, children: renderNode ? renderNode(node, node === layout.root) : defaultNodeRenderer(node, node === layout.root) }, node.id))) })] }) }), interactive && (_jsxs("div", { className: styles["rst-mind-tree-controls"], children: [_jsxs("div", { className: styles["rst-mind-tree-zoom-group"], children: [_jsx(Button, { onClick: zoomOut, value: "-", disabled: currentZoomIndex === 0, title: "Zoom Out" }), _jsx("div", { className: styles["rst-mind-tree-zoom-slider-container"], children: _jsxs(Typography, { variant: "body", children: [Math.round(transform.scale * 100), "%"] }) }), _jsx(Button, { onClick: zoomIn, value: "+", title: "Zoom In", disabled: currentZoomIndex === zoomLevels.length - 1 })] }), _jsx(Button, { onClick: fitToView, value: "⌂", title: "Fit to View" }), _jsx(Button, { onClick: resetView, value: "⟲", title: "Reset View" })] }))] }));
|
|
200
|
+
}
|
|
201
|
+
//# sourceMappingURL=mind-tree.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mind-tree.js","sourceR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AAC,EAAE,CAEX,CACL,CAAC,GACF,IACF,GACA,EAGL,WAAW,IAAI,CACd,eAAK,SAAS,EAAE,MAAM,CAAC,wBAAwB,CAAC,aAC9C,eAAK,SAAS,EAAE,MAAM,CAAC,0BAA0B,CAAC,aAChD,KAAC,MAAM,IAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,gBAAgB,KAAK,CAAC,EAAE,KAAK,EAAC,UAAU,GAAU,EAClG,cAAK,SAAS,EAAE,MAAM,CAAC,qCAAqC,CAAC,YAC3D,MAAC,UAAU,IAAC,OAAO,EAAC,MAAM,aAAE,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,GAAG,GAAG,CAAC,SAAe,GACxE,EACN,KAAC,MAAM,IAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAC,SAAS,EAAC,QAAQ,EAAE,gBAAgB,KAAK,UAAU,CAAC,MAAM,GAAG,CAAC,GAAW,IAChH,EACN,KAAC,MAAM,IAAC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAC,aAAa,GAAU,EACrE,KAAC,MAAM,IAAC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAC,YAAY,GAAU,IAChE,CACP,IACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TreeNode, ReingoldTilfordConfig, TreeLayout } from
|
|
1
|
+
import { TreeNode, ReingoldTilfordConfig, TreeLayout } from "./mind-tree-types";
|
|
2
2
|
/**
|
|
3
3
|
* Implementation of the Reingold-Tilford "tidy" tree layout algorithm
|
|
4
4
|
* Produces aesthetically pleasing tree layouts with minimal edge crossings
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Implementation of the Reingold-Tilford "tidy" tree layout algorithm
|
|
3
|
+
* Produces aesthetically pleasing tree layouts with minimal edge crossings
|
|
4
|
+
*/
|
|
5
|
+
export class ReingoldTilfordLayout {
|
|
6
|
+
config;
|
|
7
|
+
constructor(config) {
|
|
8
|
+
this.config = config;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Main entry point - calculates layout for entire tree
|
|
12
|
+
*/
|
|
13
|
+
layout(root) {
|
|
14
|
+
// Convert tree structure to layout nodes
|
|
15
|
+
const layoutRoot = this.convertToLayoutNode(root, null, 0);
|
|
16
|
+
// Choose layout algorithm based on configuration
|
|
17
|
+
if (this.config.layoutType === "radial") {
|
|
18
|
+
this.calculateRadialPositions(layoutRoot);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
this.calculatePositions(layoutRoot);
|
|
22
|
+
}
|
|
23
|
+
// Collect all nodes and calculate bounds
|
|
24
|
+
const allNodes = this.collectNodes(layoutRoot);
|
|
25
|
+
const bounds = this.calculateBounds(allNodes);
|
|
26
|
+
// Normalize positions to start from 0,0
|
|
27
|
+
this.normalizePositions(allNodes, bounds);
|
|
28
|
+
return {
|
|
29
|
+
nodes: allNodes,
|
|
30
|
+
root: layoutRoot,
|
|
31
|
+
width: Math.max(bounds.maxX - bounds.minX + this.config.nodeWidth, this.config.nodeWidth),
|
|
32
|
+
height: Math.max(bounds.maxY - bounds.minY + this.config.nodeHeight, this.config.nodeHeight),
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Convert TreeNode to LayoutNode with initial values
|
|
37
|
+
*/
|
|
38
|
+
convertToLayoutNode(node, parent, depth) {
|
|
39
|
+
const layoutNode = {
|
|
40
|
+
id: node.id,
|
|
41
|
+
label: node.label,
|
|
42
|
+
data: node.data,
|
|
43
|
+
collapsed: node.collapsed,
|
|
44
|
+
x: 0,
|
|
45
|
+
y: depth * this.config.levelSpacing,
|
|
46
|
+
depth,
|
|
47
|
+
parent: parent || undefined,
|
|
48
|
+
prelim: 0,
|
|
49
|
+
mod: 0,
|
|
50
|
+
thread: undefined,
|
|
51
|
+
change: 0,
|
|
52
|
+
shift: 0,
|
|
53
|
+
ancestor: undefined,
|
|
54
|
+
};
|
|
55
|
+
// Always convert children (collapsed state is handled at rendering level)
|
|
56
|
+
if (node.children) {
|
|
57
|
+
layoutNode.children = node.children.map(child => this.convertToLayoutNode(child, layoutNode, depth + 1));
|
|
58
|
+
}
|
|
59
|
+
return layoutNode;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* First walk of the algorithm - calculate preliminary positions
|
|
63
|
+
*/
|
|
64
|
+
firstWalk(node) {
|
|
65
|
+
if (!node.children || node.children.length === 0) {
|
|
66
|
+
// Leaf node
|
|
67
|
+
let prelim;
|
|
68
|
+
if (this.isLeftmost(node)) {
|
|
69
|
+
prelim = 0;
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
const leftSibling = this.getLeftSibling(node);
|
|
73
|
+
if (leftSibling) {
|
|
74
|
+
prelim = (leftSibling.prelim || 0) + this.config.siblingSpacing + this.config.nodeWidth;
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
prelim = 0;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
Object.assign(node, { prelim });
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
// Internal node
|
|
84
|
+
const leftmostChild = node.children[0];
|
|
85
|
+
const rightmostChild = node.children[node.children.length - 1];
|
|
86
|
+
// Recursively process children
|
|
87
|
+
node.children.forEach(child => this.firstWalk(child));
|
|
88
|
+
// Calculate midpoint of children
|
|
89
|
+
const midpoint = ((leftmostChild.prelim || 0) + (rightmostChild.prelim || 0)) / 2;
|
|
90
|
+
let prelim;
|
|
91
|
+
let mod = 0;
|
|
92
|
+
if (this.isLeftmost(node)) {
|
|
93
|
+
prelim = midpoint;
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
const leftSibling = this.getLeftSibling(node);
|
|
97
|
+
if (leftSibling) {
|
|
98
|
+
prelim = (leftSibling.prelim || 0) + this.config.siblingSpacing + this.config.nodeWidth;
|
|
99
|
+
mod = prelim - midpoint;
|
|
100
|
+
Object.assign(node, { prelim, mod });
|
|
101
|
+
this.apportion(node);
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
prelim = midpoint;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
Object.assign(node, { prelim, mod });
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Second walk - finalize positions by adding modifiers
|
|
113
|
+
*/
|
|
114
|
+
secondWalk(node, m) {
|
|
115
|
+
const x = (node.prelim || 0) + m;
|
|
116
|
+
Object.assign(node, { x });
|
|
117
|
+
if (node.children && node.children.length > 0) {
|
|
118
|
+
const childModifier = m + (node.mod || 0);
|
|
119
|
+
node.children.forEach(child => this.secondWalk(child, childModifier));
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Apportion - resolve conflicts between subtrees (simplified version)
|
|
124
|
+
*/
|
|
125
|
+
apportion(node) {
|
|
126
|
+
if (!node.children || node.children.length === 0)
|
|
127
|
+
return;
|
|
128
|
+
const leftSibling = this.getLeftSibling(node);
|
|
129
|
+
if (!leftSibling)
|
|
130
|
+
return;
|
|
131
|
+
// Check for conflicts between this node's leftmost child and left sibling's rightmost child
|
|
132
|
+
const leftmostChild = node.children[0];
|
|
133
|
+
const rightmostSiblingChild = this.getRightmostDescendant(leftSibling);
|
|
134
|
+
if (leftmostChild && rightmostSiblingChild) {
|
|
135
|
+
const distance = (rightmostSiblingChild.prelim || 0) + this.config.siblingSpacing + this.config.nodeWidth - (leftmostChild.prelim || 0);
|
|
136
|
+
if (distance > 0) {
|
|
137
|
+
// Shift this subtree to avoid conflict
|
|
138
|
+
const shift = distance;
|
|
139
|
+
Object.assign(node, {
|
|
140
|
+
prelim: (node.prelim || 0) + shift,
|
|
141
|
+
mod: (node.mod || 0) + shift
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Get the rightmost descendant at the same level as the given node
|
|
148
|
+
*/
|
|
149
|
+
getRightmostDescendant(node) {
|
|
150
|
+
if (!node.children || node.children.length === 0) {
|
|
151
|
+
return node;
|
|
152
|
+
}
|
|
153
|
+
return this.getRightmostDescendant(node.children[node.children.length - 1]);
|
|
154
|
+
}
|
|
155
|
+
// Helper methods
|
|
156
|
+
isLeftmost(node) {
|
|
157
|
+
return !node.parent || node.parent.children[0] === node;
|
|
158
|
+
}
|
|
159
|
+
getLeftSibling(node) {
|
|
160
|
+
if (!node.parent)
|
|
161
|
+
return undefined;
|
|
162
|
+
const siblings = node.parent.children;
|
|
163
|
+
const index = siblings.indexOf(node);
|
|
164
|
+
return index > 0 ? siblings[index - 1] : undefined;
|
|
165
|
+
}
|
|
166
|
+
getRightmost(node) {
|
|
167
|
+
return node.children && node.children.length > 0
|
|
168
|
+
? node.children[node.children.length - 1]
|
|
169
|
+
: node;
|
|
170
|
+
}
|
|
171
|
+
getLeftmost(node) {
|
|
172
|
+
return node.children && node.children.length > 0
|
|
173
|
+
? node.children[0]
|
|
174
|
+
: node;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Improved positioning algorithm that maintains global layout
|
|
178
|
+
*/
|
|
179
|
+
calculatePositions(node) {
|
|
180
|
+
// First pass: assign preliminary positions
|
|
181
|
+
this.firstWalk(node);
|
|
182
|
+
// Second pass: finalize positions with accumulated modifiers
|
|
183
|
+
this.secondWalk(node, 0);
|
|
184
|
+
}
|
|
185
|
+
collectNodes(root) {
|
|
186
|
+
const nodes = [];
|
|
187
|
+
function traverse(node) {
|
|
188
|
+
nodes.push(node);
|
|
189
|
+
if (node.children) {
|
|
190
|
+
node.children.forEach(traverse);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
traverse(root);
|
|
194
|
+
return nodes;
|
|
195
|
+
}
|
|
196
|
+
calculateBounds(nodes) {
|
|
197
|
+
let minX = Infinity;
|
|
198
|
+
let maxX = -Infinity;
|
|
199
|
+
let minY = Infinity;
|
|
200
|
+
let maxY = -Infinity;
|
|
201
|
+
nodes.forEach(node => {
|
|
202
|
+
minX = Math.min(minX, node.x);
|
|
203
|
+
maxX = Math.max(maxX, node.x);
|
|
204
|
+
minY = Math.min(minY, node.y);
|
|
205
|
+
maxY = Math.max(maxY, node.y);
|
|
206
|
+
});
|
|
207
|
+
return { minX, maxX, minY, maxY };
|
|
208
|
+
}
|
|
209
|
+
normalizePositions(nodes, bounds) {
|
|
210
|
+
const offsetX = -bounds.minX;
|
|
211
|
+
const offsetY = -bounds.minY;
|
|
212
|
+
nodes.forEach(currentNode => {
|
|
213
|
+
const normalizedPosition = {
|
|
214
|
+
x: currentNode.x + offsetX,
|
|
215
|
+
y: currentNode.y + offsetY
|
|
216
|
+
};
|
|
217
|
+
Object.assign(currentNode, normalizedPosition);
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Calculate positions for radial layout
|
|
222
|
+
*/
|
|
223
|
+
calculateRadialPositions(root) {
|
|
224
|
+
// Place root at center
|
|
225
|
+
Object.assign(root, { x: 0, y: 0 });
|
|
226
|
+
// Calculate positions for each level
|
|
227
|
+
this.positionRadialLevel(root, 1);
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Position nodes in a radial pattern level by level
|
|
231
|
+
*/
|
|
232
|
+
positionRadialLevel(node, level) {
|
|
233
|
+
if (!node.children || node.children.length === 0)
|
|
234
|
+
return;
|
|
235
|
+
const radius = level * this.config.levelSpacing;
|
|
236
|
+
const angleStep = (2 * Math.PI) / this.getTotalDescendants(node);
|
|
237
|
+
let currentAngle = this.getStartAngle(node);
|
|
238
|
+
node.children.forEach(child => {
|
|
239
|
+
// Calculate position on circle
|
|
240
|
+
const childAngle = currentAngle + (angleStep * this.getSubtreeSize(child)) / 2;
|
|
241
|
+
const x = node.x + radius * Math.cos(childAngle);
|
|
242
|
+
const y = node.y + radius * Math.sin(childAngle);
|
|
243
|
+
Object.assign(child, { x, y });
|
|
244
|
+
// Move to next angle position
|
|
245
|
+
currentAngle += angleStep * this.getSubtreeSize(child);
|
|
246
|
+
// Recursively position children
|
|
247
|
+
this.positionRadialLevel(child, level + 1);
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Get total number of descendants for angle calculations
|
|
252
|
+
*/
|
|
253
|
+
getTotalDescendants(node) {
|
|
254
|
+
if (!node.children || node.children.length === 0)
|
|
255
|
+
return 1;
|
|
256
|
+
return node.children.reduce((total, child) => total + this.getSubtreeSize(child), 0);
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Get size of subtree (number of leaf nodes)
|
|
260
|
+
*/
|
|
261
|
+
getSubtreeSize(node) {
|
|
262
|
+
if (!node.children || node.children.length === 0)
|
|
263
|
+
return 1;
|
|
264
|
+
return node.children.reduce((total, child) => total + this.getSubtreeSize(child), 0);
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Get starting angle based on parent's position
|
|
268
|
+
*/
|
|
269
|
+
getStartAngle(node) {
|
|
270
|
+
if (!node.parent)
|
|
271
|
+
return -Math.PI / 2; // Start from top for root children
|
|
272
|
+
// Calculate angle from parent to current node
|
|
273
|
+
const parentAngle = Math.atan2(node.y - node.parent.y, node.x - node.parent.x);
|
|
274
|
+
return parentAngle - Math.PI; // Opposite direction
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
//# sourceMappingURL=reingold-tilford-algorithm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reingold-tilford-algorithm.js","sourceRoot":"","sources":["../../../src/custom-components/mindmap/reingold-tilford-algorithm.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,OAAO,qBAAqB;IACxB,MAAM,CAAwB;IAEtC,YAAY,MAA6B;QACvC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAA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C,EAAE,CAAC,CAAC,CAAC;IACvF,CAAC;IAED;;OAEG;IACK,cAAc,CAAC,IAAuB;QAC5C,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,CAAC,CAAC;QAE3D,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;IACvF,CAAC;IAED;;OAEG;IACK,aAAa,CAAC,IAAuB;QAC3C,IAAI,CAAC,IAAI,CAAC,MAAM;YAAE,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,mCAAmC;QAE1E,8CAA8C;QAC9C,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAC/E,OAAO,WAAW,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,qBAAqB;IACrD,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shortcut-tooltip-types.js","sourceRoot":"","sources":["../../../src/custom-components/shortcut-tooltip/shortcut-tooltip-types.ts"],"names":[],"mappings":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ShortcutTooltipProps } from
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ShortcutTooltipProps } from "./shortcut-tooltip-types";
|
|
3
3
|
/**
|
|
4
4
|
* ShortcutTooltip displays visual feedback for keyboard shortcuts near the cursor
|
|
5
5
|
*
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { KbdGroup } from "../../components/kbd-group/kbd-group";
|
|
3
|
+
import styles from "./shortcut-tooltip.module.css";
|
|
4
|
+
import Typography from "../../components/typography/typography";
|
|
5
|
+
/**
|
|
6
|
+
* ShortcutTooltip displays visual feedback for keyboard shortcuts near the cursor
|
|
7
|
+
*
|
|
8
|
+
* Features:
|
|
9
|
+
* - Shows keyboard combination using KbdGroup component
|
|
10
|
+
* - Displays function/action name
|
|
11
|
+
* - Progress bar for hold-to-execute shortcuts
|
|
12
|
+
* - Positioned relative to cursor with automatic offset
|
|
13
|
+
* - Smooth animations and transitions
|
|
14
|
+
*
|
|
15
|
+
* Used internally by ShortcutProvider - typically not used directly
|
|
16
|
+
*
|
|
17
|
+
* @param props - Tooltip configuration including visibility, shortcut keys, and position
|
|
18
|
+
*/
|
|
19
|
+
export const ShortcutTooltip = ({ isVisible, shortcut, functionName, holdDuration, holdProgress = 0, position }) => {
|
|
20
|
+
if (!isVisible)
|
|
21
|
+
return null;
|
|
22
|
+
const progressPercentage = holdDuration && holdProgress > 0 ? Math.min((holdProgress / holdDuration) * 100, 100) : 0;
|
|
23
|
+
return (_jsxs("div", { className: styles["rst-shortcut-tooltip"], style: {
|
|
24
|
+
left: position.x,
|
|
25
|
+
top: position.y,
|
|
26
|
+
transform: "translate(-50%, calc(-100% - 8px))",
|
|
27
|
+
}, children: [_jsxs("div", { className: styles["rst-shortcut-tooltip-content"], children: [_jsx(KbdGroup, { keys: shortcut, showSeparator: true }), _jsx(Typography, { variant: "caption", children: functionName })] }), holdDuration && holdDuration > 0 && (_jsx("div", { className: styles["rst-shortcut-tooltip-progress"], children: _jsx("div", { className: styles["rst-shortcut-tooltip-progress-bar"], style: {
|
|
28
|
+
width: `${progressPercentage}%`,
|
|
29
|
+
minWidth: progressPercentage > 0 ? "2px" : "0px", // Ensure visibility when progress starts
|
|
30
|
+
} }) }))] }));
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=shortcut-tooltip.js.map
|
|
@@ -0,0 +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AQ,EAAE,kBAAkB,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE,yCAAyC;qBAC5F,GACD,GACE,CACP,IACG,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import style from "../timeline.module.css";
|
|
3
|
+
import { Skeleton } from "../../../utility-components/skeleton/skeleton";
|
|
4
|
+
export const TimelineSkeleton = ({ items = 2 }) => {
|
|
5
|
+
const timelineClass = {
|
|
6
|
+
timelineTl: `${style["rst-timeline-tl"]}`,
|
|
7
|
+
timelineList: `${style["rst-timeline-list"]}`,
|
|
8
|
+
timelineItem: `${style["rst-timeline-item"]}`,
|
|
9
|
+
timelineRail: `${style["rst-timeline-rail"]}`,
|
|
10
|
+
timelineLine: `${style["rst-timeline-line"]}`,
|
|
11
|
+
timelineDot: `${style["rst-timeline-dot"]}`,
|
|
12
|
+
timelineNode: `${style["rst-timeline-node"]}`,
|
|
13
|
+
timelineNodeHeader: `${style["rst-timeline-node-header"]}`,
|
|
14
|
+
timelineNodeArticle: `${style["rst-timeline-node-article"]}`,
|
|
15
|
+
};
|
|
16
|
+
return (_jsx("section", { className: timelineClass.timelineTl, "aria-label": "Timeline Skeleton", children: _jsx("ul", { className: timelineClass.timelineList, children: Array.from({ length: items }).map((_, idx) => (_jsxs("li", { className: timelineClass.timelineItem, children: [_jsxs("div", { className: timelineClass.timelineRail, "aria-hidden": true, children: [_jsx("span", { className: timelineClass.timelineDot }), _jsx("span", { className: timelineClass.timelineLine })] }), _jsxs("div", { className: timelineClass.timelineNode, children: [_jsxs("span", { className: timelineClass.timelineNodeHeader, children: [_jsx(Skeleton, { width: 120, height: 16 }), " ", _jsx(Skeleton, { width: 60, height: 12 }), " "] }), _jsxs("article", { className: timelineClass.timelineNodeArticle, children: [_jsx(Skeleton, { width: "100%", height: 12 }), _jsx(Skeleton, { width: "90%", height: 12 }), _jsx(Skeleton, { width: "95%", height: 12 }), _jsx(Skeleton, { width: "100%", height: 120 }), " "] })] })] }, idx))) }) }));
|
|
17
|
+
};
|
|
18
|
+
export default TimelineSkeleton;
|
|
19
|
+
//# sourceMappingURL=timeline-skeleton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline-skeleton.js","sourceRoot":"","sources":["../../../../src/custom-components/timeline/skeleton/timeline-skeleton.tsx"],"names":[],"mappings":";AACA,OAAO,KAAK,MAAM,wBAAwB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAMzE,MAAM,CAAC,MAAM,gBAAgB,GAAoC,CAAC,EAAE,KAAK,GAAG,CAAC,EAAE,EAAE,EAAE;IACjF,MAAM,aAAa,GAAG;QACpB,UAAU,EAAE,GAAG,KAAK,CAAC,iBAAiB,CAAC,EAAE;QACzC,YAAY,EAAE,GAAG,KAAK,CAAC,mBAAmB,CAAC,EAAE;QAC7C,YAAY,EAAE,GAAG,KAAK,CAAC,mBAAmB,CAAC,EAAE;QAC7C,YAAY,EAAE,GAAG,KAAK,CAAC,mBAAmB,CAAC,EAAE;QAC7C,YAAY,EAAE,GAAG,KAAK,CAAC,mBAAmB,CAAC,EAAE;QAC7C,WAAW,EAAE,GAAG,KAAK,CAAC,kBAAkB,CAAC,EAAE;QAC3C,YAAY,EAAE,GAAG,KAAK,CAAC,mBAAmB,CAAC,EAAE;QAC7C,kBAAkB,EAAE,GAAG,KAAK,CAAC,0BAA0B,CAAC,EAAE;QAC1D,mBAAmB,EAAE,GAAG,KAAK,CAAC,2BAA2B,CAAC,EAAE;KAC7D,CAAC;IAEF,OAAO,CACL,kBAAS,SAAS,EAAE,aAAa,CAAC,UAAU,gBAAa,mBAAmB,YAC1E,aAAI,SAAS,EAAE,aAAa,CAAC,YAAY,YACtC,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC,CAC7C,cAAc,SAAS,EAAE,aAAa,CAAC,YAAY,aACjD,eAAK,SAAS,EAAE,aAAa,CAAC,YAAY,kCACxC,eAAM,SAAS,EAAE,aAAa,CAAC,WAAW,GAAI,EAC9C,eAAM,SAAS,EAAE,aAAa,CAAC,YAAY,GAAI,IAC3C,EAGN,eAAK,SAAS,EAAE,aAAa,CAAC,YAAY,aACxC,gBAAM,SAAS,EAAE,aAAa,CAAC,kBAAkB,aAC/C,KAAC,QAAQ,IAAC,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,GAAI,OACpC,KAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,GAAI,SAC9B,EAEP,mBAAS,SAAS,EAAE,aAAa,CAAC,mBAAmB,aACnD,KAAC,QAAQ,IAAC,KAAK,EAAC,MAAM,EAAC,MAAM,EAAE,EAAE,GAAI,EACrC,KAAC,QAAQ,IAAC,KAAK,EAAC,KAAK,EAAC,MAAM,EAAE,EAAE,GAAI,EACpC,KAAC,QAAQ,IAAC,KAAK,EAAC,KAAK,EAAC,MAAM,EAAE,EAAE,GAAI,EACpC,KAAC,QAAQ,IAAC,KAAK,EAAC,MAAM,EAAC,MAAM,EAAE,GAAG,GAAI,SAC9B,IACN,KAnBC,GAAG,CAoBP,CACN,CAAC,GACC,GACG,CACX,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline-types.js","sourceRoot":"","sources":["../../../src/custom-components/timeline/timeline-types.ts"],"names":[],"mappings":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { TimelineProps, TimelineItemProps, TimelineItemIconProps, TimelineItemContentProps, TimelineItemTitleProps, TimelineItemDateProps, TimelineItemDescriptionProps, TimelineItemImageProps } from
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { TimelineProps, TimelineItemProps, TimelineItemIconProps, TimelineItemContentProps, TimelineItemTitleProps, TimelineItemDateProps, TimelineItemDescriptionProps, TimelineItemImageProps } from "./timeline-types";
|
|
3
3
|
declare const TimelineItemIcon: React.FC<TimelineItemIconProps>;
|
|
4
4
|
declare const TimelineItemTitle: React.FC<TimelineItemTitleProps>;
|
|
5
5
|
declare const TimelineItemDate: React.FC<TimelineItemDateProps>;
|