@kerfjs/ui 5.0.0-beta.131 → 5.0.0-beta.132
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 +0 -13
- package/ai/application-ui-profile-sync.cjs +5 -14
- package/ai/application-ui-profile.d.ts +0 -2
- package/ai/application-ui-profile.defaults.json +0 -4
- package/ai/application-ui-profile.mjs +5 -14
- package/ai/application-ui-profile.schema.json +0 -4
- package/ai/component-catalog.json +9 -7
- package/ai/component-composition-rules.json +2 -10
- package/ai/component-composition.d.ts +0 -17
- package/ai/component-composition.json +3 -11
- package/ai/component-composition.schema.json +0 -59
- package/ai/components/disclosure.md +2 -0
- package/ai/components/form.md +1 -2
- package/ai/components/tab-panel.md +0 -1
- package/ai/components/toolbar-control-group.md +2 -2
- package/ai/public-api-signatures-v1.md +170 -197
- package/ai/skill.md +3 -20
- package/ai/webawesome-jsx-signatures-v1.md +1 -1
- package/dist/backdrop-image.d.ts +1 -1
- package/dist/backdrop-image.js +1 -1
- package/dist/badge.js +1 -1
- package/dist/button.js +1 -1
- package/dist/catalog-resources.d.ts +2 -2
- package/dist/catalog.d.ts +2 -2
- package/dist/catalog.js +16 -16
- package/dist/checkbox-group.js +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/chip.js +1 -1
- package/dist/choice-chips.d.ts +3 -3
- package/dist/choice-chips.js +1 -1
- package/dist/{chunk-Q5BPZPCO.js → chunk-22T7FFCL.js} +2 -2
- package/dist/{chunk-Q5BPZPCO.js.map → chunk-22T7FFCL.js.map} +1 -1
- package/dist/{chunk-BCHK33XL.js → chunk-27NEAPV7.js} +2 -2
- package/dist/{chunk-BCHK33XL.js.map → chunk-27NEAPV7.js.map} +1 -1
- package/dist/{chunk-76BLSFEA.js → chunk-2OYMXGW2.js} +6 -5
- package/dist/chunk-2OYMXGW2.js.map +1 -0
- package/dist/{chunk-EHR7R7YP.js → chunk-3DPHCZQB.js} +2 -2
- package/dist/{chunk-EHR7R7YP.js.map → chunk-3DPHCZQB.js.map} +1 -1
- package/dist/{chunk-RPJOLDSR.js → chunk-3UIZ36BP.js} +3 -3
- package/dist/{chunk-RPJOLDSR.js.map → chunk-3UIZ36BP.js.map} +1 -1
- package/dist/{chunk-QZA75NOK.js → chunk-42NLFCIN.js} +6 -6
- package/dist/{chunk-QZA75NOK.js.map → chunk-42NLFCIN.js.map} +1 -1
- package/dist/{chunk-UPHPFKAD.js → chunk-4GGIML4E.js} +2 -2
- package/dist/{chunk-UPHPFKAD.js.map → chunk-4GGIML4E.js.map} +1 -1
- package/dist/{chunk-LET362AM.js → chunk-4YXKDS6I.js} +2 -2
- package/dist/{chunk-LET362AM.js.map → chunk-4YXKDS6I.js.map} +1 -1
- package/dist/{chunk-5KWXM5O7.js → chunk-5C34PAUY.js} +2 -2
- package/dist/{chunk-5KWXM5O7.js.map → chunk-5C34PAUY.js.map} +1 -1
- package/dist/{chunk-S7QB5KMM.js → chunk-5L3MLWD5.js} +19 -55
- package/dist/chunk-5L3MLWD5.js.map +1 -0
- package/dist/{chunk-6PHG2DMG.js → chunk-6OH734CG.js} +2 -2
- package/dist/{chunk-6PHG2DMG.js.map → chunk-6OH734CG.js.map} +1 -1
- package/dist/{chunk-E7ZRBMVQ.js → chunk-7XIY7G4K.js} +3 -3
- package/dist/{chunk-E7ZRBMVQ.js.map → chunk-7XIY7G4K.js.map} +1 -1
- package/dist/{chunk-OKZTLRGG.js → chunk-B5Q3KE4Z.js} +2 -2
- package/dist/{chunk-OKZTLRGG.js.map → chunk-B5Q3KE4Z.js.map} +1 -1
- package/dist/{chunk-SGYBIKQA.js → chunk-BADEZQ3V.js} +4 -4
- package/dist/chunk-BADEZQ3V.js.map +1 -0
- package/dist/{chunk-CJAKN2KZ.js → chunk-BLBMUD2W.js} +2 -2
- package/dist/{chunk-CJAKN2KZ.js.map → chunk-BLBMUD2W.js.map} +1 -1
- package/dist/{chunk-TRJS7M2H.js → chunk-BNRH7XG5.js} +2 -2
- package/dist/{chunk-TRJS7M2H.js.map → chunk-BNRH7XG5.js.map} +1 -1
- package/dist/{chunk-NA4LKVPX.js → chunk-BNXJQB2Y.js} +2 -2
- package/dist/{chunk-NA4LKVPX.js.map → chunk-BNXJQB2Y.js.map} +1 -1
- package/dist/{chunk-CCPWJDRW.js → chunk-BQHGXQVA.js} +2 -2
- package/dist/{chunk-CCPWJDRW.js.map → chunk-BQHGXQVA.js.map} +1 -1
- package/dist/{chunk-COQI4OMZ.js → chunk-BRDTP3RT.js} +1 -1
- package/dist/chunk-BRDTP3RT.js.map +1 -0
- package/dist/{chunk-RGB4DPMN.js → chunk-DGYGRMES.js} +3 -3
- package/dist/chunk-DGYGRMES.js.map +1 -0
- package/dist/{chunk-V3IXAI4L.js → chunk-DNNHT7RB.js} +2 -2
- package/dist/{chunk-V3IXAI4L.js.map → chunk-DNNHT7RB.js.map} +1 -1
- package/dist/{chunk-UU37OR3D.js → chunk-DT7KOBQJ.js} +1 -1
- package/dist/chunk-DT7KOBQJ.js.map +1 -0
- package/dist/{chunk-CUUW57WB.js → chunk-DUKE3PLH.js} +2 -2
- package/dist/chunk-DUKE3PLH.js.map +1 -0
- package/dist/{chunk-IPYQYLSX.js → chunk-EWCTBJ5O.js} +6 -6
- package/dist/{chunk-IPYQYLSX.js.map → chunk-EWCTBJ5O.js.map} +1 -1
- package/dist/{chunk-4OH6JSGU.js → chunk-F25UMYDX.js} +2 -2
- package/dist/{chunk-4OH6JSGU.js.map → chunk-F25UMYDX.js.map} +1 -1
- package/dist/{chunk-C4FBYP2D.js → chunk-FJAAOIMP.js} +2 -2
- package/dist/{chunk-C4FBYP2D.js.map → chunk-FJAAOIMP.js.map} +1 -1
- package/dist/{chunk-RHMY45DK.js → chunk-H2XGWH4V.js} +5 -5
- package/dist/{chunk-RHMY45DK.js.map → chunk-H2XGWH4V.js.map} +1 -1
- package/dist/{chunk-76VCWWUA.js → chunk-HSMSTCNZ.js} +2 -2
- package/dist/{chunk-76VCWWUA.js.map → chunk-HSMSTCNZ.js.map} +1 -1
- package/dist/{chunk-ECVTRAXN.js → chunk-IQOO3ZQK.js} +2 -2
- package/dist/{chunk-ECVTRAXN.js.map → chunk-IQOO3ZQK.js.map} +1 -1
- package/dist/{chunk-DBP3N6E5.js → chunk-JBL6SCNN.js} +3 -3
- package/dist/{chunk-DBP3N6E5.js.map → chunk-JBL6SCNN.js.map} +1 -1
- package/dist/{chunk-7KN5OQVN.js → chunk-JNQBPRAA.js} +2 -2
- package/dist/{chunk-7KN5OQVN.js.map → chunk-JNQBPRAA.js.map} +1 -1
- package/dist/{chunk-CPTQABDQ.js → chunk-JNSPYECP.js} +2 -2
- package/dist/{chunk-CPTQABDQ.js.map → chunk-JNSPYECP.js.map} +1 -1
- package/dist/{chunk-E7Q6UNCB.js → chunk-KBDYXGYT.js} +2 -2
- package/dist/{chunk-E7Q6UNCB.js.map → chunk-KBDYXGYT.js.map} +1 -1
- package/dist/{chunk-WVQDIOD7.js → chunk-KKMZP3YL.js} +2 -2
- package/dist/{chunk-WVQDIOD7.js.map → chunk-KKMZP3YL.js.map} +1 -1
- package/dist/{chunk-WSPXSWFG.js → chunk-KZEHTRPC.js} +3 -3
- package/dist/chunk-KZEHTRPC.js.map +1 -0
- package/dist/{chunk-KACJOE2N.js → chunk-LH5V6XGH.js} +2 -2
- package/dist/{chunk-KACJOE2N.js.map → chunk-LH5V6XGH.js.map} +1 -1
- package/dist/{chunk-VBXKYT4O.js → chunk-LH7YRRY7.js} +2 -2
- package/dist/{chunk-VBXKYT4O.js.map → chunk-LH7YRRY7.js.map} +1 -1
- package/dist/{chunk-QXXLDY6I.js → chunk-LI7AQ5NQ.js} +4 -4
- package/dist/{chunk-QXXLDY6I.js.map → chunk-LI7AQ5NQ.js.map} +1 -1
- package/dist/{chunk-CAB5IWV7.js → chunk-LSFPZR52.js} +4 -4
- package/dist/{chunk-CAB5IWV7.js.map → chunk-LSFPZR52.js.map} +1 -1
- package/dist/{chunk-CRHKWHTA.js → chunk-LUWZ7UZQ.js} +4 -4
- package/dist/{chunk-CRHKWHTA.js.map → chunk-LUWZ7UZQ.js.map} +1 -1
- package/dist/{chunk-CMG4OZPV.js → chunk-LWWIBUDK.js} +2 -2
- package/dist/{chunk-CMG4OZPV.js.map → chunk-LWWIBUDK.js.map} +1 -1
- package/dist/{chunk-LOW7J7SE.js → chunk-MHF2NK7F.js} +4 -4
- package/dist/{chunk-LOW7J7SE.js.map → chunk-MHF2NK7F.js.map} +1 -1
- package/dist/{chunk-JHUEYWWI.js → chunk-MPM6YBOM.js} +2 -2
- package/dist/{chunk-JHUEYWWI.js.map → chunk-MPM6YBOM.js.map} +1 -1
- package/dist/{chunk-3UEMBHBK.js → chunk-MPT6Y7Z2.js} +2 -2
- package/dist/{chunk-3UEMBHBK.js.map → chunk-MPT6Y7Z2.js.map} +1 -1
- package/dist/{chunk-OZKBIPXU.js → chunk-NO2XO7S6.js} +3 -3
- package/dist/{chunk-OZKBIPXU.js.map → chunk-NO2XO7S6.js.map} +1 -1
- package/dist/{chunk-FQETQ7CM.js → chunk-NSNQWDJ4.js} +2 -2
- package/dist/{chunk-FQETQ7CM.js.map → chunk-NSNQWDJ4.js.map} +1 -1
- package/dist/{chunk-UOBC36FL.js → chunk-OW2ODKHN.js} +2 -2
- package/dist/{chunk-UOBC36FL.js.map → chunk-OW2ODKHN.js.map} +1 -1
- package/dist/{chunk-PVKAIVKE.js → chunk-P427MACE.js} +63 -74
- package/dist/chunk-P427MACE.js.map +1 -0
- package/dist/{chunk-FR5G77K5.js → chunk-PJKH2GZ3.js} +2 -2
- package/dist/{chunk-FR5G77K5.js.map → chunk-PJKH2GZ3.js.map} +1 -1
- package/dist/{chunk-FNJA4S6J.js → chunk-QNA27ABY.js} +3 -3
- package/dist/{chunk-FNJA4S6J.js.map → chunk-QNA27ABY.js.map} +1 -1
- package/dist/{chunk-6BXPN5SC.js → chunk-RO3TSZ5W.js} +3 -3
- package/dist/{chunk-6BXPN5SC.js.map → chunk-RO3TSZ5W.js.map} +1 -1
- package/dist/{chunk-4IXG6XCT.js → chunk-RUCUU7Z7.js} +2 -2
- package/dist/{chunk-4IXG6XCT.js.map → chunk-RUCUU7Z7.js.map} +1 -1
- package/dist/{chunk-2FA3SX57.js → chunk-RYBJ7OZB.js} +4 -4
- package/dist/{chunk-2FA3SX57.js.map → chunk-RYBJ7OZB.js.map} +1 -1
- package/dist/{chunk-QSJAIXLM.js → chunk-SDQZYSCA.js} +3 -3
- package/dist/{chunk-QSJAIXLM.js.map → chunk-SDQZYSCA.js.map} +1 -1
- package/dist/{chunk-3XSY5LAB.js → chunk-SXZTDJMG.js} +4 -4
- package/dist/{chunk-3XSY5LAB.js.map → chunk-SXZTDJMG.js.map} +1 -1
- package/dist/{chunk-LJV2FNOC.js → chunk-T7M5FKCE.js} +3 -3
- package/dist/{chunk-LJV2FNOC.js.map → chunk-T7M5FKCE.js.map} +1 -1
- package/dist/{chunk-KS7EXW4P.js → chunk-TIRBSPP2.js} +2 -2
- package/dist/{chunk-KS7EXW4P.js.map → chunk-TIRBSPP2.js.map} +1 -1
- package/dist/{chunk-XO5IOPM5.js → chunk-TNJGPG6R.js} +8 -8
- package/dist/{chunk-XO5IOPM5.js.map → chunk-TNJGPG6R.js.map} +1 -1
- package/dist/{chunk-2GEGIPDR.js → chunk-U5SQOZNK.js} +4 -4
- package/dist/{chunk-2GEGIPDR.js.map → chunk-U5SQOZNK.js.map} +1 -1
- package/dist/{chunk-Y4VR6VNM.js → chunk-UPOS666Q.js} +2 -2
- package/dist/{chunk-Y4VR6VNM.js.map → chunk-UPOS666Q.js.map} +1 -1
- package/dist/{chunk-YE6KCAIN.js → chunk-USSGJ3MD.js} +2 -2
- package/dist/{chunk-YE6KCAIN.js.map → chunk-USSGJ3MD.js.map} +1 -1
- package/dist/{chunk-4UWLHKNU.js → chunk-UWLJ7UEK.js} +3 -3
- package/dist/{chunk-4UWLHKNU.js.map → chunk-UWLJ7UEK.js.map} +1 -1
- package/dist/{chunk-SNUDT6AX.js → chunk-VHAYQGWR.js} +2 -2
- package/dist/{chunk-SNUDT6AX.js.map → chunk-VHAYQGWR.js.map} +1 -1
- package/dist/{chunk-DV6GE57V.js → chunk-VWGRAE2Q.js} +2 -2
- package/dist/chunk-VWGRAE2Q.js.map +1 -0
- package/dist/{chunk-4L5ZIKDZ.js → chunk-W7J3MQNV.js} +2 -2
- package/dist/{chunk-4L5ZIKDZ.js.map → chunk-W7J3MQNV.js.map} +1 -1
- package/dist/{chunk-MVWR5WRX.js → chunk-WWDDKUDW.js} +3 -3
- package/dist/{chunk-MVWR5WRX.js.map → chunk-WWDDKUDW.js.map} +1 -1
- package/dist/{chunk-WEQNPYVA.js → chunk-XXKRHKFH.js} +2 -2
- package/dist/{chunk-WEQNPYVA.js.map → chunk-XXKRHKFH.js.map} +1 -1
- package/dist/{chunk-OQFWF7Q7.js → chunk-XZ253TGP.js} +3 -3
- package/dist/{chunk-OQFWF7Q7.js.map → chunk-XZ253TGP.js.map} +1 -1
- package/dist/{chunk-3TBMGGTA.js → chunk-Y672Z7QY.js} +2 -2
- package/dist/{chunk-3TBMGGTA.js.map → chunk-Y672Z7QY.js.map} +1 -1
- package/dist/{chunk-MMOQR426.js → chunk-YS3H6DEQ.js} +2 -2
- package/dist/{chunk-MMOQR426.js.map → chunk-YS3H6DEQ.js.map} +1 -1
- package/dist/{chunk-QR7MGGOM.js → chunk-YVGHWCMY.js} +3 -3
- package/dist/{chunk-QR7MGGOM.js.map → chunk-YVGHWCMY.js.map} +1 -1
- package/dist/{chunk-4CYCJ3NY.js → chunk-Z4PGAYO7.js} +10 -10
- package/dist/{chunk-4CYCJ3NY.js.map → chunk-Z4PGAYO7.js.map} +1 -1
- package/dist/{chunk-JAC6AVZN.js → chunk-ZIZXXYXM.js} +3 -3
- package/dist/{chunk-JAC6AVZN.js.map → chunk-ZIZXXYXM.js.map} +1 -1
- package/dist/collapsible-panel.d.ts +5 -5
- package/dist/collapsible-panel.js +4 -4
- package/dist/collapsible-panel.js.map +1 -1
- package/dist/color-field.js +2 -2
- package/dist/color-picker.js +1 -1
- package/dist/color-swatches.js +1 -1
- package/dist/column-explorer.d.ts +2 -2
- package/dist/column-explorer.js +166 -21
- package/dist/column-explorer.js.map +1 -1
- package/dist/column-track.d.ts +1 -1
- package/dist/column-track.js +1 -1
- package/dist/combobox.d.ts +3 -3
- package/dist/combobox.js +1 -1
- package/dist/content-item.d.ts +1 -1
- package/dist/content-item.js +1 -1
- package/dist/content-swap.d.ts +3 -3
- package/dist/content-swap.js +1 -1
- package/dist/corner-status.d.ts +3 -3
- package/dist/corner-status.js +1 -1
- package/dist/device-class.js +101 -1
- package/dist/device-class.js.map +1 -1
- package/dist/disclosure-arrow.d.ts +3 -3
- package/dist/disclosure-arrow.js +1 -1
- package/dist/disclosure.d.ts +14 -2
- package/dist/disclosure.js +13 -4
- package/dist/disclosure.js.map +1 -1
- package/dist/edge-activity-indicator.d.ts +3 -3
- package/dist/edge-activity-indicator.js +1 -1
- package/dist/empty-state.d.ts +3 -3
- package/dist/empty-state.js +1 -1
- package/dist/{extension-attributes-IJ4decoa.d.ts → extension-attributes-CnqvBmj3.d.ts} +1 -1
- package/dist/file-picker.d.ts +3 -3
- package/dist/file-picker.js +1 -1
- package/dist/floating-toolbar.d.ts +3 -3
- package/dist/floating-toolbar.js +1 -1
- package/dist/form.d.ts +3 -3
- package/dist/form.js +1 -1
- package/dist/framed-list.js +1 -1
- package/dist/gauge.js +1 -1
- package/dist/grid.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +68 -68
- package/dist/list-action-row.js +1 -1
- package/dist/list-detail-dialog.d.ts +3 -3
- package/dist/list-detail-dialog.js +7 -7
- package/dist/list-detail-dialog.js.map +1 -1
- package/dist/list-header.d.ts +1 -1
- package/dist/list-header.js +1 -1
- package/dist/list-inset-control.d.ts +3 -3
- package/dist/list-inset-control.js +1 -1
- package/dist/list-inset-text.js +1 -1
- package/dist/list-item.js +1 -1
- package/dist/list.d.ts +1 -1
- package/dist/list.js +1 -1
- package/dist/loading-spinner.d.ts +3 -3
- package/dist/loading-spinner.js +1 -1
- package/dist/lucide-icon.d.ts +3 -3
- package/dist/lucide-icon.js +1 -1
- package/dist/message-composer.js +1 -1
- package/dist/{nav-stack-DKrvqFjA.d.ts → nav-stack-IKSMxo2A.d.ts} +3 -3
- package/dist/nav-stack.d.ts +2 -2
- package/dist/nav-stack.js +1 -1
- package/dist/paged-view.d.ts +3 -3
- package/dist/paged-view.js +1 -1
- package/dist/paged-view.js.map +1 -1
- package/dist/pane.js +1 -1
- package/dist/popup-menu-register.js +1 -1
- package/dist/popup-menu.d.ts +1 -20
- package/dist/popup-menu.js +1 -1
- package/dist/progress-bar.js +1 -1
- package/dist/progress-ring.js +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/resizable-region.d.ts +3 -3
- package/dist/resizable-region.js +1 -1
- package/dist/row.d.ts +1 -1
- package/dist/row.js +1 -1
- package/dist/scroll-effect.d.ts +1 -1
- package/dist/scroll-effect.js +1 -1
- package/dist/{search-field-7wLt3Bd5.d.ts → search-field-BA48RaJY.d.ts} +3 -3
- package/dist/search-field-model.d.ts +2 -2
- package/dist/search-field.d.ts +2 -2
- package/dist/search-field.js +1 -1
- package/dist/segmented-control.d.ts +3 -3
- package/dist/segmented-control.js +1 -1
- package/dist/select-register.js +2 -2
- package/dist/select-register.js.map +1 -1
- package/dist/select.d.ts +3 -13
- package/dist/select.js +1 -1
- package/dist/sized-region.d.ts +3 -3
- package/dist/sized-region.js +1 -1
- package/dist/skeleton.d.ts +3 -3
- package/dist/skeleton.js +1 -1
- package/dist/slider.js +1 -1
- package/dist/spacer.d.ts +3 -3
- package/dist/spacer.js +1 -1
- package/dist/split-button.js +1 -1
- package/dist/split-view.d.ts +4 -4
- package/dist/split-view.js +1 -1
- package/dist/state-banner.js +1 -1
- package/dist/styles/components/actions/popup-menu/popup-menu.css +0 -124
- package/dist/styles/components/actions/toolbar/toolbar.css +0 -7
- package/dist/styles/components/forms/select/select.css +0 -60
- package/dist/styles/components/forms/text-field/text-field.css +1 -1
- package/dist/styles/components/surfaces/disclosure/disclosure.css +24 -4
- package/dist/styles/components/surfaces/surface-scaffold/surface-scaffold.css +1 -1
- package/dist/styles/disclosure.css +24 -4
- package/dist/styles/popup-menu.css +0 -124
- package/dist/styles/select.css +0 -60
- package/dist/styles/surface-scaffold.css +1 -1
- package/dist/styles/text-field.css +1 -1
- package/dist/styles/toolbar.css +0 -7
- package/dist/styles/webawesome.css +7 -0
- package/dist/summary-row.js +1 -1
- package/dist/sunken-panel.d.ts +3 -3
- package/dist/sunken-panel.js +1 -1
- package/dist/surface-scaffold.d.ts +9 -5
- package/dist/surface-scaffold.js +1 -1
- package/dist/switch.js +1 -1
- package/dist/tab-bar-item.js +1 -1
- package/dist/tab-bar.d.ts +3 -3
- package/dist/tab-bar.js +1 -1
- package/dist/tab-navigator.d.ts +3 -3
- package/dist/tab-navigator.js +2 -2
- package/dist/tab-navigator.js.map +1 -1
- package/dist/tab-panel.d.ts +3 -3
- package/dist/tab-panel.js +1 -1
- package/dist/tag-field.d.ts +3 -3
- package/dist/tag-field.js +1 -1
- package/dist/text-field.d.ts +2 -2
- package/dist/text-field.js +1 -1
- package/dist/text.d.ts +1 -1
- package/dist/text.js +1 -1
- package/dist/toolbar-control-group.d.ts +7 -7
- package/dist/toolbar-control-group.js +1 -1
- package/dist/toolbar-text.d.ts +3 -3
- package/dist/toolbar-text.js +1 -1
- package/dist/toolbar.d.ts +3 -3
- package/dist/toolbar.js +1 -1
- package/dist/tree-list.d.ts +3 -3
- package/dist/tree-list.js +151 -3
- package/dist/tree-list.js.map +1 -1
- package/dist/{tree-rows-Bms5QJvG.d.ts → tree-rows-BXChApji.d.ts} +1 -1
- package/dist/value-preview.d.ts +3 -3
- package/dist/value-preview.js +1 -1
- package/dist/value-table.d.ts +5 -5
- package/dist/value-table.js +1 -1
- package/dist/wire-catalog.d.ts +2 -2
- package/dist/wire-catalog.js +2 -2
- package/dist/wire-color-fields.js +73 -2
- package/dist/wire-color-fields.js.map +1 -1
- package/dist/wire-color-pickers.js +1 -1
- package/dist/wire-column-explorer.js +92 -1
- package/dist/wire-column-explorer.js.map +1 -1
- package/dist/wire-content-items.js +204 -1
- package/dist/wire-content-items.js.map +1 -1
- package/dist/wire-nav-stack.js +423 -1
- package/dist/wire-nav-stack.js.map +1 -1
- package/dist/wire-resizable-regions.js +1 -1
- package/dist/wire-search-fields.d.ts +2 -2
- package/dist/wire-search-fields.js +1 -1
- package/dist/wire-sidebar.js +228 -1
- package/dist/wire-sidebar.js.map +1 -1
- package/dist/wire-sliders.js +29 -1
- package/dist/wire-sliders.js.map +1 -1
- package/dist/wire-tab-bars.d.ts +1 -1
- package/dist/wire-tab-navigator.js +150 -1
- package/dist/wire-tab-navigator.js.map +1 -1
- package/dist/wire-tag-fields.js +252 -2
- package/dist/wire-tag-fields.js.map +1 -1
- package/dist/wire-tree-list.js +186 -1
- package/dist/wire-tree-list.js.map +1 -1
- package/dist/wire-workbench.js +1 -1
- package/dist/workbench-dialog.d.ts +3 -3
- package/dist/workbench-dialog.js +5 -5
- package/dist/workbench-dialog.js.map +1 -1
- package/dist/workbench.d.ts +4 -4
- package/dist/workbench.js +1 -1
- package/docs/accessibility.md +1 -1
- package/docs/component-contract.md +4 -3
- package/docs/component-selection.md +1 -1
- package/docs/disclosure.md +22 -0
- package/docs/list-detail-dialog.md +2 -3
- package/docs/scroll-effect.md +2 -2
- package/docs/surface-scaffold.md +5 -6
- package/docs/workbench-dialog.md +2 -3
- package/llms.txt +3 -44
- package/package.json +3 -33
- package/ux-demo/recipes/app-shell.tsx +141 -48
- package/ux-demo/recipes/collapsible-sidebar.tsx +169 -43
- package/ux-demo/recipes/compact-toolbar.tsx +114 -22
- package/ux-demo/recipes/composer-form.tsx +104 -14
- package/ux-demo/recipes/list-detail-dialog.tsx +84 -38
- package/ux-demo/recipes/list-workspace-states.tsx +152 -29
- package/ux-demo/recipes/loading-inspector.tsx +174 -30
- package/ux-demo/recipes/media-detail.tsx +146 -29
- package/ux-demo/recipes/navigation-sidebar.tsx +113 -24
- package/ux-demo/recipes/navigation-stack.tsx +43 -7
- package/ux-demo/recipes/workspace-header.tsx +66 -2
- package/ai/component-props-overlay.json +0 -8910
- package/ai/component-props-overlay.schema.json +0 -82
- package/ai/component-props.json +0 -34289
- package/ai/component-props.schema.json +0 -408
- package/ai/view-document.schema.json +0 -467
- package/dist/browser/editor.js +0 -50
- package/dist/chunk-3K5V3ZSD.js +0 -77
- package/dist/chunk-3K5V3ZSD.js.map +0 -1
- package/dist/chunk-63TJH2RF.js +0 -231
- package/dist/chunk-63TJH2RF.js.map +0 -1
- package/dist/chunk-6V6UHPJD.js +0 -153
- package/dist/chunk-6V6UHPJD.js.map +0 -1
- package/dist/chunk-76BLSFEA.js.map +0 -1
- package/dist/chunk-COQI4OMZ.js.map +0 -1
- package/dist/chunk-CUUW57WB.js.map +0 -1
- package/dist/chunk-D2KHQNJ6.js +0 -155
- package/dist/chunk-D2KHQNJ6.js.map +0 -1
- package/dist/chunk-DV6GE57V.js.map +0 -1
- package/dist/chunk-FCO7BT4P.js +0 -256
- package/dist/chunk-FCO7BT4P.js.map +0 -1
- package/dist/chunk-GHV36C6I.js +0 -94
- package/dist/chunk-GHV36C6I.js.map +0 -1
- package/dist/chunk-HPOXLOVC.js +0 -184
- package/dist/chunk-HPOXLOVC.js.map +0 -1
- package/dist/chunk-I2K4OQKB.js +0 -426
- package/dist/chunk-I2K4OQKB.js.map +0 -1
- package/dist/chunk-PVKAIVKE.js.map +0 -1
- package/dist/chunk-RGB4DPMN.js.map +0 -1
- package/dist/chunk-S7QB5KMM.js.map +0 -1
- package/dist/chunk-SGYBIKQA.js.map +0 -1
- package/dist/chunk-TXBNPEIJ.js +0 -31
- package/dist/chunk-TXBNPEIJ.js.map +0 -1
- package/dist/chunk-UU37OR3D.js.map +0 -1
- package/dist/chunk-WCMGPAY2.js +0 -103
- package/dist/chunk-WCMGPAY2.js.map +0 -1
- package/dist/chunk-WSPXSWFG.js.map +0 -1
- package/dist/chunk-X43QQWVC.js +0 -208
- package/dist/chunk-X43QQWVC.js.map +0 -1
- package/dist/chunk-YA6OAJY6.js +0 -155
- package/dist/chunk-YA6OAJY6.js.map +0 -1
- package/dist/editor.d.ts +0 -447
- package/dist/editor.js +0 -15608
- package/dist/editor.js.map +0 -1
- package/dist/styles/editor/editor.css +0 -585
- package/dist/styles/editor.css +0 -4
- package/dist/view-runtime.d.ts +0 -9
- package/dist/view-runtime.js +0 -8
- package/dist/view-runtime.js.map +0 -1
- package/docs/editor-host.md +0 -397
- package/docs/view.md +0 -314
- package/props/cli.d.mts +0 -1
- package/props/cli.mjs +0 -142
- package/props/component-props.d.mts +0 -180
- package/props/component-props.mjs +0 -1208
- package/view/catalog.mjs +0 -229
- package/view/child-kind.mjs +0 -22
- package/view/cli.d.mts +0 -18
- package/view/cli.mjs +0 -316
- package/view/contract.mjs +0 -418
- package/view/css-grammar.mjs +0 -93
- package/view/generate.d.mts +0 -16
- package/view/generate.mjs +0 -739
- package/view/index.d.mts +0 -491
- package/view/index.mjs +0 -36
- package/view/interpret.mjs +0 -339
- package/view/project-types-worker.mjs +0 -55
- package/view/project-types.d.mts +0 -43
- package/view/project-types.mjs +0 -618
- package/view/type-expression.d.mts +0 -15
- package/view/type-expression.mjs +0 -162
- package/view/types.mjs +0 -165
- package/view/validate-move.mjs +0 -353
- package/view/validate.mjs +0 -1649
- package/vite-editor.d.mts +0 -173
- package/vite-editor.mjs +0 -548
package/view/type-expression.mjs
DELETED
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
// Browser-safe transport for a compiler-checked TypeScript parameter expression.
|
|
2
|
-
// The projection is for navigation; Node's project compiler remains the semantic
|
|
3
|
-
// authority. Module-token spans let exports rebase imports without regex-parsing TS.
|
|
4
|
-
|
|
5
|
-
const OPEN = new Map([
|
|
6
|
-
['(', ')'],
|
|
7
|
-
['[', ']'],
|
|
8
|
-
['{', '}'],
|
|
9
|
-
['<', '>'],
|
|
10
|
-
]);
|
|
11
|
-
const DECLARATION =
|
|
12
|
-
/^(?:export|declare|const|let|var|class|interface|namespace|module|function|debugger)$/;
|
|
13
|
-
|
|
14
|
-
/** A lexical containment check, not TypeScript syntax or semantic validation. */
|
|
15
|
-
export function containedTypeExpression(text) {
|
|
16
|
-
if (typeof text !== 'string' || !text.trim() || text.length > 16384)
|
|
17
|
-
return false;
|
|
18
|
-
const stack = [];
|
|
19
|
-
let quote = '';
|
|
20
|
-
for (let at = 0; at < text.length; at += 1) {
|
|
21
|
-
const char = text[at];
|
|
22
|
-
if (quote) {
|
|
23
|
-
if (char === '\\') at += 1;
|
|
24
|
-
else if (char === quote) quote = '';
|
|
25
|
-
else if (quote === '`' && char === '$' && text[at + 1] === '{') {
|
|
26
|
-
stack.push('template');
|
|
27
|
-
quote = '';
|
|
28
|
-
at += 1;
|
|
29
|
-
}
|
|
30
|
-
continue;
|
|
31
|
-
}
|
|
32
|
-
if (char === '"' || char === "'" || char === '`') {
|
|
33
|
-
quote = char;
|
|
34
|
-
continue;
|
|
35
|
-
}
|
|
36
|
-
if (char === '/' && text[at + 1] === '/') {
|
|
37
|
-
const end = text.indexOf('\n', at + 2);
|
|
38
|
-
if (end === -1) break;
|
|
39
|
-
at = end;
|
|
40
|
-
continue;
|
|
41
|
-
}
|
|
42
|
-
if (char === '/' && text[at + 1] === '*') {
|
|
43
|
-
const end = text.indexOf('*/', at + 2);
|
|
44
|
-
if (end === -1) return false;
|
|
45
|
-
at = end + 1;
|
|
46
|
-
continue;
|
|
47
|
-
}
|
|
48
|
-
if (char === '>' && text[at - 1] === '=') continue;
|
|
49
|
-
if (OPEN.has(char)) stack.push(OPEN.get(char));
|
|
50
|
-
else if (')]}>'.includes(char)) {
|
|
51
|
-
const expected = stack.pop();
|
|
52
|
-
if (char === '}' && expected === 'template') quote = '`';
|
|
53
|
-
else if (expected !== char) return false;
|
|
54
|
-
} else if (stack.length === 0) {
|
|
55
|
-
if (
|
|
56
|
-
char === ';' ||
|
|
57
|
-
char === ',' ||
|
|
58
|
-
(char === '=' && text[at + 1] !== '>')
|
|
59
|
-
)
|
|
60
|
-
return false;
|
|
61
|
-
if (/[A-Za-z_$]/.test(char)) {
|
|
62
|
-
const word = /^[A-Za-z_$][\w$]*/.exec(text.slice(at))[0];
|
|
63
|
-
if (DECLARATION.test(word)) return false;
|
|
64
|
-
at += word.length - 1;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
return !quote && stack.length === 0;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/** A stable project-relative source name (never an absolute clone path). */
|
|
72
|
-
export function typeSourcePath(value) {
|
|
73
|
-
return (
|
|
74
|
-
typeof value === 'string' &&
|
|
75
|
-
value.length > 0 &&
|
|
76
|
-
!value.includes('\\') &&
|
|
77
|
-
!value.includes(':') &&
|
|
78
|
-
!value.startsWith('/') &&
|
|
79
|
-
!value
|
|
80
|
-
.split('/')
|
|
81
|
-
.some((part) => part === '..' || part === '.' || part === '')
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export function validTypeExpression(type) {
|
|
86
|
-
const value = type?.typescript;
|
|
87
|
-
if (
|
|
88
|
-
!value ||
|
|
89
|
-
!containedTypeExpression(value.text) ||
|
|
90
|
-
!typeSourcePath(value.source) ||
|
|
91
|
-
!Array.isArray(value.references)
|
|
92
|
-
)
|
|
93
|
-
return false;
|
|
94
|
-
let end = 0;
|
|
95
|
-
return value.references.every((item) => {
|
|
96
|
-
if (
|
|
97
|
-
!Number.isInteger(item.start) ||
|
|
98
|
-
!Number.isInteger(item.length) ||
|
|
99
|
-
item.start < end ||
|
|
100
|
-
item.length < 2 ||
|
|
101
|
-
typeof item.module !== 'string'
|
|
102
|
-
)
|
|
103
|
-
return false;
|
|
104
|
-
end = item.start + item.length;
|
|
105
|
-
return (
|
|
106
|
-
end <= value.text.length &&
|
|
107
|
-
value.text.slice(item.start, end) === JSON.stringify(item.module) &&
|
|
108
|
-
(!item.module.startsWith('.') ||
|
|
109
|
-
parts(
|
|
110
|
-
[...value.source.split('/').slice(0, -1), item.module].join('/'),
|
|
111
|
-
) !== undefined)
|
|
112
|
-
);
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
const parts = (value) => {
|
|
117
|
-
const result = [];
|
|
118
|
-
for (const part of value.split('/')) {
|
|
119
|
-
if (part === '..') {
|
|
120
|
-
if (!result.length) return undefined;
|
|
121
|
-
result.pop();
|
|
122
|
-
} else if (part && part !== '.') result.push(part);
|
|
123
|
-
}
|
|
124
|
-
return result;
|
|
125
|
-
};
|
|
126
|
-
const relative = (from, to) => {
|
|
127
|
-
while (from.length && to.length && from[0] === to[0]) {
|
|
128
|
-
from.shift();
|
|
129
|
-
to.shift();
|
|
130
|
-
}
|
|
131
|
-
const value = [...from.map(() => '..'), ...to].join('/');
|
|
132
|
-
return value.startsWith('.') ? value : `./${value}`;
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
/** Rebase only the module literal tokens the compiler identified in the expression. */
|
|
136
|
-
export function typeExpressionText(type, source = type.typescript.source) {
|
|
137
|
-
if (!validTypeExpression(type) || !typeSourcePath(source))
|
|
138
|
-
throw new Error('Invalid TypeScript parameter expression metadata.');
|
|
139
|
-
const { text, references } = type.typescript;
|
|
140
|
-
const original = type.typescript.source.split('/').slice(0, -1);
|
|
141
|
-
const target = source.split('/').slice(0, -1);
|
|
142
|
-
let result = text;
|
|
143
|
-
for (const item of [...references].reverse()) {
|
|
144
|
-
if (!item.module.startsWith('.')) continue;
|
|
145
|
-
const module = relative(
|
|
146
|
-
[...target],
|
|
147
|
-
parts([...original, item.module].join('/')),
|
|
148
|
-
);
|
|
149
|
-
result =
|
|
150
|
-
result.slice(0, item.start) +
|
|
151
|
-
JSON.stringify(module) +
|
|
152
|
-
result.slice(item.start + item.length);
|
|
153
|
-
}
|
|
154
|
-
return result;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
/** Whether a document needs the project compiler in addition to structural checks. */
|
|
158
|
-
export function hasTypeExpressions(document) {
|
|
159
|
-
return Object.values(document.params ?? {}).some(
|
|
160
|
-
(param) => param.type?.typescript !== undefined,
|
|
161
|
-
);
|
|
162
|
-
}
|
package/view/types.mjs
DELETED
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
// The structural type system of @kerfjs/ui/view: whether a param or binding
|
|
2
|
-
// type fits a prop type (isAssignable) and whether a JSON literal is a value
|
|
3
|
-
// of a type (isLiteralOf), over the catalogs' type descriptors.
|
|
4
|
-
|
|
5
|
-
import { isObject, resolveType, ZoneFill } from './catalog.mjs';
|
|
6
|
-
import { parseCssCall } from './css-grammar.mjs';
|
|
7
|
-
|
|
8
|
-
export const ICON_NAME = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
9
|
-
|
|
10
|
-
/** Whether a value of type `from` (a param or binding) fits type `to`. */
|
|
11
|
-
export function isAssignable(from, to, definitions = {}) {
|
|
12
|
-
// Project TypeScript types are checked by the Node language service against
|
|
13
|
-
// the generated module. The structural pass cannot prove TS assignability.
|
|
14
|
-
if (from?.typescript || to?.typescript) return true;
|
|
15
|
-
// A component prop's type fits only that same component prop.
|
|
16
|
-
if (from?.kind === 'prop' || to?.kind === 'prop')
|
|
17
|
-
return (
|
|
18
|
-
from?.kind === to?.kind &&
|
|
19
|
-
from.component === to.component &&
|
|
20
|
-
from.prop === to.prop
|
|
21
|
-
);
|
|
22
|
-
const target = resolveType(to, definitions);
|
|
23
|
-
const source = resolveType(from, definitions);
|
|
24
|
-
if (target.kind === 'unknown' || source.kind === 'unknown') return true;
|
|
25
|
-
if (target.kind === 'union') {
|
|
26
|
-
return target.members.some((member) =>
|
|
27
|
-
isAssignable(source, member, definitions),
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
const values =
|
|
31
|
-
source.kind === 'enum'
|
|
32
|
-
? source.values
|
|
33
|
-
: source.kind === 'literal'
|
|
34
|
-
? [source.value]
|
|
35
|
-
: undefined;
|
|
36
|
-
if (values) {
|
|
37
|
-
if (target.kind === 'enum') {
|
|
38
|
-
return values.every((value) => target.values.includes(value));
|
|
39
|
-
}
|
|
40
|
-
if (target.kind === 'literal') {
|
|
41
|
-
return values.length === 1 && values[0] === target.value;
|
|
42
|
-
}
|
|
43
|
-
return values.every((value) => isLiteralOf(value, target, definitions));
|
|
44
|
-
}
|
|
45
|
-
switch (source.kind) {
|
|
46
|
-
case 'string':
|
|
47
|
-
case 'number':
|
|
48
|
-
return (
|
|
49
|
-
target.kind === source.kind ||
|
|
50
|
-
(target.kind === 'content' && target.acceptsText === true)
|
|
51
|
-
);
|
|
52
|
-
case 'boolean':
|
|
53
|
-
case 'content':
|
|
54
|
-
return target.kind === source.kind;
|
|
55
|
-
case 'array':
|
|
56
|
-
return (
|
|
57
|
-
target.kind === 'array' &&
|
|
58
|
-
isAssignable(source.items, target.items, definitions)
|
|
59
|
-
);
|
|
60
|
-
case 'object': {
|
|
61
|
-
if (target.kind === 'record') return true;
|
|
62
|
-
if (target.kind !== 'object') return false;
|
|
63
|
-
const given = new Map(
|
|
64
|
-
(source.props ?? []).map((prop) => [prop.name, prop]),
|
|
65
|
-
);
|
|
66
|
-
return (target.props ?? []).every((prop) => {
|
|
67
|
-
const match = given.get(prop.name);
|
|
68
|
-
if (!match) return !prop.required;
|
|
69
|
-
return (
|
|
70
|
-
(match.required || !prop.required) &&
|
|
71
|
-
isAssignable(match.type, prop.type, definitions)
|
|
72
|
-
);
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
default:
|
|
76
|
-
return false;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/** Whether a JSON literal is a valid value of a type descriptor. */
|
|
81
|
-
export function isLiteralOf(value, type, definitions = {}) {
|
|
82
|
-
return literalOf(value, type, definitions);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* `isLiteralOf`, with `hooks` for the forms a prop value may nest:
|
|
87
|
-
* `hooks.slot` decides a `{ $slot }` at a content-typed position (KF-SXDM56:
|
|
88
|
-
* item slots), and `hooks.dynamic` a `{ $param }` / `{ $bind }` at any typed
|
|
89
|
-
* position against that position's type (KF-3QEZFB: nested params). Without
|
|
90
|
-
* them, neither is a literal.
|
|
91
|
-
*/
|
|
92
|
-
export function literalOf(value, type, definitions, hooks) {
|
|
93
|
-
if (
|
|
94
|
-
hooks?.dynamic &&
|
|
95
|
-
isObject(value) &&
|
|
96
|
-
('$param' in value || '$bind' in value)
|
|
97
|
-
)
|
|
98
|
-
return hooks.dynamic(value, type);
|
|
99
|
-
if (type?.typescript) return true;
|
|
100
|
-
const target = resolveType(type, definitions);
|
|
101
|
-
if (value === null) return target.nullable === true;
|
|
102
|
-
switch (target.kind) {
|
|
103
|
-
case 'unknown':
|
|
104
|
-
return true;
|
|
105
|
-
case 'union':
|
|
106
|
-
return target.members.some((member) =>
|
|
107
|
-
literalOf(value, member, definitions, hooks),
|
|
108
|
-
);
|
|
109
|
-
case 'string':
|
|
110
|
-
return typeof value === 'string';
|
|
111
|
-
case 'number':
|
|
112
|
-
return typeof value === 'number' && Number.isFinite(value);
|
|
113
|
-
case 'boolean':
|
|
114
|
-
return typeof value === 'boolean';
|
|
115
|
-
case 'enum':
|
|
116
|
-
return target.values.includes(value);
|
|
117
|
-
case 'literal':
|
|
118
|
-
return value === target.value;
|
|
119
|
-
// A builder call inside a list or object value (KF-3J9GJV).
|
|
120
|
-
case 'css-value':
|
|
121
|
-
return isObject(value) && parseCssCall(value.$css) !== undefined;
|
|
122
|
-
case 'content':
|
|
123
|
-
if (value instanceof ZoneFill) return true;
|
|
124
|
-
if (hooks?.slot && isObject(value) && '$slot' in value)
|
|
125
|
-
return hooks.slot(value);
|
|
126
|
-
return (
|
|
127
|
-
target.acceptsText === true &&
|
|
128
|
-
(typeof value === 'string' || typeof value === 'number')
|
|
129
|
-
);
|
|
130
|
-
case 'array':
|
|
131
|
-
return (
|
|
132
|
-
Array.isArray(value) &&
|
|
133
|
-
value.every((item) => literalOf(item, target.items, definitions, hooks))
|
|
134
|
-
);
|
|
135
|
-
case 'record':
|
|
136
|
-
return (
|
|
137
|
-
isObject(value) &&
|
|
138
|
-
Object.values(value).every((item) => typeof item === 'string')
|
|
139
|
-
);
|
|
140
|
-
case 'object': {
|
|
141
|
-
if (!isObject(value)) return false;
|
|
142
|
-
const known = new Map(
|
|
143
|
-
(target.props ?? []).map((prop) => [prop.name, prop]),
|
|
144
|
-
);
|
|
145
|
-
const { index } = target;
|
|
146
|
-
return (
|
|
147
|
-
Object.entries(value).every(([name, item]) =>
|
|
148
|
-
known.has(name)
|
|
149
|
-
? // An icon-data field names its icon (KF-3J9GJV).
|
|
150
|
-
(known.get(name).iconSource &&
|
|
151
|
-
ICON_NAME.test(item?.$icon ?? '')) ||
|
|
152
|
-
literalOf(item, known.get(name).type, definitions, hooks)
|
|
153
|
-
: index !== undefined &&
|
|
154
|
-
name.startsWith(index.keyPrefix) &&
|
|
155
|
-
literalOf(item, index.value, definitions, hooks),
|
|
156
|
-
) &&
|
|
157
|
-
[...known.values()].every(
|
|
158
|
-
(prop) => !prop.required || prop.name in value,
|
|
159
|
-
)
|
|
160
|
-
);
|
|
161
|
-
}
|
|
162
|
-
default:
|
|
163
|
-
return false;
|
|
164
|
-
}
|
|
165
|
-
}
|
package/view/validate-move.mjs
DELETED
|
@@ -1,353 +0,0 @@
|
|
|
1
|
-
// createMoveCheck (KF-SFAA5R: scoped move validation): whether moving one
|
|
2
|
-
// node adds a problem, answered without validating the whole moved document
|
|
3
|
-
// per destination. A move changes no id, name, slot, or param, so only three
|
|
4
|
-
// places can gain or lose problems: the source parent, the target parent, and
|
|
5
|
-
// the moved subtree in its new place. Each is checked alone with the
|
|
6
|
-
// validator's own checkNode, and the result is the full validation's,
|
|
7
|
-
// adjusted. Where a check depends on more than those places (the order of
|
|
8
|
-
// action uses, duplicate ids; docs/26-ui-editor.md §8.1), the check answers `undefined`
|
|
9
|
-
// and the caller validates in full, so an answer is never a guess.
|
|
10
|
-
import { childKind } from './child-kind.mjs';
|
|
11
|
-
import {
|
|
12
|
-
childFacts,
|
|
13
|
-
createScopedCheck,
|
|
14
|
-
eachTemplates,
|
|
15
|
-
runView,
|
|
16
|
-
validateView,
|
|
17
|
-
} from './validate.mjs';
|
|
18
|
-
|
|
19
|
-
const isObject = (value) =>
|
|
20
|
-
value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
21
|
-
const keyOf = ({ code, message }) => `${code} ${message}`;
|
|
22
|
-
const conflictKey = (name) =>
|
|
23
|
-
`KUI-V009 action "${name}" is used with both row and view scope`;
|
|
24
|
-
|
|
25
|
-
function count(diagnostics, into = new Map(), sign = 1) {
|
|
26
|
-
for (const diagnostic of diagnostics) {
|
|
27
|
-
const key = keyOf(diagnostic);
|
|
28
|
-
into.set(key, (into.get(key) ?? 0) + sign);
|
|
29
|
-
}
|
|
30
|
-
return into;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Whether one `$slot` object sits at two places a prop value is checked
|
|
35
|
-
* from: the validator reports a malformed one once per document, by
|
|
36
|
-
* identity, so a piece checked alone would report it again.
|
|
37
|
-
*/
|
|
38
|
-
function sharedSlot(root) {
|
|
39
|
-
const seen = new WeakSet();
|
|
40
|
-
const value = (item) => {
|
|
41
|
-
if (item === null || typeof item !== 'object') return false;
|
|
42
|
-
if ('$slot' in item) {
|
|
43
|
-
if (seen.has(item)) return true;
|
|
44
|
-
seen.add(item);
|
|
45
|
-
}
|
|
46
|
-
return Object.values(item).some(value);
|
|
47
|
-
};
|
|
48
|
-
const child = (item) => {
|
|
49
|
-
if (!isObject(item)) return false;
|
|
50
|
-
switch (childKind(item)) {
|
|
51
|
-
case 'each':
|
|
52
|
-
return value(item.kind) || eachTemplates(item).some(child);
|
|
53
|
-
case 'if':
|
|
54
|
-
return value(item.$if) || child(item.then) || child(item.else);
|
|
55
|
-
case 'slot':
|
|
56
|
-
return value(item.input);
|
|
57
|
-
default:
|
|
58
|
-
return node(item);
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
const node = (item) =>
|
|
62
|
-
isObject(item) &&
|
|
63
|
-
(value(item.props) ||
|
|
64
|
-
value(item.value) ||
|
|
65
|
-
Object.values(isObject(item.zones) ? item.zones : {}).some(
|
|
66
|
-
(list) => Array.isArray(list) && list.some(child),
|
|
67
|
-
));
|
|
68
|
-
return node(root);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Every node by id and every node placed directly in a zone list, as the
|
|
73
|
-
* editor's edits find them. Undefined unless the tree is well formed, ids
|
|
74
|
-
* are distinct strings, and names are distinct: then no move can report a
|
|
75
|
-
* duplicate, and each id names one node.
|
|
76
|
-
*/
|
|
77
|
-
function indexDocument(document) {
|
|
78
|
-
const nodes = new Map();
|
|
79
|
-
const placements = new Map();
|
|
80
|
-
const names = new Set();
|
|
81
|
-
let ok = isObject(document) && !sharedSlot(document.root);
|
|
82
|
-
const node = (item) => {
|
|
83
|
-
if (!ok || !isObject(item) || !('type' in item)) return void (ok = false);
|
|
84
|
-
if (typeof item.id !== 'string' || nodes.has(item.id)) ok = false;
|
|
85
|
-
nodes.set(item.id, item);
|
|
86
|
-
if (typeof item.name === 'string') {
|
|
87
|
-
if (names.has(item.name)) ok = false;
|
|
88
|
-
names.add(item.name);
|
|
89
|
-
}
|
|
90
|
-
if (item.zones === undefined) return;
|
|
91
|
-
if (!isObject(item.zones)) return void (ok = false);
|
|
92
|
-
for (const [zone, list] of Object.entries(item.zones)) {
|
|
93
|
-
if (!Array.isArray(list)) return void (ok = false);
|
|
94
|
-
list.forEach((entry, index) => child(entry, item, zone, index, true));
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
const child = (item, parent, zone, index, direct) => {
|
|
98
|
-
if (!isObject(item)) return void (ok = false);
|
|
99
|
-
switch (childKind(item)) {
|
|
100
|
-
case 'each':
|
|
101
|
-
for (const template of eachTemplates(item))
|
|
102
|
-
child(template, parent, zone, index, false);
|
|
103
|
-
break;
|
|
104
|
-
case 'if':
|
|
105
|
-
child(item.then, parent, zone, index, false);
|
|
106
|
-
if ('else' in item) child(item.else, parent, zone, index, false);
|
|
107
|
-
break;
|
|
108
|
-
case 'slot':
|
|
109
|
-
break;
|
|
110
|
-
default:
|
|
111
|
-
if (direct) placements.set(item.id, { parent, zone, index });
|
|
112
|
-
node(item);
|
|
113
|
-
}
|
|
114
|
-
};
|
|
115
|
-
if (ok) node(document.root);
|
|
116
|
-
return ok ? { nodes, placements } : undefined;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
/** The ids of every node a zone child holds, itself included. */
|
|
120
|
-
function heldIds(item, ids = new Set()) {
|
|
121
|
-
switch (childKind(item)) {
|
|
122
|
-
case 'slot':
|
|
123
|
-
return ids;
|
|
124
|
-
case 'each':
|
|
125
|
-
for (const template of eachTemplates(item)) heldIds(template, ids);
|
|
126
|
-
return ids;
|
|
127
|
-
case 'if':
|
|
128
|
-
heldIds(item.then, ids);
|
|
129
|
-
if (item.else) heldIds(item.else, ids);
|
|
130
|
-
return ids;
|
|
131
|
-
}
|
|
132
|
-
ids.add(item.id);
|
|
133
|
-
for (const list of Object.values(item.zones ?? {}))
|
|
134
|
-
for (const inner of list) heldIds(inner, ids);
|
|
135
|
-
return ids;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* `node`'s tree with `prepare` applied to every node, sharing what it leaves
|
|
140
|
-
* alone; `map` records each node's prepared copy.
|
|
141
|
-
*/
|
|
142
|
-
function prepareTree(node, prepare, map) {
|
|
143
|
-
const prepared = prepare(node);
|
|
144
|
-
let changed = prepared !== node;
|
|
145
|
-
let zones;
|
|
146
|
-
if (node.zones) {
|
|
147
|
-
zones = {};
|
|
148
|
-
for (const [key, list] of Object.entries(node.zones)) {
|
|
149
|
-
zones[key] = list.map((item) => prepareChild(item, prepare, map));
|
|
150
|
-
changed ||= zones[key].some((item, index) => item !== list[index]);
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
const result = !changed ? node : zones ? { ...prepared, zones } : prepared;
|
|
154
|
-
map.set(node, result);
|
|
155
|
-
return result;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
function prepareChild(item, prepare, map) {
|
|
159
|
-
switch (childKind(item)) {
|
|
160
|
-
case 'each':
|
|
161
|
-
return prepareEach(item, prepare, map);
|
|
162
|
-
case 'if': {
|
|
163
|
-
const then = prepareChild(item.then, prepare, map);
|
|
164
|
-
const otherwise =
|
|
165
|
-
'else' in item ? prepareChild(item.else, prepare, map) : undefined;
|
|
166
|
-
return then === item.then && otherwise === item.else
|
|
167
|
-
? item
|
|
168
|
-
: { ...item, then, ...('else' in item ? { else: otherwise } : {}) };
|
|
169
|
-
}
|
|
170
|
-
case 'slot':
|
|
171
|
-
return item;
|
|
172
|
-
default:
|
|
173
|
-
return prepareTree(item, prepare, map);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
function prepareEach(item, prepare, map) {
|
|
178
|
-
if ('templates' in item) {
|
|
179
|
-
// KF-YX6HMT: one prepared node per kind, sharing an unchanged map.
|
|
180
|
-
const entries = Object.entries(item.templates);
|
|
181
|
-
const prepared = entries.map(([kind, node]) => [
|
|
182
|
-
kind,
|
|
183
|
-
prepareChild(node, prepare, map),
|
|
184
|
-
]);
|
|
185
|
-
return prepared.every(([, node], index) => node === entries[index][1])
|
|
186
|
-
? item
|
|
187
|
-
: { ...item, templates: Object.fromEntries(prepared) };
|
|
188
|
-
}
|
|
189
|
-
const template = prepareChild(item.template, prepare, map);
|
|
190
|
-
return template === item.template ? item : { ...item, template };
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
/**
|
|
194
|
-
* Prepares to ask, for node `id`, whether moving it to the end of a zone adds
|
|
195
|
-
* a problem: whether `validateView(moved, catalog)` (with `prepare` applied
|
|
196
|
-
* to every node of the moved document) has a problem, by code and message,
|
|
197
|
-
* that `validateView(document, catalog)` lacks. `prepare` may change a
|
|
198
|
-
* node's own fields from its own fields and its zones' lengths, as the
|
|
199
|
-
* editor's field ownership does; it never changes zones.
|
|
200
|
-
*
|
|
201
|
-
* The returned function takes the target `parent` id and `zone` and answers
|
|
202
|
-
* `true` when the move changes the document and adds no problem, `false`
|
|
203
|
-
* when it adds one or moves nothing (into the node itself), and `undefined`
|
|
204
|
-
* when only a full validation can tell.
|
|
205
|
-
*/
|
|
206
|
-
export function createMoveCheck(document, catalog, id, options = {}) {
|
|
207
|
-
const prepare = options.prepare ?? ((node) => node);
|
|
208
|
-
const undecided = () => undefined;
|
|
209
|
-
const index = indexDocument(document);
|
|
210
|
-
const place = index?.placements.get(id);
|
|
211
|
-
if (!place) return undecided;
|
|
212
|
-
|
|
213
|
-
const map = new Map();
|
|
214
|
-
const root = prepareTree(document.root, prepare, map);
|
|
215
|
-
const prepared = root === document.root ? document : { ...document, root };
|
|
216
|
-
const trace = { entries: new Map(), notes: [] };
|
|
217
|
-
const base = runView(prepared, catalog, {}, trace).diagnostics;
|
|
218
|
-
const beforeCounts = count(
|
|
219
|
-
prepared === document ? base : validateView(document, catalog).diagnostics,
|
|
220
|
-
);
|
|
221
|
-
const baseCounts = count(base);
|
|
222
|
-
const excess = [...baseCounts].filter(
|
|
223
|
-
([key, total]) => total > (beforeCounts.get(key) ?? 0),
|
|
224
|
-
);
|
|
225
|
-
const baseUses = new Map();
|
|
226
|
-
for (const [name, scope] of trace.notes) {
|
|
227
|
-
const uses = baseUses.get(name) ?? { row: 0, view: 0 };
|
|
228
|
-
uses[scope] += 1;
|
|
229
|
-
baseUses.set(name, uses);
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
const check = createScopedCheck(prepared, catalog);
|
|
233
|
-
const shallow = (node, entry, zone) =>
|
|
234
|
-
check(node, entry, { shallow: true, zone });
|
|
235
|
-
const scopeIds = new Map();
|
|
236
|
-
let scopeCount = 0;
|
|
237
|
-
const subtreeRuns = new Map();
|
|
238
|
-
const subtree = (node, entry) => {
|
|
239
|
-
if (!scopeIds.has(entry[1])) scopeIds.set(entry[1], scopeCount++);
|
|
240
|
-
// An entry is checkNode's arguments (path, scope, row scope, parent,
|
|
241
|
-
// text zone) and the enclosing control; all but the path matter.
|
|
242
|
-
const [, scope, ...rest] = entry;
|
|
243
|
-
const key = JSON.stringify([scopeIds.get(scope), ...rest]);
|
|
244
|
-
if (!subtreeRuns.has(key))
|
|
245
|
-
subtreeRuns.set(key, check(node, entry, { asChild: true }));
|
|
246
|
-
return subtreeRuns.get(key);
|
|
247
|
-
};
|
|
248
|
-
|
|
249
|
-
const sourceDoc = place.parent;
|
|
250
|
-
const sourceZone = place.zone;
|
|
251
|
-
const movedDoc = index.nodes.get(id);
|
|
252
|
-
const moved = map.get(movedDoc);
|
|
253
|
-
const source = map.get(sourceDoc);
|
|
254
|
-
const held = heldIds(movedDoc);
|
|
255
|
-
const without = (zones) => ({
|
|
256
|
-
...zones,
|
|
257
|
-
[sourceZone]: zones[sourceZone].filter((_, at) => at !== place.index),
|
|
258
|
-
});
|
|
259
|
-
const leftDoc = { ...sourceDoc, zones: without(sourceDoc.zones) };
|
|
260
|
-
const left = { ...prepare(leftDoc), zones: without(source.zones) };
|
|
261
|
-
const sourceEntry = trace.entries.get(source);
|
|
262
|
-
const sourceBefore = sourceEntry && shallow(source, sourceEntry);
|
|
263
|
-
const sourceAfter = sourceEntry && shallow(left, sourceEntry);
|
|
264
|
-
const movedEntry = trace.entries.get(moved);
|
|
265
|
-
const movedBefore = movedEntry && check(moved, movedEntry, { asChild: true });
|
|
266
|
-
const shallowBefore = new Map();
|
|
267
|
-
// Same host for its children, same facts for its parent: else the move
|
|
268
|
-
// reaches past the three places.
|
|
269
|
-
const sameReach = (before, after, node, next) =>
|
|
270
|
-
before.hostAfter === after.hostAfter &&
|
|
271
|
-
childFacts(catalog, node) === childFacts(catalog, next);
|
|
272
|
-
|
|
273
|
-
return (parent, zone) => {
|
|
274
|
-
if (held.has(parent)) return false;
|
|
275
|
-
const targetDoc = index.nodes.get(parent);
|
|
276
|
-
if (!targetDoc || (targetDoc === sourceDoc && zone === sourceZone))
|
|
277
|
-
return undefined;
|
|
278
|
-
const list = targetDoc.zones?.[zone];
|
|
279
|
-
if (list !== undefined && !Array.isArray(list)) return undefined;
|
|
280
|
-
const same = targetDoc === sourceDoc;
|
|
281
|
-
const target = map.get(targetDoc);
|
|
282
|
-
const append = (zones, item) => ({
|
|
283
|
-
...(zones ?? {}),
|
|
284
|
-
[zone]: [...(zones?.[zone] ?? []), item],
|
|
285
|
-
});
|
|
286
|
-
const baseDoc = same ? leftDoc : targetDoc;
|
|
287
|
-
const landed = {
|
|
288
|
-
...prepare({ ...baseDoc, zones: append(baseDoc.zones, movedDoc) }),
|
|
289
|
-
zones: append(same ? left.zones : target.zones, moved),
|
|
290
|
-
};
|
|
291
|
-
const removed = movedBefore ? [movedBefore] : [];
|
|
292
|
-
const added = [];
|
|
293
|
-
if (sourceEntry && !same) {
|
|
294
|
-
if (!sameReach(sourceBefore, sourceAfter, source, left)) return undefined;
|
|
295
|
-
removed.push(sourceBefore);
|
|
296
|
-
added.push(sourceAfter);
|
|
297
|
-
}
|
|
298
|
-
const targetEntry = trace.entries.get(target);
|
|
299
|
-
if (targetEntry) {
|
|
300
|
-
if (!shallowBefore.has(target))
|
|
301
|
-
shallowBefore.set(target, shallow(target, targetEntry));
|
|
302
|
-
const before = shallowBefore.get(target);
|
|
303
|
-
const after = shallow(landed, targetEntry, zone);
|
|
304
|
-
if (!sameReach(before, after, target, landed)) return undefined;
|
|
305
|
-
removed.push(before);
|
|
306
|
-
added.push(after);
|
|
307
|
-
if (after.child) {
|
|
308
|
-
added.push(subtree(moved, after.child));
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
const delta = new Map();
|
|
312
|
-
const uses = new Map();
|
|
313
|
-
for (const [runs, sign] of [
|
|
314
|
-
[removed, -1],
|
|
315
|
-
[added, 1],
|
|
316
|
-
]) {
|
|
317
|
-
for (const run of runs) {
|
|
318
|
-
count(run.diagnostics, delta, sign);
|
|
319
|
-
for (const [name, scope] of run.notes) {
|
|
320
|
-
const use = uses.get(name) ?? { row: 0, view: 0 };
|
|
321
|
-
use[scope] += sign;
|
|
322
|
-
uses.set(name, use);
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
// Each use of an action in the other scope than its first use reports a
|
|
327
|
-
// conflict. One scope reports none; with both, document order decides
|
|
328
|
-
// between the two counts, which matters only when they fall on either
|
|
329
|
-
// side of the count before the move.
|
|
330
|
-
const conflicts = new Map();
|
|
331
|
-
for (const [name, use] of uses) {
|
|
332
|
-
const total = baseUses.get(name) ?? { row: 0, view: 0 };
|
|
333
|
-
const row = total.row + use.row;
|
|
334
|
-
const view = total.view + use.view;
|
|
335
|
-
const key = conflictKey(name);
|
|
336
|
-
const before = beforeCounts.get(key) ?? 0;
|
|
337
|
-
if (!row || !view) conflicts.set(key, 0);
|
|
338
|
-
else if (Math.min(row, view) > before) return false;
|
|
339
|
-
else if (Math.max(row, view) <= before) conflicts.set(key, before);
|
|
340
|
-
else return undefined;
|
|
341
|
-
}
|
|
342
|
-
for (const key of new Set([
|
|
343
|
-
...delta.keys(),
|
|
344
|
-
...excess.map(([key]) => key),
|
|
345
|
-
])) {
|
|
346
|
-
const total =
|
|
347
|
-
conflicts.get(key) ??
|
|
348
|
-
(baseCounts.get(key) ?? 0) + (delta.get(key) ?? 0);
|
|
349
|
-
if (total > (beforeCounts.get(key) ?? 0)) return false;
|
|
350
|
-
}
|
|
351
|
-
return true;
|
|
352
|
-
};
|
|
353
|
-
}
|