@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.
- package/assets/css/custom.css +70 -0
- package/assets/css/remixicon.css +2782 -0
- package/assets/css/satoshi-font.css +31 -0
- package/assets/fonts/flaticon.css +463 -0
- package/assets/fonts/flaticon.eot +0 -0
- package/assets/fonts/flaticon.html +2153 -0
- package/assets/fonts/flaticon.svg +441 -0
- package/assets/fonts/flaticon.ttf +0 -0
- package/assets/fonts/flaticon.woff +0 -0
- package/assets/fonts/flaticon.woff2 +0 -0
- package/assets/fonts/remixicon.eot +0 -0
- package/assets/fonts/remixicon.svg +8230 -0
- package/assets/fonts/remixicon.ttf +0 -0
- package/assets/fonts/remixicon.woff +0 -0
- package/assets/fonts/remixicon.woff2 +0 -0
- package/assets/scss/_variables.scss +31 -0
- package/assets/scss/components/_about.scss +58 -0
- package/assets/scss/components/_authentication.scss +124 -0
- package/assets/scss/components/_backtoptop.scss +27 -0
- package/assets/scss/components/_banner.scss +396 -0
- package/assets/scss/components/_best-deals.scss +74 -0
- package/assets/scss/components/_blank.scss +40 -0
- package/assets/scss/components/_blog.scss +193 -0
- package/assets/scss/components/_cart.scss +108 -0
- package/assets/scss/components/_categories.scss +82 -0
- package/assets/scss/components/_checkout.scss +110 -0
- package/assets/scss/components/_dashboard.scss +388 -0
- package/assets/scss/components/_faq.scss +22 -0
- package/assets/scss/components/_filter-rang.scss +109 -0
- package/assets/scss/components/_footer.scss +270 -0
- package/assets/scss/components/_global.scss +550 -0
- package/assets/scss/components/_header.scss +587 -0
- package/assets/scss/components/_hurry.scss +52 -0
- package/assets/scss/components/_navbar.scss +1008 -0
- package/assets/scss/components/_offers.scss +689 -0
- package/assets/scss/components/_pagination.scss +71 -0
- package/assets/scss/components/_popup.scss +172 -0
- package/assets/scss/components/_preloader.scss +108 -0
- package/assets/scss/components/_products.scss +1147 -0
- package/assets/scss/components/_rtl.scss +806 -0
- package/assets/scss/components/_services.scss +16 -0
- package/assets/scss/components/_sidebar.scss +259 -0
- package/assets/scss/style.css +6676 -0
- package/assets/scss/style.css.map +1 -0
- package/assets/scss/style.scss +40 -0
- package/assets/webfonts/Satoshi-Bold.eot +0 -0
- package/assets/webfonts/Satoshi-Bold.woff +0 -0
- package/assets/webfonts/Satoshi-Bold.woff2 +0 -0
- package/assets/webfonts/Satoshi-Medium.eot +0 -0
- package/assets/webfonts/Satoshi-Medium.woff +0 -0
- package/assets/webfonts/Satoshi-Medium.woff2 +0 -0
- package/assets/webfonts/Satoshi-Regular.eot +0 -0
- package/assets/webfonts/Satoshi-Regular.woff +0 -0
- package/assets/webfonts/Satoshi-Regular.woff2 +0 -0
- package/components/AboutUs/AboutUsTuan.vue +25 -0
- package/components/AboutUs/Statistics.vue +42 -0
- package/components/AboutUs/SubscribeToTheNewsletter.vue +57 -0
- package/components/AddAddress/index.vue +70 -0
- package/components/BestSellers/Products.vue +1562 -0
- package/components/BestSellers/RecentlyViewed.vue +304 -0
- package/components/Cart/ProductQuantity.vue +29 -0
- package/components/Cart/index.vue +167 -0
- package/components/Categories/index.vue +305 -0
- package/components/ChangePassword/index.vue +71 -0
- package/components/Checkout/index.vue +192 -0
- package/components/Common/DashboardNavigation.vue +37 -0
- package/components/Common/PageBanner.vue +28 -0
- package/components/Common/ProductCard.vue +152 -0
- package/components/Common/Services.vue +58 -0
- package/components/Contact/ContactForm.vue +91 -0
- package/components/Contact/ContactInfo.vue +74 -0
- package/components/Dashboard/RecentOrder.vue +173 -0
- package/components/Dashboard/index.vue +79 -0
- package/components/EditAddress/index.vue +119 -0
- package/components/EditProfile/index.vue +97 -0
- package/components/FAQ/index.vue +121 -0
- package/components/FeaturedProduct/FeaturedProducts.vue +304 -0
- package/components/FeaturedProduct/Products.vue +1562 -0
- package/components/ForgotPassword/index.vue +51 -0
- package/components/Layout/BackToUp.vue +38 -0
- package/components/Layout/Copyright.vue +25 -0
- package/components/Layout/Footer.vue +183 -0
- package/components/Layout/FooterTwo.vue +165 -0
- package/components/Layout/LocationOption.vue +178 -0
- package/components/Layout/MiddleHeader.vue +229 -0
- package/components/Layout/MiddleHeaderThree.vue +204 -0
- package/components/Layout/MiddleHeaderTwo.vue +240 -0
- package/components/Layout/Navbar.vue +185 -0
- package/components/Layout/NavbarStyleFour.vue +334 -0
- package/components/Layout/NavbarStyleThree.vue +188 -0
- package/components/Layout/NavbarStyleTwo.vue +108 -0
- package/components/Layout/Preloader.vue +18 -0
- package/components/Layout/RTLSwitchBtn.vue +40 -0
- package/components/Layout/ResponsiveNavbar.vue +431 -0
- package/components/Layout/TopHeader.vue +130 -0
- package/components/Login/index.vue +94 -0
- package/components/MyAccount/index.vue +154 -0
- package/components/NewArrivals/Products.vue +1969 -0
- package/components/NewArrivals/RecentlyViewed.vue +304 -0
- package/components/OrderDetails/index.vue +77 -0
- package/components/OrderHistory/index.vue +197 -0
- package/components/PrivacyPolicy/index.vue +112 -0
- package/components/ProductDetails/ProductDetailsTab.vue +343 -0
- package/components/ProductDetails/ProductQuantity.vue +29 -0
- package/components/ProductDetails/RecentlyViewed.vue +304 -0
- package/components/ProductDetails/index.vue +268 -0
- package/components/Products/RecentlyViewed.vue +304 -0
- package/components/Products/index.vue +292 -0
- package/components/Register/index.vue +88 -0
- package/components/TermsConditions/index.vue +112 -0
- package/components/TrendingProducts/FeaturedProducts.vue +304 -0
- package/components/TrendingProducts/Products.vue +1564 -0
- package/components/Wishlist/ProductQuantity.vue +29 -0
- package/components/Wishlist/index.vue +128 -0
- package/composables/useCart.ts +149 -0
- package/composables/useCategories.ts +87 -0
- package/composables/useCheckout.ts +131 -0
- package/composables/useProducts.ts +162 -0
- package/composables/useSiteConfig.ts +236 -0
- package/composables/useTemplateSections.ts +74 -0
- package/e2e/cart.spec.ts +71 -0
- package/e2e/fixtures/mock-api.ts +166 -0
- package/e2e/homepage.spec.ts +65 -0
- package/e2e/layout.spec.ts +73 -0
- package/e2e/navigation.spec.ts +61 -0
- package/e2e/pages/cart.page.ts +44 -0
- package/e2e/pages/homepage.page.ts +46 -0
- package/e2e/playwright.config.ts +32 -0
- package/e2e/products.spec.ts +33 -0
- package/layouts/default.vue +94 -0
- package/layouts/inner.vue +70 -0
- package/nuxt.config.ts +86 -0
- package/package.json +38 -0
- package/pages/about-us.vue +12 -0
- package/pages/address.vue +10 -0
- package/pages/cart.vue +10 -0
- package/pages/categories.vue +10 -0
- package/pages/change-password.vue +10 -0
- package/pages/checkout.vue +10 -0
- package/pages/contact.vue +11 -0
- package/pages/dashboard.vue +10 -0
- package/pages/edit-address.vue +10 -0
- package/pages/edit-profile.vue +10 -0
- package/pages/faq.vue +10 -0
- package/pages/forgot-password.vue +10 -0
- package/pages/login.vue +10 -0
- package/pages/my-account.vue +10 -0
- package/pages/order-details.vue +10 -0
- package/pages/order-history.vue +10 -0
- package/pages/privacy-policy.vue +10 -0
- package/pages/product-details.vue +10 -0
- package/pages/products.vue +10 -0
- package/pages/register.vue +10 -0
- package/pages/terms-conditions.vue +10 -0
- package/pages/wishlist.vue +10 -0
- package/plugins/site-init.client.ts +24 -0
- package/plugins/vuetify.ts +18 -0
- package/types/index.ts +121 -0
- package/utils/image.ts +13 -0
- package/utils/store.ts +21 -0
|
@@ -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;
|