@bettercms-ai/types 1.63.0 → 1.64.0
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.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -4329,7 +4329,7 @@ declare function fieldGroupOf(topKey: string, flat?: boolean): {
|
|
|
4329
4329
|
* section added from the library carries neither, which is how it is told apart: the site's code
|
|
4330
4330
|
* has nothing to draw it with.
|
|
4331
4331
|
*/
|
|
4332
|
-
declare function placementBindOf(block: unknown): string | null;
|
|
4332
|
+
declare function placementBindOf(block: unknown, groupOf?: (topKey: string) => string | undefined): string | null;
|
|
4333
4333
|
/**
|
|
4334
4334
|
* A slot the CMS was not known to hold when the page was wrapped is spelled `code:<bind>`.
|
|
4335
4335
|
* It matches a block bound to `<bind>` like the bare spelling does; it differs only when no block
|
package/dist/index.js
CHANGED
|
@@ -4421,14 +4421,14 @@ function fieldGroupOf(topKey, flat = false) {
|
|
|
4421
4421
|
if (TAG_HEADS.has(head)) return { groupKey: topKey, rooted: false };
|
|
4422
4422
|
return { groupKey: head, rooted: true };
|
|
4423
4423
|
}
|
|
4424
|
-
function placementBindOf(block) {
|
|
4424
|
+
function placementBindOf(block, groupOf) {
|
|
4425
4425
|
if (!block || typeof block !== "object" || block.type !== "component") return null;
|
|
4426
4426
|
const props = block.props;
|
|
4427
4427
|
const bind = props?.bind;
|
|
4428
4428
|
if (typeof bind === "string" && bind) return bind;
|
|
4429
4429
|
const source = props?.source;
|
|
4430
4430
|
if (!source || typeof source !== "object") return null;
|
|
4431
|
-
const groups = Object.values(source).filter((path) => typeof path === "string" && path.length > 0).map((path) => ({ top: topFieldKeyOf(path), group: fieldGroupOf(topFieldKeyOf(path), path === topFieldKeyOf(path)).groupKey }));
|
|
4431
|
+
const groups = Object.values(source).filter((path) => typeof path === "string" && path.length > 0).map((path) => ({ top: topFieldKeyOf(path), group: groupOf?.(topFieldKeyOf(path)) ?? fieldGroupOf(topFieldKeyOf(path), path === topFieldKeyOf(path)).groupKey }));
|
|
4432
4432
|
return (groups.find((g) => g.group !== g.top) ?? groups[0])?.group ?? null;
|
|
4433
4433
|
}
|
|
4434
4434
|
var CODE_SLOT_PREFIX = "code:";
|