@crm-market/template-shared 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. package/assets/css/custom.css +70 -0
  2. package/assets/css/remixicon.css +2782 -0
  3. package/assets/css/satoshi-font.css +31 -0
  4. package/assets/fonts/flaticon.css +463 -0
  5. package/assets/fonts/flaticon.eot +0 -0
  6. package/assets/fonts/flaticon.html +2153 -0
  7. package/assets/fonts/flaticon.svg +441 -0
  8. package/assets/fonts/flaticon.ttf +0 -0
  9. package/assets/fonts/flaticon.woff +0 -0
  10. package/assets/fonts/flaticon.woff2 +0 -0
  11. package/assets/fonts/remixicon.eot +0 -0
  12. package/assets/fonts/remixicon.svg +8230 -0
  13. package/assets/fonts/remixicon.ttf +0 -0
  14. package/assets/fonts/remixicon.woff +0 -0
  15. package/assets/fonts/remixicon.woff2 +0 -0
  16. package/assets/scss/_variables.scss +31 -0
  17. package/assets/scss/components/_about.scss +58 -0
  18. package/assets/scss/components/_authentication.scss +124 -0
  19. package/assets/scss/components/_backtoptop.scss +27 -0
  20. package/assets/scss/components/_banner.scss +396 -0
  21. package/assets/scss/components/_best-deals.scss +74 -0
  22. package/assets/scss/components/_blank.scss +40 -0
  23. package/assets/scss/components/_blog.scss +193 -0
  24. package/assets/scss/components/_cart.scss +108 -0
  25. package/assets/scss/components/_categories.scss +82 -0
  26. package/assets/scss/components/_checkout.scss +110 -0
  27. package/assets/scss/components/_dashboard.scss +388 -0
  28. package/assets/scss/components/_faq.scss +22 -0
  29. package/assets/scss/components/_filter-rang.scss +109 -0
  30. package/assets/scss/components/_footer.scss +270 -0
  31. package/assets/scss/components/_global.scss +550 -0
  32. package/assets/scss/components/_header.scss +587 -0
  33. package/assets/scss/components/_hurry.scss +52 -0
  34. package/assets/scss/components/_navbar.scss +1008 -0
  35. package/assets/scss/components/_offers.scss +689 -0
  36. package/assets/scss/components/_pagination.scss +71 -0
  37. package/assets/scss/components/_popup.scss +172 -0
  38. package/assets/scss/components/_preloader.scss +108 -0
  39. package/assets/scss/components/_products.scss +1147 -0
  40. package/assets/scss/components/_rtl.scss +806 -0
  41. package/assets/scss/components/_services.scss +16 -0
  42. package/assets/scss/components/_sidebar.scss +259 -0
  43. package/assets/scss/style.css +6676 -0
  44. package/assets/scss/style.css.map +1 -0
  45. package/assets/scss/style.scss +40 -0
  46. package/assets/webfonts/Satoshi-Bold.eot +0 -0
  47. package/assets/webfonts/Satoshi-Bold.woff +0 -0
  48. package/assets/webfonts/Satoshi-Bold.woff2 +0 -0
  49. package/assets/webfonts/Satoshi-Medium.eot +0 -0
  50. package/assets/webfonts/Satoshi-Medium.woff +0 -0
  51. package/assets/webfonts/Satoshi-Medium.woff2 +0 -0
  52. package/assets/webfonts/Satoshi-Regular.eot +0 -0
  53. package/assets/webfonts/Satoshi-Regular.woff +0 -0
  54. package/assets/webfonts/Satoshi-Regular.woff2 +0 -0
  55. package/components/AboutUs/AboutUsTuan.vue +25 -0
  56. package/components/AboutUs/Statistics.vue +42 -0
  57. package/components/AboutUs/SubscribeToTheNewsletter.vue +57 -0
  58. package/components/AddAddress/index.vue +70 -0
  59. package/components/BestSellers/Products.vue +1562 -0
  60. package/components/BestSellers/RecentlyViewed.vue +304 -0
  61. package/components/Cart/ProductQuantity.vue +29 -0
  62. package/components/Cart/index.vue +167 -0
  63. package/components/Categories/index.vue +305 -0
  64. package/components/ChangePassword/index.vue +71 -0
  65. package/components/Checkout/index.vue +192 -0
  66. package/components/Common/DashboardNavigation.vue +37 -0
  67. package/components/Common/PageBanner.vue +28 -0
  68. package/components/Common/ProductCard.vue +152 -0
  69. package/components/Common/Services.vue +58 -0
  70. package/components/Contact/ContactForm.vue +91 -0
  71. package/components/Contact/ContactInfo.vue +74 -0
  72. package/components/Dashboard/RecentOrder.vue +173 -0
  73. package/components/Dashboard/index.vue +79 -0
  74. package/components/EditAddress/index.vue +119 -0
  75. package/components/EditProfile/index.vue +97 -0
  76. package/components/FAQ/index.vue +121 -0
  77. package/components/FeaturedProduct/FeaturedProducts.vue +304 -0
  78. package/components/FeaturedProduct/Products.vue +1562 -0
  79. package/components/ForgotPassword/index.vue +51 -0
  80. package/components/Layout/BackToUp.vue +38 -0
  81. package/components/Layout/Copyright.vue +25 -0
  82. package/components/Layout/Footer.vue +183 -0
  83. package/components/Layout/FooterTwo.vue +165 -0
  84. package/components/Layout/LocationOption.vue +178 -0
  85. package/components/Layout/MiddleHeader.vue +229 -0
  86. package/components/Layout/MiddleHeaderThree.vue +204 -0
  87. package/components/Layout/MiddleHeaderTwo.vue +240 -0
  88. package/components/Layout/Navbar.vue +185 -0
  89. package/components/Layout/NavbarStyleFour.vue +334 -0
  90. package/components/Layout/NavbarStyleThree.vue +188 -0
  91. package/components/Layout/NavbarStyleTwo.vue +108 -0
  92. package/components/Layout/Preloader.vue +18 -0
  93. package/components/Layout/RTLSwitchBtn.vue +40 -0
  94. package/components/Layout/ResponsiveNavbar.vue +431 -0
  95. package/components/Layout/TopHeader.vue +130 -0
  96. package/components/Login/index.vue +94 -0
  97. package/components/MyAccount/index.vue +154 -0
  98. package/components/NewArrivals/Products.vue +1969 -0
  99. package/components/NewArrivals/RecentlyViewed.vue +304 -0
  100. package/components/OrderDetails/index.vue +77 -0
  101. package/components/OrderHistory/index.vue +197 -0
  102. package/components/PrivacyPolicy/index.vue +112 -0
  103. package/components/ProductDetails/ProductDetailsTab.vue +343 -0
  104. package/components/ProductDetails/ProductQuantity.vue +29 -0
  105. package/components/ProductDetails/RecentlyViewed.vue +304 -0
  106. package/components/ProductDetails/index.vue +268 -0
  107. package/components/Products/RecentlyViewed.vue +304 -0
  108. package/components/Products/index.vue +292 -0
  109. package/components/Register/index.vue +88 -0
  110. package/components/TermsConditions/index.vue +112 -0
  111. package/components/TrendingProducts/FeaturedProducts.vue +304 -0
  112. package/components/TrendingProducts/Products.vue +1564 -0
  113. package/components/Wishlist/ProductQuantity.vue +29 -0
  114. package/components/Wishlist/index.vue +128 -0
  115. package/composables/useCart.ts +149 -0
  116. package/composables/useCategories.ts +87 -0
  117. package/composables/useCheckout.ts +131 -0
  118. package/composables/useProducts.ts +162 -0
  119. package/composables/useSiteConfig.ts +236 -0
  120. package/composables/useTemplateSections.ts +74 -0
  121. package/e2e/cart.spec.ts +71 -0
  122. package/e2e/fixtures/mock-api.ts +166 -0
  123. package/e2e/homepage.spec.ts +65 -0
  124. package/e2e/layout.spec.ts +73 -0
  125. package/e2e/navigation.spec.ts +61 -0
  126. package/e2e/pages/cart.page.ts +44 -0
  127. package/e2e/pages/homepage.page.ts +46 -0
  128. package/e2e/playwright.config.ts +32 -0
  129. package/e2e/products.spec.ts +33 -0
  130. package/layouts/default.vue +94 -0
  131. package/layouts/inner.vue +70 -0
  132. package/nuxt.config.ts +86 -0
  133. package/package.json +38 -0
  134. package/pages/about-us.vue +12 -0
  135. package/pages/address.vue +10 -0
  136. package/pages/cart.vue +10 -0
  137. package/pages/categories.vue +10 -0
  138. package/pages/change-password.vue +10 -0
  139. package/pages/checkout.vue +10 -0
  140. package/pages/contact.vue +11 -0
  141. package/pages/dashboard.vue +10 -0
  142. package/pages/edit-address.vue +10 -0
  143. package/pages/edit-profile.vue +10 -0
  144. package/pages/faq.vue +10 -0
  145. package/pages/forgot-password.vue +10 -0
  146. package/pages/login.vue +10 -0
  147. package/pages/my-account.vue +10 -0
  148. package/pages/order-details.vue +10 -0
  149. package/pages/order-history.vue +10 -0
  150. package/pages/privacy-policy.vue +10 -0
  151. package/pages/product-details.vue +10 -0
  152. package/pages/products.vue +10 -0
  153. package/pages/register.vue +10 -0
  154. package/pages/terms-conditions.vue +10 -0
  155. package/pages/wishlist.vue +10 -0
  156. package/plugins/site-init.client.ts +24 -0
  157. package/plugins/vuetify.ts +18 -0
  158. package/types/index.ts +121 -0
  159. package/utils/image.ts +13 -0
  160. package/utils/store.ts +21 -0
@@ -0,0 +1,10 @@
1
+ <template>
2
+ <div>
3
+ <CommonPageBanner pageTitle="Деталі замовлення" />
4
+ <OrderDetails />
5
+ </div>
6
+ </template>
7
+
8
+ <script setup lang="ts">
9
+ definePageMeta({ layout: 'inner' });
10
+ </script>
@@ -0,0 +1,10 @@
1
+ <template>
2
+ <div>
3
+ <CommonPageBanner pageTitle="Історія замовлень" />
4
+ <OrderHistory />
5
+ </div>
6
+ </template>
7
+
8
+ <script setup lang="ts">
9
+ definePageMeta({ layout: 'inner' });
10
+ </script>
@@ -0,0 +1,10 @@
1
+ <template>
2
+ <div>
3
+ <CommonPageBanner pageTitle="Політика конфіденційності" />
4
+ <PrivacyPolicy />
5
+ </div>
6
+ </template>
7
+
8
+ <script setup lang="ts">
9
+ definePageMeta({ layout: 'inner' });
10
+ </script>
@@ -0,0 +1,10 @@
1
+ <template>
2
+ <div>
3
+ <CommonPageBanner pageTitle="Деталі товару" />
4
+ <ProductDetails />
5
+ </div>
6
+ </template>
7
+
8
+ <script setup lang="ts">
9
+ definePageMeta({ layout: 'inner' });
10
+ </script>
@@ -0,0 +1,10 @@
1
+ <template>
2
+ <div>
3
+ <CommonPageBanner pageTitle="Товари" />
4
+ <Products />
5
+ </div>
6
+ </template>
7
+
8
+ <script setup lang="ts">
9
+ definePageMeta({ layout: 'inner' });
10
+ </script>
@@ -0,0 +1,10 @@
1
+ <template>
2
+ <div>
3
+ <CommonPageBanner pageTitle="Реєстрація" />
4
+ <Register />
5
+ </div>
6
+ </template>
7
+
8
+ <script setup lang="ts">
9
+ definePageMeta({ layout: 'inner' });
10
+ </script>
@@ -0,0 +1,10 @@
1
+ <template>
2
+ <div>
3
+ <CommonPageBanner pageTitle="Умови використання" />
4
+ <TermsConditions />
5
+ </div>
6
+ </template>
7
+
8
+ <script setup lang="ts">
9
+ definePageMeta({ layout: 'inner' });
10
+ </script>
@@ -0,0 +1,10 @@
1
+ <template>
2
+ <div>
3
+ <CommonPageBanner pageTitle="Список бажань" />
4
+ <Wishlist />
5
+ </div>
6
+ </template>
7
+
8
+ <script setup lang="ts">
9
+ definePageMeta({ layout: 'inner' });
10
+ </script>
@@ -0,0 +1,24 @@
1
+ export default defineNuxtPlugin(async () => {
2
+ const { fetchConfig, error } = useSiteConfig();
3
+ const { loadCart } = useCart();
4
+ const { fetchCategories } = useCategories();
5
+
6
+ // Initialize cart from localStorage
7
+ loadCart();
8
+
9
+ // Fetch site configuration
10
+ try {
11
+ await fetchConfig();
12
+
13
+ // Load categories after config is loaded
14
+ await fetchCategories();
15
+ } catch (e) {
16
+ console.error('Failed to initialize site:', e);
17
+
18
+ // If site config fails to load, redirect to error page or show message
19
+ if (process.client && error.value) {
20
+ // You can customize this behavior
21
+ console.error('Site configuration error:', error.value);
22
+ }
23
+ }
24
+ });
@@ -0,0 +1,18 @@
1
+ import { defineNuxtPlugin } from "#app";
2
+ import { createVuetify } from "vuetify";
3
+ import * as components from "vuetify/components";
4
+ import * as directives from "vuetify/directives";
5
+
6
+ import "vuetify/styles";
7
+ import "~/assets/scss/style.css";
8
+
9
+ export default defineNuxtPlugin((app) => {
10
+ const vuetify = createVuetify({
11
+ ssr: true,
12
+ components: {
13
+ ...components,
14
+ },
15
+ directives,
16
+ });
17
+ app.vueApp.use(vuetify);
18
+ });
package/types/index.ts ADDED
@@ -0,0 +1,121 @@
1
+ // Інтерфейси для конфігурації шаблону
2
+
3
+ export interface TemplateSection {
4
+ key: string;
5
+ component: string;
6
+ label: string;
7
+ defaultOrder: number;
8
+ defaultEnabled: boolean;
9
+ }
10
+
11
+ export interface ContentBlock {
12
+ key: string;
13
+ type?: string;
14
+ data?: any;
15
+ order: number;
16
+ enabled: boolean;
17
+ }
18
+
19
+ export interface ColorScheme {
20
+ primary?: string;
21
+ secondary?: string;
22
+ accent?: string;
23
+ bodyColor?: string;
24
+ }
25
+
26
+ export interface Fonts {
27
+ headingFont?: string;
28
+ bodyFont?: string;
29
+ headingWeight?: string;
30
+ bodyWeight?: string;
31
+ }
32
+
33
+ export interface ContactInfo {
34
+ phone?: string;
35
+ email?: string;
36
+ address?: string;
37
+ workingHours?: string;
38
+ socialMedia?: {
39
+ facebook?: string;
40
+ instagram?: string;
41
+ twitter?: string;
42
+ telegram?: string;
43
+ };
44
+ }
45
+
46
+ export interface SiteConfig {
47
+ id: string;
48
+ organizationId: string;
49
+ publicApiToken: string;
50
+ siteName?: string;
51
+ siteDescription?: string;
52
+ logoUrl?: string;
53
+ faviconUrl?: string;
54
+ heroImageUrl?: string;
55
+ contactInfo?: ContactInfo;
56
+ subdomain?: string;
57
+ customDomain?: string;
58
+ isPublished: boolean;
59
+ template: {
60
+ code: string;
61
+ name: string;
62
+ type: string;
63
+ };
64
+ customization?: {
65
+ colors?: ColorScheme;
66
+ fonts?: Fonts;
67
+ customCSS?: string;
68
+ componentSettings?: Record<string, any>;
69
+ content?: Record<string, any>;
70
+ contentBlocks?: ContentBlock[];
71
+ values?: Record<string, any>;
72
+ };
73
+ }
74
+
75
+ export interface Product {
76
+ id: string;
77
+ name: string;
78
+ price: number;
79
+ discountPrice?: number;
80
+ images: string[];
81
+ description?: string;
82
+ categoryId: string;
83
+ organizationId: string;
84
+ isActive: boolean;
85
+ stock?: number;
86
+ rating?: number;
87
+ reviews?: number;
88
+ }
89
+
90
+ export interface Category {
91
+ id: string;
92
+ name: string;
93
+ slug?: string;
94
+ description?: string;
95
+ image?: string;
96
+ parentId?: string;
97
+ organizationId: string;
98
+ isActive: boolean;
99
+ order?: number;
100
+ }
101
+
102
+ export interface CartItem {
103
+ productId: string;
104
+ name: string;
105
+ price: number;
106
+ discountPrice?: number;
107
+ quantity: number;
108
+ image?: string;
109
+ }
110
+
111
+ export interface ShippingAddress {
112
+ firstName: string;
113
+ lastName: string;
114
+ email: string;
115
+ phone: string;
116
+ address: string;
117
+ city: string;
118
+ postalCode: string;
119
+ country: string;
120
+ notes?: string;
121
+ }
package/utils/image.ts ADDED
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Перетворює відносні шляхи до зображень (/media/...) у повні URL
3
+ */
4
+ export const resolveImageUrl = (url: string | undefined | null): string => {
5
+ if (!url) return '';
6
+ if (url.startsWith('http') || url.startsWith('data:') || url.startsWith('blob:')) return url;
7
+
8
+ const config = useRuntimeConfig();
9
+ const apiBase = (config.public.apiBase as string) || 'http://localhost:3001/api';
10
+ // Видаляємо /api з кінця, щоб отримати базовий URL сервера
11
+ const baseUrl = apiBase.replace(/\/api\/?$/, '');
12
+ return `${baseUrl}${url.startsWith('/') ? '' : '/'}${url}`;
13
+ };
package/utils/store.ts ADDED
@@ -0,0 +1,21 @@
1
+ import { reactive } from 'vue';
2
+
3
+ interface StateStore {
4
+ open: boolean;
5
+ show: boolean;
6
+ onChange: () => void;
7
+ onChangeShow: () => void;
8
+ }
9
+
10
+ const stateStore: StateStore = reactive({
11
+ open: false,
12
+ show: false,
13
+ onChange() {
14
+ this.open = !this.open;
15
+ },
16
+ onChangeShow() {
17
+ this.show = !this.show;
18
+ },
19
+ });
20
+
21
+ export default stateStore;