@ozdao/prometheus-framework 0.0.95 → 0.0.97
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/CardOrganization-1b0da77c.mjs +230 -0
- package/dist/CardOrganization-43e80590.js +1 -0
- package/dist/Chips-32092a52.js +1 -0
- package/dist/Chips-4316f652.mjs +110 -0
- package/dist/Chips-92ccc11f.js +1 -0
- package/dist/Chips-cc08d85a.mjs +108 -0
- package/dist/Feed-361761f5.mjs +366 -0
- package/dist/Feed-44f715a7.mjs +439 -0
- package/dist/Feed-67f403fb.mjs +366 -0
- package/dist/Feed-8a867bfc.js +1 -0
- package/dist/Feed-8acc6844.js +1 -0
- package/dist/Feed-8f6eb29d.mjs +439 -0
- package/dist/Feed-c88eb3aa.js +1 -0
- package/dist/Feed-c8dc4359.js +1 -0
- package/dist/IconEdit-4cfe2115.js +1 -0
- package/dist/IconEdit-eacf3856.mjs +44 -0
- package/dist/Image-661e2fbc.mjs +477 -0
- package/dist/Image-d74c19ee.mjs +477 -0
- package/dist/Image-f66dbbf4.js +9 -0
- package/dist/Image-fd501859.js +9 -0
- package/dist/Product-09a39f0b.js +7 -0
- package/dist/Product-601a9d5b.mjs +838 -0
- package/dist/Product-b7c53f33.mjs +838 -0
- package/dist/Product-f017e6cd.js +7 -0
- package/dist/ProductEdit-3d7f2823.js +1 -0
- package/dist/ProductEdit-dae66a53.js +1 -0
- package/dist/ProductEdit-e827ea38.mjs +350 -0
- package/dist/ProductEdit-fa0117b6.mjs +350 -0
- package/dist/ProfileBlogposts-69beaa14.js +1 -0
- package/dist/ProfileBlogposts-6f80b734.mjs +64 -0
- package/dist/ProfileBlogposts-92c4addb.mjs +64 -0
- package/dist/ProfileBlogposts-e3ea2c82.js +1 -0
- package/dist/ProfileComments-0d22a8ec.js +1 -0
- package/dist/ProfileComments-bae499e9.js +1 -0
- package/dist/ProfileComments-c7230f42.mjs +44 -0
- package/dist/ProfileComments-cdaccefe.mjs +44 -0
- package/dist/ProfileEvents-2f22e7cf.mjs +56 -0
- package/dist/ProfileEvents-3089a526.mjs +56 -0
- package/dist/ProfileEvents-cc65404c.js +1 -0
- package/dist/ProfileEvents-e62e76cf.js +1 -0
- package/dist/ProfileLikes-6cf19687.js +1 -0
- package/dist/ProfileLikes-75215d15.mjs +44 -0
- package/dist/ProfileLikes-e4fa0792.mjs +44 -0
- package/dist/ProfileLikes-fa41bad0.js +1 -0
- package/dist/ProfileOrganizations-55914b43.js +1 -0
- package/dist/ProfileOrganizations-cef668b5.mjs +212 -0
- package/dist/ProfileOrganizations-d4ec181b.js +1 -0
- package/dist/ProfileOrganizations-ec908108.mjs +212 -0
- package/dist/Publics-6b7c97bd.js +1 -0
- package/dist/Publics-abbe2e0c.mjs +123 -0
- package/dist/Socials-8193477c.mjs +189 -0
- package/dist/Socials-821bd677.js +1 -0
- package/dist/UploadImage-1b4c2a5e.mjs +83 -0
- package/dist/UploadImage-39d42048.js +1 -0
- package/dist/community.client.cjs +1 -1
- package/dist/community.client.js +18 -10
- package/dist/components/Text/Text.vue.d.ts +1 -0
- package/dist/components/Text/Text.vue.d.ts.map +1 -1
- package/dist/events.client.cjs +1 -1
- package/dist/events.client.js +41 -33
- package/dist/landing.client.cjs +1 -1
- package/dist/landing.client.js +38 -38
- package/dist/main.css +1 -1
- package/dist/organizations.client-723ebb3b.js +3 -0
- package/dist/organizations.client-8aa34e80.mjs +3017 -0
- package/dist/organizations.client-b0878617.js +3 -0
- package/dist/organizations.client-f4dff584.mjs +3017 -0
- package/dist/organizations.client.cjs +1 -1
- package/dist/organizations.client.js +9 -9
- package/dist/prometheus-framework.cjs.js +2 -2
- package/dist/prometheus-framework.es.js +4 -3
- package/dist/style.css +1 -1
- package/dist/users.client.cjs +1 -1
- package/dist/users.client.js +49 -46
- package/package.json +1 -1
- package/src/components/CardHeader/CardHeader.vue +2 -2
- package/src/components/Chips/Chips.vue +1 -2
- package/src/components/Magnifier/Magnifier.vue +1 -1
- package/src/components/Text/Text.vue +4 -3
- package/src/components/UploadImage/UploadImage.vue +8 -1
- package/src/modules/backoffice/components/pages/Organizations.vue +2 -2
- package/src/modules/community/components/blocks/CardBlogpost.vue +16 -1
- package/src/modules/community/components/layouts/Community.vue +2 -2
- package/src/modules/community/components/pages/Blog.vue +1 -1
- package/src/modules/community/router/blogposts.js +9 -1
- package/src/modules/constructor/components/elements/Image.vue +1 -1
- package/src/modules/constructor/components/elements/ImageUpload.vue +1 -1
- package/src/modules/events/components/blocks/CardEvent.vue +18 -6
- package/src/modules/events/components/elements/ButtonJoin.vue +1 -1
- package/src/modules/events/router/events.js +9 -1
- package/src/modules/landing/components/sections/MobileApp.vue +1 -1
- package/src/modules/orders/components/blocks/CardOrderItem.vue +1 -1
- package/src/modules/orders/components/blocks/Positions.vue +2 -2
- package/src/modules/organizations/components/blocks/CardOrganization.vue +5 -5
- package/src/modules/organizations/components/blocks/DepartmentSub.vue +1 -1
- package/src/modules/organizations/components/blocks/User.vue +1 -1
- package/src/modules/organizations/components/pages/Organization.vue +1 -1
- package/src/modules/organizations/components/pages/Organizations.vue +2 -2
- package/src/modules/organizations/components/pages/OrganizationsAccount.vue +2 -2
- package/src/modules/organizations/components/sections/DetailsTab.vue +1 -1
- package/src/modules/organizations/components/sections/Organizations.vue +1 -1
- package/src/modules/organizations/components/sections/Publics.vue +1 -1
- package/src/modules/products/components/blocks/Images360.vue +1 -1
- package/src/modules/products/components/blocks/ImagesThumbnails.vue +1 -1
- package/src/modules/products/components/blocks/LeftoverPositions.vue +2 -2
- package/src/modules/products/components/blocks/ProductCard.vue +1 -1
- package/src/modules/products/components/sections/EditProductImages.vue +1 -1
- package/src/modules/products/components/sections/HeroRecommendation.vue +1 -1
- package/src/modules/products/components/sections/SectionProduct.vue +1 -1
- package/src/modules/users/components/pages/Profile.vue +3 -3
- package/src/modules/users/components/pages/ProfileBlogposts.vue +1 -1
- package/src/modules/users/components/pages/ProfileComments.vue +1 -1
- package/src/modules/users/components/pages/ProfileEdit.vue +1 -1
- package/src/modules/users/components/pages/ProfileEvents.vue +1 -1
- package/src/modules/users/components/pages/ProfileLikes.vue +1 -1
- package/src/modules/users/components/pages/ProfileOrganizations.vue +1 -1
- package/src/modules/users/router/users.js +10 -7
- package/src/styles/base/all.scss +1 -0
@@ -0,0 +1,477 @@
|
|
1
|
+
import { ref as d, onUpdated as F, nextTick as b, onMounted as I, openBlock as i, createElementBlock as p, 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 "./auth-cfeacd61.mjs";
|
3
|
+
import { V as G } from "./vue-draggable-next.esm-bundler-ff6e3f52.mjs";
|
4
|
+
import { _ as J } from "./Chips-4316f652.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
|
+
d(t);
|
12
|
+
const e = d(null);
|
13
|
+
d(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(), p("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
|
+
d(t);
|
70
|
+
const e = d(null);
|
71
|
+
d(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(), p("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
|
+
d(t);
|
128
|
+
const e = d(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(), p("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
|
+
d(t);
|
168
|
+
const e = d(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(), p("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 = d(null), f = d(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(), p("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(), p("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(), p("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 = d(null);
|
273
|
+
d(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 = d(null), l = d(!1), r = d(!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(), p("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), p(V, null, A(_(e).content, (m, g) => (i(), p("div", {
|
331
|
+
key: g,
|
332
|
+
class: "relative"
|
333
|
+
}, [
|
334
|
+
v("div", {
|
335
|
+
onMouseover: (k) => (o.value = g, r.value = !1),
|
336
|
+
class: "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(), p("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(), p("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
|
+
}, de = { class: "mn-small" }, pe = /* @__PURE__ */ v("p", { class: "t-semi uppercase" }, "Please log in to leave a comment.", -1), fe = [
|
386
|
+
pe
|
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 = d([]), f = d(""), 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(), p("div", null, [
|
415
|
+
v("div", null, [
|
416
|
+
v("h3", de, U(e.value.length) + " comments", 1),
|
417
|
+
n.owner ? w("", !0) : (i(), p("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(), p("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), p(V, null, A(e.value, (l) => (i(), p("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 d(null), (s, t) => (i(), p("div", ke, [
|
463
|
+
n.prop.content ? (i(), p("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
|
+
Ce as _,
|
474
|
+
_e as a,
|
475
|
+
Ue as b,
|
476
|
+
Q as c
|
477
|
+
};
|