@mercurjs/dashboard-shared 2.2.0-canary.35 → 2.2.0-canary.37

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 (2) hide show
  1. package/dist/index.js +13 -4
  2. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -10013,6 +10013,17 @@ var REFERENCE_FIELDS = [
10013
10013
  "categories",
10014
10014
  "tags"
10015
10015
  ];
10016
+ var PRODUCT_FIELD_ORDER = {
10017
+ categories: 1,
10018
+ collection_id: 2,
10019
+ tags: 3,
10020
+ type_id: 4
10021
+ };
10022
+ var sortProductFieldDiffs = (diffs) => diffs.map((diff, index) => ({ diff, index })).sort((a, b) => {
10023
+ const weightA = PRODUCT_FIELD_ORDER[a.diff.field] ?? 0;
10024
+ const weightB = PRODUCT_FIELD_ORDER[b.diff.field] ?? 0;
10025
+ return weightA !== weightB ? weightA - weightB : a.index - b.index;
10026
+ }).map(({ diff }) => diff);
10016
10027
  var isReferenceField = (field) => REFERENCE_FIELDS.includes(field);
10017
10028
  var NON_EDITABLE_VARIANT_FIELDS = /* @__PURE__ */ new Set(["manage_inventory"]);
10018
10029
  var MEDIA_FIELD = "images";
@@ -10233,7 +10244,7 @@ var buildProductChangeView = (actions) => {
10233
10244
  (g) => g.fieldDiffs.length > 0 || hasMedia(g.media)
10234
10245
  );
10235
10246
  return {
10236
- productUpdated,
10247
+ productUpdated: sortProductFieldDiffs(productUpdated),
10237
10248
  productMedia,
10238
10249
  attributes,
10239
10250
  variantsAdded,
@@ -13975,9 +13986,7 @@ var ProductChangePanel = ({
13975
13986
  });
13976
13987
  const fieldLabel = (field) => {
13977
13988
  if (field === "categories") {
13978
- return t2("fields.secondary_categories", {
13979
- defaultValue: "Secondary categories"
13980
- });
13989
+ return t2("fields.category");
13981
13990
  }
13982
13991
  return t2(`fields.${field}`, { defaultValue: humanizeFieldName(field) });
13983
13992
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mercurjs/dashboard-shared",
3
- "version": "2.2.0-canary.35",
3
+ "version": "2.2.0-canary.37",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/mercurjs/mercur",
@@ -23,7 +23,7 @@
23
23
  "build": "tsup"
24
24
  },
25
25
  "dependencies": {
26
- "@mercurjs/client": "2.2.0-canary.35",
26
+ "@mercurjs/client": "2.2.0-canary.37",
27
27
  "@ariakit/react": "^0.4.15",
28
28
  "@babel/runtime": "^7.26.10",
29
29
  "@dnd-kit/core": "^6.1.0",
@@ -63,9 +63,9 @@
63
63
  "zod": "3.25.76"
64
64
  },
65
65
  "devDependencies": {
66
- "@mercurjs/types": "2.2.0-canary.35",
67
- "@mercurjs/core": "2.2.0-canary.35",
68
- "@mercurjs/dashboard-sdk": "2.2.0-canary.35",
66
+ "@mercurjs/types": "2.2.0-canary.37",
67
+ "@mercurjs/core": "2.2.0-canary.37",
68
+ "@mercurjs/dashboard-sdk": "2.2.0-canary.37",
69
69
  "tsup": "^8.0.2",
70
70
  "typescript": "5.9.3",
71
71
  "@types/lodash.debounce": "^4.0.8",