@bettercms-ai/kit 0.1.0 → 1.0.0
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/_virtual/_rolldown/runtime.js +13 -0
- package/adapters/icons.d.ts +15 -0
- package/adapters/icons.js +27 -0
- package/adapters/icons.js.map +1 -0
- package/adapters/lossy.d.ts +267 -0
- package/adapters/lossy.js +233 -0
- package/adapters/lossy.js.map +1 -0
- package/adapters/prod-types.d.ts +468 -0
- package/adapters/prod-types.js +646 -0
- package/adapters/prod-types.js.map +1 -0
- package/adapters/schema.d.ts +115 -0
- package/adapters/schema.js +2203 -0
- package/adapters/schema.js.map +1 -0
- package/adapters/values.d.ts +200 -0
- package/adapters/values.js +553 -0
- package/adapters/values.js.map +1 -0
- package/brand/logo.d.ts +17 -0
- package/brand/logo.js +9 -0
- package/brand/logo.js.map +1 -0
- package/context.d.ts +269 -0
- package/context.js +214 -0
- package/context.js.map +1 -0
- package/controls/button.d.ts +58 -0
- package/controls/button.js +507 -0
- package/controls/button.js.map +1 -0
- package/controls/c1.d.ts +11 -0
- package/controls/c1.js +24 -0
- package/controls/c1.js.map +1 -0
- package/controls/c2.d.ts +10 -0
- package/controls/c2.js +19 -0
- package/controls/c2.js.map +1 -0
- package/controls/choice.d.ts +39 -0
- package/controls/choice.js +410 -0
- package/controls/choice.js.map +1 -0
- package/controls/code-register.d.ts +1 -0
- package/controls/code-register.js +8 -0
- package/controls/code-register.js.map +1 -0
- package/controls/code.d.ts +42 -0
- package/controls/code.js +396 -0
- package/controls/code.js.map +1 -0
- package/controls/color.d.ts +5 -0
- package/controls/color.js +130 -0
- package/controls/color.js.map +1 -0
- package/controls/component-services.d.ts +114 -0
- package/controls/date-register.d.ts +1 -0
- package/controls/date-register.js +9 -0
- package/controls/date-register.js.map +1 -0
- package/controls/date-zone.d.ts +104 -0
- package/controls/date-zone.js +272 -0
- package/controls/date-zone.js.map +1 -0
- package/controls/date.d.ts +7 -0
- package/controls/date.js +458 -0
- package/controls/date.js.map +1 -0
- package/controls/form-picker-register.d.ts +1 -0
- package/controls/form-picker-register.js +19 -0
- package/controls/form-picker-register.js.map +1 -0
- package/controls/form-picker.d.ts +43 -0
- package/controls/form-picker.js +83 -0
- package/controls/form-picker.js.map +1 -0
- package/controls/icon-register.d.ts +1 -0
- package/controls/icon-register.js +8 -0
- package/controls/icon-register.js.map +1 -0
- package/controls/icon.d.ts +38 -0
- package/controls/icon.js +355 -0
- package/controls/icon.js.map +1 -0
- package/controls/index.d.ts +5 -0
- package/controls/index.js +37 -0
- package/controls/index.js.map +1 -0
- package/controls/json-register.d.ts +1 -0
- package/controls/json-register.js +8 -0
- package/controls/json-register.js.map +1 -0
- package/controls/json.d.ts +2 -0
- package/controls/json.js +72 -0
- package/controls/json.js.map +1 -0
- package/controls/link.d.ts +260 -0
- package/controls/link.js +1186 -0
- package/controls/link.js.map +1 -0
- package/controls/location-register.d.ts +1 -0
- package/controls/location-register.js +8 -0
- package/controls/location-register.js.map +1 -0
- package/controls/location.d.ts +16 -0
- package/controls/location.js +197 -0
- package/controls/location.js.map +1 -0
- package/controls/media-register.d.ts +1 -0
- package/controls/media-register.js +12 -0
- package/controls/media-register.js.map +1 -0
- package/controls/media-services.d.ts +40 -0
- package/controls/media.d.ts +73 -0
- package/controls/media.js +1076 -0
- package/controls/media.js.map +1 -0
- package/controls/number.d.ts +22 -0
- package/controls/number.js +195 -0
- package/controls/number.js.map +1 -0
- package/controls/reference-register.d.ts +1 -0
- package/controls/reference-register.js +10 -0
- package/controls/reference-register.js.map +1 -0
- package/controls/reference-services.d.ts +54 -0
- package/controls/reference.d.ts +23 -0
- package/controls/reference.js +761 -0
- package/controls/reference.js.map +1 -0
- package/controls/rich-text/blocks.d.ts +28 -0
- package/controls/rich-text/blocks.js +1532 -0
- package/controls/rich-text/blocks.js.map +1 -0
- package/controls/rich-text/catalog.d.ts +98 -0
- package/controls/rich-text/catalog.js +613 -0
- package/controls/rich-text/catalog.js.map +1 -0
- package/controls/rich-text/codec.d.ts +56 -0
- package/controls/rich-text/codec.js +32 -0
- package/controls/rich-text/codec.js.map +1 -0
- package/controls/rich-text/component-card.d.ts +14 -0
- package/controls/rich-text/component-card.js +706 -0
- package/controls/rich-text/component-card.js.map +1 -0
- package/controls/rich-text/control.d.ts +21 -0
- package/controls/rich-text/control.js +254 -0
- package/controls/rich-text/control.js.map +1 -0
- package/controls/rich-text/dom.d.ts +190 -0
- package/controls/rich-text/dom.js +690 -0
- package/controls/rich-text/dom.js.map +1 -0
- package/controls/rich-text/editor.d.ts +50 -0
- package/controls/rich-text/editor.js +1530 -0
- package/controls/rich-text/editor.js.map +1 -0
- package/controls/rich-text/floating.d.ts +23 -0
- package/controls/rich-text/floating.js +137 -0
- package/controls/rich-text/floating.js.map +1 -0
- package/controls/rich-text/index.d.ts +1 -0
- package/controls/rich-text/index.js +12 -0
- package/controls/rich-text/index.js.map +1 -0
- package/controls/rich-text/link-form.d.ts +13 -0
- package/controls/rich-text/link-form.js +111 -0
- package/controls/rich-text/link-form.js.map +1 -0
- package/controls/rich-text/markdown.d.ts +6 -0
- package/controls/rich-text/markdown.js +179 -0
- package/controls/rich-text/markdown.js.map +1 -0
- package/controls/rich-text/ops.d.ts +35 -0
- package/controls/rich-text/ops.js +314 -0
- package/controls/rich-text/ops.js.map +1 -0
- package/controls/rich-text/toolbar.d.ts +85 -0
- package/controls/rich-text/toolbar.js +338 -0
- package/controls/rich-text/toolbar.js.map +1 -0
- package/controls/scale.d.ts +56 -0
- package/controls/scale.js +563 -0
- package/controls/scale.js.map +1 -0
- package/controls/slot-register.d.ts +1 -0
- package/controls/slot-register.js +16 -0
- package/controls/slot-register.js.map +1 -0
- package/controls/slot-services.d.ts +97 -0
- package/controls/slot-services.js +38 -0
- package/controls/slot-services.js.map +1 -0
- package/controls/slot.d.ts +33 -0
- package/controls/slot.js +348 -0
- package/controls/slot.js.map +1 -0
- package/controls/table/index.d.ts +1 -0
- package/controls/table/index.js +12 -0
- package/controls/table/index.js.map +1 -0
- package/controls/table/prod.d.ts +21 -0
- package/controls/table/prod.js +79 -0
- package/controls/table/prod.js.map +1 -0
- package/controls/table/refs.d.ts +50 -0
- package/controls/table/refs.js +68 -0
- package/controls/table/refs.js.map +1 -0
- package/controls/table/stored.d.ts +15 -0
- package/controls/table/stored.js +44 -0
- package/controls/table/stored.js.map +1 -0
- package/controls/table/table-editor.d.ts +103 -0
- package/controls/table/table-editor.js +2722 -0
- package/controls/table/table-editor.js.map +1 -0
- package/controls/table/table-link.d.ts +24 -0
- package/controls/table/table-link.js +180 -0
- package/controls/table/table-link.js.map +1 -0
- package/controls/table/table.d.ts +9 -0
- package/controls/table/table.js +103 -0
- package/controls/table/table.js.map +1 -0
- package/controls/text.d.ts +17 -0
- package/controls/text.js +287 -0
- package/controls/text.js.map +1 -0
- package/engine/array.d.ts +101 -0
- package/engine/array.js +893 -0
- package/engine/array.js.map +1 -0
- package/engine/bits.d.ts +24 -0
- package/engine/bits.js +60 -0
- package/engine/bits.js.map +1 -0
- package/engine/breadcrumb.d.ts +45 -0
- package/engine/breadcrumb.js +87 -0
- package/engine/breadcrumb.js.map +1 -0
- package/engine/expand.d.ts +68 -0
- package/engine/expand.js +170 -0
- package/engine/expand.js.map +1 -0
- package/engine/field-list.d.ts +20 -0
- package/engine/field-list.js +19 -0
- package/engine/field-list.js.map +1 -0
- package/engine/field-shell.d.ts +49 -0
- package/engine/field-shell.js +860 -0
- package/engine/field-shell.js.map +1 -0
- package/engine/frame.d.ts +120 -0
- package/engine/frame.js +599 -0
- package/engine/frame.js.map +1 -0
- package/engine/group-summary.d.ts +4 -0
- package/engine/group-summary.js +66 -0
- package/engine/group-summary.js.map +1 -0
- package/engine/grouping.d.ts +224 -0
- package/engine/grouping.js +824 -0
- package/engine/grouping.js.map +1 -0
- package/engine/item-list.d.ts +89 -0
- package/engine/item-list.js +703 -0
- package/engine/item-list.js.map +1 -0
- package/engine/kit-field.d.ts +72 -0
- package/engine/kit-field.js +523 -0
- package/engine/kit-field.js.map +1 -0
- package/engine/schema-form.d.ts +91 -0
- package/engine/schema-form.js +320 -0
- package/engine/schema-form.js.map +1 -0
- package/engine/slot.d.ts +13 -0
- package/engine/slot.js +226 -0
- package/engine/slot.js.map +1 -0
- package/index.d.ts +46 -0
- package/index.js +55 -0
- package/index.js.map +1 -0
- package/kit.css +56 -0
- package/lib/cn.d.ts +4 -0
- package/lib/cn.js +53 -0
- package/lib/cn.js.map +1 -0
- package/lib/columns.d.ts +14 -0
- package/lib/columns.js +27 -0
- package/lib/columns.js.map +1 -0
- package/lib/frames.d.ts +36 -0
- package/lib/frames.js +214 -0
- package/lib/frames.js.map +1 -0
- package/lib/icons.d.ts +16 -0
- package/lib/icons.js +172 -0
- package/lib/icons.js.map +1 -0
- package/lib/path.d.ts +29 -0
- package/lib/path.js +64 -0
- package/lib/path.js.map +1 -0
- package/lib/schema.d.ts +49 -0
- package/lib/schema.js +287 -0
- package/lib/schema.js.map +1 -0
- package/lib/utils.d.ts +7 -0
- package/lib/utils.js +37 -0
- package/lib/utils.js.map +1 -0
- package/lib/validate.d.ts +20 -0
- package/lib/validate.js +150 -0
- package/lib/validate.js.map +1 -0
- package/package.json +31 -59
- package/schema/adapters.d.ts +28 -0
- package/schema/adapters.js +493 -0
- package/schema/adapters.js.map +1 -0
- package/schema/help.d.ts +25 -0
- package/schema/help.js +54 -0
- package/schema/help.js.map +1 -0
- package/schema/scale.d.ts +69 -0
- package/schema/scale.js +250 -0
- package/schema/scale.js.map +1 -0
- package/schema/sources.d.ts +103 -0
- package/schema/sources.js +65 -0
- package/schema/sources.js.map +1 -0
- package/schema/table.d.ts +319 -0
- package/schema/table.js +1198 -0
- package/schema/table.js.map +1 -0
- package/schema/types.d.ts +269 -0
- package/schema/types.js +14 -0
- package/schema/types.js.map +1 -0
- package/types.d.ts +17 -0
- package/ui/action-tray.d.ts +54 -0
- package/ui/action-tray.js +153 -0
- package/ui/action-tray.js.map +1 -0
- package/ui/button.d.ts +57 -0
- package/ui/button.js +202 -0
- package/ui/button.js.map +1 -0
- package/ui/choice-switch.d.ts +36 -0
- package/ui/choice-switch.js +57 -0
- package/ui/choice-switch.js.map +1 -0
- package/ui/controls.d.ts +83 -0
- package/ui/controls.js +319 -0
- package/ui/controls.js.map +1 -0
- package/ui/display.d.ts +156 -0
- package/ui/display.js +444 -0
- package/ui/display.js.map +1 -0
- package/ui/expanded-editor-modal.d.ts +26 -0
- package/ui/expanded-editor-modal.js +140 -0
- package/ui/expanded-editor-modal.js.map +1 -0
- package/ui/field-context.d.ts +12 -0
- package/ui/field-context.js +23 -0
- package/ui/field-context.js.map +1 -0
- package/ui/floating-panel.d.ts +152 -0
- package/ui/floating-panel.js +912 -0
- package/ui/floating-panel.js.map +1 -0
- package/ui/index.d.ts +12 -0
- package/ui/index.js +13 -0
- package/ui/input.d.ts +78 -0
- package/ui/input.js +250 -0
- package/ui/input.js.map +1 -0
- package/ui/mode-bar.d.ts +31 -0
- package/ui/mode-bar.js +65 -0
- package/ui/mode-bar.js.map +1 -0
- package/ui/overlay.d.ts +123 -0
- package/ui/overlay.js +378 -0
- package/ui/overlay.js.map +1 -0
- package/ui/path-crumbs.d.ts +90 -0
- package/ui/path-crumbs.js +532 -0
- package/ui/path-crumbs.js.map +1 -0
- package/ui/presence.d.ts +16 -0
- package/ui/presence.js +65 -0
- package/ui/presence.js.map +1 -0
- package/ui/select.d.ts +66 -0
- package/ui/select.js +405 -0
- package/ui/select.js.map +1 -0
- package/ui/shortcut-hint.d.ts +14 -0
- package/ui/shortcut-hint.js +35 -0
- package/ui/shortcut-hint.js.map +1 -0
- package/ui/surfaces.d.ts +23 -0
- package/ui/surfaces.js +26 -0
- package/ui/surfaces.js.map +1 -0
- package/ui/tooltip-root.d.ts +12 -0
- package/ui/tooltip-root.js +76 -0
- package/ui/tooltip-root.js.map +1 -0
- package/ui/variants.d.ts +15 -0
- package/ui/variants.js +14 -0
- package/ui/variants.js.map +1 -0
- package/LICENSE +0 -21
- package/README.md +0 -27
- package/dist/_chunks-cjs/_visual-editing.js +0 -5898
- package/dist/_chunks-cjs/refractor.js +0 -22
- package/dist/_chunks-es/_visual-editing.mjs +0 -5904
- package/dist/_chunks-es/refractor.mjs +0 -25
- package/dist/_color.d.mts +0 -119
- package/dist/_color.d.ts +0 -119
- package/dist/_color.js +0 -1412
- package/dist/_color.mjs +0 -1411
- package/dist/_visual-editing.d.mts +0 -1126
- package/dist/_visual-editing.d.ts +0 -1126
- package/dist/_visual-editing.js +0 -30
- package/dist/_visual-editing.mjs +0 -30
- package/dist/index.d.mts +0 -3140
- package/dist/index.d.ts +0 -3140
- package/dist/index.js +0 -2036
- package/dist/index.mjs +0 -2044
- package/dist/theme.d.mts +0 -1506
- package/dist/theme.d.ts +0 -1506
- package/dist/theme.js +0 -4126
- package/dist/theme.mjs +0 -4126
- package/exports/_visual-editing.ts +0 -31
- package/exports/index.ts +0 -1
- package/exports/theme.ts +0 -1
- package/src/color/index.d.mts +0 -119
- package/src/color/index.mjs +0 -1411
- package/src/core/__workshop__/constants.ts +0 -293
- package/src/core/_compat.ts +0 -264
- package/src/core/components/autocomplete/__mocks__/apiStore.ts +0 -49
- package/src/core/components/autocomplete/__mocks__/countries.ts +0 -245
- package/src/core/components/autocomplete/__workshop__/async.tsx +0 -156
- package/src/core/components/autocomplete/__workshop__/constrainedHeight.tsx +0 -137
- package/src/core/components/autocomplete/__workshop__/custom.tsx +0 -89
- package/src/core/components/autocomplete/__workshop__/example.tsx +0 -79
- package/src/core/components/autocomplete/__workshop__/focusAndBlur.tsx +0 -36
- package/src/core/components/autocomplete/__workshop__/fullscreen.tsx +0 -294
- package/src/core/components/autocomplete/__workshop__/index.ts +0 -39
- package/src/core/components/autocomplete/__workshop__/types.ts +0 -4
- package/src/core/components/autocomplete/autocomplete.styles.tsx +0 -39
- package/src/core/components/autocomplete/autocomplete.tsx +0 -767
- package/src/core/components/autocomplete/autocompleteOption.tsx +0 -45
- package/src/core/components/autocomplete/autocompleteReducer.ts +0 -47
- package/src/core/components/autocomplete/constants.ts +0 -28
- package/src/core/components/autocomplete/index.ts +0 -2
- package/src/core/components/autocomplete/types.ts +0 -108
- package/src/core/components/breadcrumbs/__workshop__/example.tsx +0 -62
- package/src/core/components/breadcrumbs/__workshop__/index.ts +0 -14
- package/src/core/components/breadcrumbs/breadcrumbs.styles.ts +0 -18
- package/src/core/components/breadcrumbs/breadcrumbs.test.tsx +0 -51
- package/src/core/components/breadcrumbs/breadcrumbs.tsx +0 -133
- package/src/core/components/breadcrumbs/index.ts +0 -1
- package/src/core/components/dialog/__workshop__/activate.tsx +0 -134
- package/src/core/components/dialog/__workshop__/autoFocus.tsx +0 -29
- package/src/core/components/dialog/__workshop__/index.ts +0 -19
- package/src/core/components/dialog/__workshop__/layering.tsx +0 -41
- package/src/core/components/dialog/__workshop__/nested.tsx +0 -72
- package/src/core/components/dialog/__workshop__/onScroll.tsx +0 -39
- package/src/core/components/dialog/__workshop__/panes.tsx +0 -82
- package/src/core/components/dialog/__workshop__/position.tsx +0 -30
- package/src/core/components/dialog/__workshop__/props.tsx +0 -75
- package/src/core/components/dialog/__workshop__/provider.tsx +0 -11
- package/src/core/components/dialog/__workshop__/wrapped.tsx +0 -76
- package/src/core/components/dialog/dialog.tsx +0 -430
- package/src/core/components/dialog/dialogContext.ts +0 -20
- package/src/core/components/dialog/dialogProvider.tsx +0 -35
- package/src/core/components/dialog/index.ts +0 -4
- package/src/core/components/dialog/styles.ts +0 -77
- package/src/core/components/dialog/useDialog.ts +0 -11
- package/src/core/components/hotkeys/__workshop__/index.ts +0 -14
- package/src/core/components/hotkeys/__workshop__/plain.tsx +0 -9
- package/src/core/components/hotkeys/hotkeys.test.tsx +0 -42
- package/src/core/components/hotkeys/hotkeys.tsx +0 -66
- package/src/core/components/hotkeys/index.ts +0 -1
- package/src/core/components/index.ts +0 -9
- package/src/core/components/menu/__workshop__/asComponent.tsx +0 -45
- package/src/core/components/menu/__workshop__/avatarMenu.tsx +0 -51
- package/src/core/components/menu/__workshop__/closableMenuButton.tsx +0 -46
- package/src/core/components/menu/__workshop__/constrainedInBoundary.tsx +0 -134
- package/src/core/components/menu/__workshop__/customMenuItem.tsx +0 -45
- package/src/core/components/menu/__workshop__/customSelectedState.tsx +0 -39
- package/src/core/components/menu/__workshop__/disableFocusOnClose.tsx +0 -40
- package/src/core/components/menu/__workshop__/groups.tsx +0 -156
- package/src/core/components/menu/__workshop__/index.ts +0 -89
- package/src/core/components/menu/__workshop__/menuButton.tsx +0 -80
- package/src/core/components/menu/__workshop__/menuGroupRight.tsx +0 -58
- package/src/core/components/menu/__workshop__/nestedMenu.tsx +0 -22
- package/src/core/components/menu/__workshop__/onCloseMenuButton.tsx +0 -41
- package/src/core/components/menu/__workshop__/selectedItem.tsx +0 -69
- package/src/core/components/menu/__workshop__/shouldFocus.tsx +0 -47
- package/src/core/components/menu/__workshop__/tones.tsx +0 -25
- package/src/core/components/menu/__workshop__/withoutArrow.tsx +0 -32
- package/src/core/components/menu/helpers.ts +0 -82
- package/src/core/components/menu/index.ts +0 -5
- package/src/core/components/menu/menu.spacing.test.tsx +0 -63
- package/src/core/components/menu/menu.test.tsx +0 -125
- package/src/core/components/menu/menu.tsx +0 -178
- package/src/core/components/menu/menuButton.tsx +0 -268
- package/src/core/components/menu/menuContext.ts +0 -18
- package/src/core/components/menu/menuDivider.ts +0 -23
- package/src/core/components/menu/menuGroup.spacing.test.tsx +0 -63
- package/src/core/components/menu/menuGroup.tsx +0 -233
- package/src/core/components/menu/menuItem.spacing.test.tsx +0 -59
- package/src/core/components/menu/menuItem.tsx +0 -197
- package/src/core/components/menu/useMenu.ts +0 -21
- package/src/core/components/menu/useMenuController.ts +0 -231
- package/src/core/components/skeleton/__workshop__/delay.tsx +0 -70
- package/src/core/components/skeleton/__workshop__/index.ts +0 -11
- package/src/core/components/skeleton/__workshop__/skeleton.tsx +0 -64
- package/src/core/components/skeleton/index.ts +0 -2
- package/src/core/components/skeleton/skeleton.tsx +0 -57
- package/src/core/components/skeleton/styles.ts +0 -50
- package/src/core/components/skeleton/textSkeleton.tsx +0 -122
- package/src/core/components/tab/__workshop__/example.tsx +0 -79
- package/src/core/components/tab/__workshop__/index.ts +0 -14
- package/src/core/components/tab/index.ts +0 -3
- package/src/core/components/tab/tab.tsx +0 -101
- package/src/core/components/tab/tabList.test.tsx +0 -48
- package/src/core/components/tab/tabList.tsx +0 -70
- package/src/core/components/tab/tabPanel.tsx +0 -39
- package/src/core/components/toast/__workshop__/hook.tsx +0 -71
- package/src/core/components/toast/__workshop__/index.ts +0 -19
- package/src/core/components/toast/__workshop__/toast.tsx +0 -26
- package/src/core/components/toast/index.ts +0 -4
- package/src/core/components/toast/styles.ts +0 -77
- package/src/core/components/toast/toast.test.tsx +0 -101
- package/src/core/components/toast/toast.tsx +0 -198
- package/src/core/components/toast/toastContext.ts +0 -7
- package/src/core/components/toast/toastLayer.tsx +0 -51
- package/src/core/components/toast/toastProvider.tsx +0 -113
- package/src/core/components/toast/toastState.ts +0 -6
- package/src/core/components/toast/types.ts +0 -26
- package/src/core/components/toast/useToast.ts +0 -25
- package/src/core/components/tree/__workshop__/basic.perf.ts +0 -19
- package/src/core/components/tree/__workshop__/basic.tsx +0 -105
- package/src/core/components/tree/__workshop__/index.ts +0 -21
- package/src/core/components/tree/__workshop__/tabFromElement.tsx +0 -84
- package/src/core/components/tree/helpers.ts +0 -105
- package/src/core/components/tree/index.ts +0 -4
- package/src/core/components/tree/style.ts +0 -105
- package/src/core/components/tree/tree.test.tsx +0 -55
- package/src/core/components/tree/tree.tsx +0 -240
- package/src/core/components/tree/treeContext.ts +0 -10
- package/src/core/components/tree/treeGroup.tsx +0 -28
- package/src/core/components/tree/treeItem.test.tsx +0 -65
- package/src/core/components/tree/treeItem.tsx +0 -224
- package/src/core/components/tree/types.ts +0 -25
- package/src/core/components/tree/useTree.ts +0 -17
- package/src/core/constants.ts +0 -79
- package/src/core/helpers/animation.ts +0 -27
- package/src/core/helpers/element.ts +0 -55
- package/src/core/helpers/focus.ts +0 -100
- package/src/core/helpers/index.ts +0 -4
- package/src/core/helpers/scroll.ts +0 -15
- package/src/core/hooks/index.ts +0 -12
- package/src/core/hooks/useArrayProp.ts +0 -17
- package/src/core/hooks/useClickOutside.test.tsx +0 -482
- package/src/core/hooks/useClickOutside.ts +0 -118
- package/src/core/hooks/useClickOutsideEvent.test.tsx +0 -115
- package/src/core/hooks/useClickOutsideEvent.ts +0 -73
- package/src/core/hooks/useCustomValidity.ts +0 -13
- package/src/core/hooks/useDelayed.test.ts +0 -88
- package/src/core/hooks/useDelayedState.ts +0 -36
- package/src/core/hooks/useElementRect/__workshop__/example.tsx +0 -32
- package/src/core/hooks/useElementRect/__workshop__/index.ts +0 -14
- package/src/core/hooks/useElementRect/index.ts +0 -1
- package/src/core/hooks/useElementRect/useElementRect.ts +0 -13
- package/src/core/hooks/useElementSize.ts +0 -19
- package/src/core/hooks/useForwardedRef.ts +0 -19
- package/src/core/hooks/useGlobalKeyDown.ts +0 -24
- package/src/core/hooks/useIsomorphicEffect.ts +0 -7
- package/src/core/hooks/useMatchMedia.ts +0 -28
- package/src/core/hooks/useMediaIndex/__workshop__/index.ts +0 -14
- package/src/core/hooks/useMediaIndex/__workshop__/test.tsx +0 -14
- package/src/core/hooks/useMediaIndex/index.ts +0 -1
- package/src/core/hooks/useMediaIndex/useMediaIndex.test.tsx +0 -36
- package/src/core/hooks/useMediaIndex/useMediaIndex.ts +0 -102
- package/src/core/hooks/useMounted.ts +0 -15
- package/src/core/hooks/usePrefersDark.hydration.test.tsx +0 -56
- package/src/core/hooks/usePrefersDark.test.tsx +0 -19
- package/src/core/hooks/usePrefersDark.ts +0 -16
- package/src/core/hooks/usePrefersReducedMotion.hydration.test.tsx +0 -56
- package/src/core/hooks/usePrefersReducedMotion.test.tsx +0 -19
- package/src/core/hooks/usePrefersReducedMotion.ts +0 -16
- package/src/core/index.ts +0 -10
- package/src/core/lib/createGlobalScopedContext.ts +0 -36
- package/src/core/lib/globalScope.ts +0 -19
- package/src/core/lib/isRecord.ts +0 -3
- package/src/core/middleware/origin.ts +0 -47
- package/src/core/observers/elementSizeObserver.ts +0 -116
- package/src/core/observers/index.ts +0 -2
- package/src/core/observers/resizeObserver.ts +0 -9
- package/src/core/primitives/_selectable/index.ts +0 -1
- package/src/core/primitives/_selectable/selectable.tsx +0 -15
- package/src/core/primitives/_selectable/style.ts +0 -115
- package/src/core/primitives/avatar/__workshop__/asButton.tsx +0 -14
- package/src/core/primitives/avatar/__workshop__/index.ts +0 -29
- package/src/core/primitives/avatar/__workshop__/stack.tsx +0 -25
- package/src/core/primitives/avatar/__workshop__/withinButton.tsx +0 -63
- package/src/core/primitives/avatar/__workshop__/withinMenuItem.tsx +0 -70
- package/src/core/primitives/avatar/avatar.tsx +0 -200
- package/src/core/primitives/avatar/avatarCounter.tsx +0 -91
- package/src/core/primitives/avatar/avatarStack.tsx +0 -100
- package/src/core/primitives/avatar/index.ts +0 -4
- package/src/core/primitives/avatar/styles.ts +0 -167
- package/src/core/primitives/avatar/types.ts +0 -17
- package/src/core/primitives/badge/__workshop__/index.ts +0 -19
- package/src/core/primitives/badge/__workshop__/props.tsx +0 -30
- package/src/core/primitives/badge/__workshop__/tones.tsx +0 -21
- package/src/core/primitives/badge/badge.test.tsx +0 -16
- package/src/core/primitives/badge/badge.tsx +0 -70
- package/src/core/primitives/badge/index.ts +0 -1
- package/src/core/primitives/badge/styles.ts +0 -20
- package/src/core/primitives/badge/types.ts +0 -8
- package/src/core/primitives/box/__workshop__/asComponent.tsx +0 -31
- package/src/core/primitives/box/__workshop__/index.ts +0 -24
- package/src/core/primitives/box/__workshop__/props.tsx +0 -20
- package/src/core/primitives/box/__workshop__/responsive.tsx +0 -20
- package/src/core/primitives/box/box.test.tsx +0 -142
- package/src/core/primitives/box/box.tsx +0 -154
- package/src/core/primitives/box/index.ts +0 -1
- package/src/core/primitives/button/__workshop__/custom.tsx +0 -51
- package/src/core/primitives/button/__workshop__/customIcons.tsx +0 -30
- package/src/core/primitives/button/__workshop__/disabled.tsx +0 -74
- package/src/core/primitives/button/__workshop__/index.ts +0 -59
- package/src/core/primitives/button/__workshop__/labelUploadButton.tsx +0 -36
- package/src/core/primitives/button/__workshop__/mixedChildren.tsx +0 -12
- package/src/core/primitives/button/__workshop__/props.tsx +0 -55
- package/src/core/primitives/button/__workshop__/stacked.tsx +0 -58
- package/src/core/primitives/button/__workshop__/styled1.tsx +0 -17
- package/src/core/primitives/button/__workshop__/styled2.tsx +0 -19
- package/src/core/primitives/button/__workshop__/uploadButton.tsx +0 -28
- package/src/core/primitives/button/button.test.tsx +0 -82
- package/src/core/primitives/button/button.tsx +0 -210
- package/src/core/primitives/button/index.ts +0 -1
- package/src/core/primitives/button/styles.ts +0 -117
- package/src/core/primitives/card/__workshop__/allTones.tsx +0 -25
- package/src/core/primitives/card/__workshop__/asButton.tsx +0 -107
- package/src/core/primitives/card/__workshop__/asComponent.tsx +0 -27
- package/src/core/primitives/card/__workshop__/checkered.tsx +0 -26
- package/src/core/primitives/card/__workshop__/index.ts +0 -18
- package/src/core/primitives/card/__workshop__/interactive.tsx +0 -30
- package/src/core/primitives/card/__workshop__/listNavigation.tsx +0 -80
- package/src/core/primitives/card/__workshop__/props.tsx +0 -53
- package/src/core/primitives/card/__workshop__/selected.tsx +0 -94
- package/src/core/primitives/card/__workshop__/styled.tsx +0 -14
- package/src/core/primitives/card/card.tsx +0 -128
- package/src/core/primitives/card/index.ts +0 -2
- package/src/core/primitives/card/styles.ts +0 -147
- package/src/core/primitives/card/types.ts +0 -11
- package/src/core/primitives/checkbox/__workshop__/example.tsx +0 -25
- package/src/core/primitives/checkbox/__workshop__/index.ts +0 -13
- package/src/core/primitives/checkbox/__workshop__/props.tsx +0 -33
- package/src/core/primitives/checkbox/__workshop__/readOnly.tsx +0 -16
- package/src/core/primitives/checkbox/__workshop__/tones.tsx +0 -28
- package/src/core/primitives/checkbox/checkbox.tsx +0 -73
- package/src/core/primitives/checkbox/index.ts +0 -1
- package/src/core/primitives/checkbox/styles.ts +0 -128
- package/src/core/primitives/code/__workshop__/index.ts +0 -19
- package/src/core/primitives/code/__workshop__/opticalAlignment.tsx +0 -48
- package/src/core/primitives/code/__workshop__/props.tsx +0 -21
- package/src/core/primitives/code/code.tsx +0 -55
- package/src/core/primitives/code/index.ts +0 -1
- package/src/core/primitives/code/refractor.tsx +0 -20
- package/src/core/primitives/code/styles.ts +0 -77
- package/src/core/primitives/container/__workshop__/example.tsx +0 -20
- package/src/core/primitives/container/__workshop__/index.ts +0 -8
- package/src/core/primitives/container/container.tsx +0 -54
- package/src/core/primitives/container/index.ts +0 -2
- package/src/core/primitives/container/styles.ts +0 -23
- package/src/core/primitives/container/types.ts +0 -6
- package/src/core/primitives/flex/__workshop__/example.tsx +0 -34
- package/src/core/primitives/flex/__workshop__/gap.tsx +0 -25
- package/src/core/primitives/flex/__workshop__/index.ts +0 -11
- package/src/core/primitives/flex/flex.tsx +0 -64
- package/src/core/primitives/flex/index.ts +0 -1
- package/src/core/primitives/grid/__workshop__/index.ts +0 -10
- package/src/core/primitives/grid/__workshop__/responsive.tsx +0 -54
- package/src/core/primitives/grid/grid.test.tsx +0 -80
- package/src/core/primitives/grid/grid.tsx +0 -74
- package/src/core/primitives/grid/index.ts +0 -1
- package/src/core/primitives/heading/__workshop__/index.ts +0 -19
- package/src/core/primitives/heading/__workshop__/opticalAlignment.tsx +0 -54
- package/src/core/primitives/heading/__workshop__/plain.tsx +0 -32
- package/src/core/primitives/heading/heading.tsx +0 -88
- package/src/core/primitives/heading/index.ts +0 -1
- package/src/core/primitives/heading/styles.ts +0 -64
- package/src/core/primitives/heading/types.ts +0 -7
- package/src/core/primitives/index.ts +0 -27
- package/src/core/primitives/inline/__workshop__/index.ts +0 -8
- package/src/core/primitives/inline/__workshop__/plain.tsx +0 -27
- package/src/core/primitives/inline/index.ts +0 -1
- package/src/core/primitives/inline/inline.test.tsx +0 -51
- package/src/core/primitives/inline/inline.tsx +0 -63
- package/src/core/primitives/inline/styles.ts +0 -32
- package/src/core/primitives/inline/types.ts +0 -6
- package/src/core/primitives/kbd/__workshop__/index.ts +0 -8
- package/src/core/primitives/kbd/__workshop__/plain.tsx +0 -9
- package/src/core/primitives/kbd/index.ts +0 -1
- package/src/core/primitives/kbd/kbd.tsx +0 -69
- package/src/core/primitives/label/__workshop__/index.ts +0 -19
- package/src/core/primitives/label/__workshop__/opticalAlignment.tsx +0 -48
- package/src/core/primitives/label/__workshop__/plain.tsx +0 -24
- package/src/core/primitives/label/index.ts +0 -1
- package/src/core/primitives/label/label.tsx +0 -87
- package/src/core/primitives/label/styles.ts +0 -45
- package/src/core/primitives/popover/__workshop__/AlignedStory.tsx +0 -77
- package/src/core/primitives/popover/__workshop__/MarginsStory.tsx +0 -31
- package/src/core/primitives/popover/__workshop__/MatchReferenceWidthStory.tsx +0 -32
- package/src/core/primitives/popover/__workshop__/OpenOnMountStory.tsx +0 -11
- package/src/core/primitives/popover/__workshop__/PlainStory.tsx +0 -71
- package/src/core/primitives/popover/__workshop__/RecursiveStory.tsx +0 -71
- package/src/core/primitives/popover/__workshop__/SidePanelStory.tsx +0 -89
- package/src/core/primitives/popover/__workshop__/TestStory.tsx +0 -97
- package/src/core/primitives/popover/__workshop__/index.ts +0 -49
- package/src/core/primitives/popover/constants.ts +0 -22
- package/src/core/primitives/popover/floating-ui/size.ts +0 -99
- package/src/core/primitives/popover/helpers.ts +0 -31
- package/src/core/primitives/popover/index.ts +0 -2
- package/src/core/primitives/popover/popover.tsx +0 -511
- package/src/core/primitives/popover/popoverCard.tsx +0 -166
- package/src/core/primitives/popover/types.ts +0 -7
- package/src/core/primitives/radio/__workshop__/example.tsx +0 -63
- package/src/core/primitives/radio/__workshop__/index.ts +0 -11
- package/src/core/primitives/radio/__workshop__/plain.tsx +0 -28
- package/src/core/primitives/radio/index.ts +0 -1
- package/src/core/primitives/radio/radio.tsx +0 -51
- package/src/core/primitives/radio/styles.ts +0 -117
- package/src/core/primitives/select/__workshop__/index.ts +0 -11
- package/src/core/primitives/select/__workshop__/plain.tsx +0 -27
- package/src/core/primitives/select/__workshop__/readOnly.tsx +0 -23
- package/src/core/primitives/select/index.ts +0 -1
- package/src/core/primitives/select/select.test.tsx +0 -52
- package/src/core/primitives/select/select.tsx +0 -94
- package/src/core/primitives/select/styles.ts +0 -166
- package/src/core/primitives/spinner/__workshop__/Props.tsx +0 -15
- package/src/core/primitives/spinner/__workshop__/index.ts +0 -14
- package/src/core/primitives/spinner/index.ts +0 -1
- package/src/core/primitives/spinner/spinner.tsx +0 -46
- package/src/core/primitives/stack/__workshop__/index.ts +0 -14
- package/src/core/primitives/stack/__workshop__/plain.tsx +0 -32
- package/src/core/primitives/stack/index.ts +0 -1
- package/src/core/primitives/stack/stack.test.tsx +0 -57
- package/src/core/primitives/stack/stack.tsx +0 -57
- package/src/core/primitives/stack/styles.ts +0 -32
- package/src/core/primitives/switch/__workshop__/example.tsx +0 -23
- package/src/core/primitives/switch/__workshop__/index.ts +0 -11
- package/src/core/primitives/switch/__workshop__/props.tsx +0 -21
- package/src/core/primitives/switch/index.ts +0 -1
- package/src/core/primitives/switch/styles.ts +0 -173
- package/src/core/primitives/switch/switch.tsx +0 -68
- package/src/core/primitives/text/__workshop__/colored.tsx +0 -30
- package/src/core/primitives/text/__workshop__/example.tsx +0 -39
- package/src/core/primitives/text/__workshop__/index.ts +0 -24
- package/src/core/primitives/text/__workshop__/opticalAlignment.tsx +0 -48
- package/src/core/primitives/text/index.ts +0 -1
- package/src/core/primitives/text/styles.ts +0 -74
- package/src/core/primitives/text/text.tsx +0 -89
- package/src/core/primitives/textArea/__workshop__/index.ts +0 -14
- package/src/core/primitives/textArea/__workshop__/plain.tsx +0 -50
- package/src/core/primitives/textArea/index.ts +0 -1
- package/src/core/primitives/textArea/textArea.tsx +0 -120
- package/src/core/primitives/textInput/__workshop__/clearButton.tsx +0 -30
- package/src/core/primitives/textInput/__workshop__/customValidity.tsx +0 -17
- package/src/core/primitives/textInput/__workshop__/index.ts +0 -44
- package/src/core/primitives/textInput/__workshop__/plain.tsx +0 -98
- package/src/core/primitives/textInput/__workshop__/readOnly.tsx +0 -9
- package/src/core/primitives/textInput/__workshop__/states.tsx +0 -53
- package/src/core/primitives/textInput/__workshop__/tones.tsx +0 -277
- package/src/core/primitives/textInput/__workshop__/typed.tsx +0 -23
- package/src/core/primitives/textInput/index.ts +0 -1
- package/src/core/primitives/textInput/textInput.test.tsx +0 -48
- package/src/core/primitives/textInput/textInput.tsx +0 -395
- package/src/core/primitives/tooltip/__workshop__/customPortal.tsx +0 -102
- package/src/core/primitives/tooltip/__workshop__/index.ts +0 -29
- package/src/core/primitives/tooltip/__workshop__/overflowingBoundary.tsx +0 -74
- package/src/core/primitives/tooltip/__workshop__/props.tsx +0 -107
- package/src/core/primitives/tooltip/__workshop__/resizableBoundary.tsx +0 -86
- package/src/core/primitives/tooltip/constants.ts +0 -23
- package/src/core/primitives/tooltip/index.ts +0 -2
- package/src/core/primitives/tooltip/tooltip.test.tsx +0 -452
- package/src/core/primitives/tooltip/tooltip.tsx +0 -495
- package/src/core/primitives/tooltip/tooltipCard.tsx +0 -109
- package/src/core/primitives/tooltip/tooltipDelayGroup/index.ts +0 -4
- package/src/core/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupContext.tsx +0 -11
- package/src/core/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupProvider.tsx +0 -57
- package/src/core/primitives/tooltip/tooltipDelayGroup/types.ts +0 -10
- package/src/core/primitives/tooltip/tooltipDelayGroup/useTooltipDelayGroup.ts +0 -13
- package/src/core/primitives/types.ts +0 -179
- package/src/core/styles/border/borderStyle.ts +0 -56
- package/src/core/styles/border/index.ts +0 -2
- package/src/core/styles/border/types.ts +0 -10
- package/src/core/styles/box/boxStyle.ts +0 -69
- package/src/core/styles/box/index.ts +0 -2
- package/src/core/styles/box/types.ts +0 -11
- package/src/core/styles/card/_cardColorStyle.ts +0 -108
- package/src/core/styles/card/index.ts +0 -1
- package/src/core/styles/flex/flexItemStyle.ts +0 -27
- package/src/core/styles/flex/flexStyle.ts +0 -70
- package/src/core/styles/flex/index.ts +0 -3
- package/src/core/styles/flex/types.ts +0 -25
- package/src/core/styles/focusRing/index.ts +0 -25
- package/src/core/styles/font/codeFontStyle.ts +0 -13
- package/src/core/styles/font/headingFontStyle.ts +0 -13
- package/src/core/styles/font/index.ts +0 -6
- package/src/core/styles/font/labelFontStyle.ts +0 -13
- package/src/core/styles/font/responsiveFont.ts +0 -103
- package/src/core/styles/font/textAlignStyle.ts +0 -19
- package/src/core/styles/font/textFontStyle.ts +0 -13
- package/src/core/styles/font/types.ts +0 -35
- package/src/core/styles/grid/gridItemStyle.ts +0 -82
- package/src/core/styles/grid/gridStyle.ts +0 -108
- package/src/core/styles/grid/index.ts +0 -3
- package/src/core/styles/grid/types.ts +0 -37
- package/src/core/styles/helpers.ts +0 -72
- package/src/core/styles/index.ts +0 -5
- package/src/core/styles/input/index.ts +0 -2
- package/src/core/styles/input/responsiveInputPaddingStyle.ts +0 -78
- package/src/core/styles/input/textInputStyle.ts +0 -263
- package/src/core/styles/internal.ts +0 -12
- package/src/core/styles/margin/index.ts +0 -2
- package/src/core/styles/margin/marginStyle.ts +0 -21
- package/src/core/styles/margin/marginsStyle.test.ts +0 -33
- package/src/core/styles/margin/types.ts +0 -9
- package/src/core/styles/padding/index.ts +0 -2
- package/src/core/styles/padding/paddingStyle.test.ts +0 -33
- package/src/core/styles/padding/paddingStyle.ts +0 -21
- package/src/core/styles/padding/types.ts +0 -12
- package/src/core/styles/radius/index.ts +0 -2
- package/src/core/styles/radius/radiusStyle.ts +0 -23
- package/src/core/styles/radius/types.ts +0 -8
- package/src/core/styles/shadow/index.ts +0 -2
- package/src/core/styles/shadow/shadowStyle.ts +0 -29
- package/src/core/styles/shadow/types.ts +0 -6
- package/src/core/styles/types.ts +0 -8
- package/src/core/theme/__workshop__/build/Root.tsx +0 -367
- package/src/core/theme/__workshop__/build/helpers.ts +0 -46
- package/src/core/theme/__workshop__/build/story.tsx +0 -465
- package/src/core/theme/__workshop__/canvas.tsx +0 -352
- package/src/core/theme/__workshop__/color.tsx +0 -62
- package/src/core/theme/__workshop__/debug/story.tsx +0 -408
- package/src/core/theme/__workshop__/index.ts +0 -39
- package/src/core/theme/__workshop__/layer.tsx +0 -78
- package/src/core/theme/__workshop__/nestedProvider.tsx +0 -15
- package/src/core/theme/index.ts +0 -5
- package/src/core/theme/theme.test.tsx +0 -73
- package/src/core/theme/themeColorProvider.tsx +0 -29
- package/src/core/theme/themeContext.ts +0 -10
- package/src/core/theme/themeProvider.tsx +0 -62
- package/src/core/theme/types.ts +0 -12
- package/src/core/theme/useRootTheme.ts +0 -17
- package/src/core/theme/useTheme.ts +0 -16
- package/src/core/types/avatar.ts +0 -14
- package/src/core/types/badge.ts +0 -12
- package/src/core/types/box.ts +0 -19
- package/src/core/types/button.ts +0 -21
- package/src/core/types/card.ts +0 -6
- package/src/core/types/component.ts +0 -32
- package/src/core/types/dialog.ts +0 -4
- package/src/core/types/flex.ts +0 -30
- package/src/core/types/grid.ts +0 -14
- package/src/core/types/gridItem.ts +0 -29
- package/src/core/types/index.ts +0 -15
- package/src/core/types/placement.ts +0 -18
- package/src/core/types/popover.ts +0 -4
- package/src/core/types/radius.ts +0 -4
- package/src/core/types/selectable.ts +0 -6
- package/src/core/types/text.ts +0 -4
- package/src/core/utils/arrow/arrow.tsx +0 -123
- package/src/core/utils/arrow/cmds.ts +0 -91
- package/src/core/utils/arrow/index.ts +0 -1
- package/src/core/utils/boundaryElement/__workshop__/index.ts +0 -14
- package/src/core/utils/boundaryElement/__workshop__/plain.tsx +0 -19
- package/src/core/utils/boundaryElement/boundaryElement.test.tsx +0 -100
- package/src/core/utils/boundaryElement/boundaryElementContext.ts +0 -7
- package/src/core/utils/boundaryElement/boundaryElementProvider.tsx +0 -24
- package/src/core/utils/boundaryElement/index.ts +0 -3
- package/src/core/utils/boundaryElement/types.ts +0 -7
- package/src/core/utils/boundaryElement/useBoundaryElement.ts +0 -26
- package/src/core/utils/conditionalWrapper/conditionalWrapper.tsx +0 -21
- package/src/core/utils/conditionalWrapper/index.ts +0 -1
- package/src/core/utils/elementQuery/__workshop__/customMedia.tsx +0 -30
- package/src/core/utils/elementQuery/__workshop__/index.ts +0 -14
- package/src/core/utils/elementQuery/elementQuery.tsx +0 -53
- package/src/core/utils/elementQuery/helpers.ts +0 -27
- package/src/core/utils/elementQuery/index.ts +0 -1
- package/src/core/utils/errorBoundary.tsx +0 -48
- package/src/core/utils/getElementRef.ts +0 -26
- package/src/core/utils/index.ts +0 -9
- package/src/core/utils/layer/__workshop__/_debug.tsx +0 -17
- package/src/core/utils/layer/__workshop__/index.ts +0 -24
- package/src/core/utils/layer/__workshop__/multipleRoots.tsx +0 -49
- package/src/core/utils/layer/__workshop__/nested.tsx +0 -98
- package/src/core/utils/layer/__workshop__/responsiveZOffset.tsx +0 -13
- package/src/core/utils/layer/getLayerContext.test.ts +0 -30
- package/src/core/utils/layer/getLayerContext.ts +0 -21
- package/src/core/utils/layer/index.ts +0 -4
- package/src/core/utils/layer/layer.test.tsx +0 -108
- package/src/core/utils/layer/layer.tsx +0 -98
- package/src/core/utils/layer/layerContext.ts +0 -7
- package/src/core/utils/layer/layerProvider.tsx +0 -111
- package/src/core/utils/layer/types.ts +0 -9
- package/src/core/utils/layer/useLayer.ts +0 -26
- package/src/core/utils/portal/__workshop__/index.ts +0 -14
- package/src/core/utils/portal/__workshop__/named.tsx +0 -63
- package/src/core/utils/portal/index.ts +0 -4
- package/src/core/utils/portal/portal.test.tsx +0 -103
- package/src/core/utils/portal/portal.ts +0 -32
- package/src/core/utils/portal/portalContext.ts +0 -31
- package/src/core/utils/portal/portalProvider.tsx +0 -47
- package/src/core/utils/portal/types.ts +0 -9
- package/src/core/utils/portal/usePortal.ts +0 -25
- package/src/core/utils/spanWithTextOverflow.tsx +0 -10
- package/src/core/utils/srOnly/index.ts +0 -1
- package/src/core/utils/srOnly/srOnly.tsx +0 -36
- package/src/core/utils/virtualList/__workshop__/changingProps.tsx +0 -36
- package/src/core/utils/virtualList/__workshop__/elementScroll.tsx +0 -24
- package/src/core/utils/virtualList/__workshop__/index.ts +0 -29
- package/src/core/utils/virtualList/__workshop__/infiniteList.tsx +0 -48
- package/src/core/utils/virtualList/__workshop__/windowScrolll.tsx +0 -22
- package/src/core/utils/virtualList/index.ts +0 -1
- package/src/core/utils/virtualList/virtualList.tsx +0 -200
- package/src/theme/build/_deprecated/color/_selectable/createSelectableTones.ts +0 -76
- package/src/theme/build/_deprecated/color/_solid/createSolidTones.ts +0 -54
- package/src/theme/build/_deprecated/color/button/createButtonModes.ts +0 -22
- package/src/theme/build/_deprecated/color/button/createButtonTones.ts +0 -55
- package/src/theme/build/_deprecated/color/card/createCardStates.ts +0 -60
- package/src/theme/build/_deprecated/color/color.test.ts +0 -63
- package/src/theme/build/_deprecated/color/defaults.ts +0 -390
- package/src/theme/build/_deprecated/color/factory.ts +0 -142
- package/src/theme/build/_deprecated/color/index.ts +0 -1
- package/src/theme/build/_deprecated/color/input/createInputModes.ts +0 -81
- package/src/theme/build/_deprecated/color/muted/createMuted.ts +0 -54
- package/src/theme/build/_deprecated/color/spot/createSpot.ts +0 -20
- package/src/theme/build/buildColorTheme.test.ts +0 -183
- package/src/theme/build/buildColorTheme.ts +0 -499
- package/src/theme/build/buildTheme.test.ts +0 -87
- package/src/theme/build/buildTheme.ts +0 -36
- package/src/theme/build/colorToken/colorToken.ts +0 -19
- package/src/theme/build/colorToken/compileColorToken.ts +0 -21
- package/src/theme/build/colorToken/index.ts +0 -2
- package/src/theme/build/colorToken/types.ts +0 -6
- package/src/theme/build/index.ts +0 -3
- package/src/theme/build/lib/color-fns/blend/index.ts +0 -3
- package/src/theme/build/lib/color-fns/blend/mix.ts +0 -21
- package/src/theme/build/lib/color-fns/blend/multiply.ts +0 -18
- package/src/theme/build/lib/color-fns/blend/screen.ts +0 -18
- package/src/theme/build/lib/color-fns/color-fns.test.ts +0 -68
- package/src/theme/build/lib/color-fns/contrastRatio.ts +0 -31
- package/src/theme/build/lib/color-fns/convert.ts +0 -150
- package/src/theme/build/lib/color-fns/index.ts +0 -6
- package/src/theme/build/lib/color-fns/parse.ts +0 -60
- package/src/theme/build/lib/color-fns/rgba.ts +0 -10
- package/src/theme/build/lib/color-fns/types.ts +0 -28
- package/src/theme/build/lib/isRecord.ts +0 -3
- package/src/theme/build/lib/lazy.ts +0 -30
- package/src/theme/build/lib/utils.ts +0 -19
- package/src/theme/build/merge.ts +0 -26
- package/src/theme/build/mixThemeColor.test.ts +0 -21
- package/src/theme/build/mixThemeColor.ts +0 -53
- package/src/theme/build/renderColorTheme.ts +0 -532
- package/src/theme/build/renderColorValue.ts +0 -85
- package/src/theme/build/resolveColorTokens.ts +0 -268
- package/src/theme/build/theme.test.ts +0 -27
- package/src/theme/config/helpers.ts +0 -55
- package/src/theme/config/index.ts +0 -4
- package/src/theme/config/system.ts +0 -115
- package/src/theme/config/tokens/color/index.ts +0 -1
- package/src/theme/config/tokens/color/types.ts +0 -133
- package/src/theme/config/tokens/index.ts +0 -4
- package/src/theme/config/tokens/parseTokenKey.test.ts +0 -64
- package/src/theme/config/tokens/parseTokenKey.ts +0 -67
- package/src/theme/config/tokens/parseTokenValue.test.ts +0 -42
- package/src/theme/config/tokens/parseTokenValue.ts +0 -133
- package/src/theme/config/tokens/types.ts +0 -53
- package/src/theme/config/types.ts +0 -46
- package/src/theme/defaults/colorPalette.ts +0 -5
- package/src/theme/defaults/colorTokens.ts +0 -648
- package/src/theme/defaults/config.ts +0 -84
- package/src/theme/defaults/fonts.ts +0 -227
- package/src/theme/getScopedTheme.ts +0 -98
- package/src/theme/index.ts +0 -5
- package/src/theme/system/avatar.ts +0 -14
- package/src/theme/system/color/_constants.ts +0 -45
- package/src/theme/system/color/_helpers.ts +0 -24
- package/src/theme/system/color/_system.ts +0 -40
- package/src/theme/system/color/avatar.ts +0 -15
- package/src/theme/system/color/badge.ts +0 -16
- package/src/theme/system/color/button.ts +0 -17
- package/src/theme/system/color/color.ts +0 -34
- package/src/theme/system/color/index.ts +0 -13
- package/src/theme/system/color/input.ts +0 -25
- package/src/theme/system/color/kbd.ts +0 -8
- package/src/theme/system/color/selectable.ts +0 -12
- package/src/theme/system/color/shadow.ts +0 -7
- package/src/theme/system/color/state.ts +0 -43
- package/src/theme/system/color/syntax.ts +0 -41
- package/src/theme/system/css.ts +0 -14
- package/src/theme/system/focusRing.ts +0 -7
- package/src/theme/system/font.ts +0 -52
- package/src/theme/system/index.ts +0 -11
- package/src/theme/system/input.ts +0 -33
- package/src/theme/system/layer.ts +0 -8
- package/src/theme/system/shadow.ts +0 -19
- package/src/theme/system/styles.ts +0 -13
- package/src/theme/system/theme.ts +0 -138
- package/src/theme/system/v0/avatar.ts +0 -10
- package/src/theme/system/v0/color/_generic.ts +0 -35
- package/src/theme/system/v0/color/_system.ts +0 -17
- package/src/theme/system/v0/color/base.ts +0 -21
- package/src/theme/system/v0/color/button.ts +0 -42
- package/src/theme/system/v0/color/card.ts +0 -19
- package/src/theme/system/v0/color/color.ts +0 -40
- package/src/theme/system/v0/color/index.ts +0 -11
- package/src/theme/system/v0/color/input.ts +0 -34
- package/src/theme/system/v0/color/muted.ts +0 -26
- package/src/theme/system/v0/color/selectable.ts +0 -31
- package/src/theme/system/v0/color/solid.ts +0 -26
- package/src/theme/system/v0/color/spot.ts +0 -13
- package/src/theme/system/v0/index.ts +0 -3
- package/src/theme/system/v0/input.ts +0 -23
- package/src/theme/versioning/getTheme_v2.ts +0 -57
- package/src/theme/versioning/index.ts +0 -5
- package/src/theme/versioning/is_v0.ts +0 -6
- package/src/theme/versioning/is_v2.ts +0 -6
- package/src/theme/versioning/themeColor_v0_v2.ts +0 -243
- package/src/theme/versioning/themeColor_v2_v2_9.ts +0 -49
- package/src/theme/versioning/v0_v2.ts +0 -94
- package/src/theme/versioning/v2_v0.ts +0 -135
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* <SchemaForm> — the BetterCMS Block Kit form engine (V2 HEAD 9829bf1 kit/engine/schema-form.tsx). One schema in, one
|
|
3
|
+
* value out; renders through the shared field chrome; owns validation visibility, per-field undo + history (coalesced
|
|
4
|
+
* 900ms, 50 steps), the published baseline (changed dots, Reset to published) and the navigation path.
|
|
5
|
+
*
|
|
6
|
+
* <SchemaForm schema={faq} value={v} onChange={setV} variant="panel" />
|
|
7
|
+
*
|
|
8
|
+
* `path` is controllable so a canvas can sync selection <-> breadcrumb both ways. Frames (root, drilled object, array
|
|
9
|
+
* item, slot block, button, history) come from lib/frames `resolveFrames`; the drill-in stage, crumbs and keys
|
|
10
|
+
* (Esc / Alt+Up/Down) from frame.tsx and breadcrumb.tsx; the layout of each frame from grouping.tsx through field-list.
|
|
11
|
+
*
|
|
12
|
+
* The host provides the kit scope (`data-kit-scope`) around the form; the form never declares one of its own, so a
|
|
13
|
+
* dark host scope is never reset to light inside it.
|
|
14
|
+
*/
|
|
15
|
+
import * as React from "react";
|
|
16
|
+
import type { FieldPath, TypeSchema } from "../schema/types";
|
|
17
|
+
import { type KitEnv, type KitPeer, type Swatch } from "../context";
|
|
18
|
+
import { type KitIssue } from "../lib/validate";
|
|
19
|
+
import { type KitCrumb } from "./breadcrumb";
|
|
20
|
+
export interface SchemaFormProps {
|
|
21
|
+
schema: TypeSchema;
|
|
22
|
+
value: Record<string, unknown>;
|
|
23
|
+
onChange: (value: Record<string, unknown>) => void;
|
|
24
|
+
/** controlled navigation path ([] = root). Omit for uncontrolled. */
|
|
25
|
+
path?: FieldPath;
|
|
26
|
+
defaultPath?: FieldPath;
|
|
27
|
+
onPathChange?: (path: FieldPath) => void;
|
|
28
|
+
/** "panel" = 320–420px inspector; "document" = the wide document editor column */
|
|
29
|
+
variant?: "panel" | "document";
|
|
30
|
+
/** resolve a block type (slot children) to its schema */
|
|
31
|
+
resolveSchema?: (blockType: string) => TypeSchema | undefined;
|
|
32
|
+
/** blocks offered by "+ Add block" (filtered by each slot's allow list) */
|
|
33
|
+
blockLibrary?: TypeSchema[];
|
|
34
|
+
/** the published version: enables changed dots and "Reset to published" */
|
|
35
|
+
published?: Record<string, unknown>;
|
|
36
|
+
/**
|
|
37
|
+
* Component instance (CPO D28): values come from `from` unless a top-level key is in `overridden`. Overridden fields
|
|
38
|
+
* get an accent dot + "Reset"; inherited ones read muted. `onReset(key)` drops one override.
|
|
39
|
+
*/
|
|
40
|
+
inherited?: {
|
|
41
|
+
from: string;
|
|
42
|
+
overridden: string[];
|
|
43
|
+
onReset: (key: string) => void;
|
|
44
|
+
};
|
|
45
|
+
/** pathKey → teammates in that field ("items.1.answer") */
|
|
46
|
+
presence?: Record<string, KitPeer | KitPeer[]>;
|
|
47
|
+
/** pathKey → open comment threads */
|
|
48
|
+
comments?: Record<string, number>;
|
|
49
|
+
/** host comment system. When set, the field comment chip opens the host's popover/panel instead of the kit's. */
|
|
50
|
+
onComment?: KitEnv["onComment"];
|
|
51
|
+
/** "Open {title}" on a reference: the host opens the referenced entry (e.g. a stacked panel) */
|
|
52
|
+
onOpenReference?: KitEnv["onOpenReference"];
|
|
53
|
+
/** the whole form is read-only for the lens (fields with their own `access.edit` still follow `env.can`) */
|
|
54
|
+
readOnly?: boolean;
|
|
55
|
+
/** validate everything now (after a publish attempt) */
|
|
56
|
+
showErrors?: boolean;
|
|
57
|
+
/** document identity + site context */
|
|
58
|
+
env?: {
|
|
59
|
+
docId?: string;
|
|
60
|
+
docTitle?: string;
|
|
61
|
+
urlPrefix?: string;
|
|
62
|
+
isPublished?: boolean;
|
|
63
|
+
palette?: Swatch[];
|
|
64
|
+
syncedFrom?: string;
|
|
65
|
+
/** D58: the host's access check (`useCan` at the host). Omitted → allow-all (staff tools, demos). */
|
|
66
|
+
can?: KitEnv["can"];
|
|
67
|
+
/** CPO D39: "tooltip" moves help lines behind the ⓘ (dense hosts) */
|
|
68
|
+
helpDisplay?: KitEnv["helpDisplay"];
|
|
69
|
+
};
|
|
70
|
+
/** own scroll container (default: panel yes, document no) */
|
|
71
|
+
scroll?: boolean;
|
|
72
|
+
/** rendered above the breadcrumb (e.g. a block header) */
|
|
73
|
+
header?: React.ReactNode;
|
|
74
|
+
/** label of the root crumb (defaults to schema.title) */
|
|
75
|
+
rootLabel?: string;
|
|
76
|
+
/**
|
|
77
|
+
* Host-owned trail (CPO D38): the form stops rendering its own breadcrumb and reports the drill-in crumbs
|
|
78
|
+
* instead, so a host with its own path header shows ONE breadcrumb. Navigate with `onPathChange`. Called in a
|
|
79
|
+
* layout effect, so the host header never lags a frame.
|
|
80
|
+
*/
|
|
81
|
+
onCrumbs?: (crumbs: KitCrumb[]) => void;
|
|
82
|
+
onIssuesChange?: (issues: KitIssue[]) => void;
|
|
83
|
+
/** imperative navigation for hosts (e.g. a dialog's Escape: go up one level before closing) */
|
|
84
|
+
navRef?: React.Ref<{
|
|
85
|
+
back: () => boolean;
|
|
86
|
+
}>;
|
|
87
|
+
className?: string;
|
|
88
|
+
}
|
|
89
|
+
export declare const COALESCE_MS = 900;
|
|
90
|
+
export declare const UNDO_STEPS = 50;
|
|
91
|
+
export declare function SchemaForm({ schema: schemaIn, value, onChange, path: controlledPath, defaultPath, onPathChange, variant, resolveSchema: resolveIn, blockLibrary, published, inherited, presence, comments, onComment, onOpenReference, readOnly, showErrors, env: envIn, scroll, header, rootLabel, onCrumbs, onIssuesChange, navRef, className, }: SchemaFormProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
import { cn } from "../lib/cn.js";
|
|
2
|
+
import { getIn, isObj, keyStartsWith, pathEq, pathKey, same, setIn } from "../lib/path.js";
|
|
3
|
+
import { DEFAULT_ENV, FormProvider, KitEnvProvider, useKitEnv, visibleSchema } from "../context.js";
|
|
4
|
+
import { collectIssues } from "../lib/validate.js";
|
|
5
|
+
import { FieldSection } from "./grouping.js";
|
|
6
|
+
import { ButtonScreen } from "../controls/button.js";
|
|
7
|
+
import { FieldList } from "./field-list.js";
|
|
8
|
+
import { RowsHostContext } from "./array.js";
|
|
9
|
+
import { resolveFrames } from "../lib/frames.js";
|
|
10
|
+
import { FrameCrumbs, crumbSignature, framesToCrumbs } from "./breadcrumb.js";
|
|
11
|
+
import { FrameSlotsProvider, FrameStage, useFrameNavigation } from "./frame.js";
|
|
12
|
+
import { TableFrame } from "../controls/table/table.js";
|
|
13
|
+
import { NestedForm } from "./kit-field.js";
|
|
14
|
+
import * as React from "react";
|
|
15
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
16
|
+
//#region src/kit/engine/schema-form.tsx
|
|
17
|
+
/**
|
|
18
|
+
* <SchemaForm> — the BetterCMS Block Kit form engine (V2 HEAD 9829bf1 kit/engine/schema-form.tsx). One schema in, one
|
|
19
|
+
* value out; renders through the shared field chrome; owns validation visibility, per-field undo + history (coalesced
|
|
20
|
+
* 900ms, 50 steps), the published baseline (changed dots, Reset to published) and the navigation path.
|
|
21
|
+
*
|
|
22
|
+
* <SchemaForm schema={faq} value={v} onChange={setV} variant="panel" />
|
|
23
|
+
*
|
|
24
|
+
* `path` is controllable so a canvas can sync selection <-> breadcrumb both ways. Frames (root, drilled object, array
|
|
25
|
+
* item, slot block, button, history) come from lib/frames `resolveFrames`; the drill-in stage, crumbs and keys
|
|
26
|
+
* (Esc / Alt+Up/Down) from frame.tsx and breadcrumb.tsx; the layout of each frame from grouping.tsx through field-list.
|
|
27
|
+
*
|
|
28
|
+
* The host provides the kit scope (`data-kit-scope`) around the form; the form never declares one of its own, so a
|
|
29
|
+
* dark host scope is never reset to light inside it.
|
|
30
|
+
*/
|
|
31
|
+
var COALESCE_MS = 900;
|
|
32
|
+
var UNDO_STEPS = 50;
|
|
33
|
+
var HISTORY_ENTRIES = 30;
|
|
34
|
+
var buttonLabel = (v) => ({ label: isObj(v) && typeof v.label === "string" ? v.label : void 0 });
|
|
35
|
+
var FRAME_SLOTS = {
|
|
36
|
+
get FieldList() {
|
|
37
|
+
return FieldList;
|
|
38
|
+
},
|
|
39
|
+
get FieldSection() {
|
|
40
|
+
return FieldSection;
|
|
41
|
+
},
|
|
42
|
+
get TableFrame() {
|
|
43
|
+
return TableFrame;
|
|
44
|
+
},
|
|
45
|
+
get ButtonScreen() {
|
|
46
|
+
return ButtonScreen;
|
|
47
|
+
},
|
|
48
|
+
normLink: buttonLabel
|
|
49
|
+
};
|
|
50
|
+
var ROWS_HOST = { get NestedForm() {
|
|
51
|
+
return NestedForm;
|
|
52
|
+
} };
|
|
53
|
+
function SchemaForm({ schema: schemaIn, value, onChange, path: controlledPath, defaultPath, onPathChange, variant = "panel", resolveSchema: resolveIn, blockLibrary, published, inherited, presence, comments, onComment, onOpenReference, readOnly, showErrors = false, env: envIn, scroll, header, rootLabel, onCrumbs, onIssuesChange, navRef, className }) {
|
|
54
|
+
const outerCan = useKitEnv().can;
|
|
55
|
+
const can = envIn?.can ?? outerCan;
|
|
56
|
+
const schema = React.useMemo(() => visibleSchema(schemaIn, can), [schemaIn, can]);
|
|
57
|
+
const resolveSchema = React.useMemo(() => resolveIn ? (t) => {
|
|
58
|
+
const s = resolveIn(t);
|
|
59
|
+
return s && visibleSchema(s, can);
|
|
60
|
+
} : void 0, [resolveIn, can]);
|
|
61
|
+
const docId = envIn?.docId ?? schema.name;
|
|
62
|
+
const ownScroll = scroll ?? variant === "panel";
|
|
63
|
+
const valueRef = React.useRef(value);
|
|
64
|
+
valueRef.current = value;
|
|
65
|
+
const [baseline, setBaseline] = React.useState(value);
|
|
66
|
+
const stacks = React.useRef(/* @__PURE__ */ new Map());
|
|
67
|
+
const log = React.useRef(/* @__PURE__ */ new Map());
|
|
68
|
+
const memory = React.useRef(/* @__PURE__ */ new Map());
|
|
69
|
+
const [aiKeys, setAiKeys] = React.useState(() => /* @__PURE__ */ new Set());
|
|
70
|
+
const [touched, setTouched] = React.useState(() => /* @__PURE__ */ new Set());
|
|
71
|
+
const editing = React.useRef(/* @__PURE__ */ new Set());
|
|
72
|
+
const [, bump] = React.useReducer((x) => x + 1, 0);
|
|
73
|
+
React.useEffect(() => {
|
|
74
|
+
setBaseline(valueRef.current);
|
|
75
|
+
stacks.current.clear();
|
|
76
|
+
log.current.clear();
|
|
77
|
+
memory.current.clear();
|
|
78
|
+
setTouched(/* @__PURE__ */ new Set());
|
|
79
|
+
setAiKeys(/* @__PURE__ */ new Set());
|
|
80
|
+
}, [docId]);
|
|
81
|
+
const [innerPath, setInnerPath] = React.useState(defaultPath ?? []);
|
|
82
|
+
const rawPath = controlledPath ?? innerPath;
|
|
83
|
+
const { frames, path } = React.useMemo(() => resolveFrames(schema, value, rawPath, resolveSchema), [
|
|
84
|
+
schema,
|
|
85
|
+
value,
|
|
86
|
+
rawPath,
|
|
87
|
+
resolveSchema
|
|
88
|
+
]);
|
|
89
|
+
const navigate = React.useCallback((p) => {
|
|
90
|
+
if (controlledPath === void 0) setInnerPath(p);
|
|
91
|
+
onPathChange?.(p);
|
|
92
|
+
}, [controlledPath, onPathChange]);
|
|
93
|
+
React.useEffect(() => {
|
|
94
|
+
if (!pathEq(path, rawPath)) navigate(path);
|
|
95
|
+
}, [
|
|
96
|
+
path,
|
|
97
|
+
rawPath,
|
|
98
|
+
navigate
|
|
99
|
+
]);
|
|
100
|
+
const lastDoc = React.useRef(docId);
|
|
101
|
+
React.useEffect(() => {
|
|
102
|
+
if (lastDoc.current === docId) return;
|
|
103
|
+
lastDoc.current = docId;
|
|
104
|
+
if (controlledPath === void 0) setInnerPath([]);
|
|
105
|
+
}, [docId]);
|
|
106
|
+
const setAt = React.useCallback((p, v, opts) => {
|
|
107
|
+
const prev = getIn(valueRef.current, p);
|
|
108
|
+
if (same(prev, v)) return;
|
|
109
|
+
const key = pathKey(p);
|
|
110
|
+
if (opts?.record !== false) {
|
|
111
|
+
const now = Date.now();
|
|
112
|
+
const st = stacks.current.get(key) ?? {
|
|
113
|
+
path: p,
|
|
114
|
+
values: [],
|
|
115
|
+
at: 0
|
|
116
|
+
};
|
|
117
|
+
if (!st.values.length || now - st.at > 900) st.values = [...st.values, prev].slice(-50);
|
|
118
|
+
st.at = now;
|
|
119
|
+
stacks.current.set(key, st);
|
|
120
|
+
const h = log.current.get(key) ?? [];
|
|
121
|
+
const entry = {
|
|
122
|
+
value: v,
|
|
123
|
+
at: now,
|
|
124
|
+
by: "You",
|
|
125
|
+
label: opts?.label
|
|
126
|
+
};
|
|
127
|
+
log.current.set(key, h.length && now - h[0].at < 900 && !opts?.label ? [entry, ...h.slice(1)] : [entry, ...h].slice(0, HISTORY_ENTRIES));
|
|
128
|
+
editing.current.add(key);
|
|
129
|
+
}
|
|
130
|
+
const next = setIn(valueRef.current, p, v);
|
|
131
|
+
valueRef.current = next;
|
|
132
|
+
onChange(next);
|
|
133
|
+
}, [onChange]);
|
|
134
|
+
const issueList = React.useMemo(() => collectIssues(schema.fields, value, [], resolveSchema), [
|
|
135
|
+
schema,
|
|
136
|
+
value,
|
|
137
|
+
resolveSchema
|
|
138
|
+
]);
|
|
139
|
+
const issues = React.useMemo(() => new Map(issueList.map((i) => [i.key, i])), [issueList]);
|
|
140
|
+
React.useEffect(() => onIssuesChange?.(issueList), [issueList, onIssuesChange]);
|
|
141
|
+
const isVisible = React.useCallback((i) => showErrors || touched.has(i.key) || i.kind === "rule" && !editing.current.has(i.key), [showErrors, touched]);
|
|
142
|
+
const api = {
|
|
143
|
+
schema,
|
|
144
|
+
value,
|
|
145
|
+
setAt,
|
|
146
|
+
getAt: (p) => getIn(value, p),
|
|
147
|
+
baselineAt: (p) => getIn(baseline, p),
|
|
148
|
+
publishedAt: (p) => getIn(published, p),
|
|
149
|
+
hasPublished: !!published,
|
|
150
|
+
inherited: inherited ? {
|
|
151
|
+
from: inherited.from,
|
|
152
|
+
isOverridden: (k) => inherited.overridden.includes(k),
|
|
153
|
+
reset: inherited.onReset
|
|
154
|
+
} : void 0,
|
|
155
|
+
path,
|
|
156
|
+
navigate,
|
|
157
|
+
canNavigate: true,
|
|
158
|
+
resolveSchema,
|
|
159
|
+
blockLibrary,
|
|
160
|
+
issues,
|
|
161
|
+
visibleIssue: (k) => {
|
|
162
|
+
const i = issues.get(k);
|
|
163
|
+
return i && isVisible(i) ? i : void 0;
|
|
164
|
+
},
|
|
165
|
+
rollup: (prefix) => {
|
|
166
|
+
const pk = pathKey(prefix);
|
|
167
|
+
let errors = 0;
|
|
168
|
+
let warnings = 0;
|
|
169
|
+
for (const i of issueList) if (keyStartsWith(i.key, pk) && isVisible(i)) i.level === "error" ? errors++ : warnings++;
|
|
170
|
+
return {
|
|
171
|
+
errors,
|
|
172
|
+
warnings
|
|
173
|
+
};
|
|
174
|
+
},
|
|
175
|
+
touch: (k) => {
|
|
176
|
+
editing.current.delete(k);
|
|
177
|
+
if (!touched.has(k)) setTouched((s) => new Set(s).add(k));
|
|
178
|
+
},
|
|
179
|
+
showAllErrors: showErrors,
|
|
180
|
+
canUndo: (k) => !!stacks.current.get(k)?.values.length,
|
|
181
|
+
undo: (k) => {
|
|
182
|
+
const st = stacks.current.get(k);
|
|
183
|
+
if (!st?.values.length) return;
|
|
184
|
+
const prev = st.values[st.values.length - 1];
|
|
185
|
+
st.values = st.values.slice(0, -1);
|
|
186
|
+
st.at = 0;
|
|
187
|
+
const next = setIn(valueRef.current, st.path, prev);
|
|
188
|
+
valueRef.current = next;
|
|
189
|
+
onChange(next);
|
|
190
|
+
bump();
|
|
191
|
+
},
|
|
192
|
+
history: (k) => log.current.get(k) ?? [],
|
|
193
|
+
aiKeys,
|
|
194
|
+
markAi: (k, on) => setAiKeys((s) => {
|
|
195
|
+
const n = new Set(s);
|
|
196
|
+
if (on) n.add(k);
|
|
197
|
+
else n.delete(k);
|
|
198
|
+
return n;
|
|
199
|
+
}),
|
|
200
|
+
memory: memory.current
|
|
201
|
+
};
|
|
202
|
+
const normPresence = React.useMemo(() => {
|
|
203
|
+
const out = {};
|
|
204
|
+
for (const [k, v] of Object.entries(presence ?? {})) out[k] = Array.isArray(v) ? v : [v];
|
|
205
|
+
return out;
|
|
206
|
+
}, [presence]);
|
|
207
|
+
const env = React.useMemo(() => ({
|
|
208
|
+
...DEFAULT_ENV,
|
|
209
|
+
variant,
|
|
210
|
+
docId,
|
|
211
|
+
docTitle: envIn?.docTitle,
|
|
212
|
+
urlPrefix: envIn?.urlPrefix,
|
|
213
|
+
isPublished: envIn?.isPublished ?? (published ? true : void 0),
|
|
214
|
+
palette: envIn?.palette ?? DEFAULT_ENV.palette,
|
|
215
|
+
readOnly: !!readOnly,
|
|
216
|
+
can,
|
|
217
|
+
presence: normPresence,
|
|
218
|
+
comments: comments ?? {},
|
|
219
|
+
onComment,
|
|
220
|
+
onOpenReference,
|
|
221
|
+
syncedFrom: envIn?.syncedFrom,
|
|
222
|
+
helpDisplay: envIn?.helpDisplay
|
|
223
|
+
}), [
|
|
224
|
+
variant,
|
|
225
|
+
docId,
|
|
226
|
+
envIn?.docTitle,
|
|
227
|
+
envIn?.urlPrefix,
|
|
228
|
+
envIn?.isPublished,
|
|
229
|
+
envIn?.palette,
|
|
230
|
+
envIn?.syncedFrom,
|
|
231
|
+
envIn?.helpDisplay,
|
|
232
|
+
published,
|
|
233
|
+
readOnly,
|
|
234
|
+
can,
|
|
235
|
+
normPresence,
|
|
236
|
+
comments,
|
|
237
|
+
onComment,
|
|
238
|
+
onOpenReference
|
|
239
|
+
]);
|
|
240
|
+
React.useImperativeHandle(navRef, () => ({ back: () => {
|
|
241
|
+
if (frames.length < 2) return false;
|
|
242
|
+
navigate(frames[frames.length - 2].path);
|
|
243
|
+
return true;
|
|
244
|
+
} }), [frames, navigate]);
|
|
245
|
+
const root = React.useRef(null);
|
|
246
|
+
const scroller = React.useRef(null);
|
|
247
|
+
const nav = useFrameNavigation({
|
|
248
|
+
frames,
|
|
249
|
+
navigate,
|
|
250
|
+
root,
|
|
251
|
+
scroller
|
|
252
|
+
});
|
|
253
|
+
const crumbs = framesToCrumbs(frames, schema, api.rollup, rootLabel);
|
|
254
|
+
const crumbSig = crumbSignature(crumbs);
|
|
255
|
+
const onCrumbsRef = React.useRef(onCrumbs);
|
|
256
|
+
onCrumbsRef.current = onCrumbs;
|
|
257
|
+
React.useLayoutEffect(() => {
|
|
258
|
+
onCrumbsRef.current?.(crumbs);
|
|
259
|
+
}, [crumbSig]);
|
|
260
|
+
const syncedNote = envIn?.syncedFrom ? /* @__PURE__ */ jsxs("p", {
|
|
261
|
+
className: "mb-5 flex items-start gap-2 rounded-kit-lg bg-kit-info-soft px-3 py-2 text-kit-xs text-kit-info-fg",
|
|
262
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
263
|
+
className: "mt-0.5 size-1.5 shrink-0 rounded-full bg-kit-info",
|
|
264
|
+
"aria-hidden": true
|
|
265
|
+
}), /* @__PURE__ */ jsxs("span", { children: [
|
|
266
|
+
"Synced from ",
|
|
267
|
+
/* @__PURE__ */ jsx("span", {
|
|
268
|
+
className: "font-medium",
|
|
269
|
+
children: envIn.syncedFrom
|
|
270
|
+
}),
|
|
271
|
+
". Changes here apply on every page that uses it."
|
|
272
|
+
] })]
|
|
273
|
+
}) : null;
|
|
274
|
+
const body = /* @__PURE__ */ jsx(FrameStage, {
|
|
275
|
+
frames,
|
|
276
|
+
frameKey: nav.frameKey,
|
|
277
|
+
dir: nav.dir,
|
|
278
|
+
rootLabel: rootLabel ?? schema.title,
|
|
279
|
+
variant,
|
|
280
|
+
before: syncedNote
|
|
281
|
+
});
|
|
282
|
+
return /* @__PURE__ */ jsx(KitEnvProvider, {
|
|
283
|
+
value: env,
|
|
284
|
+
children: /* @__PURE__ */ jsx(FormProvider, {
|
|
285
|
+
value: api,
|
|
286
|
+
children: /* @__PURE__ */ jsx(FrameSlotsProvider, {
|
|
287
|
+
value: FRAME_SLOTS,
|
|
288
|
+
children: /* @__PURE__ */ jsx(RowsHostContext.Provider, {
|
|
289
|
+
value: ROWS_HOST,
|
|
290
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
291
|
+
ref: root,
|
|
292
|
+
onKeyDown: nav.onKeyDown,
|
|
293
|
+
className: cn("flex min-h-0 min-w-0 flex-col", ownScroll && "h-full", className),
|
|
294
|
+
"data-kit-form": schema.name,
|
|
295
|
+
children: [
|
|
296
|
+
header,
|
|
297
|
+
onCrumbs ? null : /* @__PURE__ */ jsx(FrameCrumbs, {
|
|
298
|
+
crumbs,
|
|
299
|
+
onNavigate: navigate,
|
|
300
|
+
variant
|
|
301
|
+
}),
|
|
302
|
+
ownScroll ? /* @__PURE__ */ jsx("div", {
|
|
303
|
+
ref: scroller,
|
|
304
|
+
className: "@container min-h-0 flex-1 overflow-y-auto overscroll-contain",
|
|
305
|
+
children: body
|
|
306
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
307
|
+
className: "@container",
|
|
308
|
+
children: body
|
|
309
|
+
})
|
|
310
|
+
]
|
|
311
|
+
})
|
|
312
|
+
})
|
|
313
|
+
})
|
|
314
|
+
})
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
//#endregion
|
|
318
|
+
export { COALESCE_MS, SchemaForm, UNDO_STEPS };
|
|
319
|
+
|
|
320
|
+
//# sourceMappingURL=schema-form.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-form.js","names":[],"sources":["../../src/kit/engine/schema-form.tsx"],"sourcesContent":["/**\n * <SchemaForm> — the BetterCMS Block Kit form engine (V2 HEAD 9829bf1 kit/engine/schema-form.tsx). One schema in, one\n * value out; renders through the shared field chrome; owns validation visibility, per-field undo + history (coalesced\n * 900ms, 50 steps), the published baseline (changed dots, Reset to published) and the navigation path.\n *\n * <SchemaForm schema={faq} value={v} onChange={setV} variant=\"panel\" />\n *\n * `path` is controllable so a canvas can sync selection <-> breadcrumb both ways. Frames (root, drilled object, array\n * item, slot block, button, history) come from lib/frames `resolveFrames`; the drill-in stage, crumbs and keys\n * (Esc / Alt+Up/Down) from frame.tsx and breadcrumb.tsx; the layout of each frame from grouping.tsx through field-list.\n *\n * The host provides the kit scope (`data-kit-scope`) around the form; the form never declares one of its own, so a\n * dark host scope is never reset to light inside it.\n */\nimport * as React from \"react\";\nimport { cn } from \"../lib/cn\";\nimport type { FieldPath, TypeSchema } from \"../schema/types\";\nimport { DEFAULT_ENV, FormProvider, KitEnvProvider, useKitEnv, visibleSchema, type FormApi, type HistoryEntry, type KitEnv, type KitPeer, type Swatch } from \"../context\";\nimport { resolveFrames } from \"../lib/frames\";\nimport { getIn, isObj, keyStartsWith, pathEq, pathKey, same, setIn } from \"../lib/path\";\nimport { collectIssues, type KitIssue } from \"../lib/validate\";\nimport { RowsHostContext } from \"./array\";\nimport { crumbSignature, FrameCrumbs, framesToCrumbs, type KitCrumb } from \"./breadcrumb\";\nimport { FieldList } from \"./field-list\";\nimport { FrameSlotsProvider, FrameStage, useFrameNavigation, type FrameSlots } from \"./frame\";\nimport { FieldSection } from \"./grouping\";\nimport { NestedForm } from \"./kit-field\";\nimport { TableFrame } from \"../controls/table/table\";\nimport { ButtonScreen } from \"../controls/button\";\n\nexport interface SchemaFormProps {\n schema: TypeSchema;\n value: Record<string, unknown>;\n onChange: (value: Record<string, unknown>) => void;\n /** controlled navigation path ([] = root). Omit for uncontrolled. */\n path?: FieldPath;\n defaultPath?: FieldPath;\n onPathChange?: (path: FieldPath) => void;\n /** \"panel\" = 320–420px inspector; \"document\" = the wide document editor column */\n variant?: \"panel\" | \"document\";\n /** resolve a block type (slot children) to its schema */\n resolveSchema?: (blockType: string) => TypeSchema | undefined;\n /** blocks offered by \"+ Add block\" (filtered by each slot's allow list) */\n blockLibrary?: TypeSchema[];\n /** the published version: enables changed dots and \"Reset to published\" */\n published?: Record<string, unknown>;\n /**\n * Component instance (CPO D28): values come from `from` unless a top-level key is in `overridden`. Overridden fields\n * get an accent dot + \"Reset\"; inherited ones read muted. `onReset(key)` drops one override.\n */\n inherited?: { from: string; overridden: string[]; onReset: (key: string) => void };\n /** pathKey → teammates in that field (\"items.1.answer\") */\n presence?: Record<string, KitPeer | KitPeer[]>;\n /** pathKey → open comment threads */\n comments?: Record<string, number>;\n /** host comment system. When set, the field comment chip opens the host's popover/panel instead of the kit's. */\n onComment?: KitEnv[\"onComment\"];\n /** \"Open {title}\" on a reference: the host opens the referenced entry (e.g. a stacked panel) */\n onOpenReference?: KitEnv[\"onOpenReference\"];\n /** the whole form is read-only for the lens (fields with their own `access.edit` still follow `env.can`) */\n readOnly?: boolean;\n /** validate everything now (after a publish attempt) */\n showErrors?: boolean;\n /** document identity + site context */\n env?: {\n docId?: string;\n docTitle?: string;\n urlPrefix?: string;\n isPublished?: boolean;\n palette?: Swatch[];\n syncedFrom?: string;\n /** D58: the host's access check (`useCan` at the host). Omitted → allow-all (staff tools, demos). */\n can?: KitEnv[\"can\"];\n /** CPO D39: \"tooltip\" moves help lines behind the ⓘ (dense hosts) */\n helpDisplay?: KitEnv[\"helpDisplay\"];\n };\n /** own scroll container (default: panel yes, document no) */\n scroll?: boolean;\n /** rendered above the breadcrumb (e.g. a block header) */\n header?: React.ReactNode;\n /** label of the root crumb (defaults to schema.title) */\n rootLabel?: string;\n /**\n * Host-owned trail (CPO D38): the form stops rendering its own breadcrumb and reports the drill-in crumbs\n * instead, so a host with its own path header shows ONE breadcrumb. Navigate with `onPathChange`. Called in a\n * layout effect, so the host header never lags a frame.\n */\n onCrumbs?: (crumbs: KitCrumb[]) => void;\n onIssuesChange?: (issues: KitIssue[]) => void;\n /** imperative navigation for hosts (e.g. a dialog's Escape: go up one level before closing) */\n navRef?: React.Ref<{ back: () => boolean }>;\n className?: string;\n}\n\nexport const COALESCE_MS = 900;\nexport const UNDO_STEPS = 50;\nconst HISTORY_ENTRIES = 30;\n\n/* The frame pieces other lanes own, handed to frame.tsx (which never imports them directly). ButtonScreen (link\n control) and TableFrame (table control) arrive with the controls lanes; until then the header title reads the\n button's label the way V2's `normLink(v).label` does.\n The getters read the imports at render, not at module evaluation: kit-field → array / field-list → schema-form →\n kit-field is a cycle, and an eager read would hit the TDZ the day one of them becomes a const or memo(). */\nconst buttonLabel = (v: unknown) => ({ label: isObj(v) && typeof v.label === \"string\" ? v.label : undefined });\nconst FRAME_SLOTS: FrameSlots = {\n get FieldList() {\n return FieldList;\n },\n get FieldSection() {\n return FieldSection;\n },\n get TableFrame() {\n return TableFrame;\n },\n get ButtonScreen() {\n return ButtonScreen;\n },\n normLink: buttonLabel,\n};\nconst ROWS_HOST = {\n get NestedForm() {\n return NestedForm;\n },\n};\n\nexport function SchemaForm({\n schema: schemaIn,\n value,\n onChange,\n path: controlledPath,\n defaultPath,\n onPathChange,\n variant = \"panel\",\n resolveSchema: resolveIn,\n blockLibrary,\n published,\n inherited,\n presence,\n comments,\n onComment,\n onOpenReference,\n readOnly,\n showErrors = false,\n env: envIn,\n scroll,\n header,\n rootLabel,\n onCrumbs,\n onIssuesChange,\n navRef,\n className,\n}: SchemaFormProps) {\n const outerCan = useKitEnv().can;\n const can = envIn?.can ?? outerCan; // a nested form (dialog object, article block) inherits its host form's check\n /* D58: fields the lens can't view are dropped from the schema here, once: not rendered, not validated */\n const schema = React.useMemo(() => visibleSchema(schemaIn, can), [schemaIn, can]);\n const resolveSchema = React.useMemo(\n () =>\n resolveIn\n ? (t: string) => {\n const s = resolveIn(t);\n return s && visibleSchema(s, can);\n }\n : undefined,\n [resolveIn, can],\n );\n const docId = envIn?.docId ?? schema.name;\n const ownScroll = scroll ?? variant === \"panel\";\n\n /* value + baseline */\n const valueRef = React.useRef(value);\n valueRef.current = value;\n const [baseline, setBaseline] = React.useState(value);\n const stacks = React.useRef(new Map<string, { path: FieldPath; values: unknown[]; at: number }>());\n const log = React.useRef(new Map<string, HistoryEntry[]>());\n const memory = React.useRef(new Map<string, unknown>());\n const [aiKeys, setAiKeys] = React.useState<Set<string>>(() => new Set());\n const [touched, setTouched] = React.useState<Set<string>>(() => new Set());\n const editing = React.useRef(new Set<string>());\n const [, bump] = React.useReducer((x: number) => x + 1, 0);\n React.useEffect(() => {\n setBaseline(valueRef.current);\n stacks.current.clear();\n log.current.clear();\n memory.current.clear();\n setTouched(new Set());\n setAiKeys(new Set());\n }, [docId]);\n\n /* navigation */\n const [innerPath, setInnerPath] = React.useState<FieldPath>(defaultPath ?? []);\n const rawPath = controlledPath ?? innerPath;\n const { frames, path } = React.useMemo(() => resolveFrames(schema, value, rawPath, resolveSchema), [schema, value, rawPath, resolveSchema]);\n const navigate = React.useCallback(\n (p: FieldPath) => {\n if (controlledPath === undefined) setInnerPath(p);\n onPathChange?.(p);\n },\n [controlledPath, onPathChange],\n );\n /* a path that no longer resolves (a removed item, a hidden field) settles on the deepest frame that does */\n React.useEffect(() => {\n if (!pathEq(path, rawPath)) navigate(path);\n }, [path, rawPath, navigate]);\n /* V2: a new document starts at its root (an uncontrolled path never carries the last document's drill or history).\n Skips the mount run so `defaultPath` survives. */\n const lastDoc = React.useRef(docId);\n React.useEffect(() => {\n if (lastDoc.current === docId) return;\n lastDoc.current = docId;\n if (controlledPath === undefined) setInnerPath([]);\n }, [docId]); // eslint-disable-line react-hooks/exhaustive-deps\n\n /* writes */\n const setAt = React.useCallback<FormApi[\"setAt\"]>(\n (p, v, opts) => {\n const prev = getIn(valueRef.current, p);\n if (same(prev, v)) return;\n const key = pathKey(p);\n if (opts?.record !== false) {\n const now = Date.now();\n const st = stacks.current.get(key) ?? { path: p, values: [], at: 0 };\n if (!st.values.length || now - st.at > COALESCE_MS) st.values = [...st.values, prev].slice(-UNDO_STEPS);\n st.at = now;\n stacks.current.set(key, st);\n const h = log.current.get(key) ?? [];\n const entry: HistoryEntry = { value: v, at: now, by: \"You\", label: opts?.label };\n log.current.set(key, h.length && now - h[0].at < COALESCE_MS && !opts?.label ? [entry, ...h.slice(1)] : [entry, ...h].slice(0, HISTORY_ENTRIES));\n editing.current.add(key);\n }\n const next = setIn(valueRef.current, p, v);\n valueRef.current = next;\n onChange(next);\n },\n [onChange],\n );\n\n /* validation */\n const issueList = React.useMemo(() => collectIssues(schema.fields, value, [], resolveSchema), [schema, value, resolveSchema]);\n const issues = React.useMemo(() => new Map(issueList.map((i) => [i.key, i])), [issueList]);\n React.useEffect(() => onIssuesChange?.(issueList), [issueList, onIssuesChange]);\n const isVisible = React.useCallback(\n (i: KitIssue) => showErrors || touched.has(i.key) || (i.kind === \"rule\" && !editing.current.has(i.key)),\n [showErrors, touched],\n );\n\n const api: FormApi = {\n schema,\n value,\n setAt,\n getAt: (p) => getIn(value, p),\n baselineAt: (p) => getIn(baseline, p),\n publishedAt: (p) => getIn(published, p),\n hasPublished: !!published,\n inherited: inherited ? { from: inherited.from, isOverridden: (k) => inherited.overridden.includes(k), reset: inherited.onReset } : undefined,\n path,\n navigate,\n canNavigate: true,\n resolveSchema,\n blockLibrary,\n issues,\n visibleIssue: (k) => {\n const i = issues.get(k);\n return i && isVisible(i) ? i : undefined;\n },\n rollup: (prefix) => {\n const pk = pathKey(prefix);\n let errors = 0;\n let warnings = 0;\n for (const i of issueList) if (keyStartsWith(i.key, pk) && isVisible(i)) i.level === \"error\" ? errors++ : warnings++;\n return { errors, warnings };\n },\n touch: (k) => {\n editing.current.delete(k);\n if (!touched.has(k)) setTouched((s) => new Set(s).add(k));\n },\n showAllErrors: showErrors,\n canUndo: (k) => !!stacks.current.get(k)?.values.length,\n undo: (k) => {\n const st = stacks.current.get(k);\n if (!st?.values.length) return;\n const prev = st.values[st.values.length - 1];\n st.values = st.values.slice(0, -1);\n st.at = 0;\n const next = setIn(valueRef.current, st.path, prev);\n valueRef.current = next;\n onChange(next);\n bump();\n },\n history: (k) => log.current.get(k) ?? [],\n aiKeys,\n markAi: (k, on) =>\n setAiKeys((s) => {\n const n = new Set(s);\n if (on) n.add(k);\n else n.delete(k);\n return n;\n }),\n memory: memory.current,\n };\n\n const normPresence = React.useMemo(() => {\n const out: Record<string, KitPeer[]> = {};\n for (const [k, v] of Object.entries(presence ?? {})) out[k] = Array.isArray(v) ? v : [v];\n return out;\n }, [presence]);\n const env: KitEnv = React.useMemo(\n () => ({\n ...DEFAULT_ENV,\n variant,\n docId,\n docTitle: envIn?.docTitle,\n urlPrefix: envIn?.urlPrefix,\n /* a published copy proves \"live\"; its absence proves nothing (the dock has none), so it stays unknown */\n isPublished: envIn?.isPublished ?? (published ? true : undefined),\n palette: envIn?.palette ?? DEFAULT_ENV.palette,\n readOnly: !!readOnly,\n can,\n presence: normPresence,\n comments: comments ?? {},\n onComment,\n onOpenReference,\n syncedFrom: envIn?.syncedFrom,\n helpDisplay: envIn?.helpDisplay,\n }),\n [variant, docId, envIn?.docTitle, envIn?.urlPrefix, envIn?.isPublished, envIn?.palette, envIn?.syncedFrom, envIn?.helpDisplay, published, readOnly, can, normPresence, comments, onComment, onOpenReference],\n );\n\n React.useImperativeHandle(\n navRef,\n () => ({\n back: () => {\n if (frames.length < 2) return false;\n navigate(frames[frames.length - 2].path);\n return true;\n },\n }),\n [frames, navigate],\n );\n\n /* drill-in stage: direction-aware slide, scroll memory, focus on the entering frame, Esc / Alt+Up/Down */\n const root = React.useRef<HTMLDivElement>(null);\n const scroller = React.useRef<HTMLDivElement>(null);\n const nav = useFrameNavigation({ frames, navigate, root, scroller });\n\n const crumbs = framesToCrumbs(frames, schema, api.rollup, rootLabel);\n const crumbSig = crumbSignature(crumbs);\n const onCrumbsRef = React.useRef(onCrumbs);\n onCrumbsRef.current = onCrumbs;\n React.useLayoutEffect(() => {\n onCrumbsRef.current?.(crumbs);\n }, [crumbSig]); // eslint-disable-line react-hooks/exhaustive-deps\n\n const syncedNote = envIn?.syncedFrom ? (\n <p className=\"mb-5 flex items-start gap-2 rounded-kit-lg bg-kit-info-soft px-3 py-2 text-kit-xs text-kit-info-fg\">\n <span className=\"mt-0.5 size-1.5 shrink-0 rounded-full bg-kit-info\" aria-hidden />\n <span>\n Synced from <span className=\"font-medium\">{envIn.syncedFrom}</span>. Changes here apply on every page that uses it.\n </span>\n </p>\n ) : null;\n const body = <FrameStage frames={frames} frameKey={nav.frameKey} dir={nav.dir} rootLabel={rootLabel ?? schema.title} variant={variant} before={syncedNote} />;\n\n return (\n <KitEnvProvider value={env}>\n <FormProvider value={api}>\n <FrameSlotsProvider value={FRAME_SLOTS}>\n <RowsHostContext.Provider value={ROWS_HOST}>\n <div ref={root} onKeyDown={nav.onKeyDown} className={cn(\"flex min-h-0 min-w-0 flex-col\", ownScroll && \"h-full\", className)} data-kit-form={schema.name}>\n {header}\n {onCrumbs ? null : <FrameCrumbs crumbs={crumbs} onNavigate={navigate} variant={variant} />}\n {ownScroll ? (\n <div ref={scroller} className=\"@container min-h-0 flex-1 overflow-y-auto overscroll-contain\">\n {body}\n </div>\n ) : (\n <div className=\"@container\">{body}</div>\n )}\n </div>\n </RowsHostContext.Provider>\n </FrameSlotsProvider>\n </FormProvider>\n </KitEnvProvider>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8FA,IAAa,cAAc;AAC3B,IAAa,aAAa;AAC1B,IAAM,kBAAkB;AAOxB,IAAM,eAAe,OAAgB,EAAE,OAAO,MAAM,EAAE,IAAI,OAAO,EAAE,UAAU,WAAW,EAAE,QAAQ,KAAA,GAAW;AAC7G,IAAM,cAA0B;CAC9B,IAAI,YAAY;AACd,SAAO;;CAET,IAAI,eAAe;AACjB,SAAO;;CAET,IAAI,aAAa;AACf,SAAO;;CAET,IAAI,eAAe;AACjB,SAAO;;CAET,UAAU;CACX;AACD,IAAM,YAAY,EAChB,IAAI,aAAa;AACf,QAAO;GAEV;AAED,SAAgB,WAAW,EACzB,QAAQ,UACR,OACA,UACA,MAAM,gBACN,aACA,cACA,UAAU,SACV,eAAe,WACf,cACA,WACA,WACA,UACA,UACA,WACA,iBACA,UACA,aAAa,OACb,KAAK,OACL,QACA,QACA,WACA,UACA,gBACA,QACA,aACkB;CAClB,MAAM,WAAW,WAAW,CAAC;CAC7B,MAAM,MAAM,OAAO,OAAO;CAE1B,MAAM,SAAS,MAAM,cAAc,cAAc,UAAU,IAAI,EAAE,CAAC,UAAU,IAAI,CAAC;CACjF,MAAM,gBAAgB,MAAM,cAExB,aACK,MAAc;EACb,MAAM,IAAI,UAAU,EAAE;AACtB,SAAO,KAAK,cAAc,GAAG,IAAI;KAEnC,KAAA,GACN,CAAC,WAA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F,YACC,oBAAC,OAAD;QAAK,KAAK;QAAU,WAAU;kBAC3B;QACG,CAAA,GAEN,oBAAC,OAAD;QAAK,WAAU;kBAAc;QAAW,CAAA;OAEtC;;KACmB,CAAA;IACR,CAAA;GACR,CAAA;EACA,CAAA"}
|
package/engine/slot.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { FieldPath, FieldSchema, TypeSchema } from "../schema/types";
|
|
2
|
+
export declare function SlotField({ field, path }: {
|
|
3
|
+
field: FieldSchema;
|
|
4
|
+
path: FieldPath;
|
|
5
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
/** Blocks this slot accepts: its allow list resolved through `resolveSchema`, else the whole block library. */
|
|
7
|
+
export declare function useAvailableBlocks(field: FieldSchema): TypeSchema[];
|
|
8
|
+
export declare function BlockPicker({ blocks, onPick, disabled, label }: {
|
|
9
|
+
blocks: TypeSchema[];
|
|
10
|
+
onPick: (b: TypeSchema) => void;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
label?: string;
|
|
13
|
+
}): import("react/jsx-runtime").JSX.Element;
|