@juo/blocks 1.14.0 → 1.15.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/{ExtensionRoot-CRJx0Dtr.js → ExtensionRoot-C3lVJEBl.js} +9 -2
- package/dist/block.d.ts.map +1 -1
- package/dist/block.devtools.test.d.ts +2 -0
- package/dist/block.devtools.test.d.ts.map +1 -0
- package/dist/{bridge-D838SWmN.js → bridge-xiKEzCGR.js} +30 -30
- package/dist/context.d.ts.map +1 -1
- package/dist/context.devtools.test.d.ts +2 -0
- package/dist/context.devtools.test.d.ts.map +1 -0
- package/dist/core.js +80 -71
- package/dist/{css-runtime-DWytAzZ5.js → css-runtime-ClH0MEYr.js} +151 -113
- package/dist/devtools/env.d.ts +3 -0
- package/dist/devtools/env.d.ts.map +1 -0
- package/dist/devtools/hook.d.ts +40 -0
- package/dist/devtools/hook.d.ts.map +1 -0
- package/dist/devtools/index.d.ts +5 -0
- package/dist/devtools/index.d.ts.map +1 -0
- package/dist/devtools/instrumentation.d.ts +47 -0
- package/dist/devtools/instrumentation.d.ts.map +1 -0
- package/dist/devtools/protocol.d.ts +77 -0
- package/dist/devtools/protocol.d.ts.map +1 -0
- package/dist/devtools.js +11 -0
- package/dist/editor/components.d.ts.map +1 -1
- package/dist/editor/layout-command-emitter.d.ts +6 -0
- package/dist/editor/layout-command-emitter.d.ts.map +1 -1
- package/dist/editor/main.d.ts.map +1 -1
- package/dist/editor/messages.d.ts +6 -0
- package/dist/editor/messages.d.ts.map +1 -1
- package/dist/editor.js +74 -67
- package/dist/{gridstack-adapter-DreG3XnB.js → gridstack-adapter-CDWbSpbt.js} +15 -16
- package/dist/index-JSv6UH_o.js +169 -0
- package/dist/layout/index.d.ts +1 -0
- package/dist/layout/index.d.ts.map +1 -1
- package/dist/layout/insert.d.ts +14 -11
- package/dist/layout/insert.d.ts.map +1 -1
- package/dist/layout/override.d.ts +10 -0
- package/dist/layout/override.d.ts.map +1 -0
- package/dist/layout/override.test.d.ts +2 -0
- package/dist/layout/override.test.d.ts.map +1 -0
- package/dist/layout/project-css.d.ts.map +1 -1
- package/dist/layout/reconcile.d.ts +4 -3
- package/dist/layout/reconcile.d.ts.map +1 -1
- package/dist/{morph-Dj-xvrwt.js → morph-n4LMxOYo.js} +1 -1
- package/dist/preact/block.d.ts.map +1 -1
- package/dist/preact.js +14 -10
- package/dist/{project-gridstack-DYLMKSH1.js → project-gridstack-CM783oKI.js} +1 -1
- package/dist/react/block.d.ts.map +1 -1
- package/dist/react.js +13 -9
- package/dist/registry.devtools.test.d.ts +2 -0
- package/dist/registry.devtools.test.d.ts.map +1 -0
- package/dist/vue/block.d.ts.map +1 -1
- package/dist/vue.js +22 -4
- package/dist/web-components/ExtensionRoot.d.ts.map +1 -1
- package/dist/web-components/editor/editor-layout-controller.d.ts.map +1 -1
- package/dist/web-components/editor/gridstack-adapter.d.ts.map +1 -1
- package/dist/web-components/layout-mode-adapter.d.ts +6 -0
- package/dist/web-components/layout-mode-adapter.d.ts.map +1 -1
- package/dist/web-components-editor.js +11 -6
- package/dist/web-components-runtime.js +2 -2
- package/package.json +5 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
+
import { g as getInstrumentation, _ as __setDefinedBlocksReader } from "./index-JSv6UH_o.js";
|
|
4
5
|
import { reportBlockError, reportBlockWarning } from "./observability.js";
|
|
5
6
|
const createContext = (key) => key;
|
|
6
7
|
class ContextRequestEvent extends Event {
|
|
@@ -20,11 +21,13 @@ class ContextProvideEvent extends Event {
|
|
|
20
21
|
}
|
|
21
22
|
}
|
|
22
23
|
function provideContext(target, context, init) {
|
|
24
|
+
getInstrumentation().onContextProvided(context);
|
|
23
25
|
const ev = new ContextProvideEvent(context, init);
|
|
24
26
|
target.dispatchEvent(ev);
|
|
25
27
|
}
|
|
26
28
|
function injectContext(target, context) {
|
|
27
29
|
let value = void 0;
|
|
30
|
+
getInstrumentation().onContextRequested(context);
|
|
28
31
|
const ev = new ContextRequestEvent(context, (received) => {
|
|
29
32
|
value = received;
|
|
30
33
|
});
|
|
@@ -36,6 +39,7 @@ function injectContext(target, context) {
|
|
|
36
39
|
}
|
|
37
40
|
function subscribeContext(target, context, callback) {
|
|
38
41
|
let unsubscribeFunction = null;
|
|
42
|
+
getInstrumentation().onContextRequested(context);
|
|
39
43
|
const protocolCallback = (value, unsubscribe) => {
|
|
40
44
|
if (unsubscribe) {
|
|
41
45
|
unsubscribeFunction = unsubscribe;
|
|
@@ -583,6 +587,7 @@ function withWrapper(fn) {
|
|
|
583
587
|
});
|
|
584
588
|
rendered = createStubDefinition(block.type).render(block);
|
|
585
589
|
}
|
|
590
|
+
getInstrumentation().onBlockRendered(block, rendered);
|
|
586
591
|
if (wrapper === null) {
|
|
587
592
|
if (isEditorPreview()) {
|
|
588
593
|
wrapper = document.createElement(
|
|
@@ -610,6 +615,7 @@ function registerBlock(block) {
|
|
|
610
615
|
blockDefinitions.set(block.name, block);
|
|
611
616
|
stubDefinitionCache.delete(block.name);
|
|
612
617
|
registerBlockListeners.forEach((cb) => cb(block.name, block));
|
|
618
|
+
getInstrumentation().onBlockRegistered(block);
|
|
613
619
|
}
|
|
614
620
|
function onRegisterBlock(cb) {
|
|
615
621
|
registerBlockListeners.push(cb);
|
|
@@ -647,6 +653,7 @@ function defineBlockRuntime(name, opts) {
|
|
|
647
653
|
function getDefinedBlocks() {
|
|
648
654
|
return [...blockDefinitions.values()];
|
|
649
655
|
}
|
|
656
|
+
__setDefinedBlocksReader(getDefinedBlocks);
|
|
650
657
|
function createCeRenderer(name) {
|
|
651
658
|
function renderSlots(slots, block) {
|
|
652
659
|
if (!slots) {
|
|
@@ -694,9 +701,11 @@ function createCeRenderer(name) {
|
|
|
694
701
|
const el = document.createElement(name);
|
|
695
702
|
el.setAttribute("data-block-id", block.id);
|
|
696
703
|
el.setAttribute("data-block-type", block.type);
|
|
697
|
-
Object.entries(block
|
|
698
|
-
|
|
699
|
-
|
|
704
|
+
Object.entries(getInstrumentation().resolveProps(block)).forEach(
|
|
705
|
+
([key, value]) => {
|
|
706
|
+
el[key] = value;
|
|
707
|
+
}
|
|
708
|
+
);
|
|
700
709
|
el.replaceChildren(...renderSlots(block.slots, block));
|
|
701
710
|
attachEmptyTracking(el);
|
|
702
711
|
return el;
|
|
@@ -1258,6 +1267,31 @@ function resolveLayout(doc, breakpointId) {
|
|
|
1258
1267
|
}
|
|
1259
1268
|
return deriveLayout(baseLayout, target);
|
|
1260
1269
|
}
|
|
1270
|
+
function classifyRowDividers(items, blockIds) {
|
|
1271
|
+
const leaderBlockIds = /* @__PURE__ */ new Set();
|
|
1272
|
+
const rowBlockIds = /* @__PURE__ */ new Set();
|
|
1273
|
+
const placed = blockIds.filter((id) => items[id] != null);
|
|
1274
|
+
if (placed.length === 0) return { leaderBlockIds, rowBlockIds };
|
|
1275
|
+
const rects = placed.map((id) => items[id]);
|
|
1276
|
+
const minRow = Math.min(...rects.map((rect) => rect.r));
|
|
1277
|
+
const boundaryIsCrossed = (boundary) => rects.some((rect) => rect.r < boundary && rect.r + rect.h > boundary);
|
|
1278
|
+
const ordered = [...placed].sort((a2, b2) => {
|
|
1279
|
+
const ra = items[a2];
|
|
1280
|
+
const rb = items[b2];
|
|
1281
|
+
return ra.r - rb.r || ra.c - rb.c;
|
|
1282
|
+
});
|
|
1283
|
+
let lastLeaderRow = null;
|
|
1284
|
+
for (const id of ordered) {
|
|
1285
|
+
const { r: r2 } = items[id];
|
|
1286
|
+
if (r2 <= minRow || boundaryIsCrossed(r2)) continue;
|
|
1287
|
+
rowBlockIds.add(id);
|
|
1288
|
+
if (r2 !== lastLeaderRow) {
|
|
1289
|
+
leaderBlockIds.add(id);
|
|
1290
|
+
lastLeaderRow = r2;
|
|
1291
|
+
}
|
|
1292
|
+
}
|
|
1293
|
+
return { leaderBlockIds, rowBlockIds };
|
|
1294
|
+
}
|
|
1261
1295
|
function containerRule(scope, grid) {
|
|
1262
1296
|
return `${scope}{display:grid;grid-template-columns:repeat(${grid.cols},minmax(0,1fr));--juo-layout-cols:${grid.cols};--juo-layout-gap:var(--juo-layout-spacing,${grid.gap}px);column-gap:var(--juo-layout-gap);row-gap:0;margin-block-end:calc(-1 * var(--juo-layout-gap));}`;
|
|
1263
1297
|
}
|
|
@@ -1267,13 +1301,22 @@ function baseSpacingRule(scope) {
|
|
|
1267
1301
|
function collapseRule(scope) {
|
|
1268
1302
|
return `${scope} > [data-empty],${scope} > :has(> [data-empty]){margin-block-end:0;}`;
|
|
1269
1303
|
}
|
|
1270
|
-
function itemRule(scope, blockId, rect) {
|
|
1271
|
-
return `${scope} > [data-block-id="${blockId}"]{grid-column:${rect.c + 1}/span ${rect.w};grid-row:${rect.r + 1}/span ${rect.h};--juo-layout-c:${rect.c};}`;
|
|
1304
|
+
function itemRule(scope, blockId, rect, divider) {
|
|
1305
|
+
return `${scope} > [data-block-id="${blockId}"]{grid-column:${rect.c + 1}/span ${rect.w};grid-row:${rect.r + 1}/span ${rect.h};--juo-layout-c:${rect.c};--juo-divider-row:${divider.row ? 1 : 0};--juo-divider-line:${divider.line ? 1 : 0};}`;
|
|
1272
1306
|
}
|
|
1273
|
-
function breakpointCss(scope, layout) {
|
|
1307
|
+
function breakpointCss(scope, layout, domOrder) {
|
|
1308
|
+
const { leaderBlockIds, rowBlockIds } = classifyRowDividers(
|
|
1309
|
+
layout.items,
|
|
1310
|
+
domOrder
|
|
1311
|
+
);
|
|
1274
1312
|
const rules = [containerRule(scope, layout.grid)];
|
|
1275
1313
|
for (const blockId of Object.keys(layout.items)) {
|
|
1276
|
-
rules.push(
|
|
1314
|
+
rules.push(
|
|
1315
|
+
itemRule(scope, blockId, layout.items[blockId], {
|
|
1316
|
+
row: rowBlockIds.has(blockId),
|
|
1317
|
+
line: leaderBlockIds.has(blockId)
|
|
1318
|
+
})
|
|
1319
|
+
);
|
|
1277
1320
|
}
|
|
1278
1321
|
return rules.join("");
|
|
1279
1322
|
}
|
|
@@ -1335,7 +1378,7 @@ function projectToCss(doc, opts) {
|
|
|
1335
1378
|
const baseLayout = resolveLayout(doc, base.id);
|
|
1336
1379
|
const domOrder = opts.domOrder ?? Object.keys(baseLayout.items);
|
|
1337
1380
|
const parts = [
|
|
1338
|
-
breakpointCss(opts.scope, baseLayout),
|
|
1381
|
+
breakpointCss(opts.scope, baseLayout, domOrder),
|
|
1339
1382
|
baseSpacingRule(opts.scope),
|
|
1340
1383
|
collapseRule(opts.scope),
|
|
1341
1384
|
reclaimCss(opts.scope, baseLayout, domOrder)
|
|
@@ -1343,7 +1386,7 @@ function projectToCss(doc, opts) {
|
|
|
1343
1386
|
for (const bp of doc.breakpoints.slice(1)) {
|
|
1344
1387
|
if (!bp.query) continue;
|
|
1345
1388
|
parts.push(
|
|
1346
|
-
`@container (max-width:${bp.query.maxWidth}px){` + breakpointCss(opts.scope, resolveLayout(doc, bp.id)) + `}`
|
|
1389
|
+
`@container (max-width:${bp.query.maxWidth}px){` + breakpointCss(opts.scope, resolveLayout(doc, bp.id), domOrder) + `}`
|
|
1347
1390
|
);
|
|
1348
1391
|
}
|
|
1349
1392
|
return parts.join("");
|
|
@@ -1362,77 +1405,72 @@ function createDefaultLayoutDocument(blockIds) {
|
|
|
1362
1405
|
}
|
|
1363
1406
|
};
|
|
1364
1407
|
}
|
|
1365
|
-
function
|
|
1408
|
+
function colsForBreakpoint(doc, breakpointId, layout) {
|
|
1366
1409
|
var _a;
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
if (!baseId) return createDefaultLayoutDocument(blockIds);
|
|
1371
|
-
const layout = next.layouts[baseId] ?? { grid: { ...DEFAULT_GRID }, items: {} };
|
|
1410
|
+
return ((_a = doc.breakpoints.find((b2) => b2.id === breakpointId)) == null ? void 0 : _a.cols) ?? layout.grid.cols;
|
|
1411
|
+
}
|
|
1412
|
+
function reconcileBreakpointLayout(layout, blockIds, cols) {
|
|
1372
1413
|
const known = new Set(blockIds);
|
|
1373
1414
|
for (const id of Object.keys(layout.items)) {
|
|
1374
1415
|
if (!known.has(id)) delete layout.items[id];
|
|
1375
1416
|
}
|
|
1376
1417
|
for (const id of blockIds) {
|
|
1377
1418
|
if (!layout.items[id]) {
|
|
1378
|
-
layout.items[id] = findFreeRect(
|
|
1379
|
-
layout.items,
|
|
1380
|
-
{ w: layout.grid.cols, h: 1 },
|
|
1381
|
-
layout.grid.cols
|
|
1382
|
-
);
|
|
1419
|
+
layout.items[id] = findFreeRect(layout.items, { w: cols, h: 1 }, cols);
|
|
1383
1420
|
}
|
|
1384
1421
|
}
|
|
1385
|
-
next.layouts[baseId] = layout;
|
|
1386
|
-
return next;
|
|
1387
1422
|
}
|
|
1388
|
-
function
|
|
1423
|
+
function reconcileLayout(doc, blockIds) {
|
|
1389
1424
|
var _a;
|
|
1390
|
-
if (!doc) return
|
|
1425
|
+
if (!doc) return createDefaultLayoutDocument(blockIds);
|
|
1391
1426
|
const next = structuredClone(doc);
|
|
1392
1427
|
const baseId = (_a = next.breakpoints[0]) == null ? void 0 : _a.id;
|
|
1393
|
-
if (!baseId) return
|
|
1394
|
-
const
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1428
|
+
if (!baseId) return createDefaultLayoutDocument(blockIds);
|
|
1429
|
+
for (const def of DEFAULT_BREAKPOINTS) {
|
|
1430
|
+
if (!next.breakpoints.some((b2) => b2.id === def.id)) {
|
|
1431
|
+
next.breakpoints.push(structuredClone(def));
|
|
1432
|
+
}
|
|
1433
|
+
}
|
|
1434
|
+
next.layouts[baseId] = next.layouts[baseId] ?? {
|
|
1435
|
+
grid: { ...DEFAULT_GRID },
|
|
1436
|
+
items: {}
|
|
1437
|
+
};
|
|
1438
|
+
for (const breakpointId of Object.keys(next.layouts)) {
|
|
1439
|
+
const layout = next.layouts[breakpointId];
|
|
1440
|
+
if (!layout) continue;
|
|
1441
|
+
reconcileBreakpointLayout(
|
|
1442
|
+
layout,
|
|
1443
|
+
blockIds,
|
|
1444
|
+
colsForBreakpoint(next, breakpointId, layout)
|
|
1445
|
+
);
|
|
1446
|
+
}
|
|
1398
1447
|
return next;
|
|
1399
1448
|
}
|
|
1400
|
-
function
|
|
1401
|
-
var _a;
|
|
1449
|
+
function compactLayoutDocument(doc) {
|
|
1402
1450
|
if (!doc) return doc;
|
|
1403
1451
|
const next = structuredClone(doc);
|
|
1404
|
-
const
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1452
|
+
for (const breakpointId of Object.keys(next.layouts)) {
|
|
1453
|
+
const layout = next.layouts[breakpointId];
|
|
1454
|
+
if (!layout) continue;
|
|
1455
|
+
layout.items = compactItems(
|
|
1456
|
+
layout.items,
|
|
1457
|
+
colsForBreakpoint(next, breakpointId, layout)
|
|
1458
|
+
);
|
|
1459
|
+
}
|
|
1410
1460
|
return next;
|
|
1411
1461
|
}
|
|
1412
|
-
function
|
|
1413
|
-
|
|
1414
|
-
const
|
|
1415
|
-
const
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
const rb = items[b2];
|
|
1423
|
-
return ra.r - rb.r || ra.c - rb.c;
|
|
1424
|
-
});
|
|
1425
|
-
let lastLeaderRow = null;
|
|
1426
|
-
for (const id of ordered) {
|
|
1427
|
-
const { r: r2 } = items[id];
|
|
1428
|
-
if (r2 <= minRow || boundaryIsCrossed(r2)) continue;
|
|
1429
|
-
rowBlockIds.add(id);
|
|
1430
|
-
if (r2 !== lastLeaderRow) {
|
|
1431
|
-
leaderBlockIds.add(id);
|
|
1432
|
-
lastLeaderRow = r2;
|
|
1433
|
-
}
|
|
1462
|
+
function expandFillLayoutDocument(doc) {
|
|
1463
|
+
if (!doc) return doc;
|
|
1464
|
+
const next = structuredClone(doc);
|
|
1465
|
+
for (const breakpointId of Object.keys(next.layouts)) {
|
|
1466
|
+
const layout = next.layouts[breakpointId];
|
|
1467
|
+
if (!layout) continue;
|
|
1468
|
+
layout.items = applyFillExpansion(
|
|
1469
|
+
layout.items,
|
|
1470
|
+
colsForBreakpoint(next, breakpointId, layout)
|
|
1471
|
+
);
|
|
1434
1472
|
}
|
|
1435
|
-
return
|
|
1473
|
+
return next;
|
|
1436
1474
|
}
|
|
1437
1475
|
const LAYOUT_SCOPE_ATTR = "data-juo-layout";
|
|
1438
1476
|
function layoutScopeSelector(scopeId) {
|
|
@@ -1467,66 +1505,66 @@ function buildGridLayout(layout, blockIds, scopeId) {
|
|
|
1467
1505
|
};
|
|
1468
1506
|
}
|
|
1469
1507
|
export {
|
|
1470
|
-
|
|
1471
|
-
|
|
1508
|
+
layoutScopeSelector as $,
|
|
1509
|
+
attachEmptyTracking as A,
|
|
1472
1510
|
BlockWrapperEvent as B,
|
|
1473
|
-
|
|
1511
|
+
ContextRoot as C,
|
|
1474
1512
|
DEFAULT_GRID as D,
|
|
1475
1513
|
E,
|
|
1476
|
-
|
|
1514
|
+
buildLayoutCss as F,
|
|
1477
1515
|
GRID_V1_ENGINE_ID as G,
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1516
|
+
classifyRowDividers as H,
|
|
1517
|
+
compactLayoutDocument as I,
|
|
1518
|
+
createBlockInstanceFromJSON as J,
|
|
1519
|
+
createBlockInstanceFromObject as K,
|
|
1482
1520
|
LAYOUT_SCOPE_ATTR as L,
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1521
|
+
MAX_BLOCKS_PER_ROW as M,
|
|
1522
|
+
createCeRenderer as N,
|
|
1523
|
+
createDefaultLayoutDocument as O,
|
|
1486
1524
|
PAGE_ROOT_SLOT as P,
|
|
1487
|
-
|
|
1488
|
-
|
|
1525
|
+
createSelectedBlock as Q,
|
|
1526
|
+
createThemeState as R,
|
|
1489
1527
|
SelectedBlockContext as S,
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
d,
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1528
|
+
TranslationContext as T,
|
|
1529
|
+
createTranslationService as U,
|
|
1530
|
+
defineBlockRuntime as V,
|
|
1531
|
+
deriveLayout as W,
|
|
1532
|
+
expandFillLayoutDocument as X,
|
|
1533
|
+
hasRenderedContent as Y,
|
|
1534
|
+
indexOverrides as Z,
|
|
1535
|
+
isEditorPreview as _,
|
|
1536
|
+
isStubDefinition as a,
|
|
1537
|
+
layoutSystemEnabled as a0,
|
|
1538
|
+
projectToCss as a1,
|
|
1539
|
+
provideContext as a2,
|
|
1540
|
+
readingOrder as a3,
|
|
1541
|
+
rectsOverlap as a4,
|
|
1542
|
+
serializeBlocks as a5,
|
|
1543
|
+
setLayoutSystemEnabled as a6,
|
|
1544
|
+
n as a7,
|
|
1545
|
+
buildGridLayout as b,
|
|
1546
|
+
ThemeStateContext as c,
|
|
1547
|
+
backfillInstanceDefaults as d,
|
|
1548
|
+
reconcileLayout as e,
|
|
1549
|
+
createContext as f,
|
|
1550
|
+
d as g,
|
|
1551
|
+
w as h,
|
|
1552
|
+
injectContext as i,
|
|
1553
|
+
registerBlock as j,
|
|
1554
|
+
getDefinedBlocks as k,
|
|
1555
|
+
createBlockInstance as l,
|
|
1556
|
+
defineBlock as m,
|
|
1557
|
+
clampRect as n,
|
|
1558
|
+
onRegisterBlock as o,
|
|
1559
|
+
applyFillExpansion as p,
|
|
1560
|
+
compactItems as q,
|
|
1561
|
+
resolveLayout as r,
|
|
1524
1562
|
subscribeContext as s,
|
|
1525
|
-
|
|
1563
|
+
findFreeRect as t,
|
|
1526
1564
|
u,
|
|
1527
|
-
|
|
1528
|
-
w,
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1565
|
+
ContextProvideEvent as v,
|
|
1566
|
+
withWrapper as w,
|
|
1567
|
+
ContextRequestEvent as x,
|
|
1568
|
+
DEFAULT_BREAKPOINTS as y,
|
|
1569
|
+
DEFAULT_GLOBAL_STYLES as z
|
|
1532
1570
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/devtools/env.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM,EAMJ,OAAO,UAAU,CAAC;AAEjC,eAAO,MAAM,SAAS,SAAgC,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { DevtoolsEvent, DevtoolsEventKind, PropsSchema } from './protocol';
|
|
2
|
+
/**
|
|
3
|
+
* The page-side resolver surface the framework (`blocks/core`) publishes on the
|
|
4
|
+
* hook so a backend running in a *separate bundle* (e.g. an injected extension
|
|
5
|
+
* script) can read/write live block state without importing `@juo/blocks`.
|
|
6
|
+
* Tree + picker are NOT here — the backend derives them from the DOM.
|
|
7
|
+
*/
|
|
8
|
+
export interface DevtoolsResolverSurface {
|
|
9
|
+
getBlockState(id: string): {
|
|
10
|
+
props: Record<string, unknown>;
|
|
11
|
+
propsSchema: PropsSchema;
|
|
12
|
+
} | null;
|
|
13
|
+
setBlockProp(id: string, key: string, value: unknown): {
|
|
14
|
+
props: Record<string, unknown>;
|
|
15
|
+
} | null;
|
|
16
|
+
/** Registry name → editor display label (displayName ?? name). */
|
|
17
|
+
getBlockCatalog(): Record<string, string>;
|
|
18
|
+
}
|
|
19
|
+
export interface JuoBlocksDevtoolsHook {
|
|
20
|
+
readonly version: number;
|
|
21
|
+
emit(kind: DevtoolsEventKind, payload: Record<string, unknown>): void;
|
|
22
|
+
on(cb: (e: DevtoolsEvent) => void): () => void;
|
|
23
|
+
off(cb: (e: DevtoolsEvent) => void): void;
|
|
24
|
+
/** Attached by `blocks/core` on first lifecycle emit; undefined until then. */
|
|
25
|
+
resolvers?: DevtoolsResolverSurface;
|
|
26
|
+
/**
|
|
27
|
+
* @internal Lazily-created `BlocksInstrumentation` implementation, cached
|
|
28
|
+
* here so it is shared across separately-bundled `block.ts` module instances.
|
|
29
|
+
*/
|
|
30
|
+
__instrumentation?: unknown;
|
|
31
|
+
}
|
|
32
|
+
declare global {
|
|
33
|
+
var __JUO_BLOCKS_DEVTOOLS_HOOK__: JuoBlocksDevtoolsHook | undefined;
|
|
34
|
+
}
|
|
35
|
+
export declare function createHook(): JuoBlocksDevtoolsHook;
|
|
36
|
+
/** Installs (idempotently) and returns the global hook. */
|
|
37
|
+
export declare function installHook(): JuoBlocksDevtoolsHook;
|
|
38
|
+
/** Returns the global hook if a shell has installed one, else undefined. */
|
|
39
|
+
export declare function getHook(): JuoBlocksDevtoolsHook | undefined;
|
|
40
|
+
//# sourceMappingURL=hook.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../src/devtools/hook.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,WAAW,EACjB,MAAM,YAAY,CAAC;AAIpB;;;;;GAKG;AACH,MAAM,WAAW,uBAAuB;IACtC,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG;QACzB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC/B,WAAW,EAA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AAqB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { BlockDefinition, BlockInstance } from '../block';
|
|
2
|
+
/** @internal Wires the block registry into the devtools instrumentation. */
|
|
3
|
+
export declare function __setDefinedBlocksReader(fn: () => BlockDefinition[]): void;
|
|
4
|
+
/**
|
|
5
|
+
* The single seam between the framework runtime and devtools.
|
|
6
|
+
*
|
|
7
|
+
* Regular code calls `getInstrumentation().X(...)` at each touchpoint — never
|
|
8
|
+
* `getHook()` and never a null check. In production (no devtools shell) the
|
|
9
|
+
* shared {@link noop} implementation is returned, so every call is a single
|
|
10
|
+
* global read followed by a do-nothing method (and `resolveProps` is the
|
|
11
|
+
* identity on `block.props`, with no allocation). When a devtools shell has
|
|
12
|
+
* installed the hook, the real implementation is created lazily and cached on
|
|
13
|
+
* the hook so it is shared across separately-bundled `block.ts` module
|
|
14
|
+
* instances (see `createDevtoolsInstrumentation`).
|
|
15
|
+
*/
|
|
16
|
+
export interface BlocksInstrumentation {
|
|
17
|
+
/** A block definition was registered. */
|
|
18
|
+
onBlockRegistered(def: BlockDefinition): void;
|
|
19
|
+
/** A block instance finished rendering into `el`. */
|
|
20
|
+
onBlockRendered(block: BlockInstance, el: HTMLElement): void;
|
|
21
|
+
/** A block instance was removed from the page (editor delete, cache prune, …). */
|
|
22
|
+
onBlockUnmounted(id: string): void;
|
|
23
|
+
/** A context value was provided. */
|
|
24
|
+
onContextProvided(context: unknown): void;
|
|
25
|
+
/** A context value was requested. */
|
|
26
|
+
onContextRequested(context: unknown): void;
|
|
27
|
+
/**
|
|
28
|
+
* Returns the props to render now: the block's base props merged with any
|
|
29
|
+
* recorded devtools override. The identity on `block.props` in production.
|
|
30
|
+
*/
|
|
31
|
+
resolveProps(block: BlockInstance): Record<string, unknown>;
|
|
32
|
+
/**
|
|
33
|
+
* Returns the props to render now and, for renderers that mount into a plain
|
|
34
|
+
* element (React/Preact/Vue) and aren't reactive to DOM property sets,
|
|
35
|
+
* registers a live setter that re-renders via `rerender` on each devtools
|
|
36
|
+
* edit. `getBaseProps` lets a renderer that keeps a live instance (Vue) supply
|
|
37
|
+
* its latest base props. Returns the base props (no setter) in production.
|
|
38
|
+
*/
|
|
39
|
+
bindLiveProps(block: BlockInstance, rerender: (props: Record<string, unknown>) => void, getBaseProps?: () => Record<string, unknown>): Record<string, unknown>;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Returns the active instrumentation. The no-op when no devtools shell has
|
|
43
|
+
* installed the hook; otherwise the real implementation, created lazily and
|
|
44
|
+
* cached on the hook so it is shared across module instances.
|
|
45
|
+
*/
|
|
46
|
+
export declare function getInstrumentation(): BlocksInstrumentation;
|
|
47
|
+
//# sourceMappingURL=instrumentation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instrumentation.d.ts","sourceRoot":"","sources":["../../src/devtools/instrumentation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAa/D,4EAA4E;AAC5E,wBAAgB,wBAAwB,CAAC,EAAE,EAAE,MAAM,eAAe,EAAE,GAAG,IAAI,CAE1E;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,qBAAqB;IACpC,yCAAyC;IACzC,iBAAiB,CAAC,GAAG,EAAE,eAAe,GAAG,IAAI,CAAC;IAC9C,qDAAqD;IACrD,eAAe,CAAC,KAAK,EAAE,aAAa,EAAE,EAAE,EAAE,WAAW,GAAG,IAAI,CAAC;IAC7D,kFAAkF;IAClF,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,oCAAoC;IACpC,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IAC1C,qCAAqC;IACrC,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IAC3C;;;OAGG;IACH,YAAY,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5D;;;;;;OAMG;IACH,aAAa,CACX,KAAK,EAAE,aAAa,EACpB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,EAClD,YAAY,CAAC,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC3C,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC5B;AAgLD;;;;GAIG;AACH,wBAAgB,kBAAkB,IAAI,qBAAqB,CAO1D"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
export declare const PROTOCOL_VERSION: 1;
|
|
2
|
+
export type BlockNode = {
|
|
3
|
+
id: string;
|
|
4
|
+
type: string;
|
|
5
|
+
slot: string | null;
|
|
6
|
+
parentId: string | null;
|
|
7
|
+
propKeys: string[];
|
|
8
|
+
};
|
|
9
|
+
/** A node in the DOM-derived, nested block tree. */
|
|
10
|
+
export type BlockTreeNode = {
|
|
11
|
+
id: string;
|
|
12
|
+
type: string;
|
|
13
|
+
slot: string | null;
|
|
14
|
+
children: BlockTreeNode[];
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* The `props` sub-schema of a block definition (a JSON Schema object), as used
|
|
18
|
+
* by the visual editor to pick controls. Carried to the panel so it can render
|
|
19
|
+
* controls that reflect each prop's real type (dropdowns for enums, color
|
|
20
|
+
* pickers, steppers, …) instead of guessing from the runtime value. JSON-safe.
|
|
21
|
+
*/
|
|
22
|
+
export type PropsSchema = {
|
|
23
|
+
type?: string;
|
|
24
|
+
properties?: Record<string, Record<string, unknown>>;
|
|
25
|
+
required?: string[];
|
|
26
|
+
[key: string]: unknown;
|
|
27
|
+
} | null;
|
|
28
|
+
export type DevtoolsEventKind = "block:registered" | "block:mounted" | "block:updated" | "block:unmounted" | "signal:changed" | "context:provide" | "context:request" | "block:picked" | "tree:changed";
|
|
29
|
+
export interface DevtoolsEvent {
|
|
30
|
+
v: typeof PROTOCOL_VERSION;
|
|
31
|
+
kind: DevtoolsEventKind;
|
|
32
|
+
ts: number;
|
|
33
|
+
payload: Record<string, unknown>;
|
|
34
|
+
}
|
|
35
|
+
/** Pull-on-demand RPC the engine (server) exposes to the client. */
|
|
36
|
+
export interface DevtoolsServerFns {
|
|
37
|
+
getSnapshot(): Promise<{
|
|
38
|
+
nodes: BlockNode[];
|
|
39
|
+
registered: string[];
|
|
40
|
+
/** Registry name → editor display label. */
|
|
41
|
+
blockLabels: Record<string, string>;
|
|
42
|
+
}>;
|
|
43
|
+
getBlockState(id: string): Promise<{
|
|
44
|
+
props: Record<string, unknown>;
|
|
45
|
+
propsSchema: PropsSchema;
|
|
46
|
+
} | null>;
|
|
47
|
+
/**
|
|
48
|
+
* Writes a single prop on a live block and returns its updated state.
|
|
49
|
+
* Works for custom-element blocks (the property set is reactive); the edit
|
|
50
|
+
* is a live tweak and may be overwritten if upstream data re-renders.
|
|
51
|
+
*/
|
|
52
|
+
setBlockProp(id: string, key: string, value: unknown): Promise<{
|
|
53
|
+
props: Record<string, unknown>;
|
|
54
|
+
} | null>;
|
|
55
|
+
/** Returns the live, nested block tree derived from the page DOM. */
|
|
56
|
+
getTree(): Promise<BlockTreeNode[]>;
|
|
57
|
+
highlight(id: string | null): Promise<void>;
|
|
58
|
+
/** Persistent outline for the currently selected block in the tree. */
|
|
59
|
+
highlightSelected(id: string | null): Promise<void>;
|
|
60
|
+
/**
|
|
61
|
+
* Scrolls the block's element into view in the page and briefly flashes the
|
|
62
|
+
* highlight box over it (auto-hiding after a short delay). Purely a viewport
|
|
63
|
+
* affordance — it does not change selection.
|
|
64
|
+
*/
|
|
65
|
+
scrollToBlock(id: string): Promise<void>;
|
|
66
|
+
/** Begins the page-side element picker; resolves immediately. The pick
|
|
67
|
+
* arrives later as a pushed `block:picked` event. */
|
|
68
|
+
startPicker(): Promise<void>;
|
|
69
|
+
/** Cancels the page-side element picker if active. */
|
|
70
|
+
stopPicker(): Promise<void>;
|
|
71
|
+
}
|
|
72
|
+
/** Functions the client exposes to the server (push notifications). */
|
|
73
|
+
export interface DevtoolsClientFns {
|
|
74
|
+
onEvent(e: DevtoolsEvent): void;
|
|
75
|
+
}
|
|
76
|
+
export declare function isDevtoolsEvent(x: unknown): x is DevtoolsEvent;
|
|
77
|
+
//# sourceMappingURL=protocol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/devtools/protocol.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,EAAG,CAAU,CAAC;AAE3C,MAAM,MAAM,SAAS,GAAG;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAEF,oDAAoD;AACpD,MAAM,MAAM,aAAa,GAAG;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,QAAQ,EAAE,aAAa,EAAE,CAAC;CAC3B,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACrD,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,GAAG,IAAI,CAAC;AAET,MAAM,MAAM,iBAAiB,GACzB,kBAAkB,GAClB,eAAe,GACf,eAAe,GACf,iBAAiB,GACjB,gBAAgB,GAChB,iBAAiB,GACjB,iBAAiB,GACjB,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MAAM,CAAC,QAAQ,CAAC,YAAY,CAAM;IAC1C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,iBAAiB,CAAK;IAE9C;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,mBAAmB,CAEzC;IAEF;;;;;;;;OAQG;IACH,OAAO,CAAC,sBAAsB;IAgC9B;;;;OAIG;IACH,OAAO,CAAC,mBAAmB;IAS3B,qEAAqE;IACrE,OAAO,CAAC,cAAc;IAWtB,QAAQ,CAAC,KAAK,EAAE,aAAa;CAS9B;AAMD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,iCAAiC,EAAE,kBAAkB,CAAC;KACvD;CACF"}
|
|
@@ -9,6 +9,12 @@ export type LayoutSetRectsEvent = {
|
|
|
9
9
|
surface: ThemeSurface;
|
|
10
10
|
id: string;
|
|
11
11
|
rects: Record<string, GridRect>;
|
|
12
|
+
/**
|
|
13
|
+
* Breakpoint the gesture was made against, so the parent engine writes the
|
|
14
|
+
* rects to that breakpoint's layout (e.g. `mobile`) instead of always the
|
|
15
|
+
* authored base. Optional for back-compat; the parent falls back to base.
|
|
16
|
+
*/
|
|
17
|
+
breakpoint?: string;
|
|
12
18
|
};
|
|
13
19
|
export type LayoutCommandEmitter = (event: LayoutSetRectsEvent) => void;
|
|
14
20
|
export declare function setLayoutCommandEmitter(emitter: LayoutCommandEmitter | null): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout-command-emitter.d.ts","sourceRoot":"","sources":["../../src/editor/layout-command-emitter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,YAAY,CAAC;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"layout-command-emitter.d.ts","sourceRoot":"","sources":["../../src/editor/layout-command-emitter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,YAAY,CAAC;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAChC;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,CAAC;AAcxE,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,oBAAoB,GAAG,IAAI,GACnC,IAAI,CAEN;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,mBAAmB,GAAG,IAAI,CAEnE;AAED;;;;;;GAMG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,EAAE,YAAY,CAAC;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,aAAa,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;AAI1E,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,uBAAuB,GAAG,IAAI,GACzC,IAAI,CAEN;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,kBAAkB,GAAG,IAAI,CAEjE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/editor/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,aAAa,EAQnB,MAAM,aAAa,CAAC;AASrB,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAmD7B,eAAO,MAAM,0BAA0B,KAAK,CAAC;AAC7C,kFAAkF;AAClF,eAAO,MAAM,6BAA6B,KAAK,CAAC;AAEhD,wBAAgB,6BAA6B,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,CAM7E;AAED;;;;;;GAMG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE;IAAE,aAAa,EAAE,aAAa,CAAC;IAAC,UAAU,EAAE,UAAU,CAAA;CAAE,GAC7D,OAAO,CAAC,MAAM,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/editor/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,aAAa,EAQnB,MAAM,aAAa,CAAC;AASrB,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAmD7B,eAAO,MAAM,0BAA0B,KAAK,CAAC;AAC7C,kFAAkF;AAClF,eAAO,MAAM,6BAA6B,KAAK,CAAC;AAEhD,wBAAgB,6BAA6B,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,CAM7E;AAED;;;;;;GAMG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE;IAAE,aAAa,EAAE,aAAa,CAAC;IAAC,UAAU,EAAE,UAAU,CAAA;CAAE,GAC7D,OAAO,CAAC,MAAM,IAAI,CAAC,CAiFrB"}
|