flowrix 1.0.1-beta.0 → 1.0.1-beta.2

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/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "flowrix",
3
3
  "configKey": "flowrix",
4
- "version": "1.0.1-beta.0",
4
+ "version": "1.0.1-beta.2",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -10,8 +10,8 @@ export * from "./Cart/useCartDetail.js";
10
10
  export * from "./Category/useCategoryContent.js";
11
11
  export * from "./Category/useCategoryGrid.js";
12
12
  export * from "./Category/useCategoryIndex.js";
13
- export * from "./Category/useCategoryTemplate2.js";
14
- export * from "./Category/useCategoryTemplate3.js";
13
+ export * from "./Category/useCategoryTemplate2";
14
+ export * from "./Category/useCategoryTemplate3";
15
15
  export * from "./Category/useCategoryTop.js";
16
16
  export * from "./Checkout/useBillingAddress.js";
17
17
  export * from "./Checkout/useCheckout.js";
@@ -1,7 +1,6 @@
1
1
  import { ref } from "vue";
2
2
  import { useRoute } from "#imports";
3
3
  import { useCartStore } from "../stores/cart";
4
- import { useCartInsight } from "./useCartInsight";
5
4
  export const useAddToCart = () => {
6
5
  const showError = ref(false);
7
6
  const ErrorMessage = ref("");
@@ -11,7 +10,6 @@ export const useAddToCart = () => {
11
10
  const proQuantity = ref(1);
12
11
  const price_span = ref("");
13
12
  const route = useRoute();
14
- const { sendCartInsight } = useCartInsight();
15
13
  const closeErrorModal = () => {
16
14
  showError.value = false;
17
15
  ErrorMessage.value = "";
@@ -87,7 +85,6 @@ export const useAddToCart = () => {
87
85
  await cartStore.addToCart(product, qty, formData);
88
86
  if (cartStore.addedResponse === "success") {
89
87
  open.value = true;
90
- sendCartInsight();
91
88
  }
92
89
  } catch (error) {
93
90
  console.error("Error in addToCart:", error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flowrix",
3
- "version": "1.0.1-beta.0",
3
+ "version": "1.0.1-beta.2",
4
4
  "description": "lug-and-play Nuxt eCommerce cart powered by FLOWRiX. Subscription required.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,50 +0,0 @@
1
- interface CategoryItem {
2
- name: string;
3
- slug: string;
4
- image: string;
5
- short_description: string;
6
- sortorder?: number;
7
- type?: string;
8
- category?: string;
9
- }
10
- interface CategoryData {
11
- category: {
12
- name: string;
13
- };
14
- categories: CategoryItem[];
15
- products: {
16
- data: CategoryItem[];
17
- };
18
- prices?: {
19
- minPrice: number;
20
- };
21
- }
22
- interface CategoryTemplate2Props {
23
- data: CategoryData;
24
- }
25
- export declare const useCategoryTemplate2: (props: CategoryTemplate2Props) => {
26
- companyProfile: any;
27
- data: import("vue").ComputedRef<CategoryData>;
28
- categoryData: import("vue").ComputedRef<{
29
- type: string;
30
- name: string;
31
- slug: string;
32
- image: string;
33
- short_description: string;
34
- sortorder?: number;
35
- category?: string;
36
- }[]>;
37
- hasProducts: import("vue").ComputedRef<boolean>;
38
- categoryName: import("vue").ComputedRef<string>;
39
- getCategoryData: (CatData: CategoryData) => {
40
- type: string;
41
- name: string;
42
- slug: string;
43
- image: string;
44
- short_description: string;
45
- sortorder?: number;
46
- category?: string;
47
- }[];
48
- formatShortDescription: (html: string | null | undefined) => string;
49
- };
50
- export {};
@@ -1,43 +0,0 @@
1
- import { computed } from "vue";
2
- import { useCompanyProfile } from "../Extras/useCompanyProfile";
3
- export const useCategoryTemplate2 = (props) => {
4
- const { profile: companyProfile } = useCompanyProfile();
5
- const getCategoryData = (CatData) => {
6
- const childCategories = CatData.categories.map((item) => ({
7
- ...item,
8
- type: "category"
9
- }));
10
- const products = CatData.products.data.filter((item) => item.category === CatData.category.name).map((item) => ({
11
- ...item,
12
- type: "product"
13
- }));
14
- const newData = [...childCategories, ...products].sort(
15
- (a, b) => (a.sortorder || 0) - (b.sortorder || 0)
16
- );
17
- return newData;
18
- };
19
- const formatShortDescription = (html) => {
20
- if (html === null || html === void 0) {
21
- return "";
22
- }
23
- const text = html.replace(/<[^>]*>/g, "");
24
- const words = text.split(/\s+/);
25
- return words.slice(0, 30).join(" ") + (words.length > 30 ? "..." : "");
26
- };
27
- const data = computed(() => props.data);
28
- const categoryData = computed(() => getCategoryData(data.value));
29
- const hasProducts = computed(() => data.value.products.data.length > 0);
30
- const categoryName = computed(() => data.value.category?.name || "");
31
- return {
32
- // State
33
- companyProfile,
34
- // Computed
35
- data,
36
- categoryData,
37
- hasProducts,
38
- categoryName,
39
- // Methods
40
- getCategoryData,
41
- formatShortDescription
42
- };
43
- };
@@ -1,66 +0,0 @@
1
- interface CategoryData {
2
- category: {
3
- name: string;
4
- h1: string;
5
- description: string;
6
- };
7
- products: {
8
- data: any[];
9
- from: number;
10
- to: number;
11
- total: number;
12
- per_page: number;
13
- links: any[];
14
- last_page: number;
15
- current_page: number;
16
- };
17
- prices: any;
18
- categories: any[];
19
- brands: any[];
20
- filters: any[];
21
- filter_values: any[];
22
- }
23
- interface CategoryTemplate3Props {
24
- data: CategoryData;
25
- }
26
- export declare const useCategoryTemplate3: (props: CategoryTemplate3Props) => {
27
- data: import("vue").ComputedRef<CategoryData>;
28
- category: import("vue").ComputedRef<{
29
- name: string;
30
- h1: string;
31
- description: string;
32
- }>;
33
- products: import("vue").ComputedRef<{
34
- data: any[];
35
- from: number;
36
- to: number;
37
- total: number;
38
- per_page: number;
39
- links: any[];
40
- last_page: number;
41
- current_page: number;
42
- }>;
43
- hasCategory: import("vue").ComputedRef<boolean>;
44
- hasProducts: import("vue").ComputedRef<boolean>;
45
- shouldShowPagination: import("vue").ComputedRef<boolean>;
46
- sidebarData: import("vue").ComputedRef<{
47
- pricing: any;
48
- categories: any[];
49
- brands: any[];
50
- filters: any[];
51
- filterValues: any[];
52
- }>;
53
- topData: import("vue").ComputedRef<{
54
- from: number;
55
- to: number;
56
- total: number;
57
- }>;
58
- paginationData: import("vue").ComputedRef<{
59
- pagination: any[];
60
- lastPage: number;
61
- currentPage: number;
62
- query: import("vue-router").LocationQuery;
63
- }>;
64
- route: import("vue-router").RouteLocationNormalizedLoadedGeneric;
65
- };
66
- export {};
@@ -1,45 +0,0 @@
1
- import { useRoute } from "#imports";
2
- import { computed } from "vue";
3
- export const useCategoryTemplate3 = (props) => {
4
- const route = useRoute();
5
- const data = computed(() => props.data);
6
- const category = computed(() => data.value.category);
7
- const products = computed(() => data.value.products);
8
- const hasCategory = computed(() => !!data.value.category);
9
- const hasProducts = computed(() => data.value.products.data.length > 0);
10
- const shouldShowPagination = computed(
11
- () => data.value.category && data.value.products.total > data.value.products.per_page
12
- );
13
- const sidebarData = computed(() => ({
14
- pricing: data.value.prices,
15
- categories: data.value.categories,
16
- brands: data.value.brands,
17
- filters: data.value.filters,
18
- filterValues: data.value.filter_values
19
- }));
20
- const topData = computed(() => ({
21
- from: data.value.products.from,
22
- to: data.value.products.to,
23
- total: data.value.products.total
24
- }));
25
- const paginationData = computed(() => ({
26
- pagination: data.value.products.links,
27
- lastPage: data.value.products.last_page,
28
- currentPage: data.value.products.current_page,
29
- query: route.query
30
- }));
31
- return {
32
- // Computed
33
- data,
34
- category,
35
- products,
36
- hasCategory,
37
- hasProducts,
38
- shouldShowPagination,
39
- sidebarData,
40
- topData,
41
- paginationData,
42
- // Route
43
- route
44
- };
45
- };