@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.
Files changed (99) hide show
  1. package/dist/data.d.ts +1 -5
  2. package/dist/exports.d.ts +3 -4
  3. package/dist/host.esm.js +6 -17
  4. package/dist/host.esm.js.map +1 -1
  5. package/dist/index.cjs.js +5 -17
  6. package/dist/index.cjs.js.map +1 -1
  7. package/dist/prop-types.d.ts +6 -475
  8. package/dist/registerComponent.d.ts +8 -11
  9. package/dist/registerFunction.d.ts +2 -127
  10. package/dist/types/choice-type.d.ts +16 -0
  11. package/dist/types/component-types.d.ts +251 -0
  12. package/dist/types/container-types.d.ts +42 -0
  13. package/dist/types/function-types.d.ts +101 -0
  14. package/dist/types/misc-types.d.ts +38 -0
  15. package/dist/types/primitive-types.d.ts +123 -0
  16. package/dist/types/query-builder-types.d.ts +51 -0
  17. package/dist/types/shared-controls.d.ts +50 -0
  18. package/dist/types/type-utils.d.ts +7 -0
  19. package/dist/version.d.ts +1 -1
  20. package/package.json +4 -3
  21. package/registerComponent/dist/data.d.ts +1 -5
  22. package/registerComponent/dist/exports.d.ts +3 -4
  23. package/registerComponent/dist/index.cjs.js.map +1 -1
  24. package/registerComponent/dist/index.esm.js.map +1 -1
  25. package/registerComponent/dist/prop-types.d.ts +6 -475
  26. package/registerComponent/dist/registerComponent.d.ts +8 -11
  27. package/registerComponent/dist/registerFunction.d.ts +2 -127
  28. package/registerComponent/dist/types/choice-type.d.ts +16 -0
  29. package/registerComponent/dist/types/component-types.d.ts +251 -0
  30. package/registerComponent/dist/types/container-types.d.ts +42 -0
  31. package/registerComponent/dist/types/function-types.d.ts +101 -0
  32. package/registerComponent/dist/types/misc-types.d.ts +38 -0
  33. package/registerComponent/dist/types/primitive-types.d.ts +123 -0
  34. package/registerComponent/dist/types/query-builder-types.d.ts +51 -0
  35. package/registerComponent/dist/types/shared-controls.d.ts +50 -0
  36. package/registerComponent/dist/types/type-utils.d.ts +7 -0
  37. package/registerComponent/dist/version.d.ts +1 -1
  38. package/registerFunction/dist/data.d.ts +1 -5
  39. package/registerFunction/dist/exports.d.ts +3 -4
  40. package/registerFunction/dist/index.cjs.js.map +1 -1
  41. package/registerFunction/dist/index.esm.js.map +1 -1
  42. package/registerFunction/dist/prop-types.d.ts +6 -475
  43. package/registerFunction/dist/registerComponent.d.ts +8 -11
  44. package/registerFunction/dist/registerFunction.d.ts +2 -127
  45. package/registerFunction/dist/types/choice-type.d.ts +16 -0
  46. package/registerFunction/dist/types/component-types.d.ts +251 -0
  47. package/registerFunction/dist/types/container-types.d.ts +42 -0
  48. package/registerFunction/dist/types/function-types.d.ts +101 -0
  49. package/registerFunction/dist/types/misc-types.d.ts +38 -0
  50. package/registerFunction/dist/types/primitive-types.d.ts +123 -0
  51. package/registerFunction/dist/types/query-builder-types.d.ts +51 -0
  52. package/registerFunction/dist/types/shared-controls.d.ts +50 -0
  53. package/registerFunction/dist/types/type-utils.d.ts +7 -0
  54. package/registerFunction/dist/version.d.ts +1 -1
  55. package/registerGlobalContext/dist/data.d.ts +1 -5
  56. package/registerGlobalContext/dist/exports.d.ts +3 -4
  57. package/registerGlobalContext/dist/prop-types.d.ts +6 -475
  58. package/registerGlobalContext/dist/registerComponent.d.ts +8 -11
  59. package/registerGlobalContext/dist/registerFunction.d.ts +2 -127
  60. package/registerGlobalContext/dist/types/choice-type.d.ts +16 -0
  61. package/registerGlobalContext/dist/types/component-types.d.ts +251 -0
  62. package/registerGlobalContext/dist/types/container-types.d.ts +42 -0
  63. package/registerGlobalContext/dist/types/function-types.d.ts +101 -0
  64. package/registerGlobalContext/dist/types/misc-types.d.ts +38 -0
  65. package/registerGlobalContext/dist/types/primitive-types.d.ts +123 -0
  66. package/registerGlobalContext/dist/types/query-builder-types.d.ts +51 -0
  67. package/registerGlobalContext/dist/types/shared-controls.d.ts +50 -0
  68. package/registerGlobalContext/dist/types/type-utils.d.ts +7 -0
  69. package/registerGlobalContext/dist/version.d.ts +1 -1
  70. package/registerToken/dist/data.d.ts +1 -5
  71. package/registerToken/dist/exports.d.ts +3 -4
  72. package/registerToken/dist/prop-types.d.ts +6 -475
  73. package/registerToken/dist/registerComponent.d.ts +8 -11
  74. package/registerToken/dist/registerFunction.d.ts +2 -127
  75. package/registerToken/dist/types/choice-type.d.ts +16 -0
  76. package/registerToken/dist/types/component-types.d.ts +251 -0
  77. package/registerToken/dist/types/container-types.d.ts +42 -0
  78. package/registerToken/dist/types/function-types.d.ts +101 -0
  79. package/registerToken/dist/types/misc-types.d.ts +38 -0
  80. package/registerToken/dist/types/primitive-types.d.ts +123 -0
  81. package/registerToken/dist/types/query-builder-types.d.ts +51 -0
  82. package/registerToken/dist/types/shared-controls.d.ts +50 -0
  83. package/registerToken/dist/types/type-utils.d.ts +7 -0
  84. package/registerToken/dist/version.d.ts +1 -1
  85. package/registerTrait/dist/data.d.ts +1 -5
  86. package/registerTrait/dist/exports.d.ts +3 -4
  87. package/registerTrait/dist/prop-types.d.ts +6 -475
  88. package/registerTrait/dist/registerComponent.d.ts +8 -11
  89. package/registerTrait/dist/registerFunction.d.ts +2 -127
  90. package/registerTrait/dist/types/choice-type.d.ts +16 -0
  91. package/registerTrait/dist/types/component-types.d.ts +251 -0
  92. package/registerTrait/dist/types/container-types.d.ts +42 -0
  93. package/registerTrait/dist/types/function-types.d.ts +101 -0
  94. package/registerTrait/dist/types/misc-types.d.ts +38 -0
  95. package/registerTrait/dist/types/primitive-types.d.ts +123 -0
  96. package/registerTrait/dist/types/query-builder-types.d.ts +51 -0
  97. package/registerTrait/dist/types/shared-controls.d.ts +50 -0
  98. package/registerTrait/dist/types/type-utils.d.ts +7 -0
  99. 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.0";
1
+ export declare const hostVersion = "2.0.0-alpha.1";