@ozdao/prometheus-framework 0.1.78 → 0.1.80

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. package/dist/main.css +1 -1
  2. package/dist/prometheus-framework/src/components/Button/Button.vue.cjs +1 -1
  3. package/dist/prometheus-framework/src/components/Button/Button.vue.js +2 -224
  4. package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
  5. package/dist/prometheus-framework/src/components/Button/Button.vue2.js +224 -2
  6. package/dist/prometheus-framework/src/components/Field/Field.vue2.cjs +1 -1
  7. package/dist/prometheus-framework/src/components/Field/Field.vue2.js +33 -30
  8. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue.cjs +1 -1
  9. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue.js +1 -1
  10. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.cjs +1 -1
  11. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.js +1 -1
  12. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.cjs +1 -1
  13. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.js +41 -43
  14. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.cjs +1 -1
  15. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +33 -35
  16. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.cjs +1 -1
  17. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +1 -1
  18. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.cjs +1 -1
  19. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +44 -46
  20. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
  21. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +83 -81
  22. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.cjs +1 -1
  23. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +44 -46
  24. package/dist/prometheus-framework/src/modules/auth/localization/SignIn.json.cjs +1 -0
  25. package/dist/prometheus-framework/src/modules/auth/localization/SignIn.json.js +38 -0
  26. package/dist/prometheus-framework/src/modules/auth/router/auth.cjs +1 -1
  27. package/dist/prometheus-framework/src/modules/auth/router/auth.js +114 -111
  28. package/dist/prometheus-framework/src/modules/auth/store/auth.cjs +1 -1
  29. package/dist/prometheus-framework/src/modules/auth/store/auth.js +93 -75
  30. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  31. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +1 -1
  32. package/dist/prometheus-framework/src/modules/constructor/components/elements/Bullets.vue.cjs +1 -1
  33. package/dist/prometheus-framework/src/modules/constructor/components/elements/Bullets.vue.js +4 -3
  34. package/dist/prometheus-framework/src/modules/constructor/components/elements/Caption.vue.cjs +1 -1
  35. package/dist/prometheus-framework/src/modules/constructor/components/elements/Caption.vue.js +12 -11
  36. package/dist/prometheus-framework/src/modules/constructor/components/elements/H2.vue.cjs +2 -2
  37. package/dist/prometheus-framework/src/modules/constructor/components/elements/H2.vue.js +12 -11
  38. package/dist/prometheus-framework/src/modules/constructor/components/elements/ImageUpload.vue.cjs +1 -1
  39. package/dist/prometheus-framework/src/modules/constructor/components/elements/ImageUpload.vue.js +5 -4
  40. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +2 -2
  41. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +20 -19
  42. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.cjs +1 -1
  43. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
  44. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  45. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +1 -1
  46. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
  47. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +1 -1
  48. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  49. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +1 -1
  50. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
  51. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +1 -1
  52. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
  53. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +1 -1
  54. package/dist/prometheus-framework/src/modules/globals/localization/vue-i18n.cjs +1 -1
  55. package/dist/prometheus-framework/src/modules/globals/localization/vue-i18n.js +15 -13
  56. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
  57. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +1 -1
  58. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.cjs +1 -1
  59. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
  60. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  61. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +1 -1
  62. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
  63. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +1 -1
  64. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  65. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +1 -1
  66. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  67. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +1 -1
  68. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  69. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
  70. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  71. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +1 -1
  72. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  73. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +1 -1
  74. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
  75. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +1 -1
  76. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +1 -1
  77. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +1 -1
  78. package/dist/prometheus-framework.cjs.js +10 -10
  79. package/dist/prometheus-framework.es.js +8 -5
  80. package/dist/style.css +1 -1
  81. package/package.json +1 -2
  82. package/src/components/Field/Field.vue +4 -1
  83. package/src/modules/auth/components/layouts/Auth.vue +45 -36
  84. package/src/modules/auth/components/pages/EnterCode.vue +0 -17
  85. package/src/modules/auth/components/pages/EnterPassword.vue +0 -23
  86. package/src/modules/auth/components/pages/ResetPassword.vue +0 -27
  87. package/src/modules/auth/components/pages/SignIn.vue +26 -54
  88. package/src/modules/auth/components/pages/SignUp.vue +0 -29
  89. package/src/modules/auth/localization/EnterCode.json +14 -0
  90. package/src/modules/auth/localization/EnterPassword.json +20 -0
  91. package/src/modules/auth/localization/ResetPassword.json +24 -0
  92. package/src/modules/auth/localization/SignIn.json +34 -0
  93. package/src/modules/auth/localization/SignUp.json +26 -0
  94. package/src/modules/auth/router/auth.js +95 -86
  95. package/src/modules/auth/store/auth.js +20 -20
  96. package/src/modules/constructor/components/elements/Bullets.vue +1 -0
  97. package/src/modules/constructor/components/elements/Caption.vue +1 -0
  98. package/src/modules/constructor/components/elements/H2.vue +1 -0
  99. package/src/modules/constructor/components/elements/ImageUpload.vue +1 -1
  100. package/src/modules/constructor/components/elements/Textarea.vue +1 -0
  101. package/src/modules/globals/localization/methods/get-app-locales.js +13 -0
  102. package/src/modules/globals/localization/vue-i18n.js +20 -14
  103. package/src/modules/globals/localization/vue-i18n.singleton.js +1 -1
  104. package/src/modules/middlewares/client/inputs.validation.js +1 -0
  105. package/src/modules/globals/localization/vue-i18n-new.js +0 -70
@@ -1,118 +1,121 @@
1
- import r from "../components/layouts/Auth.vue.js";
1
+ import o from "../components/layouts/Auth.vue.js";
2
2
  import { resetUser as t, checkUser as n } from "../../middlewares/client/states.validation.js";
3
3
  import { requiresNoAuth as e } from "../../middlewares/client/auth.validation.js";
4
- const i = [
5
- {
6
- path: "auth",
7
- name: "Authentication",
8
- meta: {
9
- title: {
10
- en: "Sign In",
11
- ru: "Вход"
12
- }
13
- },
14
- component: r,
15
- children: [{
16
- path: "signin",
17
- name: "Sign In",
18
- beforeEnter: [
19
- e,
20
- t
21
- ],
4
+ function s(r) {
5
+ return [
6
+ {
7
+ path: "auth",
8
+ name: "Authentication",
22
9
  meta: {
23
10
  title: {
24
- en: "Sign In",
25
- ru: "Вход"
26
- }
11
+ en: "Аутентификация",
12
+ ru: "Authentication"
13
+ },
14
+ options: r
27
15
  },
28
- component: () => import(
29
- /* webpackChunkName: "signin" */
30
- "../components/pages/SignIn.vue.js"
31
- )
32
- }, {
33
- path: "reset-password",
34
- name: "Reset Password",
35
- beforeEnter: [
36
- e,
37
- t
38
- ],
39
- meta: {
40
- title: {
41
- en: "Reset Password",
42
- ru: "Сбросить Пароль"
43
- }
44
- },
45
- component: () => import(
46
- /* webpackChunkName: "reset-password" */
47
- "../components/pages/ResetPassword.vue.js"
48
- )
49
- }, {
50
- path: "signup",
51
- name: "Sign Up",
52
- beforeEnter: [
53
- e,
54
- t
55
- ],
56
- meta: {
57
- title: {
58
- en: "Sign Up",
59
- ru: "Регистрация"
60
- }
61
- },
62
- component: () => import(
63
- /* webpackChunkName: "signup" */
64
- "../components/pages/SignUp.vue.js"
65
- )
66
- }, {
67
- path: "enter-code",
68
- name: "Enter Code",
69
- beforeEnter: [
70
- e,
71
- n
72
- ],
73
- meta: {
74
- title: {
75
- en: "Enter Code",
76
- ru: "Введите Код"
77
- }
78
- },
79
- component: () => import(
80
- /* webpackChunkName: "signup" */
81
- "../components/pages/EnterCode.vue.js"
82
- )
83
- }, {
84
- path: "enter-password",
85
- name: "Enter Password",
86
- beforeEnter: [
87
- e,
88
- n
89
- ],
90
- meta: {
91
- title: {
92
- en: "Enter Password",
93
- ru: "Введите Пароль"
94
- }
95
- },
96
- component: () => import(
97
- /* webpackChunkName: "signup" */
98
- "../components/pages/EnterPassword.vue.js"
99
- )
100
- }, {
101
- path: "invite",
102
- name: "Invite",
103
- meta: {
104
- title: {
105
- en: "Invite",
106
- ru: "Приглашение"
107
- }
108
- },
109
- component: () => import(
110
- /* webpackChunkName: "signup" */
111
- "../components/pages/Invite.vue.js"
112
- )
113
- }]
114
- }
115
- ];
16
+ component: o,
17
+ children: [{
18
+ path: "signin",
19
+ name: "Sign In",
20
+ beforeEnter: [
21
+ e,
22
+ t
23
+ ],
24
+ meta: {
25
+ title: {
26
+ en: "Sign In",
27
+ ru: "Вход"
28
+ }
29
+ },
30
+ component: () => import(
31
+ /* webpackChunkName: "signin" */
32
+ "../components/pages/SignIn.vue.js"
33
+ )
34
+ }, {
35
+ path: "reset-password",
36
+ name: "Reset Password",
37
+ beforeEnter: [
38
+ e,
39
+ t
40
+ ],
41
+ meta: {
42
+ title: {
43
+ en: "Reset Password",
44
+ ru: "Сбросить Пароль"
45
+ }
46
+ },
47
+ component: () => import(
48
+ /* webpackChunkName: "reset-password" */
49
+ "../components/pages/ResetPassword.vue.js"
50
+ )
51
+ }, {
52
+ path: "signup",
53
+ name: "Sign Up",
54
+ beforeEnter: [
55
+ e,
56
+ t
57
+ ],
58
+ meta: {
59
+ title: {
60
+ en: "Sign Up",
61
+ ru: "Регистрация"
62
+ }
63
+ },
64
+ component: () => import(
65
+ /* webpackChunkName: "signup" */
66
+ "../components/pages/SignUp.vue.js"
67
+ )
68
+ }, {
69
+ path: "enter-code",
70
+ name: "Enter Code",
71
+ beforeEnter: [
72
+ e,
73
+ n
74
+ ],
75
+ meta: {
76
+ title: {
77
+ en: "Enter Code",
78
+ ru: "Введите Код"
79
+ }
80
+ },
81
+ component: () => import(
82
+ /* webpackChunkName: "signup" */
83
+ "../components/pages/EnterCode.vue.js"
84
+ )
85
+ }, {
86
+ path: "enter-password",
87
+ name: "Enter Password",
88
+ beforeEnter: [
89
+ e,
90
+ n
91
+ ],
92
+ meta: {
93
+ title: {
94
+ en: "Enter Password",
95
+ ru: "Введите Пароль"
96
+ }
97
+ },
98
+ component: () => import(
99
+ /* webpackChunkName: "signup" */
100
+ "../components/pages/EnterPassword.vue.js"
101
+ )
102
+ }, {
103
+ path: "invite",
104
+ name: "Invite",
105
+ meta: {
106
+ title: {
107
+ en: "Invite",
108
+ ru: "Приглашение"
109
+ }
110
+ },
111
+ component: () => import(
112
+ /* webpackChunkName: "signup" */
113
+ "../components/pages/Invite.vue.js"
114
+ )
115
+ }]
116
+ }
117
+ ];
118
+ }
116
119
  export {
117
- i as default
120
+ s as default
118
121
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("../../../../node_modules/axios/lib/axios.cjs"),p=require("../../../../../node_modules/js-cookie/src/js.cookie.cjs"),d=require("../../../../node_modules/@capacitor/core/dist/index.cjs"),l=require("vue"),n=require("../../globals/store/globals.cjs"),O=require("./twofa.cjs"),c=w.default.create({baseURL:process.env.API_URL,withCredentials:!0}),o=l.reactive({user:{_id:void 0,username:"",email:"",phone:"",password:"",passwordRepeat:""},access:{roles:null,token:null,status:!1}}),f={async login(s,t){try{const e=await c.post("/api/auth/signin",{...s,type:t});return u("user",e.data),Object.assign(o.user,{...e.data}),Object.assign(o.access,{token:e.data.accessToken,status:!0,roles:e.data.roles}),e.data}catch(e){return Object.assign(o.access,{token:null,status:!1,roles:null}),n.setError(e),Promise.reject(e)}},async signup(s,t,e){const{password:i,passwordRepeat:r}=o.user;if(i!==r){const a={response:{data:{errorCode:"PASSWORDS_DO_NOT_MATCH"}}};throw n.setError(a),new Error(a.response.status)}try{s.phone=s.phone.number;const a=await c.post("/api/auth/signup",{...s,type:t,inviteCode:e});return a.data.accessToken&&u("user",a.data),Object.assign(o.user,{...a.data}),Object.assign(o.access,{token:a.data.accessToken,status:!0,roles:a.data.roles}),a.data}catch(a){throw n.setError(a),console.log("Sign up falied"),a}},logout(){h("user"),Object.assign(o.user,{email:"",phone:"",password:"",passwordRepeat:""}),Object.assign(o.access,{token:null,status:!1})},async resetPassword(s,t){try{const e=await c.post("/api/auth/reset-password",{email:s.email,phone:s.phone.number,type:t});return Object.assign(O.state.code,{...e.data,isSended:!0}),e.data}catch(e){return n.setError(e),Promise.reject(e)}},async updatePassword(s,t){const{password:e,passwordRepeat:i}=o.user;if(e!==i){const r={response:{data:{errorCode:"PASSWORDS_DO_NOT_MATCH"}}};throw n.setError(r),new Error(r.response.status)}try{const r=await c.post("/api/auth/update-password",{email:s.email,phone:s.phone.number,password:s.password,passwordRepeat:s.passwordRepeat,type:t});return r.data.accessToken&&u("user",r.data),Object.assign(o.user,{...r.data}),Object.assign(o.access,{token:r.data.accessToken,status:!0}),r.data}catch(r){return n.setError(r),Promise.reject(r)}}},g={development:{secure:!1,expires:1},production:{expires:1,domain:process.env.API_URL,sameSite:"none",secure:!0}};function u(s,t,e=process.env.NODE_ENV){process.env.MOBILE_APP?d.CapacitorCookies.setCookie({url:process.env.API_URL,key:s,value:JSON.stringify(t)}):p.default.set(s,JSON.stringify(t),g[e])}function h(s,t=process.env.NODE_ENV){if(process.env.MOBILE_APP)d.CapacitorCookies.deleteCookie({url:process.env.API_URL,key:s});else{const e=t==="production"?{domain:process.env.API_URL}:{};p.default.remove(s,e)}}l.watch(o,(s,t)=>{});exports.actions=f;exports.state=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("../../../../node_modules/axios/lib/axios.cjs"),p=require("../../../../../node_modules/js-cookie/src/js.cookie.cjs"),l=require("../../../../node_modules/@capacitor/core/dist/index.cjs"),w=require("vue"),n=require("../../globals/store/globals.cjs"),O=require("./twofa.cjs"),i=f.default.create({baseURL:process.env.API_URL,withCredentials:!0}),a=w.reactive({user:{_id:void 0,username:"",email:"",phone:"",password:"",passwordRepeat:""},access:{roles:null,token:null,status:!1}});async function k(){const e=await P("user");if(e){const{_id:t,email:s,phone:c,roles:o,accessToken:r}=e;Object.assign(a.user,{_id:t,email:s,phone:c}),Object.assign(a.access,{token:r,roles:o,status:!!r}),i.interceptors.request.use(u=>(r&&(u.headers["x-access-token"]=r),u),u=>Promise.reject(u))}}k();const g={async login(e,t){try{const s=await i.post("/api/auth/signin",{...e,type:t});return d("user",s.data),Object.assign(a.user,{...s.data}),Object.assign(a.access,{token:s.data.accessToken,status:!0,roles:s.data.roles}),s.data}catch(s){return Object.assign(a.access,{token:null,status:!1,roles:null}),n.setError(s),Promise.reject(s)}},async signup(e,t,s){const{password:c,passwordRepeat:o}=a.user;if(c!==o){const r={response:{data:{errorCode:"PASSWORDS_DO_NOT_MATCH"}}};throw n.setError(r),new Error(r.response.status)}try{e.phone=e.phone.number;const r=await i.post("/api/auth/signup",{...e,type:t,inviteCode:s});return r.data.accessToken&&d("user",r.data),Object.assign(a.user,{...r.data}),Object.assign(a.access,{token:r.data.accessToken,status:!0,roles:r.data.roles}),r.data}catch(r){throw n.setError(r),console.log("Sign up falied"),r}},logout(){b("user"),Object.assign(a.user,{email:"",phone:"",password:"",passwordRepeat:""}),Object.assign(a.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.number,type:t});return Object.assign(O.state.code,{...s.data,isSended:!0}),s.data}catch(s){return n.setError(s),Promise.reject(s)}},async updatePassword(e,t){const{password:s,passwordRepeat:c}=a.user;if(s!==c){const o={response:{data:{errorCode:"PASSWORDS_DO_NOT_MATCH"}}};throw n.setError(o),new Error(o.response.status)}try{const o=await i.post("/api/auth/update-password",{email:e.email,phone:e.phone.number,password:e.password,passwordRepeat:e.passwordRepeat,type:t});return o.data.accessToken&&d("user",o.data),Object.assign(a.user,{...o.data}),Object.assign(a.access,{token:o.data.accessToken,status:!0}),o.data}catch(o){return n.setError(o),Promise.reject(o)}}},h={development:{secure:!1,expires:1},production:{expires:1,domain:process.env.API_URL,sameSite:"none",secure:!0}};function P(e){if(process.env.MOBILE_APP){const t=p.default.get(e);return t?JSON.parse(t):null}else{const t=p.default.get(e);return t?JSON.parse(t):null}}function d(e,t,s=process.env.NODE_ENV){process.env.MOBILE_APP?l.CapacitorCookies.setCookie({url:process.env.API_URL,key:e,value:JSON.stringify(t)}):p.default.set(e,JSON.stringify(t),h[s])}function b(e,t=process.env.NODE_ENV){if(process.env.MOBILE_APP)l.CapacitorCookies.deleteCookie({url:process.env.API_URL,key:e});else{const s=t==="production"?{domain:process.env.API_URL}:{};p.default.remove(e,s)}}w.watch(a,(e,t)=>{});exports.actions=g;exports.state=a;
@@ -1,10 +1,10 @@
1
- import l from "../../../../node_modules/axios/lib/axios.js";
1
+ import m from "../../../../node_modules/axios/lib/axios.js";
2
2
  import u from "../../../../../node_modules/js-cookie/src/js.cookie.js";
3
- import { CapacitorCookies as d } from "../../../../node_modules/@capacitor/core/dist/index.js";
4
- import { reactive as m, watch as w } from "vue";
3
+ import { CapacitorCookies as l } from "../../../../node_modules/@capacitor/core/dist/index.js";
4
+ import { reactive as w, watch as f } from "vue";
5
5
  import { setError as n } from "../../globals/store/globals.js";
6
- import { state as f } from "./twofa.js";
7
- const c = l.create({ baseURL: process.env.API_URL, withCredentials: !0 }), r = m({
6
+ import { state as O } from "./twofa.js";
7
+ const i = m.create({ baseURL: process.env.API_URL, withCredentials: !0 }), a = w({
8
8
  user: {
9
9
  _id: void 0,
10
10
  username: "",
@@ -18,137 +18,155 @@ const c = l.create({ baseURL: process.env.API_URL, withCredentials: !0 }), r = m
18
18
  token: null,
19
19
  status: !1
20
20
  }
21
- }), R = {
22
- async login(s, t) {
21
+ });
22
+ async function k() {
23
+ const e = await h("user");
24
+ if (e) {
25
+ const { _id: t, email: s, phone: c, roles: r, accessToken: o } = e;
26
+ Object.assign(a.user, { _id: t, email: s, phone: c }), Object.assign(a.access, { token: o, roles: r, status: !!o }), i.interceptors.request.use((p) => (o && (p.headers["x-access-token"] = o), p), (p) => Promise.reject(p));
27
+ }
28
+ }
29
+ k();
30
+ const R = {
31
+ async login(e, t) {
23
32
  try {
24
- const e = await c.post("/api/auth/signin", {
25
- ...s,
33
+ const s = await i.post("/api/auth/signin", {
34
+ ...e,
26
35
  type: t
27
36
  });
28
- return p("user", e.data), Object.assign(r.user, {
29
- ...e.data
30
- }), Object.assign(r.access, {
31
- token: e.data.accessToken,
37
+ return d("user", s.data), Object.assign(a.user, {
38
+ ...s.data
39
+ }), Object.assign(a.access, {
40
+ token: s.data.accessToken,
32
41
  status: !0,
33
- roles: e.data.roles
34
- }), e.data;
35
- } catch (e) {
36
- return Object.assign(r.access, {
42
+ roles: s.data.roles
43
+ }), s.data;
44
+ } catch (s) {
45
+ return Object.assign(a.access, {
37
46
  token: null,
38
47
  status: !1,
39
48
  roles: null
40
- }), n(e), Promise.reject(e);
49
+ }), n(s), Promise.reject(s);
41
50
  }
42
51
  },
43
- async signup(s, t, e) {
44
- const { password: i, passwordRepeat: o } = r.user;
45
- if (i !== o) {
46
- const a = {
52
+ async signup(e, t, s) {
53
+ const { password: c, passwordRepeat: r } = a.user;
54
+ if (c !== r) {
55
+ const o = {
47
56
  response: {
48
57
  data: { errorCode: "PASSWORDS_DO_NOT_MATCH" }
49
58
  }
50
59
  };
51
- throw n(a), new Error(a.response.status);
60
+ throw n(o), new Error(o.response.status);
52
61
  }
53
62
  try {
54
- s.phone = s.phone.number;
55
- const a = await c.post("/api/auth/signup", {
56
- ...s,
63
+ e.phone = e.phone.number;
64
+ const o = await i.post("/api/auth/signup", {
65
+ ...e,
57
66
  type: t,
58
- inviteCode: e
67
+ inviteCode: s
59
68
  });
60
- return a.data.accessToken && p("user", a.data), Object.assign(r.user, {
61
- ...a.data
62
- }), Object.assign(r.access, {
63
- token: a.data.accessToken,
69
+ return o.data.accessToken && d("user", o.data), Object.assign(a.user, {
70
+ ...o.data
71
+ }), Object.assign(a.access, {
72
+ token: o.data.accessToken,
64
73
  status: !0,
65
- roles: a.data.roles
66
- }), a.data;
67
- } catch (a) {
68
- throw n(a), console.log("Sign up falied"), a;
74
+ roles: o.data.roles
75
+ }), o.data;
76
+ } catch (o) {
77
+ throw n(o), console.log("Sign up falied"), o;
69
78
  }
70
79
  },
71
80
  logout() {
72
- h("user"), Object.assign(r.user, {
81
+ P("user"), Object.assign(a.user, {
73
82
  email: "",
74
83
  phone: "",
75
84
  password: "",
76
85
  passwordRepeat: ""
77
- }), Object.assign(r.access, {
86
+ }), Object.assign(a.access, {
78
87
  token: null,
79
88
  status: !1
80
89
  });
81
90
  },
82
- async resetPassword(s, t) {
91
+ async resetPassword(e, t) {
83
92
  try {
84
- const e = await c.post("/api/auth/reset-password", {
85
- email: s.email,
86
- phone: s.phone.number,
93
+ const s = await i.post("/api/auth/reset-password", {
94
+ email: e.email,
95
+ phone: e.phone.number,
87
96
  type: t
88
97
  });
89
- return Object.assign(f.code, {
90
- ...e.data,
98
+ return Object.assign(O.code, {
99
+ ...s.data,
91
100
  isSended: !0
92
- }), e.data;
93
- } catch (e) {
94
- return n(e), Promise.reject(e);
101
+ }), s.data;
102
+ } catch (s) {
103
+ return n(s), Promise.reject(s);
95
104
  }
96
105
  },
97
- async updatePassword(s, t) {
98
- const { password: e, passwordRepeat: i } = r.user;
99
- if (e !== i) {
100
- const o = {
106
+ async updatePassword(e, t) {
107
+ const { password: s, passwordRepeat: c } = a.user;
108
+ if (s !== c) {
109
+ const r = {
101
110
  response: {
102
111
  data: { errorCode: "PASSWORDS_DO_NOT_MATCH" }
103
112
  }
104
113
  };
105
- throw n(o), new Error(o.response.status);
114
+ throw n(r), new Error(r.response.status);
106
115
  }
107
116
  try {
108
- const o = await c.post("/api/auth/update-password", {
109
- email: s.email,
110
- phone: s.phone.number,
111
- password: s.password,
112
- passwordRepeat: s.passwordRepeat,
117
+ const r = await i.post("/api/auth/update-password", {
118
+ email: e.email,
119
+ phone: e.phone.number,
120
+ password: e.password,
121
+ passwordRepeat: e.passwordRepeat,
113
122
  type: t
114
123
  });
115
- return o.data.accessToken && p("user", o.data), Object.assign(r.user, {
116
- ...o.data
117
- }), Object.assign(r.access, {
118
- token: o.data.accessToken,
124
+ return r.data.accessToken && d("user", r.data), Object.assign(a.user, {
125
+ ...r.data
126
+ }), Object.assign(a.access, {
127
+ token: r.data.accessToken,
119
128
  status: !0
120
- }), o.data;
121
- } catch (o) {
122
- return n(o), Promise.reject(o);
129
+ }), r.data;
130
+ } catch (r) {
131
+ return n(r), Promise.reject(r);
123
132
  }
124
133
  }
125
- }, O = {
134
+ }, g = {
126
135
  development: { secure: !1, expires: 1 },
127
136
  production: { expires: 1, domain: process.env.API_URL, sameSite: "none", secure: !0 }
128
137
  };
129
- function p(s, t, e = process.env.NODE_ENV) {
130
- process.env.MOBILE_APP ? d.setCookie({
138
+ function h(e) {
139
+ if (process.env.MOBILE_APP) {
140
+ const t = u.get(e);
141
+ return t ? JSON.parse(t) : null;
142
+ } else {
143
+ const t = u.get(e);
144
+ return t ? JSON.parse(t) : null;
145
+ }
146
+ }
147
+ function d(e, t, s = process.env.NODE_ENV) {
148
+ process.env.MOBILE_APP ? l.setCookie({
131
149
  url: process.env.API_URL,
132
150
  // используйте ваш API_URL
133
- key: s,
151
+ key: e,
134
152
  value: JSON.stringify(t)
135
- }) : u.set(s, JSON.stringify(t), O[e]);
153
+ }) : u.set(e, JSON.stringify(t), g[s]);
136
154
  }
137
- function h(s, t = process.env.NODE_ENV) {
155
+ function P(e, t = process.env.NODE_ENV) {
138
156
  if (process.env.MOBILE_APP)
139
- d.deleteCookie({
157
+ l.deleteCookie({
140
158
  url: process.env.API_URL,
141
159
  // используйте ваш API_URL
142
- key: s
160
+ key: e
143
161
  });
144
162
  else {
145
- const e = t === "production" ? { domain: process.env.API_URL } : {};
146
- u.remove(s, e);
163
+ const s = t === "production" ? { domain: process.env.API_URL } : {};
164
+ u.remove(e, s);
147
165
  }
148
166
  }
149
- w(r, (s, t) => {
167
+ f(a, (e, t) => {
150
168
  });
151
169
  export {
152
170
  R as actions,
153
- r as state
171
+ a as state
154
172
  };
@@ -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.vue.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"},D=e.createElementVNode("h3",{class:"mn-small"},"Final Touches",-1),M=e.createElementVNode("h5",{class:"mn-thin"},"Add to public:",-1),S={key:0,class:"mn-thin"},U={key:1,class:"mn-medium br-grey br-2px br-solid pd-small radius-big"},A={__name:"CreateBlogPost",setup(R){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 v(){d.value=!0}function h(){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=>v()),class:"mn-l-thin bg-black t-white button"},"Publish")])])):e.createCommentVNode("",!0),e.createVNode(y.default,{title:"Добавить участника",onClosePopup:h,isPopupOpen:d.value,class:"w-m-33r t-left pd-big bg-white radius-big"},{default:e.withCtx(()=>[D,e.createVNode(B.default,{onTagsChanged:a[4]||(a[4]=l=>e.unref(t).tags=l),tags:e.unref(t).tags},null,8,["tags"]),M,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",S,"Options:")):e.createCommentVNode("",!0),r.value?(e.openBlock(),e.createElementBlock("div",U,[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=A;
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"},D=e.createElementVNode("h3",{class:"mn-small"},"Final Touches",-1),M=e.createElementVNode("h5",{class:"mn-thin"},"Add to public:",-1),S={key:0,class:"mn-thin"},U={key:1,class:"mn-medium br-grey br-2px br-solid pd-small radius-big"},A={__name:"CreateBlogPost",setup(R){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 v(){d.value=!0}function h(){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=>v()),class:"mn-l-thin bg-black t-white button"},"Publish")])])):e.createCommentVNode("",!0),e.createVNode(y.default,{title:"Добавить участника",onClosePopup:h,isPopupOpen:d.value,class:"w-m-33r t-left pd-big bg-white radius-big"},{default:e.withCtx(()=>[D,e.createVNode(B.default,{onTagsChanged:a[4]||(a[4]=l=>e.unref(t).tags=l),tags:e.unref(t).tags},null,8,["tags"]),M,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",S,"Options:")):e.createCommentVNode("",!0),r.value?(e.openBlock(),e.createElementBlock("div",U,[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=A;
@@ -7,7 +7,7 @@ import "../../../../components/FieldTags/vue-tags-input.scss.js";
7
7
  import U from "../../../../components/FieldTags/BlockTags.vue.js";
8
8
  import A from "../../../../components/Checkbox/Checkbox.vue.js";
9
9
  import E from "../../../../components/SelectMulti/SelectMulti.vue.js";
10
- import L from "../../../../components/Button/Button.vue.js";
10
+ import L from "../../../../components/Button/Button.vue2.js";
11
11
  import { useRoute as M, useRouter as R } from "vue-router";
12
12
  import { read as S, clean as F, state as H, update as k, create as y, remove as j } from "../../store/blogposts.js";
13
13
  import { state as f } from "../../../auth/store/auth.js";
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),f=["placeholder"],h={__name:"Bullets",props:["obj","label","prop","value","content","textarea","placeholder","index","ref"],emits:["deleteBlock","addBlock","focus"],setup(t,{emit:i}){const l=t;e.ref(l);const r=e.ref(null);function p(n){const o=/^\s*[-*]\s+(.*)/;let s=n.target.value.split(/\n+/).map(u=>{const d=o.exec(u);return d?d[1]:null}).filter(u=>u!==null);s.length>0?(l.prop[l.content]=s,a()):n.target.value.trim()===""&&(l.prop[l.content]=[],a())}function a(){r.value.style.height="1rem",r.value.style.height=r.value.scrollHeight+"px"}return e.onUpdated(()=>{a()}),e.onMounted(()=>{a()}),e.watch(()=>l.prop[l.content],n=>{(!n||n.length===0)&&i("deleteBlock",l.prop)}),(n,o)=>(e.openBlock(),e.createElementBlock("div",null,[e.createTextVNode(e.toDisplayString(t.prop[t.content])+" ",1),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":o[0]||(o[0]=c=>t.prop[t.content]=c),placeholder:t.placeholder?t.placeholder:"Enter text",onInput:p,onFocus:o[1]||(o[1]=c=>i("focus",r.value)),ref_key:"textarea",ref:r,class:"text-area mn-small"},`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),f=["placeholder"],h={__name:"Bullets",props:["obj","label","prop","value","content","textarea","placeholder","index","ref"],emits:["deleteBlock","addBlock","focus"],setup(t,{emit:i}){const l=t;e.ref(l);const r=e.ref(null);function p(n){const o=/^\s*[-*]\s+(.*)/;let s=n.target.value.split(/\n+/).map(u=>{const d=o.exec(u);return d?d[1]:null}).filter(u=>u!==null);s.length>0?(l.prop[l.content]=s,a()):n.target.value.trim()===""&&(l.prop[l.content]=[],a())}function a(){r.value.style.height="1rem",r.value.style.height=r.value.scrollHeight+"px"}return e.onUpdated(()=>{a()}),e.onMounted(()=>{a()}),e.watch(()=>l.prop[l.content],n=>{(!n||n.length===0)&&i("deleteBlock",l.prop)}),(n,o)=>(e.openBlock(),e.createElementBlock("div",null,[e.createTextVNode(e.toDisplayString(t.prop[t.content])+" ",1),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":o[0]||(o[0]=c=>t.prop[t.content]=c),placeholder:t.placeholder?t.placeholder:"Enter text",onInput:p,onFocus:o[1]||(o[1]=c=>i("focus",r.value)),ref_key:"textarea",ref:r,tabindex:"-1",class:"text-area mn-small"},`
2
2
  `,40,f),[[e.vModelText,t.prop[t.content]]])]))}};exports.default=h;
@@ -1,4 +1,4 @@
1
- import { ref as d, onUpdated as f, onMounted as h, watch as x, openBlock as m, createElementBlock as v, createTextVNode as g, toDisplayString as k, withDirectives as B, createElementVNode as b, vModelText as y } from "vue";
1
+ import { ref as d, onUpdated as f, onMounted as x, watch as h, openBlock as m, createElementBlock as v, createTextVNode as g, toDisplayString as k, withDirectives as B, createElementVNode as b, vModelText as y } from "vue";
2
2
  const E = ["placeholder"], I = {
3
3
  __name: "Bullets",
4
4
  props: ["obj", "label", "prop", "value", "content", "textarea", "placeholder", "index", "ref"],
@@ -20,9 +20,9 @@ const E = ["placeholder"], I = {
20
20
  }
21
21
  return f(() => {
22
22
  a();
23
- }), h(() => {
23
+ }), x(() => {
24
24
  a();
25
- }), x(() => t.prop[t.content], (l) => {
25
+ }), h(() => t.prop[t.content], (l) => {
26
26
  (!l || l.length === 0) && u("deleteBlock", t.prop);
27
27
  }), (l, n) => (m(), v("div", null, [
28
28
  g(k(e.prop[e.content]) + " ", 1),
@@ -33,6 +33,7 @@ const E = ["placeholder"], I = {
33
33
  onFocus: n[1] || (n[1] = (r) => u("focus", o.value)),
34
34
  ref_key: "textarea",
35
35
  ref: o,
36
+ tabindex: "-1",
36
37
  class: "text-area mn-small"
37
38
  }, `
38
39
  `, 40, E), [
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),f=["placeholder"],h={__name:"Caption",props:["obj","label","prop","value","content","textarea","placeholder","index","ref"],emits:["deleteBlock","addBlock","focus"],setup(l,{emit:s}){const t=l;e.ref(t);const r=e.ref(null);function p(n){const o=/^\s*[-*]\s+(.*)/;let i=n.target.value.split(/\n+/).map(u=>{const d=o.exec(u);return d?d[1]:null}).filter(u=>u!==null);i.length>0?(t.prop[t.content]=i,a()):n.target.value.trim()===""&&(t.prop[t.content]=[],a())}function a(){r.value.style.height="1rem",r.value.style.height=r.value.scrollHeight+"px"}return e.onUpdated(()=>{a()}),e.onMounted(()=>{a()}),e.watch(()=>t.prop[t.content],n=>{(!n||n.length===0)&&s("deleteBlock",t.prop)}),(n,o)=>(e.openBlock(),e.createElementBlock("div",null,[e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":o[0]||(o[0]=c=>l.prop[l.content]=c),placeholder:l.placeholder?l.placeholder:"Enter text",onInput:p,onFocus:o[1]||(o[1]=c=>s("focus",r.value)),ref_key:"textarea",ref:r,class:"br-l br-solid br-main pd-l-small text-area mn-small"},`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),f=["placeholder"],h={__name:"Caption",props:["obj","label","prop","value","content","textarea","placeholder","index","ref"],emits:["deleteBlock","addBlock","focus"],setup(l,{emit:i}){const t=l;e.ref(t);const r=e.ref(null);function p(n){const o=/^\s*[-*]\s+(.*)/;let s=n.target.value.split(/\n+/).map(u=>{const d=o.exec(u);return d?d[1]:null}).filter(u=>u!==null);s.length>0?(t.prop[t.content]=s,a()):n.target.value.trim()===""&&(t.prop[t.content]=[],a())}function a(){r.value.style.height="1rem",r.value.style.height=r.value.scrollHeight+"px"}return e.onUpdated(()=>{a()}),e.onMounted(()=>{a()}),e.watch(()=>t.prop[t.content],n=>{(!n||n.length===0)&&i("deleteBlock",t.prop)}),(n,o)=>(e.openBlock(),e.createElementBlock("div",null,[e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":o[0]||(o[0]=c=>l.prop[l.content]=c),placeholder:l.placeholder?l.placeholder:"Enter text",onInput:p,onFocus:o[1]||(o[1]=c=>i("focus",r.value)),ref_key:"textarea",ref:r,tabindex:"-1",class:"br-l br-solid br-main pd-l-small text-area mn-small"},`
2
2
  `,40,f),[[e.vModelText,l.prop[l.content]]])]))}};exports.default=h;
@@ -1,19 +1,19 @@
1
- import { ref as p, onUpdated as f, onMounted as m, watch as h, openBlock as x, createElementBlock as v, withDirectives as g, createElementVNode as b, vModelText as k } from "vue";
1
+ import { ref as d, onUpdated as f, onMounted as m, watch as h, openBlock as x, createElementBlock as v, withDirectives as b, createElementVNode as g, vModelText as k } from "vue";
2
2
  const B = ["placeholder"], E = {
3
3
  __name: "Caption",
4
4
  props: ["obj", "label", "prop", "value", "content", "textarea", "placeholder", "index", "ref"],
5
5
  emits: ["deleteBlock", "addBlock", "focus"],
6
- setup(t, { emit: s }) {
6
+ setup(t, { emit: i }) {
7
7
  const e = t;
8
- p(e);
9
- const o = p(null);
10
- function d(l) {
8
+ d(e);
9
+ const o = d(null);
10
+ function p(l) {
11
11
  const n = /^\s*[-*]\s+(.*)/;
12
- let i = l.target.value.split(/\n+/).map((c) => {
12
+ let s = l.target.value.split(/\n+/).map((c) => {
13
13
  const u = n.exec(c);
14
14
  return u ? u[1] : null;
15
15
  }).filter((c) => c !== null);
16
- i.length > 0 ? (e.prop[e.content] = i, a()) : l.target.value.trim() === "" && (e.prop[e.content] = [], a());
16
+ s.length > 0 ? (e.prop[e.content] = s, a()) : l.target.value.trim() === "" && (e.prop[e.content] = [], a());
17
17
  }
18
18
  function a() {
19
19
  o.value.style.height = "1rem", o.value.style.height = o.value.scrollHeight + "px";
@@ -23,15 +23,16 @@ const B = ["placeholder"], E = {
23
23
  }), m(() => {
24
24
  a();
25
25
  }), h(() => e.prop[e.content], (l) => {
26
- (!l || l.length === 0) && s("deleteBlock", e.prop);
26
+ (!l || l.length === 0) && i("deleteBlock", e.prop);
27
27
  }), (l, n) => (x(), v("div", null, [
28
- g(b("textarea", {
28
+ b(g("textarea", {
29
29
  "onUpdate:modelValue": n[0] || (n[0] = (r) => t.prop[t.content] = r),
30
30
  placeholder: t.placeholder ? t.placeholder : "Enter text",
31
- onInput: d,
32
- onFocus: n[1] || (n[1] = (r) => s("focus", o.value)),
31
+ onInput: p,
32
+ onFocus: n[1] || (n[1] = (r) => i("focus", o.value)),
33
33
  ref_key: "textarea",
34
34
  ref: o,
35
+ tabindex: "-1",
35
36
  class: "br-l br-solid br-main pd-l-small text-area mn-small"
36
37
  }, `
37
38
  `, 40, B), [