@cmssy/react 2.0.0 → 2.2.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.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 CmssyLocaleContext, f as CmssyAddress, g as CmssyCart, h as CmssyOrder, i as CmssyProduct } from './commerce-queries-fR6ZKQ3r.cjs';
3
- export { j as CmssyCartDiscount, k as CmssyCartItem, l as CmssyCartItemSnapshot, m as CmssyOrderItem, n as CmssyProductVariant } from './commerce-queries-fR6ZKQ3r.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 CmssyAddress, g as CmssyCart, h as CmssyOrder, i as CmssyProduct } from './commerce-queries-BFnU2_SV.cjs';
3
+ export { j as CmssyCartDiscount, k as CmssyCartItem, l as CmssyCartItemSnapshot, m as CmssyOrderItem, n as CmssyProductVariant } from './commerce-queries-BFnU2_SV.cjs';
4
4
  import { ReactNode } from 'react';
5
5
  import '@cmssy/types';
6
6
 
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 CmssyLocaleContext, f as CmssyAddress, g as CmssyCart, h as CmssyOrder, i as CmssyProduct } from './commerce-queries-fR6ZKQ3r.js';
3
- export { j as CmssyCartDiscount, k as CmssyCartItem, l as CmssyCartItemSnapshot, m as CmssyOrderItem, n as CmssyProductVariant } from './commerce-queries-fR6ZKQ3r.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 CmssyAddress, g as CmssyCart, h as CmssyOrder, i as CmssyProduct } from './commerce-queries-BFnU2_SV.js';
3
+ export { j as CmssyCartDiscount, k as CmssyCartItem, l as CmssyCartItemSnapshot, m as CmssyOrderItem, n as CmssyProductVariant } from './commerce-queries-BFnU2_SV.js';
4
4
  import { ReactNode } from 'react';
5
5
  import '@cmssy/types';
6
6
 
@@ -499,10 +499,18 @@ interface CmssyOrderPayment {
499
499
  at: string;
500
500
  }
501
501
  type CmssyOrderTaxSummaryLine = CmssyTaxSummaryLine;
502
+ interface CmssyOrderDiscount {
503
+ code: string;
504
+ type: string;
505
+ value: number;
506
+ amount: number;
507
+ }
502
508
  interface CmssyOrder {
503
509
  id: string;
504
510
  status: string;
505
511
  subtotal: number;
512
+ discount?: number;
513
+ appliedDiscount?: CmssyOrderDiscount | null;
506
514
  total: number;
507
515
  currency: string;
508
516
  customerEmail: string;
@@ -539,4 +547,4 @@ interface CmssyOrder {
539
547
  accessToken?: string | null;
540
548
  }
541
549
 
542
- export { type ParentReadyMessage as $, type AppToEditorMessage as A, type BlockSchema as B, type CmssyPageData as C, type CmssyBranding as D, type EditorToAppMessage as E, type FieldDefinition as F, type CmssyFormField as G, type CmssyFormSettings as H, type CmssyFormSubmitResponse as I, type CmssyLocalizedValue as J, type CmssyModelDefinition as K, type CmssyModelRecord as L, type CmssyOrderTaxSummaryLine as M, type CmssyPageMeta as N, type CmssyPageSummary as O, type CmssyPriceTier as P, type CmssyRecordList as Q, type RawBlock as R, type CmssyShippingMethod as S, type CmssyTaxSummaryLine as T, DEFAULT_CMSSY_API_URL as U, FORM_QUERY as V, type FetchLikeResponse as W, type FetchPageOptions as X, MODEL_DEFINITIONS_QUERY as Y, MODEL_RECORDS_QUERY as Z, PROTOCOL_VERSION as _, type BlockMeta as a, type PatchMessage as a0, type RawLayoutBlock as a1, type ReadyMessage as a2, SITE_CONFIG_QUERY as a3, SUBMIT_FORM_MUTATION as a4, type SelectMessage as a5, type SubmitFormInput as a6, blocksToMeta as a7, blocksToSchemas as a8, buildBlockContext as a9, buildBlockMap as aa, defineBlock as ab, fetchLayouts as ac, fetchPage as ad, fetchPageById as ae, fetchPageMeta as af, fetchPages as ag, isProtocolCompatible as ah, normalizeSlug as ai, resolveApiUrl as aj, resolvePublicUrl as ak, type BlockDefinition as b, type CmssyFormDefinition as c, type CmssyLayoutGroup as d, type CmssyLocaleContext as e, type CmssyAddress as f, type CmssyCart as g, type CmssyOrder as h, type CmssyProduct as i, type CmssyCartDiscount as j, type CmssyCartItem as k, type CmssyCartItemSnapshot as l, type CmssyOrderItem as m, type CmssyProductVariant as n, type CmssyBlockAuthContext as o, type CmssyBlockWorkspace as p, type FetchLike as q, type CmssyClientConfig as r, type CmssySiteConfig as s, type BlockMap as t, type CmssyBlockContext as u, type BlockRect as v, type BoundsMessage as w, type BuildBlockContextExtra as x, type ClickMessage as y, type CmssyBlockMember as z };
550
+ export { PROTOCOL_VERSION as $, type AppToEditorMessage as A, type BlockSchema as B, type CmssyPageData as C, type CmssyBranding as D, type EditorToAppMessage as E, type FieldDefinition as F, type CmssyFormField as G, type CmssyFormSettings as H, type CmssyFormSubmitResponse as I, type CmssyLocalizedValue as J, type CmssyModelDefinition as K, type CmssyModelRecord as L, type CmssyOrderDiscount as M, type CmssyOrderTaxSummaryLine as N, type CmssyPageMeta as O, type CmssyPageSummary as P, type CmssyPriceTier as Q, type RawBlock as R, type CmssyRecordList as S, type CmssyShippingMethod as T, type CmssyTaxSummaryLine as U, DEFAULT_CMSSY_API_URL as V, FORM_QUERY as W, type FetchLikeResponse as X, type FetchPageOptions as Y, MODEL_DEFINITIONS_QUERY as Z, MODEL_RECORDS_QUERY as _, type BlockMeta as a, type ParentReadyMessage as a0, type PatchMessage as a1, type RawLayoutBlock as a2, type ReadyMessage as a3, SITE_CONFIG_QUERY as a4, SUBMIT_FORM_MUTATION as a5, type SelectMessage as a6, type SubmitFormInput as a7, blocksToMeta as a8, blocksToSchemas as a9, buildBlockContext as aa, buildBlockMap as ab, defineBlock as ac, fetchLayouts as ad, fetchPage as ae, fetchPageById as af, fetchPageMeta as ag, fetchPages as ah, isProtocolCompatible as ai, normalizeSlug as aj, resolveApiUrl as ak, resolvePublicUrl as al, type BlockDefinition as b, type CmssyFormDefinition as c, type CmssyLayoutGroup as d, type CmssyLocaleContext as e, type CmssyAddress as f, type CmssyCart as g, type CmssyOrder as h, type CmssyProduct as i, type CmssyCartDiscount as j, type CmssyCartItem as k, type CmssyCartItemSnapshot as l, type CmssyOrderItem as m, type CmssyProductVariant as n, type CmssyBlockAuthContext as o, type CmssyBlockWorkspace as p, type FetchLike as q, type CmssyClientConfig as r, type CmssySiteConfig as s, type BlockMap as t, type CmssyBlockContext as u, type BlockRect as v, type BoundsMessage as w, type BuildBlockContextExtra as x, type ClickMessage as y, type CmssyBlockMember as z };
@@ -499,10 +499,18 @@ interface CmssyOrderPayment {
499
499
  at: string;
500
500
  }
501
501
  type CmssyOrderTaxSummaryLine = CmssyTaxSummaryLine;
502
+ interface CmssyOrderDiscount {
503
+ code: string;
504
+ type: string;
505
+ value: number;
506
+ amount: number;
507
+ }
502
508
  interface CmssyOrder {
503
509
  id: string;
504
510
  status: string;
505
511
  subtotal: number;
512
+ discount?: number;
513
+ appliedDiscount?: CmssyOrderDiscount | null;
506
514
  total: number;
507
515
  currency: string;
508
516
  customerEmail: string;
@@ -539,4 +547,4 @@ interface CmssyOrder {
539
547
  accessToken?: string | null;
540
548
  }
541
549
 
542
- export { type ParentReadyMessage as $, type AppToEditorMessage as A, type BlockSchema as B, type CmssyPageData as C, type CmssyBranding as D, type EditorToAppMessage as E, type FieldDefinition as F, type CmssyFormField as G, type CmssyFormSettings as H, type CmssyFormSubmitResponse as I, type CmssyLocalizedValue as J, type CmssyModelDefinition as K, type CmssyModelRecord as L, type CmssyOrderTaxSummaryLine as M, type CmssyPageMeta as N, type CmssyPageSummary as O, type CmssyPriceTier as P, type CmssyRecordList as Q, type RawBlock as R, type CmssyShippingMethod as S, type CmssyTaxSummaryLine as T, DEFAULT_CMSSY_API_URL as U, FORM_QUERY as V, type FetchLikeResponse as W, type FetchPageOptions as X, MODEL_DEFINITIONS_QUERY as Y, MODEL_RECORDS_QUERY as Z, PROTOCOL_VERSION as _, type BlockMeta as a, type PatchMessage as a0, type RawLayoutBlock as a1, type ReadyMessage as a2, SITE_CONFIG_QUERY as a3, SUBMIT_FORM_MUTATION as a4, type SelectMessage as a5, type SubmitFormInput as a6, blocksToMeta as a7, blocksToSchemas as a8, buildBlockContext as a9, buildBlockMap as aa, defineBlock as ab, fetchLayouts as ac, fetchPage as ad, fetchPageById as ae, fetchPageMeta as af, fetchPages as ag, isProtocolCompatible as ah, normalizeSlug as ai, resolveApiUrl as aj, resolvePublicUrl as ak, type BlockDefinition as b, type CmssyFormDefinition as c, type CmssyLayoutGroup as d, type CmssyLocaleContext as e, type CmssyAddress as f, type CmssyCart as g, type CmssyOrder as h, type CmssyProduct as i, type CmssyCartDiscount as j, type CmssyCartItem as k, type CmssyCartItemSnapshot as l, type CmssyOrderItem as m, type CmssyProductVariant as n, type CmssyBlockAuthContext as o, type CmssyBlockWorkspace as p, type FetchLike as q, type CmssyClientConfig as r, type CmssySiteConfig as s, type BlockMap as t, type CmssyBlockContext as u, type BlockRect as v, type BoundsMessage as w, type BuildBlockContextExtra as x, type ClickMessage as y, type CmssyBlockMember as z };
550
+ export { PROTOCOL_VERSION as $, type AppToEditorMessage as A, type BlockSchema as B, type CmssyPageData as C, type CmssyBranding as D, type EditorToAppMessage as E, type FieldDefinition as F, type CmssyFormField as G, type CmssyFormSettings as H, type CmssyFormSubmitResponse as I, type CmssyLocalizedValue as J, type CmssyModelDefinition as K, type CmssyModelRecord as L, type CmssyOrderDiscount as M, type CmssyOrderTaxSummaryLine as N, type CmssyPageMeta as O, type CmssyPageSummary as P, type CmssyPriceTier as Q, type RawBlock as R, type CmssyRecordList as S, type CmssyShippingMethod as T, type CmssyTaxSummaryLine as U, DEFAULT_CMSSY_API_URL as V, FORM_QUERY as W, type FetchLikeResponse as X, type FetchPageOptions as Y, MODEL_DEFINITIONS_QUERY as Z, MODEL_RECORDS_QUERY as _, type BlockMeta as a, type ParentReadyMessage as a0, type PatchMessage as a1, type RawLayoutBlock as a2, type ReadyMessage as a3, SITE_CONFIG_QUERY as a4, SUBMIT_FORM_MUTATION as a5, type SelectMessage as a6, type SubmitFormInput as a7, blocksToMeta as a8, blocksToSchemas as a9, buildBlockContext as aa, buildBlockMap as ab, defineBlock as ac, fetchLayouts as ad, fetchPage as ae, fetchPageById as af, fetchPageMeta as ag, fetchPages as ah, isProtocolCompatible as ai, normalizeSlug as aj, resolveApiUrl as ak, resolvePublicUrl as al, type BlockDefinition as b, type CmssyFormDefinition as c, type CmssyLayoutGroup as d, type CmssyLocaleContext as e, type CmssyAddress as f, type CmssyCart as g, type CmssyOrder as h, type CmssyProduct as i, type CmssyCartDiscount as j, type CmssyCartItem as k, type CmssyCartItemSnapshot as l, type CmssyOrderItem as m, type CmssyProductVariant as n, type CmssyBlockAuthContext as o, type CmssyBlockWorkspace as p, type FetchLike as q, type CmssyClientConfig as r, type CmssySiteConfig as s, type BlockMap as t, type CmssyBlockContext as u, type BlockRect as v, type BoundsMessage as w, type BuildBlockContextExtra as x, type ClickMessage as y, type CmssyBlockMember 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, o as CmssyBlockAuthContext, p as CmssyBlockWorkspace, d as CmssyLayoutGroup, E as EditorToAppMessage, A as AppToEditorMessage, q as FetchLike, r as CmssyClientConfig, s as CmssySiteConfig, R as RawBlock, e as CmssyLocaleContext, t as BlockMap, u as CmssyBlockContext } from './commerce-queries-fR6ZKQ3r.cjs';
2
- export { a as BlockMeta, v as BlockRect, B as BlockSchema, w as BoundsMessage, x as BuildBlockContextExtra, y as ClickMessage, f as CmssyAddress, z as CmssyBlockMember, D as CmssyBranding, g as CmssyCart, j as CmssyCartDiscount, k as CmssyCartItem, l as CmssyCartItemSnapshot, G as CmssyFormField, H as CmssyFormSettings, I as CmssyFormSubmitResponse, J as CmssyLocalizedValue, K as CmssyModelDefinition, L as CmssyModelRecord, h as CmssyOrder, m as CmssyOrderItem, M as CmssyOrderTaxSummaryLine, N as CmssyPageMeta, O as CmssyPageSummary, P as CmssyPriceTier, i as CmssyProduct, n as CmssyProductVariant, Q as CmssyRecordList, S as CmssyShippingMethod, T as CmssyTaxSummaryLine, U as DEFAULT_CMSSY_API_URL, V as FORM_QUERY, W as FetchLikeResponse, X as FetchPageOptions, Y as MODEL_DEFINITIONS_QUERY, Z as MODEL_RECORDS_QUERY, _ as PROTOCOL_VERSION, $ as ParentReadyMessage, a0 as PatchMessage, a1 as RawLayoutBlock, a2 as ReadyMessage, a3 as SITE_CONFIG_QUERY, a4 as SUBMIT_FORM_MUTATION, a5 as SelectMessage, a6 as SubmitFormInput, a7 as blocksToMeta, a8 as blocksToSchemas, a9 as buildBlockContext, aa as buildBlockMap, ab as defineBlock, ac as fetchLayouts, ad as fetchPage, ae as fetchPageById, af as fetchPageMeta, ag as fetchPages, ah as isProtocolCompatible, ai as normalizeSlug, aj as resolveApiUrl, ak as resolvePublicUrl } from './commerce-queries-fR6ZKQ3r.cjs';
1
+ import { F as FieldDefinition, C as CmssyPageData, b as BlockDefinition, c as CmssyFormDefinition, o as CmssyBlockAuthContext, p as CmssyBlockWorkspace, d as CmssyLayoutGroup, E as EditorToAppMessage, A as AppToEditorMessage, q as FetchLike, r as CmssyClientConfig, s as CmssySiteConfig, R as RawBlock, e as CmssyLocaleContext, t as BlockMap, u as CmssyBlockContext } from './commerce-queries-BFnU2_SV.cjs';
2
+ export { a as BlockMeta, v as BlockRect, B as BlockSchema, w as BoundsMessage, x as BuildBlockContextExtra, y as ClickMessage, f as CmssyAddress, z as CmssyBlockMember, D as CmssyBranding, g as CmssyCart, j as CmssyCartDiscount, k as CmssyCartItem, l as CmssyCartItemSnapshot, G as CmssyFormField, H as CmssyFormSettings, I as CmssyFormSubmitResponse, J as CmssyLocalizedValue, K as CmssyModelDefinition, L as CmssyModelRecord, h as CmssyOrder, M as CmssyOrderDiscount, m as CmssyOrderItem, N as CmssyOrderTaxSummaryLine, O as CmssyPageMeta, P as CmssyPageSummary, Q as CmssyPriceTier, i as CmssyProduct, n as CmssyProductVariant, S as CmssyRecordList, T as CmssyShippingMethod, U as CmssyTaxSummaryLine, V as DEFAULT_CMSSY_API_URL, W as FORM_QUERY, X as FetchLikeResponse, Y as FetchPageOptions, Z as MODEL_DEFINITIONS_QUERY, _ as MODEL_RECORDS_QUERY, $ as PROTOCOL_VERSION, a0 as ParentReadyMessage, a1 as PatchMessage, a2 as RawLayoutBlock, a3 as ReadyMessage, a4 as SITE_CONFIG_QUERY, a5 as SUBMIT_FORM_MUTATION, a6 as SelectMessage, a7 as SubmitFormInput, a8 as blocksToMeta, a9 as blocksToSchemas, aa as buildBlockContext, ab as buildBlockMap, ac as defineBlock, ad as fetchLayouts, ae as fetchPage, af as fetchPageById, ag as fetchPageMeta, ah as fetchPages, ai as isProtocolCompatible, aj as normalizeSlug, ak as resolveApiUrl, al as resolvePublicUrl } from './commerce-queries-BFnU2_SV.cjs';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  export { FieldCondition, FieldConditionGroup, FieldConditionLogic, FieldType, evaluateFieldConditionGroup } from '@cmssy/types';
5
5
  import 'react';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { F as FieldDefinition, C as CmssyPageData, b as BlockDefinition, c as CmssyFormDefinition, o as CmssyBlockAuthContext, p as CmssyBlockWorkspace, d as CmssyLayoutGroup, E as EditorToAppMessage, A as AppToEditorMessage, q as FetchLike, r as CmssyClientConfig, s as CmssySiteConfig, R as RawBlock, e as CmssyLocaleContext, t as BlockMap, u as CmssyBlockContext } from './commerce-queries-fR6ZKQ3r.js';
2
- export { a as BlockMeta, v as BlockRect, B as BlockSchema, w as BoundsMessage, x as BuildBlockContextExtra, y as ClickMessage, f as CmssyAddress, z as CmssyBlockMember, D as CmssyBranding, g as CmssyCart, j as CmssyCartDiscount, k as CmssyCartItem, l as CmssyCartItemSnapshot, G as CmssyFormField, H as CmssyFormSettings, I as CmssyFormSubmitResponse, J as CmssyLocalizedValue, K as CmssyModelDefinition, L as CmssyModelRecord, h as CmssyOrder, m as CmssyOrderItem, M as CmssyOrderTaxSummaryLine, N as CmssyPageMeta, O as CmssyPageSummary, P as CmssyPriceTier, i as CmssyProduct, n as CmssyProductVariant, Q as CmssyRecordList, S as CmssyShippingMethod, T as CmssyTaxSummaryLine, U as DEFAULT_CMSSY_API_URL, V as FORM_QUERY, W as FetchLikeResponse, X as FetchPageOptions, Y as MODEL_DEFINITIONS_QUERY, Z as MODEL_RECORDS_QUERY, _ as PROTOCOL_VERSION, $ as ParentReadyMessage, a0 as PatchMessage, a1 as RawLayoutBlock, a2 as ReadyMessage, a3 as SITE_CONFIG_QUERY, a4 as SUBMIT_FORM_MUTATION, a5 as SelectMessage, a6 as SubmitFormInput, a7 as blocksToMeta, a8 as blocksToSchemas, a9 as buildBlockContext, aa as buildBlockMap, ab as defineBlock, ac as fetchLayouts, ad as fetchPage, ae as fetchPageById, af as fetchPageMeta, ag as fetchPages, ah as isProtocolCompatible, ai as normalizeSlug, aj as resolveApiUrl, ak as resolvePublicUrl } from './commerce-queries-fR6ZKQ3r.js';
1
+ import { F as FieldDefinition, C as CmssyPageData, b as BlockDefinition, c as CmssyFormDefinition, o as CmssyBlockAuthContext, p as CmssyBlockWorkspace, d as CmssyLayoutGroup, E as EditorToAppMessage, A as AppToEditorMessage, q as FetchLike, r as CmssyClientConfig, s as CmssySiteConfig, R as RawBlock, e as CmssyLocaleContext, t as BlockMap, u as CmssyBlockContext } from './commerce-queries-BFnU2_SV.js';
2
+ export { a as BlockMeta, v as BlockRect, B as BlockSchema, w as BoundsMessage, x as BuildBlockContextExtra, y as ClickMessage, f as CmssyAddress, z as CmssyBlockMember, D as CmssyBranding, g as CmssyCart, j as CmssyCartDiscount, k as CmssyCartItem, l as CmssyCartItemSnapshot, G as CmssyFormField, H as CmssyFormSettings, I as CmssyFormSubmitResponse, J as CmssyLocalizedValue, K as CmssyModelDefinition, L as CmssyModelRecord, h as CmssyOrder, M as CmssyOrderDiscount, m as CmssyOrderItem, N as CmssyOrderTaxSummaryLine, O as CmssyPageMeta, P as CmssyPageSummary, Q as CmssyPriceTier, i as CmssyProduct, n as CmssyProductVariant, S as CmssyRecordList, T as CmssyShippingMethod, U as CmssyTaxSummaryLine, V as DEFAULT_CMSSY_API_URL, W as FORM_QUERY, X as FetchLikeResponse, Y as FetchPageOptions, Z as MODEL_DEFINITIONS_QUERY, _ as MODEL_RECORDS_QUERY, $ as PROTOCOL_VERSION, a0 as ParentReadyMessage, a1 as PatchMessage, a2 as RawLayoutBlock, a3 as ReadyMessage, a4 as SITE_CONFIG_QUERY, a5 as SUBMIT_FORM_MUTATION, a6 as SelectMessage, a7 as SubmitFormInput, a8 as blocksToMeta, a9 as blocksToSchemas, aa as buildBlockContext, ab as buildBlockMap, ac as defineBlock, ad as fetchLayouts, ae as fetchPage, af as fetchPageById, ag as fetchPageMeta, ah as fetchPages, ai as isProtocolCompatible, aj as normalizeSlug, ak as resolveApiUrl, al as resolvePublicUrl } from './commerce-queries-BFnU2_SV.js';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  export { FieldCondition, FieldConditionGroup, FieldConditionLogic, FieldType, evaluateFieldConditionGroup } from '@cmssy/types';
5
5
  import 'react';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmssy/react",
3
- "version": "2.0.0",
3
+ "version": "2.2.0",
4
4
  "description": "React blocks, renderers, data client and editor bridge for cmssy headless sites",
5
5
  "keywords": [
6
6
  "cmssy",