@juo/blocks 1.13.0-alpha.2 → 1.14.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 (246) hide show
  1. package/dist/ExtensionRoot-CRJx0Dtr.js +378 -0
  2. package/dist/block.d.ts +0 -50
  3. package/dist/block.d.ts.map +1 -1
  4. package/dist/{bridge-r7Yk8fjY.js → bridge-D838SWmN.js} +147 -42
  5. package/dist/context.d.ts.map +1 -1
  6. package/dist/core.js +1120 -2157
  7. package/dist/css-runtime-DWytAzZ5.js +1532 -0
  8. package/dist/editor/bridge.d.ts +8 -7
  9. package/dist/editor/bridge.d.ts.map +1 -1
  10. package/dist/editor/canvas-mode-signal.d.ts +22 -0
  11. package/dist/editor/canvas-mode-signal.d.ts.map +1 -0
  12. package/dist/editor/canvas-mode.d.ts +15 -0
  13. package/dist/editor/canvas-mode.d.ts.map +1 -0
  14. package/dist/editor/canvas-mode.test.d.ts +2 -0
  15. package/dist/editor/canvas-mode.test.d.ts.map +1 -0
  16. package/dist/editor/components.d.ts +113 -0
  17. package/dist/editor/components.d.ts.map +1 -1
  18. package/dist/editor/components.test.d.ts.map +1 -1
  19. package/dist/editor/handler.d.ts.map +1 -1
  20. package/dist/editor/handler.test.d.ts +2 -0
  21. package/dist/editor/handler.test.d.ts.map +1 -0
  22. package/dist/editor/layout-command-emitter.d.ts +31 -0
  23. package/dist/editor/layout-command-emitter.d.ts.map +1 -0
  24. package/dist/editor/layout-command-emitter.test.d.ts +2 -0
  25. package/dist/editor/layout-command-emitter.test.d.ts.map +1 -0
  26. package/dist/editor/layout-system-signal.d.ts +21 -0
  27. package/dist/editor/layout-system-signal.d.ts.map +1 -0
  28. package/dist/editor/main.d.ts +2 -2
  29. package/dist/editor/main.d.ts.map +1 -1
  30. package/dist/editor/messages.d.ts +90 -14
  31. package/dist/editor/messages.d.ts.map +1 -1
  32. package/dist/editor/surface-context.d.ts +7 -0
  33. package/dist/editor/surface-context.d.ts.map +1 -0
  34. package/dist/editor/surface-context.test.d.ts +2 -0
  35. package/dist/editor/surface-context.test.d.ts.map +1 -0
  36. package/dist/editor/wrapper-shared.d.ts +31 -0
  37. package/dist/editor/wrapper-shared.d.ts.map +1 -0
  38. package/dist/editor.js +887 -88
  39. package/dist/flows/WorkflowService.d.ts +2 -0
  40. package/dist/flows/WorkflowService.d.ts.map +1 -1
  41. package/dist/gridstack-adapter-DreG3XnB.js +5490 -0
  42. package/dist/layout/css-runtime.d.ts +41 -0
  43. package/dist/layout/css-runtime.d.ts.map +1 -0
  44. package/dist/layout/css-runtime.test.d.ts +2 -0
  45. package/dist/layout/css-runtime.test.d.ts.map +1 -0
  46. package/dist/layout/derive.d.ts +4 -0
  47. package/dist/layout/derive.d.ts.map +1 -0
  48. package/dist/layout/derive.test.d.ts +2 -0
  49. package/dist/layout/derive.test.d.ts.map +1 -0
  50. package/dist/layout/dividers.d.ts +34 -0
  51. package/dist/layout/dividers.d.ts.map +1 -0
  52. package/dist/layout/dividers.test.d.ts +2 -0
  53. package/dist/layout/dividers.test.d.ts.map +1 -0
  54. package/dist/layout/engine.d.ts +3 -0
  55. package/dist/layout/engine.d.ts.map +1 -0
  56. package/dist/layout/engine.test.d.ts +2 -0
  57. package/dist/layout/engine.test.d.ts.map +1 -0
  58. package/dist/layout/grid-utils.d.ts +57 -0
  59. package/dist/layout/grid-utils.d.ts.map +1 -0
  60. package/dist/layout/grid-utils.test.d.ts +2 -0
  61. package/dist/layout/grid-utils.test.d.ts.map +1 -0
  62. package/dist/layout/index.d.ts +12 -0
  63. package/dist/layout/index.d.ts.map +1 -0
  64. package/dist/layout/index.test.d.ts +2 -0
  65. package/dist/layout/index.test.d.ts.map +1 -0
  66. package/dist/layout/insert.d.ts +31 -0
  67. package/dist/layout/insert.d.ts.map +1 -0
  68. package/dist/layout/insert.test.d.ts +2 -0
  69. package/dist/layout/insert.test.d.ts.map +1 -0
  70. package/dist/layout/project-css.d.ts +6 -0
  71. package/dist/layout/project-css.d.ts.map +1 -0
  72. package/dist/layout/project-css.test.d.ts +2 -0
  73. package/dist/layout/project-css.test.d.ts.map +1 -0
  74. package/dist/layout/project-gridstack.d.ts +50 -0
  75. package/dist/layout/project-gridstack.d.ts.map +1 -0
  76. package/dist/layout/project-gridstack.test.d.ts +2 -0
  77. package/dist/layout/project-gridstack.test.d.ts.map +1 -0
  78. package/dist/layout/reconcile.d.ts +22 -0
  79. package/dist/layout/reconcile.d.ts.map +1 -0
  80. package/dist/layout/reconcile.test.d.ts +2 -0
  81. package/dist/layout/reconcile.test.d.ts.map +1 -0
  82. package/dist/layout/types.d.ts +118 -0
  83. package/dist/layout/types.d.ts.map +1 -0
  84. package/dist/layout-mode-adapter-BBd4JRQd.js +21 -0
  85. package/dist/main.d.ts +8 -4
  86. package/dist/main.d.ts.map +1 -1
  87. package/dist/morph-Dj-xvrwt.js +182 -0
  88. package/dist/preact.js +1 -1
  89. package/dist/project-gridstack-DYLMKSH1.js +52 -0
  90. package/dist/react.js +1 -1
  91. package/dist/services/customer/customerService.d.ts +2 -3
  92. package/dist/services/customer/customerService.d.ts.map +1 -1
  93. package/dist/services/customer/index.d.ts +0 -1
  94. package/dist/services/customer/index.d.ts.map +1 -1
  95. package/dist/services/customer/types.d.ts +1 -4
  96. package/dist/services/customer/types.d.ts.map +1 -1
  97. package/dist/services/index.d.ts +0 -3
  98. package/dist/services/index.d.ts.map +1 -1
  99. package/dist/services/login/index.d.ts +1 -3
  100. package/dist/services/login/index.d.ts.map +1 -1
  101. package/dist/services/login/loginService.d.ts +2 -6
  102. package/dist/services/login/loginService.d.ts.map +1 -1
  103. package/dist/services/orders/adapter.d.ts +0 -2
  104. package/dist/services/orders/adapter.d.ts.map +1 -1
  105. package/dist/services/orders/index.d.ts +1 -1
  106. package/dist/services/orders/index.d.ts.map +1 -1
  107. package/dist/services/product/adapter.d.ts +2 -27
  108. package/dist/services/product/adapter.d.ts.map +1 -1
  109. package/dist/services/product/index.d.ts +1 -1
  110. package/dist/services/product/index.d.ts.map +1 -1
  111. package/dist/services/product/productService.d.ts.map +1 -1
  112. package/dist/services/product/types.d.ts +0 -68
  113. package/dist/services/product/types.d.ts.map +1 -1
  114. package/dist/services/subscription/adapter.d.ts +2 -77
  115. package/dist/services/subscription/adapter.d.ts.map +1 -1
  116. package/dist/services/subscription/index.d.ts +1 -1
  117. package/dist/services/subscription/index.d.ts.map +1 -1
  118. package/dist/services/subscription/subscriptionService.d.ts +6 -1
  119. package/dist/services/subscription/subscriptionService.d.ts.map +1 -1
  120. package/dist/services/subscription/types.d.ts +9 -220
  121. package/dist/services/subscription/types.d.ts.map +1 -1
  122. package/dist/theme-state.d.ts +17 -2
  123. package/dist/theme-state.d.ts.map +1 -1
  124. package/dist/theme-state.layout.test.d.ts +2 -0
  125. package/dist/theme-state.layout.test.d.ts.map +1 -0
  126. package/dist/theme-state.test.d.ts +2 -0
  127. package/dist/theme-state.test.d.ts.map +1 -0
  128. package/dist/utils/index.d.ts +0 -6
  129. package/dist/utils/index.d.ts.map +1 -1
  130. package/dist/vue/block.d.ts.map +1 -1
  131. package/dist/vue.js +4 -25
  132. package/dist/web-components/ExtensionRoot.d.ts +50 -3
  133. package/dist/web-components/ExtensionRoot.d.ts.map +1 -1
  134. package/dist/web-components/editor/ExtensionRoot.d.ts +11 -0
  135. package/dist/web-components/editor/ExtensionRoot.d.ts.map +1 -0
  136. package/dist/web-components/editor/ExtensionRoot.test.d.ts +2 -0
  137. package/dist/web-components/editor/ExtensionRoot.test.d.ts.map +1 -0
  138. package/dist/web-components/editor/InlineText.d.ts +1 -0
  139. package/dist/web-components/editor/InlineText.d.ts.map +1 -1
  140. package/dist/web-components/editor/editor-layout-controller.d.ts +28 -0
  141. package/dist/web-components/editor/editor-layout-controller.d.ts.map +1 -0
  142. package/dist/web-components/editor/gridstack-adapter.d.ts +3 -0
  143. package/dist/web-components/editor/gridstack-adapter.d.ts.map +1 -0
  144. package/dist/web-components/editor/gridstack-adapter.test.d.ts +2 -0
  145. package/dist/web-components/editor/gridstack-adapter.test.d.ts.map +1 -0
  146. package/dist/web-components/editor/morph.d.ts +32 -0
  147. package/dist/web-components/editor/morph.d.ts.map +1 -0
  148. package/dist/web-components/editor/morph.test.d.ts +2 -0
  149. package/dist/web-components/editor/morph.test.d.ts.map +1 -0
  150. package/dist/web-components/layout/layout-controller.d.ts +55 -0
  151. package/dist/web-components/layout/layout-controller.d.ts.map +1 -0
  152. package/dist/web-components/layout/view-layout-controller.d.ts +17 -0
  153. package/dist/web-components/layout/view-layout-controller.d.ts.map +1 -0
  154. package/dist/web-components/layout/view-layout-controller.test.d.ts +2 -0
  155. package/dist/web-components/layout/view-layout-controller.test.d.ts.map +1 -0
  156. package/dist/web-components/layout-grid.d.ts +47 -0
  157. package/dist/web-components/layout-grid.d.ts.map +1 -0
  158. package/dist/web-components/layout-grid.test.d.ts +2 -0
  159. package/dist/web-components/layout-grid.test.d.ts.map +1 -0
  160. package/dist/web-components/layout-mode-adapter.d.ts +51 -0
  161. package/dist/web-components/layout-mode-adapter.d.ts.map +1 -0
  162. package/dist/web-components/layout-mode-adapter.test.d.ts +2 -0
  163. package/dist/web-components/layout-mode-adapter.test.d.ts.map +1 -0
  164. package/dist/web-components-editor.js +125 -18
  165. package/dist/web-components-runtime.js +4 -4
  166. package/package.json +3 -2
  167. package/dist/ExtensionRoot-peABLAZZ.js +0 -231
  168. package/dist/block-B6s9jL7l.js +0 -966
  169. package/dist/block.devtools.test.d.ts +0 -2
  170. package/dist/block.devtools.test.d.ts.map +0 -1
  171. package/dist/context.devtools.test.d.ts +0 -2
  172. package/dist/context.devtools.test.d.ts.map +0 -1
  173. package/dist/devtools/env.d.ts +0 -3
  174. package/dist/devtools/env.d.ts.map +0 -1
  175. package/dist/devtools/hook.d.ts +0 -35
  176. package/dist/devtools/hook.d.ts.map +0 -1
  177. package/dist/devtools/index.d.ts +0 -4
  178. package/dist/devtools/index.d.ts.map +0 -1
  179. package/dist/devtools/protocol.d.ts +0 -91
  180. package/dist/devtools/protocol.d.ts.map +0 -1
  181. package/dist/devtools.js +0 -44
  182. package/dist/editor/overlays.d.ts +0 -14
  183. package/dist/editor/overlays.d.ts.map +0 -1
  184. package/dist/editor/overlays.test.d.ts +0 -2
  185. package/dist/editor/overlays.test.d.ts.map +0 -1
  186. package/dist/juo-workflow-DY4rd256.js +0 -868
  187. package/dist/overlay-wrapper.d.ts +0 -69
  188. package/dist/overlay-wrapper.d.ts.map +0 -1
  189. package/dist/overlay-wrapper.test.d.ts +0 -2
  190. package/dist/overlay-wrapper.test.d.ts.map +0 -1
  191. package/dist/overlays/OverlayService.d.ts +0 -34
  192. package/dist/overlays/OverlayService.d.ts.map +0 -1
  193. package/dist/overlays/OverlayService.test.d.ts +0 -2
  194. package/dist/overlays/OverlayService.test.d.ts.map +0 -1
  195. package/dist/registry.devtools.test.d.ts +0 -2
  196. package/dist/registry.devtools.test.d.ts.map +0 -1
  197. package/dist/services/customer/adapter.d.ts +0 -8
  198. package/dist/services/customer/adapter.d.ts.map +0 -1
  199. package/dist/services/login/adapter.d.ts +0 -32
  200. package/dist/services/login/adapter.d.ts.map +0 -1
  201. package/dist/services/order/adapter.d.ts +0 -9
  202. package/dist/services/order/adapter.d.ts.map +0 -1
  203. package/dist/services/order/index.d.ts +0 -5
  204. package/dist/services/order/index.d.ts.map +0 -1
  205. package/dist/services/order/orderService.d.ts +0 -7
  206. package/dist/services/order/orderService.d.ts.map +0 -1
  207. package/dist/services/order/types.d.ts +0 -21
  208. package/dist/services/order/types.d.ts.map +0 -1
  209. package/dist/services/product/adapter.test.d.ts +0 -2
  210. package/dist/services/product/adapter.test.d.ts.map +0 -1
  211. package/dist/services/schedules/adapter.d.ts +0 -71
  212. package/dist/services/schedules/adapter.d.ts.map +0 -1
  213. package/dist/services/schedules/adapter.test.d.ts +0 -2
  214. package/dist/services/schedules/adapter.test.d.ts.map +0 -1
  215. package/dist/services/schedules/index.d.ts +0 -5
  216. package/dist/services/schedules/index.d.ts.map +0 -1
  217. package/dist/services/schedules/schedulesService.d.ts +0 -11
  218. package/dist/services/schedules/schedulesService.d.ts.map +0 -1
  219. package/dist/services/schedules/schedulesService.test.d.ts +0 -2
  220. package/dist/services/schedules/schedulesService.test.d.ts.map +0 -1
  221. package/dist/services/schedules/types.d.ts +0 -226
  222. package/dist/services/schedules/types.d.ts.map +0 -1
  223. package/dist/services/settings/index.d.ts +0 -3
  224. package/dist/services/settings/index.d.ts.map +0 -1
  225. package/dist/services/settings/settingsService.d.ts +0 -7
  226. package/dist/services/settings/settingsService.d.ts.map +0 -1
  227. package/dist/services/settings/settingsService.test.d.ts +0 -2
  228. package/dist/services/settings/settingsService.test.d.ts.map +0 -1
  229. package/dist/services/settings/types.d.ts +0 -35
  230. package/dist/services/settings/types.d.ts.map +0 -1
  231. package/dist/services/shop/index.d.ts +0 -3
  232. package/dist/services/shop/index.d.ts.map +0 -1
  233. package/dist/services/shop/shopService.d.ts +0 -12
  234. package/dist/services/shop/shopService.d.ts.map +0 -1
  235. package/dist/services/shop/shopService.test.d.ts +0 -2
  236. package/dist/services/shop/shopService.test.d.ts.map +0 -1
  237. package/dist/services/shop/types.d.ts +0 -7
  238. package/dist/services/shop/types.d.ts.map +0 -1
  239. package/dist/services/subscription/adapter.test.d.ts +0 -2
  240. package/dist/services/subscription/adapter.test.d.ts.map +0 -1
  241. package/dist/services/subscription/types.test.d.ts +0 -2
  242. package/dist/services/subscription/types.test.d.ts.map +0 -1
  243. package/dist/theme-state.params.test.d.ts +0 -2
  244. package/dist/theme-state.params.test.d.ts.map +0 -1
  245. package/dist/theme-state.translations.test.d.ts +0 -2
  246. package/dist/theme-state.translations.test.d.ts.map +0 -1
@@ -0,0 +1,378 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
+ import { signal, effect, createBlockInstance, layoutSystemEnabled, untracked } from "@juo/blocks";
5
+ import { reportBlockWarning, reportBlockError } from "./observability.js";
6
+ import { L as LAYOUT_SCOPE_ATTR, p as buildGridLayout, U as isStubDefinition, a5 as withWrapper, s as subscribeContext, T as ThemeStateContext, o as backfillInstanceDefaults, X as onRegisterBlock } from "./css-runtime-DWytAzZ5.js";
7
+ class Block extends HTMLElement {
8
+ constructor() {
9
+ super();
10
+ /** @description The block name to render */
11
+ __publicField(this, "name", signal(null));
12
+ __publicField(this, "disposeEffect");
13
+ }
14
+ static get observedAttributes() {
15
+ return ["name"];
16
+ }
17
+ connectedCallback() {
18
+ this.name.value = this.getAttribute("name") ?? null;
19
+ this.disposeEffect = effect(() => {
20
+ this.renderBlock(this.name.value);
21
+ });
22
+ }
23
+ attributeChangedCallback(name, oldValue, newValue) {
24
+ if (name === "name" && oldValue !== newValue) {
25
+ this.name.value = newValue ?? null;
26
+ }
27
+ }
28
+ disconnectedCallback() {
29
+ if (this.disposeEffect) {
30
+ this.disposeEffect();
31
+ this.disposeEffect = void 0;
32
+ }
33
+ }
34
+ renderBlock(name) {
35
+ if (name == null) {
36
+ reportBlockWarning("'name' attribute is required on <juo-block>", {
37
+ site: "web-components.Block.renderBlock"
38
+ });
39
+ this.replaceChildren();
40
+ return;
41
+ }
42
+ const props = Object.fromEntries(
43
+ Array.from(this.attributes).map((attr) => [attr.name, attr.value])
44
+ );
45
+ try {
46
+ const block = createBlockInstance(name, { props });
47
+ this.replaceChildren(block.definition.render(block));
48
+ } catch (error) {
49
+ reportBlockError(error, {
50
+ site: "web-components.Block.renderBlock",
51
+ block: { id: "(none)", type: name },
52
+ keys: { props: Object.keys(props) }
53
+ });
54
+ this.replaceChildren();
55
+ }
56
+ }
57
+ }
58
+ function tagGridItems(items, tags) {
59
+ const { dividerBlockIds, dividerRowBlockIds, fullWidthBlockIds } = tags;
60
+ for (const { blockId, element } of items) {
61
+ element.toggleAttribute(
62
+ "data-juo-divider",
63
+ (dividerBlockIds == null ? void 0 : dividerBlockIds.has(blockId)) ?? false
64
+ );
65
+ element.toggleAttribute(
66
+ "data-juo-divider-row",
67
+ (dividerRowBlockIds == null ? void 0 : dividerRowBlockIds.has(blockId)) ?? false
68
+ );
69
+ element.toggleAttribute(
70
+ "data-juo-grid-full-width",
71
+ (fullWidthBlockIds == null ? void 0 : fullWidthBlockIds.has(blockId)) ?? false
72
+ );
73
+ }
74
+ }
75
+ function applyGridLayout(host, inputs) {
76
+ host.style.containerType = "inline-size";
77
+ const styleEl = document.createElement("style");
78
+ styleEl.textContent = inputs.css;
79
+ const gridEl = document.createElement("div");
80
+ gridEl.setAttribute(LAYOUT_SCOPE_ATTR, inputs.scopeId);
81
+ for (const { blockId, element } of inputs.items) {
82
+ element.setAttribute("data-block-id", blockId);
83
+ gridEl.appendChild(element);
84
+ }
85
+ tagGridItems(inputs.items, inputs);
86
+ host.replaceChildren(styleEl, gridEl);
87
+ }
88
+ function clearGridLayout(host) {
89
+ host.style.removeProperty("container-type");
90
+ }
91
+ class ViewLayoutController {
92
+ readReactiveState() {
93
+ return { mode: false };
94
+ }
95
+ apply(host, inputs) {
96
+ const { extensionBlocks, children, layoutDoc, scopeId, layoutEngineEnabled } = inputs;
97
+ if (layoutEngineEnabled && host.hasAttribute("grid-layout") && layoutDoc != null) {
98
+ const blockIds = extensionBlocks.map((block) => block.id);
99
+ const runtime = buildGridLayout(layoutDoc, blockIds, scopeId);
100
+ applyGridLayout(host, {
101
+ scopeId,
102
+ css: runtime.css,
103
+ items: extensionBlocks.map((block, index) => ({
104
+ blockId: block.id,
105
+ element: children[index]
106
+ })),
107
+ dividerBlockIds: runtime.dividerBlockIds,
108
+ dividerRowBlockIds: runtime.dividerRowBlockIds,
109
+ fullWidthBlockIds: runtime.fullWidthBlockIds
110
+ });
111
+ return;
112
+ }
113
+ clearGridLayout(host);
114
+ host.replaceChildren(...children);
115
+ }
116
+ teardown(host) {
117
+ clearGridLayout(host);
118
+ }
119
+ }
120
+ const _ExtensionRoot = class _ExtensionRoot extends HTMLElement {
121
+ constructor() {
122
+ super();
123
+ __publicField(this, "state", signal(null));
124
+ __publicField(this, "themeState", null);
125
+ __publicField(this, "unsubscribeThemeContext");
126
+ __publicField(this, "disposeEffect");
127
+ __publicField(this, "__vueInstance", null);
128
+ /**
129
+ * Names of top-level slot children that resolved to a stub on the last
130
+ * render pass — i.e. blocks whose definition hasn't been registered yet.
131
+ * Rebuilt on each render and consulted from the registration listener so
132
+ * we only retrigger when a block we're actually waiting on lands.
133
+ *
134
+ * Only top-level children are tracked — nested stubs inside a registered
135
+ * parent's renderer aren't currently handled (rare in practice; revisit
136
+ * if it shows up).
137
+ */
138
+ __publicField(this, "unresolvedNames", /* @__PURE__ */ new Set());
139
+ __publicField(this, "unregisterListener");
140
+ __publicField(this, "scopeId", null);
141
+ /**
142
+ * Pluggable layout strategy. Runtime default renders the settled CSS-Grid/flex
143
+ * view; the editor subclass swaps in a controller that adds the drag/resize
144
+ * adapter path. ExtensionRoot owns block rendering — the controller owns all
145
+ * layout side-effects on this host.
146
+ */
147
+ __publicField(this, "layout", new ViewLayoutController());
148
+ /**
149
+ * Optional function to wrap each rendered block element.
150
+ * Called with the rendered block HTMLElement, must return an HTMLElement.
151
+ * When set, the wrapper sits between the editor wrapper (outer) and the actual block (inner).
152
+ * Must be set before blocks are first rendered; changing it afterwards has no effect
153
+ * on already-cached block wrappers.
154
+ */
155
+ __publicField(this, "blockWrapper", null);
156
+ /**
157
+ * Rendered top-level children cached by stable block id.
158
+ *
159
+ * Keying on id (not BlockInstance identity) is what keeps entering layout
160
+ * mode cheap: a PROVIDE_THEME_STATE that re-materialises the same blocks
161
+ * into fresh instance objects reuses the existing wrapper element instead of
162
+ * recreating the whole subtree — which would otherwise tear down and
163
+ * re-request context for every nested `juo-text` and rip GridStack's managed
164
+ * elements out from under it.
165
+ *
166
+ * `render` is the memoised withWrapper closure (owns a stable outer wrapper
167
+ * element). `signature` is a content hash of the last-rendered block; when
168
+ * it is unchanged (e.g. only `canvasMode`/layout changed) we return the
169
+ * cached element without re-rendering at all. Any real content change —
170
+ * props/slots edited in place, a stub upgrading to its real definition at
171
+ * any depth — flips the signature and forces a re-render.
172
+ */
173
+ __publicField(this, "childCache", /* @__PURE__ */ new Map());
174
+ /**
175
+ * The layout engine the cached wrappers were built under. `withWrapper`
176
+ * (block.ts) picks the wrapper *element* (legacy chrome vs. minimal layout
177
+ * wrapper) once, at creation, from `layoutSystemEnabled`. The child cache
178
+ * keys on block id and reuses that memoised closure, so a live engine switch
179
+ * would otherwise keep the stale wrapper tag until a full refresh. Tracking
180
+ * the engine here lets us drop the cache when it flips, forcing fresh
181
+ * closures (and thus the correct wrapper element) on the next render.
182
+ */
183
+ __publicField(this, "childCacheEngine", null);
184
+ }
185
+ getScopeId() {
186
+ if (this.scopeId == null) {
187
+ this.scopeId = `ext-${++_ExtensionRoot.scopeCounter}`;
188
+ }
189
+ return this.scopeId;
190
+ }
191
+ static get observedAttributes() {
192
+ return ["name", "surface", "grid-layout"];
193
+ }
194
+ /**
195
+ * Content hash of a block subtree: type, props, slot structure and the
196
+ * stub/real state of every node. Identity is deliberately excluded so a
197
+ * re-materialised-but-identical tree reuses its element; stub flags are
198
+ * included so a late-registered definition still re-renders even when its
199
+ * serialised props are unchanged.
200
+ */
201
+ static signatureOf(block) {
202
+ const stub = isStubDefinition(block.definition) ? "1" : "0";
203
+ const slots = Object.entries(block.slots ?? {}).map(([key, value]) => {
204
+ const children = Array.isArray(value) ? value : [value];
205
+ return `${key}:${children.map(
206
+ (child) => typeof child === "string" ? `s${child}` : _ExtensionRoot.signatureOf(child)
207
+ ).join(",")}`;
208
+ }).join("|");
209
+ return `${block.type}#${stub}#${JSON.stringify(block.props ?? {})}#{${slots}}`;
210
+ }
211
+ renderChild(block) {
212
+ const signature = _ExtensionRoot.signatureOf(block);
213
+ const cached = this.childCache.get(block.id);
214
+ if (cached != null && cached.signature === signature) {
215
+ return cached.element;
216
+ }
217
+ const render = (cached == null ? void 0 : cached.render) ?? withWrapper((inner) => {
218
+ const rendered = inner.definition.render({
219
+ ...inner,
220
+ __vueInstance: this.__vueInstance
221
+ });
222
+ return this.blockWrapper ? this.blockWrapper(rendered) : rendered;
223
+ });
224
+ const element = render(block);
225
+ this.childCache.set(block.id, { signature, render, element });
226
+ return element;
227
+ }
228
+ /** Drop cached children whose ids are no longer rendered to avoid leaks. */
229
+ pruneChildCache(activeIds) {
230
+ for (const id of this.childCache.keys()) {
231
+ if (!activeIds.has(id)) {
232
+ this.childCache.delete(id);
233
+ }
234
+ }
235
+ }
236
+ getSurface() {
237
+ return this.getAttribute("surface") === "overlay" ? "overlay" : "page";
238
+ }
239
+ setStateFromThemeState(themeState) {
240
+ const surface = this.getSurface();
241
+ this.state.value = surface === "overlay" ? themeState.overlay : themeState.page;
242
+ }
243
+ connectedCallback() {
244
+ this.state.value = null;
245
+ this.themeState = null;
246
+ this.style.display = "flex";
247
+ this.style.flexDirection = "column";
248
+ this.style.maxWidth = "100%";
249
+ this.unsubscribeThemeContext = subscribeContext(
250
+ this,
251
+ ThemeStateContext,
252
+ (contextValue) => {
253
+ this.themeState = contextValue;
254
+ this.setStateFromThemeState(contextValue);
255
+ }
256
+ );
257
+ this.disposeEffect = effect(() => {
258
+ var _a;
259
+ const state = this.state.value;
260
+ if (state == null) {
261
+ this.layout.teardown(this);
262
+ this.replaceChildren();
263
+ return;
264
+ }
265
+ const name = this.getAttribute("name");
266
+ if (name == null) {
267
+ console.error("'name' attribute is required");
268
+ this.layout.teardown(this);
269
+ this.replaceChildren();
270
+ return;
271
+ }
272
+ const blocks = state.blocks.value;
273
+ const layoutDoc = ((_a = state.layout) == null ? void 0 : _a.value) ?? null;
274
+ const reactive = this.layout.readReactiveState();
275
+ const layoutEngineEnabled = layoutSystemEnabled.value;
276
+ untracked(() => {
277
+ var _a2;
278
+ if (this.childCacheEngine !== layoutEngineEnabled) {
279
+ this.childCache.clear();
280
+ this.childCacheEngine = layoutEngineEnabled;
281
+ }
282
+ let extensionBlocks = [];
283
+ try {
284
+ extensionBlocks = (((_a2 = blocks.at(0)) == null ? void 0 : _a2.slots) ?? {})[name] ?? [];
285
+ for (const block of extensionBlocks) {
286
+ if (block != null && typeof block === "object") {
287
+ backfillInstanceDefaults(block);
288
+ }
289
+ }
290
+ const children = extensionBlocks.map(
291
+ (block) => this.renderChild(block)
292
+ );
293
+ this.pruneChildCache(
294
+ new Set(extensionBlocks.map((block) => block.id))
295
+ );
296
+ this.layout.apply(this, {
297
+ extensionBlocks,
298
+ children,
299
+ layoutDoc,
300
+ scopeId: this.getScopeId(),
301
+ reactive,
302
+ layoutEngineEnabled
303
+ });
304
+ } catch (error) {
305
+ reportBlockError(error, {
306
+ site: "web-components.ExtensionRoot.effect",
307
+ extra: {
308
+ surface: this.getSurface(),
309
+ name: this.getAttribute("name") ?? "(none)"
310
+ }
311
+ });
312
+ this.layout.teardown(this);
313
+ this.replaceChildren();
314
+ extensionBlocks = [];
315
+ }
316
+ this.unresolvedNames.clear();
317
+ for (const block of extensionBlocks) {
318
+ if (block != null && typeof block === "object" && isStubDefinition(block.definition)) {
319
+ this.unresolvedNames.add(block.type);
320
+ }
321
+ }
322
+ if (this.unresolvedNames.size > 0 && !this.unregisterListener) {
323
+ this.unregisterListener = onRegisterBlock((name2) => {
324
+ var _a3;
325
+ if (!this.unresolvedNames.has(name2)) return;
326
+ const stateRef = this.state.value;
327
+ if (stateRef == null) return;
328
+ const surfaceBlocks = stateRef.blocks.value;
329
+ const slotName = this.getAttribute("name");
330
+ if (slotName != null) {
331
+ const children = (((_a3 = surfaceBlocks.at(0)) == null ? void 0 : _a3.slots) ?? {})[slotName] ?? [];
332
+ for (const child of children) {
333
+ if (child != null && typeof child === "object" && child.type === name2) {
334
+ backfillInstanceDefaults(child);
335
+ }
336
+ }
337
+ }
338
+ this.state.value = { ...stateRef };
339
+ });
340
+ }
341
+ });
342
+ });
343
+ }
344
+ attributeChangedCallback(name, oldValue, newValue) {
345
+ if ((name === "name" || name === "surface" || name === "grid-layout") && oldValue !== newValue && this.state.value) {
346
+ if (name === "surface") {
347
+ if (this.themeState) {
348
+ this.setStateFromThemeState(this.themeState);
349
+ return;
350
+ }
351
+ }
352
+ this.state.value = { ...this.state.value };
353
+ }
354
+ }
355
+ disconnectedCallback() {
356
+ this.layout.teardown(this);
357
+ if (this.unsubscribeThemeContext) {
358
+ this.unsubscribeThemeContext();
359
+ this.unsubscribeThemeContext = void 0;
360
+ }
361
+ if (this.disposeEffect) {
362
+ this.disposeEffect();
363
+ this.disposeEffect = void 0;
364
+ }
365
+ if (this.unregisterListener) {
366
+ this.unregisterListener();
367
+ this.unregisterListener = void 0;
368
+ }
369
+ this.unresolvedNames.clear();
370
+ }
371
+ };
372
+ __publicField(_ExtensionRoot, "scopeCounter", 0);
373
+ let ExtensionRoot = _ExtensionRoot;
374
+ export {
375
+ Block as B,
376
+ ExtensionRoot as E,
377
+ ViewLayoutController as V
378
+ };
package/dist/block.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { JSONSchema } from 'json-schema-to-ts';
2
- import { JuoBlocksDevtoolsHook } from './devtools';
3
2
  /**
4
3
  * Returns true if `scope` has at least one visible direct element child.
5
4
  * "Visible" follows the platform's `Element.checkVisibility()` rule
@@ -117,55 +116,6 @@ declare global {
117
116
  "juo:block-wrapper-render": BlockWrapperEvent;
118
117
  }
119
118
  }
120
- /**
121
- * @internal devtools — merges any recorded devtools overrides for `id` on top
122
- * of the given base props. Returns `props` unchanged when there is no override
123
- * (the production path), avoiding allocation. Devtools edits live in the shared
124
- * store (keyed by block id) so they survive re-renders: every renderer
125
- * re-applies them, and the recorded snapshot reflects them too.
126
- */
127
- export declare function applyDevtoolsPropOverride(id: string, props: Record<string, unknown>): Record<string, unknown>;
128
- /**
129
- * @internal devtools — registers a renderer-specific live prop setter. Non-CE
130
- * renderers (e.g. the Vue `<div>` renderer) aren't reactive to DOM property
131
- * sets, so they register a setter that mutates their reactive props source.
132
- * `setDevtoolsBlockProp` prefers this over writing a DOM property.
133
- */
134
- export declare function __recordDevtoolsPropSetter(id: string, setProp: (key: string, value: unknown) => void): void;
135
- /** @internal devtools/test helper — records a rendered block instance for state pull. */
136
- export declare function __recordDevtoolsInstance(inst: {
137
- id: string;
138
- type: string;
139
- props: Record<string, unknown>;
140
- el?: HTMLElement;
141
- }): void;
142
- export declare function getDevtoolsBlockState(id: string): {
143
- props: Record<string, unknown>;
144
- propsSchema: Record<string, unknown> | null;
145
- } | null;
146
- /**
147
- * Writes a single prop override for a recorded block instance. The override is
148
- * stored centrally (so it survives re-renders) and then applied live:
149
- *
150
- * - Non-CE renderers register a setter via `__recordDevtoolsPropSetter` that
151
- * re-applies the merged overrides to their reactive props source.
152
- * - CE blocks fall back to writing the DOM property on the live custom element,
153
- * which is reactive.
154
- *
155
- * Returns the updated (merged) state, or null when the block isn't recorded.
156
- */
157
- export declare function setDevtoolsBlockProp(id: string, key: string, value: unknown): {
158
- props: Record<string, unknown>;
159
- } | null;
160
- /**
161
- * @internal devtools — publishes the (already-defined) state resolvers on the
162
- * hook so a backend in a separate bundle can reach live block state. Idempotent
163
- * and only ever runs when a devtools shell has installed the hook, so it is
164
- * prod-inert.
165
- */
166
- /** Human-readable block labels keyed by registry name (displayName ?? name). */
167
- export declare function getDevtoolsBlockCatalog(): Record<string, string>;
168
- export declare function attachDevtoolsResolvers(hook: JuoBlocksDevtoolsHook): void;
169
119
  export declare function withWrapper(fn: (block: BlockInstance) => HTMLElement): (block: BlockInstance) => HTMLElement;
170
120
  export declare function registerBlock<T>(block: BlockDefinition<T>): void;
171
121
  export declare function onRegisterBlock(cb: (name: string, block: BlockDefinition) => void): () => void;
@@ -1 +1 @@
1
- {"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../src/block.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAW,KAAK,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAIjE;;;;;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