@cmssy/react 0.2.1 → 0.2.3

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
@@ -1097,8 +1097,9 @@ function matchVariant(variants, selections) {
1097
1097
  function ProductComponent({ content }) {
1098
1098
  const c = content;
1099
1099
  const { fetchProduct, addToCart } = useCart();
1100
- const [product, setProduct] = react.useState(null);
1101
- const [loading, setLoading] = react.useState(true);
1100
+ const injected = c.product ?? null;
1101
+ const [product, setProduct] = react.useState(injected);
1102
+ const [loading, setLoading] = react.useState(!injected && Boolean(c.slug));
1102
1103
  const [selections, setSelections] = react.useState({});
1103
1104
  const [adding, setAdding] = react.useState(false);
1104
1105
  const [added, setAdded] = react.useState(false);
@@ -1107,11 +1108,12 @@ function ProductComponent({ content }) {
1107
1108
  const slugField = c.slugField ?? "slug";
1108
1109
  const slug = c.slug ?? "";
1109
1110
  react.useEffect(() => {
1111
+ if (injected || !slug) return;
1110
1112
  let active = true;
1111
1113
  setLoading(true);
1112
1114
  void (async () => {
1113
1115
  try {
1114
- const result = slug ? await fetchProduct(modelSlug, { [slugField]: slug }) : null;
1116
+ const result = await fetchProduct(modelSlug, { [slugField]: slug });
1115
1117
  if (active) setProduct(result);
1116
1118
  } finally {
1117
1119
  if (active) setLoading(false);
@@ -1120,7 +1122,7 @@ function ProductComponent({ content }) {
1120
1122
  return () => {
1121
1123
  active = false;
1122
1124
  };
1123
- }, [fetchProduct, modelSlug, slugField, slug]);
1125
+ }, [injected, fetchProduct, modelSlug, slugField, slug]);
1124
1126
  const axes = react.useMemo(
1125
1127
  () => product ? deriveAxes(product.variants) : [],
1126
1128
  [product]
@@ -1405,6 +1407,54 @@ var checkoutBlock = defineBlock({
1405
1407
  },
1406
1408
  component: CheckoutComponent
1407
1409
  });
1410
+ function useCmssyOrders(options = {}) {
1411
+ const base = (options.basePath ?? "/api/cmssy/orders").replace(/\/+$/, "");
1412
+ const skip = options.skip ?? 0;
1413
+ const limit = options.limit ?? 20;
1414
+ const [orders, setOrders] = react.useState([]);
1415
+ const [total, setTotal] = react.useState(0);
1416
+ const [hasMore, setHasMore] = react.useState(false);
1417
+ const [loading, setLoading] = react.useState(true);
1418
+ const [error, setError] = react.useState(null);
1419
+ const load = react.useCallback(async () => {
1420
+ setLoading(true);
1421
+ setError(null);
1422
+ try {
1423
+ const qs = new URLSearchParams({
1424
+ skip: String(skip),
1425
+ limit: String(limit)
1426
+ });
1427
+ const res = await fetch(`${base}?${qs.toString()}`, {
1428
+ credentials: "same-origin",
1429
+ cache: "no-store"
1430
+ });
1431
+ if (res.status === 401) {
1432
+ setOrders([]);
1433
+ setTotal(0);
1434
+ setHasMore(false);
1435
+ return;
1436
+ }
1437
+ if (!res.ok) {
1438
+ const body = await res.json().catch(() => ({}));
1439
+ throw new Error(
1440
+ body.message ?? `Orders request failed (${res.status})`
1441
+ );
1442
+ }
1443
+ const data = await res.json();
1444
+ setOrders(data.items ?? []);
1445
+ setTotal(data.total ?? 0);
1446
+ setHasMore(Boolean(data.hasMore));
1447
+ } catch (e) {
1448
+ setError(e instanceof Error ? e.message : "Could not load orders");
1449
+ } finally {
1450
+ setLoading(false);
1451
+ }
1452
+ }, [base, skip, limit]);
1453
+ react.useEffect(() => {
1454
+ void load();
1455
+ }, [load]);
1456
+ return { orders, total, hasMore, loading, error, refresh: load };
1457
+ }
1408
1458
 
1409
1459
  exports.CmssyAuthProvider = CmssyAuthProvider;
1410
1460
  exports.CmssyCommerceProvider = CmssyCommerceProvider;
@@ -1420,5 +1470,6 @@ exports.fromMinorUnits = fromMinorUnits;
1420
1470
  exports.productBlock = productBlock;
1421
1471
  exports.toMinorUnits = toMinorUnits;
1422
1472
  exports.useCart = useCart;
1473
+ exports.useCmssyOrders = useCmssyOrders;
1423
1474
  exports.useCmssyUser = useCmssyUser;
1424
1475
  exports.useEditBridge = useEditBridge;
package/dist/client.d.cts CHANGED
@@ -1,6 +1,6 @@
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 CmssyCart, f as CmssyOrder, g as CmssyProduct } from './commerce-queries-DV7PZlKS.cjs';
3
- export { h as CmssyCartDiscount, i as CmssyCartItem, j as CmssyCartItemSnapshot, k as CmssyProductVariant } from './commerce-queries-DV7PZlKS.cjs';
2
+ import { B as BlockSchema, a as BlockMeta, C as CmssyPageData, b as BlockDefinition, c as CmssyFormDefinition, d as CmssyLayoutGroup, e as CmssyCart, f as CmssyOrder, g as CmssyProduct } from './commerce-queries-Uev-JCAB.cjs';
3
+ export { h as CmssyCartDiscount, i as CmssyCartItem, j as CmssyCartItemSnapshot, k as CmssyOrderItem, l as CmssyProductVariant } from './commerce-queries-Uev-JCAB.cjs';
4
4
  import { ReactNode } from 'react';
5
5
 
6
6
  interface EditBridgeConfig {
@@ -136,9 +136,24 @@ declare const cartBlock: BlockDefinition;
136
136
 
137
137
  declare const checkoutBlock: BlockDefinition;
138
138
 
139
+ interface CmssyOrdersState {
140
+ orders: CmssyOrder[];
141
+ total: number;
142
+ hasMore: boolean;
143
+ loading: boolean;
144
+ error: string | null;
145
+ refresh(): Promise<void>;
146
+ }
147
+ interface UseCmssyOrdersOptions {
148
+ basePath?: string;
149
+ skip?: number;
150
+ limit?: number;
151
+ }
152
+ declare function useCmssyOrders(options?: UseCmssyOrdersOptions): CmssyOrdersState;
153
+
139
154
  declare function fractionDigits(currency: string): number;
140
155
  declare function fromMinorUnits(minor: number, currency: string): number;
141
156
  declare function toMinorUnits(amount: number, currency: string): number;
142
157
  declare function formatPrice(minor: number, currency: string | null | undefined): string;
143
158
 
144
- export { type CmssyAddToCartOptions, type CmssyAuthActionResult, CmssyAuthProvider, type CmssyAuthProviderProps, type CmssyAuthState, type CmssyAuthUser, CmssyCart, CmssyCommerceProvider, type CmssyCommerceProviderProps, type CmssyCommerceState, CmssyEditableLayout, type CmssyEditableLayoutProps, CmssyEditablePage, type CmssyEditablePageProps, CmssyLazyEditor, type CmssyLazyEditorProps, CmssyLazyLayout, type CmssyLazyLayoutProps, CmssyOrder, CmssyProduct, type EditBridgeConfig, type EditBridgeState, type PatchMap, cartBlock, checkoutBlock, formatPrice, fractionDigits, fromMinorUnits, productBlock, toMinorUnits, useCart, useCmssyUser, useEditBridge };
159
+ export { type CmssyAddToCartOptions, type CmssyAuthActionResult, CmssyAuthProvider, type CmssyAuthProviderProps, type CmssyAuthState, type CmssyAuthUser, CmssyCart, CmssyCommerceProvider, type CmssyCommerceProviderProps, type CmssyCommerceState, CmssyEditableLayout, type CmssyEditableLayoutProps, CmssyEditablePage, type CmssyEditablePageProps, CmssyLazyEditor, type CmssyLazyEditorProps, CmssyLazyLayout, type CmssyLazyLayoutProps, CmssyOrder, type CmssyOrdersState, CmssyProduct, type EditBridgeConfig, type EditBridgeState, type PatchMap, type UseCmssyOrdersOptions, cartBlock, checkoutBlock, formatPrice, fractionDigits, fromMinorUnits, productBlock, toMinorUnits, useCart, useCmssyOrders, useCmssyUser, useEditBridge };
package/dist/client.d.ts CHANGED
@@ -1,6 +1,6 @@
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 CmssyCart, f as CmssyOrder, g as CmssyProduct } from './commerce-queries-DV7PZlKS.js';
3
- export { h as CmssyCartDiscount, i as CmssyCartItem, j as CmssyCartItemSnapshot, k as CmssyProductVariant } from './commerce-queries-DV7PZlKS.js';
2
+ import { B as BlockSchema, a as BlockMeta, C as CmssyPageData, b as BlockDefinition, c as CmssyFormDefinition, d as CmssyLayoutGroup, e as CmssyCart, f as CmssyOrder, g as CmssyProduct } from './commerce-queries-Uev-JCAB.js';
3
+ export { h as CmssyCartDiscount, i as CmssyCartItem, j as CmssyCartItemSnapshot, k as CmssyOrderItem, l as CmssyProductVariant } from './commerce-queries-Uev-JCAB.js';
4
4
  import { ReactNode } from 'react';
5
5
 
6
6
  interface EditBridgeConfig {
@@ -136,9 +136,24 @@ declare const cartBlock: BlockDefinition;
136
136
 
137
137
  declare const checkoutBlock: BlockDefinition;
138
138
 
139
+ interface CmssyOrdersState {
140
+ orders: CmssyOrder[];
141
+ total: number;
142
+ hasMore: boolean;
143
+ loading: boolean;
144
+ error: string | null;
145
+ refresh(): Promise<void>;
146
+ }
147
+ interface UseCmssyOrdersOptions {
148
+ basePath?: string;
149
+ skip?: number;
150
+ limit?: number;
151
+ }
152
+ declare function useCmssyOrders(options?: UseCmssyOrdersOptions): CmssyOrdersState;
153
+
139
154
  declare function fractionDigits(currency: string): number;
140
155
  declare function fromMinorUnits(minor: number, currency: string): number;
141
156
  declare function toMinorUnits(amount: number, currency: string): number;
142
157
  declare function formatPrice(minor: number, currency: string | null | undefined): string;
143
158
 
144
- export { type CmssyAddToCartOptions, type CmssyAuthActionResult, CmssyAuthProvider, type CmssyAuthProviderProps, type CmssyAuthState, type CmssyAuthUser, CmssyCart, CmssyCommerceProvider, type CmssyCommerceProviderProps, type CmssyCommerceState, CmssyEditableLayout, type CmssyEditableLayoutProps, CmssyEditablePage, type CmssyEditablePageProps, CmssyLazyEditor, type CmssyLazyEditorProps, CmssyLazyLayout, type CmssyLazyLayoutProps, CmssyOrder, CmssyProduct, type EditBridgeConfig, type EditBridgeState, type PatchMap, cartBlock, checkoutBlock, formatPrice, fractionDigits, fromMinorUnits, productBlock, toMinorUnits, useCart, useCmssyUser, useEditBridge };
159
+ export { type CmssyAddToCartOptions, type CmssyAuthActionResult, CmssyAuthProvider, type CmssyAuthProviderProps, type CmssyAuthState, type CmssyAuthUser, CmssyCart, CmssyCommerceProvider, type CmssyCommerceProviderProps, type CmssyCommerceState, CmssyEditableLayout, type CmssyEditableLayoutProps, CmssyEditablePage, type CmssyEditablePageProps, CmssyLazyEditor, type CmssyLazyEditorProps, CmssyLazyLayout, type CmssyLazyLayoutProps, CmssyOrder, type CmssyOrdersState, CmssyProduct, type EditBridgeConfig, type EditBridgeState, type PatchMap, type UseCmssyOrdersOptions, cartBlock, checkoutBlock, formatPrice, fractionDigits, fromMinorUnits, productBlock, toMinorUnits, useCart, useCmssyOrders, useCmssyUser, useEditBridge };
package/dist/client.js CHANGED
@@ -1095,8 +1095,9 @@ function matchVariant(variants, selections) {
1095
1095
  function ProductComponent({ content }) {
1096
1096
  const c = content;
1097
1097
  const { fetchProduct, addToCart } = useCart();
1098
- const [product, setProduct] = useState(null);
1099
- const [loading, setLoading] = useState(true);
1098
+ const injected = c.product ?? null;
1099
+ const [product, setProduct] = useState(injected);
1100
+ const [loading, setLoading] = useState(!injected && Boolean(c.slug));
1100
1101
  const [selections, setSelections] = useState({});
1101
1102
  const [adding, setAdding] = useState(false);
1102
1103
  const [added, setAdded] = useState(false);
@@ -1105,11 +1106,12 @@ function ProductComponent({ content }) {
1105
1106
  const slugField = c.slugField ?? "slug";
1106
1107
  const slug = c.slug ?? "";
1107
1108
  useEffect(() => {
1109
+ if (injected || !slug) return;
1108
1110
  let active = true;
1109
1111
  setLoading(true);
1110
1112
  void (async () => {
1111
1113
  try {
1112
- const result = slug ? await fetchProduct(modelSlug, { [slugField]: slug }) : null;
1114
+ const result = await fetchProduct(modelSlug, { [slugField]: slug });
1113
1115
  if (active) setProduct(result);
1114
1116
  } finally {
1115
1117
  if (active) setLoading(false);
@@ -1118,7 +1120,7 @@ function ProductComponent({ content }) {
1118
1120
  return () => {
1119
1121
  active = false;
1120
1122
  };
1121
- }, [fetchProduct, modelSlug, slugField, slug]);
1123
+ }, [injected, fetchProduct, modelSlug, slugField, slug]);
1122
1124
  const axes = useMemo(
1123
1125
  () => product ? deriveAxes(product.variants) : [],
1124
1126
  [product]
@@ -1403,5 +1405,53 @@ var checkoutBlock = defineBlock({
1403
1405
  },
1404
1406
  component: CheckoutComponent
1405
1407
  });
1408
+ function useCmssyOrders(options = {}) {
1409
+ const base = (options.basePath ?? "/api/cmssy/orders").replace(/\/+$/, "");
1410
+ const skip = options.skip ?? 0;
1411
+ const limit = options.limit ?? 20;
1412
+ const [orders, setOrders] = useState([]);
1413
+ const [total, setTotal] = useState(0);
1414
+ const [hasMore, setHasMore] = useState(false);
1415
+ const [loading, setLoading] = useState(true);
1416
+ const [error, setError] = useState(null);
1417
+ const load = useCallback(async () => {
1418
+ setLoading(true);
1419
+ setError(null);
1420
+ try {
1421
+ const qs = new URLSearchParams({
1422
+ skip: String(skip),
1423
+ limit: String(limit)
1424
+ });
1425
+ const res = await fetch(`${base}?${qs.toString()}`, {
1426
+ credentials: "same-origin",
1427
+ cache: "no-store"
1428
+ });
1429
+ if (res.status === 401) {
1430
+ setOrders([]);
1431
+ setTotal(0);
1432
+ setHasMore(false);
1433
+ return;
1434
+ }
1435
+ if (!res.ok) {
1436
+ const body = await res.json().catch(() => ({}));
1437
+ throw new Error(
1438
+ body.message ?? `Orders request failed (${res.status})`
1439
+ );
1440
+ }
1441
+ const data = await res.json();
1442
+ setOrders(data.items ?? []);
1443
+ setTotal(data.total ?? 0);
1444
+ setHasMore(Boolean(data.hasMore));
1445
+ } catch (e) {
1446
+ setError(e instanceof Error ? e.message : "Could not load orders");
1447
+ } finally {
1448
+ setLoading(false);
1449
+ }
1450
+ }, [base, skip, limit]);
1451
+ useEffect(() => {
1452
+ void load();
1453
+ }, [load]);
1454
+ return { orders, total, hasMore, loading, error, refresh: load };
1455
+ }
1406
1456
 
1407
- export { CmssyAuthProvider, CmssyCommerceProvider, CmssyEditableLayout, CmssyEditablePage, CmssyLazyEditor, CmssyLazyLayout, cartBlock, checkoutBlock, formatPrice, fractionDigits, fromMinorUnits, productBlock, toMinorUnits, useCart, useCmssyUser, useEditBridge };
1457
+ export { CmssyAuthProvider, CmssyCommerceProvider, CmssyEditableLayout, CmssyEditablePage, CmssyLazyEditor, CmssyLazyLayout, cartBlock, checkoutBlock, formatPrice, fractionDigits, fromMinorUnits, productBlock, toMinorUnits, useCart, useCmssyOrders, useCmssyUser, useEditBridge };
@@ -359,6 +359,13 @@ interface CmssyProduct {
359
359
  data: Record<string, unknown>;
360
360
  variants: CmssyProductVariant[];
361
361
  }
362
+ interface CmssyOrderItem {
363
+ name: string;
364
+ price: number;
365
+ currency: string;
366
+ quantity: number;
367
+ sku: string | null;
368
+ }
362
369
  interface CmssyOrder {
363
370
  id: string;
364
371
  status: string;
@@ -366,6 +373,13 @@ interface CmssyOrder {
366
373
  total: number;
367
374
  currency: string;
368
375
  customerEmail: string;
376
+ tax?: number;
377
+ refundedAmount?: number;
378
+ items?: CmssyOrderItem[];
379
+ paymentProvider?: string | null;
380
+ paidAt?: string | null;
381
+ fulfilledAt?: string | null;
382
+ createdAt?: string;
369
383
  }
370
384
 
371
- export { fetchLayouts as $, type AppToEditorMessage as A, type BlockSchema as B, type CmssyPageData as C, type CmssySiteConfig as D, type EditorToAppMessage as E, type FieldDefinition as F, FORM_QUERY as G, type FetchLikeResponse as H, type FetchPageOptions as I, type FieldType as J, MODEL_RECORDS_QUERY as K, type ParentReadyMessage as L, MODEL_DEFINITIONS_QUERY as M, type PatchMessage as N, type RawLayoutBlock as O, PROTOCOL_VERSION as P, type ReadyMessage as Q, type RawBlock as R, SITE_CONFIG_QUERY as S, SUBMIT_FORM_MUTATION as T, type SelectMessage as U, type SubmitFormInput as V, blocksToMeta as W, blocksToSchemas as X, buildBlockContext as Y, buildBlockMap as Z, defineBlock as _, type BlockMeta as a, fetchPage as a0, isProtocolCompatible as a1, normalizeSlug as a2, type BlockDefinition as b, type CmssyFormDefinition as c, type CmssyLayoutGroup as d, type CmssyCart as e, type CmssyOrder as f, type CmssyProduct as g, type CmssyCartDiscount as h, type CmssyCartItem as i, type CmssyCartItemSnapshot as j, type CmssyProductVariant as k, type FetchLike as l, type CmssyClientConfig as m, type BlockMap as n, type CmssyBlockContext as o, type BlockRect as p, type BoundsMessage as q, type ClickMessage as r, type CmssyBranding as s, type CmssyFormField as t, type CmssyFormSettings as u, type CmssyFormSubmitResponse as v, type CmssyLocaleContext as w, type CmssyModelDefinition as x, type CmssyModelRecord as y, type CmssyRecordList as z };
385
+ export { defineBlock as $, type AppToEditorMessage as A, type BlockSchema as B, type CmssyPageData as C, type CmssyRecordList as D, type EditorToAppMessage as E, type FieldDefinition as F, type CmssySiteConfig as G, FORM_QUERY as H, type FetchLikeResponse as I, type FetchPageOptions as J, type FieldType as K, MODEL_RECORDS_QUERY as L, MODEL_DEFINITIONS_QUERY as M, type ParentReadyMessage as N, type PatchMessage as O, PROTOCOL_VERSION as P, type RawLayoutBlock as Q, type RawBlock as R, type ReadyMessage as S, SITE_CONFIG_QUERY as T, SUBMIT_FORM_MUTATION as U, type SelectMessage as V, type SubmitFormInput as W, blocksToMeta as X, blocksToSchemas as Y, buildBlockContext as Z, buildBlockMap as _, type BlockMeta as a, fetchLayouts as a0, fetchPage as a1, isProtocolCompatible as a2, normalizeSlug as a3, type BlockDefinition as b, type CmssyFormDefinition as c, type CmssyLayoutGroup as d, type CmssyCart as e, type CmssyOrder as f, type CmssyProduct as g, type CmssyCartDiscount as h, type CmssyCartItem as i, type CmssyCartItemSnapshot as j, type CmssyOrderItem as k, type CmssyProductVariant as l, type FetchLike as m, type CmssyClientConfig as n, type BlockMap as o, type CmssyBlockContext as p, type BlockRect as q, type BoundsMessage as r, type ClickMessage as s, type CmssyBranding as t, type CmssyFormField as u, type CmssyFormSettings as v, type CmssyFormSubmitResponse as w, type CmssyLocaleContext as x, type CmssyModelDefinition as y, type CmssyModelRecord as z };
@@ -359,6 +359,13 @@ interface CmssyProduct {
359
359
  data: Record<string, unknown>;
360
360
  variants: CmssyProductVariant[];
361
361
  }
362
+ interface CmssyOrderItem {
363
+ name: string;
364
+ price: number;
365
+ currency: string;
366
+ quantity: number;
367
+ sku: string | null;
368
+ }
362
369
  interface CmssyOrder {
363
370
  id: string;
364
371
  status: string;
@@ -366,6 +373,13 @@ interface CmssyOrder {
366
373
  total: number;
367
374
  currency: string;
368
375
  customerEmail: string;
376
+ tax?: number;
377
+ refundedAmount?: number;
378
+ items?: CmssyOrderItem[];
379
+ paymentProvider?: string | null;
380
+ paidAt?: string | null;
381
+ fulfilledAt?: string | null;
382
+ createdAt?: string;
369
383
  }
370
384
 
371
- export { fetchLayouts as $, type AppToEditorMessage as A, type BlockSchema as B, type CmssyPageData as C, type CmssySiteConfig as D, type EditorToAppMessage as E, type FieldDefinition as F, FORM_QUERY as G, type FetchLikeResponse as H, type FetchPageOptions as I, type FieldType as J, MODEL_RECORDS_QUERY as K, type ParentReadyMessage as L, MODEL_DEFINITIONS_QUERY as M, type PatchMessage as N, type RawLayoutBlock as O, PROTOCOL_VERSION as P, type ReadyMessage as Q, type RawBlock as R, SITE_CONFIG_QUERY as S, SUBMIT_FORM_MUTATION as T, type SelectMessage as U, type SubmitFormInput as V, blocksToMeta as W, blocksToSchemas as X, buildBlockContext as Y, buildBlockMap as Z, defineBlock as _, type BlockMeta as a, fetchPage as a0, isProtocolCompatible as a1, normalizeSlug as a2, type BlockDefinition as b, type CmssyFormDefinition as c, type CmssyLayoutGroup as d, type CmssyCart as e, type CmssyOrder as f, type CmssyProduct as g, type CmssyCartDiscount as h, type CmssyCartItem as i, type CmssyCartItemSnapshot as j, type CmssyProductVariant as k, type FetchLike as l, type CmssyClientConfig as m, type BlockMap as n, type CmssyBlockContext as o, type BlockRect as p, type BoundsMessage as q, type ClickMessage as r, type CmssyBranding as s, type CmssyFormField as t, type CmssyFormSettings as u, type CmssyFormSubmitResponse as v, type CmssyLocaleContext as w, type CmssyModelDefinition as x, type CmssyModelRecord as y, type CmssyRecordList as z };
385
+ export { defineBlock as $, type AppToEditorMessage as A, type BlockSchema as B, type CmssyPageData as C, type CmssyRecordList as D, type EditorToAppMessage as E, type FieldDefinition as F, type CmssySiteConfig as G, FORM_QUERY as H, type FetchLikeResponse as I, type FetchPageOptions as J, type FieldType as K, MODEL_RECORDS_QUERY as L, MODEL_DEFINITIONS_QUERY as M, type ParentReadyMessage as N, type PatchMessage as O, PROTOCOL_VERSION as P, type RawLayoutBlock as Q, type RawBlock as R, type ReadyMessage as S, SITE_CONFIG_QUERY as T, SUBMIT_FORM_MUTATION as U, type SelectMessage as V, type SubmitFormInput as W, blocksToMeta as X, blocksToSchemas as Y, buildBlockContext as Z, buildBlockMap as _, type BlockMeta as a, fetchLayouts as a0, fetchPage as a1, isProtocolCompatible as a2, normalizeSlug as a3, type BlockDefinition as b, type CmssyFormDefinition as c, type CmssyLayoutGroup as d, type CmssyCart as e, type CmssyOrder as f, type CmssyProduct as g, type CmssyCartDiscount as h, type CmssyCartItem as i, type CmssyCartItemSnapshot as j, type CmssyOrderItem as k, type CmssyProductVariant as l, type FetchLike as m, type CmssyClientConfig as n, type BlockMap as o, type CmssyBlockContext as p, type BlockRect as q, type BoundsMessage as r, type ClickMessage as s, type CmssyBranding as t, type CmssyFormField as u, type CmssyFormSettings as v, type CmssyFormSubmitResponse as w, type CmssyLocaleContext as x, type CmssyModelDefinition as y, type CmssyModelRecord as z };
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { F as FieldDefinition, C as CmssyPageData, b as BlockDefinition, c as CmssyFormDefinition, d as CmssyLayoutGroup, E as EditorToAppMessage, A as AppToEditorMessage, l as FetchLike, m as CmssyClientConfig, R as RawBlock, n as BlockMap, o as CmssyBlockContext } from './commerce-queries-DV7PZlKS.cjs';
2
- export { a as BlockMeta, p as BlockRect, B as BlockSchema, q as BoundsMessage, r as ClickMessage, s as CmssyBranding, e as CmssyCart, h as CmssyCartDiscount, i as CmssyCartItem, j as CmssyCartItemSnapshot, t as CmssyFormField, u as CmssyFormSettings, v as CmssyFormSubmitResponse, w as CmssyLocaleContext, x as CmssyModelDefinition, y as CmssyModelRecord, f as CmssyOrder, g as CmssyProduct, k as CmssyProductVariant, z as CmssyRecordList, D as CmssySiteConfig, G as FORM_QUERY, H as FetchLikeResponse, I as FetchPageOptions, J as FieldType, M as MODEL_DEFINITIONS_QUERY, K as MODEL_RECORDS_QUERY, P as PROTOCOL_VERSION, L as ParentReadyMessage, N as PatchMessage, O as RawLayoutBlock, Q as ReadyMessage, S as SITE_CONFIG_QUERY, T as SUBMIT_FORM_MUTATION, U as SelectMessage, V as SubmitFormInput, W as blocksToMeta, X as blocksToSchemas, Y as buildBlockContext, Z as buildBlockMap, _ as defineBlock, $ as fetchLayouts, a0 as fetchPage, a1 as isProtocolCompatible, a2 as normalizeSlug } from './commerce-queries-DV7PZlKS.cjs';
1
+ import { F as FieldDefinition, C as CmssyPageData, b as BlockDefinition, c as CmssyFormDefinition, d as CmssyLayoutGroup, E as EditorToAppMessage, A as AppToEditorMessage, m as FetchLike, n as CmssyClientConfig, R as RawBlock, o as BlockMap, p as CmssyBlockContext } from './commerce-queries-Uev-JCAB.cjs';
2
+ export { a as BlockMeta, q as BlockRect, B as BlockSchema, r as BoundsMessage, s as ClickMessage, t as CmssyBranding, e as CmssyCart, h as CmssyCartDiscount, i as CmssyCartItem, j as CmssyCartItemSnapshot, u as CmssyFormField, v as CmssyFormSettings, w as CmssyFormSubmitResponse, x as CmssyLocaleContext, y as CmssyModelDefinition, z as CmssyModelRecord, f as CmssyOrder, g as CmssyProduct, l as CmssyProductVariant, D as CmssyRecordList, G as CmssySiteConfig, H as FORM_QUERY, I as FetchLikeResponse, J as FetchPageOptions, K as FieldType, M as MODEL_DEFINITIONS_QUERY, L as MODEL_RECORDS_QUERY, P as PROTOCOL_VERSION, N as ParentReadyMessage, O as PatchMessage, Q as RawLayoutBlock, S as ReadyMessage, T as SITE_CONFIG_QUERY, U as SUBMIT_FORM_MUTATION, V as SelectMessage, W as SubmitFormInput, X as blocksToMeta, Y as blocksToSchemas, Z as buildBlockContext, _ as buildBlockMap, $ as defineBlock, a0 as fetchLayouts, a1 as fetchPage, a2 as isProtocolCompatible, a3 as normalizeSlug } from './commerce-queries-Uev-JCAB.cjs';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import 'react';
5
5
 
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { F as FieldDefinition, C as CmssyPageData, b as BlockDefinition, c as CmssyFormDefinition, d as CmssyLayoutGroup, E as EditorToAppMessage, A as AppToEditorMessage, l as FetchLike, m as CmssyClientConfig, R as RawBlock, n as BlockMap, o as CmssyBlockContext } from './commerce-queries-DV7PZlKS.js';
2
- export { a as BlockMeta, p as BlockRect, B as BlockSchema, q as BoundsMessage, r as ClickMessage, s as CmssyBranding, e as CmssyCart, h as CmssyCartDiscount, i as CmssyCartItem, j as CmssyCartItemSnapshot, t as CmssyFormField, u as CmssyFormSettings, v as CmssyFormSubmitResponse, w as CmssyLocaleContext, x as CmssyModelDefinition, y as CmssyModelRecord, f as CmssyOrder, g as CmssyProduct, k as CmssyProductVariant, z as CmssyRecordList, D as CmssySiteConfig, G as FORM_QUERY, H as FetchLikeResponse, I as FetchPageOptions, J as FieldType, M as MODEL_DEFINITIONS_QUERY, K as MODEL_RECORDS_QUERY, P as PROTOCOL_VERSION, L as ParentReadyMessage, N as PatchMessage, O as RawLayoutBlock, Q as ReadyMessage, S as SITE_CONFIG_QUERY, T as SUBMIT_FORM_MUTATION, U as SelectMessage, V as SubmitFormInput, W as blocksToMeta, X as blocksToSchemas, Y as buildBlockContext, Z as buildBlockMap, _ as defineBlock, $ as fetchLayouts, a0 as fetchPage, a1 as isProtocolCompatible, a2 as normalizeSlug } from './commerce-queries-DV7PZlKS.js';
1
+ import { F as FieldDefinition, C as CmssyPageData, b as BlockDefinition, c as CmssyFormDefinition, d as CmssyLayoutGroup, E as EditorToAppMessage, A as AppToEditorMessage, m as FetchLike, n as CmssyClientConfig, R as RawBlock, o as BlockMap, p as CmssyBlockContext } from './commerce-queries-Uev-JCAB.js';
2
+ export { a as BlockMeta, q as BlockRect, B as BlockSchema, r as BoundsMessage, s as ClickMessage, t as CmssyBranding, e as CmssyCart, h as CmssyCartDiscount, i as CmssyCartItem, j as CmssyCartItemSnapshot, u as CmssyFormField, v as CmssyFormSettings, w as CmssyFormSubmitResponse, x as CmssyLocaleContext, y as CmssyModelDefinition, z as CmssyModelRecord, f as CmssyOrder, g as CmssyProduct, l as CmssyProductVariant, D as CmssyRecordList, G as CmssySiteConfig, H as FORM_QUERY, I as FetchLikeResponse, J as FetchPageOptions, K as FieldType, M as MODEL_DEFINITIONS_QUERY, L as MODEL_RECORDS_QUERY, P as PROTOCOL_VERSION, N as ParentReadyMessage, O as PatchMessage, Q as RawLayoutBlock, S as ReadyMessage, T as SITE_CONFIG_QUERY, U as SUBMIT_FORM_MUTATION, V as SelectMessage, W as SubmitFormInput, X as blocksToMeta, Y as blocksToSchemas, Z as buildBlockContext, _ as buildBlockMap, $ as defineBlock, a0 as fetchLayouts, a1 as fetchPage, a2 as isProtocolCompatible, a3 as normalizeSlug } from './commerce-queries-Uev-JCAB.js';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import 'react';
5
5
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmssy/react",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "React blocks, renderers, data client and editor bridge for cmssy headless sites",
5
5
  "keywords": [
6
6
  "cmssy",