@lostgradient/cinder 0.5.0 → 0.7.0
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/CHANGELOG.md +34 -0
- package/README.md +32 -2
- package/components.json +66 -4
- package/dist/_internal/strict-stable-context.d.ts +9 -0
- package/dist/cli/best-practices.d.ts +2 -0
- package/dist/cli/index.d.ts +14 -0
- package/dist/cli/index.js +978 -0
- package/dist/cli/knowledge.d.ts +23 -0
- package/dist/cli/manifest-validation.d.ts +2 -0
- package/dist/cli/mcp.d.ts +2 -0
- package/dist/cli/output.d.ts +21 -0
- package/dist/cli/types.d.ts +107 -0
- package/dist/components/access-gate/index.js +26 -24
- package/dist/components/accordion/accordion.context.d.ts +2 -3
- package/dist/components/accordion/index.js +22 -8
- package/dist/components/accordion-item/index.js +22 -8
- package/dist/components/action-row/action-row.css +133 -0
- package/dist/components/action-row/action-row.schema.d.ts +3 -0
- package/dist/components/action-row/action-row.schema.js +126 -0
- package/dist/components/action-row/action-row.svelte.d.ts +19 -0
- package/dist/components/action-row/action-row.types.d.ts +45 -0
- package/dist/components/action-row/action-row.variables.d.ts +2 -0
- package/dist/components/action-row/action-row.variables.js +61 -0
- package/dist/components/action-row/index.d.ts +5 -0
- package/dist/components/action-row/index.js +184 -0
- package/dist/components/alert/index.js +19 -18
- package/dist/components/alert-dialog/index.js +62 -62
- package/dist/components/approval-card/approval-card.css +31 -1
- package/dist/components/approval-card/approval-card.schema.js +6 -1
- package/dist/components/approval-card/approval-card.svelte.d.ts +1 -1
- package/dist/components/approval-card/approval-card.types.d.ts +20 -0
- package/dist/components/approval-card/index.d.ts +1 -1
- package/dist/components/approval-card/index.js +1615 -1441
- package/dist/components/area-chart/index.js +65 -67
- package/dist/components/aspect-ratio/index.js +12 -11
- package/dist/components/autocomplete/index.js +138 -63
- package/dist/components/avatar/index.js +31 -29
- package/dist/components/avatar-group/index.js +147 -69
- package/dist/components/backdrop/index.js +16 -15
- package/dist/components/badge/index.js +21 -20
- package/dist/components/banner/index.js +19 -18
- package/dist/components/bar-chart/index.js +63 -66
- package/dist/components/bento-cell/index.d.ts +1 -1
- package/dist/components/bento-cell/index.js +16 -15
- package/dist/components/bento-grid/index.js +30 -28
- package/dist/components/blog-section/blog-section.css +2 -1
- package/dist/components/blog-section/index.js +70 -66
- package/dist/components/breadcrumbs/index.js +9 -9
- package/dist/components/button/index.js +40 -41
- package/dist/components/button-group/index.js +12 -11
- package/dist/components/calendar/index.js +25 -24
- package/dist/components/callout/callout.schema.js +6 -2
- package/dist/components/callout/callout.svelte.d.ts +2 -2
- package/dist/components/callout/callout.types.d.ts +25 -13
- package/dist/components/callout/index.d.ts +1 -1
- package/dist/components/callout/index.js +111 -49
- package/dist/components/capability-gate/index.js +33 -32
- package/dist/components/card/card.css +53 -1
- package/dist/components/card/card.schema.js +5 -1
- package/dist/components/card/card.svelte.d.ts +1 -1
- package/dist/components/card/card.types.d.ts +3 -0
- package/dist/components/card/index.d.ts +1 -1
- package/dist/components/card/index.js +253 -76
- package/dist/components/carousel/index.js +40 -44
- package/dist/components/chat/index.js +13106 -31070
- package/dist/components/chat-conversation-header/index.js +369 -14892
- package/dist/components/chat-conversation-list/index.js +188 -14788
- package/dist/components/checkbox/checkbox.schema.js +5 -1
- package/dist/components/checkbox/checkbox.types.d.ts +2 -0
- package/dist/components/checkbox/index.js +32 -27
- package/dist/components/checkbox-group/index.js +9 -9
- package/dist/components/chip/index.js +11 -12
- package/dist/components/choice-grid/index.js +17 -16
- package/dist/components/click-away-listener/index.js +11 -10
- package/dist/components/code-block/code-block.css +56 -2
- package/dist/components/code-block/index.js +26 -26
- package/dist/components/collapsible/index.js +23 -22
- package/dist/components/color-field/index.js +49 -48
- package/dist/components/color-picker/index.js +13 -13
- package/dist/components/color-swatch-picker/index.js +5 -5
- package/dist/components/combobox/index.js +112 -37
- package/dist/components/command-item/index.js +9 -9
- package/dist/components/command-menu/index.js +92 -17
- package/dist/components/command-palette/index.js +7 -7
- package/dist/components/confirm-dialog/index.js +62 -62
- package/dist/components/container/index.js +13 -12
- package/dist/components/context-menu/index.js +162 -81
- package/dist/components/context-menu-trigger/index.js +17 -16
- package/dist/components/copy-button/index.js +17 -16
- package/dist/components/cta-section/index.js +74 -73
- package/dist/components/data-grid/index.js +41 -40
- package/dist/components/data-list/index.js +17 -16
- package/dist/components/data-table/index.js +136 -129
- package/dist/components/date-picker/index.js +150 -73
- package/dist/components/date-range-field/index.js +178 -100
- package/dist/components/description-list/index.js +15 -14
- package/dist/components/diff-statistics/index.js +32 -31
- package/dist/components/diff-viewer/index.js +271 -254
- package/dist/components/divider/index.js +19 -19
- package/dist/components/drawer/index.js +43 -41
- package/dist/components/dropdown/index.js +178 -96
- package/dist/components/dropdown-group/index.js +11 -10
- package/dist/components/dropdown-item/index.js +22 -21
- package/dist/components/dropdown-label/index.js +3 -2
- package/dist/components/dropdown-menu/index.js +101 -25
- package/dist/components/dropdown-separator/index.js +3 -2
- package/dist/components/dropdown-trigger/index.js +15 -14
- package/dist/components/empty-state/index.js +21 -20
- package/dist/components/event-stream-viewer/index.js +110 -109
- package/dist/components/event-timeline/index.js +27 -26
- package/dist/components/experimental/json-viewer/index.d.ts +3 -3
- package/dist/components/experimental/json-viewer/index.js +25 -27
- package/dist/components/experimental/message/index.d.ts +3 -3
- package/dist/components/experimental/message/index.js +19 -18
- package/dist/components/faceted-filter-bar/index.js +101 -101
- package/dist/components/feature-section/feature-section.css +3 -2
- package/dist/components/feature-section/index.js +42 -40
- package/dist/components/feed/index.js +31 -29
- package/dist/components/feed-event/index.js +22 -21
- package/dist/components/file-upload/index.js +45 -44
- package/dist/components/floating-action-button/index.js +22 -21
- package/dist/components/focus-trap/index.js +13 -12
- package/dist/components/footer/footer.css +2 -1
- package/dist/components/footer/index.js +35 -35
- package/dist/components/form-field/index.js +9 -9
- package/dist/components/form-section/index.js +10 -11
- package/dist/components/grid/index.js +29 -27
- package/dist/components/grid-item/index.js +15 -14
- package/dist/components/grid-list/index.js +37 -35
- package/dist/components/grid-list-item/index.js +28 -27
- package/dist/components/hero-section/hero-section.css +2 -1
- package/dist/components/hero-section/index.js +42 -40
- package/dist/components/hover-card/index.js +96 -21
- package/dist/components/image/index.js +23 -22
- package/dist/components/inline-loading/index.js +18 -16
- package/dist/components/input/index.js +45 -44
- package/dist/components/invocation-rule-builder/index.js +58 -61
- package/dist/components/json-schema-editor/index.js +620 -517
- package/dist/components/json-viewer/index.js +25 -27
- package/dist/components/kanban-board/index.js +24 -25
- package/dist/components/kbd/index.js +11 -10
- package/dist/components/keyboard-shortcuts/index.js +33 -31
- package/dist/components/label/index.js +16 -15
- package/dist/components/line-chart/index.js +66 -68
- package/dist/components/link/index.js +21 -20
- package/dist/components/load-more/index.js +7 -7
- package/dist/components/logo-cloud/index.js +39 -37
- package/dist/components/logo-cloud/logo-cloud.css +3 -2
- package/dist/components/markdown-editor/index.js +475 -371
- package/dist/components/marquee/index.js +15 -14
- package/dist/components/masonry/index.js +12 -11
- package/dist/components/matrix-chart/index.js +50 -50
- package/dist/components/media-controls/index.js +33 -32
- package/dist/components/mega-menu/index.js +41 -43
- package/dist/components/menu-bar/index.js +167 -89
- package/dist/components/message/index.js +19 -18
- package/dist/components/meter/index.js +5 -5
- package/dist/components/modal/index.js +19 -18
- package/dist/components/multi-select/index.js +27 -27
- package/dist/components/navigation-bar/index.d.ts +1 -1
- package/dist/components/navigation-bar/index.js +76 -51
- package/dist/components/navigation-bar/navigation-bar.css +15 -0
- package/dist/components/navigation-bar/navigation-bar.schema.js +6 -1
- package/dist/components/navigation-bar/navigation-bar.svelte.d.ts +1 -1
- package/dist/components/navigation-bar/navigation-bar.types.d.ts +8 -0
- package/dist/components/navigation-item/index.js +20 -19
- package/dist/components/newsletter-section/index.js +121 -119
- package/dist/components/newsletter-section/newsletter-section.css +2 -1
- package/dist/components/number-input/index.js +36 -36
- package/dist/components/page-header/index.js +17 -16
- package/dist/components/pagination/index.js +26 -21
- package/dist/components/pagination/pagination.schema.js +12 -3
- package/dist/components/pagination/pagination.types.d.ts +6 -2
- package/dist/components/payload-inspector/index.js +136 -139
- package/dist/components/permission-matrix/index.js +39 -39
- package/dist/components/phone-input/index.js +13 -13
- package/dist/components/pin-input/index.js +13 -13
- package/dist/components/popover/index.js +96 -21
- package/dist/components/portal/index.js +90 -15
- package/dist/components/portal/portal.utilities.svelte.d.ts +25 -3
- package/dist/components/pricing-card/index.js +62 -62
- package/dist/components/pricing-section/index.js +96 -94
- package/dist/components/pricing-section/pricing-section.css +2 -1
- package/dist/components/progress/index.js +13 -13
- package/dist/components/qr-code/index.js +23 -22
- package/dist/components/radio-group/index.js +26 -25
- package/dist/components/rating/index.js +16 -17
- package/dist/components/resizable-panels/index.js +21 -20
- package/dist/components/review-editor/index.js +914 -809
- package/dist/components/run-step-timeline/index.js +127 -122
- package/dist/components/schema-form/index.js +203 -194
- package/dist/components/scroll-area/index.js +15 -14
- package/dist/components/search-field/index.js +24 -23
- package/dist/components/secret-value-field/index.js +35 -34
- package/dist/components/section-heading/index.js +11 -11
- package/dist/components/segment/index.js +37 -22
- package/dist/components/segmented-control/index.d.ts +3 -1
- package/dist/components/segmented-control/index.js +188 -74
- package/dist/components/segmented-control/segmented-control-state.svelte.d.ts +2 -1
- package/dist/components/select/index.js +29 -29
- package/dist/components/selection-popover/index.js +110 -34
- package/dist/components/share-card/index.js +37 -38
- package/dist/components/sheet/index.js +44 -42
- package/dist/components/shortcut-hint/index.js +29 -28
- package/dist/components/side-navigation/index.js +57 -53
- package/dist/components/side-navigation-group/index.js +21 -20
- package/dist/components/side-navigation-item/index.js +24 -22
- package/dist/components/sidebar/index.js +130 -160
- package/dist/components/sidebar/sidebar.css +14 -0
- package/dist/components/skip-link/index.js +11 -10
- package/dist/components/slider/index.js +15 -15
- package/dist/components/sortable-list/index.js +5 -5
- package/dist/components/source-diff-viewer/index.d.ts +6 -0
- package/dist/components/source-diff-viewer/index.js +887 -0
- package/dist/components/source-diff-viewer/source-diff-viewer.css +129 -0
- package/dist/components/source-diff-viewer/source-diff-viewer.css.d.ts +1 -0
- package/dist/components/source-diff-viewer/source-diff-viewer.schema.d.ts +3 -0
- package/dist/components/source-diff-viewer/source-diff-viewer.schema.js +96 -0
- package/dist/components/source-diff-viewer/source-diff-viewer.svelte.d.ts +20 -0
- package/dist/components/source-diff-viewer/source-diff-viewer.types.d.ts +44 -0
- package/dist/components/source-diff-viewer/source-diff-viewer.utilities.d.ts +6 -0
- package/dist/components/source-diff-viewer/source-diff-viewer.variables.d.ts +2 -0
- package/dist/components/source-diff-viewer/source-diff-viewer.variables.js +61 -0
- package/dist/components/sparkbar/index.js +20 -19
- package/dist/components/spectrogram/index.js +44 -44
- package/dist/components/spectrum-chart/index.js +39 -39
- package/dist/components/speed-dial/index.js +54 -51
- package/dist/components/speed-dial-action/index.js +39 -37
- package/dist/components/spinner/index.js +3 -2
- package/dist/components/stacked-list-item/index.js +30 -29
- package/dist/components/stat/index.js +21 -20
- package/dist/components/stat-group/index.js +34 -32
- package/dist/components/stats-section/index.js +65 -61
- package/dist/components/status-dot/index.js +21 -20
- package/dist/components/steps/index.d.ts +1 -1
- package/dist/components/steps/index.js +77 -63
- package/dist/components/steps/steps.css +15 -1
- package/dist/components/steps/steps.schema.js +6 -1
- package/dist/components/steps/steps.svelte.d.ts +2 -2
- package/dist/components/steps/steps.types.d.ts +12 -0
- package/dist/components/surface/index.js +10 -9
- package/dist/components/tab/index.js +5 -5
- package/dist/components/tab-panel/index.js +3 -3
- package/dist/components/table/index.js +64 -60
- package/dist/components/table-cell/index.js +11 -10
- package/dist/components/table-header-cell/index.js +17 -16
- package/dist/components/table-of-contents/index.js +21 -20
- package/dist/components/table-row/index.js +21 -20
- package/dist/components/tabs/index.d.ts +10 -4
- package/dist/components/tabs/index.js +15 -11
- package/dist/components/tabs/tabs.css +6 -0
- package/dist/components/tabs/tabs.schema.js +6 -1
- package/dist/components/tabs/tabs.types.d.ts +5 -0
- package/dist/components/tag-input/index.js +36 -35
- package/dist/components/team-section/index.js +523 -264
- package/dist/components/team-section/team-section.css +2 -1
- package/dist/components/testimonial-section/index.js +390 -207
- package/dist/components/testimonial-section/testimonial-section.css +2 -1
- package/dist/components/textarea/index.js +30 -29
- package/dist/components/time-field/index.js +40 -40
- package/dist/components/timeline/index.js +40 -38
- package/dist/components/toast-region/index.js +24 -25
- package/dist/components/toggle/index.js +5 -5
- package/dist/components/toolbar/index.js +34 -24
- package/dist/components/toolbar/toolbar-group.svelte.d.ts +2 -2
- package/dist/components/toolbar/toolbar.css +10 -11
- package/dist/components/toolbar/toolbar.schema.js +2 -2
- package/dist/components/toolbar/toolbar.types.d.ts +2 -2
- package/dist/components/tooltip/index.js +90 -15
- package/dist/components/transfer-list/index.js +22 -22
- package/dist/components/tree/index.js +83 -82
- package/dist/components/tree-item/index.js +21 -21
- package/dist/components/typography/index.js +13 -12
- package/dist/components/virtual-list/index.js +20 -19
- package/dist/components/visually-hidden/index.js +11 -10
- package/dist/components/waveform/index.js +38 -38
- package/dist/index.d.ts +9 -9
- package/dist/index.js +61103 -80396
- package/dist/server/components/access-gate/index.js +5 -4
- package/dist/server/components/accordion/index.js +5 -4
- package/dist/server/components/accordion-item/index.js +5 -4
- package/dist/server/components/action-row/index.js +12 -0
- package/dist/server/components/alert/index.js +1 -1
- package/dist/server/components/alert-dialog/index.js +1 -1
- package/dist/server/components/approval-card/index.js +13 -10
- package/dist/server/components/area-chart/index.js +1 -1
- package/dist/server/components/aspect-ratio/index.js +1 -1
- package/dist/server/components/autocomplete/index.js +5 -5
- package/dist/server/components/avatar/index.js +1 -1
- package/dist/server/components/avatar-group/index.js +5 -5
- package/dist/server/components/backdrop/index.js +1 -1
- package/dist/server/components/badge/index.js +3 -3
- package/dist/server/components/banner/index.js +1 -1
- package/dist/server/components/bar-chart/index.js +1 -1
- package/dist/server/components/bento-cell/index.js +1 -1
- package/dist/server/components/bento-grid/index.js +1 -1
- package/dist/server/components/blog-section/index.js +1 -1
- package/dist/server/components/breadcrumbs/index.js +1 -1
- package/dist/server/components/button/index.js +1 -1
- package/dist/server/components/button-group/index.js +1 -1
- package/dist/server/components/calendar/index.js +1 -1
- package/dist/server/components/callout/index.js +2 -2
- package/dist/server/components/capability-gate/index.js +1 -1
- package/dist/server/components/card/index.js +8 -4
- package/dist/server/components/carousel/index.js +1 -1
- package/dist/server/components/chat/index.js +15 -27
- package/dist/server/components/chat-conversation-header/index.js +9 -9
- package/dist/server/components/chat-conversation-list/index.js +5 -5
- package/dist/server/components/checkbox/index.js +4 -4
- package/dist/server/components/checkbox-group/index.js +1 -1
- package/dist/server/components/chip/index.js +1 -1
- package/dist/server/components/choice-grid/index.js +1 -1
- package/dist/server/components/choice-grid-item/index.js +1 -1
- package/dist/server/components/click-away-listener/index.js +1 -1
- package/dist/server/components/code-block/index.js +4 -4
- package/dist/server/components/collapsible/index.js +1 -1
- package/dist/server/components/color-field/index.js +4 -4
- package/dist/server/components/color-picker/index.js +2 -2
- package/dist/server/components/color-swatch-picker/index.js +1 -1
- package/dist/server/components/combobox/index.js +5 -5
- package/dist/server/components/command-item/index.js +1 -1
- package/dist/server/components/command-menu/index.js +4 -4
- package/dist/server/components/command-palette/index.js +2 -2
- package/dist/server/components/confirm-dialog/index.js +1 -1
- package/dist/server/components/container/index.js +1 -1
- package/dist/server/components/context-menu/index.js +5 -5
- package/dist/server/components/context-menu-trigger/index.js +1 -1
- package/dist/server/components/copy-button/index.js +3 -3
- package/dist/server/components/cta-section/index.js +1 -1
- package/dist/server/components/data-grid/index.js +1 -1
- package/dist/server/components/data-list/index.js +1 -1
- package/dist/server/components/data-table/index.js +5 -5
- package/dist/server/components/date-picker/index.js +5 -5
- package/dist/server/components/date-range-field/index.js +6 -6
- package/dist/server/components/description-list/index.js +1 -1
- package/dist/server/components/diff-statistics/index.js +1 -1
- package/dist/server/components/diff-viewer/index.js +8 -8
- package/dist/server/components/divider/index.js +1 -1
- package/dist/server/components/drawer/index.js +1 -1
- package/dist/server/components/dropdown/index.js +5 -5
- package/dist/server/components/dropdown-group/index.js +1 -1
- package/dist/server/components/dropdown-item/index.js +1 -1
- package/dist/server/components/dropdown-label/index.js +1 -1
- package/dist/server/components/dropdown-menu/index.js +4 -4
- package/dist/server/components/dropdown-separator/index.js +1 -1
- package/dist/server/components/dropdown-trigger/index.js +1 -1
- package/dist/server/components/empty-state/index.js +1 -1
- package/dist/server/components/event-stream-viewer/index.js +3 -3
- package/dist/server/components/event-timeline/index.js +1 -1
- package/dist/server/components/experimental/json-viewer/index.js +1 -1
- package/dist/server/components/experimental/message/index.js +1 -1
- package/dist/server/components/faceted-filter-bar/index.js +4 -4
- package/dist/server/components/feature-section/index.js +1 -1
- package/dist/server/components/feed/index.js +1 -1
- package/dist/server/components/feed-event/index.js +1 -1
- package/dist/server/components/file-upload/index.js +1 -1
- package/dist/server/components/floating-action-button/index.js +1 -1
- package/dist/server/components/focus-trap/index.js +1 -1
- package/dist/server/components/footer/index.js +1 -1
- package/dist/server/components/form-field/index.js +1 -1
- package/dist/server/components/form-section/index.js +1 -1
- package/dist/server/components/grid/index.js +1 -1
- package/dist/server/components/grid-item/index.js +1 -1
- package/dist/server/components/grid-list/index.js +1 -1
- package/dist/server/components/grid-list-item/index.js +1 -1
- package/dist/server/components/hero-section/index.js +1 -1
- package/dist/server/components/hover-card/index.js +3 -3
- package/dist/server/components/image/index.js +1 -1
- package/dist/server/components/inline-loading/index.js +1 -1
- package/dist/server/components/input/index.js +4 -4
- package/dist/server/components/invocation-rule-builder/index.js +1 -1
- package/dist/server/components/json-schema-editor/index.js +16 -16
- package/dist/server/components/json-viewer/index.js +1 -1
- package/dist/server/components/kanban-board/index.js +1 -1
- package/dist/server/components/kbd/index.js +1 -1
- package/dist/server/components/keyboard-shortcuts/index.js +1 -1
- package/dist/server/components/label/index.js +1 -1
- package/dist/server/components/line-chart/index.js +1 -1
- package/dist/server/components/link/index.js +1 -1
- package/dist/server/components/load-more/index.js +1 -1
- package/dist/server/components/locale-provider/index.js +1 -1
- package/dist/server/components/logo-cloud/index.js +1 -1
- package/dist/server/components/markdown-editor/index.js +16 -16
- package/dist/server/components/marquee/index.js +1 -1
- package/dist/server/components/masonry/index.js +1 -1
- package/dist/server/components/matrix-chart/index.js +1 -1
- package/dist/server/components/media-controls/index.js +1 -1
- package/dist/server/components/mega-menu/index.js +1 -1
- package/dist/server/components/menu-bar/index.js +5 -5
- package/dist/server/components/message/index.js +1 -1
- package/dist/server/components/meter/index.js +1 -1
- package/dist/server/components/modal/index.js +1 -1
- package/dist/server/components/multi-select/index.js +2 -2
- package/dist/server/components/navigation-bar/index.js +2 -2
- package/dist/server/components/navigation-item/index.js +1 -1
- package/dist/server/components/newsletter-section/index.js +4 -4
- package/dist/server/components/number-input/index.js +1 -1
- package/dist/server/components/page-header/index.js +1 -1
- package/dist/server/components/pagination/index.js +2 -2
- package/dist/server/components/payload-inspector/index.js +8 -8
- package/dist/server/components/permission-matrix/index.js +1 -1
- package/dist/server/components/phone-input/index.js +1 -1
- package/dist/server/components/pin-input/index.js +1 -1
- package/dist/server/components/popover/index.js +4 -4
- package/dist/server/components/portal/index.js +2 -2
- package/dist/server/components/pricing-card/index.js +1 -1
- package/dist/server/components/pricing-section/index.js +1 -1
- package/dist/server/components/progress/index.js +1 -1
- package/dist/server/components/qr-code/index.js +2 -2
- package/dist/server/components/radio-group/index.js +1 -1
- package/dist/server/components/rating/index.js +1 -1
- package/dist/server/components/resizable-panels/index.js +1 -1
- package/dist/server/components/review-editor/index.js +3396 -55
- package/dist/server/components/run-step-timeline/index.js +3 -3
- package/dist/server/components/schema-form/index.js +5 -5
- package/dist/server/components/scroll-area/index.js +1 -1
- package/dist/server/components/search-field/index.js +4 -4
- package/dist/server/components/secret-value-field/index.js +1 -1
- package/dist/server/components/section-heading/index.js +1 -1
- package/dist/server/components/segment/index.js +4 -4
- package/dist/server/components/segmented-control/index.js +10 -6
- package/dist/server/components/select/index.js +1 -1
- package/dist/server/components/selection-popover/index.js +4 -4
- package/dist/server/components/share-card/index.js +1 -1
- package/dist/server/components/sheet/index.js +1 -1
- package/dist/server/components/shortcut-hint/index.js +1 -1
- package/dist/server/components/side-navigation/index.js +1 -1
- package/dist/server/components/side-navigation-group/index.js +1 -1
- package/dist/server/components/side-navigation-item/index.js +1 -1
- package/dist/server/components/sidebar/index.js +2 -2
- package/dist/server/components/skeleton/index.js +1 -1
- package/dist/server/components/skip-link/index.js +1 -1
- package/dist/server/components/slider/index.js +1 -1
- package/dist/server/components/sortable-list/index.js +1 -1
- package/dist/server/components/source-diff-viewer/index.js +18 -0
- package/dist/server/components/sparkbar/index.js +1 -1
- package/dist/server/components/spectrogram/index.js +1 -1
- package/dist/server/components/spectrum-chart/index.js +1 -1
- package/dist/server/components/speed-dial/index.js +1 -1
- package/dist/server/components/speed-dial-action/index.js +1 -1
- package/dist/server/components/spinner/index.js +1 -1
- package/dist/server/components/stacked-list-item/index.js +1 -1
- package/dist/server/components/stat/index.js +1 -1
- package/dist/server/components/stat-group/index.js +1 -1
- package/dist/server/components/stats-section/index.js +1 -1
- package/dist/server/components/status-dot/index.js +1 -1
- package/dist/server/components/steps/index.js +2 -2
- package/dist/server/components/surface/index.js +1 -1
- package/dist/server/components/tab/index.js +1 -1
- package/dist/server/components/tab-list/index.js +1 -1
- package/dist/server/components/tab-panel/index.js +1 -1
- package/dist/server/components/table/index.js +3 -3
- package/dist/server/components/table-body/index.js +1 -1
- package/dist/server/components/table-cell/index.js +1 -1
- package/dist/server/components/table-header/index.js +1 -1
- package/dist/server/components/table-header-cell/index.js +1 -1
- package/dist/server/components/table-of-contents/index.js +1 -1
- package/dist/server/components/table-row/index.js +1 -1
- package/dist/server/components/tabs/index.js +17 -8
- package/dist/server/components/tag-input/index.js +3 -3
- package/dist/server/components/team-section/index.js +11 -7
- package/dist/server/components/testimonial-section/index.js +8 -4
- package/dist/server/components/textarea/index.js +1 -1
- package/dist/server/components/time-field/index.js +1 -1
- package/dist/server/components/timeline/index.js +1 -1
- package/dist/server/components/toast-region/index.js +1 -1
- package/dist/server/components/toggle/index.js +1 -1
- package/dist/server/components/toolbar/index.js +2 -2
- package/dist/server/components/tooltip/index.js +4 -4
- package/dist/server/components/transfer-list/index.js +1 -1
- package/dist/server/components/tree/index.js +1 -1
- package/dist/server/components/tree-item/index.js +1 -1
- package/dist/server/components/typography/index.js +1 -1
- package/dist/server/components/virtual-list/index.js +1 -1
- package/dist/server/components/visually-hidden/index.js +1 -1
- package/dist/server/components/waveform/index.js +1 -1
- package/dist/server/highlighters/shiki/index.js +1 -1
- package/dist/server/index-49we2xfs.js +344 -0
- package/dist/server/index-8fhvxk30.js +265 -0
- package/dist/server/index-x2ysg8ds.js +388 -0
- package/dist/server/index.js +176 -199
- package/dist/server/index.server-0e1m3agz.js +102 -0
- package/dist/server/index.server-0gwr59yw.js +9 -0
- package/dist/server/index.server-0q2bpsa1.js +98 -0
- package/dist/server/index.server-0v6na3yp.js +37 -0
- package/dist/server/index.server-1nh09ck7.js +377 -0
- package/dist/server/index.server-1vscnped.js +105 -0
- package/dist/server/index.server-2j52msk2.js +34 -0
- package/dist/server/index.server-4nk7gy0q.js +294 -0
- package/dist/server/index.server-4ztq565m.js +9 -0
- package/dist/server/index.server-5d01cn4f.js +52 -0
- package/dist/server/index.server-5knawt7p.js +94 -0
- package/dist/server/index.server-5npa16n7.js +9 -0
- package/dist/server/index.server-62mtrvr7.js +111 -0
- package/dist/server/index.server-73x2d3j3.js +9 -0
- package/dist/server/index.server-7fp0epev.js +143 -0
- package/dist/server/index.server-7yq1jgt3.js +9 -0
- package/dist/server/index.server-8cxs4kya.js +244 -0
- package/dist/server/index.server-9j5sym59.js +23 -0
- package/dist/server/index.server-9s4na701.js +195 -0
- package/dist/server/index.server-a2hz77tt.js +458 -0
- package/dist/server/index.server-aeexcxdp.js +9 -0
- package/dist/server/index.server-atjc1qcq.js +83 -0
- package/dist/server/index.server-bfsbp9dz.js +169 -0
- package/dist/server/index.server-bn02606y.js +19 -0
- package/dist/server/index.server-btgb3d56.js +195 -0
- package/dist/server/index.server-bvmwnjx6.js +3797 -0
- package/dist/server/index.server-bvsb9gea.js +2 -0
- package/dist/server/index.server-cbtg8rq5.js +457 -0
- package/dist/server/index.server-cf6pxeyg.js +9 -0
- package/dist/server/index.server-cvnw3hw9.js +9 -0
- package/dist/server/index.server-d04aj37r.js +62 -0
- package/dist/server/index.server-dc35kh7d.js +1835 -0
- package/dist/server/index.server-dp9j2kkr.js +291 -0
- package/dist/server/index.server-e3fnv1g6.js +223 -0
- package/dist/server/index.server-e8x1hgw6.js +118 -0
- package/dist/server/index.server-ecm1vs3g.js +9 -0
- package/dist/server/index.server-egk5q7aj.js +148 -0
- package/dist/server/index.server-ejyf7e48.js +9 -0
- package/dist/server/index.server-ezpdsg81.js +733 -0
- package/dist/server/index.server-f0hma3jp.js +9 -0
- package/dist/server/index.server-f23vtaw4.js +284 -0
- package/dist/server/index.server-ft1xvwqd.js +9 -0
- package/dist/server/index.server-g789yep6.js +1035 -0
- package/dist/server/index.server-gxf0d1p5.js +76 -0
- package/dist/server/index.server-hcfnae5y.js +126 -0
- package/dist/server/index.server-hd8gpehd.js +9 -0
- package/dist/server/index.server-hfx487zj.js +42 -0
- package/dist/server/index.server-hhxjaeen.js +35 -0
- package/dist/server/index.server-hpcs7tmh.js +271 -0
- package/dist/server/index.server-j3ddzcaa.js +1028 -0
- package/dist/server/index.server-j5hn2qds.js +126 -0
- package/dist/server/index.server-jeqg2d22.js +123 -0
- package/dist/server/index.server-jk4rx4aa.js +9 -0
- package/dist/server/index.server-jt1twhgk.js +726 -0
- package/dist/server/index.server-jtj3r53y.js +9 -0
- package/dist/server/index.server-jync915v.js +2309 -0
- package/dist/server/index.server-kd4b0342.js +607 -0
- package/dist/server/index.server-kvdrhzr3.js +176 -0
- package/dist/server/index.server-mehav5vs.js +31 -0
- package/dist/server/index.server-n39drzes.js +222 -0
- package/dist/server/index.server-nzgjr724.js +190 -0
- package/dist/server/index.server-pacrqvyz.js +9 -0
- package/dist/server/index.server-pakw5qm3.js +84 -0
- package/dist/server/index.server-pe929n15.js +107 -0
- package/dist/server/index.server-pen9pxt6.js +117 -0
- package/dist/server/index.server-pxg74pyp.js +393 -0
- package/dist/server/index.server-q89dz8h1.js +72 -0
- package/dist/server/index.server-qfa2rxzx.js +177 -0
- package/dist/server/index.server-qwknp759.js +141 -0
- package/dist/server/index.server-rhhmdxtz.js +159 -0
- package/dist/server/index.server-rjap4k7y.js +1389 -0
- package/dist/server/index.server-s9khh4ry.js +56 -0
- package/dist/server/index.server-sh2rxejg.js +371 -0
- package/dist/server/index.server-te0d13bf.js +4416 -0
- package/dist/server/index.server-thedzn9z.js +100 -0
- package/dist/server/index.server-tnbaknbp.js +9 -0
- package/dist/server/index.server-txnxnbd6.js +161 -0
- package/dist/server/index.server-vne4rzfa.js +9 -0
- package/dist/server/index.server-vt6sn9y4.js +447 -0
- package/dist/server/index.server-w83kmcrx.js +1163 -0
- package/dist/server/index.server-wc9aggfz.js +197 -0
- package/dist/server/index.server-wm7mk5kw.js +93 -0
- package/dist/server/index.server-z1q7qnb8.js +84 -0
- package/dist/server/index.server-zeqv7nrz.js +184 -0
- package/dist/server/styles/base-guard.js +1 -1
- package/dist/utilities/__test-helpers__/announcer-wrapper.svelte.d.ts +7 -0
- package/package.json +2370 -1605
- package/src/_internal/anchored-overlay.svelte.ts +158 -198
- package/src/_internal/chart/chart-interaction.svelte.ts +134 -166
- package/src/_internal/strict-stable-context.ts +27 -0
- package/src/_internal/tree-drag-controller.svelte.ts +256 -315
- package/src/_internal/tree-registry.svelte.ts +154 -222
- package/src/_internal/use-virtualizer.svelte.ts +168 -217
- package/src/components/_internal/create-command-list-state.svelte.ts +133 -160
- package/src/components/_internal/create-sliding-dialog-state.svelte.ts +130 -154
- package/src/components/_radio/radio.schema.json +36 -0
- package/src/components/_radio/radio.schema.ts +41 -0
- package/src/components/_radio/radio.svelte +14 -42
- package/src/components/_radio/radio.variables.json +1 -0
- package/src/components/_radio/radio.variables.ts +3 -0
- package/src/components/_sortable-item.svelte +302 -370
- package/src/components/_timeline-item/timeline-item.svelte +12 -42
- package/src/components/_tree-expand-all/tree-expand-all.svelte +20 -45
- package/src/components/_tree-select-all/tree-select-all.schema.json +38 -0
- package/src/components/_tree-select-all/tree-select-all.schema.ts +43 -0
- package/src/components/_tree-select-all/tree-select-all.svelte +14 -41
- package/src/components/_tree-select-all/tree-select-all.variables.json +1 -0
- package/src/components/_tree-select-all/tree-select-all.variables.ts +3 -0
- package/src/components/_visually-hidden-live-region.svelte +30 -85
- package/src/components/access-gate/access-gate-inline.svelte +231 -312
- package/src/components/access-gate/access-gate.schema.json +38 -0
- package/src/components/access-gate/access-gate.schema.ts +43 -0
- package/src/components/access-gate/access-gate.svelte +14 -54
- package/src/components/access-gate/access-gate.variables.json +1 -0
- package/src/components/access-gate/access-gate.variables.ts +3 -0
- package/src/components/accordion/accordion.context.ts +7 -7
- package/src/components/accordion/accordion.schema.json +26 -0
- package/src/components/accordion/accordion.schema.ts +30 -0
- package/src/components/accordion/accordion.svelte +20 -52
- package/src/components/accordion/accordion.variables.json +1 -0
- package/src/components/accordion/accordion.variables.ts +3 -0
- package/src/components/accordion-item/accordion-item.schema.json +35 -0
- package/src/components/accordion-item/accordion-item.schema.ts +39 -0
- package/src/components/accordion-item/accordion-item.svelte +12 -29
- package/src/components/accordion-item/accordion-item.variables.json +1 -0
- package/src/components/accordion-item/accordion-item.variables.ts +3 -0
- package/src/components/action-row/action-row.css +133 -0
- package/src/components/action-row/action-row.examples.json +19 -0
- package/src/components/action-row/action-row.schema.json +66 -0
- package/src/components/action-row/action-row.schema.ts +74 -0
- package/src/components/action-row/action-row.svelte +51 -0
- package/src/components/action-row/action-row.types.ts +50 -0
- package/src/components/action-row/action-row.variables.json +1 -0
- package/src/components/action-row/action-row.variables.ts +3 -0
- package/src/components/action-row/index.ts +11 -0
- package/src/components/alert/alert.schema.json +38 -0
- package/src/components/alert/alert.schema.ts +43 -0
- package/src/components/alert/alert.svelte +38 -88
- package/src/components/alert/alert.variables.json +1 -0
- package/src/components/alert/alert.variables.ts +3 -0
- package/src/components/alert-dialog/alert-dialog.schema.json +53 -0
- package/src/components/alert-dialog/alert-dialog.schema.ts +60 -0
- package/src/components/alert-dialog/alert-dialog.svelte +12 -42
- package/src/components/alert-dialog/alert-dialog.variables.json +1 -0
- package/src/components/alert-dialog/alert-dialog.variables.ts +3 -0
- package/src/components/approval-card/approval-card.css +31 -1
- package/src/components/approval-card/approval-card.examples.json +1 -1
- package/src/components/approval-card/approval-card.schema.json +211 -0
- package/src/components/approval-card/approval-card.schema.ts +219 -0
- package/src/components/approval-card/approval-card.svelte +316 -324
- package/src/components/approval-card/approval-card.types.ts +22 -0
- package/src/components/approval-card/approval-card.variables.json +1 -0
- package/src/components/approval-card/approval-card.variables.ts +3 -0
- package/src/components/approval-card/index.ts +2 -0
- package/src/components/area-chart/area-chart.schema.json +143 -0
- package/src/components/area-chart/area-chart.schema.ts +149 -0
- package/src/components/area-chart/area-chart.svelte +68 -141
- package/src/components/area-chart/area-chart.variables.json +1 -0
- package/src/components/area-chart/area-chart.variables.ts +3 -0
- package/src/components/aspect-ratio/aspect-ratio.schema.json +143 -0
- package/src/components/aspect-ratio/aspect-ratio.schema.ts +147 -0
- package/src/components/aspect-ratio/aspect-ratio.svelte +7 -37
- package/src/components/aspect-ratio/aspect-ratio.variables.json +1 -0
- package/src/components/aspect-ratio/aspect-ratio.variables.ts +3 -0
- package/src/components/autocomplete/autocomplete.schema.json +79 -0
- package/src/components/autocomplete/autocomplete.schema.ts +90 -0
- package/src/components/autocomplete/autocomplete.svelte +220 -295
- package/src/components/autocomplete/autocomplete.variables.json +1 -0
- package/src/components/autocomplete/autocomplete.variables.ts +3 -0
- package/src/components/avatar/avatar.schema.json +36 -0
- package/src/components/avatar/avatar.schema.ts +41 -0
- package/src/components/avatar/avatar.svelte +14 -39
- package/src/components/avatar/avatar.variables.json +1 -0
- package/src/components/avatar/avatar.variables.ts +3 -0
- package/src/components/avatar-group/avatar-group.schema.json +69 -0
- package/src/components/avatar-group/avatar-group.schema.ts +74 -0
- package/src/components/avatar-group/avatar-group.svelte +57 -114
- package/src/components/avatar-group/avatar-group.variables.json +1 -0
- package/src/components/avatar-group/avatar-group.variables.ts +3 -0
- package/src/components/backdrop/backdrop.schema.json +44 -0
- package/src/components/backdrop/backdrop.schema.ts +52 -0
- package/src/components/backdrop/backdrop.svelte +43 -68
- package/src/components/backdrop/backdrop.variables.json +1 -0
- package/src/components/backdrop/backdrop.variables.ts +3 -0
- package/src/components/badge/badge.schema.json +39 -0
- package/src/components/badge/badge.schema.ts +46 -0
- package/src/components/badge/badge.svelte +22 -65
- package/src/components/badge/badge.variables.json +1 -0
- package/src/components/badge/badge.variables.ts +3 -0
- package/src/components/banner/banner.schema.json +39 -0
- package/src/components/banner/banner.schema.ts +44 -0
- package/src/components/banner/banner.svelte +47 -86
- package/src/components/banner/banner.variables.json +1 -0
- package/src/components/banner/banner.variables.ts +3 -0
- package/src/components/bar-chart/bar-chart.schema.json +144 -0
- package/src/components/bar-chart/bar-chart.schema.ts +153 -0
- package/src/components/bar-chart/bar-chart.svelte +73 -149
- package/src/components/bar-chart/bar-chart.variables.json +1 -0
- package/src/components/bar-chart/bar-chart.variables.ts +3 -0
- package/src/components/bento-cell/bento-cell.schema.json +105 -0
- package/src/components/bento-cell/bento-cell.schema.ts +109 -0
- package/src/components/bento-cell/bento-cell.svelte +11 -41
- package/src/components/bento-cell/bento-cell.variables.json +1 -0
- package/src/components/bento-cell/bento-cell.variables.ts +3 -0
- package/src/components/bento-cell/index.ts +1 -1
- package/src/components/bento-grid/bento-grid.schema.json +54 -0
- package/src/components/bento-grid/bento-grid.schema.ts +60 -0
- package/src/components/bento-grid/bento-grid.svelte +34 -71
- package/src/components/bento-grid/bento-grid.variables.json +1 -0
- package/src/components/bento-grid/bento-grid.variables.ts +3 -0
- package/src/components/blog-section/blog-section.css +2 -1
- package/src/components/blog-section/blog-section.schema.json +82 -0
- package/src/components/blog-section/blog-section.schema.ts +86 -0
- package/src/components/blog-section/blog-section.svelte +9 -37
- package/src/components/blog-section/blog-section.variables.json +1 -0
- package/src/components/blog-section/blog-section.variables.ts +3 -0
- package/src/components/breadcrumbs/breadcrumbs.schema.json +21 -0
- package/src/components/breadcrumbs/breadcrumbs.schema.ts +25 -0
- package/src/components/breadcrumbs/breadcrumbs.svelte +3 -23
- package/src/components/breadcrumbs/breadcrumbs.variables.json +1 -0
- package/src/components/breadcrumbs/breadcrumbs.variables.ts +3 -0
- package/src/components/button/button.schema.json +62 -0
- package/src/components/button/button.schema.ts +68 -0
- package/src/components/button/button.svelte +66 -161
- package/src/components/button/button.variables.json +1 -0
- package/src/components/button/button.variables.ts +3 -0
- package/src/components/button-group/button-group.schema.json +33 -0
- package/src/components/button-group/button-group.schema.ts +39 -0
- package/src/components/button-group/button-group.svelte +61 -92
- package/src/components/button-group/button-group.variables.json +1 -0
- package/src/components/button-group/button-group.variables.ts +3 -0
- package/src/components/calendar/calendar.schema.json +61 -0
- package/src/components/calendar/calendar.schema.ts +65 -0
- package/src/components/calendar/calendar.svelte +167 -232
- package/src/components/calendar/calendar.variables.json +1 -0
- package/src/components/calendar/calendar.variables.ts +3 -0
- package/src/components/callout/callout.schema.json +38 -0
- package/src/components/callout/callout.schema.ts +46 -0
- package/src/components/callout/callout.svelte +69 -76
- package/src/components/callout/callout.types.ts +25 -13
- package/src/components/callout/callout.variables.json +1 -0
- package/src/components/callout/callout.variables.ts +3 -0
- package/src/components/callout/index.ts +1 -1
- package/src/components/capability-gate/capability-gate.schema.json +72 -0
- package/src/components/capability-gate/capability-gate.schema.ts +76 -0
- package/src/components/capability-gate/capability-gate.svelte +35 -84
- package/src/components/capability-gate/capability-gate.variables.json +1 -0
- package/src/components/capability-gate/capability-gate.variables.ts +3 -0
- package/src/components/card/card.css +53 -1
- package/src/components/card/card.examples.json +12 -0
- package/src/components/card/card.schema.json +64 -0
- package/src/components/card/card.schema.ts +71 -0
- package/src/components/card/card.svelte +41 -51
- package/src/components/card/card.types.ts +3 -0
- package/src/components/card/card.variables.json +1 -0
- package/src/components/card/card.variables.ts +3 -0
- package/src/components/card/index.ts +7 -1
- package/src/components/carousel/carousel.schema.json +46 -0
- package/src/components/carousel/carousel.schema.ts +50 -0
- package/src/components/carousel/carousel.svelte +71 -105
- package/src/components/carousel/carousel.variables.json +1 -0
- package/src/components/carousel/carousel.variables.ts +3 -0
- package/src/components/chat/artifact/artifact-panel.svelte +7 -22
- package/src/components/chat/artifact/artifact-viewer.svelte +11 -20
- package/src/components/chat/artifact/chat-artifact-layout.svelte +4 -33
- package/src/components/chat/chat.schema.json +250 -0
- package/src/components/chat/chat.schema.ts +286 -0
- package/src/components/chat/chat.svelte +34 -58
- package/src/components/chat/chat.variables.json +1 -0
- package/src/components/chat/chat.variables.ts +3 -0
- package/src/components/chat/container/chat-history-trigger.svelte +10 -30
- package/src/components/chat/container/chat-jump-controls.svelte +7 -36
- package/src/components/chat/container/chat-participant-typing.svelte +3 -31
- package/src/components/chat/container/chat-search-bar.svelte +44 -91
- package/src/components/chat/container/chat-status-announcer.svelte +2 -20
- package/src/components/chat/container/chat.svelte +842 -1144
- package/src/components/chat/container/use-chat-disclosure-state.svelte.ts +28 -62
- package/src/components/chat/container/use-chat-keyboard-nav.svelte.ts +111 -161
- package/src/components/chat/container/use-chat-message-groups.svelte.ts +104 -195
- package/src/components/chat/container/use-chat-read-receipts.svelte.ts +38 -79
- package/src/components/chat/container/use-chat-scroll-state.svelte.ts +222 -347
- package/src/components/chat/container/use-chat-search.svelte.ts +66 -128
- package/src/components/chat/container/use-chat-typing-indicator.svelte.ts +100 -147
- package/src/components/chat/container/use-chat-unread-state.svelte.ts +124 -201
- package/src/components/chat/container/use-chat-virtualizer.svelte.ts +247 -315
- package/src/components/chat/export/conversation-export-actions.svelte +61 -89
- package/src/components/chat/input/chat-attachment-preview.svelte +17 -25
- package/src/components/chat/input/chat-input.svelte +243 -398
- package/src/components/chat/message/chat-date-separator.svelte +19 -38
- package/src/components/chat/message/chat-message-parts-renderer.svelte +41 -55
- package/src/components/chat/message/chat-message.svelte +98 -229
- package/src/components/chat/message/chat-read-receipt.svelte +14 -44
- package/src/components/chat/message/image-lightbox.svelte +64 -92
- package/src/components/chat/message/markdown-preview.svelte +33 -40
- package/src/components/chat/message/message-attachments.svelte +44 -75
- package/src/components/chat/message/message-content.svelte +42 -73
- package/src/components/chat/message/parts/image-part.svelte +4 -20
- package/src/components/chat/message/parts/markdown-part.svelte +3 -9
- package/src/components/chat/message/parts/reasoning-part.svelte +26 -40
- package/src/components/chat/message/parts/step-part.svelte +8 -15
- package/src/components/chat/message/parts/suggestion-part.svelte +4 -20
- package/src/components/chat/message/parts/tool-approval-part.svelte +25 -44
- package/src/components/chat/message/parts/tool-call-part.svelte +7 -19
- package/src/components/chat/message/parts/tool-result-part.svelte +17 -26
- package/src/components/chat/message/tool-call-group.svelte +39 -68
- package/src/components/chat/message/tool-payload-code.svelte +5 -46
- package/src/components/chat-conversation-header/chat-conversation-header.schema.json +34 -0
- package/src/components/chat-conversation-header/chat-conversation-header.schema.ts +38 -0
- package/src/components/chat-conversation-header/chat-conversation-header.svelte +12 -46
- package/src/components/chat-conversation-header/chat-conversation-header.variables.json +1 -0
- package/src/components/chat-conversation-header/chat-conversation-header.variables.ts +3 -0
- package/src/components/chat-conversation-list/chat-conversation-list.schema.json +45 -0
- package/src/components/chat-conversation-list/chat-conversation-list.schema.ts +52 -0
- package/src/components/chat-conversation-list/chat-conversation-list.svelte +12 -47
- package/src/components/chat-conversation-list/chat-conversation-list.variables.json +1 -0
- package/src/components/chat-conversation-list/chat-conversation-list.variables.ts +3 -0
- package/src/components/checkbox/checkbox.examples.json +6 -0
- package/src/components/checkbox/checkbox.schema.json +53 -0
- package/src/components/checkbox/checkbox.schema.ts +59 -0
- package/src/components/checkbox/checkbox.svelte +66 -104
- package/src/components/checkbox/checkbox.types.ts +2 -0
- package/src/components/checkbox/checkbox.variables.json +1 -0
- package/src/components/checkbox/checkbox.variables.ts +3 -0
- package/src/components/checkbox-group/checkbox-group.schema.json +45 -0
- package/src/components/checkbox-group/checkbox-group.schema.ts +54 -0
- package/src/components/checkbox-group/checkbox-group.svelte +18 -50
- package/src/components/checkbox-group/checkbox-group.variables.json +1 -0
- package/src/components/checkbox-group/checkbox-group.variables.ts +3 -0
- package/src/components/chip/chip.schema.json +60 -0
- package/src/components/chip/chip.schema.ts +68 -0
- package/src/components/chip/chip.svelte +64 -102
- package/src/components/chip/chip.variables.json +1 -0
- package/src/components/chip/chip.variables.ts +3 -0
- package/src/components/choice-grid/choice-grid.schema.json +64 -0
- package/src/components/choice-grid/choice-grid.schema.ts +73 -0
- package/src/components/choice-grid/choice-grid.svelte +112 -179
- package/src/components/choice-grid/choice-grid.variables.json +1 -0
- package/src/components/choice-grid/choice-grid.variables.ts +3 -0
- package/src/components/choice-grid-item/choice-grid-item.schema.json +34 -0
- package/src/components/choice-grid-item/choice-grid-item.schema.ts +40 -0
- package/src/components/choice-grid-item/choice-grid-item.svelte +62 -99
- package/src/components/choice-grid-item/choice-grid-item.variables.json +1 -0
- package/src/components/choice-grid-item/choice-grid-item.variables.ts +3 -0
- package/src/components/click-away-listener/click-away-listener.schema.json +31 -0
- package/src/components/click-away-listener/click-away-listener.schema.ts +37 -0
- package/src/components/click-away-listener/click-away-listener.svelte +32 -59
- package/src/components/click-away-listener/click-away-listener.variables.json +1 -0
- package/src/components/click-away-listener/click-away-listener.variables.ts +3 -0
- package/src/components/code-block/code-block.css +56 -2
- package/src/components/code-block/code-block.schema.json +37 -0
- package/src/components/code-block/code-block.schema.ts +44 -0
- package/src/components/code-block/code-block.svelte +39 -63
- package/src/components/code-block/code-block.variables.json +1 -0
- package/src/components/code-block/code-block.variables.ts +3 -0
- package/src/components/collapsible/collapsible-bindable-harness.svelte +2 -3
- package/src/components/collapsible/collapsible-open-prop-harness.svelte +2 -3
- package/src/components/collapsible/collapsible-snippet-trigger-harness.svelte +1 -1
- package/src/components/collapsible/collapsible.schema.json +49 -0
- package/src/components/collapsible/collapsible.schema.ts +57 -0
- package/src/components/collapsible/collapsible.svelte +25 -58
- package/src/components/collapsible/collapsible.variables.json +1 -0
- package/src/components/collapsible/collapsible.variables.ts +3 -0
- package/src/components/color-field/color-field.schema.json +80 -0
- package/src/components/color-field/color-field.schema.ts +92 -0
- package/src/components/color-field/color-field.svelte +251 -301
- package/src/components/color-field/color-field.variables.json +1 -0
- package/src/components/color-field/color-field.variables.ts +3 -0
- package/src/components/color-picker/color-picker.schema.json +56 -0
- package/src/components/color-picker/color-picker.schema.ts +62 -0
- package/src/components/color-picker/color-picker.svelte +359 -409
- package/src/components/color-picker/color-picker.variables.json +1 -0
- package/src/components/color-picker/color-picker.variables.ts +3 -0
- package/src/components/color-swatch-picker/color-swatch-picker.schema.json +60 -0
- package/src/components/color-swatch-picker/color-swatch-picker.schema.ts +67 -0
- package/src/components/color-swatch-picker/color-swatch-picker.svelte +81 -124
- package/src/components/color-swatch-picker/color-swatch-picker.variables.json +1 -0
- package/src/components/color-swatch-picker/color-swatch-picker.variables.ts +3 -0
- package/src/components/combobox/combobox.schema.json +76 -0
- package/src/components/combobox/combobox.schema.ts +83 -0
- package/src/components/combobox/combobox.svelte +194 -229
- package/src/components/combobox/combobox.variables.json +1 -0
- package/src/components/combobox/combobox.variables.ts +3 -0
- package/src/components/command-item/command-item.schema.json +61 -0
- package/src/components/command-item/command-item.schema.ts +66 -0
- package/src/components/command-item/command-item.svelte +43 -87
- package/src/components/command-item/command-item.variables.json +1 -0
- package/src/components/command-item/command-item.variables.ts +3 -0
- package/src/components/command-menu/caret-rect.svelte.ts +76 -91
- package/src/components/command-menu/command-menu.schema.json +81 -0
- package/src/components/command-menu/command-menu.schema.ts +85 -0
- package/src/components/command-menu/command-menu.svelte +70 -120
- package/src/components/command-menu/command-menu.variables.json +1 -0
- package/src/components/command-menu/command-menu.variables.ts +3 -0
- package/src/components/command-palette/command-palette.schema.json +58 -0
- package/src/components/command-palette/command-palette.schema.ts +64 -0
- package/src/components/command-palette/command-palette.svelte +93 -136
- package/src/components/command-palette/command-palette.variables.json +1 -0
- package/src/components/command-palette/command-palette.variables.ts +3 -0
- package/src/components/confirm-dialog/confirm-dialog.schema.json +56 -0
- package/src/components/confirm-dialog/confirm-dialog.schema.ts +66 -0
- package/src/components/confirm-dialog/confirm-dialog.svelte +11 -40
- package/src/components/confirm-dialog/confirm-dialog.variables.json +1 -0
- package/src/components/confirm-dialog/confirm-dialog.variables.ts +3 -0
- package/src/components/container/container.schema.json +140 -0
- package/src/components/container/container.schema.ts +144 -0
- package/src/components/container/container.svelte +3 -25
- package/src/components/container/container.variables.json +1 -0
- package/src/components/container/container.variables.ts +3 -0
- package/src/components/context-menu/context-menu.schema.json +50 -0
- package/src/components/context-menu/context-menu.schema.ts +57 -0
- package/src/components/context-menu/context-menu.svelte +98 -142
- package/src/components/context-menu/context-menu.variables.json +1 -0
- package/src/components/context-menu/context-menu.variables.ts +3 -0
- package/src/components/context-menu-trigger/context-menu-trigger.schema.json +20 -0
- package/src/components/context-menu-trigger/context-menu-trigger.schema.ts +24 -0
- package/src/components/context-menu-trigger/context-menu-trigger.svelte +62 -111
- package/src/components/context-menu-trigger/context-menu-trigger.variables.json +1 -0
- package/src/components/context-menu-trigger/context-menu-trigger.variables.ts +3 -0
- package/src/components/copy-button/__test-helpers__/copy-state-wrapper.svelte +8 -17
- package/src/components/copy-button/copy-button.schema.json +46 -0
- package/src/components/copy-button/copy-button.schema.ts +52 -0
- package/src/components/copy-button/copy-button.svelte +34 -60
- package/src/components/copy-button/copy-button.variables.json +1 -0
- package/src/components/copy-button/copy-button.variables.ts +3 -0
- package/src/components/copy-button/use-copy-state.svelte.ts +32 -57
- package/src/components/cta-section/cta-section.schema.json +67 -0
- package/src/components/cta-section/cta-section.schema.ts +71 -0
- package/src/components/cta-section/cta-section.svelte +5 -36
- package/src/components/cta-section/cta-section.variables.json +1 -0
- package/src/components/cta-section/cta-section.variables.ts +3 -0
- package/src/components/data-grid/_internal/column-model.svelte.ts +112 -206
- package/src/components/data-grid/_internal/selection-model.svelte.ts +121 -159
- package/src/components/data-grid/_internal/virtualization-adapter.svelte.ts +376 -488
- package/src/components/data-grid/data-grid.schema.json +106 -0
- package/src/components/data-grid/data-grid.schema.ts +114 -0
- package/src/components/data-grid/data-grid.svelte +458 -653
- package/src/components/data-grid/data-grid.variables.json +1 -0
- package/src/components/data-grid/data-grid.variables.ts +3 -0
- package/src/components/data-list/data-list.schema.json +42 -0
- package/src/components/data-list/data-list.schema.ts +50 -0
- package/src/components/data-list/data-list.svelte +10 -35
- package/src/components/data-list/data-list.variables.json +1 -0
- package/src/components/data-list/data-list.variables.ts +3 -0
- package/src/components/data-table/data-table.schema.json +96 -0
- package/src/components/data-table/data-table.schema.ts +112 -0
- package/src/components/data-table/data-table.svelte +238 -343
- package/src/components/data-table/data-table.variables.json +1 -0
- package/src/components/data-table/data-table.variables.ts +3 -0
- package/src/components/date-picker/date-picker.schema.json +61 -0
- package/src/components/date-picker/date-picker.schema.ts +65 -0
- package/src/components/date-picker/date-picker.svelte +96 -130
- package/src/components/date-picker/date-picker.variables.json +1 -0
- package/src/components/date-picker/date-picker.variables.ts +3 -0
- package/src/components/date-range-field/date-range-field.schema.json +66 -0
- package/src/components/date-range-field/date-range-field.schema.ts +75 -0
- package/src/components/date-range-field/date-range-field.svelte +154 -234
- package/src/components/date-range-field/date-range-field.variables.json +1 -0
- package/src/components/date-range-field/date-range-field.variables.ts +3 -0
- package/src/components/description-list/description-list.schema.json +29 -0
- package/src/components/description-list/description-list.schema.ts +35 -0
- package/src/components/description-list/description-list.svelte +26 -53
- package/src/components/description-list/description-list.variables.json +1 -0
- package/src/components/description-list/description-list.variables.ts +3 -0
- package/src/components/diff-statistics/diff-statistics.schema.json +36 -0
- package/src/components/diff-statistics/diff-statistics.schema.ts +42 -0
- package/src/components/diff-statistics/diff-statistics.svelte +12 -45
- package/src/components/diff-statistics/diff-statistics.variables.json +1 -0
- package/src/components/diff-statistics/diff-statistics.variables.ts +3 -0
- package/src/components/diff-viewer/diff-controller.svelte.ts +208 -272
- package/src/components/diff-viewer/diff-front-matter.svelte +12 -49
- package/src/components/diff-viewer/diff-line.svelte +34 -60
- package/src/components/diff-viewer/diff-summary-bar.svelte +28 -47
- package/src/components/diff-viewer/diff-toolbar.svelte +21 -72
- package/src/components/diff-viewer/diff-viewer.schema.json +61 -0
- package/src/components/diff-viewer/diff-viewer.schema.ts +70 -0
- package/src/components/diff-viewer/diff-viewer.svelte +192 -279
- package/src/components/diff-viewer/diff-viewer.variables.json +1 -0
- package/src/components/diff-viewer/diff-viewer.variables.ts +3 -0
- package/src/components/diff-viewer/front-matter-header.svelte +21 -62
- package/src/components/divider/divider.schema.json +31 -0
- package/src/components/divider/divider.schema.ts +35 -0
- package/src/components/divider/divider.svelte +4 -28
- package/src/components/divider/divider.variables.json +1 -0
- package/src/components/divider/divider.variables.ts +3 -0
- package/src/components/drawer/drawer.schema.json +57 -0
- package/src/components/drawer/drawer.schema.ts +64 -0
- package/src/components/drawer/drawer.svelte +61 -99
- package/src/components/drawer/drawer.variables.json +1 -0
- package/src/components/drawer/drawer.variables.ts +3 -0
- package/src/components/dropdown/dropdown.schema.json +35 -0
- package/src/components/dropdown/dropdown.schema.ts +40 -0
- package/src/components/dropdown/dropdown.svelte +96 -144
- package/src/components/dropdown/dropdown.variables.json +1 -0
- package/src/components/dropdown/dropdown.variables.ts +3 -0
- package/src/components/dropdown-group/dropdown-group.schema.json +28 -0
- package/src/components/dropdown-group/dropdown-group.schema.ts +34 -0
- package/src/components/dropdown-group/dropdown-group.svelte +15 -46
- package/src/components/dropdown-group/dropdown-group.variables.json +1 -0
- package/src/components/dropdown-group/dropdown-group.variables.ts +3 -0
- package/src/components/dropdown-item/dropdown-item.schema.json +51 -0
- package/src/components/dropdown-item/dropdown-item.schema.ts +62 -0
- package/src/components/dropdown-item/dropdown-item.svelte +37 -108
- package/src/components/dropdown-item/dropdown-item.variables.json +1 -0
- package/src/components/dropdown-item/dropdown-item.variables.ts +3 -0
- package/src/components/dropdown-label/dropdown-label.schema.json +19 -0
- package/src/components/dropdown-label/dropdown-label.schema.ts +23 -0
- package/src/components/dropdown-label/dropdown-label.svelte +3 -18
- package/src/components/dropdown-label/dropdown-label.variables.json +1 -0
- package/src/components/dropdown-label/dropdown-label.variables.ts +3 -0
- package/src/components/dropdown-menu/dropdown-menu.schema.json +19 -0
- package/src/components/dropdown-menu/dropdown-menu.schema.ts +23 -0
- package/src/components/dropdown-menu/dropdown-menu.svelte +112 -154
- package/src/components/dropdown-menu/dropdown-menu.variables.json +1 -0
- package/src/components/dropdown-menu/dropdown-menu.variables.ts +3 -0
- package/src/components/dropdown-separator/dropdown-separator.schema.json +11 -0
- package/src/components/dropdown-separator/dropdown-separator.schema.ts +15 -0
- package/src/components/dropdown-separator/dropdown-separator.svelte +3 -18
- package/src/components/dropdown-separator/dropdown-separator.variables.json +1 -0
- package/src/components/dropdown-separator/dropdown-separator.variables.ts +3 -0
- package/src/components/dropdown-trigger/dropdown-trigger.schema.json +23 -0
- package/src/components/dropdown-trigger/dropdown-trigger.schema.ts +27 -0
- package/src/components/dropdown-trigger/dropdown-trigger.svelte +13 -47
- package/src/components/dropdown-trigger/dropdown-trigger.variables.json +1 -0
- package/src/components/dropdown-trigger/dropdown-trigger.variables.ts +3 -0
- package/src/components/empty-state/empty-state.schema.json +37 -0
- package/src/components/empty-state/empty-state.schema.ts +42 -0
- package/src/components/empty-state/empty-state.svelte +12 -39
- package/src/components/empty-state/empty-state.variables.json +1 -0
- package/src/components/empty-state/empty-state.variables.ts +3 -0
- package/src/components/event-stream-viewer/event-stream-viewer.schema.json +128 -0
- package/src/components/event-stream-viewer/event-stream-viewer.schema.ts +150 -0
- package/src/components/event-stream-viewer/event-stream-viewer.svelte +145 -246
- package/src/components/event-stream-viewer/event-stream-viewer.variables.json +1 -0
- package/src/components/event-stream-viewer/event-stream-viewer.variables.ts +3 -0
- package/src/components/event-timeline/event-timeline.schema.json +95 -0
- package/src/components/event-timeline/event-timeline.schema.ts +99 -0
- package/src/components/event-timeline/event-timeline.svelte +65 -123
- package/src/components/event-timeline/event-timeline.variables.json +1 -0
- package/src/components/event-timeline/event-timeline.variables.ts +3 -0
- package/src/components/experimental/json-viewer/index.ts +3 -3
- package/src/components/experimental/message/index.ts +3 -3
- package/src/components/faceted-filter-bar/faceted-filter-bar.schema.json +65 -0
- package/src/components/faceted-filter-bar/faceted-filter-bar.schema.ts +71 -0
- package/src/components/faceted-filter-bar/faceted-filter-bar.svelte +48 -101
- package/src/components/faceted-filter-bar/faceted-filter-bar.variables.json +1 -0
- package/src/components/faceted-filter-bar/faceted-filter-bar.variables.ts +3 -0
- package/src/components/feature-section/feature-section.css +3 -2
- package/src/components/feature-section/feature-section.schema.json +82 -0
- package/src/components/feature-section/feature-section.schema.ts +86 -0
- package/src/components/feature-section/feature-section.svelte +4 -39
- package/src/components/feature-section/feature-section.variables.json +1 -0
- package/src/components/feature-section/feature-section.variables.ts +3 -0
- package/src/components/feed/feed.schema.json +25 -0
- package/src/components/feed/feed.schema.ts +30 -0
- package/src/components/feed/feed.svelte +4 -21
- package/src/components/feed/feed.variables.json +1 -0
- package/src/components/feed/feed.variables.ts +3 -0
- package/src/components/feed-event/feed-event.schema.json +43 -0
- package/src/components/feed-event/feed-event.schema.ts +51 -0
- package/src/components/feed-event/feed-event.svelte +3 -28
- package/src/components/feed-event/feed-event.variables.json +1 -0
- package/src/components/feed-event/feed-event.variables.ts +3 -0
- package/src/components/file-upload/file-upload.schema.json +70 -0
- package/src/components/file-upload/file-upload.schema.ts +74 -0
- package/src/components/file-upload/file-upload.svelte +156 -212
- package/src/components/file-upload/file-upload.variables.json +6 -0
- package/src/components/file-upload/file-upload.variables.ts +8 -0
- package/src/components/floating-action-button/floating-action-button.schema.json +44 -0
- package/src/components/floating-action-button/floating-action-button.schema.ts +49 -0
- package/src/components/floating-action-button/floating-action-button.svelte +30 -89
- package/src/components/floating-action-button/floating-action-button.variables.json +1 -0
- package/src/components/floating-action-button/floating-action-button.variables.ts +3 -0
- package/src/components/focus-trap/focus-trap.schema.json +50 -0
- package/src/components/focus-trap/focus-trap.schema.ts +58 -0
- package/src/components/focus-trap/focus-trap.svelte +4 -27
- package/src/components/focus-trap/focus-trap.utilities.svelte.ts +208 -256
- package/src/components/focus-trap/focus-trap.variables.json +1 -0
- package/src/components/focus-trap/focus-trap.variables.ts +3 -0
- package/src/components/footer/footer.css +2 -1
- package/src/components/footer/footer.schema.json +41 -0
- package/src/components/footer/footer.schema.ts +45 -0
- package/src/components/footer/footer.svelte +3 -28
- package/src/components/footer/footer.variables.json +1 -0
- package/src/components/footer/footer.variables.ts +3 -0
- package/src/components/form-field/form-field.schema.json +46 -0
- package/src/components/form-field/form-field.schema.ts +52 -0
- package/src/components/form-field/form-field.svelte +20 -50
- package/src/components/form-field/form-field.variables.json +1 -0
- package/src/components/form-field/form-field.variables.ts +3 -0
- package/src/components/form-section/form-section.schema.json +41 -0
- package/src/components/form-section/form-section.schema.ts +45 -0
- package/src/components/form-section/form-section.svelte +25 -40
- package/src/components/form-section/form-section.variables.json +1 -0
- package/src/components/form-section/form-section.variables.ts +3 -0
- package/src/components/grid/grid.schema.json +53 -0
- package/src/components/grid/grid.schema.ts +59 -0
- package/src/components/grid/grid.svelte +12 -40
- package/src/components/grid/grid.variables.json +1 -0
- package/src/components/grid/grid.variables.ts +3 -0
- package/src/components/grid-item/grid-item.schema.json +80 -0
- package/src/components/grid-item/grid-item.schema.ts +84 -0
- package/src/components/grid-item/grid-item.svelte +9 -35
- package/src/components/grid-item/grid-item.variables.json +1 -0
- package/src/components/grid-item/grid-item.variables.ts +3 -0
- package/src/components/grid-list/grid-list.schema.json +26 -0
- package/src/components/grid-list/grid-list.schema.ts +31 -0
- package/src/components/grid-list/grid-list.svelte +4 -22
- package/src/components/grid-list/grid-list.variables.json +1 -0
- package/src/components/grid-list/grid-list.variables.ts +3 -0
- package/src/components/grid-list-item/grid-list-item.schema.json +60 -0
- package/src/components/grid-list-item/grid-list-item.schema.ts +69 -0
- package/src/components/grid-list-item/grid-list-item.svelte +12 -37
- package/src/components/grid-list-item/grid-list-item.variables.json +1 -0
- package/src/components/grid-list-item/grid-list-item.variables.ts +3 -0
- package/src/components/hero-section/hero-section.css +2 -1
- package/src/components/hero-section/hero-section.schema.json +63 -0
- package/src/components/hero-section/hero-section.schema.ts +67 -0
- package/src/components/hero-section/hero-section.svelte +4 -38
- package/src/components/hero-section/hero-section.variables.json +1 -0
- package/src/components/hero-section/hero-section.variables.ts +3 -0
- package/src/components/hover-card/hover-card.schema.json +74 -0
- package/src/components/hover-card/hover-card.schema.ts +83 -0
- package/src/components/hover-card/hover-card.svelte +100 -155
- package/src/components/hover-card/hover-card.variables.json +1 -0
- package/src/components/hover-card/hover-card.variables.ts +3 -0
- package/src/components/image/image.schema.json +64 -0
- package/src/components/image/image.schema.ts +72 -0
- package/src/components/image/image.svelte +32 -71
- package/src/components/image/image.variables.json +1 -0
- package/src/components/image/image.variables.ts +3 -0
- package/src/components/inline-loading/inline-loading.schema.json +29 -0
- package/src/components/inline-loading/inline-loading.schema.ts +35 -0
- package/src/components/inline-loading/inline-loading.svelte +49 -92
- package/src/components/inline-loading/inline-loading.variables.json +1 -0
- package/src/components/inline-loading/inline-loading.variables.ts +3 -0
- package/src/components/input/input.schema.json +75 -0
- package/src/components/input/input.schema.ts +86 -0
- package/src/components/input/input.svelte +57 -102
- package/src/components/input/input.variables.json +1 -0
- package/src/components/input/input.variables.ts +3 -0
- package/src/components/invocation-rule-builder/invocation-rule-builder.schema.json +163 -0
- package/src/components/invocation-rule-builder/invocation-rule-builder.schema.ts +173 -0
- package/src/components/invocation-rule-builder/invocation-rule-builder.svelte +117 -219
- package/src/components/invocation-rule-builder/invocation-rule-builder.variables.json +1 -0
- package/src/components/invocation-rule-builder/invocation-rule-builder.variables.ts +3 -0
- package/src/components/json-schema-editor/diff-view.svelte +7 -13
- package/src/components/json-schema-editor/form-view.svelte +11 -20
- package/src/components/json-schema-editor/json-schema-editor-impl.svelte +129 -185
- package/src/components/json-schema-editor/json-schema-editor-state.svelte.ts +398 -450
- package/src/components/json-schema-editor/json-schema-editor.schema.json +63 -0
- package/src/components/json-schema-editor/json-schema-editor.schema.ts +67 -0
- package/src/components/json-schema-editor/json-schema-editor.svelte +5 -33
- package/src/components/json-schema-editor/json-schema-editor.variables.json +1 -0
- package/src/components/json-schema-editor/json-schema-editor.variables.ts +3 -0
- package/src/components/json-schema-editor/json-schema-toolbar.svelte +80 -109
- package/src/components/json-schema-editor/json-view.svelte +24 -36
- package/src/components/json-schema-editor/property-editor.svelte +178 -242
- package/src/components/json-schema-editor/property-list.svelte +107 -142
- package/src/components/json-viewer/_json-viewer-node.svelte +33 -60
- package/src/components/json-viewer/json-viewer.schema.json +33 -0
- package/src/components/json-viewer/json-viewer.schema.ts +38 -0
- package/src/components/json-viewer/json-viewer.svelte +74 -95
- package/src/components/json-viewer/json-viewer.variables.json +1 -0
- package/src/components/json-viewer/json-viewer.variables.ts +3 -0
- package/src/components/kanban-board/kanban-board.schema.json +64 -0
- package/src/components/kanban-board/kanban-board.schema.ts +70 -0
- package/src/components/kanban-board/kanban-board.svelte +311 -430
- package/src/components/kanban-board/kanban-board.variables.json +6 -0
- package/src/components/kanban-board/kanban-board.variables.ts +8 -0
- package/src/components/kbd/kbd.schema.json +29 -0
- package/src/components/kbd/kbd.schema.ts +33 -0
- package/src/components/kbd/kbd.svelte +3 -18
- package/src/components/kbd/kbd.variables.json +1 -0
- package/src/components/kbd/kbd.variables.ts +3 -0
- package/src/components/keyboard-shortcuts/keyboard-shortcuts.schema.json +30 -0
- package/src/components/keyboard-shortcuts/keyboard-shortcuts.schema.ts +34 -0
- package/src/components/keyboard-shortcuts/keyboard-shortcuts.svelte +17 -42
- package/src/components/keyboard-shortcuts/keyboard-shortcuts.variables.json +1 -0
- package/src/components/keyboard-shortcuts/keyboard-shortcuts.variables.ts +3 -0
- package/src/components/label/label.schema.json +35 -0
- package/src/components/label/label.schema.ts +40 -0
- package/src/components/label/label.svelte +3 -24
- package/src/components/label/label.variables.json +1 -0
- package/src/components/label/label.variables.ts +3 -0
- package/src/components/line-chart/line-chart.schema.json +139 -0
- package/src/components/line-chart/line-chart.schema.ts +145 -0
- package/src/components/line-chart/line-chart.svelte +67 -139
- package/src/components/line-chart/line-chart.variables.json +1 -0
- package/src/components/line-chart/line-chart.variables.ts +3 -0
- package/src/components/link/link.schema.json +61 -0
- package/src/components/link/link.schema.ts +72 -0
- package/src/components/link/link.svelte +37 -68
- package/src/components/link/link.variables.json +1 -0
- package/src/components/link/link.variables.ts +3 -0
- package/src/components/load-more/load-more.schema.json +58 -0
- package/src/components/load-more/load-more.schema.ts +64 -0
- package/src/components/load-more/load-more.svelte +56 -90
- package/src/components/load-more/load-more.variables.json +1 -0
- package/src/components/load-more/load-more.variables.ts +3 -0
- package/src/components/locale-provider/locale-provider.schema.json +24 -0
- package/src/components/locale-provider/locale-provider.schema.ts +28 -0
- package/src/components/locale-provider/locale-provider.svelte +9 -29
- package/src/components/locale-provider/locale-provider.variables.json +1 -0
- package/src/components/locale-provider/locale-provider.variables.ts +3 -0
- package/src/components/logo-cloud/logo-cloud.css +3 -2
- package/src/components/logo-cloud/logo-cloud.schema.json +63 -0
- package/src/components/logo-cloud/logo-cloud.schema.ts +67 -0
- package/src/components/logo-cloud/logo-cloud.svelte +4 -31
- package/src/components/logo-cloud/logo-cloud.variables.json +1 -0
- package/src/components/logo-cloud/logo-cloud.variables.ts +3 -0
- package/src/components/markdown-editor/editor-skeleton.svelte +15 -25
- package/src/components/markdown-editor/editor-toolbar/editor-toolbar.svelte +96 -163
- package/src/components/markdown-editor/editor-toolbar/link-popover.svelte +85 -137
- package/src/components/markdown-editor/editor-toolbar/toolbar-button.svelte +6 -34
- package/src/components/markdown-editor/editor-toolbar/toolbar-dropdown.svelte +14 -47
- package/src/components/markdown-editor/editor-toolbar/toolbar-separator.svelte +3 -8
- package/src/components/markdown-editor/markdown-editor.examples.json +6 -0
- package/src/components/markdown-editor/markdown-editor.schema.json +111 -0
- package/src/components/markdown-editor/markdown-editor.schema.ts +122 -0
- package/src/components/markdown-editor/markdown-editor.svelte +472 -570
- package/src/components/markdown-editor/markdown-editor.variables.json +1 -0
- package/src/components/markdown-editor/markdown-editor.variables.ts +3 -0
- package/src/components/marquee/marquee.schema.json +50 -0
- package/src/components/marquee/marquee.schema.ts +54 -0
- package/src/components/marquee/marquee.svelte +132 -186
- package/src/components/marquee/marquee.variables.json +1 -0
- package/src/components/marquee/marquee.variables.ts +7 -0
- package/src/components/masonry/masonry.schema.json +34 -0
- package/src/components/masonry/masonry.schema.ts +39 -0
- package/src/components/masonry/masonry.svelte +3 -24
- package/src/components/masonry/masonry.variables.json +1 -0
- package/src/components/masonry/masonry.variables.ts +3 -0
- package/src/components/matrix-chart/matrix-chart.schema.json +90 -0
- package/src/components/matrix-chart/matrix-chart.schema.ts +95 -0
- package/src/components/matrix-chart/matrix-chart.svelte +115 -182
- package/src/components/matrix-chart/matrix-chart.variables.json +1 -0
- package/src/components/matrix-chart/matrix-chart.variables.ts +3 -0
- package/src/components/media-controls/media-controls.schema.json +68 -0
- package/src/components/media-controls/media-controls.schema.ts +72 -0
- package/src/components/media-controls/media-controls.svelte +47 -83
- package/src/components/media-controls/media-controls.variables.json +1 -0
- package/src/components/media-controls/media-controls.variables.ts +3 -0
- package/src/components/mega-menu/mega-menu.schema.json +37 -0
- package/src/components/mega-menu/mega-menu.schema.ts +41 -0
- package/src/components/mega-menu/mega-menu.svelte +180 -225
- package/src/components/mega-menu/mega-menu.variables.json +1 -0
- package/src/components/mega-menu/mega-menu.variables.ts +3 -0
- package/src/components/menu-bar/menu-bar-dropdown-context.svelte +9 -27
- package/src/components/menu-bar/menu-bar.schema.json +32 -0
- package/src/components/menu-bar/menu-bar.schema.ts +38 -0
- package/src/components/menu-bar/menu-bar.svelte +371 -518
- package/src/components/menu-bar/menu-bar.variables.json +1 -0
- package/src/components/menu-bar/menu-bar.variables.ts +3 -0
- package/src/components/message/message.schema.json +38 -0
- package/src/components/message/message.schema.ts +44 -0
- package/src/components/message/message.svelte +8 -36
- package/src/components/message/message.variables.json +1 -0
- package/src/components/message/message.variables.ts +3 -0
- package/src/components/meter/meter.schema.json +51 -0
- package/src/components/meter/meter.schema.ts +59 -0
- package/src/components/meter/meter.svelte +72 -128
- package/src/components/meter/meter.variables.json +1 -0
- package/src/components/meter/meter.variables.ts +3 -0
- package/src/components/modal/modal.schema.json +77 -0
- package/src/components/modal/modal.schema.ts +8 -0
- package/src/components/modal/modal.svelte +101 -148
- package/src/components/modal/modal.variables.json +1 -0
- package/src/components/modal/modal.variables.ts +3 -0
- package/src/components/multi-select/multi-select.schema.json +88 -0
- package/src/components/multi-select/multi-select.schema.ts +93 -0
- package/src/components/multi-select/multi-select.svelte +255 -303
- package/src/components/multi-select/multi-select.variables.json +1 -0
- package/src/components/multi-select/multi-select.variables.ts +3 -0
- package/src/components/navigation-bar/index.ts +1 -0
- package/src/components/navigation-bar/navigation-bar.css +15 -0
- package/src/components/navigation-bar/navigation-bar.examples.json +1 -1
- package/src/components/navigation-bar/navigation-bar.schema.json +57 -0
- package/src/components/navigation-bar/navigation-bar.schema.ts +66 -0
- package/src/components/navigation-bar/navigation-bar.svelte +117 -167
- package/src/components/navigation-bar/navigation-bar.types.ts +8 -0
- package/src/components/navigation-bar/navigation-bar.variables.json +1 -0
- package/src/components/navigation-bar/navigation-bar.variables.ts +3 -0
- package/src/components/navigation-item/navigation-item.schema.json +45 -0
- package/src/components/navigation-item/navigation-item.schema.ts +55 -0
- package/src/components/navigation-item/navigation-item.svelte +29 -63
- package/src/components/navigation-item/navigation-item.variables.json +1 -0
- package/src/components/navigation-item/navigation-item.variables.ts +3 -0
- package/src/components/newsletter-section/newsletter-section.css +2 -1
- package/src/components/newsletter-section/newsletter-section.schema.json +62 -0
- package/src/components/newsletter-section/newsletter-section.schema.ts +66 -0
- package/src/components/newsletter-section/newsletter-section.svelte +12 -45
- package/src/components/newsletter-section/newsletter-section.variables.json +1 -0
- package/src/components/newsletter-section/newsletter-section.variables.ts +3 -0
- package/src/components/number-input/number-input.schema.json +91 -0
- package/src/components/number-input/number-input.schema.ts +103 -0
- package/src/components/number-input/number-input.svelte +336 -439
- package/src/components/number-input/number-input.variables.json +1 -0
- package/src/components/number-input/number-input.variables.ts +3 -0
- package/src/components/page-header/page-header.schema.json +29 -0
- package/src/components/page-header/page-header.schema.ts +33 -0
- package/src/components/page-header/page-header.svelte +3 -19
- package/src/components/page-header/page-header.variables.json +1 -0
- package/src/components/page-header/page-header.variables.ts +3 -0
- package/src/components/pagination/pagination.examples.json +12 -0
- package/src/components/pagination/pagination.schema.json +33 -0
- package/src/components/pagination/pagination.schema.ts +39 -0
- package/src/components/pagination/pagination.svelte +38 -77
- package/src/components/pagination/pagination.types.ts +6 -2
- package/src/components/pagination/pagination.variables.json +1 -0
- package/src/components/pagination/pagination.variables.ts +3 -0
- package/src/components/payload-inspector/payload-inspector.schema.json +63 -0
- package/src/components/payload-inspector/payload-inspector.schema.ts +76 -0
- package/src/components/payload-inspector/payload-inspector.svelte +168 -228
- package/src/components/payload-inspector/payload-inspector.variables.json +1 -0
- package/src/components/payload-inspector/payload-inspector.variables.ts +3 -0
- package/src/components/permission-matrix/permission-matrix.schema.json +70 -0
- package/src/components/permission-matrix/permission-matrix.schema.ts +74 -0
- package/src/components/permission-matrix/permission-matrix.svelte +18 -71
- package/src/components/permission-matrix/permission-matrix.variables.json +1 -0
- package/src/components/permission-matrix/permission-matrix.variables.ts +3 -0
- package/src/components/phone-input/phone-input.schema.json +572 -0
- package/src/components/phone-input/phone-input.schema.ts +579 -0
- package/src/components/phone-input/phone-input.svelte +235 -331
- package/src/components/phone-input/phone-input.variables.json +1 -0
- package/src/components/phone-input/phone-input.variables.ts +3 -0
- package/src/components/pin-input/pin-input.schema.json +82 -0
- package/src/components/pin-input/pin-input.schema.ts +91 -0
- package/src/components/pin-input/pin-input.svelte +143 -199
- package/src/components/pin-input/pin-input.variables.json +1 -0
- package/src/components/pin-input/pin-input.variables.ts +3 -0
- package/src/components/popover/popover.schema.json +88 -0
- package/src/components/popover/popover.schema.ts +93 -0
- package/src/components/popover/popover.svelte +160 -215
- package/src/components/popover/popover.variables.json +1 -0
- package/src/components/popover/popover.variables.ts +3 -0
- package/src/components/portal/portal.schema.json +39 -0
- package/src/components/portal/portal.schema.ts +46 -0
- package/src/components/portal/portal.svelte +14 -35
- package/src/components/portal/portal.utilities.svelte.ts +199 -167
- package/src/components/portal/portal.variables.json +1 -0
- package/src/components/portal/portal.variables.ts +3 -0
- package/src/components/pricing-card/pricing-card.schema.json +50 -0
- package/src/components/pricing-card/pricing-card.schema.ts +54 -0
- package/src/components/pricing-card/pricing-card.svelte +21 -48
- package/src/components/pricing-card/pricing-card.variables.json +1 -0
- package/src/components/pricing-card/pricing-card.variables.ts +3 -0
- package/src/components/pricing-section/pricing-section.css +2 -1
- package/src/components/pricing-section/pricing-section.schema.json +82 -0
- package/src/components/pricing-section/pricing-section.schema.ts +86 -0
- package/src/components/pricing-section/pricing-section.svelte +9 -40
- package/src/components/pricing-section/pricing-section.variables.json +1 -0
- package/src/components/pricing-section/pricing-section.variables.ts +3 -0
- package/src/components/progress/progress.schema.json +39 -0
- package/src/components/progress/progress.schema.ts +46 -0
- package/src/components/progress/progress.svelte +22 -59
- package/src/components/progress/progress.variables.json +1 -0
- package/src/components/progress/progress.variables.ts +3 -0
- package/src/components/qr-code/qr-code.schema.json +36 -0
- package/src/components/qr-code/qr-code.schema.ts +40 -0
- package/src/components/qr-code/qr-code.svelte +57 -101
- package/src/components/qr-code/qr-code.variables.json +1 -0
- package/src/components/qr-code/qr-code.variables.ts +3 -0
- package/src/components/radio-group/radio-group.schema.json +54 -0
- package/src/components/radio-group/radio-group.schema.ts +61 -0
- package/src/components/radio-group/radio-group.svelte +29 -65
- package/src/components/radio-group/radio-group.variables.json +1 -0
- package/src/components/radio-group/radio-group.variables.ts +3 -0
- package/src/components/rating/rating.schema.json +77 -0
- package/src/components/rating/rating.schema.ts +85 -0
- package/src/components/rating/rating.svelte +177 -233
- package/src/components/rating/rating.variables.json +1 -0
- package/src/components/rating/rating.variables.ts +3 -0
- package/src/components/resizable-panels/resizable-panels.schema.json +53 -0
- package/src/components/resizable-panels/resizable-panels.schema.ts +60 -0
- package/src/components/resizable-panels/resizable-panels.svelte +206 -313
- package/src/components/resizable-panels/resizable-panels.variables.json +1 -0
- package/src/components/resizable-panels/resizable-panels.variables.ts +3 -0
- package/src/components/review-editor/comment-composer.svelte +67 -129
- package/src/components/review-editor/comment-list.svelte +32 -63
- package/src/components/review-editor/comment-sidebar.svelte +57 -99
- package/src/components/review-editor/export-actions.svelte +50 -77
- package/src/components/review-editor/front-matter-fields.svelte +52 -69
- package/src/components/review-editor/live-region.svelte +70 -86
- package/src/components/review-editor/review-editor-anchors.svelte.ts +152 -255
- package/src/components/review-editor/review-editor-controls.svelte +36 -98
- package/src/components/review-editor/review-editor-impl.svelte +953 -1256
- package/src/components/review-editor/review-editor-selection.svelte.ts +226 -283
- package/src/components/review-editor/review-editor-state.svelte.ts +77 -139
- package/src/components/review-editor/review-editor-threads.svelte.ts +365 -573
- package/src/components/review-editor/review-editor.schema.json +83 -0
- package/src/components/review-editor/review-editor.schema.ts +88 -0
- package/src/components/review-editor/review-editor.svelte +5 -28
- package/src/components/review-editor/review-editor.variables.json +1 -0
- package/src/components/review-editor/review-editor.variables.ts +3 -0
- package/src/components/review-editor/thread-popover.svelte +53 -102
- package/src/components/run-step-timeline/run-step-timeline.schema.json +429 -0
- package/src/components/run-step-timeline/run-step-timeline.schema.ts +439 -0
- package/src/components/run-step-timeline/run-step-timeline.svelte +168 -261
- package/src/components/run-step-timeline/run-step-timeline.variables.json +1 -0
- package/src/components/run-step-timeline/run-step-timeline.variables.ts +3 -0
- package/src/components/schema-form/schema-form-body.svelte +259 -352
- package/src/components/schema-form/schema-form.schema.json +39 -0
- package/src/components/schema-form/schema-form.schema.ts +44 -0
- package/src/components/schema-form/schema-form.svelte +18 -42
- package/src/components/schema-form/schema-form.variables.json +1 -0
- package/src/components/schema-form/schema-form.variables.ts +3 -0
- package/src/components/scroll-area/scroll-area.schema.json +45 -0
- package/src/components/scroll-area/scroll-area.schema.ts +51 -0
- package/src/components/scroll-area/scroll-area.svelte +15 -52
- package/src/components/scroll-area/scroll-area.variables.json +1 -0
- package/src/components/scroll-area/scroll-area.variables.ts +3 -0
- package/src/components/search-field/search-field.schema.json +63 -0
- package/src/components/search-field/search-field.schema.ts +69 -0
- package/src/components/search-field/search-field.svelte +42 -86
- package/src/components/search-field/search-field.variables.json +1 -0
- package/src/components/search-field/search-field.variables.ts +3 -0
- package/src/components/secret-value-field/secret-value-field.schema.json +53 -0
- package/src/components/secret-value-field/secret-value-field.schema.ts +64 -0
- package/src/components/secret-value-field/secret-value-field.svelte +33 -65
- package/src/components/secret-value-field/secret-value-field.variables.json +1 -0
- package/src/components/secret-value-field/secret-value-field.variables.ts +3 -0
- package/src/components/section-heading/section-heading.schema.json +43 -0
- package/src/components/section-heading/section-heading.schema.ts +52 -0
- package/src/components/section-heading/section-heading.svelte +4 -28
- package/src/components/section-heading/section-heading.variables.json +1 -0
- package/src/components/section-heading/section-heading.variables.ts +3 -0
- package/src/components/segment/segment.schema.json +45 -0
- package/src/components/segment/segment.schema.ts +50 -0
- package/src/components/segment/segment.svelte +20 -54
- package/src/components/segment/segment.variables.json +1 -0
- package/src/components/segment/segment.variables.ts +3 -0
- package/src/components/segmented-control/index.ts +3 -1
- package/src/components/segmented-control/segmented-control-state.svelte.ts +152 -222
- package/src/components/segmented-control/segmented-control.schema.json +84 -0
- package/src/components/segmented-control/segmented-control.schema.ts +93 -0
- package/src/components/segmented-control/segmented-control.svelte +57 -107
- package/src/components/segmented-control/segmented-control.variables.json +1 -0
- package/src/components/segmented-control/segmented-control.variables.ts +3 -0
- package/src/components/select/select.schema.json +52 -0
- package/src/components/select/select.schema.ts +57 -0
- package/src/components/select/select.svelte +25 -62
- package/src/components/select/select.variables.json +1 -0
- package/src/components/select/select.variables.ts +3 -0
- package/src/components/selection-popover/selection-popover.schema.json +50 -0
- package/src/components/selection-popover/selection-popover.schema.ts +54 -0
- package/src/components/selection-popover/selection-popover.svelte +96 -144
- package/src/components/selection-popover/selection-popover.variables.json +1 -0
- package/src/components/selection-popover/selection-popover.variables.ts +3 -0
- package/src/components/share-card/share-card.schema.json +55 -0
- package/src/components/share-card/share-card.schema.ts +60 -0
- package/src/components/share-card/share-card.svelte +103 -140
- package/src/components/share-card/share-card.variables.json +1 -0
- package/src/components/share-card/share-card.variables.ts +3 -0
- package/src/components/sheet/sheet.schema.json +53 -0
- package/src/components/sheet/sheet.schema.ts +61 -0
- package/src/components/sheet/sheet.svelte +37 -72
- package/src/components/sheet/sheet.variables.json +1 -0
- package/src/components/sheet/sheet.variables.ts +3 -0
- package/src/components/shortcut-hint/shortcut-hint.schema.json +37 -0
- package/src/components/shortcut-hint/shortcut-hint.schema.ts +41 -0
- package/src/components/shortcut-hint/shortcut-hint.svelte +8 -30
- package/src/components/shortcut-hint/shortcut-hint.variables.json +1 -0
- package/src/components/shortcut-hint/shortcut-hint.variables.ts +3 -0
- package/src/components/side-navigation/side-navigation.schema.json +27 -0
- package/src/components/side-navigation/side-navigation.schema.ts +32 -0
- package/src/components/side-navigation/side-navigation.svelte +6 -34
- package/src/components/side-navigation/side-navigation.variables.json +1 -0
- package/src/components/side-navigation/side-navigation.variables.ts +3 -0
- package/src/components/side-navigation-group/_contains-active-harness.svelte +7 -20
- package/src/components/side-navigation-group/side-navigation-group.schema.json +49 -0
- package/src/components/side-navigation-group/side-navigation-group.schema.ts +56 -0
- package/src/components/side-navigation-group/side-navigation-group.svelte +45 -78
- package/src/components/side-navigation-group/side-navigation-group.variables.json +1 -0
- package/src/components/side-navigation-group/side-navigation-group.variables.ts +3 -0
- package/src/components/side-navigation-item/side-navigation-item.schema.json +45 -0
- package/src/components/side-navigation-item/side-navigation-item.schema.ts +54 -0
- package/src/components/side-navigation-item/side-navigation-item.svelte +28 -46
- package/src/components/side-navigation-item/side-navigation-item.variables.json +1 -0
- package/src/components/side-navigation-item/side-navigation-item.variables.ts +3 -0
- package/src/components/sidebar/sidebar.css +14 -0
- package/src/components/sidebar/sidebar.schema.json +38 -0
- package/src/components/sidebar/sidebar.schema.ts +45 -0
- package/src/components/sidebar/sidebar.svelte +53 -99
- package/src/components/sidebar/sidebar.variables.json +1 -0
- package/src/components/sidebar/sidebar.variables.ts +3 -0
- package/src/components/skeleton/skeleton.schema.json +23 -0
- package/src/components/skeleton/skeleton.schema.ts +30 -0
- package/src/components/skeleton/skeleton.svelte +10 -28
- package/src/components/skeleton/skeleton.variables.json +1 -0
- package/src/components/skeleton/skeleton.variables.ts +3 -0
- package/src/components/skip-link/skip-link.schema.json +25 -0
- package/src/components/skip-link/skip-link.schema.ts +29 -0
- package/src/components/skip-link/skip-link.svelte +31 -61
- package/src/components/skip-link/skip-link.variables.json +1 -0
- package/src/components/skip-link/skip-link.variables.ts +3 -0
- package/src/components/slider/slider.schema.json +82 -0
- package/src/components/slider/slider.schema.ts +88 -0
- package/src/components/slider/slider.svelte +267 -315
- package/src/components/slider/slider.variables.json +1 -0
- package/src/components/slider/slider.variables.ts +3 -0
- package/src/components/sortable-list/sortable-list.schema.json +64 -0
- package/src/components/sortable-list/sortable-list.schema.ts +71 -0
- package/src/components/sortable-list/sortable-list.svelte +51 -88
- package/src/components/sortable-list/sortable-list.variables.json +1 -0
- package/src/components/sortable-list/sortable-list.variables.ts +3 -0
- package/src/components/source-diff-viewer/index.ts +18 -0
- package/src/components/source-diff-viewer/source-diff-viewer.css +129 -0
- package/src/components/source-diff-viewer/source-diff-viewer.examples.json +19 -0
- package/src/components/source-diff-viewer/source-diff-viewer.schema.json +36 -0
- package/src/components/source-diff-viewer/source-diff-viewer.schema.ts +40 -0
- package/src/components/source-diff-viewer/source-diff-viewer.svelte +88 -0
- package/src/components/source-diff-viewer/source-diff-viewer.types.ts +50 -0
- package/src/components/source-diff-viewer/source-diff-viewer.utilities.ts +898 -0
- package/src/components/source-diff-viewer/source-diff-viewer.variables.json +1 -0
- package/src/components/source-diff-viewer/source-diff-viewer.variables.ts +3 -0
- package/src/components/sparkbar/sparkbar.schema.json +44 -0
- package/src/components/sparkbar/sparkbar.schema.ts +49 -0
- package/src/components/sparkbar/sparkbar.svelte +11 -41
- package/src/components/sparkbar/sparkbar.variables.json +1 -0
- package/src/components/sparkbar/sparkbar.variables.ts +3 -0
- package/src/components/spectrogram/spectrogram.schema.json +79 -0
- package/src/components/spectrogram/spectrogram.schema.ts +86 -0
- package/src/components/spectrogram/spectrogram.svelte +87 -152
- package/src/components/spectrogram/spectrogram.variables.json +1 -0
- package/src/components/spectrogram/spectrogram.variables.ts +3 -0
- package/src/components/spectrum-chart/spectrum-chart.schema.json +69 -0
- package/src/components/spectrum-chart/spectrum-chart.schema.ts +73 -0
- package/src/components/spectrum-chart/spectrum-chart.svelte +61 -110
- package/src/components/spectrum-chart/spectrum-chart.variables.json +1 -0
- package/src/components/spectrum-chart/spectrum-chart.variables.ts +3 -0
- package/src/components/speed-dial/speed-dial.schema.json +46 -0
- package/src/components/speed-dial/speed-dial.schema.ts +51 -0
- package/src/components/speed-dial/speed-dial.svelte +78 -122
- package/src/components/speed-dial/speed-dial.variables.json +1 -0
- package/src/components/speed-dial/speed-dial.variables.ts +3 -0
- package/src/components/speed-dial-action/speed-dial-action.schema.json +41 -0
- package/src/components/speed-dial-action/speed-dial-action.schema.ts +45 -0
- package/src/components/speed-dial-action/speed-dial-action.svelte +17 -45
- package/src/components/speed-dial-action/speed-dial-action.variables.json +1 -0
- package/src/components/speed-dial-action/speed-dial-action.variables.ts +3 -0
- package/src/components/spinner/spinner.schema.json +21 -0
- package/src/components/spinner/spinner.schema.ts +25 -0
- package/src/components/spinner/spinner.svelte +3 -18
- package/src/components/spinner/spinner.variables.json +1 -0
- package/src/components/spinner/spinner.variables.ts +3 -0
- package/src/components/stacked-list-item/stacked-list-item.schema.json +76 -0
- package/src/components/stacked-list-item/stacked-list-item.schema.ts +84 -0
- package/src/components/stacked-list-item/stacked-list-item.svelte +41 -76
- package/src/components/stacked-list-item/stacked-list-item.variables.json +1 -0
- package/src/components/stacked-list-item/stacked-list-item.variables.ts +3 -0
- package/src/components/stat/stat.schema.json +50 -0
- package/src/components/stat/stat.schema.ts +55 -0
- package/src/components/stat/stat.svelte +27 -58
- package/src/components/stat/stat.variables.json +1 -0
- package/src/components/stat/stat.variables.ts +3 -0
- package/src/components/stat-group/stat-group.schema.json +35 -0
- package/src/components/stat-group/stat-group.schema.ts +41 -0
- package/src/components/stat-group/stat-group.svelte +5 -30
- package/src/components/stat-group/stat-group.variables.json +1 -0
- package/src/components/stat-group/stat-group.variables.ts +3 -0
- package/src/components/stats-section/stats-section.schema.json +83 -0
- package/src/components/stats-section/stats-section.schema.ts +87 -0
- package/src/components/stats-section/stats-section.svelte +17 -56
- package/src/components/stats-section/stats-section.variables.json +1 -0
- package/src/components/stats-section/stats-section.variables.ts +3 -0
- package/src/components/status-dot/status-dot.schema.json +37 -0
- package/src/components/status-dot/status-dot.schema.ts +45 -0
- package/src/components/status-dot/status-dot.svelte +20 -65
- package/src/components/status-dot/status-dot.variables.json +1 -0
- package/src/components/status-dot/status-dot.variables.ts +3 -0
- package/src/components/steps/index.ts +1 -1
- package/src/components/steps/steps.css +15 -1
- package/src/components/steps/steps.examples.json +6 -0
- package/src/components/steps/steps.schema.json +42 -0
- package/src/components/steps/steps.schema.ts +49 -0
- package/src/components/steps/steps.svelte +29 -48
- package/src/components/steps/steps.types.ts +12 -0
- package/src/components/steps/steps.variables.json +1 -0
- package/src/components/steps/steps.variables.ts +3 -0
- package/src/components/surface/surface.schema.json +25 -0
- package/src/components/surface/surface.schema.ts +29 -0
- package/src/components/surface/surface.svelte +8 -24
- package/src/components/surface/surface.variables.json +1 -0
- package/src/components/surface/surface.variables.ts +3 -0
- package/src/components/tab/tab.schema.json +39 -0
- package/src/components/tab/tab.schema.ts +44 -0
- package/src/components/tab/tab.svelte +54 -80
- package/src/components/tab/tab.variables.json +1 -0
- package/src/components/tab/tab.variables.ts +3 -0
- package/src/components/tab-list/tab-list.schema.json +29 -0
- package/src/components/tab-list/tab-list.schema.ts +33 -0
- package/src/components/tab-list/tab-list.svelte +5 -22
- package/src/components/tab-list/tab-list.variables.json +1 -0
- package/src/components/tab-list/tab-list.variables.ts +3 -0
- package/src/components/tab-panel/tab-panel-aria-labelledby-harness.svelte +6 -11
- package/src/components/tab-panel/tab-panel.schema.json +30 -0
- package/src/components/tab-panel/tab-panel.schema.ts +35 -0
- package/src/components/tab-panel/tab-panel.svelte +15 -33
- package/src/components/tab-panel/tab-panel.variables.json +1 -0
- package/src/components/tab-panel/tab-panel.variables.ts +3 -0
- package/src/components/table/table.schema.json +42 -0
- package/src/components/table/table.schema.ts +49 -0
- package/src/components/table/table.svelte +32 -71
- package/src/components/table/table.variables.json +1 -0
- package/src/components/table/table.variables.ts +3 -0
- package/src/components/table-body/table-body.schema.json +21 -0
- package/src/components/table-body/table-body.schema.ts +25 -0
- package/src/components/table-body/table-body.svelte +5 -20
- package/src/components/table-body/table-body.variables.json +1 -0
- package/src/components/table-body/table-body.variables.ts +3 -0
- package/src/components/table-cell/table-cell.schema.json +28 -0
- package/src/components/table-cell/table-cell.schema.ts +34 -0
- package/src/components/table-cell/table-cell.svelte +3 -17
- package/src/components/table-cell/table-cell.variables.json +1 -0
- package/src/components/table-cell/table-cell.variables.ts +3 -0
- package/src/components/table-header/table-header.schema.json +38 -0
- package/src/components/table-header/table-header.schema.ts +46 -0
- package/src/components/table-header/table-header.svelte +23 -60
- package/src/components/table-header/table-header.variables.json +1 -0
- package/src/components/table-header/table-header.variables.ts +3 -0
- package/src/components/table-header-cell/table-header-cell.schema.json +37 -0
- package/src/components/table-header-cell/table-header-cell.schema.ts +43 -0
- package/src/components/table-header-cell/table-header-cell.svelte +24 -54
- package/src/components/table-header-cell/table-header-cell.variables.json +1 -0
- package/src/components/table-header-cell/table-header-cell.variables.ts +3 -0
- package/src/components/table-of-contents/table-of-contents.schema.json +39 -0
- package/src/components/table-of-contents/table-of-contents.schema.ts +43 -0
- package/src/components/table-of-contents/table-of-contents.svelte +313 -463
- package/src/components/table-of-contents/table-of-contents.variables.json +7 -0
- package/src/components/table-of-contents/table-of-contents.variables.ts +9 -0
- package/src/components/table-row/table-row.schema.json +37 -0
- package/src/components/table-row/table-row.schema.ts +44 -0
- package/src/components/table-row/table-row.svelte +39 -79
- package/src/components/table-row/table-row.variables.json +1 -0
- package/src/components/table-row/table-row.variables.ts +3 -0
- package/src/components/tabs/index.ts +4 -1
- package/src/components/tabs/tabs.css +6 -0
- package/src/components/tabs/tabs.examples.json +6 -0
- package/src/components/tabs/tabs.schema.json +42 -0
- package/src/components/tabs/tabs.schema.ts +49 -0
- package/src/components/tabs/tabs.svelte +148 -164
- package/src/components/tabs/tabs.types.ts +5 -0
- package/src/components/tabs/tabs.variables.json +1 -0
- package/src/components/tabs/tabs.variables.ts +3 -0
- package/src/components/tag-input/tag-input.schema.json +162 -0
- package/src/components/tag-input/tag-input.schema.ts +172 -0
- package/src/components/tag-input/tag-input.svelte +194 -283
- package/src/components/tag-input/tag-input.variables.json +1 -0
- package/src/components/tag-input/tag-input.variables.ts +3 -0
- package/src/components/team-section/team-section.css +2 -1
- package/src/components/team-section/team-section.schema.json +76 -0
- package/src/components/team-section/team-section.schema.ts +80 -0
- package/src/components/team-section/team-section.svelte +16 -46
- package/src/components/team-section/team-section.variables.json +1 -0
- package/src/components/team-section/team-section.variables.ts +3 -0
- package/src/components/testimonial-section/testimonial-section.css +2 -1
- package/src/components/testimonial-section/testimonial-section.schema.json +71 -0
- package/src/components/testimonial-section/testimonial-section.schema.ts +75 -0
- package/src/components/testimonial-section/testimonial-section.svelte +8 -40
- package/src/components/testimonial-section/testimonial-section.variables.json +1 -0
- package/src/components/testimonial-section/testimonial-section.variables.ts +3 -0
- package/src/components/textarea/textarea.schema.json +58 -0
- package/src/components/textarea/textarea.schema.ts +65 -0
- package/src/components/textarea/textarea.svelte +22 -54
- package/src/components/textarea/textarea.variables.json +1 -0
- package/src/components/textarea/textarea.variables.ts +3 -0
- package/src/components/time-field/time-field.schema.json +77 -0
- package/src/components/time-field/time-field.schema.ts +81 -0
- package/src/components/time-field/time-field.svelte +110 -168
- package/src/components/time-field/time-field.variables.json +1 -0
- package/src/components/time-field/time-field.variables.ts +3 -0
- package/src/components/timeline/timeline.schema.json +90 -0
- package/src/components/timeline/timeline.schema.ts +97 -0
- package/src/components/timeline/timeline.svelte +10 -60
- package/src/components/timeline/timeline.variables.json +1 -0
- package/src/components/timeline/timeline.variables.ts +3 -0
- package/src/components/toast-region/toast-region.schema.json +39 -0
- package/src/components/toast-region/toast-region.schema.ts +37 -0
- package/src/components/toast-region/toast-region.svelte +341 -439
- package/src/components/toast-region/toast-region.variables.json +1 -0
- package/src/components/toast-region/toast-region.variables.ts +3 -0
- package/src/components/toggle/toggle.schema.json +53 -0
- package/src/components/toggle/toggle.schema.ts +64 -0
- package/src/components/toggle/toggle.svelte +18 -46
- package/src/components/toggle/toggle.variables.json +1 -0
- package/src/components/toggle/toggle.variables.ts +3 -0
- package/src/components/toolbar/toolbar-group.svelte +13 -18
- package/src/components/toolbar/toolbar-spacer.svelte +9 -26
- package/src/components/toolbar/toolbar.css +10 -11
- package/src/components/toolbar/toolbar.examples.json +1 -1
- package/src/components/toolbar/toolbar.schema.json +26 -0
- package/src/components/toolbar/toolbar.schema.ts +31 -0
- package/src/components/toolbar/toolbar.svelte +226 -285
- package/src/components/toolbar/toolbar.types.ts +2 -2
- package/src/components/toolbar/toolbar.variables.json +1 -0
- package/src/components/toolbar/toolbar.variables.ts +3 -0
- package/src/components/tooltip/tooltip.schema.json +34 -0
- package/src/components/tooltip/tooltip.schema.ts +38 -0
- package/src/components/tooltip/tooltip.svelte +91 -129
- package/src/components/tooltip/tooltip.variables.json +1 -0
- package/src/components/tooltip/tooltip.variables.ts +3 -0
- package/src/components/transfer-list/transfer-list.schema.json +61 -0
- package/src/components/transfer-list/transfer-list.schema.ts +68 -0
- package/src/components/transfer-list/transfer-list.svelte +169 -239
- package/src/components/transfer-list/transfer-list.variables.json +1 -0
- package/src/components/transfer-list/transfer-list.variables.ts +3 -0
- package/src/components/tree/tree.schema.json +128 -0
- package/src/components/tree/tree.schema.ts +141 -0
- package/src/components/tree/tree.svelte +706 -901
- package/src/components/tree/tree.variables.json +5 -0
- package/src/components/tree/tree.variables.ts +7 -0
- package/src/components/tree-item/tree-item.schema.json +68 -0
- package/src/components/tree-item/tree-item.schema.ts +75 -0
- package/src/components/tree-item/tree-item.svelte +506 -600
- package/src/components/tree-item/tree-item.variables.json +1 -0
- package/src/components/tree-item/tree-item.variables.ts +3 -0
- package/src/components/typography/typography.schema.json +154 -0
- package/src/components/typography/typography.schema.ts +158 -0
- package/src/components/typography/typography.svelte +13 -45
- package/src/components/typography/typography.variables.json +1 -0
- package/src/components/typography/typography.variables.ts +3 -0
- package/src/components/virtual-list/virtual-list.schema.json +53 -0
- package/src/components/virtual-list/virtual-list.schema.ts +61 -0
- package/src/components/virtual-list/virtual-list.svelte +67 -129
- package/src/components/virtual-list/virtual-list.variables.json +1 -0
- package/src/components/virtual-list/virtual-list.variables.ts +3 -0
- package/src/components/visually-hidden/visually-hidden.schema.json +131 -0
- package/src/components/visually-hidden/visually-hidden.schema.ts +136 -0
- package/src/components/visually-hidden/visually-hidden.svelte +4 -29
- package/src/components/visually-hidden/visually-hidden.variables.json +1 -0
- package/src/components/visually-hidden/visually-hidden.variables.ts +3 -0
- package/src/components/waveform/waveform.schema.json +61 -0
- package/src/components/waveform/waveform.schema.ts +67 -0
- package/src/components/waveform/waveform.svelte +113 -152
- package/src/components/waveform/waveform.variables.json +1 -0
- package/src/components/waveform/waveform.variables.ts +3 -0
- package/src/index.ts +40 -38
- package/src/styles/components.css +2 -0
- package/src/styles/foundation.css +39 -0
- package/src/styles/tokens-base.css +149 -0
- package/src/styles/utilities.css +141 -21
- package/src/utilities/change-tracker.svelte.ts +130 -151
- package/src/utilities/sortable-controller.svelte.ts +112 -141
- package/src/utilities/use-announcer.svelte.ts +100 -113
- package/src/utilities/use-history.svelte.ts +141 -168
- package/src/utilities/use-intersection.svelte.ts +36 -51
- package/src/utilities/use-mutation-observer.svelte.ts +51 -69
- package/src/utilities/use-reduced-motion.svelte.ts +21 -24
- package/src/utilities/use-resize-observer.svelte.ts +29 -41
- package/dist/server/components/access-gate/access-gate.schema.js +0 -47
- package/dist/server/components/access-gate/access-gate.variables.js +0 -10
- package/dist/server/components/accordion/accordion.schema.js +0 -35
- package/dist/server/components/accordion/accordion.variables.js +0 -10
- package/dist/server/components/accordion-item/accordion-item.schema.js +0 -44
- package/dist/server/components/accordion-item/accordion-item.variables.js +0 -10
- package/dist/server/components/alert/alert.schema.js +0 -47
- package/dist/server/components/alert/alert.variables.js +0 -10
- package/dist/server/components/alert-dialog/alert-dialog.schema.js +0 -62
- package/dist/server/components/alert-dialog/alert-dialog.variables.js +0 -10
- package/dist/server/components/approval-card/approval-card.schema.js +0 -215
- package/dist/server/components/approval-card/approval-card.variables.js +0 -10
- package/dist/server/components/area-chart/area-chart.schema.js +0 -152
- package/dist/server/components/area-chart/area-chart.variables.js +0 -10
- package/dist/server/components/aspect-ratio/aspect-ratio.schema.js +0 -152
- package/dist/server/components/aspect-ratio/aspect-ratio.variables.js +0 -10
- package/dist/server/components/autocomplete/autocomplete.schema.js +0 -88
- package/dist/server/components/autocomplete/autocomplete.variables.js +0 -10
- package/dist/server/components/avatar/avatar.schema.js +0 -45
- package/dist/server/components/avatar/avatar.variables.js +0 -10
- package/dist/server/components/avatar-group/avatar-group.schema.js +0 -78
- package/dist/server/components/avatar-group/avatar-group.variables.js +0 -10
- package/dist/server/components/backdrop/backdrop.schema.js +0 -55
- package/dist/server/components/backdrop/backdrop.variables.js +0 -10
- package/dist/server/components/badge/badge.schema.js +0 -48
- package/dist/server/components/badge/badge.variables.js +0 -10
- package/dist/server/components/banner/banner.schema.js +0 -48
- package/dist/server/components/banner/banner.variables.js +0 -10
- package/dist/server/components/bar-chart/bar-chart.schema.js +0 -153
- package/dist/server/components/bar-chart/bar-chart.variables.js +0 -10
- package/dist/server/components/bento-cell/bento-cell.schema.js +0 -114
- package/dist/server/components/bento-cell/bento-cell.variables.js +0 -10
- package/dist/server/components/bento-grid/bento-grid.schema.js +0 -64
- package/dist/server/components/bento-grid/bento-grid.variables.js +0 -10
- package/dist/server/components/blog-section/blog-section.schema.js +0 -91
- package/dist/server/components/blog-section/blog-section.variables.js +0 -10
- package/dist/server/components/breadcrumbs/breadcrumbs.schema.js +0 -30
- package/dist/server/components/breadcrumbs/breadcrumbs.variables.js +0 -10
- package/dist/server/components/button/button.schema.js +0 -71
- package/dist/server/components/button/button.variables.js +0 -10
- package/dist/server/components/button-group/button-group.schema.js +0 -42
- package/dist/server/components/button-group/button-group.variables.js +0 -10
- package/dist/server/components/calendar/calendar.schema.js +0 -70
- package/dist/server/components/calendar/calendar.variables.js +0 -10
- package/dist/server/components/callout/callout.schema.js +0 -43
- package/dist/server/components/callout/callout.variables.js +0 -10
- package/dist/server/components/capability-gate/capability-gate.schema.js +0 -81
- package/dist/server/components/capability-gate/capability-gate.variables.js +0 -10
- package/dist/server/components/card/card.schema.js +0 -69
- package/dist/server/components/card/card.variables.js +0 -10
- package/dist/server/components/carousel/carousel.schema.js +0 -55
- package/dist/server/components/carousel/carousel.variables.js +0 -10
- package/dist/server/components/chat/chat.schema.js +0 -268
- package/dist/server/components/chat/chat.variables.js +0 -10
- package/dist/server/components/chat-conversation-header/chat-conversation-header.schema.js +0 -43
- package/dist/server/components/chat-conversation-header/chat-conversation-header.variables.js +0 -10
- package/dist/server/components/chat-conversation-list/chat-conversation-list.schema.js +0 -54
- package/dist/server/components/chat-conversation-list/chat-conversation-list.variables.js +0 -10
- package/dist/server/components/checkbox/checkbox.schema.js +0 -58
- package/dist/server/components/checkbox/checkbox.variables.js +0 -10
- package/dist/server/components/checkbox-group/checkbox-group.schema.js +0 -54
- package/dist/server/components/checkbox-group/checkbox-group.variables.js +0 -10
- package/dist/server/components/chip/chip.schema.js +0 -69
- package/dist/server/components/chip/chip.variables.js +0 -10
- package/dist/server/components/choice-grid/choice-grid.schema.js +0 -73
- package/dist/server/components/choice-grid/choice-grid.variables.js +0 -10
- package/dist/server/components/choice-grid-item/choice-grid-item.schema.js +0 -44
- package/dist/server/components/choice-grid-item/choice-grid-item.variables.js +0 -10
- package/dist/server/components/click-away-listener/click-away-listener.schema.js +0 -42
- package/dist/server/components/click-away-listener/click-away-listener.variables.js +0 -10
- package/dist/server/components/code-block/code-block.schema.js +0 -46
- package/dist/server/components/code-block/code-block.variables.js +0 -10
- package/dist/server/components/collapsible/collapsible.schema.js +0 -58
- package/dist/server/components/collapsible/collapsible.variables.js +0 -10
- package/dist/server/components/color-field/color-field.schema.js +0 -90
- package/dist/server/components/color-field/color-field.variables.js +0 -10
- package/dist/server/components/color-picker/color-picker.schema.js +0 -65
- package/dist/server/components/color-picker/color-picker.variables.js +0 -10
- package/dist/server/components/color-swatch-picker/color-swatch-picker.schema.js +0 -74
- package/dist/server/components/color-swatch-picker/color-swatch-picker.variables.js +0 -10
- package/dist/server/components/combobox/combobox.schema.js +0 -90
- package/dist/server/components/combobox/combobox.variables.js +0 -10
- package/dist/server/components/command-item/command-item.schema.js +0 -70
- package/dist/server/components/command-item/command-item.variables.js +0 -10
- package/dist/server/components/command-menu/command-menu.schema.js +0 -90
- package/dist/server/components/command-menu/command-menu.variables.js +0 -10
- package/dist/server/components/command-palette/command-palette.schema.js +0 -69
- package/dist/server/components/command-palette/command-palette.variables.js +0 -10
- package/dist/server/components/confirm-dialog/confirm-dialog.schema.js +0 -75
- package/dist/server/components/confirm-dialog/confirm-dialog.variables.js +0 -10
- package/dist/server/components/container/container.schema.js +0 -149
- package/dist/server/components/container/container.variables.js +0 -10
- package/dist/server/components/context-menu/context-menu.schema.js +0 -59
- package/dist/server/components/context-menu/context-menu.variables.js +0 -10
- package/dist/server/components/context-menu-trigger/context-menu-trigger.schema.js +0 -29
- package/dist/server/components/context-menu-trigger/context-menu-trigger.variables.js +0 -10
- package/dist/server/components/copy-button/copy-button.schema.js +0 -56
- package/dist/server/components/copy-button/copy-button.variables.js +0 -10
- package/dist/server/components/cta-section/cta-section.schema.js +0 -76
- package/dist/server/components/cta-section/cta-section.variables.js +0 -10
- package/dist/server/components/data-grid/data-grid.schema.js +0 -115
- package/dist/server/components/data-grid/data-grid.variables.js +0 -10
- package/dist/server/components/data-list/data-list.schema.js +0 -58
- package/dist/server/components/data-list/data-list.variables.js +0 -10
- package/dist/server/components/data-table/data-table.schema.js +0 -112
- package/dist/server/components/data-table/data-table.variables.js +0 -10
- package/dist/server/components/date-picker/date-picker.schema.js +0 -70
- package/dist/server/components/date-picker/date-picker.variables.js +0 -10
- package/dist/server/components/date-range-field/date-range-field.schema.js +0 -78
- package/dist/server/components/date-range-field/date-range-field.variables.js +0 -10
- package/dist/server/components/description-list/description-list.schema.js +0 -38
- package/dist/server/components/description-list/description-list.variables.js +0 -10
- package/dist/server/components/diff-statistics/diff-statistics.schema.js +0 -45
- package/dist/server/components/diff-statistics/diff-statistics.variables.js +0 -10
- package/dist/server/components/diff-viewer/diff-viewer.schema.js +0 -78
- package/dist/server/components/diff-viewer/diff-viewer.variables.js +0 -10
- package/dist/server/components/divider/divider.schema.js +0 -40
- package/dist/server/components/divider/divider.variables.js +0 -10
- package/dist/server/components/drawer/drawer.schema.js +0 -68
- package/dist/server/components/drawer/drawer.variables.js +0 -10
- package/dist/server/components/dropdown/dropdown.schema.js +0 -44
- package/dist/server/components/dropdown/dropdown.variables.js +0 -10
- package/dist/server/components/dropdown-group/dropdown-group.schema.js +0 -37
- package/dist/server/components/dropdown-group/dropdown-group.variables.js +0 -10
- package/dist/server/components/dropdown-item/dropdown-item.schema.js +0 -60
- package/dist/server/components/dropdown-item/dropdown-item.variables.js +0 -10
- package/dist/server/components/dropdown-label/dropdown-label.schema.js +0 -28
- package/dist/server/components/dropdown-label/dropdown-label.variables.js +0 -10
- package/dist/server/components/dropdown-menu/dropdown-menu.schema.js +0 -28
- package/dist/server/components/dropdown-menu/dropdown-menu.variables.js +0 -10
- package/dist/server/components/dropdown-separator/dropdown-separator.schema.js +0 -20
- package/dist/server/components/dropdown-separator/dropdown-separator.variables.js +0 -10
- package/dist/server/components/dropdown-trigger/dropdown-trigger.schema.js +0 -32
- package/dist/server/components/dropdown-trigger/dropdown-trigger.variables.js +0 -10
- package/dist/server/components/empty-state/empty-state.schema.js +0 -46
- package/dist/server/components/empty-state/empty-state.variables.js +0 -10
- package/dist/server/components/event-stream-viewer/event-stream-viewer.schema.js +0 -144
- package/dist/server/components/event-stream-viewer/event-stream-viewer.variables.js +0 -10
- package/dist/server/components/event-timeline/event-timeline.schema.js +0 -104
- package/dist/server/components/event-timeline/event-timeline.variables.js +0 -10
- package/dist/server/components/faceted-filter-bar/faceted-filter-bar.schema.js +0 -76
- package/dist/server/components/faceted-filter-bar/faceted-filter-bar.variables.js +0 -10
- package/dist/server/components/feature-section/feature-section.schema.js +0 -91
- package/dist/server/components/feature-section/feature-section.variables.js +0 -10
- package/dist/server/components/feed/feed.schema.js +0 -34
- package/dist/server/components/feed/feed.variables.js +0 -10
- package/dist/server/components/feed-event/feed-event.schema.js +0 -59
- package/dist/server/components/feed-event/feed-event.variables.js +0 -10
- package/dist/server/components/file-upload/file-upload.schema.js +0 -79
- package/dist/server/components/file-upload/file-upload.variables.js +0 -15
- package/dist/server/components/floating-action-button/floating-action-button.schema.js +0 -53
- package/dist/server/components/floating-action-button/floating-action-button.variables.js +0 -10
- package/dist/server/components/focus-trap/focus-trap.schema.js +0 -59
- package/dist/server/components/focus-trap/focus-trap.variables.js +0 -10
- package/dist/server/components/footer/footer.schema.js +0 -50
- package/dist/server/components/footer/footer.variables.js +0 -10
- package/dist/server/components/form-field/form-field.schema.js +0 -55
- package/dist/server/components/form-field/form-field.variables.js +0 -10
- package/dist/server/components/form-section/form-section.schema.js +0 -50
- package/dist/server/components/form-section/form-section.variables.js +0 -10
- package/dist/server/components/grid/grid.schema.js +0 -62
- package/dist/server/components/grid/grid.variables.js +0 -10
- package/dist/server/components/grid-item/grid-item.schema.js +0 -89
- package/dist/server/components/grid-item/grid-item.variables.js +0 -10
- package/dist/server/components/grid-list/grid-list.schema.js +0 -35
- package/dist/server/components/grid-list/grid-list.variables.js +0 -10
- package/dist/server/components/grid-list-item/grid-list-item.schema.js +0 -69
- package/dist/server/components/grid-list-item/grid-list-item.variables.js +0 -10
- package/dist/server/components/hero-section/hero-section.schema.js +0 -72
- package/dist/server/components/hero-section/hero-section.variables.js +0 -10
- package/dist/server/components/hover-card/hover-card.schema.js +0 -83
- package/dist/server/components/hover-card/hover-card.variables.js +0 -10
- package/dist/server/components/image/image.schema.js +0 -73
- package/dist/server/components/image/image.variables.js +0 -10
- package/dist/server/components/inline-loading/inline-loading.schema.js +0 -38
- package/dist/server/components/inline-loading/inline-loading.variables.js +0 -10
- package/dist/server/components/input/input.schema.js +0 -84
- package/dist/server/components/input/input.variables.js +0 -10
- package/dist/server/components/invocation-rule-builder/invocation-rule-builder.schema.js +0 -178
- package/dist/server/components/invocation-rule-builder/invocation-rule-builder.variables.js +0 -10
- package/dist/server/components/json-schema-editor/json-schema-editor.schema.js +0 -72
- package/dist/server/components/json-schema-editor/json-schema-editor.variables.js +0 -10
- package/dist/server/components/json-viewer/json-viewer.schema.js +0 -42
- package/dist/server/components/json-viewer/json-viewer.variables.js +0 -10
- package/dist/server/components/kanban-board/kanban-board.schema.js +0 -73
- package/dist/server/components/kanban-board/kanban-board.variables.js +0 -15
- package/dist/server/components/kbd/kbd.schema.js +0 -38
- package/dist/server/components/kbd/kbd.variables.js +0 -10
- package/dist/server/components/keyboard-shortcuts/keyboard-shortcuts.schema.js +0 -39
- package/dist/server/components/keyboard-shortcuts/keyboard-shortcuts.variables.js +0 -10
- package/dist/server/components/label/label.schema.js +0 -44
- package/dist/server/components/label/label.variables.js +0 -10
- package/dist/server/components/line-chart/line-chart.schema.js +0 -148
- package/dist/server/components/line-chart/line-chart.variables.js +0 -10
- package/dist/server/components/link/link.schema.js +0 -70
- package/dist/server/components/link/link.variables.js +0 -10
- package/dist/server/components/load-more/load-more.schema.js +0 -70
- package/dist/server/components/load-more/load-more.variables.js +0 -10
- package/dist/server/components/locale-provider/locale-provider.schema.js +0 -33
- package/dist/server/components/locale-provider/locale-provider.variables.js +0 -10
- package/dist/server/components/logo-cloud/logo-cloud.schema.js +0 -72
- package/dist/server/components/logo-cloud/logo-cloud.variables.js +0 -10
- package/dist/server/components/markdown-editor/markdown-editor.schema.js +0 -126
- package/dist/server/components/markdown-editor/markdown-editor.variables.js +0 -10
- package/dist/server/components/marquee/marquee.schema.js +0 -59
- package/dist/server/components/marquee/marquee.variables.js +0 -14
- package/dist/server/components/masonry/masonry.schema.js +0 -43
- package/dist/server/components/masonry/masonry.variables.js +0 -10
- package/dist/server/components/matrix-chart/matrix-chart.schema.js +0 -99
- package/dist/server/components/matrix-chart/matrix-chart.variables.js +0 -10
- package/dist/server/components/media-controls/media-controls.schema.js +0 -77
- package/dist/server/components/media-controls/media-controls.variables.js +0 -10
- package/dist/server/components/mega-menu/mega-menu.schema.js +0 -46
- package/dist/server/components/mega-menu/mega-menu.variables.js +0 -10
- package/dist/server/components/menu-bar/menu-bar.schema.js +0 -41
- package/dist/server/components/menu-bar/menu-bar.variables.js +0 -10
- package/dist/server/components/message/message.schema.js +0 -47
- package/dist/server/components/message/message.variables.js +0 -10
- package/dist/server/components/meter/meter.schema.js +0 -63
- package/dist/server/components/meter/meter.variables.js +0 -10
- package/dist/server/components/modal/modal.schema.js +0 -96
- package/dist/server/components/modal/modal.variables.js +0 -10
- package/dist/server/components/multi-select/multi-select.schema.js +0 -97
- package/dist/server/components/multi-select/multi-select.variables.js +0 -10
- package/dist/server/components/navigation-bar/navigation-bar.schema.js +0 -61
- package/dist/server/components/navigation-bar/navigation-bar.variables.js +0 -10
- package/dist/server/components/navigation-item/navigation-item.schema.js +0 -57
- package/dist/server/components/navigation-item/navigation-item.variables.js +0 -10
- package/dist/server/components/newsletter-section/newsletter-section.schema.js +0 -71
- package/dist/server/components/newsletter-section/newsletter-section.variables.js +0 -10
- package/dist/server/components/number-input/number-input.schema.js +0 -100
- package/dist/server/components/number-input/number-input.variables.js +0 -10
- package/dist/server/components/page-header/page-header.schema.js +0 -38
- package/dist/server/components/page-header/page-header.variables.js +0 -10
- package/dist/server/components/pagination/pagination.schema.js +0 -33
- package/dist/server/components/pagination/pagination.variables.js +0 -10
- package/dist/server/components/payload-inspector/payload-inspector.schema.js +0 -86
- package/dist/server/components/payload-inspector/payload-inspector.variables.js +0 -10
- package/dist/server/components/permission-matrix/permission-matrix.schema.js +0 -79
- package/dist/server/components/permission-matrix/permission-matrix.variables.js +0 -10
- package/dist/server/components/phone-input/phone-input.schema.js +0 -581
- package/dist/server/components/phone-input/phone-input.variables.js +0 -10
- package/dist/server/components/pin-input/pin-input.schema.js +0 -99
- package/dist/server/components/pin-input/pin-input.variables.js +0 -10
- package/dist/server/components/popover/popover.schema.js +0 -97
- package/dist/server/components/popover/popover.variables.js +0 -10
- package/dist/server/components/portal/portal.schema.js +0 -48
- package/dist/server/components/portal/portal.variables.js +0 -10
- package/dist/server/components/pricing-card/pricing-card.schema.js +0 -59
- package/dist/server/components/pricing-card/pricing-card.variables.js +0 -10
- package/dist/server/components/pricing-section/pricing-section.schema.js +0 -91
- package/dist/server/components/pricing-section/pricing-section.variables.js +0 -10
- package/dist/server/components/progress/progress.schema.js +0 -48
- package/dist/server/components/progress/progress.variables.js +0 -10
- package/dist/server/components/qr-code/qr-code.schema.js +0 -45
- package/dist/server/components/qr-code/qr-code.variables.js +0 -10
- package/dist/server/components/radio-group/radio-group.schema.js +0 -63
- package/dist/server/components/radio-group/radio-group.variables.js +0 -10
- package/dist/server/components/rating/rating.schema.js +0 -94
- package/dist/server/components/rating/rating.variables.js +0 -10
- package/dist/server/components/resizable-panels/resizable-panels.schema.js +0 -62
- package/dist/server/components/resizable-panels/resizable-panels.variables.js +0 -10
- package/dist/server/components/review-editor/review-editor.schema.js +0 -92
- package/dist/server/components/review-editor/review-editor.variables.js +0 -10
- package/dist/server/components/run-step-timeline/run-step-timeline.schema.js +0 -438
- package/dist/server/components/run-step-timeline/run-step-timeline.variables.js +0 -10
- package/dist/server/components/schema-form/schema-form.schema.js +0 -55
- package/dist/server/components/schema-form/schema-form.variables.js +0 -10
- package/dist/server/components/scroll-area/scroll-area.schema.js +0 -61
- package/dist/server/components/scroll-area/scroll-area.variables.js +0 -10
- package/dist/server/components/search-field/search-field.schema.js +0 -72
- package/dist/server/components/search-field/search-field.variables.js +0 -10
- package/dist/server/components/secret-value-field/secret-value-field.schema.js +0 -66
- package/dist/server/components/secret-value-field/secret-value-field.variables.js +0 -10
- package/dist/server/components/section-heading/section-heading.schema.js +0 -53
- package/dist/server/components/section-heading/section-heading.variables.js +0 -10
- package/dist/server/components/segment/segment.schema.js +0 -54
- package/dist/server/components/segment/segment.variables.js +0 -10
- package/dist/server/components/segmented-control/segmented-control.schema.js +0 -94
- package/dist/server/components/segmented-control/segmented-control.variables.js +0 -10
- package/dist/server/components/select/select.schema.js +0 -61
- package/dist/server/components/select/select.variables.js +0 -10
- package/dist/server/components/selection-popover/selection-popover.schema.js +0 -59
- package/dist/server/components/selection-popover/selection-popover.variables.js +0 -10
- package/dist/server/components/share-card/share-card.schema.js +0 -64
- package/dist/server/components/share-card/share-card.variables.js +0 -10
- package/dist/server/components/sheet/sheet.schema.js +0 -64
- package/dist/server/components/sheet/sheet.variables.js +0 -10
- package/dist/server/components/shortcut-hint/shortcut-hint.schema.js +0 -46
- package/dist/server/components/shortcut-hint/shortcut-hint.variables.js +0 -10
- package/dist/server/components/side-navigation/side-navigation.schema.js +0 -36
- package/dist/server/components/side-navigation/side-navigation.variables.js +0 -10
- package/dist/server/components/side-navigation-group/side-navigation-group.schema.js +0 -58
- package/dist/server/components/side-navigation-group/side-navigation-group.variables.js +0 -10
- package/dist/server/components/side-navigation-item/side-navigation-item.schema.js +0 -57
- package/dist/server/components/side-navigation-item/side-navigation-item.variables.js +0 -10
- package/dist/server/components/sidebar/sidebar.schema.js +0 -47
- package/dist/server/components/sidebar/sidebar.variables.js +0 -10
- package/dist/server/components/skeleton/skeleton.schema.js +0 -32
- package/dist/server/components/skeleton/skeleton.variables.js +0 -10
- package/dist/server/components/skip-link/skip-link.schema.js +0 -34
- package/dist/server/components/skip-link/skip-link.variables.js +0 -10
- package/dist/server/components/slider/slider.schema.js +0 -91
- package/dist/server/components/slider/slider.variables.js +0 -10
- package/dist/server/components/sortable-list/sortable-list.schema.js +0 -76
- package/dist/server/components/sortable-list/sortable-list.variables.js +0 -10
- package/dist/server/components/sparkbar/sparkbar.schema.js +0 -53
- package/dist/server/components/sparkbar/sparkbar.variables.js +0 -10
- package/dist/server/components/spectrogram/spectrogram.schema.js +0 -91
- package/dist/server/components/spectrogram/spectrogram.variables.js +0 -10
- package/dist/server/components/spectrum-chart/spectrum-chart.schema.js +0 -78
- package/dist/server/components/spectrum-chart/spectrum-chart.variables.js +0 -10
- package/dist/server/components/speed-dial/speed-dial.schema.js +0 -55
- package/dist/server/components/speed-dial/speed-dial.variables.js +0 -10
- package/dist/server/components/speed-dial-action/speed-dial-action.schema.js +0 -50
- package/dist/server/components/speed-dial-action/speed-dial-action.variables.js +0 -10
- package/dist/server/components/spinner/spinner.schema.js +0 -30
- package/dist/server/components/spinner/spinner.variables.js +0 -10
- package/dist/server/components/stacked-list-item/stacked-list-item.schema.js +0 -85
- package/dist/server/components/stacked-list-item/stacked-list-item.variables.js +0 -10
- package/dist/server/components/stat/stat.schema.js +0 -59
- package/dist/server/components/stat/stat.variables.js +0 -10
- package/dist/server/components/stat-group/stat-group.schema.js +0 -44
- package/dist/server/components/stat-group/stat-group.variables.js +0 -10
- package/dist/server/components/stats-section/stats-section.schema.js +0 -92
- package/dist/server/components/stats-section/stats-section.variables.js +0 -10
- package/dist/server/components/status-dot/status-dot.schema.js +0 -46
- package/dist/server/components/status-dot/status-dot.variables.js +0 -10
- package/dist/server/components/steps/steps.schema.js +0 -48
- package/dist/server/components/steps/steps.variables.js +0 -10
- package/dist/server/components/surface/surface.schema.js +0 -34
- package/dist/server/components/surface/surface.variables.js +0 -10
- package/dist/server/components/tab/tab.schema.js +0 -48
- package/dist/server/components/tab/tab.variables.js +0 -10
- package/dist/server/components/tab-list/tab-list.schema.js +0 -38
- package/dist/server/components/tab-list/tab-list.variables.js +0 -10
- package/dist/server/components/tab-panel/tab-panel.schema.js +0 -39
- package/dist/server/components/tab-panel/tab-panel.variables.js +0 -10
- package/dist/server/components/table/table.schema.js +0 -51
- package/dist/server/components/table/table.variables.js +0 -10
- package/dist/server/components/table-body/table-body.schema.js +0 -30
- package/dist/server/components/table-body/table-body.variables.js +0 -10
- package/dist/server/components/table-cell/table-cell.schema.js +0 -44
- package/dist/server/components/table-cell/table-cell.variables.js +0 -10
- package/dist/server/components/table-header/table-header.schema.js +0 -47
- package/dist/server/components/table-header/table-header.variables.js +0 -10
- package/dist/server/components/table-header-cell/table-header-cell.schema.js +0 -46
- package/dist/server/components/table-header-cell/table-header-cell.variables.js +0 -10
- package/dist/server/components/table-of-contents/table-of-contents.schema.js +0 -48
- package/dist/server/components/table-of-contents/table-of-contents.variables.js +0 -16
- package/dist/server/components/table-row/table-row.schema.js +0 -49
- package/dist/server/components/table-row/table-row.variables.js +0 -10
- package/dist/server/components/tabs/tabs.schema.js +0 -49
- package/dist/server/components/tabs/tabs.variables.js +0 -10
- package/dist/server/components/tag-input/tag-input.schema.js +0 -171
- package/dist/server/components/tag-input/tag-input.variables.js +0 -10
- package/dist/server/components/team-section/team-section.schema.js +0 -85
- package/dist/server/components/team-section/team-section.variables.js +0 -10
- package/dist/server/components/testimonial-section/testimonial-section.schema.js +0 -80
- package/dist/server/components/testimonial-section/testimonial-section.variables.js +0 -10
- package/dist/server/components/textarea/textarea.schema.js +0 -67
- package/dist/server/components/textarea/textarea.variables.js +0 -10
- package/dist/server/components/time-field/time-field.schema.js +0 -86
- package/dist/server/components/time-field/time-field.variables.js +0 -10
- package/dist/server/components/timeline/timeline.schema.js +0 -99
- package/dist/server/components/timeline/timeline.variables.js +0 -10
- package/dist/server/components/toast-region/toast-region.schema.js +0 -41
- package/dist/server/components/toast-region/toast-region.variables.js +0 -10
- package/dist/server/components/toggle/toggle.schema.js +0 -62
- package/dist/server/components/toggle/toggle.variables.js +0 -10
- package/dist/server/components/toolbar/toolbar.schema.js +0 -35
- package/dist/server/components/toolbar/toolbar.variables.js +0 -10
- package/dist/server/components/tooltip/tooltip.schema.js +0 -43
- package/dist/server/components/tooltip/tooltip.variables.js +0 -10
- package/dist/server/components/transfer-list/transfer-list.schema.js +0 -70
- package/dist/server/components/transfer-list/transfer-list.variables.js +0 -10
- package/dist/server/components/tree/tree.schema.js +0 -137
- package/dist/server/components/tree/tree.variables.js +0 -14
- package/dist/server/components/tree-item/tree-item.schema.js +0 -77
- package/dist/server/components/tree-item/tree-item.variables.js +0 -10
- package/dist/server/components/typography/typography.schema.js +0 -163
- package/dist/server/components/typography/typography.variables.js +0 -10
- package/dist/server/components/virtual-list/virtual-list.schema.js +0 -67
- package/dist/server/components/virtual-list/virtual-list.variables.js +0 -10
- package/dist/server/components/visually-hidden/visually-hidden.schema.js +0 -140
- package/dist/server/components/visually-hidden/visually-hidden.variables.js +0 -10
- package/dist/server/components/waveform/waveform.schema.js +0 -70
- package/dist/server/components/waveform/waveform.variables.js +0 -10
- package/dist/server/index-2ynappje.js +0 -388
- package/dist/server/index-d3jpz7nh.js +0 -265
- package/dist/server/index-v5tk8a0j.js +0 -344
- package/dist/server/index.server-0jw824y0.js +0 -9
- package/dist/server/index.server-0n0h8wsw.js +0 -159
- package/dist/server/index.server-1hrcs2mn.js +0 -55
- package/dist/server/index.server-1q6csb7g.js +0 -62
- package/dist/server/index.server-2ef5byty.js +0 -41
- package/dist/server/index.server-2ssdpqz0.js +0 -458
- package/dist/server/index.server-30s4ajz2.js +0 -3391
- package/dist/server/index.server-30zw3bv3.js +0 -52
- package/dist/server/index.server-37t15r2c.js +0 -9
- package/dist/server/index.server-3jr3n02r.js +0 -1835
- package/dist/server/index.server-3yvf1t1p.js +0 -197
- package/dist/server/index.server-4h5tdvz1.js +0 -271
- package/dist/server/index.server-4xer517a.js +0 -23
- package/dist/server/index.server-51r677ht.js +0 -1035
- package/dist/server/index.server-55x63e57.js +0 -9
- package/dist/server/index.server-5zvh7svb.js +0 -9
- package/dist/server/index.server-65wyd3qb.js +0 -244
- package/dist/server/index.server-6dfav8r0.js +0 -142
- package/dist/server/index.server-70y2sq2g.js +0 -9
- package/dist/server/index.server-76z9qsxq.js +0 -93
- package/dist/server/index.server-7pjefftj.js +0 -102
- package/dist/server/index.server-7yp7j1bw.js +0 -371
- package/dist/server/index.server-8s1t2e2w.js +0 -284
- package/dist/server/index.server-90g4gszd.js +0 -1163
- package/dist/server/index.server-989dxz7z.js +0 -9
- package/dist/server/index.server-9ew3zj1z.js +0 -726
- package/dist/server/index.server-9jqd7bxw.js +0 -117
- package/dist/server/index.server-9zfs8c1b.js +0 -35
- package/dist/server/index.server-9zqmr226.js +0 -117
- package/dist/server/index.server-axf8h1gd.js +0 -161
- package/dist/server/index.server-bt1gy21n.js +0 -100
- package/dist/server/index.server-cpjmf3c9.js +0 -9
- package/dist/server/index.server-dt0ccgbz.js +0 -3839
- package/dist/server/index.server-e5zf44p5.js +0 -9
- package/dist/server/index.server-e9eyxk7a.js +0 -9
- package/dist/server/index.server-eabjzvtt.js +0 -9
- package/dist/server/index.server-edr3c033.js +0 -85
- package/dist/server/index.server-eq83dtav.js +0 -195
- package/dist/server/index.server-eqprncaf.js +0 -168
- package/dist/server/index.server-ffcsn4km.js +0 -9
- package/dist/server/index.server-fm19v7bt.js +0 -9
- package/dist/server/index.server-g3qbp906.js +0 -377
- package/dist/server/index.server-ga7e445m.js +0 -56
- package/dist/server/index.server-gdtt4a78.js +0 -143
- package/dist/server/index.server-gyg8tfq3.js +0 -176
- package/dist/server/index.server-h2hjtvk4.js +0 -94
- package/dist/server/index.server-hmqm1t7m.js +0 -222
- package/dist/server/index.server-hrdm71tg.js +0 -194
- package/dist/server/index.server-hybyy2xe.js +0 -177
- package/dist/server/index.server-j3gec8b5.js +0 -393
- package/dist/server/index.server-j89rzjcz.js +0 -9
- package/dist/server/index.server-j8x6mvrh.js +0 -294
- package/dist/server/index.server-jsxtrgrv.js +0 -9
- package/dist/server/index.server-kfcst2vb.js +0 -9
- package/dist/server/index.server-kfshf5nx.js +0 -111
- package/dist/server/index.server-meehv9hp.js +0 -4416
- package/dist/server/index.server-n16wn1ps.js +0 -15643
- package/dist/server/index.server-n4f4tspa.js +0 -9
- package/dist/server/index.server-ndss6byn.js +0 -123
- package/dist/server/index.server-pfn50743.js +0 -447
- package/dist/server/index.server-pg2vydas.js +0 -190
- package/dist/server/index.server-pm6q0dmn.js +0 -563
- package/dist/server/index.server-pne61vry.js +0 -9
- package/dist/server/index.server-rjgy0mc7.js +0 -1028
- package/dist/server/index.server-rxa52bqt.js +0 -169
- package/dist/server/index.server-sqnbagf9.js +0 -457
- package/dist/server/index.server-svgs2fzj.js +0 -2309
- package/dist/server/index.server-szrtfkbm.js +0 -31
- package/dist/server/index.server-tgmm7xgc.js +0 -83
- package/dist/server/index.server-v38m2bgg.js +0 -75
- package/dist/server/index.server-v41vrqg7.js +0 -76
- package/dist/server/index.server-vbn6z472.js +0 -291
- package/dist/server/index.server-vdpcpdqc.js +0 -126
- package/dist/server/index.server-vy5csx7j.js +0 -153
- package/dist/server/index.server-w0y2bxb7.js +0 -72
- package/dist/server/index.server-w7cxxf03.js +0 -9
- package/dist/server/index.server-w8y3eqhp.js +0 -84
- package/dist/server/index.server-wckvcay0.js +0 -50
- package/dist/server/index.server-xpad931e.js +0 -85
- package/dist/server/index.server-yb5b3hnv.js +0 -9
- package/dist/server/index.server-yg55jew8.js +0 -162
- package/dist/server/index.server-ze9xj0kf.js +0 -100
- package/src/components/schema-form/schema-form-async.fixture.ts +0 -101
- /package/dist/components/{schema-form/schema-form-async.fixture.d.ts → action-row/action-row.css.d.ts} +0 -0
- /package/dist/{index.browser.css → components/markdown-editor/index.css} +0 -0
|
@@ -1,1115 +1,882 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
|
-
|
|
3
|
-
import type {
|
|
4
|
-
Thread,
|
|
5
|
-
PersistedThread,
|
|
6
|
-
ThreadCreateEvent,
|
|
7
|
-
ReviewState,
|
|
8
|
-
AnchorUpdate,
|
|
9
|
-
} from '@lostgradient/cinder/commentary/comments';
|
|
10
|
-
import type { ReviewEditorProps, ReviewFormData } from './review-editor.types.ts';
|
|
11
|
-
|
|
12
|
-
export type { ReviewMode, ReviewEditorProps, ReviewFormData } from './review-editor.types.ts';
|
|
13
|
-
|
|
14
|
-
/** Type alias for thread ID to improve readability in state declarations */
|
|
15
|
-
type ThreadId = string;
|
|
2
|
+
export {};
|
|
16
3
|
</script>
|
|
17
4
|
|
|
18
5
|
<script lang="ts">
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
remapDocumentAnchorBodyOffset,
|
|
56
|
-
reviewStateToMarkdown,
|
|
57
|
-
} from './review-editor-front-matter.ts';
|
|
58
|
-
import type {
|
|
59
|
-
ReviewEditorDiffViewMode as DiffViewMode,
|
|
60
|
-
ReviewEditorViewType as ViewType,
|
|
61
|
-
} from './review-editor.types.ts';
|
|
62
|
-
import {
|
|
63
|
-
getSelectionAnchorPosition,
|
|
64
|
-
type SelectionAnchorPosition,
|
|
65
|
-
} from './review-editor-selection-geometry.ts';
|
|
66
|
-
import DiffViewer from '../diff-viewer/diff-viewer.svelte';
|
|
67
|
-
import SelectionPopover from '../selection-popover/selection-popover.svelte';
|
|
68
|
-
import { computeLineDiff, getDiffStats } from '@lostgradient/cinder/markdown/diff/line-diff';
|
|
69
|
-
import {
|
|
70
|
-
generateMarkdownSummary,
|
|
71
|
-
generateUnifiedDiff,
|
|
72
|
-
generateCommentsExport,
|
|
73
|
-
type MarkdownSummaryOptions,
|
|
74
|
-
type MarkdownSummaryResult,
|
|
75
|
-
type UnifiedDiffOptions,
|
|
76
|
-
type UnifiedDiffResult,
|
|
77
|
-
} from '@lostgradient/cinder/commentary/export';
|
|
78
|
-
|
|
79
|
-
// Shared reduced-motion preference (OVERLAY-POLICY: use the shared hook, not inline matchMedia).
|
|
80
|
-
const reducedMotion = useReducedMotion();
|
|
81
|
-
|
|
82
|
-
let {
|
|
83
|
-
id,
|
|
84
|
-
original = $bindable(''),
|
|
85
|
-
value = $bindable(''),
|
|
86
|
-
threads = $bindable<Thread[]>([]),
|
|
87
|
-
mode = 'edit',
|
|
88
|
-
currentUserId,
|
|
89
|
-
placeholder = 'Start writing...',
|
|
90
|
-
name,
|
|
91
|
-
class: className,
|
|
92
|
-
onchange,
|
|
93
|
-
onthreadcreate,
|
|
94
|
-
onthreaddelete,
|
|
95
|
-
oncommentcreate,
|
|
96
|
-
oncommentupdate,
|
|
97
|
-
oncommentdelete,
|
|
98
|
-
snapshotMode = false,
|
|
99
|
-
}: ReviewEditorProps = $props();
|
|
100
|
-
|
|
101
|
-
// Blur any focused element inside this component on mount when snapshotMode
|
|
102
|
-
// is active. This prevents the initial screenshot from capturing a focused
|
|
103
|
-
// ring or blinking caret. We track the container element via bind:this.
|
|
104
|
-
let containerElement = $state<HTMLDivElement | null>(null);
|
|
105
|
-
|
|
106
|
-
$effect(() => {
|
|
107
|
-
if (!snapshotMode) return;
|
|
108
|
-
if (!containerElement) return;
|
|
6
|
+
import { classNames } from '../../utilities/class-names.ts';
|
|
7
|
+
import { devWarn } from '../../utilities/dev-warn.ts';
|
|
8
|
+
import { useReducedMotion } from '../../utilities/use-reduced-motion.svelte.ts';
|
|
9
|
+
import { createFocusRegionNavigator } from './focus-navigation.ts';
|
|
10
|
+
import { createChangeTracker } from '../../utilities/change-tracker.svelte.ts';
|
|
11
|
+
import { stringifyOrNull } from '../../utilities/stringify.ts';
|
|
12
|
+
import MarkdownEditor from '../markdown-editor/markdown-editor.svelte';
|
|
13
|
+
import { contentEquals, normalize } from '@lostgradient/cinder/markdown/pipeline';
|
|
14
|
+
import { textOffsetToProseMirrorPosition } from '@lostgradient/cinder/editor';
|
|
15
|
+
import { createAnchorPlugin, anchorPluginKey, } from '@lostgradient/cinder/commentary/anchor-decorations';
|
|
16
|
+
import { reanchorQuote, ANCHOR_CONTEXT_LENGTH, generateId, extractMentions, createDocumentAnchor, } from '@lostgradient/cinder/commentary/comments';
|
|
17
|
+
import { buildAnchorFromSelection } from '@lostgradient/cinder/commentary/anchoring';
|
|
18
|
+
import ThreadPopover from './thread-popover.svelte';
|
|
19
|
+
import LiveRegion from './live-region.svelte';
|
|
20
|
+
import ExportActions from './export-actions.svelte';
|
|
21
|
+
import CommentSidebar from './comment-sidebar.svelte';
|
|
22
|
+
import FrontMatterFields from './front-matter-fields.svelte';
|
|
23
|
+
import ReviewEditorControls from './review-editor-controls.svelte';
|
|
24
|
+
import { bodyAnchorToDocumentAnchor, bodyAnchorUpdateToDocumentAnchorUpdate, combineFrontMatterAndBody, documentAnchorToBodyAnchor, documentPersistedAnchorToBodyAnchor, documentPositionToBodyPosition, parseReviewEditorFrontMatter, replaceFrontMatterData, remapDocumentAnchorBodyOffset, reviewStateToMarkdown, } from './review-editor-front-matter.ts';
|
|
25
|
+
import { getSelectionAnchorPosition, } from './review-editor-selection-geometry.ts';
|
|
26
|
+
import DiffViewer from '../diff-viewer/diff-viewer.svelte';
|
|
27
|
+
import SelectionPopover from '../selection-popover/selection-popover.svelte';
|
|
28
|
+
import { computeLineDiff, getDiffStats } from '@lostgradient/cinder/markdown/diff/line-diff';
|
|
29
|
+
import { generateMarkdownSummary, generateUnifiedDiff, generateCommentsExport, } from '@lostgradient/cinder/commentary/export';
|
|
30
|
+
// Shared reduced-motion preference (OVERLAY-POLICY: use the shared hook, not inline matchMedia).
|
|
31
|
+
const reducedMotion = useReducedMotion();
|
|
32
|
+
let { id, original = $bindable(''), value = $bindable(''), threads = $bindable([]), mode = 'edit', currentUserId, placeholder = 'Start writing...', name, class: className, onchange, onthreadcreate, onthreaddelete, oncommentcreate, oncommentupdate, oncommentdelete, snapshotMode = false, } = $props();
|
|
33
|
+
// Blur any focused element inside this component on mount when snapshotMode
|
|
34
|
+
// is active. This prevents the initial screenshot from capturing a focused
|
|
35
|
+
// ring or blinking caret. We track the container element via bind:this.
|
|
36
|
+
let containerElement = $state(null);
|
|
37
|
+
$effect(() => {
|
|
38
|
+
if (!snapshotMode)
|
|
39
|
+
return;
|
|
40
|
+
if (!containerElement)
|
|
41
|
+
return;
|
|
109
42
|
const active = document.activeElement;
|
|
110
43
|
if (active instanceof HTMLElement && containerElement.contains(active)) {
|
|
111
|
-
|
|
44
|
+
active.blur();
|
|
112
45
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
// Timer handle for panel selection scroll-then-position delay.
|
|
138
|
-
// Stored at component level so we can cancel it when switching threads.
|
|
139
|
-
let selectTimeoutId: ReturnType<typeof setTimeout> | null = null;
|
|
140
|
-
|
|
141
|
-
// Cleanup: cancel pending panel selection timeout on component unmount.
|
|
142
|
-
// This prevents the callback from executing on a destroyed component.
|
|
143
|
-
$effect(() => {
|
|
46
|
+
});
|
|
47
|
+
// Reference to the underlying MarkdownEditor. Using the imported component
|
|
48
|
+
// as a type is the Svelte ambient pattern — `*.svelte` declares the import
|
|
49
|
+
// as a constructable type with the component's `export function` methods.
|
|
50
|
+
let editorRef = $state();
|
|
51
|
+
// Reference to LiveRegion for screen reader announcements (DEP-47)
|
|
52
|
+
let liveRegionRef = $state();
|
|
53
|
+
// Track when editor view is ready (for effects that need to wait for async editor creation)
|
|
54
|
+
let editorViewReady = $state(false);
|
|
55
|
+
// Track current selection for thread creation
|
|
56
|
+
let currentSelection = $state(null);
|
|
57
|
+
// =========================================================================
|
|
58
|
+
// Thread Popover State
|
|
59
|
+
// =========================================================================
|
|
60
|
+
// Thread popover state
|
|
61
|
+
let popoverThreadId = $state(null);
|
|
62
|
+
let popoverPosition = $state(null);
|
|
63
|
+
// Timer handle for panel selection scroll-then-position delay.
|
|
64
|
+
// Stored at component level so we can cancel it when switching threads.
|
|
65
|
+
let selectTimeoutId = null;
|
|
66
|
+
// Cleanup: cancel pending panel selection timeout on component unmount.
|
|
67
|
+
// This prevents the callback from executing on a destroyed component.
|
|
68
|
+
$effect(() => {
|
|
144
69
|
return () => {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
70
|
+
if (selectTimeoutId !== null) {
|
|
71
|
+
clearTimeout(selectTimeoutId);
|
|
72
|
+
selectTimeoutId = null;
|
|
73
|
+
}
|
|
149
74
|
};
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
const currentDocument = $derived(parseReviewEditorFrontMatter(value));
|
|
159
|
-
const editorValue = $derived(currentDocument.body);
|
|
160
|
-
const viewPanelIds = $derived({
|
|
75
|
+
});
|
|
76
|
+
// Internal active thread tracking (not exposed as bindable prop)
|
|
77
|
+
let activeThreadId = $state(null);
|
|
78
|
+
// Comment sidebar toggle state
|
|
79
|
+
let sidebarOpen = $state(false);
|
|
80
|
+
const currentDocument = $derived(parseReviewEditorFrontMatter(value));
|
|
81
|
+
const editorValue = $derived(currentDocument.body);
|
|
82
|
+
const viewPanelIds = $derived({
|
|
161
83
|
editor: `${id}-editor-panel`,
|
|
162
84
|
diff: `${id}-diff-panel`,
|
|
163
85
|
summary: `${id}-summary-panel`,
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* Compute diff statistics from original vs current content.
|
|
182
|
-
* Uses the same line-diff algorithm as DiffViewer for consistency.
|
|
183
|
-
*/
|
|
184
|
-
const diffStats = $derived.by(() => {
|
|
86
|
+
});
|
|
87
|
+
// =========================================================================
|
|
88
|
+
// View Switching State (DEP-47)
|
|
89
|
+
// =========================================================================
|
|
90
|
+
/** Active view: editor for editing, diff for comparing, summary for review */
|
|
91
|
+
let activeView = $state('editor');
|
|
92
|
+
/** Diff view mode: unified shows all changes, final shows current state, original shows baseline */
|
|
93
|
+
let diffViewMode = $state('unified');
|
|
94
|
+
// =========================================================================
|
|
95
|
+
// Diff Statistics (DEP-47)
|
|
96
|
+
// =========================================================================
|
|
97
|
+
/**
|
|
98
|
+
* Compute diff statistics from original vs current content.
|
|
99
|
+
* Uses the same line-diff algorithm as DiffViewer for consistency.
|
|
100
|
+
*/
|
|
101
|
+
const diffStats = $derived.by(() => {
|
|
185
102
|
if (!original) {
|
|
186
|
-
|
|
103
|
+
return { added: 0, removed: 0, modified: 0 };
|
|
187
104
|
}
|
|
188
105
|
// Normalize both inputs to avoid false positives from formatting differences
|
|
189
106
|
const normalizedOriginal = normalize(original);
|
|
190
107
|
const normalizedCurrent = normalize(value);
|
|
191
108
|
const lineDiffs = computeLineDiff(normalizedOriginal, normalizedCurrent);
|
|
192
109
|
return getDiffStats(lineDiffs);
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
/**
|
|
208
|
-
* Summary content for the Summary view (without the "# Review Summary" heading).
|
|
209
|
-
* The heading is useful for clipboard exports but redundant in the UI preview
|
|
210
|
-
* since the view tab already indicates this is a summary.
|
|
211
|
-
*/
|
|
212
|
-
const summaryContent = $derived.by(() => {
|
|
110
|
+
});
|
|
111
|
+
/** Whether there are any content changes */
|
|
112
|
+
const hasContentChanges = $derived(diffStats.added > 0 || diffStats.removed > 0 || diffStats.modified > 0);
|
|
113
|
+
/** Total comment count (excluding soft-deleted comments) */
|
|
114
|
+
const commentCount = $derived(threads.reduce((count, thread) => {
|
|
115
|
+
return count + thread.comments.filter((c) => !c.deletedAt).length;
|
|
116
|
+
}, 0));
|
|
117
|
+
/**
|
|
118
|
+
* Summary content for the Summary view (without the "# Review Summary" heading).
|
|
119
|
+
* The heading is useful for clipboard exports but redundant in the UI preview
|
|
120
|
+
* since the view tab already indicates this is a summary.
|
|
121
|
+
*/
|
|
122
|
+
const summaryContent = $derived.by(() => {
|
|
213
123
|
const result = exportMarkdownSummary();
|
|
214
124
|
// Strip the "# Review Summary\n" heading from the beginning
|
|
215
125
|
return result.markdown.replace(/^# Review Summary\n+/, '');
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
/** Delay for scroll-then-position pattern (matches smooth scroll duration) */
|
|
250
|
-
const POSITION_DELAY_MS = 350;
|
|
251
|
-
|
|
252
|
-
/**
|
|
253
|
-
* Get the preferred scroll behavior respecting prefers-reduced-motion.
|
|
254
|
-
* @returns 'instant' if user prefers reduced motion, 'smooth' otherwise
|
|
255
|
-
*/
|
|
256
|
-
function getScrollBehavior(): ScrollBehavior {
|
|
126
|
+
});
|
|
127
|
+
// =========================================================================
|
|
128
|
+
// Selection Popover State (DEP-47)
|
|
129
|
+
// =========================================================================
|
|
130
|
+
/** Position for the selection popover (viewport-relative) */
|
|
131
|
+
let selectionPopoverPosition = $state(null);
|
|
132
|
+
/**
|
|
133
|
+
* Captured selection range for thread creation.
|
|
134
|
+
* We capture this when the popover appears because clicking the popover button
|
|
135
|
+
* will collapse the browser selection before handleSelectionComment runs.
|
|
136
|
+
*/
|
|
137
|
+
let capturedSelectionForPopover = $state(null);
|
|
138
|
+
/** Whether the selection popover is in expanded form state (user clicked to add comment) */
|
|
139
|
+
let selectionPopoverExpanded = $state(false);
|
|
140
|
+
/** Whether the selection popover should be visible */
|
|
141
|
+
const showSelectionPopover = $derived(activeView === 'editor' &&
|
|
142
|
+
mode === 'edit' &&
|
|
143
|
+
// Must have a user ID to create comments
|
|
144
|
+
currentUserId !== undefined &&
|
|
145
|
+
// Position is only set when browser selection is non-collapsed
|
|
146
|
+
// (checked via window.getSelection() in the debounced handler)
|
|
147
|
+
// OR the popover is already expanded (user is composing a comment)
|
|
148
|
+
(selectionPopoverPosition !== null || selectionPopoverExpanded) &&
|
|
149
|
+
// Don't show if a thread popover is already open
|
|
150
|
+
popoverThreadId === null);
|
|
151
|
+
/** Delay for scroll-then-position pattern (matches smooth scroll duration) */
|
|
152
|
+
const POSITION_DELAY_MS = 350;
|
|
153
|
+
/**
|
|
154
|
+
* Get the preferred scroll behavior respecting prefers-reduced-motion.
|
|
155
|
+
* @returns 'instant' if user prefers reduced motion, 'smooth' otherwise
|
|
156
|
+
*/
|
|
157
|
+
function getScrollBehavior() {
|
|
257
158
|
return reducedMotion.current ? 'instant' : 'smooth';
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
*/
|
|
271
|
-
function announce(message: string, priority: 'polite' | 'assertive' = 'polite'): void {
|
|
159
|
+
}
|
|
160
|
+
// =========================================================================
|
|
161
|
+
// Screen Reader Announcements (DEP-47)
|
|
162
|
+
// =========================================================================
|
|
163
|
+
/**
|
|
164
|
+
* Announce a message to screen readers via the LiveRegion component.
|
|
165
|
+
* Safe to call before the ref is available (no-op in that case).
|
|
166
|
+
*
|
|
167
|
+
* @param message - The message to announce
|
|
168
|
+
* @param priority - 'polite' (default) or 'assertive'
|
|
169
|
+
*/
|
|
170
|
+
function announce(message, priority = 'polite') {
|
|
272
171
|
liveRegionRef?.announce(message, priority);
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
172
|
+
}
|
|
173
|
+
// Get the popover thread
|
|
174
|
+
const popoverThread = $derived.by(() => {
|
|
175
|
+
if (!popoverThreadId)
|
|
176
|
+
return null;
|
|
278
177
|
return threads.find((t) => t.id === popoverThreadId) ?? null;
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
$effect(() => {
|
|
178
|
+
});
|
|
179
|
+
// Clear popover if thread is deleted
|
|
180
|
+
$effect(() => {
|
|
283
181
|
if (popoverThreadId && !popoverThread) {
|
|
284
|
-
|
|
285
|
-
|
|
182
|
+
popoverThreadId = null;
|
|
183
|
+
popoverPosition = null;
|
|
286
184
|
}
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
$effect(() => {
|
|
185
|
+
});
|
|
186
|
+
// Clear internal active thread if it no longer exists
|
|
187
|
+
$effect(() => {
|
|
291
188
|
if (activeThreadId && !threads.some((t) => t.id === activeThreadId)) {
|
|
292
|
-
|
|
189
|
+
activeThreadId = null;
|
|
293
190
|
}
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
let positionTimeoutId: ReturnType<typeof setTimeout> | null = null;
|
|
299
|
-
|
|
191
|
+
});
|
|
192
|
+
// Deep linking: open popover when activeThreadId is set externally (e.g., URL navigation).
|
|
193
|
+
$effect(() => {
|
|
194
|
+
let positionTimeoutId = null;
|
|
300
195
|
if (activeThreadId && popoverThreadId !== activeThreadId) {
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
}, POSITION_DELAY_MS);
|
|
323
|
-
}
|
|
196
|
+
const thread = threads.find((t) => t.id === activeThreadId);
|
|
197
|
+
if (thread) {
|
|
198
|
+
const threadIdToOpen = activeThreadId;
|
|
199
|
+
// First, scroll the anchor into view. We defer popover positioning until
|
|
200
|
+
// after the scroll completes to avoid the popover appearing off-screen.
|
|
201
|
+
scrollAnchorIntoView(threadIdToOpen);
|
|
202
|
+
// After scrolling, calculate position and open the popover.
|
|
203
|
+
// We re-fetch the thread inside the callback to avoid using stale data
|
|
204
|
+
// if the threads array changes during the scroll delay.
|
|
205
|
+
positionTimeoutId = setTimeout(() => {
|
|
206
|
+
// Re-fetch thread to ensure we have current data (thread may have been deleted/modified)
|
|
207
|
+
const currentThread = threads.find((t) => t.id === threadIdToOpen);
|
|
208
|
+
if (!currentThread)
|
|
209
|
+
return;
|
|
210
|
+
const pos = calculateViewportPosition(currentThread.anchor.from);
|
|
211
|
+
if (pos) {
|
|
212
|
+
popoverPosition = { x: pos.left + 16, y: pos.top };
|
|
213
|
+
popoverThreadId = threadIdToOpen;
|
|
214
|
+
}
|
|
215
|
+
}, POSITION_DELAY_MS);
|
|
216
|
+
}
|
|
324
217
|
}
|
|
325
|
-
|
|
326
218
|
// Cleanup: cancel pending timeout if effect re-runs or component unmounts
|
|
327
219
|
return () => {
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
220
|
+
if (positionTimeoutId !== null) {
|
|
221
|
+
clearTimeout(positionTimeoutId);
|
|
222
|
+
}
|
|
331
223
|
};
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
function scrollAnchorIntoView(threadId: ThreadId): void {
|
|
224
|
+
});
|
|
225
|
+
/**
|
|
226
|
+
* Scroll the editor to bring an anchor position into view.
|
|
227
|
+
* @param threadId - The thread ID to scroll to (passed explicitly to avoid stale closure)
|
|
228
|
+
*/
|
|
229
|
+
function scrollAnchorIntoView(threadId) {
|
|
339
230
|
// Query using the passed threadId, not the reactive activeThreadId,
|
|
340
231
|
// to avoid race conditions when called from setTimeout.
|
|
341
232
|
// Scope query to editor DOM to handle multiple ReviewEditor instances on page.
|
|
342
233
|
const editorDom = editorRef?.getView()?.dom;
|
|
343
234
|
const anchorElement = editorDom?.querySelector(`[data-thread-id="${threadId}"]`);
|
|
344
235
|
if (anchorElement) {
|
|
345
|
-
|
|
236
|
+
anchorElement.scrollIntoView({ behavior: getScrollBehavior(), block: 'center' });
|
|
346
237
|
}
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
*/
|
|
358
|
-
function handlePopoverClose(): void {
|
|
238
|
+
}
|
|
239
|
+
// =========================================================================
|
|
240
|
+
// Thread Popover Handlers
|
|
241
|
+
// =========================================================================
|
|
242
|
+
/**
|
|
243
|
+
* Handle closing the thread popover.
|
|
244
|
+
* Also clears activeThreadId to prevent the deep-linking effect from
|
|
245
|
+
* immediately reopening the popover, and cancels any pending panel selection timeout.
|
|
246
|
+
*/
|
|
247
|
+
function handlePopoverClose() {
|
|
359
248
|
// Cancel any pending panel selection timeout
|
|
360
249
|
if (selectTimeoutId !== null) {
|
|
361
|
-
|
|
362
|
-
|
|
250
|
+
clearTimeout(selectTimeoutId);
|
|
251
|
+
selectTimeoutId = null;
|
|
363
252
|
}
|
|
364
|
-
|
|
365
253
|
popoverThreadId = null;
|
|
366
254
|
popoverPosition = null;
|
|
367
255
|
activeThreadId = null;
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
function handlePopoverDelete(threadId: string): void {
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Handle thread delete from popover.
|
|
259
|
+
*/
|
|
260
|
+
function handlePopoverDelete(threadId) {
|
|
374
261
|
if (currentUserId) {
|
|
375
|
-
|
|
376
|
-
|
|
262
|
+
deleteThread(threadId);
|
|
263
|
+
handlePopoverClose();
|
|
377
264
|
}
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
function handlePopoverCommentUpdate(threadId: string, commentId: string, body: string): void {
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Handle comment update from popover.
|
|
268
|
+
*/
|
|
269
|
+
function handlePopoverCommentUpdate(threadId, commentId, body) {
|
|
384
270
|
updateComment(threadId, commentId, body);
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
function handlePopoverCommentDelete(threadId: string, commentId: string): void {
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Handle comment delete from popover.
|
|
274
|
+
*/
|
|
275
|
+
function handlePopoverCommentDelete(threadId, commentId) {
|
|
391
276
|
deleteComment(threadId, commentId);
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
function handlePopoverCommentCreate(threadId: string, body: string): void {
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Handle comment create from popover.
|
|
280
|
+
*/
|
|
281
|
+
function handlePopoverCommentCreate(threadId, body) {
|
|
398
282
|
if (currentUserId) {
|
|
399
|
-
|
|
283
|
+
createComment(threadId, body, currentUserId);
|
|
400
284
|
}
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
function calculateViewportPosition(from: number): { top: number; left: number } | null {
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Calculate position for fixed-position popovers near an anchor.
|
|
288
|
+
* Returns viewport-relative coordinates for use with position: fixed elements
|
|
289
|
+
* (ThreadPopover).
|
|
290
|
+
*/
|
|
291
|
+
function calculateViewportPosition(from) {
|
|
409
292
|
const view = editorRef?.getView();
|
|
410
|
-
if (!view)
|
|
411
|
-
|
|
293
|
+
if (!view)
|
|
294
|
+
return null;
|
|
412
295
|
try {
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
// Position may be invalid
|
|
296
|
+
const coords = view.coordsAtPos(documentPositionToBodyPosition(from, currentDocument.bodyOffset));
|
|
297
|
+
if (coords) {
|
|
298
|
+
// coords are already viewport-relative from ProseMirror
|
|
299
|
+
return {
|
|
300
|
+
top: coords.top + 24, // Below the anchor
|
|
301
|
+
left: Math.max(16, coords.left), // Minimum 16px from viewport edge
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
catch {
|
|
306
|
+
// Position may be invalid
|
|
425
307
|
}
|
|
426
308
|
return null;
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
* Create fingerprint including all mutable anchor fields.
|
|
441
|
-
* This prevents sync thrashing when quote/prefix/suffix change.
|
|
442
|
-
*/
|
|
443
|
-
function createSyncFingerprint(threadsToSync: Thread[]): string {
|
|
309
|
+
}
|
|
310
|
+
// =========================================================================
|
|
311
|
+
// Anchor Plugin Integration (DEP-39)
|
|
312
|
+
// =========================================================================
|
|
313
|
+
// Track last synced state to prevent thrashing
|
|
314
|
+
let lastSyncedFingerprint = null;
|
|
315
|
+
// Pending state for deferred re-anchoring (setState flow)
|
|
316
|
+
let pendingState = $state(null);
|
|
317
|
+
/**
|
|
318
|
+
* Create fingerprint including all mutable anchor fields.
|
|
319
|
+
* This prevents sync thrashing when quote/prefix/suffix change.
|
|
320
|
+
*/
|
|
321
|
+
function createSyncFingerprint(threadsToSync) {
|
|
444
322
|
return threadsToSync
|
|
445
|
-
|
|
323
|
+
.map((t) => {
|
|
446
324
|
const a = t.anchor;
|
|
447
325
|
// Include lastKnownOffset to propagate disambiguation updates
|
|
448
326
|
return `${t.id}:${a.from}:${a.to}:${a.quote}:${a.prefix}:${a.suffix}:${a.lastKnownOffset ?? ''}`;
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
function createPluginSyncFingerprint(threadsToSync: Thread[]): string {
|
|
327
|
+
})
|
|
328
|
+
.join('|');
|
|
329
|
+
}
|
|
330
|
+
function createPluginSyncFingerprint(threadsToSync) {
|
|
454
331
|
return `${currentDocument.bodyOffset}|${createSyncFingerprint(threadsToSync)}`;
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
function handleAnchorsUpdate(updates: AnchorUpdate[]): void {
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Handle anchor position updates from the plugin.
|
|
335
|
+
* Called when the plugin detects position changes.
|
|
336
|
+
*/
|
|
337
|
+
function handleAnchorsUpdate(updates) {
|
|
462
338
|
// Update published threads
|
|
463
339
|
threads = threads.map((thread) => {
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
};
|
|
482
|
-
}
|
|
483
|
-
return thread;
|
|
340
|
+
const update = updates.find((u) => u.threadId === thread.id);
|
|
341
|
+
if (update) {
|
|
342
|
+
const documentUpdate = bodyAnchorUpdateToDocumentAnchorUpdate(update, currentDocument.bodyOffset);
|
|
343
|
+
return {
|
|
344
|
+
...thread,
|
|
345
|
+
anchor: {
|
|
346
|
+
...thread.anchor,
|
|
347
|
+
from: documentUpdate.from,
|
|
348
|
+
to: documentUpdate.to,
|
|
349
|
+
quote: documentUpdate.quote,
|
|
350
|
+
prefix: documentUpdate.prefix,
|
|
351
|
+
suffix: documentUpdate.suffix,
|
|
352
|
+
lastKnownOffset: documentUpdate.lastKnownOffset,
|
|
353
|
+
},
|
|
354
|
+
};
|
|
355
|
+
}
|
|
356
|
+
return thread;
|
|
484
357
|
});
|
|
485
|
-
|
|
486
358
|
// Update fingerprint to skip re-sync
|
|
487
359
|
lastSyncedFingerprint = createPluginSyncFingerprint(threads);
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
const anchorPlugin = createAnchorPlugin({
|
|
360
|
+
}
|
|
361
|
+
// Create anchor plugin in instance script (per-instance, before mount)
|
|
362
|
+
// This runs once per ReviewEditor instance during initialization
|
|
363
|
+
const anchorPlugin = createAnchorPlugin({
|
|
493
364
|
onAnchorsUpdate: handleAnchorsUpdate,
|
|
494
365
|
onAnchorClick: handleAnchorClick,
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
function handleAnchorClick(threadId: string, event: MouseEvent): void {
|
|
366
|
+
});
|
|
367
|
+
/**
|
|
368
|
+
* Handle click on an anchor decoration.
|
|
369
|
+
* Opens the thread popover at the click location.
|
|
370
|
+
*/
|
|
371
|
+
function handleAnchorClick(threadId, event) {
|
|
502
372
|
// Cancel any pending panel selection timer to prevent race conditions
|
|
503
373
|
// where the timer callback would unexpectedly switch to a different thread
|
|
504
374
|
if (selectTimeoutId !== null) {
|
|
505
|
-
|
|
506
|
-
|
|
375
|
+
clearTimeout(selectTimeoutId);
|
|
376
|
+
selectTimeoutId = null;
|
|
507
377
|
}
|
|
508
|
-
|
|
509
378
|
// Clear selection popover state when opening a thread popover
|
|
510
379
|
// Otherwise stale state persists and the popover may reappear at an invalid position
|
|
511
380
|
selectionPopoverPosition = null;
|
|
512
381
|
capturedSelectionForPopover = null;
|
|
513
382
|
selectionPopoverExpanded = false;
|
|
514
|
-
|
|
515
383
|
// Set active thread and open popover
|
|
516
384
|
activeThreadId = threadId;
|
|
517
|
-
|
|
518
385
|
// Find the thread to show the popover
|
|
519
386
|
const thread = threads.find((t) => t.id === threadId);
|
|
520
387
|
if (thread) {
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
388
|
+
// Position popover near the click location
|
|
389
|
+
popoverPosition = { x: event.clientX + 16, y: event.clientY };
|
|
390
|
+
popoverThreadId = threadId;
|
|
524
391
|
}
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
function syncThreadsToPlugin(threadsToSync: Thread[]): void {
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* Sync threads to the anchor plugin via meta-transaction.
|
|
395
|
+
*/
|
|
396
|
+
function syncThreadsToPlugin(threadsToSync) {
|
|
531
397
|
const view = editorRef?.getView();
|
|
532
|
-
if (!view)
|
|
533
|
-
|
|
398
|
+
if (!view)
|
|
399
|
+
return;
|
|
534
400
|
const fingerprint = createPluginSyncFingerprint(threadsToSync);
|
|
535
|
-
|
|
536
401
|
// Skip if already synced
|
|
537
|
-
if (fingerprint === lastSyncedFingerprint)
|
|
402
|
+
if (fingerprint === lastSyncedFingerprint)
|
|
403
|
+
return;
|
|
538
404
|
lastSyncedFingerprint = fingerprint;
|
|
539
|
-
|
|
540
|
-
view.dispatch(
|
|
541
|
-
view.state.tr.setMeta(anchorPluginKey, {
|
|
405
|
+
view.dispatch(view.state.tr.setMeta(anchorPluginKey, {
|
|
542
406
|
type: 'sync',
|
|
543
407
|
threads: threadsToSync.map((thread) => ({
|
|
544
|
-
|
|
545
|
-
|
|
408
|
+
...thread,
|
|
409
|
+
anchor: documentAnchorToBodyAnchor(thread.anchor, currentDocument.bodyOffset),
|
|
546
410
|
})),
|
|
547
411
|
source: 'external',
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
if (!pendingState) return;
|
|
560
|
-
|
|
412
|
+
}));
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
* Attempt re-anchoring for pending state.
|
|
416
|
+
* Called when setState is invoked and when editor content changes.
|
|
417
|
+
*
|
|
418
|
+
* Threads whose anchor text cannot be found are removed (auto-delete behavior).
|
|
419
|
+
*/
|
|
420
|
+
function attemptReanchoring() {
|
|
421
|
+
if (!pendingState)
|
|
422
|
+
return;
|
|
561
423
|
const view = editorRef?.getView();
|
|
562
|
-
if (!view)
|
|
563
|
-
|
|
424
|
+
if (!view)
|
|
425
|
+
return;
|
|
564
426
|
// Compare markdown using contentEquals (handles normalization)
|
|
565
427
|
const currentMarkdown = editorRef?.getMarkdown() ?? '';
|
|
566
428
|
const pendingDocument = parseReviewEditorFrontMatter(pendingState.content);
|
|
567
429
|
const expectedMarkdown = pendingDocument.body;
|
|
568
|
-
|
|
569
430
|
if (!contentEquals(currentMarkdown, expectedMarkdown)) {
|
|
570
|
-
|
|
571
|
-
|
|
431
|
+
// Content not synced yet - will retry when editor updates
|
|
432
|
+
return;
|
|
572
433
|
}
|
|
573
|
-
|
|
574
434
|
const state = pendingState;
|
|
575
435
|
pendingState = null;
|
|
576
|
-
|
|
577
436
|
const { doc } = view.state;
|
|
578
437
|
const documentText = doc.textBetween(0, doc.content.size, '\n');
|
|
579
|
-
|
|
580
438
|
// Re-anchor threads, filtering out those that can't be found
|
|
581
|
-
const reanchoredThreads
|
|
582
|
-
|
|
439
|
+
const reanchoredThreads = [];
|
|
583
440
|
for (const persistedThread of state.threads) {
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
...persistedThread,
|
|
614
|
-
anchor: {
|
|
615
|
-
...persistedThread.anchor,
|
|
616
|
-
from: from + pendingDocument.bodyOffset,
|
|
617
|
-
to: to + pendingDocument.bodyOffset,
|
|
618
|
-
quote: matchedQuote,
|
|
619
|
-
prefix: newPrefix,
|
|
620
|
-
suffix: newSuffix,
|
|
621
|
-
status: 'anchored',
|
|
622
|
-
lastKnownOffset: result.from + pendingDocument.bodyOffset,
|
|
623
|
-
},
|
|
624
|
-
});
|
|
625
|
-
}
|
|
441
|
+
const bodyPersistedAnchor = documentPersistedAnchorToBodyAnchor(persistedThread.anchor, pendingDocument.bodyOffset);
|
|
442
|
+
const result = reanchorQuote(documentText, bodyPersistedAnchor);
|
|
443
|
+
// If anchor text not found, skip this thread (auto-delete)
|
|
444
|
+
if (!result.found) {
|
|
445
|
+
onthreaddelete?.({ threadId: persistedThread.id });
|
|
446
|
+
continue;
|
|
447
|
+
}
|
|
448
|
+
const from = textOffsetToProseMirrorPosition(doc, result.from);
|
|
449
|
+
const to = textOffsetToProseMirrorPosition(doc, result.to);
|
|
450
|
+
if (from !== null && to !== null) {
|
|
451
|
+
// Extract the matched quote and context from the current document
|
|
452
|
+
// This prevents the plugin from detecting false drift on subsequent transactions
|
|
453
|
+
const matchedQuote = documentText.slice(result.from, result.to);
|
|
454
|
+
const newPrefix = documentText.slice(Math.max(0, result.from - ANCHOR_CONTEXT_LENGTH), result.from);
|
|
455
|
+
const newSuffix = documentText.slice(result.to, Math.min(documentText.length, result.to + ANCHOR_CONTEXT_LENGTH));
|
|
456
|
+
reanchoredThreads.push({
|
|
457
|
+
...persistedThread,
|
|
458
|
+
anchor: {
|
|
459
|
+
...persistedThread.anchor,
|
|
460
|
+
from: from + pendingDocument.bodyOffset,
|
|
461
|
+
to: to + pendingDocument.bodyOffset,
|
|
462
|
+
quote: matchedQuote,
|
|
463
|
+
prefix: newPrefix,
|
|
464
|
+
suffix: newSuffix,
|
|
465
|
+
status: 'anchored',
|
|
466
|
+
lastKnownOffset: result.from + pendingDocument.bodyOffset,
|
|
467
|
+
},
|
|
468
|
+
});
|
|
469
|
+
}
|
|
626
470
|
}
|
|
627
|
-
|
|
628
471
|
threads = reanchoredThreads;
|
|
629
|
-
|
|
630
472
|
// Sync threads to plugin
|
|
631
473
|
syncThreadsToPlugin(threads);
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
$effect(() => {
|
|
474
|
+
}
|
|
475
|
+
// Retry re-anchoring when editor content changes (handles async content sync)
|
|
476
|
+
// We read `value` to create a dependency so this effect re-runs when content changes.
|
|
477
|
+
// This is critical for setState flow where pendingState exists but content isn't synced yet.
|
|
478
|
+
$effect(() => {
|
|
638
479
|
void value; // Create dependency on value
|
|
639
480
|
if (pendingState && editorRef?.getView()) {
|
|
640
|
-
|
|
481
|
+
attemptReanchoring();
|
|
641
482
|
}
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
$effect(() => {
|
|
483
|
+
});
|
|
484
|
+
// Sync threads to plugin when they change externally
|
|
485
|
+
// Runs for empty arrays too - needed to clear stale decorations when all threads removed
|
|
486
|
+
$effect(() => {
|
|
647
487
|
// Only sync if editor is ready and we don't have pending state
|
|
648
488
|
if (editorRef?.getView() && !pendingState) {
|
|
649
|
-
|
|
489
|
+
syncThreadsToPlugin(threads);
|
|
650
490
|
}
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
// This prevents stale popover state from persisting across mode transitions
|
|
658
|
-
$effect(() => {
|
|
491
|
+
});
|
|
492
|
+
// Determine if editor is readonly based on mode
|
|
493
|
+
const isReadonly = $derived(mode === 'readonly');
|
|
494
|
+
// Clear selection popover state when mode changes to readonly
|
|
495
|
+
// This prevents stale popover state from persisting across mode transitions
|
|
496
|
+
$effect(() => {
|
|
659
497
|
if (mode === 'readonly') {
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
498
|
+
selectionPopoverPosition = null;
|
|
499
|
+
capturedSelectionForPopover = null;
|
|
500
|
+
selectionPopoverExpanded = false;
|
|
663
501
|
}
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
*/
|
|
674
|
-
const changeTracker = createChangeTracker({
|
|
502
|
+
});
|
|
503
|
+
// =========================================================================
|
|
504
|
+
// Optimized Change Detection (DEP-47)
|
|
505
|
+
// =========================================================================
|
|
506
|
+
/**
|
|
507
|
+
* Change tracker with lazy dirty flag and debounced semantic verification.
|
|
508
|
+
* Avoids per-keystroke normalize() calls which are expensive for large documents.
|
|
509
|
+
*/
|
|
510
|
+
const changeTracker = createChangeTracker({
|
|
675
511
|
debounceMs: 300,
|
|
676
512
|
includeFrontMatter: true,
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
$effect(() => {
|
|
513
|
+
});
|
|
514
|
+
// Wire baseline and current values to the tracker
|
|
515
|
+
$effect(() => {
|
|
681
516
|
changeTracker.setBaseline(original);
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
$effect(() => {
|
|
517
|
+
});
|
|
518
|
+
$effect(() => {
|
|
685
519
|
changeTracker.setCurrent(value);
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
// This is more reliable than ProseMirror's selection events for detecting visual selection
|
|
696
|
-
$effect(() => {
|
|
697
|
-
if (typeof document === 'undefined') return;
|
|
698
|
-
|
|
699
|
-
function handleBrowserSelectionChange() {
|
|
700
|
-
// Clear any pending calculation
|
|
701
|
-
if (selectionTimeoutId !== null) {
|
|
702
|
-
clearTimeout(selectionTimeoutId);
|
|
703
|
-
selectionTimeoutId = null;
|
|
704
|
-
}
|
|
705
|
-
|
|
706
|
-
// Only process in edit mode
|
|
707
|
-
if (mode !== 'edit') {
|
|
708
|
-
selectionPopoverPosition = null;
|
|
709
|
-
capturedSelectionForPopover = null;
|
|
710
|
-
return;
|
|
711
|
-
}
|
|
712
|
-
|
|
713
|
-
// Don't clear the popover if focus is within it (user is interacting with the form)
|
|
714
|
-
const selectionPopoverElement = document.getElementById(`${id}-selection-popover`);
|
|
715
|
-
if (selectionPopoverElement?.contains(document.activeElement)) {
|
|
716
|
-
return;
|
|
717
|
-
}
|
|
718
|
-
|
|
719
|
-
// Don't clear the popover if it's expanded (user is composing a comment)
|
|
720
|
-
// This is especially important for Safari where clicking a button doesn't focus it,
|
|
721
|
-
// which would otherwise cause the popover to close unexpectedly
|
|
722
|
-
if (selectionPopoverExpanded) {
|
|
520
|
+
});
|
|
521
|
+
/** Timeout ID for debounced selection position calculation */
|
|
522
|
+
let selectionTimeoutId = null;
|
|
523
|
+
/** Debounce delay for selection position calculation (ms) */
|
|
524
|
+
const SELECTION_DEBOUNCE_MS = 20;
|
|
525
|
+
// Listen to browser's native selectionchange event
|
|
526
|
+
// This is more reliable than ProseMirror's selection events for detecting visual selection
|
|
527
|
+
$effect(() => {
|
|
528
|
+
if (typeof document === 'undefined')
|
|
723
529
|
return;
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
if (!browserSelection || browserSelection.isCollapsed) {
|
|
730
|
-
selectionPopoverPosition = null;
|
|
731
|
-
capturedSelectionForPopover = null;
|
|
732
|
-
selectionPopoverExpanded = false;
|
|
733
|
-
return;
|
|
734
|
-
}
|
|
735
|
-
|
|
736
|
-
// Check if selection is within the actual editor DOM (not front matter controls,
|
|
737
|
-
// sidebar, or toolbar content).
|
|
738
|
-
const anchorNode = browserSelection.anchorNode;
|
|
739
|
-
const editorDom = editorRef?.getView()?.dom;
|
|
740
|
-
if (!editorDom || !anchorNode || !editorDom.contains(anchorNode)) {
|
|
741
|
-
selectionPopoverPosition = null;
|
|
742
|
-
capturedSelectionForPopover = null;
|
|
743
|
-
selectionPopoverExpanded = false;
|
|
744
|
-
return;
|
|
745
|
-
}
|
|
746
|
-
|
|
747
|
-
// Debounce position calculation to let rapid selection events settle
|
|
748
|
-
selectionTimeoutId = setTimeout(() => {
|
|
749
|
-
selectionTimeoutId = null;
|
|
750
|
-
|
|
751
|
-
// Re-check selection after debounce
|
|
752
|
-
const sel = window.getSelection();
|
|
753
|
-
if (!sel || sel.isCollapsed) {
|
|
754
|
-
selectionPopoverPosition = null;
|
|
755
|
-
capturedSelectionForPopover = null;
|
|
756
|
-
return;
|
|
530
|
+
function handleBrowserSelectionChange() {
|
|
531
|
+
// Clear any pending calculation
|
|
532
|
+
if (selectionTimeoutId !== null) {
|
|
533
|
+
clearTimeout(selectionTimeoutId);
|
|
534
|
+
selectionTimeoutId = null;
|
|
757
535
|
}
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
// This prevents showing a popover that can't submit due to timing mismatches
|
|
775
|
-
selectionPopoverPosition = anchorPosition;
|
|
776
|
-
}
|
|
777
|
-
}
|
|
536
|
+
// Only process in edit mode
|
|
537
|
+
if (mode !== 'edit') {
|
|
538
|
+
selectionPopoverPosition = null;
|
|
539
|
+
capturedSelectionForPopover = null;
|
|
540
|
+
return;
|
|
541
|
+
}
|
|
542
|
+
// Don't clear the popover if focus is within it (user is interacting with the form)
|
|
543
|
+
const selectionPopoverElement = document.getElementById(`${id}-selection-popover`);
|
|
544
|
+
if (selectionPopoverElement?.contains(document.activeElement)) {
|
|
545
|
+
return;
|
|
546
|
+
}
|
|
547
|
+
// Don't clear the popover if it's expanded (user is composing a comment)
|
|
548
|
+
// This is especially important for Safari where clicking a button doesn't focus it,
|
|
549
|
+
// which would otherwise cause the popover to close unexpectedly
|
|
550
|
+
if (selectionPopoverExpanded) {
|
|
551
|
+
return;
|
|
778
552
|
}
|
|
779
|
-
|
|
553
|
+
const browserSelection = window.getSelection();
|
|
554
|
+
// If selection is collapsed, hide popover immediately and reset all popover state
|
|
555
|
+
if (!browserSelection || browserSelection.isCollapsed) {
|
|
556
|
+
selectionPopoverPosition = null;
|
|
557
|
+
capturedSelectionForPopover = null;
|
|
558
|
+
selectionPopoverExpanded = false;
|
|
559
|
+
return;
|
|
560
|
+
}
|
|
561
|
+
// Check if selection is within the actual editor DOM (not front matter controls,
|
|
562
|
+
// sidebar, or toolbar content).
|
|
563
|
+
const anchorNode = browserSelection.anchorNode;
|
|
564
|
+
const editorDom = editorRef?.getView()?.dom;
|
|
565
|
+
if (!editorDom || !anchorNode || !editorDom.contains(anchorNode)) {
|
|
566
|
+
selectionPopoverPosition = null;
|
|
567
|
+
capturedSelectionForPopover = null;
|
|
568
|
+
selectionPopoverExpanded = false;
|
|
569
|
+
return;
|
|
570
|
+
}
|
|
571
|
+
// Debounce position calculation to let rapid selection events settle
|
|
572
|
+
selectionTimeoutId = setTimeout(() => {
|
|
573
|
+
selectionTimeoutId = null;
|
|
574
|
+
// Re-check selection after debounce
|
|
575
|
+
const sel = window.getSelection();
|
|
576
|
+
if (!sel || sel.isCollapsed) {
|
|
577
|
+
selectionPopoverPosition = null;
|
|
578
|
+
capturedSelectionForPopover = null;
|
|
579
|
+
return;
|
|
580
|
+
}
|
|
581
|
+
// Get the selection range and compute position from the browser's DOM
|
|
582
|
+
const range = sel.getRangeAt(0);
|
|
583
|
+
const anchorPosition = getSelectionAnchorPosition(range);
|
|
584
|
+
if (anchorPosition) {
|
|
585
|
+
// Capture the ProseMirror selection range for thread creation
|
|
586
|
+
// We need this because clicking the popover will collapse the selection
|
|
587
|
+
// Get selection directly from the view since currentSelection state
|
|
588
|
+
// may not be updated yet when the native selectionchange fires
|
|
589
|
+
const view = editorRef?.getView();
|
|
590
|
+
if (view) {
|
|
591
|
+
const { from, to } = view.state.selection;
|
|
592
|
+
if (from !== to) {
|
|
593
|
+
capturedSelectionForPopover = { from, to };
|
|
594
|
+
// Only show popover when we have a valid captured selection
|
|
595
|
+
// This prevents showing a popover that can't submit due to timing mismatches
|
|
596
|
+
selectionPopoverPosition = anchorPosition;
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
}, SELECTION_DEBOUNCE_MS);
|
|
780
601
|
}
|
|
781
|
-
|
|
782
602
|
document.addEventListener('selectionchange', handleBrowserSelectionChange);
|
|
783
|
-
|
|
784
603
|
return () => {
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
604
|
+
document.removeEventListener('selectionchange', handleBrowserSelectionChange);
|
|
605
|
+
if (selectionTimeoutId !== null) {
|
|
606
|
+
clearTimeout(selectionTimeoutId);
|
|
607
|
+
selectionTimeoutId = null;
|
|
608
|
+
}
|
|
790
609
|
};
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
function handleSelectionChange(selection: EditorSelection | null) {
|
|
610
|
+
});
|
|
611
|
+
// Handle selection changes from ProseMirror (for currentSelection state)
|
|
612
|
+
function handleSelectionChange(selection) {
|
|
795
613
|
// Mark editor as ready on first selection change (fired when editor initializes)
|
|
796
614
|
if (!editorViewReady) {
|
|
797
|
-
|
|
615
|
+
editorViewReady = true;
|
|
798
616
|
}
|
|
799
617
|
currentSelection = selection;
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
function handleChange(newValue: string) {
|
|
618
|
+
}
|
|
619
|
+
// Handle content changes
|
|
620
|
+
function handleChange(newValue) {
|
|
804
621
|
value = newValue;
|
|
805
622
|
onchange?.(newValue);
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
function handleEditorBodyChange(newBody: string) {
|
|
623
|
+
}
|
|
624
|
+
function handleEditorBodyChange(newBody) {
|
|
809
625
|
handleChange(combineFrontMatterAndBody(currentDocument, newBody));
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
function handleFrontMatterChange(data: Record<string, unknown> | null) {
|
|
626
|
+
}
|
|
627
|
+
function handleFrontMatterChange(data) {
|
|
813
628
|
const previousBodyOffset = currentDocument.bodyOffset;
|
|
814
629
|
const nextValue = replaceFrontMatterData(value, data);
|
|
815
630
|
const nextDocument = parseReviewEditorFrontMatter(nextValue);
|
|
816
|
-
|
|
817
631
|
if (previousBodyOffset !== nextDocument.bodyOffset) {
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
previousBodyOffset,
|
|
823
|
-
nextDocument.bodyOffset,
|
|
824
|
-
nextValue,
|
|
825
|
-
),
|
|
826
|
-
}));
|
|
632
|
+
threads = threads.map((thread) => ({
|
|
633
|
+
...thread,
|
|
634
|
+
anchor: remapDocumentAnchorBodyOffset(thread.anchor, previousBodyOffset, nextDocument.bodyOffset, nextValue),
|
|
635
|
+
}));
|
|
827
636
|
}
|
|
828
|
-
|
|
829
637
|
handleChange(nextValue);
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
/** Focus the editor */
|
|
837
|
-
export function focus(): void {
|
|
638
|
+
}
|
|
639
|
+
// =========================================================================
|
|
640
|
+
// Imperative Methods
|
|
641
|
+
// =========================================================================
|
|
642
|
+
/** Focus the editor */
|
|
643
|
+
export function focus() {
|
|
838
644
|
editorRef?.focus();
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
export function getMarkdown(): string {
|
|
645
|
+
}
|
|
646
|
+
/** Get current markdown content */
|
|
647
|
+
export function getMarkdown() {
|
|
843
648
|
const body = editorRef?.getMarkdown() ?? currentDocument.body;
|
|
844
649
|
return combineFrontMatterAndBody(currentDocument, body);
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
export function setMarkdown(content: string): void {
|
|
650
|
+
}
|
|
651
|
+
/** Set markdown content */
|
|
652
|
+
export function setMarkdown(content) {
|
|
849
653
|
value = content;
|
|
850
654
|
editorRef?.setMarkdown(parseReviewEditorFrontMatter(content).body);
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
export function getAst() {
|
|
655
|
+
}
|
|
656
|
+
/** Get current AST */
|
|
657
|
+
export function getAst() {
|
|
855
658
|
return editorRef?.getAst();
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
export function getSelection(): EditorSelection | null {
|
|
659
|
+
}
|
|
660
|
+
/** Get current selection */
|
|
661
|
+
export function getSelection() {
|
|
860
662
|
const selection = editorRef?.getSelection();
|
|
861
|
-
if (!selection)
|
|
663
|
+
if (!selection)
|
|
664
|
+
return null;
|
|
862
665
|
return {
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
666
|
+
...selection,
|
|
667
|
+
from: selection.from + currentDocument.bodyOffset,
|
|
668
|
+
to: selection.to + currentDocument.bodyOffset,
|
|
866
669
|
};
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
export function scrollToThread(threadId: string): void {
|
|
670
|
+
}
|
|
671
|
+
/** Scroll to a specific thread's anchor position in the editor */
|
|
672
|
+
export function scrollToThread(threadId) {
|
|
871
673
|
const thread = threads.find((t) => t.id === threadId);
|
|
872
|
-
if (!thread)
|
|
873
|
-
|
|
674
|
+
if (!thread)
|
|
675
|
+
return;
|
|
874
676
|
const view = editorRef?.getView();
|
|
875
677
|
if (view && thread.anchor.from !== undefined) {
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
});
|
|
885
|
-
}
|
|
678
|
+
// Scroll the anchor position into view
|
|
679
|
+
const coords = view.coordsAtPos(documentPositionToBodyPosition(thread.anchor.from, currentDocument.bodyOffset));
|
|
680
|
+
if (coords) {
|
|
681
|
+
view.dom.scrollTo({
|
|
682
|
+
top: coords.top - 100, // Offset from top
|
|
683
|
+
behavior: getScrollBehavior(),
|
|
684
|
+
});
|
|
685
|
+
}
|
|
886
686
|
}
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
function handleSidebarThreadSelect(threadId: string): void {
|
|
687
|
+
}
|
|
688
|
+
/**
|
|
689
|
+
* Handle thread selection from the comment sidebar.
|
|
690
|
+
* Scrolls to the thread and opens its popover.
|
|
691
|
+
*/
|
|
692
|
+
function handleSidebarThreadSelect(threadId) {
|
|
894
693
|
const thread = threads.find((t) => t.id === threadId);
|
|
895
|
-
if (!thread)
|
|
896
|
-
|
|
694
|
+
if (!thread)
|
|
695
|
+
return;
|
|
897
696
|
// Set active thread
|
|
898
697
|
activeThreadId = threadId;
|
|
899
|
-
|
|
900
698
|
// Scroll to the thread
|
|
901
699
|
scrollToThread(threadId);
|
|
902
|
-
|
|
903
700
|
// Open popover at anchor position after scroll completes
|
|
904
701
|
setTimeout(() => {
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
popoverThreadId = threadId;
|
|
702
|
+
const view = editorRef?.getView();
|
|
703
|
+
if (view && thread.anchor.from !== undefined) {
|
|
704
|
+
const coords = view.coordsAtPos(documentPositionToBodyPosition(thread.anchor.from, currentDocument.bodyOffset));
|
|
705
|
+
if (coords) {
|
|
706
|
+
popoverPosition = { x: coords.left + 16, y: coords.top };
|
|
707
|
+
popoverThreadId = threadId;
|
|
708
|
+
}
|
|
913
709
|
}
|
|
914
|
-
}
|
|
915
710
|
}, POSITION_DELAY_MS);
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
function handleAddDocumentComment(body: string): void {
|
|
711
|
+
}
|
|
712
|
+
/**
|
|
713
|
+
* Handle request to add a document-level comment from the sidebar.
|
|
714
|
+
* The body is provided by the inline CommentComposer in the sidebar.
|
|
715
|
+
*/
|
|
716
|
+
function handleAddDocumentComment(body) {
|
|
923
717
|
if (!currentUserId) {
|
|
924
|
-
|
|
925
|
-
|
|
718
|
+
devWarn('Cannot add document comment: no currentUserId');
|
|
719
|
+
return;
|
|
926
720
|
}
|
|
927
|
-
|
|
928
721
|
createDocumentThread(body, currentUserId);
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
},
|
|
722
|
+
}
|
|
723
|
+
/**
|
|
724
|
+
* Get serializable review state.
|
|
725
|
+
* Threads are converted to persisted format for re-anchoring.
|
|
726
|
+
*
|
|
727
|
+
* Content is preserved as the complete Markdown document, including front matter.
|
|
728
|
+
*/
|
|
729
|
+
export function getState() {
|
|
730
|
+
const persistedThreads = threads.map((thread) => ({
|
|
731
|
+
...thread,
|
|
732
|
+
anchor: {
|
|
733
|
+
quote: thread.anchor.quote,
|
|
734
|
+
prefix: thread.anchor.prefix,
|
|
735
|
+
suffix: thread.anchor.suffix,
|
|
736
|
+
status: thread.anchor.status,
|
|
737
|
+
blockId: thread.anchor.blockId,
|
|
738
|
+
originalPosition: thread.anchor.originalPosition,
|
|
739
|
+
originalQuote: thread.anchor.originalQuote, // Preserve for history
|
|
740
|
+
lastKnownOffset: thread.anchor.lastKnownOffset, // For disambiguation
|
|
741
|
+
},
|
|
950
742
|
}));
|
|
951
|
-
|
|
952
743
|
return {
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
744
|
+
schemaVersion: 4,
|
|
745
|
+
content: value,
|
|
746
|
+
original: original || undefined,
|
|
747
|
+
threads: persistedThreads,
|
|
748
|
+
reviewSession: undefined,
|
|
749
|
+
frontMatter: currentDocument.data,
|
|
750
|
+
frontMatterRaw: currentDocument.raw,
|
|
751
|
+
updatedAt: new Date().toISOString(),
|
|
961
752
|
};
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
export function setState(state: ReviewState): void {
|
|
753
|
+
}
|
|
754
|
+
/**
|
|
755
|
+
* Restore review state from serialized data.
|
|
756
|
+
* Thread anchors are re-anchored using the quote/prefix/suffix context.
|
|
757
|
+
*
|
|
758
|
+
* Note: This updates both content and original baseline from the incoming state,
|
|
759
|
+
* ensuring subsequent diffs and exports use the correct baseline.
|
|
760
|
+
*/
|
|
761
|
+
export function setState(state) {
|
|
972
762
|
const nextValue = reviewStateToMarkdown(state);
|
|
973
763
|
value = nextValue;
|
|
974
764
|
// Update original baseline if provided in state, so diffs work correctly
|
|
975
765
|
if (state.original !== undefined) {
|
|
976
|
-
|
|
766
|
+
original = state.original;
|
|
977
767
|
}
|
|
978
768
|
pendingState = { ...state, content: nextValue };
|
|
979
|
-
|
|
980
769
|
// Attempt re-anchoring immediately if editor is ready
|
|
981
770
|
attemptReanchoring();
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
export function getView() {
|
|
771
|
+
}
|
|
772
|
+
/** Get direct access to ProseMirror view (advanced use) */
|
|
773
|
+
export function getView() {
|
|
986
774
|
return editorRef?.getView() ?? null;
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
export function getEditor() {
|
|
775
|
+
}
|
|
776
|
+
/** Get direct access to Milkdown editor (advanced use) */
|
|
777
|
+
export function getEditor() {
|
|
991
778
|
return editorRef?.getEditor() ?? null;
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
*/
|
|
1003
|
-
export function exportMarkdownSummary(
|
|
1004
|
-
options: MarkdownSummaryOptions | undefined = undefined,
|
|
1005
|
-
): MarkdownSummaryResult {
|
|
779
|
+
}
|
|
780
|
+
// =========================================================================
|
|
781
|
+
// Export Operations
|
|
782
|
+
// =========================================================================
|
|
783
|
+
/**
|
|
784
|
+
* Export an LLM-optimized Markdown summary of the review.
|
|
785
|
+
* Includes document changes and comment threads
|
|
786
|
+
* in a structured format suitable for LLM analysis.
|
|
787
|
+
*/
|
|
788
|
+
export function exportMarkdownSummary(options = undefined) {
|
|
1006
789
|
return generateMarkdownSummary(getState(), options);
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
export function exportUnifiedDiff(
|
|
1014
|
-
options: UnifiedDiffOptions | undefined = undefined,
|
|
1015
|
-
): UnifiedDiffResult {
|
|
790
|
+
}
|
|
791
|
+
/**
|
|
792
|
+
* Export a Git-compatible unified diff.
|
|
793
|
+
* The output can be applied with `git apply` or `patch` command.
|
|
794
|
+
*/
|
|
795
|
+
export function exportUnifiedDiff(options = undefined) {
|
|
1016
796
|
return generateUnifiedDiff(getState(), options);
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
/** Get plain markdown content for clipboard export */
|
|
1024
|
-
function handleExportContent(): string {
|
|
797
|
+
}
|
|
798
|
+
// =========================================================================
|
|
799
|
+
// Export Action Callbacks (for ExportActions component)
|
|
800
|
+
// =========================================================================
|
|
801
|
+
/** Get plain markdown content for clipboard export */
|
|
802
|
+
function handleExportContent() {
|
|
1025
803
|
return value;
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
function handleExportSummary(): string {
|
|
804
|
+
}
|
|
805
|
+
/** Get LLM-optimized summary for clipboard export */
|
|
806
|
+
function handleExportSummary() {
|
|
1030
807
|
return exportMarkdownSummary().markdown;
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
function handleExportJSON(): string {
|
|
808
|
+
}
|
|
809
|
+
/** Get JSON state for clipboard export */
|
|
810
|
+
function handleExportJSON() {
|
|
1035
811
|
const json = stringifyOrNull(getState());
|
|
1036
812
|
// Return error message if serialization fails (circular refs, BigInt, etc.)
|
|
1037
813
|
// This prevents copying invalid JSON like "[object Object]" to clipboard
|
|
1038
814
|
if (json === null) {
|
|
1039
|
-
|
|
815
|
+
return '{"error": "Failed to serialize editor state"}';
|
|
1040
816
|
}
|
|
1041
817
|
return json;
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
function handleExportDiff(): string {
|
|
818
|
+
}
|
|
819
|
+
/** Get unified diff for clipboard export */
|
|
820
|
+
function handleExportDiff() {
|
|
1046
821
|
return exportUnifiedDiff().diff;
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
function handleExportComments(): string {
|
|
822
|
+
}
|
|
823
|
+
/** Get comments export for clipboard export */
|
|
824
|
+
function handleExportComments() {
|
|
1051
825
|
return generateCommentsExport(getState()).markdown;
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
*/
|
|
1062
|
-
function getFieldName(field: string): string {
|
|
826
|
+
}
|
|
827
|
+
// =========================================================================
|
|
828
|
+
// Form Participation (FormData integration)
|
|
829
|
+
// =========================================================================
|
|
830
|
+
/**
|
|
831
|
+
* Derive field name with optional prefix.
|
|
832
|
+
* Used for hidden inputs when participating in a parent form.
|
|
833
|
+
*/
|
|
834
|
+
function getFieldName(field) {
|
|
1063
835
|
return name ? `${name}-${field}` : field;
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
*/
|
|
1089
|
-
export function getFormData(): ReviewFormData {
|
|
836
|
+
}
|
|
837
|
+
/**
|
|
838
|
+
* Derived values for hidden inputs (computed reactively).
|
|
839
|
+
* These power both the hidden form inputs and the getFormData() method.
|
|
840
|
+
*/
|
|
841
|
+
const formOriginal = $derived(original);
|
|
842
|
+
const formCurrent = $derived(value);
|
|
843
|
+
const formComments = $derived(JSON.stringify(threads));
|
|
844
|
+
const formDiff = $derived(exportUnifiedDiff().diff);
|
|
845
|
+
const formSummary = $derived(exportMarkdownSummary().markdown);
|
|
846
|
+
/**
|
|
847
|
+
* Get form data as a structured object.
|
|
848
|
+
* Use this for programmatic access when not using native form submission.
|
|
849
|
+
*
|
|
850
|
+
* @example
|
|
851
|
+
* ```ts
|
|
852
|
+
* const data = editor.getFormData();
|
|
853
|
+
* await fetch('/api/review', {
|
|
854
|
+
* method: 'POST',
|
|
855
|
+
* body: JSON.stringify(data)
|
|
856
|
+
* });
|
|
857
|
+
* ```
|
|
858
|
+
*/
|
|
859
|
+
export function getFormData() {
|
|
1090
860
|
return {
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
861
|
+
original: formOriginal,
|
|
862
|
+
current: formCurrent,
|
|
863
|
+
comments: formComments,
|
|
864
|
+
diff: formDiff,
|
|
865
|
+
summary: formSummary,
|
|
1096
866
|
};
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
export function reset(): void {
|
|
867
|
+
}
|
|
868
|
+
/**
|
|
869
|
+
* Reset the editor to its initial state.
|
|
870
|
+
* Reverts content to original and clears all threads.
|
|
871
|
+
*/
|
|
872
|
+
export function reset() {
|
|
1104
873
|
// Revert content
|
|
1105
874
|
value = original;
|
|
1106
875
|
onchange?.(original);
|
|
1107
|
-
|
|
1108
876
|
// Clear all threads
|
|
1109
877
|
for (const thread of threads) {
|
|
1110
|
-
|
|
878
|
+
onthreaddelete?.({ threadId: thread.id });
|
|
1111
879
|
}
|
|
1112
|
-
|
|
1113
880
|
// Clear UI state
|
|
1114
881
|
popoverThreadId = null;
|
|
1115
882
|
popoverPosition = null;
|
|
@@ -1118,471 +885,401 @@
|
|
|
1118
885
|
selectionPopoverPosition = null;
|
|
1119
886
|
capturedSelectionForPopover = null;
|
|
1120
887
|
selectionPopoverExpanded = false;
|
|
1121
|
-
|
|
1122
888
|
announce('Review reset');
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
*/
|
|
1138
|
-
function handleSelectionComment(body: string): void {
|
|
889
|
+
}
|
|
890
|
+
// =========================================================================
|
|
891
|
+
// Selection Popover Handlers
|
|
892
|
+
// =========================================================================
|
|
893
|
+
/**
|
|
894
|
+
* Handle the comment submission from the selection popover.
|
|
895
|
+
* Creates a new thread at the captured selection using currentUserId as author.
|
|
896
|
+
*
|
|
897
|
+
* We use capturedSelectionForPopover instead of currentSelection because
|
|
898
|
+
* clicking the popover button collapses the browser selection before this runs.
|
|
899
|
+
*
|
|
900
|
+
* @param body - The comment body from the selection popover form
|
|
901
|
+
*/
|
|
902
|
+
function handleSelectionComment(body) {
|
|
1139
903
|
// Helper to clear popover state and announce failure
|
|
1140
|
-
function failWithMessage(message
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
904
|
+
function failWithMessage(message) {
|
|
905
|
+
devWarn(message);
|
|
906
|
+
selectionPopoverPosition = null;
|
|
907
|
+
capturedSelectionForPopover = null;
|
|
908
|
+
selectionPopoverExpanded = false;
|
|
909
|
+
announce('Could not add comment. Please try selecting text again.', 'assertive');
|
|
1146
910
|
}
|
|
1147
|
-
|
|
1148
911
|
if (!currentUserId) {
|
|
1149
|
-
|
|
1150
|
-
|
|
912
|
+
failWithMessage('Cannot create comment: no currentUserId set');
|
|
913
|
+
return;
|
|
1151
914
|
}
|
|
1152
|
-
|
|
1153
915
|
// Use captured selection - clicking the popover collapses browser selection
|
|
1154
916
|
if (!capturedSelectionForPopover) {
|
|
1155
|
-
|
|
1156
|
-
|
|
917
|
+
failWithMessage('Cannot create comment: no captured selection');
|
|
918
|
+
return;
|
|
1157
919
|
}
|
|
1158
|
-
|
|
1159
920
|
if (mode === 'readonly') {
|
|
1160
|
-
|
|
1161
|
-
|
|
921
|
+
failWithMessage('Cannot create thread: editor is readonly');
|
|
922
|
+
return;
|
|
1162
923
|
}
|
|
1163
|
-
|
|
1164
924
|
const view = editorRef?.getView();
|
|
1165
925
|
if (!view) {
|
|
1166
|
-
|
|
1167
|
-
|
|
926
|
+
failWithMessage('Cannot create thread: editor view not available');
|
|
927
|
+
return;
|
|
1168
928
|
}
|
|
1169
|
-
|
|
1170
929
|
const { from, to } = capturedSelectionForPopover;
|
|
1171
|
-
|
|
1172
930
|
// Validate positions are still within document bounds
|
|
1173
931
|
// User may have edited the document while popover was expanded
|
|
1174
932
|
const docSize = view.state.doc.content.size;
|
|
1175
933
|
if (from < 0 || to > docSize || from > to) {
|
|
1176
|
-
|
|
1177
|
-
|
|
934
|
+
failWithMessage('Cannot create thread: captured selection is out of bounds');
|
|
935
|
+
return;
|
|
1178
936
|
}
|
|
1179
|
-
|
|
1180
937
|
// Build anchor using shared helper
|
|
1181
|
-
const anchor = bodyAnchorToDocumentAnchor(
|
|
1182
|
-
buildAnchorFromSelection(view, from, to),
|
|
1183
|
-
currentDocument.bodyOffset,
|
|
1184
|
-
value,
|
|
1185
|
-
);
|
|
1186
|
-
|
|
938
|
+
const anchor = bodyAnchorToDocumentAnchor(buildAnchorFromSelection(view, from, to), currentDocument.bodyOffset, value);
|
|
1187
939
|
// Generate requestId for correlating optimistic updates
|
|
1188
940
|
const requestId = generateId();
|
|
1189
|
-
|
|
1190
941
|
// Extract @mentions from the comment body
|
|
1191
942
|
const mentions = extractMentions(body);
|
|
1192
|
-
|
|
1193
943
|
// Fire the create event with the comment body
|
|
1194
|
-
const event
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
944
|
+
const event = {
|
|
945
|
+
requestId,
|
|
946
|
+
anchor,
|
|
947
|
+
body,
|
|
948
|
+
authorId: currentUserId,
|
|
949
|
+
mentions: mentions.length > 0 ? mentions : undefined,
|
|
1200
950
|
};
|
|
1201
951
|
onthreadcreate?.(event);
|
|
1202
|
-
|
|
1203
952
|
// Clear state
|
|
1204
953
|
capturedSelectionForPopover = null;
|
|
1205
954
|
selectionPopoverPosition = null;
|
|
1206
955
|
selectionPopoverExpanded = false;
|
|
1207
|
-
|
|
1208
956
|
announce('Comment added');
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
function handleSelectionPopoverExpand(): void {
|
|
957
|
+
}
|
|
958
|
+
/**
|
|
959
|
+
* Handle the selection popover expanding to show the comment form.
|
|
960
|
+
* This keeps the popover visible even when the browser selection collapses.
|
|
961
|
+
*/
|
|
962
|
+
function handleSelectionPopoverExpand() {
|
|
1216
963
|
selectionPopoverExpanded = true;
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
function handleSelectionPopoverCancel(): void {
|
|
964
|
+
}
|
|
965
|
+
/**
|
|
966
|
+
* Handle the selection popover cancel action.
|
|
967
|
+
* Resets expanded state so new selections can be processed.
|
|
968
|
+
*/
|
|
969
|
+
function handleSelectionPopoverCancel() {
|
|
1224
970
|
selectionPopoverExpanded = false;
|
|
1225
971
|
// Keep position and captured selection so user can re-expand if they want
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
function handleSelectionPopoverClose(): void {
|
|
972
|
+
}
|
|
973
|
+
/**
|
|
974
|
+
* Close the selection popover.
|
|
975
|
+
*/
|
|
976
|
+
function handleSelectionPopoverClose() {
|
|
1232
977
|
selectionPopoverPosition = null;
|
|
1233
978
|
capturedSelectionForPopover = null;
|
|
1234
979
|
selectionPopoverExpanded = false;
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
*/
|
|
1252
|
-
export function createThread(body: string, authorId: string): string | null {
|
|
980
|
+
}
|
|
981
|
+
// =========================================================================
|
|
982
|
+
// Thread Operations
|
|
983
|
+
// =========================================================================
|
|
984
|
+
/**
|
|
985
|
+
* Create a new thread at the current selection.
|
|
986
|
+
* Requires non-collapsed selection in edit or comment mode.
|
|
987
|
+
*
|
|
988
|
+
* Returns requestId for correlating with backend response, or null if creation failed.
|
|
989
|
+
*
|
|
990
|
+
* No-op (returns null) if:
|
|
991
|
+
* - No text is selected (collapsed selection)
|
|
992
|
+
* - Editor is in readonly mode
|
|
993
|
+
* - Editor view is not available
|
|
994
|
+
*/
|
|
995
|
+
export function createThread(body, authorId) {
|
|
1253
996
|
if (!currentSelection || currentSelection.isCollapsed) {
|
|
1254
|
-
|
|
1255
|
-
|
|
997
|
+
devWarn('Cannot create thread: no text selected');
|
|
998
|
+
return null;
|
|
1256
999
|
}
|
|
1257
|
-
|
|
1258
1000
|
if (mode === 'readonly') {
|
|
1259
|
-
|
|
1260
|
-
|
|
1001
|
+
devWarn('Cannot create thread: editor is readonly');
|
|
1002
|
+
return null;
|
|
1261
1003
|
}
|
|
1262
|
-
|
|
1263
1004
|
const view = editorRef?.getView();
|
|
1264
1005
|
if (!view) {
|
|
1265
|
-
|
|
1266
|
-
|
|
1006
|
+
devWarn('Cannot create thread: editor view not available');
|
|
1007
|
+
return null;
|
|
1267
1008
|
}
|
|
1268
|
-
|
|
1269
1009
|
const { from, to } = currentSelection;
|
|
1270
|
-
|
|
1271
1010
|
// Build anchor using shared helper
|
|
1272
|
-
const anchor = bodyAnchorToDocumentAnchor(
|
|
1273
|
-
buildAnchorFromSelection(view, from, to),
|
|
1274
|
-
currentDocument.bodyOffset,
|
|
1275
|
-
value,
|
|
1276
|
-
);
|
|
1277
|
-
|
|
1011
|
+
const anchor = bodyAnchorToDocumentAnchor(buildAnchorFromSelection(view, from, to), currentDocument.bodyOffset, value);
|
|
1278
1012
|
// Extract mentions from comment body
|
|
1279
1013
|
const mentions = extractMentions(body);
|
|
1280
|
-
|
|
1281
1014
|
// Generate requestId for correlating optimistic updates
|
|
1282
1015
|
const requestId = generateId();
|
|
1283
|
-
|
|
1284
1016
|
// Fire the create event (parent handles actual thread creation)
|
|
1285
|
-
const event
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1017
|
+
const event = {
|
|
1018
|
+
requestId,
|
|
1019
|
+
anchor,
|
|
1020
|
+
body,
|
|
1021
|
+
authorId,
|
|
1022
|
+
mentions: mentions.length > 0 ? mentions : undefined,
|
|
1291
1023
|
};
|
|
1292
1024
|
onthreadcreate?.(event);
|
|
1293
|
-
|
|
1294
1025
|
announce('Comment added');
|
|
1295
1026
|
return requestId;
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
export function createDocumentThread(body: string, authorId: string): string | null {
|
|
1027
|
+
}
|
|
1028
|
+
/**
|
|
1029
|
+
* Create a document-level comment thread.
|
|
1030
|
+
*
|
|
1031
|
+
* Document-level comments are not anchored to specific text but apply to
|
|
1032
|
+
* the entire document. They appear at the top of the comment sidebar.
|
|
1033
|
+
*
|
|
1034
|
+
* Returns requestId for correlating with backend response, or null if creation failed.
|
|
1035
|
+
*/
|
|
1036
|
+
export function createDocumentThread(body, authorId) {
|
|
1307
1037
|
if (mode === 'readonly') {
|
|
1308
|
-
|
|
1309
|
-
|
|
1038
|
+
devWarn('Cannot create thread: editor is readonly');
|
|
1039
|
+
return null;
|
|
1310
1040
|
}
|
|
1311
|
-
|
|
1312
1041
|
// Create document-level anchor
|
|
1313
1042
|
const anchor = createDocumentAnchor();
|
|
1314
|
-
|
|
1315
1043
|
// Extract mentions from comment body
|
|
1316
1044
|
const mentions = extractMentions(body);
|
|
1317
|
-
|
|
1318
1045
|
// Generate requestId for correlating optimistic updates
|
|
1319
1046
|
const requestId = generateId();
|
|
1320
|
-
|
|
1321
1047
|
// Fire the create event (parent handles actual thread creation)
|
|
1322
|
-
const event
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1048
|
+
const event = {
|
|
1049
|
+
requestId,
|
|
1050
|
+
anchor,
|
|
1051
|
+
body,
|
|
1052
|
+
authorId,
|
|
1053
|
+
mentions: mentions.length > 0 ? mentions : undefined,
|
|
1328
1054
|
};
|
|
1329
1055
|
onthreadcreate?.(event);
|
|
1330
|
-
|
|
1331
1056
|
announce('Document comment added');
|
|
1332
1057
|
return requestId;
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1058
|
+
}
|
|
1059
|
+
/**
|
|
1060
|
+
* Delete a thread.
|
|
1061
|
+
*
|
|
1062
|
+
* Silently returns without emitting an event if:
|
|
1063
|
+
* - Editor is in readonly mode (mode === 'readonly')
|
|
1064
|
+
* - Thread does not exist
|
|
1065
|
+
*
|
|
1066
|
+
* This silent no-op behavior supports declarative UI patterns where callers
|
|
1067
|
+
* don't need to pre-check conditions before calling mutation methods.
|
|
1068
|
+
*/
|
|
1069
|
+
export function deleteThread(threadId) {
|
|
1070
|
+
if (mode === 'readonly')
|
|
1071
|
+
return;
|
|
1348
1072
|
const thread = threads.find((t) => t.id === threadId);
|
|
1349
|
-
if (!thread)
|
|
1350
|
-
|
|
1073
|
+
if (!thread)
|
|
1074
|
+
return;
|
|
1351
1075
|
onthreaddelete?.({ threadId });
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
if (threads.length === 0)
|
|
1366
|
-
|
|
1076
|
+
}
|
|
1077
|
+
/**
|
|
1078
|
+
* Delete all threads (clear all comments).
|
|
1079
|
+
*
|
|
1080
|
+
* Silently does nothing if:
|
|
1081
|
+
* - Editor is in readonly mode (mode === 'readonly')
|
|
1082
|
+
* - No threads exist
|
|
1083
|
+
*
|
|
1084
|
+
* Fires onthreaddelete for each thread.
|
|
1085
|
+
*/
|
|
1086
|
+
export function clearAllThreads() {
|
|
1087
|
+
if (mode === 'readonly')
|
|
1088
|
+
return;
|
|
1089
|
+
if (threads.length === 0)
|
|
1090
|
+
return;
|
|
1367
1091
|
// Fire delete event for each thread
|
|
1368
1092
|
for (const thread of threads) {
|
|
1369
|
-
|
|
1093
|
+
onthreaddelete?.({ threadId: thread.id });
|
|
1370
1094
|
}
|
|
1371
|
-
|
|
1372
1095
|
// Clear any active selection state
|
|
1373
1096
|
popoverThreadId = null;
|
|
1374
1097
|
popoverPosition = null;
|
|
1375
1098
|
activeThreadId = null;
|
|
1376
|
-
|
|
1377
1099
|
announce('All comments cleared');
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
if (mode === 'readonly') return null;
|
|
1398
|
-
|
|
1100
|
+
}
|
|
1101
|
+
// =========================================================================
|
|
1102
|
+
// Comment Operations
|
|
1103
|
+
// =========================================================================
|
|
1104
|
+
/**
|
|
1105
|
+
* Create a new comment in an existing thread.
|
|
1106
|
+
*
|
|
1107
|
+
* @returns requestId for correlating with backend response, or null if creation was blocked
|
|
1108
|
+
*
|
|
1109
|
+
* Silently returns null without emitting an event if:
|
|
1110
|
+
* - Editor is in readonly mode (mode === 'readonly')
|
|
1111
|
+
* - Thread does not exist
|
|
1112
|
+
*
|
|
1113
|
+
* This silent no-op behavior supports declarative UI patterns where callers
|
|
1114
|
+
* don't need to pre-check conditions before calling mutation methods.
|
|
1115
|
+
*/
|
|
1116
|
+
export function createComment(threadId, body, authorId) {
|
|
1117
|
+
if (mode === 'readonly')
|
|
1118
|
+
return null;
|
|
1399
1119
|
const thread = threads.find((t) => t.id === threadId);
|
|
1400
|
-
if (!thread)
|
|
1401
|
-
|
|
1120
|
+
if (!thread)
|
|
1121
|
+
return null;
|
|
1402
1122
|
const mentions = extractMentions(body);
|
|
1403
1123
|
const requestId = generateId();
|
|
1404
|
-
|
|
1405
1124
|
oncommentcreate?.({
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1125
|
+
requestId,
|
|
1126
|
+
threadId,
|
|
1127
|
+
body,
|
|
1128
|
+
authorId,
|
|
1129
|
+
mentions: mentions.length > 0 ? mentions : undefined,
|
|
1411
1130
|
});
|
|
1412
|
-
|
|
1413
1131
|
announce('Comment added');
|
|
1414
1132
|
return requestId;
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1133
|
+
}
|
|
1134
|
+
/**
|
|
1135
|
+
* Update an existing comment.
|
|
1136
|
+
*
|
|
1137
|
+
* Silently returns without emitting an event if:
|
|
1138
|
+
* - Editor is in readonly mode (mode === 'readonly')
|
|
1139
|
+
* - Thread or comment does not exist
|
|
1140
|
+
* - Comment is soft-deleted
|
|
1141
|
+
*
|
|
1142
|
+
* This silent no-op behavior supports declarative UI patterns where callers
|
|
1143
|
+
* don't need to pre-check conditions before calling mutation methods.
|
|
1144
|
+
*/
|
|
1145
|
+
export function updateComment(threadId, commentId, body) {
|
|
1146
|
+
if (mode === 'readonly')
|
|
1147
|
+
return;
|
|
1431
1148
|
const thread = threads.find((t) => t.id === threadId);
|
|
1432
1149
|
const comment = thread?.comments.find((c) => c.id === commentId);
|
|
1433
|
-
if (!comment || comment.deletedAt)
|
|
1434
|
-
|
|
1150
|
+
if (!comment || comment.deletedAt)
|
|
1151
|
+
return;
|
|
1435
1152
|
const mentions = extractMentions(body);
|
|
1436
|
-
|
|
1437
1153
|
oncommentupdate?.({
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1154
|
+
threadId,
|
|
1155
|
+
commentId,
|
|
1156
|
+
body,
|
|
1157
|
+
mentions: mentions.length > 0 ? mentions : undefined,
|
|
1442
1158
|
});
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1159
|
+
}
|
|
1160
|
+
/**
|
|
1161
|
+
* Delete a comment.
|
|
1162
|
+
*
|
|
1163
|
+
* Silently returns without emitting an event if:
|
|
1164
|
+
* - Editor is in readonly mode (mode === 'readonly')
|
|
1165
|
+
* - Thread or comment does not exist
|
|
1166
|
+
* - Soft delete is requested but comment is already soft-deleted
|
|
1167
|
+
*
|
|
1168
|
+
* This silent no-op behavior supports declarative UI patterns where callers
|
|
1169
|
+
* don't need to pre-check conditions before calling mutation methods.
|
|
1170
|
+
*
|
|
1171
|
+
* @param soft - If true (default), sets deletedAt for soft delete. If false, requests hard delete.
|
|
1172
|
+
*/
|
|
1173
|
+
export function deleteComment(threadId, commentId, soft = true) {
|
|
1174
|
+
if (mode === 'readonly')
|
|
1175
|
+
return;
|
|
1461
1176
|
const thread = threads.find((t) => t.id === threadId);
|
|
1462
1177
|
const comment = thread?.comments.find((c) => c.id === commentId);
|
|
1463
|
-
if (!comment || (soft && comment.deletedAt))
|
|
1464
|
-
|
|
1178
|
+
if (!comment || (soft && comment.deletedAt))
|
|
1179
|
+
return;
|
|
1465
1180
|
oncommentdelete?.({ threadId, commentId, soft });
|
|
1466
1181
|
announce('Comment deleted');
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
*/
|
|
1484
|
-
export function createBlockThread(body: string, authorId: string): string | null {
|
|
1182
|
+
}
|
|
1183
|
+
// =========================================================================
|
|
1184
|
+
// Block-Level Thread Creation
|
|
1185
|
+
// =========================================================================
|
|
1186
|
+
/**
|
|
1187
|
+
* Create a thread anchored to the block containing the cursor.
|
|
1188
|
+
* Works even with a collapsed selection (no text selected).
|
|
1189
|
+
*
|
|
1190
|
+
* Returns requestId for correlating with backend response, or null if creation failed.
|
|
1191
|
+
*
|
|
1192
|
+
* No-op (returns null) if:
|
|
1193
|
+
* - Editor is in readonly mode
|
|
1194
|
+
* - Editor view is not available
|
|
1195
|
+
* - Cursor is not inside a block
|
|
1196
|
+
*/
|
|
1197
|
+
export function createBlockThread(body, authorId) {
|
|
1485
1198
|
if (mode === 'readonly') {
|
|
1486
|
-
|
|
1487
|
-
|
|
1199
|
+
devWarn('Cannot create block thread: editor is readonly');
|
|
1200
|
+
return null;
|
|
1488
1201
|
}
|
|
1489
|
-
|
|
1490
1202
|
const view = editorRef?.getView();
|
|
1491
1203
|
if (!view) {
|
|
1492
|
-
|
|
1493
|
-
|
|
1204
|
+
devWarn('Cannot create block thread: editor view not available');
|
|
1205
|
+
return null;
|
|
1494
1206
|
}
|
|
1495
|
-
|
|
1496
1207
|
const { from } = view.state.selection;
|
|
1497
1208
|
const resolvedPos = view.state.doc.resolve(from);
|
|
1498
|
-
|
|
1499
1209
|
// Find the nearest block-level node
|
|
1500
1210
|
for (let depth = resolvedPos.depth; depth > 0; depth--) {
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
requestId,
|
|
1522
|
-
anchor,
|
|
1523
|
-
body,
|
|
1524
|
-
authorId,
|
|
1525
|
-
mentions: mentions.length > 0 ? mentions : undefined,
|
|
1526
|
-
});
|
|
1527
|
-
|
|
1528
|
-
return requestId;
|
|
1211
|
+
const node = resolvedPos.node(depth);
|
|
1212
|
+
if (!node.isBlock)
|
|
1213
|
+
continue;
|
|
1214
|
+
// Get the block's inner positions (content bounds)
|
|
1215
|
+
const blockFrom = resolvedPos.start(depth);
|
|
1216
|
+
const blockTo = resolvedPos.end(depth);
|
|
1217
|
+
// Build anchor for the entire block
|
|
1218
|
+
const anchor = bodyAnchorToDocumentAnchor(buildAnchorFromSelection(view, blockFrom, blockTo), currentDocument.bodyOffset, value);
|
|
1219
|
+
// Extract mentions and generate requestId
|
|
1220
|
+
const mentions = extractMentions(body);
|
|
1221
|
+
const requestId = generateId();
|
|
1222
|
+
// Fire the create event
|
|
1223
|
+
onthreadcreate?.({
|
|
1224
|
+
requestId,
|
|
1225
|
+
anchor,
|
|
1226
|
+
body,
|
|
1227
|
+
authorId,
|
|
1228
|
+
mentions: mentions.length > 0 ? mentions : undefined,
|
|
1229
|
+
});
|
|
1230
|
+
return requestId;
|
|
1529
1231
|
}
|
|
1530
|
-
|
|
1531
1232
|
devWarn('Cannot create block thread: cursor not inside a block');
|
|
1532
1233
|
return null;
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
*/
|
|
1543
|
-
const focusRegions: FocusRegion[] = [
|
|
1234
|
+
}
|
|
1235
|
+
// =========================================================================
|
|
1236
|
+
// Keyboard Navigation (F6 Landmark Navigation)
|
|
1237
|
+
// =========================================================================
|
|
1238
|
+
/**
|
|
1239
|
+
* Focus regions for F6 navigation.
|
|
1240
|
+
* The 'popover' region is conditionally included when a thread popover is open.
|
|
1241
|
+
*/
|
|
1242
|
+
const focusRegions = [
|
|
1544
1243
|
{ id: 'editor', selector: '.review-editor-main', label: 'Editor' },
|
|
1545
1244
|
{ id: 'popover', selector: '.thread-popover', label: 'Thread' },
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
const focusNavigator = createFocusRegionNavigator(focusRegions, {
|
|
1245
|
+
];
|
|
1246
|
+
/**
|
|
1247
|
+
* Focus region navigator with conditional popover inclusion and custom editor focus.
|
|
1248
|
+
*/
|
|
1249
|
+
const focusNavigator = createFocusRegionNavigator(focusRegions, {
|
|
1552
1250
|
// Only include popover region when a thread popover is actually open
|
|
1553
1251
|
isRegionActive: (region) => {
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1252
|
+
if (region.id === 'popover') {
|
|
1253
|
+
return popoverThread !== null;
|
|
1254
|
+
}
|
|
1255
|
+
return true;
|
|
1558
1256
|
},
|
|
1559
1257
|
// Custom focus handler for the editor region (ProseMirror needs special handling)
|
|
1560
1258
|
customFocusHandler: (region) => {
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1259
|
+
if (region.id === 'editor') {
|
|
1260
|
+
editorRef?.getView()?.focus();
|
|
1261
|
+
return true; // Handled
|
|
1262
|
+
}
|
|
1263
|
+
return false; // Use default behavior
|
|
1566
1264
|
},
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1265
|
+
});
|
|
1266
|
+
/**
|
|
1267
|
+
* Handle F6 keyboard navigation between regions.
|
|
1268
|
+
* Uses event.currentTarget to scope navigation to this specific editor instance,
|
|
1269
|
+
* supporting multiple ReviewEditor instances on the same page.
|
|
1270
|
+
*/
|
|
1271
|
+
function handleContainerKeyDown(event) {
|
|
1272
|
+
if (event.key !== 'F6')
|
|
1273
|
+
return;
|
|
1577
1274
|
// Use currentTarget (the element with the listener) to get this specific editor container
|
|
1578
1275
|
const container = event.currentTarget;
|
|
1579
|
-
if (!(container instanceof HTMLElement))
|
|
1580
|
-
|
|
1276
|
+
if (!(container instanceof HTMLElement))
|
|
1277
|
+
return;
|
|
1581
1278
|
event.preventDefault();
|
|
1582
1279
|
const current = focusNavigator.getCurrentRegion(container);
|
|
1583
1280
|
const next = focusNavigator.getNextRegion(current, event.shiftKey);
|
|
1584
1281
|
focusNavigator.focusRegion(container, next);
|
|
1585
|
-
|
|
1282
|
+
}
|
|
1586
1283
|
</script>
|
|
1587
1284
|
|
|
1588
1285
|
<!-- Export actions snippet for passing to controls -->
|