@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 +1 -1
- package/dist/index.d.mts +22 -10
- package/dist/index.d.ts +22 -10
- package/dist/index.js +1048 -673
- package/dist/index.mjs +1041 -666
- package/package.json +3 -3
package/README.md
CHANGED
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
|
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:
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
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
|
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:
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
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;
|