@mercurjs/dashboard-shared 2.3.4-canary.1 → 2.3.4-canary.2
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/index.js +13 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -22707,7 +22707,19 @@ 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
|
-
|
|
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
|
+
}
|
|
22711
22723
|
} else if (!isAttached) {
|
|
22712
22724
|
payload = { add: [{ id: attribute.id, value: scalarValue }] };
|
|
22713
22725
|
} else {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mercurjs/dashboard-shared",
|
|
3
|
-
"version": "2.3.4-canary.
|
|
3
|
+
"version": "2.3.4-canary.2",
|
|
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.4-canary.
|
|
26
|
+
"@mercurjs/client": "2.3.4-canary.2",
|
|
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.4-canary.
|
|
67
|
-
"@mercurjs/dashboard-sdk": "2.3.4-canary.
|
|
68
|
-
"@mercurjs/types": "2.3.4-canary.
|
|
66
|
+
"@mercurjs/core": "2.3.4-canary.2",
|
|
67
|
+
"@mercurjs/dashboard-sdk": "2.3.4-canary.2",
|
|
68
|
+
"@mercurjs/types": "2.3.4-canary.2",
|
|
69
69
|
"@types/lodash.debounce": "^4.0.8",
|
|
70
70
|
"@types/react": "^18.3.2",
|
|
71
71
|
"@types/react-dom": "^18.2.22",
|