@cardstack/boxel-cli 0.2.0 → 0.3.0-unstable.13
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/bundled-types/base/-private.d.ts +1 -0
- package/bundled-types/base/address.d.ts +17 -0
- package/bundled-types/base/ai-app-generator.d.ts +14 -0
- package/bundled-types/base/amount-with-currency.d.ts +10 -0
- package/bundled-types/base/avif-image-def.d.ts +12 -0
- package/bundled-types/base/avif-meta-extractor.d.ts +4 -0
- package/bundled-types/base/base64-image.d.ts +25 -0
- package/bundled-types/base/big-integer.d.ts +12 -0
- package/bundled-types/base/boolean.d.ts +14 -0
- package/bundled-types/base/brand-functional-palette.d.ts +16 -0
- package/bundled-types/base/brand-guide.d.ts +26 -0
- package/bundled-types/base/brand-logo.d.ts +29 -0
- package/bundled-types/base/card-api.d.ts +513 -0
- package/bundled-types/base/card-serialization.d.ts +47 -0
- package/bundled-types/base/cards-grid.d.ts +10 -0
- package/bundled-types/base/code-ref.d.ts +14 -0
- package/bundled-types/base/codemirror-editor.d.ts +135 -0
- package/bundled-types/base/color-field/components/advanced-color-picker.d.ts +66 -0
- package/bundled-types/base/color-field/components/color-picker-field.d.ts +22 -0
- package/bundled-types/base/color-field/components/color-wheel-picker.d.ts +44 -0
- package/bundled-types/base/color-field/components/contrast-checker-addon.d.ts +14 -0
- package/bundled-types/base/color-field/components/recent-colors-addon.d.ts +19 -0
- package/bundled-types/base/color-field/components/slider-picker.d.ts +40 -0
- package/bundled-types/base/color-field/components/swatches-picker.d.ts +5 -0
- package/bundled-types/base/color-field/modifiers/setup-element-modifier.d.ts +10 -0
- package/bundled-types/base/color-field/util/color-field-signature.d.ts +9 -0
- package/bundled-types/base/color-field/util/color-utils.d.ts +96 -0
- package/bundled-types/base/color-field/util/css-color-parsers.d.ts +11 -0
- package/bundled-types/base/color.d.ts +10 -0
- package/bundled-types/base/command.d.ts +593 -0
- package/bundled-types/base/commands/search-card-result.d.ts +36 -0
- package/bundled-types/base/components/age.d.ts +22 -0
- package/bundled-types/base/components/business-days.d.ts +16 -0
- package/bundled-types/base/components/card-list.d.ts +25 -0
- package/bundled-types/base/components/cards-grid-layout.d.ts +58 -0
- package/bundled-types/base/components/countdown.d.ts +31 -0
- package/bundled-types/base/components/expiration-warning.d.ts +24 -0
- package/bundled-types/base/components/time-ago.d.ts +24 -0
- package/bundled-types/base/components/time-slots.d.ts +20 -0
- package/bundled-types/base/components/timeline.d.ts +22 -0
- package/bundled-types/base/contains-many-component.d.ts +7 -0
- package/bundled-types/base/coordinate.d.ts +7 -0
- package/bundled-types/base/country.d.ts +23 -0
- package/bundled-types/base/css-value.d.ts +6 -0
- package/bundled-types/base/csv-file-def.d.ts +29 -0
- package/bundled-types/base/currency.d.ts +16 -0
- package/bundled-types/base/date/day.d.ts +9 -0
- package/bundled-types/base/date/month-day.d.ts +10 -0
- package/bundled-types/base/date/month-year.d.ts +9 -0
- package/bundled-types/base/date/month.d.ts +9 -0
- package/bundled-types/base/date/quarter.d.ts +10 -0
- package/bundled-types/base/date/week.d.ts +9 -0
- package/bundled-types/base/date/year.d.ts +9 -0
- package/bundled-types/base/date-range-field.d.ts +12 -0
- package/bundled-types/base/date.d.ts +12 -0
- package/bundled-types/base/datetime-stamp.d.ts +7 -0
- package/bundled-types/base/datetime.d.ts +12 -0
- package/bundled-types/base/default-templates/atom.d.ts +10 -0
- package/bundled-types/base/default-templates/card-info.d.ts +32 -0
- package/bundled-types/base/default-templates/embedded.d.ts +11 -0
- package/bundled-types/base/default-templates/field-edit.d.ts +10 -0
- package/bundled-types/base/default-templates/file-def-edit.d.ts +8 -0
- package/bundled-types/base/default-templates/fitted.d.ts +12 -0
- package/bundled-types/base/default-templates/head.d.ts +13 -0
- package/bundled-types/base/default-templates/image-def-atom.d.ts +8 -0
- package/bundled-types/base/default-templates/image-def-embedded.d.ts +8 -0
- package/bundled-types/base/default-templates/image-def-fitted.d.ts +8 -0
- package/bundled-types/base/default-templates/image-def-isolated.d.ts +8 -0
- package/bundled-types/base/default-templates/isolated-and-edit.d.ts +15 -0
- package/bundled-types/base/default-templates/markdown-fallback.d.ts +19 -0
- package/bundled-types/base/default-templates/markdown.d.ts +60 -0
- package/bundled-types/base/default-templates/missing-template.d.ts +13 -0
- package/bundled-types/base/default-templates/theme-dashboard.d.ts +126 -0
- package/bundled-types/base/detailed-style-reference.d.ts +48 -0
- package/bundled-types/base/email.d.ts +10 -0
- package/bundled-types/base/enum.d.ts +30 -0
- package/bundled-types/base/ethereum-address.d.ts +13 -0
- package/bundled-types/base/field-component.d.ts +65 -0
- package/bundled-types/base/field-support.d.ts +55 -0
- package/bundled-types/base/file-api.d.ts +2 -0
- package/bundled-types/base/file-menu-items.d.ts +4 -0
- package/bundled-types/base/gif-image-def.d.ts +12 -0
- package/bundled-types/base/gif-meta-extractor.d.ts +4 -0
- package/bundled-types/base/gts-file-def.d.ts +7 -0
- package/bundled-types/base/helpers/country.d.ts +3198 -0
- package/bundled-types/base/helpers/sanitized-html.d.ts +2 -0
- package/bundled-types/base/helpers/set-background-image.d.ts +2 -0
- package/bundled-types/base/image-file-def.d.ts +1 -0
- package/bundled-types/base/image.d.ts +8 -0
- package/bundled-types/base/index.d.ts +1 -0
- package/bundled-types/base/join-the-community.d.ts +14 -0
- package/bundled-types/base/jpg-image-def.d.ts +12 -0
- package/bundled-types/base/jpg-meta-extractor.d.ts +4 -0
- package/bundled-types/base/json-file-def.d.ts +23 -0
- package/bundled-types/base/links-to-editor.d.ts +22 -0
- package/bundled-types/base/links-to-many-component.d.ts +7 -0
- package/bundled-types/base/llm-model.d.ts +6 -0
- package/bundled-types/base/markdown-file-def.d.ts +25 -0
- package/bundled-types/base/markdown-helpers.d.ts +26 -0
- package/bundled-types/base/markdown.d.ts +1 -0
- package/bundled-types/base/matrix-event.d.ts +400 -0
- package/bundled-types/base/menu-items.d.ts +21 -0
- package/bundled-types/base/number/components/badge-counter.d.ts +32 -0
- package/bundled-types/base/number/components/badge-metric.d.ts +34 -0
- package/bundled-types/base/number/components/badge-notification.d.ts +38 -0
- package/bundled-types/base/number/components/gauge.d.ts +45 -0
- package/bundled-types/base/number/components/number-input.d.ts +27 -0
- package/bundled-types/base/number/components/progress-bar.d.ts +44 -0
- package/bundled-types/base/number/components/progress-circle.d.ts +41 -0
- package/bundled-types/base/number/components/score.d.ts +41 -0
- package/bundled-types/base/number/components/stat.d.ts +38 -0
- package/bundled-types/base/number/util/index.d.ts +29 -0
- package/bundled-types/base/number.d.ts +52 -0
- package/bundled-types/base/percentage.d.ts +9 -0
- package/bundled-types/base/phone-number.d.ts +25 -0
- package/bundled-types/base/png-image-def.d.ts +12 -0
- package/bundled-types/base/png-meta-extractor.d.ts +4 -0
- package/bundled-types/base/positioned-card.d.ts +7 -0
- package/bundled-types/base/query-field-support.d.ts +6 -0
- package/bundled-types/base/realm-config.d.ts +16 -0
- package/bundled-types/base/realm.d.ts +7 -0
- package/bundled-types/base/resources/command-data.d.ts +43 -0
- package/bundled-types/base/response-field.d.ts +6 -0
- package/bundled-types/base/rich-markdown.d.ts +30 -0
- package/bundled-types/base/shared-state.d.ts +1 -0
- package/bundled-types/base/skill-plus.d.ts +79 -0
- package/bundled-types/base/skill-reference.d.ts +12 -0
- package/bundled-types/base/skill-set.d.ts +18 -0
- package/bundled-types/base/skill.d.ts +21 -0
- package/bundled-types/base/spec.d.ts +108 -0
- package/bundled-types/base/string.d.ts +2 -0
- package/bundled-types/base/structured-theme-variables.d.ts +85 -0
- package/bundled-types/base/structured-theme.d.ts +32 -0
- package/bundled-types/base/style-reference.d.ts +14 -0
- package/bundled-types/base/svg-image-def.d.ts +12 -0
- package/bundled-types/base/svg-meta-extractor.d.ts +12 -0
- package/bundled-types/base/system-card.d.ts +17 -0
- package/bundled-types/base/tag.d.ts +15 -0
- package/bundled-types/base/text-area.d.ts +2 -0
- package/bundled-types/base/text-file-def.d.ts +23 -0
- package/bundled-types/base/text-input-validator.d.ts +13 -0
- package/bundled-types/base/theme.d.ts +2 -0
- package/bundled-types/base/time/duration.d.ts +14 -0
- package/bundled-types/base/time/relative-time.d.ts +10 -0
- package/bundled-types/base/time/time-range.d.ts +11 -0
- package/bundled-types/base/time.d.ts +9 -0
- package/bundled-types/base/ts-file-def.d.ts +26 -0
- package/bundled-types/base/ts-highlight.d.ts +1 -0
- package/bundled-types/base/types/@cardstack/boxel-host/index.d.ts +5 -0
- package/bundled-types/base/types/ember-css-url/index.d.ts +15 -0
- package/bundled-types/base/typography.d.ts +14 -0
- package/bundled-types/base/url.d.ts +13 -0
- package/bundled-types/base/watched-array.d.ts +7 -0
- package/bundled-types/base/webp-image-def.d.ts +12 -0
- package/bundled-types/base/webp-meta-extractor.d.ts +4 -0
- package/bundled-types/base/website.d.ts +8 -0
- package/bundled-types/base/welcome-to-boxel.d.ts +22 -0
- package/bundled-types/boxel-ui/components/accordion/index.gts +50 -0
- package/bundled-types/boxel-ui/components/accordion/item/index.gts +156 -0
- package/bundled-types/boxel-ui/components/accordion/usage.gts +157 -0
- package/bundled-types/boxel-ui/components/add-button/index.gts +46 -0
- package/bundled-types/boxel-ui/components/add-button/usage.gts +54 -0
- package/bundled-types/boxel-ui/components/alert/index.gts +151 -0
- package/bundled-types/boxel-ui/components/alert/usage.gts +66 -0
- package/bundled-types/boxel-ui/components/avatar/index.gts +79 -0
- package/bundled-types/boxel-ui/components/avatar/usage.gts +96 -0
- package/bundled-types/boxel-ui/components/basic-fitted/index.gts +340 -0
- package/bundled-types/boxel-ui/components/basic-fitted/usage.gts +223 -0
- package/bundled-types/boxel-ui/components/button/index.gts +416 -0
- package/bundled-types/boxel-ui/components/button/usage.gts +334 -0
- package/bundled-types/boxel-ui/components/card-container/index.gts +251 -0
- package/bundled-types/boxel-ui/components/card-container/usage.gts +53 -0
- package/bundled-types/boxel-ui/components/card-header/index.gts +473 -0
- package/bundled-types/boxel-ui/components/card-header/usage.gts +295 -0
- package/bundled-types/boxel-ui/components/circle-spinner/index.gts +42 -0
- package/bundled-types/boxel-ui/components/circle-spinner/usage.gts +48 -0
- package/bundled-types/boxel-ui/components/color-palette/index.gts +134 -0
- package/bundled-types/boxel-ui/components/color-palette/usage.gts +69 -0
- package/bundled-types/boxel-ui/components/color-picker/index.gts +125 -0
- package/bundled-types/boxel-ui/components/color-picker/usage.gts +56 -0
- package/bundled-types/boxel-ui/components/container/index.gts +67 -0
- package/bundled-types/boxel-ui/components/container/usage.gts +59 -0
- package/bundled-types/boxel-ui/components/context-button/index.gts +184 -0
- package/bundled-types/boxel-ui/components/context-button/usage.gts +125 -0
- package/bundled-types/boxel-ui/components/copy-button/index.gts +79 -0
- package/bundled-types/boxel-ui/components/copy-button/usage.gts +25 -0
- package/bundled-types/boxel-ui/components/date-range-picker/index.gts +211 -0
- package/bundled-types/boxel-ui/components/date-range-picker/setup.gts +11 -0
- package/bundled-types/boxel-ui/components/date-range-picker/usage.gts +52 -0
- package/bundled-types/boxel-ui/components/drag-and-drop/index.gts +256 -0
- package/bundled-types/boxel-ui/components/drag-and-drop/usage.gts +142 -0
- package/bundled-types/boxel-ui/components/dropdown/index.gts +478 -0
- package/bundled-types/boxel-ui/components/dropdown/trigger/index.gts +70 -0
- package/bundled-types/boxel-ui/components/dropdown/trigger/usage.gts +54 -0
- package/bundled-types/boxel-ui/components/dropdown/usage.gts +119 -0
- package/bundled-types/boxel-ui/components/email-input/index.gts +111 -0
- package/bundled-types/boxel-ui/components/email-input/usage.gts +75 -0
- package/bundled-types/boxel-ui/components/entity-icon-display/index.gts +144 -0
- package/bundled-types/boxel-ui/components/entity-icon-display/usage.gts +54 -0
- package/bundled-types/boxel-ui/components/entity-thumbnail-display/index.gts +148 -0
- package/bundled-types/boxel-ui/components/entity-thumbnail-display/usage.gts +76 -0
- package/bundled-types/boxel-ui/components/field-container/index.gts +150 -0
- package/bundled-types/boxel-ui/components/field-container/usage.gts +188 -0
- package/bundled-types/boxel-ui/components/filter-list/index.gts +255 -0
- package/bundled-types/boxel-ui/components/filter-list/usage.gts +153 -0
- package/bundled-types/boxel-ui/components/fitted-card-container/index.gts +66 -0
- package/bundled-types/boxel-ui/components/fitted-card-container/usage.gts +81 -0
- package/bundled-types/boxel-ui/components/grid-container/grid-item-container/index.gts +37 -0
- package/bundled-types/boxel-ui/components/grid-container/index.gts +116 -0
- package/bundled-types/boxel-ui/components/grid-container/usage.gts +105 -0
- package/bundled-types/boxel-ui/components/header/index.gts +101 -0
- package/bundled-types/boxel-ui/components/header/usage.gts +116 -0
- package/bundled-types/boxel-ui/components/icon-button/index.gts +148 -0
- package/bundled-types/boxel-ui/components/icon-button/usage.gts +249 -0
- package/bundled-types/boxel-ui/components/input/index.gts +560 -0
- package/bundled-types/boxel-ui/components/input/usage.gts +449 -0
- package/bundled-types/boxel-ui/components/input-group/accessories/index.gts +191 -0
- package/bundled-types/boxel-ui/components/input-group/controls/index.gts +54 -0
- package/bundled-types/boxel-ui/components/input-group/index.gts +347 -0
- package/bundled-types/boxel-ui/components/input-group/usage.gts +437 -0
- package/bundled-types/boxel-ui/components/kanban/card.gts +89 -0
- package/bundled-types/boxel-ui/components/kanban/column-header.gts +151 -0
- package/bundled-types/boxel-ui/components/kanban/drag.gts +1007 -0
- package/bundled-types/boxel-ui/components/kanban/engine.ts +247 -0
- package/bundled-types/boxel-ui/components/kanban/ghost.gts +64 -0
- package/bundled-types/boxel-ui/components/kanban/index.gts +16 -0
- package/bundled-types/boxel-ui/components/kanban/modifiers.gts +42 -0
- package/bundled-types/boxel-ui/components/kanban/plane-inner.gts +525 -0
- package/bundled-types/boxel-ui/components/kanban/plane.gts +163 -0
- package/bundled-types/boxel-ui/components/kanban/usage.gts +392 -0
- package/bundled-types/boxel-ui/components/label/index.gts +64 -0
- package/bundled-types/boxel-ui/components/loading-indicator/index.gts +78 -0
- package/bundled-types/boxel-ui/components/loading-indicator/usage.gts +72 -0
- package/bundled-types/boxel-ui/components/menu/index.gts +267 -0
- package/bundled-types/boxel-ui/components/menu/usage.gts +100 -0
- package/bundled-types/boxel-ui/components/message/index.gts +146 -0
- package/bundled-types/boxel-ui/components/message/usage.gts +263 -0
- package/bundled-types/boxel-ui/components/modal/index.gts +159 -0
- package/bundled-types/boxel-ui/components/modal/usage.gts +206 -0
- package/bundled-types/boxel-ui/components/multi-select/after-options.gts +59 -0
- package/bundled-types/boxel-ui/components/multi-select/index.gts +230 -0
- package/bundled-types/boxel-ui/components/multi-select/selected-item.gts +91 -0
- package/bundled-types/boxel-ui/components/multi-select/trigger.gts +190 -0
- package/bundled-types/boxel-ui/components/multi-select/usage.gts +420 -0
- package/bundled-types/boxel-ui/components/phone-input/index.gts +149 -0
- package/bundled-types/boxel-ui/components/phone-input/usage.gts +73 -0
- package/bundled-types/boxel-ui/components/picker/before-options-with-search.gts +340 -0
- package/bundled-types/boxel-ui/components/picker/index.gts +427 -0
- package/bundled-types/boxel-ui/components/picker/option-row.gts +270 -0
- package/bundled-types/boxel-ui/components/picker/selected-item.gts +171 -0
- package/bundled-types/boxel-ui/components/picker/trigger-labeled.gts +216 -0
- package/bundled-types/boxel-ui/components/picker/usage.gts +179 -0
- package/bundled-types/boxel-ui/components/pill/index.gts +231 -0
- package/bundled-types/boxel-ui/components/pill/usage.gts +230 -0
- package/bundled-types/boxel-ui/components/progress-bar/index.gts +124 -0
- package/bundled-types/boxel-ui/components/progress-bar/usage.gts +131 -0
- package/bundled-types/boxel-ui/components/progress-radial/index.gts +95 -0
- package/bundled-types/boxel-ui/components/progress-radial/usage.gts +79 -0
- package/bundled-types/boxel-ui/components/radio-input/index.gts +143 -0
- package/bundled-types/boxel-ui/components/radio-input/item.gts +210 -0
- package/bundled-types/boxel-ui/components/radio-input/usage.gts +303 -0
- package/bundled-types/boxel-ui/components/realm-icon/index.gts +129 -0
- package/bundled-types/boxel-ui/components/realm-icon/usage.gts +62 -0
- package/bundled-types/boxel-ui/components/resizable-panel-group/handle.gts +180 -0
- package/bundled-types/boxel-ui/components/resizable-panel-group/index.gts +341 -0
- package/bundled-types/boxel-ui/components/resizable-panel-group/panel.gts +86 -0
- package/bundled-types/boxel-ui/components/resizable-panel-group/usage.gts +350 -0
- package/bundled-types/boxel-ui/components/resizable-panel-group/utils/adjust-layout-by-delta.ts +231 -0
- package/bundled-types/boxel-ui/components/resizable-panel-group/utils/assert.ts +10 -0
- package/bundled-types/boxel-ui/components/resizable-panel-group/utils/calculate-delta-percentage.ts +41 -0
- package/bundled-types/boxel-ui/components/resizable-panel-group/utils/calculate-unsafe-default-layout.ts +53 -0
- package/bundled-types/boxel-ui/components/resizable-panel-group/utils/compare-layouts.ts +12 -0
- package/bundled-types/boxel-ui/components/resizable-panel-group/utils/const.ts +6 -0
- package/bundled-types/boxel-ui/components/resizable-panel-group/utils/determine-pivot-indices.ts +15 -0
- package/bundled-types/boxel-ui/components/resizable-panel-group/utils/dom/get-panel-element.ts +10 -0
- package/bundled-types/boxel-ui/components/resizable-panel-group/utils/dom/get-panel-elements-for-group.ts +8 -0
- package/bundled-types/boxel-ui/components/resizable-panel-group/utils/dom/get-panel-group-element.ts +21 -0
- package/bundled-types/boxel-ui/components/resizable-panel-group/utils/dom/get-resize-handle-element-index.ts +14 -0
- package/bundled-types/boxel-ui/components/resizable-panel-group/utils/dom/get-resize-handle-element.ts +12 -0
- package/bundled-types/boxel-ui/components/resizable-panel-group/utils/dom/get-resize-handle-elements-for-group.ts +10 -0
- package/bundled-types/boxel-ui/components/resizable-panel-group/utils/fuzzy-layouts-equal.ts +22 -0
- package/bundled-types/boxel-ui/components/resizable-panel-group/utils/fuzzy-numbers.ts +21 -0
- package/bundled-types/boxel-ui/components/resizable-panel-group/utils/get-resize-event-coordinates.ts +8 -0
- package/bundled-types/boxel-ui/components/resizable-panel-group/utils/get-resize-event-cursor-position.ts +10 -0
- package/bundled-types/boxel-ui/components/resizable-panel-group/utils/panel-resize-handle-registry.ts +446 -0
- package/bundled-types/boxel-ui/components/resizable-panel-group/utils/resize-panel.ts +35 -0
- package/bundled-types/boxel-ui/components/resizable-panel-group/utils/types.ts +23 -0
- package/bundled-types/boxel-ui/components/resizable-panel-group/utils/validate-panel-group-layout.ts +86 -0
- package/bundled-types/boxel-ui/components/select/index.gts +882 -0
- package/bundled-types/boxel-ui/components/select/trigger.gts +132 -0
- package/bundled-types/boxel-ui/components/select/usage.gts +353 -0
- package/bundled-types/boxel-ui/components/skeleton-placeholder/index.gts +89 -0
- package/bundled-types/boxel-ui/components/skeleton-placeholder/usage.gts +102 -0
- package/bundled-types/boxel-ui/components/sort-dropdown/index.gts +91 -0
- package/bundled-types/boxel-ui/components/sort-dropdown/usage.gts +77 -0
- package/bundled-types/boxel-ui/components/swatch/index.gts +81 -0
- package/bundled-types/boxel-ui/components/swatch/usage.gts +57 -0
- package/bundled-types/boxel-ui/components/switch/index.gts +95 -0
- package/bundled-types/boxel-ui/components/switch/usage.gts +79 -0
- package/bundled-types/boxel-ui/components/tabbed-header/index.gts +141 -0
- package/bundled-types/boxel-ui/components/tabbed-header/usage.gts +103 -0
- package/bundled-types/boxel-ui/components/tag/index.gts +50 -0
- package/bundled-types/boxel-ui/components/tag/usage.gts +89 -0
- package/bundled-types/boxel-ui/components/tag-list/index.gts +85 -0
- package/bundled-types/boxel-ui/components/tag-list/usage.gts +129 -0
- package/bundled-types/boxel-ui/components/tooltip/index.gts +306 -0
- package/bundled-types/boxel-ui/components/tooltip/usage.gts +168 -0
- package/bundled-types/boxel-ui/components/view-selector/index.gts +166 -0
- package/bundled-types/boxel-ui/components/view-selector/usage.gts +149 -0
- package/bundled-types/boxel-ui/components.ts +169 -0
- package/bundled-types/boxel-ui/helpers/add-class-to-svg.ts +8 -0
- package/bundled-types/boxel-ui/helpers/clipboard.ts +21 -0
- package/bundled-types/boxel-ui/helpers/cn.ts +12 -0
- package/bundled-types/boxel-ui/helpers/color-tools.ts +331 -0
- package/bundled-types/boxel-ui/helpers/compact.ts +3 -0
- package/bundled-types/boxel-ui/helpers/contrast-color.ts +32 -0
- package/bundled-types/boxel-ui/helpers/css-var.ts +41 -0
- package/bundled-types/boxel-ui/helpers/currency-format.ts +25 -0
- package/bundled-types/boxel-ui/helpers/dayjs-format.ts +27 -0
- package/bundled-types/boxel-ui/helpers/deterministic-color-from-string.ts +45 -0
- package/bundled-types/boxel-ui/helpers/element.ts +16 -0
- package/bundled-types/boxel-ui/helpers/extract-css-variables.ts +126 -0
- package/bundled-types/boxel-ui/helpers/format-age.ts +72 -0
- package/bundled-types/boxel-ui/helpers/format-countdown.ts +110 -0
- package/bundled-types/boxel-ui/helpers/format-currency.ts +95 -0
- package/bundled-types/boxel-ui/helpers/format-date-time.ts +567 -0
- package/bundled-types/boxel-ui/helpers/format-duration.ts +143 -0
- package/bundled-types/boxel-ui/helpers/format-file-size.ts +49 -0
- package/bundled-types/boxel-ui/helpers/format-list.ts +73 -0
- package/bundled-types/boxel-ui/helpers/format-names.ts +103 -0
- package/bundled-types/boxel-ui/helpers/format-number.ts +140 -0
- package/bundled-types/boxel-ui/helpers/format-ordinal.ts +115 -0
- package/bundled-types/boxel-ui/helpers/format-period.ts +188 -0
- package/bundled-types/boxel-ui/helpers/format-relative-time.ts +789 -0
- package/bundled-types/boxel-ui/helpers/generate-css-variables.ts +47 -0
- package/bundled-types/boxel-ui/helpers/markdown-escape.ts +36 -0
- package/bundled-types/boxel-ui/helpers/math-helpers.ts +18 -0
- package/bundled-types/boxel-ui/helpers/menu-divider.ts +15 -0
- package/bundled-types/boxel-ui/helpers/menu-item.ts +76 -0
- package/bundled-types/boxel-ui/helpers/optional.ts +7 -0
- package/bundled-types/boxel-ui/helpers/pick.ts +11 -0
- package/bundled-types/boxel-ui/helpers/sanitize-html.ts +45 -0
- package/bundled-types/boxel-ui/helpers/string.ts +15 -0
- package/bundled-types/boxel-ui/helpers/theme-css.ts +148 -0
- package/bundled-types/boxel-ui/helpers/truth-helpers.ts +48 -0
- package/bundled-types/boxel-ui/helpers/validate-email-format.ts +138 -0
- package/bundled-types/boxel-ui/helpers/validate-phone-format.ts +201 -0
- package/bundled-types/boxel-ui/helpers.ts +134 -0
- package/bundled-types/boxel-ui/icons/ai-bw.gts +22 -0
- package/bundled-types/boxel-ui/icons/arrow-left.gts +25 -0
- package/bundled-types/boxel-ui/icons/arrow-right.gts +28 -0
- package/bundled-types/boxel-ui/icons/arrow-top-left.gts +22 -0
- package/bundled-types/boxel-ui/icons/arrow-up.gts +25 -0
- package/bundled-types/boxel-ui/icons/atom.gts +26 -0
- package/bundled-types/boxel-ui/icons/boxel-icon-with-text.gts +29 -0
- package/bundled-types/boxel-ui/icons/boxel-icon.gts +34 -0
- package/bundled-types/boxel-ui/icons/card-definition.gts +26 -0
- package/bundled-types/boxel-ui/icons/card-instance.gts +26 -0
- package/bundled-types/boxel-ui/icons/card.gts +24 -0
- package/bundled-types/boxel-ui/icons/cardbot-lg.gts +24 -0
- package/bundled-types/boxel-ui/icons/caret-down.gts +23 -0
- package/bundled-types/boxel-ui/icons/caret-up.gts +23 -0
- package/bundled-types/boxel-ui/icons/check-mark.gts +23 -0
- package/bundled-types/boxel-ui/icons/chevron-right.gts +23 -0
- package/bundled-types/boxel-ui/icons/copy.gts +28 -0
- package/bundled-types/boxel-ui/icons/diagonal-arrow-left-up.gts +21 -0
- package/bundled-types/boxel-ui/icons/download.gts +19 -0
- package/bundled-types/boxel-ui/icons/dropdown-arrow-down.gts +20 -0
- package/bundled-types/boxel-ui/icons/dropdown-arrow-filled.gts +19 -0
- package/bundled-types/boxel-ui/icons/dropdown-arrow-up.gts +20 -0
- package/bundled-types/boxel-ui/icons/edit.gts +14 -0
- package/bundled-types/boxel-ui/icons/embedded.gts +34 -0
- package/bundled-types/boxel-ui/icons/exclamation-circle.gts +26 -0
- package/bundled-types/boxel-ui/icons/exclamation.gts +20 -0
- package/bundled-types/boxel-ui/icons/eye.gts +19 -0
- package/bundled-types/boxel-ui/icons/failure-bordered.gts +26 -0
- package/bundled-types/boxel-ui/icons/field.gts +26 -0
- package/bundled-types/boxel-ui/icons/file-alert.gts +28 -0
- package/bundled-types/boxel-ui/icons/file.gts +27 -0
- package/bundled-types/boxel-ui/icons/fitted.gts +42 -0
- package/bundled-types/boxel-ui/icons/folder.gts +26 -0
- package/bundled-types/boxel-ui/icons/form.gts +38 -0
- package/bundled-types/boxel-ui/icons/four-lines.gts +21 -0
- package/bundled-types/boxel-ui/icons/grid-3x3.gts +26 -0
- package/bundled-types/boxel-ui/icons/group.gts +22 -0
- package/bundled-types/boxel-ui/icons/head.gts +28 -0
- package/bundled-types/boxel-ui/icons/highlight-icon.gts +46 -0
- package/bundled-types/boxel-ui/icons/icon-circle-selected.gts +25 -0
- package/bundled-types/boxel-ui/icons/icon-circle.gts +25 -0
- package/bundled-types/boxel-ui/icons/icon-code.gts +22 -0
- package/bundled-types/boxel-ui/icons/icon-funnel.gts +23 -0
- package/bundled-types/boxel-ui/icons/icon-globe.gts +19 -0
- package/bundled-types/boxel-ui/icons/icon-grid.gts +68 -0
- package/bundled-types/boxel-ui/icons/icon-hexagon.gts +22 -0
- package/bundled-types/boxel-ui/icons/icon-inherit.gts +19 -0
- package/bundled-types/boxel-ui/icons/icon-link.gts +20 -0
- package/bundled-types/boxel-ui/icons/icon-list.gts +40 -0
- package/bundled-types/boxel-ui/icons/icon-minus-circle.gts +26 -0
- package/bundled-types/boxel-ui/icons/icon-pencil-crossed-out.gts +33 -0
- package/bundled-types/boxel-ui/icons/icon-pencil-not-crossed-out.gts +21 -0
- package/bundled-types/boxel-ui/icons/icon-pencil.gts +23 -0
- package/bundled-types/boxel-ui/icons/icon-plus-circle.gts +31 -0
- package/bundled-types/boxel-ui/icons/icon-plus-thin.gts +19 -0
- package/bundled-types/boxel-ui/icons/icon-plus.gts +20 -0
- package/bundled-types/boxel-ui/icons/icon-search-thick.gts +27 -0
- package/bundled-types/boxel-ui/icons/icon-search.gts +25 -0
- package/bundled-types/boxel-ui/icons/icon-table.gts +44 -0
- package/bundled-types/boxel-ui/icons/icon-trash.gts +24 -0
- package/bundled-types/boxel-ui/icons/icon-turn-down-right.gts +18 -0
- package/bundled-types/boxel-ui/icons/icon-x.gts +21 -0
- package/bundled-types/boxel-ui/icons/image-placeholder.gts +30 -0
- package/bundled-types/boxel-ui/icons/isolated.gts +20 -0
- package/bundled-types/boxel-ui/icons/loading-indicator.gts +26 -0
- package/bundled-types/boxel-ui/icons/lock.gts +23 -0
- package/bundled-types/boxel-ui/icons/markdown.gts +19 -0
- package/bundled-types/boxel-ui/icons/profile.gts +23 -0
- package/bundled-types/boxel-ui/icons/publish-site-icon.gts +25 -0
- package/bundled-types/boxel-ui/icons/rows-4.gts +26 -0
- package/bundled-types/boxel-ui/icons/select-all.gts +25 -0
- package/bundled-types/boxel-ui/icons/send.gts +21 -0
- package/bundled-types/boxel-ui/icons/sparkle.gts +21 -0
- package/bundled-types/boxel-ui/icons/star-filled.gts +25 -0
- package/bundled-types/boxel-ui/icons/star-half-fill.gts +27 -0
- package/bundled-types/boxel-ui/icons/star.gts +25 -0
- package/bundled-types/boxel-ui/icons/success-bordered.gts +30 -0
- package/bundled-types/boxel-ui/icons/three-dots-horizontal.gts +21 -0
- package/bundled-types/boxel-ui/icons/triangle-left.gts +23 -0
- package/bundled-types/boxel-ui/icons/triangle-right.gts +23 -0
- package/bundled-types/boxel-ui/icons/types.ts +10 -0
- package/bundled-types/boxel-ui/icons/upload.gts +20 -0
- package/bundled-types/boxel-ui/icons/warning.gts +19 -0
- package/bundled-types/boxel-ui/icons.gts +249 -0
- package/bundled-types/boxel-ui/modifiers/auto-focus.ts +7 -0
- package/bundled-types/boxel-ui/modifiers/set-css-var.ts +24 -0
- package/bundled-types/boxel-ui/modifiers.ts +14 -0
- package/bundled-types/boxel-ui/types/@cardstack/boxel-ui/index.d.ts +3 -0
- package/bundled-types/boxel-ui/types/ember-css-url/index.d.ts +15 -0
- package/bundled-types/boxel-ui/types/ember-draggable-modifiers/index.d.ts +109 -0
- package/bundled-types/boxel-ui/types/ember-draggable-modifiers/utils.d.ts +7 -0
- package/bundled-types/boxel-ui/types/ember-focus-trap/index.d.ts +20 -0
- package/bundled-types/boxel-ui/types/ember-power-calendar/components/index.d.ts +9 -0
- package/bundled-types/boxel-ui/types/ember-resize-modifier/index.d.ts +14 -0
- package/bundled-types/boxel-ui/types/ember-set-body-class/index.d.ts +12 -0
- package/bundled-types/boxel-ui/types/ember-sortable/index.d.ts +52 -0
- package/bundled-types/boxel-ui/types/global.d.ts +7 -0
- package/bundled-types/boxel-ui/usage.ts +112 -0
- package/bundled-types/boxel-ui/utils/date-utils.ts +192 -0
- package/bundled-types/boxel-ui/utils/fitted-formats.ts +161 -0
- package/bundled-types/host-app/app.ts +22 -0
- package/bundled-types/host-app/commands/add-field-to-card-definition.ts +74 -0
- package/bundled-types/host-app/commands/ai-assistant.ts +203 -0
- package/bundled-types/host-app/commands/apply-markdown-edit.ts +203 -0
- package/bundled-types/host-app/commands/apply-search-replace-block.ts +225 -0
- package/bundled-types/host-app/commands/ask-ai.ts +66 -0
- package/bundled-types/host-app/commands/authed-fetch.ts +53 -0
- package/bundled-types/host-app/commands/bot-requests/create-listing-pr-request.ts +77 -0
- package/bundled-types/host-app/commands/bot-requests/send-bot-trigger-event.ts +53 -0
- package/bundled-types/host-app/commands/can-read-realm.ts +34 -0
- package/bundled-types/host-app/commands/cancel-indexing-job.ts +29 -0
- package/bundled-types/host-app/commands/check-correctness.ts +309 -0
- package/bundled-types/host-app/commands/copy-and-edit.ts +311 -0
- package/bundled-types/host-app/commands/copy-card-as-markdown.ts +41 -0
- package/bundled-types/host-app/commands/copy-card-to-stack.ts +70 -0
- package/bundled-types/host-app/commands/copy-card.ts +67 -0
- package/bundled-types/host-app/commands/copy-file-to-realm.ts +82 -0
- package/bundled-types/host-app/commands/copy-source.ts +46 -0
- package/bundled-types/host-app/commands/create-ai-assistant-room.ts +144 -0
- package/bundled-types/host-app/commands/create-and-open-submission-workflow-card.ts +30 -0
- package/bundled-types/host-app/commands/create-specs.ts +422 -0
- package/bundled-types/host-app/commands/create-submission-workflow.ts +172 -0
- package/bundled-types/host-app/commands/evaluate-module.ts +119 -0
- package/bundled-types/host-app/commands/execute-atomic-operations.ts +44 -0
- package/bundled-types/host-app/commands/fetch-card-json.ts +33 -0
- package/bundled-types/host-app/commands/full-reindex-realm.ts +30 -0
- package/bundled-types/host-app/commands/generate-example-cards.ts +298 -0
- package/bundled-types/host-app/commands/generate-readme-spec.ts +116 -0
- package/bundled-types/host-app/commands/generate-theme-example.ts +147 -0
- package/bundled-types/host-app/commands/generate-thumbnail.ts +247 -0
- package/bundled-types/host-app/commands/get-all-realm-metas.ts +38 -0
- package/bundled-types/host-app/commands/get-available-realm-identifiers.ts +29 -0
- package/bundled-types/host-app/commands/get-card-type-schema.ts +59 -0
- package/bundled-types/host-app/commands/get-card.ts +34 -0
- package/bundled-types/host-app/commands/get-catalog-realm-identifiers.ts +29 -0
- package/bundled-types/host-app/commands/get-default-writable-realm.ts +28 -0
- package/bundled-types/host-app/commands/get-events-from-room.ts +70 -0
- package/bundled-types/host-app/commands/get-realm-of-resource-identifier.ts +37 -0
- package/bundled-types/host-app/commands/get-user-system-card.ts +38 -0
- package/bundled-types/host-app/commands/index.ts +590 -0
- package/bundled-types/host-app/commands/instantiate-card.ts +185 -0
- package/bundled-types/host-app/commands/invalidate-realm-identifiers.ts +33 -0
- package/bundled-types/host-app/commands/invite-user-to-room.ts +34 -0
- package/bundled-types/host-app/commands/lint-and-fix.ts +60 -0
- package/bundled-types/host-app/commands/listing-action-build.ts +79 -0
- package/bundled-types/host-app/commands/listing-action-init.ts +106 -0
- package/bundled-types/host-app/commands/listing-create.ts +632 -0
- package/bundled-types/host-app/commands/listing-generate-example.ts +83 -0
- package/bundled-types/host-app/commands/listing-install.ts +227 -0
- package/bundled-types/host-app/commands/listing-remix.ts +150 -0
- package/bundled-types/host-app/commands/listing-update-specs.ts +116 -0
- package/bundled-types/host-app/commands/listing-use.ts +97 -0
- package/bundled-types/host-app/commands/one-shot-llm-request.ts +209 -0
- package/bundled-types/host-app/commands/open-ai-assistant-room.ts +38 -0
- package/bundled-types/host-app/commands/open-create-listing-modal.ts +52 -0
- package/bundled-types/host-app/commands/open-in-interact-mode.ts +36 -0
- package/bundled-types/host-app/commands/open-workspace.ts +38 -0
- package/bundled-types/host-app/commands/patch-card-instance.ts +108 -0
- package/bundled-types/host-app/commands/patch-code.ts +243 -0
- package/bundled-types/host-app/commands/patch-fields.ts +304 -0
- package/bundled-types/host-app/commands/patch-theme.ts +52 -0
- package/bundled-types/host-app/commands/persist-module-inspector-view.ts +41 -0
- package/bundled-types/host-app/commands/populate-with-sample-data.ts +84 -0
- package/bundled-types/host-app/commands/preview-format.ts +52 -0
- package/bundled-types/host-app/commands/read-binary-file.ts +62 -0
- package/bundled-types/host-app/commands/read-card-for-ai-assistant.ts +50 -0
- package/bundled-types/host-app/commands/read-file-for-ai-assistant.ts +46 -0
- package/bundled-types/host-app/commands/read-source.ts +46 -0
- package/bundled-types/host-app/commands/read-text-file.ts +44 -0
- package/bundled-types/host-app/commands/register-bot.ts +42 -0
- package/bundled-types/host-app/commands/reindex-realm.ts +30 -0
- package/bundled-types/host-app/commands/retry-submission-workflow.ts +119 -0
- package/bundled-types/host-app/commands/sanitize-module-list.ts +83 -0
- package/bundled-types/host-app/commands/save-card.ts +44 -0
- package/bundled-types/host-app/commands/screenshot-card.ts +148 -0
- package/bundled-types/host-app/commands/search-and-choose.ts +180 -0
- package/bundled-types/host-app/commands/search-cards.ts +102 -0
- package/bundled-types/host-app/commands/search-google-images.ts +100 -0
- package/bundled-types/host-app/commands/send-ai-assistant-message.ts +122 -0
- package/bundled-types/host-app/commands/send-request-via-proxy.ts +70 -0
- package/bundled-types/host-app/commands/serialize-card.ts +45 -0
- package/bundled-types/host-app/commands/set-active-llm.ts +39 -0
- package/bundled-types/host-app/commands/set-user-system-card.ts +29 -0
- package/bundled-types/host-app/commands/show-card.ts +102 -0
- package/bundled-types/host-app/commands/show-file.ts +39 -0
- package/bundled-types/host-app/commands/store-add.ts +37 -0
- package/bundled-types/host-app/commands/summarize-session.ts +82 -0
- package/bundled-types/host-app/commands/switch-submode.ts +112 -0
- package/bundled-types/host-app/commands/sync-openrouter-models.ts +373 -0
- package/bundled-types/host-app/commands/transform-cards.ts +59 -0
- package/bundled-types/host-app/commands/unregister-bot.ts +29 -0
- package/bundled-types/host-app/commands/update-code-path-with-selection.ts +45 -0
- package/bundled-types/host-app/commands/update-playground-selection.ts +37 -0
- package/bundled-types/host-app/commands/update-room-skills.ts +231 -0
- package/bundled-types/host-app/commands/utils.ts +178 -0
- package/bundled-types/host-app/commands/validate-realm.ts +40 -0
- package/bundled-types/host-app/commands/write-binary-file.ts +142 -0
- package/bundled-types/host-app/commands/write-text-file.ts +104 -0
- package/bundled-types/host-app/components/.gitkeep +0 -0
- package/bundled-types/host-app/components/ai-assistant/action-bar.gts +188 -0
- package/bundled-types/host-app/components/ai-assistant/ai-assist-button-active-bg.webp +0 -0
- package/bundled-types/host-app/components/ai-assistant/ai-assist-button-active-bg@2x.webp +0 -0
- package/bundled-types/host-app/components/ai-assistant/ai-assist-button-active-bg@3x.webp +0 -0
- package/bundled-types/host-app/components/ai-assistant/ai-assist-icon-animated.webp +0 -0
- package/bundled-types/host-app/components/ai-assistant/ai-assist-icon-bw.png +0 -0
- package/bundled-types/host-app/components/ai-assistant/ai-assist-icon-bw@2x.png +0 -0
- package/bundled-types/host-app/components/ai-assistant/ai-assist-icon-bw@3x.png +0 -0
- package/bundled-types/host-app/components/ai-assistant/ai-assist-icon.webp +0 -0
- package/bundled-types/host-app/components/ai-assistant/ai-assist-icon@2x.webp +0 -0
- package/bundled-types/host-app/components/ai-assistant/ai-assist-icon@3x.webp +0 -0
- package/bundled-types/host-app/components/ai-assistant/apply-button/index.gts +226 -0
- package/bundled-types/host-app/components/ai-assistant/apply-button/usage.gts +81 -0
- package/bundled-types/host-app/components/ai-assistant/attached-file-dropdown-menu.gts +179 -0
- package/bundled-types/host-app/components/ai-assistant/attachment-picker/attach-button.gts +176 -0
- package/bundled-types/host-app/components/ai-assistant/attachment-picker/attached-items.gts +271 -0
- package/bundled-types/host-app/components/ai-assistant/attachment-picker/index.gts +144 -0
- package/bundled-types/host-app/components/ai-assistant/attachment-picker/usage.gts +127 -0
- package/bundled-types/host-app/components/ai-assistant/button.gts +60 -0
- package/bundled-types/host-app/components/ai-assistant/chat-input/index.gts +203 -0
- package/bundled-types/host-app/components/ai-assistant/chat-input/usage.gts +68 -0
- package/bundled-types/host-app/components/ai-assistant/code-block/actions.gts +58 -0
- package/bundled-types/host-app/components/ai-assistant/code-block/apply-code-patch-button.gts +66 -0
- package/bundled-types/host-app/components/ai-assistant/code-block/command-header.gts +115 -0
- package/bundled-types/host-app/components/ai-assistant/code-block/diff-editor-header.gts +209 -0
- package/bundled-types/host-app/components/ai-assistant/code-block/index.gts +228 -0
- package/bundled-types/host-app/components/ai-assistant/code-block/patch-footer.gts +32 -0
- package/bundled-types/host-app/components/ai-assistant/code-block/view-code-button.gts +73 -0
- package/bundled-types/host-app/components/ai-assistant/focus-pill/index.gts +60 -0
- package/bundled-types/host-app/components/ai-assistant/focus-pill/usage.gts +45 -0
- package/bundled-types/host-app/components/ai-assistant/llm-mode-toggle.gts +113 -0
- package/bundled-types/host-app/components/ai-assistant/llm-select.gts +158 -0
- package/bundled-types/host-app/components/ai-assistant/message/aibot-message.gts +374 -0
- package/bundled-types/host-app/components/ai-assistant/message/attachments.gts +153 -0
- package/bundled-types/host-app/components/ai-assistant/message/index.gts +678 -0
- package/bundled-types/host-app/components/ai-assistant/message/meta.gts +66 -0
- package/bundled-types/host-app/components/ai-assistant/message/text-content.gts +32 -0
- package/bundled-types/host-app/components/ai-assistant/message/usage.gts +182 -0
- package/bundled-types/host-app/components/ai-assistant/message/user-message.gts +52 -0
- package/bundled-types/host-app/components/ai-assistant/new-session-button.gts +126 -0
- package/bundled-types/host-app/components/ai-assistant/new-session-settings.gts +180 -0
- package/bundled-types/host-app/components/ai-assistant/new-session.gts +83 -0
- package/bundled-types/host-app/components/ai-assistant/panel-popover.gts +102 -0
- package/bundled-types/host-app/components/ai-assistant/panel.gts +453 -0
- package/bundled-types/host-app/components/ai-assistant/past-session-item.gts +323 -0
- package/bundled-types/host-app/components/ai-assistant/past-sessions.gts +115 -0
- package/bundled-types/host-app/components/ai-assistant/rename-session.gts +144 -0
- package/bundled-types/host-app/components/ai-assistant/restore-file-modal.gts +105 -0
- package/bundled-types/host-app/components/ai-assistant/skill-menu/index.gts +190 -0
- package/bundled-types/host-app/components/ai-assistant/skill-menu/skill-toggle.gts +168 -0
- package/bundled-types/host-app/components/ai-assistant/skill-menu/usage.gts +48 -0
- package/bundled-types/host-app/components/ai-assistant/toast.gts +293 -0
- package/bundled-types/host-app/components/card-catalog/modal.gts +579 -0
- package/bundled-types/host-app/components/card-error.gts +41 -0
- package/bundled-types/host-app/components/card-instance-picker/index.gts +54 -0
- package/bundled-types/host-app/components/card-pill.gts +189 -0
- package/bundled-types/host-app/components/card-prerender.gts +880 -0
- package/bundled-types/host-app/components/card-renderer.gts +84 -0
- package/bundled-types/host-app/components/card-search/constants.ts +76 -0
- package/bundled-types/host-app/components/card-search/item-button.gts +243 -0
- package/bundled-types/host-app/components/card-search/panel.gts +150 -0
- package/bundled-types/host-app/components/card-search/search-bar.gts +218 -0
- package/bundled-types/host-app/components/card-search/search-content.gts +604 -0
- package/bundled-types/host-app/components/card-search/search-result-header.gts +165 -0
- package/bundled-types/host-app/components/card-search/search-result-section.gts +545 -0
- package/bundled-types/host-app/components/card-search/section-header.gts +117 -0
- package/bundled-types/host-app/components/editor/directory.gts +308 -0
- package/bundled-types/host-app/components/editor/file-tree.gts +69 -0
- package/bundled-types/host-app/components/editor/import-module.gts +27 -0
- package/bundled-types/host-app/components/editor/indexed-file-tree.gts +572 -0
- package/bundled-types/host-app/components/editor/recent-files.gts +141 -0
- package/bundled-types/host-app/components/file-pill.gts +206 -0
- package/bundled-types/host-app/components/head-format-preview.gts +781 -0
- package/bundled-types/host-app/components/host-mode/breadcrumb-item.gts +150 -0
- package/bundled-types/host-app/components/host-mode/breadcrumbs.gts +131 -0
- package/bundled-types/host-app/components/host-mode/card.gts +199 -0
- package/bundled-types/host-app/components/host-mode/content.gts +195 -0
- package/bundled-types/host-app/components/host-mode/stack-item.gts +310 -0
- package/bundled-types/host-app/components/host-mode/stack.gts +91 -0
- package/bundled-types/host-app/components/matrix/auth-container.gts +66 -0
- package/bundled-types/host-app/components/matrix/auth.gts +73 -0
- package/bundled-types/host-app/components/matrix/forgot-password.gts +487 -0
- package/bundled-types/host-app/components/matrix/login.gts +241 -0
- package/bundled-types/host-app/components/matrix/register-user.gts +843 -0
- package/bundled-types/host-app/components/matrix/room-message-command.gts +330 -0
- package/bundled-types/host-app/components/matrix/room-message.gts +261 -0
- package/bundled-types/host-app/components/matrix/room.gts +1872 -0
- package/bundled-types/host-app/components/matrix/user-profile.gts +99 -0
- package/bundled-types/host-app/components/modal-container.gts +171 -0
- package/bundled-types/host-app/components/operator-mode/binary-file-info.gts +77 -0
- package/bundled-types/host-app/components/operator-mode/card-adoption-chain.gts +99 -0
- package/bundled-types/host-app/components/operator-mode/card-error-detail.gts +87 -0
- package/bundled-types/host-app/components/operator-mode/card-error.gts +177 -0
- package/bundled-types/host-app/components/operator-mode/card-schema-editor.gts +616 -0
- package/bundled-types/host-app/components/operator-mode/card-url-bar.gts +197 -0
- package/bundled-types/host-app/components/operator-mode/choose-file-modal.gts +562 -0
- package/bundled-types/host-app/components/operator-mode/choose-subscription-plan-modal.gts +517 -0
- package/bundled-types/host-app/components/operator-mode/code-editor.gts +736 -0
- package/bundled-types/host-app/components/operator-mode/code-submode/editor-indicator.gts +128 -0
- package/bundled-types/host-app/components/operator-mode/code-submode/format-chooser.gts +589 -0
- package/bundled-types/host-app/components/operator-mode/code-submode/inner-container.gts +162 -0
- package/bundled-types/host-app/components/operator-mode/code-submode/left-panel-toggle.gts +267 -0
- package/bundled-types/host-app/components/operator-mode/code-submode/module-inspector.gts +836 -0
- package/bundled-types/host-app/components/operator-mode/code-submode/playground/field-chooser-modal.gts +97 -0
- package/bundled-types/host-app/components/operator-mode/code-submode/playground/instance-chooser-dropdown.gts +346 -0
- package/bundled-types/host-app/components/operator-mode/code-submode/playground/playground-background.png +0 -0
- package/bundled-types/host-app/components/operator-mode/code-submode/playground/playground-panel.gts +1274 -0
- package/bundled-types/host-app/components/operator-mode/code-submode/playground/playground-preview.gts +155 -0
- package/bundled-types/host-app/components/operator-mode/code-submode/playground/playground.gts +98 -0
- package/bundled-types/host-app/components/operator-mode/code-submode/playground/spec-search.gts +70 -0
- package/bundled-types/host-app/components/operator-mode/code-submode/schema-editor.gts +205 -0
- package/bundled-types/host-app/components/operator-mode/code-submode/spec-preview-badge.gts +72 -0
- package/bundled-types/host-app/components/operator-mode/code-submode/spec-preview.gts +432 -0
- package/bundled-types/host-app/components/operator-mode/code-submode/toggle-button.gts +72 -0
- package/bundled-types/host-app/components/operator-mode/code-submode.gts +1030 -0
- package/bundled-types/host-app/components/operator-mode/container.gts +270 -0
- package/bundled-types/host-app/components/operator-mode/context-menu-button.gts +95 -0
- package/bundled-types/host-app/components/operator-mode/copy-button.gts +277 -0
- package/bundled-types/host-app/components/operator-mode/create-file-modal.gts +1087 -0
- package/bundled-types/host-app/components/operator-mode/create-listing-modal.gts +513 -0
- package/bundled-types/host-app/components/operator-mode/definition-container/base.gts +222 -0
- package/bundled-types/host-app/components/operator-mode/definition-container/clickable.gts +59 -0
- package/bundled-types/host-app/components/operator-mode/definition-container/divider.gts +48 -0
- package/bundled-types/host-app/components/operator-mode/definition-container/index.gts +108 -0
- package/bundled-types/host-app/components/operator-mode/delete-modal.gts +123 -0
- package/bundled-types/host-app/components/operator-mode/detail-panel-selector.gts +320 -0
- package/bundled-types/host-app/components/operator-mode/detail-panel.gts +834 -0
- package/bundled-types/host-app/components/operator-mode/edit-field-modal.gts +450 -0
- package/bundled-types/host-app/components/operator-mode/error-display.gts +590 -0
- package/bundled-types/host-app/components/operator-mode/host-submode/open-site-popover.gts +127 -0
- package/bundled-types/host-app/components/operator-mode/host-submode/publishing-realm-popover.gts +159 -0
- package/bundled-types/host-app/components/operator-mode/host-submode.gts +373 -0
- package/bundled-types/host-app/components/operator-mode/interact-submode/neighbor-stack-trigger.gts +116 -0
- package/bundled-types/host-app/components/operator-mode/interact-submode.gts +1021 -0
- package/bundled-types/host-app/components/operator-mode/new-file-button.gts +187 -0
- package/bundled-types/host-app/components/operator-mode/operator-mode-overlays.gts +511 -0
- package/bundled-types/host-app/components/operator-mode/overlays.gts +342 -0
- package/bundled-types/host-app/components/operator-mode/preview-panel/fitted-format-gallery.gts +127 -0
- package/bundled-types/host-app/components/operator-mode/preview-panel/index.gts +443 -0
- package/bundled-types/host-app/components/operator-mode/preview-panel/markdown-preview.gts +175 -0
- package/bundled-types/host-app/components/operator-mode/preview-panel/metadata-panel.gts +214 -0
- package/bundled-types/host-app/components/operator-mode/preview-panel/rendered-markdown.gts +718 -0
- package/bundled-types/host-app/components/operator-mode/private-dependency-violation.gts +70 -0
- package/bundled-types/host-app/components/operator-mode/profile/profile-email.gts +686 -0
- package/bundled-types/host-app/components/operator-mode/profile/profile-settings-modal.gts +454 -0
- package/bundled-types/host-app/components/operator-mode/profile/profile-subscription.gts +170 -0
- package/bundled-types/host-app/components/operator-mode/profile-info-popover.gts +263 -0
- package/bundled-types/host-app/components/operator-mode/publish-realm-modal.gts +1529 -0
- package/bundled-types/host-app/components/operator-mode/remove-field-modal.gts +135 -0
- package/bundled-types/host-app/components/operator-mode/send-error-to-ai-assistant.gts +195 -0
- package/bundled-types/host-app/components/operator-mode/stack-item.gts +1341 -0
- package/bundled-types/host-app/components/operator-mode/stack.gts +191 -0
- package/bundled-types/host-app/components/operator-mode/submode-layout.gts +781 -0
- package/bundled-types/host-app/components/operator-mode/syntax-error-display.gts +72 -0
- package/bundled-types/host-app/components/operator-mode/workspace-chooser/add-workspace.gts +282 -0
- package/bundled-types/host-app/components/operator-mode/workspace-chooser/index.gts +299 -0
- package/bundled-types/host-app/components/operator-mode/workspace-chooser/item-container.gts +50 -0
- package/bundled-types/host-app/components/operator-mode/workspace-chooser/workspace-loading-indicator.gts +50 -0
- package/bundled-types/host-app/components/operator-mode/workspace-chooser/workspace.gts +1079 -0
- package/bundled-types/host-app/components/pill-menu/index.gts +281 -0
- package/bundled-types/host-app/components/pill-menu/usage.gts +64 -0
- package/bundled-types/host-app/components/prerendered-card-search.gts +274 -0
- package/bundled-types/host-app/components/realm-dropdown.gts +209 -0
- package/bundled-types/host-app/components/realm-picker/index.gts +142 -0
- package/bundled-types/host-app/components/search-sheet/index.gts +426 -0
- package/bundled-types/host-app/components/search-sheet/usage.gts +99 -0
- package/bundled-types/host-app/components/submode-switcher.gts +260 -0
- package/bundled-types/host-app/components/type-picker/index.gts +111 -0
- package/bundled-types/host-app/components/with-known-realms-loaded.gts +47 -0
- package/bundled-types/host-app/components/with-loaded-realm.gts +39 -0
- package/bundled-types/host-app/components/with-subscription-data.gts +247 -0
- package/bundled-types/host-app/config/environment.ts +66 -0
- package/bundled-types/host-app/deprecation-workflow.js +30 -0
- package/bundled-types/host-app/lib/browser-queue.ts +198 -0
- package/bundled-types/host-app/lib/codemirror-context.ts +1081 -0
- package/bundled-types/host-app/lib/command-definitions.ts +41 -0
- package/bundled-types/host-app/lib/download-realm.ts +9 -0
- package/bundled-types/host-app/lib/example-card-helpers.ts +99 -0
- package/bundled-types/host-app/lib/externals.ts +247 -0
- package/bundled-types/host-app/lib/field-path-parser.ts +520 -0
- package/bundled-types/host-app/lib/file-def-manager.ts +712 -0
- package/bundled-types/host-app/lib/file-upload-state.ts +6 -0
- package/bundled-types/host-app/lib/formatted-message/utils.ts +272 -0
- package/bundled-types/host-app/lib/gc-card-store.ts +1084 -0
- package/bundled-types/host-app/lib/host-base-command.ts +29 -0
- package/bundled-types/host-app/lib/html-component.ts +144 -0
- package/bundled-types/host-app/lib/html-to-markdown.ts +96 -0
- package/bundled-types/host-app/lib/isolated-render.gts +90 -0
- package/bundled-types/host-app/lib/known-file-meta-urls.ts +17 -0
- package/bundled-types/host-app/lib/limited-set.ts +68 -0
- package/bundled-types/host-app/lib/matrix-classes/member.ts +28 -0
- package/bundled-types/host-app/lib/matrix-classes/message-builder.ts +444 -0
- package/bundled-types/host-app/lib/matrix-classes/message-code-patch-result.ts +44 -0
- package/bundled-types/host-app/lib/matrix-classes/message-command.ts +109 -0
- package/bundled-types/host-app/lib/matrix-classes/message.ts +239 -0
- package/bundled-types/host-app/lib/matrix-classes/room.ts +174 -0
- package/bundled-types/host-app/lib/matrix-utils.ts +114 -0
- package/bundled-types/host-app/lib/mutex.ts +62 -0
- package/bundled-types/host-app/lib/prerender-fetch-headers.ts +46 -0
- package/bundled-types/host-app/lib/prerender-util.ts +31 -0
- package/bundled-types/host-app/lib/public-path.ts +1 -0
- package/bundled-types/host-app/lib/random-name.ts +26 -0
- package/bundled-types/host-app/lib/realm-utils.ts +45 -0
- package/bundled-types/host-app/lib/search-cache-key.ts +33 -0
- package/bundled-types/host-app/lib/search-in-flight-key.ts +28 -0
- package/bundled-types/host-app/lib/search-replace-block-parsing.ts +101 -0
- package/bundled-types/host-app/lib/setup-globals.ts +15 -0
- package/bundled-types/host-app/lib/sqlite-adapter.ts +510 -0
- package/bundled-types/host-app/lib/stack-item.ts +164 -0
- package/bundled-types/host-app/lib/utils.ts +84 -0
- package/bundled-types/host-app/lib/window-error-handler.ts +132 -0
- package/bundled-types/host-app/router.ts +31 -0
- package/bundled-types/host-app/services/ai-assistant-panel-service.ts +850 -0
- package/bundled-types/host-app/services/billing-service.ts +208 -0
- package/bundled-types/host-app/services/card-service.ts +373 -0
- package/bundled-types/host-app/services/card-type-service.ts +226 -0
- package/bundled-types/host-app/services/code-semantics-service.ts +297 -0
- package/bundled-types/host-app/services/command-service.ts +975 -0
- package/bundled-types/host-app/services/environment-service.ts +26 -0
- package/bundled-types/host-app/services/error-display.ts +42 -0
- package/bundled-types/host-app/services/file-upload.ts +212 -0
- package/bundled-types/host-app/services/host-mode-service.ts +381 -0
- package/bundled-types/host-app/services/host-mode-state-service.ts +160 -0
- package/bundled-types/host-app/services/loader-service.ts +148 -0
- package/bundled-types/host-app/services/local-indexer.ts +68 -0
- package/bundled-types/host-app/services/local-persistence-service.ts +296 -0
- package/bundled-types/host-app/services/logger-service.ts +13 -0
- package/bundled-types/host-app/services/matrix-sdk-loader.ts +346 -0
- package/bundled-types/host-app/services/matrix-service.ts +2287 -0
- package/bundled-types/host-app/services/message-service.ts +84 -0
- package/bundled-types/host-app/services/module-contents-service.ts +333 -0
- package/bundled-types/host-app/services/monaco-service.ts +333 -0
- package/bundled-types/host-app/services/network.ts +101 -0
- package/bundled-types/host-app/services/operator-mode-state-service.ts +1591 -0
- package/bundled-types/host-app/services/playground-panel-service.ts +236 -0
- package/bundled-types/host-app/services/queue.ts +30 -0
- package/bundled-types/host-app/services/realm-info-service.ts +37 -0
- package/bundled-types/host-app/services/realm-server.ts +1209 -0
- package/bundled-types/host-app/services/realm.ts +1413 -0
- package/bundled-types/host-app/services/recent-cards-service.ts +174 -0
- package/bundled-types/host-app/services/recent-files-service.ts +224 -0
- package/bundled-types/host-app/services/render-error-state.ts +55 -0
- package/bundled-types/host-app/services/render-service.ts +362 -0
- package/bundled-types/host-app/services/render-store.ts +27 -0
- package/bundled-types/host-app/services/reset.ts +19 -0
- package/bundled-types/host-app/services/scroll-position-service.ts +81 -0
- package/bundled-types/host-app/services/spec-panel-service.ts +107 -0
- package/bundled-types/host-app/services/store.ts +2540 -0
- package/bundled-types/host-app/utils/assert-never.ts +3 -0
- package/bundled-types/host-app/utils/auth-error-guard.ts +183 -0
- package/bundled-types/host-app/utils/auth-service-worker-registration.ts +123 -0
- package/bundled-types/host-app/utils/card-search/query-builder.ts +169 -0
- package/bundled-types/host-app/utils/card-search/section-pagination.ts +57 -0
- package/bundled-types/host-app/utils/card-search/sections.ts +240 -0
- package/bundled-types/host-app/utils/card-search/type-filter.ts +124 -0
- package/bundled-types/host-app/utils/card-search/types.ts +11 -0
- package/bundled-types/host-app/utils/card-search/url.ts +23 -0
- package/bundled-types/host-app/utils/clipboard.ts +23 -0
- package/bundled-types/host-app/utils/editor/boxel-formatter.ts +65 -0
- package/bundled-types/host-app/utils/editor/editor-language.ts +88 -0
- package/bundled-types/host-app/utils/editor/monaco-test-waiter.ts +302 -0
- package/bundled-types/host-app/utils/file-def-attributes-extractor.ts +438 -0
- package/bundled-types/host-app/utils/file-name.ts +38 -0
- package/bundled-types/host-app/utils/id-from-card-or-url.ts +11 -0
- package/bundled-types/host-app/utils/lint-formatting.ts +57 -0
- package/bundled-types/host-app/utils/local-storage-keys.ts +28 -0
- package/bundled-types/host-app/utils/normalized-dir-path.ts +3 -0
- package/bundled-types/host-app/utils/prettify-messages.ts +21 -0
- package/bundled-types/host-app/utils/prettify-prompts.ts +21 -0
- package/bundled-types/host-app/utils/realm-index-boilerplate.ts +27 -0
- package/bundled-types/host-app/utils/register-boxel-transition.ts +17 -0
- package/bundled-types/host-app/utils/render-desync-detector.ts +362 -0
- package/bundled-types/host-app/utils/render-error.ts +455 -0
- package/bundled-types/host-app/utils/render-timer-stub.ts +249 -0
- package/bundled-types/host-app/utils/run-while-active.ts +14 -0
- package/bundled-types/host-app/utils/schema-editor.ts +25 -0
- package/bundled-types/host-app/utils/text-suggestion.ts +82 -0
- package/bundled-types/host-app/utils/titleize.ts +10 -0
- package/bundled-types/host-app/utils/uuid.ts +13 -0
- package/bundled-types/host-tests/helpers/adapter.ts +464 -0
- package/bundled-types/host-tests/helpers/base-realm.ts +464 -0
- package/bundled-types/host-tests/helpers/cards/view-card-demo.ts +119 -0
- package/bundled-types/host-tests/helpers/field-test-helpers.gts +54 -0
- package/bundled-types/host-tests/helpers/image-fixture.ts +3 -0
- package/bundled-types/host-tests/helpers/index.gts +2099 -0
- package/bundled-types/host-tests/helpers/indexer.ts +293 -0
- package/bundled-types/host-tests/helpers/interact-submode-setup.gts +551 -0
- package/bundled-types/host-tests/helpers/mock-matrix/_client.ts +1042 -0
- package/bundled-types/host-tests/helpers/mock-matrix/_sdk.ts +71 -0
- package/bundled-types/host-tests/helpers/mock-matrix/_server-state.ts +343 -0
- package/bundled-types/host-tests/helpers/mock-matrix/_sliding-sync.ts +140 -0
- package/bundled-types/host-tests/helpers/mock-matrix/_utils.ts +146 -0
- package/bundled-types/host-tests/helpers/mock-matrix.ts +200 -0
- package/bundled-types/host-tests/helpers/operator-mode-parameters-match.ts +71 -0
- package/bundled-types/host-tests/helpers/operator-mode-state.ts +18 -0
- package/bundled-types/host-tests/helpers/percy-snapshot.ts +228 -0
- package/bundled-types/host-tests/helpers/playground.ts +130 -0
- package/bundled-types/host-tests/helpers/realm-server-mock/index.ts +100 -0
- package/bundled-types/host-tests/helpers/realm-server-mock/routes.ts +617 -0
- package/bundled-types/host-tests/helpers/realm-server-mock/types.ts +24 -0
- package/bundled-types/host-tests/helpers/recent-files-cards.ts +86 -0
- package/bundled-types/host-tests/helpers/render-component.ts +40 -0
- package/bundled-types/host-tests/helpers/setup-qunit.js +164 -0
- package/bundled-types/host-tests/helpers/setup.ts +349 -0
- package/bundled-types/host-tests/helpers/shard-warmup.ts +72 -0
- package/bundled-types/host-tests/helpers/stream.ts +60 -0
- package/bundled-types/host-tests/helpers/test-auth.ts +27 -0
- package/bundled-types/host-tests/helpers/test-realm-registry.ts +23 -0
- package/bundled-types/host-tests/helpers/test-realm-service-worker.ts +92 -0
- package/bundled-types/host-tests/helpers/uncaught-exceptions.ts +16 -0
- package/bundled-types/host-tests/helpers/visit-operator-mode.ts +39 -0
- package/bundled-types/host-types/@cardstack/host/index.d.ts +3 -0
- package/bundled-types/host-types/@joplin/turndown-plugin-gfm/index.d.ts +15 -0
- package/bundled-types/host-types/@sqlite.org/sqlite-wasm/index.d.ts +122 -0
- package/bundled-types/host-types/ember-click-outside/modifiers/on-click-outside.ts +16 -0
- package/bundled-types/host-types/ember-concurrency/helpers/perform.d.ts +3 -0
- package/bundled-types/host-types/ember-css-url/index.d.ts +15 -0
- package/bundled-types/host-types/ember-data/types/registries/model.d.ts +6 -0
- package/bundled-types/host-types/ember-elsewhere/from-elsewhere.d.ts +12 -0
- package/bundled-types/host-types/ember-elsewhere/to-elsewhere.d.ts +16 -0
- package/bundled-types/host-types/ember-focus-trap/index.d.ts +4 -0
- package/bundled-types/host-types/ember-keyboard/modifiers/on-key.d.ts +15 -0
- package/bundled-types/host-types/index.d.ts +6 -0
- package/bundled-types/local-types/eslint-js.d.ts +5 -0
- package/bundled-types/local-types/index.d.ts +115 -0
- package/bundled-types/local-types/marked-gfm-heading-id.d.ts +12 -0
- package/bundled-types/local-types/matrix-js-sdk/index.d.ts +11 -0
- package/bundled-types/local-types/package.json +13 -0
- package/bundled-types/shims/boxel-cli-shims.d.ts +10 -0
- package/dist/index.js +100 -100
- package/package.json +13 -7
- package/src/commands/parse.ts +277 -34
|
@@ -0,0 +1,1007 @@
|
|
|
1
|
+
// KanbanDragManager — Drag interaction for Kanban boards.
|
|
2
|
+
// Uses insertion model: cards insert BETWEEN other cards.
|
|
3
|
+
|
|
4
|
+
import { type Timer, cancel, scheduleOnce } from '@ember/runloop';
|
|
5
|
+
import { tracked } from '@glimmer/tracking';
|
|
6
|
+
import { restartableTask, timeout } from 'ember-concurrency';
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
type DragRect,
|
|
10
|
+
type InsertionPoint,
|
|
11
|
+
type KanbanPlacement,
|
|
12
|
+
cardsInColumn,
|
|
13
|
+
findInsertionFromDragRect,
|
|
14
|
+
findInsertionFromPointer,
|
|
15
|
+
resolveInsertion,
|
|
16
|
+
} from './engine.ts';
|
|
17
|
+
|
|
18
|
+
// ── Constants ────────────────────────────────────────────────────────── //
|
|
19
|
+
const DRAG_THRESHOLD_PX = 4;
|
|
20
|
+
const SETTLE_DURATION_MS = 200;
|
|
21
|
+
|
|
22
|
+
function placementsEqual(a: KanbanPlacement[], b: KanbanPlacement[]): boolean {
|
|
23
|
+
if (a.length !== b.length) {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
const bMap = new Map(b.map((p) => [p.index, p]));
|
|
27
|
+
return a.every((p) => {
|
|
28
|
+
const q = bMap.get(p.index);
|
|
29
|
+
return (
|
|
30
|
+
q !== undefined && p.column === q.column && p.sortOrder === q.sortOrder
|
|
31
|
+
);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
const HOLD_DELAY_MS = 180;
|
|
35
|
+
|
|
36
|
+
// ── Types ────────────────────────────────────────────────────────────── //
|
|
37
|
+
|
|
38
|
+
type BodyStyle = CSSStyleDeclaration & { webkitUserSelect: string };
|
|
39
|
+
|
|
40
|
+
export type KanbanInteractionMode = 'idle' | 'pending' | 'drag' | 'kb-drag';
|
|
41
|
+
|
|
42
|
+
export interface KanbanDragManagerArgs {
|
|
43
|
+
columnCount: number;
|
|
44
|
+
isColumnVisible: (column: number) => boolean;
|
|
45
|
+
onChange: (placements: KanbanPlacement[]) => void;
|
|
46
|
+
onOpen?: (index: number) => void;
|
|
47
|
+
onSelect?: (index: number | null) => void;
|
|
48
|
+
placements: KanbanPlacement[];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// ── KanbanDragManager ────────────────────────────────────────────────── //
|
|
52
|
+
|
|
53
|
+
export class KanbanDragManager {
|
|
54
|
+
private args: KanbanDragManagerArgs;
|
|
55
|
+
|
|
56
|
+
// ── Tracked State ──────────────────────────────────────────────────
|
|
57
|
+
@tracked selectedIndex: number | null = null;
|
|
58
|
+
@tracked interactionMode: KanbanInteractionMode = 'idle';
|
|
59
|
+
@tracked activeDragIndex: number | null = null;
|
|
60
|
+
// Deferred by one render frame so the source card's collapse animation begins
|
|
61
|
+
// after the ghost has materialised, rather than in the same paint.
|
|
62
|
+
@tracked collapseIndex: number | null = null;
|
|
63
|
+
@tracked pointerClientX = 0;
|
|
64
|
+
@tracked pointerClientY = 0;
|
|
65
|
+
@tracked dragGhostWidth = 0;
|
|
66
|
+
@tracked dragGhostHeight = 0;
|
|
67
|
+
@tracked dragOffsetX = 0;
|
|
68
|
+
@tracked dragOffsetY = 0;
|
|
69
|
+
@tracked insertion: InsertionPoint | null = null;
|
|
70
|
+
@tracked isSettling = false;
|
|
71
|
+
@tracked settleX = 0;
|
|
72
|
+
@tracked settleY = 0;
|
|
73
|
+
@tracked settleWidth = 0;
|
|
74
|
+
@tracked settleHeight = 0;
|
|
75
|
+
@tracked announcement = '';
|
|
76
|
+
@tracked kbGrabIndex: number | null = null;
|
|
77
|
+
@tracked insertionBoxOffset: { height: number; yOffset: number } | null =
|
|
78
|
+
null;
|
|
79
|
+
|
|
80
|
+
// ── Non-tracked ────────────────────────────────────────────────────
|
|
81
|
+
private activePointerId: number | null = null;
|
|
82
|
+
private startClientX = 0;
|
|
83
|
+
private startClientY = 0;
|
|
84
|
+
private dragIndex: number | null = null;
|
|
85
|
+
// Long-press on touch can promote a pending interaction into a drag.
|
|
86
|
+
private holdTask = restartableTask(async (container: HTMLElement) => {
|
|
87
|
+
await timeout(HOLD_DELAY_MS);
|
|
88
|
+
if (this.interactionMode === 'pending') {
|
|
89
|
+
this.activateDrag(container);
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
private focusCardTask = restartableTask(async (index: number) => {
|
|
93
|
+
await timeout(0);
|
|
94
|
+
this.focusCard(index);
|
|
95
|
+
});
|
|
96
|
+
private settleTimer: ReturnType<typeof setTimeout> | null = null;
|
|
97
|
+
private rafTimer: Timer | null = null;
|
|
98
|
+
private snapshotPlacements: KanbanPlacement[] | null = null;
|
|
99
|
+
private suppressLostPointerCapture = false;
|
|
100
|
+
private activeCardHeight = 0;
|
|
101
|
+
|
|
102
|
+
// ── Public container ref ───────────────────────────────────────────
|
|
103
|
+
containerRef: HTMLElement | null = null;
|
|
104
|
+
|
|
105
|
+
constructor(args: KanbanDragManagerArgs) {
|
|
106
|
+
this.args = args;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
destroy(): void {
|
|
110
|
+
this.holdTask.cancelAll();
|
|
111
|
+
this.focusCardTask.cancelAll();
|
|
112
|
+
if (this.settleTimer) {
|
|
113
|
+
clearTimeout(this.settleTimer);
|
|
114
|
+
this.settleTimer = null;
|
|
115
|
+
}
|
|
116
|
+
if (this.rafTimer !== null) {
|
|
117
|
+
cancel(this.rafTimer);
|
|
118
|
+
this.rafTimer = null;
|
|
119
|
+
}
|
|
120
|
+
document.body.style.userSelect = '';
|
|
121
|
+
(document.body.style as BodyStyle).webkitUserSelect = '';
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
get isDragging(): boolean {
|
|
125
|
+
return this.interactionMode === 'drag';
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
get isActivelyMoving(): boolean {
|
|
129
|
+
return (
|
|
130
|
+
this.interactionMode === 'drag' || this.interactionMode === 'kb-drag'
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
registerContainer = (el: HTMLElement): void => {
|
|
135
|
+
this.containerRef = el;
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
private getDragRect(clientX: number, clientY: number): DragRect | null {
|
|
139
|
+
if (this.dragGhostWidth <= 0 || this.dragGhostHeight <= 0) {
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
const left = clientX - this.dragOffsetX;
|
|
144
|
+
const top = clientY - this.dragOffsetY;
|
|
145
|
+
return {
|
|
146
|
+
left,
|
|
147
|
+
top,
|
|
148
|
+
right: left + this.dragGhostWidth,
|
|
149
|
+
bottom: top + this.dragGhostHeight,
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
private getCurrentInsertion(
|
|
154
|
+
clientX: number,
|
|
155
|
+
clientY: number,
|
|
156
|
+
container: HTMLElement,
|
|
157
|
+
dragIndex: number,
|
|
158
|
+
): InsertionPoint | null {
|
|
159
|
+
const dragRect = this.getDragRect(clientX, clientY);
|
|
160
|
+
if (!dragRect) {
|
|
161
|
+
return null;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
const centerY = (dragRect.top + dragRect.bottom) / 2;
|
|
165
|
+
// Prefer pointer-based hit testing while the pointer is over a column.
|
|
166
|
+
// When it leaves the board horizontally, fall back to the dragged card's
|
|
167
|
+
// rect so we can preserve a sensible "last visible" target.
|
|
168
|
+
if (this.getColumnAtClientX(clientX, container) !== null) {
|
|
169
|
+
return findInsertionFromPointer(
|
|
170
|
+
clientX,
|
|
171
|
+
centerY,
|
|
172
|
+
container,
|
|
173
|
+
this.args.placements,
|
|
174
|
+
dragIndex,
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
return findInsertionFromDragRect(
|
|
179
|
+
dragRect,
|
|
180
|
+
container,
|
|
181
|
+
this.args.placements,
|
|
182
|
+
dragIndex,
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
private getColumnAtClientX(
|
|
187
|
+
clientX: number,
|
|
188
|
+
container: HTMLElement,
|
|
189
|
+
): number | null {
|
|
190
|
+
const columnEls = container.querySelectorAll('[data-kanban-column]');
|
|
191
|
+
|
|
192
|
+
for (let i = 0; i < columnEls.length; i++) {
|
|
193
|
+
const el = columnEls[i] as HTMLElement;
|
|
194
|
+
const rect = el.getBoundingClientRect();
|
|
195
|
+
if (clientX >= rect.left && clientX <= rect.right) {
|
|
196
|
+
return parseInt(el.getAttribute('data-kanban-column')!, 10);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
return null;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// ── Pointer Handlers ───────────────────────────────────────────────
|
|
204
|
+
|
|
205
|
+
onPointerDown = (e: PointerEvent): void => {
|
|
206
|
+
if (e.button !== 0 || this.interactionMode !== 'idle') {
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
const container = this.containerRef;
|
|
211
|
+
if (!container) {
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
const targetEl = e.target as HTMLElement;
|
|
216
|
+
const cardEl = targetEl?.closest?.(
|
|
217
|
+
'[data-card-index]',
|
|
218
|
+
) as HTMLElement | null;
|
|
219
|
+
if (!cardEl) {
|
|
220
|
+
this.selectedIndex = null;
|
|
221
|
+
this.args.onSelect?.(null);
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
const hitIndex = parseInt(cardEl.getAttribute('data-card-index')!, 10);
|
|
226
|
+
// Pointer interactions start in "pending" so a quick click can still open
|
|
227
|
+
// the card, while a move past the threshold or a hold becomes a drag.
|
|
228
|
+
this.suppressLostPointerCapture = false;
|
|
229
|
+
this.activePointerId = e.pointerId;
|
|
230
|
+
this.startClientX = e.clientX;
|
|
231
|
+
this.startClientY = e.clientY;
|
|
232
|
+
this.pointerClientX = e.clientX;
|
|
233
|
+
this.pointerClientY = e.clientY;
|
|
234
|
+
this.dragIndex = hitIndex;
|
|
235
|
+
this.selectedIndex = hitIndex;
|
|
236
|
+
this.args.onSelect?.(hitIndex);
|
|
237
|
+
this.interactionMode = 'pending';
|
|
238
|
+
|
|
239
|
+
document.body.style.userSelect = 'none';
|
|
240
|
+
(document.body.style as BodyStyle).webkitUserSelect = 'none';
|
|
241
|
+
|
|
242
|
+
void this.holdTask.perform(container);
|
|
243
|
+
|
|
244
|
+
container.setPointerCapture(e.pointerId);
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
onPointerCancel = (event: Event): void => {
|
|
248
|
+
const e = event as PointerEvent;
|
|
249
|
+
if (e.pointerId !== this.activePointerId) {
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
this.abortPointerInteraction();
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
onLostPointerCapture = (event: Event): void => {
|
|
256
|
+
const e = event as PointerEvent;
|
|
257
|
+
if (e.pointerId !== this.activePointerId) {
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
if (this.suppressLostPointerCapture) {
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
this.abortPointerInteraction();
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
onPointerMove = (event: Event): void => {
|
|
267
|
+
const e = event as PointerEvent;
|
|
268
|
+
if (
|
|
269
|
+
e.pointerId !== this.activePointerId ||
|
|
270
|
+
this.interactionMode === 'idle'
|
|
271
|
+
) {
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
// Update coordinates immediately so the ghost tracks the pointer every frame.
|
|
276
|
+
this.pointerClientX = e.clientX;
|
|
277
|
+
this.pointerClientY = e.clientY;
|
|
278
|
+
|
|
279
|
+
if (this.interactionMode === 'pending') {
|
|
280
|
+
const dx = e.clientX - this.startClientX;
|
|
281
|
+
const dy = e.clientY - this.startClientY;
|
|
282
|
+
if (Math.sqrt(dx * dx + dy * dy) >= DRAG_THRESHOLD_PX) {
|
|
283
|
+
const container = this.containerRef;
|
|
284
|
+
if (container) {
|
|
285
|
+
this.activateDrag(container);
|
|
286
|
+
this.insertion = this.getCurrentInsertion(
|
|
287
|
+
e.clientX,
|
|
288
|
+
e.clientY,
|
|
289
|
+
container,
|
|
290
|
+
this.dragIndex!,
|
|
291
|
+
);
|
|
292
|
+
scheduleOnce('afterRender', this, this.updateInsertionBox);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
// Throttle the expensive querySelectorAll / getBoundingClientRect work to
|
|
299
|
+
// one Ember queue flush. pointerClientX/Y above are already updated.
|
|
300
|
+
if (this.rafTimer !== null) {
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
this.rafTimer = scheduleOnce('afterRender', this, this.processMoveFrame);
|
|
304
|
+
};
|
|
305
|
+
|
|
306
|
+
onPointerUp = (event: Event): void => {
|
|
307
|
+
const e = event as PointerEvent;
|
|
308
|
+
if (e.pointerId !== this.activePointerId) {
|
|
309
|
+
return;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
const container = this.containerRef;
|
|
313
|
+
if (container) {
|
|
314
|
+
this.releasePointerCapture(container, e.pointerId);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
if (this.interactionMode === 'pending') {
|
|
318
|
+
this.holdTask.cancelAll();
|
|
319
|
+
const tappedIndex = this.dragIndex;
|
|
320
|
+
this.interactionMode = 'idle';
|
|
321
|
+
this.activePointerId = null;
|
|
322
|
+
this.dragIndex = null;
|
|
323
|
+
this.snapshotPlacements = null;
|
|
324
|
+
document.body.style.userSelect = '';
|
|
325
|
+
(document.body.style as BodyStyle).webkitUserSelect = '';
|
|
326
|
+
if (tappedIndex !== null) {
|
|
327
|
+
this.args.onOpen?.(tappedIndex);
|
|
328
|
+
}
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
if (this.interactionMode !== 'drag' || this.dragIndex === null) {
|
|
333
|
+
this.resetSession();
|
|
334
|
+
return;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
// Recompute once on drop so the final insertion reflects the latest
|
|
338
|
+
// pointer position even if a throttled move frame has not run yet.
|
|
339
|
+
const pendingInsertion = this.insertion;
|
|
340
|
+
const pendingDragIndex = this.dragIndex;
|
|
341
|
+
let finalInsertion = pendingInsertion;
|
|
342
|
+
|
|
343
|
+
if (container && pendingDragIndex !== null) {
|
|
344
|
+
const finalClientX = Number.isFinite(e.clientX)
|
|
345
|
+
? e.clientX
|
|
346
|
+
: this.pointerClientX;
|
|
347
|
+
const finalClientY = Number.isFinite(e.clientY)
|
|
348
|
+
? e.clientY
|
|
349
|
+
: this.pointerClientY;
|
|
350
|
+
const currentInsertion = this.getCurrentInsertion(
|
|
351
|
+
finalClientX,
|
|
352
|
+
finalClientY,
|
|
353
|
+
container,
|
|
354
|
+
pendingDragIndex,
|
|
355
|
+
);
|
|
356
|
+
finalInsertion = currentInsertion ?? pendingInsertion;
|
|
357
|
+
this.insertion = finalInsertion;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
// Snapshot placements at drop time so the settle timer's resolveInsertion
|
|
361
|
+
// call is unaffected by any parent update that arrives during the 200 ms
|
|
362
|
+
// settle window (e.g. a live-sync push).
|
|
363
|
+
const placementsAtDrop = this.args.placements;
|
|
364
|
+
|
|
365
|
+
// No-op drop: card released at its original position — skip settle entirely.
|
|
366
|
+
if (finalInsertion !== null && pendingDragIndex !== null) {
|
|
367
|
+
const next = resolveInsertion(
|
|
368
|
+
pendingDragIndex,
|
|
369
|
+
finalInsertion,
|
|
370
|
+
placementsAtDrop,
|
|
371
|
+
);
|
|
372
|
+
if (placementsEqual(placementsAtDrop, next)) {
|
|
373
|
+
this.resetSession();
|
|
374
|
+
return;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
if (container && finalInsertion) {
|
|
379
|
+
this.measureSettlePosition(container);
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
this.isSettling = true;
|
|
383
|
+
|
|
384
|
+
this.settleTimer = setTimeout(() => {
|
|
385
|
+
this.settleTimer = null;
|
|
386
|
+
if (finalInsertion && pendingDragIndex !== null) {
|
|
387
|
+
const newPlacements = resolveInsertion(
|
|
388
|
+
pendingDragIndex,
|
|
389
|
+
finalInsertion,
|
|
390
|
+
placementsAtDrop,
|
|
391
|
+
);
|
|
392
|
+
this.args.onChange(newPlacements);
|
|
393
|
+
this.announcement = 'Card moved.';
|
|
394
|
+
} else {
|
|
395
|
+
this.announcement = 'Movement cancelled.';
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
this.resetSession();
|
|
399
|
+
}, SETTLE_DURATION_MS);
|
|
400
|
+
};
|
|
401
|
+
|
|
402
|
+
// ── Keyboard ───────────────────────────────────────────────────────
|
|
403
|
+
|
|
404
|
+
onKeyDown = (event: Event): void => {
|
|
405
|
+
const e = event as KeyboardEvent;
|
|
406
|
+
|
|
407
|
+
if (e.key === 'Tab' && this.interactionMode === 'kb-drag') {
|
|
408
|
+
e.preventDefault();
|
|
409
|
+
this.cancelKeyboardDrag();
|
|
410
|
+
return;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
if (e.key === 'Escape') {
|
|
414
|
+
if (this.interactionMode === 'kb-drag') {
|
|
415
|
+
e.preventDefault();
|
|
416
|
+
this.cancelKeyboardDrag();
|
|
417
|
+
} else if (this.interactionMode !== 'idle') {
|
|
418
|
+
e.preventDefault();
|
|
419
|
+
this.cancelDrag();
|
|
420
|
+
} else {
|
|
421
|
+
this.selectedIndex = null;
|
|
422
|
+
this.args.onSelect?.(null);
|
|
423
|
+
}
|
|
424
|
+
return;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
if (this.interactionMode === 'kb-drag') {
|
|
428
|
+
this.handleKeyboardMove(e);
|
|
429
|
+
return;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
if (this.interactionMode === 'idle') {
|
|
433
|
+
switch (e.key) {
|
|
434
|
+
case 'ArrowUp':
|
|
435
|
+
e.preventDefault();
|
|
436
|
+
this.navigateFocus('up');
|
|
437
|
+
break;
|
|
438
|
+
case 'ArrowDown':
|
|
439
|
+
e.preventDefault();
|
|
440
|
+
this.navigateFocus('down');
|
|
441
|
+
break;
|
|
442
|
+
case 'ArrowLeft':
|
|
443
|
+
e.preventDefault();
|
|
444
|
+
this.navigateFocus('left');
|
|
445
|
+
break;
|
|
446
|
+
case 'ArrowRight':
|
|
447
|
+
e.preventDefault();
|
|
448
|
+
this.navigateFocus('right');
|
|
449
|
+
break;
|
|
450
|
+
case ' ':
|
|
451
|
+
case 'Enter': {
|
|
452
|
+
const cardEl = (e.target as HTMLElement)?.closest?.(
|
|
453
|
+
'[data-card-index]',
|
|
454
|
+
) as HTMLElement | null;
|
|
455
|
+
if (cardEl) {
|
|
456
|
+
e.preventDefault();
|
|
457
|
+
const index = parseInt(cardEl.getAttribute('data-card-index')!, 10);
|
|
458
|
+
this.startKeyboardDrag(index);
|
|
459
|
+
}
|
|
460
|
+
break;
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
};
|
|
465
|
+
|
|
466
|
+
// ── Actions ────────────────────────────────────────────────────────
|
|
467
|
+
|
|
468
|
+
select = (index: number | null): void => {
|
|
469
|
+
this.selectedIndex = index;
|
|
470
|
+
this.args.onSelect?.(index);
|
|
471
|
+
};
|
|
472
|
+
|
|
473
|
+
// ── Private ────────────────────────────────────────────────────────
|
|
474
|
+
|
|
475
|
+
private applyCollapse = (): void => {
|
|
476
|
+
this.collapseIndex = this.dragIndex;
|
|
477
|
+
};
|
|
478
|
+
|
|
479
|
+
private activateDrag(container: HTMLElement): void {
|
|
480
|
+
this.holdTask.cancelAll();
|
|
481
|
+
this.interactionMode = 'drag';
|
|
482
|
+
this.activeDragIndex = this.dragIndex;
|
|
483
|
+
// Snapshot the pre-drag placements so cancellation can restore them.
|
|
484
|
+
this.snapshotPlacements = this.args.placements.map((p) => ({ ...p }));
|
|
485
|
+
// Defer the collapse so it starts after the ghost has painted.
|
|
486
|
+
scheduleOnce('afterRender', this, this.applyCollapse);
|
|
487
|
+
|
|
488
|
+
const rect = this.measureActiveCardRect(container, this.dragIndex);
|
|
489
|
+
if (rect) {
|
|
490
|
+
this.dragGhostWidth = rect.width;
|
|
491
|
+
this.dragGhostHeight = rect.height;
|
|
492
|
+
this.activeCardHeight = rect.height;
|
|
493
|
+
this.dragOffsetX = this.pointerClientX - rect.left;
|
|
494
|
+
this.dragOffsetY = this.pointerClientY - rect.top;
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
private updateInsertionBox(): void {
|
|
499
|
+
const container = this.containerRef;
|
|
500
|
+
const ins = this.insertion;
|
|
501
|
+
if (!container || !ins) {
|
|
502
|
+
this.insertionBoxOffset = null;
|
|
503
|
+
return;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
const { column, position } = ins;
|
|
507
|
+
const colCards = this.args.placements
|
|
508
|
+
.filter((p) => p.column === column && p.index !== this.activeDragIndex)
|
|
509
|
+
.sort((a, b) => a.sortOrder - b.sortOrder);
|
|
510
|
+
|
|
511
|
+
const colEl = container.querySelector(
|
|
512
|
+
`[data-kanban-column="${column}"]`,
|
|
513
|
+
) as HTMLElement | null;
|
|
514
|
+
const bodyEl = colEl?.querySelector(
|
|
515
|
+
'[data-kanban-col-body]',
|
|
516
|
+
) as HTMLElement | null;
|
|
517
|
+
if (!bodyEl) {
|
|
518
|
+
this.insertionBoxOffset = null;
|
|
519
|
+
return;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
const height = this.getInsertionBoxHeight(container);
|
|
523
|
+
|
|
524
|
+
if (colCards.length === 0) {
|
|
525
|
+
this.insertionBoxOffset = { yOffset: 0, height };
|
|
526
|
+
return;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
// The insertion indicator is positioned in the board's untransformed flow,
|
|
530
|
+
// so remove any card transform offsets before measuring the gap.
|
|
531
|
+
const bodyRect = bodyEl.getBoundingClientRect();
|
|
532
|
+
const scrollTop = bodyEl.scrollTop;
|
|
533
|
+
const gap = parseFloat(getComputedStyle(bodyEl).gap) || 0;
|
|
534
|
+
// Find the first card whose sortOrder is >= the insertion position. Using
|
|
535
|
+
// sortOrder comparison instead of (position - 1) as an array index avoids
|
|
536
|
+
// an off-by-one when the source card is excluded from colCards (the gap in
|
|
537
|
+
// sortOrder values would push the index one past the intended slot).
|
|
538
|
+
const rawIdx = colCards.findIndex((c) => c.sortOrder >= position);
|
|
539
|
+
const insertIdx = rawIdx === -1 ? colCards.length : rawIdx;
|
|
540
|
+
|
|
541
|
+
if (insertIdx >= colCards.length) {
|
|
542
|
+
const lastEl = container.querySelector(
|
|
543
|
+
`[data-card-index="${colCards[colCards.length - 1]?.index}"]`,
|
|
544
|
+
) as HTMLElement | null;
|
|
545
|
+
if (lastEl) {
|
|
546
|
+
const rect = lastEl.getBoundingClientRect();
|
|
547
|
+
const matrix = new DOMMatrix(getComputedStyle(lastEl).transform);
|
|
548
|
+
this.insertionBoxOffset = {
|
|
549
|
+
yOffset: rect.bottom - matrix.m42 - bodyRect.top + gap + scrollTop,
|
|
550
|
+
height,
|
|
551
|
+
};
|
|
552
|
+
} else {
|
|
553
|
+
this.insertionBoxOffset = null;
|
|
554
|
+
}
|
|
555
|
+
} else {
|
|
556
|
+
const beforeEl = container.querySelector(
|
|
557
|
+
`[data-card-index="${colCards[insertIdx]?.index}"]`,
|
|
558
|
+
) as HTMLElement | null;
|
|
559
|
+
if (beforeEl) {
|
|
560
|
+
const rect = beforeEl.getBoundingClientRect();
|
|
561
|
+
const matrix = new DOMMatrix(getComputedStyle(beforeEl).transform);
|
|
562
|
+
this.insertionBoxOffset = {
|
|
563
|
+
yOffset: rect.top - matrix.m42 - bodyRect.top + scrollTop,
|
|
564
|
+
height,
|
|
565
|
+
};
|
|
566
|
+
} else {
|
|
567
|
+
this.insertionBoxOffset = null;
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
private measureSettlePosition(container: HTMLElement): void {
|
|
573
|
+
if (!this.insertion) {
|
|
574
|
+
return;
|
|
575
|
+
}
|
|
576
|
+
// The settle animation moves the ghost to the exact slot it will resolve
|
|
577
|
+
// into before onChange updates the parent-owned placements.
|
|
578
|
+
const { column, position } = this.insertion;
|
|
579
|
+
const placements = this.args.placements;
|
|
580
|
+
const colCards = placements
|
|
581
|
+
.filter((p) => p.column === column && p.index !== this.dragIndex)
|
|
582
|
+
.sort((a, b) => a.sortOrder - b.sortOrder);
|
|
583
|
+
|
|
584
|
+
const colEl = container.querySelector(
|
|
585
|
+
`[data-kanban-column="${column}"]`,
|
|
586
|
+
) as HTMLElement | null;
|
|
587
|
+
if (!colEl) {
|
|
588
|
+
return;
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
const bodyEl = colEl.querySelector(
|
|
592
|
+
'[data-kanban-col-body]',
|
|
593
|
+
) as HTMLElement | null;
|
|
594
|
+
if (!bodyEl) {
|
|
595
|
+
return;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
const bodyCs = getComputedStyle(bodyEl);
|
|
599
|
+
const bodyPadTop = parseFloat(bodyCs.paddingTop);
|
|
600
|
+
const bodyPadLeft = parseFloat(bodyCs.paddingLeft);
|
|
601
|
+
const bodyPadRight = parseFloat(bodyCs.paddingRight);
|
|
602
|
+
const gap = parseFloat(bodyCs.gap) || 0;
|
|
603
|
+
|
|
604
|
+
if (colCards.length === 0) {
|
|
605
|
+
const bodyRect = bodyEl.getBoundingClientRect();
|
|
606
|
+
this.settleX = bodyRect.left + bodyPadLeft;
|
|
607
|
+
this.settleY = bodyRect.top + bodyPadTop;
|
|
608
|
+
this.settleWidth = bodyRect.width - bodyPadLeft - bodyPadRight;
|
|
609
|
+
this.settleHeight = this.dragGhostHeight;
|
|
610
|
+
return;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
const rawIdx = colCards.findIndex((c) => c.sortOrder >= position);
|
|
614
|
+
const insertIdx = rawIdx === -1 ? colCards.length : rawIdx;
|
|
615
|
+
|
|
616
|
+
if (insertIdx >= colCards.length) {
|
|
617
|
+
const lastCardEl = container.querySelector(
|
|
618
|
+
`[data-card-index="${colCards[colCards.length - 1]?.index}"]`,
|
|
619
|
+
) as HTMLElement | null;
|
|
620
|
+
if (lastCardEl) {
|
|
621
|
+
const rect = lastCardEl.getBoundingClientRect();
|
|
622
|
+
const cs = getComputedStyle(lastCardEl);
|
|
623
|
+
const matrix = new DOMMatrix(cs.transform);
|
|
624
|
+
this.settleX = rect.left - matrix.m41;
|
|
625
|
+
this.settleY = rect.bottom - matrix.m42 + gap;
|
|
626
|
+
this.settleWidth = rect.width;
|
|
627
|
+
this.settleHeight = this.dragGhostHeight;
|
|
628
|
+
}
|
|
629
|
+
} else {
|
|
630
|
+
const beforeCardEl = container.querySelector(
|
|
631
|
+
`[data-card-index="${colCards[insertIdx]?.index}"]`,
|
|
632
|
+
) as HTMLElement | null;
|
|
633
|
+
if (beforeCardEl) {
|
|
634
|
+
const rect = beforeCardEl.getBoundingClientRect();
|
|
635
|
+
const cs = getComputedStyle(beforeCardEl);
|
|
636
|
+
const matrix = new DOMMatrix(cs.transform);
|
|
637
|
+
this.settleX = rect.left - matrix.m41;
|
|
638
|
+
this.settleY = rect.top - matrix.m42;
|
|
639
|
+
this.settleWidth = rect.width;
|
|
640
|
+
this.settleHeight = this.dragGhostHeight;
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
private startKeyboardDrag(index: number): void {
|
|
646
|
+
const placements = this.args.placements;
|
|
647
|
+
const placement = placements.find((p) => p.index === index);
|
|
648
|
+
if (!placement) {
|
|
649
|
+
return;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
const colCards = cardsInColumn(placement.column, placements).filter(
|
|
653
|
+
(p) => p.index !== index,
|
|
654
|
+
);
|
|
655
|
+
const slot = colCards.filter(
|
|
656
|
+
(c) => c.sortOrder < placement.sortOrder,
|
|
657
|
+
).length;
|
|
658
|
+
|
|
659
|
+
// Keyboard dragging reuses the same insertion model as pointer dragging,
|
|
660
|
+
// but advances it in discrete slots instead of by pointer geometry.
|
|
661
|
+
this.interactionMode = 'kb-drag';
|
|
662
|
+
this.activeDragIndex = index;
|
|
663
|
+
this.collapseIndex = index;
|
|
664
|
+
this.kbGrabIndex = index;
|
|
665
|
+
this.selectedIndex = index;
|
|
666
|
+
this.snapshotPlacements = placements.map((p) => ({ ...p }));
|
|
667
|
+
const rect = this.measureActiveCardRect(this.containerRef, index);
|
|
668
|
+
if (rect && rect.height > 0) {
|
|
669
|
+
this.dragGhostHeight = rect.height;
|
|
670
|
+
this.activeCardHeight = rect.height;
|
|
671
|
+
}
|
|
672
|
+
this.insertion = this.slotToInsertion(placement.column, slot, colCards);
|
|
673
|
+
this.updateInsertionBox();
|
|
674
|
+
this.args.onSelect?.(index);
|
|
675
|
+
this.announcement =
|
|
676
|
+
'Grabbed. Use arrow keys to move, Space or Enter to drop, Escape to cancel.';
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
private handleKeyboardMove(e: KeyboardEvent): void {
|
|
680
|
+
const movingKeys = [
|
|
681
|
+
'ArrowUp',
|
|
682
|
+
'ArrowDown',
|
|
683
|
+
'ArrowLeft',
|
|
684
|
+
'ArrowRight',
|
|
685
|
+
' ',
|
|
686
|
+
'Enter',
|
|
687
|
+
];
|
|
688
|
+
if (!movingKeys.includes(e.key)) {
|
|
689
|
+
return;
|
|
690
|
+
}
|
|
691
|
+
e.preventDefault();
|
|
692
|
+
|
|
693
|
+
if (e.key === ' ' || e.key === 'Enter') {
|
|
694
|
+
this.commitKeyboardDrag();
|
|
695
|
+
return;
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
if (!this.insertion) {
|
|
699
|
+
return;
|
|
700
|
+
}
|
|
701
|
+
const placements = this.args.placements;
|
|
702
|
+
const { column } = this.insertion;
|
|
703
|
+
const totalColumns = this.args.columnCount;
|
|
704
|
+
|
|
705
|
+
if (e.key === 'ArrowLeft' || e.key === 'ArrowRight') {
|
|
706
|
+
const delta = e.key === 'ArrowLeft' ? -1 : 1;
|
|
707
|
+
let newColumn = column + delta;
|
|
708
|
+
while (
|
|
709
|
+
newColumn >= 0 &&
|
|
710
|
+
newColumn < totalColumns &&
|
|
711
|
+
!this.isColumnVisible(newColumn)
|
|
712
|
+
) {
|
|
713
|
+
newColumn += delta;
|
|
714
|
+
}
|
|
715
|
+
if (newColumn < 0 || newColumn >= totalColumns || newColumn === column) {
|
|
716
|
+
return;
|
|
717
|
+
}
|
|
718
|
+
const currentColCards = cardsInColumn(column, placements).filter(
|
|
719
|
+
(p) => p.index !== this.activeDragIndex,
|
|
720
|
+
);
|
|
721
|
+
const currentSlot = this.insertionToSlot(this.insertion, currentColCards);
|
|
722
|
+
const newColCards = cardsInColumn(newColumn, placements).filter(
|
|
723
|
+
(p) => p.index !== this.activeDragIndex,
|
|
724
|
+
);
|
|
725
|
+
const newSlot = Math.min(currentSlot, newColCards.length);
|
|
726
|
+
this.insertion = this.slotToInsertion(newColumn, newSlot, newColCards);
|
|
727
|
+
this.updateInsertionBox();
|
|
728
|
+
this.announcement = `Column ${newColumn + 1}. Position ${newSlot + 1} of ${newColCards.length + 1}.`;
|
|
729
|
+
return;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
const colCards = cardsInColumn(column, placements).filter(
|
|
733
|
+
(p) => p.index !== this.activeDragIndex,
|
|
734
|
+
);
|
|
735
|
+
const currentSlot = this.insertionToSlot(this.insertion, colCards);
|
|
736
|
+
const newSlot =
|
|
737
|
+
e.key === 'ArrowUp'
|
|
738
|
+
? Math.max(0, currentSlot - 1)
|
|
739
|
+
: Math.min(colCards.length, currentSlot + 1);
|
|
740
|
+
if (newSlot === currentSlot) {
|
|
741
|
+
return;
|
|
742
|
+
}
|
|
743
|
+
this.insertion = this.slotToInsertion(column, newSlot, colCards);
|
|
744
|
+
this.updateInsertionBox();
|
|
745
|
+
this.announcement = `Position ${newSlot + 1} of ${colCards.length + 1}.`;
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
private commitKeyboardDrag(): void {
|
|
749
|
+
const pendingInsertion = this.insertion;
|
|
750
|
+
const pendingIndex = this.kbGrabIndex;
|
|
751
|
+
if (pendingInsertion !== null && pendingIndex !== null) {
|
|
752
|
+
const placements = this.args.placements;
|
|
753
|
+
const next = resolveInsertion(pendingIndex, pendingInsertion, placements);
|
|
754
|
+
if (!placementsEqual(placements, next)) {
|
|
755
|
+
this.args.onChange(next);
|
|
756
|
+
this.announcement = 'Card dropped.';
|
|
757
|
+
} else {
|
|
758
|
+
this.announcement = 'Card returned to original position.';
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
const focusTarget = pendingIndex;
|
|
762
|
+
this.resetSession();
|
|
763
|
+
if (focusTarget !== null) {
|
|
764
|
+
void this.focusCardTask.perform(focusTarget);
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
private cancelKeyboardDrag(): void {
|
|
769
|
+
const focusTarget = this.kbGrabIndex;
|
|
770
|
+
this.announcement = 'Movement cancelled.';
|
|
771
|
+
if (this.snapshotPlacements) {
|
|
772
|
+
this.args.onChange(this.snapshotPlacements);
|
|
773
|
+
}
|
|
774
|
+
this.resetSession();
|
|
775
|
+
if (focusTarget !== null) {
|
|
776
|
+
void this.focusCardTask.perform(focusTarget);
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
private navigateFocus(direction: 'up' | 'down' | 'left' | 'right'): void {
|
|
781
|
+
const placements = this.args.placements;
|
|
782
|
+
const visiblePlacements = placements.filter((p) =>
|
|
783
|
+
this.isColumnVisible(p.column),
|
|
784
|
+
);
|
|
785
|
+
if (visiblePlacements.length === 0) {
|
|
786
|
+
return;
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
const currentIndex = this.selectedIndex;
|
|
790
|
+
const current =
|
|
791
|
+
currentIndex !== null
|
|
792
|
+
? visiblePlacements.find((p) => p.index === currentIndex)
|
|
793
|
+
: null;
|
|
794
|
+
|
|
795
|
+
const colCards = (col: number) =>
|
|
796
|
+
visiblePlacements
|
|
797
|
+
.filter((p) => p.column === col)
|
|
798
|
+
.sort((a, b) => a.sortOrder - b.sortOrder);
|
|
799
|
+
|
|
800
|
+
let targetCard: KanbanPlacement | undefined;
|
|
801
|
+
|
|
802
|
+
if (!current) {
|
|
803
|
+
targetCard = visiblePlacements
|
|
804
|
+
.slice()
|
|
805
|
+
.sort((a, b) => a.column - b.column || a.sortOrder - b.sortOrder)[0];
|
|
806
|
+
} else if (direction === 'up') {
|
|
807
|
+
const cards = colCards(current.column);
|
|
808
|
+
const idx = cards.findIndex((p) => p.index === current.index);
|
|
809
|
+
targetCard = cards[idx - 1];
|
|
810
|
+
} else if (direction === 'down') {
|
|
811
|
+
const cards = colCards(current.column);
|
|
812
|
+
const idx = cards.findIndex((p) => p.index === current.index);
|
|
813
|
+
targetCard = cards[idx + 1];
|
|
814
|
+
} else {
|
|
815
|
+
const delta = direction === 'left' ? -1 : 1;
|
|
816
|
+
const totalCols = this.args.columnCount;
|
|
817
|
+
const currentRowIndex = colCards(current.column).findIndex(
|
|
818
|
+
(p) => p.index === current.index,
|
|
819
|
+
);
|
|
820
|
+
let col = current.column + delta;
|
|
821
|
+
while (col >= 0 && col < totalCols) {
|
|
822
|
+
if (!this.isColumnVisible(col)) {
|
|
823
|
+
col += delta;
|
|
824
|
+
continue;
|
|
825
|
+
}
|
|
826
|
+
const cards = colCards(col);
|
|
827
|
+
if (cards.length > 0) {
|
|
828
|
+
targetCard = cards[Math.min(currentRowIndex, cards.length - 1)];
|
|
829
|
+
break;
|
|
830
|
+
}
|
|
831
|
+
col += delta;
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
if (!targetCard) {
|
|
836
|
+
return;
|
|
837
|
+
}
|
|
838
|
+
this.selectedIndex = targetCard.index;
|
|
839
|
+
this.args.onSelect?.(targetCard.index);
|
|
840
|
+
void this.focusCardTask.perform(targetCard.index);
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
private focusCard(index: number): void {
|
|
844
|
+
const el = this.containerRef?.querySelector(
|
|
845
|
+
`[data-card-index="${index}"]`,
|
|
846
|
+
) as HTMLElement | null;
|
|
847
|
+
el?.focus();
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
private insertionToSlot(
|
|
851
|
+
insertion: InsertionPoint,
|
|
852
|
+
colCards: KanbanPlacement[],
|
|
853
|
+
): number {
|
|
854
|
+
if (insertion.insertBeforeIndex === -1) {
|
|
855
|
+
return colCards.length;
|
|
856
|
+
}
|
|
857
|
+
const idx = colCards.findIndex(
|
|
858
|
+
(c) => c.index === insertion.insertBeforeIndex,
|
|
859
|
+
);
|
|
860
|
+
return idx === -1 ? colCards.length : idx;
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
private slotToInsertion(
|
|
864
|
+
column: number,
|
|
865
|
+
slot: number,
|
|
866
|
+
colCards: KanbanPlacement[],
|
|
867
|
+
): InsertionPoint {
|
|
868
|
+
if (slot >= colCards.length) {
|
|
869
|
+
return {
|
|
870
|
+
column,
|
|
871
|
+
insertBeforeIndex: -1,
|
|
872
|
+
position: (colCards[colCards.length - 1]?.sortOrder ?? 0) + 1,
|
|
873
|
+
};
|
|
874
|
+
}
|
|
875
|
+
const beforeCard = colCards[slot]!;
|
|
876
|
+
return {
|
|
877
|
+
column,
|
|
878
|
+
insertBeforeIndex: beforeCard.index,
|
|
879
|
+
position: beforeCard.sortOrder,
|
|
880
|
+
};
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
private processMoveFrame(): void {
|
|
884
|
+
this.rafTimer = null;
|
|
885
|
+
if (this.interactionMode !== 'drag' || this.dragIndex === null) {
|
|
886
|
+
return;
|
|
887
|
+
}
|
|
888
|
+
// Pointer coordinates update on every event, but DOM measurement is batched
|
|
889
|
+
// here to avoid repeating layout work for each pointermove.
|
|
890
|
+
const container = this.containerRef;
|
|
891
|
+
if (!container) {
|
|
892
|
+
return;
|
|
893
|
+
}
|
|
894
|
+
this.insertion = this.getCurrentInsertion(
|
|
895
|
+
this.pointerClientX,
|
|
896
|
+
this.pointerClientY,
|
|
897
|
+
container,
|
|
898
|
+
this.dragIndex,
|
|
899
|
+
);
|
|
900
|
+
this.updateInsertionBox();
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
private isColumnVisible(column: number): boolean {
|
|
904
|
+
return this.args.isColumnVisible(column);
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
private cancelDrag(): void {
|
|
908
|
+
this.announcement = 'Movement cancelled.';
|
|
909
|
+
if (this.snapshotPlacements) {
|
|
910
|
+
this.args.onChange(this.snapshotPlacements);
|
|
911
|
+
}
|
|
912
|
+
this.abortPointerInteraction();
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
private abortPointerInteraction(): void {
|
|
916
|
+
const container = this.containerRef;
|
|
917
|
+
if (container && this.activePointerId !== null) {
|
|
918
|
+
this.releasePointerCapture(container, this.activePointerId);
|
|
919
|
+
}
|
|
920
|
+
this.resetSession();
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
private releasePointerCapture(
|
|
924
|
+
container: HTMLElement,
|
|
925
|
+
pointerId: number,
|
|
926
|
+
): void {
|
|
927
|
+
this.suppressLostPointerCapture = true;
|
|
928
|
+
try {
|
|
929
|
+
container.releasePointerCapture(pointerId);
|
|
930
|
+
} catch (_) {
|
|
931
|
+
// Capture was already lost; lostpointercapture has already fired or will
|
|
932
|
+
// not fire again, so the suppress flag should stay true to avoid a
|
|
933
|
+
// double-abort if it fires late.
|
|
934
|
+
}
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
private measureActiveCardRect(
|
|
938
|
+
container: HTMLElement | null,
|
|
939
|
+
index: number | null,
|
|
940
|
+
): DOMRect | null {
|
|
941
|
+
if (!container || index === null) {
|
|
942
|
+
return null;
|
|
943
|
+
}
|
|
944
|
+
const cardEl = container.querySelector(
|
|
945
|
+
`[data-card-index="${index}"]`,
|
|
946
|
+
) as HTMLElement | null;
|
|
947
|
+
return cardEl?.getBoundingClientRect() ?? null;
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
private getInsertionBoxHeight(container: HTMLElement): number {
|
|
951
|
+
if (this.dragGhostHeight > 0) {
|
|
952
|
+
return this.dragGhostHeight;
|
|
953
|
+
}
|
|
954
|
+
if (this.activeCardHeight > 0) {
|
|
955
|
+
return this.activeCardHeight;
|
|
956
|
+
}
|
|
957
|
+
if (this.insertionBoxOffset && this.insertionBoxOffset.height > 0) {
|
|
958
|
+
this.activeCardHeight = this.insertionBoxOffset.height;
|
|
959
|
+
return this.insertionBoxOffset.height;
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
const rect = this.measureActiveCardRect(container, this.activeDragIndex);
|
|
963
|
+
if (rect && rect.height > 0) {
|
|
964
|
+
this.activeCardHeight = rect.height;
|
|
965
|
+
return rect.height;
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
return 40;
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
private resetSession(): void {
|
|
972
|
+
// Clear every transient drag artifact so the next interaction starts from
|
|
973
|
+
// a fully neutral state, regardless of how this one ended.
|
|
974
|
+
this.suppressLostPointerCapture = false;
|
|
975
|
+
this.activePointerId = null;
|
|
976
|
+
this.activeDragIndex = null;
|
|
977
|
+
this.collapseIndex = null;
|
|
978
|
+
this.kbGrabIndex = null;
|
|
979
|
+
this.insertion = null;
|
|
980
|
+
this.insertionBoxOffset = null;
|
|
981
|
+
this.isSettling = false;
|
|
982
|
+
this.settleX = 0;
|
|
983
|
+
this.settleY = 0;
|
|
984
|
+
this.settleWidth = 0;
|
|
985
|
+
this.settleHeight = 0;
|
|
986
|
+
this.dragGhostWidth = 0;
|
|
987
|
+
this.dragGhostHeight = 0;
|
|
988
|
+
this.dragOffsetX = 0;
|
|
989
|
+
this.dragOffsetY = 0;
|
|
990
|
+
this.dragIndex = null;
|
|
991
|
+
this.activeCardHeight = 0;
|
|
992
|
+
this.snapshotPlacements = null;
|
|
993
|
+
this.interactionMode = 'idle';
|
|
994
|
+
this.holdTask.cancelAll();
|
|
995
|
+
this.focusCardTask.cancelAll();
|
|
996
|
+
if (this.settleTimer) {
|
|
997
|
+
clearTimeout(this.settleTimer);
|
|
998
|
+
this.settleTimer = null;
|
|
999
|
+
}
|
|
1000
|
+
if (this.rafTimer !== null) {
|
|
1001
|
+
cancel(this.rafTimer);
|
|
1002
|
+
this.rafTimer = null;
|
|
1003
|
+
}
|
|
1004
|
+
document.body.style.userSelect = '';
|
|
1005
|
+
(document.body.style as BodyStyle).webkitUserSelect = '';
|
|
1006
|
+
}
|
|
1007
|
+
}
|