coding-tool-x 3.8.9 → 3.8.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -388
- package/dist/web/assets/AgentsDrawer-Bam7kBjG.js +1 -0
- package/dist/web/assets/Analytics-D5dUWXEa.js +1 -0
- package/dist/web/assets/AssetPathField-CLqalYv-.js +1 -0
- package/dist/web/assets/{ChatHistoryDrawer-BTmQ1aQr.js → ChatHistoryDrawer-C1At65O3.js} +1 -1
- package/dist/web/assets/{CollapseItem-CwqJk3bE.js → CollapseItem-CVWojShK.js} +1 -1
- package/dist/web/assets/CommandsDrawer-BEoypGBf.js +1 -0
- package/dist/web/assets/ConfigExportDrawer-DBvFDDWK.js +1 -0
- package/dist/web/assets/{ConfigTemplates-gyERg9iC.js → ConfigTemplates-BpaWG-iC.js} +1 -1
- package/dist/web/assets/{ConfigTemplatesDrawer-B17RqFi4.js → ConfigTemplatesDrawer-C2lvyKMf.js} +1 -1
- package/dist/web/assets/ConfigTemplatesPanel-CorOY7kY.js +1 -0
- package/dist/web/assets/{Divider-DsdbkHrG.js → Divider-BLLhMTSt.js} +1 -1
- package/dist/web/assets/FavoritesDrawer-uW88N6te.js +1 -0
- package/dist/web/assets/GatewayConvertDrawer-i5Wt9Dd9.js +1 -0
- package/dist/web/assets/Home-BIxWvm29.js +1 -0
- package/dist/web/assets/{MarkdownEditor-9TTwTS-U.js → MarkdownEditor-Ul0bSGj-.js} +1 -1
- package/dist/web/assets/McpDrawer-Cc2xq77I.js +1 -0
- package/dist/web/assets/McpFormDrawer-DLHX_nrI.js +1 -0
- package/dist/web/assets/{PluginManager-BuRcWuBj.js → PluginManager-BGQ0xF2F.js} +1 -1
- package/dist/web/assets/{PluginsDrawer-_zZENaQn.js → PluginsDrawer-STwHEqiF.js} +1 -1
- package/dist/web/assets/PluginsPanel-1zuNP7da.js +1 -0
- package/dist/web/assets/ProjectList-_pe2nk9c.js +1 -0
- package/dist/web/assets/PromptsDrawer-CJN1xZk7.js +1 -0
- package/dist/web/assets/RecentSessionsDrawer-DX1HI8Nm.js +1 -0
- package/dist/web/assets/SessionCard-Op6PHvi0.js +1 -0
- package/dist/web/assets/SessionList-Da_TAEYr.js +1 -0
- package/dist/web/assets/SettingsDrawer-DKLd4Sjy.js +1 -0
- package/dist/web/assets/{SkillManager-S698Hns8.js → SkillManager-PcAa5EbF.js} +1 -1
- package/dist/web/assets/{SkillsDrawer-Ms4lPCow.js → SkillsDrawer-DPdU4p6C.js} +1 -1
- package/dist/web/assets/SkillsPanel-B9qzRqjd.js +1 -0
- package/dist/web/assets/Upload-e1M9Yp5z.js +1 -0
- package/dist/web/assets/{WorkspaceDrawer-L7HJRc6u.js → WorkspaceDrawer-oS6mB1VZ.js} +1 -1
- package/dist/web/assets/{WorkspaceManager-DsoNg2z8.js → WorkspaceManager-6VvRWe3r.js} +1 -1
- package/dist/web/assets/WorkspacePanel-CYq0Z8iY.js +1 -0
- package/dist/web/assets/client-BgcNg4Bt.js +1 -0
- package/dist/web/assets/{headers-B5JWGn3v.js → headers-DbowkmZJ.js} +1 -1
- package/dist/web/assets/{icons-DmFe4b5j.js → icons-B-AzZoeE.js} +1 -1
- package/dist/web/assets/index-BlUXw84U.js +2 -0
- package/dist/web/assets/index-Bn8BUnwP.css +1 -0
- package/dist/web/assets/{light-0eavxNvt.js → light-C2X7hegj.js} +1 -1
- package/dist/web/assets/platforms-DrzAtnjY.js +1 -0
- package/dist/web/assets/platforms-mqqe_82d.js +1 -0
- package/dist/web/assets/project-config-BVt5s-pH.js +1 -0
- package/dist/web/assets/sessions-53-Fr68H.js +1 -0
- package/dist/web/assets/{sessions-D4yQtfKb.js → sessions-CaWUaysM.js} +1 -1
- package/dist/web/assets/use-message-DBsCm7FJ.js +1 -0
- package/dist/web/assets/{useResponsiveDrawer-V_onl9NV.js → useResponsiveDrawer-ChHZrTfl.js} +1 -1
- package/dist/web/assets/{workspaces-mjyPVGS8.js → workspaces-DQuZd4qw.js} +1 -1
- package/dist/web/index.html +8 -8
- package/package.json +4 -2
- package/src/commands/export-config.js +17 -211
- package/src/config/model-metadata.json +180 -16
- package/src/platforms/channel-auth-service.js +1 -1
- package/src/platforms/commands-service.js +28 -0
- package/src/platforms/driver-registry.js +1 -0
- package/src/platforms/drivers/claude/channels-implementation.js +79 -90
- package/src/platforms/drivers/claude/native-config-implementation.js +3 -4
- package/src/platforms/drivers/codex/channels-implementation.js +34 -49
- package/src/platforms/drivers/codex/native-config-implementation.js +3 -51
- package/src/platforms/drivers/dsh/api-operations.js +1 -1
- package/src/platforms/drivers/dsh/channels-implementation.js +28 -8
- package/src/platforms/drivers/dsh/channels.js +0 -18
- package/src/platforms/drivers/dsh/common.js +7 -0
- package/src/platforms/drivers/dsh/native-config.js +7 -2
- package/src/platforms/drivers/gemini/channels-implementation.js +47 -55
- package/src/platforms/drivers/gemini/native-config-implementation.js +8 -20
- package/src/platforms/drivers/generic-native-config.js +20 -0
- package/src/platforms/drivers/native-config-snapshot.js +30 -4
- package/src/platforms/drivers/omp/channels-implementation.js +51 -17
- package/src/platforms/drivers/omp/native-config-implementation.js +10 -17
- package/src/platforms/drivers/opencode/channels-implementation.js +6 -0
- package/src/platforms/drivers/opencode/native-config-implementation.js +3 -67
- package/src/platforms/manifest-schema.js +35 -2
- package/src/platforms/manifests/claude.json +0 -8
- package/src/platforms/manifests/codex.json +0 -8
- package/src/platforms/manifests/dsh.json +6 -9
- package/src/platforms/manifests/gemini.json +0 -8
- package/src/platforms/manifests/omp.json +0 -8
- package/src/platforms/manifests/opencode.json +0 -8
- package/src/platforms/native-oauth-adapters.js +33 -33
- package/src/server/index.js +2 -0
- package/src/server/services/bounded-content.js +60 -0
- package/src/server/services/channel-balance.js +10 -4
- package/src/server/services/config-export-service.js +2 -2
- package/src/server/services/config-templates-service.js +5 -1
- package/src/server/services/plugins-service.js +162 -85
- package/src/server/services/session-history-maintenance-worker.js +71 -0
- package/src/server/services/session-history-maintenance.js +166 -0
- package/src/server/services/skill-service.js +23 -3
- package/src/server/services/speed-test.js +0 -72
- package/src/shared/channel-driver.js +16 -0
- package/src/shared/driver-factories/api.js +1 -0
- package/src/utils/native-config-patcher.js +474 -0
- package/dist/web/assets/AgentsDrawer-Cj5CJ4d9.js +0 -1
- package/dist/web/assets/Analytics-1doS-8uC.js +0 -1
- package/dist/web/assets/AssetPathField-C9TOPl7o.js +0 -1
- package/dist/web/assets/CommandsDrawer-CaZWDI_G.js +0 -1
- package/dist/web/assets/ConfigExportDrawer-C3vSZEsS.js +0 -1
- package/dist/web/assets/ConfigTemplatesPanel-DKIC_FqG.js +0 -1
- package/dist/web/assets/FavoritesDrawer-DaziQmBp.js +0 -1
- package/dist/web/assets/GatewayConvertDrawer-OMgWUUSc.js +0 -1
- package/dist/web/assets/Home-DOSUTfrE.js +0 -1
- package/dist/web/assets/McpDrawer-I8rl8lGH.js +0 -1
- package/dist/web/assets/McpFormDrawer-DEP3C7ut.js +0 -1
- package/dist/web/assets/PluginsPanel-Bs5qZ-TK.js +0 -1
- package/dist/web/assets/ProjectList-BSxuL2td.js +0 -1
- package/dist/web/assets/PromptsDrawer-CoZ-ZtsY.js +0 -1
- package/dist/web/assets/RecentSessionsDrawer-B_17aJBG.js +0 -1
- package/dist/web/assets/SessionCard-BL_x0d3t.js +0 -1
- package/dist/web/assets/SessionList-DhRYZ6vl.js +0 -1
- package/dist/web/assets/SettingsDrawer-fYb0DU7X.js +0 -1
- package/dist/web/assets/SkillsPanel-rqnqAOGL.js +0 -1
- package/dist/web/assets/SpeedTestDrawer-Bbn38SfV.js +0 -1
- package/dist/web/assets/SpeedTestDrawer-Dc0WToJ_.css +0 -1
- package/dist/web/assets/Upload-CdyVHxCI.js +0 -1
- package/dist/web/assets/WorkspacePanel-Be8PVZah.js +0 -1
- package/dist/web/assets/client-UDwXBP9i.js +0 -1
- package/dist/web/assets/index-3Lp6z8TQ.css +0 -1
- package/dist/web/assets/index-BKlAWTH-.js +0 -2
- package/dist/web/assets/platforms-BmzzwnSw.js +0 -1
- package/dist/web/assets/platforms-DWXgmy2w.js +0 -1
- package/dist/web/assets/project-config-B2baPzYL.js +0 -1
- package/dist/web/assets/sessions-CC0j-KH_.js +0 -1
- package/dist/web/assets/use-message-DqCwefG6.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as e,I as t,It as n,Jt as r,N as o,Nt as i,Qt as a,Rt as s,Tt as l,Ut as d,Wt as c,Zt as u,gn as h,gt as m,hn as v,ht as b,jt as f,kt as p,qt as g,vn as w,w as y,y as z,yn as $,zt as x}from"./_plugin-vue_export-helper-BeLZJZij.js";import{A as S,F as k,G as C,H as E,M as B,N as F,Q as M,V as R,Z as H,b as O,dt as A,f as T,l as W,st as D,tt as N,z as P}from"./vue-vendor-BqZbbXHA.js";import{n as U,t as j}from"./use-lock-html-scroll-DXIqmUW4.js";import{J as L}from"./index-BKlAWTH-.js";var I=S({name:"NDrawerContent",inheritAttrs:!1,props:{blockScroll:Boolean,show:{type:Boolean,default:void 0},displayDirective:{type:String,required:!0},placement:{type:String,required:!0},contentClass:String,contentStyle:[Object,String],nativeScrollbar:{type:Boolean,required:!0},scrollbarProps:Object,trapFocus:{type:Boolean,default:!0},autoFocus:{type:Boolean,default:!0},showMask:{type:[Boolean,String],required:!0},maxWidth:Number,maxHeight:Number,minWidth:Number,minHeight:Number,resizable:Boolean,onClickoutside:Function,onAfterLeave:Function,onAfterEnter:Function,onEsc:Function},setup(e){const n=D(!!e.show),o=D(null),i=F(r);let a=0,s="",l=null;const u=D(!1),h=D(!1),v=O(()=>"top"===e.placement||"bottom"===e.placement),{mergedClsPrefixRef:b,mergedRtlRef:f}=m(e),p=t("Drawer",f,b),w=S,{doUpdateHeight:y,doUpdateWidth:z}=i;function $(t){var n,r;if(h.value)if(v.value){let r=(null===(n=o.value)||void 0===n?void 0:n.offsetHeight)||0;const i=a-t.clientY;r+="bottom"===e.placement?i:-i,r=(t=>{const{maxHeight:n}=e;if(n&&t>n)return n;const{minHeight:r}=e;return r&&t<r?r:t})(r),y(r),a=t.clientY}else{let n=(null===(r=o.value)||void 0===r?void 0:r.offsetWidth)||0;const i=a-t.clientX;n+="right"===e.placement?i:-i,n=(t=>{const{maxWidth:n}=e;if(n&&t>n)return n;const{minWidth:r}=e;return r&&t<r?r:t})(n),z(n),a=t.clientX}}function S(){h.value&&(a=0,h.value=!1,document.body.style.cursor=s,document.body.removeEventListener("mousemove",$),document.body.removeEventListener("mouseup",S),document.body.removeEventListener("mouseleave",w))}M(()=>{e.show&&(n.value=!0)}),H(()=>e.show,e=>{e||S()}),P(()=>{S()});const k=O(()=>{const{show:t}=e,n=[[T,t]];return e.showMask||n.push([x,e.onClickoutside,void 0,{capture:!0}]),n});return j(O(()=>e.blockScroll&&n.value)),C(g,o),C(d,null),C(c,null),{bodyRef:o,rtlEnabled:p,mergedClsPrefix:i.mergedClsPrefixRef,isMounted:i.isMountedRef,mergedTheme:i.mergedThemeRef,displayed:n,transitionName:O(()=>({right:"slide-in-from-right-transition",left:"slide-in-from-left-transition",top:"slide-in-from-top-transition",bottom:"slide-in-from-bottom-transition"}[e.placement])),handleAfterLeave:function(){var t;n.value=!1,null===(t=e.onAfterLeave)||void 0===t||t.call(e)},bodyDirectives:k,handleMousedownResizeTrigger:e=>{h.value=!0,a=v.value?e.clientY:e.clientX,s=document.body.style.cursor,document.body.style.cursor=v.value?"ns-resize":"ew-resize",document.body.addEventListener("mousemove",$),document.body.addEventListener("mouseleave",w),document.body.addEventListener("mouseup",S)},handleMouseenterResizeTrigger:()=>{null!==l&&(window.clearTimeout(l),l=null),h.value?u.value=!0:l=window.setTimeout(()=>{u.value=!0},300)},handleMouseleaveResizeTrigger:()=>{null!==l&&(window.clearTimeout(l),l=null),u.value=!1},isDragging:h,isHoverOnResizeTrigger:u}},render(){const{$slots:e,mergedClsPrefix:t}=this;return"show"===this.displayDirective||this.displayed||this.show?N(B("div",{role:"none"},B(i,{disabled:!this.showMask||!this.trapFocus,active:this.show,autoFocus:this.autoFocus,onEsc:this.onEsc},{default:()=>B(W,{name:this.transitionName,appear:this.isMounted,onAfterEnter:this.onAfterEnter,onAfterLeave:this.handleAfterLeave},{default:()=>N(B("div",k(this.$attrs,{role:"dialog",ref:"bodyRef","aria-modal":"true",class:[`${t}-drawer`,this.rtlEnabled&&`${t}-drawer--rtl`,`${t}-drawer--${this.placement}-placement`,this.isDragging&&`${t}-drawer--unselectable`,this.nativeScrollbar&&`${t}-drawer--native-scrollbar`]}),[this.resizable?B("div",{class:[`${t}-drawer__resize-trigger`,(this.isDragging||this.isHoverOnResizeTrigger)&&`${t}-drawer__resize-trigger--hover`],onMouseenter:this.handleMouseenterResizeTrigger,onMouseleave:this.handleMouseleaveResizeTrigger,onMousedown:this.handleMousedownResizeTrigger}):null,this.nativeScrollbar?B("div",{class:[`${t}-drawer-content-wrapper`,this.contentClass],style:this.contentStyle,role:"none"},e):B(z,Object.assign({},this.scrollbarProps,{contentStyle:this.contentStyle,contentClass:[`${t}-drawer-content-wrapper`,this.contentClass],theme:this.mergedTheme.peers.Scrollbar,themeOverrides:this.mergedTheme.peerOverrides.Scrollbar}),e)]),this.bodyDirectives)})})),[[T,"if"===this.displayDirective||this.displayed||this.show]]):null}}),{cubicBezierEaseIn:X,cubicBezierEaseOut:Y}=e;var{cubicBezierEaseIn:_,cubicBezierEaseOut:q}=e;var{cubicBezierEaseIn:V,cubicBezierEaseOut:J}=e;var{cubicBezierEaseIn:Q,cubicBezierEaseOut:Z}=e;var G=v([h("drawer","\n word-break: break-word;\n line-height: var(--n-line-height);\n position: absolute;\n pointer-events: all;\n box-shadow: var(--n-box-shadow);\n transition:\n background-color .3s var(--n-bezier),\n color .3s var(--n-bezier);\n background-color: var(--n-color);\n color: var(--n-text-color);\n box-sizing: border-box;\n ",[function({duration:e="0.3s",leaveDuration:t="0.2s",name:n="slide-in-from-right"}={}){return[v(`&.${n}-transition-leave-active`,{transition:`transform ${t} ${V}`}),v(`&.${n}-transition-enter-active`,{transition:`transform ${e} ${J}`}),v(`&.${n}-transition-enter-to`,{transform:"translateX(0)"}),v(`&.${n}-transition-enter-from`,{transform:"translateX(100%)"}),v(`&.${n}-transition-leave-from`,{transform:"translateX(0)"}),v(`&.${n}-transition-leave-to`,{transform:"translateX(100%)"})]}(),function({duration:e="0.3s",leaveDuration:t="0.2s",name:n="slide-in-from-left"}={}){return[v(`&.${n}-transition-leave-active`,{transition:`transform ${t} ${_}`}),v(`&.${n}-transition-enter-active`,{transition:`transform ${e} ${q}`}),v(`&.${n}-transition-enter-to`,{transform:"translateX(0)"}),v(`&.${n}-transition-enter-from`,{transform:"translateX(-100%)"}),v(`&.${n}-transition-leave-from`,{transform:"translateX(0)"}),v(`&.${n}-transition-leave-to`,{transform:"translateX(-100%)"})]}(),function({duration:e="0.3s",leaveDuration:t="0.2s",name:n="slide-in-from-top"}={}){return[v(`&.${n}-transition-leave-active`,{transition:`transform ${t} ${Q}`}),v(`&.${n}-transition-enter-active`,{transition:`transform ${e} ${Z}`}),v(`&.${n}-transition-enter-to`,{transform:"translateY(0)"}),v(`&.${n}-transition-enter-from`,{transform:"translateY(-100%)"}),v(`&.${n}-transition-leave-from`,{transform:"translateY(0)"}),v(`&.${n}-transition-leave-to`,{transform:"translateY(-100%)"})]}(),function({duration:e="0.3s",leaveDuration:t="0.2s",name:n="slide-in-from-bottom"}={}){return[v(`&.${n}-transition-leave-active`,{transition:`transform ${t} ${X}`}),v(`&.${n}-transition-enter-active`,{transition:`transform ${e} ${Y}`}),v(`&.${n}-transition-enter-to`,{transform:"translateY(0)"}),v(`&.${n}-transition-enter-from`,{transform:"translateY(100%)"}),v(`&.${n}-transition-leave-from`,{transform:"translateY(0)"}),v(`&.${n}-transition-leave-to`,{transform:"translateY(100%)"})]}(),$("unselectable","\n user-select: none; \n -webkit-user-select: none;\n "),$("native-scrollbar",[h("drawer-content-wrapper","\n overflow: auto;\n height: 100%;\n ")]),w("resize-trigger","\n position: absolute;\n background-color: #0000;\n transition: background-color .3s var(--n-bezier);\n ",[$("hover","\n background-color: var(--n-resize-trigger-color-hover);\n ")]),h("drawer-content-wrapper","\n box-sizing: border-box;\n "),h("drawer-content","\n height: 100%;\n display: flex;\n flex-direction: column;\n ",[$("native-scrollbar",[h("drawer-body-content-wrapper","\n height: 100%;\n overflow: auto;\n ")]),h("drawer-body","\n flex: 1 0 0;\n overflow: hidden;\n "),h("drawer-body-content-wrapper","\n box-sizing: border-box;\n padding: var(--n-body-padding);\n "),h("drawer-header","\n font-weight: var(--n-title-font-weight);\n line-height: 1;\n font-size: var(--n-title-font-size);\n color: var(--n-title-text-color);\n padding: var(--n-header-padding);\n transition: border .3s var(--n-bezier);\n border-bottom: 1px solid var(--n-divider-color);\n border-bottom: var(--n-header-border-bottom);\n display: flex;\n justify-content: space-between;\n align-items: center;\n ",[w("main","\n flex: 1;\n "),w("close","\n margin-left: 6px;\n transition:\n background-color .3s var(--n-bezier),\n color .3s var(--n-bezier);\n ")]),h("drawer-footer","\n display: flex;\n justify-content: flex-end;\n border-top: var(--n-footer-border-top);\n transition: border .3s var(--n-bezier);\n padding: var(--n-footer-padding);\n ")]),$("right-placement","\n top: 0;\n bottom: 0;\n right: 0;\n border-top-left-radius: var(--n-border-radius);\n border-bottom-left-radius: var(--n-border-radius);\n ",[w("resize-trigger","\n width: 3px;\n height: 100%;\n top: 0;\n left: 0;\n transform: translateX(-1.5px);\n cursor: ew-resize;\n ")]),$("left-placement","\n top: 0;\n bottom: 0;\n left: 0;\n border-top-right-radius: var(--n-border-radius);\n border-bottom-right-radius: var(--n-border-radius);\n ",[w("resize-trigger","\n width: 3px;\n height: 100%;\n top: 0;\n right: 0;\n transform: translateX(1.5px);\n cursor: ew-resize;\n ")]),$("top-placement","\n top: 0;\n left: 0;\n right: 0;\n border-bottom-left-radius: var(--n-border-radius);\n border-bottom-right-radius: var(--n-border-radius);\n ",[w("resize-trigger","\n width: 100%;\n height: 3px;\n bottom: 0;\n left: 0;\n transform: translateY(1.5px);\n cursor: ns-resize;\n ")]),$("bottom-placement","\n left: 0;\n bottom: 0;\n right: 0;\n border-top-left-radius: var(--n-border-radius);\n border-top-right-radius: var(--n-border-radius);\n ",[w("resize-trigger","\n width: 100%;\n height: 3px;\n top: 0;\n left: 0;\n transform: translateY(-1.5px);\n cursor: ns-resize;\n ")])]),v("body",[v(">",[h("drawer-container","\n position: fixed;\n ")])]),h("drawer-container","\n position: relative;\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n pointer-events: none;\n ",[v("> *","\n pointer-events: all;\n ")]),h("drawer-mask","\n background-color: rgba(0, 0, 0, .3);\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n ",[$("invisible","\n background-color: rgba(0, 0, 0, 0)\n "),y({enterDuration:"0.2s",leaveDuration:"0.2s",enterCubicBezier:"var(--n-bezier-in)",leaveCubicBezier:"var(--n-bezier-out)"})])]),K=S({name:"Drawer",inheritAttrs:!1,props:Object.assign(Object.assign({},o.props),{show:Boolean,width:[Number,String],height:[Number,String],placement:{type:String,default:"right"},maskClosable:{type:Boolean,default:!0},showMask:{type:[Boolean,String],default:!0},to:[String,Object],displayDirective:{type:String,default:"if"},nativeScrollbar:{type:Boolean,default:!0},zIndex:Number,onMaskClick:Function,scrollbarProps:Object,contentClass:String,contentStyle:[Object,String],trapFocus:{type:Boolean,default:!0},onEsc:Function,autoFocus:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0},blockScroll:{type:Boolean,default:!0},maxWidth:Number,maxHeight:Number,minWidth:Number,minHeight:Number,resizable:Boolean,defaultWidth:{type:[Number,String],default:251},defaultHeight:{type:[Number,String],default:251},onUpdateWidth:[Function,Array],onUpdateHeight:[Function,Array],"onUpdate:width":[Function,Array],"onUpdate:height":[Function,Array],"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],onAfterEnter:Function,onAfterLeave:Function,drawerStyle:[String,Object],drawerClass:String,target:null,onShow:Function,onHide:Function}),setup(e){const{mergedClsPrefixRef:t,namespaceRef:n,inlineThemeDisabled:i}=m(e),s=u(),d=o("Drawer","-drawer",G,L,e,t),c=D(e.defaultWidth),h=D(e.defaultHeight),v=a(A(e,"width"),c),g=a(A(e,"height"),h),w=O(()=>{const{placement:t}=e;return"top"===t||"bottom"===t?"":f(v.value)}),y=O(()=>{const{placement:t}=e;return"left"===t||"right"===t?"":f(g.value)}),z=O(()=>[{width:w.value,height:y.value},e.drawerStyle||""]);function $(t){const{onMaskClick:n,maskClosable:r}=e;r&&S(!1),n&&n(t)}const x=U();function S(t){const{onHide:n,onUpdateShow:r,"onUpdate:show":o}=e;r&&l(r,t),o&&l(o,t),n&&!t&&l(n,t)}C(r,{isMountedRef:s,mergedThemeRef:d,mergedClsPrefixRef:t,doUpdateShow:S,doUpdateHeight:t=>{const{onUpdateHeight:n,"onUpdate:width":r}=e;n&&l(n,t),r&&l(r,t),h.value=t},doUpdateWidth:t=>{const{onUpdateWidth:n,"onUpdate:width":r}=e;n&&l(n,t),r&&l(r,t),c.value=t}});const k=O(()=>{const{common:{cubicBezierEaseInOut:e,cubicBezierEaseIn:t,cubicBezierEaseOut:n},self:{color:r,textColor:o,boxShadow:i,lineHeight:a,headerPadding:s,footerPadding:l,borderRadius:c,bodyPadding:u,titleFontSize:h,titleTextColor:m,titleFontWeight:v,headerBorderBottom:b,footerBorderTop:f,closeIconColor:p,closeIconColorHover:g,closeIconColorPressed:w,closeColorHover:y,closeColorPressed:z,closeIconSize:$,closeSize:x,closeBorderRadius:S,resizableTriggerColorHover:k}}=d.value;return{"--n-line-height":a,"--n-color":r,"--n-border-radius":c,"--n-text-color":o,"--n-box-shadow":i,"--n-bezier":e,"--n-bezier-out":n,"--n-bezier-in":t,"--n-header-padding":s,"--n-body-padding":u,"--n-footer-padding":l,"--n-title-text-color":m,"--n-title-font-size":h,"--n-title-font-weight":v,"--n-header-border-bottom":b,"--n-footer-border-top":f,"--n-close-icon-color":p,"--n-close-icon-color-hover":g,"--n-close-icon-color-pressed":w,"--n-close-size":x,"--n-close-color-hover":y,"--n-close-color-pressed":z,"--n-close-icon-size":$,"--n-close-border-radius":S,"--n-resize-trigger-color-hover":k}}),E=i?b("drawer",void 0,k,e):void 0;return{mergedClsPrefix:t,namespace:n,mergedBodyStyle:z,handleOutsideClick:function(e){$(e)},handleMaskClick:$,handleEsc:function(t){var n;null===(n=e.onEsc)||void 0===n||n.call(e),e.show&&e.closeOnEsc&&p(t)&&(x.value||S(!1))},mergedTheme:d,cssVars:i?void 0:k,themeClass:null==E?void 0:E.themeClass,onRender:null==E?void 0:E.onRender,isMounted:s}},render(){const{mergedClsPrefix:e}=this;return B(n,{to:this.to,show:this.show},{default:()=>{var t;return null===(t=this.onRender)||void 0===t||t.call(this),N(B("div",{class:[`${e}-drawer-container`,this.namespace,this.themeClass],style:this.cssVars,role:"none"},this.showMask?B(W,{name:"fade-in-transition",appear:this.isMounted},{default:()=>this.show?B("div",{"aria-hidden":!0,class:[`${e}-drawer-mask`,"transparent"===this.showMask&&`${e}-drawer-mask--invisible`],onClick:this.handleMaskClick}):null}):null,B(I,Object.assign({},this.$attrs,{class:[this.drawerClass,this.$attrs.class],style:[this.mergedBodyStyle,this.$attrs.style],blockScroll:this.blockScroll,contentStyle:this.contentStyle,contentClass:this.contentClass,placement:this.placement,scrollbarProps:this.scrollbarProps,show:this.show,displayDirective:this.displayDirective,nativeScrollbar:this.nativeScrollbar,onAfterEnter:this.onAfterEnter,onAfterLeave:this.onAfterLeave,trapFocus:this.trapFocus,autoFocus:this.autoFocus,resizable:this.resizable,maxHeight:this.maxHeight,minHeight:this.minHeight,maxWidth:this.maxWidth,minWidth:this.minWidth,showMask:this.showMask,onEsc:this.handleEsc,onClickoutside:this.handleOutsideClick}),this.$slots)),[[s,{zIndex:this.zIndex,enabled:this.show}]])}})}});function ee(e=520,t=null){const n=D("undefined"!=typeof window?window.innerWidth:1200),r=()=>{n.value=window.innerWidth};R(()=>{window.addEventListener("resize",r)}),E(()=>{window.removeEventListener("resize",r)});const o=O(()=>n.value<640),i=O(()=>n.value>=640&&n.value<1024);return{drawerWidth:O(()=>{if(n.value<640)return"100%";if(n.value<768)return Math.min(.95*n.value,e);if(n.value<1024){const r=t||e;return Math.min(.85*n.value,r)}return e}),isMobile:o,isTablet:i,windowWidth:n}}export{K as n,ee as t};
|
|
1
|
+
import{F as e,I as t,It as n,Jt as r,N as o,Nt as i,Qt as a,Rt as s,Tt as l,Ut as d,Wt as c,Zt as u,gn as h,gt as m,hn as v,ht as b,jt as f,kt as p,qt as g,vn as w,w as y,y as z,yn as $,zt as x}from"./_plugin-vue_export-helper-BeLZJZij.js";import{A as S,F as k,G as C,H as E,M as B,N as F,Q as M,V as R,Z as H,b as O,dt as W,f as A,l as T,st as D,tt as N,z as P}from"./vue-vendor-BqZbbXHA.js";import{n as U,t as j}from"./use-lock-html-scroll-DXIqmUW4.js";import{W as L}from"./index-BlUXw84U.js";var I=S({name:"NDrawerContent",inheritAttrs:!1,props:{blockScroll:Boolean,show:{type:Boolean,default:void 0},displayDirective:{type:String,required:!0},placement:{type:String,required:!0},contentClass:String,contentStyle:[Object,String],nativeScrollbar:{type:Boolean,required:!0},scrollbarProps:Object,trapFocus:{type:Boolean,default:!0},autoFocus:{type:Boolean,default:!0},showMask:{type:[Boolean,String],required:!0},maxWidth:Number,maxHeight:Number,minWidth:Number,minHeight:Number,resizable:Boolean,onClickoutside:Function,onAfterLeave:Function,onAfterEnter:Function,onEsc:Function},setup(e){const n=D(!!e.show),o=D(null),i=F(r);let a=0,s="",l=null;const u=D(!1),h=D(!1),v=O(()=>"top"===e.placement||"bottom"===e.placement),{mergedClsPrefixRef:b,mergedRtlRef:f}=m(e),p=t("Drawer",f,b),w=S,{doUpdateHeight:y,doUpdateWidth:z}=i;function $(t){var n,r;if(h.value)if(v.value){let r=(null===(n=o.value)||void 0===n?void 0:n.offsetHeight)||0;const i=a-t.clientY;r+="bottom"===e.placement?i:-i,r=(t=>{const{maxHeight:n}=e;if(n&&t>n)return n;const{minHeight:r}=e;return r&&t<r?r:t})(r),y(r),a=t.clientY}else{let n=(null===(r=o.value)||void 0===r?void 0:r.offsetWidth)||0;const i=a-t.clientX;n+="right"===e.placement?i:-i,n=(t=>{const{maxWidth:n}=e;if(n&&t>n)return n;const{minWidth:r}=e;return r&&t<r?r:t})(n),z(n),a=t.clientX}}function S(){h.value&&(a=0,h.value=!1,document.body.style.cursor=s,document.body.removeEventListener("mousemove",$),document.body.removeEventListener("mouseup",S),document.body.removeEventListener("mouseleave",w))}M(()=>{e.show&&(n.value=!0)}),H(()=>e.show,e=>{e||S()}),P(()=>{S()});const k=O(()=>{const{show:t}=e,n=[[A,t]];return e.showMask||n.push([x,e.onClickoutside,void 0,{capture:!0}]),n});return j(O(()=>e.blockScroll&&n.value)),C(g,o),C(d,null),C(c,null),{bodyRef:o,rtlEnabled:p,mergedClsPrefix:i.mergedClsPrefixRef,isMounted:i.isMountedRef,mergedTheme:i.mergedThemeRef,displayed:n,transitionName:O(()=>({right:"slide-in-from-right-transition",left:"slide-in-from-left-transition",top:"slide-in-from-top-transition",bottom:"slide-in-from-bottom-transition"}[e.placement])),handleAfterLeave:function(){var t;n.value=!1,null===(t=e.onAfterLeave)||void 0===t||t.call(e)},bodyDirectives:k,handleMousedownResizeTrigger:e=>{h.value=!0,a=v.value?e.clientY:e.clientX,s=document.body.style.cursor,document.body.style.cursor=v.value?"ns-resize":"ew-resize",document.body.addEventListener("mousemove",$),document.body.addEventListener("mouseleave",w),document.body.addEventListener("mouseup",S)},handleMouseenterResizeTrigger:()=>{null!==l&&(window.clearTimeout(l),l=null),h.value?u.value=!0:l=window.setTimeout(()=>{u.value=!0},300)},handleMouseleaveResizeTrigger:()=>{null!==l&&(window.clearTimeout(l),l=null),u.value=!1},isDragging:h,isHoverOnResizeTrigger:u}},render(){const{$slots:e,mergedClsPrefix:t}=this;return"show"===this.displayDirective||this.displayed||this.show?N(B("div",{role:"none"},B(i,{disabled:!this.showMask||!this.trapFocus,active:this.show,autoFocus:this.autoFocus,onEsc:this.onEsc},{default:()=>B(T,{name:this.transitionName,appear:this.isMounted,onAfterEnter:this.onAfterEnter,onAfterLeave:this.handleAfterLeave},{default:()=>N(B("div",k(this.$attrs,{role:"dialog",ref:"bodyRef","aria-modal":"true",class:[`${t}-drawer`,this.rtlEnabled&&`${t}-drawer--rtl`,`${t}-drawer--${this.placement}-placement`,this.isDragging&&`${t}-drawer--unselectable`,this.nativeScrollbar&&`${t}-drawer--native-scrollbar`]}),[this.resizable?B("div",{class:[`${t}-drawer__resize-trigger`,(this.isDragging||this.isHoverOnResizeTrigger)&&`${t}-drawer__resize-trigger--hover`],onMouseenter:this.handleMouseenterResizeTrigger,onMouseleave:this.handleMouseleaveResizeTrigger,onMousedown:this.handleMousedownResizeTrigger}):null,this.nativeScrollbar?B("div",{class:[`${t}-drawer-content-wrapper`,this.contentClass],style:this.contentStyle,role:"none"},e):B(z,Object.assign({},this.scrollbarProps,{contentStyle:this.contentStyle,contentClass:[`${t}-drawer-content-wrapper`,this.contentClass],theme:this.mergedTheme.peers.Scrollbar,themeOverrides:this.mergedTheme.peerOverrides.Scrollbar}),e)]),this.bodyDirectives)})})),[[A,"if"===this.displayDirective||this.displayed||this.show]]):null}}),{cubicBezierEaseIn:X,cubicBezierEaseOut:Y}=e;var{cubicBezierEaseIn:_,cubicBezierEaseOut:q}=e;var{cubicBezierEaseIn:V,cubicBezierEaseOut:Q}=e;var{cubicBezierEaseIn:Z,cubicBezierEaseOut:G}=e;var J=v([h("drawer","\n word-break: break-word;\n line-height: var(--n-line-height);\n position: absolute;\n pointer-events: all;\n box-shadow: var(--n-box-shadow);\n transition:\n background-color .3s var(--n-bezier),\n color .3s var(--n-bezier);\n background-color: var(--n-color);\n color: var(--n-text-color);\n box-sizing: border-box;\n ",[function({duration:e="0.3s",leaveDuration:t="0.2s",name:n="slide-in-from-right"}={}){return[v(`&.${n}-transition-leave-active`,{transition:`transform ${t} ${V}`}),v(`&.${n}-transition-enter-active`,{transition:`transform ${e} ${Q}`}),v(`&.${n}-transition-enter-to`,{transform:"translateX(0)"}),v(`&.${n}-transition-enter-from`,{transform:"translateX(100%)"}),v(`&.${n}-transition-leave-from`,{transform:"translateX(0)"}),v(`&.${n}-transition-leave-to`,{transform:"translateX(100%)"})]}(),function({duration:e="0.3s",leaveDuration:t="0.2s",name:n="slide-in-from-left"}={}){return[v(`&.${n}-transition-leave-active`,{transition:`transform ${t} ${_}`}),v(`&.${n}-transition-enter-active`,{transition:`transform ${e} ${q}`}),v(`&.${n}-transition-enter-to`,{transform:"translateX(0)"}),v(`&.${n}-transition-enter-from`,{transform:"translateX(-100%)"}),v(`&.${n}-transition-leave-from`,{transform:"translateX(0)"}),v(`&.${n}-transition-leave-to`,{transform:"translateX(-100%)"})]}(),function({duration:e="0.3s",leaveDuration:t="0.2s",name:n="slide-in-from-top"}={}){return[v(`&.${n}-transition-leave-active`,{transition:`transform ${t} ${Z}`}),v(`&.${n}-transition-enter-active`,{transition:`transform ${e} ${G}`}),v(`&.${n}-transition-enter-to`,{transform:"translateY(0)"}),v(`&.${n}-transition-enter-from`,{transform:"translateY(-100%)"}),v(`&.${n}-transition-leave-from`,{transform:"translateY(0)"}),v(`&.${n}-transition-leave-to`,{transform:"translateY(-100%)"})]}(),function({duration:e="0.3s",leaveDuration:t="0.2s",name:n="slide-in-from-bottom"}={}){return[v(`&.${n}-transition-leave-active`,{transition:`transform ${t} ${X}`}),v(`&.${n}-transition-enter-active`,{transition:`transform ${e} ${Y}`}),v(`&.${n}-transition-enter-to`,{transform:"translateY(0)"}),v(`&.${n}-transition-enter-from`,{transform:"translateY(100%)"}),v(`&.${n}-transition-leave-from`,{transform:"translateY(0)"}),v(`&.${n}-transition-leave-to`,{transform:"translateY(100%)"})]}(),$("unselectable","\n user-select: none; \n -webkit-user-select: none;\n "),$("native-scrollbar",[h("drawer-content-wrapper","\n overflow: auto;\n height: 100%;\n ")]),w("resize-trigger","\n position: absolute;\n background-color: #0000;\n transition: background-color .3s var(--n-bezier);\n ",[$("hover","\n background-color: var(--n-resize-trigger-color-hover);\n ")]),h("drawer-content-wrapper","\n box-sizing: border-box;\n "),h("drawer-content","\n height: 100%;\n display: flex;\n flex-direction: column;\n ",[$("native-scrollbar",[h("drawer-body-content-wrapper","\n height: 100%;\n overflow: auto;\n ")]),h("drawer-body","\n flex: 1 0 0;\n overflow: hidden;\n "),h("drawer-body-content-wrapper","\n box-sizing: border-box;\n padding: var(--n-body-padding);\n "),h("drawer-header","\n font-weight: var(--n-title-font-weight);\n line-height: 1;\n font-size: var(--n-title-font-size);\n color: var(--n-title-text-color);\n padding: var(--n-header-padding);\n transition: border .3s var(--n-bezier);\n border-bottom: 1px solid var(--n-divider-color);\n border-bottom: var(--n-header-border-bottom);\n display: flex;\n justify-content: space-between;\n align-items: center;\n ",[w("main","\n flex: 1;\n "),w("close","\n margin-left: 6px;\n transition:\n background-color .3s var(--n-bezier),\n color .3s var(--n-bezier);\n ")]),h("drawer-footer","\n display: flex;\n justify-content: flex-end;\n border-top: var(--n-footer-border-top);\n transition: border .3s var(--n-bezier);\n padding: var(--n-footer-padding);\n ")]),$("right-placement","\n top: 0;\n bottom: 0;\n right: 0;\n border-top-left-radius: var(--n-border-radius);\n border-bottom-left-radius: var(--n-border-radius);\n ",[w("resize-trigger","\n width: 3px;\n height: 100%;\n top: 0;\n left: 0;\n transform: translateX(-1.5px);\n cursor: ew-resize;\n ")]),$("left-placement","\n top: 0;\n bottom: 0;\n left: 0;\n border-top-right-radius: var(--n-border-radius);\n border-bottom-right-radius: var(--n-border-radius);\n ",[w("resize-trigger","\n width: 3px;\n height: 100%;\n top: 0;\n right: 0;\n transform: translateX(1.5px);\n cursor: ew-resize;\n ")]),$("top-placement","\n top: 0;\n left: 0;\n right: 0;\n border-bottom-left-radius: var(--n-border-radius);\n border-bottom-right-radius: var(--n-border-radius);\n ",[w("resize-trigger","\n width: 100%;\n height: 3px;\n bottom: 0;\n left: 0;\n transform: translateY(1.5px);\n cursor: ns-resize;\n ")]),$("bottom-placement","\n left: 0;\n bottom: 0;\n right: 0;\n border-top-left-radius: var(--n-border-radius);\n border-top-right-radius: var(--n-border-radius);\n ",[w("resize-trigger","\n width: 100%;\n height: 3px;\n top: 0;\n left: 0;\n transform: translateY(-1.5px);\n cursor: ns-resize;\n ")])]),v("body",[v(">",[h("drawer-container","\n position: fixed;\n ")])]),h("drawer-container","\n position: relative;\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n pointer-events: none;\n ",[v("> *","\n pointer-events: all;\n ")]),h("drawer-mask","\n background-color: rgba(0, 0, 0, .3);\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n ",[$("invisible","\n background-color: rgba(0, 0, 0, 0)\n "),y({enterDuration:"0.2s",leaveDuration:"0.2s",enterCubicBezier:"var(--n-bezier-in)",leaveCubicBezier:"var(--n-bezier-out)"})])]),K=S({name:"Drawer",inheritAttrs:!1,props:Object.assign(Object.assign({},o.props),{show:Boolean,width:[Number,String],height:[Number,String],placement:{type:String,default:"right"},maskClosable:{type:Boolean,default:!0},showMask:{type:[Boolean,String],default:!0},to:[String,Object],displayDirective:{type:String,default:"if"},nativeScrollbar:{type:Boolean,default:!0},zIndex:Number,onMaskClick:Function,scrollbarProps:Object,contentClass:String,contentStyle:[Object,String],trapFocus:{type:Boolean,default:!0},onEsc:Function,autoFocus:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0},blockScroll:{type:Boolean,default:!0},maxWidth:Number,maxHeight:Number,minWidth:Number,minHeight:Number,resizable:Boolean,defaultWidth:{type:[Number,String],default:251},defaultHeight:{type:[Number,String],default:251},onUpdateWidth:[Function,Array],onUpdateHeight:[Function,Array],"onUpdate:width":[Function,Array],"onUpdate:height":[Function,Array],"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],onAfterEnter:Function,onAfterLeave:Function,drawerStyle:[String,Object],drawerClass:String,target:null,onShow:Function,onHide:Function}),setup(e){const{mergedClsPrefixRef:t,namespaceRef:n,inlineThemeDisabled:i}=m(e),s=u(),d=o("Drawer","-drawer",J,L,e,t),c=D(e.defaultWidth),h=D(e.defaultHeight),v=a(W(e,"width"),c),g=a(W(e,"height"),h),w=O(()=>{const{placement:t}=e;return"top"===t||"bottom"===t?"":f(v.value)}),y=O(()=>{const{placement:t}=e;return"left"===t||"right"===t?"":f(g.value)}),z=O(()=>[{width:w.value,height:y.value},e.drawerStyle||""]);function $(t){const{onMaskClick:n,maskClosable:r}=e;r&&S(!1),n&&n(t)}const x=U();function S(t){const{onHide:n,onUpdateShow:r,"onUpdate:show":o}=e;r&&l(r,t),o&&l(o,t),n&&!t&&l(n,t)}C(r,{isMountedRef:s,mergedThemeRef:d,mergedClsPrefixRef:t,doUpdateShow:S,doUpdateHeight:t=>{const{onUpdateHeight:n,"onUpdate:width":r}=e;n&&l(n,t),r&&l(r,t),h.value=t},doUpdateWidth:t=>{const{onUpdateWidth:n,"onUpdate:width":r}=e;n&&l(n,t),r&&l(r,t),c.value=t}});const k=O(()=>{const{common:{cubicBezierEaseInOut:e,cubicBezierEaseIn:t,cubicBezierEaseOut:n},self:{color:r,textColor:o,boxShadow:i,lineHeight:a,headerPadding:s,footerPadding:l,borderRadius:c,bodyPadding:u,titleFontSize:h,titleTextColor:m,titleFontWeight:v,headerBorderBottom:b,footerBorderTop:f,closeIconColor:p,closeIconColorHover:g,closeIconColorPressed:w,closeColorHover:y,closeColorPressed:z,closeIconSize:$,closeSize:x,closeBorderRadius:S,resizableTriggerColorHover:k}}=d.value;return{"--n-line-height":a,"--n-color":r,"--n-border-radius":c,"--n-text-color":o,"--n-box-shadow":i,"--n-bezier":e,"--n-bezier-out":n,"--n-bezier-in":t,"--n-header-padding":s,"--n-body-padding":u,"--n-footer-padding":l,"--n-title-text-color":m,"--n-title-font-size":h,"--n-title-font-weight":v,"--n-header-border-bottom":b,"--n-footer-border-top":f,"--n-close-icon-color":p,"--n-close-icon-color-hover":g,"--n-close-icon-color-pressed":w,"--n-close-size":x,"--n-close-color-hover":y,"--n-close-color-pressed":z,"--n-close-icon-size":$,"--n-close-border-radius":S,"--n-resize-trigger-color-hover":k}}),E=i?b("drawer",void 0,k,e):void 0;return{mergedClsPrefix:t,namespace:n,mergedBodyStyle:z,handleOutsideClick:function(e){$(e)},handleMaskClick:$,handleEsc:function(t){var n;null===(n=e.onEsc)||void 0===n||n.call(e),e.show&&e.closeOnEsc&&p(t)&&(x.value||S(!1))},mergedTheme:d,cssVars:i?void 0:k,themeClass:null==E?void 0:E.themeClass,onRender:null==E?void 0:E.onRender,isMounted:s}},render(){const{mergedClsPrefix:e}=this;return B(n,{to:this.to,show:this.show},{default:()=>{var t;return null===(t=this.onRender)||void 0===t||t.call(this),N(B("div",{class:[`${e}-drawer-container`,this.namespace,this.themeClass],style:this.cssVars,role:"none"},this.showMask?B(T,{name:"fade-in-transition",appear:this.isMounted},{default:()=>this.show?B("div",{"aria-hidden":!0,class:[`${e}-drawer-mask`,"transparent"===this.showMask&&`${e}-drawer-mask--invisible`],onClick:this.handleMaskClick}):null}):null,B(I,Object.assign({},this.$attrs,{class:[this.drawerClass,this.$attrs.class],style:[this.mergedBodyStyle,this.$attrs.style],blockScroll:this.blockScroll,contentStyle:this.contentStyle,contentClass:this.contentClass,placement:this.placement,scrollbarProps:this.scrollbarProps,show:this.show,displayDirective:this.displayDirective,nativeScrollbar:this.nativeScrollbar,onAfterEnter:this.onAfterEnter,onAfterLeave:this.onAfterLeave,trapFocus:this.trapFocus,autoFocus:this.autoFocus,resizable:this.resizable,maxHeight:this.maxHeight,minHeight:this.minHeight,maxWidth:this.maxWidth,minWidth:this.minWidth,showMask:this.showMask,onEsc:this.handleEsc,onClickoutside:this.handleOutsideClick}),this.$slots)),[[s,{zIndex:this.zIndex,enabled:this.show}]])}})}});function ee(e=520,t=null){const n=D("undefined"!=typeof window?window.innerWidth:1200),r=()=>{n.value=window.innerWidth};R(()=>{window.addEventListener("resize",r)}),E(()=>{window.removeEventListener("resize",r)});const o=O(()=>n.value<640),i=O(()=>n.value>=640&&n.value<1024);return{drawerWidth:O(()=>{if(n.value<640)return"100%";if(n.value<768)return Math.min(.95*n.value,e);if(n.value<1024){const r=t||e;return Math.min(.85*n.value,r)}return e}),isMobile:o,isTablet:i,windowWidth:n}}export{K as n,ee as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{t as a}from"./client-BgcNg4Bt.js";var t="/config-templates";async function n(){return(await a.get(t)).data}async function e(n){return(await a.post(t,n)).data}async function r(n,e){return(await a.put(`${t}/${n}`,e)).data}async function s(n){return(await a.delete(`${t}/${n}`)).data}async function c(){return(await a.get(`${t}/available-configs`)).data}async function o(n,e,r=["claude"]){const s=Array.isArray(r)?r:[r];return(await a.post(`${t}/${n}/apply`,{targetPath:e,aiConfigTypes:s})).data}async function i(n,e,r=["claude"]){const s=Array.isArray(r)?r:[r];return(await a.post(`${t}/${n}/preview`,{targetPath:e,aiConfigTypes:s})).data}var u="/workspaces";async function p(){return(await a.get(u)).data}async function d(t){return(await a.get(`${u}/${t}`)).data}async function y(t){return(await a.post(u,t)).data}async function $(t,n=!1){return(await a.delete(`${u}/${t}`,{params:{removeFiles:n}})).data}async function f(t,n){return(await a.post(`${u}/${t}/projects`,n)).data}async function l(t,n,e=!1){const r=encodeURIComponent(n);return(await a.delete(`${u}/${t}/projects/${r}`,{params:{removeWorktrees:e}})).data}async function w(t){const n=encodeURIComponent(t);return(await a.get(`${u}/check-git/${n}`)).data}async function g(){return(await a.get(`${u}/available-projects`)).data}async function m(t,n,e=null){return(await a.post(`${u}/${t}/launch`,{tool:n,projectName:e})).data}export{g as a,p as c,e as d,s as f,r as g,i as h,$ as i,l,c as m,w as n,m as o,n as p,y as r,d as s,f as t,o as u};
|
package/dist/web/index.html
CHANGED
|
@@ -5,18 +5,18 @@
|
|
|
5
5
|
<link rel="icon" href="/favicon.ico">
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
7
|
<title>coding-tool-x · AI 编程工作台</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-BlUXw84U.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/vue-vendor-BqZbbXHA.js">
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/_plugin-vue_export-helper-BeLZJZij.js">
|
|
11
11
|
<link rel="modulepreload" crossorigin href="/assets/vendors-D0c_0KLP.js">
|
|
12
|
-
<link rel="modulepreload" crossorigin href="/assets/client-
|
|
13
|
-
<link rel="modulepreload" crossorigin href="/assets/icons-
|
|
14
|
-
<link rel="modulepreload" crossorigin href="/assets/platforms-
|
|
15
|
-
<link rel="modulepreload" crossorigin href="/assets/platforms-
|
|
16
|
-
<link rel="modulepreload" crossorigin href="/assets/use-message-
|
|
12
|
+
<link rel="modulepreload" crossorigin href="/assets/client-BgcNg4Bt.js">
|
|
13
|
+
<link rel="modulepreload" crossorigin href="/assets/icons-B-AzZoeE.js">
|
|
14
|
+
<link rel="modulepreload" crossorigin href="/assets/platforms-DrzAtnjY.js">
|
|
15
|
+
<link rel="modulepreload" crossorigin href="/assets/platforms-mqqe_82d.js">
|
|
16
|
+
<link rel="modulepreload" crossorigin href="/assets/use-message-DBsCm7FJ.js">
|
|
17
17
|
<link rel="modulepreload" crossorigin href="/assets/use-lock-html-scroll-DXIqmUW4.js">
|
|
18
|
-
<link rel="modulepreload" crossorigin href="/assets/light-
|
|
19
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
18
|
+
<link rel="modulepreload" crossorigin href="/assets/light-C2X7hegj.js">
|
|
19
|
+
<link rel="stylesheet" crossorigin href="/assets/index-Bn8BUnwP.css">
|
|
20
20
|
</head>
|
|
21
21
|
<body>
|
|
22
22
|
<div id="app"></div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "coding-tool-x",
|
|
3
|
-
"version": "3.8.
|
|
3
|
+
"version": "3.8.10",
|
|
4
4
|
"description": "Vibe Coding 增强工作助手 - 智能会话管理、动态渠道切换、全局搜索、实时监控",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -69,13 +69,15 @@
|
|
|
69
69
|
"https-proxy-agent": "^7.0.6",
|
|
70
70
|
"inquirer": "^8.2.7",
|
|
71
71
|
"js-yaml": "^4.3.1",
|
|
72
|
+
"jsonc-parser": "^3.3.1",
|
|
72
73
|
"open": "^8.4.2",
|
|
73
74
|
"ora": "^5.4.1",
|
|
74
75
|
"pm2": "^7.0.3",
|
|
75
76
|
"rxjs": "^7.8.2",
|
|
76
77
|
"semver": "^7.6.0",
|
|
77
78
|
"toml": "^5.0.0",
|
|
78
|
-
"ws": "^8.18.3"
|
|
79
|
+
"ws": "^8.18.3",
|
|
80
|
+
"yaml": "^2.9.1"
|
|
79
81
|
},
|
|
80
82
|
"overrides": {
|
|
81
83
|
"basic-ftp": "^6.2.0",
|
|
@@ -1,223 +1,29 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
1
3
|
const fs = require('fs');
|
|
2
4
|
const path = require('path');
|
|
3
|
-
const archiver = require('archiver');
|
|
4
5
|
const chalk = require('chalk');
|
|
5
|
-
const {
|
|
6
|
-
const { getPlatformContext } = require('../server/platform-context');
|
|
7
|
-
|
|
8
|
-
function resolveClaudeExportPaths(options = {}) {
|
|
9
|
-
const registry = options.registry || getPlatformContext().registry;
|
|
10
|
-
const pathContext = options.pathContext
|
|
11
|
-
|| registry?.resolvePathContext?.('claude', options.pathOptions || {});
|
|
12
|
-
const homeDir = pathContext?.home || HOME_DIR;
|
|
13
|
-
const native = pathContext?.native || {};
|
|
14
|
-
const claudeDir = native.dir || path.join(homeDir, '.claude');
|
|
15
|
-
|
|
16
|
-
return {
|
|
17
|
-
homeDir,
|
|
18
|
-
claudeDir,
|
|
19
|
-
prompt: native.prompt || path.join(claudeDir, 'CLAUDE.md'),
|
|
20
|
-
settings: native.settings || path.join(claudeDir, 'settings.json'),
|
|
21
|
-
skills: native.skills || path.join(claudeDir, 'skills')
|
|
22
|
-
};
|
|
23
|
-
}
|
|
6
|
+
const { exportAllConfigsZip } = require('../server/services/config-export-service');
|
|
24
7
|
|
|
25
8
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
9
|
+
* 导出统一配置包。
|
|
10
|
+
*
|
|
11
|
+
* 保留旧命令入口,但实际复用服务端的 Manifest/Driver 导出流程,
|
|
12
|
+
* 不再只导出 Claude Code,也不再维护第二套打包逻辑。
|
|
28
13
|
*/
|
|
29
14
|
async function exportConfig(options = {}) {
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
const exportPaths = resolveClaudeExportPaths(options);
|
|
36
|
-
const { homeDir, claudeDir } = exportPaths;
|
|
37
|
-
const currentDir = process.cwd();
|
|
38
|
-
|
|
39
|
-
// 检查 .claude 目录是否存在
|
|
40
|
-
if (!fs.existsSync(claudeDir)) {
|
|
41
|
-
console.log(chalk.red('[ERROR] 未找到 .claude 配置目录'));
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// 创建输出文件流
|
|
46
|
-
const outputPath = path.resolve(currentDir, output);
|
|
47
|
-
const outputStream = fs.createWriteStream(outputPath);
|
|
48
|
-
const archive = archiver('zip', { zlib: { level: 9 } });
|
|
49
|
-
|
|
50
|
-
// 监听错误
|
|
51
|
-
archive.on('error', (err) => {
|
|
52
|
-
throw err;
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
// 监听完成
|
|
56
|
-
archive.on('end', () => {
|
|
57
|
-
console.log(chalk.green(`\n[OK] 配置导出成功!`));
|
|
58
|
-
console.log(chalk.gray(` 文件位置: ${outputPath}`));
|
|
59
|
-
console.log(chalk.gray(` 文件大小: ${(archive.pointer() / 1024 / 1024).toFixed(2)} MB`));
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
// 连接流
|
|
63
|
-
archive.pipe(outputStream);
|
|
64
|
-
|
|
65
|
-
// 收集配置清单
|
|
66
|
-
const manifest = {
|
|
67
|
-
exportTime: new Date().toISOString(),
|
|
68
|
-
version: '1.0.0',
|
|
69
|
-
globalConfig: {},
|
|
70
|
-
projectConfig: {},
|
|
71
|
-
enabledConfigs: []
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
// 1. 导出全局 CLAUDE.md
|
|
75
|
-
const globalClaudeMd = exportPaths.prompt;
|
|
76
|
-
if (fs.existsSync(globalClaudeMd)) {
|
|
77
|
-
archive.file(globalClaudeMd, { name: 'global/CLAUDE.md' });
|
|
78
|
-
manifest.globalConfig.claudeMd = true;
|
|
79
|
-
manifest.enabledConfigs.push('global/CLAUDE.md');
|
|
80
|
-
console.log(chalk.gray(' [v] 全局 CLAUDE.md'));
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
// 2. 导出 settings.json
|
|
84
|
-
const settingsJson = exportPaths.settings;
|
|
85
|
-
if (fs.existsSync(settingsJson)) {
|
|
86
|
-
archive.file(settingsJson, { name: 'global/settings.json' });
|
|
87
|
-
manifest.globalConfig.settings = true;
|
|
88
|
-
manifest.enabledConfigs.push('global/settings.json');
|
|
89
|
-
console.log(chalk.gray(' [v] settings.json'));
|
|
90
|
-
|
|
91
|
-
// 解析 MCP 服务器配置
|
|
92
|
-
try {
|
|
93
|
-
const settings = JSON.parse(fs.readFileSync(settingsJson, 'utf-8'));
|
|
94
|
-
if (settings.mcpServers) {
|
|
95
|
-
manifest.globalConfig.mcpServers = Object.keys(settings.mcpServers);
|
|
96
|
-
console.log(chalk.gray(` - MCP 服务器: ${manifest.globalConfig.mcpServers.join(', ')}`));
|
|
97
|
-
}
|
|
98
|
-
if (settings.hooks) {
|
|
99
|
-
manifest.globalConfig.hooks = Object.keys(settings.hooks);
|
|
100
|
-
}
|
|
101
|
-
if (settings.statusLine) {
|
|
102
|
-
manifest.globalConfig.statusLine = true;
|
|
103
|
-
}
|
|
104
|
-
} catch (e) {
|
|
105
|
-
console.log(chalk.yellow(' [!] settings.json 解析失败'));
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
// 3. 导出 Skills
|
|
110
|
-
const skillsDir = exportPaths.skills;
|
|
111
|
-
if (fs.existsSync(skillsDir)) {
|
|
112
|
-
const skills = fs.readdirSync(skillsDir).filter(f => !f.startsWith('.'));
|
|
113
|
-
if (skills.length > 0) {
|
|
114
|
-
archive.directory(skillsDir, 'global/skills');
|
|
115
|
-
manifest.globalConfig.skills = skills;
|
|
116
|
-
manifest.enabledConfigs.push('global/skills');
|
|
117
|
-
console.log(chalk.gray(` [v] Skills (${skills.length} 个)`));
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
// 4. 导出当前项目配置
|
|
122
|
-
if (includeProjects) {
|
|
123
|
-
// 项目级 CLAUDE.md
|
|
124
|
-
const projectClaudeMd = path.join(currentDir, 'CLAUDE.md');
|
|
125
|
-
if (fs.existsSync(projectClaudeMd)) {
|
|
126
|
-
archive.file(projectClaudeMd, { name: 'project/CLAUDE.md' });
|
|
127
|
-
manifest.projectConfig.claudeMd = true;
|
|
128
|
-
manifest.enabledConfigs.push('project/CLAUDE.md');
|
|
129
|
-
console.log(chalk.gray(' [v] 项目 CLAUDE.md'));
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
// 项目级 settings.local.json
|
|
133
|
-
const projectSettings = path.join(currentDir, '.claude', 'settings.local.json');
|
|
134
|
-
if (fs.existsSync(projectSettings)) {
|
|
135
|
-
archive.file(projectSettings, { name: 'project/.claude/settings.local.json' });
|
|
136
|
-
manifest.projectConfig.settingsLocal = true;
|
|
137
|
-
manifest.enabledConfigs.push('project/.claude/settings.local.json');
|
|
138
|
-
console.log(chalk.gray(' [v] 项目 settings.local.json'));
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
// 项目级 workspace CLAUDE.md
|
|
142
|
-
const workspaceClaudeMd = path.join(homeDir, 'workspace', 'CLAUDE.md');
|
|
143
|
-
if (fs.existsSync(workspaceClaudeMd)) {
|
|
144
|
-
archive.file(workspaceClaudeMd, { name: 'workspace/CLAUDE.md' });
|
|
145
|
-
manifest.projectConfig.workspaceClaudeMd = true;
|
|
146
|
-
manifest.enabledConfigs.push('workspace/CLAUDE.md');
|
|
147
|
-
console.log(chalk.gray(' [v] workspace CLAUDE.md'));
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
// 5. 添加配置清单
|
|
152
|
-
archive.append(JSON.stringify(manifest, null, 2), { name: 'manifest.json' });
|
|
153
|
-
console.log(chalk.gray(' [v] manifest.json'));
|
|
154
|
-
|
|
155
|
-
// 6. 添加 README
|
|
156
|
-
const readme = generateReadme(manifest);
|
|
157
|
-
archive.append(readme, { name: 'README.md' });
|
|
158
|
-
console.log(chalk.gray(' [v] README.md'));
|
|
159
|
-
|
|
160
|
-
// 完成打包
|
|
161
|
-
await archive.finalize();
|
|
162
|
-
|
|
163
|
-
} catch (error) {
|
|
164
|
-
console.error(chalk.red('[ERROR] 导出失败:'), error.message);
|
|
165
|
-
throw error;
|
|
15
|
+
const result = exportAllConfigsZip();
|
|
16
|
+
if (!result.success) {
|
|
17
|
+
console.error(chalk.red('[ERROR] 导出失败:'), result.message || '未知错误');
|
|
18
|
+
return null;
|
|
166
19
|
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
* 生成配置包说明文档
|
|
171
|
-
*/
|
|
172
|
-
function generateReadme(manifest) {
|
|
173
|
-
return `# Claude Code 配置包
|
|
174
|
-
|
|
175
|
-
导出时间: ${new Date(manifest.exportTime).toLocaleString('zh-CN')}
|
|
176
|
-
版本: ${manifest.version}
|
|
177
|
-
|
|
178
|
-
## [PKG] 包含内容
|
|
179
|
-
|
|
180
|
-
### 全局配置
|
|
181
|
-
${manifest.globalConfig.claudeMd ? '- [OK] 全局 CLAUDE.md(AI 行为指令)' : ''}
|
|
182
|
-
${manifest.globalConfig.settings ? '- [OK] settings.json(包含 MCP 服务器、Hooks 等)' : ''}
|
|
183
|
-
${manifest.globalConfig.mcpServers ? ` - MCP 服务器: ${manifest.globalConfig.mcpServers.join(', ')}` : ''}
|
|
184
|
-
${manifest.globalConfig.hooks ? ` - Hooks: ${manifest.globalConfig.hooks.join(', ')}` : ''}
|
|
185
|
-
${manifest.globalConfig.skills ? `- [OK] Skills (${manifest.globalConfig.skills.length} 个): ${manifest.globalConfig.skills.join(', ')}` : ''}
|
|
186
|
-
|
|
187
|
-
### 项目配置
|
|
188
|
-
${manifest.projectConfig.claudeMd ? '- [OK] 项目 CLAUDE.md' : ''}
|
|
189
|
-
${manifest.projectConfig.settingsLocal ? '- [OK] 项目 settings.local.json' : ''}
|
|
190
|
-
${manifest.projectConfig.workspaceClaudeMd ? '- [OK] workspace CLAUDE.md' : ''}
|
|
191
|
-
|
|
192
|
-
## [IMPORT] 如何导入
|
|
193
|
-
|
|
194
|
-
### 方法 1:手动导入
|
|
195
|
-
1. 解压此 ZIP 文件
|
|
196
|
-
2. 复制 \`global/\` 内容到 \`~/.claude/\`
|
|
197
|
-
3. 复制 \`project/\` 内容到你的项目目录
|
|
198
|
-
4. 复制 \`workspace/\` 内容到 \`~/workspace/\`
|
|
199
|
-
|
|
200
|
-
### 方法 2:使用命令(计划中)
|
|
201
|
-
\`\`\`bash
|
|
202
|
-
ctx import-config claude-config.zip
|
|
203
|
-
\`\`\`
|
|
204
|
-
|
|
205
|
-
## [WARN] 注意事项
|
|
206
|
-
|
|
207
|
-
1. **备份现有配置**:导入前请备份现有的 \`.claude\` 目录
|
|
208
|
-
2. **敏感信息**:此配置包可能包含 API Keys、代理配置等敏感信息,请妥善保管
|
|
209
|
-
3. **路径适配**:某些路径可能需要根据你的系统调整(如 hooks 中的脚本路径)
|
|
210
|
-
4. **MCP 服务器**:需要确保目标环境已安装对应的 MCP 服务器
|
|
211
|
-
|
|
212
|
-
## [NOTE] 配置清单
|
|
213
|
-
|
|
214
|
-
已启用的配置项:
|
|
215
|
-
${manifest.enabledConfigs.map(c => `- ${c}`).join('\n')}
|
|
216
|
-
|
|
217
|
-
---
|
|
218
20
|
|
|
219
|
-
|
|
220
|
-
|
|
21
|
+
const outputPath = path.resolve(process.cwd(), options.output || result.filename || 'ctx-config.zip');
|
|
22
|
+
fs.writeFileSync(outputPath, result.data);
|
|
23
|
+
console.log(chalk.green('[OK] 配置导出成功!'));
|
|
24
|
+
console.log(chalk.gray(` 文件位置: ${outputPath}`));
|
|
25
|
+
console.log(chalk.gray(` 文件大小: ${(result.data.length / 1024 / 1024).toFixed(2)} MB`));
|
|
26
|
+
return outputPath;
|
|
221
27
|
}
|
|
222
28
|
|
|
223
29
|
module.exports = { exportConfig };
|