@box/metadata-editor 0.56.1 → 0.58.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/esm/lib/components/add-metadata-template-dropdown/add-metadata-template-dropdown.js +20 -19
- package/esm/lib/components/filter-dropdown-menu/filter-dropdown-menu-search.js +16 -15
- package/esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/ai-suggestion-field.js +53 -48
- package/esm/lib/components/metadata-editor-fields/components/update-mode-field-wrapper/update-mode-field-wrapper.js +38 -37
- package/esm/lib/components/metadata-instance-editor/subcomponents/custom-instance/custom-instance.js +29 -27
- package/esm/lib/components/metadata-instance-editor/subcomponents/custom-instance-new-field/custom-instance-new-field.js +15 -13
- package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/metadata-instance-form.js +51 -49
- package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-footer/metadata-instance-form-footer.js +23 -20
- package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/metadata-instance-form-header.js +25 -23
- package/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-footer/metadata-instance-footer.js +15 -13
- package/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-header/metadata-instance-header.js +28 -26
- package/package.json +3 -2
- package/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/types.d.ts +1 -0
- package/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/metadata-instance-form-header.d.ts +1 -1
- package/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/types.d.ts +1 -0
@@ -1,39 +1,40 @@
|
|
1
|
-
import { IconButton as
|
1
|
+
import { IconButton as S } from "@box/blueprint-web";
|
2
2
|
import { Plus as T } from "@box/blueprint-web-assets/icons/Fill";
|
3
3
|
import { Space2 as E } from "@box/blueprint-web-assets/tokens/px-tokens";
|
4
|
-
import { useState as
|
5
|
-
import { useIntl as
|
6
|
-
import { TEMPLATE_CUSTOM_PROPERTIES as
|
4
|
+
import { useState as I, useMemo as L } from "react";
|
5
|
+
import { useIntl as w } from "react-intl";
|
6
|
+
import { TEMPLATE_CUSTOM_PROPERTIES as y } from "../../constants.js";
|
7
7
|
import { FilterDropdownMenu as t } from "../filter-dropdown-menu/index.js";
|
8
8
|
import s from "./messages.js";
|
9
|
-
import { jsxs as
|
10
|
-
const
|
9
|
+
import { jsxs as d, jsx as a } from "react/jsx-runtime";
|
10
|
+
const B = parseInt(E, 10);
|
11
11
|
function j({
|
12
|
-
availableTemplates:
|
13
|
-
onSelect:
|
12
|
+
availableTemplates: n,
|
13
|
+
onSelect: l,
|
14
14
|
selectedTemplates: c
|
15
15
|
}) {
|
16
|
-
const o =
|
17
|
-
|
16
|
+
const o = w(), u = o.formatMessage(s.customMetadataName), m = (e) => e.templateKey === y ? u : e.displayName, [r, p] = I(""), i = L(() => n.filter((e) => m(e).toLowerCase().includes(r.toLowerCase())), [n, r]), g = r.length > 0 && i.length === 0, f = (e) => c.some((M) => M.id === e.id), h = (e) => {
|
17
|
+
l(e);
|
18
18
|
};
|
19
|
-
return /* @__PURE__ */
|
19
|
+
return /* @__PURE__ */ d(t.Root, {
|
20
20
|
resetValueOnHide: !0,
|
21
|
-
setValue:
|
21
|
+
setValue: p,
|
22
22
|
children: [/* @__PURE__ */ a(t.Trigger, {
|
23
|
-
triggerButton: /* @__PURE__ */ a(
|
23
|
+
triggerButton: /* @__PURE__ */ a(S, {
|
24
24
|
"aria-label": o.formatMessage(s.addMetadataTemplatesTriggerButtonLabel),
|
25
25
|
icon: T,
|
26
|
-
size: "x-small"
|
26
|
+
size: "x-small",
|
27
|
+
"data-target-id": "IconButton-addMetadataTemplatesTriggerButtonLabel"
|
27
28
|
})
|
28
|
-
}), /* @__PURE__ */
|
29
|
-
gutter:
|
29
|
+
}), /* @__PURE__ */ d(t.Content, {
|
30
|
+
gutter: B,
|
30
31
|
children: [/* @__PURE__ */ a(t.Search, {
|
31
32
|
placeholder: o.formatMessage(s.addMetadataTemplatesSearchPlaceholder)
|
32
33
|
}), /* @__PURE__ */ a(t.List, {
|
33
|
-
children:
|
34
|
-
disabled:
|
34
|
+
children: g ? /* @__PURE__ */ a(t.EmptyState, {}) : i.map((e) => /* @__PURE__ */ a(t.Item, {
|
35
|
+
disabled: f(e),
|
35
36
|
onClick: () => h(e),
|
36
|
-
value:
|
37
|
+
value: m(e)
|
37
38
|
}, e.id))
|
38
39
|
})]
|
39
40
|
})]
|
@@ -1,36 +1,37 @@
|
|
1
|
-
import { Combobox as
|
1
|
+
import { Combobox as n, ComboboxCancel as s } from "@ariakit/react";
|
2
2
|
import { IconButton as l, Divider as i } from "@box/blueprint-web";
|
3
3
|
import { Search as m, XMark as p } from "@box/blueprint-web-assets/icons/Fill";
|
4
|
-
import { IconIconOnLightSecondary as
|
5
|
-
import { useIntl as
|
4
|
+
import { IconIconOnLightSecondary as u, IconCtaIcon as d } from "@box/blueprint-web-assets/tokens/tokens";
|
5
|
+
import { useIntl as h } from "react-intl";
|
6
6
|
import { s as o } from "../../../../chunks/filter-dropdown-menu.module.js";
|
7
|
-
import
|
8
|
-
import { jsxs as r, Fragment as
|
7
|
+
import I from "./messages.js";
|
8
|
+
import { jsxs as r, Fragment as f, jsx as e } from "react/jsx-runtime";
|
9
9
|
const b = () => /* @__PURE__ */ e(p, {
|
10
10
|
role: "presentation"
|
11
11
|
}), x = (a) => {
|
12
12
|
const {
|
13
|
-
...
|
14
|
-
} = a,
|
15
|
-
return /* @__PURE__ */ r(
|
13
|
+
...t
|
14
|
+
} = a, c = h().formatMessage(I.cancelButtonAriaLabel);
|
15
|
+
return /* @__PURE__ */ r(f, {
|
16
16
|
children: [/* @__PURE__ */ r("div", {
|
17
17
|
className: o.search,
|
18
18
|
children: [/* @__PURE__ */ e(m, {
|
19
19
|
className: o.searchIcon,
|
20
|
-
color:
|
20
|
+
color: u,
|
21
21
|
role: "presentation"
|
22
|
-
}), /* @__PURE__ */ e(
|
22
|
+
}), /* @__PURE__ */ e(n, {
|
23
23
|
"aria-haspopup": "false",
|
24
24
|
autoSelect: !0,
|
25
25
|
className: o.searchInput,
|
26
|
-
...
|
27
|
-
}), /* @__PURE__ */ e(
|
26
|
+
...t
|
27
|
+
}), /* @__PURE__ */ e(s, {
|
28
28
|
render: /* @__PURE__ */ e(l, {
|
29
|
-
"aria-label":
|
29
|
+
"aria-label": c,
|
30
30
|
className: o.clearSearchIcon,
|
31
|
-
color:
|
31
|
+
color: d,
|
32
32
|
icon: b,
|
33
|
-
size: "x-small"
|
33
|
+
size: "x-small",
|
34
|
+
"data-target-id": "IconButton-cancelButtonAriaLabel"
|
34
35
|
})
|
35
36
|
})]
|
36
37
|
}), /* @__PURE__ */ e(i, {
|
@@ -1,72 +1,77 @@
|
|
1
1
|
import "../../../../../../styles/ai-suggestion-field.css";
|
2
|
-
import { Text as
|
3
|
-
import { Checkmark as u, Ellipsis as
|
4
|
-
import { useIntl as
|
5
|
-
import
|
6
|
-
import { formatSuggestionValue as
|
2
|
+
import { Text as g, IconButton as l, DropdownMenu as t } from "@box/blueprint-web";
|
3
|
+
import { Checkmark as u, Ellipsis as S } from "@box/blueprint-web-assets/icons/Fill";
|
4
|
+
import { useIntl as h, FormattedMessage as a } from "react-intl";
|
5
|
+
import r from "./messages.js";
|
6
|
+
import { formatSuggestionValue as w } from "./utils.js";
|
7
7
|
import { jsx as e, jsxs as i } from "react/jsx-runtime";
|
8
|
-
const
|
9
|
-
wrapperGradient:
|
10
|
-
wrapper:
|
11
|
-
buttons:
|
12
|
-
selectTrigger:
|
8
|
+
const I = "_wrapperGradient_1izxt_1", _ = "_wrapper_1izxt_1", f = "_buttons_1izxt_18", x = "_selectTrigger_1izxt_22", n = {
|
9
|
+
wrapperGradient: I,
|
10
|
+
wrapper: _,
|
11
|
+
buttons: f,
|
12
|
+
selectTrigger: x
|
13
13
|
};
|
14
|
-
function
|
15
|
-
aiSuggestion:
|
14
|
+
function D({
|
15
|
+
aiSuggestion: c,
|
16
16
|
onAiSuggestionAppend: s,
|
17
|
-
onAiSuggestionReplace:
|
18
|
-
onAiSuggestionIgnore:
|
19
|
-
type:
|
17
|
+
onAiSuggestionReplace: p,
|
18
|
+
onAiSuggestionIgnore: d,
|
19
|
+
type: m
|
20
20
|
}) {
|
21
|
-
const
|
21
|
+
const o = h();
|
22
22
|
return /* @__PURE__ */ e("div", {
|
23
|
-
className:
|
23
|
+
className: n.wrapperGradient,
|
24
24
|
children: /* @__PURE__ */ i("div", {
|
25
|
-
className:
|
25
|
+
className: n.wrapper,
|
26
26
|
children: [/* @__PURE__ */ i("div", {
|
27
|
-
children: [/* @__PURE__ */ e(
|
27
|
+
children: [/* @__PURE__ */ e(g, {
|
28
28
|
as: "p",
|
29
29
|
color: "textOnLightSecondary",
|
30
30
|
variant: "caption",
|
31
|
-
children: /* @__PURE__ */ e(
|
32
|
-
...
|
31
|
+
children: /* @__PURE__ */ e(a, {
|
32
|
+
...r.aiSuggestionCaption
|
33
33
|
})
|
34
|
-
}), /* @__PURE__ */ e(
|
34
|
+
}), /* @__PURE__ */ e(g, {
|
35
35
|
as: "p",
|
36
|
-
children:
|
37
|
-
type:
|
38
|
-
locale:
|
36
|
+
children: w(c, {
|
37
|
+
type: m,
|
38
|
+
locale: o.locale
|
39
39
|
})
|
40
40
|
})]
|
41
41
|
}), /* @__PURE__ */ i("div", {
|
42
|
-
className:
|
43
|
-
children: [/* @__PURE__ */ e(
|
44
|
-
"aria-label":
|
42
|
+
className: n.buttons,
|
43
|
+
children: [/* @__PURE__ */ e(l, {
|
44
|
+
"aria-label": o.formatMessage(r.aiSuggestionAppend),
|
45
45
|
icon: u,
|
46
46
|
onClick: s,
|
47
|
-
size: "x-small"
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
47
|
+
size: "x-small",
|
48
|
+
"data-target-id": "IconButton-aiSuggestionAppend"
|
49
|
+
}), /* @__PURE__ */ i(t.Root, {
|
50
|
+
children: [/* @__PURE__ */ e(t.Trigger, {
|
51
|
+
className: n.selectTrigger,
|
52
|
+
children: /* @__PURE__ */ e(l, {
|
53
|
+
"aria-label": o.formatMessage(r.aiSuggestionOptions),
|
54
|
+
icon: S,
|
55
|
+
"data-target-id": "IconButton-aiSuggestionOptions"
|
54
56
|
})
|
55
|
-
}), /* @__PURE__ */ i(
|
56
|
-
children: [/* @__PURE__ */ e(
|
57
|
+
}), /* @__PURE__ */ i(t.Content, {
|
58
|
+
children: [/* @__PURE__ */ e(t.Item, {
|
57
59
|
onSelect: s,
|
58
|
-
|
59
|
-
|
60
|
+
"data-target-id": "DropdownMenu.Item-aiSuggestionAppend",
|
61
|
+
children: /* @__PURE__ */ e(a, {
|
62
|
+
...r.aiSuggestionAppend
|
60
63
|
})
|
61
|
-
}), /* @__PURE__ */ e(
|
62
|
-
onSelect:
|
63
|
-
|
64
|
-
|
64
|
+
}), /* @__PURE__ */ e(t.Item, {
|
65
|
+
onSelect: p,
|
66
|
+
"data-target-id": "DropdownMenu.Item-aiSuggestionClearAndReplace",
|
67
|
+
children: /* @__PURE__ */ e(a, {
|
68
|
+
...r.aiSuggestionClearAndReplace
|
65
69
|
})
|
66
|
-
}), /* @__PURE__ */ e(
|
67
|
-
onSelect:
|
68
|
-
|
69
|
-
|
70
|
+
}), /* @__PURE__ */ e(t.Separator, {}), /* @__PURE__ */ e(t.Item, {
|
71
|
+
onSelect: d,
|
72
|
+
"data-target-id": "DropdownMenu.Item-aiSuggestionIgnore",
|
73
|
+
children: /* @__PURE__ */ e(a, {
|
74
|
+
...r.aiSuggestionIgnore
|
70
75
|
})
|
71
76
|
})]
|
72
77
|
})]
|
@@ -76,5 +81,5 @@ function N({
|
|
76
81
|
});
|
77
82
|
}
|
78
83
|
export {
|
79
|
-
|
84
|
+
D as AiSuggestionField
|
80
85
|
};
|
@@ -1,90 +1,91 @@
|
|
1
1
|
import "../../../../../../styles/update-mode-field-wrapper.css";
|
2
|
-
import { IconButton as
|
2
|
+
import { IconButton as F, Radio as l } from "@box/blueprint-web";
|
3
3
|
import { Settings as I, XMark as R } from "@box/blueprint-web-assets/icons/Fill";
|
4
4
|
import w from "clsx";
|
5
|
-
import { useFormikContext as
|
6
|
-
import _, { useState as
|
7
|
-
import { useIntl as
|
8
|
-
import { U as
|
5
|
+
import { useFormikContext as A, getIn as C, Field as E } from "formik";
|
6
|
+
import _, { useState as S } from "react";
|
7
|
+
import { useIntl as B } from "react-intl";
|
8
|
+
import { U as d } from "../../../../../../chunks/types.js";
|
9
9
|
import { messages as n } from "./messages.js";
|
10
10
|
import { jsxs as s, jsx as o } from "react/jsx-runtime";
|
11
|
-
const
|
12
|
-
wrapperContianer:
|
13
|
-
fieldContainer:
|
14
|
-
field:
|
11
|
+
const N = "_wrapperContianer_1n09p_1", U = "_fieldContainer_1n09p_6", $ = "_field_1n09p_6", k = "_collapseButton_1n09p_13", x = "_radioContainer_1n09p_19", G = "_additionalFieldContainer_1n09p_22", V = "_hidden_1n09p_26", t = {
|
12
|
+
wrapperContianer: N,
|
13
|
+
fieldContainer: U,
|
14
|
+
field: $,
|
15
15
|
collapseButton: k,
|
16
16
|
radioContainer: x,
|
17
17
|
additionalFieldContainer: G,
|
18
18
|
hidden: V
|
19
|
-
}, j = (e) => e ===
|
19
|
+
}, j = (e) => e === d.ReplaceEntered, y = (e) => e === "string" || e === "multiSelect", L = ({
|
20
20
|
children: e,
|
21
|
-
fieldNamePrefix:
|
21
|
+
fieldNamePrefix: i,
|
22
22
|
fieldType: f
|
23
23
|
}) => {
|
24
24
|
const {
|
25
25
|
setFieldValue: g,
|
26
26
|
values: m
|
27
|
-
} =
|
27
|
+
} = A(), [p, M] = S(!0), a = B(), u = `${i}.updateMode.mode`, h = C(m, u), r = e && _.Children.only(e), v = C(m, `${i}.options`, []).map(({
|
28
28
|
key: c
|
29
29
|
}) => c);
|
30
30
|
return /* @__PURE__ */ s("div", {
|
31
|
-
className:
|
31
|
+
className: t.wrapperContianer,
|
32
32
|
children: [/* @__PURE__ */ s("div", {
|
33
|
-
className:
|
33
|
+
className: t.fieldContainer,
|
34
34
|
children: [/* @__PURE__ */ o("span", {
|
35
|
-
className:
|
35
|
+
className: t.field,
|
36
36
|
children: e
|
37
|
-
}), /* @__PURE__ */ o(
|
38
|
-
"aria-label":
|
39
|
-
className:
|
37
|
+
}), /* @__PURE__ */ o(F, {
|
38
|
+
"aria-label": a.formatMessage(n.toggleUpdateModeSelectiorAriaLabel),
|
39
|
+
className: t.collapseButton,
|
40
40
|
"data-testid": `${r.props.label}-update-mode-toggle`,
|
41
41
|
icon: p ? I : R,
|
42
42
|
onClick: () => {
|
43
43
|
M(!p);
|
44
44
|
},
|
45
|
-
size: "small"
|
45
|
+
size: "small",
|
46
|
+
"data-target-id": "IconButton-toggleUpdateModeSelectiorAriaLabel"
|
46
47
|
})]
|
47
48
|
}), /* @__PURE__ */ s("div", {
|
48
|
-
className: w(
|
49
|
-
[
|
49
|
+
className: w(t.radioContainer, {
|
50
|
+
[t.hidden]: p
|
50
51
|
}),
|
51
|
-
children: [/* @__PURE__ */ o(
|
52
|
-
name: `${
|
52
|
+
children: [/* @__PURE__ */ o(E, {
|
53
|
+
name: `${i}.updateMode.mode`,
|
53
54
|
children: ({
|
54
55
|
field: c
|
55
56
|
}) => /* @__PURE__ */ s(l.Group, {
|
56
57
|
"data-testid": `${r.props.label}-radio-group`,
|
57
58
|
loop: !0,
|
58
|
-
onValueChange: (
|
59
|
+
onValueChange: (b) => g(u, b),
|
59
60
|
orientation: "vertical",
|
60
61
|
value: c.value,
|
61
62
|
children: [y(f) && /* @__PURE__ */ o(l.Item, {
|
62
|
-
label:
|
63
|
-
value:
|
63
|
+
label: a.formatMessage(n.append),
|
64
|
+
value: d.Append
|
64
65
|
}), /* @__PURE__ */ o(l.Item, {
|
65
|
-
label:
|
66
|
-
value:
|
66
|
+
label: a.formatMessage(n.clearAndReplace),
|
67
|
+
value: d.ClearAndReplace
|
67
68
|
}), /* @__PURE__ */ o(l.Item, {
|
68
|
-
label:
|
69
|
-
value:
|
69
|
+
label: a.formatMessage(n.removeEntered),
|
70
|
+
value: d.RemoveEntered
|
70
71
|
}), /* @__PURE__ */ o(l.Item, {
|
71
|
-
label:
|
72
|
-
value:
|
72
|
+
label: a.formatMessage(n.replaceEntered),
|
73
|
+
value: d.ReplaceEntered
|
73
74
|
})]
|
74
75
|
})
|
75
76
|
}), j(h) && r && /* @__PURE__ */ o("div", {
|
76
|
-
className:
|
77
|
+
className: t.additionalFieldContainer,
|
77
78
|
children: /* @__PURE__ */ _.cloneElement(r, {
|
78
79
|
// This field edits ${fieldNamePrefix}.updateMode.value, the '.value' is added by the field component
|
79
|
-
fieldNamePrefix: `${
|
80
|
+
fieldNamePrefix: `${i}.updateMode`,
|
80
81
|
options: v,
|
81
|
-
label:
|
82
|
+
label: a.formatMessage(n.with)
|
82
83
|
})
|
83
84
|
})]
|
84
85
|
})]
|
85
86
|
});
|
86
87
|
};
|
87
|
-
|
88
|
+
L.displayName = "UpdateModeFieldWrapper";
|
88
89
|
export {
|
89
|
-
|
90
|
+
L as UpdateModeFieldWrapper
|
90
91
|
};
|
package/esm/lib/components/metadata-instance-editor/subcomponents/custom-instance/custom-instance.js
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
import "../../../../../../styles/custom-instance.css";
|
2
2
|
import { useFormikContext as A, FieldArray as N, Field as k } from "formik";
|
3
|
-
import { useState as I, useRef as
|
3
|
+
import { useState as I, useRef as v, useEffect as y } from "react";
|
4
4
|
import { useIntl as C } from "react-intl";
|
5
|
-
import { TextInput as q, IconButton as
|
6
|
-
import { Trash as
|
7
|
-
import { CustomInstanceNewField as
|
8
|
-
import { fieldDefaultProps as
|
9
|
-
import
|
5
|
+
import { TextInput as q, IconButton as B, TextButton as T } from "@box/blueprint-web";
|
6
|
+
import { Trash as w } from "@box/blueprint-web-assets/icons/Line";
|
7
|
+
import { CustomInstanceNewField as M } from "../custom-instance-new-field/custom-instance-new-field.js";
|
8
|
+
import { fieldDefaultProps as R } from "../../../metadata-editor-fields/components/constants.js";
|
9
|
+
import d from "./messages.js";
|
10
10
|
import { jsx as t, jsxs as p } from "react/jsx-runtime";
|
11
|
-
const
|
12
|
-
customInstance:
|
13
|
-
customInstanceField:
|
11
|
+
const V = "_customInstance_xq8r7_1", j = "_customInstanceField_xq8r7_7", P = "_customInstanceFieldInput_xq8r7_12", z = "_customInstanceFieldIcon_xq8r7_16", c = {
|
12
|
+
customInstance: V,
|
13
|
+
customInstanceField: j,
|
14
14
|
customInstanceFieldInput: P,
|
15
15
|
customInstanceFieldIcon: z
|
16
16
|
}, Q = (F) => {
|
@@ -18,19 +18,19 @@ const j = "_customInstance_xq8r7_1", B = "_customInstanceField_xq8r7_7", P = "_c
|
|
18
18
|
isLoading: l
|
19
19
|
} = F, {
|
20
20
|
values: e
|
21
|
-
} = A(), i = C(), [
|
22
|
-
|
23
|
-
},
|
24
|
-
|
25
|
-
}, f =
|
26
|
-
return
|
21
|
+
} = A(), i = C(), [m, o] = I(!e.metadata.fields.length), [u, r] = I(0), h = () => {
|
22
|
+
r(e.metadata.fields.length);
|
23
|
+
}, b = (a) => {
|
24
|
+
r(a === 0 ? 0 : a - 1);
|
25
|
+
}, f = v(null);
|
26
|
+
return y(() => {
|
27
27
|
e.metadata.fields.length > 0 ? f.current.focus() : o(!0);
|
28
28
|
}, [u, e.metadata.fields.length]), /* @__PURE__ */ t("div", {
|
29
29
|
children: /* @__PURE__ */ t(N, {
|
30
30
|
name: "metadata.fields",
|
31
31
|
children: ({
|
32
32
|
remove: a,
|
33
|
-
push:
|
33
|
+
push: _
|
34
34
|
}) => /* @__PURE__ */ p("div", {
|
35
35
|
className: c.customInstance,
|
36
36
|
children: [e == null ? void 0 : e.metadata.fields.map((s, n) => /* @__PURE__ */ p("div", {
|
@@ -43,40 +43,42 @@ const j = "_customInstance_xq8r7_1", B = "_customInstanceField_xq8r7_7", P = "_c
|
|
43
43
|
field: g,
|
44
44
|
meta: x
|
45
45
|
}) => /* @__PURE__ */ t(q, {
|
46
|
-
...
|
46
|
+
...R,
|
47
47
|
...g,
|
48
48
|
ref: n === u ? f : null,
|
49
49
|
disabled: l,
|
50
50
|
error: x.error,
|
51
51
|
label: s.key,
|
52
|
-
placeholder: i.formatMessage(
|
52
|
+
placeholder: i.formatMessage(d.setValuePlaceholder)
|
53
53
|
})
|
54
54
|
})
|
55
|
-
}), /* @__PURE__ */ t(
|
56
|
-
"aria-label": i.formatMessage(
|
55
|
+
}), /* @__PURE__ */ t(B, {
|
56
|
+
"aria-label": i.formatMessage(d.removeAttribute, {
|
57
57
|
fieldName: s.key
|
58
58
|
}),
|
59
59
|
className: c.customInstanceFieldIcon,
|
60
60
|
disabled: l,
|
61
|
-
icon:
|
61
|
+
icon: w,
|
62
62
|
onClick: () => {
|
63
|
-
a(n),
|
63
|
+
a(n), b(n);
|
64
64
|
},
|
65
|
-
size: "x-small"
|
65
|
+
size: "x-small",
|
66
|
+
"data-target-id": "IconButton-removeAttribute"
|
66
67
|
})]
|
67
|
-
}, s.key)),
|
68
|
+
}, s.key)), m && /* @__PURE__ */ t(M, {
|
68
69
|
formKeys: e.metadata.fields.map((s) => s.key),
|
69
70
|
onAdd: (s, n) => {
|
70
|
-
|
71
|
+
_({
|
71
72
|
key: s,
|
72
73
|
value: n
|
73
74
|
}), h(), o(!1);
|
74
75
|
},
|
75
76
|
onCancel: () => o(!1)
|
76
|
-
}), !
|
77
|
+
}), !m && /* @__PURE__ */ t(T, {
|
77
78
|
disabled: l,
|
78
79
|
onClick: () => o(!0),
|
79
|
-
|
80
|
+
"data-target-id": "TextButton-addAttribute",
|
81
|
+
children: i.formatMessage(d.addAttribute)
|
80
82
|
})]
|
81
83
|
})
|
82
84
|
})
|
@@ -1,24 +1,24 @@
|
|
1
1
|
import "../../../../../../styles/custom-instance-new-field.css";
|
2
|
-
import { Card as
|
2
|
+
import { Card as y, TextInput as m, Button as u } from "@box/blueprint-web";
|
3
3
|
import { useState as l } from "react";
|
4
|
-
import { useIntl as
|
4
|
+
import { useIntl as v } from "react-intl";
|
5
5
|
import t from "./messages.js";
|
6
6
|
import { jsxs as p, jsx as a } from "react/jsx-runtime";
|
7
7
|
const M = "_customInstanceNewFieldCard_1m7z1_1", _ = "_customInstanceNewFieldFooter_1m7z1_6", b = "_inputWrapper_1m7z1_13", n = {
|
8
8
|
customInstanceNewFieldCard: M,
|
9
9
|
customInstanceNewFieldFooter: _,
|
10
10
|
inputWrapper: b
|
11
|
-
},
|
11
|
+
}, E = (g) => {
|
12
12
|
const {
|
13
|
-
onAdd:
|
14
|
-
onCancel:
|
13
|
+
onAdd: f,
|
14
|
+
onCancel: F,
|
15
15
|
formKeys: c = []
|
16
|
-
} =
|
17
|
-
|
18
|
-
},
|
19
|
-
r ? r.startsWith("$") ? o(e.formatMessage(t.customErrorInternalKey)) : c.includes(r) ? o(e.formatMessage(t.customErrorDuplicateKey)) :
|
16
|
+
} = g, e = v(), [r, h] = l(""), [i, C] = l(""), [d, o] = l(""), N = c.length !== 0, I = (s) => {
|
17
|
+
h(s), d && o("");
|
18
|
+
}, w = () => {
|
19
|
+
r ? r.startsWith("$") ? o(e.formatMessage(t.customErrorInternalKey)) : c.includes(r) ? o(e.formatMessage(t.customErrorDuplicateKey)) : f(r, i) : o(e.formatMessage(t.keyFieldRequiredError));
|
20
20
|
};
|
21
|
-
return /* @__PURE__ */ p(
|
21
|
+
return /* @__PURE__ */ p(y, {
|
22
22
|
"aria-label": e.formatMessage(t.addAttributeGroupAriaLabel),
|
23
23
|
className: n.customInstanceNewFieldCard,
|
24
24
|
"data-testid": "customInstanceNewField",
|
@@ -45,17 +45,19 @@ const M = "_customInstanceNewFieldCard_1m7z1_1", _ = "_customInstanceNewFieldFoo
|
|
45
45
|
}), /* @__PURE__ */ p("div", {
|
46
46
|
className: n.customInstanceNewFieldFooter,
|
47
47
|
children: [N && /* @__PURE__ */ a(u, {
|
48
|
-
onClick:
|
48
|
+
onClick: F,
|
49
49
|
variant: "secondary",
|
50
|
+
"data-target-id": "Button-cancelCTA",
|
50
51
|
children: e.formatMessage(t.cancelCTA)
|
51
52
|
}), /* @__PURE__ */ a(u, {
|
52
|
-
onClick:
|
53
|
+
onClick: w,
|
53
54
|
variant: "primary",
|
55
|
+
"data-target-id": "Button-addNewFieldCTA",
|
54
56
|
children: e.formatMessage(t.addNewFieldCTA)
|
55
57
|
})]
|
56
58
|
})]
|
57
59
|
});
|
58
60
|
};
|
59
61
|
export {
|
60
|
-
|
62
|
+
E as CustomInstanceNewField
|
61
63
|
};
|
@@ -1,56 +1,57 @@
|
|
1
1
|
import "../../../../../../styles/metadata-instance-form.css";
|
2
2
|
import { Card as N } from "@box/blueprint-web";
|
3
|
-
import { Formik as T, Form as
|
4
|
-
import { useState as d, useRef as
|
5
|
-
import { TEMPLATE_CUSTOM_PROPERTIES as
|
6
|
-
import { useAutofill as
|
7
|
-
import { TemplateInstance as
|
8
|
-
import { MetadataEmptyState as
|
9
|
-
import { UnsavedChangesModal as
|
10
|
-
import { CustomInstance as
|
11
|
-
import { DeleteConfirmationModal as
|
12
|
-
import { MetadataInstanceFormFooter as
|
13
|
-
import { MetadataInstanceFormHeader as
|
14
|
-
import { createJSONPatch as
|
3
|
+
import { Formik as T, Form as P } from "formik";
|
4
|
+
import { useState as d, useRef as U, useEffect as _, useMemo as x } from "react";
|
5
|
+
import { TEMPLATE_CUSTOM_PROPERTIES as L } from "../../../../constants.js";
|
6
|
+
import { useAutofill as R } from "../../../../utils/autofill-context.js";
|
7
|
+
import { TemplateInstance as j } from "../../../metadata-editor-fields/metadata-editor-fields.js";
|
8
|
+
import { MetadataEmptyState as B } from "../../../metadata-empty-state/metadata-empty-state.js";
|
9
|
+
import { UnsavedChangesModal as k } from "../../../unsaved-changes-modal/unsaved-changes-modal.js";
|
10
|
+
import { CustomInstance as w } from "../custom-instance/custom-instance.js";
|
11
|
+
import { DeleteConfirmationModal as H } from "../delete-confirmation-modal/delete-confirmation-modal.js";
|
12
|
+
import { MetadataInstanceFormFooter as J } from "../metadata-instance-form-footer/metadata-instance-form-footer.js";
|
13
|
+
import { MetadataInstanceFormHeader as K } from "../metadata-instance-form-header/metadata-instance-form-header.js";
|
14
|
+
import { createJSONPatch as V } from "./utils.js";
|
15
15
|
import { jsx as n, jsxs as f } from "react/jsx-runtime";
|
16
|
-
const
|
17
|
-
metadataInstanceForm:
|
18
|
-
},
|
16
|
+
const q = "_metadataInstanceForm_1hu4u_1", z = {
|
17
|
+
metadataInstanceForm: q
|
18
|
+
}, re = (u) => {
|
19
19
|
const {
|
20
|
+
areAiSuggestionsAvailable: p,
|
20
21
|
isAiSuggestionsFeatureEnabled: o,
|
21
|
-
isDeleteButtonDisabled:
|
22
|
-
isUnsavedChangesModalOpen:
|
23
|
-
onCancel:
|
24
|
-
onDelete:
|
25
|
-
onSubmit:
|
22
|
+
isDeleteButtonDisabled: g,
|
23
|
+
isUnsavedChangesModalOpen: C = !1,
|
24
|
+
onCancel: h,
|
25
|
+
onDelete: F,
|
26
|
+
onSubmit: M,
|
26
27
|
selectedTemplateInstance: e,
|
27
28
|
setIsUnsavedChangesModalOpen: s,
|
28
|
-
onUnsavedChangesModalCancel:
|
29
|
-
} = u, [
|
29
|
+
onUnsavedChangesModalCancel: S
|
30
|
+
} = u, [I, m] = d(!1), {
|
30
31
|
isFetchingSuggestions: a,
|
31
|
-
getAiSuggestions:
|
32
|
-
} =
|
33
|
-
await
|
34
|
-
},
|
35
|
-
t ? s(!0) :
|
32
|
+
getAiSuggestions: E
|
33
|
+
} = R(), i = e.templateKey === L, r = async (t) => {
|
34
|
+
await M(t, V(t, e)), s(!1);
|
35
|
+
}, A = (t) => {
|
36
|
+
t ? s(!0) : h();
|
36
37
|
}, D = () => {
|
37
38
|
m(!0);
|
38
39
|
}, b = {
|
39
40
|
metadata: {
|
40
41
|
...e
|
41
42
|
}
|
42
|
-
}, l =
|
43
|
-
|
44
|
-
|
43
|
+
}, l = U(null), [c, y] = d(null);
|
44
|
+
_(() => {
|
45
|
+
y(l.current);
|
45
46
|
}, []);
|
46
|
-
const
|
47
|
+
const O = x(() => {
|
47
48
|
const t = e.fields.length === 0;
|
48
|
-
return i ? /* @__PURE__ */ n(
|
49
|
+
return i ? /* @__PURE__ */ n(w, {
|
49
50
|
isLoading: a
|
50
|
-
}) : t ? /* @__PURE__ */ n(
|
51
|
+
}) : t ? /* @__PURE__ */ n(B, {
|
51
52
|
isBoxAiSuggestionsFeatureEnabled: o,
|
52
53
|
level: "instance"
|
53
|
-
}) : /* @__PURE__ */ n(
|
54
|
+
}) : /* @__PURE__ */ n(j, {
|
54
55
|
disableForm: a,
|
55
56
|
portalElement: c
|
56
57
|
});
|
@@ -60,36 +61,37 @@ const V = "_metadataInstanceForm_1hu4u_1", q = {
|
|
60
61
|
onSubmit: r,
|
61
62
|
children: ({
|
62
63
|
values: t,
|
63
|
-
dirty:
|
64
|
-
}) => /* @__PURE__ */ f(
|
64
|
+
dirty: v
|
65
|
+
}) => /* @__PURE__ */ f(P, {
|
65
66
|
children: [/* @__PURE__ */ f(N, {
|
66
67
|
ref: l,
|
67
|
-
className:
|
68
|
-
children: [/* @__PURE__ */ n(
|
68
|
+
className: z.metadataInstanceForm,
|
69
|
+
children: [/* @__PURE__ */ n(K, {
|
70
|
+
areAiSuggestionsAvailable: p,
|
69
71
|
isAiSuggestionsFeatureEnabled: o && !i,
|
70
72
|
isLoading: a,
|
71
|
-
onAutofill:
|
73
|
+
onAutofill: E,
|
72
74
|
templateName: e.displayName
|
73
|
-
}),
|
74
|
-
isDeleteButtonDisabled:
|
75
|
+
}), O, /* @__PURE__ */ n(J, {
|
76
|
+
isDeleteButtonDisabled: g,
|
75
77
|
isLoading: a,
|
76
|
-
onCancel: () =>
|
78
|
+
onCancel: () => A(v),
|
77
79
|
onDelete: D
|
78
80
|
})]
|
79
|
-
}), /* @__PURE__ */ n(
|
80
|
-
onCancel:
|
81
|
+
}), /* @__PURE__ */ n(k, {
|
82
|
+
onCancel: S,
|
81
83
|
onDismiss: () => s(!1),
|
82
84
|
onSaveAndContinue: () => r(t),
|
83
|
-
open:
|
84
|
-
}), /* @__PURE__ */ n(
|
85
|
-
onConfirm: () =>
|
85
|
+
open: C
|
86
|
+
}), /* @__PURE__ */ n(H, {
|
87
|
+
onConfirm: () => F(e),
|
86
88
|
onDismiss: () => m(!1),
|
87
|
-
open:
|
89
|
+
open: I,
|
88
90
|
templateName: e.displayName
|
89
91
|
})]
|
90
92
|
})
|
91
93
|
});
|
92
94
|
};
|
93
95
|
export {
|
94
|
-
|
96
|
+
re as MetadataInstanceForm
|
95
97
|
};
|
@@ -1,45 +1,48 @@
|
|
1
1
|
import "../../../../../../styles/metadata-instance-form-footer.css";
|
2
2
|
import { TextButton as b, Button as r } from "@box/blueprint-web";
|
3
|
-
import { useFormikContext as
|
4
|
-
import { useIntl as
|
3
|
+
import { useFormikContext as g } from "formik";
|
4
|
+
import { useIntl as B } from "react-intl";
|
5
5
|
import o from "./messages.js";
|
6
6
|
import { jsx as e, jsxs as i } from "react/jsx-runtime";
|
7
|
-
const
|
8
|
-
metadataInstanceFormFooter:
|
9
|
-
buttonsContainer:
|
10
|
-
buttons:
|
7
|
+
const F = "_metadataInstanceFormFooter_17478_1", f = "_buttonsContainer_17478_8", _ = "_buttons_17478_8", n = {
|
8
|
+
metadataInstanceFormFooter: F,
|
9
|
+
buttonsContainer: f,
|
10
|
+
buttons: _
|
11
11
|
}, M = ({
|
12
|
-
isDeleteButtonDisabled:
|
13
|
-
isLoading:
|
14
|
-
onCancel:
|
15
|
-
onDelete:
|
12
|
+
isDeleteButtonDisabled: d,
|
13
|
+
isLoading: m,
|
14
|
+
onCancel: c,
|
15
|
+
onDelete: l
|
16
16
|
}) => {
|
17
|
-
const t =
|
17
|
+
const t = B(), {
|
18
18
|
isSubmitting: s,
|
19
19
|
submitForm: u
|
20
|
-
} =
|
20
|
+
} = g(), a = m || s;
|
21
21
|
return /* @__PURE__ */ e("div", {
|
22
|
-
className:
|
22
|
+
className: n.metadataInstanceFormFooter,
|
23
23
|
children: /* @__PURE__ */ i("div", {
|
24
|
-
className:
|
24
|
+
className: n.buttonsContainer,
|
25
25
|
children: [/* @__PURE__ */ e(b, {
|
26
|
-
disabled:
|
27
|
-
onClick:
|
26
|
+
disabled: a || d,
|
27
|
+
onClick: l,
|
28
|
+
"data-target-id": "TextButton-deleteButton",
|
28
29
|
children: t.formatMessage(o.deleteButton)
|
29
30
|
}), /* @__PURE__ */ i("div", {
|
30
|
-
className:
|
31
|
+
className: n.buttons,
|
31
32
|
children: [/* @__PURE__ */ e(r, {
|
32
|
-
disabled:
|
33
|
-
onClick:
|
33
|
+
disabled: a,
|
34
|
+
onClick: c,
|
34
35
|
size: "large",
|
35
36
|
variant: "secondary",
|
37
|
+
"data-target-id": "Button-cancelButton",
|
36
38
|
children: t.formatMessage(o.cancelButton)
|
37
39
|
}), /* @__PURE__ */ e(r, {
|
38
|
-
disabled:
|
40
|
+
disabled: a,
|
39
41
|
loading: s,
|
40
42
|
loadingAriaLabel: t.formatMessage(o.loadingAriaLabel),
|
41
43
|
onClick: u,
|
42
44
|
size: "large",
|
45
|
+
"data-target-id": "Button-saveButton",
|
43
46
|
children: t.formatMessage(o.saveButton)
|
44
47
|
})]
|
45
48
|
})]
|
@@ -1,48 +1,50 @@
|
|
1
1
|
import "../../../../../../styles/metadata-instance-form-header.css";
|
2
2
|
import { Text as h, Tooltip as F, Button as x } from "@box/blueprint-web";
|
3
|
-
import { BoxAiLogo as
|
4
|
-
import { useFormikContext as
|
5
|
-
import { useIntl as
|
3
|
+
import { BoxAiLogo as M } from "@box/blueprint-web-assets/icons/Logo";
|
4
|
+
import { useFormikContext as _, getIn as n } from "formik";
|
5
|
+
import { useIntl as y } from "react-intl";
|
6
6
|
import e from "./messages.js";
|
7
|
-
import { jsxs as
|
8
|
-
const
|
9
|
-
metadataInstanceFormHeader:
|
10
|
-
title:
|
11
|
-
},
|
12
|
-
|
7
|
+
import { jsxs as H, jsx as a } from "react/jsx-runtime";
|
8
|
+
const v = "_metadataInstanceFormHeader_1b2cc_1", A = "_title_1b2cc_8", i = {
|
9
|
+
metadataInstanceFormHeader: v,
|
10
|
+
title: A
|
11
|
+
}, S = ({
|
12
|
+
areAiSuggestionsAvailable: l,
|
13
|
+
isAiSuggestionsFeatureEnabled: r,
|
13
14
|
isLoading: o,
|
14
|
-
templateName:
|
15
|
-
onAutofill:
|
15
|
+
templateName: m,
|
16
|
+
onAutofill: c
|
16
17
|
}) => {
|
17
18
|
const {
|
18
|
-
isSubmitting:
|
19
|
+
isSubmitting: d,
|
19
20
|
values: s,
|
20
|
-
setFieldValue:
|
21
|
-
} =
|
22
|
-
const
|
23
|
-
|
24
|
-
},
|
25
|
-
return /* @__PURE__ */
|
21
|
+
setFieldValue: u
|
22
|
+
} = _(), t = y(), f = async () => {
|
23
|
+
const B = n(s, "metadata.fields"), I = n(s, "metadata.templateKey"), b = await c(I, B);
|
24
|
+
u("metadata.fields", b);
|
25
|
+
}, g = m ?? t.formatMessage(e.customInstanceTitle), p = !l || d || o;
|
26
|
+
return /* @__PURE__ */ H("div", {
|
26
27
|
className: i.metadataInstanceFormHeader,
|
27
28
|
children: [/* @__PURE__ */ a(h, {
|
28
29
|
as: "h1",
|
29
30
|
className: i.title,
|
30
31
|
variant: "titleMedium",
|
31
|
-
children:
|
32
|
-
}),
|
32
|
+
children: g
|
33
|
+
}), r && /* @__PURE__ */ a(F, {
|
33
34
|
content: t.formatMessage(e.autofillButtonTooltip),
|
34
35
|
children: /* @__PURE__ */ a(x, {
|
35
|
-
disabled:
|
36
|
-
icon:
|
36
|
+
disabled: p,
|
37
|
+
icon: M,
|
37
38
|
loading: o,
|
38
39
|
loadingAriaLabel: t.formatMessage(e.loadingButtonAriaLabel),
|
39
40
|
onClick: f,
|
40
41
|
variant: "secondary",
|
42
|
+
"data-target-id": "Button-autofillButton",
|
41
43
|
children: t.formatMessage(e.autofillButton)
|
42
44
|
})
|
43
45
|
})]
|
44
46
|
});
|
45
47
|
};
|
46
48
|
export {
|
47
|
-
|
49
|
+
S as MetadataInstanceFormHeader
|
48
50
|
};
|
@@ -1,30 +1,32 @@
|
|
1
1
|
import "../../../../../../styles/metadata-instance-footer.css";
|
2
|
-
import { TextButton as
|
2
|
+
import { TextButton as o } from "@box/blueprint-web";
|
3
3
|
import { useIntl as c } from "react-intl";
|
4
4
|
import s from "./messages.js";
|
5
5
|
import { jsx as t } from "react/jsx-runtime";
|
6
|
-
const i = "_metadataInstanceFooter_6auqo_1",
|
6
|
+
const i = "_metadataInstanceFooter_6auqo_1", u = "_button_6auqo_5", a = {
|
7
7
|
metadataInstanceFooter: i,
|
8
|
-
button:
|
9
|
-
},
|
8
|
+
button: u
|
9
|
+
}, f = ({
|
10
10
|
isAnyEmptyValueHidden: n,
|
11
11
|
onHideEmptyValues: r,
|
12
12
|
onShowEmptyValues: m
|
13
13
|
}) => {
|
14
|
-
const
|
14
|
+
const e = c();
|
15
15
|
return /* @__PURE__ */ t("div", {
|
16
|
-
className:
|
17
|
-
children: n ? /* @__PURE__ */ t(
|
18
|
-
className:
|
16
|
+
className: a.metadataInstanceFooter,
|
17
|
+
children: n ? /* @__PURE__ */ t(o, {
|
18
|
+
className: a.button,
|
19
19
|
onClick: m,
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
"data-target-id": "TextButton-showEmptyValuesCTA",
|
21
|
+
children: e.formatMessage(s.showEmptyValuesCTA)
|
22
|
+
}) : /* @__PURE__ */ t(o, {
|
23
|
+
className: a.button,
|
23
24
|
onClick: r,
|
24
|
-
|
25
|
+
"data-target-id": "TextButton-hideEmptyValuesCTA",
|
26
|
+
children: e.formatMessage(s.hideEmptyValuesCTA)
|
25
27
|
})
|
26
28
|
});
|
27
29
|
};
|
28
30
|
export {
|
29
|
-
|
31
|
+
f as MetadataInstanceFooter
|
30
32
|
};
|
@@ -1,52 +1,54 @@
|
|
1
1
|
import "../../../../../../styles/metadata-instance-header.css";
|
2
|
-
import { Text as
|
3
|
-
import { Pencil as
|
2
|
+
import { Text as f, Tooltip as i, IconButton as s } from "@box/blueprint-web";
|
3
|
+
import { Pencil as g } from "@box/blueprint-web-assets/icons/Line";
|
4
4
|
import { BoxAiLogo as b } from "@box/blueprint-web-assets/icons/Logo";
|
5
|
-
import { useIntl as
|
5
|
+
import { useIntl as I } from "react-intl";
|
6
6
|
import o from "./messages.js";
|
7
|
-
import { jsxs as r, jsx as
|
8
|
-
const
|
9
|
-
metadataInstanceHeader:
|
10
|
-
iconButtonsContainer:
|
7
|
+
import { jsxs as r, jsx as a } from "react/jsx-runtime";
|
8
|
+
const p = "_metadataInstanceHeader_1vbbg_1", _ = "_iconButtonsContainer_1vbbg_7", h = "_title_1vbbg_15", e = {
|
9
|
+
metadataInstanceHeader: p,
|
10
|
+
iconButtonsContainer: _,
|
11
11
|
title: h
|
12
|
-
},
|
12
|
+
}, T = ({
|
13
13
|
canEdit: c,
|
14
14
|
isAiSuggestionsFeatureEnabled: l,
|
15
|
-
onEdit:
|
16
|
-
onAutofill:
|
17
|
-
templateName:
|
15
|
+
onEdit: d,
|
16
|
+
onAutofill: m,
|
17
|
+
templateName: n
|
18
18
|
}) => {
|
19
|
-
const t =
|
19
|
+
const t = I(), u = n || t.formatMessage(o.customInstanceTitle), B = l && n;
|
20
20
|
return /* @__PURE__ */ r("div", {
|
21
|
-
className:
|
22
|
-
children: [/* @__PURE__ */
|
21
|
+
className: e.metadataInstanceHeader,
|
22
|
+
children: [/* @__PURE__ */ a(f, {
|
23
23
|
as: "h1",
|
24
|
-
className:
|
24
|
+
className: e.title,
|
25
25
|
variant: "titleMedium",
|
26
26
|
children: u
|
27
27
|
}), c && /* @__PURE__ */ r("div", {
|
28
|
-
className:
|
29
|
-
children: [
|
28
|
+
className: e.iconButtonsContainer,
|
29
|
+
children: [B && /* @__PURE__ */ a(i, {
|
30
30
|
content: t.formatMessage(o.autofillButtonTooltip),
|
31
|
-
children: /* @__PURE__ */
|
31
|
+
children: /* @__PURE__ */ a(s, {
|
32
32
|
"aria-label": t.formatMessage(o.autofillButtonAriaLabel),
|
33
33
|
icon: b,
|
34
|
-
onClick:
|
35
|
-
variant: "icon-logo"
|
34
|
+
onClick: m,
|
35
|
+
variant: "icon-logo",
|
36
|
+
"data-target-id": "IconButton-autofillButtonAriaLabel"
|
36
37
|
})
|
37
|
-
}), /* @__PURE__ */
|
38
|
+
}), /* @__PURE__ */ a(i, {
|
38
39
|
content: t.formatMessage(o.editButtonTooltip),
|
39
|
-
children: /* @__PURE__ */
|
40
|
+
children: /* @__PURE__ */ a(s, {
|
40
41
|
"aria-label": t.formatMessage(o.editButtonAriaLabel, {
|
41
|
-
templateName:
|
42
|
+
templateName: n
|
42
43
|
}),
|
43
|
-
icon:
|
44
|
-
onClick:
|
44
|
+
icon: g,
|
45
|
+
onClick: d,
|
46
|
+
"data-target-id": "IconButton-editButtonAriaLabel"
|
45
47
|
})
|
46
48
|
})]
|
47
49
|
})]
|
48
50
|
});
|
49
51
|
};
|
50
52
|
export {
|
51
|
-
|
53
|
+
T as MetadataInstanceHeader
|
52
54
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@box/metadata-editor",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.58.0",
|
4
4
|
"peerDependencies": {
|
5
5
|
"@ariakit/react": "0.4.5",
|
6
6
|
"@box/blueprint-web": "^7.20.0",
|
@@ -13,6 +13,7 @@
|
|
13
13
|
},
|
14
14
|
"devDependencies": {
|
15
15
|
"@ariakit/react": "0.4.5",
|
16
|
+
"@box/babel-plugin-target-attributes": "1.3.0",
|
16
17
|
"@box/blueprint-web": "^7.30.1",
|
17
18
|
"@box/blueprint-web-assets": "^4.25.0",
|
18
19
|
"@box/storybook-utils": "^0.6.1",
|
@@ -52,5 +53,5 @@
|
|
52
53
|
"**/*.css"
|
53
54
|
],
|
54
55
|
"license": "SEE LICENSE IN LICENSE",
|
55
|
-
"gitHead": "
|
56
|
+
"gitHead": "94397e9a7efb1301c59eac9df44fe32b263f4aa5"
|
56
57
|
}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { type MetadataFormFieldValue, type MetadataTemplateInstance } from '../../../../types';
|
2
2
|
import { type FormValues } from '../../types';
|
3
3
|
export type MetadataInstanceFormProps = {
|
4
|
+
areAiSuggestionsAvailable: boolean;
|
4
5
|
isAiSuggestionsFeatureEnabled: boolean;
|
5
6
|
isDeleteButtonDisabled: boolean;
|
6
7
|
isUnsavedChangesModalOpen: boolean;
|
@@ -1,2 +1,2 @@
|
|
1
1
|
import { type MetadataInstanceFormHeaderProps } from './types';
|
2
|
-
export declare const MetadataInstanceFormHeader: ({ isAiSuggestionsFeatureEnabled, isLoading, templateName, onAutofill, }: MetadataInstanceFormHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
2
|
+
export declare const MetadataInstanceFormHeader: ({ areAiSuggestionsAvailable, isAiSuggestionsFeatureEnabled, isLoading, templateName, onAutofill, }: MetadataInstanceFormHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { type MetadataTemplateField, type MetadataTemplateInstance } from '../../../../types';
|
2
2
|
export type MetadataInstanceFormHeaderProps = {
|
3
|
+
areAiSuggestionsAvailable: boolean;
|
3
4
|
isAiSuggestionsFeatureEnabled: boolean;
|
4
5
|
isLoading: boolean;
|
5
6
|
onAutofill?: (templateKey: MetadataTemplateInstance['templateKey'], fields: MetadataTemplateField[]) => Promise<MetadataTemplateField[]>;
|