@riverbankcms/sdk 0.78.0 → 0.78.2

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 (152) hide show
  1. package/README.md +45 -43
  2. package/dist/{PreviewEditorSidebar-RIKFQ72L.mjs → PreviewEditorSidebar-4DXLYX2V.mjs} +29 -21
  3. package/dist/{PreviewEditorUI-XO7TUWKK.mjs → PreviewEditorUI-CS5P4N3P.mjs} +4 -4
  4. package/dist/SdkPreviewModeRuntime-IJDHTW4W.mjs +8 -0
  5. package/dist/_dts/ai/src/contracts/proposals.d.ts +36 -0
  6. package/dist/_dts/api/src/contentRuntime.d.ts +1 -0
  7. package/dist/_dts/api/src/endpoints.d.ts +9 -0
  8. package/dist/_dts/api/src/index.d.ts +3 -3
  9. package/dist/_dts/api/src/public/types.d.ts +1 -1
  10. package/dist/_dts/api/src/request.d.ts +3 -11
  11. package/dist/_dts/api/src/sdkConfig/contracts.d.ts +1 -0
  12. package/dist/_dts/api/src/sdkContracts.d.ts +7 -1
  13. package/dist/_dts/api/src/siteManagementEndpoints.d.ts +10 -0
  14. package/dist/_dts/api/src/sitePlatformEndpoints.d.ts +1 -0
  15. package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +15 -19
  16. package/dist/_dts/api/src/types.d.ts +11 -26
  17. package/dist/_dts/block-form/src/fields/types.d.ts +6 -0
  18. package/dist/_dts/block-form/src/widgets/RepeaterField/components/RepeaterList.d.ts +3 -2
  19. package/dist/_dts/block-form/src/widgets/RepeaterField/components/RepeaterRow.d.ts +6 -3
  20. package/dist/_dts/block-form/src/widgets/RepeaterField/components/RepeaterRowActions.d.ts +8 -3
  21. package/dist/_dts/block-form/src/widgets/RepeaterField/hooks/index.d.ts +1 -1
  22. package/dist/_dts/block-form/src/widgets/RepeaterField/hooks/useLinearRepeaterDnd.d.ts +1 -0
  23. package/dist/_dts/block-form/src/widgets/RepeaterField/hooks/useRepeaterPointerDragCapability.d.ts +1 -0
  24. package/dist/_dts/block-form/src/widgets/RepeaterField/hooks/useResolvedItemLabel.d.ts +7 -0
  25. package/dist/_dts/block-form/src/widgets/RepeaterField/utils/buildSummary.d.ts +1 -0
  26. package/dist/_dts/block-form/src/widgets/RepeaterField/utils/index.d.ts +3 -1
  27. package/dist/_dts/block-form/src/widgets/RepeaterField/utils/repeaterDndDomain.d.ts +1 -1
  28. package/dist/_dts/block-form/src/widgets/RepeaterField/utils/repeaterLabelSource.d.ts +15 -0
  29. package/dist/_dts/block-form/src/widgets/RepeaterField/utils/repeaterRowActionsDomain.d.ts +50 -0
  30. package/dist/_dts/blocks/src/system/blocks/appointment-booking.d.ts +591 -0
  31. package/dist/_dts/blocks/src/system/blocks/blog-listing.d.ts +591 -0
  32. package/dist/_dts/blocks/src/system/blocks/cart.d.ts +591 -0
  33. package/dist/_dts/blocks/src/system/blocks/checkout.d.ts +591 -0
  34. package/dist/_dts/blocks/src/system/blocks/collection.d.ts +591 -0
  35. package/dist/_dts/blocks/src/system/blocks/faq.d.ts +591 -0
  36. package/dist/_dts/blocks/src/system/blocks/gifting.d.ts +591 -0
  37. package/dist/_dts/blocks/src/system/blocks/location-map.d.ts +2 -0
  38. package/dist/_dts/blocks/src/system/blocks/media-text.d.ts +47 -0
  39. package/dist/_dts/blocks/src/system/blocks/product-detail.d.ts +591 -0
  40. package/dist/_dts/blocks/src/system/blocks/product-list.d.ts +591 -0
  41. package/dist/_dts/blocks/src/system/blocks/shop.d.ts +591 -0
  42. package/dist/_dts/blocks/src/system/blocks/team-members.d.ts +3 -0
  43. package/dist/_dts/blocks/src/system/manifest/schema.d.ts +164 -0
  44. package/dist/_dts/blocks/src/system/runtime/hooks/useHeadlessBookingFlow.state.d.ts +1 -1
  45. package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.headless.state.d.ts +1 -1
  46. package/dist/_dts/content-editor/src/index.d.ts +1 -1
  47. package/dist/_dts/content-editor/src/ui/editorSnapshot.d.ts +2 -2
  48. package/dist/_dts/content-model/src/content-types/schema.d.ts +14 -0
  49. package/dist/_dts/content-model/src/templates/bindingTypeCompatibility.d.ts +3 -1
  50. package/dist/_dts/content-model/src/templates/bindingValidation.d.ts +10 -4
  51. package/dist/_dts/content-model/src/templates/fieldPaths.d.ts +20 -0
  52. package/dist/_dts/content-model/src/templates/manifestAdapter.d.ts +5 -2
  53. package/dist/_dts/core/src/branded.d.ts +108 -85
  54. package/dist/_dts/core/src/csv-types.d.ts +2 -2
  55. package/dist/_dts/core/src/editor-state.d.ts +7 -7
  56. package/dist/_dts/core/src/participants.d.ts +2 -2
  57. package/dist/_dts/db/src/generated/supabase/database.types.d.ts +11 -0
  58. package/dist/_dts/editor-blocks/src/blockPayload.d.ts +1 -1
  59. package/dist/_dts/media-editor/src/MediaEditor.d.ts +3 -1
  60. package/dist/_dts/media-editor/src/MediaPreview.d.ts +3 -1
  61. package/dist/_dts/media-editor/src/fieldUi.d.ts +5 -0
  62. package/dist/_dts/media-editor/src/index.d.ts +1 -1
  63. package/dist/_dts/sdk/src/cli/commands/push/consts.d.ts +1 -1
  64. package/dist/_dts/sdk/src/cli/commands/push/metadata.d.ts +2 -0
  65. package/dist/_dts/sdk/src/cli/commands/push/stale.d.ts +3 -3
  66. package/dist/_dts/sdk/src/cli/commands/push-execute.d.ts +7 -0
  67. package/dist/_dts/sdk/src/cli/commands/push.d.ts +2 -0
  68. package/dist/_dts/sdk/src/cli/content/reader.d.ts +13 -0
  69. package/dist/_dts/sdk/src/cli/content/writer.d.ts +2 -1
  70. package/dist/_dts/sdk/src/cli/helpers.d.ts +2 -0
  71. package/dist/_dts/sdk/src/cli/site-commands/commandKeys.d.ts +6 -6
  72. package/dist/_dts/sdk/src/cli/site-commands/commandRuntime.d.ts +5 -0
  73. package/dist/_dts/sdk/src/cli/site-commands/commandSurfaceDispatch.d.ts +4 -0
  74. package/dist/_dts/sdk/src/cli/site-commands/pageCommands.d.ts +5 -2
  75. package/dist/_dts/sdk/src/cli/site-commands/pushExecution.d.ts +10 -1
  76. package/dist/_dts/sdk/src/cli/site-commands/pushExecutionTypes.d.ts +1 -1
  77. package/dist/_dts/sdk/src/client/management/types.d.ts +6 -0
  78. package/dist/_dts/sdk/src/client/types.d.ts +2 -2
  79. package/dist/_dts/sdk/src/config/content-types.d.ts +7 -0
  80. package/dist/_dts/sdk/src/config/field-definitions.d.ts +2 -0
  81. package/dist/_dts/sdk/src/version.d.ts +1 -1
  82. package/dist/_dts/site-commands/src/commands.d.ts +3 -0
  83. package/dist/{altcha-B5XGSXP5.mjs → altcha-EKUEQ4RP.mjs} +1 -1
  84. package/dist/{chunk-NIDXI46P.mjs → chunk-4QEGTLK6.mjs} +1 -1
  85. package/dist/{chunk-TXDES5P2.mjs → chunk-6HYXHRAI.mjs} +5 -5
  86. package/dist/{chunk-SVMMM2NA.mjs → chunk-CR5HKAGU.mjs} +24 -5
  87. package/dist/{chunk-OECWLDHN.mjs → chunk-MCRQMPET.mjs} +1030 -588
  88. package/dist/{chunk-SXOLGNMX.mjs → chunk-OKMBEAXY.mjs} +1 -1
  89. package/dist/{chunk-XGB3TDIC.mjs → chunk-R7POPVJR.mjs} +2 -8
  90. package/dist/{chunk-F7RTCZYN.mjs → chunk-RGTOD4AJ.mjs} +20 -14
  91. package/dist/cli/index.mjs +681 -225
  92. package/dist/cli/init-docs/content/cli-reference.md +3 -2
  93. package/dist/cli/init-docs/content/content-management.md +2 -2
  94. package/dist/cli/init-docs/content/workflow-preview-mode.md +68 -2
  95. package/dist/client/{accordion-EVDEOUPR.mjs → accordion-PLYNJIIM.mjs} +2 -2
  96. package/dist/client/analytics.mjs +1 -1
  97. package/dist/client/{bookingForm-DIHBLC64.mjs → bookingForm-BXAP6AO7.mjs} +55 -48
  98. package/dist/client/bookings.mjs +62 -55
  99. package/dist/client/{carousel-FEBQHIWI.mjs → carousel-TRBXDHGF.mjs} +3 -3
  100. package/dist/client/{cart-7CKSXAE4.mjs → cart-Z7H3HJRS.mjs} +7 -7
  101. package/dist/client/{checkout-WKYCANLV.mjs → checkout-WAFCUBIX.mjs} +7 -7
  102. package/dist/client/{chunk-OFMSCGNY.mjs → chunk-75OUS5MT.mjs} +2 -2
  103. package/dist/client/{chunk-IVNCUVAV.mjs → chunk-AUJ5DBZJ.mjs} +18 -18
  104. package/dist/client/{chunk-36WJCERQ.mjs → chunk-CE7IBGVW.mjs} +3 -1
  105. package/dist/client/{chunk-RZDWX7QW.mjs → chunk-CWGTG37I.mjs} +1 -1
  106. package/dist/client/{chunk-YDSEG6GZ.mjs → chunk-DNRGY432.mjs} +2 -2
  107. package/dist/client/{chunk-RV6FX7UH.mjs → chunk-FUXW6VW2.mjs} +9 -9
  108. package/dist/client/{chunk-65F47D7Y.mjs → chunk-JGXPTEI2.mjs} +43 -36
  109. package/dist/client/{chunk-GUK2FPXQ.mjs → chunk-JRDUHZCT.mjs} +37 -15
  110. package/dist/client/{chunk-VPPMNXCF.mjs → chunk-UVQEJJTN.mjs} +2 -2
  111. package/dist/client/{chunk-F7LHOKEH.mjs → chunk-XSV6KW4D.mjs} +1 -1
  112. package/dist/client/{chunk-PD6NBCEY.mjs → chunk-ZFHRN6W2.mjs} +1 -1
  113. package/dist/client/{chunk-2SAVKN2M.mjs → chunk-ZI3LLBPZ.mjs} +2 -2
  114. package/dist/client/client.mjs +249 -160
  115. package/dist/client/{courseRegistration-5QF2PHKM.mjs → courseRegistration-AHFQHWIJ.mjs} +10 -10
  116. package/dist/client/{eventCalendar-4ZOSETDU.mjs → eventCalendar-LDXTV5R7.mjs} +9 -9
  117. package/dist/client/{eventCombined-WQGU7JUX.mjs → eventCombined-A4JGTNJO.mjs} +9 -9
  118. package/dist/client/{eventDetails-AYWVUJ5Y.mjs → eventDetails-4YXTZ7EG.mjs} +9 -9
  119. package/dist/client/{eventListing-NT7C6UT5.mjs → eventListing-P72TPFFM.mjs} +9 -9
  120. package/dist/client/{eventRegistration-OH24F4ZJ.mjs → eventRegistration-LSYJHGMT.mjs} +9 -9
  121. package/dist/client/{form-7L42SRBB.mjs → form-AOPYOKOW.mjs} +6 -3
  122. package/dist/client/{headerSection-OZRZNZ52.mjs → headerSection-5TFYDFVQ.mjs} +3 -3
  123. package/dist/client/hooks.mjs +78 -48
  124. package/dist/client/{locationMap-ZBXRPQ7C.mjs → locationMap-QSZ3ZVAZ.mjs} +3 -3
  125. package/dist/client/{newsletterForm-SNAGFF2I.mjs → newsletterForm-KTRHZY52.mjs} +2 -2
  126. package/dist/client/{productDetail-I46BOFGV.mjs → productDetail-N4E775RG.mjs} +7 -7
  127. package/dist/client/{productList-BOYHTYI6.mjs → productList-UGUQ2S45.mjs} +7 -7
  128. package/dist/client/rendering/client.mjs +173 -131
  129. package/dist/client/rendering/islands.mjs +19 -19
  130. package/dist/client/rendering.mjs +230 -150
  131. package/dist/client/{shop-XTXPZTKR.mjs → shop-VHSZEEQ2.mjs} +7 -7
  132. package/dist/preview-next/before-render.mjs +10 -1
  133. package/dist/preview-next/client/runtime.mjs +6 -6
  134. package/dist/preview-next/middleware.mjs +10 -1
  135. package/dist/preview-next/tailwind-sources.css +1 -0
  136. package/dist/sdk-runtime-WHPJEF5G.mjs +8 -0
  137. package/dist/server/components.mjs +101 -54
  138. package/dist/server/config-template-validation.mjs +221 -15
  139. package/dist/server/config-validation.mjs +76 -42
  140. package/dist/server/config.mjs +76 -42
  141. package/dist/server/data.mjs +77 -47
  142. package/dist/server/index.mjs +31 -10
  143. package/dist/server/next.mjs +133 -71
  144. package/dist/server/page-converter.mjs +60 -40
  145. package/dist/server/prebuild.mjs +1 -1
  146. package/dist/server/rendering/server.mjs +107 -60
  147. package/dist/server/rendering.mjs +111 -61
  148. package/dist/server/routing.mjs +93 -63
  149. package/dist/server/server.mjs +102 -57
  150. package/package.json +1 -1
  151. package/dist/SdkPreviewModeRuntime-LAGYMPNF.mjs +0 -8
  152. package/dist/sdk-runtime-ZJLKC6DR.mjs +0 -8
@@ -7,7 +7,7 @@ import type { compileNavigationPushCommands, NavigationCommandExecutionReport }
7
7
  import type { compilePagePushCommands, PageCommandExecutionReport } from './pageCommands';
8
8
  export type CommandSurface = 'entry' | 'page' | 'form' | 'navigation';
9
9
  export type CommandSurfaceFailurePolicy = 'continue' | 'stop';
10
- export type ContentPushScope = Extract<PushScope, 'entries' | 'pages' | 'navigation' | 'forms' | 'all'>;
10
+ export type ContentPushScope = Extract<PushScope, 'entries' | 'pages' | 'navigation' | 'forms' | 'settings' | 'all'>;
11
11
  export type ResidualSettingsPushPlan = Readonly<{
12
12
  diff: ResidualSettingsDiff;
13
13
  local: ResidualSettingsLocalContent;
@@ -39,12 +39,14 @@ export interface ManagementEntry {
39
39
  createdAt: string;
40
40
  updatedAt: string;
41
41
  publishedAt: string | null;
42
+ manualOrder: number;
42
43
  }
43
44
  export interface EntryUpsertInput {
44
45
  identifier: string;
45
46
  contentType: string;
46
47
  data: Record<string, unknown>;
47
48
  slug?: string;
49
+ manualOrder?: number;
48
50
  }
49
51
  export interface ManagementPage {
50
52
  id: string;
@@ -534,9 +536,11 @@ export interface PulledEntries {
534
536
  * Canonical entry title (route title for routable content types).
535
537
  */
536
538
  title: string;
539
+ manualOrder?: number;
537
540
  }>;
538
541
  meta: {
539
542
  pulledAt: string;
543
+ manualOrder?: string[];
540
544
  entries: Record<string, {
541
545
  createdAt: string;
542
546
  updatedAt: string;
@@ -586,6 +590,7 @@ export interface PulledSettings {
586
590
  warnings?: string[];
587
591
  meta: {
588
592
  pulledAt: string;
593
+ updatedAt: string | null;
589
594
  };
590
595
  }
591
596
  export interface PulledForms {
@@ -734,6 +739,7 @@ export interface PulledContent {
734
739
  courses?: PulledCourses['courses'];
735
740
  meta: {
736
741
  pulledAt: string;
742
+ settingsUpdatedAt?: string | null;
737
743
  /** Whether the response was truncated due to size limits */
738
744
  truncated?: boolean;
739
745
  /** Message explaining what was truncated */
@@ -60,8 +60,8 @@ export interface GetEntriesBaseParams extends SdkMethodOptions {
60
60
  limit?: number;
61
61
  /** Number of entries to skip for pagination */
62
62
  offset?: number;
63
- /** Sort order for entries. 'order' uses custom ordering (default behavior). */
64
- order?: 'newest' | 'oldest' | 'title' | 'order';
63
+ /** Sort order for entries. Use 'manual' for content types that opt into manual ordering. */
64
+ order?: 'newest' | 'oldest' | 'title' | 'manual';
65
65
  /** If true, includes draft entries (requires API key with site access) */
66
66
  preview?: boolean;
67
67
  /** Selection mode: 'query' for automatic, 'manual' for specific entry IDs */
@@ -150,6 +150,13 @@ export interface ContentTypeConfig {
150
150
  fields: FieldDefinition[];
151
151
  /** Field ID to use as the entry title source */
152
152
  titleField?: string;
153
+ /**
154
+ * Entry ordering behavior. Set `mode: 'manual'` to allow editors and SDK
155
+ * content metadata to curate entry order for this content type.
156
+ */
157
+ ordering?: {
158
+ mode?: 'default' | 'manual';
159
+ };
153
160
  /**
154
161
  * When true, only one entry can exist for this content type.
155
162
  * The entry is auto-created when the content type is created.
@@ -35,6 +35,8 @@ export type FieldUi = Partial<{
35
35
  mediaPickerAutoOpen: boolean;
36
36
  showMediaPreview: boolean;
37
37
  showMediaOverlayActions: boolean;
38
+ mediaPreviewMaxWidth: 'xs' | 'sm' | 'md' | 'none';
39
+ preventMediaPreviewUpscale: boolean;
38
40
  mediaDelivery: MediaDeliveryOptions;
39
41
  mediaDeliveryByVariant: Record<string, MediaDeliveryOptions>;
40
42
  inputType: 'text' | 'email' | 'tel' | 'number';
@@ -8,4 +8,4 @@
8
8
  * 1. This constant
9
9
  * 2. The "version" field in package.json
10
10
  */
11
- export declare const SDK_VERSION = "0.78.0";
11
+ export declare const SDK_VERSION = "0.78.2";
@@ -268,6 +268,7 @@ export declare const upsertContentEntryCommandSchema: z.ZodObject<{
268
268
  contentTypeKey: z.ZodString;
269
269
  slug: z.ZodOptional<z.ZodString>;
270
270
  title: z.ZodOptional<z.ZodString>;
271
+ manualOrder: z.ZodOptional<z.ZodNumber>;
271
272
  data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
272
273
  linkedSubjectRef: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContentEntryRef, string>>>;
273
274
  mediaRefs: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<MediaRef, string>>>>>;
@@ -1166,6 +1167,7 @@ export declare const siteCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1166
1167
  contentTypeKey: z.ZodString;
1167
1168
  slug: z.ZodOptional<z.ZodString>;
1168
1169
  title: z.ZodOptional<z.ZodString>;
1170
+ manualOrder: z.ZodOptional<z.ZodNumber>;
1169
1171
  data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1170
1172
  linkedSubjectRef: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContentEntryRef, string>>>;
1171
1173
  mediaRefs: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<MediaRef, string>>>>>;
@@ -1999,6 +2001,7 @@ export declare const siteCommandBatchSchema: z.ZodObject<{
1999
2001
  contentTypeKey: z.ZodString;
2000
2002
  slug: z.ZodOptional<z.ZodString>;
2001
2003
  title: z.ZodOptional<z.ZodString>;
2004
+ manualOrder: z.ZodOptional<z.ZodNumber>;
2002
2005
  data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2003
2006
  linkedSubjectRef: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContentEntryRef, string>>>;
2004
2007
  mediaRefs: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<MediaRef, string>>>>>;
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import './chunk-XGB3TDIC.mjs';
2
+ import './chunk-R7POPVJR.mjs';
3
3
 
4
4
  // ../../node_modules/.pnpm/altcha@1.5.1/node_modules/altcha/dist/altcha.js
5
5
  var Ri = Object.defineProperty;
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { assertNever2, deriveNearestCompatibleHeaderStyle, findLegacyHeaderLookIdForSelection, compileSiteThemeFromSelections, footerLookCatalog, getOrderedHeaderStyleIdsForLayout, getOrderedHeaderLayoutIdsForCuration, footerLookRejectionReasonLabel, getHeaderStyle, getHeaderLayout, writePlanForLookCustomizationCommand, siteStyleIdFromTheme, getCuratedSiteStyle } from './chunk-OECWLDHN.mjs';
2
+ import { assertNever2, deriveNearestCompatibleHeaderStyle, findLegacyHeaderLookIdForSelection, compileSiteThemeFromSelections, footerLookCatalog, getOrderedHeaderStyleIdsForLayout, getOrderedHeaderLayoutIdsForCuration, footerLookRejectionReasonLabel, getHeaderStyle, getHeaderLayout, writePlanForLookCustomizationCommand, siteStyleIdFromTheme, getCuratedSiteStyle } from './chunk-MCRQMPET.mjs';
3
3
  import { createContext, useState, useCallback, useMemo, useContext, useRef, useEffect } from 'react';
4
4
  import { jsx } from 'react/jsx-runtime';
5
5
 
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- import { assertNever2, useOptionalEditorUiStoreInstance, getPageDesignEditorState, PAGE_DESIGN_EDITOR_STATE_FETCH_ERROR_MESSAGE, useDebouncedLatestSave, applyPageDesignEditorAction, asEditorBlockId, asEditorBlockValues, resolvePreviewSidebarTab, systemCustomizeFacetDefinitionForBlock, systemCustomizeFacetRollbackContentPatch, systemCustomizeFacetApplyContentPatch, createHistoryState, redoHistory, undoHistory, pushHistoryEntry, canRedoHistory, canUndoHistory, planPageDesignLayoutLookCompatibility } from './chunk-OECWLDHN.mjs';
3
- import { ApiRequestError, resolveSurfaceDocumentAttributes, SURFACE_DOCUMENT_DATA_ATTRIBUTE, SURFACE_IDS } from './chunk-SVMMM2NA.mjs';
2
+ import { assertNever2, useOptionalEditorUiStoreInstance, getPageDesignEditorState, PAGE_DESIGN_EDITOR_STATE_FETCH_ERROR_MESSAGE, useDebouncedLatestSave, applyPageDesignEditorAction, unsafeAsEditorBlockId, unsafeAsEditorBlockValues, resolvePreviewSidebarTab, systemCustomizeFacetDefinitionForBlock, systemCustomizeFacetRollbackContentPatch, systemCustomizeFacetApplyContentPatch, createHistoryState, redoHistory, undoHistory, pushHistoryEntry, canRedoHistory, canUndoHistory, planPageDesignLayoutLookCompatibility } from './chunk-MCRQMPET.mjs';
3
+ import { ApiRequestError, resolveSurfaceDocumentAttributes, SURFACE_DOCUMENT_DATA_ATTRIBUTE, SURFACE_IDS } from './chunk-CR5HKAGU.mjs';
4
4
  import { createContext, useState, useRef, useEffect, useMemo, useContext } from 'react';
5
5
  import { jsx } from 'react/jsx-runtime';
6
6
 
@@ -1080,11 +1080,11 @@ function blockIdForRuntimePatch(action) {
1080
1080
  }
1081
1081
  }
1082
1082
  function currentLocalBlockContent(uiStore, targetBlockId) {
1083
- const current = uiStore.getState().drafts.getCurrentValues(asEditorBlockId(targetBlockId));
1083
+ const current = uiStore.getState().drafts.getCurrentValues(unsafeAsEditorBlockId(targetBlockId));
1084
1084
  return isRecord(current) ? current : null;
1085
1085
  }
1086
1086
  function replaceLocalBlockContentWithoutHistory(uiStore, targetBlockId, nextContent) {
1087
- const editorBlockId = asEditorBlockId(targetBlockId);
1087
+ const editorBlockId = unsafeAsEditorBlockId(targetBlockId);
1088
1088
  const history = uiStore.getState().history;
1089
1089
  const snapshot = history.getState().present;
1090
1090
  const draft = snapshot.drafts[editorBlockId];
@@ -1095,7 +1095,7 @@ function replaceLocalBlockContentWithoutHistory(uiStore, targetBlockId, nextCont
1095
1095
  ...snapshot.drafts,
1096
1096
  [editorBlockId]: {
1097
1097
  ...draft,
1098
- current: asEditorBlockValues(nextContent)
1098
+ current: unsafeAsEditorBlockValues(nextContent)
1099
1099
  }
1100
1100
  }
1101
1101
  });
@@ -2034,7 +2034,16 @@ var ENDPOINT_DEFINITIONS = {
2034
2034
  revalidate: 60,
2035
2035
  tags: ["site-{siteId}", "content-{siteId}-{type}"],
2036
2036
  auth: "user",
2037
- responseKind: "json"
2037
+ responseKind: "json",
2038
+ errors: ["validation:invalid_input", "resource:not_found", "resource:conflict", "server:internal_error"]
2039
+ },
2040
+ reorderContentEntries: {
2041
+ path: "/sites/{siteId}/content/{type}/order",
2042
+ method: "POST",
2043
+ tags: ["site-{siteId}", "content-{siteId}-{type}"],
2044
+ auth: "user",
2045
+ responseKind: "json",
2046
+ errors: ["validation:invalid_input", "resource:not_found", "resource:conflict", "server:internal_error"]
2038
2047
  },
2039
2048
  getContentTemplate: {
2040
2049
  path: "/sites/{siteId}/content/types/{type}/template",
@@ -6595,18 +6604,21 @@ function buildEndpointURL(baseURL, endpoint) {
6595
6604
  function isFormDataBody(value) {
6596
6605
  return typeof FormData !== "undefined" && value instanceof FormData;
6597
6606
  }
6607
+ function isUnknownArray(value) {
6608
+ return Array.isArray(value);
6609
+ }
6598
6610
  function appendQueryParam(queryParams, key, value) {
6599
6611
  if (value === void 0 || value === null) {
6600
6612
  return;
6601
6613
  }
6602
- if (Array.isArray(value)) {
6614
+ if (isUnknownArray(value)) {
6603
6615
  const stack = [...value].reverse();
6604
6616
  while (stack.length > 0) {
6605
6617
  const item = stack.pop();
6606
6618
  if (item === void 0 || item === null) {
6607
6619
  continue;
6608
6620
  }
6609
- if (Array.isArray(item)) {
6621
+ if (isUnknownArray(item)) {
6610
6622
  stack.push(...[...item].reverse());
6611
6623
  continue;
6612
6624
  }
@@ -6616,6 +6628,12 @@ function appendQueryParam(queryParams, key, value) {
6616
6628
  }
6617
6629
  queryParams.append(key, String(value));
6618
6630
  }
6631
+ function serializePathParam(endpoint, key, value) {
6632
+ if (typeof value === "string") {
6633
+ return value;
6634
+ }
6635
+ throw new Error(`Invalid path param for endpoint ${String(endpoint)}: ${key} must be a string`);
6636
+ }
6619
6637
  function invalidateCacheTags(tags, params) {
6620
6638
  const resolved = getRevalidateTag();
6621
6639
  if (typeof window !== "undefined" || !resolved || !tags) return;
@@ -6754,8 +6772,9 @@ function createRawCMSClient(headers = {}, baseUrl) {
6754
6772
  const bracePlaceholder = `{${key}}`;
6755
6773
  const colonPlaceholder = `:${key}`;
6756
6774
  if (originalPath.includes(bracePlaceholder) || originalPath.includes(colonPlaceholder)) {
6757
- url = url.replace(bracePlaceholder, value);
6758
- url = url.replace(colonPlaceholder, value);
6775
+ const stringValue = serializePathParam(endpoint, key, value);
6776
+ url = url.replace(bracePlaceholder, stringValue);
6777
+ url = url.replace(colonPlaceholder, stringValue);
6759
6778
  } else {
6760
6779
  unusedParams[key] = value;
6761
6780
  }