ingeniuscliq-core 0.3.8 → 0.3.10

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.
@@ -1,4 +1,4 @@
1
- import './index.css';var Bh = Object.defineProperty;
1
+ import './index-C25q5vF8-1761141940862.css';var Bh = Object.defineProperty;
2
2
  var Wh = (e, t, n) => t in e ? Bh(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
3
  var Se = (e, t, n) => Wh(e, typeof t != "symbol" ? t + "" : t, n);
4
4
  import Hh from "i18next";
@@ -1788,15 +1788,16 @@ const H5 = (e) => {
1788
1788
  const r = decodeURIComponent(t);
1789
1789
  e.headers && (e.headers["X-XSRF-TOKEN"] = r);
1790
1790
  }
1791
- }, M0 = (e) => e == null ? void 0 : e.styles.reduce((t, n) => {
1792
- var r;
1793
- return {
1794
- ...t,
1795
- ...Object.fromEntries(
1796
- (r = n.colorProperties) == null ? void 0 : r.map((o) => [o.key, o.value])
1797
- )
1798
- };
1799
- }, {});
1791
+ }, M0 = (e) => {
1792
+ var t;
1793
+ return (t = e == null ? void 0 : e.styles) != null && t.length ? e.styles.reduce((n, r) => {
1794
+ if (!Array.isArray(r == null ? void 0 : r.colorProperties) || r.colorProperties.length === 0)
1795
+ return n;
1796
+ for (const { key: o, value: a } of r.colorProperties)
1797
+ n[o] = a;
1798
+ return n;
1799
+ }, {}) : {};
1800
+ };
1800
1801
  function z5(e) {
1801
1802
  return !e || typeof e != "string" ? e : e.charAt(0).toUpperCase() + e.slice(1).toLowerCase();
1802
1803
  }
@@ -2478,33 +2479,20 @@ class X5 {
2478
2479
  throw console.error(a), t((s) => ({ ...s, error: a, loading: !1 })), a;
2479
2480
  }
2480
2481
  },
2481
- removeFromCart: (r) => {
2482
+ removeFromCart: async (r) => {
2482
2483
  try {
2483
- t({ loading: !0, error: null }), this.shopCartService.removeFromCart(r);
2484
- const o = n().cart.items.find((a) => a.productible_id === r);
2485
- o && t(
2486
- (a) => ({
2487
- cart: {
2488
- ...a.cart,
2489
- items: [
2490
- ...a.cart.items,
2491
- { ...o, quantity: o.quantity - 1 }
2492
- ]
2493
- },
2494
- cartItems: [
2495
- ...a.cartItems,
2496
- { ...o, quantity: o.quantity - 1 }
2497
- ],
2498
- loading: !1
2499
- })
2500
- );
2484
+ t({ loading: !0, error: null }), await this.shopCartService.removeFromCart(r);
2485
+ let o = await this.shopCartService.getCart();
2486
+ t(() => ({ cart: o.data.data, cartItems: o.data.data.items, loading: !1 }));
2501
2487
  } catch (o) {
2502
2488
  throw console.error(o), t((a) => ({ ...a, error: o, loading: !1 })), o;
2503
2489
  }
2504
2490
  },
2505
- removeItemFromCart: (r) => {
2491
+ removeItemFromCart: async (r) => {
2506
2492
  try {
2507
- t({ loading: !0, error: null }), this.shopCartService.removeItemFromCart(r), t((o) => ({ cart: { ...o.cart, items: o.cart.items.filter((a) => a.productible_id !== r) }, cartItems: o.cartItems.filter((a) => a.productible_id !== r), loading: !1 }));
2493
+ t({ loading: !0, error: null }), await this.shopCartService.removeItemFromCart(r);
2494
+ let o = await this.shopCartService.getCart();
2495
+ t(() => ({ cart: o.data.data, cartItems: o.data.data.items, loading: !1 }));
2508
2496
  } catch (o) {
2509
2497
  throw console.error(o), t((a) => ({ ...a, error: o, loading: !1 })), o;
2510
2498
  }
@@ -1,2 +1,2 @@
1
1
  import { CoreDesignTemplate } from '../types/ui/template';
2
- export declare const getTemplateStyles: (template?: CoreDesignTemplate) => {} | undefined;
2
+ export declare const getTemplateStyles: (template?: CoreDesignTemplate) => Record<string, string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ingeniuscliq-core",
3
- "version": "0.3.8",
3
+ "version": "0.3.10",
4
4
  "description": "IngeniusCliq Core UI y lógica compartida",
5
5
  "license": "MIT",
6
6
  "type": "module",