@m2s2/vue-lib 2.1.0 → 2.3.0
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/dist/index.cjs +1 -1
- package/dist/index.mjs +28 -22
- package/dist/index16.cjs +1 -1
- package/dist/index16.mjs +1 -1
- package/dist/index26.cjs +6 -1
- package/dist/index26.mjs +271 -77
- package/dist/index28.cjs +1 -1
- package/dist/index28.mjs +78 -101
- package/dist/index30.cjs +1 -1
- package/dist/index30.mjs +101 -63
- package/dist/index32.cjs +1 -1
- package/dist/index32.mjs +52 -65
- package/dist/index34.cjs +1 -1
- package/dist/index34.mjs +85 -3
- package/dist/index36.cjs +1 -1
- package/dist/index36.mjs +26 -3
- package/dist/index38.cjs +1 -1
- package/dist/index38.mjs +2 -2
- package/dist/index39.cjs +1 -1
- package/dist/index39.mjs +2 -2
- package/dist/index40.cjs +1 -1
- package/dist/index40.mjs +2 -2
- package/dist/index41.cjs +1 -1
- package/dist/index41.mjs +2 -2
- package/dist/index42.cjs +1 -1
- package/dist/index42.mjs +1 -1
- package/dist/index43.cjs +1 -1
- package/dist/index43.mjs +1 -1
- package/dist/index44.cjs +1 -1
- package/dist/index44.mjs +1 -1
- package/dist/index45.cjs +1 -1
- package/dist/index45.mjs +1 -1
- package/dist/index46.cjs +1 -1
- package/dist/index46.mjs +1 -1
- package/dist/index47.cjs +1 -1
- package/dist/index47.mjs +1 -1
- package/dist/index48.cjs +1 -1
- package/dist/index48.mjs +1 -1
- package/dist/index49.cjs +1 -1
- package/dist/index49.mjs +1 -1
- package/dist/index50.cjs +1 -1
- package/dist/index50.mjs +3 -51
- package/dist/index51.cjs +1 -1
- package/dist/index51.mjs +3 -2
- package/dist/index52.cjs +1 -0
- package/dist/index52.mjs +5 -0
- package/dist/index53.cjs +1 -0
- package/dist/index53.mjs +5 -0
- package/dist/index54.cjs +1 -0
- package/dist/index54.mjs +5 -0
- package/dist/index55.cjs +1 -0
- package/dist/index55.mjs +5 -0
- package/dist/index56.cjs +59 -0
- package/dist/index56.mjs +1152 -0
- package/dist/index57.cjs +1 -0
- package/dist/index57.mjs +53 -0
- package/dist/index58.cjs +1 -0
- package/dist/index58.mjs +4 -0
- package/dist/vue-lib/src/components/BlogEditor/BlogEditor.vue.d.ts +16 -0
- package/dist/vue-lib/src/components/BlogEditor/BlogEditor.vue.d.ts.map +1 -0
- package/dist/vue-lib/src/components/LoadingButton/LoadingButton.vue.d.ts +19 -0
- package/dist/vue-lib/src/components/LoadingButton/LoadingButton.vue.d.ts.map +1 -0
- package/dist/vue-lib/src/index.d.ts +2 -0
- package/dist/vue-lib/src/index.d.ts.map +1 -1
- package/dist/vue-lib.css +1 -1
- package/package.json +8 -5
- package/dist/index35.cjs +0 -1
- package/dist/index35.mjs +0 -5
- package/dist/index37.cjs +0 -1
- package/dist/index37.mjs +0 -5
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index2.cjs");;/* empty css */const r=require("./index4.cjs");;/* empty css */const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index2.cjs");;/* empty css */const r=require("./index4.cjs");;/* empty css */const t=require("./index6.cjs");;/* empty css */const _=require("./index8.cjs");;/* empty css */const u=require("./index10.cjs");;/* empty css */const i=require("./index12.cjs");;/* empty css */const s=require("./index14.cjs");;/* empty css */const a=require("./index16.cjs");;/* empty css */const p=require("./index18.cjs");;/* empty css */const n=require("./index20.cjs");;/* empty css */const o=require("./index22.cjs");;/* empty css */const c=require("./index24.cjs");;/* empty css */const v=require("./index26.cjs");;/* empty css */const q=require("./index28.cjs");;/* empty css */const g=require("./index30.cjs");;/* empty css */const l=require("./index32.cjs");;/* empty css */const y=require("./index34.cjs");;/* empty css */const d=require("./index36.cjs");;/* empty css */exports.Chat=e;exports.SectionHeader=r;exports.StatRow=t;exports.StatusBadge=_;exports.PageHeader=u;exports.CtaSection=i;exports.ProcessSteps=s;exports.Footer=a;exports.Navbar=p;exports.BaseCard=n;exports.FeatureCard=o;exports.BlogCard=c;exports.BlogEditor=v;exports.DataTable=q;exports.SubscribeForm=g;exports.Dialog=l;exports.Panel=y;exports.LoadingButton=d;
|
package/dist/index.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { default as
|
|
1
|
+
import { default as c } from "./index2.mjs";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import { default as
|
|
3
|
+
import { default as P } from "./index4.mjs";
|
|
4
4
|
/* empty css */
|
|
5
|
-
import { default as
|
|
5
|
+
import { default as H } from "./index6.mjs";
|
|
6
6
|
/* empty css */
|
|
7
|
-
import { default as
|
|
7
|
+
import { default as v } from "./index8.mjs";
|
|
8
8
|
/* empty css */
|
|
9
|
-
import { default as
|
|
9
|
+
import { default as E } from "./index10.mjs";
|
|
10
10
|
/* empty css */
|
|
11
11
|
import { default as N } from "./index12.mjs";
|
|
12
12
|
/* empty css */
|
|
@@ -18,33 +18,39 @@ import { default as y } from "./index18.mjs";
|
|
|
18
18
|
/* empty css */
|
|
19
19
|
import { default as A } from "./index20.mjs";
|
|
20
20
|
/* empty css */
|
|
21
|
-
import { default as
|
|
21
|
+
import { default as I } from "./index22.mjs";
|
|
22
22
|
/* empty css */
|
|
23
|
-
import { default as
|
|
23
|
+
import { default as K } from "./index24.mjs";
|
|
24
24
|
/* empty css */
|
|
25
|
-
import { default as
|
|
25
|
+
import { default as O } from "./index26.mjs";
|
|
26
26
|
/* empty css */
|
|
27
|
-
import { default as
|
|
27
|
+
import { default as U } from "./index28.mjs";
|
|
28
28
|
/* empty css */
|
|
29
|
-
import { default as
|
|
29
|
+
import { default as W } from "./index30.mjs";
|
|
30
30
|
/* empty css */
|
|
31
|
-
import { default as
|
|
31
|
+
import { default as Y } from "./index32.mjs";
|
|
32
|
+
/* empty css */
|
|
33
|
+
import { default as _ } from "./index34.mjs";
|
|
34
|
+
/* empty css */
|
|
35
|
+
import { default as tt } from "./index36.mjs";
|
|
32
36
|
/* empty css */
|
|
33
37
|
export {
|
|
34
38
|
A as BaseCard,
|
|
35
|
-
|
|
36
|
-
|
|
39
|
+
K as BlogCard,
|
|
40
|
+
O as BlogEditor,
|
|
41
|
+
c as Chat,
|
|
37
42
|
N as CtaSection,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
43
|
+
U as DataTable,
|
|
44
|
+
Y as Dialog,
|
|
45
|
+
I as FeatureCard,
|
|
41
46
|
k as Footer,
|
|
47
|
+
tt as LoadingButton,
|
|
42
48
|
y as Navbar,
|
|
43
|
-
|
|
44
|
-
|
|
49
|
+
E as PageHeader,
|
|
50
|
+
_ as Panel,
|
|
45
51
|
T as ProcessSteps,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
52
|
+
P as SectionHeader,
|
|
53
|
+
H as StatRow,
|
|
54
|
+
v as StatusBadge,
|
|
55
|
+
W as SubscribeForm
|
|
50
56
|
};
|
package/dist/index16.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),a=require("./
|
|
1
|
+
"use strict";const e=require("vue"),a=require("./index57.cjs"),n={class:"m2s2-footer"},l={class:"footer-inner"},s={class:"footer-copy"},c={class:"footer-social","aria-label":"Social links"},i=["href","title","aria-label"],_=e.defineComponent({__name:"Footer",props:{config:{}},setup(o){const r=new Date().getFullYear();return(p,u)=>(e.openBlock(),e.createElementBlock("footer",n,[e.createElementVNode("div",l,[e.createElementVNode("span",s," © "+e.toDisplayString(e.unref(r))+" "+e.toDisplayString(o.config.brandName)+" — All Rights Reserved ",1),e.createElementVNode("nav",c,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.config.links,t=>(e.openBlock(),e.createElementBlock("a",e.mergeProps({key:t.type,href:t.href,class:"social-link",title:t.label??t.type,"aria-label":t.label??t.type},{ref_for:!0},t.type!=="email"?{target:"_blank",rel:"noopener noreferrer"}:{}),[e.createVNode(a,{type:t.type},null,8,["type"])],16,i))),128))])])]))}});module.exports=_;
|
package/dist/index16.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as l, openBlock as t, createElementBlock as o, createElementVNode as r, toDisplayString as s, unref as c, Fragment as i, renderList as f, mergeProps as p, createVNode as _ } from "vue";
|
|
2
|
-
import m from "./
|
|
2
|
+
import m from "./index57.mjs";
|
|
3
3
|
const d = { class: "m2s2-footer" }, u = { class: "footer-inner" }, y = { class: "footer-copy" }, h = {
|
|
4
4
|
class: "footer-social",
|
|
5
5
|
"aria-label": "Social links"
|
package/dist/index26.cjs
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),
|
|
1
|
+
"use strict";const e=require("vue"),Q=require("./index56.cjs"),X={class:"be-root"},Y={class:"be-meta"},Z={class:"be-field be-field--full"},ee=["value"],te={class:"be-field"},le={class:"be-field"},ae={class:"be-field be-field--full"},ne={class:"be-field be-field--full"},oe={class:"be-field"},ie={class:"be-tags"},se=["onClick","aria-label"],re={class:"be-field"},ce={class:"be-field be-field--cover"},ue={class:"be-cover"},de=["src"],ve={class:"be-cover__pick"},be={class:"be-editor"},me={class:"be-toolbar",role:"toolbar","aria-label":"Formatting"},pe=["title","onClick"],ge={class:"be-panes"},fe={class:"be-pane be-pane--write"},Ee=["value"],Ve={class:"be-pane be-pane--preview"},Ne=["innerHTML"],_e={class:"be-footer"},xe={class:"be-footer__meta"},ke=["disabled"],we=e.defineComponent({__name:"BlogEditor",props:{initialPost:{},coverImageUrl:{}},emits:["publish","coverImageSelected"],setup(R,{emit:q}){var T,C,I,P,B,D,S,M,U;const n=R,x=q,F=[{label:"Heading 2",icon:"H2",prefix:"## "},{label:"Heading 3",icon:"H3",prefix:"### "},{label:"Bold",icon:"B",wrap:["**","**"]},{label:"Italic",icon:"I",wrap:["*","*"]},{label:"Inline code",icon:"`",wrap:["`","`"]},{label:"Code block",icon:"{ }",block:"\n```\n\n```\n"},{label:"Blockquote",icon:"❝",prefix:"> "},{label:"Link",icon:"⇗",wrap:["[","](url)"]},{label:"Image",icon:"⬚",block:`
|
|
2
|
+
`},{label:"Bullet list",icon:"•–",prefix:"- "},{label:"Numbered list",icon:"1.",prefix:"1. "},{label:"Divider",icon:"—",block:`
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
`}];function O(){return new Date().toISOString().split("T")[0]}function k(l){return l.toLowerCase().replace(/[^a-z0-9\s-]/g,"").trim().replace(/\s+/g,"-").replace(/-+/g,"-")}function w(l){const t=l.trim().split(/\s+/).filter(Boolean).length;return Math.max(1,Math.ceil(t/200))}const c=e.ref(((T=n.initialPost)==null?void 0:T.title)??""),d=e.ref(((C=n.initialPost)==null?void 0:C.slug)??""),p=e.ref(((I=n.initialPost)==null?void 0:I.date)??O()),v=e.ref(((P=n.initialPost)==null?void 0:P.summary)??""),g=e.ref(((B=n.initialPost)==null?void 0:B.excerpt)??""),o=e.ref([...((D=n.initialPost)==null?void 0:D.tags)??[]]),u=e.ref(((S=n.initialPost)==null?void 0:S.readingTime)??1),i=e.ref(((M=n.initialPost)==null?void 0:M.content)??""),f=e.ref((U=n.initialPost)==null?void 0:U.coverImage),b=e.ref(""),N=e.ref(!!n.initialPost),h=e.ref(null);e.watch(()=>n.initialPost,l=>{l&&(c.value=l.title,d.value=l.slug,p.value=l.date,v.value=l.summary,g.value=l.excerpt??"",o.value=[...l.tags],u.value=l.readingTime??1,i.value=l.content,f.value=l.coverImage,N.value=!0)});const $=e.computed(()=>Q.marked.parse(i.value)),y=e.computed(()=>c.value.trim().length>0&&v.value.trim().length>0&&i.value.trim().length>0),_=e.computed(()=>f.value??n.coverImageUrl);function A(l){c.value=l.target.value,N.value||(d.value=k(c.value)),u.value=w(i.value)}function K(l){i.value=l.target.value,u.value=w(i.value)}function z(l){if(l.key==="Enter"||l.key===","){l.preventDefault();const t=b.value.trim().replace(/,/g,"").toLowerCase();t&&!o.value.includes(t)&&(o.value=[...o.value,t]),b.value=""}l.key==="Backspace"&&!b.value&&o.value.length&&(o.value=o.value.slice(0,-1))}function W(l){o.value=o.value.filter(t=>t!==l)}function j(l){var s;const t=(s=l.target.files)==null?void 0:s[0];if(!t)return;x("coverImageSelected",t);const a=new FileReader;a.onload=()=>{f.value=a.result},a.readAsDataURL(t)}function G(l){const t=h.value;if(!t)return;const a=t.selectionStart,s=t.selectionEnd,r=i.value;let E,V;if(l.wrap){const[m,L]=l.wrap,H=r.slice(a,s)||"text";E=r.slice(0,a)+m+H+L+r.slice(s),V=a+m.length+H.length+L.length}else if(l.prefix){const m=r.lastIndexOf(`
|
|
6
|
+
`,a-1)+1;E=r.slice(0,m)+l.prefix+r.slice(m),V=a+l.prefix.length}else if(l.block)E=r.slice(0,a)+l.block+r.slice(s),V=a+l.block.length;else return;i.value=E,setTimeout(()=>{t.selectionStart=t.selectionEnd=V,t.focus()},0)}function J(){y.value&&x("publish",{title:c.value,slug:d.value||k(c.value),date:p.value,summary:v.value,excerpt:g.value||void 0,tags:o.value,readingTime:u.value,content:i.value,coverImage:n.coverImageUrl??f.value})}return(l,t)=>(e.openBlock(),e.createElementBlock("div",X,[e.createElementVNode("section",Y,[e.createElementVNode("div",Z,[t[7]||(t[7]=e.createElementVNode("label",{class:"be-label"},[e.createTextVNode("Title "),e.createElementVNode("span",{class:"be-required"},"*")],-1)),e.createElementVNode("input",{class:"be-input",type:"text",value:c.value,onInput:A,placeholder:"Post title…"},null,40,ee)]),e.createElementVNode("div",te,[t[8]||(t[8]=e.createElementVNode("label",{class:"be-label"},"Slug",-1)),e.withDirectives(e.createElementVNode("input",{class:"be-input",type:"text","onUpdate:modelValue":t[0]||(t[0]=a=>d.value=a),onInput:t[1]||(t[1]=a=>N.value=!0),placeholder:"post-slug"},null,544),[[e.vModelText,d.value]])]),e.createElementVNode("div",le,[t[9]||(t[9]=e.createElementVNode("label",{class:"be-label"},"Date",-1)),e.withDirectives(e.createElementVNode("input",{class:"be-input",type:"date","onUpdate:modelValue":t[2]||(t[2]=a=>p.value=a)},null,512),[[e.vModelText,p.value]])]),e.createElementVNode("div",ae,[t[10]||(t[10]=e.createElementVNode("label",{class:"be-label"},[e.createTextVNode("Summary "),e.createElementVNode("span",{class:"be-required"},"*")],-1)),e.withDirectives(e.createElementVNode("textarea",{class:"be-input be-input--textarea",rows:"2","onUpdate:modelValue":t[3]||(t[3]=a=>v.value=a),placeholder:"Short description shown in blog listings…"},null,512),[[e.vModelText,v.value]])]),e.createElementVNode("div",ne,[t[11]||(t[11]=e.createElementVNode("label",{class:"be-label"},[e.createTextVNode("Excerpt "),e.createElementVNode("span",{class:"be-optional"},"(optional)")],-1)),e.withDirectives(e.createElementVNode("textarea",{class:"be-input be-input--textarea",rows:"2","onUpdate:modelValue":t[4]||(t[4]=a=>g.value=a),placeholder:"Longer teaser for social previews…"},null,512),[[e.vModelText,g.value]])]),e.createElementVNode("div",oe,[t[12]||(t[12]=e.createElementVNode("label",{class:"be-label"},"Tags",-1)),e.createElementVNode("div",ie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,a=>(e.openBlock(),e.createElementBlock("span",{key:a,class:"be-tag"},[e.createTextVNode(e.toDisplayString(a)+" ",1),e.createElementVNode("button",{type:"button",class:"be-tag__remove",onClick:s=>W(a),"aria-label":`Remove tag ${a}`},"×",8,se)]))),128)),e.withDirectives(e.createElementVNode("input",{class:"be-tag-input",type:"text","onUpdate:modelValue":t[5]||(t[5]=a=>b.value=a),onKeydown:z,placeholder:"Add tag, press Enter…"},null,544),[[e.vModelText,b.value]])])]),e.createElementVNode("div",re,[t[13]||(t[13]=e.createElementVNode("label",{class:"be-label"},"Reading time (min)",-1)),e.withDirectives(e.createElementVNode("input",{class:"be-input be-input--narrow",type:"number",min:"1","onUpdate:modelValue":t[6]||(t[6]=a=>u.value=a)},null,512),[[e.vModelText,u.value,void 0,{number:!0}]])]),e.createElementVNode("div",ce,[t[14]||(t[14]=e.createElementVNode("label",{class:"be-label"},"Cover Image",-1)),e.createElementVNode("div",ue,[_.value?(e.openBlock(),e.createElementBlock("img",{key:0,class:"be-cover__preview",src:_.value,alt:"Cover preview"},null,8,de)):e.createCommentVNode("",!0),e.createElementVNode("label",ve,[e.createTextVNode(e.toDisplayString(_.value?"Replace":"Choose image")+" ",1),e.createElementVNode("input",{type:"file",accept:"image/*",onChange:j,hidden:""},null,32)])])])]),e.createElementVNode("section",be,[e.createElementVNode("div",me,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(F,a=>e.createElementVNode("button",{key:a.label,type:"button",class:"be-toolbar__btn",title:a.label,onClick:s=>G(a)},e.toDisplayString(a.icon),9,pe)),64))]),e.createElementVNode("div",ge,[e.createElementVNode("div",fe,[t[15]||(t[15]=e.createElementVNode("div",{class:"be-pane__label"},"Markdown",-1)),e.createElementVNode("textarea",{ref_key:"textareaEl",ref:h,class:"be-pane__textarea",value:i.value,onInput:K,placeholder:"Write your post in markdown…",spellcheck:"true"},null,40,Ee)]),e.createElementVNode("div",Ve,[t[16]||(t[16]=e.createElementVNode("div",{class:"be-pane__label"},"Preview",-1)),e.createElementVNode("div",{class:"be-pane__preview prose",innerHTML:$.value},null,8,Ne)])])]),e.createElementVNode("footer",_e,[e.createElementVNode("span",xe,"~"+e.toDisplayString(u.value)+" min read",1),e.createElementVNode("button",{type:"button",class:"be-publish",disabled:!y.value,onClick:J}," Publish Post ",8,ke)])]))}});module.exports=we;
|
package/dist/index26.mjs
CHANGED
|
@@ -1,89 +1,283 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class: "
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
__name: "DataTable",
|
|
1
|
+
import { defineComponent as oe, ref as s, watch as ie, computed as E, openBlock as _, createElementBlock as w, createElementVNode as l, createTextVNode as x, withDirectives as v, vModelText as b, Fragment as W, renderList as j, toDisplayString as P, createCommentVNode as re } from "vue";
|
|
2
|
+
import { marked as ue } from "./index56.mjs";
|
|
3
|
+
const ce = { class: "be-root" }, de = { class: "be-meta" }, ve = { class: "be-field be-field--full" }, be = ["value"], pe = { class: "be-field" }, ge = { class: "be-field" }, fe = { class: "be-field be-field--full" }, me = { class: "be-field be-field--full" }, _e = { class: "be-field" }, we = { class: "be-tags" }, xe = ["onClick", "aria-label"], he = { class: "be-field" }, ke = { class: "be-field be-field--cover" }, ye = { class: "be-cover" }, Ce = ["src"], Ie = { class: "be-cover__pick" }, Pe = { class: "be-editor" }, Te = {
|
|
4
|
+
class: "be-toolbar",
|
|
5
|
+
role: "toolbar",
|
|
6
|
+
"aria-label": "Formatting"
|
|
7
|
+
}, Se = ["title", "onClick"], Ee = { class: "be-panes" }, Ue = { class: "be-pane be-pane--write" }, Be = ["value"], Le = { class: "be-pane be-pane--preview" }, Ve = ["innerHTML"], De = { class: "be-footer" }, He = { class: "be-footer__meta" }, Re = ["disabled"], Ne = /* @__PURE__ */ oe({
|
|
8
|
+
__name: "BlogEditor",
|
|
10
9
|
props: {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
statuses: { default: () => [] },
|
|
14
|
-
statusFilter: { default: "all" },
|
|
15
|
-
statusLabels: { default: () => ({}) },
|
|
16
|
-
searchValue: { default: "" },
|
|
17
|
-
searchPlaceholder: { default: "Search…" },
|
|
18
|
-
totalCount: { default: 0 },
|
|
19
|
-
filteredCount: { default: 0 },
|
|
20
|
-
emptyMessage: { default: "No data yet." }
|
|
10
|
+
initialPost: {},
|
|
11
|
+
coverImageUrl: {}
|
|
21
12
|
},
|
|
22
|
-
emits: ["
|
|
23
|
-
setup(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
13
|
+
emits: ["publish", "coverImageSelected"],
|
|
14
|
+
setup(G, { emit: J }) {
|
|
15
|
+
var H, R, M, F, N, O, $, q, A;
|
|
16
|
+
const n = G, U = J, Q = [
|
|
17
|
+
{ label: "Heading 2", icon: "H2", prefix: "## " },
|
|
18
|
+
{ label: "Heading 3", icon: "H3", prefix: "### " },
|
|
19
|
+
{ label: "Bold", icon: "B", wrap: ["**", "**"] },
|
|
20
|
+
{ label: "Italic", icon: "I", wrap: ["*", "*"] },
|
|
21
|
+
{ label: "Inline code", icon: "`", wrap: ["`", "`"] },
|
|
22
|
+
{ label: "Code block", icon: "{ }", block: "\n```\n\n```\n" },
|
|
23
|
+
{ label: "Blockquote", icon: "❝", prefix: "> " },
|
|
24
|
+
{ label: "Link", icon: "⇗", wrap: ["[", "](url)"] },
|
|
25
|
+
{ label: "Image", icon: "⬚", block: `
|
|
26
|
+
` },
|
|
27
|
+
{ label: "Bullet list", icon: "•–", prefix: "- " },
|
|
28
|
+
{ label: "Numbered list", icon: "1.", prefix: "1. " },
|
|
29
|
+
{ label: "Divider", icon: "—", block: `
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
` }
|
|
33
|
+
];
|
|
34
|
+
function X() {
|
|
35
|
+
return (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
27
36
|
}
|
|
28
|
-
function
|
|
29
|
-
|
|
30
|
-
(c = h.value) != null && c.contains(s.target) || (o.value = !1, document.removeEventListener("click", f));
|
|
37
|
+
function B(t) {
|
|
38
|
+
return t.toLowerCase().replace(/[^a-z0-9\s-]/g, "").trim().replace(/\s+/g, "-").replace(/-+/g, "-");
|
|
31
39
|
}
|
|
32
|
-
function
|
|
33
|
-
|
|
40
|
+
function L(t) {
|
|
41
|
+
const e = t.trim().split(/\s+/).filter(Boolean).length;
|
|
42
|
+
return Math.max(1, Math.ceil(e / 200));
|
|
34
43
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
44
|
+
const c = s(((H = n.initialPost) == null ? void 0 : H.title) ?? ""), p = s(((R = n.initialPost) == null ? void 0 : R.slug) ?? ""), h = s(((M = n.initialPost) == null ? void 0 : M.date) ?? X()), g = s(((F = n.initialPost) == null ? void 0 : F.summary) ?? ""), k = s(((N = n.initialPost) == null ? void 0 : N.excerpt) ?? ""), o = s([...((O = n.initialPost) == null ? void 0 : O.tags) ?? []]), d = s((($ = n.initialPost) == null ? void 0 : $.readingTime) ?? 1), i = s(((q = n.initialPost) == null ? void 0 : q.content) ?? ""), y = s((A = n.initialPost) == null ? void 0 : A.coverImage), f = s(""), T = s(!!n.initialPost), V = s(null);
|
|
45
|
+
ie(() => n.initialPost, (t) => {
|
|
46
|
+
t && (c.value = t.title, p.value = t.slug, h.value = t.date, g.value = t.summary, k.value = t.excerpt ?? "", o.value = [...t.tags], d.value = t.readingTime ?? 1, i.value = t.content, y.value = t.coverImage, T.value = !0);
|
|
47
|
+
});
|
|
48
|
+
const Y = E(() => ue.parse(i.value)), D = E(() => c.value.trim().length > 0 && g.value.trim().length > 0 && i.value.trim().length > 0), S = E(() => y.value ?? n.coverImageUrl);
|
|
49
|
+
function Z(t) {
|
|
50
|
+
c.value = t.target.value, T.value || (p.value = B(c.value)), d.value = L(i.value);
|
|
51
|
+
}
|
|
52
|
+
function ee(t) {
|
|
53
|
+
i.value = t.target.value, d.value = L(i.value);
|
|
54
|
+
}
|
|
55
|
+
function le(t) {
|
|
56
|
+
if (t.key === "Enter" || t.key === ",") {
|
|
57
|
+
t.preventDefault();
|
|
58
|
+
const e = f.value.trim().replace(/,/g, "").toLowerCase();
|
|
59
|
+
e && !o.value.includes(e) && (o.value = [...o.value, e]), f.value = "";
|
|
60
|
+
}
|
|
61
|
+
t.key === "Backspace" && !f.value && o.value.length && (o.value = o.value.slice(0, -1));
|
|
62
|
+
}
|
|
63
|
+
function te(t) {
|
|
64
|
+
o.value = o.value.filter((e) => e !== t);
|
|
65
|
+
}
|
|
66
|
+
function ae(t) {
|
|
67
|
+
var r;
|
|
68
|
+
const e = (r = t.target.files) == null ? void 0 : r[0];
|
|
69
|
+
if (!e) return;
|
|
70
|
+
U("coverImageSelected", e);
|
|
71
|
+
const a = new FileReader();
|
|
72
|
+
a.onload = () => {
|
|
73
|
+
y.value = a.result;
|
|
74
|
+
}, a.readAsDataURL(e);
|
|
75
|
+
}
|
|
76
|
+
function ne(t) {
|
|
77
|
+
const e = V.value;
|
|
78
|
+
if (!e) return;
|
|
79
|
+
const a = e.selectionStart, r = e.selectionEnd, u = i.value;
|
|
80
|
+
let C, I;
|
|
81
|
+
if (t.wrap) {
|
|
82
|
+
const [m, K] = t.wrap, z = u.slice(a, r) || "text";
|
|
83
|
+
C = u.slice(0, a) + m + z + K + u.slice(r), I = a + m.length + z.length + K.length;
|
|
84
|
+
} else if (t.prefix) {
|
|
85
|
+
const m = u.lastIndexOf(`
|
|
86
|
+
`, a - 1) + 1;
|
|
87
|
+
C = u.slice(0, m) + t.prefix + u.slice(m), I = a + t.prefix.length;
|
|
88
|
+
} else if (t.block)
|
|
89
|
+
C = u.slice(0, a) + t.block + u.slice(r), I = a + t.block.length;
|
|
90
|
+
else
|
|
91
|
+
return;
|
|
92
|
+
i.value = C, setTimeout(() => {
|
|
93
|
+
e.selectionStart = e.selectionEnd = I, e.focus();
|
|
94
|
+
}, 0);
|
|
95
|
+
}
|
|
96
|
+
function se() {
|
|
97
|
+
D.value && U("publish", {
|
|
98
|
+
title: c.value,
|
|
99
|
+
slug: p.value || B(c.value),
|
|
100
|
+
date: h.value,
|
|
101
|
+
summary: g.value,
|
|
102
|
+
excerpt: k.value || void 0,
|
|
103
|
+
tags: o.value,
|
|
104
|
+
readingTime: d.value,
|
|
105
|
+
content: i.value,
|
|
106
|
+
coverImage: n.coverImageUrl ?? y.value
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
return (t, e) => (_(), w("div", ce, [
|
|
110
|
+
l("section", de, [
|
|
111
|
+
l("div", ve, [
|
|
112
|
+
e[7] || (e[7] = l("label", { class: "be-label" }, [
|
|
113
|
+
x("Title "),
|
|
114
|
+
l("span", { class: "be-required" }, "*")
|
|
115
|
+
], -1)),
|
|
116
|
+
l("input", {
|
|
117
|
+
class: "be-input",
|
|
118
|
+
type: "text",
|
|
119
|
+
value: c.value,
|
|
120
|
+
onInput: Z,
|
|
121
|
+
placeholder: "Post title…"
|
|
122
|
+
}, null, 40, be)
|
|
123
|
+
]),
|
|
124
|
+
l("div", pe, [
|
|
125
|
+
e[8] || (e[8] = l("label", { class: "be-label" }, "Slug", -1)),
|
|
126
|
+
v(l("input", {
|
|
127
|
+
class: "be-input",
|
|
128
|
+
type: "text",
|
|
129
|
+
"onUpdate:modelValue": e[0] || (e[0] = (a) => p.value = a),
|
|
130
|
+
onInput: e[1] || (e[1] = (a) => T.value = !0),
|
|
131
|
+
placeholder: "post-slug"
|
|
132
|
+
}, null, 544), [
|
|
133
|
+
[b, p.value]
|
|
134
|
+
])
|
|
135
|
+
]),
|
|
136
|
+
l("div", ge, [
|
|
137
|
+
e[9] || (e[9] = l("label", { class: "be-label" }, "Date", -1)),
|
|
138
|
+
v(l("input", {
|
|
139
|
+
class: "be-input",
|
|
140
|
+
type: "date",
|
|
141
|
+
"onUpdate:modelValue": e[2] || (e[2] = (a) => h.value = a)
|
|
142
|
+
}, null, 512), [
|
|
143
|
+
[b, h.value]
|
|
144
|
+
])
|
|
145
|
+
]),
|
|
146
|
+
l("div", fe, [
|
|
147
|
+
e[10] || (e[10] = l("label", { class: "be-label" }, [
|
|
148
|
+
x("Summary "),
|
|
149
|
+
l("span", { class: "be-required" }, "*")
|
|
150
|
+
], -1)),
|
|
151
|
+
v(l("textarea", {
|
|
152
|
+
class: "be-input be-input--textarea",
|
|
153
|
+
rows: "2",
|
|
154
|
+
"onUpdate:modelValue": e[3] || (e[3] = (a) => g.value = a),
|
|
155
|
+
placeholder: "Short description shown in blog listings…"
|
|
156
|
+
}, null, 512), [
|
|
157
|
+
[b, g.value]
|
|
158
|
+
])
|
|
159
|
+
]),
|
|
160
|
+
l("div", me, [
|
|
161
|
+
e[11] || (e[11] = l("label", { class: "be-label" }, [
|
|
162
|
+
x("Excerpt "),
|
|
163
|
+
l("span", { class: "be-optional" }, "(optional)")
|
|
164
|
+
], -1)),
|
|
165
|
+
v(l("textarea", {
|
|
166
|
+
class: "be-input be-input--textarea",
|
|
167
|
+
rows: "2",
|
|
168
|
+
"onUpdate:modelValue": e[4] || (e[4] = (a) => k.value = a),
|
|
169
|
+
placeholder: "Longer teaser for social previews…"
|
|
170
|
+
}, null, 512), [
|
|
171
|
+
[b, k.value]
|
|
172
|
+
])
|
|
173
|
+
]),
|
|
174
|
+
l("div", _e, [
|
|
175
|
+
e[12] || (e[12] = l("label", { class: "be-label" }, "Tags", -1)),
|
|
176
|
+
l("div", we, [
|
|
177
|
+
(_(!0), w(W, null, j(o.value, (a) => (_(), w("span", {
|
|
178
|
+
key: a,
|
|
179
|
+
class: "be-tag"
|
|
180
|
+
}, [
|
|
181
|
+
x(P(a) + " ", 1),
|
|
182
|
+
l("button", {
|
|
183
|
+
type: "button",
|
|
184
|
+
class: "be-tag__remove",
|
|
185
|
+
onClick: (r) => te(a),
|
|
186
|
+
"aria-label": `Remove tag ${a}`
|
|
187
|
+
}, "×", 8, xe)
|
|
188
|
+
]))), 128)),
|
|
189
|
+
v(l("input", {
|
|
190
|
+
class: "be-tag-input",
|
|
191
|
+
type: "text",
|
|
192
|
+
"onUpdate:modelValue": e[5] || (e[5] = (a) => f.value = a),
|
|
193
|
+
onKeydown: le,
|
|
194
|
+
placeholder: "Add tag, press Enter…"
|
|
195
|
+
}, null, 544), [
|
|
196
|
+
[b, f.value]
|
|
197
|
+
])
|
|
198
|
+
])
|
|
199
|
+
]),
|
|
200
|
+
l("div", he, [
|
|
201
|
+
e[13] || (e[13] = l("label", { class: "be-label" }, "Reading time (min)", -1)),
|
|
202
|
+
v(l("input", {
|
|
203
|
+
class: "be-input be-input--narrow",
|
|
204
|
+
type: "number",
|
|
205
|
+
min: "1",
|
|
206
|
+
"onUpdate:modelValue": e[6] || (e[6] = (a) => d.value = a)
|
|
207
|
+
}, null, 512), [
|
|
208
|
+
[
|
|
209
|
+
b,
|
|
210
|
+
d.value,
|
|
211
|
+
void 0,
|
|
212
|
+
{ number: !0 }
|
|
213
|
+
]
|
|
214
|
+
])
|
|
215
|
+
]),
|
|
216
|
+
l("div", ke, [
|
|
217
|
+
e[14] || (e[14] = l("label", { class: "be-label" }, "Cover Image", -1)),
|
|
218
|
+
l("div", ye, [
|
|
219
|
+
S.value ? (_(), w("img", {
|
|
220
|
+
key: 0,
|
|
221
|
+
class: "be-cover__preview",
|
|
222
|
+
src: S.value,
|
|
223
|
+
alt: "Cover preview"
|
|
224
|
+
}, null, 8, Ce)) : re("", !0),
|
|
225
|
+
l("label", Ie, [
|
|
226
|
+
x(P(S.value ? "Replace" : "Choose image") + " ", 1),
|
|
227
|
+
l("input", {
|
|
228
|
+
type: "file",
|
|
229
|
+
accept: "image/*",
|
|
230
|
+
onChange: ae,
|
|
231
|
+
hidden: ""
|
|
232
|
+
}, null, 32)
|
|
233
|
+
])
|
|
234
|
+
])
|
|
235
|
+
])
|
|
236
|
+
]),
|
|
237
|
+
l("section", Pe, [
|
|
238
|
+
l("div", Te, [
|
|
239
|
+
(_(), w(W, null, j(Q, (a) => l("button", {
|
|
240
|
+
key: a.label,
|
|
241
|
+
type: "button",
|
|
242
|
+
class: "be-toolbar__btn",
|
|
243
|
+
title: a.label,
|
|
244
|
+
onClick: (r) => ne(a)
|
|
245
|
+
}, P(a.icon), 9, Se)), 64))
|
|
79
246
|
]),
|
|
80
|
-
|
|
81
|
-
|
|
247
|
+
l("div", Ee, [
|
|
248
|
+
l("div", Ue, [
|
|
249
|
+
e[15] || (e[15] = l("div", { class: "be-pane__label" }, "Markdown", -1)),
|
|
250
|
+
l("textarea", {
|
|
251
|
+
ref_key: "textareaEl",
|
|
252
|
+
ref: V,
|
|
253
|
+
class: "be-pane__textarea",
|
|
254
|
+
value: i.value,
|
|
255
|
+
onInput: ee,
|
|
256
|
+
placeholder: "Write your post in markdown…",
|
|
257
|
+
spellcheck: "true"
|
|
258
|
+
}, null, 40, Be)
|
|
259
|
+
]),
|
|
260
|
+
l("div", Le, [
|
|
261
|
+
e[16] || (e[16] = l("div", { class: "be-pane__label" }, "Preview", -1)),
|
|
262
|
+
l("div", {
|
|
263
|
+
class: "be-pane__preview prose",
|
|
264
|
+
innerHTML: Y.value
|
|
265
|
+
}, null, 8, Ve)
|
|
266
|
+
])
|
|
82
267
|
])
|
|
83
|
-
],
|
|
268
|
+
]),
|
|
269
|
+
l("footer", De, [
|
|
270
|
+
l("span", He, "~" + P(d.value) + " min read", 1),
|
|
271
|
+
l("button", {
|
|
272
|
+
type: "button",
|
|
273
|
+
class: "be-publish",
|
|
274
|
+
disabled: !D.value,
|
|
275
|
+
onClick: se
|
|
276
|
+
}, " Publish Post ", 8, Re)
|
|
277
|
+
])
|
|
84
278
|
]));
|
|
85
279
|
}
|
|
86
280
|
});
|
|
87
281
|
export {
|
|
88
|
-
|
|
282
|
+
Ne as default
|
|
89
283
|
};
|
package/dist/index28.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),
|
|
1
|
+
"use strict";const e=require("vue"),h={class:"table-panel"},f={key:0,class:"dt-empty"},g={class:"dt-toolbar"},y=["placeholder","value"],C={class:"dt-pills"},v=["onClick"],B={class:"dt-count"},E={key:0,class:"dt-col-panel"},p=["checked","onChange"],V={class:"dt-scroll"},b=e.defineComponent({__name:"DataTable",props:{columnDefs:{default:()=>[]},colVisibility:{default:()=>({})},statuses:{default:()=>[]},statusFilter:{default:"all"},statusLabels:{default:()=>({})},searchValue:{default:""},searchPlaceholder:{default:"Search…"},totalCount:{default:0},filteredCount:{default:0},emptyMessage:{default:"No data yet."}},emits:["searchChange","statusChange","colToggle"],setup(t,{emit:u}){const i=t,c=u,o=e.ref(!1),s=e.ref(null);function d(a){return a==="all"?"All":i.statusLabels[a]??a}function r(a){var n;(n=s.value)!=null&&n.contains(a.target)||(o.value=!1,document.removeEventListener("click",r))}function m(){o.value=!o.value,o.value&&setTimeout(()=>document.addEventListener("click",r),0)}return(a,n)=>(e.openBlock(),e.createElementBlock("div",h,[t.totalCount===0?(e.openBlock(),e.createElementBlock("p",f,e.toDisplayString(t.emptyMessage),1)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",g,[t.statuses.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("input",{class:"dt-search",type:"search",placeholder:t.searchPlaceholder,value:t.searchValue,onInput:n[0]||(n[0]=l=>c("searchChange",l.target.value))},null,40,y),e.createElementVNode("div",C,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.statuses,l=>(e.openBlock(),e.createElementBlock("button",{key:l,class:e.normalizeClass(["dt-pill",{"dt-pill--active":t.statusFilter===l}]),onClick:k=>c("statusChange",l)},e.toDisplayString(d(l)),11,v))),128))]),e.createElementVNode("span",B,e.toDisplayString(t.filteredCount)+" of "+e.toDisplayString(t.totalCount),1)],64)):e.createCommentVNode("",!0),t.columnDefs.length>0?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"colWrapRef",ref:s,class:"dt-col-wrap"},[e.createElementVNode("button",{class:"dt-col-btn",onClick:m},"⚙ Columns"),o.value?(e.openBlock(),e.createElementBlock("div",E,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columnDefs,l=>(e.openBlock(),e.createElementBlock("label",{key:l.key,class:"dt-col-check"},[e.createElementVNode("input",{type:"checkbox",checked:t.colVisibility[l.key]??!0,onChange:k=>c("colToggle",l.key)},null,40,p),e.createTextVNode(" "+e.toDisplayString(l.label),1)]))),128))])):e.createCommentVNode("",!0)],512)):e.createCommentVNode("",!0)]),e.createElementVNode("div",V,[e.renderSlot(a.$slots,"default")])],64))]))}});module.exports=b;
|