@plasmicapp/host 2.0.0-alpha.0 → 2.0.0-alpha.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/data.d.ts +1 -5
- package/dist/exports.d.ts +3 -4
- package/dist/host.esm.js +6 -17
- package/dist/host.esm.js.map +1 -1
- package/dist/index.cjs.js +5 -17
- package/dist/index.cjs.js.map +1 -1
- package/dist/prop-types.d.ts +6 -475
- package/dist/registerComponent.d.ts +8 -11
- package/dist/registerFunction.d.ts +2 -127
- package/dist/types/choice-type.d.ts +16 -0
- package/dist/types/component-types.d.ts +251 -0
- package/dist/types/container-types.d.ts +42 -0
- package/dist/types/function-types.d.ts +101 -0
- package/dist/types/misc-types.d.ts +38 -0
- package/dist/types/primitive-types.d.ts +123 -0
- package/dist/types/query-builder-types.d.ts +51 -0
- package/dist/types/shared-controls.d.ts +50 -0
- package/dist/types/type-utils.d.ts +7 -0
- package/dist/version.d.ts +1 -1
- package/package.json +4 -3
- package/registerComponent/dist/data.d.ts +1 -5
- package/registerComponent/dist/exports.d.ts +3 -4
- package/registerComponent/dist/index.cjs.js.map +1 -1
- package/registerComponent/dist/index.esm.js.map +1 -1
- package/registerComponent/dist/prop-types.d.ts +6 -475
- package/registerComponent/dist/registerComponent.d.ts +8 -11
- package/registerComponent/dist/registerFunction.d.ts +2 -127
- package/registerComponent/dist/types/choice-type.d.ts +16 -0
- package/registerComponent/dist/types/component-types.d.ts +251 -0
- package/registerComponent/dist/types/container-types.d.ts +42 -0
- package/registerComponent/dist/types/function-types.d.ts +101 -0
- package/registerComponent/dist/types/misc-types.d.ts +38 -0
- package/registerComponent/dist/types/primitive-types.d.ts +123 -0
- package/registerComponent/dist/types/query-builder-types.d.ts +51 -0
- package/registerComponent/dist/types/shared-controls.d.ts +50 -0
- package/registerComponent/dist/types/type-utils.d.ts +7 -0
- package/registerComponent/dist/version.d.ts +1 -1
- package/registerFunction/dist/data.d.ts +1 -5
- package/registerFunction/dist/exports.d.ts +3 -4
- package/registerFunction/dist/index.cjs.js.map +1 -1
- package/registerFunction/dist/index.esm.js.map +1 -1
- package/registerFunction/dist/prop-types.d.ts +6 -475
- package/registerFunction/dist/registerComponent.d.ts +8 -11
- package/registerFunction/dist/registerFunction.d.ts +2 -127
- package/registerFunction/dist/types/choice-type.d.ts +16 -0
- package/registerFunction/dist/types/component-types.d.ts +251 -0
- package/registerFunction/dist/types/container-types.d.ts +42 -0
- package/registerFunction/dist/types/function-types.d.ts +101 -0
- package/registerFunction/dist/types/misc-types.d.ts +38 -0
- package/registerFunction/dist/types/primitive-types.d.ts +123 -0
- package/registerFunction/dist/types/query-builder-types.d.ts +51 -0
- package/registerFunction/dist/types/shared-controls.d.ts +50 -0
- package/registerFunction/dist/types/type-utils.d.ts +7 -0
- package/registerFunction/dist/version.d.ts +1 -1
- package/registerGlobalContext/dist/data.d.ts +1 -5
- package/registerGlobalContext/dist/exports.d.ts +3 -4
- package/registerGlobalContext/dist/prop-types.d.ts +6 -475
- package/registerGlobalContext/dist/registerComponent.d.ts +8 -11
- package/registerGlobalContext/dist/registerFunction.d.ts +2 -127
- package/registerGlobalContext/dist/types/choice-type.d.ts +16 -0
- package/registerGlobalContext/dist/types/component-types.d.ts +251 -0
- package/registerGlobalContext/dist/types/container-types.d.ts +42 -0
- package/registerGlobalContext/dist/types/function-types.d.ts +101 -0
- package/registerGlobalContext/dist/types/misc-types.d.ts +38 -0
- package/registerGlobalContext/dist/types/primitive-types.d.ts +123 -0
- package/registerGlobalContext/dist/types/query-builder-types.d.ts +51 -0
- package/registerGlobalContext/dist/types/shared-controls.d.ts +50 -0
- package/registerGlobalContext/dist/types/type-utils.d.ts +7 -0
- package/registerGlobalContext/dist/version.d.ts +1 -1
- package/registerToken/dist/data.d.ts +1 -5
- package/registerToken/dist/exports.d.ts +3 -4
- package/registerToken/dist/prop-types.d.ts +6 -475
- package/registerToken/dist/registerComponent.d.ts +8 -11
- package/registerToken/dist/registerFunction.d.ts +2 -127
- package/registerToken/dist/types/choice-type.d.ts +16 -0
- package/registerToken/dist/types/component-types.d.ts +251 -0
- package/registerToken/dist/types/container-types.d.ts +42 -0
- package/registerToken/dist/types/function-types.d.ts +101 -0
- package/registerToken/dist/types/misc-types.d.ts +38 -0
- package/registerToken/dist/types/primitive-types.d.ts +123 -0
- package/registerToken/dist/types/query-builder-types.d.ts +51 -0
- package/registerToken/dist/types/shared-controls.d.ts +50 -0
- package/registerToken/dist/types/type-utils.d.ts +7 -0
- package/registerToken/dist/version.d.ts +1 -1
- package/registerTrait/dist/data.d.ts +1 -5
- package/registerTrait/dist/exports.d.ts +3 -4
- package/registerTrait/dist/prop-types.d.ts +6 -475
- package/registerTrait/dist/registerComponent.d.ts +8 -11
- package/registerTrait/dist/registerFunction.d.ts +2 -127
- package/registerTrait/dist/types/choice-type.d.ts +16 -0
- package/registerTrait/dist/types/component-types.d.ts +251 -0
- package/registerTrait/dist/types/container-types.d.ts +42 -0
- package/registerTrait/dist/types/function-types.d.ts +101 -0
- package/registerTrait/dist/types/misc-types.d.ts +38 -0
- package/registerTrait/dist/types/primitive-types.d.ts +123 -0
- package/registerTrait/dist/types/query-builder-types.d.ts +51 -0
- package/registerTrait/dist/types/shared-controls.d.ts +50 -0
- package/registerTrait/dist/types/type-utils.d.ts +7 -0
- package/registerTrait/dist/version.d.ts +1 -1
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export type GenericContext<Props, Data, Extra = unknown> = [Props, Data, Extra];
|
|
2
|
+
/**
|
|
3
|
+
* Config option that takes the context (e.g., props) of the component instance
|
|
4
|
+
* or function to dynamically set its value.
|
|
5
|
+
*/
|
|
6
|
+
export type ContextDependentConfig<Ctx extends any[], R> = (...args: Ctx) => R;
|
|
7
|
+
export type MaybeContextDependentConfig<Ctx extends any[], V> = V | ContextDependentConfig<Ctx, V>;
|
|
8
|
+
export interface CanvasComponentProps<Data = any> {
|
|
9
|
+
/**
|
|
10
|
+
* This prop is only provided within the canvas of Plasmic Studio.
|
|
11
|
+
* Allows the component to set data to be consumed by the props' controls.
|
|
12
|
+
*/
|
|
13
|
+
setControlContextData?: (data: Data) => void;
|
|
14
|
+
}
|
|
15
|
+
export type ControlExtras = {
|
|
16
|
+
path: (string | number)[];
|
|
17
|
+
item?: any;
|
|
18
|
+
};
|
|
19
|
+
export type InferDataType<P> = P extends CanvasComponentProps<infer Data> ? Data : any;
|
|
20
|
+
export interface CommonTypeBase {
|
|
21
|
+
description?: string;
|
|
22
|
+
helpText?: string;
|
|
23
|
+
/**
|
|
24
|
+
* If true, will hide the prop in a collapsed section; good for props that
|
|
25
|
+
* should not usually be used.
|
|
26
|
+
*/
|
|
27
|
+
advanced?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* If the user has chosen to use a dynamic expression for this prop, provide
|
|
30
|
+
* a hint as to the expected values that the expression should evaluate to.
|
|
31
|
+
* This hint will be displayed alongside the code editor. You may use
|
|
32
|
+
* markdown in the text here.
|
|
33
|
+
*/
|
|
34
|
+
exprHint?: string;
|
|
35
|
+
/**
|
|
36
|
+
* If true, does not allow the user to use a dynamic expression for this prop
|
|
37
|
+
*/
|
|
38
|
+
disableDynamicValue?: boolean;
|
|
39
|
+
}
|
|
40
|
+
export interface Defaultable<Ctx extends any[], T> {
|
|
41
|
+
/**
|
|
42
|
+
* Default value to set for this prop when the component is instantiated
|
|
43
|
+
*/
|
|
44
|
+
defaultValue?: T;
|
|
45
|
+
/**
|
|
46
|
+
* Specify that default when no prop/param is provided,
|
|
47
|
+
* so the Plasmic user can see it in the studio UI
|
|
48
|
+
*/
|
|
49
|
+
defaultValueHint?: T | ContextDependentConfig<Ctx, T | undefined>;
|
|
50
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts a union type to a tuple type of the same members
|
|
3
|
+
*/
|
|
4
|
+
export type TupleUnion<U extends string, R extends string[] = []> = {
|
|
5
|
+
[S in U]: Exclude<U, S> extends never ? [...R, S] : TupleUnion<Exclude<U, S>, [...R, S]>;
|
|
6
|
+
}[U] & string[];
|
|
7
|
+
export type Nullish<T> = T | null | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const hostVersion = "2.0.0-alpha.
|
|
1
|
+
export declare const hostVersion = "2.0.0-alpha.1";
|