@mercurjs/admin 2.0.0-canary.44 → 2.0.0-canary.46

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.
@@ -171,7 +171,7 @@ var Root2 = ({
171
171
  const form = useTabbedForm();
172
172
  const { control, setValue } = form;
173
173
  const variantIdMap = useMemo(() => {
174
- return priceList.prices.reduce(
174
+ return (priceList.prices ?? []).reduce(
175
175
  (acc, curr) => {
176
176
  acc[curr.variant_id] = true;
177
177
  return acc;
@@ -389,13 +389,15 @@ var PriceListPricesAddForm = ({
389
389
  import { jsx as jsx4 } from "react/jsx-runtime";
390
390
  var Root3 = ({ children }) => {
391
391
  const { id } = useParams();
392
- const { price_list, isPending, isError, error } = usePriceList(id);
392
+ const { price_list, isPending, isError, error } = usePriceList(id, {
393
+ fields: "*prices"
394
+ });
393
395
  const currencyData = usePriceListCurrencyData();
394
396
  const ready = currencyData.isReady && !isPending && !!price_list;
395
397
  if (isError) {
396
398
  throw error;
397
399
  }
398
- return /* @__PURE__ */ jsx4(RouteFocusModal, { children: ready && (Children2.count(children) > 0 ? children : /* @__PURE__ */ jsx4(
400
+ return /* @__PURE__ */ jsx4(RouteFocusModal, { prev: "../..", children: ready && (Children2.count(children) > 0 ? children : /* @__PURE__ */ jsx4(
399
401
  PriceListPricesAddForm,
400
402
  {
401
403
  priceList: price_list,
package/dist/index.js CHANGED
@@ -3359,11 +3359,11 @@ function getRouteMap({
3359
3359
  },
3360
3360
  {
3361
3361
  path: "options/create",
3362
- lazy: () => import("./product-create-option-F3VM3YQB.js")
3362
+ lazy: () => import("./product-create-option-AHDAKWNR.js")
3363
3363
  },
3364
3364
  {
3365
3365
  path: "options/:option_id/edit",
3366
- lazy: () => import("./product-edit-option-L6LT4IFK.js")
3366
+ lazy: () => import("./product-edit-option-JEEROY34.js")
3367
3367
  },
3368
3368
  {
3369
3369
  path: "variants/create",
@@ -3514,7 +3514,7 @@ function getRouteMap({
3514
3514
  },
3515
3515
  {
3516
3516
  path: "returns/:return_id/receive",
3517
- lazy: () => import("./order-receive-return-GKMHYD4G.js")
3517
+ lazy: () => import("./order-receive-return-FKL5M2L5.js")
3518
3518
  },
3519
3519
  {
3520
3520
  path: "allocate-items",
@@ -3771,11 +3771,11 @@ function getRouteMap({
3771
3771
  },
3772
3772
  {
3773
3773
  path: "products/add",
3774
- lazy: () => import("./price-list-prices-add-NSAQWBT6.js")
3774
+ lazy: () => import("./price-list-prices-add-33JWTRUE.js")
3775
3775
  },
3776
3776
  {
3777
3777
  path: "products/edit",
3778
- lazy: () => import("./price-list-prices-edit-UOAIOS5X.js")
3778
+ lazy: () => import("./price-list-prices-edit-NDQO4YDD.js")
3779
3779
  }
3780
3780
  ]
3781
3781
  }
@@ -4785,7 +4785,7 @@ function getRouteMap({
4785
4785
  },
4786
4786
  {
4787
4787
  path: "overrides/:tax_rate_id/edit",
4788
- lazy: () => import("./tax-region-tax-override-edit-55ODL7KC.js")
4788
+ lazy: () => import("./tax-region-tax-override-edit-SLTLZFHQ.js")
4789
4789
  },
4790
4790
  {
4791
4791
  path: "tax-rates/create",
@@ -4793,7 +4793,7 @@ function getRouteMap({
4793
4793
  },
4794
4794
  {
4795
4795
  path: "tax-rates/:tax_rate_id/edit",
4796
- lazy: () => import("./tax-region-tax-rate-edit-KJNIQ4FS.js")
4796
+ lazy: () => import("./tax-region-tax-rate-edit-KWGMLHRP.js")
4797
4797
  },
4798
4798
  {
4799
4799
  path: "metadata/edit",
@@ -4824,7 +4824,7 @@ function getRouteMap({
4824
4824
  },
4825
4825
  {
4826
4826
  path: "tax-rates/:tax_rate_id/edit",
4827
- lazy: () => import("./tax-region-tax-rate-edit-KJNIQ4FS.js")
4827
+ lazy: () => import("./tax-region-tax-rate-edit-KWGMLHRP.js")
4828
4828
  },
4829
4829
  {
4830
4830
  path: "overrides/create",
@@ -4832,7 +4832,7 @@ function getRouteMap({
4832
4832
  },
4833
4833
  {
4834
4834
  path: "overrides/:tax_rate_id/edit",
4835
- lazy: () => import("./tax-region-tax-override-edit-55ODL7KC.js")
4835
+ lazy: () => import("./tax-region-tax-override-edit-SLTLZFHQ.js")
4836
4836
  }
4837
4837
  ]
4838
4838
  }
@@ -534,7 +534,7 @@ function OrderReceiveReturn() {
534
534
  })();
535
535
  }, [preview]);
536
536
  const ready = order && orderReturn && preview;
537
- return /* @__PURE__ */ jsxs3(RouteDrawer, { "data-testid": "order-receive-return-drawer", children: [
537
+ return /* @__PURE__ */ jsxs3(RouteDrawer, { prev: "../../..", "data-testid": "order-receive-return-drawer", children: [
538
538
  /* @__PURE__ */ jsx3(RouteDrawer.Header, { "data-testid": "order-receive-return-header", children: /* @__PURE__ */ jsx3(Heading, { "data-testid": "order-receive-return-heading", children: t("orders.returns.receive.title", {
539
539
  returnId: return_id?.slice(-7)
540
540
  }) }) }),
@@ -139,7 +139,7 @@ import "../chunk-F55UXYYA.js";
139
139
  import {
140
140
  PriceListPricesAddPage,
141
141
  PriceListPricesAddSchema
142
- } from "../chunk-GOVOSXUU.js";
142
+ } from "../chunk-7AQGLPV7.js";
143
143
  import {
144
144
  CustomerListPage
145
145
  } from "../chunk-DOMRLXOI.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  PriceListProductsAdd
3
- } from "./chunk-GOVOSXUU.js";
3
+ } from "./chunk-7AQGLPV7.js";
4
4
  import "./chunk-MSFNMGFD.js";
5
5
  import "./chunk-U5MJIHLY.js";
6
6
  import "./chunk-6IJMSVC6.js";
@@ -287,7 +287,9 @@ var PriceListPricesEdit = () => {
287
287
  const { id } = useParams();
288
288
  const [searchParams] = useSearchParams();
289
289
  const ids = searchParams.get("ids[]");
290
- const { price_list, isLoading, isError, error } = usePriceList(id);
290
+ const { price_list, isLoading, isError, error } = usePriceList(id, {
291
+ fields: "*prices"
292
+ });
291
293
  const productIds = ids?.split(",");
292
294
  const {
293
295
  products,
@@ -309,7 +311,7 @@ var PriceListPricesEdit = () => {
309
311
  if (isProductsError) {
310
312
  throw productError;
311
313
  }
312
- return /* @__PURE__ */ jsxs2(RouteFocusModal, { children: [
314
+ return /* @__PURE__ */ jsxs2(RouteFocusModal, { prev: "../..", children: [
313
315
  /* @__PURE__ */ jsx2(RouteFocusModal.Title, { asChild: true, children: /* @__PURE__ */ jsxs2("span", { className: "sr-only", children: [
314
316
  "Edit Prices for ",
315
317
  price_list?.title
@@ -135,7 +135,7 @@ var ProductCreateOption = () => {
135
135
  if (isError) {
136
136
  throw error;
137
137
  }
138
- return /* @__PURE__ */ jsxs2(RouteDrawer, { children: [
138
+ return /* @__PURE__ */ jsxs2(RouteDrawer, { prev: "../..", children: [
139
139
  /* @__PURE__ */ jsx2(RouteDrawer.Header, { children: /* @__PURE__ */ jsx2(Heading, { children: t("products.options.create.header") }) }),
140
140
  !isLoading && product && /* @__PURE__ */ jsx2(CreateProductOptionForm, { product })
141
141
  ] });
@@ -143,7 +143,7 @@ var ProductEditOption = () => {
143
143
  if (isError) {
144
144
  throw error;
145
145
  }
146
- return /* @__PURE__ */ jsxs2(RouteDrawer, { "data-testid": "product-edit-option-drawer", children: [
146
+ return /* @__PURE__ */ jsxs2(RouteDrawer, { prev: "../../..", "data-testid": "product-edit-option-drawer", children: [
147
147
  /* @__PURE__ */ jsx2(RouteDrawer.Header, { "data-testid": "product-edit-option-drawer-header", children: /* @__PURE__ */ jsx2(RouteDrawer.Title, { asChild: true, "data-testid": "product-edit-option-drawer-title", children: /* @__PURE__ */ jsx2(Heading, { "data-testid": "product-edit-option-drawer-title-text", children: t("products.options.edit.header") }) }) }),
148
148
  option && /* @__PURE__ */ jsx2(CreateProductOptionForm, { option })
149
149
  ] });
@@ -666,7 +666,7 @@ var TaxRegionTaxOverrideEdit = () => {
666
666
  if (isError) {
667
667
  throw error;
668
668
  }
669
- return /* @__PURE__ */ jsxs2(RouteDrawer, { children: [
669
+ return /* @__PURE__ */ jsxs2(RouteDrawer, { prev: "../..", children: [
670
670
  /* @__PURE__ */ jsxs2(RouteDrawer.Header, { children: [
671
671
  /* @__PURE__ */ jsx2(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx2(Heading2, { children: t("taxRegions.taxOverrides.edit.header") }) }),
672
672
  /* @__PURE__ */ jsx2(RouteDrawer.Description, { className: "sr-only", children: t("taxRegions.taxOverrides.edit.hint") })
@@ -174,7 +174,7 @@ var TaxRegionEdit = () => {
174
174
  if (isError) {
175
175
  throw error;
176
176
  }
177
- return /* @__PURE__ */ jsxs2(RouteDrawer, { children: [
177
+ return /* @__PURE__ */ jsxs2(RouteDrawer, { prev: "../..", children: [
178
178
  /* @__PURE__ */ jsxs2(RouteDrawer.Header, { children: [
179
179
  /* @__PURE__ */ jsx2(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx2(Heading, { children: t("taxRegions.taxRates.edit.header") }) }),
180
180
  /* @__PURE__ */ jsx2(RouteDrawer.Description, { className: "sr-only", children: t("taxRegions.taxRates.edit.hint") })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mercurjs/admin",
3
- "version": "2.0.0-canary.44",
3
+ "version": "2.0.0-canary.46",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/mercurjs/mercur",