@infuro/cms-core 1.0.45 → 1.0.47

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 (82) hide show
  1. package/README.md +19 -2
  2. package/dist/admin.cjs +4249 -2872
  3. package/dist/admin.d.cts +24 -4
  4. package/dist/admin.d.ts +24 -4
  5. package/dist/admin.js +3179 -1804
  6. package/dist/api.cjs +41 -39
  7. package/dist/api.d.cts +10 -4
  8. package/dist/api.d.ts +10 -4
  9. package/dist/api.js +9 -7
  10. package/dist/auth.cjs +55 -51
  11. package/dist/auth.d.cts +6 -3
  12. package/dist/auth.d.ts +6 -3
  13. package/dist/auth.js +3 -3
  14. package/dist/{chunk-KFFB6EMZ.js → chunk-2HU5R2JE.js} +2 -0
  15. package/dist/chunk-2IAXTKQN.cjs +19 -0
  16. package/dist/chunk-2KUCQVAQ.js +936 -0
  17. package/dist/chunk-3K5AIEIZ.js +256 -0
  18. package/dist/{chunk-SPQFNIYJ.cjs → chunk-4PMK3RNA.cjs} +2 -0
  19. package/dist/{chunk-X6UQFV4X.cjs → chunk-77NUXO6A.cjs} +14 -12
  20. package/dist/chunk-BXYZDMTZ.cjs +953 -0
  21. package/dist/chunk-DBPSJYLZ.js +47 -0
  22. package/dist/chunk-EIZKW2PF.js +13 -0
  23. package/dist/chunk-HY3AXLOI.cjs +265 -0
  24. package/dist/{chunk-X47PBV4I.js → chunk-JE22VP6S.js} +1 -0
  25. package/dist/{chunk-DN65KDIA.js → chunk-JIWUVQ6B.js} +14 -13
  26. package/dist/{chunk-HT5DI3XW.cjs → chunk-KOTXDSQB.cjs} +1 -0
  27. package/dist/chunk-L3525VXI.js +243 -0
  28. package/dist/{chunk-22FFHLTO.cjs → chunk-LMJ7RKPF.cjs} +421 -150
  29. package/dist/chunk-OY2YTBMP.cjs +50 -0
  30. package/dist/{chunk-TAHX46EI.cjs → chunk-Q3HQEM4R.cjs} +15 -7
  31. package/dist/chunk-V25RDUOU.cjs +248 -0
  32. package/dist/{chunk-ZMRQ72F6.cjs → chunk-VUQFARRT.cjs} +10 -10
  33. package/dist/{chunk-MVXLRANV.js → chunk-W42UZLQO.js} +1977 -891
  34. package/dist/{chunk-F5XFHYTG.cjs → chunk-XUCKZPML.cjs} +2088 -991
  35. package/dist/{chunk-I6NH72MO.js → chunk-YC4NUZCS.js} +10 -2
  36. package/dist/{chunk-NNQBWDCI.js → chunk-YXH2UUEZ.js} +418 -146
  37. package/dist/{chunk-BLR6H5GL.js → chunk-ZF2RQWXB.js} +4 -4
  38. package/dist/cli.cjs +9 -4
  39. package/dist/cli.js +9 -4
  40. package/dist/{email-queue-TPZWLTIV.cjs → email-queue-6NJY6HNM.cjs} +7 -5
  41. package/dist/email-queue-OI2HSCGE.js +4 -0
  42. package/dist/{emit-order-notification-trigger-IVLWKKJL.js → emit-order-notification-trigger-6XX7LSC4.js} +1 -1
  43. package/dist/{emit-order-notification-trigger-D2N3KFHL.cjs → emit-order-notification-trigger-NASG7ZEO.cjs} +3 -3
  44. package/dist/erp-order-invoice-3GXDE443.js +3 -0
  45. package/dist/erp-order-invoice-EYYNR526.cjs +24 -0
  46. package/dist/{event-order-defaults-EMWBIGL3.cjs → event-order-defaults-7Z3UZOEH.cjs} +9 -9
  47. package/dist/{event-order-defaults-SDRNAZHC.js → event-order-defaults-XQ3IDPD7.js} +1 -1
  48. package/dist/hooks.cjs +43 -0
  49. package/dist/hooks.d.cts +10 -1
  50. package/dist/hooks.d.ts +10 -1
  51. package/dist/hooks.js +39 -1
  52. package/dist/index.cjs +429 -298
  53. package/dist/index.d.cts +317 -30
  54. package/dist/index.d.ts +317 -30
  55. package/dist/index.js +17 -13
  56. package/dist/migrations/1781810000000-OrderItemsVariantId.ts +44 -0
  57. package/dist/migrations/1781900000000-UserInviteStatusToken.ts +46 -0
  58. package/dist/migrations/1782000000000-ComboSlug.ts +58 -0
  59. package/dist/migrations/1782100000000-DiscountDeviceType.ts +20 -0
  60. package/dist/migrations/1782200000000-VendorTeamProfiles.ts +233 -0
  61. package/dist/migrations/1782300000000-AddTypeToOrderNotificationBindings.ts +75 -0
  62. package/dist/order-inventory-2MYRKEPC.cjs +39 -0
  63. package/dist/order-inventory-76V4XIGW.js +2 -0
  64. package/dist/{order-notification-dispatcher-XWIJYDGA.js → order-notification-dispatcher-6WNG24NY.js} +4 -2
  65. package/dist/{order-notification-dispatcher-RU7BTGGX.cjs → order-notification-dispatcher-6XSU3AR7.cjs} +6 -4
  66. package/dist/{rbac-debug-db-2SGNLANF.js → rbac-debug-db-6EMIVMGF.js} +1 -1
  67. package/dist/{rbac-debug-db-4Z6A425H.cjs → rbac-debug-db-6PWTLBEL.cjs} +2 -2
  68. package/dist/retire-soft-deleted-unique-5VXBA5XX.cjs +15 -0
  69. package/dist/retire-soft-deleted-unique-NXQIH4BC.js +2 -0
  70. package/dist/theme.cjs +6 -1
  71. package/dist/theme.d.cts +4 -1
  72. package/dist/theme.d.ts +4 -1
  73. package/dist/theme.js +3 -1
  74. package/package.json +5 -4
  75. package/src/admin/admin.css +34 -24
  76. package/dist/chunk-5ELSW2UP.js +0 -150
  77. package/dist/chunk-PNOKNSG2.cjs +0 -222
  78. package/dist/chunk-WEMDMVHQ.js +0 -216
  79. package/dist/chunk-XW5ATPRW.cjs +0 -155
  80. package/dist/email-queue-CGZBVVAS.js +0 -2
  81. package/dist/erp-order-invoice-3YISSOWW.js +0 -3
  82. package/dist/erp-order-invoice-ZR5F2KTA.cjs +0 -12
@@ -1,4 +1,4 @@
1
- import { explainSessionEntityAccess, isVendorPortalUser, logRbac } from './chunk-DN65KDIA.js';
1
+ import { explainSessionEntityAccess, isVendorPortalUser, logRbac } from './chunk-JIWUVQ6B.js';
2
2
  import { __name } from './chunk-SHUYVCID.js';
3
3
 
4
4
  // src/auth/helpers.ts
@@ -66,7 +66,7 @@ function createCmsAuthBundle(getSession, NextResponse) {
66
66
  __name(createCmsAuthBundle, "createCmsAuthBundle");
67
67
  function createAuthHelpersFromGetSession(getSession, NextResponse) {
68
68
  return {
69
- async requireAuth() {
69
+ async requireAuth(_req) {
70
70
  const session = await getSession();
71
71
  if (!session?.user?.email) {
72
72
  return NextResponse.json({
@@ -77,7 +77,7 @@ function createAuthHelpersFromGetSession(getSession, NextResponse) {
77
77
  }
78
78
  return null;
79
79
  },
80
- async requirePermission() {
80
+ async requirePermission(_req, _permission) {
81
81
  const session = await getSession();
82
82
  if (!session?.user?.email) {
83
83
  return NextResponse.json({
@@ -121,7 +121,7 @@ function createAuthHelpersFromGetSession(getSession, NextResponse) {
121
121
  status: 403
122
122
  });
123
123
  },
124
- async requireAdminAccess() {
124
+ async requireAdminAccess(_req) {
125
125
  const session = await getSession();
126
126
  if (!session?.user?.email) {
127
127
  return NextResponse.json({
package/dist/cli.cjs CHANGED
@@ -220,7 +220,7 @@ async function getOptions() {
220
220
  const user = await userRepo.findOne({
221
221
  where: { email },
222
222
  relations: ['group', 'group.permissions'],
223
- select: ['id', 'email', 'name', 'password', 'blocked', 'deleted', 'groupId', 'adminAccess'],
223
+ select: ['id', 'email', 'name', 'password', 'blocked', 'inviteStatus', 'deleted', 'groupId', 'adminAccess'],
224
224
  });
225
225
  return enrichUserWithVendorContext(dataSource, user as any);
226
226
  },
@@ -259,7 +259,7 @@ async function getOptions() {
259
259
  const user = await userRepo.findOne({
260
260
  where: { email },
261
261
  relations: ['group', 'group.permissions'],
262
- select: ['id', 'email', 'name', 'password', 'blocked', 'deleted', 'groupId', 'adminAccess'],
262
+ select: ['id', 'email', 'name', 'password', 'blocked', 'inviteStatus', 'deleted', 'groupId', 'adminAccess'],
263
263
  });
264
264
  return enrichUserWithVendorContext(dataSource, user as any);
265
265
  },
@@ -340,8 +340,13 @@ export async function middleware(request: NextRequest) {
340
340
  return NextResponse.next();
341
341
  }
342
342
 
343
+ /**
344
+ * Next.js matchers do not support lookaheads, so /api/:path* cannot reliably
345
+ * exclude /api/upload. Matching only /admin avoids buffering large multipart
346
+ * bodies (videos) which breaks req.formData(). API auth still runs in handlers.
347
+ */
343
348
  export const config = {
344
- matcher: ['/admin/:path*', '/api/:path*'],
349
+ matcher: ['/admin/:path*'],
345
350
  };
346
351
  `,
347
352
  "src/app/providers.tsx": `"use client";
@@ -353,7 +358,7 @@ import { Toaster } from "sonner";
353
358
  export function Providers({ children }: { children: React.ReactNode }) {
354
359
  return (
355
360
  <SessionProvider>
356
- <ThemeProvider attribute="class" defaultTheme="system" enableSystem>
361
+ <ThemeProvider attribute="class" defaultTheme="light" forcedTheme="light" enableSystem={false} enableColorScheme>
357
362
  {children}
358
363
  <Toaster position="top-right" />
359
364
  </ThemeProvider>
package/dist/cli.js CHANGED
@@ -213,7 +213,7 @@ async function getOptions() {
213
213
  const user = await userRepo.findOne({
214
214
  where: { email },
215
215
  relations: ['group', 'group.permissions'],
216
- select: ['id', 'email', 'name', 'password', 'blocked', 'deleted', 'groupId', 'adminAccess'],
216
+ select: ['id', 'email', 'name', 'password', 'blocked', 'inviteStatus', 'deleted', 'groupId', 'adminAccess'],
217
217
  });
218
218
  return enrichUserWithVendorContext(dataSource, user as any);
219
219
  },
@@ -252,7 +252,7 @@ async function getOptions() {
252
252
  const user = await userRepo.findOne({
253
253
  where: { email },
254
254
  relations: ['group', 'group.permissions'],
255
- select: ['id', 'email', 'name', 'password', 'blocked', 'deleted', 'groupId', 'adminAccess'],
255
+ select: ['id', 'email', 'name', 'password', 'blocked', 'inviteStatus', 'deleted', 'groupId', 'adminAccess'],
256
256
  });
257
257
  return enrichUserWithVendorContext(dataSource, user as any);
258
258
  },
@@ -333,8 +333,13 @@ export async function middleware(request: NextRequest) {
333
333
  return NextResponse.next();
334
334
  }
335
335
 
336
+ /**
337
+ * Next.js matchers do not support lookaheads, so /api/:path* cannot reliably
338
+ * exclude /api/upload. Matching only /admin avoids buffering large multipart
339
+ * bodies (videos) which breaks req.formData(). API auth still runs in handlers.
340
+ */
336
341
  export const config = {
337
- matcher: ['/admin/:path*', '/api/:path*'],
342
+ matcher: ['/admin/:path*'],
338
343
  };
339
344
  `,
340
345
  "src/app/providers.tsx": `"use client";
@@ -346,7 +351,7 @@ import { Toaster } from "sonner";
346
351
  export function Providers({ children }: { children: React.ReactNode }) {
347
352
  return (
348
353
  <SessionProvider>
349
- <ThemeProvider attribute="class" defaultTheme="system" enableSystem>
354
+ <ThemeProvider attribute="class" defaultTheme="light" forcedTheme="light" enableSystem={false} enableColorScheme>
350
355
  {children}
351
356
  <Toaster position="top-right" />
352
357
  </ThemeProvider>
@@ -1,23 +1,25 @@
1
1
  'use strict';
2
2
 
3
- var chunkXW5ATPRW_cjs = require('./chunk-XW5ATPRW.cjs');
3
+ var chunkV25RDUOU_cjs = require('./chunk-V25RDUOU.cjs');
4
+ require('./chunk-BXYZDMTZ.cjs');
5
+ require('./chunk-UPLVMVRX.cjs');
4
6
  require('./chunk-USNT2KNT.cjs');
5
7
 
6
8
 
7
9
 
8
10
  Object.defineProperty(exports, "queueEmail", {
9
11
  enumerable: true,
10
- get: function () { return chunkXW5ATPRW_cjs.queueEmail; }
12
+ get: function () { return chunkV25RDUOU_cjs.queueEmail; }
11
13
  });
12
14
  Object.defineProperty(exports, "queueOrderPlacedEmails", {
13
15
  enumerable: true,
14
- get: function () { return chunkXW5ATPRW_cjs.queueOrderPlacedEmails; }
16
+ get: function () { return chunkV25RDUOU_cjs.queueOrderPlacedEmails; }
15
17
  });
16
18
  Object.defineProperty(exports, "queueVendorOnboardEmails", {
17
19
  enumerable: true,
18
- get: function () { return chunkXW5ATPRW_cjs.queueVendorOnboardEmails; }
20
+ get: function () { return chunkV25RDUOU_cjs.queueVendorOnboardEmails; }
19
21
  });
20
22
  Object.defineProperty(exports, "registerEmailQueueProcessor", {
21
23
  enumerable: true,
22
- get: function () { return chunkXW5ATPRW_cjs.registerEmailQueueProcessor; }
24
+ get: function () { return chunkV25RDUOU_cjs.registerEmailQueueProcessor; }
23
25
  });
@@ -0,0 +1,4 @@
1
+ export { queueEmail, queueOrderPlacedEmails, queueVendorOnboardEmails, registerEmailQueueProcessor } from './chunk-L3525VXI.js';
2
+ import './chunk-2KUCQVAQ.js';
3
+ import './chunk-JC6DLWTE.js';
4
+ import './chunk-SHUYVCID.js';
@@ -1,3 +1,3 @@
1
- export { emitOrderNotificationTrigger, fireOrderNotificationTrigger } from './chunk-X47PBV4I.js';
1
+ export { emitOrderNotificationTrigger, fireOrderNotificationTrigger } from './chunk-JE22VP6S.js';
2
2
  import './chunk-HCIRL37O.js';
3
3
  import './chunk-SHUYVCID.js';
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkHT5DI3XW_cjs = require('./chunk-HT5DI3XW.cjs');
3
+ var chunkKOTXDSQB_cjs = require('./chunk-KOTXDSQB.cjs');
4
4
  require('./chunk-UCKN4BBY.cjs');
5
5
  require('./chunk-USNT2KNT.cjs');
6
6
 
@@ -8,9 +8,9 @@ require('./chunk-USNT2KNT.cjs');
8
8
 
9
9
  Object.defineProperty(exports, "emitOrderNotificationTrigger", {
10
10
  enumerable: true,
11
- get: function () { return chunkHT5DI3XW_cjs.emitOrderNotificationTrigger; }
11
+ get: function () { return chunkKOTXDSQB_cjs.emitOrderNotificationTrigger; }
12
12
  });
13
13
  Object.defineProperty(exports, "fireOrderNotificationTrigger", {
14
14
  enumerable: true,
15
- get: function () { return chunkHT5DI3XW_cjs.fireOrderNotificationTrigger; }
15
+ get: function () { return chunkKOTXDSQB_cjs.fireOrderNotificationTrigger; }
16
16
  });
@@ -0,0 +1,3 @@
1
+ export { ORDER_INVOICE_EMAIL_ELIGIBLE_STATUSES, isOrderEligibleForInvoiceEmail, resolveOrderInvoicePdfBytes, streamOrderInvoicePdf } from './chunk-2KUCQVAQ.js';
2
+ import './chunk-JC6DLWTE.js';
3
+ import './chunk-SHUYVCID.js';
@@ -0,0 +1,24 @@
1
+ 'use strict';
2
+
3
+ var chunkBXYZDMTZ_cjs = require('./chunk-BXYZDMTZ.cjs');
4
+ require('./chunk-UPLVMVRX.cjs');
5
+ require('./chunk-USNT2KNT.cjs');
6
+
7
+
8
+
9
+ Object.defineProperty(exports, "ORDER_INVOICE_EMAIL_ELIGIBLE_STATUSES", {
10
+ enumerable: true,
11
+ get: function () { return chunkBXYZDMTZ_cjs.ORDER_INVOICE_EMAIL_ELIGIBLE_STATUSES; }
12
+ });
13
+ Object.defineProperty(exports, "isOrderEligibleForInvoiceEmail", {
14
+ enumerable: true,
15
+ get: function () { return chunkBXYZDMTZ_cjs.isOrderEligibleForInvoiceEmail; }
16
+ });
17
+ Object.defineProperty(exports, "resolveOrderInvoicePdfBytes", {
18
+ enumerable: true,
19
+ get: function () { return chunkBXYZDMTZ_cjs.resolveOrderInvoicePdfBytes; }
20
+ });
21
+ Object.defineProperty(exports, "streamOrderInvoicePdf", {
22
+ enumerable: true,
23
+ get: function () { return chunkBXYZDMTZ_cjs.streamOrderInvoicePdf; }
24
+ });
@@ -1,39 +1,39 @@
1
1
  'use strict';
2
2
 
3
- var chunkSPQFNIYJ_cjs = require('./chunk-SPQFNIYJ.cjs');
3
+ var chunk4PMK3RNA_cjs = require('./chunk-4PMK3RNA.cjs');
4
4
  require('./chunk-USNT2KNT.cjs');
5
5
 
6
6
 
7
7
 
8
8
  Object.defineProperty(exports, "EVENT_ORDER_MESSAGE_TEMPLATE_DEFAULTS", {
9
9
  enumerable: true,
10
- get: function () { return chunkSPQFNIYJ_cjs.EVENT_ORDER_MESSAGE_TEMPLATE_DEFAULTS; }
10
+ get: function () { return chunk4PMK3RNA_cjs.EVENT_ORDER_MESSAGE_TEMPLATE_DEFAULTS; }
11
11
  });
12
12
  Object.defineProperty(exports, "EVENT_ORDER_TEMPLATE_KEY", {
13
13
  enumerable: true,
14
- get: function () { return chunkSPQFNIYJ_cjs.EVENT_ORDER_TEMPLATE_KEY; }
14
+ get: function () { return chunk4PMK3RNA_cjs.EVENT_ORDER_TEMPLATE_KEY; }
15
15
  });
16
16
  Object.defineProperty(exports, "EVENT_ORDER_TEMPLATE_VARIABLES", {
17
17
  enumerable: true,
18
- get: function () { return chunkSPQFNIYJ_cjs.EVENT_ORDER_TEMPLATE_VARIABLES; }
18
+ get: function () { return chunk4PMK3RNA_cjs.EVENT_ORDER_TEMPLATE_VARIABLES; }
19
19
  });
20
20
  Object.defineProperty(exports, "EVENT_ORDER_TEMPLATE_VARIABLE_HINTS", {
21
21
  enumerable: true,
22
- get: function () { return chunkSPQFNIYJ_cjs.EVENT_ORDER_TEMPLATE_VARIABLE_HINTS; }
22
+ get: function () { return chunk4PMK3RNA_cjs.EVENT_ORDER_TEMPLATE_VARIABLE_HINTS; }
23
23
  });
24
24
  Object.defineProperty(exports, "EVENT_ORDER_WHATSAPP_PARAM_KEYS", {
25
25
  enumerable: true,
26
- get: function () { return chunkSPQFNIYJ_cjs.EVENT_ORDER_WHATSAPP_PARAM_KEYS; }
26
+ get: function () { return chunk4PMK3RNA_cjs.EVENT_ORDER_WHATSAPP_PARAM_KEYS; }
27
27
  });
28
28
  Object.defineProperty(exports, "getEventOrderTemplateDefault", {
29
29
  enumerable: true,
30
- get: function () { return chunkSPQFNIYJ_cjs.getEventOrderTemplateDefault; }
30
+ get: function () { return chunk4PMK3RNA_cjs.getEventOrderTemplateDefault; }
31
31
  });
32
32
  Object.defineProperty(exports, "pickWhatsAppTemplateParams", {
33
33
  enumerable: true,
34
- get: function () { return chunkSPQFNIYJ_cjs.pickWhatsAppTemplateParams; }
34
+ get: function () { return chunk4PMK3RNA_cjs.pickWhatsAppTemplateParams; }
35
35
  });
36
36
  Object.defineProperty(exports, "resolveEventOrderTemplate", {
37
37
  enumerable: true,
38
- get: function () { return chunkSPQFNIYJ_cjs.resolveEventOrderTemplate; }
38
+ get: function () { return chunk4PMK3RNA_cjs.resolveEventOrderTemplate; }
39
39
  });
@@ -1,2 +1,2 @@
1
- export { EVENT_ORDER_MESSAGE_TEMPLATE_DEFAULTS, EVENT_ORDER_TEMPLATE_KEY, EVENT_ORDER_TEMPLATE_VARIABLES, EVENT_ORDER_TEMPLATE_VARIABLE_HINTS, EVENT_ORDER_WHATSAPP_PARAM_KEYS, getEventOrderTemplateDefault, pickWhatsAppTemplateParams, resolveEventOrderTemplate } from './chunk-KFFB6EMZ.js';
1
+ export { EVENT_ORDER_MESSAGE_TEMPLATE_DEFAULTS, EVENT_ORDER_TEMPLATE_KEY, EVENT_ORDER_TEMPLATE_VARIABLES, EVENT_ORDER_TEMPLATE_VARIABLE_HINTS, EVENT_ORDER_WHATSAPP_PARAM_KEYS, getEventOrderTemplateDefault, pickWhatsAppTemplateParams, resolveEventOrderTemplate } from './chunk-2HU5R2JE.js';
2
2
  import './chunk-SHUYVCID.js';
package/dist/hooks.cjs CHANGED
@@ -1,5 +1,6 @@
1
1
  'use strict';
2
2
 
3
+ var chunk2IAXTKQN_cjs = require('./chunk-2IAXTKQN.cjs');
3
4
  var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
4
5
  var React2 = require('react');
5
6
 
@@ -364,13 +365,55 @@ function useCaptchaPayload() {
364
365
  ]);
365
366
  }
366
367
  chunkUSNT2KNT_cjs.__name(useCaptchaPayload, "useCaptchaPayload");
368
+ function useForceLightMode() {
369
+ React2.useEffect(() => {
370
+ if (typeof window === "undefined") return;
371
+ const root = document.documentElement;
372
+ const body = document.body;
373
+ const applyLight = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name(() => {
374
+ if (root.classList.contains("dark")) root.classList.remove("dark");
375
+ if (body && body.classList.contains("dark")) body.classList.remove("dark");
376
+ if (root.style.colorScheme !== "light") root.style.colorScheme = "light";
377
+ if (body && body.style.colorScheme !== "light") body.style.colorScheme = "light";
378
+ }, "applyLight");
379
+ applyLight();
380
+ const observer = new MutationObserver(() => {
381
+ applyLight();
382
+ });
383
+ observer.observe(root, {
384
+ attributes: true,
385
+ attributeFilter: [
386
+ "class",
387
+ "style"
388
+ ]
389
+ });
390
+ if (body) {
391
+ observer.observe(body, {
392
+ attributes: true,
393
+ attributeFilter: [
394
+ "class",
395
+ "style"
396
+ ]
397
+ });
398
+ }
399
+ return () => {
400
+ observer.disconnect();
401
+ };
402
+ }, []);
403
+ }
404
+ chunkUSNT2KNT_cjs.__name(useForceLightMode, "useForceLightMode");
367
405
 
406
+ Object.defineProperty(exports, "ForceLightMode", {
407
+ enumerable: true,
408
+ get: function () { return chunk2IAXTKQN_cjs.ForceLightMode; }
409
+ });
368
410
  exports.CaptchaProvider = CaptchaProvider;
369
411
  exports.PluginProvider = PluginProvider;
370
412
  exports.useAnalytics = useAnalytics;
371
413
  exports.useCaptchaPayload = useCaptchaPayload;
372
414
  exports.useCatalogCategories = useCatalogCategories;
373
415
  exports.useCatalogCollections = useCatalogCollections;
416
+ exports.useForceLightMode = useForceLightMode;
374
417
  exports.useIsMobile = useIsMobile;
375
418
  exports.usePlugin = usePlugin;
376
419
  exports.vendorCategoryWorkspaceUrl = vendorCategoryWorkspaceUrl;
package/dist/hooks.d.cts CHANGED
@@ -83,4 +83,13 @@ declare function CaptchaProvider({ children }: {
83
83
  /** Returns a function that resolves to captcha fields for JSON bodies, or {} if disabled / not ready. */
84
84
  declare function useCaptchaPayload(): () => Promise<Record<string, string>>;
85
85
 
86
- export { CaptchaProvider, type CatalogCategory, type CatalogCollection, PluginProvider, useAnalytics, useCaptchaPayload, useCatalogCategories, useCatalogCollections, useIsMobile, usePlugin, vendorCategoryWorkspaceUrl, vendorCollectionCreateUrl, vendorCollectionProductsUrl, vendorEventProductCreateUrl, vendorProductCreateUrl };
86
+ /** Component wrapper that forces light mode */
87
+ declare function ForceLightMode(): React.ReactElement;
88
+
89
+ /**
90
+ * Universally enforce light mode across all websites and admin panels using webcore.
91
+ * Removes `dark` class from <html> and <body> and continuously blocks system/app dark mode.
92
+ */
93
+ declare function useForceLightMode(): void;
94
+
95
+ export { CaptchaProvider, type CatalogCategory, type CatalogCollection, ForceLightMode, PluginProvider, useAnalytics, useCaptchaPayload, useCatalogCategories, useCatalogCollections, useForceLightMode, useIsMobile, usePlugin, vendorCategoryWorkspaceUrl, vendorCollectionCreateUrl, vendorCollectionProductsUrl, vendorEventProductCreateUrl, vendorProductCreateUrl };
package/dist/hooks.d.ts CHANGED
@@ -83,4 +83,13 @@ declare function CaptchaProvider({ children }: {
83
83
  /** Returns a function that resolves to captcha fields for JSON bodies, or {} if disabled / not ready. */
84
84
  declare function useCaptchaPayload(): () => Promise<Record<string, string>>;
85
85
 
86
- export { CaptchaProvider, type CatalogCategory, type CatalogCollection, PluginProvider, useAnalytics, useCaptchaPayload, useCatalogCategories, useCatalogCollections, useIsMobile, usePlugin, vendorCategoryWorkspaceUrl, vendorCollectionCreateUrl, vendorCollectionProductsUrl, vendorEventProductCreateUrl, vendorProductCreateUrl };
86
+ /** Component wrapper that forces light mode */
87
+ declare function ForceLightMode(): React.ReactElement;
88
+
89
+ /**
90
+ * Universally enforce light mode across all websites and admin panels using webcore.
91
+ * Removes `dark` class from <html> and <body> and continuously blocks system/app dark mode.
92
+ */
93
+ declare function useForceLightMode(): void;
94
+
95
+ export { CaptchaProvider, type CatalogCategory, type CatalogCollection, ForceLightMode, PluginProvider, useAnalytics, useCaptchaPayload, useCatalogCategories, useCatalogCollections, useForceLightMode, useIsMobile, usePlugin, vendorCategoryWorkspaceUrl, vendorCollectionCreateUrl, vendorCollectionProductsUrl, vendorEventProductCreateUrl, vendorProductCreateUrl };
package/dist/hooks.js CHANGED
@@ -1,3 +1,4 @@
1
+ export { ForceLightMode } from './chunk-EIZKW2PF.js';
1
2
  import { __name } from './chunk-SHUYVCID.js';
2
3
  import React2, { createContext, useState, useEffect, useContext, useRef, useCallback, useMemo } from 'react';
3
4
 
@@ -358,5 +359,42 @@ function useCaptchaPayload() {
358
359
  ]);
359
360
  }
360
361
  __name(useCaptchaPayload, "useCaptchaPayload");
362
+ function useForceLightMode() {
363
+ useEffect(() => {
364
+ if (typeof window === "undefined") return;
365
+ const root = document.documentElement;
366
+ const body = document.body;
367
+ const applyLight = /* @__PURE__ */ __name(() => {
368
+ if (root.classList.contains("dark")) root.classList.remove("dark");
369
+ if (body && body.classList.contains("dark")) body.classList.remove("dark");
370
+ if (root.style.colorScheme !== "light") root.style.colorScheme = "light";
371
+ if (body && body.style.colorScheme !== "light") body.style.colorScheme = "light";
372
+ }, "applyLight");
373
+ applyLight();
374
+ const observer = new MutationObserver(() => {
375
+ applyLight();
376
+ });
377
+ observer.observe(root, {
378
+ attributes: true,
379
+ attributeFilter: [
380
+ "class",
381
+ "style"
382
+ ]
383
+ });
384
+ if (body) {
385
+ observer.observe(body, {
386
+ attributes: true,
387
+ attributeFilter: [
388
+ "class",
389
+ "style"
390
+ ]
391
+ });
392
+ }
393
+ return () => {
394
+ observer.disconnect();
395
+ };
396
+ }, []);
397
+ }
398
+ __name(useForceLightMode, "useForceLightMode");
361
399
 
362
- export { CaptchaProvider, PluginProvider, useAnalytics, useCaptchaPayload, useCatalogCategories, useCatalogCollections, useIsMobile, usePlugin, vendorCategoryWorkspaceUrl, vendorCollectionCreateUrl, vendorCollectionProductsUrl, vendorEventProductCreateUrl, vendorProductCreateUrl };
400
+ export { CaptchaProvider, PluginProvider, useAnalytics, useCaptchaPayload, useCatalogCategories, useCatalogCollections, useForceLightMode, useIsMobile, usePlugin, vendorCategoryWorkspaceUrl, vendorCollectionCreateUrl, vendorCollectionProductsUrl, vendorEventProductCreateUrl, vendorProductCreateUrl };