@cardstack/boxel-cli 0.2.0-unstable.448 → 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,736 @@
|
|
|
1
|
+
import { registerDestructor } from '@ember/destroyable';
|
|
2
|
+
import { hash } from '@ember/helper';
|
|
3
|
+
import { action } from '@ember/object';
|
|
4
|
+
import type Owner from '@ember/owner';
|
|
5
|
+
import { service } from '@ember/service';
|
|
6
|
+
import Component from '@glimmer/component';
|
|
7
|
+
import { cached, tracked } from '@glimmer/tracking';
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
task,
|
|
11
|
+
restartableTask,
|
|
12
|
+
timeout,
|
|
13
|
+
all,
|
|
14
|
+
didCancel,
|
|
15
|
+
} from 'ember-concurrency';
|
|
16
|
+
|
|
17
|
+
import perform from 'ember-concurrency/helpers/perform';
|
|
18
|
+
|
|
19
|
+
import isEqual from 'lodash/isEqual';
|
|
20
|
+
|
|
21
|
+
import { Position } from 'monaco-editor';
|
|
22
|
+
|
|
23
|
+
import { LoadingIndicator } from '@cardstack/boxel-ui/components';
|
|
24
|
+
|
|
25
|
+
import {
|
|
26
|
+
hasExecutableExtension,
|
|
27
|
+
logger,
|
|
28
|
+
isSingleCardDocument,
|
|
29
|
+
isCardInstance,
|
|
30
|
+
meta as metaSymbol,
|
|
31
|
+
codeRefWithAbsoluteIdentifier,
|
|
32
|
+
type SingleCardDocument,
|
|
33
|
+
type PatchData,
|
|
34
|
+
} from '@cardstack/runtime-common';
|
|
35
|
+
import { getName } from '@cardstack/runtime-common/schema-analysis-plugin';
|
|
36
|
+
|
|
37
|
+
import LintAndFixCommand from '@cardstack/host/commands/lint-and-fix';
|
|
38
|
+
import monacoModifier from '@cardstack/host/modifiers/monaco';
|
|
39
|
+
import {
|
|
40
|
+
isReady,
|
|
41
|
+
type FileResource,
|
|
42
|
+
type Ready,
|
|
43
|
+
} from '@cardstack/host/resources/file';
|
|
44
|
+
import type {
|
|
45
|
+
ModuleAnalysis,
|
|
46
|
+
ModuleDeclaration,
|
|
47
|
+
} from '@cardstack/host/resources/module-contents';
|
|
48
|
+
import type { SaveType } from '@cardstack/host/services/card-service';
|
|
49
|
+
import type CommandService from '@cardstack/host/services/command-service';
|
|
50
|
+
import type EnvironmentService from '@cardstack/host/services/environment-service';
|
|
51
|
+
import { findDeclarationByName } from '@cardstack/host/services/module-contents-service';
|
|
52
|
+
import type MonacoService from '@cardstack/host/services/monaco-service';
|
|
53
|
+
import type { MonacoSDK } from '@cardstack/host/services/monaco-service';
|
|
54
|
+
import type OperatorModeStateService from '@cardstack/host/services/operator-mode-state-service';
|
|
55
|
+
import type RecentFilesService from '@cardstack/host/services/recent-files-service';
|
|
56
|
+
import type StoreService from '@cardstack/host/services/store';
|
|
57
|
+
import { applyBoxelFormatting } from '@cardstack/host/utils/editor/boxel-formatter';
|
|
58
|
+
|
|
59
|
+
import BinaryFileInfo from './binary-file-info';
|
|
60
|
+
|
|
61
|
+
interface Signature {
|
|
62
|
+
Args: {
|
|
63
|
+
file: FileResource | undefined;
|
|
64
|
+
moduleAnalysis: ModuleAnalysis | undefined;
|
|
65
|
+
selectedDeclaration: ModuleDeclaration | undefined;
|
|
66
|
+
isReadOnly: boolean;
|
|
67
|
+
saveSourceOnClose: (url: URL, content: string) => void;
|
|
68
|
+
selectDeclaration: (declaration: ModuleDeclaration) => void;
|
|
69
|
+
onFileSave: (status: 'started' | 'finished') => void;
|
|
70
|
+
onSetup: (
|
|
71
|
+
updateCursorByName: (name: string, fieldName?: string) => void,
|
|
72
|
+
) => void;
|
|
73
|
+
onWriteError?: (message: string | undefined) => void;
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const log = logger('component:code-editor');
|
|
78
|
+
|
|
79
|
+
export default class CodeEditor extends Component<Signature> {
|
|
80
|
+
@service declare private monacoService: MonacoService;
|
|
81
|
+
@service declare private operatorModeStateService: OperatorModeStateService;
|
|
82
|
+
@service declare private environmentService: EnvironmentService;
|
|
83
|
+
@service declare private recentFilesService: RecentFilesService;
|
|
84
|
+
@service declare private store: StoreService;
|
|
85
|
+
@service declare private commandService: CommandService;
|
|
86
|
+
|
|
87
|
+
@tracked private maybeMonacoSDK: MonacoSDK | undefined;
|
|
88
|
+
@tracked private isFormatting = false;
|
|
89
|
+
@tracked private formattingError: string | undefined;
|
|
90
|
+
|
|
91
|
+
private hasUnsavedSourceChanges = false;
|
|
92
|
+
private hasSavedUnsavedSourceOnClose = false;
|
|
93
|
+
private codePath;
|
|
94
|
+
private formatContextKey:
|
|
95
|
+
| ReturnType<
|
|
96
|
+
import('monaco-editor').editor.IStandaloneCodeEditor['createContextKey']
|
|
97
|
+
>
|
|
98
|
+
| undefined;
|
|
99
|
+
private formatActionDisposable:
|
|
100
|
+
| import('monaco-editor').IDisposable
|
|
101
|
+
| undefined;
|
|
102
|
+
|
|
103
|
+
constructor(owner: Owner, args: Signature['Args']) {
|
|
104
|
+
super(owner, args);
|
|
105
|
+
// note that we actually set our own `codePath` property because within
|
|
106
|
+
// onEditorDispose we actually can no longer see the codePath that pertains
|
|
107
|
+
// to the component that is being destroyed--rather we see the new codePath
|
|
108
|
+
// that we are transitioning to.
|
|
109
|
+
this.codePath = this.operatorModeStateService.state.codePath;
|
|
110
|
+
|
|
111
|
+
registerDestructor(this, () => {
|
|
112
|
+
this.saveUnsavedSourceOnClose();
|
|
113
|
+
this.formatActionDisposable?.dispose();
|
|
114
|
+
this.formatActionDisposable = undefined;
|
|
115
|
+
this.formatContextKey = undefined;
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
this.loadMonaco.perform();
|
|
119
|
+
|
|
120
|
+
this.args.onSetup(this.updateMonacoCursorPositionByName);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
private onEditorDispose = () => {
|
|
124
|
+
this.saveUnsavedSourceOnClose();
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
private get isReady() {
|
|
128
|
+
return this.maybeMonacoSDK && isReady(this.args.file);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
private get isLoading() {
|
|
132
|
+
return this.loadMonaco.isRunning || this.args.moduleAnalysis?.isLoading;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
private get declarations() {
|
|
136
|
+
return this.args.moduleAnalysis?.declarations || [];
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
private loadMonaco = task(async () => {
|
|
140
|
+
this.maybeMonacoSDK = await this.monacoService.getMonacoContext();
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
private get monacoSDK() {
|
|
144
|
+
if (this.maybeMonacoSDK) {
|
|
145
|
+
return this.maybeMonacoSDK;
|
|
146
|
+
}
|
|
147
|
+
throw new Error(`cannot use monaco SDK before it has loaded`);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
private get readyFile() {
|
|
151
|
+
if (isReady(this.args.file)) {
|
|
152
|
+
return this.args.file;
|
|
153
|
+
}
|
|
154
|
+
throw new Error(
|
|
155
|
+
`cannot access file contents ${this.codePath} before file is open`,
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
@cached
|
|
160
|
+
private get initialMonacoCursorPosition() {
|
|
161
|
+
if (this.codePath) {
|
|
162
|
+
let recentFile = this.recentFilesService.findRecentFileByURL(
|
|
163
|
+
this.codePath.toString(),
|
|
164
|
+
);
|
|
165
|
+
if (recentFile?.cursorPosition) {
|
|
166
|
+
return new Position(
|
|
167
|
+
recentFile.cursorPosition.line,
|
|
168
|
+
recentFile.cursorPosition.column,
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
let selectedFieldName = this.operatorModeStateService.state.fieldSelection;
|
|
174
|
+
let { selectedDeclaration } = this.args;
|
|
175
|
+
if (
|
|
176
|
+
selectedFieldName &&
|
|
177
|
+
selectedDeclaration &&
|
|
178
|
+
'possibleFields' in selectedDeclaration &&
|
|
179
|
+
selectedDeclaration.possibleFields
|
|
180
|
+
) {
|
|
181
|
+
let possibleFields = selectedDeclaration.possibleFields;
|
|
182
|
+
let field = possibleFields.get(selectedFieldName);
|
|
183
|
+
let loc =
|
|
184
|
+
field?.path?.node && 'loc' in field.path.node && field.path.node.loc
|
|
185
|
+
? field.path.node.loc
|
|
186
|
+
: undefined;
|
|
187
|
+
if (loc) {
|
|
188
|
+
let { start } = loc;
|
|
189
|
+
let { line, column } = start;
|
|
190
|
+
// Adjusts column to make cursor position right after the field name
|
|
191
|
+
let fieldDecoratorTextLength = 8;
|
|
192
|
+
column = column + fieldDecoratorTextLength + selectedFieldName.length;
|
|
193
|
+
return new Position(line, column);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
let loc =
|
|
198
|
+
selectedDeclaration?.path?.node &&
|
|
199
|
+
'body' in selectedDeclaration.path.node &&
|
|
200
|
+
'loc' in selectedDeclaration.path.node.body! &&
|
|
201
|
+
selectedDeclaration.path.node.body.loc
|
|
202
|
+
? selectedDeclaration?.path?.node.body.loc
|
|
203
|
+
: undefined;
|
|
204
|
+
if (loc) {
|
|
205
|
+
let { start } = loc;
|
|
206
|
+
return new Position(start.line, start.column);
|
|
207
|
+
}
|
|
208
|
+
return undefined;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
@action
|
|
212
|
+
private updateMonacoCursorPositionByName(name: string, fieldName?: string) {
|
|
213
|
+
let declaration = findDeclarationByName(name, this.declarations);
|
|
214
|
+
if (declaration === undefined) return;
|
|
215
|
+
return this.updateMonacoCursorPositionByDeclaration(declaration, fieldName);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
@action
|
|
219
|
+
private updateMonacoCursorPositionByDeclaration(
|
|
220
|
+
declaration: ModuleDeclaration,
|
|
221
|
+
fieldName?: string,
|
|
222
|
+
) {
|
|
223
|
+
if (
|
|
224
|
+
fieldName &&
|
|
225
|
+
'possibleFields' in declaration &&
|
|
226
|
+
declaration.possibleFields
|
|
227
|
+
) {
|
|
228
|
+
let possibleFields = declaration.possibleFields;
|
|
229
|
+
let field = possibleFields.get(fieldName);
|
|
230
|
+
let loc =
|
|
231
|
+
field?.path?.node && 'loc' in field.path.node && field.path.node.loc
|
|
232
|
+
? field.path.node.loc
|
|
233
|
+
: undefined;
|
|
234
|
+
if (loc) {
|
|
235
|
+
// Adjusts column to make cursor position right after the field name
|
|
236
|
+
let fieldDecoratorTextLength = 8;
|
|
237
|
+
let columnAdjustment = fieldDecoratorTextLength + fieldName.length;
|
|
238
|
+
this.monacoService.updateCursorPosition(
|
|
239
|
+
new Position(loc.start.line, loc.start.column + columnAdjustment),
|
|
240
|
+
);
|
|
241
|
+
}
|
|
242
|
+
} else if (
|
|
243
|
+
declaration.path?.node &&
|
|
244
|
+
'body' in declaration.path.node &&
|
|
245
|
+
'loc' in declaration.path.node.body! &&
|
|
246
|
+
declaration.path.node.body.loc
|
|
247
|
+
) {
|
|
248
|
+
let { start, end } = declaration.path.node.body.loc;
|
|
249
|
+
let currentCursorPosition = this.monacoService.getCursorPosition();
|
|
250
|
+
if (
|
|
251
|
+
currentCursorPosition &&
|
|
252
|
+
(currentCursorPosition.lineNumber < start.line ||
|
|
253
|
+
currentCursorPosition.lineNumber > end.line)
|
|
254
|
+
) {
|
|
255
|
+
this.monacoService.updateCursorPosition(
|
|
256
|
+
new Position(start.line, start.column),
|
|
257
|
+
);
|
|
258
|
+
}
|
|
259
|
+
} else if (
|
|
260
|
+
declaration.path?.node &&
|
|
261
|
+
'loc' in (declaration.path?.node || {}) &&
|
|
262
|
+
declaration.path.node.loc
|
|
263
|
+
) {
|
|
264
|
+
//This is a fallback path if we cannot find declaration / code for element
|
|
265
|
+
if (declaration.path?.isExportNamedDeclaration()) {
|
|
266
|
+
//capturing position of named export declarations
|
|
267
|
+
//this will always divert to the end of the specifier
|
|
268
|
+
let specifier = declaration.path?.node.specifiers.find(
|
|
269
|
+
(specifier) => getName(specifier.exported) === declaration.exportName,
|
|
270
|
+
);
|
|
271
|
+
if (
|
|
272
|
+
specifier &&
|
|
273
|
+
specifier.exported.loc !== null &&
|
|
274
|
+
specifier.exported.loc !== undefined
|
|
275
|
+
) {
|
|
276
|
+
let { start, end } = specifier.exported.loc;
|
|
277
|
+
this.monacoService.updateCursorPosition(
|
|
278
|
+
new Position(start.line, end.column + 1), //need to +1 for specifier positions
|
|
279
|
+
);
|
|
280
|
+
}
|
|
281
|
+
} else if (declaration.path.isExportDefaultDeclaration()) {
|
|
282
|
+
let { start, end } = declaration.path.node.loc;
|
|
283
|
+
this.monacoService.updateCursorPosition(
|
|
284
|
+
new Position(start.line, end.column),
|
|
285
|
+
);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
@action
|
|
291
|
+
private onCursorPositionChange(position: Position) {
|
|
292
|
+
this.selectDeclarationByMonacoCursorPosition(position);
|
|
293
|
+
|
|
294
|
+
if (!this.codePath) {
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
this.recentFilesService.updateCursorPositionByURL(
|
|
298
|
+
this.codePath.toString(),
|
|
299
|
+
{
|
|
300
|
+
line: position.lineNumber,
|
|
301
|
+
column: position.column,
|
|
302
|
+
},
|
|
303
|
+
);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
@action
|
|
307
|
+
private selectDeclarationByMonacoCursorPosition(position: Position) {
|
|
308
|
+
let declarationCursorOn = this.declarations.find(
|
|
309
|
+
(declaration: ModuleDeclaration) => {
|
|
310
|
+
if (
|
|
311
|
+
declaration.path?.node &&
|
|
312
|
+
'body' in declaration.path.node &&
|
|
313
|
+
'loc' in declaration.path.node.body! &&
|
|
314
|
+
declaration.path.node.body.loc
|
|
315
|
+
) {
|
|
316
|
+
let { start, end } = declaration.path.node.body.loc;
|
|
317
|
+
return (
|
|
318
|
+
position.lineNumber >= start.line && position.lineNumber <= end.line
|
|
319
|
+
);
|
|
320
|
+
}
|
|
321
|
+
return false;
|
|
322
|
+
},
|
|
323
|
+
);
|
|
324
|
+
|
|
325
|
+
if (
|
|
326
|
+
declarationCursorOn &&
|
|
327
|
+
declarationCursorOn !== this.args.selectedDeclaration
|
|
328
|
+
) {
|
|
329
|
+
this.args.selectDeclaration(declarationCursorOn);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
private contentChangedTask = restartableTask(async (content: string) => {
|
|
334
|
+
this.hasUnsavedSourceChanges = true;
|
|
335
|
+
this.hasSavedUnsavedSourceOnClose = false;
|
|
336
|
+
if (!isReady(this.args.file) || content === this.args.file?.content) {
|
|
337
|
+
return;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
// intentionally not awaiting this
|
|
341
|
+
this.syncWithStore.perform(content);
|
|
342
|
+
|
|
343
|
+
await timeout(this.environmentService.autoSaveDelayMs);
|
|
344
|
+
this.args.onWriteError?.(undefined);
|
|
345
|
+
this.writeSourceCodeToFile(
|
|
346
|
+
this.args.file,
|
|
347
|
+
content,
|
|
348
|
+
this.canSyncWithStore(content) ? 'editor-with-instance' : 'editor',
|
|
349
|
+
);
|
|
350
|
+
this.waitForSourceCodeWrite.perform();
|
|
351
|
+
this.hasUnsavedSourceChanges = false;
|
|
352
|
+
this.hasSavedUnsavedSourceOnClose = false;
|
|
353
|
+
});
|
|
354
|
+
|
|
355
|
+
private canSyncWithStore(content: string): boolean {
|
|
356
|
+
if (!isReady(this.args.file) || !this.args.file.url.endsWith('.json')) {
|
|
357
|
+
return false;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
let json: Record<string, any> | undefined;
|
|
361
|
+
try {
|
|
362
|
+
json = JSON.parse(content);
|
|
363
|
+
} catch (e) {
|
|
364
|
+
return false;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
if (!json || !isSingleCardDocument(json)) {
|
|
368
|
+
return false;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
let instance = this.store.peek(this.args.file.url.replace(/\.json$/, ''));
|
|
372
|
+
if (!instance || !isCardInstance(instance)) {
|
|
373
|
+
return false;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
let { adoptsFrom } = instance[metaSymbol] ?? {};
|
|
377
|
+
if (!adoptsFrom) {
|
|
378
|
+
return false;
|
|
379
|
+
}
|
|
380
|
+
adoptsFrom = codeRefWithAbsoluteIdentifier(
|
|
381
|
+
adoptsFrom,
|
|
382
|
+
new URL(this.args.file.url),
|
|
383
|
+
);
|
|
384
|
+
if (
|
|
385
|
+
!isEqual(
|
|
386
|
+
adoptsFrom,
|
|
387
|
+
codeRefWithAbsoluteIdentifier(
|
|
388
|
+
json.data.meta.adoptsFrom,
|
|
389
|
+
new URL(this.args.file.url),
|
|
390
|
+
),
|
|
391
|
+
)
|
|
392
|
+
) {
|
|
393
|
+
return false;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
return true;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
private syncWithStore = restartableTask(async (content: string) => {
|
|
400
|
+
if (!isReady(this.args.file)) {
|
|
401
|
+
return;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
if (!this.canSyncWithStore(content)) {
|
|
405
|
+
return;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
// we checked above to make sure that we are dealing with a SingleCardDocument
|
|
409
|
+
let doc: SingleCardDocument = JSON.parse(content);
|
|
410
|
+
let patch: PatchData = {
|
|
411
|
+
...(doc.data.attributes ? { attributes: doc.data.attributes } : {}),
|
|
412
|
+
...(doc.data.relationships
|
|
413
|
+
? { relationships: doc.data.relationships }
|
|
414
|
+
: {}),
|
|
415
|
+
...(doc.data.meta.fields
|
|
416
|
+
? { meta: { fields: doc.data.meta.fields } }
|
|
417
|
+
: {}),
|
|
418
|
+
};
|
|
419
|
+
await this.store.patch(this.args.file.url.replace(/\.json$/, ''), patch, {
|
|
420
|
+
doNotPersist: true,
|
|
421
|
+
});
|
|
422
|
+
});
|
|
423
|
+
|
|
424
|
+
// these saves can happen so fast that we'll make sure to wait at
|
|
425
|
+
// least 500ms for human consumption
|
|
426
|
+
private waitForSourceCodeWrite = restartableTask(async () => {
|
|
427
|
+
if (isReady(this.args.file)) {
|
|
428
|
+
this.args.onFileSave('started');
|
|
429
|
+
try {
|
|
430
|
+
await all([this.args.file.writing, timeout(500)]);
|
|
431
|
+
} catch {
|
|
432
|
+
// Errors are surfaced via writeError banners, so don't rethrow.
|
|
433
|
+
}
|
|
434
|
+
this.args.onFileSave('finished');
|
|
435
|
+
}
|
|
436
|
+
});
|
|
437
|
+
|
|
438
|
+
private writeSourceCodeToFile(
|
|
439
|
+
file: FileResource,
|
|
440
|
+
content: string,
|
|
441
|
+
saveType: SaveType,
|
|
442
|
+
) {
|
|
443
|
+
if (file.state !== 'ready') {
|
|
444
|
+
throw new Error('File is not ready to be written to');
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
let isJSON = file.name.endsWith('.json');
|
|
448
|
+
let validJSON = isJSON && this.safeJSONParse(content);
|
|
449
|
+
|
|
450
|
+
if (isJSON && !validJSON) {
|
|
451
|
+
log.warn(
|
|
452
|
+
`content for ${this.codePath} is not valid JSON, skipping write`,
|
|
453
|
+
);
|
|
454
|
+
return;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
// flush the loader so that the preview (when card instance data is shown),
|
|
458
|
+
// or schema editor (when module code is shown) gets refreshed on save
|
|
459
|
+
return file
|
|
460
|
+
.write(content, {
|
|
461
|
+
flushLoader: hasExecutableExtension(file.name),
|
|
462
|
+
saveType,
|
|
463
|
+
})
|
|
464
|
+
.catch((error) => {
|
|
465
|
+
// Task cancellations are expected when the restartable contentChangedTask is
|
|
466
|
+
// performed again while still running - this is normal behaviour, not an error
|
|
467
|
+
if (didCancel(error)) {
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
if (error?.status === 413 && error?.title) {
|
|
472
|
+
this.args.onWriteError?.(error.title);
|
|
473
|
+
return;
|
|
474
|
+
}
|
|
475
|
+
let message =
|
|
476
|
+
error?.message ??
|
|
477
|
+
(error?.title ? `${error.title}: ${error.message ?? ''}` : undefined);
|
|
478
|
+
this.args.onWriteError?.(message ? message.trim() : String(error));
|
|
479
|
+
});
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
private safeJSONParse(content: string) {
|
|
483
|
+
try {
|
|
484
|
+
return JSON.parse(content);
|
|
485
|
+
} catch (err) {
|
|
486
|
+
log.warn(
|
|
487
|
+
`content for ${this.codePath} is not valid JSON, skipping write`,
|
|
488
|
+
);
|
|
489
|
+
return;
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
private saveUnsavedSourceOnClose() {
|
|
494
|
+
// The component destructor and the Monaco modifier's onDispose callback can
|
|
495
|
+
// both run during the same file switch. We only want to persist the pending
|
|
496
|
+
// buffer once for that transition.
|
|
497
|
+
if (
|
|
498
|
+
this.hasSavedUnsavedSourceOnClose ||
|
|
499
|
+
!this.codePath ||
|
|
500
|
+
!this.hasUnsavedSourceChanges
|
|
501
|
+
) {
|
|
502
|
+
return;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
let monacoContent = this.monacoService.getMonacoContent();
|
|
506
|
+
if (!monacoContent) {
|
|
507
|
+
return;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
this.hasSavedUnsavedSourceOnClose = true;
|
|
511
|
+
this.hasUnsavedSourceChanges = false;
|
|
512
|
+
this.args.saveSourceOnClose(this.codePath, monacoContent);
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
private get language(): string | undefined {
|
|
516
|
+
if (this.codePath) {
|
|
517
|
+
const editorLanguages = this.monacoSDK.languages.getLanguages();
|
|
518
|
+
let extension = '.' + this.codePath.href.split('.').pop();
|
|
519
|
+
let language = editorLanguages.find((lang) =>
|
|
520
|
+
lang.extensions?.find((ext) => ext === extension),
|
|
521
|
+
);
|
|
522
|
+
return language?.id ?? 'plaintext';
|
|
523
|
+
}
|
|
524
|
+
return undefined;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
private setupFormatAction = (
|
|
528
|
+
editor: import('monaco-editor').editor.IStandaloneCodeEditor,
|
|
529
|
+
) => {
|
|
530
|
+
this.formatContextKey = editor.createContextKey(
|
|
531
|
+
'boxelFormatSupported',
|
|
532
|
+
this.computeFormatSupport(),
|
|
533
|
+
);
|
|
534
|
+
this.formatActionDisposable = editor.addAction({
|
|
535
|
+
id: 'boxel-format-with-boxel',
|
|
536
|
+
label: 'Format with Boxel',
|
|
537
|
+
contextMenuGroupId: '1_modification',
|
|
538
|
+
contextMenuOrder: 0.5,
|
|
539
|
+
precondition: 'boxelFormatSupported',
|
|
540
|
+
run: () => this.formatWithBoxel.perform(),
|
|
541
|
+
});
|
|
542
|
+
this.updateFormatActionAvailability();
|
|
543
|
+
};
|
|
544
|
+
|
|
545
|
+
private isFormatSupported(file: Ready) {
|
|
546
|
+
if (this.args.isReadOnly || file.isBinary) {
|
|
547
|
+
return false;
|
|
548
|
+
}
|
|
549
|
+
let normalizedName = file.name.toLowerCase();
|
|
550
|
+
return normalizedName.endsWith('.gts') || normalizedName.endsWith('.ts');
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
private updateFormatActionAvailability() {
|
|
554
|
+
if (!this.formatContextKey) {
|
|
555
|
+
return;
|
|
556
|
+
}
|
|
557
|
+
let supports = this.computeFormatSupport();
|
|
558
|
+
if (!supports) {
|
|
559
|
+
this.formattingError = undefined;
|
|
560
|
+
}
|
|
561
|
+
this.formatContextKey.set(supports && !this.isFormatting);
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
private formatWithBoxel = restartableTask(async () => {
|
|
565
|
+
if (this.isFormatting || !this.computeFormatSupport()) {
|
|
566
|
+
return;
|
|
567
|
+
}
|
|
568
|
+
if (!this.monacoService.editor) {
|
|
569
|
+
return;
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
let model = this.monacoService.editor.getModel();
|
|
573
|
+
if (!model) {
|
|
574
|
+
return;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
let content = model.getValue();
|
|
578
|
+
let readyFile = this.readyFile;
|
|
579
|
+
this.isFormatting = true;
|
|
580
|
+
this.formattingError = undefined;
|
|
581
|
+
this.updateFormatActionAvailability();
|
|
582
|
+
|
|
583
|
+
try {
|
|
584
|
+
let lintCommand = new LintAndFixCommand(
|
|
585
|
+
this.commandService.commandContext,
|
|
586
|
+
);
|
|
587
|
+
await applyBoxelFormatting({
|
|
588
|
+
lintAndFix: (input) => lintCommand.execute(input),
|
|
589
|
+
realm: readyFile.realmURL,
|
|
590
|
+
filename: readyFile.name,
|
|
591
|
+
fileContent: content,
|
|
592
|
+
editor: this.monacoService.editor,
|
|
593
|
+
model,
|
|
594
|
+
});
|
|
595
|
+
} catch (error) {
|
|
596
|
+
console.error(error);
|
|
597
|
+
this.formattingError =
|
|
598
|
+
error instanceof Error ? error.message : String(error);
|
|
599
|
+
} finally {
|
|
600
|
+
this.isFormatting = false;
|
|
601
|
+
this.updateFormatActionAvailability();
|
|
602
|
+
}
|
|
603
|
+
});
|
|
604
|
+
|
|
605
|
+
private computeFormatSupport(): boolean {
|
|
606
|
+
if (!isReady(this.args.file)) {
|
|
607
|
+
return false;
|
|
608
|
+
}
|
|
609
|
+
return this.isFormatSupported(this.args.file);
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
<template>
|
|
613
|
+
{{#if this.isReady}}
|
|
614
|
+
{{#if this.readyFile.isBinary}}
|
|
615
|
+
<BinaryFileInfo @readyFile={{this.readyFile}} />
|
|
616
|
+
{{else}}
|
|
617
|
+
<div class='monaco-wrapper'>
|
|
618
|
+
{{#if this.isFormatting}}
|
|
619
|
+
<div
|
|
620
|
+
class='formatting-status'
|
|
621
|
+
data-test-formatting-status
|
|
622
|
+
aria-live='assertive'
|
|
623
|
+
>
|
|
624
|
+
Formatting with Boxel…
|
|
625
|
+
</div>
|
|
626
|
+
{{/if}}
|
|
627
|
+
{{#if this.formattingError}}
|
|
628
|
+
<div
|
|
629
|
+
class='formatting-error'
|
|
630
|
+
data-test-formatting-error
|
|
631
|
+
role='alert'
|
|
632
|
+
>
|
|
633
|
+
{{this.formattingError}}
|
|
634
|
+
</div>
|
|
635
|
+
{{/if}}
|
|
636
|
+
<div
|
|
637
|
+
class='monaco-container {{if @isReadOnly "readonly"}}'
|
|
638
|
+
data-test-editor
|
|
639
|
+
data-test-percy-hide
|
|
640
|
+
data-monaco-container-operator-mode
|
|
641
|
+
{{monacoModifier
|
|
642
|
+
content=this.readyFile.content
|
|
643
|
+
contentChanged=(perform this.contentChangedTask)
|
|
644
|
+
monacoSDK=this.monacoSDK
|
|
645
|
+
language=this.language
|
|
646
|
+
initialCursorPosition=this.initialMonacoCursorPosition
|
|
647
|
+
onCursorPositionChange=this.onCursorPositionChange
|
|
648
|
+
onSetup=this.setupFormatAction
|
|
649
|
+
onDispose=this.onEditorDispose
|
|
650
|
+
readOnly=@isReadOnly
|
|
651
|
+
editorDisplayOptions=(hash lineNumbersMinChars=3 fontSize=12)
|
|
652
|
+
}}
|
|
653
|
+
></div>
|
|
654
|
+
</div>
|
|
655
|
+
{{/if}}
|
|
656
|
+
{{else if this.isLoading}}
|
|
657
|
+
<div class='loading'>
|
|
658
|
+
<LoadingIndicator />
|
|
659
|
+
</div>
|
|
660
|
+
{{/if}}
|
|
661
|
+
|
|
662
|
+
<style scoped>
|
|
663
|
+
.monaco-wrapper {
|
|
664
|
+
position: relative;
|
|
665
|
+
height: 100%;
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
.formatting-status,
|
|
669
|
+
.formatting-error {
|
|
670
|
+
position: absolute;
|
|
671
|
+
top: var(--boxel-sp-xs);
|
|
672
|
+
left: var(--boxel-sp-xs);
|
|
673
|
+
z-index: 1;
|
|
674
|
+
padding: var(--boxel-sp-xxs) var(--boxel-sp-xs);
|
|
675
|
+
border-radius: var(--boxel-border-radius-sm);
|
|
676
|
+
font: 600 var(--boxel-font-sm);
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
.formatting-status {
|
|
680
|
+
background: rgba(49, 132, 255, 0.9);
|
|
681
|
+
color: white;
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
.formatting-error {
|
|
685
|
+
top: calc(var(--boxel-sp-xs) + var(--boxel-sp-sm));
|
|
686
|
+
background: rgba(220, 53, 69, 0.9);
|
|
687
|
+
color: white;
|
|
688
|
+
max-width: 60ch;
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
.monaco-container {
|
|
692
|
+
height: 100%;
|
|
693
|
+
min-height: 100%;
|
|
694
|
+
width: 100%;
|
|
695
|
+
min-width: 100%;
|
|
696
|
+
padding-top: var(--boxel-sp-xxs);
|
|
697
|
+
background-color: var(--monaco-background);
|
|
698
|
+
font-family: var(--boxel-monospace-font-family);
|
|
699
|
+
font-size: var(--boxel-caption-font-size);
|
|
700
|
+
font-weight: 500;
|
|
701
|
+
}
|
|
702
|
+
.monaco-container:not(.readonly) {
|
|
703
|
+
filter: contrast(1.05) brightness(1.05);
|
|
704
|
+
}
|
|
705
|
+
.monaco-container.readonly {
|
|
706
|
+
--monaco-background: var(--monaco-readonly-background);
|
|
707
|
+
filter: contrast(1.1) saturate(1.1);
|
|
708
|
+
}
|
|
709
|
+
.monaco-container :deep(.monaco-editor) {
|
|
710
|
+
--vscode-editor-background: var(--monaco-background);
|
|
711
|
+
--vscode-editor-selectionBackground: var(--monaco-selection-background);
|
|
712
|
+
--vscode-editor-inactiveSelectionBackground: var(
|
|
713
|
+
--monaco-inactive-selection-background
|
|
714
|
+
);
|
|
715
|
+
|
|
716
|
+
--vscode-editorStickyScroll-background: var(--monaco-background);
|
|
717
|
+
--vscode-editorGutter-background: var(--monaco-background);
|
|
718
|
+
--vscode-editorStickyScroll-shadow: rgba(0 0 0 / 40%);
|
|
719
|
+
--vscode-scrollbar-shadow: rgba(0 0 0 / 20%);
|
|
720
|
+
}
|
|
721
|
+
.monaco-container :deep(.monaco-editor .sticky-widget) {
|
|
722
|
+
box-shadow: 0 1px 15px -2px var(--vscode-editorStickyScroll-shadow);
|
|
723
|
+
}
|
|
724
|
+
.monaco-container.readonly
|
|
725
|
+
:deep(.monaco-editor .view-overlays .current-line-exact) {
|
|
726
|
+
border-color: #454545;
|
|
727
|
+
}
|
|
728
|
+
.loading {
|
|
729
|
+
display: flex;
|
|
730
|
+
justify-content: center;
|
|
731
|
+
align-items: center;
|
|
732
|
+
height: 100%;
|
|
733
|
+
}
|
|
734
|
+
</style>
|
|
735
|
+
</template>
|
|
736
|
+
}
|