@box/metadata-editor 1.9.0 → 1.9.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,23 +1,23 @@
1
- import { Modal as o, Text as h, Checkbox as b, TextInput as v } from "@box/blueprint-web";
2
- import { useState as p } from "react";
3
- import { useIntl as F, FormattedMessage as d } from "react-intl";
1
+ import { Modal as o, Text as h, Checkbox as b, TextInput as F } from "@box/blueprint-web";
2
+ import { useState as u } from "react";
3
+ import { useIntl as v, FormattedMessage as d } from "react-intl";
4
4
  import a from "./messages.js";
5
5
  import { jsx as e, jsxs as m } from "react/jsx-runtime";
6
6
  import '../../../../../../styles/delete-confirmation-modal.css';const I = "_modalBody_1wc7x_1", V = {
7
7
  modalBody: I
8
8
  }, H = ({
9
- onConfirm: u,
10
- templateName: g,
11
- onDismiss: M,
9
+ onConfirm: p,
10
+ templateName: M,
11
+ onDismiss: g,
12
12
  open: B,
13
- isCheckboxEnabled: l
13
+ isCheckboxEnabled: n
14
14
  }) => {
15
- const t = F(), [c, f] = p(""), [i, C] = p(!1), s = (r) => {
16
- r || (M(), f(""), C(!1));
17
- }, n = g || t.formatMessage(a.deleteConfirmationModalCustomMetadata), y = c === n, k = () => {
15
+ const t = v(), [c, f] = u(""), [i, C] = u(!1), s = (r) => {
16
+ r || (g(), f(""), C(!1));
17
+ }, l = M || t.formatMessage(a.deleteConfirmationModalCustomMetadata), y = c === l, k = () => {
18
18
  C(!i);
19
19
  }, x = () => {
20
- u(), s(!1);
20
+ p(), s(!1);
21
21
  };
22
22
  return /* @__PURE__ */ e(o, {
23
23
  onOpenChange: s,
@@ -30,7 +30,7 @@ import '../../../../../../styles/delete-confirmation-modal.css';const I = "_moda
30
30
  children: /* @__PURE__ */ e(d, {
31
31
  ...a.deleteConfirmationModalHeader,
32
32
  values: {
33
- templateName: n
33
+ templateName: l
34
34
  }
35
35
  })
36
36
  }), /* @__PURE__ */ e(o.ScrollableContainer, {
@@ -38,32 +38,32 @@ import '../../../../../../styles/delete-confirmation-modal.css';const I = "_moda
38
38
  className: V.modalBody,
39
39
  children: [/* @__PURE__ */ e(h, {
40
40
  as: "p",
41
- children: l ? /* @__PURE__ */ e(d, {
41
+ children: n ? /* @__PURE__ */ e(d, {
42
42
  ...a.deleteConfirmationModalBodyFirstParagraphCheckboxVersion,
43
43
  values: {
44
- templateName: n
44
+ templateName: l
45
45
  }
46
46
  }) : /* @__PURE__ */ e(d, {
47
47
  ...a.deleteConfirmationModalBodyFirstParagraph,
48
48
  values: {
49
- templateName: n
49
+ templateName: l
50
50
  }
51
51
  })
52
- }), !l && /* @__PURE__ */ e(h, {
52
+ }), !n && /* @__PURE__ */ e(h, {
53
53
  as: "p",
54
54
  children: /* @__PURE__ */ e(d, {
55
55
  ...a.deleteConfirmationModalBodySecondParagraph
56
56
  })
57
- }), l ? /* @__PURE__ */ e(b.Item, {
57
+ }), n ? /* @__PURE__ */ e(b.Item, {
58
58
  checked: i,
59
59
  "data-resin-target": "checkbox",
60
60
  label: t.formatMessage(a.deleteConfirmationModalBodyCheckboxLabel),
61
61
  onCheckedChange: k,
62
62
  value: "overageCheckbox"
63
- }) : /* @__PURE__ */ e(v, {
63
+ }) : /* @__PURE__ */ e(F, {
64
64
  label: t.formatMessage(a.deleteConfirmationModalBodyInputFieldLabel),
65
65
  onChange: (r) => f(r.target.value),
66
- placeholder: n,
66
+ placeholder: l,
67
67
  required: !0,
68
68
  value: c
69
69
  })]
@@ -72,12 +72,13 @@ import '../../../../../../styles/delete-confirmation-modal.css';const I = "_moda
72
72
  children: [/* @__PURE__ */ e(o.Footer.SecondaryButton, {
73
73
  onClick: () => s(!1),
74
74
  size: "large",
75
+ "data-target-id": "Modal.Footer.SecondaryButton-deleteConfirmationModalCancelButton",
75
76
  children: t.formatMessage(a.deleteConfirmationModalCancelButton)
76
77
  }), /* @__PURE__ */ e(o.Footer.PrimaryButton, {
77
- disabled: l ? !i : !y,
78
+ disabled: n ? !i : !y,
78
79
  onClick: x,
79
80
  size: "large",
80
- children: t.formatMessage(l ? a.deleteConfirmationModalConfirmButtonCheckboxVersion : a.deleteConfirmationModalConfirmButton)
81
+ children: t.formatMessage(n ? a.deleteConfirmationModalConfirmButtonCheckboxVersion : a.deleteConfirmationModalConfirmButton)
81
82
  })]
82
83
  }), /* @__PURE__ */ e(o.Close, {
83
84
  "aria-label": t.formatMessage(a.deleteConfirmationModalDismissButton)
@@ -1,56 +1,58 @@
1
1
  import { Modal as e } from "@box/blueprint-web";
2
- import { useState as M, useEffect as p, useCallback as d } from "react";
3
- import { useIntl as v, FormattedMessage as h } from "react-intl";
4
- import n from "./messages.js";
5
- import { jsx as a, jsxs as C } from "react/jsx-runtime";
6
- function x({
2
+ import { useState as f, useEffect as v, useCallback as l } from "react";
3
+ import { useIntl as p, FormattedMessage as c } from "react-intl";
4
+ import o from "./messages.js";
5
+ import { jsx as a, jsxs as g } from "react/jsx-runtime";
6
+ function E({
7
7
  onBackToEdit: i,
8
- onDiscardChanges: c,
9
- defaultOpen: g = !0,
10
- open: r = g
8
+ onDiscardChanges: C,
9
+ defaultOpen: h = !0,
10
+ open: s = h
11
11
  }) {
12
- const t = v(), [m, o] = M(r);
13
- p(() => o(r), [r]);
14
- const l = d(() => {
15
- i(), o(!1);
16
- }, [i]), u = d(() => {
17
- c(), o(!1);
18
- }, [c]), f = d((s) => {
19
- o(s), s || l();
20
- }, [l]);
12
+ const r = p(), [u, n] = f(s);
13
+ v(() => n(s), [s]);
14
+ const d = l(() => {
15
+ i(), n(!1);
16
+ }, [i]), m = l(() => {
17
+ C(), n(!1);
18
+ }, [C]), M = l((t) => {
19
+ n(t), t || d();
20
+ }, [d]);
21
21
  return /* @__PURE__ */ a(e, {
22
22
  modal: !0,
23
- onOpenChange: f,
24
- open: m,
25
- children: /* @__PURE__ */ C(e.Content, {
26
- onEscapeKeyDown: (s) => s.stopPropagation(),
23
+ onOpenChange: M,
24
+ open: u,
25
+ children: /* @__PURE__ */ g(e.Content, {
26
+ onEscapeKeyDown: (t) => t.stopPropagation(),
27
27
  size: "small",
28
28
  children: [/* @__PURE__ */ a(e.Header, {
29
- children: /* @__PURE__ */ a(h, {
30
- ...n.unsavedChangesModalHeader
29
+ children: /* @__PURE__ */ a(c, {
30
+ ...o.unsavedChangesModalHeader
31
31
  })
32
32
  }), /* @__PURE__ */ a(e.ScrollableContainer, {
33
33
  children: /* @__PURE__ */ a(e.Body, {
34
- children: /* @__PURE__ */ a(h, {
35
- ...n.unsavedChangesModalBody
34
+ children: /* @__PURE__ */ a(c, {
35
+ ...o.unsavedChangesModalBody
36
36
  })
37
37
  })
38
- }), /* @__PURE__ */ C(e.Footer, {
38
+ }), /* @__PURE__ */ g(e.Footer, {
39
39
  children: [/* @__PURE__ */ a(e.Footer.SecondaryButton, {
40
- onClick: u,
40
+ onClick: m,
41
41
  size: "large",
42
- children: t.formatMessage(n.unsavedChangesModalDiscardChangesCTA)
42
+ "data-target-id": "Modal.Footer.SecondaryButton-unsavedChangesModalDiscardChangesCTA",
43
+ children: r.formatMessage(o.unsavedChangesModalDiscardChangesCTA)
43
44
  }), /* @__PURE__ */ a(e.Footer.PrimaryButton, {
44
- onClick: l,
45
+ onClick: d,
45
46
  size: "large",
46
- children: t.formatMessage(n.unsavedChangesModalContinueEditingCTA)
47
+ "data-target-id": "Modal.Footer.PrimaryButton-unsavedChangesModalContinueEditingCTA",
48
+ children: r.formatMessage(o.unsavedChangesModalContinueEditingCTA)
47
49
  })]
48
50
  }), /* @__PURE__ */ a(e.Close, {
49
- "aria-label": t.formatMessage(n.unsavedChangesModalCloseLabel)
51
+ "aria-label": r.formatMessage(o.unsavedChangesModalCloseLabel)
50
52
  })]
51
53
  })
52
54
  });
53
55
  }
54
56
  export {
55
- x as UnsavedChangesModal
57
+ E as UnsavedChangesModal
56
58
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/metadata-editor",
3
- "version": "1.9.0",
3
+ "version": "1.9.1",
4
4
  "peerDependencies": {
5
5
  "@ariakit/react": "0.4.15",
6
6
  "@box/box-ai-agent-selector": "^0.55.2",
@@ -15,9 +15,9 @@
15
15
  },
16
16
  "devDependencies": {
17
17
  "@ariakit/react": "0.4.15",
18
- "@box/box-ai-agent-selector": "^1.9.0",
19
- "@box/babel-plugin-target-attributes": "1.3.0",
20
- "@box/blueprint-web": "^12.95.1",
18
+ "@box/box-ai-agent-selector": "^1.9.1",
19
+ "@box/babel-plugin-target-attributes": "1.4.0",
20
+ "@box/blueprint-web": "^12.96.0",
21
21
  "@box/blueprint-web-assets": "^4.80.0",
22
22
  "@box/storybook-utils": "^0.14.17",
23
23
  "@testing-library/react": "^15.0.6",