@measured/puck-plugin-heading-analyzer 0.19.0-canary.0ea6ce4 → 0.19.0-canary.15d05558
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 +23 -10
- package/dist/index.d.ts +23 -10
- package/dist/index.js +1806 -195
- package/dist/index.mjs +1800 -199
- package/package.json +3 -3
package/README.md
CHANGED
package/dist/index.d.mts
CHANGED
@@ -12,6 +12,9 @@ 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";
|
@@ -98,16 +101,22 @@ type ExternalField<Props extends {
|
|
98
101
|
filterFields?: Record<string, Field>;
|
99
102
|
initialFilters?: Record<string, any>;
|
100
103
|
};
|
101
|
-
type
|
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 & {
|
102
113
|
type: "custom";
|
103
|
-
render:
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
readOnly?: boolean;
|
110
|
-
}) => ReactElement;
|
114
|
+
render: CustomFieldRender<Value>;
|
115
|
+
};
|
116
|
+
type SlotField = BaseField & {
|
117
|
+
type: "slot";
|
118
|
+
allow?: string[];
|
119
|
+
disallow?: string[];
|
111
120
|
};
|
112
121
|
type Field<Props extends any = any> = TextField | NumberField | TextareaField | SelectField | RadioField | ArrayField<Props extends {
|
113
122
|
[key: string]: any;
|
@@ -117,7 +126,7 @@ type Field<Props extends any = any> = TextField | NumberField | TextareaField |
|
|
117
126
|
[key: string]: any;
|
118
127
|
} ? Props : any> | ExternalFieldWithAdaptor<Props extends {
|
119
128
|
[key: string]: any;
|
120
|
-
} ? Props : any> | CustomField<Props
|
129
|
+
} ? Props : any> | CustomField<Props> | SlotField;
|
121
130
|
type FieldProps<F = Field<any>, ValueType = any> = {
|
122
131
|
field: F;
|
123
132
|
value: ValueType;
|
@@ -126,6 +135,10 @@ type FieldProps<F = Field<any>, ValueType = any> = {
|
|
126
135
|
readOnly?: boolean;
|
127
136
|
};
|
128
137
|
|
138
|
+
type Metadata = {
|
139
|
+
[key: string]: any;
|
140
|
+
};
|
141
|
+
|
129
142
|
type ItemWithId = {
|
130
143
|
_arrayId: string;
|
131
144
|
_originalIndex: number;
|
package/dist/index.d.ts
CHANGED
@@ -12,6 +12,9 @@ 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";
|
@@ -98,16 +101,22 @@ type ExternalField<Props extends {
|
|
98
101
|
filterFields?: Record<string, Field>;
|
99
102
|
initialFilters?: Record<string, any>;
|
100
103
|
};
|
101
|
-
type
|
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 & {
|
102
113
|
type: "custom";
|
103
|
-
render:
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
readOnly?: boolean;
|
110
|
-
}) => ReactElement;
|
114
|
+
render: CustomFieldRender<Value>;
|
115
|
+
};
|
116
|
+
type SlotField = BaseField & {
|
117
|
+
type: "slot";
|
118
|
+
allow?: string[];
|
119
|
+
disallow?: string[];
|
111
120
|
};
|
112
121
|
type Field<Props extends any = any> = TextField | NumberField | TextareaField | SelectField | RadioField | ArrayField<Props extends {
|
113
122
|
[key: string]: any;
|
@@ -117,7 +126,7 @@ type Field<Props extends any = any> = TextField | NumberField | TextareaField |
|
|
117
126
|
[key: string]: any;
|
118
127
|
} ? Props : any> | ExternalFieldWithAdaptor<Props extends {
|
119
128
|
[key: string]: any;
|
120
|
-
} ? Props : any> | CustomField<Props
|
129
|
+
} ? Props : any> | CustomField<Props> | SlotField;
|
121
130
|
type FieldProps<F = Field<any>, ValueType = any> = {
|
122
131
|
field: F;
|
123
132
|
value: ValueType;
|
@@ -126,6 +135,10 @@ type FieldProps<F = Field<any>, ValueType = any> = {
|
|
126
135
|
readOnly?: boolean;
|
127
136
|
};
|
128
137
|
|
138
|
+
type Metadata = {
|
139
|
+
[key: string]: any;
|
140
|
+
};
|
141
|
+
|
129
142
|
type ItemWithId = {
|
130
143
|
_arrayId: string;
|
131
144
|
_originalIndex: number;
|