@measured/puck-plugin-heading-analyzer 0.18.3 → 0.19.0-canary.01a27f78

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,17 +12,24 @@ type FieldOption = {
12
12
  type FieldOptions = Array<FieldOption> | ReadonlyArray<FieldOption>;
13
13
  type BaseField = {
14
14
  label?: string;
15
+ labelIcon?: ReactElement;
16
+ metadata?: Metadata;
17
+ visible?: boolean;
15
18
  };
16
19
  type TextField = BaseField & {
17
20
  type: "text";
21
+ placeholder?: string;
18
22
  };
19
23
  type NumberField = BaseField & {
20
24
  type: "number";
25
+ placeholder?: string;
21
26
  min?: number;
22
27
  max?: number;
28
+ step?: number;
23
29
  };
24
30
  type TextareaField = BaseField & {
25
31
  type: "textarea";
32
+ placeholder?: string;
26
33
  };
27
34
  type SelectField = BaseField & {
28
35
  type: "select";
@@ -94,16 +101,22 @@ type ExternalField<Props extends {
94
101
  filterFields?: Record<string, Field>;
95
102
  initialFilters?: Record<string, any>;
96
103
  };
97
- type CustomField<Props extends any = {}> = BaseField & {
104
+ type CustomFieldRender<Value extends any> = (props: {
105
+ field: CustomField<Value>;
106
+ name: string;
107
+ id: string;
108
+ value: Value;
109
+ onChange: (value: Value) => void;
110
+ readOnly?: boolean;
111
+ }) => ReactElement;
112
+ type CustomField<Value extends any> = BaseField & {
98
113
  type: "custom";
99
- render: (props: {
100
- field: CustomField<Props>;
101
- name: string;
102
- id: string;
103
- value: Props;
104
- onChange: (value: Props) => void;
105
- readOnly?: boolean;
106
- }) => ReactElement;
114
+ render: CustomFieldRender<Value>;
115
+ };
116
+ type SlotField = BaseField & {
117
+ type: "slot";
118
+ allow?: string[];
119
+ disallow?: string[];
107
120
  };
108
121
  type Field<Props extends any = any> = TextField | NumberField | TextareaField | SelectField | RadioField | ArrayField<Props extends {
109
122
  [key: string]: any;
@@ -113,7 +126,7 @@ type Field<Props extends any = any> = TextField | NumberField | TextareaField |
113
126
  [key: string]: any;
114
127
  } ? Props : any> | ExternalFieldWithAdaptor<Props extends {
115
128
  [key: string]: any;
116
- } ? Props : any> | CustomField<Props>;
129
+ } ? Props : any> | CustomField<Props> | SlotField;
117
130
  type FieldProps<F = Field<any>, ValueType = any> = {
118
131
  field: F;
119
132
  value: ValueType;
@@ -122,6 +135,10 @@ type FieldProps<F = Field<any>, ValueType = any> = {
122
135
  readOnly?: boolean;
123
136
  };
124
137
 
138
+ type Metadata = {
139
+ [key: string]: any;
140
+ };
141
+
125
142
  type ItemWithId = {
126
143
  _arrayId: string;
127
144
  _originalIndex: number;
package/dist/index.d.ts CHANGED
@@ -12,17 +12,24 @@ type FieldOption = {
12
12
  type FieldOptions = Array<FieldOption> | ReadonlyArray<FieldOption>;
13
13
  type BaseField = {
14
14
  label?: string;
15
+ labelIcon?: ReactElement;
16
+ metadata?: Metadata;
17
+ visible?: boolean;
15
18
  };
16
19
  type TextField = BaseField & {
17
20
  type: "text";
21
+ placeholder?: string;
18
22
  };
19
23
  type NumberField = BaseField & {
20
24
  type: "number";
25
+ placeholder?: string;
21
26
  min?: number;
22
27
  max?: number;
28
+ step?: number;
23
29
  };
24
30
  type TextareaField = BaseField & {
25
31
  type: "textarea";
32
+ placeholder?: string;
26
33
  };
27
34
  type SelectField = BaseField & {
28
35
  type: "select";
@@ -94,16 +101,22 @@ type ExternalField<Props extends {
94
101
  filterFields?: Record<string, Field>;
95
102
  initialFilters?: Record<string, any>;
96
103
  };
97
- type CustomField<Props extends any = {}> = BaseField & {
104
+ type CustomFieldRender<Value extends any> = (props: {
105
+ field: CustomField<Value>;
106
+ name: string;
107
+ id: string;
108
+ value: Value;
109
+ onChange: (value: Value) => void;
110
+ readOnly?: boolean;
111
+ }) => ReactElement;
112
+ type CustomField<Value extends any> = BaseField & {
98
113
  type: "custom";
99
- render: (props: {
100
- field: CustomField<Props>;
101
- name: string;
102
- id: string;
103
- value: Props;
104
- onChange: (value: Props) => void;
105
- readOnly?: boolean;
106
- }) => ReactElement;
114
+ render: CustomFieldRender<Value>;
115
+ };
116
+ type SlotField = BaseField & {
117
+ type: "slot";
118
+ allow?: string[];
119
+ disallow?: string[];
107
120
  };
108
121
  type Field<Props extends any = any> = TextField | NumberField | TextareaField | SelectField | RadioField | ArrayField<Props extends {
109
122
  [key: string]: any;
@@ -113,7 +126,7 @@ type Field<Props extends any = any> = TextField | NumberField | TextareaField |
113
126
  [key: string]: any;
114
127
  } ? Props : any> | ExternalFieldWithAdaptor<Props extends {
115
128
  [key: string]: any;
116
- } ? Props : any> | CustomField<Props>;
129
+ } ? Props : any> | CustomField<Props> | SlotField;
117
130
  type FieldProps<F = Field<any>, ValueType = any> = {
118
131
  field: F;
119
132
  value: ValueType;
@@ -122,6 +135,10 @@ type FieldProps<F = Field<any>, ValueType = any> = {
122
135
  readOnly?: boolean;
123
136
  };
124
137
 
138
+ type Metadata = {
139
+ [key: string]: any;
140
+ };
141
+
125
142
  type ItemWithId = {
126
143
  _arrayId: string;
127
144
  _originalIndex: number;