@xenosystem/blocks 0.23.0 → 0.23.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.
@@ -292,6 +292,8 @@ declare class ShapeController {
292
292
  private narrowed;
293
293
  private refit;
294
294
  private afterSelect;
295
+ /** Is this card wholly inside the viewport (with a small margin)? */
296
+ private fullyVisible;
295
297
  /** The question and the depth are the viewer's: remembered so they do not reset on every open. */
296
298
  serialize(): {
297
299
  lens: XenoCorpusLens;
@@ -382,8 +382,14 @@ var ShapeController = class {
382
382
  const n = this.s.placed.find((x) => x.key === sel);
383
383
  if (!n) return;
384
384
  const z = Math.max(this.s.camera.zoom, 0.8);
385
+ if (z === this.s.camera.zoom && this.fullyVisible(n)) return;
385
386
  this.camera({ zoom: z, x: n.x + NODE_W / 2 - this.s.size.w / 2 / z, y: n.y + NODE_H / 2 - this.s.size.h / 2 / z }, true);
386
387
  }
388
+ /** Is this card wholly inside the viewport (with a small margin)? */
389
+ fullyVisible(n) {
390
+ const v = this.viewport, m = 8 / this.s.camera.zoom;
391
+ return n.x >= v.x + m && n.y >= v.y + m && n.x + NODE_W <= v.x + v.width - m && n.y + NODE_H <= v.y + v.height - m;
392
+ }
387
393
  // ── persistence ────────────────────────────────────────────────────────────
388
394
  /** The question and the depth are the viewer's: remembered so they do not reset on every open. */
389
395
  serialize() {
@@ -647,6 +653,7 @@ function CorpusShapeSurface({ controller, minimap = true, legend = true }) {
647
653
  const s = useSyncExternalStore(controller.subscribe, controller.getState, controller.getState);
648
654
  const ref = useRef(null);
649
655
  const drag = useRef(null);
656
+ const firstClick = useRef(null);
650
657
  useEffect(() => {
651
658
  const el = ref.current;
652
659
  if (!el) return;
@@ -775,7 +782,14 @@ function CorpusShapeSurface({ controller, minimap = true, legend = true }) {
775
782
  const unknown = n.kind === "tenet" && (n.state === "unobserved" || n.state === "never-run");
776
783
  const dashed = n.kind === "proposal" || n.kind === "missing" || n.kind === "uncovered";
777
784
  const c = cardChip(n), sub = subLine(n);
778
- const common = { type: "button", "aria-pressed": picked, "aria-label": `${n.label} \xB7 ${c.label.toLowerCase()} \xB7 ${sub}`, onClick: () => controller.select(n.key), onDoubleClick: () => controller.open(n.key), onPointerDown: stop };
785
+ const common = { type: "button", "aria-pressed": picked, "aria-label": `${n.label} \xB7 ${c.label.toLowerCase()} \xB7 ${sub}`, onClick: (e) => {
786
+ if (e.detail >= 2 && firstClick.current) {
787
+ controller.open(firstClick.current);
788
+ return;
789
+ }
790
+ firstClick.current = n.key;
791
+ controller.select(n.key);
792
+ }, onPointerDown: stop };
779
793
  if (s.compact) {
780
794
  return /* @__PURE__ */ jsx(
781
795
  "button",
package/package.json CHANGED
@@ -1,221 +1,221 @@
1
- {
2
- "name": "@xenosystem/blocks",
3
- "version": "0.23.0",
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, /docs, /corpus; framework-free /docs/core and pure /docs/format), one named export per block — XENO PACKAGE NAMING - STANDARD.md.",
5
- "license": "UNLICENSED",
6
- "type": "module",
7
- "sideEffects": false,
8
- "exports": {
9
- ".": {
10
- "types": "./dist/index.d.ts",
11
- "import": "./dist/index.js"
12
- },
13
- "./auth": {
14
- "types": "./dist/auth/index.d.ts",
15
- "import": "./dist/auth/index.js"
16
- },
17
- "./trust": {
18
- "types": "./dist/trust/index.d.ts",
19
- "import": "./dist/trust/index.js"
20
- },
21
- "./ops": {
22
- "types": "./dist/ops/index.d.ts",
23
- "import": "./dist/ops/index.js"
24
- },
25
- "./time": {
26
- "types": "./dist/time/index.d.ts",
27
- "import": "./dist/time/index.js"
28
- },
29
- "./data": {
30
- "types": "./dist/data/index.d.ts",
31
- "import": "./dist/data/index.js"
32
- },
33
- "./data/duckdb": {
34
- "types": "./dist/data/duckdb.d.ts",
35
- "import": "./dist/data/duckdb.js"
36
- },
37
- "./icons": {
38
- "types": "./dist/icons/index.d.ts",
39
- "import": "./dist/icons/index.js"
40
- },
41
- "./edit": {
42
- "types": "./dist/edit/index.d.ts",
43
- "import": "./dist/edit/index.js"
44
- },
45
- "./agent": {
46
- "types": "./dist/agent/index.d.ts",
47
- "import": "./dist/agent/index.js"
48
- },
49
- "./agent/host-source": {
50
- "types": "./dist/agent/host-source.d.ts",
51
- "import": "./dist/agent/host-source.js"
52
- },
53
- "./docs": {
54
- "types": "./dist/docs/index.d.ts",
55
- "import": "./dist/docs/index.js"
56
- },
57
- "./docs/core": {
58
- "types": "./dist/docs/core.d.ts",
59
- "import": "./dist/docs/core.js"
60
- },
61
- "./docs/format": {
62
- "types": "./dist/docs/format.d.ts",
63
- "import": "./dist/docs/format.js"
64
- },
65
- "./corpus": {
66
- "types": "./dist/corpus/index.d.ts",
67
- "import": "./dist/corpus/index.js"
68
- }
69
- },
70
- "files": [
71
- "dist",
72
- "README.md",
73
- "LICENSE"
74
- ],
75
- "scripts": {
76
- "build": "tsup",
77
- "typecheck": "tsc --noEmit",
78
- "test": "vitest run",
79
- "mutation:docs": "node scripts/docs-mutation-check.mjs"
80
- },
81
- "peerDependencies": {
82
- "@duckdb/duckdb-wasm": ">=1.28.0",
83
- "@tiptap/core": "^2.11.0",
84
- "@tiptap/extension-highlight": "^2.11.0",
85
- "@tiptap/extension-image": "^2.11.0",
86
- "@tiptap/extension-link": "^2.11.0",
87
- "@tiptap/extension-placeholder": "^2.11.0",
88
- "@tiptap/extension-subscript": "^2.11.0",
89
- "@tiptap/extension-superscript": "^2.11.0",
90
- "@tiptap/extension-table": "^2.11.0",
91
- "@tiptap/extension-table-cell": "^2.11.0",
92
- "@tiptap/extension-table-header": "^2.11.0",
93
- "@tiptap/extension-table-row": "^2.11.0",
94
- "@tiptap/extension-task-item": "^2.11.0",
95
- "@tiptap/extension-task-list": "^2.11.0",
96
- "@tiptap/extension-text-align": "^2.11.0",
97
- "@tiptap/extension-typography": "^2.11.0",
98
- "@tiptap/extension-underline": "^2.11.0",
99
- "@tiptap/pm": "^2.11.0",
100
- "@tiptap/starter-kit": "^2.11.0",
101
- "@xenosystem/block-sdk": ">=0.3.4 <1",
102
- "@xenosystem/components": ">=0.34.0 <1",
103
- "@xenosystem/data-core": "^0.1.0",
104
- "@xenosystem/elements": ">=0.0.1",
105
- "@xenosystem/elements-react": ">=0.0.1",
106
- "@xenosystem/time-core": "^0.1.0",
107
- "@xenosystem/tree-core": "^0.1.0",
108
- "@xenosystem/workbench": "^1.0.0",
109
- "@xterm/addon-fit": ">=0.10.0",
110
- "@xterm/xterm": ">=5.5.0",
111
- "react": ">=18.0.0",
112
- "react-dom": ">=18.0.0"
113
- },
114
- "devDependencies": {
115
- "@tiptap/core": "^2.27.2",
116
- "@tiptap/extension-highlight": "^2.27.2",
117
- "@tiptap/extension-image": "^2.27.2",
118
- "@tiptap/extension-link": "^2.27.2",
119
- "@tiptap/extension-placeholder": "^2.27.2",
120
- "@tiptap/extension-subscript": "^2.27.2",
121
- "@tiptap/extension-superscript": "^2.27.2",
122
- "@tiptap/extension-table": "^2.27.2",
123
- "@tiptap/extension-table-cell": "^2.27.2",
124
- "@tiptap/extension-table-header": "^2.27.2",
125
- "@tiptap/extension-table-row": "^2.27.2",
126
- "@tiptap/extension-task-item": "^2.27.2",
127
- "@tiptap/extension-task-list": "^2.27.2",
128
- "@tiptap/extension-text-align": "^2.27.2",
129
- "@tiptap/extension-typography": "^2.27.2",
130
- "@tiptap/extension-underline": "^2.27.2",
131
- "@tiptap/pm": "^2.27.2",
132
- "@tiptap/starter-kit": "^2.27.2",
133
- "@types/node": "^22.0.0",
134
- "@types/react": "^19.0.0",
135
- "@types/react-dom": "^19.0.0",
136
- "@xenosystem/block-sdk": "^0.3.4",
137
- "@xenosystem/components": "^0.34.0",
138
- "@xenosystem/data-core": "^0.1.0",
139
- "@xenosystem/elements": "0.0.1",
140
- "@xenosystem/elements-react": "0.0.1",
141
- "@xenosystem/time-core": "^0.1.0",
142
- "@xenosystem/tree-core": "^0.1.0",
143
- "@xenosystem/workbench": "^1.2.1",
144
- "@xterm/addon-fit": "^0.11.0",
145
- "@xterm/xterm": "^6.0.0",
146
- "jsdom": "^26.0.0",
147
- "react": "^19.0.0",
148
- "react-dom": "^19.0.0",
149
- "tsup": "^8.0.0",
150
- "typescript": "^5.4.0",
151
- "vitest": "^4.1.0"
152
- },
153
- "publishConfig": {
154
- "access": "public"
155
- },
156
- "peerDependenciesMeta": {
157
- "@duckdb/duckdb-wasm": {
158
- "optional": true
159
- },
160
- "@tiptap/core": {
161
- "optional": true
162
- },
163
- "@tiptap/extension-highlight": {
164
- "optional": true
165
- },
166
- "@tiptap/extension-image": {
167
- "optional": true
168
- },
169
- "@tiptap/extension-link": {
170
- "optional": true
171
- },
172
- "@tiptap/extension-placeholder": {
173
- "optional": true
174
- },
175
- "@tiptap/extension-subscript": {
176
- "optional": true
177
- },
178
- "@tiptap/extension-superscript": {
179
- "optional": true
180
- },
181
- "@tiptap/extension-table": {
182
- "optional": true
183
- },
184
- "@tiptap/extension-table-cell": {
185
- "optional": true
186
- },
187
- "@tiptap/extension-table-header": {
188
- "optional": true
189
- },
190
- "@tiptap/extension-table-row": {
191
- "optional": true
192
- },
193
- "@tiptap/extension-task-item": {
194
- "optional": true
195
- },
196
- "@tiptap/extension-task-list": {
197
- "optional": true
198
- },
199
- "@tiptap/extension-text-align": {
200
- "optional": true
201
- },
202
- "@tiptap/extension-typography": {
203
- "optional": true
204
- },
205
- "@tiptap/extension-underline": {
206
- "optional": true
207
- },
208
- "@tiptap/pm": {
209
- "optional": true
210
- },
211
- "@tiptap/starter-kit": {
212
- "optional": true
213
- },
214
- "@xterm/addon-fit": {
215
- "optional": true
216
- },
217
- "@xterm/xterm": {
218
- "optional": true
219
- }
220
- }
221
- }
1
+ {
2
+ "name": "@xenosystem/blocks",
3
+ "version": "0.23.1",
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, /docs, /corpus; framework-free /docs/core and pure /docs/format), one named export per block — XENO PACKAGE NAMING - STANDARD.md.",
5
+ "license": "UNLICENSED",
6
+ "type": "module",
7
+ "sideEffects": false,
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
+ },
13
+ "./auth": {
14
+ "types": "./dist/auth/index.d.ts",
15
+ "import": "./dist/auth/index.js"
16
+ },
17
+ "./trust": {
18
+ "types": "./dist/trust/index.d.ts",
19
+ "import": "./dist/trust/index.js"
20
+ },
21
+ "./ops": {
22
+ "types": "./dist/ops/index.d.ts",
23
+ "import": "./dist/ops/index.js"
24
+ },
25
+ "./time": {
26
+ "types": "./dist/time/index.d.ts",
27
+ "import": "./dist/time/index.js"
28
+ },
29
+ "./data": {
30
+ "types": "./dist/data/index.d.ts",
31
+ "import": "./dist/data/index.js"
32
+ },
33
+ "./data/duckdb": {
34
+ "types": "./dist/data/duckdb.d.ts",
35
+ "import": "./dist/data/duckdb.js"
36
+ },
37
+ "./icons": {
38
+ "types": "./dist/icons/index.d.ts",
39
+ "import": "./dist/icons/index.js"
40
+ },
41
+ "./edit": {
42
+ "types": "./dist/edit/index.d.ts",
43
+ "import": "./dist/edit/index.js"
44
+ },
45
+ "./agent": {
46
+ "types": "./dist/agent/index.d.ts",
47
+ "import": "./dist/agent/index.js"
48
+ },
49
+ "./agent/host-source": {
50
+ "types": "./dist/agent/host-source.d.ts",
51
+ "import": "./dist/agent/host-source.js"
52
+ },
53
+ "./docs": {
54
+ "types": "./dist/docs/index.d.ts",
55
+ "import": "./dist/docs/index.js"
56
+ },
57
+ "./docs/core": {
58
+ "types": "./dist/docs/core.d.ts",
59
+ "import": "./dist/docs/core.js"
60
+ },
61
+ "./docs/format": {
62
+ "types": "./dist/docs/format.d.ts",
63
+ "import": "./dist/docs/format.js"
64
+ },
65
+ "./corpus": {
66
+ "types": "./dist/corpus/index.d.ts",
67
+ "import": "./dist/corpus/index.js"
68
+ }
69
+ },
70
+ "files": [
71
+ "dist",
72
+ "README.md",
73
+ "LICENSE"
74
+ ],
75
+ "scripts": {
76
+ "build": "tsup",
77
+ "typecheck": "tsc --noEmit",
78
+ "test": "vitest run",
79
+ "mutation:docs": "node scripts/docs-mutation-check.mjs"
80
+ },
81
+ "peerDependencies": {
82
+ "@duckdb/duckdb-wasm": ">=1.28.0",
83
+ "@tiptap/core": "^2.11.0",
84
+ "@tiptap/extension-highlight": "^2.11.0",
85
+ "@tiptap/extension-image": "^2.11.0",
86
+ "@tiptap/extension-link": "^2.11.0",
87
+ "@tiptap/extension-placeholder": "^2.11.0",
88
+ "@tiptap/extension-subscript": "^2.11.0",
89
+ "@tiptap/extension-superscript": "^2.11.0",
90
+ "@tiptap/extension-table": "^2.11.0",
91
+ "@tiptap/extension-table-cell": "^2.11.0",
92
+ "@tiptap/extension-table-header": "^2.11.0",
93
+ "@tiptap/extension-table-row": "^2.11.0",
94
+ "@tiptap/extension-task-item": "^2.11.0",
95
+ "@tiptap/extension-task-list": "^2.11.0",
96
+ "@tiptap/extension-text-align": "^2.11.0",
97
+ "@tiptap/extension-typography": "^2.11.0",
98
+ "@tiptap/extension-underline": "^2.11.0",
99
+ "@tiptap/pm": "^2.11.0",
100
+ "@tiptap/starter-kit": "^2.11.0",
101
+ "@xenosystem/block-sdk": ">=0.3.4 <1",
102
+ "@xenosystem/components": ">=0.34.0 <1",
103
+ "@xenosystem/data-core": "^0.1.0",
104
+ "@xenosystem/elements": ">=0.0.1",
105
+ "@xenosystem/elements-react": ">=0.0.1",
106
+ "@xenosystem/time-core": "^0.1.0",
107
+ "@xenosystem/tree-core": "^0.1.0",
108
+ "@xenosystem/workbench": "^1.0.0",
109
+ "@xterm/addon-fit": ">=0.10.0",
110
+ "@xterm/xterm": ">=5.5.0",
111
+ "react": ">=18.0.0",
112
+ "react-dom": ">=18.0.0"
113
+ },
114
+ "devDependencies": {
115
+ "@tiptap/core": "^2.27.2",
116
+ "@tiptap/extension-highlight": "^2.27.2",
117
+ "@tiptap/extension-image": "^2.27.2",
118
+ "@tiptap/extension-link": "^2.27.2",
119
+ "@tiptap/extension-placeholder": "^2.27.2",
120
+ "@tiptap/extension-subscript": "^2.27.2",
121
+ "@tiptap/extension-superscript": "^2.27.2",
122
+ "@tiptap/extension-table": "^2.27.2",
123
+ "@tiptap/extension-table-cell": "^2.27.2",
124
+ "@tiptap/extension-table-header": "^2.27.2",
125
+ "@tiptap/extension-table-row": "^2.27.2",
126
+ "@tiptap/extension-task-item": "^2.27.2",
127
+ "@tiptap/extension-task-list": "^2.27.2",
128
+ "@tiptap/extension-text-align": "^2.27.2",
129
+ "@tiptap/extension-typography": "^2.27.2",
130
+ "@tiptap/extension-underline": "^2.27.2",
131
+ "@tiptap/pm": "^2.27.2",
132
+ "@tiptap/starter-kit": "^2.27.2",
133
+ "@types/node": "^22.0.0",
134
+ "@types/react": "^19.0.0",
135
+ "@types/react-dom": "^19.0.0",
136
+ "@xenosystem/block-sdk": "^0.3.4",
137
+ "@xenosystem/components": "^0.34.0",
138
+ "@xenosystem/data-core": "^0.1.0",
139
+ "@xenosystem/elements": "0.0.1",
140
+ "@xenosystem/elements-react": "0.0.1",
141
+ "@xenosystem/time-core": "^0.1.0",
142
+ "@xenosystem/tree-core": "^0.1.0",
143
+ "@xenosystem/workbench": "^1.2.1",
144
+ "@xterm/addon-fit": "^0.11.0",
145
+ "@xterm/xterm": "^6.0.0",
146
+ "jsdom": "^26.0.0",
147
+ "react": "^19.0.0",
148
+ "react-dom": "^19.0.0",
149
+ "tsup": "^8.0.0",
150
+ "typescript": "^5.4.0",
151
+ "vitest": "^4.1.0"
152
+ },
153
+ "publishConfig": {
154
+ "access": "public"
155
+ },
156
+ "peerDependenciesMeta": {
157
+ "@duckdb/duckdb-wasm": {
158
+ "optional": true
159
+ },
160
+ "@tiptap/core": {
161
+ "optional": true
162
+ },
163
+ "@tiptap/extension-highlight": {
164
+ "optional": true
165
+ },
166
+ "@tiptap/extension-image": {
167
+ "optional": true
168
+ },
169
+ "@tiptap/extension-link": {
170
+ "optional": true
171
+ },
172
+ "@tiptap/extension-placeholder": {
173
+ "optional": true
174
+ },
175
+ "@tiptap/extension-subscript": {
176
+ "optional": true
177
+ },
178
+ "@tiptap/extension-superscript": {
179
+ "optional": true
180
+ },
181
+ "@tiptap/extension-table": {
182
+ "optional": true
183
+ },
184
+ "@tiptap/extension-table-cell": {
185
+ "optional": true
186
+ },
187
+ "@tiptap/extension-table-header": {
188
+ "optional": true
189
+ },
190
+ "@tiptap/extension-table-row": {
191
+ "optional": true
192
+ },
193
+ "@tiptap/extension-task-item": {
194
+ "optional": true
195
+ },
196
+ "@tiptap/extension-task-list": {
197
+ "optional": true
198
+ },
199
+ "@tiptap/extension-text-align": {
200
+ "optional": true
201
+ },
202
+ "@tiptap/extension-typography": {
203
+ "optional": true
204
+ },
205
+ "@tiptap/extension-underline": {
206
+ "optional": true
207
+ },
208
+ "@tiptap/pm": {
209
+ "optional": true
210
+ },
211
+ "@tiptap/starter-kit": {
212
+ "optional": true
213
+ },
214
+ "@xterm/addon-fit": {
215
+ "optional": true
216
+ },
217
+ "@xterm/xterm": {
218
+ "optional": true
219
+ }
220
+ }
221
+ }