@m2s2/vue-lib 2.5.2 → 2.6.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.
Files changed (138) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.mjs +58 -57
  3. package/dist/{index16.cjs → index17.cjs} +1 -1
  4. package/dist/{index16.mjs → index17.mjs} +1 -1
  5. package/dist/{index22.cjs → index23.cjs} +1 -1
  6. package/dist/{index22.mjs → index23.mjs} +1 -1
  7. package/dist/{index24.cjs → index25.cjs} +1 -1
  8. package/dist/{index24.mjs → index25.mjs} +1 -1
  9. package/dist/index27.cjs +2 -0
  10. package/dist/index27.mjs +363 -0
  11. package/dist/{index28.cjs → index29.cjs} +1 -1
  12. package/dist/{index28.mjs → index29.mjs} +1 -1
  13. package/dist/{index30.cjs → index31.cjs} +1 -1
  14. package/dist/{index30.mjs → index31.mjs} +1 -1
  15. package/dist/index35.cjs +1 -1
  16. package/dist/index35.mjs +40 -9
  17. package/dist/index36.cjs +1 -1
  18. package/dist/index36.mjs +9 -85
  19. package/dist/index37.cjs +1 -0
  20. package/dist/index37.mjs +87 -0
  21. package/dist/index39.cjs +1 -1
  22. package/dist/index39.mjs +30 -9
  23. package/dist/index40.cjs +1 -1
  24. package/dist/index40.mjs +9 -26
  25. package/dist/index41.cjs +1 -0
  26. package/dist/index41.mjs +28 -0
  27. package/dist/index43.cjs +1 -1
  28. package/dist/index43.mjs +30 -9
  29. package/dist/index44.cjs +1 -1
  30. package/dist/index44.mjs +9 -34
  31. package/dist/index45.cjs +1 -1
  32. package/dist/index45.mjs +34 -9
  33. package/dist/index46.cjs +1 -1
  34. package/dist/index46.mjs +9 -49
  35. package/dist/index47.cjs +1 -0
  36. package/dist/index47.mjs +51 -0
  37. package/dist/index51.cjs +1 -1
  38. package/dist/index51.mjs +27 -3
  39. package/dist/index52.cjs +1 -1
  40. package/dist/index52.mjs +1 -1
  41. package/dist/index53.cjs +1 -1
  42. package/dist/index53.mjs +1 -1
  43. package/dist/index54.cjs +1 -1
  44. package/dist/index54.mjs +1 -1
  45. package/dist/index55.cjs +1 -1
  46. package/dist/index55.mjs +1 -1
  47. package/dist/index56.cjs +1 -1
  48. package/dist/index56.mjs +1 -1
  49. package/dist/index57.cjs +1 -1
  50. package/dist/index57.mjs +1 -1
  51. package/dist/index58.cjs +1 -1
  52. package/dist/index58.mjs +1 -1
  53. package/dist/index59.cjs +1 -1
  54. package/dist/index59.mjs +1 -1
  55. package/dist/index60.cjs +1 -1
  56. package/dist/index60.mjs +1 -1
  57. package/dist/index61.cjs +1 -1
  58. package/dist/index61.mjs +1 -1
  59. package/dist/index62.cjs +1 -1
  60. package/dist/index62.mjs +1 -1
  61. package/dist/index63.cjs +1 -1
  62. package/dist/index63.mjs +1 -1
  63. package/dist/index64.cjs +1 -1
  64. package/dist/index64.mjs +1 -1
  65. package/dist/index65.cjs +1 -1
  66. package/dist/index65.mjs +1 -1
  67. package/dist/index66.cjs +1 -1
  68. package/dist/index66.mjs +1 -1
  69. package/dist/index67.cjs +1 -1
  70. package/dist/index67.mjs +3 -2
  71. package/dist/index68.cjs +1 -1
  72. package/dist/index68.mjs +2 -3
  73. package/dist/index69.cjs +1 -1
  74. package/dist/index69.mjs +3 -2
  75. package/dist/index70.cjs +1 -1
  76. package/dist/index70.mjs +2 -3
  77. package/dist/index71.cjs +1 -1
  78. package/dist/index71.mjs +3 -2
  79. package/dist/index72.cjs +1 -1
  80. package/dist/index72.mjs +1 -1
  81. package/dist/index73.cjs +1 -1
  82. package/dist/index73.mjs +2 -3
  83. package/dist/index74.cjs +1 -1
  84. package/dist/index74.mjs +1 -1
  85. package/dist/index75.cjs +1 -1
  86. package/dist/index75.mjs +3 -51
  87. package/dist/index76.cjs +1 -59
  88. package/dist/index76.mjs +51 -1150
  89. package/dist/index77.cjs +1 -1
  90. package/dist/index77.mjs +5 -21
  91. package/dist/index78.cjs +59 -5
  92. package/dist/index78.mjs +1150 -19
  93. package/dist/index79.cjs +1 -1
  94. package/dist/index79.mjs +21 -5
  95. package/dist/index80.cjs +5 -1
  96. package/dist/index80.mjs +19 -4
  97. package/dist/index81.cjs +1 -1
  98. package/dist/index81.mjs +4 -2
  99. package/dist/index82.cjs +1 -0
  100. package/dist/index82.mjs +4 -0
  101. package/dist/vue-lib/src/components/BlogEditor/BlogEditor.vue.d.ts +9 -0
  102. package/dist/vue-lib/src/components/BlogEditor/BlogEditor.vue.d.ts.map +1 -1
  103. package/dist/vue-lib/src/index.d.ts +1 -0
  104. package/dist/vue-lib/src/index.d.ts.map +1 -1
  105. package/dist/vue-lib.css +1 -1
  106. package/package.json +1 -1
  107. package/dist/index26.cjs +0 -2
  108. package/dist/index26.mjs +0 -321
  109. package/dist/index34.cjs +0 -1
  110. package/dist/index34.mjs +0 -42
  111. package/dist/index38.cjs +0 -1
  112. package/dist/index38.mjs +0 -32
  113. package/dist/index42.cjs +0 -1
  114. package/dist/index42.mjs +0 -32
  115. package/dist/index50.cjs +0 -1
  116. package/dist/index50.mjs +0 -29
  117. /package/dist/{index10.cjs → index11.cjs} +0 -0
  118. /package/dist/{index10.mjs → index11.mjs} +0 -0
  119. /package/dist/{index12.cjs → index13.cjs} +0 -0
  120. /package/dist/{index12.mjs → index13.mjs} +0 -0
  121. /package/dist/{index14.cjs → index15.cjs} +0 -0
  122. /package/dist/{index14.mjs → index15.mjs} +0 -0
  123. /package/dist/{index18.cjs → index19.cjs} +0 -0
  124. /package/dist/{index18.mjs → index19.mjs} +0 -0
  125. /package/dist/{index20.cjs → index21.cjs} +0 -0
  126. /package/dist/{index20.mjs → index21.mjs} +0 -0
  127. /package/dist/{index2.cjs → index3.cjs} +0 -0
  128. /package/dist/{index2.mjs → index3.mjs} +0 -0
  129. /package/dist/{index32.cjs → index33.cjs} +0 -0
  130. /package/dist/{index32.mjs → index33.mjs} +0 -0
  131. /package/dist/{index48.cjs → index49.cjs} +0 -0
  132. /package/dist/{index48.mjs → index49.mjs} +0 -0
  133. /package/dist/{index4.cjs → index5.cjs} +0 -0
  134. /package/dist/{index4.mjs → index5.mjs} +0 -0
  135. /package/dist/{index6.cjs → index7.cjs} +0 -0
  136. /package/dist/{index6.mjs → index7.mjs} +0 -0
  137. /package/dist/{index8.cjs → index9.cjs} +0 -0
  138. /package/dist/{index8.mjs → index9.mjs} +0 -0
package/dist/index26.mjs DELETED
@@ -1,321 +0,0 @@
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 "./index76.mjs";
3
- import { todayAsIsoDate as xe, generateSlug as se, calcReadingTime as ie } from "./index77.mjs";
4
- import { BLOG_EDITOR_TOOLBAR as Pe } from "./index78.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 = {
6
- class: "be-toolbar",
7
- role: "toolbar",
8
- "aria-label": "Formatting"
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({
10
- __name: "BlogEditor",
11
- props: {
12
- initialPost: { default: void 0 },
13
- coverImageUrl: { default: void 0 }
14
- },
15
- emits: ["publish", "coverImageSelected"],
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);
22
- });
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);
26
- }
27
- function de(a) {
28
- r.value = a.target.value, p.value = ie(r.value);
29
- }
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 = "";
35
- }
36
- a.key === "Backspace" && !y.value && n.value.length && (n.value = n.value.slice(0, -1));
37
- }
38
- function be(a) {
39
- n.value = n.value.filter((e) => e !== a);
40
- }
41
- function pe(a) {
42
- var o;
43
- const e = (o = a.target.files) == null ? void 0 : o[0];
44
- if (!e) return;
45
- R("coverImageSelected", e);
46
- const t = new FileReader();
47
- t.onload = () => {
48
- k.value = t.result;
49
- }, t.readAsDataURL(e);
50
- }
51
- function ce(a) {
52
- const e = B.value;
53
- if (!e) return;
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;
65
- else
66
- return;
67
- r.value = S, setTimeout(() => {
68
- e.selectionStart = e.selectionEnd = h, e.focus();
69
- }, 0);
70
- }
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
85
- });
86
- }
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 "),
92
- l("span", { class: "be-required" }, "*")
93
- ], -1)),
94
- l("input", {
95
- class: "be-input",
96
- type: "text",
97
- value: b.value,
98
- placeholder: "Post title…",
99
- onInput: re
100
- }, null, 40, Ie)
101
- ]),
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),
106
- class: "be-input",
107
- type: "text",
108
- placeholder: "post-slug",
109
- onInput: e[1] || (e[1] = (t) => E.value = !0)
110
- }, null, 544), [
111
- [v, f.value]
112
- ])
113
- ]),
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),
118
- class: "be-input",
119
- type: "date"
120
- }, null, 512), [
121
- [v, x.value]
122
- ])
123
- ]),
124
- l("div", he, [
125
- e[14] || (e[14] = l("label", { class: "be-label" }, [
126
- g("Summary "),
127
- l("span", { class: "be-required" }, "*")
128
- ], -1)),
129
- d(l("textarea", {
130
- "onUpdate:modelValue": e[3] || (e[3] = (t) => _.value = t),
131
- class: "be-input be-input--textarea",
132
- rows: "2",
133
- placeholder: "Short description shown in blog listings…"
134
- }, null, 512), [
135
- [v, _.value]
136
- ])
137
- ]),
138
- l("div", Ve, [
139
- e[15] || (e[15] = l("label", { class: "be-label" }, [
140
- g("Excerpt "),
141
- l("span", { class: "be-optional" }, "(optional)")
142
- ], -1)),
143
- d(l("textarea", {
144
- "onUpdate:modelValue": e[4] || (e[4] = (t) => P.value = t),
145
- class: "be-input be-input--textarea",
146
- rows: "2",
147
- placeholder: "Longer teaser for social previews…"
148
- }, null, 512), [
149
- [v, P.value]
150
- ])
151
- ]),
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,
157
- class: "be-tag"
158
- }, [
159
- g(V(t) + " ", 1),
160
- l("button", {
161
- type: "button",
162
- class: "be-tag__remove",
163
- "aria-label": `Remove tag ${t}`,
164
- onClick: (o) => be(t)
165
- }, "×", 8, Le)
166
- ]))), 128)),
167
- d(l("input", {
168
- "onUpdate:modelValue": e[5] || (e[5] = (t) => y.value = t),
169
- class: "be-tag-input",
170
- type: "text",
171
- placeholder: "Add tag, press Enter…",
172
- onKeydown: ve
173
- }, null, 544), [
174
- [v, y.value]
175
- ])
176
- ])
177
- ]),
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),
182
- class: "be-input be-input--narrow",
183
- type: "number",
184
- min: "1"
185
- }, null, 512), [
186
- [
187
- v,
188
- p.value,
189
- void 0,
190
- { number: !0 }
191
- ]
192
- ])
193
- ]),
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", {
198
- key: 0,
199
- class: "be-cover__preview",
200
- src: D.value,
201
- alt: "Cover preview"
202
- }, null, 8, Ae)) : _e("", !0),
203
- l("label", Fe, [
204
- g(V(D.value ? "Replace" : "Choose image") + " ", 1),
205
- l("input", {
206
- type: "file",
207
- accept: "image/*",
208
- hidden: "",
209
- onChange: pe
210
- }, null, 32)
211
- ])
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
- ])
273
- ])
274
- ]),
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,
279
- type: "button",
280
- class: "be-toolbar__btn",
281
- title: t.label,
282
- onClick: (o) => ce(t)
283
- }, V(t.icon), 9, Ge))), 128))
284
- ]),
285
- l("div", Ke, [
286
- l("div", We, [
287
- e[24] || (e[24] = l("div", { class: "be-pane__label" }, " Markdown ", -1)),
288
- l("textarea", {
289
- ref_key: "textareaEl",
290
- ref: B,
291
- class: "be-pane__textarea",
292
- value: r.value,
293
- placeholder: "Write your post in markdown…",
294
- spellcheck: "true",
295
- onInput: de
296
- }, null, 40, je)
297
- ]),
298
- l("div", ze, [
299
- e[25] || (e[25] = l("div", { class: "be-pane__label" }, " Preview ", -1)),
300
- l("div", {
301
- class: "be-pane__preview prose",
302
- innerHTML: ue.value
303
- }, null, 8, Je)
304
- ])
305
- ])
306
- ]),
307
- l("footer", Qe, [
308
- l("span", Xe, "~" + V(p.value) + " min read", 1),
309
- l("button", {
310
- type: "button",
311
- class: "be-publish",
312
- disabled: !O.value,
313
- onClick: me
314
- }, " Publish Post ", 8, Ye)
315
- ])
316
- ]));
317
- }
318
- });
319
- export {
320
- al as default
321
- };
package/dist/index34.cjs DELETED
@@ -1 +0,0 @@
1
- "use strict";const e=require("vue"),u=require("./index32.cjs");;/* empty css */const i=require("./index35.cjs"),c=e.defineComponent({__name:"DialogProvider",setup(s){const t=e.ref(null);function o(r){return new Promise(n=>{t.value={data:r,resolve:n}})}function a(r,n){return o({title:r,message:n,actions:[{label:"Cancel",value:!1,variant:"secondary"},{label:"Confirm",value:!0,variant:"primary"}]})}function l(r){var n;(n=t.value)==null||n.resolve(r),t.value=null}return e.provide(i.DIALOG_KEY,{dialog:o,confirm:a}),(r,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.renderSlot(r.$slots,"default"),t.value?(e.openBlock(),e.createBlock(u,{key:0,data:t.value.data,open:!0,onAction:l,onClose:n[0]||(n[0]=v=>l(null))},null,8,["data"])):e.createCommentVNode("",!0)],64))}});module.exports=c;
package/dist/index34.mjs DELETED
@@ -1,42 +0,0 @@
1
- import { defineComponent as u, ref as i, provide as m, openBlock as a, createElementBlock as c, Fragment as s, renderSlot as f, createBlock as v, createCommentVNode as p } from "vue";
2
- import d from "./index32.mjs";
3
- /* empty css */
4
- import { DIALOG_KEY as _ } from "./index35.mjs";
5
- const b = /* @__PURE__ */ u({
6
- __name: "DialogProvider",
7
- setup(C) {
8
- const o = i(null);
9
- function r(n) {
10
- return new Promise((e) => {
11
- o.value = { data: n, resolve: e };
12
- });
13
- }
14
- function l(n, e) {
15
- return r({
16
- title: n,
17
- message: e,
18
- actions: [
19
- { label: "Cancel", value: !1, variant: "secondary" },
20
- { label: "Confirm", value: !0, variant: "primary" }
21
- ]
22
- });
23
- }
24
- function t(n) {
25
- var e;
26
- (e = o.value) == null || e.resolve(n), o.value = null;
27
- }
28
- return m(_, { dialog: r, confirm: l }), (n, e) => (a(), c(s, null, [
29
- f(n.$slots, "default"),
30
- o.value ? (a(), v(d, {
31
- key: 0,
32
- data: o.value.data,
33
- open: !0,
34
- onAction: t,
35
- onClose: e[0] || (e[0] = (k) => t(null))
36
- }, null, 8, ["data"])) : p("", !0)
37
- ], 64));
38
- }
39
- });
40
- export {
41
- b as default
42
- };
package/dist/index38.cjs DELETED
@@ -1 +0,0 @@
1
- "use strict";const e=require("vue"),u=require("./index36.cjs");;/* empty css */const a=require("./index39.cjs"),s=e.defineComponent({__name:"PanelProvider",setup(c){const t=e.ref(null);function o(r){return new Promise(n=>{t.value={data:r,resolve:n}})}function l(r){var n;(n=t.value)==null||n.resolve(r),t.value=null}return e.provide(a.PANEL_KEY,{panel:o}),(r,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.renderSlot(r.$slots,"default"),t.value?(e.openBlock(),e.createBlock(u,{key:0,data:t.value.data,open:!0,onAction:l,onClose:n[0]||(n[0]=i=>l(null))},null,8,["data"])):e.createCommentVNode("",!0)],64))}});module.exports=s;
package/dist/index38.mjs DELETED
@@ -1,32 +0,0 @@
1
- import { defineComponent as a, ref as u, provide as m, openBlock as r, createElementBlock as i, Fragment as c, renderSlot as p, createBlock as s, createCommentVNode as f } from "vue";
2
- import d from "./index36.mjs";
3
- /* empty css */
4
- import { PANEL_KEY as v } from "./index39.mjs";
5
- const $ = /* @__PURE__ */ a({
6
- __name: "PanelProvider",
7
- setup(_) {
8
- const n = u(null);
9
- function l(o) {
10
- return new Promise((e) => {
11
- n.value = { data: o, resolve: e };
12
- });
13
- }
14
- function t(o) {
15
- var e;
16
- (e = n.value) == null || e.resolve(o), n.value = null;
17
- }
18
- return m(v, { panel: l }), (o, e) => (r(), i(c, null, [
19
- p(o.$slots, "default"),
20
- n.value ? (r(), s(d, {
21
- key: 0,
22
- data: n.value.data,
23
- open: !0,
24
- onAction: t,
25
- onClose: e[0] || (e[0] = (k) => t(null))
26
- }, null, 8, ["data"])) : f("", !0)
27
- ], 64));
28
- }
29
- });
30
- export {
31
- $ as default
32
- };
package/dist/index42.cjs DELETED
@@ -1 +0,0 @@
1
- "use strict";const t=require("vue"),c=require("./index43.cjs"),u="m2s2-theme",d=t.defineComponent({__name:"ThemeProvider",props:{defaultTheme:{default:"auto"}},setup(r){const n=r;function m(){return localStorage.getItem(u)??n.defaultTheme}function a(e){e==="auto"?document.documentElement.removeAttribute("data-theme"):document.documentElement.setAttribute("data-theme",e)}const o=t.ref(n.defaultTheme);t.onMounted(()=>{o.value=m()}),t.watch(o,e=>{localStorage.setItem(u,e),a(e)},{immediate:!1});function s(e){o.value=e}return t.provide(c.THEME_KEY,{get theme(){return o.value},setTheme:s}),(e,l)=>t.renderSlot(e.$slots,"default")}});module.exports=d;
package/dist/index42.mjs DELETED
@@ -1,32 +0,0 @@
1
- import { defineComponent as d, ref as l, onMounted as c, watch as s, provide as f, renderSlot as i } from "vue";
2
- import { THEME_KEY as h } from "./index43.mjs";
3
- const m = "m2s2-theme", _ = /* @__PURE__ */ d({
4
- __name: "ThemeProvider",
5
- props: {
6
- defaultTheme: { default: "auto" }
7
- },
8
- setup(a) {
9
- const o = a;
10
- function n() {
11
- return localStorage.getItem(m) ?? o.defaultTheme;
12
- }
13
- function r(e) {
14
- e === "auto" ? document.documentElement.removeAttribute("data-theme") : document.documentElement.setAttribute("data-theme", e);
15
- }
16
- const t = l(o.defaultTheme);
17
- c(() => {
18
- t.value = n();
19
- }), s(t, (e) => {
20
- localStorage.setItem(m, e), r(e);
21
- }, { immediate: !1 });
22
- function u(e) {
23
- t.value = e;
24
- }
25
- return f(h, { get theme() {
26
- return t.value;
27
- }, setTheme: u }), (e, p) => i(e.$slots, "default");
28
- }
29
- });
30
- export {
31
- _ as default
32
- };
package/dist/index50.cjs DELETED
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("vue"),l=require("./index43.cjs"),a=require("./index34.cjs"),m=require("./index38.cjs"),d=require("./index42.cjs"),n="m2s2-theme";function i(e){typeof document>"u"||(e==="auto"?document.documentElement.removeAttribute("data-theme"):document.documentElement.setAttribute("data-theme",e))}function s(e={}){return{install(t){const c=(typeof localStorage<"u"?localStorage.getItem(n):null)??e.defaultTheme??"auto",r=u.ref(c);i(r.value),u.watch(r,o=>{typeof localStorage<"u"&&localStorage.setItem(n,o),i(o)}),t.provide(l.THEME_KEY,{get theme(){return r.value},setTheme(o){r.value=o}}),t.component("M2S2ThemeProvider",d),t.component("M2S2DialogProvider",a),t.component("M2S2PanelProvider",m)}}}exports.createM2S2=s;
package/dist/index50.mjs DELETED
@@ -1,29 +0,0 @@
1
- import { ref as i, watch as c } from "vue";
2
- import { THEME_KEY as l } from "./index43.mjs";
3
- import u from "./index34.mjs";
4
- import f from "./index38.mjs";
5
- import d from "./index42.mjs";
6
- const n = "m2s2-theme";
7
- function r(e) {
8
- typeof document > "u" || (e === "auto" ? document.documentElement.removeAttribute("data-theme") : document.documentElement.setAttribute("data-theme", e));
9
- }
10
- function _(e = {}) {
11
- return {
12
- install(t) {
13
- const a = (typeof localStorage < "u" ? localStorage.getItem(n) : null) ?? e.defaultTheme ?? "auto", o = i(a);
14
- r(o.value), c(o, (m) => {
15
- typeof localStorage < "u" && localStorage.setItem(n, m), r(m);
16
- }), t.provide(l, {
17
- get theme() {
18
- return o.value;
19
- },
20
- setTheme(m) {
21
- o.value = m;
22
- }
23
- }), t.component("M2S2ThemeProvider", d), t.component("M2S2DialogProvider", u), t.component("M2S2PanelProvider", f);
24
- }
25
- };
26
- }
27
- export {
28
- _ as createM2S2
29
- };
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes