@riverbankcms/sdk 0.90.0 → 0.91.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 (90) hide show
  1. package/dist/{PreviewEditorSidebar-KVXNF3VW.mjs → PreviewEditorSidebar-3TT47WCF.mjs} +3 -3
  2. package/dist/{PreviewEditorUI-J3JN5Z7T.mjs → PreviewEditorUI-ORCLLUNZ.mjs} +3 -3
  3. package/dist/SdkPreviewModeRuntime-GMCDQPZZ.mjs +8 -0
  4. package/dist/_dts/api/src/bookingConfig.d.ts +3 -0
  5. package/dist/_dts/api/src/event-listing-destination.d.ts +59 -0
  6. package/dist/_dts/api/src/index.d.ts +4 -0
  7. package/dist/_dts/api/src/navigation/dashboardSettingsNav.d.ts +0 -1
  8. package/dist/_dts/api/src/navigation.d.ts +2 -0
  9. package/dist/_dts/api/src/publicExperienceEndpoints.d.ts +3 -1
  10. package/dist/_dts/api/src/settings/permissions.d.ts +273 -0
  11. package/dist/_dts/api/src/types.d.ts +1 -0
  12. package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +60 -2
  13. package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +12 -1
  14. package/dist/_dts/blocks/src/system/blocks/media-text.d.ts +9 -9
  15. package/dist/_dts/blocks/src/system/blocks/team-members.d.ts +1 -1
  16. package/dist/_dts/blocks/src/system/manifest/fieldValidation/index.d.ts +17 -0
  17. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/event-registration.headless.contract.d.ts +5 -0
  18. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/eventPaymentOptions.d.ts +24 -0
  19. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/destination.d.ts +8 -0
  20. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/pricing.d.ts +3 -0
  21. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/utils.d.ts +7 -0
  22. package/dist/_dts/core/src/event-pricing.d.ts +12 -2
  23. package/dist/_dts/core/src/string.d.ts +12 -0
  24. package/dist/_dts/sdk/src/cli/sync/validation.d.ts +2 -2
  25. package/dist/_dts/sdk/src/public-api/contracts.d.ts +11 -1
  26. package/dist/_dts/sdk/src/rendering/islands/types.d.ts +11 -1
  27. package/dist/_dts/sdk/src/version.d.ts +1 -1
  28. package/dist/{chunk-GSPFFUVB.mjs → chunk-AFPMCLS7.mjs} +2 -2
  29. package/dist/{chunk-RQ3XZ4SJ.mjs → chunk-GDT2QGIL.mjs} +1 -1
  30. package/dist/{chunk-PMBB6MQ7.mjs → chunk-RQUZYSES.mjs} +345 -153
  31. package/dist/{chunk-AEOYWPE4.mjs → chunk-S3YHJWEU.mjs} +7 -7
  32. package/dist/{chunk-UG7I7S7W.mjs → chunk-U5YM4AWE.mjs} +1 -1
  33. package/dist/{chunk-BOQXMCSP.mjs → chunk-ZA2S7H34.mjs} +3 -3
  34. package/dist/cli/index.mjs +363 -437
  35. package/dist/cli/init-docs/content/workflow-add-block.md +48 -0
  36. package/dist/cli/init-docs/content/workflow-custom-block.md +10 -0
  37. package/dist/client/{accordion-GXQNWQ6O.mjs → accordion-AFX37652.mjs} +2 -2
  38. package/dist/client/{bookingForm-STLUJ36H.mjs → bookingForm-32V5QCOW.mjs} +6 -6
  39. package/dist/client/bookings.mjs +1170 -571
  40. package/dist/client/{carousel-CVRN6EPP.mjs → carousel-TJGQJ7ER.mjs} +3 -3
  41. package/dist/client/{cart-IYIBA5CL.mjs → cart-JUU2JEW4.mjs} +6 -6
  42. package/dist/client/{checkout-O3BGM4GS.mjs → checkout-RD6BTFX4.mjs} +6 -6
  43. package/dist/client/{chunk-DAS5CIER.mjs → chunk-6QZIBNGV.mjs} +119 -21
  44. package/dist/client/{chunk-VFHZLZAC.mjs → chunk-6RN62XBV.mjs} +1 -1
  45. package/dist/client/{chunk-D3ETC2SU.mjs → chunk-C4LP6BPG.mjs} +1 -1
  46. package/dist/client/{chunk-NBFRJ5NB.mjs → chunk-CKXEUWWA.mjs} +2 -2
  47. package/dist/client/{chunk-4RTFGHZN.mjs → chunk-E6VIWZUG.mjs} +6 -3
  48. package/dist/client/{chunk-Z62JYS5O.mjs → chunk-FMZZHAIR.mjs} +2 -2
  49. package/dist/client/{chunk-FHU6PFPM.mjs → chunk-ISAUXU5R.mjs} +1 -1
  50. package/dist/client/{chunk-HIHOQGIP.mjs → chunk-LJCX6V7Q.mjs} +9 -9
  51. package/dist/client/{chunk-6DPXDOIL.mjs → chunk-MLBNVN4H.mjs} +99 -26
  52. package/dist/client/{chunk-7DH35FGA.mjs → chunk-PMNAV6LO.mjs} +1 -1
  53. package/dist/client/{chunk-MFPKS6QS.mjs → chunk-RMOFBBNA.mjs} +5 -5
  54. package/dist/client/{chunk-25W2EQUN.mjs → chunk-RWYFG625.mjs} +17 -8
  55. package/dist/client/client.mjs +305 -113
  56. package/dist/client/{courseRegistration-2D3ACMJR.mjs → courseRegistration-X63QAIVV.mjs} +6 -6
  57. package/dist/client/{eventCalendar-QY4UZUFF.mjs → eventCalendar-5T24GCZL.mjs} +9 -9
  58. package/dist/client/{eventCombined-RRCDKJC2.mjs → eventCombined-AZVTF22X.mjs} +9 -9
  59. package/dist/client/{eventDetails-YO335BUT.mjs → eventDetails-7GPFNLGF.mjs} +9 -9
  60. package/dist/client/{eventListing-PXA6GFQ3.mjs → eventListing-QEUMTMUM.mjs} +9 -9
  61. package/dist/client/{eventRegistration-2ZHEDDXO.mjs → eventRegistration-P2EDKCQZ.mjs} +9 -9
  62. package/dist/client/{form-ZS6KX4U2.mjs → form-NUJ7H4IN.mjs} +3 -3
  63. package/dist/client/{headerSection-QK5SLIIB.mjs → headerSection-JB7LECPL.mjs} +3 -3
  64. package/dist/client/hooks.mjs +93 -42
  65. package/dist/client/{locationMap-GFNIUD2X.mjs → locationMap-UEYWUCSW.mjs} +3 -3
  66. package/dist/client/{newsletterForm-PGLTTCUG.mjs → newsletterForm-S2YZQ2X7.mjs} +3 -3
  67. package/dist/client/{productDetail-OPBE5ZPI.mjs → productDetail-H5MADGG7.mjs} +6 -6
  68. package/dist/client/{productList-NI72Q62Z.mjs → productList-DK7YON7H.mjs} +6 -6
  69. package/dist/client/rendering/client.mjs +262 -70
  70. package/dist/client/rendering/islands.mjs +19 -19
  71. package/dist/client/rendering.mjs +306 -114
  72. package/dist/client/{shop-3ZQPEWYI.mjs → shop-6PA7RDRJ.mjs} +6 -6
  73. package/dist/client/spam-protection.mjs +10 -10
  74. package/dist/preview-next/client/runtime.mjs +5 -5
  75. package/dist/{sdk-runtime-FSHXCWDS.mjs → sdk-runtime-JP5347OB.mjs} +6 -6
  76. package/dist/server/components.mjs +149 -69
  77. package/dist/server/config-validation.mjs +85 -34
  78. package/dist/server/config.mjs +85 -34
  79. package/dist/server/data.mjs +93 -42
  80. package/dist/server/index.mjs +1 -1
  81. package/dist/server/navigation.mjs +2 -2
  82. package/dist/server/next.mjs +170 -90
  83. package/dist/server/page-converter.mjs +77 -26
  84. package/dist/server/prebuild.mjs +1 -1
  85. package/dist/server/rendering/server.mjs +161 -81
  86. package/dist/server/rendering.mjs +165 -85
  87. package/dist/server/routing.mjs +135 -58
  88. package/dist/server/server.mjs +102 -51
  89. package/package.json +2 -2
  90. package/dist/SdkPreviewModeRuntime-UBL6MSNP.mjs +0 -8
@@ -49,6 +49,16 @@ riverbankcms block list home
49
49
  riverbankcms block upsert <page-id> <block-id> --kind <block-kind> --data '<json>'
50
50
  ```
51
51
 
52
+ ### Authoring Block JSON
53
+
54
+ Use `block-types.md` and `block-types-site.md` as the source of truth for fields.
55
+
56
+ - Fields marked `required` must be present with a valid value.
57
+ - Fields not marked `required` may be omitted. You do not need to include every optional key or set unused optional values to `null`.
58
+ - Defaults shown in the block reference are applied by the editor/rendering contract. Include an optional field only when you want to override that default.
59
+ - For nested objects and repeaters, required child fields apply once you include the parent value. For example, an omitted `images` repeater is valid, but `images: [{}]` is not because the item is present and its required `image` field is missing.
60
+ - `null` is only valid for field types that explicitly accept clearing to no value. When in doubt, omit optional fields instead of sending `null`.
61
+
52
62
  **Examples:**
53
63
 
54
64
  Add a hero block:
@@ -59,6 +69,44 @@ riverbankcms block upsert home main-hero \
59
69
  --data '{"heading": "Welcome", "subheading": "to our website"}'
60
70
  ```
61
71
 
72
+ Add a minimal media and text block:
73
+
74
+ `block.media-text` has many display and carousel fields, but most are optional controls with defaults. A minimal content-only block only needs rich text:
75
+
76
+ ```json
77
+ {
78
+ "text": {
79
+ "type": "doc",
80
+ "content": [
81
+ {
82
+ "type": "paragraph",
83
+ "content": [{ "type": "text", "text": "Welcome to our space." }]
84
+ }
85
+ ]
86
+ }
87
+ }
88
+ ```
89
+
90
+ Add media only when you have a complete media item:
91
+
92
+ ```json
93
+ {
94
+ "text": {
95
+ "type": "doc",
96
+ "content": [{ "type": "paragraph", "content": [] }]
97
+ },
98
+ "images": [
99
+ {
100
+ "image": {
101
+ "type": "image",
102
+ "src": "/images/studio.jpg",
103
+ "alt": "A bright studio room"
104
+ }
105
+ }
106
+ ]
107
+ }
108
+ ```
109
+
62
110
  Add a body text block:
63
111
 
64
112
  ```bash
@@ -105,6 +105,16 @@ Common field types for custom blocks:
105
105
  | `repeater` | List of nested fields | `schema`, `minItems`, `maxItems` |
106
106
  | `group` | Grouped fields | `schema` |
107
107
 
108
+ ### Step 2.5: Model Required Fields Carefully
109
+
110
+ The same content authoring rules apply to custom blocks and system blocks:
111
+
112
+ - Leave `required` unset or `false` for fields that can be omitted from pushed JSON.
113
+ - Use `defaultValue` for optional controls that should have a stable editor/rendering default.
114
+ - Set `required: true` only when every pushed block must provide that field.
115
+ - For repeaters and groups, required child fields apply when the parent item/object is present. If a repeater item has `{ id: 'title', required: true }`, then every item in that repeater must include `title`.
116
+ - In React overrides, type optional fields as optional and handle missing values with defaults or conditional rendering.
117
+
108
118
  ### Step 3: Create React Override Component
109
119
 
110
120
  Create a component to render your block:
@@ -1,5 +1,5 @@
1
- import { defineIslandPropsDecoder } from './chunk-6DPXDOIL.mjs';
2
- import './chunk-25W2EQUN.mjs';
1
+ import { defineIslandPropsDecoder } from './chunk-MLBNVN4H.mjs';
2
+ import './chunk-RWYFG625.mjs';
3
3
 
4
4
  // src/rendering/islands/enhancers/accordion.ts
5
5
  var decode = defineIslandPropsDecoder("accordion");
@@ -1,15 +1,15 @@
1
1
  "use client";
2
- import { buildBookingPaymentSelectionViewModel, usePolling } from './chunk-4RTFGHZN.mjs';
3
- import { SpinnerNode } from './chunk-FHU6PFPM.mjs';
2
+ import { buildBookingPaymentSelectionViewModel, usePolling } from './chunk-E6VIWZUG.mjs';
3
+ import { SpinnerNode } from './chunk-ISAUXU5R.mjs';
4
4
  import { buildRouteIslandApiConfig } from './chunk-L4J5Y62O.mjs';
5
- import { scrollToBlock, useDiscountCodeUi, buildCheckoutReturnUrls, DiscountCodeDisclosure } from './chunk-NBFRJ5NB.mjs';
5
+ import { scrollToBlock, useDiscountCodeUi, buildCheckoutReturnUrls, DiscountCodeDisclosure } from './chunk-CKXEUWWA.mjs';
6
6
  import { FieldValidationMessage, getFieldValidationControlProps } from './chunk-3DCJ45Z2.mjs';
7
7
  import './chunk-WBQG7VJA.mjs';
8
- import { isSpamProtectionEnabled, getChallengeUrl, AltchaWidget } from './chunk-HIHOQGIP.mjs';
8
+ import { isSpamProtectionEnabled, getChallengeUrl, AltchaWidget } from './chunk-LJCX6V7Q.mjs';
9
9
  import { BlockApiProvider, useBlockApi, FeedbackMessage } from './chunk-WHZQDPBZ.mjs';
10
10
  import { mountReactIsland } from './chunk-N7PBWBWQ.mjs';
11
- import { defineIslandPropsDecoder, resolveBookingSiteId, resolveDefaultBookingServiceId, getBookingRedirectStateFromLocation, deriveBookingFormViewState, logger, getBookingSuccessMessage, resolveAppointmentCheckoutVerificationState, themeButtonClassName, toSelectedCollectionOptionKind, assertNever, prepareBookingSubmission, formatBookingSubmissionPreparationError, resolveBookingPaymentStep, BOOKING_FORM_DATA_RESERVED_KEYS, clearWorkflowFeedback, reportWorkflowError, reportWorkflowSuccess, okWith, err } from './chunk-6DPXDOIL.mjs';
12
- import { resolveBookingTimeZoneId, DEFAULT_BOOKING_TIME_ZONE, unsafeAsFormId, unsafeAsAppointmentResourceId, unsafeAsCustomerPassId, unsafeAsAppointmentServiceId, formatLocalScheduleDate, addLocalScheduleDays, parseBookingLocalDate, unsafeAsPassId, formatBookingInstant } from './chunk-25W2EQUN.mjs';
11
+ import { defineIslandPropsDecoder, resolveBookingSiteId, resolveDefaultBookingServiceId, getBookingRedirectStateFromLocation, deriveBookingFormViewState, logger, getBookingSuccessMessage, resolveAppointmentCheckoutVerificationState, themeButtonClassName, toSelectedCollectionOptionKind, assertNever, prepareBookingSubmission, formatBookingSubmissionPreparationError, resolveBookingPaymentStep, BOOKING_FORM_DATA_RESERVED_KEYS, clearWorkflowFeedback, reportWorkflowError, reportWorkflowSuccess, okWith, err } from './chunk-MLBNVN4H.mjs';
12
+ import { resolveBookingTimeZoneId, DEFAULT_BOOKING_TIME_ZONE, unsafeAsFormId, unsafeAsAppointmentResourceId, unsafeAsCustomerPassId, unsafeAsAppointmentServiceId, formatLocalScheduleDate, addLocalScheduleDays, parseBookingLocalDate, unsafeAsPassId, formatBookingInstant } from './chunk-RWYFG625.mjs';
13
13
  import React2, { useRef, useState, useMemo, useReducer, useEffect, useCallback, useLayoutEffect } from 'react';
14
14
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
15
15