From 8605d6659220f0b5777cb73348099fe1c4313b29 Mon Sep 17 00:00:00 2001 From: Jay Wang Date: Tue, 9 Jan 2024 16:07:46 -0500 Subject: [PATCH] Deploy 040b7f739912dab0aed2f280493d997bd66e04d4 --- assets/{main-9125d8c8.js => main-602df7b5.js} | 2 +- index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename assets/{main-9125d8c8.js => main-602df7b5.js} (99%) diff --git a/assets/main-9125d8c8.js b/assets/main-602df7b5.js similarity index 99% rename from assets/main-9125d8c8.js rename to assets/main-602df7b5.js index 1715159..81f5df8 100644 --- a/assets/main-9125d8c8.js +++ b/assets/main-602df7b5.js @@ -1910,7 +1910,7 @@ The style should be appropriate for academic research papers. Please use active Put the revised text in XML format in the tag. -{{text}}`,tags:[],temperature:.2,userID:"13e5deed-1f15-47fe-aea8-29da794be6fe",userName:"",description:"",icon:"🎓",forkFrom:"",promptRunCount:0,created:"",title:"Improve Academic Writing",outputParsingPattern:".*(.*).*",outputParsingReplacement:"$1",recommendedModels:[],injectionMode:"replace",key:""},{prompt:"You are a great writer. Improve the flow of the following text.",tags:[],temperature:.2,userID:"13e5deed-1f15-47fe-aea8-29da794be6fe",userName:"",description:"",icon:"✍️",forkFrom:"",promptRunCount:0,created:"",title:"Improve Text Flow",outputParsingPattern:"",outputParsingReplacement:"",recommendedModels:[],injectionMode:"replace",key:""}],Rv="wordflow",Bv="0.1.3",_v="module",zv={dev:"vite --port 3000",build:"tsc && vite build","build:github":"tsc && vite build --mode github","deploy:github":`pnpm run build:github && pnpm gh-pages -m "Deploy $(git log '--format=format:%H' main -1)" -d ./dist`,"deploy:vercel":"pnpm run build && cp -r .vercel ./dist/ && vercel ./dist",preview:"vite preview"},Hv={lit:"^3.0.0"},jv={"@floating-ui/dom":"^1.5.3","@tiptap/core":"^2.1.12","@tiptap/extension-bubble-menu":"^2.1.12","@tiptap/extension-document":"^2.1.12","@tiptap/extension-highlight":"^2.1.12","@tiptap/extension-paragraph":"^2.1.12","@tiptap/extension-placeholder":"^2.1.13","@tiptap/extension-text":"^2.1.12","@tiptap/pm":"^2.1.12","@tiptap/starter-kit":"^2.1.12","@types/d3-format":"^3.0.4","@types/d3-time-format":"^4.0.3","@types/diff":"^5.0.7","@types/diff-match-patch":"^1.0.35","@types/emoji-regex":"^9.2.0","@types/uuid":"^9.0.7","@typescript-eslint/eslint-plugin":"^6.9.0","@xiaohk/utils":"^0.0.6","d3-format":"^3.1.0","d3-time-format":"^4.1.0",diff:"^5.1.0","diff-match-patch":"^1.0.5","emoji-regex":"^10.3.0",eslint:"^8.52.0","eslint-config-prettier":"^9.0.0","eslint-plugin-lit":"^1.10.1","eslint-plugin-prettier":"^5.0.1","eslint-plugin-wc":"^2.0.4","gh-pages":"^6.0.0","idb-keyval":"^6.2.1",prettier:"^3.0.3","tippy.js":"^6.3.7",typescript:"^5.2.2",uuid:"^9.0.1",vite:"^4.5.0","vite-plugin-dts":"^3.6.1","vite-plugin-web-components-hmr":"^0.1.3"},Uv={name:Rv,private:!1,version:Bv,type:_v,scripts:zv,dependencies:Hv,devDependencies:jv};var Vv=Object.defineProperty,Gv=Object.getOwnPropertyDescriptor,ee=(n,e,t,r)=>{for(var o=r>1?void 0:r?Gv(e,t):e,i=n.length-1,s;i>=0;i--)(s=n[i])&&(o=(r?s(e,t,o):s(o))||o);return r&&o&&Vv(e,t,o),o};const tc=Lv,nc=Ue.layout.sidebarMenuXOffset;let J=class extends Q{constructor(){super(),this.showSettingWindow=!1,this.loadingActionIndex=null,this.favPrompts=[null,null,null],this.localPrompts=[],this.remotePrompts=[],this.popularTags=[],this.toastMessage="",this.toastType="success",this.lastUpdateSidebarMenuProps=null,this.initData=async()=>{},this.updateSidebarMenu=async({anchor:i,boxPosition:s,editor:a,mode:l,oldText:c,newText:u,summaryCounter:d})=>{if(this.centerPanelElement===void 0||this.popperSidebarBox===void 0){console.error("centerPanelElement is undefined");return}const p=await this.popperSidebarBox,h=p.querySelector("wordflow-sidebar-menu");l&&(h.mode=l),c&&(h.oldText=c),u&&(h.newText=u),d?h.summaryCounter=d:h.summaryCounter=null,this.lastUpdateSidebarMenuProps={anchor:i,boxPosition:s,editor:a,mode:h.mode,oldText:h.oldText,newText:h.newText,summaryCounter:h.summaryCounter};const{view:f}=a,m=f.state.selection.$from,g=f.coordsAtPos(m.pos);await new Promise(H=>{setTimeout(H,0)});const y=p.getBoundingClientRect(),b=window.innerHeight,v=window.scrollY,k=parseInt(window.getComputedStyle(a.options.element).lineHeight),x=5,C=v+y.height/2+x,A=b+v-y.height/2-x,$=g.top+v+k/2,E=Math.min(A,Math.max(C,$));p.style.marginTop=`${E}px`},this.initUserID();const n=i=>{this.localPrompts=i},e=i=>{this.favPrompts=i};this.promptManager=new tp(n,e);const t=i=>{this.remotePrompts=i},r=i=>{this.popularTags=i};this.remotePromptManager=new rp(t,r),this.initDefaultPrompts();const o=i=>{this.userConfig=i};this.userConfigManager=new op(o),localStorage.setItem("has-confirmed-privacy","true")}firstUpdated(){if(this.workflowElement===void 0)throw Error("workflowElement undefined.")}willUpdate(n){}initUserID(){const n=localStorage.getItem("user-id");if(n===null){const e=mn();return localStorage.setItem("user-id",e),e}else return n}initDefaultPrompts(){let n=localStorage.getItem("user-id");if(n===null&&(console.warn("userID is null"),n=this.initUserID()),localStorage.getItem("has-added-default-prompts")===null){for(const[t,r]of tc.entries())r.key=mn(),r.userID=n,r.created=new Date().toISOString(),this.promptManager.addPrompt(r);for(const[t,r]of tc.reverse().slice(0,3).entries())this.promptManager.setFavPrompt(t,r);localStorage.setItem("has-added-default-prompts","true")}}async updateSidebarMenuXPos(n){if(this.centerPanelElement===void 0||this.popperSidebarBox===void 0){console.error("centerPanelElement is undefined");return}const e=await this.popperSidebarBox,t=this.centerPanelElement.getBoundingClientRect(),r=e.querySelector("wordflow-sidebar-menu");if(n==="left"){r.isOnLeft=!0;const o=e.offsetParent.getBoundingClientRect();e.style.left="unset",e.style.right=`${o.width-t.x+nc}px`}else r.isOnLeft=!1,e.style.right="unset",e.style.left=`${t.x+t.width+nc}px`}sidebarMenuFooterButtonClickedHandler(n){this.textEditorElement&&this.textEditorElement.sidebarMenuFooterButtonClickedHandler(n)}floatingMenuToolMouseEnterHandler(){this.textEditorElement&&this.textEditorElement.floatingMenuToolsMouseEnterHandler()}floatingMenuToolsMouseLeaveHandler(){this.textEditorElement&&this.textEditorElement.floatingMenuToolsMouseLeaveHandler()}floatingMenuToolButtonClickHandler(n){if(this.workflowElement===void 0)throw Error("workflowElement is undefined");const e=()=>{if(!this.textEditorElement)return;const[r,o]=n.detail;this.textEditorElement.floatingMenuToolButtonClickHandler(r),this.loadingActionIndex=o};if(localStorage.getItem("has-confirmed-privacy")==="true")e();else{if(!this.privacyDialogComponent)throw Error("privacyDialogComponent is null");this.privacyDialogComponent.show(e)}}textEditorLoadingFinishedHandler(){this.loadingActionIndex=null}promptEditorShareClicked(n){if(!this.toastComponent)throw Error("Toast is undefined.");const e=n.detail.data,t=n.detail.stopLoader,r=()=>{this.remotePromptManager.sharePrompt(e).then(i=>{t(i)})};if(localStorage.getItem("has-confirmed-privacy")==="true")r();else{if(!this.privacyDialogComponent)throw Error("privacyDialogComponent is null");this.privacyDialogComponent.show(r)}}render(){return M` +{{text}}`,tags:[],temperature:.2,userID:"13e5deed-1f15-47fe-aea8-29da794be6fe",userName:"",description:"",icon:"🎓",forkFrom:"",promptRunCount:0,created:"",title:"Improve Academic Writing",outputParsingPattern:".*(.*).*",outputParsingReplacement:"$1",recommendedModels:[],injectionMode:"replace",key:""},{prompt:"You are a great writer. Improve the flow of the following text.",tags:[],temperature:.2,userID:"13e5deed-1f15-47fe-aea8-29da794be6fe",userName:"",description:"",icon:"✍️",forkFrom:"",promptRunCount:0,created:"",title:"Improve Text Flow",outputParsingPattern:"",outputParsingReplacement:"",recommendedModels:[],injectionMode:"replace",key:""}],Rv="wordflow",Bv="0.1.4",_v="module",zv={dev:"vite --port 3000",build:"tsc && vite build","build:github":"tsc && vite build --mode github","deploy:github":`pnpm run build:github && pnpm gh-pages -m "Deploy $(git log '--format=format:%H' main -1)" -d ./dist`,"deploy:vercel":"pnpm run build && cp -r .vercel ./dist/ && vercel ./dist",preview:"vite preview"},Hv={lit:"^3.0.0"},jv={"@floating-ui/dom":"^1.5.3","@tiptap/core":"^2.1.12","@tiptap/extension-bubble-menu":"^2.1.12","@tiptap/extension-document":"^2.1.12","@tiptap/extension-highlight":"^2.1.12","@tiptap/extension-paragraph":"^2.1.12","@tiptap/extension-placeholder":"^2.1.13","@tiptap/extension-text":"^2.1.12","@tiptap/pm":"^2.1.12","@tiptap/starter-kit":"^2.1.12","@types/d3-format":"^3.0.4","@types/d3-time-format":"^4.0.3","@types/diff":"^5.0.7","@types/diff-match-patch":"^1.0.35","@types/emoji-regex":"^9.2.0","@types/uuid":"^9.0.7","@typescript-eslint/eslint-plugin":"^6.9.0","@xiaohk/utils":"^0.0.6","d3-format":"^3.1.0","d3-time-format":"^4.1.0",diff:"^5.1.0","diff-match-patch":"^1.0.5","emoji-regex":"^10.3.0",eslint:"^8.52.0","eslint-config-prettier":"^9.0.0","eslint-plugin-lit":"^1.10.1","eslint-plugin-prettier":"^5.0.1","eslint-plugin-wc":"^2.0.4","gh-pages":"^6.0.0","idb-keyval":"^6.2.1",prettier:"^3.0.3","tippy.js":"^6.3.7",typescript:"^5.2.2",uuid:"^9.0.1",vite:"^4.5.0","vite-plugin-dts":"^3.6.1","vite-plugin-web-components-hmr":"^0.1.3"},Uv={name:Rv,private:!1,version:Bv,type:_v,scripts:zv,dependencies:Hv,devDependencies:jv};var Vv=Object.defineProperty,Gv=Object.getOwnPropertyDescriptor,ee=(n,e,t,r)=>{for(var o=r>1?void 0:r?Gv(e,t):e,i=n.length-1,s;i>=0;i--)(s=n[i])&&(o=(r?s(e,t,o):s(o))||o);return r&&o&&Vv(e,t,o),o};const tc=Lv,nc=Ue.layout.sidebarMenuXOffset;let J=class extends Q{constructor(){super(),this.showSettingWindow=!1,this.loadingActionIndex=null,this.favPrompts=[null,null,null],this.localPrompts=[],this.remotePrompts=[],this.popularTags=[],this.toastMessage="",this.toastType="success",this.lastUpdateSidebarMenuProps=null,this.initData=async()=>{},this.updateSidebarMenu=async({anchor:i,boxPosition:s,editor:a,mode:l,oldText:c,newText:u,summaryCounter:d})=>{if(this.centerPanelElement===void 0||this.popperSidebarBox===void 0){console.error("centerPanelElement is undefined");return}const p=await this.popperSidebarBox,h=p.querySelector("wordflow-sidebar-menu");l&&(h.mode=l),c&&(h.oldText=c),u&&(h.newText=u),d?h.summaryCounter=d:h.summaryCounter=null,this.lastUpdateSidebarMenuProps={anchor:i,boxPosition:s,editor:a,mode:h.mode,oldText:h.oldText,newText:h.newText,summaryCounter:h.summaryCounter};const{view:f}=a,m=f.state.selection.$from,g=f.coordsAtPos(m.pos);await new Promise(H=>{setTimeout(H,0)});const y=p.getBoundingClientRect(),b=window.innerHeight,v=window.scrollY,k=parseInt(window.getComputedStyle(a.options.element).lineHeight),x=5,C=v+y.height/2+x,A=b+v-y.height/2-x,$=g.top+v+k/2,E=Math.min(A,Math.max(C,$));p.style.marginTop=`${E}px`},this.initUserID();const n=i=>{this.localPrompts=i},e=i=>{this.favPrompts=i};this.promptManager=new tp(n,e);const t=i=>{this.remotePrompts=i},r=i=>{this.popularTags=i};this.remotePromptManager=new rp(t,r),this.initDefaultPrompts();const o=i=>{this.userConfig=i};this.userConfigManager=new op(o),localStorage.setItem("has-confirmed-privacy","true")}firstUpdated(){if(this.workflowElement===void 0)throw Error("workflowElement undefined.")}willUpdate(n){}initUserID(){const n=localStorage.getItem("user-id");if(n===null){const e=mn();return localStorage.setItem("user-id",e),e}else return n}initDefaultPrompts(){let n=localStorage.getItem("user-id");if(n===null&&(console.warn("userID is null"),n=this.initUserID()),localStorage.getItem("has-added-default-prompts")===null){for(const[t,r]of tc.entries())r.key=mn(),r.userID=n,r.created=new Date().toISOString(),this.promptManager.addPrompt(r);for(const[t,r]of tc.reverse().slice(0,3).entries())this.promptManager.setFavPrompt(t,r);localStorage.setItem("has-added-default-prompts","true")}}async updateSidebarMenuXPos(n){if(this.centerPanelElement===void 0||this.popperSidebarBox===void 0){console.error("centerPanelElement is undefined");return}const e=await this.popperSidebarBox,t=this.centerPanelElement.getBoundingClientRect(),r=e.querySelector("wordflow-sidebar-menu");if(n==="left"){r.isOnLeft=!0;const o=e.offsetParent.getBoundingClientRect();e.style.left="unset",e.style.right=`${o.width-t.x+nc}px`}else r.isOnLeft=!1,e.style.right="unset",e.style.left=`${t.x+t.width+nc}px`}sidebarMenuFooterButtonClickedHandler(n){this.textEditorElement&&this.textEditorElement.sidebarMenuFooterButtonClickedHandler(n)}floatingMenuToolMouseEnterHandler(){this.textEditorElement&&this.textEditorElement.floatingMenuToolsMouseEnterHandler()}floatingMenuToolsMouseLeaveHandler(){this.textEditorElement&&this.textEditorElement.floatingMenuToolsMouseLeaveHandler()}floatingMenuToolButtonClickHandler(n){if(this.workflowElement===void 0)throw Error("workflowElement is undefined");const e=()=>{if(!this.textEditorElement)return;const[r,o]=n.detail;this.textEditorElement.floatingMenuToolButtonClickHandler(r),this.loadingActionIndex=o};if(localStorage.getItem("has-confirmed-privacy")==="true")e();else{if(!this.privacyDialogComponent)throw Error("privacyDialogComponent is null");this.privacyDialogComponent.show(e)}}textEditorLoadingFinishedHandler(){this.loadingActionIndex=null}promptEditorShareClicked(n){if(!this.toastComponent)throw Error("Toast is undefined.");const e=n.detail.data,t=n.detail.stopLoader,r=()=>{this.remotePromptManager.sharePrompt(e).then(i=>{t(i)})};if(localStorage.getItem("has-confirmed-privacy")==="true")r();else{if(!this.privacyDialogComponent)throw Error("privacyDialogComponent is null");this.privacyDialogComponent.show(r)}}render(){return M`
- +