@ozdao/prometheus-framework 0.1.63 → 0.1.66

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. package/dist/prometheus-framework/src/components/Select/Select.vue.cjs +1 -1
  2. package/dist/prometheus-framework/src/components/Select/Select.vue.js +2 -78
  3. package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
  4. package/dist/prometheus-framework/src/components/Select/Select.vue2.js +78 -2
  5. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
  6. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +65 -67
  7. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +1 -1
  8. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +1 -1
  9. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  10. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +1 -1
  11. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +1 -4
  12. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +2 -61
  13. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +4 -1
  14. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +61 -2
  15. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.cjs +1 -1
  16. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.js +1 -1
  17. package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.cjs +1 -1
  18. package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.js +1 -1
  19. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  20. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +1 -1
  21. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  22. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +1 -1
  23. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
  24. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +1 -1
  25. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
  26. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +1 -1
  27. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  28. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +1 -1
  29. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
  30. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +1 -1
  31. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  32. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +1 -1
  33. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  34. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
  35. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  36. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +1 -1
  37. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
  38. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
  39. package/dist/prometheus-framework/src/modules/products/components/pages/LeftoverAdd.vue.cjs +1 -1
  40. package/dist/prometheus-framework/src/modules/products/components/pages/LeftoverAdd.vue.js +1 -1
  41. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  42. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +1 -1
  43. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
  44. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +1 -1
  45. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  46. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +1 -1
  47. package/dist/prometheus-framework.cjs.js +19 -19
  48. package/dist/prometheus-framework.es.js +2198 -2208
  49. package/dist/style.css +1 -1
  50. package/package.json +1 -1
  51. package/src/modules/auth/components/pages/SignIn.vue +2 -2
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("./Select.vue2.cjs");const m=require("../../../../_virtual/_plugin-vue_export-helper.cjs"),p=["onClick"],k={key:0,class:"t-transp mn-r-small"},f={class:"w-100"},v=["onClick"],h={key:0,class:"w-100"},g={key:0,class:"mn-t-thin invalid-feedback"},B={__name:"Select",props:{label:String,select:[String,Object],placeholder:{type:String,default:"Please select an item"},options:{type:Array,default:()=>[]},validation:Boolean},emits:["update:select","focus","blur"],setup(l,{emit:c}){const n=l,o=e.ref(n.select),a=e.ref(!1);e.watch(()=>n.select,t=>{o.value=t});const u=e.computed(()=>n.select?n.options.filter(t=>t!==n.select):n.options),r=()=>{a.value=!a.value,c(a.value?"focus":"blur")},d=t=>{o.value=t,r(),c("update:select",o.value)};return(t,y)=>{var i;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{onClick:e.withModifiers(r,["stop"]),class:e.normalizeClass([t.$attrs.class,"cursor-pointer flex-nowrap flex"])},[l.label?(e.openBlock(),e.createElementBlock("div",k,[e.createElementVNode("span",null,e.toDisplayString(l.label),1)])):e.createCommentVNode("",!0),e.createElementVNode("li",f,[e.createElementVNode("span",null,e.toDisplayString(((i=o.value)==null?void 0:i.name)||o.value||l.placeholder),1)]),e.createVNode(e.Transition,{mode:"out-in",name:"TransitionTranslateY"},{default:e.withCtx(()=>[a.value?(e.openBlock(),e.createElementBlock("ul",{key:0,class:e.normalizeClass([t.$attrs.class,"pos-absolute pos-t-100 pos-l-0 z-index-5 w-100 mn-t-thin"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(u),s=>(e.openBlock(),e.createElementBlock("li",{onClick:e.withModifiers(C=>d(s),["stop"])},[s?(e.openBlock(),e.createElementBlock("span",h,e.toDisplayString(s.name||s),1)):e.createCommentVNode("",!0)],8,v))),256))],2)):e.createCommentVNode("",!0)]),_:1})],10,p),e.createVNode(e.Transition,{mode:"out-in",name:"fade"},{default:e.withCtx(()=>[l.validation?(e.openBlock(),e.createElementBlock("div",g," * "+e.toDisplayString(l.validation.message),1)):e.createCommentVNode("",!0)]),_:1})],64)}}},_=m.default(B,[["__scopeId","data-v-dfe03dc2"]]);exports.default=_;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="";exports.default=e;
@@ -1,80 +1,4 @@
1
- import { ref as f, watch as C, computed as S, openBlock as t, createElementBlock as l, Fragment as v, createElementVNode as i, withModifiers as h, normalizeClass as _, toDisplayString as r, createCommentVNode as u, createVNode as k, Transition as b, withCtx as g, renderList as x, unref as B } from "vue";
2
- import "./Select.vue2.js";
3
- import M from "../../../../_virtual/_plugin-vue_export-helper.js";
4
- const N = ["onClick"], O = {
5
- key: 0,
6
- class: "t-transp mn-r-small"
7
- }, T = { class: "w-100" }, V = ["onClick"], $ = {
8
- key: 0,
9
- class: "w-100"
10
- }, z = {
11
- key: 0,
12
- class: "mn-t-thin invalid-feedback"
13
- }, E = {
14
- __name: "Select",
15
- props: {
16
- label: String,
17
- select: [String, Object],
18
- placeholder: { type: String, default: "Please select an item" },
19
- options: { type: Array, default: () => [] },
20
- validation: Boolean
21
- },
22
- emits: ["update:select", "focus", "blur"],
23
- setup(s, { emit: d }) {
24
- const a = s, n = f(a.select), o = f(!1);
25
- C(() => a.select, (e) => {
26
- n.value = e;
27
- });
28
- const w = S(() => a.select ? a.options.filter((e) => e !== a.select) : a.options), m = () => {
29
- o.value = !o.value, d(o.value ? "focus" : "blur");
30
- }, y = (e) => {
31
- n.value = e, m(), d("update:select", n.value);
32
- };
33
- return (e, L) => {
34
- var p;
35
- return t(), l(v, null, [
36
- i("div", {
37
- onClick: h(m, ["stop"]),
38
- class: _([e.$attrs.class, "cursor-pointer flex-nowrap flex"])
39
- }, [
40
- s.label ? (t(), l("div", O, [
41
- i("span", null, r(s.label), 1)
42
- ])) : u("", !0),
43
- i("li", T, [
44
- i("span", null, r(((p = n.value) == null ? void 0 : p.name) || n.value || s.placeholder), 1)
45
- ]),
46
- k(b, {
47
- mode: "out-in",
48
- name: "TransitionTranslateY"
49
- }, {
50
- default: g(() => [
51
- o.value ? (t(), l("ul", {
52
- key: 0,
53
- class: _([e.$attrs.class, "pos-absolute pos-t-100 pos-l-0 z-index-5 w-100 mn-t-thin"])
54
- }, [
55
- (t(!0), l(v, null, x(B(w), (c) => (t(), l("li", {
56
- onClick: h((j) => y(c), ["stop"])
57
- }, [
58
- c ? (t(), l("span", $, r(c.name || c), 1)) : u("", !0)
59
- ], 8, V))), 256))
60
- ], 2)) : u("", !0)
61
- ]),
62
- _: 1
63
- })
64
- ], 10, N),
65
- k(b, {
66
- mode: "out-in",
67
- name: "fade"
68
- }, {
69
- default: g(() => [
70
- s.validation ? (t(), l("div", z, " * " + r(s.validation.message), 1)) : u("", !0)
71
- ]),
72
- _: 1
73
- })
74
- ], 64);
75
- };
76
- }
77
- }, I = /* @__PURE__ */ M(E, [["__scopeId", "data-v-dfe03dc2"]]);
1
+ const e = "";
78
2
  export {
79
- I as default
3
+ e as default
80
4
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="";exports.default=e;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("./Select.vue.cjs");const m=require("../../../../_virtual/_plugin-vue_export-helper.cjs"),p=["onClick"],k={key:0,class:"t-transp mn-r-small"},f={class:"w-100"},v=["onClick"],h={key:0,class:"w-100"},g={key:0,class:"mn-t-thin invalid-feedback"},B={__name:"Select",props:{label:String,select:[String,Object],placeholder:{type:String,default:"Please select an item"},options:{type:Array,default:()=>[]},validation:Boolean},emits:["update:select","focus","blur"],setup(l,{emit:c}){const n=l,o=e.ref(n.select),a=e.ref(!1);e.watch(()=>n.select,t=>{o.value=t});const u=e.computed(()=>n.select?n.options.filter(t=>t!==n.select):n.options),r=()=>{a.value=!a.value,c(a.value?"focus":"blur")},d=t=>{o.value=t,r(),c("update:select",o.value)};return(t,y)=>{var i;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{onClick:e.withModifiers(r,["stop"]),class:e.normalizeClass([t.$attrs.class,"cursor-pointer flex-nowrap flex"])},[l.label?(e.openBlock(),e.createElementBlock("div",k,[e.createElementVNode("span",null,e.toDisplayString(l.label),1)])):e.createCommentVNode("",!0),e.createElementVNode("li",f,[e.createElementVNode("span",null,e.toDisplayString(((i=o.value)==null?void 0:i.name)||o.value||l.placeholder),1)]),e.createVNode(e.Transition,{mode:"out-in",name:"TransitionTranslateY"},{default:e.withCtx(()=>[a.value?(e.openBlock(),e.createElementBlock("ul",{key:0,class:e.normalizeClass([t.$attrs.class,"pos-absolute pos-t-100 pos-l-0 z-index-5 w-100 mn-t-thin"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(u),s=>(e.openBlock(),e.createElementBlock("li",{onClick:e.withModifiers(C=>d(s),["stop"])},[s?(e.openBlock(),e.createElementBlock("span",h,e.toDisplayString(s.name||s),1)):e.createCommentVNode("",!0)],8,v))),256))],2)):e.createCommentVNode("",!0)]),_:1})],10,p),e.createVNode(e.Transition,{mode:"out-in",name:"fade"},{default:e.withCtx(()=>[l.validation?(e.openBlock(),e.createElementBlock("div",g," * "+e.toDisplayString(l.validation.message),1)):e.createCommentVNode("",!0)]),_:1})],64)}}},_=m.default(B,[["__scopeId","data-v-dfe03dc2"]]);exports.default=_;
@@ -1,4 +1,80 @@
1
- const e = "";
1
+ import { ref as f, watch as C, computed as S, openBlock as t, createElementBlock as l, Fragment as v, createElementVNode as i, withModifiers as h, normalizeClass as _, toDisplayString as r, createCommentVNode as u, createVNode as k, Transition as b, withCtx as g, renderList as x, unref as B } from "vue";
2
+ import "./Select.vue.js";
3
+ import M from "../../../../_virtual/_plugin-vue_export-helper.js";
4
+ const N = ["onClick"], O = {
5
+ key: 0,
6
+ class: "t-transp mn-r-small"
7
+ }, T = { class: "w-100" }, V = ["onClick"], $ = {
8
+ key: 0,
9
+ class: "w-100"
10
+ }, z = {
11
+ key: 0,
12
+ class: "mn-t-thin invalid-feedback"
13
+ }, E = {
14
+ __name: "Select",
15
+ props: {
16
+ label: String,
17
+ select: [String, Object],
18
+ placeholder: { type: String, default: "Please select an item" },
19
+ options: { type: Array, default: () => [] },
20
+ validation: Boolean
21
+ },
22
+ emits: ["update:select", "focus", "blur"],
23
+ setup(s, { emit: d }) {
24
+ const a = s, n = f(a.select), o = f(!1);
25
+ C(() => a.select, (e) => {
26
+ n.value = e;
27
+ });
28
+ const w = S(() => a.select ? a.options.filter((e) => e !== a.select) : a.options), m = () => {
29
+ o.value = !o.value, d(o.value ? "focus" : "blur");
30
+ }, y = (e) => {
31
+ n.value = e, m(), d("update:select", n.value);
32
+ };
33
+ return (e, L) => {
34
+ var p;
35
+ return t(), l(v, null, [
36
+ i("div", {
37
+ onClick: h(m, ["stop"]),
38
+ class: _([e.$attrs.class, "cursor-pointer flex-nowrap flex"])
39
+ }, [
40
+ s.label ? (t(), l("div", O, [
41
+ i("span", null, r(s.label), 1)
42
+ ])) : u("", !0),
43
+ i("li", T, [
44
+ i("span", null, r(((p = n.value) == null ? void 0 : p.name) || n.value || s.placeholder), 1)
45
+ ]),
46
+ k(b, {
47
+ mode: "out-in",
48
+ name: "TransitionTranslateY"
49
+ }, {
50
+ default: g(() => [
51
+ o.value ? (t(), l("ul", {
52
+ key: 0,
53
+ class: _([e.$attrs.class, "pos-absolute pos-t-100 pos-l-0 z-index-5 w-100 mn-t-thin"])
54
+ }, [
55
+ (t(!0), l(v, null, x(B(w), (c) => (t(), l("li", {
56
+ onClick: h((j) => y(c), ["stop"])
57
+ }, [
58
+ c ? (t(), l("span", $, r(c.name || c), 1)) : u("", !0)
59
+ ], 8, V))), 256))
60
+ ], 2)) : u("", !0)
61
+ ]),
62
+ _: 1
63
+ })
64
+ ], 10, N),
65
+ k(b, {
66
+ mode: "out-in",
67
+ name: "fade"
68
+ }, {
69
+ default: g(() => [
70
+ s.validation ? (t(), l("div", z, " * " + r(s.validation.message), 1)) : u("", !0)
71
+ ]),
72
+ _: 1
73
+ })
74
+ ], 64);
75
+ };
76
+ }
77
+ }, I = /* @__PURE__ */ M(E, [["__scopeId", "data-v-dfe03dc2"]]);
2
78
  export {
3
- e as default
79
+ I as default
4
80
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),g=require("../../../../components/Tab/Tab.vue2.cjs"),c=require("../../../../components/Field/Field.vue2.cjs"),N=require("../../../../components/FieldPhone/FieldPhone.vue.cjs"),b=require("../../../../components/Button/Button.vue2.cjs"),p=require("vue-router"),E=require("vue-i18n"),a=require("../../store/auth.cjs"),i=require("../../../middlewares/client/inputs.validation.cjs");require("./SignIn.vue2.cjs");const m=require("./SignIn.vue3.cjs"),y={class:""},S={class:"mn-medium"},q=e.createElementVNode("br",null,null,-1),x={class:"t-semi"},P={class:"mn-big"},C={class:"mn-small p-small uppercase t-semi bg-grey radius-big o-hidden"},D={class:""},I={class:"mn-thin radius-small"},T={class:"mn-thin radius-small o-hidden"},U={class:"w-100 mn-big"},h={__name:"SignIn",setup(j){const{t:n}=E.useI18n({inheritLocale:!0,useScope:"local"}),d=e.ref(null),f=e.ref(null),u=e.ref(null);p.useRoute();const _=p.useRouter(),l=e.ref("phone");e.inject("APPLE_CLIENTID"),e.inject("APPLE_REDIRECT_URL");const v=r=>new Promise((s,o)=>{const t=document.createElement("script");t.type="text/javascript",t.src=r,t.onload=s,t.onerror=o,document.head.appendChild(t)});e.onMounted(async()=>{await v("https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js")});async function w(){try{l.value==="phone"&&await i.validateInputs(d,i.validatePhone,a.state.user.phone,"Некорректный телефон"),l.value==="email"&&await i.validateInputs(u,i.validateEmail,a.state.user.email,"Некорректный email")}catch{throw new Error}a.state.user.phone=a.state.user.phone.number,await a.actions.login(a.state.user,l.value)}function V(){_.push({name:"User Profile",params:{_id:a.state.user._id},query:{afterAuth:"true"}})}return(r,s)=>{const o=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("section",y,[e.createElementVNode("h3",S,[e.createTextVNode(e.toDisplayString(e.unref(n)("title"))+" ",1),q,e.createElementVNode("span",x,e.toDisplayString(e.unref(n)("subtitle")),1)]),e.createElementVNode("p",P,[e.createVNode(o,{to:{name:"Sign Up"},class:"underline t-second"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("signup")),1)]),_:1})]),e.createElementVNode("div",C,[e.createVNode(g.default,{selected:l.value,"onUpdate:selected":s[0]||(s[0]=t=>l.value=t),tabs:[{name:e.unref(n)("phone"),value:"phone"},{name:e.unref(n)("email"),value:"email"}]},null,8,["selected","tabs"])]),e.createElementVNode("div",D,[e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",I,[e.createVNode(N.default,{modelValue:a.state.user.phone,"onUpdate:modelValue":s[1]||(s[1]=t=>a.state.user.phone=t),dropdownOptions:{showDialCodeInSelection:!0,showFlags:!0,showDialCodeInList:!0},validation:d.value,mode:"national",inputOptions:{placeholder:e.unref(n)("phonePlaceholder")},class:"bg-grey pd-small radius-small mn-thin"},null,8,["modelValue","validation","inputOptions"])],512),[[e.vShow,l.value==="phone"]])]),_:1}),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",T,[e.createVNode(c.default,{field:a.state.user.email,"onUpdate:field":s[2]||(s[2]=t=>a.state.user.email=t),placeholder:e.unref(n)("emailPlaceholder"),validation:u.value,class:"bg-grey pd-medium radius-small"},null,8,["field","placeholder","validation"])],512),[[e.vShow,l.value==="email"]])]),_:1})]),e.createVNode(c.default,{field:a.state.user.password,"onUpdate:field":s[3]||(s[3]=t=>a.state.user.password=t),type:"password",validation:f.value,placeholder:e.unref(n)("passwordPlaceholder"),class:"bg-grey pd-medium radius-small mn-semi"},null,8,["field","validation","placeholder"]),e.createElementVNode("div",U,[e.createVNode(o,{to:"/auth/reset-password",class:"underline d-block t-blue"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("forgotPassword")),1)]),_:1})]),e.createVNode(b.default,{submit:w,callback:V,class:"mn-thin"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("signin")),1)]),_:1})])}}};typeof m.default=="function"&&m.default(h);exports.default=h;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),w=require("../../../../components/Tab/Tab.vue2.cjs"),c=require("../../../../components/Field/Field.vue2.cjs"),V=require("../../../../components/FieldPhone/FieldPhone.vue.cjs"),g=require("../../../../components/Button/Button.vue2.cjs"),p=require("vue-router"),N=require("vue-i18n"),a=require("../../store/auth.cjs"),i=require("../../../middlewares/client/inputs.validation.cjs");require("./SignIn.vue2.cjs");const b={class:""},E={class:"mn-medium"},y=e.createElementVNode("br",null,null,-1),S={class:"t-semi"},P={class:"mn-big"},q={class:"mn-small p-small uppercase t-semi bg-grey radius-big o-hidden"},x={class:""},C={class:"mn-thin radius-small"},D={class:"mn-thin radius-small o-hidden"},T={class:"w-100 mn-big"},I={__name:"SignIn",setup(U){const{t:s}=N.useI18n({inheritLocale:!0,useScope:"local"}),d=e.ref(null),m=e.ref(null),u=e.ref(null);p.useRoute();const h=p.useRouter(),l=e.ref("phone");e.inject("APPLE_CLIENTID"),e.inject("APPLE_REDIRECT_URL");const f=r=>new Promise((n,o)=>{const t=document.createElement("script");t.type="text/javascript",t.src=r,t.onload=n,t.onerror=o,document.head.appendChild(t)});e.onMounted(async()=>{await f("https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js")});async function v(){try{l.value==="phone"&&await i.validateInputs(d,i.validatePhone,a.state.user.phone,"Некорректный телефон"),l.value==="email"&&await i.validateInputs(u,i.validateEmail,a.state.user.email,"Некорректный email")}catch{throw new Error}a.state.user.phone=a.state.user.phone.number,await a.actions.login(a.state.user,l.value)}function _(){h.push({name:"User Profile",params:{_id:a.state.user._id},query:{afterAuth:"true"}})}return(r,n)=>{const o=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("section",b,[e.createElementVNode("h3",E,[e.createTextVNode(e.toDisplayString(e.unref(s)("title"))+" ",1),y,e.createElementVNode("span",S,e.toDisplayString(e.unref(s)("subtitle")),1)]),e.createElementVNode("p",P,[e.createVNode(o,{to:{name:"Sign Up"},class:"underline t-second"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("signup")),1)]),_:1})]),e.createElementVNode("div",q,[e.createVNode(w.default,{selected:l.value,"onUpdate:selected":n[0]||(n[0]=t=>l.value=t),tabs:[{name:e.unref(s)("phone"),value:"phone"},{name:e.unref(s)("email"),value:"email"}]},null,8,["selected","tabs"])]),e.createElementVNode("div",x,[e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",C,[e.createVNode(V.default,{modelValue:a.state.user.phone,"onUpdate:modelValue":n[1]||(n[1]=t=>a.state.user.phone=t),dropdownOptions:{showDialCodeInSelection:!0,showFlags:!0,showDialCodeInList:!0},validation:d.value,mode:"national",inputOptions:{placeholder:e.unref(s)("phonePlaceholder")},class:"bg-grey pd-small radius-small mn-thin"},null,8,["modelValue","validation","inputOptions"])],512),[[e.vShow,l.value==="phone"]])]),_:1}),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",D,[e.createVNode(c.default,{field:a.state.user.email,"onUpdate:field":n[2]||(n[2]=t=>a.state.user.email=t),placeholder:e.unref(s)("emailPlaceholder"),validation:u.value,class:"bg-grey pd-medium radius-small"},null,8,["field","placeholder","validation"])],512),[[e.vShow,l.value==="email"]])]),_:1})]),e.createVNode(c.default,{field:a.state.user.password,"onUpdate:field":n[3]||(n[3]=t=>a.state.user.password=t),type:"password",validation:m.value,placeholder:e.unref(s)("passwordPlaceholder"),class:"bg-grey pd-medium radius-small mn-semi"},null,8,["field","validation","placeholder"]),e.createElementVNode("div",T,[e.createVNode(o,{to:"/auth/reset-password",class:"underline d-block t-blue"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("forgotPassword")),1)]),_:1})]),e.createVNode(g.default,{submit:v,callback:_,class:"mn-thin"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("signin")),1)]),_:1})])}}};exports.default=I;
@@ -1,51 +1,50 @@
1
- import { ref as p, inject as _, onMounted as k, resolveComponent as C, openBlock as x, createElementBlock as D, createElementVNode as i, createTextVNode as m, toDisplayString as r, unref as l, createVNode as s, withCtx as d, Transition as v, withDirectives as w, vShow as b } from "vue";
2
- import L from "../../../../components/Tab/Tab.vue2.js";
3
- import g from "../../../../components/Field/Field.vue2.js";
4
- import R from "../../../../components/FieldPhone/FieldPhone.vue.js";
5
- import T from "../../../../components/Button/Button.vue2.js";
6
- import { useRoute as j, useRouter as A } from "vue-router";
7
- import { useI18n as N } from "vue-i18n";
8
- import { state as t, actions as F } from "../../store/auth.js";
9
- import { validateInputs as y, validatePhone as O, validateEmail as B } from "../../../middlewares/client/inputs.validation.js";
1
+ import { ref as p, inject as f, onMounted as U, resolveComponent as C, openBlock as k, createElementBlock as x, createElementVNode as i, createTextVNode as m, toDisplayString as r, unref as o, createVNode as s, withCtx as d, Transition as v, withDirectives as w, vShow as g } from "vue";
2
+ import D from "../../../../components/Tab/Tab.vue2.js";
3
+ import b from "../../../../components/Field/Field.vue2.js";
4
+ import L from "../../../../components/FieldPhone/FieldPhone.vue.js";
5
+ import R from "../../../../components/Button/Button.vue2.js";
6
+ import { useRoute as T, useRouter as j } from "vue-router";
7
+ import { useI18n as A } from "vue-i18n";
8
+ import { state as t, actions as N } from "../../store/auth.js";
9
+ import { validateInputs as P, validatePhone as F, validateEmail as O } from "../../../middlewares/client/inputs.validation.js";
10
10
  import "./SignIn.vue2.js";
11
- import P from "./SignIn.vue3.js";
12
- const $ = { class: "" }, q = { class: "mn-medium" }, M = /* @__PURE__ */ i("br", null, null, -1), z = { class: "t-semi" }, G = { class: "mn-big" }, H = { class: "mn-small p-small uppercase t-semi bg-grey radius-big o-hidden" }, J = { class: "" }, K = { class: "mn-thin radius-small" }, Q = { class: "mn-thin radius-small o-hidden" }, W = { class: "w-100 mn-big" }, X = {
11
+ const B = { class: "" }, $ = { class: "mn-medium" }, q = /* @__PURE__ */ i("br", null, null, -1), M = { class: "t-semi" }, z = { class: "mn-big" }, G = { class: "mn-small p-small uppercase t-semi bg-grey radius-big o-hidden" }, H = { class: "" }, J = { class: "mn-thin radius-small" }, K = { class: "mn-thin radius-small o-hidden" }, Q = { class: "w-100 mn-big" }, ne = {
13
12
  __name: "SignIn",
14
- setup(Y) {
15
- const { t: o } = N({
13
+ setup(W) {
14
+ const { t: a } = A({
16
15
  inheritLocale: !0,
17
16
  useScope: "local"
18
- }), h = p(null), E = p(null), f = p(null);
19
- j();
20
- const S = A(), n = p("phone");
21
- _("APPLE_CLIENTID"), _("APPLE_REDIRECT_URL");
22
- const V = (c) => new Promise((a, u) => {
17
+ }), h = p(null), y = p(null), _ = p(null);
18
+ T();
19
+ const E = j(), n = p("phone");
20
+ f("APPLE_CLIENTID"), f("APPLE_REDIRECT_URL");
21
+ const S = (c) => new Promise((l, u) => {
23
22
  const e = document.createElement("script");
24
- e.type = "text/javascript", e.src = c, e.onload = a, e.onerror = u, document.head.appendChild(e);
23
+ e.type = "text/javascript", e.src = c, e.onload = l, e.onerror = u, document.head.appendChild(e);
25
24
  });
26
- k(async () => {
27
- await V("https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js");
25
+ U(async () => {
26
+ await S("https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js");
28
27
  });
29
- async function I() {
28
+ async function V() {
30
29
  try {
31
- n.value === "phone" && await y(
30
+ n.value === "phone" && await P(
32
31
  h,
33
- O,
32
+ F,
34
33
  t.user.phone,
35
34
  "Некорректный телефон"
36
- ), n.value === "email" && await y(
37
- f,
38
- B,
35
+ ), n.value === "email" && await P(
36
+ _,
37
+ O,
39
38
  t.user.email,
40
39
  "Некорректный email"
41
40
  );
42
41
  } catch {
43
42
  throw new Error();
44
43
  }
45
- t.user.phone = t.user.phone.number, await F.login(t.user, n.value);
44
+ t.user.phone = t.user.phone.number, await N.login(t.user, n.value);
46
45
  }
47
- function U() {
48
- S.push({
46
+ function I() {
47
+ E.push({
49
48
  name: "User Profile",
50
49
  params: {
51
50
  _id: t.user._id
@@ -53,42 +52,42 @@ const $ = { class: "" }, q = { class: "mn-medium" }, M = /* @__PURE__ */ i("br",
53
52
  query: { afterAuth: "true" }
54
53
  });
55
54
  }
56
- return (c, a) => {
55
+ return (c, l) => {
57
56
  const u = C("router-link");
58
- return x(), D("section", $, [
59
- i("h3", q, [
60
- m(r(l(o)("title")) + " ", 1),
61
- M,
62
- i("span", z, r(l(o)("subtitle")), 1)
57
+ return k(), x("section", B, [
58
+ i("h3", $, [
59
+ m(r(o(a)("title")) + " ", 1),
60
+ q,
61
+ i("span", M, r(o(a)("subtitle")), 1)
63
62
  ]),
64
- i("p", G, [
63
+ i("p", z, [
65
64
  s(u, {
66
65
  to: { name: "Sign Up" },
67
66
  class: "underline t-second"
68
67
  }, {
69
68
  default: d(() => [
70
- m(r(l(o)("signup")), 1)
69
+ m(r(o(a)("signup")), 1)
71
70
  ]),
72
71
  _: 1
73
72
  })
74
73
  ]),
75
- i("div", H, [
76
- s(L, {
74
+ i("div", G, [
75
+ s(D, {
77
76
  selected: n.value,
78
- "onUpdate:selected": a[0] || (a[0] = (e) => n.value = e),
77
+ "onUpdate:selected": l[0] || (l[0] = (e) => n.value = e),
79
78
  tabs: [
80
- { name: l(o)("phone"), value: "phone" },
81
- { name: l(o)("email"), value: "email" }
79
+ { name: o(a)("phone"), value: "phone" },
80
+ { name: o(a)("email"), value: "email" }
82
81
  ]
83
82
  }, null, 8, ["selected", "tabs"])
84
83
  ]),
85
- i("div", J, [
84
+ i("div", H, [
86
85
  s(v, { name: "slide-fade" }, {
87
86
  default: d(() => [
88
- w(i("div", K, [
89
- s(R, {
87
+ w(i("div", J, [
88
+ s(L, {
90
89
  modelValue: t.user.phone,
91
- "onUpdate:modelValue": a[1] || (a[1] = (e) => t.user.phone = e),
90
+ "onUpdate:modelValue": l[1] || (l[1] = (e) => t.user.phone = e),
92
91
  dropdownOptions: {
93
92
  showDialCodeInSelection: !0,
94
93
  showFlags: !0,
@@ -96,58 +95,58 @@ const $ = { class: "" }, q = { class: "mn-medium" }, M = /* @__PURE__ */ i("br",
96
95
  },
97
96
  validation: h.value,
98
97
  mode: "national",
99
- inputOptions: { placeholder: l(o)("phonePlaceholder") },
98
+ inputOptions: { placeholder: o(a)("phonePlaceholder") },
100
99
  class: "bg-grey pd-small radius-small mn-thin"
101
100
  }, null, 8, ["modelValue", "validation", "inputOptions"])
102
101
  ], 512), [
103
- [b, n.value === "phone"]
102
+ [g, n.value === "phone"]
104
103
  ])
105
104
  ]),
106
105
  _: 1
107
106
  }),
108
107
  s(v, { name: "slide-fade" }, {
109
108
  default: d(() => [
110
- w(i("div", Q, [
111
- s(g, {
109
+ w(i("div", K, [
110
+ s(b, {
112
111
  field: t.user.email,
113
- "onUpdate:field": a[2] || (a[2] = (e) => t.user.email = e),
114
- placeholder: l(o)("emailPlaceholder"),
115
- validation: f.value,
112
+ "onUpdate:field": l[2] || (l[2] = (e) => t.user.email = e),
113
+ placeholder: o(a)("emailPlaceholder"),
114
+ validation: _.value,
116
115
  class: "bg-grey pd-medium radius-small"
117
116
  }, null, 8, ["field", "placeholder", "validation"])
118
117
  ], 512), [
119
- [b, n.value === "email"]
118
+ [g, n.value === "email"]
120
119
  ])
121
120
  ]),
122
121
  _: 1
123
122
  })
124
123
  ]),
125
- s(g, {
124
+ s(b, {
126
125
  field: t.user.password,
127
- "onUpdate:field": a[3] || (a[3] = (e) => t.user.password = e),
126
+ "onUpdate:field": l[3] || (l[3] = (e) => t.user.password = e),
128
127
  type: "password",
129
- validation: E.value,
130
- placeholder: l(o)("passwordPlaceholder"),
128
+ validation: y.value,
129
+ placeholder: o(a)("passwordPlaceholder"),
131
130
  class: "bg-grey pd-medium radius-small mn-semi"
132
131
  }, null, 8, ["field", "validation", "placeholder"]),
133
- i("div", W, [
132
+ i("div", Q, [
134
133
  s(u, {
135
134
  to: "/auth/reset-password",
136
135
  class: "underline d-block t-blue"
137
136
  }, {
138
137
  default: d(() => [
139
- m(r(l(o)("forgotPassword")), 1)
138
+ m(r(o(a)("forgotPassword")), 1)
140
139
  ]),
141
140
  _: 1
142
141
  })
143
142
  ]),
144
- s(T, {
145
- submit: I,
146
- callback: U,
143
+ s(R, {
144
+ submit: V,
145
+ callback: I,
147
146
  class: "mn-thin"
148
147
  }, {
149
148
  default: d(() => [
150
- m(r(l(o)("signin")), 1)
149
+ m(r(o(a)("signin")), 1)
151
150
  ]),
152
151
  _: 1
153
152
  })
@@ -155,7 +154,6 @@ const $ = { class: "" }, q = { class: "mn-medium" }, M = /* @__PURE__ */ i("br",
155
154
  };
156
155
  }
157
156
  };
158
- typeof P == "function" && P(X);
159
157
  export {
160
- X as default
158
+ ne as default
161
159
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),n=require("vue-router"),u=require("../../../../components/Select/Select.vue.cjs"),a=require("../../store/blogposts.cjs"),c=require("../../../auth/store/auth.cjs"),m={class:"min-h-100vh pd-thin"},d={class:"mn-thin flex-v-center t-left flex-nowrap flex"},p={class:"flex-v-center flex-nowrap flex t-left"},f=e.createElementVNode("span",{class:""},"Topics for ",-1),g={class:"w-100 bg-grey pd-small radius-big mn-semi gap-thin flex-nowrap flex"},h={class:""},w={__name:"Community",setup(k){const l=n.useRoute(),r=n.useRouter();return(y,t)=>{const s=e.resolveComponent("router-view");return e.openBlock(),e.createElementBlock("div",m,[e.createElementVNode("header",d,[e.createElementVNode("h2",p,[f,e.createVNode(u.default,{options:["today","week","month","year"],select:a.state.filter.period,"onUpdate:select":t[0]||(t[0]=o=>a.state.filter.period=o),placeholder:"Select type",class:"w-max mn-l-small bg-grey pd-thin radius-medium h2 t-center t-black"},null,8,["select"])])]),e.createElementVNode("ul",g,[e.createElementVNode("li",{class:e.normalizeClass([{"t-white bg-black":e.unref(l).params.category==="featured"},"t-medium pd-thin radius-small"]),onClick:t[1]||(t[1]=o=>e.unref(r).push({name:"Blog"}))},"👑 Featured",2),e.createElementVNode("li",{class:e.normalizeClass([{"t-white bg-black":e.unref(l).params.category==="popular"},"t-medium pd-thin radius-small"]),onClick:t[2]||(t[2]=o=>e.unref(r).push({name:"Blog",params:{category:"popular"}}))},"🔥 Popular",2),e.createElementVNode("li",{class:e.normalizeClass([{"t-white bg-black":e.unref(l).params.category==="new"},"t-medium pd-thin radius-small"]),onClick:t[3]||(t[3]=o=>e.unref(r).push({name:"Blog",params:{category:"new"}}))},"🆕 New",2),c.state.user._id?(e.openBlock(),e.createElementBlock("li",{key:0,class:e.normalizeClass([{"t-white bg-black":e.unref(l).params.category==="following"},"t-medium pd-thin radius-small"]),onClick:t[4]||(t[4]=o=>e.unref(r).push({name:"Blog",params:{category:"following"}}))},"👥 Following",2)):e.createCommentVNode("",!0)]),e.createElementVNode("section",h,[e.createVNode(s,null,{default:e.withCtx(({Component:o,route:i})=>[e.createVNode(e.Transition,{name:"scaleIn",mode:"out-in"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o),{ref:"page",key:i.query}))]),_:2},1024)]),_:1})])])}}};exports.default=w;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),n=require("vue-router"),u=require("../../../../components/Select/Select.vue2.cjs"),a=require("../../store/blogposts.cjs"),c=require("../../../auth/store/auth.cjs"),m={class:"min-h-100vh pd-thin"},d={class:"mn-thin flex-v-center t-left flex-nowrap flex"},p={class:"flex-v-center flex-nowrap flex t-left"},f=e.createElementVNode("span",{class:""},"Topics for ",-1),g={class:"w-100 bg-grey pd-small radius-big mn-semi gap-thin flex-nowrap flex"},h={class:""},w={__name:"Community",setup(k){const l=n.useRoute(),r=n.useRouter();return(y,t)=>{const s=e.resolveComponent("router-view");return e.openBlock(),e.createElementBlock("div",m,[e.createElementVNode("header",d,[e.createElementVNode("h2",p,[f,e.createVNode(u.default,{options:["today","week","month","year"],select:a.state.filter.period,"onUpdate:select":t[0]||(t[0]=o=>a.state.filter.period=o),placeholder:"Select type",class:"w-max mn-l-small bg-grey pd-thin radius-medium h2 t-center t-black"},null,8,["select"])])]),e.createElementVNode("ul",g,[e.createElementVNode("li",{class:e.normalizeClass([{"t-white bg-black":e.unref(l).params.category==="featured"},"t-medium pd-thin radius-small"]),onClick:t[1]||(t[1]=o=>e.unref(r).push({name:"Blog"}))},"👑 Featured",2),e.createElementVNode("li",{class:e.normalizeClass([{"t-white bg-black":e.unref(l).params.category==="popular"},"t-medium pd-thin radius-small"]),onClick:t[2]||(t[2]=o=>e.unref(r).push({name:"Blog",params:{category:"popular"}}))},"🔥 Popular",2),e.createElementVNode("li",{class:e.normalizeClass([{"t-white bg-black":e.unref(l).params.category==="new"},"t-medium pd-thin radius-small"]),onClick:t[3]||(t[3]=o=>e.unref(r).push({name:"Blog",params:{category:"new"}}))},"🆕 New",2),c.state.user._id?(e.openBlock(),e.createElementBlock("li",{key:0,class:e.normalizeClass([{"t-white bg-black":e.unref(l).params.category==="following"},"t-medium pd-thin radius-small"]),onClick:t[4]||(t[4]=o=>e.unref(r).push({name:"Blog",params:{category:"following"}}))},"👥 Following",2)):e.createCommentVNode("",!0)]),e.createElementVNode("section",h,[e.createVNode(s,null,{default:e.withCtx(({Component:o,route:i})=>[e.createVNode(e.Transition,{name:"scaleIn",mode:"out-in"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o),{ref:"page",key:i.query}))]),_:2},1024)]),_:1})])])}}};exports.default=w;
@@ -1,6 +1,6 @@
1
1
  import { resolveComponent as f, openBlock as n, createElementBlock as m, createElementVNode as o, createVNode as i, normalizeClass as r, unref as t, createCommentVNode as g, withCtx as p, Transition as h, createBlock as w, resolveDynamicComponent as y } from "vue";
2
2
  import { useRoute as _, useRouter as k } from "vue-router";
3
- import b from "../../../../components/Select/Select.vue.js";
3
+ import b from "../../../../components/Select/Select.vue2.js";
4
4
  import { state as c } from "../../store/blogposts.js";
5
5
  import { state as v } from "../../../auth/store/auth.js";
6
6
  const x = { class: "min-h-100vh pd-thin" }, C = { class: "mn-thin flex-v-center t-left flex-nowrap flex" }, B = { class: "flex-v-center flex-nowrap flex t-left" }, $ = /* @__PURE__ */ o("span", { class: "" }, "Topics for ", -1), N = { class: "w-100 bg-grey pd-small radius-big mn-semi gap-thin flex-nowrap flex" }, V = { class: "" }, D = {
@@ -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.vue.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"),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"),C=require("../../../organizations/store/organizations.cjs"),q={class:"pd-thin"},E={key:0,class:"h-100 w-100 bg-grey pd-big radius-big"},T={class:"w-full h-full"},z={key:1,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"},$=e.createElementVNode("h3",{class:"mn-small"},"Final Touches",-1),D=e.createElementVNode("h5",{class:"mn-thin"},"Add to public:",-1),M={key:0,class:"mn-thin"},S={key:1,class:"mn-medium br-grey br-2px br-solid pd-small radius-big"},U={__name:"CreateBlogPost",setup(A){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()=>{if(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});const o=await C.actions.read({user:i.state.user._id,postable:i.state.user._id,limit:100});console.log(o),p.value=o.map(a=>({name:a.profile.name,_id:a._id,photo:a.profile.photo}))});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=>{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 _(){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",q,[e.unref(t)?(e.openBlock(),e.createElementBlock("section",E,[e.createElementVNode("div",T,[e.createVNode(w.default,{prop:e.unref(t),content:"name",placeholder:"Enter post title",class:"h2"},null,8,["prop"])]),e.createVNode(V.default,{content:e.unref(t).content,onUpdate:a[0]||(a[0]=l=>e.unref(t).content=l)},null,8,["content"])])):e.createCommentVNode("",!0),e.unref(t)?(e.openBlock(),e.createElementBlock("section",z,[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),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(()=>[$,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(P.default,{modelValue:r.value,"onUpdate:modelValue":a[5]||(a[5]=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-medium bg-grey radius-medium pd-small"},null,8,["modelValue","options"]),r.value?(e.openBlock(),e.createElementBlock("h5",M,"Options:")):e.createCommentVNode("",!0),r.value?(e.openBlock(),e.createElementBlock("div",S,[e.createVNode(N.default,{label:"Hide Author",radio:e.unref(t).creator.hidden,"onUpdate:radio":a[6]||(a[6]=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=U;
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"),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"),C=require("../../../organizations/store/organizations.cjs"),q={class:"pd-thin"},E={key:0,class:"h-100 w-100 bg-grey pd-big radius-big"},T={class:"w-full h-full"},z={key:1,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"},$=e.createElementVNode("h3",{class:"mn-small"},"Final Touches",-1),D=e.createElementVNode("h5",{class:"mn-thin"},"Add to public:",-1),M={key:0,class:"mn-thin"},S={key:1,class:"mn-medium br-grey br-2px br-solid pd-small radius-big"},U={__name:"CreateBlogPost",setup(A){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()=>{if(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});const o=await C.actions.read({user:i.state.user._id,postable:i.state.user._id,limit:100});console.log(o),p.value=o.map(a=>({name:a.profile.name,_id:a._id,photo:a.profile.photo}))});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=>{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 _(){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",q,[e.unref(t)?(e.openBlock(),e.createElementBlock("section",E,[e.createElementVNode("div",T,[e.createVNode(w.default,{prop:e.unref(t),content:"name",placeholder:"Enter post title",class:"h2"},null,8,["prop"])]),e.createVNode(V.default,{content:e.unref(t).content,onUpdate:a[0]||(a[0]=l=>e.unref(t).content=l)},null,8,["content"])])):e.createCommentVNode("",!0),e.unref(t)?(e.openBlock(),e.createElementBlock("section",z,[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),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(()=>[$,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(P.default,{modelValue:r.value,"onUpdate:modelValue":a[5]||(a[5]=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-medium bg-grey radius-medium pd-small"},null,8,["modelValue","options"]),r.value?(e.openBlock(),e.createElementBlock("h5",M,"Options:")):e.createCommentVNode("",!0),r.value?(e.openBlock(),e.createElementBlock("div",S,[e.createVNode(N.default,{label:"Hide Author",radio:e.unref(t).creator.hidden,"onUpdate:radio":a[6]||(a[6]=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=U;
@@ -1,5 +1,5 @@
1
1
  import { ref as r, onMounted as V, computed as _, openBlock as u, createElementBlock as i, unref as a, createElementVNode as p, createVNode as n, createCommentVNode as m, withCtx as w, createTextVNode as z } from "vue";
2
- import D from "../../../constructor/components/elements/Textarea.vue.js";
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";
@@ -1,4 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("./Textarea.vue2.cjs");const f=["placeholder"],k={__name:"Textarea",props:["prop","value","content","placeholder","index","setFocus"],emits:["deleteBlock","updateBlock","addBlock","focus"],setup(l,{emit:c}){const t=l;e.ref(t);const o=e.ref(null);e.ref(0);function d(a){let n=a.target.value.split(/\n+/);if(n.length>1){t.prop[t.content]=n[0],e.nextTick(()=>{r()});let u=n.slice(1).map(p=>({__name:"Textarea",content:p}));c("addBlock","Textarea","",t.index,{blocks:u,ref:o})}else a.target.value.trim()===""&&a.target.value.includes(`
2
-
3
- `)&&(console.log("We are adding new block:"+t.index+newBlocks+o),c("addBlock","Textarea","",t.index,{blocks:newBlocks,ref:o})),r()}function i(a){(a.keyCode===8||a.keyCode===46)&&t.prop[t.content].trim()===""&&c("deleteBlock",t.prop)}function s(){e.nextTick(()=>{o.value.focus(),c("updateBlock",t.prop,{setFocus:!1})})}function r(){o.value.style.height="1rem",o.value.style.height=o.value.scrollHeight+"px"}return e.onUpdated(()=>{t.setFocus&&e.nextTick(()=>{s()}),r()}),e.onMounted(()=>{t.setFocus&&e.nextTick(()=>{s()}),r()}),(a,n)=>(e.openBlock(),e.createElementBlock("div",null,[e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":n[0]||(n[0]=u=>l.prop[l.content]=u),placeholder:l.placeholder?l.placeholder:"Enter text",onInput:d,onFocus:n[1]||(n[1]=u=>c("focus",o.value)),onKeyup:i,ref_key:"textarea",ref:o,class:"text-area mn-thin"},`
4
- `,40,f),[[e.vModelText,l.prop[l.content]]])]))}};exports.default=k;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="";exports.default=e;
@@ -1,63 +1,4 @@
1
- import { ref as d, onUpdated as k, nextTick as s, onMounted as x, openBlock as h, createElementBlock as B, withDirectives as m, createElementVNode as g, vModelText as v } from "vue";
2
- import "./Textarea.vue2.js";
3
- const y = ["placeholder"], F = {
4
- __name: "Textarea",
5
- props: ["prop", "value", "content", "placeholder", "index", "setFocus"],
6
- emits: ["deleteBlock", "updateBlock", "addBlock", "focus"],
7
- setup(l, { emit: a }) {
8
- const e = l;
9
- d(e);
10
- const t = d(null);
11
- d(0);
12
- function i(n) {
13
- let o = n.target.value.split(/\n+/);
14
- if (o.length > 1) {
15
- e.prop[e.content] = o[0], s(() => {
16
- c();
17
- });
18
- let r = o.slice(1).map((f) => ({ __name: "Textarea", content: f }));
19
- a("addBlock", "Textarea", "", e.index, { blocks: r, ref: t });
20
- } else
21
- n.target.value.trim() === "" && n.target.value.includes(`
22
-
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 p(n) {
26
- (n.keyCode === 8 || n.keyCode === 46) && e.prop[e.content].trim() === "" && a("deleteBlock", e.prop);
27
- }
28
- function u() {
29
- s(() => {
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 k(() => {
37
- e.setFocus && s(() => {
38
- u();
39
- }), c();
40
- }), x(() => {
41
- e.setFocus && s(() => {
42
- u();
43
- }), c();
44
- }), (n, o) => (h(), B("div", null, [
45
- m(g("textarea", {
46
- "onUpdate:modelValue": o[0] || (o[0] = (r) => l.prop[l.content] = r),
47
- placeholder: l.placeholder ? l.placeholder : "Enter text",
48
- onInput: i,
49
- onFocus: o[1] || (o[1] = (r) => a("focus", t.value)),
50
- onKeyup: p,
51
- ref_key: "textarea",
52
- ref: t,
53
- class: "text-area mn-thin"
54
- }, `
55
- `, 40, y), [
56
- [v, l.prop[l.content]]
57
- ])
58
- ]));
59
- }
60
- };
1
+ const e = "";
61
2
  export {
62
- F as default
3
+ e as default
63
4
  };
@@ -1 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="";exports.default=e;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("./Textarea.vue.cjs");const f=["placeholder"],k={__name:"Textarea",props:["prop","value","content","placeholder","index","setFocus"],emits:["deleteBlock","updateBlock","addBlock","focus"],setup(l,{emit:c}){const t=l;e.ref(t);const o=e.ref(null);e.ref(0);function d(a){let n=a.target.value.split(/\n+/);if(n.length>1){t.prop[t.content]=n[0],e.nextTick(()=>{r()});let u=n.slice(1).map(p=>({__name:"Textarea",content:p}));c("addBlock","Textarea","",t.index,{blocks:u,ref:o})}else a.target.value.trim()===""&&a.target.value.includes(`
2
+
3
+ `)&&(console.log("We are adding new block:"+t.index+newBlocks+o),c("addBlock","Textarea","",t.index,{blocks:newBlocks,ref:o})),r()}function i(a){(a.keyCode===8||a.keyCode===46)&&t.prop[t.content].trim()===""&&c("deleteBlock",t.prop)}function s(){e.nextTick(()=>{o.value.focus(),c("updateBlock",t.prop,{setFocus:!1})})}function r(){o.value.style.height="1rem",o.value.style.height=o.value.scrollHeight+"px"}return e.onUpdated(()=>{t.setFocus&&e.nextTick(()=>{s()}),r()}),e.onMounted(()=>{t.setFocus&&e.nextTick(()=>{s()}),r()}),(a,n)=>(e.openBlock(),e.createElementBlock("div",null,[e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":n[0]||(n[0]=u=>l.prop[l.content]=u),placeholder:l.placeholder?l.placeholder:"Enter text",onInput:d,onFocus:n[1]||(n[1]=u=>c("focus",o.value)),onKeyup:i,ref_key:"textarea",ref:o,class:"text-area mn-thin"},`
4
+ `,40,f),[[e.vModelText,l.prop[l.content]]])]))}};exports.default=k;