diff --git a/knip.config.ts b/knip.config.ts index 38bd0acdfd..ff55bf1a00 100644 --- a/knip.config.ts +++ b/knip.config.ts @@ -88,7 +88,9 @@ const config: KnipConfig = { // the v1→v2 cut-over). Tracked by I-EXT (#12144). 'src/extensions/core/noteNode.v2.ts', 'src/extensions/core/rerouteNode.v2.ts', - 'src/extensions/core/slotDefaults.v2.ts' + 'src/extensions/core/slotDefaults.v2.ts', + // W6.P3.D — defineWidget+mount showcase port (D-widget-converge / A12). + 'src/extensions/core/webcamCapture.v2.ts' ], vite: { config: ['vite?(.*).config.mts'] diff --git a/src/extensions/core/webcamCapture.v2.ts b/src/extensions/core/webcamCapture.v2.ts new file mode 100644 index 0000000000..a93355a4c8 --- /dev/null +++ b/src/extensions/core/webcamCapture.v2.ts @@ -0,0 +1,110 @@ +/** + * WebcamCapture — rewritten with the v2 extension API. + * + * v1: registers the `WEBCAM` custom widget type via `getCustomWidgets()` + * returning `node.addDOMWidget(name, 'WEBCAM', container)`, then a + * separate `nodeCreated` reaches into `node.widgets` to wire the + * capture button and `serializeValue` override. + * + * v2: registers the `WEBCAM` widget type via `defineWidget({ type, mount })` + * per **Axiom A12** — the mount-lifecycle hook is the sole DOM seam. + * The mount body captures `host` (and the constructed `