@ozdao/prometheus-framework 0.1.20 → 0.1.22

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. package/dist/BackofficeGallery-08d96af1.mjs +305 -0
  2. package/dist/BackofficeGallery-2e695fed.js +1 -0
  3. package/dist/BackofficeGallery-7ae8fbba.mjs +307 -0
  4. package/dist/BackofficeGallery-fe39cff3.js +1 -0
  5. package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-8660f9cb.js +1 -0
  6. package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-bd3889ee.mjs +1945 -0
  7. package/dist/ButtonFollow-81508d85.mjs +132 -0
  8. package/dist/ButtonFollow-df6317f0.js +1 -0
  9. package/dist/CardOrganization-d8f209ee.js +1 -0
  10. package/dist/CardOrganization-de8ec36e.mjs +230 -0
  11. package/dist/Feed-a75d053e.js +1 -0
  12. package/dist/Feed-c4084664.mjs +368 -0
  13. package/dist/Feed-fea84ce7.mjs +439 -0
  14. package/dist/Feed-ff3b96b2.js +1 -0
  15. package/dist/Image-1281bc48.mjs +477 -0
  16. package/dist/Image-8e67dd2d.js +9 -0
  17. package/dist/Popup-b7609baa.js +1 -0
  18. package/dist/Popup-d5c4cb46.mjs +76 -0
  19. package/dist/Product-3c7b2921.mjs +841 -0
  20. package/dist/Product-6df77924.js +7 -0
  21. package/dist/ProductEdit-737e2a5a.mjs +302 -0
  22. package/dist/ProductEdit-c99ab559.js +1 -0
  23. package/dist/ProfileBlogposts-4293a1e3.js +1 -0
  24. package/dist/ProfileBlogposts-4c326fed.mjs +65 -0
  25. package/dist/ProfileComments-03f88b54.mjs +44 -0
  26. package/dist/ProfileComments-761ce00e.js +1 -0
  27. package/dist/ProfileEvents-0bdd36e4.mjs +57 -0
  28. package/dist/ProfileEvents-a9b96fec.js +1 -0
  29. package/dist/ProfileLikes-3edf6fb8.mjs +44 -0
  30. package/dist/ProfileLikes-51729962.js +1 -0
  31. package/dist/ProfileOrganizations-8961aaee.mjs +213 -0
  32. package/dist/ProfileOrganizations-f52e62e1.js +1 -0
  33. package/dist/Publics-70a0ca9c.mjs +45 -0
  34. package/dist/Publics-bbab7a79.js +1 -0
  35. package/dist/Select-90d4b7c8.mjs +81 -0
  36. package/dist/Select-b9299fb6.js +1 -0
  37. package/dist/Select.vue_vue_type_style_index_0_scoped_a78dbba1_lang-0ea8fbf8.js +1 -0
  38. package/dist/Select.vue_vue_type_style_index_0_scoped_a78dbba1_lang-4ed993c7.mjs +1 -0
  39. package/dist/UploadImage-c9711af2.js +1 -0
  40. package/dist/UploadImage-ec3714e8.mjs +83 -0
  41. package/dist/UploadImageMultiple-b4c8d627.js +1 -0
  42. package/dist/UploadImageMultiple-ebcc51e6.mjs +58 -0
  43. package/dist/auth-78d9392a.mjs +612 -0
  44. package/dist/auth-96449d96.js +7 -0
  45. package/dist/auth.client.cjs +8 -8
  46. package/dist/auth.client.js +8 -8
  47. package/dist/auth.validation-9e493d2f.mjs +20 -0
  48. package/dist/auth.validation-d4795c25.js +1 -0
  49. package/dist/backoffice.client.cjs +1 -1
  50. package/dist/backoffice.client.js +41 -48
  51. package/dist/community.client.cjs +1 -1
  52. package/dist/community.client.js +44 -42
  53. package/dist/events.client.cjs +2 -2
  54. package/dist/events.client.js +25 -24
  55. package/dist/index-2a0269fc.js +2 -0
  56. package/dist/index-9128ade5.mjs +1228 -0
  57. package/dist/landing.client.cjs +1 -1
  58. package/dist/organizations-0fb56927.mjs +122 -0
  59. package/dist/organizations-195ec134.js +1 -0
  60. package/dist/organizations.client-b39db194.js +3 -0
  61. package/dist/organizations.client-df5e8a6f.mjs +3020 -0
  62. package/dist/organizations.client.cjs +1 -1
  63. package/dist/organizations.client.js +46 -44
  64. package/dist/style.css +1 -1
  65. package/dist/users.client.cjs +1 -1
  66. package/dist/users.client.js +23 -23
  67. package/package.json +1 -1
  68. package/src/modules/backoffice/components/layouts/Backoffice.vue +0 -13
  69. package/src/modules/gallery/components/sections/BackofficeGallery.vue +13 -12
@@ -0,0 +1,477 @@
1
+ import { ref as p, onUpdated as F, nextTick as b, onMounted as I, openBlock as i, createElementBlock as d, withDirectives as B, createElementVNode as v, vModelText as $, watch as E, createTextVNode as j, toDisplayString as U, withModifiers as D, watchEffect as K, unref as _, createBlock as R, withCtx as L, Fragment as V, renderList as A, resolveDynamicComponent as P, normalizeClass as W, createVNode as H, Transition as q, createCommentVNode as w } from "vue";
2
+ import { a as S } from "./index-9128ade5.mjs";
3
+ import { V as G } from "./vue-draggable-next.esm-bundler-ff6e3f52.mjs";
4
+ import { _ as J } from "./Chips-03ff0c34.mjs";
5
+ const O = ["placeholder"], Q = {
6
+ __name: "Textarea",
7
+ props: ["prop", "value", "content", "placeholder", "index", "setFocus"],
8
+ emits: ["deleteBlock", "updateBlock", "addBlock", "focus"],
9
+ setup(n, { emit: s }) {
10
+ const t = n;
11
+ p(t);
12
+ const e = p(null);
13
+ p(0);
14
+ function f(o) {
15
+ let l = o.target.value.split(/\n+/);
16
+ if (l.length > 1) {
17
+ t.prop[t.content] = l[0], b(() => {
18
+ a();
19
+ });
20
+ let r = l.slice(1).map((h) => ({ __name: "Textarea", content: h }));
21
+ s("addBlock", "Textarea", "", t.index, { blocks: r, ref: e });
22
+ } else
23
+ o.target.value.trim() === "" && o.target.value.includes(`
24
+
25
+ `) && (console.log("We are adding new block:" + t.index + newBlocks + e), s("addBlock", "Textarea", "", t.index, { blocks: newBlocks, ref: e })), a();
26
+ }
27
+ function u(o) {
28
+ (o.keyCode === 8 || o.keyCode === 46) && t.prop[t.content].trim() === "" && s("deleteBlock", t.prop);
29
+ }
30
+ function c() {
31
+ b(() => {
32
+ e.value.focus(), s("updateBlock", t.prop, { setFocus: !1 });
33
+ });
34
+ }
35
+ function a() {
36
+ e.value.style.height = "1rem", e.value.style.height = e.value.scrollHeight + "px";
37
+ }
38
+ return F(() => {
39
+ t.setFocus && b(() => {
40
+ c();
41
+ }), a();
42
+ }), I(() => {
43
+ t.setFocus && b(() => {
44
+ c();
45
+ }), a();
46
+ }), (o, l) => (i(), d("div", null, [
47
+ B(v("textarea", {
48
+ "onUpdate:modelValue": l[0] || (l[0] = (r) => n.prop[n.content] = r),
49
+ placeholder: n.placeholder ? n.placeholder : "Enter text",
50
+ onInput: f,
51
+ onFocus: l[1] || (l[1] = (r) => s("focus", e.value)),
52
+ onKeyup: u,
53
+ ref_key: "textarea",
54
+ ref: e,
55
+ class: "text-area mn-thin"
56
+ }, `
57
+ `, 40, O), [
58
+ [$, n.prop[n.content]]
59
+ ])
60
+ ]));
61
+ }
62
+ };
63
+ const X = ["placeholder"], Y = {
64
+ __name: "H2",
65
+ props: ["obj", "label", "prop", "value", "content", "textarea", "placeholder", "index", "ref", "setFocus"],
66
+ emits: ["deleteBlock", "updateBlock", "addBlock", "focus"],
67
+ setup(n, { emit: s }) {
68
+ const t = n;
69
+ p(t);
70
+ const e = p(null);
71
+ p(0);
72
+ function f(o) {
73
+ let l = o.target.value.split(/\n+/);
74
+ if (l.length > 1) {
75
+ t.prop[t.content] = l[0], b(() => {
76
+ a();
77
+ });
78
+ let r = l.slice(1).map((h) => ({ type: "Textarea", content: h }));
79
+ s("addBlock", "Textarea", "", t.index, { blocks: r, ref: e });
80
+ } else
81
+ o.target.value.trim() === "" && o.target.value.includes(`
82
+
83
+ `) && (console.log("We are adding new block:" + t.index + newBlocks + e), s("addBlock", "Textarea", "", t.index, { blocks: newBlocks, ref: e })), a();
84
+ }
85
+ function u(o) {
86
+ (o.keyCode === 8 || o.keyCode === 46) && t.prop[t.content].trim() === "" && s("deleteBlock", t.prop);
87
+ }
88
+ function c() {
89
+ b(() => {
90
+ e.value.focus(), s("updateBlock", t.prop, { setFocus: !1 });
91
+ });
92
+ }
93
+ function a() {
94
+ e.value.style.height = "1rem", e.value.style.height = e.value.scrollHeight + "px";
95
+ }
96
+ return F(() => {
97
+ t.setFocus && b(() => {
98
+ c();
99
+ }), a();
100
+ }), I(() => {
101
+ t.setFocus && b(() => {
102
+ c();
103
+ }), a();
104
+ }), E(() => t.prop[t.content], (o) => {
105
+ }), (o, l) => (i(), d("div", null, [
106
+ B(v("textarea", {
107
+ "onUpdate:modelValue": l[0] || (l[0] = (r) => n.prop[n.content] = r),
108
+ placeholder: n.placeholder ? n.placeholder : "Enter text",
109
+ onInput: f,
110
+ onFocus: l[1] || (l[1] = (r) => s("focus", e.value)),
111
+ onKeyup: u,
112
+ ref_key: "textarea",
113
+ ref: e,
114
+ class: "h3 text-area mn-thin"
115
+ }, `
116
+ `, 40, X), [
117
+ [$, n.prop[n.content]]
118
+ ])
119
+ ]));
120
+ }
121
+ }, Z = ["placeholder"], ee = {
122
+ __name: "Caption",
123
+ props: ["obj", "label", "prop", "value", "content", "textarea", "placeholder", "index", "ref"],
124
+ emits: ["deleteBlock", "addBlock", "focus"],
125
+ setup(n, { emit: s }) {
126
+ const t = n;
127
+ p(t);
128
+ const e = p(null);
129
+ function f(c) {
130
+ const a = /^\s*[-*]\s+(.*)/;
131
+ let l = c.target.value.split(/\n+/).map((r) => {
132
+ const h = a.exec(r);
133
+ return h ? h[1] : null;
134
+ }).filter((r) => r !== null);
135
+ l.length > 0 ? (t.prop[t.content] = l, u()) : c.target.value.trim() === "" && (t.prop[t.content] = [], u());
136
+ }
137
+ function u() {
138
+ e.value.style.height = "1rem", e.value.style.height = e.value.scrollHeight + "px";
139
+ }
140
+ return F(() => {
141
+ u();
142
+ }), I(() => {
143
+ u();
144
+ }), E(() => t.prop[t.content], (c) => {
145
+ (!c || c.length === 0) && s("deleteBlock", t.prop);
146
+ }), (c, a) => (i(), d("div", null, [
147
+ B(v("textarea", {
148
+ "onUpdate:modelValue": a[0] || (a[0] = (o) => n.prop[n.content] = o),
149
+ placeholder: n.placeholder ? n.placeholder : "Enter text",
150
+ onInput: f,
151
+ onFocus: a[1] || (a[1] = (o) => s("focus", e.value)),
152
+ ref_key: "textarea",
153
+ ref: e,
154
+ class: "br-l br-solid br-main pd-l-small text-area mn-small"
155
+ }, `
156
+ `, 40, Z), [
157
+ [$, n.prop[n.content]]
158
+ ])
159
+ ]));
160
+ }
161
+ }, te = ["placeholder"], ne = {
162
+ __name: "Bullets",
163
+ props: ["obj", "label", "prop", "value", "content", "textarea", "placeholder", "index", "ref"],
164
+ emits: ["deleteBlock", "addBlock", "focus"],
165
+ setup(n, { emit: s }) {
166
+ const t = n;
167
+ p(t);
168
+ const e = p(null);
169
+ function f(c) {
170
+ const a = /^\s*[-*]\s+(.*)/;
171
+ let l = c.target.value.split(/\n+/).map((r) => {
172
+ const h = a.exec(r);
173
+ return h ? h[1] : null;
174
+ }).filter((r) => r !== null);
175
+ l.length > 0 ? (t.prop[t.content] = l, u()) : c.target.value.trim() === "" && (t.prop[t.content] = [], u());
176
+ }
177
+ function u() {
178
+ e.value.style.height = "1rem", e.value.style.height = e.value.scrollHeight + "px";
179
+ }
180
+ return F(() => {
181
+ u();
182
+ }), I(() => {
183
+ u();
184
+ }), E(() => t.prop[t.content], (c) => {
185
+ (!c || c.length === 0) && s("deleteBlock", t.prop);
186
+ }), (c, a) => (i(), d("div", null, [
187
+ j(U(n.prop[n.content]) + " ", 1),
188
+ B(v("textarea", {
189
+ "onUpdate:modelValue": a[0] || (a[0] = (o) => n.prop[n.content] = o),
190
+ placeholder: n.placeholder ? n.placeholder : "Enter text",
191
+ onInput: f,
192
+ onFocus: a[1] || (a[1] = (o) => s("focus", e.value)),
193
+ ref_key: "textarea",
194
+ ref: e,
195
+ class: "text-area mn-small"
196
+ }, `
197
+ `, 40, te), [
198
+ [$, n.prop[n.content]]
199
+ ])
200
+ ]));
201
+ }
202
+ }, le = ["src"], oe = {
203
+ key: 1,
204
+ class: "t-transp pd-extra"
205
+ }, ae = {
206
+ __name: "ImageUpload",
207
+ props: [
208
+ "label",
209
+ "value",
210
+ "prop"
211
+ ],
212
+ emits: ["input", "updateBlock"],
213
+ setup(n, { emit: s }) {
214
+ const t = n, e = p(null), f = p(null);
215
+ function u() {
216
+ f.value.click();
217
+ }
218
+ async function c(o) {
219
+ let l = o.target.files[0];
220
+ console.log(l);
221
+ let r = new FormData(), h = "unsorted";
222
+ r.append("file", l), console.log(r.has("file"));
223
+ try {
224
+ let y = await S.create({ baseURL: process.env.API_URL, withCredentials: !0 }).post(`/api/upload/file?folderName=${encodeURIComponent(h)}`, r, {
225
+ headers: {
226
+ "Content-Type": "multipart/form-data"
227
+ }
228
+ });
229
+ e.value = y.data.filepath, console.log(e.value), s("input", e.value), s("updateBlock", t.prop, { content: e.value });
230
+ } catch (C) {
231
+ console.error(C);
232
+ }
233
+ }
234
+ function a(o) {
235
+ o.preventDefault(), c({
236
+ target: {
237
+ files: o.dataTransfer.files
238
+ }
239
+ });
240
+ }
241
+ return (o, l) => (i(), d("div", {
242
+ onClick: u,
243
+ onDrop: a,
244
+ onDragover: l[0] || (l[0] = D(() => {
245
+ }, ["prevent"])),
246
+ class: "w-100 radius-big bg-white image-upload-area flex-v-center flex-h-center flex t-black mn-small"
247
+ }, [
248
+ n.prop.content ? (i(), d("img", {
249
+ key: 0,
250
+ src: (o.FILE_SERVER_URL || "") + n.prop.content,
251
+ alt: "Uploaded image",
252
+ class: "w-100 h-30r object-fit-contain"
253
+ }, null, 8, le)) : (i(), d("span", oe, "Click or drag-and-drop your image")),
254
+ v("input", {
255
+ type: "file",
256
+ ref_key: "fileInput",
257
+ ref: f,
258
+ onChange: c,
259
+ style: { display: "none" }
260
+ }, null, 544)
261
+ ], 32));
262
+ }
263
+ }, se = ["onMouseover"], ce = {
264
+ key: 0,
265
+ class: "z-index-5 radius-thin mn-small relative left-0 mt-2 w-max bg-white shadow-lg rounded"
266
+ }, re = ["onClick"], ue = ["onClick"], ie = ["onClick"], Ce = {
267
+ __name: "Constructor",
268
+ props: ["content"],
269
+ emits: ["update"],
270
+ setup(n, { emit: s }) {
271
+ const t = n;
272
+ let e = p(null);
273
+ p(null), e.value = { content: t.content };
274
+ const f = {
275
+ Textarea: Q,
276
+ H2: Y,
277
+ Bullets: ne,
278
+ Caption: ee,
279
+ ImageUpload: ae
280
+ };
281
+ function u(y = "Textarea", x = "", m, g) {
282
+ console.log("We are adding new block (functuin HandleAddBlock):" + y + x + m + g);
283
+ let k = {
284
+ order: e.value.content.length + 1,
285
+ type: y,
286
+ style: "",
287
+ class: "",
288
+ content: x,
289
+ blocks: [],
290
+ setFocus: !0
291
+ };
292
+ if (g && g.blocks && Array.isArray(g.blocks)) {
293
+ let T = g.blocks.map((N) => ({
294
+ ...k,
295
+ content: N.content
296
+ })), z = [(g.index || m) + 1, 0].concat(T);
297
+ e.value.content.splice.apply(e.value.content, z);
298
+ const M = T[T.length - 1];
299
+ console.log("New block is" + M);
300
+ } else
301
+ m !== void 0 ? (e.value.content.splice(m + 1, 0, k), console.log("Latest block is" + k)) : (console.log("Another block is" + k), e.value.content.push(k));
302
+ o.value = null, s("update", e.value.content);
303
+ }
304
+ function c(y, x) {
305
+ const m = e.value.content.findIndex((g) => g === y);
306
+ m !== -1 && (e.value.content[m] = { ...e.value.content[m], ...x }), s("update", e.value.content);
307
+ }
308
+ function a(y) {
309
+ let x = e.value.content.findIndex((m) => m === y);
310
+ x !== -1 && e.value.content.splice(x, 1), e.value.content[x - 1].setFocus = !0, s("update", e.value.content);
311
+ }
312
+ const o = p(null), l = p(!1), r = p(!1);
313
+ function h() {
314
+ l.value = !0;
315
+ }
316
+ function C() {
317
+ l.value = !1;
318
+ }
319
+ return K(() => {
320
+ e.value && e.value.content.length === 0 && u("Textarea", ""), s("update", e.value.content);
321
+ }), (y, x) => (i(), d("section", null, [
322
+ _(e).content ? (i(), R(_(G), {
323
+ key: 0,
324
+ class: "w-full",
325
+ list: _(e).content,
326
+ onStart: h,
327
+ onEnd: C
328
+ }, {
329
+ default: L(() => [
330
+ (i(!0), d(V, null, A(_(e).content, (m, g) => (i(), d("div", {
331
+ key: g,
332
+ class: "pos-relative"
333
+ }, [
334
+ v("div", {
335
+ onMouseover: (k) => (o.value = g, r.value = !1),
336
+ class: "pos-relative w-full h-full"
337
+ }, [
338
+ (i(), R(P(f[m.type]), {
339
+ index: g,
340
+ component: m,
341
+ prop: m,
342
+ class: W(m.class),
343
+ setFocus: m.setFocus,
344
+ content: "content",
345
+ onDeleteBlock: a,
346
+ onAddBlock: u,
347
+ onUpdateBlock: c
348
+ }, null, 40, ["index", "component", "prop", "class", "setFocus"]))
349
+ ], 40, se),
350
+ H(q, { name: "fade" }, {
351
+ default: L(() => [
352
+ o.value === g ? (i(), d("div", {
353
+ key: 0,
354
+ class: "pos-absolute pos-r-100 pos-t-0 z-index-4 i-semi",
355
+ onMousedown: x[1] || (x[1] = D((k) => l.value = !0, ["prevent"]))
356
+ }, [
357
+ v("button", {
358
+ onClick: x[0] || (x[0] = (k) => r.value = !r.value),
359
+ class: "mn-small w-100 i-semi bg-white radius-thin"
360
+ }, U(m.content ? "..." : "+"), 1),
361
+ r.value ? (i(), d("div", ce, [
362
+ v("button", {
363
+ onClick: (k) => a(m),
364
+ class: "block w-max text-left px-4 py-2 hover:bg-gray-200"
365
+ }, "Удалить", 8, re),
366
+ v("button", {
367
+ onClick: (k) => u("ImageUpload", "", g),
368
+ class: "block w-max text-left px-4 py-2 hover:bg-gray-200"
369
+ }, "Добавить изображение", 8, ue),
370
+ v("button", {
371
+ onClick: (k) => u("H2", "", g),
372
+ class: "block w-max text-left px-4 py-2 hover:bg-gray-200"
373
+ }, "Добавить заголовок", 8, ie)
374
+ ])) : w("", !0)
375
+ ], 32)) : w("", !0)
376
+ ]),
377
+ _: 2
378
+ }, 1024)
379
+ ]))), 128))
380
+ ]),
381
+ _: 1
382
+ }, 8, ["list"])) : w("", !0)
383
+ ]));
384
+ }
385
+ }, pe = { class: "mn-small" }, de = /* @__PURE__ */ v("p", { class: "t-semi uppercase" }, "Please log in to leave a comment.", -1), fe = [
386
+ de
387
+ ], me = {
388
+ key: 1,
389
+ class: "mn-small"
390
+ }, ve = ["onSubmit"], ge = /* @__PURE__ */ v("button", {
391
+ type: "submit",
392
+ class: "mn-l-auto bg-main button"
393
+ }, "Send", -1), he = { class: "pd-t-zero" }, xe = { class: "p-big" }, _e = {
394
+ __name: "Comments",
395
+ props: ["target", "owner", "type"],
396
+ setup(n) {
397
+ const s = n, t = S.create({ baseURL: process.env.API_URL }), e = p([]), f = p(""), u = async () => {
398
+ const { data: a } = await t.get(`/comments/read?type=${s.type}&target=${s.target}`);
399
+ e.value = a;
400
+ }, c = async () => {
401
+ if (f.value)
402
+ try {
403
+ const a = await t.post("/comments/create", {
404
+ target: s.target,
405
+ user: s.owner,
406
+ type: s.type,
407
+ content: f.value
408
+ });
409
+ a.data.owner = s.owner, e.value.push(a.data), f.value = "";
410
+ } catch (a) {
411
+ console.error(a);
412
+ }
413
+ };
414
+ return u(), (a, o) => (i(), d("div", null, [
415
+ v("div", null, [
416
+ v("h3", pe, U(e.value.length) + " comments", 1),
417
+ n.owner ? w("", !0) : (i(), d("div", {
418
+ key: 0,
419
+ onClick: o[0] || (o[0] = (l) => a.$router.push({ name: "Sign In" })),
420
+ class: "cursor-pointer mn-small section bg-black t-white flex-center flex radius-big"
421
+ }, fe)),
422
+ n.owner ? (i(), d("div", me, [
423
+ v("form", {
424
+ onSubmit: D(c, ["prevent"]),
425
+ class: "bg-grey radius-big pd-medium"
426
+ }, [
427
+ B(v("textarea", {
428
+ "onUpdate:modelValue": o[1] || (o[1] = (l) => f.value = l),
429
+ placeholder: "Enter your comment",
430
+ class: "pd-small p-big w-100 radius-small mn-r-small"
431
+ }, null, 512), [
432
+ [$, f.value]
433
+ ]),
434
+ ge
435
+ ], 40, ve)
436
+ ])) : w("", !0)
437
+ ]),
438
+ (i(!0), d(V, null, A(e.value, (l) => (i(), d("div", {
439
+ key: l._id,
440
+ class: "comment mn-small radius-big pd-medium bg-grey"
441
+ }, [
442
+ H(J, {
443
+ class: "mn-medium",
444
+ owner: { target: l.user },
445
+ creator: { target: l.user },
446
+ date: l.createdAt
447
+ }, null, 8, ["owner", "creator", "date"]),
448
+ v("div", he, [
449
+ v("p", xe, U(l.content), 1)
450
+ ])
451
+ ]))), 128))
452
+ ]));
453
+ }
454
+ }, ke = { class: "w-100 bg-white radius-big image-upload-area flex-v-center flex-h-center flex t-black mn-small" }, ye = ["src"], Ue = {
455
+ __name: "Image",
456
+ props: [
457
+ "label",
458
+ "value",
459
+ "prop"
460
+ ],
461
+ setup(n) {
462
+ return p(null), (s, t) => (i(), d("div", ke, [
463
+ n.prop.content ? (i(), d("img", {
464
+ key: 0,
465
+ src: (s.FILE_SERVER_URL || "") + n.prop.content,
466
+ alt: "Uploaded image",
467
+ class: "w-100 h-30r object-fit-contain"
468
+ }, null, 8, ye)) : w("", !0)
469
+ ]));
470
+ }
471
+ };
472
+ export {
473
+ Q as _,
474
+ Ce as a,
475
+ _e as b,
476
+ Ue as c
477
+ };
@@ -0,0 +1,9 @@
1
+ "use strict";const e=require("vue"),B=require("./index-2a0269fc.js"),C=require("./vue-draggable-next.esm-bundler-80731ae0.js"),$=require("./Chips-4d8ac62e.js");const _=["placeholder"],y={__name:"Textarea",props:["prop","value","content","placeholder","index","setFocus"],emits:["deleteBlock","updateBlock","addBlock","focus"],setup(o,{emit:r}){const n=o;e.ref(n);const t=e.ref(null);e.ref(0);function d(a){let l=a.target.value.split(/\n+/);if(l.length>1){n.prop[n.content]=l[0],e.nextTick(()=>{c()});let u=l.slice(1).map(f=>({__name:"Textarea",content:f}));r("addBlock","Textarea","",n.index,{blocks:u,ref:t})}else a.target.value.trim()===""&&a.target.value.includes(`
2
+
3
+ `)&&(console.log("We are adding new block:"+n.index+newBlocks+t),r("addBlock","Textarea","",n.index,{blocks:newBlocks,ref:t})),c()}function i(a){(a.keyCode===8||a.keyCode===46)&&n.prop[n.content].trim()===""&&r("deleteBlock",n.prop)}function s(){e.nextTick(()=>{t.value.focus(),r("updateBlock",n.prop,{setFocus:!1})})}function c(){t.value.style.height="1rem",t.value.style.height=t.value.scrollHeight+"px"}return e.onUpdated(()=>{n.setFocus&&e.nextTick(()=>{s()}),c()}),e.onMounted(()=>{n.setFocus&&e.nextTick(()=>{s()}),c()}),(a,l)=>(e.openBlock(),e.createElementBlock("div",null,[e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":l[0]||(l[0]=u=>o.prop[o.content]=u),placeholder:o.placeholder?o.placeholder:"Enter text",onInput:d,onFocus:l[1]||(l[1]=u=>r("focus",t.value)),onKeyup:i,ref_key:"textarea",ref:t,class:"text-area mn-thin"},`
4
+ `,40,_),[[e.vModelText,o.prop[o.content]]])]))}};const V=["placeholder"],N={__name:"H2",props:["obj","label","prop","value","content","textarea","placeholder","index","ref","setFocus"],emits:["deleteBlock","updateBlock","addBlock","focus"],setup(o,{emit:r}){const n=o;e.ref(n);const t=e.ref(null);e.ref(0);function d(a){let l=a.target.value.split(/\n+/);if(l.length>1){n.prop[n.content]=l[0],e.nextTick(()=>{c()});let u=l.slice(1).map(f=>({type:"Textarea",content:f}));r("addBlock","Textarea","",n.index,{blocks:u,ref:t})}else a.target.value.trim()===""&&a.target.value.includes(`
5
+
6
+ `)&&(console.log("We are adding new block:"+n.index+newBlocks+t),r("addBlock","Textarea","",n.index,{blocks:newBlocks,ref:t})),c()}function i(a){(a.keyCode===8||a.keyCode===46)&&n.prop[n.content].trim()===""&&r("deleteBlock",n.prop)}function s(){e.nextTick(()=>{t.value.focus(),r("updateBlock",n.prop,{setFocus:!1})})}function c(){t.value.style.height="1rem",t.value.style.height=t.value.scrollHeight+"px"}return e.onUpdated(()=>{n.setFocus&&e.nextTick(()=>{s()}),c()}),e.onMounted(()=>{n.setFocus&&e.nextTick(()=>{s()}),c()}),e.watch(()=>n.prop[n.content],a=>{}),(a,l)=>(e.openBlock(),e.createElementBlock("div",null,[e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":l[0]||(l[0]=u=>o.prop[o.content]=u),placeholder:o.placeholder?o.placeholder:"Enter text",onInput:d,onFocus:l[1]||(l[1]=u=>r("focus",t.value)),onKeyup:i,ref_key:"textarea",ref:t,class:"h3 text-area mn-thin"},`
7
+ `,40,V),[[e.vModelText,o.prop[o.content]]])]))}},T=["placeholder"],U={__name:"Caption",props:["obj","label","prop","value","content","textarea","placeholder","index","ref"],emits:["deleteBlock","addBlock","focus"],setup(o,{emit:r}){const n=o;e.ref(n);const t=e.ref(null);function d(s){const c=/^\s*[-*]\s+(.*)/;let l=s.target.value.split(/\n+/).map(u=>{const f=c.exec(u);return f?f[1]:null}).filter(u=>u!==null);l.length>0?(n.prop[n.content]=l,i()):s.target.value.trim()===""&&(n.prop[n.content]=[],i())}function i(){t.value.style.height="1rem",t.value.style.height=t.value.scrollHeight+"px"}return e.onUpdated(()=>{i()}),e.onMounted(()=>{i()}),e.watch(()=>n.prop[n.content],s=>{(!s||s.length===0)&&r("deleteBlock",n.prop)}),(s,c)=>(e.openBlock(),e.createElementBlock("div",null,[e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":c[0]||(c[0]=a=>o.prop[o.content]=a),placeholder:o.placeholder?o.placeholder:"Enter text",onInput:d,onFocus:c[1]||(c[1]=a=>r("focus",t.value)),ref_key:"textarea",ref:t,class:"br-l br-solid br-main pd-l-small text-area mn-small"},`
8
+ `,40,T),[[e.vModelText,o.prop[o.content]]])]))}},D=["placeholder"],F={__name:"Bullets",props:["obj","label","prop","value","content","textarea","placeholder","index","ref"],emits:["deleteBlock","addBlock","focus"],setup(o,{emit:r}){const n=o;e.ref(n);const t=e.ref(null);function d(s){const c=/^\s*[-*]\s+(.*)/;let l=s.target.value.split(/\n+/).map(u=>{const f=c.exec(u);return f?f[1]:null}).filter(u=>u!==null);l.length>0?(n.prop[n.content]=l,i()):s.target.value.trim()===""&&(n.prop[n.content]=[],i())}function i(){t.value.style.height="1rem",t.value.style.height=t.value.scrollHeight+"px"}return e.onUpdated(()=>{i()}),e.onMounted(()=>{i()}),e.watch(()=>n.prop[n.content],s=>{(!s||s.length===0)&&r("deleteBlock",n.prop)}),(s,c)=>(e.openBlock(),e.createElementBlock("div",null,[e.createTextVNode(e.toDisplayString(o.prop[o.content])+" ",1),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":c[0]||(c[0]=a=>o.prop[o.content]=a),placeholder:o.placeholder?o.placeholder:"Enter text",onInput:d,onFocus:c[1]||(c[1]=a=>r("focus",t.value)),ref_key:"textarea",ref:t,class:"text-area mn-small"},`
9
+ `,40,D),[[e.vModelText,o.prop[o.content]]])]))}},I=["src"],M={key:1,class:"t-transp pd-extra"},L={__name:"ImageUpload",props:["label","value","prop"],emits:["input","updateBlock"],setup(o,{emit:r}){const n=o,t=e.ref(null),d=e.ref(null);function i(){d.value.click()}async function s(a){let l=a.target.files[0];console.log(l);let u=new FormData,f="unsorted";u.append("file",l),console.log(u.has("file"));try{let h=await B.axios.create({baseURL:process.env.API_URL,withCredentials:!0}).post(`/api/upload/file?folderName=${encodeURIComponent(f)}`,u,{headers:{"Content-Type":"multipart/form-data"}});t.value=h.data.filepath,console.log(t.value),r("input",t.value),r("updateBlock",n.prop,{content:t.value})}catch(g){console.error(g)}}function c(a){a.preventDefault(),s({target:{files:a.dataTransfer.files}})}return(a,l)=>(e.openBlock(),e.createElementBlock("div",{onClick:i,onDrop:c,onDragover:l[0]||(l[0]=e.withModifiers(()=>{},["prevent"])),class:"w-100 radius-big bg-white image-upload-area flex-v-center flex-h-center flex t-black mn-small"},[o.prop.content?(e.openBlock(),e.createElementBlock("img",{key:0,src:(a.FILE_SERVER_URL||"")+o.prop.content,alt:"Uploaded image",class:"w-100 h-30r object-fit-contain"},null,8,I)):(e.openBlock(),e.createElementBlock("span",M,"Click or drag-and-drop your image")),e.createElementVNode("input",{type:"file",ref_key:"fileInput",ref:d,onChange:s,style:{display:"none"}},null,544)],32))}},R=["onMouseover"],S={key:0,class:"z-index-5 radius-thin mn-small relative left-0 mt-2 w-max bg-white shadow-lg rounded"},A=["onClick"],H=["onClick"],z=["onClick"],j={__name:"Constructor",props:["content"],emits:["update"],setup(o,{emit:r}){const n=o;let t=e.ref(null);e.ref(null),t.value={content:n.content};const d={Textarea:y,H2:N,Bullets:F,Caption:U,ImageUpload:L};function i(h="Textarea",k="",p,m){console.log("We are adding new block (functuin HandleAddBlock):"+h+k+p+m);let v={order:t.value.content.length+1,type:h,style:"",class:"",content:k,blocks:[],setFocus:!0};if(m&&m.blocks&&Array.isArray(m.blocks)){let x=m.blocks.map(E=>({...v,content:E.content})),b=[(m.index||p)+1,0].concat(x);t.value.content.splice.apply(t.value.content,b);const w=x[x.length-1];console.log("New block is"+w)}else p!==void 0?(t.value.content.splice(p+1,0,v),console.log("Latest block is"+v)):(console.log("Another block is"+v),t.value.content.push(v));a.value=null,r("update",t.value.content)}function s(h,k){const p=t.value.content.findIndex(m=>m===h);p!==-1&&(t.value.content[p]={...t.value.content[p],...k}),r("update",t.value.content)}function c(h){let k=t.value.content.findIndex(p=>p===h);k!==-1&&t.value.content.splice(k,1),t.value.content[k-1].setFocus=!0,r("update",t.value.content)}const a=e.ref(null),l=e.ref(!1),u=e.ref(!1);function f(){l.value=!0}function g(){l.value=!1}return e.watchEffect(()=>{t.value&&t.value.content.length===0&&i("Textarea",""),r("update",t.value.content)}),(h,k)=>(e.openBlock(),e.createElementBlock("section",null,[e.unref(t).content?(e.openBlock(),e.createBlock(e.unref(C.VueDraggableNext),{key:0,class:"w-full",list:e.unref(t).content,onStart:f,onEnd:g},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t).content,(p,m)=>(e.openBlock(),e.createElementBlock("div",{key:m,class:"pos-relative"},[e.createElementVNode("div",{onMouseover:v=>(a.value=m,u.value=!1),class:"pos-relative w-full h-full"},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d[p.type]),{index:m,component:p,prop:p,class:e.normalizeClass(p.class),setFocus:p.setFocus,content:"content",onDeleteBlock:c,onAddBlock:i,onUpdateBlock:s},null,40,["index","component","prop","class","setFocus"]))],40,R),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[a.value===m?(e.openBlock(),e.createElementBlock("div",{key:0,class:"pos-absolute pos-r-100 pos-t-0 z-index-4 i-semi",onMousedown:k[1]||(k[1]=e.withModifiers(v=>l.value=!0,["prevent"]))},[e.createElementVNode("button",{onClick:k[0]||(k[0]=v=>u.value=!u.value),class:"mn-small w-100 i-semi bg-white radius-thin"},e.toDisplayString(p.content?"...":"+"),1),u.value?(e.openBlock(),e.createElementBlock("div",S,[e.createElementVNode("button",{onClick:v=>c(p),class:"block w-max text-left px-4 py-2 hover:bg-gray-200"},"Удалить",8,A),e.createElementVNode("button",{onClick:v=>i("ImageUpload","",m),class:"block w-max text-left px-4 py-2 hover:bg-gray-200"},"Добавить изображение",8,H),e.createElementVNode("button",{onClick:v=>i("H2","",m),class:"block w-max text-left px-4 py-2 hover:bg-gray-200"},"Добавить заголовок",8,z)])):e.createCommentVNode("",!0)],32)):e.createCommentVNode("",!0)]),_:2},1024)]))),128))]),_:1},8,["list"])):e.createCommentVNode("",!0)]))}},q={class:"mn-small"},K=e.createElementVNode("p",{class:"t-semi uppercase"},"Please log in to leave a comment.",-1),P=[K],W={key:1,class:"mn-small"},G=["onSubmit"],J=e.createElementVNode("button",{type:"submit",class:"mn-l-auto bg-main button"},"Send",-1),O={class:"pd-t-zero"},Q={class:"p-big"},X={__name:"Comments",props:["target","owner","type"],setup(o){const r=o,n=B.axios.create({baseURL:process.env.API_URL}),t=e.ref([]),d=e.ref(""),i=async()=>{const{data:c}=await n.get(`/comments/read?type=${r.type}&target=${r.target}`);t.value=c},s=async()=>{if(d.value)try{const c=await n.post("/comments/create",{target:r.target,user:r.owner,type:r.type,content:d.value});c.data.owner=r.owner,t.value.push(c.data),d.value=""}catch(c){console.error(c)}};return i(),(c,a)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",null,[e.createElementVNode("h3",q,e.toDisplayString(t.value.length)+" comments",1),o.owner?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,onClick:a[0]||(a[0]=l=>c.$router.push({name:"Sign In"})),class:"cursor-pointer mn-small section bg-black t-white flex-center flex radius-big"},P)),o.owner?(e.openBlock(),e.createElementBlock("div",W,[e.createElementVNode("form",{onSubmit:e.withModifiers(s,["prevent"]),class:"bg-grey radius-big pd-medium"},[e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":a[1]||(a[1]=l=>d.value=l),placeholder:"Enter your comment",class:"pd-small p-big w-100 radius-small mn-r-small"},null,512),[[e.vModelText,d.value]]),J],40,G)])):e.createCommentVNode("",!0)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,l=>(e.openBlock(),e.createElementBlock("div",{key:l._id,class:"comment mn-small radius-big pd-medium bg-grey"},[e.createVNode($._sfc_main,{class:"mn-medium",owner:{target:l.user},creator:{target:l.user},date:l.createdAt},null,8,["owner","creator","date"]),e.createElementVNode("div",O,[e.createElementVNode("p",Q,e.toDisplayString(l.content),1)])]))),128))]))}},Y={class:"w-100 bg-white radius-big image-upload-area flex-v-center flex-h-center flex t-black mn-small"},Z=["src"],ee={__name:"Image",props:["label","value","prop"],setup(o){return e.ref(null),(r,n)=>(e.openBlock(),e.createElementBlock("div",Y,[o.prop.content?(e.openBlock(),e.createElementBlock("img",{key:0,src:(r.FILE_SERVER_URL||"")+o.prop.content,alt:"Uploaded image",class:"w-100 h-30r object-fit-contain"},null,8,Z)):e.createCommentVNode("",!0)]))}};exports._sfc_main=y;exports._sfc_main$1=j;exports._sfc_main$2=X;exports._sfc_main$3=ee;
@@ -0,0 +1 @@
1
+ "use strict";const e=require("vue"),l=require("vue-router"),p=require("vue-i18n");require("./Breadcrumbs.vue_vue_type_style_index_0_lang-8660f9cb.js");const a={class:"pd-small popup-wrapper"},d=e.createElementVNode("svg",{width:"26",height:"26",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("rect",{width:"24",height:"24",transform:"translate(1 1)"}),e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12.9996 10.8L22.8994 0.900244L25.0993 3.1002L15.1995 13L25.0993 22.8998L22.8994 25.0998L12.9996 15.2L3.09976 25.0998L0.899801 22.8998L10.7996 13L0.899801 3.1002L3.09976 0.900244L12.9996 10.8Z",fill:"white"})],-1),m=[d],v={__name:"Popup",props:{isPopupOpen:{type:Boolean,default:!1},style:String},emits:["close-popup"],setup(t,{emit:r}){const i=t;function n(){r("close-popup")}e.watch(()=>i.isPopupOpen,o=>{o?document.body.classList.add("no-scroll"):document.body.classList.remove("no-scroll")}),l.useRoute(),l.useRouter();const c={messages:{en:{},ru:{}}};return p.useI18n(c),(o,s)=>t.isPopupOpen?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:"body"},[e.createVNode(e.Transition,{name:"scale"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",a,[e.createElementVNode("section",e.mergeProps({class:"t-center z-index-4"},o.$attrs),[e.createElementVNode("button",{onClick:s[0]||(s[0]=u=>n()),class:"pd-regular hover-scale-1 z-index-5 button-close-popup button"},m),e.renderSlot(o.$slots,"default")],16),e.createElementVNode("div",{onClick:s[1]||(s[1]=u=>n()),class:e.normalizeClass([{active:t.isPopupOpen===!0},"color-overlay z-index-3"])},null,2)],512),[[e.vShow,t.isPopupOpen]])]),_:3})])):e.createCommentVNode("",!0)}};exports._sfc_main=v;
@@ -0,0 +1,76 @@
1
+ import { watch as p, openBlock as u, createBlock as a, Teleport as c, createVNode as d, Transition as m, withCtx as v, withDirectives as f, createElementVNode as e, mergeProps as h, renderSlot as L, normalizeClass as w, vShow as g, createCommentVNode as x } from "vue";
2
+ import { useRoute as P, useRouter as y } from "vue-router";
3
+ import { useI18n as b } from "vue-i18n";
4
+ import "./Breadcrumbs.vue_vue_type_style_index_0_lang-bd3889ee.mjs";
5
+ const k = { class: "pd-small popup-wrapper" }, C = /* @__PURE__ */ e("svg", {
6
+ width: "26",
7
+ height: "26",
8
+ viewBox: "0 0 26 26",
9
+ fill: "none",
10
+ xmlns: "http://www.w3.org/2000/svg"
11
+ }, [
12
+ /* @__PURE__ */ e("rect", {
13
+ width: "24",
14
+ height: "24",
15
+ transform: "translate(1 1)"
16
+ }),
17
+ /* @__PURE__ */ e("path", {
18
+ "fill-rule": "evenodd",
19
+ "clip-rule": "evenodd",
20
+ d: "M12.9996 10.8L22.8994 0.900244L25.0993 3.1002L15.1995 13L25.0993 22.8998L22.8994 25.0998L12.9996 15.2L3.09976 25.0998L0.899801 22.8998L10.7996 13L0.899801 3.1002L3.09976 0.900244L12.9996 10.8Z",
21
+ fill: "white"
22
+ })
23
+ ], -1), O = [
24
+ C
25
+ ], V = {
26
+ __name: "Popup",
27
+ props: {
28
+ isPopupOpen: {
29
+ type: Boolean,
30
+ default: !1
31
+ },
32
+ style: String
33
+ },
34
+ emits: ["close-popup"],
35
+ setup(t, { emit: l }) {
36
+ const r = t;
37
+ function n() {
38
+ l("close-popup");
39
+ }
40
+ return p(() => r.isPopupOpen, (o) => {
41
+ o ? document.body.classList.add("no-scroll") : document.body.classList.remove("no-scroll");
42
+ }), P(), y(), b({
43
+ messages: {
44
+ en: {},
45
+ ru: {}
46
+ }
47
+ }), (o, s) => t.isPopupOpen ? (u(), a(c, {
48
+ key: 0,
49
+ to: "body"
50
+ }, [
51
+ d(m, { name: "scale" }, {
52
+ default: v(() => [
53
+ f(e("div", k, [
54
+ e("section", h({ class: "t-center z-index-4" }, o.$attrs), [
55
+ e("button", {
56
+ onClick: s[0] || (s[0] = (i) => n()),
57
+ class: "pd-regular hover-scale-1 z-index-5 button-close-popup button"
58
+ }, O),
59
+ L(o.$slots, "default")
60
+ ], 16),
61
+ e("div", {
62
+ onClick: s[1] || (s[1] = (i) => n()),
63
+ class: w([{ active: t.isPopupOpen === !0 }, "color-overlay z-index-3"])
64
+ }, null, 2)
65
+ ], 512), [
66
+ [g, t.isPopupOpen]
67
+ ])
68
+ ]),
69
+ _: 3
70
+ })
71
+ ])) : x("", !0);
72
+ }
73
+ };
74
+ export {
75
+ V as _
76
+ };