@ozdao/prometheus-framework 0.2.90 → 0.2.92
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/auth.server.js +1 -0
- package/dist/auth.server.mjs +1 -0
- package/dist/events.server.js +5 -3
- package/dist/events.server.mjs +5 -3
- package/dist/main-BQisDfLk.js +92 -0
- package/dist/main-DTlUA63C.mjs +13617 -0
- package/dist/main.css +1 -1
- package/dist/prometheus-framework/src/components/Block/Block.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Block/Block.vue.js +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue2.js +24 -32
- package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone.vue.js +17 -16
- package/dist/prometheus-framework/src/components/Select/Select.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue.js +1 -103
- package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue2.js +103 -1
- package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue.js +1 -36
- package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue2.js +36 -1
- package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.js +1 -45
- package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.js +45 -1
- package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.js +7 -6
- package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +28 -29
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +64 -64
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +37 -38
- package/dist/prometheus-framework/src/modules/auth/store/auth.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/store/auth.js +35 -37
- package/dist/prometheus-framework/src/modules/auth/store/twofa.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/store/twofa.js +3 -3
- package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +10 -9
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +1 -5
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +0 -66
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +5 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +66 -0
- package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.js +14 -48
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +85 -25
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +69 -57
- package/dist/prometheus-framework/src/modules/landing/components/sections/SectionFeatures.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/landing/components/sections/SectionFeatures.vue.js +74 -0
- package/dist/prometheus-framework/src/modules/landing/landing.client.cjs +1 -1
- package/dist/prometheus-framework/src/modules/landing/landing.client.js +4 -2
- package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +3 -2
- package/dist/prometheus-framework/src/modules/middlewares/client/inputs.validation.cjs +1 -1
- package/dist/prometheus-framework/src/modules/middlewares/client/inputs.validation.js +10 -13
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/router/orders.backoffice.router.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/router/orders.backoffice.router.js +6 -8
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +3 -2
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +4 -3
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.js +36 -25
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +7 -6
- package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +3 -2
- package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +5 -4
- package/dist/prometheus-framework.cjs.js +1 -1
- package/dist/prometheus-framework.es.js +1 -1
- package/dist/style.css +1 -1
- package/dist/web-CXzcKdk4.mjs +54 -0
- package/dist/web-D9Cfcy5k.js +1 -0
- package/package.json +1 -1
- package/src/components/Button/Button.vue +5 -8
- package/src/components/FieldPhone/FieldPhone.vue +4 -0
- package/src/modules/auth/components/pages/ResetPassword.vue +1 -1
- package/src/modules/auth/components/pages/SignIn.vue +3 -3
- package/src/modules/auth/components/pages/SignUp.vue +1 -1
- package/src/modules/auth/controllers/auth.controller.js +1 -0
- package/src/modules/auth/store/auth.js +3 -5
- package/src/modules/auth/store/twofa.js +1 -1
- package/src/modules/events/components/layouts/layoutEvents.vue +2 -59
- package/src/modules/events/components/pages/Events.vue +106 -23
- package/src/modules/events/controllers/events.controller.js +6 -3
- package/src/modules/globals/components/blocks/CardHeader.vue +29 -4
- package/src/modules/landing/landing.client.js +3 -1
- package/src/modules/middlewares/client/inputs.validation.js +0 -13
- package/src/modules/orders/components/sections/SubscribeNewsletter.vue +2 -2
- package/src/modules/orders/router/orders.backoffice.router.js +2 -4
- package/src/modules/products/components/blocks/CardProduct.vue +31 -20
- package/src/modules/products/components/sections/HeroRecommendation.vue +1 -1
@@ -1,32 +1,32 @@
|
|
1
|
-
import { ref as d, resolveComponent as
|
2
|
-
import
|
3
|
-
import
|
4
|
-
import
|
1
|
+
import { ref as d, resolveComponent as k, openBlock as E, createElementBlock as S, createElementVNode as o, toDisplayString as r, unref as t, createVNode as l, Transition as h, withCtx as m, withDirectives as f, vShow as _, createTextVNode as v } from "vue";
|
2
|
+
import x from "../../../../components/Tab/Tab.vue2.js";
|
3
|
+
import N from "../../../../components/Field/Field.vue2.js";
|
4
|
+
import V from "../../../../components/FieldPhone/FieldPhone.vue.js";
|
5
5
|
import D from "../../../../components/Button/Button.vue2.js";
|
6
6
|
import { useRoute as I, useRouter as P } from "vue-router";
|
7
|
-
import { useI18n as
|
8
|
-
import
|
7
|
+
import { useI18n as F } from "vue-i18n";
|
8
|
+
import O from "../../localization/SignUp.json.js";
|
9
9
|
import { state as s } from "../../store/auth.js";
|
10
|
-
import { sendCode as
|
11
|
-
import { validateInputs as b, validatePhone as
|
10
|
+
import { sendCode as T } from "../../store/twofa.js";
|
11
|
+
import { validateInputs as b, validatePhone as U, validateEmail as A } from "../../../middlewares/client/inputs.validation.js";
|
12
12
|
import "./SignUp.vue2.js";
|
13
|
-
const B = { class: "t-left pd-medium" }, R = { class: "mn-b-small" }, $ = { class: "mn-b-small p-small uppercase t-semi bg-grey radius-big o-hidden" }, L = { class: "pos-relative" }, j = { class: "mn-b-semi radius-small" }, q = { class: "mn-b-small t-transp" }, z = { class: "mn-b-semi radius-small o-hidden" }, G = { class: "mn-b-small t-transp" }, H = { class: "w-100" },
|
13
|
+
const B = { class: "t-left pd-medium" }, R = { class: "mn-b-small" }, $ = { class: "mn-b-small p-small uppercase t-semi bg-grey radius-big o-hidden" }, L = { class: "pos-relative" }, j = { class: "mn-b-semi radius-small" }, q = { class: "mn-b-small t-transp" }, z = { class: "mn-b-semi radius-small o-hidden" }, G = { class: "mn-b-small t-transp" }, H = { class: "w-100" }, ie = {
|
14
14
|
__name: "SignUp",
|
15
15
|
setup(J) {
|
16
|
-
const { t: e } =
|
16
|
+
const { t: e } = F({
|
17
17
|
useScope: "global",
|
18
|
-
...
|
18
|
+
...O
|
19
19
|
}), u = d(null), c = d(null);
|
20
20
|
I();
|
21
|
-
const
|
22
|
-
async function
|
21
|
+
const g = P(), a = d("phone");
|
22
|
+
async function w() {
|
23
23
|
try {
|
24
|
-
|
24
|
+
a.value === "phone" && await b(
|
25
25
|
u,
|
26
|
-
|
26
|
+
U,
|
27
27
|
s.user.phone,
|
28
28
|
"Некорректный телефон"
|
29
|
-
),
|
29
|
+
), a.value === "email" && await b(
|
30
30
|
c,
|
31
31
|
A,
|
32
32
|
s.user.email,
|
@@ -36,22 +36,22 @@ const B = { class: "t-left pd-medium" }, R = { class: "mn-b-small" }, $ = { clas
|
|
36
36
|
throw new Error();
|
37
37
|
}
|
38
38
|
try {
|
39
|
-
await
|
39
|
+
await T(s.user, "signup", a.value);
|
40
40
|
} catch {
|
41
41
|
throw new Error();
|
42
42
|
}
|
43
43
|
}
|
44
|
-
function
|
45
|
-
|
44
|
+
function C() {
|
45
|
+
g.push({ name: "Enter Code" });
|
46
46
|
}
|
47
47
|
return (p, i) => {
|
48
|
-
const y =
|
49
|
-
return
|
48
|
+
const y = k("router-link");
|
49
|
+
return E(), S("section", B, [
|
50
50
|
o("h3", R, r(t(e)("title")), 1),
|
51
51
|
o("div", $, [
|
52
|
-
|
53
|
-
selected:
|
54
|
-
"onUpdate:selected": i[0] || (i[0] = (n) =>
|
52
|
+
l(x, {
|
53
|
+
selected: a.value,
|
54
|
+
"onUpdate:selected": i[0] || (i[0] = (n) => a.value = n),
|
55
55
|
tabs: [
|
56
56
|
{ name: t(e)("phone"), value: "phone" },
|
57
57
|
{ name: t(e)("email"), value: "email" }
|
@@ -59,13 +59,12 @@ const B = { class: "t-left pd-medium" }, R = { class: "mn-b-small" }, $ = { clas
|
|
59
59
|
}, null, 8, ["selected", "tabs"])
|
60
60
|
]),
|
61
61
|
o("div", L, [
|
62
|
-
|
62
|
+
l(h, { name: "slide-fade" }, {
|
63
63
|
default: m(() => [
|
64
64
|
f(o("div", j, [
|
65
65
|
o("p", q, r(t(e)("smsNotice")), 1),
|
66
|
-
|
67
|
-
|
68
|
-
"onUpdate:modelValue": i[1] || (i[1] = (n) => s.user.phone = n),
|
66
|
+
l(V, {
|
67
|
+
onChange: i[1] || (i[1] = (n) => s.user.phone = n),
|
69
68
|
dropdownOptions: {
|
70
69
|
showDialCodeInSelection: !0,
|
71
70
|
showFlags: !0,
|
@@ -75,18 +74,18 @@ const B = { class: "t-left pd-medium" }, R = { class: "mn-b-small" }, $ = { clas
|
|
75
74
|
mode: "national",
|
76
75
|
inputOptions: { placeholder: t(e)("phonePlaceholder") },
|
77
76
|
class: "bg-grey pd-small radius-small mn-b-thin"
|
78
|
-
}, null, 8, ["
|
77
|
+
}, null, 8, ["validation", "inputOptions"])
|
79
78
|
], 512), [
|
80
|
-
[_,
|
79
|
+
[_, a.value === "phone"]
|
81
80
|
])
|
82
81
|
]),
|
83
82
|
_: 1
|
84
83
|
}),
|
85
|
-
|
84
|
+
l(h, { name: "slide-fade" }, {
|
86
85
|
default: m(() => [
|
87
86
|
f(o("div", z, [
|
88
87
|
o("p", G, r(t(e)("emailNotice")), 1),
|
89
|
-
|
88
|
+
l(N, {
|
90
89
|
field: s.user.email,
|
91
90
|
"onUpdate:field": i[2] || (i[2] = (n) => s.user.email = n),
|
92
91
|
placeholder: t(e)("emailPlaceholder"),
|
@@ -94,15 +93,15 @@ const B = { class: "t-left pd-medium" }, R = { class: "mn-b-small" }, $ = { clas
|
|
94
93
|
class: "bg-grey pd-medium radius-small"
|
95
94
|
}, null, 8, ["field", "placeholder", "validation"])
|
96
95
|
], 512), [
|
97
|
-
[_,
|
96
|
+
[_, a.value === "email"]
|
98
97
|
])
|
99
98
|
]),
|
100
99
|
_: 1
|
101
100
|
})
|
102
101
|
]),
|
103
|
-
|
104
|
-
submit:
|
105
|
-
callback:
|
102
|
+
l(D, {
|
103
|
+
submit: w,
|
104
|
+
callback: C,
|
106
105
|
class: "w-100 bg-main mn-b-big"
|
107
106
|
}, {
|
108
107
|
default: m(() => [
|
@@ -111,7 +110,7 @@ const B = { class: "t-left pd-medium" }, R = { class: "mn-b-small" }, $ = { clas
|
|
111
110
|
_: 1
|
112
111
|
}),
|
113
112
|
o("div", H, [
|
114
|
-
|
113
|
+
l(y, {
|
115
114
|
to: "/auth/signin",
|
116
115
|
class: "underline mn-b-medium d-block t-blue"
|
117
116
|
}, {
|
@@ -126,5 +125,5 @@ const B = { class: "t-left pd-medium" }, R = { class: "mn-b-small" }, $ = { clas
|
|
126
125
|
}
|
127
126
|
};
|
128
127
|
export {
|
129
|
-
|
128
|
+
ie as default
|
130
129
|
};
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("../../../../node_modules/axios/lib/axios.cjs"),d=require("../../../../../node_modules/js-cookie/dist/js.cookie.cjs"),l=require("../../../../node_modules/@capacitor/preferences/dist/esm/index.cjs"),w=require("vue"),c=require("../../globals/store/globals.cjs"),g=require("./twofa.cjs"),i=f.default.create({baseURL:process.env.API_URL,withCredentials:!0}),o=w.reactive({user:{_id:void 0,username:"",email:"",phone:"",password:"",passwordRepeat:""},access:{roles:null,token:null,status:!1}});async function O(){const e=await P("user");if(e){const{_id:t,email:s,phone:n,roles:a,accessToken:r}=e;Object.assign(o.user,{_id:t,email:s,phone:n}),Object.assign(o.access,{token:r,roles:a,status:!!r}),i.interceptors.request.use(u=>(r&&(u.headers["x-access-token"]=r),u),u=>Promise.reject(u))}}O();const k={async login(e,t){try{const s=await i.post("/api/auth/signin",{...e,type:t});return p("user",s.data),Object.assign(o.user,{...s.data}),Object.assign(o.access,{token:s.data.accessToken,status:!0,roles:s.data.roles}),s.data}catch(s){return Object.assign(o.access,{token:null,status:!1,roles:null}),c.setError(s),Promise.reject(s)}},async signup(e,t,s){const{password:n,passwordRepeat:a}=o.user;if(console.log(n),console.log(a),n!==a){const r={response:{data:{errorCode:"PASSWORDS_DO_NOT_MATCH"}}};throw c.setError(r),new Error(r.response.status)}try{const r=await i.post("/api/auth/signup",{...e,type:t,inviteCode:s});return console.log(r),r.data.accessToken&&p("user",r.data),Object.assign(o.user,{...r.data}),Object.assign(o.access,{token:r.data.accessToken,status:!0,roles:r.data.roles}),r.data}catch(r){throw c.setError(r),console.log("Sign up falied"),r}},logout(){j("user"),Object.assign(o.user,{email:"",phone:"",password:"",passwordRepeat:""}),Object.assign(o.access,{token:null,status:!1})},async resetPassword(e,t){try{const s=await i.post("/api/auth/reset-password",{email:e.email,phone:e.phone,type:t});return Object.assign(g.state.code,{...s.data,isSended:!0}),s.data}catch(s){return c.setError(s),Promise.reject(s)}},async updatePassword(e,t){const{password:s,passwordRepeat:n}=o.user;if(s!==n){const a={response:{data:{errorCode:"PASSWORDS_DO_NOT_MATCH"}}};throw c.setError(a),new Error(a.response.status)}try{const a=await i.post("/api/auth/update-password",{email:e.email,phone:e.phone,password:e.password,passwordRepeat:e.passwordRepeat,type:t});return a.data.accessToken&&p("user",a.data),Object.assign(o.user,{...a.data}),Object.assign(o.access,{token:a.data.accessToken,status:!0}),a.data}catch(a){return c.setError(a),Promise.reject(a)}}},h={development:{secure:!1,expires:7,sameSite:"Lax"},production:{expires:7,path:"/",domain:process.env.API_URL,sameSite:"none",secure:!0}};async function P(e){if(process.env.MOBILE_APP){const{value:t}=await l.Preferences.get({key:e});return t?JSON.parse(t):null}else{const t=d.default.get(e);return t?JSON.parse(t):null}}function p(e,t,s=process.env.DOMAIN_URL){process.env.MOBILE_APP?l.Preferences.set({key:e,value:JSON.stringify(t)}):d.default.set(e,JSON.stringify(t),h[s])}function j(e,t=process.env.NODE_ENV){if(process.env.MOBILE_APP)l.Preferences.remove({key:e});else{const s=t==="production"?{domain:process.env.API_URL}:{};d.default.remove(e,s)}}w.watch(o,(e,t)=>{});exports.actions=k;exports.state=o;
|
@@ -1,10 +1,10 @@
|
|
1
|
-
import
|
1
|
+
import w from "../../../../node_modules/axios/lib/axios.js";
|
2
2
|
import d from "../../../../../node_modules/js-cookie/dist/js.cookie.js";
|
3
3
|
import { Preferences as l } from "../../../../node_modules/@capacitor/preferences/dist/esm/index.js";
|
4
|
-
import { reactive as
|
5
|
-
import { setError as
|
4
|
+
import { reactive as m, watch as f } from "vue";
|
5
|
+
import { setError as c } from "../../globals/store/globals.js";
|
6
6
|
import { state as O } from "./twofa.js";
|
7
|
-
const
|
7
|
+
const i = w.create({ baseURL: process.env.API_URL, withCredentials: !0 }), r = m({
|
8
8
|
user: {
|
9
9
|
_id: void 0,
|
10
10
|
username: "",
|
@@ -22,15 +22,15 @@ const p = m.create({ baseURL: process.env.API_URL, withCredentials: !0 }), r = w
|
|
22
22
|
async function g() {
|
23
23
|
const e = await k("user");
|
24
24
|
if (e) {
|
25
|
-
const { _id: t, email: s, phone:
|
26
|
-
Object.assign(r.user, { _id: t, email: s, phone:
|
25
|
+
const { _id: t, email: s, phone: n, roles: o, accessToken: a } = e;
|
26
|
+
Object.assign(r.user, { _id: t, email: s, phone: n }), Object.assign(r.access, { token: a, roles: o, status: !!a }), i.interceptors.request.use((p) => (a && (p.headers["x-access-token"] = a), p), (p) => Promise.reject(p));
|
27
27
|
}
|
28
28
|
}
|
29
29
|
g();
|
30
30
|
const R = {
|
31
31
|
async login(e, t) {
|
32
32
|
try {
|
33
|
-
const s = await
|
33
|
+
const s = await i.post("/api/auth/signin", {
|
34
34
|
...e,
|
35
35
|
type: t
|
36
36
|
});
|
@@ -46,36 +46,34 @@ const R = {
|
|
46
46
|
token: null,
|
47
47
|
status: !1,
|
48
48
|
roles: null
|
49
|
-
}),
|
49
|
+
}), c(s), Promise.reject(s);
|
50
50
|
}
|
51
51
|
},
|
52
52
|
async signup(e, t, s) {
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
const o = {
|
53
|
+
const { password: n, passwordRepeat: o } = r.user;
|
54
|
+
if (console.log(n), console.log(o), n !== o) {
|
55
|
+
const a = {
|
57
56
|
response: {
|
58
57
|
data: { errorCode: "PASSWORDS_DO_NOT_MATCH" }
|
59
58
|
}
|
60
59
|
};
|
61
|
-
throw
|
60
|
+
throw c(a), new Error(a.response.status);
|
62
61
|
}
|
63
62
|
try {
|
64
|
-
|
65
|
-
const o = await p.post("/api/auth/signup", {
|
63
|
+
const a = await i.post("/api/auth/signup", {
|
66
64
|
...e,
|
67
65
|
type: t,
|
68
66
|
inviteCode: s
|
69
67
|
});
|
70
|
-
return console.log(
|
71
|
-
...
|
68
|
+
return console.log(a), a.data.accessToken && u("user", a.data), Object.assign(r.user, {
|
69
|
+
...a.data
|
72
70
|
}), Object.assign(r.access, {
|
73
|
-
token:
|
71
|
+
token: a.data.accessToken,
|
74
72
|
status: !0,
|
75
|
-
roles:
|
76
|
-
}),
|
77
|
-
} catch (
|
78
|
-
throw
|
73
|
+
roles: a.data.roles
|
74
|
+
}), a.data;
|
75
|
+
} catch (a) {
|
76
|
+
throw c(a), console.log("Sign up falied"), a;
|
79
77
|
}
|
80
78
|
},
|
81
79
|
logout() {
|
@@ -91,9 +89,9 @@ const R = {
|
|
91
89
|
},
|
92
90
|
async resetPassword(e, t) {
|
93
91
|
try {
|
94
|
-
const s = await
|
92
|
+
const s = await i.post("/api/auth/reset-password", {
|
95
93
|
email: e.email,
|
96
|
-
phone: e.phone
|
94
|
+
phone: e.phone,
|
97
95
|
type: t
|
98
96
|
});
|
99
97
|
return Object.assign(O.code, {
|
@@ -101,35 +99,35 @@ const R = {
|
|
101
99
|
isSended: !0
|
102
100
|
}), s.data;
|
103
101
|
} catch (s) {
|
104
|
-
return
|
102
|
+
return c(s), Promise.reject(s);
|
105
103
|
}
|
106
104
|
},
|
107
105
|
async updatePassword(e, t) {
|
108
|
-
const { password: s, passwordRepeat:
|
109
|
-
if (s !==
|
110
|
-
const
|
106
|
+
const { password: s, passwordRepeat: n } = r.user;
|
107
|
+
if (s !== n) {
|
108
|
+
const o = {
|
111
109
|
response: {
|
112
110
|
data: { errorCode: "PASSWORDS_DO_NOT_MATCH" }
|
113
111
|
}
|
114
112
|
};
|
115
|
-
throw
|
113
|
+
throw c(o), new Error(o.response.status);
|
116
114
|
}
|
117
115
|
try {
|
118
|
-
const
|
116
|
+
const o = await i.post("/api/auth/update-password", {
|
119
117
|
email: e.email,
|
120
|
-
phone: e.phone
|
118
|
+
phone: e.phone,
|
121
119
|
password: e.password,
|
122
120
|
passwordRepeat: e.passwordRepeat,
|
123
121
|
type: t
|
124
122
|
});
|
125
|
-
return
|
126
|
-
...
|
123
|
+
return o.data.accessToken && u("user", o.data), Object.assign(r.user, {
|
124
|
+
...o.data
|
127
125
|
}), Object.assign(r.access, {
|
128
|
-
token:
|
126
|
+
token: o.data.accessToken,
|
129
127
|
status: !0
|
130
|
-
}),
|
131
|
-
} catch (
|
132
|
-
return
|
128
|
+
}), o.data;
|
129
|
+
} catch (o) {
|
130
|
+
return c(o), Promise.reject(o);
|
133
131
|
}
|
134
132
|
}
|
135
133
|
}, h = {
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("../../../../node_modules/axios/lib/axios.cjs");require("../../../../../node_modules/js-cookie/dist/js.cookie.cjs");const i=require("vue"),n=require("../../globals/store/globals.cjs"),c=d.default.create({baseURL:process.env.API_URL,withCredentials:!0}),t=i.reactive({code:{value:"",type:"",method:"",isSended:!1,isValid:!1}});async function l(a,o,r){let s="/api/twofa/sendcode";return o==="reset-password"&&(s="/api/twofa/sendcodereset"),await c.post(s,{phone:a.phone,email:a.email,method:o,type:r}).then(e=>(t.code=e.data,t.code.isSended=!0,Promise.resolve(e.data)),e=>(console.log(e),n.setError(e),Promise.reject(e)))}i.watch(t,(a,o)=>{});exports.sendCode=l;exports.state=t;
|
@@ -11,10 +11,10 @@ const p = r.create({ baseURL: process.env.API_URL, withCredentials: !0 }), a = d
|
|
11
11
|
isValid: !1
|
12
12
|
}
|
13
13
|
});
|
14
|
-
async function
|
14
|
+
async function h(t, o, i) {
|
15
15
|
let s = "/api/twofa/sendcode";
|
16
16
|
return o === "reset-password" && (s = "/api/twofa/sendcodereset"), await p.post(s, {
|
17
|
-
phone: t.phone
|
17
|
+
phone: t.phone,
|
18
18
|
email: t.email,
|
19
19
|
method: o,
|
20
20
|
type: i
|
@@ -26,6 +26,6 @@ async function w(t, o, i) {
|
|
26
26
|
n(a, (t, o) => {
|
27
27
|
});
|
28
28
|
export {
|
29
|
-
|
29
|
+
h as sendCode,
|
30
30
|
a as state
|
31
31
|
};
|
package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),d=require("vue-router"),f=require("../../../../components/Select/Select.
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),d=require("vue-router"),f=require("../../../../components/Select/Select.vue2.cjs"),g=require("../../../../components/Feed/Feed.vue.cjs"),h=require("../../../organizations/components/blocks/CardOrganization.vue.cjs"),x=require("../../../icons/entities/IconFeatured.vue.cjs"),b=require("../../../icons/entities/IconPopular.vue.cjs"),_=require("../../../icons/entities/IconRecent.vue.cjs"),w=require("../../../icons/entities/IconFollowing.vue.cjs"),m=require("../../store/blogposts.cjs"),l=require("../../../auth/store/auth.cjs"),c=require("../../../organizations/store/organizations.cjs"),k=require("../../../organizations/store/memberships.cjs"),N={style:{"grid-template-columns":"2fr 4fr 2fr"},class:"cols-3 gap-thin pd-thin"},V={class:"align-self-start pos-sticky pos-t-0 w-100 bg-grey radius-big pd-medium p-medium gap-thin flex-column flex-nowrap flex"},v={class:"pos-relative"},C={class:"bg-main t-black radius-big pd-medium pos-relative mn-b-thin flex-v-center t-left flex-nowrap flex"},y={class:"pos-relative flex-v-center flex-nowrap flex"},B=e.createElementVNode("span",{class:"mn-r-small"},"Topics for ",-1),q={class:"align-self-start bg-grey radius-big pd-medium"},E={class:"gap-thin flex-nowrap flex"},z=e.createElementVNode("p",{class:"t-medium mn-b-small"},"Popular Communities",-1),T={__name:"Community",setup(F){const o=d.useRoute(),a=d.useRouter(),p=({membership:u,status:r,target:s},i,t)=>{k.mutations.handleMembershipUpdate(c.state.current,u,r,s,i,t)};return(u,r)=>{const s=e.resolveComponent("router-link"),i=e.resolveComponent("router-view");return e.openBlock(),e.createElementBlock("div",N,[e.createElementVNode("ul",V,[e.createElementVNode("li",{class:e.normalizeClass([{"t-black bg-white":e.unref(o).params.category==="featured"},"cursor-pointer flex-v-center flex t-medium pd-thin radius-extra"]),onClick:r[0]||(r[0]=t=>e.unref(a).push({name:"Blog",params:{category:"featured"}}))},[e.createVNode(x.default,{class:"i-medium mn-r-thin t-transp"}),e.createTextVNode(" Featured ")],2),e.createElementVNode("li",{class:e.normalizeClass([{"t-black bg-white":e.unref(o).params.category==="popular"},"cursor-pointer t-medium flex-v-center flex pd-thin radius-extra"]),onClick:r[1]||(r[1]=t=>e.unref(a).push({name:"Blog",params:{category:"popular"}}))},[e.createVNode(b.default,{class:"i-medium mn-r-thin t-transp"}),e.createTextVNode(" Popular ")],2),e.createElementVNode("li",{class:e.normalizeClass([{"t-black bg-white":e.unref(o).params.category==="new"},"cursor-pointer t-medium flex-v-center flex pd-thin radius-extra"]),onClick:r[2]||(r[2]=t=>e.unref(a).push({name:"Blog",params:{category:"new"}}))},[e.createVNode(_.default,{class:"i-medium mn-r-thin t-transp"}),e.createTextVNode(" Recent ")],2),l.state.user._id?(e.openBlock(),e.createElementBlock("li",{key:0,class:e.normalizeClass([{"t-white bg-black":e.unref(o).params.category==="following"},"cursor-pointer t-medium flex-v-center flex pd-thin radius-extra"]),onClick:r[3]||(r[3]=t=>e.unref(a).push({name:"Blog",params:{category:"following"}}))},[e.createVNode(w.default,{class:"i-medium mn-r-thin t-transp"}),e.createTextVNode(" Following ")],2)):e.createCommentVNode("",!0),e.createVNode(s,{to:{name:"Create BlogPost"},class:"button t-medium mn-t-small bg-main w-100"},{default:e.withCtx(()=>[e.createTextVNode(" Create Post ")]),_:1})]),e.createElementVNode("section",v,[e.createElementVNode("header",C,[e.createElementVNode("h2",y,[B,e.createVNode(f.default,{options:["today","week","month","year"],select:m.state.filter.period,"onUpdate:select":r[4]||(r[4]=t=>m.state.filter.period=t),placeholder:"Select type",class:"t-semi pos-relative w-max bg-main t-black pd-thin radius-medium h2 t-center br-solid br-2px br-black-transp-10"},null,8,["select"])])]),e.createVNode(i,null,{default:e.withCtx(({Component:t,route:n})=>[e.createVNode(e.Transition,{name:"scaleIn",mode:"out-in"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t),{ref:"page",key:n.query}))]),_:2},1024)]),_:1})]),e.createElementVNode("div",q,[e.createElementVNode("div",E,[z,l.state.user._id?(e.openBlock(),e.createBlock(s,{key:0,to:{name:"Create Organization"},class:"t-medium cursor-pointer hover-scale-1 radius-extra flex-center flex i-medium bg-main"},{default:e.withCtx(()=>[e.createTextVNode(" + ")]),_:1})):e.createCommentVNode("",!0)]),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.createVNode(g.default,{states:{empty:{title:"No Organization Found",description:"Currently, there are no organization available."}},store:{read:t=>c.actions.read(t),state:c.state},options:{user:l.state.user._id,sort:"numberOfMemberships",contain:["blogposts"],limit:10}},{default:e.withCtx(({items:t})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t,n=>(e.openBlock(),e.createBlock(h.default,{key:n._id,organization:n,user:l.state.user,showProducts:!1,showRating:!1,showFeatured:!1,showFollowers:!1,onUpdateMembership:p,class:"mn-b-thin w-100 pd-0 bg-white radius-big o-hidden"},null,8,["organization","user"]))),128))]),_:1},8,["store","options"])]),_:1})])])}}};exports.default=T;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { resolveComponent as b, openBlock as a, createElementBlock as g, createElementVNode as r, normalizeClass as d, unref as o, createVNode as s, createTextVNode as i, createCommentVNode as x, withCtx as n, Transition as w, createBlock as _, resolveDynamicComponent as C, Fragment as $, renderList as B } from "vue";
|
2
2
|
import { useRoute as F, useRouter as z } from "vue-router";
|
3
|
-
import N from "../../../../components/Select/Select.
|
3
|
+
import N from "../../../../components/Select/Select.vue2.js";
|
4
4
|
import P from "../../../../components/Feed/Feed.vue.js";
|
5
5
|
import M from "../../../organizations/components/blocks/CardOrganization.vue.js";
|
6
6
|
import R from "../../../icons/entities/IconFeatured.vue.js";
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../../../components/Field/Field.vue.cjs");const p=require("../../../../../../_virtual/_plugin-vue_export-helper.cjs");require("../../../../components/Select/Select.
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../../../components/Field/Field.vue.cjs");const p=require("../../../../../../_virtual/_plugin-vue_export-helper.cjs");require("../../../../components/Select/Select.vue.cjs");require("../../../../components/Loader/Loader.vue.cjs");require("../../../../components/Button/Button.vue.cjs");require("../../../../components/Upload/Upload.vue2.cjs");const _=require("../blocks/CardBlogpost.vue.cjs"),r=require("../../store/blogposts.cjs"),f=require("../../../auth/store/auth.cjs"),b=require("vue-router");require("./Community.vue2.cjs");const v=l=>(e.pushScopeId("data-v-bdf0e48a"),l=l(),e.popScopeId(),l),g={class:"flex-v-center flex-nowrap flex mn-b-medium"},h=v(()=>e.createElementVNode("h3",{class:"mn-r-medium"},"Blog",-1)),k={class:""},w={class:"flex-nowrap flex pd-t-zero pd-b-zero pd-big"},q=["onClick"],y=["onClick"],C={__name:"Community",async setup(l){let s,u;const i=b.useRouter();[s,u]=e.withAsyncContext(()=>r.read()),await s,u(),console.log(r.state),e.ref({title:"",content:"",categories:[]});const d=async t=>{window.confirm("Are you sure you want to delete this post?")&&(console.log(t),await r.remove(t))};let c=e.ref("all");const a=e.computed(()=>c.value==="all"?r.state.all:r.state.all.filter(t=>t.categories.includes(c.value)));return e.computed(()=>{for(let t of a.value)if(t.blocks&&t.blocks.length>0){const n=t.blocks.find(o=>o.type.name==="ImageUpload");if(n)return n.content}return null}),(t,n)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",g,[h,e.createElementVNode("button",{onClick:n[0]||(n[0]=o=>e.unref(i).push({name:"Create BlogPost"})),class:"t-white bg-second button-small button"},"+")]),e.createElementVNode("div",k,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,o=>(e.openBlock(),e.createBlock(_.default,{key:o._id,blogpost:o,owner:f.state.user._id,class:"mn-b-medium"},{default:e.withCtx(()=>[e.createElementVNode("div",w,[e.createElementVNode("button",{class:"mn-r-thin button-small w-100 button",onClick:m=>t.$router.push({path:"/community/posts/"+o.url+"/edit"})},"Edit",8,q),e.createElementVNode("button",{class:"button-small w-100 button",onClick:m=>d(o._id)},"Delete",8,y)])]),_:2},1032,["blogpost","owner"]))),128))])]))}},B=p.default(C,[["__scopeId","data-v-bdf0e48a"]]);exports.default=B;
|
@@ -1,11 +1,12 @@
|
|
1
|
-
import { withAsyncContext as h, ref as u, computed as d, openBlock as
|
1
|
+
import { withAsyncContext as h, ref as u, computed as d, openBlock as r, createElementBlock as p, createElementVNode as o, unref as v, Fragment as w, renderList as g, createBlock as k, withCtx as y, pushScopeId as C, popScopeId as x } from "vue";
|
2
2
|
import "../../../../components/Field/Field.vue.js";
|
3
3
|
import B from "../../../../../../_virtual/_plugin-vue_export-helper.js";
|
4
|
-
import "../../../../components/Select/Select.
|
4
|
+
import "../../../../components/Select/Select.vue.js";
|
5
|
+
import "../../../../components/Loader/Loader.vue.js";
|
5
6
|
import "../../../../components/Button/Button.vue.js";
|
6
7
|
import "../../../../components/Upload/Upload.vue2.js";
|
7
8
|
import $ from "../blocks/CardBlogpost.vue.js";
|
8
|
-
import { read as I, state as
|
9
|
+
import { read as I, state as l, remove as E } from "../../store/blogposts.js";
|
9
10
|
import { state as P } from "../../../auth/store/auth.js";
|
10
11
|
import { useRouter as S } from "vue-router";
|
11
12
|
import "./Community.vue2.js";
|
@@ -14,7 +15,7 @@ const z = (s) => (C("data-v-bdf0e48a"), s = s(), x(), s), A = { class: "flex-v-c
|
|
14
15
|
async setup(s) {
|
15
16
|
let i, a;
|
16
17
|
const _ = S();
|
17
|
-
[i, a] = h(() => I()), await i, a(), console.log(
|
18
|
+
[i, a] = h(() => I()), await i, a(), console.log(l), u({
|
18
19
|
title: "",
|
19
20
|
content: "",
|
20
21
|
categories: []
|
@@ -23,7 +24,7 @@ const z = (s) => (C("data-v-bdf0e48a"), s = s(), x(), s), A = { class: "flex-v-c
|
|
23
24
|
window.confirm("Are you sure you want to delete this post?") && (console.log(t), await E(t));
|
24
25
|
};
|
25
26
|
let c = u("all");
|
26
|
-
const m = d(() => c.value === "all" ?
|
27
|
+
const m = d(() => c.value === "all" ? l.all : l.all.filter((t) => t.categories.includes(c.value)));
|
27
28
|
return d(() => {
|
28
29
|
for (let t of m.value)
|
29
30
|
if (t.blocks && t.blocks.length > 0) {
|
@@ -32,7 +33,7 @@ const z = (s) => (C("data-v-bdf0e48a"), s = s(), x(), s), A = { class: "flex-v-c
|
|
32
33
|
return n.content;
|
33
34
|
}
|
34
35
|
return null;
|
35
|
-
}), (t, n) => (
|
36
|
+
}), (t, n) => (r(), p("div", null, [
|
36
37
|
o("div", A, [
|
37
38
|
D,
|
38
39
|
o("button", {
|
@@ -41,7 +42,7 @@ const z = (s) => (C("data-v-bdf0e48a"), s = s(), x(), s), A = { class: "flex-v-c
|
|
41
42
|
}, "+")
|
42
43
|
]),
|
43
44
|
o("div", F, [
|
44
|
-
(
|
45
|
+
(r(!0), p(w, null, g(m.value, (e) => (r(), k($, {
|
45
46
|
key: e._id,
|
46
47
|
blogpost: e,
|
47
48
|
owner: P.user._id,
|
@@ -64,7 +65,7 @@ const z = (s) => (C("data-v-bdf0e48a"), s = s(), x(), s), A = { class: "flex-v-c
|
|
64
65
|
])
|
65
66
|
]));
|
66
67
|
}
|
67
|
-
},
|
68
|
+
}, X = /* @__PURE__ */ B(U, [["__scopeId", "data-v-bdf0e48a"]]);
|
68
69
|
export {
|
69
|
-
|
70
|
+
X as default
|
70
71
|
};
|
package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),w=require("../../../constructor/components/elements/Textarea.
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),w=require("../../../constructor/components/elements/Textarea.vue2.cjs"),V=require("../../../constructor/components/sections/Constructor.vue.cjs"),y=require("../../../../components/Popup/Popup.vue.cjs");require("../../../../components/FieldTags/tag-input.vue.cjs");require("../../../../components/FieldTags/vue-tags-input.scss.cjs");const B=require("../../../../components/FieldTags/BlockTags.vue.cjs"),N=require("../../../../components/Checkbox/Checkbox.vue.cjs"),C=require("../../../../components/Field/Field.vue2.cjs"),P=require("../../../../components/SelectMulti/SelectMulti.vue.cjs"),x=require("../../../../components/Button/Button.vue2.cjs"),f=require("vue-router"),n=require("../../store/blogposts.cjs"),i=require("../../../auth/store/auth.cjs"),q=require("../../../organizations/store/organizations.cjs"),E={class:"pd-thin"},T={style:{"min-height":"100%"},class:"w-100 bg-grey pd-big radius-big"},z={class:"w-full h-full"},A={key:0,class:"pd-thin pos-sticky pos-l-0 pos-b-0 w-100"},O={class:"pd-thin radius-big bg-main w-100 flex-nowrap flex"},U=e.createElementVNode("h3",{class:"mn-b-small"},"Final Touches",-1),D=e.createElementVNode("h5",{class:"mn-b-thin"},"Add source:",-1),M=e.createElementVNode("h5",{class:"mn-b-thin"},"Add to public:",-1),S={key:0,class:"mn-b-thin"},F={key:1,class:"mn-b-medium br-grey br-2px br-solid pd-small radius-big"},R={__name:"CreateBlogPost",setup($){const s=f.useRoute(),u=f.useRouter();let t=e.ref(null),p=e.ref(null);const c=e.ref([]),r=e.ref(null);e.onMounted(async()=>{const o=await q.actions.read({user:i.state.user._id,postable:i.state.user._id,limit:100});if(p.value=o.map(a=>({name:a.profile.name,_id:a._id,photo:a.profile.photo})),s.params.url){const a=await n.read({user:i.state.user._id,url:s.params.url});t.value=a.pop()}else n.clean(),t.value=n.state.current;t.value.owner||(t.value.owner={target:i.state.user._id,type:"user"}),t.value.creator||(t.value.creator={target:i.state.user._id,type:"user",hidden:!1}),t.value.owner.type==="organization"&&(r.value={_id:t.value.owner.target._id,name:t.value.owner.target.profile.name,photo:t.value.owner.target.profile.photo}),console.log(o)});const g=e.ref(""),m=e.ref([{text:"story"},{text:"news"},{text:"guide"},{text:"discussion"},{text:"photos"}]);e.computed(()=>m.value.filter(o=>o.text.toLowerCase().includes(g.value.toLowerCase()))),e.computed(()=>m.value.filter(o=>!c.value.some(a=>a.text===o.text)));const d=e.ref(!1);function h(){d.value=!0}function v(){d.value=!1}function b(){c.value.length>0&&c.value.map(o=>o.text),t.value.status="draft",s.params.url?n.update(t.value).then(o=>{u.push({name:"BlogPost",params:{url:o.url}})}).catch(o=>{console.log(o)}):n.create(t.value).then(o=>{u.push({name:"BlogPost",params:{url:o.url}})}).catch(o=>{console.log(o)})}function k(){r.value&&(t.value.owner={target:r.value._id,type:"organization"}),r.value||(t.value.creator.hidden=!1),r.value||(t.value.organization=t.value.creator),t.value.status="published",console.log(t.value),s.params.url?n.update(t.value).then(o=>{console.log(t.value),u.push({name:"BlogPost",params:{url:o.url}})}).catch(o=>{console.error(o)}):n.create(t.value).then(o=>{u.push({name:"BlogPost",params:{url:o.url}})}).catch(o=>{console.error(o)})}function _(){confirm("Are you sure you want to delete this post?")&&n.remove(t.value._id).then(o=>{u.push({name:"User Blogposts",params:{_id:t.value.creator.target._id}})}).catch(o=>{console.log(o)})}return(o,a)=>(e.openBlock(),e.createElementBlock("article",E,[e.createElementVNode("section",T,[e.createElementVNode("div",z,[e.unref(t)?(e.openBlock(),e.createBlock(w.default,{key:0,prop:e.unref(t),setFocus:!0,content:"name",placeholder:"Enter post title",class:"h2"},null,8,["prop"])):e.createCommentVNode("",!0)]),e.unref(t)?(e.openBlock(),e.createBlock(V.default,{key:0,content:e.unref(t).content,onUpdate:a[0]||(a[0]=l=>e.unref(t).content=l)},null,8,["content"])):e.createCommentVNode("",!0)]),e.createVNode(e.Transition,{name:"scaleIn"},{default:e.withCtx(()=>[e.unref(t)?(e.openBlock(),e.createElementBlock("section",A,[e.createElementVNode("div",O,[e.unref(s).params.url?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:a[1]||(a[1]=l=>_()),class:"mn-r-auto bg-red t-white t-black button"},"Delete")):e.createCommentVNode("",!0),e.createElementVNode("a",{onClick:a[2]||(a[2]=l=>b()),class:"mn-l-auto bg-white t-black button"},"To Drafts"),e.createElementVNode("a",{onClick:a[3]||(a[3]=l=>h()),class:"mn-l-thin bg-black t-white button"},"Publish")])])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(y.default,{title:"Добавить участника",onClosePopup:v,isPopupOpen:d.value,class:"w-m-33r t-left pd-big bg-white radius-big"},{default:e.withCtx(()=>[U,e.createVNode(B.default,{onTagsChanged:a[4]||(a[4]=l=>e.unref(t).tags=l),tags:e.unref(t).tags},null,8,["tags"]),D,e.createVNode(C.default,{field:e.unref(t).source,"onUpdate:field":a[5]||(a[5]=l=>e.unref(t).source=l),placeholder:"Add full link to the source",class:"mn-b-medium bg-grey radius-medium pd-small"},null,8,["field"]),M,e.createVNode(P.default,{modelValue:r.value,"onUpdate:modelValue":a[6]||(a[6]=l=>r.value=l),options:e.unref(p),multiple:!1,taggable:!1,placeholder:"Type to search or add tag",label:"name","track-by":"_id",class:"mn-b-medium bg-grey radius-medium pd-small"},null,8,["modelValue","options"]),r.value?(e.openBlock(),e.createElementBlock("h5",S,"Options:")):e.createCommentVNode("",!0),r.value?(e.openBlock(),e.createElementBlock("div",F,[e.createVNode(N.default,{label:"Hide Author",radio:e.unref(t).creator.hidden,"onUpdate:radio":a[7]||(a[7]=l=>e.unref(t).creator.hidden=l),name:"prices",class:"w-100"},null,8,["radio"])])):e.createCommentVNode("",!0),e.createVNode(x.default,{submit:k,callback:o.redirectTo,class:"w-100 bg-black t-white"},{default:e.withCtx(()=>[e.createTextVNode("Publish")]),_:1},8,["callback"])]),_:1},8,["isPopupOpen"])]))}};exports.default=R;
|
package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { ref as n, onMounted as A, computed as w, openBlock as i, createElementBlock as m, createElementVNode as r, unref as a, createBlock as k, createCommentVNode as c, createVNode as u, Transition as U, withCtx as v, createTextVNode as z } from "vue";
|
2
|
-
import D from "../../../constructor/components/elements/Textarea.
|
2
|
+
import D from "../../../constructor/components/elements/Textarea.vue2.js";
|
3
3
|
import N from "../../../constructor/components/sections/Constructor.vue.js";
|
4
4
|
import O from "../../../../components/Popup/Popup.vue.js";
|
5
5
|
import "../../../../components/FieldTags/tag-input.vue.js";
|
package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs
CHANGED
@@ -1,5 +1 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
`)&&(console.log("We are adding new block:"+t.index+newBlocks+n),c("addBlock","Textarea","",t.index,{blocks:newBlocks,ref:n})),r()}function p(a){(a.keyCode===8||a.keyCode===46)&&t.prop[t.content].trim()===""&&c("deleteBlock",t.prop)}function u(){e.nextTick(()=>{n.value.focus(),c("updateBlock",t.prop,{setFocus:!1})})}function r(){n.value.style.height="1rem",n.value.style.height=n.value.scrollHeight+"px"}return e.onUpdated(()=>{t.setFocus&&e.nextTick(()=>{u()}),r()}),e.onMounted(()=>{t.setFocus&&e.nextTick(()=>{u()}),r()}),(a,l)=>(e.openBlock(),e.createElementBlock("div",null,[e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":l[0]||(l[0]=i=>o.prop[o.content]=i),placeholder:o.placeholder?o.placeholder:"",onInput:d,onFocus:l[1]||(l[1]=i=>c("focus",n.value)),onKeyup:p,ref_key:"textarea",ref:n,tabindex:"-1",class:e.normalizeClass(["text-area mn-b-thin",{"t-main t-semi":o.prop.type==="Link"}])},`
|
4
|
-
|
5
|
-
`,42,k),[[e.vModelText,o.prop[o.content]]])]))}};exports.default=x;
|
1
|
+
"use strict";
|
package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js
CHANGED
@@ -1,67 +1 @@
|
|
1
|
-
import { ref as s, onUpdated as m, nextTick as i, onMounted as x, openBlock as h, createElementBlock as B, withDirectives as g, createElementVNode as v, normalizeClass as y, vModelText as T } from "vue";
|
2
|
-
import "./Textarea.vue2.js";
|
3
|
-
const b = ["placeholder"], C = {
|
4
|
-
__name: "Textarea",
|
5
|
-
props: ["prop", "value", "content", "placeholder", "index", "setFocus"],
|
6
|
-
emits: ["deleteBlock", "updateBlock", "addBlock", "focus"],
|
7
|
-
setup(o, { emit: u }) {
|
8
|
-
const e = o, a = u;
|
9
|
-
s(e);
|
10
|
-
const t = s(null);
|
11
|
-
s(0);
|
12
|
-
function p(l) {
|
13
|
-
let n = l.target.value.split(/\n+/);
|
14
|
-
if (n.length > 1) {
|
15
|
-
e.prop[e.content] = n[0], i(() => {
|
16
|
-
c();
|
17
|
-
});
|
18
|
-
let r = n.slice(1).map((k) => ({ __name: "Textarea", content: k }));
|
19
|
-
a("addBlock", "Textarea", "", e.index, { blocks: r, ref: t });
|
20
|
-
} else
|
21
|
-
l.target.value.trim() === "" && l.target.value.includes(`
|
22
1
|
|
23
|
-
`) && (console.log("We are adding new block:" + e.index + newBlocks + t), a("addBlock", "Textarea", "", e.index, { blocks: newBlocks, ref: t })), c();
|
24
|
-
}
|
25
|
-
function f(l) {
|
26
|
-
(l.keyCode === 8 || l.keyCode === 46) && e.prop[e.content].trim() === "" && a("deleteBlock", e.prop);
|
27
|
-
}
|
28
|
-
function d() {
|
29
|
-
i(() => {
|
30
|
-
t.value.focus(), a("updateBlock", e.prop, { setFocus: !1 });
|
31
|
-
});
|
32
|
-
}
|
33
|
-
function c() {
|
34
|
-
t.value.style.height = "1rem", t.value.style.height = t.value.scrollHeight + "px";
|
35
|
-
}
|
36
|
-
return m(() => {
|
37
|
-
e.setFocus && i(() => {
|
38
|
-
d();
|
39
|
-
}), c();
|
40
|
-
}), x(() => {
|
41
|
-
e.setFocus && i(() => {
|
42
|
-
d();
|
43
|
-
}), c();
|
44
|
-
}), (l, n) => (h(), B("div", null, [
|
45
|
-
g(v("textarea", {
|
46
|
-
"onUpdate:modelValue": n[0] || (n[0] = (r) => o.prop[o.content] = r),
|
47
|
-
placeholder: o.placeholder ? o.placeholder : "",
|
48
|
-
onInput: p,
|
49
|
-
onFocus: n[1] || (n[1] = (r) => a("focus", t.value)),
|
50
|
-
onKeyup: f,
|
51
|
-
ref_key: "textarea",
|
52
|
-
ref: t,
|
53
|
-
tabindex: "-1",
|
54
|
-
class: y(["text-area mn-b-thin", {
|
55
|
-
"t-main t-semi": o.prop.type === "Link"
|
56
|
-
}])
|
57
|
-
}, `
|
58
|
-
|
59
|
-
`, 42, b), [
|
60
|
-
[T, o.prop[o.content]]
|
61
|
-
])
|
62
|
-
]));
|
63
|
-
}
|
64
|
-
};
|
65
|
-
export {
|
66
|
-
C as default
|
67
|
-
};
|
package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs
CHANGED
@@ -1 +1,5 @@
|
|
1
|
-
"use strict";
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("./Textarea.vue.cjs");const k=["placeholder"],x={__name:"Textarea",props:["prop","value","content","placeholder","index","setFocus"],emits:["deleteBlock","updateBlock","addBlock","focus"],setup(o,{emit:s}){const t=o,c=s;e.ref(t);const n=e.ref(null);e.ref(0);function d(a){let l=a.target.value.split(/\n+/);if(l.length>1){t.prop[t.content]=l[0],e.nextTick(()=>{r()});let i=l.slice(1).map(f=>({__name:"Textarea",content:f}));c("addBlock","Textarea","",t.index,{blocks:i,ref:n})}else a.target.value.trim()===""&&a.target.value.includes(`
|
2
|
+
|
3
|
+
`)&&(console.log("We are adding new block:"+t.index+newBlocks+n),c("addBlock","Textarea","",t.index,{blocks:newBlocks,ref:n})),r()}function p(a){(a.keyCode===8||a.keyCode===46)&&t.prop[t.content].trim()===""&&c("deleteBlock",t.prop)}function u(){e.nextTick(()=>{n.value.focus(),c("updateBlock",t.prop,{setFocus:!1})})}function r(){n.value.style.height="1rem",n.value.style.height=n.value.scrollHeight+"px"}return e.onUpdated(()=>{t.setFocus&&e.nextTick(()=>{u()}),r()}),e.onMounted(()=>{t.setFocus&&e.nextTick(()=>{u()}),r()}),(a,l)=>(e.openBlock(),e.createElementBlock("div",null,[e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":l[0]||(l[0]=i=>o.prop[o.content]=i),placeholder:o.placeholder?o.placeholder:"",onInput:d,onFocus:l[1]||(l[1]=i=>c("focus",n.value)),onKeyup:p,ref_key:"textarea",ref:n,tabindex:"-1",class:e.normalizeClass(["text-area mn-b-thin",{"t-main t-semi":o.prop.type==="Link"}])},`
|
4
|
+
|
5
|
+
`,42,k),[[e.vModelText,o.prop[o.content]]])]))}};exports.default=x;
|