@ozdao/prometheus-framework 0.1.69 → 0.1.72

Sign up to get free protection for your applications and to get access to all the features.
Files changed (152) hide show
  1. package/dist/auth.server.js +1 -1
  2. package/dist/auth.server.mjs +1 -1
  3. package/dist/components/Upload/Upload.vue.d.ts.map +1 -1
  4. package/dist/main.css +1 -1
  5. package/dist/modules/constructor/components/elements/H2.vue.d.ts +1 -1
  6. package/dist/modules/constructor/components/elements/Textarea.vue.d.ts +1 -1
  7. package/dist/modules/events/components/sections/Feed.vue.d.ts +1 -1
  8. package/dist/modules/products/components/sections/EditProductInfo.vue.d.ts +5 -1
  9. package/dist/prometheus-framework/src/components/Popup/Popup.vue.cjs +1 -1
  10. package/dist/prometheus-framework/src/components/Popup/Popup.vue.js +72 -2
  11. package/dist/prometheus-framework/src/components/Popup/Popup.vue2.cjs +1 -1
  12. package/dist/prometheus-framework/src/components/Popup/Popup.vue2.js +2 -72
  13. package/dist/prometheus-framework/src/modules/auth/auth.client.cjs +1 -1
  14. package/dist/prometheus-framework/src/modules/auth/auth.client.js +27 -24
  15. package/dist/prometheus-framework/src/modules/backoffice/backoffice.client.cjs +1 -1
  16. package/dist/prometheus-framework/src/modules/backoffice/backoffice.client.js +5 -2
  17. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.cjs +1 -1
  18. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.js +1 -1
  19. package/dist/prometheus-framework/src/modules/community/community.client.cjs +1 -1
  20. package/dist/prometheus-framework/src/modules/community/community.client.js +33 -30
  21. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  22. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +1 -1
  23. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  24. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +1 -1
  25. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
  26. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +24 -21
  27. package/dist/prometheus-framework/src/modules/events/events.client.cjs +1 -1
  28. package/dist/prometheus-framework/src/modules/events/events.client.js +21 -18
  29. package/dist/prometheus-framework/src/modules/gallery/gallery.client.cjs +1 -1
  30. package/dist/prometheus-framework/src/modules/gallery/gallery.client.js +7 -4
  31. package/dist/prometheus-framework/src/modules/globals/globals.client.cjs +1 -1
  32. package/dist/prometheus-framework/src/modules/globals/globals.client.js +9 -6
  33. package/dist/prometheus-framework/src/modules/icons/icons.client.cjs +1 -1
  34. package/dist/prometheus-framework/src/modules/icons/icons.client.js +49 -46
  35. package/dist/prometheus-framework/src/modules/icons/socials/facebook.vue.js +3 -3
  36. package/dist/prometheus-framework/src/modules/icons/socials/instagram.vue.cjs +1 -1
  37. package/dist/prometheus-framework/src/modules/icons/socials/linkedin.vue.cjs +1 -1
  38. package/dist/prometheus-framework/src/modules/icons/socials/linkedin.vue.js +1 -1
  39. package/dist/prometheus-framework/src/modules/icons/socials/reddit.vue.cjs +1 -1
  40. package/dist/prometheus-framework/src/modules/icons/socials/telegram.vue.js +3 -3
  41. package/dist/prometheus-framework/src/modules/icons/socials/twitter.vue.cjs +1 -1
  42. package/dist/prometheus-framework/src/modules/icons/socials/twitter.vue.js +3 -3
  43. package/dist/prometheus-framework/src/modules/landing/landing.client.cjs +1 -1
  44. package/dist/prometheus-framework/src/modules/landing/landing.client.js +5 -2
  45. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
  46. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +1 -1
  47. package/dist/prometheus-framework/src/modules/legal/legal.client.cjs +1 -1
  48. package/dist/prometheus-framework/src/modules/legal/legal.client.js +14 -10
  49. package/dist/prometheus-framework/src/modules/middlewares/middlewares.client.cjs +1 -1
  50. package/dist/prometheus-framework/src/modules/middlewares/middlewares.client.js +8 -1
  51. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.cjs +1 -1
  52. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.js +11 -2
  53. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.cjs +1 -1
  54. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.js +2 -11
  55. package/dist/prometheus-framework/src/modules/organizations/components/blocks/Socials.vue.js +9 -9
  56. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  57. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +1 -1
  58. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
  59. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +1 -1
  60. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
  61. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +1 -1
  62. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  63. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +1 -1
  64. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  65. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +1 -1
  66. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  67. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +9 -9
  68. package/dist/prometheus-framework/src/modules/organizations/organizations.client.cjs +1 -1
  69. package/dist/prometheus-framework/src/modules/organizations/organizations.client.js +61 -58
  70. package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.cjs +1 -1
  71. package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.js +1 -1
  72. package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.cjs +1 -1
  73. package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.js +1 -1
  74. package/dist/prometheus-framework/src/modules/products/components/elements/THC.vue.cjs +1 -1
  75. package/dist/prometheus-framework/src/modules/products/components/elements/THC.vue.js +2 -78
  76. package/dist/prometheus-framework/src/modules/products/components/elements/THC.vue2.cjs +1 -1
  77. package/dist/prometheus-framework/src/modules/products/components/elements/THC.vue2.js +78 -2
  78. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  79. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +1 -1
  80. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.cjs +1 -1
  81. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.js +1 -1
  82. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  83. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +1 -1
  84. package/dist/prometheus-framework/src/modules/reports/reports.client.cjs +1 -1
  85. package/dist/prometheus-framework/src/modules/reports/reports.client.js +7 -1
  86. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
  87. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +1 -1
  88. package/dist/prometheus-framework/src/modules/users/users.client.cjs +1 -1
  89. package/dist/prometheus-framework/src/modules/users/users.client.js +11 -8
  90. package/dist/prometheus-framework.cjs.js +21 -21
  91. package/dist/prometheus-framework.es.js +705 -687
  92. package/dist/style.css +1 -1
  93. package/package.json +40 -39
  94. package/src/components/Button/Button.vue +1 -1
  95. package/src/components/Search/Search.vue +1 -1
  96. package/src/components/Sidebar/Sidebar.vue +8 -10
  97. package/src/components/Status/Status.vue +1 -1
  98. package/src/components/Upload/Upload.vue +28 -8
  99. package/src/{main.ts → main.js} +1 -2
  100. package/src/modules/auth/auth.client.js +1 -1
  101. package/src/modules/auth/controllers/auth.controller.js +1 -1
  102. package/src/modules/auth/store/auth.js +24 -21
  103. package/src/modules/backoffice/backoffice.client.js +1 -1
  104. package/src/modules/backoffice/components/admin/Backcalls.vue +1 -1
  105. package/src/modules/backoffice/components/admin/Categories.vue +1 -1
  106. package/src/modules/backoffice/components/admin/CategoryEdit.vue +1 -1
  107. package/src/modules/backoffice/components/admin/Dashboard.vue +1 -1
  108. package/src/modules/backoffice/components/admin/FastOrders.vue +1 -1
  109. package/src/modules/backoffice/components/admin/PageEdit.vue +1 -1
  110. package/src/modules/backoffice/components/admin/Pages.vue +1 -1
  111. package/src/modules/backoffice/components/admin/ProductEdit.vue +0 -2
  112. package/src/modules/backoffice/components/admin/User.vue +1 -1
  113. package/src/modules/backoffice/components/admin/Users.vue +1 -1
  114. package/src/modules/community/community.client.js +1 -1
  115. package/src/modules/constructor/components/elements/Audio.vue +82 -0
  116. package/src/modules/constructor/components/elements/Embed.vue +85 -0
  117. package/src/modules/constructor/components/sections/Constructor.vue +54 -7
  118. package/src/modules/events/components/pages/Events.vue +2 -2
  119. package/src/modules/events/events.client.js +1 -1
  120. package/src/modules/gallery/components/pages/Gallery.vue +1 -7
  121. package/src/modules/gallery/components/sections/GalleryWithCategories.vue +8 -24
  122. package/src/modules/gallery/gallery.client.js +2 -6
  123. package/src/modules/globals/globals.client.js +1 -1
  124. package/src/modules/globals/mixins/mixins.js +52 -0
  125. package/src/modules/globals/router/routerGuards.js +28 -0
  126. package/src/modules/icons/icons.client.js +1 -1
  127. package/src/modules/landing/landing.client.js +1 -1
  128. package/src/modules/legal/legal.client.js +1 -1
  129. package/src/modules/marketplace/components/layouts/Marketplace.vue +0 -1
  130. package/src/modules/middlewares/middlewares.client.js +1 -1
  131. package/src/modules/orders/components/blocks/Positions.vue +1 -1
  132. package/src/modules/orders/components/pages/ViewOrder.vue +1 -1
  133. package/src/modules/organizations/components/pages/Organization.vue +2 -2
  134. package/src/modules/organizations/organizations.client.js +1 -1
  135. package/src/modules/payments/components/pages/Payments.vue +3 -4
  136. package/src/modules/products/components/blocks/CardLeftover.vue +1 -0
  137. package/src/modules/products/components/blocks/CardProduct.vue +1 -15
  138. package/src/modules/products/components/sections/EditProductInfo.vue +14 -16
  139. package/src/modules/products/components/sections/FilterProducts.vue +2 -0
  140. package/src/modules/products/components/sections/ProductInformationSection.vue +2 -5
  141. package/src/modules/products/components/sections/SectionProduct.vue +0 -1
  142. package/src/modules/products/components/sections/SortProducts.vue +0 -2
  143. package/src/modules/products/store/categories.js +9 -9
  144. package/src/modules/products/store/leftovers.js +9 -6
  145. package/src/modules/products/store/products.js +0 -2
  146. package/src/modules/reports/reports.client.js +1 -1
  147. package/src/modules/users/components/pages/Profile.vue +5 -3
  148. package/src/modules/users/users.client.js +1 -1
  149. package/src/modules/wallet/components/pages/Wallet.vue +1 -1
  150. package/src/styles/theme.scss +0 -1
  151. package/src/styles/components/button.scss +0 -253
  152. /package/src/components/{index.ts → index.js} +0 -0
@@ -1,4 +1,3 @@
1
- import type { App } from 'vue';
2
1
 
3
2
  // Define Styles
4
3
  // ------------------------------------- //
@@ -29,7 +28,7 @@ import {
29
28
  } from './components';
30
29
 
31
30
  export default {
32
- install: (app: App) => {
31
+ install: (app) => {
33
32
  app.component('Address', () => import('./components/Address/Address.vue'));
34
33
  app.component('Button', () => import('./components/Button/Button.vue'));
35
34
  app.component('Checkbox', () => import('./components/Checkbox/Checkbox.vue'));
@@ -17,7 +17,7 @@ import * as invitesStore from './store/invites.js';
17
17
  import authRoutes from './router/auth.js';
18
18
 
19
19
  // Exporting
20
- export {
20
+ export default {
21
21
  Auth,
22
22
  EnterCode,
23
23
  Invite,
@@ -41,7 +41,7 @@ const controllerFactory = (db) => {
41
41
 
42
42
  let user = await User.findOne(query).populate('roles').exec();
43
43
 
44
- if ((type === 'email' || type === 'phone') && req.body.password) {
44
+ if ((type === 'email' || type === 'phone')) {
45
45
 
46
46
  const passwordIsValid = bcrypt.compareSync(req.body.password, user.password);
47
47
 
@@ -27,27 +27,27 @@
27
27
  },
28
28
  });
29
29
 
30
- async function initialize() {
31
- const userCookie = await getCookie('user');
30
+ // async function initialize() {
31
+ // const userCookie = await getCookie('user');
32
32
 
33
- if (userCookie) {
34
- const {_id, email, phone, roles, accessToken} = userCookie;
33
+ // if (userCookie) {
34
+ // const {_id, email, phone, roles, accessToken} = userCookie;
35
35
 
36
- Object.assign(state.user, {_id, email, phone});
37
- Object.assign(state.access, {token: accessToken, roles, status: !!accessToken});
36
+ // Object.assign(state.user, {_id, email, phone});
37
+ // Object.assign(state.access, {token: accessToken, roles, status: !!accessToken});
38
38
 
39
- $axios.interceptors.request.use((config) => {
40
- if (accessToken) {
41
- config.headers['x-access-token'] = accessToken;
42
- }
43
- return config;
44
- }, (error) => {
45
- return Promise.reject(error);
46
- });
47
- }
48
- }
39
+ // $axios.interceptors.request.use((config) => {
40
+ // if (accessToken) {
41
+ // config.headers['x-access-token'] = accessToken;
42
+ // }
43
+ // return config;
44
+ // }, (error) => {
45
+ // return Promise.reject(error);
46
+ // });
47
+ // }
48
+ // }
49
49
 
50
- initialize();
50
+ // initialize();
51
51
 
52
52
  const actions = {
53
53
  async login (user, type) {
@@ -214,10 +214,13 @@
214
214
 
215
215
  function getCookie(name) {
216
216
  if (process.env.MOBILE_APP) {
217
- return CapacitorCookies.getCookie({
218
- url: process.env.API_URL,
219
- key: name
220
- }).then(response => JSON.parse(response.value));
217
+ // return CapacitorCookies.getCookie({
218
+ // url: process.env.API_URL,
219
+ // key: name
220
+ // })
221
+ // .then(response => JSON.parse(response.value));
222
+ const cookie = Cookies.get(name);
223
+ return cookie ? JSON.parse(cookie) : null;
221
224
  } else {
222
225
  // Для веб-версии
223
226
  const cookie = Cookies.get(name);
@@ -10,6 +10,6 @@
10
10
  import backofficeRoutes from './router/backoffice.js';
11
11
 
12
12
  // Exporting components, store modules, and routes
13
- export {
13
+ export default {
14
14
  backofficeRoutes
15
15
  };
@@ -52,7 +52,7 @@
52
52
 
53
53
 
54
54
  import { computed, onMounted, reactive, toRefs } from 'vue'
55
- import { useStore } from 'vuex'
55
+
56
56
  import { useRoute,useRouter } from 'vue-router'
57
57
 
58
58
  const store = useStore()
@@ -24,7 +24,7 @@
24
24
  <script setup>
25
25
 
26
26
  import { computed,ref} from 'vue'
27
- import { useStore } from 'vuex'
27
+
28
28
 
29
29
  import { VueDraggableNext } from 'vue-draggable-next'
30
30
 
@@ -69,7 +69,7 @@
69
69
  import EditFilters from '@/components/blocks/EditFilters.vue'
70
70
  // Import libs
71
71
  import { computed, onMounted } from 'vue'
72
- import { useStore } from 'vuex'
72
+
73
73
  import { useRoute } from 'vue-router'
74
74
  // Accessing router and store
75
75
  const store = useStore()
@@ -17,7 +17,7 @@
17
17
 
18
18
 
19
19
  import { computed, onMounted } from 'vue'
20
- import { useStore } from 'vuex'
20
+
21
21
  import { useRoute } from 'vue-router'
22
22
 
23
23
 
@@ -81,7 +81,7 @@
81
81
 
82
82
 
83
83
  import { computed, onMounted, reactive, toRefs,ref } from 'vue'
84
- import { useStore } from 'vuex'
84
+
85
85
  import { useRoute,useRouter } from 'vue-router'
86
86
 
87
87
  const store = useStore()
@@ -59,7 +59,7 @@
59
59
  import EditCategories from '@pf/src/modules/products/components/blocks/EditCategories.vue'
60
60
 
61
61
  import { computed, onMounted, reactive, toRefs } from 'vue'
62
- import { useStore } from 'vuex'
62
+
63
63
  import { useRoute,useRouter } from 'vue-router'
64
64
 
65
65
  const store = useStore()
@@ -44,7 +44,7 @@
44
44
 
45
45
 
46
46
  import { computed, onMounted, reactive, toRefs } from 'vue'
47
- import { useStore } from 'vuex'
47
+
48
48
  import { useRoute,useRouter } from 'vue-router'
49
49
 
50
50
  const store = useStore()
@@ -61,7 +61,6 @@
61
61
  <script setup>
62
62
  // Import libs
63
63
  import { reactive, computed, onMounted, toRefs } from 'vue'
64
- import { useStore } from 'vuex'
65
64
  import { useRoute, useRouter } from 'vue-router'
66
65
  // Import components
67
66
  import EditProductInfo from '@/components/sections/product/EditProductInfo.vue';
@@ -71,7 +70,6 @@
71
70
  import EditModifications from '@/components/sections/product/EditModifications.vue';
72
71
 
73
72
  // Accessing router and store
74
- const store = useStore()
75
73
  const route = useRoute()
76
74
  const router = useRouter()
77
75
 
@@ -65,7 +65,7 @@
65
65
  <script setup>
66
66
  // Import libs
67
67
  import { computed, onMounted } from 'vue'
68
- import { useStore } from 'vuex'
68
+
69
69
  import { useRoute } from 'vue-router'
70
70
  // Accessing router and store
71
71
  const store = useStore()
@@ -64,7 +64,7 @@
64
64
 
65
65
 
66
66
  import { computed, onMounted, reactive, toRefs } from 'vue'
67
- import { useStore } from 'vuex'
67
+
68
68
  import { useRoute } from 'vue-router'
69
69
 
70
70
  import HeaderAdmin from '@pf/src/components/HeaderAdmin/HeaderAdmin.vue'
@@ -21,7 +21,7 @@ import * as reactionsStore from './store/reactions.js';
21
21
  import blogpostsRoutes from './router/blogposts.js';
22
22
 
23
23
  // Exporting components, store modules, and routes
24
- export {
24
+ export default {
25
25
  Community,
26
26
  CreateBlogPost,
27
27
  BlogPost,
@@ -0,0 +1,82 @@
1
+ <template>
2
+ <div
3
+ class="mn-thin w-100 pd-medium bg-white radius-medium">
4
+
5
+ <div
6
+ v-if="prop.content"
7
+ v-html="prop.content"
8
+ class="flex-center flex"
9
+ />
10
+
11
+ <div
12
+ class=""
13
+ v-else
14
+ >
15
+ <Upload
16
+ v-model:field="embedCode"
17
+ @file-change="onComponentClick"
18
+ type="file"
19
+ :placeholder="'Enter embed code'"
20
+ class="
21
+ w-100
22
+ br-solid
23
+ br-1px
24
+ br-black-transp-10
25
+ pd-medium
26
+ radius-small
27
+ mn-thin
28
+ "
29
+ />
30
+ <button
31
+ @click="onComponentClick"
32
+ class="button-small button"
33
+ >
34
+ Save
35
+ </button>
36
+ </div>
37
+ <!-- <button v-if="prop.content" @click="editEmbedCode">Edit Embed Code</button> -->
38
+ </div>
39
+ </template>
40
+
41
+ <script setup>
42
+ import { ref } from 'vue';
43
+
44
+ import Upload from '@pf/src/components/Upload/Upload.vue'
45
+
46
+ const embedCode = ref(null);
47
+
48
+ const props = defineProps([
49
+ 'label',
50
+ 'value',
51
+ 'prop'
52
+ ]);
53
+
54
+ const emit = defineEmits(['input', 'updateBlock']);
55
+
56
+ function isValidEmbedCode(code) {
57
+ const allowedSources = [/youtube\.com/, /soundcloud\.com/, /vimeo\.com/];
58
+ return allowedSources.some(pattern => pattern.test(code));
59
+ }
60
+
61
+ function onComponentClick(file) {
62
+ embedCode.value = file
63
+ if (embedCode.value && isValidEmbedCode(embedCode.value)) {
64
+ emit('input', embedCode.value);
65
+ emit('updateBlock', props.prop, { content: embedCode.value });
66
+ } else {
67
+ alert('Invalid embed code or source not allowed.');
68
+ }
69
+ }
70
+
71
+ function editEmbedCode() {
72
+ let embedInput = prompt('Edit embed code:', prop.content);
73
+ if (embedInput && isValidEmbedCode(embedInput)) {
74
+ embedCode.value = embedInput;
75
+ emit('input', embedCode.value);
76
+ emit('updateBlock', props.prop, { content: embedCode.value });
77
+ } else {
78
+ alert('Invalid embed code or source not allowed.');
79
+ }
80
+ }
81
+ </script>
82
+
@@ -0,0 +1,85 @@
1
+ <template>
2
+ <div
3
+ class="mn-thin w-100 pd-medium bg-white radius-medium">
4
+
5
+ <div
6
+ v-if="prop.content"
7
+ v-html="prop.content"
8
+ class="flex-center flex"
9
+ />
10
+
11
+ <div
12
+ class=""
13
+ v-else
14
+ >
15
+ <Field
16
+ v-model:field="embedCode"
17
+ type="textarea"
18
+ :placeholder="'Paste your embed code here'"
19
+ class="
20
+ w-100
21
+ br-solid
22
+ br-1px
23
+ br-black-transp-10
24
+ pd-medium
25
+ radius-small
26
+ mn-thin
27
+ "
28
+ />
29
+ <div class="flex-v-center flex-nowrap flex gap-small">
30
+
31
+ <p class="t-center">Embeds from youtube.com, vimeo.com, soundcloud.com are allowed</p>
32
+ <button
33
+ @click="onComponentClick"
34
+ class="button-small button"
35
+ >
36
+ Save
37
+ </button>
38
+ </div>
39
+ </div>
40
+ <!-- <button v-if="prop.content" @click="editEmbedCode">Edit Embed Code</button> -->
41
+ </div>
42
+ </template>
43
+
44
+ <script setup>
45
+ import { ref } from 'vue';
46
+
47
+ import Field from '@pf/src/components/Field/Field.vue'
48
+
49
+ const embedCode = ref(null);
50
+
51
+ const props = defineProps([
52
+ 'label',
53
+ 'value',
54
+ 'prop'
55
+ ]);
56
+
57
+ const emit = defineEmits(['input', 'updateBlock']);
58
+
59
+ function isValidEmbedCode(code) {
60
+ const allowedSources = [/youtube\.com/, /soundcloud\.com/, /vimeo\.com/];
61
+ return allowedSources.some(pattern => pattern.test(code));
62
+ }
63
+
64
+ function onComponentClick() {
65
+
66
+ if (embedCode.value && isValidEmbedCode(embedCode.value)) {
67
+ emit('input', embedCode.value);
68
+ emit('updateBlock', props.prop, { content: embedCode.value });
69
+ } else {
70
+ alert('Invalid embed code or source not allowed.');
71
+ }
72
+ }
73
+
74
+ function editEmbedCode() {
75
+ let embedInput = prompt('Edit embed code:', prop.content);
76
+ if (embedInput && isValidEmbedCode(embedInput)) {
77
+ embedCode.value = embedInput;
78
+ emit('input', embedCode.value);
79
+ emit('updateBlock', props.prop, { content: embedCode.value });
80
+ } else {
81
+ alert('Invalid embed code or source not allowed.');
82
+ }
83
+ }
84
+ </script>
85
+
@@ -36,17 +36,60 @@ a<template>
36
36
  <transition name="fade">
37
37
  <div
38
38
  v-if="showControls === index"
39
- class="pos-absolute pos-r-100 pos-t-0 z-index-4 i-semi"
39
+ class="pos-absolute z-index-4 i-semi"
40
+ style="right: calc(100% + 0.5rem); top: calc(50% - 1.125rem);"
40
41
  @mousedown.prevent="startDragging = true"
41
42
  >
42
- <button @click="showMenu = !showMenu" class="mn-small w-100 i-semi bg-white radius-thin">{{ block.content ? '...' : '+' }}</button>
43
- <div v-if="showMenu" class="z-index-5 radius-thin mn-small relative left-0 mt-2 w-max bg-white shadow-lg rounded">
44
- <button @click="handleDeleteBlock(block)" class="block w-max text-left px-4 py-2 hover:bg-gray-200">Remove</button>
45
- <button @click="handleAddBlock('ImageUpload', '', index)" class="block w-max text-left px-4 py-2 hover:bg-gray-200">Add Image</button>
46
- <button @click="handleAddBlock('H2', '', index)" class="block w-max text-left px-4 py-2 hover:bg-gray-200">Add Title</button>
43
+ <button
44
+ @click="showMenu = !showMenu"
45
+ class="mn-small cursor-pointer w-100 i-semi bg-white radius-thin"
46
+ >
47
+ {{ block.content ? '...' : '+' }}
48
+ </button>
49
+
50
+ <div
51
+ v-if="showMenu"
52
+ class="z-index-5 radius-thin pd-thin bg-white w-max mn-small flex-nowrap flex-column flex"
53
+ >
54
+ <span
55
+ @click="handleDeleteBlock(block)"
56
+ class="mn-thin w-max t-red bg-white button-small button"
57
+ >
58
+ Remove
59
+ </span>
60
+ <span
61
+ @click="handleAddBlock('ImageUpload', '', index)"
62
+ class="mn-thin w-max t-black bg-white button-small button"
63
+ >
64
+ Add Image
65
+ </span>
66
+ <span
67
+ @click="handleAddBlock('H2', '', index)"
68
+ class="w-max button-small t-black bg-white button"
69
+ >
70
+ Add Title
71
+ </span>
72
+ <span
73
+ @click="handleAddBlock('Embed', '', index)"
74
+ class="w-max button-small t-black bg-white button"
75
+ >
76
+ Add Embed
77
+ </span>
78
+ <!-- <span
79
+ @click="handleAddBlock('Audio', '', index)"
80
+ class="w-max button-small t-black bg-white button"
81
+ >
82
+ Add Audio
83
+ </span> -->
84
+
47
85
  </div>
86
+
87
+
48
88
  </div>
49
89
  </transition>
90
+
91
+
92
+
50
93
  </div>
51
94
  </VueDraggableNext>
52
95
  </section>
@@ -59,6 +102,8 @@ import H2 from '../elements/H2.vue';
59
102
  import Caption from '../elements/Caption.vue';
60
103
  import Bullets from '../elements/Bullets.vue';
61
104
  import ImageUpload from '../elements/ImageUpload.vue';
105
+ import Embed from '../elements/Embed.vue';
106
+ import Audio from '../elements/Audio.vue';
62
107
 
63
108
  import { ref, watchEffect, computed, emit } from 'vue';
64
109
  import { VueDraggableNext } from 'vue-draggable-next';
@@ -76,7 +121,9 @@ const ComponentMap = {
76
121
  'H2': H2,
77
122
  'Bullets': Bullets,
78
123
  'Caption': Caption,
79
- 'ImageUpload': ImageUpload
124
+ 'ImageUpload': ImageUpload,
125
+ 'Embed': Embed,
126
+ 'Audio': Audio
80
127
  };
81
128
 
82
129
  function handleAddBlock(type = 'Textarea', content = '', index, data) {
@@ -1,10 +1,10 @@
1
1
  <template>
2
2
  <section>
3
- <List
3
+ <!-- <List
4
4
  :user="auth.state.user._id"
5
5
  class="bg-grey mn-thin radius-big"
6
6
  :phase="'week'"
7
- />
7
+ /> -->
8
8
 
9
9
  <Feed
10
10
  :category="route.params.category"
@@ -14,7 +14,7 @@ import * as eventsStore from './store/events.js';
14
14
  import eventsRoutes from './router/events.js';
15
15
 
16
16
  // Exporting components, models, store modules, and routes
17
- export {
17
+ export default {
18
18
  CardEvent,
19
19
  Feed,
20
20
  List,
@@ -9,13 +9,7 @@
9
9
  </template>
10
10
 
11
11
  <script setup>
12
- /////////////////////////////
13
- // COMPONENT DEPENDENCIES
14
- /////////////////////////////
15
- import { onMounted } from 'vue'
16
- import { gsap } from "gsap/dist/gsap";
17
- import { ScrollTrigger } from "gsap/dist/ScrollTrigger";
18
-
19
12
  import Title from '@pf/src/modules/globals/components/sections/Title.vue';
13
+
20
14
  import GalleryWithCategories from '@pf/src/modules/gallery/components/sections/GalleryWithCategories.vue';
21
15
  </script>
@@ -16,7 +16,6 @@
16
16
  </div>
17
17
 
18
18
  <div ref="grid" class="pd-medium cols-4 gap-thin">
19
- <!-- :class="['grid-item pd-small', item.size.value, ...item.categories]" -->
20
19
  <div
21
20
  v-for="(item, index) in filteredGallery"
22
21
  :key="item.id"
@@ -30,26 +29,6 @@
30
29
  class="w-100 h-100 o-hidden radius-medium object-fit-cover"
31
30
  @click="openModal(item.image)"
32
31
  />
33
- <!-- <div class="pd-small radius-small bg-white" v-else>
34
- <img :src="'/photos/' + item.cover" class="w-100 radius-small mn-small h-10r object-fit-cover " @click="openModal(item)" />
35
-
36
- <p class="t-black p-small mn-small">
37
- <span class="uppercase t-transp ">Size</span>
38
- <br>
39
- <span class="pd-2px radius-big d-inline-block bg-grey">{{item.size.name}}</span>
40
- </p>
41
-
42
- <p class="t-black p-small mn-small uppe">
43
- <span class="uppercase t-transp">Categories</span>
44
- <br>
45
- <span class="pd-2px radius-big d-inline-block bg-grey t-semi" v-for="category in item.categories">{{category}}</span>
46
- </p>
47
-
48
- <div class="flex-nowrap flex">
49
- <button class="mn-r-thin button-small w-100 button" @click="editPhoto(item)">Edit</button>
50
- <button class="button-small w-100 button" @click="deletePhoto(item._id)">Delete</button>
51
- </div>
52
- </div> -->
53
32
  </transition>
54
33
  </div>
55
34
 
@@ -70,6 +49,7 @@
70
49
  </transition>
71
50
 
72
51
  <transition name="modal">
52
+
73
53
  <div v-if="selectedImage.image !== false && modal === 'edit-modal'" class="flex-v-center flex m modal pd-big">
74
54
  <div class="modal-content radius-small pd-medium bg-white">
75
55
  <span class="close" @click="closeModal">&times;</span>
@@ -129,11 +109,15 @@
129
109
 
130
110
  <script setup>
131
111
  import { ref, onMounted, reactive, computed } from 'vue'
132
- import { Button, Field, Select, Upload } from '@ozdao/prometheus-framework'
133
- import { state, actions } from '@pf/src/modules/gallery/store/gallery';
134
-
135
112
  import { useRoute } from 'vue-router'
136
113
 
114
+ import Field from '@pf/src/components/Field/Field.vue'
115
+ import Button from '@pf/src/components/Button/Button.vue'
116
+ import Select from '@pf/src/components/Select/Select.vue'
117
+ import Upload from '@pf/src/components/Upload/Upload.vue'
118
+
119
+ import { state, actions } from '@pf/src/modules/gallery/store/gallery';
120
+
137
121
  const route = useRoute()
138
122
 
139
123
  const isEditablePath = false
@@ -1,14 +1,10 @@
1
- import * as galleryStore from './store/gallery.store.js';
1
+ import * as galleryStore from './store/gallery.js';
2
2
 
3
3
  // Importing Vue Router routes from the router directory
4
4
  import galleryRouter from './router/gallery.router.js';
5
5
 
6
- import galleryPage from './components/pages/Gallery.vue'
7
-
8
6
  // Exporting components, store modules, and routes
9
- export {
7
+ export default {
10
8
  galleryStore,
11
9
  galleryRouter,
12
- filesStore,
13
- filesRoutes
14
10
  };
@@ -7,7 +7,7 @@ import * as globalStore from './store/globals.js';
7
7
  // Since you didn't specify routes for the client, assuming there are none at this time
8
8
 
9
9
  // Exporting localization methods, Vuex store
10
- export {
10
+ export default {
11
11
  getBrowserLocale,
12
12
  VueI18n,
13
13
  globalStore
@@ -0,0 +1,52 @@
1
+ // mixins.js
2
+ export const globalMixins = {
3
+ methods: {
4
+ returnCurrency() {
5
+ const currency = '฿'
6
+ return currency
7
+ },
8
+ formatPrice(number) {
9
+ const currency = this.returnCurrency();
10
+ let formattedNumber = number.toFixed(2).replace('.', ',').replace(/\B(?=(\d{3})+(?!\d))/g, ' ');
11
+ return `${formattedNumber} ${currency}`;
12
+ },
13
+ formatDate(d) {
14
+ var fixedDate = new Date(d);
15
+ var yyyy = fixedDate.getFullYear().toString();
16
+ var mm = (fixedDate.getMonth() + 1).toString();
17
+ var dd = fixedDate.getDate().toString();
18
+ var hh = fixedDate.getHours().toString();
19
+ var minmin = fixedDate.getMinutes().toString();
20
+
21
+ return yyyy + '.' + (mm[1] ? mm : "0" + mm[0]) + '.' + (dd[1] ? dd : "0" + dd[0]) + " в " + (hh[1] ? hh : "0" + hh[0]) + ':' + (minmin[1] ? minmin : "0" + minmin[0]);
22
+ },
23
+ normalizeUrlParam(param) {
24
+ if (!param) param = ''
25
+
26
+ return param
27
+ .toLowerCase()
28
+ .replace(/ /g, '-')
29
+ .replace(/[^a-z0-9-]/g, '');
30
+ },
31
+ getMarketplaceLink(categories, country, state, city) {
32
+ categories = []
33
+
34
+ let country_normalized = this.normalizeUrlParam(country);
35
+ let state_normalized = this.normalizeUrlParam(state);
36
+ let city_normalized = this.normalizeUrlParam(city);
37
+ let base = `/marketplace/${country_normalized || ''}${state_normalized ? `/${state_normalized}` : ''}${city_normalized ? `/${city_normalized}` : ''}`;
38
+
39
+ if (categories.length) {
40
+ base += `?categories=${categories.join(",")}`;
41
+ }
42
+
43
+ return base;
44
+ },
45
+ getSpotsLink(country, state, city) {
46
+ let country_normalized = this.normalizeUrlParam(country);
47
+ let state_normalized = this.normalizeUrlParam(state);
48
+ let city_normalized = this.normalizeUrlParam(city);
49
+ return `/spots/${country_normalized || ''}${state_normalized ? `/${state_normalized}` : ''}${city_normalized ? `/${city_normalized}` : ''}`;
50
+ },
51
+ }
52
+ }