@ozdao/prometheus-framework 0.1.82 → 0.1.83

Sign up to get free protection for your applications and to get access to all the features.
Files changed (175) hide show
  1. package/dist/node_modules/vue-draggable-next/dist/vue-draggable-next.esm-bundler.cjs +4 -4
  2. package/dist/node_modules/vue-draggable-next/dist/vue-draggable-next.esm-bundler.js +3 -3
  3. package/dist/prometheus-framework/node_modules/@vuepic/vue-datepicker/dist/vue-datepicker.cjs +1 -1
  4. package/dist/prometheus-framework/node_modules/@vuepic/vue-datepicker/dist/vue-datepicker.js +2981 -2804
  5. package/dist/prometheus-framework/node_modules/date-fns/esm/getQuarter/index.cjs +1 -0
  6. package/dist/prometheus-framework/node_modules/date-fns/esm/getQuarter/index.js +10 -0
  7. package/dist/prometheus-framework/node_modules/libphonenumber-js/es6/helpers/getNumberType.cjs +2 -2
  8. package/dist/prometheus-framework/node_modules/libphonenumber-js/es6/helpers/getNumberType.js +26 -26
  9. package/dist/prometheus-framework/node_modules/libphonenumber-js/es6/helpers/isObject.cjs +1 -0
  10. package/dist/prometheus-framework/node_modules/libphonenumber-js/es6/helpers/isObject.js +7 -0
  11. package/dist/prometheus-framework/node_modules/libphonenumber-js/es6/metadata.cjs +1 -1
  12. package/dist/prometheus-framework/node_modules/libphonenumber-js/es6/metadata.js +28 -29
  13. package/dist/prometheus-framework/node_modules/libphonenumber-js/es6/normalizeArguments.cjs +2 -2
  14. package/dist/prometheus-framework/node_modules/libphonenumber-js/es6/normalizeArguments.js +55 -65
  15. package/dist/prometheus-framework/node_modules/libphonenumber-js/metadata.min.json.cjs +1 -1
  16. package/dist/prometheus-framework/node_modules/libphonenumber-js/metadata.min.json.js +1 -1
  17. package/dist/prometheus-framework/src/components/Address/Address.vue.cjs +1 -1
  18. package/dist/prometheus-framework/src/components/Address/Address.vue.js +23 -23
  19. package/dist/prometheus-framework/src/components/Breadcrumbs/Breadcrumbs.vue2.cjs +1 -1
  20. package/dist/prometheus-framework/src/components/Breadcrumbs/Breadcrumbs.vue2.js +31 -31
  21. package/dist/prometheus-framework/src/components/Button/Button.vue.cjs +1 -1
  22. package/dist/prometheus-framework/src/components/Button/Button.vue.js +2 -224
  23. package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
  24. package/dist/prometheus-framework/src/components/Button/Button.vue2.js +224 -2
  25. package/dist/prometheus-framework/src/components/Checkbox/Checkbox.vue.cjs +1 -1
  26. package/dist/prometheus-framework/src/components/Checkbox/Checkbox.vue.js +22 -22
  27. package/dist/prometheus-framework/src/components/DatePicker/DatePicker.vue.cjs +1 -1
  28. package/dist/prometheus-framework/src/components/DatePicker/DatePicker.vue.js +18 -18
  29. package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue.cjs +1 -1
  30. package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue.js +49 -2
  31. package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue2.cjs +1 -1
  32. package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue2.js +2 -49
  33. package/dist/prometheus-framework/src/components/EditImages/EditImages.vue.cjs +1 -1
  34. package/dist/prometheus-framework/src/components/EditImages/EditImages.vue.js +24 -24
  35. package/dist/prometheus-framework/src/components/Field/Field.vue.cjs +1 -1
  36. package/dist/prometheus-framework/src/components/Field/Field.vue.js +2 -76
  37. package/dist/prometheus-framework/src/components/Field/Field.vue2.cjs +1 -1
  38. package/dist/prometheus-framework/src/components/Field/Field.vue2.js +76 -2
  39. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.cjs +1 -1
  40. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.js +31 -30
  41. package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone.vue.js +1 -1
  42. package/dist/prometheus-framework/src/components/FieldTags/BlockTags.vue.cjs +1 -1
  43. package/dist/prometheus-framework/src/components/FieldTags/BlockTags.vue.js +20 -20
  44. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue.cjs +1 -1
  45. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue.js +33 -33
  46. package/dist/prometheus-framework/src/components/Popup/Popup.vue.cjs +1 -1
  47. package/dist/prometheus-framework/src/components/Popup/Popup.vue.js +2 -72
  48. package/dist/prometheus-framework/src/components/Popup/Popup.vue2.cjs +1 -1
  49. package/dist/prometheus-framework/src/components/Popup/Popup.vue2.js +72 -2
  50. package/dist/prometheus-framework/src/components/Select/Select.vue.cjs +1 -1
  51. package/dist/prometheus-framework/src/components/Select/Select.vue.js +2 -78
  52. package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
  53. package/dist/prometheus-framework/src/components/Select/Select.vue2.js +78 -2
  54. package/dist/prometheus-framework/src/components/Tab/Tab.vue.cjs +1 -1
  55. package/dist/prometheus-framework/src/components/Tab/Tab.vue.js +2 -44
  56. package/dist/prometheus-framework/src/components/Tab/Tab.vue2.cjs +1 -1
  57. package/dist/prometheus-framework/src/components/Tab/Tab.vue2.js +44 -2
  58. package/dist/prometheus-framework/src/components/Text/Text.vue.cjs +1 -1
  59. package/dist/prometheus-framework/src/components/Text/Text.vue.js +11 -11
  60. package/dist/prometheus-framework/src/components/Upload/Upload.vue.cjs +1 -1
  61. package/dist/prometheus-framework/src/components/Upload/Upload.vue.js +27 -27
  62. package/dist/prometheus-framework/src/components/UploadImage/UploadImage.vue.cjs +1 -1
  63. package/dist/prometheus-framework/src/components/UploadImage/UploadImage.vue.js +18 -18
  64. package/dist/prometheus-framework/src/components/UploadImageMultiple/UploadImageMultiple.vue.cjs +1 -1
  65. package/dist/prometheus-framework/src/components/UploadImageMultiple/UploadImageMultiple.vue.js +17 -17
  66. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.cjs +1 -1
  67. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.js +3 -3
  68. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.cjs +1 -1
  69. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.js +1 -1
  70. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.cjs +1 -1
  71. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +3 -3
  72. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.cjs +1 -1
  73. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +3 -3
  74. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.cjs +1 -1
  75. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +3 -3
  76. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
  77. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +44 -43
  78. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.cjs +1 -1
  79. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +3 -3
  80. package/dist/prometheus-framework/src/modules/auth/store/auth.cjs +1 -1
  81. package/dist/prometheus-framework/src/modules/auth/store/auth.js +55 -65
  82. package/dist/prometheus-framework/src/modules/community/components/blocks/CardBlogpost.vue.cjs +1 -1
  83. package/dist/prometheus-framework/src/modules/community/components/blocks/CardBlogpost.vue.js +24 -24
  84. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +1 -1
  85. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +1 -1
  86. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  87. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +3 -3
  88. package/dist/prometheus-framework/src/modules/constructor/components/elements/Audio.vue.cjs +1 -1
  89. package/dist/prometheus-framework/src/modules/constructor/components/elements/Audio.vue.js +19 -19
  90. package/dist/prometheus-framework/src/modules/constructor/components/elements/Bullets.vue.cjs +2 -2
  91. package/dist/prometheus-framework/src/modules/constructor/components/elements/Bullets.vue.js +16 -16
  92. package/dist/prometheus-framework/src/modules/constructor/components/elements/Caption.vue.cjs +1 -1
  93. package/dist/prometheus-framework/src/modules/constructor/components/elements/Caption.vue.js +13 -13
  94. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.cjs +1 -1
  95. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.js +16 -16
  96. package/dist/prometheus-framework/src/modules/constructor/components/elements/H2.vue.cjs +3 -3
  97. package/dist/prometheus-framework/src/modules/constructor/components/elements/H2.vue.js +30 -30
  98. package/dist/prometheus-framework/src/modules/constructor/components/elements/ImageUpload.vue.cjs +1 -1
  99. package/dist/prometheus-framework/src/modules/constructor/components/elements/ImageUpload.vue.js +22 -22
  100. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +1 -4
  101. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +2 -62
  102. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +4 -1
  103. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +62 -2
  104. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.cjs +1 -1
  105. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.js +56 -56
  106. package/dist/prometheus-framework/src/modules/events/components/blocks/CardEvent.vue.cjs +1 -1
  107. package/dist/prometheus-framework/src/modules/events/components/blocks/CardEvent.vue.js +44 -43
  108. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.cjs +1 -1
  109. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.js +15 -15
  110. package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.cjs +1 -1
  111. package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.js +1 -1
  112. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  113. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +14 -14
  114. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
  115. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +4 -4
  116. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  117. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +51 -53
  118. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
  119. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +59 -61
  120. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
  121. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +2 -2
  122. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
  123. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +2 -2
  124. package/dist/prometheus-framework/src/modules/organizations/components/blocks/Contacts.vue.cjs +1 -1
  125. package/dist/prometheus-framework/src/modules/organizations/components/blocks/Contacts.vue.js +22 -22
  126. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
  127. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +25 -25
  128. package/dist/prometheus-framework/src/modules/organizations/components/blocks/EditArray.vue.cjs +1 -1
  129. package/dist/prometheus-framework/src/modules/organizations/components/blocks/EditArray.vue.js +9 -9
  130. package/dist/prometheus-framework/src/modules/organizations/components/blocks/Socials.vue.cjs +1 -1
  131. package/dist/prometheus-framework/src/modules/organizations/components/blocks/Socials.vue.js +23 -23
  132. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.cjs +1 -1
  133. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +11 -11
  134. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  135. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +5 -5
  136. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
  137. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +4 -4
  138. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  139. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +5 -5
  140. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.cjs +1 -1
  141. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.js +1 -1
  142. package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.cjs +1 -1
  143. package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.js +1 -1
  144. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  145. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +3 -3
  146. package/dist/prometheus-framework/src/modules/organizations/components/sections/FeedDepartments.vue.cjs +1 -1
  147. package/dist/prometheus-framework/src/modules/organizations/components/sections/FeedDepartments.vue.js +19 -19
  148. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  149. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +3 -3
  150. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersList.vue.cjs +1 -1
  151. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersList.vue.js +30 -30
  152. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  153. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +6 -6
  154. package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.cjs +1 -1
  155. package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.js +24 -24
  156. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  157. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +3 -3
  158. package/dist/prometheus-framework/src/modules/spots/components/sections/Feed.vue.cjs +1 -1
  159. package/dist/prometheus-framework/src/modules/spots/components/sections/Feed.vue.js +21 -21
  160. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
  161. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +3 -3
  162. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.cjs +1 -1
  163. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.js +1 -1
  164. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +1 -1
  165. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +3 -3
  166. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.cjs +1 -1
  167. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.js +1 -1
  168. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileOrganizations.vue.cjs +1 -1
  169. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileOrganizations.vue.js +1 -1
  170. package/dist/prometheus-framework.cjs.js +27 -27
  171. package/dist/prometheus-framework.es.js +1949 -1937
  172. package/dist/style.css +1 -1
  173. package/package.json +2 -4
  174. package/src/modules/auth/components/pages/SignIn.vue +1 -0
  175. package/src/modules/auth/store/auth.js +2 -11
@@ -2,7 +2,7 @@ import m from "../../../../node_modules/axios/lib/axios.js";
2
2
  import d from "../../../../../node_modules/js-cookie/src/js.cookie.js";
3
3
  import { CapacitorCookies as l } from "../../../../node_modules/@capacitor/core/dist/index.js";
4
4
  import { reactive as w, watch as f } from "vue";
5
- import { setError as c } from "../../globals/store/globals.js";
5
+ import { setError as n } from "../../globals/store/globals.js";
6
6
  import { state as k } from "./twofa.js";
7
7
  const i = m.create({ baseURL: process.env.API_URL, withCredentials: !0 }), a = w({
8
8
  user: {
@@ -20,51 +20,51 @@ const i = m.create({ baseURL: process.env.API_URL, withCredentials: !0 }), a = w
20
20
  }
21
21
  });
22
22
  async function O() {
23
- const s = await g("user");
24
- if (s) {
25
- const { _id: t, email: e, phone: n, roles: r, accessToken: o } = s;
26
- Object.assign(a.user, { _id: t, email: e, phone: n }), 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));
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
27
  }
28
28
  }
29
29
  O();
30
- const R = {
31
- async login(s, t) {
30
+ const S = {
31
+ async login(e, t) {
32
32
  try {
33
- const e = await i.post("/api/auth/signin", {
34
- ...s,
33
+ const s = await i.post("/api/auth/signin", {
34
+ ...e,
35
35
  type: t
36
36
  });
37
- return u("user", e.data), Object.assign(a.user, {
38
- ...e.data
37
+ return u("user", s.data), Object.assign(a.user, {
38
+ ...s.data
39
39
  }), Object.assign(a.access, {
40
- token: e.data.accessToken,
40
+ token: s.data.accessToken,
41
41
  status: !0,
42
- roles: e.data.roles
43
- }), e.data;
44
- } catch (e) {
42
+ roles: s.data.roles
43
+ }), s.data;
44
+ } catch (s) {
45
45
  return Object.assign(a.access, {
46
46
  token: null,
47
47
  status: !1,
48
48
  roles: null
49
- }), c(e), Promise.reject(e);
49
+ }), n(s), Promise.reject(s);
50
50
  }
51
51
  },
52
- async signup(s, t, e) {
53
- const { password: n, passwordRepeat: r } = a.user;
54
- if (n !== r) {
52
+ async signup(e, t, s) {
53
+ const { password: c, passwordRepeat: r } = a.user;
54
+ if (c !== r) {
55
55
  const o = {
56
56
  response: {
57
57
  data: { errorCode: "PASSWORDS_DO_NOT_MATCH" }
58
58
  }
59
59
  };
60
- throw c(o), new Error(o.response.status);
60
+ throw n(o), new Error(o.response.status);
61
61
  }
62
62
  try {
63
- s.phone = s.phone.number;
63
+ e.phone = e.phone.number;
64
64
  const o = await i.post("/api/auth/signup", {
65
- ...s,
65
+ ...e,
66
66
  type: t,
67
- inviteCode: e
67
+ inviteCode: s
68
68
  });
69
69
  return o.data.accessToken && u("user", o.data), Object.assign(a.user, {
70
70
  ...o.data
@@ -74,7 +74,7 @@ const R = {
74
74
  roles: o.data.roles
75
75
  }), o.data;
76
76
  } catch (o) {
77
- throw c(o), console.log("Sign up falied"), o;
77
+ throw n(o), console.log("Sign up falied"), o;
78
78
  }
79
79
  },
80
80
  logout() {
@@ -88,37 +88,37 @@ const R = {
88
88
  status: !1
89
89
  });
90
90
  },
91
- async resetPassword(s, t) {
91
+ async resetPassword(e, t) {
92
92
  try {
93
- const e = await i.post("/api/auth/reset-password", {
94
- email: s.email,
95
- phone: s.phone.number,
93
+ const s = await i.post("/api/auth/reset-password", {
94
+ email: e.email,
95
+ phone: e.phone.number,
96
96
  type: t
97
97
  });
98
98
  return Object.assign(k.code, {
99
- ...e.data,
99
+ ...s.data,
100
100
  isSended: !0
101
- }), e.data;
102
- } catch (e) {
103
- return c(e), Promise.reject(e);
101
+ }), s.data;
102
+ } catch (s) {
103
+ return n(s), Promise.reject(s);
104
104
  }
105
105
  },
106
- async updatePassword(s, t) {
107
- const { password: e, passwordRepeat: n } = a.user;
108
- if (e !== n) {
106
+ async updatePassword(e, t) {
107
+ const { password: s, passwordRepeat: c } = a.user;
108
+ if (s !== c) {
109
109
  const r = {
110
110
  response: {
111
111
  data: { errorCode: "PASSWORDS_DO_NOT_MATCH" }
112
112
  }
113
113
  };
114
- throw c(r), new Error(r.response.status);
114
+ throw n(r), new Error(r.response.status);
115
115
  }
116
116
  try {
117
117
  const r = await i.post("/api/auth/update-password", {
118
- email: s.email,
119
- phone: s.phone.number,
120
- password: s.password,
121
- passwordRepeat: s.passwordRepeat,
118
+ email: e.email,
119
+ phone: e.phone.number,
120
+ password: e.password,
121
+ passwordRepeat: e.passwordRepeat,
122
122
  type: t
123
123
  });
124
124
  return r.data.accessToken && u("user", r.data), Object.assign(a.user, {
@@ -128,54 +128,44 @@ const R = {
128
128
  status: !0
129
129
  }), r.data;
130
130
  } catch (r) {
131
- return c(r), Promise.reject(r);
131
+ return n(r), Promise.reject(r);
132
132
  }
133
133
  }
134
- }, h = {
134
+ }, g = {
135
135
  development: { secure: !1, expires: 1 },
136
136
  production: { expires: 1, domain: process.env.API_URL, sameSite: "none", secure: !0 }
137
137
  };
138
- function g(s) {
138
+ function h(e) {
139
139
  if (process.env.MOBILE_APP)
140
- Object.fromEntries(
141
- document.cookie.split("/; *").map((t) => {
142
- const [e, ...n] = t.split("=");
143
- return [
144
- {
145
- key: e,
146
- value: n.join("=")
147
- }
148
- ];
149
- })
150
- );
151
- else {
152
- const t = d.get(s);
140
+ return l.getCookies();
141
+ {
142
+ const t = d.get(e);
153
143
  return t ? JSON.parse(t) : null;
154
144
  }
155
145
  }
156
- function u(s, t, e = process.env.NODE_ENV) {
146
+ function u(e, t, s = process.env.NODE_ENV) {
157
147
  process.env.MOBILE_APP ? l.setCookie({
158
148
  url: process.env.API_URL,
159
149
  // используйте ваш API_URL
160
- key: s,
150
+ key: e,
161
151
  value: JSON.stringify(t)
162
- }) : d.set(s, JSON.stringify(t), h[e]);
152
+ }) : d.set(e, JSON.stringify(t), g[s]);
163
153
  }
164
- function P(s, t = process.env.NODE_ENV) {
154
+ function P(e, t = process.env.NODE_ENV) {
165
155
  if (process.env.MOBILE_APP)
166
156
  l.deleteCookie({
167
157
  url: process.env.API_URL,
168
158
  // используйте ваш API_URL
169
- key: s
159
+ key: e
170
160
  });
171
161
  else {
172
- const e = t === "production" ? { domain: process.env.API_URL } : {};
173
- d.remove(s, e);
162
+ const s = t === "production" ? { domain: process.env.API_URL } : {};
163
+ d.remove(e, s);
174
164
  }
175
165
  }
176
- f(a, (s, t) => {
166
+ f(a, (e, t) => {
177
167
  });
178
168
  export {
179
- R as actions,
169
+ S as actions,
180
170
  a as state
181
171
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("../../../globals/components/blocks/CardHeader.vue.cjs"),i=require("./FooterBlogpost.vue.cjs"),d=require("../../../../components/Chips/Chips.vue.cjs"),m=require("../../../icons/navigation/IconEdit.vue.cjs"),g=require("vue-router"),p={class:"pos-relative bg-grey radius-big"},b=["src"],f={class:"pd-t-zero pd-medium"},y={key:0,class:"cursor-pointer mn-thin flex-nowrap flex w-100"},k={key:0,class:"pd-micro t-white uppercase t-semi p-small flex-center flex pd-r-small pd-l-small mn-l-thin w-min bg-second radius-extra"},h={key:1,class:"mn-small t-transp p-big"},B={key:2,class:"mn-small h2"},C={__name:"CardBlogpost",props:["blogpost","user","type"],setup(t){const n=t,a=g.useRouter(),s=e.computed(()=>n.blogpost.content.find(o=>o.type==="ImageUpload")),r=e.computed(()=>n.blogpost.content.find(o=>o.type==="Textarea"));return(o,l)=>(e.openBlock(),e.createElementBlock("article",p,[t.user&&t.user===t.blogpost.creator.target._id?(e.openBlock(),e.createBlock(m.default,{key:0,onClick:l[0]||(l[0]=e.withModifiers(c=>o.$router.push({name:"Edit BlogPost",params:{url:t.blogpost.url}}),["stop"])),class:"z-index-2 pos-absolute pos-t-regular pos-r-regular i-regular t-transp"})):e.createCommentVNode("",!0),e.createVNode(u.default,{class:e.normalizeClass({"mn-small pd-medium":t.type!=="short","flex-child-order-last flex-child mn-l-small":t.type==="short"}),entity:t.blogpost,entityType:"blogpost",user:t.user,owner:t.blogpost.owner,creator:t.blogpost.creator,date:t.blogpost.createdAt},null,8,["class","entity","user","owner","creator","date"]),e.unref(s)&&e.unref(s).content&&t.type!=="blogpostPage"?(e.openBlock(),e.createElementBlock("img",{key:1,src:(o.FILE_SERVER_URL||"")+e.unref(s).content,alt:"Blog post image",class:"mn-medium object-fit-cover w-100 h-20r"},null,8,b)):e.createCommentVNode("",!0),e.createElementVNode("section",f,[t.type!=="blogpostPage"?(e.openBlock(),e.createElementBlock("div",y,[e.createElementVNode("h3",{onClick:l[1]||(l[1]=c=>e.unref(a).push({name:"BlogPost",params:{url:t.blogpost.url}})),class:""},e.toDisplayString(t.blogpost.name),1),t.blogpost.status==="draft"?(e.openBlock(),e.createElementBlock("div",k,e.toDisplayString(t.blogpost.status),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.unref(r)&&e.unref(r).content&&t.type!=="blogpostPage"?(e.openBlock(),e.createElementBlock("p",h,e.toDisplayString(e.unref(r).content.slice(0,120))+"... ",1)):e.createCommentVNode("",!0),t.type==="blogpostPage"?(e.openBlock(),e.createElementBlock("h3",B,e.toDisplayString(t.blogpost.name),1)):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"default"),t.type!=="short"&&t.blogpost.tags.length>0?(e.openBlock(),e.createBlock(d.default,{key:3,chips:t.blogpost.tags},null,8,["chips"])):e.createCommentVNode("",!0)]),e.createVNode(i.default,{class:"pd-t-zero pd-medium",blogpost:t.blogpost,user:t.user},null,8,["blogpost","user"])]))}};exports.default=C;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("../../../globals/components/blocks/CardHeader.vue.cjs"),i=require("./FooterBlogpost.vue.cjs"),d=require("../../../../components/Chips/Chips.vue.cjs"),m=require("../../../icons/navigation/IconEdit.vue.cjs"),g=require("vue-router"),p={class:"pos-relative bg-grey radius-big"},b=["src"],y={class:"pd-t-zero pd-medium"},k={key:0,class:"cursor-pointer mn-thin flex-nowrap flex w-100"},h={key:0,class:"pd-micro t-white uppercase t-semi p-small flex-center flex pd-r-small pd-l-small mn-l-thin w-min bg-second radius-extra"},f={key:1,class:"mn-small t-transp p-big"},B={key:2,class:"mn-small h2"},v={__name:"CardBlogpost",props:["blogpost","user","type"],setup(t){const a=g.useRouter(),n=t,s=e.computed(()=>n.blogpost.content.find(o=>o.type==="ImageUpload")),r=e.computed(()=>n.blogpost.content.find(o=>o.type==="Textarea"));return(o,l)=>(e.openBlock(),e.createElementBlock("article",p,[t.user&&t.user===t.blogpost.creator.target._id?(e.openBlock(),e.createBlock(m.default,{key:0,onClick:l[0]||(l[0]=e.withModifiers(c=>o.$router.push({name:"Edit BlogPost",params:{url:t.blogpost.url}}),["stop"])),class:"z-index-2 pos-absolute pos-t-regular pos-r-regular i-regular t-transp"})):e.createCommentVNode("",!0),e.createVNode(u.default,{class:e.normalizeClass({"mn-small pd-medium":t.type!=="short","flex-child-order-last flex-child mn-l-small":t.type==="short"}),entity:t.blogpost,entityType:"blogpost",user:t.user,owner:t.blogpost.owner,creator:t.blogpost.creator,date:t.blogpost.createdAt},null,8,["class","entity","user","owner","creator","date"]),s.value&&s.value.content&&t.type!=="blogpostPage"?(e.openBlock(),e.createElementBlock("img",{key:1,src:(o.FILE_SERVER_URL||"")+s.value.content,alt:"Blog post image",class:"mn-medium object-fit-cover w-100 h-20r"},null,8,b)):e.createCommentVNode("",!0),e.createElementVNode("section",y,[t.type!=="blogpostPage"?(e.openBlock(),e.createElementBlock("div",k,[e.createElementVNode("h3",{onClick:l[1]||(l[1]=c=>e.unref(a).push({name:"BlogPost",params:{url:t.blogpost.url}})),class:""},e.toDisplayString(t.blogpost.name),1),t.blogpost.status==="draft"?(e.openBlock(),e.createElementBlock("div",h,e.toDisplayString(t.blogpost.status),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),r.value&&r.value.content&&t.type!=="blogpostPage"?(e.openBlock(),e.createElementBlock("p",f,e.toDisplayString(r.value.content.slice(0,120))+"... ",1)):e.createCommentVNode("",!0),t.type==="blogpostPage"?(e.openBlock(),e.createElementBlock("h3",B,e.toDisplayString(t.blogpost.name),1)):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"default"),t.type!=="short"&&t.blogpost.tags.length>0?(e.openBlock(),e.createBlock(d.default,{key:3,chips:t.blogpost.tags},null,8,["chips"])):e.createCommentVNode("",!0)]),e.createVNode(i.default,{class:"pd-t-zero pd-medium",blogpost:t.blogpost,user:t.user},null,8,["blogpost","user"])]))}};exports.default=v;
@@ -1,10 +1,10 @@
1
- import { computed as u, openBlock as e, createElementBlock as r, createBlock as g, withModifiers as y, createCommentVNode as s, createVNode as d, normalizeClass as h, unref as l, createElementVNode as p, toDisplayString as a, renderSlot as k } from "vue";
2
- import w from "../../../globals/components/blocks/CardHeader.vue.js";
3
- import x from "./FooterBlogpost.vue.js";
4
- import B from "../../../../components/Chips/Chips.vue.js";
5
- import E from "../../../icons/navigation/IconEdit.vue.js";
6
- import { useRouter as $ } from "vue-router";
7
- const v = { class: "pos-relative bg-grey radius-big" }, P = ["src"], C = { class: "pd-t-zero pd-medium" }, z = {
1
+ import { computed as u, openBlock as e, createElementBlock as l, createBlock as m, withModifiers as f, createCommentVNode as s, createVNode as g, normalizeClass as y, createElementVNode as d, unref as h, toDisplayString as a, renderSlot as k } from "vue";
2
+ import v from "../../../globals/components/blocks/CardHeader.vue.js";
3
+ import w from "./FooterBlogpost.vue.js";
4
+ import x from "../../../../components/Chips/Chips.vue.js";
5
+ import B from "../../../icons/navigation/IconEdit.vue.js";
6
+ import { useRouter as E } from "vue-router";
7
+ const $ = { class: "pos-relative bg-grey radius-big" }, P = ["src"], C = { class: "pd-t-zero pd-medium" }, z = {
8
8
  key: 0,
9
9
  class: "cursor-pointer mn-thin flex-nowrap flex w-100"
10
10
  }, I = {
@@ -20,11 +20,11 @@ const v = { class: "pos-relative bg-grey radius-big" }, P = ["src"], C = { class
20
20
  __name: "CardBlogpost",
21
21
  props: ["blogpost", "user", "type"],
22
22
  setup(t) {
23
- const m = t, b = $(), i = u(() => m.blogpost.content.find((o) => o.type === "ImageUpload")), c = u(() => m.blogpost.content.find((o) => o.type === "Textarea"));
24
- return (o, n) => (e(), r("article", v, [
25
- t.user && t.user === t.blogpost.creator.target._id ? (e(), g(E, {
23
+ const p = E(), c = t, n = u(() => c.blogpost.content.find((o) => o.type === "ImageUpload")), i = u(() => c.blogpost.content.find((o) => o.type === "Textarea"));
24
+ return (o, r) => (e(), l("article", $, [
25
+ t.user && t.user === t.blogpost.creator.target._id ? (e(), m(B, {
26
26
  key: 0,
27
- onClick: n[0] || (n[0] = y((f) => o.$router.push({
27
+ onClick: r[0] || (r[0] = f((b) => o.$router.push({
28
28
  name: "Edit BlogPost",
29
29
  params: {
30
30
  url: t.blogpost.url
@@ -32,8 +32,8 @@ const v = { class: "pos-relative bg-grey radius-big" }, P = ["src"], C = { class
32
32
  }), ["stop"])),
33
33
  class: "z-index-2 pos-absolute pos-t-regular pos-r-regular i-regular t-transp"
34
34
  })) : s("", !0),
35
- d(w, {
36
- class: h({
35
+ g(v, {
36
+ class: y({
37
37
  "mn-small pd-medium": t.type !== "short",
38
38
  "flex-child-order-last flex-child mn-l-small": t.type === "short"
39
39
  }),
@@ -44,16 +44,16 @@ const v = { class: "pos-relative bg-grey radius-big" }, P = ["src"], C = { class
44
44
  creator: t.blogpost.creator,
45
45
  date: t.blogpost.createdAt
46
46
  }, null, 8, ["class", "entity", "user", "owner", "creator", "date"]),
47
- l(i) && l(i).content && t.type !== "blogpostPage" ? (e(), r("img", {
47
+ n.value && n.value.content && t.type !== "blogpostPage" ? (e(), l("img", {
48
48
  key: 1,
49
- src: (o.FILE_SERVER_URL || "") + l(i).content,
49
+ src: (o.FILE_SERVER_URL || "") + n.value.content,
50
50
  alt: "Blog post image",
51
51
  class: "mn-medium object-fit-cover w-100 h-20r"
52
52
  }, null, 8, P)) : s("", !0),
53
- p("section", C, [
54
- t.type !== "blogpostPage" ? (e(), r("div", z, [
55
- p("h3", {
56
- onClick: n[1] || (n[1] = (f) => l(b).push({
53
+ d("section", C, [
54
+ t.type !== "blogpostPage" ? (e(), l("div", z, [
55
+ d("h3", {
56
+ onClick: r[1] || (r[1] = (b) => h(p).push({
57
57
  name: "BlogPost",
58
58
  params: {
59
59
  url: t.blogpost.url
@@ -61,17 +61,17 @@ const v = { class: "pos-relative bg-grey radius-big" }, P = ["src"], C = { class
61
61
  })),
62
62
  class: ""
63
63
  }, a(t.blogpost.name), 1),
64
- t.blogpost.status === "draft" ? (e(), r("div", I, a(t.blogpost.status), 1)) : s("", !0)
64
+ t.blogpost.status === "draft" ? (e(), l("div", I, a(t.blogpost.status), 1)) : s("", !0)
65
65
  ])) : s("", !0),
66
- l(c) && l(c).content && t.type !== "blogpostPage" ? (e(), r("p", R, a(l(c).content.slice(0, 120)) + "... ", 1)) : s("", !0),
67
- t.type === "blogpostPage" ? (e(), r("h3", V, a(t.blogpost.name), 1)) : s("", !0),
66
+ i.value && i.value.content && t.type !== "blogpostPage" ? (e(), l("p", R, a(i.value.content.slice(0, 120)) + "... ", 1)) : s("", !0),
67
+ t.type === "blogpostPage" ? (e(), l("h3", V, a(t.blogpost.name), 1)) : s("", !0),
68
68
  k(o.$slots, "default"),
69
- t.type !== "short" && t.blogpost.tags.length > 0 ? (e(), g(B, {
69
+ t.type !== "short" && t.blogpost.tags.length > 0 ? (e(), m(x, {
70
70
  key: 3,
71
71
  chips: t.blogpost.tags
72
72
  }, null, 8, ["chips"])) : s("", !0)
73
73
  ]),
74
- d(x, {
74
+ g(w, {
75
75
  class: "pd-t-zero pd-medium",
76
76
  blogpost: t.blogpost,
77
77
  user: t.user
@@ -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.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.vue2.cjs"),V=require("../../../constructor/components/sections/Constructor.vue.cjs"),y=require("../../../../components/Popup/Popup.vue2.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;
@@ -1,13 +1,13 @@
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
- import O from "../../../../components/Popup/Popup.vue.js";
4
+ import O from "../../../../components/Popup/Popup.vue2.js";
5
5
  import "../../../../components/FieldTags/tag-input.vue.js";
6
6
  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 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),i=require("../../../../components/Upload/Upload.vue.cjs"),r={class:"mn-thin w-100 pd-medium bg-white radius-medium"},m=["innerHTML"],p={key:1,class:""},v={__name:"Audio",props:["label","value","prop"],emits:["input","updateBlock"],setup(t,{emit:u}){const a=t,o=e.ref(null);function s(l){return[/youtube\.com/,/soundcloud\.com/,/vimeo\.com/].some(c=>c.test(l))}function d(l){o.value=l,o.value&&s(o.value)?(u("input",o.value),u("updateBlock",a.prop,{content:o.value})):alert("Invalid embed code or source not allowed.")}return(l,n)=>(e.openBlock(),e.createElementBlock("div",r,[t.prop.content?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:t.prop.content,class:"flex-center flex"},null,8,m)):(e.openBlock(),e.createElementBlock("div",p,[e.createVNode(i.default,{field:o.value,"onUpdate:field":n[0]||(n[0]=c=>o.value=c),onFileChange:d,type:"file",placeholder:"Enter embed code",class:"w-100 br-solid br-1px br-black-transp-10 pd-medium radius-small mn-thin"},null,8,["field"]),e.createElementVNode("button",{onClick:d,class:"button-small button"}," Save ")]))]))}};exports.default=v;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("../../../../components/Upload/Upload.vue.cjs"),m={class:"mn-thin w-100 pd-medium bg-white radius-medium"},p=["innerHTML"],v={key:1,class:""},b={__name:"Audio",props:["label","value","prop"],emits:["input","updateBlock"],setup(l,{emit:a}){const o=e.ref(null),i=l,u=a;function s(t){return[/youtube\.com/,/soundcloud\.com/,/vimeo\.com/].some(c=>c.test(t))}function d(t){o.value=t,o.value&&s(o.value)?(u("input",o.value),u("updateBlock",i.prop,{content:o.value})):alert("Invalid embed code or source not allowed.")}return(t,n)=>(e.openBlock(),e.createElementBlock("div",m,[l.prop.content?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:l.prop.content,class:"flex-center flex"},null,8,p)):(e.openBlock(),e.createElementBlock("div",v,[e.createVNode(r.default,{field:o.value,"onUpdate:field":n[0]||(n[0]=c=>o.value=c),onFileChange:d,type:"file",placeholder:"Enter embed code",class:"w-100 br-solid br-1px br-black-transp-10 pd-medium radius-small mn-thin"},null,8,["field"]),e.createElementVNode("button",{onClick:d,class:"button-small button"}," Save ")]))]))}};exports.default=b;
@@ -1,9 +1,9 @@
1
- import { ref as r, openBlock as d, createElementBlock as a, createVNode as m, createElementVNode as p } from "vue";
2
- import b from "../../../../components/Upload/Upload.vue.js";
3
- const f = { class: "mn-thin w-100 pd-medium bg-white radius-medium" }, v = ["innerHTML"], k = {
1
+ import { ref as m, openBlock as d, createElementBlock as i, createVNode as p, createElementVNode as b } from "vue";
2
+ import f from "../../../../components/Upload/Upload.vue.js";
3
+ const v = { class: "mn-thin w-100 pd-medium bg-white radius-medium" }, k = ["innerHTML"], h = {
4
4
  key: 1,
5
5
  class: ""
6
- }, C = {
6
+ }, _ = {
7
7
  __name: "Audio",
8
8
  props: [
9
9
  "label",
@@ -11,30 +11,30 @@ const f = { class: "mn-thin w-100 pd-medium bg-white radius-medium" }, v = ["inn
11
11
  "prop"
12
12
  ],
13
13
  emits: ["input", "updateBlock"],
14
- setup(l, { emit: c }) {
15
- const u = l, e = r(null);
16
- function i(o) {
14
+ setup(t, { emit: s }) {
15
+ const e = m(null), u = t, a = s;
16
+ function r(o) {
17
17
  return [/youtube\.com/, /soundcloud\.com/, /vimeo\.com/].some((n) => n.test(o));
18
18
  }
19
- function s(o) {
20
- e.value = o, e.value && i(e.value) ? (c("input", e.value), c("updateBlock", u.prop, { content: e.value })) : alert("Invalid embed code or source not allowed.");
19
+ function c(o) {
20
+ e.value = o, e.value && r(e.value) ? (a("input", e.value), a("updateBlock", u.prop, { content: e.value })) : alert("Invalid embed code or source not allowed.");
21
21
  }
22
- return (o, t) => (d(), a("div", f, [
23
- l.prop.content ? (d(), a("div", {
22
+ return (o, l) => (d(), i("div", v, [
23
+ t.prop.content ? (d(), i("div", {
24
24
  key: 0,
25
- innerHTML: l.prop.content,
25
+ innerHTML: t.prop.content,
26
26
  class: "flex-center flex"
27
- }, null, 8, v)) : (d(), a("div", k, [
28
- m(b, {
27
+ }, null, 8, k)) : (d(), i("div", h, [
28
+ p(f, {
29
29
  field: e.value,
30
- "onUpdate:field": t[0] || (t[0] = (n) => e.value = n),
31
- onFileChange: s,
30
+ "onUpdate:field": l[0] || (l[0] = (n) => e.value = n),
31
+ onFileChange: c,
32
32
  type: "file",
33
33
  placeholder: "Enter embed code",
34
34
  class: "w-100 br-solid br-1px br-black-transp-10 pd-medium radius-small mn-thin"
35
35
  }, null, 8, ["field"]),
36
- p("button", {
37
- onClick: s,
36
+ b("button", {
37
+ onClick: c,
38
38
  class: "button-small button"
39
39
  }, " Save ")
40
40
  ]))
@@ -42,5 +42,5 @@ const f = { class: "mn-thin w-100 pd-medium bg-white radius-medium" }, v = ["inn
42
42
  }
43
43
  };
44
44
  export {
45
- C as default
45
+ _ as default
46
46
  };
@@ -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,tabindex:"-1",class:"text-area mn-small"},`
2
- `,40,f),[[e.vModelText,t.prop[t.content]]])]))}};exports.default=h;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),m=["placeholder"],h={__name:"Bullets",props:["obj","label","prop","value","content","textarea","placeholder","index","ref"],emits:["deleteBlock","addBlock","focus"],setup(t,{emit:p}){const l=t;e.ref(l);const r=e.ref(null),i=p;function f(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:f,onFocus:o[1]||(o[1]=c=>i("focus",r.value)),ref_key:"textarea",ref:r,tabindex:"-1",class:"text-area mn-small"},`
2
+ `,40,m),[[e.vModelText,t.prop[t.content]]])]))}};exports.default=h;
@@ -1,19 +1,19 @@
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
- const E = ["placeholder"], I = {
1
+ import { ref as d, onUpdated as f, onMounted as x, watch as h, openBlock as v, createElementBlock as g, createTextVNode as k, toDisplayString as B, withDirectives as b, createElementVNode as y, vModelText as E } from "vue";
2
+ const D = ["placeholder"], M = {
3
3
  __name: "Bullets",
4
4
  props: ["obj", "label", "prop", "value", "content", "textarea", "placeholder", "index", "ref"],
5
5
  emits: ["deleteBlock", "addBlock", "focus"],
6
- setup(e, { emit: u }) {
6
+ setup(e, { emit: p }) {
7
7
  const t = e;
8
8
  d(t);
9
- const o = d(null);
10
- function p(l) {
9
+ const o = d(null), i = p;
10
+ function m(l) {
11
11
  const n = /^\s*[-*]\s+(.*)/;
12
- let i = l.target.value.split(/\n+/).map((c) => {
12
+ let u = l.target.value.split(/\n+/).map((c) => {
13
13
  const s = n.exec(c);
14
14
  return s ? s[1] : null;
15
15
  }).filter((c) => c !== null);
16
- i.length > 0 ? (t.prop[t.content] = i, a()) : l.target.value.trim() === "" && (t.prop[t.content] = [], a());
16
+ u.length > 0 ? (t.prop[t.content] = u, a()) : l.target.value.trim() === "" && (t.prop[t.content] = [], a());
17
17
  }
18
18
  function a() {
19
19
  o.value.style.height = "1rem", o.value.style.height = o.value.scrollHeight + "px";
@@ -23,25 +23,25 @@ const E = ["placeholder"], I = {
23
23
  }), x(() => {
24
24
  a();
25
25
  }), h(() => t.prop[t.content], (l) => {
26
- (!l || l.length === 0) && u("deleteBlock", t.prop);
27
- }), (l, n) => (m(), v("div", null, [
28
- g(k(e.prop[e.content]) + " ", 1),
29
- B(b("textarea", {
26
+ (!l || l.length === 0) && i("deleteBlock", t.prop);
27
+ }), (l, n) => (v(), g("div", null, [
28
+ k(B(e.prop[e.content]) + " ", 1),
29
+ b(y("textarea", {
30
30
  "onUpdate:modelValue": n[0] || (n[0] = (r) => e.prop[e.content] = r),
31
31
  placeholder: e.placeholder ? e.placeholder : "Enter text",
32
- onInput: p,
33
- onFocus: n[1] || (n[1] = (r) => u("focus", o.value)),
32
+ onInput: m,
33
+ onFocus: n[1] || (n[1] = (r) => i("focus", o.value)),
34
34
  ref_key: "textarea",
35
35
  ref: o,
36
36
  tabindex: "-1",
37
37
  class: "text-area mn-small"
38
38
  }, `
39
- `, 40, E), [
40
- [y, e.prop[e.content]]
39
+ `, 40, D), [
40
+ [E, e.prop[e.content]]
41
41
  ])
42
42
  ]));
43
43
  }
44
44
  };
45
45
  export {
46
- I as default
46
+ M as default
47
47
  };
@@ -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: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"},`
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:p}){const t=l;e.ref(t);const r=e.ref(null),u=p;function m(n){const o=/^\s*[-*]\s+(.*)/;let s=n.target.value.split(/\n+/).map(i=>{const d=o.exec(i);return d?d[1]:null}).filter(i=>i!==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)&&u("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:m,onFocus:o[1]||(o[1]=c=>u("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,13 +1,13 @@
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
- const B = ["placeholder"], E = {
1
+ import { ref as d, onUpdated as f, onMounted as h, watch as x, openBlock as v, createElementBlock as b, withDirectives as g, createElementVNode as k, vModelText as B } from "vue";
2
+ const y = ["placeholder"], I = {
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: i }) {
6
+ setup(t, { emit: p }) {
7
7
  const e = t;
8
8
  d(e);
9
- const o = d(null);
10
- function p(l) {
9
+ const o = d(null), i = p;
10
+ function m(l) {
11
11
  const n = /^\s*[-*]\s+(.*)/;
12
12
  let s = l.target.value.split(/\n+/).map((c) => {
13
13
  const u = n.exec(c);
@@ -20,27 +20,27 @@ const B = ["placeholder"], E = {
20
20
  }
21
21
  return f(() => {
22
22
  a();
23
- }), m(() => {
23
+ }), h(() => {
24
24
  a();
25
- }), h(() => e.prop[e.content], (l) => {
25
+ }), x(() => e.prop[e.content], (l) => {
26
26
  (!l || l.length === 0) && i("deleteBlock", e.prop);
27
- }), (l, n) => (x(), v("div", null, [
28
- b(g("textarea", {
27
+ }), (l, n) => (v(), b("div", null, [
28
+ g(k("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: p,
31
+ onInput: m,
32
32
  onFocus: n[1] || (n[1] = (r) => i("focus", o.value)),
33
33
  ref_key: "textarea",
34
34
  ref: o,
35
35
  tabindex: "-1",
36
36
  class: "br-l br-solid br-main pd-l-small text-area mn-small"
37
37
  }, `
38
- `, 40, B), [
39
- [k, t.prop[t.content]]
38
+ `, 40, y), [
39
+ [B, t.prop[t.content]]
40
40
  ])
41
41
  ]));
42
42
  }
43
43
  };
44
44
  export {
45
- E as default
45
+ I as default
46
46
  };