@box/metadata-editor 0.58.1 → 0.58.3

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.
@@ -1,24 +1,24 @@
1
1
  import { IconButton as S } from "@box/blueprint-web";
2
2
  import { Plus as T } from "@box/blueprint-web-assets/icons/Fill";
3
- import { Space2 as E } from "@box/blueprint-web-assets/tokens/px-tokens";
4
- import { useState as I, useMemo as L } from "react";
5
- import { useIntl as w } from "react-intl";
6
- import { TEMPLATE_CUSTOM_PROPERTIES as y } from "../../constants.js";
3
+ import { Space2 as y } from "@box/blueprint-web-assets/tokens/px-tokens";
4
+ import { useState as E, useMemo as I } from "react";
5
+ import { useIntl as L } from "react-intl";
6
+ import { TEMPLATE_CUSTOM_PROPERTIES as w } from "../../constants.js";
7
7
  import { FilterDropdownMenu as t } from "../filter-dropdown-menu/index.js";
8
8
  import s from "./messages.js";
9
9
  import { jsxs as d, jsx as a } from "react/jsx-runtime";
10
- const B = parseInt(E, 10);
11
- function j({
10
+ const B = parseInt(y, 10);
11
+ function R({
12
12
  availableTemplates: n,
13
- onSelect: l,
14
- selectedTemplates: c
13
+ onSelect: c,
14
+ selectedTemplates: p
15
15
  }) {
16
- const o = w(), u = o.formatMessage(s.customMetadataName), m = (e) => e.templateKey === y ? u : e.displayName, [r, p] = I(""), i = L(() => n.filter((e) => m(e).toLowerCase().includes(r.toLowerCase())), [n, r]), g = r.length > 0 && i.length === 0, f = (e) => c.some((M) => M.id === e.id), h = (e) => {
17
- l(e);
16
+ const o = L(), u = o.formatMessage(s.customMetadataName), m = (e) => e.templateKey === w ? u : e.displayName, [r, g] = E(""), i = I(() => n.filter((e) => m(e).toLowerCase().includes(r.toLowerCase())), [n, r]), f = r.length > 0 && i.length === 0, h = (e) => p.some((l) => l.scope === e.scope && l.templateKey === e.templateKey), M = (e) => {
17
+ c(e);
18
18
  };
19
19
  return /* @__PURE__ */ d(t.Root, {
20
20
  resetValueOnHide: !0,
21
- setValue: p,
21
+ setValue: g,
22
22
  children: [/* @__PURE__ */ a(t.Trigger, {
23
23
  triggerButton: /* @__PURE__ */ a(S, {
24
24
  "aria-label": o.formatMessage(s.addMetadataTemplatesTriggerButtonLabel),
@@ -31,9 +31,9 @@ function j({
31
31
  children: [/* @__PURE__ */ a(t.Search, {
32
32
  placeholder: o.formatMessage(s.addMetadataTemplatesSearchPlaceholder)
33
33
  }), /* @__PURE__ */ a(t.List, {
34
- children: g ? /* @__PURE__ */ a(t.EmptyState, {}) : i.map((e) => /* @__PURE__ */ a(t.Item, {
35
- disabled: f(e),
36
- onClick: () => h(e),
34
+ children: f ? /* @__PURE__ */ a(t.EmptyState, {}) : i.map((e) => /* @__PURE__ */ a(t.Item, {
35
+ disabled: h(e),
36
+ onClick: () => M(e),
37
37
  value: m(e)
38
38
  }, e.id))
39
39
  })]
@@ -41,5 +41,5 @@ function j({
41
41
  });
42
42
  }
43
43
  export {
44
- j as AddMetadataTemplateDropdown
44
+ R as AddMetadataTemplateDropdown
45
45
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/metadata-editor",
3
- "version": "0.58.1",
3
+ "version": "0.58.3",
4
4
  "peerDependencies": {
5
5
  "@ariakit/react": "0.4.5",
6
6
  "@box/blueprint-web": "^7.20.0",
@@ -14,7 +14,7 @@
14
14
  "devDependencies": {
15
15
  "@ariakit/react": "0.4.5",
16
16
  "@box/babel-plugin-target-attributes": "1.3.0",
17
- "@box/blueprint-web": "^7.30.2",
17
+ "@box/blueprint-web": "^7.30.3",
18
18
  "@box/blueprint-web-assets": "^4.26.0",
19
19
  "@box/storybook-utils": "^0.6.1",
20
20
  "@testing-library/react": "^15.0.6",
@@ -53,5 +53,5 @@
53
53
  "**/*.css"
54
54
  ],
55
55
  "license": "SEE LICENSE IN LICENSE",
56
- "gitHead": "fc4d7910edf521a9a5eb4c109c22eb305ff86341"
56
+ "gitHead": "b80861a847d90496b048c6f3658384afde4d22fb"
57
57
  }