@puckeditor/plugin-heading-analyzer 0.22.0-canary.8f15de54 → 0.22.0-canary.a070d890
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 +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +9 -16
- package/dist/index.mjs +9 -16
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -428,6 +428,7 @@ UserField extends BaseField = {}> = {
|
|
|
428
428
|
metadata: ComponentMetadata;
|
|
429
429
|
trigger: ResolveDataTrigger;
|
|
430
430
|
parent: ComponentData | null;
|
|
431
|
+
root: RootData;
|
|
431
432
|
}) => Promise<WithPartialProps<DataShape, FieldProps>> | WithPartialProps<DataShape, FieldProps>;
|
|
432
433
|
resolvePermissions?: (data: DataShape, params: {
|
|
433
434
|
changed: Partial<Record<keyof FieldProps, boolean> & {
|
package/dist/index.d.ts
CHANGED
|
@@ -428,6 +428,7 @@ UserField extends BaseField = {}> = {
|
|
|
428
428
|
metadata: ComponentMetadata;
|
|
429
429
|
trigger: ResolveDataTrigger;
|
|
430
430
|
parent: ComponentData | null;
|
|
431
|
+
root: RootData;
|
|
431
432
|
}) => Promise<WithPartialProps<DataShape, FieldProps>> | WithPartialProps<DataShape, FieldProps>;
|
|
432
433
|
resolvePermissions?: (data: DataShape, params: {
|
|
433
434
|
changed: Partial<Record<keyof FieldProps, boolean> & {
|
package/dist/index.js
CHANGED
|
@@ -550,20 +550,10 @@ var walkField = ({
|
|
|
550
550
|
if (map && fieldType === "slot") {
|
|
551
551
|
const content = value || [];
|
|
552
552
|
const mappedContent = recurseSlots ? content.map((el) => {
|
|
553
|
-
|
|
554
|
-
const componentConfig = config.components[el.type];
|
|
555
|
-
if (!componentConfig) {
|
|
553
|
+
if (!config.components[el.type]) {
|
|
556
554
|
throw new Error(`Could not find component config for ${el.type}`);
|
|
557
555
|
}
|
|
558
|
-
|
|
559
|
-
return walkField({
|
|
560
|
-
value: __spreadProps(__spreadValues({}, el), { props: defaultSlots(el.props, fields2) }),
|
|
561
|
-
fields: fields2,
|
|
562
|
-
mappers,
|
|
563
|
-
id: el.props.id,
|
|
564
|
-
config,
|
|
565
|
-
recurseSlots
|
|
566
|
-
});
|
|
556
|
+
return mapFields(el, mappers, config, recurseSlots);
|
|
567
557
|
}) : content;
|
|
568
558
|
if (containsPromise(mappedContent)) {
|
|
569
559
|
return Promise.all(mappedContent);
|
|
@@ -2268,7 +2258,7 @@ var createFieldsSlice = (_set, _get) => {
|
|
|
2268
2258
|
// ../core/lib/resolve-component-data.ts
|
|
2269
2259
|
init_react_import();
|
|
2270
2260
|
var cache = { lastChange: {} };
|
|
2271
|
-
var resolveComponentData = (_0, _1, ..._2) => __async(null, [_0, _1, ..._2], function* (item, config, metadata = {}, onResolveStart, onResolveEnd, trigger = "replace", parent = null) {
|
|
2261
|
+
var resolveComponentData = (_0, _1, ..._2) => __async(null, [_0, _1, ..._2], function* (item, config, metadata = {}, onResolveStart, onResolveEnd, trigger = "replace", parent = null, root = { props: {} }) {
|
|
2272
2262
|
const configForItem = "type" in item && item.type !== "root" ? config.components[item.type] : config.root;
|
|
2273
2263
|
const resolvedItem = __spreadValues({}, item);
|
|
2274
2264
|
const shouldRunResolver = (configForItem == null ? void 0 : configForItem.resolveData) && item.props;
|
|
@@ -2295,7 +2285,8 @@ var resolveComponentData = (_0, _1, ..._2) => __async(null, [_0, _1, ..._2], fun
|
|
|
2295
2285
|
lastData: oldItem,
|
|
2296
2286
|
metadata: __spreadValues(__spreadValues({}, metadata), configForItem.metadata),
|
|
2297
2287
|
trigger,
|
|
2298
|
-
parent
|
|
2288
|
+
parent,
|
|
2289
|
+
root
|
|
2299
2290
|
});
|
|
2300
2291
|
resolvedItem.props = __spreadValues(__spreadValues({}, item.props), resolvedProps);
|
|
2301
2292
|
if (Object.keys(readOnly).length) {
|
|
@@ -2318,7 +2309,8 @@ var resolveComponentData = (_0, _1, ..._2) => __async(null, [_0, _1, ..._2], fun
|
|
|
2318
2309
|
onResolveStart,
|
|
2319
2310
|
onResolveEnd,
|
|
2320
2311
|
trigger,
|
|
2321
|
-
itemAsComponentData
|
|
2312
|
+
itemAsComponentData,
|
|
2313
|
+
root
|
|
2322
2314
|
)).node;
|
|
2323
2315
|
})
|
|
2324
2316
|
)
|
|
@@ -2537,7 +2529,8 @@ var createAppStore = (initialAppStore) => create()(
|
|
|
2537
2529
|
timeouts[id]();
|
|
2538
2530
|
}),
|
|
2539
2531
|
trigger,
|
|
2540
|
-
parentData
|
|
2532
|
+
parentData,
|
|
2533
|
+
state.data.root
|
|
2541
2534
|
);
|
|
2542
2535
|
}),
|
|
2543
2536
|
resolveAndCommitData: () => __async(null, null, function* () {
|
package/dist/index.mjs
CHANGED
|
@@ -538,20 +538,10 @@ var walkField = ({
|
|
|
538
538
|
if (map && fieldType === "slot") {
|
|
539
539
|
const content = value || [];
|
|
540
540
|
const mappedContent = recurseSlots ? content.map((el) => {
|
|
541
|
-
|
|
542
|
-
const componentConfig = config.components[el.type];
|
|
543
|
-
if (!componentConfig) {
|
|
541
|
+
if (!config.components[el.type]) {
|
|
544
542
|
throw new Error(`Could not find component config for ${el.type}`);
|
|
545
543
|
}
|
|
546
|
-
|
|
547
|
-
return walkField({
|
|
548
|
-
value: __spreadProps(__spreadValues({}, el), { props: defaultSlots(el.props, fields2) }),
|
|
549
|
-
fields: fields2,
|
|
550
|
-
mappers,
|
|
551
|
-
id: el.props.id,
|
|
552
|
-
config,
|
|
553
|
-
recurseSlots
|
|
554
|
-
});
|
|
544
|
+
return mapFields(el, mappers, config, recurseSlots);
|
|
555
545
|
}) : content;
|
|
556
546
|
if (containsPromise(mappedContent)) {
|
|
557
547
|
return Promise.all(mappedContent);
|
|
@@ -2256,7 +2246,7 @@ var createFieldsSlice = (_set, _get) => {
|
|
|
2256
2246
|
// ../core/lib/resolve-component-data.ts
|
|
2257
2247
|
init_react_import();
|
|
2258
2248
|
var cache = { lastChange: {} };
|
|
2259
|
-
var resolveComponentData = (_0, _1, ..._2) => __async(null, [_0, _1, ..._2], function* (item, config, metadata = {}, onResolveStart, onResolveEnd, trigger = "replace", parent = null) {
|
|
2249
|
+
var resolveComponentData = (_0, _1, ..._2) => __async(null, [_0, _1, ..._2], function* (item, config, metadata = {}, onResolveStart, onResolveEnd, trigger = "replace", parent = null, root = { props: {} }) {
|
|
2260
2250
|
const configForItem = "type" in item && item.type !== "root" ? config.components[item.type] : config.root;
|
|
2261
2251
|
const resolvedItem = __spreadValues({}, item);
|
|
2262
2252
|
const shouldRunResolver = (configForItem == null ? void 0 : configForItem.resolveData) && item.props;
|
|
@@ -2283,7 +2273,8 @@ var resolveComponentData = (_0, _1, ..._2) => __async(null, [_0, _1, ..._2], fun
|
|
|
2283
2273
|
lastData: oldItem,
|
|
2284
2274
|
metadata: __spreadValues(__spreadValues({}, metadata), configForItem.metadata),
|
|
2285
2275
|
trigger,
|
|
2286
|
-
parent
|
|
2276
|
+
parent,
|
|
2277
|
+
root
|
|
2287
2278
|
});
|
|
2288
2279
|
resolvedItem.props = __spreadValues(__spreadValues({}, item.props), resolvedProps);
|
|
2289
2280
|
if (Object.keys(readOnly).length) {
|
|
@@ -2306,7 +2297,8 @@ var resolveComponentData = (_0, _1, ..._2) => __async(null, [_0, _1, ..._2], fun
|
|
|
2306
2297
|
onResolveStart,
|
|
2307
2298
|
onResolveEnd,
|
|
2308
2299
|
trigger,
|
|
2309
|
-
itemAsComponentData
|
|
2300
|
+
itemAsComponentData,
|
|
2301
|
+
root
|
|
2310
2302
|
)).node;
|
|
2311
2303
|
})
|
|
2312
2304
|
)
|
|
@@ -2525,7 +2517,8 @@ var createAppStore = (initialAppStore) => create()(
|
|
|
2525
2517
|
timeouts[id]();
|
|
2526
2518
|
}),
|
|
2527
2519
|
trigger,
|
|
2528
|
-
parentData
|
|
2520
|
+
parentData,
|
|
2521
|
+
state.data.root
|
|
2529
2522
|
);
|
|
2530
2523
|
}),
|
|
2531
2524
|
resolveAndCommitData: () => __async(null, null, function* () {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@puckeditor/plugin-heading-analyzer",
|
|
3
|
-
"version": "0.22.0-canary.
|
|
3
|
+
"version": "0.22.0-canary.a070d890",
|
|
4
4
|
"author": "Chris Villa <chris@puckeditor.com>",
|
|
5
5
|
"repository": "puckeditor/puck",
|
|
6
6
|
"bugs": "https://github.com/puckeditor/puck/issues",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"dist"
|
|
26
26
|
],
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@puckeditor/core": "^0.22.0-canary.
|
|
28
|
+
"@puckeditor/core": "^0.22.0-canary.a070d890",
|
|
29
29
|
"@types/minimatch": "3.0.5",
|
|
30
30
|
"@types/react": "^19.0.1",
|
|
31
31
|
"@types/react-dom": "^19.0.2",
|