@ozdao/prometheus-framework 0.0.78 → 0.0.80

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-451d2614.mjs +80 -0
  2. package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-5ea8b4fa.js +1 -0
  3. package/dist/ButtonFollow-0d83a04a.mjs +130 -0
  4. package/dist/ButtonFollow-f9c5dc7a.js +1 -0
  5. package/dist/CardHeader-2d7e5d49.mjs +76 -0
  6. package/dist/CardHeader-dff9c71a.js +1 -0
  7. package/dist/Comments-b6e32958.js +1 -0
  8. package/dist/Comments-d2a8fd0f.mjs +76 -0
  9. package/dist/EditProductImages-1d4b44a9.mjs +236 -0
  10. package/dist/EditProductImages-d9228ad0.js +1 -0
  11. package/dist/EmptyState-34d85f10.mjs +36 -0
  12. package/dist/EmptyState-7658d7d6.js +1 -0
  13. package/dist/Feed-932d976d.js +1 -0
  14. package/dist/Feed-962e009b.js +1 -0
  15. package/dist/Feed-c93012c7.mjs +346 -0
  16. package/dist/Feed-d8e33aed.mjs +397 -0
  17. package/dist/PlaceholderUserpic-1a6cf257.mjs +28 -0
  18. package/dist/PlaceholderUserpic-3bf126ee.js +1 -0
  19. package/dist/Popup.vue_vue_type_style_index_0_lang-8981c189.mjs +280 -0
  20. package/dist/Popup.vue_vue_type_style_index_0_lang-931f265a.js +1 -0
  21. package/dist/Product-3c64a352.mjs +904 -0
  22. package/dist/Product-67efba5c.js +7 -0
  23. package/dist/ProductEdit-04760699.js +1 -0
  24. package/dist/ProductEdit-39adf62f.mjs +113 -0
  25. package/dist/ProfileBlogposts-00424109.js +1 -0
  26. package/dist/ProfileBlogposts-65a7a5e0.mjs +56 -0
  27. package/dist/ProfileComments-5884d09f.mjs +43 -0
  28. package/dist/ProfileComments-677731b3.js +1 -0
  29. package/dist/ProfileEvents-85a88674.mjs +55 -0
  30. package/dist/ProfileEvents-b5431cd6.js +1 -0
  31. package/dist/ProfileLikes-4a57f637.mjs +43 -0
  32. package/dist/ProfileLikes-8ccf6815.js +1 -0
  33. package/dist/ProfileOrganizations-5d681498.mjs +202 -0
  34. package/dist/ProfileOrganizations-c7688210.js +1 -0
  35. package/dist/Publics-889c25fc.js +1 -0
  36. package/dist/Publics-8bea4201.mjs +44 -0
  37. package/dist/UploadImage-34bc4a3f.mjs +99 -0
  38. package/dist/UploadImage-75b1a18a.js +1 -0
  39. package/dist/auth-18f80fef.mjs +1501 -0
  40. package/dist/auth-78fd9408.js +8 -0
  41. package/dist/auth.client.cjs +5 -5
  42. package/dist/auth.client.js +5 -5
  43. package/dist/auth.validation-6bccabd6.mjs +20 -0
  44. package/dist/auth.validation-a18510e8.js +1 -0
  45. package/dist/community.client.cjs +8 -9
  46. package/dist/community.client.js +568 -552
  47. package/dist/community.server.js +3 -2
  48. package/dist/community.server.mjs +3 -2
  49. package/dist/events.client.cjs +1 -1
  50. package/dist/events.client.js +10 -10
  51. package/dist/files.client.cjs +1 -0
  52. package/dist/files.client.js +1 -0
  53. package/dist/files.server.js +5 -2
  54. package/dist/files.server.mjs +5 -2
  55. package/dist/main.css +1 -1
  56. package/dist/organizations-0e9ff7ca.mjs +319 -0
  57. package/dist/organizations-c77ea9d0.js +1 -0
  58. package/dist/organizations.client.cjs +2 -2
  59. package/dist/organizations.client.js +26 -26
  60. package/dist/prometheus-framework.cjs.js +3 -3
  61. package/dist/prometheus-framework.es.js +8 -8
  62. package/dist/style.css +1 -1
  63. package/dist/users.client.cjs +1 -1
  64. package/dist/users.client.js +10 -10
  65. package/package.json +3 -3
  66. package/src/modules/community/components/elements/ImageUpload.vue +7 -5
  67. package/src/modules/community/components/pages/BlogPost.vue +12 -15
  68. package/src/modules/community/components/pages/CreateBlogPost.vue +14 -1
  69. package/src/modules/community/controllers/blog.controller.js +2 -1
  70. package/src/modules/files/controllers/files.controller.js +5 -1
  71. package/src/modules/files/routes/files.routes.js +3 -1
@@ -0,0 +1,397 @@
1
+ import { reactive as L, watch as I, openBlock as n, createElementBlock as c, toDisplayString as d, createCommentVNode as p, createElementVNode as v, ref as u, createTextVNode as z, computed as B, createVNode as _, normalizeClass as O, unref as f, renderSlot as A, onMounted as T, Transition as x, withCtx as $, createBlock as j, Fragment as U, renderList as E } from "vue";
2
+ import { _ as M } from "./EmptyState-34d85f10.mjs";
3
+ import { a as N, _ as F } from "./auth-18f80fef.mjs";
4
+ import { _ as V } from "./CardHeader-2d7e5d49.mjs";
5
+ import { useRouter as q } from "vue-router";
6
+ import { s as m } from "./globals-f538c0ef.mjs";
7
+ const k = N.create({ baseURL: process.env.API_URL, withCredentials: !0 });
8
+ k.defaults.withCredentials = !0;
9
+ const g = L({
10
+ all: [],
11
+ filter: {
12
+ // query
13
+ tags: [],
14
+ period: ""
15
+ // pagination
16
+ },
17
+ pagination: {
18
+ page: 1,
19
+ perPage: 18
20
+ },
21
+ // Sort
22
+ sort: {
23
+ current: "popularity",
24
+ ascending: !1
25
+ },
26
+ current: {
27
+ _id: "",
28
+ url: "",
29
+ status: "",
30
+ name: "",
31
+ tags: [],
32
+ owner: {},
33
+ date: "",
34
+ views: 0,
35
+ content: []
36
+ }
37
+ });
38
+ async function C(e = {}) {
39
+ e.params = e.params || {}, e.params.skip = e.skip || 0, e.params.limit = e.limit || 9, e.params.tags = e.tags || [], e.period && (e.params.period = e.period), e.url && (e.params = { url: e.url }), e.category && (e.params.category = e.category), e.organization && (e.params.organization = e.organization), e.owner && (e.params.owner = e.owner), e.user && (e.params.user = e.user), e.params.skip = e.skip || 0, e.params.limit = e.limit || 10;
40
+ try {
41
+ console.log("Request params:" + e.params);
42
+ const t = await k.get("/api/blog/read", { params: e.params });
43
+ return e.url ? w(t.data, "current") : w(t.data, "all"), Promise.resolve(t.data);
44
+ } catch (t) {
45
+ return m(t), Promise.reject(t);
46
+ }
47
+ }
48
+ async function D(e) {
49
+ return k.post("/api/blog/create", e).then(
50
+ (t) => (w(t.data, "current"), Promise.resolve(t.data)),
51
+ (t) => (m(t), Promise.reject(t))
52
+ );
53
+ }
54
+ async function G(e) {
55
+ return k.post("/api/blog/update", e).then(
56
+ (t) => (w(t.data, "current"), Promise.resolve(t.data)),
57
+ (t) => (m(t), Promise.reject(t))
58
+ );
59
+ }
60
+ async function H(e) {
61
+ return await k.delete(`/api/blog/delete/${e}`).then(
62
+ (t) => {
63
+ const a = g.all.findIndex((r) => r._id === e);
64
+ return a !== -1 && g.all.splice(a, 1), Promise.resolve(t.data);
65
+ },
66
+ (t) => (m(t), Promise.reject(t))
67
+ );
68
+ }
69
+ function w(e, t) {
70
+ g[t] = e;
71
+ }
72
+ function J() {
73
+ g.current = {
74
+ _id: "",
75
+ url: "",
76
+ status: "",
77
+ name: "",
78
+ tags: [],
79
+ author: "",
80
+ owner: "",
81
+ date: "",
82
+ views: 0,
83
+ content: []
84
+ };
85
+ }
86
+ function K(e) {
87
+ const t = {
88
+ order: g.project.content.length + 1,
89
+ type: e.type,
90
+ data: e.data,
91
+ class: e.class,
92
+ content: e.content
93
+ };
94
+ g.project.content.push(t);
95
+ }
96
+ I(g, (e, t) => {
97
+ });
98
+ const we = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
99
+ __proto__: null,
100
+ blockAdd: K,
101
+ clean: J,
102
+ create: D,
103
+ read: C,
104
+ remove: H,
105
+ set: w,
106
+ state: g,
107
+ update: G
108
+ }, Symbol.toStringTag, { value: "Module" })), Q = {
109
+ props: {
110
+ progress: {
111
+ type: Number,
112
+ default: null
113
+ },
114
+ status: {
115
+ type: String,
116
+ default: null
117
+ }
118
+ }
119
+ }, W = { class: "circular-loader" }, X = /* @__PURE__ */ v("svg", { viewBox: "25 25 50 50" }, [
120
+ /* @__PURE__ */ v("circle", {
121
+ cx: "50",
122
+ cy: "50",
123
+ r: "20",
124
+ fill: "none",
125
+ "stroke-width": "4",
126
+ "stroke-miterlimit": "10"
127
+ })
128
+ ], -1), Y = {
129
+ key: 0,
130
+ class: "progress-text"
131
+ }, Z = {
132
+ key: 1,
133
+ class: "uppercase t-semi w-m-10r status-text"
134
+ };
135
+ function ee(e, t, a, r, s, l) {
136
+ return n(), c("div", W, [
137
+ X,
138
+ a.progress ? (n(), c("div", Y, d(a.progress), 1)) : p("", !0),
139
+ a.status ? (n(), c("div", Z, d(a.status), 1)) : p("", !0)
140
+ ]);
141
+ }
142
+ const te = /* @__PURE__ */ F(Q, [["render", ee]]), P = N.create({
143
+ baseURL: process.env.API_URL,
144
+ withCredentials: !0
145
+ }), y = L({
146
+ reactions: [],
147
+ error: null
148
+ }), R = {
149
+ async read({ user: e, type: t, target: a, role: r }) {
150
+ try {
151
+ const s = await P.get("/api/reactions", { params: { user: e, type: t, target: a, role: r } });
152
+ return y.error = null, y.reactions = s.data, Promise.resolve(s.data);
153
+ } catch (s) {
154
+ return m(s), Promise.reject(s);
155
+ }
156
+ },
157
+ async create(e) {
158
+ try {
159
+ const t = await P.post("/api/reactions/create", e);
160
+ return y.error = null, Promise.resolve(t.data);
161
+ } catch (t) {
162
+ return console.log(t), m(t), Promise.reject(t);
163
+ }
164
+ },
165
+ async update(e) {
166
+ try {
167
+ const t = await P.post("/api/reactions/update", e);
168
+ return y.error = null, Promise.resolve(t.data);
169
+ } catch (t) {
170
+ return m(t), Promise.reject(t);
171
+ }
172
+ },
173
+ async delete(e) {
174
+ try {
175
+ const t = await P.post("/api/reactions/delete", e);
176
+ return y.error = null, Promise.resolve(t.data);
177
+ } catch (t) {
178
+ return m(t), Promise.reject(t);
179
+ }
180
+ }
181
+ }, re = {
182
+ handleReactionUpdate(e, t, a) {
183
+ let r;
184
+ if (Array.isArray(e) ? r = e.find((s) => s._id === t.target) : typeof e == "object" && e._id === t.target && (r = e), r)
185
+ if (r.hasReaction = a, a)
186
+ r.reactions.push(t), r.numberOfReactions += 1;
187
+ else {
188
+ const s = r.reactions.findIndex((l) => l._id === t._id);
189
+ s !== -1 && (r.reactions.splice(s, 1), r.numberOfReactions -= 1);
190
+ }
191
+ }
192
+ };
193
+ I(y, (e) => {
194
+ });
195
+ const ke = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
196
+ __proto__: null,
197
+ actions: R,
198
+ mutations: re,
199
+ state: y
200
+ }, Symbol.toStringTag, { value: "Module" })), ae = { class: "t-semi br-top-dark flex-nowrap flex-nojustify flex" }, se = /* @__PURE__ */ v("span", { class: "mn-r-small mn-l-small d-block" }, "·", -1), oe = { class: "cursor-pointer" }, ne = /* @__PURE__ */ v("span", { class: "mn-r-small mn-l-small d-block" }, "·", -1), le = {
201
+ __name: "FooterBlogpost",
202
+ props: ["blogpost", "owner", "user"],
203
+ setup(e) {
204
+ const t = e, a = u(t.blogpost.numberOfReactions), r = u(t.blogpost.isReacted), s = u(t.blogpost.reactionId);
205
+ async function l(b) {
206
+ if (!t.user) {
207
+ alert("Please login to add a reaction");
208
+ return;
209
+ }
210
+ try {
211
+ const o = {
212
+ target: t.blogpost._id,
213
+ type: "blogpost",
214
+ user: t.user,
215
+ class: "like"
216
+ }, h = await R.create(o);
217
+ h.reaction.class === "like" && (a.value += 1, r.value = !0, s.value = h.reaction._id);
218
+ } catch (o) {
219
+ console.error(o), alert("Error adding reaction. Please try again later.");
220
+ }
221
+ }
222
+ async function i(b) {
223
+ if (!t.user) {
224
+ alert("Please login to add a reaction");
225
+ return;
226
+ }
227
+ try {
228
+ const o = { _id: s.value };
229
+ await R.delete(o), a.value -= 1, r.value = !1, s.value = null;
230
+ } catch {
231
+ alert("Error adding reaction. Please try again later.");
232
+ }
233
+ }
234
+ return (b, o) => (n(), c("footer", ae, [
235
+ z(" 👁️ " + d(e.blogpost.views) + " ", 1),
236
+ se,
237
+ v("div", oe, [
238
+ r.value ? p("", !0) : (n(), c("div", {
239
+ key: 0,
240
+ class: "cursor-pointer",
241
+ onClick: o[0] || (o[0] = (h) => l())
242
+ }, " 👍 " + d(a.value), 1)),
243
+ r.value ? (n(), c("div", {
244
+ key: 1,
245
+ class: "cursor-pointer",
246
+ onClick: o[1] || (o[1] = (h) => i())
247
+ }, " 👍 " + d(a.value), 1)) : p("", !0)
248
+ ]),
249
+ ne,
250
+ z(" 💬 " + d(e.blogpost.numberOfComments), 1)
251
+ ]));
252
+ }
253
+ }, ce = { class: "bg-grey radius-big" }, ie = ["src"], ue = { class: "pd-t-zero pd-medium" }, de = {
254
+ key: 0,
255
+ class: "mn-small t-transp p-big"
256
+ }, me = {
257
+ __name: "CardBlogpost",
258
+ props: ["blogpost", "user", "type"],
259
+ setup(e) {
260
+ const t = e, a = q(), r = B(() => t.blogpost.content.find((l) => l.type.name === "ImageUpload")), s = B(() => t.blogpost.content.find((l) => l.type.name === "Textarea"));
261
+ return (l, i) => (n(), c("article", ce, [
262
+ _(V, {
263
+ class: O({
264
+ "mn-small pd-medium": e.type !== "short",
265
+ "flex-child-order-last flex-child mn-l-small": e.type === "short"
266
+ }),
267
+ owner: e.blogpost.owner,
268
+ creator: e.blogpost.creator,
269
+ date: e.blogpost.createdAt
270
+ }, null, 8, ["class", "owner", "creator", "date"]),
271
+ f(r) && e.type !== "blogpostPage" ? (n(), c("img", {
272
+ key: 0,
273
+ src: f(r).content,
274
+ alt: "Blog post image",
275
+ class: "mn-medium object-fit-cover w-100 h-20r"
276
+ }, null, 8, ie)) : p("", !0),
277
+ v("section", ue, [
278
+ v("h3", {
279
+ onClick: i[0] || (i[0] = (b) => f(a).push({
280
+ name: "BlogPost",
281
+ params: {
282
+ url: e.blogpost.url
283
+ }
284
+ })),
285
+ class: "cursor-pointer mn-thin"
286
+ }, d(e.blogpost.name), 1),
287
+ f(s) && e.type !== "blogpostPage" ? (n(), c("p", de, d(f(s).content.slice(0, 120)) + "... ", 1)) : p("", !0),
288
+ A(l.$slots, "default")
289
+ ]),
290
+ _(le, {
291
+ class: "pd-t-zero pd-medium",
292
+ blogpost: e.blogpost,
293
+ user: e.user
294
+ }, null, 8, ["blogpost", "user"])
295
+ ]));
296
+ }
297
+ }, pe = { class: "feed" }, ge = { key: 1 }, Pe = {
298
+ __name: "Feed",
299
+ props: {
300
+ category: {
301
+ type: String,
302
+ default: null
303
+ },
304
+ owner: {
305
+ type: String,
306
+ default: null
307
+ },
308
+ user: {
309
+ type: [String, Number],
310
+ default: null
311
+ },
312
+ period: {
313
+ type: String,
314
+ default: null
315
+ }
316
+ },
317
+ setup(e) {
318
+ const t = e, a = u([]), r = u(!0);
319
+ let s = u(!0), l = u(0), i = u(2);
320
+ const b = async () => {
321
+ if (r.value) {
322
+ l.value += i.value;
323
+ const o = await C({
324
+ skip: l.value,
325
+ limit: i.value,
326
+ category: t.category,
327
+ user: t.user,
328
+ owner: t.owner,
329
+ period: t.period
330
+ });
331
+ o.length === 0 && (r.value = !1), a.value = [...a.value, ...o];
332
+ }
333
+ };
334
+ return T(async () => {
335
+ const o = await C({
336
+ skip: l.value,
337
+ limit: i.value,
338
+ category: t.category,
339
+ user: t.user,
340
+ owner: t.owner,
341
+ period: t.period
342
+ });
343
+ o.length === 0 ? r.value = !1 : r.value = !0, a.value = o, s.value = !1;
344
+ }), (o, h) => (n(), c("section", pe, [
345
+ _(x, { name: "fade" }, {
346
+ default: $(() => [
347
+ f(s) ? (n(), j(te, {
348
+ key: 0,
349
+ class: "z-index-5 pos-t-50 left-t-50 pos-absolute"
350
+ })) : p("", !0)
351
+ ]),
352
+ _: 1
353
+ }),
354
+ _(x, { name: "fade" }, {
355
+ default: $(() => [
356
+ !f(s) && a.value.length < 1 ? (n(), j(M, {
357
+ key: 0,
358
+ title: "No Blog Posts Found",
359
+ description: "Currently, there are no posts available in this blog. Please check back later.",
360
+ class: "pd-medium mn-thin bg-grey radius-big"
361
+ })) : (n(), c("div", ge, [
362
+ (n(!0), c(U, null, E(a.value, (S) => (n(), j(me, {
363
+ key: S._id,
364
+ blogpost: S,
365
+ user: e.user,
366
+ class: "mn-medium"
367
+ }, null, 8, ["blogpost", "user"]))), 128)),
368
+ _(x, { name: "fade" }, {
369
+ default: $(() => [
370
+ r.value && a.value.length > 0 ? (n(), c("button", {
371
+ key: 0,
372
+ onClick: b,
373
+ class: "w-100 bg-main button"
374
+ }, " Load more ")) : p("", !0)
375
+ ]),
376
+ _: 1
377
+ })
378
+ ]))
379
+ ]),
380
+ _: 1
381
+ })
382
+ ]));
383
+ }
384
+ };
385
+ export {
386
+ te as L,
387
+ Pe as _,
388
+ D as a,
389
+ me as b,
390
+ J as c,
391
+ le as d,
392
+ we as e,
393
+ ke as f,
394
+ C as r,
395
+ g as s,
396
+ G as u
397
+ };
@@ -0,0 +1,28 @@
1
+ import { openBlock as o, createElementBlock as c, createElementVNode as e } from "vue";
2
+ import { _ as l } from "./auth-18f80fef.mjs";
3
+ const t = {}, n = {
4
+ viewBox: "0 0 42 42",
5
+ fill: "none",
6
+ xmlns: "http://www.w3.org/2000/svg"
7
+ }, r = /* @__PURE__ */ e("circle", {
8
+ fill: "rgb(var(--main))",
9
+ cx: "21",
10
+ cy: "21",
11
+ r: "21"
12
+ }, null, -1), i = /* @__PURE__ */ e("path", {
13
+ fill: "#242424",
14
+ "fill-opacity": "0.1",
15
+ "fill-rule": "evenodd",
16
+ "clip-rule": "evenodd",
17
+ d: "M8.00233 37.4954C8.00078 37.4458 8 37.3961 8 37.3462C8 32.9066 11.5673 29.3077 15.9677 29.3077H26.0323C30.4328 29.3077 34 32.9066 34 37.3462C34 37.3961 33.9992 37.4458 33.9977 37.4954C30.4223 40.3165 25.9078 42 21 42C16.0922 42 11.5777 40.3164 8.00233 37.4954ZM21 9C16.5995 9 13.0323 12.5989 13.0323 17.0385C13.0323 21.478 16.5995 25.0769 21 25.0769C25.4005 25.0769 28.9677 21.478 28.9677 17.0385C28.9677 12.5989 25.4005 9 21 9Z"
18
+ }, null, -1), s = [
19
+ r,
20
+ i
21
+ ];
22
+ function _(d, a) {
23
+ return o(), c("svg", n, s);
24
+ }
25
+ const C = /* @__PURE__ */ l(t, [["render", _]]);
26
+ export {
27
+ C as P
28
+ };
@@ -0,0 +1 @@
1
+ "use strict";const e=require("vue"),c=require("./auth-78fd9408.js"),t={},l={viewBox:"0 0 42 42",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o=e.createElementVNode("circle",{fill:"rgb(var(--main))",cx:"21",cy:"21",r:"21"},null,-1),n=e.createElementVNode("path",{fill:"#242424","fill-opacity":"0.1","fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.00233 37.4954C8.00078 37.4458 8 37.3961 8 37.3462C8 32.9066 11.5673 29.3077 15.9677 29.3077H26.0323C30.4328 29.3077 34 32.9066 34 37.3462C34 37.3961 33.9992 37.4458 33.9977 37.4954C30.4223 40.3165 25.9078 42 21 42C16.0922 42 11.5777 40.3164 8.00233 37.4954ZM21 9C16.5995 9 13.0323 12.5989 13.0323 17.0385C13.0323 21.478 16.5995 25.0769 21 25.0769C25.4005 25.0769 28.9677 21.478 28.9677 17.0385C28.9677 12.5989 25.4005 9 21 9Z"},null,-1),r=[o,n];function s(_,d){return e.openBlock(),e.createElementBlock("svg",l,r)}const i=c._export_sfc(t,[["render",s]]);exports.PlaceholderUserpic=i;