@kerfjs/ui 5.0.0-beta.13 → 5.0.0-beta.131
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/README.md +741 -163
- package/ai/application-ui-diagnostic-ids-v1.json +140 -0
- package/ai/application-ui-profile-sync.cjs +579 -0
- package/ai/application-ui-profile.d.mts +1 -0
- package/ai/application-ui-profile.d.ts +108 -0
- package/ai/application-ui-profile.defaults.json +226 -0
- package/ai/application-ui-profile.mjs +684 -0
- package/ai/application-ui-profile.schema.json +257 -0
- package/ai/catalog-authoring.json +34 -0
- package/ai/catalog-authoring.schema.json +105 -0
- package/ai/compile-time-contracts-v1.json +149 -0
- package/ai/compile-time-contracts-v1.schema.json +52 -0
- package/ai/component-catalog-extension.schema.json +104 -0
- package/ai/component-catalog.json +10592 -1339
- package/ai/component-catalog.schema.json +127 -2
- package/ai/component-class-owners.cjs +83 -0
- package/ai/component-composition-extension.d.ts +7 -0
- package/ai/component-composition-extension.schema.json +7 -0
- package/ai/component-composition-rules.json +586 -0
- package/ai/component-composition.d.ts +178 -0
- package/ai/component-composition.json +11319 -0
- package/ai/component-composition.schema.json +749 -0
- package/ai/component-props-overlay.json +8910 -0
- package/ai/component-props-overlay.schema.json +82 -0
- package/ai/component-props.json +34289 -0
- package/ai/component-props.schema.json +408 -0
- package/ai/components/README.md +216 -0
- package/ai/components/anchored-surface.md +99 -0
- package/ai/components/application-tabs.md +65 -0
- package/ai/components/backdrop-image.md +86 -0
- package/ai/components/badge.md +77 -0
- package/ai/components/button.md +103 -0
- package/ai/components/checkbox-group.md +91 -0
- package/ai/components/checkbox.md +92 -0
- package/ai/components/chip.md +82 -0
- package/ai/components/choice-chips.md +97 -0
- package/ai/components/collapsible-panel.md +103 -0
- package/ai/components/color-field.md +94 -0
- package/ai/components/color-picker.md +95 -0
- package/ai/components/color-swatches.md +84 -0
- package/ai/components/column-explorer.md +89 -0
- package/ai/components/column-track.md +81 -0
- package/ai/components/combobox.md +92 -0
- package/ai/components/content-item.md +107 -0
- package/ai/components/content-swap.md +78 -0
- package/ai/components/corner-status.md +88 -0
- package/ai/components/disclosure-arrow.md +77 -0
- package/ai/components/disclosure.md +90 -0
- package/ai/components/document-baseline.md +77 -0
- package/ai/components/edge-activity-indicator.md +81 -0
- package/ai/components/editor-frame.md +80 -0
- package/ai/components/empty-state.md +80 -0
- package/ai/components/feedback.md +71 -0
- package/ai/components/file-picker.md +92 -0
- package/ai/components/floating-toolbar.md +82 -0
- package/ai/components/form.md +86 -0
- package/ai/components/foundation.md +65 -0
- package/ai/components/framed-list.md +80 -0
- package/ai/components/gauge.md +83 -0
- package/ai/components/grid.md +101 -0
- package/ai/components/headers.md +63 -0
- package/ai/components/layout.md +75 -0
- package/ai/components/list-action-row.md +110 -0
- package/ai/components/list-detail-dialog.md +92 -0
- package/ai/components/list-header.md +93 -0
- package/ai/components/list-inset-control.md +74 -0
- package/ai/components/list-inset-text.md +72 -0
- package/ai/components/list-item.md +112 -0
- package/ai/components/list.md +131 -0
- package/ai/components/loading-spinner.md +73 -0
- package/ai/components/lucide-icon.md +99 -0
- package/ai/components/message-composer.md +87 -0
- package/ai/components/nav-stack.md +122 -0
- package/ai/components/paged-view.md +89 -0
- package/ai/components/pane.md +130 -0
- package/ai/components/popup-menu.md +177 -0
- package/ai/components/progress-bar.md +82 -0
- package/ai/components/progress-ring.md +80 -0
- package/ai/components/radio-group.md +95 -0
- package/ai/components/recipe-app-shell.md +57 -0
- package/ai/components/recipe-collapsible-sidebar.md +57 -0
- package/ai/components/recipe-compact-toolbar.md +57 -0
- package/ai/components/recipe-composer-form.md +57 -0
- package/ai/components/recipe-list-detail-dialog.md +57 -0
- package/ai/components/recipe-list-workspace-states.md +57 -0
- package/ai/components/recipe-loading-inspector.md +57 -0
- package/ai/components/recipe-media-detail.md +57 -0
- package/ai/components/recipe-navigation-sidebar.md +57 -0
- package/ai/components/recipe-navigation-stack.md +57 -0
- package/ai/components/recipe-workspace-header.md +57 -0
- package/ai/components/resize.md +106 -0
- package/ai/components/row.md +96 -0
- package/ai/components/scroll-effect.md +84 -0
- package/ai/components/search-field.md +110 -0
- package/ai/components/segmented-control.md +86 -0
- package/ai/components/select.md +122 -0
- package/ai/components/sized-region.md +86 -0
- package/ai/components/skeleton.md +84 -0
- package/ai/components/slider.md +86 -0
- package/ai/components/spacer.md +86 -0
- package/ai/components/split-button.md +85 -0
- package/ai/components/split-view.md +105 -0
- package/ai/components/state-banner.md +98 -0
- package/ai/components/summary-row.md +94 -0
- package/ai/components/sunken-panel.md +79 -0
- package/ai/components/surface-scaffold.md +137 -0
- package/ai/components/switch.md +83 -0
- package/ai/components/tab-bar.md +119 -0
- package/ai/components/tab-navigator.md +107 -0
- package/ai/components/tab-panel.md +84 -0
- package/ai/components/tabs.md +101 -0
- package/ai/components/tag-field.md +88 -0
- package/ai/components/text-field.md +104 -0
- package/ai/components/text.md +96 -0
- package/ai/components/toast.md +85 -0
- package/ai/components/toolbar-control-group.md +134 -0
- package/ai/components/toolbar-text.md +102 -0
- package/ai/components/toolbar.md +105 -0
- package/ai/components/tooltip.md +81 -0
- package/ai/components/tree-list.md +95 -0
- package/ai/components/value-preview.md +75 -0
- package/ai/components/value-table.md +80 -0
- package/ai/components/wa-accordion-item.md +63 -0
- package/ai/components/wa-accordion.md +71 -0
- package/ai/components/wa-animated-image.md +56 -0
- package/ai/components/wa-animation.md +56 -0
- package/ai/components/wa-avatar.md +56 -0
- package/ai/components/wa-badge.md +62 -0
- package/ai/components/wa-breadcrumb-item.md +56 -0
- package/ai/components/wa-breadcrumb.md +56 -0
- package/ai/components/wa-button-group.md +62 -0
- package/ai/components/wa-button.md +63 -0
- package/ai/components/wa-callout.md +60 -0
- package/ai/components/wa-card.md +67 -0
- package/ai/components/wa-carousel-item.md +54 -0
- package/ai/components/wa-carousel.md +58 -0
- package/ai/components/wa-checkbox-group.md +62 -0
- package/ai/components/wa-checkbox.md +63 -0
- package/ai/components/wa-color-picker.md +65 -0
- package/ai/components/wa-comparison.md +58 -0
- package/ai/components/wa-copy-button.md +58 -0
- package/ai/components/wa-details.md +69 -0
- package/ai/components/wa-dialog.md +67 -0
- package/ai/components/wa-divider.md +54 -0
- package/ai/components/wa-drawer.md +64 -0
- package/ai/components/wa-dropdown-item.md +64 -0
- package/ai/components/wa-dropdown.md +62 -0
- package/ai/components/wa-format-bytes.md +54 -0
- package/ai/components/wa-format-date.md +54 -0
- package/ai/components/wa-format-number.md +54 -0
- package/ai/components/wa-icon.md +59 -0
- package/ai/components/wa-include.md +55 -0
- package/ai/components/wa-input.md +64 -0
- package/ai/components/wa-intersection-observer.md +54 -0
- package/ai/components/wa-known-date.md +56 -0
- package/ai/components/wa-markdown.md +54 -0
- package/ai/components/wa-mutation-observer.md +54 -0
- package/ai/components/wa-number-input.md +58 -0
- package/ai/components/wa-option.md +61 -0
- package/ai/components/wa-otp-input.md +56 -0
- package/ai/components/wa-page.md +62 -0
- package/ai/components/wa-pagination.md +58 -0
- package/ai/components/wa-popover.md +61 -0
- package/ai/components/wa-popup.md +60 -0
- package/ai/components/wa-progress-bar.md +60 -0
- package/ai/components/wa-progress-ring.md +60 -0
- package/ai/components/wa-qr-code.md +54 -0
- package/ai/components/wa-radio-group.md +67 -0
- package/ai/components/wa-radio.md +63 -0
- package/ai/components/wa-random-content.md +54 -0
- package/ai/components/wa-rating.md +58 -0
- package/ai/components/wa-relative-time.md +54 -0
- package/ai/components/wa-resize-observer.md +54 -0
- package/ai/components/wa-scroller.md +61 -0
- package/ai/components/wa-select.md +67 -0
- package/ai/components/wa-skeleton.md +60 -0
- package/ai/components/wa-slider.md +63 -0
- package/ai/components/wa-spinner.md +60 -0
- package/ai/components/wa-split-panel.md +60 -0
- package/ai/components/wa-step.md +56 -0
- package/ai/components/wa-stepper.md +56 -0
- package/ai/components/wa-switch.md +62 -0
- package/ai/components/wa-tab-group.md +71 -0
- package/ai/components/wa-tab-panel.md +62 -0
- package/ai/components/wa-tab.md +63 -0
- package/ai/components/wa-tag-input.md +64 -0
- package/ai/components/wa-tag.md +62 -0
- package/ai/components/wa-textarea.md +62 -0
- package/ai/components/wa-time-input.md +58 -0
- package/ai/components/wa-toast-item.md +62 -0
- package/ai/components/wa-toast.md +62 -0
- package/ai/components/wa-tooltip.md +61 -0
- package/ai/components/wa-tree-item.md +63 -0
- package/ai/components/wa-tree.md +61 -0
- package/ai/components/wa-zoomable-frame.md +58 -0
- package/ai/components/workbench-dialog.md +92 -0
- package/ai/components/workbench.md +120 -0
- package/ai/design-mock/SKILL.md +27 -0
- package/ai/design-mock/references/hs2-example.md +7 -0
- package/ai/public-api-signatures-v1.md +7713 -524
- package/ai/skill.md +683 -66
- package/ai/view-document.schema.json +467 -0
- package/ai/webawesome-jsx-signatures-v1.md +12 -2
- package/analyzer/cli.mjs +85 -0
- package/analyzer/component-ownership.d.mts +72 -0
- package/analyzer/component-ownership.mjs +429 -0
- package/analyzer/index.d.mts +54 -0
- package/analyzer/index.mjs +2738 -0
- package/analyzer/loud-pairs.d.mts +49 -0
- package/analyzer/loud-pairs.mjs +357 -0
- package/analyzer/report.schema.json +66 -0
- package/analyzer/selectors.d.mts +21 -0
- package/analyzer/selectors.mjs +212 -0
- package/catalog-projection-cli.mjs +132 -0
- package/catalog-projection.d.mts +55 -0
- package/catalog-projection.mjs +62 -0
- package/dist/anchor-name-BZ1rpxaw.d.ts +4 -0
- package/dist/anchored-surface.d.ts +69 -0
- package/dist/anchored-surface.js +4 -0
- package/dist/anchored-surface.js.map +1 -0
- package/dist/backdrop-image.d.ts +147 -0
- package/dist/backdrop-image.js +6 -0
- package/dist/backdrop-image.js.map +1 -0
- package/dist/badge.d.ts +91 -0
- package/dist/badge.js +4 -0
- package/dist/badge.js.map +1 -0
- package/dist/browser/anchored-surface.js +3 -0
- package/dist/browser/backdrop-image.js +4 -0
- package/dist/browser/badge.js +3 -0
- package/dist/browser/button.js +5 -0
- package/dist/browser/catalog.js +29 -0
- package/dist/browser/checkbox-group.js +5 -0
- package/dist/browser/checkbox.js +4 -0
- package/dist/browser/chip.js +3 -0
- package/dist/browser/choice-chips.js +3 -0
- package/dist/browser/collapsible-panel.js +10 -0
- package/dist/browser/color-field.js +4 -0
- package/dist/browser/color-picker.js +5 -0
- package/dist/browser/color-swatches.js +3 -0
- package/dist/browser/column-explorer.js +13 -0
- package/dist/browser/column-track.js +3 -0
- package/dist/browser/combobox.js +3 -0
- package/dist/browser/content-item.js +5 -0
- package/dist/browser/content-swap.js +3 -0
- package/dist/browser/corner-status.js +3 -0
- package/dist/browser/disclosure.js +5 -0
- package/dist/browser/edge-activity-indicator.js +3 -0
- package/dist/browser/editor-frame.js +3 -0
- package/dist/browser/editor.js +50 -0
- package/dist/browser/file-picker.js +3 -0
- package/dist/browser/form.js +3 -0
- package/dist/browser/framed-list.js +3 -0
- package/dist/browser/gauge.js +3 -0
- package/dist/browser/grid.js +3 -0
- package/dist/browser/list-action-row.js +3 -0
- package/dist/browser/list-detail-dialog.js +15 -0
- package/dist/browser/list-header.js +3 -1
- package/dist/browser/list-item.js +1 -0
- package/dist/browser/list.js +3 -0
- package/dist/browser/message-composer.js +5 -0
- package/dist/browser/nav-stack.js +12 -0
- package/dist/browser/paged-view.js +3 -0
- package/dist/browser/pane.js +3 -0
- package/dist/browser/popup-menu.js +4 -0
- package/dist/browser/progress-bar.js +3 -0
- package/dist/browser/progress-ring.js +3 -0
- package/dist/browser/radio-group.js +4 -0
- package/dist/browser/row.js +3 -0
- package/dist/browser/scroll-effect.js +3 -0
- package/dist/browser/search-field.js +4 -0
- package/dist/browser/segmented-control.js +1 -1
- package/dist/browser/select.js +2 -1
- package/dist/browser/sized-region.js +3 -0
- package/dist/browser/slider.js +3 -0
- package/dist/browser/spacer.js +3 -0
- package/dist/browser/split-button.js +5 -0
- package/dist/browser/split-view.js +14 -0
- package/dist/browser/state-banner.js +1 -0
- package/dist/browser/summary-row.js +3 -0
- package/dist/browser/sunken-panel.js +3 -0
- package/dist/browser/surface-scaffold.js +4 -0
- package/dist/browser/switch.js +3 -0
- package/dist/browser/tab-bar-item.js +4 -0
- package/dist/browser/tab-navigator.js +4 -0
- package/dist/browser/tab-panel.js +3 -0
- package/dist/browser/tag-field.js +5 -0
- package/dist/browser/text-field.js +4 -0
- package/dist/browser/text.js +3 -0
- package/dist/browser/toolbar-control-group.js +2 -0
- package/dist/browser/tree-list.js +7 -0
- package/dist/browser/value-preview.js +3 -0
- package/dist/browser/workbench-dialog.js +16 -0
- package/dist/browser/workbench.js +15 -0
- package/dist/button.d.ts +164 -0
- package/dist/button.js +8 -0
- package/dist/button.js.map +1 -0
- package/dist/catalog-resources.d.ts +52 -0
- package/dist/catalog-resources.js +22 -0
- package/dist/catalog-resources.js.map +1 -0
- package/dist/catalog.d.ts +136 -101
- package/dist/catalog.js +707 -108
- package/dist/catalog.js.map +1 -1
- package/dist/checkbox-group.d.ts +70 -0
- package/dist/checkbox-group.js +7 -0
- package/dist/checkbox-group.js.map +1 -0
- package/dist/checkbox.d.ts +45 -0
- package/dist/checkbox.js +6 -0
- package/dist/checkbox.js.map +1 -0
- package/dist/chip.d.ts +117 -0
- package/dist/chip.js +4 -0
- package/dist/chip.js.map +1 -0
- package/dist/choice-chips.d.ts +135 -0
- package/dist/choice-chips.js +4 -0
- package/dist/choice-chips.js.map +1 -0
- package/dist/chunk-2FA3SX57.js +156 -0
- package/dist/chunk-2FA3SX57.js.map +1 -0
- package/dist/chunk-2GEGIPDR.js +78 -0
- package/dist/chunk-2GEGIPDR.js.map +1 -0
- package/dist/chunk-2GOCOLQL.js +270 -0
- package/dist/chunk-2GOCOLQL.js.map +1 -0
- package/dist/chunk-2RDWKN3Y.js +689 -0
- package/dist/chunk-2RDWKN3Y.js.map +1 -0
- package/dist/chunk-3K5V3ZSD.js +77 -0
- package/dist/chunk-3K5V3ZSD.js.map +1 -0
- package/dist/chunk-3TBMGGTA.js +27 -0
- package/dist/chunk-3TBMGGTA.js.map +1 -0
- package/dist/chunk-3UEMBHBK.js +1022 -0
- package/dist/chunk-3UEMBHBK.js.map +1 -0
- package/dist/chunk-3VZ6SFD4.js +8 -0
- package/dist/chunk-3VZ6SFD4.js.map +1 -0
- package/dist/chunk-3XSY5LAB.js +385 -0
- package/dist/chunk-3XSY5LAB.js.map +1 -0
- package/dist/chunk-44AOBT2F.js +16 -0
- package/dist/chunk-44AOBT2F.js.map +1 -0
- package/dist/chunk-4CYCJ3NY.js +563 -0
- package/dist/chunk-4CYCJ3NY.js.map +1 -0
- package/dist/chunk-4IXG6XCT.js +70 -0
- package/dist/chunk-4IXG6XCT.js.map +1 -0
- package/dist/chunk-4K7XXSOX.js +21 -0
- package/dist/chunk-4K7XXSOX.js.map +1 -0
- package/dist/chunk-4L5ZIKDZ.js +129 -0
- package/dist/chunk-4L5ZIKDZ.js.map +1 -0
- package/dist/chunk-4OH6JSGU.js +53 -0
- package/dist/chunk-4OH6JSGU.js.map +1 -0
- package/dist/chunk-4UWLHKNU.js +190 -0
- package/dist/chunk-4UWLHKNU.js.map +1 -0
- package/dist/chunk-5KWXM5O7.js +51 -0
- package/dist/chunk-5KWXM5O7.js.map +1 -0
- package/dist/chunk-63TJH2RF.js +231 -0
- package/dist/chunk-63TJH2RF.js.map +1 -0
- package/dist/chunk-6BXPN5SC.js +73 -0
- package/dist/chunk-6BXPN5SC.js.map +1 -0
- package/dist/chunk-6C6DLP3W.js +31 -0
- package/dist/chunk-6C6DLP3W.js.map +1 -0
- package/dist/chunk-6PHG2DMG.js +127 -0
- package/dist/chunk-6PHG2DMG.js.map +1 -0
- package/dist/chunk-6V6UHPJD.js +153 -0
- package/dist/chunk-6V6UHPJD.js.map +1 -0
- package/dist/chunk-76BLSFEA.js +825 -0
- package/dist/chunk-76BLSFEA.js.map +1 -0
- package/dist/chunk-76VCWWUA.js +73 -0
- package/dist/chunk-76VCWWUA.js.map +1 -0
- package/dist/chunk-7DIWVGGA.js +36 -0
- package/dist/chunk-7DIWVGGA.js.map +1 -0
- package/dist/chunk-7KN5OQVN.js +157 -0
- package/dist/chunk-7KN5OQVN.js.map +1 -0
- package/dist/chunk-7QQ3HE47.js +17 -0
- package/dist/chunk-7QQ3HE47.js.map +1 -0
- package/dist/chunk-7U65KLDL.js +67 -0
- package/dist/chunk-7U65KLDL.js.map +1 -0
- package/dist/chunk-AYPGXR2E.js +20 -0
- package/dist/chunk-AYPGXR2E.js.map +1 -0
- package/dist/chunk-BCHK33XL.js +167 -0
- package/dist/chunk-BCHK33XL.js.map +1 -0
- package/dist/chunk-C2TY5DJC.js +303 -0
- package/dist/chunk-C2TY5DJC.js.map +1 -0
- package/dist/chunk-C4FBYP2D.js +59 -0
- package/dist/chunk-C4FBYP2D.js.map +1 -0
- package/dist/chunk-CAB5IWV7.js +93 -0
- package/dist/chunk-CAB5IWV7.js.map +1 -0
- package/dist/chunk-CCPWJDRW.js +61 -0
- package/dist/chunk-CCPWJDRW.js.map +1 -0
- package/dist/chunk-CIAUILRR.js +222 -0
- package/dist/chunk-CIAUILRR.js.map +1 -0
- package/dist/chunk-CJAKN2KZ.js +35 -0
- package/dist/chunk-CJAKN2KZ.js.map +1 -0
- package/dist/chunk-CKPI4WIN.js +58 -0
- package/dist/chunk-CKPI4WIN.js.map +1 -0
- package/dist/chunk-CMG4OZPV.js +119 -0
- package/dist/chunk-CMG4OZPV.js.map +1 -0
- package/dist/chunk-COMEWURO.js +122 -0
- package/dist/chunk-COMEWURO.js.map +1 -0
- package/dist/chunk-COQI4OMZ.js +71 -0
- package/dist/chunk-COQI4OMZ.js.map +1 -0
- package/dist/chunk-CPTQABDQ.js +36 -0
- package/dist/chunk-CPTQABDQ.js.map +1 -0
- package/dist/chunk-CRHKWHTA.js +90 -0
- package/dist/chunk-CRHKWHTA.js.map +1 -0
- package/dist/chunk-CUUW57WB.js +539 -0
- package/dist/chunk-CUUW57WB.js.map +1 -0
- package/dist/chunk-D2KHQNJ6.js +155 -0
- package/dist/chunk-D2KHQNJ6.js.map +1 -0
- package/dist/chunk-D4MXSAMI.js +50 -0
- package/dist/chunk-D4MXSAMI.js.map +1 -0
- package/dist/chunk-DB64I3DB.js +191 -0
- package/dist/chunk-DB64I3DB.js.map +1 -0
- package/dist/chunk-DBP3N6E5.js +204 -0
- package/dist/chunk-DBP3N6E5.js.map +1 -0
- package/dist/chunk-DJWBXEF4.js +40 -0
- package/dist/chunk-DJWBXEF4.js.map +1 -0
- package/dist/chunk-DKPYHVIV.js +13 -0
- package/dist/chunk-DKPYHVIV.js.map +1 -0
- package/dist/chunk-DV6GE57V.js +191 -0
- package/dist/chunk-DV6GE57V.js.map +1 -0
- package/dist/chunk-E7Q6UNCB.js +41 -0
- package/dist/chunk-E7Q6UNCB.js.map +1 -0
- package/dist/chunk-E7ZRBMVQ.js +76 -0
- package/dist/chunk-E7ZRBMVQ.js.map +1 -0
- package/dist/chunk-ECVTRAXN.js +37 -0
- package/dist/chunk-ECVTRAXN.js.map +1 -0
- package/dist/chunk-EHR7R7YP.js +62 -0
- package/dist/chunk-EHR7R7YP.js.map +1 -0
- package/dist/chunk-EI55KWHP.js +28 -0
- package/dist/chunk-EI55KWHP.js.map +1 -0
- package/dist/chunk-FCO7BT4P.js +256 -0
- package/dist/chunk-FCO7BT4P.js.map +1 -0
- package/dist/chunk-FNJA4S6J.js +38 -0
- package/dist/chunk-FNJA4S6J.js.map +1 -0
- package/dist/chunk-FQETQ7CM.js +48 -0
- package/dist/chunk-FQETQ7CM.js.map +1 -0
- package/dist/chunk-FR5G77K5.js +82 -0
- package/dist/chunk-FR5G77K5.js.map +1 -0
- package/dist/chunk-GE2BQXB3.js +206 -0
- package/dist/chunk-GE2BQXB3.js.map +1 -0
- package/dist/chunk-GHV36C6I.js +94 -0
- package/dist/chunk-GHV36C6I.js.map +1 -0
- package/dist/chunk-GXSX6Q6O.js +42 -0
- package/dist/chunk-GXSX6Q6O.js.map +1 -0
- package/dist/chunk-HPOXLOVC.js +184 -0
- package/dist/chunk-HPOXLOVC.js.map +1 -0
- package/dist/chunk-HTERKONR.js +49 -0
- package/dist/chunk-HTERKONR.js.map +1 -0
- package/dist/chunk-I2K4OQKB.js +426 -0
- package/dist/chunk-I2K4OQKB.js.map +1 -0
- package/dist/chunk-IFDTSVE6.js +9 -0
- package/dist/chunk-IFDTSVE6.js.map +1 -0
- package/dist/chunk-IKS72C6P.js +53 -0
- package/dist/chunk-IKS72C6P.js.map +1 -0
- package/dist/chunk-IPYQYLSX.js +169 -0
- package/dist/chunk-IPYQYLSX.js.map +1 -0
- package/dist/chunk-IQSRHXZR.js +164 -0
- package/dist/chunk-IQSRHXZR.js.map +1 -0
- package/dist/chunk-IRC5N7FA.js +16 -0
- package/dist/chunk-IRC5N7FA.js.map +1 -0
- package/dist/chunk-JAC6AVZN.js +104 -0
- package/dist/chunk-JAC6AVZN.js.map +1 -0
- package/dist/chunk-JHUEYWWI.js +74 -0
- package/dist/chunk-JHUEYWWI.js.map +1 -0
- package/dist/chunk-JYKP7TBZ.js +27 -0
- package/dist/chunk-JYKP7TBZ.js.map +1 -0
- package/dist/chunk-KACJOE2N.js +170 -0
- package/dist/chunk-KACJOE2N.js.map +1 -0
- package/dist/chunk-KBS3GP6S.js +68 -0
- package/dist/chunk-KBS3GP6S.js.map +1 -0
- package/dist/chunk-KC6WUSNS.js +34 -0
- package/dist/chunk-KC6WUSNS.js.map +1 -0
- package/dist/chunk-KK3S5OTW.js +98 -0
- package/dist/chunk-KK3S5OTW.js.map +1 -0
- package/dist/chunk-KS7EXW4P.js +290 -0
- package/dist/chunk-KS7EXW4P.js.map +1 -0
- package/dist/chunk-LET362AM.js +105 -0
- package/dist/chunk-LET362AM.js.map +1 -0
- package/dist/chunk-LJV2FNOC.js +346 -0
- package/dist/chunk-LJV2FNOC.js.map +1 -0
- package/dist/chunk-LK3QJHVX.js +19 -0
- package/dist/chunk-LK3QJHVX.js.map +1 -0
- package/dist/chunk-LOW7J7SE.js +63 -0
- package/dist/chunk-LOW7J7SE.js.map +1 -0
- package/dist/chunk-LTOTL5AS.js +56 -0
- package/dist/chunk-LTOTL5AS.js.map +1 -0
- package/dist/chunk-M64TAGZY.js +590 -0
- package/dist/chunk-M64TAGZY.js.map +1 -0
- package/dist/chunk-M72QLDUO.js +33 -0
- package/dist/chunk-M72QLDUO.js.map +1 -0
- package/dist/chunk-MHMWQ7RB.js +19 -0
- package/dist/chunk-MHMWQ7RB.js.map +1 -0
- package/dist/chunk-MJ5RU6XT.js +173 -0
- package/dist/chunk-MJ5RU6XT.js.map +1 -0
- package/dist/chunk-MMOQR426.js +14 -0
- package/dist/chunk-MMOQR426.js.map +1 -0
- package/dist/chunk-MVWR5WRX.js +99 -0
- package/dist/chunk-MVWR5WRX.js.map +1 -0
- package/dist/chunk-NA4LKVPX.js +48 -0
- package/dist/chunk-NA4LKVPX.js.map +1 -0
- package/dist/chunk-OK7FUK7U.js +9 -0
- package/dist/chunk-OK7FUK7U.js.map +1 -0
- package/dist/chunk-OKZTLRGG.js +34 -0
- package/dist/chunk-OKZTLRGG.js.map +1 -0
- package/dist/chunk-OQFWF7Q7.js +178 -0
- package/dist/chunk-OQFWF7Q7.js.map +1 -0
- package/dist/chunk-OZKBIPXU.js +114 -0
- package/dist/chunk-OZKBIPXU.js.map +1 -0
- package/dist/chunk-PVKAIVKE.js +283 -0
- package/dist/chunk-PVKAIVKE.js.map +1 -0
- package/dist/chunk-Q5BPZPCO.js +52 -0
- package/dist/chunk-Q5BPZPCO.js.map +1 -0
- package/dist/chunk-QDSZTQXL.js +28 -0
- package/dist/chunk-QDSZTQXL.js.map +1 -0
- package/dist/chunk-QPTJ5DOO.js +87 -0
- package/dist/chunk-QPTJ5DOO.js.map +1 -0
- package/dist/chunk-QR7MGGOM.js +49 -0
- package/dist/chunk-QR7MGGOM.js.map +1 -0
- package/dist/chunk-QSJAIXLM.js +524 -0
- package/dist/chunk-QSJAIXLM.js.map +1 -0
- package/dist/chunk-QXXLDY6I.js +164 -0
- package/dist/chunk-QXXLDY6I.js.map +1 -0
- package/dist/chunk-QY77Q7RY.js +129 -0
- package/dist/chunk-QY77Q7RY.js.map +1 -0
- package/dist/chunk-QYOPZ2XS.js +124 -0
- package/dist/chunk-QYOPZ2XS.js.map +1 -0
- package/dist/chunk-QZA75NOK.js +202 -0
- package/dist/chunk-QZA75NOK.js.map +1 -0
- package/dist/chunk-R4JK2C6D.js +358 -0
- package/dist/chunk-R4JK2C6D.js.map +1 -0
- package/dist/chunk-RGB4DPMN.js +144 -0
- package/dist/chunk-RGB4DPMN.js.map +1 -0
- package/dist/chunk-RHMY45DK.js +178 -0
- package/dist/chunk-RHMY45DK.js.map +1 -0
- package/dist/{chunk-56RJXPHG.js → chunk-RPJOLDSR.js} +15 -4
- package/dist/chunk-RPJOLDSR.js.map +1 -0
- package/dist/chunk-S7QB5KMM.js +398 -0
- package/dist/chunk-S7QB5KMM.js.map +1 -0
- package/dist/chunk-SGYBIKQA.js +265 -0
- package/dist/chunk-SGYBIKQA.js.map +1 -0
- package/dist/chunk-SHECA2N4.js +96 -0
- package/dist/chunk-SHECA2N4.js.map +1 -0
- package/dist/chunk-SNUDT6AX.js +89 -0
- package/dist/chunk-SNUDT6AX.js.map +1 -0
- package/dist/chunk-TBVSPSGX.js +14 -0
- package/dist/chunk-TBVSPSGX.js.map +1 -0
- package/dist/chunk-TNJLNLVE.js +115 -0
- package/dist/chunk-TNJLNLVE.js.map +1 -0
- package/dist/chunk-TRJS7M2H.js +39 -0
- package/dist/chunk-TRJS7M2H.js.map +1 -0
- package/dist/chunk-TUID42UE.js +15 -0
- package/dist/chunk-TUID42UE.js.map +1 -0
- package/dist/chunk-TXBNPEIJ.js +31 -0
- package/dist/chunk-TXBNPEIJ.js.map +1 -0
- package/dist/chunk-UOBC36FL.js +149 -0
- package/dist/chunk-UOBC36FL.js.map +1 -0
- package/dist/chunk-UPHPFKAD.js +190 -0
- package/dist/chunk-UPHPFKAD.js.map +1 -0
- package/dist/chunk-UU37OR3D.js +18 -0
- package/dist/chunk-UU37OR3D.js.map +1 -0
- package/dist/chunk-V3IXAI4L.js +52 -0
- package/dist/chunk-V3IXAI4L.js.map +1 -0
- package/dist/chunk-VBXKYT4O.js +71 -0
- package/dist/chunk-VBXKYT4O.js.map +1 -0
- package/dist/chunk-WCMGPAY2.js +103 -0
- package/dist/chunk-WCMGPAY2.js.map +1 -0
- package/dist/chunk-WEQNPYVA.js +62 -0
- package/dist/chunk-WEQNPYVA.js.map +1 -0
- package/dist/chunk-WSPXSWFG.js +76 -0
- package/dist/chunk-WSPXSWFG.js.map +1 -0
- package/dist/chunk-WVQDIOD7.js +148 -0
- package/dist/chunk-WVQDIOD7.js.map +1 -0
- package/dist/chunk-X43QQWVC.js +208 -0
- package/dist/chunk-X43QQWVC.js.map +1 -0
- package/dist/chunk-XO5IOPM5.js +218 -0
- package/dist/chunk-XO5IOPM5.js.map +1 -0
- package/dist/chunk-Y4VR6VNM.js +44 -0
- package/dist/chunk-Y4VR6VNM.js.map +1 -0
- package/dist/chunk-YA6OAJY6.js +155 -0
- package/dist/chunk-YA6OAJY6.js.map +1 -0
- package/dist/chunk-YE6KCAIN.js +382 -0
- package/dist/chunk-YE6KCAIN.js.map +1 -0
- package/dist/collapsible-panel.d.ts +104 -17
- package/dist/collapsible-panel.js +174 -14
- package/dist/collapsible-panel.js.map +1 -1
- package/dist/color-field.d.ts +51 -0
- package/dist/color-field.js +92 -0
- package/dist/color-field.js.map +1 -0
- package/dist/color-picker.d.ts +113 -0
- package/dist/color-picker.js +8 -0
- package/dist/color-picker.js.map +1 -0
- package/dist/color-swatches.d.ts +56 -0
- package/dist/color-swatches.js +4 -0
- package/dist/color-swatches.js.map +1 -0
- package/dist/column-explorer.d.ts +71 -0
- package/dist/column-explorer.js +23 -0
- package/dist/column-explorer.js.map +1 -0
- package/dist/column-track.d.ts +70 -0
- package/dist/column-track.js +4 -0
- package/dist/column-track.js.map +1 -0
- package/dist/combobox.d.ts +44 -0
- package/dist/combobox.js +4 -0
- package/dist/combobox.js.map +1 -0
- package/dist/content-item.d.ts +182 -0
- package/dist/content-item.js +8 -0
- package/dist/content-item.js.map +1 -0
- package/dist/content-swap.d.ts +38 -0
- package/dist/content-swap.js +4 -0
- package/dist/content-swap.js.map +1 -0
- package/dist/corner-status.d.ts +40 -0
- package/dist/corner-status.js +4 -0
- package/dist/corner-status.js.map +1 -0
- package/dist/css-values.d.ts +127 -0
- package/dist/css-values.js +3 -0
- package/dist/css-values.js.map +1 -0
- package/dist/device-class.js +1 -73
- package/dist/device-class.js.map +1 -1
- package/dist/dialog-surface-controller-BeKZ3e8Z.d.ts +251 -0
- package/dist/disclosure-arrow.d.ts +10 -1
- package/dist/disclosure-arrow.js +3 -1
- package/dist/disclosure.d.ts +66 -0
- package/dist/disclosure.js +51 -0
- package/dist/disclosure.js.map +1 -0
- package/dist/edge-activity-indicator.d.ts +32 -0
- package/dist/edge-activity-indicator.js +4 -0
- package/dist/edge-activity-indicator.js.map +1 -0
- package/dist/editor-frame.d.ts +41 -0
- package/dist/editor-frame.js +3 -0
- package/dist/editor-frame.js.map +1 -0
- package/dist/editor.d.ts +447 -0
- package/dist/editor.js +15608 -0
- package/dist/editor.js.map +1 -0
- package/dist/empty-state.d.ts +9 -2
- package/dist/empty-state.js +3 -1
- package/dist/extension-attributes-IJ4decoa.d.ts +19 -0
- package/dist/file-picker.d.ts +75 -0
- package/dist/file-picker.js +4 -0
- package/dist/file-picker.js.map +1 -0
- package/dist/flex-alignment-4ms8ZbV8.d.ts +5 -0
- package/dist/floating-toolbar.d.ts +33 -6
- package/dist/floating-toolbar.js +2 -1
- package/dist/form.d.ts +45 -0
- package/dist/form.js +4 -0
- package/dist/form.js.map +1 -0
- package/dist/framed-list.d.ts +47 -0
- package/dist/framed-list.js +4 -0
- package/dist/framed-list.js.map +1 -0
- package/dist/gauge.d.ts +73 -0
- package/dist/gauge.js +157 -0
- package/dist/gauge.js.map +1 -0
- package/dist/grid.d.ts +58 -0
- package/dist/grid.js +6 -0
- package/dist/grid.js.map +1 -0
- package/dist/help-tags-register.d.ts +13 -0
- package/dist/help-tags-register.js +11 -0
- package/dist/help-tags-register.js.map +1 -0
- package/dist/index.d.ts +83 -17
- package/dist/index.js +103 -27
- package/dist/list-action-row.d.ts +69 -12
- package/dist/list-action-row.js +10 -1
- package/dist/list-detail-dialog.d.ts +131 -0
- package/dist/list-detail-dialog.js +173 -0
- package/dist/list-detail-dialog.js.map +1 -0
- package/dist/list-header.d.ts +122 -10
- package/dist/list-header.js +5 -1
- package/dist/list-icon-tile-B8dr97OW.d.ts +18 -0
- package/dist/list-inset-control.d.ts +14 -4
- package/dist/list-inset-control.js +2 -1
- package/dist/list-inset-text.d.ts +18 -4
- package/dist/list-inset-text.js +2 -1
- package/dist/list-item.d.ts +49 -5
- package/dist/list-item.js +7 -1
- package/dist/list.d.ts +268 -0
- package/dist/list.js +7 -0
- package/dist/list.js.map +1 -0
- package/dist/loading-spinner.d.ts +16 -2
- package/dist/loading-spinner.js +3 -1
- package/dist/lucide-icon.d.ts +27 -3
- package/dist/lucide-icon.js +3 -1
- package/dist/message-composer.d.ts +70 -0
- package/dist/message-composer.js +7 -0
- package/dist/message-composer.js.map +1 -0
- package/dist/nav-stack-DKrvqFjA.d.ts +206 -0
- package/dist/nav-stack.d.ts +17 -38
- package/dist/nav-stack.js +18 -1
- package/dist/paged-view.d.ts +47 -0
- package/dist/paged-view.js +86 -0
- package/dist/paged-view.js.map +1 -0
- package/dist/pane.d.ts +275 -0
- package/dist/pane.js +8 -0
- package/dist/pane.js.map +1 -0
- package/dist/panel-toolbar-CEcHHDkn.d.ts +85 -0
- package/dist/popup-menu-register.d.ts +11 -0
- package/dist/popup-menu-register.js +7 -0
- package/dist/popup-menu-register.js.map +1 -0
- package/dist/popup-menu.d.ts +193 -0
- package/dist/popup-menu.js +8 -0
- package/dist/popup-menu.js.map +1 -0
- package/dist/progress-bar.d.ts +52 -0
- package/dist/progress-bar.js +68 -0
- package/dist/progress-bar.js.map +1 -0
- package/dist/progress-ring.d.ts +44 -0
- package/dist/progress-ring.js +73 -0
- package/dist/progress-ring.js.map +1 -0
- package/dist/radio-group.d.ts +79 -0
- package/dist/radio-group.js +6 -0
- package/dist/radio-group.js.map +1 -0
- package/dist/resizable-region.d.ts +36 -3
- package/dist/resizable-region.js +2 -1
- package/dist/row.d.ts +58 -0
- package/dist/row.js +7 -0
- package/dist/row.js.map +1 -0
- package/dist/scroll-clearance-BikHljTc.d.ts +14 -0
- package/dist/scroll-effect.d.ts +86 -0
- package/dist/scroll-effect.js +5 -0
- package/dist/scroll-effect.js.map +1 -0
- package/dist/search-field-7wLt3Bd5.d.ts +221 -0
- package/dist/search-field-model.d.ts +4 -0
- package/dist/search-field-model.js +3 -0
- package/dist/search-field-model.js.map +1 -0
- package/dist/search-field.d.ts +4 -0
- package/dist/search-field.js +6 -0
- package/dist/search-field.js.map +1 -0
- package/dist/segmented-control.d.ts +40 -10
- package/dist/segmented-control.js +3 -1
- package/dist/select-register.d.ts +6 -3
- package/dist/select-register.js +403 -8
- package/dist/select-register.js.map +1 -1
- package/dist/select.d.ts +149 -9
- package/dist/select.js +6 -1
- package/dist/selection.d.ts +54 -0
- package/dist/selection.js +3 -0
- package/dist/selection.js.map +1 -0
- package/dist/semantic-content-BbzjvSu9.d.ts +14 -0
- package/dist/semantic-tone-CdW013KF.d.ts +4 -0
- package/dist/sides-BPSWde0A.d.ts +4 -0
- package/dist/sized-region.d.ts +44 -0
- package/dist/sized-region.js +4 -0
- package/dist/sized-region.js.map +1 -0
- package/dist/skeleton.d.ts +18 -7
- package/dist/skeleton.js +3 -1
- package/dist/slider.d.ts +74 -0
- package/dist/slider.js +103 -0
- package/dist/slider.js.map +1 -0
- package/dist/spacer.d.ts +22 -0
- package/dist/spacer.js +5 -0
- package/dist/spacer.js.map +1 -0
- package/dist/split-button.d.ts +69 -0
- package/dist/split-button.js +7 -0
- package/dist/split-button.js.map +1 -0
- package/dist/split-middle-De745N2j.d.ts +7 -0
- package/dist/split-view.d.ts +71 -6
- package/dist/split-view.js +18 -15
- package/dist/split-view.js.map +1 -1
- package/dist/state-banner.d.ts +59 -7
- package/dist/state-banner.js +4 -1
- package/dist/styles/anchored-surface.css +44 -0
- package/dist/styles/backdrop-image.css +330 -0
- package/dist/styles/badge.css +227 -0
- package/dist/styles/button.css +396 -0
- package/dist/styles/catalog/components/catalog-example-stack.css +14 -0
- package/dist/styles/catalog/components/catalog-example.css +250 -0
- package/dist/styles/catalog/components/catalog-stage.css +61 -0
- package/dist/styles/catalog/components/catalog.css +26 -0
- package/dist/styles/catalog.css +5 -522
- package/dist/styles/checkbox-group.css +63 -0
- package/dist/styles/checkbox.css +122 -0
- package/dist/styles/chip.css +234 -0
- package/dist/styles/choice-chips.css +264 -0
- package/dist/styles/collapsible-panel.css +459 -16
- package/dist/styles/color-field.css +125 -0
- package/dist/styles/color-picker.css +366 -0
- package/dist/styles/color-swatches.css +122 -0
- package/dist/styles/column-explorer.css +6 -0
- package/dist/styles/column-track.css +62 -0
- package/dist/styles/combobox.css +115 -0
- package/dist/styles/components/actions/button/button.css +396 -0
- package/dist/styles/components/actions/floating-toolbar/floating-toolbar.css +119 -0
- package/dist/styles/components/actions/popup-menu/popup-menu.css +651 -0
- package/dist/styles/components/actions/split-button/split-button.css +141 -0
- package/dist/styles/components/actions/toolbar/toolbar.css +524 -0
- package/dist/styles/components/actions/toolbar-control-group/toolbar-control-group.css +1041 -0
- package/dist/styles/components/actions/toolbar-text/toolbar-text.css +256 -0
- package/dist/styles/components/collections/column-explorer/column-explorer.css +6 -0
- package/dist/styles/components/collections/framed-list/framed-list.css +57 -0
- package/dist/styles/components/collections/list/list.css +301 -0
- package/dist/styles/components/collections/list-action-row/list-action-row.css +470 -0
- package/dist/styles/components/collections/list-header/list-header.css +272 -0
- package/dist/styles/components/collections/list-inset-control/list-inset-control.css +30 -0
- package/dist/styles/components/collections/list-inset-text/list-inset-text.css +29 -0
- package/dist/styles/components/collections/list-item/list-item.css +532 -0
- package/dist/styles/components/collections/summary-row/summary-row.css +198 -0
- package/dist/styles/components/collections/tree-list/tree-list.css +8 -0
- package/dist/styles/components/data-display/value-preview/value-preview.css +18 -0
- package/dist/styles/components/data-display/value-table/value-table.css +184 -0
- package/dist/styles/components/feedback/anchored-surface/anchored-surface.css +44 -0
- package/dist/styles/components/feedback/badge/badge.css +227 -0
- package/dist/styles/components/feedback/chip/chip.css +234 -0
- package/dist/styles/components/feedback/corner-status/corner-status.css +60 -0
- package/dist/styles/components/feedback/edge-activity-indicator/edge-activity-indicator.css +127 -0
- package/dist/styles/components/feedback/empty-state/empty-state.css +47 -0
- package/dist/styles/components/feedback/gauge/gauge.css +132 -0
- package/dist/styles/components/feedback/loading-spinner/loading-spinner.css +25 -0
- package/dist/styles/components/feedback/progress-bar/progress-bar.css +168 -0
- package/dist/styles/components/feedback/progress-ring/progress-ring.css +91 -0
- package/dist/styles/components/feedback/skeleton/skeleton.css +92 -0
- package/dist/styles/components/feedback/state-banner/state-banner.css +317 -0
- package/dist/styles/components/forms/checkbox/checkbox.css +122 -0
- package/dist/styles/components/forms/checkbox-group/checkbox-group.css +63 -0
- package/dist/styles/components/forms/choice-chips/choice-chips.css +264 -0
- package/dist/styles/components/forms/color-field/color-field.css +125 -0
- package/dist/styles/components/forms/color-picker/color-picker.css +366 -0
- package/dist/styles/components/forms/color-swatches/color-swatches.css +122 -0
- package/dist/styles/components/forms/combobox/combobox.css +115 -0
- package/dist/styles/components/forms/file-picker/file-picker.css +92 -0
- package/dist/styles/components/forms/form/form.css +6 -0
- package/dist/styles/components/forms/message-composer/message-composer.css +84 -0
- package/dist/styles/components/forms/radio-group/radio-group.css +269 -0
- package/dist/styles/components/forms/search-field/search-field.css +539 -0
- package/dist/styles/components/forms/segmented-control/segmented-control.css +212 -0
- package/dist/styles/components/forms/select/select.css +663 -0
- package/dist/styles/components/forms/slider/slider.css +241 -0
- package/dist/styles/components/forms/switch/switch.css +132 -0
- package/dist/styles/components/forms/tag-field/tag-field.css +8 -0
- package/dist/styles/components/forms/text-field/text-field.css +237 -0
- package/dist/styles/components/layout/collapsible-panel/collapsible-panel.css +589 -0
- package/dist/styles/components/layout/column-track/column-track.css +62 -0
- package/dist/styles/components/layout/content-swap/content-swap.css +154 -0
- package/dist/styles/components/layout/grid/grid.css +88 -0
- package/dist/styles/components/layout/pane/pane.css +796 -0
- package/dist/styles/components/layout/resizable-region/resizable-region.css +536 -0
- package/dist/styles/components/layout/row/row.css +125 -0
- package/dist/styles/components/layout/sized-region/sized-region.css +22 -0
- package/dist/styles/components/layout/spacer/spacer.css +11 -0
- package/dist/styles/components/layout/split-view/split-view.css +157 -0
- package/dist/styles/components/layout/workbench/workbench.css +1077 -0
- package/dist/styles/components/media/lucide-icon/lucide-icon.css +15 -0
- package/dist/styles/components/navigation/disclosure-arrow/disclosure-arrow.css +43 -0
- package/dist/styles/components/navigation/nav-stack/nav-stack.css +617 -0
- package/dist/styles/components/navigation/paged-view/paged-view.css +160 -0
- package/dist/styles/components/navigation/tab-bar/tab-bar.css +210 -0
- package/dist/styles/components/navigation/tab-bar-item/tab-bar-item.css +480 -0
- package/dist/styles/components/navigation/tab-navigator/tab-navigator.css +461 -0
- package/dist/styles/components/navigation/tab-panel/tab-panel.css +7 -0
- package/dist/styles/components/surfaces/backdrop-image/backdrop-image.css +208 -0
- package/dist/styles/components/surfaces/content-item/content-item.css +220 -0
- package/dist/styles/components/surfaces/disclosure/disclosure.css +136 -0
- package/dist/styles/components/surfaces/editor-frame/editor-frame.css +128 -0
- package/dist/styles/components/surfaces/scroll-effect/scroll-effect.css +121 -0
- package/dist/styles/components/surfaces/sunken-panel/sunken-panel.css +34 -0
- package/dist/styles/components/surfaces/surface-scaffold/surface-scaffold.css +1132 -0
- package/dist/styles/components/typography/text/text.css +270 -0
- package/dist/styles/content-item.css +551 -0
- package/dist/styles/content-swap.css +154 -0
- package/dist/styles/corner-status.css +60 -0
- package/dist/styles/disclosure-arrow.css +20 -0
- package/dist/styles/disclosure.css +136 -0
- package/dist/styles/document.css +102 -0
- package/dist/styles/edge-activity-indicator.css +127 -0
- package/dist/styles/editor/editor.css +585 -0
- package/dist/styles/editor-frame.css +128 -0
- package/dist/styles/editor.css +4 -0
- package/dist/styles/file-picker.css +92 -0
- package/dist/styles/floating-toolbar.css +87 -6
- package/dist/styles/form.css +6 -0
- package/dist/styles/foundation.css +550 -51
- package/dist/styles/framed-list.css +57 -0
- package/dist/styles/gauge.css +132 -0
- package/dist/styles/grid.css +88 -0
- package/dist/styles/layout.css +3 -41
- package/dist/styles/list-action-row.css +328 -18
- package/dist/styles/list-detail-dialog.css +11 -0
- package/dist/styles/list-header.css +172 -60
- package/dist/styles/list-inset-control.css +25 -2
- package/dist/styles/list-inset-text.css +27 -3
- package/dist/styles/list-item.css +443 -34
- package/dist/styles/list.css +301 -0
- package/dist/styles/loading-spinner.css +4 -0
- package/dist/styles/lucide-icon.css +9 -0
- package/dist/styles/message-composer.css +84 -0
- package/dist/styles/nav-stack.css +553 -47
- package/dist/styles/overlay-sheet.css +211 -0
- package/dist/styles/overlay-toast.css +149 -0
- package/dist/styles/overlay-tooltip.css +55 -0
- package/dist/styles/paged-view.css +160 -0
- package/dist/styles/pane.css +796 -0
- package/dist/styles/popup-menu.css +651 -0
- package/dist/styles/progress-bar.css +168 -0
- package/dist/styles/progress-ring.css +91 -0
- package/dist/styles/radio-group.css +269 -0
- package/dist/styles/resizable-region.css +429 -4
- package/dist/styles/row.css +125 -0
- package/dist/styles/scroll-effect.css +121 -0
- package/dist/styles/search-field.css +539 -0
- package/dist/styles/segmented-control.css +53 -10
- package/dist/styles/select.css +599 -74
- package/dist/styles/sized-region.css +22 -0
- package/dist/styles/skeleton.css +64 -3
- package/dist/styles/slider.css +241 -0
- package/dist/styles/spacer.css +11 -0
- package/dist/styles/split-button.css +141 -0
- package/dist/styles/split-view.css +125 -3
- package/dist/styles/state-banner.css +169 -25
- package/dist/styles/styles.css +52 -3
- package/dist/styles/summary-row.css +198 -0
- package/dist/styles/sunken-panel.css +34 -0
- package/dist/styles/surface-scaffold.css +1132 -0
- package/dist/styles/switch.css +132 -0
- package/dist/styles/tab-bar-item.css +480 -0
- package/dist/styles/tab-bar.css +174 -9
- package/dist/styles/tab-navigator.css +461 -0
- package/dist/styles/tab-panel.css +7 -0
- package/dist/styles/tag-field.css +8 -0
- package/dist/styles/text-field.css +237 -0
- package/dist/styles/text.css +270 -0
- package/dist/styles/toolbar-control-group.css +894 -78
- package/dist/styles/toolbar-text.css +223 -7
- package/dist/styles/toolbar.css +474 -11
- package/dist/styles/tree-list.css +8 -0
- package/dist/styles/value-preview.css +18 -0
- package/dist/styles/value-table.css +116 -7
- package/dist/styles/webawesome.css +823 -24
- package/dist/styles/workbench-dialog.css +10 -0
- package/dist/styles/workbench.css +990 -7
- package/dist/summary-row.d.ts +73 -0
- package/dist/summary-row.js +5 -0
- package/dist/summary-row.js.map +1 -0
- package/dist/sunken-panel.d.ts +42 -0
- package/dist/sunken-panel.js +5 -0
- package/dist/sunken-panel.js.map +1 -0
- package/dist/surface-scaffold-register.d.ts +12 -0
- package/dist/surface-scaffold-register.js +11 -0
- package/dist/surface-scaffold-register.js.map +1 -0
- package/dist/surface-scaffold.d.ts +283 -0
- package/dist/surface-scaffold.js +10 -0
- package/dist/surface-scaffold.js.map +1 -0
- package/dist/surface-tint-DQgYCaP9.d.ts +25 -0
- package/dist/switch.d.ts +38 -0
- package/dist/switch.js +4 -0
- package/dist/switch.js.map +1 -0
- package/dist/tab-bar-item.d.ts +100 -0
- package/dist/tab-bar-item.js +7 -0
- package/dist/tab-bar-item.js.map +1 -0
- package/dist/tab-bar.d.ts +46 -7
- package/dist/tab-bar.js +2 -1
- package/dist/tab-navigator.d.ts +177 -0
- package/dist/tab-navigator.js +155 -0
- package/dist/tab-navigator.js.map +1 -0
- package/dist/tab-panel.d.ts +35 -0
- package/dist/tab-panel.js +4 -0
- package/dist/tab-panel.js.map +1 -0
- package/dist/tag-field.d.ts +56 -0
- package/dist/tag-field.js +7 -0
- package/dist/tag-field.js.map +1 -0
- package/dist/text-field.d.ts +119 -0
- package/dist/text-field.js +6 -0
- package/dist/text-field.js.map +1 -0
- package/dist/text.d.ts +136 -0
- package/dist/text.js +5 -0
- package/dist/text.js.map +1 -0
- package/dist/toolbar-control-group.d.ts +201 -8
- package/dist/toolbar-control-group.js +6 -1
- package/dist/toolbar-text.d.ts +71 -9
- package/dist/toolbar-text.js +3 -1
- package/dist/toolbar.d.ts +88 -7
- package/dist/toolbar.js +2 -1
- package/dist/tree-list.d.ts +48 -0
- package/dist/tree-list.js +12 -0
- package/dist/tree-list.js.map +1 -0
- package/dist/tree-rows-Bms5QJvG.d.ts +68 -0
- package/dist/types-DmHWkSd6.d.ts +207 -0
- package/dist/value-preview.d.ts +25 -0
- package/dist/value-preview.js +4 -0
- package/dist/value-preview.js.map +1 -0
- package/dist/value-table.d.ts +37 -4
- package/dist/value-table.js +3 -1
- package/dist/view-runtime.d.ts +9 -0
- package/dist/view-runtime.js +8 -0
- package/dist/view-runtime.js.map +1 -0
- package/dist/webawesome.d.ts +11 -1
- package/dist/wire-catalog.d.ts +119 -5
- package/dist/wire-catalog.js +316 -14
- package/dist/wire-catalog.js.map +1 -1
- package/dist/wire-checkboxes.d.ts +10 -0
- package/dist/wire-checkboxes.js +4 -0
- package/dist/{wire-token-search-fields.js.map → wire-checkboxes.js.map} +1 -1
- package/dist/wire-choice-chips.d.ts +19 -0
- package/dist/wire-choice-chips.js +5 -0
- package/dist/wire-choice-chips.js.map +1 -0
- package/dist/wire-color-fields.d.ts +33 -0
- package/dist/wire-color-fields.js +12 -0
- package/dist/wire-color-fields.js.map +1 -0
- package/dist/wire-color-pickers.d.ts +35 -0
- package/dist/wire-color-pickers.js +10 -0
- package/dist/wire-color-pickers.js.map +1 -0
- package/dist/wire-column-explorer.d.ts +13 -0
- package/dist/wire-column-explorer.js +3 -0
- package/dist/wire-column-explorer.js.map +1 -0
- package/dist/wire-column-tracks.d.ts +13 -0
- package/dist/wire-column-tracks.js +4 -0
- package/dist/wire-column-tracks.js.map +1 -0
- package/dist/wire-comboboxes.d.ts +28 -0
- package/dist/wire-comboboxes.js +5 -0
- package/dist/wire-comboboxes.js.map +1 -0
- package/dist/wire-content-items.d.ts +24 -0
- package/dist/wire-content-items.js +5 -0
- package/dist/wire-content-items.js.map +1 -0
- package/dist/wire-corner-status.d.ts +11 -0
- package/dist/wire-corner-status.js +4 -0
- package/dist/wire-corner-status.js.map +1 -0
- package/dist/wire-file-pickers.d.ts +27 -0
- package/dist/wire-file-pickers.js +3 -0
- package/dist/wire-file-pickers.js.map +1 -0
- package/dist/wire-forms.d.ts +14 -0
- package/dist/wire-forms.js +3 -0
- package/dist/wire-forms.js.map +1 -0
- package/dist/wire-list-focus-scroll.d.ts +16 -0
- package/dist/wire-list-focus-scroll.js +3 -0
- package/dist/wire-list-focus-scroll.js.map +1 -0
- package/dist/wire-list-reorder.d.ts +41 -0
- package/dist/wire-list-reorder.js +3 -0
- package/dist/wire-list-reorder.js.map +1 -0
- package/dist/wire-message-composers.d.ts +17 -0
- package/dist/wire-message-composers.js +3 -0
- package/dist/wire-message-composers.js.map +1 -0
- package/dist/wire-nav-stack.d.ts +4 -1
- package/dist/wire-nav-stack.js +1 -85
- package/dist/wire-nav-stack.js.map +1 -1
- package/dist/wire-overlay-sheets.d.ts +20 -0
- package/dist/wire-overlay-sheets.js +5 -0
- package/dist/wire-overlay-sheets.js.map +1 -0
- package/dist/wire-paged-views.d.ts +27 -0
- package/dist/wire-paged-views.js +186 -0
- package/dist/wire-paged-views.js.map +1 -0
- package/dist/wire-pane-chrome.d.ts +21 -0
- package/dist/wire-pane-chrome.js +67 -0
- package/dist/wire-pane-chrome.js.map +1 -0
- package/dist/wire-resizable-regions.d.ts +2 -1
- package/dist/wire-resizable-regions.js +4 -1
- package/dist/wire-scroll-dividers.d.ts +87 -0
- package/dist/wire-scroll-dividers.js +3 -0
- package/dist/wire-scroll-dividers.js.map +1 -0
- package/dist/{wire-token-search-fields.d.ts → wire-search-fields.d.ts} +35 -25
- package/dist/wire-search-fields.js +8 -0
- package/dist/wire-search-fields.js.map +1 -0
- package/dist/wire-sidebar.d.ts +24 -4
- package/dist/wire-sidebar.js +1 -114
- package/dist/wire-sidebar.js.map +1 -1
- package/dist/wire-sliders.d.ts +12 -0
- package/dist/wire-sliders.js +3 -0
- package/dist/wire-sliders.js.map +1 -0
- package/dist/wire-summary-rows.d.ts +18 -0
- package/dist/wire-summary-rows.js +4 -0
- package/dist/wire-summary-rows.js.map +1 -0
- package/dist/wire-tab-bars.d.ts +57 -3
- package/dist/wire-tab-bars.js +1 -1
- package/dist/wire-tab-navigator.d.ts +13 -0
- package/dist/wire-tab-navigator.js +4 -0
- package/dist/wire-tab-navigator.js.map +1 -0
- package/dist/wire-tag-fields.d.ts +41 -0
- package/dist/wire-tag-fields.js +10 -0
- package/dist/wire-tag-fields.js.map +1 -0
- package/dist/wire-text-fields.d.ts +12 -0
- package/dist/wire-text-fields.js +3 -0
- package/dist/wire-text-fields.js.map +1 -0
- package/dist/wire-toolbar-visibility.d.ts +13 -0
- package/dist/wire-toolbar-visibility.js +3 -0
- package/dist/wire-toolbar-visibility.js.map +1 -0
- package/dist/wire-tree-list.d.ts +53 -0
- package/dist/wire-tree-list.js +3 -0
- package/dist/wire-tree-list.js.map +1 -0
- package/dist/wire-workbench.d.ts +132 -0
- package/dist/wire-workbench.js +8 -0
- package/dist/wire-workbench.js.map +1 -0
- package/dist/workbench-dialog.d.ts +114 -0
- package/dist/workbench-dialog.js +133 -0
- package/dist/workbench-dialog.js.map +1 -0
- package/dist/workbench.d.ts +271 -10
- package/dist/workbench.js +25 -15
- package/dist/workbench.js.map +1 -1
- package/docs/accessibility.md +899 -41
- package/docs/anchored-surface.md +107 -0
- package/docs/app-layouts.md +270 -11
- package/docs/apple-hig.md +2 -0
- package/docs/backdrop-image.md +142 -0
- package/docs/button.md +43 -0
- package/docs/catalog.md +599 -63
- package/docs/collapsible-panel.md +308 -25
- package/docs/color-field.md +65 -0
- package/docs/color-picker.md +102 -0
- package/docs/color-swatches.md +46 -0
- package/docs/column-explorer.md +79 -0
- package/docs/component-contract.md +980 -61
- package/docs/component-integration.md +79 -0
- package/docs/component-selection.md +1199 -110
- package/docs/dark-mode-checklist.md +15 -0
- package/docs/data-tables-and-lists.md +18 -0
- package/docs/design/sketch/Kerf-UI.sketch +0 -0
- package/docs/design/sketch/README.md +73 -0
- package/docs/design/sketch/advanced/README.md +75 -0
- package/docs/design/sketch/button/README.md +270 -0
- package/docs/design/sketch/content/README.md +70 -0
- package/docs/design/sketch/coverage.md +162 -0
- package/docs/design/sketch/forms/README.md +98 -0
- package/docs/design/sketch/lists/README.md +65 -0
- package/docs/design/sketch/toolbar/README.md +73 -0
- package/docs/design/sketch/unified/README.md +69 -0
- package/docs/design/sketch/unified/pages/advanced.png +0 -0
- package/docs/design/sketch/unified/pages/button.png +0 -0
- package/docs/design/sketch/unified/pages/content.png +0 -0
- package/docs/design/sketch/unified/pages/forms.png +0 -0
- package/docs/design/sketch/unified/pages/lists.png +0 -0
- package/docs/design/sketch/unified/pages/toolbar.png +0 -0
- package/docs/design/sketch-runner.md +87 -0
- package/docs/design/templates/button/emphasis-dark.svg +1 -0
- package/docs/design/templates/button/emphasis.svg +1 -0
- package/docs/design/templates/button/full-width-dark.svg +1 -0
- package/docs/design/templates/button/full-width.svg +1 -0
- package/docs/design/templates/button/icons-dark.svg +1 -0
- package/docs/design/templates/button/icons.svg +1 -0
- package/docs/design/templates/button/pill-dark.svg +1 -0
- package/docs/design/templates/button/pill.svg +1 -0
- package/docs/design/templates/button/states-dark.svg +1 -0
- package/docs/design/templates/button/states.svg +1 -0
- package/docs/design/templates/button/toggles-dark.svg +1 -0
- package/docs/design/templates/button/toggles.svg +1 -0
- package/docs/design/templates/button/tones-dark.svg +1 -0
- package/docs/design/templates/button/tones.svg +1 -0
- package/docs/design/templates/button-dark.svg +1 -0
- package/docs/design/templates/button.svg +1 -0
- package/docs/design/templates/checkbox/compact-dark.svg +1 -0
- package/docs/design/templates/checkbox/compact.svg +1 -0
- package/docs/design/templates/checkbox/error-dark.svg +1 -0
- package/docs/design/templates/checkbox/error.svg +1 -0
- package/docs/design/templates/checkbox/mixed-dark.svg +1 -0
- package/docs/design/templates/checkbox/mixed.svg +1 -0
- package/docs/design/templates/checkbox/states-dark.svg +1 -0
- package/docs/design/templates/checkbox/states.svg +1 -0
- package/docs/design/templates/checkbox-dark.svg +1 -0
- package/docs/design/templates/checkbox-group/horizontal-dark.svg +1 -0
- package/docs/design/templates/checkbox-group/horizontal.svg +1 -0
- package/docs/design/templates/checkbox-group/vertical-dark.svg +1 -0
- package/docs/design/templates/checkbox-group/vertical.svg +1 -0
- package/docs/design/templates/checkbox-group-dark.svg +1 -0
- package/docs/design/templates/checkbox-group.svg +1 -0
- package/docs/design/templates/checkbox.svg +1 -0
- package/docs/design/templates/chip/action-filters-dark.svg +1 -0
- package/docs/design/templates/chip/action-filters.svg +1 -0
- package/docs/design/templates/chip/tags-dark.svg +1 -0
- package/docs/design/templates/chip/tags.svg +1 -0
- package/docs/design/templates/chip-dark.svg +1 -0
- package/docs/design/templates/chip.svg +1 -0
- package/docs/design/templates/choice-chips/color-palette-dark.svg +1 -0
- package/docs/design/templates/choice-chips/color-palette.svg +1 -0
- package/docs/design/templates/choice-chips/compact-icons-dark.svg +1 -0
- package/docs/design/templates/choice-chips/compact-icons.svg +1 -0
- package/docs/design/templates/choice-chips/multiple-dark.svg +1 -0
- package/docs/design/templates/choice-chips/multiple.svg +1 -0
- package/docs/design/templates/choice-chips-dark.svg +1 -0
- package/docs/design/templates/choice-chips.svg +1 -0
- package/docs/design/templates/color-field/compact-dark.svg +1 -0
- package/docs/design/templates/color-field/compact.svg +1 -0
- package/docs/design/templates/color-field/error-dark.svg +1 -0
- package/docs/design/templates/color-field/error.svg +1 -0
- package/docs/design/templates/color-field/hint-dark.svg +1 -0
- package/docs/design/templates/color-field/hint.svg +1 -0
- package/docs/design/templates/color-field-dark.svg +1 -0
- package/docs/design/templates/color-field.svg +1 -0
- package/docs/design/templates/color-picker/gray-dark.svg +1 -0
- package/docs/design/templates/color-picker/gray.svg +1 -0
- package/docs/design/templates/color-picker/hsb-dark.svg +1 -0
- package/docs/design/templates/color-picker/hsb.svg +1 -0
- package/docs/design/templates/color-picker/rgb-dark.svg +1 -0
- package/docs/design/templates/color-picker/rgb.svg +1 -0
- package/docs/design/templates/color-picker-dark.svg +1 -0
- package/docs/design/templates/color-picker.svg +1 -0
- package/docs/design/templates/color-swatches/palette-dark.svg +1 -0
- package/docs/design/templates/color-swatches/palette.svg +1 -0
- package/docs/design/templates/color-swatches-dark.svg +1 -0
- package/docs/design/templates/color-swatches.svg +1 -0
- package/docs/design/templates/disclosure/embedded-dark.svg +1 -0
- package/docs/design/templates/disclosure/embedded.svg +1 -0
- package/docs/design/templates/disclosure/framed-sunken-dark.svg +1 -0
- package/docs/design/templates/disclosure/framed-sunken.svg +1 -0
- package/docs/design/templates/disclosure/plain-dark.svg +1 -0
- package/docs/design/templates/disclosure/plain.svg +1 -0
- package/docs/design/templates/disclosure-dark.svg +1 -0
- package/docs/design/templates/disclosure.svg +1 -0
- package/docs/design/templates/empty-state/filtered-dark.svg +1 -1
- package/docs/design/templates/empty-state/filtered.svg +1 -1
- package/docs/design/templates/empty-state/with-action-dark.svg +1 -1
- package/docs/design/templates/empty-state/with-action.svg +1 -1
- package/docs/design/templates/empty-state-dark.svg +1 -7
- package/docs/design/templates/empty-state.svg +1 -7
- package/docs/design/templates/gauge/bare-dark.svg +1 -0
- package/docs/design/templates/gauge/bare.svg +1 -0
- package/docs/design/templates/gauge/full-dark.svg +1 -0
- package/docs/design/templates/gauge/full.svg +1 -0
- package/docs/design/templates/gauge-dark.svg +1 -0
- package/docs/design/templates/gauge.svg +1 -0
- package/docs/design/templates/list/compact-dark.svg +1 -0
- package/docs/design/templates/list/compact.svg +1 -0
- package/docs/design/templates/list/stack-dark.svg +1 -0
- package/docs/design/templates/list/stack.svg +1 -0
- package/docs/design/templates/list-action-row/default-dark.svg +1 -1
- package/docs/design/templates/list-action-row/default.svg +1 -1
- package/docs/design/templates/list-action-row/icon-tile-dark.svg +1 -0
- package/docs/design/templates/list-action-row/icon-tile.svg +1 -0
- package/docs/design/templates/list-action-row/selected-dark.svg +1 -1
- package/docs/design/templates/list-action-row/selected.svg +1 -1
- package/docs/design/templates/list-action-row/trailing-menu-dark.svg +1 -0
- package/docs/design/templates/list-action-row/trailing-menu.svg +1 -0
- package/docs/design/templates/list-action-row-dark.svg +1 -7
- package/docs/design/templates/list-action-row.svg +1 -7
- package/docs/design/templates/list-dark.svg +1 -0
- package/docs/design/templates/list-header/action-dark.svg +1 -1
- package/docs/design/templates/list-header/action.svg +1 -1
- package/docs/design/templates/list-header/count-dark.svg +1 -1
- package/docs/design/templates/list-header/count.svg +1 -1
- package/docs/design/templates/list-header/inline-action-dark.svg +1 -0
- package/docs/design/templates/list-header/inline-action.svg +1 -0
- package/docs/design/templates/list-header/size-l-dark.svg +1 -0
- package/docs/design/templates/list-header/size-l.svg +1 -0
- package/docs/design/templates/list-header/size-m-dark.svg +1 -0
- package/docs/design/templates/list-header/size-m.svg +1 -0
- package/docs/design/templates/list-header/size-xl-dark.svg +1 -0
- package/docs/design/templates/list-header/size-xl.svg +1 -0
- package/docs/design/templates/list-header/size-xs-dark.svg +1 -0
- package/docs/design/templates/list-header/size-xs.svg +1 -0
- package/docs/design/templates/list-header/toggle-collapsed-dark.svg +1 -1
- package/docs/design/templates/list-header/toggle-collapsed.svg +1 -1
- package/docs/design/templates/list-header/toggle-expanded-dark.svg +1 -1
- package/docs/design/templates/list-header/toggle-expanded.svg +1 -1
- package/docs/design/templates/list-header-dark.svg +1 -11
- package/docs/design/templates/list-header.svg +1 -11
- package/docs/design/templates/list-item/default-dark.svg +1 -1
- package/docs/design/templates/list-item/default.svg +1 -1
- package/docs/design/templates/list-item/icon-tile-dark.svg +1 -0
- package/docs/design/templates/list-item/icon-tile.svg +1 -0
- package/docs/design/templates/list-item/multiline-dark.svg +1 -1
- package/docs/design/templates/list-item/multiline.svg +1 -1
- package/docs/design/templates/list-item/selected-dark.svg +1 -1
- package/docs/design/templates/list-item/selected.svg +1 -1
- package/docs/design/templates/list-item/trailing-dark.svg +1 -1
- package/docs/design/templates/list-item/trailing.svg +1 -1
- package/docs/design/templates/list-item-dark.svg +1 -11
- package/docs/design/templates/list-item.svg +1 -11
- package/docs/design/templates/list.svg +1 -0
- package/docs/design/templates/message-composer/chat-dark.svg +1 -0
- package/docs/design/templates/message-composer/chat.svg +1 -0
- package/docs/design/templates/message-composer/prompt-dark.svg +1 -0
- package/docs/design/templates/message-composer/prompt.svg +1 -0
- package/docs/design/templates/message-composer-dark.svg +1 -0
- package/docs/design/templates/message-composer.svg +1 -0
- package/docs/design/templates/progress-bar/determinate-dark.svg +1 -0
- package/docs/design/templates/progress-bar/determinate.svg +1 -0
- package/docs/design/templates/progress-bar/tones-dark.svg +1 -0
- package/docs/design/templates/progress-bar/tones.svg +1 -0
- package/docs/design/templates/progress-bar-dark.svg +1 -0
- package/docs/design/templates/progress-bar.svg +1 -0
- package/docs/design/templates/progress-ring/sizes-dark.svg +1 -0
- package/docs/design/templates/progress-ring/sizes.svg +1 -0
- package/docs/design/templates/progress-ring/tones-dark.svg +1 -0
- package/docs/design/templates/progress-ring/tones.svg +1 -0
- package/docs/design/templates/progress-ring-dark.svg +1 -0
- package/docs/design/templates/progress-ring.svg +1 -0
- package/docs/design/templates/radio-group/horizontal-dark.svg +1 -0
- package/docs/design/templates/radio-group/horizontal.svg +1 -0
- package/docs/design/templates/radio-group/tiles-dark.svg +1 -0
- package/docs/design/templates/radio-group/tiles.svg +1 -0
- package/docs/design/templates/radio-group/vertical-dark.svg +1 -0
- package/docs/design/templates/radio-group/vertical.svg +1 -0
- package/docs/design/templates/radio-group-dark.svg +1 -0
- package/docs/design/templates/radio-group.svg +1 -0
- package/docs/design/templates/search-field/empty-dark.svg +1 -0
- package/docs/design/templates/search-field/empty.svg +1 -0
- package/docs/design/templates/search-field/tokens-dark.svg +1 -0
- package/docs/design/templates/search-field/tokens.svg +1 -0
- package/docs/design/templates/search-field-dark.svg +1 -0
- package/docs/design/templates/search-field.svg +1 -0
- package/docs/design/templates/segmented-control/equal-dark.svg +1 -1
- package/docs/design/templates/segmented-control/equal.svg +1 -1
- package/docs/design/templates/segmented-control/pill-small-dark.svg +1 -1
- package/docs/design/templates/segmented-control/pill-small.svg +1 -1
- package/docs/design/templates/segmented-control-dark.svg +1 -7
- package/docs/design/templates/segmented-control.svg +1 -7
- package/docs/design/templates/select/compact-dark.svg +1 -0
- package/docs/design/templates/select/compact.svg +1 -0
- package/docs/design/templates/select/form-dark.svg +1 -0
- package/docs/design/templates/select/form.svg +1 -0
- package/docs/design/templates/select/icons-dark.svg +1 -0
- package/docs/design/templates/select/icons.svg +1 -0
- package/docs/design/templates/select-dark.svg +1 -0
- package/docs/design/templates/select.svg +1 -0
- package/docs/design/templates/skeleton-dark.svg +1 -9
- package/docs/design/templates/skeleton.svg +1 -9
- package/docs/design/templates/slider/compact-dark.svg +1 -0
- package/docs/design/templates/slider/compact.svg +1 -0
- package/docs/design/templates/slider/readout-dark.svg +1 -0
- package/docs/design/templates/slider/readout.svg +1 -0
- package/docs/design/templates/slider/ticks-dark.svg +1 -0
- package/docs/design/templates/slider/ticks.svg +1 -0
- package/docs/design/templates/slider-dark.svg +1 -0
- package/docs/design/templates/slider.svg +1 -0
- package/docs/design/templates/split-button/full-width-dark.svg +1 -0
- package/docs/design/templates/split-button/full-width.svg +1 -0
- package/docs/design/templates/split-button/pill-dark.svg +1 -0
- package/docs/design/templates/split-button/pill.svg +1 -0
- package/docs/design/templates/split-button/states-dark.svg +1 -0
- package/docs/design/templates/split-button/states.svg +1 -0
- package/docs/design/templates/split-button/tones-dark.svg +1 -0
- package/docs/design/templates/split-button/tones.svg +1 -0
- package/docs/design/templates/split-button-dark.svg +1 -0
- package/docs/design/templates/split-button.svg +1 -0
- package/docs/design/templates/state-banner/danger-dark.svg +1 -1
- package/docs/design/templates/state-banner/danger.svg +1 -1
- package/docs/design/templates/state-banner/info-badge-dark.svg +1 -0
- package/docs/design/templates/state-banner/info-badge.svg +1 -0
- package/docs/design/templates/state-banner/info-dark.svg +1 -1
- package/docs/design/templates/state-banner/info.svg +1 -1
- package/docs/design/templates/state-banner/strip-dark.svg +1 -0
- package/docs/design/templates/state-banner/strip.svg +1 -0
- package/docs/design/templates/state-banner/success-dark.svg +1 -1
- package/docs/design/templates/state-banner/success.svg +1 -1
- package/docs/design/templates/state-banner/warning-dark.svg +1 -1
- package/docs/design/templates/state-banner/warning.svg +1 -1
- package/docs/design/templates/state-banner-dark.svg +1 -11
- package/docs/design/templates/state-banner.svg +1 -11
- package/docs/design/templates/switch/compact-dark.svg +1 -0
- package/docs/design/templates/switch/compact.svg +1 -0
- package/docs/design/templates/switch/states-dark.svg +1 -0
- package/docs/design/templates/switch/states.svg +1 -0
- package/docs/design/templates/switch-dark.svg +1 -0
- package/docs/design/templates/switch.svg +1 -0
- package/docs/design/templates/tab-bar/workspace-tabs-dark.svg +1 -1
- package/docs/design/templates/tab-bar/workspace-tabs.svg +1 -1
- package/docs/design/templates/tab-bar-dark.svg +1 -5
- package/docs/design/templates/tab-bar.svg +1 -5
- package/docs/design/templates/tag-field/error-dark.svg +1 -0
- package/docs/design/templates/tag-field/error.svg +1 -0
- package/docs/design/templates/tag-field/tags-dark.svg +1 -0
- package/docs/design/templates/tag-field/tags.svg +1 -0
- package/docs/design/templates/tag-field-dark.svg +1 -0
- package/docs/design/templates/tag-field.svg +1 -0
- package/docs/design/templates/text-field/compact-dark.svg +1 -0
- package/docs/design/templates/text-field/compact.svg +1 -0
- package/docs/design/templates/text-field/error-dark.svg +1 -0
- package/docs/design/templates/text-field/error.svg +1 -0
- package/docs/design/templates/text-field/labeled-dark.svg +1 -0
- package/docs/design/templates/text-field/labeled.svg +1 -0
- package/docs/design/templates/text-field/multiline-dark.svg +1 -0
- package/docs/design/templates/text-field/multiline.svg +1 -0
- package/docs/design/templates/text-field/number-dark.svg +1 -0
- package/docs/design/templates/text-field/number.svg +1 -0
- package/docs/design/templates/text-field/search-dark.svg +1 -0
- package/docs/design/templates/text-field/search.svg +1 -0
- package/docs/design/templates/text-field-dark.svg +1 -0
- package/docs/design/templates/text-field.svg +1 -0
- package/docs/design/templates/toolbar/title-and-actions-dark.svg +1 -1
- package/docs/design/templates/toolbar/title-and-actions.svg +1 -1
- package/docs/design/templates/toolbar/width-visibility-320-dark.svg +1 -0
- package/docs/design/templates/toolbar/width-visibility-320.svg +1 -0
- package/docs/design/templates/toolbar/width-visibility-600-dark.svg +1 -0
- package/docs/design/templates/toolbar/width-visibility-600.svg +1 -0
- package/docs/design/templates/toolbar-control-group/borderless-single-dark.svg +1 -1
- package/docs/design/templates/toolbar-control-group/borderless-single.svg +1 -1
- package/docs/design/templates/toolbar-control-group/glass-dark.svg +1 -0
- package/docs/design/templates/toolbar-control-group/glass.svg +1 -0
- package/docs/design/templates/toolbar-control-group/icon-buttons-dark.svg +1 -1
- package/docs/design/templates/toolbar-control-group/icon-buttons.svg +1 -1
- package/docs/design/templates/toolbar-control-group/icon-tile-brand-dark.svg +1 -0
- package/docs/design/templates/toolbar-control-group/icon-tile-brand.svg +1 -0
- package/docs/design/templates/toolbar-control-group/icon-tile-danger-dark.svg +1 -0
- package/docs/design/templates/toolbar-control-group/icon-tile-danger.svg +1 -0
- package/docs/design/templates/toolbar-control-group/icon-tile-neutral-dark.svg +1 -0
- package/docs/design/templates/toolbar-control-group/icon-tile-neutral.svg +1 -0
- package/docs/design/templates/toolbar-control-group/icon-tile-success-dark.svg +1 -0
- package/docs/design/templates/toolbar-control-group/icon-tile-success.svg +1 -0
- package/docs/design/templates/toolbar-control-group/icon-tile-warning-dark.svg +1 -0
- package/docs/design/templates/toolbar-control-group/icon-tile-warning.svg +1 -0
- package/docs/design/templates/toolbar-control-group/push-buttons-dark.svg +1 -1
- package/docs/design/templates/toolbar-control-group/push-buttons.svg +1 -1
- package/docs/design/templates/toolbar-control-group/with-text-dark.svg +1 -1
- package/docs/design/templates/toolbar-control-group/with-text.svg +1 -1
- package/docs/design/templates/toolbar-control-group-dark.svg +1 -11
- package/docs/design/templates/toolbar-control-group.svg +1 -11
- package/docs/design/templates/toolbar-dark.svg +1 -5
- package/docs/design/templates/toolbar-text/dark-tone-dark.svg +1 -0
- package/docs/design/templates/toolbar-text/dark-tone.svg +1 -0
- package/docs/design/templates/toolbar-text/default-dark.svg +1 -1
- package/docs/design/templates/toolbar-text/default.svg +1 -1
- package/docs/design/templates/toolbar-text/large-dark.svg +1 -1
- package/docs/design/templates/toolbar-text/large.svg +1 -1
- package/docs/design/templates/toolbar-text/small-dark.svg +1 -1
- package/docs/design/templates/toolbar-text/small.svg +1 -1
- package/docs/design/templates/toolbar-text-dark.svg +1 -9
- package/docs/design/templates/toolbar-text.svg +1 -9
- package/docs/design/templates/toolbar.svg +1 -5
- package/docs/design/templates/tree-list/files-dark.svg +1 -0
- package/docs/design/templates/tree-list/files.svg +1 -0
- package/docs/design/templates/tree-list/outline-dark.svg +1 -0
- package/docs/design/templates/tree-list/outline.svg +1 -0
- package/docs/design/templates/tree-list-dark.svg +1 -0
- package/docs/design/templates/tree-list.svg +1 -0
- package/docs/design/templates/value-table/details-dark.svg +1 -1
- package/docs/design/templates/value-table/details.svg +1 -1
- package/docs/design/templates/value-table-dark.svg +1 -5
- package/docs/design/templates/value-table.svg +1 -5
- package/docs/design/templates.md +102 -36
- package/docs/design-philosophy.md +69 -20
- package/docs/device-class.md +10 -9
- package/docs/disclosure.md +97 -0
- package/docs/document-baseline.md +101 -0
- package/docs/editor-frame.md +47 -0
- package/docs/editor-host.md +397 -0
- package/docs/examples/application-ui-profile.json +60 -0
- package/docs/examples/command-palette-adapter.tsx +69 -17
- package/docs/examples/component-catalog-extension.json +52 -0
- package/docs/examples/component-composition-extension.json +80 -0
- package/docs/forms-and-validation.md +50 -0
- package/docs/gauge.md +55 -0
- package/docs/interaction-conventions.md +55 -0
- package/docs/investigations/content-item-media-scroll-performance.md +46 -0
- package/docs/layout.md +1075 -53
- package/docs/list-detail-dialog.md +105 -0
- package/docs/manual-test-plan.md +87 -0
- package/docs/message-composer.md +156 -0
- package/docs/nav-stack.md +328 -14
- package/docs/overlay-toast.md +62 -0
- package/docs/overlay-tooltip.md +53 -0
- package/docs/paged-view.md +89 -0
- package/docs/progress.md +63 -0
- package/docs/recipes.md +156 -73
- package/docs/scroll-effect.md +127 -0
- package/docs/slider.md +64 -0
- package/docs/split-view.md +100 -8
- package/docs/sunken-panel.md +106 -0
- package/docs/surface-scaffold.md +677 -0
- package/docs/tab-navigator.md +292 -0
- package/docs/tag-field.md +66 -0
- package/docs/testing-applications.md +25 -0
- package/docs/tree-list.md +144 -0
- package/docs/type-contracts.md +137 -0
- package/docs/ui-analyzer.md +466 -0
- package/docs/ui-doctor.md +370 -0
- package/docs/ui-evaluator.md +176 -0
- package/docs/upgrading.md +14 -0
- package/docs/ux-demo.md +58 -17
- package/docs/value-preview.md +16 -0
- package/docs/view.md +314 -0
- package/docs/webawesome-migration.md +93 -0
- package/docs/webawesome-theme.md +343 -58
- package/docs/workbench-dialog.md +92 -0
- package/docs/workbench.md +658 -12
- package/docs/writing.md +154 -0
- package/doctor/cli.mjs +125 -0
- package/doctor/component-style-checks.mjs +457 -0
- package/doctor/config.schema.json +94 -0
- package/doctor/copy-capitalization-checks.mjs +603 -0
- package/doctor/eslint-diagnostics.d.mts +28 -0
- package/doctor/eslint-diagnostics.mjs +29 -0
- package/doctor/index.d.mts +122 -0
- package/doctor/index.mjs +1648 -0
- package/doctor/project-guidance-checks.d.mts +11 -0
- package/doctor/project-guidance-checks.mjs +97 -0
- package/doctor/report.schema.json +118 -0
- package/evaluator/cli.mjs +95 -0
- package/evaluator/firefox-app-data.d.mts +4 -0
- package/evaluator/firefox-app-data.mjs +35 -0
- package/evaluator/index.d.mts +90 -0
- package/evaluator/index.mjs +1229 -0
- package/evaluator/report.schema.json +152 -0
- package/llms.txt +1166 -57
- package/package.json +613 -49
- package/props/cli.d.mts +1 -0
- package/props/cli.mjs +142 -0
- package/props/component-props.d.mts +180 -0
- package/props/component-props.mjs +1208 -0
- package/scripts/component-catalog-extension-validation.mjs +28 -0
- package/scripts/lib/cli-args.mjs +98 -0
- package/scripts/lib/json-schema-subset.mjs +137 -0
- package/traversal-exclusions.mjs +86 -0
- package/ux-demo/recipes/app-shell.tsx +118 -25
- package/ux-demo/recipes/collapsible-sidebar.tsx +97 -62
- package/ux-demo/recipes/compact-toolbar.tsx +50 -24
- package/ux-demo/recipes/composer-form.tsx +49 -27
- package/ux-demo/recipes/list-detail-dialog.tsx +113 -25
- package/ux-demo/recipes/list-workspace-states.tsx +63 -14
- package/ux-demo/recipes/loaders.ts +11 -3
- package/ux-demo/recipes/loading-inspector.tsx +41 -60
- package/ux-demo/recipes/media-detail.tsx +169 -0
- package/ux-demo/recipes/mount-recipe.ts +28 -11
- package/ux-demo/recipes/navigation-sidebar.tsx +53 -17
- package/ux-demo/recipes/navigation-stack.tsx +48 -29
- package/ux-demo/recipes/types.ts +18 -2
- package/ux-demo/recipes/workspace-header.tsx +23 -6
- package/view/catalog.mjs +229 -0
- package/view/child-kind.mjs +22 -0
- package/view/cli.d.mts +18 -0
- package/view/cli.mjs +316 -0
- package/view/contract.mjs +418 -0
- package/view/css-grammar.mjs +93 -0
- package/view/generate.d.mts +16 -0
- package/view/generate.mjs +739 -0
- package/view/index.d.mts +491 -0
- package/view/index.mjs +36 -0
- package/view/interpret.mjs +339 -0
- package/view/project-types-worker.mjs +55 -0
- package/view/project-types.d.mts +43 -0
- package/view/project-types.mjs +618 -0
- package/view/type-expression.d.mts +15 -0
- package/view/type-expression.mjs +162 -0
- package/view/types.mjs +165 -0
- package/view/validate-move.mjs +353 -0
- package/view/validate.mjs +1649 -0
- package/vite-editor.d.mts +173 -0
- package/vite-editor.mjs +548 -0
- package/vite-ux-review.d.mts +83 -0
- package/vite-ux-review.mjs +120 -0
- package/dist/app-tab.d.ts +0 -30
- package/dist/app-tab.js +0 -5
- package/dist/app-tab.js.map +0 -1
- package/dist/browser/app-tab.js +0 -4
- package/dist/browser/panel-header.js +0 -7
- package/dist/browser/token-search-field.js +0 -4
- package/dist/chunk-2Z5TWHKQ.js +0 -34
- package/dist/chunk-2Z5TWHKQ.js.map +0 -1
- package/dist/chunk-37T3VNIZ.js +0 -19
- package/dist/chunk-37T3VNIZ.js.map +0 -1
- package/dist/chunk-55DATV3A.js +0 -10
- package/dist/chunk-55DATV3A.js.map +0 -1
- package/dist/chunk-56RJXPHG.js.map +0 -1
- package/dist/chunk-5ATCDSQS.js +0 -42
- package/dist/chunk-5ATCDSQS.js.map +0 -1
- package/dist/chunk-5E2HVJ33.js +0 -10
- package/dist/chunk-5E2HVJ33.js.map +0 -1
- package/dist/chunk-7BR3DO2A.js +0 -31
- package/dist/chunk-7BR3DO2A.js.map +0 -1
- package/dist/chunk-7JB7VPRI.js +0 -34
- package/dist/chunk-7JB7VPRI.js.map +0 -1
- package/dist/chunk-7LDCTU7D.js +0 -134
- package/dist/chunk-7LDCTU7D.js.map +0 -1
- package/dist/chunk-AQNKJRFH.js +0 -79
- package/dist/chunk-AQNKJRFH.js.map +0 -1
- package/dist/chunk-AVZHJN6C.js +0 -14
- package/dist/chunk-AVZHJN6C.js.map +0 -1
- package/dist/chunk-B24C4A6T.js +0 -22
- package/dist/chunk-B24C4A6T.js.map +0 -1
- package/dist/chunk-BLK3UEEI.js +0 -23
- package/dist/chunk-BLK3UEEI.js.map +0 -1
- package/dist/chunk-CH4SQ6H5.js +0 -39
- package/dist/chunk-CH4SQ6H5.js.map +0 -1
- package/dist/chunk-DAFFDO33.js +0 -14
- package/dist/chunk-DAFFDO33.js.map +0 -1
- package/dist/chunk-I7INRJO4.js +0 -17
- package/dist/chunk-I7INRJO4.js.map +0 -1
- package/dist/chunk-L4OKFDJY.js +0 -24
- package/dist/chunk-L4OKFDJY.js.map +0 -1
- package/dist/chunk-LCOBDOCC.js +0 -265
- package/dist/chunk-LCOBDOCC.js.map +0 -1
- package/dist/chunk-M5JRI6MN.js +0 -27
- package/dist/chunk-M5JRI6MN.js.map +0 -1
- package/dist/chunk-RNPGFQ33.js +0 -10
- package/dist/chunk-RNPGFQ33.js.map +0 -1
- package/dist/chunk-RUNWEPR4.js +0 -10
- package/dist/chunk-RUNWEPR4.js.map +0 -1
- package/dist/chunk-VPCTCUED.js +0 -10
- package/dist/chunk-VPCTCUED.js.map +0 -1
- package/dist/chunk-W2FK7ZNY.js +0 -26
- package/dist/chunk-W2FK7ZNY.js.map +0 -1
- package/dist/chunk-WVPYVDXY.js +0 -15
- package/dist/chunk-WVPYVDXY.js.map +0 -1
- package/dist/chunk-XE4OX6AZ.js +0 -10
- package/dist/chunk-XE4OX6AZ.js.map +0 -1
- package/dist/chunk-XE5ZLPCC.js +0 -20
- package/dist/chunk-XE5ZLPCC.js.map +0 -1
- package/dist/chunk-XXMOARTH.js +0 -229
- package/dist/chunk-XXMOARTH.js.map +0 -1
- package/dist/chunk-YGN7OMLT.js +0 -57
- package/dist/chunk-YGN7OMLT.js.map +0 -1
- package/dist/panel-header.d.ts +0 -36
- package/dist/panel-header.js +0 -7
- package/dist/panel-header.js.map +0 -1
- package/dist/styles/app-tab.css +0 -152
- package/dist/styles/panel-header.css +0 -64
- package/dist/styles/tab-scaffold.css +0 -84
- package/dist/styles/token-search-field.css +0 -289
- package/dist/tab-scaffold.d.ts +0 -30
- package/dist/tab-scaffold.js +0 -16
- package/dist/tab-scaffold.js.map +0 -1
- package/dist/token-search-field.d.ts +0 -43
- package/dist/token-search-field.js +0 -4
- package/dist/token-search-field.js.map +0 -1
- package/dist/wire-tab-scaffold.d.ts +0 -11
- package/dist/wire-tab-scaffold.js +0 -16
- package/dist/wire-tab-scaffold.js.map +0 -1
- package/dist/wire-token-search-fields.js +0 -5
- package/docs/design/templates/panel-header/icon-actions-dark.svg +0 -1
- package/docs/design/templates/panel-header/icon-actions.svg +0 -1
- package/docs/design/templates/panel-header/icon-summary-actions-dark.svg +0 -1
- package/docs/design/templates/panel-header/icon-summary-actions.svg +0 -1
- package/docs/design/templates/panel-header/no-icon-dark.svg +0 -1
- package/docs/design/templates/panel-header/no-icon.svg +0 -1
- package/docs/design/templates/panel-header/page-heading-dark.svg +0 -1
- package/docs/design/templates/panel-header/page-heading.svg +0 -1
- package/docs/design/templates/panel-header/title-only-dark.svg +0 -1
- package/docs/design/templates/panel-header/title-only.svg +0 -1
- package/docs/design/templates/panel-header-dark.svg +0 -13
- package/docs/design/templates/panel-header.svg +0 -13
- package/docs/design/templates/token-search-field/empty-dark.svg +0 -1
- package/docs/design/templates/token-search-field/empty.svg +0 -1
- package/docs/design/templates/token-search-field/tokens-dark.svg +0 -1
- package/docs/design/templates/token-search-field/tokens.svg +0 -1
- package/docs/design/templates/token-search-field-dark.svg +0 -7
- package/docs/design/templates/token-search-field.svg +0 -7
- package/docs/tab-scaffold.md +0 -41
- package/ux-demo/recipes/recipes.css +0 -448
|
@@ -0,0 +1,1649 @@
|
|
|
1
|
+
// validateView: checks a Kerf UI view document (kerf-ui-document/v1, see
|
|
2
|
+
// docs/26-ui-editor.md) against the component-props and composition
|
|
3
|
+
// catalogs. Pure and synchronous, with no Node APIs, so the editor runs it in
|
|
4
|
+
// the browser and the CLI runs it in Node. The catalog index, the type
|
|
5
|
+
// system, and the `$css` grammar it checks against live in catalog.mjs,
|
|
6
|
+
// types.mjs, and css-grammar.mjs.
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
channelOf,
|
|
10
|
+
fieldParent,
|
|
11
|
+
fieldZoneOf,
|
|
12
|
+
isBinding,
|
|
13
|
+
isObject,
|
|
14
|
+
keyOf,
|
|
15
|
+
propsOf,
|
|
16
|
+
quoteValue,
|
|
17
|
+
resolveType,
|
|
18
|
+
withFieldZones,
|
|
19
|
+
} from './catalog.mjs';
|
|
20
|
+
import { childKind } from './child-kind.mjs';
|
|
21
|
+
import { CSS_HELPERS, parseCssCall } from './css-grammar.mjs';
|
|
22
|
+
import { ICON_NAME, isAssignable, isLiteralOf, literalOf } from './types.mjs';
|
|
23
|
+
import { hasTypeExpressions, validTypeExpression } from './type-expression.mjs';
|
|
24
|
+
|
|
25
|
+
export const VIEW_DOCUMENT_SCHEMA_ID = 'kerf-ui-document/v1';
|
|
26
|
+
|
|
27
|
+
const ULID = /^[0-9A-HJKMNP-TV-Z]{26}$/;
|
|
28
|
+
const CAMEL = /^[a-z][A-Za-z0-9]*$/;
|
|
29
|
+
const PASCAL = /^[A-Z][A-Za-z0-9]*$/;
|
|
30
|
+
const ACTION_NAME = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/;
|
|
31
|
+
const ACTION_PROP = /^action$|[a-z]Action$/;
|
|
32
|
+
// Loop variable names the generated module already uses.
|
|
33
|
+
const RESERVED_NAMES = new Set(['inputs', 'slots', 'each', 'handlers']);
|
|
34
|
+
const PARAM_KINDS = new Set([
|
|
35
|
+
'string',
|
|
36
|
+
'number',
|
|
37
|
+
'boolean',
|
|
38
|
+
'enum',
|
|
39
|
+
'literal',
|
|
40
|
+
'content',
|
|
41
|
+
'array',
|
|
42
|
+
'object',
|
|
43
|
+
// The exact type of one component prop (KF-H3CB2P: app-supplied values):
|
|
44
|
+
// `{ kind: 'prop', component: '@kerfjs/ui:search-field', prop: 'model' }`,
|
|
45
|
+
// for values a document cannot spell, such as functions and signals.
|
|
46
|
+
'prop',
|
|
47
|
+
]);
|
|
48
|
+
|
|
49
|
+
const only = (value, keys) =>
|
|
50
|
+
Object.keys(value).filter((key) => !keys.includes(key));
|
|
51
|
+
|
|
52
|
+
// Optional props print as `T | undefined`; messages name the type itself.
|
|
53
|
+
function describe(type) {
|
|
54
|
+
return (type?.text ?? type?.kind ?? 'unknown').replace(/ \| undefined$/, '');
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** Validates one param or slot-input type in the document's own grammar. */
|
|
58
|
+
function validateDeclaredType(ctx, type, path) {
|
|
59
|
+
if (type?.typescript !== undefined) {
|
|
60
|
+
if (!validTypeExpression(type))
|
|
61
|
+
ctx.report(
|
|
62
|
+
'KUI-V001',
|
|
63
|
+
path,
|
|
64
|
+
'invalid TypeScript expression or portable import context',
|
|
65
|
+
);
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
if (!isObject(type) || !PARAM_KINDS.has(type.kind)) {
|
|
69
|
+
ctx.report(
|
|
70
|
+
'KUI-V001',
|
|
71
|
+
path,
|
|
72
|
+
`type must be one of ${[...PARAM_KINDS].join(', ')}`,
|
|
73
|
+
);
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
if (
|
|
77
|
+
type.kind === 'enum' &&
|
|
78
|
+
!(Array.isArray(type.values) && type.values.length)
|
|
79
|
+
) {
|
|
80
|
+
ctx.report(
|
|
81
|
+
'KUI-V001',
|
|
82
|
+
path,
|
|
83
|
+
'an enum type needs a non-empty `values` list',
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
if (type.kind === 'prop') {
|
|
87
|
+
const owner =
|
|
88
|
+
typeof type.component === 'string'
|
|
89
|
+
? ctx.catalog.components.get(type.component)?.component
|
|
90
|
+
: undefined;
|
|
91
|
+
if (!owner?.props.some((prop) => prop.name === type.prop)) {
|
|
92
|
+
ctx.report(
|
|
93
|
+
'KUI-V001',
|
|
94
|
+
path,
|
|
95
|
+
'a prop type names a catalog `component` key and one of its `prop`s',
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
if (type.kind === 'array') {
|
|
101
|
+
if (!isObject(type.items))
|
|
102
|
+
ctx.report('KUI-V001', path, 'an array type needs `items`');
|
|
103
|
+
else validateDeclaredType(ctx, type.items, `${path}.items`);
|
|
104
|
+
}
|
|
105
|
+
if (type.kind === 'object') {
|
|
106
|
+
if (!Array.isArray(type.props)) {
|
|
107
|
+
ctx.report('KUI-V001', path, 'an object type needs a `props` list');
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
type.props.forEach((prop, index) => {
|
|
111
|
+
const at = `${path}.props[${index}]`;
|
|
112
|
+
if (
|
|
113
|
+
!isObject(prop) ||
|
|
114
|
+
typeof prop.name !== 'string' ||
|
|
115
|
+
typeof prop.required !== 'boolean'
|
|
116
|
+
) {
|
|
117
|
+
ctx.report(
|
|
118
|
+
'KUI-V001',
|
|
119
|
+
at,
|
|
120
|
+
'a prop needs `name`, `type`, and `required`',
|
|
121
|
+
);
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
validateDeclaredType(ctx, prop.type, `${at}.type`);
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/** Resolves a `$bind` path to its type, or reports why it cannot. */
|
|
130
|
+
function bindingType(ctx, path, scope, at) {
|
|
131
|
+
if (typeof path !== 'string' || path === '') {
|
|
132
|
+
ctx.report('KUI-V007', at, '`$bind` needs a dotted path');
|
|
133
|
+
return undefined;
|
|
134
|
+
}
|
|
135
|
+
const [head, ...rest] = path.split('.');
|
|
136
|
+
let type = scope.get(head) ?? ctx.params.get(head)?.type;
|
|
137
|
+
if (!type) {
|
|
138
|
+
ctx.report(
|
|
139
|
+
'KUI-V007',
|
|
140
|
+
at,
|
|
141
|
+
`\`$bind\` path "${path}" names nothing in scope`,
|
|
142
|
+
);
|
|
143
|
+
return undefined;
|
|
144
|
+
}
|
|
145
|
+
const project = type.typescript;
|
|
146
|
+
for (const segment of rest) {
|
|
147
|
+
const prop = propsOf(type, {})?.find((item) => item.name === segment);
|
|
148
|
+
if (!prop) {
|
|
149
|
+
if (project) return { kind: 'unknown', typescript: project };
|
|
150
|
+
ctx.report(
|
|
151
|
+
'KUI-V007',
|
|
152
|
+
at,
|
|
153
|
+
`\`$bind\` path "${path}" has no "${segment}"`,
|
|
154
|
+
);
|
|
155
|
+
return undefined;
|
|
156
|
+
}
|
|
157
|
+
type = prop.type;
|
|
158
|
+
}
|
|
159
|
+
return project ? { ...type, typescript: project } : type;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* The type of a dynamic value (`$param` or `$bind`), `null` for a literal, or
|
|
164
|
+
* `undefined` after reporting an unresolvable reference.
|
|
165
|
+
*/
|
|
166
|
+
function dynamicType(ctx, value, scope, at) {
|
|
167
|
+
if (!isObject(value)) return null;
|
|
168
|
+
if ('$param' in value) {
|
|
169
|
+
const param = ctx.params.get(value.$param);
|
|
170
|
+
if (!param)
|
|
171
|
+
ctx.report(
|
|
172
|
+
'KUI-V007',
|
|
173
|
+
at,
|
|
174
|
+
`\`$param\` "${value.$param}" is not a document param`,
|
|
175
|
+
);
|
|
176
|
+
return param?.type;
|
|
177
|
+
}
|
|
178
|
+
if ('$bind' in value) return bindingType(ctx, value.$bind, scope, at);
|
|
179
|
+
return null;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
function checkPropValue(ctx, prop, value, definitions, scope, at, rowScoped) {
|
|
183
|
+
if (isObject(value) && '$action' in value) {
|
|
184
|
+
if (
|
|
185
|
+
!ACTION_PROP.test(prop.name) ||
|
|
186
|
+
resolveType(prop.type, definitions).kind !== 'string'
|
|
187
|
+
) {
|
|
188
|
+
ctx.report(
|
|
189
|
+
'KUI-V009',
|
|
190
|
+
at,
|
|
191
|
+
`\`$action\` is only valid on an action-name prop, not "${prop.name}"`,
|
|
192
|
+
);
|
|
193
|
+
} else if (
|
|
194
|
+
typeof value.$action !== 'string' ||
|
|
195
|
+
!ACTION_NAME.test(value.$action)
|
|
196
|
+
) {
|
|
197
|
+
ctx.report('KUI-V001', at, 'an action name is lowercase kebab-case');
|
|
198
|
+
} else {
|
|
199
|
+
ctx.noteAction(value.$action, rowScoped ? 'row' : 'view', at);
|
|
200
|
+
}
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
if (isObject(value) && '$icon' in value) {
|
|
204
|
+
if (prop.iconSource !== 'lucide') {
|
|
205
|
+
ctx.report(
|
|
206
|
+
'KUI-V013',
|
|
207
|
+
at,
|
|
208
|
+
`\`$icon\` is only valid on an icon-data prop, not "${prop.name}"`,
|
|
209
|
+
);
|
|
210
|
+
} else if (
|
|
211
|
+
typeof value.$icon !== 'string' ||
|
|
212
|
+
!ICON_NAME.test(value.$icon)
|
|
213
|
+
) {
|
|
214
|
+
ctx.report(
|
|
215
|
+
'KUI-V013',
|
|
216
|
+
at,
|
|
217
|
+
'an icon name is a kebab-case Lucide name such as "inbox"',
|
|
218
|
+
);
|
|
219
|
+
} else if (ctx.icons && !ctx.icons.has(value.$icon)) {
|
|
220
|
+
ctx.report('KUI-V013', at, `unknown Lucide icon "${value.$icon}"`);
|
|
221
|
+
}
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
if (isObject(value) && '$css' in value) {
|
|
225
|
+
const target = resolveType(prop.type, definitions);
|
|
226
|
+
const kinds =
|
|
227
|
+
target.kind === 'union'
|
|
228
|
+
? target.members.map((member) => member.kind)
|
|
229
|
+
: [target.kind];
|
|
230
|
+
if (!kinds.includes('css-value')) {
|
|
231
|
+
ctx.report(
|
|
232
|
+
'KUI-V010',
|
|
233
|
+
at,
|
|
234
|
+
`\`$css\` is only valid on a css-value prop, not "${prop.name}"`,
|
|
235
|
+
);
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
const helpers = parseCssCall(value.$css);
|
|
239
|
+
const allowed = prop.cssValue?.helpers ?? CSS_HELPERS;
|
|
240
|
+
// The catalog's non-standalone helpers (`plus`) may appear nested.
|
|
241
|
+
const nested = [...allowed, ...(prop.cssValue?.nonStandaloneHelpers ?? [])];
|
|
242
|
+
if (
|
|
243
|
+
!helpers ||
|
|
244
|
+
!allowed.includes(helpers[0]) ||
|
|
245
|
+
!helpers
|
|
246
|
+
.slice(1)
|
|
247
|
+
.every((name) => nested.includes(name) || CSS_HELPERS.includes(name))
|
|
248
|
+
) {
|
|
249
|
+
ctx.report(
|
|
250
|
+
'KUI-V010',
|
|
251
|
+
at,
|
|
252
|
+
`\`$css\` must be one literal-argument call to ${allowed.join(', ')}`,
|
|
253
|
+
);
|
|
254
|
+
}
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
const type = dynamicType(ctx, value, scope, at);
|
|
258
|
+
if (type === undefined) return;
|
|
259
|
+
// A param typed as a component prop binds only to that prop.
|
|
260
|
+
if (type?.kind === 'prop') {
|
|
261
|
+
// Outside a node's own props (a `#text` value, a `#view` prop, a `$if`
|
|
262
|
+
// condition, a `$slot` input) no component prop is being set, so a
|
|
263
|
+
// prop-typed value fits nothing there (KF-3624D4). Reading
|
|
264
|
+
// `ctx.component` there would name whichever component was checked last.
|
|
265
|
+
if (!ctx.inProps) {
|
|
266
|
+
ctx.report(
|
|
267
|
+
'KUI-V004',
|
|
268
|
+
at,
|
|
269
|
+
`a ${type.component} "${type.prop}" value fits only that prop, not "${prop.name}"`,
|
|
270
|
+
);
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
if (type.component !== ctx.component || type.prop !== prop.name) {
|
|
274
|
+
ctx.report(
|
|
275
|
+
'KUI-V004',
|
|
276
|
+
at,
|
|
277
|
+
`a ${type.component} "${type.prop}" value does not fit "${prop.name}" of ${ctx.component}`,
|
|
278
|
+
);
|
|
279
|
+
}
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
if (type === null) {
|
|
283
|
+
const hooks = {
|
|
284
|
+
slot: (slot) => checkValueSlot(ctx, slot, at),
|
|
285
|
+
dynamic: (item, type) =>
|
|
286
|
+
nestedDynamicFits(ctx, item, type, definitions, scope, at),
|
|
287
|
+
};
|
|
288
|
+
if (!literalOf(value, prop.type, definitions, hooks)) {
|
|
289
|
+
ctx.report(
|
|
290
|
+
'KUI-V004',
|
|
291
|
+
at,
|
|
292
|
+
`${quoteValue(value)} is not a valid ${describe(prop.type)}`,
|
|
293
|
+
);
|
|
294
|
+
}
|
|
295
|
+
} else if (!isAssignable(type, prop.type, definitions)) {
|
|
296
|
+
ctx.report(
|
|
297
|
+
'KUI-V004',
|
|
298
|
+
at,
|
|
299
|
+
`a ${describe(type)} value does not fit ${describe(prop.type)}`,
|
|
300
|
+
);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* A `$param` / `$bind` inside a list or object prop value (KF-3QEZFB: nested
|
|
306
|
+
* params): it fits when its type is assignable to that position's type, as a
|
|
307
|
+
* whole prop's does. A prop-typed param names a whole component prop, so it
|
|
308
|
+
* never fits inside one. Each value object resolves once (an unknown param or
|
|
309
|
+
* an out-of-scope path reports once, though a union may try it against
|
|
310
|
+
* several members); an unresolved one counts as fitting, so it is not also a
|
|
311
|
+
* type mismatch.
|
|
312
|
+
*/
|
|
313
|
+
function nestedDynamicFits(ctx, value, type, definitions, scope, at) {
|
|
314
|
+
if (!ctx.nestedDynamics.has(value))
|
|
315
|
+
ctx.nestedDynamics.set(value, dynamicType(ctx, value, scope, at));
|
|
316
|
+
const found = ctx.nestedDynamics.get(value);
|
|
317
|
+
if (found === undefined) return true;
|
|
318
|
+
if (found?.kind === 'prop') return false;
|
|
319
|
+
return isAssignable(found, type, definitions);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* A `$slot` inside a prop value (KF-SXDM56: item slots): the application
|
|
324
|
+
* fills it with content, as a zone's `$slot`, but it passes no input. Each
|
|
325
|
+
* slot object reports once, though a union may try it against several
|
|
326
|
+
* members. Returns true, so a malformed slot is not also a type mismatch.
|
|
327
|
+
*/
|
|
328
|
+
function checkValueSlot(ctx, slot, at) {
|
|
329
|
+
if (ctx.checkedSlots.has(slot)) return true;
|
|
330
|
+
ctx.checkedSlots.add(slot);
|
|
331
|
+
for (const key of only(slot, ['$slot']))
|
|
332
|
+
ctx.report(
|
|
333
|
+
'KUI-V001',
|
|
334
|
+
`${at}`,
|
|
335
|
+
`a \`$slot\` in a prop value passes no "${key}"`,
|
|
336
|
+
);
|
|
337
|
+
if (typeof slot.$slot !== 'string' || !CAMEL.test(slot.$slot)) {
|
|
338
|
+
ctx.report('KUI-V001', at, 'a slot name is a camelCase identifier');
|
|
339
|
+
} else if (ctx.slots.get(slot.$slot)?.input) {
|
|
340
|
+
ctx.report(
|
|
341
|
+
'KUI-V001',
|
|
342
|
+
at,
|
|
343
|
+
`slot "${slot.$slot}" declares an input, which a \`$slot\` in a prop value cannot pass`,
|
|
344
|
+
);
|
|
345
|
+
}
|
|
346
|
+
return true;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* Why a `rootAttributes` key cannot appear in a document (KF-65FTKX: data-*
|
|
351
|
+
* only), or undefined. Documents carry lowercase `data-*` names only; the
|
|
352
|
+
* node marker and other `data-kerf-*` names, the row key (`data-key`), and
|
|
353
|
+
* the editor's `data-editor-*` hooks are reserved for the generated view.
|
|
354
|
+
*/
|
|
355
|
+
export function dataAttributeProblem(key) {
|
|
356
|
+
if (!/^data-[a-z0-9]+(?:[-_.][a-z0-9]+)*$/.test(key))
|
|
357
|
+
return `"${key}" is not a lowercase data-* attribute name`;
|
|
358
|
+
if (/^data-(?:kerf-|editor-|key$)/.test(key))
|
|
359
|
+
return `"${key}" is reserved for the generated view and the editor`;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
/** A zone key's binding: the composition zone, or a content (`slot`) prop. */
|
|
363
|
+
function zonesOf(ctx, component) {
|
|
364
|
+
const zones = new Map();
|
|
365
|
+
const entry =
|
|
366
|
+
component.export && component.key.includes('#')
|
|
367
|
+
? undefined
|
|
368
|
+
: ctx.catalog.entries.get(component.key);
|
|
369
|
+
for (const zone of entry?.zones ?? []) {
|
|
370
|
+
if (zone.jsx?.prop) zones.set(zone.id, { prop: zone.jsx.prop, zone });
|
|
371
|
+
}
|
|
372
|
+
for (const prop of component.props) {
|
|
373
|
+
if (prop.slot) {
|
|
374
|
+
zones.set(prop.name, {
|
|
375
|
+
prop: prop.name,
|
|
376
|
+
text: prop.type.acceptsText === true,
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
// A Web Awesome element's slots are its zones; its default slot is its
|
|
381
|
+
// children, and slotted text is ordinary light-DOM text.
|
|
382
|
+
for (const slot of component.slots ?? []) {
|
|
383
|
+
zones.set(slot.name, { prop: 'children', slot: slot.name, text: true });
|
|
384
|
+
}
|
|
385
|
+
for (const binding of zones.values()) {
|
|
386
|
+
if (binding.text === undefined) {
|
|
387
|
+
const prop = component.props.find((item) => item.name === binding.prop);
|
|
388
|
+
binding.text = prop?.type.acceptsText === true;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
return zones;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
function variantMatches(variant, present, literals) {
|
|
395
|
+
if (!variant.required.every((name) => present.has(name))) return false;
|
|
396
|
+
if (variant.forbidden.some((name) => present.has(name))) return false;
|
|
397
|
+
return Object.entries(variant.when ?? {}).every(([name, value]) => {
|
|
398
|
+
if (!present.has(name)) return value === false || value === undefined;
|
|
399
|
+
return !literals.has(name) || literals.get(name) === value;
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
// Callers pass only objects: checkChild classifies non-objects, and root and
|
|
404
|
+
// `$each` templates are checked for a `type` before they get here.
|
|
405
|
+
function checkNode(ctx, node, at, scope, rowScoped, parentKey, text = false) {
|
|
406
|
+
// A scoped run (validate-move.mjs) records where each node is checked:
|
|
407
|
+
// these arguments and the enclosing control.
|
|
408
|
+
const trace = ctx.trace;
|
|
409
|
+
trace?.entries?.set(node, [
|
|
410
|
+
at,
|
|
411
|
+
scope,
|
|
412
|
+
rowScoped,
|
|
413
|
+
parentKey,
|
|
414
|
+
text,
|
|
415
|
+
ctx.interactiveHost,
|
|
416
|
+
]);
|
|
417
|
+
ctx.noteId(node.id, at);
|
|
418
|
+
if (node.type === '#text') {
|
|
419
|
+
for (const key of only(node, ['id', 'type', 'value']))
|
|
420
|
+
ctx.report('KUI-V001', `${at}.${key}`, 'unknown field on a text node');
|
|
421
|
+
if (!text) {
|
|
422
|
+
ctx.report(
|
|
423
|
+
'KUI-V004',
|
|
424
|
+
at,
|
|
425
|
+
'this zone does not take plain text; place a text component (such as Text) instead',
|
|
426
|
+
);
|
|
427
|
+
}
|
|
428
|
+
checkPropValue(
|
|
429
|
+
ctx,
|
|
430
|
+
{ name: 'value', type: { kind: 'string' } },
|
|
431
|
+
node.value,
|
|
432
|
+
{},
|
|
433
|
+
scope,
|
|
434
|
+
`${at}.value`,
|
|
435
|
+
rowScoped,
|
|
436
|
+
);
|
|
437
|
+
return;
|
|
438
|
+
}
|
|
439
|
+
if (node.type === '#view') {
|
|
440
|
+
for (const key of only(node, ['id', 'type', 'src', 'props']))
|
|
441
|
+
ctx.report('KUI-V001', `${at}.${key}`, 'unknown field on a #view node');
|
|
442
|
+
checkView(ctx, node, at, scope, rowScoped);
|
|
443
|
+
return;
|
|
444
|
+
}
|
|
445
|
+
for (const key of only(node, ['id', 'type', 'name', 'props', 'zones']))
|
|
446
|
+
ctx.report('KUI-V001', `${at}.${key}`, 'unknown node field');
|
|
447
|
+
const resolved =
|
|
448
|
+
typeof node.type === 'string'
|
|
449
|
+
? ctx.catalog.components.get(node.type)
|
|
450
|
+
: undefined;
|
|
451
|
+
if (!resolved) {
|
|
452
|
+
ctx.report(
|
|
453
|
+
'KUI-V002',
|
|
454
|
+
`${at}.type`,
|
|
455
|
+
`unknown component type ${JSON.stringify(node.type)}`,
|
|
456
|
+
);
|
|
457
|
+
return;
|
|
458
|
+
}
|
|
459
|
+
const { component, definitions } = resolved;
|
|
460
|
+
const pkg = keyOf(node.type).slice(0, keyOf(node.type).lastIndexOf(':'));
|
|
461
|
+
if (ctx.packages && !ctx.packages.has(pkg)) {
|
|
462
|
+
ctx.report(
|
|
463
|
+
'KUI-V002',
|
|
464
|
+
`${at}.type`,
|
|
465
|
+
`${pkg} is not listed in the document's catalogs`,
|
|
466
|
+
);
|
|
467
|
+
}
|
|
468
|
+
if (node.name !== undefined) {
|
|
469
|
+
ctx.noteName(node.name, at);
|
|
470
|
+
if (channelOf(component) === 'none') {
|
|
471
|
+
ctx.report(
|
|
472
|
+
'KUI-V011',
|
|
473
|
+
`${at}.name`,
|
|
474
|
+
`${node.type} has no data-* channel for the node marker, so it cannot be named`,
|
|
475
|
+
);
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
const interactive = interactiveOf(ctx.catalog, node);
|
|
479
|
+
if (interactive && ctx.interactiveHost) {
|
|
480
|
+
ctx.report(
|
|
481
|
+
'KUI-V014',
|
|
482
|
+
at,
|
|
483
|
+
`${node.type} renders a control or link, so it cannot sit inside ${ctx.interactiveHost}, which renders one itself`,
|
|
484
|
+
);
|
|
485
|
+
}
|
|
486
|
+
const host = ctx.interactiveHost;
|
|
487
|
+
if (interactive === 'root' && !host) ctx.interactiveHost = node.type;
|
|
488
|
+
if (trace?.shallow === node) trace.hostAfter = ctx.interactiveHost;
|
|
489
|
+
const zones = zonesOf(ctx, component);
|
|
490
|
+
// The component whose props are checked next, for a prop-typed param.
|
|
491
|
+
ctx.component = node.type;
|
|
492
|
+
const byName = new Map(component.props.map((prop) => [prop.name, prop]));
|
|
493
|
+
const native = new Set(component.nativeAttributes ?? []);
|
|
494
|
+
const present = new Set();
|
|
495
|
+
const literals = new Map();
|
|
496
|
+
if (node.props !== undefined && !isObject(node.props))
|
|
497
|
+
ctx.report('KUI-V001', `${at}.props`, '`props` is an object');
|
|
498
|
+
// A field zone fills a content field inside a prop value (KF-PD6QC5), so
|
|
499
|
+
// the prop is checked with the zone's placeholder in that field.
|
|
500
|
+
const ownProps = isObject(node.props) ? node.props : {};
|
|
501
|
+
const ownZones = isObject(node.zones) ? node.zones : {};
|
|
502
|
+
const filledProps = withFieldZones(
|
|
503
|
+
ownProps,
|
|
504
|
+
Object.fromEntries(
|
|
505
|
+
Object.entries(ownZones).filter(([, children]) =>
|
|
506
|
+
Array.isArray(children),
|
|
507
|
+
),
|
|
508
|
+
),
|
|
509
|
+
component,
|
|
510
|
+
definitions,
|
|
511
|
+
);
|
|
512
|
+
ctx.inProps = true;
|
|
513
|
+
for (const [name, value] of Object.entries(filledProps)) {
|
|
514
|
+
const propAt = `${at}.props.${name}`;
|
|
515
|
+
const prop = byName.get(name);
|
|
516
|
+
if ([...zones.values()].some((zone) => zone.zone && zone.prop === name)) {
|
|
517
|
+
ctx.report(
|
|
518
|
+
'KUI-V003',
|
|
519
|
+
propAt,
|
|
520
|
+
`"${name}" is a zone; fill it through \`zones\``,
|
|
521
|
+
);
|
|
522
|
+
continue;
|
|
523
|
+
}
|
|
524
|
+
if (!prop && !native.has(name)) {
|
|
525
|
+
ctx.report('KUI-V003', propAt, `${node.type} has no prop "${name}"`);
|
|
526
|
+
continue;
|
|
527
|
+
}
|
|
528
|
+
present.add(name);
|
|
529
|
+
if (!isObject(value) || Array.isArray(value)) literals.set(name, value);
|
|
530
|
+
// A literal data-* channel names only unreserved data-* keys (KF-65FTKX).
|
|
531
|
+
if (
|
|
532
|
+
name === 'rootAttributes' &&
|
|
533
|
+
isObject(value) &&
|
|
534
|
+
!isBinding(value) &&
|
|
535
|
+
Object.keys(value).filter((key) => {
|
|
536
|
+
const problem = dataAttributeProblem(key);
|
|
537
|
+
if (problem) ctx.report('KUI-V015', `${propAt}.${key}`, problem);
|
|
538
|
+
return problem;
|
|
539
|
+
}).length
|
|
540
|
+
)
|
|
541
|
+
continue;
|
|
542
|
+
checkPropValue(
|
|
543
|
+
ctx,
|
|
544
|
+
prop ?? {
|
|
545
|
+
name,
|
|
546
|
+
type: {
|
|
547
|
+
kind: 'union',
|
|
548
|
+
members: [
|
|
549
|
+
{ kind: 'string' },
|
|
550
|
+
{ kind: 'number' },
|
|
551
|
+
{ kind: 'boolean' },
|
|
552
|
+
],
|
|
553
|
+
},
|
|
554
|
+
},
|
|
555
|
+
value,
|
|
556
|
+
definitions,
|
|
557
|
+
scope,
|
|
558
|
+
propAt,
|
|
559
|
+
rowScoped,
|
|
560
|
+
);
|
|
561
|
+
}
|
|
562
|
+
ctx.inProps = false;
|
|
563
|
+
if (node.zones !== undefined && !isObject(node.zones))
|
|
564
|
+
ctx.report('KUI-V001', `${at}.zones`, '`zones` is an object');
|
|
565
|
+
const shapes = new Map();
|
|
566
|
+
for (const [zoneKey, children] of Object.entries(
|
|
567
|
+
isObject(node.zones) ? node.zones : {},
|
|
568
|
+
)) {
|
|
569
|
+
const zoneAt = `${at}.zones.${zoneKey}`;
|
|
570
|
+
const field = zones.has(zoneKey)
|
|
571
|
+
? undefined
|
|
572
|
+
: fieldZoneOf(component, definitions, zoneKey);
|
|
573
|
+
const binding = zones.get(zoneKey) ?? field;
|
|
574
|
+
if (!binding) {
|
|
575
|
+
ctx.report('KUI-V003', zoneAt, `${node.type} has no zone "${zoneKey}"`);
|
|
576
|
+
continue;
|
|
577
|
+
}
|
|
578
|
+
if (!Array.isArray(children)) {
|
|
579
|
+
ctx.report('KUI-V001', zoneAt, 'a zone is a list of children');
|
|
580
|
+
continue;
|
|
581
|
+
}
|
|
582
|
+
if (field) {
|
|
583
|
+
const own = ownProps[field.prop];
|
|
584
|
+
if (isBinding(own)) {
|
|
585
|
+
ctx.report(
|
|
586
|
+
'KUI-V003',
|
|
587
|
+
zoneAt,
|
|
588
|
+
`"${field.prop}" is bound, so a zone cannot fill "${zoneKey}"`,
|
|
589
|
+
);
|
|
590
|
+
} else if (
|
|
591
|
+
field.path.reduce(
|
|
592
|
+
(current, step) =>
|
|
593
|
+
current === undefined || current === null
|
|
594
|
+
? undefined
|
|
595
|
+
: current[step],
|
|
596
|
+
own,
|
|
597
|
+
) !== undefined
|
|
598
|
+
) {
|
|
599
|
+
ctx.report(
|
|
600
|
+
'KUI-V003',
|
|
601
|
+
zoneAt,
|
|
602
|
+
`"${zoneKey}" is set in both \`props\` and \`zones\``,
|
|
603
|
+
);
|
|
604
|
+
}
|
|
605
|
+
} else if (isObject(node.props) && binding.prop in node.props) {
|
|
606
|
+
ctx.report(
|
|
607
|
+
'KUI-V003',
|
|
608
|
+
zoneAt,
|
|
609
|
+
`"${binding.prop}" is set in both \`props\` and \`zones\``,
|
|
610
|
+
);
|
|
611
|
+
}
|
|
612
|
+
// KF-YCM09F: an empty zone list is an explicit null, which a required
|
|
613
|
+
// prop of a nullable type (SplitView's `detail` with nothing selected)
|
|
614
|
+
// accepts; a zone left out entirely still leaves the prop missing.
|
|
615
|
+
if (
|
|
616
|
+
children.length > 0 ||
|
|
617
|
+
(!field && byName.get(binding.prop)?.type?.nullable === true)
|
|
618
|
+
)
|
|
619
|
+
present.add(binding.prop);
|
|
620
|
+
// A field inside a value another component renders (a view's toolbar
|
|
621
|
+
// config) places its children in that component (KF-THTR71).
|
|
622
|
+
const parent =
|
|
623
|
+
(field && fieldParent(ctx, node, component, definitions, zoneKey)) ||
|
|
624
|
+
node.type;
|
|
625
|
+
// A shallow run checks the node alone, noting where a child appended to
|
|
626
|
+
// `trace.zone` would be checked.
|
|
627
|
+
if (trace?.shallow === node) {
|
|
628
|
+
if (zoneKey === trace.zone)
|
|
629
|
+
trace.child = [
|
|
630
|
+
`${zoneAt}[${children.length - 1}]`,
|
|
631
|
+
scope,
|
|
632
|
+
rowScoped,
|
|
633
|
+
parent,
|
|
634
|
+
binding.text,
|
|
635
|
+
ctx.interactiveHost,
|
|
636
|
+
];
|
|
637
|
+
} else
|
|
638
|
+
children.forEach((child, index) =>
|
|
639
|
+
checkChild(
|
|
640
|
+
ctx,
|
|
641
|
+
child,
|
|
642
|
+
`${zoneAt}[${index}]`,
|
|
643
|
+
scope,
|
|
644
|
+
rowScoped,
|
|
645
|
+
parent,
|
|
646
|
+
binding.text,
|
|
647
|
+
),
|
|
648
|
+
);
|
|
649
|
+
shapes.set(zoneKey, combine(children.map((child) => childShape(child))));
|
|
650
|
+
}
|
|
651
|
+
ctx.interactiveHost = host;
|
|
652
|
+
if (component.variants) {
|
|
653
|
+
if (
|
|
654
|
+
!component.variants.some((variant) =>
|
|
655
|
+
variantMatches(variant, present, literals),
|
|
656
|
+
)
|
|
657
|
+
) {
|
|
658
|
+
ctx.report(
|
|
659
|
+
'KUI-V004',
|
|
660
|
+
at,
|
|
661
|
+
`${node.type} props match none of its variants`,
|
|
662
|
+
);
|
|
663
|
+
}
|
|
664
|
+
} else {
|
|
665
|
+
for (const prop of component.props) {
|
|
666
|
+
if (prop.required && !prop.variantOnly && !present.has(prop.name)) {
|
|
667
|
+
ctx.report('KUI-V005', at, `${node.type} requires "${prop.name}"`);
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
checkComposition(ctx, node, at, parentKey, shapes, literals, zones);
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
/**
|
|
675
|
+
* An `$each` template: one keyable node, or (KF-8J8E5V: per-item row
|
|
676
|
+
* designs) an `$if` chain whose every branch is one. `else` is required, so
|
|
677
|
+
* each item yields exactly one row and a repeat never filters.
|
|
678
|
+
*/
|
|
679
|
+
function checkTemplate(
|
|
680
|
+
ctx,
|
|
681
|
+
template,
|
|
682
|
+
at,
|
|
683
|
+
scope,
|
|
684
|
+
parentKey,
|
|
685
|
+
text,
|
|
686
|
+
chain = true,
|
|
687
|
+
) {
|
|
688
|
+
// A chain nests only in `else`; `then` is always one node.
|
|
689
|
+
if (chain && isObject(template) && '$if' in template) {
|
|
690
|
+
for (const key of only(template, ['$if', 'then', 'else']))
|
|
691
|
+
ctx.report('KUI-V001', `${at}.${key}`, 'unknown `$if` field');
|
|
692
|
+
checkPropValue(
|
|
693
|
+
ctx,
|
|
694
|
+
{ name: 'condition', type: { kind: 'boolean' } },
|
|
695
|
+
template.$if,
|
|
696
|
+
{},
|
|
697
|
+
scope,
|
|
698
|
+
`${at}.$if`,
|
|
699
|
+
true,
|
|
700
|
+
);
|
|
701
|
+
checkTemplate(
|
|
702
|
+
ctx,
|
|
703
|
+
template.then,
|
|
704
|
+
`${at}.then`,
|
|
705
|
+
scope,
|
|
706
|
+
parentKey,
|
|
707
|
+
text,
|
|
708
|
+
false,
|
|
709
|
+
);
|
|
710
|
+
if ('else' in template)
|
|
711
|
+
checkTemplate(ctx, template.else, `${at}.else`, scope, parentKey, text);
|
|
712
|
+
else
|
|
713
|
+
ctx.report(
|
|
714
|
+
'KUI-V008',
|
|
715
|
+
at,
|
|
716
|
+
'a template `$if` needs an `else`, so every item yields exactly one row',
|
|
717
|
+
);
|
|
718
|
+
return;
|
|
719
|
+
}
|
|
720
|
+
if (!isObject(template) || !('type' in template)) {
|
|
721
|
+
ctx.report(
|
|
722
|
+
'KUI-V008',
|
|
723
|
+
at,
|
|
724
|
+
'the template is exactly one node, or an `$if` chain of them',
|
|
725
|
+
);
|
|
726
|
+
return;
|
|
727
|
+
}
|
|
728
|
+
const entry = ctx.catalog.components.get(template.type);
|
|
729
|
+
if (entry && channelOf(entry.component) === 'none') {
|
|
730
|
+
ctx.report(
|
|
731
|
+
'KUI-V008',
|
|
732
|
+
at,
|
|
733
|
+
`${template.type} has no data-* channel to carry the row key`,
|
|
734
|
+
);
|
|
735
|
+
}
|
|
736
|
+
checkNode(ctx, template, at, scope, true, parentKey, text);
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
/**
|
|
740
|
+
* An `$each`'s rows: exactly one of `template` (one node or an `$if` chain)
|
|
741
|
+
* and `templates`, a map of one node per item kind picked by `kind`
|
|
742
|
+
* (KF-YX6HMT: keyed row designs). `templates` needs a `default`, which an
|
|
743
|
+
* item of any other kind takes, so every item yields exactly one row.
|
|
744
|
+
*/
|
|
745
|
+
function checkRows(ctx, child, at, scope, parentKey, text) {
|
|
746
|
+
if (!('templates' in child)) {
|
|
747
|
+
if ('kind' in child)
|
|
748
|
+
ctx.report(
|
|
749
|
+
'KUI-V008',
|
|
750
|
+
`${at}.kind`,
|
|
751
|
+
'`kind` picks one of `templates`; this `$each` has none',
|
|
752
|
+
);
|
|
753
|
+
checkTemplate(
|
|
754
|
+
ctx,
|
|
755
|
+
child.template,
|
|
756
|
+
`${at}.template`,
|
|
757
|
+
scope,
|
|
758
|
+
parentKey,
|
|
759
|
+
text,
|
|
760
|
+
);
|
|
761
|
+
return;
|
|
762
|
+
}
|
|
763
|
+
if ('template' in child)
|
|
764
|
+
ctx.report(
|
|
765
|
+
'KUI-V008',
|
|
766
|
+
at,
|
|
767
|
+
'an `$each` has exactly one of `template` and `templates`',
|
|
768
|
+
);
|
|
769
|
+
const templates = isObject(child.templates) ? child.templates : {};
|
|
770
|
+
if (!('default' in templates))
|
|
771
|
+
ctx.report(
|
|
772
|
+
'KUI-V008',
|
|
773
|
+
`${at}.templates`,
|
|
774
|
+
'`templates` needs a `default` row design, which an item of any other kind takes',
|
|
775
|
+
);
|
|
776
|
+
if ('kind' in child)
|
|
777
|
+
checkPropValue(
|
|
778
|
+
ctx,
|
|
779
|
+
{ name: 'kind', type: { kind: 'string' } },
|
|
780
|
+
child.kind,
|
|
781
|
+
{},
|
|
782
|
+
scope,
|
|
783
|
+
`${at}.kind`,
|
|
784
|
+
true,
|
|
785
|
+
);
|
|
786
|
+
else
|
|
787
|
+
ctx.report(
|
|
788
|
+
'KUI-V008',
|
|
789
|
+
`${at}.kind`,
|
|
790
|
+
'`templates` needs a `kind` that resolves to a string on the item',
|
|
791
|
+
);
|
|
792
|
+
for (const [kind, template] of Object.entries(templates)) {
|
|
793
|
+
const path = `${at}.templates.${kind}`;
|
|
794
|
+
if (!isObject(template) || !('type' in template))
|
|
795
|
+
ctx.report(
|
|
796
|
+
'KUI-V008',
|
|
797
|
+
path,
|
|
798
|
+
'each `templates` entry is exactly one node',
|
|
799
|
+
);
|
|
800
|
+
else checkTemplate(ctx, template, path, scope, parentKey, text, false);
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
/**
|
|
805
|
+
* The templates an `$each` can render a row from: its `template`, or every
|
|
806
|
+
* entry of its `templates` map in order (KF-YX6HMT). Each is one node or an
|
|
807
|
+
* `$if` chain of them.
|
|
808
|
+
*/
|
|
809
|
+
export function eachTemplates(each) {
|
|
810
|
+
if (!('templates' in each)) return [each.template];
|
|
811
|
+
// A malformed map is one malformed template, so walkers report it.
|
|
812
|
+
return isObject(each.templates)
|
|
813
|
+
? Object.values(each.templates)
|
|
814
|
+
: [each.templates];
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
/** Every node an `$each` can render a row from, in order; the first keys it. */
|
|
818
|
+
export function eachNodes(each) {
|
|
819
|
+
return eachTemplates(each).flatMap(templateNodes);
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
/**
|
|
823
|
+
* The nodes an `$each` template can render, in branch order: the template
|
|
824
|
+
* itself, or every leaf of its `$if` chain.
|
|
825
|
+
*/
|
|
826
|
+
export function templateNodes(template) {
|
|
827
|
+
if (isObject(template) && '$if' in template)
|
|
828
|
+
return [
|
|
829
|
+
...templateNodes(template.then),
|
|
830
|
+
...('else' in template ? templateNodes(template.else) : []),
|
|
831
|
+
];
|
|
832
|
+
return isObject(template) ? [template] : [];
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
function checkChild(ctx, child, at, scope, rowScoped, parentKey, text = false) {
|
|
836
|
+
if (!isObject(child)) {
|
|
837
|
+
ctx.report('KUI-V001', at, 'a zone child is an object');
|
|
838
|
+
return;
|
|
839
|
+
}
|
|
840
|
+
switch (childKind(child)) {
|
|
841
|
+
case 'each':
|
|
842
|
+
return checkEach(ctx, child, at, scope, rowScoped, parentKey, text);
|
|
843
|
+
case 'if':
|
|
844
|
+
return checkIf(ctx, child, at, scope, rowScoped, parentKey, text);
|
|
845
|
+
case 'slot':
|
|
846
|
+
return checkSlot(ctx, child, at, scope, rowScoped);
|
|
847
|
+
default:
|
|
848
|
+
return checkNode(ctx, child, at, scope, rowScoped, parentKey, text);
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
/** Checks an `$each` child: its fields, source list, key, and rows. */
|
|
853
|
+
function checkEach(ctx, child, at, scope, rowScoped, parentKey, text) {
|
|
854
|
+
for (const key of only(child, [
|
|
855
|
+
'$each',
|
|
856
|
+
'as',
|
|
857
|
+
'key',
|
|
858
|
+
'template',
|
|
859
|
+
'templates',
|
|
860
|
+
'kind',
|
|
861
|
+
]))
|
|
862
|
+
ctx.report('KUI-V001', `${at}.${key}`, 'unknown `$each` field');
|
|
863
|
+
// KF-CFA1S1: an inner `$each` in this document renders as a plain map, but
|
|
864
|
+
// a document composed into another's row cannot know it is in one: its
|
|
865
|
+
// module renders a keyed each(), which kerf refuses inside a row render.
|
|
866
|
+
if (ctx.rowHost && !rowScoped) {
|
|
867
|
+
ctx.report(
|
|
868
|
+
'KUI-V016',
|
|
869
|
+
at,
|
|
870
|
+
'a document composed into an `$each` row cannot repeat; move the `$each` into the composing document',
|
|
871
|
+
);
|
|
872
|
+
}
|
|
873
|
+
const source = dynamicType(ctx, child.$each, scope, `${at}.$each`);
|
|
874
|
+
const list = source ? resolveType(source, {}) : undefined;
|
|
875
|
+
if (source === null)
|
|
876
|
+
ctx.report(
|
|
877
|
+
'KUI-V008',
|
|
878
|
+
`${at}.$each`,
|
|
879
|
+
'`$each` iterates a `$param` or `$bind`, not a literal',
|
|
880
|
+
);
|
|
881
|
+
else if (list && list.kind !== 'array')
|
|
882
|
+
ctx.report(
|
|
883
|
+
'KUI-V008',
|
|
884
|
+
`${at}.$each`,
|
|
885
|
+
`\`$each\` needs an array, not ${describe(list)}`,
|
|
886
|
+
);
|
|
887
|
+
// kerf's each() keys rows by item identity, so items are objects.
|
|
888
|
+
else if (
|
|
889
|
+
list &&
|
|
890
|
+
!['object', 'unknown', 'record'].includes(resolveType(list.items, {}).kind)
|
|
891
|
+
) {
|
|
892
|
+
ctx.report(
|
|
893
|
+
'KUI-V008',
|
|
894
|
+
`${at}.$each`,
|
|
895
|
+
'`$each` items are objects (each() keys rows by item identity)',
|
|
896
|
+
);
|
|
897
|
+
}
|
|
898
|
+
if (
|
|
899
|
+
typeof child.as !== 'string' ||
|
|
900
|
+
!CAMEL.test(child.as) ||
|
|
901
|
+
RESERVED_NAMES.has(child.as) ||
|
|
902
|
+
ctx.params.has(child.as) ||
|
|
903
|
+
scope.has(child.as)
|
|
904
|
+
) {
|
|
905
|
+
ctx.report(
|
|
906
|
+
'KUI-V008',
|
|
907
|
+
`${at}.as`,
|
|
908
|
+
'`as` names the item with a camelCase identifier that is not reserved, a param, or an outer item',
|
|
909
|
+
);
|
|
910
|
+
return;
|
|
911
|
+
}
|
|
912
|
+
const inner = new Map(scope).set(
|
|
913
|
+
child.as,
|
|
914
|
+
list?.kind === 'array' ? list.items : { kind: 'unknown' },
|
|
915
|
+
);
|
|
916
|
+
const keyType =
|
|
917
|
+
typeof child.key === 'string' && child.key.split('.')[0] === child.as
|
|
918
|
+
? bindingType(ctx, child.key, inner, `${at}.key`)
|
|
919
|
+
: undefined;
|
|
920
|
+
const keyKind = keyType && resolveType(keyType, {}).kind;
|
|
921
|
+
if (!keyType || !['string', 'number', 'unknown'].includes(keyKind)) {
|
|
922
|
+
ctx.report(
|
|
923
|
+
'KUI-V008',
|
|
924
|
+
`${at}.key`,
|
|
925
|
+
'`key` is a path on the item that resolves to a string or number',
|
|
926
|
+
);
|
|
927
|
+
}
|
|
928
|
+
checkRows(ctx, child, at, inner, parentKey, text);
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
/** Checks an `$if` child: its condition and both branches. */
|
|
932
|
+
function checkIf(ctx, child, at, scope, rowScoped, parentKey, text) {
|
|
933
|
+
for (const key of only(child, ['$if', 'then', 'else']))
|
|
934
|
+
ctx.report('KUI-V001', `${at}.${key}`, 'unknown `$if` field');
|
|
935
|
+
checkPropValue(
|
|
936
|
+
ctx,
|
|
937
|
+
{ name: 'condition', type: { kind: 'boolean' } },
|
|
938
|
+
child.$if,
|
|
939
|
+
{},
|
|
940
|
+
scope,
|
|
941
|
+
`${at}.$if`,
|
|
942
|
+
rowScoped,
|
|
943
|
+
);
|
|
944
|
+
checkChild(ctx, child.then, `${at}.then`, scope, rowScoped, parentKey, text);
|
|
945
|
+
if ('else' in child)
|
|
946
|
+
checkChild(
|
|
947
|
+
ctx,
|
|
948
|
+
child.else,
|
|
949
|
+
`${at}.else`,
|
|
950
|
+
scope,
|
|
951
|
+
rowScoped,
|
|
952
|
+
parentKey,
|
|
953
|
+
text,
|
|
954
|
+
);
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
/** Checks a `$slot` child: its name and the input it passes. */
|
|
958
|
+
function checkSlot(ctx, child, at, scope, rowScoped) {
|
|
959
|
+
for (const key of only(child, ['$slot', 'input']))
|
|
960
|
+
ctx.report('KUI-V001', `${at}.${key}`, 'unknown `$slot` field');
|
|
961
|
+
if (typeof child.$slot !== 'string' || !CAMEL.test(child.$slot)) {
|
|
962
|
+
ctx.report(
|
|
963
|
+
'KUI-V001',
|
|
964
|
+
`${at}.$slot`,
|
|
965
|
+
'a slot name is a camelCase identifier',
|
|
966
|
+
);
|
|
967
|
+
return;
|
|
968
|
+
}
|
|
969
|
+
const declared = ctx.slots.get(child.$slot);
|
|
970
|
+
const props = declared?.input?.props ?? [];
|
|
971
|
+
if (child.input !== undefined && !declared?.input) {
|
|
972
|
+
ctx.report(
|
|
973
|
+
'KUI-V001',
|
|
974
|
+
`${at}.input`,
|
|
975
|
+
`slot "${child.$slot}" declares no input`,
|
|
976
|
+
);
|
|
977
|
+
return;
|
|
978
|
+
}
|
|
979
|
+
const given = isObject(child.input) ? child.input : {};
|
|
980
|
+
for (const prop of props) {
|
|
981
|
+
if (!(prop.name in given)) {
|
|
982
|
+
if (prop.required)
|
|
983
|
+
ctx.report(
|
|
984
|
+
'KUI-V005',
|
|
985
|
+
`${at}.input`,
|
|
986
|
+
`slot "${child.$slot}" requires input "${prop.name}"`,
|
|
987
|
+
);
|
|
988
|
+
continue;
|
|
989
|
+
}
|
|
990
|
+
checkPropValue(
|
|
991
|
+
ctx,
|
|
992
|
+
prop,
|
|
993
|
+
given[prop.name],
|
|
994
|
+
{},
|
|
995
|
+
scope,
|
|
996
|
+
`${at}.input.${prop.name}`,
|
|
997
|
+
rowScoped,
|
|
998
|
+
);
|
|
999
|
+
}
|
|
1000
|
+
for (const name of Object.keys(given)) {
|
|
1001
|
+
if (!props.some((prop) => prop.name === name))
|
|
1002
|
+
ctx.report(
|
|
1003
|
+
'KUI-V003',
|
|
1004
|
+
`${at}.input.${name}`,
|
|
1005
|
+
`slot "${child.$slot}" has no input "${name}"`,
|
|
1006
|
+
);
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
/**
|
|
1011
|
+
* KF-3X7MFF: where a `#view`'s `src` points, relative to the top document's
|
|
1012
|
+
* folder, from the composing document at `from` (undefined for the top
|
|
1013
|
+
* document): `src` resolves from the folder of the document that contains it,
|
|
1014
|
+
* as each generated module imports its children. A posix path with `.`
|
|
1015
|
+
* segments removed and `..` folded; it may start with `../` (or `/`).
|
|
1016
|
+
*/
|
|
1017
|
+
export function composedViewPath(from, src) {
|
|
1018
|
+
const parts = from === undefined ? [] : from.split('/').slice(0, -1);
|
|
1019
|
+
if (src.startsWith('/')) parts.length = 0;
|
|
1020
|
+
for (const part of src.split('/')) {
|
|
1021
|
+
if (part === '' || part === '.') continue;
|
|
1022
|
+
if (part !== '..') parts.push(part);
|
|
1023
|
+
// `..` folds a folder; above the root (`/`) it stays at the root.
|
|
1024
|
+
else if (parts.length && parts.at(-1) !== '..') {
|
|
1025
|
+
if (parts.at(-1) !== '') parts.pop();
|
|
1026
|
+
} else parts.push(part);
|
|
1027
|
+
}
|
|
1028
|
+
return `${src.startsWith('/') ? '/' : ''}${parts.join('/')}`;
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
function checkView(ctx, node, at, scope, rowScoped) {
|
|
1032
|
+
if (typeof node.src !== 'string' || node.src === '') {
|
|
1033
|
+
ctx.report(
|
|
1034
|
+
'KUI-V012',
|
|
1035
|
+
`${at}.src`,
|
|
1036
|
+
'a #view node names its document in `src`',
|
|
1037
|
+
);
|
|
1038
|
+
return;
|
|
1039
|
+
}
|
|
1040
|
+
if (!ctx.resolveView) return;
|
|
1041
|
+
// Cycles compare where sources point, not their text: the same `src` in
|
|
1042
|
+
// two folders names two documents.
|
|
1043
|
+
const path = composedViewPath(ctx.viewPath, node.src);
|
|
1044
|
+
if (ctx.viewStack.includes(path)) {
|
|
1045
|
+
ctx.report('KUI-V012', `${at}.src`, `#view "${node.src}" is cyclic`);
|
|
1046
|
+
return;
|
|
1047
|
+
}
|
|
1048
|
+
const child = ctx.resolveView(node.src, path);
|
|
1049
|
+
if (!isObject(child)) {
|
|
1050
|
+
ctx.report('KUI-V012', `${at}.src`, `#view "${node.src}" was not found`);
|
|
1051
|
+
return;
|
|
1052
|
+
}
|
|
1053
|
+
if (isObject(child.slots) && Object.keys(child.slots).length > 0) {
|
|
1054
|
+
ctx.report(
|
|
1055
|
+
'KUI-V012',
|
|
1056
|
+
`${at}.src`,
|
|
1057
|
+
`#view "${node.src}" declares slots, which a composing document cannot fill`,
|
|
1058
|
+
);
|
|
1059
|
+
}
|
|
1060
|
+
const params = isObject(child.params) ? child.params : {};
|
|
1061
|
+
const given = isObject(node.props) ? node.props : {};
|
|
1062
|
+
for (const [name, value] of Object.entries(given)) {
|
|
1063
|
+
if (!isObject(params[name])) {
|
|
1064
|
+
ctx.report(
|
|
1065
|
+
'KUI-V012',
|
|
1066
|
+
`${at}.props.${name}`,
|
|
1067
|
+
`#view "${node.src}" has no param "${name}"`,
|
|
1068
|
+
);
|
|
1069
|
+
continue;
|
|
1070
|
+
}
|
|
1071
|
+
checkPropValue(
|
|
1072
|
+
ctx,
|
|
1073
|
+
{ name, type: params[name].type },
|
|
1074
|
+
value,
|
|
1075
|
+
{},
|
|
1076
|
+
scope,
|
|
1077
|
+
`${at}.props.${name}`,
|
|
1078
|
+
rowScoped,
|
|
1079
|
+
);
|
|
1080
|
+
}
|
|
1081
|
+
for (const [name, param] of Object.entries(params)) {
|
|
1082
|
+
if (
|
|
1083
|
+
isObject(param) &&
|
|
1084
|
+
!('default' in param) &&
|
|
1085
|
+
param.optional !== true &&
|
|
1086
|
+
!(name in given)
|
|
1087
|
+
) {
|
|
1088
|
+
ctx.report(
|
|
1089
|
+
'KUI-V012',
|
|
1090
|
+
at,
|
|
1091
|
+
`#view "${node.src}" requires param "${name}"`,
|
|
1092
|
+
);
|
|
1093
|
+
}
|
|
1094
|
+
}
|
|
1095
|
+
const nested = validateView(child, ctx.catalog, {
|
|
1096
|
+
resolveView: ctx.resolveView,
|
|
1097
|
+
icons: ctx.icons,
|
|
1098
|
+
viewStack: [...ctx.viewStack, path],
|
|
1099
|
+
viewPath: path,
|
|
1100
|
+
// A composed document inside a control renders inside it too.
|
|
1101
|
+
interactiveHost: ctx.interactiveHost,
|
|
1102
|
+
// ... and one inside a row renders inside that row.
|
|
1103
|
+
rowHost: ctx.rowHost || rowScoped,
|
|
1104
|
+
});
|
|
1105
|
+
for (const diagnostic of nested.diagnostics) {
|
|
1106
|
+
ctx.report(
|
|
1107
|
+
diagnostic.code,
|
|
1108
|
+
`${at}{${node.src}}${diagnostic.path.slice(1)}`,
|
|
1109
|
+
diagnostic.message,
|
|
1110
|
+
);
|
|
1111
|
+
}
|
|
1112
|
+
// KF-RDZ7N7: a document composed into a row renders inside that keyed row,
|
|
1113
|
+
// and the generated row passes its key to the composed root, so a delegated
|
|
1114
|
+
// handler reads the row key there. Its actions are row actions of the
|
|
1115
|
+
// composing document; its own contract keeps them view-scoped, since
|
|
1116
|
+
// standalone it has no row.
|
|
1117
|
+
for (const [name, actionScope] of nested.actions)
|
|
1118
|
+
ctx.noteAction(name, rowScoped ? 'row' : actionScope, at);
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1121
|
+
// Zone shapes, as the ESLint rule computes them over JSX: how many direct
|
|
1122
|
+
// children a zone can hold at least and at most, and which ones.
|
|
1123
|
+
const shape = (min, max, items) => ({ min, max, items });
|
|
1124
|
+
function combine(shapes) {
|
|
1125
|
+
return shapes.reduce(
|
|
1126
|
+
(total, item) =>
|
|
1127
|
+
shape(total.min + item.min, total.max + item.max, [
|
|
1128
|
+
...total.items,
|
|
1129
|
+
...item.items,
|
|
1130
|
+
]),
|
|
1131
|
+
shape(0, 0, []),
|
|
1132
|
+
);
|
|
1133
|
+
}
|
|
1134
|
+
function childShape(child) {
|
|
1135
|
+
if (!isObject(child)) return shape(0, 0, []);
|
|
1136
|
+
switch (childKind(child)) {
|
|
1137
|
+
case 'each': {
|
|
1138
|
+
const items = eachTemplates(child).flatMap((template) =>
|
|
1139
|
+
isObject(template) ? childShape(template).items : [],
|
|
1140
|
+
);
|
|
1141
|
+
return shape(0, Number.POSITIVE_INFINITY, items);
|
|
1142
|
+
}
|
|
1143
|
+
case 'if': {
|
|
1144
|
+
const then = childShape(child.then);
|
|
1145
|
+
const otherwise =
|
|
1146
|
+
'else' in child ? childShape(child.else) : shape(0, 0, []);
|
|
1147
|
+
return shape(
|
|
1148
|
+
Math.min(then.min, otherwise.min),
|
|
1149
|
+
Math.max(then.max, otherwise.max),
|
|
1150
|
+
[...then.items, ...otherwise.items],
|
|
1151
|
+
);
|
|
1152
|
+
}
|
|
1153
|
+
case 'slot':
|
|
1154
|
+
case 'view':
|
|
1155
|
+
return shape(1, 1, []);
|
|
1156
|
+
default:
|
|
1157
|
+
if (child.type === '#text') return shape(1, 1, [{ label: 'text' }]);
|
|
1158
|
+
return shape(1, 1, [{ node: child }]);
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
// Interactive content (HTML's button, a, input, label, and so on) cannot hold
|
|
1163
|
+
// more of it: the parser splits the host and the row contract breaks. An
|
|
1164
|
+
// entry's `content.interactive` rules say whether a node renders a control as
|
|
1165
|
+
// its root or inside it; `content.exports` does the same per JSX export.
|
|
1166
|
+
function interactiveOf(catalog, node) {
|
|
1167
|
+
const [base, exportName] = node.type.split('#');
|
|
1168
|
+
const content = catalog.entries.get(base)?.content;
|
|
1169
|
+
const rules = exportName
|
|
1170
|
+
? content?.exports?.[exportName]?.interactive
|
|
1171
|
+
: content?.interactive;
|
|
1172
|
+
const props = isObject(node.props) ? node.props : {};
|
|
1173
|
+
const applies = (rule) =>
|
|
1174
|
+
!rule.whenProps ||
|
|
1175
|
+
rule.whenProps.some((name) => props[name] != null && props[name] !== false);
|
|
1176
|
+
const matched = (rules ?? []).filter(applies).map((rule) => rule.kind);
|
|
1177
|
+
return matched.includes('root') ? 'root' : matched[0];
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
const conditionLabel = ({ prop, equals }) =>
|
|
1181
|
+
`\`${prop}=${JSON.stringify(equals)}\``;
|
|
1182
|
+
|
|
1183
|
+
function bringsInset(entry, node) {
|
|
1184
|
+
const geometry = entry?.layout?.geometry;
|
|
1185
|
+
if (
|
|
1186
|
+
!geometry ||
|
|
1187
|
+
!['margin', 'border', 'padding'].every((side) => geometry[side] === 'self')
|
|
1188
|
+
)
|
|
1189
|
+
return false;
|
|
1190
|
+
const props = isObject(node.props) ? node.props : {};
|
|
1191
|
+
return !(entry.insetFreeWhen ?? []).some((condition) => {
|
|
1192
|
+
const value = props[condition.prop];
|
|
1193
|
+
const known = !isObject(value);
|
|
1194
|
+
return !known || value === condition.equals;
|
|
1195
|
+
});
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
function checkComposition(
|
|
1199
|
+
ctx,
|
|
1200
|
+
node,
|
|
1201
|
+
at,
|
|
1202
|
+
parentKey,
|
|
1203
|
+
shapes,
|
|
1204
|
+
literals,
|
|
1205
|
+
bindings,
|
|
1206
|
+
) {
|
|
1207
|
+
const [base, exportName] = node.type.split('#');
|
|
1208
|
+
const entry = ctx.catalog.entries.get(base);
|
|
1209
|
+
if (!entry) return;
|
|
1210
|
+
const exportContract = exportName
|
|
1211
|
+
? entry.jsxExports?.[exportName]
|
|
1212
|
+
: undefined;
|
|
1213
|
+
const rootsOf = (key) => ctx.catalog.entries.get(key)?.rendersAs ?? [key];
|
|
1214
|
+
const parents = exportName ? exportContract?.parents : entry.parents;
|
|
1215
|
+
if (parents?.mode === 'listed' && parentKey) {
|
|
1216
|
+
const parentRoots = rootsOf(keyOf(parentKey));
|
|
1217
|
+
if (!parentRoots.every((root) => parents.entries.includes(root))) {
|
|
1218
|
+
ctx.report(
|
|
1219
|
+
'KUI-L201',
|
|
1220
|
+
at,
|
|
1221
|
+
`\`${node.type}\` requires one of these cataloged parents: ${parents.entries.join(', ')}`,
|
|
1222
|
+
);
|
|
1223
|
+
}
|
|
1224
|
+
}
|
|
1225
|
+
if (exportName) return;
|
|
1226
|
+
const insetCondition = (entry.insetFreeChildren ?? []).find(
|
|
1227
|
+
(condition) =>
|
|
1228
|
+
literals.has(condition.prop) &&
|
|
1229
|
+
literals.get(condition.prop) === condition.equals,
|
|
1230
|
+
);
|
|
1231
|
+
for (const zone of entry.zones ?? []) {
|
|
1232
|
+
if (!zone.jsx?.prop) continue;
|
|
1233
|
+
const found = shapes.get(zone.id) ?? shape(0, 0, []);
|
|
1234
|
+
const allowed = new Set(
|
|
1235
|
+
zone.accepts
|
|
1236
|
+
.map((accepted) =>
|
|
1237
|
+
accepted.includes(':') ? accepted : `${entry.package}:${accepted}`,
|
|
1238
|
+
)
|
|
1239
|
+
.filter((accepted) => ctx.catalog.entries.has(accepted)),
|
|
1240
|
+
);
|
|
1241
|
+
if (allowed.size) {
|
|
1242
|
+
for (const item of found.items) {
|
|
1243
|
+
const key = item.node
|
|
1244
|
+
? item.node.type.includes('#')
|
|
1245
|
+
? item.node.type.replace('#', ':')
|
|
1246
|
+
: item.node.type
|
|
1247
|
+
: undefined;
|
|
1248
|
+
const roots = key ? rootsOf(key) : [];
|
|
1249
|
+
if (!key || !roots.every((root) => allowed.has(root))) {
|
|
1250
|
+
ctx.report(
|
|
1251
|
+
'KUI-L202',
|
|
1252
|
+
`${at}.zones.${zone.id}`,
|
|
1253
|
+
`\`${node.type}\` zone \`${zone.id}\` does not accept ${key ?? item.label}; catalog accepts: ${[...allowed].join(', ')}`,
|
|
1254
|
+
);
|
|
1255
|
+
}
|
|
1256
|
+
}
|
|
1257
|
+
}
|
|
1258
|
+
const { min, max } = zone.cardinality;
|
|
1259
|
+
if (found.max < min || (max !== 'unbounded' && found.min > max)) {
|
|
1260
|
+
ctx.report(
|
|
1261
|
+
'KUI-L203',
|
|
1262
|
+
`${at}.zones.${zone.id}`,
|
|
1263
|
+
`\`${node.type}\` zone \`${zone.id}\` requires ${min}..${max} direct children; found ${found.max < min ? found.max : found.min}`,
|
|
1264
|
+
);
|
|
1265
|
+
}
|
|
1266
|
+
}
|
|
1267
|
+
// The inset rule reads the children region, whether the catalog binds it
|
|
1268
|
+
// as a zone or the component exposes it as a content prop.
|
|
1269
|
+
const childrenKey = [...bindings].find(
|
|
1270
|
+
([, binding]) => binding.prop === 'children',
|
|
1271
|
+
)?.[0];
|
|
1272
|
+
const children = childrenKey ? shapes.get(childrenKey) : undefined;
|
|
1273
|
+
if (!insetCondition || !children) return;
|
|
1274
|
+
for (const item of children.items) {
|
|
1275
|
+
const childEntry = item.node && ctx.catalog.entries.get(item.node.type);
|
|
1276
|
+
if (!childEntry || !bringsInset(childEntry, item.node)) continue;
|
|
1277
|
+
const fix = childEntry.insetFreeWhen?.length
|
|
1278
|
+
? `set ${childEntry.insetFreeWhen.map(conditionLabel).join(' or ')}`
|
|
1279
|
+
: 'use an inset-free child';
|
|
1280
|
+
ctx.report(
|
|
1281
|
+
'KUI-L204',
|
|
1282
|
+
`${at}.zones.${childrenKey}`,
|
|
1283
|
+
`\`${item.node.type}\` brings its own content-item inset into \`${node.type}\` with ${conditionLabel(insetCondition)}, which expects inset-free content; ${fix}`,
|
|
1284
|
+
);
|
|
1285
|
+
}
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1288
|
+
/**
|
|
1289
|
+
* Kerf UI's whole-screen layouts: each fills its parent's height and has no
|
|
1290
|
+
* height of its own, so below the root it collapses to its bar unless a
|
|
1291
|
+
* SizedRegion or another of these layouts gives it a height (KF-KQ72TW).
|
|
1292
|
+
*/
|
|
1293
|
+
const SCREEN_LAYOUTS = new Set([
|
|
1294
|
+
'@kerfjs/ui:nav-stack',
|
|
1295
|
+
'@kerfjs/ui:split-view',
|
|
1296
|
+
'@kerfjs/ui:tab-navigator',
|
|
1297
|
+
'@kerfjs/ui:workbench',
|
|
1298
|
+
]);
|
|
1299
|
+
const SIZED_REGION = '@kerfjs/ui:sized-region';
|
|
1300
|
+
|
|
1301
|
+
const PANE = '@kerfjs/ui:pane';
|
|
1302
|
+
|
|
1303
|
+
/**
|
|
1304
|
+
* Whether `node`'s `zone` gives a child a definite height. A SizedRegion or
|
|
1305
|
+
* another whole-screen layout always does. A Pane with a literal `fill: true`
|
|
1306
|
+
* gives its `content` zone one when the Pane itself sits in a sized place (the
|
|
1307
|
+
* root, inside a SizedRegion or layout), since its rows then have a height
|
|
1308
|
+
* (KF-AMEZB3: a filled root Pane sizes a nested layout).
|
|
1309
|
+
*/
|
|
1310
|
+
function zoneSizes(node, zone, sized) {
|
|
1311
|
+
if (node.type === SIZED_REGION || SCREEN_LAYOUTS.has(node.type)) return true;
|
|
1312
|
+
return (
|
|
1313
|
+
sized &&
|
|
1314
|
+
node.type === PANE &&
|
|
1315
|
+
zone === 'content' &&
|
|
1316
|
+
isObject(node.props) &&
|
|
1317
|
+
node.props.fill === true
|
|
1318
|
+
);
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1321
|
+
/**
|
|
1322
|
+
* `KUI-H001` hints (non-blocking): a whole-screen layout below the root whose
|
|
1323
|
+
* place has no definite height: its parent is not a SizedRegion, another
|
|
1324
|
+
* whole-screen layout, or a filled Pane's content in a sized place. `sized`
|
|
1325
|
+
* is whether `node` itself sits in a place with a definite height.
|
|
1326
|
+
*/
|
|
1327
|
+
function hintUnsizedLayouts(node, at, sized, hints, isRoot = false) {
|
|
1328
|
+
if (!isObject(node) || typeof node.type !== 'string') return;
|
|
1329
|
+
if (!isRoot && !sized && SCREEN_LAYOUTS.has(node.type))
|
|
1330
|
+
hints.push({
|
|
1331
|
+
code: 'KUI-H001',
|
|
1332
|
+
path: at,
|
|
1333
|
+
message: `${node.type} has no height of its own here and collapses to its bar; wrap it in ${SIZED_REGION}`,
|
|
1334
|
+
});
|
|
1335
|
+
const child = (item, path, childSized) => {
|
|
1336
|
+
if (!isObject(item)) return;
|
|
1337
|
+
switch (childKind(item)) {
|
|
1338
|
+
case 'each':
|
|
1339
|
+
if ('templates' in item)
|
|
1340
|
+
for (const [kind, template] of Object.entries(
|
|
1341
|
+
isObject(item.templates) ? item.templates : {},
|
|
1342
|
+
))
|
|
1343
|
+
child(template, `${path}.templates.${kind}`, childSized);
|
|
1344
|
+
else child(item.template, `${path}.template`, childSized);
|
|
1345
|
+
break;
|
|
1346
|
+
case 'if':
|
|
1347
|
+
child(item.then, `${path}.then`, childSized);
|
|
1348
|
+
if ('else' in item) child(item.else, `${path}.else`, childSized);
|
|
1349
|
+
break;
|
|
1350
|
+
default:
|
|
1351
|
+
hintUnsizedLayouts(item, path, childSized, hints);
|
|
1352
|
+
}
|
|
1353
|
+
};
|
|
1354
|
+
for (const [zone, children] of Object.entries(
|
|
1355
|
+
isObject(node.zones) ? node.zones : {},
|
|
1356
|
+
)) {
|
|
1357
|
+
const childSized = zoneSizes(node, zone, sized);
|
|
1358
|
+
if (Array.isArray(children))
|
|
1359
|
+
children.forEach((item, index) =>
|
|
1360
|
+
child(item, `${at}.zones.${zone}[${index}]`, childSized),
|
|
1361
|
+
);
|
|
1362
|
+
}
|
|
1363
|
+
}
|
|
1364
|
+
|
|
1365
|
+
/**
|
|
1366
|
+
* Validates a view document. Returns `{ valid, diagnostics, hints, actions }`,
|
|
1367
|
+
* where each diagnostic is `{ code, path, message }` (a `KUI-V###` document id
|
|
1368
|
+
* or a `KUI-L201`–`L204` composition id) and `actions` maps each action name
|
|
1369
|
+
* to its `row` or `view` scope. `hints` are non-blocking `KUI-H###` advice
|
|
1370
|
+
* about a valid document (a nested layout with no height); they never make it
|
|
1371
|
+
* invalid. `options.resolveView(src, path)` loads a composed document, where
|
|
1372
|
+
* `path` is where `src` points relative to the top document's folder (each
|
|
1373
|
+
* `src` resolves from the document that contains it); without it, `#view`
|
|
1374
|
+
* nodes are checked for shape only.
|
|
1375
|
+
*/
|
|
1376
|
+
export function validateView(document, catalog, options = {}) {
|
|
1377
|
+
return runView(document, catalog, options);
|
|
1378
|
+
}
|
|
1379
|
+
|
|
1380
|
+
/**
|
|
1381
|
+
* A validation context: the options, a diagnostics sink, and the id, name,
|
|
1382
|
+
* and action tables. A `trace` marks a scoped run (validate-move.mjs): it
|
|
1383
|
+
* records each action use, and a `quiet` one leaves conflicts to its caller.
|
|
1384
|
+
*/
|
|
1385
|
+
function createContext(catalog, options, trace) {
|
|
1386
|
+
const diagnostics = [];
|
|
1387
|
+
const ids = new Map();
|
|
1388
|
+
const names = new Map();
|
|
1389
|
+
const actions = new Map();
|
|
1390
|
+
const ctx = {
|
|
1391
|
+
catalog,
|
|
1392
|
+
diagnostics,
|
|
1393
|
+
actions,
|
|
1394
|
+
trace,
|
|
1395
|
+
resolveView: options.resolveView,
|
|
1396
|
+
icons: options.icons ? new Set(options.icons) : undefined,
|
|
1397
|
+
viewStack: options.viewStack ?? [],
|
|
1398
|
+
viewPath: options.viewPath,
|
|
1399
|
+
params: new Map(),
|
|
1400
|
+
slots: new Map(),
|
|
1401
|
+
checkedSlots: new WeakSet(),
|
|
1402
|
+
nestedDynamics: new WeakMap(),
|
|
1403
|
+
packages: undefined,
|
|
1404
|
+
interactiveHost: options.interactiveHost,
|
|
1405
|
+
rowHost: options.rowHost === true,
|
|
1406
|
+
report(code, path, message) {
|
|
1407
|
+
diagnostics.push({ code, path, message });
|
|
1408
|
+
},
|
|
1409
|
+
noteId(id, at) {
|
|
1410
|
+
if (typeof id !== 'string' || !ULID.test(id)) {
|
|
1411
|
+
ctx.report('KUI-V006', `${at}.id`, 'a node id is a 26-character ULID');
|
|
1412
|
+
} else if (ids.has(id)) {
|
|
1413
|
+
ctx.report(
|
|
1414
|
+
'KUI-V006',
|
|
1415
|
+
`${at}.id`,
|
|
1416
|
+
`duplicate node id ${id} (first at ${ids.get(id)})`,
|
|
1417
|
+
);
|
|
1418
|
+
} else ids.set(id, at);
|
|
1419
|
+
},
|
|
1420
|
+
noteName(name, at) {
|
|
1421
|
+
if (typeof name !== 'string' || !CAMEL.test(name)) {
|
|
1422
|
+
ctx.report(
|
|
1423
|
+
'KUI-V006',
|
|
1424
|
+
`${at}.name`,
|
|
1425
|
+
'a node name is a camelCase identifier',
|
|
1426
|
+
);
|
|
1427
|
+
} else if (names.has(name)) {
|
|
1428
|
+
ctx.report(
|
|
1429
|
+
'KUI-V006',
|
|
1430
|
+
`${at}.name`,
|
|
1431
|
+
`duplicate node name "${name}" (first at ${names.get(name)})`,
|
|
1432
|
+
);
|
|
1433
|
+
} else names.set(name, at);
|
|
1434
|
+
},
|
|
1435
|
+
noteAction(name, scope, at) {
|
|
1436
|
+
if (trace) {
|
|
1437
|
+
trace.notes.push([name, scope]);
|
|
1438
|
+
if (trace.quiet) return;
|
|
1439
|
+
}
|
|
1440
|
+
const seen = actions.get(name);
|
|
1441
|
+
if (seen && seen !== scope) {
|
|
1442
|
+
ctx.report(
|
|
1443
|
+
'KUI-V009',
|
|
1444
|
+
at,
|
|
1445
|
+
`action "${name}" is used with both row and view scope`,
|
|
1446
|
+
);
|
|
1447
|
+
} else actions.set(name, scope);
|
|
1448
|
+
},
|
|
1449
|
+
};
|
|
1450
|
+
return ctx;
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
/**
|
|
1454
|
+
* Checks a document's own fields, params, and slots into `ctx`, which then
|
|
1455
|
+
* knows them. False when the document is not an object.
|
|
1456
|
+
*/
|
|
1457
|
+
function checkHeader(ctx, document) {
|
|
1458
|
+
if (!isObject(document)) {
|
|
1459
|
+
ctx.report('KUI-V001', '$', 'a view document is a JSON object');
|
|
1460
|
+
return false;
|
|
1461
|
+
}
|
|
1462
|
+
for (const key of only(document, [
|
|
1463
|
+
'$schema',
|
|
1464
|
+
'schema',
|
|
1465
|
+
'name',
|
|
1466
|
+
'catalogs',
|
|
1467
|
+
'params',
|
|
1468
|
+
'slots',
|
|
1469
|
+
'root',
|
|
1470
|
+
])) {
|
|
1471
|
+
ctx.report('KUI-V001', `$.${key}`, 'unknown top-level field');
|
|
1472
|
+
}
|
|
1473
|
+
if (document.schema !== VIEW_DOCUMENT_SCHEMA_ID) {
|
|
1474
|
+
ctx.report(
|
|
1475
|
+
'KUI-V001',
|
|
1476
|
+
'$.schema',
|
|
1477
|
+
`schema must be "${VIEW_DOCUMENT_SCHEMA_ID}"`,
|
|
1478
|
+
);
|
|
1479
|
+
}
|
|
1480
|
+
if (typeof document.name !== 'string' || !PASCAL.test(document.name)) {
|
|
1481
|
+
ctx.report('KUI-V001', '$.name', 'name is a PascalCase identifier');
|
|
1482
|
+
}
|
|
1483
|
+
if (
|
|
1484
|
+
!Array.isArray(document.catalogs) ||
|
|
1485
|
+
document.catalogs.some((item) => typeof item !== 'string')
|
|
1486
|
+
) {
|
|
1487
|
+
ctx.report(
|
|
1488
|
+
'KUI-V001',
|
|
1489
|
+
'$.catalogs',
|
|
1490
|
+
'catalogs is a list of package names or catalog paths',
|
|
1491
|
+
);
|
|
1492
|
+
} else {
|
|
1493
|
+
// Only package names can be checked here; a path's package is the caller's
|
|
1494
|
+
// to resolve, so a document naming any path skips the package check.
|
|
1495
|
+
const pathLike = document.catalogs.some(
|
|
1496
|
+
(item) => item.startsWith('.') || item.startsWith('/'),
|
|
1497
|
+
);
|
|
1498
|
+
if (!pathLike) ctx.packages = new Set(document.catalogs);
|
|
1499
|
+
}
|
|
1500
|
+
for (const [name, param] of Object.entries(
|
|
1501
|
+
isObject(document.params) ? document.params : {},
|
|
1502
|
+
)) {
|
|
1503
|
+
const at = `$.params.${name}`;
|
|
1504
|
+
if (!CAMEL.test(name) || !isObject(param)) {
|
|
1505
|
+
ctx.report(
|
|
1506
|
+
'KUI-V001',
|
|
1507
|
+
at,
|
|
1508
|
+
'a param is a camelCase name mapped to `{ type, default?, optional? }`',
|
|
1509
|
+
);
|
|
1510
|
+
continue;
|
|
1511
|
+
}
|
|
1512
|
+
for (const key of only(param, [
|
|
1513
|
+
'type',
|
|
1514
|
+
'default',
|
|
1515
|
+
'optional',
|
|
1516
|
+
'description',
|
|
1517
|
+
]))
|
|
1518
|
+
ctx.report('KUI-V001', `${at}.${key}`, 'unknown param field');
|
|
1519
|
+
// KF-JE8KHX: `optional: true` makes an input optional with no default,
|
|
1520
|
+
// so an omitted value reads as absent (an optional item field extracted
|
|
1521
|
+
// into a row document).
|
|
1522
|
+
if ('optional' in param && (param.optional !== true || 'default' in param))
|
|
1523
|
+
ctx.report(
|
|
1524
|
+
'KUI-V001',
|
|
1525
|
+
`${at}.optional`,
|
|
1526
|
+
'optional is `true`, on a param with no default (a default already makes it optional)',
|
|
1527
|
+
);
|
|
1528
|
+
validateDeclaredType(ctx, param.type, `${at}.type`);
|
|
1529
|
+
// A prop-typed param's default is a literal of that prop (KF-V9V2B6: a
|
|
1530
|
+
// Select's choices promoted with their current list).
|
|
1531
|
+
const owner =
|
|
1532
|
+
param.type?.kind === 'prop'
|
|
1533
|
+
? ctx.catalog.components.get(param.type.component)
|
|
1534
|
+
: undefined;
|
|
1535
|
+
const ownerProp = owner?.component.props.find(
|
|
1536
|
+
(prop) => prop.name === param.type.prop,
|
|
1537
|
+
);
|
|
1538
|
+
if (
|
|
1539
|
+
'default' in param &&
|
|
1540
|
+
PARAM_KINDS.has(param.type?.kind) &&
|
|
1541
|
+
!(ownerProp
|
|
1542
|
+
? isLiteralOf(param.default, ownerProp.type, owner.definitions)
|
|
1543
|
+
: isLiteralOf(param.default, param.type))
|
|
1544
|
+
) {
|
|
1545
|
+
ctx.report(
|
|
1546
|
+
'KUI-V004',
|
|
1547
|
+
`${at}.default`,
|
|
1548
|
+
`the default is not a valid ${describe(param.type)}`,
|
|
1549
|
+
);
|
|
1550
|
+
}
|
|
1551
|
+
ctx.params.set(name, param);
|
|
1552
|
+
}
|
|
1553
|
+
if (document.params !== undefined && !isObject(document.params))
|
|
1554
|
+
ctx.report('KUI-V001', '$.params', 'params is an object');
|
|
1555
|
+
for (const [name, slot] of Object.entries(
|
|
1556
|
+
isObject(document.slots) ? document.slots : {},
|
|
1557
|
+
)) {
|
|
1558
|
+
const at = `$.slots.${name}`;
|
|
1559
|
+
if (!CAMEL.test(name) || !isObject(slot)) {
|
|
1560
|
+
ctx.report(
|
|
1561
|
+
'KUI-V001',
|
|
1562
|
+
at,
|
|
1563
|
+
'a slot is a camelCase name mapped to `{ input? }`',
|
|
1564
|
+
);
|
|
1565
|
+
continue;
|
|
1566
|
+
}
|
|
1567
|
+
for (const key of only(slot, ['input', 'description']))
|
|
1568
|
+
ctx.report('KUI-V001', `${at}.${key}`, 'unknown slot field');
|
|
1569
|
+
if (slot.input !== undefined) {
|
|
1570
|
+
if (slot.input?.kind !== 'object')
|
|
1571
|
+
ctx.report('KUI-V001', `${at}.input`, 'a slot input is an object type');
|
|
1572
|
+
else validateDeclaredType(ctx, slot.input, `${at}.input`);
|
|
1573
|
+
}
|
|
1574
|
+
ctx.slots.set(name, slot);
|
|
1575
|
+
}
|
|
1576
|
+
return true;
|
|
1577
|
+
}
|
|
1578
|
+
|
|
1579
|
+
/**
|
|
1580
|
+
* `validateView` with an optional `trace` (validate-move.mjs): its
|
|
1581
|
+
* `entries` map, when given, records where each node is checked. Internal.
|
|
1582
|
+
*/
|
|
1583
|
+
export function runView(document, catalog, options, trace) {
|
|
1584
|
+
const ctx = createContext(catalog, options, trace);
|
|
1585
|
+
const { diagnostics, actions } = ctx;
|
|
1586
|
+
if (!checkHeader(ctx, document))
|
|
1587
|
+
return { valid: false, diagnostics, hints: [], actions };
|
|
1588
|
+
// KF-PK3GVY: an editor's empty draft has no root yet; it is a document,
|
|
1589
|
+
// but nothing can generate or render it until a component becomes one.
|
|
1590
|
+
if (document.root === undefined) {
|
|
1591
|
+
ctx.report(
|
|
1592
|
+
'KUI-V017',
|
|
1593
|
+
'$.root',
|
|
1594
|
+
'the document has no root; add a component to start it',
|
|
1595
|
+
);
|
|
1596
|
+
} else if (!isObject(document.root) || !('type' in document.root)) {
|
|
1597
|
+
ctx.report('KUI-V001', '$.root', 'root is exactly one node');
|
|
1598
|
+
} else {
|
|
1599
|
+
checkNode(ctx, document.root, '$.root', new Map(), false, undefined);
|
|
1600
|
+
}
|
|
1601
|
+
const hints = [];
|
|
1602
|
+
if (hasTypeExpressions(document))
|
|
1603
|
+
hints.push({
|
|
1604
|
+
code: 'KUI-H002',
|
|
1605
|
+
path: '$.params',
|
|
1606
|
+
message:
|
|
1607
|
+
'TypeScript parameter expressions require the owning project compiler; this pass checks structure only.',
|
|
1608
|
+
});
|
|
1609
|
+
hintUnsizedLayouts(document.root, '$.root', true, hints, true);
|
|
1610
|
+
return { valid: diagnostics.length === 0, diagnostics, hints, actions };
|
|
1611
|
+
}
|
|
1612
|
+
|
|
1613
|
+
/**
|
|
1614
|
+
* Checks pieces of `document` alone (KF-SFAA5R: scoped move validation), as
|
|
1615
|
+
* `validateView(document, catalog)` checks them in the place `entry`
|
|
1616
|
+
* describes (an `entries` record of a traced run). Returns a function that
|
|
1617
|
+
* checks `item`, a node (or, with `asChild`, any zone child) and its
|
|
1618
|
+
* subtree, or, with `shallow`, the node alone, noting where a child appended
|
|
1619
|
+
* to `zone` would be checked. Action conflicts and duplicate ids and names
|
|
1620
|
+
* are left to the caller: each run has its own tables. Internal.
|
|
1621
|
+
*/
|
|
1622
|
+
export function createScopedCheck(document, catalog) {
|
|
1623
|
+
const header = createContext(catalog, {});
|
|
1624
|
+
checkHeader(header, document);
|
|
1625
|
+
return (item, entry, { asChild = false, shallow = false, zone } = {}) => {
|
|
1626
|
+
const trace = {
|
|
1627
|
+
quiet: true,
|
|
1628
|
+
notes: [],
|
|
1629
|
+
shallow: shallow ? item : undefined,
|
|
1630
|
+
zone,
|
|
1631
|
+
child: undefined,
|
|
1632
|
+
hostAfter: undefined,
|
|
1633
|
+
};
|
|
1634
|
+
const ctx = createContext(catalog, {}, trace);
|
|
1635
|
+
ctx.params = header.params;
|
|
1636
|
+
ctx.slots = header.slots;
|
|
1637
|
+
ctx.packages = header.packages;
|
|
1638
|
+
ctx.interactiveHost = entry[5];
|
|
1639
|
+
(asChild ? checkChild : checkNode)(ctx, item, ...entry.slice(0, 5));
|
|
1640
|
+
return { ...trace, diagnostics: ctx.diagnostics };
|
|
1641
|
+
};
|
|
1642
|
+
}
|
|
1643
|
+
|
|
1644
|
+
/**
|
|
1645
|
+
* What a parent's checks read of node `node` as its child: its type and
|
|
1646
|
+
* whether it brings its own content-item inset (`KUI-L204`). Internal.
|
|
1647
|
+
*/
|
|
1648
|
+
export const childFacts = (catalog, node) =>
|
|
1649
|
+
`${node.type} ${bringsInset(catalog.entries.get(node.type), node)}`;
|