@box/metadata-editor 0.98.1 → 0.98.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,22 +1,22 @@
|
|
|
1
1
|
import { IconButton as b, Radio as i } from "@box/blueprint-web";
|
|
2
|
-
import { Settings as
|
|
3
|
-
import
|
|
4
|
-
import { useFormikContext as
|
|
5
|
-
import C, { useState as
|
|
6
|
-
import { useIntl as
|
|
2
|
+
import { Settings as y, XMark as A } from "@box/blueprint-web-assets/icons/Fill";
|
|
3
|
+
import E from "clsx";
|
|
4
|
+
import { useFormikContext as R, getIn as _, Field as U } from "formik";
|
|
5
|
+
import C, { useState as q } from "react";
|
|
6
|
+
import { useIntl as w } from "react-intl";
|
|
7
7
|
import { U as r } from "../../../../../../chunks/types.js";
|
|
8
8
|
import { messages as l } from "./messages.js";
|
|
9
|
-
import { MULTI_VALUE_DEFAULT_OPTION as
|
|
9
|
+
import { MULTI_VALUE_DEFAULT_OPTION as S } from "./mulitple-values-utils.js";
|
|
10
10
|
import { jsxs as p, jsx as o } from "react/jsx-runtime";
|
|
11
|
-
import '../../../../../../styles/update-mode-field-wrapper.css';const
|
|
12
|
-
wrapperContianer:
|
|
13
|
-
fieldContainer:
|
|
14
|
-
field:
|
|
15
|
-
collapseButton:
|
|
16
|
-
radioContainer:
|
|
17
|
-
additionalFieldContainer:
|
|
18
|
-
hidden:
|
|
19
|
-
},
|
|
11
|
+
import '../../../../../../styles/update-mode-field-wrapper.css';const B = "_wrapperContianer_19nqy_1", N = "_fieldContainer_19nqy_6", $ = "_field_19nqy_6", L = "_collapseButton_19nqy_14", O = "_radioContainer_19nqy_20", V = "_additionalFieldContainer_19nqy_23", k = "_hidden_19nqy_27", t = {
|
|
12
|
+
wrapperContianer: B,
|
|
13
|
+
fieldContainer: N,
|
|
14
|
+
field: $,
|
|
15
|
+
collapseButton: L,
|
|
16
|
+
radioContainer: O,
|
|
17
|
+
additionalFieldContainer: V,
|
|
18
|
+
hidden: k
|
|
19
|
+
}, x = (e) => e === r.ReplaceEntered, G = (e, a) => e === "string" || e === "multiSelect" || a, j = ({
|
|
20
20
|
children: e,
|
|
21
21
|
fieldNamePrefix: a,
|
|
22
22
|
fieldType: f,
|
|
@@ -25,7 +25,7 @@ import '../../../../../../styles/update-mode-field-wrapper.css';const $ = "_wrap
|
|
|
25
25
|
const {
|
|
26
26
|
setFieldValue: M,
|
|
27
27
|
values: m
|
|
28
|
-
} =
|
|
28
|
+
} = R(), [c, h] = q(!0), n = w(), u = `${a}.updateMode.mode`, v = _(m, u), s = e && C.Children.only(e), I = _(m, `${a}.options`, []).filter((d) => d.id !== S.id).map(({
|
|
29
29
|
key: d
|
|
30
30
|
}) => d);
|
|
31
31
|
return /* @__PURE__ */ p("div", {
|
|
@@ -39,7 +39,7 @@ import '../../../../../../styles/update-mode-field-wrapper.css';const $ = "_wrap
|
|
|
39
39
|
"aria-label": n.formatMessage(l.toggleUpdateModeSelectiorAriaLabel),
|
|
40
40
|
className: t.collapseButton,
|
|
41
41
|
"data-testid": `${s.props.label}-update-mode-toggle`,
|
|
42
|
-
icon: c ?
|
|
42
|
+
icon: c ? y : A,
|
|
43
43
|
onClick: () => {
|
|
44
44
|
h(!c);
|
|
45
45
|
},
|
|
@@ -47,10 +47,10 @@ import '../../../../../../styles/update-mode-field-wrapper.css';const $ = "_wrap
|
|
|
47
47
|
"data-target-id": "IconButton-toggleUpdateModeSelectiorAriaLabel"
|
|
48
48
|
})]
|
|
49
49
|
}), /* @__PURE__ */ p("div", {
|
|
50
|
-
className:
|
|
50
|
+
className: E(t.radioContainer, {
|
|
51
51
|
[t.hidden]: c
|
|
52
52
|
}),
|
|
53
|
-
children: [/* @__PURE__ */ o(
|
|
53
|
+
children: [/* @__PURE__ */ o(U, {
|
|
54
54
|
name: `${a}.updateMode.mode`,
|
|
55
55
|
children: ({
|
|
56
56
|
field: d
|
|
@@ -60,7 +60,7 @@ import '../../../../../../styles/update-mode-field-wrapper.css';const $ = "_wrap
|
|
|
60
60
|
onValueChange: (F) => M(u, F),
|
|
61
61
|
orientation: "vertical",
|
|
62
62
|
value: d.value,
|
|
63
|
-
children: [
|
|
63
|
+
children: [G(f, g) && /* @__PURE__ */ o(i.Item, {
|
|
64
64
|
label: n.formatMessage(l.append),
|
|
65
65
|
value: r.Append
|
|
66
66
|
}), /* @__PURE__ */ o(i.Item, {
|
|
@@ -74,7 +74,7 @@ import '../../../../../../styles/update-mode-field-wrapper.css';const $ = "_wrap
|
|
|
74
74
|
value: r.ReplaceEntered
|
|
75
75
|
})]
|
|
76
76
|
})
|
|
77
|
-
}),
|
|
77
|
+
}), x(v) && s && /* @__PURE__ */ o("div", {
|
|
78
78
|
className: t.additionalFieldContainer,
|
|
79
79
|
children: /* @__PURE__ */ C.cloneElement(s, {
|
|
80
80
|
// This field edits ${fieldNamePrefix}.updateMode.value, the '.value' is added by the field component
|
|
@@ -86,7 +86,7 @@ import '../../../../../../styles/update-mode-field-wrapper.css';const $ = "_wrap
|
|
|
86
86
|
})]
|
|
87
87
|
});
|
|
88
88
|
};
|
|
89
|
-
|
|
89
|
+
j.displayName = "UpdateModeFieldWrapper";
|
|
90
90
|
export {
|
|
91
|
-
|
|
91
|
+
j as UpdateModeFieldWrapper
|
|
92
92
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._wrapperContianer_19nqy_1{display:flex;flex-direction:column;gap:var(--space-2)}._wrapperContianer_19nqy_1 ._fieldContainer_19nqy_6{display:flex;gap:var(--space-2)}._wrapperContianer_19nqy_1 ._fieldContainer_19nqy_6 ._field_19nqy_6{flex-grow:1;overflow:hidden}._wrapperContianer_19nqy_1 ._fieldContainer_19nqy_6 ._collapseButton_19nqy_14{flex-grow:0;flex-shrink:0;align-self:flex-end;margin-block-end:var(--space-1)}._wrapperContianer_19nqy_1 ._radioContainer_19nqy_20{padding-inline-start:var(--space-2)}._wrapperContianer_19nqy_1 ._radioContainer_19nqy_20 ._additionalFieldContainer_19nqy_23{padding-block-start:var(--space-2);padding-inline-start:var(--space-4)}._wrapperContianer_19nqy_1 ._hidden_19nqy_27{display:none}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/metadata-editor",
|
|
3
|
-
"version": "0.98.
|
|
3
|
+
"version": "0.98.3",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@ariakit/react": "0.4.15",
|
|
6
6
|
"@box/blueprint-web": "^7.30.3",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"@ariakit/react": "0.4.15",
|
|
17
17
|
"@box/babel-plugin-target-attributes": "1.3.0",
|
|
18
|
-
"@box/blueprint-web": "^10.
|
|
18
|
+
"@box/blueprint-web": "^10.1.0",
|
|
19
19
|
"@box/blueprint-web-assets": "^4.37.3",
|
|
20
20
|
"@box/storybook-utils": "^0.9.0",
|
|
21
21
|
"@testing-library/react": "^15.0.6",
|