pisper 0.6.34 → 0.6.35
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 +5 -5
- package/web/.vite/manifest.json +662 -669
- package/web/assets/{AppDialog-xnUDICdc.js → AppDialog-BIc2uEZh.js} +1 -1
- package/web/assets/{AppOverlays-rUZC1kCv.js → AppOverlays-BlJ0uL_P.js} +1 -1
- package/web/assets/{AssetsPage-XEKK_C-R.js → AssetsPage-B9lqKmXy.js} +1 -1
- package/web/assets/BoardPage-BB_xAnQV.js +3 -0
- package/web/assets/{ChannelsPage-qmX4oWnZ.js → ChannelsPage-DgzuzmFL.js} +1 -1
- package/web/assets/{ChatAppearancePage-BfSCRq3M.js → ChatAppearancePage-98Sa8ZQW.js} +1 -1
- package/web/assets/{ChatHistoryPage-Dn2KO-xs.js → ChatHistoryPage-BHsZFF4a.js} +1 -1
- package/web/assets/ChatPage-C3NC9LNG.js +553 -0
- package/web/assets/{ConfigPage-bwrsIfQ2.js → ConfigPage-D3SyAsIs.js} +2 -2
- package/web/assets/{DesktopWindowControls-BYSFRwAw.js → DesktopWindowControls-BQ0OvDZ8.js} +1 -1
- package/web/assets/{FeaturePage-DTDpEz7O.js → FeaturePage-C0bAQ4el.js} +1 -1
- package/web/assets/{FileAttachmentPreview-DSXCj6RP.js → FileAttachmentPreview-BdMgsecO.js} +1 -1
- package/web/assets/{FloatingWidgets-BbeW1y-O.js → FloatingWidgets-DjMCcqln.js} +1 -1
- package/web/assets/FocusRuntimeControls-DeSe12wJ.js +2 -0
- package/web/assets/{GitDiffViewer-DQVUfRzI.js → GitDiffViewer-hHSTzUJk.js} +1 -1
- package/web/assets/{ManageProjectsDialog-69xTwGhN.js → ManageProjectsDialog-DVLX4ZBu.js} +1 -1
- package/web/assets/{MarkdownMessage-CMM5-pzJ.js → MarkdownMessage-CktdHgKM.js} +1 -1
- package/web/assets/{McpPage-DuR_f74H.js → McpPage-7wR_N0eS.js} +1 -1
- package/web/assets/{MemoryEvolution-Ulreb-P1.js → MemoryEvolution-DBjU-Nr7.js} +1 -1
- package/web/assets/MemoryPage-DiO4GHc7.js +2 -0
- package/web/assets/{MobileNavigation-B6e3f9M1.js → MobileNavigation-B2NKM8rj.js} +1 -1
- package/web/assets/{MorePage-BAEFRO9r.js → MorePage-xB2zBRtU.js} +1 -1
- package/web/assets/{NewFolderDialog-CrIBoIPP.js → NewFolderDialog-CjWMsY2Q.js} +1 -1
- package/web/assets/{PageHeader-CkkhGH11.js → PageHeader-BN-qcxte.js} +1 -1
- package/web/assets/{PhoneDrawer-BQglMtV6.js → PhoneDrawer-utEXi-yp.js} +1 -1
- package/web/assets/{PhoneMenuButton-CudQuQyy.js → PhoneMenuButton-uG_T93KL.js} +1 -1
- package/web/assets/{PhoneTopBar-DyaB9qif.js → PhoneTopBar-DuLewk2J.js} +1 -1
- package/web/assets/{PluginsPage-DMLkkpQg.js → PluginsPage-D0hAMgQ_.js} +1 -1
- package/web/assets/{SafeModePrompt-BWzQ6wxr.js → SafeModePrompt-jV-PRvrW.js} +1 -1
- package/web/assets/{SchedulesPage-CvsxgvB6.js → SchedulesPage-Diethe4H.js} +1 -1
- package/web/assets/{SessionBrowserPane-NHFA_B4m.js → SessionBrowserPane-y7gPArTV.js} +2 -2
- package/web/assets/{SessionContextPanel-DTHjt2nZ.js → SessionContextPanel-Ckca3NrN.js} +2 -2
- package/web/assets/{SessionHome-B1OsYR84.js → SessionHome-CcjiU1fU.js} +1 -1
- package/web/assets/SessionInspector-CNSyVYK6.js +1 -0
- package/web/assets/{SessionShell-BfdEBF6l.js → SessionShell-wOw-rTQD.js} +1 -1
- package/web/assets/{SettingsSidebar-z1Fxmoyd.js → SettingsSidebar-CpAD5iSt.js} +1 -1
- package/web/assets/{ShortcutHelpDialog-DL3H1yOW.js → ShortcutHelpDialog-C2QbSvui.js} +1 -1
- package/web/assets/{ShortcutKeys-DPl0NOHr.js → ShortcutKeys-Dl4Suwhz.js} +1 -1
- package/web/assets/{SidebarUpdateStatus-Cpew_R7W.js → SidebarUpdateStatus-DrS7u_v_.js} +1 -1
- package/web/assets/{SkillsPage-Dl57veVj.js → SkillsPage-CDoMtK-E.js} +1 -1
- package/web/assets/{TaskProcessesPane-B6hiVd6p.js → TaskProcessesPane-Z_9HeVX5.js} +1 -1
- package/web/assets/{TaskTerminalView-jBOqCyhw.js → TaskTerminalView-BTCVpAHF.js} +1 -1
- package/web/assets/{TerminalPanel-CAl3KAS_.js → TerminalPanel-DuUtaPyf.js} +1 -1
- package/web/assets/{WebDesktopPet-kcayOmfs.js → WebDesktopPet-CWviMnct.js} +1 -1
- package/web/assets/{WorkflowsPage-DrX0d5UQ.js → WorkflowsPage-CHvyXwCg.js} +1 -1
- package/web/assets/{WorkspacePicker-Bt_doGjv.js → WorkspacePicker-D6FLo7O1.js} +1 -1
- package/web/assets/{api-C35aq3ml.js → api-Cm58F7OP.js} +1 -1
- package/web/assets/{app-update-5vmM-tQ5.js → app-update-KLjtuCDT.js} +1 -1
- package/web/assets/{approval-confirm-DhWuPa_J.js → approval-confirm-BrorOUHg.js} +1 -1
- package/web/assets/board-messages-3qT8nGsd.js +1 -0
- package/web/assets/{board-projects-Nk7cPRh8.js → board-projects-CeL6PPiY.js} +1 -1
- package/web/assets/{bots-store-CWuQZKi-.js → bots-store-CRGayU4z.js} +1 -1
- package/web/assets/chat-api-DQyHZl-V.js +1 -0
- package/web/assets/{client-store-D1Oy98mB.js → client-store-4G-xfNKc.js} +1 -1
- package/web/assets/{config-search-C5x1n8SB.js → config-search-1BIdouae.js} +1 -1
- package/web/assets/{desktop-hosts-9JgAXtsJ.js → desktop-hosts-uMG7lFRY.js} +1 -1
- package/web/assets/{dialog-27CgEIc2.js → dialog-D23yIdOZ.js} +1 -1
- package/web/assets/{event-stream-DTCmB4AA.js → event-stream-BrDcABQx.js} +1 -1
- package/web/assets/{events-DMbz7S1A.js → events-BgEZwyTb.js} +1 -1
- package/web/assets/{folder-paths-BB2PvkZ4.js → folder-paths-D0-7xV2n.js} +1 -1
- package/web/assets/{hosts-D81SQ3Fm.js → hosts-DljHKUSO.js} +1 -1
- package/web/assets/{http-YNvizzuJ.js → http-DtkTCrZ4.js} +1 -1
- package/web/assets/{http-response-Bb_1H1lE.js → http-response-B2n7HFQ4.js} +1 -1
- package/web/assets/i18n-B7QmqfvO.js +1 -0
- package/web/assets/{index-_WvEqLNn.js → index-79gEOxmD.js} +2 -2
- package/web/assets/index-XwGsScbB.css +2 -0
- package/web/assets/{machine-messages-Cnbja0tj.js → machine-messages-Bd6JwiOe.js} +1 -1
- package/web/assets/{machines-api-p5yRMnI5.js → machines-api-Kg457H3y.js} +1 -1
- package/web/assets/{memory-api-CSEqYBZN.js → memory-api-DHLgFXzZ.js} +1 -1
- package/web/assets/message-square-text-C5MJw0FL.js +1 -0
- package/web/assets/mount-app-BlaI2VZs.js +9 -0
- package/web/assets/{permission-rules-api-BM5qRwQ-.js → permission-rules-api-BZn4yp-J.js} +1 -1
- package/web/assets/{pick-system-directory-CjwfGZuj.js → pick-system-directory-DS_-qn8W.js} +1 -1
- package/web/assets/placements-BMxzzGTX.js +2 -0
- package/web/assets/{popover-CaaxkJV6.js → popover-C5U02alK.js} +1 -1
- package/web/assets/{public-Cs-VgI_R.js → public-B8mbf50i.js} +1 -1
- package/web/assets/public-Be05c5M9.js +2 -0
- package/web/assets/{public-bgEdGMBy.js → public-Bq1VrNr8.js} +2 -2
- package/web/assets/{public-CTCOj1Tc.js → public-DsjuTTt0.js} +1 -1
- package/web/assets/{public-components-Cxirb-D4.js → public-components-CMbKXCZU.js} +1 -1
- package/web/assets/public-diff-4sBkfeo8.js +1 -0
- package/web/assets/public-events-D2kHUhG2.js +1 -0
- package/web/assets/{public-flags-BHDCY_aY.js → public-flags-D8CxujmF.js} +1 -1
- package/web/assets/{public-folder-dialog-MAINAiLs.js → public-folder-dialog-Dnmn6DIU.js} +1 -1
- package/web/assets/{public-greeting-nLVPlZrv.js → public-greeting-Cs-sacVq.js} +1 -1
- package/web/assets/{public-session-qCqrUJ6y.js → public-session-DSLmbBcw.js} +1 -1
- package/web/assets/{public-sidebar-D6Ujh_8I.js → public-sidebar-UNJ9_fD1.js} +1 -1
- package/web/assets/{runtime-capabilities-store-D_0w_fuG.js → runtime-capabilities-store-Y9MaywP8.js} +1 -1
- package/web/assets/{safe-mode-instance-B1xRd2Id.js → safe-mode-instance-CYIRMY5i.js} +1 -1
- package/web/assets/safe-mode-sentinel-Bq9lNJoA.js +1 -0
- package/web/assets/{session-change-summary-api-Bz6qW3dZ.js → session-change-summary-api-Dp9vVPv_.js} +1 -1
- package/web/assets/{session-home-CdOoCouS.js → session-home-DqEkX19H.js} +1 -1
- package/web/assets/{session-inspector-store-BUq8tTV4.js → session-inspector-store-D_mwa4K7.js} +1 -1
- package/web/assets/{session-organization-api-oAt9Tied.js → session-organization-api-ibzfB8fg.js} +1 -1
- package/web/assets/session-questions-94KACguh.js +1 -0
- package/web/assets/{session-scope-PFTSXL_B.js → session-scope-BJIZo6ty.js} +1 -1
- package/web/assets/{session-tree-actions-D-hQZc07.js → session-tree-actions-B8GDKcGe.js} +1 -1
- package/web/assets/{session-tree-summary-gqTig55_.js → session-tree-summary-BTcPaCgY.js} +1 -1
- package/web/assets/{shortcuts-B5Q10H38.js → shortcuts-DRfz9B_B.js} +1 -1
- package/web/assets/side-chat-context-CRQ33Q0D.js +7 -0
- package/web/assets/{sidebar-Dct9J7LY.js → sidebar-DrzZKq2i.js} +1 -1
- package/web/assets/{sidebar-store-CHqFyueh.js → sidebar-store-BvZAgxJg.js} +1 -1
- package/web/assets/{speech-session-BzWOz7_A.js → speech-session-DGkMojp3.js} +1 -1
- package/web/assets/{startup-queries-LEtJRewm.js → startup-queries-BjjeYiQ8.js} +1 -1
- package/web/assets/{use-i18n-QY-mTTDS.js → use-i18n-8V6eRMcE.js} +1 -1
- package/web/assets/{use-open-bot-BCteAGsU.js → use-open-bot-BEhRmhru.js} +1 -1
- package/web/assets/{use-studio-actions-CVQo8gWA.js → use-studio-actions-BsdfCptK.js} +1 -1
- package/web/assets/{useCatalogProjects-B0P8PrPz.js → useCatalogProjects-DKjmAJ2x.js} +1 -1
- package/web/assets/{useMachines-D-YSauyl.js → useMachines-BBeg2uOZ.js} +1 -1
- package/web/assets/useNewProjectPicker-Cmw2SOhW.js +2 -0
- package/web/assets/{useNow-CvnDomJ8.js → useNow-D-gM4IXU.js} +1 -1
- package/web/assets/{usePhoneShell-Cv5Or-Rz.js → usePhoneShell-DRZTDDgZ.js} +1 -1
- package/web/assets/useSessionListQuery-DtpEX8a5.js +2 -0
- package/web/assets/{useSessionRowActions-DaVD7CkP.js → useSessionRowActions-DBqnVodk.js} +1 -1
- package/web/assets/{useSidebarModel-KU2-5Lqq.js → useSidebarModel-DBH3JLQ1.js} +1 -1
- package/web/assets/{workspace-folders-BrwI22Ku.js → workspace-folders-Bu3t-gEw.js} +1 -1
- package/web/assets/{workspace-order-store-04YPBRRV.js → workspace-order-store-DmEFuNUL.js} +1 -1
- package/web/index.html +2 -2
- package/web/assets/BoardPage-DsRRgaSA.js +0 -3
- package/web/assets/ChatPage-saAM1R5P.js +0 -553
- package/web/assets/FocusRuntimeControls-CUqEkAM6.js +0 -1
- package/web/assets/MemoryPage-BSAhhmdG.js +0 -2
- package/web/assets/SessionInspector-CIfPX9LJ.js +0 -1
- package/web/assets/board-messages-D6AWGHuF.js +0 -1
- package/web/assets/chat-api-fzSB1i2N.js +0 -1
- package/web/assets/focus-session-composer-bits-B_mOqktE.js +0 -1
- package/web/assets/i18n-CWhhZ2QN.js +0 -1
- package/web/assets/index-BTqJTVNA.css +0 -2
- package/web/assets/mount-app-Dee6SQOq.js +0 -9
- package/web/assets/placements-BvtgsaIH.js +0 -2
- package/web/assets/public-DW6Tkvj2.js +0 -2
- package/web/assets/public-diff-B2iBx26D.js +0 -1
- package/web/assets/public-events-QnPYL1F-.js +0 -1
- package/web/assets/safe-mode-sentinel-DmNv7ZYs.js +0 -1
- package/web/assets/session-questions-Cf-1g85h.js +0 -1
- package/web/assets/side-chat-context-CoDP1BZc.js +0 -7
- package/web/assets/useNewProjectPicker-V3_nwv5l.js +0 -2
- package/web/assets/useSessionListQuery-CuUmG2UC.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{u as t}from"./vendor-router-CSN_DGvx.js";import{t as n}from"./index-_WvEqLNn.js";import{i as r,r as i}from"./vendor-react-DwNgTV1j.js";import{o as a,r as o}from"./routes-DIeaqWVc.js";import{t as s}from"./use-i18n-QY-mTTDS.js";import{a as c,i as l,o as u}from"./vendor-state-GkUciC5H.js";import{r as d,t as f}from"./useQuery-DfOU-27z.js";import{A as p,j as m,n as h,r as g,t as _}from"./session-scope-PFTSXL_B.js";import{t as v}from"./createLucideIcon-Cd-3GVxJ.js";import{t as y}from"./ellipsis-CfGKfbq6.js";import{t as b}from"./grip-vertical-B__LYT0s.js";import{t as x}from"./plus-fQbSqB1n.js";import{t as S}from"./rotate-ccw-C0v8V77_.js";import{t as C}from"./settings-2-CXJjXJS9.js";import{t as w}from"./x-07u4-129.js";import{c as T,d as E,f as D,i as O,p as k,r as A,t as ee,u as te}from"./dropdown-menu-Ds0gD8S8.js";import{i as ne,n as re,t as j}from"./popover-CaaxkJV6.js";import{t as M}from"./utils-C8uzG5AZ.js";import{t as N}from"./button-CCcCN8tE.js";import{A as P,D as ie,E as ae,I as oe,O as se,S as F,f as ce,i as I,t as L,u as R}from"./use-studio-actions-CVQo8gWA.js";var le=v(`arrow-right-left`,[[`path`,{d:`m16 3 4 4-4 4`,key:`1x1c3m`}],[`path`,{d:`M20 7H4`,key:`zbl0bi`}],[`path`,{d:`m8 21-4-4 4-4`,key:`h9nckh`}],[`path`,{d:`M4 17h16`,key:`g4d7ey`}]]),ue=v(`square-arrow-out-up-right`,[[`path`,{d:`M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6`,key:`y09zxi`}],[`path`,{d:`m21 3-9 9`,key:`mpx6sq`}],[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}]]),z=e(r(),1),B=e=>Math.min(1,Math.max(0,e)),V=e=>Number.isFinite(e)?Math.max(0,e):0,H=8,U=12,de=160;function fe(e,t,n=0){let r=Math.max(0,V(e.width)-V(t.width)),i=Math.max(0,V(e.height)-V(t.height)),a=Math.max(0,i-de),o=Math.max(0,a-H),s=V(t.height)+U,c=s?Math.floor(o/s)+1:1,l=Math.max(0,Math.floor(n)),u=Math.floor(l/c),d=l%c,f=r-H-u*(V(t.width)+U),p=a-d*s;return{x:r?B(f/r):1,y:i?B(p/i):1}}function pe(e,t){return`${t?`mobile`:`desktop`}:${e}`}function W(e,t,n){return{x:B(e.x)*Math.max(0,V(t.width)-V(n.width)),y:B(e.y)*Math.max(0,V(t.height)-V(n.height))}}function G(e,t,n,r){let i=W(e,n,r),a=Math.max(0,V(n.width)-V(r.width)),o=Math.max(0,V(n.height)-V(r.height));return{x:B(a?(i.x+t.x)/a:e.x),y:B(o?(i.y+t.y)/o:e.y)}}function K(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function q(e){if(!Array.isArray(e))return[];let t=new Map;for(let n of e)!K(n)||typeof n.key!=`string`||!/^(desktop|mobile):[a-zA-Z0-9][a-zA-Z0-9._:-]{0,95}$/.test(n.key)||!K(n.position)||typeof n.position.x!=`number`||!Number.isFinite(n.position.x)||typeof n.position.y!=`number`||!Number.isFinite(n.position.y)||(t.delete(n.key),t.set(n.key,{x:B(n.position.x),y:B(n.position.y)}),t.size>128&&t.delete(t.keys().next().value??``));return[...t].map(([e,t])=>({key:e,position:t}))}function me(e,t,n){return q([...e.filter(e=>e.key!==t),{key:t,position:n}])}var he=l(()=>({getItem:e=>{try{return n.getItem(e)}catch{return null}},setItem:(e,t)=>{try{n.setItem(e,t)}catch{}},removeItem:e=>{try{n.removeItem(e)}catch{}}})),J=u()(c(e=>({positions:[],setPosition:(t,n)=>e(e=>({positions:me(e.positions,t,n)})),resetPosition:t=>e(e=>({positions:e.positions.filter(e=>e.key!==t)}))}),{name:`pisper-floating-placement`,version:1,storage:he,partialize:({positions:e})=>({positions:e}),merge:(e,t)=>({...t,positions:q(e&&typeof e==`object`&&`positions`in e?e.positions:void 0)})})),Y=i(),X={width:0,height:0},ge=/^(?:desktop|mobile):[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Z=`flex items-center justify-center rounded-full bg-key text-content-muted shadow-key ring-1 ring-key-border hover:text-content`;function _e(e){let t=e.component.manifest,n=t&&se(t,`floating`)?.size||ae;return{width:n.w,height:n.h}}function ve({placed:e,boundaryRef:t,activeSessionId:n,notify:r,onClose:i,stackIndex:a}){let{t:o}=s(),{instance:c,component:l}=e,u=R(l,r),d=pe(c.instanceId,!1),f=J(e=>e.positions.find(e=>e.key===d)?.position),p=(0,z.useRef)(null),m=(0,z.useRef)(null),[h,g]=(0,z.useState)(null),[_,v]=(0,z.useState)({bounds:X,widget:X}),y=f??fe(_.bounds,_.widget,a),x=(0,z.useId)(),C=_e(e),T=c.title||l.manifest?.name||l.name;(0,z.useEffect)(()=>{let e=t.current,n=p.current;if(!e||!n)return;let r=()=>{let t={bounds:{width:e.clientWidth,height:e.clientHeight},widget:{width:n.offsetWidth,height:n.offsetHeight}};v(e=>e.bounds.width===t.bounds.width&&e.bounds.height===t.bounds.height&&e.widget.width===t.widget.width&&e.widget.height===t.widget.height?e:t)},i=new ResizeObserver(()=>r());return r(),i.observe(e),i.observe(n),window.addEventListener(`resize`,r),()=>{i.disconnect(),window.removeEventListener(`resize`,r)}},[t]),(0,z.useEffect)(()=>(g(null),()=>{let e=m.current;m.current=null,e?.element.hasPointerCapture(e.pointerId)&&e.element.releasePointerCapture(e.pointerId)}),[d]);let E=(e,t)=>{let n=m.current;!n||n.pointerId!==e.pointerId||(m.current=null,t&&J.getState().setPosition(d,n.latest),g(null),n.element.hasPointerCapture(n.pointerId)&&n.element.releasePointerCapture(n.pointerId))},D=()=>J.getState().resetPosition(d),O=e=>{let t=e.shiftKey?32:12,n={ArrowLeft:{x:-t,y:0},ArrowRight:{x:t,y:0},ArrowUp:{x:0,y:-t},ArrowDown:{x:0,y:t}};if(e.key===`Home`){e.preventDefault(),D();return}let r=n[e.key];r&&(e.preventDefault(),J.getState().setPosition(d,G(y,r,_.bounds,_.widget)))},k=W(h??y,_.bounds,_.widget);return(0,Y.jsxs)(`div`,{ref:p,role:`group`,"aria-label":T,"data-floating-widget":c.instanceId,"data-floating-component":l.id,className:`pointer-events-auto absolute flex max-w-full flex-col px-6`,style:{left:k.x,top:k.y,width:C.width+48,maxHeight:`100%`,visibility:_.bounds.width>0?`visible`:`hidden`},children:[(0,Y.jsxs)(`div`,{className:`absolute top-1/2 left-0 z-10 flex -translate-y-1/2 flex-col items-center gap-1`,children:[(0,Y.jsx)(`button`,{type:`button`,"aria-label":o(`custom-ui:floating.move`),"aria-describedby":x,title:o(`custom-ui:floating.moveHint`),className:M(Z,`h-6 w-5 touch-none`),style:{cursor:h?`grabbing`:`grab`},"data-floating-move":!0,onKeyDown:O,onPointerDown:e=>{e.button!==0||m.current||(e.preventDefault(),e.currentTarget.focus({preventScroll:!0}),e.currentTarget.setPointerCapture(e.pointerId),m.current={pointerId:e.pointerId,element:e.currentTarget,x:e.clientX,y:e.clientY,initial:y,latest:y},g(y))},onPointerMove:e=>{let t=m.current;if(!t||t.pointerId!==e.pointerId)return;let n=G(t.initial,{x:e.clientX-t.x,y:e.clientY-t.y},_.bounds,_.widget);t.latest=n,g(n)},onPointerUp:e=>E(e,!0),onPointerCancel:e=>E(e,!1),onLostPointerCapture:e=>E(e,!1),children:(0,Y.jsx)(b,{className:`size-3`})}),(0,Y.jsx)(`button`,{type:`button`,"aria-label":o(`custom-ui:floating.resetPosition`),title:o(`custom-ui:floating.resetPosition`),onClick:D,className:M(Z,`size-5`),children:(0,Y.jsx)(S,{className:`size-3`})}),(0,Y.jsx)(`span`,{id:x,className:`sr-only`,children:o(`custom-ui:floating.moveHint`)})]}),(0,Y.jsx)(`button`,{type:`button`,"aria-label":o(`custom-ui:floating.close`),title:o(`custom-ui:floating.close`),"data-floating-close":!0,onClick:()=>i(c.instanceId),className:M(Z,`absolute top-1/2 right-0 z-10 size-5 -translate-y-1/2`),children:(0,Y.jsx)(w,{className:`size-3`})}),(0,Y.jsx)(`div`,{className:`flex min-h-0 flex-col overflow-hidden rounded-md border border-stroke bg-panel shadow-key`,style:{height:C.height},children:(0,Y.jsx)(P,{component:l,instance:{instanceId:c.instanceId,surface:`floating`,title:c.title,props:c.props},session:n?{id:n,title:``,cwd:``,status:`idle`}:void 0,notify:r,onRequestFix:u,className:`h-full`})})]})}function ye({placed:e,activeSessionId:t,notify:n,hidden:r=!1}){let{t:i}=s(),a=d(),o=(0,z.useRef)(null);(0,z.useEffect)(()=>{let e=J.getState();for(let t of e.positions)ge.test(t.key)||e.resetPosition(t.key)},[]);let c=e=>{p(e,{enabled:!1}).then(()=>a.invalidateQueries({queryKey:m.instances()}),()=>n(i(`custom-ui:floating.closeFailed`)))};return(0,Y.jsx)(`div`,{ref:o,className:`pointer-events-none fixed inset-x-2 top-12 bottom-2 z-40 overflow-hidden`,hidden:r,"data-floating-custom-ui":!0,children:e.map((e,r)=>(0,Y.jsx)(ve,{placed:e,boundaryRef:o,activeSessionId:t,notify:n,onClose:c,stackIndex:r},e.instance.instanceId))})}var be=[`session-panel`,`feature-page`,`floating`];function xe(e,t){let{instance:n,component:r}=e;return n.title||r.manifest?.i18n[t]?.name||r.name}function Q({placed:e,label:n,instances:r,notify:i}){let{t:o}=s(),c=t(),l=L(i),[u,d]=(0,z.useState)(!1),{instance:f,component:p}=e,m=async e=>{if(!u){d(!0);try{if(!await l.place(p,r,{surface:e,...f.title?{title:f.title}:{},props:f.props}))return;await l.unplace(f)&&i(o(`custom-ui:overview.moved`,{place:I(e,o)}))}finally{d(!1)}}};return(0,Y.jsxs)(ee,{children:[(0,Y.jsx)(k,{asChild:!0,children:(0,Y.jsx)(N,{type:`button`,variant:`ghost`,size:`icon-sm`,className:`flex-none`,disabled:u,"aria-label":o(`custom-ui:overview.menu`,{name:n}),title:o(`custom-ui:overview.menu`,{name:n}),"data-overview-component-menu":!0,children:(0,Y.jsx)(y,{"aria-hidden":`true`})})}),(0,Y.jsxs)(A,{align:`end`,className:`w-52`,children:[(0,Y.jsxs)(O,{onSelect:()=>c(a(p.id),{state:{componentInstanceId:f.instanceId}}),children:[(0,Y.jsx)(C,{"aria-hidden":`true`}),o(`custom-ui:overview.settings`)]}),(0,Y.jsxs)(O,{onSelect:()=>c(a(p.id)),children:[(0,Y.jsx)(ue,{"aria-hidden":`true`}),o(`custom-ui:tool.openInStudio`)]}),(0,Y.jsxs)(te,{children:[(0,Y.jsxs)(D,{"data-overview-component-move":!0,children:[(0,Y.jsx)(le,{"aria-hidden":`true`}),o(`custom-ui:overview.move`)]}),(0,Y.jsx)(E,{className:`w-48`,children:be.map(e=>{let t=F(p.manifest,e),n=r.some(t=>t.componentId===p.id&&t.surface===e&&t.enabled);return(0,Y.jsxs)(O,{disabled:!t||n,"data-overview-component-move-to":e,onSelect:()=>void m(e),children:[I(e,o),(0,Y.jsx)(`span`,{className:`ml-auto text-xs text-content-muted`,children:t?n?o(`custom-ui:studio.placed`):``:o(`custom-ui:studio.placeUndeclaredShort`)})]},e)})})]}),(0,Y.jsx)(T,{}),(0,Y.jsxs)(O,{"data-overview-component-remove":!0,onSelect:()=>{l.unplace(f).then(e=>{e&&i(o(`custom-ui:overview.removed`,{name:n}))})},children:[(0,Y.jsx)(w,{"aria-hidden":`true`}),o(`custom-ui:overview.remove`)]})]})]})}function Se({placed:e,instances:t,activeSessionId:n,notify:r,onOpenSession:i}){let{t:a,language:o}=s(),{instance:c,component:l}=e,u=c.size===`M`?`M`:`S`,d=xe(e,o),f=R(l,r);return(0,Y.jsxs)(`article`,{"aria-label":d,"data-overview-component":c.instanceId,"data-overview-component-id":l.id,"data-overview-component-size":u,className:`flex-none overflow-hidden rounded-[var(--r-lg)] bg-panel ring-1 ring-stroke`,children:[(0,Y.jsxs)(`header`,{className:`flex h-9 items-center gap-2 border-b border-stroke-soft pr-1 pl-3 pointer-coarse:h-12`,children:[(0,Y.jsx)(`h3`,{className:`min-w-0 flex-1 truncate text-[13px] leading-5 font-medium text-content`,children:d}),(0,Y.jsx)(`span`,{className:`flex-none rounded-xs border border-stroke px-1.5 text-[11px] leading-4 text-content-muted`,children:a(`custom-ui:overview.badge`)}),(0,Y.jsx)(Q,{placed:e,label:d,instances:t,notify:r})]}),(0,Y.jsx)(`div`,{"data-overview-component-body":!0,className:`overflow-hidden`,style:{height:ie[u].h},children:(0,Y.jsx)(P,{component:l,instance:{instanceId:c.instanceId,surface:`overview-card`,title:c.title,props:c.props,size:u},session:n?{id:n,title:``,cwd:``,status:`idle`}:void 0,notify:r,onOpenSession:i,onRequestFix:f,className:`h-full`})})]})}function $({className:e}){let{t:n}=s(),r=t();return(0,Y.jsxs)(`button`,{type:`button`,"data-overview-component-place":!0,onClick:()=>r(o.components),className:M(`flex h-9 w-full flex-none items-center justify-center gap-1.5 rounded-[var(--r-lg)] border border-dashed border-stroke-strong text-[12.5px] text-content-muted transition-colors duration-(--d-fast) hover:bg-surface-hover hover:text-content focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus pointer-coarse:h-11`,e),children:[(0,Y.jsx)(x,{className:`size-3.5`,"aria-hidden":`true`}),n(`custom-ui:overview.place`)]})}function Ce({placed:e,layout:t,activeSessionId:n,notify:r,onOpenSession:i}){let{t:a}=s(),o=f(g()).data?.instances??[],c=e.map(e=>(0,Y.jsx)(Se,{placed:e,instances:o,activeSessionId:n,notify:r,onOpenSession:i},e.instance.instanceId));return t===`popover`?(0,Y.jsxs)(j,{children:[(0,Y.jsx)(ne,{asChild:!0,children:(0,Y.jsx)(N,{variant:`outline`,"data-overview-components-trigger":!0,children:a(`custom-ui:overview.trigger`,{count:e.length})})}),(0,Y.jsxs)(re,{align:`end`,"aria-label":a(`custom-ui:overview.heading`),"data-overview-components":`popover`,className:`max-h-(--radix-popover-content-available-height) w-[344px] gap-3 overflow-y-auto p-3`,children:[c,(0,Y.jsx)($,{})]})]}):(0,Y.jsxs)(`div`,{"data-overview-components":t,className:M(`flex flex-col gap-3`,t===`phone`&&`mt-6`),children:[(0,Y.jsx)(`h2`,{className:`text-[13px] leading-5 font-medium text-content-secondary`,children:a(`custom-ui:overview.heading`)}),c,(0,Y.jsx)($,{})]})}function we({placed:e,sessionId:t,cwd:n,notify:r,onOpenSession:i}){let a=oe().find(e=>e.id===t),o=a?.title??``,s=a?.status??`idle`,c=(0,z.useMemo)(()=>({id:t,title:o,cwd:a?.cwd||n,status:s}),[n,t,s,a?.cwd,o]),{instance:l,component:u}=e,d=R(u,r);return(0,Y.jsx)(`div`,{"data-session-panel-component":l.instanceId,className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden`,children:(0,Y.jsx)(P,{component:u,instance:{instanceId:l.instanceId,surface:`session-panel`,title:l.title,props:l.props},session:c,notify:r,onOpenSession:i,onRequestFix:d,className:`h-full`},t)})}function Te(e,t){return e.manifest?.i18n[t]?.name||e.name}function Ee({cwd:e,notify:t,onAdded:n}){let{t:r,language:i}=s(),a=f(h()),o=f(g()),c=L(t),[l,u]=(0,z.useState)(null),d=o.data?.instances??[],p=(a.data?.components??[]).filter(e=>ce(e)&&F(e.manifest,`session-panel`)),m=async(e,t)=>{if(!l){u(e.id);try{let r=await c.place(e,d,{surface:`session-panel`,scope:t});r&&n(r.instance.instanceId)}finally{u(null)}}};return a.isPending||o.isPending?(0,Y.jsx)(`p`,{role:`status`,className:`text-content-muted`,children:r(`custom-ui:customUiPage.loading`)}):a.error||o.error?(0,Y.jsxs)(`div`,{className:`flex flex-col items-start gap-2`,children:[(0,Y.jsx)(`p`,{role:`alert`,className:`text-content-secondary`,children:r(`custom-ui:widget.catalogFailed`)}),(0,Y.jsx)(N,{type:`button`,size:`sm`,variant:`secondary`,onClick:()=>{a.refetch(),o.refetch()},children:r(`custom-ui:widget.retry`)})]}):p.length?(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,"data-session-component-add-menu":!0,children:[(0,Y.jsx)(`p`,{className:`text-content-secondary`,children:r(`custom-ui:sessionPanel.addHint`)}),(0,Y.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:p.map(t=>{let a=Te(t,i),o=d.find(e=>e.componentId===t.id&&e.surface===`session-panel`),s=!!(o?.enabled&&_(o.scope,e));return(0,Y.jsxs)(`li`,{"data-session-component-candidate":t.id,className:`flex flex-col gap-1.5 rounded-sm px-1.5 py-1.5`,children:[(0,Y.jsx)(`span`,{className:`truncate text-[13px] font-medium text-content`,children:a}),s&&o?(0,Y.jsx)(N,{type:`button`,size:`sm`,variant:`ghost`,className:`self-start`,onClick:()=>n(o.instanceId),children:r(`custom-ui:studio.placed`)}):(0,Y.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[(0,Y.jsx)(N,{type:`button`,size:`sm`,variant:`secondary`,disabled:l!==null,"data-session-component-scope":`all`,onClick:()=>void m(t,{type:`all`}),children:r(`custom-ui:studio.scopeAll`)}),(0,Y.jsx)(N,{type:`button`,size:`sm`,variant:`secondary`,disabled:l!==null||!e,"data-session-component-scope":`project`,onClick:()=>void m(t,{type:`project`,cwd:e}),children:r(`custom-ui:sessionPanel.thisProject`)})]})]},t.id)})})]}):(0,Y.jsx)(`p`,{className:`text-content-secondary`,children:r(`custom-ui:sessionPanel.empty`)})}export{P as ComponentHost,ye as FloatingComponents,Ce as OverviewComponents,Ee as SessionComponentAddMenu,we as SessionPanelComponent};
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{u as t}from"./vendor-router-CSN_DGvx.js";import{t as n}from"./index-79gEOxmD.js";import{i as r,r as i}from"./vendor-react-DwNgTV1j.js";import{o as a,r as o}from"./routes-DIeaqWVc.js";import{t as s}from"./use-i18n-8V6eRMcE.js";import{a as c,i as l,o as u}from"./vendor-state-GkUciC5H.js";import{r as d,t as f}from"./useQuery-DfOU-27z.js";import{A as p,j as m,n as h,r as g,t as _}from"./session-scope-BJIZo6ty.js";import{t as v}from"./createLucideIcon-Cd-3GVxJ.js";import{t as y}from"./ellipsis-CfGKfbq6.js";import{t as b}from"./grip-vertical-B__LYT0s.js";import{t as x}from"./plus-fQbSqB1n.js";import{t as S}from"./rotate-ccw-C0v8V77_.js";import{t as C}from"./settings-2-CXJjXJS9.js";import{t as w}from"./x-07u4-129.js";import{c as T,d as E,f as D,i as O,p as k,r as A,t as ee,u as te}from"./dropdown-menu-Ds0gD8S8.js";import{i as ne,n as re,t as j}from"./popover-C5U02alK.js";import{t as M}from"./utils-C8uzG5AZ.js";import{t as N}from"./button-CCcCN8tE.js";import{A as P,D as ie,E as ae,I as oe,O as se,S as F,f as ce,i as I,t as L,u as R}from"./use-studio-actions-BsdfCptK.js";var le=v(`arrow-right-left`,[[`path`,{d:`m16 3 4 4-4 4`,key:`1x1c3m`}],[`path`,{d:`M20 7H4`,key:`zbl0bi`}],[`path`,{d:`m8 21-4-4 4-4`,key:`h9nckh`}],[`path`,{d:`M4 17h16`,key:`g4d7ey`}]]),ue=v(`square-arrow-out-up-right`,[[`path`,{d:`M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6`,key:`y09zxi`}],[`path`,{d:`m21 3-9 9`,key:`mpx6sq`}],[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}]]),z=e(r(),1),B=e=>Math.min(1,Math.max(0,e)),V=e=>Number.isFinite(e)?Math.max(0,e):0,H=8,U=12,de=160;function fe(e,t,n=0){let r=Math.max(0,V(e.width)-V(t.width)),i=Math.max(0,V(e.height)-V(t.height)),a=Math.max(0,i-de),o=Math.max(0,a-H),s=V(t.height)+U,c=s?Math.floor(o/s)+1:1,l=Math.max(0,Math.floor(n)),u=Math.floor(l/c),d=l%c,f=r-H-u*(V(t.width)+U),p=a-d*s;return{x:r?B(f/r):1,y:i?B(p/i):1}}function pe(e,t){return`${t?`mobile`:`desktop`}:${e}`}function W(e,t,n){return{x:B(e.x)*Math.max(0,V(t.width)-V(n.width)),y:B(e.y)*Math.max(0,V(t.height)-V(n.height))}}function G(e,t,n,r){let i=W(e,n,r),a=Math.max(0,V(n.width)-V(r.width)),o=Math.max(0,V(n.height)-V(r.height));return{x:B(a?(i.x+t.x)/a:e.x),y:B(o?(i.y+t.y)/o:e.y)}}function K(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function q(e){if(!Array.isArray(e))return[];let t=new Map;for(let n of e)!K(n)||typeof n.key!=`string`||!/^(desktop|mobile):[a-zA-Z0-9][a-zA-Z0-9._:-]{0,95}$/.test(n.key)||!K(n.position)||typeof n.position.x!=`number`||!Number.isFinite(n.position.x)||typeof n.position.y!=`number`||!Number.isFinite(n.position.y)||(t.delete(n.key),t.set(n.key,{x:B(n.position.x),y:B(n.position.y)}),t.size>128&&t.delete(t.keys().next().value??``));return[...t].map(([e,t])=>({key:e,position:t}))}function me(e,t,n){return q([...e.filter(e=>e.key!==t),{key:t,position:n}])}var he=l(()=>({getItem:e=>{try{return n.getItem(e)}catch{return null}},setItem:(e,t)=>{try{n.setItem(e,t)}catch{}},removeItem:e=>{try{n.removeItem(e)}catch{}}})),J=u()(c(e=>({positions:[],setPosition:(t,n)=>e(e=>({positions:me(e.positions,t,n)})),resetPosition:t=>e(e=>({positions:e.positions.filter(e=>e.key!==t)}))}),{name:`pisper-floating-placement`,version:1,storage:he,partialize:({positions:e})=>({positions:e}),merge:(e,t)=>({...t,positions:q(e&&typeof e==`object`&&`positions`in e?e.positions:void 0)})})),Y=i(),X={width:0,height:0},ge=/^(?:desktop|mobile):[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Z=`flex items-center justify-center rounded-full bg-key text-content-muted shadow-key ring-1 ring-key-border hover:text-content`;function _e(e){let t=e.component.manifest,n=t&&se(t,`floating`)?.size||ae;return{width:n.w,height:n.h}}function ve({placed:e,boundaryRef:t,activeSessionId:n,notify:r,onClose:i,stackIndex:a}){let{t:o}=s(),{instance:c,component:l}=e,u=R(l,r),d=pe(c.instanceId,!1),f=J(e=>e.positions.find(e=>e.key===d)?.position),p=(0,z.useRef)(null),m=(0,z.useRef)(null),[h,g]=(0,z.useState)(null),[_,v]=(0,z.useState)({bounds:X,widget:X}),y=f??fe(_.bounds,_.widget,a),x=(0,z.useId)(),C=_e(e),T=c.title||l.manifest?.name||l.name;(0,z.useEffect)(()=>{let e=t.current,n=p.current;if(!e||!n)return;let r=()=>{let t={bounds:{width:e.clientWidth,height:e.clientHeight},widget:{width:n.offsetWidth,height:n.offsetHeight}};v(e=>e.bounds.width===t.bounds.width&&e.bounds.height===t.bounds.height&&e.widget.width===t.widget.width&&e.widget.height===t.widget.height?e:t)},i=new ResizeObserver(()=>r());return r(),i.observe(e),i.observe(n),window.addEventListener(`resize`,r),()=>{i.disconnect(),window.removeEventListener(`resize`,r)}},[t]),(0,z.useEffect)(()=>(g(null),()=>{let e=m.current;m.current=null,e?.element.hasPointerCapture(e.pointerId)&&e.element.releasePointerCapture(e.pointerId)}),[d]);let E=(e,t)=>{let n=m.current;!n||n.pointerId!==e.pointerId||(m.current=null,t&&J.getState().setPosition(d,n.latest),g(null),n.element.hasPointerCapture(n.pointerId)&&n.element.releasePointerCapture(n.pointerId))},D=()=>J.getState().resetPosition(d),O=e=>{let t=e.shiftKey?32:12,n={ArrowLeft:{x:-t,y:0},ArrowRight:{x:t,y:0},ArrowUp:{x:0,y:-t},ArrowDown:{x:0,y:t}};if(e.key===`Home`){e.preventDefault(),D();return}let r=n[e.key];r&&(e.preventDefault(),J.getState().setPosition(d,G(y,r,_.bounds,_.widget)))},k=W(h??y,_.bounds,_.widget);return(0,Y.jsxs)(`div`,{ref:p,role:`group`,"aria-label":T,"data-floating-widget":c.instanceId,"data-floating-component":l.id,className:`pointer-events-auto absolute flex max-w-full flex-col px-6`,style:{left:k.x,top:k.y,width:C.width+48,maxHeight:`100%`,visibility:_.bounds.width>0?`visible`:`hidden`},children:[(0,Y.jsxs)(`div`,{className:`absolute top-1/2 left-0 z-10 flex -translate-y-1/2 flex-col items-center gap-1`,children:[(0,Y.jsx)(`button`,{type:`button`,"aria-label":o(`custom-ui:floating.move`),"aria-describedby":x,title:o(`custom-ui:floating.moveHint`),className:M(Z,`h-6 w-5 touch-none`),style:{cursor:h?`grabbing`:`grab`},"data-floating-move":!0,onKeyDown:O,onPointerDown:e=>{e.button!==0||m.current||(e.preventDefault(),e.currentTarget.focus({preventScroll:!0}),e.currentTarget.setPointerCapture(e.pointerId),m.current={pointerId:e.pointerId,element:e.currentTarget,x:e.clientX,y:e.clientY,initial:y,latest:y},g(y))},onPointerMove:e=>{let t=m.current;if(!t||t.pointerId!==e.pointerId)return;let n=G(t.initial,{x:e.clientX-t.x,y:e.clientY-t.y},_.bounds,_.widget);t.latest=n,g(n)},onPointerUp:e=>E(e,!0),onPointerCancel:e=>E(e,!1),onLostPointerCapture:e=>E(e,!1),children:(0,Y.jsx)(b,{className:`size-3`})}),(0,Y.jsx)(`button`,{type:`button`,"aria-label":o(`custom-ui:floating.resetPosition`),title:o(`custom-ui:floating.resetPosition`),onClick:D,className:M(Z,`size-5`),children:(0,Y.jsx)(S,{className:`size-3`})}),(0,Y.jsx)(`span`,{id:x,className:`sr-only`,children:o(`custom-ui:floating.moveHint`)})]}),(0,Y.jsx)(`button`,{type:`button`,"aria-label":o(`custom-ui:floating.close`),title:o(`custom-ui:floating.close`),"data-floating-close":!0,onClick:()=>i(c.instanceId),className:M(Z,`absolute top-1/2 right-0 z-10 size-5 -translate-y-1/2`),children:(0,Y.jsx)(w,{className:`size-3`})}),(0,Y.jsx)(`div`,{className:`flex min-h-0 flex-col overflow-hidden rounded-md border border-stroke bg-panel shadow-key`,style:{height:C.height},children:(0,Y.jsx)(P,{component:l,instance:{instanceId:c.instanceId,surface:`floating`,title:c.title,props:c.props},session:n?{id:n,title:``,cwd:``,status:`idle`}:void 0,notify:r,onRequestFix:u,className:`h-full`})})]})}function ye({placed:e,activeSessionId:t,notify:n,hidden:r=!1}){let{t:i}=s(),a=d(),o=(0,z.useRef)(null);(0,z.useEffect)(()=>{let e=J.getState();for(let t of e.positions)ge.test(t.key)||e.resetPosition(t.key)},[]);let c=e=>{p(e,{enabled:!1}).then(()=>a.invalidateQueries({queryKey:m.instances()}),()=>n(i(`custom-ui:floating.closeFailed`)))};return(0,Y.jsx)(`div`,{ref:o,className:`pointer-events-none fixed inset-x-2 top-12 bottom-2 z-40 overflow-hidden`,hidden:r,"data-floating-custom-ui":!0,children:e.map((e,r)=>(0,Y.jsx)(ve,{placed:e,boundaryRef:o,activeSessionId:t,notify:n,onClose:c,stackIndex:r},e.instance.instanceId))})}var be=[`session-panel`,`feature-page`,`floating`];function xe(e,t){let{instance:n,component:r}=e;return n.title||r.manifest?.i18n[t]?.name||r.name}function Q({placed:e,label:n,instances:r,notify:i}){let{t:o}=s(),c=t(),l=L(i),[u,d]=(0,z.useState)(!1),{instance:f,component:p}=e,m=async e=>{if(!u){d(!0);try{if(!await l.place(p,r,{surface:e,...f.title?{title:f.title}:{},props:f.props}))return;await l.unplace(f)&&i(o(`custom-ui:overview.moved`,{place:I(e,o)}))}finally{d(!1)}}};return(0,Y.jsxs)(ee,{children:[(0,Y.jsx)(k,{asChild:!0,children:(0,Y.jsx)(N,{type:`button`,variant:`ghost`,size:`icon-sm`,className:`flex-none`,disabled:u,"aria-label":o(`custom-ui:overview.menu`,{name:n}),title:o(`custom-ui:overview.menu`,{name:n}),"data-overview-component-menu":!0,children:(0,Y.jsx)(y,{"aria-hidden":`true`})})}),(0,Y.jsxs)(A,{align:`end`,className:`w-52`,children:[(0,Y.jsxs)(O,{onSelect:()=>c(a(p.id),{state:{componentInstanceId:f.instanceId}}),children:[(0,Y.jsx)(C,{"aria-hidden":`true`}),o(`custom-ui:overview.settings`)]}),(0,Y.jsxs)(O,{onSelect:()=>c(a(p.id)),children:[(0,Y.jsx)(ue,{"aria-hidden":`true`}),o(`custom-ui:tool.openInStudio`)]}),(0,Y.jsxs)(te,{children:[(0,Y.jsxs)(D,{"data-overview-component-move":!0,children:[(0,Y.jsx)(le,{"aria-hidden":`true`}),o(`custom-ui:overview.move`)]}),(0,Y.jsx)(E,{className:`w-48`,children:be.map(e=>{let t=F(p.manifest,e),n=r.some(t=>t.componentId===p.id&&t.surface===e&&t.enabled);return(0,Y.jsxs)(O,{disabled:!t||n,"data-overview-component-move-to":e,onSelect:()=>void m(e),children:[I(e,o),(0,Y.jsx)(`span`,{className:`ml-auto text-xs text-content-muted`,children:t?n?o(`custom-ui:studio.placed`):``:o(`custom-ui:studio.placeUndeclaredShort`)})]},e)})})]}),(0,Y.jsx)(T,{}),(0,Y.jsxs)(O,{"data-overview-component-remove":!0,onSelect:()=>{l.unplace(f).then(e=>{e&&i(o(`custom-ui:overview.removed`,{name:n}))})},children:[(0,Y.jsx)(w,{"aria-hidden":`true`}),o(`custom-ui:overview.remove`)]})]})]})}function Se({placed:e,instances:t,activeSessionId:n,notify:r,onOpenSession:i}){let{t:a,language:o}=s(),{instance:c,component:l}=e,u=c.size===`M`?`M`:`S`,d=xe(e,o),f=R(l,r);return(0,Y.jsxs)(`article`,{"aria-label":d,"data-overview-component":c.instanceId,"data-overview-component-id":l.id,"data-overview-component-size":u,className:`flex-none overflow-hidden rounded-[var(--r-lg)] bg-panel ring-1 ring-stroke`,children:[(0,Y.jsxs)(`header`,{className:`flex h-9 items-center gap-2 border-b border-stroke-soft pr-1 pl-3 pointer-coarse:h-12`,children:[(0,Y.jsx)(`h3`,{className:`min-w-0 flex-1 truncate text-[13px] leading-5 font-medium text-content`,children:d}),(0,Y.jsx)(`span`,{className:`flex-none rounded-xs border border-stroke px-1.5 text-[11px] leading-4 text-content-muted`,children:a(`custom-ui:overview.badge`)}),(0,Y.jsx)(Q,{placed:e,label:d,instances:t,notify:r})]}),(0,Y.jsx)(`div`,{"data-overview-component-body":!0,className:`overflow-hidden`,style:{height:ie[u].h},children:(0,Y.jsx)(P,{component:l,instance:{instanceId:c.instanceId,surface:`overview-card`,title:c.title,props:c.props,size:u},session:n?{id:n,title:``,cwd:``,status:`idle`}:void 0,notify:r,onOpenSession:i,onRequestFix:f,className:`h-full`})})]})}function $({className:e}){let{t:n}=s(),r=t();return(0,Y.jsxs)(`button`,{type:`button`,"data-overview-component-place":!0,onClick:()=>r(o.components),className:M(`flex h-9 w-full flex-none items-center justify-center gap-1.5 rounded-[var(--r-lg)] border border-dashed border-stroke-strong text-[12.5px] text-content-muted transition-colors duration-(--d-fast) hover:bg-surface-hover hover:text-content focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus pointer-coarse:h-11`,e),children:[(0,Y.jsx)(x,{className:`size-3.5`,"aria-hidden":`true`}),n(`custom-ui:overview.place`)]})}function Ce({placed:e,layout:t,activeSessionId:n,notify:r,onOpenSession:i}){let{t:a}=s(),o=f(g()).data?.instances??[],c=e.map(e=>(0,Y.jsx)(Se,{placed:e,instances:o,activeSessionId:n,notify:r,onOpenSession:i},e.instance.instanceId));return t===`popover`?(0,Y.jsxs)(j,{children:[(0,Y.jsx)(ne,{asChild:!0,children:(0,Y.jsx)(N,{variant:`outline`,"data-overview-components-trigger":!0,children:a(`custom-ui:overview.trigger`,{count:e.length})})}),(0,Y.jsxs)(re,{align:`end`,"aria-label":a(`custom-ui:overview.heading`),"data-overview-components":`popover`,className:`max-h-(--radix-popover-content-available-height) w-[344px] gap-3 overflow-y-auto p-3`,children:[c,(0,Y.jsx)($,{})]})]}):(0,Y.jsxs)(`div`,{"data-overview-components":t,className:M(`flex flex-col gap-3`,t===`phone`&&`mt-6`),children:[(0,Y.jsx)(`h2`,{className:`text-[13px] leading-5 font-medium text-content-secondary`,children:a(`custom-ui:overview.heading`)}),c,(0,Y.jsx)($,{})]})}function we({placed:e,sessionId:t,cwd:n,notify:r,onOpenSession:i}){let a=oe().find(e=>e.id===t),o=a?.title??``,s=a?.status??`idle`,c=(0,z.useMemo)(()=>({id:t,title:o,cwd:a?.cwd||n,status:s}),[n,t,s,a?.cwd,o]),{instance:l,component:u}=e,d=R(u,r);return(0,Y.jsx)(`div`,{"data-session-panel-component":l.instanceId,className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden`,children:(0,Y.jsx)(P,{component:u,instance:{instanceId:l.instanceId,surface:`session-panel`,title:l.title,props:l.props},session:c,notify:r,onOpenSession:i,onRequestFix:d,className:`h-full`},t)})}function Te(e,t){return e.manifest?.i18n[t]?.name||e.name}function Ee({cwd:e,notify:t,onAdded:n}){let{t:r,language:i}=s(),a=f(h()),o=f(g()),c=L(t),[l,u]=(0,z.useState)(null),d=o.data?.instances??[],p=(a.data?.components??[]).filter(e=>ce(e)&&F(e.manifest,`session-panel`)),m=async(e,t)=>{if(!l){u(e.id);try{let r=await c.place(e,d,{surface:`session-panel`,scope:t});r&&n(r.instance.instanceId)}finally{u(null)}}};return a.isPending||o.isPending?(0,Y.jsx)(`p`,{role:`status`,className:`text-content-muted`,children:r(`custom-ui:customUiPage.loading`)}):a.error||o.error?(0,Y.jsxs)(`div`,{className:`flex flex-col items-start gap-2`,children:[(0,Y.jsx)(`p`,{role:`alert`,className:`text-content-secondary`,children:r(`custom-ui:widget.catalogFailed`)}),(0,Y.jsx)(N,{type:`button`,size:`sm`,variant:`secondary`,onClick:()=>{a.refetch(),o.refetch()},children:r(`custom-ui:widget.retry`)})]}):p.length?(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,"data-session-component-add-menu":!0,children:[(0,Y.jsx)(`p`,{className:`text-content-secondary`,children:r(`custom-ui:sessionPanel.addHint`)}),(0,Y.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:p.map(t=>{let a=Te(t,i),o=d.find(e=>e.componentId===t.id&&e.surface===`session-panel`),s=!!(o?.enabled&&_(o.scope,e));return(0,Y.jsxs)(`li`,{"data-session-component-candidate":t.id,className:`flex flex-col gap-1.5 rounded-sm px-1.5 py-1.5`,children:[(0,Y.jsx)(`span`,{className:`truncate text-[13px] font-medium text-content`,children:a}),s&&o?(0,Y.jsx)(N,{type:`button`,size:`sm`,variant:`ghost`,className:`self-start`,onClick:()=>n(o.instanceId),children:r(`custom-ui:studio.placed`)}):(0,Y.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[(0,Y.jsx)(N,{type:`button`,size:`sm`,variant:`secondary`,disabled:l!==null,"data-session-component-scope":`all`,onClick:()=>void m(t,{type:`all`}),children:r(`custom-ui:studio.scopeAll`)}),(0,Y.jsx)(N,{type:`button`,size:`sm`,variant:`secondary`,disabled:l!==null||!e,"data-session-component-scope":`project`,onClick:()=>void m(t,{type:`project`,cwd:e}),children:r(`custom-ui:sessionPanel.thisProject`)})]})]},t.id)})})]}):(0,Y.jsx)(`p`,{className:`text-content-secondary`,children:r(`custom-ui:sessionPanel.empty`)})}export{P as ComponentHost,ye as FloatingComponents,Ce as OverviewComponents,Ee as SessionComponentAddMenu,we as SessionPanelComponent};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mobile-runtime-recovery-tbTyacip.js","assets/rolldown-runtime-B0Z9INg1.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{h as e}from"./vendor-router-CSN_DGvx.js";import{i as t,n}from"./abort-signal-f4JsiYKX.js";import{i as r,n as i,r as a}from"./http-response-
|
|
2
|
+
import{h as e}from"./vendor-router-CSN_DGvx.js";import{i as t,n}from"./abort-signal-f4JsiYKX.js";import{i as r,n as i,r as a}from"./http-response-B2n7HFQ4.js";async function o(r){if(typeof window>`u`||!window.__PISPER_MOBILE_APP__)return;let i=n(r,s);try{await t(e(()=>import(`./mobile-runtime-recovery-tbTyacip.js`).then(e=>e.t).then(async e=>{e.installMobileRuntimeForegroundRecovery(),await e.waitForMobileRuntimeReady()}),__vite__mapDeps([0,1])),i.signal)}finally{i.dispose()}}var s=3e4;function c(e,t){return e instanceof Error&&e.message?e.message:typeof e==`string`&&e?e:t}async function l(e,t,n){let{body:a,data:l,headers:u,signal:d,timeout:f=s,...p}=t,m=l===void 0?a:l,h=new Headers(u),g;m!==void 0&&(m instanceof Blob?(g=m,h.has(`Content-Type`)||h.set(`Content-Type`,m.type||`application/octet-stream`)):(g=typeof m==`string`?m:JSON.stringify(m),h.has(`Content-Type`)||h.set(`Content-Type`,`application/json`)));let _=new AbortController,v=!1,y=()=>_.abort(d?.reason);d?.aborted?y():d?.addEventListener(`abort`,y,{once:!0});let b=f>0?setTimeout(()=>{v=!0,_.abort(new DOMException(`Request timed out`,`TimeoutError`))},f):void 0;try{if(await o(_.signal),_.signal.aborted)throw _.signal.reason;let t=await fetch(e,{...p,body:g,headers:h,signal:_.signal});if(!t.ok)throw await i(t);return await n(t)}catch(e){throw e instanceof r?e:v?new r(`请求超时 (${f}ms)`,{kind:`timeout`}):d?.aborted?new r(c(d.reason,`请求已取消`),{kind:`cancelled`}):new r(c(e,`请求失败 (network)`),{kind:`network`})}finally{b!==void 0&&clearTimeout(b),d?.removeEventListener(`abort`,y)}}function u(e,t={}){let{parse:n,...r}=t;return l(e,r,async e=>{let t=await a(e);return n?n(t):t})}function d(e,t={}){return l(e,t,e=>e.text())}function f(e,t={}){return l(e,t,e=>e.blob())}export{o as i,u as n,d as r,f as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as e,f as t,p as n,u as r}from"./i18n-
|
|
1
|
+
import{d as e,f as t,p as n,u as r}from"./i18n-B7QmqfvO.js";var i=class extends Error{status;data;kind;constructor(e,t={}){super(e),this.name=`ApiError`,this.status=t.status,this.data=t.data,this.kind=t.kind}};function a(a){return new i(n(`common:api.invalidResponse`,e(r.language)?r.language:t()),{status:a,kind:`protocol`,data:{code:`INVALID_RESPONSE`}})}function o(e){if(e)try{let t=JSON.parse(e);return typeof t==`object`&&t&&!Array.isArray(t)?{...t,error:`error`in t&&typeof t.error==`string`?t.error:void 0}:{error:typeof t==`string`?t:e,body:t}}catch{return{error:e}}}async function s(e){let t=o(await e.text());return new i(t?.error||e.statusText||`HTTP ${e.status}`,{status:e.status,data:t,kind:`http`})}async function c(e){if(e.status===204)return;let t=await e.text();if(t)try{return JSON.parse(t)}catch{throw a(e.status)}}export{i,s as n,c as r,a as t};
|