@box/metadata-editor 0.59.4 → 0.59.6
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,30 +1,31 @@
|
|
|
1
1
|
import "../styles/metadata-editor-field-wrapper.css";
|
|
2
|
-
import
|
|
3
|
-
import { useFormikContext as
|
|
4
|
-
import
|
|
5
|
-
import { useState as
|
|
6
|
-
import { AiSuggestionField as
|
|
7
|
-
import { UpdateModeFieldWrapper as
|
|
8
|
-
import { editorFieldTypes as
|
|
9
|
-
import { jsx as o, jsxs as
|
|
10
|
-
const
|
|
11
|
-
noAttributesText:
|
|
12
|
-
fieldWrapper:
|
|
13
|
-
hasSuggestion:
|
|
14
|
-
error:
|
|
2
|
+
import S from "clsx";
|
|
3
|
+
import { useFormikContext as y } from "formik";
|
|
4
|
+
import F from "lodash/isUndefined";
|
|
5
|
+
import { useState as h } from "react";
|
|
6
|
+
import { AiSuggestionField as A } from "../esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/ai-suggestion-field.js";
|
|
7
|
+
import { UpdateModeFieldWrapper as W } from "../esm/lib/components/metadata-editor-fields/components/update-mode-field-wrapper/update-mode-field-wrapper.js";
|
|
8
|
+
import { editorFieldTypes as M } from "../esm/lib/components/metadata-editor-fields/editor-field-types.js";
|
|
9
|
+
import { jsx as o, jsxs as N } from "react/jsx-runtime";
|
|
10
|
+
const q = "_noAttributesText_1xlmq_1", T = "_fieldWrapper_1xlmq_5", b = "_hasSuggestion_1xlmq_5", v = "_error_1xlmq_13", P = "_dateField_1xlmq_25", a = {
|
|
11
|
+
noAttributesText: q,
|
|
12
|
+
fieldWrapper: T,
|
|
13
|
+
hasSuggestion: b,
|
|
14
|
+
error: v,
|
|
15
|
+
dateField: P
|
|
15
16
|
}, R = ({
|
|
16
17
|
disableForm: n,
|
|
17
|
-
portalElement:
|
|
18
|
+
portalElement: p,
|
|
18
19
|
field: e,
|
|
19
|
-
index:
|
|
20
|
+
index: d
|
|
20
21
|
}) => {
|
|
21
22
|
const {
|
|
22
|
-
setFieldValue:
|
|
23
|
-
} =
|
|
24
|
-
if (!
|
|
23
|
+
setFieldValue: l
|
|
24
|
+
} = y(), [u, i] = h(!0), r = M[e.type], c = r && !e.hidden, g = !F(e.updateMode), s = `metadata.fields[${d}]`;
|
|
25
|
+
if (!c)
|
|
25
26
|
return null;
|
|
26
|
-
if (
|
|
27
|
-
return /* @__PURE__ */ o(
|
|
27
|
+
if (g)
|
|
28
|
+
return /* @__PURE__ */ o(W, {
|
|
28
29
|
fieldNamePrefix: s,
|
|
29
30
|
fieldType: e.type,
|
|
30
31
|
children: /* @__PURE__ */ o(r, {
|
|
@@ -32,38 +33,41 @@ const M = "_noAttributesText_vykxc_1", N = "_fieldWrapper_vykxc_5", T = "_hasSug
|
|
|
32
33
|
disableForm: n,
|
|
33
34
|
fieldNamePrefix: s,
|
|
34
35
|
label: e.displayName,
|
|
35
|
-
portalElement:
|
|
36
|
+
portalElement: p
|
|
36
37
|
})
|
|
37
38
|
}, e.key);
|
|
38
39
|
const {
|
|
39
40
|
aiSuggestion: t,
|
|
40
|
-
type:
|
|
41
|
-
value:
|
|
42
|
-
} = e,
|
|
43
|
-
return /* @__PURE__ */
|
|
44
|
-
className:
|
|
41
|
+
type: _,
|
|
42
|
+
value: f
|
|
43
|
+
} = e, m = t && u;
|
|
44
|
+
return /* @__PURE__ */ N("div", {
|
|
45
|
+
className: a.fieldWrapper,
|
|
45
46
|
children: [/* @__PURE__ */ o(r, {
|
|
46
|
-
className:
|
|
47
|
+
className: S({
|
|
48
|
+
[a.hasSuggestions]: m,
|
|
49
|
+
[a.dateField]: e.type === "date"
|
|
50
|
+
}),
|
|
47
51
|
description: e.description,
|
|
48
52
|
disableForm: n,
|
|
49
|
-
fieldNamePrefix: `metadata.fields[${
|
|
53
|
+
fieldNamePrefix: `metadata.fields[${d}]`,
|
|
50
54
|
label: e.displayName,
|
|
51
|
-
portalElement:
|
|
52
|
-
}),
|
|
55
|
+
portalElement: p
|
|
56
|
+
}), m && /* @__PURE__ */ o(A, {
|
|
53
57
|
aiSuggestion: t,
|
|
54
58
|
onAiSuggestionAppend: () => {
|
|
55
|
-
const
|
|
56
|
-
|
|
59
|
+
const x = e.type === "multiSelect" ? [f, t].flat() : t;
|
|
60
|
+
l(`${s}.value`, x), i(!1);
|
|
57
61
|
},
|
|
58
62
|
onAiSuggestionIgnore: () => i(!1),
|
|
59
63
|
onAiSuggestionReplace: () => {
|
|
60
|
-
|
|
64
|
+
l(`${s}.value`, t), i(!1);
|
|
61
65
|
},
|
|
62
|
-
type:
|
|
66
|
+
type: _
|
|
63
67
|
})]
|
|
64
68
|
}, e.key);
|
|
65
69
|
};
|
|
66
70
|
export {
|
|
67
71
|
R as M,
|
|
68
|
-
|
|
72
|
+
a as s
|
|
69
73
|
};
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/metadata-editor",
|
|
3
|
-
"version": "0.59.
|
|
3
|
+
"version": "0.59.6",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@ariakit/react": "0.4.5",
|
|
6
|
-
"@box/blueprint-web": "^7.
|
|
6
|
+
"@box/blueprint-web": "^7.30.3",
|
|
7
7
|
"@box/blueprint-web-assets": "^4.21.0",
|
|
8
8
|
"formik": "^2.0.3",
|
|
9
9
|
"lodash": "^4.17.15",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"devDependencies": {
|
|
15
15
|
"@ariakit/react": "0.4.5",
|
|
16
16
|
"@box/babel-plugin-target-attributes": "1.3.0",
|
|
17
|
-
"@box/blueprint-web": "^7.31.
|
|
17
|
+
"@box/blueprint-web": "^7.31.3",
|
|
18
18
|
"@box/blueprint-web-assets": "^4.27.0",
|
|
19
19
|
"@box/storybook-utils": "^0.6.1",
|
|
20
20
|
"@testing-library/react": "^15.0.6",
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"**/*.css"
|
|
54
54
|
],
|
|
55
55
|
"license": "SEE LICENSE IN LICENSE",
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "6665cc401f9bb13d7fc81a5a34fc27bc75535d3d"
|
|
57
57
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._noAttributesText_1xlmq_1{text-align:center}._fieldWrapper_1xlmq_5 ._hasSuggestion_1xlmq_5>input,._fieldWrapper_1xlmq_5 ._hasSuggestion_1xlmq_5>button,._fieldWrapper_1xlmq_5 ._hasSuggestion_1xlmq_5>div[role=group]>div,._fieldWrapper_1xlmq_5 ._hasSuggestion_1xlmq_5>div>div{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}._fieldWrapper_1xlmq_5 ._hasSuggestion_1xlmq_5>input:not(:disabled):not(:focus-visible):not(._error_1xlmq_13):hover,._fieldWrapper_1xlmq_5 ._hasSuggestion_1xlmq_5>button:not(:disabled):not(:focus-visible):not(._error_1xlmq_13):hover,._fieldWrapper_1xlmq_5 ._hasSuggestion_1xlmq_5>div[role=group]>div:not(:disabled):not(:focus-visible):not(._error_1xlmq_13):hover,._fieldWrapper_1xlmq_5 ._hasSuggestion_1xlmq_5>div>div:not(:disabled):not(:focus-visible):not(._error_1xlmq_13):hover{border-bottom:none}._fieldWrapper_1xlmq_5 ._hasSuggestion_1xlmq_5 div[role=group]>div{margin-left:var(--border-1);margin-right:var(--border-1)}._fieldWrapper_1xlmq_5 ._dateField_1xlmq_25>div[role=group]>div{padding-inline:.75rem}
|