@ozdao/prometheus-framework 0.0.85 → 0.0.87

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-15e71ec4.js +1 -0
  2. package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-628f013e.mjs +138 -0
  3. package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-cdbafd07.mjs +1944 -0
  4. package/dist/ButtonFollow-728aab73.mjs +130 -0
  5. package/dist/CardHeader-ce5a1a75.mjs +96 -0
  6. package/dist/CardOrganization-58b54995.js +1 -0
  7. package/dist/CardOrganization-91e79698.mjs +320 -0
  8. package/dist/CardOrganization-ee5c34ab.js +1 -0
  9. package/dist/CardOrganization-f70bd169.mjs +202 -0
  10. package/dist/Comments-63f154a6.js +9 -0
  11. package/dist/Comments-c092550f.mjs +76 -0
  12. package/dist/Comments-c5afa4d6.mjs +459 -0
  13. package/dist/EditProductImages-61ff4321.mjs +236 -0
  14. package/dist/Feed-8fd41524.js +1 -0
  15. package/dist/Feed-926cf4f3.mjs +355 -0
  16. package/dist/Feed-a31c43c2.mjs +423 -0
  17. package/dist/Feed-ecf37814.mjs +367 -0
  18. package/dist/IconEdit-736c89be.js +1 -0
  19. package/dist/IconEdit-e9fd4c6c.mjs +21 -0
  20. package/dist/PlaceholderUserpic-995da0fc.mjs +28 -0
  21. package/dist/Popup-0c791801.mjs +76 -0
  22. package/dist/Popup-105ef2c3.js +1 -0
  23. package/dist/Popup-82fb2c8a.mjs +76 -0
  24. package/dist/Product-2f3d592f.mjs +837 -0
  25. package/dist/Product-2fbf9d99.js +7 -0
  26. package/dist/Product-6c37ef35.js +7 -0
  27. package/dist/Product-7087b358.mjs +837 -0
  28. package/dist/ProductEdit-20709821.mjs +349 -0
  29. package/dist/ProductEdit-a81d13b9.js +1 -0
  30. package/dist/ProductEdit-c5067942.mjs +113 -0
  31. package/dist/ProfileBlogposts-79d5c858.mjs +63 -0
  32. package/dist/ProfileBlogposts-eca9916c.js +1 -0
  33. package/dist/ProfileBlogposts-fb014bc6.mjs +63 -0
  34. package/dist/ProfileComments-48f3d4bc.mjs +43 -0
  35. package/dist/ProfileComments-58094a50.mjs +43 -0
  36. package/dist/ProfileComments-b919f021.js +1 -0
  37. package/dist/ProfileEvents-05485e20.js +1 -0
  38. package/dist/ProfileEvents-20695376.mjs +55 -0
  39. package/dist/ProfileEvents-5d206e3d.mjs +55 -0
  40. package/dist/ProfileLikes-2f3a4488.js +1 -0
  41. package/dist/ProfileLikes-503712ec.mjs +43 -0
  42. package/dist/ProfileLikes-b5ac7f48.mjs +43 -0
  43. package/dist/ProfileOrganizations-0b76e38f.js +1 -0
  44. package/dist/ProfileOrganizations-32ab1e30.mjs +211 -0
  45. package/dist/ProfileOrganizations-3f305f4e.mjs +210 -0
  46. package/dist/ProfileOrganizations-50fce34e.js +1 -0
  47. package/dist/Publics-3f277c17.js +1 -0
  48. package/dist/Publics-49dbeafc.js +1 -0
  49. package/dist/Publics-9ebffff1.mjs +122 -0
  50. package/dist/Publics-b0fad2b0.mjs +1926 -0
  51. package/dist/Tab-58cd105f.mjs +46 -0
  52. package/dist/Tab-6f0a4909.js +1 -0
  53. package/dist/UploadImage-441e8526.js +1 -0
  54. package/dist/UploadImage-d1dbc280.mjs +99 -0
  55. package/dist/UploadImage-ff8f9a0c.mjs +83 -0
  56. package/dist/auth-35ef1791.mjs +1502 -0
  57. package/dist/auth.client.cjs +2 -2
  58. package/dist/auth.client.js +61 -41
  59. package/dist/auth.validation-29113f37.mjs +20 -0
  60. package/dist/categories-d669f3af.mjs +225 -0
  61. package/dist/community.client.cjs +1 -9
  62. package/dist/community.client.js +369 -741
  63. package/dist/community.server.js +16 -4
  64. package/dist/community.server.mjs +16 -4
  65. package/dist/events.client.cjs +1 -1
  66. package/dist/events.client.js +433 -331
  67. package/dist/events.server.js +19 -2
  68. package/dist/events.server.mjs +19 -2
  69. package/dist/inputs.validation-24ae76b9.js +1 -0
  70. package/dist/modules/constructor/components/elements/Bullets.vue.d.ts +15 -0
  71. package/dist/modules/constructor/components/elements/Caption.vue.d.ts +15 -0
  72. package/dist/modules/constructor/components/elements/H2.vue.d.ts +16 -0
  73. package/dist/modules/constructor/components/elements/Image.vue.d.ts +8 -0
  74. package/dist/modules/constructor/components/elements/ImageUpload.vue.d.ts +9 -0
  75. package/dist/modules/constructor/components/elements/Textarea.vue.d.ts +12 -0
  76. package/dist/modules/constructor/components/sections/Constructor.vue.d.ts +7 -0
  77. package/dist/modules/events/components/sections/Feed.vue.d.ts +1 -0
  78. package/dist/modules/icons/entities/IconCommunity.vue.d.ts +2 -0
  79. package/dist/organizations-1b4c84ee.mjs +121 -0
  80. package/dist/organizations-af43bda4.js +1 -0
  81. package/dist/organizations.client-253c8068.mjs +3179 -0
  82. package/dist/organizations.client-c60d7659.js +3 -0
  83. package/dist/organizations.client.cjs +1 -3
  84. package/dist/organizations.client.js +50 -3026
  85. package/dist/organizations.server.js +1 -1
  86. package/dist/organizations.server.mjs +1 -1
  87. package/dist/style.css +1 -1
  88. package/dist/users.client.cjs +1 -1
  89. package/dist/users.client.js +245 -208
  90. package/package.json +1 -1
  91. package/src/modules/auth/router/auth.js +28 -7
  92. package/src/modules/community/community.client.js +1 -12
  93. package/src/modules/community/components/pages/BlogPost.vue +1 -1
  94. package/src/modules/community/components/pages/CreateBlogPost.vue +8 -151
  95. package/src/modules/community/middlewares/server/verifyBlogpost.js +24 -11
  96. package/src/modules/{community → constructor}/components/elements/Textarea.vue +3 -11
  97. package/src/modules/constructor/components/sections/Constructor.vue +167 -0
  98. package/src/modules/events/components/blocks/CardEvent.vue +14 -6
  99. package/src/modules/events/components/pages/EditEvent.vue +228 -133
  100. package/src/modules/events/components/sections/Feed.vue +7 -1
  101. package/src/modules/events/controllers/events.controller.js +9 -0
  102. package/src/modules/events/controllers/tickets.controller.js +2 -1
  103. package/src/modules/events/models/event.model.js +10 -0
  104. package/src/modules/events/store/events.js +15 -19
  105. package/src/modules/icons/entities/IconCommunity.vue +8 -0
  106. package/src/modules/organizations/components/blocks/CardOrganization.vue +3 -5
  107. package/src/modules/organizations/components/sections/Publics.vue +3 -3
  108. package/src/modules/organizations/controllers/organizations.controller.js +1 -1
  109. package/src/modules/organizations/organizations.client.js +0 -2
  110. package/src/modules/users/components/pages/Profile.vue +15 -4
  111. package/src/modules/users/components/pages/ProfileEvents.vue +3 -3
  112. package/src/modules/organizations/components/blocks/CardOrganizationSocial.vue +0 -46
  113. /package/src/modules/{community → constructor}/components/elements/Bullets.vue +0 -0
  114. /package/src/modules/{community → constructor}/components/elements/Caption.vue +0 -0
  115. /package/src/modules/{community → constructor}/components/elements/H2.vue +0 -0
  116. /package/src/modules/{community → constructor}/components/elements/Image.vue +0 -0
  117. /package/src/modules/{community → constructor}/components/elements/ImageUpload.vue +0 -0
@@ -0,0 +1,202 @@
1
+ import { openBlock as i, createElementBlock as n, createCommentVNode as o, createElementVNode as e, createTextVNode as d, toDisplayString as s, Fragment as u, renderList as m, createBlock as h, withModifiers as f } from "vue";
2
+ import { useRouter as g } from "vue-router";
3
+ import { B as v } from "./ButtonFollow-728aab73.mjs";
4
+ const b = { class: "flex-stretch flex-nojustify flex-nowrap flex shop-cart-item" }, w = ["src"], C = {
5
+ key: 1,
6
+ width: "524",
7
+ height: "345",
8
+ viewBox: "0 0 524 345",
9
+ fill: "none",
10
+ xmlns: "http://www.w3.org/2000/svg",
11
+ class: "aspect-1x1",
12
+ style: { "object-fit": "cover" }
13
+ }, x = /* @__PURE__ */ e("rect", {
14
+ width: "524",
15
+ height: "345",
16
+ fill: "white"
17
+ }, null, -1), p = /* @__PURE__ */ e("rect", {
18
+ width: "524",
19
+ height: "345",
20
+ fill: "white"
21
+ }, null, -1), y = /* @__PURE__ */ e("circle", {
22
+ cx: "262",
23
+ cy: "172",
24
+ r: "56",
25
+ fill: "#00ff88",
26
+ "fill-opacity": "0.1"
27
+ }, null, -1), z = /* @__PURE__ */ e("path", {
28
+ fill: "#00ff88",
29
+ d: "M229.348 186.819C230.243 191.884 233.393 194.231 238.458 193.273V193.644C238.458 198.832 241.206 201.581 246.364 201.581H291.545C296.733 201.581 299.481 198.74 299.481 193.644V162.576C299.481 157.481 296.733 154.64 291.545 154.64H285.677L284.071 145.653C283.175 140.619 279.995 138.303 274.899 139.198L230.398 147.043C225.302 147.969 223.048 151.15 223.943 156.246L229.348 186.819ZM230.83 186.479L225.456 156.06C224.715 151.86 226.537 149.266 230.737 148.525L275.084 140.712C279.13 140.001 281.848 141.762 282.62 145.993L284.102 154.64H246.364C241.206 154.64 238.458 157.419 238.458 162.576V191.729L238.365 191.76C234.165 192.532 231.571 190.679 230.83 186.479ZM239.971 162.669C239.971 158.376 242.164 156.153 246.456 156.153H291.483C295.59 156.153 297.968 158.376 297.968 162.669V190.093L284.565 177.894C283.145 176.597 281.662 175.856 279.809 175.856C277.987 175.856 276.628 176.566 275.146 177.863L262.052 189.073L257.142 184.565C255.875 183.36 254.764 182.743 253.158 182.743C251.675 182.743 250.656 183.36 249.39 184.503L239.971 193.212V162.669ZM257.636 178.419C261.373 178.419 264.43 175.3 264.43 171.471C264.43 167.734 261.373 164.584 257.636 164.584C253.806 164.584 250.718 167.734 250.718 171.471C250.718 175.3 253.806 178.419 257.636 178.419Z"
30
+ }, null, -1), $ = [
31
+ x,
32
+ p,
33
+ y,
34
+ z
35
+ ], k = { class: "text-left" }, _ = { class: "name" }, M = {
36
+ key: 0,
37
+ class: "t-transp"
38
+ }, L = {
39
+ key: 1,
40
+ class: "t-transp"
41
+ }, V = {
42
+ key: 2,
43
+ class: "t-transp"
44
+ }, B = { class: "t-main t-demi price mn-small" }, O = { key: 0 }, I = {
45
+ key: 0,
46
+ class: "flex-nojustify flex"
47
+ }, Z = { class: "flex-nowrap flex" }, j = /* @__PURE__ */ e("svg", {
48
+ fill: "none",
49
+ height: "20",
50
+ viewBox: "0 0 20 20",
51
+ width: "20",
52
+ xmlns: "http://www.w3.org/2000/svg"
53
+ }, [
54
+ /* @__PURE__ */ e("path", {
55
+ "clip-rule": "evenodd",
56
+ d: "m7.27124 0h5.45456c1.0041 0 1.8182.814027 1.8182 1.81818v.90899h2.7278c1.0042 0 1.8182.81402 1.8182 1.81818v1.81818c0 1.00415-.814 1.81818-1.8182 1.81818h-.0735l-.8363 10.00009c0 1.0042-.814 1.8182-1.8182 1.8182h-9.09087c-1.00416 0-1.81818-.814-1.81504-1.7427l-.83964-10.07559h-.07187c-1.00415 0-1.818177-.81403-1.818177-1.81818v-1.81818c0-1.00416.814027-1.81818 1.818177-1.81818h2.72668v-.90899c0-1.004153.81402-1.81818 1.81818-1.81818zm-1.81889 18.1819-.83047-10h10.75152l-.827 9.9245-.0031.0755zm-2.72612-11.81799v-1.81818h14.54547v1.81818zm10.00137-4.54571v.90909h-5.45456v-.90909z",
57
+ fill: "#8a8a8a",
58
+ "fill-rule": "evenodd"
59
+ })
60
+ ], -1), F = [
61
+ j
62
+ ], H = {
63
+ __name: "CardOrderItem",
64
+ props: {
65
+ product: Object,
66
+ editable: String,
67
+ increase: Function,
68
+ decrease: Function,
69
+ remove: Function
70
+ },
71
+ setup(t) {
72
+ return g(), (c, r) => (i(), n("div", b, [
73
+ t.product.images[0] ? (i(), n("img", {
74
+ key: 0,
75
+ class: "bg-grey aspect-1x1",
76
+ src: t.product.images[0]
77
+ }, null, 8, w)) : o("", !0),
78
+ t.product.images[0] ? o("", !0) : (i(), n("svg", C, $)),
79
+ e("div", k, [
80
+ e("p", _, [
81
+ d(s(t.product.name) + " ", 1),
82
+ t.product.size ? (i(), n("span", M, ", " + s(t.product.size), 1)) : o("", !0),
83
+ typeof t.product.color == "string" && t.product.size ? (i(), n("span", L, ", ")) : o("", !0),
84
+ typeof t.product.color == "string" ? (i(), n("span", V, s(t.product.color), 1)) : o("", !0)
85
+ ]),
86
+ e("p", B, [
87
+ t.editable ? (i(), n("span", O, s(t.product.quantity) + " x ", 1)) : o("", !0),
88
+ d(s(t.product.price) + " " + s(c.returnCurrency()), 1)
89
+ ]),
90
+ t.editable ? (i(), n("div", I, [
91
+ e("div", Z, [
92
+ e("button", {
93
+ onClick: r[0] || (r[0] = (l) => t.decrease(t.product)),
94
+ class: "mn-r-thin bg-grey button-square button"
95
+ }, "-"),
96
+ e("button", {
97
+ onClick: r[1] || (r[1] = (l) => t.increase(t.product)),
98
+ class: "mn-r-thin bg-grey button-square button"
99
+ }, "+")
100
+ ]),
101
+ e("button", {
102
+ onClick: r[2] || (r[2] = (l) => t.remove(t.product)),
103
+ class: "hover_br-transp hover_br-l-dark bg-transp button-square button"
104
+ }, F)
105
+ ])) : o("", !0)
106
+ ])
107
+ ]));
108
+ }
109
+ }, q = { class: "pd-medium flex-v-center flex-nowrap flex" }, S = ["src"], N = {
110
+ key: 1,
111
+ class: "h-4r w-4r radius-extra",
112
+ width: "42",
113
+ height: "42",
114
+ viewBox: "0 0 42 42",
115
+ fill: "none",
116
+ xmlns: "http://www.w3.org/2000/svg"
117
+ }, E = /* @__PURE__ */ e("circle", {
118
+ fill: "rgb(var(--main))",
119
+ cx: "21",
120
+ cy: "21",
121
+ r: "21"
122
+ }, null, -1), D = /* @__PURE__ */ e("path", {
123
+ fill: "#242424",
124
+ "fill-opacity": "0.1",
125
+ "fill-rule": "evenodd",
126
+ "clip-rule": "evenodd",
127
+ d: "M8.00233 37.4954C8.00078 37.4458 8 37.3961 8 37.3462C8 32.9066 11.5673 29.3077 15.9677 29.3077H26.0323C30.4328 29.3077 34 32.9066 34 37.3462C34 37.3961 33.9992 37.4458 33.9977 37.4954C30.4223 40.3165 25.9078 42 21 42C16.0922 42 11.5777 40.3164 8.00233 37.4954ZM21 9C16.5995 9 13.0323 12.5989 13.0323 17.0385C13.0323 21.478 16.5995 25.0769 21 25.0769C25.4005 25.0769 28.9677 21.478 28.9677 17.0385C28.9677 12.5989 25.4005 9 21 9Z"
128
+ }, null, -1), P = [
129
+ E,
130
+ D
131
+ ], R = { class: "mn-l-small" }, T = { class: "h3 mn-r-semi mn-thin" }, U = {
132
+ key: 0,
133
+ class: "w-max star-container flex-v-center flex"
134
+ }, A = { class: "mn-r-thin pd-r-thin pd-l-thin pd-micro radius-small t-semi uppercase bg-main p-small" }, G = ["src"], J = { class: "p-small t-semi mn-r-thin" }, K = { class: "p-small" }, Q = { class: "mn-thin" }, W = {
135
+ key: 0,
136
+ class: "pd-medium"
137
+ }, X = { class: "mn-small w-100 flex-nowrap flex flex-v-center pd-small bg-white radius-medium" }, Y = { class: "t-black p-medium t-semi" }, t1 = /* @__PURE__ */ e("span", { class: "mn-r-small" }, "30-60min", -1), e1 = /* @__PURE__ */ e("span", { class: "mn-r-auto" }, "$50 min", -1), i1 = { class: "d-block o-scroll flex-nowrap flex" }, n1 = /* @__PURE__ */ e("button", { class: "flex-center flex-nowrap flex shop-cart-item pd-thin radius-medium w-15r bg-main button" }, "View menu", -1), l1 = {
138
+ __name: "CardOrganization",
139
+ props: {
140
+ user: String,
141
+ organization: Object
142
+ },
143
+ emits: ["updateMembership"],
144
+ setup(t, { emit: c }) {
145
+ return g(), (r, l) => (i(), n("div", {
146
+ class: "bg-grey radius-big o-hidden",
147
+ onClick: l[1] || (l[1] = (a) => r.$router.push({ name: "Organization", params: { _id: t.organization._id } }))
148
+ }, [
149
+ e("div", q, [
150
+ t.organization.profile.photo && t.organization.profile.photo.length > 0 ? (i(), n("img", {
151
+ key: 0,
152
+ src: t.organization.profile.photo,
153
+ class: "h-4r w-4r radius-extra bg-main"
154
+ }, null, 8, S)) : (i(), n("svg", N, P)),
155
+ e("div", R, [
156
+ e("p", T, s(t.organization.profile.name), 1),
157
+ t.organization.ratingS ? (i(), n("div", U, [
158
+ e("span", A, s(t.organization.types[0]), 1),
159
+ (i(), n(u, null, m(5, (a) => e("img", {
160
+ class: "i-small mn-r-thin",
161
+ src: a <= t.organization.rating.median ? "/icons/star.svg" : "/icons/star-stroke.svg"
162
+ }, null, 8, G)), 64)),
163
+ e("span", J, s(t.organization.rating.median), 1),
164
+ e("span", K, "(" + s(t.organization.rating.amount) + ")", 1)
165
+ ])) : o("", !0),
166
+ e("div", null, [
167
+ e("p", Q, s(t.organization.numberOfMemberships) + " followers", 1),
168
+ t.user._id ? (i(), h(v, {
169
+ key: 0,
170
+ type: "organization",
171
+ isMember: t.organization.isMember,
172
+ targetId: t.organization._id,
173
+ userId: t.user,
174
+ class: "radius-big w-100",
175
+ onUpdateMembership: l[0] || (l[0] = (a) => c("updateMembership", a))
176
+ }, null, 8, ["isMember", "targetId", "userId"])) : o("", !0)
177
+ ])
178
+ ])
179
+ ]),
180
+ t.organization.products.length > 0 ? (i(), n("div", W, [
181
+ e("div", X, [
182
+ e("p", Y, s(t.organization.products.length) + " items: ", 1),
183
+ t1,
184
+ e1
185
+ ]),
186
+ e("div", i1, [
187
+ (i(!0), n(u, null, m(t.organization.products, (a) => (i(), h(H, {
188
+ onClick: f((s1) => r.$router.push({ name: "Product Organization", params: { _id: t.organization._id, product: a._id } }), ["stop"]),
189
+ key: a._id,
190
+ editable: !1,
191
+ product: a,
192
+ class: "pd-thin radius-medium w-15r br-solid br-grey br-1px bg-white mn-r-thin"
193
+ }, null, 8, ["onClick", "product"]))), 128)),
194
+ n1
195
+ ])
196
+ ])) : o("", !0)
197
+ ]));
198
+ }
199
+ };
200
+ export {
201
+ l1 as _
202
+ };
@@ -0,0 +1,9 @@
1
+ "use strict";const e=require("vue"),B=require("./auth-5aa8e90c.js"),C=require("./vue-draggable-next.esm-bundler-80731ae0.js"),$=require("./CardHeader-925a972b.js");const N=["placeholder"],y={__name:"Textarea",props:["prop","value","content","placeholder","index","setFocus"],emits:["deleteBlock","updateBlock","addBlock","focus"],setup(o,{emit:r}){const n=o;e.ref(n);const t=e.ref(null);e.ref(0);function d(a){let l=a.target.value.split(/\n+/);if(l.length>1){n.prop[n.content]=l[0],e.nextTick(()=>{c()});let u=l.slice(1).map(f=>({__name:"Textarea",content:f}));r("addBlock","Textarea","",n.index,{blocks:u,ref:t})}else a.target.value.trim()===""&&a.target.value.includes(`
2
+
3
+ `)&&(console.log("We are adding new block:"+n.index+newBlocks+t),r("addBlock","Textarea","",n.index,{blocks:newBlocks,ref:t})),c()}function i(a){(a.keyCode===8||a.keyCode===46)&&n.prop[n.content].trim()===""&&r("deleteBlock",n.prop)}function s(){e.nextTick(()=>{t.value.focus(),r("updateBlock",n.prop,{setFocus:!1})})}function c(){t.value.style.height="1rem",t.value.style.height=t.value.scrollHeight+"px"}return e.onUpdated(()=>{n.setFocus&&e.nextTick(()=>{s()}),c()}),e.onMounted(()=>{n.setFocus&&e.nextTick(()=>{s()}),c()}),(a,l)=>(e.openBlock(),e.createElementBlock("div",null,[e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":l[0]||(l[0]=u=>o.prop[o.content]=u),placeholder:o.placeholder?o.placeholder:"Enter text",onInput:d,onFocus:l[1]||(l[1]=u=>r("focus",t.value)),onKeyup:i,ref_key:"textarea",ref:t,class:"text-area mn-thin"},`
4
+ `,40,N),[[e.vModelText,o.prop[o.content]]])]))}};const V=["placeholder"],T={__name:"H2",props:["obj","label","prop","value","content","textarea","placeholder","index","ref","setFocus"],emits:["deleteBlock","updateBlock","addBlock","focus"],setup(o,{emit:r}){const n=o;e.ref(n);const t=e.ref(null);e.ref(0);function d(a){let l=a.target.value.split(/\n+/);if(l.length>1){n.prop[n.content]=l[0],e.nextTick(()=>{c()});let u=l.slice(1).map(f=>({type:"Textarea",content:f}));r("addBlock","Textarea","",n.index,{blocks:u,ref:t})}else a.target.value.trim()===""&&a.target.value.includes(`
5
+
6
+ `)&&(console.log("We are adding new block:"+n.index+newBlocks+t),r("addBlock","Textarea","",n.index,{blocks:newBlocks,ref:t})),c()}function i(a){(a.keyCode===8||a.keyCode===46)&&n.prop[n.content].trim()===""&&r("deleteBlock",n.prop)}function s(){e.nextTick(()=>{t.value.focus(),r("updateBlock",n.prop,{setFocus:!1})})}function c(){t.value.style.height="1rem",t.value.style.height=t.value.scrollHeight+"px"}return e.onUpdated(()=>{n.setFocus&&e.nextTick(()=>{s()}),c()}),e.onMounted(()=>{n.setFocus&&e.nextTick(()=>{s()}),c()}),e.watch(()=>n.prop[n.content],a=>{}),(a,l)=>(e.openBlock(),e.createElementBlock("div",null,[e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":l[0]||(l[0]=u=>o.prop[o.content]=u),placeholder:o.placeholder?o.placeholder:"Enter text",onInput:d,onFocus:l[1]||(l[1]=u=>r("focus",t.value)),onKeyup:i,ref_key:"textarea",ref:t,class:"h3 text-area mn-thin"},`
7
+ `,40,V),[[e.vModelText,o.prop[o.content]]])]))}},_=["placeholder"],D={__name:"Caption",props:["obj","label","prop","value","content","textarea","placeholder","index","ref"],emits:["deleteBlock","addBlock","focus"],setup(o,{emit:r}){const n=o;e.ref(n);const t=e.ref(null);function d(s){const c=/^\s*[-*]\s+(.*)/;let l=s.target.value.split(/\n+/).map(u=>{const f=c.exec(u);return f?f[1]:null}).filter(u=>u!==null);l.length>0?(n.prop[n.content]=l,i()):s.target.value.trim()===""&&(n.prop[n.content]=[],i())}function i(){t.value.style.height="1rem",t.value.style.height=t.value.scrollHeight+"px"}return e.onUpdated(()=>{i()}),e.onMounted(()=>{i()}),e.watch(()=>n.prop[n.content],s=>{(!s||s.length===0)&&r("deleteBlock",n.prop)}),(s,c)=>(e.openBlock(),e.createElementBlock("div",null,[e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":c[0]||(c[0]=a=>o.prop[o.content]=a),placeholder:o.placeholder?o.placeholder:"Enter text",onInput:d,onFocus:c[1]||(c[1]=a=>r("focus",t.value)),ref_key:"textarea",ref:t,class:"br-l br-solid br-main pd-l-small text-area mn-small"},`
8
+ `,40,_),[[e.vModelText,o.prop[o.content]]])]))}},U=["placeholder"],F={__name:"Bullets",props:["obj","label","prop","value","content","textarea","placeholder","index","ref"],emits:["deleteBlock","addBlock","focus"],setup(o,{emit:r}){const n=o;e.ref(n);const t=e.ref(null);function d(s){const c=/^\s*[-*]\s+(.*)/;let l=s.target.value.split(/\n+/).map(u=>{const f=c.exec(u);return f?f[1]:null}).filter(u=>u!==null);l.length>0?(n.prop[n.content]=l,i()):s.target.value.trim()===""&&(n.prop[n.content]=[],i())}function i(){t.value.style.height="1rem",t.value.style.height=t.value.scrollHeight+"px"}return e.onUpdated(()=>{i()}),e.onMounted(()=>{i()}),e.watch(()=>n.prop[n.content],s=>{(!s||s.length===0)&&r("deleteBlock",n.prop)}),(s,c)=>(e.openBlock(),e.createElementBlock("div",null,[e.createTextVNode(e.toDisplayString(o.prop[o.content])+" ",1),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":c[0]||(c[0]=a=>o.prop[o.content]=a),placeholder:o.placeholder?o.placeholder:"Enter text",onInput:d,onFocus:c[1]||(c[1]=a=>r("focus",t.value)),ref_key:"textarea",ref:t,class:"text-area mn-small"},`
9
+ `,40,U),[[e.vModelText,o.prop[o.content]]])]))}},I=["src"],M={key:1,class:"t-transp pd-extra"},H={__name:"ImageUpload",props:["label","value","prop"],emits:["input","updateBlock"],setup(o,{emit:r}){const n=o,t=e.ref(null),d=e.ref(null);function i(){d.value.click()}async function s(a){let l=a.target.files[0];console.log(l);let u=new FormData,f="unsorted";u.append("file",l),console.log(u.has("file"));try{let h=await B.axios.create({baseURL:process.env.API_URL,withCredentials:!0}).post(`/api/upload/file?folderName=${encodeURIComponent(f)}`,u,{headers:{"Content-Type":"multipart/form-data"}});t.value=h.data.filepath,console.log(t.value),r("input",t.value),r("updateBlock",n.prop,{content:t.value})}catch(g){console.error(g)}}function c(a){a.preventDefault(),s({target:{files:a.dataTransfer.files}})}return(a,l)=>(e.openBlock(),e.createElementBlock("div",{onClick:i,onDrop:c,onDragover:l[0]||(l[0]=e.withModifiers(()=>{},["prevent"])),class:"w-100 radius-big bg-white image-upload-area flex-v-center flex-h-center flex t-black mn-small"},[o.prop.content?(e.openBlock(),e.createElementBlock("img",{key:0,src:o.prop.content,alt:"Uploaded image",class:"w-100 h-30r object-fit-contain"},null,8,I)):(e.openBlock(),e.createElementBlock("span",M,"Click or drag-and-drop your image")),e.createElementVNode("input",{type:"file",ref_key:"fileInput",ref:d,onChange:s,style:{display:"none"}},null,544)],32))}},S=["onMouseover"],A={key:0,class:"z-index-5 radius-thin mn-small relative left-0 mt-2 w-max bg-white shadow-lg rounded"},L=["onClick"],z=["onClick"],R=["onClick"],j={__name:"Constructor",props:["content"],emits:["update"],setup(o,{emit:r}){const n=o;let t=e.ref(null);e.ref(null),t.value={content:n.content};const d={Textarea:y,H2:T,Bullets:F,Caption:D,ImageUpload:H};function i(h="Textarea",k="",p,m){console.log("We are adding new block (functuin HandleAddBlock):"+h+k+p+m);let v={order:t.value.content.length+1,type:h,style:"",class:"",content:k,blocks:[],setFocus:!0};if(m&&m.blocks&&Array.isArray(m.blocks)){let x=m.blocks.map(E=>({...v,content:E.content})),b=[(m.index||p)+1,0].concat(x);t.value.content.splice.apply(t.value.content,b);const w=x[x.length-1];console.log("New block is"+w)}else p!==void 0?(t.value.content.splice(p+1,0,v),console.log("Latest block is"+v)):(console.log("Another block is"+v),t.value.content.push(v));a.value=null,r("update",t.value.content)}function s(h,k){const p=t.value.content.findIndex(m=>m===h);p!==-1&&(t.value.content[p]={...t.value.content[p],...k}),r("update",t.value.content)}function c(h){let k=t.value.content.findIndex(p=>p===h);k!==-1&&t.value.content.splice(k,1),t.value.content[k-1].setFocus=!0,r("update",t.value.content)}const a=e.ref(null),l=e.ref(!1),u=e.ref(!1);function f(){l.value=!0}function g(){l.value=!1}return e.watchEffect(()=>{t.value&&t.value.content.length===0&&i("Textarea",""),r("update",t.value.content)}),(h,k)=>(e.openBlock(),e.createElementBlock("section",null,[e.unref(t).content?(e.openBlock(),e.createBlock(e.unref(C.VueDraggableNext),{key:0,class:"w-full",list:e.unref(t).content,onStart:f,onEnd:g},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t).content,(p,m)=>(e.openBlock(),e.createElementBlock("div",{key:m,class:"relative"},[e.createElementVNode("div",{onMouseover:v=>(a.value=m,u.value=!1),class:"w-full h-full"},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d[p.type]),{index:m,component:p,prop:p,class:e.normalizeClass(p.class),setFocus:p.setFocus,content:"content",onDeleteBlock:c,onAddBlock:i,onUpdateBlock:s},null,40,["index","component","prop","class","setFocus"]))],40,S),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[a.value===m?(e.openBlock(),e.createElementBlock("div",{key:0,class:"pos-absolute pos-r-100 pos-t-0 z-index-4 i-semi",onMousedown:k[1]||(k[1]=e.withModifiers(v=>l.value=!0,["prevent"]))},[e.createElementVNode("button",{onClick:k[0]||(k[0]=v=>u.value=!u.value),class:"mn-small w-100 i-semi bg-white radius-thin"},e.toDisplayString(p.content?"...":"+"),1),u.value?(e.openBlock(),e.createElementBlock("div",A,[e.createElementVNode("button",{onClick:v=>c(p),class:"block w-max text-left px-4 py-2 hover:bg-gray-200"},"Удалить",8,L),e.createElementVNode("button",{onClick:v=>i("ImageUpload","",m),class:"block w-max text-left px-4 py-2 hover:bg-gray-200"},"Добавить изображение",8,z),e.createElementVNode("button",{onClick:v=>i("H2","",m),class:"block w-max text-left px-4 py-2 hover:bg-gray-200"},"Добавить заголовок",8,R)])):e.createCommentVNode("",!0)],32)):e.createCommentVNode("",!0)]),_:2},1024)]))),128))]),_:1},8,["list"])):e.createCommentVNode("",!0)]))}},q={class:"mn-small"},K=e.createElementVNode("p",{class:"t-semi uppercase"},"Please log in to leave a comment.",-1),P=[K],W={key:1,class:"mn-small"},G=["onSubmit"],J=e.createElementVNode("button",{type:"submit",class:"mn-l-auto bg-main button"},"Send",-1),O={class:"pd-t-zero"},Q={class:"p-big"},X={__name:"Comments",props:["target","owner","type"],setup(o){const r=o,n=B.axios.create({baseURL:process.env.API_URL}),t=e.ref([]),d=e.ref(""),i=async()=>{const{data:c}=await n.get(`/comments/read?type=${r.type}&target=${r.target}`);t.value=c},s=async()=>{if(d.value)try{const c=await n.post("/comments/create",{target:r.target,user:r.owner,type:r.type,content:d.value});c.data.owner=r.owner,t.value.push(c.data),d.value=""}catch(c){console.error(c)}};return i(),(c,a)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",null,[e.createElementVNode("h3",q,e.toDisplayString(t.value.length)+" comments",1),o.owner?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,onClick:a[0]||(a[0]=l=>c.$router.push({name:"Sign In"})),class:"cursor-pointer mn-small section bg-black t-white flex-center flex radius-big"},P)),o.owner?(e.openBlock(),e.createElementBlock("div",W,[e.createElementVNode("form",{onSubmit:e.withModifiers(s,["prevent"]),class:"bg-grey radius-big pd-medium"},[e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":a[1]||(a[1]=l=>d.value=l),placeholder:"Enter your comment",class:"pd-small p-big w-100 radius-small mn-r-small"},null,512),[[e.vModelText,d.value]]),J],40,G)])):e.createCommentVNode("",!0)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,l=>(e.openBlock(),e.createElementBlock("div",{key:l._id,class:"comment mn-small radius-big pd-medium bg-grey"},[e.createVNode($._sfc_main,{class:"mn-medium",owner:{target:l.user},creator:{target:l.user},date:l.createdAt},null,8,["owner","creator","date"]),e.createElementVNode("div",O,[e.createElementVNode("p",Q,e.toDisplayString(l.content),1)])]))),128))]))}};exports._sfc_main=j;exports._sfc_main$1=X;exports._sfc_main$2=y;
@@ -0,0 +1,76 @@
1
+ import { ref as u, openBlock as a, createElementBlock as r, createElementVNode as s, toDisplayString as d, createCommentVNode as p, withModifiers as _, withDirectives as b, vModelText as y, Fragment as h, renderList as w, createVNode as f } from "vue";
2
+ import { a as k } from "./auth-35ef1791.mjs";
3
+ import { _ as x } from "./CardHeader-ce5a1a75.mjs";
4
+ const C = { class: "mn-small" }, $ = /* @__PURE__ */ s("p", { class: "t-semi uppercase" }, "Please log in to leave a comment.", -1), S = [
5
+ $
6
+ ], V = {
7
+ key: 1,
8
+ class: "mn-small"
9
+ }, E = ["onSubmit"], L = /* @__PURE__ */ s("button", {
10
+ type: "submit",
11
+ class: "mn-l-auto bg-main button"
12
+ }, "Send", -1), N = { class: "pd-t-zero" }, U = { class: "p-big" }, I = {
13
+ __name: "Comments",
14
+ props: ["target", "owner", "type"],
15
+ setup(m) {
16
+ const o = m, c = k.create({ baseURL: process.env.API_URL }), l = u([]), n = u(""), g = async () => {
17
+ const { data: e } = await c.get(`/comments/read?type=${o.type}&target=${o.target}`);
18
+ l.value = e;
19
+ }, v = async () => {
20
+ if (n.value)
21
+ try {
22
+ const e = await c.post("/comments/create", {
23
+ target: o.target,
24
+ user: o.owner,
25
+ type: o.type,
26
+ content: n.value
27
+ });
28
+ e.data.owner = o.owner, l.value.push(e.data), n.value = "";
29
+ } catch (e) {
30
+ console.error(e);
31
+ }
32
+ };
33
+ return g(), (e, i) => (a(), r("div", null, [
34
+ s("div", null, [
35
+ s("h3", C, d(l.value.length) + " comments", 1),
36
+ m.owner ? p("", !0) : (a(), r("div", {
37
+ key: 0,
38
+ onClick: i[0] || (i[0] = (t) => e.$router.push({ name: "Sign In" })),
39
+ class: "cursor-pointer mn-small section bg-black t-white flex-center flex radius-big"
40
+ }, S)),
41
+ m.owner ? (a(), r("div", V, [
42
+ s("form", {
43
+ onSubmit: _(v, ["prevent"]),
44
+ class: "bg-grey radius-big pd-medium"
45
+ }, [
46
+ b(s("textarea", {
47
+ "onUpdate:modelValue": i[1] || (i[1] = (t) => n.value = t),
48
+ placeholder: "Enter your comment",
49
+ class: "pd-small p-big w-100 radius-small mn-r-small"
50
+ }, null, 512), [
51
+ [y, n.value]
52
+ ]),
53
+ L
54
+ ], 40, E)
55
+ ])) : p("", !0)
56
+ ]),
57
+ (a(!0), r(h, null, w(l.value, (t) => (a(), r("div", {
58
+ key: t._id,
59
+ class: "comment mn-small radius-big pd-medium bg-grey"
60
+ }, [
61
+ f(x, {
62
+ class: "mn-medium",
63
+ owner: { target: t.user },
64
+ creator: { target: t.user },
65
+ date: t.createdAt
66
+ }, null, 8, ["owner", "creator", "date"]),
67
+ s("div", N, [
68
+ s("p", U, d(t.content), 1)
69
+ ])
70
+ ]))), 128))
71
+ ]));
72
+ }
73
+ };
74
+ export {
75
+ I as _
76
+ };