refactoring routing and webpages
This commit is contained in:
parent
f01cd1ee71
commit
f45008f80e
160 changed files with 64 additions and 67 deletions
|
|
@ -4,9 +4,9 @@
|
|||
"version": "0.0.0",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build --base=/assets/suppliers_portal/frontend/ && yarn copy-html-entry",
|
||||
"build": "vite build --base=/assets/suppliers_portal/supplier-portal/ && yarn copy-html-entry",
|
||||
"preview": "vite preview",
|
||||
"copy-html-entry": "cp ../suppliers_portal/public/frontend/index.html ../suppliers_portal/www/frontend.html"
|
||||
"copy-html-entry": "cp ../suppliers_portal/public/supplier-portal/index.html ../suppliers_portal/www/supplier-portal.html"
|
||||
},
|
||||
"dependencies": {
|
||||
"bootstrap": "5.2.3",
|
||||
|
Before Width: | Height: | Size: 440 B After Width: | Height: | Size: 440 B |
|
|
@ -27,7 +27,7 @@ const routes = [
|
|||
]
|
||||
|
||||
let router = createRouter({
|
||||
history: createWebHistory('/frontend'),
|
||||
history: createWebHistory('/supplier-portal'),
|
||||
routes,
|
||||
})
|
||||
|
||||
|
|
@ -39,6 +39,10 @@ router.beforeEach(async (to, from, next) => {
|
|||
isLoggedIn = false
|
||||
}
|
||||
|
||||
console.log('isLoggedIn', isLoggedIn)
|
||||
console.log('to', to)
|
||||
console.log('from', from)
|
||||
|
||||
if (to.name === 'Login' && isLoggedIn) {
|
||||
next({ name: 'SupplierInvoiceList' })
|
||||
} else if (to.name !== 'Login' && !isLoggedIn) {
|
||||
|
|
@ -12,7 +12,7 @@ export default defineConfig({
|
|||
},
|
||||
},
|
||||
build: {
|
||||
outDir: `../${path.basename(path.resolve('..'))}/public/frontend`,
|
||||
outDir: `../${path.basename(path.resolve('..'))}/public/supplier-portal`,
|
||||
emptyOutDir: true,
|
||||
target: 'es2015',
|
||||
},
|
||||
|
|
@ -244,13 +244,6 @@ app_license = "mit"
|
|||
|
||||
|
||||
website_route_rules = [
|
||||
{"from_route": "/erpnext", "to_route": "/login"},
|
||||
{"from_route": "/frontend/<path:app_path>", "to_route": "frontend"},
|
||||
{"from_route": "/supplier-portal", "to_route": "frontend"},
|
||||
{"from_route": "/supplier-portal/<path:app_path>", "to_route": "frontend"},
|
||||
]
|
||||
|
||||
|
||||
website_redirects = [
|
||||
{"source": "/supplier-portal", "target": "frontend"},
|
||||
{"from_route": "/supplier-portal/<path:app_path>", "to_route": "supplier-portal"},
|
||||
{"from_route": "/erpnext", "to_route": "/app"},
|
||||
]
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1 +0,0 @@
|
|||
var h=(e,s,i)=>new Promise((n,r)=>{var t=u=>{try{l(i.next(u))}catch(g){r(g)}},c=u=>{try{l(i.throw(u))}catch(g){r(g)}},l=u=>u.done?n(u.value):Promise.resolve(u.value).then(t,c);l((i=i.apply(e,s)).next())});import{c as m,r as L,a as k,b as I,d as S,_ as y,e as E,f as P,g as b,o as C,h as R,s as T,i as w,j as $,C as U,I as j,k as O}from"./vendor.3e69a9be.js";const A=function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))n(r);new MutationObserver(r=>{for(const t of r)if(t.type==="childList")for(const c of t.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&n(c)}).observe(document,{childList:!0,subtree:!0});function i(r){const t={};return r.integrity&&(t.integrity=r.integrity),r.referrerpolicy&&(t.referrerPolicy=r.referrerpolicy),r.crossorigin==="use-credentials"?t.credentials="include":r.crossorigin==="anonymous"?t.credentials="omit":t.credentials="same-origin",t}function n(r){if(r.ep)return;r.ep=!0;const t=i(r);fetch(r.href,t)}};A();const x="modulepreload",v={},N="/assets/suppliers_portal/frontend/",d=function(s,i){return!i||i.length===0?s():Promise.all(i.map(n=>{if(n=`${N}${n}`,n in v)return;v[n]=!0;const r=n.endsWith(".css"),t=r?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${n}"]${t}`))return;const c=document.createElement("link");if(c.rel=r?"stylesheet":x,r||(c.as="script",c.crossOrigin=""),c.href=n,document.head.appendChild(c),r)return new Promise((l,u)=>{c.addEventListener("load",l),c.addEventListener("error",u)})})).then(()=>s())},_=m({url:"frappe.auth.get_logged_user",cache:"User",onError(e){e&&e.exc_type==="AuthenticationError"&&p.push({name:"LoginPage"})}});function f(){let s=new URLSearchParams(document.cookie.split("; ").join("&")).get("user_id");return s==="Guest"&&(s=null),s}function V(){return new URLSearchParams(document.cookie.split("; ").join("&")).get("supplier_id")}function D(){return new URLSearchParams(document.cookie.split("; ").join("&")).get("supplier_name")}const o=L({supplier_login:m({url:"suppliers_portal.suppliers_portal.api.validate_supplier_id",makeParams({supplier_id:e}){return{supplier_id:e}},onSuccess(e){e&&e.status==="success"&&(_.reload(),o.user=f(),document.cookie=`supplier_id=${e.supplier_id}`,document.cookie=`supplier_name=${e.supplier_name}`,o.supplier_id=e.supplier_id,o.supplier_name=e.supplier_name,o.login.reset(),p.replace({name:"SupplierInvoiceList"}))},onError(e){console.error("Login failed",e)}}),login:m({url:"login",makeParams({email:e,password:s}){return{usr:e,pwd:s}},onSuccess(e){e&&(_.reload(),o.user=f(),document.cookie=`supplier_id=${o.supplier_id}; expires=Thu, 01 Jan 1970 00:00:00 UTC'`,document.cookie=`supplier_id=${o.supplier_name}; expires=Thu, 01 Jan 1970 00:00:00 UTC'`,o.supplier_id="",o.supplier_name="",o.login.reset(),p.replace({name:"SupplierInvoiceList"}))},onError(e){console.error("Login failed",e)}}),logout:m({url:"logout",onSuccess(){document.cookie=`supplier_id=${o.supplier_id}; expires=Thu, 01 Jan 1970 00:00:00 UTC'`,document.cookie=`supplier_id=${o.supplier_name}; expires=Thu, 01 Jan 1970 00:00:00 UTC'`,o.supplier_id="",o.supplier_name="",_.reset(),o.user=f(),p.replace({name:"Login"})}}),user:f(),supplier_id:V(),supplier_name:D(),isLoggedIn:k(()=>!!o.user)}),J=[{name:"Login",path:"/login",component:()=>d(()=>import("./Login.80913e45.js"),["assets/Login.80913e45.js","assets/vendor.3e69a9be.js","assets/vendor.43acabc4.css"])},{name:"SupplierInvoiceList",path:"/",component:()=>d(()=>import("./SupplierInvoiceList.55bab896.js"),["assets/SupplierInvoiceList.55bab896.js","assets/SupplierInvoiceList.e8de1e21.css","assets/vendor.3e69a9be.js","assets/vendor.43acabc4.css"])},{name:"SupplierInvoice",path:"/invoices/:supplierInvoiceNumber",component:()=>d(()=>import("./SupplierInvoice.beb0f4cf.js"),["assets/SupplierInvoice.beb0f4cf.js","assets/SupplierInvoice.9dfb3ca8.css","assets/vendor.3e69a9be.js","assets/vendor.43acabc4.css"]),props:!0},{name:"SupplierInvoiceCreate",path:"/invoices/new",component:()=>d(()=>import("./NewInvoice.1228f5fc.js"),["assets/NewInvoice.1228f5fc.js","assets/NewInvoice.67c196f0.css","assets/vendor.3e69a9be.js","assets/vendor.43acabc4.css"])}];let p=I({history:S("/frontend"),routes:J});p.beforeEach((e,s,i)=>h(void 0,null,function*(){let n=o.isLoggedIn;try{yield _.promise}catch(r){n=!1}e.name==="Login"&&n?i({name:"SupplierInvoiceList"}):e.name!=="Login"&&!n?i({name:"Login"}):i()}));const q={};function B(e,s){const i=b("router-view");return C(),E("div",null,[P(i)])}var F=y(q,[["render",B]]);let a=R(F);T("resourceFetcher",O);a.use(p);a.use(w);a.component("Button",$);a.component("Card",U);a.component("Input",j);a.mount("#app");export{f as a,V as b,D as c,p as r,o as s};
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" href="/assets/suppliers_portal/frontend/favicon.png" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Supplier Portal</title>
|
||||
<script type="module" crossorigin src="/assets/suppliers_portal/frontend/assets/index.c142ad70.js"></script>
|
||||
<link rel="modulepreload" href="/assets/suppliers_portal/frontend/assets/vendor.3e69a9be.js">
|
||||
<link rel="stylesheet" href="/assets/suppliers_portal/frontend/assets/vendor.43acabc4.css">
|
||||
<link rel="stylesheet" href="/assets/suppliers_portal/frontend/assets/index.ab6c1a8e.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<div id="modals"></div>
|
||||
<div id="popovers"></div>
|
||||
|
||||
<script> window.csrf_token = '{{ csrf_token }}'; </script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1 +1 @@
|
|||
import{_ as x,R as g,S as _,N as l,w as r,g as d,o,T as p,U as C,V as b,m as a,e as c,z as u,W as m,F as h,G as k}from"./vendor.3e69a9be.js";const v={name:"FontColor",props:["editor"],components:{Popover:g,Tooltip:_},methods:{setBackgroundColor(t){t.name!="Default"?this.editor.chain().focus().toggleHighlight({color:t.hex}).run():this.editor.chain().focus().unsetHighlight().run()},setForegroundColor(t){t.name!="Default"?this.editor.chain().focus().setColor(t.hex).run():this.editor.chain().focus().unsetColor().run()}},computed:{foregroundColors(){return[{name:"Default",hex:"#1F272E"},{name:"Yellow",hex:"#ca8a04"},{name:"Orange",hex:"#ea580c"},{name:"Red",hex:"#dc2626"},{name:"Green",hex:"#16a34a"},{name:"Blue",hex:"#1579D0"},{name:"Purple",hex:"#9333ea"},{name:"Pink",hex:"#db2777"}]},backgroundColors(){return[{name:"Default",hex:null},{name:"Yellow",hex:"#fef9c3"},{name:"Orange",hex:"#ffedd5"},{name:"Red",hex:"#fee2e2"},{name:"Green",hex:"#dcfce7"},{name:"Blue",hex:"#D3E9FC"},{name:"Purple",hex:"#f3e8ff"},{name:"Pink",hex:"#fce7f3"}]}}},y={class:"p-2"},B=a("div",{class:"text-sm text-gray-700"},"Text Color",-1),P={class:"mt-1 grid grid-cols-8 gap-1"},F=["aria-label","onClick"],w=a("div",{class:"mt-2 text-sm text-gray-700"},"Background Color",-1),D={class:"mt-1 grid grid-cols-8 gap-1"},T=["aria-label","onClick"];function z(t,R,$,j,A,n){const i=d("Tooltip"),f=d("Popover");return o(),l(f,{transition:"default"},{target:r(({togglePopover:e,isOpen:s})=>[p(t.$slots,"default",C(b({onClick:()=>e(),isActive:s})))]),"body-main":r(()=>[a("div",y,[B,a("div",P,[(o(!0),c(h,null,u(n.foregroundColors,e=>(o(),l(i,{class:"flex",key:e.name,text:e.name},{default:r(()=>[a("button",{"aria-label":e.name,class:"flex h-5 w-5 items-center justify-center rounded border text-base",style:m({color:e.hex}),onClick:s=>n.setForegroundColor(e)}," A ",12,F)]),_:2},1032,["text"]))),128))]),w,a("div",D,[(o(!0),c(h,null,u(n.backgroundColors,e=>(o(),l(i,{class:"flex",key:e.name,text:e.name},{default:r(()=>[a("button",{"aria-label":e.name,class:k(["flex h-5 w-5 items-center justify-center rounded border text-base text-gray-900",e.hex?"border-transparent":"border-gray-200"]),style:m({backgroundColor:e.hex}),onClick:s=>n.setBackgroundColor(e)}," A ",14,T)]),_:2},1032,["text"]))),128))])])]),_:3})}var G=x(v,[["render",z]]);export{G as default};
|
||||
import{_ as x,R as g,S as _,N as l,w as r,g as c,o,T as p,U as C,V as k,m as a,e as d,z as u,W as m,F as h,G as b}from"./vendor.99304cc5.js";const v={name:"FontColor",props:["editor"],components:{Popover:g,Tooltip:_},methods:{setBackgroundColor(t){t.name!="Default"?this.editor.chain().focus().toggleHighlight({color:t.hex}).run():this.editor.chain().focus().unsetHighlight().run()},setForegroundColor(t){t.name!="Default"?this.editor.chain().focus().setColor(t.hex).run():this.editor.chain().focus().unsetColor().run()}},computed:{foregroundColors(){return[{name:"Default",hex:"#1F272E"},{name:"Yellow",hex:"#ca8a04"},{name:"Orange",hex:"#ea580c"},{name:"Red",hex:"#dc2626"},{name:"Green",hex:"#16a34a"},{name:"Blue",hex:"#1579D0"},{name:"Purple",hex:"#9333ea"},{name:"Pink",hex:"#db2777"}]},backgroundColors(){return[{name:"Default",hex:null},{name:"Yellow",hex:"#fef9c3"},{name:"Orange",hex:"#ffedd5"},{name:"Red",hex:"#fee2e2"},{name:"Green",hex:"#dcfce7"},{name:"Blue",hex:"#D3E9FC"},{name:"Purple",hex:"#f3e8ff"},{name:"Pink",hex:"#fce7f3"}]}}},y={class:"p-2"},B=a("div",{class:"text-sm text-gray-700"},"Text Color",-1),P={class:"mt-1 grid grid-cols-8 gap-1"},F=["aria-label","onClick"],w=a("div",{class:"mt-2 text-sm text-gray-700"},"Background Color",-1),D={class:"mt-1 grid grid-cols-8 gap-1"},T=["aria-label","onClick"];function z(t,R,$,j,A,n){const i=c("Tooltip"),f=c("Popover");return o(),l(f,{transition:"default"},{target:r(({togglePopover:e,isOpen:s})=>[p(t.$slots,"default",C(k({onClick:()=>e(),isActive:s})))]),"body-main":r(()=>[a("div",y,[B,a("div",P,[(o(!0),d(h,null,u(n.foregroundColors,e=>(o(),l(i,{class:"flex",key:e.name,text:e.name},{default:r(()=>[a("button",{"aria-label":e.name,class:"flex h-5 w-5 items-center justify-center rounded border text-base",style:m({color:e.hex}),onClick:s=>n.setForegroundColor(e)}," A ",12,F)]),_:2},1032,["text"]))),128))]),w,a("div",D,[(o(!0),d(h,null,u(n.backgroundColors,e=>(o(),l(i,{class:"flex",key:e.name,text:e.name},{default:r(()=>[a("button",{"aria-label":e.name,class:b(["flex h-5 w-5 items-center justify-center rounded border text-base text-gray-900",e.hex?"border-transparent":"border-gray-200"]),style:m({backgroundColor:e.hex}),onClick:s=>n.setBackgroundColor(e)}," A ",14,T)]),_:2},1032,["text"]))),128))])])]),_:3})}var G=x(v,[["render",z]]);export{G as default};
|
||||
|
|
@ -1 +1 @@
|
|||
import{_ as f,j as I,Y as _,$ as h,e as g,T as D,U as v,V as y,f as n,w as l,F as w,g as m,o as c,m as i,t as C,p as b,v as u}from"./vendor.3e69a9be.js";const V={name:"InsertImage",props:["editor"],expose:["openDialog"],data(){return{addImageDialog:{url:"",file:null,show:!1}}},components:{Button:I,Dialog:_},methods:{openDialog(){this.addImageDialog.show=!0},onImageSelect(t){let e=t.target.files[0];!e||(this.addImageDialog.file=e,h(e).then(r=>{this.addImageDialog.url=r}))},addImage(t){this.editor.chain().focus().setImage({src:t}).run(),this.reset()},reset(){this.addImageDialog=this.$options.data().addImageDialog}}},k={class:"relative cursor-pointer rounded-lg bg-gray-100 py-1 focus-within:bg-gray-200 hover:bg-gray-200"},x={class:"absolute inset-0 select-none px-2 py-1 text-base"},B=["src"],S=u(" Insert Image "),N=u(" Cancel ");function A(t,e,r,T,a,o){const d=m("Button"),p=m("Dialog");return c(),g(w,null,[D(t.$slots,"default",v(y({onClick:o.openDialog}))),n(p,{options:{title:"Add Image"},modelValue:a.addImageDialog.show,"onUpdate:modelValue":e[2]||(e[2]=s=>a.addImageDialog.show=s),onAfterLeave:o.reset},{"body-content":l(()=>[i("label",k,[i("input",{type:"file",class:"w-full opacity-0",onChange:e[0]||(e[0]=(...s)=>o.onImageSelect&&o.onImageSelect(...s)),accept:"image/*"},null,32),i("span",x,C(a.addImageDialog.file?"Select another image":"Select an image"),1)]),a.addImageDialog.url?(c(),g("img",{key:0,src:a.addImageDialog.url,class:"mt-2 w-full rounded-lg"},null,8,B)):b("",!0)]),actions:l(()=>[n(d,{variant:"solid",onClick:e[1]||(e[1]=s=>o.addImage(a.addImageDialog.url))},{default:l(()=>[S]),_:1}),n(d,{onClick:o.reset},{default:l(()=>[N]),_:1},8,["onClick"])]),_:1},8,["modelValue","onAfterLeave"])],64)}var F=f(V,[["render",A]]);export{F as default};
|
||||
import{_ as f,j as I,Y as _,$ as h,e as g,T as D,U as v,V as y,f as n,w as l,F as w,g as m,o as c,m as i,t as C,p as V,v as u}from"./vendor.99304cc5.js";const b={name:"InsertImage",props:["editor"],expose:["openDialog"],data(){return{addImageDialog:{url:"",file:null,show:!1}}},components:{Button:I,Dialog:_},methods:{openDialog(){this.addImageDialog.show=!0},onImageSelect(t){let e=t.target.files[0];!e||(this.addImageDialog.file=e,h(e).then(r=>{this.addImageDialog.url=r}))},addImage(t){this.editor.chain().focus().setImage({src:t}).run(),this.reset()},reset(){this.addImageDialog=this.$options.data().addImageDialog}}},k={class:"relative cursor-pointer rounded-lg bg-gray-100 py-1 focus-within:bg-gray-200 hover:bg-gray-200"},x={class:"absolute inset-0 select-none px-2 py-1 text-base"},B=["src"],S=u(" Insert Image "),N=u(" Cancel ");function A(t,e,r,T,a,o){const d=m("Button"),p=m("Dialog");return c(),g(w,null,[D(t.$slots,"default",v(y({onClick:o.openDialog}))),n(p,{options:{title:"Add Image"},modelValue:a.addImageDialog.show,"onUpdate:modelValue":e[2]||(e[2]=s=>a.addImageDialog.show=s),onAfterLeave:o.reset},{"body-content":l(()=>[i("label",k,[i("input",{type:"file",class:"w-full opacity-0",onChange:e[0]||(e[0]=(...s)=>o.onImageSelect&&o.onImageSelect(...s)),accept:"image/*"},null,32),i("span",x,C(a.addImageDialog.file?"Select another image":"Select an image"),1)]),a.addImageDialog.url?(c(),g("img",{key:0,src:a.addImageDialog.url,class:"mt-2 w-full rounded-lg"},null,8,B)):V("",!0)]),actions:l(()=>[n(d,{variant:"solid",onClick:e[1]||(e[1]=s=>o.addImage(a.addImageDialog.url))},{default:l(()=>[S]),_:1}),n(d,{onClick:o.reset},{default:l(()=>[N]),_:1},8,["onClick"])]),_:1},8,["modelValue","onAfterLeave"])],64)}var F=f(b,[["render",A]]);export{F as default};
|
||||
|
|
@ -1 +1 @@
|
|||
import{_ as d,j as g,X as m,Y as L,e as f,T as p,U as D,V as c,f as i,w as l,F as h,g as a,o as _,Z as v,v as w}from"./vendor.3e69a9be.js";const V={name:"InsertLink",props:["editor"],components:{Button:g,FormControl:m,Dialog:L},data(){return{setLinkDialog:{url:"",show:!1}}},methods:{openDialog(){let t=this.editor.getAttributes("link").href;t&&(this.setLinkDialog.url=t),this.setLinkDialog.show=!0},setLink(t){t===""?this.editor.chain().focus().extendMarkRange("link").unsetLink().run():this.editor.chain().focus().extendMarkRange("link").setLink({href:t}).run(),this.setLinkDialog.show=!1,this.setLinkDialog.url=""},reset(){this.setLinkDialog=this.$options.data().setLinkDialog}}},x=w(" Save ");function C(t,e,B,F,n,s){const r=a("FormControl"),u=a("Button"),k=a("Dialog");return _(),f(h,null,[p(t.$slots,"default",D(c({onClick:s.openDialog}))),i(k,{options:{title:"Set Link"},modelValue:n.setLinkDialog.show,"onUpdate:modelValue":e[3]||(e[3]=o=>n.setLinkDialog.show=o),onAfterLeave:s.reset},{"body-content":l(()=>[i(r,{type:"text",label:"URL",modelValue:n.setLinkDialog.url,"onUpdate:modelValue":e[0]||(e[0]=o=>n.setLinkDialog.url=o),onKeydown:e[1]||(e[1]=v(o=>s.setLink(o.target.value),["enter"]))},null,8,["modelValue"])]),actions:l(()=>[i(u,{variant:"solid",onClick:e[2]||(e[2]=o=>s.setLink(n.setLinkDialog.url))},{default:l(()=>[x]),_:1})]),_:1},8,["modelValue","onAfterLeave"])],64)}var U=d(V,[["render",C]]);export{U as default};
|
||||
import{_ as d,j as g,X as m,Y as L,e as f,T as p,U as c,V as D,f as i,w as l,F as h,g as a,o as _,Z as v,v as w}from"./vendor.99304cc5.js";const V={name:"InsertLink",props:["editor"],components:{Button:g,FormControl:m,Dialog:L},data(){return{setLinkDialog:{url:"",show:!1}}},methods:{openDialog(){let t=this.editor.getAttributes("link").href;t&&(this.setLinkDialog.url=t),this.setLinkDialog.show=!0},setLink(t){t===""?this.editor.chain().focus().extendMarkRange("link").unsetLink().run():this.editor.chain().focus().extendMarkRange("link").setLink({href:t}).run(),this.setLinkDialog.show=!1,this.setLinkDialog.url=""},reset(){this.setLinkDialog=this.$options.data().setLinkDialog}}},x=w(" Save ");function C(t,e,B,F,n,s){const r=a("FormControl"),u=a("Button"),k=a("Dialog");return _(),f(h,null,[p(t.$slots,"default",c(D({onClick:s.openDialog}))),i(k,{options:{title:"Set Link"},modelValue:n.setLinkDialog.show,"onUpdate:modelValue":e[3]||(e[3]=o=>n.setLinkDialog.show=o),onAfterLeave:s.reset},{"body-content":l(()=>[i(r,{type:"text",label:"URL",modelValue:n.setLinkDialog.url,"onUpdate:modelValue":e[0]||(e[0]=o=>n.setLinkDialog.url=o),onKeydown:e[1]||(e[1]=v(o=>s.setLink(o.target.value),["enter"]))},null,8,["modelValue"])]),actions:l(()=>[i(u,{variant:"solid",onClick:e[2]||(e[2]=o=>s.setLink(n.setLinkDialog.url))},{default:l(()=>[x]),_:1})]),_:1},8,["modelValue","onAfterLeave"])],64)}var U=d(V,[["render",C]]);export{U as default};
|
||||
|
|
@ -1 +1 @@
|
|||
import{_ as D,j as v,Y as h,a0 as C,e as u,T as k,U as w,V as x,f as t,w as i,F as B,g as r,o as c,m as U,v as n,t as y,N as F,p}from"./vendor.3e69a9be.js";const N={name:"InsertImage",props:["editor"],expose:["openDialog"],data(){return{addVideoDialog:{url:"",file:null,show:!1}}},components:{Button:v,Dialog:h,FileUploader:C},methods:{openDialog(){this.addVideoDialog.show=!0},onVideoSelect(l){let o=l.target.files[0];!o||(this.addVideoDialog.file=o)},addVideo(l){this.editor.chain().focus().insertContent(`<video src="${l}"></video>`).run(),this.reset()},reset(){this.addVideoDialog=this.$options.data().addVideoDialog}}},I={class:"flex items-center space-x-2"},S=n(" Remove "),A=["src"],b=n(" Insert Video "),j=n("Cancel");function L(l,o,P,R,e,a){const s=r("Button"),V=r("FileUploader"),g=r("Dialog");return c(),u(B,null,[k(l.$slots,"default",w(x({onClick:a.openDialog}))),t(g,{options:{title:"Add Video"},modelValue:e.addVideoDialog.show,"onUpdate:modelValue":o[2]||(o[2]=d=>e.addVideoDialog.show=d),onAfterLeave:a.reset},{"body-content":i(()=>[t(V,{"file-types":"video/*",onSuccess:o[0]||(o[0]=d=>e.addVideoDialog.url=d.file_url)},{default:i(({file:d,progress:f,uploading:_,openFileSelector:m})=>[U("div",I,[t(s,{onClick:m},{default:i(()=>[n(y(_?`Uploading ${f}%`:e.addVideoDialog.url?"Change Video":"Upload Video"),1)]),_:2},1032,["onClick"]),e.addVideoDialog.url?(c(),F(s,{key:0,onClick:()=>{e.addVideoDialog.url=null,e.addVideoDialog.file=null}},{default:i(()=>[S]),_:2},1032,["onClick"])):p("",!0)])]),_:1}),e.addVideoDialog.url?(c(),u("video",{key:0,src:e.addVideoDialog.url,class:"mt-2 w-full rounded-lg",type:"video/mp4",controls:""},null,8,A)):p("",!0)]),actions:i(()=>[t(s,{variant:"solid",onClick:o[1]||(o[1]=d=>a.addVideo(e.addVideoDialog.url))},{default:i(()=>[b]),_:1}),t(s,{onClick:a.reset},{default:i(()=>[j]),_:1},8,["onClick"])]),_:1},8,["modelValue","onAfterLeave"])],64)}var z=D(N,[["render",L]]);export{z as default};
|
||||
import{_ as D,j as v,Y as h,a0 as C,e as u,T as k,U as w,V as x,f as t,w as i,F as B,g as r,o as c,m as U,v as n,t as y,N as F,p}from"./vendor.99304cc5.js";const N={name:"InsertImage",props:["editor"],expose:["openDialog"],data(){return{addVideoDialog:{url:"",file:null,show:!1}}},components:{Button:v,Dialog:h,FileUploader:C},methods:{openDialog(){this.addVideoDialog.show=!0},onVideoSelect(l){let o=l.target.files[0];!o||(this.addVideoDialog.file=o)},addVideo(l){this.editor.chain().focus().insertContent(`<video src="${l}"></video>`).run(),this.reset()},reset(){this.addVideoDialog=this.$options.data().addVideoDialog}}},I={class:"flex items-center space-x-2"},S=n(" Remove "),A=["src"],j=n(" Insert Video "),L=n("Cancel");function P(l,o,R,T,e,s){const a=r("Button"),V=r("FileUploader"),g=r("Dialog");return c(),u(B,null,[k(l.$slots,"default",w(x({onClick:s.openDialog}))),t(g,{options:{title:"Add Video"},modelValue:e.addVideoDialog.show,"onUpdate:modelValue":o[2]||(o[2]=d=>e.addVideoDialog.show=d),onAfterLeave:s.reset},{"body-content":i(()=>[t(V,{"file-types":"video/*",onSuccess:o[0]||(o[0]=d=>e.addVideoDialog.url=d.file_url)},{default:i(({file:d,progress:f,uploading:_,openFileSelector:m})=>[U("div",I,[t(a,{onClick:m},{default:i(()=>[n(y(_?`Uploading ${f}%`:e.addVideoDialog.url?"Change Video":"Upload Video"),1)]),_:2},1032,["onClick"]),e.addVideoDialog.url?(c(),F(a,{key:0,onClick:()=>{e.addVideoDialog.url=null,e.addVideoDialog.file=null}},{default:i(()=>[S]),_:2},1032,["onClick"])):p("",!0)])]),_:1}),e.addVideoDialog.url?(c(),u("video",{key:0,src:e.addVideoDialog.url,class:"mt-2 w-full rounded-lg",type:"video/mp4",controls:""},null,8,A)):p("",!0)]),actions:i(()=>[t(a,{variant:"solid",onClick:o[1]||(o[1]=d=>s.addVideo(e.addVideoDialog.url))},{default:i(()=>[j]),_:1}),t(a,{onClick:s.reset},{default:i(()=>[L]),_:1},8,["onClick"])]),_:1},8,["modelValue","onAfterLeave"])],64)}var z=D(N,[["render",P]]);export{z as default};
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue