ingeniuscliq-core 0.1.22 → 0.1.24

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,5 +1,5 @@
1
1
  import { BaseStyleProps } from '../../../types/ui/main';
2
- import { CoreMenuItem } from '../../../types/types';
2
+ import { CoreMenuItem } from '../../../types';
3
3
  interface CoreSubMenuProps extends BaseStyleProps {
4
4
  classNameItems?: string;
5
5
  items?: CoreMenuItem[];
@@ -1,8 +1,8 @@
1
1
  import { VariantProps } from 'class-variance-authority';
2
2
  import * as React from "react";
3
3
  declare const buttonVariants: (props?: ({
4
- variant?: "link" | "default" | "secondary" | "destructive" | "outline" | "ghost" | null | undefined;
5
- size?: "default" | "sm" | "lg" | "icon" | null | undefined;
4
+ variant?: "default" | "link" | "secondary" | "destructive" | "outline" | "ghost" | null | undefined;
5
+ size?: "default" | "icon" | "sm" | "lg" | null | undefined;
6
6
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
7
  declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
8
8
  asChild?: boolean;
package/dist/index.js CHANGED
@@ -1,421 +1 @@
1
- var p = Object.defineProperty;
2
- var h = (o, t, r) => t in o ? p(o, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : o[t] = r;
3
- var i = (o, t, r) => h(o, typeof t != "symbol" ? t + "" : t, r);
4
- import { B as d } from "./customizationStore-C7lxXp5P.js";
5
- import { a as Ft, C as Ot, S as qt, c as $t, f as Bt, g as Nt, u as xt } from "./customizationStore-C7lxXp5P.js";
6
- import { c as u, p as l } from "./authStore-CBIJbSuH.js";
7
- import { C as Dt, L as zt, d as Mt, f as Ut, R as Ht, U as Gt, a as Vt, e as kt, b as Kt, g as Yt, i as jt, u as Jt } from "./authStore-CBIJbSuH.js";
8
- import C from "i18next";
9
- import { default as Wt } from "i18next";
10
- import { initReactI18next as _ } from "react-i18next";
11
- class wt {
12
- }
13
- const S = { store: "Store", about: "About", contact: "Contact" }, v = { login: "Login", register: "Register", noAccount: "Don't have an account?", alreadyHaveAccount: "Already have an account?" }, f = {
14
- menu: S,
15
- auth: v
16
- }, y = { store: "Tienda", about: "Acerca de", contact: "Contacto" }, g = { login: "Iniciar sesión", register: "Registrarse", noAccount: "¿No tiene una cuenta?", alreadyHaveAccount: "¿Ya tiene una cuenta?" }, I = {
17
- menu: y,
18
- auth: g
19
- }, w = "Loading...", E = { create: "Successfully created", update: "Successfully updated", delete: "Successfully deleted" }, T = { required: "This field is required", invalid: "The entered value is invalid", notFound: "The requested resource was not found" }, A = { delete: "Are you sure you want to delete this item?", cancel: "Are you sure you want to cancel?" }, R = { name: "Name is required", lastname: "Lastname is required", email: "Invalid email address", password: "Password must be at least 8 characters", passwordConfirmation: "Confirm password required", passwordConfirmationNotMatch: "Passwords do not match", customer_name: "Name is required", customer_email: "Invalid email address", customer_phone: { required: "Phone is required", prefix: "Phone must start with +", length: "Phone must be 10 digits" }, customer_address: "Address is required" }, P = {
20
- loading: w,
21
- success: E,
22
- error: T,
23
- confirmation: A,
24
- validation: R
25
- }, b = "Cargando...", F = { create: "Creado exitosamente", update: "Actualizado exitosamente", delete: "Eliminado exitosamente" }, O = { required: "Este campo es requerido", invalid: "El valor ingresado no es válido", notFound: "No se encontró el recurso solicitado" }, q = { delete: "¿Está seguro que desea eliminar este elemento?", cancel: "¿Está seguro que desea cancelar?" }, $ = { name: "El nombre es requerido", lastname: "El apellido es requerido", email: "El correo electrónico no es válido", password: "La contraseña debe tener al menos 8 caracteres", passwordConfirmation: "Confirmar contraseña requerida", passwordConfirmationNotMatch: "Las contraseñas no coinciden", customer_name: "El nombre es requerido", customer_email: "El correo electrónico no es válido", customer_phone: { required: "El teléfono es requerido", prefix: "El teléfono debe empezar con +", length: "El teléfono debe tener 10 dígitos" }, customer_address: "La dirección es requerida" }, B = {
26
- loading: b,
27
- success: F,
28
- error: O,
29
- confirmation: q,
30
- validation: $
31
- }, N = "Name", x = "Lastname", L = "Email", D = "Password", z = "Confirm password", M = "Phone", U = "Address", H = "Note", G = "Name", V = "Email", k = "Phone", K = "Address", Y = {
32
- name: N,
33
- lastname: x,
34
- email: L,
35
- password: D,
36
- password_confirmation: z,
37
- phone: M,
38
- address: U,
39
- note: H,
40
- customer_name: G,
41
- customer_email: V,
42
- customer_phone: k,
43
- customer_address: K
44
- }, j = "Nombre", J = "Apellido", Q = "Correo electrónico", W = "Contraseña", X = "Confirmar contraseña", Z = "Teléfono", tt = "Dirección", et = "Notas", rt = "Nombre", at = "Correo electrónico", st = "Teléfono", ot = "Dirección", ct = {
45
- name: j,
46
- lastname: J,
47
- email: Q,
48
- password: W,
49
- password_confirmation: X,
50
- phone: Z,
51
- address: tt,
52
- note: et,
53
- customer_name: rt,
54
- customer_email: at,
55
- customer_phone: st,
56
- customer_address: ot
57
- }, it = {
58
- en: {
59
- translation: {
60
- ...f,
61
- modules: {},
62
- // Initialize empty modules object
63
- messages: P,
64
- fields: Y
65
- }
66
- },
67
- es: {
68
- translation: {
69
- ...I,
70
- modules: {},
71
- // Initialize empty modules object
72
- messages: B,
73
- fields: ct
74
- }
75
- }
76
- };
77
- C.use(_).init({
78
- resources: it,
79
- lng: "en",
80
- // default language
81
- fallbackLng: "en",
82
- interpolation: {
83
- escapeValue: !1
84
- // not needed for react as it escapes by default
85
- },
86
- // Uncomment these options if you want to detect user's language
87
- // detection: {
88
- // order: ['localStorage', 'navigator']
89
- // },
90
- // have a common namespace used around the full app
91
- defaultNS: "translation",
92
- ns: ["translation"]
93
- });
94
- class nt extends d {
95
- constructor() {
96
- super("orders");
97
- }
98
- }
99
- class Et {
100
- constructor(t = new nt(), r = this.initialState) {
101
- i(this, "orderService");
102
- i(this, "initialState", {
103
- order: {
104
- id: 0,
105
- customer_name: "",
106
- customer_email: "",
107
- customer_address: "",
108
- customer_phone: "",
109
- order_number: "",
110
- userable_type: "",
111
- userable_id: 0,
112
- items_subtotal: 0,
113
- current_base_currency: "",
114
- currency: "",
115
- exchange_rate: 0,
116
- status: "",
117
- base_total_amount_in_cents: 0,
118
- base_total_amount_formatted: "",
119
- total_amount_in_cents: 0,
120
- total_amount_formatted: "",
121
- status_name: "",
122
- allowed_next_statuses: [],
123
- products: []
124
- }
125
- });
126
- this.orderService = t, this.initialState = r;
127
- }
128
- build() {
129
- return u()(
130
- l(
131
- (t, r) => ({
132
- ...this.initialState,
133
- createOrder: async (e) => {
134
- const a = await this.orderService.create(e), s = a.data.data.order;
135
- return t({ order: s }), a.data;
136
- },
137
- fetchOrder: async (e) => {
138
- const a = await this.orderService.getById(e), s = a.data.data;
139
- return t({ order: s }), a.data;
140
- },
141
- getOrder: () => r().order
142
- }),
143
- {
144
- name: "order-storage",
145
- partialize: (t) => ({
146
- order: t.order
147
- })
148
- }
149
- )
150
- );
151
- }
152
- }
153
- class dt extends d {
154
- constructor() {
155
- super("payforms"), this.setCrudResourceProperty("getAll", "payforms/actives");
156
- }
157
- }
158
- class Tt {
159
- constructor(t = new dt(), r = this.initialState) {
160
- i(this, "payFormService");
161
- i(this, "initialState", {
162
- payForms: null,
163
- loading: !1,
164
- error: null
165
- });
166
- this.payFormService = t, this.initialState = r;
167
- }
168
- build() {
169
- return u()(
170
- l(
171
- (t, r) => ({
172
- ...this.initialState,
173
- setPayForms: (e) => t({ payForms: e }),
174
- setLoading: (e) => t({ loading: e }),
175
- setError: (e) => t({ error: e }),
176
- getPayForms: () => r().payForms,
177
- fetchPayForms: async (e) => {
178
- try {
179
- const a = await this.payFormService.getAll(e);
180
- return t({ payForms: a.data.data }), a.data;
181
- } catch (a) {
182
- throw t({ error: a }), a;
183
- }
184
- },
185
- reset: () => t(this.initialState)
186
- }),
187
- {
188
- name: "pay-form-storage",
189
- partialize: (t) => ({
190
- payForms: t.payForms
191
- })
192
- }
193
- )
194
- );
195
- }
196
- }
197
- class ut extends d {
198
- constructor() {
199
- super("product"), this.setCrudResourceProperty("getAll", "shop/products"), this.setCrudResourceProperty("get", "products");
200
- }
201
- }
202
- class At {
203
- constructor(t = new ut(), r = this.initialState) {
204
- i(this, "productService");
205
- i(this, "initialState", {
206
- productDetails: null,
207
- products: null,
208
- loading: !1,
209
- error: null
210
- });
211
- this.productService = t, this.initialState = r;
212
- }
213
- build() {
214
- return u()(
215
- l(
216
- (t, r) => ({
217
- ...this.initialState,
218
- setProductDetails: (e) => t({ productDetails: e }),
219
- setProducts: (e) => t({ products: e }),
220
- setLoading: (e) => t({ loading: e }),
221
- setError: (e) => t({ error: e }),
222
- getProducts: () => r().products,
223
- fetchProducts: async (e) => {
224
- try {
225
- const a = await this.productService.getAll(e);
226
- return t({ products: a.data.data }), a.data;
227
- } catch (a) {
228
- throw t({ error: a }), a;
229
- }
230
- },
231
- getProductDetails: () => r().productDetails,
232
- fetchProductDetails: async (e) => {
233
- try {
234
- const a = await this.productService.getById(e);
235
- return t({ productDetails: a.data.data }), a.data;
236
- } catch (a) {
237
- throw t({ error: a }), a;
238
- }
239
- },
240
- reset: () => t(this.initialState)
241
- }),
242
- {
243
- name: "product-storage",
244
- partialize: (t) => ({
245
- productDetails: t.productDetails,
246
- products: t.products
247
- })
248
- }
249
- )
250
- );
251
- }
252
- }
253
- const lt = "/api/cart/product/add", mt = "/api/cart/product/remove", pt = "/api/cart/product/delete", ht = "/api/cart/clear", Ct = "/api/cart/items", _t = "/api/cart";
254
- class St extends d {
255
- constructor() {
256
- super("shop-cart");
257
- }
258
- addToCart(t, r) {
259
- return this.api.post(lt, { product_id: t, quantity: r });
260
- }
261
- removeFromCart(t) {
262
- this.api.put(mt, { product_id: t });
263
- }
264
- removeItemFromCart(t) {
265
- this.api.delete(pt, { data: { product_id: t } });
266
- }
267
- clearCart() {
268
- this.api.post(ht);
269
- }
270
- getCartItems() {
271
- return this.api.get(Ct);
272
- }
273
- getCart() {
274
- return this.api.get(_t);
275
- }
276
- }
277
- class Rt {
278
- constructor(t = new St(), r = this.initialState) {
279
- i(this, "shopCartService");
280
- i(this, "initialState", {
281
- cart: {
282
- items: [],
283
- subtotal: 0,
284
- total: 0,
285
- itemized_subtotals: []
286
- },
287
- cartItems: []
288
- });
289
- this.shopCartService = t, this.initialState = r;
290
- }
291
- build() {
292
- return u()(
293
- l(
294
- (t, r) => ({
295
- ...this.initialState,
296
- addToCart: async (e, a) => {
297
- const s = r().cart, c = r().cartItems;
298
- try {
299
- const n = await this.shopCartService.addToCart(e, a);
300
- t((m) => ({ cartItems: [...m.cartItems, n.data.data], cart: { ...m.cart, items: [...m.cart.items, n.data.data] } }));
301
- } catch (n) {
302
- console.error(n), t(() => ({ cart: s, cartItems: c }));
303
- }
304
- },
305
- removeFromCart: (e) => {
306
- const a = r().cart;
307
- try {
308
- this.shopCartService.removeFromCart(e);
309
- const s = r().cart.items.find((c) => c.productible_id === e);
310
- s && t(
311
- (c) => ({
312
- cart: {
313
- ...c.cart,
314
- items: [
315
- ...c.cart.items,
316
- { ...s, quantity: s.quantity - 1 }
317
- ]
318
- },
319
- cartItems: [
320
- ...c.cartItems,
321
- { ...s, quantity: s.quantity - 1 }
322
- ]
323
- })
324
- );
325
- } catch (s) {
326
- console.error(s), t(() => ({ cart: a }));
327
- }
328
- },
329
- removeItemFromCart: (e) => {
330
- const a = r().cart;
331
- try {
332
- this.shopCartService.removeItemFromCart(e), t((s) => ({ cart: { ...s.cart, items: s.cart.items.filter((c) => c.productible_id !== e) }, cartItems: s.cartItems.filter((c) => c.productible_id !== e) }));
333
- } catch (s) {
334
- console.error(s), t(() => ({ cart: a }));
335
- }
336
- },
337
- clearCart: () => {
338
- const e = r().cart, a = r().cartItems;
339
- try {
340
- this.shopCartService.clearCart(), t({ ...this.initialState });
341
- } catch (s) {
342
- console.error(s), t(() => ({ cart: e, cartItems: a }));
343
- }
344
- },
345
- getCartItems: () => r().cartItems,
346
- getCart: () => r().cart,
347
- setCart: (e) => {
348
- t({ cart: e });
349
- },
350
- setCartItems: (e) => {
351
- t({ cartItems: e });
352
- },
353
- fetchCart: async () => {
354
- const e = r().cart, a = r().cartItems;
355
- try {
356
- let s = await this.shopCartService.getCart();
357
- return t(() => ({ cart: s.data.data, cartItems: s.data.data.items })), s.data;
358
- } catch (s) {
359
- throw console.error(s), t(() => ({ cart: e, cartItems: a })), s;
360
- }
361
- },
362
- fetchCartItems: async () => {
363
- const e = r().cartItems, a = r().cart;
364
- try {
365
- let s = await this.shopCartService.getCartItems();
366
- return t(() => ({ cartItems: s.data.data })), s.data;
367
- } catch (s) {
368
- throw console.error(s), t(() => ({ cartItems: e, cart: a })), s;
369
- }
370
- }
371
- }),
372
- {
373
- name: "shop-cart-storage",
374
- partialize: (t) => ({
375
- cart: t.cart,
376
- cartItems: t.cartItems
377
- })
378
- }
379
- )
380
- );
381
- }
382
- }
383
- export {
384
- d as BaseService,
385
- Dt as CoreAuthBaseService,
386
- wt as CoreBuilder,
387
- Ft as CoreCustomizationBaseService,
388
- Ot as CoreCustomizationBuilder,
389
- nt as CoreOrderBaseService,
390
- Et as CoreOrderBuilder,
391
- dt as CorePayFormBaseService,
392
- Tt as CorePayFormBuilder,
393
- ut as CoreProductBaseService,
394
- At as CoreProductBuilder,
395
- St as CoreShopCartBaseService,
396
- Rt as CoreShopCartBuilder,
397
- zt as LOGIN_ROUTE,
398
- Mt as LOGOUT_ROUTE,
399
- Ut as REFRESH_TOKEN_ROUTE,
400
- Ht as REGISTER_ROUTE,
401
- lt as SHOP_CART_ADD_TO_CART,
402
- ht as SHOP_CART_CLEAR_CART,
403
- _t as SHOP_CART_GET_CART,
404
- Ct as SHOP_CART_GET_CART_ITEMS,
405
- mt as SHOP_CART_REMOVE_FROM_CART,
406
- pt as SHOP_CART_REMOVE_ITEM_FROM_CART,
407
- qt as SUB_MENU_HEADER,
408
- Gt as USER_ROUTE,
409
- Vt as api,
410
- $t as capitalizeFirstLetter,
411
- kt as ensureCsrfToken,
412
- Bt as findComponentPath,
413
- Nt as getTemplateStyles,
414
- Kt as getTenantName,
415
- Yt as getTenantURL,
416
- Wt as i18n,
417
- jt as isCentralAccess,
418
- it as resources,
419
- Jt as useAuthStore,
420
- xt as useCustomizationStore
421
- };
1
+
@@ -1,5 +1,5 @@
1
- import { t as i } from "../useAuth-CQWwwHN3.js";
2
- import { b as p, u as g, a as m } from "../useAuth-CQWwwHN3.js";
1
+ import { t as i } from "./useAuth-CQWwwHN3.js";
2
+ import { b as p, u as g, a as m } from "./useAuth-CQWwwHN3.js";
3
3
  function n() {
4
4
  return {
5
5
  notify: (t, o, s = 1e3, e) => {
package/dist/index3.js ADDED
@@ -0,0 +1,421 @@
1
+ var p = Object.defineProperty;
2
+ var h = (o, t, r) => t in o ? p(o, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : o[t] = r;
3
+ var i = (o, t, r) => h(o, typeof t != "symbol" ? t + "" : t, r);
4
+ import { B as d } from "./customizationStore-C7lxXp5P.js";
5
+ import { a as Ft, C as Ot, S as qt, c as $t, f as Bt, g as Nt, u as xt } from "./customizationStore-C7lxXp5P.js";
6
+ import { c as u, p as l } from "./authStore-CBIJbSuH.js";
7
+ import { C as Dt, L as zt, d as Mt, f as Ut, R as Ht, U as Gt, a as Vt, e as kt, b as Kt, g as Yt, i as jt, u as Jt } from "./authStore-CBIJbSuH.js";
8
+ import C from "i18next";
9
+ import { default as Wt } from "i18next";
10
+ import { initReactI18next as _ } from "react-i18next";
11
+ class wt {
12
+ }
13
+ const S = { store: "Store", about: "About", contact: "Contact" }, v = { login: "Login", register: "Register", noAccount: "Don't have an account?", alreadyHaveAccount: "Already have an account?" }, f = {
14
+ menu: S,
15
+ auth: v
16
+ }, y = { store: "Tienda", about: "Acerca de", contact: "Contacto" }, g = { login: "Iniciar sesión", register: "Registrarse", noAccount: "¿No tiene una cuenta?", alreadyHaveAccount: "¿Ya tiene una cuenta?" }, I = {
17
+ menu: y,
18
+ auth: g
19
+ }, w = "Loading...", E = { create: "Successfully created", update: "Successfully updated", delete: "Successfully deleted" }, T = { required: "This field is required", invalid: "The entered value is invalid", notFound: "The requested resource was not found" }, A = { delete: "Are you sure you want to delete this item?", cancel: "Are you sure you want to cancel?" }, R = { name: "Name is required", lastname: "Lastname is required", email: "Invalid email address", password: "Password must be at least 8 characters", passwordConfirmation: "Confirm password required", passwordConfirmationNotMatch: "Passwords do not match", customer_name: "Name is required", customer_email: "Invalid email address", customer_phone: { required: "Phone is required", prefix: "Phone must start with +", length: "Phone must be 10 digits" }, customer_address: "Address is required" }, P = {
20
+ loading: w,
21
+ success: E,
22
+ error: T,
23
+ confirmation: A,
24
+ validation: R
25
+ }, b = "Cargando...", F = { create: "Creado exitosamente", update: "Actualizado exitosamente", delete: "Eliminado exitosamente" }, O = { required: "Este campo es requerido", invalid: "El valor ingresado no es válido", notFound: "No se encontró el recurso solicitado" }, q = { delete: "¿Está seguro que desea eliminar este elemento?", cancel: "¿Está seguro que desea cancelar?" }, $ = { name: "El nombre es requerido", lastname: "El apellido es requerido", email: "El correo electrónico no es válido", password: "La contraseña debe tener al menos 8 caracteres", passwordConfirmation: "Confirmar contraseña requerida", passwordConfirmationNotMatch: "Las contraseñas no coinciden", customer_name: "El nombre es requerido", customer_email: "El correo electrónico no es válido", customer_phone: { required: "El teléfono es requerido", prefix: "El teléfono debe empezar con +", length: "El teléfono debe tener 10 dígitos" }, customer_address: "La dirección es requerida" }, B = {
26
+ loading: b,
27
+ success: F,
28
+ error: O,
29
+ confirmation: q,
30
+ validation: $
31
+ }, N = "Name", x = "Lastname", L = "Email", D = "Password", z = "Confirm password", M = "Phone", U = "Address", H = "Note", G = "Name", V = "Email", k = "Phone", K = "Address", Y = {
32
+ name: N,
33
+ lastname: x,
34
+ email: L,
35
+ password: D,
36
+ password_confirmation: z,
37
+ phone: M,
38
+ address: U,
39
+ note: H,
40
+ customer_name: G,
41
+ customer_email: V,
42
+ customer_phone: k,
43
+ customer_address: K
44
+ }, j = "Nombre", J = "Apellido", Q = "Correo electrónico", W = "Contraseña", X = "Confirmar contraseña", Z = "Teléfono", tt = "Dirección", et = "Notas", rt = "Nombre", at = "Correo electrónico", st = "Teléfono", ot = "Dirección", ct = {
45
+ name: j,
46
+ lastname: J,
47
+ email: Q,
48
+ password: W,
49
+ password_confirmation: X,
50
+ phone: Z,
51
+ address: tt,
52
+ note: et,
53
+ customer_name: rt,
54
+ customer_email: at,
55
+ customer_phone: st,
56
+ customer_address: ot
57
+ }, it = {
58
+ en: {
59
+ translation: {
60
+ ...f,
61
+ modules: {},
62
+ // Initialize empty modules object
63
+ messages: P,
64
+ fields: Y
65
+ }
66
+ },
67
+ es: {
68
+ translation: {
69
+ ...I,
70
+ modules: {},
71
+ // Initialize empty modules object
72
+ messages: B,
73
+ fields: ct
74
+ }
75
+ }
76
+ };
77
+ C.use(_).init({
78
+ resources: it,
79
+ lng: "en",
80
+ // default language
81
+ fallbackLng: "en",
82
+ interpolation: {
83
+ escapeValue: !1
84
+ // not needed for react as it escapes by default
85
+ },
86
+ // Uncomment these options if you want to detect user's language
87
+ // detection: {
88
+ // order: ['localStorage', 'navigator']
89
+ // },
90
+ // have a common namespace used around the full app
91
+ defaultNS: "translation",
92
+ ns: ["translation"]
93
+ });
94
+ class nt extends d {
95
+ constructor() {
96
+ super("orders");
97
+ }
98
+ }
99
+ class Et {
100
+ constructor(t = new nt(), r = this.initialState) {
101
+ i(this, "orderService");
102
+ i(this, "initialState", {
103
+ order: {
104
+ id: 0,
105
+ customer_name: "",
106
+ customer_email: "",
107
+ customer_address: "",
108
+ customer_phone: "",
109
+ order_number: "",
110
+ userable_type: "",
111
+ userable_id: 0,
112
+ items_subtotal: 0,
113
+ current_base_currency: "",
114
+ currency: "",
115
+ exchange_rate: 0,
116
+ status: "",
117
+ base_total_amount_in_cents: 0,
118
+ base_total_amount_formatted: "",
119
+ total_amount_in_cents: 0,
120
+ total_amount_formatted: "",
121
+ status_name: "",
122
+ allowed_next_statuses: [],
123
+ products: []
124
+ }
125
+ });
126
+ this.orderService = t, this.initialState = r;
127
+ }
128
+ build() {
129
+ return u()(
130
+ l(
131
+ (t, r) => ({
132
+ ...this.initialState,
133
+ createOrder: async (e) => {
134
+ const a = await this.orderService.create(e), s = a.data.data.order;
135
+ return t({ order: s }), a.data;
136
+ },
137
+ fetchOrder: async (e) => {
138
+ const a = await this.orderService.getById(e), s = a.data.data;
139
+ return t({ order: s }), a.data;
140
+ },
141
+ getOrder: () => r().order
142
+ }),
143
+ {
144
+ name: "order-storage",
145
+ partialize: (t) => ({
146
+ order: t.order
147
+ })
148
+ }
149
+ )
150
+ );
151
+ }
152
+ }
153
+ class dt extends d {
154
+ constructor() {
155
+ super("payforms"), this.setCrudResourceProperty("getAll", "payforms/actives");
156
+ }
157
+ }
158
+ class Tt {
159
+ constructor(t = new dt(), r = this.initialState) {
160
+ i(this, "payFormService");
161
+ i(this, "initialState", {
162
+ payForms: null,
163
+ loading: !1,
164
+ error: null
165
+ });
166
+ this.payFormService = t, this.initialState = r;
167
+ }
168
+ build() {
169
+ return u()(
170
+ l(
171
+ (t, r) => ({
172
+ ...this.initialState,
173
+ setPayForms: (e) => t({ payForms: e }),
174
+ setLoading: (e) => t({ loading: e }),
175
+ setError: (e) => t({ error: e }),
176
+ getPayForms: () => r().payForms,
177
+ fetchPayForms: async (e) => {
178
+ try {
179
+ const a = await this.payFormService.getAll(e);
180
+ return t({ payForms: a.data.data }), a.data;
181
+ } catch (a) {
182
+ throw t({ error: a }), a;
183
+ }
184
+ },
185
+ reset: () => t(this.initialState)
186
+ }),
187
+ {
188
+ name: "pay-form-storage",
189
+ partialize: (t) => ({
190
+ payForms: t.payForms
191
+ })
192
+ }
193
+ )
194
+ );
195
+ }
196
+ }
197
+ class ut extends d {
198
+ constructor() {
199
+ super("product"), this.setCrudResourceProperty("getAll", "shop/products"), this.setCrudResourceProperty("get", "products");
200
+ }
201
+ }
202
+ class At {
203
+ constructor(t = new ut(), r = this.initialState) {
204
+ i(this, "productService");
205
+ i(this, "initialState", {
206
+ productDetails: null,
207
+ products: null,
208
+ loading: !1,
209
+ error: null
210
+ });
211
+ this.productService = t, this.initialState = r;
212
+ }
213
+ build() {
214
+ return u()(
215
+ l(
216
+ (t, r) => ({
217
+ ...this.initialState,
218
+ setProductDetails: (e) => t({ productDetails: e }),
219
+ setProducts: (e) => t({ products: e }),
220
+ setLoading: (e) => t({ loading: e }),
221
+ setError: (e) => t({ error: e }),
222
+ getProducts: () => r().products,
223
+ fetchProducts: async (e) => {
224
+ try {
225
+ const a = await this.productService.getAll(e);
226
+ return t({ products: a.data.data }), a.data;
227
+ } catch (a) {
228
+ throw t({ error: a }), a;
229
+ }
230
+ },
231
+ getProductDetails: () => r().productDetails,
232
+ fetchProductDetails: async (e) => {
233
+ try {
234
+ const a = await this.productService.getById(e);
235
+ return t({ productDetails: a.data.data }), a.data;
236
+ } catch (a) {
237
+ throw t({ error: a }), a;
238
+ }
239
+ },
240
+ reset: () => t(this.initialState)
241
+ }),
242
+ {
243
+ name: "product-storage",
244
+ partialize: (t) => ({
245
+ productDetails: t.productDetails,
246
+ products: t.products
247
+ })
248
+ }
249
+ )
250
+ );
251
+ }
252
+ }
253
+ const lt = "/api/cart/product/add", mt = "/api/cart/product/remove", pt = "/api/cart/product/delete", ht = "/api/cart/clear", Ct = "/api/cart/items", _t = "/api/cart";
254
+ class St extends d {
255
+ constructor() {
256
+ super("shop-cart");
257
+ }
258
+ addToCart(t, r) {
259
+ return this.api.post(lt, { product_id: t, quantity: r });
260
+ }
261
+ removeFromCart(t) {
262
+ this.api.put(mt, { product_id: t });
263
+ }
264
+ removeItemFromCart(t) {
265
+ this.api.delete(pt, { data: { product_id: t } });
266
+ }
267
+ clearCart() {
268
+ this.api.post(ht);
269
+ }
270
+ getCartItems() {
271
+ return this.api.get(Ct);
272
+ }
273
+ getCart() {
274
+ return this.api.get(_t);
275
+ }
276
+ }
277
+ class Rt {
278
+ constructor(t = new St(), r = this.initialState) {
279
+ i(this, "shopCartService");
280
+ i(this, "initialState", {
281
+ cart: {
282
+ items: [],
283
+ subtotal: 0,
284
+ total: 0,
285
+ itemized_subtotals: []
286
+ },
287
+ cartItems: []
288
+ });
289
+ this.shopCartService = t, this.initialState = r;
290
+ }
291
+ build() {
292
+ return u()(
293
+ l(
294
+ (t, r) => ({
295
+ ...this.initialState,
296
+ addToCart: async (e, a) => {
297
+ const s = r().cart, c = r().cartItems;
298
+ try {
299
+ const n = await this.shopCartService.addToCart(e, a);
300
+ t((m) => ({ cartItems: [...m.cartItems, n.data.data], cart: { ...m.cart, items: [...m.cart.items, n.data.data] } }));
301
+ } catch (n) {
302
+ console.error(n), t(() => ({ cart: s, cartItems: c }));
303
+ }
304
+ },
305
+ removeFromCart: (e) => {
306
+ const a = r().cart;
307
+ try {
308
+ this.shopCartService.removeFromCart(e);
309
+ const s = r().cart.items.find((c) => c.productible_id === e);
310
+ s && t(
311
+ (c) => ({
312
+ cart: {
313
+ ...c.cart,
314
+ items: [
315
+ ...c.cart.items,
316
+ { ...s, quantity: s.quantity - 1 }
317
+ ]
318
+ },
319
+ cartItems: [
320
+ ...c.cartItems,
321
+ { ...s, quantity: s.quantity - 1 }
322
+ ]
323
+ })
324
+ );
325
+ } catch (s) {
326
+ console.error(s), t(() => ({ cart: a }));
327
+ }
328
+ },
329
+ removeItemFromCart: (e) => {
330
+ const a = r().cart;
331
+ try {
332
+ this.shopCartService.removeItemFromCart(e), t((s) => ({ cart: { ...s.cart, items: s.cart.items.filter((c) => c.productible_id !== e) }, cartItems: s.cartItems.filter((c) => c.productible_id !== e) }));
333
+ } catch (s) {
334
+ console.error(s), t(() => ({ cart: a }));
335
+ }
336
+ },
337
+ clearCart: () => {
338
+ const e = r().cart, a = r().cartItems;
339
+ try {
340
+ this.shopCartService.clearCart(), t({ ...this.initialState });
341
+ } catch (s) {
342
+ console.error(s), t(() => ({ cart: e, cartItems: a }));
343
+ }
344
+ },
345
+ getCartItems: () => r().cartItems,
346
+ getCart: () => r().cart,
347
+ setCart: (e) => {
348
+ t({ cart: e });
349
+ },
350
+ setCartItems: (e) => {
351
+ t({ cartItems: e });
352
+ },
353
+ fetchCart: async () => {
354
+ const e = r().cart, a = r().cartItems;
355
+ try {
356
+ let s = await this.shopCartService.getCart();
357
+ return t(() => ({ cart: s.data.data, cartItems: s.data.data.items })), s.data;
358
+ } catch (s) {
359
+ throw console.error(s), t(() => ({ cart: e, cartItems: a })), s;
360
+ }
361
+ },
362
+ fetchCartItems: async () => {
363
+ const e = r().cartItems, a = r().cart;
364
+ try {
365
+ let s = await this.shopCartService.getCartItems();
366
+ return t(() => ({ cartItems: s.data.data })), s.data;
367
+ } catch (s) {
368
+ throw console.error(s), t(() => ({ cartItems: e, cart: a })), s;
369
+ }
370
+ }
371
+ }),
372
+ {
373
+ name: "shop-cart-storage",
374
+ partialize: (t) => ({
375
+ cart: t.cart,
376
+ cartItems: t.cartItems
377
+ })
378
+ }
379
+ )
380
+ );
381
+ }
382
+ }
383
+ export {
384
+ d as BaseService,
385
+ Dt as CoreAuthBaseService,
386
+ wt as CoreBuilder,
387
+ Ft as CoreCustomizationBaseService,
388
+ Ot as CoreCustomizationBuilder,
389
+ nt as CoreOrderBaseService,
390
+ Et as CoreOrderBuilder,
391
+ dt as CorePayFormBaseService,
392
+ Tt as CorePayFormBuilder,
393
+ ut as CoreProductBaseService,
394
+ At as CoreProductBuilder,
395
+ St as CoreShopCartBaseService,
396
+ Rt as CoreShopCartBuilder,
397
+ zt as LOGIN_ROUTE,
398
+ Mt as LOGOUT_ROUTE,
399
+ Ut as REFRESH_TOKEN_ROUTE,
400
+ Ht as REGISTER_ROUTE,
401
+ lt as SHOP_CART_ADD_TO_CART,
402
+ ht as SHOP_CART_CLEAR_CART,
403
+ _t as SHOP_CART_GET_CART,
404
+ Ct as SHOP_CART_GET_CART_ITEMS,
405
+ mt as SHOP_CART_REMOVE_FROM_CART,
406
+ pt as SHOP_CART_REMOVE_ITEM_FROM_CART,
407
+ qt as SUB_MENU_HEADER,
408
+ Gt as USER_ROUTE,
409
+ Vt as api,
410
+ $t as capitalizeFirstLetter,
411
+ kt as ensureCsrfToken,
412
+ Bt as findComponentPath,
413
+ Nt as getTemplateStyles,
414
+ Kt as getTenantName,
415
+ Yt as getTenantURL,
416
+ Wt as i18n,
417
+ jt as isCentralAccess,
418
+ it as resources,
419
+ Jt as useAuthStore,
420
+ xt as useCustomizationStore
421
+ };
@@ -3,12 +3,12 @@ import * as p from "react";
3
3
  import k, { useRef as or, useState as vt, useCallback as qe, useEffect as Tn, forwardRef as gu, createElement as As, useLayoutEffect as ui, lazy as $o, Suspense as vu, createContext as cv, useContext as lv, useMemo as Fo, Fragment as uv } from "react";
4
4
  import * as ua from "react-dom";
5
5
  import bu from "react-dom";
6
- import { a as Vn, u as dv, T as fv, b as wu } from "../useAuth-CQWwwHN3.js";
6
+ import { a as Vn, u as dv, T as fv, b as wu } from "./useAuth-CQWwwHN3.js";
7
7
  import { Link as yu, useNavigate as mv } from "@tanstack/react-router";
8
- import { S as pv, c as Dc, u as hv, f as gv, g as vv } from "../customizationStore-C7lxXp5P.js";
8
+ import { S as pv, c as Dc, u as hv, f as gv, g as vv } from "./customizationStore-C7lxXp5P.js";
9
9
  import { useQuery as bv } from "@tanstack/react-query";
10
- import { b as wv } from "../authStore-CBIJbSuH.js";
11
- import '../ui.css';function yv(e) {
10
+ import { b as wv } from "./authStore-CBIJbSuH.js";
11
+ import './index.css';function yv(e) {
12
12
  return Object.prototype.toString.call(e) === "[object Object]";
13
13
  }
14
14
  function Pc(e) {
@@ -8,7 +8,7 @@ export declare class CorePayFormBuilder implements CoreBuilder {
8
8
  build(): import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<CorePayFormStore<CorePayForm>>, "persist"> & {
9
9
  persist: {
10
10
  setOptions: (options: Partial<import('zustand/middleware').PersistOptions<CorePayFormStore<CorePayForm>, {
11
- payForms: import('../../../types/contracts').BasePagination<CorePayForm> | null;
11
+ payForms: import('../../../types').BasePagination<CorePayForm> | null;
12
12
  }>>) => void;
13
13
  clearStorage: () => void;
14
14
  rehydrate: () => Promise<void> | void;
@@ -16,7 +16,7 @@ export declare class CorePayFormBuilder implements CoreBuilder {
16
16
  onHydrate: (fn: (state: CorePayFormStore<CorePayForm>) => void) => () => void;
17
17
  onFinishHydration: (fn: (state: CorePayFormStore<CorePayForm>) => void) => () => void;
18
18
  getOptions: () => Partial<import('zustand/middleware').PersistOptions<CorePayFormStore<CorePayForm>, {
19
- payForms: import('../../../types/contracts').BasePagination<CorePayForm> | null;
19
+ payForms: import('../../../types').BasePagination<CorePayForm> | null;
20
20
  }>>;
21
21
  };
22
22
  }>;
@@ -9,7 +9,7 @@ export declare class CoreProductBuilder implements CoreBuilder {
9
9
  persist: {
10
10
  setOptions: (options: Partial<import('zustand/middleware').PersistOptions<CoreProductStore<CoreProduct>, {
11
11
  productDetails: CoreProduct | null;
12
- products: import('../../../types/contracts').BasePagination<CoreProduct> | null;
12
+ products: import('../../../types').BasePagination<CoreProduct> | null;
13
13
  }>>) => void;
14
14
  clearStorage: () => void;
15
15
  rehydrate: () => Promise<void> | void;
@@ -18,7 +18,7 @@ export declare class CoreProductBuilder implements CoreBuilder {
18
18
  onFinishHydration: (fn: (state: CoreProductStore<CoreProduct>) => void) => () => void;
19
19
  getOptions: () => Partial<import('zustand/middleware').PersistOptions<CoreProductStore<CoreProduct>, {
20
20
  productDetails: CoreProduct | null;
21
- products: import('../../../types/contracts').BasePagination<CoreProduct> | null;
21
+ products: import('../../../types').BasePagination<CoreProduct> | null;
22
22
  }>>;
23
23
  };
24
24
  }>;
@@ -1,6 +1,6 @@
1
- export declare const useCustomizationStore: import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<import('../types/types').CoreCustomizationStore>, "persist"> & {
1
+ export declare const useCustomizationStore: import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<import('../types').CoreCustomizationStore>, "persist"> & {
2
2
  persist: {
3
- setOptions: (options: Partial<import('zustand/middleware').PersistOptions<import('../types/types').CoreCustomizationStore, {
3
+ setOptions: (options: Partial<import('zustand/middleware').PersistOptions<import('../types').CoreCustomizationStore, {
4
4
  template: string | null;
5
5
  components: string[] | null;
6
6
  styles: import('../types/ui').CoreDesignTemplateStyles[] | null;
@@ -9,9 +9,9 @@ export declare const useCustomizationStore: import('zustand').UseBoundStore<Omit
9
9
  clearStorage: () => void;
10
10
  rehydrate: () => Promise<void> | void;
11
11
  hasHydrated: () => boolean;
12
- onHydrate: (fn: (state: import('../types/types').CoreCustomizationStore) => void) => () => void;
13
- onFinishHydration: (fn: (state: import('../types/types').CoreCustomizationStore) => void) => () => void;
14
- getOptions: () => Partial<import('zustand/middleware').PersistOptions<import('../types/types').CoreCustomizationStore, {
12
+ onHydrate: (fn: (state: import('../types').CoreCustomizationStore) => void) => () => void;
13
+ onFinishHydration: (fn: (state: import('../types').CoreCustomizationStore) => void) => () => void;
14
+ getOptions: () => Partial<import('zustand/middleware').PersistOptions<import('../types').CoreCustomizationStore, {
15
15
  template: string | null;
16
16
  components: string[] | null;
17
17
  styles: import('../types/ui').CoreDesignTemplateStyles[] | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ingeniuscliq-core",
3
- "version": "0.1.22",
3
+ "version": "0.1.24",
4
4
  "description": "IngeniusCliq Core UI y lógica compartida",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -13,15 +13,7 @@
13
13
  },
14
14
  "./ui": {
15
15
  "import": "./dist/ui/index.js",
16
- "types": "./dist/ui/ui.d.ts"
17
- },
18
- "./types": {
19
- "import": "./dist/types/index.js",
20
- "types": "./dist/types/types.d.ts"
21
- },
22
- "./hooks": {
23
- "import": "./dist/hooks/index.js",
24
- "types": "./dist/hooks/hooks.d.ts"
16
+ "types": "./dist/ui/index.d.ts"
25
17
  }
26
18
  },
27
19
  "files": [
@@ -1 +0,0 @@
1
-
File without changes
File without changes
File without changes
File without changes