@riverbankcms/sdk 0.91.0 → 0.93.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 (118) hide show
  1. package/dist/{PreviewEditorSidebar-3TT47WCF.mjs → PreviewEditorSidebar-D3PAF7NW.mjs} +3 -3
  2. package/dist/{PreviewEditorUI-ORCLLUNZ.mjs → PreviewEditorUI-G5JVJEIJ.mjs} +3 -3
  3. package/dist/SdkPreviewModeRuntime-NHTLRNQD.mjs +8 -0
  4. package/dist/_dts/api/src/bookingConfig.d.ts +13 -1
  5. package/dist/_dts/api/src/bookingOperations.d.ts +1 -0
  6. package/dist/_dts/api/src/bookingRefundOutcomes.d.ts +6 -6
  7. package/dist/_dts/api/src/common/envelope.d.ts +10 -0
  8. package/dist/_dts/api/src/customerMembershipOutcomes.d.ts +4 -4
  9. package/dist/_dts/api/src/index.d.ts +2 -2
  10. package/dist/_dts/api/src/publicExperienceEndpoints.d.ts +6 -0
  11. package/dist/_dts/api/src/request.d.ts +1 -1
  12. package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +32 -0
  13. package/dist/_dts/blocks/src/system/blocks/courses/shared/pricing.d.ts +12 -1
  14. package/dist/_dts/blocks/src/system/blocks/courses/shared/schemas.d.ts +12 -0
  15. package/dist/_dts/blocks/src/system/blocks/courses/shared/types.d.ts +4 -1
  16. package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +44 -0
  17. package/dist/_dts/blocks/src/system/manifest/fieldValidation/index.d.ts +8 -0
  18. package/dist/_dts/blocks/src/system/runtime/api/types.d.ts +8 -1
  19. package/dist/_dts/blocks/src/system/runtime/hooks/useHeadlessBookingFlow.d.ts +8 -1
  20. package/dist/_dts/blocks/src/system/runtime/hooks/useHeadlessBookingFlow.state.d.ts +1 -0
  21. package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.headless.state.d.ts +4 -0
  22. package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.interactive.d.ts +40 -0
  23. package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.reserved-fields.d.ts +1 -1
  24. package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.state.d.ts +29 -0
  25. package/dist/_dts/blocks/src/system/runtime/nodes/booking-runtime-sources.d.ts +1 -0
  26. package/dist/_dts/blocks/src/system/runtime/nodes/course-registration/components.d.ts +6 -0
  27. package/dist/_dts/blocks/src/system/runtime/nodes/course-registration/useCourseRegistrationWizard.d.ts +8 -0
  28. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/TicketSelectionStep.d.ts +8 -0
  29. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/hooks.d.ts +1 -0
  30. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/types.d.ts +1 -1
  31. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationSubmit.d.ts +1 -0
  32. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationWizard.d.ts +9 -0
  33. package/dist/_dts/content-editor/src/controller/EntryControllerProvider.d.ts +14 -14
  34. package/dist/_dts/content-editor/src/controller/useEntrySyncHelpers.d.ts +1 -1
  35. package/dist/_dts/content-editor/src/hooks/useEntryActions.d.ts +5 -15
  36. package/dist/_dts/content-editor/src/ui/editorSnapshot.d.ts +46 -0
  37. package/dist/_dts/content-editor/src/ui/editorUiStore.d.ts +43 -36
  38. package/dist/_dts/content-model/src/entry-slots/types.d.ts +110 -2
  39. package/dist/_dts/core/src/branded.d.ts +3 -0
  40. package/dist/_dts/core/src/event-pricing.d.ts +18 -1
  41. package/dist/_dts/core/src/money-input.d.ts +34 -4
  42. package/dist/_dts/db/src/generated/supabase/database.types.d.ts +70 -0
  43. package/dist/_dts/media-core/src/fileAssetCompatibility.d.ts +1 -1
  44. package/dist/_dts/media-core/src/filePersistence.d.ts +5 -1
  45. package/dist/_dts/media-core/src/fileStorage.d.ts +1 -0
  46. package/dist/_dts/media-core/src/fileUploadFinalization.d.ts +29 -1
  47. package/dist/_dts/media-core/src/index.d.ts +1 -0
  48. package/dist/_dts/media-core/src/legacyMediaValue.d.ts +11 -0
  49. package/dist/_dts/media-core/src/videoPrep.d.ts +15 -6
  50. package/dist/_dts/media-core/src/videoSlotPolicy.d.ts +5 -5
  51. package/dist/_dts/media-react/src/hooks/useApiMediaUploader.d.ts +2 -1
  52. package/dist/_dts/sdk/src/cli/commands/push/execute/diff.d.ts +2 -0
  53. package/dist/_dts/sdk/src/cli/commands/push/execute/localMediaReporting.d.ts +23 -0
  54. package/dist/_dts/sdk/src/cli/commands/push/scopes/commandBackedDatedOfferingScope.d.ts +54 -0
  55. package/dist/_dts/sdk/src/cli/commands/push/scopes/mediaPrep.d.ts +7 -2
  56. package/dist/_dts/sdk/src/cli/commands/push/scopes/types.d.ts +6 -0
  57. package/dist/_dts/sdk/src/cli/media/local-sync.d.ts +35 -0
  58. package/dist/_dts/sdk/src/rendering/islands/types.d.ts +23 -1
  59. package/dist/_dts/sdk/src/version.d.ts +1 -1
  60. package/dist/{chunk-GDT2QGIL.mjs → chunk-A63UXN3P.mjs} +21 -19
  61. package/dist/{chunk-U5YM4AWE.mjs → chunk-AJZGT6YG.mjs} +1 -1
  62. package/dist/{chunk-AFPMCLS7.mjs → chunk-AQ6RT6LZ.mjs} +2 -2
  63. package/dist/{chunk-ZA2S7H34.mjs → chunk-NT76QGIJ.mjs} +98 -1
  64. package/dist/{chunk-RQUZYSES.mjs → chunk-PCNCETBI.mjs} +1196 -426
  65. package/dist/{chunk-S3YHJWEU.mjs → chunk-XIK2HYI3.mjs} +7 -7
  66. package/dist/cli/index.mjs +749 -166
  67. package/dist/client/{accordion-AFX37652.mjs → accordion-RNQIPG55.mjs} +2 -2
  68. package/dist/client/{bookingForm-32V5QCOW.mjs → bookingForm-HYEEVRLP.mjs} +89 -14
  69. package/dist/client/bookings.mjs +243 -17
  70. package/dist/client/{carousel-TJGQJ7ER.mjs → carousel-W7DQ3YPU.mjs} +3 -3
  71. package/dist/client/{cart-JUU2JEW4.mjs → cart-PXJ3SXXO.mjs} +7 -7
  72. package/dist/client/{checkout-RD6BTFX4.mjs → checkout-X3JYSOXI.mjs} +7 -7
  73. package/dist/client/{chunk-MLBNVN4H.mjs → chunk-6SYGVVWA.mjs} +67 -4
  74. package/dist/client/{chunk-E6VIWZUG.mjs → chunk-DUOHLWLF.mjs} +3 -3
  75. package/dist/client/{chunk-6QZIBNGV.mjs → chunk-IXDSXF2D.mjs} +154 -16
  76. package/dist/client/{chunk-CKXEUWWA.mjs → chunk-J6TMMMXW.mjs} +3 -3
  77. package/dist/client/{chunk-PMNAV6LO.mjs → chunk-JNE6UI6U.mjs} +7 -6
  78. package/dist/client/{chunk-ISAUXU5R.mjs → chunk-OLAOAZEO.mjs} +1 -1
  79. package/dist/client/{chunk-RWYFG625.mjs → chunk-PCHACQEB.mjs} +30 -2
  80. package/dist/client/{chunk-FMZZHAIR.mjs → chunk-PICR3NTQ.mjs} +52 -5
  81. package/dist/client/{chunk-6RN62XBV.mjs → chunk-Q47XGAGS.mjs} +1 -1
  82. package/dist/client/{chunk-WHZQDPBZ.mjs → chunk-TNGL2WJF.mjs} +1 -0
  83. package/dist/client/{chunk-C4LP6BPG.mjs → chunk-WERRJXNJ.mjs} +1 -1
  84. package/dist/client/{chunk-RMOFBBNA.mjs → chunk-YYVGSYBO.mjs} +6 -6
  85. package/dist/client/client.mjs +641 -54
  86. package/dist/client/{courseRegistration-X63QAIVV.mjs → courseRegistration-QZ67PVHO.mjs} +111 -11
  87. package/dist/client/{eventCalendar-5T24GCZL.mjs → eventCalendar-V3BDHQNT.mjs} +9 -9
  88. package/dist/client/{eventCombined-AZVTF22X.mjs → eventCombined-XYFRN2RG.mjs} +9 -9
  89. package/dist/client/{eventDetails-7GPFNLGF.mjs → eventDetails-TFE5TWKV.mjs} +9 -9
  90. package/dist/client/{eventListing-QEUMTMUM.mjs → eventListing-IQ6AGWZ6.mjs} +9 -9
  91. package/dist/client/{eventRegistration-P2EDKCQZ.mjs → eventRegistration-WGJVFKQJ.mjs} +9 -9
  92. package/dist/client/{form-NUJ7H4IN.mjs → form-6UZY6RUA.mjs} +3 -3
  93. package/dist/client/{headerSection-JB7LECPL.mjs → headerSection-RSFXY6V3.mjs} +3 -3
  94. package/dist/client/hooks.mjs +57 -5
  95. package/dist/client/{locationMap-UEYWUCSW.mjs → locationMap-24FH67I4.mjs} +3 -3
  96. package/dist/client/{newsletterForm-S2YZQ2X7.mjs → newsletterForm-QVL3MLTN.mjs} +3 -3
  97. package/dist/client/{productDetail-H5MADGG7.mjs → productDetail-ZDYN3G4T.mjs} +7 -7
  98. package/dist/client/{productList-DK7YON7H.mjs → productList-4BMJLQHZ.mjs} +7 -7
  99. package/dist/client/rendering/client.mjs +503 -36
  100. package/dist/client/rendering/islands.mjs +19 -19
  101. package/dist/client/rendering.mjs +583 -39
  102. package/dist/client/{shop-6PA7RDRJ.mjs → shop-U5C634FF.mjs} +7 -7
  103. package/dist/preview-next/client/runtime.mjs +5 -5
  104. package/dist/{sdk-runtime-JP5347OB.mjs → sdk-runtime-VGV46WVB.mjs} +6 -6
  105. package/dist/server/components.mjs +287 -68
  106. package/dist/server/config-validation.mjs +58 -5
  107. package/dist/server/config.mjs +58 -5
  108. package/dist/server/data.mjs +57 -5
  109. package/dist/server/index.mjs +104 -29
  110. package/dist/server/next.mjs +347 -85
  111. package/dist/server/page-converter.mjs +22 -5
  112. package/dist/server/prebuild.mjs +1 -1
  113. package/dist/server/rendering/server.mjs +287 -68
  114. package/dist/server/rendering.mjs +287 -68
  115. package/dist/server/routing.mjs +131 -67
  116. package/dist/server/server.mjs +189 -94
  117. package/package.json +1 -1
  118. package/dist/SdkPreviewModeRuntime-GMCDQPZZ.mjs +0 -8
@@ -1,4 +1,4 @@
1
- import { type Result } from '../../core/src/index';
1
+ import { type Brand, type PositiveByteCount, type Result } from '../../core/src/index';
2
2
  export type VideoPrepIntent = {
3
3
  readonly tag: 'files-and-media';
4
4
  } | {
@@ -8,8 +8,8 @@ export type VideoPrepIntent = {
8
8
  };
9
9
  export type VideoPrepPolicy = {
10
10
  readonly intent: VideoPrepIntent;
11
- readonly maxRawByteCount: number;
12
- readonly maxDurationSeconds?: number;
11
+ readonly maxRawByteCount: PositiveByteCount;
12
+ readonly maxDurationSeconds?: PositiveVideoDurationSeconds;
13
13
  readonly targetMaxDimensionPixels: number;
14
14
  readonly stripAudio: boolean;
15
15
  readonly allowOriginalFallback: boolean;
@@ -20,6 +20,13 @@ export type VideoPrepSourceMetadata = {
20
20
  readonly width: number;
21
21
  readonly height: number;
22
22
  };
23
+ export type PositiveVideoDurationSeconds = Brand<number, 'PositiveVideoDurationSeconds'>;
24
+ export type ParsedVideoPrepSourceMetadata = {
25
+ readonly byteSize: PositiveByteCount;
26
+ readonly durationSeconds: PositiveVideoDurationSeconds;
27
+ readonly width: number;
28
+ readonly height: number;
29
+ };
23
30
  export type VideoPrepValidationError = {
24
31
  readonly tag: 'invalid-byte-size';
25
32
  readonly byteSize: number;
@@ -40,11 +47,12 @@ export type VideoPrepValidationError = {
40
47
  readonly height: number;
41
48
  };
42
49
  export declare const VIDEO_PREP_LIMITS: {
43
- readonly maxRawByteCount: number;
44
- readonly inlineContentMaxDurationSeconds: 60;
45
- readonly backgroundVideoMaxDurationSeconds: 30;
50
+ readonly maxRawByteCount: PositiveByteCount;
51
+ readonly inlineContentMaxDurationSeconds: PositiveVideoDurationSeconds;
52
+ readonly backgroundVideoMaxDurationSeconds: PositiveVideoDurationSeconds;
46
53
  readonly targetMaxDimensionPixels: 1080;
47
54
  };
55
+ export declare function asPositiveVideoDurationSeconds(value: number): Result<PositiveVideoDurationSeconds, 'not-positive-video-duration-seconds'>;
48
56
  /**
49
57
  * Derives the client-side video preparation rules for a concrete upload/use surface.
50
58
  */
@@ -55,4 +63,5 @@ export declare function deriveVideoPrepPolicy(intent: VideoPrepIntent): VideoPre
55
63
  * Checks cheap scalar invariants first, then policy limits, then dimensions so the
56
64
  * returned error points at the first user-actionable upload problem.
57
65
  */
66
+ export declare function parseVideoPrepSourceMetadata(source: VideoPrepSourceMetadata, policy: VideoPrepPolicy): Result<ParsedVideoPrepSourceMetadata, VideoPrepValidationError>;
58
67
  export declare function validateVideoPrepSource(source: VideoPrepSourceMetadata, policy: VideoPrepPolicy): Result<void, VideoPrepValidationError>;
@@ -1,4 +1,4 @@
1
- import { type VideoPrepIntent } from './videoPrep';
1
+ import { type PositiveVideoDurationSeconds, type VideoPrepIntent } from './videoPrep';
2
2
  export type VideoSlotPolicyIntent = Extract<VideoPrepIntent, {
3
3
  readonly tag: 'inline-content';
4
4
  } | {
@@ -6,7 +6,7 @@ export type VideoSlotPolicyIntent = Extract<VideoPrepIntent, {
6
6
  }>;
7
7
  export type VideoSlotPolicy = Readonly<{
8
8
  intent: VideoSlotPolicyIntent;
9
- maxDurationSeconds: number;
9
+ maxDurationSeconds: PositiveVideoDurationSeconds;
10
10
  }>;
11
11
  export type VideoSlotAssetLike = Readonly<{
12
12
  mimeType?: string | null;
@@ -24,11 +24,11 @@ export type VideoSlotAssetPolicyResult = Readonly<{
24
24
  tag: 'unconstrained';
25
25
  }> | Readonly<{
26
26
  tag: 'duration-unknown';
27
- maxSeconds: number;
27
+ maxSeconds: PositiveVideoDurationSeconds;
28
28
  }> | Readonly<{
29
29
  tag: 'duration-too-long';
30
- actualSeconds: number;
31
- maxSeconds: number;
30
+ actualSeconds: PositiveVideoDurationSeconds;
31
+ maxSeconds: PositiveVideoDurationSeconds;
32
32
  }>;
33
33
  export declare function deriveVideoSlotPolicy(intent: VideoPrepIntent | undefined): VideoSlotPolicy | undefined;
34
34
  export declare function evaluateVideoSlotAssetPolicy(asset: VideoSlotAssetLike, policy: VideoSlotPolicy | undefined): VideoSlotAssetPolicyResult;
@@ -34,6 +34,7 @@ export type UseApiMediaUploaderOptions = {
34
34
  videoPrepIntent?: VideoPrepIntentResolver;
35
35
  loadVideoPrep?: BrowserVideoPrepLoader;
36
36
  onClassification?: ClassificationHook;
37
+ onUploadError?: (error: MediaUploaderError, file: File) => void;
37
38
  logger?: LoggerLike;
38
39
  };
39
- export declare const useApiMediaUploader: ({ siteId, apiClient, autoClassify, uploadIntent, videoPrepIntent, loadVideoPrep, onClassification, logger: providedLogger, }: UseApiMediaUploaderOptions) => (file: File, onProgress?: UploadProgressHandler) => Promise<MediaAssetWithLabels>;
40
+ export declare const useApiMediaUploader: ({ siteId, apiClient, autoClassify, uploadIntent, videoPrepIntent, loadVideoPrep, onClassification, onUploadError, logger: providedLogger, }: UseApiMediaUploaderOptions) => (file: File, onProgress?: UploadProgressHandler) => Promise<MediaAssetWithLabels>;
@@ -3,6 +3,7 @@ import type { LoadedCliConfig } from '../../../config-loader';
3
3
  import type { LocalContent } from '../../../content/reader';
4
4
  import type { OutputContext } from '../../../output';
5
5
  import { type ContentDiff, type JsonDiffMode } from '../../../sync';
6
+ import type { LocalMediaPushReport } from '../../../media/local-sync';
6
7
  export declare function displayDiff(params: {
7
8
  output: OutputContext;
8
9
  diff: ContentDiff;
@@ -14,4 +15,5 @@ export declare function displayDiff(params: {
14
15
  localContent: LocalContent;
15
16
  remoteContent: PulledContent;
16
17
  humanDiff?: boolean;
18
+ mediaReport?: LocalMediaPushReport;
17
19
  }): void;
@@ -0,0 +1,23 @@
1
+ import { type OutputContext } from '../../../output';
2
+ import type { ManagementClient } from '../../../../client/management';
3
+ import type { LocalContent } from '../../../content/reader';
4
+ import type { LocalMediaPushEvent, LocalMediaPushReport } from '../../../media/local-sync';
5
+ import { type LocalMediaPushResult } from '../../../media/local-sync';
6
+ export declare function reportLocalMediaPushEvent(output: OutputContext, event: LocalMediaPushEvent): void;
7
+ export declare function reportLocalMediaPushSummary(params: {
8
+ output: OutputContext;
9
+ report: LocalMediaPushReport;
10
+ dryRun: boolean;
11
+ includeResolved?: boolean;
12
+ }): void;
13
+ export declare function syncLocalMediaForPushWithReporting(params: {
14
+ output: OutputContext;
15
+ contentDir: string;
16
+ content: LocalContent;
17
+ client: ManagementClient;
18
+ dryRun: boolean;
19
+ targetEnv: string;
20
+ isStructuredOutput: boolean;
21
+ forceUpdateAsset?: boolean;
22
+ printSummary?: boolean;
23
+ }): Promise<LocalMediaPushResult>;
@@ -1,7 +1,9 @@
1
1
  import type { SiteId } from '../../../../../../core/src/index';
2
+ import { type JsonDiffMode } from '../../../sync';
2
3
  import { type CliDatedOfferingCommandBatchSource, type CliDatedOfferingCommandCompileInput, type DatedOfferingReportSubject, type DatedOfferingUpsertItem } from '../../../site-commands';
3
4
  import type { WriterOptions } from '../../../content/writer';
4
5
  import type { PushScopeResult, ScopePushContext } from './types';
6
+ import type { LocalMediaPushReport } from '../../../media/local-sync';
5
7
  type CommandBackedDatedOfferingScopeConfig<TLocal, TRemote> = Readonly<{
6
8
  source: CliDatedOfferingCommandBatchSource;
7
9
  scopeName: string;
@@ -27,6 +29,58 @@ type CommandBackedDatedOfferingScopeConfig<TLocal, TRemote> = Readonly<{
27
29
  upserts: readonly DatedOfferingUpsertItem<TLocal>[];
28
30
  deletes: readonly string[];
29
31
  }>) => CliDatedOfferingCommandCompileInput;
32
+ dryRunReportExtras?: Readonly<{
33
+ media?: LocalMediaPushReport;
34
+ }>;
30
35
  }>;
36
+ type DatedOfferingDryRunItemStatus = 'created' | 'updated' | 'unchanged' | 'deleted';
37
+ export type DatedOfferingDryRunItem = Readonly<{
38
+ identifier: string;
39
+ label: string;
40
+ status: DatedOfferingDryRunItemStatus;
41
+ changes: readonly Readonly<{
42
+ path: string;
43
+ before: unknown;
44
+ after: unknown;
45
+ }>[];
46
+ }>;
47
+ export type DatedOfferingDryRunSummary = Readonly<{
48
+ created: number;
49
+ updated: number;
50
+ unchanged: number;
51
+ deleted: number;
52
+ }>;
53
+ export type DatedOfferingDryRunPlan = Readonly<{
54
+ summary: DatedOfferingDryRunSummary;
55
+ items: readonly DatedOfferingDryRunItem[];
56
+ }>;
57
+ export type ScopedPushJsonDiffChange = Readonly<{
58
+ type: string;
59
+ identifier: string;
60
+ operation: 'create' | 'update' | 'delete';
61
+ changes?: DatedOfferingDryRunItem['changes'];
62
+ }>;
63
+ export interface ScopedPushJsonDiff {
64
+ mode: JsonDiffMode;
65
+ direction: 'push';
66
+ scope: string;
67
+ targetEnv: ScopePushContext['targetEnv'];
68
+ dryRun: true;
69
+ summary: Readonly<{
70
+ creates: number;
71
+ updates: number;
72
+ deletes: number;
73
+ unchanged: number;
74
+ }>;
75
+ changes: readonly ScopedPushJsonDiffChange[];
76
+ media?: LocalMediaPushReport;
77
+ }
78
+ export declare function normalizeDatedOfferingForComparison(value: unknown): Record<string, unknown>;
79
+ export declare function buildDatedOfferingDryRunPlan<TLocal, TRemote>(input: Readonly<{
80
+ localItems: readonly TLocal[];
81
+ remoteItems: readonly TRemote[];
82
+ orphanIdentifiers: readonly string[];
83
+ config: Pick<CommandBackedDatedOfferingScopeConfig<TLocal, TRemote>, 'getIdentifier' | 'getDisplayLabel' | 'findRemote'>;
84
+ }>): DatedOfferingDryRunPlan;
31
85
  export declare function pushCommandBackedDatedOfferingScope<TLocal, TRemote>(ctx: ScopePushContext, config: CommandBackedDatedOfferingScopeConfig<TLocal, TRemote>): Promise<PushScopeResult>;
32
86
  export {};
@@ -1,9 +1,14 @@
1
1
  import type { LocalContent } from '../../../content/reader';
2
+ import type { LocalMediaPushReport } from '../../../media/local-sync';
2
3
  import type { ScopePushContext } from './types';
3
4
  export declare function createEmptyLocalContent(): LocalContent;
4
- export declare function syncLocalMediaForScopePush(ctx: ScopePushContext, content: LocalContent): Promise<{
5
+ type ScopedLocalMediaSyncResult = Readonly<{
5
6
  ok: true;
6
- } | {
7
+ mediaReport: LocalMediaPushReport;
8
+ }> | Readonly<{
7
9
  ok: false;
8
10
  errors: string[];
11
+ mediaReport: LocalMediaPushReport;
9
12
  }>;
13
+ export declare function syncLocalMediaForScopePush(ctx: ScopePushContext, content: LocalContent): Promise<ScopedLocalMediaSyncResult>;
14
+ export {};
@@ -3,6 +3,8 @@ import type { ManagementClient } from '../../../../client/management';
3
3
  import type { WriterOptions } from '../../../content/writer';
4
4
  import type { SiteId } from '../../../../../../core/src/index';
5
5
  import type { EnvTarget } from '../../../helpers';
6
+ import type { JsonDiffMode } from '../../../sync';
7
+ import type { LocalMediaPushReport } from '../../../media/local-sync';
6
8
  export interface ScopePushContext {
7
9
  output: OutputContext;
8
10
  contentDir: string;
@@ -12,6 +14,8 @@ export interface ScopePushContext {
12
14
  dryRun: boolean;
13
15
  force: boolean;
14
16
  isJsonOutput: boolean;
17
+ isStructuredOutput?: boolean;
18
+ jsonDiffMode?: JsonDiffMode | null;
15
19
  forceUpdateAsset?: boolean;
16
20
  deleteOrphaned: boolean;
17
21
  autoPullStale: boolean;
@@ -29,9 +33,11 @@ export interface PushScopeResult {
29
33
  scopeName: string;
30
34
  created: number;
31
35
  updated: number;
36
+ unchanged?: number;
32
37
  deleted: number;
33
38
  failed: number;
34
39
  errors: PushScopeItemError[];
40
+ media?: LocalMediaPushReport;
35
41
  }
36
42
  /**
37
43
  * Generic configuration for push scope operations
@@ -13,10 +13,42 @@ export type LocalMediaPushSummary = {
13
13
  pendingUploads: number;
14
14
  pendingAssignments: number;
15
15
  };
16
+ export type LocalMediaUploadFailureKind = 'max_object_size' | 'unsupported_mime' | 'quota_or_storage_limit' | 'auth_or_permission' | 'network' | 'cms_api' | 'unknown';
17
+ export type LocalMediaPushItemStatus = 'resolved' | 'reused' | 'assigned' | 'pending_upload' | 'uploaded' | 'skipped' | 'missing_local_file' | 'failed';
18
+ export type LocalMediaPushItemReport = Readonly<{
19
+ identifier: string;
20
+ status: LocalMediaPushItemStatus;
21
+ targetEnv?: string;
22
+ filename?: string;
23
+ sizeBytes?: number;
24
+ mimeType?: string;
25
+ locations?: readonly string[];
26
+ message?: string;
27
+ failureKind?: LocalMediaUploadFailureKind;
28
+ rawError?: string;
29
+ }>;
30
+ export type LocalMediaPushReport = Readonly<{
31
+ targetEnv?: string;
32
+ summary: LocalMediaPushSummary;
33
+ items: readonly LocalMediaPushItemReport[];
34
+ failedIdentifiers: readonly string[];
35
+ missingIdentifiers: readonly string[];
36
+ }>;
37
+ export type LocalMediaPushEvent = Readonly<{
38
+ type: 'upload_started';
39
+ item: LocalMediaPushItemReport;
40
+ }> | Readonly<{
41
+ type: 'upload_succeeded';
42
+ item: LocalMediaPushItemReport;
43
+ }> | Readonly<{
44
+ type: 'upload_failed';
45
+ item: LocalMediaPushItemReport;
46
+ }>;
16
47
  export type LocalMediaPushResult = {
17
48
  content: LocalContent;
18
49
  manifest: LocalMediaManifest;
19
50
  summary: LocalMediaPushSummary;
51
+ report: LocalMediaPushReport;
20
52
  warnings: string[];
21
53
  errors: string[];
22
54
  hasChanges: boolean;
@@ -40,6 +72,8 @@ type SyncLocalMediaForPushOptions = {
40
72
  client: ManagementClient;
41
73
  dryRun: boolean;
42
74
  forceUpdateAsset?: boolean;
75
+ targetEnv?: string;
76
+ onEvent?: (event: LocalMediaPushEvent) => void;
43
77
  };
44
78
  type SyncLocalMediaForPullOptions = {
45
79
  contentDir: string;
@@ -51,6 +85,7 @@ type SyncLocalMediaForPullOptions = {
51
85
  siteId?: string;
52
86
  downloadFiles: boolean;
53
87
  };
88
+ export declare function classifyLocalMediaUploadFailure(error: unknown): LocalMediaUploadFailureKind;
54
89
  export declare function syncLocalMediaForPush(options: SyncLocalMediaForPushOptions): Promise<LocalMediaPushResult>;
55
90
  export declare function syncLocalMediaForPull(options: SyncLocalMediaForPullOptions): Promise<LocalMediaPullResult>;
56
91
  export {};
@@ -1,4 +1,5 @@
1
1
  import type { Media } from '../../contracts';
2
+ import type { EventScheduleScope, EventSurfacePreset } from '../../contracts/system-block-content';
2
3
  import type { PublicTeamMemberSummary } from '../../../../api/src/index';
3
4
  import type { BookingFlexibleBalanceConfig, BookingInstalmentPlanConfig, LocationCoordinates, PublicCoursePriceDisplay, PublicEventPriceDisplay, PublicEventPricing, PublicEventPricingType } from '../../../../core/src/index';
4
5
  import type { AccordionIslandProps as BlocksAccordionIslandProps, BookingFormConfig as BlocksBookingFormConfig, BookingFormInteractiveIslandProps as BlocksBookingFormIslandProps, BookingFormService as BlocksBookingFormService, CarouselIslandProps as BlocksCarouselIslandProps, CourseRegistrationInteractiveIslandProps as BlocksCourseRegistrationIslandProps, CartDisplay as BlocksCartDisplay, CartInteractiveIslandProps as BlocksCartIslandProps, CartLineDisplay as BlocksCartLineDisplay, CheckoutDisplay as BlocksCheckoutDisplay, CheckoutInteractiveIslandProps as BlocksCheckoutIslandProps, EventCalendarInteractiveIslandProps as BlocksEventCalendarIslandProps, EventCombinedInteractiveIslandProps as BlocksEventCombinedIslandProps, EventDetailsContentEntry as BlocksEventDetailsContentEntry, EventDetailsIslandProps as BlocksEventDetailsIslandProps, EventDetailsOccurrenceContext as BlocksEventDetailsOccurrenceContext, LocationMapIslandProps as BlocksLocationMapIslandProps, EventRegistrationInteractiveIslandProps as BlocksEventRegistrationIslandProps, EventListingDisplay as BlocksEventListingDisplay, EventListingHydration as BlocksEventListingHydration, EventListingInteractiveIslandProps as BlocksEventListingIslandProps, FormInteractiveIslandProps as BlocksFormIslandProps, HeaderSectionIslandProps as BlocksHeaderSectionIslandProps, MembershipCardDisplay as BlocksMembershipCardDisplay, NewsletterFormInteractiveIslandProps as BlocksNewsletterFormIslandProps, PassCardDisplay as BlocksPassCardDisplay, PassesMembershipsDisplay as BlocksPassesMembershipsDisplay, ProductCardDisplay as BlocksProductCardDisplay, ProductDetailDisplay as BlocksProductDetailDisplay, ProductDetailInteractiveIslandProps as BlocksProductDetailIslandProps, ProductListDisplay as BlocksProductListDisplay, ProductListInteractiveIslandProps as BlocksProductListIslandProps, ProductVariantOptionDisplay as BlocksProductVariantOptionDisplay, ShopInteractiveIslandProps as BlocksShopIslandProps } from '../../../../blocks/src/contracts/index';
@@ -122,20 +123,41 @@ export type BookingPricingOption = {
122
123
  };
123
124
  export type BookingPricing = {
124
125
  bookingRequirement: 'none' | 'required';
125
- pricingStrategy: 'free' | 'single' | 'tiered';
126
+ pricingStrategy: 'free' | 'single' | 'tiered' | 'sliding_scale';
126
127
  currency: string;
127
128
  singlePriceAmount: number | null;
129
+ slidingMinAmount?: number | null;
130
+ slidingMaxAmount?: number | null;
131
+ slidingSuggestedAmount?: number | null;
128
132
  paymentTerms: BookingPaymentTerms;
129
133
  options: readonly BookingPricingOption[];
130
134
  };
135
+ type PublicEventRichTextDoc = {
136
+ type: 'doc';
137
+ content: Array<{
138
+ type: string;
139
+ content?: Array<{
140
+ type: string;
141
+ text?: string;
142
+ [key: string]: unknown;
143
+ }>;
144
+ [key: string]: unknown;
145
+ }>;
146
+ };
131
147
  export type PublicEvent = {
132
148
  kind?: 'event' | 'course_session';
149
+ eventPreset?: 'event' | EventSurfacePreset;
150
+ eventDestinationMode?: 'cms-managed' | 'system-managed';
133
151
  destination: PublicEventDestination;
152
+ scheduleScope?: Exclude<EventScheduleScope, 'any'>;
134
153
  id: string;
135
154
  occurrenceId: string;
136
155
  seriesId: string;
137
156
  title: string;
138
157
  description: string | null;
158
+ content?: {
159
+ body?: PublicEventRichTextDoc | null;
160
+ };
139
161
  presentation?: {
140
162
  cardTitleOverride?: string | null;
141
163
  summary?: string | null;
@@ -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.91.0";
11
+ export declare const SDK_VERSION = "0.93.0";
@@ -1,5 +1,6 @@
1
1
  "use client";
2
- import { KeyboardCode, getBlockDefinition, CSS, useSdkConfig, unwrapResponse, parseSiteIconStyleGuideVersionId, parseBlockIconValue, listBlockDescriptors, useSensor, PointerSensor, useSensors, createEditorRemoveBlockCommand, unsafeAsEditorBlockId, DndContext, closestCenter, Button, Plus, useDroppable, useDraggable, useCombinedRefs, isKeyboardEvent, createCustomBlockRegistry, Card, cn, Collapsible, CollapsibleContent, listContentTypes, mergeBlockDescriptorsWithRegistry, createEditorReorderBlocksCommand, mutateBlockContent, deleteEntrySlotBlock, deleteBlock, useDndContext, useUniqueId, useIsomorphicLayoutEffect, EmptyState, Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, Search, getClientRect, resolveBlockTitle, CardHeader, GripVertical, ChevronRight, CardTitle, ArrowUp, ArrowDown, DropdownMenu, DropdownMenuTrigger, EllipsisVertical, DropdownMenuContent, DropdownMenuSeparator, DropdownMenuItem, Copy, Trash2, DialogFooter, DialogClose, CardContent, createEntrySlotBlock, createBlock, createEditorInsertBlockCommand, reorderEntrySlotBlocks, reorderBlocks, LoaderCircle, ChevronDown, getFeatureCardIconCompletion, toFeatureCardIconSuggestionInputs, getBlockIconSemanticFallbackId, suggestSemanticIconForFeatureCard, getGeneratedBlockIconStyleState, assertNever, createManifestFormAdapter, getModalConfig, createStoreBackend, validateBlockManifestIssues, isNonEmptyValue, Settings, ScrollableDialogContent, FormRenderer, Tabs, TabsList, TabsTrigger, TabsContent, RotateCcw, ImagePlus, Sparkles, Textarea, Callout, CalloutDescription, normalEditorCuratedPromotedFieldPaths, resolveVisiblePromotedFieldPathsForEditorBlock, CalloutTitle, unfinishedBlockCopy, recoveryConflictCopy, ManifestForm, unsafeAsEditorBlockValues, Box, mergeManifestWithSdkOptions, augmentManifestWithStyleGroups, suggestFeatureCardSemanticIcons, applyFeatureCardIconSuggestions, createFeatureCardIconKey, lucide_react_exports, isThemeV2NormalEditorRawStylePath, getFieldIntent, isHeaderField, isThemeV2NormalEditorRawStyleFieldName, BackgroundGradientField, BackgroundColorField, useField, FieldFrame, Select, SelectTrigger, SelectValue, SelectContent, SelectItem, useMediaEditorOptional, useRichTextEditor, RichTextEditorSurface, ThemeScope, isObjectRecord, EMPTY_DOC, useAsyncPickerOptions, resolvePickerSelectionLabel, shouldShowPickerSearch, normalizePickerSearchThreshold, Combobox, Badge, useBlockContext, resolveMediaSlotContract, asRecord, parseAspectRatioValue, MediaEditor, PUBLIC_FILE_FIELD_KINDS, useBackendWatch, resolveIconPickerPreset, isIconPickerPreset, getIconPickerOptionsForPreset, isKnownIconName, getIconComponent, isOfferingsPreviewSourceKey, EyeOff, CommandMultiSelect, expectParsedBrandedId, parseSiteId, buildThemeRuntime, SdkConfigProvider, PaletteProvider, MediaEditorProvider, useEditorUiStoreInstance, useUISelector, getRichTextImagePositionFromTarget, insertOrReplaceRichTextImage, emitMediaCropDebug, Pencil, resolveVideoSelectionIntentForMediaField, resolveOfferingsPreviewGroupOrderEntries, normalizeOfferingsPreviewGroupOrder, inferLegacyOfferingsPreviewGroupOrder, siteOptionSources, evaluateVisibility, Root2, List, Trigger, Content, Input, Check, Label, isInternalResolvedLinkValue, resolveImageUrlWithContext, useMediaEditor, MediaPickerMini, MediaPickerDialog, toRoutableLinkPayload, classifyKnownMimeType, getDirectImageUrlForMediaAsset, isSvgMimeType } from './chunk-RQUZYSES.mjs';
2
+ import { KeyboardCode, getBlockDefinition, CSS, useSdkConfig, parseSiteIconStyleGuideVersionId, parseBlockIconValue, listBlockDescriptors, useSensor, PointerSensor, useSensors, createEditorRemoveBlockCommand, unsafeAsEditorBlockId, DndContext, closestCenter, Button, Plus, useDroppable, useDraggable, useCombinedRefs, isKeyboardEvent, createCustomBlockRegistry, Card, cn, Collapsible, CollapsibleContent, listContentTypes, mergeBlockDescriptorsWithRegistry, createEditorReorderBlocksCommand, mutateBlockContent, deleteEntrySlotBlock, deleteBlock, useDndContext, useUniqueId, useIsomorphicLayoutEffect, EmptyState, Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, Search, getClientRect, resolveBlockTitle, CardHeader, GripVertical, ChevronRight, CardTitle, ArrowUp, ArrowDown, DropdownMenu, DropdownMenuTrigger, EllipsisVertical, DropdownMenuContent, DropdownMenuSeparator, DropdownMenuItem, Copy, Trash2, DialogFooter, DialogClose, CardContent, createEntrySlotBlock, createBlock, createEditorInsertBlockCommand, reorderEntrySlotBlocks, reorderBlocks, LoaderCircle, ChevronDown, getFeatureCardIconCompletion, toFeatureCardIconSuggestionInputs, getBlockIconSemanticFallbackId, suggestSemanticIconForFeatureCard, getGeneratedBlockIconStyleState, assertNever, createManifestFormAdapter, getModalConfig, createStoreBackend, validateBlockManifestIssues, isNonEmptyValue, Settings, ScrollableDialogContent, FormRenderer, Tabs, TabsList, TabsTrigger, TabsContent, RotateCcw, ImagePlus, Sparkles, Textarea, Callout, CalloutDescription, normalEditorCuratedPromotedFieldPaths, resolveVisiblePromotedFieldPathsForEditorBlock, CalloutTitle, unfinishedBlockCopy, recoveryConflictCopy, ManifestForm, unsafeAsEditorBlockValues, Box, mergeManifestWithSdkOptions, augmentManifestWithStyleGroups, suggestFeatureCardSemanticIcons, applyFeatureCardIconSuggestions, createFeatureCardIconKey, lucide_react_exports, isThemeV2NormalEditorRawStylePath, getFieldIntent, isHeaderField, isThemeV2NormalEditorRawStyleFieldName, BackgroundGradientField, BackgroundColorField, useField, FieldFrame, Select, SelectTrigger, SelectValue, SelectContent, SelectItem, useMediaEditorOptional, useRichTextEditor, RichTextEditorSurface, ThemeScope, isObjectRecord, EMPTY_DOC, useAsyncPickerOptions, resolvePickerSelectionLabel, shouldShowPickerSearch, normalizePickerSearchThreshold, Combobox, Badge, useBlockContext, resolveMediaSlotContract, asRecord, parseAspectRatioValue, MediaEditor, PUBLIC_FILE_FIELD_KINDS, useBackendWatch, resolveIconPickerPreset, isIconPickerPreset, getIconPickerOptionsForPreset, isKnownIconName, getIconComponent, isOfferingsPreviewSourceKey, EyeOff, CommandMultiSelect, expectParsedBrandedId, parseSiteId, buildThemeRuntime, SdkConfigProvider, PaletteProvider, MediaEditorProvider, useEditorUiStoreInstance, useUISelector, getRichTextImagePositionFromTarget, insertOrReplaceRichTextImage, emitMediaCropDebug, Pencil, resolveVideoSelectionIntentForMediaField, resolveOfferingsPreviewGroupOrderEntries, normalizeOfferingsPreviewGroupOrder, inferLegacyOfferingsPreviewGroupOrder, siteOptionSources, evaluateVisibility, Root2, List, Trigger, Content, Input, Check, Label, isInternalResolvedLinkValue, resolveImageUrlWithContext, useMediaEditor, MediaPickerMini, MediaPickerDialog, toRoutableLinkPayload, classifyKnownMimeType, getDirectImageUrlForMediaAsset, isSvgMimeType } from './chunk-PCNCETBI.mjs';
3
+ import { unwrapResponse } from './chunk-NT76QGIJ.mjs';
3
4
  import React, { createContext, memo, useMemo, useState, useRef, useEffect, forwardRef, useCallback, useImperativeHandle, useContext, useSyncExternalStore, useLayoutEffect, Fragment as Fragment$1, useReducer } from 'react';
4
5
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
5
6
 
@@ -4184,14 +4185,14 @@ function LinkPicker(props) {
4184
4185
  }
4185
4186
  onChange({ kind: "url", href: trimmed.startsWith("/") ? trimmed : `/${trimmed}` });
4186
4187
  };
4187
- return /* @__PURE__ */ jsx("div", { className: cn("space-y-3", className), children: /* @__PURE__ */ jsxs(Root2, { value: activeTab, onValueChange: (next) => setActiveTab(next), children: [
4188
- /* @__PURE__ */ jsxs(List, { className: "flex gap-2 rounded-md bg-muted/40 p-1", children: [
4188
+ return /* @__PURE__ */ jsx("div", { className: cn("min-w-0 space-y-3", className), children: /* @__PURE__ */ jsxs(Root2, { value: activeTab, onValueChange: (next) => setActiveTab(next), children: [
4189
+ /* @__PURE__ */ jsxs(List, { className: "flex min-w-0 gap-2 rounded-md bg-muted/40 p-1", children: [
4189
4190
  /* @__PURE__ */ jsx(
4190
4191
  Trigger,
4191
4192
  {
4192
4193
  value: "internal",
4193
4194
  className: cn(
4194
- "flex-1 rounded-sm px-3 py-2 text-sm font-medium transition data-[state=active]:bg-background data-[state=active]:shadow",
4195
+ "min-w-0 flex-1 truncate rounded-sm px-3 py-2 text-sm font-medium transition data-[state=active]:bg-background data-[state=active]:shadow",
4195
4196
  "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"
4196
4197
  ),
4197
4198
  children: "Internal"
@@ -4202,7 +4203,7 @@ function LinkPicker(props) {
4202
4203
  {
4203
4204
  value: "external",
4204
4205
  className: cn(
4205
- "flex-1 rounded-sm px-3 py-2 text-sm font-medium transition data-[state=active]:bg-background data-[state=active]:shadow",
4206
+ "min-w-0 flex-1 truncate rounded-sm px-3 py-2 text-sm font-medium transition data-[state=active]:bg-background data-[state=active]:shadow",
4206
4207
  "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"
4207
4208
  ),
4208
4209
  children: "External URL"
@@ -4213,25 +4214,26 @@ function LinkPicker(props) {
4213
4214
  {
4214
4215
  value: "custom",
4215
4216
  className: cn(
4216
- "flex-1 rounded-sm px-3 py-2 text-sm font-medium transition data-[state=active]:bg-background data-[state=active]:shadow",
4217
+ "min-w-0 flex-1 truncate rounded-sm px-3 py-2 text-sm font-medium transition data-[state=active]:bg-background data-[state=active]:shadow",
4217
4218
  "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"
4218
4219
  ),
4219
4220
  children: "Custom Path"
4220
4221
  }
4221
4222
  )
4222
4223
  ] }),
4223
- /* @__PURE__ */ jsx(Content, { value: "internal", className: "focus-visible:outline-none", children: /* @__PURE__ */ jsxs("div", { className: "space-y-3 pt-3", children: [
4224
+ /* @__PURE__ */ jsx(Content, { value: "internal", className: "focus-visible:outline-none", children: /* @__PURE__ */ jsxs("div", { className: "min-w-0 space-y-3 pt-3", children: [
4224
4225
  /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "Select any published or draft page, post, or routed entry for this site." }),
4225
4226
  /* @__PURE__ */ jsx(
4226
4227
  Input,
4227
4228
  {
4229
+ className: "min-w-0",
4228
4230
  placeholder: loading ? "Loading\u2026" : "Search content...",
4229
4231
  value: searchQuery,
4230
4232
  onChange: (e) => setSearchQuery(e.target.value),
4231
4233
  disabled: disabled || loading
4232
4234
  }
4233
4235
  ),
4234
- /* @__PURE__ */ jsx("div", { className: "max-h-64 overflow-y-auto rounded-md border border-input", children: filteredItems.length > 0 ? filteredItems.map((item) => {
4236
+ /* @__PURE__ */ jsx("div", { className: "min-w-0 max-w-full overflow-hidden rounded-md border border-input", children: /* @__PURE__ */ jsx("div", { className: "max-h-64 overflow-y-auto", children: filteredItems.length > 0 ? filteredItems.map((item) => {
4235
4237
  const isSelected = internalSelectedId === item.routeId;
4236
4238
  const title = getDisplayTitle(item);
4237
4239
  return /* @__PURE__ */ jsxs(
@@ -4239,13 +4241,13 @@ function LinkPicker(props) {
4239
4241
  {
4240
4242
  type: "button",
4241
4243
  className: cn(
4242
- "flex w-full items-center gap-2 px-3 py-2 text-sm text-left transition-colors hover:bg-muted",
4244
+ "flex min-w-0 w-full items-center gap-2 px-3 py-2 text-left text-sm transition-colors hover:bg-muted",
4243
4245
  isSelected && "bg-muted"
4244
4246
  ),
4245
4247
  onClick: () => handleInternalSelect(item),
4246
4248
  disabled,
4247
4249
  children: [
4248
- /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
4250
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1 overflow-hidden", children: [
4249
4251
  /* @__PURE__ */ jsx("span", { className: "block truncate font-medium", children: title }),
4250
4252
  /* @__PURE__ */ jsx(
4251
4253
  "span",
@@ -4264,12 +4266,12 @@ function LinkPicker(props) {
4264
4266
  },
4265
4267
  item.routeId
4266
4268
  );
4267
- }) : /* @__PURE__ */ jsx("p", { className: "px-3 py-6 text-center text-sm text-muted-foreground", children: loading ? "Loading\u2026" : errorMessage ?? "No routable content yet" }) }),
4268
- internalSelectedItem ? /* @__PURE__ */ jsxs("div", { className: "rounded-md border border-border bg-muted/30 px-3 py-2 text-sm", children: [
4269
- /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2", children: [
4270
- /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
4271
- /* @__PURE__ */ jsx("span", { className: "truncate font-medium", children: getDisplayTitle(internalSelectedItem) }),
4272
- /* @__PURE__ */ jsx(Badge, { variant: "secondary", className: "ml-2 shrink-0", children: internalSelectedItem.typeLabel })
4269
+ }) : /* @__PURE__ */ jsx("p", { className: "px-3 py-6 text-center text-sm text-muted-foreground", children: loading ? "Loading\u2026" : errorMessage ?? "No routable content yet" }) }) }),
4270
+ internalSelectedItem ? /* @__PURE__ */ jsxs("div", { className: "min-w-0 overflow-hidden rounded-md border border-border bg-muted/30 px-3 py-2 text-sm", children: [
4271
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center justify-between gap-2", children: [
4272
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [
4273
+ /* @__PURE__ */ jsx("span", { className: "block min-w-0 truncate font-medium", children: getDisplayTitle(internalSelectedItem) }),
4274
+ /* @__PURE__ */ jsx(Badge, { variant: "secondary", className: "shrink-0", children: internalSelectedItem.typeLabel })
4273
4275
  ] }),
4274
4276
  /* @__PURE__ */ jsx(
4275
4277
  Button,
@@ -4277,7 +4279,7 @@ function LinkPicker(props) {
4277
4279
  type: "button",
4278
4280
  variant: "ghost",
4279
4281
  size: "sm",
4280
- className: "h-7 px-2 text-xs",
4282
+ className: "h-7 shrink-0 px-2 text-xs",
4281
4283
  onClick: () => onChange(null),
4282
4284
  disabled,
4283
4285
  children: "Clear"
@@ -4339,12 +4341,12 @@ function LinkPickerDialog({
4339
4341
  useEffect(() => {
4340
4342
  if (open) setDraft(value);
4341
4343
  }, [open, value]);
4342
- return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs(DialogContent, { className: "max-w-2xl", children: [
4344
+ return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs(DialogContent, { className: "w-[calc(100vw-2rem)] max-w-2xl overflow-hidden", children: [
4343
4345
  /* @__PURE__ */ jsxs(DialogHeader, { children: [
4344
4346
  /* @__PURE__ */ jsx(DialogTitle, { children: "Choose link" }),
4345
4347
  /* @__PURE__ */ jsx(DialogDescription, { children: "Select an internal page, an external URL, or a custom path." })
4346
4348
  ] }),
4347
- /* @__PURE__ */ jsx("div", { className: "py-2", children: /* @__PURE__ */ jsx(
4349
+ /* @__PURE__ */ jsx("div", { className: "min-w-0 py-2", children: /* @__PURE__ */ jsx(
4348
4350
  LinkPicker,
4349
4351
  {
4350
4352
  siteId,
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { ApiRequestError, markPreviewAuthExpired } from './chunk-ZA2S7H34.mjs';
2
+ import { ApiRequestError, markPreviewAuthExpired } from './chunk-NT76QGIJ.mjs';
3
3
  import { createContext, useContext, useRef } from 'react';
4
4
  import { jsx } from 'react/jsx-runtime';
5
5
  import { QueryClient, MutationCache, QueryCache, QueryClientProvider } from '@tanstack/react-query';
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- import { assertNever2, usePreviewDesignHistoryOrder, useOptionalEditorUiStoreInstance, getPageDesignEditorState, PAGE_DESIGN_EDITOR_STATE_FETCH_ERROR_MESSAGE, unwrapResponse, useDebouncedLatestSave, AMBIENT_BACKGROUND_ROLES, applyPageDesignEditorAction, resolvePreviewSidebarTab, confirmAutosaveBatch, beginAutosaveBatch, enqueueTransaction, applyBackgroundOverrideContentPatch, systemCustomizeFacetDefinitionForBlock, systemCustomizeFacetRollbackContentPatch, systemCustomizeFacetApplyContentPatch, unsafeAsEditorBlockId, createHistoryState, rejectAutosaveBatch, redoHistory, undoHistory, pushHistoryEntry, idleEditorTransactionQueueState, canRedoHistory, deriveTransactionCapabilities, canUndoHistory, backgroundOverrideEquals, attachRenderableMediaAssetFields, planPageDesignLayoutLookCompatibility, unsafeAsEditorBlockValues } from './chunk-RQUZYSES.mjs';
3
- import { ApiRequestError, resolveSurfaceDocumentAttributes, SURFACE_DOCUMENT_DATA_ATTRIBUTE, SURFACE_IDS } from './chunk-ZA2S7H34.mjs';
2
+ import { assertNever2, usePreviewDesignHistoryOrder, useOptionalEditorUiStoreInstance, getPageDesignEditorState, PAGE_DESIGN_EDITOR_STATE_FETCH_ERROR_MESSAGE, useDebouncedLatestSave, AMBIENT_BACKGROUND_ROLES, applyPageDesignEditorAction, resolvePreviewSidebarTab, confirmAutosaveBatch, beginAutosaveBatch, enqueueTransaction, applyBackgroundOverrideContentPatch, systemCustomizeFacetDefinitionForBlock, systemCustomizeFacetRollbackContentPatch, systemCustomizeFacetApplyContentPatch, unsafeAsEditorBlockId, createHistoryState, rejectAutosaveBatch, redoHistory, undoHistory, pushHistoryEntry, idleEditorTransactionQueueState, canRedoHistory, deriveTransactionCapabilities, canUndoHistory, backgroundOverrideEquals, attachRenderableMediaAssetFields, planPageDesignLayoutLookCompatibility, unsafeAsEditorBlockValues } from './chunk-PCNCETBI.mjs';
3
+ import { ApiRequestError, unwrapResponse, resolveSurfaceDocumentAttributes, SURFACE_DOCUMENT_DATA_ATTRIBUTE, SURFACE_IDS } from './chunk-NT76QGIJ.mjs';
4
4
  import { createContext, useState, useRef, useEffect, useMemo, useLayoutEffect, useContext } from 'react';
5
5
  import { jsx } from 'react/jsx-runtime';
6
6
 
@@ -278,6 +278,101 @@ function resolveApiBaseUrl() {
278
278
  return getCmsApiUrl();
279
279
  }
280
280
 
281
+ // ../api/src/common/envelope.ts
282
+ var API_ERROR_CODES = [
283
+ "auth:unauthenticated",
284
+ "auth:token_expired",
285
+ "auth:token_invalid",
286
+ "auth:forbidden",
287
+ "auth:mfa_required",
288
+ "auth:sudo_required",
289
+ "auth:insufficient_permissions",
290
+ "auth:impersonation_restricted",
291
+ "validation:invalid_input",
292
+ "validation:missing_field",
293
+ "validation:invalid_format",
294
+ "validation:payload_too_large",
295
+ "resource:not_found",
296
+ "resource:already_exists",
297
+ "resource:conflict",
298
+ "resource:gone",
299
+ "rate_limit:exceeded",
300
+ "billing:payment_required",
301
+ "billing:plan_limit_exceeded",
302
+ "billing:pass_redemption_failed",
303
+ "server:internal_error",
304
+ "server:unavailable",
305
+ "external:service_error",
306
+ "external:registrar_orphaned_contact_profile",
307
+ "network:connection_error",
308
+ "network:timeout",
309
+ "network:dns_error"
310
+ ];
311
+ var API_ERROR_CODE_SET = new Set(API_ERROR_CODES);
312
+ function isApiErrorCode(value) {
313
+ return typeof value === "string" && API_ERROR_CODE_SET.has(value);
314
+ }
315
+ function isApiSuccess(result) {
316
+ return result.success === true;
317
+ }
318
+ function isRecord(value) {
319
+ return typeof value === "object" && value !== null && !Array.isArray(value);
320
+ }
321
+ function isFieldError(value) {
322
+ return isRecord(value) && typeof value.field === "string" && typeof value.code === "string" && typeof value.message === "string";
323
+ }
324
+ function fieldErrorsFromUnknown(value) {
325
+ if (!Array.isArray(value)) return null;
326
+ return value.every(isFieldError) ? value : null;
327
+ }
328
+ function extractEnvelopeErrorObject(body) {
329
+ if (!isRecord(body)) return null;
330
+ const error = body.error;
331
+ if (!isRecord(error)) return null;
332
+ if ("success" in body && body.success !== false) {
333
+ return null;
334
+ }
335
+ return error;
336
+ }
337
+ function extractApiEnvelopeErrorDetails(body) {
338
+ const error = extractEnvelopeErrorObject(body);
339
+ if (!error) {
340
+ return {
341
+ rawCode: null,
342
+ code: null,
343
+ message: null,
344
+ status: null,
345
+ fieldErrors: null
346
+ };
347
+ }
348
+ const rawCode = typeof error.code === "string" ? error.code : null;
349
+ const message = typeof error.message === "string" && error.message.trim().length > 0 ? error.message : null;
350
+ return {
351
+ rawCode,
352
+ code: isApiErrorCode(rawCode) ? rawCode : null,
353
+ message,
354
+ status: typeof error.status === "number" && Number.isFinite(error.status) ? error.status : null,
355
+ fieldErrors: fieldErrorsFromUnknown(error.fieldErrors)
356
+ };
357
+ }
358
+ var ApiEnvelopeError = class extends Error {
359
+ constructor(error) {
360
+ super(error.message);
361
+ this.name = "ApiEnvelopeError";
362
+ this.code = error.code;
363
+ this.requestId = error.requestId;
364
+ this.timestamp = error.timestamp;
365
+ this.status = error.status;
366
+ this.fieldErrors = error.fieldErrors;
367
+ }
368
+ };
369
+ function unwrapResponse(result) {
370
+ if (isApiSuccess(result)) {
371
+ return result.data;
372
+ }
373
+ throw new ApiEnvelopeError(result.error);
374
+ }
375
+
281
376
  // ../api/src/apiEndpointTypes.ts
282
377
  function blockedDemoMutationPolicy(classification, publicMessage) {
283
378
  if (publicMessage.trim() === "") {
@@ -7085,6 +7180,7 @@ function createParsedClient(rawClient) {
7085
7180
  const auth = config.auth ?? "user";
7086
7181
  if (!response.ok) {
7087
7182
  const body = await parseErrorBody(response);
7183
+ const envelopeError = extractApiEnvelopeErrorDetails(body);
7088
7184
  const requestId = response.headers.get("x-request-id") ?? void 0;
7089
7185
  const retryAfterMs = parseRetryAfterHeader(response.headers.get("retry-after"));
7090
7186
  throw new ApiRequestError(
@@ -7096,6 +7192,7 @@ function createParsedClient(rawClient) {
7096
7192
  auth,
7097
7193
  requestId,
7098
7194
  body,
7195
+ errorCode: envelopeError.code ?? void 0,
7099
7196
  retryAfterMs
7100
7197
  }
7101
7198
  );
@@ -7113,4 +7210,4 @@ function createBearerAPIClient(token, baseUrl) {
7113
7210
  return createCMSClient(authHeaders, baseUrl);
7114
7211
  }
7115
7212
 
7116
- export { API_ENDPOINTS, ApiRequestError, DEFAULT_SURFACE_ID, SURFACE_DOCUMENT_DATA_ATTRIBUTE, SURFACE_IDS, createBearerAPIClient, getDashboardUrl, initPreviewAuth, isPreviewRuntimeSessionEditable, markPreviewAuthExpired, resolveSurfaceDocumentAttributes, usePreviewAuth, usePreviewAuthFetch, usePreviewToken };
7213
+ export { API_ENDPOINTS, ApiEnvelopeError, ApiRequestError, DEFAULT_SURFACE_ID, SURFACE_DOCUMENT_DATA_ATTRIBUTE, SURFACE_IDS, createBearerAPIClient, extractApiEnvelopeErrorDetails, getDashboardUrl, initPreviewAuth, isPreviewRuntimeSessionEditable, markPreviewAuthExpired, resolveSurfaceDocumentAttributes, unwrapResponse, usePreviewAuth, usePreviewAuthFetch, usePreviewToken };