@matterfact/embed 0.7.0 → 0.8.0
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/README.md +99 -1
- package/dist/chunk-PNSYFXXU.js +791 -0
- package/dist/chunk-PNSYFXXU.js.map +1 -0
- package/dist/chunk-R2ZEJARX.js +776 -0
- package/dist/chunk-R2ZEJARX.js.map +1 -0
- package/dist/{chunk-4Q2ROXLR.js → chunk-UD7CAQXV.js} +2 -2
- package/dist/{chunk-7I37ZFAJ.js → chunk-UQCETVRF.js} +2 -2
- package/dist/chunk-W52Q7G4J.js +3 -0
- package/dist/chunk-W52Q7G4J.js.map +7 -0
- package/dist/context-ARBB2XD6.js +3 -0
- package/dist/{context-YX2KXFLI.js.map → context-ARBB2XD6.js.map} +1 -1
- package/dist/{context-WU2F5CBC.js → context-MVGSYIMB.js} +2 -2
- package/dist/embed.js +1 -1
- package/dist/embed.js.map +4 -4
- package/dist/index.cjs +978 -159
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +133 -31
- package/dist/index.d.ts +133 -31
- package/dist/index.js +534 -130
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +1004 -165
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +33 -1
- package/dist/react.d.ts +33 -1
- package/dist/react.js +553 -132
- package/dist/react.js.map +1 -1
- package/dist/{snapshot-MUXE7KXX.js → snapshot-GL4YBMXD.js} +3 -3
- package/dist/{snapshot-MUXE7KXX.js.map → snapshot-GL4YBMXD.js.map} +1 -1
- package/dist/{snapshot-JOGZWESK.js → snapshot-UGTXZVB6.js} +2 -2
- package/examples/embed-demo/README.md +37 -0
- package/examples/embed-demo/src/App.tsx +55 -21
- package/examples/embed-demo/src/HoistDemo.tsx +390 -0
- package/examples/embed-demo/src/main.tsx +7 -0
- package/examples/embed-demo/src/mockXH.ts +492 -0
- package/examples/embed-demo/src/placement.tsx +43 -0
- package/examples/embed-demo/src/styles.css +147 -2
- package/examples/embed-demo/vite.config.ts +2 -2
- package/package.json +1 -1
- package/dist/chunk-AXKXNYRT.js +0 -381
- package/dist/chunk-AXKXNYRT.js.map +0 -1
- package/dist/chunk-D7R6WVHG.js +0 -2
- package/dist/chunk-D7R6WVHG.js.map +0 -7
- package/dist/chunk-RS6RMZ77.js +0 -396
- package/dist/chunk-RS6RMZ77.js.map +0 -1
- package/dist/context-YX2KXFLI.js +0 -3
- /package/dist/{chunk-4Q2ROXLR.js.map → chunk-UD7CAQXV.js.map} +0 -0
- /package/dist/{chunk-7I37ZFAJ.js.map → chunk-UQCETVRF.js.map} +0 -0
- /package/dist/{context-WU2F5CBC.js.map → context-MVGSYIMB.js.map} +0 -0
- /package/dist/{snapshot-JOGZWESK.js.map → snapshot-UGTXZVB6.js.map} +0 -0
package/dist/react.d.cts
CHANGED
|
@@ -25,6 +25,27 @@ interface PageEntity {
|
|
|
25
25
|
data?: Record<string, unknown>;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
/**
|
|
29
|
+
* The Hoist adapter — a pure transform from a `HoistRuntime` (already read out of
|
|
30
|
+
* `window.XH` by hoist-runtime.ts) into the context/snapshot shapes context.ts sends
|
|
31
|
+
* over the bridge.
|
|
32
|
+
*
|
|
33
|
+
* This file never touches `window` or `XH` itself — see hoist-runtime.ts for the only
|
|
34
|
+
* code that does — so every function here is a plain, fully unit-testable transform
|
|
35
|
+
* against a plain object. That split is what keeps this file degrade-safe: it can be
|
|
36
|
+
* exhaustively tested without a real Hoist app, and hoist-runtime.ts's own try/catch
|
|
37
|
+
* (via detectHoist) is the one place a live-model surprise can ever throw.
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
/** The host's policy for agent-driven actions, keyed by tool family. Read from
|
|
41
|
+
* `window.matterfact.hoist.actions` by hoist-runtime.ts's `readActionsConfig`
|
|
42
|
+
* (the `<MatterfactAgent actions>` React prop is sugar that writes that same
|
|
43
|
+
* global — see react.tsx's `writeActionsGlobal`); `'off'` is the default — the
|
|
44
|
+
* tool is opt-in, never advertised unless a host turns it on. */
|
|
45
|
+
interface HoistActionsConfig {
|
|
46
|
+
navigate: 'off' | 'confirm' | 'auto';
|
|
47
|
+
}
|
|
48
|
+
|
|
28
49
|
interface MatterfactAgentProps {
|
|
29
50
|
/** Publishable key (`pk_…`) identifying this embed app. Public, origin-scoped. */
|
|
30
51
|
publishableKey: string;
|
|
@@ -76,8 +97,19 @@ interface MatterfactAgentProps {
|
|
|
76
97
|
* OR'd together.
|
|
77
98
|
*/
|
|
78
99
|
dev?: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Turn on agent-driven host tools (today: `hoist.navigate`) at the given confirm
|
|
102
|
+
* tier, e.g. `{ navigate: 'confirm' }`. Default is every action tool OFF; this is
|
|
103
|
+
* opt-in only.
|
|
104
|
+
*
|
|
105
|
+
* This is just sugar over setting `window.matterfact.hoist.actions` yourself — the
|
|
106
|
+
* LAZY chunk (adapters/hoist-runtime.ts's `readActionsConfig`) reads that global
|
|
107
|
+
* directly at advertise/execute time, so there is nothing for the eager loader to
|
|
108
|
+
* carry. See `writeActionsGlobal` below.
|
|
109
|
+
*/
|
|
110
|
+
actions?: HoistActionsConfig;
|
|
79
111
|
}
|
|
80
|
-
declare function MatterfactAgent({ publishableKey, widgetOrigin, surface, theme, getAuthToken, getPageContext, inline, className, style, pageContext, dev, }: MatterfactAgentProps): react_jsx_runtime.JSX.Element | null;
|
|
112
|
+
declare function MatterfactAgent({ publishableKey, widgetOrigin, surface, theme, getAuthToken, getPageContext, inline, className, style, pageContext, dev, actions, }: MatterfactAgentProps): react_jsx_runtime.JSX.Element | null;
|
|
81
113
|
interface MatterfactArtifactProps {
|
|
82
114
|
/** The artifact's slug/name. */
|
|
83
115
|
slug: string;
|
package/dist/react.d.ts
CHANGED
|
@@ -25,6 +25,27 @@ interface PageEntity {
|
|
|
25
25
|
data?: Record<string, unknown>;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
/**
|
|
29
|
+
* The Hoist adapter — a pure transform from a `HoistRuntime` (already read out of
|
|
30
|
+
* `window.XH` by hoist-runtime.ts) into the context/snapshot shapes context.ts sends
|
|
31
|
+
* over the bridge.
|
|
32
|
+
*
|
|
33
|
+
* This file never touches `window` or `XH` itself — see hoist-runtime.ts for the only
|
|
34
|
+
* code that does — so every function here is a plain, fully unit-testable transform
|
|
35
|
+
* against a plain object. That split is what keeps this file degrade-safe: it can be
|
|
36
|
+
* exhaustively tested without a real Hoist app, and hoist-runtime.ts's own try/catch
|
|
37
|
+
* (via detectHoist) is the one place a live-model surprise can ever throw.
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
/** The host's policy for agent-driven actions, keyed by tool family. Read from
|
|
41
|
+
* `window.matterfact.hoist.actions` by hoist-runtime.ts's `readActionsConfig`
|
|
42
|
+
* (the `<MatterfactAgent actions>` React prop is sugar that writes that same
|
|
43
|
+
* global — see react.tsx's `writeActionsGlobal`); `'off'` is the default — the
|
|
44
|
+
* tool is opt-in, never advertised unless a host turns it on. */
|
|
45
|
+
interface HoistActionsConfig {
|
|
46
|
+
navigate: 'off' | 'confirm' | 'auto';
|
|
47
|
+
}
|
|
48
|
+
|
|
28
49
|
interface MatterfactAgentProps {
|
|
29
50
|
/** Publishable key (`pk_…`) identifying this embed app. Public, origin-scoped. */
|
|
30
51
|
publishableKey: string;
|
|
@@ -76,8 +97,19 @@ interface MatterfactAgentProps {
|
|
|
76
97
|
* OR'd together.
|
|
77
98
|
*/
|
|
78
99
|
dev?: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Turn on agent-driven host tools (today: `hoist.navigate`) at the given confirm
|
|
102
|
+
* tier, e.g. `{ navigate: 'confirm' }`. Default is every action tool OFF; this is
|
|
103
|
+
* opt-in only.
|
|
104
|
+
*
|
|
105
|
+
* This is just sugar over setting `window.matterfact.hoist.actions` yourself — the
|
|
106
|
+
* LAZY chunk (adapters/hoist-runtime.ts's `readActionsConfig`) reads that global
|
|
107
|
+
* directly at advertise/execute time, so there is nothing for the eager loader to
|
|
108
|
+
* carry. See `writeActionsGlobal` below.
|
|
109
|
+
*/
|
|
110
|
+
actions?: HoistActionsConfig;
|
|
79
111
|
}
|
|
80
|
-
declare function MatterfactAgent({ publishableKey, widgetOrigin, surface, theme, getAuthToken, getPageContext, inline, className, style, pageContext, dev, }: MatterfactAgentProps): react_jsx_runtime.JSX.Element | null;
|
|
112
|
+
declare function MatterfactAgent({ publishableKey, widgetOrigin, surface, theme, getAuthToken, getPageContext, inline, className, style, pageContext, dev, actions, }: MatterfactAgentProps): react_jsx_runtime.JSX.Element | null;
|
|
81
113
|
interface MatterfactArtifactProps {
|
|
82
114
|
/** The artifact's slug/name. */
|
|
83
115
|
slug: string;
|