@riverbankcms/sdk 0.147.0 → 0.148.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/CHANGELOG.md +16 -0
- package/dist/{PreviewEditorSidebar-DtpB3_sS.mjs → PreviewEditorSidebar-DvEPG3Z2.mjs} +202 -143
- package/dist/{PreviewEditorUI-DxTLgaHo.mjs → PreviewEditorUI-D6eb6fkx.mjs} +68 -60
- package/dist/{PreviewQueryProvider-Dd4dxOiU.mjs → PreviewQueryProvider-5znTyJuz.mjs} +1 -1
- package/dist/{SdkPreviewModeRuntime-DMMNCngt.mjs → SdkPreviewModeRuntime-DJ6utQ_R.mjs} +1191 -513
- package/dist/{SiteChromeCustomizeContext-DQXZXiqS.mjs → SiteChromeCustomizeContext-CFJYh6vo.mjs} +201798 -197304
- package/dist/_dts/ai/src/contracts/proposals.d.ts +0 -33
- package/dist/_dts/ai/src/contracts/siteStyleProposalSchemas.d.ts +0 -3
- package/dist/_dts/api/src/accessAdmin.d.ts +0 -4
- package/dist/_dts/api/src/accountApi.d.ts +1 -1
- package/dist/_dts/api/src/admin.d.ts +22 -22
- package/dist/_dts/api/src/aiPatch.d.ts +2 -2
- package/dist/_dts/api/src/aiPlayground.d.ts +1 -0
- package/dist/_dts/api/src/analytics.d.ts +2 -2
- package/dist/_dts/api/src/apiEndpointTypes.d.ts +2 -0
- package/dist/_dts/api/src/appointmentSetup.d.ts +2 -2
- package/dist/_dts/api/src/auth.d.ts +10 -10
- package/dist/_dts/api/src/availability.d.ts +6 -6
- package/dist/_dts/api/src/billing.d.ts +42 -15
- package/dist/_dts/api/src/billingEndpointDefinitions.d.ts +8 -0
- package/dist/_dts/api/src/billingEndpointTypes.d.ts +15 -6
- package/dist/_dts/api/src/blocks.d.ts +15 -14
- package/dist/_dts/api/src/blocksKeys.d.ts +2 -0
- package/dist/_dts/api/src/bookingConfig.d.ts +0 -2
- package/dist/_dts/api/src/bookingOperations.d.ts +4 -4
- package/dist/_dts/api/src/bookingRecords.d.ts +1 -0
- package/dist/_dts/api/src/bookings.d.ts +7 -7
- package/dist/_dts/api/src/calendar.d.ts +9 -9
- package/dist/_dts/api/src/commercePortalEndpoints.d.ts +7 -6
- package/dist/_dts/api/src/common/envelope.d.ts +2 -2
- package/dist/_dts/api/src/content-editor.d.ts +2 -2
- package/dist/_dts/api/src/contentEntries.d.ts +17 -48
- package/dist/_dts/api/src/contentRuntime.d.ts +51 -37
- package/dist/_dts/api/src/contentTypes.d.ts +11 -11
- package/dist/_dts/api/src/contentVersionHistoryClient.d.ts +6 -6
- package/dist/_dts/api/src/documentLifecycle.d.ts +67 -0
- package/dist/_dts/api/src/domains.d.ts +16 -16
- package/dist/_dts/api/src/editLeaseEndpoints.d.ts +72 -0
- package/dist/_dts/api/src/emailSettings.d.ts +4 -4
- package/dist/_dts/api/src/endpoints.d.ts +133 -41
- package/dist/_dts/api/src/eventEmailTemplates.d.ts +2 -2
- package/dist/_dts/api/src/eventManagementContracts.d.ts +25 -0
- package/dist/_dts/api/src/eventManagementEndpointDefinitions.d.ts +0 -8
- package/dist/_dts/api/src/eventPageWords.d.ts +7 -12
- package/dist/_dts/api/src/footerSettings.d.ts +6 -6
- package/dist/_dts/api/src/index.d.ts +6 -5
- package/dist/_dts/api/src/indexCoreTypes.d.ts +1 -0
- package/dist/_dts/api/src/indexExtendedTypes.d.ts +1 -1
- package/dist/_dts/api/src/navigation.d.ts +5 -5
- package/dist/_dts/api/src/pageSurfaceEditorEndpoints.d.ts +55 -0
- package/dist/_dts/api/src/pageSurfaceEndpoints.d.ts +28 -7
- package/dist/_dts/api/src/pages.d.ts +7 -7
- package/dist/_dts/api/src/performance.d.ts +1 -1
- package/dist/_dts/api/src/public/index.d.ts +1 -1
- package/dist/_dts/api/src/publicAppointmentBookingContracts.d.ts +2 -0
- package/dist/_dts/api/src/publicExperience/commerceEndpoints.d.ts +4 -0
- package/dist/_dts/api/src/redirects.d.ts +3 -3
- package/dist/_dts/api/src/request.d.ts +10 -1
- package/dist/_dts/api/src/resources.d.ts +4 -4
- package/dist/_dts/api/src/routes.d.ts +8 -3
- package/dist/_dts/api/src/sdk-event-upsert.d.ts +0 -1
- package/dist/_dts/api/src/sdkBlockUpsertContracts.d.ts +21 -0
- package/dist/_dts/api/src/sdkContracts.d.ts +5 -28
- package/dist/_dts/api/src/sdkEventEndpointDefinitions.d.ts +1 -1
- package/dist/_dts/api/src/sdkEventOccurrenceRequestContracts.d.ts +43 -0
- package/dist/_dts/api/src/sdkManagedEventContracts.d.ts +4 -2
- package/dist/_dts/api/src/sdkPullEventContracts.d.ts +8 -1
- package/dist/_dts/api/src/seo.d.ts +4 -4
- package/dist/_dts/api/src/services.d.ts +4 -4
- package/dist/_dts/api/src/siteManagementEndpoints.d.ts +15 -8
- package/dist/_dts/api/src/siteMembers.d.ts +10 -10
- package/dist/_dts/api/src/siteOnboarding.d.ts +14 -0
- package/dist/_dts/api/src/sitePlatformEndpoints.d.ts +7 -3
- package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +5 -12
- package/dist/_dts/api/src/siteRuntimeEntry.d.ts +31 -0
- package/dist/_dts/billing/src/checkout/platform.d.ts +77 -0
- package/dist/_dts/billing/src/components/index.d.ts +25 -40
- package/dist/_dts/billing/src/membership/index.d.ts +1 -3
- package/dist/_dts/billing/src/plans/entitlements.d.ts +80 -0
- package/dist/_dts/billing/src/plans/registry.d.ts +16 -16
- package/dist/_dts/billing/src/plans/standing.d.ts +9 -2
- package/dist/_dts/billing/src/plans/types.d.ts +5 -15
- package/dist/_dts/billing/src/site-arrangements.d.ts +2 -2
- package/dist/_dts/billing/src/subscriptions/standingEvidence.d.ts +2 -4
- package/dist/_dts/billing/src/subscriptions/store.d.ts +17 -11
- package/dist/_dts/block-form/src/backend/store-backend.d.ts +6 -7
- package/dist/_dts/block-form/src/backend/types.d.ts +7 -0
- package/dist/_dts/block-form/src/widgets/FieldFrame.d.ts +3 -1
- package/dist/_dts/blocks/src/client/events.d.ts +3 -0
- package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +16 -4
- package/dist/_dts/blocks/src/pageRenderAdmission.d.ts +4 -13
- package/dist/_dts/blocks/src/pageRendererContracts.d.ts +2 -0
- package/dist/_dts/blocks/src/portal/types.d.ts +0 -2
- package/dist/_dts/blocks/src/system/blocks/contact-newsletter.d.ts +2 -1
- package/dist/_dts/blocks/src/system/blocks/event-registration.d.ts +3 -1
- package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +4 -4
- package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +6 -1
- package/dist/_dts/blocks/src/system/runtime/api/client.d.ts +2 -2
- package/dist/_dts/blocks/src/system/runtime/api/index.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/api/types/appointments.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/api/types/events.d.ts +6 -0
- package/dist/_dts/blocks/src/system/runtime/api/types/portal.d.ts +6 -0
- package/dist/_dts/blocks/src/system/runtime/api/types/shop.d.ts +4 -0
- package/dist/_dts/blocks/src/system/runtime/components/booking/SuccessMessage.d.ts +4 -1
- package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +24 -6
- package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +12 -3
- package/dist/_dts/blocks/src/system/runtime/hooks/useHeadlessBookingFlow.d.ts +3 -0
- package/dist/_dts/blocks/src/system/runtime/hooks/usePaymentVerification.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/hooks/usePolling.d.ts +7 -48
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.checkout-return-context.d.ts +7 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.completion.d.ts +3 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.headless.state.d.ts +4 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.interactive.d.ts +9 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.payment-confirmation.d.ts +13 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.state.d.ts +15 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.submit-actions.d.ts +8 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.submit-handler.d.ts +1 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-runtime-sources.d.ts +1 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/checkout.server.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventRegistrationSurface.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventRegistrationWizard.d.ts +5 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/SuccessStep.d.ts +4 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/types.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationSubmit.d.ts +2 -5
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration.interactive.d.ts +9 -5
- package/dist/_dts/blocks/src/system/runtime/nodes/events/EventListing.interactive.d.ts +6 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/domain/dates.d.ts +37 -3
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/EventCard.client.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/EventCard.d.ts +16 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/eventCardPresentations.d.ts +13 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/eventCollectionContract.d.ts +5 -5
- package/dist/_dts/blocks/src/system/runtime/nodes/shared/MagicLinkForm.d.ts +1 -14
- package/dist/_dts/blocks/src/system/runtime/nodes/shared/MagicLinkForm.state.d.ts +12 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/shop.interactive.d.ts +13 -0
- package/dist/_dts/blocks/src/system/runtime/shared/components/DemoBookingPortalAccess.d.ts +22 -0
- package/dist/_dts/blocks/src/system/runtime/shared/components/DemoPortalSignInLink.d.ts +4 -0
- package/dist/_dts/blocks/src/system/runtime/shared/components/index.d.ts +1 -0
- package/dist/_dts/blocks/src/system/runtime/shared/utils/demoBookingPassStorage.d.ts +10 -0
- package/dist/_dts/blocks/src/system/runtime/shared/utils/demoPortalMagicLink.d.ts +29 -0
- package/dist/_dts/commerce/src/purchase/event-registration-errors.d.ts +4 -0
- package/dist/_dts/content-editor/src/components/ContentFieldsForm.d.ts +2 -7
- package/dist/_dts/content-editor/src/controller/EditLeaseController.d.ts +39 -0
- package/dist/_dts/content-editor/src/controller/EditorWriteGate.d.ts +38 -0
- package/dist/_dts/content-editor/src/controller/EntryControllerProvider.d.ts +25 -61
- package/dist/_dts/content-editor/src/controller/LinkedEntryLeaseBanner.d.ts +7 -0
- package/dist/_dts/content-editor/src/controller/LinkedEntryLeaseControllers.d.ts +14 -0
- package/dist/_dts/content-editor/src/controller/deriveEditorUnpublishedState.d.ts +6 -0
- package/dist/_dts/content-editor/src/controller/documentValueBaseline.d.ts +25 -0
- package/dist/_dts/content-editor/src/controller/editLeaseLossSignal.d.ts +6 -0
- package/dist/_dts/content-editor/src/controller/editLeaseNotice.d.ts +28 -0
- package/dist/_dts/content-editor/src/controller/editorClientId.d.ts +2 -0
- package/dist/_dts/content-editor/src/controller/editorEditability.d.ts +38 -0
- package/dist/_dts/content-editor/src/controller/editorLeaseParticipation.d.ts +34 -0
- package/dist/_dts/content-editor/src/controller/normalizedMetadataBaseline.d.ts +29 -0
- package/dist/_dts/content-editor/src/controller/pageSurfaceDocumentBaselines.d.ts +14 -0
- package/dist/_dts/content-editor/src/controller/pageSurfaceLifecycle.d.ts +11 -0
- package/dist/_dts/content-editor/src/controller/planDocumentBaselineRefresh.d.ts +19 -0
- package/dist/_dts/content-editor/src/controller/readDocumentLeaseBaselines.d.ts +19 -0
- package/dist/_dts/content-editor/src/controller/refreshDocumentLeaseBaseline.d.ts +12 -0
- package/dist/_dts/content-editor/src/controller/refreshLinkedEntry.d.ts +17 -0
- package/dist/_dts/content-editor/src/controller/replayRestoredEditorEffects.d.ts +2 -3
- package/dist/_dts/content-editor/src/controller/routeWrites.d.ts +26 -0
- package/dist/_dts/content-editor/src/controller/useAutosaveTriggers.d.ts +16 -17
- package/dist/_dts/content-editor/src/controller/useBlockedPublishPlan.d.ts +6 -2
- package/dist/_dts/content-editor/src/controller/useBlocksList.d.ts +3 -3
- package/dist/_dts/content-editor/src/controller/useEntryValueAutosaves.d.ts +21 -0
- package/dist/_dts/content-editor/src/controller/useInitialEditorUiStore.d.ts +24 -0
- package/dist/_dts/content-editor/src/controller/useServerBaselineReconciliation.d.ts +17 -0
- package/dist/_dts/content-editor/src/footerComposerPanelTypes.d.ts +1 -1
- package/dist/_dts/content-editor/src/hooks/applyBlockedPublishPlan.d.ts +5 -1
- package/dist/_dts/content-editor/src/hooks/blockDraftLifecycle.d.ts +8 -47
- package/dist/_dts/content-editor/src/hooks/editLeaseMachine.d.ts +120 -0
- package/dist/_dts/content-editor/src/hooks/publishability.d.ts +6 -10
- package/dist/_dts/content-editor/src/hooks/useAutosaveStatus.d.ts +3 -0
- package/dist/_dts/content-editor/src/hooks/useBlockAutosave.d.ts +5 -15
- package/dist/_dts/content-editor/src/hooks/useDebouncedLatestSave.d.ts +7 -5
- package/dist/_dts/content-editor/src/hooks/useEditLease.d.ts +28 -0
- package/dist/_dts/content-editor/src/hooks/useEntryActions.d.ts +25 -39
- package/dist/_dts/content-editor/src/hooks/useEntryMutations.d.ts +17 -19
- package/dist/_dts/content-editor/src/hooks/useLinkedEntryAutosave.d.ts +5 -8
- package/dist/_dts/content-editor/src/hooks/useValueAutosave.d.ts +64 -0
- package/dist/_dts/content-editor/src/hooks/validateBlocksForPublish.d.ts +0 -7
- package/dist/_dts/content-editor/src/index.d.ts +26 -7
- package/dist/_dts/content-editor/src/linkedEntries/domain.d.ts +12 -0
- package/dist/_dts/content-editor/src/linkedEntries/owner.d.ts +9 -0
- package/dist/_dts/content-editor/src/liveDrafts/draftProjection.d.ts +66 -0
- package/dist/_dts/content-editor/src/liveDrafts/linkedSaveHandovers.d.ts +37 -0
- package/dist/_dts/content-editor/src/liveDrafts/remoteDraftOverlay.d.ts +113 -0
- package/dist/_dts/content-editor/src/liveDrafts/useLiveDrafts.d.ts +32 -0
- package/dist/_dts/content-editor/src/liveDrafts/useRetentionTicks.d.ts +7 -0
- package/dist/_dts/content-editor/src/primitives/shared/activePreviewField.d.ts +6 -0
- package/dist/_dts/content-editor/src/primitives/shared/storeBinding.d.ts +1 -0
- package/dist/_dts/content-editor/src/services/contentEntryServices.d.ts +96 -19
- package/dist/_dts/content-editor/src/services/editorApiClient.d.ts +13 -0
- package/dist/_dts/content-editor/src/services/index.d.ts +2 -0
- package/dist/_dts/content-editor/src/services/pageSurfaceEditorServices.d.ts +23 -0
- package/dist/_dts/content-editor/src/sync/flushValues.d.ts +13 -0
- package/dist/_dts/content-editor/src/sync/lifecycleFailure.d.ts +51 -0
- package/dist/_dts/content-editor/src/sync/runLifecycle.d.ts +64 -0
- package/dist/_dts/content-editor/src/sync/schedulerValues.d.ts +27 -0
- package/dist/_dts/content-editor/src/sync/sendPlanning.d.ts +104 -0
- package/dist/_dts/content-editor/src/sync/valueSync.d.ts +114 -0
- package/dist/_dts/content-editor/src/ui/blockCollection.d.ts +8 -0
- package/dist/_dts/content-editor/src/ui/documentLifecycle.d.ts +18 -0
- package/dist/_dts/content-editor/src/ui/editorLeaseUiState.d.ts +7 -0
- package/dist/_dts/content-editor/src/ui/editorRefresh.d.ts +82 -0
- package/dist/_dts/content-editor/src/ui/editorSnapshot.d.ts +102 -127
- package/dist/_dts/content-editor/src/ui/editorTransactionState.d.ts +1 -1
- package/dist/_dts/content-editor/src/ui/editorUiStore.d.ts +126 -72
- package/dist/_dts/content-editor/src/ui/editorValueSnapshot.d.ts +18 -0
- package/dist/_dts/content-editor/src/ui/serverBlockAdmission.d.ts +26 -0
- package/dist/_dts/content-editor/src/ui/stores/autosaveStore.d.ts +16 -27
- package/dist/_dts/content-editor/src/ui/stores/blockVersionsStore.d.ts +24 -0
- package/dist/_dts/content-editor/src/ui/stores/linkedEntryLeaseStore.d.ts +54 -0
- package/dist/_dts/content-editor/src/ui/stores/linkedSaveHandoversStore.d.ts +11 -0
- package/dist/_dts/content-editor/src/ui/stores/remoteDraftsStore.d.ts +10 -0
- package/dist/_dts/content-editor/src/ui/stores/types.d.ts +63 -3
- package/dist/_dts/content-editor/src/useFooterComposerState.d.ts +2 -2
- package/dist/_dts/content-editor/src/useFooterNavigationLayout.d.ts +1 -1
- package/dist/_dts/content-model/src/content-types/builtin-schemas.d.ts +4 -4
- package/dist/_dts/content-model/src/content-types/builtins.d.ts +4 -4
- package/dist/_dts/content-model/src/definitions/shared.d.ts +11 -2
- package/dist/_dts/content-model/src/entry-slots/index.d.ts +1 -0
- package/dist/_dts/content-model/src/entry-slots/serializeAllowedBlocks.d.ts +2 -0
- package/dist/_dts/content-model/src/metadataConfig.d.ts +10 -38
- package/dist/_dts/content-model/src/templates/defaults.d.ts +0 -1
- package/dist/_dts/content-model/src/types.d.ts +0 -1
- package/dist/_dts/core/src/block-content-identity.d.ts +49 -1
- package/dist/_dts/core/src/branded.d.ts +12 -0
- package/dist/_dts/core/src/currency-format.d.ts +8 -2
- package/dist/_dts/core/src/demo-lifecycle-status.d.ts +2 -2
- package/dist/_dts/core/src/demo-warm-pool-target.d.ts +8 -0
- package/dist/_dts/core/src/edit-lease.d.ts +55 -0
- package/dist/_dts/core/src/editor-state.d.ts +38 -13
- package/dist/_dts/core/src/editor-value-sync.d.ts +79 -0
- package/dist/_dts/core/src/html-entities.d.ts +6 -0
- package/dist/_dts/core/src/index.d.ts +4 -0
- package/dist/_dts/core/src/uuid.d.ts +7 -5
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +159 -153
- package/dist/_dts/editor/src/EditorProvider.d.ts +5 -0
- package/dist/_dts/editor/src/chrome/EditorChrome.d.ts +14 -0
- package/dist/_dts/editor/src/chrome/EditorStatusBar.d.ts +1 -0
- package/dist/_dts/editor/src/chrome/statusBarPresentation.d.ts +0 -1
- package/dist/_dts/editor/src/index.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/BlockEditor.d.ts +10 -9
- package/dist/_dts/editor-blocks/src/BlockForm.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/block-editor/BlockCard.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/block-editor/BlockCardFrame.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/block-editor/BlockSettingsModal.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/block-editor/applyExtendedFieldDefaults.d.ts +3 -4
- package/dist/_dts/editor-blocks/src/block-editor/blockDraftBaselineSeed.d.ts +4 -8
- package/dist/_dts/editor-blocks/src/block-editor/editorBlockItem.d.ts +23 -0
- package/dist/_dts/editor-blocks/src/block-editor/generatedIconApplyCoordination.d.ts +2 -7
- package/dist/_dts/editor-blocks/src/block-editor/hooks/applyBlockStructureChange.d.ts +4 -0
- package/dist/_dts/editor-blocks/src/block-editor/hooks/buildInsertBlockHistoryCommand.d.ts +14 -5
- package/dist/_dts/editor-blocks/src/block-editor/hooks/useBlockBaselineSync.d.ts +21 -19
- package/dist/_dts/editor-blocks/src/block-editor/hooks/useBlockCreation.d.ts +2 -10
- package/dist/_dts/editor-blocks/src/block-editor/hooks/useBlockDuplication.d.ts +8 -16
- package/dist/_dts/editor-blocks/src/block-editor/owner.d.ts +6 -16
- package/dist/_dts/editor-blocks/src/block-editor/types.d.ts +37 -9
- package/dist/_dts/editor-blocks/src/index.d.ts +2 -1
- package/dist/_dts/editor-blocks/src/widgets/entry-picker/loaders.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/link/loaders.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/mailing-list-targeting/loaders.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/reference/loaders.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/site-option-picker/loaders.d.ts +3 -2
- package/dist/_dts/media-core/src/fileStorage.d.ts +4 -0
- package/dist/_dts/media-editor/src/context.d.ts +1 -1
- package/dist/_dts/media-editor/src/createMediaEditorProvider.d.ts +1 -2
- package/dist/_dts/media-editor/src/provider.d.ts +3 -2
- package/dist/_dts/media-react/src/hooks/internal/classification.d.ts +1 -1
- package/dist/_dts/media-react/src/hooks/useApiMediaUploader.d.ts +3 -1
- package/dist/_dts/preview-next/src/client/blocks/composer/mergeDrafts.d.ts +8 -3
- package/dist/_dts/preview-next/src/client/blocks/composer/types.d.ts +6 -3
- package/dist/_dts/preview-next/src/client/blocks/linkedEntryRenderOverlay.d.ts +22 -2
- package/dist/_dts/preview-next/src/client/blocks/previewProjection/entryFieldRebinding.d.ts +13 -0
- package/dist/_dts/preview-next/src/client/blocks/previewProjection/index.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/blocks/previewProjection/types.d.ts +11 -1
- package/dist/_dts/preview-next/src/client/blocks/renderPrecedence.d.ts +17 -0
- package/dist/_dts/preview-next/src/client/blocks/useLinkedSaveHandoverRetention.d.ts +20 -0
- package/dist/_dts/preview-next/src/client/index.d.ts +1 -1
- package/dist/_dts/preview-next/src/client/preview/EntryEditorPanel.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/preview/EntrySlotBlockEditorPanel.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/preview/PreviewAccessBanners.d.ts +7 -0
- package/dist/_dts/preview-next/src/client/preview/PreviewEditorSidebar.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/preview/PreviewEntryControllerProvider.d.ts +24 -14
- package/dist/_dts/preview-next/src/client/preview/PreviewLeaseEditingMode.d.ts +2 -0
- package/dist/_dts/preview-next/src/client/preview/PreviewShell.d.ts +9 -2
- package/dist/_dts/preview-next/src/client/preview/PreviewShellLayout.d.ts +1 -0
- package/dist/_dts/preview-next/src/client/preview/previewCustomizeAutosave.d.ts +5 -0
- package/dist/_dts/preview-next/src/client/preview/previewCustomizeWorkflowState.d.ts +3 -4
- package/dist/_dts/preview-next/src/client/preview/sdkConfig.d.ts +1 -0
- package/dist/_dts/preview-next/src/client/preview/usePreviewCustomizeWorkflowState.d.ts +4 -0
- package/dist/_dts/realtime/src/client.d.ts +3 -0
- package/dist/_dts/realtime/src/draftChannel.d.ts +91 -0
- package/dist/_dts/realtime/src/drafts.d.ts +210 -0
- package/dist/_dts/realtime/src/index.d.ts +3 -0
- package/dist/_dts/realtime/src/leaseChangeSubscriptions.d.ts +8 -0
- package/dist/_dts/realtime/src/types.d.ts +113 -0
- package/dist/_dts/realtime/src/useDraftChannel.d.ts +34 -0
- package/dist/_dts/realtime/src/useSiteRealtimeReload.d.ts +27 -0
- package/dist/_dts/sdk/src/public-api/contracts.d.ts +6 -55
- package/dist/_dts/sdk/src/rendering/blocks-page-renderer.d.ts +1 -0
- package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +1 -0
- package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +2 -0
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/surfaces/src/index.d.ts +1 -0
- package/dist/_dts/theme-core/src/site-styles/designState.d.ts +2 -2
- package/dist/client/{BookingMailingListNote-1n4Ch_u_.mjs → BookingMailingListNote-CzRt2dF_.mjs} +98 -96
- package/dist/client/DemoBookingPortalAccess-mxqwap3f.mjs +344 -0
- package/dist/client/{EventCombined.client-C0pgma9y.mjs → EventCombined.client-CDb11igO.mjs} +6 -6
- package/dist/client/{EventListing.client-4fhLOvHP.mjs → EventListing.client-EgYhzKPa.mjs} +2 -2
- package/dist/client/{LeafletStaticMap-DScC4F3w.mjs → LeafletStaticMap-gtmtaA2b.mjs} +1 -1
- package/dist/client/{TerminalPanel-B5ZUsYhe.mjs → TerminalPanel-DvNUP5ot.mjs} +1 -1
- package/dist/client/{ThemedButton-DoVIV1Ao.mjs → ThemedButton-C7CeUJjW.mjs} +1 -1
- package/dist/client/{accordion-CoT5g7zo.mjs → accordion-kjvt49rA.mjs} +1 -1
- package/dist/client/{bookingForm-BWxB46xD.mjs → bookingForm-pbRZordh.mjs} +212 -62
- package/dist/client/bookings.mjs +616 -225
- package/dist/client/{carousel-DtNYWFd3.mjs → carousel-f4Zbmicv.mjs} +1 -1
- package/dist/client/{cart-z4qZih1Y.mjs → cart-DO20An50.mjs} +3 -3
- package/dist/client/{checkout-DpL7euFH.mjs → checkout-Du5amDR_.mjs} +3 -3
- package/dist/client/{checkoutUrls-BEfR7kVu.mjs → checkoutUrls-CXhko2Rv.mjs} +1 -1
- package/dist/client/client.mjs +1753 -823
- package/dist/client/{context-C8TinPJc.mjs → context-eW97E945.mjs} +4 -3
- package/dist/client/{dates-vwwxTeB0.mjs → dates-jPCirRea.mjs} +56 -11
- package/dist/client/{eventCalendar-DIbHfJXO.mjs → eventCalendar-C2M-iE4j.mjs} +9 -9
- package/dist/client/{eventCombined-DoGMJ6cg.mjs → eventCombined-W6ns3LHg.mjs} +4 -4
- package/dist/client/{eventDetails-BjN9v6a1.mjs → eventDetails-CR-GT0f0.mjs} +4 -4
- package/dist/client/{eventListing-DajjWgOv.mjs → eventListing-BK8AfYZz.mjs} +4 -4
- package/dist/client/{eventRegistration-DMq9gMA-.mjs → eventRegistration-BJSd4KUu.mjs} +369 -242
- package/dist/client/{form-Qf6qTbos.mjs → form-BvpfbQaT.mjs} +3 -3
- package/dist/client/{headerSection-D7qJrqFX.mjs → headerSection-I5sUQ8x-.mjs} +3 -3
- package/dist/client/hooks.mjs +254 -53
- package/dist/client/{locationMap-CCF9-t_0.mjs → locationMap-BLvwf9_f.mjs} +3 -3
- package/dist/client/{media-CwBGetqC.mjs → media-Cl38iOMI.mjs} +10 -3
- package/dist/client/{newsletterForm-DzCLSP4S.mjs → newsletterForm-DrQ2weE8.mjs} +3 -3
- package/dist/client/{pricing-Cgxv2KLC.mjs → pricing-BES87mrR.mjs} +1 -1
- package/dist/client/{productDetail-ru9w5GHx.mjs → productDetail-Url9jcc5.mjs} +3 -3
- package/dist/client/{productList-zaapKSl-.mjs → productList-DE7ngEZJ.mjs} +3 -3
- package/dist/client/{propsDecoder-CwvvNOHx.mjs → propsDecoder-D1OtGXDV.mjs} +89 -17
- package/dist/client/rendering/client.mjs +1445 -658
- package/dist/client/rendering/islands.mjs +18 -18
- package/dist/client/rendering.mjs +2478 -1515
- package/dist/client/{routeIslandApiConfig-BwVFo0Y4.mjs → routeIslandApiConfig-BG9Y-SHg.mjs} +1 -1
- package/dist/client/{shop-mktkXvbV.mjs → shop-CJkuySJ3.mjs} +126 -79
- package/dist/client/{shop-commerce-De7gEnkA.mjs → shop-commerce-4rKj5n9h.mjs} +25 -13
- package/dist/client/{shop-commerce-store-B3MCxIBW.mjs → shop-commerce-store-Bxm75Pg6.mjs} +1 -1
- package/dist/client/{shopShared-TqExh235.mjs → shopShared-DpoQDWfz.mjs} +4 -4
- package/dist/client/{useEventFilters-n_OjkIjX.mjs → useEventFilters-D8HliSqR.mjs} +32 -17
- package/dist/preview-next/before-render.mjs +192 -83
- package/dist/preview-next/client/runtime.mjs +4 -4
- package/dist/preview-next/keepAlive.mjs +192 -83
- package/dist/preview-next/middleware.mjs +192 -83
- package/dist/{previewAuthStore-C_EHQ5XA.mjs → previewAuthStore-BXXF3hhW.mjs} +194 -83
- package/dist/{sdk-runtime-BIkJg5y1.mjs → sdk-runtime-C2a05WjL.mjs} +2 -2
- package/dist/{separator-C9qDP95Z.mjs → separator-CuNhBAhS.mjs} +1 -1
- package/dist/server/components.mjs +1720 -1392
- package/dist/server/config-validation.mjs +221 -37
- package/dist/server/config.mjs +221 -37
- package/dist/server/data.mjs +221 -37
- package/dist/server/index.mjs +195 -84
- package/dist/server/next.mjs +490 -196
- package/dist/server/page-converter.mjs +53 -14
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +1427 -1098
- package/dist/server/rendering.mjs +2693 -2365
- package/dist/server/routing.mjs +291 -55
- package/dist/server/server.mjs +281 -114
- package/package.json +1 -1
- package/dist/_dts/billing/src/plans/display.d.ts +0 -15
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.mailing-list-note.d.ts +0 -3
- package/dist/_dts/content-editor/src/controller/buildBlockPublishedBaselines.d.ts +0 -4
- package/dist/_dts/content-editor/src/controller/buildPublishSuccessTransition.d.ts +0 -16
- package/dist/_dts/content-editor/src/controller/driver.d.ts +0 -14
- package/dist/_dts/content-editor/src/controller/seedDraftBaselinesFromBlocks.d.ts +0 -7
- package/dist/_dts/content-editor/src/controller/useEntrySyncHelpers.d.ts +0 -29
- package/dist/_dts/content-editor/src/hooks/autosaveScopePlanning.d.ts +0 -26
- package/dist/_dts/content-editor/src/hooks/useSimpleAutosave.d.ts +0 -64
- package/dist/_dts/content-editor/src/hooks/useStoreAutosave.d.ts +0 -48
- package/dist/_dts/content-editor/src/types.d.ts +0 -44
- package/dist/client/DiscountCodeDisclosure-CKJtz0mY.mjs +0 -137
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
export type DebouncedLatestSaveHandle = {
|
|
1
|
+
export type DebouncedLatestSaveHandle<TResult = void, TSnapshot = unknown> = {
|
|
2
2
|
trigger: () => void;
|
|
3
3
|
cancel: () => void;
|
|
4
|
-
flush: () => Promise<
|
|
4
|
+
flush: () => Promise<TResult | undefined>;
|
|
5
5
|
isPending: () => boolean;
|
|
6
|
+
whenIdle: () => Promise<TResult | undefined>;
|
|
7
|
+
run: (snapshot: TSnapshot) => Promise<TResult | undefined>;
|
|
6
8
|
};
|
|
7
9
|
export type DebouncedLatestSaveConfig<TSnapshot, TPayload, TResult> = {
|
|
8
10
|
getSnapshot: () => TSnapshot;
|
|
9
|
-
buildPayload: (snapshot: TSnapshot) => TPayload | null | undefined;
|
|
11
|
+
buildPayload: (snapshot: TSnapshot, preceding?: TResult) => TPayload | null | undefined;
|
|
10
12
|
save: (payload: TPayload) => Promise<TResult>;
|
|
11
13
|
shouldSkip?: (snapshot: TSnapshot) => boolean;
|
|
12
14
|
onSaving?: (snapshot: TSnapshot) => void;
|
|
@@ -19,6 +21,6 @@ export type DebouncedLatestSaveConfig<TSnapshot, TPayload, TResult> = {
|
|
|
19
21
|
delay?: number;
|
|
20
22
|
maxWait?: number;
|
|
21
23
|
enabled?: boolean;
|
|
22
|
-
retryDelay?: number;
|
|
23
24
|
};
|
|
24
|
-
|
|
25
|
+
/** Timing and serial execution only. Request identity and save eligibility remain in the value store. */
|
|
26
|
+
export declare function useDebouncedLatestSave<TSnapshot, TPayload, TResult>(config: DebouncedLatestSaveConfig<TSnapshot, TPayload, TResult>): DebouncedLatestSaveHandle<TResult, TSnapshot>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ApiClient } from '../../../api/src/request';
|
|
2
|
+
import type { EditLeaseScope } from '../../../core/src/index';
|
|
3
|
+
import type { EditorLeaseUiState } from '../ui/editorLeaseUiState';
|
|
4
|
+
type LeaseUiPort = Readonly<{
|
|
5
|
+
getState: () => Pick<EditorLeaseUiState, 'setEditability' | 'setLeaseDiscardedChanges'>;
|
|
6
|
+
}>;
|
|
7
|
+
import type { EditLeaseLossSignal } from '../controller/editLeaseLossSignal';
|
|
8
|
+
type LeaseParams = Readonly<{
|
|
9
|
+
siteId: string;
|
|
10
|
+
nodeType: EditLeaseScope['nodeType'];
|
|
11
|
+
nodeId: string;
|
|
12
|
+
}>;
|
|
13
|
+
export type EditLeaseChangeSubscription = (scope: Pick<LeaseParams, 'nodeType' | 'nodeId'>, listener: () => void) => () => void;
|
|
14
|
+
export type UseEditLeaseOptions = Readonly<{
|
|
15
|
+
scope: LeaseParams;
|
|
16
|
+
apiClient: ApiClient;
|
|
17
|
+
uiStore: LeaseUiPort;
|
|
18
|
+
subscribeToLeaseChanges?: EditLeaseChangeSubscription;
|
|
19
|
+
onGranted?: (takingBack: boolean, isCurrent: () => boolean) => Promise<void> | void;
|
|
20
|
+
onAccessChanged?: () => void;
|
|
21
|
+
leaseLossSignal: EditLeaseLossSignal;
|
|
22
|
+
}>;
|
|
23
|
+
export declare function useEditLease({ scope, apiClient, uiStore, subscribeToLeaseChanges, onGranted, onAccessChanged, leaseLossSignal, }: UseEditLeaseOptions): {
|
|
24
|
+
takeOver: () => void;
|
|
25
|
+
retry: () => void;
|
|
26
|
+
recheck: () => void;
|
|
27
|
+
};
|
|
28
|
+
export {};
|
|
@@ -1,65 +1,51 @@
|
|
|
1
1
|
import { type ContentEntrySnapshot, type RoutingHelpers } from '../../../content-model/src/index';
|
|
2
2
|
import type { EditorUiStoreInstance } from '../ui/editorUiStore';
|
|
3
|
+
import type { LifecycleOutcome } from '../ui/stores/types';
|
|
3
4
|
import type { BlockedPublishPlan } from './blockedPublishPlan';
|
|
4
|
-
import type {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
}
|
|
5
|
+
import type { DiscardDraftInput, DiscardLifecycleResult, EditorDeletion, PublishLifecycleResult } from '../services/contentEntryServices';
|
|
6
|
+
export type PublishOptions = Readonly<{
|
|
7
|
+
whenUnchanged?: 'publish' | 'skip';
|
|
8
|
+
}>;
|
|
9
|
+
export type EntryActions = Readonly<{
|
|
10
|
+
saveDraft: () => Promise<LifecycleOutcome>;
|
|
11
|
+
publish: (options?: PublishOptions) => Promise<LifecycleOutcome>;
|
|
12
|
+
discardDraft: () => Promise<LifecycleOutcome>;
|
|
13
|
+
deletion: Readonly<{
|
|
14
|
+
kind: 'deletable';
|
|
15
|
+
deleteEntry: () => Promise<LifecycleOutcome>;
|
|
16
|
+
}> | Readonly<{
|
|
17
|
+
kind: 'deletedWithOwner';
|
|
18
|
+
}>;
|
|
19
|
+
}>;
|
|
19
20
|
export type EntryActionsOptions<TEntry extends ContentEntrySnapshot> = {
|
|
20
21
|
/** Current entry snapshot */
|
|
21
22
|
entry: TEntry;
|
|
22
23
|
/** UI store instance (to read latest metadata values at call time) */
|
|
23
24
|
uiStore: EditorUiStoreInstance;
|
|
24
|
-
/** Whether this entry has a route (pages vs content) */
|
|
25
|
-
hasRoute: boolean;
|
|
26
25
|
/** Routing helpers (for routable published baseline derivations). */
|
|
27
26
|
routing?: RoutingHelpers;
|
|
28
27
|
/** Publish mutation from react-query */
|
|
29
28
|
publishMutation: {
|
|
30
|
-
mutateAsync: (
|
|
29
|
+
mutateAsync: () => Promise<PublishLifecycleResult<TEntry>>;
|
|
31
30
|
};
|
|
32
31
|
/** Discard draft mutation from react-query */
|
|
33
32
|
discardMutation: {
|
|
34
|
-
mutateAsync: () => Promise<TEntry
|
|
33
|
+
mutateAsync: (input: DiscardDraftInput) => Promise<DiscardLifecycleResult<TEntry>>;
|
|
35
34
|
};
|
|
36
35
|
/** Entry definition with services */
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
|
|
40
|
-
clearError?: boolean;
|
|
41
|
-
}) => {
|
|
36
|
+
deletion: EditorDeletion;
|
|
37
|
+
/** The metadata values an entry snapshot holds, as the store holds them (`normalizedMetadataBaseline`). */
|
|
38
|
+
metadataOf: (nextEntry: TEntry) => {
|
|
42
39
|
baseline: Record<string, unknown>;
|
|
43
40
|
values: Record<string, unknown>;
|
|
44
41
|
};
|
|
45
|
-
/** Function to reset form from snapshot */
|
|
46
|
-
resetFromSnapshot: (snapshot: {
|
|
47
|
-
baseline: Record<string, unknown>;
|
|
48
|
-
values: Record<string, unknown>;
|
|
49
|
-
}) => void;
|
|
50
|
-
/** Function to set error message */
|
|
51
|
-
setErrorMessage: (message: string | null) => void;
|
|
52
42
|
setBlockedPublishPlan?: (plan: Extract<BlockedPublishPlan, {
|
|
53
43
|
type: 'blocked';
|
|
54
44
|
}> | null) => void;
|
|
55
45
|
};
|
|
56
46
|
/**
|
|
57
|
-
* Hook to handle entry actions (publish, discard, delete).
|
|
58
|
-
*
|
|
47
|
+
* Hook to handle entry actions (save draft, publish, discard, delete). Each returns a
|
|
48
|
+
* `LifecycleOutcome`; expected refusals are results, and the error banner and status
|
|
49
|
+
* derive from the lifecycle failure it records (issue 1553).
|
|
59
50
|
*/
|
|
60
|
-
export declare function useEntryActions<TEntry extends ContentEntrySnapshot>({ entry, uiStore,
|
|
61
|
-
saveDraft: () => Promise<void>;
|
|
62
|
-
publish: (options?: PublishOptions) => Promise<void>;
|
|
63
|
-
discardDraft: () => Promise<void>;
|
|
64
|
-
deleteEntry: () => Promise<void>;
|
|
65
|
-
};
|
|
51
|
+
export declare function useEntryActions<TEntry extends ContentEntrySnapshot>({ entry, uiStore, routing, publishMutation, discardMutation, deletion, metadataOf, setBlockedPublishPlan: setBlockedPlan, }: EntryActionsOptions<TEntry>): EntryActions;
|
|
@@ -1,28 +1,26 @@
|
|
|
1
|
+
import { useQueryClient } from '@tanstack/react-query';
|
|
1
2
|
import type { ContentEntrySnapshot } from '../../../content-model/src/index';
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
type
|
|
5
|
-
|
|
3
|
+
import type { DocumentBlockState } from '@riverbankcms/api/content-entries';
|
|
4
|
+
import type { DiscardDraftInput, DiscardLifecycleResult, PublishLifecycleResult } from '../services/contentEntryServices';
|
|
5
|
+
type BlockCacheContext = {
|
|
6
|
+
queryClient: ReturnType<typeof useQueryClient>;
|
|
7
|
+
siteId: string;
|
|
8
|
+
type: string;
|
|
9
|
+
entryId: string;
|
|
6
10
|
};
|
|
7
|
-
export declare function
|
|
8
|
-
|
|
11
|
+
export declare function reconcileBlockCache(context: BlockCacheContext, state: DocumentBlockState): void;
|
|
12
|
+
export declare function usePublishEntryMutation<TEntry extends ContentEntrySnapshot = ContentEntrySnapshot>({ publishFn, siteId, type, entryId, }: {
|
|
13
|
+
publishFn?: () => Promise<PublishLifecycleResult<TEntry>>;
|
|
9
14
|
siteId: string;
|
|
10
15
|
type: string;
|
|
11
16
|
entryId: string;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}): import("@tanstack/react-query").UseMutationResult<Readonly<{
|
|
16
|
-
snapshot: TEntry;
|
|
17
|
-
publishedContent?: Record<string, unknown> | null;
|
|
18
|
-
publishedBlocks?: readonly import("../../../api/src/index").PublishedBlockBaseline[];
|
|
19
|
-
}>, Error, TPublishPayload | undefined, unknown>;
|
|
20
|
-
export declare function useDiscardDraftMutation<TEntry = unknown>({ discardFn, siteId, type, entryId, isPage, pageId, }: {
|
|
21
|
-
discardFn?: () => Promise<TEntry>;
|
|
17
|
+
}): import("@tanstack/react-query").UseMutationResult<PublishLifecycleResult<TEntry>, Error, void, unknown>;
|
|
18
|
+
export declare function useDiscardDraftMutation<TEntry extends ContentEntrySnapshot>({ discardFn, siteId, type, entryId, }: {
|
|
19
|
+
discardFn?: (input: DiscardDraftInput) => Promise<DiscardLifecycleResult<TEntry>>;
|
|
22
20
|
siteId: string;
|
|
23
21
|
type: string;
|
|
24
22
|
entryId: string;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
23
|
+
}): import("@tanstack/react-query").UseMutationResult<DiscardLifecycleResult<TEntry>, Error, Readonly<{
|
|
24
|
+
contentRevision: string | null;
|
|
25
|
+
}>, unknown>;
|
|
28
26
|
export {};
|
|
@@ -1,23 +1,20 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type { LinkedContentEntryId, LinkedContentTypeKey } from '../linkedEntries/domain';
|
|
1
|
+
import { type LinkedContentEntryId, type LinkedContentTypeKey } from '../linkedEntries/domain';
|
|
3
2
|
import type { EditorUiStoreInstance } from '../ui/editorUiStore';
|
|
4
3
|
export type PendingLinkedEntrySave = Readonly<{
|
|
5
4
|
entryId: LinkedContentEntryId;
|
|
6
5
|
contentTypeKey: LinkedContentTypeKey;
|
|
7
6
|
content: Record<string, unknown>;
|
|
8
|
-
optimisticHash: string
|
|
9
|
-
acknowledgedVersion: number;
|
|
7
|
+
optimisticHash: string;
|
|
10
8
|
}>;
|
|
11
9
|
export type LinkedEntrySaveResult = Readonly<{
|
|
12
10
|
entryId: LinkedContentEntryId;
|
|
13
11
|
content: Record<string, unknown>;
|
|
14
|
-
optimisticHash: string
|
|
12
|
+
optimisticHash: string;
|
|
15
13
|
}>;
|
|
16
14
|
export type LinkedEntryAutosaveOptions = Readonly<{
|
|
17
15
|
uiStore: EditorUiStoreInstance;
|
|
18
|
-
apiClient: ApiClient;
|
|
19
16
|
siteId: string;
|
|
20
17
|
saveLinkedEntry?: (save: PendingLinkedEntrySave) => Promise<LinkedEntrySaveResult>;
|
|
21
18
|
}>;
|
|
22
|
-
|
|
23
|
-
export declare function useLinkedEntryAutosave(
|
|
19
|
+
/** Linked-entry autosave: the linked-entry family's adapter for `useValueAutosave`. */
|
|
20
|
+
export declare function useLinkedEntryAutosave(options: LinkedEntryAutosaveOptions): import("../ui/editorUiStore").AutosaveHandle;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { BaselineRevision, SaveFailure, SavedBlockContentVersion } from '../../../core/src/index';
|
|
2
|
+
import type { EditorUiState, EditorUiStoreInstance, EditorValueKey, StartedSend } from '../ui/editorUiStore';
|
|
3
|
+
import type { AutosaveHandle, AutosaveType } from '../ui/stores/types';
|
|
4
|
+
import { type FlushCheckpoint, type SendAcknowledgement } from '../sync/sendPlanning';
|
|
5
|
+
import type { SendMode } from '../sync/valueSync';
|
|
6
|
+
/** What the server stored for one request. */
|
|
7
|
+
export type SavedValue = Readonly<{
|
|
8
|
+
blockVersion?: SavedBlockContentVersion;
|
|
9
|
+
values: Record<string, unknown> | null;
|
|
10
|
+
revision: BaselineRevision;
|
|
11
|
+
published?: Readonly<{
|
|
12
|
+
kind: 'known';
|
|
13
|
+
values: Record<string, unknown> | null;
|
|
14
|
+
} | {
|
|
15
|
+
kind: 'unknown';
|
|
16
|
+
}>;
|
|
17
|
+
}>;
|
|
18
|
+
/**
|
|
19
|
+
* One value family's part of autosave: which scheduler it is, and how one started request
|
|
20
|
+
* is sent. `send` resolves with what the server stored and throws on failure.
|
|
21
|
+
*/
|
|
22
|
+
export type ValueAutosaveAdapter<TSaved extends SavedValue = SavedValue> = Readonly<{
|
|
23
|
+
uiStore: EditorUiStoreInstance;
|
|
24
|
+
scheduler: AutosaveType;
|
|
25
|
+
send: (send: StartedSend) => Promise<TSaved>;
|
|
26
|
+
onSaved?: (send: StartedSend, saved: TSaved) => void;
|
|
27
|
+
enabled?: boolean;
|
|
28
|
+
delay?: number;
|
|
29
|
+
maxWait?: number;
|
|
30
|
+
}>;
|
|
31
|
+
/** One batch: the values to send and how a failure among them is treated (`canSend`). */
|
|
32
|
+
export type SendBatch = Readonly<{
|
|
33
|
+
keys: readonly EditorValueKey[];
|
|
34
|
+
mode: SendMode;
|
|
35
|
+
checkpoints?: readonly FlushCheckpoint[];
|
|
36
|
+
completed?: readonly SendAcknowledgement[];
|
|
37
|
+
signal?: AbortSignal;
|
|
38
|
+
}>;
|
|
39
|
+
/** A save that can't be compared-and-set: the editor never received the value's revision. */
|
|
40
|
+
export declare function missingRevisionError(): Error;
|
|
41
|
+
/** A send found the tab no longer holds the value's lease before it reached the server. */
|
|
42
|
+
export declare class LeaseLostError extends Error {
|
|
43
|
+
constructor();
|
|
44
|
+
}
|
|
45
|
+
/** Losing the lease leaves edits unsaved, not failed; they send again once writable (W1). */
|
|
46
|
+
export declare function saveFailureOf(error: unknown): SaveFailure;
|
|
47
|
+
/**
|
|
48
|
+
* The next batch for a scheduler: what the background would send, plus any values a
|
|
49
|
+
* flush asked for, which are sent explicitly so a failure is retried (row S3b). A
|
|
50
|
+
* requested value still has to be writable and saveable now: the lease or a block's
|
|
51
|
+
* validity can change between the flush's plan and this batch.
|
|
52
|
+
*/
|
|
53
|
+
export declare function nextSendBatch(state: EditorUiState, scheduler: AutosaveType, requested: readonly EditorValueKey[]): SendBatch;
|
|
54
|
+
/**
|
|
55
|
+
* The whole send effect: start every planned request under its own id, send them
|
|
56
|
+
* together, and settle each response against its id only.
|
|
57
|
+
*/
|
|
58
|
+
export declare function sendPlanned<TSaved extends SavedValue>(adapter: ValueAutosaveAdapter<TSaved>, batch: SendBatch): Promise<readonly SendAcknowledgement[]>;
|
|
59
|
+
/**
|
|
60
|
+
* The one autosave hook (issue 1553). `useDebouncedLatestSave` is the timing shell
|
|
61
|
+
* (debounce, max wait, one batch at a time); the store's request slots say what is
|
|
62
|
+
* outstanding and `planSends` says what may send.
|
|
63
|
+
*/
|
|
64
|
+
export declare function useValueAutosave<TSaved extends SavedValue>(adapter: ValueAutosaveAdapter<TSaved>): AutosaveHandle;
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pre-publish validation for blocks.
|
|
3
|
-
*
|
|
4
|
-
* Validates all block content using strict mode validation before allowing publish.
|
|
5
|
-
* This catches empty required fields and other validation errors that were allowed
|
|
6
|
-
* during editing (draft mode) but must be fixed before publishing.
|
|
7
|
-
*/
|
|
8
1
|
import type { FieldValidationDescriptor } from '../../../blocks/src/index';
|
|
9
2
|
import type { EditorBlockId } from '../../../core/src/index';
|
|
10
3
|
import type { EditorUiStoreInstance } from '../ui/editorUiStore';
|
|
@@ -1,20 +1,39 @@
|
|
|
1
|
+
export { canWriteLinkedEntry } from './ui/stores/linkedEntryLeaseStore';
|
|
2
|
+
export { LinkedEntryLeaseBanner } from './controller/LinkedEntryLeaseBanner';
|
|
1
3
|
export * from './registry';
|
|
4
|
+
export { getEditorClientId } from './controller/editorClientId';
|
|
5
|
+
export { useEditLeaseActions, type EditLeaseControllerActions, type EditorLeaseConfig, } from './controller/EditLeaseController';
|
|
6
|
+
export { EditLeaseDiscardedNotice, EditLeaseModal, EditorWriteGate, EditorWriteSurface, } from './controller/EditorWriteGate';
|
|
7
|
+
export { planLeaseNotice, type LeaseNotice, type LeaseNoticeAction } from './controller/editLeaseNotice';
|
|
8
|
+
export { VIEWING_PARTICIPATION, type EditorLeaseParticipation, } from './controller/editorLeaseParticipation';
|
|
9
|
+
export { canEditorWrite, unmanagedSurfaceEditability } from './controller/editorEditability';
|
|
10
|
+
export { liveDraftRole, type LiveDraftsClient, type LiveDraftsConfig, type LiveDraftRole, } from './liveDrafts/useLiveDrafts';
|
|
11
|
+
export { remoteDraftValues, renderedFieldChanges, renderSourceFor, resolveRenderedValues, type RemoteDraftEntry, type RenderSource, type RemoteDraftOverlay, } from './liveDrafts/remoteDraftOverlay';
|
|
12
|
+
export { activeLinkedSaveHandover, planLinkedSaveHandoverRetention, type LinkedSaveHandover, type LinkedSaveHandovers, type RenderedLinkedRevisions, } from './liveDrafts/linkedSaveHandovers';
|
|
13
|
+
export { useRetentionTicks } from './liveDrafts/useRetentionTicks';
|
|
14
|
+
export type { EditorEditability } from './controller/editorEditability';
|
|
2
15
|
export * from './services';
|
|
3
16
|
export { useDebouncedLatestSave, type DebouncedLatestSaveConfig, type DebouncedLatestSaveHandle, } from './hooks/useDebouncedLatestSave';
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
17
|
+
export { useAutosaveStatus } from './hooks/useAutosaveStatus';
|
|
18
|
+
export { selectAutosaveStatus } from './sync/schedulerValues';
|
|
19
|
+
export { lifecycleOutcomeMessage, requireSavedDraft } from './sync/lifecycleFailure';
|
|
20
|
+
export type { LifecycleFailure, LifecycleOutcome } from './ui/stores/types';
|
|
21
|
+
export type { RouteWrites, RouteWriteOperation } from './controller/routeWrites';
|
|
22
|
+
export { documentSince, type DocumentSince } from './sync/runLifecycle';
|
|
23
|
+
export type { FlushPolicy, FlushResult } from './sync/sendPlanning';
|
|
24
|
+
export { baselineRevisionOf, displayedValues, hasOutstandingRequest, isEdited, syncStateOf, valueStatus, type ValueStatus, } from './sync/valueSync';
|
|
6
25
|
export { useBlockAutosave, type BlockAutosaveOptions, } from './hooks/useBlockAutosave';
|
|
7
|
-
export {
|
|
26
|
+
export { useLinkedEntryAutosave, type LinkedEntryAutosaveOptions, type LinkedEntrySaveResult, type PendingLinkedEntrySave, } from './hooks/useLinkedEntryAutosave';
|
|
8
27
|
export { unsafeAsLinkedContentEntryId, unsafeAsLinkedContentTypeKey, type LinkedContentEntryId, type LinkedContentTypeKey, } from './linkedEntries/domain';
|
|
9
28
|
export { useEntryActions, type EntryActionsOptions, } from './hooks/useEntryActions';
|
|
10
29
|
export { useReactiveToolbar } from './hooks/useReactiveToolbar';
|
|
30
|
+
export { canDiscardDraft } from './controller/deriveEditorUnpublishedState';
|
|
11
31
|
export { isInvalidSaveability, selectHasInvalidBlocks, } from './hooks/invalidBlockSelectors';
|
|
12
32
|
export { useHistoryShortcuts } from './hooks/useHistoryShortcuts';
|
|
13
33
|
export { validateAllBlocks, type BlockValidationError, type PublishEditorTarget, } from './hooks/validateBlocksForPublish';
|
|
14
34
|
export type { BlockedPublishPlan, PublishValidationDiagnostic, } from './hooks/blockedPublishPlan';
|
|
15
|
-
export { EntryControllerProvider, useEntryEditorController, useEntryController,
|
|
16
|
-
export type { EntryDraftBlockPatch, EntryDraftCompositePatch, EntryDraftsActions, EntryDraftsSlice, } from './controller/EntryControllerProvider';
|
|
17
|
-
export type { EntryEditorDriver } from './controller/driver';
|
|
35
|
+
export { EntryControllerProvider, useEntryEditorController, useEntryController, } from './controller/EntryControllerProvider';
|
|
36
|
+
export type { EntryDraftBlockPatch, EntryDraftCompositePatch, EntryDraftsActions, EntryDraftsSlice, EntryActions, } from './controller/EntryControllerProvider';
|
|
18
37
|
export { EditableBlockProvider, useBlockData, } from './components/EditableBlockProvider';
|
|
19
38
|
export { ContentFieldsForm, type ContentFieldsFormProps, } from './components/ContentFieldsForm';
|
|
20
39
|
export { useUISelector } from './ui/useUISelector';
|
|
@@ -39,4 +58,4 @@ export { buildFooterBlocksUpdatePayload, createInitialFooterBlocksEditorState, f
|
|
|
39
58
|
export { asContentEntrySnapshotSource, createContentEntriesDefinitionPlan, createPageSnapshot, createPagesDefinitionPlan, createSnapshotDefaults, getDefaultEntityLabel, mapPageRecordToSnapshot, type ContentEntriesDefinitionPlanOptions, type ContentEntryDefinitionPlan, type DefinitionServices, type PageEntrySnapshot, type PagesDefinitionPlanOptions, type SnapshotDefaults, } from './definitions/factory';
|
|
40
59
|
export { canRedoHistory, canUndoHistory, createHistoryState, unsafeAsEditorBlockId, pushHistoryEntry, redoHistory, replaceHistoryPresent, undoHistory, type HistoryState, type EditorBlockId, } from './ui/editorHistory';
|
|
41
60
|
export { classifyHistoryShortcut, isNativeHistoryTarget, type HistoryShortcutCommand, } from './historyShortcuts';
|
|
42
|
-
export type {
|
|
61
|
+
export type { EditLeaseChangeSubscription } from './hooks/useEditLease';
|
|
@@ -6,3 +6,15 @@ export type LinkedContentTypeKey = string & {
|
|
|
6
6
|
};
|
|
7
7
|
export declare function unsafeAsLinkedContentEntryId(value: string): LinkedContentEntryId;
|
|
8
8
|
export declare function unsafeAsLinkedContentTypeKey(value: string): LinkedContentTypeKey;
|
|
9
|
+
export type LinkedEntryOpenTarget = {
|
|
10
|
+
entryId: string;
|
|
11
|
+
contentTypeKey: string;
|
|
12
|
+
contentTypeLabel: string;
|
|
13
|
+
title: string;
|
|
14
|
+
optimisticHash?: string | null;
|
|
15
|
+
content: Record<string, unknown>;
|
|
16
|
+
contentType: {
|
|
17
|
+
titleField?: string | null;
|
|
18
|
+
fields: readonly Record<string, unknown>[];
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ValueRefresh } from '../ui/editorRefresh';
|
|
2
|
+
import { type EditorCommand, type EditorHistorySnapshot, type EditorLinkedEntrySnapshot, type EditorValueKey } from '../ui/editorHistory';
|
|
3
|
+
/** A reference to the document itself is another view of its existing content. */
|
|
4
|
+
export declare function linkedEntrySnapshot(snapshot: EditorHistorySnapshot, entryId: string, ownerEntryId?: string): EditorLinkedEntrySnapshot | null;
|
|
5
|
+
/** Sync events for the document's own entry apply to its content. */
|
|
6
|
+
export declare function routeValueKey(key: EditorValueKey, ownerEntryId?: string): EditorValueKey;
|
|
7
|
+
/** A server read of the document's own entry refreshes its content. */
|
|
8
|
+
export declare function routeRefresh(refresh: ValueRefresh, ownerEntryId?: string): ValueRefresh;
|
|
9
|
+
export declare function routeLinkedEntryCommand(command: EditorCommand, ownerEntryId?: string): EditorCommand;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { type DraftItem, type DraftTarget, type DroppedDraftItem } from '../../../realtime/src/index';
|
|
2
|
+
import type { EditorHistorySnapshot } from '../ui/editorHistory';
|
|
3
|
+
/** The inputs of one projection: the editor state, what was last sent, and who may write what. */
|
|
4
|
+
export type DraftProjectionInput = Readonly<{
|
|
5
|
+
snapshot: EditorHistorySnapshot;
|
|
6
|
+
previouslySent: readonly DraftItem[];
|
|
7
|
+
contentOwnerEntryId?: string;
|
|
8
|
+
/** Per-item write authority (`canWriteDraftTarget`): a tab only speaks for what it may write. */
|
|
9
|
+
canWrite: (target: DraftTarget) => boolean;
|
|
10
|
+
}>;
|
|
11
|
+
/**
|
|
12
|
+
* Pure projection of the editor state into the items to stream.
|
|
13
|
+
*
|
|
14
|
+
* - An item this tab may not write (a linked entry whose own lease moved elsewhere)
|
|
15
|
+
* is omitted before anything else, so it is never sent as unsaved or as saved. A
|
|
16
|
+
* viewer treats the omission as that item being gone and drops it.
|
|
17
|
+
* - Every value the person has edited is sent as `unsaved` with what it shows.
|
|
18
|
+
* - A value that was sent as `unsaved` last time and is now pristine (saved,
|
|
19
|
+
* discarded, or undone) is sent once as `saved` with the baseline and its server
|
|
20
|
+
* revision, so a viewer can hand over to its own refreshed baseline without
|
|
21
|
+
* flashing the old value. Without a known revision it is simply omitted.
|
|
22
|
+
*
|
|
23
|
+
* Diffing against what was last *sent* (not last observed) keeps saved markers
|
|
24
|
+
* correct when sends are throttled.
|
|
25
|
+
*/
|
|
26
|
+
export declare function projectDraftItems(input: DraftProjectionInput): DraftItem[];
|
|
27
|
+
/**
|
|
28
|
+
* Why the emitter is considering a send:
|
|
29
|
+
* - `change`: the store changed; send only when the items differ from the last send.
|
|
30
|
+
* - `heartbeat`: keep viewers' unsaved items alive while anything is unsaved.
|
|
31
|
+
* - `sync`: a viewer asked for the current state; always answer.
|
|
32
|
+
*/
|
|
33
|
+
export type DraftPublishReason = 'change' | 'heartbeat' | 'sync';
|
|
34
|
+
/** `dropped` is reported on both outcomes: an oversized item can be dropped on a skip too. */
|
|
35
|
+
export type DraftPublishPlan = Readonly<{
|
|
36
|
+
kind: 'skip';
|
|
37
|
+
dropped: readonly DroppedDraftItem[];
|
|
38
|
+
}> | Readonly<{
|
|
39
|
+
kind: 'send';
|
|
40
|
+
items: readonly DraftItem[];
|
|
41
|
+
dropped: readonly DroppedDraftItem[];
|
|
42
|
+
}>;
|
|
43
|
+
/**
|
|
44
|
+
* What the emitter sends, decided purely: project, keep what fits the message
|
|
45
|
+
* budget, then send or skip by reason. `items` is exactly what goes on the wire,
|
|
46
|
+
* so the emitter keeps it as the next `previouslySent`.
|
|
47
|
+
*/
|
|
48
|
+
export declare function planDraftPublish(input: DraftProjectionInput & Readonly<{
|
|
49
|
+
reason: DraftPublishReason;
|
|
50
|
+
}>): DraftPublishPlan;
|
|
51
|
+
/**
|
|
52
|
+
* The dropped items not already reported, so each oversized item warns once while it
|
|
53
|
+
* stays oversized, and again only if it fits and later outgrows the budget again.
|
|
54
|
+
*/
|
|
55
|
+
export declare function newlyDroppedDraftItems(previouslyDropped: ReadonlySet<string>, dropped: readonly DroppedDraftItem[]): readonly DroppedDraftItem[];
|
|
56
|
+
/**
|
|
57
|
+
* The next sequence number for an emitter. Viewers ignore a seq that isn't newer
|
|
58
|
+
* than the last one from the same origin, and the origin outlives an editor mount,
|
|
59
|
+
* so a new mount starts from the clock rather than from zero.
|
|
60
|
+
*/
|
|
61
|
+
export declare function nextDraftSeq(previous: number, now: number): number;
|
|
62
|
+
/**
|
|
63
|
+
* The server revision of the viewer's own baselines, keyed like the overlay. Built
|
|
64
|
+
* once per retention check rather than once per overlay entry.
|
|
65
|
+
*/
|
|
66
|
+
export declare function baselineRevisions(snapshot: EditorHistorySnapshot): ReadonlyMap<string, string | null>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { BaselineRevision, EditorValueRecord, ValueSync } from '../../../core/src/index';
|
|
2
|
+
import { type LinkedContentEntryId } from '../linkedEntries/domain';
|
|
3
|
+
import type { EditorValueKey } from '../ui/editorSnapshot';
|
|
4
|
+
import { type RetentionPlan, type SavedHandover } from './remoteDraftOverlay';
|
|
5
|
+
/**
|
|
6
|
+
* This tab's accepted linked-entry save, handing over to the rendered data (issue 1553, D).
|
|
7
|
+
* No content is copied: the render reads the record's own baseline while the handover applies.
|
|
8
|
+
*/
|
|
9
|
+
export type LinkedSaveHandover = Readonly<{
|
|
10
|
+
revision: string;
|
|
11
|
+
since: number;
|
|
12
|
+
phase: SavedHandover;
|
|
13
|
+
}>;
|
|
14
|
+
/** Outside history, beside `remoteDrafts`; only the renderer reads it. */
|
|
15
|
+
export type LinkedSaveHandovers = ReadonlyMap<LinkedContentEntryId, LinkedSaveHandover>;
|
|
16
|
+
export declare const EMPTY_LINKED_SAVE_HANDOVERS: LinkedSaveHandovers;
|
|
17
|
+
/** Every rendered occurrence's `optimisticHash` for each linked entry. */
|
|
18
|
+
export type RenderedLinkedRevisions = ReadonlyMap<LinkedContentEntryId, readonly (string | null)[]>;
|
|
19
|
+
/** A later accepted save replaces the entry's earlier handover (row H7). */
|
|
20
|
+
export declare function recordLinkedSaveHandover(handovers: LinkedSaveHandovers, entryId: LinkedContentEntryId, revision: string, since: number): LinkedSaveHandovers;
|
|
21
|
+
/**
|
|
22
|
+
* What an accepted save leaves behind: a linked entry's save, at a known revision, hands
|
|
23
|
+
* over to the rendered data, including a save that lands after a discard (rows H1, H5).
|
|
24
|
+
* Other values render from the store and need no handover.
|
|
25
|
+
*/
|
|
26
|
+
export declare function handoversAfterAcceptedSave(handovers: LinkedSaveHandovers, key: EditorValueKey, revision: BaselineRevision, at: string): LinkedSaveHandovers;
|
|
27
|
+
/**
|
|
28
|
+
* The handover that applies to a record, if any. It holds only while the record is
|
|
29
|
+
* pristine at the saved revision: an edit, a refresh to another baseline or a later
|
|
30
|
+
* save ends it by derivation (rows H3, H4).
|
|
31
|
+
*/
|
|
32
|
+
export declare function activeLinkedSaveHandover(handovers: LinkedSaveHandovers | undefined, entryId: LinkedContentEntryId, sync: ValueSync<EditorValueRecord | null>): LinkedSaveHandover | null;
|
|
33
|
+
/**
|
|
34
|
+
* Local retention (rows H1b, H2): a caught-up handover drops with no refresh; otherwise
|
|
35
|
+
* the shared `decideSavedHandover` timing applies.
|
|
36
|
+
*/
|
|
37
|
+
export declare function planLinkedSaveHandoverRetention(handovers: LinkedSaveHandovers, rendered: RenderedLinkedRevisions, now: number): RetentionPlan<LinkedContentEntryId, LinkedSaveHandover>;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { type DraftItem, type DraftStateMessage, type DraftTarget } from '../../../realtime/src/index';
|
|
2
|
+
import { type EditorValueRecord, type ValueSync } from '../../../core/src/index';
|
|
3
|
+
import type { EditorEditability } from '../controller/editorEditability';
|
|
4
|
+
/**
|
|
5
|
+
* A preview tab's read-only overlay of another tab's live drafts (issue 1545).
|
|
6
|
+
* It lives outside history, snapshots, autosave and the lease: nothing here is
|
|
7
|
+
* ever edited, saved or undone, it is only read by the renderer.
|
|
8
|
+
*/
|
|
9
|
+
/** No message from an unsaved item's origin for this long means its editor went away. */
|
|
10
|
+
export declare const UNSAVED_DRAFT_TTL_MS = 15000;
|
|
11
|
+
/** A saved item whose baseline has not caught up by then asks the host for one refresh. */
|
|
12
|
+
export declare const SAVED_DRAFT_REFRESH_AFTER_MS = 10000;
|
|
13
|
+
/** After the refresh, a saved item that still has not matched is dropped. */
|
|
14
|
+
export declare const SAVED_DRAFT_DROP_AFTER_REFRESH_MS = 10000;
|
|
15
|
+
/** Where a saved value's wait for fresh data stands: before or after its one refresh. */
|
|
16
|
+
export type SavedHandover = Readonly<{
|
|
17
|
+
kind: 'awaiting-baseline';
|
|
18
|
+
}> | Readonly<{
|
|
19
|
+
kind: 'refresh-requested';
|
|
20
|
+
at: number;
|
|
21
|
+
}>;
|
|
22
|
+
export type RemoteDraftEntry = Readonly<{
|
|
23
|
+
kind: 'unsaved';
|
|
24
|
+
item: DraftItem;
|
|
25
|
+
origin: string;
|
|
26
|
+
receivedAt: number;
|
|
27
|
+
}> | Readonly<{
|
|
28
|
+
kind: 'saved';
|
|
29
|
+
item: DraftItem;
|
|
30
|
+
origin: string;
|
|
31
|
+
revision: string;
|
|
32
|
+
receivedAt: number;
|
|
33
|
+
handover: SavedHandover;
|
|
34
|
+
}>;
|
|
35
|
+
/** Keyed by `draftItemKey`. */
|
|
36
|
+
export type RemoteDraftOverlay = ReadonlyMap<string, RemoteDraftEntry>;
|
|
37
|
+
export declare const EMPTY_REMOTE_DRAFTS: RemoteDraftOverlay;
|
|
38
|
+
/**
|
|
39
|
+
* Apply an accepted draft-state. It replaces everything unsaved from the same
|
|
40
|
+
* origin: an unsaved item it omits is gone (discarded or undone). Saved items
|
|
41
|
+
* stay until their own retention rule drops them, and other origins are untouched.
|
|
42
|
+
*/
|
|
43
|
+
export declare function applyRemoteDraftState(overlay: RemoteDraftOverlay, message: Pick<DraftStateMessage, 'origin' | 'items'>, now: number): RemoteDraftOverlay;
|
|
44
|
+
export type OverlayRetentionPlan = Readonly<{
|
|
45
|
+
overlay: RemoteDraftOverlay;
|
|
46
|
+
changed: boolean;
|
|
47
|
+
/** Ask the host to refresh its server baselines once. */
|
|
48
|
+
refresh: boolean;
|
|
49
|
+
}>;
|
|
50
|
+
export type SavedHandoverDecision = 'keep' | 'request-refresh' | 'drop';
|
|
51
|
+
/**
|
|
52
|
+
* How long a saved value keeps showing while the data it hands over to catches up
|
|
53
|
+
* (issue 1553, DP5). Shared by a viewer's saved remote drafts and this tab's own
|
|
54
|
+
* linked-entry saves; each caller decides what "caught up" means for its data.
|
|
55
|
+
* - Caught up: drop, so the fresh data shows in the same render.
|
|
56
|
+
* - Not caught up after `SAVED_DRAFT_REFRESH_AFTER_MS`: ask the host for one refresh.
|
|
57
|
+
* - Still not caught up `SAVED_DRAFT_DROP_AFTER_REFRESH_MS` after that: drop.
|
|
58
|
+
*/
|
|
59
|
+
export declare function decideSavedHandover(timing: Readonly<{
|
|
60
|
+
since: number;
|
|
61
|
+
phase: SavedHandover;
|
|
62
|
+
}>, caughtUp: boolean, now: number): SavedHandoverDecision;
|
|
63
|
+
export type RetentionDecision<E> = Readonly<{
|
|
64
|
+
kind: 'keep';
|
|
65
|
+
}> | Readonly<{
|
|
66
|
+
kind: 'drop';
|
|
67
|
+
}> | Readonly<{
|
|
68
|
+
kind: 'request-refresh';
|
|
69
|
+
entry: E;
|
|
70
|
+
}>;
|
|
71
|
+
export type RetentionPlan<K, E> = Readonly<{
|
|
72
|
+
entries: ReadonlyMap<K, E>;
|
|
73
|
+
changed: boolean;
|
|
74
|
+
/** Ask the host to refresh its server baselines once. */
|
|
75
|
+
refresh: boolean;
|
|
76
|
+
}>;
|
|
77
|
+
/** Applies one retention decision per entry; an unchanged map keeps its identity. */
|
|
78
|
+
export declare function planRetention<K, E>(entries: ReadonlyMap<K, E>, decide: (key: K, entry: E) => RetentionDecision<E>): RetentionPlan<K, E>;
|
|
79
|
+
/** A saved-handover decision as a retention decision, recording the refresh on the entry. */
|
|
80
|
+
export declare function savedRetentionDecision<E>(decision: SavedHandoverDecision, withRefreshRequested: () => E): RetentionDecision<E>;
|
|
81
|
+
/**
|
|
82
|
+
* Pure retention rule for the overlay.
|
|
83
|
+
* - Unsaved items expire after `UNSAVED_DRAFT_TTL_MS` without a message from their origin.
|
|
84
|
+
* - Saved items follow `decideSavedHandover`, caught up once the viewer's own baseline
|
|
85
|
+
* for the item has the saved revision. The overlay and that baseline are read in the
|
|
86
|
+
* same render, so the swap is atomic and nothing flashes.
|
|
87
|
+
*/
|
|
88
|
+
export declare function planOverlayRetention(overlay: RemoteDraftOverlay, baselineRevision: (key: string) => string | null, now: number): OverlayRetentionPlan;
|
|
89
|
+
/** The remote value for a target, if another tab is streaming one. */
|
|
90
|
+
export declare function remoteDraftValues(overlay: RemoteDraftOverlay | undefined, target: DraftTarget): EditorValueRecord | null;
|
|
91
|
+
/**
|
|
92
|
+
* Where a tab's rendered values come from. A tab that is only viewing renders
|
|
93
|
+
* what the editing tab streams; any other tab renders its own edits.
|
|
94
|
+
*/
|
|
95
|
+
export type RenderSource = 'own-edits' | 'live-drafts';
|
|
96
|
+
export declare function renderSourceFor(editability: EditorEditability): RenderSource;
|
|
97
|
+
type LocalValues = Readonly<{
|
|
98
|
+
sync: ValueSync<EditorValueRecord | null>;
|
|
99
|
+
}>;
|
|
100
|
+
/**
|
|
101
|
+
* Render precedence, in one place.
|
|
102
|
+
* - `own-edits`: the tab's current value (its dirty edit, or the baseline). It never
|
|
103
|
+
* holds a remote overlay, so none is read.
|
|
104
|
+
* - `live-drafts`: another tab's live draft, then the baseline. Local values are never
|
|
105
|
+
* used, so edits a viewer abandoned can't outrank what the editing tab streams.
|
|
106
|
+
*/
|
|
107
|
+
export declare function resolveRenderedValues(source: RenderSource, local: LocalValues | null, remote: EditorValueRecord | null): EditorValueRecord | null;
|
|
108
|
+
/**
|
|
109
|
+
* The top-level fields whose rendered value (after the precedence above) differs
|
|
110
|
+
* from the baseline, e.g. entry fields a template page must bind in again.
|
|
111
|
+
*/
|
|
112
|
+
export declare function renderedFieldChanges(source: RenderSource, local: LocalValues | null, remote: EditorValueRecord | null): Readonly<Record<string, unknown>>;
|
|
113
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type RealtimeEditScope } from '../../../realtime/src/index';
|
|
2
|
+
import { type DraftRealtimeClient, type UseDraftChannelAuth } from '../../../realtime/src/client';
|
|
3
|
+
import type { EditorEditability } from '../controller/editorEditability';
|
|
4
|
+
import type { EditorUiStoreInstance } from '../ui/editorUiStore';
|
|
5
|
+
/**
|
|
6
|
+
* What the host app supplies for live drafts: its own Supabase client (the
|
|
7
|
+
* preview uses a dedicated one, because token auth pins the token client-wide),
|
|
8
|
+
* how the channel authenticates, the document, and how a viewer refreshes its
|
|
9
|
+
* server baselines when a saved value has not arrived.
|
|
10
|
+
*/
|
|
11
|
+
export type LiveDraftsConfig = Readonly<{
|
|
12
|
+
client: DraftRealtimeClient;
|
|
13
|
+
auth: UseDraftChannelAuth;
|
|
14
|
+
siteId: string;
|
|
15
|
+
scope: RealtimeEditScope;
|
|
16
|
+
refreshBaselines?: () => void;
|
|
17
|
+
}>;
|
|
18
|
+
/** The structural slice of a Supabase client the drafts channel needs. */
|
|
19
|
+
export type LiveDraftsClient = DraftRealtimeClient;
|
|
20
|
+
export type LiveDraftRole = 'emit' | 'view' | 'off';
|
|
21
|
+
/**
|
|
22
|
+
* A tab that holds the lease streams its drafts; a preview tab that is only
|
|
23
|
+
* viewing shows other tabs' drafts; any other tab (acquiring, read-only,
|
|
24
|
+
* unleased surfaces) takes no part.
|
|
25
|
+
*/
|
|
26
|
+
export declare function liveDraftRole(editability: EditorEditability): LiveDraftRole;
|
|
27
|
+
/**
|
|
28
|
+
* Live drafts for one editor mount (issue 1545): joins the private drafts
|
|
29
|
+
* channel while the tab emits or views, streams this tab's dirty values while
|
|
30
|
+
* it holds the lease, and keeps the remote overlay while it only views.
|
|
31
|
+
*/
|
|
32
|
+
export declare function useLiveDrafts(uiStore: EditorUiStoreInstance, config: LiveDraftsConfig | null): void;
|