@measured/puck-plugin-emotion-cache 0.19.0-canary.896a6279 → 0.19.0-canary.91cb9cee

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 CHANGED
@@ -35,4 +35,4 @@ Key to pass to Emotion's [`createCache` method](https://emotion.sh/docs/@emotion
35
35
 
36
36
  ## License
37
37
 
38
- MIT © [Measured Corporation Ltd](https://measured.co)
38
+ MIT © [The Puck Contributors](https://github.com/measuredco/puck/graphs/contributors)
package/dist/index.d.mts CHANGED
@@ -13,6 +13,7 @@ type FieldOptions = Array<FieldOption> | ReadonlyArray<FieldOption>;
13
13
  type BaseField = {
14
14
  label?: string;
15
15
  labelIcon?: ReactElement;
16
+ metadata?: Metadata;
16
17
  };
17
18
  type TextField = BaseField & {
18
19
  type: "text";
@@ -99,19 +100,22 @@ type ExternalField<Props extends {
99
100
  filterFields?: Record<string, Field>;
100
101
  initialFilters?: Record<string, any>;
101
102
  };
102
- type CustomField<Props extends any = {}> = BaseField & {
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 & {
103
112
  type: "custom";
104
- render: (props: {
105
- field: CustomField<Props>;
106
- name: string;
107
- id: string;
108
- value: Props;
109
- onChange: (value: Props) => void;
110
- readOnly?: boolean;
111
- }) => ReactElement;
113
+ render: CustomFieldRender<Value>;
112
114
  };
113
115
  type SlotField = BaseField & {
114
116
  type: "slot";
117
+ allow?: string[];
118
+ disallow?: string[];
115
119
  };
116
120
  type Field<Props extends any = any> = TextField | NumberField | TextareaField | SelectField | RadioField | ArrayField<Props extends {
117
121
  [key: string]: any;
@@ -130,6 +134,10 @@ type FieldProps<F = Field<any>, ValueType = any> = {
130
134
  readOnly?: boolean;
131
135
  };
132
136
 
137
+ type Metadata = {
138
+ [key: string]: any;
139
+ };
140
+
133
141
  type ItemWithId = {
134
142
  _arrayId: string;
135
143
  _originalIndex: number;
package/dist/index.d.ts CHANGED
@@ -13,6 +13,7 @@ type FieldOptions = Array<FieldOption> | ReadonlyArray<FieldOption>;
13
13
  type BaseField = {
14
14
  label?: string;
15
15
  labelIcon?: ReactElement;
16
+ metadata?: Metadata;
16
17
  };
17
18
  type TextField = BaseField & {
18
19
  type: "text";
@@ -99,19 +100,22 @@ type ExternalField<Props extends {
99
100
  filterFields?: Record<string, Field>;
100
101
  initialFilters?: Record<string, any>;
101
102
  };
102
- type CustomField<Props extends any = {}> = BaseField & {
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 & {
103
112
  type: "custom";
104
- render: (props: {
105
- field: CustomField<Props>;
106
- name: string;
107
- id: string;
108
- value: Props;
109
- onChange: (value: Props) => void;
110
- readOnly?: boolean;
111
- }) => ReactElement;
113
+ render: CustomFieldRender<Value>;
112
114
  };
113
115
  type SlotField = BaseField & {
114
116
  type: "slot";
117
+ allow?: string[];
118
+ disallow?: string[];
115
119
  };
116
120
  type Field<Props extends any = any> = TextField | NumberField | TextareaField | SelectField | RadioField | ArrayField<Props extends {
117
121
  [key: string]: any;
@@ -130,6 +134,10 @@ type FieldProps<F = Field<any>, ValueType = any> = {
130
134
  readOnly?: boolean;
131
135
  };
132
136
 
137
+ type Metadata = {
138
+ [key: string]: any;
139
+ };
140
+
133
141
  type ItemWithId = {
134
142
  _arrayId: string;
135
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.896a6279",
4
- "author": "Measured Corporation Ltd <hello@measured.co>",
3
+ "version": "0.19.0-canary.91cb9cee",
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.896a6279",
26
+ "@measured/puck": "^0.19.0-canary.91cb9cee",
27
27
  "@types/react": "^19.0.1",
28
28
  "@types/react-dom": "^19.0.2",
29
29
  "eslint": "^7.32.0",