@box/metadata-editor 1.4.3 → 1.5.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.
@@ -1,4 +1,4 @@
1
- import '../styles/filter-dropdown-menu.css';const c = "_content_fupgp_1", e = "_scrollableContainer_fupgp_20", o = "_item_fupgp_25", t = "_option_fupgp_35", n = "_search_fupgp_56", _ = "_searchIcon_fupgp_61", a = "_global_fupgp_70", p = "_clearSearchIcon_fupgp_75", r = "_searchInput_fupgp_83", s = "_firefoxDefaultOpacityFix_fupgp_115", i = "_divider_fupgp_133", l = "_searchDivider_fupgp_137", f = {
1
+ import '../styles/filter-dropdown-menu.css';const c = "_content_2vpjl_2", e = "_scrollableContainer_2vpjl_21", o = "_item_2vpjl_26", t = "_option_2vpjl_36", n = "_search_2vpjl_57", _ = "_searchIcon_2vpjl_62", a = "_global_2vpjl_71", l = "_clearSearchIcon_2vpjl_76", r = "_searchInput_2vpjl_84", s = "_firefoxDefaultOpacityFix_2vpjl_116", i = "_divider_2vpjl_134", p = "_searchDivider_2vpjl_138", v = {
2
2
  content: c,
3
3
  scrollableContainer: e,
4
4
  item: o,
@@ -6,12 +6,12 @@ import '../styles/filter-dropdown-menu.css';const c = "_content_fupgp_1", e = "_
6
6
  search: n,
7
7
  searchIcon: _,
8
8
  global: a,
9
- clearSearchIcon: p,
9
+ clearSearchIcon: l,
10
10
  searchInput: r,
11
11
  firefoxDefaultOpacityFix: s,
12
12
  divider: i,
13
- searchDivider: l
13
+ searchDivider: p
14
14
  };
15
15
  export {
16
- f as s
16
+ v as s
17
17
  };
@@ -5,7 +5,7 @@ import { useState as s } from "react";
5
5
  import { useIntl as B, FormattedMessage as _ } from "react-intl";
6
6
  import a from "../esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/taxonomy-entry/messages.js";
7
7
  import { jsxs as l, jsx as e } from "react/jsx-runtime";
8
- import '../styles/taxonomy-ancestor-status-pill.css';const N = "_popoverContentContainer_1heyb_1", w = "_popoverMainContent_1heyb_6", E = "_loadingIndicatorWrapper_1heyb_10", D = "_errorMessageWrapper_1heyb_17", P = "_errorMessageWrapperText_1heyb_22", R = "_container_1heyb_30", k = "_taxonomyAncestorTable_1heyb_36", K = "_taxonomyValueGroup_1heyb_79", G = "_taxonomyValueButton_1heyb_84", O = "_taxonomyValueLabel_1heyb_94", n = {
8
+ import '../styles/taxonomy-ancestor-status-pill.css';const N = "_popoverContentContainer_1vfhn_2", w = "_popoverMainContent_1vfhn_7", E = "_loadingIndicatorWrapper_1vfhn_11", D = "_errorMessageWrapper_1vfhn_18", P = "_errorMessageWrapperText_1vfhn_23", R = "_container_1vfhn_31", k = "_taxonomyAncestorTable_1vfhn_37", K = "_taxonomyValueGroup_1vfhn_80", G = "_taxonomyValueButton_1vfhn_85", O = "_taxonomyValueLabel_1vfhn_95", r = {
9
9
  popoverContentContainer: N,
10
10
  popoverMainContent: w,
11
11
  loadingIndicatorWrapper: E,
@@ -18,57 +18,57 @@ import '../styles/taxonomy-ancestor-status-pill.css';const N = "_popoverContentC
18
18
  taxonomyValueLabel: O
19
19
  }, j = {
20
20
  right: 24
21
- }, S = (r) => {
22
- r.stopPropagation();
23
- }, z = (r) => {
24
- (r.key === "ArrowLeft" || r.key === "ArrowRight") && r.stopPropagation();
21
+ }, S = (n) => {
22
+ n.stopPropagation();
23
+ }, z = (n) => {
24
+ (n.key === "ArrowLeft" || n.key === "ArrowRight") && n.stopPropagation();
25
25
  };
26
26
  function Y({
27
- taxonomyNodeFetcher: r,
28
- scope: b,
29
- taxonomyKey: v,
27
+ taxonomyNodeFetcher: n,
28
+ scope: y,
29
+ taxonomyKey: f,
30
30
  value: x,
31
31
  displayValue: c
32
32
  }) {
33
33
  const {
34
34
  formatMessage: i
35
- } = B(), [C, f] = s([]), [p, d] = s(!1), [m, y] = s(!1), [M, g] = s(!1), L = V(C, (o) => o.level), h = async () => {
36
- d(!0), y(!1), g(!0);
35
+ } = B(), [C, b] = s([]), [p, d] = s(!1), [m, g] = s(!1), [M, h] = s(!1), L = V(C, (o) => o.level), v = async () => {
36
+ d(!0), g(!1), h(!0);
37
37
  try {
38
- const o = await r(b, v, x);
39
- f(o);
38
+ const o = await n(y, f, x);
39
+ b(o);
40
40
  } catch {
41
- y(!0);
41
+ g(!0);
42
42
  } finally {
43
43
  d(!1);
44
44
  }
45
45
  };
46
46
  return /* @__PURE__ */ l(t.Root, {
47
- onOpenChange: g,
47
+ onOpenChange: h,
48
48
  open: M,
49
49
  children: [/* @__PURE__ */ e(t.Trigger, {
50
50
  children: /* @__PURE__ */ e(u.ChipButton, {
51
51
  "aria-checked": void 0,
52
- className: n.taxonomyValueButton,
53
- disabled: !r,
54
- onClick: h,
52
+ className: r.taxonomyValueButton,
53
+ disabled: !n,
54
+ onClick: v,
55
55
  onKeyDown: z,
56
56
  role: void 0,
57
57
  value: c,
58
58
  children: /* @__PURE__ */ e(u.Label, {
59
- className: n.taxonomyValueLabel,
59
+ className: r.taxonomyValueLabel,
60
60
  children: c
61
61
  })
62
62
  })
63
63
  }), /* @__PURE__ */ e(t.ContentContainer, {
64
64
  align: "start",
65
- className: n.popoverContentContainer,
65
+ className: r.popoverContentContainer,
66
66
  collisionPadding: j,
67
67
  onEscapeKeyDown: S,
68
68
  children: /* @__PURE__ */ l(t.MainContent, {
69
- className: n.popoverMainContent,
69
+ className: r.popoverMainContent,
70
70
  children: [m && /* @__PURE__ */ l("div", {
71
- className: n.errorMessageWrapper,
71
+ className: r.errorMessageWrapper,
72
72
  children: [/* @__PURE__ */ e(A, {
73
73
  variant: "error",
74
74
  variantIconAriaLabel: i(a.loadingResultsErrorIconLabel),
@@ -76,20 +76,20 @@ function Y({
76
76
  ...a.loadingResultsErrorMessage
77
77
  })
78
78
  }), /* @__PURE__ */ e(T, {
79
- className: n.errorMessageWrapperText,
79
+ className: r.errorMessageWrapperText,
80
80
  icon: W,
81
- onClick: h,
81
+ onClick: v,
82
82
  "data-target-id": "TextButton-loadingResultsErrorAction",
83
83
  children: i(a.loadingResultsErrorAction)
84
84
  })]
85
85
  }), p && /* @__PURE__ */ e("div", {
86
- className: n.loadingIndicatorWrapper,
86
+ className: r.loadingIndicatorWrapper,
87
87
  children: /* @__PURE__ */ e(I, {
88
88
  "aria-label": i(a.loadingAriaLabel),
89
89
  size: "large"
90
90
  })
91
91
  }), !m && !p && /* @__PURE__ */ e("table", {
92
- className: n.taxonomyAncestorTable,
92
+ className: r.taxonomyAncestorTable,
93
93
  children: /* @__PURE__ */ e("tbody", {
94
94
  children: L.map((o) => /* @__PURE__ */ l("tr", {
95
95
  children: [/* @__PURE__ */ e("th", {
@@ -109,5 +109,5 @@ function Y({
109
109
  }
110
110
  export {
111
111
  Y as T,
112
- n as s
112
+ r as s
113
113
  };
@@ -3,23 +3,23 @@ import { Combobox as m, useForkRef as re, LoadingIndicator as ne, InlineNotice a
3
3
  import { Search as ae, Loader as le } from "@box/blueprint-web-assets/icons/Fill";
4
4
  import { IconIconOnLightSecondary as ce, Size6 as T, Size1 as ue } from "@box/blueprint-web-assets/tokens/tokens";
5
5
  import S from "clsx";
6
- import { forwardRef as F, useRef as v, useCallback as de, useMemo as R, useEffect as me } from "react";
6
+ import { forwardRef as F, useRef as C, useCallback as de, useMemo as A, useEffect as me } from "react";
7
7
  import { useIntl as P, FormattedMessage as V } from "react-intl";
8
8
  import i from "./messages.js";
9
9
  import { useAsyncList as pe } from "./use-async-list.js";
10
10
  import { useControllableState as he } from "./utils/use-controllable-state.js";
11
11
  import { useTrackVisibility as fe } from "./utils/use-intersection-observer.js";
12
12
  import { jsx as r, jsxs as N, Fragment as ge } from "react/jsx-runtime";
13
- import '../../../../styles/combobox-with-api-pagination.css';const be = "_container_syvk5_1", xe = "_disabled_syvk5_7", _e = "_highlightOptionText_syvk5_11", Oe = "_selected_syvk5_23", ye = "_option_syvk5_34", ve = "_errorComboboxOption_syvk5_38", Re = "_errorComboboxOptionText_syvk5_43", a = {
13
+ import '../../../../styles/combobox-with-api-pagination.css';const be = "_container_19k3s_2", xe = "_disabled_19k3s_8", _e = "_highlightOptionText_19k3s_12", Oe = "_selected_19k3s_24", Re = "_option_19k3s_35", Ce = "_errorComboboxOption_19k3s_39", Ae = "_errorComboboxOptionText_19k3s_44", a = {
14
14
  container: be,
15
15
  disabled: xe,
16
16
  highlightOptionText: _e,
17
17
  selected: Oe,
18
- option: ye,
19
- errorComboboxOption: ve,
20
- errorComboboxOptionText: Re
18
+ option: Re,
19
+ errorComboboxOption: Ce,
20
+ errorComboboxOptionText: Ae
21
21
  }, k = /* @__PURE__ */ F(({
22
- onTryAgain: L
22
+ onTryAgain: E
23
23
  }, p) => {
24
24
  const {
25
25
  formatMessage: h
@@ -34,7 +34,7 @@ import '../../../../styles/combobox-with-api-pagination.css';const be = "_contai
34
34
  }), /* @__PURE__ */ r(m.Option, {
35
35
  ref: p,
36
36
  className: a.errorComboboxOption,
37
- onClick: L,
37
+ onClick: E,
38
38
  children: /* @__PURE__ */ N(se, {
39
39
  as: "span",
40
40
  className: a.errorComboboxOptionText,
@@ -50,7 +50,7 @@ import '../../../../styles/combobox-with-api-pagination.css';const be = "_contai
50
50
  })
51
51
  })]
52
52
  });
53
- }), C = "__LOADING__", A = "__LOADING_ERROR__", Ce = "0px 0px 20px 0px", Ae = /* @__PURE__ */ r(ae, {
53
+ }), L = "__LOADING__", y = "__LOADING_ERROR__", Le = "0px 0px 20px 0px", ye = /* @__PURE__ */ r(ae, {
54
54
  color: ce,
55
55
  height: T,
56
56
  role: "presentation",
@@ -71,18 +71,18 @@ import '../../../../styles/combobox-with-api-pagination.css';const be = "_contai
71
71
  multiselect: l = !1,
72
72
  disabled: j,
73
73
  className: U,
74
- displaySingleSelectionAsChip: E = !0,
74
+ displaySingleSelectionAsChip: v = !0,
75
75
  ...q
76
76
  } = p, {
77
77
  formatMessage: u
78
- } = P(), g = v(null), b = v(!0), e = pe({
78
+ } = P(), g = C(null), b = C(!0), e = pe({
79
79
  async load({
80
80
  marker: o,
81
81
  searchInput: t,
82
- signal: y
82
+ signal: R
83
83
  }) {
84
84
  const c = await D({
85
- signal: y,
85
+ signal: R,
86
86
  marker: o,
87
87
  searchInput: t
88
88
  });
@@ -91,21 +91,21 @@ import '../../../../styles/combobox-with-api-pagination.css';const be = "_contai
91
91
  marker: c.marker
92
92
  };
93
93
  }
94
- }), I = v(!1), H = de(() => {
94
+ }), I = C(!1), H = de(() => {
95
95
  I.current || (e.reload(), I.current = !0);
96
96
  }, []), [n, x] = he({
97
97
  prop: w,
98
98
  defaultProp: z,
99
99
  onChange: B
100
100
  }), _ = !l && n.length === 1, J = (o) => {
101
- o === void 0 ? (x([]), (!b.current || !E) && (e.search(""), b.current = !0)) : Array.isArray(o) ? x(o) : x([o]);
102
- }, K = R(() => n.length === 0 ? l ? [] : void 0 : l ? n : n[0], [l, n]), O = R(() => n.filter((o) => !e.items.some((t) => t.value === o.value)), [n, e.items]), Q = (o) => {
101
+ o === void 0 ? (x([]), (!b.current || !v) && (e.search(""), b.current = !0)) : Array.isArray(o) ? x(o) : x([o]);
102
+ }, K = A(() => n.length === 0 ? l ? [] : void 0 : l ? n : n[0], [l, n]), O = A(() => n.filter((o) => !e.items.some((t) => t.value === o.value)), [n, e.items]), Q = (o) => {
103
103
  const {
104
104
  value: t,
105
- displayValue: y,
105
+ displayValue: R,
106
106
  ...c
107
107
  } = o;
108
- if (t === C)
108
+ if (t === L)
109
109
  return e.hasNextPage ? /* @__PURE__ */ r(m.Option, {
110
110
  ...c,
111
111
  ref: Z,
@@ -118,7 +118,7 @@ import '../../../../styles/combobox-with-api-pagination.css';const be = "_contai
118
118
  }
119
119
  })
120
120
  }) : null;
121
- if (t === A && e.hasError && !e.isEmpty)
121
+ if (t === y && e.hasError && !e.isEmpty)
122
122
  return /* @__PURE__ */ r(k, {
123
123
  onTryAgain: () => {
124
124
  var s;
@@ -134,7 +134,7 @@ import '../../../../styles/combobox-with-api-pagination.css';const be = "_contai
134
134
  value: t,
135
135
  children: /* @__PURE__ */ r(te, {
136
136
  className: S(a.highlightOptionText, oe && a.selected),
137
- value: y || t
137
+ value: R || t
138
138
  })
139
139
  });
140
140
  }, X = (o) => {
@@ -155,7 +155,7 @@ import '../../../../styles/combobox-with-api-pagination.css';const be = "_contai
155
155
  rootRef: $,
156
156
  isVisible: M
157
157
  }] = fe({
158
- rootMargin: Ce
158
+ rootMargin: Le
159
159
  });
160
160
  me(() => {
161
161
  if (!(M && e.hasNextPage))
@@ -167,13 +167,13 @@ import '../../../../styles/combobox-with-api-pagination.css';const be = "_contai
167
167
  clearTimeout(t);
168
168
  };
169
169
  }, [M]);
170
- const ee = R(() => {
170
+ const ee = A(() => {
171
171
  const o = e.hasNextPage ? {
172
- displayValue: C,
173
- value: C
172
+ displayValue: L,
173
+ value: L
174
174
  } : null, t = !o && e.hasError && !e.isEmpty ? {
175
- displayValue: A,
176
- value: A
175
+ displayValue: y,
176
+ value: y
177
177
  } : null;
178
178
  return [...e.items, ...O, o, t].filter(Boolean);
179
179
  }, [e.hasNextPage, e.hasError, e.isEmpty, e.items, O]);
@@ -186,9 +186,9 @@ import '../../../../styles/combobox-with-api-pagination.css';const be = "_contai
186
186
  }, U),
187
187
  clearButtonAriaLabel: u(i.clearButtonAriaLabel),
188
188
  disabled: j || _,
189
- displaySingleSelectionAsChip: E,
189
+ displaySingleSelectionAsChip: v,
190
190
  displayValue: (o) => o.displayValue || o.value,
191
- endComboboxIcon: Ae,
191
+ endComboboxIcon: ye,
192
192
  focusLoop: !1,
193
193
  getPopoverRef: $,
194
194
  loading: e.isReloading,
@@ -1,89 +1,89 @@
1
- import { TriggerButton as v, Text as C, ScrollableContainer as N, Divider as w } from "@box/blueprint-web";
1
+ import { TriggerButton as v, Text as C, ScrollableContainer as N, Divider as j } from "@box/blueprint-web";
2
2
  import { useIntl as x } from "react-intl";
3
- import { SelectProvider as B, Select as b, SelectPopover as I, SelectItem as g, SelectItemCheck as k } from "@ariakit/react";
4
- import { Space1 as M } from "@box/blueprint-web-assets/tokens/px-tokens";
5
- import { useEffect as S } from "react";
6
- import y from "clsx";
3
+ import { SelectProvider as B, Select as b, SelectPopover as z, SelectItem as g, SelectItemCheck as I } from "@ariakit/react";
4
+ import { Space1 as k } from "@box/blueprint-web-assets/tokens/px-tokens";
5
+ import { useEffect as M } from "react";
6
+ import S from "clsx";
7
7
  import { Checkmark as p } from "@box/blueprint-web-assets/icons/Fill";
8
- import { getVisibleTemplates as D, getTemplateDisplayName as _ } from "../../utils/utils.js";
8
+ import { getVisibleTemplates as y, getTemplateDisplayName as _ } from "../../utils/utils.js";
9
9
  import s from "./messages.js";
10
- import { jsxs as o, jsx as t } from "react/jsx-runtime";
11
- import '../../../../styles/filter-instances-dropdown.css';const j = "_details_1ew6d_1", F = "_triggerContainer_1ew6d_5", O = "_triggerButton_1ew6d_10", P = "_popover_1ew6d_16", L = "_divider_1ew6d_33", V = "_scrollableContainer_1ew6d_36", z = "_item_1ew6d_40", E = "_indicator_1ew6d_67", G = "_indicatorIcon_1ew6d_76", R = "_testContainer_1ew6d_80", e = {
12
- details: j,
13
- triggerContainer: F,
14
- triggerButton: O,
15
- popover: P,
16
- divider: L,
17
- scrollableContainer: V,
18
- item: z,
10
+ import { jsxs as o, jsx as e } from "react/jsx-runtime";
11
+ import '../../../../styles/filter-instances-dropdown.css';const D = "_details_106jz_2", w = "_triggerContainer_106jz_6", F = "_triggerButton_106jz_11", O = "_popover_106jz_17", P = "_divider_106jz_34", L = "_scrollableContainer_106jz_37", V = "_item_106jz_41", E = "_indicator_106jz_68", G = "_indicatorIcon_106jz_77", R = "_testContainer_106jz_81", t = {
12
+ details: D,
13
+ triggerContainer: w,
14
+ triggerButton: F,
15
+ popover: O,
16
+ divider: P,
17
+ scrollableContainer: L,
18
+ item: V,
19
19
  indicator: E,
20
20
  indicatorIcon: G,
21
21
  testContainer: R
22
- }, q = parseInt(M, 10);
22
+ }, q = parseInt(k, 10);
23
23
  function $({
24
24
  appliedTemplates: u,
25
25
  selectedTemplates: c,
26
26
  setSelectedTemplates: l
27
27
  }) {
28
- const a = x(), m = a.formatMessage(s.customMetadataName), n = D(u), i = c.length, d = n.length, h = i === 0 ? a.formatMessage(s.allTemplatesTriggerButtonText) : a.formatMessage(s.selectedTemplatesTriggerButtonText, {
28
+ const a = x(), d = a.formatMessage(s.customMetadataName), n = y(u), i = c.length, m = n.length, h = i === 0 ? a.formatMessage(s.allTemplatesTriggerButtonText) : a.formatMessage(s.selectedTemplatesTriggerButtonText, {
29
29
  selectedTemplatesNumber: i,
30
- visibleTemplatesNumber: d
30
+ visibleTemplatesNumber: m
31
31
  }), T = () => {
32
32
  l([]);
33
33
  };
34
- return S(() => {
35
- i === d && l([]);
36
- }, [i, d]), /* @__PURE__ */ o(B, {
34
+ return M(() => {
35
+ i === m && l([]);
36
+ }, [i, m]), /* @__PURE__ */ o(B, {
37
37
  setValue: l,
38
38
  value: c,
39
39
  children: [/* @__PURE__ */ o("div", {
40
- className: e.triggerContainer,
41
- children: [/* @__PURE__ */ t(b, {
42
- render: /* @__PURE__ */ t(v, {
40
+ className: t.triggerContainer,
41
+ children: [/* @__PURE__ */ e(b, {
42
+ render: /* @__PURE__ */ e(v, {
43
43
  caretDirection: "down",
44
- className: e.triggerButton,
44
+ className: t.triggerButton,
45
45
  label: h,
46
46
  size: "small",
47
47
  variant: "tertiary",
48
48
  "data-target-id": "TriggerButton-allTemplatesTriggerButtonText|selectedTemplatesTriggerButtonText"
49
49
  })
50
- }), n.length > 0 && /* @__PURE__ */ t(C, {
50
+ }), n.length > 0 && /* @__PURE__ */ e(C, {
51
51
  as: "p",
52
- className: e.details,
52
+ className: t.details,
53
53
  color: "textOnLightSecondary",
54
54
  "data-testid": "detailsList",
55
55
  variant: "caption",
56
- children: n.filter((r) => c.some((f) => f === r.id)).map((r) => _(r, m)).join(", ")
56
+ children: n.filter((r) => c.some((f) => f === r.id)).map((r) => _(r, d)).join(", ")
57
57
  })]
58
- }), /* @__PURE__ */ t(I, {
59
- className: e.popover,
58
+ }), /* @__PURE__ */ e(z, {
59
+ className: t.popover,
60
60
  gutter: q,
61
61
  children: /* @__PURE__ */ o(N, {
62
- className: e.scrollableContainer,
62
+ className: t.scrollableContainer,
63
63
  children: [/* @__PURE__ */ o(g, {
64
64
  autoFocus: i === 0,
65
- className: e.item,
65
+ className: t.item,
66
66
  hideOnClick: !0,
67
67
  onClick: T,
68
- children: [i === 0 && /* @__PURE__ */ t(p, {
69
- className: y(e.indicator, e.indicatorIcon)
68
+ children: [i === 0 && /* @__PURE__ */ e(p, {
69
+ className: S(t.indicator, t.indicatorIcon)
70
70
  }), a.formatMessage(s.allTemplatesTriggerButtonText)]
71
- }), /* @__PURE__ */ t(w, {
72
- className: e.divider
71
+ }), /* @__PURE__ */ e(j, {
72
+ className: t.divider
73
73
  }), n.map((r) => /* @__PURE__ */ o(g, {
74
- className: e.item,
74
+ className: t.item,
75
75
  hideOnClick: !0,
76
76
  value: r.id,
77
- children: [/* @__PURE__ */ t(k, {
78
- className: e.indicator,
77
+ children: [/* @__PURE__ */ e(I, {
78
+ className: t.indicator,
79
79
  style: {
80
80
  width: "none",
81
81
  height: "none"
82
82
  },
83
- children: /* @__PURE__ */ t(p, {
84
- className: e.indicatorIcon
83
+ children: /* @__PURE__ */ e(p, {
84
+ className: t.indicatorIcon
85
85
  })
86
- }), _(r, m)]
86
+ }), _(r, d)]
87
87
  }, r.id))]
88
88
  })
89
89
  })]