@plasmicapp/host 1.0.149 → 1.0.151
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/exports.d.ts +1 -1
- package/dist/host.esm.js +8 -2
- package/dist/host.esm.js.map +1 -1
- package/dist/index.cjs.js +8 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/prop-types.d.ts +14 -4
- package/dist/registerComponent.d.ts +5 -0
- package/dist/version.d.ts +1 -1
- package/package.json +3 -3
- package/registerComponent/dist/exports.d.ts +1 -1
- package/registerComponent/dist/index.cjs.js +6 -0
- package/registerComponent/dist/index.cjs.js.map +1 -1
- package/registerComponent/dist/index.esm.js +6 -1
- package/registerComponent/dist/index.esm.js.map +1 -1
- package/registerComponent/dist/prop-types.d.ts +14 -4
- package/registerComponent/dist/registerComponent.d.ts +5 -0
- package/registerComponent/dist/version.d.ts +1 -1
- package/registerGlobalContext/dist/exports.d.ts +1 -1
- package/registerGlobalContext/dist/prop-types.d.ts +14 -4
- package/registerGlobalContext/dist/registerComponent.d.ts +5 -0
- package/registerGlobalContext/dist/version.d.ts +1 -1
- package/registerToken/dist/exports.d.ts +1 -1
- package/registerToken/dist/prop-types.d.ts +14 -4
- package/registerToken/dist/registerComponent.d.ts +5 -0
- package/registerToken/dist/version.d.ts +1 -1
- package/registerTrait/dist/exports.d.ts +1 -1
- package/registerTrait/dist/prop-types.d.ts +14 -4
- package/registerTrait/dist/registerComponent.d.ts +5 -0
- package/registerTrait/dist/version.d.ts +1 -1
|
@@ -3,7 +3,7 @@ export * from "./data";
|
|
|
3
3
|
export { PlasmicElement } from "./element-types";
|
|
4
4
|
export { registerFetcher as unstable_registerFetcher } from "./fetcher";
|
|
5
5
|
export * from "./global-actions";
|
|
6
|
-
export { Action, ActionProps, CodeComponentMeta, ComponentHelpers, ComponentMeta, ComponentRegistration, ComponentTemplates, default as registerComponent, StateHelpers, StateSpec, CodeComponentMode, } from "./registerComponent";
|
|
6
|
+
export { Action, ActionProps, CodeComponentMeta, ComponentHelpers, ComponentMeta, ComponentRegistration, ComponentTemplates, default as registerComponent, stateHelpersKeys, StateHelpers, StateSpec, CodeComponentMode, } from "./registerComponent";
|
|
7
7
|
export { PropType, ContextDependentConfig } from "./prop-types";
|
|
8
8
|
export { default as registerGlobalContext, GlobalContextMeta, GlobalContextRegistration, PropType as GlobalContextPropType, } from "./registerGlobalContext";
|
|
9
9
|
export { default as registerToken, TokenRegistration, TokenType, } from "./registerToken";
|
|
@@ -41,6 +41,7 @@ export interface PropTypeBase<P> {
|
|
|
41
41
|
displayName?: string;
|
|
42
42
|
description?: string;
|
|
43
43
|
helpText?: string;
|
|
44
|
+
required?: boolean;
|
|
44
45
|
/**
|
|
45
46
|
* If the user has chosen to use a dynamic expression for this prop, provide
|
|
46
47
|
* a hint as to the expected values that the expression should evaluate to.
|
|
@@ -84,6 +85,11 @@ interface Defaultable<P, T> {
|
|
|
84
85
|
*/
|
|
85
86
|
defaultExpr?: string;
|
|
86
87
|
defaultExprHint?: string;
|
|
88
|
+
/**
|
|
89
|
+
* This function validates whether the prop value is valid.
|
|
90
|
+
* If the value is invalid, it returns an error message. Otherwise, it returns true.
|
|
91
|
+
*/
|
|
92
|
+
validator?: (value: T, ...args: ControlContext<P>) => (string | true) | Promise<string | true>;
|
|
87
93
|
}
|
|
88
94
|
interface Controllable {
|
|
89
95
|
/**
|
|
@@ -259,15 +265,19 @@ export interface DataSourceType<P> extends PropTypeBase<P> {
|
|
|
259
265
|
dataSource: "airtable" | "cms";
|
|
260
266
|
}
|
|
261
267
|
type DataPickerValueType = string | number | (string | number)[];
|
|
262
|
-
interface
|
|
268
|
+
interface RichDataPickerType<P> extends PropTypeBaseDefault<P, DataPickerValueType> {
|
|
263
269
|
type: "dataSelector";
|
|
264
|
-
data
|
|
270
|
+
data?: Record<string, any> | ContextDependentConfig<P, Record<string, any>>;
|
|
265
271
|
alwaysShowValuePathAsLabel?: boolean;
|
|
272
|
+
mergeWithExternalData?: boolean;
|
|
266
273
|
}
|
|
267
|
-
|
|
274
|
+
type DataPickerType<P> = "dataPicker" | RichDataPickerType<P>;
|
|
275
|
+
interface RichExprEditorType<P> extends PropTypeBaseDefault<P, DataPickerValueType> {
|
|
268
276
|
type: "exprEditor";
|
|
269
|
-
data
|
|
277
|
+
data?: Record<string, any> | ContextDependentConfig<P, Record<string, any>>;
|
|
278
|
+
mergeWithExternalData?: boolean;
|
|
270
279
|
}
|
|
280
|
+
type ExprEditorType<P> = "exprEditor" | RichExprEditorType<P>;
|
|
271
281
|
interface FormValidationRulesType<P> extends PropTypeBaseDefault<P, any> {
|
|
272
282
|
type: "formValidationRules";
|
|
273
283
|
}
|
|
@@ -76,7 +76,12 @@ export type StateSpec = {
|
|
|
76
76
|
export interface StateHelpers<P, T> {
|
|
77
77
|
initFunc?: ($props: P) => T;
|
|
78
78
|
onChangeArgsToValue?: (...args: any) => T;
|
|
79
|
+
onMutate?: (stateValue: T, $ref: any) => void;
|
|
79
80
|
}
|
|
81
|
+
type TupleUnion<U extends string, R extends string[] = []> = {
|
|
82
|
+
[S in U]: Exclude<U, S> extends never ? [...R, S] : TupleUnion<Exclude<U, S>, [...R, S]>;
|
|
83
|
+
}[U] & string[];
|
|
84
|
+
export declare const stateHelpersKeys: TupleUnion<keyof StateHelpers<any, any>>;
|
|
80
85
|
export type ComponentHelpers<P> = {
|
|
81
86
|
states: Record<string, StateHelpers<P, any>>;
|
|
82
87
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const hostVersion = "1.0.
|
|
1
|
+
export declare const hostVersion = "1.0.151";
|
|
@@ -3,7 +3,7 @@ export * from "./data";
|
|
|
3
3
|
export { PlasmicElement } from "./element-types";
|
|
4
4
|
export { registerFetcher as unstable_registerFetcher } from "./fetcher";
|
|
5
5
|
export * from "./global-actions";
|
|
6
|
-
export { Action, ActionProps, CodeComponentMeta, ComponentHelpers, ComponentMeta, ComponentRegistration, ComponentTemplates, default as registerComponent, StateHelpers, StateSpec, CodeComponentMode, } from "./registerComponent";
|
|
6
|
+
export { Action, ActionProps, CodeComponentMeta, ComponentHelpers, ComponentMeta, ComponentRegistration, ComponentTemplates, default as registerComponent, stateHelpersKeys, StateHelpers, StateSpec, CodeComponentMode, } from "./registerComponent";
|
|
7
7
|
export { PropType, ContextDependentConfig } from "./prop-types";
|
|
8
8
|
export { default as registerGlobalContext, GlobalContextMeta, GlobalContextRegistration, PropType as GlobalContextPropType, } from "./registerGlobalContext";
|
|
9
9
|
export { default as registerToken, TokenRegistration, TokenType, } from "./registerToken";
|
|
@@ -41,6 +41,7 @@ export interface PropTypeBase<P> {
|
|
|
41
41
|
displayName?: string;
|
|
42
42
|
description?: string;
|
|
43
43
|
helpText?: string;
|
|
44
|
+
required?: boolean;
|
|
44
45
|
/**
|
|
45
46
|
* If the user has chosen to use a dynamic expression for this prop, provide
|
|
46
47
|
* a hint as to the expected values that the expression should evaluate to.
|
|
@@ -84,6 +85,11 @@ interface Defaultable<P, T> {
|
|
|
84
85
|
*/
|
|
85
86
|
defaultExpr?: string;
|
|
86
87
|
defaultExprHint?: string;
|
|
88
|
+
/**
|
|
89
|
+
* This function validates whether the prop value is valid.
|
|
90
|
+
* If the value is invalid, it returns an error message. Otherwise, it returns true.
|
|
91
|
+
*/
|
|
92
|
+
validator?: (value: T, ...args: ControlContext<P>) => (string | true) | Promise<string | true>;
|
|
87
93
|
}
|
|
88
94
|
interface Controllable {
|
|
89
95
|
/**
|
|
@@ -259,15 +265,19 @@ export interface DataSourceType<P> extends PropTypeBase<P> {
|
|
|
259
265
|
dataSource: "airtable" | "cms";
|
|
260
266
|
}
|
|
261
267
|
type DataPickerValueType = string | number | (string | number)[];
|
|
262
|
-
interface
|
|
268
|
+
interface RichDataPickerType<P> extends PropTypeBaseDefault<P, DataPickerValueType> {
|
|
263
269
|
type: "dataSelector";
|
|
264
|
-
data
|
|
270
|
+
data?: Record<string, any> | ContextDependentConfig<P, Record<string, any>>;
|
|
265
271
|
alwaysShowValuePathAsLabel?: boolean;
|
|
272
|
+
mergeWithExternalData?: boolean;
|
|
266
273
|
}
|
|
267
|
-
|
|
274
|
+
type DataPickerType<P> = "dataPicker" | RichDataPickerType<P>;
|
|
275
|
+
interface RichExprEditorType<P> extends PropTypeBaseDefault<P, DataPickerValueType> {
|
|
268
276
|
type: "exprEditor";
|
|
269
|
-
data
|
|
277
|
+
data?: Record<string, any> | ContextDependentConfig<P, Record<string, any>>;
|
|
278
|
+
mergeWithExternalData?: boolean;
|
|
270
279
|
}
|
|
280
|
+
type ExprEditorType<P> = "exprEditor" | RichExprEditorType<P>;
|
|
271
281
|
interface FormValidationRulesType<P> extends PropTypeBaseDefault<P, any> {
|
|
272
282
|
type: "formValidationRules";
|
|
273
283
|
}
|
|
@@ -76,7 +76,12 @@ export type StateSpec = {
|
|
|
76
76
|
export interface StateHelpers<P, T> {
|
|
77
77
|
initFunc?: ($props: P) => T;
|
|
78
78
|
onChangeArgsToValue?: (...args: any) => T;
|
|
79
|
+
onMutate?: (stateValue: T, $ref: any) => void;
|
|
79
80
|
}
|
|
81
|
+
type TupleUnion<U extends string, R extends string[] = []> = {
|
|
82
|
+
[S in U]: Exclude<U, S> extends never ? [...R, S] : TupleUnion<Exclude<U, S>, [...R, S]>;
|
|
83
|
+
}[U] & string[];
|
|
84
|
+
export declare const stateHelpersKeys: TupleUnion<keyof StateHelpers<any, any>>;
|
|
80
85
|
export type ComponentHelpers<P> = {
|
|
81
86
|
states: Record<string, StateHelpers<P, any>>;
|
|
82
87
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const hostVersion = "1.0.
|
|
1
|
+
export declare const hostVersion = "1.0.151";
|
|
@@ -3,7 +3,7 @@ export * from "./data";
|
|
|
3
3
|
export { PlasmicElement } from "./element-types";
|
|
4
4
|
export { registerFetcher as unstable_registerFetcher } from "./fetcher";
|
|
5
5
|
export * from "./global-actions";
|
|
6
|
-
export { Action, ActionProps, CodeComponentMeta, ComponentHelpers, ComponentMeta, ComponentRegistration, ComponentTemplates, default as registerComponent, StateHelpers, StateSpec, CodeComponentMode, } from "./registerComponent";
|
|
6
|
+
export { Action, ActionProps, CodeComponentMeta, ComponentHelpers, ComponentMeta, ComponentRegistration, ComponentTemplates, default as registerComponent, stateHelpersKeys, StateHelpers, StateSpec, CodeComponentMode, } from "./registerComponent";
|
|
7
7
|
export { PropType, ContextDependentConfig } from "./prop-types";
|
|
8
8
|
export { default as registerGlobalContext, GlobalContextMeta, GlobalContextRegistration, PropType as GlobalContextPropType, } from "./registerGlobalContext";
|
|
9
9
|
export { default as registerToken, TokenRegistration, TokenType, } from "./registerToken";
|
|
@@ -41,6 +41,7 @@ export interface PropTypeBase<P> {
|
|
|
41
41
|
displayName?: string;
|
|
42
42
|
description?: string;
|
|
43
43
|
helpText?: string;
|
|
44
|
+
required?: boolean;
|
|
44
45
|
/**
|
|
45
46
|
* If the user has chosen to use a dynamic expression for this prop, provide
|
|
46
47
|
* a hint as to the expected values that the expression should evaluate to.
|
|
@@ -84,6 +85,11 @@ interface Defaultable<P, T> {
|
|
|
84
85
|
*/
|
|
85
86
|
defaultExpr?: string;
|
|
86
87
|
defaultExprHint?: string;
|
|
88
|
+
/**
|
|
89
|
+
* This function validates whether the prop value is valid.
|
|
90
|
+
* If the value is invalid, it returns an error message. Otherwise, it returns true.
|
|
91
|
+
*/
|
|
92
|
+
validator?: (value: T, ...args: ControlContext<P>) => (string | true) | Promise<string | true>;
|
|
87
93
|
}
|
|
88
94
|
interface Controllable {
|
|
89
95
|
/**
|
|
@@ -259,15 +265,19 @@ export interface DataSourceType<P> extends PropTypeBase<P> {
|
|
|
259
265
|
dataSource: "airtable" | "cms";
|
|
260
266
|
}
|
|
261
267
|
type DataPickerValueType = string | number | (string | number)[];
|
|
262
|
-
interface
|
|
268
|
+
interface RichDataPickerType<P> extends PropTypeBaseDefault<P, DataPickerValueType> {
|
|
263
269
|
type: "dataSelector";
|
|
264
|
-
data
|
|
270
|
+
data?: Record<string, any> | ContextDependentConfig<P, Record<string, any>>;
|
|
265
271
|
alwaysShowValuePathAsLabel?: boolean;
|
|
272
|
+
mergeWithExternalData?: boolean;
|
|
266
273
|
}
|
|
267
|
-
|
|
274
|
+
type DataPickerType<P> = "dataPicker" | RichDataPickerType<P>;
|
|
275
|
+
interface RichExprEditorType<P> extends PropTypeBaseDefault<P, DataPickerValueType> {
|
|
268
276
|
type: "exprEditor";
|
|
269
|
-
data
|
|
277
|
+
data?: Record<string, any> | ContextDependentConfig<P, Record<string, any>>;
|
|
278
|
+
mergeWithExternalData?: boolean;
|
|
270
279
|
}
|
|
280
|
+
type ExprEditorType<P> = "exprEditor" | RichExprEditorType<P>;
|
|
271
281
|
interface FormValidationRulesType<P> extends PropTypeBaseDefault<P, any> {
|
|
272
282
|
type: "formValidationRules";
|
|
273
283
|
}
|
|
@@ -76,7 +76,12 @@ export type StateSpec = {
|
|
|
76
76
|
export interface StateHelpers<P, T> {
|
|
77
77
|
initFunc?: ($props: P) => T;
|
|
78
78
|
onChangeArgsToValue?: (...args: any) => T;
|
|
79
|
+
onMutate?: (stateValue: T, $ref: any) => void;
|
|
79
80
|
}
|
|
81
|
+
type TupleUnion<U extends string, R extends string[] = []> = {
|
|
82
|
+
[S in U]: Exclude<U, S> extends never ? [...R, S] : TupleUnion<Exclude<U, S>, [...R, S]>;
|
|
83
|
+
}[U] & string[];
|
|
84
|
+
export declare const stateHelpersKeys: TupleUnion<keyof StateHelpers<any, any>>;
|
|
80
85
|
export type ComponentHelpers<P> = {
|
|
81
86
|
states: Record<string, StateHelpers<P, any>>;
|
|
82
87
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const hostVersion = "1.0.
|
|
1
|
+
export declare const hostVersion = "1.0.151";
|