@empty-complete-org/medusa-product-attributes 1.1.3 → 1.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.
@@ -110,7 +110,7 @@ const ru = {
110
110
  globalsDesc: globalsDesc$1
111
111
  };
112
112
  const attributes = "Attributes";
113
- const characteristics = "Characteristics";
113
+ const characteristics = "Attributes";
114
114
  const inherited = "Inherited";
115
115
  const own = "Own";
116
116
  const global = "global";
@@ -489,6 +489,18 @@ const ProductAttributeValuesWidget = ({
489
489
  const productId = data.id;
490
490
  const productHandle = data.handle || productId;
491
491
  const t = useT();
492
+ React.useEffect(() => {
493
+ var _a2, _b, _c, _d;
494
+ const headings = document.querySelectorAll("h2");
495
+ for (const h of headings) {
496
+ if (h.textContent === "Attributes" || h.textContent === "Атрибуты") {
497
+ const container = h.closest(".shadow-elevation-card-rest");
498
+ if (container && ((_b = (_a2 = container.querySelector("p")) == null ? void 0 : _a2.textContent) == null ? void 0 : _b.includes("Height")) || ((_d = (_c = container == null ? void 0 : container.querySelector("p")) == null ? void 0 : _c.textContent) == null ? void 0 : _d.includes("Weight"))) {
499
+ container.style.display = "none";
500
+ }
501
+ }
502
+ }
503
+ }, []);
492
504
  const qc = reactQuery.useQueryClient();
493
505
  const [formValues, setFormValues] = React.useState({});
494
506
  const [saveSuccess, setSaveSuccess] = React.useState(false);
@@ -3,7 +3,7 @@ import { defineWidgetConfig, defineRouteConfig } from "@medusajs/admin-sdk";
3
3
  import { Container, Heading, Button, Text, Badge, Input } from "@medusajs/ui";
4
4
  import { useQueryClient, useQuery, useMutation } from "@tanstack/react-query";
5
5
  import * as React from "react";
6
- import { useMemo, useState, useRef, useEffect } from "react";
6
+ import { useMemo, useState, useEffect, useRef } from "react";
7
7
  import Medusa from "@medusajs/js-sdk";
8
8
  const sdk = new Medusa({
9
9
  baseUrl: "/",
@@ -90,7 +90,7 @@ const ru = {
90
90
  globalsDesc: globalsDesc$1
91
91
  };
92
92
  const attributes = "Attributes";
93
- const characteristics = "Characteristics";
93
+ const characteristics = "Attributes";
94
94
  const inherited = "Inherited";
95
95
  const own = "Own";
96
96
  const global = "global";
@@ -469,6 +469,18 @@ const ProductAttributeValuesWidget = ({
469
469
  const productId = data.id;
470
470
  const productHandle = data.handle || productId;
471
471
  const t = useT();
472
+ useEffect(() => {
473
+ var _a2, _b, _c, _d;
474
+ const headings = document.querySelectorAll("h2");
475
+ for (const h of headings) {
476
+ if (h.textContent === "Attributes" || h.textContent === "Атрибуты") {
477
+ const container = h.closest(".shadow-elevation-card-rest");
478
+ if (container && ((_b = (_a2 = container.querySelector("p")) == null ? void 0 : _a2.textContent) == null ? void 0 : _b.includes("Height")) || ((_d = (_c = container == null ? void 0 : container.querySelector("p")) == null ? void 0 : _c.textContent) == null ? void 0 : _d.includes("Weight"))) {
479
+ container.style.display = "none";
480
+ }
481
+ }
482
+ }
483
+ }, []);
472
484
  const qc = useQueryClient();
473
485
  const [formValues, setFormValues] = useState({});
474
486
  const [saveSuccess, setSaveSuccess] = useState(false);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@empty-complete-org/medusa-product-attributes",
3
- "version": "1.1.3",
3
+ "version": "1.2.0",
4
4
  "description": "Custom attributes module for Medusa v2 with support for text, number, file types and units of measurement",
5
5
  "author": "empty-complete",
6
6
  "license": "MIT",
@@ -86,4 +86,4 @@
86
86
  "dependencies": {
87
87
  "transliteration": "^2.6.1"
88
88
  }
89
- }
89
+ }