@ozdao/prometheus-framework 0.0.94 → 0.0.96
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-6f807eb5.js +1 -0
- package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-97217d38.mjs +1945 -0
- package/dist/ButtonFollow-4049a57e.js +1 -0
- package/dist/ButtonFollow-6765c266.mjs +131 -0
- package/dist/CardOrganization-1b0da77c.mjs +230 -0
- package/dist/CardOrganization-43e80590.js +1 -0
- package/dist/CardOrganization-b2098e42.js +1 -0
- package/dist/CardOrganization-c2e7e903.mjs +229 -0
- package/dist/Chips-4316f652.mjs +110 -0
- package/dist/Chips-92ccc11f.js +1 -0
- package/dist/Feed-13499a3a.mjs +428 -0
- package/dist/Feed-345d8513.mjs +355 -0
- package/dist/Feed-361761f5.mjs +366 -0
- package/dist/Feed-8acc6844.js +1 -0
- package/dist/Feed-8f6eb29d.mjs +439 -0
- package/dist/Feed-c6b67df4.js +1 -0
- package/dist/Feed-c8dc4359.js +1 -0
- package/dist/Feed-f0a40b33.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-b2131fa0.mjs +477 -0
- package/dist/Image-d01026cf.js +9 -0
- package/dist/Image-f66dbbf4.js +9 -0
- package/dist/Popup-0b38b537.js +1 -0
- package/dist/Popup-e6685f31.mjs +76 -0
- package/dist/Product-3c2ae338.js +7 -0
- package/dist/Product-601a9d5b.mjs +838 -0
- package/dist/Product-dccb371a.mjs +838 -0
- package/dist/Product-f017e6cd.js +7 -0
- package/dist/ProductEdit-777bb9e2.mjs +350 -0
- package/dist/ProductEdit-d5dec3cf.js +1 -0
- package/dist/ProductEdit-dae66a53.js +1 -0
- package/dist/ProductEdit-fa0117b6.mjs +350 -0
- package/dist/ProfileBlogposts-39c20b79.mjs +64 -0
- package/dist/ProfileBlogposts-69beaa14.js +1 -0
- package/dist/ProfileBlogposts-6c715a38.js +1 -0
- package/dist/ProfileBlogposts-92c4addb.mjs +64 -0
- package/dist/ProfileComments-1525663e.mjs +44 -0
- package/dist/ProfileComments-1cbf5c45.js +1 -0
- package/dist/ProfileComments-bae499e9.js +1 -0
- package/dist/ProfileComments-cdaccefe.mjs +44 -0
- package/dist/ProfileEvents-3089a526.mjs +56 -0
- package/dist/ProfileEvents-48c70286.mjs +56 -0
- package/dist/ProfileEvents-a28a4ee5.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-ca197731.mjs +44 -0
- package/dist/ProfileLikes-e31f28dc.js +1 -0
- package/dist/ProfileOrganizations-55914b43.js +1 -0
- package/dist/ProfileOrganizations-600d310d.js +1 -0
- package/dist/ProfileOrganizations-774c6508.mjs +212 -0
- package/dist/ProfileOrganizations-ec908108.mjs +212 -0
- package/dist/Publics-4db36606.js +1 -0
- package/dist/Publics-6b7c97bd.js +1 -0
- package/dist/Publics-abbe2e0c.mjs +123 -0
- package/dist/Publics-cbb8eaaa.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/UploadImage-739cab04.js +1 -0
- package/dist/UploadImage-8835be69.mjs +83 -0
- package/dist/auth-b61483ce.js +8 -0
- package/dist/auth-cfeacd61.mjs +1839 -0
- package/dist/auth.client.cjs +1 -1
- package/dist/auth.client.js +3 -3
- package/dist/auth.validation-2f00457e.js +1 -0
- package/dist/auth.validation-3fd4cc7c.mjs +20 -0
- package/dist/community.client.cjs +1 -1
- package/dist/community.client.js +12 -12
- 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 +12 -12
- package/dist/landing.client.cjs +1 -1
- package/dist/landing.client.js +38 -38
- package/dist/main.css +1 -1
- package/dist/organizations-49a10611.js +1 -0
- package/dist/organizations-8ffdf84d.mjs +121 -0
- package/dist/organizations.client-0071acee.js +3 -0
- package/dist/organizations.client-8aa34e80.mjs +3017 -0
- package/dist/organizations.client-b0878617.js +3 -0
- package/dist/organizations.client-fa3b0839.mjs +3017 -0
- package/dist/organizations.client.cjs +1 -1
- package/dist/organizations.client.js +13 -13
- 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 +48 -48
- package/package.json +2 -1
- package/src/components/CardHeader/CardHeader.vue +2 -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/auth/store/auth.js +23 -3
- package/src/modules/backoffice/components/pages/Organizations.vue +1 -1
- package/src/modules/community/components/blocks/CardBlogpost.vue +16 -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/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/Organizations.vue +1 -1
- package/src/modules/organizations/components/pages/OrganizationsAccount.vue +1 -1
- package/src/modules/organizations/components/sections/DetailsTab.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/ProfileEdit.vue +1 -1
- package/src/styles/base/all.scss +1 -0
@@ -0,0 +1,110 @@
|
|
1
|
+
import { openBlock as r, createElementBlock as s, createElementVNode as d, withModifiers as h, createCommentVNode as i, createBlock as k, toDisplayString as a, Fragment as w, renderList as y, normalizeStyle as $, normalizeClass as x } from "vue";
|
2
|
+
import { useRouter as v } from "vue-router";
|
3
|
+
import { P as p } from "./IconEdit-eacf3856.mjs";
|
4
|
+
const E = {
|
5
|
+
key: 0,
|
6
|
+
class: "pd-b-zero"
|
7
|
+
}, z = { class: "w-100 flex-v-center flex-nojustify flex" }, C = { class: "w-100 flex-nowrap flex-v-center flex" }, P = ["src"], M = {
|
8
|
+
key: 2,
|
9
|
+
class: "t-semi"
|
10
|
+
}, R = { key: 1 }, U = { key: 2 }, F = { class: "d-block mn-l-auto flex-nowrap flex flex-v-center" }, L = {
|
11
|
+
key: 0,
|
12
|
+
class: "w-4r i-thin"
|
13
|
+
}, D = {
|
14
|
+
style: { position: "absolute", top: "0px", right: "0px" },
|
15
|
+
class: "br-solid br-2px br-white z-index-1 radius-big i-thin bg-second flex flex-center t-white p-small mn-r-small t-semi"
|
16
|
+
}, S = ["src"], j = {
|
17
|
+
__name: "CardHeader",
|
18
|
+
props: [
|
19
|
+
"date",
|
20
|
+
"dateFormatted",
|
21
|
+
"owner",
|
22
|
+
"creator",
|
23
|
+
"members",
|
24
|
+
"membersPhotos",
|
25
|
+
"type"
|
26
|
+
],
|
27
|
+
setup(e) {
|
28
|
+
v();
|
29
|
+
function g(n) {
|
30
|
+
const t = /* @__PURE__ */ new Date(), o = new Date(n), l = Math.abs(t - o), b = Math.floor(l / 1e3), m = Math.floor(b / 60), c = Math.floor(m / 60), u = Math.floor(c / 24), f = Math.floor(u / 7);
|
31
|
+
return f > 0 ? `${f} week${f > 1 ? "s" : ""} ago` : u > 0 ? `${u} day${u > 1 ? "s" : ""} ago` : c > 0 ? `${c} hour${c > 1 ? "s" : ""} ago` : m > 0 ? `${m} minute${m > 1 ? "s" : ""} ago` : "Just now";
|
32
|
+
}
|
33
|
+
return (n, t) => e.owner ? (r(), s("header", E, [
|
34
|
+
d("div", z, [
|
35
|
+
d("div", C, [
|
36
|
+
e.owner.target.profile.photo.length > 0 && e.type !== "short" ? (r(), s("img", {
|
37
|
+
key: 0,
|
38
|
+
src: (n.FILE_SERVER_URL || "") + e.owner.target.profile.photo,
|
39
|
+
class: "radius-medium mn-r-thin i-thin",
|
40
|
+
onClick: t[0] || (t[0] = h((o) => n.$router.push({
|
41
|
+
name: e.owner.type === "user" ? "User Profile" : "Organization",
|
42
|
+
params: {
|
43
|
+
_id: e.owner.target._id
|
44
|
+
}
|
45
|
+
}), ["stop"]))
|
46
|
+
}, null, 8, P)) : i("", !0),
|
47
|
+
!e.owner.target.profile.photo && e.type !== "short" ? (r(), k(p, {
|
48
|
+
key: 1,
|
49
|
+
class: "radius-medium mn-r-thin i-thin",
|
50
|
+
onClick: t[1] || (t[1] = h((o) => n.$router.push({
|
51
|
+
name: e.owner.type === "user" ? "User Profile" : "Organization",
|
52
|
+
params: {
|
53
|
+
_id: e.owner.target._id
|
54
|
+
}
|
55
|
+
}), ["stop"]))
|
56
|
+
})) : i("", !0),
|
57
|
+
e.type !== "short" ? (r(), s("span", M, [
|
58
|
+
d("span", {
|
59
|
+
onClick: t[2] || (t[2] = h((o) => n.$router.push({
|
60
|
+
name: e.owner.type === "user" ? "User Profile" : "Organization",
|
61
|
+
params: {
|
62
|
+
_id: e.owner.target._id
|
63
|
+
}
|
64
|
+
}), ["stop"]))
|
65
|
+
}, a(e.owner.target.profile.name), 1),
|
66
|
+
!e.creator.hidden && e.owner.target.profile.name !== e.creator.target.profile.name ? (r(), s("span", {
|
67
|
+
key: 0,
|
68
|
+
onClick: t[3] || (t[3] = h((o) => n.$router.push({
|
69
|
+
name: "User Profile",
|
70
|
+
params: {
|
71
|
+
_id: e.owner.target._id
|
72
|
+
}
|
73
|
+
}), ["stop"]))
|
74
|
+
}, " · by " + a(e.creator.target.profile.name), 1)) : i("", !0),
|
75
|
+
e.date ? (r(), s("span", R, " · " + a(g(e.date)), 1)) : i("", !0),
|
76
|
+
e.dateFormatted ? (r(), s("span", U, " · " + a(e.dateFormatted), 1)) : i("", !0)
|
77
|
+
])) : i("", !0),
|
78
|
+
d("div", F, [
|
79
|
+
e.members ? (r(), s("div", L, [
|
80
|
+
d("span", D, a(e.members), 1),
|
81
|
+
(r(!0), s(w, null, y(e.membersPhotos.slice(0, 2), (o, l) => (r(), s("img", {
|
82
|
+
key: l,
|
83
|
+
src: (n.FILE_SERVER_URL || "") + o,
|
84
|
+
style: $({ position: "absolute", top: "0px", right: l * 20 + 40 + "%", zIndex: 1 - l }),
|
85
|
+
class: "br-solid br-2px br-white i-thin bg-grey radius-big"
|
86
|
+
}, null, 12, S))), 128))
|
87
|
+
])) : i("", !0)
|
88
|
+
])
|
89
|
+
])
|
90
|
+
])
|
91
|
+
])) : i("", !0);
|
92
|
+
}
|
93
|
+
}, V = { class: "flex-v-center flex-nowrap flex" }, B = {
|
94
|
+
key: 1,
|
95
|
+
class: "pd-thin radius-small t-semi bg-white"
|
96
|
+
}, A = {
|
97
|
+
__name: "Chips",
|
98
|
+
props: ["chips"],
|
99
|
+
setup(e) {
|
100
|
+
return (g, n) => (r(), s("div", V, [
|
101
|
+
e.chips.length ? (r(!0), s(w, { key: 0 }, y(e.chips, (t, o) => (r(), s("div", {
|
102
|
+
class: x(["pd-thin radius-small t-semi bg-main", { "mn-r-thin": o !== e.chips.length - 1 }])
|
103
|
+
}, a(t.text ? t.text : t), 3))), 256)) : (r(), s("div", B, a(e.chips), 1))
|
104
|
+
]));
|
105
|
+
}
|
106
|
+
};
|
107
|
+
export {
|
108
|
+
j as _,
|
109
|
+
A as a
|
110
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";const e=require("vue"),u=require("vue-router"),h=require("./IconEdit-4cfe2115.js"),f={key:0,class:"pd-b-zero"},k={class:"w-100 flex-v-center flex-nojustify flex"},g={class:"w-100 flex-nowrap flex-v-center flex"},w=["src"],y={key:2,class:"t-semi"},p={key:1},B={key:2},E={class:"d-block mn-l-auto flex-nowrap flex flex-v-center"},b={key:0,class:"w-4r i-thin"},$={style:{position:"absolute",top:"0px",right:"0px"},class:"br-solid br-2px br-white z-index-1 radius-big i-thin bg-second flex flex-center t-white p-small mn-r-small t-semi"},v=["src"],x={__name:"CardHeader",props:["date","dateFormatted","owner","creator","members","membersPhotos","type"],setup(t){u.useRouter();function m(r){const o=new Date,n=new Date(r),s=Math.abs(o-n),d=Math.floor(s/1e3),i=Math.floor(d/60),a=Math.floor(i/60),l=Math.floor(a/24),c=Math.floor(l/7);return c>0?`${c} week${c>1?"s":""} ago`:l>0?`${l} day${l>1?"s":""} ago`:a>0?`${a} hour${a>1?"s":""} ago`:i>0?`${i} minute${i>1?"s":""} ago`:"Just now"}return(r,o)=>t.owner?(e.openBlock(),e.createElementBlock("header",f,[e.createElementVNode("div",k,[e.createElementVNode("div",g,[t.owner.target.profile.photo.length>0&&t.type!=="short"?(e.openBlock(),e.createElementBlock("img",{key:0,src:(r.FILE_SERVER_URL||"")+t.owner.target.profile.photo,class:"radius-medium mn-r-thin i-thin",onClick:o[0]||(o[0]=e.withModifiers(n=>r.$router.push({name:t.owner.type==="user"?"User Profile":"Organization",params:{_id:t.owner.target._id}}),["stop"]))},null,8,w)):e.createCommentVNode("",!0),!t.owner.target.profile.photo&&t.type!=="short"?(e.openBlock(),e.createBlock(h.PlaceholderUserpic,{key:1,class:"radius-medium mn-r-thin i-thin",onClick:o[1]||(o[1]=e.withModifiers(n=>r.$router.push({name:t.owner.type==="user"?"User Profile":"Organization",params:{_id:t.owner.target._id}}),["stop"]))})):e.createCommentVNode("",!0),t.type!=="short"?(e.openBlock(),e.createElementBlock("span",y,[e.createElementVNode("span",{onClick:o[2]||(o[2]=e.withModifiers(n=>r.$router.push({name:t.owner.type==="user"?"User Profile":"Organization",params:{_id:t.owner.target._id}}),["stop"]))},e.toDisplayString(t.owner.target.profile.name),1),!t.creator.hidden&&t.owner.target.profile.name!==t.creator.target.profile.name?(e.openBlock(),e.createElementBlock("span",{key:0,onClick:o[3]||(o[3]=e.withModifiers(n=>r.$router.push({name:"User Profile",params:{_id:t.owner.target._id}}),["stop"]))}," · by "+e.toDisplayString(t.creator.target.profile.name),1)):e.createCommentVNode("",!0),t.date?(e.openBlock(),e.createElementBlock("span",p," · "+e.toDisplayString(m(t.date)),1)):e.createCommentVNode("",!0),t.dateFormatted?(e.openBlock(),e.createElementBlock("span",B," · "+e.toDisplayString(t.dateFormatted),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",E,[t.members?(e.openBlock(),e.createElementBlock("div",b,[e.createElementVNode("span",$,e.toDisplayString(t.members),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.membersPhotos.slice(0,2),(n,s)=>(e.openBlock(),e.createElementBlock("img",{key:s,src:(r.FILE_SERVER_URL||"")+n,style:e.normalizeStyle({position:"absolute",top:"0px",right:s*20+40+"%",zIndex:1-s}),class:"br-solid br-2px br-white i-thin bg-grey radius-big"},null,12,v))),128))])):e.createCommentVNode("",!0)])])])])):e.createCommentVNode("",!0)}},C={class:"flex-v-center flex-nowrap flex"},V={key:1,class:"pd-thin radius-small t-semi bg-white"},N={__name:"Chips",props:["chips"],setup(t){return(m,r)=>(e.openBlock(),e.createElementBlock("div",C,[t.chips.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.chips,(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["pd-thin radius-small t-semi bg-main",{"mn-r-thin":n!==t.chips.length-1}])},e.toDisplayString(o.text?o.text:o),3))),256)):(e.openBlock(),e.createElementBlock("div",V,e.toDisplayString(t.chips),1))]))}};exports._sfc_main=x;exports._sfc_main$1=N;
|
@@ -0,0 +1,428 @@
|
|
1
|
+
import { reactive as L, watch as I, openBlock as o, createElementBlock as l, toDisplayString as u, createCommentVNode as i, createElementVNode as b, ref as g, createTextVNode as z, computed as B, createVNode as w, normalizeClass as O, unref as d, renderSlot as A, createBlock as x, onMounted as T, Transition as $, withCtx as j, Fragment as U, renderList as E } from "vue";
|
2
|
+
import { _ as M } from "./EmptyState-34d85f10.mjs";
|
3
|
+
import { _ as F } from "./_plugin-vue_export-helper-dad06003.mjs";
|
4
|
+
import { _ as V, a as q } from "./Chips-f0b7ce36.mjs";
|
5
|
+
import { useRouter as D } from "vue-router";
|
6
|
+
import { a as N } from "./auth-cfeacd61.mjs";
|
7
|
+
import { s as p } from "./globals-96ba60e4.mjs";
|
8
|
+
const k = N.create({ baseURL: process.env.API_URL, withCredentials: !0 });
|
9
|
+
k.defaults.withCredentials = !0;
|
10
|
+
const f = L({
|
11
|
+
all: [],
|
12
|
+
filter: {
|
13
|
+
// query
|
14
|
+
tags: [],
|
15
|
+
period: ""
|
16
|
+
// pagination
|
17
|
+
},
|
18
|
+
pagination: {
|
19
|
+
page: 1,
|
20
|
+
perPage: 18
|
21
|
+
},
|
22
|
+
// Sort
|
23
|
+
sort: {
|
24
|
+
current: "popularity",
|
25
|
+
ascending: !1
|
26
|
+
},
|
27
|
+
current: {
|
28
|
+
_id: "",
|
29
|
+
url: "",
|
30
|
+
status: "",
|
31
|
+
name: "",
|
32
|
+
tags: [],
|
33
|
+
owner: {},
|
34
|
+
date: "",
|
35
|
+
views: 0,
|
36
|
+
content: []
|
37
|
+
}
|
38
|
+
});
|
39
|
+
async function S(e = {}) {
|
40
|
+
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.creator && (e.params.creator = e.creator), e.status && (e.params.status = e.status), e.user && (e.params.user = e.user), e.params.skip = e.skip || 0, e.params.limit = e.limit || 10;
|
41
|
+
try {
|
42
|
+
console.log("Request params:" + e.params);
|
43
|
+
const t = await k.get("/api/blog/read", { params: e.params });
|
44
|
+
return e.url ? _(t.data, "current") : _(t.data, "all"), Promise.resolve(t.data);
|
45
|
+
} catch (t) {
|
46
|
+
return p(t), Promise.reject(t);
|
47
|
+
}
|
48
|
+
}
|
49
|
+
async function G(e) {
|
50
|
+
return k.post("/api/blog/create", e).then(
|
51
|
+
(t) => (_(t.data, "current"), Promise.resolve(t.data)),
|
52
|
+
(t) => (p(t), Promise.reject(t))
|
53
|
+
);
|
54
|
+
}
|
55
|
+
async function H(e) {
|
56
|
+
return k.post("/api/blog/update", e).then(
|
57
|
+
(t) => (_(t.data, "current"), Promise.resolve(t.data)),
|
58
|
+
(t) => (p(t), Promise.reject(t))
|
59
|
+
);
|
60
|
+
}
|
61
|
+
async function J(e) {
|
62
|
+
return await k.delete(`/api/blog/delete/${e}`).then(
|
63
|
+
(t) => {
|
64
|
+
const a = f.all.findIndex((r) => r._id === e);
|
65
|
+
return a !== -1 && f.all.splice(a, 1), Promise.resolve(t.data);
|
66
|
+
},
|
67
|
+
(t) => (p(t), Promise.reject(t))
|
68
|
+
);
|
69
|
+
}
|
70
|
+
function _(e, t) {
|
71
|
+
f[t] = e;
|
72
|
+
}
|
73
|
+
function K() {
|
74
|
+
f.current = {
|
75
|
+
_id: "",
|
76
|
+
url: "",
|
77
|
+
status: "",
|
78
|
+
name: "",
|
79
|
+
tags: [],
|
80
|
+
author: "",
|
81
|
+
owner: "",
|
82
|
+
date: "",
|
83
|
+
views: 0,
|
84
|
+
content: []
|
85
|
+
};
|
86
|
+
}
|
87
|
+
function Q(e) {
|
88
|
+
const t = {
|
89
|
+
order: f.project.content.length + 1,
|
90
|
+
type: e.type,
|
91
|
+
data: e.data,
|
92
|
+
class: e.class,
|
93
|
+
content: e.content
|
94
|
+
};
|
95
|
+
f.project.content.push(t);
|
96
|
+
}
|
97
|
+
I(f, (e, t) => {
|
98
|
+
});
|
99
|
+
const je = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
100
|
+
__proto__: null,
|
101
|
+
blockAdd: Q,
|
102
|
+
clean: K,
|
103
|
+
create: G,
|
104
|
+
read: S,
|
105
|
+
remove: J,
|
106
|
+
set: _,
|
107
|
+
state: f,
|
108
|
+
update: H
|
109
|
+
}, Symbol.toStringTag, { value: "Module" })), W = {
|
110
|
+
props: {
|
111
|
+
progress: {
|
112
|
+
type: Number,
|
113
|
+
default: null
|
114
|
+
},
|
115
|
+
status: {
|
116
|
+
type: String,
|
117
|
+
default: null
|
118
|
+
}
|
119
|
+
}
|
120
|
+
}, X = { class: "circular-loader" }, Y = /* @__PURE__ */ b("svg", { viewBox: "25 25 50 50" }, [
|
121
|
+
/* @__PURE__ */ b("circle", {
|
122
|
+
cx: "50",
|
123
|
+
cy: "50",
|
124
|
+
r: "20",
|
125
|
+
fill: "none",
|
126
|
+
"stroke-width": "4",
|
127
|
+
"stroke-miterlimit": "10"
|
128
|
+
})
|
129
|
+
], -1), Z = {
|
130
|
+
key: 0,
|
131
|
+
class: "progress-text"
|
132
|
+
}, ee = {
|
133
|
+
key: 1,
|
134
|
+
class: "uppercase t-semi w-m-10r status-text"
|
135
|
+
};
|
136
|
+
function te(e, t, a, r, s, c) {
|
137
|
+
return o(), l("div", X, [
|
138
|
+
Y,
|
139
|
+
a.progress ? (o(), l("div", Z, u(a.progress), 1)) : i("", !0),
|
140
|
+
a.status ? (o(), l("div", ee, u(a.status), 1)) : i("", !0)
|
141
|
+
]);
|
142
|
+
}
|
143
|
+
const re = /* @__PURE__ */ F(W, [["render", te]]), P = N.create({
|
144
|
+
baseURL: process.env.API_URL,
|
145
|
+
withCredentials: !0
|
146
|
+
}), y = L({
|
147
|
+
reactions: [],
|
148
|
+
error: null
|
149
|
+
}), C = {
|
150
|
+
async read({ user: e, type: t, target: a, role: r }) {
|
151
|
+
try {
|
152
|
+
const s = await P.get("/api/reactions", { params: { user: e, type: t, target: a, role: r } });
|
153
|
+
return y.error = null, y.reactions = s.data, Promise.resolve(s.data);
|
154
|
+
} catch (s) {
|
155
|
+
return p(s), Promise.reject(s);
|
156
|
+
}
|
157
|
+
},
|
158
|
+
async create(e) {
|
159
|
+
try {
|
160
|
+
const t = await P.post("/api/reactions/create", e);
|
161
|
+
return y.error = null, Promise.resolve(t.data);
|
162
|
+
} catch (t) {
|
163
|
+
return console.log(t), p(t), Promise.reject(t);
|
164
|
+
}
|
165
|
+
},
|
166
|
+
async update(e) {
|
167
|
+
try {
|
168
|
+
const t = await P.post("/api/reactions/update", e);
|
169
|
+
return y.error = null, Promise.resolve(t.data);
|
170
|
+
} catch (t) {
|
171
|
+
return p(t), Promise.reject(t);
|
172
|
+
}
|
173
|
+
},
|
174
|
+
async delete(e) {
|
175
|
+
try {
|
176
|
+
const t = await P.post("/api/reactions/delete", e);
|
177
|
+
return y.error = null, Promise.resolve(t.data);
|
178
|
+
} catch (t) {
|
179
|
+
return p(t), Promise.reject(t);
|
180
|
+
}
|
181
|
+
}
|
182
|
+
}, ae = {
|
183
|
+
handleReactionUpdate(e, t, a) {
|
184
|
+
let r;
|
185
|
+
if (Array.isArray(e) ? r = e.find((s) => s._id === t.target) : typeof e == "object" && e._id === t.target && (r = e), r)
|
186
|
+
if (r.hasReaction = a, a)
|
187
|
+
r.reactions.push(t), r.numberOfReactions += 1;
|
188
|
+
else {
|
189
|
+
const s = r.reactions.findIndex((c) => c._id === t._id);
|
190
|
+
s !== -1 && (r.reactions.splice(s, 1), r.numberOfReactions -= 1);
|
191
|
+
}
|
192
|
+
}
|
193
|
+
};
|
194
|
+
I(y, (e) => {
|
195
|
+
});
|
196
|
+
const Se = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
197
|
+
__proto__: null,
|
198
|
+
actions: C,
|
199
|
+
mutations: ae,
|
200
|
+
state: y
|
201
|
+
}, Symbol.toStringTag, { value: "Module" })), se = { class: "t-semi br-top-dark flex-nowrap flex-nojustify flex" }, oe = /* @__PURE__ */ b("span", { class: "mn-r-small mn-l-small d-block" }, "·", -1), ne = { class: "cursor-pointer" }, le = /* @__PURE__ */ b("span", { class: "mn-r-small mn-l-small d-block" }, "·", -1), ce = {
|
202
|
+
__name: "FooterBlogpost",
|
203
|
+
props: ["blogpost", "owner", "user"],
|
204
|
+
setup(e) {
|
205
|
+
const t = e, a = g(t.blogpost.numberOfReactions), r = g(t.blogpost.isReacted), s = g(t.blogpost.reactionId);
|
206
|
+
async function c(h) {
|
207
|
+
if (!t.user) {
|
208
|
+
alert("Please login to add a reaction");
|
209
|
+
return;
|
210
|
+
}
|
211
|
+
try {
|
212
|
+
const n = {
|
213
|
+
target: t.blogpost._id,
|
214
|
+
type: "blogpost",
|
215
|
+
user: t.user,
|
216
|
+
class: "like"
|
217
|
+
}, v = await C.create(n);
|
218
|
+
v.reaction.class === "like" && (a.value += 1, r.value = !0, s.value = v.reaction._id);
|
219
|
+
} catch (n) {
|
220
|
+
console.error(n), alert("Error adding reaction. Please try again later.");
|
221
|
+
}
|
222
|
+
}
|
223
|
+
async function m(h) {
|
224
|
+
if (!t.user) {
|
225
|
+
alert("Please login to add a reaction");
|
226
|
+
return;
|
227
|
+
}
|
228
|
+
try {
|
229
|
+
const n = { _id: s.value };
|
230
|
+
await C.delete(n), a.value -= 1, r.value = !1, s.value = null;
|
231
|
+
} catch {
|
232
|
+
alert("Error adding reaction. Please try again later.");
|
233
|
+
}
|
234
|
+
}
|
235
|
+
return (h, n) => (o(), l("footer", se, [
|
236
|
+
z(" 👁️ " + u(e.blogpost.views) + " ", 1),
|
237
|
+
oe,
|
238
|
+
b("div", ne, [
|
239
|
+
r.value ? i("", !0) : (o(), l("div", {
|
240
|
+
key: 0,
|
241
|
+
class: "cursor-pointer",
|
242
|
+
onClick: n[0] || (n[0] = (v) => c())
|
243
|
+
}, " 👍 " + u(a.value), 1)),
|
244
|
+
r.value ? (o(), l("div", {
|
245
|
+
key: 1,
|
246
|
+
class: "cursor-pointer",
|
247
|
+
onClick: n[1] || (n[1] = (v) => m())
|
248
|
+
}, " 👍 " + u(a.value), 1)) : i("", !0)
|
249
|
+
]),
|
250
|
+
le,
|
251
|
+
z(" 💬 " + u(e.blogpost.numberOfComments), 1)
|
252
|
+
]));
|
253
|
+
}
|
254
|
+
}, ie = { class: "bg-grey radius-big" }, ue = ["src"], de = { class: "pd-t-zero pd-medium" }, me = {
|
255
|
+
key: 0,
|
256
|
+
class: "cursor-pointer mn-thin flex-nowrap flex w-100"
|
257
|
+
}, ge = {
|
258
|
+
key: 0,
|
259
|
+
class: "pd-micro t-white uppercase t-semi p-small flex-center flex pd-r-small pd-l-small mn-l-thin w-min bg-second radius-extra"
|
260
|
+
}, pe = {
|
261
|
+
key: 1,
|
262
|
+
class: "mn-small t-transp p-big"
|
263
|
+
}, fe = {
|
264
|
+
key: 2,
|
265
|
+
class: "mn-small h2"
|
266
|
+
}, ye = {
|
267
|
+
__name: "CardBlogpost",
|
268
|
+
props: ["blogpost", "user", "type"],
|
269
|
+
setup(e) {
|
270
|
+
const t = e, a = D(), r = B(() => t.blogpost.content.find((c) => c.type === "ImageUpload")), s = B(() => t.blogpost.content.find((c) => c.type === "Textarea"));
|
271
|
+
return (c, m) => (o(), l("article", ie, [
|
272
|
+
w(V, {
|
273
|
+
class: O({
|
274
|
+
"mn-small pd-medium": e.type !== "short",
|
275
|
+
"flex-child-order-last flex-child mn-l-small": e.type === "short"
|
276
|
+
}),
|
277
|
+
owner: e.blogpost.owner,
|
278
|
+
creator: e.blogpost.creator,
|
279
|
+
date: e.blogpost.createdAt
|
280
|
+
}, null, 8, ["class", "owner", "creator", "date"]),
|
281
|
+
d(r) && d(r).content && e.type !== "blogpostPage" ? (o(), l("img", {
|
282
|
+
key: 0,
|
283
|
+
src: d(r).content,
|
284
|
+
alt: "Blog post image",
|
285
|
+
class: "mn-medium object-fit-cover w-100 h-20r"
|
286
|
+
}, null, 8, ue)) : i("", !0),
|
287
|
+
b("section", de, [
|
288
|
+
e.type !== "blogpostPage" ? (o(), l("div", me, [
|
289
|
+
b("h3", {
|
290
|
+
onClick: m[0] || (m[0] = (h) => d(a).push({
|
291
|
+
name: "BlogPost",
|
292
|
+
params: {
|
293
|
+
url: e.blogpost.url
|
294
|
+
}
|
295
|
+
})),
|
296
|
+
class: ""
|
297
|
+
}, u(e.blogpost.name), 1),
|
298
|
+
e.blogpost.status === "draft" ? (o(), l("div", ge, u(e.blogpost.status), 1)) : i("", !0)
|
299
|
+
])) : i("", !0),
|
300
|
+
d(s) && d(s).content && e.type !== "blogpostPage" ? (o(), l("p", pe, u(d(s).content.slice(0, 120)) + "... ", 1)) : i("", !0),
|
301
|
+
e.type === "blogpostPage" ? (o(), l("h3", fe, u(e.blogpost.name), 1)) : i("", !0),
|
302
|
+
A(c.$slots, "default"),
|
303
|
+
e.type !== "short" && e.blogpost.tags.length > 0 ? (o(), x(q, {
|
304
|
+
key: 3,
|
305
|
+
chips: e.blogpost.tags
|
306
|
+
}, null, 8, ["chips"])) : i("", !0)
|
307
|
+
]),
|
308
|
+
w(ce, {
|
309
|
+
class: "pd-t-zero pd-medium",
|
310
|
+
blogpost: e.blogpost,
|
311
|
+
user: e.user
|
312
|
+
}, null, 8, ["blogpost", "user"])
|
313
|
+
]));
|
314
|
+
}
|
315
|
+
}, be = { class: "feed" }, he = { key: 1 }, Ce = {
|
316
|
+
__name: "Feed",
|
317
|
+
props: {
|
318
|
+
category: {
|
319
|
+
type: String,
|
320
|
+
default: null
|
321
|
+
},
|
322
|
+
owner: {
|
323
|
+
type: String,
|
324
|
+
default: null
|
325
|
+
},
|
326
|
+
creator: {
|
327
|
+
type: String,
|
328
|
+
default: null
|
329
|
+
},
|
330
|
+
status: {
|
331
|
+
type: String,
|
332
|
+
default: "published"
|
333
|
+
},
|
334
|
+
user: {
|
335
|
+
type: [String, Number],
|
336
|
+
default: null
|
337
|
+
},
|
338
|
+
period: {
|
339
|
+
type: String,
|
340
|
+
default: null
|
341
|
+
}
|
342
|
+
},
|
343
|
+
setup(e) {
|
344
|
+
const t = e, a = g([]), r = g(!0);
|
345
|
+
let s = g(!0), c = g(0), m = g(7);
|
346
|
+
const h = async () => {
|
347
|
+
if (r.value) {
|
348
|
+
c.value += m.value;
|
349
|
+
const n = await S({
|
350
|
+
skip: c.value,
|
351
|
+
limit: m.value,
|
352
|
+
category: t.category,
|
353
|
+
user: t.user,
|
354
|
+
owner: t.owner,
|
355
|
+
status: t.status,
|
356
|
+
creator: t.creator,
|
357
|
+
period: t.period
|
358
|
+
});
|
359
|
+
n.length === 0 && (r.value = !1), a.value = [...a.value, ...n];
|
360
|
+
}
|
361
|
+
};
|
362
|
+
return T(async () => {
|
363
|
+
const n = await S({
|
364
|
+
skip: c.value,
|
365
|
+
limit: m.value,
|
366
|
+
category: t.category,
|
367
|
+
user: t.user,
|
368
|
+
owner: t.owner,
|
369
|
+
status: t.status,
|
370
|
+
creator: t.creator,
|
371
|
+
period: t.period
|
372
|
+
});
|
373
|
+
n.length === 0 ? r.value = !1 : r.value = !0, a.value = n, s.value = !1;
|
374
|
+
}), (n, v) => (o(), l("section", be, [
|
375
|
+
w($, { name: "fade" }, {
|
376
|
+
default: j(() => [
|
377
|
+
d(s) ? (o(), x(re, {
|
378
|
+
key: 0,
|
379
|
+
class: "z-index-5 pos-t-50 left-t-50 pos-absolute"
|
380
|
+
})) : i("", !0)
|
381
|
+
]),
|
382
|
+
_: 1
|
383
|
+
}),
|
384
|
+
w($, { name: "fade" }, {
|
385
|
+
default: j(() => [
|
386
|
+
!d(s) && a.value.length < 1 ? (o(), x(M, {
|
387
|
+
key: 0,
|
388
|
+
title: "No Blog Posts Found",
|
389
|
+
description: "Currently, there are no posts available in this blog. Please check back later.",
|
390
|
+
class: "pd-medium mn-thin bg-grey radius-big"
|
391
|
+
})) : (o(), l("div", he, [
|
392
|
+
(o(!0), l(U, null, E(a.value, (R) => (o(), x(ye, {
|
393
|
+
key: R._id,
|
394
|
+
blogpost: R,
|
395
|
+
user: e.user,
|
396
|
+
class: "mn-medium"
|
397
|
+
}, null, 8, ["blogpost", "user"]))), 128)),
|
398
|
+
w($, { name: "fade" }, {
|
399
|
+
default: j(() => [
|
400
|
+
r.value && a.value.length > 0 ? (o(), l("button", {
|
401
|
+
key: 0,
|
402
|
+
onClick: h,
|
403
|
+
class: "w-100 bg-main button"
|
404
|
+
}, " Load more ")) : i("", !0)
|
405
|
+
]),
|
406
|
+
_: 1
|
407
|
+
})
|
408
|
+
]))
|
409
|
+
]),
|
410
|
+
_: 1
|
411
|
+
})
|
412
|
+
]));
|
413
|
+
}
|
414
|
+
};
|
415
|
+
export {
|
416
|
+
re as L,
|
417
|
+
Ce as _,
|
418
|
+
G as a,
|
419
|
+
J as b,
|
420
|
+
K as c,
|
421
|
+
ye as d,
|
422
|
+
ce as e,
|
423
|
+
je as f,
|
424
|
+
Se as g,
|
425
|
+
S as r,
|
426
|
+
f as s,
|
427
|
+
H as u
|
428
|
+
};
|