@cmssy/react 0.8.1 → 0.9.1
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 +1 -0
- package/dist/client.d.cts +2 -2
- package/dist/client.d.ts +2 -2
- package/dist/client.js +1 -0
- package/dist/{commerce-queries-Da7vBV3S.d.cts → commerce-queries-DXT2RQlm.d.cts} +4 -3
- package/dist/{commerce-queries-Da7vBV3S.d.ts → commerce-queries-DXT2RQlm.d.ts} +4 -3
- package/dist/index.cjs +7 -1
- package/dist/index.d.cts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +3 -1
- package/package.json +2 -2
package/dist/client.cjs
CHANGED
|
@@ -1023,6 +1023,7 @@ var fields = {
|
|
|
1023
1023
|
text: control("text"),
|
|
1024
1024
|
textarea: control("textarea"),
|
|
1025
1025
|
richText: control("richText"),
|
|
1026
|
+
markdown: control("markdown"),
|
|
1026
1027
|
number: control("number"),
|
|
1027
1028
|
date: control("date"),
|
|
1028
1029
|
datetime: control("datetime"),
|
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 CmssyCart, g as CmssyOrder, h as CmssyProduct } from './commerce-queries-
|
|
3
|
-
export { i as CmssyCartDiscount, j as CmssyCartItem, k as CmssyCartItemSnapshot, l as CmssyOrderItem, m as CmssyProductVariant } from './commerce-queries-
|
|
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-DXT2RQlm.cjs';
|
|
3
|
+
export { i as CmssyCartDiscount, j as CmssyCartItem, k as CmssyCartItemSnapshot, l as CmssyOrderItem, m as CmssyProductVariant } from './commerce-queries-DXT2RQlm.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 CmssyCart, g as CmssyOrder, h as CmssyProduct } from './commerce-queries-
|
|
3
|
-
export { i as CmssyCartDiscount, j as CmssyCartItem, k as CmssyCartItemSnapshot, l as CmssyOrderItem, m as CmssyProductVariant } from './commerce-queries-
|
|
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-DXT2RQlm.js';
|
|
3
|
+
export { i as CmssyCartDiscount, j as CmssyCartItem, k as CmssyCartItemSnapshot, l as CmssyOrderItem, m as CmssyProductVariant } from './commerce-queries-DXT2RQlm.js';
|
|
4
4
|
import { ReactNode } from 'react';
|
|
5
5
|
import '@cmssy/types';
|
|
6
6
|
|
package/dist/client.js
CHANGED
|
@@ -1021,6 +1021,7 @@ var fields = {
|
|
|
1021
1021
|
text: control("text"),
|
|
1022
1022
|
textarea: control("textarea"),
|
|
1023
1023
|
richText: control("richText"),
|
|
1024
|
+
markdown: control("markdown"),
|
|
1024
1025
|
number: control("number"),
|
|
1025
1026
|
date: control("date"),
|
|
1026
1027
|
datetime: control("datetime"),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentType } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { FieldConditionGroup, FieldType } from '@cmssy/types';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* The cmssy cloud GraphQL delivery endpoint. It is the same for every workspace,
|
|
@@ -128,7 +128,8 @@ interface CmssyFormField {
|
|
|
128
128
|
validation: unknown;
|
|
129
129
|
width: string | null;
|
|
130
130
|
order: number | null;
|
|
131
|
-
showWhen:
|
|
131
|
+
showWhen: FieldConditionGroup | null;
|
|
132
|
+
requiredWhen: FieldConditionGroup | null;
|
|
132
133
|
}
|
|
133
134
|
interface CmssyFormSettings {
|
|
134
135
|
actionType: string | null;
|
|
@@ -159,7 +160,7 @@ interface SubmitFormInput {
|
|
|
159
160
|
data: Record<string, unknown>;
|
|
160
161
|
website?: string;
|
|
161
162
|
}
|
|
162
|
-
declare const FORM_QUERY = "query PublicForm($formId: ID!) {\n publicForm(formId: $formId) {\n id\n name\n slug\n description\n fields {\n id name fieldType label placeholder helpText\n defaultValue width order showWhen\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}";
|
|
163
|
+
declare const FORM_QUERY = "query PublicForm($formId: ID!) {\n publicForm(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}";
|
|
163
164
|
declare const SUBMIT_FORM_MUTATION = "mutation SubmitForm($formId: ID!, $input: SubmitFormInput!) {\n submitForm(formId: $formId, input: $input) {\n success message submissionId redirectUrl accessToken customer\n }\n}";
|
|
164
165
|
|
|
165
166
|
interface CmssyLocaleContext {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentType } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { FieldConditionGroup, FieldType } from '@cmssy/types';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* The cmssy cloud GraphQL delivery endpoint. It is the same for every workspace,
|
|
@@ -128,7 +128,8 @@ interface CmssyFormField {
|
|
|
128
128
|
validation: unknown;
|
|
129
129
|
width: string | null;
|
|
130
130
|
order: number | null;
|
|
131
|
-
showWhen:
|
|
131
|
+
showWhen: FieldConditionGroup | null;
|
|
132
|
+
requiredWhen: FieldConditionGroup | null;
|
|
132
133
|
}
|
|
133
134
|
interface CmssyFormSettings {
|
|
134
135
|
actionType: string | null;
|
|
@@ -159,7 +160,7 @@ interface SubmitFormInput {
|
|
|
159
160
|
data: Record<string, unknown>;
|
|
160
161
|
website?: string;
|
|
161
162
|
}
|
|
162
|
-
declare const FORM_QUERY = "query PublicForm($formId: ID!) {\n publicForm(formId: $formId) {\n id\n name\n slug\n description\n fields {\n id name fieldType label placeholder helpText\n defaultValue width order showWhen\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}";
|
|
163
|
+
declare const FORM_QUERY = "query PublicForm($formId: ID!) {\n publicForm(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}";
|
|
163
164
|
declare const SUBMIT_FORM_MUTATION = "mutation SubmitForm($formId: ID!, $input: SubmitFormInput!) {\n submitForm(formId: $formId, input: $input) {\n success message submissionId redirectUrl accessToken customer\n }\n}";
|
|
164
165
|
|
|
165
166
|
interface CmssyLocaleContext {
|
package/dist/index.cjs
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var react = require('react');
|
|
4
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var types = require('@cmssy/types');
|
|
5
6
|
|
|
6
7
|
// src/fields.ts
|
|
7
8
|
function control(type) {
|
|
@@ -15,6 +16,7 @@ var fields = {
|
|
|
15
16
|
text: control("text"),
|
|
16
17
|
textarea: control("textarea"),
|
|
17
18
|
richText: control("richText"),
|
|
19
|
+
markdown: control("markdown"),
|
|
18
20
|
number: control("number"),
|
|
19
21
|
date: control("date"),
|
|
20
22
|
datetime: control("datetime"),
|
|
@@ -639,7 +641,7 @@ var FORM_QUERY = `query PublicForm($formId: ID!) {
|
|
|
639
641
|
description
|
|
640
642
|
fields {
|
|
641
643
|
id name fieldType label placeholder helpText
|
|
642
|
-
defaultValue width order showWhen
|
|
644
|
+
defaultValue width order showWhen requiredWhen
|
|
643
645
|
options { value label disabled }
|
|
644
646
|
validation { required minLength maxLength minValue maxValue pattern customMessage }
|
|
645
647
|
}
|
|
@@ -873,6 +875,10 @@ function CmssyBlock({
|
|
|
873
875
|
);
|
|
874
876
|
}
|
|
875
877
|
|
|
878
|
+
Object.defineProperty(exports, "evaluateFieldConditionGroup", {
|
|
879
|
+
enumerable: true,
|
|
880
|
+
get: function () { return types.evaluateFieldConditionGroup; }
|
|
881
|
+
});
|
|
876
882
|
exports.CmssyBlock = CmssyBlock;
|
|
877
883
|
exports.CmssyServerLayout = CmssyServerLayout;
|
|
878
884
|
exports.CmssyServerPage = CmssyServerPage;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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-
|
|
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-
|
|
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-DXT2RQlm.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-DXT2RQlm.cjs';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
-
export { FieldType } from '@cmssy/types';
|
|
4
|
+
export { FieldCondition, FieldConditionGroup, FieldConditionLogic, FieldType, evaluateFieldConditionGroup } from '@cmssy/types';
|
|
5
5
|
import 'react';
|
|
6
6
|
|
|
7
7
|
type FieldControl = Omit<FieldDefinition, "type" | "label"> & {
|
|
@@ -11,6 +11,7 @@ declare const fields: {
|
|
|
11
11
|
text: (opts?: FieldControl) => FieldDefinition;
|
|
12
12
|
textarea: (opts?: FieldControl) => FieldDefinition;
|
|
13
13
|
richText: (opts?: FieldControl) => FieldDefinition;
|
|
14
|
+
markdown: (opts?: FieldControl) => FieldDefinition;
|
|
14
15
|
number: (opts?: FieldControl) => FieldDefinition;
|
|
15
16
|
date: (opts?: FieldControl) => FieldDefinition;
|
|
16
17
|
datetime: (opts?: FieldControl) => FieldDefinition;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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-
|
|
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-
|
|
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-DXT2RQlm.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-DXT2RQlm.js';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
-
export { FieldType } from '@cmssy/types';
|
|
4
|
+
export { FieldCondition, FieldConditionGroup, FieldConditionLogic, FieldType, evaluateFieldConditionGroup } from '@cmssy/types';
|
|
5
5
|
import 'react';
|
|
6
6
|
|
|
7
7
|
type FieldControl = Omit<FieldDefinition, "type" | "label"> & {
|
|
@@ -11,6 +11,7 @@ declare const fields: {
|
|
|
11
11
|
text: (opts?: FieldControl) => FieldDefinition;
|
|
12
12
|
textarea: (opts?: FieldControl) => FieldDefinition;
|
|
13
13
|
richText: (opts?: FieldControl) => FieldDefinition;
|
|
14
|
+
markdown: (opts?: FieldControl) => FieldDefinition;
|
|
14
15
|
number: (opts?: FieldControl) => FieldDefinition;
|
|
15
16
|
date: (opts?: FieldControl) => FieldDefinition;
|
|
16
17
|
datetime: (opts?: FieldControl) => FieldDefinition;
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createElement } from 'react';
|
|
2
2
|
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
3
|
+
export { evaluateFieldConditionGroup } from '@cmssy/types';
|
|
3
4
|
|
|
4
5
|
// src/fields.ts
|
|
5
6
|
function control(type) {
|
|
@@ -13,6 +14,7 @@ var fields = {
|
|
|
13
14
|
text: control("text"),
|
|
14
15
|
textarea: control("textarea"),
|
|
15
16
|
richText: control("richText"),
|
|
17
|
+
markdown: control("markdown"),
|
|
16
18
|
number: control("number"),
|
|
17
19
|
date: control("date"),
|
|
18
20
|
datetime: control("datetime"),
|
|
@@ -637,7 +639,7 @@ var FORM_QUERY = `query PublicForm($formId: ID!) {
|
|
|
637
639
|
description
|
|
638
640
|
fields {
|
|
639
641
|
id name fieldType label placeholder helpText
|
|
640
|
-
defaultValue width order showWhen
|
|
642
|
+
defaultValue width order showWhen requiredWhen
|
|
641
643
|
options { value label disabled }
|
|
642
644
|
validation { required minLength maxLength minValue maxValue pattern customMessage }
|
|
643
645
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cmssy/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"description": "React blocks, renderers, data client and editor bridge for cmssy headless sites",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cmssy",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"vitest": "^2.1.0"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@cmssy/types": "^0.
|
|
58
|
+
"@cmssy/types": "^0.20.0"
|
|
59
59
|
},
|
|
60
60
|
"scripts": {
|
|
61
61
|
"build": "tsup",
|