@juo/blocks 1.14.0 → 1.16.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.
Files changed (144) hide show
  1. package/dist/{ExtensionRoot-CRJx0Dtr.js → ExtensionRoot-C3lVJEBl.js} +9 -2
  2. package/dist/{block-VhmfGB3N.js → block-dVP4Rqgz.js} +9 -0
  3. package/dist/block.d.ts.map +1 -1
  4. package/dist/block.devtools.test.d.ts +2 -0
  5. package/dist/block.devtools.test.d.ts.map +1 -0
  6. package/dist/{bridge-D838SWmN.js → bridge-xiKEzCGR.js} +30 -30
  7. package/dist/context.d.ts.map +1 -1
  8. package/dist/context.devtools.test.d.ts +2 -0
  9. package/dist/context.devtools.test.d.ts.map +1 -0
  10. package/dist/core.js +2390 -465
  11. package/dist/{css-runtime-DWytAzZ5.js → css-runtime-ClH0MEYr.js} +151 -113
  12. package/dist/devtools/env.d.ts +3 -0
  13. package/dist/devtools/env.d.ts.map +1 -0
  14. package/dist/devtools/hook.d.ts +40 -0
  15. package/dist/devtools/hook.d.ts.map +1 -0
  16. package/dist/devtools/index.d.ts +5 -0
  17. package/dist/devtools/index.d.ts.map +1 -0
  18. package/dist/devtools/instrumentation.d.ts +47 -0
  19. package/dist/devtools/instrumentation.d.ts.map +1 -0
  20. package/dist/devtools/protocol.d.ts +77 -0
  21. package/dist/devtools/protocol.d.ts.map +1 -0
  22. package/dist/devtools.js +11 -0
  23. package/dist/editor/components.d.ts.map +1 -1
  24. package/dist/editor/layout-command-emitter.d.ts +6 -0
  25. package/dist/editor/layout-command-emitter.d.ts.map +1 -1
  26. package/dist/editor/main.d.ts.map +1 -1
  27. package/dist/editor/messages.d.ts +6 -0
  28. package/dist/editor/messages.d.ts.map +1 -1
  29. package/dist/editor.js +74 -67
  30. package/dist/{gridstack-adapter-DreG3XnB.js → gridstack-adapter-CDWbSpbt.js} +15 -16
  31. package/dist/index-JSv6UH_o.js +169 -0
  32. package/dist/layout/index.d.ts +1 -0
  33. package/dist/layout/index.d.ts.map +1 -1
  34. package/dist/layout/insert.d.ts +14 -11
  35. package/dist/layout/insert.d.ts.map +1 -1
  36. package/dist/layout/override.d.ts +10 -0
  37. package/dist/layout/override.d.ts.map +1 -0
  38. package/dist/layout/override.test.d.ts +2 -0
  39. package/dist/layout/override.test.d.ts.map +1 -0
  40. package/dist/layout/project-css.d.ts.map +1 -1
  41. package/dist/layout/reconcile.d.ts +4 -3
  42. package/dist/layout/reconcile.d.ts.map +1 -1
  43. package/dist/{morph-Dj-xvrwt.js → morph-n4LMxOYo.js} +1 -1
  44. package/dist/preact/block.d.ts.map +1 -1
  45. package/dist/preact.js +16 -12
  46. package/dist/{project-gridstack-DYLMKSH1.js → project-gridstack-CM783oKI.js} +1 -1
  47. package/dist/react/block.d.ts.map +1 -1
  48. package/dist/react.js +15 -11
  49. package/dist/registry.devtools.test.d.ts +2 -0
  50. package/dist/registry.devtools.test.d.ts.map +1 -0
  51. package/dist/services/customer/adapter.d.ts +8 -0
  52. package/dist/services/customer/adapter.d.ts.map +1 -0
  53. package/dist/services/customer/customerService.d.ts +3 -2
  54. package/dist/services/customer/customerService.d.ts.map +1 -1
  55. package/dist/services/customer/index.d.ts +1 -0
  56. package/dist/services/customer/index.d.ts.map +1 -1
  57. package/dist/services/customer/types.d.ts +4 -1
  58. package/dist/services/customer/types.d.ts.map +1 -1
  59. package/dist/services/index.d.ts +3 -0
  60. package/dist/services/index.d.ts.map +1 -1
  61. package/dist/services/login/adapter.d.ts +33 -0
  62. package/dist/services/login/adapter.d.ts.map +1 -0
  63. package/dist/services/login/index.d.ts +3 -1
  64. package/dist/services/login/index.d.ts.map +1 -1
  65. package/dist/services/login/loginService.d.ts +6 -2
  66. package/dist/services/login/loginService.d.ts.map +1 -1
  67. package/dist/services/order/adapter.d.ts +9 -0
  68. package/dist/services/order/adapter.d.ts.map +1 -0
  69. package/dist/services/order/index.d.ts +5 -0
  70. package/dist/services/order/index.d.ts.map +1 -0
  71. package/dist/services/order/orderService.d.ts +7 -0
  72. package/dist/services/order/orderService.d.ts.map +1 -0
  73. package/dist/services/order/types.d.ts +21 -0
  74. package/dist/services/order/types.d.ts.map +1 -0
  75. package/dist/services/orders/adapter.d.ts +2 -0
  76. package/dist/services/orders/adapter.d.ts.map +1 -1
  77. package/dist/services/orders/index.d.ts +1 -1
  78. package/dist/services/orders/index.d.ts.map +1 -1
  79. package/dist/services/product/adapter.d.ts +27 -2
  80. package/dist/services/product/adapter.d.ts.map +1 -1
  81. package/dist/services/product/adapter.test.d.ts +2 -0
  82. package/dist/services/product/adapter.test.d.ts.map +1 -0
  83. package/dist/services/product/index.d.ts +1 -1
  84. package/dist/services/product/index.d.ts.map +1 -1
  85. package/dist/services/product/productService.d.ts.map +1 -1
  86. package/dist/services/product/types.d.ts +68 -0
  87. package/dist/services/product/types.d.ts.map +1 -1
  88. package/dist/services/schedules/adapter.d.ts +94 -0
  89. package/dist/services/schedules/adapter.d.ts.map +1 -0
  90. package/dist/services/schedules/adapter.test.d.ts +2 -0
  91. package/dist/services/schedules/adapter.test.d.ts.map +1 -0
  92. package/dist/services/schedules/apiSchedulesAdapter.test.d.ts +2 -0
  93. package/dist/services/schedules/apiSchedulesAdapter.test.d.ts.map +1 -0
  94. package/dist/services/schedules/index.d.ts +5 -0
  95. package/dist/services/schedules/index.d.ts.map +1 -0
  96. package/dist/services/schedules/schedulesService.d.ts +11 -0
  97. package/dist/services/schedules/schedulesService.d.ts.map +1 -0
  98. package/dist/services/schedules/schedulesService.test.d.ts +2 -0
  99. package/dist/services/schedules/schedulesService.test.d.ts.map +1 -0
  100. package/dist/services/schedules/types.d.ts +290 -0
  101. package/dist/services/schedules/types.d.ts.map +1 -0
  102. package/dist/services/settings/index.d.ts +3 -0
  103. package/dist/services/settings/index.d.ts.map +1 -0
  104. package/dist/services/settings/settingsService.d.ts +7 -0
  105. package/dist/services/settings/settingsService.d.ts.map +1 -0
  106. package/dist/services/settings/settingsService.test.d.ts +2 -0
  107. package/dist/services/settings/settingsService.test.d.ts.map +1 -0
  108. package/dist/services/settings/types.d.ts +35 -0
  109. package/dist/services/settings/types.d.ts.map +1 -0
  110. package/dist/services/shop/index.d.ts +3 -0
  111. package/dist/services/shop/index.d.ts.map +1 -0
  112. package/dist/services/shop/shopService.d.ts +12 -0
  113. package/dist/services/shop/shopService.d.ts.map +1 -0
  114. package/dist/services/shop/shopService.test.d.ts +2 -0
  115. package/dist/services/shop/shopService.test.d.ts.map +1 -0
  116. package/dist/services/shop/types.d.ts +7 -0
  117. package/dist/services/shop/types.d.ts.map +1 -0
  118. package/dist/services/subscription/adapter.d.ts +77 -2
  119. package/dist/services/subscription/adapter.d.ts.map +1 -1
  120. package/dist/services/subscription/adapter.test.d.ts +2 -0
  121. package/dist/services/subscription/adapter.test.d.ts.map +1 -0
  122. package/dist/services/subscription/index.d.ts +1 -1
  123. package/dist/services/subscription/index.d.ts.map +1 -1
  124. package/dist/services/subscription/subscriptionService.d.ts +1 -6
  125. package/dist/services/subscription/subscriptionService.d.ts.map +1 -1
  126. package/dist/services/subscription/types.d.ts +220 -9
  127. package/dist/services/subscription/types.d.ts.map +1 -1
  128. package/dist/services/subscription/types.test.d.ts +2 -0
  129. package/dist/services/subscription/types.test.d.ts.map +1 -0
  130. package/dist/shared/context.d.ts.map +1 -1
  131. package/dist/utils/index.d.ts +6 -0
  132. package/dist/utils/index.d.ts.map +1 -1
  133. package/dist/vue/block.d.ts.map +1 -1
  134. package/dist/vue/context.d.ts +1 -0
  135. package/dist/vue/context.d.ts.map +1 -1
  136. package/dist/vue.js +34 -6
  137. package/dist/web-components/ExtensionRoot.d.ts.map +1 -1
  138. package/dist/web-components/editor/editor-layout-controller.d.ts.map +1 -1
  139. package/dist/web-components/editor/gridstack-adapter.d.ts.map +1 -1
  140. package/dist/web-components/layout-mode-adapter.d.ts +6 -0
  141. package/dist/web-components/layout-mode-adapter.d.ts.map +1 -1
  142. package/dist/web-components-editor.js +11 -6
  143. package/dist/web-components-runtime.js +2 -2
  144. 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.props).forEach(([key, value]) => {
698
- el[key] = value;
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(itemRule(scope, blockId, layout.items[blockId]));
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 reconcileLayout(doc, blockIds) {
1408
+ function colsForBreakpoint(doc, breakpointId, layout) {
1366
1409
  var _a;
1367
- if (!doc) return createDefaultLayoutDocument(blockIds);
1368
- const next = structuredClone(doc);
1369
- const baseId = (_a = next.breakpoints[0]) == null ? void 0 : _a.id;
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 compactLayoutDocument(doc) {
1423
+ function reconcileLayout(doc, blockIds) {
1389
1424
  var _a;
1390
- if (!doc) return doc;
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 next;
1394
- const layout = next.layouts[baseId];
1395
- if (!layout) return next;
1396
- layout.items = compactItems(layout.items, layout.grid.cols);
1397
- next.layouts[baseId] = layout;
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 expandFillLayoutDocument(doc) {
1401
- var _a;
1449
+ function compactLayoutDocument(doc) {
1402
1450
  if (!doc) return doc;
1403
1451
  const next = structuredClone(doc);
1404
- const baseId = (_a = next.breakpoints[0]) == null ? void 0 : _a.id;
1405
- if (!baseId) return next;
1406
- const layout = next.layouts[baseId];
1407
- if (!layout) return next;
1408
- layout.items = applyFillExpansion(layout.items, layout.grid.cols);
1409
- next.layouts[baseId] = layout;
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 classifyRowDividers(items, blockIds) {
1413
- const leaderBlockIds = /* @__PURE__ */ new Set();
1414
- const rowBlockIds = /* @__PURE__ */ new Set();
1415
- const placed = blockIds.filter((id) => items[id] != null);
1416
- if (placed.length === 0) return { leaderBlockIds, rowBlockIds };
1417
- const rects = placed.map((id) => items[id]);
1418
- const minRow = Math.min(...rects.map((rect) => rect.r));
1419
- const boundaryIsCrossed = (boundary) => rects.some((rect) => rect.r < boundary && rect.r + rect.h > boundary);
1420
- const ordered = [...placed].sort((a2, b2) => {
1421
- const ra = items[a2];
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 { leaderBlockIds, rowBlockIds };
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
- reconcileLayout as $,
1471
- createDefaultLayoutDocument as A,
1508
+ layoutScopeSelector as $,
1509
+ attachEmptyTracking as A,
1472
1510
  BlockWrapperEvent as B,
1473
- ContextProvideEvent as C,
1511
+ ContextRoot as C,
1474
1512
  DEFAULT_GRID as D,
1475
1513
  E,
1476
- createSelectedBlock as F,
1514
+ buildLayoutCss as F,
1477
1515
  GRID_V1_ENGINE_ID as G,
1478
- createThemeState as H,
1479
- createTranslationService as I,
1480
- defineBlockRuntime as J,
1481
- deriveLayout as K,
1516
+ classifyRowDividers as H,
1517
+ compactLayoutDocument as I,
1518
+ createBlockInstanceFromJSON as J,
1519
+ createBlockInstanceFromObject as K,
1482
1520
  LAYOUT_SCOPE_ATTR as L,
1483
- expandFillLayoutDocument as M,
1484
- hasRenderedContent as N,
1485
- indexOverrides as O,
1521
+ MAX_BLOCKS_PER_ROW as M,
1522
+ createCeRenderer as N,
1523
+ createDefaultLayoutDocument as O,
1486
1524
  PAGE_ROOT_SLOT as P,
1487
- injectContext as Q,
1488
- isEditorPreview as R,
1525
+ createSelectedBlock as Q,
1526
+ createThemeState as R,
1489
1527
  SelectedBlockContext as S,
1490
- ThemeStateContext as T,
1491
- isStubDefinition as U,
1492
- layoutScopeSelector as V,
1493
- layoutSystemEnabled as W,
1494
- onRegisterBlock as X,
1495
- projectToCss as Y,
1496
- provideContext as Z,
1497
- readingOrder as _,
1498
- createBlockInstance as a,
1499
- rectsOverlap as a0,
1500
- resolveLayout as a1,
1501
- serializeBlocks as a2,
1502
- setLayoutSystemEnabled as a3,
1503
- n as a4,
1504
- withWrapper as a5,
1505
- ContextRoot as a6,
1506
- MAX_BLOCKS_PER_ROW as a7,
1507
- defineBlock as b,
1508
- createContext as c,
1509
- d,
1510
- clampRect as e,
1511
- applyFillExpansion as f,
1512
- getDefinedBlocks as g,
1513
- compactItems as h,
1514
- findFreeRect as i,
1515
- ContextRequestEvent as j,
1516
- DEFAULT_BREAKPOINTS as k,
1517
- DEFAULT_GLOBAL_STYLES as l,
1518
- TranslationContext as m,
1519
- attachEmptyTracking as n,
1520
- backfillInstanceDefaults as o,
1521
- buildGridLayout as p,
1522
- buildLayoutCss as q,
1523
- registerBlock as r,
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
- classifyRowDividers as t,
1563
+ findFreeRect as t,
1526
1564
  u,
1527
- compactLayoutDocument as v,
1528
- w,
1529
- createBlockInstanceFromJSON as x,
1530
- createBlockInstanceFromObject as y,
1531
- createCeRenderer as z
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,3 @@
1
+ export declare const target: typeof globalThis;
2
+ export declare const isBrowser: boolean;
3
+ //# sourceMappingURL=env.d.ts.map
@@ -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,K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
+ export * from './env';
2
+ export * from './protocol';
3
+ export * from './hook';
4
+ export { getInstrumentation, type BlocksInstrumentation } from './instrumentation';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/devtools/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,OAAO,EAAE,kBAAkB,EAAE,KAAK,qBAAqB,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,oDAAo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;;OAIG;IACH,YAAY,CACV,EAAE,EAAE,MAAM,EACV,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,OAAO,GACb,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,GAAG,IAAI,CAAC,CAAC;IACtD,qEAAqE;IACrE,OAAO,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;IACpC,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5C,uEAAuE;IACvE,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpD;;;;OAIG;IACH,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC;yDACqD;IACrD,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,sDAAsD;IACtD,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7B;AAED,uEAAuE;AACvE,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;CACjC;AAED,wBAAgB,eAAe,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,aAAa,CAQ9D"}
@@ -0,0 +1,11 @@
1
+ import { P, c, a, g, i, b, d, t } from "./index-JSv6UH_o.js";
2
+ export {
3
+ P as PROTOCOL_VERSION,
4
+ c as createHook,
5
+ a as getHook,
6
+ g as getInstrumentation,
7
+ i as installHook,
8
+ b as isBrowser,
9
+ d as isDevtoolsEvent,
10
+ t as target
11
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../src/editor/components.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AA+jB9C,qBAAa,YAAa,SAAQ,WAAW;I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AC,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;CACjC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,CAAC;AAcxE,wBAAg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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,CAgFrB"}
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"}