@box/metadata-editor 1.8.0 → 1.8.2
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,73 +1,73 @@
|
|
|
1
1
|
import { ComboboxWithApiTreeView as w, ComboboxWithApiPagination as A } from "@box/combobox-with-api";
|
|
2
2
|
import { useFormikContext as K, getIn as V, Field as $ } from "formik";
|
|
3
|
-
import { forwardRef as j } from "react";
|
|
4
|
-
import { useIntl as
|
|
5
|
-
import
|
|
6
|
-
import { g as
|
|
3
|
+
import { forwardRef as j, useCallback as D } from "react";
|
|
4
|
+
import { useIntl as E } from "react-intl";
|
|
5
|
+
import R from "../../../../messages.js";
|
|
6
|
+
import { g as y } from "../../../../../../chunks/utils2.js";
|
|
7
7
|
import { jsx as e } from "react/jsx-runtime";
|
|
8
|
-
const
|
|
8
|
+
const O = /* @__PURE__ */ j(({
|
|
9
9
|
description: r,
|
|
10
10
|
disableForm: i,
|
|
11
|
-
isAiSuggestionApplied:
|
|
12
|
-
fieldNamePrefix:
|
|
11
|
+
isAiSuggestionApplied: l,
|
|
12
|
+
fieldNamePrefix: m,
|
|
13
13
|
label: a,
|
|
14
14
|
portalElement: d,
|
|
15
|
-
taxonomyOptionsFetcher:
|
|
16
|
-
updateModePrefix:
|
|
17
|
-
className:
|
|
18
|
-
isMultilevelTaxonomyFieldEnabled:
|
|
19
|
-
},
|
|
20
|
-
const
|
|
21
|
-
setFieldValue:
|
|
22
|
-
values:
|
|
15
|
+
taxonomyOptionsFetcher: u,
|
|
16
|
+
updateModePrefix: F,
|
|
17
|
+
className: s,
|
|
18
|
+
isMultilevelTaxonomyFieldEnabled: M
|
|
19
|
+
}, c) => {
|
|
20
|
+
const k = E(), h = `${F ?? m}.value`, {
|
|
21
|
+
setFieldValue: I,
|
|
22
|
+
values: p
|
|
23
23
|
} = K(), {
|
|
24
24
|
metadata: {
|
|
25
|
-
templateKey:
|
|
26
|
-
scope:
|
|
25
|
+
templateKey: g,
|
|
26
|
+
scope: x
|
|
27
27
|
}
|
|
28
|
-
} =
|
|
29
|
-
key:
|
|
28
|
+
} = p, P = V(p, m), {
|
|
29
|
+
key: f,
|
|
30
30
|
optionsRules: {
|
|
31
31
|
multiSelect: n,
|
|
32
32
|
selectableLevels: t
|
|
33
33
|
},
|
|
34
|
-
levels:
|
|
35
|
-
} = P,
|
|
36
|
-
|
|
34
|
+
levels: W
|
|
35
|
+
} = P, v = M && (t == null ? void 0 : t.some((o) => o > 1)), C = D((o) => u(x, g, f, t == null ? void 0 : t[0], o), [f, x, t, u, g]), b = (o) => n || !(o != null && o.length) ? k.formatMessage(R.taxonomyPlaceholder) : void 0, T = (o) => {
|
|
36
|
+
I(h, o);
|
|
37
37
|
};
|
|
38
38
|
return /* @__PURE__ */ e("div", {
|
|
39
39
|
"data-testid": `${a}-field`,
|
|
40
40
|
onKeyDown: (o) => o.stopPropagation(),
|
|
41
41
|
role: "presentation",
|
|
42
42
|
children: /* @__PURE__ */ e($, {
|
|
43
|
-
name:
|
|
43
|
+
name: h,
|
|
44
44
|
children: ({
|
|
45
45
|
field: o
|
|
46
|
-
}) =>
|
|
47
|
-
ref:
|
|
48
|
-
className:
|
|
49
|
-
closeOnSelection:
|
|
46
|
+
}) => v ? /* @__PURE__ */ e(w, {
|
|
47
|
+
ref: c,
|
|
48
|
+
className: s,
|
|
49
|
+
closeOnSelection: v,
|
|
50
50
|
dataTargetId: "ComboboxWithApiTreeView-MetadataEditorTaxonomyField",
|
|
51
|
-
defaultFetcher:
|
|
51
|
+
defaultFetcher: C,
|
|
52
52
|
disabled: i,
|
|
53
|
-
label:
|
|
54
|
-
levels:
|
|
53
|
+
label: y(a, r, l),
|
|
54
|
+
levels: W,
|
|
55
55
|
multiselect: n,
|
|
56
|
-
onValueChange:
|
|
57
|
-
placeholder:
|
|
56
|
+
onValueChange: T,
|
|
57
|
+
placeholder: b(o.value),
|
|
58
58
|
portalElement: d,
|
|
59
59
|
selectableLevels: t,
|
|
60
60
|
value: o.value
|
|
61
61
|
}) : /* @__PURE__ */ e(A, {
|
|
62
|
-
ref:
|
|
63
|
-
className:
|
|
62
|
+
ref: c,
|
|
63
|
+
className: s,
|
|
64
64
|
dataTargetId: "ComboboxWithApiPagination-MetadataEditorTaxonomyField",
|
|
65
|
-
defaultFetcher:
|
|
65
|
+
defaultFetcher: C,
|
|
66
66
|
disabled: i,
|
|
67
|
-
label:
|
|
67
|
+
label: y(a, r, l),
|
|
68
68
|
multiselect: n,
|
|
69
|
-
onValueChange:
|
|
70
|
-
placeholder:
|
|
69
|
+
onValueChange: T,
|
|
70
|
+
placeholder: b(o.value),
|
|
71
71
|
portalElement: d,
|
|
72
72
|
value: o.value
|
|
73
73
|
})
|
|
@@ -75,5 +75,5 @@ const H = /* @__PURE__ */ j(({
|
|
|
75
75
|
});
|
|
76
76
|
});
|
|
77
77
|
export {
|
|
78
|
-
|
|
78
|
+
O as MetadataTaxonomyField
|
|
79
79
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/metadata-editor",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.2",
|
|
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.8.
|
|
18
|
+
"@box/box-ai-agent-selector": "^1.8.1",
|
|
19
19
|
"@box/babel-plugin-target-attributes": "1.3.0",
|
|
20
|
-
"@box/blueprint-web": "^12.
|
|
20
|
+
"@box/blueprint-web": "^12.95.0",
|
|
21
21
|
"@box/blueprint-web-assets": "^4.79.0",
|
|
22
22
|
"@box/storybook-utils": "^0.14.16",
|
|
23
23
|
"@testing-library/react": "^15.0.6",
|