@bettercms-ai/kit 1.0.0 → 2.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/README.md +33 -0
- package/dist/adapters/dock-values.d.ts +28 -0
- package/dist/adapters/dock-values.js +41 -0
- package/dist/adapters/dock-values.js.map +1 -0
- package/{adapters → dist/adapters}/icons.js +2 -2
- package/dist/adapters/icons.js.map +1 -0
- package/{adapters → dist/adapters}/lossy.d.ts +90 -31
- package/dist/adapters/lossy.js +414 -0
- package/dist/adapters/lossy.js.map +1 -0
- package/{adapters → dist/adapters}/prod-types.d.ts +82 -4
- package/{adapters → dist/adapters}/prod-types.js +71 -3
- package/dist/adapters/prod-types.js.map +1 -0
- package/{adapters → dist/adapters}/schema.d.ts +40 -1
- package/{adapters → dist/adapters}/schema.js +996 -179
- package/dist/adapters/schema.js.map +1 -0
- package/{adapters → dist/adapters}/values.d.ts +26 -5
- package/{adapters → dist/adapters}/values.js +87 -17
- package/dist/adapters/values.js.map +1 -0
- package/dist/brand/logo.js +96 -0
- package/dist/brand/logo.js.map +1 -0
- package/{context.d.ts → dist/context.d.ts} +92 -2
- package/{context.js → dist/context.js} +5 -2
- package/dist/context.js.map +1 -0
- package/{controls → dist/controls}/button.d.ts +19 -5
- package/{controls → dist/controls}/button.js +125 -54
- package/dist/controls/button.js.map +1 -0
- package/{controls → dist/controls}/c1.js +1 -1
- package/dist/controls/c1.js.map +1 -0
- package/{controls → dist/controls}/c2.js +1 -1
- package/dist/controls/c2.js.map +1 -0
- package/{controls → dist/controls}/choice.d.ts +7 -2
- package/{controls → dist/controls}/choice.js +71 -18
- package/dist/controls/choice.js.map +1 -0
- package/{controls → dist/controls}/code-register.js +1 -1
- package/dist/controls/code-register.js.map +1 -0
- package/{controls → dist/controls}/code.js +10 -9
- package/dist/controls/code.js.map +1 -0
- package/{controls → dist/controls}/color.js +8 -8
- package/dist/controls/color.js.map +1 -0
- package/{controls → dist/controls}/component-services.d.ts +42 -0
- package/dist/controls/component-services.js +7 -0
- package/dist/controls/component-services.js.map +1 -0
- package/{controls → dist/controls}/date-register.js +1 -1
- package/dist/controls/date-register.js.map +1 -0
- package/{controls → dist/controls}/date-zone.js +8 -2
- package/dist/controls/date-zone.js.map +1 -0
- package/{controls → dist/controls}/date.js +32 -24
- package/dist/controls/date.js.map +1 -0
- package/{controls → dist/controls}/form-picker-register.js +1 -1
- package/dist/controls/form-picker-register.js.map +1 -0
- package/{controls → dist/controls}/form-picker.js +11 -9
- package/dist/controls/form-picker.js.map +1 -0
- package/{controls → dist/controls}/icon-register.js +1 -1
- package/dist/controls/icon-register.js.map +1 -0
- package/{controls → dist/controls}/icon.d.ts +4 -2
- package/{controls → dist/controls}/icon.js +32 -27
- package/dist/controls/icon.js.map +1 -0
- package/{controls → dist/controls}/index.d.ts +1 -1
- package/{controls → dist/controls}/index.js +4 -3
- package/dist/controls/index.js.map +1 -0
- package/{controls → dist/controls}/json-register.js +1 -1
- package/dist/controls/json-register.js.map +1 -0
- package/{controls → dist/controls}/json.js +13 -3
- package/dist/controls/json.js.map +1 -0
- package/{controls → dist/controls}/link.js +6 -6
- package/dist/controls/link.js.map +1 -0
- package/{controls → dist/controls}/location-register.js +1 -1
- package/dist/controls/location-register.js.map +1 -0
- package/{controls → dist/controls}/location.js +64 -40
- package/dist/controls/location.js.map +1 -0
- package/{controls → dist/controls}/media-register.js +1 -1
- package/dist/controls/media-register.js.map +1 -0
- package/{controls → dist/controls}/media-services.d.ts +6 -0
- package/dist/controls/media-services.js +0 -0
- package/{controls → dist/controls}/media.d.ts +35 -4
- package/{controls → dist/controls}/media.js +491 -171
- package/dist/controls/media.js.map +1 -0
- package/{controls → dist/controls}/number.js +10 -9
- package/dist/controls/number.js.map +1 -0
- package/{controls → dist/controls}/reference-register.js +1 -1
- package/dist/controls/reference-register.js.map +1 -0
- package/{controls → dist/controls}/reference-services.d.ts +4 -0
- package/dist/controls/reference-services.js +0 -0
- package/{controls → dist/controls}/reference.d.ts +1 -1
- package/{controls → dist/controls}/reference.js +93 -77
- package/dist/controls/reference.js.map +1 -0
- package/dist/controls/rich-text/blocks.d.ts +49 -0
- package/{controls → dist/controls}/rich-text/blocks.js +471 -144
- package/dist/controls/rich-text/blocks.js.map +1 -0
- package/{controls → dist/controls}/rich-text/catalog.d.ts +4 -1
- package/{controls → dist/controls}/rich-text/catalog.js +75 -65
- package/dist/controls/rich-text/catalog.js.map +1 -0
- package/{controls → dist/controls}/rich-text/codec.d.ts +9 -1
- package/{controls → dist/controls}/rich-text/codec.js +3 -1
- package/dist/controls/rich-text/codec.js.map +1 -0
- package/{controls → dist/controls}/rich-text/component-card.d.ts +1 -1
- package/{controls → dist/controls}/rich-text/component-card.js +417 -99
- package/dist/controls/rich-text/component-card.js.map +1 -0
- package/dist/controls/rich-text/component-panel.d.ts +47 -0
- package/dist/controls/rich-text/component-panel.js +141 -0
- package/dist/controls/rich-text/component-panel.js.map +1 -0
- package/{controls → dist/controls}/rich-text/control.d.ts +1 -2
- package/{controls → dist/controls}/rich-text/control.js +84 -42
- package/dist/controls/rich-text/control.js.map +1 -0
- package/{controls → dist/controls}/rich-text/dom.d.ts +52 -9
- package/{controls → dist/controls}/rich-text/dom.js +379 -50
- package/dist/controls/rich-text/dom.js.map +1 -0
- package/{controls → dist/controls}/rich-text/editor.d.ts +7 -0
- package/{controls → dist/controls}/rich-text/editor.js +148 -48
- package/dist/controls/rich-text/editor.js.map +1 -0
- package/{controls → dist/controls}/rich-text/floating.d.ts +6 -1
- package/{controls → dist/controls}/rich-text/floating.js +35 -18
- package/dist/controls/rich-text/floating.js.map +1 -0
- package/{controls → dist/controls}/rich-text/index.js +1 -1
- package/dist/controls/rich-text/index.js.map +1 -0
- package/dist/controls/rich-text/link-form.js +147 -0
- package/dist/controls/rich-text/link-form.js.map +1 -0
- package/{controls → dist/controls}/rich-text/markdown.js +4 -2
- package/dist/controls/rich-text/markdown.js.map +1 -0
- package/{controls → dist/controls}/rich-text/ops.js +17 -15
- package/dist/controls/rich-text/ops.js.map +1 -0
- package/dist/controls/rich-text/plain.d.ts +17 -0
- package/dist/controls/rich-text/plain.js +44 -0
- package/dist/controls/rich-text/plain.js.map +1 -0
- package/{controls → dist/controls}/rich-text/toolbar.d.ts +6 -2
- package/{controls → dist/controls}/rich-text/toolbar.js +12 -7
- package/dist/controls/rich-text/toolbar.js.map +1 -0
- package/{controls → dist/controls}/scale.js +5 -5
- package/dist/controls/scale.js.map +1 -0
- package/{controls → dist/controls}/slot-register.js +1 -1
- package/dist/controls/slot-register.js.map +1 -0
- package/{controls → dist/controls}/slot-services.d.ts +25 -0
- package/dist/controls/slot-services.js +155 -0
- package/dist/controls/slot-services.js.map +1 -0
- package/{controls → dist/controls}/slot.js +42 -24
- package/dist/controls/slot.js.map +1 -0
- package/{controls → dist/controls}/table/index.js +1 -1
- package/dist/controls/table/index.js.map +1 -0
- package/{controls → dist/controls}/table/prod.js +3 -3
- package/dist/controls/table/prod.js.map +1 -0
- package/{controls → dist/controls}/table/refs.js +13 -2
- package/dist/controls/table/refs.js.map +1 -0
- package/{controls → dist/controls}/table/stored.js +1 -1
- package/dist/controls/table/stored.js.map +1 -0
- package/{controls → dist/controls}/table/table-editor.js +51 -48
- package/dist/controls/table/table-editor.js.map +1 -0
- package/{controls → dist/controls}/table/table-link.js +3 -3
- package/dist/controls/table/table-link.js.map +1 -0
- package/{controls → dist/controls}/table/table.js +3 -3
- package/dist/controls/table/table.js.map +1 -0
- package/{controls → dist/controls}/text.d.ts +2 -2
- package/{controls → dist/controls}/text.js +78 -43
- package/dist/controls/text.js.map +1 -0
- package/dist/controls/unknown-value.d.ts +17 -0
- package/dist/controls/unknown-value.js +66 -0
- package/dist/controls/unknown-value.js.map +1 -0
- package/dist/core/core.d.ts +63 -0
- package/dist/core/core.js +171 -0
- package/dist/core/core.js.map +1 -0
- package/dist/core/facets.d.ts +347 -0
- package/dist/core/facets.js +334 -0
- package/dist/core/facets.js.map +1 -0
- package/dist/core/index.d.ts +3 -0
- package/dist/core/index.js +3 -0
- package/{engine → dist/engine}/array.js +34 -21
- package/dist/engine/array.js.map +1 -0
- package/{engine → dist/engine}/bits.js +1 -1
- package/dist/engine/bits.js.map +1 -0
- package/{engine → dist/engine}/breadcrumb.d.ts +3 -3
- package/{engine → dist/engine}/breadcrumb.js +12 -36
- package/dist/engine/breadcrumb.js.map +1 -0
- package/{engine → dist/engine}/expand.d.ts +2 -4
- package/{engine → dist/engine}/expand.js +5 -22
- package/dist/engine/expand.js.map +1 -0
- package/{engine → dist/engine}/field-list.js +1 -1
- package/dist/engine/field-list.js.map +1 -0
- package/{engine → dist/engine}/field-shell.js +249 -121
- package/dist/engine/field-shell.js.map +1 -0
- package/{engine → dist/engine}/frame.d.ts +3 -1
- package/{engine → dist/engine}/frame.js +16 -14
- package/dist/engine/frame.js.map +1 -0
- package/{engine → dist/engine}/group-summary.d.ts +2 -1
- package/{engine → dist/engine}/group-summary.js +7 -3
- package/dist/engine/group-summary.js.map +1 -0
- package/{engine → dist/engine}/grouping.d.ts +19 -5
- package/{engine → dist/engine}/grouping.js +193 -21
- package/dist/engine/grouping.js.map +1 -0
- package/{engine → dist/engine}/item-list.d.ts +11 -1
- package/{engine → dist/engine}/item-list.js +35 -13
- package/dist/engine/item-list.js.map +1 -0
- package/{engine → dist/engine}/kit-field.js +45 -10
- package/dist/engine/kit-field.js.map +1 -0
- package/{engine → dist/engine}/schema-form.d.ts +27 -2
- package/{engine → dist/engine}/schema-form.js +182 -40
- package/dist/engine/schema-form.js.map +1 -0
- package/{engine → dist/engine}/slot.js +5 -15
- package/dist/engine/slot.js.map +1 -0
- package/dist/index.js +47 -0
- package/dist/index.js.map +1 -0
- package/{kit.css → dist/kit.css} +19 -0
- package/{lib → dist/lib}/cn.js +7 -4
- package/dist/lib/cn.js.map +1 -0
- package/{lib → dist/lib}/columns.js +4 -1
- package/dist/lib/columns.js.map +1 -0
- package/{lib → dist/lib}/frames.js +2 -2
- package/dist/lib/frames.js.map +1 -0
- package/dist/lib/icon-image.d.ts +10 -0
- package/dist/lib/icon-image.js +8 -0
- package/dist/lib/icon-image.js.map +1 -0
- package/{lib → dist/lib}/icons.js +4 -3
- package/dist/lib/icons.js.map +1 -0
- package/dist/lib/input-modality.d.ts +11 -0
- package/dist/lib/input-modality.js +47 -0
- package/dist/lib/input-modality.js.map +1 -0
- package/dist/lib/key-event.d.ts +11 -0
- package/dist/lib/key-event.js +16 -0
- package/dist/lib/key-event.js.map +1 -0
- package/{lib → dist/lib}/path.js +4 -2
- package/dist/lib/path.js.map +1 -0
- package/{lib → dist/lib}/schema.d.ts +34 -3
- package/{lib → dist/lib}/schema.js +110 -13
- package/dist/lib/schema.js.map +1 -0
- package/{lib → dist/lib}/utils.js +1 -1
- package/dist/lib/utils.js.map +1 -0
- package/{lib → dist/lib}/validate.d.ts +11 -1
- package/{lib → dist/lib}/validate.js +85 -11
- package/dist/lib/validate.js.map +1 -0
- package/dist/library/analysis.d.ts +23 -0
- package/dist/library/analysis.js +160 -0
- package/dist/library/analysis.js.map +1 -0
- package/dist/library/catalog.d.ts +57 -0
- package/dist/library/catalog.js +307 -0
- package/dist/library/catalog.js.map +1 -0
- package/dist/library/coreNotes.d.ts +8 -0
- package/dist/library/coreNotes.js +111 -0
- package/dist/library/coreNotes.js.map +1 -0
- package/dist/library/coverage.d.ts +40 -0
- package/dist/library/coverage.js +59 -0
- package/dist/library/coverage.js.map +1 -0
- package/dist/library/entries/advanced.entries.d.ts +2 -0
- package/dist/library/entries/advanced.entries.js +6579 -0
- package/dist/library/entries/advanced.entries.js.map +1 -0
- package/dist/library/entries/commerce.entries.d.ts +2 -0
- package/dist/library/entries/commerce.entries.js +4140 -0
- package/dist/library/entries/commerce.entries.js.map +1 -0
- package/dist/library/entries/company.entries.d.ts +2 -0
- package/dist/library/entries/company.entries.js +2731 -0
- package/dist/library/entries/company.entries.js.map +1 -0
- package/dist/library/entries/conversion.entries.d.ts +2 -0
- package/dist/library/entries/conversion.entries.js +3707 -0
- package/dist/library/entries/conversion.entries.js.map +1 -0
- package/dist/library/entries/data.entries.d.ts +7 -0
- package/dist/library/entries/data.entries.js +4613 -0
- package/dist/library/entries/data.entries.js.map +1 -0
- package/dist/library/entries/events.entries.d.ts +2 -0
- package/dist/library/entries/events.entries.js +3428 -0
- package/dist/library/entries/events.entries.js.map +1 -0
- package/dist/library/entries/features.entries.d.ts +2 -0
- package/dist/library/entries/features.entries.js +3157 -0
- package/dist/library/entries/features.entries.js.map +1 -0
- package/dist/library/entries/heroes.entries.d.ts +2 -0
- package/dist/library/entries/heroes.entries.js +3401 -0
- package/dist/library/entries/heroes.entries.js.map +1 -0
- package/dist/library/entries/index.d.ts +3 -0
- package/dist/library/entries/index.js +35 -0
- package/dist/library/entries/index.js.map +1 -0
- package/dist/library/entries/listings.entries.d.ts +2 -0
- package/dist/library/entries/listings.entries.js +2976 -0
- package/dist/library/entries/listings.entries.js.map +1 -0
- package/dist/library/entries/longform.entries.d.ts +2 -0
- package/dist/library/entries/longform.entries.js +4227 -0
- package/dist/library/entries/longform.entries.js.map +1 -0
- package/dist/library/entries/media.entries.d.ts +2 -0
- package/dist/library/entries/media.entries.js +2781 -0
- package/dist/library/entries/media.entries.js.map +1 -0
- package/dist/library/entries/navigation.entries.d.ts +2 -0
- package/dist/library/entries/navigation.entries.js +4011 -0
- package/dist/library/entries/navigation.entries.js.map +1 -0
- package/dist/library/entries/pricing.entries.d.ts +2 -0
- package/dist/library/entries/pricing.entries.js +2383 -0
- package/dist/library/entries/pricing.entries.js.map +1 -0
- package/dist/library/entries/social-proof.entries.d.ts +2 -0
- package/dist/library/entries/social-proof.entries.js +2297 -0
- package/dist/library/entries/social-proof.entries.js.map +1 -0
- package/dist/library/examples/bento.d.ts +92 -0
- package/dist/library/examples/bento.js +201 -0
- package/dist/library/examples/bento.js.map +1 -0
- package/dist/library/examples/blocks.d.ts +14 -0
- package/dist/library/examples/blocks.js +313 -0
- package/dist/library/examples/blocks.js.map +1 -0
- package/dist/library/examples/faq.d.ts +28 -0
- package/dist/library/examples/faq.js +230 -0
- package/dist/library/examples/faq.js.map +1 -0
- package/dist/library/examples/hero.d.ts +43 -0
- package/dist/library/examples/hero.js +222 -0
- package/dist/library/examples/hero.js.map +1 -0
- package/dist/library/examples/index.d.ts +36 -0
- package/dist/library/examples/index.js +109 -0
- package/dist/library/examples/index.js.map +1 -0
- package/dist/library/examples/journalStory.d.ts +93 -0
- package/dist/library/examples/journalStory.js +338 -0
- package/dist/library/examples/journalStory.js.map +1 -0
- package/dist/library/examples/megaMenu.d.ts +134 -0
- package/dist/library/examples/megaMenu.js +442 -0
- package/dist/library/examples/megaMenu.js.map +1 -0
- package/dist/library/examples/pricing.d.ts +103 -0
- package/dist/library/examples/pricing.js +479 -0
- package/dist/library/examples/pricing.js.map +1 -0
- package/dist/library/examples/tabs.d.ts +87 -0
- package/dist/library/examples/tabs.js +180 -0
- package/dist/library/examples/tabs.js.map +1 -0
- package/dist/library/export.d.ts +42 -0
- package/dist/library/export.js +80 -0
- package/dist/library/export.js.map +1 -0
- package/dist/library/index.d.ts +13 -0
- package/dist/library/index.js +6 -0
- package/dist/library/kit-catalog.json +1510 -0
- package/dist/library/types.d.ts +42 -0
- package/dist/library/types.js +0 -0
- package/{schema → dist/schema}/adapters.js +1 -2
- package/dist/schema/adapters.js.map +1 -0
- package/{schema → dist/schema}/help.d.ts +2 -0
- package/{schema → dist/schema}/help.js +6 -4
- package/dist/schema/help.js.map +1 -0
- package/{schema → dist/schema}/scale.js +1 -1
- package/dist/schema/scale.js.map +1 -0
- package/{schema → dist/schema}/sources.js +1 -1
- package/dist/schema/sources.js.map +1 -0
- package/{schema → dist/schema}/table.js +11 -10
- package/dist/schema/table.js.map +1 -0
- package/{schema → dist/schema}/types.d.ts +29 -1
- package/{schema → dist/schema}/types.js +1 -1
- package/dist/schema/types.js.map +1 -0
- package/dist/styles.css +2 -0
- package/dist/table/table-view.d.ts +14 -0
- package/dist/table/table-view.js +140 -0
- package/dist/table/table-view.js.map +1 -0
- package/dist/table/table.css +73 -0
- package/dist/testing/corpus.d.ts +63 -0
- package/dist/testing/corpus.js +129 -0
- package/dist/testing/corpus.js.map +1 -0
- package/dist/testing/test-form.d.ts +11 -0
- package/dist/testing/test-form.js +38 -0
- package/dist/testing/test-form.js.map +1 -0
- package/dist/theme.css +345 -0
- package/dist/theme.d.ts +22 -0
- package/dist/theme.js +43 -0
- package/dist/theme.js.map +1 -0
- package/dist/tokens.css +542 -0
- package/dist/types.js +0 -0
- package/{ui → dist/ui}/action-tray.d.ts +1 -1
- package/{ui → dist/ui}/action-tray.js +20 -19
- package/dist/ui/action-tray.js.map +1 -0
- package/dist/ui/autocomplete.d.ts +30 -0
- package/dist/ui/autocomplete.js +139 -0
- package/dist/ui/autocomplete.js.map +1 -0
- package/{ui → dist/ui}/button.d.ts +3 -3
- package/{ui → dist/ui}/button.js +6 -7
- package/dist/ui/button.js.map +1 -0
- package/{ui → dist/ui}/choice-switch.js +1 -1
- package/dist/ui/choice-switch.js.map +1 -0
- package/{ui → dist/ui}/controls.js +51 -39
- package/dist/ui/controls.js.map +1 -0
- package/{ui → dist/ui}/display.d.ts +10 -3
- package/{ui → dist/ui}/display.js +57 -46
- package/dist/ui/display.js.map +1 -0
- package/{ui → dist/ui}/expanded-editor-modal.d.ts +2 -2
- package/{ui → dist/ui}/expanded-editor-modal.js +6 -6
- package/dist/ui/expanded-editor-modal.js.map +1 -0
- package/{ui → dist/ui}/field-context.js +1 -1
- package/dist/ui/field-context.js.map +1 -0
- package/{ui → dist/ui}/floating-panel.d.ts +1 -1
- package/{ui → dist/ui}/floating-panel.js +28 -12
- package/dist/ui/floating-panel.js.map +1 -0
- package/{ui → dist/ui}/index.d.ts +4 -0
- package/dist/ui/index.js +18 -0
- package/{ui → dist/ui}/input.d.ts +1 -1
- package/{ui → dist/ui}/input.js +9 -9
- package/dist/ui/input.js.map +1 -0
- package/{ui → dist/ui}/mode-bar.js +3 -3
- package/dist/ui/mode-bar.js.map +1 -0
- package/{ui → dist/ui}/overlay.d.ts +77 -5
- package/dist/ui/overlay.js +697 -0
- package/dist/ui/overlay.js.map +1 -0
- package/{ui → dist/ui}/path-crumbs.js +37 -3
- package/dist/ui/path-crumbs.js.map +1 -0
- package/{ui → dist/ui}/presence.js +2 -2
- package/dist/ui/presence.js.map +1 -0
- package/{ui → dist/ui}/select.js +89 -87
- package/dist/ui/select.js.map +1 -0
- package/{ui → dist/ui}/shortcut-hint.js +1 -1
- package/dist/ui/shortcut-hint.js.map +1 -0
- package/dist/ui/spinner.d.ts +24 -0
- package/dist/ui/spinner.js +42 -0
- package/dist/ui/spinner.js.map +1 -0
- package/dist/ui/split-button.d.ts +32 -0
- package/dist/ui/split-button.js +60 -0
- package/dist/ui/split-button.js.map +1 -0
- package/{ui → dist/ui}/surfaces.js +1 -1
- package/dist/ui/surfaces.js.map +1 -0
- package/dist/ui/tab.d.ts +38 -0
- package/dist/ui/tab.js +87 -0
- package/dist/ui/tab.js.map +1 -0
- package/dist/ui/toast.d.ts +20 -0
- package/dist/ui/toast.js +115 -0
- package/dist/ui/toast.js.map +1 -0
- package/{ui → dist/ui}/tooltip-root.d.ts +4 -3
- package/{ui → dist/ui}/tooltip-root.js +9 -8
- package/dist/ui/tooltip-root.js.map +1 -0
- package/{ui → dist/ui}/variants.js +1 -1
- package/dist/ui/variants.js.map +1 -0
- package/package.json +77 -23
- package/adapters/icons.js.map +0 -1
- package/adapters/lossy.js +0 -233
- package/adapters/lossy.js.map +0 -1
- package/adapters/prod-types.js.map +0 -1
- package/adapters/schema.js.map +0 -1
- package/adapters/values.js.map +0 -1
- package/brand/logo.js +0 -9
- package/brand/logo.js.map +0 -1
- package/context.js.map +0 -1
- package/controls/button.js.map +0 -1
- package/controls/c1.js.map +0 -1
- package/controls/c2.js.map +0 -1
- package/controls/choice.js.map +0 -1
- package/controls/code-register.js.map +0 -1
- package/controls/code.js.map +0 -1
- package/controls/color.js.map +0 -1
- package/controls/date-register.js.map +0 -1
- package/controls/date-zone.js.map +0 -1
- package/controls/date.js.map +0 -1
- package/controls/form-picker-register.js.map +0 -1
- package/controls/form-picker.js.map +0 -1
- package/controls/icon-register.js.map +0 -1
- package/controls/icon.js.map +0 -1
- package/controls/index.js.map +0 -1
- package/controls/json-register.js.map +0 -1
- package/controls/json.js.map +0 -1
- package/controls/link.js.map +0 -1
- package/controls/location-register.js.map +0 -1
- package/controls/location.js.map +0 -1
- package/controls/media-register.js.map +0 -1
- package/controls/media.js.map +0 -1
- package/controls/number.js.map +0 -1
- package/controls/reference-register.js.map +0 -1
- package/controls/reference.js.map +0 -1
- package/controls/rich-text/blocks.d.ts +0 -28
- package/controls/rich-text/blocks.js.map +0 -1
- package/controls/rich-text/catalog.js.map +0 -1
- package/controls/rich-text/codec.js.map +0 -1
- package/controls/rich-text/component-card.js.map +0 -1
- package/controls/rich-text/control.js.map +0 -1
- package/controls/rich-text/dom.js.map +0 -1
- package/controls/rich-text/editor.js.map +0 -1
- package/controls/rich-text/floating.js.map +0 -1
- package/controls/rich-text/index.js.map +0 -1
- package/controls/rich-text/link-form.js +0 -111
- package/controls/rich-text/link-form.js.map +0 -1
- package/controls/rich-text/markdown.js.map +0 -1
- package/controls/rich-text/ops.js.map +0 -1
- package/controls/rich-text/toolbar.js.map +0 -1
- package/controls/scale.js.map +0 -1
- package/controls/slot-register.js.map +0 -1
- package/controls/slot-services.js +0 -38
- package/controls/slot-services.js.map +0 -1
- package/controls/slot.js.map +0 -1
- package/controls/table/index.js.map +0 -1
- package/controls/table/prod.js.map +0 -1
- package/controls/table/refs.js.map +0 -1
- package/controls/table/stored.js.map +0 -1
- package/controls/table/table-editor.js.map +0 -1
- package/controls/table/table-link.js.map +0 -1
- package/controls/table/table.js.map +0 -1
- package/controls/text.js.map +0 -1
- package/engine/array.js.map +0 -1
- package/engine/bits.js.map +0 -1
- package/engine/breadcrumb.js.map +0 -1
- package/engine/expand.js.map +0 -1
- package/engine/field-list.js.map +0 -1
- package/engine/field-shell.js.map +0 -1
- package/engine/frame.js.map +0 -1
- package/engine/group-summary.js.map +0 -1
- package/engine/grouping.js.map +0 -1
- package/engine/item-list.js.map +0 -1
- package/engine/kit-field.js.map +0 -1
- package/engine/schema-form.js.map +0 -1
- package/engine/slot.js.map +0 -1
- package/index.js +0 -55
- package/index.js.map +0 -1
- package/lib/cn.js.map +0 -1
- package/lib/columns.js.map +0 -1
- package/lib/frames.js.map +0 -1
- package/lib/icons.js.map +0 -1
- package/lib/path.js.map +0 -1
- package/lib/schema.js.map +0 -1
- package/lib/utils.js.map +0 -1
- package/lib/validate.js.map +0 -1
- package/schema/adapters.js.map +0 -1
- package/schema/help.js.map +0 -1
- package/schema/scale.js.map +0 -1
- package/schema/sources.js.map +0 -1
- package/schema/table.js.map +0 -1
- package/schema/types.js.map +0 -1
- package/ui/action-tray.js.map +0 -1
- package/ui/button.js.map +0 -1
- package/ui/choice-switch.js.map +0 -1
- package/ui/controls.js.map +0 -1
- package/ui/display.js.map +0 -1
- package/ui/expanded-editor-modal.js.map +0 -1
- package/ui/field-context.js.map +0 -1
- package/ui/floating-panel.js.map +0 -1
- package/ui/index.js +0 -13
- package/ui/input.js.map +0 -1
- package/ui/mode-bar.js.map +0 -1
- package/ui/overlay.js +0 -378
- package/ui/overlay.js.map +0 -1
- package/ui/path-crumbs.js.map +0 -1
- package/ui/presence.js.map +0 -1
- package/ui/select.js.map +0 -1
- package/ui/shortcut-hint.js.map +0 -1
- package/ui/surfaces.js.map +0 -1
- package/ui/tooltip-root.js.map +0 -1
- package/ui/variants.js.map +0 -1
- /package/{_virtual → dist/_virtual}/_rolldown/runtime.js +0 -0
- /package/{adapters → dist/adapters}/icons.d.ts +0 -0
- /package/{brand → dist/brand}/logo.d.ts +0 -0
- /package/{controls → dist/controls}/c1.d.ts +0 -0
- /package/{controls → dist/controls}/c2.d.ts +0 -0
- /package/{controls → dist/controls}/code-register.d.ts +0 -0
- /package/{controls → dist/controls}/code.d.ts +0 -0
- /package/{controls → dist/controls}/color.d.ts +0 -0
- /package/{controls → dist/controls}/date-register.d.ts +0 -0
- /package/{controls → dist/controls}/date-zone.d.ts +0 -0
- /package/{controls → dist/controls}/date.d.ts +0 -0
- /package/{controls → dist/controls}/form-picker-register.d.ts +0 -0
- /package/{controls → dist/controls}/form-picker.d.ts +0 -0
- /package/{controls → dist/controls}/icon-register.d.ts +0 -0
- /package/{controls → dist/controls}/json-register.d.ts +0 -0
- /package/{controls → dist/controls}/json.d.ts +0 -0
- /package/{controls → dist/controls}/link.d.ts +0 -0
- /package/{controls → dist/controls}/location-register.d.ts +0 -0
- /package/{controls → dist/controls}/location.d.ts +0 -0
- /package/{controls → dist/controls}/media-register.d.ts +0 -0
- /package/{controls → dist/controls}/number.d.ts +0 -0
- /package/{controls → dist/controls}/reference-register.d.ts +0 -0
- /package/{controls → dist/controls}/rich-text/index.d.ts +0 -0
- /package/{controls → dist/controls}/rich-text/link-form.d.ts +0 -0
- /package/{controls → dist/controls}/rich-text/markdown.d.ts +0 -0
- /package/{controls → dist/controls}/rich-text/ops.d.ts +0 -0
- /package/{controls → dist/controls}/scale.d.ts +0 -0
- /package/{controls → dist/controls}/slot-register.d.ts +0 -0
- /package/{controls → dist/controls}/slot.d.ts +0 -0
- /package/{controls → dist/controls}/table/index.d.ts +0 -0
- /package/{controls → dist/controls}/table/prod.d.ts +0 -0
- /package/{controls → dist/controls}/table/refs.d.ts +0 -0
- /package/{controls → dist/controls}/table/stored.d.ts +0 -0
- /package/{controls → dist/controls}/table/table-editor.d.ts +0 -0
- /package/{controls → dist/controls}/table/table-link.d.ts +0 -0
- /package/{controls → dist/controls}/table/table.d.ts +0 -0
- /package/{engine → dist/engine}/array.d.ts +0 -0
- /package/{engine → dist/engine}/bits.d.ts +0 -0
- /package/{engine → dist/engine}/field-list.d.ts +0 -0
- /package/{engine → dist/engine}/field-shell.d.ts +0 -0
- /package/{engine → dist/engine}/kit-field.d.ts +0 -0
- /package/{engine → dist/engine}/slot.d.ts +0 -0
- /package/{index.d.ts → dist/index.d.ts} +0 -0
- /package/{lib → dist/lib}/cn.d.ts +0 -0
- /package/{lib → dist/lib}/columns.d.ts +0 -0
- /package/{lib → dist/lib}/frames.d.ts +0 -0
- /package/{lib → dist/lib}/icons.d.ts +0 -0
- /package/{lib → dist/lib}/path.d.ts +0 -0
- /package/{lib → dist/lib}/utils.d.ts +0 -0
- /package/{schema → dist/schema}/adapters.d.ts +0 -0
- /package/{schema → dist/schema}/scale.d.ts +0 -0
- /package/{schema → dist/schema}/sources.d.ts +0 -0
- /package/{schema → dist/schema}/table.d.ts +0 -0
- /package/{types.d.ts → dist/types.d.ts} +0 -0
- /package/{ui → dist/ui}/choice-switch.d.ts +0 -0
- /package/{ui → dist/ui}/controls.d.ts +0 -0
- /package/{ui → dist/ui}/field-context.d.ts +0 -0
- /package/{ui → dist/ui}/mode-bar.d.ts +0 -0
- /package/{ui → dist/ui}/path-crumbs.d.ts +0 -0
- /package/{ui → dist/ui}/presence.d.ts +0 -0
- /package/{ui → dist/ui}/select.d.ts +0 -0
- /package/{ui → dist/ui}/shortcut-hint.d.ts +0 -0
- /package/{ui → dist/ui}/surfaces.d.ts +0 -0
- /package/{ui → dist/ui}/variants.d.ts +0 -0
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import type { ScaleSchema, ScaleValue } from "../schema/types";
|
|
10
10
|
import type { TableValue } from "../schema/table";
|
|
11
|
-
import { type DockIconName, type ProdButtonValue, type ProdFormRef, type ProdImageCrop, type ProdImageValue, type ProdLinkValue, type ProdPolymorphicRef, type ProdVideoValue } from "./prod-types";
|
|
11
|
+
import { type DockIconName, type ProdButtonValue, type ProdFormRef, type ProdImageCrop, type ProdImageValue, type ProdLinkValue, type ProdPolymorphicRef, type ProdTargetRef, type ProdVideoValue } from "./prod-types";
|
|
12
12
|
export interface ValueResult<T> {
|
|
13
13
|
value: T;
|
|
14
14
|
/** V2 keys (dotted, relative to the value) production cannot keep. */
|
|
@@ -49,7 +49,8 @@ export interface V2ImageValue {
|
|
|
49
49
|
x: number;
|
|
50
50
|
y: number;
|
|
51
51
|
};
|
|
52
|
-
|
|
52
|
+
/** A preset to cut (written as its rect, so it needs the size), or the stored rect itself, carried as it was read. */
|
|
53
|
+
crop?: V2ImageCrop | ProdImageCrop;
|
|
53
54
|
caption?: string;
|
|
54
55
|
name?: string;
|
|
55
56
|
width?: number;
|
|
@@ -103,16 +104,24 @@ export interface ImageAsset {
|
|
|
103
104
|
* `lost`. Passing the asset to imageFromProd restores them.
|
|
104
105
|
*/
|
|
105
106
|
export declare function imageToProd(v: V2ImageValue | string | null | undefined): ValueResult<ProdImageValue | string | null>;
|
|
106
|
-
/**
|
|
107
|
+
/** A crop window as prod stores it: four 0–1 edges that leave something on both axes. */
|
|
108
|
+
export declare function isCropRect(v: unknown): v is ProdImageCrop;
|
|
109
|
+
/**
|
|
110
|
+
* Pass the asset's pixel size to read a stored crop rect back as its preset and to restore width / height / size.
|
|
111
|
+
* An older value written as `{ src, alt }` (the block's own image props) reads as the same picture and alt text.
|
|
112
|
+
*/
|
|
107
113
|
export declare function imageFromProd(v: unknown, asset?: ImageAsset): V2ImageValue | string | null;
|
|
114
|
+
export declare const targetTag: (kind: ProdTargetRef["kind"], id: string) => string;
|
|
115
|
+
export declare function parseTargetTag(v: string): ProdTargetRef | null;
|
|
108
116
|
/**
|
|
109
117
|
* V2 stores the target id (`"en_12"`; a list for many). Prod stores the same id, or `{ entryId, modelSlug }` on a
|
|
110
|
-
* polymorphic field (pass `modelSlug`), or `{ formId }` on a component `form` prop (`to: "form"`)
|
|
118
|
+
* polymorphic field (pass `modelSlug`), or `{ formId }` on a component `form` prop (`to: "form"`), or `{ kind, id }` for
|
|
119
|
+
* a tagged page / form / collection pick (`"page:pg_1"`).
|
|
111
120
|
*/
|
|
112
121
|
export declare function referenceToProd(v: string | string[] | null | undefined, opts?: {
|
|
113
122
|
to?: "form";
|
|
114
123
|
modelSlug?: string;
|
|
115
|
-
}): ValueResult<string | string[] | ProdPolymorphicRef | ProdFormRef | null>;
|
|
124
|
+
}): ValueResult<string | (string | ProdTargetRef)[] | ProdPolymorphicRef | ProdFormRef | ProdTargetRef | null>;
|
|
116
125
|
export declare function referenceFromProd(v: unknown): string | string[] | null;
|
|
117
126
|
/**
|
|
118
127
|
* Prod has no table type: the schema adapter stores a V2 table as a `json` field (named in the lossy ledger), and
|
|
@@ -196,5 +205,17 @@ export declare const zoneListToProd: (v: unknown[] | null | undefined) => {
|
|
|
196
205
|
repeatable: unknown[];
|
|
197
206
|
};
|
|
198
207
|
export declare const zoneListFromProd: (v: unknown) => unknown[];
|
|
208
|
+
/** A row of a polymorphic list: V2's and prod's shape alike, `{ _key?, _type, ...fields }` (BE prop-fields typedRowIssues). */
|
|
209
|
+
export type TypedRow = Record<string, unknown> & {
|
|
210
|
+
_type: string;
|
|
211
|
+
_key?: string;
|
|
212
|
+
};
|
|
213
|
+
/**
|
|
214
|
+
* V2 rows → the stored rows. Prod keeps V2's own row shape, so a row passes as it is after `mapRow` (its fields through
|
|
215
|
+
* their plans); a row with no `_type` has no item type to be judged by (item_type_required) and is named, by index.
|
|
216
|
+
*/
|
|
217
|
+
export declare function typedRowsToProd(v: unknown, mapRow?: (row: TypedRow, i: number) => Record<string, unknown>): ValueResult<unknown>;
|
|
218
|
+
/** Stored rows → V2 rows: the same shape, each row through `mapRow`; a row that is not typed passes as stored. */
|
|
219
|
+
export declare function typedRowsFromProd(v: unknown, mapRow?: (row: TypedRow, i: number) => Record<string, unknown>): unknown;
|
|
199
220
|
/** A dock icon name passes through; anything else is not a prod icon. */
|
|
200
221
|
export declare const isDockIcon: (v: unknown) => v is DockIconName;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BUTTON_SIZES, BUTTON_VARIANTS, DOCK_ICON_NAME_SET, LINK_RELS, LINK_VALUE_TYPES, VIDEO_VALUE_KEYS } from "./prod-types.js";
|
|
2
|
-
//#region src/
|
|
2
|
+
//#region src/adapters/values.ts
|
|
3
3
|
var isObj = (v) => !!v && typeof v === "object" && !Array.isArray(v);
|
|
4
4
|
/** The keys only a button carries; a link field never stores them. */
|
|
5
5
|
var BUTTON_ONLY = [
|
|
@@ -125,6 +125,7 @@ function buttonFromProd(v) {
|
|
|
125
125
|
}
|
|
126
126
|
if (out.style !== void 0 && out.variant === out.style) delete out.variant;
|
|
127
127
|
if (out.icon === null) delete out.icon;
|
|
128
|
+
if ((out.label === void 0 || out.label === "") && out.href === "#") out.href = "";
|
|
128
129
|
return out;
|
|
129
130
|
}
|
|
130
131
|
var ZONED = /^(.*)\[([^\]]+)\]$/;
|
|
@@ -223,11 +224,17 @@ function imageToProd(v) {
|
|
|
223
224
|
x: round(v.focal.x / 100),
|
|
224
225
|
y: round(v.focal.y / 100)
|
|
225
226
|
};
|
|
226
|
-
if (v.crop
|
|
227
|
+
if (isCropRect(v.crop)) out.crop = {
|
|
228
|
+
top: v.crop.top,
|
|
229
|
+
right: v.crop.right,
|
|
230
|
+
bottom: v.crop.bottom,
|
|
231
|
+
left: v.crop.left
|
|
232
|
+
};
|
|
233
|
+
else if (typeof v.crop === "string" && v.crop !== "original") {
|
|
227
234
|
const rect = v.width && v.height ? cropRect(v.crop, v.width, v.height, v.focal) : void 0;
|
|
228
235
|
if (rect) out.crop = rect;
|
|
229
|
-
lost.push("crop");
|
|
230
|
-
}
|
|
236
|
+
else lost.push("crop");
|
|
237
|
+
}
|
|
231
238
|
for (const k of [
|
|
232
239
|
"caption",
|
|
233
240
|
"width",
|
|
@@ -251,31 +258,58 @@ function imageToProd(v) {
|
|
|
251
258
|
lost
|
|
252
259
|
};
|
|
253
260
|
}
|
|
254
|
-
/**
|
|
261
|
+
/** A crop window as prod stores it: four 0–1 edges that leave something on both axes. */
|
|
262
|
+
function isCropRect(v) {
|
|
263
|
+
if (!isObj(v)) return false;
|
|
264
|
+
const { top, right, bottom, left } = v;
|
|
265
|
+
const num = (n) => typeof n === "number" && Number.isFinite(n) && n >= 0 && n <= 1;
|
|
266
|
+
return num(top) && num(right) && num(bottom) && num(left) && top + bottom < 1 && left + right < 1;
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Pass the asset's pixel size to read a stored crop rect back as its preset and to restore width / height / size.
|
|
270
|
+
* An older value written as `{ src, alt }` (the block's own image props) reads as the same picture and alt text.
|
|
271
|
+
*/
|
|
255
272
|
function imageFromProd(v, asset = {}) {
|
|
256
273
|
if (typeof v === "string") return v;
|
|
257
|
-
if (!isObj(v)
|
|
274
|
+
if (!isObj(v)) return null;
|
|
275
|
+
const url = typeof v.url === "string" ? v.url : typeof v.src === "string" ? v.src : null;
|
|
276
|
+
if (url === null) return null;
|
|
258
277
|
const p = v;
|
|
259
|
-
const out = { url
|
|
278
|
+
const out = { url };
|
|
260
279
|
if (p.id !== void 0) out.id = p.id;
|
|
261
280
|
if (p.name !== void 0) out.name = p.name;
|
|
262
281
|
if (p.altText !== void 0) out.alt = p.altText;
|
|
282
|
+
else if (typeof p.alt === "string") out.alt = p.alt;
|
|
263
283
|
if (p.focal) out.focal = {
|
|
264
284
|
x: round(p.focal.x * 100),
|
|
265
285
|
y: round(p.focal.y * 100)
|
|
266
286
|
};
|
|
267
|
-
if (p.crop
|
|
268
|
-
const preset = cropPreset(p.crop, asset.width, asset.height);
|
|
269
|
-
if (preset) out.crop = preset;
|
|
270
|
-
}
|
|
287
|
+
if (isCropRect(p.crop)) out.crop = (asset.width && asset.height ? cropPreset(p.crop, asset.width, asset.height) : void 0) ?? { ...p.crop };
|
|
271
288
|
if (asset.width !== void 0) out.width = asset.width;
|
|
272
289
|
if (asset.height !== void 0) out.height = asset.height;
|
|
273
290
|
if (asset.size !== void 0) out.size = asset.size;
|
|
274
291
|
return out;
|
|
275
292
|
}
|
|
276
293
|
/**
|
|
294
|
+
* A V2 reference value is the target's id. Prod reads a bare id as an ENTRY on a prop reference that takes entries
|
|
295
|
+
* (backend acceptsEntries), so a page, form or collection picked there travels in the kit as `"<kind>:<id>"` (the
|
|
296
|
+
* dock's reference services hand such picks back tagged) and is stored as `{ kind, id }` (targetRefOf). A stored
|
|
297
|
+
* `{ kind, id }` reads back tagged, whatever the field takes, so a save writes the same target back.
|
|
298
|
+
*/
|
|
299
|
+
var TARGET_TAG = /^(page|form|collection):(.+)$/;
|
|
300
|
+
var targetTag = (kind, id) => `${kind}:${id}`;
|
|
301
|
+
function parseTargetTag(v) {
|
|
302
|
+
const m = TARGET_TAG.exec(v);
|
|
303
|
+
return m ? {
|
|
304
|
+
kind: m[1],
|
|
305
|
+
id: m[2]
|
|
306
|
+
} : null;
|
|
307
|
+
}
|
|
308
|
+
var isTargetRef = (v) => isObj(v) && typeof v.kind === "string" && TARGET_TAG.test(`${v.kind}:x`) && typeof v.id === "string" && v.id !== "";
|
|
309
|
+
/**
|
|
277
310
|
* V2 stores the target id (`"en_12"`; a list for many). Prod stores the same id, or `{ entryId, modelSlug }` on a
|
|
278
|
-
* polymorphic field (pass `modelSlug`), or `{ formId }` on a component `form` prop (`to: "form"`)
|
|
311
|
+
* polymorphic field (pass `modelSlug`), or `{ formId }` on a component `form` prop (`to: "form"`), or `{ kind, id }` for
|
|
312
|
+
* a tagged page / form / collection pick (`"page:pg_1"`).
|
|
279
313
|
*/
|
|
280
314
|
function referenceToProd(v, opts = {}) {
|
|
281
315
|
if (v == null || v === "") return {
|
|
@@ -283,13 +317,18 @@ function referenceToProd(v, opts = {}) {
|
|
|
283
317
|
lost: []
|
|
284
318
|
};
|
|
285
319
|
if (Array.isArray(v)) return {
|
|
286
|
-
value:
|
|
320
|
+
value: v.map((x) => parseTargetTag(x) ?? x),
|
|
287
321
|
lost: []
|
|
288
322
|
};
|
|
289
323
|
if (opts.to === "form") return {
|
|
290
324
|
value: { formId: v },
|
|
291
325
|
lost: []
|
|
292
326
|
};
|
|
327
|
+
const target = parseTargetTag(v);
|
|
328
|
+
if (target) return {
|
|
329
|
+
value: target,
|
|
330
|
+
lost: []
|
|
331
|
+
};
|
|
293
332
|
if (opts.modelSlug) return {
|
|
294
333
|
value: {
|
|
295
334
|
entryId: v,
|
|
@@ -302,7 +341,7 @@ function referenceToProd(v, opts = {}) {
|
|
|
302
341
|
lost: []
|
|
303
342
|
};
|
|
304
343
|
}
|
|
305
|
-
var refId = (v) => typeof v === "string" ? v || null : isObj(v) ? typeof v.entryId === "string" && v.entryId || typeof v.formId === "string" && v.formId || null : null;
|
|
344
|
+
var refId = (v) => typeof v === "string" ? v || null : isTargetRef(v) ? targetTag(v.kind, v.id) : isObj(v) ? typeof v.entryId === "string" && v.entryId || typeof v.formId === "string" && v.formId || null : null;
|
|
306
345
|
function referenceFromProd(v) {
|
|
307
346
|
if (Array.isArray(v)) return v.map(refId).filter((x) => !!x);
|
|
308
347
|
return refId(v);
|
|
@@ -527,8 +566,10 @@ function codeToProd(v, opts = {}) {
|
|
|
527
566
|
};
|
|
528
567
|
const lost = Object.keys(v).filter((k) => k !== "code" && k !== "language");
|
|
529
568
|
const out = { code };
|
|
530
|
-
if (v.language !== void 0)
|
|
531
|
-
|
|
569
|
+
if (v.language !== void 0) {
|
|
570
|
+
if (typeof v.language === "string" && (!opts.languages || opts.languages.includes(v.language))) out.language = v.language;
|
|
571
|
+
else lost.push("language");
|
|
572
|
+
}
|
|
532
573
|
return {
|
|
533
574
|
value: out,
|
|
534
575
|
lost
|
|
@@ -545,9 +586,38 @@ function codeFromProd(v) {
|
|
|
545
586
|
/** A V2 list of object items is stored by prod as the repeatable zone of its array: `{ repeatable: [...] }`. */
|
|
546
587
|
var zoneListToProd = (v) => ({ repeatable: v ? [...v] : [] });
|
|
547
588
|
var zoneListFromProd = (v) => isObj(v) && Array.isArray(v.repeatable) ? [...v.repeatable] : Array.isArray(v) ? [...v] : [];
|
|
589
|
+
var isTypedRow = (v) => isObj(v) && typeof v._type === "string" && v._type !== "";
|
|
590
|
+
/**
|
|
591
|
+
* V2 rows → the stored rows. Prod keeps V2's own row shape, so a row passes as it is after `mapRow` (its fields through
|
|
592
|
+
* their plans); a row with no `_type` has no item type to be judged by (item_type_required) and is named, by index.
|
|
593
|
+
*/
|
|
594
|
+
function typedRowsToProd(v, mapRow = (r) => ({ ...r })) {
|
|
595
|
+
if (v == null) return {
|
|
596
|
+
value: v ?? null,
|
|
597
|
+
lost: []
|
|
598
|
+
};
|
|
599
|
+
if (!Array.isArray(v)) return {
|
|
600
|
+
value: v,
|
|
601
|
+
lost: ["(value)"]
|
|
602
|
+
};
|
|
603
|
+
const lost = [];
|
|
604
|
+
return {
|
|
605
|
+
value: v.map((row, i) => {
|
|
606
|
+
if (isTypedRow(row)) return mapRow(row, i);
|
|
607
|
+
lost.push(String(i));
|
|
608
|
+
return row;
|
|
609
|
+
}),
|
|
610
|
+
lost
|
|
611
|
+
};
|
|
612
|
+
}
|
|
613
|
+
/** Stored rows → V2 rows: the same shape, each row through `mapRow`; a row that is not typed passes as stored. */
|
|
614
|
+
function typedRowsFromProd(v, mapRow = (r) => ({ ...r })) {
|
|
615
|
+
if (!Array.isArray(v)) return v;
|
|
616
|
+
return v.map((row, i) => isTypedRow(row) ? mapRow(row, i) : row);
|
|
617
|
+
}
|
|
548
618
|
/** A dock icon name passes through; anything else is not a prod icon. */
|
|
549
619
|
var isDockIcon = (v) => typeof v === "string" && DOCK_ICON_NAME_SET.has(v);
|
|
550
620
|
//#endregion
|
|
551
|
-
export { buttonFromProd, buttonToProd, codeFromProd, codeToProd, cropPreset, cropRect, dateFromProd, dateToProd, datetimeFromProd, datetimeToProd, imageFromProd, imageToProd, isDockIcon, linkFromProd, linkToProd, listFromProd, listToProd, ratingFromProd, ratingToProd, referenceFromProd, referenceToProd, scaleFromProd, scaleToProd, tableFromProd, tableToProd, tagsFromProd, tagsToProd, videoFromProd, videoToProd, zoneListFromProd, zoneListToProd };
|
|
621
|
+
export { buttonFromProd, buttonToProd, codeFromProd, codeToProd, cropPreset, cropRect, dateFromProd, dateToProd, datetimeFromProd, datetimeToProd, imageFromProd, imageToProd, isCropRect, isDockIcon, linkFromProd, linkToProd, listFromProd, listToProd, parseTargetTag, ratingFromProd, ratingToProd, referenceFromProd, referenceToProd, scaleFromProd, scaleToProd, tableFromProd, tableToProd, tagsFromProd, tagsToProd, targetTag, typedRowsFromProd, typedRowsToProd, videoFromProd, videoToProd, zoneListFromProd, zoneListToProd };
|
|
552
622
|
|
|
553
623
|
//# sourceMappingURL=values.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"values.js","names":[],"sources":["../../src/adapters/values.ts"],"sourcesContent":["/**\n * VALUE ADAPTERS — a V2 stored value ↔ the value production stores for the same field (Lane C map,\n * docs/design-system/v2-map/C-controls.md §2, updated for F1). Storage stays prod's: `*ToProd` returns what the\n * backend accepts, `*FromProd` the V2 shape the kit controls edit.\n *\n * Every `*ToProd` returns `{ value, lost }`. `lost` names the V2 keys prod cannot keep (relative to the value), so\n * `*FromProd(*ToProd(v).value)` equals `v` minus exactly those keys. Nothing is dropped without being named.\n */\nimport type { ScaleSchema, ScaleValue } from \"../schema/types\";\nimport type { TableValue } from \"../schema/table\";\nimport {\n BUTTON_SIZES,\n BUTTON_VARIANTS,\n CODE_MAX_LENGTH,\n DOCK_ICON_NAME_SET,\n LINK_RELS,\n LINK_VALUE_TYPES,\n RATING_DEFAULT_MAX,\n TAG_VALUE_MAX_LENGTH,\n VIDEO_TRANSCRIPT_MAX,\n VIDEO_VALUE_KEYS,\n type DockIconName,\n type ProdButtonValue,\n type ProdFormRef,\n type ProdImageCrop,\n type ProdImageValue,\n type ProdLinkValue,\n type ProdPolymorphicRef,\n type ProdTargetRef,\n type ProdVideoValue,\n type ScaleUnit,\n} from \"./prod-types\";\n\nexport interface ValueResult<T> {\n value: T;\n /** V2 keys (dotted, relative to the value) production cannot keep. */\n lost: string[];\n}\n\ntype Obj = Record<string, unknown>;\nconst isObj = (v: unknown): v is Obj => !!v && typeof v === \"object\" && !Array.isArray(v);\n\n/* ── V2 value shapes (DESIGN §6.7, §6.9; V2 HEAD controls/link.tsx, controls/media.tsx) ── */\nexport type V2LinkType = \"page\" | \"entry\" | \"url\" | \"section\" | \"email\" | \"phone\" | \"file\";\nexport type V2ButtonStyle = \"primary\" | \"secondary\" | \"outline\" | \"link\";\nexport interface V2LinkValue {\n type?: V2LinkType;\n href: string;\n label?: string;\n title?: string;\n pageId?: string;\n entryId?: string;\n anchor?: string;\n assetId?: string;\n email?: string;\n subject?: string;\n phone?: string;\n target?: \"_self\" | \"_blank\";\n newTab?: boolean;\n rel?: \"follow\" | \"nofollow\" | \"ugc\" | \"sponsored\";\n}\nexport interface V2ButtonValue extends V2LinkValue {\n style?: V2ButtonStyle;\n variant?: V2ButtonStyle;\n size?: \"sm\" | \"md\" | \"lg\";\n arrow?: boolean;\n icon?: string;\n fullWidth?: boolean;\n}\nexport type V2ImageCrop = \"original\" | \"16:9\" | \"4:3\" | \"1:1\" | \"4:5\";\nexport interface V2ImageValue {\n url: string;\n alt?: string;\n /** percent */\n focal?: { x: number; y: number };\n /** A preset to cut (written as its rect, so it needs the size), or the stored rect itself, carried as it was read. */\n crop?: V2ImageCrop | ProdImageCrop;\n caption?: string;\n name?: string;\n width?: number;\n height?: number;\n size?: number;\n id?: string;\n}\n\n/** The keys only a button carries; a link field never stores them. */\nconst BUTTON_ONLY = [\"style\", \"variant\", \"size\", \"arrow\", \"icon\", \"fullWidth\"] as const;\nconst isScriptHref = (href: string) => /^(javascript|data|vbscript):/i.test(href.replace(/[\\u0000- \\u007F]/g, \"\"));\n\n/* ── link ─────────────────────────────────────────────────────────────── */\n/**\n * F1 stores the V2 link object as sent (link-value.ts: the kit's pageId, entryId, anchor, email, phone, label… are\n * kept), plus `ref` for a page / entry link so delivery resolves it. A bare href string stays a string.\n */\nexport function linkToProd(v: V2LinkValue | string | null | undefined): ValueResult<ProdLinkValue | string | null> {\n if (v == null) return { value: null, lost: [] };\n if (typeof v === \"string\") return isScriptHref(v) ? { value: null, lost: [\"\"] } : { value: v, lost: [] };\n if (isScriptHref(v.href)) return { value: null, lost: [\"\"] };\n const lost: string[] = [];\n const out: Obj = {};\n for (const [k, x] of Object.entries(v)) {\n if ((BUTTON_ONLY as readonly string[]).includes(k)) lost.push(k);\n else out[k] = x;\n }\n if (v.type !== undefined && !(LINK_VALUE_TYPES as readonly string[]).includes(v.type)) {\n lost.push(\"type\");\n delete out.type;\n }\n // The backend refuses a target that disagrees with newTab; newTab is the one the kit reads.\n if (typeof v.newTab === \"boolean\" && v.target !== undefined && v.newTab !== (v.target === \"_blank\")) {\n lost.push(\"target\");\n delete out.target;\n }\n const ref = v.type === \"page\" ? v.pageId : v.type === \"entry\" ? v.entryId : undefined;\n if (ref) out.ref = ref;\n return { value: out as unknown as ProdLinkValue, lost };\n}\n\nexport function linkFromProd(v: unknown): V2LinkValue | string | null {\n if (typeof v === \"string\") return v;\n if (!isObj(v) || typeof v.href !== \"string\") return null;\n const { ref, ...rest } = v;\n const out = rest as unknown as V2LinkValue;\n // `ref` mirrors the kit's own id key; a ref with no twin (written by another client) becomes that key.\n if (typeof ref === \"string\") {\n if (out.type === \"page\" && out.pageId === undefined) out.pageId = ref;\n if (out.type === \"entry\" && out.entryId === undefined) out.entryId = ref;\n }\n return out;\n}\n\n/* ── button ───────────────────────────────────────────────────────────── */\n/**\n * A V2 button is a link with a label and a look, flattened. Prod's ButtonValue reads `label`, `href` (string or link\n * object), `variant`, `size`, `arrow`, `icon` (a dock icon name), `newTab`, `rel`; other keys are kept and ignored,\n * so the link half (type, pageId, anchor…) rides along as sent. The look is written as `variant` (what renderers read).\n */\nexport function buttonToProd(v: V2ButtonValue | null | undefined): ValueResult<ProdButtonValue | null> {\n if (v == null) return { value: null, lost: [] };\n if (typeof v.href === \"string\" && isScriptHref(v.href)) return { value: null, lost: [\"\"] };\n const lost: string[] = [];\n const out: Obj = { ...v };\n const valid = (x: unknown) => typeof x === \"string\" && (BUTTON_VARIANTS as readonly string[]).includes(x);\n // the first valid of variant, style is the look prod renders; an invalid variant never shadows a valid style\n const look = [v.variant, v.style].find(valid);\n if (look !== undefined) out.variant = look;\n else delete out.variant;\n if (v.variant !== undefined && !valid(v.variant)) lost.push(\"variant\");\n // Both set: the kit writes them in sync, prod keeps one look.\n if (v.style !== undefined && v.variant !== undefined && v.style === v.variant) lost.push(\"variant\");\n if (v.size !== undefined && !(BUTTON_SIZES as readonly string[]).includes(v.size)) {\n lost.push(\"size\");\n delete out.size;\n }\n if (v.icon !== undefined && !DOCK_ICON_NAME_SET.has(v.icon)) {\n lost.push(\"icon\");\n delete out.icon;\n }\n // A button's rel is one of nofollow / sponsored / ugc; \"follow\" is no rel at all.\n if (v.rel !== undefined && !(LINK_RELS as readonly string[]).includes(v.rel)) {\n lost.push(\"rel\");\n delete out.rel;\n }\n if (typeof v.newTab === \"boolean\" && v.target !== undefined && v.newTab !== (v.target === \"_blank\")) {\n lost.push(\"target\");\n delete out.target;\n }\n // fullWidth is true or false (the backend refuses anything else a write brings: button_full_width_invalid)\n if (v.fullWidth !== undefined && typeof v.fullWidth !== \"boolean\") {\n lost.push(\"fullWidth\");\n delete out.fullWidth;\n }\n // prod's ButtonValue requires both; a filled-in \"\" reads back where the kit had nothing, so it is named\n if (typeof out.label !== \"string\") {\n out.label = \"\";\n lost.push(\"label\");\n }\n if (typeof out.href !== \"string\") {\n out.href = \"\";\n lost.push(\"href\");\n }\n return { value: out as unknown as ProdButtonValue, lost: [...new Set(lost)] };\n}\n\nexport function buttonFromProd(v: unknown): V2ButtonValue | null {\n if (!isObj(v)) return null;\n const out: Obj = { ...v };\n if (isObj(v.href)) {\n // A link object in `href` (written by another client): flatten it the way the kit stores a button.\n const link = linkFromProd(v.href);\n if (isObj(link)) Object.assign(out, link);\n }\n if (out.style !== undefined && out.variant === out.style) delete out.variant;\n if (out.icon === null) delete out.icon;\n // An unfilled button: no label, and the bare \"#\" a new button block starts with (blockDefs button) or the classic\n // editor carries. It links nowhere, so it reads as V2's empty button (\"Add link\", a Page link), never as a link to a\n // section of this page. The \"\" it reads as is what an untouched form compares against, so opening it writes nothing.\n if ((out.label === undefined || out.label === \"\") && out.href === \"#\") out.href = \"\";\n return out as unknown as V2ButtonValue;\n}\n\n/* ── date / datetime ──────────────────────────────────────────────────── */\nconst ZONED = /^(.*)\\[([^\\]]+)\\]$/;\nconst NO_SECONDS = /^(\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2})(Z|[+-]\\d{2}:?\\d{2})?$/;\nconst OFFSET = /(?:Z|[+-]\\d{2}:?\\d{2})$/;\n\n/** A date is the same \"YYYY-MM-DD\" string on both sides. */\nexport const dateToProd = (v: string | null | undefined): ValueResult<string | null> => ({ value: v ?? null, lost: [] });\nexport const dateFromProd = (v: unknown): string | null => (typeof v === \"string\" ? v : null);\n\n/**\n * V2 stores RFC 9557 (`2026-10-14T09:00:00+05:30[Asia/Kolkata]`). Prod keeps the ISO instant with seconds and its\n * offset; a `[Zone]` suffix is checked and dropped on write. So the zone survives only as the field's own\n * `config.timezone` when that names it (pass it as `zone`); otherwise it is lost.\n */\nexport function datetimeToProd(v: string | null | undefined, opts: { zone?: string } = {}): ValueResult<string | null> {\n if (v == null || v === \"\") return { value: v ?? null, lost: [] };\n const lost: string[] = [];\n const m = ZONED.exec(v);\n let bare = m ? m[1] : v;\n // the zone reads back only from config.timezone, and only onto a value with an offset\n if (m && (m[2] !== opts.zone || !OFFSET.test(bare))) lost.push(\"zone\");\n const short = NO_SECONDS.exec(bare);\n if (short) {\n bare = `${short[1]}:00${short[2] ?? \"\"}`;\n lost.push(\"format\");\n }\n return { value: bare, lost };\n}\n\nexport function datetimeFromProd(v: unknown, opts: { zone?: string } = {}): string | null {\n if (typeof v !== \"string\") return null;\n const zone = opts.zone && opts.zone !== \"site\" ? opts.zone : undefined;\n return zone && OFFSET.test(v) && !ZONED.test(v) ? `${v}[${zone}]` : v;\n}\n\n/* ── image ────────────────────────────────────────────────────────────── */\nconst CROPS: Record<Exclude<V2ImageCrop, \"original\">, number> = { \"16:9\": 16 / 9, \"4:3\": 4 / 3, \"1:1\": 1, \"4:5\": 4 / 5 };\nconst round = (n: number) => Math.round(n * 1e6) / 1e6;\nconst clamp01 = (n: number) => Math.min(1, Math.max(0, n));\n\n/** A crop preset → the centred-on-focal rect prod stores. Needs the image's pixel size. */\nexport function cropRect(crop: V2ImageCrop, width: number, height: number, focal = { x: 50, y: 50 }): ProdImageCrop | undefined {\n if (crop === \"original\" || !(width > 0 && height > 0)) return undefined;\n const want = CROPS[crop];\n const have = width / height;\n const w = want < have ? want / have : 1;\n const h = want < have ? 1 : have / want;\n const left = clamp01(Math.min(1 - w, Math.max(0, focal.x / 100 - w / 2)));\n const top = clamp01(Math.min(1 - h, Math.max(0, focal.y / 100 - h / 2)));\n return { top: round(top), right: round(1 - left - w), bottom: round(1 - top - h), left: round(left) };\n}\n\n/** A stored rect → the preset whose aspect it cuts (within 1%), when the image's pixel size is known. */\nexport function cropPreset(rect: ProdImageCrop, width: number, height: number): V2ImageCrop | undefined {\n const w = (1 - rect.left - rect.right) * width;\n const h = (1 - rect.top - rect.bottom) * height;\n if (!(w > 0 && h > 0)) return undefined;\n const ratio = w / h;\n const hit = (Object.entries(CROPS) as [V2ImageCrop, number][]).find(([, r]) => Math.abs(ratio - r) / r < 0.01);\n return hit?.[0];\n}\n\n/** The asset facts an image value refers to but prod does not store in the value (width, height, size). */\nexport interface ImageAsset {\n width?: number;\n height?: number;\n size?: number;\n}\n\n/**\n * The contract holds against `imageFromProd(value)` with no asset (how stored defaults are read): a crop rect needs the\n * image's pixel size to read back as its preset, and width / height / size live on the asset, so all four are named in\n * `lost`. Passing the asset to imageFromProd restores them.\n */\nexport function imageToProd(v: V2ImageValue | string | null | undefined): ValueResult<ProdImageValue | string | null> {\n if (v == null) return { value: null, lost: [] };\n if (typeof v === \"string\") return { value: v, lost: [] };\n const lost: string[] = [];\n const out: ProdImageValue = { url: v.url };\n if (v.id !== undefined) out.id = v.id;\n if (v.name !== undefined) out.name = v.name;\n if (v.alt !== undefined) out.altText = v.alt;\n if (v.focal) out.focal = { x: round(v.focal.x / 100), y: round(v.focal.y / 100) };\n // A stored rect is carried as it was read (it reads back the same), a preset is cut against the picture's size, and\n // \"original\" is no crop at all. Only a preset with no size to cut against has nowhere to go.\n if (isCropRect(v.crop)) out.crop = { top: v.crop.top, right: v.crop.right, bottom: v.crop.bottom, left: v.crop.left };\n else if (typeof v.crop === \"string\" && v.crop !== \"original\") {\n const rect = v.width && v.height ? cropRect(v.crop, v.width, v.height, v.focal) : undefined;\n if (rect) out.crop = rect;\n else lost.push(\"crop\");\n }\n // The normaliser rebuilds the value from these keys; the rest is the asset's (width, height, size) or has no home.\n for (const k of [\"caption\", \"width\", \"height\", \"size\"] as const) if (v[k] !== undefined) lost.push(k);\n for (const k of Object.keys(v)) if (![\"url\", \"id\", \"name\", \"alt\", \"focal\", \"crop\", \"caption\", \"width\", \"height\", \"size\"].includes(k)) lost.push(k);\n return { value: out, lost };\n}\n\n/** A crop window as prod stores it: four 0–1 edges that leave something on both axes. */\nexport function isCropRect(v: unknown): v is ProdImageCrop {\n if (!isObj(v)) return false;\n const { top, right, bottom, left } = v as Record<string, unknown>;\n const num = (n: unknown): n is number => typeof n === \"number\" && Number.isFinite(n) && n >= 0 && n <= 1;\n return num(top) && num(right) && num(bottom) && num(left) && top + bottom < 1 && left + right < 1;\n}\n\n/**\n * Pass the asset's pixel size to read a stored crop rect back as its preset and to restore width / height / size.\n * An older value written as `{ src, alt }` (the block's own image props) reads as the same picture and alt text.\n */\nexport function imageFromProd(v: unknown, asset: ImageAsset = {}): V2ImageValue | string | null {\n if (typeof v === \"string\") return v;\n if (!isObj(v)) return null;\n const url = typeof v.url === \"string\" ? v.url : typeof v.src === \"string\" ? v.src : null;\n if (url === null) return null;\n const p = v as unknown as ProdImageValue & { alt?: unknown };\n const out: V2ImageValue = { url };\n if (p.id !== undefined) out.id = p.id;\n if (p.name !== undefined) out.name = p.name;\n if (p.altText !== undefined) out.alt = p.altText;\n else if (typeof p.alt === \"string\") out.alt = p.alt;\n if (p.focal) out.focal = { x: round(p.focal.x * 100), y: round(p.focal.y * 100) };\n if (isCropRect(p.crop)) {\n const preset = asset.width && asset.height ? cropPreset(p.crop, asset.width, asset.height) : undefined;\n out.crop = preset ?? { ...p.crop };\n }\n if (asset.width !== undefined) out.width = asset.width;\n if (asset.height !== undefined) out.height = asset.height;\n if (asset.size !== undefined) out.size = asset.size;\n return out;\n}\n\n/* ── reference ────────────────────────────────────────────────────────── */\n/**\n * A V2 reference value is the target's id. Prod reads a bare id as an ENTRY on a prop reference that takes entries\n * (backend acceptsEntries), so a page, form or collection picked there travels in the kit as `\"<kind>:<id>\"` (the\n * dock's reference services hand such picks back tagged) and is stored as `{ kind, id }` (targetRefOf). A stored\n * `{ kind, id }` reads back tagged, whatever the field takes, so a save writes the same target back.\n */\nconst TARGET_TAG = /^(page|form|collection):(.+)$/;\nexport const targetTag = (kind: ProdTargetRef[\"kind\"], id: string): string => `${kind}:${id}`;\nexport function parseTargetTag(v: string): ProdTargetRef | null {\n const m = TARGET_TAG.exec(v);\n return m ? { kind: m[1] as ProdTargetRef[\"kind\"], id: m[2] } : null;\n}\nconst isTargetRef = (v: unknown): v is ProdTargetRef =>\n isObj(v) && typeof v.kind === \"string\" && TARGET_TAG.test(`${v.kind}:x`) && typeof v.id === \"string\" && v.id !== \"\";\n\n/**\n * V2 stores the target id (`\"en_12\"`; a list for many). Prod stores the same id, or `{ entryId, modelSlug }` on a\n * polymorphic field (pass `modelSlug`), or `{ formId }` on a component `form` prop (`to: \"form\"`), or `{ kind, id }` for\n * a tagged page / form / collection pick (`\"page:pg_1\"`).\n */\nexport function referenceToProd(\n v: string | string[] | null | undefined,\n opts: { to?: \"form\"; modelSlug?: string } = {},\n): ValueResult<string | (string | ProdTargetRef)[] | ProdPolymorphicRef | ProdFormRef | ProdTargetRef | null> {\n if (v == null || v === \"\") return { value: null, lost: [] };\n if (Array.isArray(v)) return { value: v.map((x) => parseTargetTag(x) ?? x), lost: [] };\n if (opts.to === \"form\") return { value: { formId: v }, lost: [] };\n const target = parseTargetTag(v);\n if (target) return { value: target, lost: [] };\n if (opts.modelSlug) return { value: { entryId: v, modelSlug: opts.modelSlug }, lost: [] };\n return { value: v, lost: [] };\n}\n\nconst refId = (v: unknown): string | null =>\n typeof v === \"string\"\n ? v || null\n : isTargetRef(v)\n ? targetTag(v.kind, v.id)\n : isObj(v)\n ? ((typeof v.entryId === \"string\" && v.entryId) || (typeof v.formId === \"string\" && v.formId) || null)\n : null;\n\nexport function referenceFromProd(v: unknown): string | string[] | null {\n if (Array.isArray(v)) return v.map(refId).filter((x): x is string => !!x);\n return refId(v);\n}\n\n/* ── table ────────────────────────────────────────────────────────────── */\n/**\n * Prod has no table type: the schema adapter stores a V2 table as a `json` field (named in the lossy ledger), and\n * `json` keeps any JSON value, so the TableValue itself is stored verbatim (typed columns, groups, footer,\n * footnotes, caption, design, jsonLd).\n */\nexport function tableToProd(v: TableValue | null | undefined): ValueResult<TableValue | null> {\n return { value: v == null ? null : (JSON.parse(JSON.stringify(v)) as TableValue), lost: [] };\n}\nexport const tableFromProd = (v: unknown): TableValue | null => (isObj(v) ? (v as unknown as TableValue) : null);\n\n/* ── scale ────────────────────────────────────────────────────────────── */\nconst SCALE_UNITS: readonly ScaleUnit[] = [\"px\", \"%\", \"rem\", \"em\", \"vw\", \"vh\"];\n/**\n * Prod stores the three V2 scale shapes as they are (CPO D41, reference-validation.ts scaleValueProblem): a bare number,\n * a token step's string, a custom `{ value, unit }`. Pass the field's scale: a token it does not list, or a custom value\n * it does not allow (allowCustom off, a unit outside its units, past its bounds), is refused by the backend, so it is\n * not written (`lost: [\"\"]`). With no scale only a number is known to fit.\n */\nexport function scaleToProd(v: ScaleValue | null | undefined, scale?: ScaleSchema): ValueResult<ScaleValue | null> {\n if (v == null) return { value: null, lost: [] };\n if (typeof v === \"number\") return Number.isFinite(v) ? { value: v, lost: [] } : { value: null, lost: [\"\"] };\n const refused = { value: null, lost: [\"\"] };\n if (!scale) return refused;\n if (typeof v === \"string\") return Array.isArray(scale.steps) && scale.steps.some((x) => x.value === v) ? { value: v, lost: [] } : refused;\n if (!isObj(v) || !scale.allowCustom || typeof v.value !== \"number\" || !Number.isFinite(v.value) || Object.keys(v).some((k) => k !== \"value\" && k !== \"unit\")) return refused;\n const custom = typeof scale.allowCustom === \"object\" ? scale.allowCustom : {};\n const units = custom.units ?? scale.units ?? SCALE_UNITS;\n if (!units.includes(v.unit)) return refused;\n const bound = (b: number | Partial<Record<ScaleUnit, number>> | undefined) => (typeof b === \"number\" ? b : b?.[v.unit]);\n const min = bound(custom.min);\n const max = bound(custom.max);\n if ((min !== undefined && v.value < min) || (max !== undefined && v.value > max)) return refused;\n return { value: { value: v.value, unit: v.unit }, lost: [] };\n}\nexport function scaleFromProd(v: unknown): ScaleValue | null {\n if (typeof v === \"number\") return Number.isFinite(v) ? v : null;\n if (typeof v === \"string\") return v;\n if (isObj(v) && typeof v.value === \"number\" && typeof v.unit === \"string\" && (SCALE_UNITS as readonly string[]).includes(v.unit)) return { value: v.value, unit: v.unit as ScaleUnit };\n return null;\n}\n\n/* ── video ────────────────────────────────────────────────────────────── */\nexport type V2VideoValue = string | { url: string; poster?: string; autoplay?: boolean; loop?: boolean; transcript?: string };\n/** An http(s) URL or a site path; \"\" is an unset one (video-value.ts isVideoUrl). */\nconst isVideoUrl = (s: string) => s === \"\" || /^https?:\\/\\/[^\\s]+$/i.test(s.trim()) || /^\\/(?!\\/)\\S*$/.test(s.trim());\n/**\n * The V2 video value and prod's are the same shape: a URL string, or `{ url, poster?, autoplay?, loop?, transcript? }`\n * (the video block's props). The backend refuses any other key, and a url or poster that is not an http(s) URL or a\n * site path (video_value_invalid): another key is left out and named, a bad url refuses the value whole.\n */\nexport function videoToProd(v: V2VideoValue | null | undefined): ValueResult<ProdVideoValue | string | null> {\n if (v == null) return { value: null, lost: [] };\n if (typeof v === \"string\") return isVideoUrl(v) ? { value: v, lost: [] } : { value: null, lost: [\"\"] };\n if (!isObj(v) || typeof v.url !== \"string\" || !isVideoUrl(v.url)) return { value: null, lost: [\"\"] };\n const lost: string[] = [];\n const out: Obj = {};\n for (const [k, x] of Object.entries(v)) {\n const ok =\n !(VIDEO_VALUE_KEYS as readonly string[]).includes(k) ? false\n : k === \"url\" ? true\n : k === \"poster\" ? typeof x === \"string\" && isVideoUrl(x)\n : k === \"transcript\" ? typeof x === \"string\" && x.length <= VIDEO_TRANSCRIPT_MAX\n : typeof x === \"boolean\";\n if (ok) out[k] = x;\n else if (x !== undefined) lost.push(k);\n }\n return { value: out as unknown as ProdVideoValue, lost };\n}\nexport function videoFromProd(v: unknown): V2VideoValue | null {\n if (typeof v === \"string\") return v;\n if (!isObj(v) || typeof v.url !== \"string\") return null;\n return { ...v } as V2VideoValue;\n}\n\n/* ── primitive lists ──────────────────────────────────────────────────── */\nexport type ListItemType = \"text\" | \"number\" | \"date\" | \"image\" | \"link\" | \"richtext\";\n/**\n * A V2 list of one primitive (`of: [{ type }]`) is a prod `array` with `config.itemType`, each item judged and normalized\n * as a field of its type: an image item stores prod's image keys (altText, 0–1 focal), a link item its stored link. Scalar\n * and rich text items pass as they are. `lost` names `<index>/<key>` (or `<index>` for a whole item) per item.\n */\nexport function listToProd(v: unknown, itemType: ListItemType): ValueResult<unknown[] | null> {\n if (v == null) return { value: null, lost: [] };\n if (!Array.isArray(v)) return { value: null, lost: [\"\"] };\n const lost: string[] = [];\n const out: unknown[] = [];\n v.forEach((x, i) => {\n const r = itemType === \"image\" ? imageToProd(x as V2ImageValue) : itemType === \"link\" ? linkToProd(x as V2LinkValue) : { value: x, lost: [] };\n for (const l of r.lost) lost.push(l ? `${i}/${l}` : String(i));\n out.push(r.value);\n });\n return { value: out, lost };\n}\nexport function listFromProd(v: unknown, itemType: ListItemType): unknown[] {\n if (!Array.isArray(v)) return [];\n return itemType === \"image\" ? v.map((x) => imageFromProd(x)) : itemType === \"link\" ? v.map((x) => linkFromProd(x)) : [...v];\n}\n\n/* ── tags ─────────────────────────────────────────────────────────────── */\n/**\n * The backend judges tags trimmed and case-insensitively (reference-validation.ts tagsValueProblem): a field write\n * trims and de-dupes, a prop value is refused (tags_value_invalid). So the value is written clean for both: trimmed,\n * first spelling of a case-repeat kept, and an empty, over-long, off-list (`allowCustom: false`) or over-`max` tag left\n * out. `lost` names each changed or dropped tag by its index in `v`.\n */\nexport function tagsToProd(\n v: string[] | null | undefined,\n opts: { max?: number; allowCustom?: boolean; options?: (string | { value: string })[] } = {},\n): ValueResult<string[] | null> {\n if (v == null) return { value: null, lost: [] };\n const allowed = opts.allowCustom === false ? new Set((opts.options ?? []).map((o) => (typeof o === \"string\" ? o : o.value).trim().toLowerCase())) : undefined;\n const out: string[] = [];\n const seen = new Set<string>();\n const lost: string[] = [];\n v.forEach((x, i) => {\n const t = typeof x === \"string\" ? x.trim() : \"\";\n const folded = t.toLowerCase();\n const keep =\n t !== \"\" && Array.from(t).length <= TAG_VALUE_MAX_LENGTH && !seen.has(folded) && (!allowed || allowed.has(folded)) && (opts.max === undefined || out.length < opts.max);\n if (keep) {\n seen.add(folded);\n out.push(t);\n }\n if (!keep || t !== x) lost.push(String(i));\n });\n return { value: out, lost };\n}\nexport const tagsFromProd = (v: unknown): string[] => (Array.isArray(v) ? v.filter((x): x is string => typeof x === \"string\") : []);\n\n/* ── rating ───────────────────────────────────────────────────────────── */\nexport interface RatingScale {\n min?: number;\n max?: number;\n step?: number;\n}\n/**\n * A prod rating runs from config.min (0 unset) to config.max (5 unset) in steps of config.step (1 unset), and 0 is \"not\n * rated\" on every scale (validation-parity.ts ratingScale / onRatingScale). V2's empty rating is null: it is written as\n * null, and any other number off the scale is refused by the backend (rating_value_invalid), so it is not written either.\n */\nexport function ratingToProd(v: number | null | undefined, opts: RatingScale = {}): ValueResult<number | null> {\n if (v == null) return { value: null, lost: [] };\n const min = opts.min ?? 0;\n const max = opts.max ?? RATING_DEFAULT_MAX;\n const step = opts.step ?? 1;\n const steps = (v - min) / step;\n const ok = Number.isFinite(v) && v >= min && v <= max && Math.abs(steps - Math.round(steps)) < 1e-9;\n return ok ? { value: v, lost: [] } : { value: null, lost: [\"\"] };\n}\n/** A stored number back; 0 on a scale that starts above it is prod's \"not rated\", which V2 holds as null. */\nexport function ratingFromProd(v: unknown, opts: RatingScale = {}): number | null {\n if (typeof v !== \"number\" || !Number.isFinite(v)) return null;\n return v === 0 && (opts.min ?? 0) > 0 ? null : v;\n}\n\n/* ── code ─────────────────────────────────────────────────────────────── */\nexport type V2CodeValue = string | { language?: string; code: string };\n/**\n * Prod stores a code value as a string, or `{ language?, code }` (no other key). A language outside the field's\n * `config.languages` is refused by the backend (code_value_invalid), so it is left out and named; a value over\n * CODE_MAX_LENGTH characters is refused whole.\n */\nexport function codeToProd(v: V2CodeValue | null | undefined, opts: { languages?: string[] } = {}): ValueResult<V2CodeValue | null> {\n if (v == null) return { value: null, lost: [] };\n const code = typeof v === \"string\" ? v : v.code;\n if (typeof code !== \"string\" || code.length > CODE_MAX_LENGTH) return { value: null, lost: [\"\"] };\n if (typeof v === \"string\") return { value: v, lost: [] };\n const lost = Object.keys(v).filter((k) => k !== \"code\" && k !== \"language\");\n const out: { language?: string; code: string } = { code };\n if (v.language !== undefined) {\n if (typeof v.language === \"string\" && (!opts.languages || opts.languages.includes(v.language))) out.language = v.language;\n else lost.push(\"language\");\n }\n return { value: out, lost };\n}\nexport function codeFromProd(v: unknown): V2CodeValue | null {\n if (typeof v === \"string\") return v;\n if (!isObj(v) || typeof v.code !== \"string\") return null;\n return typeof v.language === \"string\" ? { language: v.language, code: v.code } : { code: v.code };\n}\n\n/* ── zoned arrays ─────────────────────────────────────────────────────── */\n/** A V2 list of object items is stored by prod as the repeatable zone of its array: `{ repeatable: [...] }`. */\nexport const zoneListToProd = (v: unknown[] | null | undefined): { repeatable: unknown[] } => ({ repeatable: v ? [...v] : [] });\nexport const zoneListFromProd = (v: unknown): unknown[] => (isObj(v) && Array.isArray(v.repeatable) ? [...v.repeatable] : Array.isArray(v) ? [...v] : []);\n\n/* ── polymorphic list (prop table, config.mode \"types\") ─────────────── */\n/** A row of a polymorphic list: V2's and prod's shape alike, `{ _key?, _type, ...fields }` (BE prop-fields typedRowIssues). */\nexport type TypedRow = Record<string, unknown> & { _type: string; _key?: string };\nconst isTypedRow = (v: unknown): v is TypedRow => isObj(v) && typeof v._type === \"string\" && v._type !== \"\";\n\n/**\n * V2 rows → the stored rows. Prod keeps V2's own row shape, so a row passes as it is after `mapRow` (its fields through\n * their plans); a row with no `_type` has no item type to be judged by (item_type_required) and is named, by index.\n */\nexport function typedRowsToProd(v: unknown, mapRow: (row: TypedRow, i: number) => Record<string, unknown> = (r) => ({ ...r })): ValueResult<unknown> {\n if (v == null) return { value: v ?? null, lost: [] };\n if (!Array.isArray(v)) return { value: v, lost: [\"(value)\"] };\n const lost: string[] = [];\n const value = v.map((row, i) => {\n if (isTypedRow(row)) return mapRow(row, i);\n lost.push(String(i));\n return row;\n });\n return { value, lost };\n}\n\n/** Stored rows → V2 rows: the same shape, each row through `mapRow`; a row that is not typed passes as stored. */\nexport function typedRowsFromProd(v: unknown, mapRow: (row: TypedRow, i: number) => Record<string, unknown> = (r) => ({ ...r })): unknown {\n if (!Array.isArray(v)) return v;\n return v.map((row, i) => (isTypedRow(row) ? mapRow(row, i) : row));\n}\n\n/** A dock icon name passes through; anything else is not a prod icon. */\nexport const isDockIcon = (v: unknown): v is DockIconName => typeof v === \"string\" && DOCK_ICON_NAME_SET.has(v);\n"],"mappings":";;AAwCA,IAAM,SAAS,MAAyB,CAAC,CAAC,KAAK,OAAO,MAAM,YAAY,CAAC,MAAM,QAAQ,CAAC;;AA8CxF,IAAM,cAAc;CAAC;CAAS;CAAW;CAAQ;CAAS;CAAQ;AAAW;AAC7E,IAAM,gBAAgB,SAAiB,gCAAgC,KAAK,KAAK,QAAQ,qBAAqB,EAAE,CAAC;;;;;AAOjH,SAAgB,WAAW,GAAwF;CACjH,IAAI,KAAK,MAAM,OAAO;EAAE,OAAO;EAAM,MAAM,CAAC;CAAE;CAC9C,IAAI,OAAO,MAAM,UAAU,OAAO,aAAa,CAAC,IAAI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K;AACvB;;AAGA,SAAgB,kBAAkB,GAAY,UAAiE,OAAO,EAAE,GAAG,EAAE,IAAa;CACxI,IAAI,CAAC,MAAM,QAAQ,CAAC,GAAG,OAAO;CAC9B,OAAO,EAAE,KAAK,KAAK,MAAO,WAAW,GAAG,IAAI,OAAO,KAAK,CAAC,IAAI,GAAI;AACnE;;AAGA,IAAa,cAAc,MAAkC,OAAO,MAAM,YAAY,mBAAmB,IAAI,CAAC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { cn } from "../lib/cn.js";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
//#region src/brand/logo.tsx
|
|
5
|
+
var ICON = [
|
|
6
|
+
"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",
|
|
7
|
+
"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",
|
|
8
|
+
"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"
|
|
9
|
+
];
|
|
10
|
+
var WORD = [
|
|
11
|
+
"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",
|
|
12
|
+
"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",
|
|
13
|
+
"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",
|
|
14
|
+
"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",
|
|
15
|
+
"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",
|
|
16
|
+
"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",
|
|
17
|
+
"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",
|
|
18
|
+
"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",
|
|
19
|
+
"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"
|
|
20
|
+
];
|
|
21
|
+
/** boxicons:sparkle-circle-filled — path from public/brand/ai-sparkle-glyph.svg (viewBox 2 2 16 16). */
|
|
22
|
+
var 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";
|
|
23
|
+
var BRAND_STOPS = [
|
|
24
|
+
{
|
|
25
|
+
offset: .0817,
|
|
26
|
+
color: "#A878D2"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
offset: .4808,
|
|
30
|
+
color: "#ED6262"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
offset: .9231,
|
|
34
|
+
color: "#D13A3A"
|
|
35
|
+
}
|
|
36
|
+
];
|
|
37
|
+
function MarkGradient({ id }) {
|
|
38
|
+
return /* @__PURE__ */ jsx("linearGradient", {
|
|
39
|
+
id,
|
|
40
|
+
x1: "8.81595",
|
|
41
|
+
y1: "-2.84571",
|
|
42
|
+
x2: "18.8801",
|
|
43
|
+
y2: "29.1204",
|
|
44
|
+
gradientUnits: "userSpaceOnUse",
|
|
45
|
+
children: BRAND_STOPS.map((s) => /* @__PURE__ */ jsx("stop", {
|
|
46
|
+
offset: s.offset,
|
|
47
|
+
stopColor: s.color
|
|
48
|
+
}, s.offset))
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
/** The mark alone (square). */
|
|
52
|
+
function LogoMark({ size = 24, className }) {
|
|
53
|
+
const id = React.useId().replace(/:/g, "");
|
|
54
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
55
|
+
width: size,
|
|
56
|
+
height: size,
|
|
57
|
+
viewBox: "-1 0 26 28",
|
|
58
|
+
className: cn("shrink-0", className),
|
|
59
|
+
"aria-hidden": true,
|
|
60
|
+
children: [/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx(MarkGradient, { id: `bm${id}` }) }), ICON.map((d) => /* @__PURE__ */ jsx("path", {
|
|
61
|
+
d,
|
|
62
|
+
fill: `url(#bm${id})`
|
|
63
|
+
}, d.slice(0, 12)))]
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
/** Full lockup: mark + "BetterCMS" wordmark. Height-driven (default 24px → 106px wide). */
|
|
67
|
+
function Logo({ className, compact, height = 24 }) {
|
|
68
|
+
const id = React.useId().replace(/:/g, "");
|
|
69
|
+
if (compact) return /* @__PURE__ */ jsx(LogoMark, {
|
|
70
|
+
size: height,
|
|
71
|
+
className
|
|
72
|
+
});
|
|
73
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
74
|
+
height,
|
|
75
|
+
width: height * 113 / 28,
|
|
76
|
+
viewBox: "0 0 113 28",
|
|
77
|
+
className: cn("shrink-0 text-[var(--kit-wordmark,#291018)] [.dark_&]:text-[var(--kit-fg,#e1e1e4)]", className),
|
|
78
|
+
role: "img",
|
|
79
|
+
"aria-label": "BetterCMS",
|
|
80
|
+
children: [
|
|
81
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx(MarkGradient, { id: `bl${id}` }) }),
|
|
82
|
+
ICON.map((d) => /* @__PURE__ */ jsx("path", {
|
|
83
|
+
d,
|
|
84
|
+
fill: `url(#bl${id})`
|
|
85
|
+
}, d.slice(0, 12))),
|
|
86
|
+
WORD.map((d) => /* @__PURE__ */ jsx("path", {
|
|
87
|
+
d,
|
|
88
|
+
fill: "currentColor"
|
|
89
|
+
}, d.slice(0, 12)))
|
|
90
|
+
]
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
//#endregion
|
|
94
|
+
export { BRAND_STOPS, Logo, LogoMark, SPARKLE_PATH };
|
|
95
|
+
|
|
96
|
+
//# sourceMappingURL=logo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logo.js","names":[],"sources":["../../src/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":";;;;AAOA,IAAM,OAAO;CAAC;CAAgT;CAAqK;AAAkK;AACroB,IAAM,OAAO;CAAC;CAAoK;CAAyc;CAAsQ;CAA4Q;CAAuc;CAAuf;CAA8mB;CAA0J;AAA4a;;AAE/vG,IAAa,eAAe;AAC5B,IAAa,cAAc;CACzB;EAAE,QAAQ;EAAQ,OAAO;CAAU;CACnC;EAAE,QAAQ;EAAQ,OAAO;CAAU;CACnC;EAAE,QAAQ;EAAQ,OAAO;CAAU;AACrC;AAEA,SAAS,aAAa,EAAE,MAAsB;CAC5C,OACE,oBAAC,kBAAD;EAAoB;EAAI,IAAG;EAAU,IAAG;EAAW,IAAG;EAAU,IAAG;EAAU,eAAc;EACxF,UAAA,YAAY,KAAK,MAAM,oBAAC,QAAD;GAAqB,QAAQ,EAAE;GAAQ,WAAW,EAAE;EAAQ,GAAjD,EAAE,MAA+C,CAAC;CACvE,CAAA;AAEpB;;AAGA,SAAgB,SAAS,EAAE,OAAO,IAAI,aAAoD;CACxF,MAAM,KAAK,MAAM,MAAM,CAAC,CAAC,QAAQ,MAAM,EAAE;CACzC,OACE,qBAAC,OAAD;EAAK,OAAO;EAAM,QAAQ;EAAM,SAAQ;EAAa,WAAW,GAAG,YAAY,SAAS;EAAG,eAAA;EAA3F,UAAA,CACE,oBAAC,QAAD,EAAA,UAAM,oBAAC,cAAD,EAAc,IAAI,KAAK,KAAO,CAAA,EAAO,CAAA,GAC1C,KAAK,KAAK,MAAM,oBAAC,QAAD;GAA8B;GAAG,MAAM,UAAU,GAAG;EAAK,GAA9C,EAAE,MAAM,GAAG,EAAE,CAAiC,CAAC,CACxE;;AAET;;AAGA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