@ozdao/prometheus-framework 0.1.30 → 0.1.31

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/BackofficeGallery-02c9721b.mjs +304 -0
  2. package/dist/BackofficeGallery-1d117a40.js +1 -0
  3. package/dist/BackofficeReports-cb4b180d.mjs +44 -0
  4. package/dist/BackofficeReports-d021871f.js +1 -0
  5. package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-505c3ca5.js +1 -0
  6. package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-b1873cb7.mjs +1945 -0
  7. package/dist/Button-2ca405bd.js +1 -0
  8. package/dist/Button-c59d387c.mjs +283 -0
  9. package/dist/Button.vue_vue_type_style_index_0_lang-0ea8fbf8.js +1 -0
  10. package/dist/Button.vue_vue_type_style_index_0_lang-4ed993c7.mjs +1 -0
  11. package/dist/ButtonFollow.vue_vue_type_style_index_0_scoped_0634d4a1_lang-0ea8fbf8.js +1 -0
  12. package/dist/ButtonFollow.vue_vue_type_style_index_0_scoped_0634d4a1_lang-4ed993c7.mjs +1 -0
  13. package/dist/CardOrganization-18c1e3fa.mjs +297 -0
  14. package/dist/CardOrganization-7d679e75.js +1 -0
  15. package/dist/Chips-2ada5eda.mjs +200 -0
  16. package/dist/Chips-8d0a1d2c.js +1 -0
  17. package/dist/Dashboard-239fb7a6.mjs +52 -0
  18. package/dist/Dashboard-94267906.js +1 -0
  19. package/dist/EULA-8265b0cf.mjs +4218 -0
  20. package/dist/EULA-cbb27503.js +1 -0
  21. package/dist/Feed-66095e66.js +1 -0
  22. package/dist/Feed-76fc4475.mjs +383 -0
  23. package/dist/Feed-e55bc6fa.js +1 -0
  24. package/dist/Feed-ef6c6ca3.mjs +371 -0
  25. package/dist/IconEdit-c98d3d06.mjs +339 -0
  26. package/dist/IconEdit-e4d0cc6e.js +1 -0
  27. package/dist/Image-052a3cc2.mjs +480 -0
  28. package/dist/Image-c90ee624.js +9 -0
  29. package/dist/MenuItem-0b249b94.mjs +93 -0
  30. package/dist/MenuItem-8b70d2cf.js +1 -0
  31. package/dist/Product-4b58701f.js +7 -0
  32. package/dist/Product-a6251018.mjs +844 -0
  33. package/dist/ProductEdit-3ff2af92.js +1 -0
  34. package/dist/ProductEdit-f901314c.mjs +306 -0
  35. package/dist/ProfileBlogposts-57931834.mjs +70 -0
  36. package/dist/ProfileBlogposts-af88ce98.js +1 -0
  37. package/dist/ProfileEvents-588eadf9.js +1 -0
  38. package/dist/ProfileEvents-ed7f9603.mjs +62 -0
  39. package/dist/ProfileOrganizations-7911deec.mjs +219 -0
  40. package/dist/ProfileOrganizations-ae258581.js +1 -0
  41. package/dist/Publics-50c0ff6c.js +1 -0
  42. package/dist/Publics-f34131bf.mjs +45 -0
  43. package/dist/Select-11ddabf5.mjs +79 -0
  44. package/dist/Select-3ca5ab39.js +1 -0
  45. package/dist/Socials-3fe01af1.mjs +275 -0
  46. package/dist/Socials-b19d0cb1.js +1 -0
  47. package/dist/addMembersQuantity-ea216f92.mjs +85 -0
  48. package/dist/addMembersQuantity-f922d82b.js +84 -0
  49. package/dist/auth-98fe3efb.mjs +612 -0
  50. package/dist/auth-acbe3ae1.js +7 -0
  51. package/dist/auth.client.cjs +7 -8
  52. package/dist/auth.client.js +435 -439
  53. package/dist/auth.validation-495e9d6d.js +1 -0
  54. package/dist/auth.validation-e265b496.mjs +23 -0
  55. package/dist/backoffice.client.cjs +1 -1
  56. package/dist/backoffice.client.js +55 -28
  57. package/dist/click-outside-0b0727d1.js +2 -0
  58. package/dist/click-outside-6101836c.mjs +19 -0
  59. package/dist/community.client.cjs +1 -1
  60. package/dist/community.client.js +121 -121
  61. package/dist/community.server.js +35 -5
  62. package/dist/community.server.mjs +35 -5
  63. package/dist/components/Button/Button.vue.d.ts +3 -0
  64. package/dist/components/Button/Button.vue.d.ts.map +1 -1
  65. package/dist/components/CardHeader/CardHeader.vue.d.ts +3 -0
  66. package/dist/components/Dropdown/Dropdown.vue.d.ts +3 -0
  67. package/dist/components/Dropdown/Dropdown.vue.d.ts.map +1 -1
  68. package/dist/components/Field/Field.vue.d.ts +1 -1
  69. package/dist/components/FieldPhone/FieldPhone(script-setup).vue.d.ts +3 -3
  70. package/dist/components/Popup/Popup.vue.d.ts +2 -1
  71. package/dist/components/Popup/Popup.vue.d.ts.map +1 -1
  72. package/dist/components/Select/Select.vue.d.ts +1 -1
  73. package/dist/components/Select/Select.vue.d.ts.map +1 -1
  74. package/dist/components/Upload/Upload.vue.d.ts +1 -1
  75. package/dist/events.client.cjs +2 -2
  76. package/dist/events.client.js +219 -217
  77. package/dist/events.server.js +2 -9
  78. package/dist/events.server.mjs +2 -9
  79. package/dist/legal.client.cjs +1 -1
  80. package/dist/legal.client.js +2565 -2545
  81. package/dist/main.css +1 -1
  82. package/dist/main.d.ts +1 -1
  83. package/dist/modules/backoffice/components/pages/Dashboard.vue.d.ts +6 -0
  84. package/dist/modules/icons/navigation/IconCross.vue.d.ts +4 -0
  85. package/dist/modules/legal/components/pages/legal/EULA.vue.d.ts +2 -0
  86. package/dist/modules/organizations/components/elements/ButtonFollow.vue.d.ts +1 -1
  87. package/dist/modules/organizations/components/elements/ButtonToggleMembership.vue.d.ts +12 -0
  88. package/dist/modules/organizations/components/sections/DetailsTab.vue.d.ts +2 -58
  89. package/dist/modules/organizations/components/sections/Feed.vue.d.ts +1 -1
  90. package/dist/modules/reports/components/pages/BackofficeReports.vue.d.ts +2 -0
  91. package/dist/modules/reports/components/sections/FormReport.vue.d.ts +75 -0
  92. package/dist/modules/reports/store/reports.d.ts +41 -0
  93. package/dist/organizations-a241b21d.js +1 -0
  94. package/dist/organizations-ea9de495.mjs +122 -0
  95. package/dist/organizations.client-292e8444.js +3 -0
  96. package/dist/organizations.client-6fc91683.mjs +3072 -0
  97. package/dist/organizations.client.cjs +1 -1
  98. package/dist/organizations.client.js +51 -49
  99. package/dist/organizations.server.js +20 -28
  100. package/dist/organizations.server.mjs +20 -28
  101. package/dist/prometheus-framework.cjs.js +19 -19
  102. package/dist/prometheus-framework.es.js +1635 -1608
  103. package/dist/reports-270f69df.js +1 -0
  104. package/dist/reports-79cd9459.mjs +91 -0
  105. package/dist/reports.client.cjs +1 -0
  106. package/dist/reports.client.js +8 -0
  107. package/dist/reports.server.js +159 -0
  108. package/dist/reports.server.mjs +160 -0
  109. package/dist/states.validation-02ba0aee.js +1 -0
  110. package/dist/states.validation-e5f4fa3a.mjs +13 -0
  111. package/dist/style.css +1 -1
  112. package/dist/users.client.cjs +1 -1
  113. package/dist/users.client.js +286 -242
  114. package/dist/users.server.js +6 -18
  115. package/dist/users.server.mjs +6 -18
  116. package/package.json +9 -1
  117. package/src/components/Button/Button.vue +66 -60
  118. package/src/components/CardHeader/CardHeader.vue +51 -50
  119. package/src/components/Dropdown/Dropdown.vue +28 -12
  120. package/src/components/FieldPhone/click-outside.js +0 -48
  121. package/src/components/Popup/Popup.vue +74 -23
  122. package/src/components/Select/Select.vue +10 -6
  123. package/src/main.ts +1 -1
  124. package/src/modules/auth/components/pages/EnterPassword.vue +6 -0
  125. package/src/modules/auth/router/auth.js +1 -1
  126. package/src/modules/auth/store/auth.js +1 -1
  127. package/src/modules/backoffice/components/layouts/Backoffice.vue +3 -3
  128. package/src/modules/backoffice/components/pages/Dashboard.vue +62 -0
  129. package/src/modules/backoffice/router/backoffice.js +26 -0
  130. package/src/modules/community/components/blocks/CardBlogpost.vue +3 -0
  131. package/src/modules/community/components/layouts/Community.vue +4 -4
  132. package/src/modules/community/components/pages/CreateBlogPost.vue +27 -28
  133. package/src/modules/community/components/sections/Comments.vue +4 -2
  134. package/src/modules/community/components/sections/Feed.vue +1 -1
  135. package/src/modules/community/controllers/blog.controller.js +22 -3
  136. package/src/modules/community/controllers/comments.controller.js +23 -5
  137. package/src/modules/events/components/blocks/CardEvent.vue +4 -0
  138. package/src/modules/events/components/pages/EditEvent.vue +27 -28
  139. package/src/modules/events/components/sections/Feed.vue +1 -1
  140. package/src/modules/events/controllers/events.controller.js +3 -10
  141. package/src/modules/gallery/components/sections/BackofficeGallery.vue +7 -23
  142. package/src/modules/icons/navigation/IconCross.vue +22 -0
  143. package/src/modules/legal/components/pages/Legal.vue +3 -0
  144. package/src/modules/legal/components/pages/legal/EULA.vue +2148 -0
  145. package/src/modules/legal/router/legal.js +11 -4
  146. package/src/modules/middlewares/client/auth.validation.js +14 -0
  147. package/src/modules/mobile/components/Menu/Menu.vue +1 -1
  148. package/src/modules/organizations/components/blocks/CardOrganization.vue +1 -1
  149. package/src/modules/organizations/components/elements/ButtonFollow.vue +9 -7
  150. package/src/modules/organizations/components/elements/ButtonToggleMembership.vue +101 -0
  151. package/src/modules/organizations/components/pages/Organization.vue +1 -34
  152. package/src/modules/organizations/components/sections/DetailsTab.vue +86 -8
  153. package/src/modules/organizations/controllers/memberships.controller.js +10 -7
  154. package/src/modules/organizations/controllers/organizations.controller.js +9 -20
  155. package/src/modules/organizations/controllers/utils/addMembersQuantity.js +21 -0
  156. package/src/modules/organizations/controllers/utils/addUserStatusFields.js +65 -0
  157. package/src/modules/organizations/controllers/utils/excludeBlockedMembers.js +18 -0
  158. package/src/modules/organizations/models/membership.model.js +5 -5
  159. package/src/modules/organizations/store/memberships.js +6 -6
  160. package/src/modules/organizations/store/organizations.js +0 -1
  161. package/src/modules/products/products.server.js +5 -0
  162. package/src/modules/reports/components/pages/BackofficeReports.vue +67 -0
  163. package/src/modules/reports/components/sections/FormReport.vue +114 -0
  164. package/src/modules/reports/controllers/reports.controller.js +67 -0
  165. package/src/modules/reports/models/report.model.js +58 -0
  166. package/src/modules/reports/reports.client.js +17 -0
  167. package/src/modules/reports/reports.server.js +13 -0
  168. package/src/modules/reports/routes/reports.routes.js +43 -0
  169. package/src/modules/reports/store/reports.js +118 -0
  170. package/src/modules/users/components/pages/Profile.vue +57 -10
  171. package/src/modules/users/controllers/users.controller.js +6 -19
  172. package/src/styles/base/all.scss +2 -0
  173. package/src/styles/layout.scss +39 -63
  174. package/src/styles/theme.scss +0 -1
  175. package/src/styles/components/popup.scss +0 -55
@@ -0,0 +1 @@
1
+ "use strict";const e=require("vue"),m=require("./_plugin-vue_export-helper-f246444f.js"),f=require("vue-router"),w=require("vue-i18n"),y=require("./Button-2ca405bd.js"),b=require("./Select-3ca5ab39.js"),C=require("./reports-270f69df.js"),k=require("./click-outside-0b0727d1.js"),x=require("./index-b41aac19.js"),u=require("./globals-928eb13c.js"),L={},P={width:"26",height:"26",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg"},$=e.createElementVNode("rect",{width:"24",height:"24",transform:"translate(1 1)"},null,-1),E=e.createElementVNode("path",{fill:"rgb(var(--black))","fill-rule":"evenodd","clip-rule":"evenodd",d:"M12.9996 10.8L22.8994 0.900244L25.0993 3.1002L15.1995 13L25.0993 22.8998L22.8994 25.0998L12.9996 15.2L3.09976 25.0998L0.899801 22.8998L10.7996 13L0.899801 3.1002L3.09976 0.900244L12.9996 10.8Z"},null,-1),V=[$,E];function N(r,t){return e.openBlock(),e.createElementBlock("svg",P,V)}const S=m._export_sfc(L,[["render",N]]);const B={key:"popup-content",class:"pd-small popup-wrapper"},h={__name:"Popup",props:{isPopupOpen:{type:Boolean,default:!1},style:String},emits:["close-popup"],setup(r,{emit:t}){const n=r;function l(){t("close-popup")}e.watch(()=>n.isPopupOpen,i=>{i?document.body.classList.add("no-scroll"):document.body.classList.remove("no-scroll")}),f.useRoute(),f.useRouter();const s={messages:{en:{},ru:{}}};return w.useI18n(s),(i,o)=>r.isPopupOpen?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:"body"},[e.createVNode(e.Transition,{name:"TransitionTranslateY",appear:""},{default:e.withCtx(()=>[r.isPopupOpen?(e.openBlock(),e.createElementBlock("div",B,[e.createVNode(e.Transition,{name:"TransitionTranslateY",mode:"out-in"},{default:e.withCtx(()=>[r.isPopupOpen?(e.openBlock(),e.createElementBlock("section",e.mergeProps({key:0,class:"pos-relative z-index-4"},i.$attrs),[e.createElementVNode("button",{onClick:o[0]||(o[0]=a=>l()),class:"pd-regular hover-scale-1 z-index-5 button-close-popup button"},[e.createVNode(S)]),e.renderSlot(i.$slots,"default")],16)):e.createCommentVNode("",!0)]),_:3}),e.createElementVNode("div",{onClick:o[1]||(o[1]=a=>l()),class:e.normalizeClass([{active:r.isPopupOpen===!0},"color-overlay z-index-3"])},null,2)])):e.createCommentVNode("",!0)]),_:3})])):e.createCommentVNode("",!0)}},O={},q={viewBox:"0 0 42 42",fill:"none",xmlns:"http://www.w3.org/2000/svg"},T=e.createElementVNode("circle",{fill:"rgb(var(--main))",cx:"21",cy:"21",r:"21"},null,-1),R=e.createElementVNode("path",{fill:"#242424","fill-opacity":"0.1","fill-rule":"evenodd","clip-rule":"evenodd",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"},null,-1),M=[T,R];function I(r,t){return e.openBlock(),e.createElementBlock("svg",q,M)}const j=m._export_sfc(O,[["render",I]]),D=e.createElementVNode("h3",{class:"mn-small"}," Report Content ",-1),Z=e.createElementVNode("p",{class:"p-medium mn-small"}," We strive to maintain a safe and comfortable environment for all users. If you encounter content that you believe violates our guidelines, please report it: ",-1),z=e.createElementVNode("p",{class:"p-medium mn-small"},"Our moderators will review your report within 24 hours and take action if it violates our policies.",-1),U={__name:"FormReport",props:{user:{type:String,required:!1},type:{type:String,required:!1},reason:{type:String,required:!1},target:{type:String,required:!0},text:{type:String,default:"!"},status:{type:String,default:"new"}},setup(r){const t=r,n=e.reactive({user:t.user,type:t.type,reason:t.reason,target:t.target,status:t.status});function l(){C.actions.create(n)}const s=e.ref(!1);function i(){s.value=!0}function o(){s.value=!1}return(a,p)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{onClick:p[0]||(p[0]=_=>i())},[e.renderSlot(a.$slots,"default")]),e.createVNode(h,{onClosePopup:o,isPopupOpen:s.value,class:"w-m-33r t-left pd-big bg-white radius-big"},{default:e.withCtx(()=>[D,Z,e.createVNode(b.Select,{select:n.reason,"onUpdate:select":p[1]||(p[1]=_=>n.reason=_),options:["harassment","spam","inappropriate","misinformation","copyright","other"],placeholder:"Select reason",class:"mn-small bg-white br-solid br-black-transp br-1px uppercase pd-medium t-semi bg-white t-black radius-medium"},null,8,["select"]),z,e.createVNode(y._sfc_main,{submit:l,callback:o,class:"w-100 bg-black t-white"},{default:e.withCtx(()=>[e.createTextVNode(" Report ")]),_:1})]),_:1},8,["isPopupOpen"])],64))}};const A={__name:"Dropdown",props:{label:{type:String,default:"Open"},align:{type:String,default:"left"}},setup(r){let t=k.clickOutside;const n=e.ref(!1);function l(){n.value=!1}return(s,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:"dropdown pos-relative",onClick:i[0]||(i[0]=e.withModifiers(o=>n.value=!n.value,["stop"]))},[e.createTextVNode(e.toDisplayString(r.label)+" ",1),e.createVNode(e.Transition,{name:"TransitionTranslateY",mode:"out-in"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{style:e.normalizeStyle({left:r.align==="left"?"0":"auto",right:r.align==="right"?"0":"auto"}),class:"dropdown-content w-15r radius-big"},[e.renderSlot(s.$slots,"default",{},void 0,!0)],4),[[e.vShow,n.value]])]),_:3})])),[[e.unref(t),l]])}},H=m._export_sfc(A,[["__scopeId","data-v-5646d77f"]]),d=x.axios.create({baseURL:process.env.API_URL,withCredentials:!0}),c=e.reactive({memberships:[],error:null}),v={async read({user:r,type:t,target:n,role:l}){try{const s=await d.get("/api/memberships",{params:{user:r,type:t,target:n,role:l}});return c.error=null,c.memberships=s.data,Promise.resolve(s.data)}catch(s){return u.setError(s),Promise.reject(s)}},async create(r){try{const t=await d.post("/api/memberships/create",r);return c.error=null,Promise.resolve(t.data)}catch(t){return u.setError(t),Promise.reject(t)}},async update(r){try{const t=await d.post("/api/memberships/update",r);return c.error=null,Promise.resolve(t.data)}catch(t){return u.setError(t),Promise.reject(t)}},async delete(r){try{const t=await d.post("/api/memberships/delete",r);return c.error=null,Promise.resolve(t.data)}catch(t){return u.setError(t),Promise.reject(t)}}},g={handleMembershipUpdate(r,t,n,l,s,i){let o;if(Array.isArray(r)?o=r.find(a=>a._id===t.target):typeof r=="object"&&r._id===t.target&&(o=r),o)if(o[s]=n,n)o.memberships.push(t),o[i]+=1;else{const a=o.memberships.findIndex(p=>p._id===t._id);a!==-1&&(o.memberships.splice(a,1),o[i]-=1)}}};e.watch(c,r=>{});const Y=Object.freeze(Object.defineProperty({__proto__:null,actions:v,mutations:g,state:c},Symbol.toStringTag,{value:"Module"})),F={},W={width:"652",height:"652",viewBox:"0 0 652 652",fill:"none",xmlns:"http://www.w3.org/2000/svg"},G=e.createElementVNode("path",{fill:"rgb(var(--black))",d:"M515.693 9.52082C510.095 3.91669 502.49 0.765625 494.563 0.765625C486.635 0.765625 479.036 3.91669 473.432 9.52082L48.7255 434.307C44.8244 438.214 42.0848 443.125 40.8088 448.496L0.939444 615.069C-1.47202 625.168 1.528 635.788 8.86652 643.132C16.2103 650.47 26.8305 653.47 36.9292 651.059L203.516 611.261H203.511C208.88 609.985 213.792 607.246 217.699 603.35L642.485 178.496C648.089 172.892 651.241 165.293 651.241 157.366C651.241 149.439 648.089 141.835 642.485 136.235L515.693 9.52082ZM113.76 453.708L388.307 179.161L472.828 263.682L198.281 538.229L113.76 453.708ZM87.1041 511.5L140.416 564.812L70.3014 581.614L87.1041 511.5ZM515.091 221.793L430.195 136.897L494.184 72.9075L579.08 157.429L515.091 221.793Z"},null,-1),J=[G];function K(r,t){return e.openBlock(),e.createElementBlock("svg",W,J)}const Q=m._export_sfc(F,[["render",K]]);exports.Dropdown=H;exports.IconEdit=Q;exports.PlaceholderUserpic=j;exports._sfc_main=U;exports._sfc_main$1=h;exports.actions=v;exports.memberships=Y;exports.mutations=g;exports.state=c;
@@ -0,0 +1,480 @@
1
+ import { ref as d, onUpdated as U, nextTick as b, onMounted as F, openBlock as i, createElementBlock as p, withDirectives as B, createElementVNode as v, vModelText as $, watch as E, createTextVNode as j, toDisplayString as I, withModifiers as D, watchEffect as K, unref as _, createBlock as R, withCtx as L, Fragment as V, renderList as A, resolveDynamicComponent as P, normalizeClass as W, createVNode as H, Transition as q, createCommentVNode as w } from "vue";
2
+ import { a as S } from "./index-a661083c.mjs";
3
+ import { V as G } from "./vue-draggable-next.esm-bundler-ff6e3f52.mjs";
4
+ import { _ as J } from "./Chips-2ada5eda.mjs";
5
+ const O = ["placeholder"], Q = {
6
+ __name: "Textarea",
7
+ props: ["prop", "value", "content", "placeholder", "index", "setFocus"],
8
+ emits: ["deleteBlock", "updateBlock", "addBlock", "focus"],
9
+ setup(n, { emit: s }) {
10
+ const t = n;
11
+ d(t);
12
+ const e = d(null);
13
+ d(0);
14
+ function f(o) {
15
+ let l = o.target.value.split(/\n+/);
16
+ if (l.length > 1) {
17
+ t.prop[t.content] = l[0], b(() => {
18
+ a();
19
+ });
20
+ let c = l.slice(1).map((h) => ({ __name: "Textarea", content: h }));
21
+ s("addBlock", "Textarea", "", t.index, { blocks: c, ref: e });
22
+ } else
23
+ o.target.value.trim() === "" && o.target.value.includes(`
24
+
25
+ `) && (console.log("We are adding new block:" + t.index + newBlocks + e), s("addBlock", "Textarea", "", t.index, { blocks: newBlocks, ref: e })), a();
26
+ }
27
+ function u(o) {
28
+ (o.keyCode === 8 || o.keyCode === 46) && t.prop[t.content].trim() === "" && s("deleteBlock", t.prop);
29
+ }
30
+ function r() {
31
+ b(() => {
32
+ e.value.focus(), s("updateBlock", t.prop, { setFocus: !1 });
33
+ });
34
+ }
35
+ function a() {
36
+ e.value.style.height = "1rem", e.value.style.height = e.value.scrollHeight + "px";
37
+ }
38
+ return U(() => {
39
+ t.setFocus && b(() => {
40
+ r();
41
+ }), a();
42
+ }), F(() => {
43
+ t.setFocus && b(() => {
44
+ r();
45
+ }), a();
46
+ }), (o, l) => (i(), p("div", null, [
47
+ B(v("textarea", {
48
+ "onUpdate:modelValue": l[0] || (l[0] = (c) => n.prop[n.content] = c),
49
+ placeholder: n.placeholder ? n.placeholder : "Enter text",
50
+ onInput: f,
51
+ onFocus: l[1] || (l[1] = (c) => s("focus", e.value)),
52
+ onKeyup: u,
53
+ ref_key: "textarea",
54
+ ref: e,
55
+ class: "text-area mn-thin"
56
+ }, `
57
+ `, 40, O), [
58
+ [$, n.prop[n.content]]
59
+ ])
60
+ ]));
61
+ }
62
+ };
63
+ const X = ["placeholder"], Y = {
64
+ __name: "H2",
65
+ props: ["obj", "label", "prop", "value", "content", "textarea", "placeholder", "index", "ref", "setFocus"],
66
+ emits: ["deleteBlock", "updateBlock", "addBlock", "focus"],
67
+ setup(n, { emit: s }) {
68
+ const t = n;
69
+ d(t);
70
+ const e = d(null);
71
+ d(0);
72
+ function f(o) {
73
+ let l = o.target.value.split(/\n+/);
74
+ if (l.length > 1) {
75
+ t.prop[t.content] = l[0], b(() => {
76
+ a();
77
+ });
78
+ let c = l.slice(1).map((h) => ({ type: "Textarea", content: h }));
79
+ s("addBlock", "Textarea", "", t.index, { blocks: c, ref: e });
80
+ } else
81
+ o.target.value.trim() === "" && o.target.value.includes(`
82
+
83
+ `) && (console.log("We are adding new block:" + t.index + newBlocks + e), s("addBlock", "Textarea", "", t.index, { blocks: newBlocks, ref: e })), a();
84
+ }
85
+ function u(o) {
86
+ (o.keyCode === 8 || o.keyCode === 46) && t.prop[t.content].trim() === "" && s("deleteBlock", t.prop);
87
+ }
88
+ function r() {
89
+ b(() => {
90
+ e.value.focus(), s("updateBlock", t.prop, { setFocus: !1 });
91
+ });
92
+ }
93
+ function a() {
94
+ e.value.style.height = "1rem", e.value.style.height = e.value.scrollHeight + "px";
95
+ }
96
+ return U(() => {
97
+ t.setFocus && b(() => {
98
+ r();
99
+ }), a();
100
+ }), F(() => {
101
+ t.setFocus && b(() => {
102
+ r();
103
+ }), a();
104
+ }), E(() => t.prop[t.content], (o) => {
105
+ }), (o, l) => (i(), p("div", null, [
106
+ B(v("textarea", {
107
+ "onUpdate:modelValue": l[0] || (l[0] = (c) => n.prop[n.content] = c),
108
+ placeholder: n.placeholder ? n.placeholder : "Enter text",
109
+ onInput: f,
110
+ onFocus: l[1] || (l[1] = (c) => s("focus", e.value)),
111
+ onKeyup: u,
112
+ ref_key: "textarea",
113
+ ref: e,
114
+ class: "h3 text-area mn-thin"
115
+ }, `
116
+ `, 40, X), [
117
+ [$, n.prop[n.content]]
118
+ ])
119
+ ]));
120
+ }
121
+ }, Z = ["placeholder"], ee = {
122
+ __name: "Caption",
123
+ props: ["obj", "label", "prop", "value", "content", "textarea", "placeholder", "index", "ref"],
124
+ emits: ["deleteBlock", "addBlock", "focus"],
125
+ setup(n, { emit: s }) {
126
+ const t = n;
127
+ d(t);
128
+ const e = d(null);
129
+ function f(r) {
130
+ const a = /^\s*[-*]\s+(.*)/;
131
+ let l = r.target.value.split(/\n+/).map((c) => {
132
+ const h = a.exec(c);
133
+ return h ? h[1] : null;
134
+ }).filter((c) => c !== null);
135
+ l.length > 0 ? (t.prop[t.content] = l, u()) : r.target.value.trim() === "" && (t.prop[t.content] = [], u());
136
+ }
137
+ function u() {
138
+ e.value.style.height = "1rem", e.value.style.height = e.value.scrollHeight + "px";
139
+ }
140
+ return U(() => {
141
+ u();
142
+ }), F(() => {
143
+ u();
144
+ }), E(() => t.prop[t.content], (r) => {
145
+ (!r || r.length === 0) && s("deleteBlock", t.prop);
146
+ }), (r, a) => (i(), p("div", null, [
147
+ B(v("textarea", {
148
+ "onUpdate:modelValue": a[0] || (a[0] = (o) => n.prop[n.content] = o),
149
+ placeholder: n.placeholder ? n.placeholder : "Enter text",
150
+ onInput: f,
151
+ onFocus: a[1] || (a[1] = (o) => s("focus", e.value)),
152
+ ref_key: "textarea",
153
+ ref: e,
154
+ class: "br-l br-solid br-main pd-l-small text-area mn-small"
155
+ }, `
156
+ `, 40, Z), [
157
+ [$, n.prop[n.content]]
158
+ ])
159
+ ]));
160
+ }
161
+ }, te = ["placeholder"], ne = {
162
+ __name: "Bullets",
163
+ props: ["obj", "label", "prop", "value", "content", "textarea", "placeholder", "index", "ref"],
164
+ emits: ["deleteBlock", "addBlock", "focus"],
165
+ setup(n, { emit: s }) {
166
+ const t = n;
167
+ d(t);
168
+ const e = d(null);
169
+ function f(r) {
170
+ const a = /^\s*[-*]\s+(.*)/;
171
+ let l = r.target.value.split(/\n+/).map((c) => {
172
+ const h = a.exec(c);
173
+ return h ? h[1] : null;
174
+ }).filter((c) => c !== null);
175
+ l.length > 0 ? (t.prop[t.content] = l, u()) : r.target.value.trim() === "" && (t.prop[t.content] = [], u());
176
+ }
177
+ function u() {
178
+ e.value.style.height = "1rem", e.value.style.height = e.value.scrollHeight + "px";
179
+ }
180
+ return U(() => {
181
+ u();
182
+ }), F(() => {
183
+ u();
184
+ }), E(() => t.prop[t.content], (r) => {
185
+ (!r || r.length === 0) && s("deleteBlock", t.prop);
186
+ }), (r, a) => (i(), p("div", null, [
187
+ j(I(n.prop[n.content]) + " ", 1),
188
+ B(v("textarea", {
189
+ "onUpdate:modelValue": a[0] || (a[0] = (o) => n.prop[n.content] = o),
190
+ placeholder: n.placeholder ? n.placeholder : "Enter text",
191
+ onInput: f,
192
+ onFocus: a[1] || (a[1] = (o) => s("focus", e.value)),
193
+ ref_key: "textarea",
194
+ ref: e,
195
+ class: "text-area mn-small"
196
+ }, `
197
+ `, 40, te), [
198
+ [$, n.prop[n.content]]
199
+ ])
200
+ ]));
201
+ }
202
+ }, le = ["src"], oe = {
203
+ key: 1,
204
+ class: "t-transp pd-extra"
205
+ }, ae = {
206
+ __name: "ImageUpload",
207
+ props: [
208
+ "label",
209
+ "value",
210
+ "prop"
211
+ ],
212
+ emits: ["input", "updateBlock"],
213
+ setup(n, { emit: s }) {
214
+ const t = n, e = d(null), f = d(null);
215
+ function u() {
216
+ f.value.click();
217
+ }
218
+ async function r(o) {
219
+ let l = o.target.files[0];
220
+ console.log(l);
221
+ let c = new FormData(), h = "unsorted";
222
+ c.append("file", l), console.log(c.has("file"));
223
+ try {
224
+ let y = await S.create({ baseURL: process.env.API_URL, withCredentials: !0 }).post(`/api/upload/file?folderName=${encodeURIComponent(h)}`, c, {
225
+ headers: {
226
+ "Content-Type": "multipart/form-data"
227
+ }
228
+ });
229
+ e.value = y.data.filepath, console.log(e.value), s("input", e.value), s("updateBlock", t.prop, { content: e.value });
230
+ } catch (C) {
231
+ console.error(C);
232
+ }
233
+ }
234
+ function a(o) {
235
+ o.preventDefault(), r({
236
+ target: {
237
+ files: o.dataTransfer.files
238
+ }
239
+ });
240
+ }
241
+ return (o, l) => (i(), p("div", {
242
+ onClick: u,
243
+ onDrop: a,
244
+ onDragover: l[0] || (l[0] = D(() => {
245
+ }, ["prevent"])),
246
+ class: "w-100 radius-big bg-white image-upload-area flex-v-center flex-h-center flex t-black mn-small"
247
+ }, [
248
+ n.prop.content ? (i(), p("img", {
249
+ key: 0,
250
+ src: (o.FILE_SERVER_URL || "") + n.prop.content,
251
+ alt: "Uploaded image",
252
+ class: "w-100 h-30r object-fit-contain"
253
+ }, null, 8, le)) : (i(), p("span", oe, "Click or drag-and-drop your image")),
254
+ v("input", {
255
+ type: "file",
256
+ ref_key: "fileInput",
257
+ ref: f,
258
+ onChange: r,
259
+ style: { display: "none" }
260
+ }, null, 544)
261
+ ], 32));
262
+ }
263
+ }, se = ["onMouseover"], re = {
264
+ key: 0,
265
+ class: "z-index-5 radius-thin mn-small relative left-0 mt-2 w-max bg-white shadow-lg rounded"
266
+ }, ce = ["onClick"], ue = ["onClick"], ie = ["onClick"], Ce = {
267
+ __name: "Constructor",
268
+ props: ["content"],
269
+ emits: ["update"],
270
+ setup(n, { emit: s }) {
271
+ const t = n;
272
+ let e = d(null);
273
+ d(null), e.value = { content: t.content };
274
+ const f = {
275
+ Textarea: Q,
276
+ H2: Y,
277
+ Bullets: ne,
278
+ Caption: ee,
279
+ ImageUpload: ae
280
+ };
281
+ function u(y = "Textarea", x = "", m, g) {
282
+ console.log("We are adding new block (functuin HandleAddBlock):" + y + x + m + g);
283
+ let k = {
284
+ order: e.value.content.length + 1,
285
+ type: y,
286
+ style: "",
287
+ class: "",
288
+ content: x,
289
+ blocks: [],
290
+ setFocus: !0
291
+ };
292
+ if (g && g.blocks && Array.isArray(g.blocks)) {
293
+ let T = g.blocks.map((N) => ({
294
+ ...k,
295
+ content: N.content
296
+ })), z = [(g.index || m) + 1, 0].concat(T);
297
+ e.value.content.splice.apply(e.value.content, z);
298
+ const M = T[T.length - 1];
299
+ console.log("New block is" + M);
300
+ } else
301
+ m !== void 0 ? (e.value.content.splice(m + 1, 0, k), console.log("Latest block is" + k)) : (console.log("Another block is" + k), e.value.content.push(k));
302
+ o.value = null, s("update", e.value.content);
303
+ }
304
+ function r(y, x) {
305
+ const m = e.value.content.findIndex((g) => g === y);
306
+ m !== -1 && (e.value.content[m] = { ...e.value.content[m], ...x }), s("update", e.value.content);
307
+ }
308
+ function a(y) {
309
+ let x = e.value.content.findIndex((m) => m === y);
310
+ x !== -1 && e.value.content.splice(x, 1), e.value.content[x - 1].setFocus = !0, s("update", e.value.content);
311
+ }
312
+ const o = d(null), l = d(!1), c = d(!1);
313
+ function h() {
314
+ l.value = !0;
315
+ }
316
+ function C() {
317
+ l.value = !1;
318
+ }
319
+ return K(() => {
320
+ e.value && e.value.content.length === 0 && u("Textarea", ""), s("update", e.value.content);
321
+ }), (y, x) => (i(), p("section", null, [
322
+ _(e).content ? (i(), R(_(G), {
323
+ key: 0,
324
+ class: "w-full",
325
+ list: _(e).content,
326
+ onStart: h,
327
+ onEnd: C
328
+ }, {
329
+ default: L(() => [
330
+ (i(!0), p(V, null, A(_(e).content, (m, g) => (i(), p("div", {
331
+ key: g,
332
+ class: "pos-relative"
333
+ }, [
334
+ v("div", {
335
+ onMouseover: (k) => (o.value = g, c.value = !1),
336
+ class: "pos-relative w-full h-full"
337
+ }, [
338
+ (i(), R(P(f[m.type]), {
339
+ index: g,
340
+ component: m,
341
+ prop: m,
342
+ class: W(m.class),
343
+ setFocus: m.setFocus,
344
+ content: "content",
345
+ onDeleteBlock: a,
346
+ onAddBlock: u,
347
+ onUpdateBlock: r
348
+ }, null, 40, ["index", "component", "prop", "class", "setFocus"]))
349
+ ], 40, se),
350
+ H(q, { name: "fade" }, {
351
+ default: L(() => [
352
+ o.value === g ? (i(), p("div", {
353
+ key: 0,
354
+ class: "pos-absolute pos-r-100 pos-t-0 z-index-4 i-semi",
355
+ onMousedown: x[1] || (x[1] = D((k) => l.value = !0, ["prevent"]))
356
+ }, [
357
+ v("button", {
358
+ onClick: x[0] || (x[0] = (k) => c.value = !c.value),
359
+ class: "mn-small w-100 i-semi bg-white radius-thin"
360
+ }, I(m.content ? "..." : "+"), 1),
361
+ c.value ? (i(), p("div", re, [
362
+ v("button", {
363
+ onClick: (k) => a(m),
364
+ class: "block w-max text-left px-4 py-2 hover:bg-gray-200"
365
+ }, "Remove", 8, ce),
366
+ v("button", {
367
+ onClick: (k) => u("ImageUpload", "", g),
368
+ class: "block w-max text-left px-4 py-2 hover:bg-gray-200"
369
+ }, "Add Image", 8, ue),
370
+ v("button", {
371
+ onClick: (k) => u("H2", "", g),
372
+ class: "block w-max text-left px-4 py-2 hover:bg-gray-200"
373
+ }, "Add Title", 8, ie)
374
+ ])) : w("", !0)
375
+ ], 32)) : w("", !0)
376
+ ]),
377
+ _: 2
378
+ }, 1024)
379
+ ]))), 128))
380
+ ]),
381
+ _: 1
382
+ }, 8, ["list"])) : w("", !0)
383
+ ]));
384
+ }
385
+ }, de = { class: "mn-small" }, pe = /* @__PURE__ */ v("p", { class: "t-semi uppercase" }, "Please log in to leave a comment.", -1), fe = [
386
+ pe
387
+ ], me = {
388
+ key: 1,
389
+ class: "mn-small"
390
+ }, ve = ["onSubmit"], ge = /* @__PURE__ */ v("button", {
391
+ type: "submit",
392
+ class: "mn-l-auto bg-main button"
393
+ }, "Send", -1), he = { class: "pd-t-zero" }, xe = { class: "p-big" }, _e = {
394
+ __name: "Comments",
395
+ props: ["target", "owner", "type"],
396
+ setup(n) {
397
+ const s = n, t = S.create({ baseURL: process.env.API_URL }), e = d([]), f = d(""), u = async () => {
398
+ const { data: a } = await t.get(`/comments/read?type=${s.type}&target=${s.target}&user=${s.owner}`);
399
+ e.value = a;
400
+ }, r = async () => {
401
+ if (f.value)
402
+ try {
403
+ const a = await t.post("/comments/create", {
404
+ target: s.target,
405
+ user: s.owner,
406
+ type: s.type,
407
+ content: f.value
408
+ });
409
+ a.data.owner = s.owner, e.value.push(a.data), f.value = "";
410
+ } catch (a) {
411
+ console.error(a);
412
+ }
413
+ };
414
+ return u(), (a, o) => (i(), p("div", null, [
415
+ v("div", null, [
416
+ v("h3", de, I(e.value.length) + " comments", 1),
417
+ n.owner ? w("", !0) : (i(), p("div", {
418
+ key: 0,
419
+ onClick: o[0] || (o[0] = (l) => a.$router.push({ name: "Sign In" })),
420
+ class: "cursor-pointer mn-small section bg-black t-white flex-center flex radius-big"
421
+ }, fe)),
422
+ n.owner ? (i(), p("div", me, [
423
+ v("form", {
424
+ onSubmit: D(r, ["prevent"]),
425
+ class: "bg-grey radius-big pd-medium"
426
+ }, [
427
+ B(v("textarea", {
428
+ "onUpdate:modelValue": o[1] || (o[1] = (l) => f.value = l),
429
+ placeholder: "Enter your comment",
430
+ class: "pd-small p-big w-100 radius-small mn-r-small"
431
+ }, null, 512), [
432
+ [$, f.value]
433
+ ]),
434
+ ge
435
+ ], 40, ve)
436
+ ])) : w("", !0)
437
+ ]),
438
+ (i(!0), p(V, null, A(e.value, (l) => (i(), p("div", {
439
+ key: l._id,
440
+ class: "comment mn-small radius-big pd-medium bg-grey"
441
+ }, [
442
+ H(J, {
443
+ class: "mn-medium",
444
+ entity: l,
445
+ entityType: "comment",
446
+ user: n.owner,
447
+ owner: { target: l.user },
448
+ creator: { target: l.user },
449
+ date: l.createdAt
450
+ }, null, 8, ["entity", "user", "owner", "creator", "date"]),
451
+ v("div", he, [
452
+ v("p", xe, I(l.content), 1)
453
+ ])
454
+ ]))), 128))
455
+ ]));
456
+ }
457
+ }, ke = { class: "w-100 bg-white radius-big image-upload-area flex-v-center flex-h-center flex t-black mn-small" }, ye = ["src"], Ie = {
458
+ __name: "Image",
459
+ props: [
460
+ "label",
461
+ "value",
462
+ "prop"
463
+ ],
464
+ setup(n) {
465
+ return d(null), (s, t) => (i(), p("div", ke, [
466
+ n.prop.content ? (i(), p("img", {
467
+ key: 0,
468
+ src: (s.FILE_SERVER_URL || "") + n.prop.content,
469
+ alt: "Uploaded image",
470
+ class: "w-100 h-30r object-fit-contain"
471
+ }, null, 8, ye)) : w("", !0)
472
+ ]));
473
+ }
474
+ };
475
+ export {
476
+ Q as _,
477
+ Ce as a,
478
+ _e as b,
479
+ Ie as c
480
+ };
@@ -0,0 +1,9 @@
1
+ "use strict";const e=require("vue"),B=require("./index-b41aac19.js"),$=require("./vue-draggable-next.esm-bundler-80731ae0.js"),C=require("./Chips-8d0a1d2c.js");const _=["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,_),[[e.vModelText,o.prop[o.content]]])]))}};const V=["placeholder"],N={__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]]])]))}},T=["placeholder"],U={__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,T),[[e.vModelText,o.prop[o.content]]])]))}},D=["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,D),[[e.vModelText,o.prop[o.content]]])]))}},I=["src"],M={key:1,class:"t-transp pd-extra"},R={__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:(a.FILE_SERVER_URL||"")+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))}},L=["onMouseover"],S={key:0,class:"z-index-5 radius-thin mn-small relative left-0 mt-2 w-max bg-white shadow-lg rounded"},A=["onClick"],H=["onClick"],z=["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:N,Bullets:F,Caption:U,ImageUpload:R};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($.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:"pos-relative"},[e.createElementVNode("div",{onMouseover:v=>(a.value=m,u.value=!1),class:"pos-relative 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,L),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",S,[e.createElementVNode("button",{onClick:v=>c(p),class:"block w-max text-left px-4 py-2 hover:bg-gray-200"},"Remove",8,A),e.createElementVNode("button",{onClick:v=>i("ImageUpload","",m),class:"block w-max text-left px-4 py-2 hover:bg-gray-200"},"Add Image",8,H),e.createElementVNode("button",{onClick:v=>i("H2","",m),class:"block w-max text-left px-4 py-2 hover:bg-gray-200"},"Add Title",8,z)])):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}&user=${r.owner}`);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(C._sfc_main,{class:"mn-medium",entity:l,entityType:"comment",user:o.owner,owner:{target:l.user},creator:{target:l.user},date:l.createdAt},null,8,["entity","user","owner","creator","date"]),e.createElementVNode("div",O,[e.createElementVNode("p",Q,e.toDisplayString(l.content),1)])]))),128))]))}},Y={class:"w-100 bg-white radius-big image-upload-area flex-v-center flex-h-center flex t-black mn-small"},Z=["src"],ee={__name:"Image",props:["label","value","prop"],setup(o){return e.ref(null),(r,n)=>(e.openBlock(),e.createElementBlock("div",Y,[o.prop.content?(e.openBlock(),e.createElementBlock("img",{key:0,src:(r.FILE_SERVER_URL||"")+o.prop.content,alt:"Uploaded image",class:"w-100 h-30r object-fit-contain"},null,8,Z)):e.createCommentVNode("",!0)]))}};exports._sfc_main=y;exports._sfc_main$1=j;exports._sfc_main$2=X;exports._sfc_main$3=ee;
@@ -0,0 +1,93 @@
1
+ import { openBlock as o, createElementBlock as c, renderSlot as a, createElementVNode as m, defineComponent as p, h as n } from "vue";
2
+ import { _ as h } from "./_plugin-vue_export-helper-dad06003.mjs";
3
+ const u = { class: "mobile-menu-section pd-r-zero pd-t-thin pd-b-thin pd-medium radius-medium" }, v = {
4
+ __name: "Menu",
5
+ setup(l) {
6
+ return (t, s) => (o(), c("section", u, [
7
+ a(t.$slots, "default")
8
+ ]));
9
+ }
10
+ }, _ = {
11
+ props: {
12
+ theme: {
13
+ type: String,
14
+ default: "black"
15
+ }
16
+ }
17
+ }, d = {
18
+ width: "80",
19
+ height: "80",
20
+ viewBox: "0 0 80 80",
21
+ fill: "none",
22
+ xmlns: "http://www.w3.org/2000/svg"
23
+ }, f = ["fill"];
24
+ function x(l, t, s, i, r, e) {
25
+ return o(), c("svg", d, [
26
+ m("path", {
27
+ fill: s.theme,
28
+ d: "M16.25 9.375L20 5.9375C21.5625 4.53125 23.9062 4.6875 25.3125 6.25L54.2188 37.8125C55.3125 39.0625 55.3125 40.9375 54.2188 42.1875L25.3125 73.75C23.9062 75.3125 21.5625 75.4688 20 74.0625L16.25 70.625C14.6875 69.375 14.5312 66.875 15.9375 65.4688L39.375 40L15.9375 14.5312C14.5312 13.125 14.6875 10.625 16.25 9.375Z"
29
+ }, null, 8, f)
30
+ ]);
31
+ }
32
+ const g = /* @__PURE__ */ h(_, [["render", x]]), C = p({
33
+ props: {
34
+ theme: {
35
+ type: String,
36
+ default: "black"
37
+ // Значение по умолчанию
38
+ }
39
+ },
40
+ setup(l, { slots: t }) {
41
+ return () => {
42
+ const s = t.default ? t.default() : [], i = [], r = [];
43
+ return s.forEach((e) => {
44
+ e.toString(), e.props && e.props.icon ? i.push(e) : r.push(e);
45
+ }), n(
46
+ "div",
47
+ {
48
+ class: [
49
+ "w-100",
50
+ "t-left",
51
+ "flex-nowrap",
52
+ "flex-v-center",
53
+ "flex",
54
+ // here we need add logic
55
+ { "br-b br-black-transp-10 br-solid": !0 }
56
+ ]
57
+ },
58
+ [
59
+ // Conditionally include the div for iconSlot
60
+ ...i.length ? [
61
+ n(
62
+ "div",
63
+ {
64
+ class: ["mn-thin", "mn-t-thin", "flex-center", "flex", "mn-r-small", "flex-child", "flex-child-shrink-0", "i-big", "bg-main", "radius-thin"]
65
+ },
66
+ i
67
+ )
68
+ ] : [],
69
+ n(
70
+ "div",
71
+ {
72
+ class: ["w-100", "mn-thin", "mn-t-thin", "mn-r-small", "i-big", "flex-v-center", "flex"]
73
+ },
74
+ [
75
+ n(
76
+ "span",
77
+ {
78
+ class: ["p-big", "t-medium", "mn-r-auto"]
79
+ },
80
+ r
81
+ )
82
+ ]
83
+ ),
84
+ n(g, { class: "i-medium mn-r-medium", type: "chevron", theme: l.theme })
85
+ ]
86
+ );
87
+ };
88
+ }
89
+ });
90
+ export {
91
+ v as _,
92
+ C as a
93
+ };
@@ -0,0 +1 @@
1
+ "use strict";const e=require("vue"),c=require("./_plugin-vue_export-helper-f246444f.js");const o={class:"mobile-menu-section pd-r-zero pd-t-thin pd-b-thin pd-medium radius-medium"},a={__name:"Menu",setup(l){return(n,s)=>(e.openBlock(),e.createElementBlock("section",o,[e.renderSlot(n.$slots,"default")]))}},m={props:{theme:{type:String,default:"black"}}},u={width:"80",height:"80",viewBox:"0 0 80 80",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h=["fill"];function p(l,n,s,i,r,t){return e.openBlock(),e.createElementBlock("svg",u,[e.createElementVNode("path",{fill:s.theme,d:"M16.25 9.375L20 5.9375C21.5625 4.53125 23.9062 4.6875 25.3125 6.25L54.2188 37.8125C55.3125 39.0625 55.3125 40.9375 54.2188 42.1875L25.3125 73.75C23.9062 75.3125 21.5625 75.4688 20 74.0625L16.25 70.625C14.6875 69.375 14.5312 66.875 15.9375 65.4688L39.375 40L15.9375 14.5312C14.5312 13.125 14.6875 10.625 16.25 9.375Z"},null,8,h)])}const _=c._export_sfc(m,[["render",p]]),d=e.defineComponent({props:{theme:{type:String,default:"black"}},setup(l,{slots:n}){return()=>{const s=n.default?n.default():[],i=[],r=[];return s.forEach(t=>{t.toString(),t.props&&t.props.icon?i.push(t):r.push(t)}),e.h("div",{class:["w-100","t-left","flex-nowrap","flex-v-center","flex",{"br-b br-black-transp-10 br-solid":!0}]},[...i.length?[e.h("div",{class:["mn-thin","mn-t-thin","flex-center","flex","mn-r-small","flex-child","flex-child-shrink-0","i-big","bg-main","radius-thin"]},i)]:[],e.h("div",{class:["w-100","mn-thin","mn-t-thin","mn-r-small","i-big","flex-v-center","flex"]},[e.h("span",{class:["p-big","t-medium","mn-r-auto"]},r)]),e.h(_,{class:"i-medium mn-r-medium",type:"chevron",theme:l.theme})])}}});exports._sfc_main=a;exports._sfc_main$1=d;