@mercurjs/vendor 2.2.0-rc.2 → 2.2.0

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 (44) hide show
  1. package/dist/{[id]-MIASQVLP.js → [id]-FOWK6QIJ.js} +1 -1
  2. package/dist/{[id]-3HIZGJWE.js → [id]-H3YKIFO3.js} +2 -2
  3. package/dist/{[id]-ONBG5DZJ.js → [id]-WUXFJPPB.js} +3 -3
  4. package/dist/{add-ZIP3VEAV.js → add-HARVSLKD.js} +4 -3
  5. package/dist/{add-FDIWOFVE.js → add-IEIH4CBT.js} +2 -1
  6. package/dist/{add-promotions-3BALABRA.js → add-promotions-7KCUDY3S.js} +3 -3
  7. package/dist/{allocate-items-5HHGU3XW.js → allocate-items-646J75L2.js} +1 -1
  8. package/dist/{areas-XQE3AYPZ.js → areas-VO7NUUUL.js} +7 -5
  9. package/dist/{chunk-UDPMSL6L.js → chunk-53JNB4BP.js} +1 -1
  10. package/dist/{chunk-XRNDVICA.js → chunk-BNOKKKUU.js} +5 -2
  11. package/dist/{chunk-ASN3XS2R.js → chunk-D6XR2USM.js} +2 -2
  12. package/dist/{chunk-VR7P4DAZ.js → chunk-DSNCEHLY.js} +1 -1
  13. package/dist/{chunk-55TS752B.js → chunk-E73SSHJR.js} +4 -2
  14. package/dist/{chunk-H3PVTKOP.js → chunk-JDMNEMRJ.js} +2 -2
  15. package/dist/{chunk-GGXGKMYK.js → chunk-S5KWI3MM.js} +1 -1
  16. package/dist/{chunk-OATVHDPZ.js → chunk-SCPQYA26.js} +1 -1
  17. package/dist/{chunk-E5VLRRZR.js → chunk-UWU6VSO4.js} +1 -1
  18. package/dist/{chunk-DREOA2LP.js → chunk-X6ZQMFCT.js} +1 -1
  19. package/dist/{chunk-57ZJ6HTU.js → chunk-YXEC5XAV.js} +3 -0
  20. package/dist/{chunk-ESXMD6CR.js → chunk-ZZ4JC4WE.js} +36393 -2091
  21. package/dist/{chunk-RZHVUQ7G.js → chunk-ZZ7T7GN5.js} +1 -1
  22. package/dist/{create-B4VIR7YP.js → create-7VKH255E.js} +7 -5
  23. package/dist/{create-4ZRQVXT5.js → create-DU2V6X5H.js} +2 -2
  24. package/dist/{create-XU35U2HL.js → create-G6VJD52A.js} +4 -4
  25. package/dist/{create-3ZQFAKYR.js → create-Y2FZ4565.js} +14 -13
  26. package/dist/{create-7Z63KA2P.js → create-Z6ZHEAKU.js} +9 -9
  27. package/dist/{edit-ISFEI7YX.js → edit-3AM5DZE7.js} +2 -2
  28. package/dist/{edit-QII5YJ2R.js → edit-3HMTDPZK.js} +3 -3
  29. package/dist/{edit-5XPDTCB5.js → edit-CKO32TA3.js} +3 -3
  30. package/dist/{edit-FF2ZWS6U.js → edit-H5FJ45ZT.js} +5 -5
  31. package/dist/{edit-NTTJKLUI.js → edit-RY35FORN.js} +5 -5
  32. package/dist/index.js +32 -32
  33. package/dist/{login-FK6ATIQV.js → login-VMLJYOCF.js} +1 -1
  34. package/dist/{media-2Z2UIOQU.js → media-ZXUMWWXV.js} +3 -3
  35. package/dist/{offer-create-page-QAHHXLLJ.js → offer-create-page-VHNJL3UO.js} +1 -1
  36. package/dist/pages/index.js +10 -10
  37. package/dist/{price-lists-5CSCTVWN.js → price-lists-5C4MCWWR.js} +2 -2
  38. package/dist/{pricing-NHI4NSLA.js → pricing-OQ4RKZO5.js} +7 -5
  39. package/dist/{products-27ASSSVK.js → products-QIGSKI65.js} +4 -4
  40. package/dist/{promotions-E4Z6APSX.js → promotions-JT5PFYPT.js} +4 -4
  41. package/dist/{register-IKY5DDUR.js → register-S4EBPL7B.js} +3 -1
  42. package/dist/{reset-password-RMKCQLBX.js → reset-password-VTYSKEFH.js} +1 -1
  43. package/dist/{stock-VMND7PJY.js → stock-QOUDJSFO.js} +2 -2
  44. package/package.json +6 -6
@@ -7,7 +7,7 @@ import {
7
7
  } from "./chunk-DSY5PNK6.js";
8
8
  import {
9
9
  getPriceListStatus
10
- } from "./chunk-XRNDVICA.js";
10
+ } from "./chunk-BNOKKKUU.js";
11
11
  import "./chunk-6IJMSVC6.js";
12
12
  import {
13
13
  useProductTableColumns
@@ -6,10 +6,10 @@ import {
6
6
  } from "./chunk-BWGPN6XV.js";
7
7
  import {
8
8
  StatusCell
9
- } from "./chunk-GGXGKMYK.js";
9
+ } from "./chunk-S5KWI3MM.js";
10
10
  import "./chunk-FMFVTERD.js";
11
11
  import "./chunk-DB6ANJBO.js";
12
- import "./chunk-ESXMD6CR.js";
12
+ import "./chunk-ZZ4JC4WE.js";
13
13
  import {
14
14
  TwoColumnPage
15
15
  } from "./chunk-YV6MK4PZ.js";
@@ -7,8 +7,8 @@ import {
7
7
  import {
8
8
  usePromotionTableColumns,
9
9
  usePromotionTableQuery
10
- } from "./chunk-VR7P4DAZ.js";
11
- import "./chunk-GGXGKMYK.js";
10
+ } from "./chunk-DSNCEHLY.js";
11
+ import "./chunk-S5KWI3MM.js";
12
12
  import "./chunk-JHIMVLB2.js";
13
13
  import {
14
14
  usePromotionTableFilters
@@ -19,7 +19,7 @@ import "./chunk-PHOCVOZ5.js";
19
19
  import {
20
20
  currencies
21
21
  } from "./chunk-IQPN4PZJ.js";
22
- import "./chunk-ESXMD6CR.js";
22
+ import "./chunk-ZZ4JC4WE.js";
23
23
  import {
24
24
  TwoColumnPage
25
25
  } from "./chunk-YV6MK4PZ.js";
@@ -2,14 +2,14 @@ import {
2
2
  PriceListCreateProductsSchema,
3
3
  usePriceListCurrencyData,
4
4
  usePriceListGridColumns
5
- } from "./chunk-DREOA2LP.js";
5
+ } from "./chunk-X6ZQMFCT.js";
6
6
  import "./chunk-N335VHD3.js";
7
7
  import "./chunk-EBZ5VZEO.js";
8
8
  import "./chunk-4F5GP7J7.js";
9
9
  import {
10
10
  exctractPricesFromProducts,
11
11
  isProductRow
12
- } from "./chunk-XRNDVICA.js";
12
+ } from "./chunk-BNOKKKUU.js";
13
13
  import "./chunk-6IJMSVC6.js";
14
14
  import "./chunk-7TIZP4YG.js";
15
15
  import "./chunk-GJM5XI3E.js";
@@ -372,6 +372,7 @@ var useColumns = () => {
372
372
  };
373
373
 
374
374
  // src/pages/price-lists/[id]/products/add/price-list-prices-add-form/schema.ts
375
+ import i18n from "i18next";
375
376
  import { z } from "zod";
376
377
  var PriceListPricesAddBaseSchema = z.object({
377
378
  product_ids: z.array(z.object({ id: z.string() })).min(1),
@@ -412,7 +413,7 @@ var PriceListPricesAddSchema = PriceListPricesAddBaseSchema.refine(
412
413
  return false;
413
414
  },
414
415
  {
415
- message: "At least one price must be added.",
416
+ message: i18n.t("validation.atLeastOnePrice"),
416
417
  path: ["products"]
417
418
  }
418
419
  );
@@ -91,6 +91,7 @@ import { useTranslation } from "react-i18next";
91
91
  import { useParams } from "react-router-dom";
92
92
  import { keepPreviousData } from "@tanstack/react-query";
93
93
  import { zodResolver } from "@hookform/resolvers/zod";
94
+ import i18n from "i18next";
94
95
  import * as zod from "zod";
95
96
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
96
97
  var PAGE_SIZE = 20;
@@ -116,7 +117,7 @@ var AttributeValueSchema = zod.object({
116
117
  if (Array.isArray(val)) return val.length > 0;
117
118
  return val.length > 0;
118
119
  },
119
- { message: "Value is required" }
120
+ { message: i18n.t("validation.valueRequired") }
120
121
  )
121
122
  });
122
123
  var AddExistingAttributesSchema = zod.object({
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  usePromotionTableColumns,
3
3
  usePromotionTableQuery
4
- } from "./chunk-VR7P4DAZ.js";
5
- import "./chunk-GGXGKMYK.js";
4
+ } from "./chunk-DSNCEHLY.js";
5
+ import "./chunk-S5KWI3MM.js";
6
6
  import "./chunk-JHIMVLB2.js";
7
7
  import {
8
8
  usePromotionTableFilters
@@ -10,7 +10,7 @@ import {
10
10
  import "./chunk-FMFVTERD.js";
11
11
  import "./chunk-DB6ANJBO.js";
12
12
  import "./chunk-PHOCVOZ5.js";
13
- import "./chunk-ESXMD6CR.js";
13
+ import "./chunk-ZZ4JC4WE.js";
14
14
  import "./chunk-TKGWSUEI.js";
15
15
  import {
16
16
  KeyboundForm
@@ -459,7 +459,7 @@ function OrderAllocateItemsForm({ order }) {
459
459
  });
460
460
  } catch (e) {
461
461
  toast.error(t("general.error"), {
462
- description: e instanceof Error ? e.message : "An unknown error occurred"
462
+ description: e instanceof Error ? e.message : t("general.unknownError")
463
463
  });
464
464
  }
465
465
  });
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  GeoZoneForm
3
- } from "./chunk-55TS752B.js";
3
+ } from "./chunk-E73SSHJR.js";
4
4
  import {
5
5
  GEO_ZONE_STACKED_MODAL_ID
6
6
  } from "./chunk-BCU3FKP2.js";
@@ -40,7 +40,7 @@ import "./chunk-DTGEFKK4.js";
40
40
  import "./chunk-NBMM2TZK.js";
41
41
 
42
42
  // src/pages/settings/locations/[location_id]/fulfillment-set/[fset_id]/service-zone/[zone_id]/areas/index.tsx
43
- import { json, useParams } from "react-router-dom";
43
+ import { useParams } from "react-router-dom";
44
44
 
45
45
  // src/pages/settings/locations/[location_id]/fulfillment-set/[fset_id]/service-zone/[zone_id]/areas/_components/edit-service-zone-areas-form.tsx
46
46
  import { zodResolver } from "@hookform/resolvers/zod";
@@ -129,9 +129,11 @@ var LocationServiceZoneManageAreas = () => {
129
129
  });
130
130
  const zone = stock_location?.fulfillment_sets?.find((f) => f.id === fset_id)?.service_zones.find((z2) => z2.id === zone_id);
131
131
  if (!isPending && !isFetching && !zone) {
132
- throw json(
133
- { message: `Service zone with ID ${zone_id} was not found` },
134
- 404
132
+ throw new Response(
133
+ JSON.stringify({
134
+ message: `Service zone with ID ${zone_id} was not found`
135
+ }),
136
+ { status: 404, headers: { "Content-Type": "application/json" } }
135
137
  );
136
138
  }
137
139
  if (isError) {
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-DSY5PNK6.js";
4
4
  import {
5
5
  getPriceListStatus
6
- } from "./chunk-XRNDVICA.js";
6
+ } from "./chunk-BNOKKKUU.js";
7
7
  import {
8
8
  TextCell,
9
9
  TextHeader
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-SMQT3ZNO.js";
4
4
 
5
5
  // src/pages/price-lists/common/utils.ts
6
- import { json } from "react-router-dom";
6
+ import i18n from "i18next";
7
7
  var getValues = (priceList) => {
8
8
  const startsAt = priceList.starts_at;
9
9
  const endsAt = priceList.ends_at;
@@ -49,7 +49,10 @@ var extractPricesFromVariants = (variantId, variant, regions) => {
49
49
  const extractPriceDetails = (price, priceType, id) => {
50
50
  const currencyCode = priceType === "currency" ? id : regions.find((r) => r.id === id)?.currency_code;
51
51
  if (!currencyCode) {
52
- throw json({ message: "Currency code not found" }, 400);
52
+ throw new Response(
53
+ JSON.stringify({ message: i18n.t("validation.currencyCodeNotFound") }),
54
+ { status: 400, headers: { "Content-Type": "application/json" } }
55
+ );
53
56
  }
54
57
  return {
55
58
  amount: castNumber(price.amount),
@@ -19,13 +19,13 @@ import {
19
19
  } from "./chunk-OVPAOBZB.js";
20
20
  import {
21
21
  UploadMediaFormItem
22
- } from "./chunk-OATVHDPZ.js";
22
+ } from "./chunk-SCPQYA26.js";
23
23
  import {
24
24
  PRODUCT_CREATE_FORM_DEFAULTS,
25
25
  ProductCreateSchema,
26
26
  generateVariantsFromAttributes,
27
27
  normalizeProductFormValues
28
- } from "./chunk-E5VLRRZR.js";
28
+ } from "./chunk-UWU6VSO4.js";
29
29
  import {
30
30
  ChipInput
31
31
  } from "./chunk-KDE4HKH2.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  StatusCell
3
- } from "./chunk-GGXGKMYK.js";
3
+ } from "./chunk-S5KWI3MM.js";
4
4
  import {
5
5
  TextCell,
6
6
  TextHeader
@@ -111,7 +111,6 @@ var Chip = ({ index, className, children }) => {
111
111
  var ChipGroup = Object.assign(Group, { Chip });
112
112
 
113
113
  // src/pages/settings/regions/_common/hooks/use-countries.tsx
114
- import { json } from "react-router-dom";
115
114
  var acceptedOrderKeys = ["name", "code"];
116
115
  var useCountries = ({
117
116
  countries: countries2,
@@ -126,7 +125,10 @@ var useCountries = ({
126
125
  const key = order.replace("-", "");
127
126
  if (!acceptedOrderKeys.includes(key)) {
128
127
  console.log("The key ${key} is not a valid order key");
129
- throw json(`The key ${key} is not a valid order key`, 500);
128
+ throw new Response(
129
+ JSON.stringify(`The key ${key} is not a valid order key`),
130
+ { status: 500, headers: { "Content-Type": "application/json" } }
131
+ );
130
132
  }
131
133
  const sortKey = key === "code" ? "iso_2" : "name";
132
134
  data.sort((a, b) => {
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  PriceListUpdateProductsSchema,
3
3
  usePriceListGridColumns
4
- } from "./chunk-DREOA2LP.js";
4
+ } from "./chunk-X6ZQMFCT.js";
5
5
  import {
6
6
  isProductRow
7
- } from "./chunk-XRNDVICA.js";
7
+ } from "./chunk-BNOKKKUU.js";
8
8
  import {
9
9
  DataGrid
10
10
  } from "./chunk-5FBQOAXU.js";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-DB6ANJBO.js";
4
4
  import {
5
5
  i18n
6
- } from "./chunk-ESXMD6CR.js";
6
+ } from "./chunk-ZZ4JC4WE.js";
7
7
 
8
8
  // src/lib/promotions.ts
9
9
  var promotionStatusMap = {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  FileUpload,
3
3
  formatFileSize
4
- } from "./chunk-E5VLRRZR.js";
4
+ } from "./chunk-UWU6VSO4.js";
5
5
  import {
6
6
  Form
7
7
  } from "./chunk-3QSRE5LS.js";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-AJLGY3LQ.js";
4
4
  import {
5
5
  i18n
6
- } from "./chunk-ESXMD6CR.js";
6
+ } from "./chunk-ZZ4JC4WE.js";
7
7
  import {
8
8
  require_dist
9
9
  } from "./chunk-52KJSIHS.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isProductRow
3
- } from "./chunk-XRNDVICA.js";
3
+ } from "./chunk-BNOKKKUU.js";
4
4
  import {
5
5
  DataGrid,
6
6
  createDataGridHelper,
@@ -148,11 +148,13 @@ var LoginForm = () => {
148
148
  ] }) });
149
149
  };
150
150
  var LoginFooter = () => {
151
+ const { t } = useTranslation();
151
152
  const { feature_flags } = useFeatureFlags();
152
153
  return /* @__PURE__ */ jsxs("div", { className: "mt-auto flex flex-col gap-y-2", children: [
153
154
  /* @__PURE__ */ jsx("span", { className: "text-ui-fg-muted txt-small", children: /* @__PURE__ */ jsx(
154
155
  Trans,
155
156
  {
157
+ t,
156
158
  i18nKey: "login.forgotPassword",
157
159
  components: [
158
160
  /* @__PURE__ */ jsx(
@@ -169,6 +171,7 @@ var LoginFooter = () => {
169
171
  feature_flags?.[import_types.MercurFeatureFlags.SELLER_REGISTRATION] && /* @__PURE__ */ jsx("span", { className: "text-ui-fg-muted txt-small", children: /* @__PURE__ */ jsx(
170
172
  Trans,
171
173
  {
174
+ t,
172
175
  i18nKey: "login.notSellerYet",
173
176
  components: [
174
177
  /* @__PURE__ */ jsx(