@box/metadata-editor 0.78.8 → 0.79.0
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.
- package/chunks/utils.js +40 -41
- package/chunks/utils2.js +43 -0
- package/esm/index.js +34 -30
- package/esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/ai-suggestion-field.js +81 -60
- package/esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/messages.js +8 -0
- package/esm/lib/components/metadata-editor-fields/components/metadata-date-field/metadata-date-field.js +1 -1
- package/esm/lib/components/metadata-editor-fields/components/metadata-enum-field/metadata-enum-field.js +1 -1
- package/esm/lib/components/metadata-editor-fields/components/metadata-float-field/metadata-float-field.js +1 -1
- package/esm/lib/components/metadata-editor-fields/components/metadata-multi-select-field/metadata-multi-select-field.js +1 -1
- package/esm/lib/components/metadata-editor-fields/components/metadata-string-field/metadata-string-field.js +1 -1
- package/esm/lib/components/metadata-editor-fields/components/metadata-taxonomy-field/metadata-taxonomy-field.js +1 -1
- package/esm/lib/components/metadata-editor-fields/metadata-editor-field-wrapper.js +51 -50
- package/esm/lib/components/metadata-editor-fields/metadata-editor-fields.js +1 -1
- package/esm/lib/components/metadata-editor-fields/utils.js +1 -1
- package/esm/lib/components/metadata-instance-editor/index.js +12 -8
- package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/metadata-instance-form-card-wrapper.js +40 -0
- package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/metadata-instance-form.js +85 -86
- package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/utils.js +6 -39
- package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-autofill-button/messages.js +18 -0
- package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-autofill-button/metadata-instance-form-autofill-button.js +68 -0
- package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/messages.js +0 -12
- package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/metadata-instance-form-header.js +26 -61
- package/i18n/bn-IN.js +2 -0
- package/i18n/da-DK.js +2 -0
- package/i18n/de-DE.js +2 -0
- package/i18n/en-AU.js +2 -0
- package/i18n/en-CA.js +2 -0
- package/i18n/en-GB.js +2 -0
- package/i18n/en-US.js +2 -0
- package/i18n/en-US.properties +4 -0
- package/i18n/en-x-pseudo.js +2 -0
- package/i18n/es-419.js +2 -0
- package/i18n/es-ES.js +2 -0
- package/i18n/fi-FI.js +2 -0
- package/i18n/fr-CA.js +2 -0
- package/i18n/fr-FR.js +2 -0
- package/i18n/hi-IN.js +2 -0
- package/i18n/it-IT.js +2 -0
- package/i18n/ja-JP.js +2 -0
- package/i18n/json/src/lib/components/metadata-editor-fields/components/ai-suggestion-field/messages.json +1 -1
- package/i18n/json/src/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-autofill-button/messages.json +1 -0
- package/i18n/json/src/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/messages.json +1 -1
- package/i18n/ko-KR.js +2 -0
- package/i18n/nb-NO.js +2 -0
- package/i18n/nl-NL.js +2 -0
- package/i18n/pl-PL.js +2 -0
- package/i18n/pt-BR.js +2 -0
- package/i18n/ru-RU.js +2 -0
- package/i18n/sv-SE.js +2 -0
- package/i18n/tr-TR.js +2 -0
- package/i18n/zh-CN.js +2 -0
- package/i18n/zh-TW.js +2 -0
- package/package.json +3 -3
- package/styles/metadata-instance-form-autofill-button.css +1 -0
- package/types/lib/components/metadata-editor-fields/components/ai-suggestion-field/ai-suggestion-field.d.ts +1 -1
- package/types/lib/components/metadata-editor-fields/components/ai-suggestion-field/messages.d.ts +10 -0
- package/types/lib/components/metadata-editor-fields/components/ai-suggestion-field/types.d.ts +1 -0
- package/types/lib/components/metadata-instance-editor/index.d.ts +3 -1
- package/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/metadata-instance-form-card-wrapper.d.ts +2 -0
- package/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/types.d.ts +20 -3
- package/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-autofill-button/messages.d.ts +18 -0
- package/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-autofill-button/metadata-instance-form-autofill-button.d.ts +2 -0
- package/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-autofill-button/types.d.ts +7 -0
- package/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/messages.d.ts +0 -15
- package/types/lib/types.d.ts +0 -1
- package/types/lib/utils/autofill-context.d.ts +1 -1
package/chunks/utils.js
CHANGED
@@ -1,43 +1,42 @@
|
|
1
|
-
import "
|
2
|
-
import
|
3
|
-
import
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
};
|
1
|
+
import h from "lodash/isEmpty";
|
2
|
+
import O from "lodash/isArray";
|
3
|
+
import { TEMPLATE_CUSTOM_PROPERTIES as f } from "../esm/lib/constants.js";
|
4
|
+
const n = {
|
5
|
+
ADD: "add",
|
6
|
+
REMOVE: "remove",
|
7
|
+
REPLACE: "replace",
|
8
|
+
TEST: "test"
|
9
|
+
}, p = (e) => e.value === void 0 || e.value === null || e.value === "" || O(e.value) && h(e.value), S = (e, a) => {
|
10
|
+
const o = [], c = e.metadata.fields, r = a.templateKey === f, E = new Map(a.fields.map((t) => [t.key, t])), m = new Map(c.map((t) => [t.key, t]));
|
11
|
+
return c.forEach((t) => {
|
12
|
+
const s = E.get(t.key);
|
13
|
+
s ? JSON.stringify(t) === JSON.stringify(s) || (!r && p(s) && !p(t) ? o.push(v(t.key, u(t))) : (
|
14
|
+
// template instance
|
15
|
+
(!r && t.value !== s.value && s.value !== null && !p(t) || // custom instance
|
16
|
+
r && t.value !== s.value) && (o.push(y(s.key, u(s))), o.push(M(t.key, u(t))))
|
17
|
+
)) : o.push(v(t.key, t.value));
|
18
|
+
}), a.fields.forEach((t) => {
|
19
|
+
const s = m.get(t.key);
|
20
|
+
(!s || !r && p(s) && !p(t)) && (o.push(y(t.key, u(t))), o.push(k(t.key)));
|
21
|
+
}), o;
|
22
|
+
}, u = (e) => e.type === "float" ? Number(e.value) : e.type === "taxonomy" ? e.value.map((a) => a.value) : e.value, y = (e, a) => ({
|
23
|
+
op: n.TEST,
|
24
|
+
path: `/${e}`,
|
25
|
+
value: a
|
26
|
+
}), v = (e, a) => ({
|
27
|
+
op: n.ADD,
|
28
|
+
path: `/${e}`,
|
29
|
+
value: a
|
30
|
+
}), k = (e) => ({
|
31
|
+
op: n.REMOVE,
|
32
|
+
path: `/${e}`
|
33
|
+
}), M = (e, a) => ({
|
34
|
+
op: n.REPLACE,
|
35
|
+
path: `/${e}`,
|
36
|
+
value: a
|
37
|
+
});
|
39
38
|
export {
|
40
|
-
|
41
|
-
|
42
|
-
|
39
|
+
n as J,
|
40
|
+
S as c,
|
41
|
+
u as g
|
43
42
|
};
|
package/chunks/utils2.js
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
import "../styles/utils.css";
|
2
|
+
import { BoxAiLogo as s } from "@box/blueprint-web-assets/icons/Logo";
|
3
|
+
import g from "../esm/lib/components/interactive-text/interactive-text.js";
|
4
|
+
import { convertISOStringToUTCDate as i } from "../esm/lib/utils/convertDate.js";
|
5
|
+
import { jsxs as c, jsx as o } from "react/jsx-runtime";
|
6
|
+
const _ = "_noAttributesText_1ggnw_1", p = "_fieldWrapper_1ggnw_5", b = "_hasSuggestion_1ggnw_10", x = "_error_1ggnw_18", d = "_dateField_1ggnw_30", m = "_suggestionApplied_1ggnw_34", u = "_comboboxContainer_1ggnw_34", T = "_labelWrapper_1ggnw_48", w = "_labelText_1ggnw_54", S = "_labelIcon_1ggnw_57", t = {
|
7
|
+
noAttributesText: _,
|
8
|
+
fieldWrapper: p,
|
9
|
+
hasSuggestion: b,
|
10
|
+
error: x,
|
11
|
+
dateField: d,
|
12
|
+
suggestionApplied: m,
|
13
|
+
comboboxContainer: u,
|
14
|
+
labelWrapper: T,
|
15
|
+
labelText: w,
|
16
|
+
labelIcon: S
|
17
|
+
}, C = (e, n, l = !1, a = "label") => (r) => /* @__PURE__ */ c("div", {
|
18
|
+
className: t.labelWrapper,
|
19
|
+
children: [n ? /* @__PURE__ */ o(g, {
|
20
|
+
as: a,
|
21
|
+
className: t.labelText,
|
22
|
+
tooltipText: n,
|
23
|
+
...r,
|
24
|
+
children: e
|
25
|
+
}) : /* @__PURE__ */ o("label", {
|
26
|
+
className: t.labelText,
|
27
|
+
...r,
|
28
|
+
children: e
|
29
|
+
}), l && /* @__PURE__ */ o(s, {
|
30
|
+
className: t.labelIcon
|
31
|
+
})]
|
32
|
+
}), F = (e) => {
|
33
|
+
try {
|
34
|
+
return i(e).toISOString();
|
35
|
+
} catch {
|
36
|
+
return null;
|
37
|
+
}
|
38
|
+
};
|
39
|
+
export {
|
40
|
+
C as g,
|
41
|
+
t as s,
|
42
|
+
F as t
|
43
|
+
};
|
package/esm/index.js
CHANGED
@@ -1,39 +1,43 @@
|
|
1
|
-
import { AddMetadataTemplateDropdown as
|
1
|
+
import { AddMetadataTemplateDropdown as e } from "./lib/components/add-metadata-template-dropdown/add-metadata-template-dropdown.js";
|
2
2
|
import { ComboboxWithApiPagination as r } from "./lib/components/combobox-with-api-pagination/combobox-with-api-pagination.js";
|
3
|
-
import { FilterDropdownMenu as
|
4
|
-
import { FilterInstancesDropdown as
|
3
|
+
import { FilterDropdownMenu as n } from "./lib/components/filter-dropdown-menu/index.js";
|
4
|
+
import { FilterInstancesDropdown as d } from "./lib/components/filter-instances-dropdown/filter-instances-dropdown.js";
|
5
5
|
import { MetadataEmptyState as x } from "./lib/components/metadata-empty-state/metadata-empty-state.js";
|
6
|
-
import {
|
7
|
-
import {
|
8
|
-
import {
|
9
|
-
import {
|
10
|
-
import {
|
11
|
-
import {
|
12
|
-
import {
|
13
|
-
import {
|
14
|
-
import {
|
6
|
+
import { CustomInstanceNewField as l } from "./lib/components/metadata-instance-editor/subcomponents/custom-instance-new-field/custom-instance-new-field.js";
|
7
|
+
import { DeleteConfirmationModal as M } from "./lib/components/metadata-instance-editor/subcomponents/delete-confirmation-modal/delete-confirmation-modal.js";
|
8
|
+
import { MetadataInstanceFormAutofillButton as c } from "./lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-autofill-button/metadata-instance-form-autofill-button.js";
|
9
|
+
import { MetadataInstanceFormHeader as A } from "./lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/metadata-instance-form-header.js";
|
10
|
+
import { MetadataInstanceForm as F } from "./lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/metadata-instance-form.js";
|
11
|
+
import { J as h } from "../chunks/utils.js";
|
12
|
+
import { MetadataInstanceList as P } from "./lib/components/metadata-instance-list/metadata-instance-list.js";
|
13
|
+
import { MetadataInstanceHeader as b } from "./lib/components/metadata-instance-list/subcomponents/metadata-instance-header/metadata-instance-header.js";
|
14
|
+
import { UnsavedChangesModal as v } from "./lib/components/unsaved-changes-modal/unsaved-changes-modal.js";
|
15
|
+
import { defaultInitialValues as H, defaultMetadataValueMap as J } from "./lib/defaults.js";
|
16
|
+
import { MetadataEditor as O } from "./lib/metadata-editor.js";
|
15
17
|
import { U as V } from "../chunks/types.js";
|
16
|
-
import { AutofillContext as y, AutofillContextProvider as
|
17
|
-
import { withApiWrapper as
|
18
|
+
import { AutofillContext as y, AutofillContextProvider as B, useAutofill as L } from "./lib/utils/autofill-context.js";
|
19
|
+
import { withApiWrapper as j } from "./lib/utils/api-wrapper.js";
|
18
20
|
export {
|
19
|
-
|
21
|
+
e as AddMetadataTemplateDropdown,
|
20
22
|
y as AutofillContext,
|
21
|
-
|
23
|
+
B as AutofillContextProvider,
|
22
24
|
r as ComboboxWithApiPagination,
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
25
|
+
l as CustomInstanceNewField,
|
26
|
+
M as DeleteConfirmationModal,
|
27
|
+
n as FilterDropdownMenu,
|
28
|
+
d as FilterInstancesDropdown,
|
29
|
+
h as JSONPatchOp,
|
30
|
+
O as MetadataEditor,
|
28
31
|
x as MetadataEmptyState,
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
32
|
+
F as MetadataInstanceForm,
|
33
|
+
c as MetadataInstanceFormAutofillButton,
|
34
|
+
A as MetadataInstanceFormHeader,
|
35
|
+
b as MetadataInstanceHeader,
|
36
|
+
P as MetadataInstanceList,
|
37
|
+
v as UnsavedChangesModal,
|
34
38
|
V as UpdateMode,
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
+
H as defaultInitialValues,
|
40
|
+
J as defaultMetadataValueMap,
|
41
|
+
L as useAutofill,
|
42
|
+
j as withApiWrapper
|
39
43
|
};
|
@@ -1,81 +1,102 @@
|
|
1
1
|
import "../../../../../../styles/ai-suggestion-field.css";
|
2
|
-
import { Text as
|
3
|
-
import { Checkmark as
|
4
|
-
import { useIntl as
|
5
|
-
import
|
6
|
-
import { formatSuggestionValue as
|
7
|
-
import { jsx as e, jsxs as
|
8
|
-
const
|
9
|
-
wrapperGradient:
|
2
|
+
import { Text as l, IconButton as c, DropdownMenu as a } from "@box/blueprint-web";
|
3
|
+
import { Checkmark as m, Ellipsis as f } from "@box/blueprint-web-assets/icons/Fill";
|
4
|
+
import { useIntl as w, FormattedMessage as r } from "react-intl";
|
5
|
+
import t from "./messages.js";
|
6
|
+
import { formatSuggestionValue as _ } from "./utils.js";
|
7
|
+
import { jsx as e, jsxs as i, Fragment as u } from "react/jsx-runtime";
|
8
|
+
const C = "_wrapperGradient_t2yak_1", I = "_wrapper_t2yak_1", b = "_buttons_t2yak_18", k = "_selectTrigger_t2yak_22", n = {
|
9
|
+
wrapperGradient: C,
|
10
10
|
wrapper: I,
|
11
|
-
buttons:
|
11
|
+
buttons: b,
|
12
12
|
selectTrigger: k
|
13
13
|
};
|
14
14
|
function D({
|
15
|
-
aiSuggestion:
|
16
|
-
onAiSuggestionAppend:
|
17
|
-
onAiSuggestionReplace:
|
18
|
-
onAiSuggestionIgnore:
|
19
|
-
type:
|
15
|
+
aiSuggestion: S,
|
16
|
+
onAiSuggestionAppend: g,
|
17
|
+
onAiSuggestionReplace: d,
|
18
|
+
onAiSuggestionIgnore: p,
|
19
|
+
type: o,
|
20
|
+
isSameValue: h
|
20
21
|
}) {
|
21
|
-
const s =
|
22
|
+
const s = w();
|
22
23
|
return /* @__PURE__ */ e("div", {
|
23
|
-
className:
|
24
|
-
children: /* @__PURE__ */
|
25
|
-
className:
|
26
|
-
children:
|
27
|
-
children: [/* @__PURE__ */ e(
|
24
|
+
className: n.wrapperGradient,
|
25
|
+
children: /* @__PURE__ */ e("div", {
|
26
|
+
className: n.wrapper,
|
27
|
+
children: h ? /* @__PURE__ */ i(u, {
|
28
|
+
children: [/* @__PURE__ */ e(l, {
|
28
29
|
as: "p",
|
29
30
|
color: "textOnLightSecondary",
|
30
31
|
variant: "caption",
|
31
|
-
children: /* @__PURE__ */ e(
|
32
|
-
...
|
32
|
+
children: /* @__PURE__ */ e(r, {
|
33
|
+
...t.sameValueAiSuggestionCaption
|
33
34
|
})
|
34
|
-
}), /* @__PURE__ */ e(
|
35
|
-
|
36
|
-
children:
|
37
|
-
|
38
|
-
|
35
|
+
}), /* @__PURE__ */ e("div", {
|
36
|
+
className: n.buttons,
|
37
|
+
children: /* @__PURE__ */ e(c, {
|
38
|
+
"aria-label": s.formatMessage(t.aiSuggestionConfirm),
|
39
|
+
icon: m,
|
40
|
+
onClick: p,
|
41
|
+
size: "x-small",
|
42
|
+
"data-target-id": "IconButton-aiSuggestionConfirm"
|
39
43
|
})
|
40
44
|
})]
|
41
|
-
})
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
children: [/* @__PURE__ */ e(t.Trigger, {
|
50
|
-
className: o.selectTrigger,
|
51
|
-
children: /* @__PURE__ */ e(d, {
|
52
|
-
"aria-label": s.formatMessage(r.aiSuggestionOptions),
|
53
|
-
icon: S,
|
54
|
-
"data-target-id": "IconButton-aiSuggestionOptions"
|
45
|
+
}) : /* @__PURE__ */ i(u, {
|
46
|
+
children: [/* @__PURE__ */ i("div", {
|
47
|
+
children: [/* @__PURE__ */ e(l, {
|
48
|
+
as: "p",
|
49
|
+
color: "textOnLightSecondary",
|
50
|
+
variant: "caption",
|
51
|
+
children: /* @__PURE__ */ e(r, {
|
52
|
+
...t.aiSuggestionCaption
|
55
53
|
})
|
56
|
-
}), /* @__PURE__ */
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
54
|
+
}), /* @__PURE__ */ e(l, {
|
55
|
+
as: "p",
|
56
|
+
children: _(S, {
|
57
|
+
type: o,
|
58
|
+
locale: s.locale
|
59
|
+
})
|
60
|
+
})]
|
61
|
+
}), /* @__PURE__ */ i("div", {
|
62
|
+
className: n.buttons,
|
63
|
+
children: [/* @__PURE__ */ e(c, {
|
64
|
+
"aria-label": s.formatMessage(o === "multiSelect" ? t.aiSuggestionAppend : t.aiSuggestionClearAndReplace),
|
65
|
+
icon: m,
|
66
|
+
onClick: o === "multiSelect" ? g : d,
|
67
|
+
size: "x-small"
|
68
|
+
}), /* @__PURE__ */ i(a.Root, {
|
69
|
+
children: [/* @__PURE__ */ e(a.Trigger, {
|
70
|
+
className: n.selectTrigger,
|
71
|
+
children: /* @__PURE__ */ e(c, {
|
72
|
+
"aria-label": s.formatMessage(t.aiSuggestionOptions),
|
73
|
+
icon: f,
|
74
|
+
"data-target-id": "IconButton-aiSuggestionOptions"
|
74
75
|
})
|
76
|
+
}), /* @__PURE__ */ i(a.Content, {
|
77
|
+
children: [o === "multiSelect" && /* @__PURE__ */ e(a.Item, {
|
78
|
+
onSelect: g,
|
79
|
+
"data-target-id": "DropdownMenu.Item-aiSuggestionAppend",
|
80
|
+
children: /* @__PURE__ */ e(r, {
|
81
|
+
...t.aiSuggestionAppend
|
82
|
+
})
|
83
|
+
}), /* @__PURE__ */ e(a.Item, {
|
84
|
+
onSelect: d,
|
85
|
+
"data-target-id": "DropdownMenu.Item-aiSuggestionClearAndReplace",
|
86
|
+
children: /* @__PURE__ */ e(r, {
|
87
|
+
...t.aiSuggestionClearAndReplace
|
88
|
+
})
|
89
|
+
}), /* @__PURE__ */ e(a.Separator, {}), /* @__PURE__ */ e(a.Item, {
|
90
|
+
onSelect: p,
|
91
|
+
"data-target-id": "DropdownMenu.Item-aiSuggestionIgnore",
|
92
|
+
children: /* @__PURE__ */ e(r, {
|
93
|
+
...t.aiSuggestionIgnore
|
94
|
+
})
|
95
|
+
})]
|
75
96
|
})]
|
76
97
|
})]
|
77
98
|
})]
|
78
|
-
})
|
99
|
+
})
|
79
100
|
})
|
80
101
|
});
|
81
102
|
}
|
package/esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/messages.js
CHANGED
@@ -4,6 +4,10 @@ const i = e({
|
|
4
4
|
id: "metadataEditor.aiSuggestionField.aiSuggestionCaption",
|
5
5
|
defaultMessage: "Box AI suggestion:"
|
6
6
|
},
|
7
|
+
sameValueAiSuggestionCaption: {
|
8
|
+
id: "metadataEditor.aiSuggestionField.sameValueAiSuggestionCaption",
|
9
|
+
defaultMessage: "Box AI suggests the same value as above"
|
10
|
+
},
|
7
11
|
aiSuggestionOptions: {
|
8
12
|
id: "metadataEditor.aiSuggestionField.aiSuggestionOptions",
|
9
13
|
defaultMessage: "Options"
|
@@ -19,6 +23,10 @@ const i = e({
|
|
19
23
|
aiSuggestionIgnore: {
|
20
24
|
id: "metadataEditor.aiSuggestionField.ignoreLabel",
|
21
25
|
defaultMessage: "Ignore"
|
26
|
+
},
|
27
|
+
aiSuggestionConfirm: {
|
28
|
+
id: "metadataEditor.aiSuggestionField.dismissLabel",
|
29
|
+
defaultMessage: "Confirm"
|
22
30
|
}
|
23
31
|
});
|
24
32
|
export {
|
@@ -4,7 +4,7 @@ import { forwardRef as w, useMemo as S } from "react";
|
|
4
4
|
import { useIntl as V } from "react-intl";
|
5
5
|
import { convertIsoStringToCalendarDate as N, convertCalendarDateToISOString as O } from "../../../../utils/convertDate.js";
|
6
6
|
import a from "../../../../messages.js";
|
7
|
-
import { g as B } from "../../../../../../chunks/
|
7
|
+
import { g as B } from "../../../../../../chunks/utils2.js";
|
8
8
|
import { jsx as t } from "react/jsx-runtime";
|
9
9
|
const H = /* @__PURE__ */ w(({
|
10
10
|
className: i,
|
@@ -3,7 +3,7 @@ import { useFormikContext as C, getIn as L, Field as P } from "formik";
|
|
3
3
|
import { forwardRef as $ } from "react";
|
4
4
|
import { useIntl as b, FormattedMessage as j } from "react-intl";
|
5
5
|
import d from "../../../../messages.js";
|
6
|
-
import { g as w } from "../../../../../../chunks/
|
6
|
+
import { g as w } from "../../../../../../chunks/utils2.js";
|
7
7
|
import { jsx as t, jsxs as I } from "react/jsx-runtime";
|
8
8
|
const U = /* @__PURE__ */ $(({
|
9
9
|
className: i,
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { TextInput as T } from "@box/blueprint-web";
|
2
2
|
import { useFormikContext as V, getIn as $, Field as b } from "formik";
|
3
3
|
import { forwardRef as B, useRef as I } from "react";
|
4
|
-
import { g as M } from "../../../../../../chunks/
|
4
|
+
import { g as M } from "../../../../../../chunks/utils2.js";
|
5
5
|
import { fieldDefaultProps as O } from "../constants.js";
|
6
6
|
import { useFloatValidation as j } from "./use-float-validation.js";
|
7
7
|
import { jsx as r } from "react/jsx-runtime";
|
@@ -3,7 +3,7 @@ import { useFormikContext as x, getIn as M, Field as $ } from "formik";
|
|
3
3
|
import { forwardRef as I } from "react";
|
4
4
|
import { useIntl as j } from "react-intl";
|
5
5
|
import k from "../../../../messages.js";
|
6
|
-
import { g as D } from "../../../../../../chunks/
|
6
|
+
import { g as D } from "../../../../../../chunks/utils2.js";
|
7
7
|
import { fieldDefaultProps as O } from "../constants.js";
|
8
8
|
import { jsx as t } from "react/jsx-runtime";
|
9
9
|
const E = /* @__PURE__ */ I(({
|
@@ -3,7 +3,7 @@ import { Field as g } from "formik";
|
|
3
3
|
import { forwardRef as h } from "react";
|
4
4
|
import { useIntl as F } from "react-intl";
|
5
5
|
import x from "../../../../messages.js";
|
6
|
-
import { g as M } from "../../../../../../chunks/
|
6
|
+
import { g as M } from "../../../../../../chunks/utils2.js";
|
7
7
|
import { fieldDefaultProps as b } from "../constants.js";
|
8
8
|
import { jsx as e } from "react/jsx-runtime";
|
9
9
|
const v = /* @__PURE__ */ h(({
|
@@ -3,7 +3,7 @@ import { forwardRef as $ } from "react";
|
|
3
3
|
import { useIntl as j } from "react-intl";
|
4
4
|
import w from "../../../../messages.js";
|
5
5
|
import { ComboboxWithApiPagination as A } from "../../../combobox-with-api-pagination/combobox-with-api-pagination.js";
|
6
|
-
import { g as K } from "../../../../../../chunks/
|
6
|
+
import { g as K } from "../../../../../../chunks/utils2.js";
|
7
7
|
import { jsx as e } from "react/jsx-runtime";
|
8
8
|
const E = /* @__PURE__ */ $(({
|
9
9
|
description: l,
|
@@ -1,79 +1,80 @@
|
|
1
1
|
import I from "clsx";
|
2
|
-
import { useFormikContext as
|
3
|
-
import
|
4
|
-
import { forwardRef as
|
5
|
-
import { AiSuggestionField as
|
6
|
-
import { UpdateModeFieldWrapper as
|
7
|
-
import { editorFieldTypes as
|
8
|
-
import { s as n } from "../../../../chunks/
|
9
|
-
import { jsx as a, jsxs as
|
10
|
-
const
|
11
|
-
disableForm:
|
12
|
-
portalElement:
|
2
|
+
import { useFormikContext as v } from "formik";
|
3
|
+
import C from "lodash/isUndefined";
|
4
|
+
import { forwardRef as P, useState as N, useCallback as R, useEffect as T, useMemo as U } from "react";
|
5
|
+
import { AiSuggestionField as b } from "./components/ai-suggestion-field/ai-suggestion-field.js";
|
6
|
+
import { UpdateModeFieldWrapper as j } from "./components/update-mode-field-wrapper/update-mode-field-wrapper.js";
|
7
|
+
import { editorFieldTypes as $ } from "./editor-field-types.js";
|
8
|
+
import { s as n } from "../../../../chunks/utils2.js";
|
9
|
+
import { jsx as a, jsxs as B } from "react/jsx-runtime";
|
10
|
+
const X = /* @__PURE__ */ P(({
|
11
|
+
disableForm: g,
|
12
|
+
portalElement: c,
|
13
13
|
field: e,
|
14
|
-
index:
|
15
|
-
taxonomyOptionsFetcher:
|
16
|
-
},
|
17
|
-
var
|
14
|
+
index: V,
|
15
|
+
taxonomyOptionsFetcher: m
|
16
|
+
}, f) => {
|
17
|
+
var M;
|
18
18
|
const {
|
19
|
-
setFieldValue:
|
20
|
-
} =
|
19
|
+
setFieldValue: S
|
20
|
+
} = v(), [A, p] = N(!0), [r, y] = N(!1), l = $[e.type], {
|
21
21
|
aiSuggestion: t,
|
22
|
-
type:
|
23
|
-
value:
|
24
|
-
} = e, W =
|
25
|
-
[n.suggestionApplied]:
|
22
|
+
type: h,
|
23
|
+
value: d
|
24
|
+
} = e, W = l && !e.hidden, k = !C(e.updateMode), s = `metadata.fields[${V}]`, w = e.type === "taxonomy" && ((M = e.optionsRules) == null ? void 0 : M.multiSelect), i = t && A, E = I({
|
25
|
+
[n.suggestionApplied]: r,
|
26
26
|
[n.hasSuggestion]: i,
|
27
|
-
[n.dateField]:
|
28
|
-
}), o =
|
29
|
-
|
30
|
-
}, [s,
|
31
|
-
|
32
|
-
!i ||
|
27
|
+
[n.dateField]: h === "date"
|
28
|
+
}), o = R((u) => {
|
29
|
+
S(`${s}.value`, u), p(!1), y(!0);
|
30
|
+
}, [s, S]);
|
31
|
+
T(() => {
|
32
|
+
!i || d || o(t);
|
33
33
|
}, [i, t, o]);
|
34
|
-
const
|
35
|
-
|
34
|
+
const x = U(() => t && d === t, [A]), F = () => {
|
35
|
+
r && y(!1), x && p(!1);
|
36
36
|
};
|
37
|
-
return W ? k ? /* @__PURE__ */ a(
|
37
|
+
return W ? k ? /* @__PURE__ */ a(j, {
|
38
38
|
fieldNamePrefix: s,
|
39
39
|
fieldType: e.type,
|
40
40
|
isTaxonomyMultiSelect: w,
|
41
|
-
children: /* @__PURE__ */ a(
|
42
|
-
ref:
|
41
|
+
children: /* @__PURE__ */ a(l, {
|
42
|
+
ref: f,
|
43
43
|
description: e.description,
|
44
|
-
disableForm:
|
44
|
+
disableForm: g,
|
45
45
|
fieldNamePrefix: s,
|
46
46
|
isAiSuggestionApplied: !1,
|
47
47
|
label: e.displayName,
|
48
|
-
onValueEdited:
|
49
|
-
portalElement:
|
50
|
-
taxonomyOptionsFetcher:
|
48
|
+
onValueEdited: F,
|
49
|
+
portalElement: c,
|
50
|
+
taxonomyOptionsFetcher: m
|
51
51
|
})
|
52
|
-
}, e.key) : /* @__PURE__ */
|
52
|
+
}, e.key) : /* @__PURE__ */ B("div", {
|
53
53
|
className: n.fieldWrapper,
|
54
|
-
children: [/* @__PURE__ */ a(
|
55
|
-
ref:
|
54
|
+
children: [/* @__PURE__ */ a(l, {
|
55
|
+
ref: f,
|
56
56
|
className: E,
|
57
57
|
description: e.description,
|
58
|
-
disableForm:
|
58
|
+
disableForm: g,
|
59
59
|
fieldNamePrefix: s,
|
60
|
-
isAiSuggestionApplied:
|
60
|
+
isAiSuggestionApplied: r,
|
61
61
|
label: e.displayName,
|
62
|
-
onValueEdited:
|
63
|
-
portalElement:
|
64
|
-
taxonomyOptionsFetcher:
|
65
|
-
}), i && /* @__PURE__ */ a(
|
62
|
+
onValueEdited: F,
|
63
|
+
portalElement: c,
|
64
|
+
taxonomyOptionsFetcher: m
|
65
|
+
}), i && /* @__PURE__ */ a(b, {
|
66
66
|
aiSuggestion: t,
|
67
|
+
isSameValue: x,
|
67
68
|
onAiSuggestionAppend: () => {
|
68
|
-
const
|
69
|
-
o(
|
69
|
+
const u = [...new Set([d, t].flat().filter(Boolean))];
|
70
|
+
o(u);
|
70
71
|
},
|
71
|
-
onAiSuggestionIgnore: () =>
|
72
|
+
onAiSuggestionIgnore: () => p(!1),
|
72
73
|
onAiSuggestionReplace: () => o(t),
|
73
|
-
type:
|
74
|
+
type: h
|
74
75
|
})]
|
75
76
|
}, e.key) : null;
|
76
77
|
});
|
77
78
|
export {
|
78
|
-
|
79
|
+
X as MetadataEditorFieldWrapper
|
79
80
|
};
|
@@ -4,7 +4,7 @@ import { useFormikContext as d, getIn as p, FieldArray as u } from "formik";
|
|
4
4
|
import { FormattedMessage as x } from "react-intl";
|
5
5
|
import g from "../../messages.js";
|
6
6
|
import { MetadataEditorFieldWrapper as h } from "./metadata-editor-field-wrapper.js";
|
7
|
-
import { s as F } from "../../../../chunks/
|
7
|
+
import { s as F } from "../../../../chunks/utils2.js";
|
8
8
|
import { jsx as t } from "react/jsx-runtime";
|
9
9
|
const C = (m) => {
|
10
10
|
const {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import "@box/blueprint-web-assets/icons/Logo";
|
2
2
|
import "../interactive-text/interactive-text.js";
|
3
|
-
import { g as m, t as p } from "../../../../chunks/
|
3
|
+
import { g as m, t as p } from "../../../../chunks/utils2.js";
|
4
4
|
import "../../utils/convertDate.js";
|
5
5
|
import "react/jsx-runtime";
|
6
6
|
export {
|
@@ -1,10 +1,14 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
3
|
-
import {
|
4
|
-
import {
|
1
|
+
import { CustomInstanceNewField as e } from "./subcomponents/custom-instance-new-field/custom-instance-new-field.js";
|
2
|
+
import { DeleteConfirmationModal as r } from "./subcomponents/delete-confirmation-modal/delete-confirmation-modal.js";
|
3
|
+
import { MetadataInstanceFormAutofillButton as n } from "./subcomponents/metadata-instance-form-autofill-button/metadata-instance-form-autofill-button.js";
|
4
|
+
import { MetadataInstanceFormHeader as p } from "./subcomponents/metadata-instance-form-header/metadata-instance-form-header.js";
|
5
|
+
import { MetadataInstanceForm as s } from "./subcomponents/metadata-instance-form/metadata-instance-form.js";
|
6
|
+
import { J as c } from "../../../../chunks/utils.js";
|
5
7
|
export {
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
8
|
+
e as CustomInstanceNewField,
|
9
|
+
r as DeleteConfirmationModal,
|
10
|
+
c as JSONPatchOp,
|
11
|
+
s as MetadataInstanceForm,
|
12
|
+
n as MetadataInstanceFormAutofillButton,
|
13
|
+
p as MetadataInstanceFormHeader
|
10
14
|
};
|