@riverbankcms/sdk 0.62.2 → 0.64.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 +11 -0
- package/dist/_dts/api/src/accessAdmin.d.ts +71 -2
- package/dist/_dts/api/src/aiEndpoints.d.ts +2 -2
- package/dist/_dts/api/src/billing.d.ts +46 -10
- package/dist/_dts/api/src/bookingClosures.d.ts +106 -0
- package/dist/_dts/api/src/bookingConfig.d.ts +2 -0
- package/dist/_dts/api/src/bookingManagementEndpoints.d.ts +18 -0
- package/dist/_dts/api/src/bookingRecords.d.ts +27 -1
- package/dist/_dts/api/src/calendar.d.ts +11 -1
- package/dist/_dts/api/src/commercePortalEndpoints.d.ts +12 -1
- package/dist/_dts/api/src/contentRuntime.d.ts +3 -0
- package/dist/_dts/api/src/contentVersionHistory.d.ts +52 -0
- package/dist/_dts/api/src/contentVersionHistoryClient.d.ts +45 -0
- package/dist/_dts/api/src/courses.d.ts +3 -0
- package/dist/_dts/api/src/endpoints.d.ts +133 -6
- package/dist/_dts/api/src/index.d.ts +12 -6
- package/dist/_dts/api/src/sdkConfig/contracts.d.ts +29 -0
- package/dist/_dts/api/src/sdkContracts.d.ts +13 -1
- package/dist/_dts/api/src/siteManagementEndpoints.d.ts +31 -7
- package/dist/_dts/api/src/siteMembers.d.ts +10 -1
- package/dist/_dts/api/src/siteOnboarding.d.ts +4 -0
- package/dist/_dts/api/src/siteOperations.d.ts +10 -0
- package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +62 -12
- package/dist/_dts/api/src/types.d.ts +4 -2
- package/dist/_dts/api/src/url.d.ts +3 -3
- package/dist/_dts/billing/src/plans/registry.d.ts +1 -0
- package/dist/_dts/billing/src/plans/types.d.ts +9 -0
- package/dist/_dts/block-form/src/FormRenderer.d.ts +38 -0
- package/dist/_dts/block-form/src/backend/adapter.d.ts +7 -0
- package/dist/_dts/block-form/src/backend/hooks/useRepeaterBackend.d.ts +34 -0
- package/dist/_dts/block-form/src/backend/hooks.d.ts +66 -0
- package/dist/_dts/block-form/src/backend/index.d.ts +12 -0
- package/dist/_dts/block-form/src/backend/rhf-backend.d.ts +34 -0
- package/dist/_dts/block-form/src/backend/store-backend.d.ts +60 -0
- package/dist/_dts/block-form/src/backend/types.d.ts +137 -0
- package/dist/_dts/block-form/src/backend/useBackendWatch.d.ts +22 -0
- package/dist/_dts/block-form/src/backend/utils/getErrorMessage.d.ts +1 -0
- package/dist/_dts/block-form/src/blockDraftSaveability.d.ts +70 -0
- package/dist/_dts/block-form/src/client/blockDraftSaveability.d.ts +1 -0
- package/dist/_dts/block-form/src/client/index.d.ts +30 -0
- package/dist/_dts/block-form/src/context/BlockContext.d.ts +29 -0
- package/dist/_dts/block-form/src/context/DisplayLabelResolverContext.d.ts +33 -0
- package/dist/_dts/block-form/src/context/FieldPreviewResolverContext.d.ts +30 -0
- package/dist/_dts/block-form/src/context/ImageResolveContext.d.ts +1 -0
- package/dist/_dts/block-form/src/context/index.d.ts +4 -0
- package/dist/_dts/block-form/src/fields/props.d.ts +48 -0
- package/dist/_dts/block-form/src/fields/types.d.ts +223 -0
- package/dist/_dts/block-form/src/index.d.ts +22 -0
- package/dist/_dts/block-form/src/manifest/ManifestForm.d.ts +37 -0
- package/dist/_dts/block-form/src/manifest/canonicalValidation.d.ts +5 -0
- package/dist/_dts/block-form/src/manifest/filterSdkTabs.d.ts +44 -0
- package/dist/_dts/block-form/src/manifest/manifestFormAdapter.d.ts +61 -0
- package/dist/_dts/block-form/src/manifest/mergeManifestWithSdkOptions.d.ts +24 -0
- package/dist/_dts/block-form/src/palette/PaletteContext.d.ts +11 -0
- package/dist/_dts/block-form/src/registry/schemas.d.ts +105 -0
- package/dist/_dts/block-form/src/registry/widgets.d.ts +59 -0
- package/dist/_dts/block-form/src/sdk-config/SdkConfigContext.d.ts +110 -0
- package/dist/_dts/block-form/src/sdk-config/hooks.d.ts +21 -0
- package/dist/_dts/block-form/src/sdk-config/index.d.ts +2 -0
- package/dist/_dts/block-form/src/shared/disclosure.d.ts +1 -0
- package/dist/_dts/block-form/src/shared/hooks/index.d.ts +2 -0
- package/dist/_dts/block-form/src/shared/hooks/useCoarsePointer.d.ts +5 -0
- package/dist/_dts/block-form/src/shared/hooks/useContainerWidth.d.ts +6 -0
- package/dist/_dts/block-form/src/utils/VisibilityWrapper.d.ts +25 -0
- package/dist/_dts/block-form/src/utils/computeWatchedPath.d.ts +18 -0
- package/dist/_dts/block-form/src/utils/evaluateVisibility.d.ts +9 -0
- package/dist/_dts/block-form/src/utils/fieldHelpers.d.ts +94 -0
- package/dist/_dts/block-form/src/utils/resolvePromotedFields.d.ts +22 -0
- package/dist/_dts/block-form/src/utils/slug.d.ts +3 -0
- package/dist/_dts/block-form/src/utils/typeGuards.d.ts +3 -0
- package/dist/_dts/block-form/src/widgets/BackgroundColorWidget/BackgroundColorField.d.ts +10 -0
- package/dist/_dts/block-form/src/widgets/BackgroundColorWidget/BackgroundColorWidget.d.ts +23 -0
- package/dist/_dts/block-form/src/widgets/BackgroundColorWidget/index.d.ts +2 -0
- package/dist/_dts/block-form/src/widgets/BackgroundGradientWidget/BackgroundGradientField.d.ts +13 -0
- package/dist/_dts/block-form/src/widgets/BackgroundGradientWidget/BackgroundGradientWidget.d.ts +17 -0
- package/dist/_dts/block-form/src/widgets/BackgroundGradientWidget/index.d.ts +2 -0
- package/dist/_dts/block-form/src/widgets/BooleanField/BooleanField.d.ts +6 -0
- package/dist/_dts/block-form/src/widgets/BooleanField/booleanFieldDefaults.d.ts +6 -0
- package/dist/_dts/block-form/src/widgets/BooleanField/booleanFieldSchema.d.ts +7 -0
- package/dist/_dts/block-form/src/widgets/BooleanField/index.d.ts +3 -0
- package/dist/_dts/block-form/src/widgets/BoxStyleWidget/BoxStyleWidget.d.ts +17 -0
- package/dist/_dts/block-form/src/widgets/BoxStyleWidget/index.d.ts +1 -0
- package/dist/_dts/block-form/src/widgets/ContentTypeSelectField/contentTypeSelectFieldDefaults.d.ts +3 -0
- package/dist/_dts/block-form/src/widgets/ContentTypeSelectField/contentTypeSelectFieldSchema.d.ts +4 -0
- package/dist/_dts/block-form/src/widgets/DateField/DateField.d.ts +23 -0
- package/dist/_dts/block-form/src/widgets/DateField/dateFieldDefaults.d.ts +8 -0
- package/dist/_dts/block-form/src/widgets/DateField/dateFieldSchema.d.ts +9 -0
- package/dist/_dts/block-form/src/widgets/DateField/datePickerPopover.d.ts +32 -0
- package/dist/_dts/block-form/src/widgets/DateField/index.d.ts +4 -0
- package/dist/_dts/block-form/src/widgets/DateTimeField/DateTimeField.d.ts +30 -0
- package/dist/_dts/block-form/src/widgets/DateTimeField/dateTimeFieldDefaults.d.ts +8 -0
- package/dist/_dts/block-form/src/widgets/DateTimeField/dateTimeFieldSchema.d.ts +11 -0
- package/dist/_dts/block-form/src/widgets/DateTimeField/index.d.ts +4 -0
- package/dist/_dts/block-form/src/widgets/DateTimeField/utils/dateTimeUtils.d.ts +22 -0
- package/dist/_dts/block-form/src/widgets/DateTimeField/utils/index.d.ts +1 -0
- package/dist/_dts/block-form/src/widgets/EntryPickerField/entryPickerFieldDefaults.d.ts +3 -0
- package/dist/_dts/block-form/src/widgets/EntryPickerField/entryPickerFieldSchema.d.ts +4 -0
- package/dist/_dts/block-form/src/widgets/Field.d.ts +21 -0
- package/dist/_dts/block-form/src/widgets/FieldFrame.d.ts +32 -0
- package/dist/_dts/block-form/src/widgets/FieldSettingsModal/FieldSettingsModal.d.ts +34 -0
- package/dist/_dts/block-form/src/widgets/FieldSettingsModal/index.d.ts +2 -0
- package/dist/_dts/block-form/src/widgets/GroupField/GroupField.d.ts +23 -0
- package/dist/_dts/block-form/src/widgets/GroupField/groupFieldDefaults.d.ts +9 -0
- package/dist/_dts/block-form/src/widgets/GroupField/groupFieldSchema.d.ts +10 -0
- package/dist/_dts/block-form/src/widgets/GroupField/index.d.ts +3 -0
- package/dist/_dts/block-form/src/widgets/LinkField/linkFieldDefaults.d.ts +10 -0
- package/dist/_dts/block-form/src/widgets/LinkField/linkFieldSchema.d.ts +3 -0
- package/dist/_dts/block-form/src/widgets/MediaField/mediaFieldDefaults.d.ts +6 -0
- package/dist/_dts/block-form/src/widgets/MediaField/mediaFieldSchema.d.ts +6 -0
- package/dist/_dts/block-form/src/widgets/ModalGroupField/ModalGroupField.d.ts +17 -0
- package/dist/_dts/block-form/src/widgets/ModalGroupField/index.d.ts +3 -0
- package/dist/_dts/block-form/src/widgets/ModalGroupField/modalFieldDefaults.d.ts +18 -0
- package/dist/_dts/block-form/src/widgets/ModalGroupField/modalFieldSchema.d.ts +14 -0
- package/dist/_dts/block-form/src/widgets/NumberField/NumberField.d.ts +7 -0
- package/dist/_dts/block-form/src/widgets/NumberField/index.d.ts +3 -0
- package/dist/_dts/block-form/src/widgets/NumberField/numberFieldDefaults.d.ts +6 -0
- package/dist/_dts/block-form/src/widgets/NumberField/numberFieldSchema.d.ts +7 -0
- package/dist/_dts/block-form/src/widgets/PresetOrCustomField/PresetOrCustomField.d.ts +11 -0
- package/dist/_dts/block-form/src/widgets/PresetOrCustomField/index.d.ts +4 -0
- package/dist/_dts/block-form/src/widgets/PresetOrCustomField/presetOrCustomFieldDefaults.d.ts +3 -0
- package/dist/_dts/block-form/src/widgets/PresetOrCustomField/presetOrCustomFieldSchema.d.ts +4 -0
- package/dist/_dts/block-form/src/widgets/PresetOrCustomField/types.d.ts +37 -0
- package/dist/_dts/block-form/src/widgets/ReferenceField/referenceFieldDefaults.d.ts +3 -0
- package/dist/_dts/block-form/src/widgets/ReferenceField/referenceFieldSchema.d.ts +4 -0
- package/dist/_dts/block-form/src/widgets/RepeaterField/RepeaterField.d.ts +26 -0
- package/dist/_dts/block-form/src/widgets/RepeaterField/components/RepeaterDragHandle.d.ts +8 -0
- package/dist/_dts/block-form/src/widgets/RepeaterField/components/RepeaterError.d.ts +11 -0
- package/dist/_dts/block-form/src/widgets/RepeaterField/components/RepeaterHeader.d.ts +10 -0
- package/dist/_dts/block-form/src/widgets/RepeaterField/components/RepeaterLayoutGrid.d.ts +27 -0
- package/dist/_dts/block-form/src/widgets/RepeaterField/components/RepeaterList.d.ts +19 -0
- package/dist/_dts/block-form/src/widgets/RepeaterField/components/RepeaterRow.d.ts +23 -0
- package/dist/_dts/block-form/src/widgets/RepeaterField/components/RepeaterRowActions.d.ts +16 -0
- package/dist/_dts/block-form/src/widgets/RepeaterField/components/RepeaterRowContent.d.ts +19 -0
- package/dist/_dts/block-form/src/widgets/RepeaterField/components/RepeaterTabbedEditDialog.d.ts +16 -0
- package/dist/_dts/block-form/src/widgets/RepeaterField/components/RepeaterThumbnailCard.d.ts +26 -0
- package/dist/_dts/block-form/src/widgets/RepeaterField/components/RepeaterThumbnailGrid.d.ts +20 -0
- package/dist/_dts/block-form/src/widgets/RepeaterField/components/index.d.ts +11 -0
- package/dist/_dts/block-form/src/widgets/RepeaterField/components/layoutGridDomain.d.ts +34 -0
- package/dist/_dts/block-form/src/widgets/RepeaterField/hooks/index.d.ts +6 -0
- package/dist/_dts/block-form/src/widgets/RepeaterField/hooks/layoutGridCapacityDecision.d.ts +22 -0
- package/dist/_dts/block-form/src/widgets/RepeaterField/hooks/useLayoutGridCapacity.d.ts +20 -0
- package/dist/_dts/block-form/src/widgets/RepeaterField/hooks/useLinearRepeaterDnd.d.ts +23 -0
- package/dist/_dts/block-form/src/widgets/RepeaterField/hooks/useRepeaterPointerDragCapability.d.ts +10 -0
- package/dist/_dts/block-form/src/widgets/RepeaterField/hooks/useRepeaterRowErrors.d.ts +12 -0
- package/dist/_dts/block-form/src/widgets/RepeaterField/hooks/useRepeaterVisibility.d.ts +6 -0
- package/dist/_dts/block-form/src/widgets/RepeaterField/hooks/useResolvedItemLabel.d.ts +12 -0
- package/dist/_dts/block-form/src/widgets/RepeaterField/index.d.ts +3 -0
- package/dist/_dts/block-form/src/widgets/RepeaterField/repeaterFieldDefaults.d.ts +7 -0
- package/dist/_dts/block-form/src/widgets/RepeaterField/repeaterFieldSchema.d.ts +8 -0
- package/dist/_dts/block-form/src/widgets/RepeaterField/utils/buildItemLabel.d.ts +7 -0
- package/dist/_dts/block-form/src/widgets/RepeaterField/utils/buildSummary.d.ts +7 -0
- package/dist/_dts/block-form/src/widgets/RepeaterField/utils/createDefaultItem.d.ts +6 -0
- package/dist/_dts/block-form/src/widgets/RepeaterField/utils/getRepeaterItemFieldGroups.d.ts +8 -0
- package/dist/_dts/block-form/src/widgets/RepeaterField/utils/getRepeaterItemFields.d.ts +22 -0
- package/dist/_dts/block-form/src/widgets/RepeaterField/utils/index.d.ts +10 -0
- package/dist/_dts/block-form/src/widgets/RepeaterField/utils/layoutGridCapacityContext.d.ts +2 -0
- package/dist/_dts/block-form/src/widgets/RepeaterField/utils/repeaterDndDomain.d.ts +43 -0
- package/dist/_dts/block-form/src/widgets/RepeaterField/utils/repeaterPresentation.d.ts +24 -0
- package/dist/_dts/block-form/src/widgets/RepeaterField/utils/resolveThumbnail.d.ts +12 -0
- package/dist/_dts/block-form/src/widgets/RichTextField/richTextFieldDefaults.d.ts +20 -0
- package/dist/_dts/block-form/src/widgets/RichTextField/richTextFieldSchema.d.ts +16 -0
- package/dist/_dts/block-form/src/widgets/SdkSelectField/SdkSelectField.d.ts +11 -0
- package/dist/_dts/block-form/src/widgets/SdkSelectField/index.d.ts +1 -0
- package/dist/_dts/block-form/src/widgets/SelectField/SelectField.d.ts +7 -0
- package/dist/_dts/block-form/src/widgets/SelectField/index.d.ts +3 -0
- package/dist/_dts/block-form/src/widgets/SelectField/selectFieldDefaults.d.ts +6 -0
- package/dist/_dts/block-form/src/widgets/SelectField/selectFieldSchema.d.ts +7 -0
- package/dist/_dts/block-form/src/widgets/SelectWidget.d.ts +34 -0
- package/dist/_dts/block-form/src/widgets/SettingsModal/SettingsModal.d.ts +17 -0
- package/dist/_dts/block-form/src/widgets/SettingsModal/index.d.ts +2 -0
- package/dist/_dts/block-form/src/widgets/SliderField/SliderField.d.ts +16 -0
- package/dist/_dts/block-form/src/widgets/SliderField/index.d.ts +1 -0
- package/dist/_dts/block-form/src/widgets/SlugField/SlugField.d.ts +39 -0
- package/dist/_dts/block-form/src/widgets/SlugField/hooks/index.d.ts +1 -0
- package/dist/_dts/block-form/src/widgets/SlugField/hooks/useSlugAutoGeneration.d.ts +29 -0
- package/dist/_dts/block-form/src/widgets/SlugField/index.d.ts +5 -0
- package/dist/_dts/block-form/src/widgets/SlugField/slugFieldDefaults.d.ts +8 -0
- package/dist/_dts/block-form/src/widgets/SlugField/slugFieldSchema.d.ts +14 -0
- package/dist/_dts/block-form/src/widgets/SlugField/utils/index.d.ts +2 -0
- package/dist/_dts/block-form/src/widgets/SlugField/utils/pathUtils.d.ts +30 -0
- package/dist/_dts/block-form/src/widgets/SlugField/utils/slugUtils.d.ts +17 -0
- package/dist/_dts/block-form/src/widgets/TabGroupField/TabGroupField.d.ts +13 -0
- package/dist/_dts/block-form/src/widgets/TabGroupField/index.d.ts +3 -0
- package/dist/_dts/block-form/src/widgets/TabGroupField/tabGroupFieldSchema.d.ts +25 -0
- package/dist/_dts/block-form/src/widgets/TabGroupField/types.d.ts +46 -0
- package/dist/_dts/block-form/src/widgets/TextField/TextField.d.ts +7 -0
- package/dist/_dts/block-form/src/widgets/TextField/index.d.ts +3 -0
- package/dist/_dts/block-form/src/widgets/TextField/textFieldDefaults.d.ts +6 -0
- package/dist/_dts/block-form/src/widgets/TextField/textFieldSchema.d.ts +7 -0
- package/dist/_dts/block-form/src/widgets/TextInputWidget.d.ts +20 -0
- package/dist/_dts/block-form/src/widgets/TimeField/TimeField.d.ts +23 -0
- package/dist/_dts/block-form/src/widgets/TimeField/index.d.ts +3 -0
- package/dist/_dts/block-form/src/widgets/TimeField/timeFieldDefaults.d.ts +8 -0
- package/dist/_dts/block-form/src/widgets/TimeField/timeFieldSchema.d.ts +9 -0
- package/dist/_dts/block-form/src/widgets/ToggleWidget.d.ts +16 -0
- package/dist/_dts/block-form/src/widgets/UrlField/UrlField.d.ts +23 -0
- package/dist/_dts/block-form/src/widgets/UrlField/index.d.ts +3 -0
- package/dist/_dts/block-form/src/widgets/UrlField/urlFieldDefaults.d.ts +8 -0
- package/dist/_dts/block-form/src/widgets/UrlField/urlFieldSchema.d.ts +9 -0
- package/dist/_dts/block-form/src/widgets/constants.d.ts +58 -0
- package/dist/_dts/block-form/src/widgets/groupFieldHelpers.d.ts +61 -0
- package/dist/_dts/block-form/src/widgets/index.d.ts +20 -0
- package/dist/_dts/block-form/src/widgets/selectValueMapping.d.ts +9 -0
- package/dist/_dts/block-form/src/widgets/types/modalConfig.d.ts +18 -0
- package/dist/_dts/block-form/src/widgets/utils/readNumericUiConfig.d.ts +10 -0
- package/dist/_dts/blocks/src/bindings/index.d.ts +2 -2
- package/dist/_dts/blocks/src/contracts/non-block-islands.d.ts +4 -0
- package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +2 -0
- package/dist/_dts/blocks/src/system/blocks/appointment-booking.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/blog-listing.d.ts +2 -2
- package/dist/_dts/blocks/src/system/blocks/blog-post.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/cart.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/checkout.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/collection.d.ts +2 -2
- package/dist/_dts/blocks/src/system/blocks/columns.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/courses/shared/schemas.d.ts +2 -2
- package/dist/_dts/blocks/src/system/blocks/cta-full.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/event-details.d.ts +25 -0
- package/dist/_dts/blocks/src/system/blocks/events/event-spotlight.d.ts +2 -2
- package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +2 -2
- package/dist/_dts/blocks/src/system/blocks/faq.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/file-download.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/gifting.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/image-gallery.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/location-map.d.ts +2 -2
- package/dist/_dts/blocks/src/system/blocks/media-text.d.ts +6 -6
- package/dist/_dts/blocks/src/system/blocks/product-detail.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/product-list.d.ts +2 -2
- package/dist/_dts/blocks/src/system/blocks/products/shared.d.ts +2 -2
- package/dist/_dts/blocks/src/system/blocks/shop.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/team-members.d.ts +2 -2
- package/dist/_dts/blocks/src/system/blocks/testimonials.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/video-grid.d.ts +1 -1
- package/dist/_dts/blocks/src/system/fragments/library/card.d.ts +1 -1
- package/dist/_dts/blocks/src/system/fragments/library/ctaRow.d.ts +1 -1
- package/dist/_dts/blocks/src/system/fragments/library/feedbackCallout.d.ts +1 -1
- package/dist/_dts/blocks/src/system/fragments/library/heroCtaRow.d.ts +1 -1
- package/dist/_dts/blocks/src/system/fragments/library/sectionState.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +1 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-details/view.d.ts +4 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-details.client.d.ts +4 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-details.server.d.ts +4 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/newsletter-form.client.state.d.ts +12 -0
- package/dist/_dts/blocks/src/system/runtime/shared/components/FieldValidationMessage.d.ts +19 -0
- package/dist/_dts/blocks/src/system/runtime/shared/components/TerminalPanel.d.ts +8 -2
- package/dist/_dts/blocks/src/system/runtime/shared/components/index.d.ts +3 -1
- package/dist/_dts/blocks/src/system/runtime/shared/index.d.ts +2 -2
- package/dist/_dts/blocks/src/system/transforms/registry/_utils/themeColorResolution.d.ts +7 -0
- package/dist/_dts/calendar/src/grid.d.ts +60 -0
- package/dist/_dts/calendar/src/group.d.ts +14 -0
- package/dist/_dts/calendar/src/index.d.ts +6 -0
- package/dist/_dts/calendar/src/lane-packing.d.ts +28 -0
- package/dist/_dts/calendar/src/timetable.d.ts +90 -0
- package/dist/_dts/calendar/src/timezone.d.ts +19 -0
- package/dist/_dts/content-editor/src/hooks/useDebouncedLatestSave.d.ts +24 -0
- package/dist/_dts/content-editor/src/index.d.ts +2 -4
- package/dist/_dts/content-editor/src/ui/stores/autosaveStore.d.ts +1 -0
- package/dist/_dts/content-editor/src/ui/stores/types.d.ts +1 -0
- package/dist/_dts/core/src/booking-date-time.d.ts +1 -0
- package/dist/_dts/core/src/branded.d.ts +18 -0
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +1192 -234
- package/dist/_dts/db/src/schemas/forms.d.ts +1 -0
- package/dist/_dts/editor-blocks/src/index.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/index.d.ts +7 -7
- package/dist/_dts/editor-blocks/src/widgets/link/LinkWidget.d.ts +1 -2
- package/dist/_dts/editor-blocks/src/widgets/link/index.d.ts +1 -0
- package/dist/_dts/preview-next/src/client/blocks/BlockToolbar.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/blocks/composer/composePageFromBlocks.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/blocks/composer/index.d.ts +2 -2
- package/dist/_dts/preview-next/src/client/blocks/composer/mergeDrafts.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/blocks/composer/types.d.ts +31 -8
- package/dist/_dts/preview-next/src/client/blocks/pageDesignRuntimePreview.d.ts +6 -5
- package/dist/_dts/preview-next/src/client/blocks/previewProjection/aiProposalProjection.d.ts +7 -0
- package/dist/_dts/preview-next/src/client/blocks/previewProjection/applyPreviewProjections.d.ts +7 -0
- package/dist/_dts/preview-next/src/client/blocks/previewProjection/index.d.ts +4 -0
- package/dist/_dts/preview-next/src/client/blocks/previewProjection/runtimeContentDecoration.d.ts +5 -0
- package/dist/_dts/preview-next/src/client/blocks/previewProjection/types.d.ts +72 -0
- package/dist/_dts/preview-next/src/client/index.d.ts +1 -1
- package/dist/_dts/preview-next/src/client/layout/PreviewLayoutContext.d.ts +6 -5
- package/dist/_dts/preview-next/src/client/preview/PageDesignEditorStateContext.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/preview/PreviewEditorSidebar.d.ts +12 -1
- package/dist/_dts/preview-next/src/client/preview/PreviewShell.d.ts +10 -5
- package/dist/_dts/preview-next/src/client/preview/PreviewShellLayout.d.ts +7 -1
- package/dist/_dts/preview-next/src/client/preview/SiteChromeCustomizeButton.d.ts +4 -0
- package/dist/_dts/preview-next/src/client/preview/SiteChromeCustomizeContext.d.ts +49 -0
- package/dist/_dts/preview-next/src/client/preview/SiteChromeEditableSurface.d.ts +6 -0
- package/dist/_dts/preview-next/src/client/preview/StyleConfigurator.d.ts +15 -2
- package/dist/_dts/preview-next/src/client/preview/StyleConfigurator.state.d.ts +8 -1
- package/dist/_dts/preview-next/src/client/preview/previewCustomizeControlStyles.d.ts +1 -0
- package/dist/_dts/preview-next/src/client/preview/previewCustomizeHistory.d.ts +1 -0
- package/dist/_dts/preview-next/src/client/preview/previewCustomizeRuntimePatch.d.ts +9 -1
- package/dist/_dts/preview-next/src/client/preview/previewCustomizeWorkflowState.d.ts +13 -0
- package/dist/_dts/preview-next/src/client/preview/sidebarTabPreference.d.ts +8 -2
- package/dist/_dts/preview-next/src/client/preview/siteChromeLookRows.d.ts +49 -0
- package/dist/_dts/preview-next/src/client/preview/styleConfiguratorSnapshot.d.ts +18 -0
- package/dist/_dts/sdk/src/cli/commands/pull.d.ts +5 -0
- package/dist/_dts/sdk/src/cli/commands/push/options.d.ts +2 -0
- package/dist/_dts/sdk/src/cli/commands/push-execute.d.ts +17 -0
- package/dist/_dts/sdk/src/cli/content/entryPaths.d.ts +6 -0
- package/dist/_dts/sdk/src/cli/content/writer.d.ts +2 -0
- package/dist/_dts/sdk/src/cli/merge-remote/entryLocal.d.ts +3 -0
- package/dist/_dts/sdk/src/cli/merge-remote/entryMerge.d.ts +77 -0
- package/dist/_dts/sdk/src/cli/merge-remote/entryMergePlan.d.ts +45 -0
- package/dist/_dts/sdk/src/cli/merge-remote/entryMergePush.d.ts +21 -0
- package/dist/_dts/sdk/src/cli/merge-remote/entryMergeReport.d.ts +30 -0
- package/dist/_dts/sdk/src/cli/merge-remote/entryRemote.d.ts +9 -0
- package/dist/_dts/sdk/src/cli/merge-remote/entrySnapshots.d.ts +50 -0
- package/dist/_dts/sdk/src/cli/merge-remote/stableJson.d.ts +3 -0
- package/dist/_dts/sdk/src/cli/site-commands/entryCommands.d.ts +85 -0
- package/dist/_dts/sdk/src/cli/site-commands/index.d.ts +2 -0
- package/dist/_dts/sdk/src/cli/site-commands/pushExecution.d.ts +30 -0
- package/dist/_dts/sdk/src/cli/sync/executor.d.ts +1 -0
- package/dist/_dts/sdk/src/cli/sync/index.d.ts +1 -1
- package/dist/_dts/sdk/src/public-api/contracts.d.ts +4 -1
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/site-commands/src/adapter.d.ts +23 -0
- package/dist/_dts/site-commands/src/capabilityGaps.d.ts +8 -0
- package/dist/_dts/site-commands/src/commands.d.ts +1944 -0
- package/dist/_dts/site-commands/src/domain.d.ts +104 -0
- package/dist/_dts/site-commands/src/guards.d.ts +1 -0
- package/dist/_dts/site-commands/src/index.d.ts +9 -0
- package/dist/_dts/site-commands/src/metadata.d.ts +412 -0
- package/dist/_dts/site-commands/src/planner.d.ts +51 -0
- package/dist/_dts/site-commands/src/refContributions.d.ts +10 -0
- package/dist/_dts/site-commands/src/refs.d.ts +75 -0
- package/dist/_dts/site-commands/src/staticExecutionGaps.d.ts +10 -0
- package/dist/_dts/surfaces/src/index.d.ts +1 -0
- package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
- package/dist/_dts/theme-core/src/index.d.ts +1 -1
- package/dist/_dts/theme-core/src/palette/variants/types.d.ts +2 -21
- package/dist/_dts/theme-core/src/site-styles/appearancePresetCatalog.d.ts +3 -67
- package/dist/_dts/theme-core/src/site-styles/appearancePresetTypes.d.ts +4 -62
- package/dist/_dts/theme-core/src/site-styles/appearancePresets.d.ts +1 -1
- package/dist/_dts/theme-core/src/site-styles/curatedSiteStyles.d.ts +24 -0
- package/dist/_dts/theme-core/src/site-styles/customizableSurfaces.d.ts +94 -0
- package/dist/_dts/theme-core/src/site-styles/footerLooks.d.ts +59 -0
- package/dist/_dts/theme-core/src/site-styles/generatedDesignPipeline.d.ts +4 -0
- package/dist/_dts/theme-core/src/site-styles/headerCtaVariants.d.ts +3 -0
- package/dist/_dts/theme-core/src/site-styles/headerLooks.d.ts +155 -0
- package/dist/_dts/theme-core/src/site-styles/headerOpeningSection.d.ts +15 -0
- package/dist/_dts/theme-core/src/site-styles/index.d.ts +6 -0
- package/dist/_dts/theme-core/src/site-styles/pageDesignAuthority.d.ts +7 -0
- package/dist/_dts/theme-core/src/site-styles/pageDesignEditorModel.d.ts +25 -0
- package/dist/_dts/theme-core/src/site-styles/previewCompiler.d.ts +15 -1
- package/dist/_dts/theme-core/src/site-styles/records.d.ts +1 -0
- package/dist/_dts/theme-core/src/site-styles/siteStyleBlockPolicies.d.ts +96 -0
- package/dist/_dts/theme-core/src/site-styles/types.d.ts +1 -2
- package/dist/_dts/theme-core/src/siteChrome.d.ts +44 -2
- package/dist/_dts/theme-core/src/tokens/colorTokenParts.d.ts +13 -0
- package/dist/_dts/theme-core/src/tokens/index.d.ts +2 -0
- package/dist/_dts/theme-core/src/tokens/themeColorTokens.d.ts +29 -0
- package/dist/_dts/theme-core/src/utils/tokenOrColor.d.ts +27 -1
- package/dist/cli/index.mjs +5049 -932
- package/dist/cli/init-docs/content/cli-reference.md +18 -0
- package/dist/client/bookings.mjs +544 -393
- package/dist/client/client.mjs +5189 -4144
- package/dist/client/hooks.mjs +3233 -2540
- package/dist/client/rendering/client.mjs +4649 -3597
- package/dist/client/rendering/islands.mjs +19533 -13480
- package/dist/client/rendering.mjs +5218 -4171
- package/dist/preview-next/before-render.mjs +161 -6
- package/dist/preview-next/client/runtime.mjs +5676 -3565
- package/dist/preview-next/editor-base.css +31 -0
- package/dist/preview-next/middleware.mjs +154 -6
- package/dist/server/components.mjs +3333 -2575
- package/dist/server/config-validation.mjs +3447 -2754
- package/dist/server/config.mjs +3450 -2757
- package/dist/server/data.mjs +3233 -2540
- package/dist/server/index.mjs +730 -543
- package/dist/server/next.mjs +3651 -2893
- package/dist/server/page-converter.mjs +2512 -2031
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +3333 -2575
- package/dist/server/rendering.mjs +3352 -2594
- package/dist/server/routing.mjs +3351 -2640
- package/dist/server/server.mjs +3262 -2569
- package/dist/server/theme-bridge.mjs +1260 -767
- package/dist/server/theme.mjs +623 -498
- package/dist/styles/index.css +33 -0
- package/package.json +2 -1
- package/dist/_dts/blocks/src/system/transforms/registry/_utils/colorResolution.d.ts +0 -13
- package/dist/_dts/content-editor/src/ai/patch/allowed.d.ts +0 -2
- package/dist/_dts/content-editor/src/ai/patch/diff.d.ts +0 -17
- package/dist/_dts/content-editor/src/ai/patch/schema.d.ts +0 -49
- package/dist/_dts/preview-next/src/client/blocks/overlay.d.ts +0 -30
- package/dist/_dts/theme-core/src/site-styles/siteChromeAppearancePresets.d.ts +0 -67
|
@@ -242,6 +242,10 @@ export type AcknowledgeLaunchRequirementResponse = {
|
|
|
242
242
|
acknowledged: true;
|
|
243
243
|
requirementId: Extract<LaunchRequirementId, "review_generated_site" | "configure_appointments">;
|
|
244
244
|
};
|
|
245
|
+
export declare const goLiveSiteRequestSchema: z.ZodObject<{
|
|
246
|
+
acceptExtraSiteCharge: z.ZodOptional<z.ZodBoolean>;
|
|
247
|
+
}, z.core.$strip>;
|
|
248
|
+
export type GoLiveSiteRequest = z.infer<typeof goLiveSiteRequestSchema>;
|
|
245
249
|
export type GoLiveSiteResponse = {
|
|
246
250
|
redirectPath: string;
|
|
247
251
|
};
|
|
@@ -110,6 +110,16 @@ export type AdminSiteCostUpdateSyncResult = {
|
|
|
110
110
|
export type AdminUpdateSiteCostResponse = AdminSiteCostResponse & {
|
|
111
111
|
subscriptionSync: AdminSiteCostUpdateSyncResult;
|
|
112
112
|
};
|
|
113
|
+
export type AdminScheduleBillingComponentEndRequest = {
|
|
114
|
+
reason?: string;
|
|
115
|
+
};
|
|
116
|
+
export type AdminScheduleBillingComponentEndResponse = {
|
|
117
|
+
component: {
|
|
118
|
+
id: string;
|
|
119
|
+
status: "ending" | "ended";
|
|
120
|
+
endsAt: string;
|
|
121
|
+
};
|
|
122
|
+
};
|
|
113
123
|
export type ListGscPropertiesAdminResponse = {
|
|
114
124
|
properties: Array<{
|
|
115
125
|
id: string;
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
import type { SystemCustomizeFacetSelection, Theme } from '@riverbankcms/blocks';
|
|
2
2
|
import type { ListMediaAssetsResult, MediaAssetWithLabels } from '@riverbankcms/media-storage-supabase';
|
|
3
3
|
import type { DbJson } from '@riverbankcms/db';
|
|
4
|
-
import type { PageDesignEditorReadModel, PageDesignIntent, AppearancePresetId, BoundaryOptionId, DesignBlockId, LayoutVariantKey } from '@riverbankcms/theme-core/site-styles';
|
|
4
|
+
import type { PageDesignEditorReadModel, PageDesignIntent, AppearancePresetId, BoundaryOptionId, DesignBlockId, FooterLookId, HeaderLookId, LayoutVariantKey } from '@riverbankcms/theme-core/site-styles';
|
|
5
5
|
import type { ButtonPersonalityId } from '@riverbankcms/theme-core/buttons';
|
|
6
6
|
import type { PaletteOverrides, PaletteVariantId } from '@riverbankcms/theme-core/palette';
|
|
7
|
+
import type { APIEndpoint } from './apiEndpointTypes';
|
|
8
|
+
import type { AnalyticsReportFilters, AnalyticsReportResponse } from './analytics';
|
|
9
|
+
import type { CreateMediaAssetBody, MediaAssetResponse, MediaAssetFileFilterContract, MediaBulkDeleteResponse, MediaClassifyJobResponse, MediaJobSummaryResponse, MediaLabelSummary, MediaSettingsResponse } from './media';
|
|
10
|
+
import type { MediaUsageCheckResponse } from './shared-contracts';
|
|
11
|
+
import type { BlockWithContentResponse, BlockListItem, ContentEntryListStage, ListPublishedEntriesResponse, PageDraftRecord, PublishedBlockBaseline, PublishedContentEntryPreviewResponse, PublishedPostPreviewResponse, SdkBlockContent, SdkRuntimeContentByPathResponse, SdkTemplate, SiteBySlugResponse, ThemeGenerationTurn, ThemePreferencesRecord, ThemeRow } from './contentRuntime';
|
|
12
|
+
import type { GetVersionHistoryResponse, ListVersionHistoryResponse, RestoreVersionHistoryRequest, RestoreVersionHistoryResponse, VersionHistoryListQuery } from './contentVersionHistory';
|
|
13
|
+
import type { CreateInstagramZipUploadUrlRequest, CreateInstagramZipUploadUrlResponse, CreateMediaUploadUrlRequest, CreateMediaUploadUrlResponse, CreateSiteLogoUploadUrlRequest, CreateSiteLogoUploadUrlResponse, InstagramUploadZipRequest, MediaUploadFinalizeRequest, UploadSiteLogoRequest } from './siteInfrastructure';
|
|
14
|
+
import type { DevToolsGetSiteRoleDowngradeQuery, DevToolsImpersonationResponse, DevToolsSeedResponse, DevToolsSetSiteRoleDowngradeRequest, SiteRoleDowngradeState } from './siteOperations';
|
|
7
15
|
/**
|
|
8
|
-
* Round-trip shape for the Style configurator
|
|
16
|
+
* Round-trip shape for the Style configurator and site-chrome persisted selections on the
|
|
9
17
|
* `saveSiteTheme` endpoint. Each field is optional independently so callers
|
|
10
18
|
* can update one decision at a time; `null` explicitly clears the selection
|
|
11
19
|
* (server falls back to the site style's default), distinct from omission
|
|
@@ -15,14 +23,34 @@ export type SiteThemeSelectionsPayload = {
|
|
|
15
23
|
buttonPersonalityId?: ButtonPersonalityId | null;
|
|
16
24
|
paletteVariantId?: PaletteVariantId | null;
|
|
17
25
|
paletteOverrides?: PaletteOverrides | null;
|
|
26
|
+
headerLookId?: HeaderLookId | null;
|
|
27
|
+
footerLookId?: FooterLookId | null;
|
|
18
28
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
29
|
+
export type SaveSiteChromeLookSelectionBody = Readonly<{
|
|
30
|
+
surface: 'header';
|
|
31
|
+
lookId: HeaderLookId | null;
|
|
32
|
+
theme: Theme;
|
|
33
|
+
themeId?: string | null;
|
|
34
|
+
selectionId?: string | null;
|
|
35
|
+
baseSelectionUpdatedAt?: string | null;
|
|
36
|
+
}> | Readonly<{
|
|
37
|
+
surface: 'footer';
|
|
38
|
+
lookId: FooterLookId | null;
|
|
39
|
+
theme: Theme;
|
|
40
|
+
themeId?: string | null;
|
|
41
|
+
selectionId?: string | null;
|
|
42
|
+
baseSelectionUpdatedAt?: string | null;
|
|
43
|
+
}>;
|
|
44
|
+
export type SaveSiteChromeLookSelectionResponse = Readonly<{
|
|
45
|
+
success: boolean;
|
|
46
|
+
themeId: string;
|
|
47
|
+
selectionId: string;
|
|
48
|
+
selectionUpdatedAt: string | null;
|
|
49
|
+
savedAt: string;
|
|
50
|
+
theme: Theme;
|
|
51
|
+
headerLookId: HeaderLookId | null;
|
|
52
|
+
footerLookId: FooterLookId | null;
|
|
53
|
+
}>;
|
|
26
54
|
export type PageDesignRevisionToken = {
|
|
27
55
|
kind: 'absent';
|
|
28
56
|
} | {
|
|
@@ -151,19 +179,27 @@ export type SiteRuntimeAPIEndpoints = {
|
|
|
151
179
|
success: boolean;
|
|
152
180
|
themeId: string;
|
|
153
181
|
selectionId: string;
|
|
182
|
+
selectionUpdatedAt: string | null;
|
|
154
183
|
savedAt: string;
|
|
155
184
|
overrides: Record<string, unknown> | null;
|
|
156
185
|
theme: Theme;
|
|
157
186
|
/**
|
|
158
187
|
* Persisted Style configurator selections. The client resolves
|
|
159
|
-
* compatibility locally via `compileSiteThemeFromSelections
|
|
160
|
-
*
|
|
161
|
-
*
|
|
188
|
+
* compatibility locally via `compileSiteThemeFromSelections`, but
|
|
189
|
+
* header/footer Look IDs remain requested user intent; rendering may
|
|
190
|
+
* temporarily fall back while the stored selection stays reversible.
|
|
191
|
+
* This response echoes the row's stored state so the caller can refresh
|
|
192
|
+
* local state without a follow-up read.
|
|
162
193
|
*/
|
|
163
194
|
buttonPersonalityId: ButtonPersonalityId | null;
|
|
164
195
|
paletteVariantId: PaletteVariantId | null;
|
|
165
196
|
paletteOverrides: PaletteOverrides | null;
|
|
197
|
+
headerLookId: HeaderLookId | null;
|
|
198
|
+
footerLookId: FooterLookId | null;
|
|
166
199
|
}>;
|
|
200
|
+
saveSiteChromeLookSelection: APIEndpoint<SaveSiteChromeLookSelectionBody, {
|
|
201
|
+
siteId: string;
|
|
202
|
+
}, SaveSiteChromeLookSelectionResponse>;
|
|
167
203
|
uploadSiteLogo: APIEndpoint<UploadSiteLogoRequest, never, {
|
|
168
204
|
path: string;
|
|
169
205
|
publicUrl: string | null;
|
|
@@ -436,6 +472,20 @@ export type SiteRuntimeAPIEndpoints = {
|
|
|
436
472
|
siteId: string;
|
|
437
473
|
pageId: string;
|
|
438
474
|
}, SavePageDesignStateResponse>;
|
|
475
|
+
listPageVersions: APIEndpoint<never, VersionHistoryListQuery & {
|
|
476
|
+
siteId: string;
|
|
477
|
+
pageId: string;
|
|
478
|
+
}, ListVersionHistoryResponse>;
|
|
479
|
+
getPageVersion: APIEndpoint<never, {
|
|
480
|
+
siteId: string;
|
|
481
|
+
pageId: string;
|
|
482
|
+
versionId: string;
|
|
483
|
+
}, GetVersionHistoryResponse>;
|
|
484
|
+
restorePageVersion: APIEndpoint<RestoreVersionHistoryRequest, {
|
|
485
|
+
siteId: string;
|
|
486
|
+
pageId: string;
|
|
487
|
+
versionId: string;
|
|
488
|
+
}, RestoreVersionHistoryResponse>;
|
|
439
489
|
applyPageDesignEditorAction: APIEndpoint<{
|
|
440
490
|
action: PageDesignEditorAction;
|
|
441
491
|
}, {
|
|
@@ -3,6 +3,7 @@ export type { AccessPolicyContract, AccessPolicyTag, CreateMediaAssetBody, Entit
|
|
|
3
3
|
export type { AnalyticsPreset, AnalyticsReferrer, AnalyticsReportFilters, AnalyticsReportQuery, AnalyticsReportResponse, AnalyticsSeriesPoint, AnalyticsTopPage, AnalyticsTotals, } from "./analytics";
|
|
4
4
|
export type { AIChatMessage, AiBriefTurn, JsonPrimitive, JsonValue, MediaUsageCheckItem, MediaUsageCheckResponse, MediaUsageLocation, } from "./shared-contracts";
|
|
5
5
|
export type * from "./accessAdmin";
|
|
6
|
+
export { STAFF_OPERATIONAL_CAPABILITIES } from "./accessAdmin";
|
|
6
7
|
export type * from "./aiEndpoints";
|
|
7
8
|
export type * from "./apiEndpointTypes";
|
|
8
9
|
export type * from "./bookingAdjustments";
|
|
@@ -14,6 +15,7 @@ export type * from "./bookingRecords";
|
|
|
14
15
|
export type * from "./commercePortalEndpoints";
|
|
15
16
|
export type * from "./communications";
|
|
16
17
|
export type * from "./contentRuntime";
|
|
18
|
+
export type * from "./contentVersionHistory";
|
|
17
19
|
export type * from "./courses";
|
|
18
20
|
export type * from "./participantMessaging";
|
|
19
21
|
export type * from "./publicExperienceEndpoints";
|
|
@@ -41,7 +43,7 @@ export type { SitePageBlock, SitePagePayload } from "./sitePages";
|
|
|
41
43
|
export type { SiteAnalyticsCookieBannerCopyOverrides, SiteAnalyticsSettingsPayload, SiteAnalyticsSettingsResponse, } from "./siteAnalytics";
|
|
42
44
|
export type { SiteLegalJurisdiction, SiteLegalProfilePayload, SensitiveClientRecordsConfirmationKey, SensitiveClientRecordsMode, SensitiveClientRecordsRetentionProfile, SensitiveClientRecordsSettings, SensitiveClientRecordsUpdatePayload, SitePrivacyPolicyCapabilities, SitePrivacyPolicyDocument, SitePrivacySettings, SitePrivacySettingsPayload, SitePrivacySettingsResponse, SiteRuntimePrivacyPolicy, SitePrivacyPolicySection, } from "./privacyPolicy";
|
|
43
45
|
export type { MaintenanceSettingsPayload, MaintenanceSettingsResponse, SiteBusinessAddressPayload, SiteBusinessAddressResponse, SiteDeploymentMode, SiteFooterBlocksEditorBlock, SiteFooterBlocksEditorResponse, SiteGeneralSettingsPayload, SiteGeneralSettingsResponse, SiteLayoutResolvedPayload, SiteLayoutSettingsPayload, SiteLayoutSettingsResponse, UpdateSiteDeploymentModePayload, UpdateSiteDeploymentModeResponse, UpdateSiteFooterBlocksPayload, UpdateSiteFooterBlocksResponse, } from "./siteSettings";
|
|
44
|
-
export type { BillingCheckoutRequest, BillingCheckoutResponse, BillingStatusResponse, BillingSummaryResponse, SiteBillingCheckoutResponse, SiteBillingCostResponse, StripeAutomaticTaxIssue, StripeAutomaticTaxReadiness, StripeAutomaticTaxStatus, StripeConnectDisconnectResponse, StripeConnectRestrictions, StripeConnectStartResponse, StripeConnectStatusResponse, UpdateStripeAutomaticTaxRequest, } from "./billing";
|
|
46
|
+
export type { BillingCheckoutRequest, BillingCheckoutResponse, BillingStatusResponse, BillingSummaryComponent, BillingSummaryComponentKind, BillingSummaryComponentSource, BillingSummaryBasePlanComponent, BillingSummarySiteComponent, BillingSummaryAddOnComponent, BillingSummaryResponse, SiteBillingCheckoutResponse, SiteBillingCostResponse, StripeAutomaticTaxIssue, StripeAutomaticTaxReadiness, StripeAutomaticTaxStatus, StripeConnectDisconnectResponse, StripeConnectRestrictions, StripeConnectStartResponse, StripeConnectStatusResponse, UpdateStripeAutomaticTaxRequest, } from "./billing";
|
|
45
47
|
export type { AiGenerateSiteEntityType, AiGenerateSitePrimaryCta, AiGenerateSiteRequest, AiGenerateSiteResponse, } from "./siteGeneration";
|
|
46
48
|
export { SITE_ROLE_DISPLAY_ORDER, SITE_ROLE_PERMISSION_LEVEL } from "./siteMembers";
|
|
47
49
|
export type { SiteRole } from "./siteMembers";
|
|
@@ -64,7 +66,7 @@ type ComposeEndpointMaps<Maps extends readonly object[], Acc extends object = {}
|
|
|
64
66
|
infer Head extends object,
|
|
65
67
|
...infer Tail extends readonly object[]
|
|
66
68
|
] ? [Extract<keyof Acc, keyof Head>] extends [never] ? ComposeEndpointMaps<Tail, Acc & Head> : never : Acc;
|
|
67
|
-
type SiteMembersAPIEndpointName = "listSiteMembers" | "inviteSiteMember" | "updateSiteMemberRole" | "removeSiteMember" | "revokeSiteInvitation" | "transferSiteOwnership" | "acceptSiteInvitation";
|
|
69
|
+
type SiteMembersAPIEndpointName = "listSiteMembers" | "inviteSiteMember" | "updateSiteMemberRole" | "linkCurrentUserPractitioner" | "unlinkCurrentUserPractitioner" | "removeSiteMember" | "revokeSiteInvitation" | "transferSiteOwnership" | "acceptSiteInvitation";
|
|
68
70
|
type SeoAPIEndpointName = "getSeoOverview" | "getSeoPages" | "exportSeoPagesCsv" | "getSeoQueries" | "exportSeoQueriesCsv" | "getPerformanceOverview" | "applySeoChanges";
|
|
69
71
|
type RedirectsAPIEndpointName = "checkRedirect" | "listRedirectRules" | "createRedirectRule" | "deleteRedirectRule";
|
|
70
72
|
type AvailabilityAPIEndpointName = "listAvailabilityRules" | "setWeeklyAvailability" | "listBlackouts" | "createBlackout" | "deleteBlackout" | "getAvailableSlots";
|
|
@@ -48,9 +48,9 @@ export declare function getCmsApiUrl(): string;
|
|
|
48
48
|
* ```ts
|
|
49
49
|
* getAbsoluteDashboardUrl() // -> 'http://localhost:4000/dashboard'
|
|
50
50
|
* getAbsoluteDashboardUrl('sites/site-123/content/event/entry-456') // -> 'http://localhost:4000/dashboard/sites/site-123/content/event/entry-456'
|
|
51
|
-
* getAbsoluteDashboardUrl('sites/site-123/forms/
|
|
52
|
-
* // prod: 'https://macadamia.studio/dashboard/sites/site-123/forms/
|
|
53
|
-
* // dev: 'http://macadamia.localhost:4000/dashboard/sites/site-123/forms/
|
|
51
|
+
* getAbsoluteDashboardUrl('sites/site-123/forms/form-123/submissions', { surfaceId: 'macadamia' })
|
|
52
|
+
* // prod: 'https://macadamia.studio/dashboard/sites/site-123/forms/form-123/submissions'
|
|
53
|
+
* // dev: 'http://macadamia.localhost:4000/dashboard/sites/site-123/forms/form-123/submissions'
|
|
54
54
|
* ```
|
|
55
55
|
*/
|
|
56
56
|
export type GetAbsoluteDashboardUrlOptions = Readonly<{
|
|
@@ -5,6 +5,7 @@ export declare function ensureBillingPlanId(planId: string): BillingPlanId;
|
|
|
5
5
|
export declare function getPlanById(planId: string): PlanDefinition | undefined;
|
|
6
6
|
export declare function ensurePlan(planId: string): PlanDefinition;
|
|
7
7
|
export declare function getPlanEntitlements(planId: string): PlanDefinition['entitlements'];
|
|
8
|
+
export declare function getMacadamiaSiteAllowance(planId: string): PlanDefinition['entitlements']['macadamiaSiteAllowance'];
|
|
8
9
|
/**
|
|
9
10
|
* @deprecated Use database pricing with resolveUserPrice() instead.
|
|
10
11
|
* This function fetches pre-created Stripe Price IDs which is being replaced
|
|
@@ -55,6 +55,15 @@ export interface PlanEntitlements {
|
|
|
55
55
|
planId: BillingPlanId;
|
|
56
56
|
monthlyPricePence: number | null;
|
|
57
57
|
availableIntervals: readonly BillingInterval[];
|
|
58
|
+
macadamiaSiteAllowance: Readonly<{
|
|
59
|
+
includedLiveSiteCount: number;
|
|
60
|
+
extraSite: Readonly<{
|
|
61
|
+
tag: 'not_supported';
|
|
62
|
+
}> | Readonly<{
|
|
63
|
+
tag: 'priced';
|
|
64
|
+
monthlyPricePence: number;
|
|
65
|
+
}>;
|
|
66
|
+
}>;
|
|
58
67
|
monthlyBookingLimit: number | null;
|
|
59
68
|
durableStorageQuota: StorageQuota;
|
|
60
69
|
stripeBookingCommission: StripeBookingCommission;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FormRenderer - Generic form rendering component
|
|
3
|
+
*
|
|
4
|
+
* Completely manifest-agnostic. Renders any FieldConfig[] with any FormBackend.
|
|
5
|
+
* Provides renderChild recursively for container widgets (GroupField, RepeaterField).
|
|
6
|
+
*/
|
|
7
|
+
import type { ReactNode } from 'react';
|
|
8
|
+
import type { FieldConfig } from './fields/types';
|
|
9
|
+
import type { FormBackend } from './backend/types';
|
|
10
|
+
import type { FieldWidgetComponent } from './fields/props';
|
|
11
|
+
export interface FormRendererProps {
|
|
12
|
+
/** Field configurations to render */
|
|
13
|
+
fields: FieldConfig[];
|
|
14
|
+
/** Form backend (RHF or Store) */
|
|
15
|
+
backend: FormBackend;
|
|
16
|
+
/** Optional className for container */
|
|
17
|
+
className?: string;
|
|
18
|
+
/** Optional wrapper component for each field */
|
|
19
|
+
fieldWrapper?: (children: ReactNode, field: FieldConfig) => ReactNode;
|
|
20
|
+
/** Optional widget overrides - allows replacing widgets at runtime */
|
|
21
|
+
widgetOverrides?: Partial<Record<string, FieldWidgetComponent>>;
|
|
22
|
+
/** Optional block kind for SDK field options lookup (e.g., 'block.embed', 'custom.hero') */
|
|
23
|
+
blockKind?: string;
|
|
24
|
+
/** Show inline settings trigger for non-content intents (default: true) */
|
|
25
|
+
showSettingsTrigger?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Optional list of nested field paths to surface in the main form body as shortcuts.
|
|
28
|
+
* These paths should refer to existing data within the form values (no duplication).
|
|
29
|
+
*/
|
|
30
|
+
promotedFields?: string[];
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* FormRenderer - Renders a list of fields using the widget registry
|
|
34
|
+
*
|
|
35
|
+
* Works with any field source (manifests, custom configs, etc.)
|
|
36
|
+
* Works with any backend (RHF, Zustand store, etc.)
|
|
37
|
+
*/
|
|
38
|
+
export declare function FormRenderer({ fields, backend, className, fieldWrapper, widgetOverrides, blockKind, showSettingsTrigger, promotedFields, }: FormRendererProps): ReactNode;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Import from './types', './rhf-backend', or './store-backend' instead.
|
|
3
|
+
* This file is kept for backward compatibility only.
|
|
4
|
+
*/
|
|
5
|
+
export type { FormBackend, SetValueOptions, FieldError, FieldState, FormState, StoreBackendOptions, } from './types';
|
|
6
|
+
export { createRHFBackend } from './rhf-backend';
|
|
7
|
+
export { createStoreBackend } from './store-backend';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { FormBackend } from '../adapter';
|
|
2
|
+
/**
|
|
3
|
+
* Item with stable React key for repeater rendering
|
|
4
|
+
*/
|
|
5
|
+
export type RepeaterItem = {
|
|
6
|
+
/** Stable ID for React keys and drag-drop */
|
|
7
|
+
id: string;
|
|
8
|
+
/** Item data */
|
|
9
|
+
data: unknown;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Array operations interface for repeater widgets
|
|
13
|
+
*/
|
|
14
|
+
export type RepeaterBackendOps = {
|
|
15
|
+
/** Array items with stable keys */
|
|
16
|
+
items: RepeaterItem[];
|
|
17
|
+
/** Append item to array */
|
|
18
|
+
append: (value: unknown) => void;
|
|
19
|
+
/** Remove item at index */
|
|
20
|
+
remove: (index: number) => void;
|
|
21
|
+
/** Move item from one index to another */
|
|
22
|
+
move: (from: number, to: number) => void;
|
|
23
|
+
/** Insert item at index */
|
|
24
|
+
insert: (index: number, value: unknown) => void;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Hook to get repeater operations from a backend.
|
|
28
|
+
* Provides stable keys for React rendering and drag-drop.
|
|
29
|
+
*
|
|
30
|
+
* Uses backend's unified interface throughout - no branching on backend.type.
|
|
31
|
+
* For RHF backends, uses react-hook-form's optimized useFieldArray hook.
|
|
32
|
+
* For other backends, uses useSyncExternalStore with the backend's subscribe/getValue.
|
|
33
|
+
*/
|
|
34
|
+
export declare function useRepeaterBackend(backend: FormBackend, path: string): RepeaterBackendOps;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { FormBackend, SetValueOptions } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* useArrayField - Hook for array field operations (append, remove, move, insert)
|
|
4
|
+
*
|
|
5
|
+
* @param path - Field path
|
|
6
|
+
* @param backend - Form backend
|
|
7
|
+
* @returns Object with array manipulation functions
|
|
8
|
+
*/
|
|
9
|
+
export declare function useArrayField(path: string, backend: FormBackend): {
|
|
10
|
+
append: (value: unknown) => void;
|
|
11
|
+
remove: (index: number) => void;
|
|
12
|
+
move: (from: number, to: number) => void;
|
|
13
|
+
insert: (index: number, value: unknown) => void;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* useField - Combined hook for field value, state, and setter
|
|
17
|
+
*
|
|
18
|
+
* This is the recommended hook for form widgets. It provides everything needed
|
|
19
|
+
* for a field in one call, using the unified backend.subscribe API.
|
|
20
|
+
*
|
|
21
|
+
* No branching on backend.type - the backend hides implementation details.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* function TextField({ path, backend, field }: FormFieldProps<string>) {
|
|
26
|
+
* const { value, error, isDirty, setValue } = useField<string>(path, backend)
|
|
27
|
+
*
|
|
28
|
+
* return (
|
|
29
|
+
* <input
|
|
30
|
+
* value={value ?? ''}
|
|
31
|
+
* onChange={(e) => setValue(e.target.value)}
|
|
32
|
+
* />
|
|
33
|
+
* )
|
|
34
|
+
* }
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export declare function useField<T = unknown>(path: string, backend: FormBackend): {
|
|
38
|
+
value: T | undefined;
|
|
39
|
+
error: import("./types").FieldError | undefined;
|
|
40
|
+
isDirty: boolean | undefined;
|
|
41
|
+
isTouched: boolean | undefined;
|
|
42
|
+
invalid: boolean | undefined;
|
|
43
|
+
setValue: (newValue: T, options?: SetValueOptions) => void;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* useFieldError - Hook to get only the error state of a field
|
|
47
|
+
*
|
|
48
|
+
* Use this for container widgets (GroupField, RepeaterField) that need to display
|
|
49
|
+
* group-level errors but don't interact with the field value.
|
|
50
|
+
*
|
|
51
|
+
* More efficient than useField when you only need error state.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```tsx
|
|
55
|
+
* function GroupField({ path, backend, field, renderChild }: FormFieldProps) {
|
|
56
|
+
* const error = useFieldError(path, backend)
|
|
57
|
+
*
|
|
58
|
+
* return (
|
|
59
|
+
* <FieldFrame error={error?.message}>
|
|
60
|
+
* {field.fields.map(child => renderChild(child, `${path}.${child.id}`))}
|
|
61
|
+
* </FieldFrame>
|
|
62
|
+
* )
|
|
63
|
+
* }
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
export declare function useFieldError(path: string, backend: FormBackend): import("./types").FieldError | undefined;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Backend abstraction layer for form operations
|
|
3
|
+
*
|
|
4
|
+
* This module provides a unified API that works with either:
|
|
5
|
+
* - React Hook Form (RHF) for traditional form handling
|
|
6
|
+
* - Zustand Store for inline editing with autosave
|
|
7
|
+
*/
|
|
8
|
+
export * from './types';
|
|
9
|
+
export * from './hooks';
|
|
10
|
+
export * from './adapter';
|
|
11
|
+
export { useRepeaterBackend } from './hooks/useRepeaterBackend';
|
|
12
|
+
export type { RepeaterBackendOps, RepeaterItem } from './hooks/useRepeaterBackend';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* React Hook Form (RHF) backend implementation
|
|
3
|
+
*
|
|
4
|
+
* Wraps a react-hook-form instance to provide the unified FormBackend interface.
|
|
5
|
+
* Validation is handled by the resolver passed to useForm (e.g., zodResolver).
|
|
6
|
+
*
|
|
7
|
+
* ## Why `as never` casts are used
|
|
8
|
+
*
|
|
9
|
+
* React Hook Form is heavily typed around its generic parameter, so methods like
|
|
10
|
+
* `setValue<TFieldName>(path: TFieldName, value: TFieldValues[TFieldName])` require
|
|
11
|
+
* compile-time knowledge of the exact form schema.
|
|
12
|
+
*
|
|
13
|
+
* Our FormBackend interface is library-agnostic and uses dynamic string paths
|
|
14
|
+
* (e.g., `"author.name"`, `"items.0.title"`) that can't be statically typed.
|
|
15
|
+
* TypeScript's `keyof T` doesn't work with nested dot-notation paths.
|
|
16
|
+
*
|
|
17
|
+
* The `as never` cast is the safest way to bypass this:
|
|
18
|
+
* - `never` is the bottom type, so casting TO `never` is always allowed
|
|
19
|
+
* - It makes the intent explicit: "we're deliberately bypassing type checking here"
|
|
20
|
+
* - It's more honest than using `any`, which could mask real errors
|
|
21
|
+
*
|
|
22
|
+
* Type safety is maintained at the widget layer, where components know their
|
|
23
|
+
* specific field types and cast immediately after reading values.
|
|
24
|
+
*/
|
|
25
|
+
import type { FieldValues, UseFormReturn } from 'react-hook-form';
|
|
26
|
+
import type { FormBackend } from './types';
|
|
27
|
+
/**
|
|
28
|
+
* Create RHF backend from react-hook-form instance
|
|
29
|
+
*
|
|
30
|
+
* Note: RHF handles validation through its resolver (passed to useForm).
|
|
31
|
+
* The schema is integrated at form creation time, so we don't need it here.
|
|
32
|
+
*/
|
|
33
|
+
export declare function createRHFBackend<TFieldValues extends FieldValues>(form: UseFormReturn<TFieldValues>): FormBackend;
|
|
34
|
+
export declare function createRHFBackend(form: UseFormReturn<FieldValues>): FormBackend;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zustand Store backend implementation
|
|
3
|
+
*
|
|
4
|
+
* Integrates with EditorUiStore for autosave-enabled form management.
|
|
5
|
+
* Supports three scopes: blocks (per-block data), metadata (page/entry metadata), and content (content entry data).
|
|
6
|
+
*/
|
|
7
|
+
import type { EditorBlockId, EditorSyncState } from '@riverbankcms/core';
|
|
8
|
+
import type { FormBackend, StoreBackendOptions } from './types';
|
|
9
|
+
type StoreSnapshot = {
|
|
10
|
+
current: Record<string, unknown> | null;
|
|
11
|
+
baseline: Record<string, unknown> | null;
|
|
12
|
+
syncState: EditorSyncState;
|
|
13
|
+
version?: number;
|
|
14
|
+
};
|
|
15
|
+
interface BlocksSlice {
|
|
16
|
+
getAtPath: (blockId: EditorBlockId, path: string) => unknown;
|
|
17
|
+
setAtPath: (blockId: EditorBlockId, path: string, value: unknown) => void;
|
|
18
|
+
getCurrentValues: (blockId: EditorBlockId) => Record<string, unknown> | null;
|
|
19
|
+
getBlockSnapshot?: (blockId: EditorBlockId) => StoreSnapshot | null;
|
|
20
|
+
clearError?: (blockId: EditorBlockId) => void;
|
|
21
|
+
updateBlockBaseline?: (blockId: EditorBlockId, data: Record<string, unknown> | null) => void;
|
|
22
|
+
}
|
|
23
|
+
interface RootSlice {
|
|
24
|
+
getAtPath: (path: string) => unknown;
|
|
25
|
+
setAtPath: (path: string, value: unknown) => void;
|
|
26
|
+
getCurrentValues: () => Record<string, unknown> | null;
|
|
27
|
+
getSnapshot?: () => StoreSnapshot | null;
|
|
28
|
+
clearError?: () => void;
|
|
29
|
+
hydrate?: (baseline: Record<string, unknown> | null, current: Record<string, unknown> | null) => void;
|
|
30
|
+
}
|
|
31
|
+
interface ArrayKeysManager {
|
|
32
|
+
get: (scope: string, path: string) => string[] | undefined;
|
|
33
|
+
set: (scope: string, path: string, keys: string[]) => void;
|
|
34
|
+
append: (scope: string, path: string, key: string) => void;
|
|
35
|
+
remove: (scope: string, path: string, index: number) => void;
|
|
36
|
+
move: (scope: string, path: string, from: number, to: number) => void;
|
|
37
|
+
insert: (scope: string, path: string, index: number, key: string) => void;
|
|
38
|
+
}
|
|
39
|
+
interface EditorStoreState {
|
|
40
|
+
drafts?: BlocksSlice;
|
|
41
|
+
metadata?: RootSlice;
|
|
42
|
+
content?: RootSlice;
|
|
43
|
+
blockValidation?: {
|
|
44
|
+
markPathEdited: (blockId: EditorBlockId, path: string) => void;
|
|
45
|
+
isPathEdited: (blockId: EditorBlockId, path: string) => boolean;
|
|
46
|
+
showAllValidation: (blockId: EditorBlockId) => boolean;
|
|
47
|
+
};
|
|
48
|
+
arrayKeys: ArrayKeysManager;
|
|
49
|
+
requestFocus?: (payload: {
|
|
50
|
+
blockId: EditorBlockId;
|
|
51
|
+
fieldPath?: string | null;
|
|
52
|
+
}) => void;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Create Store backend from Zustand store
|
|
56
|
+
*
|
|
57
|
+
* Integrates with editorUiStore for autosave and validation
|
|
58
|
+
*/
|
|
59
|
+
export declare function createStoreBackend(options: StoreBackendOptions<EditorStoreState>): FormBackend;
|
|
60
|
+
export {};
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FormBackend - Unified backend interface for form operations
|
|
3
|
+
*
|
|
4
|
+
* This module provides types for a unified interface that works with either:
|
|
5
|
+
* - React Hook Form (RHF) for settings forms
|
|
6
|
+
* - Zustand Store for content editing with autosave
|
|
7
|
+
*
|
|
8
|
+
* Validation Flow:
|
|
9
|
+
* - RHF backends: Validation handled by resolver passed to useForm (zodResolver, etc.)
|
|
10
|
+
* - Store backends: Validation handled by validateFn option
|
|
11
|
+
* Example: createStoreBackend({ validateFn: (values) => schema.safeParse(values).error?.issues ?? [] })
|
|
12
|
+
*/
|
|
13
|
+
import type { ZodIssue } from 'zod';
|
|
14
|
+
import type { FieldValues, UseFormReturn } from 'react-hook-form';
|
|
15
|
+
import type { EditorBlockId } from '@riverbankcms/core';
|
|
16
|
+
/**
|
|
17
|
+
* Zustand-like store interface for store backend.
|
|
18
|
+
* We use a minimal contract here to avoid circular dependencies with content-editor.
|
|
19
|
+
* The actual EditorUiStoreInstance has more methods, but we only require
|
|
20
|
+
* the core zustand contract at the type level.
|
|
21
|
+
*/
|
|
22
|
+
export interface ZustandLikeStore<TState = unknown> {
|
|
23
|
+
getState: () => TState;
|
|
24
|
+
subscribe: (callback: () => void) => () => void;
|
|
25
|
+
}
|
|
26
|
+
export type SetValueOptions = {
|
|
27
|
+
shouldDirty?: boolean;
|
|
28
|
+
shouldTouch?: boolean;
|
|
29
|
+
shouldValidate?: boolean;
|
|
30
|
+
};
|
|
31
|
+
export type FieldError = {
|
|
32
|
+
message: string;
|
|
33
|
+
type?: string;
|
|
34
|
+
};
|
|
35
|
+
export type FieldState = {
|
|
36
|
+
error?: FieldError;
|
|
37
|
+
isDirty?: boolean;
|
|
38
|
+
isTouched?: boolean;
|
|
39
|
+
invalid?: boolean;
|
|
40
|
+
};
|
|
41
|
+
export type FormState = {
|
|
42
|
+
isDirty: boolean;
|
|
43
|
+
isValid: boolean;
|
|
44
|
+
isSubmitting?: boolean;
|
|
45
|
+
errors: Record<string, FieldError>;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Unified form backend interface.
|
|
49
|
+
* Factory functions (createRHFBackend, createStoreBackend) return this interface.
|
|
50
|
+
*
|
|
51
|
+
* Internal properties (form, store, scope, blockId) are available for hooks that need
|
|
52
|
+
* direct access to underlying implementations (e.g., for reactivity).
|
|
53
|
+
*/
|
|
54
|
+
export interface FormBackend {
|
|
55
|
+
/** Backend type identifier */
|
|
56
|
+
type: 'rhf' | 'store';
|
|
57
|
+
/** RHF form instance (RHF backend only) */
|
|
58
|
+
form?: UseFormReturn<FieldValues>;
|
|
59
|
+
/** Zustand store instance (Store backend only) */
|
|
60
|
+
store?: ZustandLikeStore;
|
|
61
|
+
/** Store scope (Store backend only) */
|
|
62
|
+
scope?: 'blocks' | 'metadata' | 'content';
|
|
63
|
+
/** Block ID for blocks scope (Store backend only) */
|
|
64
|
+
blockId?: EditorBlockId;
|
|
65
|
+
/** Get value at field path */
|
|
66
|
+
getValue: (path: string) => unknown;
|
|
67
|
+
/** Set value at field path with options */
|
|
68
|
+
setValue: (path: string, value: unknown, options?: SetValueOptions) => void;
|
|
69
|
+
/** Get all form values */
|
|
70
|
+
getValues: () => Record<string, unknown>;
|
|
71
|
+
/** Get field-level state (error, dirty, touched) */
|
|
72
|
+
getFieldState: (path: string) => FieldState;
|
|
73
|
+
/** Set custom error on field (for async/server validation) */
|
|
74
|
+
setError: (path: string, error: FieldError) => void;
|
|
75
|
+
/** Clear errors (specific field or all) */
|
|
76
|
+
clearErrors: (path?: string) => void;
|
|
77
|
+
/** Get all form errors */
|
|
78
|
+
getErrors: () => Record<string, FieldError>;
|
|
79
|
+
/** Manually mark field as dirty */
|
|
80
|
+
setDirty: (path: string, isDirty: boolean) => void;
|
|
81
|
+
/** Manually mark field as touched */
|
|
82
|
+
setTouched: (path: string, isTouched: boolean) => void;
|
|
83
|
+
/** Reset field to default value */
|
|
84
|
+
resetField: (path: string) => void;
|
|
85
|
+
/** Request focus on field */
|
|
86
|
+
setFocus: (path: string) => void;
|
|
87
|
+
/** Array field operations for repeater widgets */
|
|
88
|
+
arrayField: {
|
|
89
|
+
/** Append item to array */
|
|
90
|
+
append: (path: string, value: unknown) => void;
|
|
91
|
+
/** Remove item at index */
|
|
92
|
+
remove: (path: string, index: number) => void;
|
|
93
|
+
/** Move item from one index to another */
|
|
94
|
+
move: (path: string, from: number, to: number) => void;
|
|
95
|
+
/** Insert item at index */
|
|
96
|
+
insert: (path: string, index: number, value: unknown) => void;
|
|
97
|
+
};
|
|
98
|
+
/** Get form-level state */
|
|
99
|
+
formState: FormState;
|
|
100
|
+
/** Reset entire form (optionally with new values) */
|
|
101
|
+
reset: (values?: unknown) => void;
|
|
102
|
+
/** Trigger validation */
|
|
103
|
+
validate: () => Promise<boolean>;
|
|
104
|
+
/**
|
|
105
|
+
* Subscribe to form changes. Callback fires whenever any value changes.
|
|
106
|
+
* Returns unsubscribe function.
|
|
107
|
+
*
|
|
108
|
+
* This is the unified subscription API - consumers should never branch on backend.type.
|
|
109
|
+
*/
|
|
110
|
+
subscribe: (callback: () => void) => () => void;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Options for creating a store backend
|
|
114
|
+
*/
|
|
115
|
+
export type StoreBackendOptions<TState = unknown> = {
|
|
116
|
+
scope: 'blocks' | 'metadata' | 'content';
|
|
117
|
+
store: ZustandLikeStore<TState>;
|
|
118
|
+
blockId?: EditorBlockId;
|
|
119
|
+
validateFn?: (values: Record<string, unknown>) => ZodIssue[];
|
|
120
|
+
};
|
|
121
|
+
/**
|
|
122
|
+
* Type guards for discriminating backend types
|
|
123
|
+
*/
|
|
124
|
+
export declare function isRhfBackend(backend: FormBackend): backend is FormBackend & {
|
|
125
|
+
type: 'rhf';
|
|
126
|
+
form: UseFormReturn<FieldValues>;
|
|
127
|
+
};
|
|
128
|
+
export declare function isStoreBackend(backend: FormBackend): backend is FormBackend & {
|
|
129
|
+
type: 'store';
|
|
130
|
+
store: ZustandLikeStore;
|
|
131
|
+
scope: 'blocks' | 'metadata' | 'content';
|
|
132
|
+
blockId?: EditorBlockId;
|
|
133
|
+
};
|
|
134
|
+
export type { FieldDefinition } from '@riverbankcms/blocks';
|
|
135
|
+
export { createRHFBackend } from './rhf-backend';
|
|
136
|
+
export { createStoreBackend } from './store-backend';
|
|
137
|
+
export { useBackendWatch } from './useBackendWatch';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useBackendWatch - Hook for watching field values reactively
|
|
3
|
+
*
|
|
4
|
+
* Works with all backends through the unified interface.
|
|
5
|
+
* For RHF backends, uses react-hook-form's optimized useWatch hook.
|
|
6
|
+
* For other backends, uses useSyncExternalStore with backend.subscribe/getValue.
|
|
7
|
+
*/
|
|
8
|
+
import type { FormBackend } from './adapter';
|
|
9
|
+
/**
|
|
10
|
+
* Watch a field path and return its current value.
|
|
11
|
+
* The value updates reactively when the field changes.
|
|
12
|
+
*
|
|
13
|
+
* Uses backend's unified interface - no branching on backend.type.
|
|
14
|
+
* Detects RHF backend by presence of backend.form property.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* const titleValue = useBackendWatch(backend, 'title')
|
|
19
|
+
* const statusValue = useBackendWatch(backend, 'status')
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare function useBackendWatch(backend: FormBackend, path: string): unknown;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getErrorMessage(error: unknown): string | undefined;
|