@mercurjs/dashboard-shared 2.3.3 → 2.3.4-canary.1

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 +1 -13
  2. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -22707,19 +22707,7 @@ var EditCatalogAttributeForm = ({
22707
22707
  const scalarValue = attribute.type === import_types3.AttributeType.TOGGLE ? vals[0] === "true" : vals[0];
22708
22708
  if (hasPresetValues) {
22709
22709
  const selectedIds = (attribute.all_values ?? []).filter((v) => vals.includes(v.name)).map((v) => v.id);
22710
- if (!isAttached) {
22711
- payload = { add: [{ id: attribute.id, value_ids: selectedIds }] };
22712
- } else if (attribute.is_variant_axis) {
22713
- const currentIds = (attribute.values ?? []).map((v) => v.id);
22714
- const add = selectedIds.filter((id) => !currentIds.includes(id));
22715
- const remove = currentIds.filter((id) => !selectedIds.includes(id));
22716
- payload = { update: [{ id: attribute.id, add, remove }] };
22717
- } else {
22718
- payload = {
22719
- remove: [attribute.id],
22720
- add: [{ id: attribute.id, value_ids: selectedIds }]
22721
- };
22722
- }
22710
+ payload = isAttached ? { update: [{ id: attribute.id, value_ids: selectedIds }] } : { add: [{ id: attribute.id, value_ids: selectedIds }] };
22723
22711
  } else if (!isAttached) {
22724
22712
  payload = { add: [{ id: attribute.id, value: scalarValue }] };
22725
22713
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mercurjs/dashboard-shared",
3
- "version": "2.3.3",
3
+ "version": "2.3.4-canary.1",
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.3.3",
26
+ "@mercurjs/client": "2.3.4-canary.1",
27
27
  "@ariakit/react": "^0.4.15",
28
28
  "@babel/runtime": "^8.0.0",
29
29
  "@dnd-kit/core": "^6.1.0",
@@ -63,9 +63,9 @@
63
63
  },
64
64
  "devDependencies": {
65
65
  "@medusajs/types": "2.18.0",
66
- "@mercurjs/core": "2.3.3",
67
- "@mercurjs/dashboard-sdk": "2.3.3",
68
- "@mercurjs/types": "2.3.3",
66
+ "@mercurjs/core": "2.3.4-canary.1",
67
+ "@mercurjs/dashboard-sdk": "2.3.4-canary.1",
68
+ "@mercurjs/types": "2.3.4-canary.1",
69
69
  "@types/lodash.debounce": "^4.0.8",
70
70
  "@types/react": "^18.3.2",
71
71
  "@types/react-dom": "^18.2.22",