@riverbankcms/sdk 0.147.0 → 0.149.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.
Files changed (442) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +1 -1
  3. package/dist/{PreviewEditorSidebar-DtpB3_sS.mjs → PreviewEditorSidebar-DBKln68M.mjs} +301 -205
  4. package/dist/{PreviewEditorUI-DxTLgaHo.mjs → PreviewEditorUI-DpRX4Mum.mjs} +68 -63
  5. package/dist/{PreviewQueryProvider-Dd4dxOiU.mjs → PreviewQueryProvider-C0mndwHB.mjs} +3 -3
  6. package/dist/{SdkPreviewModeRuntime-DMMNCngt.mjs → SdkPreviewModeRuntime-DJPmPY-r.mjs} +1247 -541
  7. package/dist/{SiteChromeCustomizeContext-DQXZXiqS.mjs → SiteChromeCustomizeContext-JYA0cJ_Z.mjs} +209720 -204978
  8. package/dist/_dts/ai/src/contracts/proposals.d.ts +0 -33
  9. package/dist/_dts/ai/src/contracts/siteStyleProposalSchemas.d.ts +0 -3
  10. package/dist/_dts/api/src/accessAdmin.d.ts +0 -4
  11. package/dist/_dts/api/src/accountApi.d.ts +1 -1
  12. package/dist/_dts/api/src/admin.d.ts +22 -22
  13. package/dist/_dts/api/src/aiPatch.d.ts +2 -2
  14. package/dist/_dts/api/src/aiPlayground.d.ts +1 -0
  15. package/dist/_dts/api/src/analytics.d.ts +2 -2
  16. package/dist/_dts/api/src/apiEndpointTypes.d.ts +2 -0
  17. package/dist/_dts/api/src/appointmentSetup.d.ts +2 -2
  18. package/dist/_dts/api/src/auth.d.ts +10 -10
  19. package/dist/_dts/api/src/availability.d.ts +6 -6
  20. package/dist/_dts/api/src/billing.d.ts +42 -15
  21. package/dist/_dts/api/src/billingEndpointDefinitions.d.ts +8 -0
  22. package/dist/_dts/api/src/billingEndpointTypes.d.ts +15 -6
  23. package/dist/_dts/api/src/blocks.d.ts +15 -14
  24. package/dist/_dts/api/src/blocksKeys.d.ts +2 -0
  25. package/dist/_dts/api/src/bookingConfig.d.ts +33 -50
  26. package/dist/_dts/api/src/bookingManagementEndpoints.d.ts +2 -6
  27. package/dist/_dts/api/src/bookingOperations.d.ts +9 -11
  28. package/dist/_dts/api/src/bookingRecords.d.ts +16 -11
  29. package/dist/_dts/api/src/bookingRefundOutcomes.d.ts +5 -5
  30. package/dist/_dts/api/src/bookings.d.ts +7 -7
  31. package/dist/_dts/api/src/calendar.d.ts +9 -9
  32. package/dist/_dts/api/src/clientErrorReporting.d.ts +11 -0
  33. package/dist/_dts/api/src/commercePortalEndpoints.d.ts +7 -8
  34. package/dist/_dts/api/src/common/cancellation.d.ts +23 -0
  35. package/dist/_dts/api/src/common/envelope.d.ts +2 -2
  36. package/dist/_dts/api/src/content-editor.d.ts +2 -2
  37. package/dist/_dts/api/src/contentEntries.d.ts +17 -48
  38. package/dist/_dts/api/src/contentRuntime.d.ts +51 -37
  39. package/dist/_dts/api/src/contentTypes.d.ts +11 -11
  40. package/dist/_dts/api/src/contentVersionHistoryClient.d.ts +6 -6
  41. package/dist/_dts/api/src/customerMembershipOutcomes.d.ts +1 -1
  42. package/dist/_dts/api/src/documentLifecycle.d.ts +67 -0
  43. package/dist/_dts/api/src/domains.d.ts +16 -16
  44. package/dist/_dts/api/src/editLeaseEndpoints.d.ts +72 -0
  45. package/dist/_dts/api/src/emailSettings.d.ts +4 -4
  46. package/dist/_dts/api/src/endpoints.d.ts +135 -51
  47. package/dist/_dts/api/src/eventEmailTemplates.d.ts +2 -2
  48. package/dist/_dts/api/src/eventManagementContracts.d.ts +29 -7
  49. package/dist/_dts/api/src/eventManagementEndpointDefinitions.d.ts +0 -8
  50. package/dist/_dts/api/src/eventPageWords.d.ts +7 -12
  51. package/dist/_dts/api/src/footerSettings.d.ts +6 -6
  52. package/dist/_dts/api/src/index.d.ts +8 -7
  53. package/dist/_dts/api/src/indexCoreTypes.d.ts +1 -0
  54. package/dist/_dts/api/src/indexExtendedTypes.d.ts +1 -1
  55. package/dist/_dts/api/src/navigation.d.ts +5 -5
  56. package/dist/_dts/api/src/pageSurfaceEditorEndpoints.d.ts +55 -0
  57. package/dist/_dts/api/src/pageSurfaceEndpoints.d.ts +28 -7
  58. package/dist/_dts/api/src/pages.d.ts +7 -7
  59. package/dist/_dts/api/src/performance.d.ts +1 -1
  60. package/dist/_dts/api/src/public/index.d.ts +1 -1
  61. package/dist/_dts/api/src/publicAppointmentBookingContracts.d.ts +4 -2
  62. package/dist/_dts/api/src/publicExperience/commerceEndpoints.d.ts +6 -29
  63. package/dist/_dts/api/src/redirects.d.ts +3 -3
  64. package/dist/_dts/api/src/request.d.ts +11 -2
  65. package/dist/_dts/api/src/resources.d.ts +4 -4
  66. package/dist/_dts/api/src/routes.d.ts +8 -3
  67. package/dist/_dts/api/src/sdk-event-upsert.d.ts +1 -2
  68. package/dist/_dts/api/src/sdkBlockUpsertContracts.d.ts +21 -0
  69. package/dist/_dts/api/src/sdkContracts.d.ts +5 -28
  70. package/dist/_dts/api/src/sdkEventEndpointDefinitions.d.ts +1 -1
  71. package/dist/_dts/api/src/sdkEventOccurrenceRequestContracts.d.ts +43 -0
  72. package/dist/_dts/api/src/sdkManagedEventContracts.d.ts +4 -2
  73. package/dist/_dts/api/src/sdkPullEventContracts.d.ts +9 -2
  74. package/dist/_dts/api/src/seo.d.ts +4 -4
  75. package/dist/_dts/api/src/services.d.ts +4 -4
  76. package/dist/_dts/api/src/siteManagementEndpoints.d.ts +15 -8
  77. package/dist/_dts/api/src/siteMembers.d.ts +10 -10
  78. package/dist/_dts/api/src/siteOnboarding.d.ts +14 -0
  79. package/dist/_dts/api/src/siteOperations.d.ts +6 -2
  80. package/dist/_dts/api/src/sitePlatformEndpoints.d.ts +7 -3
  81. package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +5 -12
  82. package/dist/_dts/api/src/siteRuntimeEntry.d.ts +31 -0
  83. package/dist/_dts/billing/src/checkout/platform.d.ts +77 -0
  84. package/dist/_dts/billing/src/components/index.d.ts +25 -40
  85. package/dist/_dts/billing/src/membership/index.d.ts +1 -3
  86. package/dist/_dts/billing/src/plans/entitlements.d.ts +80 -0
  87. package/dist/_dts/billing/src/plans/registry.d.ts +16 -16
  88. package/dist/_dts/billing/src/plans/standing.d.ts +9 -2
  89. package/dist/_dts/billing/src/plans/types.d.ts +5 -15
  90. package/dist/_dts/billing/src/site-arrangements.d.ts +2 -2
  91. package/dist/_dts/billing/src/subscriptions/standingEvidence.d.ts +2 -4
  92. package/dist/_dts/billing/src/subscriptions/store.d.ts +17 -11
  93. package/dist/_dts/block-form/src/backend/store-backend.d.ts +6 -7
  94. package/dist/_dts/block-form/src/backend/types.d.ts +7 -0
  95. package/dist/_dts/block-form/src/widgets/FieldFrame.d.ts +3 -1
  96. package/dist/_dts/blocks/src/client/events.d.ts +3 -0
  97. package/dist/_dts/blocks/src/contracts/index.d.ts +1 -1
  98. package/dist/_dts/blocks/src/contracts/non-block-islands.d.ts +2 -2
  99. package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +54 -14
  100. package/dist/_dts/blocks/src/pageRenderAdmission.d.ts +4 -13
  101. package/dist/_dts/blocks/src/pageRendererContracts.d.ts +2 -0
  102. package/dist/_dts/blocks/src/portal/types.d.ts +9 -8
  103. package/dist/_dts/blocks/src/system/blocks/contact-newsletter.d.ts +2 -1
  104. package/dist/_dts/blocks/src/system/blocks/event-registration.d.ts +3 -1
  105. package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +28 -28
  106. package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +7 -2
  107. package/dist/_dts/blocks/src/system/blocks/shared/bookingPaymentTerms.d.ts +84 -160
  108. package/dist/_dts/blocks/src/system/blocks/shop.d.ts +2 -2
  109. package/dist/_dts/blocks/src/system/blocks/shop.shared.d.ts +31 -4
  110. package/dist/_dts/blocks/src/system/runtime/api/client.d.ts +2 -2
  111. package/dist/_dts/blocks/src/system/runtime/api/index.d.ts +1 -1
  112. package/dist/_dts/blocks/src/system/runtime/api/types/appointments.d.ts +4 -2
  113. package/dist/_dts/blocks/src/system/runtime/api/types/core.d.ts +3 -1
  114. package/dist/_dts/blocks/src/system/runtime/api/types/events.d.ts +6 -0
  115. package/dist/_dts/blocks/src/system/runtime/api/types/portal.d.ts +6 -0
  116. package/dist/_dts/blocks/src/system/runtime/api/types/shop.d.ts +4 -0
  117. package/dist/_dts/blocks/src/system/runtime/components/booking/SuccessMessage.d.ts +4 -1
  118. package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +72 -12
  119. package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +36 -6
  120. package/dist/_dts/blocks/src/system/runtime/hooks/useBookingNowIso.d.ts +8 -0
  121. package/dist/_dts/blocks/src/system/runtime/hooks/useHeadlessBookingFlow.d.ts +3 -0
  122. package/dist/_dts/blocks/src/system/runtime/hooks/usePaymentVerification.d.ts +2 -1
  123. package/dist/_dts/blocks/src/system/runtime/hooks/usePolling.d.ts +7 -48
  124. package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.checkout-return-context.d.ts +7 -0
  125. package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.completion.d.ts +3 -1
  126. package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.headless.state.d.ts +4 -0
  127. package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.interactive.d.ts +9 -0
  128. package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.payment-confirmation.d.ts +13 -0
  129. package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.state.d.ts +17 -2
  130. package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.submit-actions.d.ts +8 -0
  131. package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.submit-handler.d.ts +1 -0
  132. package/dist/_dts/blocks/src/system/runtime/nodes/booking-runtime-sources.d.ts +1 -0
  133. package/dist/_dts/blocks/src/system/runtime/nodes/checkout.server.d.ts +2 -1
  134. package/dist/_dts/blocks/src/system/runtime/nodes/commerce/shared/display.d.ts +9 -2
  135. package/dist/_dts/blocks/src/system/runtime/nodes/event-details/presentation.d.ts +14 -2
  136. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventRegistrationSurface.d.ts +2 -1
  137. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventRegistrationWizard.d.ts +5 -0
  138. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/PaymentSelectionStep.d.ts +2 -0
  139. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/SuccessStep.d.ts +4 -1
  140. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/eventPaymentOptions.d.ts +3 -3
  141. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/types.d.ts +2 -0
  142. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationSubmit.d.ts +2 -5
  143. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationWizard.d.ts +4 -0
  144. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration.interactive.d.ts +9 -5
  145. package/dist/_dts/blocks/src/system/runtime/nodes/events/EventListing.interactive.d.ts +6 -0
  146. package/dist/_dts/blocks/src/system/runtime/nodes/events/domain/dates.d.ts +37 -3
  147. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/EventCard.client.d.ts +1 -1
  148. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/EventCard.d.ts +16 -1
  149. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/eventCardPresentations.d.ts +13 -0
  150. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/eventCollectionContract.d.ts +29 -29
  151. package/dist/_dts/blocks/src/system/runtime/nodes/shared/MagicLinkForm.d.ts +1 -14
  152. package/dist/_dts/blocks/src/system/runtime/nodes/shared/MagicLinkForm.state.d.ts +12 -0
  153. package/dist/_dts/blocks/src/system/runtime/nodes/shop.interactive.d.ts +54 -6
  154. package/dist/_dts/blocks/src/system/runtime/shared/bookingPaymentOptions.d.ts +7 -2
  155. package/dist/_dts/blocks/src/system/runtime/shared/components/DemoBookingPortalAccess.d.ts +22 -0
  156. package/dist/_dts/blocks/src/system/runtime/shared/components/DemoPortalSignInLink.d.ts +4 -0
  157. package/dist/_dts/blocks/src/system/runtime/shared/components/index.d.ts +1 -0
  158. package/dist/_dts/blocks/src/system/runtime/shared/utils/demoBookingPassStorage.d.ts +10 -0
  159. package/dist/_dts/blocks/src/system/runtime/shared/utils/demoPortalMagicLink.d.ts +29 -0
  160. package/dist/_dts/commerce/src/purchase/bookingPaymentSelection.d.ts +54 -0
  161. package/dist/_dts/commerce/src/purchase/checkoutCommitPlan.d.ts +58 -13
  162. package/dist/_dts/commerce/src/purchase/checkoutErrorCodes.d.ts +1 -1
  163. package/dist/_dts/commerce/src/purchase/checkoutPaymentPlanPlanning.d.ts +16 -21
  164. package/dist/_dts/commerce/src/purchase/checkoutPaymentTerms.d.ts +23 -40
  165. package/dist/_dts/commerce/src/purchase/checkoutSessionMetadata.d.ts +2 -2
  166. package/dist/_dts/commerce/src/purchase/checkoutStripeSessionPlanning.d.ts +5 -4
  167. package/dist/_dts/commerce/src/purchase/event-registration-errors.d.ts +4 -0
  168. package/dist/_dts/commerce/src/purchase/index.d.ts +1 -3
  169. package/dist/_dts/commerce/src/purchase/membershipOrderItemMetadata.d.ts +4 -0
  170. package/dist/_dts/commerce/src/purchase/oneTimeCheckoutPlanning.d.ts +9 -4
  171. package/dist/_dts/commerce/src/purchase/orderInstalmentClosure.d.ts +13 -1
  172. package/dist/_dts/commerce/src/purchase/orderInstalmentLifecycle.d.ts +5 -0
  173. package/dist/_dts/commerce/src/purchase/orderItemMetadata.d.ts +3 -1
  174. package/dist/_dts/commerce/src/purchase/orderTypes.d.ts +7 -1
  175. package/dist/_dts/commerce/src/purchase/refundRailSplit.d.ts +1 -1
  176. package/dist/_dts/commerce/src/purchase/stateTransitions.d.ts +2 -2
  177. package/dist/_dts/commerce/src/purchase/stripeMinimumCharge.d.ts +6 -0
  178. package/dist/_dts/commerce/src/purchase/types.d.ts +2 -1
  179. package/dist/_dts/content-editor/src/components/ContentFieldsForm.d.ts +2 -7
  180. package/dist/_dts/content-editor/src/controller/EditLeaseController.d.ts +39 -0
  181. package/dist/_dts/content-editor/src/controller/EditorWriteGate.d.ts +38 -0
  182. package/dist/_dts/content-editor/src/controller/EntryControllerProvider.d.ts +25 -61
  183. package/dist/_dts/content-editor/src/controller/LinkedEntryLeaseBanner.d.ts +7 -0
  184. package/dist/_dts/content-editor/src/controller/LinkedEntryLeaseControllers.d.ts +14 -0
  185. package/dist/_dts/content-editor/src/controller/deriveEditorUnpublishedState.d.ts +6 -0
  186. package/dist/_dts/content-editor/src/controller/documentValueBaseline.d.ts +25 -0
  187. package/dist/_dts/content-editor/src/controller/editLeaseHandover.d.ts +30 -0
  188. package/dist/_dts/content-editor/src/controller/editLeaseLossSignal.d.ts +6 -0
  189. package/dist/_dts/content-editor/src/controller/editLeaseNotice.d.ts +28 -0
  190. package/dist/_dts/content-editor/src/controller/editorClientId.d.ts +2 -0
  191. package/dist/_dts/content-editor/src/controller/editorEditability.d.ts +38 -0
  192. package/dist/_dts/content-editor/src/controller/editorLeaseParticipation.d.ts +34 -0
  193. package/dist/_dts/content-editor/src/controller/normalizedMetadataBaseline.d.ts +29 -0
  194. package/dist/_dts/content-editor/src/controller/pageSurfaceDocumentBaselines.d.ts +14 -0
  195. package/dist/_dts/content-editor/src/controller/pageSurfaceLifecycle.d.ts +11 -0
  196. package/dist/_dts/content-editor/src/controller/planDocumentBaselineRefresh.d.ts +19 -0
  197. package/dist/_dts/content-editor/src/controller/readDocumentLeaseBaselines.d.ts +19 -0
  198. package/dist/_dts/content-editor/src/controller/refreshDocumentLeaseBaseline.d.ts +12 -0
  199. package/dist/_dts/content-editor/src/controller/refreshLinkedEntry.d.ts +17 -0
  200. package/dist/_dts/content-editor/src/controller/replayRestoredEditorEffects.d.ts +2 -3
  201. package/dist/_dts/content-editor/src/controller/routeWrites.d.ts +26 -0
  202. package/dist/_dts/content-editor/src/controller/useAutosaveTriggers.d.ts +16 -17
  203. package/dist/_dts/content-editor/src/controller/useBlockedPublishPlan.d.ts +6 -2
  204. package/dist/_dts/content-editor/src/controller/useBlocksList.d.ts +3 -3
  205. package/dist/_dts/content-editor/src/controller/useEntryValueAutosaves.d.ts +21 -0
  206. package/dist/_dts/content-editor/src/controller/useInitialEditorUiStore.d.ts +24 -0
  207. package/dist/_dts/content-editor/src/controller/useServerBaselineReconciliation.d.ts +17 -0
  208. package/dist/_dts/content-editor/src/footerComposerPanelTypes.d.ts +1 -1
  209. package/dist/_dts/content-editor/src/hooks/applyBlockedPublishPlan.d.ts +5 -1
  210. package/dist/_dts/content-editor/src/hooks/blockDraftLifecycle.d.ts +8 -47
  211. package/dist/_dts/content-editor/src/hooks/editLeaseMachine.d.ts +120 -0
  212. package/dist/_dts/content-editor/src/hooks/publishability.d.ts +6 -10
  213. package/dist/_dts/content-editor/src/hooks/useAutosaveStatus.d.ts +3 -0
  214. package/dist/_dts/content-editor/src/hooks/useBlockAutosave.d.ts +5 -15
  215. package/dist/_dts/content-editor/src/hooks/useDebouncedLatestSave.d.ts +7 -5
  216. package/dist/_dts/content-editor/src/hooks/useEditLease.d.ts +28 -0
  217. package/dist/_dts/content-editor/src/hooks/useEntryActions.d.ts +25 -39
  218. package/dist/_dts/content-editor/src/hooks/useEntryMutations.d.ts +17 -19
  219. package/dist/_dts/content-editor/src/hooks/useLinkedEntryAutosave.d.ts +5 -8
  220. package/dist/_dts/content-editor/src/hooks/useValueAutosave.d.ts +64 -0
  221. package/dist/_dts/content-editor/src/hooks/validateBlocksForPublish.d.ts +0 -7
  222. package/dist/_dts/content-editor/src/index.d.ts +26 -7
  223. package/dist/_dts/content-editor/src/lib/browserStorage.d.ts +5 -0
  224. package/dist/_dts/content-editor/src/linkedEntries/domain.d.ts +12 -0
  225. package/dist/_dts/content-editor/src/linkedEntries/owner.d.ts +9 -0
  226. package/dist/_dts/content-editor/src/liveDrafts/draftProjection.d.ts +66 -0
  227. package/dist/_dts/content-editor/src/liveDrafts/linkedSaveHandovers.d.ts +37 -0
  228. package/dist/_dts/content-editor/src/liveDrafts/remoteDraftOverlay.d.ts +113 -0
  229. package/dist/_dts/content-editor/src/liveDrafts/useLiveDrafts.d.ts +32 -0
  230. package/dist/_dts/content-editor/src/liveDrafts/useRetentionTicks.d.ts +7 -0
  231. package/dist/_dts/content-editor/src/primitives/shared/activePreviewField.d.ts +6 -0
  232. package/dist/_dts/content-editor/src/primitives/shared/storeBinding.d.ts +1 -0
  233. package/dist/_dts/content-editor/src/services/contentEntryServices.d.ts +96 -19
  234. package/dist/_dts/content-editor/src/services/editorApiClient.d.ts +13 -0
  235. package/dist/_dts/content-editor/src/services/index.d.ts +2 -0
  236. package/dist/_dts/content-editor/src/services/pageSurfaceEditorServices.d.ts +23 -0
  237. package/dist/_dts/content-editor/src/sync/flushValues.d.ts +13 -0
  238. package/dist/_dts/content-editor/src/sync/lifecycleFailure.d.ts +51 -0
  239. package/dist/_dts/content-editor/src/sync/runLifecycle.d.ts +64 -0
  240. package/dist/_dts/content-editor/src/sync/schedulerValues.d.ts +27 -0
  241. package/dist/_dts/content-editor/src/sync/sendPlanning.d.ts +104 -0
  242. package/dist/_dts/content-editor/src/sync/valueSync.d.ts +114 -0
  243. package/dist/_dts/content-editor/src/ui/blockCollection.d.ts +8 -0
  244. package/dist/_dts/content-editor/src/ui/documentLifecycle.d.ts +18 -0
  245. package/dist/_dts/content-editor/src/ui/editorLeaseUiState.d.ts +7 -0
  246. package/dist/_dts/content-editor/src/ui/editorRefresh.d.ts +82 -0
  247. package/dist/_dts/content-editor/src/ui/editorSnapshot.d.ts +102 -127
  248. package/dist/_dts/content-editor/src/ui/editorTransactionState.d.ts +1 -1
  249. package/dist/_dts/content-editor/src/ui/editorUiStore.d.ts +126 -72
  250. package/dist/_dts/content-editor/src/ui/editorValueSnapshot.d.ts +18 -0
  251. package/dist/_dts/content-editor/src/ui/serverBlockAdmission.d.ts +26 -0
  252. package/dist/_dts/content-editor/src/ui/stores/autosaveStore.d.ts +16 -27
  253. package/dist/_dts/content-editor/src/ui/stores/blockVersionsStore.d.ts +24 -0
  254. package/dist/_dts/content-editor/src/ui/stores/linkedEntryLeaseStore.d.ts +54 -0
  255. package/dist/_dts/content-editor/src/ui/stores/linkedSaveHandoversStore.d.ts +11 -0
  256. package/dist/_dts/content-editor/src/ui/stores/remoteDraftsStore.d.ts +10 -0
  257. package/dist/_dts/content-editor/src/ui/stores/types.d.ts +63 -3
  258. package/dist/_dts/content-editor/src/useFooterComposerState.d.ts +2 -2
  259. package/dist/_dts/content-editor/src/useFooterNavigationLayout.d.ts +1 -1
  260. package/dist/_dts/content-model/src/content-types/builtin-schemas.d.ts +4 -4
  261. package/dist/_dts/content-model/src/content-types/builtins.d.ts +4 -4
  262. package/dist/_dts/content-model/src/definitions/shared.d.ts +11 -2
  263. package/dist/_dts/content-model/src/entry-slots/index.d.ts +1 -0
  264. package/dist/_dts/content-model/src/entry-slots/serializeAllowedBlocks.d.ts +2 -0
  265. package/dist/_dts/content-model/src/metadataConfig.d.ts +10 -38
  266. package/dist/_dts/content-model/src/templates/defaults.d.ts +0 -1
  267. package/dist/_dts/content-model/src/types.d.ts +0 -1
  268. package/dist/_dts/core/src/block-content-identity.d.ts +49 -1
  269. package/dist/_dts/core/src/booking-flexible-balance.d.ts +2 -2
  270. package/dist/_dts/core/src/booking-instalment-deposit.d.ts +20 -0
  271. package/dist/_dts/core/src/booking-live-payment-terms.d.ts +72 -0
  272. package/dist/_dts/core/src/booking-payment-options.d.ts +24 -0
  273. package/dist/_dts/core/src/booking-payment-schemas.d.ts +522 -0
  274. package/dist/_dts/core/src/branded.d.ts +15 -0
  275. package/dist/_dts/core/src/currency-format.d.ts +8 -2
  276. package/dist/_dts/core/src/demo-lifecycle-status.d.ts +2 -2
  277. package/dist/_dts/core/src/demo-warm-pool-target.d.ts +8 -0
  278. package/dist/_dts/core/src/edit-lease.d.ts +60 -0
  279. package/dist/_dts/core/src/editor-state.d.ts +38 -13
  280. package/dist/_dts/core/src/editor-value-sync.d.ts +79 -0
  281. package/dist/_dts/core/src/html-entities.d.ts +6 -0
  282. package/dist/_dts/core/src/index.d.ts +7 -0
  283. package/dist/_dts/core/src/uuid.d.ts +7 -5
  284. package/dist/_dts/db/src/generated/supabase/database.types.d.ts +456 -189
  285. package/dist/_dts/editor/src/EditorProvider.d.ts +5 -0
  286. package/dist/_dts/editor/src/chrome/EditorChrome.d.ts +14 -0
  287. package/dist/_dts/editor/src/chrome/EditorStatusBar.d.ts +1 -0
  288. package/dist/_dts/editor/src/chrome/statusBarPresentation.d.ts +0 -1
  289. package/dist/_dts/editor/src/index.d.ts +1 -1
  290. package/dist/_dts/editor-blocks/src/BlockEditor.d.ts +10 -9
  291. package/dist/_dts/editor-blocks/src/BlockForm.d.ts +1 -1
  292. package/dist/_dts/editor-blocks/src/block-editor/BlockCard.d.ts +1 -1
  293. package/dist/_dts/editor-blocks/src/block-editor/BlockCardFrame.d.ts +1 -1
  294. package/dist/_dts/editor-blocks/src/block-editor/BlockSettingsModal.d.ts +1 -1
  295. package/dist/_dts/editor-blocks/src/block-editor/applyExtendedFieldDefaults.d.ts +3 -4
  296. package/dist/_dts/editor-blocks/src/block-editor/blockDraftBaselineSeed.d.ts +4 -8
  297. package/dist/_dts/editor-blocks/src/block-editor/editorBlockItem.d.ts +23 -0
  298. package/dist/_dts/editor-blocks/src/block-editor/generatedIconApplyCoordination.d.ts +2 -7
  299. package/dist/_dts/editor-blocks/src/block-editor/hooks/applyBlockStructureChange.d.ts +4 -0
  300. package/dist/_dts/editor-blocks/src/block-editor/hooks/buildInsertBlockHistoryCommand.d.ts +14 -5
  301. package/dist/_dts/editor-blocks/src/block-editor/hooks/useBlockBaselineSync.d.ts +21 -19
  302. package/dist/_dts/editor-blocks/src/block-editor/hooks/useBlockCreation.d.ts +2 -10
  303. package/dist/_dts/editor-blocks/src/block-editor/hooks/useBlockDuplication.d.ts +8 -16
  304. package/dist/_dts/editor-blocks/src/block-editor/owner.d.ts +6 -16
  305. package/dist/_dts/editor-blocks/src/block-editor/types.d.ts +37 -9
  306. package/dist/_dts/editor-blocks/src/index.d.ts +2 -1
  307. package/dist/_dts/editor-blocks/src/widgets/entry-picker/loaders.d.ts +1 -1
  308. package/dist/_dts/editor-blocks/src/widgets/link/loaders.d.ts +1 -1
  309. package/dist/_dts/editor-blocks/src/widgets/mailing-list-targeting/loaders.d.ts +1 -1
  310. package/dist/_dts/editor-blocks/src/widgets/reference/loaders.d.ts +1 -1
  311. package/dist/_dts/editor-blocks/src/widgets/site-option-picker/loaders.d.ts +3 -2
  312. package/dist/_dts/media-core/src/fileStorage.d.ts +4 -0
  313. package/dist/_dts/media-editor/src/MediaPickerDialog.d.ts +3 -1
  314. package/dist/_dts/media-editor/src/MediaPickerMiniDialog.d.ts +10 -0
  315. package/dist/_dts/media-editor/src/context.d.ts +1 -1
  316. package/dist/_dts/media-editor/src/createMediaEditorProvider.d.ts +1 -2
  317. package/dist/_dts/media-editor/src/index.d.ts +2 -0
  318. package/dist/_dts/media-editor/src/provider.d.ts +3 -2
  319. package/dist/_dts/media-react/src/hooks/internal/classification.d.ts +1 -1
  320. package/dist/_dts/media-react/src/hooks/useApiMediaUploader.d.ts +3 -1
  321. package/dist/_dts/preview-next/src/client/blocks/composer/mergeDrafts.d.ts +8 -3
  322. package/dist/_dts/preview-next/src/client/blocks/composer/types.d.ts +6 -3
  323. package/dist/_dts/preview-next/src/client/blocks/linkedEntryRenderOverlay.d.ts +22 -2
  324. package/dist/_dts/preview-next/src/client/blocks/previewProjection/entryFieldRebinding.d.ts +13 -0
  325. package/dist/_dts/preview-next/src/client/blocks/previewProjection/index.d.ts +2 -1
  326. package/dist/_dts/preview-next/src/client/blocks/previewProjection/types.d.ts +11 -1
  327. package/dist/_dts/preview-next/src/client/blocks/renderPrecedence.d.ts +17 -0
  328. package/dist/_dts/preview-next/src/client/blocks/useLinkedSaveHandoverRetention.d.ts +20 -0
  329. package/dist/_dts/preview-next/src/client/index.d.ts +1 -1
  330. package/dist/_dts/preview-next/src/client/preview/EntryEditorPanel.d.ts +2 -1
  331. package/dist/_dts/preview-next/src/client/preview/EntrySlotBlockEditorPanel.d.ts +2 -1
  332. package/dist/_dts/preview-next/src/client/preview/PreviewAccessBanners.d.ts +7 -0
  333. package/dist/_dts/preview-next/src/client/preview/PreviewEditorSidebar.d.ts +2 -1
  334. package/dist/_dts/preview-next/src/client/preview/PreviewEntryControllerProvider.d.ts +23 -14
  335. package/dist/_dts/preview-next/src/client/preview/PreviewLeaseEditingMode.d.ts +2 -0
  336. package/dist/_dts/preview-next/src/client/preview/PreviewShell.d.ts +9 -2
  337. package/dist/_dts/preview-next/src/client/preview/PreviewShellLayout.d.ts +1 -0
  338. package/dist/_dts/preview-next/src/client/preview/previewCustomizeAutosave.d.ts +5 -0
  339. package/dist/_dts/preview-next/src/client/preview/previewCustomizeWorkflowState.d.ts +3 -4
  340. package/dist/_dts/preview-next/src/client/preview/sdkConfig.d.ts +1 -0
  341. package/dist/_dts/preview-next/src/client/preview/usePreviewCustomizeWorkflowState.d.ts +4 -0
  342. package/dist/_dts/preview-next/src/client/previewAuthStore.d.ts +7 -0
  343. package/dist/_dts/preview-next/src/constants.d.ts +4 -0
  344. package/dist/_dts/preview-next/src/keepAlive.d.ts +1 -0
  345. package/dist/_dts/realtime/src/client.d.ts +3 -0
  346. package/dist/_dts/realtime/src/draftChannel.d.ts +91 -0
  347. package/dist/_dts/realtime/src/drafts.d.ts +210 -0
  348. package/dist/_dts/realtime/src/index.d.ts +3 -0
  349. package/dist/_dts/realtime/src/leaseChangeSubscriptions.d.ts +8 -0
  350. package/dist/_dts/realtime/src/types.d.ts +113 -0
  351. package/dist/_dts/realtime/src/useDraftChannel.d.ts +34 -0
  352. package/dist/_dts/realtime/src/useSiteRealtimeReload.d.ts +27 -0
  353. package/dist/_dts/sdk/src/public-api/contracts.d.ts +6 -55
  354. package/dist/_dts/sdk/src/rendering/blocks-page-renderer.d.ts +1 -0
  355. package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +1 -0
  356. package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +2 -0
  357. package/dist/_dts/sdk/src/rendering/islands/types.d.ts +2 -12
  358. package/dist/_dts/sdk/src/version.d.ts +1 -1
  359. package/dist/_dts/surfaces/src/index.d.ts +1 -0
  360. package/dist/_dts/theme-core/src/site-styles/designState.d.ts +2 -2
  361. package/dist/_dts/theme-core/src/site-styles/pageDesignIntent.d.ts +0 -5
  362. package/dist/_dts/ui/src/color-picker.d.ts +1 -1
  363. package/dist/_dts/ui/src/palette/useHexDraft.d.ts +7 -0
  364. package/dist/client/{BookingMailingListNote-1n4Ch_u_.mjs → BookingMailingListNote-Cr3EeTP5.mjs} +504 -163
  365. package/dist/client/DemoBookingPortalAccess-BFGB1Fay.mjs +344 -0
  366. package/dist/client/{EventCombined.client-C0pgma9y.mjs → EventCombined.client-DKYV0_ft.mjs} +6 -6
  367. package/dist/client/{EventListing.client-4fhLOvHP.mjs → EventListing.client-B9UIcEYc.mjs} +2 -2
  368. package/dist/client/{LeafletStaticMap-DScC4F3w.mjs → LeafletStaticMap-CFLPkP0K.mjs} +1 -1
  369. package/dist/client/{TerminalPanel-B5ZUsYhe.mjs → TerminalPanel-JjmgxEsR.mjs} +1 -1
  370. package/dist/client/{ThemedButton-DoVIV1Ao.mjs → ThemedButton-CKV1Jh2m.mjs} +1 -1
  371. package/dist/client/{accordion-CoT5g7zo.mjs → accordion-DXWIfT3T.mjs} +1 -1
  372. package/dist/client/{bookingForm-BWxB46xD.mjs → bookingForm-CjZgHNvv.mjs} +216 -63
  373. package/dist/client/bookings.mjs +1187 -692
  374. package/dist/client/{carousel-DtNYWFd3.mjs → carousel-DSLikmvZ.mjs} +1 -1
  375. package/dist/client/{cart-z4qZih1Y.mjs → cart-HDjWReFt.mjs} +3 -3
  376. package/dist/client/{checkout-DpL7euFH.mjs → checkout-CUvRZA3W.mjs} +3 -3
  377. package/dist/client/{checkoutUrls-BEfR7kVu.mjs → checkoutUrls-CXhko2Rv.mjs} +1 -1
  378. package/dist/client/client.mjs +2711 -1684
  379. package/dist/client/{context-C8TinPJc.mjs → context-DFmaZa-Q.mjs} +4 -3
  380. package/dist/client/{dates-vwwxTeB0.mjs → dates-BBep1JnF.mjs} +56 -11
  381. package/dist/client/{eventCalendar-DIbHfJXO.mjs → eventCalendar-zEobhxo4.mjs} +9 -9
  382. package/dist/client/{eventCombined-DoGMJ6cg.mjs → eventCombined-Dp7bz5k-.mjs} +4 -4
  383. package/dist/client/{eventDetails-BjN9v6a1.mjs → eventDetails-FE-zqTt7.mjs} +4 -4
  384. package/dist/client/{eventListing-DajjWgOv.mjs → eventListing-BMt5snal.mjs} +4 -4
  385. package/dist/client/{eventRegistration-DMq9gMA-.mjs → eventRegistration-O6ZxHfOb.mjs} +422 -570
  386. package/dist/client/{form-Qf6qTbos.mjs → form-DFa1D8vt.mjs} +3 -3
  387. package/dist/client/{headerSection-D7qJrqFX.mjs → headerSection-CmjHLR-N.mjs} +3 -3
  388. package/dist/client/hooks.mjs +414 -182
  389. package/dist/client/{locationMap-CCF9-t_0.mjs → locationMap-BXKP_lGh.mjs} +3 -3
  390. package/dist/client/{media-CwBGetqC.mjs → media-Cl38iOMI.mjs} +10 -3
  391. package/dist/client/{newsletterForm-DzCLSP4S.mjs → newsletterForm-CU-HmxGx.mjs} +3 -3
  392. package/dist/client/{pricing-Cgxv2KLC.mjs → pricing-KEAEsibq.mjs} +1 -1
  393. package/dist/client/{productDetail-ru9w5GHx.mjs → productDetail-Ckp7MGnt.mjs} +3 -3
  394. package/dist/client/{productList-zaapKSl-.mjs → productList-D91V0sYa.mjs} +3 -3
  395. package/dist/client/{propsDecoder-CwvvNOHx.mjs → propsDecoder-DZd6RJeA.mjs} +244 -94
  396. package/dist/client/rendering/client.mjs +2656 -1705
  397. package/dist/client/rendering/islands.mjs +18 -18
  398. package/dist/client/rendering.mjs +3430 -2352
  399. package/dist/client/{routeIslandApiConfig-BwVFo0Y4.mjs → routeIslandApiConfig-E1EkhhYY.mjs} +1 -1
  400. package/dist/client/{shop-mktkXvbV.mjs → shop-4F2jLQPI.mjs} +131 -85
  401. package/dist/client/{shop-commerce-De7gEnkA.mjs → shop-commerce-BbfCJjB3.mjs} +25 -13
  402. package/dist/client/{shop-commerce-store-B3MCxIBW.mjs → shop-commerce-store-vicweP2K.mjs} +1 -1
  403. package/dist/client/{shopShared-TqExh235.mjs → shopShared-DlONJt0T.mjs} +4 -4
  404. package/dist/client/{useEventFilters-n_OjkIjX.mjs → useEventFilters-COYyL3m7.mjs} +32 -17
  405. package/dist/preview-next/before-render.mjs +207 -105
  406. package/dist/preview-next/client/runtime.mjs +4 -4
  407. package/dist/preview-next/constants.mjs +5 -1
  408. package/dist/preview-next/index.mjs +5 -1
  409. package/dist/preview-next/keepAlive.mjs +341 -165
  410. package/dist/preview-next/middleware.mjs +207 -105
  411. package/dist/{previewAuthStore-C_EHQ5XA.mjs → previewAuthStore-BBmV7UsW.mjs} +243 -112
  412. package/dist/{sdk-runtime-BIkJg5y1.mjs → sdk-runtime-CwvFFjB-.mjs} +2 -2
  413. package/dist/{separator-C9qDP95Z.mjs → separator-ByL72zUT.mjs} +1 -1
  414. package/dist/server/components.mjs +1839 -1475
  415. package/dist/server/config-validation.mjs +381 -166
  416. package/dist/server/config.mjs +381 -166
  417. package/dist/server/data.mjs +381 -166
  418. package/dist/server/index.mjs +214 -110
  419. package/dist/server/next.mjs +663 -351
  420. package/dist/server/page-converter.mjs +198 -79
  421. package/dist/server/prebuild.mjs +1 -1
  422. package/dist/server/rendering/server.mjs +1536 -1169
  423. package/dist/server/rendering.mjs +2432 -2068
  424. package/dist/server/routing.mjs +456 -173
  425. package/dist/server/server.mjs +447 -267
  426. package/package.json +1 -1
  427. package/dist/_dts/api/src/bookingPaymentTermSchemas.d.ts +0 -123
  428. package/dist/_dts/billing/src/plans/display.d.ts +0 -15
  429. package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.mailing-list-note.d.ts +0 -3
  430. package/dist/_dts/commerce/src/purchase/checkoutPaymentTermPlanning.d.ts +0 -10
  431. package/dist/_dts/commerce/src/purchase/checkoutValidatedItemPlanning.d.ts +0 -55
  432. package/dist/_dts/commerce/src/purchase/orderInstalmentPayoff.d.ts +0 -24
  433. package/dist/_dts/content-editor/src/controller/buildBlockPublishedBaselines.d.ts +0 -4
  434. package/dist/_dts/content-editor/src/controller/buildPublishSuccessTransition.d.ts +0 -16
  435. package/dist/_dts/content-editor/src/controller/driver.d.ts +0 -14
  436. package/dist/_dts/content-editor/src/controller/seedDraftBaselinesFromBlocks.d.ts +0 -7
  437. package/dist/_dts/content-editor/src/controller/useEntrySyncHelpers.d.ts +0 -29
  438. package/dist/_dts/content-editor/src/hooks/autosaveScopePlanning.d.ts +0 -26
  439. package/dist/_dts/content-editor/src/hooks/useSimpleAutosave.d.ts +0 -64
  440. package/dist/_dts/content-editor/src/hooks/useStoreAutosave.d.ts +0 -48
  441. package/dist/_dts/content-editor/src/types.d.ts +0 -44
  442. package/dist/client/DiscountCodeDisclosure-CKJtz0mY.mjs +0 -137
@@ -1,5 +1,9 @@
1
- import { unsafeAsEditorBlockId, unsafeAsEditorBlockValues, unsafeAsEditorContentValues, unsafeAsEditorEntryId, unsafeAsEditorMetadataValues, unsafeAsEditorPageId, unsafeAsEditorSiteId, type EditorBlockBaselineInput, type EditorBlockId, type EditorBlockPublishedBaselineInput, type EditorDraftBlockBaselineUpdateMetaInput, type EditorDraftBlockInitMetaInput, type EditorBlockValues, type EditorContentValues, type EditorEntryId, type EditorMetadataValues, type EditorPageId, type EditorPersistedBlock, type BlockContentIdentity, type EditorSiteId, type EditorStructuralCommand, type EditorStructuralDraftSnapshot, type EditorSyncState, type EditorValueRecord } from '../../../core/src/index';
1
+ import { type EditorBlockVersions } from '../../../core/src/index';
2
+ import { type EditorBlockCollectionOwner, type EditorBlockCollectionReadBaseline, unsafeAsEditorBlockId, unsafeAsEditorBlockValues, unsafeAsEditorContentValues, unsafeAsEditorEntryId, unsafeAsEditorMetadataValues, unsafeAsEditorPageId, unsafeAsEditorSiteId, type EditorBlockBaselineInput, type EditorBlockId, type EditorDraftBlockBaselineUpdateMetaInput, type EditorDraftBlockInitMetaInput, type EditorBlockValues, type EditorContentValues, type EditorEntryId, type EditorMetadataValues, type EditorPageId, type EditorPersistedBlock, type EditorSiteId, type EditorStructuralCommand, type EditorStructuralDraftSnapshot, type EditorValueRecord, type BaselineRevision, type SendId, type ValueSync } from '../../../core/src/index';
2
3
  import { type LinkedContentEntryId, type LinkedContentTypeKey } from '../linkedEntries/domain';
4
+ import { type EditorValueSnapshot } from './editorValueSnapshot';
5
+ import { type OwnWriteSince, type RefreshPolicy, type ValueSyncEvent, type ValueSyncOutcome } from '../sync/valueSync';
6
+ export type { EditorValueSnapshot } from './editorValueSnapshot';
3
7
  export { unsafeAsEditorBlockId, unsafeAsEditorBlockValues, unsafeAsEditorContentValues, unsafeAsEditorEntryId, unsafeAsEditorMetadataValues, unsafeAsEditorPageId, unsafeAsEditorSiteId, type EditorBlockId, type EditorBlockValues, type EditorContentValues, type EditorEntryId, type EditorMetadataValues, type EditorPageId, type EditorSiteId, };
4
8
  export type EditorCommand = {
5
9
  type: 'set-metadata-value';
@@ -52,13 +56,6 @@ type PersistRemoveEffect = Readonly<{
52
56
  blockId: EditorBlockId;
53
57
  }>;
54
58
  export type EditorEffect = PersistReorderEffect | PersistInsertEffect | PersistRemoveEffect;
55
- export type EditorValueSnapshot<TValue extends EditorValueRecord | null> = Readonly<{
56
- version: number;
57
- baseline: TValue;
58
- current: TValue;
59
- publishedBaseline: TValue;
60
- syncState: EditorSyncState;
61
- }>;
62
59
  export type EditorValuePublicationState<TValue extends EditorValueRecord | null> = Readonly<{
63
60
  kind: 'empty';
64
61
  hasUnpublishedChanges: false;
@@ -81,27 +78,15 @@ export type EditorValuePublicationState<TValue extends EditorValueRecord | null>
81
78
  hasUnpublishedChanges: true;
82
79
  }>;
83
80
  export declare function deriveEditorValuePublicationState<TValue extends EditorValueRecord | null>(snapshot: EditorValueSnapshot<TValue>): EditorValuePublicationState<TValue>;
84
- export type EditorPublishSuccessTransition = Readonly<{
85
- metadata: Readonly<{
86
- baseline: EditorMetadataValues | null;
87
- current: EditorMetadataValues | null;
88
- published: EditorMetadataValues | null;
89
- }>;
90
- content: Readonly<{
91
- published: EditorContentValues | null;
92
- versionAtPublishStart: number;
93
- }>;
94
- blockPublishedBaselines: readonly BlockPublishedBaselineInput[] | null;
95
- }>;
96
81
  type EditorMetadataSnapshot = EditorValueSnapshot<EditorMetadataValues | null>;
97
82
  type EditorContentSnapshot = EditorValueSnapshot<EditorContentValues | null>;
83
+ /** The linked entry's baseline revision (its optimistic hash) lives in `sync`. */
98
84
  export type EditorLinkedEntryMeta = Readonly<{
99
85
  entryId: LinkedContentEntryId;
100
86
  contentTypeKey: LinkedContentTypeKey;
101
87
  contentTypeLabel: string;
102
88
  title: string;
103
89
  titleField: string | null;
104
- optimisticHash: string | null;
105
90
  fields: readonly EditorValueRecord[];
106
91
  }>;
107
92
  export type EditorLinkedEntrySnapshot = EditorValueSnapshot<EditorContentValues | null> & Readonly<{
@@ -111,31 +96,26 @@ export type EditorBlockMeta = Readonly<{
111
96
  kind: string;
112
97
  purpose: string | null;
113
98
  orderIndex: number | null;
114
- publishedContent: EditorBlockValues | null;
115
- optimisticHash: string | null;
116
99
  }>;
117
100
  export type EditorDraftSnapshot = EditorStructuralDraftSnapshot;
118
101
  export type DraftBlockInitMetaInput = EditorDraftBlockInitMetaInput;
119
102
  export type DraftBlockBaselineUpdateMetaInput = EditorDraftBlockBaselineUpdateMetaInput;
120
103
  export type DraftBlockBaselineInput = EditorBlockBaselineInput;
121
- export type BlockPublishedBaselineInput = EditorBlockPublishedBaselineInput;
122
- export type EditorBlockItem = Partial<BlockContentIdentity> & Readonly<{
104
+ export type EditorBlockItem = Readonly<{
123
105
  id?: string | null;
124
106
  kind: string;
125
107
  content?: EditorValueRecord | null;
126
108
  orderIndex?: number | null;
127
109
  draftContent?: EditorValueRecord | null;
128
- publishedContent?: EditorValueRecord | null;
129
110
  bindings?: EditorValueRecord | null;
130
111
  purpose?: string | null;
131
112
  optimisticHash?: string | null;
132
113
  }>;
133
- type NormalizedEditorBlockBase = BlockContentIdentity & Readonly<{
114
+ type NormalizedEditorBlockBase = Readonly<{
134
115
  kind: string;
135
116
  content: EditorBlockValues | null;
136
117
  orderIndex: number | null;
137
118
  draftContent: EditorBlockValues | null;
138
- publishedContent: EditorBlockValues | null;
139
119
  bindings: EditorBlockValues | null;
140
120
  purpose: string | null;
141
121
  optimisticHash: string | null;
@@ -153,10 +133,30 @@ export type EditorHistorySnapshot = Readonly<{
153
133
  * Structural/history operations and baseline acknowledgements keep this list in sync,
154
134
  * while draft-only validation/edit metadata continues to live in `drafts`.
155
135
  */
136
+ blockCollectionOwner: EditorBlockCollectionOwner | null;
137
+ collectionReadBaselines: Readonly<Record<string, EditorBlockCollectionReadBaseline>>;
156
138
  blockList: readonly NormalizedEditorBlockItem[];
157
139
  drafts: Readonly<Record<EditorBlockId, EditorDraftSnapshot>>;
158
140
  linkedEntries: Readonly<Record<string, EditorLinkedEntrySnapshot>>;
159
141
  }>;
142
+ /** Which value a sync event applies to. A linked entry that is the document itself routes to content. */
143
+ export type EditorValueKey = Readonly<{
144
+ kind: 'metadata';
145
+ }> | Readonly<{
146
+ kind: 'content';
147
+ }> | Readonly<{
148
+ kind: 'block';
149
+ blockId: EditorBlockId;
150
+ }> | Readonly<{
151
+ kind: 'linked-entry';
152
+ entryId: string;
153
+ }>;
154
+ /** Events arrive unbranded; each family brands (and clones) the values it stores. */
155
+ export type EditorValueSyncEvent = ValueSyncEvent<EditorValueRecord | null>;
156
+ export type EditorValueTransition = Readonly<{
157
+ snapshot: EditorHistorySnapshot;
158
+ outcome: ValueSyncOutcome;
159
+ }>;
160
160
  export declare function requirePersistedEditorBlock(block: EditorBlockItem | NormalizedEditorBlockItem): PersistedEditorBlockItem;
161
161
  export declare function createEditorDraftSnapshotFromBlock(block: PersistedEditorBlockItem): EditorDraftSnapshot;
162
162
  export declare function createEditorHistorySnapshot(): EditorHistorySnapshot;
@@ -171,78 +171,24 @@ export type EditorUserOperation = {
171
171
  type: 'user-command';
172
172
  command: EditorCommand;
173
173
  };
174
+ /**
175
+ * History-free operations. Save requests don't appear here: the store applies their
176
+ * sync events (`send-started`, `send-succeeded`, `send-failed`) through `applyValueEvent`.
177
+ */
174
178
  export type EditorSystemOperation = {
175
- type: 'hydrate-metadata';
176
- baseline: EditorMetadataValues | null;
177
- current?: EditorMetadataValues | null;
178
- published?: EditorMetadataValues | null;
179
- } | {
180
- type: 'hydrate-content';
181
- baseline: EditorContentValues | null;
182
- current?: EditorContentValues | null;
183
- published?: EditorContentValues | null;
184
- } | {
185
179
  type: 'set-metadata-published-baseline';
186
180
  published: EditorMetadataValues | null;
187
181
  } | {
188
182
  type: 'set-content-published-baseline';
189
183
  published: EditorContentValues | null;
190
- } | {
191
- type: 'apply-publish-success';
192
- transition: EditorPublishSuccessTransition;
193
- } | {
194
- type: 'autosave-metadata-succeeded';
195
- savedValues: EditorMetadataValues | null;
196
- acknowledgedVersion: number;
197
- } | {
198
- type: 'autosave-content-succeeded';
199
- savedValues: EditorContentValues | null;
200
- acknowledgedVersion: number;
201
- } | {
202
- type: 'autosave-metadata-failed';
203
- message?: string;
204
- } | {
205
- type: 'autosave-content-failed';
206
- message?: string;
207
- } | {
208
- type: 'clear-metadata-error';
209
- } | {
210
- type: 'clear-content-error';
211
184
  } | {
212
185
  type: 'init-new-draft-block';
213
186
  blockId: EditorBlockId;
214
187
  baseline: DraftBlockBaselineInput;
215
188
  meta: DraftBlockInitMetaInput;
216
- } | {
217
- type: 'update-draft-block-baseline';
218
- blockId: EditorBlockId;
219
- baseline: DraftBlockBaselineInput;
220
- meta?: DraftBlockBaselineUpdateMetaInput;
221
189
  } | {
222
190
  type: 'remove-draft-block';
223
191
  blockId: EditorBlockId;
224
- } | {
225
- type: 'set-draft-published-baselines';
226
- blocks: readonly BlockPublishedBaselineInput[];
227
- } | {
228
- type: 'autosave-draft-succeeded';
229
- blockId: EditorBlockId;
230
- savedValues: EditorBlockValues | null;
231
- acknowledgedVersion: number;
232
- optimisticHash: string | null;
233
- } | {
234
- type: 'autosave-draft-failed';
235
- blockId: EditorBlockId;
236
- message?: string;
237
- } | {
238
- type: 'clear-draft-error';
239
- blockId: EditorBlockId;
240
- } | {
241
- type: 'set-draft-pending';
242
- blockId: EditorBlockId;
243
- } | {
244
- type: 'clear-draft-pending';
245
- blockId: EditorBlockId;
246
192
  } | {
247
193
  type: 'hydrate-linked-entry';
248
194
  entryId: string;
@@ -253,23 +199,14 @@ export type EditorSystemOperation = {
253
199
  optimisticHash?: string | null;
254
200
  fields: readonly EditorValueRecord[];
255
201
  baseline: EditorContentValues | null;
256
- current?: EditorContentValues | null;
257
- } | {
258
- type: 'discard-linked-entry';
259
- entryId: string;
260
202
  } | {
261
- type: 'save-linked-entry-succeeded';
262
- entryId: string;
263
- savedValues: EditorContentValues | null;
264
- acknowledgedVersion: number;
265
- optimisticHash?: string | null;
203
+ /** An `edited` event outside history: a preview runtime showing values it drives. */
204
+ type: 'edit-without-history';
205
+ key: EditorValueKey;
206
+ values: EditorValueRecord | null;
266
207
  } | {
267
- type: 'save-linked-entry-failed';
268
- entryId: string;
269
- message?: string;
270
- } | {
271
- type: 'clear-linked-entry-error';
272
- entryId: string;
208
+ type: 'discard-local-edits';
209
+ contentOwnerEntryId?: string;
273
210
  } | {
274
211
  type: 'replace-block-list';
275
212
  next: readonly EditorBlockItem[];
@@ -279,36 +216,73 @@ export declare function applyEditorCommand(snapshot: EditorHistorySnapshot, comm
279
216
  export declare function applyUserOperation(snapshot: EditorHistorySnapshot, operation: EditorUserOperation): EditorHistorySnapshot;
280
217
  export declare function applySystemOperation(snapshot: EditorHistorySnapshot, operation: EditorSystemOperation): EditorHistorySnapshot;
281
218
  export declare function applyEditorOperation(snapshot: EditorHistorySnapshot, operation: EditorOperation): EditorHistorySnapshot;
282
- export declare function hydrateMetadataSnapshot(snapshot: EditorHistorySnapshot, baseline: EditorMetadataValues | null, current?: EditorMetadataValues | null, published?: EditorMetadataValues | null): EditorHistorySnapshot;
283
- export declare function hydrateContentSnapshot(snapshot: EditorHistorySnapshot, baseline: EditorContentValues | null, current?: EditorContentValues | null, published?: EditorContentValues | null): EditorHistorySnapshot;
219
+ /** The sync state of one value, or `undefined` when that block or linked entry isn't loaded. */
220
+ export declare function valueSyncAt(snapshot: EditorHistorySnapshot, key: EditorValueKey): ValueSync<EditorValueRecord | null> | undefined;
221
+ /** Applies one sync event to one value; the single path every family's transitions take. */
222
+ export declare function applyValueEvent(snapshot: EditorHistorySnapshot, key: EditorValueKey, event: EditorValueSyncEvent): EditorValueTransition;
223
+ /** What one started request carries: the values sent and the revision they were based on. */
224
+ export type StartedSend = Readonly<{
225
+ key: EditorValueKey;
226
+ id: SendId;
227
+ values: EditorValueRecord | null;
228
+ basis: BaselineRevision;
229
+ }>;
230
+ export declare function startedSendAt(snapshot: EditorHistorySnapshot, key: EditorValueKey, id: SendId): StartedSend | null;
231
+ export declare function aggregateSyncState(snapshot: EditorHistorySnapshot): 'baseline' | 'pending' | 'failed';
284
232
  export declare function setMetadataPublishedBaseline(snapshot: EditorHistorySnapshot, published: EditorMetadataValues | null): EditorHistorySnapshot;
285
233
  export declare function setContentPublishedBaseline(snapshot: EditorHistorySnapshot, published: EditorContentValues | null): EditorHistorySnapshot;
286
- export declare function applyPublishSuccessTransition(snapshot: EditorHistorySnapshot, transition: EditorPublishSuccessTransition): EditorHistorySnapshot;
287
- export declare function autosaveMetadataSucceeded(snapshot: EditorHistorySnapshot, savedValues: EditorMetadataValues | null, acknowledgedVersion: number): EditorHistorySnapshot;
288
- export declare function autosaveContentSucceeded(snapshot: EditorHistorySnapshot, savedValues: EditorContentValues | null, acknowledgedVersion: number): EditorHistorySnapshot;
289
- export declare function autosaveMetadataFailed(snapshot: EditorHistorySnapshot, message?: string): EditorHistorySnapshot;
290
- export declare function autosaveContentFailed(snapshot: EditorHistorySnapshot, message?: string): EditorHistorySnapshot;
291
- export declare function clearMetadataError(snapshot: EditorHistorySnapshot): EditorHistorySnapshot;
292
- export declare function clearContentError(snapshot: EditorHistorySnapshot): EditorHistorySnapshot;
293
234
  export declare function getCurrentValues<TValue extends EditorValueRecord | null>(snapshot: EditorValueSnapshot<TValue>): TValue;
294
- export declare function getSnapshotStatus(syncState: EditorSyncState): 'baseline' | 'pending' | 'failed';
295
- export declare function getSnapshotError(syncState: EditorSyncState): string | null;
235
+ /**
236
+ * How a server block value arrives (issue 1553): a read is a refresh under its policy;
237
+ * a response to this tab's own write (discard draft's block result) is rebased against
238
+ * what the person's edits are measured from.
239
+ */
240
+ export type DraftBlockArrival = Readonly<{
241
+ kind: 'refreshed';
242
+ policy: RefreshPolicy;
243
+ }> | Readonly<{
244
+ kind: 'own-write';
245
+ since: OwnWriteSince<EditorBlockValues | null>;
246
+ }>;
296
247
  export declare function initNewDraftBlock(snapshot: EditorHistorySnapshot, blockId: EditorBlockId, baseline: DraftBlockBaselineInput, meta: DraftBlockInitMetaInput): EditorHistorySnapshot;
297
- export declare function updateDraftBlockBaseline(snapshot: EditorHistorySnapshot, blockId: EditorBlockId, baseline: DraftBlockBaselineInput, meta?: DraftBlockBaselineUpdateMetaInput): EditorHistorySnapshot;
248
+ /** What a server block refresh carries; the shape of editor-blocks' baseline seed. */
249
+ export type DraftBlockRefresh = Readonly<{
250
+ blockId: EditorBlockId;
251
+ baseline: DraftBlockBaselineInput;
252
+ initMeta?: DraftBlockInitMetaInput;
253
+ refreshMeta?: DraftBlockBaselineUpdateMetaInput;
254
+ }>;
255
+ /**
256
+ * Refreshes one block from the server: an existing draft moves under the policy, a
257
+ * missing one is created pristine (when the refresh says how to create it).
258
+ */
259
+ export declare function refreshDraftBlock(snapshot: EditorHistorySnapshot, refresh: DraftBlockRefresh, arrival: DraftBlockArrival): EditorValueTransition;
298
260
  export declare function removeDraftBlock(snapshot: EditorHistorySnapshot, blockId: EditorBlockId): EditorHistorySnapshot;
299
- export declare function setDraftPublishedBaselines(snapshot: EditorHistorySnapshot, blocks: readonly BlockPublishedBaselineInput[]): EditorHistorySnapshot;
300
- export declare function autosaveDraftSucceeded(snapshot: EditorHistorySnapshot, blockId: EditorBlockId, savedValues: EditorBlockValues | null, acknowledgedVersion: number, optimisticHash: string | null): EditorHistorySnapshot;
301
- export declare function autosaveDraftFailed(snapshot: EditorHistorySnapshot, blockId: EditorBlockId, message?: string): EditorHistorySnapshot;
302
- export declare function clearDraftError(snapshot: EditorHistorySnapshot, blockId: EditorBlockId): EditorHistorySnapshot;
303
- export declare function setDraftPending(snapshot: EditorHistorySnapshot, blockId: EditorBlockId): EditorHistorySnapshot;
304
- export declare function clearDraftPending(snapshot: EditorHistorySnapshot, blockId: EditorBlockId): EditorHistorySnapshot;
305
- export declare function hydrateLinkedEntrySnapshot(snapshot: EditorHistorySnapshot, input: Extract<EditorSystemOperation, {
261
+ type LinkedEntryHydration = Extract<EditorSystemOperation, {
306
262
  type: 'hydrate-linked-entry';
307
- }>): EditorHistorySnapshot;
308
- export declare function discardLinkedEntrySnapshot(snapshot: EditorHistorySnapshot, entryId: string): EditorHistorySnapshot;
309
- export declare function saveLinkedEntrySucceeded(snapshot: EditorHistorySnapshot, entryId: string, savedValues: EditorContentValues | null, acknowledgedVersion: number, optimisticHash?: string | null): EditorHistorySnapshot;
310
- export declare function saveLinkedEntryFailed(snapshot: EditorHistorySnapshot, entryId: string, message?: string): EditorHistorySnapshot;
311
- export declare function clearLinkedEntryError(snapshot: EditorHistorySnapshot, entryId: string): EditorHistorySnapshot;
263
+ }>;
264
+ /**
265
+ * Opening a linked entry from the rendered page is an ordinary keep-local refresh of its
266
+ * record. A render without a revision keeps the record's own rather than wiping it.
267
+ */
268
+ export declare function hydrateLinkedEntrySnapshot(snapshot: EditorHistorySnapshot, input: LinkedEntryHydration): EditorHistorySnapshot;
269
+ /**
270
+ * Throw away every unsaved local edit, synchronously and locally: each value is
271
+ * `discarded`, so it shows its baseline and any request still outstanding becomes
272
+ * abandoned (issue 1553, D1–D3). Linked entries keep their record (D2); the document's
273
+ * own entry is routed through content. Nothing is read from the server, so it can't
274
+ * fail; newer server values arrive by the usual paths.
275
+ */
276
+ export declare function discardLocalEditsSnapshot(snapshot: EditorHistorySnapshot, contentOwnerEntryId?: string): EditorHistorySnapshot;
277
+ /** The linked entries whose local edits a discard would throw away. */
278
+ export declare function editedLinkedEntryIds(snapshot: EditorHistorySnapshot): readonly string[];
279
+ /**
280
+ * Undo and redo restore what the person sees, never sync state (issue 1553, D4).
281
+ * Displayed values and structure come from the target; baselines, revisions, requests
282
+ * and published baselines come from the present. A block record brought back by
283
+ * structure has no request (U3); other records missing from the target keep the present's.
284
+ */
285
+ export declare function restoreDisplay(present: EditorHistorySnapshot, target: EditorHistorySnapshot): EditorHistorySnapshot;
312
286
  export declare function replaceEditorBlockList(snapshot: EditorHistorySnapshot, blockList: readonly EditorBlockItem[]): EditorHistorySnapshot;
313
287
  export declare function getDraftSnapshot(snapshot: EditorHistorySnapshot, blockId: string): EditorDraftSnapshot | null;
314
288
  export declare function inspectDrafts(snapshot: EditorHistorySnapshot): EditorDraftSnapshot[];
@@ -320,5 +294,6 @@ export type EditorDraftUnpublishedBlockChange = Readonly<{
320
294
  currentContent: EditorBlockValues | null;
321
295
  publishedContent: EditorBlockValues | null;
322
296
  }>;
323
- export declare function getFirstUnpublishedDraftChange(snapshot: EditorHistorySnapshot): EditorDraftUnpublishedBlockChange | null;
324
- export declare function hasUnpublishedDraftChanges(snapshot: EditorHistorySnapshot): boolean;
297
+ export declare function blockPublicationState(draft: EditorDraftSnapshot, versions: EditorBlockVersions): EditorValuePublicationState<EditorBlockValues | null>;
298
+ export declare function getFirstUnpublishedDraftChange(snapshot: EditorHistorySnapshot, versionsFor: (blockId: EditorBlockId) => EditorBlockVersions): EditorDraftUnpublishedBlockChange | null;
299
+ export declare function hasUnpublishedDraftChanges(snapshot: EditorHistorySnapshot, versionsFor: (blockId: EditorBlockId) => EditorBlockVersions): boolean;
@@ -87,7 +87,7 @@ export declare function confirmStagedSession<TSnapshot, THistoryEntry, TTargetKe
87
87
  export declare function rejectStagedSession<TSnapshot, THistoryEntry, TTargetKey extends string = string>(state: EditorStagedSessionState<TSnapshot, THistoryEntry, TTargetKey>, failure: EditorTransactionFailure): EditorStagedSessionState<TSnapshot, THistoryEntry, TTargetKey>;
88
88
  export declare function cancelStagedSession<TSnapshot, THistoryEntry, TTargetKey extends string = string>(state: EditorStagedSessionState<TSnapshot, THistoryEntry, TTargetKey>): EditorStagedSessionState<TSnapshot, THistoryEntry, TTargetKey>;
89
89
  export declare function enqueueTransaction<TAction, THistoryEntry, TTargetKey extends string = string>(state: EditorTransactionQueueState<TAction, THistoryEntry, TTargetKey>, transaction: EditorTransaction<TAction, THistoryEntry, TTargetKey>): EditorTransactionQueueState<TAction, THistoryEntry, TTargetKey>;
90
- export declare function beginAutosaveBatch<TAction, THistoryEntry, TTargetKey extends string = string>(state: EditorTransactionQueueState<TAction, THistoryEntry, TTargetKey>): EditorTransactionQueueState<TAction, THistoryEntry, TTargetKey>;
90
+ export declare function beginAutosaveBatch<TAction, THistoryEntry, TTargetKey extends string = string>(state: EditorTransactionQueueState<TAction, THistoryEntry, TTargetKey>, captured?: EditorSaveBatch<TAction, THistoryEntry, TTargetKey>): EditorTransactionQueueState<TAction, THistoryEntry, TTargetKey>;
91
91
  export declare function confirmAutosaveBatch<TAction, THistoryEntry, TTargetKey extends string = string>(state: EditorTransactionQueueState<TAction, THistoryEntry, TTargetKey>): EditorTransactionQueueState<TAction, THistoryEntry, TTargetKey>;
92
92
  export declare function rejectAutosaveBatch<TAction, THistoryEntry, TTargetKey extends string = string>(state: EditorTransactionQueueState<TAction, THistoryEntry, TTargetKey>, failure: EditorTransactionFailure): EditorTransactionQueueState<TAction, THistoryEntry, TTargetKey>;
93
93
  export declare function coalesceQueuedTransactions<TAction, THistoryEntry, TTargetKey extends string = string>(queue: readonly EditorTransaction<TAction, THistoryEntry, TTargetKey>[], transaction: EditorTransaction<TAction, THistoryEntry, TTargetKey>): readonly EditorTransaction<TAction, THistoryEntry, TTargetKey>[];
@@ -1,16 +1,33 @@
1
- import type { FooterModuleId } from '../../../core/src/index';
1
+ import { type BlockFieldExtensions } from '../../../editor-blocks/src/block-editor/blockDraftBaselineSeed';
2
+ import type { EditorBlockCollectionOwner, EditorBlockCollectionReadBaseline } from '../../../core/src/index';
3
+ import { type ServerBlockAdmission } from './serverBlockAdmission';
4
+ import { type BlockVersionsState } from './stores/blockVersionsStore';
5
+ import { type EditorBlockVersions, type EditorInsertBlockCommand, type SavedBlockContentVersion } from '../../../core/src/index';
6
+ import type { ServerBlockItem } from '../../../editor-blocks/src/block-editor/types';
7
+ import { type DocumentLifecycleResult } from './documentLifecycle';
8
+ import type { EditorValueRecord, FooterModuleId } from '../../../core/src/index';
9
+ import type { EditorLeaseUiState } from './editorLeaseUiState';
10
+ import type { DraftsSlice } from '../../../editor-blocks/src/block-editor/types';
11
+ import { type EditorEditability } from '../controller/editorEditability';
12
+ export { unmanagedSurfaceEditability } from '../controller/editorEditability';
13
+ import { type LinkedEntryLeaseState } from './stores/linkedEntryLeaseStore';
14
+ import { type DocumentValueRefreshInput, type OwnWrite, type PublishSuccessRefresh, type ValueRefresh } from './editorRefresh';
15
+ import { type RemoteDraftsState } from './stores/remoteDraftsStore';
16
+ import { type LinkedSaveHandoversState } from './stores/linkedSaveHandoversStore';
2
17
  import { type EditorUnpublishedState } from '../controller/deriveEditorUnpublishedState';
3
18
  import { type AutosaveState } from './stores/autosaveStore';
4
19
  import { type GeneratedIconAssetsState } from './stores/generatedIconAssetsStore';
5
20
  import { type ArrayKeysState } from './stores/arrayKeysStore';
6
21
  import { type ViewportState } from './stores/viewportStore';
7
22
  import { type AiOverlaysState } from './stores/aiOverlaysSlice';
8
- import { type EditorValueSnapshot, type EditorBlockItem, type EditorBlockId, type NormalizedEditorBlockItem, type DraftBlockBaselineInput, type DraftBlockBaselineUpdateMetaInput, type DraftBlockInitMetaInput, type EditorCommand, type EditorContentValues, type EditorDraftSnapshot, type EditorDraftUnpublishedBlockChange, type EditorEffect, type EditorHistorySnapshot, type EditorLinkedEntrySnapshot, type EditorMetadataValues, type BlockPublishedBaselineInput } from './editorHistory';
23
+ import { type EditorValueSnapshot, type EditorBlockItem, type EditorBlockId, type NormalizedEditorBlockItem, type EditorCommand, type EditorContentValues, type EditorDraftUnpublishedBlockChange, type EditorEffect, type EditorHistorySnapshot, type EditorLinkedEntrySnapshot, type EditorMetadataValues, type EditorValueKey, type StartedSend } from './editorHistory';
24
+ import { type RefreshPolicy, type SendMode, type ValueSyncOutcome } from '../sync/valueSync';
25
+ import type { BaselineRevision, SaveFailure, SendId, ValueSync } from '../../../core/src/index';
9
26
  import { type HistoryState } from './editorHistory';
10
- import type { FocusRequest, FocusTarget } from './stores/types';
11
- import { type LinkedContentEntryId } from '../linkedEntries/domain';
27
+ import type { FocusRequest, FocusTarget, HeldOperation, LifecycleFailure, LifecycleOperation, LifecycleStatus } from './stores/types';
28
+ import { type LinkedContentEntryId, type LinkedEntryOpenTarget } from '../linkedEntries/domain';
12
29
  import { type BlockDraftSaveability, type BlockDraftValidationIssue, type ResolveBlockManifest } from './blockValidationView';
13
- export type { AutosaveStatusValue, AutosaveStatus, AutosaveHandle, AutosaveType, AutosaveType as AutosaveSchedulerKey, FocusRequest, ViewportMode, ViewportWidth, ZoomLevel, } from './stores/types';
30
+ export type { AutosaveStatusValue, AutosaveStatus, AutosaveHandle, AutosaveType, FocusRequest, HeldOperation, LifecycleFailure, LifecycleOperation, LifecycleOutcome, LifecycleStatus, ViewportMode, ViewportWidth, ZoomLevel, } from './stores/types';
14
31
  export type { AutosaveState } from './stores/autosaveStore';
15
32
  export type { ArrayKeysState } from './stores/arrayKeysStore';
16
33
  export type { ViewportState } from './stores/viewportStore';
@@ -41,15 +58,24 @@ export type ActivePreviewField = (Readonly<{
41
58
  entryId: LinkedContentEntryId;
42
59
  fieldPath: string;
43
60
  }>) | null;
44
- /**
45
- * Version of the local draft snapshot that a completed autosave request persisted.
46
- * The reducer uses this to accept the saved baseline without treating older
47
- * in-flight saves as acknowledgements of newer local edits.
48
- */
49
- export type AutosaveAcknowledgement = Readonly<{
50
- acknowledgedVersion: number;
51
- optimisticHash?: string | null;
61
+ /** How a save request settled. `at` is the ISO time the shell observed the response. */
62
+ export type SendResult = Readonly<{
63
+ kind: 'succeeded';
64
+ values: Record<string, unknown> | null;
65
+ revision: BaselineRevision;
66
+ at: string;
67
+ published?: Readonly<{
68
+ kind: 'known';
69
+ values: Record<string, unknown> | null;
70
+ } | {
71
+ kind: 'unknown';
72
+ }>;
73
+ blockVersion?: SavedBlockContentVersion;
74
+ }> | Readonly<{
75
+ kind: 'failed';
76
+ failure: SaveFailure;
52
77
  }>;
78
+ export type { EditorValueKey, StartedSend } from './editorHistory';
53
79
  /**
54
80
  * Form-facing metadata facade. Consumers pass plain records for ergonomics;
55
81
  * the reducer core normalizes and brands values at this boundary.
@@ -57,16 +83,16 @@ export type AutosaveAcknowledgement = Readonly<{
57
83
  export type MetadataState = {
58
84
  getSnapshot: () => MetadataSnapshot;
59
85
  getCurrentValues: () => Record<string, unknown> | null;
60
- hydrate: (baseline: Record<string, unknown> | null, current?: Record<string, unknown> | null, published?: Record<string, unknown> | null) => void;
86
+ /**
87
+ * Applies a server read of this value as a refresh event (issue 1553). Ordinary
88
+ * refreshes are keep-local; returns whether local edits were discarded.
89
+ */
90
+ refresh: (input: DocumentValueRefreshInput, policy?: RefreshPolicy) => boolean;
61
91
  setPublishedBaseline: (published: Record<string, unknown> | null) => void;
62
92
  hasUnpublishedChanges: () => boolean;
63
- setBaseline: (baseline: Record<string, unknown> | null) => void;
64
93
  setCurrentValues: (values: Record<string, unknown> | null) => void;
65
94
  setAtPath: (path: string, value: unknown) => void;
66
95
  getAtPath: <R = unknown>(path: string) => R | undefined;
67
- autosaveSucceeded: (savedValues: Record<string, unknown> | null, acknowledgement?: AutosaveAcknowledgement) => void;
68
- autosaveFailed: (message?: string) => void;
69
- clearError: () => void;
70
96
  };
71
97
  export type ContentState = Omit<MetadataState, 'getSnapshot'> & {
72
98
  getSnapshot: () => ContentSnapshot;
@@ -91,18 +117,7 @@ export type PreviewInspection = Readonly<{
91
117
  }>;
92
118
  export type LinkedEntryState = {
93
119
  getSelectedEntryId: () => LinkedContentEntryId | null;
94
- open: (target: {
95
- entryId: string;
96
- contentTypeKey: string;
97
- contentTypeLabel: string;
98
- title: string;
99
- optimisticHash?: string | null;
100
- content: Record<string, unknown>;
101
- contentType: {
102
- titleField?: string | null;
103
- fields: readonly Record<string, unknown>[];
104
- };
105
- }) => void;
120
+ open: (target: LinkedEntryOpenTarget) => void;
106
121
  close: () => void;
107
122
  discard: (entryId?: string) => void;
108
123
  getSelectedSnapshot: () => EditorLinkedEntrySnapshot | null;
@@ -112,11 +127,6 @@ export type LinkedEntryState = {
112
127
  setCurrentValues: (values: Record<string, unknown> | null, entryId?: string) => void;
113
128
  setAtPath: (path: string, value: unknown, entryId?: string) => void;
114
129
  getAtPath: <R = unknown>(path: string, entryId?: string) => R | undefined;
115
- saveSucceeded: (entryId: string, content: Record<string, unknown> | null, acknowledgement?: AutosaveAcknowledgement & {
116
- optimisticHash?: string | null;
117
- }) => void;
118
- saveFailed: (entryId: string, message?: string) => void;
119
- clearError: (entryId?: string) => void;
120
130
  };
121
131
  export type EditorPreviewInspectorStore = {
122
132
  getState: () => {
@@ -127,6 +137,12 @@ export type EditorPreviewInspectorStore = {
127
137
  structure?: AiOverlaysState['structure'];
128
138
  }>;
129
139
  linkedEntries: Pick<LinkedEntryState, 'inspect'>;
140
+ blockVersions: Pick<BlockVersionsState, 'get' | 'revision'>;
141
+ remoteDrafts?: RemoteDraftsState['remoteDrafts'];
142
+ linkedSaveHandovers?: LinkedSaveHandoversState['linkedSaveHandovers'];
143
+ content?: Pick<ContentState, 'getSnapshot'>;
144
+ /** Decides the render source: a viewer renders live drafts, any other tab its own edits. */
145
+ editability: EditorEditability;
130
146
  };
131
147
  };
132
148
  export type EditorHistoryState = HistoryState<EditorHistorySnapshot>;
@@ -155,54 +171,40 @@ export type BlockValidationState = {
155
171
  } | null;
156
172
  getBlockSaveability: (blockId: EditorBlockId) => BlockDraftSaveability;
157
173
  };
158
- export type DraftsState = {
159
- getBlockSnapshot: (blockId: EditorBlockId) => EditorDraftSnapshot | null;
160
- getCurrentValues: (blockId: EditorBlockId) => Record<string, unknown> | null;
161
- inspect: () => EditorDraftSnapshot[];
162
- /**
163
- * Form-facing drafts facade. Baseline inputs stay unbranded so editor consumers
164
- * can pass raw form values; the reducer core normalizes and brands them here.
165
- */
166
- initNewBlock: (blockId: EditorBlockId, baseline: DraftBlockBaselineInput, meta: DraftBlockInitMetaInput) => void;
167
- updateBlockBaseline: (blockId: EditorBlockId, baseline: DraftBlockBaselineInput, meta?: DraftBlockBaselineUpdateMetaInput) => void;
168
- setBlockPublishedBaselinesFromBlocks: (blocks: readonly BlockPublishedBaselineInput[]) => void;
169
- edit: (blockId: EditorBlockId, content: Record<string, unknown> | null) => void;
170
- remove: (blockId: EditorBlockId) => void;
171
- clearError: (blockId: EditorBlockId) => void;
172
- setPending: (blockId: EditorBlockId) => void;
173
- clearPending: (blockId: EditorBlockId) => void;
174
- setFailed: (blockId: EditorBlockId, message?: string) => void;
175
- autosaveSucceeded: (blockId: EditorBlockId, content: Record<string, unknown> | null, acknowledgement?: AutosaveAcknowledgement) => void;
176
- autosaveFailed: (blockId: EditorBlockId, message?: string) => void;
177
- setAtPath: (blockId: EditorBlockId, path: string, value: unknown) => void;
178
- getAtPath: <T = unknown>(blockId: EditorBlockId, path: string) => T | undefined;
179
- updateBlockOrder: (blockIds: EditorBlockId[]) => void;
174
+ /**
175
+ * Form-facing drafts facade: editor-blocks' `DraftsSlice` contract plus the store-only
176
+ * publish helpers. Baseline inputs stay unbranded so editor consumers can pass raw
177
+ * form values; the reducer core normalizes and brands them here.
178
+ */
179
+ export type DraftsState = DraftsSlice & {
180
180
  hasUnpublishedBlockChanges: () => boolean;
181
181
  getFirstUnpublishedBlockChange: () => EditorDraftUnpublishedBlockChange | null;
182
- markAllBlocksAsPublished: () => void;
183
182
  onChange: (listener: (blockId: EditorBlockId) => void) => () => void;
183
+ /**
184
+ * Shows `content` as the block's local edit without a history entry: a preview runtime
185
+ * (customize) drives these values and owns their undo (issue 1553).
186
+ */
187
+ editWithoutHistory: (blockId: EditorBlockId, content: Record<string, unknown> | null) => void;
184
188
  };
189
+ /** Local edits are refused while the tab can't write (read-only, acquiring or viewing). */
190
+ export type EditorUserOperationOutcome = 'applied' | 'unchanged' | 'refused';
191
+ export type EditorPublishedVersionScope = 'metadata' | 'content';
185
192
  export type CreateEditorUiStoreOptions = Readonly<{
193
+ publishedVersionScope?: EditorPublishedVersionScope;
194
+ contentOwnerEntryId?: string;
195
+ /** Required so a new caller can't write freely by omission; unmanaged surfaces say so explicitly. */
196
+ editability: EditorLeaseUiState['editability'];
186
197
  resolveBlockManifest?: ResolveBlockManifest;
198
+ resolveBlockFieldExtensions?: () => BlockFieldExtensions | null | undefined;
187
199
  }>;
188
200
  type RestoreListener = (transition: {
189
201
  previous: EditorHistorySnapshot;
190
202
  next: EditorHistorySnapshot;
191
203
  effects: readonly EditorEffect[];
192
204
  }) => void;
193
- export type ApplyPublishSuccessTransitionInput = Readonly<{
194
- metadata: Readonly<{
195
- baseline: Record<string, unknown> | null;
196
- current: Record<string, unknown> | null;
197
- published: Record<string, unknown> | null;
198
- }>;
199
- content: Readonly<{
200
- published: Record<string, unknown> | null;
201
- versionAtPublishStart: number;
202
- }>;
203
- blockPublishedBaselines: readonly BlockPublishedBaselineInput[] | null;
204
- }>;
205
- export type EditorUiState = {
205
+ export type ApplyPublishSuccessTransitionInput = PublishSuccessRefresh;
206
+ export type EditorUiState = EditorLeaseUiState & LinkedEntryLeaseState & RemoteDraftsState & LinkedSaveHandoversState & {
207
+ contentOwnerEntryId: string | undefined;
206
208
  drawerOpen: boolean;
207
209
  previewSidebarTab: PreviewSidebarTab;
208
210
  previewInspection: PreviewInspection;
@@ -222,9 +224,36 @@ export type EditorUiState = {
222
224
  clearFocus: () => void;
223
225
  setActiveBlockId: (id: EditorBlockId | null) => void;
224
226
  getDraftSyncState: () => 'baseline' | 'pending' | 'failed';
227
+ /** The document's lifecycle operations (`LifecycleOperation`); outside history, beside the values' states. */
228
+ lifecycle: LifecycleStatus;
229
+ /** When a save or lifecycle operation was last accepted (ISO time). */
230
+ lastSavedAt: string | null;
231
+ /** How many saves have been accepted; a `server` lifecycle failure holds until this moves. */
232
+ acceptedSaves: number;
233
+ setLifecycle: (change: LifecycleChange) => void;
234
+ /**
235
+ * Starts a save for each value that may send now, allocating one id per request.
236
+ * Returns what each started request carries; values that may not send are left out.
237
+ */
238
+ beginSends: (keys: readonly EditorValueKey[], mode?: SendMode, checkpoints?: ReadonlyMap<string, Record<string, unknown> | null>) => readonly StartedSend[];
239
+ /** One value's sync state; `undefined` when that block or linked entry isn't loaded. */
240
+ getValueSync: (key: EditorValueKey) => ValueSync<EditorValueRecord | null> | undefined;
241
+ /** Applies a response. Only the value's current request is acknowledged; others are ignored. */
242
+ settle: (key: EditorValueKey, id: SendId, result: SendResult) => ValueSyncOutcome;
243
+ /** Throws away every unsaved local edit, synchronously; see `discardLocalEditsSnapshot`. */
244
+ discardLocalEdits: () => void;
225
245
  getUnpublishedState: () => EditorUnpublishedState;
226
246
  hasAnyUnpublishedChanges: () => boolean;
247
+ applyDocumentLifecycle: (result: DocumentLifecycleResult) => void;
227
248
  applyPublishSuccessTransition: (transition: ApplyPublishSuccessTransitionInput) => void;
249
+ /** Applies what this tab's own writes returned, rebased under any edits (`OwnWrite`). */
250
+ applyOwnWrites: (writes: readonly OwnWrite[]) => void;
251
+ /**
252
+ * Applies server reads as refresh events in one update, under one policy (issue 1553):
253
+ * keep-local for ordinary refreshes, take-back for a lease grant, replace for discard
254
+ * draft. Returns whether local edits were discarded.
255
+ */
256
+ refreshValues: (refreshes: readonly ValueRefresh[], policy: RefreshPolicy) => boolean;
228
257
  history: {
229
258
  getState: () => EditorHistoryState;
230
259
  canUndo: () => boolean;
@@ -241,9 +270,16 @@ export type EditorUiState = {
241
270
  };
242
271
  blockValidation: BlockValidationState;
243
272
  structure: {
273
+ getOwner: () => EditorBlockCollectionOwner | null;
274
+ mount: (owner: EditorBlockCollectionOwner, blocks: readonly ServerBlockItem[], reads?: readonly EditorBlockCollectionReadBaseline[]) => void;
275
+ unmount: (owner: EditorBlockCollectionOwner) => void;
244
276
  getList: () => readonly NormalizedEditorBlockItem[];
245
277
  replaceList: (next: readonly EditorBlockItem[]) => void;
246
278
  };
279
+ blockVersions: BlockVersionsState;
280
+ admitServerBlocks: (entries: readonly ServerBlockAdmission[], policy?: RefreshPolicy) => void;
281
+ insertServerBlock: (command: EditorInsertBlockCommand, versions: EditorBlockVersions) => void;
282
+ remapServerBlock: (fromId: EditorBlockId, toId: EditorBlockId, versions: EditorBlockVersions) => void;
247
283
  drafts: DraftsState;
248
284
  metadata: MetadataState;
249
285
  content: ContentState;
@@ -254,7 +290,25 @@ export type EditorUiState = {
254
290
  viewport: ViewportState;
255
291
  aiOverlays: AiOverlaysState;
256
292
  };
257
- export declare function createEditorUiStore(options?: CreateEditorUiStoreOptions): import("zustand").StoreApi<EditorUiState>;
293
+ /**
294
+ * How a lifecycle operation moves the status: it starts, finishes (recording when it
295
+ * saved, if it did) or fails.
296
+ */
297
+ export type LifecycleChange = Readonly<{
298
+ kind: 'start';
299
+ operation: LifecycleOperation;
300
+ }> | Readonly<{
301
+ kind: 'hold';
302
+ operation: HeldOperation;
303
+ }> | Readonly<{
304
+ kind: 'finish';
305
+ at: string | null;
306
+ }> | Readonly<{
307
+ kind: 'fail';
308
+ operation: LifecycleOperation;
309
+ failure: LifecycleFailure;
310
+ }>;
311
+ export declare function createEditorUiStore(options: CreateEditorUiStoreOptions): import("zustand").StoreApi<EditorUiState>;
258
312
  export type EditorUiStoreInstance = ReturnType<typeof createEditorUiStore>;
259
313
  export declare const EditorUiStoreProvider: import("react").Provider<import("zustand").StoreApi<EditorUiState> | null>;
260
314
  export declare function useEditorUiStore<T>(selector: (state: EditorUiState) => T): T;