@cmssy/react 0.7.7 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/client.cjs CHANGED
@@ -40,7 +40,7 @@ function blocksToMeta(blocks, defaults = {}) {
40
40
  }
41
41
 
42
42
  // src/bridge/protocol.ts
43
- var PROTOCOL_VERSION = 1;
43
+ var PROTOCOL_VERSION = 2;
44
44
 
45
45
  // src/bridge/messages.ts
46
46
  function normalizeOrigin(origin) {
@@ -1020,17 +1020,21 @@ function control(type) {
1020
1020
  });
1021
1021
  }
1022
1022
  var fields = {
1023
- singleLine: control("singleLine"),
1024
- multiLine: control("multiLine"),
1023
+ text: control("text"),
1024
+ textarea: control("textarea"),
1025
1025
  richText: control("richText"),
1026
- numeric: control("numeric"),
1026
+ number: control("number"),
1027
1027
  date: control("date"),
1028
+ datetime: control("datetime"),
1029
+ boolean: control("boolean"),
1030
+ color: control("color"),
1028
1031
  media: control("media"),
1029
1032
  link: control("link"),
1033
+ url: control("url"),
1034
+ email: control("email"),
1030
1035
  select: control("select"),
1031
1036
  multiselect: control("multiselect"),
1032
- boolean: control("boolean"),
1033
- color: control("color"),
1037
+ radio: control("radio"),
1034
1038
  repeater: control("repeater")
1035
1039
  };
1036
1040
 
@@ -1217,12 +1221,12 @@ var productBlock = defineBlock({
1217
1221
  label: "Product",
1218
1222
  category: "Commerce",
1219
1223
  props: {
1220
- modelSlug: fields.singleLine({ label: "Model slug" }),
1221
- slugField: fields.singleLine({ label: "Slug field" }),
1222
- slug: fields.singleLine({ label: "Product slug" }),
1223
- nameField: fields.singleLine({ label: "Name field" }),
1224
- priceField: fields.singleLine({ label: "Price field" }),
1225
- imageField: fields.singleLine({ label: "Image field" })
1224
+ modelSlug: fields.text({ label: "Model slug" }),
1225
+ slugField: fields.text({ label: "Slug field" }),
1226
+ slug: fields.text({ label: "Product slug" }),
1227
+ nameField: fields.text({ label: "Name field" }),
1228
+ priceField: fields.text({ label: "Price field" }),
1229
+ imageField: fields.text({ label: "Image field" })
1226
1230
  },
1227
1231
  component: ProductComponent
1228
1232
  });
@@ -1416,7 +1420,7 @@ var checkoutBlock = defineBlock({
1416
1420
  label: "Checkout",
1417
1421
  category: "Commerce",
1418
1422
  props: {
1419
- successMessage: fields.singleLine({ label: "Success message" })
1423
+ successMessage: fields.text({ label: "Success message" })
1420
1424
  },
1421
1425
  component: CheckoutComponent
1422
1426
  });
package/dist/client.d.cts CHANGED
@@ -1,7 +1,8 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { B as BlockSchema, a as BlockMeta, C as CmssyPageData, b as BlockDefinition, c as CmssyFormDefinition, d as CmssyLayoutGroup, e as CmssyLocaleContext, f as CmssyCart, g as CmssyOrder, h as CmssyProduct } from './commerce-queries-BSTuurfl.cjs';
3
- export { i as CmssyCartDiscount, j as CmssyCartItem, k as CmssyCartItemSnapshot, l as CmssyOrderItem, m as CmssyProductVariant } from './commerce-queries-BSTuurfl.cjs';
2
+ import { B as BlockSchema, a as BlockMeta, C as CmssyPageData, b as BlockDefinition, c as CmssyFormDefinition, d as CmssyLayoutGroup, e as CmssyLocaleContext, f as CmssyCart, g as CmssyOrder, h as CmssyProduct } from './commerce-queries-Ch7QldF7.cjs';
3
+ export { i as CmssyCartDiscount, j as CmssyCartItem, k as CmssyCartItemSnapshot, l as CmssyOrderItem, m as CmssyProductVariant } from './commerce-queries-Ch7QldF7.cjs';
4
4
  import { ReactNode } from 'react';
5
+ import '@cmssy/types';
5
6
 
6
7
  interface EditBridgeConfig {
7
8
  editorOrigin: string;
package/dist/client.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { B as BlockSchema, a as BlockMeta, C as CmssyPageData, b as BlockDefinition, c as CmssyFormDefinition, d as CmssyLayoutGroup, e as CmssyLocaleContext, f as CmssyCart, g as CmssyOrder, h as CmssyProduct } from './commerce-queries-BSTuurfl.js';
3
- export { i as CmssyCartDiscount, j as CmssyCartItem, k as CmssyCartItemSnapshot, l as CmssyOrderItem, m as CmssyProductVariant } from './commerce-queries-BSTuurfl.js';
2
+ import { B as BlockSchema, a as BlockMeta, C as CmssyPageData, b as BlockDefinition, c as CmssyFormDefinition, d as CmssyLayoutGroup, e as CmssyLocaleContext, f as CmssyCart, g as CmssyOrder, h as CmssyProduct } from './commerce-queries-Ch7QldF7.js';
3
+ export { i as CmssyCartDiscount, j as CmssyCartItem, k as CmssyCartItemSnapshot, l as CmssyOrderItem, m as CmssyProductVariant } from './commerce-queries-Ch7QldF7.js';
4
4
  import { ReactNode } from 'react';
5
+ import '@cmssy/types';
5
6
 
6
7
  interface EditBridgeConfig {
7
8
  editorOrigin: string;
package/dist/client.js CHANGED
@@ -38,7 +38,7 @@ function blocksToMeta(blocks, defaults = {}) {
38
38
  }
39
39
 
40
40
  // src/bridge/protocol.ts
41
- var PROTOCOL_VERSION = 1;
41
+ var PROTOCOL_VERSION = 2;
42
42
 
43
43
  // src/bridge/messages.ts
44
44
  function normalizeOrigin(origin) {
@@ -1018,17 +1018,21 @@ function control(type) {
1018
1018
  });
1019
1019
  }
1020
1020
  var fields = {
1021
- singleLine: control("singleLine"),
1022
- multiLine: control("multiLine"),
1021
+ text: control("text"),
1022
+ textarea: control("textarea"),
1023
1023
  richText: control("richText"),
1024
- numeric: control("numeric"),
1024
+ number: control("number"),
1025
1025
  date: control("date"),
1026
+ datetime: control("datetime"),
1027
+ boolean: control("boolean"),
1028
+ color: control("color"),
1026
1029
  media: control("media"),
1027
1030
  link: control("link"),
1031
+ url: control("url"),
1032
+ email: control("email"),
1028
1033
  select: control("select"),
1029
1034
  multiselect: control("multiselect"),
1030
- boolean: control("boolean"),
1031
- color: control("color"),
1035
+ radio: control("radio"),
1032
1036
  repeater: control("repeater")
1033
1037
  };
1034
1038
 
@@ -1215,12 +1219,12 @@ var productBlock = defineBlock({
1215
1219
  label: "Product",
1216
1220
  category: "Commerce",
1217
1221
  props: {
1218
- modelSlug: fields.singleLine({ label: "Model slug" }),
1219
- slugField: fields.singleLine({ label: "Slug field" }),
1220
- slug: fields.singleLine({ label: "Product slug" }),
1221
- nameField: fields.singleLine({ label: "Name field" }),
1222
- priceField: fields.singleLine({ label: "Price field" }),
1223
- imageField: fields.singleLine({ label: "Image field" })
1222
+ modelSlug: fields.text({ label: "Model slug" }),
1223
+ slugField: fields.text({ label: "Slug field" }),
1224
+ slug: fields.text({ label: "Product slug" }),
1225
+ nameField: fields.text({ label: "Name field" }),
1226
+ priceField: fields.text({ label: "Price field" }),
1227
+ imageField: fields.text({ label: "Image field" })
1224
1228
  },
1225
1229
  component: ProductComponent
1226
1230
  });
@@ -1414,7 +1418,7 @@ var checkoutBlock = defineBlock({
1414
1418
  label: "Checkout",
1415
1419
  category: "Commerce",
1416
1420
  props: {
1417
- successMessage: fields.singleLine({ label: "Success message" })
1421
+ successMessage: fields.text({ label: "Success message" })
1418
1422
  },
1419
1423
  component: CheckoutComponent
1420
1424
  });
@@ -1,4 +1,5 @@
1
1
  import { ComponentType } from 'react';
2
+ import { FieldType } from '@cmssy/types';
2
3
 
3
4
  /**
4
5
  * The cmssy cloud GraphQL delivery endpoint. It is the same for every workspace,
@@ -191,8 +192,8 @@ interface BuildBlockContextExtra {
191
192
  }
192
193
  declare function buildBlockContext(locale: string, defaultLocale: string, enabledLocales?: string[], isPreview?: boolean, forms?: Record<string, CmssyFormDefinition>, extra?: BuildBlockContextExtra): CmssyBlockContext;
193
194
 
194
- declare const PROTOCOL_VERSION = 1;
195
- type FieldType = "singleLine" | "multiLine" | "richText" | "numeric" | "date" | "media" | "link" | "select" | "multiselect" | "boolean" | "color" | "repeater";
195
+ declare const PROTOCOL_VERSION = 2;
196
+
196
197
  interface FieldDefinition {
197
198
  type: FieldType;
198
199
  label: string;
@@ -200,6 +201,7 @@ interface FieldDefinition {
200
201
  helperText?: string;
201
202
  required?: boolean;
202
203
  placeholder?: string;
204
+ tab?: string;
203
205
  options?: string[];
204
206
  itemSchema?: Record<string, FieldDefinition>;
205
207
  itemLabel?: string;
@@ -462,4 +464,4 @@ interface CmssyOrder {
462
464
  createdAt?: string;
463
465
  }
464
466
 
465
- export { SITE_CONFIG_QUERY as $, type AppToEditorMessage as A, type BlockSchema as B, type CmssyPageData as C, type CmssyFormField as D, type EditorToAppMessage as E, type FieldDefinition as F, type CmssyFormSettings as G, type CmssyFormSubmitResponse as H, type CmssyLocalizedValue as I, type CmssyModelDefinition as J, type CmssyModelRecord as K, type CmssyPageMeta as L, type CmssyPageSummary as M, type CmssyRecordList as N, DEFAULT_CMSSY_API_URL as O, FORM_QUERY as P, type FetchLikeResponse as Q, type RawBlock as R, type FetchPageOptions as S, type FieldType as T, MODEL_DEFINITIONS_QUERY as U, MODEL_RECORDS_QUERY as V, PROTOCOL_VERSION as W, type ParentReadyMessage as X, type PatchMessage as Y, type RawLayoutBlock as Z, type ReadyMessage as _, type BlockMeta as a, SUBMIT_FORM_MUTATION as a0, type SelectMessage as a1, type SubmitFormInput as a2, blocksToMeta as a3, blocksToSchemas as a4, buildBlockContext as a5, buildBlockMap as a6, defineBlock as a7, fetchLayouts as a8, fetchPage as a9, fetchPageById as aa, fetchPageMeta as ab, fetchPages as ac, isProtocolCompatible as ad, normalizeSlug as ae, resolveApiUrl as af, type BlockDefinition as b, type CmssyFormDefinition as c, type CmssyLayoutGroup as d, type CmssyLocaleContext as e, type CmssyCart as f, type CmssyOrder as g, type CmssyProduct as h, type CmssyCartDiscount as i, type CmssyCartItem as j, type CmssyCartItemSnapshot as k, type CmssyOrderItem as l, type CmssyProductVariant as m, type CmssyBlockAuthContext as n, type CmssyBlockWorkspace as o, type FetchLike as p, type CmssyClientConfig as q, type CmssySiteConfig as r, type BlockMap as s, type CmssyBlockContext as t, type BlockRect as u, type BoundsMessage as v, type BuildBlockContextExtra as w, type ClickMessage as x, type CmssyBlockMember as y, type CmssyBranding as z };
467
+ export { SUBMIT_FORM_MUTATION as $, type AppToEditorMessage as A, type BlockSchema as B, type CmssyPageData as C, type CmssyFormField as D, type EditorToAppMessage as E, type FieldDefinition as F, type CmssyFormSettings as G, type CmssyFormSubmitResponse as H, type CmssyLocalizedValue as I, type CmssyModelDefinition as J, type CmssyModelRecord as K, type CmssyPageMeta as L, type CmssyPageSummary as M, type CmssyRecordList as N, DEFAULT_CMSSY_API_URL as O, FORM_QUERY as P, type FetchLikeResponse as Q, type RawBlock as R, type FetchPageOptions as S, MODEL_DEFINITIONS_QUERY as T, MODEL_RECORDS_QUERY as U, PROTOCOL_VERSION as V, type ParentReadyMessage as W, type PatchMessage as X, type RawLayoutBlock as Y, type ReadyMessage as Z, SITE_CONFIG_QUERY as _, type BlockMeta as a, type SelectMessage as a0, type SubmitFormInput as a1, blocksToMeta as a2, blocksToSchemas as a3, buildBlockContext as a4, buildBlockMap as a5, defineBlock as a6, fetchLayouts as a7, fetchPage as a8, fetchPageById as a9, fetchPageMeta as aa, fetchPages as ab, isProtocolCompatible as ac, normalizeSlug as ad, resolveApiUrl as ae, type BlockDefinition as b, type CmssyFormDefinition as c, type CmssyLayoutGroup as d, type CmssyLocaleContext as e, type CmssyCart as f, type CmssyOrder as g, type CmssyProduct as h, type CmssyCartDiscount as i, type CmssyCartItem as j, type CmssyCartItemSnapshot as k, type CmssyOrderItem as l, type CmssyProductVariant as m, type CmssyBlockAuthContext as n, type CmssyBlockWorkspace as o, type FetchLike as p, type CmssyClientConfig as q, type CmssySiteConfig as r, type BlockMap as s, type CmssyBlockContext as t, type BlockRect as u, type BoundsMessage as v, type BuildBlockContextExtra as w, type ClickMessage as x, type CmssyBlockMember as y, type CmssyBranding as z };
@@ -1,4 +1,5 @@
1
1
  import { ComponentType } from 'react';
2
+ import { FieldType } from '@cmssy/types';
2
3
 
3
4
  /**
4
5
  * The cmssy cloud GraphQL delivery endpoint. It is the same for every workspace,
@@ -191,8 +192,8 @@ interface BuildBlockContextExtra {
191
192
  }
192
193
  declare function buildBlockContext(locale: string, defaultLocale: string, enabledLocales?: string[], isPreview?: boolean, forms?: Record<string, CmssyFormDefinition>, extra?: BuildBlockContextExtra): CmssyBlockContext;
193
194
 
194
- declare const PROTOCOL_VERSION = 1;
195
- type FieldType = "singleLine" | "multiLine" | "richText" | "numeric" | "date" | "media" | "link" | "select" | "multiselect" | "boolean" | "color" | "repeater";
195
+ declare const PROTOCOL_VERSION = 2;
196
+
196
197
  interface FieldDefinition {
197
198
  type: FieldType;
198
199
  label: string;
@@ -200,6 +201,7 @@ interface FieldDefinition {
200
201
  helperText?: string;
201
202
  required?: boolean;
202
203
  placeholder?: string;
204
+ tab?: string;
203
205
  options?: string[];
204
206
  itemSchema?: Record<string, FieldDefinition>;
205
207
  itemLabel?: string;
@@ -462,4 +464,4 @@ interface CmssyOrder {
462
464
  createdAt?: string;
463
465
  }
464
466
 
465
- export { SITE_CONFIG_QUERY as $, type AppToEditorMessage as A, type BlockSchema as B, type CmssyPageData as C, type CmssyFormField as D, type EditorToAppMessage as E, type FieldDefinition as F, type CmssyFormSettings as G, type CmssyFormSubmitResponse as H, type CmssyLocalizedValue as I, type CmssyModelDefinition as J, type CmssyModelRecord as K, type CmssyPageMeta as L, type CmssyPageSummary as M, type CmssyRecordList as N, DEFAULT_CMSSY_API_URL as O, FORM_QUERY as P, type FetchLikeResponse as Q, type RawBlock as R, type FetchPageOptions as S, type FieldType as T, MODEL_DEFINITIONS_QUERY as U, MODEL_RECORDS_QUERY as V, PROTOCOL_VERSION as W, type ParentReadyMessage as X, type PatchMessage as Y, type RawLayoutBlock as Z, type ReadyMessage as _, type BlockMeta as a, SUBMIT_FORM_MUTATION as a0, type SelectMessage as a1, type SubmitFormInput as a2, blocksToMeta as a3, blocksToSchemas as a4, buildBlockContext as a5, buildBlockMap as a6, defineBlock as a7, fetchLayouts as a8, fetchPage as a9, fetchPageById as aa, fetchPageMeta as ab, fetchPages as ac, isProtocolCompatible as ad, normalizeSlug as ae, resolveApiUrl as af, type BlockDefinition as b, type CmssyFormDefinition as c, type CmssyLayoutGroup as d, type CmssyLocaleContext as e, type CmssyCart as f, type CmssyOrder as g, type CmssyProduct as h, type CmssyCartDiscount as i, type CmssyCartItem as j, type CmssyCartItemSnapshot as k, type CmssyOrderItem as l, type CmssyProductVariant as m, type CmssyBlockAuthContext as n, type CmssyBlockWorkspace as o, type FetchLike as p, type CmssyClientConfig as q, type CmssySiteConfig as r, type BlockMap as s, type CmssyBlockContext as t, type BlockRect as u, type BoundsMessage as v, type BuildBlockContextExtra as w, type ClickMessage as x, type CmssyBlockMember as y, type CmssyBranding as z };
467
+ export { SUBMIT_FORM_MUTATION as $, type AppToEditorMessage as A, type BlockSchema as B, type CmssyPageData as C, type CmssyFormField as D, type EditorToAppMessage as E, type FieldDefinition as F, type CmssyFormSettings as G, type CmssyFormSubmitResponse as H, type CmssyLocalizedValue as I, type CmssyModelDefinition as J, type CmssyModelRecord as K, type CmssyPageMeta as L, type CmssyPageSummary as M, type CmssyRecordList as N, DEFAULT_CMSSY_API_URL as O, FORM_QUERY as P, type FetchLikeResponse as Q, type RawBlock as R, type FetchPageOptions as S, MODEL_DEFINITIONS_QUERY as T, MODEL_RECORDS_QUERY as U, PROTOCOL_VERSION as V, type ParentReadyMessage as W, type PatchMessage as X, type RawLayoutBlock as Y, type ReadyMessage as Z, SITE_CONFIG_QUERY as _, type BlockMeta as a, type SelectMessage as a0, type SubmitFormInput as a1, blocksToMeta as a2, blocksToSchemas as a3, buildBlockContext as a4, buildBlockMap as a5, defineBlock as a6, fetchLayouts as a7, fetchPage as a8, fetchPageById as a9, fetchPageMeta as aa, fetchPages as ab, isProtocolCompatible as ac, normalizeSlug as ad, resolveApiUrl as ae, type BlockDefinition as b, type CmssyFormDefinition as c, type CmssyLayoutGroup as d, type CmssyLocaleContext as e, type CmssyCart as f, type CmssyOrder as g, type CmssyProduct as h, type CmssyCartDiscount as i, type CmssyCartItem as j, type CmssyCartItemSnapshot as k, type CmssyOrderItem as l, type CmssyProductVariant as m, type CmssyBlockAuthContext as n, type CmssyBlockWorkspace as o, type FetchLike as p, type CmssyClientConfig as q, type CmssySiteConfig as r, type BlockMap as s, type CmssyBlockContext as t, type BlockRect as u, type BoundsMessage as v, type BuildBlockContextExtra as w, type ClickMessage as x, type CmssyBlockMember as y, type CmssyBranding as z };
package/dist/index.cjs CHANGED
@@ -12,17 +12,21 @@ function control(type) {
12
12
  });
13
13
  }
14
14
  var fields = {
15
- singleLine: control("singleLine"),
16
- multiLine: control("multiLine"),
15
+ text: control("text"),
16
+ textarea: control("textarea"),
17
17
  richText: control("richText"),
18
- numeric: control("numeric"),
18
+ number: control("number"),
19
19
  date: control("date"),
20
+ datetime: control("datetime"),
21
+ boolean: control("boolean"),
22
+ color: control("color"),
20
23
  media: control("media"),
21
24
  link: control("link"),
25
+ url: control("url"),
26
+ email: control("email"),
22
27
  select: control("select"),
23
28
  multiselect: control("multiselect"),
24
- boolean: control("boolean"),
25
- color: control("color"),
29
+ radio: control("radio"),
26
30
  repeater: control("repeater")
27
31
  };
28
32
 
@@ -213,7 +217,7 @@ function CmssyServerLayout({
213
217
  }
214
218
 
215
219
  // src/bridge/protocol.ts
216
- var PROTOCOL_VERSION = 1;
220
+ var PROTOCOL_VERSION = 2;
217
221
  function isProtocolCompatible(version) {
218
222
  return version === PROTOCOL_VERSION;
219
223
  }
package/dist/index.d.cts CHANGED
@@ -1,23 +1,28 @@
1
- import { F as FieldDefinition, C as CmssyPageData, b as BlockDefinition, c as CmssyFormDefinition, n as CmssyBlockAuthContext, o as CmssyBlockWorkspace, d as CmssyLayoutGroup, E as EditorToAppMessage, A as AppToEditorMessage, p as FetchLike, q as CmssyClientConfig, r as CmssySiteConfig, R as RawBlock, e as CmssyLocaleContext, s as BlockMap, t as CmssyBlockContext } from './commerce-queries-BSTuurfl.cjs';
2
- export { a as BlockMeta, u as BlockRect, B as BlockSchema, v as BoundsMessage, w as BuildBlockContextExtra, x as ClickMessage, y as CmssyBlockMember, z as CmssyBranding, f as CmssyCart, i as CmssyCartDiscount, j as CmssyCartItem, k as CmssyCartItemSnapshot, D as CmssyFormField, G as CmssyFormSettings, H as CmssyFormSubmitResponse, I as CmssyLocalizedValue, J as CmssyModelDefinition, K as CmssyModelRecord, g as CmssyOrder, L as CmssyPageMeta, M as CmssyPageSummary, h as CmssyProduct, m as CmssyProductVariant, N as CmssyRecordList, O as DEFAULT_CMSSY_API_URL, P as FORM_QUERY, Q as FetchLikeResponse, S as FetchPageOptions, T as FieldType, U as MODEL_DEFINITIONS_QUERY, V as MODEL_RECORDS_QUERY, W as PROTOCOL_VERSION, X as ParentReadyMessage, Y as PatchMessage, Z as RawLayoutBlock, _ as ReadyMessage, $ as SITE_CONFIG_QUERY, a0 as SUBMIT_FORM_MUTATION, a1 as SelectMessage, a2 as SubmitFormInput, a3 as blocksToMeta, a4 as blocksToSchemas, a5 as buildBlockContext, a6 as buildBlockMap, a7 as defineBlock, a8 as fetchLayouts, a9 as fetchPage, aa as fetchPageById, ab as fetchPageMeta, ac as fetchPages, ad as isProtocolCompatible, ae as normalizeSlug, af as resolveApiUrl } from './commerce-queries-BSTuurfl.cjs';
1
+ import { F as FieldDefinition, C as CmssyPageData, b as BlockDefinition, c as CmssyFormDefinition, n as CmssyBlockAuthContext, o as CmssyBlockWorkspace, d as CmssyLayoutGroup, E as EditorToAppMessage, A as AppToEditorMessage, p as FetchLike, q as CmssyClientConfig, r as CmssySiteConfig, R as RawBlock, e as CmssyLocaleContext, s as BlockMap, t as CmssyBlockContext } from './commerce-queries-Ch7QldF7.cjs';
2
+ export { a as BlockMeta, u as BlockRect, B as BlockSchema, v as BoundsMessage, w as BuildBlockContextExtra, x as ClickMessage, y as CmssyBlockMember, z as CmssyBranding, f as CmssyCart, i as CmssyCartDiscount, j as CmssyCartItem, k as CmssyCartItemSnapshot, D as CmssyFormField, G as CmssyFormSettings, H as CmssyFormSubmitResponse, I as CmssyLocalizedValue, J as CmssyModelDefinition, K as CmssyModelRecord, g as CmssyOrder, L as CmssyPageMeta, M as CmssyPageSummary, h as CmssyProduct, m as CmssyProductVariant, N as CmssyRecordList, O as DEFAULT_CMSSY_API_URL, P as FORM_QUERY, Q as FetchLikeResponse, S as FetchPageOptions, T as MODEL_DEFINITIONS_QUERY, U as MODEL_RECORDS_QUERY, V as PROTOCOL_VERSION, W as ParentReadyMessage, X as PatchMessage, Y as RawLayoutBlock, Z as ReadyMessage, _ as SITE_CONFIG_QUERY, $ as SUBMIT_FORM_MUTATION, a0 as SelectMessage, a1 as SubmitFormInput, a2 as blocksToMeta, a3 as blocksToSchemas, a4 as buildBlockContext, a5 as buildBlockMap, a6 as defineBlock, a7 as fetchLayouts, a8 as fetchPage, a9 as fetchPageById, aa as fetchPageMeta, ab as fetchPages, ac as isProtocolCompatible, ad as normalizeSlug, ae as resolveApiUrl } from './commerce-queries-Ch7QldF7.cjs';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
+ export { FieldType } from '@cmssy/types';
4
5
  import 'react';
5
6
 
6
7
  type FieldControl = Omit<FieldDefinition, "type" | "label"> & {
7
8
  label?: string;
8
9
  };
9
10
  declare const fields: {
10
- singleLine: (opts?: FieldControl) => FieldDefinition;
11
- multiLine: (opts?: FieldControl) => FieldDefinition;
11
+ text: (opts?: FieldControl) => FieldDefinition;
12
+ textarea: (opts?: FieldControl) => FieldDefinition;
12
13
  richText: (opts?: FieldControl) => FieldDefinition;
13
- numeric: (opts?: FieldControl) => FieldDefinition;
14
+ number: (opts?: FieldControl) => FieldDefinition;
14
15
  date: (opts?: FieldControl) => FieldDefinition;
16
+ datetime: (opts?: FieldControl) => FieldDefinition;
17
+ boolean: (opts?: FieldControl) => FieldDefinition;
18
+ color: (opts?: FieldControl) => FieldDefinition;
15
19
  media: (opts?: FieldControl) => FieldDefinition;
16
20
  link: (opts?: FieldControl) => FieldDefinition;
21
+ url: (opts?: FieldControl) => FieldDefinition;
22
+ email: (opts?: FieldControl) => FieldDefinition;
17
23
  select: (opts?: FieldControl) => FieldDefinition;
18
24
  multiselect: (opts?: FieldControl) => FieldDefinition;
19
- boolean: (opts?: FieldControl) => FieldDefinition;
20
- color: (opts?: FieldControl) => FieldDefinition;
25
+ radio: (opts?: FieldControl) => FieldDefinition;
21
26
  repeater: (opts?: FieldControl) => FieldDefinition;
22
27
  };
23
28
 
package/dist/index.d.ts CHANGED
@@ -1,23 +1,28 @@
1
- import { F as FieldDefinition, C as CmssyPageData, b as BlockDefinition, c as CmssyFormDefinition, n as CmssyBlockAuthContext, o as CmssyBlockWorkspace, d as CmssyLayoutGroup, E as EditorToAppMessage, A as AppToEditorMessage, p as FetchLike, q as CmssyClientConfig, r as CmssySiteConfig, R as RawBlock, e as CmssyLocaleContext, s as BlockMap, t as CmssyBlockContext } from './commerce-queries-BSTuurfl.js';
2
- export { a as BlockMeta, u as BlockRect, B as BlockSchema, v as BoundsMessage, w as BuildBlockContextExtra, x as ClickMessage, y as CmssyBlockMember, z as CmssyBranding, f as CmssyCart, i as CmssyCartDiscount, j as CmssyCartItem, k as CmssyCartItemSnapshot, D as CmssyFormField, G as CmssyFormSettings, H as CmssyFormSubmitResponse, I as CmssyLocalizedValue, J as CmssyModelDefinition, K as CmssyModelRecord, g as CmssyOrder, L as CmssyPageMeta, M as CmssyPageSummary, h as CmssyProduct, m as CmssyProductVariant, N as CmssyRecordList, O as DEFAULT_CMSSY_API_URL, P as FORM_QUERY, Q as FetchLikeResponse, S as FetchPageOptions, T as FieldType, U as MODEL_DEFINITIONS_QUERY, V as MODEL_RECORDS_QUERY, W as PROTOCOL_VERSION, X as ParentReadyMessage, Y as PatchMessage, Z as RawLayoutBlock, _ as ReadyMessage, $ as SITE_CONFIG_QUERY, a0 as SUBMIT_FORM_MUTATION, a1 as SelectMessage, a2 as SubmitFormInput, a3 as blocksToMeta, a4 as blocksToSchemas, a5 as buildBlockContext, a6 as buildBlockMap, a7 as defineBlock, a8 as fetchLayouts, a9 as fetchPage, aa as fetchPageById, ab as fetchPageMeta, ac as fetchPages, ad as isProtocolCompatible, ae as normalizeSlug, af as resolveApiUrl } from './commerce-queries-BSTuurfl.js';
1
+ import { F as FieldDefinition, C as CmssyPageData, b as BlockDefinition, c as CmssyFormDefinition, n as CmssyBlockAuthContext, o as CmssyBlockWorkspace, d as CmssyLayoutGroup, E as EditorToAppMessage, A as AppToEditorMessage, p as FetchLike, q as CmssyClientConfig, r as CmssySiteConfig, R as RawBlock, e as CmssyLocaleContext, s as BlockMap, t as CmssyBlockContext } from './commerce-queries-Ch7QldF7.js';
2
+ export { a as BlockMeta, u as BlockRect, B as BlockSchema, v as BoundsMessage, w as BuildBlockContextExtra, x as ClickMessage, y as CmssyBlockMember, z as CmssyBranding, f as CmssyCart, i as CmssyCartDiscount, j as CmssyCartItem, k as CmssyCartItemSnapshot, D as CmssyFormField, G as CmssyFormSettings, H as CmssyFormSubmitResponse, I as CmssyLocalizedValue, J as CmssyModelDefinition, K as CmssyModelRecord, g as CmssyOrder, L as CmssyPageMeta, M as CmssyPageSummary, h as CmssyProduct, m as CmssyProductVariant, N as CmssyRecordList, O as DEFAULT_CMSSY_API_URL, P as FORM_QUERY, Q as FetchLikeResponse, S as FetchPageOptions, T as MODEL_DEFINITIONS_QUERY, U as MODEL_RECORDS_QUERY, V as PROTOCOL_VERSION, W as ParentReadyMessage, X as PatchMessage, Y as RawLayoutBlock, Z as ReadyMessage, _ as SITE_CONFIG_QUERY, $ as SUBMIT_FORM_MUTATION, a0 as SelectMessage, a1 as SubmitFormInput, a2 as blocksToMeta, a3 as blocksToSchemas, a4 as buildBlockContext, a5 as buildBlockMap, a6 as defineBlock, a7 as fetchLayouts, a8 as fetchPage, a9 as fetchPageById, aa as fetchPageMeta, ab as fetchPages, ac as isProtocolCompatible, ad as normalizeSlug, ae as resolveApiUrl } from './commerce-queries-Ch7QldF7.js';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
+ export { FieldType } from '@cmssy/types';
4
5
  import 'react';
5
6
 
6
7
  type FieldControl = Omit<FieldDefinition, "type" | "label"> & {
7
8
  label?: string;
8
9
  };
9
10
  declare const fields: {
10
- singleLine: (opts?: FieldControl) => FieldDefinition;
11
- multiLine: (opts?: FieldControl) => FieldDefinition;
11
+ text: (opts?: FieldControl) => FieldDefinition;
12
+ textarea: (opts?: FieldControl) => FieldDefinition;
12
13
  richText: (opts?: FieldControl) => FieldDefinition;
13
- numeric: (opts?: FieldControl) => FieldDefinition;
14
+ number: (opts?: FieldControl) => FieldDefinition;
14
15
  date: (opts?: FieldControl) => FieldDefinition;
16
+ datetime: (opts?: FieldControl) => FieldDefinition;
17
+ boolean: (opts?: FieldControl) => FieldDefinition;
18
+ color: (opts?: FieldControl) => FieldDefinition;
15
19
  media: (opts?: FieldControl) => FieldDefinition;
16
20
  link: (opts?: FieldControl) => FieldDefinition;
21
+ url: (opts?: FieldControl) => FieldDefinition;
22
+ email: (opts?: FieldControl) => FieldDefinition;
17
23
  select: (opts?: FieldControl) => FieldDefinition;
18
24
  multiselect: (opts?: FieldControl) => FieldDefinition;
19
- boolean: (opts?: FieldControl) => FieldDefinition;
20
- color: (opts?: FieldControl) => FieldDefinition;
25
+ radio: (opts?: FieldControl) => FieldDefinition;
21
26
  repeater: (opts?: FieldControl) => FieldDefinition;
22
27
  };
23
28
 
package/dist/index.js CHANGED
@@ -10,17 +10,21 @@ function control(type) {
10
10
  });
11
11
  }
12
12
  var fields = {
13
- singleLine: control("singleLine"),
14
- multiLine: control("multiLine"),
13
+ text: control("text"),
14
+ textarea: control("textarea"),
15
15
  richText: control("richText"),
16
- numeric: control("numeric"),
16
+ number: control("number"),
17
17
  date: control("date"),
18
+ datetime: control("datetime"),
19
+ boolean: control("boolean"),
20
+ color: control("color"),
18
21
  media: control("media"),
19
22
  link: control("link"),
23
+ url: control("url"),
24
+ email: control("email"),
20
25
  select: control("select"),
21
26
  multiselect: control("multiselect"),
22
- boolean: control("boolean"),
23
- color: control("color"),
27
+ radio: control("radio"),
24
28
  repeater: control("repeater")
25
29
  };
26
30
 
@@ -211,7 +215,7 @@ function CmssyServerLayout({
211
215
  }
212
216
 
213
217
  // src/bridge/protocol.ts
214
- var PROTOCOL_VERSION = 1;
218
+ var PROTOCOL_VERSION = 2;
215
219
  function isProtocolCompatible(version) {
216
220
  return version === PROTOCOL_VERSION;
217
221
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmssy/react",
3
- "version": "0.7.7",
3
+ "version": "0.8.0",
4
4
  "description": "React blocks, renderers, data client and editor bridge for cmssy headless sites",
5
5
  "keywords": [
6
6
  "cmssy",
@@ -54,6 +54,9 @@
54
54
  "typescript": "^5.6.0",
55
55
  "vitest": "^2.1.0"
56
56
  },
57
+ "dependencies": {
58
+ "@cmssy/types": "^0.17.0"
59
+ },
57
60
  "scripts": {
58
61
  "build": "tsup",
59
62
  "test": "vitest run",