@medusajs/dashboard 2.12.2-snapshot-20251207203158 → 2.12.2-snapshot-20251208134209

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/app.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  DashboardApp
3
- } from "./chunk-7HL4FXK7.mjs";
3
+ } from "./chunk-SVJZUHGT.mjs";
4
4
  import "./chunk-2SSUH2HJ.mjs";
5
5
  import "./chunk-ONB3JEHR.mjs";
6
6
  import "./chunk-YCDDT44O.mjs";
@@ -92440,6 +92440,7 @@ var UserSection2 = () => {
92440
92440
  // src/components/utilities/error-boundary/error-boundary.tsx
92441
92441
  import { ExclamationCircle } from "@medusajs/icons";
92442
92442
  import { Text as Text7 } from "@medusajs/ui";
92443
+ import { useEffect as useEffect12 } from "react";
92443
92444
  import { useTranslation as useTranslation11 } from "react-i18next";
92444
92445
  import { Navigate as Navigate2, useLocation as useLocation8, useRouteError } from "react-router-dom";
92445
92446
  import { jsx as jsx16, jsxs as jsxs10 } from "react/jsx-runtime";
@@ -92448,6 +92449,34 @@ var ErrorBoundary = () => {
92448
92449
  const location = useLocation8();
92449
92450
  const { t: t2 } = useTranslation11();
92450
92451
  let code = null;
92452
+ useEffect12(() => {
92453
+ if (error) {
92454
+ let filename;
92455
+ let lineno;
92456
+ let colno;
92457
+ if (error instanceof Error && error.stack) {
92458
+ const match = error.stack.match(
92459
+ /at\s+(?:\S+\s+\()?(https?:\/\/[^)]+):(\d+):(\d+)/
92460
+ );
92461
+ if (match) {
92462
+ filename = match[1];
92463
+ lineno = parseInt(match[2], 10);
92464
+ colno = parseInt(match[3], 10);
92465
+ }
92466
+ }
92467
+ const errorPayload = {
92468
+ type: "ADMIN_ROUTE_ERROR",
92469
+ payload: {
92470
+ message: error instanceof Error ? error.message : String(error),
92471
+ filename,
92472
+ lineno,
92473
+ colno,
92474
+ stack: error instanceof Error ? error.stack : void 0
92475
+ }
92476
+ };
92477
+ window.parent.postMessage(errorPayload, "*");
92478
+ }
92479
+ }, [error]);
92451
92480
  if (isFetchError(error)) {
92452
92481
  if (error.status === 401) {
92453
92482
  return /* @__PURE__ */ jsx16(Navigate2, { to: "/login", state: { from: location }, replace: true });
@@ -92477,21 +92506,6 @@ var ErrorBoundary = () => {
92477
92506
  message = t2("errorBoundary.defaultMessage");
92478
92507
  break;
92479
92508
  }
92480
- if (window !== window.parent) {
92481
- window.addEventListener("error", (event) => {
92482
- const errorPayload = {
92483
- type: "ADMIN_RUNTIME_ERROR",
92484
- payload: {
92485
- message: event.message,
92486
- filename: event.filename,
92487
- lineno: event.lineno,
92488
- colno: event.colno,
92489
- stack: event.error && event.error.stack
92490
- }
92491
- };
92492
- window.parent.postMessage(errorPayload, "*");
92493
- });
92494
- }
92495
92509
  return /* @__PURE__ */ jsx16("div", { className: "flex size-full min-h-[calc(100vh-57px-24px)] items-center justify-center", children: /* @__PURE__ */ jsx16("div", { className: "flex flex-col gap-y-6", children: /* @__PURE__ */ jsxs10("div", { className: "text-ui-fg-subtle flex flex-col items-center gap-y-3", children: [
92496
92510
  /* @__PURE__ */ jsx16(ExclamationCircle, {}),
92497
92511
  /* @__PURE__ */ jsxs10("div", { className: "flex flex-col items-center justify-center gap-y-1", children: [
@@ -92540,7 +92554,7 @@ function getRouteMap({
92540
92554
  children: [
92541
92555
  {
92542
92556
  path: "create",
92543
- lazy: () => import("./product-create-IJXK2CPJ.mjs")
92557
+ lazy: () => import("./product-create-4EPPP2EJ.mjs")
92544
92558
  },
92545
92559
  {
92546
92560
  path: "import",
@@ -92556,7 +92570,7 @@ function getRouteMap({
92556
92570
  path: ":id",
92557
92571
  errorElement: /* @__PURE__ */ jsx17(ErrorBoundary, {}),
92558
92572
  lazy: async () => {
92559
- const { Breadcrumb, loader } = await import("./product-detail-3QA6OXHI.mjs");
92573
+ const { Breadcrumb, loader } = await import("./product-detail-SUWEBER4.mjs");
92560
92574
  return {
92561
92575
  Component: Outlet4,
92562
92576
  loader,
@@ -92568,11 +92582,11 @@ function getRouteMap({
92568
92582
  children: [
92569
92583
  {
92570
92584
  path: "",
92571
- lazy: () => import("./product-detail-3QA6OXHI.mjs"),
92585
+ lazy: () => import("./product-detail-SUWEBER4.mjs"),
92572
92586
  children: [
92573
92587
  {
92574
92588
  path: "edit",
92575
- lazy: () => import("./product-edit-WPVM44C2.mjs")
92589
+ lazy: () => import("./product-edit-WMA4R3RV.mjs")
92576
92590
  },
92577
92591
  {
92578
92592
  path: "edit-variant",
@@ -92584,11 +92598,11 @@ function getRouteMap({
92584
92598
  },
92585
92599
  {
92586
92600
  path: "attributes",
92587
- lazy: () => import("./product-attributes-W6URSOII.mjs")
92601
+ lazy: () => import("./product-attributes-QTM5XG44.mjs")
92588
92602
  },
92589
92603
  {
92590
92604
  path: "organization",
92591
- lazy: () => import("./product-organization-QG53UJ2J.mjs")
92605
+ lazy: () => import("./product-organization-SA6DTKLT.mjs")
92592
92606
  },
92593
92607
  {
92594
92608
  path: "shipping-profile",
@@ -13,7 +13,7 @@ import {
13
13
  import {
14
14
  FormExtensionZone,
15
15
  useExtendableForm
16
- } from "./chunk-7HL4FXK7.mjs";
16
+ } from "./chunk-SVJZUHGT.mjs";
17
17
  import "./chunk-2SSUH2HJ.mjs";
18
18
  import "./chunk-ONB3JEHR.mjs";
19
19
  import "./chunk-YCDDT44O.mjs";
@@ -61,7 +61,7 @@ import {
61
61
  import {
62
62
  FormExtensionZone,
63
63
  useExtendableForm
64
- } from "./chunk-7HL4FXK7.mjs";
64
+ } from "./chunk-SVJZUHGT.mjs";
65
65
  import "./chunk-2SSUH2HJ.mjs";
66
66
  import "./chunk-ONB3JEHR.mjs";
67
67
  import "./chunk-YCDDT44O.mjs";
@@ -27,7 +27,7 @@ import {
27
27
  import "./chunk-DZWH2RV6.mjs";
28
28
  import {
29
29
  getLinkedFields
30
- } from "./chunk-7HL4FXK7.mjs";
30
+ } from "./chunk-SVJZUHGT.mjs";
31
31
  import "./chunk-2SSUH2HJ.mjs";
32
32
  import "./chunk-ONB3JEHR.mjs";
33
33
  import "./chunk-YCDDT44O.mjs";
@@ -16,7 +16,7 @@ import {
16
16
  import {
17
17
  FormExtensionZone,
18
18
  useExtendableForm
19
- } from "./chunk-7HL4FXK7.mjs";
19
+ } from "./chunk-SVJZUHGT.mjs";
20
20
  import "./chunk-2SSUH2HJ.mjs";
21
21
  import "./chunk-ONB3JEHR.mjs";
22
22
  import "./chunk-YCDDT44O.mjs";
@@ -18,7 +18,7 @@ import {
18
18
  import {
19
19
  FormExtensionZone,
20
20
  useExtendableForm
21
- } from "./chunk-7HL4FXK7.mjs";
21
+ } from "./chunk-SVJZUHGT.mjs";
22
22
  import "./chunk-2SSUH2HJ.mjs";
23
23
  import "./chunk-ONB3JEHR.mjs";
24
24
  import "./chunk-YCDDT44O.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medusajs/dashboard",
3
- "version": "2.12.2-snapshot-20251207203158",
3
+ "version": "2.12.2-snapshot-20251208134209",
4
4
  "scripts": {
5
5
  "generate:static": "node ./scripts/generate-currencies.js && prettier --write ./src/lib/currencies.ts",
6
6
  "dev": "../../../node_modules/.bin/vite",
@@ -46,10 +46,10 @@
46
46
  "@dnd-kit/utilities": "^3.2.2",
47
47
  "@hookform/error-message": "^2.0.1",
48
48
  "@hookform/resolvers": "3.4.2",
49
- "@medusajs/admin-shared": "2.12.2-snapshot-20251207203158",
50
- "@medusajs/icons": "2.12.2-snapshot-20251207203158",
51
- "@medusajs/js-sdk": "2.12.2-snapshot-20251207203158",
52
- "@medusajs/ui": "4.0.30-snapshot-20251207203158",
49
+ "@medusajs/admin-shared": "2.12.2-snapshot-20251208134209",
50
+ "@medusajs/icons": "2.12.2-snapshot-20251208134209",
51
+ "@medusajs/js-sdk": "2.12.2-snapshot-20251208134209",
52
+ "@medusajs/ui": "4.0.30-snapshot-20251208134209",
53
53
  "@radix-ui/react-dialog": "1.1.4",
54
54
  "@radix-ui/react-dismissable-layer": "1.1.4",
55
55
  "@tanstack/react-query": "5.64.2",
@@ -80,10 +80,10 @@
80
80
  "zod": "3.25.76"
81
81
  },
82
82
  "devDependencies": {
83
- "@medusajs/admin-shared": "2.12.2-snapshot-20251207203158",
84
- "@medusajs/admin-vite-plugin": "2.12.2-snapshot-20251207203158",
85
- "@medusajs/types": "2.12.2-snapshot-20251207203158",
86
- "@medusajs/ui-preset": "2.12.2-snapshot-20251207203158"
83
+ "@medusajs/admin-shared": "2.12.2-snapshot-20251208134209",
84
+ "@medusajs/admin-vite-plugin": "2.12.2-snapshot-20251208134209",
85
+ "@medusajs/types": "2.12.2-snapshot-20251208134209",
86
+ "@medusajs/ui-preset": "2.12.2-snapshot-20251208134209"
87
87
  },
88
88
  "packageManager": "yarn@3.2.1"
89
89
  }
@@ -1,5 +1,6 @@
1
1
  import { ExclamationCircle } from "@medusajs/icons"
2
2
  import { Text } from "@medusajs/ui"
3
+ import { useEffect } from "react"
3
4
  import { useTranslation } from "react-i18next"
4
5
  import { Navigate, useLocation, useRouteError } from "react-router-dom"
5
6
 
@@ -12,6 +13,41 @@ export const ErrorBoundary = () => {
12
13
 
13
14
  let code: number | null = null
14
15
 
16
+ /**
17
+ * Send error to parent frame when running in an iframe.
18
+ */
19
+ useEffect(() => {
20
+ if (error) {
21
+ let filename: string | undefined
22
+ let lineno: number | undefined
23
+ let colno: number | undefined
24
+
25
+ if (error instanceof Error && error.stack) {
26
+ // Parse the first location from the stack trace
27
+ const match = error.stack.match(
28
+ /at\s+(?:\S+\s+\()?(https?:\/\/[^)]+):(\d+):(\d+)/
29
+ )
30
+ if (match) {
31
+ filename = match[1]
32
+ lineno = parseInt(match[2], 10)
33
+ colno = parseInt(match[3], 10)
34
+ }
35
+ }
36
+
37
+ const errorPayload = {
38
+ type: "ADMIN_ROUTE_ERROR",
39
+ payload: {
40
+ message: error instanceof Error ? error.message : String(error),
41
+ filename,
42
+ lineno,
43
+ colno,
44
+ stack: error instanceof Error ? error.stack : undefined,
45
+ },
46
+ }
47
+ window.parent.postMessage(errorPayload, "*")
48
+ }
49
+ }, [error])
50
+
15
51
  if (isFetchError(error)) {
16
52
  if (error.status === 401) {
17
53
  return <Navigate to="/login" state={{ from: location }} replace />
@@ -52,26 +88,6 @@ export const ErrorBoundary = () => {
52
88
  break
53
89
  }
54
90
 
55
- /**
56
- * When admin is running in a sandbox, we need to send the error to the parent frame.
57
- */
58
- if (window !== window.parent) {
59
- window.addEventListener("error", (event) => {
60
- const errorPayload = {
61
- type: "ADMIN_RUNTIME_ERROR",
62
- payload: {
63
- message: event.message,
64
- filename: event.filename,
65
- lineno: event.lineno,
66
- colno: event.colno,
67
- stack: event.error && event.error.stack,
68
- },
69
- }
70
-
71
- window.parent.postMessage(errorPayload, "*")
72
- })
73
- }
74
-
75
91
  return (
76
92
  <div className="flex size-full min-h-[calc(100vh-57px-24px)] items-center justify-center">
77
93
  <div className="flex flex-col gap-y-6">