@measured/puck-plugin-heading-analyzer 0.19.0-canary.1fc19b5 → 0.19.0-canary.226c08da

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
@@ -12,6 +12,8 @@ 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";
@@ -98,16 +100,22 @@ type ExternalField<Props extends {
98
100
  filterFields?: Record<string, Field>;
99
101
  initialFilters?: Record<string, any>;
100
102
  };
101
- 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 & {
102
112
  type: "custom";
103
- render: (props: {
104
- field: CustomField<Props>;
105
- name: string;
106
- id: string;
107
- value: Props;
108
- onChange: (value: Props) => void;
109
- readOnly?: boolean;
110
- }) => ReactElement;
113
+ render: CustomFieldRender<Value>;
114
+ };
115
+ type SlotField = BaseField & {
116
+ type: "slot";
117
+ allow?: string[];
118
+ disallow?: string[];
111
119
  };
112
120
  type Field<Props extends any = any> = TextField | NumberField | TextareaField | SelectField | RadioField | ArrayField<Props extends {
113
121
  [key: string]: any;
@@ -117,7 +125,7 @@ type Field<Props extends any = any> = TextField | NumberField | TextareaField |
117
125
  [key: string]: any;
118
126
  } ? Props : any> | ExternalFieldWithAdaptor<Props extends {
119
127
  [key: string]: any;
120
- } ? Props : any> | CustomField<Props>;
128
+ } ? Props : any> | CustomField<Props> | SlotField;
121
129
  type FieldProps<F = Field<any>, ValueType = any> = {
122
130
  field: F;
123
131
  value: ValueType;
@@ -126,6 +134,10 @@ type FieldProps<F = Field<any>, ValueType = any> = {
126
134
  readOnly?: boolean;
127
135
  };
128
136
 
137
+ type Metadata = {
138
+ [key: string]: any;
139
+ };
140
+
129
141
  type ItemWithId = {
130
142
  _arrayId: string;
131
143
  _originalIndex: number;
package/dist/index.d.ts CHANGED
@@ -12,6 +12,8 @@ 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";
@@ -98,16 +100,22 @@ type ExternalField<Props extends {
98
100
  filterFields?: Record<string, Field>;
99
101
  initialFilters?: Record<string, any>;
100
102
  };
101
- 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 & {
102
112
  type: "custom";
103
- render: (props: {
104
- field: CustomField<Props>;
105
- name: string;
106
- id: string;
107
- value: Props;
108
- onChange: (value: Props) => void;
109
- readOnly?: boolean;
110
- }) => ReactElement;
113
+ render: CustomFieldRender<Value>;
114
+ };
115
+ type SlotField = BaseField & {
116
+ type: "slot";
117
+ allow?: string[];
118
+ disallow?: string[];
111
119
  };
112
120
  type Field<Props extends any = any> = TextField | NumberField | TextareaField | SelectField | RadioField | ArrayField<Props extends {
113
121
  [key: string]: any;
@@ -117,7 +125,7 @@ type Field<Props extends any = any> = TextField | NumberField | TextareaField |
117
125
  [key: string]: any;
118
126
  } ? Props : any> | ExternalFieldWithAdaptor<Props extends {
119
127
  [key: string]: any;
120
- } ? Props : any> | CustomField<Props>;
128
+ } ? Props : any> | CustomField<Props> | SlotField;
121
129
  type FieldProps<F = Field<any>, ValueType = any> = {
122
130
  field: F;
123
131
  value: ValueType;
@@ -126,6 +134,10 @@ type FieldProps<F = Field<any>, ValueType = any> = {
126
134
  readOnly?: boolean;
127
135
  };
128
136
 
137
+ type Metadata = {
138
+ [key: string]: any;
139
+ };
140
+
129
141
  type ItemWithId = {
130
142
  _arrayId: string;
131
143
  _originalIndex: number;