@cmssy/react 2.4.0 → 2.5.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,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { BlockSchema, BlockMeta, CmssyPageData, CmssyLayoutGroup } from '@cmssy/types';
3
- import { B as BlockDefinition, C as CmssyFormDefinition, a as CmssyLocaleContext, b as CmssyAddress, c as CmssyCart, d as CmssyOrder, e as CmssyProduct } from './commerce-queries-BJCoqTJW.cjs';
4
- export { f as CmssyCartDiscount, g as CmssyCartItem, h as CmssyCartItemSnapshot, i as CmssyOrderItem, j as CmssyProductVariant } from './commerce-queries-BJCoqTJW.cjs';
2
+ import { BlockSchema, BlockMeta, CmssyPageData, CmssyFormDefinition, CmssyLayoutGroup, CmssyLocaleContext } from '@cmssy/types';
3
+ import { B as BlockDefinition, C as CmssyAddress, a as CmssyCart, b as CmssyOrder, c as CmssyProduct } from './commerce-queries-CfjwkgfE.cjs';
4
+ export { d as CmssyCartDiscount, e as CmssyCartItem, f as CmssyCartItemSnapshot, g as CmssyOrderItem, h as CmssyProductVariant } from './commerce-queries-CfjwkgfE.cjs';
5
5
  import { ReactNode } from 'react';
6
6
 
7
7
  interface EditBridgeConfig {
package/dist/client.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { BlockSchema, BlockMeta, CmssyPageData, CmssyLayoutGroup } from '@cmssy/types';
3
- import { B as BlockDefinition, C as CmssyFormDefinition, a as CmssyLocaleContext, b as CmssyAddress, c as CmssyCart, d as CmssyOrder, e as CmssyProduct } from './commerce-queries-BJCoqTJW.js';
4
- export { f as CmssyCartDiscount, g as CmssyCartItem, h as CmssyCartItemSnapshot, i as CmssyOrderItem, j as CmssyProductVariant } from './commerce-queries-BJCoqTJW.js';
2
+ import { BlockSchema, BlockMeta, CmssyPageData, CmssyFormDefinition, CmssyLayoutGroup, CmssyLocaleContext } from '@cmssy/types';
3
+ import { B as BlockDefinition, C as CmssyAddress, a as CmssyCart, b as CmssyOrder, c as CmssyProduct } from './commerce-queries-CfjwkgfE.js';
4
+ export { d as CmssyCartDiscount, e as CmssyCartItem, f as CmssyCartItemSnapshot, g as CmssyOrderItem, h as CmssyProductVariant } from './commerce-queries-CfjwkgfE.js';
5
5
  import { ReactNode } from 'react';
6
6
 
7
7
  interface EditBridgeConfig {
@@ -1,108 +1,5 @@
1
1
  import { ComponentType } from 'react';
2
- import { FieldConditionGroup, FieldDefinition, BlockMeta, BlockSchema } from '@cmssy/types';
3
-
4
- declare const SITE_CONFIG_QUERY = "query PublicSiteConfig($workspaceSlug: String!) {\n public {\n siteConfig(workspaceSlug: $workspaceSlug) {\n id\n workspaceId\n siteName\n defaultLanguage\n enabledLanguages\n enabledFeatures\n notFoundPageId\n previewUrl\n branding {\n brandName\n logoUrl\n faviconUrl\n ogImageUrl\n }\n }\n }\n}";
5
- interface CmssyModelDefinition {
6
- id: string;
7
- name: string;
8
- slug: string;
9
- description: string | null;
10
- icon: string | null;
11
- color: string | null;
12
- displayField: string | null;
13
- recordCount: number | null;
14
- }
15
- interface CmssyModelRecord {
16
- id: string;
17
- modelId: string;
18
- data: Record<string, unknown>;
19
- status: string | null;
20
- createdAt: string | null;
21
- updatedAt: string | null;
22
- }
23
- interface CmssyRecordList {
24
- items: CmssyModelRecord[];
25
- total: number;
26
- hasMore: boolean;
27
- }
28
- declare const MODEL_DEFINITIONS_QUERY = "query PublicModelDefinitions($workspaceId: String!) {\n public {\n model {\n definitions(workspaceId: $workspaceId) {\n id name slug description icon color displayField recordCount\n }\n }\n }\n}";
29
- declare const MODEL_RECORDS_QUERY = "query PublicModelRecords($workspaceId: String!, $modelSlug: String!, $filter: JSON, $sort: String, $limit: Int, $offset: Int, $populate: [String!]) {\n public {\n model {\n records(workspaceId: $workspaceId, modelSlug: $modelSlug, filter: $filter, sort: $sort, limit: $limit, offset: $offset, populate: $populate) {\n items { id modelId data status createdAt updatedAt }\n total\n hasMore\n }\n }\n }\n}";
30
- interface CmssyFormField {
31
- id: string;
32
- name: string;
33
- fieldType: string;
34
- label: string | null;
35
- placeholder: string | null;
36
- helpText: string | null;
37
- defaultValue: unknown;
38
- options: unknown;
39
- validation: unknown;
40
- width: string | null;
41
- order: number | null;
42
- showWhen: FieldConditionGroup | null;
43
- requiredWhen: FieldConditionGroup | null;
44
- }
45
- interface CmssyFormSettings {
46
- actionType: string | null;
47
- submitButtonLabel: unknown;
48
- successMessage: unknown;
49
- errorMessage: unknown;
50
- redirectUrl: string | null;
51
- requireLogin: boolean | null;
52
- enableCaptcha: boolean | null;
53
- }
54
- interface CmssyFormDefinition {
55
- id: string;
56
- name: string;
57
- slug: string | null;
58
- description: string | null;
59
- fields: CmssyFormField[];
60
- settings: CmssyFormSettings | null;
61
- }
62
- interface CmssyFormSubmitResponse {
63
- success: boolean;
64
- message: string | null;
65
- submissionId: string | null;
66
- redirectUrl: string | null;
67
- accessToken: string | null;
68
- customer: unknown;
69
- }
70
- interface SubmitFormInput {
71
- data: Record<string, unknown>;
72
- website?: string;
73
- }
74
- declare const FORM_QUERY = "query PublicForm($formId: ID!) {\n public {\n form {\n get(formId: $formId) {\n id\n name\n slug\n description\n fields {\n id name fieldType label placeholder helpText\n defaultValue width order showWhen requiredWhen\n options { value label disabled }\n validation { required minLength maxLength minValue maxValue pattern customMessage }\n }\n settings {\n actionType submitButtonLabel successMessage errorMessage\n redirectUrl requireLogin enableCaptcha\n }\n }\n }\n }\n}";
75
- declare const SUBMIT_FORM_MUTATION = "mutation SubmitForm($formId: ID!, $input: SubmitFormInput!) {\n public {\n form {\n submit(formId: $formId, input: $input) {\n success message submissionId redirectUrl accessToken customer\n }\n }\n }\n}";
76
-
77
- interface CmssyLocaleContext {
78
- current: string;
79
- default: string;
80
- enabled: string[];
81
- }
82
- interface CmssyBlockMember {
83
- recordId: string;
84
- email: string;
85
- }
86
- interface CmssyBlockAuthContext {
87
- isAuthenticated: boolean;
88
- member: CmssyBlockMember | null;
89
- }
90
- interface CmssyBlockWorkspace {
91
- id: string;
92
- slug: string;
93
- }
94
- interface CmssyBlockContext {
95
- locale: CmssyLocaleContext;
96
- isPreview: boolean;
97
- forms?: Record<string, CmssyFormDefinition>;
98
- auth?: CmssyBlockAuthContext;
99
- workspace?: CmssyBlockWorkspace;
100
- }
101
- interface BuildBlockContextExtra {
102
- auth?: CmssyBlockAuthContext;
103
- workspace?: CmssyBlockWorkspace;
104
- }
105
- declare function buildBlockContext(locale: string, defaultLocale: string, enabledLocales?: string[], isPreview?: boolean, forms?: Record<string, CmssyFormDefinition>, extra?: BuildBlockContextExtra): CmssyBlockContext;
2
+ import { FieldDefinition, CmssyBlockContext, BlockMeta, BlockSchema } from '@cmssy/types';
106
3
 
107
4
  interface BlockLoaderArgs {
108
5
  content: Record<string, unknown>;
@@ -323,4 +220,4 @@ interface CmssyOrder {
323
220
  accessToken?: string | null;
324
221
  }
325
222
 
326
- export { type CmssyTaxSummaryLine as A, type BlockDefinition as B, type CmssyFormDefinition as C, MODEL_RECORDS_QUERY as D, SUBMIT_FORM_MUTATION as E, FORM_QUERY as F, type SubmitFormInput as G, blocksToMeta as H, blocksToSchemas as I, buildBlockContext as J, buildBlockMap as K, defineBlock as L, MODEL_DEFINITIONS_QUERY as M, SITE_CONFIG_QUERY as S, type CmssyLocaleContext as a, type CmssyAddress as b, type CmssyCart as c, type CmssyOrder as d, type CmssyProduct as e, type CmssyCartDiscount as f, type CmssyCartItem as g, type CmssyCartItemSnapshot as h, type CmssyOrderItem as i, type CmssyProductVariant as j, type CmssyBlockAuthContext as k, type CmssyBlockWorkspace as l, type BlockMap as m, type CmssyBlockContext as n, type BuildBlockContextExtra as o, type CmssyBlockMember as p, type CmssyFormField as q, type CmssyFormSettings as r, type CmssyFormSubmitResponse as s, type CmssyModelDefinition as t, type CmssyModelRecord as u, type CmssyOrderDiscount as v, type CmssyOrderTaxSummaryLine as w, type CmssyPriceTier as x, type CmssyRecordList as y, type CmssyShippingMethod as z };
223
+ export { type BlockDefinition as B, type CmssyAddress as C, type CmssyCart as a, type CmssyOrder as b, type CmssyProduct as c, type CmssyCartDiscount as d, type CmssyCartItem as e, type CmssyCartItemSnapshot as f, type CmssyOrderItem as g, type CmssyProductVariant as h, type BlockMap as i, type CmssyOrderDiscount as j, type CmssyOrderTaxSummaryLine as k, type CmssyPriceTier as l, type CmssyShippingMethod as m, type CmssyTaxSummaryLine as n, blocksToMeta as o, blocksToSchemas as p, buildBlockMap as q, defineBlock as r };
@@ -1,108 +1,5 @@
1
1
  import { ComponentType } from 'react';
2
- import { FieldConditionGroup, FieldDefinition, BlockMeta, BlockSchema } from '@cmssy/types';
3
-
4
- declare const SITE_CONFIG_QUERY = "query PublicSiteConfig($workspaceSlug: String!) {\n public {\n siteConfig(workspaceSlug: $workspaceSlug) {\n id\n workspaceId\n siteName\n defaultLanguage\n enabledLanguages\n enabledFeatures\n notFoundPageId\n previewUrl\n branding {\n brandName\n logoUrl\n faviconUrl\n ogImageUrl\n }\n }\n }\n}";
5
- interface CmssyModelDefinition {
6
- id: string;
7
- name: string;
8
- slug: string;
9
- description: string | null;
10
- icon: string | null;
11
- color: string | null;
12
- displayField: string | null;
13
- recordCount: number | null;
14
- }
15
- interface CmssyModelRecord {
16
- id: string;
17
- modelId: string;
18
- data: Record<string, unknown>;
19
- status: string | null;
20
- createdAt: string | null;
21
- updatedAt: string | null;
22
- }
23
- interface CmssyRecordList {
24
- items: CmssyModelRecord[];
25
- total: number;
26
- hasMore: boolean;
27
- }
28
- declare const MODEL_DEFINITIONS_QUERY = "query PublicModelDefinitions($workspaceId: String!) {\n public {\n model {\n definitions(workspaceId: $workspaceId) {\n id name slug description icon color displayField recordCount\n }\n }\n }\n}";
29
- declare const MODEL_RECORDS_QUERY = "query PublicModelRecords($workspaceId: String!, $modelSlug: String!, $filter: JSON, $sort: String, $limit: Int, $offset: Int, $populate: [String!]) {\n public {\n model {\n records(workspaceId: $workspaceId, modelSlug: $modelSlug, filter: $filter, sort: $sort, limit: $limit, offset: $offset, populate: $populate) {\n items { id modelId data status createdAt updatedAt }\n total\n hasMore\n }\n }\n }\n}";
30
- interface CmssyFormField {
31
- id: string;
32
- name: string;
33
- fieldType: string;
34
- label: string | null;
35
- placeholder: string | null;
36
- helpText: string | null;
37
- defaultValue: unknown;
38
- options: unknown;
39
- validation: unknown;
40
- width: string | null;
41
- order: number | null;
42
- showWhen: FieldConditionGroup | null;
43
- requiredWhen: FieldConditionGroup | null;
44
- }
45
- interface CmssyFormSettings {
46
- actionType: string | null;
47
- submitButtonLabel: unknown;
48
- successMessage: unknown;
49
- errorMessage: unknown;
50
- redirectUrl: string | null;
51
- requireLogin: boolean | null;
52
- enableCaptcha: boolean | null;
53
- }
54
- interface CmssyFormDefinition {
55
- id: string;
56
- name: string;
57
- slug: string | null;
58
- description: string | null;
59
- fields: CmssyFormField[];
60
- settings: CmssyFormSettings | null;
61
- }
62
- interface CmssyFormSubmitResponse {
63
- success: boolean;
64
- message: string | null;
65
- submissionId: string | null;
66
- redirectUrl: string | null;
67
- accessToken: string | null;
68
- customer: unknown;
69
- }
70
- interface SubmitFormInput {
71
- data: Record<string, unknown>;
72
- website?: string;
73
- }
74
- declare const FORM_QUERY = "query PublicForm($formId: ID!) {\n public {\n form {\n get(formId: $formId) {\n id\n name\n slug\n description\n fields {\n id name fieldType label placeholder helpText\n defaultValue width order showWhen requiredWhen\n options { value label disabled }\n validation { required minLength maxLength minValue maxValue pattern customMessage }\n }\n settings {\n actionType submitButtonLabel successMessage errorMessage\n redirectUrl requireLogin enableCaptcha\n }\n }\n }\n }\n}";
75
- declare const SUBMIT_FORM_MUTATION = "mutation SubmitForm($formId: ID!, $input: SubmitFormInput!) {\n public {\n form {\n submit(formId: $formId, input: $input) {\n success message submissionId redirectUrl accessToken customer\n }\n }\n }\n}";
76
-
77
- interface CmssyLocaleContext {
78
- current: string;
79
- default: string;
80
- enabled: string[];
81
- }
82
- interface CmssyBlockMember {
83
- recordId: string;
84
- email: string;
85
- }
86
- interface CmssyBlockAuthContext {
87
- isAuthenticated: boolean;
88
- member: CmssyBlockMember | null;
89
- }
90
- interface CmssyBlockWorkspace {
91
- id: string;
92
- slug: string;
93
- }
94
- interface CmssyBlockContext {
95
- locale: CmssyLocaleContext;
96
- isPreview: boolean;
97
- forms?: Record<string, CmssyFormDefinition>;
98
- auth?: CmssyBlockAuthContext;
99
- workspace?: CmssyBlockWorkspace;
100
- }
101
- interface BuildBlockContextExtra {
102
- auth?: CmssyBlockAuthContext;
103
- workspace?: CmssyBlockWorkspace;
104
- }
105
- declare function buildBlockContext(locale: string, defaultLocale: string, enabledLocales?: string[], isPreview?: boolean, forms?: Record<string, CmssyFormDefinition>, extra?: BuildBlockContextExtra): CmssyBlockContext;
2
+ import { FieldDefinition, CmssyBlockContext, BlockMeta, BlockSchema } from '@cmssy/types';
106
3
 
107
4
  interface BlockLoaderArgs {
108
5
  content: Record<string, unknown>;
@@ -323,4 +220,4 @@ interface CmssyOrder {
323
220
  accessToken?: string | null;
324
221
  }
325
222
 
326
- export { type CmssyTaxSummaryLine as A, type BlockDefinition as B, type CmssyFormDefinition as C, MODEL_RECORDS_QUERY as D, SUBMIT_FORM_MUTATION as E, FORM_QUERY as F, type SubmitFormInput as G, blocksToMeta as H, blocksToSchemas as I, buildBlockContext as J, buildBlockMap as K, defineBlock as L, MODEL_DEFINITIONS_QUERY as M, SITE_CONFIG_QUERY as S, type CmssyLocaleContext as a, type CmssyAddress as b, type CmssyCart as c, type CmssyOrder as d, type CmssyProduct as e, type CmssyCartDiscount as f, type CmssyCartItem as g, type CmssyCartItemSnapshot as h, type CmssyOrderItem as i, type CmssyProductVariant as j, type CmssyBlockAuthContext as k, type CmssyBlockWorkspace as l, type BlockMap as m, type CmssyBlockContext as n, type BuildBlockContextExtra as o, type CmssyBlockMember as p, type CmssyFormField as q, type CmssyFormSettings as r, type CmssyFormSubmitResponse as s, type CmssyModelDefinition as t, type CmssyModelRecord as u, type CmssyOrderDiscount as v, type CmssyOrderTaxSummaryLine as w, type CmssyPriceTier as x, type CmssyRecordList as y, type CmssyShippingMethod as z };
223
+ export { type BlockDefinition as B, type CmssyAddress as C, type CmssyCart as a, type CmssyOrder as b, type CmssyProduct as c, type CmssyCartDiscount as d, type CmssyCartItem as e, type CmssyCartItemSnapshot as f, type CmssyOrderItem as g, type CmssyProductVariant as h, type BlockMap as i, type CmssyOrderDiscount as j, type CmssyOrderTaxSummaryLine as k, type CmssyPriceTier as l, type CmssyShippingMethod as m, type CmssyTaxSummaryLine as n, blocksToMeta as o, blocksToSchemas as p, buildBlockMap as q, defineBlock as r };
package/dist/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
- import { CmssyClientConfig, CmssyLayoutGroup, CmssyPageData, CmssyPageMeta, CmssyPageSummary, BlockRect, BlockSchema, BlockMeta, FieldControl, FieldDefinition, CmssySiteConfig, RawBlock, CmssySiteLocales } from '@cmssy/types';
2
- export { BlockMeta, BlockRect, BlockSchema, CmssyBranding, CmssyClientConfig, CmssyLayoutGroup, CmssyLayoutSettings, CmssyLocalizedValue, CmssyPageData, CmssyPageMeta, CmssyPageSummary, CmssySiteConfig, CmssySiteLocales, FieldCondition, FieldConditionGroup, FieldConditionLogic, FieldControl, FieldDefinition, FieldType, RawBlock, RawLayoutBlock, evaluateFieldConditionGroup } from '@cmssy/types';
3
- import { B as BlockDefinition, C as CmssyFormDefinition, k as CmssyBlockAuthContext, l as CmssyBlockWorkspace, a as CmssyLocaleContext, m as BlockMap, n as CmssyBlockContext } from './commerce-queries-BJCoqTJW.cjs';
4
- export { o as BuildBlockContextExtra, b as CmssyAddress, p as CmssyBlockMember, c as CmssyCart, f as CmssyCartDiscount, g as CmssyCartItem, h as CmssyCartItemSnapshot, q as CmssyFormField, r as CmssyFormSettings, s as CmssyFormSubmitResponse, t as CmssyModelDefinition, u as CmssyModelRecord, d as CmssyOrder, v as CmssyOrderDiscount, i as CmssyOrderItem, w as CmssyOrderTaxSummaryLine, x as CmssyPriceTier, e as CmssyProduct, j as CmssyProductVariant, y as CmssyRecordList, z as CmssyShippingMethod, A as CmssyTaxSummaryLine, F as FORM_QUERY, M as MODEL_DEFINITIONS_QUERY, D as MODEL_RECORDS_QUERY, S as SITE_CONFIG_QUERY, E as SUBMIT_FORM_MUTATION, G as SubmitFormInput, H as blocksToMeta, I as blocksToSchemas, J as buildBlockContext, K as buildBlockMap, L as defineBlock } from './commerce-queries-BJCoqTJW.cjs';
1
+ import { CmssyClientConfig, CmssyLayoutGroup, CmssyPageData, CmssyPageMeta, CmssyPageSummary, CmssyFormDefinition, BuildBlockContextExtra, CmssyBlockContext, BlockRect, BlockSchema, BlockMeta, FieldControl, FieldDefinition, CmssyBlockAuthContext, CmssyBlockWorkspace, CmssySiteConfig, RawBlock, CmssySiteLocales, CmssyLocaleContext } from '@cmssy/types';
2
+ export { BlockMeta, BlockRect, BlockSchema, BuildBlockContextExtra, CmssyBlockAuthContext, CmssyBlockContext, CmssyBlockMember, CmssyBlockWorkspace, CmssyBranding, CmssyClientConfig, CmssyFormDefinition, CmssyFormField, CmssyFormSettings, CmssyFormSubmitResponse, CmssyLayoutGroup, CmssyLayoutSettings, CmssyLocaleContext, CmssyLocalizedValue, CmssyModelDefinition, CmssyModelRecord, CmssyPageData, CmssyPageMeta, CmssyPageSummary, CmssyRecordList, CmssySiteConfig, CmssySiteLocales, FieldCondition, FieldConditionGroup, FieldConditionLogic, FieldControl, FieldDefinition, FieldType, RawBlock, RawLayoutBlock, SubmitFormInput, evaluateFieldConditionGroup } from '@cmssy/types';
3
+ import { B as BlockDefinition, i as BlockMap } from './commerce-queries-CfjwkgfE.cjs';
4
+ export { C as CmssyAddress, a as CmssyCart, d as CmssyCartDiscount, e as CmssyCartItem, f as CmssyCartItemSnapshot, b as CmssyOrder, j as CmssyOrderDiscount, g as CmssyOrderItem, k as CmssyOrderTaxSummaryLine, l as CmssyPriceTier, c as CmssyProduct, h as CmssyProductVariant, m as CmssyShippingMethod, n as CmssyTaxSummaryLine, o as blocksToMeta, p as blocksToSchemas, q as buildBlockMap, r as defineBlock } from './commerce-queries-CfjwkgfE.cjs';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
6
  import 'react';
7
7
 
@@ -45,6 +45,14 @@ declare function fetchPages(config: CmssyClientConfig, options?: Pick<FetchPageO
45
45
  declare function fetchPageMeta(config: CmssyClientConfig, path: string | string[] | undefined, options?: Pick<FetchPageOptions, "fetch" | "signal">): Promise<CmssyPageMeta | null>;
46
46
  declare function fetchLayouts(config: CmssyClientConfig, path: string | string[] | undefined, options?: FetchPageOptions): Promise<CmssyLayoutGroup[]>;
47
47
 
48
+ declare const SITE_CONFIG_QUERY = "query PublicSiteConfig($workspaceSlug: String!) {\n public {\n siteConfig(workspaceSlug: $workspaceSlug) {\n id\n workspaceId\n siteName\n defaultLanguage\n enabledLanguages\n enabledFeatures\n notFoundPageId\n previewUrl\n branding {\n brandName\n logoUrl\n faviconUrl\n ogImageUrl\n }\n }\n }\n}";
49
+ declare const MODEL_DEFINITIONS_QUERY = "query PublicModelDefinitions($workspaceId: String!) {\n public {\n model {\n definitions(workspaceId: $workspaceId) {\n id name slug description icon color displayField recordCount\n }\n }\n }\n}";
50
+ declare const MODEL_RECORDS_QUERY = "query PublicModelRecords($workspaceId: String!, $modelSlug: String!, $filter: JSON, $sort: String, $limit: Int, $offset: Int, $populate: [String!]) {\n public {\n model {\n records(workspaceId: $workspaceId, modelSlug: $modelSlug, filter: $filter, sort: $sort, limit: $limit, offset: $offset, populate: $populate) {\n items { id modelId data status createdAt updatedAt }\n total\n hasMore\n }\n }\n }\n}";
51
+ declare const FORM_QUERY = "query PublicForm($formId: ID!) {\n public {\n form {\n get(formId: $formId) {\n id\n name\n slug\n description\n fields {\n id name fieldType label placeholder helpText\n defaultValue width order showWhen requiredWhen\n options { value label disabled }\n validation { required minLength maxLength minValue maxValue pattern customMessage }\n }\n settings {\n actionType submitButtonLabel successMessage errorMessage\n redirectUrl requireLogin enableCaptcha\n }\n }\n }\n }\n}";
52
+ declare const SUBMIT_FORM_MUTATION = "mutation SubmitForm($formId: ID!, $input: SubmitFormInput!) {\n public {\n form {\n submit(formId: $formId, input: $input) {\n success message submissionId redirectUrl accessToken customer\n }\n }\n }\n}";
53
+
54
+ declare function buildBlockContext(locale: string, defaultLocale: string, enabledLocales?: string[], isPreview?: boolean, forms?: Record<string, CmssyFormDefinition>, extra?: BuildBlockContextExtra): CmssyBlockContext;
55
+
48
56
  declare const PROTOCOL_VERSION = 2;
49
57
 
50
58
  interface ReadyMessage {
@@ -274,4 +282,4 @@ interface UnknownBlockProps {
274
282
  }
275
283
  declare function UnknownBlock({ type }: UnknownBlockProps): react_jsx_runtime.JSX.Element;
276
284
 
277
- export { type AppToEditorMessage, BlockDefinition, BlockMap, type BoundsMessage, type ClickMessage, CmssyBlock, CmssyBlockAuthContext, CmssyBlockContext, type CmssyBlockProps, CmssyBlockWorkspace, type CmssyClient, CmssyFormDefinition, CmssyLocaleContext, CmssyServerLayout, type CmssyServerLayoutProps, CmssyServerPage, type CmssyServerPageProps, DEFAULT_CMSSY_API_URL, type EditorToAppMessage, type FetchLike, type FetchLikeResponse, type FetchPageOptions, type GraphqlRequestOptions, PROTOCOL_VERSION, type ParentReadyMessage, type PatchMessage, type PostTarget, type QueryScopedOptions, type ReadyMessage, type SelectMessage, UnknownBlock, type UnknownBlockProps, buildLocaleSwitchHref, collectFormIds, createCmssyClient, fetchLayouts, fetchPage, fetchPageById, fetchPageMeta, fetchPages, fetchSiteConfig, fields, getBlockContentForLanguage, graphqlRequest, isProtocolCompatible, localizeHref, localizeHtmlLinks, normalizeOrigin, normalizeSlug, parseEditorMessage, postToEditor, resolveApiUrl, resolveForms, resolvePublicUrl, resolveSiteLocales, resolveWorkspaceId, splitLocaleFromPath };
285
+ export { type AppToEditorMessage, BlockDefinition, BlockMap, type BoundsMessage, type ClickMessage, CmssyBlock, type CmssyBlockProps, type CmssyClient, CmssyServerLayout, type CmssyServerLayoutProps, CmssyServerPage, type CmssyServerPageProps, DEFAULT_CMSSY_API_URL, type EditorToAppMessage, FORM_QUERY, type FetchLike, type FetchLikeResponse, type FetchPageOptions, type GraphqlRequestOptions, MODEL_DEFINITIONS_QUERY, MODEL_RECORDS_QUERY, PROTOCOL_VERSION, type ParentReadyMessage, type PatchMessage, type PostTarget, type QueryScopedOptions, type ReadyMessage, SITE_CONFIG_QUERY, SUBMIT_FORM_MUTATION, type SelectMessage, UnknownBlock, type UnknownBlockProps, buildBlockContext, buildLocaleSwitchHref, collectFormIds, createCmssyClient, fetchLayouts, fetchPage, fetchPageById, fetchPageMeta, fetchPages, fetchSiteConfig, fields, getBlockContentForLanguage, graphqlRequest, isProtocolCompatible, localizeHref, localizeHtmlLinks, normalizeOrigin, normalizeSlug, parseEditorMessage, postToEditor, resolveApiUrl, resolveForms, resolvePublicUrl, resolveSiteLocales, resolveWorkspaceId, splitLocaleFromPath };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { CmssyClientConfig, CmssyLayoutGroup, CmssyPageData, CmssyPageMeta, CmssyPageSummary, BlockRect, BlockSchema, BlockMeta, FieldControl, FieldDefinition, CmssySiteConfig, RawBlock, CmssySiteLocales } from '@cmssy/types';
2
- export { BlockMeta, BlockRect, BlockSchema, CmssyBranding, CmssyClientConfig, CmssyLayoutGroup, CmssyLayoutSettings, CmssyLocalizedValue, CmssyPageData, CmssyPageMeta, CmssyPageSummary, CmssySiteConfig, CmssySiteLocales, FieldCondition, FieldConditionGroup, FieldConditionLogic, FieldControl, FieldDefinition, FieldType, RawBlock, RawLayoutBlock, evaluateFieldConditionGroup } from '@cmssy/types';
3
- import { B as BlockDefinition, C as CmssyFormDefinition, k as CmssyBlockAuthContext, l as CmssyBlockWorkspace, a as CmssyLocaleContext, m as BlockMap, n as CmssyBlockContext } from './commerce-queries-BJCoqTJW.js';
4
- export { o as BuildBlockContextExtra, b as CmssyAddress, p as CmssyBlockMember, c as CmssyCart, f as CmssyCartDiscount, g as CmssyCartItem, h as CmssyCartItemSnapshot, q as CmssyFormField, r as CmssyFormSettings, s as CmssyFormSubmitResponse, t as CmssyModelDefinition, u as CmssyModelRecord, d as CmssyOrder, v as CmssyOrderDiscount, i as CmssyOrderItem, w as CmssyOrderTaxSummaryLine, x as CmssyPriceTier, e as CmssyProduct, j as CmssyProductVariant, y as CmssyRecordList, z as CmssyShippingMethod, A as CmssyTaxSummaryLine, F as FORM_QUERY, M as MODEL_DEFINITIONS_QUERY, D as MODEL_RECORDS_QUERY, S as SITE_CONFIG_QUERY, E as SUBMIT_FORM_MUTATION, G as SubmitFormInput, H as blocksToMeta, I as blocksToSchemas, J as buildBlockContext, K as buildBlockMap, L as defineBlock } from './commerce-queries-BJCoqTJW.js';
1
+ import { CmssyClientConfig, CmssyLayoutGroup, CmssyPageData, CmssyPageMeta, CmssyPageSummary, CmssyFormDefinition, BuildBlockContextExtra, CmssyBlockContext, BlockRect, BlockSchema, BlockMeta, FieldControl, FieldDefinition, CmssyBlockAuthContext, CmssyBlockWorkspace, CmssySiteConfig, RawBlock, CmssySiteLocales, CmssyLocaleContext } from '@cmssy/types';
2
+ export { BlockMeta, BlockRect, BlockSchema, BuildBlockContextExtra, CmssyBlockAuthContext, CmssyBlockContext, CmssyBlockMember, CmssyBlockWorkspace, CmssyBranding, CmssyClientConfig, CmssyFormDefinition, CmssyFormField, CmssyFormSettings, CmssyFormSubmitResponse, CmssyLayoutGroup, CmssyLayoutSettings, CmssyLocaleContext, CmssyLocalizedValue, CmssyModelDefinition, CmssyModelRecord, CmssyPageData, CmssyPageMeta, CmssyPageSummary, CmssyRecordList, CmssySiteConfig, CmssySiteLocales, FieldCondition, FieldConditionGroup, FieldConditionLogic, FieldControl, FieldDefinition, FieldType, RawBlock, RawLayoutBlock, SubmitFormInput, evaluateFieldConditionGroup } from '@cmssy/types';
3
+ import { B as BlockDefinition, i as BlockMap } from './commerce-queries-CfjwkgfE.js';
4
+ export { C as CmssyAddress, a as CmssyCart, d as CmssyCartDiscount, e as CmssyCartItem, f as CmssyCartItemSnapshot, b as CmssyOrder, j as CmssyOrderDiscount, g as CmssyOrderItem, k as CmssyOrderTaxSummaryLine, l as CmssyPriceTier, c as CmssyProduct, h as CmssyProductVariant, m as CmssyShippingMethod, n as CmssyTaxSummaryLine, o as blocksToMeta, p as blocksToSchemas, q as buildBlockMap, r as defineBlock } from './commerce-queries-CfjwkgfE.js';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
6
  import 'react';
7
7
 
@@ -45,6 +45,14 @@ declare function fetchPages(config: CmssyClientConfig, options?: Pick<FetchPageO
45
45
  declare function fetchPageMeta(config: CmssyClientConfig, path: string | string[] | undefined, options?: Pick<FetchPageOptions, "fetch" | "signal">): Promise<CmssyPageMeta | null>;
46
46
  declare function fetchLayouts(config: CmssyClientConfig, path: string | string[] | undefined, options?: FetchPageOptions): Promise<CmssyLayoutGroup[]>;
47
47
 
48
+ declare const SITE_CONFIG_QUERY = "query PublicSiteConfig($workspaceSlug: String!) {\n public {\n siteConfig(workspaceSlug: $workspaceSlug) {\n id\n workspaceId\n siteName\n defaultLanguage\n enabledLanguages\n enabledFeatures\n notFoundPageId\n previewUrl\n branding {\n brandName\n logoUrl\n faviconUrl\n ogImageUrl\n }\n }\n }\n}";
49
+ declare const MODEL_DEFINITIONS_QUERY = "query PublicModelDefinitions($workspaceId: String!) {\n public {\n model {\n definitions(workspaceId: $workspaceId) {\n id name slug description icon color displayField recordCount\n }\n }\n }\n}";
50
+ declare const MODEL_RECORDS_QUERY = "query PublicModelRecords($workspaceId: String!, $modelSlug: String!, $filter: JSON, $sort: String, $limit: Int, $offset: Int, $populate: [String!]) {\n public {\n model {\n records(workspaceId: $workspaceId, modelSlug: $modelSlug, filter: $filter, sort: $sort, limit: $limit, offset: $offset, populate: $populate) {\n items { id modelId data status createdAt updatedAt }\n total\n hasMore\n }\n }\n }\n}";
51
+ declare const FORM_QUERY = "query PublicForm($formId: ID!) {\n public {\n form {\n get(formId: $formId) {\n id\n name\n slug\n description\n fields {\n id name fieldType label placeholder helpText\n defaultValue width order showWhen requiredWhen\n options { value label disabled }\n validation { required minLength maxLength minValue maxValue pattern customMessage }\n }\n settings {\n actionType submitButtonLabel successMessage errorMessage\n redirectUrl requireLogin enableCaptcha\n }\n }\n }\n }\n}";
52
+ declare const SUBMIT_FORM_MUTATION = "mutation SubmitForm($formId: ID!, $input: SubmitFormInput!) {\n public {\n form {\n submit(formId: $formId, input: $input) {\n success message submissionId redirectUrl accessToken customer\n }\n }\n }\n}";
53
+
54
+ declare function buildBlockContext(locale: string, defaultLocale: string, enabledLocales?: string[], isPreview?: boolean, forms?: Record<string, CmssyFormDefinition>, extra?: BuildBlockContextExtra): CmssyBlockContext;
55
+
48
56
  declare const PROTOCOL_VERSION = 2;
49
57
 
50
58
  interface ReadyMessage {
@@ -274,4 +282,4 @@ interface UnknownBlockProps {
274
282
  }
275
283
  declare function UnknownBlock({ type }: UnknownBlockProps): react_jsx_runtime.JSX.Element;
276
284
 
277
- export { type AppToEditorMessage, BlockDefinition, BlockMap, type BoundsMessage, type ClickMessage, CmssyBlock, CmssyBlockAuthContext, CmssyBlockContext, type CmssyBlockProps, CmssyBlockWorkspace, type CmssyClient, CmssyFormDefinition, CmssyLocaleContext, CmssyServerLayout, type CmssyServerLayoutProps, CmssyServerPage, type CmssyServerPageProps, DEFAULT_CMSSY_API_URL, type EditorToAppMessage, type FetchLike, type FetchLikeResponse, type FetchPageOptions, type GraphqlRequestOptions, PROTOCOL_VERSION, type ParentReadyMessage, type PatchMessage, type PostTarget, type QueryScopedOptions, type ReadyMessage, type SelectMessage, UnknownBlock, type UnknownBlockProps, buildLocaleSwitchHref, collectFormIds, createCmssyClient, fetchLayouts, fetchPage, fetchPageById, fetchPageMeta, fetchPages, fetchSiteConfig, fields, getBlockContentForLanguage, graphqlRequest, isProtocolCompatible, localizeHref, localizeHtmlLinks, normalizeOrigin, normalizeSlug, parseEditorMessage, postToEditor, resolveApiUrl, resolveForms, resolvePublicUrl, resolveSiteLocales, resolveWorkspaceId, splitLocaleFromPath };
285
+ export { type AppToEditorMessage, BlockDefinition, BlockMap, type BoundsMessage, type ClickMessage, CmssyBlock, type CmssyBlockProps, type CmssyClient, CmssyServerLayout, type CmssyServerLayoutProps, CmssyServerPage, type CmssyServerPageProps, DEFAULT_CMSSY_API_URL, type EditorToAppMessage, FORM_QUERY, type FetchLike, type FetchLikeResponse, type FetchPageOptions, type GraphqlRequestOptions, MODEL_DEFINITIONS_QUERY, MODEL_RECORDS_QUERY, PROTOCOL_VERSION, type ParentReadyMessage, type PatchMessage, type PostTarget, type QueryScopedOptions, type ReadyMessage, SITE_CONFIG_QUERY, SUBMIT_FORM_MUTATION, type SelectMessage, UnknownBlock, type UnknownBlockProps, buildBlockContext, buildLocaleSwitchHref, collectFormIds, createCmssyClient, fetchLayouts, fetchPage, fetchPageById, fetchPageMeta, fetchPages, fetchSiteConfig, fields, getBlockContentForLanguage, graphqlRequest, isProtocolCompatible, localizeHref, localizeHtmlLinks, normalizeOrigin, normalizeSlug, parseEditorMessage, postToEditor, resolveApiUrl, resolveForms, resolvePublicUrl, resolveSiteLocales, resolveWorkspaceId, splitLocaleFromPath };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmssy/react",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
4
4
  "description": "React blocks, renderers, data client and editor bridge for cmssy headless sites",
5
5
  "keywords": [
6
6
  "cmssy",
@@ -56,7 +56,7 @@
56
56
  "vitest": "^2.1.0"
57
57
  },
58
58
  "dependencies": {
59
- "@cmssy/types": "0.24.0"
59
+ "@cmssy/types": "0.25.0"
60
60
  },
61
61
  "scripts": {
62
62
  "build": "tsup",