@ozdao/prometheus-framework 0.1.69 → 0.1.70

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) 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/components/Select/Select.vue.cjs +1 -1
  14. package/dist/prometheus-framework/src/components/Select/Select.vue.js +78 -2
  15. package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
  16. package/dist/prometheus-framework/src/components/Select/Select.vue2.js +2 -78
  17. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +1 -1
  18. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +1 -1
  19. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  20. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +2 -2
  21. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +4 -1
  22. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +61 -2
  23. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +1 -4
  24. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +2 -61
  25. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.cjs +1 -1
  26. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.js +1 -1
  27. package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.cjs +1 -1
  28. package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.js +1 -1
  29. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  30. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +2 -2
  31. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
  32. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +24 -21
  33. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  34. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +1 -1
  35. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
  36. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +1 -1
  37. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
  38. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +1 -1
  39. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  40. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +2 -2
  41. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
  42. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +1 -1
  43. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  44. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +2 -2
  45. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  46. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +1 -1
  47. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  48. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
  49. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  50. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +2 -2
  51. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
  52. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
  53. package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.cjs +1 -1
  54. package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.js +1 -1
  55. package/dist/prometheus-framework/src/modules/products/components/pages/LeftoverAdd.vue.cjs +1 -1
  56. package/dist/prometheus-framework/src/modules/products/components/pages/LeftoverAdd.vue.js +1 -1
  57. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  58. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +2 -2
  59. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
  60. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +1 -1
  61. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  62. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +2 -2
  63. package/dist/prometheus-framework.cjs.js +21 -21
  64. package/dist/prometheus-framework.es.js +690 -682
  65. package/dist/style.css +1 -1
  66. package/package.json +35 -30
  67. package/src/components/Button/Button.vue +1 -1
  68. package/src/components/Search/Search.vue +1 -1
  69. package/src/components/Sidebar/Sidebar.vue +8 -10
  70. package/src/components/Status/Status.vue +1 -1
  71. package/src/components/Upload/Upload.vue +28 -8
  72. package/src/modules/auth/controllers/auth.controller.js +1 -1
  73. package/src/modules/auth/store/auth.js +24 -21
  74. package/src/modules/backoffice/components/admin/Backcalls.vue +1 -1
  75. package/src/modules/backoffice/components/admin/Categories.vue +1 -1
  76. package/src/modules/backoffice/components/admin/CategoryEdit.vue +1 -1
  77. package/src/modules/backoffice/components/admin/Dashboard.vue +1 -1
  78. package/src/modules/backoffice/components/admin/FastOrders.vue +1 -1
  79. package/src/modules/backoffice/components/admin/PageEdit.vue +1 -1
  80. package/src/modules/backoffice/components/admin/Pages.vue +1 -1
  81. package/src/modules/backoffice/components/admin/ProductEdit.vue +0 -2
  82. package/src/modules/backoffice/components/admin/User.vue +1 -1
  83. package/src/modules/backoffice/components/admin/Users.vue +1 -1
  84. package/src/modules/constructor/components/elements/Audio.vue +82 -0
  85. package/src/modules/constructor/components/elements/Embed.vue +85 -0
  86. package/src/modules/constructor/components/sections/Constructor.vue +54 -7
  87. package/src/modules/events/components/pages/Events.vue +2 -2
  88. package/src/modules/gallery/components/pages/Gallery.vue +1 -7
  89. package/src/modules/gallery/components/sections/GalleryWithCategories.vue +8 -24
  90. package/src/modules/gallery/gallery.client.js +1 -5
  91. package/src/modules/globals/mixins/mixins.js +52 -0
  92. package/src/modules/globals/router/routerGuards.js +28 -0
  93. package/src/modules/marketplace/components/layouts/Marketplace.vue +0 -1
  94. package/src/modules/orders/components/blocks/Positions.vue +1 -1
  95. package/src/modules/orders/components/pages/ViewOrder.vue +1 -1
  96. package/src/modules/organizations/components/pages/Organization.vue +2 -2
  97. package/src/modules/payments/components/pages/Payments.vue +3 -4
  98. package/src/modules/products/components/blocks/CardLeftover.vue +1 -0
  99. package/src/modules/products/components/blocks/CardProduct.vue +1 -15
  100. package/src/modules/products/components/sections/EditProductInfo.vue +14 -16
  101. package/src/modules/products/components/sections/FilterProducts.vue +2 -0
  102. package/src/modules/products/components/sections/ProductInformationSection.vue +2 -5
  103. package/src/modules/products/components/sections/SectionProduct.vue +0 -1
  104. package/src/modules/products/components/sections/SortProducts.vue +0 -2
  105. package/src/modules/products/store/categories.js +9 -9
  106. package/src/modules/products/store/leftovers.js +9 -6
  107. package/src/modules/products/store/products.js +0 -2
  108. package/src/modules/users/components/pages/Profile.vue +5 -3
  109. package/src/modules/wallet/components/pages/Wallet.vue +1 -1
  110. package/src/styles/theme.scss +0 -1
  111. package/src/styles/components/button.scss +0 -253
@@ -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);
@@ -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'
@@ -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"
@@ -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
7
  export {
10
8
  galleryStore,
11
9
  galleryRouter,
12
- filesStore,
13
- filesRoutes
14
10
  };
@@ -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
+ }
@@ -0,0 +1,28 @@
1
+ // routerGuards.js
2
+ export function setupRouterGuards(router, store, app) {
3
+ router.beforeEach((to, from, next) => {
4
+ const { authorize } = to.meta;
5
+
6
+ if (authorize) {
7
+ if (store.auth.state.access.status === false) {
8
+ return next({ path: '/', query: { returnUrl: to.path } });
9
+ }
10
+
11
+ if (authorize.length && !authorize.some(r => store.auth.state.access.roles.includes(r))) {
12
+ return next({ path: '/' });
13
+ }
14
+ }
15
+
16
+ const locale = to.params.locale;
17
+ if (
18
+ app.config.globalProperties.$i18n.locale !== locale
19
+ && locale
20
+ && Object.keys(i18n.global.availableLocales).includes(locale)
21
+ ) {
22
+ app.config.globalProperties.$i18n.locale = locale;
23
+ return next();
24
+ }
25
+
26
+ next();
27
+ });
28
+ }
@@ -2,7 +2,6 @@
2
2
  <div class="min-h-100vh pd-thin">
3
3
 
4
4
  <div class=" br-solid br-1px br-grey bg-grey radius-big">
5
- <Breadcrumbs class=" br-b br-solid br-black-transp pd-medium"/>
6
5
 
7
6
  <header class=" pd-medium mn-r-auto flex-v-center t-left flex-nowrap flex">
8
7
  <h2 class="t-left">
@@ -101,7 +101,7 @@
101
101
  import InputSelect from '@/components/elements/InputSelect.vue'
102
102
 
103
103
  import {ref,computed,reactive,toRefs } from 'vue'
104
- import { useStore } from 'vuex'
104
+
105
105
  import { useRouter,useRoute } from 'vue-router'
106
106
 
107
107
  const store = useStore()
@@ -65,7 +65,7 @@
65
65
  // import OrderCard from '@/components/blocks/OrderCard.vue';
66
66
 
67
67
  import { toRefs, computed } from 'vue';
68
- import { useStore } from 'vuex'
68
+
69
69
  /////////////////////////////
70
70
  // HELPERS
71
71
  /////////////////////////////
@@ -49,9 +49,9 @@
49
49
  :tabs="[
50
50
 
51
51
  { name: 'Community', value: 'community' },
52
- { name: 'Products', value: 'products' },
52
+ // { name: 'Products', value: 'products' },
53
53
  { name: 'Events', value: 'events' },
54
- { name: 'Spots', value: 'spots' }
54
+ // { name: 'Spots', value: 'spots' }
55
55
  ]"
56
56
  class="mn-small o-hidden h5 radius-big bg-grey"
57
57
  />