@kerfjs/ui 5.0.0-beta.6 → 5.0.0-beta.61
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 +494 -138
- package/ai/application-ui-diagnostic-ids-v1.json +109 -0
- package/ai/application-ui-profile-sync.cjs +529 -0
- package/ai/application-ui-profile.d.mts +1 -0
- package/ai/application-ui-profile.d.ts +102 -0
- package/ai/application-ui-profile.defaults.json +96 -0
- package/ai/application-ui-profile.mjs +626 -0
- package/ai/application-ui-profile.schema.json +130 -0
- package/ai/catalog-authoring.json +36 -0
- package/ai/catalog-authoring.schema.json +109 -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 +79 -0
- package/ai/component-catalog.json +4041 -591
- package/ai/component-catalog.schema.json +78 -1
- 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 +524 -0
- package/ai/component-composition.d.ts +125 -0
- package/ai/component-composition.json +7074 -0
- package/ai/component-composition.schema.json +375 -0
- package/ai/components/README.md +171 -0
- package/ai/components/application-tabs.md +65 -0
- package/ai/components/badge.md +72 -0
- package/ai/components/chip.md +72 -0
- package/ai/components/collapsible-panel.md +102 -0
- package/ai/components/content-item.md +90 -0
- package/ai/components/disclosure-arrow.md +77 -0
- package/ai/components/document-baseline.md +75 -0
- package/ai/components/empty-state.md +80 -0
- package/ai/components/feedback.md +71 -0
- package/ai/components/floating-toolbar.md +82 -0
- package/ai/components/foundation.md +65 -0
- package/ai/components/grid.md +96 -0
- package/ai/components/headers.md +63 -0
- package/ai/components/layout.md +75 -0
- package/ai/components/list-action-row.md +91 -0
- package/ai/components/list-header.md +89 -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 +94 -0
- package/ai/components/list.md +103 -0
- package/ai/components/loading-spinner.md +72 -0
- package/ai/components/lucide-icon.md +66 -0
- package/ai/components/nav-stack.md +103 -0
- package/ai/components/pane.md +100 -0
- package/ai/components/popup-menu.md +171 -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-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/segmented-control.md +82 -0
- package/ai/components/select.md +112 -0
- package/ai/components/skeleton.md +84 -0
- package/ai/components/spacer.md +86 -0
- package/ai/components/split-view.md +102 -0
- package/ai/components/state-banner.md +94 -0
- package/ai/components/sunken-panel.md +79 -0
- package/ai/components/surface-scaffold.md +78 -0
- package/ai/components/tab-bar.md +112 -0
- package/ai/components/tab-scaffold.md +94 -0
- package/ai/components/tabs.md +95 -0
- package/ai/components/text.md +83 -0
- package/ai/components/token-search-field.md +103 -0
- package/ai/components/toolbar-control-group.md +102 -0
- package/ai/components/toolbar-text.md +78 -0
- package/ai/components/toolbar.md +97 -0
- package/ai/components/value-table.md +73 -0
- package/ai/components/wa-accordion-item.md +55 -0
- package/ai/components/wa-accordion.md +65 -0
- package/ai/components/wa-animated-image.md +55 -0
- package/ai/components/wa-animation.md +55 -0
- package/ai/components/wa-avatar.md +55 -0
- package/ai/components/wa-badge.md +55 -0
- package/ai/components/wa-breadcrumb-item.md +53 -0
- package/ai/components/wa-breadcrumb.md +55 -0
- package/ai/components/wa-button-group.md +59 -0
- package/ai/components/wa-button.md +55 -0
- package/ai/components/wa-callout.md +58 -0
- package/ai/components/wa-card.md +59 -0
- package/ai/components/wa-carousel-item.md +53 -0
- package/ai/components/wa-carousel.md +55 -0
- package/ai/components/wa-checkbox-group.md +55 -0
- package/ai/components/wa-checkbox.md +55 -0
- package/ai/components/wa-color-picker.md +55 -0
- package/ai/components/wa-comparison.md +55 -0
- package/ai/components/wa-copy-button.md +55 -0
- package/ai/components/wa-details.md +61 -0
- package/ai/components/wa-dialog.md +59 -0
- package/ai/components/wa-divider.md +53 -0
- package/ai/components/wa-drawer.md +55 -0
- package/ai/components/wa-dropdown-item.md +60 -0
- package/ai/components/wa-dropdown.md +60 -0
- package/ai/components/wa-format-bytes.md +53 -0
- package/ai/components/wa-format-date.md +53 -0
- package/ai/components/wa-format-number.md +53 -0
- package/ai/components/wa-icon.md +58 -0
- package/ai/components/wa-include.md +53 -0
- package/ai/components/wa-input.md +59 -0
- package/ai/components/wa-intersection-observer.md +53 -0
- package/ai/components/wa-known-date.md +53 -0
- package/ai/components/wa-markdown.md +53 -0
- package/ai/components/wa-mutation-observer.md +53 -0
- package/ai/components/wa-number-input.md +55 -0
- package/ai/components/wa-option.md +59 -0
- package/ai/components/wa-otp-input.md +53 -0
- package/ai/components/wa-page.md +53 -0
- package/ai/components/wa-pagination.md +55 -0
- package/ai/components/wa-popover.md +55 -0
- package/ai/components/wa-popup.md +53 -0
- package/ai/components/wa-progress-bar.md +53 -0
- package/ai/components/wa-progress-ring.md +53 -0
- package/ai/components/wa-qr-code.md +53 -0
- package/ai/components/wa-radio-group.md +59 -0
- package/ai/components/wa-radio.md +55 -0
- package/ai/components/wa-random-content.md +53 -0
- package/ai/components/wa-rating.md +55 -0
- package/ai/components/wa-relative-time.md +53 -0
- package/ai/components/wa-resize-observer.md +53 -0
- package/ai/components/wa-scroller.md +53 -0
- package/ai/components/wa-select.md +63 -0
- package/ai/components/wa-skeleton.md +53 -0
- package/ai/components/wa-slider.md +55 -0
- package/ai/components/wa-spinner.md +58 -0
- package/ai/components/wa-split-panel.md +58 -0
- package/ai/components/wa-switch.md +53 -0
- package/ai/components/wa-tab-group.md +69 -0
- package/ai/components/wa-tab-panel.md +60 -0
- package/ai/components/wa-tab.md +59 -0
- package/ai/components/wa-tag.md +59 -0
- package/ai/components/wa-textarea.md +53 -0
- package/ai/components/wa-time-input.md +55 -0
- package/ai/components/wa-toast-item.md +60 -0
- package/ai/components/wa-toast.md +60 -0
- package/ai/components/wa-tooltip.md +55 -0
- package/ai/components/wa-tree-item.md +55 -0
- package/ai/components/wa-tree.md +55 -0
- package/ai/components/wa-zoomable-frame.md +55 -0
- package/ai/components/workbench.md +114 -0
- package/ai/public-api-signatures-v1.md +2597 -190
- package/ai/skill.md +259 -65
- package/ai/webawesome-jsx-signatures-v1.md +9 -2
- package/analyzer/cli.mjs +49 -0
- package/analyzer/component-ownership.d.mts +56 -0
- package/analyzer/component-ownership.mjs +184 -0
- package/analyzer/index.d.mts +49 -0
- package/analyzer/index.mjs +1458 -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/dist/app-tab.d.ts +41 -4
- package/dist/app-tab.js +3 -1
- package/dist/badge.d.ts +52 -0
- package/dist/badge.js +3 -0
- package/dist/badge.js.map +1 -0
- package/dist/browser/app-tab.js +1 -0
- package/dist/browser/badge.js +3 -0
- package/dist/browser/catalog.js +25 -0
- package/dist/browser/chip.js +3 -0
- package/dist/browser/collapsible-panel.js +7 -0
- package/dist/browser/content-item.js +3 -0
- package/dist/browser/floating-toolbar.js +3 -0
- package/dist/browser/grid.js +3 -0
- package/dist/browser/list-action-row.js +5 -0
- package/dist/browser/list-header.js +8 -0
- package/dist/browser/list-inset-control.js +3 -0
- package/dist/browser/list-inset-text.js +3 -0
- package/dist/browser/list-item.js +5 -0
- package/dist/browser/list.js +3 -0
- package/dist/browser/{panel-header.js → nav-stack.js} +4 -2
- package/dist/browser/pane.js +3 -0
- package/dist/browser/popup-menu.js +3 -0
- package/dist/browser/row.js +3 -0
- package/dist/browser/select.js +2 -0
- package/dist/browser/skeleton.js +3 -0
- package/dist/browser/spacer.js +3 -0
- package/dist/browser/split-view.js +10 -0
- package/dist/browser/state-banner.js +2 -0
- package/dist/browser/sunken-panel.js +3 -0
- package/dist/browser/surface-scaffold.js +3 -0
- package/dist/browser/tab-scaffold.js +4 -0
- package/dist/browser/text.js +3 -0
- package/dist/browser/toolbar-text.js +1 -0
- package/dist/browser/value-table.js +1 -0
- package/dist/browser/workbench.js +10 -0
- package/dist/catalog-resources.d.ts +46 -0
- package/dist/catalog-resources.js +22 -0
- package/dist/catalog-resources.js.map +1 -0
- package/dist/catalog.d.ts +90 -0
- package/dist/catalog.js +501 -0
- package/dist/catalog.js.map +1 -0
- package/dist/chip.d.ts +29 -0
- package/dist/chip.js +3 -0
- package/dist/chip.js.map +1 -0
- package/dist/chunk-2G2ZJQYK.js +152 -0
- package/dist/chunk-2G2ZJQYK.js.map +1 -0
- package/dist/chunk-3SXMEK3B.js +43 -0
- package/dist/chunk-3SXMEK3B.js.map +1 -0
- package/dist/{chunk-W2FK7ZNY.js → chunk-4R777DUZ.js} +10 -2
- package/dist/chunk-4R777DUZ.js.map +1 -0
- package/dist/chunk-4SQK27MR.js +202 -0
- package/dist/chunk-4SQK27MR.js.map +1 -0
- package/dist/chunk-5I7QGQVT.js +24 -0
- package/dist/chunk-5I7QGQVT.js.map +1 -0
- package/dist/chunk-5PESG2VP.js +115 -0
- package/dist/chunk-5PESG2VP.js.map +1 -0
- package/dist/chunk-5Q3N6EV7.js +156 -0
- package/dist/chunk-5Q3N6EV7.js.map +1 -0
- package/dist/chunk-6ZXOQEAN.js +27 -0
- package/dist/chunk-6ZXOQEAN.js.map +1 -0
- package/dist/chunk-7JUBXOIV.js +103 -0
- package/dist/chunk-7JUBXOIV.js.map +1 -0
- package/dist/chunk-A3CKOW2R.js +622 -0
- package/dist/chunk-A3CKOW2R.js.map +1 -0
- package/dist/chunk-AHEG27M7.js +66 -0
- package/dist/chunk-AHEG27M7.js.map +1 -0
- package/dist/chunk-AUKT3KMG.js +37 -0
- package/dist/chunk-AUKT3KMG.js.map +1 -0
- package/dist/chunk-AYUHMAI6.js +48 -0
- package/dist/chunk-AYUHMAI6.js.map +1 -0
- package/dist/chunk-BFPBS5Y4.js +250 -0
- package/dist/chunk-BFPBS5Y4.js.map +1 -0
- package/dist/{chunk-MQIZAD4A.js → chunk-C4OYOKWX.js} +138 -22
- package/dist/chunk-C4OYOKWX.js.map +1 -0
- package/dist/chunk-DG6G5EPF.js +35 -0
- package/dist/chunk-DG6G5EPF.js.map +1 -0
- package/dist/chunk-E36EVCKG.js +34 -0
- package/dist/chunk-E36EVCKG.js.map +1 -0
- package/dist/chunk-EAC4CDY7.js +57 -0
- package/dist/chunk-EAC4CDY7.js.map +1 -0
- package/dist/chunk-EZVNC4J6.js +104 -0
- package/dist/chunk-EZVNC4J6.js.map +1 -0
- package/dist/chunk-F4QMLOXJ.js +135 -0
- package/dist/chunk-F4QMLOXJ.js.map +1 -0
- package/dist/chunk-GLDWRCAM.js +49 -0
- package/dist/chunk-GLDWRCAM.js.map +1 -0
- package/dist/chunk-I3Q7KKYM.js +33 -0
- package/dist/chunk-I3Q7KKYM.js.map +1 -0
- package/dist/chunk-IA7TMD4Y.js +288 -0
- package/dist/chunk-IA7TMD4Y.js.map +1 -0
- package/dist/chunk-JCV4GXWB.js +249 -0
- package/dist/chunk-JCV4GXWB.js.map +1 -0
- package/dist/chunk-K47P7QZC.js +17 -0
- package/dist/chunk-K47P7QZC.js.map +1 -0
- package/dist/chunk-KLJKU6ZL.js +109 -0
- package/dist/chunk-KLJKU6ZL.js.map +1 -0
- package/dist/{chunk-56RJXPHG.js → chunk-KROD7KZK.js} +7 -4
- package/dist/chunk-KROD7KZK.js.map +1 -0
- package/dist/chunk-MA73TA6D.js +42 -0
- package/dist/chunk-MA73TA6D.js.map +1 -0
- package/dist/chunk-MERWRTBG.js +45 -0
- package/dist/chunk-MERWRTBG.js.map +1 -0
- package/dist/chunk-MEY33VWB.js +44 -0
- package/dist/chunk-MEY33VWB.js.map +1 -0
- package/dist/chunk-MP2GDBQZ.js +50 -0
- package/dist/chunk-MP2GDBQZ.js.map +1 -0
- package/dist/chunk-N3GKMPDW.js +51 -0
- package/dist/chunk-N3GKMPDW.js.map +1 -0
- package/dist/chunk-NAPE7WUS.js +75 -0
- package/dist/chunk-NAPE7WUS.js.map +1 -0
- package/dist/chunk-NN6GYOA2.js +47 -0
- package/dist/chunk-NN6GYOA2.js.map +1 -0
- package/dist/chunk-NNMLEDMD.js +399 -0
- package/dist/chunk-NNMLEDMD.js.map +1 -0
- package/dist/chunk-NYL63PSD.js +95 -0
- package/dist/chunk-NYL63PSD.js.map +1 -0
- package/dist/chunk-P7D3EMXM.js +52 -0
- package/dist/chunk-P7D3EMXM.js.map +1 -0
- package/dist/chunk-PSHUSWQH.js +18 -0
- package/dist/chunk-PSHUSWQH.js.map +1 -0
- package/dist/chunk-Q6YU3BT7.js +138 -0
- package/dist/chunk-Q6YU3BT7.js.map +1 -0
- package/dist/chunk-RRB26JRJ.js +247 -0
- package/dist/chunk-RRB26JRJ.js.map +1 -0
- package/dist/{chunk-7BR3DO2A.js → chunk-SRSJO5QE.js} +13 -4
- package/dist/chunk-SRSJO5QE.js.map +1 -0
- package/dist/chunk-SWVW56CV.js +188 -0
- package/dist/chunk-SWVW56CV.js.map +1 -0
- package/dist/chunk-TEYARRAK.js +216 -0
- package/dist/chunk-TEYARRAK.js.map +1 -0
- package/dist/chunk-UCKKT6KO.js +71 -0
- package/dist/chunk-UCKKT6KO.js.map +1 -0
- package/dist/chunk-UIDKY4UB.js +14 -0
- package/dist/chunk-UIDKY4UB.js.map +1 -0
- package/dist/chunk-VCBTX62E.js +135 -0
- package/dist/chunk-VCBTX62E.js.map +1 -0
- package/dist/chunk-VZOFZPSO.js +71 -0
- package/dist/chunk-VZOFZPSO.js.map +1 -0
- package/dist/{chunk-TRNBHPNW.js → chunk-X5QSICJ3.js} +13 -7
- package/dist/chunk-X5QSICJ3.js.map +1 -0
- package/dist/chunk-Y74NWGQW.js +418 -0
- package/dist/chunk-Y74NWGQW.js.map +1 -0
- package/dist/chunk-ZLWQZUGF.js +27 -0
- package/dist/chunk-ZLWQZUGF.js.map +1 -0
- package/dist/collapsible-panel.d.ts +122 -0
- package/dist/collapsible-panel.js +115 -0
- package/dist/collapsible-panel.js.map +1 -0
- package/dist/content-item.d.ts +46 -0
- package/dist/content-item.js +4 -0
- package/dist/content-item.js.map +1 -0
- package/dist/css-values.d.ts +107 -0
- package/dist/css-values.js +3 -0
- package/dist/css-values.js.map +1 -0
- package/dist/device-class.js +33 -5
- package/dist/device-class.js.map +1 -1
- package/dist/disclosure-arrow.d.ts +6 -1
- package/dist/disclosure-arrow.js +1 -1
- package/dist/empty-state.d.ts +5 -2
- package/dist/empty-state.js +1 -1
- package/dist/flex-alignment-4ms8ZbV8.d.ts +5 -0
- package/dist/floating-toolbar.d.ts +51 -0
- package/dist/floating-toolbar.js +3 -0
- package/dist/floating-toolbar.js.map +1 -0
- package/dist/grid.d.ts +42 -0
- package/dist/grid.js +5 -0
- package/dist/grid.js.map +1 -0
- package/dist/help-tags-register.d.ts +13 -0
- package/dist/help-tags-register.js +9 -0
- package/dist/help-tags-register.js.map +1 -0
- package/dist/index.d.ts +35 -14
- package/dist/index.js +43 -22
- package/dist/list-action-row.d.ts +64 -0
- package/dist/list-action-row.js +8 -0
- package/dist/list-action-row.js.map +1 -0
- package/dist/list-header.d.ts +99 -0
- package/dist/list-header.js +10 -0
- package/dist/list-header.js.map +1 -0
- package/dist/list-inset-control.d.ts +22 -0
- package/dist/list-inset-control.js +3 -0
- package/dist/list-inset-control.js.map +1 -0
- package/dist/list-inset-text.d.ts +30 -0
- package/dist/list-inset-text.js +4 -0
- package/dist/list-inset-text.js.map +1 -0
- package/dist/list-item.d.ts +62 -0
- package/dist/list-item.js +8 -0
- package/dist/list-item.js.map +1 -0
- package/dist/list.d.ts +59 -0
- package/dist/list.js +6 -0
- package/dist/list.js.map +1 -0
- package/dist/loading-spinner.d.ts +3 -1
- package/dist/loading-spinner.js +1 -1
- package/dist/lucide-icon.d.ts +3 -1
- package/dist/lucide-icon.js +1 -1
- package/dist/nav-stack.d.ts +60 -10
- package/dist/nav-stack.js +6 -1
- package/dist/pane.d.ts +102 -0
- package/dist/pane.js +4 -0
- package/dist/pane.js.map +1 -0
- package/dist/panel-toolbar-DqwtBxQL.d.ts +63 -0
- package/dist/popup-menu-register.d.ts +9 -0
- package/dist/popup-menu-register.js +31 -0
- package/dist/popup-menu-register.js.map +1 -0
- package/dist/popup-menu.d.ts +99 -0
- package/dist/popup-menu.js +3 -0
- package/dist/popup-menu.js.map +1 -0
- package/dist/resizable-region.d.ts +32 -3
- package/dist/resizable-region.js +1 -1
- package/dist/row.d.ts +48 -0
- package/dist/row.js +6 -0
- package/dist/row.js.map +1 -0
- package/dist/segmented-control.d.ts +13 -8
- package/dist/segmented-control.js +1 -1
- package/dist/select-register.d.ts +5 -1
- package/dist/select-register.js +243 -2
- package/dist/select-register.js.map +1 -1
- package/dist/select.d.ts +101 -8
- package/dist/select.js +4 -1
- package/dist/semantic-content-BbzjvSu9.d.ts +14 -0
- package/dist/sides-BPSWde0A.d.ts +4 -0
- package/dist/skeleton.d.ts +31 -0
- package/dist/skeleton.js +4 -0
- package/dist/skeleton.js.map +1 -0
- package/dist/spacer.d.ts +18 -0
- package/dist/spacer.js +4 -0
- package/dist/spacer.js.map +1 -0
- package/dist/split-view.d.ts +39 -7
- package/dist/split-view.js +120 -10
- package/dist/split-view.js.map +1 -1
- package/dist/state-banner.d.ts +19 -5
- package/dist/state-banner.js +4 -1
- package/dist/styles/app-tab.css +104 -0
- package/dist/styles/badge.css +118 -0
- package/dist/styles/catalog/components/catalog-example-stack.css +9 -0
- package/dist/styles/catalog/components/catalog-example.css +164 -0
- package/dist/styles/catalog/components/catalog-stage.css +55 -0
- package/dist/styles/catalog/components/catalog.css +12 -0
- package/dist/styles/catalog.css +5 -0
- package/dist/styles/chip.css +118 -0
- package/dist/styles/collapsible-panel.css +575 -0
- package/dist/styles/content-item.css +30 -0
- package/dist/styles/document.css +23 -0
- package/dist/styles/floating-toolbar.css +119 -0
- package/dist/styles/foundation.css +178 -40
- package/dist/styles/grid.css +28 -0
- package/dist/styles/layout.css +3 -41
- package/dist/styles/list-action-row.css +257 -0
- package/dist/styles/list-header.css +228 -0
- package/dist/styles/list-inset-control.css +30 -0
- package/dist/styles/list-inset-text.css +29 -0
- package/dist/styles/list-item.css +245 -0
- package/dist/styles/list.css +133 -0
- package/dist/styles/nav-stack.css +158 -50
- package/dist/styles/pane.css +229 -0
- package/dist/styles/popup-menu.css +271 -0
- package/dist/styles/resizable-region.css +429 -4
- package/dist/styles/row.css +111 -0
- package/dist/styles/segmented-control.css +33 -9
- package/dist/styles/select.css +262 -9
- package/dist/styles/skeleton.css +92 -0
- package/dist/styles/spacer.css +11 -0
- package/dist/styles/split-view.css +108 -3
- package/dist/styles/state-banner.css +94 -19
- package/dist/styles/styles.css +14 -4
- package/dist/styles/sunken-panel.css +22 -0
- package/dist/styles/surface-scaffold.css +56 -0
- package/dist/styles/tab-bar.css +132 -9
- package/dist/styles/tab-scaffold.css +113 -3
- package/dist/styles/text.css +65 -0
- package/dist/styles/token-search-field.css +49 -43
- package/dist/styles/toolbar-control-group.css +465 -28
- package/dist/styles/toolbar-text.css +88 -4
- package/dist/styles/toolbar.css +322 -11
- package/dist/styles/value-table.css +34 -4
- package/dist/styles/webawesome.css +348 -10
- package/dist/styles/workbench.css +828 -7
- package/dist/sunken-panel.d.ts +22 -0
- package/dist/sunken-panel.js +3 -0
- package/dist/sunken-panel.js.map +1 -0
- package/dist/surface-scaffold.d.ts +30 -0
- package/dist/surface-scaffold.js +3 -0
- package/dist/surface-scaffold.js.map +1 -0
- package/dist/tab-bar.d.ts +31 -6
- package/dist/tab-bar.js +1 -1
- package/dist/tab-scaffold.d.ts +54 -7
- package/dist/tab-scaffold.js +82 -9
- package/dist/tab-scaffold.js.map +1 -1
- package/dist/text.d.ts +38 -0
- package/dist/text.js +3 -0
- package/dist/text.js.map +1 -0
- package/dist/token-search-field-DvgFLhLL.d.ts +130 -0
- package/dist/token-search-field.d.ts +3 -43
- package/dist/token-search-field.js +1 -1
- package/dist/token-search-model.d.ts +3 -0
- package/dist/token-search-model.js +3 -0
- package/dist/token-search-model.js.map +1 -0
- package/dist/toolbar-control-group.d.ts +65 -7
- package/dist/toolbar-control-group.js +1 -1
- package/dist/toolbar-text.d.ts +37 -4
- package/dist/toolbar-text.js +3 -1
- package/dist/toolbar.d.ts +56 -7
- package/dist/toolbar.js +1 -1
- package/dist/types-BuHELdXR.d.ts +117 -0
- package/dist/value-table.d.ts +13 -3
- package/dist/value-table.js +3 -1
- package/dist/webawesome.d.ts +8 -1
- package/dist/wire-catalog.d.ts +82 -0
- package/dist/wire-catalog.js +327 -0
- package/dist/wire-catalog.js.map +1 -0
- package/dist/wire-nav-stack.d.ts +4 -1
- package/dist/wire-nav-stack.js +147 -7
- package/dist/wire-nav-stack.js.map +1 -1
- package/dist/wire-resizable-regions.d.ts +2 -1
- package/dist/wire-resizable-regions.js +2 -1
- package/dist/wire-scroll-dividers.d.ts +69 -0
- package/dist/wire-scroll-dividers.js +3 -0
- package/dist/wire-scroll-dividers.js.map +1 -0
- package/dist/wire-sidebar.d.ts +63 -0
- package/dist/wire-sidebar.js +231 -0
- package/dist/wire-sidebar.js.map +1 -0
- package/dist/wire-tab-bars.d.ts +19 -2
- package/dist/wire-tab-bars.js +1 -1
- package/dist/wire-tab-scaffold.js +9 -4
- package/dist/wire-tab-scaffold.js.map +1 -1
- package/dist/wire-token-search-fields.d.ts +65 -3
- package/dist/wire-token-search-fields.js +1 -1
- package/dist/wire-workbench.d.ts +109 -0
- package/dist/wire-workbench.js +6 -0
- package/dist/wire-workbench.js.map +1 -0
- package/dist/workbench.d.ts +218 -7
- package/dist/workbench.js +13 -15
- package/dist/workbench.js.map +1 -1
- package/docs/accessibility.md +413 -23
- package/docs/app-layouts.md +106 -8
- package/docs/catalog.md +440 -0
- package/docs/collapsible-panel.md +363 -0
- package/docs/component-contract.md +560 -52
- package/docs/component-integration.md +75 -0
- package/docs/component-selection.md +421 -89
- package/docs/design/templates/empty-state/filtered-dark.svg +1 -0
- package/docs/design/templates/empty-state/filtered.svg +1 -0
- package/docs/design/templates/empty-state/with-action-dark.svg +1 -0
- package/docs/design/templates/empty-state/with-action.svg +1 -0
- package/docs/design/templates/empty-state-dark.svg +1 -0
- package/docs/design/templates/empty-state.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 -0
- package/docs/design/templates/list-action-row/default.svg +1 -0
- package/docs/design/templates/list-action-row/selected-dark.svg +1 -0
- package/docs/design/templates/list-action-row/selected.svg +1 -0
- package/docs/design/templates/list-action-row-dark.svg +1 -0
- package/docs/design/templates/list-action-row.svg +1 -0
- package/docs/design/templates/list-dark.svg +1 -0
- package/docs/design/templates/list-header/action-dark.svg +1 -0
- package/docs/design/templates/list-header/action.svg +1 -0
- package/docs/design/templates/list-header/count-dark.svg +1 -0
- package/docs/design/templates/list-header/count.svg +1 -0
- 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/toggle-collapsed-dark.svg +1 -0
- package/docs/design/templates/list-header/toggle-collapsed.svg +1 -0
- package/docs/design/templates/list-header/toggle-expanded-dark.svg +1 -0
- package/docs/design/templates/list-header/toggle-expanded.svg +1 -0
- package/docs/design/templates/list-header-dark.svg +1 -0
- package/docs/design/templates/list-header.svg +1 -0
- package/docs/design/templates/list-item/default-dark.svg +1 -0
- package/docs/design/templates/list-item/default.svg +1 -0
- package/docs/design/templates/list-item/multiline-dark.svg +1 -0
- package/docs/design/templates/list-item/multiline.svg +1 -0
- package/docs/design/templates/list-item/selected-dark.svg +1 -0
- package/docs/design/templates/list-item/selected.svg +1 -0
- package/docs/design/templates/list-item/trailing-dark.svg +1 -0
- package/docs/design/templates/list-item/trailing.svg +1 -0
- package/docs/design/templates/list-item-dark.svg +1 -0
- package/docs/design/templates/list-item.svg +1 -0
- package/docs/design/templates/list.svg +1 -0
- package/docs/design/templates/segmented-control/equal-dark.svg +1 -0
- package/docs/design/templates/segmented-control/equal.svg +1 -0
- package/docs/design/templates/segmented-control/pill-small-dark.svg +1 -0
- package/docs/design/templates/segmented-control/pill-small.svg +1 -0
- package/docs/design/templates/segmented-control-dark.svg +1 -0
- package/docs/design/templates/segmented-control.svg +1 -0
- package/docs/design/templates/skeleton/avatar-dark.svg +1 -0
- package/docs/design/templates/skeleton/avatar.svg +1 -0
- package/docs/design/templates/skeleton/block-dark.svg +1 -0
- package/docs/design/templates/skeleton/block.svg +1 -0
- package/docs/design/templates/skeleton/lines-dark.svg +1 -0
- package/docs/design/templates/skeleton/lines.svg +1 -0
- package/docs/design/templates/skeleton-dark.svg +1 -0
- package/docs/design/templates/skeleton.svg +1 -0
- package/docs/design/templates/state-banner/danger-dark.svg +1 -0
- package/docs/design/templates/state-banner/danger.svg +1 -0
- 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 -0
- package/docs/design/templates/state-banner/info.svg +1 -0
- package/docs/design/templates/state-banner/success-dark.svg +1 -0
- package/docs/design/templates/state-banner/success.svg +1 -0
- package/docs/design/templates/state-banner/warning-dark.svg +1 -0
- package/docs/design/templates/state-banner/warning.svg +1 -0
- package/docs/design/templates/state-banner-dark.svg +1 -0
- package/docs/design/templates/state-banner.svg +1 -0
- package/docs/design/templates/tab-bar/workspace-tabs-dark.svg +1 -0
- package/docs/design/templates/tab-bar/workspace-tabs.svg +1 -0
- package/docs/design/templates/tab-bar-dark.svg +1 -0
- package/docs/design/templates/tab-bar.svg +1 -0
- package/docs/design/templates/token-search-field/empty-dark.svg +1 -0
- package/docs/design/templates/token-search-field/empty.svg +1 -0
- package/docs/design/templates/token-search-field/tokens-dark.svg +1 -0
- package/docs/design/templates/token-search-field/tokens.svg +1 -0
- package/docs/design/templates/token-search-field-dark.svg +1 -0
- package/docs/design/templates/token-search-field.svg +1 -0
- package/docs/design/templates/toolbar/title-and-actions-dark.svg +1 -0
- package/docs/design/templates/toolbar/title-and-actions.svg +1 -0
- package/docs/design/templates/toolbar-control-group/borderless-single-dark.svg +1 -0
- package/docs/design/templates/toolbar-control-group/borderless-single.svg +1 -0
- package/docs/design/templates/toolbar-control-group/icon-buttons-dark.svg +1 -0
- package/docs/design/templates/toolbar-control-group/icon-buttons.svg +1 -0
- package/docs/design/templates/toolbar-control-group/push-buttons-dark.svg +1 -0
- package/docs/design/templates/toolbar-control-group/push-buttons.svg +1 -0
- package/docs/design/templates/toolbar-control-group/with-text-dark.svg +1 -0
- package/docs/design/templates/toolbar-control-group/with-text.svg +1 -0
- package/docs/design/templates/toolbar-control-group-dark.svg +1 -0
- package/docs/design/templates/toolbar-control-group.svg +1 -0
- package/docs/design/templates/toolbar-dark.svg +1 -0
- package/docs/design/templates/toolbar-text/default-dark.svg +1 -0
- package/docs/design/templates/toolbar-text/default.svg +1 -0
- package/docs/design/templates/toolbar-text/large-dark.svg +1 -0
- package/docs/design/templates/toolbar-text/large.svg +1 -0
- package/docs/design/templates/toolbar-text/small-dark.svg +1 -0
- package/docs/design/templates/toolbar-text/small.svg +1 -0
- package/docs/design/templates/toolbar-text-dark.svg +1 -0
- package/docs/design/templates/toolbar-text.svg +1 -0
- package/docs/design/templates/toolbar.svg +1 -0
- package/docs/design/templates/value-table/details-dark.svg +1 -0
- package/docs/design/templates/value-table/details.svg +1 -0
- package/docs/design/templates/value-table-dark.svg +1 -0
- package/docs/design/templates/value-table.svg +1 -0
- package/docs/design/templates.md +138 -0
- package/docs/design-philosophy.md +48 -20
- package/docs/device-class.md +10 -9
- package/docs/document-baseline.md +38 -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 +45 -0
- package/docs/examples/component-composition-extension.json +80 -0
- package/docs/layout.md +409 -59
- package/docs/nav-stack.md +126 -14
- package/docs/recipes.md +137 -54
- package/docs/split-view.md +69 -6
- package/docs/sunken-panel.md +58 -0
- package/docs/surface-scaffold.md +25 -0
- package/docs/tab-scaffold.md +94 -10
- package/docs/type-contracts.md +134 -0
- package/docs/ui-analyzer.md +306 -0
- package/docs/ui-doctor.md +107 -0
- package/docs/ui-evaluator.md +139 -0
- package/docs/ux-demo.md +40 -16
- package/docs/webawesome-theme.md +175 -16
- package/docs/workbench.md +534 -12
- package/doctor/cli.mjs +115 -0
- package/doctor/config.schema.json +68 -0
- package/doctor/eslint-diagnostics.d.mts +24 -0
- package/doctor/eslint-diagnostics.mjs +24 -0
- package/doctor/index.d.mts +116 -0
- package/doctor/index.mjs +1277 -0
- package/doctor/report.schema.json +118 -0
- package/evaluator/cli.mjs +89 -0
- package/evaluator/index.d.mts +90 -0
- package/evaluator/index.mjs +1203 -0
- package/evaluator/report.schema.json +152 -0
- package/llms.txt +423 -42
- package/package.json +241 -37
- package/traversal-exclusions.mjs +27 -0
- package/ux-demo/recipes/app-shell.tsx +205 -17
- package/ux-demo/recipes/collapsible-sidebar.tsx +260 -0
- package/ux-demo/recipes/compact-toolbar.tsx +135 -14
- package/ux-demo/recipes/composer-form.tsx +133 -21
- package/ux-demo/recipes/list-detail-dialog.tsx +282 -0
- package/ux-demo/recipes/list-workspace-states.tsx +183 -11
- package/ux-demo/recipes/loaders.ts +15 -5
- package/ux-demo/recipes/loading-inspector.tsx +204 -0
- package/ux-demo/recipes/mount-recipe.ts +28 -10
- package/ux-demo/recipes/navigation-sidebar.tsx +139 -13
- package/ux-demo/recipes/navigation-stack.tsx +79 -24
- package/ux-demo/recipes/types.ts +23 -2
- package/ux-demo/recipes/workspace-header.tsx +86 -5
- package/dist/browser/menu-action-row.js +0 -3
- package/dist/browser/menu-header.js +0 -5
- package/dist/browser/menu-item.js +0 -3
- package/dist/chunk-24Z2XE6C.js +0 -10
- package/dist/chunk-24Z2XE6C.js.map +0 -1
- package/dist/chunk-2RJBFNB6.js +0 -172
- package/dist/chunk-2RJBFNB6.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-7BR3DO2A.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-CTQKI2XL.js +0 -28
- package/dist/chunk-CTQKI2XL.js.map +0 -1
- package/dist/chunk-DAFFDO33.js +0 -14
- package/dist/chunk-DAFFDO33.js.map +0 -1
- package/dist/chunk-EGHL5S4P.js +0 -33
- package/dist/chunk-EGHL5S4P.js.map +0 -1
- package/dist/chunk-KZKSBUKC.js +0 -19
- package/dist/chunk-KZKSBUKC.js.map +0 -1
- package/dist/chunk-M5JRI6MN.js +0 -27
- package/dist/chunk-M5JRI6MN.js.map +0 -1
- package/dist/chunk-MBR3TYNL.js +0 -14
- package/dist/chunk-MBR3TYNL.js.map +0 -1
- package/dist/chunk-MFKMHK5W.js +0 -10
- package/dist/chunk-MFKMHK5W.js.map +0 -1
- package/dist/chunk-MQIZAD4A.js.map +0 -1
- package/dist/chunk-NPPD2A6O.js +0 -40
- package/dist/chunk-NPPD2A6O.js.map +0 -1
- package/dist/chunk-R6JHHBKQ.js +0 -19
- package/dist/chunk-R6JHHBKQ.js.map +0 -1
- package/dist/chunk-RBTVBGRD.js +0 -23
- package/dist/chunk-RBTVBGRD.js.map +0 -1
- package/dist/chunk-S3TPM2LP.js +0 -23
- package/dist/chunk-S3TPM2LP.js.map +0 -1
- package/dist/chunk-TRNBHPNW.js.map +0 -1
- package/dist/chunk-VHW5YNIB.js +0 -17
- package/dist/chunk-VHW5YNIB.js.map +0 -1
- 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-XZXRLY5Q.js +0 -33
- package/dist/chunk-XZXRLY5Q.js.map +0 -1
- package/dist/menu-action-row.d.ts +0 -50
- package/dist/menu-action-row.js +0 -4
- package/dist/menu-action-row.js.map +0 -1
- package/dist/menu-header.d.ts +0 -41
- package/dist/menu-header.js +0 -6
- package/dist/menu-header.js.map +0 -1
- package/dist/menu-item.d.ts +0 -31
- package/dist/menu-item.js +0 -4
- package/dist/menu-item.js.map +0 -1
- package/dist/panel-header.d.ts +0 -26
- package/dist/panel-header.js +0 -6
- package/dist/panel-header.js.map +0 -1
- package/dist/styles/menu-action-row.css +0 -160
- package/dist/styles/menu-header.css +0 -160
- package/dist/styles/menu-item.css +0 -123
- package/dist/styles/panel-header.css +0 -59
- package/ux-demo/recipes/master-detail-dialog.tsx +0 -45
- package/ux-demo/recipes/recipes.css +0 -355
|
@@ -0,0 +1,626 @@
|
|
|
1
|
+
import { access, readFile } from 'node:fs/promises';
|
|
2
|
+
import { dirname, isAbsolute, relative, resolve } from 'node:path';
|
|
3
|
+
import process from 'node:process';
|
|
4
|
+
import { fileURLToPath, URL } from 'node:url';
|
|
5
|
+
|
|
6
|
+
export const APPLICATION_UI_PROFILE_FILENAME = '.kerf-ui-profile.json';
|
|
7
|
+
|
|
8
|
+
const exists = async (path) => {
|
|
9
|
+
try {
|
|
10
|
+
await access(path);
|
|
11
|
+
return true;
|
|
12
|
+
} catch {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export async function discoverApplicationUiProfileFiles({
|
|
18
|
+
workspaceRoot,
|
|
19
|
+
startDirectory,
|
|
20
|
+
packageProfile,
|
|
21
|
+
}) {
|
|
22
|
+
const root = resolve(workspaceRoot);
|
|
23
|
+
const start = resolve(startDirectory);
|
|
24
|
+
const outside = relative(root, start);
|
|
25
|
+
if (
|
|
26
|
+
outside === '..' ||
|
|
27
|
+
outside.startsWith(`..${process.platform === 'win32' ? '\\' : '/'}`) ||
|
|
28
|
+
isAbsolute(outside)
|
|
29
|
+
)
|
|
30
|
+
throw new Error(`startDirectory must be inside workspaceRoot: ${start}`);
|
|
31
|
+
|
|
32
|
+
const resolvedPackageProfile = packageProfile
|
|
33
|
+
? resolve(packageProfile)
|
|
34
|
+
: fileURLToPath(
|
|
35
|
+
new URL('./application-ui-profile.defaults.json', import.meta.url),
|
|
36
|
+
);
|
|
37
|
+
const files = [resolvedPackageProfile];
|
|
38
|
+
const directories = [];
|
|
39
|
+
let directory = start;
|
|
40
|
+
while (true) {
|
|
41
|
+
directories.push(directory);
|
|
42
|
+
if (directory === root) break;
|
|
43
|
+
directory = dirname(directory);
|
|
44
|
+
}
|
|
45
|
+
for (const candidateDirectory of directories.reverse()) {
|
|
46
|
+
const candidate = resolve(
|
|
47
|
+
candidateDirectory,
|
|
48
|
+
APPLICATION_UI_PROFILE_FILENAME,
|
|
49
|
+
);
|
|
50
|
+
if ((await exists(candidate)) && !files.includes(candidate))
|
|
51
|
+
files.push(candidate);
|
|
52
|
+
}
|
|
53
|
+
return files;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export async function readApplicationUiProfile(source) {
|
|
57
|
+
const text = await readFile(source, 'utf8');
|
|
58
|
+
try {
|
|
59
|
+
return { source, profile: JSON.parse(text) };
|
|
60
|
+
} catch (error) {
|
|
61
|
+
throw new Error(
|
|
62
|
+
`${source}: invalid application UI profile JSON: ${error.message}`,
|
|
63
|
+
{ cause: error },
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const recordProvenance = (provenance, source, prefix, value) => {
|
|
69
|
+
if (!value || typeof value !== 'object') return;
|
|
70
|
+
for (const key of Object.keys(value)) provenance[`${prefix}.${key}`] = source;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export function mergeApplicationUiProfiles(layers) {
|
|
74
|
+
if (!layers.length)
|
|
75
|
+
throw new Error('At least one application UI profile is required.');
|
|
76
|
+
const profile = { schemaVersion: 1, scope: 'package' };
|
|
77
|
+
const provenance = {};
|
|
78
|
+
const catalogs = new Map();
|
|
79
|
+
const exceptions = new Map();
|
|
80
|
+
|
|
81
|
+
for (const { source, profile: layer } of layers) {
|
|
82
|
+
if (!layer || typeof layer !== 'object' || Array.isArray(layer)) continue;
|
|
83
|
+
profile.schemaVersion = layer.schemaVersion;
|
|
84
|
+
profile.scope = layer.scope;
|
|
85
|
+
provenance.$schemaVersion = source;
|
|
86
|
+
provenance.$scope = source;
|
|
87
|
+
if (layer.$schema) profile.$schema = layer.$schema;
|
|
88
|
+
for (const catalog of Array.isArray(layer.catalogs) ? layer.catalogs : []) {
|
|
89
|
+
if (!catalog || typeof catalog !== 'object' || Array.isArray(catalog))
|
|
90
|
+
continue;
|
|
91
|
+
catalogs.set(catalog.package, catalog);
|
|
92
|
+
provenance[`$catalogs.${catalog.package}`] = source;
|
|
93
|
+
}
|
|
94
|
+
if (
|
|
95
|
+
layer.preferences &&
|
|
96
|
+
typeof layer.preferences === 'object' &&
|
|
97
|
+
!Array.isArray(layer.preferences)
|
|
98
|
+
) {
|
|
99
|
+
profile.preferences = { ...profile.preferences, ...layer.preferences };
|
|
100
|
+
recordProvenance(provenance, source, '$preferences', layer.preferences);
|
|
101
|
+
}
|
|
102
|
+
if (
|
|
103
|
+
layer.theme &&
|
|
104
|
+
typeof layer.theme === 'object' &&
|
|
105
|
+
!Array.isArray(layer.theme)
|
|
106
|
+
) {
|
|
107
|
+
profile.theme = { ...profile.theme, ...layer.theme };
|
|
108
|
+
recordProvenance(provenance, source, '$theme', layer.theme);
|
|
109
|
+
}
|
|
110
|
+
if (
|
|
111
|
+
layer.tokens &&
|
|
112
|
+
typeof layer.tokens === 'object' &&
|
|
113
|
+
!Array.isArray(layer.tokens)
|
|
114
|
+
) {
|
|
115
|
+
profile.tokens = { ...profile.tokens, ...layer.tokens };
|
|
116
|
+
recordProvenance(provenance, source, '$tokens', layer.tokens);
|
|
117
|
+
}
|
|
118
|
+
if (
|
|
119
|
+
layer.layout &&
|
|
120
|
+
typeof layer.layout === 'object' &&
|
|
121
|
+
!Array.isArray(layer.layout)
|
|
122
|
+
) {
|
|
123
|
+
profile.layout = { ...profile.layout, ...layer.layout };
|
|
124
|
+
recordProvenance(provenance, source, '$layout', layer.layout);
|
|
125
|
+
}
|
|
126
|
+
for (const exception of Array.isArray(layer.exceptions)
|
|
127
|
+
? layer.exceptions
|
|
128
|
+
: []) {
|
|
129
|
+
if (
|
|
130
|
+
!exception ||
|
|
131
|
+
typeof exception !== 'object' ||
|
|
132
|
+
Array.isArray(exception)
|
|
133
|
+
)
|
|
134
|
+
continue;
|
|
135
|
+
exceptions.set(exception.id, exception);
|
|
136
|
+
provenance[`$exceptions.${exception.id}`] = source;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
if (catalogs.size) profile.catalogs = [...catalogs.values()];
|
|
140
|
+
if (
|
|
141
|
+
exceptions.size ||
|
|
142
|
+
layers.some(({ profile: layer }) => Array.isArray(layer.exceptions))
|
|
143
|
+
)
|
|
144
|
+
profile.exceptions = [...exceptions.values()];
|
|
145
|
+
return { profile, provenance };
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export function validateApplicationUiProfileLayers(layers) {
|
|
149
|
+
const diagnostics = [];
|
|
150
|
+
const ranks = { package: 0, workspace: 1, directory: 2 };
|
|
151
|
+
const counts = new Map();
|
|
152
|
+
let previousRank = -1;
|
|
153
|
+
let previousDirectory;
|
|
154
|
+
for (const { source, profile } of layers) {
|
|
155
|
+
const rank = ranks[profile?.scope];
|
|
156
|
+
counts.set(profile?.scope, (counts.get(profile?.scope) ?? 0) + 1);
|
|
157
|
+
if (rank === undefined || rank < previousRank)
|
|
158
|
+
diagnostics.push({
|
|
159
|
+
code: 'KUI-P027',
|
|
160
|
+
source,
|
|
161
|
+
path: '$.scope',
|
|
162
|
+
message:
|
|
163
|
+
'Profile layers must be ordered package, workspace, then parent-to-child directory.',
|
|
164
|
+
});
|
|
165
|
+
if (rank !== undefined) previousRank = Math.max(previousRank, rank);
|
|
166
|
+
if (profile?.scope === 'directory') {
|
|
167
|
+
const currentDirectory = dirname(source);
|
|
168
|
+
if (
|
|
169
|
+
previousDirectory &&
|
|
170
|
+
relative(previousDirectory, currentDirectory).startsWith('..')
|
|
171
|
+
)
|
|
172
|
+
diagnostics.push({
|
|
173
|
+
code: 'KUI-P029',
|
|
174
|
+
source,
|
|
175
|
+
path: '$.scope',
|
|
176
|
+
message: 'Directory profiles must be ordered from parent to child.',
|
|
177
|
+
});
|
|
178
|
+
previousDirectory = currentDirectory;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
for (const scope of ['package', 'workspace'])
|
|
182
|
+
if ((counts.get(scope) ?? 0) > 1)
|
|
183
|
+
diagnostics.push({
|
|
184
|
+
code: 'KUI-P028',
|
|
185
|
+
source: layers.findLast(({ profile }) => profile.scope === scope)
|
|
186
|
+
.source,
|
|
187
|
+
path: '$.scope',
|
|
188
|
+
message: `At most one ${scope} profile layer is allowed.`,
|
|
189
|
+
});
|
|
190
|
+
if ((counts.get('package') ?? 0) !== 1)
|
|
191
|
+
diagnostics.push({
|
|
192
|
+
code: 'KUI-P028',
|
|
193
|
+
source: layers[0]?.source ?? '<profiles>',
|
|
194
|
+
path: '$.scope',
|
|
195
|
+
message: 'Exactly one package profile must be the first layer.',
|
|
196
|
+
});
|
|
197
|
+
return diagnostics;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
const stringList = (value) =>
|
|
201
|
+
Array.isArray(value) &&
|
|
202
|
+
value.every((item) => typeof item === 'string' && item.length > 0) &&
|
|
203
|
+
new Set(value).size === value.length;
|
|
204
|
+
|
|
205
|
+
export function validateApplicationUiProfile(
|
|
206
|
+
profile,
|
|
207
|
+
{ source = '<profile>', knownComponents, knownTokens, knownRules } = {},
|
|
208
|
+
) {
|
|
209
|
+
const diagnostics = [];
|
|
210
|
+
const componentSet = knownComponents && new Set(knownComponents);
|
|
211
|
+
const tokenSet = knownTokens && new Set(knownTokens);
|
|
212
|
+
const ruleSet = knownRules && new Set(knownRules);
|
|
213
|
+
const add = (code, path, message) =>
|
|
214
|
+
diagnostics.push({ code, source, path, message });
|
|
215
|
+
const objectAt = (value, path) => {
|
|
216
|
+
if (value === undefined) return undefined;
|
|
217
|
+
if (!value || typeof value !== 'object' || Array.isArray(value)) {
|
|
218
|
+
add('KUI-P030', path, 'Expected an object.');
|
|
219
|
+
return undefined;
|
|
220
|
+
}
|
|
221
|
+
return value;
|
|
222
|
+
};
|
|
223
|
+
const arrayAt = (value, path) => {
|
|
224
|
+
if (value === undefined) return [];
|
|
225
|
+
if (!Array.isArray(value)) {
|
|
226
|
+
add('KUI-P030', path, 'Expected an array.');
|
|
227
|
+
return [];
|
|
228
|
+
}
|
|
229
|
+
return value;
|
|
230
|
+
};
|
|
231
|
+
if (!profile || typeof profile !== 'object' || Array.isArray(profile)) {
|
|
232
|
+
add('KUI-P030', '$', 'Expected a profile object.');
|
|
233
|
+
return diagnostics;
|
|
234
|
+
}
|
|
235
|
+
const rejectUnknown = (value, allowed, path) => {
|
|
236
|
+
if (!value || typeof value !== 'object' || Array.isArray(value)) return;
|
|
237
|
+
for (const key of Object.keys(value))
|
|
238
|
+
if (!allowed.includes(key))
|
|
239
|
+
add('KUI-P023', `${path}.${key}`, `Unknown profile property ${key}.`);
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
rejectUnknown(
|
|
243
|
+
profile,
|
|
244
|
+
[
|
|
245
|
+
'$schema',
|
|
246
|
+
'schemaVersion',
|
|
247
|
+
'scope',
|
|
248
|
+
'catalogs',
|
|
249
|
+
'preferences',
|
|
250
|
+
'theme',
|
|
251
|
+
'tokens',
|
|
252
|
+
'layout',
|
|
253
|
+
'exceptions',
|
|
254
|
+
],
|
|
255
|
+
'$',
|
|
256
|
+
);
|
|
257
|
+
|
|
258
|
+
if (profile?.schemaVersion !== 1)
|
|
259
|
+
add('KUI-P001', '$.schemaVersion', 'schemaVersion must equal 1.');
|
|
260
|
+
if (!['package', 'workspace', 'directory'].includes(profile?.scope))
|
|
261
|
+
add(
|
|
262
|
+
'KUI-P002',
|
|
263
|
+
'$.scope',
|
|
264
|
+
'scope must be package, workspace, or directory.',
|
|
265
|
+
);
|
|
266
|
+
|
|
267
|
+
const catalogs = arrayAt(profile?.catalogs, '$.catalogs');
|
|
268
|
+
const preferences = objectAt(profile?.preferences, '$.preferences') ?? {};
|
|
269
|
+
const theme = objectAt(profile?.theme, '$.theme');
|
|
270
|
+
const tokens = objectAt(profile?.tokens, '$.tokens') ?? {};
|
|
271
|
+
const layout = objectAt(profile?.layout, '$.layout');
|
|
272
|
+
const exceptions = arrayAt(profile?.exceptions, '$.exceptions');
|
|
273
|
+
|
|
274
|
+
const catalogPackages = new Set();
|
|
275
|
+
for (const [index, catalog] of catalogs.entries()) {
|
|
276
|
+
const path = `$.catalogs[${index}]`;
|
|
277
|
+
if (!objectAt(catalog, path)) continue;
|
|
278
|
+
rejectUnknown(catalog, ['package', 'selection', 'composition'], path);
|
|
279
|
+
if (!catalog?.package)
|
|
280
|
+
add('KUI-P003', `${path}.package`, 'Catalog package is required.');
|
|
281
|
+
if (catalogPackages.has(catalog?.package))
|
|
282
|
+
add(
|
|
283
|
+
'KUI-P004',
|
|
284
|
+
`${path}.package`,
|
|
285
|
+
`Catalog package ${catalog.package} is duplicated.`,
|
|
286
|
+
);
|
|
287
|
+
catalogPackages.add(catalog?.package);
|
|
288
|
+
if (catalog?.package === '@kerfjs/ui' && !catalog.selection)
|
|
289
|
+
add(
|
|
290
|
+
'KUI-P005',
|
|
291
|
+
`${path}.selection`,
|
|
292
|
+
'The @kerfjs/ui catalog requires its component-catalog.json selection location.',
|
|
293
|
+
);
|
|
294
|
+
for (const kind of ['selection', 'composition']) {
|
|
295
|
+
if (kind === 'selection' && !catalog?.selection) continue;
|
|
296
|
+
rejectUnknown(
|
|
297
|
+
catalog?.[kind],
|
|
298
|
+
['path', 'schemaVersion'],
|
|
299
|
+
`${path}.${kind}`,
|
|
300
|
+
);
|
|
301
|
+
if (
|
|
302
|
+
!catalog?.[kind]?.path ||
|
|
303
|
+
!Number.isInteger(catalog?.[kind]?.schemaVersion)
|
|
304
|
+
)
|
|
305
|
+
add(
|
|
306
|
+
'KUI-P005',
|
|
307
|
+
`${path}.${kind}`,
|
|
308
|
+
`${kind} requires a path and integer schemaVersion.`,
|
|
309
|
+
);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
for (const [concept, rawPreference] of Object.entries(preferences)) {
|
|
314
|
+
const path = `$.preferences.${concept}`;
|
|
315
|
+
const preference = objectAt(rawPreference, path);
|
|
316
|
+
rejectUnknown(preference, ['preferred', 'avoid', 'rationale'], path);
|
|
317
|
+
if (!/^[a-z][a-z0-9-]*$/.test(concept))
|
|
318
|
+
add(
|
|
319
|
+
'KUI-P024',
|
|
320
|
+
path,
|
|
321
|
+
'Preference concept keys must be lowercase kebab-case.',
|
|
322
|
+
);
|
|
323
|
+
if (!preference?.preferred)
|
|
324
|
+
add(
|
|
325
|
+
'KUI-P006',
|
|
326
|
+
`${path}.preferred`,
|
|
327
|
+
'A preferred package:id is required.',
|
|
328
|
+
);
|
|
329
|
+
if (!stringList(preference?.avoid ?? []))
|
|
330
|
+
add(
|
|
331
|
+
'KUI-P007',
|
|
332
|
+
`${path}.avoid`,
|
|
333
|
+
'avoid must contain unique package:id values.',
|
|
334
|
+
);
|
|
335
|
+
if ((preference?.avoid ?? []).includes(preference?.preferred))
|
|
336
|
+
add(
|
|
337
|
+
'KUI-P008',
|
|
338
|
+
path,
|
|
339
|
+
`${preference.preferred} cannot be both preferred and avoided.`,
|
|
340
|
+
);
|
|
341
|
+
for (const [field, references] of [
|
|
342
|
+
['preferred', preference?.preferred ? [preference.preferred] : []],
|
|
343
|
+
['avoid', preference?.avoid ?? []],
|
|
344
|
+
])
|
|
345
|
+
for (const reference of references)
|
|
346
|
+
if (!/^.+:.+$/.test(reference))
|
|
347
|
+
add(
|
|
348
|
+
'KUI-P024',
|
|
349
|
+
`${path}.${field}`,
|
|
350
|
+
`${reference} must use package:id identity.`,
|
|
351
|
+
);
|
|
352
|
+
else if (componentSet && !componentSet.has(reference))
|
|
353
|
+
add(
|
|
354
|
+
'KUI-P009',
|
|
355
|
+
`${path}.${field}`,
|
|
356
|
+
`Unknown or stale component reference ${reference}.`,
|
|
357
|
+
);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
if (
|
|
361
|
+
theme?.colorScheme &&
|
|
362
|
+
Array.isArray(theme.allowedColorSchemes) &&
|
|
363
|
+
!theme.allowedColorSchemes.includes(theme.colorScheme)
|
|
364
|
+
)
|
|
365
|
+
add(
|
|
366
|
+
'KUI-P010',
|
|
367
|
+
'$.theme.colorScheme',
|
|
368
|
+
'colorScheme must be included in allowedColorSchemes.',
|
|
369
|
+
);
|
|
370
|
+
if (
|
|
371
|
+
theme?.density &&
|
|
372
|
+
Array.isArray(theme.allowedDensities) &&
|
|
373
|
+
!theme.allowedDensities.includes(theme.density)
|
|
374
|
+
)
|
|
375
|
+
add(
|
|
376
|
+
'KUI-P011',
|
|
377
|
+
'$.theme.density',
|
|
378
|
+
'density must be included in allowedDensities.',
|
|
379
|
+
);
|
|
380
|
+
rejectUnknown(
|
|
381
|
+
theme,
|
|
382
|
+
['colorScheme', 'allowedColorSchemes', 'density', 'allowedDensities'],
|
|
383
|
+
'$.theme',
|
|
384
|
+
);
|
|
385
|
+
const colorSchemes = ['light', 'dark', 'invert', 'system'];
|
|
386
|
+
const densities = ['standard', 'compact'];
|
|
387
|
+
if (theme?.colorScheme && !colorSchemes.includes(theme.colorScheme))
|
|
388
|
+
add('KUI-P026', '$.theme.colorScheme', 'Unknown color scheme.');
|
|
389
|
+
if (theme?.density && !densities.includes(theme.density))
|
|
390
|
+
add('KUI-P026', '$.theme.density', 'Unknown density.');
|
|
391
|
+
for (const value of arrayAt(
|
|
392
|
+
theme?.allowedColorSchemes,
|
|
393
|
+
'$.theme.allowedColorSchemes',
|
|
394
|
+
))
|
|
395
|
+
if (!colorSchemes.includes(value))
|
|
396
|
+
add(
|
|
397
|
+
'KUI-P026',
|
|
398
|
+
'$.theme.allowedColorSchemes',
|
|
399
|
+
`Unknown color scheme ${value}.`,
|
|
400
|
+
);
|
|
401
|
+
for (const value of arrayAt(
|
|
402
|
+
theme?.allowedDensities,
|
|
403
|
+
'$.theme.allowedDensities',
|
|
404
|
+
))
|
|
405
|
+
if (!densities.includes(value))
|
|
406
|
+
add('KUI-P026', '$.theme.allowedDensities', `Unknown density ${value}.`);
|
|
407
|
+
|
|
408
|
+
for (const token of Object.keys(tokens)) {
|
|
409
|
+
if (!token.startsWith('--kui-'))
|
|
410
|
+
add(
|
|
411
|
+
'KUI-P012',
|
|
412
|
+
`$.tokens.${token}`,
|
|
413
|
+
'Only --kui-* semantic tokens may be overridden.',
|
|
414
|
+
);
|
|
415
|
+
else if (tokenSet && !tokenSet.has(token))
|
|
416
|
+
add(
|
|
417
|
+
'KUI-P013',
|
|
418
|
+
`$.tokens.${token}`,
|
|
419
|
+
`Unknown or private semantic token ${token}.`,
|
|
420
|
+
);
|
|
421
|
+
if (typeof tokens[token] !== 'string' || !tokens[token])
|
|
422
|
+
add(
|
|
423
|
+
'KUI-P025',
|
|
424
|
+
`$.tokens.${token}`,
|
|
425
|
+
'Token override must be a non-empty string.',
|
|
426
|
+
);
|
|
427
|
+
}
|
|
428
|
+
rejectUnknown(
|
|
429
|
+
layout,
|
|
430
|
+
[
|
|
431
|
+
'shell',
|
|
432
|
+
'pane',
|
|
433
|
+
'responsiveStrategy',
|
|
434
|
+
'compactNavigation',
|
|
435
|
+
'scrollOwnership',
|
|
436
|
+
'spacingScale',
|
|
437
|
+
],
|
|
438
|
+
'$.layout',
|
|
439
|
+
);
|
|
440
|
+
for (const field of ['shell', 'pane']) {
|
|
441
|
+
const reference = layout?.[field];
|
|
442
|
+
if (reference && !/^.+:.+$/.test(reference))
|
|
443
|
+
add(
|
|
444
|
+
'KUI-P024',
|
|
445
|
+
`$.layout.${field}`,
|
|
446
|
+
`${reference} must use package:id identity.`,
|
|
447
|
+
);
|
|
448
|
+
else if (reference && componentSet && !componentSet.has(reference))
|
|
449
|
+
add(
|
|
450
|
+
'KUI-P014',
|
|
451
|
+
`$.layout.${field}`,
|
|
452
|
+
`Unknown or stale component reference ${reference}.`,
|
|
453
|
+
);
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
const exceptionIds = new Set();
|
|
457
|
+
for (const [index, exception] of exceptions.entries()) {
|
|
458
|
+
const path = `$.exceptions[${index}]`;
|
|
459
|
+
if (!objectAt(exception, path)) continue;
|
|
460
|
+
rejectUnknown(exception, ['id', 'rules', 'target', 'rationale'], path);
|
|
461
|
+
if (!exception?.id || exceptionIds.has(exception.id))
|
|
462
|
+
add(
|
|
463
|
+
'KUI-P015',
|
|
464
|
+
`${path}.id`,
|
|
465
|
+
'Exception ids must be present and unique.',
|
|
466
|
+
);
|
|
467
|
+
exceptionIds.add(exception?.id);
|
|
468
|
+
if (!stringList(exception?.rules) || !exception.rules.length)
|
|
469
|
+
add(
|
|
470
|
+
'KUI-P016',
|
|
471
|
+
`${path}.rules`,
|
|
472
|
+
'An exception must name at least one exact rule id.',
|
|
473
|
+
);
|
|
474
|
+
for (const rule of exception?.rules ?? [])
|
|
475
|
+
if (ruleSet && !ruleSet.has(rule))
|
|
476
|
+
add('KUI-P022', `${path}.rules`, `Unknown or stale rule id ${rule}.`);
|
|
477
|
+
if (
|
|
478
|
+
!exception?.target ||
|
|
479
|
+
isAbsolute(exception.target) ||
|
|
480
|
+
exception.target.includes('..') ||
|
|
481
|
+
/[*?]/.test(exception.target) ||
|
|
482
|
+
['.', 'src', 'ui'].includes(exception.target.replace(/\/$/, ''))
|
|
483
|
+
)
|
|
484
|
+
add(
|
|
485
|
+
'KUI-P017',
|
|
486
|
+
`${path}.target`,
|
|
487
|
+
'Exception target must be a narrow relative path without traversal or wildcards.',
|
|
488
|
+
);
|
|
489
|
+
if (!exception?.rationale || exception.rationale.trim().length < 12)
|
|
490
|
+
add(
|
|
491
|
+
'KUI-P018',
|
|
492
|
+
`${path}.rationale`,
|
|
493
|
+
'Exception rationale must explain the narrow need.',
|
|
494
|
+
);
|
|
495
|
+
}
|
|
496
|
+
return diagnostics;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
const catalogFactsForProfile = async (resolved, seedRules = []) => {
|
|
500
|
+
const diagnostics = [];
|
|
501
|
+
const knownComponents = new Set();
|
|
502
|
+
const knownTokens = new Set();
|
|
503
|
+
const knownRules = new Set(seedRules);
|
|
504
|
+
for (const [index, catalog] of (resolved.profile.catalogs ?? []).entries()) {
|
|
505
|
+
const owner = resolved.provenance[`$catalogs.${catalog.package}`];
|
|
506
|
+
if (!owner) continue;
|
|
507
|
+
for (const kind of ['selection', 'composition']) {
|
|
508
|
+
const location = catalog[kind];
|
|
509
|
+
if (!location?.path) continue;
|
|
510
|
+
const catalogPath = resolve(dirname(owner), location.path);
|
|
511
|
+
try {
|
|
512
|
+
const artifact = JSON.parse(await readFile(catalogPath, 'utf8'));
|
|
513
|
+
if (
|
|
514
|
+
artifact.package !== catalog.package ||
|
|
515
|
+
artifact.schemaVersion !== location.schemaVersion
|
|
516
|
+
)
|
|
517
|
+
diagnostics.push({
|
|
518
|
+
code: 'KUI-P020',
|
|
519
|
+
source: owner,
|
|
520
|
+
path: `$.catalogs[${index}].${kind}`,
|
|
521
|
+
message: `Catalog ${catalogPath} does not match package ${catalog.package} schemaVersion ${location.schemaVersion}.`,
|
|
522
|
+
});
|
|
523
|
+
if (kind === 'composition')
|
|
524
|
+
for (const entry of artifact.entries ?? []) {
|
|
525
|
+
knownComponents.add(entry.key ?? `${artifact.package}:${entry.id}`);
|
|
526
|
+
for (const token of entry.boundaries?.publicTokens ?? [])
|
|
527
|
+
knownTokens.add(token);
|
|
528
|
+
for (const diagnostic of entry.diagnostics ?? [])
|
|
529
|
+
knownRules.add(diagnostic.id);
|
|
530
|
+
}
|
|
531
|
+
} catch (error) {
|
|
532
|
+
diagnostics.push({
|
|
533
|
+
code: 'KUI-P021',
|
|
534
|
+
source: owner,
|
|
535
|
+
path: `$.catalogs[${index}].${kind}.path`,
|
|
536
|
+
message: `Cannot load catalog ${catalogPath}: ${error.message}`,
|
|
537
|
+
});
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
return { diagnostics, knownComponents, knownTokens, knownRules };
|
|
542
|
+
};
|
|
543
|
+
|
|
544
|
+
const addUniqueDiagnostics = (target, additions) => {
|
|
545
|
+
const seen = new Set(
|
|
546
|
+
target.map(({ code, source, path }) => `${code}\0${source}\0${path}`),
|
|
547
|
+
);
|
|
548
|
+
for (const diagnostic of additions) {
|
|
549
|
+
const key = `${diagnostic.code}\0${diagnostic.source}\0${diagnostic.path}`;
|
|
550
|
+
if (!seen.has(key)) target.push(diagnostic);
|
|
551
|
+
seen.add(key);
|
|
552
|
+
}
|
|
553
|
+
};
|
|
554
|
+
|
|
555
|
+
export async function loadApplicationUiProfile(options) {
|
|
556
|
+
const files = await discoverApplicationUiProfileFiles(options);
|
|
557
|
+
const layers = [];
|
|
558
|
+
const diagnostics = [];
|
|
559
|
+
for (const source of files) {
|
|
560
|
+
try {
|
|
561
|
+
layers.push(await readApplicationUiProfile(source));
|
|
562
|
+
} catch (error) {
|
|
563
|
+
diagnostics.push({
|
|
564
|
+
code: 'KUI-P019',
|
|
565
|
+
source,
|
|
566
|
+
path: '$',
|
|
567
|
+
message: error.message,
|
|
568
|
+
});
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
if (!layers.length) return { files, layers, diagnostics };
|
|
572
|
+
|
|
573
|
+
diagnostics.push(...validateApplicationUiProfileLayers(layers));
|
|
574
|
+
let facts;
|
|
575
|
+
for (const [index, layer] of layers.entries()) {
|
|
576
|
+
const prefix = mergeApplicationUiProfiles(layers.slice(0, index + 1));
|
|
577
|
+
facts = await catalogFactsForProfile(prefix, options.knownRules);
|
|
578
|
+
addUniqueDiagnostics(diagnostics, facts.diagnostics);
|
|
579
|
+
addUniqueDiagnostics(
|
|
580
|
+
diagnostics,
|
|
581
|
+
validateApplicationUiProfile(layer.profile, {
|
|
582
|
+
source: layer.source,
|
|
583
|
+
knownComponents: facts.knownComponents,
|
|
584
|
+
knownTokens: facts.knownTokens,
|
|
585
|
+
knownRules: facts.knownRules,
|
|
586
|
+
}),
|
|
587
|
+
);
|
|
588
|
+
}
|
|
589
|
+
const resolved = mergeApplicationUiProfiles(layers);
|
|
590
|
+
const sourceForResolvedPath = (path) => {
|
|
591
|
+
const catalogIndex = /^\$\.catalogs\[(\d+)\]/.exec(path)?.[1];
|
|
592
|
+
if (catalogIndex !== undefined) {
|
|
593
|
+
const catalog = resolved.profile.catalogs?.[Number(catalogIndex)];
|
|
594
|
+
return resolved.provenance[`$catalogs.${catalog?.package}`];
|
|
595
|
+
}
|
|
596
|
+
const exceptionIndex = /^\$\.exceptions\[(\d+)\]/.exec(path)?.[1];
|
|
597
|
+
if (exceptionIndex !== undefined) {
|
|
598
|
+
const exception = resolved.profile.exceptions?.[Number(exceptionIndex)];
|
|
599
|
+
return resolved.provenance[`$exceptions.${exception?.id}`];
|
|
600
|
+
}
|
|
601
|
+
for (const [prefix, provenancePrefix] of [
|
|
602
|
+
['$.preferences.', '$preferences.'],
|
|
603
|
+
['$.theme.', '$theme.'],
|
|
604
|
+
['$.tokens.', '$tokens.'],
|
|
605
|
+
['$.layout.', '$layout.'],
|
|
606
|
+
])
|
|
607
|
+
if (path.startsWith(prefix)) {
|
|
608
|
+
const field = path.slice(prefix.length).split('.')[0];
|
|
609
|
+
return resolved.provenance[`${provenancePrefix}${field}`];
|
|
610
|
+
}
|
|
611
|
+
if (path === '$.schemaVersion') return resolved.provenance.$schemaVersion;
|
|
612
|
+
if (path === '$.scope') return resolved.provenance.$scope;
|
|
613
|
+
return files.at(-1);
|
|
614
|
+
};
|
|
615
|
+
const resolvedDiagnostics = validateApplicationUiProfile(resolved.profile, {
|
|
616
|
+
source: files.at(-1),
|
|
617
|
+
knownComponents: facts.knownComponents,
|
|
618
|
+
knownTokens: facts.knownTokens,
|
|
619
|
+
knownRules: facts.knownRules,
|
|
620
|
+
}).map((diagnostic) => ({
|
|
621
|
+
...diagnostic,
|
|
622
|
+
source: sourceForResolvedPath(diagnostic.path) ?? diagnostic.source,
|
|
623
|
+
}));
|
|
624
|
+
addUniqueDiagnostics(diagnostics, resolvedDiagnostics);
|
|
625
|
+
return { files, layers, ...resolved, diagnostics };
|
|
626
|
+
}
|