@measured/puck-plugin-heading-analyzer 0.19.0-canary.706ea0c1 → 0.19.0-canary.75340804

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
@@ -31,4 +31,4 @@ export function Page() {
31
31
 
32
32
  ## License
33
33
 
34
- MIT © [Measured Corporation Ltd](https://measured.co)
34
+ 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,16 +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>;
114
+ };
115
+ type SlotField = BaseField & {
116
+ type: "slot";
117
+ allow?: string[];
118
+ disallow?: string[];
112
119
  };
113
120
  type Field<Props extends any = any> = TextField | NumberField | TextareaField | SelectField | RadioField | ArrayField<Props extends {
114
121
  [key: string]: any;
@@ -118,7 +125,7 @@ type Field<Props extends any = any> = TextField | NumberField | TextareaField |
118
125
  [key: string]: any;
119
126
  } ? Props : any> | ExternalFieldWithAdaptor<Props extends {
120
127
  [key: string]: any;
121
- } ? Props : any> | CustomField<Props>;
128
+ } ? Props : any> | CustomField<Props> | SlotField;
122
129
  type FieldProps<F = Field<any>, ValueType = any> = {
123
130
  field: F;
124
131
  value: ValueType;
@@ -127,6 +134,10 @@ type FieldProps<F = Field<any>, ValueType = any> = {
127
134
  readOnly?: boolean;
128
135
  };
129
136
 
137
+ type Metadata = {
138
+ [key: string]: any;
139
+ };
140
+
130
141
  type ItemWithId = {
131
142
  _arrayId: string;
132
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,16 +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>;
114
+ };
115
+ type SlotField = BaseField & {
116
+ type: "slot";
117
+ allow?: string[];
118
+ disallow?: string[];
112
119
  };
113
120
  type Field<Props extends any = any> = TextField | NumberField | TextareaField | SelectField | RadioField | ArrayField<Props extends {
114
121
  [key: string]: any;
@@ -118,7 +125,7 @@ type Field<Props extends any = any> = TextField | NumberField | TextareaField |
118
125
  [key: string]: any;
119
126
  } ? Props : any> | ExternalFieldWithAdaptor<Props extends {
120
127
  [key: string]: any;
121
- } ? Props : any> | CustomField<Props>;
128
+ } ? Props : any> | CustomField<Props> | SlotField;
122
129
  type FieldProps<F = Field<any>, ValueType = any> = {
123
130
  field: F;
124
131
  value: ValueType;
@@ -127,6 +134,10 @@ type FieldProps<F = Field<any>, ValueType = any> = {
127
134
  readOnly?: boolean;
128
135
  };
129
136
 
137
+ type Metadata = {
138
+ [key: string]: any;
139
+ };
140
+
130
141
  type ItemWithId = {
131
142
  _arrayId: string;
132
143
  _originalIndex: number;