@theoremjs/studio 0.3.4-next.767.gb6b8d79 → 0.3.4-next.781.g97bafb5
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/package.json +6 -6
- package/page/assets/CheckboxInput-BIFNQqbA.js +2 -0
- package/page/assets/{CodeBlock-DzXH_9DF.js → CodeBlock-PkWvyBvu.js} +2 -2
- package/page/assets/CollapsibleGroup-Dfbkt6Hp.js +1 -0
- package/page/assets/ConsoleFrame-DEpLq5JK.js +3 -0
- package/page/assets/DateInput-D8vNhNrf.js +1 -0
- package/page/assets/FieldStatus-CSAKvGxp.js +1 -0
- package/page/assets/HStack-cOiUht-L.js +1 -0
- package/page/assets/Icon-BWzSKxTK.js +3 -0
- package/page/assets/IconButton-CerBBPke.js +1 -0
- package/page/assets/{ListItem-MWWVygeh.js → ListItem-DrfoLYVQ.js} +1 -1
- package/page/assets/{MenuBottomSheet-DHHFwrX2.js → MenuBottomSheet-C_3yIrip.js} +1 -1
- package/page/assets/{MenuBottomSheetActionList-CYZ56fty.js → MenuBottomSheetActionList-CG8160ZS.js} +1 -1
- package/page/assets/{OverflowList-CsAj89UP.js → OverflowList-BoqbSk8e.js} +1 -1
- package/page/assets/SchemaFields-6DykPEuu.js +1 -0
- package/page/assets/SidePanel-DLgOJwvB.js +2 -0
- package/page/assets/Spinner--TVdDovX.js +1 -0
- package/page/assets/Stack-DPSs1dBF.js +1 -0
- package/page/assets/StackItem-YZCLellt.js +1 -0
- package/page/assets/TextInput-6ChkOVD6.js +1 -0
- package/page/assets/{TimestampHoverCard-BNDnoAyp.js → TimestampHoverCard-G3Y6IWqf.js} +1 -1
- package/page/assets/ToolResultCharts-CdC4NMnY.js +1 -0
- package/page/assets/{Toolbar-BDW6J7QA.js → Toolbar-CP17ibJL.js} +1 -1
- package/page/assets/TraceInspector-C22WINe1.js +1 -0
- package/page/assets/{TraceOverview-3TC0yf85.js → TraceOverview-BNwwXUBe.js} +4 -4
- package/page/assets/VStack-CEcm-qoM.js +1 -0
- package/page/assets/VisuallyHidden-BdRLF-8h.js +1 -0
- package/page/assets/{browser-engine-CMbqiA6o.js → browser-engine-C_D0-ixe.js} +3 -3
- package/page/assets/{browser-transport-D-kfBycp.js → browser-transport-DHxl8B4G.js} +3 -3
- package/page/assets/editor.api-BldS301e.js +908 -0
- package/page/assets/{export-agent-SKuzsCut.js → export-agent-ChJn8p0v.js} +3 -3
- package/page/assets/fieldParts-CNKpMZ7U.js +1 -0
- package/page/assets/{guardrail-tester-CaSlReMa.js → guardrail-tester-DAE2FcUW.js} +2 -2
- package/page/assets/{highlightRanges-yrVxbmkN.js → highlightRanges-DvvjZZAv.js} +1 -1
- package/page/assets/index-Bl2XBXLS.css +1 -0
- package/page/assets/index-D7DLOQ55.js +150 -0
- package/page/assets/inputStyles.stylex-uYr8_KtT.js +1 -0
- package/page/assets/json-code-Bug7WeDv.js +3 -0
- package/page/assets/json.worker-DdeUAmHa.js +65 -0
- package/page/assets/json.worker-eZ5CgyQq.js +1 -0
- package/page/assets/jsonMode-DYGImCy6.js +29 -0
- package/page/assets/jsonMode-jMDxUeWM.css +1 -0
- package/page/assets/{labels-provider-Dc-AJqPH.js → labels-provider-BcEDhptf.js} +2 -2
- package/page/assets/prompt-row-BKBsSgAj.js +71 -0
- package/page/assets/{register-CDgivxvX.js → register-BLInT6S0.js} +2 -2
- package/page/assets/studio-code-pane-BxxDOnFx.js +10 -0
- package/page/assets/{studio-console-DGGdlBUn.js → studio-console-O7NvBp3e.js} +1 -1
- package/page/assets/{studio-decision-BwhZcZi3.js → studio-decision-q35VhGi0.js} +1 -1
- package/page/assets/studio-embedding-Yckte2Aw.js +2 -0
- package/page/assets/studio-host-console-CtH7Fi7W.js +2 -0
- package/page/assets/studio-labels-BQnomulw.js +3 -0
- package/page/assets/studio-live-ChTgWUic.js +5 -0
- package/page/assets/{studio-map-D-CNsPgj.js → studio-map-BwsBYjcv.js} +1 -1
- package/page/assets/studio-monaco-BkNqudm7.css +1 -0
- package/page/assets/studio-monaco-C20o5PnA.js +34 -0
- package/page/assets/{studio-trace-replay-CLslqTKN.js → studio-trace-replay-CjJd0zKT.js} +3 -3
- package/page/assets/trace-patterns-86-gKv3I.js +1 -0
- package/page/assets/{typescript-20GgZ8PJ.js → typescript-CF1Ntufd.js} +1 -1
- package/page/assets/use-one-call-CW8bM8kF.js +1 -0
- package/page/assets/{use-second-ticker-GWBt83pd.css → use-second-ticker-B-V4bkIB.css} +1 -1
- package/page/assets/useAnnounce-DlZth-he.js +1 -0
- package/page/assets/useAnnounceRenderedText-BrbiKE4-.js +1 -0
- package/page/assets/{useClipboard-BC4cMFBa.js → useClipboard-DeMRGvqJ.js} +1 -1
- package/page/assets/{useKeyboardHint-BBkDGjRh.js → useKeyboardHint-BIqbBlHw.js} +1 -1
- package/page/assets/useLocale-DrfYfZTs.js +1 -0
- package/page/assets/useMenuDrillIn-DOLSnkWq.js +1 -0
- package/page/assets/usePressFeedback-CBSbXJuo.js +1 -0
- package/page/assets/useResolvedRequired-CAelf7J-.js +1 -0
- package/page/index.html +37 -30
- package/ui/built/theme.css +27 -3
- package/ui/built/theorem-studio.js +27 -3
- package/ui/code/json-code.d.ts +12 -0
- package/ui/code/json-code.js +130 -0
- package/ui/code/studio-code.js +2 -9
- package/ui/code/studio-monaco.d.ts +4 -0
- package/ui/code/studio-monaco.js +18 -0
- package/ui/inspector.d.ts +10 -2
- package/ui/inspector.js +12 -3
- package/ui/lib/tab-fills.d.ts +3 -2
- package/ui/profile-editor.js +12 -11
- package/ui/studio-theme.js +25 -0
- package/ui/studio.css +20 -4
- package/page/assets/CheckboxInput-MMjt4mDv.js +0 -2
- package/page/assets/CollapsibleGroup-C5fLYcux.js +0 -1
- package/page/assets/ConsoleFrame-1zBq8Aef.js +0 -3
- package/page/assets/DateInput-BfmlGmw1.js +0 -1
- package/page/assets/Icon-3c9WmPTH.js +0 -3
- package/page/assets/IconButton-BeI1pXEZ.js +0 -1
- package/page/assets/SchemaFields-D0W9vuLc.js +0 -1
- package/page/assets/SidePanel-D5woAYFH.js +0 -2
- package/page/assets/StackItem-CQviqAfM.js +0 -1
- package/page/assets/TextInput-Dq9voagQ.js +0 -1
- package/page/assets/ToolResultCharts-TPkKdyQt.js +0 -1
- package/page/assets/TraceInspector-DJLaxle-.js +0 -1
- package/page/assets/VStack-CkVMcNiK.js +0 -1
- package/page/assets/editor.api-Cd3ViPQa.js +0 -908
- package/page/assets/fieldParts-BnDYE6oM.js +0 -1
- package/page/assets/index-BcMQ291i.js +0 -149
- package/page/assets/index-DZ3ArAk6.css +0 -1
- package/page/assets/prompt-row-DhGOXTVR.js +0 -71
- package/page/assets/studio-code-pane-DucGib9w.js +0 -10
- package/page/assets/studio-embedding-C8BulZi2.js +0 -2
- package/page/assets/studio-host-console-C8zLZsl2.js +0 -2
- package/page/assets/studio-labels-DHrOBSMz.js +0 -3
- package/page/assets/studio-live-D0PISMYH.js +0 -5
- package/page/assets/studio-monaco-CbKf90i6.css +0 -1
- package/page/assets/studio-monaco-xfyfezQS.js +0 -34
- package/page/assets/trace-patterns-D5Rcl0G4.js +0 -1
- package/page/assets/use-one-call-x1Gm_JQc.js +0 -1
- package/page/assets/useAnnounce-DOkF3CS1.js +0 -1
- package/page/assets/useAnnounceRenderedText-BaMlDax-.js +0 -1
- package/page/assets/useLocale-D8GRz3lz.js +0 -1
- package/page/assets/useMenuDrillIn-CmUoRV2h.js +0 -1
- package/page/assets/useResolvedRequired-68GOSl0j.js +0 -1
- /package/page/assets/{use-second-ticker-DhbZ0Soz.js → use-second-ticker-D29e7ivl.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{u as t}from"./themeProps-3IqahpCr.js";function n(e){return e.replace(/[\x00-\x1f\x7f]/g,``).trim()}function r(e){return e.toLowerCase().replace(/^([a-z][a-z\d+.-]*:) +/,`$1`)}function i(e){let t=n(e),i=r(t);return i.startsWith(`javascript:`)||i.startsWith(`vbscript:`)||i.startsWith(`data:text/html`)?null:t}function a(e){return i(e)!==null}function o(e){if(e==null)return!0;if(typeof e==`string`)return a(e);if(typeof e!=`object`)return!1;let{pathname:t,href:r,protocol:i,host:o,hostname:s}=e;for(let e of[t,r,i,o,s])if(e!=null&&typeof e!=`string`)return!1;if(typeof t==`string`&&!a(t)||typeof r==`string`&&!a(r))return!1;if(typeof i==`string`&&i!==``){let e=n(i),r=e.endsWith(`:`)?e:`${e}:`;if(!a(r)||!a(`${r}${o||s||``}${typeof t==`string`?t:``}`))return!1}return!0}var s=e(t(),1),c=`data-astryx-live-region`,l=`position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;inset-block-start:0;inset-inline-start:0;pointer-events:none;user-select:none;`,u=2e3,d={polite:null,assertive:null};function f(e){let t=d[e];t!=null&&(clearTimeout(t),d[e]=null)}var p={polite:new Set,assertive:new Set};function m(e){for(let t of p[e])cancelAnimationFrame(t);p[e].clear()}function h(e,t){f(e),d[e]=setTimeout(()=>{d[e]=null,t.textContent=``},u)}var g=null;function _(e){let t=document.createElement(`div`);return t.setAttribute(c,e),t.setAttribute(`aria-live`,e),t.setAttribute(`aria-atomic`,`true`),t.setAttribute(`role`,e===`assertive`?`alert`:`status`),t.style.cssText=l,document.body.appendChild(t),t}function v(){return typeof document>`u`?null:g?(g.polite.isConnected||document.body.appendChild(g.polite),g.assertive.isConnected||document.body.appendChild(g.assertive),g):(g={polite:_(`polite`),assertive:_(`assertive`)},g)}function y(e,t){let n=v();if(!n)return;let r=t===`assertive`?n.assertive:n.polite;r.textContent=``;let i=requestAnimationFrame(()=>{p[t].delete(i),r.textContent=e});p[t].add(i),h(t,r)}function b(e){if(m(e),f(e),!g)return;let t=e===`assertive`?g.assertive:g.polite;t.textContent=``}function x(){return(0,s.useCallback)((e,t=`polite`)=>{e?y(e,t):b(t)},[])}export{i,o as n,a as r,x as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{c as t,l as n,n as r,s as i,u as a}from"./themeProps-3IqahpCr.js";import{a as o,h as s,n as c,o as l,s as u,t as d,y as f}from"./padding.stylex-B76907Zf.js";import{n as p}from"./Stack-DPSs1dBF.js";import{n as m}from"./StackItem-YZCLellt.js";import{t as h}from"./mergeProps-ptS-gIMz.js";import{n as g}from"./useLayerDismissal-BAnTRYTt.js";import{p as _}from"./fieldParts-CNKpMZ7U.js";import{x as v}from"./Icon-BWzSKxTK.js";import{r as y}from"./useResolvedRequired-CAelf7J-.js";import{r as b}from"./focusOutline.stylex-B9nWSXsG.js";import{a as x}from"./useTooltip-BaCjTHk-.js";import{n as S}from"./IconButton-CerBBPke.js";import{t as C}from"./useAnnounce-DlZth-he.js";import{t as w}from"./focusableSelector-DXZeMU85.js";import{t as T}from"./useDevWarning-Z9SoixOP.js";var E=e(a(),1),D=(0,E.createContext)(null);D.displayName=`LayoutAreaContext`;var O=f({hasHeader:!1,hasFooter:!1,hasStart:!1,hasEnd:!1});O.displayName=`LayoutSlotsContext`;var k=f(null);k.displayName=`LayoutDividerContext`;function A(e,t){return e==null?`fallback:${typeof t==`function`?t():t}`:`id:${e}`}var j=typeof Intl.Segmenter==`function`?new Intl.Segmenter(void 0,{granularity:`grapheme`}):null;function M(e){return j?[...j.segment(e)].map(e=>e.segment):[...e]}function N(e){return e===``?0:M(e).length}function P(e){if(j){let t=j.segment(e)[Symbol.iterator]().next();return t.done?``:t.value.segment}let t=e.codePointAt(0);return t==null?``:String.fromCodePoint(t)}function F(e,t,n=`…`){let r=M(e);if(r.length<=t)return e;let i=Math.max(t-N(n),0);return r.slice(0,i).join(``)+n}function I(e){let t=e.auxiliaryData;return typeof t?.group==`string`?t.group:void 0}function L(e,{ungroupedFirst:t=!1}={}){if(!e.some(e=>I(e)!=null))return[{heading:null,items:e}];let n=[],r=new Map,i=[];for(let t of e){let e=I(t);e==null?i.push(t):(r.has(e)||(n.push(e),r.set(e,[])),r.get(e)?.push(t))}let a=n.map(e=>({heading:e,items:r.get(e)??[]})),o=i.length>0?[{heading:null,items:i}]:[];return t?[...o,...a]:[...a,...o]}var R=t();function z(e){if(e==null||typeof e==`number`)return!0;let t=e.trim().toLowerCase();return t.includes(`%`)?!1:t===`0`||/^-?(?:\d+(?:\.\d+)?|\.\d+)[a-z]+$/.test(t)||/^(?:calc|min|max|clamp)\(/.test(t)}var B={layoutOuter:{keTefX:`xojxgvx`,k71WvV:`x1fcf3bl`,keoZOQ:`x1sa9bsh`,k1K539:`x6h7pi7`,$$css:!0},layoutInner:{"--container-padding-inline-start":`xrhngw9`,"--container-padding-inline-end":`xjsfl84`,"--container-padding-block-start":`x1047aw6`,"--container-padding-block-end":`xax9j7h`,"--layout-content-width":`x15lplax`,"--layout-alignment-width":`x19kr0ht`,"--layout-padding-own-outer-x":`x1vii845`,"--layout-padding-own-outer-y":`xojybgt`,$$css:!0},fill:{kZKoxP:`x12qplqi`,kskxy:`xenllk4`,$$css:!0},auto:{kAzted:`x1us19tq`,$$css:!0},middle:{kUk6DE:`x98rzlu`,kAzted:`x2lwn1j`,$$css:!0},middleQuery:{k9g6sI:`xsw3flo`,$$css:!0},singleColumnContent:{kzqmXN:`xh8yej3`,ks0D6T:`xjl2t3p xpgkkid`,kUOVxO:`xvueqy4`,$$css:!0},singlePanelMiddle:{kB7OPa:`x9f619`,kzqmXN:`xh8yej3`,ks0D6T:`xjl2t3p xnpzo02`,kUOVxO:`xvueqy4 xb0m1lw`,$$css:!0},singleStartPanel:{kZCmMZ:`x1vvd0s7`,$$css:!0},singleEndPanel:{kwRFfy:`xxdn8bs`,$$css:!0},fullBleed:{"--layout-padding-own-outer-x":`xbjcssu`,"--layout-padding-own-outer-y":`x1bz2q72`,$$css:!0}},V={kzqmXN:`xh8yej3`,kUOVxO:`xvueqy4`,$$css:!0},H={contentWidthVar:e=>[{"--layout-content-width":(typeof e==`number`?`${e}px`:e)==null?typeof e==`number`?`${e}px`:e:`x4906uf`,$$css:!0},{"--x---layout-content-width":(typeof e==`number`?`${e}px`:e)==null?void 0:typeof e==`number`?`${e}px`:e}],contentAlignmentWidthVar:e=>[{"--layout-alignment-width":(typeof e==`number`?`${e}px`:e)==null?typeof e==`number`?`${e}px`:e:`x1b1nz06`,$$css:!0},{"--x---layout-alignment-width":(typeof e==`number`?`${e}px`:e)==null?void 0:typeof e==`number`?`${e}px`:e}],contentWidth:e=>[V,{ks0D6T:(typeof e==`number`?`${e}px`:e)==null?typeof e==`number`?`${e}px`:e:`xf68679`,$$css:!0},{"--x-maxWidth":(e=>typeof e==`number`?e+`px`:e??void 0)(typeof e==`number`?`${e}px`:e)}]};function U({area:e,children:t}){return t==null?null:(0,R.jsx)(D,{value:e,children:t})}var W={"x-default-marker":`x-default-marker`,$$css:!0};function G({children:e,content:t,contentWidth:i,defaultHasDividers:a,end:o,footer:s,header:c,height:d=`fill`,padding:f,ref:g,start:_,xstyle:v,className:y,style:b,...x}){let S=d===`fill`,C=t??e,w=(0,E.useMemo)(()=>a==null?null:{defaultHasDividers:a},[a]),T=c!=null,D=s!=null,A=_!=null,j=o!=null,M=A&&j,N=A!==j,P=i!=null&&z(i),F=(0,E.useMemo)(()=>({hasHeader:T,hasFooter:D,hasStart:A,hasEnd:j}),[T,D,A,j]),I=(0,R.jsx)(O,{value:F,children:(0,R.jsx)(`div`,{...x,ref:g,...h(r(`layout`,{height:d}),n(B.layoutOuter,S?B.fill:B.auto,v),y,b),children:(0,R.jsxs)(`div`,{...n(W,B.layoutInner,...p({direction:`vertical`}),S?B.fill:B.auto,f===0&&B.fullBleed,f!=null&&l[f],f!=null&&u[f],i!=null&&H.contentWidthVar(i),P&&H.contentAlignmentWidthVar(i)),children:[(0,R.jsx)(U,{area:`header`,children:c}),(0,R.jsxs)(`div`,{...n(...p({direction:`horizontal`}),B.middle,i!=null&&(!P||M)&&H.contentWidth(i),P&&!M&&B.middleQuery,P&&N&&B.singlePanelMiddle,P&&A&&!j&&B.singleStartPanel,P&&!A&&j&&B.singleEndPanel),children:[(0,R.jsx)(U,{area:`start`,children:_}),(0,R.jsx)(`div`,{...n(...m({size:`fill`}),P&&!A&&!j&&B.singleColumnContent),children:(0,R.jsx)(U,{area:`content`,children:C})}),(0,R.jsx)(U,{area:`end`,children:o})]}),(0,R.jsx)(U,{area:`footer`,children:s})]})})});return w==null?I:(0,R.jsx)(k,{value:w,children:I})}G.displayName=`Layout`;var K={content:{kB7OPa:`x9f619`,kZKoxP:`x5yr21d`,kUk6DE:`x98rzlu`,kAzted:`x2lwn1j`,kVQacm:`x7giv3`,kZCmMZ:`xwjyata`,kwRFfy:`x1peupej`,kLKAdn:`xqty4a x1ioh5az`,kGO01o:`xg476vw xsg11nj`,"--container-padding-inline-start":`x408pgh`,"--container-padding-inline-end":`xikqloz`,"--container-padding-block-start":`xjmgx01`,"--container-padding-block-end":`xi9ns85`,$$css:!0},noStart:{kZCmMZ:`xaku5ci`,"--container-padding-inline-start":`xt2a87w`,"--container-padding-inline-end":`xhq06x6`,$$css:!0},noEnd:{kwRFfy:`x19eyx77`,$$css:!0},noHeader:{kLKAdn:`xuqi0w`,"--container-padding-block-start":`x186o6qk`,$$css:!0},noFooter:{kGO01o:`x1363qu6`,"--container-padding-block-end":`xfsxxt8`,$$css:!0},scrollable:{kVQacm:`xysyzu8`,$$css:!0},constrainedNoPanelsStart:{kZCmMZ:`xhlv5e7`,$$css:!0},constrainedNoPanelsEnd:{kwRFfy:`x1ahicqp`,$$css:!0},constrainedSingleStartPanel:{kwRFfy:`xy07wb4`,$$css:!0},constrainedSingleEndPanel:{kZCmMZ:`xxjme2g`,$$css:!0},fullBleed:{kZCmMZ:`x1c1uobl`,kwRFfy:`xyri2b`,kLKAdn:`xexx8yu`,kGO01o:`x18d9i69`,"--container-padding-inline-start":`xrhngw9`,"--container-padding-inline-end":`xjsfl84`,"--container-padding-block-start":`x1047aw6`,"--container-padding-block-end":`xax9j7h`,$$css:!0}};function q({children:e,isScrollable:t=!0,padding:i,label:a,role:l,xstyle:u,className:f,style:p,ref:m,...g}){let{hasHeader:_,hasFooter:v,hasStart:y,hasEnd:b}=(0,E.use)(O),x=i===0;return(0,R.jsx)(`div`,{ref:m,role:l,"aria-label":a,...h(r(`layout-content`),n(K.content,!y&&!x&&i==null&&K.noStart,!b&&!x&&i==null&&K.noEnd,!_&&!x&&i==null&&K.noHeader,!v&&!x&&i==null&&K.noFooter,t&&K.scrollable,x&&K.fullBleed,i!=null&&s[i],i!=null&&o[i],i!=null&&c[i],i!=null&&d[i],!y&&!b&&!x&&K.constrainedNoPanelsStart,!y&&!b&&!x&&K.constrainedNoPanelsEnd,y&&!b&&!x&&K.constrainedSingleStartPanel,!y&&b&&!x&&K.constrainedSingleEndPanel,u),f,p),...g,children:e})}q.displayName=`LayoutContent`;var J=`[data-astryx-popover-fallback-close]`;function Y(e){try{e.focus()}catch{}return document.activeElement===e}function X(e){let t=Array.from(e.querySelectorAll(w)).filter(e=>e.closest(J)==null);for(let e of t)if(Y(e))return!0;return!1}var Z={surface:{kWkggS:`x1prclbq`,"--_popover-radius":`xiki222`,kaIpWk:`x11m9jtl`,kGVxlE:`x1i5ehqx`,$$css:!0},contentWrapper:{kVAEAm:`x1n2onr6`,$$css:!0},closeButtonWrapper:{kVAEAm:`x10l6tqk`,krVfgx:`x1ey2m1c`,kY2c9j:`x1vjfegm`,kzqmXN:`x1i1rx1s x10okhzq`,kZKoxP:`xjm9jq1 x132qfvm`,kVQacm:`xb3r6kr x1dordxg`,kz4h6p:`x1hyvwdk x10wafsz`,kfzvcC:`x47corl xbt4iw`,kLKAdn:`xexx8yu x1kw28su`,$$css:!0}};function Q(e={}){let{onShow:t,onHide:a,xstyle:o,className:c,style:l,hasLightDismiss:u=!0,hasEscapeDismiss:d=!0,hasAutoFocus:f=!0,hasSurface:p=!0,padding:m,surfaceTarget:C,hasCloseButton:w=!0,closeButtonLabel:D,dialogLabel:O,role:k=`dialog`,isModal:A=!0}=e,j=v(),M=D??j(`@astryx.popover.close`),N=(0,E.useRef)(null),P=(0,E.useRef)(!1),F=x({mode:`context`,lightDismiss:u,onShow:t,onHide:a}),{containerRef:I,focusFirst:L}=_({isActive:F.isOpen,onEscape:d||u?F.hide:void 0}),z=(0,E.useCallback)(()=>{let e=I.current;e&&(X(e)||(k===`dialog`?Y(e):L()))},[I,L,k]);(0,E.useEffect)(()=>{F.isOpen&&f&&!P.current&&requestAnimationFrame(z),F.isOpen||(P.current=!1)},[F.isOpen,f,z]);let B=(0,E.useCallback)(e=>{N.current=e,F.ref(e)},[F]),V=(0,E.useCallback)(e=>{P.current=e?.skipAutoFocus??!1,F.show()},[F]),H=(0,E.useCallback)(()=>{F.isOpen?F.hide():V()},[F,V]),U={"aria-haspopup":k===`dialog`?`dialog`:`true`,"aria-expanded":F.isOpen,"aria-controls":F.id};T(`usePopover`,'role="dialog" without a `dialogLabel` renders an unnamed dialog. Pass `dialogLabel`, or use `role: "none"` for listbox/menu popups whose content already carries its own role.',k===`dialog`&&!O);let W=(0,E.useCallback)((e,t)=>{let a=r(`popover`),u=C!=null&&C!==`popover`?`${a.className} ${i(C)}`:a.className;return F.render((0,R.jsx)(g,{children:(0,R.jsxs)(`div`,{ref:I,role:k===`dialog`?`dialog`:void 0,"aria-modal":k===`dialog`&&A?!0:void 0,"aria-label":k===`dialog`?O:void 0,tabIndex:k===`dialog`?-1:void 0,...h({...a,className:u},b.focusVisible(Z.contentWrapper,p&&Z.surface,m!=null&&s[m],o),c,l),children:[e,w&&(0,R.jsx)(`div`,{"data-astryx-popover-fallback-close":``,...n(Z.closeButtonWrapper,y.centerInline(`100%`)),children:(0,R.jsx)(S,{variant:`secondary`,label:M,onClick:F.hide})})]})}),{...t,xstyle:t?.xstyle})},[F,w,p,m,C,c,l,M,I,O,k,A,o]);return{triggerRef:B,contentRef:I,anchorId:F.anchorId,show:V,hide:F.hide,toggle:H,isOpen:F.isOpen,id:F.id,render:W,triggerProps:U}}function $(e={}){return Q(e)}function ee({isOpen:e,highlightedIndex:t,setHighlightedIndex:n,getOptionId:r,itemCount:i}){let a=(0,E.useRef)(!1),o=(0,E.useCallback)(e=>{e!==t&&(a.current=!0),n(e)},[t,n]);return(0,E.useEffect)(()=>{a.current?a.current=!1:!e||t<0||document.getElementById(r(t))?.scrollIntoView?.({block:`nearest`})},[e,t,r,i]),o}function te(e){let t=e.cloneNode(!0);for(let e of t.querySelectorAll(`[aria-hidden="true"]`))e.remove();return(t.textContent??``).replace(/\s+/g,` `).trim()}function ne(e,t,n){let r=C(),i=(0,E.useRef)(null);(0,E.useEffect)(()=>{if(!t){i.current=null;return}let a=e.current;if(!a)return;let o=te(a);if(o===``)return;let s=`${n}\u0000${o}`;i.current!==s&&(i.current=s,r(o))})}export{G as a,P as c,k as d,O as f,q as i,F as l,ee as n,L as o,D as p,$ as r,N as s,ne as t,A as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{u as t}from"./themeProps-3IqahpCr.js";import{t as n}from"./useAnnounce-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{u as t}from"./themeProps-3IqahpCr.js";import{t as n}from"./useAnnounce-DlZth-he.js";var r=e(t(),1),i=2e3;function a(e={}){let{announce:t,resetAfterMs:a=i}=e,o=n(),[s,c]=(0,r.useState)(!1),l=(0,r.useRef)(null);return(0,r.useEffect)(()=>()=>{l.current!=null&&clearTimeout(l.current)},[]),{copy:(0,r.useCallback)(async e=>{try{return await navigator.clipboard.writeText(e),c(!0),t&&o(t),l.current!=null&&clearTimeout(l.current),l.current=setTimeout(()=>{l.current=null,c(!1)},a),!0}catch{return!1}},[o,t,a]),isCopied:s}}export{a as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{c as t,l as n,n as r,u as i}from"./themeProps-3IqahpCr.js";import{g as a}from"./tokens.stylex-BpCwr7Mf.js";import{t as o}from"./mergeProps-ptS-gIMz.js";import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{c as t,l as n,n as r,u as i}from"./themeProps-3IqahpCr.js";import{g as a}from"./tokens.stylex-BpCwr7Mf.js";import{t as o}from"./mergeProps-ptS-gIMz.js";import{x as s}from"./Icon-BWzSKxTK.js";import{a as c}from"./useTooltip-BaCjTHk-.js";var l=e(i(),1);function u(){if(typeof navigator>`u`)return!1;let e=`userAgentData`in navigator?navigator.userAgentData:null;if(e&&typeof e==`object`&&`platform`in e){let t=e.platform,n=typeof t==`string`?t.trim():``;if(n!==``&&n.toLowerCase()!==`unknown`)return/mac/i.test(n)}return/Mac|iPhone|iPad|iPod/.test(navigator.platform??``)}var d=t(),f={wrapper:{k1xSpc:`x3nfvp2`,kGNEyG:`x6s0dn4`,kOIVth:`xzye2dw`,kmuXW:`x2lah0s`,$$css:!0}},p=new Map([[`ctrl`,`⌃`],[`alt`,`⌥`],[`shift`,`⇧`],[`enter`,`↵`],[`backspace`,`⌫`],[`escape`,`Esc`],[`tab`,`⇥`],[`up`,`↑`],[`down`,`↓`],[`left`,`←`],[`right`,`→`],[`plus`,`+`]]),m=new Map([[`esc`,`escape`],[`return`,`enter`]]);function h(e,t){return e===`mod`?t?`⌘`:`Ctrl`:p.get(e)??e.toUpperCase()}var g=new Map([[`ctrl`,`Control`],[`alt`,`Alt`],[`shift`,`Shift`],[`enter`,`Enter`],[`backspace`,`Backspace`],[`escape`,`Escape`],[`tab`,`Tab`],[`up`,`Up arrow`],[`down`,`Down arrow`],[`left`,`Left arrow`],[`right`,`Right arrow`],[`plus`,`Plus`]]);function _(e,t){return e===`mod`?t?`Command`:`Control`:g.get(e)??e.toUpperCase()}function v(){return()=>{}}function y(){return!1}function b({keys:e,ref:t,xstyle:i,className:a,style:s,...c}){let p=(0,l.useSyncExternalStore)(v,u,y),g=new Map,b=e.split(`+`).map(e=>e.trim().toLowerCase()).map(e=>{let t=g.get(e)??0;return g.set(e,t+1),{key:m.get(e)??e,reactKey:`${e}:${t}`}}),x=b.map(({key:e})=>_(e,p)).join(` + `);return(0,d.jsx)(`span`,{...c,ref:t,role:`img`,"aria-label":x,...o(r(`kbd`),n(f.wrapper,i),a,s),children:b.map(({key:e,reactKey:t})=>(0,d.jsx)(`kbd`,{"aria-hidden":`true`,className:`x3nfvp2 x6s0dn4 xl56j7k x16asifk x1grt7ep x7a5moj xx3sua9 x17x4s8c xlxy82 x1q0q8m5 xib2hle x1tgivj0 x9ynric x141an7d x1e4wzip x1ltkj2j x87ps6o`,children:h(e,p)},t))})}b.displayName=`Kbd`;var x=new Set([`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`]),S={horizontal:[`left`,`right`],vertical:[`up`,`down`],both:[`left`,`right`,`up`,`down`]},C={hint:{kVAEAm:`xixxii4`,kpwlN0:`x1anvkwx`,kogj98:`x1ghz6dp`,kMzoRj:`xc342km`,ksu8eU:`xng3xce`,kWkggS:`x1prclbq`,kaIpWk:`xh6dtrn`,kGVxlE:`x1i5ehqx`,kLKAdn:`xfsso4q`,kGO01o:`xy143xn`,kZCmMZ:`x12gdq22`,kwRFfy:`x1djylfy`,kGuDYH:`x141an7d`,kLWn49:`x1ltkj2j`,kMwMTN:`xv1l7n4`,khDVqt:`xuxw1ft`,kSiTet:`xg01cxk xofkqq2`,k1ekBW:`xsm4mo9`,kIyJzY:`xx6bhzk`,kzIqYQ:`xd00j3c`,kfzvcC:`x47corl`,$$css:!0}};function w(e={}){let{orientation:t=`horizontal`,dismissAfterMs:n=3e3,isEnabled:r=!0}=e,i=s(),o=(0,l.useRef)(null),u=(0,l.useRef)(!1),f=(0,l.useRef)(!1),p=(0,l.useRef)(()=>{}),m=(0,l.useCallback)(()=>{o.current&&=(clearTimeout(o.current),null)},[]),h=(0,l.useCallback)(()=>{f.current=!0},[]),g=(0,l.useCallback)(()=>{f.current=!1,m(),p.current(null)},[m]),_=c({mode:`context`,onShow:h,onHide:g});p.current=_.ref;let v=(0,l.useCallback)(()=>{u.current=!0,m(),_.hide(),f.current=!1,p.current(null)},[m,_]),y=(0,l.useCallback)(e=>{!u.current&&r&&(p.current(e),_.show(),m(),o.current=setTimeout(()=>{v()},n))},[m,v,n,r,_]);(0,l.useEffect)(()=>()=>{m(),p.current(null)},[m]);let w=(0,l.useCallback)(e=>{if(u.current||!r)return;let t=e.target;if(!t.matches(`:focus-visible`))return;let n=e.currentTarget;e.relatedTarget instanceof Node&&n.contains(e.relatedTarget)||y(t)},[y,r]),T=(0,l.useCallback)(e=>{if(!f.current)return;let t=e.currentTarget;e.relatedTarget instanceof Node&&t.contains(e.relatedTarget)?!u.current&&e.relatedTarget instanceof HTMLElement&&p.current(e.relatedTarget):v()},[v]),E=(0,l.useCallback)(e=>{f.current&&x.has(e.key)&&v()},[v]),D=(0,d.jsx)(`span`,{className:`x3nfvp2 x6s0dn4 xzye2dw`,children:S[t].map(e=>(0,d.jsx)(b,{keys:e},e))});return{hintElement:_.render((0,d.jsxs)(`span`,{"aria-hidden":`true`,children:[D,(0,d.jsx)(`span`,{className:`x11g1kdw`,children:i(`@astryx.keyboardHint.toNavigate`)})]}),{placement:`below`,alignment:`start`,xstyle:C.hint,style:{marginBlockStart:a[`--spacing-2`]}}),onFocus:w,onBlur:T,onKeyDown:E}}export{b as n,w as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{u as t}from"./themeProps-3IqahpCr.js";import{S as n}from"./Icon-BWzSKxTK.js";var r=e(t(),1);function i(){return(0,r.use)(n).locale}export{i as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{c as t,l as n,n as r,u as i}from"./themeProps-3IqahpCr.js";import{g as a}from"./tokens.stylex-BpCwr7Mf.js";import{y as o}from"./padding.stylex-B76907Zf.js";import{t as s}from"./mergeProps-ptS-gIMz.js";import{o as c,r as l,s as u}from"./useLayerDismissal-BAnTRYTt.js";import{d,f,g as p,i as ee,u as m}from"./fieldParts-CNKpMZ7U.js";import{t as h}from"./isRenderable-DHkzpAoQ.js";import{n as te,t as g,x as _}from"./Icon-BWzSKxTK.js";import{n as v,r as y}from"./useResolvedRequired-CAelf7J-.js";import{i as b}from"./focusOutline.stylex-B9nWSXsG.js";import{n as x,t as S}from"./usePressFeedback-CBSbXJuo.js";import{a as C,d as w,l as T,n as E}from"./useTooltip-BaCjTHk-.js";import{r as D}from"./Text-B74VhVA7.js";import{t as O}from"./Spinner--TVdDovX.js";import{t as ne}from"./useMediaQuery-BCT0NUeZ.js";import{a as k,c as re}from"./CheckboxInput-BIFNQqbA.js";import{t as ie}from"./useDevWarning-Z9SoixOP.js";import{a as ae,i as oe,n as se,r as A,t as ce}from"./menuItemRoles-Bod0knkp.js";import{n as le,r as ue,t as de}from"./useMenuPress-DPpqa6F7.js";import{i as fe,r as pe}from"./useAdaptivePresentation-Bma4-u1a.js";var j=e(i(),1),me=o(null);me.displayName=`DropdownMenuSurfaceContext`;var he=o(null);he.displayName=`DropdownMenuRootOpenContext`;function ge(){return(0,j.use)(he)!==!1}var _e=o(null);_e.displayName=`DropdownMenuContext`;function ve(){return(0,j.use)(_e)}var ye=(0,j.createContext)(null);ye.displayName=`DropdownMenuRadioGroupContext`;function be(e,t){if(t||e.pointerType!==`mouse`)return;let n=e.currentTarget;n!==n.ownerDocument.activeElement&&n.focus({preventScroll:!0})}var M=t(),xe={root:{kB7OPa:`x9f619`,kzqmXN:`xh8yej3`,k8WAf4:`xce4md1`,kg3NbH:`xf314gf`,kaIpWk:`x1ws5lxm`,kMv6JI:`x9ynric`,kGuDYH:`xcr08ib`,kMwMTN:`x1tgivj0`,kWkggS:`xjbqb8w x1c52tdz xprvw0a`,kMzoRj:`xc342km`,ksu8eU:`xng3xce`,kkrTdU:`x1ypdohk x16khyan`,k9WMMc:`x1yc453h`,kI3sdo:`x1a2a7pz`,$$css:!0},disabled:{kSiTet:`xbyyjgo`,kkrTdU:`xt0e3qv`,$$css:!0},destructive:{kMwMTN:`xjt36v0`,"--_item-label-color":`xufyqxy`,"--_item-description-color":`xqlix59`,$$css:!0}},N={sm:{k8WAf4:`xu0wf1k`,kg3NbH:`xf314gf`,$$css:!0},md:{k8WAf4:`x1vofgu7`,$$css:!0},lg:{$$css:!0}};function Se({icon:e,label:t,description:n,onClick:i,href:a,target:o,rel:c,isDisabled:l=!1,endContent:u,hasCloseOnSelect:d=!0,variant:f=`default`,xstyle:ee,className:m,style:h,ref:g,onPointerMove:_,onAuxClick:v,...y}){let b=ve(),C=b?.menuSize??`md`,w=S(),T=(0,j.useCallback)(e=>{l?e.preventDefault():(a!=null&&ae(e)||i?.(e),d&&b?.closeMenu())},[l,a,i,d,b]),E=(0,j.useCallback)(e=>{l?e.preventDefault():a!=null&&e.button===1&&d&&b?.closeMenu()},[l,a,d,b]),D=(0,j.useCallback)(e=>be(e,l),[l]),O=f===`destructive`,ne=x();return(0,M.jsx)(k,{...y,ref:g,as:a==null?void 0:ne,role:`menuitem`,tabIndex:l?void 0:-1,onPointerMove:p(D,_),...w,startContent:e?te(e,{size:`sm`,color:O?`error`:`secondary`}):void 0,label:t,description:n,endContent:u,onClick:T,onAuxClick:p(E,v),href:a,target:o,rel:c,draggable:a==null&&void 0,isDisabled:l,xstyle:[xe.root,N[C],O&&xe.destructive,l&&xe.disabled,ee],...s(r(`dropdown-menu-item`,{size:C,variant:O?`destructive`:null}),{className:m,style:h})})}Se.displayName=`DropdownMenuItem`;var Ce={divider:{kqGvvJ:`xsq74q5`,$$css:!0}},we=r(`dropdown-menu-divider`).className;function Te({xstyle:e,className:t,style:n,ref:r,...i}){return(0,M.jsx)(re,{...i,ref:r,xstyle:[Ce.divider,e],className:t?`${we} ${t}`:we,style:n})}Te.displayName=`DropdownMenuDivider`;var Ee=w(),De=(0,j.createContext)(!1);De.displayName=`MenuRegionsContext`;function Oe(e){return e==null?[]:f(e).filter(t=>t.tabIndex>=0&&!ke(t,e))}function ke(e,t){if(typeof window>`u`||!window.getComputedStyle)return!1;for(let n=e.parentElement;n!=null&&n!==t.parentElement;n=n.parentElement)if(window.getComputedStyle(n).display===`none`)return!0;return!1}function Ae(e,t,n){let r=new Map,i=e=>e instanceof HTMLInputElement&&e.getAttribute(`type`)===`radio`&&e.name!==``?`${e.form?.id??``}\u0000${e.name}`:null;for(let t of e){let e=i(t);if(e!=null){let n=r.get(e)??[];n.push(t),r.set(e,n)}}let a=new Set,o=[];for(let s of e){let e=i(s);if(e==null){o.push(s);continue}if(a.has(e))continue;a.add(e);let c=r.get(e)??[],l=c.find(e=>e===t)??c.find(e=>e.checked)??(n?c[c.length-1]:c[0]);o.push(l)}return o}function je(e){return e.focus(),e.ownerDocument.activeElement===e}function Me(e,t,n,r,i=!1){if(t==null)return;e.preventDefault(),e.stopPropagation();let a=document.activeElement,o=Ae([...Oe(n),t,...Oe(r)],a,e.shiftKey);if(o.length===1){i&&t.focus();return}let s=o.indexOf(t),c=t.contains(a)?s:o.findIndex(e=>e===a||e.contains(a));c<0&&(c=s);let l=e.shiftKey?-1:1,u=o[(c+l+o.length)%o.length];je(u)||t.focus()}var Ne=500,Pe=300,P=8;function F(e,t,n){return(e.x-n.x)*(t.y-n.y)-(t.x-n.x)*(e.y-n.y)}function Fe(e,t,n,r){let i=F(e,t,n),a=F(e,n,r),o=F(e,r,t);return!((i<0||a<0||o<0)&&(i>0||a>0||o>0))}function Ie(e,t,n){let r=P,i,a;if(t.x<=n.left)i={x:n.left,y:n.top-r},a={x:n.left,y:n.bottom+r};else if(t.x>=n.right)i={x:n.right,y:n.top-r},a={x:n.right,y:n.bottom+r};else if(t.y<=n.top)i={x:n.left-r,y:n.top},a={x:n.right+r,y:n.top};else if(t.y>=n.bottom)i={x:n.left-r,y:n.bottom},a={x:n.right+r,y:n.bottom};else return!1;return Fe(e,t,i,a)}function Le(e){let{show:t,hide:n,isOpen:r,isEnabled:i,showDelay:a=150,hideDelay:o=200,clickGuardMs:s=Ne,itemSelector:c,popoverId:u,ownsFocus:d=!0,flyoutRef:f}=e,p=ne(`(hover: hover)`),m=(0,j.useRef)(null),h=(0,j.useRef)(null),te=(0,j.useRef)(null),g=(0,j.useRef)(null),_=(0,j.useRef)(!1),v=(0,j.useRef)(0),y=(0,j.useRef)(0),b=(0,j.useRef)(r),x=(0,j.useCallback)(()=>{m.current&&=(clearTimeout(m.current),null),h.current&&=(clearTimeout(h.current),null),g.current?.(),g.current=null},[]);l(()=>{let e=b.current;b.current=r,e&&!r&&(x(),_.current=!1,y.current=0,v.current=Date.now())},[r,x]);let S=(0,j.useRef)(()=>{}),{listRef:C,handleKeyDown:w,focusFirst:T}=ee({itemSelector:c,onEscape:()=>S.current()}),E=(0,j.useCallback)(()=>{let e=C.current?.contains(document.activeElement)??!1;n(),e&&te.current?.focus()},[n,C]);(0,j.useEffect)(()=>{S.current=()=>{x(),E()}},[x,E]),(0,j.useEffect)(()=>()=>x(),[x]),(0,j.useEffect)(()=>{i||x()},[i,x]);let D=(0,j.useCallback)(()=>{T()||C.current?.focus()},[T,C]),O=(0,j.useCallback)(()=>{d?(t({skipAutoFocus:!0}),D()):t()},[d,t,D]),k=(0,j.useCallback)(()=>s>0&&y.current>0&&Date.now()-y.current<s&&(_.current=!1,y.current=0,!0),[s]),re=(0,j.useCallback)(e=>{u&&e?.preventDefault(),x(),e!=null&&e.detail===0?(v.current=0,_.current=!1,y.current=0,r?d&&D():O()):r?k()?d&&D():E():(v.current=0,_.current=!1,y.current=0,O())},[u,x,r,d,k,O,D,E]),ie=(0,j.useCallback)(()=>{if(!p||v.current>0&&Date.now()-v.current<Pe)return;if(r){x();return}_.current=!0,x();let e=()=>{y.current=Date.now(),t({skipAutoFocus:!0})};a>0?m.current=setTimeout(e,a):e()},[p,r,x,t,a]),ae=(0,j.useCallback)(e=>{if(v.current=0,!_.current)return;x();let t=null,i=!1,a=()=>!1,s=()=>{h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{i&&t!=null&&a(t)?s():n()},o)};s();let c=f?.current??C.current,l=e==null?null:{x:e.clientX,y:e.clientY};if(c==null||l==null||!r)return;let u=c.getBoundingClientRect();if(u.width<=0||u.height<=0)return;let d=c.ownerDocument;a=e=>Ie(e,l,u),i=!0,t=l;let p=e=>{let n={x:e.clientX,y:e.clientY};t=n,a(n)?s():(i=!1,g.current?.(),g.current=null)};d.addEventListener(`pointermove`,p,!0),g.current=()=>{d.removeEventListener(`pointermove`,p,!0)}},[x,n,o,r,C,f]),oe=(0,j.useCallback)(()=>{x()},[x]),se=(0,j.useCallback)(e=>{te.current=e},[]),A=(0,j.useCallback)(()=>{},[]),ce=(0,j.useCallback)(e=>{},[]),le=(0,j.useCallback)(e=>{},[]);return i?{triggerProps:{onClick:re,onMouseEnter:ie,onMouseLeave:ae,...u?{popoverTarget:u}:null},contentProps:{onMouseEnter:oe,onMouseLeave:ae,onKeyDown:w},menuRef:C,focusFirst:T,focusMenu:D,confirmHoverOpen:k,close:E,setTriggerEl:se}:{triggerProps:{onClick:A,onMouseEnter:A,onMouseLeave:A},contentProps:{onMouseEnter:A,onMouseLeave:A,onKeyDown:le},menuRef:C,focusFirst:T,focusMenu:D,confirmHoverOpen:k,close:E,setTriggerEl:ce}}function Re(e,t){return typeof e==`string`&&d(e)?{property:`inlineSize`,value:e.trim()}:{property:`minWidth`,value:m(e,t)}}`${T.maxBlockSize}`,`${T.maxBlockSizeFallback}`;var ze={root:{kB7OPa:`x9f619`,kzqmXN:`xh8yej3`,k8WAf4:`xce4md1`,kg3NbH:`xf314gf`,kaIpWk:`x1ws5lxm`,kMv6JI:`x9ynric`,kGuDYH:`xcr08ib`,kMwMTN:`x1tgivj0`,kWkggS:`xjbqb8w x1c52tdz`,kMzoRj:`xc342km`,ksu8eU:`xng3xce`,kkrTdU:`x1ypdohk x16khyan`,k9WMMc:`x1yc453h`,kI3sdo:`x1a2a7pz`,$$css:!0},open:{kWkggS:`x1lmrjuc`,$$css:!0},disabled:{kSiTet:`xbyyjgo`,kkrTdU:`xt0e3qv`,$$css:!0}},Be={sm:{k8WAf4:`xu0wf1k`,kg3NbH:`xf314gf`,$$css:!0},md:{k8WAf4:`x1vofgu7`,$$css:!0},lg:{$$css:!0}},I={kzqmXN:`x1uyokj7`,$$css:!0},L={scrollable:{kORKVm:`x1odjw0f`,kXHlph:`x6ikm8r`,kZeWKH:`xish69e`,$$css:!0},touchPinchZoom:{kFalU9:`x1j4r261`,$$css:!0},touchPanYPinchZoom:{kFalU9:`xge0x1e`,kZeWKH:`xish69e`,$$css:!0},popoverViewport:{kB7OPa:`x9f619`,kskxy:`x1uh1i8a`,$$css:!0},popover:{k7Eaqz:`x1b27s9g`,$$css:!0},popoverCustomWidth:e=>[{k7Eaqz:e==null?e:`xkj4a21`,$$css:!0},{"--x-minWidth":(e=>typeof e==`number`?e+`px`:e??void 0)(e)}],popoverCustomIntrinsicWidth:e=>[I,{"--x-inlineSize":(e=>typeof e==`number`?e+`px`:e??void 0)(e)}]},Ve={kskxy:`x1jols5v`,$$css:!0},He={viewMaxHeight:e=>[Ve,{"--x-maxHeight":(e=>typeof e==`number`?e+`px`:e??void 0)(`min(${e}, ${T.maxBlockSize})`)}]},Ue={frame:{kB7OPa:`x9f619`,k1xSpc:`x78zum5`,kXwgrk:`xdt5ytf`,kskxy:`x1uh1i8a`,"--_dropdown-menu-radius":`x1fcsqxe`,"--_dropdown-menu-padding":`xgory14`,kaIpWk:`x1n97fys`,$$css:!0},menu:{kB7OPa:`x9f619`,k1xSpc:`x78zum5`,kXwgrk:`xdt5ytf`,kOIVth:`x1lsbc85`,kzQI83:`x1iyjqo2`,kmuXW:`xs83m0k`,kAzted:`x2lwn1j`,kmVPX3:`x9epnlk`,kI3sdo:`x1a2a7pz`,k7VYTy:`xpdipgo`,kfSwDN:`x87ps6o`,$$css:!0},hidden:{k1xSpc:`x1s85apg`,$$css:!0}};function We(e){if(e==null)return;let t=e.ownerDocument,n=e.querySelectorAll(`[aria-expanded="true"][aria-controls]`);for(let e of[...n].reverse()){let n=t.getElementById(e.getAttribute(`aria-controls`)??``);if(n?.getAttribute(`data-astryx-submenu-regions`)!==`flyout`)continue;let r=n.closest(`[popover]`);if(r!=null){if(typeof r.hidePopover==`function`)r.matches(`:popover-open`)&&r.hidePopover();else if(r.style.display===`block`){r.style.display=`none`;let e=new Event(`toggle`,{bubbles:!1});Object.defineProperty(e,"newState",{value:`closed`,configurable:!0}),r.dispatchEvent(e)}}}}function Ge(e){let{icon:t,label:i,description:o,isDisabled:l=!1,hasSpinner:d=!1,menuWidth:f,onOpenChange:m,presentation:x=`adaptive`,header:S,footer:w,children:ne,xstyle:re,className:ae,style:ye,"data-testid":xe,menuDataTestId:N,ref:Ce,id:we,onMouseEnter:Te,onMouseLeave:Oe,onPointerMove:ke,onClick:Ae,onKeyDown:je,...Ne}=e,Pe=_(),P=ve(),F=(0,j.use)(me),Fe=(0,j.use)(De),Ie=P?.menuSize??`md`,I=!l,Ve=h(S)||h(w),Ge=F!=null,R=Ve&&Ge,Ke=F?.host.getElement()??null;ie(`DropdownMenuSubMenu`,`header and footer show only inside a DropdownMenu; this menu has no place outside its rows for them, so they are not rendered.`,Ve&&!Ge);let qe=(0,j.useId)(),Je=(0,j.useRef)(null),Ye=(0,j.useRef)(null),Xe=(0,j.useRef)(null),[Ze,Qe]=(0,j.useState)(!1),z=(0,j.useId)(),$e=(0,j.useId)(),B=we??$e,V=(0,j.useRef)(null),H=P?.drillIn,U=H!=null&&(x===`drill-in`||x===`adaptive`&&H.isCompactTouch)?H:null,W=U!=null,et=(0,j.useId)(),G=U?.viewStack.includes(et)===!0,K=G&&U?.viewStack.at(-1)===et,q=typeof i==`string`?i:void 0,tt=P?.menuLabel,nt=tt==null?Pe(`@astryx.dropdownMenu.back`):Pe(`@astryx.dropdownMenu.backTo`,{parent:tt}),[rt,it]=(0,j.useState)(!1),J=W?G:rt,at=(0,j.useRef)(!1),Y=(0,j.useRef)(!1),X=C({mode:`context`,lightDismiss:!1,onShow:(0,j.useCallback)(()=>{Y.current=!1,it(!0),m?.(!0)},[m]),onHide:(0,j.useCallback)(()=>{Y.current=!1,We(V.current?.ownerDocument.getElementById(z)??null),it(!1),m?.(!1)},[m,z])}),ot=(0,j.useCallback)(()=>{I&&X.show()},[I,X]),st=(0,j.useCallback)(()=>{R&&at.current?Y.current=!0:X.hide()},[X,R]),ct=(0,j.useCallback)(()=>{at.current=!0},[]),lt=(0,j.useCallback)(e=>{if(at.current=!1,!Y.current)return;let t=e.relatedTarget;t instanceof Node&&e.currentTarget.contains(t)||setTimeout(()=>{!at.current&&Y.current&&V.current?.isConnected===!0&&(Y.current=!1,X.hide())},0)},[X]),ut=(0,j.useCallback)(()=>{Y.current=!1},[]),{listRef:Z,handleKeyDown:dt,focusFirst:ft,focusItem:pt,ownsEvent:mt,getItems:ht}=ee({itemSelector:A,boundarySelector:ce,wrap:!0,hasPaging:!0,onEscape:()=>$({focusTrigger:!0})}),Q=pe(Z,ne,J&&(!W||R)),gt=fe({getItemLabels:()=>ht().map(e=>e.textContent),onMatch:pt,getCurrentIndex:()=>ht().findIndex(e=>e===document.activeElement||e.contains(document.activeElement))}),_t=ge();v(d&&_t,Pe(`@astryx.spinner.loading`),V);let{triggerProps:vt,contentProps:yt,confirmHoverOpen:bt}=Le({show:ot,hide:st,isOpen:rt,isEnabled:I&&!W&&_t,flyoutRef:R?Je:Z}),xt=(0,j.useRef)(null),St=(0,j.useRef)(!1),Ct=(0,j.useCallback)(e=>{I&&(U==null?(X.show(),e?.focusFirst&&(ft()||Z.current?.focus())):(xt.current=e?.focusFirst?`first`:`container`,U.push(et),m?.(!0)))},[I,U,et,m,X,ft,Z]),$=(0,j.useCallback)(e=>{U==null?(X.hide(),e?.focusTrigger!==!1&&V.current?.focus()):G&&(St.current=e?.focusTrigger!==!1,U.pop(),m?.(!1))},[U,G,m,X]);(0,j.useEffect)(()=>{if(!K||U?.host==null)return;let e=xt.current;if(e==null)return;xt.current=null;let t=ht(),n=e===`first`?t[1]??t[0]:null;n==null?Z.current?.focus({preventScroll:!0}):n.focus({preventScroll:!0})},[K,U?.host,ht,Z]),(0,j.useEffect)(()=>{!G&&St.current&&(St.current=!1,V.current?.focus({preventScroll:!0}))},[G]);let wt=X.ref,Tt=(0,j.useCallback)(e=>{V.current=e,wt(e)},[wt]),Et=D(Tt,Ce),Dt=(0,j.useCallback)(e=>{if(l)e.preventDefault();else if(W){let t=e.detail>0||le();Ct({focusFirst:!t})}else if(rt){if(bt()){ft()||Z.current?.focus();return}$({focusTrigger:!0})}else Ct({focusFirst:!0})},[l,W,rt,Ct,$,bt,ft,Z]),Ot=(0,j.useCallback)(e=>{p(Dt,Ae)(e)},[Dt,Ae]),kt=(0,j.useCallback)(e=>{if(l)return;let t=typeof window<`u`&&V.current&&window.getComputedStyle(V.current).direction===`rtl`?`ArrowLeft`:`ArrowRight`;(e.key===t||e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),Ct({focusFirst:!0}))},[l,Ct]),At=(0,j.useCallback)(e=>be(e,l),[l]),jt=(0,j.useCallback)(e=>{if(e.key===`Tab`){if(R){Me(e,Z.current,Ye.current,Xe.current,!mt(e));return}if(Fe){$({focusTrigger:!1});return}}if(!mt(e))return;if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),$({focusTrigger:!0});return}if(e.key===`Enter`||e.key===` `){if(e.preventDefault(),e.repeat)return;let t=document.activeElement;t&&se.has(t.getAttribute(`role`)??``)&&oe(t,e);return}let t=typeof window<`u`&&Z.current&&window.getComputedStyle(Z.current).direction===`rtl`?`ArrowRight`:`ArrowLeft`;e.key===t?(e.preventDefault(),$({focusTrigger:!0})):gt.onKeyDown(e)?e.preventDefault():dt(e)},[mt,$,dt,gt,Z,Fe,R]),Mt=(0,j.useCallback)(e=>{e.key===`Tab`?Me(e,Z.current,Ye.current,Xe.current):e.key===`Escape`&&!e.defaultPrevented&&!c(e.nativeEvent)&&(e.preventDefault(),e.stopPropagation(),$({focusTrigger:!0}))},[Z,$]),Nt=(0,j.useMemo)(()=>({menuSize:Ie,closeMenu:()=>{$({focusTrigger:!1}),P?.closeMenu()},drillIn:H,menuLabel:q}),[Ie,$,P,H,q]),Pt=ue({menuRef:Z,itemSelector:A,onDismiss:Nt.closeMenu}),Ft=d?(0,M.jsx)(`span`,{className:`x78zum5 x6s0dn4`,children:(0,M.jsx)(O,{size:`sm`,"aria-hidden":`true`})}):(0,M.jsx)(`span`,{className:`x78zum5 x6s0dn4`,children:(0,M.jsx)(g,{icon:`chevronRight`,size:`sm`,color:`secondary`,xstyle:y.mirror,...r(`dropdown-menu-indicator-icon`)})}),It=f?Re(f,T.maxInlineSizeFallback):null,Lt=It?It.property===`inlineSize`?L.popoverCustomIntrinsicWidth(It.value):L.popoverCustomWidth(It.value):L.popover,Rt=(0,M.jsx)(_e,{value:Nt,children:(0,M.jsxs)(me,{value:F,children:[W&&(0,M.jsx)(Se,{icon:(0,M.jsx)(g,{icon:`chevronLeft`,size:`sm`,color:`secondary`,xstyle:y.mirror}),label:nt,hasCloseOnSelect:!1,onClick:()=>$({focusTrigger:!0})}),ne]})}),zt=(0,M.jsx)(he,{value:_t&&J,children:R?(0,M.jsx)(De,{value:!0,children:Rt}):Rt}),Bt=R&&F!=null?{[de]:F.ownerId}:void 0,Vt=(e,t,i)=>(0,M.jsxs)(`div`,{ref:Je,id:qe,role:`dialog`,"aria-modal":`true`,"data-astryx-submenu-regions":i,...t,...i===`flyout`?{onFocus:ct,onBlur:lt,onPointerEnter:ut}:void 0,...i===`flyout`?s(r(`dropdown-menu`),{className:`x9f619 x78zum5 xdt5ytf x1uh1i8a x1fcsqxe xgory14 x1n97fys xc0b1yq x1prclbq x1i5ehqx x1hc1fzr x19991ni xuedmi6 xlr8y92`}):n(Ue.frame,F?.menuMaxHeight!=null&&He.viewMaxHeight(F.menuMaxHeight),t.hidden===!0&&Ue.hidden),children:[h(S)&&(0,M.jsx)(`div`,{ref:Ye,onKeyDown:Mt,className:`x2lah0s x9epnlk`,children:S}),e,h(w)&&(0,M.jsx)(`div`,{ref:Xe,onKeyDown:Mt,className:`x2lah0s x9epnlk`,children:w})]}),Ht=e=>R&&Ke!=null?(0,Ee.createPortal)(e,Ke):e,Ut=e=>{R&&e.target===e.currentTarget&&Qe(u()===`keyboard`)},Wt=e=>{R&&e.target===e.currentTarget&&Qe(!1)};return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(k,{...Ne,ref:Et,id:B,role:`menuitem`,tabIndex:l?void 0:-1,"aria-haspopup":R?`dialog`:`menu`,"aria-expanded":J,"aria-controls":J?R?qe:z:void 0,"aria-disabled":l||void 0,"data-testid":xe,onMouseEnter:p(vt.onMouseEnter,Te),onMouseLeave:p(vt.onMouseLeave,Oe),onPointerMove:p(At,ke),startContent:t?te(t,{size:`sm`,color:`secondary`}):void 0,label:i,description:o,endContent:Ft,onClick:Ot,onKeyDown:p(kt,je),isDisabled:l,xstyle:[ze.root,Be[Ie],J&&ze.open,l&&ze.disabled,re],...s(r(`dropdown-menu-item`,{size:Ie}),{className:ae,style:ye})}),U==null?Ht(X.render(R?Vt((0,M.jsx)(`div`,{ref:Z,id:z,role:`menu`,tabIndex:0,"aria-labelledby":B,onKeyDown:jt,onFocus:Ut,onBlur:Wt,"data-testid":N,...Pt.menuProps,...Bt,...n(Ue.menu,Q?L.touchPanYPinchZoom:L.touchPinchZoom,Q&&L.scrollable,Ze&&b.focusVisible),children:zt}),{"aria-labelledby":B,onMouseEnter:yt.onMouseEnter,onMouseLeave:yt.onMouseLeave},`flyout`):(0,M.jsx)(`div`,{ref:Z,id:z,role:`menu`,tabIndex:Q?0:-1,"aria-labelledby":B,onKeyDown:jt,onMouseEnter:yt.onMouseEnter,onMouseLeave:yt.onMouseLeave,"data-testid":N,...Pt.menuProps,...s(r(`dropdown-menu`),{0:{className:`x9f619 x78zum5 xdt5ytf x1lsbc85 xc0b1yq x1uh1i8a x1fcsqxe xgory14 x9epnlk x1n97fys x1prclbq x1i5ehqx x1hc1fzr x19991ni xuedmi6 xlr8y92 xpdipgo x87ps6o x1j4r261`},2:{className:`x9f619 x78zum5 xdt5ytf x1lsbc85 xc0b1yq x1uh1i8a x1fcsqxe xgory14 x9epnlk x1n97fys x1prclbq x1i5ehqx x1hc1fzr x19991ni xuedmi6 xlr8y92 xpdipgo x87ps6o xge0x1e xish69e`},1:{className:`x9f619 x78zum5 xdt5ytf x1lsbc85 xc0b1yq x1uh1i8a x1fcsqxe xgory14 x9epnlk x1n97fys x1prclbq x1i5ehqx x1hc1fzr x19991ni xuedmi6 xlr8y92 xpdipgo x87ps6o x1j4r261 x1odjw0f x6ikm8r xish69e`},3:{className:`x9f619 x78zum5 xdt5ytf x1lsbc85 xc0b1yq x1uh1i8a x1fcsqxe xgory14 x9epnlk x1n97fys x1prclbq x1i5ehqx x1hc1fzr x19991ni xuedmi6 xlr8y92 xpdipgo x87ps6o xge0x1e x1odjw0f x6ikm8r xish69e`}}[!!Q<<1|!!Q]),children:zt}),{placement:`end`,alignment:`start`,offset:a[`--spacing-1`],xstyle:[L.popoverViewport,Lt,E.end]})):G&&U.host!=null&&(R?(0,Ee.createPortal)(Vt((0,M.jsx)(`div`,{ref:Z,id:z,role:`menu`,tabIndex:0,"aria-label":q,"aria-labelledby":q==null?B:void 0,onKeyDown:jt,onFocus:Ut,onBlur:Wt,"data-testid":N,...Pt.menuProps,...Bt,...n(Ue.menu,Q&&L.scrollable,Q?L.touchPanYPinchZoom:L.touchPinchZoom,Ze&&b.focusVisible),children:zt}),{"aria-label":q,"aria-labelledby":q==null?B:void 0,hidden:!K,inert:!K},`view`),Ke??U.host):(0,Ee.createPortal)((0,M.jsx)(`div`,{ref:Z,id:z,role:`menu`,tabIndex:-1,"aria-label":q,"aria-labelledby":q==null?B:void 0,hidden:!K,inert:!K,onKeyDown:jt,"data-testid":N,...Pt.menuProps,...{0:{className:`x78zum5 xdt5ytf x1lsbc85 x1a2a7pz xpdipgo x87ps6o`},1:{className:`xdt5ytf x1lsbc85 x1a2a7pz xpdipgo x87ps6o x1s85apg`}}[!K|0],children:zt}),U.host))]})}Ge.displayName=`DropdownMenuSubMenu`;function R(e,t){return`item-${e.id??t}`}function Ke(e,t){return`section-${e.id??t}`}function qe(e,t){let{items:n,id:r,...i}=e;return(0,M.jsx)(Se,{...i},R(e,t))}function Je(e){let t=[];for(let n=0;n<e.length;n++){let i=e[n];`type`in i&&i.type===`divider`?t.push((0,M.jsx)(Te,{},`divider-${n}`)):`type`in i&&i.type===`section`?t.push((0,M.jsxs)(`div`,{role:`group`,"aria-label":i.title,children:[i.title&&(0,M.jsx)(`div`,{"aria-hidden":`true`,...s(r(`dropdown-menu-section-heading`),{className:`xu0wf1k xf314gf x9ynric x141an7d x1ltkj2j xv1l7n4 x87ps6o`}),children:i.title}),i.items.map(qe)]},Ke(i,n))):`type`in i||(i.items&&i.items.length>0?t.push((0,M.jsx)(Ge,{icon:i.icon,label:i.label,isDisabled:i.isDisabled,children:Je(i.items)},R(i,n))):t.push(qe(i,n)))}return t}function Ye(){return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(max-width: 768px) and (pointer: coarse)`).matches}function Xe(e){let[t,n]=(0,j.useState)(!1),[r,i]=(0,j.useState)([]),[a,o]=(0,j.useState)(null),[s,c]=(0,j.useState)(e);s!==e&&(c(e),e?n(Ye()):r.length>0&&i([]));let l=(0,j.useCallback)(e=>{i(t=>t.includes(e)?t:[...t,e])},[]),u=(0,j.useCallback)(()=>{i(e=>e.length===0?e:e.slice(0,-1))},[]),d=(0,j.useMemo)(()=>({isCompactTouch:t,viewStack:r,host:a,push:l,pop:u}),[t,r,a,l,u]),f=r.length>0;return{drillIn:d,isDrilled:f,wrapContent:(0,j.useCallback)(e=>(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`div`,{hidden:f,inert:f,...{0:{className:`xjp7ctv`},1:{className:`x1s85apg`}}[!!f|0],children:e}),(0,M.jsx)(`div`,{ref:o,className:`xjp7ctv`})]}),[f])}}export{Me as a,he as c,Le as i,me as l,Je as n,De as o,Re as r,_e as s,Xe as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{u as t}from"./themeProps-3IqahpCr.js";import{r as n}from"./tokens.stylex-BpCwr7Mf.js";import{n as r}from"./useAnnounce-DlZth-he.js";var i=e(t(),1),a={"--astryx-press-alpha":`var(--astryx-press-alpha)`,__varGroupHash__:`x1qqxm5o`},o={releaseMs:200};`${o.releaseMs}`;var s=a[`--astryx-press-alpha`];`${n[`--color-overlay-hover`]}${n[`--color-overlay-hover`]}`,`${n[`--color-overlay-pressed`]}${n[`--color-overlay-pressed`]}`,`${n[`--color-neutral`]}${n[`--color-neutral`]}`,`${n[`--color-overlay-pressed`]}${s}`;var c={backgroundColor:{"--astryx-press-alpha":`x11z29ks xli5ek3`,kKVMdj:`x14e4jsf`,k44tkh:`x8s9nux`,kyAemX:`xwkbtvz`,kWV6AL:`xziyay6`,"--_press-paint":`xz2mauf`,"--_press-paint-image":`x1l7afqf`,kWkggS:`xjbqb8w x1anq1lc x1s5nr2v x13ugjdw xl8sb5e xoevpu5 xprvw0a`,kKwaWg:`x7ngsy6 xubczrd`,$$css:!0},backgroundImage:{"--astryx-press-alpha":`x11z29ks xli5ek3`,kKVMdj:`x14e4jsf`,k44tkh:`x8s9nux`,kyAemX:`xwkbtvz`,kWV6AL:`xziyay6`,"--_press-paint":`xz2mauf`,"--_press-paint-image":`x1l7afqf`,kKwaWg:`x7uyq82 x3f84ok x7ngsy6 xubczrd xmvprkv xetgvay`,$$css:!0},backgroundImageOnNeutral:{"--astryx-press-alpha":`x11z29ks xli5ek3`,kKVMdj:`x14e4jsf`,k44tkh:`x8s9nux`,kyAemX:`xwkbtvz`,kWV6AL:`xziyay6`,"--_press-paint":`xz2mauf`,"--_press-paint-image":`x1l7afqf`,kKwaWg:`x14bno8m xzmimnh xvbnuu x5rw36h x1qxwyo6 x1otsd3y xo3fi6e`,$$css:!0},pressedBackgroundColor:{"--astryx-press-alpha":`x11z29ks xli5ek3`,kKVMdj:`x14e4jsf`,k44tkh:`x8s9nux`,kyAemX:`xwkbtvz`,kWV6AL:`xziyay6`,"--_press-paint":`xz2mauf`,"--_press-paint-image":`x1l7afqf`,kWkggS:`x1anq1lc x1s5nr2v x13ugjdw xl8sb5e`,kKwaWg:`x7ngsy6 xubczrd`,$$css:!0},pressedAlpha:{"--astryx-press-alpha":`x11z29ks xli5ek3`,kKVMdj:`x14e4jsf`,k44tkh:`x8s9nux`,kyAemX:`xwkbtvz`,kWV6AL:`xziyay6`,"--_press-paint":`xz2mauf`,"--_press-paint-image":`x1l7afqf`,$$css:!0}},l=(0,i.createContext)(null);l.displayName=`LinkContext`;function u(e){function t({href:t,to:n,ref:a,...o}){return!r(t)||!r(n)?(0,i.createElement)(`a`,{ref:a,...o}):e===`a`?(0,i.createElement)(`a`,{ref:a,...o,href:t}):(0,i.createElement)(e,{ref:a,...o,href:t,to:n??t})}return t.displayName=`SafeLink(${typeof e==`string`?e:e.displayName||e.name||`Component`})`,t}function d(e){let t=(0,i.use)(l),n=e??t?.component??`a`;return(0,i.useMemo)(()=>u(n),[n])}var f=o.releaseMs,p={originX:0,originY:0,phase:`idle`};function m(e,t,n){return Math.hypot(t-e.originX,n-e.originY)>10}function h(e,t,n,r){return{gesture:{...e,phase:t},paint:n,timer:r}}function g(e,t){if(t.kind===`down`)return{gesture:{originX:t.x,originY:t.y,phase:`armed`},paint:`none`,timer:`onset`};switch(e.phase){case`armed`:return t.kind===`move`?m(e,t.x,t.y)?h(e,`dead`,`none`,null):{gesture:e,paint:`none`,timer:null}:t.kind===`cancel`?h(e,`dead`,`none`,null):t.kind===`onset`?h(e,`pressed`,`on`,null):t.kind===`up`?h(e,`flash`,`on`,`flash`):{gesture:e,paint:`none`,timer:null};case`pressed`:return t.kind===`move`&&!m(e,t.x,t.y)?{gesture:e,paint:`on`,timer:null}:t.kind===`move`||t.kind===`cancel`?h(e,`dead`,`none`,null):t.kind===`up`?h(e,`fading`,`fading`,`fade`):{gesture:e,paint:`on`,timer:null};case`flash`:return t.kind===`flashEnd`?h(e,`fading`,`fading`,`fade`):{gesture:e,paint:`on`,timer:null};case`fading`:return t.kind===`fadeEnd`?{gesture:p,paint:`none`,timer:null}:{gesture:e,paint:`fading`,timer:null};case`dead`:return t.kind===`up`?{gesture:p,paint:`none`,timer:null}:{gesture:e,paint:`none`,timer:null};case`idle`:return{gesture:p,paint:`none`,timer:null}}}function _(){return p}var v=`data-astryx-pressable`,y=`data-astryx-press`,b={[v]:``},x=`:disabled, [aria-disabled="true"]`,S=null,C=0,w=0,T=null,E=0,D=null,O={fade:f,flash:100,onset:150},k={fade:`fadeEnd`,flash:`flashEnd`,onset:`onset`};function A(e,t){t===`none`?e.removeAttribute(y):e.setAttribute(y,t)}function j(){S?.timer!=null&&(clearTimeout(S.timer),S.timer=null)}function M(e){if(S==null)return;let t=e.gesture.phase!==S.gesture.phase;if((e.timer!=null||t)&&j(),S.gesture=e.gesture,A(S.element,e.paint),e.gesture.phase===`idle`)S=null;else if(e.timer!=null){let t=e.timer;S.timer=setTimeout(()=>{S!=null&&(S.timer=null),M(g(S?.gesture??_(),{kind:k[t]}))},O[t])}}function N(e){if(!(e instanceof Element))return null;let t=e.closest(`[${v}]`);return!(t instanceof HTMLElement)||t.matches(x)?null:t}function P(e){return Date.now()-w>=150?!1:T instanceof Node&&T.contains(e)}function F(){S?.gesture.phase===`dead`&&(j(),S=null)}function I(){S!=null&&(j(),S.element.removeAttribute(y),S=null)}function L(e){if(e.pointerType===`mouse`)return;if(S!=null){if(S.gesture.phase!==`fading`&&S.gesture.phase!==`flash`){I();return}I()}let t=N(e.target),n=t!=null&&P(t);E=Date.now(),D=e.target instanceof Node?e.target:null,!(t==null||n)&&(S={element:t,gesture:_(),pointerId:e.pointerId,timer:null},M(g(S.gesture,{kind:`down`,x:e.clientX,y:e.clientY})))}function R(e){S==null||S.pointerId!=null&&e.pointerId!==S.pointerId||M(g(S.gesture,{kind:`move`,x:e.clientX,y:e.clientY}))}function z(e){e.pointerType!==`mouse`&&(E=Date.now(),e.target instanceof Node&&(D=e.target),!(S==null||S.pointerId!=null&&e.pointerId!==S.pointerId)&&(M(g(S.gesture,{kind:`up`})),F()))}function B(){S!=null&&(M(g(S.gesture,{kind:`cancel`})),F())}function V(e){let t=e.target instanceof Node?e.target:document;Date.now()-E<3e3&&D!=null&&t.contains(D)&&(w=Date.now(),T=t),S!=null&&(t===document||t.contains(S.element))&&B()}function H(){document.visibilityState===`hidden`&&I()}var U={capture:!0,passive:!0};function W(){window.addEventListener(`pointerdown`,L,U),window.addEventListener(`pointermove`,R,U),window.addEventListener(`pointerup`,z,U),window.addEventListener(`pointercancel`,B,U),window.addEventListener(`touchcancel`,B,U),window.addEventListener(`dragstart`,B,U),document.addEventListener(`scroll`,V,U),document.addEventListener(`visibilitychange`,H)}function G(){window.removeEventListener(`pointerdown`,L,U),window.removeEventListener(`pointermove`,R,U),window.removeEventListener(`pointerup`,z,U),window.removeEventListener(`pointercancel`,B,U),window.removeEventListener(`touchcancel`,B,U),window.removeEventListener(`dragstart`,B,U),document.removeEventListener(`scroll`,V,U),document.removeEventListener(`visibilitychange`,H)}function K(){if(typeof window>`u`)return()=>void 0;C===0&&W(),C+=1;let e=!1;return()=>{e||(e=!0,--C,!(C>0)&&(G(),I(),w=0,T=null,E=0,D=null))}}function q(){return(0,i.useEffect)(()=>K(),[]),b}export{d as n,c as r,q as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{u as t}from"./themeProps-3IqahpCr.js";import{t as n}from"./useAnnounce-DlZth-he.js";import{i as r}from"./FieldStatus-CSAKvGxp.js";var i={kbCHJM:`x1nrll8i`,k3aq6I:`xsqj5wx`,$$css:!0},a={mirror:{k3aq6I:`xgtlewx`,$$css:!0},centerInline:e=>[i,{"--x-transform":`translate(-50%, ${e})`==null?void 0:`translate(-50%, ${e})`}]},o=e(t(),1),s=`data-astryx-modal-busy-region`,c=`position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;`,l=2e3,u=new WeakMap;function d(e,t){let n=e.querySelector(`:scope > [${s}]`);n??(n=document.createElement(`div`),n.setAttribute(s,``),n.setAttribute(`role`,`status`),n.setAttribute(`aria-live`,`polite`),n.setAttribute(`aria-atomic`,`true`),n.style.cssText=c,e.appendChild(n));let r=n,i=u.get(r);i!=null&&(cancelAnimationFrame(i.frame),clearTimeout(i.timer)),r.textContent=``;let a={frame:0};a.frame=requestAnimationFrame(()=>{r.textContent=t,a.timer=setTimeout(()=>{r.textContent=``,u.delete(r)},l)}),u.set(r,a)}function f(e,t,r){let i=n(),a=(0,o.useRef)(!1);(0,o.useEffect)(()=>{if(!e){a.current=!1;return}if(a.current)return;let n=requestAnimationFrame(()=>{a.current=!0;let e=r.current?.closest(`dialog`);e?.open&&e.matches(`:modal`)?d(e,t):i(t,`polite`)});return()=>cancelAnimationFrame(n)},[i,r,e,t])}function p({isRequired:e=!1,isOptional:t=!1}){let{defaultOptionality:n}=(0,o.use)(r);return!t&&(e||n===`required`)}export{f as n,a as r,p as t};
|
package/page/index.html
CHANGED
|
@@ -10,40 +10,46 @@
|
|
|
10
10
|
href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' rx='7' fill='%23000'/%3E%3Cg transform='translate(4 4)' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4.5 18.5c2 0 3-1.2 4.2-3.4l2.6-5c1-1.9 2.1-3.1 4.2-3.1'/%3E%3Cpath d='M5.5 8.2c1.6-.9 3.2-.4 3.8 1.6l2.3 6.6c.6 1.7 2.1 2.4 3.9 1.7'/%3E%3Ccircle cx='19.5' cy='4.5' r='1.6' fill='%23fff' stroke='none'/%3E%3C/g%3E%3C/svg%3E"
|
|
11
11
|
/>
|
|
12
12
|
<title>theorem studio</title>
|
|
13
|
-
<script type="module" crossorigin src="/studio/assets/index-
|
|
13
|
+
<script type="module" crossorigin src="/studio/assets/index-D7DLOQ55.js"></script>
|
|
14
14
|
<link rel="modulepreload" crossorigin href="/studio/assets/rolldown-runtime-hePW80VL.js">
|
|
15
15
|
<link rel="modulepreload" crossorigin href="/studio/assets/themeProps-3IqahpCr.js">
|
|
16
16
|
<link rel="modulepreload" crossorigin href="/studio/assets/tokens.stylex-BpCwr7Mf.js">
|
|
17
17
|
<link rel="modulepreload" crossorigin href="/studio/assets/padding.stylex-B76907Zf.js">
|
|
18
18
|
<link rel="modulepreload" crossorigin href="/studio/assets/mergeProps-ptS-gIMz.js">
|
|
19
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/
|
|
20
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/StackItem-
|
|
19
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/Stack-DPSs1dBF.js">
|
|
20
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/StackItem-YZCLellt.js">
|
|
21
21
|
<link rel="modulepreload" crossorigin href="/studio/assets/useLayerDismissal-BAnTRYTt.js">
|
|
22
22
|
<link rel="modulepreload" crossorigin href="/studio/assets/devWarning-DxuplmRl.js">
|
|
23
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/useMediaQuery-BCT0NUeZ.js">
|
|
24
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/Icon-BWzSKxTK.js">
|
|
25
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/focusOutline.stylex-B9nWSXsG.js">
|
|
26
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/useAnnounce-DlZth-he.js">
|
|
27
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/usePressFeedback-CBSbXJuo.js">
|
|
23
28
|
<link rel="modulepreload" crossorigin href="/studio/assets/sharedResizeObserver-4U9Xq5Oq.js">
|
|
24
29
|
<link rel="modulepreload" crossorigin href="/studio/assets/preload-helper-DpV6A1kQ.js">
|
|
25
30
|
<link rel="modulepreload" crossorigin href="/studio/assets/Text-B74VhVA7.js">
|
|
26
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/useMediaQuery-BCT0NUeZ.js">
|
|
27
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/Icon-3c9WmPTH.js">
|
|
28
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/useAnnounce-DOkF3CS1.js">
|
|
29
31
|
<link rel="modulepreload" crossorigin href="/studio/assets/useTooltip-BaCjTHk-.js">
|
|
32
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/Spinner--TVdDovX.js">
|
|
33
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/VisuallyHidden-BdRLF-8h.js">
|
|
34
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/IconButton-CerBBPke.js">
|
|
30
35
|
<link rel="modulepreload" crossorigin href="/studio/assets/Tooltip-DrSpWxD8.js">
|
|
31
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/
|
|
32
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/focusOutline.stylex-B9nWSXsG.js">
|
|
33
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/IconButton-BeI1pXEZ.js">
|
|
36
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/FieldStatus-CSAKvGxp.js">
|
|
34
37
|
<link rel="modulepreload" crossorigin href="/studio/assets/focusableSelector-DXZeMU85.js">
|
|
35
38
|
<link rel="modulepreload" crossorigin href="/studio/assets/useDevWarning-Z9SoixOP.js">
|
|
36
39
|
<link rel="modulepreload" crossorigin href="/studio/assets/createReactComponent-CZwsv6DD.js">
|
|
37
40
|
<link rel="modulepreload" crossorigin href="/studio/assets/isRtlElement-BG33-k_H.js">
|
|
38
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/fieldParts-
|
|
39
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/
|
|
41
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/fieldParts-CNKpMZ7U.js">
|
|
42
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/useResolvedRequired-CAelf7J-.js">
|
|
43
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/useAnnounceRenderedText-BrbiKE4-.js">
|
|
40
44
|
<link rel="modulepreload" crossorigin href="/studio/assets/plainDate-BHiJcj7o.js">
|
|
41
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/OverflowList-
|
|
45
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/OverflowList-BoqbSk8e.js">
|
|
42
46
|
<link rel="modulepreload" crossorigin href="/studio/assets/useScrollableArea-DuF_pz9m.js">
|
|
43
47
|
<link rel="modulepreload" crossorigin href="/studio/assets/ScrollableArea-CZpbLBeP.js">
|
|
48
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/HStack-cOiUht-L.js">
|
|
49
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/VStack-CEcm-qoM.js">
|
|
44
50
|
<link rel="modulepreload" crossorigin href="/studio/assets/container.stylex-C2nFBhUj.js">
|
|
45
51
|
<link rel="modulepreload" crossorigin href="/studio/assets/Card-D_40unTk.js">
|
|
46
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/SidePanel-
|
|
52
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/SidePanel-DLgOJwvB.js">
|
|
47
53
|
<link rel="modulepreload" crossorigin href="/studio/assets/IconAlertTriangle-BqAEqqdU.js">
|
|
48
54
|
<link rel="modulepreload" crossorigin href="/studio/assets/schemas-D7cgkv3L.js">
|
|
49
55
|
<link rel="modulepreload" crossorigin href="/studio/assets/host-patterns-F-KZIzkF.js">
|
|
@@ -63,25 +69,26 @@
|
|
|
63
69
|
<link rel="modulepreload" crossorigin href="/studio/assets/stub-CJG-5zBe.js">
|
|
64
70
|
<link rel="modulepreload" crossorigin href="/studio/assets/reader-SzTjS7rw.js">
|
|
65
71
|
<link rel="modulepreload" crossorigin href="/studio/assets/registry-BrmnEhgs.js">
|
|
66
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/browser-transport-
|
|
72
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/browser-transport-DHxl8B4G.js">
|
|
67
73
|
<link rel="modulepreload" crossorigin href="/studio/assets/focusReturn-CTppP2k0.js">
|
|
68
74
|
<link rel="modulepreload" crossorigin href="/studio/assets/isRenderable-DHkzpAoQ.js">
|
|
69
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/labels-provider-
|
|
70
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/useLocale-
|
|
71
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/CheckboxInput-
|
|
75
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/labels-provider-BcEDhptf.js">
|
|
76
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/useLocale-DrfYfZTs.js">
|
|
77
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/CheckboxInput-BIFNQqbA.js">
|
|
72
78
|
<link rel="modulepreload" crossorigin href="/studio/assets/useScrollLock-Dyf6PHJt.js">
|
|
73
79
|
<link rel="modulepreload" crossorigin href="/studio/assets/chainEventHandlers-C6ttXGfW.js">
|
|
74
80
|
<link rel="modulepreload" crossorigin href="/studio/assets/Dialog-DUNBjHOI.js">
|
|
75
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/useClipboard-
|
|
76
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/highlightRanges-
|
|
77
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/CodeBlock-
|
|
81
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/useClipboard-DeMRGvqJ.js">
|
|
82
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/highlightRanges-DvvjZZAv.js">
|
|
83
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/CodeBlock-PkWvyBvu.js">
|
|
78
84
|
<link rel="modulepreload" crossorigin href="/studio/assets/HoverCard-DMHc1Gh1.js">
|
|
79
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/
|
|
85
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/inputStyles.stylex-uYr8_KtT.js">
|
|
86
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/TextInput-6ChkOVD6.js">
|
|
80
87
|
<link rel="modulepreload" crossorigin href="/studio/assets/encode-files-CCet4LKE.js">
|
|
81
88
|
<link rel="modulepreload" crossorigin href="/studio/assets/turn-client-eM8VIbMd.js">
|
|
82
89
|
<link rel="modulepreload" crossorigin href="/studio/assets/Badge-D78MvW22.js">
|
|
83
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/CollapsibleGroup-
|
|
84
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/studio-labels-
|
|
90
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/CollapsibleGroup-Dfbkt6Hp.js">
|
|
91
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/studio-labels-BQnomulw.js">
|
|
85
92
|
<link rel="modulepreload" crossorigin href="/studio/assets/workspace-3igDw3Tv.js">
|
|
86
93
|
<link rel="modulepreload" crossorigin href="/studio/assets/lent-keys-C32ems-I.js">
|
|
87
94
|
<link rel="modulepreload" crossorigin href="/studio/assets/editors-BJX_S59A.js">
|
|
@@ -89,17 +96,17 @@
|
|
|
89
96
|
<link rel="modulepreload" crossorigin href="/studio/assets/people-CIsR0-5R.js">
|
|
90
97
|
<link rel="modulepreload" crossorigin href="/studio/assets/studio-session-ClF2iNCX.js">
|
|
91
98
|
<link rel="modulepreload" crossorigin href="/studio/assets/EmptyState-C_uF9Wyj.js">
|
|
92
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/use-second-ticker-
|
|
99
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/use-second-ticker-D29e7ivl.js">
|
|
93
100
|
<link rel="modulepreload" crossorigin href="/studio/assets/menuItemRoles-Bod0knkp.js">
|
|
94
101
|
<link rel="modulepreload" crossorigin href="/studio/assets/useMenuPress-DPpqa6F7.js">
|
|
95
102
|
<link rel="modulepreload" crossorigin href="/studio/assets/useAdaptivePresentation-Bma4-u1a.js">
|
|
96
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/useMenuDrillIn-
|
|
103
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/useMenuDrillIn-DOLSnkWq.js">
|
|
97
104
|
<link rel="modulepreload" crossorigin href="/studio/assets/useFocusReturnVisibility-BHKv5Jwr.js">
|
|
98
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/useKeyboardHint-
|
|
99
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/ListItem-
|
|
100
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/MenuBottomSheetActionList-
|
|
101
|
-
<link rel="stylesheet" crossorigin href="/studio/assets/use-second-ticker-
|
|
102
|
-
<link rel="stylesheet" crossorigin href="/studio/assets/index-
|
|
105
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/useKeyboardHint-BIqbBlHw.js">
|
|
106
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/ListItem-DrfoLYVQ.js">
|
|
107
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/MenuBottomSheetActionList-CG8160ZS.js">
|
|
108
|
+
<link rel="stylesheet" crossorigin href="/studio/assets/use-second-ticker-B-V4bkIB.css">
|
|
109
|
+
<link rel="stylesheet" crossorigin href="/studio/assets/index-Bl2XBXLS.css">
|
|
103
110
|
<style>html{color-scheme:dark}html,body{margin:0;background:#000}html[data-boot-pending],html[data-boot-pending] body{background:#262626}html[data-boot-pending] .astryx-app-shell{height:100dvh}html[data-boot-pending] .astryx-app-shell-sidenav{position:absolute;inset-block:0;inset-inline-start:0;z-index:0;width:3rem}html[data-boot-pending] #astryx-app-shell-main{position:relative;z-index:1;width:100%;height:100%;max-width:none;margin:0;border-radius:0;clip-path:none;background:#262626;color:#fff}html[data-boot-pending] #astryx-app-shell-main>:not([data-boot]){visibility:hidden}html[data-boot-pending] [data-boot]{position:absolute;inset:0;z-index:2;display:grid;place-items:center;background:#262626;color:#fff}</style>
|
|
104
111
|
<noscript> <style>html[data-boot-pending],html[data-boot-pending] body{background:#000}html[data-boot-pending] #astryx-app-shell-main>:not([data-boot]){visibility:visible !important}[data-boot]{display:none !important}</style>
|
|
105
112
|
</noscript>
|
package/ui/built/theme.css
CHANGED
|
@@ -253,9 +253,9 @@
|
|
|
253
253
|
--radius-container: 0.75rem;
|
|
254
254
|
--radius-page: 1.75rem;
|
|
255
255
|
--radius-full: 9999px;
|
|
256
|
-
--shadow-low: 0 2px 4px light-dark(oklch(0 0 0 / 5%), oklch(0 0 0 / 25%)), 0 4px 8px light-dark(oklch(0 0 0 / 10%), oklch(0 0 0 / 40%))
|
|
257
|
-
--shadow-med: 0 2px 4px light-dark(oklch(0 0 0 / 5%), oklch(0 0 0 / 35%)), 0 4px 12px light-dark(oklch(0 0 0 / 10%), oklch(0 0 0 / 50%))
|
|
258
|
-
--shadow-high: 0 4px 6px light-dark(oklch(0 0 0 / 10%), oklch(0 0 0 / 50%)), 0 12px 24px light-dark(oklch(0 0 0 / 15%), oklch(0 0 0 / 70%))
|
|
256
|
+
--shadow-low: 0 2px 4px light-dark(oklch(0 0 0 / 5%), oklch(0 0 0 / 25%)), 0 4px 8px light-dark(oklch(0 0 0 / 10%), oklch(0 0 0 / 40%));
|
|
257
|
+
--shadow-med: 0 2px 4px light-dark(oklch(0 0 0 / 5%), oklch(0 0 0 / 35%)), 0 4px 12px light-dark(oklch(0 0 0 / 10%), oklch(0 0 0 / 50%));
|
|
258
|
+
--shadow-high: 0 4px 6px light-dark(oklch(0 0 0 / 10%), oklch(0 0 0 / 50%)), 0 12px 24px light-dark(oklch(0 0 0 / 15%), oklch(0 0 0 / 70%));
|
|
259
259
|
--shadow-inset-hover: inset 0px 0px 0px 2px #0074e24D;
|
|
260
260
|
--shadow-inset-selected: inset 0px 0px 0px 2px #0074e280;
|
|
261
261
|
--shadow-inset-success: inset 0px 0px 0px 2px #2f7d334D;
|
|
@@ -654,6 +654,30 @@
|
|
|
654
654
|
transition: none;
|
|
655
655
|
}
|
|
656
656
|
|
|
657
|
+
.astryx-dialog {
|
|
658
|
+
--font-size-xs: 0.625rem;
|
|
659
|
+
--font-size-sm: 0.75rem;
|
|
660
|
+
--font-size-base: 0.875rem;
|
|
661
|
+
--font-size-lg: 1.0625rem;
|
|
662
|
+
--font-size-xl: 1.25rem;
|
|
663
|
+
--font-size-2xl: 1.5rem;
|
|
664
|
+
--text-body-size: var(--font-size-base);
|
|
665
|
+
--text-code-size: var(--font-size-base);
|
|
666
|
+
--text-label-size: var(--font-size-base);
|
|
667
|
+
--text-large-size: var(--font-size-lg);
|
|
668
|
+
--text-supporting-size: var(--font-size-sm);
|
|
669
|
+
--text-heading-1-size: var(--font-size-2xl);
|
|
670
|
+
--text-heading-2-size: var(--font-size-xl);
|
|
671
|
+
--text-heading-3-size: var(--font-size-lg);
|
|
672
|
+
--text-heading-4-size: var(--font-size-base);
|
|
673
|
+
--text-heading-5-size: var(--font-size-sm);
|
|
674
|
+
--text-heading-6-size: var(--font-size-xs);
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
.astryx-dialog::backdrop {
|
|
678
|
+
background-color: light-dark(#00000080, #000000BF);
|
|
679
|
+
}
|
|
680
|
+
|
|
657
681
|
.astryx-toast {
|
|
658
682
|
width: fit-content;
|
|
659
683
|
min-width: min(240px, 100%);
|
|
@@ -187,9 +187,9 @@ export const theoremStudioTheme = {
|
|
|
187
187
|
"--radius-container": "0.75rem",
|
|
188
188
|
"--radius-page": "1.75rem",
|
|
189
189
|
"--radius-full": "9999px",
|
|
190
|
-
"--shadow-low": "0 2px 4px light-dark(oklch(0 0 0 / 5%), oklch(0 0 0 / 25%)), 0 4px 8px light-dark(oklch(0 0 0 / 10%), oklch(0 0 0 / 40%))
|
|
191
|
-
"--shadow-med": "0 2px 4px light-dark(oklch(0 0 0 / 5%), oklch(0 0 0 / 35%)), 0 4px 12px light-dark(oklch(0 0 0 / 10%), oklch(0 0 0 / 50%))
|
|
192
|
-
"--shadow-high": "0 4px 6px light-dark(oklch(0 0 0 / 10%), oklch(0 0 0 / 50%)), 0 12px 24px light-dark(oklch(0 0 0 / 15%), oklch(0 0 0 / 70%))
|
|
190
|
+
"--shadow-low": "0 2px 4px light-dark(oklch(0 0 0 / 5%), oklch(0 0 0 / 25%)), 0 4px 8px light-dark(oklch(0 0 0 / 10%), oklch(0 0 0 / 40%))",
|
|
191
|
+
"--shadow-med": "0 2px 4px light-dark(oklch(0 0 0 / 5%), oklch(0 0 0 / 35%)), 0 4px 12px light-dark(oklch(0 0 0 / 10%), oklch(0 0 0 / 50%))",
|
|
192
|
+
"--shadow-high": "0 4px 6px light-dark(oklch(0 0 0 / 10%), oklch(0 0 0 / 50%)), 0 12px 24px light-dark(oklch(0 0 0 / 15%), oklch(0 0 0 / 70%))",
|
|
193
193
|
"--shadow-inset-hover": "inset 0px 0px 0px 2px #0074e24D",
|
|
194
194
|
"--shadow-inset-selected": "inset 0px 0px 0px 2px #0074e280",
|
|
195
195
|
"--shadow-inset-success": "inset 0px 0px 0px 2px #2f7d334D",
|
|
@@ -569,6 +569,30 @@ export const theoremStudioTheme = {
|
|
|
569
569
|
}
|
|
570
570
|
}
|
|
571
571
|
},
|
|
572
|
+
"dialog": {
|
|
573
|
+
"base": {
|
|
574
|
+
"--font-size-xs": "0.625rem",
|
|
575
|
+
"--font-size-sm": "0.75rem",
|
|
576
|
+
"--font-size-base": "0.875rem",
|
|
577
|
+
"--font-size-lg": "1.0625rem",
|
|
578
|
+
"--font-size-xl": "1.25rem",
|
|
579
|
+
"--font-size-2xl": "1.5rem",
|
|
580
|
+
"--text-body-size": "var(--font-size-base)",
|
|
581
|
+
"--text-code-size": "var(--font-size-base)",
|
|
582
|
+
"--text-label-size": "var(--font-size-base)",
|
|
583
|
+
"--text-large-size": "var(--font-size-lg)",
|
|
584
|
+
"--text-supporting-size": "var(--font-size-sm)",
|
|
585
|
+
"--text-heading-1-size": "var(--font-size-2xl)",
|
|
586
|
+
"--text-heading-2-size": "var(--font-size-xl)",
|
|
587
|
+
"--text-heading-3-size": "var(--font-size-lg)",
|
|
588
|
+
"--text-heading-4-size": "var(--font-size-base)",
|
|
589
|
+
"--text-heading-5-size": "var(--font-size-sm)",
|
|
590
|
+
"--text-heading-6-size": "var(--font-size-xs)",
|
|
591
|
+
"::backdrop": {
|
|
592
|
+
"backgroundColor": "light-dark(#00000080, #000000BF)"
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
},
|
|
572
596
|
"toast": {
|
|
573
597
|
"base": {
|
|
574
598
|
"width": "fit-content",
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type InputStatus } from '@astryxdesign/core/Field';
|
|
2
|
+
export interface JsonCodeProps {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
placeholder: string | undefined;
|
|
6
|
+
/** A placeholder that is a value, for Tab to take up. */
|
|
7
|
+
fills: string | undefined;
|
|
8
|
+
status: InputStatus | undefined;
|
|
9
|
+
onChange: (next: string) => void;
|
|
10
|
+
}
|
|
11
|
+
/** JSON as code, in a field as tall as its text. */
|
|
12
|
+
export declare function JsonCode({ label, value, placeholder, fills, status, onChange }: JsonCodeProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Field, inputStatusBorderStyles, inputStatusFocusWithinStyles, inputWrapperStyles, } from '@astryxdesign/core/Field';
|
|
3
|
+
import { HStack } from '@astryxdesign/core/Stack';
|
|
4
|
+
import { jsonDefaults } from 'monaco-editor/languages/features/json/register';
|
|
5
|
+
import { useEffect, useId, useRef } from 'react';
|
|
6
|
+
import { tabFills } from "../lib/tab-fills.js";
|
|
7
|
+
import { editor, serveMonacoWorkers, studioMonacoTheme } from "./studio-monaco.js";
|
|
8
|
+
const LINE_HEIGHT = 20;
|
|
9
|
+
const PADDING = 8;
|
|
10
|
+
// why: the kernel checks what a schema says; Monaco only says where the JSON breaks.
|
|
11
|
+
jsonDefaults.setDiagnosticsOptions({
|
|
12
|
+
validate: true,
|
|
13
|
+
allowComments: false,
|
|
14
|
+
comments: 'error',
|
|
15
|
+
trailingCommas: 'error',
|
|
16
|
+
schemaValidation: 'ignore',
|
|
17
|
+
schemaRequest: 'ignore',
|
|
18
|
+
});
|
|
19
|
+
jsonDefaults.setModeConfiguration({
|
|
20
|
+
documentFormattingEdits: true,
|
|
21
|
+
documentRangeFormattingEdits: true,
|
|
22
|
+
diagnostics: true,
|
|
23
|
+
foldingRanges: true,
|
|
24
|
+
selectionRanges: true,
|
|
25
|
+
tokens: true,
|
|
26
|
+
});
|
|
27
|
+
const workers = serveMonacoWorkers();
|
|
28
|
+
const FIELD_OPTIONS = {
|
|
29
|
+
language: 'json',
|
|
30
|
+
automaticLayout: true,
|
|
31
|
+
// why: under EditContext a focused field took no Cmd+A.
|
|
32
|
+
editContext: false,
|
|
33
|
+
fixedOverflowWidgets: true,
|
|
34
|
+
folding: true,
|
|
35
|
+
fontFamily: 'var(--font-family-code)',
|
|
36
|
+
fontSize: 12,
|
|
37
|
+
formatOnPaste: true,
|
|
38
|
+
glyphMargin: false,
|
|
39
|
+
guides: { bracketPairs: false, indentation: false },
|
|
40
|
+
hideCursorInOverviewRuler: true,
|
|
41
|
+
lineDecorationsWidth: 0,
|
|
42
|
+
lineHeight: LINE_HEIGHT,
|
|
43
|
+
lineNumbers: 'off',
|
|
44
|
+
lineNumbersMinChars: 0,
|
|
45
|
+
links: false,
|
|
46
|
+
minimap: { enabled: false },
|
|
47
|
+
occurrencesHighlight: 'off',
|
|
48
|
+
overviewRulerBorder: false,
|
|
49
|
+
overviewRulerLanes: 0,
|
|
50
|
+
padding: { top: PADDING, bottom: PADDING },
|
|
51
|
+
quickSuggestions: false,
|
|
52
|
+
renderLineHighlight: 'none',
|
|
53
|
+
// why: the field is as tall as its text, so the wheel belongs to the panel around it.
|
|
54
|
+
scrollbar: {
|
|
55
|
+
alwaysConsumeMouseWheel: false,
|
|
56
|
+
handleMouseWheel: false,
|
|
57
|
+
horizontal: 'hidden',
|
|
58
|
+
vertical: 'hidden',
|
|
59
|
+
},
|
|
60
|
+
scrollBeyondLastLine: false,
|
|
61
|
+
selectionHighlight: false,
|
|
62
|
+
showFoldingControls: 'mouseover',
|
|
63
|
+
stickyScroll: { enabled: false },
|
|
64
|
+
suggestOnTriggerCharacters: false,
|
|
65
|
+
tabSize: 2,
|
|
66
|
+
wordBasedSuggestions: 'off',
|
|
67
|
+
wordWrap: 'on',
|
|
68
|
+
wrappingIndent: 'indent',
|
|
69
|
+
};
|
|
70
|
+
/** JSON as code, in a field as tall as its text. */
|
|
71
|
+
export function JsonCode({ label, value, placeholder, fills, status, onChange }) {
|
|
72
|
+
const id = useId();
|
|
73
|
+
const node = useRef(null);
|
|
74
|
+
const code = useRef(undefined);
|
|
75
|
+
const latest = useRef({ value, placeholder, fills, onChange });
|
|
76
|
+
latest.current = { value, placeholder, fills, onChange };
|
|
77
|
+
useEffect(() => {
|
|
78
|
+
const host = node.current;
|
|
79
|
+
if (!host)
|
|
80
|
+
return;
|
|
81
|
+
let disposed = false;
|
|
82
|
+
void workers.then(() => {
|
|
83
|
+
if (disposed)
|
|
84
|
+
return;
|
|
85
|
+
const field = editor.create(host, {
|
|
86
|
+
...FIELD_OPTIONS,
|
|
87
|
+
ariaLabel: label,
|
|
88
|
+
placeholder: latest.current.placeholder,
|
|
89
|
+
theme: studioMonacoTheme(),
|
|
90
|
+
value: latest.current.value,
|
|
91
|
+
});
|
|
92
|
+
code.current = field;
|
|
93
|
+
const fit = () => {
|
|
94
|
+
const shown = field.getValue() === '' ? latest.current.placeholder : undefined;
|
|
95
|
+
const lines = shown?.split('\n').length ?? 1;
|
|
96
|
+
const blank = lines * LINE_HEIGHT + 2 * PADDING;
|
|
97
|
+
host.style.height = `${String(Math.max(field.getContentHeight(), blank))}px`;
|
|
98
|
+
};
|
|
99
|
+
field.onDidContentSizeChange(fit);
|
|
100
|
+
field.onDidChangeModelContent(() => {
|
|
101
|
+
const next = field.getValue();
|
|
102
|
+
if (next !== latest.current.value)
|
|
103
|
+
latest.current.onChange(next);
|
|
104
|
+
});
|
|
105
|
+
field.onKeyDown((event) => {
|
|
106
|
+
const { value: text, fills: example, onChange: change } = latest.current;
|
|
107
|
+
tabFills(text, example, change)(event.browserEvent);
|
|
108
|
+
});
|
|
109
|
+
fit();
|
|
110
|
+
});
|
|
111
|
+
return () => {
|
|
112
|
+
disposed = true;
|
|
113
|
+
code.current?.dispose();
|
|
114
|
+
code.current = undefined;
|
|
115
|
+
};
|
|
116
|
+
}, [label]);
|
|
117
|
+
useEffect(() => {
|
|
118
|
+
if (code.current && code.current.getValue() !== value)
|
|
119
|
+
code.current.setValue(value);
|
|
120
|
+
}, [value]);
|
|
121
|
+
return (_jsx(Field, { label: label, isLabelHidden: true, inputID: id, status: status, children: _jsx(HStack
|
|
122
|
+
// why: Astryx's own input styles hold a media-query shadow its `xstyle` type refuses.
|
|
123
|
+
, {
|
|
124
|
+
// why: Astryx's own input styles hold a media-query shadow its `xstyle` type refuses.
|
|
125
|
+
xstyle: [
|
|
126
|
+
inputWrapperStyles.base,
|
|
127
|
+
status && inputStatusBorderStyles[status.type],
|
|
128
|
+
status && inputStatusFocusWithinStyles[status.type],
|
|
129
|
+
], className: "json-code", children: _jsx("div", { ref: node, id: id, className: "json-code-host" }) }) }));
|
|
130
|
+
}
|
package/ui/code/studio-code.js
CHANGED
|
@@ -67,16 +67,9 @@ export function StudioCode({ text, hold, isReadOnly = false, issues, onApply })
|
|
|
67
67
|
// Colour only, until the visitor types. The typechecker is a compiler in
|
|
68
68
|
// a worker, so it stays out of this import.
|
|
69
69
|
await import('monaco-editor/languages/definitions/typescript/register');
|
|
70
|
-
|
|
71
|
-
self.MonacoEnvironment = {
|
|
72
|
-
getWorker() {
|
|
73
|
-
return new editorWorker();
|
|
74
|
-
},
|
|
75
|
-
};
|
|
70
|
+
await monaco.serveMonacoWorkers();
|
|
76
71
|
if (life.disposed || !host.isConnected)
|
|
77
72
|
return;
|
|
78
|
-
const dark = document.documentElement.dataset.theme === 'dark' ||
|
|
79
|
-
globalThis.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
80
73
|
const uri = monaco.Uri.parse('file:///agent.ts');
|
|
81
74
|
monaco.editor.getModel(uri)?.dispose();
|
|
82
75
|
const model = monaco.editor.createModel(printed.current, 'typescript', uri);
|
|
@@ -84,7 +77,7 @@ export function StudioCode({ text, hold, isReadOnly = false, issues, onApply })
|
|
|
84
77
|
model,
|
|
85
78
|
readOnly: readOnly.current,
|
|
86
79
|
language: 'typescript',
|
|
87
|
-
theme:
|
|
80
|
+
theme: monaco.studioMonacoTheme(),
|
|
88
81
|
minimap: { enabled: false },
|
|
89
82
|
fontSize: 13,
|
|
90
83
|
wordWrap: 'on',
|
|
@@ -41,4 +41,8 @@ import 'monaco-editor/editor/contrib/wordHighlighter/browser/wordHighlighter';
|
|
|
41
41
|
import 'monaco-editor/editor/contrib/wordOperations/browser/wordOperations';
|
|
42
42
|
import 'monaco-editor/editor/contrib/wordPartOperations/browser/wordPartOperations';
|
|
43
43
|
import 'monaco-editor/features/find/register';
|
|
44
|
+
/** Gives Monaco its workers: JSON's own, and the editor's for the rest. */
|
|
45
|
+
export declare function serveMonacoWorkers(): Promise<void>;
|
|
46
|
+
/** The Monaco theme for the page's colour scheme. */
|
|
47
|
+
export declare function studioMonacoTheme(): "vs-dark" | "vs";
|
|
44
48
|
export { editor, languages, MarkerSeverity, Uri };
|
package/ui/code/studio-monaco.js
CHANGED
|
@@ -45,4 +45,22 @@ import 'monaco-editor/editor/contrib/wordHighlighter/browser/wordHighlighter';
|
|
|
45
45
|
import 'monaco-editor/editor/contrib/wordOperations/browser/wordOperations';
|
|
46
46
|
import 'monaco-editor/editor/contrib/wordPartOperations/browser/wordPartOperations';
|
|
47
47
|
import 'monaco-editor/features/find/register';
|
|
48
|
+
/** Gives Monaco its workers: JSON's own, and the editor's for the rest. */
|
|
49
|
+
export async function serveMonacoWorkers() {
|
|
50
|
+
const [{ default: EditorWorker }, { default: JsonWorker }] = await Promise.all([
|
|
51
|
+
import('monaco-editor/editor/editor.worker?worker'),
|
|
52
|
+
import('monaco-editor/languages/features/json/json.worker?worker'),
|
|
53
|
+
]);
|
|
54
|
+
self.MonacoEnvironment = {
|
|
55
|
+
getWorker(_id, label) {
|
|
56
|
+
return label === 'json' ? new JsonWorker() : new EditorWorker();
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
/** The Monaco theme for the page's colour scheme. */
|
|
61
|
+
export function studioMonacoTheme() {
|
|
62
|
+
const dark = document.documentElement.dataset.theme === 'dark' ||
|
|
63
|
+
globalThis.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
64
|
+
return dark ? 'vs-dark' : 'vs';
|
|
65
|
+
}
|
|
48
66
|
export { editor, languages, MarkerSeverity, Uri };
|
package/ui/inspector.d.ts
CHANGED
|
@@ -147,12 +147,20 @@ export declare function TextAreaRow(props: FieldRowProps & {
|
|
|
147
147
|
placeholder?: string;
|
|
148
148
|
hint?: string;
|
|
149
149
|
rows?: number;
|
|
150
|
-
|
|
151
|
-
/** A status of the row's own, such as text that is not JSON; the field's issues win. */
|
|
150
|
+
/** A status of the row's own; the field's issues win. */
|
|
152
151
|
status?: InputStatus;
|
|
153
152
|
action?: ReactNode;
|
|
154
153
|
onChange: (next: string) => void;
|
|
155
154
|
}): import("react").JSX.Element;
|
|
155
|
+
/** JSON under its label, as code. Plain text holds its place until the editor has loaded. */
|
|
156
|
+
export declare function JsonRow(props: FieldRowProps & {
|
|
157
|
+
value: string;
|
|
158
|
+
placeholder?: string;
|
|
159
|
+
hint?: string;
|
|
160
|
+
/** A status of the row's own, such as text that is not JSON; the field's issues win. */
|
|
161
|
+
status?: InputStatus;
|
|
162
|
+
onChange: (next: string) => void;
|
|
163
|
+
}): import("react").JSX.Element;
|
|
156
164
|
/** A number the kernel leaves unset when cleared: it gives `null`, shown as what leaving it out does. */
|
|
157
165
|
export declare function NumberRow(props: FieldRowProps & {
|
|
158
166
|
value: number | null;
|