@measured/puck-plugin-emotion-cache 0.19.0-canary.b9add22 → 0.19.0-canary.bc5bfff1
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/README.md +1 -1
- package/dist/index.d.mts +26 -10
- package/dist/index.d.ts +26 -10
- package/package.json +3 -3
package/README.md
CHANGED
package/dist/index.d.mts
CHANGED
@@ -12,17 +12,23 @@ type FieldOption = {
|
|
12
12
|
type FieldOptions = Array<FieldOption> | ReadonlyArray<FieldOption>;
|
13
13
|
type BaseField = {
|
14
14
|
label?: string;
|
15
|
+
labelIcon?: ReactElement;
|
16
|
+
metadata?: Metadata;
|
15
17
|
};
|
16
18
|
type TextField = BaseField & {
|
17
19
|
type: "text";
|
20
|
+
placeholder?: string;
|
18
21
|
};
|
19
22
|
type NumberField = BaseField & {
|
20
23
|
type: "number";
|
24
|
+
placeholder?: string;
|
21
25
|
min?: number;
|
22
26
|
max?: number;
|
27
|
+
step?: number;
|
23
28
|
};
|
24
29
|
type TextareaField = BaseField & {
|
25
30
|
type: "textarea";
|
31
|
+
placeholder?: string;
|
26
32
|
};
|
27
33
|
type SelectField = BaseField & {
|
28
34
|
type: "select";
|
@@ -94,16 +100,22 @@ type ExternalField<Props extends {
|
|
94
100
|
filterFields?: Record<string, Field>;
|
95
101
|
initialFilters?: Record<string, any>;
|
96
102
|
};
|
97
|
-
type
|
103
|
+
type CustomFieldRender<Value extends any> = (props: {
|
104
|
+
field: CustomField<Value>;
|
105
|
+
name: string;
|
106
|
+
id: string;
|
107
|
+
value: Value;
|
108
|
+
onChange: (value: Value) => void;
|
109
|
+
readOnly?: boolean;
|
110
|
+
}) => ReactElement;
|
111
|
+
type CustomField<Value extends any> = BaseField & {
|
98
112
|
type: "custom";
|
99
|
-
render:
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
readOnly?: boolean;
|
106
|
-
}) => ReactElement;
|
113
|
+
render: CustomFieldRender<Value>;
|
114
|
+
};
|
115
|
+
type SlotField = BaseField & {
|
116
|
+
type: "slot";
|
117
|
+
allow?: string[];
|
118
|
+
disallow?: string[];
|
107
119
|
};
|
108
120
|
type Field<Props extends any = any> = TextField | NumberField | TextareaField | SelectField | RadioField | ArrayField<Props extends {
|
109
121
|
[key: string]: any;
|
@@ -113,7 +125,7 @@ type Field<Props extends any = any> = TextField | NumberField | TextareaField |
|
|
113
125
|
[key: string]: any;
|
114
126
|
} ? Props : any> | ExternalFieldWithAdaptor<Props extends {
|
115
127
|
[key: string]: any;
|
116
|
-
} ? Props : any> | CustomField<Props
|
128
|
+
} ? Props : any> | CustomField<Props> | SlotField;
|
117
129
|
type FieldProps<F = Field<any>, ValueType = any> = {
|
118
130
|
field: F;
|
119
131
|
value: ValueType;
|
@@ -122,6 +134,10 @@ type FieldProps<F = Field<any>, ValueType = any> = {
|
|
122
134
|
readOnly?: boolean;
|
123
135
|
};
|
124
136
|
|
137
|
+
type Metadata = {
|
138
|
+
[key: string]: any;
|
139
|
+
};
|
140
|
+
|
125
141
|
type ItemWithId = {
|
126
142
|
_arrayId: string;
|
127
143
|
_originalIndex: number;
|
package/dist/index.d.ts
CHANGED
@@ -12,17 +12,23 @@ type FieldOption = {
|
|
12
12
|
type FieldOptions = Array<FieldOption> | ReadonlyArray<FieldOption>;
|
13
13
|
type BaseField = {
|
14
14
|
label?: string;
|
15
|
+
labelIcon?: ReactElement;
|
16
|
+
metadata?: Metadata;
|
15
17
|
};
|
16
18
|
type TextField = BaseField & {
|
17
19
|
type: "text";
|
20
|
+
placeholder?: string;
|
18
21
|
};
|
19
22
|
type NumberField = BaseField & {
|
20
23
|
type: "number";
|
24
|
+
placeholder?: string;
|
21
25
|
min?: number;
|
22
26
|
max?: number;
|
27
|
+
step?: number;
|
23
28
|
};
|
24
29
|
type TextareaField = BaseField & {
|
25
30
|
type: "textarea";
|
31
|
+
placeholder?: string;
|
26
32
|
};
|
27
33
|
type SelectField = BaseField & {
|
28
34
|
type: "select";
|
@@ -94,16 +100,22 @@ type ExternalField<Props extends {
|
|
94
100
|
filterFields?: Record<string, Field>;
|
95
101
|
initialFilters?: Record<string, any>;
|
96
102
|
};
|
97
|
-
type
|
103
|
+
type CustomFieldRender<Value extends any> = (props: {
|
104
|
+
field: CustomField<Value>;
|
105
|
+
name: string;
|
106
|
+
id: string;
|
107
|
+
value: Value;
|
108
|
+
onChange: (value: Value) => void;
|
109
|
+
readOnly?: boolean;
|
110
|
+
}) => ReactElement;
|
111
|
+
type CustomField<Value extends any> = BaseField & {
|
98
112
|
type: "custom";
|
99
|
-
render:
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
readOnly?: boolean;
|
106
|
-
}) => ReactElement;
|
113
|
+
render: CustomFieldRender<Value>;
|
114
|
+
};
|
115
|
+
type SlotField = BaseField & {
|
116
|
+
type: "slot";
|
117
|
+
allow?: string[];
|
118
|
+
disallow?: string[];
|
107
119
|
};
|
108
120
|
type Field<Props extends any = any> = TextField | NumberField | TextareaField | SelectField | RadioField | ArrayField<Props extends {
|
109
121
|
[key: string]: any;
|
@@ -113,7 +125,7 @@ type Field<Props extends any = any> = TextField | NumberField | TextareaField |
|
|
113
125
|
[key: string]: any;
|
114
126
|
} ? Props : any> | ExternalFieldWithAdaptor<Props extends {
|
115
127
|
[key: string]: any;
|
116
|
-
} ? Props : any> | CustomField<Props
|
128
|
+
} ? Props : any> | CustomField<Props> | SlotField;
|
117
129
|
type FieldProps<F = Field<any>, ValueType = any> = {
|
118
130
|
field: F;
|
119
131
|
value: ValueType;
|
@@ -122,6 +134,10 @@ type FieldProps<F = Field<any>, ValueType = any> = {
|
|
122
134
|
readOnly?: boolean;
|
123
135
|
};
|
124
136
|
|
137
|
+
type Metadata = {
|
138
|
+
[key: string]: any;
|
139
|
+
};
|
140
|
+
|
125
141
|
type ItemWithId = {
|
126
142
|
_arrayId: string;
|
127
143
|
_originalIndex: number;
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@measured/puck-plugin-emotion-cache",
|
3
|
-
"version": "0.19.0-canary.
|
4
|
-
"author": "
|
3
|
+
"version": "0.19.0-canary.bc5bfff1",
|
4
|
+
"author": "Chris Villa <chris@puckeditor.com>",
|
5
5
|
"repository": "measuredco/puck",
|
6
6
|
"bugs": "https://github.com/measuredco/puck/issues",
|
7
7
|
"homepage": "https://puckeditor.com",
|
@@ -23,7 +23,7 @@
|
|
23
23
|
],
|
24
24
|
"devDependencies": {
|
25
25
|
"@emotion/react": "^11.13.3",
|
26
|
-
"@measured/puck": "^0.19.0-canary.
|
26
|
+
"@measured/puck": "^0.19.0-canary.bc5bfff1",
|
27
27
|
"@types/react": "^19.0.1",
|
28
28
|
"@types/react-dom": "^19.0.2",
|
29
29
|
"eslint": "^7.32.0",
|