@plasmicapp/host 1.0.227 → 1.0.229
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/host.esm.js +1 -1
- package/dist/host.esm.js.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/types/component-types.d.ts +10 -17
- package/dist/types/function-types.d.ts +26 -21
- package/dist/types/query-builder-types.d.ts +51 -0
- package/dist/types/shared-controls.d.ts +17 -7
- package/dist/version.d.ts +1 -1
- package/package.json +2 -2
- package/registerComponent/dist/types/component-types.d.ts +10 -17
- package/registerComponent/dist/types/function-types.d.ts +26 -21
- package/registerComponent/dist/types/query-builder-types.d.ts +51 -0
- package/registerComponent/dist/types/shared-controls.d.ts +17 -7
- package/registerComponent/dist/version.d.ts +1 -1
- package/registerFunction/dist/types/component-types.d.ts +10 -17
- package/registerFunction/dist/types/function-types.d.ts +26 -21
- package/registerFunction/dist/types/query-builder-types.d.ts +51 -0
- package/registerFunction/dist/types/shared-controls.d.ts +17 -7
- package/registerFunction/dist/version.d.ts +1 -1
- package/registerGlobalContext/dist/types/component-types.d.ts +10 -17
- package/registerGlobalContext/dist/types/function-types.d.ts +26 -21
- package/registerGlobalContext/dist/types/query-builder-types.d.ts +51 -0
- package/registerGlobalContext/dist/types/shared-controls.d.ts +17 -7
- package/registerGlobalContext/dist/version.d.ts +1 -1
- package/registerToken/dist/types/component-types.d.ts +10 -17
- package/registerToken/dist/types/function-types.d.ts +26 -21
- package/registerToken/dist/types/query-builder-types.d.ts +51 -0
- package/registerToken/dist/types/shared-controls.d.ts +17 -7
- package/registerToken/dist/version.d.ts +1 -1
- package/registerTrait/dist/types/component-types.d.ts +10 -17
- package/registerTrait/dist/types/function-types.d.ts +26 -21
- package/registerTrait/dist/types/query-builder-types.d.ts +51 -0
- package/registerTrait/dist/types/shared-controls.d.ts +17 -7
- package/registerTrait/dist/version.d.ts +1 -1
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ContextDependentConfig } from "./shared-controls";
|
|
2
|
+
/**
|
|
3
|
+
* Control type for building a custom query format.
|
|
4
|
+
*
|
|
5
|
+
* This control is based on react-awesome-query-builder
|
|
6
|
+
* and returns data in JsonLogic format.
|
|
7
|
+
*
|
|
8
|
+
* If using this control type, it's recommended to install
|
|
9
|
+
* @react-awesome-query-builder/core and json-logic-js as devDependencies
|
|
10
|
+
* so that you can reference their types.
|
|
11
|
+
*
|
|
12
|
+
* References:
|
|
13
|
+
* - https://github.com/ukrbublik/react-awesome-query-builder
|
|
14
|
+
* - https://github.com/jwadhams/json-logic-js
|
|
15
|
+
* - https://jsonlogic.com/
|
|
16
|
+
*/
|
|
17
|
+
export interface QueryBuilderCore<Ctx extends any[]> {
|
|
18
|
+
type: "queryBuilder";
|
|
19
|
+
/**
|
|
20
|
+
* Return a @react-awesome-query-builder/core `Config` that will be merged
|
|
21
|
+
* with Plasmic's built-in config.
|
|
22
|
+
*
|
|
23
|
+
* https://github.com/plasmicapp/plasmic/blob/master/platform/wab/src/wab/client/components/QueryBuilder/QueryBuilderConfig.tsx
|
|
24
|
+
*
|
|
25
|
+
* At a minimum, this should return fields and their types.
|
|
26
|
+
* For configuration options, see react-awesome-query-builder docs.
|
|
27
|
+
*/
|
|
28
|
+
config: ContextDependentConfig<Ctx, SimplifiedConfig>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* A simplified subset of @react-awesome-query-builder/core `Config`.
|
|
32
|
+
*/
|
|
33
|
+
interface SimplifiedConfig {
|
|
34
|
+
fields: SimplifiedFields;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* A simplified subset of @react-awesome-query-builder/core `Fields`.
|
|
38
|
+
*/
|
|
39
|
+
interface SimplifiedFields {
|
|
40
|
+
[key: string]: SimplifiedField;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* A simplified subset of @react-awesome-query-builder/core `FieldOrGroup`.
|
|
44
|
+
*/
|
|
45
|
+
interface SimplifiedField {
|
|
46
|
+
type: "text" | "number" | "boolean" | "date" | "time" | "datetime" | "select" | "multiselect" | "treeselect" | "treemultiselect" | string;
|
|
47
|
+
label?: string;
|
|
48
|
+
defaultValue?: unknown;
|
|
49
|
+
fieldSettings?: {};
|
|
50
|
+
}
|
|
51
|
+
export {};
|
|
@@ -17,10 +17,14 @@ export type ControlExtras = {
|
|
|
17
17
|
item?: any;
|
|
18
18
|
};
|
|
19
19
|
export type InferDataType<P> = P extends CanvasComponentProps<infer Data> ? Data : any;
|
|
20
|
-
export interface CommonTypeBase
|
|
20
|
+
export interface CommonTypeBase {
|
|
21
21
|
description?: string;
|
|
22
22
|
helpText?: string;
|
|
23
|
-
|
|
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;
|
|
24
28
|
/**
|
|
25
29
|
* If the user has chosen to use a dynamic expression for this prop, provide
|
|
26
30
|
* a hint as to the expected values that the expression should evaluate to.
|
|
@@ -28,13 +32,19 @@ export interface CommonTypeBase<Ctx extends any[]> {
|
|
|
28
32
|
* markdown in the text here.
|
|
29
33
|
*/
|
|
30
34
|
exprHint?: string;
|
|
31
|
-
/**
|
|
32
|
-
* Function for whether this prop should be hidden in the right panel,
|
|
33
|
-
* given the current props for this component
|
|
34
|
-
*/
|
|
35
|
-
hidden?: ContextDependentConfig<Ctx, boolean>;
|
|
36
35
|
/**
|
|
37
36
|
* If true, does not allow the user to use a dynamic expression for this prop
|
|
38
37
|
*/
|
|
39
38
|
disableDynamicValue?: boolean;
|
|
40
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
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const hostVersion = "1.0.
|
|
1
|
+
export declare const hostVersion = "1.0.229";
|