@xenosystem/blocks 0.1.0 → 0.1.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.
- package/dist/auth/index.d.ts +41 -1
- package/dist/auth/index.js +32 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +6 -3
package/dist/auth/index.d.ts
CHANGED
|
@@ -118,4 +118,44 @@ interface AuthGateViewProps {
|
|
|
118
118
|
}
|
|
119
119
|
declare function AuthGateView({ controller, productName, children, heroSrc, now }: AuthGateViewProps): react.JSX.Element;
|
|
120
120
|
|
|
121
|
-
|
|
121
|
+
/**
|
|
122
|
+
* `mountXenoAuthGate` — the per-product plug, exactly as `XENO AUTH - AUTH GATE DELTA.md` §4 specifies:
|
|
123
|
+
*
|
|
124
|
+
* mountXenoAuthGate(root, {
|
|
125
|
+
* product: { slug: 'canvas', name: 'XENO Canvas' },
|
|
126
|
+
* bridge: window.xenoAuthGate, // preload-exposed: subscribe(state) + send(intent)
|
|
127
|
+
* children: () => renderTheApp(), // called ONLY once phase === 'open'
|
|
128
|
+
* })
|
|
129
|
+
*
|
|
130
|
+
* A product is NOT a workbench host, so it does not go through `createAuthGatePanel` (a PanelModule
|
|
131
|
+
* that needs a PanelHost). This mounts the same controller + view directly over a two-verb bridge:
|
|
132
|
+
* the host pushes state, the gate emits intents, nothing else crosses. The gate holds no token and
|
|
133
|
+
* calls no SDK (LICENCE-ENFORCEMENT §1: main process, never the renderer).
|
|
134
|
+
*
|
|
135
|
+
* Not per product: the design, the copy, the phase derivation. A product that edits those has found a
|
|
136
|
+
* gate defect, fixed once here — MOVE, never port.
|
|
137
|
+
*/
|
|
138
|
+
|
|
139
|
+
interface XenoAuthGateBridge {
|
|
140
|
+
/** Receive every state push; returns the unsubscribe. The host pushes the current state on subscribe. */
|
|
141
|
+
subscribe: (listener: (state: XenoAuthGateState) => void) => () => void;
|
|
142
|
+
/** Route an intent to the host (main process). */
|
|
143
|
+
send: (intent: XenoAuthGateIntent) => void;
|
|
144
|
+
}
|
|
145
|
+
interface MountXenoAuthGateOptions {
|
|
146
|
+
product: {
|
|
147
|
+
slug: string;
|
|
148
|
+
name: string;
|
|
149
|
+
};
|
|
150
|
+
bridge: XenoAuthGateBridge;
|
|
151
|
+
/** Rendered ONLY when the phase is `open`. */
|
|
152
|
+
children: () => ReactNode;
|
|
153
|
+
heroSrc?: string;
|
|
154
|
+
}
|
|
155
|
+
interface MountedXenoAuthGate {
|
|
156
|
+
controller: AuthGateController;
|
|
157
|
+
unmount: () => void;
|
|
158
|
+
}
|
|
159
|
+
declare function mountXenoAuthGate(root: HTMLElement, options: MountXenoAuthGateOptions): MountedXenoAuthGate;
|
|
160
|
+
|
|
161
|
+
export { AUTH_GATE_INITIAL, AUTH_GATE_PANEL_ID, AuthGateController, type AuthGateHostBridge, AuthGateView, type AuthGateViewProps, type CreateAuthGatePanelOptions, type MountXenoAuthGateOptions, type MountedXenoAuthGate, PHASE_INTENTS, type XenoAuthGateBridge, type XenoAuthGateIntent, type XenoAuthGateIntentKind, type XenoAuthGatePhase, type XenoAuthGateState, type XenoLicenceState, authGateManifest, authGatePanel, createAuthGatePanel, deriveAuthGatePhase, formatSince, hostContradiction, intentOffered, mountXenoAuthGate };
|
package/dist/auth/index.js
CHANGED
|
@@ -256,6 +256,36 @@ function createAuthGatePanel(options = {}) {
|
|
|
256
256
|
}
|
|
257
257
|
var authGatePanel = createAuthGatePanel();
|
|
258
258
|
|
|
259
|
+
// src/auth/gate/mount.ts
|
|
260
|
+
import { createElement as createElement2 } from "react";
|
|
261
|
+
import { createRoot as createRoot2 } from "react-dom/client";
|
|
262
|
+
function mountXenoAuthGate(root, options) {
|
|
263
|
+
const controller = new AuthGateController({ emit: (_port, value) => options.bridge.send(value) });
|
|
264
|
+
const reactRoot = createRoot2(root);
|
|
265
|
+
const draw = () => reactRoot.render(
|
|
266
|
+
createElement2(AuthGateView, {
|
|
267
|
+
controller,
|
|
268
|
+
productName: options.product.name,
|
|
269
|
+
heroSrc: options.heroSrc,
|
|
270
|
+
children: createElement2(Behind, { render: options.children })
|
|
271
|
+
})
|
|
272
|
+
);
|
|
273
|
+
const unsubscribe = options.bridge.subscribe((state) => controller.setState(state));
|
|
274
|
+
const stop = controller.subscribe(draw);
|
|
275
|
+
draw();
|
|
276
|
+
return {
|
|
277
|
+
controller,
|
|
278
|
+
unmount: () => {
|
|
279
|
+
stop();
|
|
280
|
+
unsubscribe();
|
|
281
|
+
reactRoot.unmount();
|
|
282
|
+
}
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
function Behind({ render }) {
|
|
286
|
+
return render();
|
|
287
|
+
}
|
|
288
|
+
|
|
259
289
|
// src/auth/index.ts
|
|
260
290
|
export * from "@xenosystem/panel-account";
|
|
261
291
|
export {
|
|
@@ -270,5 +300,6 @@ export {
|
|
|
270
300
|
deriveAuthGatePhase,
|
|
271
301
|
formatSince,
|
|
272
302
|
hostContradiction,
|
|
273
|
-
intentOffered
|
|
303
|
+
intentOffered,
|
|
304
|
+
mountXenoAuthGate
|
|
274
305
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
* `/agent`. This root re-exports nothing on purpose: import the family you mount, so a product
|
|
5
5
|
* carries only it. Naming rule: `XENO PACKAGE NAMING - STANDARD.md`.
|
|
6
6
|
*/
|
|
7
|
-
declare const BLOCKS_VERSION = "0.1.
|
|
7
|
+
declare const BLOCKS_VERSION = "0.1.1";
|
|
8
8
|
|
|
9
9
|
export { BLOCKS_VERSION };
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xenosystem/blocks",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.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",
|
|
@@ -26,10 +26,11 @@
|
|
|
26
26
|
"test": "vitest run"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"@xenosystem/components": "^0.1
|
|
29
|
+
"@xenosystem/components": "^0.3.1",
|
|
30
30
|
"@xenosystem/elements-react": ">=0.0.1",
|
|
31
31
|
"@xenosystem/panel-account": "^0.1.0",
|
|
32
32
|
"@xenosystem/panel-sdk": "^1.1.0",
|
|
33
|
+
"@xenosystem/workbench": "^1.0.0",
|
|
33
34
|
"react": ">=18.0.0",
|
|
34
35
|
"react-dom": ">=18.0.0"
|
|
35
36
|
},
|
|
@@ -37,10 +38,12 @@
|
|
|
37
38
|
"@types/node": "^22.0.0",
|
|
38
39
|
"@types/react": "^19.0.0",
|
|
39
40
|
"@types/react-dom": "^19.0.0",
|
|
40
|
-
"@xenosystem/components": "^0.1
|
|
41
|
+
"@xenosystem/components": "^0.3.1",
|
|
41
42
|
"@xenosystem/elements-react": "0.0.1",
|
|
42
43
|
"@xenosystem/panel-account": "^0.1.0",
|
|
43
44
|
"@xenosystem/panel-sdk": "^1.1.0",
|
|
45
|
+
"@xenosystem/workbench": "^1.0.0",
|
|
46
|
+
"jsdom": "^26.0.0",
|
|
44
47
|
"react": "^19.0.0",
|
|
45
48
|
"react-dom": "^19.0.0",
|
|
46
49
|
"tsup": "^8.0.0",
|