@pascal-app/nodes 1.1.1 → 1.1.2

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.
@@ -1 +1 @@
1
- {"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../src/column/renderer.tsx"],"names":[],"mappings":"AAEA,OAAO,EAML,KAAK,UAAU,EACf,KAAK,YAAY,EAMjB,QAAQ,EACT,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAEL,KAAK,WAAW,EAShB,KAAK,aAAa,EAKnB,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EAAsD,KAAK,QAAQ,EAAE,MAAM,OAAO,CAAA;AAYzF,KAAK,cAAc,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,QAAQ,CAAC,CAAC,WAAW,CAAC,CAAA;AAgDvE,wBAAgB,yBAAyB,CAAC,EACxC,WAAW,EACX,cAAc,EACd,IAAI,EACJ,cAAc,EACd,OAAO,EACP,MAAM,EACN,QAAQ,GACT,EAAE;IACD,WAAW,EAAE,WAAW,CAAA;IACxB,cAAc,EAAE,QAAQ,GAAG,IAAI,CAAA;IAC/B,IAAI,EAAE,UAAU,CAAA;IAChB,cAAc,EAAE,cAAc,CAAA;IAC9B,OAAO,EAAE,aAAa,CAAA;IACtB,MAAM,EAAE,YAAY,CAAA;IACpB,QAAQ,EAAE,OAAO,CAAA;CAClB,GAAG,QAAQ,CAeX;AAszDD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,aAAa,aAAc;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,gCA6C3D,CAAA;AAED,eAAO,MAAM,cAAc,sBAAuB;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,gCA6ErE,CAAA;eAEc,cAAc"}
1
+ {"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../src/column/renderer.tsx"],"names":[],"mappings":"AAEA,OAAO,EAML,KAAK,UAAU,EACf,KAAK,YAAY,EAMjB,QAAQ,EACT,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAEL,KAAK,WAAW,EAShB,KAAK,aAAa,EAKnB,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EAAsD,KAAK,QAAQ,EAAE,MAAM,OAAO,CAAA;AAYzF,KAAK,cAAc,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,QAAQ,CAAC,CAAC,WAAW,CAAC,CAAA;AAgDvE,wBAAgB,yBAAyB,CAAC,EACxC,WAAW,EACX,cAAc,EACd,IAAI,EACJ,cAAc,EACd,OAAO,EACP,MAAM,EACN,QAAQ,GACT,EAAE;IACD,WAAW,EAAE,WAAW,CAAA;IACxB,cAAc,EAAE,QAAQ,GAAG,IAAI,CAAA;IAC/B,IAAI,EAAE,UAAU,CAAA;IAChB,cAAc,EAAE,cAAc,CAAA;IAC9B,OAAO,EAAE,aAAa,CAAA;IACtB,MAAM,EAAE,YAAY,CAAA;IACpB,QAAQ,EAAE,OAAO,CAAA;CAClB,GAAG,QAAQ,CAeX;AAszDD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,aAAa,aAAc;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,gCA6C3D,CAAA;AAED,eAAO,MAAM,cAAc,sBAAuB;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,gCAiFrE,CAAA;eAEc,cAAc"}
@@ -911,6 +911,6 @@ export const ColumnRenderer = ({ node: rawNode }) => {
911
911
  dirtySubtree();
912
912
  });
913
913
  }, [node]);
914
- return (_jsx(ColumnMaterialContext.Provider, { value: materials, children: _jsxs(ColumnEdgeSoftnessContext.Provider, { value: node.edgeSoftness ?? 0.025, children: [_jsxs("group", { position: liveTransform?.position ?? node.position, ref: ref, rotation: [0, liveTransform?.rotation ?? node.rotation, 0], visible: node.visible, userData: modelData, ...handlers, children: [_jsx("group", { ref: bodyRef, name: "column-body", children: node.source ? _jsx(ScriptedOpeningModel, { node: node }) : _jsx(ColumnBody, { node: node }) }), node.children.map((id) => (_jsx(NodeRenderer, { nodeId: id }, id)))] }), _jsx(ColumnInspectorOverlay, { nodeId: node.id, body: bodyRef, node: node, position: liveTransform?.position ?? node.position, rotation: liveTransform?.rotation ?? node.rotation })] }) }));
914
+ return (_jsx(ColumnMaterialContext.Provider, { value: materials, children: _jsxs(ColumnEdgeSoftnessContext.Provider, { value: node.edgeSoftness ?? 0.025, children: [_jsxs("group", { position: liveTransform?.position ?? node.position, ref: ref, rotation: [0, liveTransform?.rotation ?? node.rotation, 0], visible: node.visible, userData: modelData, ...handlers, children: [_jsx("group", { ref: bodyRef, name: "column-body", children: node.source ? (_jsx(ScriptedOpeningModel, { host: ref, node: node })) : (_jsx(ColumnBody, { node: node })) }), node.children.map((id) => (_jsx(NodeRenderer, { nodeId: id }, id)))] }), _jsx(ColumnInspectorOverlay, { nodeId: node.id, body: bodyRef, node: node, position: liveTransform?.position ?? node.position, rotation: liveTransform?.rotation ?? node.rotation })] }) }));
915
915
  };
916
916
  export default ColumnRenderer;
@@ -1,12 +1,19 @@
1
1
  import { type ColumnNode, type DoorNode, type WindowNode } from '@pascal-app/core';
2
+ import { type RefObject } from 'react';
3
+ import type { Object3D } from 'three';
2
4
  /**
3
5
  * A window, door or column built from a script, rendered exactly as an authored
4
6
  * item: the same artifact, paint slots, clips and lights. The artifact's origin
5
7
  * is its bottom centre: an opening's mesh is centred on the opening, a column's
6
8
  * sits on its support point.
7
9
  */
8
- export declare function ScriptedOpeningModel({ node }: {
10
+ export declare function ScriptedOpeningModel({ node, host, }: {
9
11
  node: WindowNode | DoorNode | ColumnNode;
12
+ /**
13
+ * The node's own group, for a kind with no system of its own (a column): its batch reads there
14
+ * whether the artifact has loaded. A window's or door's system reads it on this model's group.
15
+ */
16
+ host?: RefObject<Object3D | null>;
10
17
  }): import("react").JSX.Element;
11
18
  /** Open and Close for a window or door built from a script: its `open` clip, through the item toggles. */
12
19
  export declare const scriptedOpening: {
@@ -1 +1 @@
1
- {"version":3,"file":"scripted-opening.d.ts","sourceRoot":"","sources":["../../src/shared/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AAU,CAAC,QAAQ,CAAC,CAAA;KAAE;IAC7C,IAAI,SAAS;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAA;KAAE;IAK1D,GAAG,SAAS;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAA;KAAE,MAAM,OAAO;CAKvE,CAAA"}
@@ -10,7 +10,7 @@ import { ScriptedModel } from '../item/renderer.js';
10
10
  * is its bottom centre: an opening's mesh is centred on the opening, a column's
11
11
  * sits on its support point.
12
12
  */
13
- export function ScriptedOpeningModel({ node }) {
13
+ export function ScriptedOpeningModel({ node, host, }) {
14
14
  const source = node.source;
15
15
  const ref = useRef(null);
16
16
  const modelData = useMemo(() => ({ [SCRIPTED_MODEL_FLAG]: true }), []);
@@ -35,16 +35,14 @@ export function ScriptedOpeningModel({ node }) {
35
35
  };
36
36
  }, [node.id, node.type, node.parentId, node.metadata, node.slots, source]);
37
37
  const setSettled = useCallback((settled) => {
38
- if (ref.current) {
38
+ if (ref.current)
39
39
  ref.current.userData.itemModelSettled = settled;
40
- // A column has no system of its own: its renderer and batch read the flag on the node's group.
41
- if (node.type === 'column' && ref.current.parent)
42
- ref.current.parent.userData.itemModelSettled = settled;
43
- }
44
- // The opening's system holds its dirty mark until the artifact has loaded.
40
+ if (host?.current)
41
+ host.current.userData.itemModelSettled = settled;
42
+ // The node's dirty mark is held until the artifact has loaded.
45
43
  if (settled)
46
44
  useScene.getState().markDirty(node.id);
47
- }, [node.id, node.type]);
45
+ }, [node.id, host]);
48
46
  const [, height] = scriptedSize(source.manifest);
49
47
  return (_jsx("group", { "position-y": node.type === 'column' ? 0 : -height / 2, ref: ref, userData: modelData, children: _jsx(ScriptedModel, { setSettled: setSettled, view: view }) }));
50
48
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pascal-app/nodes",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "Built-in node bundles for the Pascal 3D editor — one folder per kind, exported as `builtinPlugin`",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -44,9 +44,9 @@
44
44
  "bench:elevator": "bun test ./src/elevator/__bench__/rendering.bench.tsx && bun ./src/elevator/__bench__/runtime.ts"
45
45
  },
46
46
  "peerDependencies": {
47
- "@pascal-app/core": "^1.1.1",
48
- "@pascal-app/editor": "^1.1.1",
49
- "@pascal-app/viewer": "^1.1.1",
47
+ "@pascal-app/core": "^1.1.2",
48
+ "@pascal-app/editor": "^1.1.2",
49
+ "@pascal-app/viewer": "^1.1.2",
50
50
  "@react-three/drei": "^10",
51
51
  "@react-three/fiber": "^9",
52
52
  "lucide-react": "^1",
@@ -58,10 +58,10 @@
58
58
  "devDependencies": {
59
59
  "@modelcontextprotocol/client": "^2.4.0",
60
60
  "@modelcontextprotocol/server": "^2.4.0",
61
- "@pascal-app/core": "^1.1.1",
62
- "@pascal-app/editor": "^1.1.1",
63
- "@pascal-app/mcp": "^1.1.1",
64
- "@pascal-app/viewer": "^1.1.1",
61
+ "@pascal-app/core": "^1.1.2",
62
+ "@pascal-app/editor": "^1.1.2",
63
+ "@pascal-app/mcp": "^1.1.2",
64
+ "@pascal-app/viewer": "^1.1.2",
65
65
  "@pascal/typescript-config": "*",
66
66
  "@react-three/test-renderer": "^9.1.1",
67
67
  "@types/bun": "^1.4.4",