@swiftcast/clip-editor-react 0.0.4 → 0.0.5

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.
Files changed (40) hide show
  1. package/dist/index.html +1 -1
  2. package/dist/mf-manifest.json +30 -26
  3. package/dist/mf-stats.json +30 -26
  4. package/dist/remoteEntry.js +5 -5
  5. package/dist/static/css/async/805.b43be9cc.css +1 -0
  6. package/dist/static/js/{94.3bce66cb.js → 552.b04291a4.js} +5 -5
  7. package/dist/static/js/async/110.635d1a5d.js +6 -0
  8. package/dist/static/js/async/{696.9e1d8d18.js.LICENSE.txt → 110.635d1a5d.js.LICENSE.txt} +1 -1
  9. package/dist/static/js/async/{728.d8464797.js → 156.ea08b61f.js} +3 -3
  10. package/dist/static/js/async/194.c9db450b.js +1 -0
  11. package/dist/static/js/async/{888.87fe6dc2.js → 265.b614432d.js} +2 -2
  12. package/dist/static/js/async/{888.87fe6dc2.js.LICENSE.txt → 265.b614432d.js.LICENSE.txt} +1 -1
  13. package/dist/static/js/async/462.61de9839.js +1 -0
  14. package/dist/static/js/async/{977.96bac1ea.js → 522.174d0767.js} +48 -122
  15. package/dist/static/js/async/{977.96bac1ea.js.LICENSE.txt → 522.174d0767.js.LICENSE.txt} +1 -41
  16. package/dist/static/js/async/{525.e80f374e.js → 525.bbee183c.js} +1 -1
  17. package/dist/static/js/async/619.06ac249b.js +9 -0
  18. package/dist/static/js/async/{470.b7746900.js.LICENSE.txt → 619.06ac249b.js.LICENSE.txt} +1 -1
  19. package/dist/static/js/async/623.3daadabe.js +36 -0
  20. package/dist/static/js/async/{731.f9db2879.js.LICENSE.txt → 623.3daadabe.js.LICENSE.txt} +1 -1
  21. package/dist/static/js/async/762.05e5c6b0.js +1 -0
  22. package/dist/static/js/async/805.5e9d6df3.js +1 -0
  23. package/dist/static/js/async/__federation_expose_ProjectsPage.6625188a.js +2 -0
  24. package/dist/static/js/async/{__federation_expose_ProjectsPage.939a362b.js.LICENSE.txt → __federation_expose_ProjectsPage.6625188a.js.LICENSE.txt} +1 -1
  25. package/dist/static/js/async/__federation_expose_SniffingPage.e0b0bced.js +1 -0
  26. package/dist/static/js/async/{__federation_expose_WorkFlow.3f5bc0f5.js → __federation_expose_WorkFlow.8c2e7b23.js} +3 -3
  27. package/dist/static/js/index.71d965ba.js +1 -0
  28. package/package.json +4 -4
  29. package/dist/static/css/async/505.452896aa.css +0 -1
  30. package/dist/static/js/async/194.00a1ac33.js +0 -1
  31. package/dist/static/js/async/375.dbbbf5b9.js +0 -1
  32. package/dist/static/js/async/470.b7746900.js +0 -9
  33. package/dist/static/js/async/491.24ed25bd.js +0 -1
  34. package/dist/static/js/async/696.9e1d8d18.js +0 -6
  35. package/dist/static/js/async/731.f9db2879.js +0 -36
  36. package/dist/static/js/async/929.23ab9291.js +0 -1
  37. package/dist/static/js/async/__federation_expose_ProjectsPage.939a362b.js +0 -2
  38. package/dist/static/js/async/__federation_expose_SniffingPage.55fecd62.js +0 -1
  39. package/dist/static/js/index.65653c3a.js +0 -1
  40. /package/dist/static/js/async/{728.d8464797.js.LICENSE.txt → 156.ea08b61f.js.LICENSE.txt} +0 -0
@@ -72,47 +72,7 @@
72
72
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
73
73
 
74
74
  /**
75
- * @license React
76
- * use-sync-external-store-shim.development.js
77
- *
78
- * Copyright (c) Facebook, Inc. and its affiliates.
79
- *
80
- * This source code is licensed under the MIT license found in the
81
- * LICENSE file in the root directory of this source tree.
82
- */
83
-
84
- /**
85
- * @license React
86
- * use-sync-external-store-shim.production.min.js
87
- *
88
- * Copyright (c) Facebook, Inc. and its affiliates.
89
- *
90
- * This source code is licensed under the MIT license found in the
91
- * LICENSE file in the root directory of this source tree.
92
- */
93
-
94
- /**
95
- * @license React
96
- * use-sync-external-store-shim/with-selector.development.js
97
- *
98
- * Copyright (c) Facebook, Inc. and its affiliates.
99
- *
100
- * This source code is licensed under the MIT license found in the
101
- * LICENSE file in the root directory of this source tree.
102
- */
103
-
104
- /**
105
- * @license React
106
- * use-sync-external-store-shim/with-selector.production.min.js
107
- *
108
- * Copyright (c) Facebook, Inc. and its affiliates.
109
- *
110
- * This source code is licensed under the MIT license found in the
111
- * LICENSE file in the root directory of this source tree.
112
- */
113
-
114
- /**
115
- * @license lucide-react v0.501.0 - ISC
75
+ * @license lucide-react v0.503.0 - ISC
116
76
  *
117
77
  * This source code is licensed under the ISC license.
118
78
  * See the LICENSE file in the root directory of this source tree.
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkremote=self.webpackChunkremote||[]).push([["525"],{85079:function(e,s,t){t.d(s,{z:()=>i});var a=t(31549),n=t(25613),r=t(71553);let i=e=>{let{className:s}=e;return(0,a.jsx)("div",{className:(0,r.cn)("bg-[#EFF2F9] rounded-lg m-2 inline-flex items-center justify-center",s),children:(0,a.jsx)(n.Z,{className:"text-gray-400"})})}},19813:function(e,s,t){t.d(s,{Z:()=>Q});var a=t(31549),n=t(36423),r=t(99523),i=t(8491),l=t(29055),c=t(56896),d=t(30157),o=t(43346),h=t(23560),m=t(59693),x=t(40718),u=t(30929),j=t(23942),p=t(93585),f=t(53589),v=t(57282),y=t(93330);async function N(e){try{return await f.hi.get(`/studio_manager/generate-share-link/${e}`)}catch(e){console.error("该项目共享链接生成失败:",e),(0,p.S3)("共享链接生成失败")}}async function g(e){try{let s=new URL(e).pathname.split("/").pop();return await f.hi.get(`/studio_manager/share-content/${s}`)}catch(e){console.error("使用共享链接失败:",e),(0,p.S3)("共享链接使用失败")}}function _(e){let{projectId:s,disabled:t=!1}=e,[n,r]=(0,i.useState)(!1),[l,c]=(0,i.useState)(""),[f,_]=(0,i.useState)(""),[w,b]=(0,i.useState)(!1),[S,C]=(0,i.useState)(!1),[k,z]=(0,i.useState)(!1),{t:$}=(0,y.$)();(0,i.useEffect)(()=>{let e=!0;return n&&(b(!0),(async()=>{try{let t=await N(s);e&&t&&(c(t),z(!1))}catch(e){console.error("获取分享链接失败:",e)}finally{e&&b(!1)}})()),()=>{e=!1}},[n]);let Z=async()=>{try{await navigator.clipboard.writeText(l),z(!0),(0,p.x9)("分享链接已复制到剪贴板")}catch(e){console.error(`复制失败 ${e}`),(0,p.S3)("复制失败,请手动复制")}},R=async()=>{if(!f.trim())return void(0,p.L$)("请输入共享链接");try{C(!0);let e=await g(f);e.used_flag?(_(""),(0,p.x9)("共享链接使用成功,Team 已在新窗口打开"),r(!1),window.open(`/?${e}`,"_blank")):(0,p.L$)("你已经在这个 Team 中了")}catch(e){console.error(`共享链接使用失败 ${e}`),(0,p.S3)("使用共享链接失败")}finally{C(!1)}};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(d.z,{variant:"outline",size:"default",onClick:()=>{r(!0),c(""),z(!1)},disabled:t,children:[(0,a.jsx)(o.Z,{className:"mr-2 h-4 w-4"}),$("home.share.title")]}),(0,a.jsx)(u.Vq,{open:n,onOpenChange:e=>r(e),children:(0,a.jsxs)(u.cZ,{className:"sm:max-w-md",children:[(0,a.jsx)(u.fK,{children:(0,a.jsxs)(u.$N,{children:[" ",$("home.share.title")]})}),(0,a.jsxs)("div",{className:"space-y-4 mb-6",children:[(0,a.jsxs)("h3",{className:"text-sm font-medium",children:[" ",$("home.share.link")]}),(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(j.I,{value:l,readOnly:!0,placeholder:"点击生成按钮获取共享链接",className:"flex-1"}),(0,a.jsxs)(d.z,{size:"sm",onClick:Z,variant:"secondary",children:[k?(0,a.jsx)(h.Z,{className:"h-4 w-4 mr-2"}):(0,a.jsx)(m.Z,{className:"h-4 w-4 mr-2"}),$(k?"home.share.copied":"home.share.copy")]})]})]}),(0,a.jsx)(v.Z,{}),(0,a.jsxs)("div",{className:"space-y-4 mt-6",children:[(0,a.jsxs)("h3",{className:"text-sm font-medium",children:[" ",$("home.share.use_share_link_content")]}),(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(j.I,{value:f,onChange:e=>_(e.target.value),placeholder:"粘贴共享链接",className:"flex-1"}),(0,a.jsxs)(d.z,{size:"sm",onClick:R,disabled:S||!f.trim(),variant:"secondary",children:[(0,a.jsx)(x.Z,{className:"h-4 w-4 mr-2"}),S?"处理中...":"共享"]})]})]})]})})]})}var w=t(17511),b=t(46041),S=t(7132),C=t(94455),k=t(76497),z=t(79530),$=t(78271),Z=t(57077),R=t(12786),F=t(35731),O=t(57972),E=t(75953),q=t(85079);function A(e){let{isOpen:s,onClose:t,onConfirm:n,projectName:r}=e;return(0,a.jsx)(u.Vq,{open:s,onOpenChange:t,children:(0,a.jsxs)(u.cZ,{className:"sm:max-w-[425px]",children:[(0,a.jsxs)(u.fK,{children:[(0,a.jsx)(u.$N,{children:"确认克隆"}),(0,a.jsxs)(u.Be,{children:['你确定要克隆项目 "',r,'" 吗?']})]}),(0,a.jsxs)(u.cN,{children:[(0,a.jsx)(d.z,{type:"button",variant:"outline",onClick:t,children:"取消"}),(0,a.jsx)(d.z,{type:"button",variant:"default",onClick:n,children:"克隆"})]})]})})}var T=t(53701);function I(e){let{isOpen:s,onClose:t,onConfirm:n,projectName:r}=e;return(0,a.jsx)(u.Vq,{open:s,onOpenChange:t,children:(0,a.jsxs)(u.cZ,{className:"sm:max-w-[425px]",children:[(0,a.jsxs)(u.fK,{children:[(0,a.jsx)(u.$N,{children:"确认删除"}),(0,a.jsxs)(u.Be,{children:['你确定要删除项目 "',r,'" 吗?此操作不可逆。']})]}),(0,a.jsxs)(u.cN,{children:[(0,a.jsx)(d.z,{type:"button",variant:"secondary",onClick:t,children:"取消"}),(0,a.jsx)(d.z,{type:"button",variant:"destructive",onClick:n,children:"删除"})]})]})})}var D=t(66264);function K(e){let{isOpen:s,onClose:t,onRename:n,currentName:r}=e,[l,c]=(0,i.useState)(r);return(0,a.jsx)(u.Vq,{open:s,onOpenChange:t,children:(0,a.jsxs)(u.cZ,{className:"sm:max-w-[425px]",children:[(0,a.jsxs)(u.fK,{children:[(0,a.jsx)(u.$N,{children:"重命名项目"}),(0,a.jsx)(u.Be,{children:"输入新的项目名称"})]}),(0,a.jsx)("div",{className:"grid gap-4 py-4",children:(0,a.jsxs)("div",{className:"grid grid-cols-4 items-center gap-4",children:[(0,a.jsx)(D._,{htmlFor:"name",className:"text-right",children:"名称"}),(0,a.jsx)(j.I,{id:"name",value:l,onChange:e=>c(e.target.value),className:"col-span-3"})]})}),(0,a.jsxs)(u.cN,{children:[(0,a.jsx)(d.z,{type:"button",variant:"secondary",onClick:t,children:"取消"}),(0,a.jsx)(d.z,{type:"button",onClick:()=>{n(l),t()},children:"确认"})]})]})})}function V(e){let{project:s,onRename:t,onClone:n,onDelete:r}=e,[l,c]=(0,i.useState)(!1),[o,h]=(0,i.useState)(!1),[m,x]=(0,i.useState)(!1),u=(0,C.s)({from:"/"}),{t:j}=(0,y.$)();return(0,a.jsxs)("div",{children:[(0,a.jsx)(T.Zb,{className:"hover:shadow-lg hover:cursor-pointer p-4",onClick:()=>{u({to:"/editor?project="+s.short_url_id})},children:(0,a.jsx)("div",{className:"aspect-video relative overflow-hidden rounded-md",children:(0,a.jsx)(q.z,{className:"w-full h-full m-0"})})}),(0,a.jsxs)("div",{className:"flex flex-row items-center justify-between space-y-0 pb-2 pt-4",children:[(0,a.jsx)("h3",{className:"font-medium text-xl text-gray-600 truncate w-[70%]",children:s.title}),(0,a.jsxs)(w.h_,{children:[(0,a.jsx)(w.$F,{asChild:!0,children:(0,a.jsxs)(d.z,{variant:"ghost",size:"icon",className:"h-8 w-8 p-0",children:[(0,a.jsx)("span",{className:"sr-only",children:"Open menu"}),(0,a.jsx)(E.Z,{})]})}),(0,a.jsxs)(w.AW,{align:"end",children:[(0,a.jsx)(w.Xi,{onSelect:()=>c(!0),children:j("home.project.rename")}),(0,a.jsx)(w.Xi,{onSelect:()=>h(!0),children:j("home.project.clone")}),(0,a.jsx)(w.Xi,{onSelect:()=>x(!0),className:"text-red-600",children:j("home.project.delete")})]})]})]}),(0,a.jsx)("div",{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:(0,a.jsxs)("span",{className:"text-sm",children:[" ",s.createdAt]})}),(0,a.jsx)(K,{isOpen:l,onClose:()=>c(!1),onRename:e=>t(s.short_url_id,e),currentName:s.title}),(0,a.jsx)(A,{isOpen:o,onClose:()=>h(!1),onConfirm:()=>{n(s.short_url_id),h(!1)},projectName:s.title}),(0,a.jsx)(I,{isOpen:m,onClose:()=>x(!1),onConfirm:()=>{console.info(555,s),r(s.short_url_id)},projectName:s.title})]})}function X(e){let{teamId:s}=e,{t}=(0,y.$)(),n=(0,R.D)({mutationFn:async e=>await c.R.POST("/studio_manager/projects/",{body:{name:"工作流"+(0,$.Vj)(),create_at:(0,$.Ux)(),update_at:(0,$.Ux)(),team_id:e}}),onSuccess:async e=>{window.open(`/editor?project=${e.data.data.short_url_id}`,"_blank")}});return(0,a.jsx)("div",{children:(0,a.jsx)(d.z,{disabled:-1==s,onClick:()=>{n.mutate(s)},children:t("home.create_project")})})}var L=t(44153);function P(e){let{projects:s,onRename:t,onDelete:n}=e,[r,l]=(0,i.useState)(null),[c,o]=(0,i.useState)(!1),[h,m]=(0,i.useState)(!1),x=(e,s)=>{t(e,s),l(null),o(!1)},u=e=>{n(e),l(null),m(!1)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"rounded-md border",children:(0,a.jsxs)(L.iA,{children:[(0,a.jsx)(L.xD,{children:(0,a.jsxs)(L.SC,{children:[(0,a.jsx)(L.ss,{className:"w-[100px]",children:"缩略图"}),(0,a.jsx)(L.ss,{children:"项目名称"}),(0,a.jsx)(L.ss,{children:"创建时间"}),(0,a.jsx)(L.ss,{className:"w-[100px]",children:"操作"})]})}),(0,a.jsx)(L.RM,{children:s.map(e=>(0,a.jsxs)(L.SC,{children:[(0,a.jsx)(L.pj,{children:(0,a.jsx)("div",{className:"relative w-16 h-16 rounded-md overflow-hidden",children:(0,a.jsx)("img",{src:e.thumbnail||"/placeholder.svg",alt:e.title,className:"object-cover"})})}),(0,a.jsx)(L.pj,{className:"font-medium",children:e.title}),(0,a.jsx)(L.pj,{children:e.createdAt}),(0,a.jsx)(L.pj,{children:(0,a.jsxs)(w.h_,{children:[(0,a.jsx)(w.$F,{asChild:!0,children:(0,a.jsxs)(d.z,{variant:"ghost",className:"h-8 w-8 p-0",children:[(0,a.jsx)("span",{className:"sr-only",children:"Open menu"}),(0,a.jsx)(E.Z,{className:"h-4 w-4"})]})}),(0,a.jsxs)(w.AW,{align:"end",children:[(0,a.jsx)(w.Xi,{onSelect:()=>{l(e),o(!0)},children:"重命名"}),(0,a.jsx)(w.Xi,{onSelect:()=>{l(e),m(!0)},className:"text-red-600",children:"删除"})]})]})})]},e.id))})]})}),r&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(K,{isOpen:c,onClose:()=>{o(!1),l(null)},onRename:e=>x(r.short_url_id,e),currentName:r.title}),(0,a.jsx)(I,{isOpen:h,onClose:()=>{m(!1),l(null)},onConfirm:()=>u(r.id),projectName:r.title})]})]})}function Q(){let[e,s]=(0,i.useState)("grid"),t=(0,S.T)(),[o,h]=function(e,s){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};(0,b.t)();let a=(0,S.T)(),n=(0,C.s)(),[r,l]=(0,i.useState)(s);return(0,i.useEffect)(()=>{let n=a.search[e];n?t.validate?t.validate(n)&&l(n):l(n):l(s)},[a,e,s,t.validate]),[r,s=>{l(s);let r=new URLSearchParams(a.searchStr);r.set(e,s),t.replace,n({to:`?${r.toString()}`})}]}("teamId","-1"),{t:m}=(0,y.$)(),{isPending:x,error:u,data:j}=(0,Z.a)({queryKey:["teams"],queryFn:async()=>{let e=await c.R.GET("/studio_manager/teams/",{params:{query:{user_id:(0,l.rc)()}}}),s=await c.R.GET("/studio_manager/projects/",{params:{query:{user_id:(0,l.rc)()}}});return(0,$.yV)({teams:[],projects:[]},e,s)}});(0,k.Z)(async()=>{j&&"-1"===o&&!t.search.teamId&&h(j.teams.find(e=>e.name.startsWith("我的")).short_url_id)},[j]);let p=(0,R.D)({mutationFn:async e=>await c.R.DELETE("/studio_manager/projects/{project_id}/",{params:{path:{project_id:e}}}),onSuccess:e=>z.E.invalidateQueries({queryKey:["teams"]})}),f=(0,R.D)({mutationFn:async e=>await c.R.POST("/studio_manager/projects/clone/",{body:{project_id:e}}),onSuccess:async e=>{console.info(444,e),window.open(`/editor?project=${e.data.data.short_url_id}`,"_blank")}}),v=(0,R.D)({mutationKey:["update_project_name"],mutationFn:async e=>await c.R.PUT("/studio_manager/projects/{project_id}/",{params:{path:{project_id:e.project_id}},body:{name:e.name}}),onSuccess:e=>z.E.invalidateQueries({queryKey:["teams"]})}),N=(e,s)=>{v.mutate({project_id:e,name:s})},g=e=>{f.mutate(e)},E=e=>{p.mutate(e)},q=null==j?void 0:j.teams.find(e=>e.short_url_id===o),A=null==j?void 0:j.projects.map(e=>({id:e.id,short_url_id:e.short_url_id,team_id:e.team_id,title:e.name,thumbnail:"",createdAt:e.update_at})).filter(e=>"-1"!==o&&String(e.team_id)===String(null==q?void 0:q.id));return(0,a.jsx)(F.Z,{spinning:x,children:(0,a.jsx)("div",{className:"w-full h-full flex-1 flex-col space-y-8 p-8 flex ",children:(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("div",{className:"flex items-end space-x-2",children:(0,a.jsx)("h2",{className:"text-xl font-semibold",children:m("home.title")})}),(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsxs)(w.h_,{children:[(0,a.jsx)(w.$F,{asChild:!0,children:(0,a.jsx)(d.z,{size:"icon",variant:"outline",children:"grid"===e?(0,a.jsx)(n.Z,{className:"h-4 w-4"}):(0,a.jsx)(r.Z,{className:"h-4 w-4"})})}),(0,a.jsxs)(w.AW,{align:"end",children:[(0,a.jsxs)(w.Xi,{onClick:()=>s("grid"),children:[(0,a.jsx)(n.Z,{className:"mr-2 h-4 w-4"})," Grid view"]}),(0,a.jsxs)(w.Xi,{onClick:()=>s("list"),children:[(0,a.jsx)(r.Z,{className:"mr-2 h-4 w-4"})," List view"]})]})]}),(0,a.jsx)(_,{projectId:o}),(0,a.jsxs)(O.Ph,{value:o,onValueChange:e=>{z.E.invalidateQueries({queryKey:["teams"]}),h(e)},children:[(0,a.jsx)(O.i4,{className:"w-[180px]",children:(0,a.jsx)(O.ki,{placeholder:"Select a fruit"})}),(0,a.jsx)(O.Bw,{children:(0,a.jsx)(O.DI,{children:null==j?void 0:j.teams.map((e,s)=>(0,a.jsx)(O.Ql,{value:String(e.short_url_id),children:e.name},e.short_url_id))})})]}),(0,a.jsx)(X,{teamId:o})]})]}),"grid"===e?(0,a.jsx)("div",{className:"grid grid-cols-5 gap-14",children:null==A?void 0:A.map(e=>(0,a.jsx)(V,{project:e,onRename:N,onClone:g,onDelete:E},e.id))}):(0,a.jsx)(P,{projects:A,onRename:N,onDelete:E})]})})})}},23942:function(e,s,t){t.d(s,{I:()=>i});var a=t(31549),n=t(8491),r=t(71553);let i=n.forwardRef((e,s)=>{let{className:t,type:n,...i}=e;return(0,a.jsx)("input",{type:n,className:(0,r.cn)("flex h-9 w-full rounded-md border border-zinc-200 bg-transparent px-3 py-1 text-base shadow-xs transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-zinc-950 placeholder:text-zinc-500 focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-zinc-950 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:border-zinc-800 dark:file:text-zinc-50 dark:placeholder:text-zinc-400 dark:focus-visible:ring-zinc-300",t),ref:s,...i})});i.displayName="Input"},66264:function(e,s,t){t.d(s,{_:()=>d});var a=t(31549),n=t(60891),r=t(68621),i=t(8491),l=t(71553);let c=(0,r.j)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),d=i.forwardRef((e,s)=>{let{className:t,...r}=e;return(0,a.jsx)(n.f,{ref:s,className:(0,l.cn)(c(),t),...r})});d.displayName=n.f.displayName},93330:function(e,s,t){t.d(s,{$:()=>n});var a=t(91299);function n(){let{language:e,setLanguage:s,languages:t,dictionary:n}=(0,a.Qg)();return{t:(e,s)=>{let t=(Array.isArray(e)?e:e.split(".")).reduce((e,s)=>null==e?void 0:e[s],n);return t?(s&&"string"==typeof t&&Object.entries(s).forEach(e=>{let[s,a]=e;t=t.replace(RegExp(`{{${s}}}`,"g"),a)}),t):Array.isArray(e)?e[e.length-1]:e.split(".").pop()||e},language:e,setLanguage:s,languages:t}}}}]);
1
+ "use strict";(self.webpackChunkremote=self.webpackChunkremote||[]).push([["525"],{85079:function(e,s,t){t.d(s,{z:()=>i});var a=t(31549),n=t(77829),r=t(71553);let i=e=>{let{className:s}=e;return(0,a.jsx)("div",{className:(0,r.cn)("bg-[#EFF2F9] rounded-lg m-2 inline-flex items-center justify-center",s),children:(0,a.jsx)(n.Z,{className:"text-gray-400"})})}},19813:function(e,s,t){t.d(s,{Z:()=>Q});var a=t(31549),n=t(27106),r=t(62969),i=t(8491),l=t(29055),c=t(56896),d=t(30157),o=t(19583),h=t(22984),m=t(37646),x=t(46014),u=t(30929),j=t(23942),p=t(93585),f=t(53589),v=t(57282),y=t(93330);async function N(e){try{return await f.hi.get(`/studio_manager/generate-share-link/${e}`)}catch(e){console.error("该项目共享链接生成失败:",e),(0,p.S3)("共享链接生成失败")}}async function g(e){try{let s=new URL(e).pathname.split("/").pop();return await f.hi.get(`/studio_manager/share-content/${s}`)}catch(e){console.error("使用共享链接失败:",e),(0,p.S3)("共享链接使用失败")}}function _(e){let{projectId:s,disabled:t=!1}=e,[n,r]=(0,i.useState)(!1),[l,c]=(0,i.useState)(""),[f,_]=(0,i.useState)(""),[w,b]=(0,i.useState)(!1),[S,C]=(0,i.useState)(!1),[k,z]=(0,i.useState)(!1),{t:$}=(0,y.$)();(0,i.useEffect)(()=>{let e=!0;return n&&(b(!0),(async()=>{try{let t=await N(s);e&&t&&(c(t),z(!1))}catch(e){console.error("获取分享链接失败:",e)}finally{e&&b(!1)}})()),()=>{e=!1}},[n]);let Z=async()=>{try{await navigator.clipboard.writeText(l),z(!0),(0,p.x9)("分享链接已复制到剪贴板")}catch(e){console.error(`复制失败 ${e}`),(0,p.S3)("复制失败,请手动复制")}},R=async()=>{if(!f.trim())return void(0,p.L$)("请输入共享链接");try{C(!0);let e=await g(f);e.used_flag?(_(""),(0,p.x9)("共享链接使用成功,Team 已在新窗口打开"),r(!1),window.open(`/?${e}`,"_blank")):(0,p.L$)("你已经在这个 Team 中了")}catch(e){console.error(`共享链接使用失败 ${e}`),(0,p.S3)("使用共享链接失败")}finally{C(!1)}};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(d.z,{variant:"outline",size:"default",onClick:()=>{r(!0),c(""),z(!1)},disabled:t,children:[(0,a.jsx)(o.Z,{className:"mr-2 h-4 w-4"}),$("home.share.title")]}),(0,a.jsx)(u.Vq,{open:n,onOpenChange:e=>r(e),children:(0,a.jsxs)(u.cZ,{className:"sm:max-w-md",children:[(0,a.jsx)(u.fK,{children:(0,a.jsxs)(u.$N,{children:[" ",$("home.share.title")]})}),(0,a.jsxs)("div",{className:"space-y-4 mb-6",children:[(0,a.jsxs)("h3",{className:"text-sm font-medium",children:[" ",$("home.share.link")]}),(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(j.I,{value:l,readOnly:!0,placeholder:"点击生成按钮获取共享链接",className:"flex-1"}),(0,a.jsxs)(d.z,{size:"sm",onClick:Z,variant:"secondary",children:[k?(0,a.jsx)(h.Z,{className:"h-4 w-4 mr-2"}):(0,a.jsx)(m.Z,{className:"h-4 w-4 mr-2"}),$(k?"home.share.copied":"home.share.copy")]})]})]}),(0,a.jsx)(v.Z,{}),(0,a.jsxs)("div",{className:"space-y-4 mt-6",children:[(0,a.jsxs)("h3",{className:"text-sm font-medium",children:[" ",$("home.share.use_share_link_content")]}),(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(j.I,{value:f,onChange:e=>_(e.target.value),placeholder:"粘贴共享链接",className:"flex-1"}),(0,a.jsxs)(d.z,{size:"sm",onClick:R,disabled:S||!f.trim(),variant:"secondary",children:[(0,a.jsx)(x.Z,{className:"h-4 w-4 mr-2"}),S?"处理中...":"共享"]})]})]})]})})]})}var w=t(17511),b=t(46041),S=t(7132),C=t(94455),k=t(76497),z=t(79530),$=t(78271),Z=t(57077),R=t(12786),F=t(39072),O=t(57972),E=t(65635),q=t(85079);function A(e){let{isOpen:s,onClose:t,onConfirm:n,projectName:r}=e;return(0,a.jsx)(u.Vq,{open:s,onOpenChange:t,children:(0,a.jsxs)(u.cZ,{className:"sm:max-w-[425px]",children:[(0,a.jsxs)(u.fK,{children:[(0,a.jsx)(u.$N,{children:"确认克隆"}),(0,a.jsxs)(u.Be,{children:['你确定要克隆项目 "',r,'" 吗?']})]}),(0,a.jsxs)(u.cN,{children:[(0,a.jsx)(d.z,{type:"button",variant:"outline",onClick:t,children:"取消"}),(0,a.jsx)(d.z,{type:"button",variant:"default",onClick:n,children:"克隆"})]})]})})}var T=t(53701);function I(e){let{isOpen:s,onClose:t,onConfirm:n,projectName:r}=e;return(0,a.jsx)(u.Vq,{open:s,onOpenChange:t,children:(0,a.jsxs)(u.cZ,{className:"sm:max-w-[425px]",children:[(0,a.jsxs)(u.fK,{children:[(0,a.jsx)(u.$N,{children:"确认删除"}),(0,a.jsxs)(u.Be,{children:['你确定要删除项目 "',r,'" 吗?此操作不可逆。']})]}),(0,a.jsxs)(u.cN,{children:[(0,a.jsx)(d.z,{type:"button",variant:"secondary",onClick:t,children:"取消"}),(0,a.jsx)(d.z,{type:"button",variant:"destructive",onClick:n,children:"删除"})]})]})})}var D=t(66264);function K(e){let{isOpen:s,onClose:t,onRename:n,currentName:r}=e,[l,c]=(0,i.useState)(r);return(0,a.jsx)(u.Vq,{open:s,onOpenChange:t,children:(0,a.jsxs)(u.cZ,{className:"sm:max-w-[425px]",children:[(0,a.jsxs)(u.fK,{children:[(0,a.jsx)(u.$N,{children:"重命名项目"}),(0,a.jsx)(u.Be,{children:"输入新的项目名称"})]}),(0,a.jsx)("div",{className:"grid gap-4 py-4",children:(0,a.jsxs)("div",{className:"grid grid-cols-4 items-center gap-4",children:[(0,a.jsx)(D._,{htmlFor:"name",className:"text-right",children:"名称"}),(0,a.jsx)(j.I,{id:"name",value:l,onChange:e=>c(e.target.value),className:"col-span-3"})]})}),(0,a.jsxs)(u.cN,{children:[(0,a.jsx)(d.z,{type:"button",variant:"secondary",onClick:t,children:"取消"}),(0,a.jsx)(d.z,{type:"button",onClick:()=>{n(l),t()},children:"确认"})]})]})})}function V(e){let{project:s,onRename:t,onClone:n,onDelete:r}=e,[l,c]=(0,i.useState)(!1),[o,h]=(0,i.useState)(!1),[m,x]=(0,i.useState)(!1),u=(0,C.s)({from:"/"}),{t:j}=(0,y.$)();return(0,a.jsxs)("div",{children:[(0,a.jsx)(T.Zb,{className:"hover:shadow-lg hover:cursor-pointer p-4",onClick:()=>{u({to:"/editor?project="+s.short_url_id})},children:(0,a.jsx)("div",{className:"aspect-video relative overflow-hidden rounded-md",children:(0,a.jsx)(q.z,{className:"w-full h-full m-0"})})}),(0,a.jsxs)("div",{className:"flex flex-row items-center justify-between space-y-0 pb-2 pt-4",children:[(0,a.jsx)("h3",{className:"font-medium text-xl text-gray-600 truncate w-[70%]",children:s.title}),(0,a.jsxs)(w.h_,{children:[(0,a.jsx)(w.$F,{asChild:!0,children:(0,a.jsxs)(d.z,{variant:"ghost",size:"icon",className:"h-8 w-8 p-0",children:[(0,a.jsx)("span",{className:"sr-only",children:"Open menu"}),(0,a.jsx)(E.Z,{})]})}),(0,a.jsxs)(w.AW,{align:"end",children:[(0,a.jsx)(w.Xi,{onSelect:()=>c(!0),children:j("home.project.rename")}),(0,a.jsx)(w.Xi,{onSelect:()=>h(!0),children:j("home.project.clone")}),(0,a.jsx)(w.Xi,{onSelect:()=>x(!0),className:"text-red-600",children:j("home.project.delete")})]})]})]}),(0,a.jsx)("div",{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:(0,a.jsxs)("span",{className:"text-sm",children:[" ",s.createdAt]})}),(0,a.jsx)(K,{isOpen:l,onClose:()=>c(!1),onRename:e=>t(s.short_url_id,e),currentName:s.title}),(0,a.jsx)(A,{isOpen:o,onClose:()=>h(!1),onConfirm:()=>{n(s.short_url_id),h(!1)},projectName:s.title}),(0,a.jsx)(I,{isOpen:m,onClose:()=>x(!1),onConfirm:()=>{console.info(555,s),r(s.short_url_id)},projectName:s.title})]})}function X(e){let{teamId:s}=e,{t}=(0,y.$)(),n=(0,R.D)({mutationFn:async e=>await c.R.POST("/studio_manager/projects/",{body:{name:"工作流"+(0,$.Vj)(),create_at:(0,$.Ux)(),update_at:(0,$.Ux)(),team_id:e}}),onSuccess:async e=>{window.open(`/editor?project=${e.data.data.short_url_id}`,"_blank")}});return(0,a.jsx)("div",{children:(0,a.jsx)(d.z,{disabled:-1==s,onClick:()=>{n.mutate(s)},children:t("home.create_project")})})}var L=t(44153);function P(e){let{projects:s,onRename:t,onDelete:n}=e,[r,l]=(0,i.useState)(null),[c,o]=(0,i.useState)(!1),[h,m]=(0,i.useState)(!1),x=(e,s)=>{t(e,s),l(null),o(!1)},u=e=>{n(e),l(null),m(!1)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"rounded-md border",children:(0,a.jsxs)(L.iA,{children:[(0,a.jsx)(L.xD,{children:(0,a.jsxs)(L.SC,{children:[(0,a.jsx)(L.ss,{className:"w-[100px]",children:"缩略图"}),(0,a.jsx)(L.ss,{children:"项目名称"}),(0,a.jsx)(L.ss,{children:"创建时间"}),(0,a.jsx)(L.ss,{className:"w-[100px]",children:"操作"})]})}),(0,a.jsx)(L.RM,{children:s.map(e=>(0,a.jsxs)(L.SC,{children:[(0,a.jsx)(L.pj,{children:(0,a.jsx)("div",{className:"relative w-16 h-16 rounded-md overflow-hidden",children:(0,a.jsx)("img",{src:e.thumbnail||"/placeholder.svg",alt:e.title,className:"object-cover"})})}),(0,a.jsx)(L.pj,{className:"font-medium",children:e.title}),(0,a.jsx)(L.pj,{children:e.createdAt}),(0,a.jsx)(L.pj,{children:(0,a.jsxs)(w.h_,{children:[(0,a.jsx)(w.$F,{asChild:!0,children:(0,a.jsxs)(d.z,{variant:"ghost",className:"h-8 w-8 p-0",children:[(0,a.jsx)("span",{className:"sr-only",children:"Open menu"}),(0,a.jsx)(E.Z,{className:"h-4 w-4"})]})}),(0,a.jsxs)(w.AW,{align:"end",children:[(0,a.jsx)(w.Xi,{onSelect:()=>{l(e),o(!0)},children:"重命名"}),(0,a.jsx)(w.Xi,{onSelect:()=>{l(e),m(!0)},className:"text-red-600",children:"删除"})]})]})})]},e.id))})]})}),r&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(K,{isOpen:c,onClose:()=>{o(!1),l(null)},onRename:e=>x(r.short_url_id,e),currentName:r.title}),(0,a.jsx)(I,{isOpen:h,onClose:()=>{m(!1),l(null)},onConfirm:()=>u(r.id),projectName:r.title})]})]})}function Q(){let[e,s]=(0,i.useState)("grid"),t=(0,S.T)(),[o,h]=function(e,s){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};(0,b.t)();let a=(0,S.T)(),n=(0,C.s)(),[r,l]=(0,i.useState)(s);return(0,i.useEffect)(()=>{let n=a.search[e];n?t.validate?t.validate(n)&&l(n):l(n):l(s)},[a,e,s,t.validate]),[r,s=>{l(s);let r=new URLSearchParams(a.searchStr);r.set(e,s),t.replace,n({to:`?${r.toString()}`})}]}("teamId","-1"),{t:m}=(0,y.$)(),{isPending:x,error:u,data:j}=(0,Z.a)({queryKey:["teams"],queryFn:async()=>{let e=await c.R.GET("/studio_manager/teams/",{params:{query:{user_id:(0,l.rc)()}}}),s=await c.R.GET("/studio_manager/projects/",{params:{query:{user_id:(0,l.rc)()}}});return(0,$.yV)({teams:[],projects:[]},e,s)}});(0,k.Z)(async()=>{j&&"-1"===o&&!t.search.teamId&&h(j.teams.find(e=>e.name.startsWith("我的")).short_url_id)},[j]);let p=(0,R.D)({mutationFn:async e=>await c.R.DELETE("/studio_manager/projects/{project_id}/",{params:{path:{project_id:e}}}),onSuccess:e=>z.E.invalidateQueries({queryKey:["teams"]})}),f=(0,R.D)({mutationFn:async e=>await c.R.POST("/studio_manager/projects/clone/",{body:{project_id:e}}),onSuccess:async e=>{console.info(444,e),window.open(`/editor?project=${e.data.data.short_url_id}`,"_blank")}}),v=(0,R.D)({mutationKey:["update_project_name"],mutationFn:async e=>await c.R.PUT("/studio_manager/projects/{project_id}/",{params:{path:{project_id:e.project_id}},body:{name:e.name}}),onSuccess:e=>z.E.invalidateQueries({queryKey:["teams"]})}),N=(e,s)=>{v.mutate({project_id:e,name:s})},g=e=>{f.mutate(e)},E=e=>{p.mutate(e)},q=null==j?void 0:j.teams.find(e=>e.short_url_id===o),A=null==j?void 0:j.projects.map(e=>({id:e.id,short_url_id:e.short_url_id,team_id:e.team_id,title:e.name,thumbnail:"",createdAt:e.update_at})).filter(e=>"-1"!==o&&String(e.team_id)===String(null==q?void 0:q.id));return(0,a.jsx)(F.Z,{spinning:x,children:(0,a.jsx)("div",{className:"w-full h-full flex-1 flex-col space-y-8 p-8 flex ",children:(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("div",{className:"flex items-end space-x-2",children:(0,a.jsx)("h2",{className:"text-xl font-semibold",children:m("home.title")})}),(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsxs)(w.h_,{children:[(0,a.jsx)(w.$F,{asChild:!0,children:(0,a.jsx)(d.z,{size:"icon",variant:"outline",children:"grid"===e?(0,a.jsx)(n.Z,{className:"h-4 w-4"}):(0,a.jsx)(r.Z,{className:"h-4 w-4"})})}),(0,a.jsxs)(w.AW,{align:"end",children:[(0,a.jsxs)(w.Xi,{onClick:()=>s("grid"),children:[(0,a.jsx)(n.Z,{className:"mr-2 h-4 w-4"})," Grid view"]}),(0,a.jsxs)(w.Xi,{onClick:()=>s("list"),children:[(0,a.jsx)(r.Z,{className:"mr-2 h-4 w-4"})," List view"]})]})]}),(0,a.jsx)(_,{projectId:o}),(0,a.jsxs)(O.Ph,{value:o,onValueChange:e=>{z.E.invalidateQueries({queryKey:["teams"]}),h(e)},children:[(0,a.jsx)(O.i4,{className:"w-[180px]",children:(0,a.jsx)(O.ki,{placeholder:"Select a fruit"})}),(0,a.jsx)(O.Bw,{children:(0,a.jsx)(O.DI,{children:null==j?void 0:j.teams.map((e,s)=>(0,a.jsx)(O.Ql,{value:String(e.short_url_id),children:e.name},e.short_url_id))})})]}),(0,a.jsx)(X,{teamId:o})]})]}),"grid"===e?(0,a.jsx)("div",{className:"grid grid-cols-5 gap-14",children:null==A?void 0:A.map(e=>(0,a.jsx)(V,{project:e,onRename:N,onClone:g,onDelete:E},e.id))}):(0,a.jsx)(P,{projects:A,onRename:N,onDelete:E})]})})})}},23942:function(e,s,t){t.d(s,{I:()=>i});var a=t(31549),n=t(8491),r=t(71553);let i=n.forwardRef((e,s)=>{let{className:t,type:n,...i}=e;return(0,a.jsx)("input",{type:n,className:(0,r.cn)("flex h-9 w-full rounded-md border border-zinc-200 bg-transparent px-3 py-1 text-base shadow-xs transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-zinc-950 placeholder:text-zinc-500 focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-zinc-950 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:border-zinc-800 dark:file:text-zinc-50 dark:placeholder:text-zinc-400 dark:focus-visible:ring-zinc-300",t),ref:s,...i})});i.displayName="Input"},66264:function(e,s,t){t.d(s,{_:()=>d});var a=t(31549),n=t(60891),r=t(68621),i=t(8491),l=t(71553);let c=(0,r.j)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),d=i.forwardRef((e,s)=>{let{className:t,...r}=e;return(0,a.jsx)(n.f,{ref:s,className:(0,l.cn)(c(),t),...r})});d.displayName=n.f.displayName},93330:function(e,s,t){t.d(s,{$:()=>n});var a=t(91299);function n(){let{language:e,setLanguage:s,languages:t,dictionary:n}=(0,a.Qg)();return{t:(e,s)=>{let t=(Array.isArray(e)?e:e.split(".")).reduce((e,s)=>null==e?void 0:e[s],n);return t?(s&&"string"==typeof t&&Object.entries(s).forEach(e=>{let[s,a]=e;t=t.replace(RegExp(`{{${s}}}`,"g"),a)}),t):Array.isArray(e)?e[e.length-1]:e.split(".").pop()||e},language:e,setLanguage:s,languages:t}}}}]);