@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 @@
|
|
|
1
|
+
{"version":3,"file":"logo.js","names":[],"sources":["../../src/kit/brand/logo.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../lib/cn\";\n\n/* OFFICIAL BetterCMS logo — exported from the V2 Figma (node 60995:8678 \"Link - BetterCMS home\").\n Mark: three facets with the brand gradient (#A878D2 → #ED6262 → #D13A3A).\n Wordmark: --wordmark (#291018 on light, = --fg on dark; kit.css has no wordmark token yet, so the V2 values are the fallbacks). Never redraw or recolor the mark. */\n\nconst ICON = [\"M12.7575 27.0001L1.51134 20.0938C0.572213 19.5171 0.000244141 18.4961 0.000244141 17.3965V8.59934C0.000244141 7.45142 0.623145 6.3933 1.62844 5.83354L9.5867 1.4023C10.4896 0.899541 11.5815 0.866267 12.5135 1.3131L23.8336 6.74014L14.354 12.1618C13.3665 12.7265 12.7575 13.7747 12.7575 14.9096V27.0001Z\", \"M14.3398 16.0219V18.8735L22.2169 13.8627C23.1316 13.2808 23.6853 12.2739 23.6853 11.1921V8.29945L15.7983 13.3576C14.8893 13.9406 14.3398 14.9443 14.3398 16.0219Z\", \"M14.3398 22.2591V25.1107L22.2169 20.0999C23.1316 19.518 23.6853 18.5111 23.6853 17.4293V14.5367L15.7983 19.5948C14.8893 20.1779 14.3398 21.1815 14.3398 22.2591Z\"];\nconst WORD = [\"M70.5658 20.3613V10.9967H72.1245V12.1933C72.8865 11.2048 73.8044 10.8407 75.2418 10.9274V12.7136C73.2675 12.6095 72.1245 13.598 72.1245 15.4362V20.3613H70.5658Z\", \"M65.4408 20.5694C62.8083 20.5694 61.1977 18.4537 61.1977 15.679C61.1977 12.8696 62.8603 10.8406 65.3888 10.8406C67.8134 10.8406 69.4067 12.7309 69.4067 15.4015V16.0779H62.8083C62.9123 17.76 63.8994 19.0433 65.4408 19.0433C66.5319 19.0433 67.4497 18.4363 67.9866 17.2744L69.2682 17.9161C68.4889 19.7023 67.138 20.5694 65.4408 20.5694ZM62.8776 14.6212H67.7615C67.5883 13.2858 66.705 12.3494 65.3888 12.3494C64.0207 12.3494 63.1028 13.3379 62.8776 14.6212Z\", \"M59.2561 20.5693C57.5935 20.5693 56.918 19.9276 56.918 18.2975V12.5053H55.394V10.9966H56.918V8.37799H58.4767V10.9966H60.3298V12.5053H58.4767V18.072C58.4767 18.8524 58.8231 19.0085 59.3253 19.0085H60.4164V20.4999C60.07 20.5346 59.6371 20.5693 59.2561 20.5693Z\", \"M53.3658 20.5693C51.7033 20.5693 51.0278 19.9276 51.0278 18.2975V12.5053H49.5038V10.9966H51.0278V8.37799H52.5865V10.9966H54.4396V12.5053H52.5865V18.072C52.5865 18.8524 52.9329 19.0085 53.4351 19.0085H54.5262V20.4999C54.1798 20.5346 53.7469 20.5693 53.3658 20.5693Z\", \"M44.9815 20.5695C42.3491 20.5695 40.7384 18.4538 40.7384 15.6791C40.7384 12.8697 42.401 10.8408 44.9296 10.8408C47.3542 10.8408 48.9475 12.731 48.9475 15.4016V16.078H42.3491C42.453 17.7601 43.4402 19.0434 44.9815 19.0434C46.0726 19.0434 46.9905 18.4365 47.5274 17.2746L48.8089 17.9162C48.0296 19.7024 46.6787 20.5695 44.9815 20.5695ZM42.4184 14.6213H47.3022C47.129 13.286 46.2458 12.3495 44.9296 12.3495C43.5614 12.3495 42.6435 13.338 42.4184 14.6213Z\", \"M29.834 20.3613V7.32031H35.1162C37.6447 7.32031 39.0995 8.5169 39.0995 10.5806C39.0995 11.8639 38.5279 12.8697 37.4542 13.4593C38.8743 13.9449 39.6537 15.0894 39.6537 16.5808C39.6537 18.8353 37.8352 20.3613 35.1854 20.3613H29.834ZM31.3927 12.7483H34.6486C36.4151 12.7483 37.5581 11.9506 37.5581 10.6673C37.5581 9.52272 36.6229 8.86373 35.0469 8.86373H31.3927V12.7483ZM31.3927 18.8006H35.0642C36.9346 18.8006 38.0603 17.9682 38.043 16.5808C38.0603 15.1415 36.848 14.257 34.891 14.257H31.3927V18.8006Z\", \"M107.608 20.6788C104.835 20.6788 103.115 19.3074 102.697 16.7653L104.2 16.4643C104.501 18.2538 105.637 19.1736 107.524 19.1736C109.345 19.1736 110.614 18.3039 110.614 17.0663C110.614 15.9793 109.629 15.2267 107.224 14.5242C104.301 13.688 103.048 12.4504 103.048 10.7111C103.048 8.72086 104.685 7.48326 107.307 7.48326C109.862 7.48326 111.399 8.65396 111.917 10.895L110.364 11.2295C110.03 9.72433 109.027 8.97173 107.274 8.97173C105.637 8.97173 104.618 9.60726 104.618 10.6943C104.618 11.6978 105.47 12.3835 107.858 13.1194C110.998 14.0727 112.167 15.3103 112.167 17.0663C112.167 19.2572 110.38 20.6788 107.608 20.6788Z\", \"M89.8249 20.3612V7.78442H91.7289L95.871 18.2204L99.9463 7.78442H101.85V20.3612H100.347V10.6945L96.5725 20.3612H95.1695L91.328 10.6945V20.3612H89.8249Z\", \"M83.2802 20.6788C79.6558 20.6788 77.0837 18.0364 77.0837 14.24C77.0837 10.3766 79.8061 7.4833 83.4639 7.4833C85.9692 7.4833 87.9902 8.82125 88.9756 11.079L87.3889 11.4303C86.6206 9.90833 85.2009 9.02194 83.4305 9.02194C80.6579 9.02194 78.7038 11.1961 78.7038 14.1731C78.7038 17.0998 80.5911 19.1569 83.2635 19.1569C85.2343 19.1569 86.8043 18.0364 87.5392 16.1967L89.0424 16.5312C88.0737 19.1569 86.036 20.6788 83.2802 20.6788Z\"];\n/** boxicons:sparkle-circle-filled — path from public/brand/ai-sparkle-glyph.svg (viewBox 2 2 16 16). */\nexport const SPARKLE_PATH = \"M9.4668 2.37243C9.64848 1.87586 10.351 1.87586 10.5326 2.37243L11.0754 3.85459C11.501 5.01732 12.1751 6.07325 13.0506 6.94879C13.9262 7.82432 14.9821 8.4984 16.1448 8.92405L17.627 9.4668C18.1243 9.64848 18.1243 10.351 17.627 10.5326L16.1448 11.0754C14.9821 11.501 13.9262 12.1751 13.0506 13.0506C12.1751 13.9262 11.501 14.9821 11.0754 16.1448L10.5326 17.627C10.351 18.1243 9.64848 18.1243 9.4668 17.627L8.92405 16.1448C8.4984 14.9821 7.82432 13.9262 6.94879 13.0506C6.07325 12.1751 5.01732 11.501 3.85459 11.0754L2.37243 10.5326C1.87586 10.351 1.87586 9.64848 2.37243 9.4668L3.85459 8.92405C5.01732 8.4984 6.07325 7.82432 6.94879 6.94879C7.82432 6.07325 8.4984 5.01732 8.92405 3.85459L9.4668 2.37243Z\";\nexport const BRAND_STOPS = [\n { offset: 0.0817, color: \"#A878D2\" },\n { offset: 0.4808, color: \"#ED6262\" },\n { offset: 0.9231, color: \"#D13A3A\" },\n];\n\nfunction MarkGradient({ id }: { id: string }) {\n return (\n <linearGradient id={id} x1=\"8.81595\" y1=\"-2.84571\" x2=\"18.8801\" y2=\"29.1204\" gradientUnits=\"userSpaceOnUse\">\n {BRAND_STOPS.map((s) => <stop key={s.offset} offset={s.offset} stopColor={s.color} />)}\n </linearGradient>\n );\n}\n\n/** The mark alone (square). */\nexport function LogoMark({ size = 24, className }: { size?: number; className?: string }) {\n const id = React.useId().replace(/:/g, \"\");\n return (\n <svg width={size} height={size} viewBox=\"-1 0 26 28\" className={cn(\"shrink-0\", className)} aria-hidden>\n <defs><MarkGradient id={`bm${id}`} /></defs>\n {ICON.map((d) => <path key={d.slice(0, 12)} d={d} fill={`url(#bm${id})`} />)}\n </svg>\n );\n}\n\n/** Full lockup: mark + \"BetterCMS\" wordmark. Height-driven (default 24px → 106px wide). */\nexport function Logo({ className, compact, height = 24 }: { className?: string; compact?: boolean; height?: number }) {\n const id = React.useId().replace(/:/g, \"\");\n if (compact) return <LogoMark size={height} className={className} />;\n return (\n <svg height={height} width={(height * 113) / 28} viewBox=\"0 0 113 28\" className={cn(\"shrink-0 text-[var(--kit-wordmark,#291018)] [.dark_&]:text-[var(--kit-fg,#e1e1e4)]\", className)} role=\"img\" aria-label=\"BetterCMS\">\n <defs><MarkGradient id={`bl${id}`} /></defs>\n {ICON.map((d) => <path key={d.slice(0, 12)} d={d} fill={`url(#bl${id})`} />)}\n {WORD.map((d) => <path key={d.slice(0, 12)} d={d} fill=\"currentColor\" />)}\n </svg>\n );\n}\n"],"mappings":";;;;AAUA,IAAa,eAAe"}
|
package/context.d.ts
ADDED
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kit runtime contexts (V2 HEAD 9829bf1 kit/context.tsx).
|
|
3
|
+
*
|
|
4
|
+
* - KitServices — pluggable app services (media library picker, upload sink, toast, AI rewrite, comment threads).
|
|
5
|
+
* Hosts register theirs once (`registerKitServices`) or provide them (`KitServicesProvider`); the kit
|
|
6
|
+
* never imports a feature. A service that is absent hides the surface that needs it.
|
|
7
|
+
* - KitEnv — the editing environment a control renders in: variant (panel | document), doc identity, site
|
|
8
|
+
* palette, permissions, presence, comments. Has safe defaults so a control can render alone.
|
|
9
|
+
* - FormApi — present only inside <SchemaForm>: value, writes, navigation, issues, baselines, history.
|
|
10
|
+
*/
|
|
11
|
+
import * as React from "react";
|
|
12
|
+
import type { Cap } from "./schema/sources";
|
|
13
|
+
import type { FieldAccess, FieldPath, FieldSchema, TypeSchema } from "./schema/types";
|
|
14
|
+
import type { KitIssue } from "./lib/validate";
|
|
15
|
+
import type { ControlProps } from "./types";
|
|
16
|
+
import type { LinkTarget } from "./controls/link";
|
|
17
|
+
/** The media asset a picker hands back (the host's media library row, narrowed to what the kit reads). */
|
|
18
|
+
export interface KitMediaAsset {
|
|
19
|
+
id: string;
|
|
20
|
+
url: string;
|
|
21
|
+
name?: string;
|
|
22
|
+
alt?: string;
|
|
23
|
+
kind?: "image" | "video" | "file" | "svg";
|
|
24
|
+
width?: number;
|
|
25
|
+
height?: number;
|
|
26
|
+
size?: number;
|
|
27
|
+
}
|
|
28
|
+
export interface KitMediaPickerProps {
|
|
29
|
+
open: boolean;
|
|
30
|
+
onOpenChange: (v: boolean) => void;
|
|
31
|
+
onPick: (assets: KitMediaAsset[]) => void;
|
|
32
|
+
multiple?: boolean;
|
|
33
|
+
accept?: ("image" | "video" | "file" | "svg")[];
|
|
34
|
+
}
|
|
35
|
+
export interface KitToastOptions {
|
|
36
|
+
/** the second line under the message (V2 sonner `description`) */
|
|
37
|
+
description?: string;
|
|
38
|
+
action?: {
|
|
39
|
+
label: string;
|
|
40
|
+
onClick: () => void;
|
|
41
|
+
};
|
|
42
|
+
duration?: number;
|
|
43
|
+
icon?: React.ReactNode;
|
|
44
|
+
}
|
|
45
|
+
/** The host's toaster. The kit has no toast dependency (V2 re-exported sonner's). */
|
|
46
|
+
export interface KitToast {
|
|
47
|
+
(message: string, opts?: KitToastOptions): void;
|
|
48
|
+
success: (message: string, opts?: KitToastOptions) => void;
|
|
49
|
+
}
|
|
50
|
+
/** Rewrite with AI presets (V2 lib/ai.ts). The host's `aiRewrite` service produces the text. */
|
|
51
|
+
export type AiPreset = "improve" | "shorter" | "longer" | "simplify" | "grammar" | "translate";
|
|
52
|
+
export declare const AI_PRESETS: {
|
|
53
|
+
id: AiPreset;
|
|
54
|
+
label: string;
|
|
55
|
+
}[];
|
|
56
|
+
/** The in-place field comments popover (V2 FieldThreads over the comments store), drawn by the host. */
|
|
57
|
+
export interface KitFieldCommentsProps {
|
|
58
|
+
docId: string;
|
|
59
|
+
/** pathKey of the field ("items.1.answer") */
|
|
60
|
+
fieldKey: string;
|
|
61
|
+
label: string;
|
|
62
|
+
/** the field's text, first 80 characters */
|
|
63
|
+
quote?: string;
|
|
64
|
+
onClose: () => void;
|
|
65
|
+
/** "Open in panel": set when the host has a comments panel (`env.onComment`) */
|
|
66
|
+
onOpenPanel?: () => void;
|
|
67
|
+
}
|
|
68
|
+
export interface KitServices {
|
|
69
|
+
/** The media library picker. */
|
|
70
|
+
MediaPicker?: React.ComponentType<KitMediaPickerProps>;
|
|
71
|
+
/** Called after an upload so the host can file the assets into its media library. */
|
|
72
|
+
onUploaded?: (assets: KitMediaAsset[]) => void;
|
|
73
|
+
/**
|
|
74
|
+
* Image placements keep their edits BESIDE the url (`${name}Alt` · `${name}Focal` · `${name}Crop` ·
|
|
75
|
+
* `${name}Decorative`) instead of turning the value into an object — the Visuals block model.
|
|
76
|
+
*/
|
|
77
|
+
imageSiblings?: boolean;
|
|
78
|
+
/** Real metadata for an image url (the host's media library), so captions never show placeholders. */
|
|
79
|
+
resolveImage?: (url: string) => {
|
|
80
|
+
name?: string;
|
|
81
|
+
width?: number;
|
|
82
|
+
height?: number;
|
|
83
|
+
size?: number;
|
|
84
|
+
} | undefined;
|
|
85
|
+
/** The host's full image editor (crop, rotate, focal, alt…), opened in place. */
|
|
86
|
+
editImage?: (req: {
|
|
87
|
+
docId: string;
|
|
88
|
+
path: FieldPath;
|
|
89
|
+
title: string;
|
|
90
|
+
}) => void;
|
|
91
|
+
/** The project's forms for `reference: { to: ["form"] }` (the host's Forms store). */
|
|
92
|
+
forms?: () => {
|
|
93
|
+
id: string;
|
|
94
|
+
title: string;
|
|
95
|
+
subtitle: string;
|
|
96
|
+
}[];
|
|
97
|
+
/** Toasts for Copy / Paste / Reset / AI (each with Undo). Absent → the action still runs, silently. */
|
|
98
|
+
toast?: KitToast;
|
|
99
|
+
/** Rewrite with AI. Absent → the ⋯ menu offers no rewrite. `attempt` counts "Try again" presses. */
|
|
100
|
+
aiRewrite?: (text: string, preset: AiPreset, attempt: number) => string | Promise<string>;
|
|
101
|
+
/** In-place field comments. Absent and no `env.onComment` → the field shows no add-comment control. */
|
|
102
|
+
FieldComments?: React.ComponentType<KitFieldCommentsProps>;
|
|
103
|
+
/**
|
|
104
|
+
* A React hook: open (unresolved) threads on one field, read from the same store FieldComments draws (V2 counted
|
|
105
|
+
* `useBlockThreads(docId, key)`). Used while the host has no `env.onComment`; absent → SchemaForm `comments` counts.
|
|
106
|
+
*/
|
|
107
|
+
useFieldCommentCount?: (docId: string, fieldKey: string) => number;
|
|
108
|
+
/**
|
|
109
|
+
* The host's own control for a type (a FieldRenderer arm in the dashboard), drawn for a stored value a kit control
|
|
110
|
+
* hands off because it cannot carry it unchanged (rich text, LegacyFallback). Bare inside the kit FieldShell, which
|
|
111
|
+
* owns the label row and the help; the box is tagged `data-kit-legacy`. Absent → the field says why in words.
|
|
112
|
+
*/
|
|
113
|
+
LegacyControl?: React.ComponentType<ControlProps>;
|
|
114
|
+
/**
|
|
115
|
+
* A React HOOK: the project's pages and CMS items a link can point at (controls/link.tsx). The host passes the same
|
|
116
|
+
* function for the life of the form (it is called on every render of a link control). Absent → the link picker says
|
|
117
|
+
* page search isn't available and takes a typed path. `error` is a whole sentence naming what failed ("Pages couldn't
|
|
118
|
+
* be loaded: …", "Items from Blog couldn't be loaded: …"); the picker shows it under whatever did load.
|
|
119
|
+
*/
|
|
120
|
+
useLinkTargets?: () => {
|
|
121
|
+
targets: LinkTarget[];
|
|
122
|
+
loading?: boolean;
|
|
123
|
+
error?: string;
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
/** Register app services once at module load (e.g. the Content feature registers its media library). */
|
|
127
|
+
export declare function registerKitServices(s: KitServices): void;
|
|
128
|
+
export declare function KitServicesProvider({ value, children }: {
|
|
129
|
+
value: KitServices;
|
|
130
|
+
children: React.ReactNode;
|
|
131
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
132
|
+
export declare function useKitServices(): KitServices;
|
|
133
|
+
/** A host header element a top-level field (by path key) renders its actions into, instead of a label row. */
|
|
134
|
+
export declare const FieldHeaderSlot: React.Context<{
|
|
135
|
+
key: string;
|
|
136
|
+
el: HTMLElement;
|
|
137
|
+
} | null>;
|
|
138
|
+
export type KitVariant = "panel" | "document";
|
|
139
|
+
export interface KitPeer {
|
|
140
|
+
id?: string;
|
|
141
|
+
name: string;
|
|
142
|
+
avatar?: string;
|
|
143
|
+
/** presence colour (avatar ring, field border, caret flag) */
|
|
144
|
+
color?: string;
|
|
145
|
+
/** "editing" (soft lock + border) or "viewing" */
|
|
146
|
+
status?: "editing" | "viewing";
|
|
147
|
+
}
|
|
148
|
+
export interface Swatch {
|
|
149
|
+
name: string;
|
|
150
|
+
value: string;
|
|
151
|
+
token?: string;
|
|
152
|
+
}
|
|
153
|
+
/** V2's demo site palette (Caldera). Hosts pass the project's brand palette through `env.palette`. */
|
|
154
|
+
export declare const SITE_PALETTE: Swatch[];
|
|
155
|
+
export interface KitEnv {
|
|
156
|
+
variant: KitVariant;
|
|
157
|
+
/** Identity of the document/block being edited (rich-text sync, comments, history). */
|
|
158
|
+
docId: string;
|
|
159
|
+
/** The document's title — slug generation. */
|
|
160
|
+
docTitle?: string;
|
|
161
|
+
/** Public URL prefix for slug previews, e.g. "caldera.bettercms.site/journal/". */
|
|
162
|
+
urlPrefix?: string;
|
|
163
|
+
/** The document has been published (slug changes warn about the old address). */
|
|
164
|
+
isPublished?: boolean;
|
|
165
|
+
palette: Swatch[];
|
|
166
|
+
/** The whole form is read-only for the lens (the host's content.edit rule, a generated twin…). */
|
|
167
|
+
readOnly: boolean;
|
|
168
|
+
/**
|
|
169
|
+
* D58: the host's access check for the lens (`useCan` at the host). The kit never imports the store; it asks this for
|
|
170
|
+
* field-level `access` and for developer surfaces (field keys, IDs, API names: `schema.view` or `api.view`).
|
|
171
|
+
* Hosts that omit it (staff tools, demos) get allow-all.
|
|
172
|
+
*/
|
|
173
|
+
can: (cap: Cap) => boolean;
|
|
174
|
+
/** pathKey → teammates in that field */
|
|
175
|
+
presence: Record<string, KitPeer[]>;
|
|
176
|
+
/** pathKey → open comment threads */
|
|
177
|
+
comments: Record<string, number>;
|
|
178
|
+
/** Host comment panel. When absent, field comments live in the in-place popover only. */
|
|
179
|
+
onComment?: (path: FieldPath, field: FieldSchema) => void;
|
|
180
|
+
/** The whole form is a global block ("Navigation") — every field is synced. */
|
|
181
|
+
syncedFrom?: string;
|
|
182
|
+
/** "Open {title}" on a reference card: the host edits the referenced entry in place (stacked panel). */
|
|
183
|
+
onOpenReference?: (ref: {
|
|
184
|
+
collectionId: string;
|
|
185
|
+
entryId: string;
|
|
186
|
+
title: string;
|
|
187
|
+
}) => void;
|
|
188
|
+
/** CPO D39: "inline" (default) shows help under the label; "tooltip" moves it behind the ⓘ — for dense hosts (grid cells, popovers). */
|
|
189
|
+
helpDisplay?: "inline" | "tooltip";
|
|
190
|
+
}
|
|
191
|
+
export declare const DEFAULT_ENV: KitEnv;
|
|
192
|
+
/** D58 field access: fields in the `seo` group default to `{ edit: "seo.edit" }`. */
|
|
193
|
+
export declare const fieldAccessOf: (field: FieldSchema) => FieldAccess | undefined;
|
|
194
|
+
/**
|
|
195
|
+
* One field for the lens: hidden (no `view`), read-only (plain text: no `edit`, the field is `readOnly`, or the whole form
|
|
196
|
+
* is read-only and the field has no edit cap of its own), or editable. An explicit `edit` cap wins over the form's
|
|
197
|
+
* read-only rule, so an SEO specialist edits SEO fields inside a form they can't otherwise change.
|
|
198
|
+
*/
|
|
199
|
+
export declare function resolveFieldAccess(field: FieldSchema, env: Pick<KitEnv, "can" | "readOnly">): {
|
|
200
|
+
hidden: boolean;
|
|
201
|
+
readOnly: boolean;
|
|
202
|
+
};
|
|
203
|
+
/** Drop the fields the lens can't `view` (recursively), so they are neither rendered nor validated. Same object back when
|
|
204
|
+
* nothing is hidden. Values of dropped fields stay in the document untouched. */
|
|
205
|
+
export declare function visibleFields(fields: FieldSchema[], can: KitEnv["can"]): FieldSchema[];
|
|
206
|
+
export declare function visibleSchema(schema: TypeSchema, can: KitEnv["can"]): TypeSchema;
|
|
207
|
+
/** Developer surfaces (field keys, API names, IDs): `schema.view` or `api.view`. */
|
|
208
|
+
export declare const seesDevSurfaces: (env: Pick<KitEnv, "can">) => boolean;
|
|
209
|
+
export declare const KitEnvProvider: React.Provider<KitEnv>;
|
|
210
|
+
export declare const useKitEnv: () => KitEnv;
|
|
211
|
+
export interface HistoryEntry {
|
|
212
|
+
value: unknown;
|
|
213
|
+
at: number;
|
|
214
|
+
by: string;
|
|
215
|
+
label?: string;
|
|
216
|
+
}
|
|
217
|
+
export interface FormApi {
|
|
218
|
+
schema: TypeSchema;
|
|
219
|
+
value: Record<string, unknown>;
|
|
220
|
+
/** write a value; `record: false` skips the field undo/history stack (e.g. programmatic sync) */
|
|
221
|
+
setAt: (path: FieldPath, v: unknown, opts?: {
|
|
222
|
+
record?: boolean;
|
|
223
|
+
label?: string;
|
|
224
|
+
}) => void;
|
|
225
|
+
getAt: (path: FieldPath) => unknown;
|
|
226
|
+
/** value when the form mounted (field undo baseline) */
|
|
227
|
+
baselineAt: (path: FieldPath) => unknown;
|
|
228
|
+
/** published value (changed dot, Reset to published); undefined when never published */
|
|
229
|
+
publishedAt: (path: FieldPath) => unknown;
|
|
230
|
+
hasPublished: boolean;
|
|
231
|
+
/** component instances (CPO D28): top-level fields inherit from a component unless overridden */
|
|
232
|
+
inherited?: {
|
|
233
|
+
from: string;
|
|
234
|
+
isOverridden: (key: string) => boolean;
|
|
235
|
+
reset: (key: string) => void;
|
|
236
|
+
};
|
|
237
|
+
/** the current navigation path (drill-in stack) */
|
|
238
|
+
path: FieldPath;
|
|
239
|
+
navigate: (path: FieldPath) => void;
|
|
240
|
+
/** the form draws frames for a non-root path. False while SchemaForm renders only the root frame: History and
|
|
241
|
+
* drill-in rows hide or go inert instead of navigating to a path nothing shows (no silent no-op). */
|
|
242
|
+
canNavigate: boolean;
|
|
243
|
+
resolveSchema?: (blockType: string) => TypeSchema | undefined;
|
|
244
|
+
/** blocks offered by "+ Add block" in slots (filtered by each slot's allow list) */
|
|
245
|
+
blockLibrary?: TypeSchema[];
|
|
246
|
+
/** all issues by pathKey */
|
|
247
|
+
issues: Map<string, KitIssue>;
|
|
248
|
+
/** the issue shown for a key (rules on blur, required after blur or a publish attempt) */
|
|
249
|
+
visibleIssue: (key: string) => KitIssue | undefined;
|
|
250
|
+
/** visible issues under a path prefix (rollup dots on rows, crumbs and tabs) */
|
|
251
|
+
rollup: (prefix: FieldPath) => {
|
|
252
|
+
errors: number;
|
|
253
|
+
warnings: number;
|
|
254
|
+
};
|
|
255
|
+
touch: (key: string) => void;
|
|
256
|
+
showAllErrors: boolean;
|
|
257
|
+
/** per-field undo (Undo last change to {label}) */
|
|
258
|
+
canUndo: (key: string) => boolean;
|
|
259
|
+
undo: (key: string) => void;
|
|
260
|
+
/** versions of a field this session (newest first) */
|
|
261
|
+
history: (key: string) => HistoryEntry[];
|
|
262
|
+
/** the last change to this field came from AI (⋯ shows "Undo AI change") */
|
|
263
|
+
aiKeys: Set<string>;
|
|
264
|
+
markAi: (key: string, on: boolean) => void;
|
|
265
|
+
/** remembered UI state per frame (selected group tab, open fieldsets) */
|
|
266
|
+
memory: Map<string, unknown>;
|
|
267
|
+
}
|
|
268
|
+
export declare const FormProvider: React.Provider<FormApi | null>;
|
|
269
|
+
export declare const useForm: () => FormApi | null;
|
package/context.js
ADDED
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region src/kit/context.tsx
|
|
4
|
+
/**
|
|
5
|
+
* Kit runtime contexts (V2 HEAD 9829bf1 kit/context.tsx).
|
|
6
|
+
*
|
|
7
|
+
* - KitServices — pluggable app services (media library picker, upload sink, toast, AI rewrite, comment threads).
|
|
8
|
+
* Hosts register theirs once (`registerKitServices`) or provide them (`KitServicesProvider`); the kit
|
|
9
|
+
* never imports a feature. A service that is absent hides the surface that needs it.
|
|
10
|
+
* - KitEnv — the editing environment a control renders in: variant (panel | document), doc identity, site
|
|
11
|
+
* palette, permissions, presence, comments. Has safe defaults so a control can render alone.
|
|
12
|
+
* - FormApi — present only inside <SchemaForm>: value, writes, navigation, issues, baselines, history.
|
|
13
|
+
*/
|
|
14
|
+
var AI_PRESETS = [
|
|
15
|
+
{
|
|
16
|
+
id: "improve",
|
|
17
|
+
label: "Improve"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
id: "shorter",
|
|
21
|
+
label: "Shorter"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
id: "longer",
|
|
25
|
+
label: "Longer"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: "simplify",
|
|
29
|
+
label: "Simplify"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: "grammar",
|
|
33
|
+
label: "Fix spelling & grammar"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
id: "translate",
|
|
37
|
+
label: "Translate to Spanish"
|
|
38
|
+
}
|
|
39
|
+
];
|
|
40
|
+
var registry = {};
|
|
41
|
+
var listeners = /* @__PURE__ */ new Set();
|
|
42
|
+
/** Register app services once at module load (e.g. the Content feature registers its media library). */
|
|
43
|
+
function registerKitServices(s) {
|
|
44
|
+
registry = {
|
|
45
|
+
...registry,
|
|
46
|
+
...s
|
|
47
|
+
};
|
|
48
|
+
listeners.forEach((l) => l());
|
|
49
|
+
}
|
|
50
|
+
var ServicesCtx = React.createContext(null);
|
|
51
|
+
function KitServicesProvider({ value, children }) {
|
|
52
|
+
return /* @__PURE__ */ jsx(ServicesCtx.Provider, {
|
|
53
|
+
value,
|
|
54
|
+
children
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
function useKitServices() {
|
|
58
|
+
const local = React.useContext(ServicesCtx);
|
|
59
|
+
const global = React.useSyncExternalStore((cb) => {
|
|
60
|
+
listeners.add(cb);
|
|
61
|
+
return () => listeners.delete(cb);
|
|
62
|
+
}, () => registry, () => registry);
|
|
63
|
+
return local ? {
|
|
64
|
+
...global,
|
|
65
|
+
...local
|
|
66
|
+
} : global;
|
|
67
|
+
}
|
|
68
|
+
/** A host header element a top-level field (by path key) renders its actions into, instead of a label row. */
|
|
69
|
+
var FieldHeaderSlot = React.createContext(null);
|
|
70
|
+
/** V2's demo site palette (Caldera). Hosts pass the project's brand palette through `env.palette`. */
|
|
71
|
+
var SITE_PALETTE = [
|
|
72
|
+
{
|
|
73
|
+
name: "Ember",
|
|
74
|
+
value: "#E0663B",
|
|
75
|
+
token: "brand.ember"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: "Ochre",
|
|
79
|
+
value: "#D97706",
|
|
80
|
+
token: "brand.ochre"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: "Moss",
|
|
84
|
+
value: "#4F6B4A",
|
|
85
|
+
token: "brand.moss"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: "Lake",
|
|
89
|
+
value: "#2563EB",
|
|
90
|
+
token: "accent.lake"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
name: "Dusk",
|
|
94
|
+
value: "#7C3AED",
|
|
95
|
+
token: "accent.dusk"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
name: "Berry",
|
|
99
|
+
value: "#DB2777",
|
|
100
|
+
token: "accent.berry"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: "Char",
|
|
104
|
+
value: "#1E1B18",
|
|
105
|
+
token: "neutral.900"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
name: "Slate",
|
|
109
|
+
value: "#4B5563",
|
|
110
|
+
token: "neutral.600"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
name: "Bone",
|
|
114
|
+
value: "#E7E0D6",
|
|
115
|
+
token: "neutral.200"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
name: "Paper",
|
|
119
|
+
value: "#F6F1EA",
|
|
120
|
+
token: "neutral.50"
|
|
121
|
+
}
|
|
122
|
+
];
|
|
123
|
+
var DEFAULT_ENV = {
|
|
124
|
+
variant: "panel",
|
|
125
|
+
docId: "kit",
|
|
126
|
+
palette: [],
|
|
127
|
+
readOnly: false,
|
|
128
|
+
can: () => true,
|
|
129
|
+
presence: {},
|
|
130
|
+
comments: {}
|
|
131
|
+
};
|
|
132
|
+
var EnvCtx = React.createContext(DEFAULT_ENV);
|
|
133
|
+
/** D58 field access: fields in the `seo` group default to `{ edit: "seo.edit" }`. */
|
|
134
|
+
var fieldAccessOf = (field) => field.access ?? (field.group === "seo" ? { edit: "seo.edit" } : void 0);
|
|
135
|
+
/**
|
|
136
|
+
* One field for the lens: hidden (no `view`), read-only (plain text: no `edit`, the field is `readOnly`, or the whole form
|
|
137
|
+
* is read-only and the field has no edit cap of its own), or editable. An explicit `edit` cap wins over the form's
|
|
138
|
+
* read-only rule, so an SEO specialist edits SEO fields inside a form they can't otherwise change.
|
|
139
|
+
*/
|
|
140
|
+
function resolveFieldAccess(field, env) {
|
|
141
|
+
const a = fieldAccessOf(field);
|
|
142
|
+
if (a?.view && !env.can(a.view)) return {
|
|
143
|
+
hidden: true,
|
|
144
|
+
readOnly: true
|
|
145
|
+
};
|
|
146
|
+
if (field.readOnly === true) return {
|
|
147
|
+
hidden: false,
|
|
148
|
+
readOnly: true
|
|
149
|
+
};
|
|
150
|
+
if (a?.edit) return {
|
|
151
|
+
hidden: false,
|
|
152
|
+
readOnly: !env.can(a.edit)
|
|
153
|
+
};
|
|
154
|
+
return {
|
|
155
|
+
hidden: false,
|
|
156
|
+
readOnly: env.readOnly
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
/** Drop the fields the lens can't `view` (recursively), so they are neither rendered nor validated. Same object back when
|
|
160
|
+
* nothing is hidden. Values of dropped fields stay in the document untouched. */
|
|
161
|
+
function visibleFields(fields, can) {
|
|
162
|
+
let changed = false;
|
|
163
|
+
const out = [];
|
|
164
|
+
for (const f of fields) {
|
|
165
|
+
const a = fieldAccessOf(f);
|
|
166
|
+
if (a?.view && !can(a.view)) {
|
|
167
|
+
changed = true;
|
|
168
|
+
continue;
|
|
169
|
+
}
|
|
170
|
+
let g = f;
|
|
171
|
+
if (f.fields) {
|
|
172
|
+
const n = visibleFields(f.fields, can);
|
|
173
|
+
if (n !== f.fields) g = {
|
|
174
|
+
...g,
|
|
175
|
+
fields: n
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
if (Array.isArray(f.of)) {
|
|
179
|
+
const n = visibleFields(f.of, can);
|
|
180
|
+
if (n !== f.of) g = {
|
|
181
|
+
...g,
|
|
182
|
+
of: n
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
if (f.slotSettings) {
|
|
186
|
+
const n = visibleFields(f.slotSettings, can);
|
|
187
|
+
if (n !== f.slotSettings) g = {
|
|
188
|
+
...g,
|
|
189
|
+
slotSettings: n
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
if (g !== f) changed = true;
|
|
193
|
+
out.push(g);
|
|
194
|
+
}
|
|
195
|
+
return changed ? out : fields;
|
|
196
|
+
}
|
|
197
|
+
function visibleSchema(schema, can) {
|
|
198
|
+
const fields = visibleFields(schema.fields, can);
|
|
199
|
+
return fields === schema.fields ? schema : {
|
|
200
|
+
...schema,
|
|
201
|
+
fields
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
/** Developer surfaces (field keys, API names, IDs): `schema.view` or `api.view`. */
|
|
205
|
+
var seesDevSurfaces = (env) => env.can("schema.view") || env.can("api.view");
|
|
206
|
+
var KitEnvProvider = EnvCtx.Provider;
|
|
207
|
+
var useKitEnv = () => React.useContext(EnvCtx);
|
|
208
|
+
var FormCtx = React.createContext(null);
|
|
209
|
+
var FormProvider = FormCtx.Provider;
|
|
210
|
+
var useForm = () => React.useContext(FormCtx);
|
|
211
|
+
//#endregion
|
|
212
|
+
export { AI_PRESETS, DEFAULT_ENV, FieldHeaderSlot, FormProvider, KitEnvProvider, KitServicesProvider, SITE_PALETTE, fieldAccessOf, registerKitServices, resolveFieldAccess, seesDevSurfaces, useForm, useKitEnv, useKitServices, visibleFields, visibleSchema };
|
|
213
|
+
|
|
214
|
+
//# sourceMappingURL=context.js.map
|
package/context.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","names":[],"sources":["../src/kit/context.tsx"],"sourcesContent":["/**\n * Kit runtime contexts (V2 HEAD 9829bf1 kit/context.tsx).\n *\n * - KitServices — pluggable app services (media library picker, upload sink, toast, AI rewrite, comment threads).\n * Hosts register theirs once (`registerKitServices`) or provide them (`KitServicesProvider`); the kit\n * never imports a feature. A service that is absent hides the surface that needs it.\n * - KitEnv — the editing environment a control renders in: variant (panel | document), doc identity, site\n * palette, permissions, presence, comments. Has safe defaults so a control can render alone.\n * - FormApi — present only inside <SchemaForm>: value, writes, navigation, issues, baselines, history.\n */\nimport * as React from \"react\";\nimport type { Cap } from \"./schema/sources\";\nimport type { FieldAccess, FieldPath, FieldSchema, TypeSchema } from \"./schema/types\";\nimport type { KitIssue } from \"./lib/validate\";\nimport type { ControlProps } from \"./types\";\nimport type { LinkTarget } from \"./controls/link\";\n\n/* ── Services ─────────────────────────────────────────────────────────── */\n/** The media asset a picker hands back (the host's media library row, narrowed to what the kit reads). */\nexport interface KitMediaAsset {\n id: string;\n url: string;\n name?: string;\n alt?: string;\n kind?: \"image\" | \"video\" | \"file\" | \"svg\";\n width?: number;\n height?: number;\n size?: number;\n}\nexport interface KitMediaPickerProps {\n open: boolean;\n onOpenChange: (v: boolean) => void;\n onPick: (assets: KitMediaAsset[]) => void;\n multiple?: boolean;\n accept?: (\"image\" | \"video\" | \"file\" | \"svg\")[];\n}\nexport interface KitToastOptions {\n /** the second line under the message (V2 sonner `description`) */\n description?: string;\n action?: { label: string; onClick: () => void };\n duration?: number;\n icon?: React.ReactNode;\n}\n/** The host's toaster. The kit has no toast dependency (V2 re-exported sonner's). */\nexport interface KitToast {\n (message: string, opts?: KitToastOptions): void;\n success: (message: string, opts?: KitToastOptions) => void;\n}\n/** Rewrite with AI presets (V2 lib/ai.ts). The host's `aiRewrite` service produces the text. */\nexport type AiPreset = \"improve\" | \"shorter\" | \"longer\" | \"simplify\" | \"grammar\" | \"translate\";\nexport const AI_PRESETS: { id: AiPreset; label: string }[] = [\n { id: \"improve\", label: \"Improve\" },\n { id: \"shorter\", label: \"Shorter\" },\n { id: \"longer\", label: \"Longer\" },\n { id: \"simplify\", label: \"Simplify\" },\n { id: \"grammar\", label: \"Fix spelling & grammar\" },\n { id: \"translate\", label: \"Translate to Spanish\" },\n];\n/** The in-place field comments popover (V2 FieldThreads over the comments store), drawn by the host. */\nexport interface KitFieldCommentsProps {\n docId: string;\n /** pathKey of the field (\"items.1.answer\") */\n fieldKey: string;\n label: string;\n /** the field's text, first 80 characters */\n quote?: string;\n onClose: () => void;\n /** \"Open in panel\": set when the host has a comments panel (`env.onComment`) */\n onOpenPanel?: () => void;\n}\n/* The popover around FieldComments keeps itself open on Escape while focus is on an element marked `data-esc-owner`\n (V2 guardEscape): the composer marks its input so Escape clears or blurs the draft instead of losing it. */\nexport interface KitServices {\n /** The media library picker. */\n MediaPicker?: React.ComponentType<KitMediaPickerProps>;\n /** Called after an upload so the host can file the assets into its media library. */\n onUploaded?: (assets: KitMediaAsset[]) => void;\n /**\n * Image placements keep their edits BESIDE the url (`${name}Alt` · `${name}Focal` · `${name}Crop` ·\n * `${name}Decorative`) instead of turning the value into an object — the Visuals block model.\n */\n imageSiblings?: boolean;\n /** Real metadata for an image url (the host's media library), so captions never show placeholders. */\n resolveImage?: (url: string) => { name?: string; width?: number; height?: number; size?: number } | undefined;\n /** The host's full image editor (crop, rotate, focal, alt…), opened in place. */\n editImage?: (req: { docId: string; path: FieldPath; title: string }) => void;\n /** The project's forms for `reference: { to: [\"form\"] }` (the host's Forms store). */\n forms?: () => { id: string; title: string; subtitle: string }[];\n /** Toasts for Copy / Paste / Reset / AI (each with Undo). Absent → the action still runs, silently. */\n toast?: KitToast;\n /** Rewrite with AI. Absent → the ⋯ menu offers no rewrite. `attempt` counts \"Try again\" presses. */\n aiRewrite?: (text: string, preset: AiPreset, attempt: number) => string | Promise<string>;\n /** In-place field comments. Absent and no `env.onComment` → the field shows no add-comment control. */\n FieldComments?: React.ComponentType<KitFieldCommentsProps>;\n /**\n * A React hook: open (unresolved) threads on one field, read from the same store FieldComments draws (V2 counted\n * `useBlockThreads(docId, key)`). Used while the host has no `env.onComment`; absent → SchemaForm `comments` counts.\n */\n useFieldCommentCount?: (docId: string, fieldKey: string) => number;\n /**\n * The host's own control for a type (a FieldRenderer arm in the dashboard), drawn for a stored value a kit control\n * hands off because it cannot carry it unchanged (rich text, LegacyFallback). Bare inside the kit FieldShell, which\n * owns the label row and the help; the box is tagged `data-kit-legacy`. Absent → the field says why in words.\n */\n LegacyControl?: React.ComponentType<ControlProps>;\n /**\n * A React HOOK: the project's pages and CMS items a link can point at (controls/link.tsx). The host passes the same\n * function for the life of the form (it is called on every render of a link control). Absent → the link picker says\n * page search isn't available and takes a typed path. `error` is a whole sentence naming what failed (\"Pages couldn't\n * be loaded: …\", \"Items from Blog couldn't be loaded: …\"); the picker shows it under whatever did load.\n */\n useLinkTargets?: () => { targets: LinkTarget[]; loading?: boolean; error?: string };\n}\nlet registry: KitServices = {};\nconst listeners = new Set<() => void>();\n/** Register app services once at module load (e.g. the Content feature registers its media library). */\nexport function registerKitServices(s: KitServices) {\n registry = { ...registry, ...s };\n listeners.forEach((l) => l());\n}\nconst ServicesCtx = React.createContext<KitServices | null>(null);\nexport function KitServicesProvider({ value, children }: { value: KitServices; children: React.ReactNode }) {\n return <ServicesCtx.Provider value={value}>{children}</ServicesCtx.Provider>;\n}\nexport function useKitServices(): KitServices {\n const local = React.useContext(ServicesCtx);\n const global = React.useSyncExternalStore(\n (cb) => {\n listeners.add(cb);\n return () => listeners.delete(cb);\n },\n () => registry,\n () => registry,\n );\n return local ? { ...global, ...local } : global;\n}\n\n/** A host header element a top-level field (by path key) renders its actions into, instead of a label row. */\nexport const FieldHeaderSlot = React.createContext<{ key: string; el: HTMLElement } | null>(null);\n\n/* ── Environment ──────────────────────────────────────────────────────── */\nexport type KitVariant = \"panel\" | \"document\";\nexport interface KitPeer {\n id?: string;\n name: string;\n avatar?: string;\n /** presence colour (avatar ring, field border, caret flag) */\n color?: string;\n /** \"editing\" (soft lock + border) or \"viewing\" */\n status?: \"editing\" | \"viewing\";\n}\nexport interface Swatch {\n name: string;\n value: string;\n token?: string;\n}\n\n/** V2's demo site palette (Caldera). Hosts pass the project's brand palette through `env.palette`. */\nexport const SITE_PALETTE: Swatch[] = [\n { name: \"Ember\", value: \"#E0663B\", token: \"brand.ember\" },\n { name: \"Ochre\", value: \"#D97706\", token: \"brand.ochre\" },\n { name: \"Moss\", value: \"#4F6B4A\", token: \"brand.moss\" },\n { name: \"Lake\", value: \"#2563EB\", token: \"accent.lake\" },\n { name: \"Dusk\", value: \"#7C3AED\", token: \"accent.dusk\" },\n { name: \"Berry\", value: \"#DB2777\", token: \"accent.berry\" },\n { name: \"Char\", value: \"#1E1B18\", token: \"neutral.900\" },\n { name: \"Slate\", value: \"#4B5563\", token: \"neutral.600\" },\n { name: \"Bone\", value: \"#E7E0D6\", token: \"neutral.200\" },\n { name: \"Paper\", value: \"#F6F1EA\", token: \"neutral.50\" },\n];\n\nexport interface KitEnv {\n variant: KitVariant;\n /** Identity of the document/block being edited (rich-text sync, comments, history). */\n docId: string;\n /** The document's title — slug generation. */\n docTitle?: string;\n /** Public URL prefix for slug previews, e.g. \"caldera.bettercms.site/journal/\". */\n urlPrefix?: string;\n /** The document has been published (slug changes warn about the old address). */\n isPublished?: boolean;\n palette: Swatch[];\n /** The whole form is read-only for the lens (the host's content.edit rule, a generated twin…). */\n readOnly: boolean;\n /**\n * D58: the host's access check for the lens (`useCan` at the host). The kit never imports the store; it asks this for\n * field-level `access` and for developer surfaces (field keys, IDs, API names: `schema.view` or `api.view`).\n * Hosts that omit it (staff tools, demos) get allow-all.\n */\n can: (cap: Cap) => boolean;\n /** pathKey → teammates in that field */\n presence: Record<string, KitPeer[]>;\n /** pathKey → open comment threads */\n comments: Record<string, number>;\n /** Host comment panel. When absent, field comments live in the in-place popover only. */\n onComment?: (path: FieldPath, field: FieldSchema) => void;\n /** The whole form is a global block (\"Navigation\") — every field is synced. */\n syncedFrom?: string;\n /** \"Open {title}\" on a reference card: the host edits the referenced entry in place (stacked panel). */\n onOpenReference?: (ref: { collectionId: string; entryId: string; title: string }) => void;\n /** CPO D39: \"inline\" (default) shows help under the label; \"tooltip\" moves it behind the ⓘ — for dense hosts (grid cells, popovers). */\n helpDisplay?: \"inline\" | \"tooltip\";\n}\nexport const DEFAULT_ENV: KitEnv = {\n variant: \"panel\",\n docId: \"kit\",\n palette: [],\n readOnly: false,\n can: () => true,\n presence: {},\n comments: {},\n};\nconst EnvCtx = React.createContext<KitEnv>(DEFAULT_ENV);\n\n/** D58 field access: fields in the `seo` group default to `{ edit: \"seo.edit\" }`. */\nexport const fieldAccessOf = (field: FieldSchema): FieldAccess | undefined => field.access ?? (field.group === \"seo\" ? { edit: \"seo.edit\" } : undefined);\n\n/**\n * One field for the lens: hidden (no `view`), read-only (plain text: no `edit`, the field is `readOnly`, or the whole form\n * is read-only and the field has no edit cap of its own), or editable. An explicit `edit` cap wins over the form's\n * read-only rule, so an SEO specialist edits SEO fields inside a form they can't otherwise change.\n */\nexport function resolveFieldAccess(field: FieldSchema, env: Pick<KitEnv, \"can\" | \"readOnly\">): { hidden: boolean; readOnly: boolean } {\n const a = fieldAccessOf(field);\n if (a?.view && !env.can(a.view)) return { hidden: true, readOnly: true };\n if (field.readOnly === true) return { hidden: false, readOnly: true };\n if (a?.edit) return { hidden: false, readOnly: !env.can(a.edit) };\n return { hidden: false, readOnly: env.readOnly };\n}\n/** Drop the fields the lens can't `view` (recursively), so they are neither rendered nor validated. Same object back when\n * nothing is hidden. Values of dropped fields stay in the document untouched. */\nexport function visibleFields(fields: FieldSchema[], can: KitEnv[\"can\"]): FieldSchema[] {\n let changed = false;\n const out: FieldSchema[] = [];\n for (const f of fields) {\n const a = fieldAccessOf(f);\n if (a?.view && !can(a.view)) {\n changed = true;\n continue;\n }\n let g = f;\n if (f.fields) {\n const n = visibleFields(f.fields, can);\n if (n !== f.fields) g = { ...g, fields: n };\n }\n if (Array.isArray(f.of)) {\n const n = visibleFields(f.of, can);\n if (n !== f.of) g = { ...g, of: n };\n }\n if (f.slotSettings) {\n const n = visibleFields(f.slotSettings, can);\n if (n !== f.slotSettings) g = { ...g, slotSettings: n };\n }\n if (g !== f) changed = true;\n out.push(g);\n }\n return changed ? out : fields;\n}\nexport function visibleSchema(schema: TypeSchema, can: KitEnv[\"can\"]): TypeSchema {\n const fields = visibleFields(schema.fields, can);\n return fields === schema.fields ? schema : { ...schema, fields };\n}\n\n/** Developer surfaces (field keys, API names, IDs): `schema.view` or `api.view`. */\nexport const seesDevSurfaces = (env: Pick<KitEnv, \"can\">) => env.can(\"schema.view\") || env.can(\"api.view\");\nexport const KitEnvProvider = EnvCtx.Provider;\nexport const useKitEnv = () => React.useContext(EnvCtx);\n\n/* ── Form runtime (inside <SchemaForm>) ──────────────────────────────── */\nexport interface HistoryEntry {\n value: unknown;\n at: number;\n by: string;\n label?: string;\n}\nexport interface FormApi {\n schema: TypeSchema;\n value: Record<string, unknown>;\n /** write a value; `record: false` skips the field undo/history stack (e.g. programmatic sync) */\n setAt: (path: FieldPath, v: unknown, opts?: { record?: boolean; label?: string }) => void;\n getAt: (path: FieldPath) => unknown;\n /** value when the form mounted (field undo baseline) */\n baselineAt: (path: FieldPath) => unknown;\n /** published value (changed dot, Reset to published); undefined when never published */\n publishedAt: (path: FieldPath) => unknown;\n hasPublished: boolean;\n /** component instances (CPO D28): top-level fields inherit from a component unless overridden */\n inherited?: { from: string; isOverridden: (key: string) => boolean; reset: (key: string) => void };\n /** the current navigation path (drill-in stack) */\n path: FieldPath;\n navigate: (path: FieldPath) => void;\n /** the form draws frames for a non-root path. False while SchemaForm renders only the root frame: History and\n * drill-in rows hide or go inert instead of navigating to a path nothing shows (no silent no-op). */\n canNavigate: boolean;\n resolveSchema?: (blockType: string) => TypeSchema | undefined;\n /** blocks offered by \"+ Add block\" in slots (filtered by each slot's allow list) */\n blockLibrary?: TypeSchema[];\n /** all issues by pathKey */\n issues: Map<string, KitIssue>;\n /** the issue shown for a key (rules on blur, required after blur or a publish attempt) */\n visibleIssue: (key: string) => KitIssue | undefined;\n /** visible issues under a path prefix (rollup dots on rows, crumbs and tabs) */\n rollup: (prefix: FieldPath) => { errors: number; warnings: number };\n touch: (key: string) => void;\n showAllErrors: boolean;\n /** per-field undo (Undo last change to {label}) */\n canUndo: (key: string) => boolean;\n undo: (key: string) => void;\n /** versions of a field this session (newest first) */\n history: (key: string) => HistoryEntry[];\n /** the last change to this field came from AI (⋯ shows \"Undo AI change\") */\n aiKeys: Set<string>;\n markAi: (key: string, on: boolean) => void;\n /** remembered UI state per frame (selected group tab, open fieldsets) */\n memory: Map<string, unknown>;\n}\nconst FormCtx = React.createContext<FormApi | null>(null);\nexport const FormProvider = FormCtx.Provider;\nexport const useForm = () => React.useContext(FormCtx);\n"],"mappings":";;;;;;;;;;;;;AAkDA,IAAa,aAAgD;CAC3D;EAAE,IAAI;EAAW,OAAO;EAAW;CACnC;EAAE,IAAI;EAAW,OAAO;EAAW;CACnC;EAAE,IAAI;EAAU,OAAO;EAAU;CACjC;EAAE,IAAI;EAAY,OAAO;EAAY;CACrC;EAAE,IAAI;EAAW,OAAO;EAA0B;CAClD;EAAE,IAAI;EAAa,OAAO;EAAwB;CACnD;AAwDD,IAAI,WAAwB,EAAE;AAC9B,IAAM,4BAAY,IAAI,KAAiB;;AAEvC,SAAgB,oBAAoB,GAAgB;AAClD,YAAW;EAAE,GAAG;EAAU,GAAG;EAAG;AAChC,WAAU,SAAS,MAAM,GAAG,CAAC;;AAE/B,IAAM,cAAc,MAAM,cAAkC,KAAK;AACjE,SAAgB,oBAAoB,EAAE,OAAO,YAA+D;AAC1G,QAAO,oBAAC,YAAY,UAAb;EAA6B;EAAQ;EAAgC,CAAA;;AAE9E,SAAgB,iBAA8B;CAC5C,MAAM,QAAQ,MAAM,WAAW,YAAY;CAC3C,MAAM,SAAS,MAAM,sBAClB,OAAO;AACN,YAAU,IAAI,GAAG;AACjB,eAAa,UAAU,OAAO,GAAG;UAE7B,gBACA,SACP;AACD,QAAO,QAAQ;EAAE,GAAG;EAAQ,GAAG;EAAO,GAAG;;;AAI3C,IAAa,kBAAkB,MAAM,cAAuD,KAAK;;AAoBjG,IAAa,eAAyB;CACpC;EAAE,MAAM;EAAS,OAAO;EAAW,OAAO;EAAe;CACzD;EAAE,MAAM;EAAS,OAAO;EAAW,OAAO;EAAe;CACzD;EAAE,MAAM;EAAQ,OAAO;EAAW,OAAO;EAAc;CACvD;EAAE,MAAM;EAAQ,OAAO;EAAW,OAAO;EAAe;CACxD;EAAE,MAAM;EAAQ,OAAO;EAAW,OAAO;EAAe;CACxD;EAAE,MAAM;EAAS,OAAO;EAAW,OAAO;EAAgB;CAC1D;EAAE,MAAM;EAAQ,OAAO;EAAW,OAAO;EAAe;CACxD;EAAE,MAAM;EAAS,OAAO;EAAW,OAAO;EAAe;CACzD;EAAE,MAAM;EAAQ,OAAO;EAAW,OAAO;EAAe;CACxD;EAAE,MAAM;EAAS,OAAO;EAAW,OAAO;EAAc;CACzD;AAkCD,IAAa,cAAsB;CACjC,SAAS;CACT,OAAO;CACP,SAAS,EAAE;CACX,UAAU;CACV,WAAW;CACX,UAAU,EAAE;CACZ,UAAU,EAAE;CACb;AACD,IAAM,SAAS,MAAM,cAAsB,YAAY;;AAGvD,IAAa,iBAAiB,UAAgD,MAAM,WAAW,MAAM,UAAU,QAAQ,EAAE,MAAM,YAAY,GAAG,KAAA;;;;;;AAO9I,SAAgB,mBAAmB,OAAoB,KAA+E;CACpI,MAAM,IAAI,cAAc,MAAM;AAC9B,KAAI,GAAG,QAAQ,CAAC,IAAI,IAAI,EAAE,KAAK,CAAE,QAAO;EAAE,QAAQ;EAAM,UAAU;EAAM;AACxE,KAAI,MAAM,aAAa,KAAM,QAAO;EAAE,QAAQ;EAAO,UAAU;EAAM;AACrE,KAAI,GAAG,KAAM,QAAO;EAAE,QAAQ;EAAO,UAAU,CAAC,IAAI,IAAI,EAAE,KAAK;EAAE;AACjE,QAAO;EAAE,QAAQ;EAAO,UAAU,IAAI;EAAU;;;;AAIlD,SAAgB,cAAc,QAAuB,KAAmC;CACtF,IAAI,UAAU;CACd,MAAM,MAAqB,EAAE;AAC7B,MAAK,MAAM,KAAK,QAAQ;EACtB,MAAM,IAAI,cAAc,EAAE;AAC1B,MAAI,GAAG,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE;AAC3B,aAAU;AACV;;EAEF,IAAI,IAAI;AACR,MAAI,EAAE,QAAQ;GACZ,MAAM,IAAI,cAAc,EAAE,QAAQ,IAAI;AACtC,OAAI,MAAM,EAAE,OAAQ,KAAI;IAAE,GAAG;IAAG,QAAQ;IAAG;;AAE7C,MAAI,MAAM,QAAQ,EAAE,GAAG,EAAE;GACvB,MAAM,IAAI,cAAc,EAAE,IAAI,IAAI;AAClC,OAAI,MAAM,EAAE,GAAI,KAAI;IAAE,GAAG;IAAG,IAAI;IAAG;;AAErC,MAAI,EAAE,cAAc;GAClB,MAAM,IAAI,cAAc,EAAE,cAAc,IAAI;AAC5C,OAAI,MAAM,EAAE,aAAc,KAAI;IAAE,GAAG;IAAG,cAAc;IAAG;;AAEzD,MAAI,MAAM,EAAG,WAAU;AACvB,MAAI,KAAK,EAAE;;AAEb,QAAO,UAAU,MAAM;;AAEzB,SAAgB,cAAc,QAAoB,KAAgC;CAChF,MAAM,SAAS,cAAc,OAAO,QAAQ,IAAI;AAChD,QAAO,WAAW,OAAO,SAAS,SAAS;EAAE,GAAG;EAAQ;EAAQ;;;AAIlE,IAAa,mBAAmB,QAA6B,IAAI,IAAI,cAAc,IAAI,IAAI,IAAI,WAAW;AAC1G,IAAa,iBAAiB,OAAO;AACrC,IAAa,kBAAkB,MAAM,WAAW,OAAO;AAkDvD,IAAM,UAAU,MAAM,cAA8B,KAAK;AACzD,IAAa,eAAe,QAAQ;AACpC,IAAa,gBAAgB,MAAM,WAAW,QAAQ"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { ControlProps } from "../types";
|
|
2
|
+
import { type ButtonStyle, type LinkValue } from "./link";
|
|
3
|
+
export declare const STYLE_ITEMS: {
|
|
4
|
+
value: ButtonStyle;
|
|
5
|
+
label: string;
|
|
6
|
+
}[];
|
|
7
|
+
/** The look prod renders: the first valid of variant, style (buttonToProd's rule). */
|
|
8
|
+
export declare function lookOf(v: Pick<LinkValue, "variant" | "style">): string | undefined;
|
|
9
|
+
/** "Brand" for a stored look outside the four styles; undefined when unset. */
|
|
10
|
+
export declare function lookLabel(look: string | undefined): string;
|
|
11
|
+
/**
|
|
12
|
+
* The next stored button: `raw` (the value as the field holds it) with `patch` applied, keyed like `raw`. A look in the
|
|
13
|
+
* patch (`style`) lands in the key `raw` uses for it.
|
|
14
|
+
*/
|
|
15
|
+
export declare function nextButton(raw: unknown, patch: Partial<LinkValue>): LinkValue;
|
|
16
|
+
/** The icons a button can carry: the kit's drawn icons that are also dock names (the backend checks the name). */
|
|
17
|
+
export declare const BUTTON_ICONS: string[];
|
|
18
|
+
/** D46: four styles never sit in a row of tabs. The option IS the visual, so it is a 2×2 grid of live previews (one
|
|
19
|
+
* radiogroup: Tab enters on the checked style, arrows move and pick). A stored look outside the four is listed too. */
|
|
20
|
+
export declare function ButtonStyleGrid({ v, onPick, "aria-label": ariaLabel, size, }: {
|
|
21
|
+
v: LinkValue;
|
|
22
|
+
onPick: (s: ButtonStyle) => void;
|
|
23
|
+
"aria-label": string;
|
|
24
|
+
size?: "sm" | "md";
|
|
25
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
/**
|
|
27
|
+
* The button as a shape: filled · soft · outlined · underlined. In kit ink by default; `site` draws it in the host's
|
|
28
|
+
* site palette (--kit-preview-*), falling back to kit ink for each token the host leaves unset.
|
|
29
|
+
*/
|
|
30
|
+
export declare function ButtonPreview({ v, className, small, site }: {
|
|
31
|
+
v: LinkValue;
|
|
32
|
+
className?: string;
|
|
33
|
+
small?: boolean;
|
|
34
|
+
site?: boolean;
|
|
35
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
/** A 16px neutral glyph of the style (filled · outlined · underlined) — brand-free, so the field stays calm. */
|
|
37
|
+
export declare function StyleGlyph({ style, className }: {
|
|
38
|
+
style?: string;
|
|
39
|
+
className?: string;
|
|
40
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
/** The leading-icon picker: search + grid over BUTTON_ICONS, "No icon" first. */
|
|
42
|
+
export declare function ButtonIconPicker({ value, onPick }: {
|
|
43
|
+
value?: string;
|
|
44
|
+
onPick: (icon: string | undefined) => void;
|
|
45
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
46
|
+
/** The ONE button screen: preview · label · link (+ new tab, rel) · appearance (style, size, icon, arrow). */
|
|
47
|
+
export declare function ButtonScreen({ value, onChange, readOnly, title }: {
|
|
48
|
+
value: unknown;
|
|
49
|
+
onChange: (v: LinkValue) => void;
|
|
50
|
+
readOnly?: boolean;
|
|
51
|
+
title?: string;
|
|
52
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
53
|
+
/**
|
|
54
|
+
* Button field at rest: ONE unit between two hairlines (fieldset-like).
|
|
55
|
+
* [style glyph] Label ……………… Primary · Medium › → drills into the button screen ("… › Button")
|
|
56
|
+
* [page icon] Title /path → edits the link in place
|
|
57
|
+
*/
|
|
58
|
+
export declare function ButtonControl({ value, onChange, readOnly, id, path, field }: ControlProps): import("react/jsx-runtime").JSX.Element;
|