@nimblebrain/synapse 0.10.2 → 0.12.0-rc.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 +1 -0
- package/dist/chunk-3HQGHPNC.js +20 -0
- package/dist/chunk-3HQGHPNC.js.map +1 -0
- package/dist/{chunk-74EGUVGE.cjs → chunk-A4ENX6XW.cjs} +7 -79
- package/dist/chunk-A4ENX6XW.cjs.map +1 -0
- package/dist/chunk-ANUZ7WFQ.cjs +476 -0
- package/dist/chunk-ANUZ7WFQ.cjs.map +1 -0
- package/dist/chunk-JVKQNMAP.js +463 -0
- package/dist/chunk-JVKQNMAP.js.map +1 -0
- package/dist/chunk-KTXASIFJ.cjs +75 -0
- package/dist/chunk-KTXASIFJ.cjs.map +1 -0
- package/dist/chunk-RX6XCLFF.cjs +23 -0
- package/dist/chunk-RX6XCLFF.cjs.map +1 -0
- package/dist/chunk-VXTMI266.js +73 -0
- package/dist/chunk-VXTMI266.js.map +1 -0
- package/dist/{chunk-S7QIWD46.js → chunk-XGJAADVV.js} +4 -75
- package/dist/chunk-XGJAADVV.js.map +1 -0
- package/dist/codegen/index.cjs +5 -5
- package/dist/codegen/index.js +1 -1
- package/dist/connect.iife.global.js +18 -18
- package/dist/detect-DSnLT-_m.d.cts +171 -0
- package/dist/detect-DSnLT-_m.d.ts +171 -0
- package/dist/host/index.cjs +57 -0
- package/dist/host/index.cjs.map +1 -0
- package/dist/host/index.d.cts +68 -0
- package/dist/host/index.d.ts +68 -0
- package/dist/host/index.js +4 -0
- package/dist/host/index.js.map +1 -0
- package/dist/index.cjs +21 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/react/index.cjs +5 -4
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.js +2 -1
- package/dist/react/index.js.map +1 -1
- package/dist/synapse-runtime.iife.global.js +18 -18
- package/dist/synapse-ui.iife.global.js +1 -0
- package/dist/ui/base.cjs +13 -0
- package/dist/ui/base.cjs.map +1 -0
- package/dist/ui/base.d.cts +27 -0
- package/dist/ui/base.d.ts +27 -0
- package/dist/ui/base.js +7 -0
- package/dist/ui/base.js.map +1 -0
- package/dist/ui/index.cjs +14 -24
- package/dist/ui/index.cjs.map +1 -1
- package/dist/ui/index.js +2 -12
- package/dist/ui/index.js.map +1 -1
- package/package.json +14 -1
- package/dist/chunk-74EGUVGE.cjs.map +0 -1
- package/dist/chunk-S7QIWD46.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(){'use strict';var de={"--color-background-primary":"#ffffff","--color-background-secondary":"#fafafa","--color-background-tertiary":"#f3f4f6","--color-text-primary":"#111827","--color-text-secondary":"#6b7280","--color-text-tertiary":"#9ca3af","--color-text-accent":"#2563eb","--nb-color-accent-foreground":"#ffffff","--color-border-primary":"#e5e7eb","--color-border-secondary":"#d1d5db","--color-ring-primary":"#2563eb","--nb-color-danger":"#dc2626","--nb-color-success":"#059669","--nb-color-warning":"#f59e0b","--nb-color-warm":"#d4620a","--nb-color-warm-light":"#fef5ee","--nb-color-processing":"#7c3aed","--nb-color-processing-light":"#f3eeff","--nb-color-info-light":"#eef4ff"},ue={"--color-background-primary":"#18181b","--color-background-secondary":"#27272a","--color-background-tertiary":"#2f2f34","--color-text-primary":"#fafafa","--color-text-secondary":"#a1a1aa","--color-text-tertiary":"#71717a","--color-text-accent":"#818cf8","--nb-color-accent-foreground":"#ffffff","--color-border-primary":"#3f3f46","--color-border-secondary":"#52525b","--color-ring-primary":"#818cf8","--nb-color-danger":"#f87171","--nb-color-success":"#34d399","--nb-color-warning":"#fbbf24","--nb-color-warm":"#fb923c","--nb-color-warm-light":"#3a2a1e","--nb-color-processing":"#a78bfa","--nb-color-processing-light":"#2a2440","--nb-color-info-light":"#1e2a44"},pe={light:de,dark:ue};function N(t,r){if(typeof document>"u")return;let n=document.documentElement.style;for(let[i,l]of Object.entries(pe[t]))n.setProperty(i,l);if(r&&typeof r=="object")for(let[i,l]of Object.entries(r))typeof i=="string"&&typeof l=="string"&&n.setProperty(i,l);}function R(t){typeof document<"u"&&document.documentElement.setAttribute("data-theme",t.mode),N(t.mode,t.tokens);}function C(t){try{if(t?.matchMedia?.("(prefers-color-scheme: dark)").matches)return "dark"}catch{}return "light"}function h(t,r){return t==="light"||t==="dark"?t:r}var b=class extends Error{constructor(r,n){super(`"${r}" is not supported by the "${n}" host`),this.name="HostUnsupportedError";}},A="synapse-ui-data",z="ui-lifecycle-iframe-ready",j="ui-lifecycle-iframe-render-data",G="ui-size-change",K="link",W="prompt",S="openai:set_globals",F="2026-01-26",Z="ui/initialize",q="ui/notifications/initialized",Y="ui/notifications/tool-result",V="ui/notifications/host-context-changed",B="ui/notifications/size-changed",Q="ui/open-link",$="ui/message",X="ui/resource-teardown",J="tools/call";function ee(t,r){let n=()=>t.openai,i=n()?.toolOutput??null,l={mode:h(n()?.theme,"light"),tokens:{}},a=new Set,p=new Set,f=false,m=s=>{if(f)return;let c=s.detail?.globals;if(c){if("toolOutput"in c&&c.toolOutput!=null){i=c.toolOutput;for(let u of a)u(i);}if("theme"in c&&c.theme!=null){let u=h(c.theme,l.mode);if(u!==l.mode){l={mode:u,tokens:{}};for(let P of p)P(l);}}}};return {host:"chatgpt",getData:()=>i,onData(s){return a.add(s),()=>a.delete(s)},getTheme:()=>l,onTheme(s){return p.add(s),()=>p.delete(s)},async callTool(s,c){let u=n()?.callTool;if(!u)throw new b("callTool","chatgpt");return await u(s,c??{})},sendPrompt(s){let c=n();(c?.sendFollowUpMessage??c?.sendFollowupMessage)?.({prompt:s});},openLink(s){let c=n()?.openExternal;c?c({href:s}):t.open(s,"_blank","noopener,noreferrer");},resize(){},capabilities(){let s=n();return {pull:typeof s?.callTool=="function",sendPrompt:typeof s?.sendFollowUpMessage=="function"||typeof s?.sendFollowupMessage=="function",openLink:true}},start(){t.addEventListener(S,m,{passive:true}),i=n()?.toolOutput??i;},destroy(){f||(f=true,t.removeEventListener(S,m),a.clear(),p.clear());}}}function O(t,r){if(!t)return null;let i=t.getElementById(r)?.textContent;if(!i)return null;try{return JSON.parse(i)??null}catch{return null}}function L(t){if(t==null||typeof t!="object")return null;let r=t,n=r.renderData,i=n!=null&&typeof n=="object"?n:r;return i.toolOutput!=null?i.toolOutput:i.structuredContent!=null?i.structuredContent:i}function te(t,r){let n=r.dataElementId??A,i=null,l={mode:C(t),tokens:{}},a=new Set,p=false,f=null,m=s=>{if(p)return;let c=h(s.matches?"dark":"light",l.mode);if(c!==l.mode){l={mode:c,tokens:{}};for(let u of a)u(l);}};return {host:"generic",getData:()=>i,onData(){return ()=>{}},getTheme:()=>l,onTheme(s){return a.add(s),()=>a.delete(s)},async callTool(s){throw new b("callTool","generic")},sendPrompt(){},openLink(s){t.open(s,"_blank","noopener,noreferrer");},resize(){},capabilities(){return {pull:false,sendPrompt:false,openLink:true}},start(){i=O(t.document,n);try{f=t.matchMedia?.("(prefers-color-scheme: dark)")??null,f?.addEventListener?.("change",m);}catch{f=null;}},destroy(){p||(p=true,f?.removeEventListener?.("change",m),f=null,a.clear());}}}var fe=3e4;function ne(t,r){let n=r.dataElementId??A,i=r.autoResize!==false,l=null,a={mode:C(t),tokens:{}},p=new Set,f=new Set,m=false,s=false,c=1,u=new Map,P=-1,v=null,k=null,U=()=>t.parent??t;function I(e){U().postMessage(e,"*");}function _(e){s||I(e);}function x(e,o){I({jsonrpc:"2.0",method:e,params:o??{}});}function w(e,o){let d=c++;return new Promise((g,y)=>{let T=setTimeout(()=>{u.delete(d),y(new Error(`"${e}" timed out`));},fe);u.set(d,{resolve:g,reject:y,timer:T}),I({jsonrpc:"2.0",id:d,method:e,params:o??{}});})}function D(e){if(e!=null){l=e;for(let o of p)o(e);}}function M(e){if(!e||typeof e!="object")return;let{mode:o,tokens:d}=a,g=false;if(e.theme!=null){let T=h(e.theme,o);T!==o&&(o=T,g=true);}let y=e.styles;if(y?.variables&&typeof y.variables=="object"&&(d={...d,...y.variables},g=true),g){a={mode:o,tokens:d};for(let T of f)T(a);}}function E(e){if(m)return;let o=typeof e=="number"?e:Math.ceil(t.document.body.scrollHeight);o!==P&&(P=o,x(B,{height:o}),_({type:G,payload:{height:o}}));}function se(e){let o=Number(e.id),d=u.get(o);if(d)if(u.delete(o),clearTimeout(d.timer),e.error!=null){let g=e.error;d.reject(new Error(g.message??"request failed"));}else d.resolve(e.result);}function ie(e,o){if(e===Y){let d=o.structuredContent;D(d??L(o));}else e===V&&M(o);}function ae(e){e.method===X&&I({jsonrpc:"2.0",id:e.id,result:{}});}function le(e){if(e.type===j||e.type==="renderData"){let{theme:o,...d}=e.payload??{};o!=null&&M({theme:o}),Object.keys(d).length>0&&D(L(d));}}let H=e=>{if(m||e.source&&e.source!==U())return;let o=e.data;if(!(!o||typeof o!="object")){if(o.jsonrpc!=="2.0"){le(o);return}o.id!=null&&("result"in o||"error"in o)?se(o):typeof o.method=="string"&&(o.id!=null?ae(o):ie(o.method,o.params??{}));}};function ce(){k=()=>E(),t.addEventListener("resize",k),typeof t.ResizeObserver<"u"&&(v=new t.ResizeObserver(()=>E()),v.observe(t.document.body));}return {host:"claude",getData:()=>l,onData(e){return p.add(e),()=>p.delete(e)},getTheme:()=>a,onTheme(e){return f.add(e),()=>f.delete(e)},async callTool(e,o){return await w(J,{name:e,arguments:o??{}})},sendPrompt(e){w($,{role:"user",content:[{type:"text",text:e}]}).catch(()=>{}),_({type:W,payload:{prompt:e}});},openLink(e){w(Q,{url:e}).catch(()=>{}),_({type:K,payload:{url:e}});},resize(e){E(e);},capabilities(){return {pull:true,sendPrompt:true,openLink:true}},start(){t.addEventListener("message",H),l=O(t.document,n),i&&ce(),I({type:z}),w(Z,{appInfo:{name:r.name??"synapse-ui",version:r.version??"0.0.0"},appCapabilities:{availableDisplayModes:["inline"]},protocolVersion:F}).then(e=>{m||(s=true,M(e?.hostContext),x(q,{}),P=-1,E());}).catch(()=>{}),E();},destroy(){if(!m){m=true,t.removeEventListener("message",H),k&&t.removeEventListener("resize",k),k=null,v?.disconnect(),v=null;for(let e of u.values())clearTimeout(e.timer),e.reject(new Error("adapter destroyed"));u.clear(),p.clear(),f.clear();}}}}function me(t){if(t.openai!=null)return "chatgpt";try{if(t.parent!=null&&t.parent!==t)return "claude"}catch{return "claude"}return "generic"}function ge(t,r,n){switch(t){case "chatgpt":return ee(r);case "claude":case "nimblebrain":return ne(r,n);default:return te(r,n)}}function oe(t,r){let n=r.host??me(t);return ge(n,t,r)}function re(t={}){let r=t.window??globalThis,n=oe(r,t);R(n.getTheme());let i=n.onTheme(R);n.start();let l=false;return {data:()=>n.getData(),onData:a=>n.onData(a),theme:()=>n.getTheme(),onTheme:a=>n.onTheme(a),callTool:(a,p)=>n.callTool(a,p),sendPrompt:a=>n.sendPrompt(a),openLink:a=>n.openLink(a),resize:a=>n.resize(a),capabilities:()=>n.capabilities(),host:()=>n.host,destroy(){l||(l=true,i(),n.destroy());}}}globalThis.SynapseUI={connect:re};})();
|
package/dist/ui/base.cjs
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkRX6XCLFF_cjs = require('../chunk-RX6XCLFF.cjs');
|
|
4
|
+
|
|
5
|
+
// src/ui/base.ts
|
|
6
|
+
chunkRX6XCLFF_cjs.injectBaseReset();
|
|
7
|
+
|
|
8
|
+
Object.defineProperty(exports, "injectBaseReset", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return chunkRX6XCLFF_cjs.injectBaseReset; }
|
|
11
|
+
});
|
|
12
|
+
//# sourceMappingURL=base.cjs.map
|
|
13
|
+
//# sourceMappingURL=base.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/ui/base.ts"],"names":["injectBaseReset"],"mappings":";;;;;AAqBAA,iCAAA,EAAgB","file":"base.cjs","sourcesContent":["/**\n * Establishes the root-height chain a full-pane Synapse app needs. Import for\n * the side effect:\n *\n * ```ts\n * import \"@nimblebrain/synapse/ui/base\";\n * ```\n *\n * This injects `html, body, #root { height: 100% }` (so a `height: 100%` app\n * shell resolves against the iframe's allocated pane) and `body { margin: 0 }`\n * (so the pane has no UA-margin gap). See `./internal/base-reset.ts` for why a\n * percentage chain — not a viewport unit — is the correct mechanism.\n *\n * `AppFrame` already calls `injectBaseReset()` on render, so apps built on it\n * get the chain automatically. Import this module explicitly to establish the\n * chain *before* React mounts — avoiding a first-paint layout jump — or for an\n * app that renders a full-pane root without `AppFrame`.\n */\n\nimport { injectBaseReset } from \"./internal/base-reset.js\";\n\ninjectBaseReset();\n\nexport { injectBaseReset };\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The root-height chain every full-pane Synapse app needs, as a plain function
|
|
3
|
+
* (no side effect on import — so a component can call it on render without the
|
|
4
|
+
* mere act of importing injecting anything). The side-effect entry point is
|
|
5
|
+
* `../base.ts` (`@nimblebrain/synapse/ui/base`).
|
|
6
|
+
*
|
|
7
|
+
* `AppFrame` sizes the app shell with `height: 100%`, which only resolves if its
|
|
8
|
+
* ancestor chain (`#root` → `body` → `html`) has a definite height. Each app
|
|
9
|
+
* iframe is its own bare document, so without this chain the shell collapses to
|
|
10
|
+
* content height — full width, short height — inside the host pane.
|
|
11
|
+
*
|
|
12
|
+
* Percentages resolve against the actual pane box, which is correct whether the
|
|
13
|
+
* app is sandboxed in an iframe or mounted into a host panel. A viewport unit
|
|
14
|
+
* (`vh`/`dvh`) would instead assume the pane equals the viewport — wrong on
|
|
15
|
+
* hosts that allocate a pane shorter than the viewport (it overflows with a
|
|
16
|
+
* second scrollbar). The `#root` rule targets the conventional mount id and
|
|
17
|
+
* harmlessly matches nothing if an app mounts elsewhere; `html, body` still
|
|
18
|
+
* apply. `body { margin: 0 }` removes the UA default so the pane has no gap.
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* Inject the root-height + body-margin reset once. Idempotent (keyed by a
|
|
22
|
+
* single style id) and SSR-safe (no-ops when `document` is unavailable, via
|
|
23
|
+
* `ensureStyle`).
|
|
24
|
+
*/
|
|
25
|
+
declare function injectBaseReset(): void;
|
|
26
|
+
|
|
27
|
+
export { injectBaseReset };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The root-height chain every full-pane Synapse app needs, as a plain function
|
|
3
|
+
* (no side effect on import — so a component can call it on render without the
|
|
4
|
+
* mere act of importing injecting anything). The side-effect entry point is
|
|
5
|
+
* `../base.ts` (`@nimblebrain/synapse/ui/base`).
|
|
6
|
+
*
|
|
7
|
+
* `AppFrame` sizes the app shell with `height: 100%`, which only resolves if its
|
|
8
|
+
* ancestor chain (`#root` → `body` → `html`) has a definite height. Each app
|
|
9
|
+
* iframe is its own bare document, so without this chain the shell collapses to
|
|
10
|
+
* content height — full width, short height — inside the host pane.
|
|
11
|
+
*
|
|
12
|
+
* Percentages resolve against the actual pane box, which is correct whether the
|
|
13
|
+
* app is sandboxed in an iframe or mounted into a host panel. A viewport unit
|
|
14
|
+
* (`vh`/`dvh`) would instead assume the pane equals the viewport — wrong on
|
|
15
|
+
* hosts that allocate a pane shorter than the viewport (it overflows with a
|
|
16
|
+
* second scrollbar). The `#root` rule targets the conventional mount id and
|
|
17
|
+
* harmlessly matches nothing if an app mounts elsewhere; `html, body` still
|
|
18
|
+
* apply. `body { margin: 0 }` removes the UA default so the pane has no gap.
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* Inject the root-height + body-margin reset once. Idempotent (keyed by a
|
|
22
|
+
* single style id) and SSR-safe (no-ops when `document` is unavailable, via
|
|
23
|
+
* `ensureStyle`).
|
|
24
|
+
*/
|
|
25
|
+
declare function injectBaseReset(): void;
|
|
26
|
+
|
|
27
|
+
export { injectBaseReset };
|
package/dist/ui/base.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/ui/base.ts"],"names":[],"mappings":";;;;AAqBA,eAAA,EAAgB","file":"base.js","sourcesContent":["/**\n * Establishes the root-height chain a full-pane Synapse app needs. Import for\n * the side effect:\n *\n * ```ts\n * import \"@nimblebrain/synapse/ui/base\";\n * ```\n *\n * This injects `html, body, #root { height: 100% }` (so a `height: 100%` app\n * shell resolves against the iframe's allocated pane) and `body { margin: 0 }`\n * (so the pane has no UA-margin gap). See `./internal/base-reset.ts` for why a\n * percentage chain — not a viewport unit — is the correct mechanism.\n *\n * `AppFrame` already calls `injectBaseReset()` on render, so apps built on it\n * get the chain automatically. Import this module explicitly to establish the\n * chain *before* React mounts — avoiding a first-paint layout jump — or for an\n * app that renders a full-pane root without `AppFrame`.\n */\n\nimport { injectBaseReset } from \"./internal/base-reset.js\";\n\ninjectBaseReset();\n\nexport { injectBaseReset };\n"]}
|
package/dist/ui/index.cjs
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var chunkRX6XCLFF_cjs = require('../chunk-RX6XCLFF.cjs');
|
|
3
4
|
var react = require('react');
|
|
4
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
6
|
|
|
6
|
-
// src/ui/components/Avatar.tsx
|
|
7
|
-
|
|
8
7
|
// src/ui/tokens.ts
|
|
9
8
|
var tokens = {
|
|
10
9
|
// ── Surfaces ──
|
|
@@ -166,16 +165,6 @@ function Badge({ tone = "neutral", style, children, ...rest }) {
|
|
|
166
165
|
}
|
|
167
166
|
);
|
|
168
167
|
}
|
|
169
|
-
|
|
170
|
-
// src/ui/internal/inject-style.ts
|
|
171
|
-
function ensureStyle(id, css) {
|
|
172
|
-
if (typeof document === "undefined") return;
|
|
173
|
-
if (document.getElementById(id)) return;
|
|
174
|
-
const style = document.createElement("style");
|
|
175
|
-
style.id = id;
|
|
176
|
-
style.textContent = css;
|
|
177
|
-
document.head.appendChild(style);
|
|
178
|
-
}
|
|
179
168
|
var STYLE_ID = "nb-synapse-button";
|
|
180
169
|
var RULES = `
|
|
181
170
|
.nb-btn {
|
|
@@ -223,7 +212,7 @@ function Button({
|
|
|
223
212
|
children,
|
|
224
213
|
...rest
|
|
225
214
|
}) {
|
|
226
|
-
ensureStyle(STYLE_ID, RULES);
|
|
215
|
+
chunkRX6XCLFF_cjs.ensureStyle(STYLE_ID, RULES);
|
|
227
216
|
const vars = {
|
|
228
217
|
"--nb-btn-radius": tokens.radiusSm,
|
|
229
218
|
"--nb-btn-font": tokens.fontSans,
|
|
@@ -253,7 +242,7 @@ function Button({
|
|
|
253
242
|
return /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: `nb-btn ${className ?? ""}`.trim(), style: btnStyle, ...rest, children });
|
|
254
243
|
}
|
|
255
244
|
function TextLink({ tone = "muted", style, className, children, ...rest }) {
|
|
256
|
-
ensureStyle(STYLE_ID, RULES);
|
|
245
|
+
chunkRX6XCLFF_cjs.ensureStyle(STYLE_ID, RULES);
|
|
257
246
|
const resting = tone === "danger" ? tokens.danger : tone === "default" ? tokens.fg : tokens.fgMuted;
|
|
258
247
|
const hover = tone === "danger" ? tokens.danger : tokens.accent;
|
|
259
248
|
const linkStyle = {
|
|
@@ -295,7 +284,7 @@ function Card({
|
|
|
295
284
|
children,
|
|
296
285
|
...rest
|
|
297
286
|
}) {
|
|
298
|
-
if (interactive) ensureStyle(STYLE_ID2, RULES2);
|
|
287
|
+
if (interactive) chunkRX6XCLFF_cjs.ensureStyle(STYLE_ID2, RULES2);
|
|
299
288
|
const cardStyle = {
|
|
300
289
|
background: tokens.bgRaised,
|
|
301
290
|
border: `${tokens.borderWidth} solid ${tokens.border}`,
|
|
@@ -353,7 +342,7 @@ function DrawerRoot({
|
|
|
353
342
|
children,
|
|
354
343
|
...rest
|
|
355
344
|
}) {
|
|
356
|
-
ensureStyle(STYLE_ID3, RULES3);
|
|
345
|
+
chunkRX6XCLFF_cjs.ensureStyle(STYLE_ID3, RULES3);
|
|
357
346
|
const dialogRef = react.useRef(null);
|
|
358
347
|
const labelId = react.useId();
|
|
359
348
|
const [hasTitle, setHasTitle] = react.useState(false);
|
|
@@ -672,7 +661,7 @@ function ListRow({
|
|
|
672
661
|
className,
|
|
673
662
|
...rest
|
|
674
663
|
}) {
|
|
675
|
-
ensureStyle(STYLE_ID4, RULES4);
|
|
664
|
+
chunkRX6XCLFF_cjs.ensureStyle(STYLE_ID4, RULES4);
|
|
676
665
|
const rowStyle = {
|
|
677
666
|
"--nb-listrow-hover": tokens.bgSubtle,
|
|
678
667
|
display: "grid",
|
|
@@ -812,7 +801,7 @@ var RULES5 = `
|
|
|
812
801
|
.nb-prose strong { font-weight: ${tokens.weightSemibold}; }
|
|
813
802
|
`;
|
|
814
803
|
function Prose({ html, children, className, ...rest }) {
|
|
815
|
-
ensureStyle(STYLE_ID5, RULES5);
|
|
804
|
+
chunkRX6XCLFF_cjs.ensureStyle(STYLE_ID5, RULES5);
|
|
816
805
|
const cls = `nb-prose ${className ?? ""}`.trim();
|
|
817
806
|
if (html !== void 0) {
|
|
818
807
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cls, dangerouslySetInnerHTML: { __html: html }, ...rest });
|
|
@@ -850,7 +839,7 @@ function SearchField({
|
|
|
850
839
|
type = "search",
|
|
851
840
|
...rest
|
|
852
841
|
}) {
|
|
853
|
-
ensureStyle(STYLE_ID6, RULES6);
|
|
842
|
+
chunkRX6XCLFF_cjs.ensureStyle(STYLE_ID6, RULES6);
|
|
854
843
|
const fieldStyle = {
|
|
855
844
|
"--nb-search-font": tokens.fontSans,
|
|
856
845
|
"--nb-search-fg": tokens.fg,
|
|
@@ -909,7 +898,7 @@ function SegmentedControl({
|
|
|
909
898
|
className,
|
|
910
899
|
...rest
|
|
911
900
|
}) {
|
|
912
|
-
ensureStyle(STYLE_ID7, RULES7);
|
|
901
|
+
chunkRX6XCLFF_cjs.ensureStyle(STYLE_ID7, RULES7);
|
|
913
902
|
const trackStyle = {
|
|
914
903
|
"--nb-seg-radius": tokens.radiusSm,
|
|
915
904
|
"--nb-seg-track": tokens.bgSubtle,
|
|
@@ -945,7 +934,7 @@ var RULES8 = `
|
|
|
945
934
|
@media (prefers-reduced-motion: reduce) { .nb-spinner { animation-duration: 1.6s; } }
|
|
946
935
|
`;
|
|
947
936
|
function Spinner({ size = 16, color, style, className, ...rest }) {
|
|
948
|
-
ensureStyle(STYLE_ID8, RULES8);
|
|
937
|
+
chunkRX6XCLFF_cjs.ensureStyle(STYLE_ID8, RULES8);
|
|
949
938
|
const spinnerStyle = {
|
|
950
939
|
display: "inline-block",
|
|
951
940
|
flexShrink: 0,
|
|
@@ -996,7 +985,7 @@ function StatusDot({
|
|
|
996
985
|
className,
|
|
997
986
|
...rest
|
|
998
987
|
}) {
|
|
999
|
-
ensureStyle(STYLE_ID9, KEYFRAMES);
|
|
988
|
+
chunkRX6XCLFF_cjs.ensureStyle(STYLE_ID9, KEYFRAMES);
|
|
1000
989
|
const dotColor = color ?? COLOR[status];
|
|
1001
990
|
const working = status === "working";
|
|
1002
991
|
const dotStyle = {
|
|
@@ -1049,7 +1038,7 @@ function Table({
|
|
|
1049
1038
|
className,
|
|
1050
1039
|
...rest
|
|
1051
1040
|
}) {
|
|
1052
|
-
ensureStyle(STYLE_ID10, RULES9);
|
|
1041
|
+
chunkRX6XCLFF_cjs.ensureStyle(STYLE_ID10, RULES9);
|
|
1053
1042
|
const vars = {
|
|
1054
1043
|
"--nb-table-font": tokens.fontSans,
|
|
1055
1044
|
"--nb-table-fg": tokens.fg,
|
|
@@ -1103,6 +1092,7 @@ function columnStyle(width) {
|
|
|
1103
1092
|
return width === "reading" ? { maxWidth: READING_MAX, marginInline: "auto", width: "100%" } : {};
|
|
1104
1093
|
}
|
|
1105
1094
|
function AppFrameRoot({ contentWidth = "full", style, children, ...rest }) {
|
|
1095
|
+
chunkRX6XCLFF_cjs.injectBaseReset();
|
|
1106
1096
|
return /* @__PURE__ */ jsxRuntime.jsx(ContentWidthCtx.Provider, { value: contentWidth, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1107
1097
|
"div",
|
|
1108
1098
|
{
|
|
@@ -1297,7 +1287,7 @@ function SidebarLayoutRoot({
|
|
|
1297
1287
|
}
|
|
1298
1288
|
function Sidebar({ style, children, ...rest }) {
|
|
1299
1289
|
const { collapsed, mode, side, width, open, setOpen } = useSidebar();
|
|
1300
|
-
ensureStyle(STYLE_ID11, RULES10);
|
|
1290
|
+
chunkRX6XCLFF_cjs.ensureStyle(STYLE_ID11, RULES10);
|
|
1301
1291
|
if (!collapsed) {
|
|
1302
1292
|
const border = `${tokens.borderWidth} solid ${tokens.border}`;
|
|
1303
1293
|
return /* @__PURE__ */ jsxRuntime.jsx(
|