@measured/puck-plugin-heading-analyzer 0.21.0-canary.e4131567 → 0.21.0-canary.ec77dd9f
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/dist/index.d.mts +51 -38
- package/dist/index.d.ts +51 -38
- package/dist/index.js +27 -62
- package/dist/index.mjs +24 -59
- package/package.json +3 -2
package/dist/index.d.mts
CHANGED
|
@@ -10,63 +10,63 @@ type FieldOption = {
|
|
|
10
10
|
value: string | number | boolean | undefined | null | object;
|
|
11
11
|
};
|
|
12
12
|
type FieldOptions = Array<FieldOption> | ReadonlyArray<FieldOption>;
|
|
13
|
-
|
|
13
|
+
interface BaseField {
|
|
14
14
|
label?: string;
|
|
15
15
|
labelIcon?: ReactElement;
|
|
16
|
-
metadata?:
|
|
16
|
+
metadata?: FieldMetadata;
|
|
17
17
|
visible?: boolean;
|
|
18
|
-
}
|
|
19
|
-
|
|
18
|
+
}
|
|
19
|
+
interface TextField extends BaseField {
|
|
20
20
|
type: "text";
|
|
21
21
|
placeholder?: string;
|
|
22
22
|
contentEditable?: boolean;
|
|
23
|
-
}
|
|
24
|
-
|
|
23
|
+
}
|
|
24
|
+
interface NumberField extends BaseField {
|
|
25
25
|
type: "number";
|
|
26
26
|
placeholder?: string;
|
|
27
27
|
min?: number;
|
|
28
28
|
max?: number;
|
|
29
29
|
step?: number;
|
|
30
|
-
}
|
|
31
|
-
|
|
30
|
+
}
|
|
31
|
+
interface TextareaField extends BaseField {
|
|
32
32
|
type: "textarea";
|
|
33
33
|
placeholder?: string;
|
|
34
34
|
contentEditable?: boolean;
|
|
35
|
-
}
|
|
36
|
-
|
|
35
|
+
}
|
|
36
|
+
interface SelectField extends BaseField {
|
|
37
37
|
type: "select";
|
|
38
38
|
options: FieldOptions;
|
|
39
|
-
}
|
|
40
|
-
|
|
39
|
+
}
|
|
40
|
+
interface RadioField extends BaseField {
|
|
41
41
|
type: "radio";
|
|
42
42
|
options: FieldOptions;
|
|
43
|
-
}
|
|
44
|
-
|
|
43
|
+
}
|
|
44
|
+
interface ArrayField<Props extends {
|
|
45
45
|
[key: string]: any;
|
|
46
46
|
}[] = {
|
|
47
47
|
[key: string]: any;
|
|
48
|
-
}[], UserField extends {} = {}>
|
|
48
|
+
}[], UserField extends {} = {}> extends BaseField {
|
|
49
49
|
type: "array";
|
|
50
50
|
arrayFields: {
|
|
51
51
|
[SubPropName in keyof Props[0]]: UserField extends {
|
|
52
52
|
type: PropertyKey;
|
|
53
53
|
} ? Field<Props[0][SubPropName], UserField> | UserField : Field<Props[0][SubPropName], UserField>;
|
|
54
54
|
};
|
|
55
|
-
defaultItemProps?: Props[0];
|
|
55
|
+
defaultItemProps?: Props[0] | ((index: number) => Props[0]);
|
|
56
56
|
getItemSummary?: (item: Props[0], index?: number) => string;
|
|
57
57
|
max?: number;
|
|
58
58
|
min?: number;
|
|
59
|
-
}
|
|
60
|
-
|
|
59
|
+
}
|
|
60
|
+
interface ObjectField<Props extends any = {
|
|
61
61
|
[key: string]: any;
|
|
62
|
-
}, UserField extends {} = {}>
|
|
62
|
+
}, UserField extends {} = {}> extends BaseField {
|
|
63
63
|
type: "object";
|
|
64
64
|
objectFields: {
|
|
65
65
|
[SubPropName in keyof Props]: UserField extends {
|
|
66
66
|
type: PropertyKey;
|
|
67
67
|
} ? Field<Props[SubPropName]> | UserField : Field<Props[SubPropName]>;
|
|
68
68
|
};
|
|
69
|
-
}
|
|
69
|
+
}
|
|
70
70
|
type Adaptor<AdaptorParams = {}, TableShape extends Record<string, any> = {}, PropShape = TableShape> = {
|
|
71
71
|
name: string;
|
|
72
72
|
fetchList: (adaptorParams?: AdaptorParams) => Promise<TableShape[] | null>;
|
|
@@ -82,10 +82,14 @@ type ExternalFieldWithAdaptor<Props extends any = {
|
|
|
82
82
|
adaptorParams?: object;
|
|
83
83
|
getItemSummary: (item: NotUndefined<Props>, index?: number) => string;
|
|
84
84
|
};
|
|
85
|
-
type
|
|
85
|
+
type CacheOpts = {
|
|
86
|
+
enabled?: boolean;
|
|
87
|
+
};
|
|
88
|
+
interface ExternalField<Props extends any = {
|
|
86
89
|
[key: string]: any;
|
|
87
|
-
}>
|
|
90
|
+
}> extends BaseField {
|
|
88
91
|
type: "external";
|
|
92
|
+
cache?: CacheOpts;
|
|
89
93
|
placeholder?: string;
|
|
90
94
|
fetchList: (params: {
|
|
91
95
|
query: string;
|
|
@@ -101,7 +105,7 @@ type ExternalField<Props extends any = {
|
|
|
101
105
|
initialQuery?: string;
|
|
102
106
|
filterFields?: Record<string, Field>;
|
|
103
107
|
initialFilters?: Record<string, any>;
|
|
104
|
-
}
|
|
108
|
+
}
|
|
105
109
|
type CustomFieldRender<Value extends any> = (props: {
|
|
106
110
|
field: CustomField<Value>;
|
|
107
111
|
name: string;
|
|
@@ -110,16 +114,17 @@ type CustomFieldRender<Value extends any> = (props: {
|
|
|
110
114
|
onChange: (value: Value) => void;
|
|
111
115
|
readOnly?: boolean;
|
|
112
116
|
}) => ReactElement;
|
|
113
|
-
|
|
117
|
+
interface CustomField<Value extends any> extends BaseField {
|
|
114
118
|
type: "custom";
|
|
115
119
|
render: CustomFieldRender<Value>;
|
|
116
120
|
contentEditable?: boolean;
|
|
117
|
-
|
|
118
|
-
|
|
121
|
+
key?: string;
|
|
122
|
+
}
|
|
123
|
+
interface SlotField extends BaseField {
|
|
119
124
|
type: "slot";
|
|
120
125
|
allow?: string[];
|
|
121
126
|
disallow?: string[];
|
|
122
|
-
}
|
|
127
|
+
}
|
|
123
128
|
type Field<ValueType = any, UserField extends {} = {}> = TextField | NumberField | TextareaField | SelectField | RadioField | ArrayField<ValueType extends {
|
|
124
129
|
[key: string]: any;
|
|
125
130
|
}[] ? ValueType : never, UserField> | ObjectField<ValueType, UserField> | ExternalField<ValueType> | ExternalFieldWithAdaptor<ValueType> | CustomField<ValueType> | SlotField;
|
|
@@ -147,7 +152,7 @@ type DropZoneProps = {
|
|
|
147
152
|
};
|
|
148
153
|
|
|
149
154
|
type PuckContext = {
|
|
150
|
-
renderDropZone: React.
|
|
155
|
+
renderDropZone: (props: DropZoneProps) => React.ReactNode;
|
|
151
156
|
metadata: Metadata;
|
|
152
157
|
isEditing: boolean;
|
|
153
158
|
dragRef: ((element: Element | null) => void) | null;
|
|
@@ -195,6 +200,8 @@ type ResolveDataTrigger = "insert" | "replace" | "load" | "force";
|
|
|
195
200
|
type WithPartialProps<T, Props extends DefaultComponentProps> = Omit<T, "props"> & {
|
|
196
201
|
props?: Partial<Props>;
|
|
197
202
|
};
|
|
203
|
+
interface ComponentConfigExtensions {
|
|
204
|
+
}
|
|
198
205
|
type ComponentConfigInternal<RenderProps extends DefaultComponentProps, FieldProps extends DefaultComponentProps, DataShape = Omit<ComponentData<FieldProps>, "type">, // NB this doesn't include AllProps, so types will not contain deep slot types. To fix, we require a breaking change.
|
|
199
206
|
UserField extends BaseField = {}> = {
|
|
200
207
|
render: PuckComponent<RenderProps>;
|
|
@@ -210,7 +217,7 @@ UserField extends BaseField = {}> = {
|
|
|
210
217
|
fields: Fields<FieldProps>;
|
|
211
218
|
lastFields: Fields<FieldProps>;
|
|
212
219
|
lastData: DataShape | null;
|
|
213
|
-
metadata:
|
|
220
|
+
metadata: ComponentMetadata;
|
|
214
221
|
appState: AppState;
|
|
215
222
|
parent: ComponentData | null;
|
|
216
223
|
}) => Promise<Fields<FieldProps>> | Fields<FieldProps>;
|
|
@@ -219,7 +226,7 @@ UserField extends BaseField = {}> = {
|
|
|
219
226
|
id: string;
|
|
220
227
|
}>;
|
|
221
228
|
lastData: DataShape | null;
|
|
222
|
-
metadata:
|
|
229
|
+
metadata: ComponentMetadata;
|
|
223
230
|
trigger: ResolveDataTrigger;
|
|
224
231
|
}) => Promise<WithPartialProps<DataShape, FieldProps>> | WithPartialProps<DataShape, FieldProps>;
|
|
225
232
|
resolvePermissions?: (data: DataShape, params: {
|
|
@@ -231,8 +238,8 @@ UserField extends BaseField = {}> = {
|
|
|
231
238
|
appState: AppState;
|
|
232
239
|
lastData: DataShape | null;
|
|
233
240
|
}) => Promise<Partial<Permissions>> | Partial<Permissions>;
|
|
234
|
-
metadata?:
|
|
235
|
-
};
|
|
241
|
+
metadata?: ComponentMetadata;
|
|
242
|
+
} & ComponentConfigExtensions;
|
|
236
243
|
type RootConfigInternal<RootProps extends DefaultComponentProps = DefaultComponentProps, UserField extends BaseField = {}> = Partial<ComponentConfigInternal<WithChildren<RootProps>, AsFieldProps<RootProps>, RootData<AsFieldProps<RootProps>>, UserField>>;
|
|
237
244
|
type Category<ComponentName> = {
|
|
238
245
|
components?: ComponentName[];
|
|
@@ -259,6 +266,12 @@ type ExtractConfigParams<UserConfig extends ConfigInternal> = UserConfig extends
|
|
|
259
266
|
type: string;
|
|
260
267
|
} ? UserField : Field;
|
|
261
268
|
} : never;
|
|
269
|
+
type ConfigParams<Components extends DefaultComponents = DefaultComponents, RootProps extends DefaultComponentProps = any, CategoryNames extends string[] = string[], UserFields extends FieldsExtension = FieldsExtension> = {
|
|
270
|
+
components?: Components;
|
|
271
|
+
root?: RootProps;
|
|
272
|
+
categories?: CategoryNames;
|
|
273
|
+
fields?: AssertHasValue<UserFields>;
|
|
274
|
+
};
|
|
262
275
|
|
|
263
276
|
type BaseData<Props extends {
|
|
264
277
|
[key: string]: any;
|
|
@@ -298,6 +311,12 @@ type Data<Components extends DefaultComponents = DefaultComponents, RootProps ex
|
|
|
298
311
|
type Metadata = {
|
|
299
312
|
[key: string]: any;
|
|
300
313
|
};
|
|
314
|
+
interface PuckMetadata extends Metadata {
|
|
315
|
+
}
|
|
316
|
+
interface ComponentMetadata extends PuckMetadata {
|
|
317
|
+
}
|
|
318
|
+
interface FieldMetadata extends Metadata {
|
|
319
|
+
}
|
|
301
320
|
|
|
302
321
|
type ItemWithId = {
|
|
303
322
|
_arrayId: string;
|
|
@@ -366,12 +385,6 @@ type BuiltinTypes = Date | RegExp | Error | Function | symbol | null | undefined
|
|
|
366
385
|
type WithDeepSlots<T, SlotType = T> = T extends Slot ? SlotType : T extends (infer U)[] ? Array<WithDeepSlots<U, SlotType>> : T extends (infer U)[] ? WithDeepSlots<U, SlotType>[] : T extends BuiltinTypes ? T : T extends object ? {
|
|
367
386
|
[K in keyof T]: WithDeepSlots<T[K], SlotType>;
|
|
368
387
|
} : T;
|
|
369
|
-
type ConfigParams<Components extends DefaultComponents = DefaultComponents, RootProps extends DefaultComponentProps = any, CategoryNames extends string[] = string[], UserFields extends FieldsExtension = FieldsExtension> = {
|
|
370
|
-
components?: Components;
|
|
371
|
-
root?: RootProps;
|
|
372
|
-
categories?: CategoryNames;
|
|
373
|
-
fields?: AssertHasValue<UserFields>;
|
|
374
|
-
};
|
|
375
388
|
type FieldsExtension = {
|
|
376
389
|
[Type in string]: {
|
|
377
390
|
type: Type;
|
package/dist/index.d.ts
CHANGED
|
@@ -10,63 +10,63 @@ type FieldOption = {
|
|
|
10
10
|
value: string | number | boolean | undefined | null | object;
|
|
11
11
|
};
|
|
12
12
|
type FieldOptions = Array<FieldOption> | ReadonlyArray<FieldOption>;
|
|
13
|
-
|
|
13
|
+
interface BaseField {
|
|
14
14
|
label?: string;
|
|
15
15
|
labelIcon?: ReactElement;
|
|
16
|
-
metadata?:
|
|
16
|
+
metadata?: FieldMetadata;
|
|
17
17
|
visible?: boolean;
|
|
18
|
-
}
|
|
19
|
-
|
|
18
|
+
}
|
|
19
|
+
interface TextField extends BaseField {
|
|
20
20
|
type: "text";
|
|
21
21
|
placeholder?: string;
|
|
22
22
|
contentEditable?: boolean;
|
|
23
|
-
}
|
|
24
|
-
|
|
23
|
+
}
|
|
24
|
+
interface NumberField extends BaseField {
|
|
25
25
|
type: "number";
|
|
26
26
|
placeholder?: string;
|
|
27
27
|
min?: number;
|
|
28
28
|
max?: number;
|
|
29
29
|
step?: number;
|
|
30
|
-
}
|
|
31
|
-
|
|
30
|
+
}
|
|
31
|
+
interface TextareaField extends BaseField {
|
|
32
32
|
type: "textarea";
|
|
33
33
|
placeholder?: string;
|
|
34
34
|
contentEditable?: boolean;
|
|
35
|
-
}
|
|
36
|
-
|
|
35
|
+
}
|
|
36
|
+
interface SelectField extends BaseField {
|
|
37
37
|
type: "select";
|
|
38
38
|
options: FieldOptions;
|
|
39
|
-
}
|
|
40
|
-
|
|
39
|
+
}
|
|
40
|
+
interface RadioField extends BaseField {
|
|
41
41
|
type: "radio";
|
|
42
42
|
options: FieldOptions;
|
|
43
|
-
}
|
|
44
|
-
|
|
43
|
+
}
|
|
44
|
+
interface ArrayField<Props extends {
|
|
45
45
|
[key: string]: any;
|
|
46
46
|
}[] = {
|
|
47
47
|
[key: string]: any;
|
|
48
|
-
}[], UserField extends {} = {}>
|
|
48
|
+
}[], UserField extends {} = {}> extends BaseField {
|
|
49
49
|
type: "array";
|
|
50
50
|
arrayFields: {
|
|
51
51
|
[SubPropName in keyof Props[0]]: UserField extends {
|
|
52
52
|
type: PropertyKey;
|
|
53
53
|
} ? Field<Props[0][SubPropName], UserField> | UserField : Field<Props[0][SubPropName], UserField>;
|
|
54
54
|
};
|
|
55
|
-
defaultItemProps?: Props[0];
|
|
55
|
+
defaultItemProps?: Props[0] | ((index: number) => Props[0]);
|
|
56
56
|
getItemSummary?: (item: Props[0], index?: number) => string;
|
|
57
57
|
max?: number;
|
|
58
58
|
min?: number;
|
|
59
|
-
}
|
|
60
|
-
|
|
59
|
+
}
|
|
60
|
+
interface ObjectField<Props extends any = {
|
|
61
61
|
[key: string]: any;
|
|
62
|
-
}, UserField extends {} = {}>
|
|
62
|
+
}, UserField extends {} = {}> extends BaseField {
|
|
63
63
|
type: "object";
|
|
64
64
|
objectFields: {
|
|
65
65
|
[SubPropName in keyof Props]: UserField extends {
|
|
66
66
|
type: PropertyKey;
|
|
67
67
|
} ? Field<Props[SubPropName]> | UserField : Field<Props[SubPropName]>;
|
|
68
68
|
};
|
|
69
|
-
}
|
|
69
|
+
}
|
|
70
70
|
type Adaptor<AdaptorParams = {}, TableShape extends Record<string, any> = {}, PropShape = TableShape> = {
|
|
71
71
|
name: string;
|
|
72
72
|
fetchList: (adaptorParams?: AdaptorParams) => Promise<TableShape[] | null>;
|
|
@@ -82,10 +82,14 @@ type ExternalFieldWithAdaptor<Props extends any = {
|
|
|
82
82
|
adaptorParams?: object;
|
|
83
83
|
getItemSummary: (item: NotUndefined<Props>, index?: number) => string;
|
|
84
84
|
};
|
|
85
|
-
type
|
|
85
|
+
type CacheOpts = {
|
|
86
|
+
enabled?: boolean;
|
|
87
|
+
};
|
|
88
|
+
interface ExternalField<Props extends any = {
|
|
86
89
|
[key: string]: any;
|
|
87
|
-
}>
|
|
90
|
+
}> extends BaseField {
|
|
88
91
|
type: "external";
|
|
92
|
+
cache?: CacheOpts;
|
|
89
93
|
placeholder?: string;
|
|
90
94
|
fetchList: (params: {
|
|
91
95
|
query: string;
|
|
@@ -101,7 +105,7 @@ type ExternalField<Props extends any = {
|
|
|
101
105
|
initialQuery?: string;
|
|
102
106
|
filterFields?: Record<string, Field>;
|
|
103
107
|
initialFilters?: Record<string, any>;
|
|
104
|
-
}
|
|
108
|
+
}
|
|
105
109
|
type CustomFieldRender<Value extends any> = (props: {
|
|
106
110
|
field: CustomField<Value>;
|
|
107
111
|
name: string;
|
|
@@ -110,16 +114,17 @@ type CustomFieldRender<Value extends any> = (props: {
|
|
|
110
114
|
onChange: (value: Value) => void;
|
|
111
115
|
readOnly?: boolean;
|
|
112
116
|
}) => ReactElement;
|
|
113
|
-
|
|
117
|
+
interface CustomField<Value extends any> extends BaseField {
|
|
114
118
|
type: "custom";
|
|
115
119
|
render: CustomFieldRender<Value>;
|
|
116
120
|
contentEditable?: boolean;
|
|
117
|
-
|
|
118
|
-
|
|
121
|
+
key?: string;
|
|
122
|
+
}
|
|
123
|
+
interface SlotField extends BaseField {
|
|
119
124
|
type: "slot";
|
|
120
125
|
allow?: string[];
|
|
121
126
|
disallow?: string[];
|
|
122
|
-
}
|
|
127
|
+
}
|
|
123
128
|
type Field<ValueType = any, UserField extends {} = {}> = TextField | NumberField | TextareaField | SelectField | RadioField | ArrayField<ValueType extends {
|
|
124
129
|
[key: string]: any;
|
|
125
130
|
}[] ? ValueType : never, UserField> | ObjectField<ValueType, UserField> | ExternalField<ValueType> | ExternalFieldWithAdaptor<ValueType> | CustomField<ValueType> | SlotField;
|
|
@@ -147,7 +152,7 @@ type DropZoneProps = {
|
|
|
147
152
|
};
|
|
148
153
|
|
|
149
154
|
type PuckContext = {
|
|
150
|
-
renderDropZone: React.
|
|
155
|
+
renderDropZone: (props: DropZoneProps) => React.ReactNode;
|
|
151
156
|
metadata: Metadata;
|
|
152
157
|
isEditing: boolean;
|
|
153
158
|
dragRef: ((element: Element | null) => void) | null;
|
|
@@ -195,6 +200,8 @@ type ResolveDataTrigger = "insert" | "replace" | "load" | "force";
|
|
|
195
200
|
type WithPartialProps<T, Props extends DefaultComponentProps> = Omit<T, "props"> & {
|
|
196
201
|
props?: Partial<Props>;
|
|
197
202
|
};
|
|
203
|
+
interface ComponentConfigExtensions {
|
|
204
|
+
}
|
|
198
205
|
type ComponentConfigInternal<RenderProps extends DefaultComponentProps, FieldProps extends DefaultComponentProps, DataShape = Omit<ComponentData<FieldProps>, "type">, // NB this doesn't include AllProps, so types will not contain deep slot types. To fix, we require a breaking change.
|
|
199
206
|
UserField extends BaseField = {}> = {
|
|
200
207
|
render: PuckComponent<RenderProps>;
|
|
@@ -210,7 +217,7 @@ UserField extends BaseField = {}> = {
|
|
|
210
217
|
fields: Fields<FieldProps>;
|
|
211
218
|
lastFields: Fields<FieldProps>;
|
|
212
219
|
lastData: DataShape | null;
|
|
213
|
-
metadata:
|
|
220
|
+
metadata: ComponentMetadata;
|
|
214
221
|
appState: AppState;
|
|
215
222
|
parent: ComponentData | null;
|
|
216
223
|
}) => Promise<Fields<FieldProps>> | Fields<FieldProps>;
|
|
@@ -219,7 +226,7 @@ UserField extends BaseField = {}> = {
|
|
|
219
226
|
id: string;
|
|
220
227
|
}>;
|
|
221
228
|
lastData: DataShape | null;
|
|
222
|
-
metadata:
|
|
229
|
+
metadata: ComponentMetadata;
|
|
223
230
|
trigger: ResolveDataTrigger;
|
|
224
231
|
}) => Promise<WithPartialProps<DataShape, FieldProps>> | WithPartialProps<DataShape, FieldProps>;
|
|
225
232
|
resolvePermissions?: (data: DataShape, params: {
|
|
@@ -231,8 +238,8 @@ UserField extends BaseField = {}> = {
|
|
|
231
238
|
appState: AppState;
|
|
232
239
|
lastData: DataShape | null;
|
|
233
240
|
}) => Promise<Partial<Permissions>> | Partial<Permissions>;
|
|
234
|
-
metadata?:
|
|
235
|
-
};
|
|
241
|
+
metadata?: ComponentMetadata;
|
|
242
|
+
} & ComponentConfigExtensions;
|
|
236
243
|
type RootConfigInternal<RootProps extends DefaultComponentProps = DefaultComponentProps, UserField extends BaseField = {}> = Partial<ComponentConfigInternal<WithChildren<RootProps>, AsFieldProps<RootProps>, RootData<AsFieldProps<RootProps>>, UserField>>;
|
|
237
244
|
type Category<ComponentName> = {
|
|
238
245
|
components?: ComponentName[];
|
|
@@ -259,6 +266,12 @@ type ExtractConfigParams<UserConfig extends ConfigInternal> = UserConfig extends
|
|
|
259
266
|
type: string;
|
|
260
267
|
} ? UserField : Field;
|
|
261
268
|
} : never;
|
|
269
|
+
type ConfigParams<Components extends DefaultComponents = DefaultComponents, RootProps extends DefaultComponentProps = any, CategoryNames extends string[] = string[], UserFields extends FieldsExtension = FieldsExtension> = {
|
|
270
|
+
components?: Components;
|
|
271
|
+
root?: RootProps;
|
|
272
|
+
categories?: CategoryNames;
|
|
273
|
+
fields?: AssertHasValue<UserFields>;
|
|
274
|
+
};
|
|
262
275
|
|
|
263
276
|
type BaseData<Props extends {
|
|
264
277
|
[key: string]: any;
|
|
@@ -298,6 +311,12 @@ type Data<Components extends DefaultComponents = DefaultComponents, RootProps ex
|
|
|
298
311
|
type Metadata = {
|
|
299
312
|
[key: string]: any;
|
|
300
313
|
};
|
|
314
|
+
interface PuckMetadata extends Metadata {
|
|
315
|
+
}
|
|
316
|
+
interface ComponentMetadata extends PuckMetadata {
|
|
317
|
+
}
|
|
318
|
+
interface FieldMetadata extends Metadata {
|
|
319
|
+
}
|
|
301
320
|
|
|
302
321
|
type ItemWithId = {
|
|
303
322
|
_arrayId: string;
|
|
@@ -366,12 +385,6 @@ type BuiltinTypes = Date | RegExp | Error | Function | symbol | null | undefined
|
|
|
366
385
|
type WithDeepSlots<T, SlotType = T> = T extends Slot ? SlotType : T extends (infer U)[] ? Array<WithDeepSlots<U, SlotType>> : T extends (infer U)[] ? WithDeepSlots<U, SlotType>[] : T extends BuiltinTypes ? T : T extends object ? {
|
|
367
386
|
[K in keyof T]: WithDeepSlots<T[K], SlotType>;
|
|
368
387
|
} : T;
|
|
369
|
-
type ConfigParams<Components extends DefaultComponents = DefaultComponents, RootProps extends DefaultComponentProps = any, CategoryNames extends string[] = string[], UserFields extends FieldsExtension = FieldsExtension> = {
|
|
370
|
-
components?: Components;
|
|
371
|
-
root?: RootProps;
|
|
372
|
-
categories?: CategoryNames;
|
|
373
|
-
fields?: AssertHasValue<UserFields>;
|
|
374
|
-
};
|
|
375
388
|
type FieldsExtension = {
|
|
376
389
|
[Type in string]: {
|
|
377
390
|
type: Type;
|
package/dist/index.js
CHANGED
|
@@ -268,11 +268,11 @@ var require_flat = __commonJS({
|
|
|
268
268
|
});
|
|
269
269
|
|
|
270
270
|
// index.ts
|
|
271
|
-
var
|
|
272
|
-
__export(
|
|
271
|
+
var index_exports = {};
|
|
272
|
+
__export(index_exports, {
|
|
273
273
|
default: () => HeadingAnalyzer_default
|
|
274
274
|
});
|
|
275
|
-
module.exports = __toCommonJS(
|
|
275
|
+
module.exports = __toCommonJS(index_exports);
|
|
276
276
|
init_react_import();
|
|
277
277
|
|
|
278
278
|
// src/HeadingAnalyzer.tsx
|
|
@@ -818,10 +818,10 @@ var insert = (list, index, item) => {
|
|
|
818
818
|
// ../core/lib/generate-id.ts
|
|
819
819
|
init_react_import();
|
|
820
820
|
|
|
821
|
-
//
|
|
821
|
+
// ../core/node_modules/uuid/dist/esm-node/index.js
|
|
822
822
|
init_react_import();
|
|
823
823
|
|
|
824
|
-
//
|
|
824
|
+
// ../core/node_modules/uuid/dist/esm-node/rng.js
|
|
825
825
|
init_react_import();
|
|
826
826
|
var import_crypto = __toESM(require("crypto"));
|
|
827
827
|
var rnds8Pool = new Uint8Array(256);
|
|
@@ -834,7 +834,7 @@ function rng() {
|
|
|
834
834
|
return rnds8Pool.slice(poolPtr, poolPtr += 16);
|
|
835
835
|
}
|
|
836
836
|
|
|
837
|
-
//
|
|
837
|
+
// ../core/node_modules/uuid/dist/esm-node/stringify.js
|
|
838
838
|
init_react_import();
|
|
839
839
|
var byteToHex = [];
|
|
840
840
|
for (let i = 0; i < 256; ++i) {
|
|
@@ -844,17 +844,17 @@ function unsafeStringify(arr, offset = 0) {
|
|
|
844
844
|
return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
|
|
845
845
|
}
|
|
846
846
|
|
|
847
|
-
//
|
|
847
|
+
// ../core/node_modules/uuid/dist/esm-node/v4.js
|
|
848
848
|
init_react_import();
|
|
849
849
|
|
|
850
|
-
//
|
|
850
|
+
// ../core/node_modules/uuid/dist/esm-node/native.js
|
|
851
851
|
init_react_import();
|
|
852
852
|
var import_crypto2 = __toESM(require("crypto"));
|
|
853
853
|
var native_default = {
|
|
854
854
|
randomUUID: import_crypto2.default.randomUUID
|
|
855
855
|
};
|
|
856
856
|
|
|
857
|
-
//
|
|
857
|
+
// ../core/node_modules/uuid/dist/esm-node/v4.js
|
|
858
858
|
function v4(options, buf, offset) {
|
|
859
859
|
if (native_default.randomUUID && !buf && !options) {
|
|
860
860
|
return native_default.randomUUID();
|
|
@@ -1434,7 +1434,7 @@ var createStoreImpl = (createState) => {
|
|
|
1434
1434
|
const initialState = state = createState(setState, getState, api);
|
|
1435
1435
|
return api;
|
|
1436
1436
|
};
|
|
1437
|
-
var createStore = (createState) => createState ? createStoreImpl(createState) : createStoreImpl;
|
|
1437
|
+
var createStore = ((createState) => createState ? createStoreImpl(createState) : createStoreImpl);
|
|
1438
1438
|
|
|
1439
1439
|
// ../../node_modules/zustand/esm/react.mjs
|
|
1440
1440
|
init_react_import();
|
|
@@ -1443,8 +1443,8 @@ var identity = (arg) => arg;
|
|
|
1443
1443
|
function useStore(api, selector = identity) {
|
|
1444
1444
|
const slice = import_react4.default.useSyncExternalStore(
|
|
1445
1445
|
api.subscribe,
|
|
1446
|
-
() => selector(api.getState()),
|
|
1447
|
-
() => selector(api.getInitialState())
|
|
1446
|
+
import_react4.default.useCallback(() => selector(api.getState()), [api, selector]),
|
|
1447
|
+
import_react4.default.useCallback(() => selector(api.getInitialState()), [api, selector])
|
|
1448
1448
|
);
|
|
1449
1449
|
import_react4.default.useDebugValue(slice);
|
|
1450
1450
|
return slice;
|
|
@@ -1455,13 +1455,13 @@ var createImpl = (createState) => {
|
|
|
1455
1455
|
Object.assign(useBoundStore, api);
|
|
1456
1456
|
return useBoundStore;
|
|
1457
1457
|
};
|
|
1458
|
-
var create = (createState) => createState ? createImpl(createState) : createImpl;
|
|
1458
|
+
var create = ((createState) => createState ? createImpl(createState) : createImpl);
|
|
1459
1459
|
|
|
1460
1460
|
// ../../node_modules/zustand/esm/middleware.mjs
|
|
1461
1461
|
init_react_import();
|
|
1462
1462
|
var subscribeWithSelectorImpl = (fn) => (set, get, api) => {
|
|
1463
1463
|
const origSubscribe = api.subscribe;
|
|
1464
|
-
api.subscribe = (selector, optListener, options) => {
|
|
1464
|
+
api.subscribe = ((selector, optListener, options) => {
|
|
1465
1465
|
let listener = selector;
|
|
1466
1466
|
if (optListener) {
|
|
1467
1467
|
const equalityFn = (options == null ? void 0 : options.equalityFn) || Object.is;
|
|
@@ -1478,7 +1478,7 @@ var subscribeWithSelectorImpl = (fn) => (set, get, api) => {
|
|
|
1478
1478
|
}
|
|
1479
1479
|
}
|
|
1480
1480
|
return origSubscribe(listener);
|
|
1481
|
-
};
|
|
1481
|
+
});
|
|
1482
1482
|
const initialState = fn(set, get, api);
|
|
1483
1483
|
return initialState;
|
|
1484
1484
|
};
|
|
@@ -1695,9 +1695,9 @@ function createIsCircular(areItemsEqual) {
|
|
|
1695
1695
|
function getStrictProperties(object) {
|
|
1696
1696
|
return getOwnPropertyNames(object).concat(getOwnPropertySymbols(object));
|
|
1697
1697
|
}
|
|
1698
|
-
var hasOwn = Object.hasOwn || function(object, property) {
|
|
1698
|
+
var hasOwn = Object.hasOwn || (function(object, property) {
|
|
1699
1699
|
return hasOwnProperty.call(object, property);
|
|
1700
|
-
};
|
|
1700
|
+
});
|
|
1701
1701
|
function sameValueZeroEqual(a, b) {
|
|
1702
1702
|
return a === b || !a && !b && a !== a && b !== b;
|
|
1703
1703
|
}
|
|
@@ -2087,10 +2087,10 @@ var getChanged = (newItem, oldItem) => {
|
|
|
2087
2087
|
|
|
2088
2088
|
// ../core/store/slices/permissions.ts
|
|
2089
2089
|
var createPermissionsSlice = (set, get) => {
|
|
2090
|
-
const resolvePermissions = (..._0) => __async(
|
|
2090
|
+
const resolvePermissions = (..._0) => __async(null, [..._0], function* (params = {}, force) {
|
|
2091
2091
|
const { state, permissions, config } = get();
|
|
2092
2092
|
const { cache: cache2, globalPermissions } = permissions;
|
|
2093
|
-
const resolveDataForItem = (item2, force2 = false) => __async(
|
|
2093
|
+
const resolveDataForItem = (item2, force2 = false) => __async(null, null, function* () {
|
|
2094
2094
|
var _a, _b, _c;
|
|
2095
2095
|
const { config: config2, state: appState, setComponentLoading } = get();
|
|
2096
2096
|
const componentConfig = item2.type === "root" ? config2.root : config2.components[item2.type];
|
|
@@ -2145,13 +2145,13 @@ var createPermissionsSlice = (set, get) => {
|
|
|
2145
2145
|
if (item) {
|
|
2146
2146
|
yield resolveDataForItem(item, force);
|
|
2147
2147
|
} else if (type) {
|
|
2148
|
-
flattenData(state, config).filter((item2) => item2.type === type).map((item2) => __async(
|
|
2148
|
+
flattenData(state, config).filter((item2) => item2.type === type).map((item2) => __async(null, null, function* () {
|
|
2149
2149
|
yield resolveDataForItem(item2, force);
|
|
2150
2150
|
}));
|
|
2151
2151
|
} else if (root) {
|
|
2152
2152
|
resolveDataForRoot(force);
|
|
2153
2153
|
} else {
|
|
2154
|
-
flattenData(state, config).map((item2) => __async(
|
|
2154
|
+
flattenData(state, config).map((item2) => __async(null, null, function* () {
|
|
2155
2155
|
yield resolveDataForItem(item2, force);
|
|
2156
2156
|
}));
|
|
2157
2157
|
}
|
|
@@ -2206,7 +2206,7 @@ var createFieldsSlice = (_set, _get) => {
|
|
|
2206
2206
|
// ../core/lib/resolve-component-data.ts
|
|
2207
2207
|
init_react_import();
|
|
2208
2208
|
var cache = { lastChange: {} };
|
|
2209
|
-
var resolveComponentData = (_0, _1, ..._2) => __async(
|
|
2209
|
+
var resolveComponentData = (_0, _1, ..._2) => __async(null, [_0, _1, ..._2], function* (item, config, metadata = {}, onResolveStart, onResolveEnd, trigger = "replace") {
|
|
2210
2210
|
const configForItem = "type" in item && item.type !== "root" ? config.components[item.type] : config.root;
|
|
2211
2211
|
const resolvedItem = __spreadValues({}, item);
|
|
2212
2212
|
const shouldRunResolver = (configForItem == null ? void 0 : configForItem.resolveData) && item.props;
|
|
@@ -2234,11 +2234,11 @@ var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], f
|
|
|
2234
2234
|
let itemWithResolvedChildren = yield mapFields(
|
|
2235
2235
|
resolvedItem,
|
|
2236
2236
|
{
|
|
2237
|
-
slot: (_02) => __async(
|
|
2237
|
+
slot: (_02) => __async(null, [_02], function* ({ value }) {
|
|
2238
2238
|
const content = value;
|
|
2239
2239
|
return yield Promise.all(
|
|
2240
2240
|
content.map(
|
|
2241
|
-
(childItem) => __async(
|
|
2241
|
+
(childItem) => __async(null, null, function* () {
|
|
2242
2242
|
return (yield resolveComponentData(
|
|
2243
2243
|
childItem,
|
|
2244
2244
|
config,
|
|
@@ -2428,7 +2428,7 @@ var createAppStore = (initialAppStore) => create()(
|
|
|
2428
2428
|
const selectedItem = state.ui.itemSelector ? getItem(state.ui.itemSelector, state) : null;
|
|
2429
2429
|
return __spreadProps(__spreadValues({}, s), { state, selectedItem });
|
|
2430
2430
|
}),
|
|
2431
|
-
resolveComponentData: (componentData, trigger) => __async(
|
|
2431
|
+
resolveComponentData: (componentData, trigger) => __async(null, null, function* () {
|
|
2432
2432
|
const { config, metadata, setComponentLoading, permissions } = get();
|
|
2433
2433
|
const timeouts = {};
|
|
2434
2434
|
return yield resolveComponentData(
|
|
@@ -2439,7 +2439,7 @@ var createAppStore = (initialAppStore) => create()(
|
|
|
2439
2439
|
const id = "id" in item.props ? item.props.id : "root";
|
|
2440
2440
|
timeouts[id] = setComponentLoading(id, true, 50);
|
|
2441
2441
|
},
|
|
2442
|
-
(item) => __async(
|
|
2442
|
+
(item) => __async(null, null, function* () {
|
|
2443
2443
|
const id = "id" in item.props ? item.props.id : "root";
|
|
2444
2444
|
if ("type" in item) {
|
|
2445
2445
|
yield permissions.refreshPermissions({ item });
|
|
@@ -2451,7 +2451,7 @@ var createAppStore = (initialAppStore) => create()(
|
|
|
2451
2451
|
trigger
|
|
2452
2452
|
);
|
|
2453
2453
|
}),
|
|
2454
|
-
resolveAndCommitData: () => __async(
|
|
2454
|
+
resolveAndCommitData: () => __async(null, null, function* () {
|
|
2455
2455
|
const { config, state, dispatch, resolveComponentData: resolveComponentData2 } = get();
|
|
2456
2456
|
walkAppState(
|
|
2457
2457
|
state,
|
|
@@ -2875,45 +2875,10 @@ classnames/index.js:
|
|
|
2875
2875
|
*)
|
|
2876
2876
|
|
|
2877
2877
|
lucide-react/dist/esm/shared/src/utils.js:
|
|
2878
|
-
(**
|
|
2879
|
-
* @license lucide-react v0.468.0 - ISC
|
|
2880
|
-
*
|
|
2881
|
-
* This source code is licensed under the ISC license.
|
|
2882
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
2883
|
-
*)
|
|
2884
|
-
|
|
2885
2878
|
lucide-react/dist/esm/defaultAttributes.js:
|
|
2886
|
-
(**
|
|
2887
|
-
* @license lucide-react v0.468.0 - ISC
|
|
2888
|
-
*
|
|
2889
|
-
* This source code is licensed under the ISC license.
|
|
2890
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
2891
|
-
*)
|
|
2892
|
-
|
|
2893
2879
|
lucide-react/dist/esm/Icon.js:
|
|
2894
|
-
(**
|
|
2895
|
-
* @license lucide-react v0.468.0 - ISC
|
|
2896
|
-
*
|
|
2897
|
-
* This source code is licensed under the ISC license.
|
|
2898
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
2899
|
-
*)
|
|
2900
|
-
|
|
2901
2880
|
lucide-react/dist/esm/createLucideIcon.js:
|
|
2902
|
-
(**
|
|
2903
|
-
* @license lucide-react v0.468.0 - ISC
|
|
2904
|
-
*
|
|
2905
|
-
* This source code is licensed under the ISC license.
|
|
2906
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
2907
|
-
*)
|
|
2908
|
-
|
|
2909
2881
|
lucide-react/dist/esm/icons/chevron-right.js:
|
|
2910
|
-
(**
|
|
2911
|
-
* @license lucide-react v0.468.0 - ISC
|
|
2912
|
-
*
|
|
2913
|
-
* This source code is licensed under the ISC license.
|
|
2914
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
2915
|
-
*)
|
|
2916
|
-
|
|
2917
2882
|
lucide-react/dist/esm/lucide-react.js:
|
|
2918
2883
|
(**
|
|
2919
2884
|
* @license lucide-react v0.468.0 - ISC
|
package/dist/index.mjs
CHANGED
|
@@ -806,10 +806,10 @@ var insert = (list, index, item) => {
|
|
|
806
806
|
// ../core/lib/generate-id.ts
|
|
807
807
|
init_react_import();
|
|
808
808
|
|
|
809
|
-
//
|
|
809
|
+
// ../core/node_modules/uuid/dist/esm-node/index.js
|
|
810
810
|
init_react_import();
|
|
811
811
|
|
|
812
|
-
//
|
|
812
|
+
// ../core/node_modules/uuid/dist/esm-node/rng.js
|
|
813
813
|
init_react_import();
|
|
814
814
|
import crypto from "crypto";
|
|
815
815
|
var rnds8Pool = new Uint8Array(256);
|
|
@@ -822,7 +822,7 @@ function rng() {
|
|
|
822
822
|
return rnds8Pool.slice(poolPtr, poolPtr += 16);
|
|
823
823
|
}
|
|
824
824
|
|
|
825
|
-
//
|
|
825
|
+
// ../core/node_modules/uuid/dist/esm-node/stringify.js
|
|
826
826
|
init_react_import();
|
|
827
827
|
var byteToHex = [];
|
|
828
828
|
for (let i = 0; i < 256; ++i) {
|
|
@@ -832,17 +832,17 @@ function unsafeStringify(arr, offset = 0) {
|
|
|
832
832
|
return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
|
|
833
833
|
}
|
|
834
834
|
|
|
835
|
-
//
|
|
835
|
+
// ../core/node_modules/uuid/dist/esm-node/v4.js
|
|
836
836
|
init_react_import();
|
|
837
837
|
|
|
838
|
-
//
|
|
838
|
+
// ../core/node_modules/uuid/dist/esm-node/native.js
|
|
839
839
|
init_react_import();
|
|
840
840
|
import crypto2 from "crypto";
|
|
841
841
|
var native_default = {
|
|
842
842
|
randomUUID: crypto2.randomUUID
|
|
843
843
|
};
|
|
844
844
|
|
|
845
|
-
//
|
|
845
|
+
// ../core/node_modules/uuid/dist/esm-node/v4.js
|
|
846
846
|
function v4(options, buf, offset) {
|
|
847
847
|
if (native_default.randomUUID && !buf && !options) {
|
|
848
848
|
return native_default.randomUUID();
|
|
@@ -1422,7 +1422,7 @@ var createStoreImpl = (createState) => {
|
|
|
1422
1422
|
const initialState = state = createState(setState, getState, api);
|
|
1423
1423
|
return api;
|
|
1424
1424
|
};
|
|
1425
|
-
var createStore = (createState) => createState ? createStoreImpl(createState) : createStoreImpl;
|
|
1425
|
+
var createStore = ((createState) => createState ? createStoreImpl(createState) : createStoreImpl);
|
|
1426
1426
|
|
|
1427
1427
|
// ../../node_modules/zustand/esm/react.mjs
|
|
1428
1428
|
init_react_import();
|
|
@@ -1431,8 +1431,8 @@ var identity = (arg) => arg;
|
|
|
1431
1431
|
function useStore(api, selector = identity) {
|
|
1432
1432
|
const slice = React2.useSyncExternalStore(
|
|
1433
1433
|
api.subscribe,
|
|
1434
|
-
() => selector(api.getState()),
|
|
1435
|
-
() => selector(api.getInitialState())
|
|
1434
|
+
React2.useCallback(() => selector(api.getState()), [api, selector]),
|
|
1435
|
+
React2.useCallback(() => selector(api.getInitialState()), [api, selector])
|
|
1436
1436
|
);
|
|
1437
1437
|
React2.useDebugValue(slice);
|
|
1438
1438
|
return slice;
|
|
@@ -1443,13 +1443,13 @@ var createImpl = (createState) => {
|
|
|
1443
1443
|
Object.assign(useBoundStore, api);
|
|
1444
1444
|
return useBoundStore;
|
|
1445
1445
|
};
|
|
1446
|
-
var create = (createState) => createState ? createImpl(createState) : createImpl;
|
|
1446
|
+
var create = ((createState) => createState ? createImpl(createState) : createImpl);
|
|
1447
1447
|
|
|
1448
1448
|
// ../../node_modules/zustand/esm/middleware.mjs
|
|
1449
1449
|
init_react_import();
|
|
1450
1450
|
var subscribeWithSelectorImpl = (fn) => (set, get, api) => {
|
|
1451
1451
|
const origSubscribe = api.subscribe;
|
|
1452
|
-
api.subscribe = (selector, optListener, options) => {
|
|
1452
|
+
api.subscribe = ((selector, optListener, options) => {
|
|
1453
1453
|
let listener = selector;
|
|
1454
1454
|
if (optListener) {
|
|
1455
1455
|
const equalityFn = (options == null ? void 0 : options.equalityFn) || Object.is;
|
|
@@ -1466,7 +1466,7 @@ var subscribeWithSelectorImpl = (fn) => (set, get, api) => {
|
|
|
1466
1466
|
}
|
|
1467
1467
|
}
|
|
1468
1468
|
return origSubscribe(listener);
|
|
1469
|
-
};
|
|
1469
|
+
});
|
|
1470
1470
|
const initialState = fn(set, get, api);
|
|
1471
1471
|
return initialState;
|
|
1472
1472
|
};
|
|
@@ -1683,9 +1683,9 @@ function createIsCircular(areItemsEqual) {
|
|
|
1683
1683
|
function getStrictProperties(object) {
|
|
1684
1684
|
return getOwnPropertyNames(object).concat(getOwnPropertySymbols(object));
|
|
1685
1685
|
}
|
|
1686
|
-
var hasOwn = Object.hasOwn || function(object, property) {
|
|
1686
|
+
var hasOwn = Object.hasOwn || (function(object, property) {
|
|
1687
1687
|
return hasOwnProperty.call(object, property);
|
|
1688
|
-
};
|
|
1688
|
+
});
|
|
1689
1689
|
function sameValueZeroEqual(a, b) {
|
|
1690
1690
|
return a === b || !a && !b && a !== a && b !== b;
|
|
1691
1691
|
}
|
|
@@ -2075,10 +2075,10 @@ var getChanged = (newItem, oldItem) => {
|
|
|
2075
2075
|
|
|
2076
2076
|
// ../core/store/slices/permissions.ts
|
|
2077
2077
|
var createPermissionsSlice = (set, get) => {
|
|
2078
|
-
const resolvePermissions = (..._0) => __async(
|
|
2078
|
+
const resolvePermissions = (..._0) => __async(null, [..._0], function* (params = {}, force) {
|
|
2079
2079
|
const { state, permissions, config } = get();
|
|
2080
2080
|
const { cache: cache2, globalPermissions } = permissions;
|
|
2081
|
-
const resolveDataForItem = (item2, force2 = false) => __async(
|
|
2081
|
+
const resolveDataForItem = (item2, force2 = false) => __async(null, null, function* () {
|
|
2082
2082
|
var _a, _b, _c;
|
|
2083
2083
|
const { config: config2, state: appState, setComponentLoading } = get();
|
|
2084
2084
|
const componentConfig = item2.type === "root" ? config2.root : config2.components[item2.type];
|
|
@@ -2133,13 +2133,13 @@ var createPermissionsSlice = (set, get) => {
|
|
|
2133
2133
|
if (item) {
|
|
2134
2134
|
yield resolveDataForItem(item, force);
|
|
2135
2135
|
} else if (type) {
|
|
2136
|
-
flattenData(state, config).filter((item2) => item2.type === type).map((item2) => __async(
|
|
2136
|
+
flattenData(state, config).filter((item2) => item2.type === type).map((item2) => __async(null, null, function* () {
|
|
2137
2137
|
yield resolveDataForItem(item2, force);
|
|
2138
2138
|
}));
|
|
2139
2139
|
} else if (root) {
|
|
2140
2140
|
resolveDataForRoot(force);
|
|
2141
2141
|
} else {
|
|
2142
|
-
flattenData(state, config).map((item2) => __async(
|
|
2142
|
+
flattenData(state, config).map((item2) => __async(null, null, function* () {
|
|
2143
2143
|
yield resolveDataForItem(item2, force);
|
|
2144
2144
|
}));
|
|
2145
2145
|
}
|
|
@@ -2194,7 +2194,7 @@ var createFieldsSlice = (_set, _get) => {
|
|
|
2194
2194
|
// ../core/lib/resolve-component-data.ts
|
|
2195
2195
|
init_react_import();
|
|
2196
2196
|
var cache = { lastChange: {} };
|
|
2197
|
-
var resolveComponentData = (_0, _1, ..._2) => __async(
|
|
2197
|
+
var resolveComponentData = (_0, _1, ..._2) => __async(null, [_0, _1, ..._2], function* (item, config, metadata = {}, onResolveStart, onResolveEnd, trigger = "replace") {
|
|
2198
2198
|
const configForItem = "type" in item && item.type !== "root" ? config.components[item.type] : config.root;
|
|
2199
2199
|
const resolvedItem = __spreadValues({}, item);
|
|
2200
2200
|
const shouldRunResolver = (configForItem == null ? void 0 : configForItem.resolveData) && item.props;
|
|
@@ -2222,11 +2222,11 @@ var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], f
|
|
|
2222
2222
|
let itemWithResolvedChildren = yield mapFields(
|
|
2223
2223
|
resolvedItem,
|
|
2224
2224
|
{
|
|
2225
|
-
slot: (_02) => __async(
|
|
2225
|
+
slot: (_02) => __async(null, [_02], function* ({ value }) {
|
|
2226
2226
|
const content = value;
|
|
2227
2227
|
return yield Promise.all(
|
|
2228
2228
|
content.map(
|
|
2229
|
-
(childItem) => __async(
|
|
2229
|
+
(childItem) => __async(null, null, function* () {
|
|
2230
2230
|
return (yield resolveComponentData(
|
|
2231
2231
|
childItem,
|
|
2232
2232
|
config,
|
|
@@ -2416,7 +2416,7 @@ var createAppStore = (initialAppStore) => create()(
|
|
|
2416
2416
|
const selectedItem = state.ui.itemSelector ? getItem(state.ui.itemSelector, state) : null;
|
|
2417
2417
|
return __spreadProps(__spreadValues({}, s), { state, selectedItem });
|
|
2418
2418
|
}),
|
|
2419
|
-
resolveComponentData: (componentData, trigger) => __async(
|
|
2419
|
+
resolveComponentData: (componentData, trigger) => __async(null, null, function* () {
|
|
2420
2420
|
const { config, metadata, setComponentLoading, permissions } = get();
|
|
2421
2421
|
const timeouts = {};
|
|
2422
2422
|
return yield resolveComponentData(
|
|
@@ -2427,7 +2427,7 @@ var createAppStore = (initialAppStore) => create()(
|
|
|
2427
2427
|
const id = "id" in item.props ? item.props.id : "root";
|
|
2428
2428
|
timeouts[id] = setComponentLoading(id, true, 50);
|
|
2429
2429
|
},
|
|
2430
|
-
(item) => __async(
|
|
2430
|
+
(item) => __async(null, null, function* () {
|
|
2431
2431
|
const id = "id" in item.props ? item.props.id : "root";
|
|
2432
2432
|
if ("type" in item) {
|
|
2433
2433
|
yield permissions.refreshPermissions({ item });
|
|
@@ -2439,7 +2439,7 @@ var createAppStore = (initialAppStore) => create()(
|
|
|
2439
2439
|
trigger
|
|
2440
2440
|
);
|
|
2441
2441
|
}),
|
|
2442
|
-
resolveAndCommitData: () => __async(
|
|
2442
|
+
resolveAndCommitData: () => __async(null, null, function* () {
|
|
2443
2443
|
const { config, state, dispatch, resolveComponentData: resolveComponentData2 } = get();
|
|
2444
2444
|
walkAppState(
|
|
2445
2445
|
state,
|
|
@@ -2866,45 +2866,10 @@ classnames/index.js:
|
|
|
2866
2866
|
*)
|
|
2867
2867
|
|
|
2868
2868
|
lucide-react/dist/esm/shared/src/utils.js:
|
|
2869
|
-
(**
|
|
2870
|
-
* @license lucide-react v0.468.0 - ISC
|
|
2871
|
-
*
|
|
2872
|
-
* This source code is licensed under the ISC license.
|
|
2873
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
2874
|
-
*)
|
|
2875
|
-
|
|
2876
2869
|
lucide-react/dist/esm/defaultAttributes.js:
|
|
2877
|
-
(**
|
|
2878
|
-
* @license lucide-react v0.468.0 - ISC
|
|
2879
|
-
*
|
|
2880
|
-
* This source code is licensed under the ISC license.
|
|
2881
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
2882
|
-
*)
|
|
2883
|
-
|
|
2884
2870
|
lucide-react/dist/esm/Icon.js:
|
|
2885
|
-
(**
|
|
2886
|
-
* @license lucide-react v0.468.0 - ISC
|
|
2887
|
-
*
|
|
2888
|
-
* This source code is licensed under the ISC license.
|
|
2889
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
2890
|
-
*)
|
|
2891
|
-
|
|
2892
2871
|
lucide-react/dist/esm/createLucideIcon.js:
|
|
2893
|
-
(**
|
|
2894
|
-
* @license lucide-react v0.468.0 - ISC
|
|
2895
|
-
*
|
|
2896
|
-
* This source code is licensed under the ISC license.
|
|
2897
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
2898
|
-
*)
|
|
2899
|
-
|
|
2900
2872
|
lucide-react/dist/esm/icons/chevron-right.js:
|
|
2901
|
-
(**
|
|
2902
|
-
* @license lucide-react v0.468.0 - ISC
|
|
2903
|
-
*
|
|
2904
|
-
* This source code is licensed under the ISC license.
|
|
2905
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
2906
|
-
*)
|
|
2907
|
-
|
|
2908
2873
|
lucide-react/dist/esm/lucide-react.js:
|
|
2909
2874
|
(**
|
|
2910
2875
|
* @license lucide-react v0.468.0 - ISC
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@measured/puck-plugin-heading-analyzer",
|
|
3
|
-
"version": "0.21.0-canary.
|
|
3
|
+
"version": "0.21.0-canary.ec77dd9f",
|
|
4
4
|
"author": "Chris Villa <chris@puckeditor.com>",
|
|
5
5
|
"repository": "measuredco/puck",
|
|
6
6
|
"bugs": "https://github.com/measuredco/puck/issues",
|
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
"dist"
|
|
26
26
|
],
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@measured/puck": "^0.21.0-canary.
|
|
28
|
+
"@measured/puck": "^0.21.0-canary.ec77dd9f",
|
|
29
|
+
"@types/minimatch": "3.0.5",
|
|
29
30
|
"@types/react": "^19.0.1",
|
|
30
31
|
"@types/react-dom": "^19.0.2",
|
|
31
32
|
"eslint": "^7.32.0",
|