@xenosystem/blocks 0.12.0 → 0.12.1

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.
@@ -208,7 +208,15 @@ declare function ticksPerStep(unit: XenoStepUnit, timebase: XenoTimebase): numbe
208
208
  */
209
209
 
210
210
  /** Options for {@link createTransportPanel}. */
211
- type CreateTransportPanelOptions = TransportPanelControllerOptions;
211
+ interface CreateTransportPanelOptions extends TransportPanelControllerOptions {
212
+ /**
213
+ * Draw the strip yourself — a host that mounts the block AS ITS DECLARATION renders
214
+ * `TRANSPORT_DECLARATION` from `transportViewState(controller)` here and applies `ui` intents with
215
+ * `applyTransportUi`. Default: the code view. The RAF pump and the keyboard model stay with the
216
+ * controller either way: `controller.pump()` while `isAnimating()`, `controller.handleKey()` on the root.
217
+ */
218
+ render?: (root: HTMLElement, controller: TransportPanelController) => () => void;
219
+ }
212
220
  /**
213
221
  * Build the Transport panel module.
214
222
  *
@@ -1159,11 +1159,20 @@ function createTransportPanel(options = {}) {
1159
1159
  return {
1160
1160
  manifest: transportManifest,
1161
1161
  activate(host) {
1162
- const controller = new TransportPanelController(host, options);
1162
+ const { render: customRender, ...controllerOptions } = options;
1163
+ const controller = new TransportPanelController(host, controllerOptions);
1163
1164
  void controller.load();
1164
1165
  let root = null;
1166
+ let unrender = null;
1165
1167
  return {
1166
1168
  render(el) {
1169
+ if (customRender) {
1170
+ unrender = customRender(el, controller);
1171
+ return () => {
1172
+ unrender?.();
1173
+ unrender = null;
1174
+ };
1175
+ }
1167
1176
  root = createRoot(el);
1168
1177
  root.render(createElement(TransportPanelView, { controller }));
1169
1178
  return () => {
@@ -1186,6 +1195,8 @@ function createTransportPanel(options = {}) {
1186
1195
  dispose() {
1187
1196
  root?.unmount();
1188
1197
  root = null;
1198
+ unrender?.();
1199
+ unrender = null;
1189
1200
  controller.dispose();
1190
1201
  }
1191
1202
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xenosystem/blocks",
3
- "version": "0.12.0",
3
+ "version": "0.12.1",
4
4
  "description": "XENO Blocks — rung 3 of the front ladder: components composed into a contract-bearing unit (manifest: ports, intents, commands, agent surface), rendered by @xenosystem/workbench. ONE package, one subpath per family (/auth, /edit, /data, /time, /ops, /trust, /agent), one named export per block — XENO PACKAGE NAMING - STANDARD.md.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",