@m2s2/vue-lib 2.4.1 → 2.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/dist/index14.cjs +1 -1
  2. package/dist/index14.mjs +1 -1
  3. package/dist/index16.cjs +1 -1
  4. package/dist/index16.mjs +1 -1
  5. package/dist/index2.cjs +1 -1
  6. package/dist/index2.mjs +12 -12
  7. package/dist/index24.cjs +1 -1
  8. package/dist/index24.mjs +20 -26
  9. package/dist/index26.cjs +2 -6
  10. package/dist/index26.mjs +214 -176
  11. package/dist/index28.cjs +1 -1
  12. package/dist/index28.mjs +33 -32
  13. package/dist/index30.cjs +1 -1
  14. package/dist/index30.mjs +29 -28
  15. package/dist/index32.cjs +1 -1
  16. package/dist/index32.mjs +1 -1
  17. package/dist/index36.cjs +1 -1
  18. package/dist/index36.mjs +1 -1
  19. package/dist/index40.cjs +1 -1
  20. package/dist/index40.mjs +4 -4
  21. package/dist/index46.cjs +1 -1
  22. package/dist/index46.mjs +2 -2
  23. package/dist/index75.cjs +1 -1
  24. package/dist/index75.mjs +4 -51
  25. package/dist/index76.cjs +1 -59
  26. package/dist/index76.mjs +18 -1146
  27. package/dist/index77.cjs +1 -1
  28. package/dist/index77.mjs +6 -2
  29. package/dist/index78.cjs +59 -0
  30. package/dist/index78.mjs +1152 -0
  31. package/dist/index79.cjs +5 -0
  32. package/dist/index79.mjs +21 -0
  33. package/dist/index8.cjs +1 -1
  34. package/dist/index8.mjs +5 -5
  35. package/dist/index80.cjs +1 -0
  36. package/dist/index80.mjs +53 -0
  37. package/dist/index81.cjs +1 -0
  38. package/dist/index81.mjs +4 -0
  39. package/dist/storybook-shared/src/globals.d.ts +2 -0
  40. package/dist/storybook-shared/src/globals.d.ts.map +1 -1
  41. package/dist/vue-lib/src/BrandConfigurator.vue.d.ts.map +1 -1
  42. package/dist/vue-lib/src/Welcome.vue.d.ts.map +1 -1
  43. package/dist/vue-lib/src/components/BlogEditor/BlogEditor.vue.d.ts +4 -1
  44. package/dist/vue-lib/src/components/BlogEditor/BlogEditor.vue.d.ts.map +1 -1
  45. package/dist/vue-lib/src/components/Chat/Chat.vue.d.ts +2 -0
  46. package/dist/vue-lib/src/components/Chat/Chat.vue.d.ts.map +1 -1
  47. package/dist/vue-lib/src/components/CtaSection/CtaSection.vue.d.ts.map +1 -1
  48. package/dist/vue-lib/src/components/DataTable/DataTable.vue.d.ts.map +1 -1
  49. package/dist/vue-lib/src/components/Dialog/Dialog.vue.d.ts.map +1 -1
  50. package/dist/vue-lib/src/components/Dropdown/Dropdown.vue.d.ts.map +1 -1
  51. package/dist/vue-lib/src/components/Dropdown/DropdownItem.vue.d.ts.map +1 -1
  52. package/dist/vue-lib/src/components/Footer/Footer.vue.d.ts.map +1 -1
  53. package/dist/vue-lib/src/components/Footer/SocialIcon.vue.d.ts.map +1 -1
  54. package/dist/vue-lib/src/components/LoadingButton/LoadingButton.vue.d.ts +1 -0
  55. package/dist/vue-lib/src/components/LoadingButton/LoadingButton.vue.d.ts.map +1 -1
  56. package/dist/vue-lib/src/components/Navbar/Navbar.vue.d.ts.map +1 -1
  57. package/dist/vue-lib/src/components/PageHeader/PageHeader.vue.d.ts.map +1 -1
  58. package/dist/vue-lib/src/components/Panel/Panel.vue.d.ts.map +1 -1
  59. package/dist/vue-lib/src/components/ProcessSteps/ProcessSteps.vue.d.ts.map +1 -1
  60. package/dist/vue-lib/src/components/SectionHeader/SectionHeader.vue.d.ts.map +1 -1
  61. package/dist/vue-lib/src/components/StatRow/StatRow.vue.d.ts.map +1 -1
  62. package/dist/vue-lib/src/components/StatusBadge/StatusBadge.vue.d.ts +1 -0
  63. package/dist/vue-lib/src/components/StatusBadge/StatusBadge.vue.d.ts.map +1 -1
  64. package/dist/vue-lib/src/components/SubscribeForm/SubscribeForm.vue.d.ts +3 -0
  65. package/dist/vue-lib/src/components/SubscribeForm/SubscribeForm.vue.d.ts.map +1 -1
  66. package/dist/vue-lib/src/components/cards/BlogCard/BlogCard.vue.d.ts.map +1 -1
  67. package/dist/vue-lib/src/components/cards/FeatureCard/FeatureCard.vue.d.ts.map +1 -1
  68. package/dist/vue-lib.css +1 -1
  69. package/package.json +10 -7
package/dist/index26.mjs CHANGED
@@ -1,283 +1,321 @@
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 "./index76.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 = {
1
+ import { defineComponent as ge, ref as i, watch as fe, computed as L, openBlock as c, createElementBlock as m, createElementVNode as l, createTextVNode as g, withDirectives as d, vModelText as v, Fragment as te, renderList as ae, toDisplayString as V, createCommentVNode as _e, unref as ye } from "vue";
2
+ import { marked as we } from "./index78.mjs";
3
+ import { todayAsIsoDate as xe, generateSlug as se, calcReadingTime as ie } from "./index76.mjs";
4
+ import { BLOG_EDITOR_TOOLBAR as Pe } from "./index79.mjs";
5
+ const ke = { class: "be-root" }, Te = { class: "be-meta" }, Ce = { class: "be-field be-field--full" }, Ie = ["value"], Ue = { class: "be-field" }, Se = { class: "be-field" }, he = { class: "be-field be-field--full" }, Ve = { class: "be-field be-field--full" }, Ee = { class: "be-field" }, De = { class: "be-tags" }, Le = ["aria-label", "onClick"], Re = { class: "be-field" }, Be = { class: "be-field be-field--cover" }, Oe = { class: "be-cover" }, Ae = ["src"], Fe = { class: "be-cover__pick" }, Me = { class: "be-field" }, $e = { class: "be-field" }, He = { class: "be-field be-field--narrow-pair" }, Ne = { class: "be-editor" }, qe = {
4
6
  class: "be-toolbar",
5
7
  role: "toolbar",
6
8
  "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({
9
+ }, Ge = ["title", "onClick"], Ke = { class: "be-panes" }, We = { class: "be-pane be-pane--write" }, je = ["value"], ze = { class: "be-pane be-pane--preview" }, Je = ["innerHTML"], Qe = { class: "be-footer" }, Xe = { class: "be-footer__meta" }, Ye = ["disabled"], al = /* @__PURE__ */ ge({
8
10
  __name: "BlogEditor",
9
11
  props: {
10
- initialPost: {},
11
- coverImageUrl: {}
12
+ initialPost: { default: void 0 },
13
+ coverImageUrl: { default: void 0 }
12
14
  },
13
15
  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: `![alt text](image-url)
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];
36
- }
37
- function B(t) {
38
- return t.toLowerCase().replace(/[^a-z0-9\s-]/g, "").trim().replace(/\s+/g, "-").replace(/-+/g, "-");
39
- }
40
- function L(t) {
41
- const e = t.trim().split(/\s+/).filter(Boolean).length;
42
- return Math.max(1, Math.ceil(e / 200));
43
- }
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);
16
+ setup(ne, { emit: oe }) {
17
+ var A, F, M, $, H, N, q, G, K, W, j, z, J, Q, X, Y, Z;
18
+ const s = ne, R = oe, b = i(((A = s.initialPost) == null ? void 0 : A.title) ?? ""), f = i(((F = s.initialPost) == null ? void 0 : F.slug) ?? ""), x = i(((M = s.initialPost) == null ? void 0 : M.date) ?? xe()), _ = i((($ = s.initialPost) == null ? void 0 : $.summary) ?? ""), P = i(((H = s.initialPost) == null ? void 0 : H.excerpt) ?? ""), n = i([...((N = s.initialPost) == null ? void 0 : N.tags) ?? []]), p = i(((q = s.initialPost) == null ? void 0 : q.readingTime) ?? 1), r = i(((G = s.initialPost) == null ? void 0 : G.content) ?? ""), k = i((K = s.initialPost) == null ? void 0 : K.coverImage), y = i(""), E = i(!!s.initialPost), B = i(null), T = i(((j = (W = s.initialPost) == null ? void 0 : W.series) == null ? void 0 : j.id) ?? ""), C = i(((J = (z = s.initialPost) == null ? void 0 : z.series) == null ? void 0 : J.title) ?? ""), I = i(((X = (Q = s.initialPost) == null ? void 0 : Q.series) == null ? void 0 : X.part) ?? 1), U = i(((Z = (Y = s.initialPost) == null ? void 0 : Y.series) == null ? void 0 : Z.total) ?? 1);
19
+ fe(() => s.initialPost, (a) => {
20
+ var e, t, o, u;
21
+ a && (b.value = a.title, f.value = a.slug, x.value = a.date, _.value = a.summary, P.value = a.excerpt ?? "", n.value = [...a.tags], p.value = a.readingTime ?? 1, r.value = a.content, k.value = a.coverImage, T.value = ((e = a.series) == null ? void 0 : e.id) ?? "", C.value = ((t = a.series) == null ? void 0 : t.title) ?? "", I.value = ((o = a.series) == null ? void 0 : o.part) ?? 1, U.value = ((u = a.series) == null ? void 0 : u.total) ?? 1, E.value = !0);
47
22
  });
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);
23
+ const ue = L(() => we.parse(r.value)), O = L(() => b.value.trim().length > 0 && _.value.trim().length > 0 && r.value.trim().length > 0), D = L(() => k.value ?? s.coverImageUrl);
24
+ function re(a) {
25
+ b.value = a.target.value, E.value || (f.value = se(b.value)), p.value = ie(r.value);
51
26
  }
52
- function ee(t) {
53
- i.value = t.target.value, d.value = L(i.value);
27
+ function de(a) {
28
+ r.value = a.target.value, p.value = ie(r.value);
54
29
  }
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 = "";
30
+ function ve(a) {
31
+ if (a.key === "Enter" || a.key === ",") {
32
+ a.preventDefault();
33
+ const e = y.value.trim().replace(/,/g, "").toLowerCase();
34
+ e && !n.value.includes(e) && (n.value = [...n.value, e]), y.value = "";
60
35
  }
61
- t.key === "Backspace" && !f.value && o.value.length && (o.value = o.value.slice(0, -1));
36
+ a.key === "Backspace" && !y.value && n.value.length && (n.value = n.value.slice(0, -1));
62
37
  }
63
- function te(t) {
64
- o.value = o.value.filter((e) => e !== t);
38
+ function be(a) {
39
+ n.value = n.value.filter((e) => e !== a);
65
40
  }
66
- function ae(t) {
67
- var r;
68
- const e = (r = t.target.files) == null ? void 0 : r[0];
41
+ function pe(a) {
42
+ var o;
43
+ const e = (o = a.target.files) == null ? void 0 : o[0];
69
44
  if (!e) return;
70
- U("coverImageSelected", e);
71
- const a = new FileReader();
72
- a.onload = () => {
73
- y.value = a.result;
74
- }, a.readAsDataURL(e);
45
+ R("coverImageSelected", e);
46
+ const t = new FileReader();
47
+ t.onload = () => {
48
+ k.value = t.result;
49
+ }, t.readAsDataURL(e);
75
50
  }
76
- function ne(t) {
77
- const e = V.value;
51
+ function ce(a) {
52
+ const e = B.value;
78
53
  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;
54
+ const t = e.selectionStart, o = e.selectionEnd, u = r.value;
55
+ let S, h;
56
+ if (a.wrap) {
57
+ const [w, ee] = a.wrap, le = u.slice(t, o) || "text";
58
+ S = u.slice(0, t) + w + le + ee + u.slice(o), h = t + w.length + le.length + ee.length;
59
+ } else if (a.prefix) {
60
+ const w = u.lastIndexOf(`
61
+ `, t - 1) + 1;
62
+ S = u.slice(0, w) + a.prefix + u.slice(w), h = t + a.prefix.length;
63
+ } else if (a.block)
64
+ S = u.slice(0, t) + a.block + u.slice(o), h = t + a.block.length;
90
65
  else
91
66
  return;
92
- i.value = C, setTimeout(() => {
93
- e.selectionStart = e.selectionEnd = I, e.focus();
67
+ r.value = S, setTimeout(() => {
68
+ e.selectionStart = e.selectionEnd = h, e.focus();
94
69
  }, 0);
95
70
  }
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
71
+ function me() {
72
+ if (!O.value) return;
73
+ const a = T.value.trim();
74
+ R("publish", {
75
+ title: b.value,
76
+ slug: f.value || se(b.value),
77
+ date: x.value,
78
+ summary: _.value,
79
+ excerpt: P.value || void 0,
80
+ tags: n.value,
81
+ readingTime: p.value,
82
+ content: r.value,
83
+ coverImage: s.coverImageUrl ?? k.value,
84
+ series: a ? { id: a, title: C.value.trim() || a, part: I.value, total: U.value } : void 0
107
85
  });
108
86
  }
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 "),
87
+ return (a, e) => (c(), m("div", ke, [
88
+ l("section", Te, [
89
+ l("div", Ce, [
90
+ e[11] || (e[11] = l("label", { class: "be-label" }, [
91
+ g("Title "),
114
92
  l("span", { class: "be-required" }, "*")
115
93
  ], -1)),
116
94
  l("input", {
117
95
  class: "be-input",
118
96
  type: "text",
119
- value: c.value,
120
- onInput: Z,
121
- placeholder: "Post title…"
122
- }, null, 40, be)
97
+ value: b.value,
98
+ placeholder: "Post title…",
99
+ onInput: re
100
+ }, null, 40, Ie)
123
101
  ]),
124
- l("div", pe, [
125
- e[8] || (e[8] = l("label", { class: "be-label" }, "Slug", -1)),
126
- v(l("input", {
102
+ l("div", Ue, [
103
+ e[12] || (e[12] = l("label", { class: "be-label" }, "Slug", -1)),
104
+ d(l("input", {
105
+ "onUpdate:modelValue": e[0] || (e[0] = (t) => f.value = t),
127
106
  class: "be-input",
128
107
  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"
108
+ placeholder: "post-slug",
109
+ onInput: e[1] || (e[1] = (t) => E.value = !0)
132
110
  }, null, 544), [
133
- [b, p.value]
111
+ [v, f.value]
134
112
  ])
135
113
  ]),
136
- l("div", ge, [
137
- e[9] || (e[9] = l("label", { class: "be-label" }, "Date", -1)),
138
- v(l("input", {
114
+ l("div", Se, [
115
+ e[13] || (e[13] = l("label", { class: "be-label" }, "Date", -1)),
116
+ d(l("input", {
117
+ "onUpdate:modelValue": e[2] || (e[2] = (t) => x.value = t),
139
118
  class: "be-input",
140
- type: "date",
141
- "onUpdate:modelValue": e[2] || (e[2] = (a) => h.value = a)
119
+ type: "date"
142
120
  }, null, 512), [
143
- [b, h.value]
121
+ [v, x.value]
144
122
  ])
145
123
  ]),
146
- l("div", fe, [
147
- e[10] || (e[10] = l("label", { class: "be-label" }, [
148
- x("Summary "),
124
+ l("div", he, [
125
+ e[14] || (e[14] = l("label", { class: "be-label" }, [
126
+ g("Summary "),
149
127
  l("span", { class: "be-required" }, "*")
150
128
  ], -1)),
151
- v(l("textarea", {
129
+ d(l("textarea", {
130
+ "onUpdate:modelValue": e[3] || (e[3] = (t) => _.value = t),
152
131
  class: "be-input be-input--textarea",
153
132
  rows: "2",
154
- "onUpdate:modelValue": e[3] || (e[3] = (a) => g.value = a),
155
133
  placeholder: "Short description shown in blog listings…"
156
134
  }, null, 512), [
157
- [b, g.value]
135
+ [v, _.value]
158
136
  ])
159
137
  ]),
160
- l("div", me, [
161
- e[11] || (e[11] = l("label", { class: "be-label" }, [
162
- x("Excerpt "),
138
+ l("div", Ve, [
139
+ e[15] || (e[15] = l("label", { class: "be-label" }, [
140
+ g("Excerpt "),
163
141
  l("span", { class: "be-optional" }, "(optional)")
164
142
  ], -1)),
165
- v(l("textarea", {
143
+ d(l("textarea", {
144
+ "onUpdate:modelValue": e[4] || (e[4] = (t) => P.value = t),
166
145
  class: "be-input be-input--textarea",
167
146
  rows: "2",
168
- "onUpdate:modelValue": e[4] || (e[4] = (a) => k.value = a),
169
147
  placeholder: "Longer teaser for social previews…"
170
148
  }, null, 512), [
171
- [b, k.value]
149
+ [v, P.value]
172
150
  ])
173
151
  ]),
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,
152
+ l("div", Ee, [
153
+ e[16] || (e[16] = l("label", { class: "be-label" }, "Tags", -1)),
154
+ l("div", De, [
155
+ (c(!0), m(te, null, ae(n.value, (t) => (c(), m("span", {
156
+ key: t,
179
157
  class: "be-tag"
180
158
  }, [
181
- x(P(a) + " ", 1),
159
+ g(V(t) + " ", 1),
182
160
  l("button", {
183
161
  type: "button",
184
162
  class: "be-tag__remove",
185
- onClick: (r) => te(a),
186
- "aria-label": `Remove tag ${a}`
187
- }, "×", 8, xe)
163
+ "aria-label": `Remove tag ${t}`,
164
+ onClick: (o) => be(t)
165
+ }, "×", 8, Le)
188
166
  ]))), 128)),
189
- v(l("input", {
167
+ d(l("input", {
168
+ "onUpdate:modelValue": e[5] || (e[5] = (t) => y.value = t),
190
169
  class: "be-tag-input",
191
170
  type: "text",
192
- "onUpdate:modelValue": e[5] || (e[5] = (a) => f.value = a),
193
- onKeydown: le,
194
- placeholder: "Add tag, press Enter…"
171
+ placeholder: "Add tag, press Enter…",
172
+ onKeydown: ve
195
173
  }, null, 544), [
196
- [b, f.value]
174
+ [v, y.value]
197
175
  ])
198
176
  ])
199
177
  ]),
200
- l("div", he, [
201
- e[13] || (e[13] = l("label", { class: "be-label" }, "Reading time (min)", -1)),
202
- v(l("input", {
178
+ l("div", Re, [
179
+ e[17] || (e[17] = l("label", { class: "be-label" }, "Reading time (min)", -1)),
180
+ d(l("input", {
181
+ "onUpdate:modelValue": e[6] || (e[6] = (t) => p.value = t),
203
182
  class: "be-input be-input--narrow",
204
183
  type: "number",
205
- min: "1",
206
- "onUpdate:modelValue": e[6] || (e[6] = (a) => d.value = a)
184
+ min: "1"
207
185
  }, null, 512), [
208
186
  [
209
- b,
210
- d.value,
187
+ v,
188
+ p.value,
211
189
  void 0,
212
190
  { number: !0 }
213
191
  ]
214
192
  ])
215
193
  ]),
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", {
194
+ l("div", Be, [
195
+ e[18] || (e[18] = l("label", { class: "be-label" }, "Cover Image", -1)),
196
+ l("div", Oe, [
197
+ D.value ? (c(), m("img", {
220
198
  key: 0,
221
199
  class: "be-cover__preview",
222
- src: S.value,
200
+ src: D.value,
223
201
  alt: "Cover preview"
224
- }, null, 8, Ce)) : re("", !0),
225
- l("label", Ie, [
226
- x(P(S.value ? "Replace" : "Choose image") + " ", 1),
202
+ }, null, 8, Ae)) : _e("", !0),
203
+ l("label", Fe, [
204
+ g(V(D.value ? "Replace" : "Choose image") + " ", 1),
227
205
  l("input", {
228
206
  type: "file",
229
207
  accept: "image/*",
230
- onChange: ae,
231
- hidden: ""
208
+ hidden: "",
209
+ onChange: pe
232
210
  }, null, 32)
233
211
  ])
234
212
  ])
213
+ ]),
214
+ e[23] || (e[23] = l("div", { class: "be-field-group-label" }, [
215
+ g(" Series "),
216
+ l("span", { class: "be-optional" }, "(optional)")
217
+ ], -1)),
218
+ l("div", Me, [
219
+ e[19] || (e[19] = l("label", { class: "be-label" }, "Series ID", -1)),
220
+ d(l("input", {
221
+ "onUpdate:modelValue": e[7] || (e[7] = (t) => T.value = t),
222
+ class: "be-input",
223
+ type: "text",
224
+ placeholder: "e.g. go-backend"
225
+ }, null, 512), [
226
+ [v, T.value]
227
+ ])
228
+ ]),
229
+ l("div", $e, [
230
+ e[20] || (e[20] = l("label", { class: "be-label" }, "Series Title", -1)),
231
+ d(l("input", {
232
+ "onUpdate:modelValue": e[8] || (e[8] = (t) => C.value = t),
233
+ class: "be-input",
234
+ type: "text",
235
+ placeholder: "e.g. Go Backend Series"
236
+ }, null, 512), [
237
+ [v, C.value]
238
+ ])
239
+ ]),
240
+ l("div", He, [
241
+ l("div", null, [
242
+ e[21] || (e[21] = l("label", { class: "be-label" }, "Part", -1)),
243
+ d(l("input", {
244
+ "onUpdate:modelValue": e[9] || (e[9] = (t) => I.value = t),
245
+ class: "be-input be-input--narrow",
246
+ type: "number",
247
+ min: "1"
248
+ }, null, 512), [
249
+ [
250
+ v,
251
+ I.value,
252
+ void 0,
253
+ { number: !0 }
254
+ ]
255
+ ])
256
+ ]),
257
+ l("div", null, [
258
+ e[22] || (e[22] = l("label", { class: "be-label" }, "Total Parts", -1)),
259
+ d(l("input", {
260
+ "onUpdate:modelValue": e[10] || (e[10] = (t) => U.value = t),
261
+ class: "be-input be-input--narrow",
262
+ type: "number",
263
+ min: "1"
264
+ }, null, 512), [
265
+ [
266
+ v,
267
+ U.value,
268
+ void 0,
269
+ { number: !0 }
270
+ ]
271
+ ])
272
+ ])
235
273
  ])
236
274
  ]),
237
- l("section", Pe, [
238
- l("div", Te, [
239
- (_(), w(W, null, j(Q, (a) => l("button", {
240
- key: a.label,
275
+ l("section", Ne, [
276
+ l("div", qe, [
277
+ (c(!0), m(te, null, ae(ye(Pe), (t) => (c(), m("button", {
278
+ key: t.label,
241
279
  type: "button",
242
280
  class: "be-toolbar__btn",
243
- title: a.label,
244
- onClick: (r) => ne(a)
245
- }, P(a.icon), 9, Se)), 64))
281
+ title: t.label,
282
+ onClick: (o) => ce(t)
283
+ }, V(t.icon), 9, Ge))), 128))
246
284
  ]),
247
- l("div", Ee, [
248
- l("div", Ue, [
249
- e[15] || (e[15] = l("div", { class: "be-pane__label" }, "Markdown", -1)),
285
+ l("div", Ke, [
286
+ l("div", We, [
287
+ e[24] || (e[24] = l("div", { class: "be-pane__label" }, " Markdown ", -1)),
250
288
  l("textarea", {
251
289
  ref_key: "textareaEl",
252
- ref: V,
290
+ ref: B,
253
291
  class: "be-pane__textarea",
254
- value: i.value,
255
- onInput: ee,
292
+ value: r.value,
256
293
  placeholder: "Write your post in markdown…",
257
- spellcheck: "true"
258
- }, null, 40, Be)
294
+ spellcheck: "true",
295
+ onInput: de
296
+ }, null, 40, je)
259
297
  ]),
260
- l("div", Le, [
261
- e[16] || (e[16] = l("div", { class: "be-pane__label" }, "Preview", -1)),
298
+ l("div", ze, [
299
+ e[25] || (e[25] = l("div", { class: "be-pane__label" }, " Preview ", -1)),
262
300
  l("div", {
263
301
  class: "be-pane__preview prose",
264
- innerHTML: Y.value
265
- }, null, 8, Ve)
302
+ innerHTML: ue.value
303
+ }, null, 8, Je)
266
304
  ])
267
305
  ])
268
306
  ]),
269
- l("footer", De, [
270
- l("span", He, "~" + P(d.value) + " min read", 1),
307
+ l("footer", Qe, [
308
+ l("span", Xe, "~" + V(p.value) + " min read", 1),
271
309
  l("button", {
272
310
  type: "button",
273
311
  class: "be-publish",
274
- disabled: !D.value,
275
- onClick: se
276
- }, " Publish Post ", 8, Re)
312
+ disabled: !O.value,
313
+ onClick: me
314
+ }, " Publish Post ", 8, Ye)
277
315
  ])
278
316
  ]));
279
317
  }
280
318
  });
281
319
  export {
282
- Ne as default
320
+ al as default
283
321
  };
package/dist/index28.cjs CHANGED
@@ -1 +1 @@
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;
1
+ "use strict";const e=require("vue"),h=require("./index75.cjs"),f={class:"table-panel"},g={key:0,class:"dt-empty"},y={class:"dt-toolbar"},C=["placeholder","value"],v={class:"dt-pills"},B=["onClick"],E={class:"dt-count"},p={key:0,class:"dt-col-panel"},b=["checked","onChange"],V={class:"dt-scroll"},N=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,a=e.ref(!1),s=e.ref(null);function d(o){return h.getStatusLabel(o,i.statusLabels)}function r(o){var n;(n=s.value)!=null&&n.contains(o.target)||(a.value=!1,document.removeEventListener("click",r))}function m(){a.value=!a.value,a.value&&setTimeout(()=>document.addEventListener("click",r),0)}return(o,n)=>(e.openBlock(),e.createElementBlock("div",f,[t.totalCount===0?(e.openBlock(),e.createElementBlock("p",g,e.toDisplayString(t.emptyMessage),1)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",y,[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,C),e.createElementVNode("div",v,[(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,B))),128))]),e.createElementVNode("span",E,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 "),a.value?(e.openBlock(),e.createElementBlock("div",p,[(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,b),e.createTextVNode(" "+e.toDisplayString(l.label),1)]))),128))])):e.createCommentVNode("",!0)],512)):e.createCommentVNode("",!0)]),e.createElementVNode("div",V,[e.renderSlot(o.$slots,"default")])],64))]))}});module.exports=N;
package/dist/index28.mjs CHANGED
@@ -1,11 +1,12 @@
1
- import { defineComponent as V, ref as m, openBlock as l, createElementBlock as a, toDisplayString as u, Fragment as d, createElementVNode as n, renderList as k, normalizeClass as p, createCommentVNode as r, createTextVNode as D, renderSlot as L } from "vue";
1
+ import { defineComponent as p, ref as m, openBlock as l, createElementBlock as a, toDisplayString as u, Fragment as i, createElementVNode as s, renderList as k, normalizeClass as L, createCommentVNode as r, createTextVNode as V, renderSlot as D } from "vue";
2
+ import { getStatusLabel as S } from "./index75.mjs";
2
3
  const T = { class: "table-panel" }, E = {
3
4
  key: 0,
4
5
  class: "dt-empty"
5
- }, N = { class: "dt-toolbar" }, S = ["placeholder", "value"], x = { class: "dt-pills" }, F = ["onClick"], $ = { class: "dt-count" }, w = {
6
+ }, N = { class: "dt-toolbar" }, $ = ["placeholder", "value"], x = { class: "dt-pills" }, F = ["onClick"], w = { class: "dt-count" }, B = {
6
7
  key: 0,
7
8
  class: "dt-col-panel"
8
- }, B = ["checked", "onChange"], M = { class: "dt-scroll" }, R = /* @__PURE__ */ V({
9
+ }, M = ["checked", "onChange"], P = { class: "dt-scroll" }, z = /* @__PURE__ */ p({
9
10
  __name: "DataTable",
10
11
  props: {
11
12
  columnDefs: { default: () => [] },
@@ -21,36 +22,36 @@ const T = { class: "table-panel" }, E = {
21
22
  },
22
23
  emits: ["searchChange", "statusChange", "colToggle"],
23
24
  setup(e, { emit: g }) {
24
- const v = e, i = g, o = m(!1), h = m(null);
25
- function C(s) {
26
- return s === "all" ? "All" : v.statusLabels[s] ?? s;
25
+ const v = e, d = g, n = m(!1), h = m(null);
26
+ function C(o) {
27
+ return S(o, v.statusLabels);
27
28
  }
28
- function f(s) {
29
+ function f(o) {
29
30
  var c;
30
- (c = h.value) != null && c.contains(s.target) || (o.value = !1, document.removeEventListener("click", f));
31
+ (c = h.value) != null && c.contains(o.target) || (n.value = !1, document.removeEventListener("click", f));
31
32
  }
32
33
  function y() {
33
- o.value = !o.value, o.value && setTimeout(() => document.addEventListener("click", f), 0);
34
+ n.value = !n.value, n.value && setTimeout(() => document.addEventListener("click", f), 0);
34
35
  }
35
- return (s, c) => (l(), a("div", T, [
36
- e.totalCount === 0 ? (l(), a("p", E, u(e.emptyMessage), 1)) : (l(), a(d, { key: 1 }, [
37
- n("div", N, [
38
- e.statuses.length > 0 ? (l(), a(d, { key: 0 }, [
39
- n("input", {
36
+ return (o, c) => (l(), a("div", T, [
37
+ e.totalCount === 0 ? (l(), a("p", E, u(e.emptyMessage), 1)) : (l(), a(i, { key: 1 }, [
38
+ s("div", N, [
39
+ e.statuses.length > 0 ? (l(), a(i, { key: 0 }, [
40
+ s("input", {
40
41
  class: "dt-search",
41
42
  type: "search",
42
43
  placeholder: e.searchPlaceholder,
43
44
  value: e.searchValue,
44
- onInput: c[0] || (c[0] = (t) => i("searchChange", t.target.value))
45
- }, null, 40, S),
46
- n("div", x, [
47
- (l(!0), a(d, null, k(e.statuses, (t) => (l(), a("button", {
45
+ onInput: c[0] || (c[0] = (t) => d("searchChange", t.target.value))
46
+ }, null, 40, $),
47
+ s("div", x, [
48
+ (l(!0), a(i, null, k(e.statuses, (t) => (l(), a("button", {
48
49
  key: t,
49
- class: p(["dt-pill", { "dt-pill--active": e.statusFilter === t }]),
50
- onClick: (b) => i("statusChange", t)
50
+ class: L(["dt-pill", { "dt-pill--active": e.statusFilter === t }]),
51
+ onClick: (b) => d("statusChange", t)
51
52
  }, u(C(t)), 11, F))), 128))
52
53
  ]),
53
- n("span", $, u(e.filteredCount) + " of " + u(e.totalCount), 1)
54
+ s("span", w, u(e.filteredCount) + " of " + u(e.totalCount), 1)
54
55
  ], 64)) : r("", !0),
55
56
  e.columnDefs.length > 0 ? (l(), a("div", {
56
57
  key: 1,
@@ -58,32 +59,32 @@ const T = { class: "table-panel" }, E = {
58
59
  ref: h,
59
60
  class: "dt-col-wrap"
60
61
  }, [
61
- n("button", {
62
+ s("button", {
62
63
  class: "dt-col-btn",
63
64
  onClick: y
64
- }, "⚙ Columns"),
65
- o.value ? (l(), a("div", w, [
66
- (l(!0), a(d, null, k(e.columnDefs, (t) => (l(), a("label", {
65
+ }, " ⚙ Columns "),
66
+ n.value ? (l(), a("div", B, [
67
+ (l(!0), a(i, null, k(e.columnDefs, (t) => (l(), a("label", {
67
68
  key: t.key,
68
69
  class: "dt-col-check"
69
70
  }, [
70
- n("input", {
71
+ s("input", {
71
72
  type: "checkbox",
72
73
  checked: e.colVisibility[t.key] ?? !0,
73
- onChange: (b) => i("colToggle", t.key)
74
- }, null, 40, B),
75
- D(" " + u(t.label), 1)
74
+ onChange: (b) => d("colToggle", t.key)
75
+ }, null, 40, M),
76
+ V(" " + u(t.label), 1)
76
77
  ]))), 128))
77
78
  ])) : r("", !0)
78
79
  ], 512)) : r("", !0)
79
80
  ]),
80
- n("div", M, [
81
- L(s.$slots, "default")
81
+ s("div", P, [
82
+ D(o.$slots, "default")
82
83
  ])
83
84
  ], 64))
84
85
  ]));
85
86
  }
86
87
  });
87
88
  export {
88
- R as default
89
+ z as default
89
90
  };