@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
|
|
2
|
-
import { useState as
|
|
3
|
-
import { useIntl as
|
|
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:
|
|
10
|
-
templateName:
|
|
11
|
-
onDismiss:
|
|
9
|
+
onConfirm: p,
|
|
10
|
+
templateName: M,
|
|
11
|
+
onDismiss: g,
|
|
12
12
|
open: B,
|
|
13
|
-
isCheckboxEnabled:
|
|
13
|
+
isCheckboxEnabled: n
|
|
14
14
|
}) => {
|
|
15
|
-
const t =
|
|
16
|
-
r || (
|
|
17
|
-
},
|
|
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
|
-
|
|
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:
|
|
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:
|
|
41
|
+
children: n ? /* @__PURE__ */ e(d, {
|
|
42
42
|
...a.deleteConfirmationModalBodyFirstParagraphCheckboxVersion,
|
|
43
43
|
values: {
|
|
44
|
-
templateName:
|
|
44
|
+
templateName: l
|
|
45
45
|
}
|
|
46
46
|
}) : /* @__PURE__ */ e(d, {
|
|
47
47
|
...a.deleteConfirmationModalBodyFirstParagraph,
|
|
48
48
|
values: {
|
|
49
|
-
templateName:
|
|
49
|
+
templateName: l
|
|
50
50
|
}
|
|
51
51
|
})
|
|
52
|
-
}), !
|
|
52
|
+
}), !n && /* @__PURE__ */ e(h, {
|
|
53
53
|
as: "p",
|
|
54
54
|
children: /* @__PURE__ */ e(d, {
|
|
55
55
|
...a.deleteConfirmationModalBodySecondParagraph
|
|
56
56
|
})
|
|
57
|
-
}),
|
|
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(
|
|
63
|
+
}) : /* @__PURE__ */ e(F, {
|
|
64
64
|
label: t.formatMessage(a.deleteConfirmationModalBodyInputFieldLabel),
|
|
65
65
|
onChange: (r) => f(r.target.value),
|
|
66
|
-
placeholder:
|
|
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:
|
|
78
|
+
disabled: n ? !i : !y,
|
|
78
79
|
onClick: x,
|
|
79
80
|
size: "large",
|
|
80
|
-
children: t.formatMessage(
|
|
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
|
|
3
|
-
import { useIntl as
|
|
4
|
-
import
|
|
5
|
-
import { jsx as a, jsxs as
|
|
6
|
-
function
|
|
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:
|
|
9
|
-
defaultOpen:
|
|
10
|
-
open:
|
|
8
|
+
onDiscardChanges: C,
|
|
9
|
+
defaultOpen: h = !0,
|
|
10
|
+
open: s = h
|
|
11
11
|
}) {
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
i(),
|
|
16
|
-
}, [i]),
|
|
17
|
-
|
|
18
|
-
}, [
|
|
19
|
-
|
|
20
|
-
}, [
|
|
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:
|
|
24
|
-
open:
|
|
25
|
-
children: /* @__PURE__ */
|
|
26
|
-
onEscapeKeyDown: (
|
|
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(
|
|
30
|
-
...
|
|
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(
|
|
35
|
-
...
|
|
34
|
+
children: /* @__PURE__ */ a(c, {
|
|
35
|
+
...o.unsavedChangesModalBody
|
|
36
36
|
})
|
|
37
37
|
})
|
|
38
|
-
}), /* @__PURE__ */
|
|
38
|
+
}), /* @__PURE__ */ g(e.Footer, {
|
|
39
39
|
children: [/* @__PURE__ */ a(e.Footer.SecondaryButton, {
|
|
40
|
-
onClick:
|
|
40
|
+
onClick: m,
|
|
41
41
|
size: "large",
|
|
42
|
-
|
|
42
|
+
"data-target-id": "Modal.Footer.SecondaryButton-unsavedChangesModalDiscardChangesCTA",
|
|
43
|
+
children: r.formatMessage(o.unsavedChangesModalDiscardChangesCTA)
|
|
43
44
|
}), /* @__PURE__ */ a(e.Footer.PrimaryButton, {
|
|
44
|
-
onClick:
|
|
45
|
+
onClick: d,
|
|
45
46
|
size: "large",
|
|
46
|
-
|
|
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":
|
|
51
|
+
"aria-label": r.formatMessage(o.unsavedChangesModalCloseLabel)
|
|
50
52
|
})]
|
|
51
53
|
})
|
|
52
54
|
});
|
|
53
55
|
}
|
|
54
56
|
export {
|
|
55
|
-
|
|
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.
|
|
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.
|
|
19
|
-
"@box/babel-plugin-target-attributes": "1.
|
|
20
|
-
"@box/blueprint-web": "^12.
|
|
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",
|