@cmssy/core 16.5.0 → 16.7.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/index.cjs +2 -2
- package/dist/index.d.cts +37 -33
- package/dist/index.d.ts +37 -33
- package/dist/index.js +2 -2
- package/dist/internal/locale.cjs +1 -1
- package/dist/internal/locale.js +1 -1
- package/dist/internal.cjs +1 -1
- package/dist/internal.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -74,7 +74,7 @@ Set the listed environment variables (e.g. in .env.local) and restart the dev se
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
// src/version.ts
|
|
77
|
-
var CMSSY_CORE_VERSION = "16.
|
|
77
|
+
var CMSSY_CORE_VERSION = "16.7.0" ;
|
|
78
78
|
var CMSSY_USER_AGENT = `@cmssy/core/${CMSSY_CORE_VERSION}`;
|
|
79
79
|
|
|
80
80
|
// src/data/http.ts
|
|
@@ -569,9 +569,9 @@ var fields = {
|
|
|
569
569
|
link: control("link"),
|
|
570
570
|
url: control("url"),
|
|
571
571
|
email: control("email"),
|
|
572
|
-
table: control("table"),
|
|
573
572
|
json: control("json"),
|
|
574
573
|
form: control("form"),
|
|
574
|
+
table: (opts = {}) => build("table", opts),
|
|
575
575
|
select: choice("select"),
|
|
576
576
|
radio: choice("radio"),
|
|
577
577
|
multiselect: (opts) => build("multiselect", opts),
|
package/dist/index.d.cts
CHANGED
|
@@ -2,7 +2,7 @@ export { A as AppToEditorMessage, B as BoundsMessage, C as ClickMessage, a as Cm
|
|
|
2
2
|
export { C as CMSSY_LOCALE_HEADER, G as GraphqlRequestOptions, g as graphqlRequest, l as localizeHref, r as resolveCmssyLocale } from './locale-JyBHqpAQ.cjs';
|
|
3
3
|
export { C as CMSSY_RATE_LIMIT_WINDOW_MS, a as CMSSY_RETRY_MODES, b as CmssyRequestError, c as CmssyRetryMode, D as DEFAULT_CMSSY_API_URL, F as FetchLike, d as FetchLikeResponse, e as FetchPageOptions, R as RetryOption, f as RetryPolicy } from './content-client-65N8ZRq9.cjs';
|
|
4
4
|
import * as _cmssy_types from '@cmssy/types';
|
|
5
|
-
import { FieldOptions, TypedField, ResolvedMediaValue, PageRef, BlockPropsSchema, InferBlockContent, RelationMode, CmssyModelRecord, ResolvedMedia, BlockSchema, LayoutRegion, FieldDefinition, BlockMeta, VerifyCmssyWebhookOptions, CmssyWebhookEvent } from '@cmssy/types';
|
|
5
|
+
import { FieldOptions, TypedField, FieldTypeValueMap, ResolvedMediaValue, PageRef, BlockPropsSchema, InferBlockContent, RelationMode, CmssyModelRecord, ResolvedMedia, BlockSchema, LayoutRegion, FieldDefinition, BlockMeta, VerifyCmssyWebhookOptions, CmssyWebhookEvent } from '@cmssy/types';
|
|
6
6
|
export { BlockMeta, BlockPropsSchema, BlockRect, BlockSchema, BuildBlockContextExtra, CmssyBlockAuthContext, CmssyBlockContext, CmssyBlockMember, CmssyBlockPage, CmssyBlockWorkspace, CmssyBranding, CmssyClientConfig, CmssyFormDefinition, CmssyFormField, CmssyFormSettings, CmssyFormSubmitResponse, CmssyLayoutGroup, CmssyLocaleContext, CmssyLocalizedValue, CmssyModelDefinition, CmssyModelRecord, CmssyPageData, CmssyPageMeta, CmssyPageSummary, CmssyRecordList, CmssySiteConfig, CmssyWebhookEvent, CmssyWebhookOrder, FieldCondition, FieldConditionGroup, FieldConditionLogic, FieldControl, FieldDefinition, FieldOptions, FieldType, InferBlockContent, LayoutRegion, LayoutRegionId, RawBlock, RawLayoutBlock, SubmitFormInput, TypedField, VerifyCmssyWebhookOptions, evaluateFieldConditionGroup } from '@cmssy/types';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -13,9 +13,20 @@ export { BlockMeta, BlockPropsSchema, BlockRect, BlockSchema, BuildBlockContextE
|
|
|
13
13
|
type Declared<O> = O extends {
|
|
14
14
|
required: true;
|
|
15
15
|
} ? true : false;
|
|
16
|
-
type
|
|
17
|
-
type
|
|
18
|
-
type
|
|
16
|
+
type BaseFieldOptions = Pick<FieldOptions, "label" | "defaultValue" | "helperText" | "required" | "placeholder" | "tab" | "localized">;
|
|
17
|
+
type ChoiceFieldOptions = BaseFieldOptions & Pick<FieldOptions, "options">;
|
|
18
|
+
type MediaFieldOptions = BaseFieldOptions & Pick<FieldOptions, "multiple" | "acceptedTypes" | "accept" | "maxSize" | "aspectRatio" | "aspectRatios">;
|
|
19
|
+
type PageSelectorFieldOptions = BaseFieldOptions & Pick<FieldOptions, "multiple" | "pageType">;
|
|
20
|
+
type RepeaterFieldOptions = BaseFieldOptions & Pick<FieldOptions, "itemSchema" | "minItems" | "maxItems" | "itemLabel" | "addButtonLabel" | "collapsible">;
|
|
21
|
+
type TableFieldOptions = BaseFieldOptions & Pick<FieldOptions, "maxColumns">;
|
|
22
|
+
interface RelationFieldOptions extends BaseFieldOptions {
|
|
23
|
+
model: string;
|
|
24
|
+
mode?: RelationMode;
|
|
25
|
+
multiple?: boolean;
|
|
26
|
+
sort?: string;
|
|
27
|
+
limit?: number;
|
|
28
|
+
}
|
|
29
|
+
type Only<O, Shape> = Shape & Record<Exclude<keyof O, keyof Shape>, never>;
|
|
19
30
|
type OptionValue<O> = O extends {
|
|
20
31
|
options: readonly (infer Option extends string)[];
|
|
21
32
|
} ? Option : string;
|
|
@@ -38,36 +49,29 @@ type RelationValue<O> = O extends {
|
|
|
38
49
|
type PageSelectorValue<O> = O extends {
|
|
39
50
|
multiple: false;
|
|
40
51
|
} ? PageRef | undefined : PageRef[];
|
|
41
|
-
interface RelationFieldOptions extends Omit<FieldOptions, "options" | "itemSchema"> {
|
|
42
|
-
model: string;
|
|
43
|
-
mode?: RelationMode;
|
|
44
|
-
multiple?: boolean;
|
|
45
|
-
sort?: string;
|
|
46
|
-
limit?: number;
|
|
47
|
-
}
|
|
48
52
|
declare const fields: {
|
|
49
|
-
text: <const O extends
|
|
50
|
-
textarea: <const O extends
|
|
51
|
-
richText: <const O extends
|
|
52
|
-
markdown: <const O extends
|
|
53
|
-
number: <const O extends
|
|
54
|
-
date: <const O extends
|
|
55
|
-
datetime: <const O extends
|
|
56
|
-
boolean: <const O extends
|
|
57
|
-
color: <const O extends
|
|
58
|
-
link: <const O extends
|
|
59
|
-
url: <const O extends
|
|
60
|
-
email: <const O extends
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
select: <const O extends
|
|
65
|
-
radio: <const O extends
|
|
66
|
-
multiselect: <const O extends
|
|
67
|
-
media: <const O extends
|
|
68
|
-
pageSelector: <const O extends
|
|
69
|
-
repeater: <const O extends
|
|
70
|
-
relation: <const O extends
|
|
53
|
+
text: <const O extends Only<O, BaseFieldOptions>>(opts?: O) => TypedField<string, Declared<O>>;
|
|
54
|
+
textarea: <const O extends Only<O, BaseFieldOptions>>(opts?: O) => TypedField<string, Declared<O>>;
|
|
55
|
+
richText: <const O extends Only<O, BaseFieldOptions>>(opts?: O) => TypedField<string, Declared<O>>;
|
|
56
|
+
markdown: <const O extends Only<O, BaseFieldOptions>>(opts?: O) => TypedField<string, Declared<O>>;
|
|
57
|
+
number: <const O extends Only<O, BaseFieldOptions>>(opts?: O) => TypedField<number, Declared<O>>;
|
|
58
|
+
date: <const O extends Only<O, BaseFieldOptions>>(opts?: O) => TypedField<string, Declared<O>>;
|
|
59
|
+
datetime: <const O extends Only<O, BaseFieldOptions>>(opts?: O) => TypedField<string, Declared<O>>;
|
|
60
|
+
boolean: <const O extends Only<O, BaseFieldOptions>>(opts?: O) => TypedField<boolean, Declared<O>>;
|
|
61
|
+
color: <const O extends Only<O, BaseFieldOptions>>(opts?: O) => TypedField<string, Declared<O>>;
|
|
62
|
+
link: <const O extends Only<O, BaseFieldOptions>>(opts?: O) => TypedField<string, Declared<O>>;
|
|
63
|
+
url: <const O extends Only<O, BaseFieldOptions>>(opts?: O) => TypedField<string, Declared<O>>;
|
|
64
|
+
email: <const O extends Only<O, BaseFieldOptions>>(opts?: O) => TypedField<string, Declared<O>>;
|
|
65
|
+
json: <const O extends Only<O, BaseFieldOptions>>(opts?: O) => TypedField<_cmssy_types.JsonValue, Declared<O>>;
|
|
66
|
+
form: <const O extends Only<O, BaseFieldOptions>>(opts?: O) => TypedField<string, Declared<O>>;
|
|
67
|
+
table: <const O extends Only<O, TableFieldOptions>>(opts?: O) => TypedField<FieldTypeValueMap["table"], Declared<O>>;
|
|
68
|
+
select: <const O extends Only<O, ChoiceFieldOptions>>(opts: O) => TypedField<OptionValue<O>, Declared<O>>;
|
|
69
|
+
radio: <const O extends Only<O, ChoiceFieldOptions>>(opts: O) => TypedField<OptionValue<O>, Declared<O>>;
|
|
70
|
+
multiselect: <const O extends Only<O, ChoiceFieldOptions>>(opts: O) => TypedField<OptionValue<O>[], Declared<O>>;
|
|
71
|
+
media: <const O extends Only<O, MediaFieldOptions>>(opts?: O) => TypedField<MediaValue<O>, Declared<O>>;
|
|
72
|
+
pageSelector: <const O extends Only<O, PageSelectorFieldOptions>>(opts?: O) => TypedField<PageSelectorValue<O>, Declared<O>>;
|
|
73
|
+
repeater: <const O extends Only<O, RepeaterFieldOptions>>(opts: O) => TypedField<RepeaterValue<O>, Declared<O>>;
|
|
74
|
+
relation: <const O extends Only<O, RelationFieldOptions>>(opts: O) => TypedField<RelationValue<O>, Declared<O>>;
|
|
71
75
|
};
|
|
72
76
|
|
|
73
77
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export { A as AppToEditorMessage, B as BoundsMessage, C as ClickMessage, a as Cm
|
|
|
2
2
|
export { C as CMSSY_LOCALE_HEADER, G as GraphqlRequestOptions, g as graphqlRequest, l as localizeHref, r as resolveCmssyLocale } from './locale-D9KI4bND.js';
|
|
3
3
|
export { C as CMSSY_RATE_LIMIT_WINDOW_MS, a as CMSSY_RETRY_MODES, b as CmssyRequestError, c as CmssyRetryMode, D as DEFAULT_CMSSY_API_URL, F as FetchLike, d as FetchLikeResponse, e as FetchPageOptions, R as RetryOption, f as RetryPolicy } from './content-client-65N8ZRq9.js';
|
|
4
4
|
import * as _cmssy_types from '@cmssy/types';
|
|
5
|
-
import { FieldOptions, TypedField, ResolvedMediaValue, PageRef, BlockPropsSchema, InferBlockContent, RelationMode, CmssyModelRecord, ResolvedMedia, BlockSchema, LayoutRegion, FieldDefinition, BlockMeta, VerifyCmssyWebhookOptions, CmssyWebhookEvent } from '@cmssy/types';
|
|
5
|
+
import { FieldOptions, TypedField, FieldTypeValueMap, ResolvedMediaValue, PageRef, BlockPropsSchema, InferBlockContent, RelationMode, CmssyModelRecord, ResolvedMedia, BlockSchema, LayoutRegion, FieldDefinition, BlockMeta, VerifyCmssyWebhookOptions, CmssyWebhookEvent } from '@cmssy/types';
|
|
6
6
|
export { BlockMeta, BlockPropsSchema, BlockRect, BlockSchema, BuildBlockContextExtra, CmssyBlockAuthContext, CmssyBlockContext, CmssyBlockMember, CmssyBlockPage, CmssyBlockWorkspace, CmssyBranding, CmssyClientConfig, CmssyFormDefinition, CmssyFormField, CmssyFormSettings, CmssyFormSubmitResponse, CmssyLayoutGroup, CmssyLocaleContext, CmssyLocalizedValue, CmssyModelDefinition, CmssyModelRecord, CmssyPageData, CmssyPageMeta, CmssyPageSummary, CmssyRecordList, CmssySiteConfig, CmssyWebhookEvent, CmssyWebhookOrder, FieldCondition, FieldConditionGroup, FieldConditionLogic, FieldControl, FieldDefinition, FieldOptions, FieldType, InferBlockContent, LayoutRegion, LayoutRegionId, RawBlock, RawLayoutBlock, SubmitFormInput, TypedField, VerifyCmssyWebhookOptions, evaluateFieldConditionGroup } from '@cmssy/types';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -13,9 +13,20 @@ export { BlockMeta, BlockPropsSchema, BlockRect, BlockSchema, BuildBlockContextE
|
|
|
13
13
|
type Declared<O> = O extends {
|
|
14
14
|
required: true;
|
|
15
15
|
} ? true : false;
|
|
16
|
-
type
|
|
17
|
-
type
|
|
18
|
-
type
|
|
16
|
+
type BaseFieldOptions = Pick<FieldOptions, "label" | "defaultValue" | "helperText" | "required" | "placeholder" | "tab" | "localized">;
|
|
17
|
+
type ChoiceFieldOptions = BaseFieldOptions & Pick<FieldOptions, "options">;
|
|
18
|
+
type MediaFieldOptions = BaseFieldOptions & Pick<FieldOptions, "multiple" | "acceptedTypes" | "accept" | "maxSize" | "aspectRatio" | "aspectRatios">;
|
|
19
|
+
type PageSelectorFieldOptions = BaseFieldOptions & Pick<FieldOptions, "multiple" | "pageType">;
|
|
20
|
+
type RepeaterFieldOptions = BaseFieldOptions & Pick<FieldOptions, "itemSchema" | "minItems" | "maxItems" | "itemLabel" | "addButtonLabel" | "collapsible">;
|
|
21
|
+
type TableFieldOptions = BaseFieldOptions & Pick<FieldOptions, "maxColumns">;
|
|
22
|
+
interface RelationFieldOptions extends BaseFieldOptions {
|
|
23
|
+
model: string;
|
|
24
|
+
mode?: RelationMode;
|
|
25
|
+
multiple?: boolean;
|
|
26
|
+
sort?: string;
|
|
27
|
+
limit?: number;
|
|
28
|
+
}
|
|
29
|
+
type Only<O, Shape> = Shape & Record<Exclude<keyof O, keyof Shape>, never>;
|
|
19
30
|
type OptionValue<O> = O extends {
|
|
20
31
|
options: readonly (infer Option extends string)[];
|
|
21
32
|
} ? Option : string;
|
|
@@ -38,36 +49,29 @@ type RelationValue<O> = O extends {
|
|
|
38
49
|
type PageSelectorValue<O> = O extends {
|
|
39
50
|
multiple: false;
|
|
40
51
|
} ? PageRef | undefined : PageRef[];
|
|
41
|
-
interface RelationFieldOptions extends Omit<FieldOptions, "options" | "itemSchema"> {
|
|
42
|
-
model: string;
|
|
43
|
-
mode?: RelationMode;
|
|
44
|
-
multiple?: boolean;
|
|
45
|
-
sort?: string;
|
|
46
|
-
limit?: number;
|
|
47
|
-
}
|
|
48
52
|
declare const fields: {
|
|
49
|
-
text: <const O extends
|
|
50
|
-
textarea: <const O extends
|
|
51
|
-
richText: <const O extends
|
|
52
|
-
markdown: <const O extends
|
|
53
|
-
number: <const O extends
|
|
54
|
-
date: <const O extends
|
|
55
|
-
datetime: <const O extends
|
|
56
|
-
boolean: <const O extends
|
|
57
|
-
color: <const O extends
|
|
58
|
-
link: <const O extends
|
|
59
|
-
url: <const O extends
|
|
60
|
-
email: <const O extends
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
select: <const O extends
|
|
65
|
-
radio: <const O extends
|
|
66
|
-
multiselect: <const O extends
|
|
67
|
-
media: <const O extends
|
|
68
|
-
pageSelector: <const O extends
|
|
69
|
-
repeater: <const O extends
|
|
70
|
-
relation: <const O extends
|
|
53
|
+
text: <const O extends Only<O, BaseFieldOptions>>(opts?: O) => TypedField<string, Declared<O>>;
|
|
54
|
+
textarea: <const O extends Only<O, BaseFieldOptions>>(opts?: O) => TypedField<string, Declared<O>>;
|
|
55
|
+
richText: <const O extends Only<O, BaseFieldOptions>>(opts?: O) => TypedField<string, Declared<O>>;
|
|
56
|
+
markdown: <const O extends Only<O, BaseFieldOptions>>(opts?: O) => TypedField<string, Declared<O>>;
|
|
57
|
+
number: <const O extends Only<O, BaseFieldOptions>>(opts?: O) => TypedField<number, Declared<O>>;
|
|
58
|
+
date: <const O extends Only<O, BaseFieldOptions>>(opts?: O) => TypedField<string, Declared<O>>;
|
|
59
|
+
datetime: <const O extends Only<O, BaseFieldOptions>>(opts?: O) => TypedField<string, Declared<O>>;
|
|
60
|
+
boolean: <const O extends Only<O, BaseFieldOptions>>(opts?: O) => TypedField<boolean, Declared<O>>;
|
|
61
|
+
color: <const O extends Only<O, BaseFieldOptions>>(opts?: O) => TypedField<string, Declared<O>>;
|
|
62
|
+
link: <const O extends Only<O, BaseFieldOptions>>(opts?: O) => TypedField<string, Declared<O>>;
|
|
63
|
+
url: <const O extends Only<O, BaseFieldOptions>>(opts?: O) => TypedField<string, Declared<O>>;
|
|
64
|
+
email: <const O extends Only<O, BaseFieldOptions>>(opts?: O) => TypedField<string, Declared<O>>;
|
|
65
|
+
json: <const O extends Only<O, BaseFieldOptions>>(opts?: O) => TypedField<_cmssy_types.JsonValue, Declared<O>>;
|
|
66
|
+
form: <const O extends Only<O, BaseFieldOptions>>(opts?: O) => TypedField<string, Declared<O>>;
|
|
67
|
+
table: <const O extends Only<O, TableFieldOptions>>(opts?: O) => TypedField<FieldTypeValueMap["table"], Declared<O>>;
|
|
68
|
+
select: <const O extends Only<O, ChoiceFieldOptions>>(opts: O) => TypedField<OptionValue<O>, Declared<O>>;
|
|
69
|
+
radio: <const O extends Only<O, ChoiceFieldOptions>>(opts: O) => TypedField<OptionValue<O>, Declared<O>>;
|
|
70
|
+
multiselect: <const O extends Only<O, ChoiceFieldOptions>>(opts: O) => TypedField<OptionValue<O>[], Declared<O>>;
|
|
71
|
+
media: <const O extends Only<O, MediaFieldOptions>>(opts?: O) => TypedField<MediaValue<O>, Declared<O>>;
|
|
72
|
+
pageSelector: <const O extends Only<O, PageSelectorFieldOptions>>(opts?: O) => TypedField<PageSelectorValue<O>, Declared<O>>;
|
|
73
|
+
repeater: <const O extends Only<O, RepeaterFieldOptions>>(opts: O) => TypedField<RepeaterValue<O>, Declared<O>>;
|
|
74
|
+
relation: <const O extends Only<O, RelationFieldOptions>>(opts: O) => TypedField<RelationValue<O>, Declared<O>>;
|
|
71
75
|
};
|
|
72
76
|
|
|
73
77
|
/**
|
package/dist/index.js
CHANGED
|
@@ -73,7 +73,7 @@ Set the listed environment variables (e.g. in .env.local) and restart the dev se
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
// src/version.ts
|
|
76
|
-
var CMSSY_CORE_VERSION = "16.
|
|
76
|
+
var CMSSY_CORE_VERSION = "16.7.0" ;
|
|
77
77
|
var CMSSY_USER_AGENT = `@cmssy/core/${CMSSY_CORE_VERSION}`;
|
|
78
78
|
|
|
79
79
|
// src/data/http.ts
|
|
@@ -568,9 +568,9 @@ var fields = {
|
|
|
568
568
|
link: control("link"),
|
|
569
569
|
url: control("url"),
|
|
570
570
|
email: control("email"),
|
|
571
|
-
table: control("table"),
|
|
572
571
|
json: control("json"),
|
|
573
572
|
form: control("form"),
|
|
573
|
+
table: (opts = {}) => build("table", opts),
|
|
574
574
|
select: choice("select"),
|
|
575
575
|
radio: choice("radio"),
|
|
576
576
|
multiselect: (opts) => build("multiselect", opts),
|
package/dist/internal/locale.cjs
CHANGED
package/dist/internal/locale.js
CHANGED
package/dist/internal.cjs
CHANGED
package/dist/internal.js
CHANGED