@prettier-ai/dsh-client-ui-renderer 0.1.2-alpha.2 → 0.1.2-alpha.4

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 (2) hide show
  1. package/lib/client.js +11 -9
  2. package/package.json +4 -4
package/lib/client.js CHANGED
@@ -336,21 +336,23 @@ window.__ModuleLoader__.load({
336
336
  const args = [];
337
337
  if (binding !== void 0) args.push(binding.key);
338
338
  if (actions !== void 0) args.push(actions);
339
- return bindInjectHooks(inject(...args));
339
+ return bindInjectSources(inject(...args));
340
340
  }
341
- /**
342
- * Normalize one entry-owned inject face on its existing cache axis. Its hooks
343
- * compartment remains the original Observable-only contract.
344
- */
345
- function bindInjectHooks(face) {
341
+ /** Bind one entry-owned inject face on its existing cache axis. */
342
+ function bindInjectSources(face) {
346
343
  const sources = face["hooks"];
347
- if (sources === void 0) return face;
348
- const { hooks: _hooks, ...rest } = face;
344
+ const keyedSources = face["keyedHooks"];
345
+ if (sources === void 0 && keyedSources === void 0) return face;
346
+ const { hooks: _hooks, keyedHooks: _keyedHooks, ...rest } = face;
349
347
  const bound = rest;
350
- for (const [name, source] of Object.entries(sources)) {
348
+ for (const [name, source] of Object.entries(sources ?? {})) {
351
349
  const hookName = (0, _prettier_ai_dsh_client_ui_slots.standardHookPropName)(name);
352
350
  bound[hookName] = observableHook(source);
353
351
  }
352
+ for (const [name, source] of Object.entries(keyedSources ?? {})) {
353
+ const hookName = (0, _prettier_ai_dsh_client_ui_slots.standardHookPropName)(name);
354
+ bound[hookName] = keyedObservableHook(source);
355
+ }
354
356
  return bound;
355
357
  }
356
358
  const slotInjectCache = /* @__PURE__ */ new WeakMap();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@prettier-ai/dsh-client-ui-renderer",
3
3
  "description": "Browser UI renderer: React slot bindings, ctx.uiRenderer, and the assembled application root",
4
- "version": "0.1.2-alpha.2",
4
+ "version": "0.1.2-alpha.4",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -49,9 +49,9 @@
49
49
  "react": "^18.2.0",
50
50
  "react-dom": "^18.2.0",
51
51
  "@prettier-ai/cordis": "^4.0.2",
52
- "@prettier-ai/dsh-client-ui-slots": "^0.1.2-alpha.2",
53
- "@prettier-ai/dsh-invariants": "^0.1.2-alpha.2",
54
- "@prettier-ai/dsh-client-test-runtime": "^0.1.2-alpha.2"
52
+ "@prettier-ai/dsh-client-ui-slots": "^0.1.2-alpha.4",
53
+ "@prettier-ai/dsh-client-test-runtime": "^0.1.2-alpha.4",
54
+ "@prettier-ai/dsh-invariants": "^0.1.2-alpha.4"
55
55
  },
56
56
  "files": [
57
57
  "lib/index.js",