@box/metadata-editor 0.85.0 → 0.85.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.
- package/chunks/filter-dropdown-menu.module.js +4 -5
- package/chunks/index.js +292 -0
- package/chunks/message.js +18 -0
- package/chunks/taxonomy-ancestor-status-pill.js +33 -33
- package/chunks/utils2.js +7 -8
- package/esm/lib/components/add-metadata-template-dropdown/add-metadata-template-dropdown.js +5 -5
- package/esm/lib/components/add-metadata-template-dropdown/messages.js +1 -1
- package/esm/lib/components/combobox-with-api-pagination/combobox-with-api-pagination.js +29 -29
- package/esm/lib/components/combobox-with-api-pagination/messages.js +1 -1
- package/esm/lib/components/filter-dropdown-menu/filter-dropdown-menu-empty-state.js +1 -1
- package/esm/lib/components/filter-dropdown-menu/filter-dropdown-menu-search.js +6 -6
- package/esm/lib/components/filter-dropdown-menu/messages.js +1 -1
- package/esm/lib/components/filter-instances-dropdown/filter-instances-dropdown.js +10 -11
- package/esm/lib/components/filter-instances-dropdown/messages.js +1 -1
- package/esm/lib/components/interactive-header-text/interactive-header-text.js +8 -9
- package/esm/lib/components/interactive-text/interactive-text.js +11 -12
- package/esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/ai-suggestion-field.js +14 -14
- package/esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/messages.js +1 -1
- 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 +28 -27
- package/esm/lib/components/metadata-editor-fields/components/metadata-float-field/use-float-validation.js +6 -6
- package/esm/lib/components/metadata-editor-fields/components/metadata-multi-select-field/metadata-multi-select-field.js +5 -5
- package/esm/lib/components/metadata-editor-fields/components/metadata-string-field/metadata-string-field.js +9 -9
- package/esm/lib/components/metadata-editor-fields/components/metadata-taxonomy-field/metadata-taxonomy-field.js +5 -5
- package/esm/lib/components/metadata-editor-fields/components/update-mode-field-wrapper/messages.js +1 -1
- package/esm/lib/components/metadata-editor-fields/components/update-mode-field-wrapper/update-mode-field-wrapper.js +2 -3
- package/esm/lib/components/metadata-editor-fields/metadata-editor-field-wrapper.js +567 -70
- package/esm/lib/components/metadata-editor-fields/metadata-editor-fields.js +19 -18
- package/esm/lib/components/metadata-empty-state/messages.js +1 -1
- package/esm/lib/components/metadata-empty-state/metadata-empty-state.js +1 -1
- package/esm/lib/components/metadata-instance-editor/subcomponents/custom-instance/custom-instance.js +13 -14
- package/esm/lib/components/metadata-instance-editor/subcomponents/custom-instance/messages.js +1 -1
- package/esm/lib/components/metadata-instance-editor/subcomponents/custom-instance-new-field/custom-instance-new-field.js +4 -5
- package/esm/lib/components/metadata-instance-editor/subcomponents/custom-instance-new-field/messages.js +1 -1
- package/esm/lib/components/metadata-instance-editor/subcomponents/delete-confirmation-modal/delete-confirmation-modal.js +14 -14
- package/esm/lib/components/metadata-instance-editor/subcomponents/delete-confirmation-modal/messages.js +1 -1
- package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/metadata-instance-form.js +27 -28
- package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-autofill-button/messages.js +1 -1
- package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-autofill-button/metadata-instance-form-autofill-button.js +10 -11
- package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-footer/messages.js +1 -1
- package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-footer/metadata-instance-form-footer.js +4 -5
- package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/messages.js +1 -1
- package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/metadata-instance-form-header.js +16 -17
- package/esm/lib/components/metadata-instance-list/metadata-instance-list.js +8 -9
- package/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance/metadata-instance.js +7 -8
- package/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-content/metadata-instance-content.js +3 -4
- package/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/metadata-instance-entry.js +8 -9
- package/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/taxonomy-entry/messages.js +3 -3
- package/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/taxonomy-entry/taxonomy-ancestor-status-pill.js +4 -3
- package/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-footer/messages.js +1 -1
- package/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-footer/metadata-instance-footer.js +6 -7
- package/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-header/messages.js +1 -1
- package/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-header/metadata-instance-header.js +10 -11
- package/esm/lib/components/unsaved-changes-modal/messages.js +1 -1
- package/esm/lib/components/unsaved-changes-modal/unsaved-changes-modal.js +19 -18
- package/esm/lib/messages.js +1 -1
- package/esm/lib/metadata-editor.js +4 -5
- package/package.json +5 -5
- package/styles/ai-suggestion-field.css +1 -1
- package/styles/utils.css +1 -1
- package/types/lib/components/add-metadata-template-dropdown/add-metadata-template-dropdown.d.ts +1 -1
- package/types/lib/components/add-metadata-template-dropdown/types.d.ts +1 -1
- package/types/lib/components/combobox-with-api-pagination/combobox-with-api-pagination.d.ts +5 -5
- package/types/lib/components/combobox-with-api-pagination/types.d.ts +2 -2
- package/types/lib/components/filter-dropdown-menu/filter-dropdown-menu-content.d.ts +1 -1
- package/types/lib/components/filter-dropdown-menu/filter-dropdown-menu-item.d.ts +1 -1
- package/types/lib/components/filter-dropdown-menu/filter-dropdown-menu-list.d.ts +1 -1
- package/types/lib/components/filter-dropdown-menu/filter-dropdown-menu-root.d.ts +1 -1
- package/types/lib/components/filter-dropdown-menu/filter-dropdown-menu-search.d.ts +1 -1
- package/types/lib/components/filter-dropdown-menu/filter-dropdown-menu-trigger.d.ts +1 -1
- package/types/lib/components/filter-dropdown-menu/index.d.ts +6 -6
- package/types/lib/components/filter-instances-dropdown/filter-instances-dropdown.d.ts +1 -1
- package/types/lib/components/filter-instances-dropdown/types.d.ts +1 -1
- package/types/lib/components/interactive-header-text/interactive-header-text.d.ts +1 -1
- package/types/lib/components/interactive-text/interactive-text.d.ts +1 -1
- 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/types.d.ts +1 -1
- package/types/lib/components/metadata-editor-fields/components/ai-suggestion-field/utils.d.ts +2 -2
- package/types/lib/components/metadata-editor-fields/components/metadata-date-field/metadata-date-field.d.ts +2 -2
- package/types/lib/components/metadata-editor-fields/components/metadata-date-field/types.d.ts +1 -1
- package/types/lib/components/metadata-editor-fields/components/metadata-enum-field/metadata-enum-field.d.ts +2 -2
- package/types/lib/components/metadata-editor-fields/components/metadata-float-field/metadata-float-field.d.ts +2 -2
- package/types/lib/components/metadata-editor-fields/components/metadata-multi-select-field/metadata-multi-select-field.d.ts +2 -2
- package/types/lib/components/metadata-editor-fields/components/metadata-string-field/metadata-string-field.d.ts +2 -2
- package/types/lib/components/metadata-editor-fields/components/metadata-taxonomy-field/metadata-taxonomy-field.d.ts +2 -2
- package/types/lib/components/metadata-editor-fields/components/metadata-taxonomy-field/types.d.ts +2 -2
- package/types/lib/components/metadata-editor-fields/components/update-mode-field-wrapper/update-mode-field-wrapper.d.ts +2 -2
- package/types/lib/components/metadata-editor-fields/editor-field-types.d.ts +6 -6
- package/types/lib/components/metadata-editor-fields/metadata-editor-field-wrapper.d.ts +4 -4
- package/types/lib/components/metadata-editor-fields/metadata-editor-fields.d.ts +1 -1
- package/types/lib/components/metadata-editor-fields/types.d.ts +2 -2
- package/types/lib/components/metadata-editor-fields/utils.d.ts +1 -1
- package/types/lib/components/metadata-empty-state/metadata-empty-state.d.ts +1 -1
- package/types/lib/components/metadata-instance-editor/subcomponents/custom-instance/custom-instance.d.ts +1 -1
- package/types/lib/components/metadata-instance-editor/subcomponents/custom-instance-new-field/custom-instance-new-field.d.ts +1 -1
- package/types/lib/components/metadata-instance-editor/subcomponents/delete-confirmation-modal/delete-confirmation-modal.d.ts +1 -1
- package/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/metadata-instance-form-card-wrapper.d.ts +1 -1
- package/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/metadata-instance-form.d.ts +1 -1
- package/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/types.d.ts +3 -3
- package/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/utils.d.ts +3 -3
- package/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-autofill-button/metadata-instance-form-autofill-button.d.ts +1 -1
- package/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-autofill-button/types.d.ts +1 -1
- package/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-footer/metadata-instance-form-footer.d.ts +1 -1
- 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 -1
- package/types/lib/components/metadata-instance-editor/types.d.ts +1 -1
- package/types/lib/components/metadata-instance-list/metadata-instance-list.d.ts +1 -1
- package/types/lib/components/metadata-instance-list/subcomponents/metadata-instance/metadata-instance.d.ts +1 -1
- package/types/lib/components/metadata-instance-list/subcomponents/metadata-instance/types.d.ts +2 -2
- package/types/lib/components/metadata-instance-list/subcomponents/metadata-instance-content/metadata-instance-content.d.ts +1 -1
- package/types/lib/components/metadata-instance-list/subcomponents/metadata-instance-content/types.d.ts +2 -2
- package/types/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/metadata-entry-display.d.ts +1 -1
- package/types/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/metadata-instance-entry.d.ts +1 -1
- package/types/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/taxonomy-entry/taxonomy-ancestor-status-pill.d.ts +1 -1
- package/types/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/taxonomy-entry/taxonomy-value.d.ts +1 -1
- package/types/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/types.d.ts +2 -2
- package/types/lib/components/metadata-instance-list/subcomponents/metadata-instance-footer/metadata-instance-footer.d.ts +1 -1
- package/types/lib/components/metadata-instance-list/subcomponents/metadata-instance-header/metadata-instance-header.d.ts +1 -1
- package/types/lib/components/metadata-instance-list/types.d.ts +2 -2
- package/types/lib/components/unsaved-changes-modal/types.d.ts +1 -1
- package/types/lib/components/unsaved-changes-modal/unsaved-changes-modal.d.ts +1 -1
- package/types/lib/defaults.d.ts +1 -1
- package/types/lib/mappers.d.ts +2 -2
- package/types/lib/test-utils/formik-wrapper.d.ts +3 -3
- package/types/lib/test-utils/sample-data.d.ts +1 -1
- package/types/lib/test-utils/test-utils.d.ts +1 -1
- package/types/lib/types.d.ts +1 -1
- package/types/lib/utils/api-wrapper.d.ts +1 -1
- package/types/lib/utils/autofill-context.d.ts +2 -2
- package/types/lib/utils/convertDate.d.ts +1 -1
- package/types/lib/utils/utils.d.ts +1 -1
@@ -1,33 +1,34 @@
|
|
1
1
|
import { useRef as f, useEffect as l } from "react";
|
2
|
-
import { Text as
|
3
|
-
import { useFormikContext as
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import { MetadataEditorFieldWrapper as
|
7
|
-
import { s as
|
2
|
+
import { Text as d } from "@box/blueprint-web";
|
3
|
+
import { useFormikContext as c, getIn as p, FieldArray as u } from "formik";
|
4
|
+
import "../../../../chunks/index.js";
|
5
|
+
import x from "../../messages.js";
|
6
|
+
import { MetadataEditorFieldWrapper as g } from "./metadata-editor-field-wrapper.js";
|
7
|
+
import { s as h } from "../../../../chunks/utils2.js";
|
8
8
|
import { jsx as t } from "react/jsx-runtime";
|
9
|
-
|
9
|
+
import { M as F } from "../../../../chunks/message.js";
|
10
|
+
const C = (n) => {
|
10
11
|
const {
|
11
12
|
values: i
|
12
|
-
} =
|
13
|
+
} = c(), r = "metadata.fields", o = p(i, r), s = f(null), a = o.findIndex((e) => !e.hidden);
|
13
14
|
return l(() => {
|
14
15
|
var e;
|
15
16
|
a > -1 && ((e = s.current) == null || e.focus());
|
16
|
-
}, []),
|
17
|
-
name:
|
17
|
+
}, []), o.length ? /* @__PURE__ */ t(u, {
|
18
|
+
name: r,
|
18
19
|
validateOnChange: !1,
|
19
|
-
children: () =>
|
20
|
-
...
|
21
|
-
ref:
|
20
|
+
children: () => o.map((e, m) => /* @__PURE__ */ t(g, {
|
21
|
+
...n,
|
22
|
+
ref: m === a ? s : null,
|
22
23
|
field: e,
|
23
|
-
index:
|
24
|
+
index: m
|
24
25
|
}, e.key))
|
25
|
-
}) : /* @__PURE__ */ t(
|
26
|
+
}) : /* @__PURE__ */ t(d, {
|
26
27
|
as: "span",
|
27
|
-
className:
|
28
|
+
className: h.noAttributesText,
|
28
29
|
color: "textOnLightSecondary",
|
29
|
-
children: /* @__PURE__ */ t(
|
30
|
-
...
|
30
|
+
children: /* @__PURE__ */ t(F, {
|
31
|
+
...x.noTemplateAtributesError
|
31
32
|
})
|
32
33
|
});
|
33
34
|
};
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { Text as n, EmptyState as m } from "@box/blueprint-web";
|
2
2
|
import { JobAnalyzeData as c } from "@box/blueprint-web-assets/illustrations/Small";
|
3
3
|
import { useCallback as f } from "react";
|
4
|
-
import {
|
4
|
+
import { u as d } from "../../../../chunks/index.js";
|
5
5
|
import a from "./messages.js";
|
6
6
|
import { jsx as e } from "react/jsx-runtime";
|
7
7
|
function E({
|
package/esm/lib/components/metadata-instance-editor/subcomponents/custom-instance/custom-instance.js
CHANGED
@@ -1,35 +1,34 @@
|
|
1
|
-
import "../../../../../../styles/custom-instance.css";
|
2
1
|
import { useFormikContext as A, FieldArray as N, Field as k } from "formik";
|
3
2
|
import { useState as I, useRef as v, useEffect as y } from "react";
|
4
|
-
import {
|
3
|
+
import { u as C } from "../../../../../../chunks/index.js";
|
5
4
|
import { TextInput as q, IconButton as B, TextButton as T } from "@box/blueprint-web";
|
6
5
|
import { Trash as w } from "@box/blueprint-web-assets/icons/Line";
|
7
6
|
import { CustomInstanceNewField as M } from "../custom-instance-new-field/custom-instance-new-field.js";
|
8
7
|
import { fieldDefaultProps as R } from "../../../metadata-editor-fields/components/constants.js";
|
9
8
|
import d from "./messages.js";
|
10
9
|
import { jsx as t, jsxs as p } from "react/jsx-runtime";
|
11
|
-
const V = "_customInstance_xq8r7_1", j = "_customInstanceField_xq8r7_7", P = "_customInstanceFieldInput_xq8r7_12", z = "_customInstanceFieldIcon_xq8r7_16", c = {
|
10
|
+
import '../../../../../../styles/custom-instance.css';const V = "_customInstance_xq8r7_1", j = "_customInstanceField_xq8r7_7", P = "_customInstanceFieldInput_xq8r7_12", z = "_customInstanceFieldIcon_xq8r7_16", c = {
|
12
11
|
customInstance: V,
|
13
12
|
customInstanceField: j,
|
14
13
|
customInstanceFieldInput: P,
|
15
14
|
customInstanceFieldIcon: z
|
16
|
-
},
|
15
|
+
}, O = (F) => {
|
17
16
|
const {
|
18
17
|
isLoading: l
|
19
18
|
} = F, {
|
20
19
|
values: e
|
21
|
-
} = A(), i = C(), [m,
|
20
|
+
} = A(), i = C(), [m, a] = I(!e.metadata.fields.length), [u, r] = I(0), h = () => {
|
22
21
|
r(e.metadata.fields.length);
|
23
|
-
}, b = (
|
24
|
-
r(
|
22
|
+
}, b = (o) => {
|
23
|
+
r(o === 0 ? 0 : o - 1);
|
25
24
|
}, f = v(null);
|
26
25
|
return y(() => {
|
27
|
-
e.metadata.fields.length > 0 ? f.current.focus() :
|
26
|
+
e.metadata.fields.length > 0 ? f.current.focus() : a(!0);
|
28
27
|
}, [u, e.metadata.fields.length]), /* @__PURE__ */ t("div", {
|
29
28
|
children: /* @__PURE__ */ t(N, {
|
30
29
|
name: "metadata.fields",
|
31
30
|
children: ({
|
32
|
-
remove:
|
31
|
+
remove: o,
|
33
32
|
push: _
|
34
33
|
}) => /* @__PURE__ */ p("div", {
|
35
34
|
className: c.customInstance,
|
@@ -60,7 +59,7 @@ const V = "_customInstance_xq8r7_1", j = "_customInstanceField_xq8r7_7", P = "_c
|
|
60
59
|
disabled: l,
|
61
60
|
icon: w,
|
62
61
|
onClick: () => {
|
63
|
-
|
62
|
+
o(n), b(n);
|
64
63
|
},
|
65
64
|
size: "x-small",
|
66
65
|
"data-target-id": "IconButton-removeAttribute"
|
@@ -71,12 +70,12 @@ const V = "_customInstance_xq8r7_1", j = "_customInstanceField_xq8r7_7", P = "_c
|
|
71
70
|
_({
|
72
71
|
key: s,
|
73
72
|
value: n
|
74
|
-
}), h(),
|
73
|
+
}), h(), a(!1);
|
75
74
|
},
|
76
|
-
onCancel: () =>
|
75
|
+
onCancel: () => a(!1)
|
77
76
|
}), !m && /* @__PURE__ */ t(T, {
|
78
77
|
disabled: l,
|
79
|
-
onClick: () =>
|
78
|
+
onClick: () => a(!0),
|
80
79
|
"data-target-id": "TextButton-addAttribute",
|
81
80
|
children: i.formatMessage(d.addAttribute)
|
82
81
|
})]
|
@@ -85,5 +84,5 @@ const V = "_customInstance_xq8r7_1", j = "_customInstanceField_xq8r7_7", P = "_c
|
|
85
84
|
});
|
86
85
|
};
|
87
86
|
export {
|
88
|
-
|
87
|
+
O as CustomInstance
|
89
88
|
};
|
@@ -1,14 +1,13 @@
|
|
1
|
-
import "../../../../../../styles/custom-instance-new-field.css";
|
2
1
|
import { Card as I, TextInput as u, Button as m } from "@box/blueprint-web";
|
3
2
|
import { useState as l } from "react";
|
4
|
-
import {
|
3
|
+
import { u as y } from "../../../../../../chunks/index.js";
|
5
4
|
import t from "./messages.js";
|
6
5
|
import { jsxs as p, jsx as a } from "react/jsx-runtime";
|
7
|
-
const M = "_customInstanceNewFieldCard_ivrhw_1", _ = "_customInstanceNewFieldFooter_ivrhw_6", b = "_inputWrapper_ivrhw_13", n = {
|
6
|
+
import '../../../../../../styles/custom-instance-new-field.css';const M = "_customInstanceNewFieldCard_ivrhw_1", _ = "_customInstanceNewFieldFooter_ivrhw_6", b = "_inputWrapper_ivrhw_13", n = {
|
8
7
|
customInstanceNewFieldCard: M,
|
9
8
|
customInstanceNewFieldFooter: _,
|
10
9
|
inputWrapper: b
|
11
|
-
},
|
10
|
+
}, x = (g) => {
|
12
11
|
const {
|
13
12
|
onAdd: h,
|
14
13
|
onCancel: f,
|
@@ -59,5 +58,5 @@ const M = "_customInstanceNewFieldCard_ivrhw_1", _ = "_customInstanceNewFieldFoo
|
|
59
58
|
});
|
60
59
|
};
|
61
60
|
export {
|
62
|
-
|
61
|
+
x as CustomInstanceNewField
|
63
62
|
};
|
@@ -1,18 +1,18 @@
|
|
1
|
-
import "../../../../../../styles/delete-confirmation-modal.css";
|
2
1
|
import { Modal as a, Text as c, TextInput as b } from "@box/blueprint-web";
|
3
2
|
import { useState as f, useEffect as F } from "react";
|
4
|
-
import {
|
3
|
+
import { u as I } from "../../../../../../chunks/index.js";
|
5
4
|
import o from "./messages.js";
|
6
|
-
import { jsx as e, jsxs as
|
7
|
-
|
5
|
+
import { jsx as e, jsxs as s } from "react/jsx-runtime";
|
6
|
+
import { M as d } from "../../../../../../chunks/message.js";
|
7
|
+
import '../../../../../../styles/delete-confirmation-modal.css';const P = "_modalBody_yiat3_1", x = {
|
8
8
|
modalBody: P
|
9
9
|
}, T = ({
|
10
10
|
onConfirm: u,
|
11
11
|
templateName: p,
|
12
12
|
onDismiss: C,
|
13
|
-
open:
|
13
|
+
open: M
|
14
14
|
}) => {
|
15
|
-
const n = I(), [r, m] = f(""), [
|
15
|
+
const n = I(), [r, m] = f(""), [h, g] = f(!0), i = (t) => {
|
16
16
|
t || (C(), m(""));
|
17
17
|
}, l = p || n.formatMessage(o.deleteConfirmationModalCustomMetadata), y = (t) => {
|
18
18
|
m(t);
|
@@ -23,24 +23,24 @@ const P = "_modalBody_yiat3_1", x = {
|
|
23
23
|
g(r !== l);
|
24
24
|
}, [r, l]), /* @__PURE__ */ e(a, {
|
25
25
|
onOpenChange: i,
|
26
|
-
open:
|
27
|
-
children: /* @__PURE__ */
|
26
|
+
open: M,
|
27
|
+
children: /* @__PURE__ */ s(a.Content, {
|
28
28
|
onEscapeKeyDown: (t) => t.stopPropagation(),
|
29
29
|
size: "small",
|
30
30
|
children: [/* @__PURE__ */ e(a.Header, {
|
31
31
|
"aria-label": n.formatMessage(o.deleteConfirmationModalHeaderAriaLabel),
|
32
|
-
children: /* @__PURE__ */ e(
|
32
|
+
children: /* @__PURE__ */ e(d, {
|
33
33
|
...o.deleteConfirmationModalHeader,
|
34
34
|
values: {
|
35
35
|
templateName: l
|
36
36
|
}
|
37
37
|
})
|
38
38
|
}), /* @__PURE__ */ e(a.ScrollableContainer, {
|
39
|
-
children: /* @__PURE__ */
|
39
|
+
children: /* @__PURE__ */ s(a.Body, {
|
40
40
|
className: x.modalBody,
|
41
41
|
children: [/* @__PURE__ */ e(c, {
|
42
42
|
as: "p",
|
43
|
-
children: /* @__PURE__ */ e(
|
43
|
+
children: /* @__PURE__ */ e(d, {
|
44
44
|
...o.deleteConfirmationModalBodyFirstParagraph,
|
45
45
|
values: {
|
46
46
|
templateName: l
|
@@ -48,7 +48,7 @@ const P = "_modalBody_yiat3_1", x = {
|
|
48
48
|
})
|
49
49
|
}), /* @__PURE__ */ e(c, {
|
50
50
|
as: "p",
|
51
|
-
children: /* @__PURE__ */ e(
|
51
|
+
children: /* @__PURE__ */ e(d, {
|
52
52
|
...o.deleteConfirmationModalBodySecondParagraph
|
53
53
|
})
|
54
54
|
}), /* @__PURE__ */ e(b, {
|
@@ -59,13 +59,13 @@ const P = "_modalBody_yiat3_1", x = {
|
|
59
59
|
value: r
|
60
60
|
})]
|
61
61
|
})
|
62
|
-
}), /* @__PURE__ */
|
62
|
+
}), /* @__PURE__ */ s(a.Footer, {
|
63
63
|
children: [/* @__PURE__ */ e(a.Footer.SecondaryButton, {
|
64
64
|
onClick: () => i(!1),
|
65
65
|
size: "large",
|
66
66
|
children: n.formatMessage(o.deleteConfirmationModalCancelButton)
|
67
67
|
}), /* @__PURE__ */ e(a.Footer.PrimaryButton, {
|
68
|
-
disabled:
|
68
|
+
disabled: h,
|
69
69
|
onClick: B,
|
70
70
|
size: "large",
|
71
71
|
children: n.formatMessage(o.deleteConfirmationModalConfirmButton)
|
@@ -1,6 +1,5 @@
|
|
1
|
-
import "../../../../../../styles/metadata-instance-form.css";
|
2
1
|
import { Formik as K, Form as W } from "formik";
|
3
|
-
import { useState as
|
2
|
+
import { useState as d, useEffect as p, useRef as j, useMemo as k } from "react";
|
4
3
|
import { TEMPLATE_CUSTOM_PROPERTIES as L } from "../../../../constants.js";
|
5
4
|
import { useAutofill as V } from "../../../../utils/autofill-context.js";
|
6
5
|
import { TemplateInstance as $ } from "../../../metadata-editor-fields/metadata-editor-fields.js";
|
@@ -10,14 +9,14 @@ import { CustomInstance as q } from "../custom-instance/custom-instance.js";
|
|
10
9
|
import { DeleteConfirmationModal as z } from "../delete-confirmation-modal/delete-confirmation-modal.js";
|
11
10
|
import { c as G } from "../../../../../../chunks/utils.js";
|
12
11
|
import { MetadataInstanceFormCardWrapper as H } from "./metadata-instance-form-card-wrapper.js";
|
13
|
-
import { jsx as
|
14
|
-
const X = "_metadataInstanceForm_1hu4u_1", Y = {
|
12
|
+
import { jsx as a, jsxs as Q } from "react/jsx-runtime";
|
13
|
+
import '../../../../../../styles/metadata-instance-form.css';const X = "_metadataInstanceForm_1hu4u_1", Y = {
|
15
14
|
metadataInstanceForm: X
|
16
|
-
},
|
15
|
+
}, uo = (c) => {
|
17
16
|
const {
|
18
17
|
areAiSuggestionsAvailable: h,
|
19
|
-
customRef:
|
20
|
-
isAiSuggestionsFeatureEnabled:
|
18
|
+
customRef: r,
|
19
|
+
isAiSuggestionsFeatureEnabled: s,
|
21
20
|
isDeleteButtonDisabled: C,
|
22
21
|
isUnsavedChangesModalOpen: F = !1,
|
23
22
|
MetadataInstanceFormCustomWrapper: M,
|
@@ -26,52 +25,52 @@ const X = "_metadataInstanceForm_1hu4u_1", Y = {
|
|
26
25
|
onDelete: E,
|
27
26
|
onDiscardUnsavedChanges: D,
|
28
27
|
onSubmit: y,
|
29
|
-
setIsUnsavedChangesModalOpen:
|
28
|
+
setIsUnsavedChangesModalOpen: i,
|
30
29
|
taxonomyOptionsFetcher: e
|
31
|
-
} = c, b = M ?? H, [O, m] =
|
30
|
+
} = c, b = M ?? H, [O, m] = d(!1), {
|
32
31
|
isFetchingSuggestions: n,
|
33
32
|
getAiSuggestions: A,
|
34
33
|
clearSuggestions: u,
|
35
34
|
suggestions: v
|
36
35
|
} = V();
|
37
|
-
|
36
|
+
p(() => () => {
|
38
37
|
u();
|
39
38
|
}, [u]);
|
40
39
|
const f = (o == null ? void 0 : o.templateKey) === L, x = async (t) => {
|
41
40
|
await y(t, G(t, o));
|
42
41
|
}, P = (t) => {
|
43
|
-
t ?
|
42
|
+
t ? i(!0) : S();
|
44
43
|
}, R = () => {
|
45
44
|
m(!0);
|
46
45
|
}, U = {
|
47
46
|
metadata: {
|
48
47
|
...o
|
49
48
|
}
|
50
|
-
}, l = j(null), [g, _] =
|
51
|
-
|
52
|
-
_(
|
53
|
-
}, [
|
49
|
+
}, l = j(null), [g, _] = d(null);
|
50
|
+
p(() => {
|
51
|
+
_(r ?? l.current);
|
52
|
+
}, [r, o == null ? void 0 : o.templateKey, o == null ? void 0 : o.scope]);
|
54
53
|
const N = k(() => {
|
55
54
|
const t = (o == null ? void 0 : o.fields.length) === 0;
|
56
|
-
return f ? /* @__PURE__ */
|
55
|
+
return f ? /* @__PURE__ */ a(q, {
|
57
56
|
isLoading: n
|
58
|
-
}) : t ? /* @__PURE__ */
|
59
|
-
isBoxAiSuggestionsFeatureEnabled:
|
57
|
+
}) : t ? /* @__PURE__ */ a(w, {
|
58
|
+
isBoxAiSuggestionsFeatureEnabled: s,
|
60
59
|
level: "instance"
|
61
|
-
}) : /* @__PURE__ */
|
60
|
+
}) : /* @__PURE__ */ a($, {
|
62
61
|
disableForm: n,
|
63
|
-
portalElement:
|
62
|
+
portalElement: r ?? g,
|
64
63
|
taxonomyOptionsFetcher: e
|
65
64
|
});
|
66
|
-
}, [o == null ? void 0 : o.fields.length, f, n,
|
67
|
-
return /* @__PURE__ */
|
65
|
+
}, [o == null ? void 0 : o.fields.length, f, n, r, g, e, s]);
|
66
|
+
return /* @__PURE__ */ a(K, {
|
68
67
|
initialValues: U,
|
69
68
|
onSubmit: x,
|
70
69
|
children: ({
|
71
70
|
values: t,
|
72
71
|
dirty: B
|
73
72
|
}) => /* @__PURE__ */ Q(W, {
|
74
|
-
children: [/* @__PURE__ */
|
73
|
+
children: [/* @__PURE__ */ a(b, {
|
75
74
|
areAiSuggestionsAvailable: h,
|
76
75
|
className: Y.metadataInstanceForm,
|
77
76
|
formRef: l,
|
@@ -79,18 +78,18 @@ const X = "_metadataInstanceForm_1hu4u_1", Y = {
|
|
79
78
|
getAiSuggestions: A,
|
80
79
|
handleCancel: P,
|
81
80
|
handleDelete: R,
|
82
|
-
isAiSuggestionsFeatureEnabled:
|
81
|
+
isAiSuggestionsFeatureEnabled: s,
|
83
82
|
isDeleteButtonDisabled: C,
|
84
83
|
isFetchingSuggestions: n,
|
85
84
|
isFormDirty: B,
|
86
85
|
selectedTemplateInstance: o,
|
87
86
|
suggestions: v,
|
88
87
|
children: o && N
|
89
|
-
}), /* @__PURE__ */
|
90
|
-
onBackToEdit: () =>
|
88
|
+
}), /* @__PURE__ */ a(J, {
|
89
|
+
onBackToEdit: () => i(!1),
|
91
90
|
onDiscardChanges: D,
|
92
91
|
open: F
|
93
|
-
}), /* @__PURE__ */
|
92
|
+
}), /* @__PURE__ */ a(z, {
|
94
93
|
onConfirm: () => E(o),
|
95
94
|
onDismiss: () => m(!1),
|
96
95
|
open: O,
|
@@ -100,5 +99,5 @@ const X = "_metadataInstanceForm_1hu4u_1", Y = {
|
|
100
99
|
}, `${o == null ? void 0 : o.scope}.${o == null ? void 0 : o.templateKey}`);
|
101
100
|
};
|
102
101
|
export {
|
103
|
-
|
102
|
+
uo as MetadataInstanceForm
|
104
103
|
};
|
@@ -1,15 +1,14 @@
|
|
1
|
-
import "../../../../../../styles/metadata-instance-form-autofill-button.css";
|
2
1
|
import { LoadingIndicator as M, IconButton as v, Tooltip as L, Button as k } from "@box/blueprint-web";
|
3
2
|
import { BoxAiLogo as p } from "@box/blueprint-web-assets/icons/Logo";
|
4
3
|
import { useFormikContext as x, getIn as i } from "formik";
|
5
4
|
import { useEffect as K } from "react";
|
6
|
-
import {
|
5
|
+
import { u as h } from "../../../../../../chunks/index.js";
|
7
6
|
import { useAutofill as C } from "../../../../utils/autofill-context.js";
|
8
7
|
import n from "./messages.js";
|
9
8
|
import { jsx as l } from "react/jsx-runtime";
|
10
|
-
const F = "_loadingIndicator_1vv9u_1", _ = {
|
9
|
+
import '../../../../../../styles/metadata-instance-form-autofill-button.css';const F = "_loadingIndicator_1vv9u_1", _ = {
|
11
10
|
loadingIndicator: F
|
12
|
-
},
|
11
|
+
}, w = ({
|
13
12
|
areAiSuggestionsAvailable: B,
|
14
13
|
isLoading: r,
|
15
14
|
variant: b = "secondary-button",
|
@@ -18,14 +17,14 @@ const F = "_loadingIndicator_1vv9u_1", _ = {
|
|
18
17
|
const {
|
19
18
|
isSubmitting: y,
|
20
19
|
values: e,
|
21
|
-
setFieldValue:
|
20
|
+
setFieldValue: u
|
22
21
|
} = x(), t = h(), {
|
23
22
|
suggestions: o
|
24
23
|
} = C();
|
25
24
|
K(() => {
|
26
25
|
if (o) {
|
27
26
|
const a = i(e, "metadata.fields"), s = i(e, "metadata.templateKey");
|
28
|
-
|
27
|
+
u("metadata.fields", a == null ? void 0 : a.map((c) => {
|
29
28
|
var g;
|
30
29
|
const f = (g = o == null ? void 0 : o[s]) == null ? void 0 : g[c.key];
|
31
30
|
return f ? {
|
@@ -34,8 +33,8 @@ const F = "_loadingIndicator_1vv9u_1", _ = {
|
|
34
33
|
} : c;
|
35
34
|
}));
|
36
35
|
}
|
37
|
-
}, [o,
|
38
|
-
const
|
36
|
+
}, [o, u]);
|
37
|
+
const m = () => {
|
39
38
|
const a = i(e, "metadata.templateKey"), s = i(e, "metadata.scope");
|
40
39
|
I(a, s);
|
41
40
|
}, d = !B || y || r, A = r ? /* @__PURE__ */ l(M, {
|
@@ -45,7 +44,7 @@ const F = "_loadingIndicator_1vv9u_1", _ = {
|
|
45
44
|
"aria-label": t.formatMessage(n.autofillButtonAriaLabel),
|
46
45
|
disabled: d,
|
47
46
|
icon: p,
|
48
|
-
onClick:
|
47
|
+
onClick: m,
|
49
48
|
variant: "icon-logo",
|
50
49
|
"data-target-id": "IconButton-autofillButtonAriaLabel"
|
51
50
|
});
|
@@ -56,7 +55,7 @@ const F = "_loadingIndicator_1vv9u_1", _ = {
|
|
56
55
|
icon: p,
|
57
56
|
loading: r,
|
58
57
|
loadingAriaLabel: t.formatMessage(n.loadingButtonAriaLabel),
|
59
|
-
onClick:
|
58
|
+
onClick: m,
|
60
59
|
variant: "secondary",
|
61
60
|
"data-target-id": "Button-autofillButton",
|
62
61
|
children: t.formatMessage(n.autofillButton)
|
@@ -64,5 +63,5 @@ const F = "_loadingIndicator_1vv9u_1", _ = {
|
|
64
63
|
});
|
65
64
|
};
|
66
65
|
export {
|
67
|
-
|
66
|
+
w as MetadataInstanceFormAutofillButton
|
68
67
|
};
|
@@ -1,14 +1,13 @@
|
|
1
|
-
import "../../../../../../styles/metadata-instance-form-footer.css";
|
2
1
|
import { TextButton as b, Button as r } from "@box/blueprint-web";
|
3
2
|
import { useFormikContext as g } from "formik";
|
4
|
-
import {
|
3
|
+
import { u as B } from "../../../../../../chunks/index.js";
|
5
4
|
import o from "./messages.js";
|
6
5
|
import { jsx as e, jsxs as i } from "react/jsx-runtime";
|
7
|
-
const F = "_metadataInstanceFormFooter_17478_1", f = "_buttonsContainer_17478_8", _ = "_buttons_17478_8", n = {
|
6
|
+
import '../../../../../../styles/metadata-instance-form-footer.css';const F = "_metadataInstanceFormFooter_17478_1", f = "_buttonsContainer_17478_8", _ = "_buttons_17478_8", n = {
|
8
7
|
metadataInstanceFormFooter: F,
|
9
8
|
buttonsContainer: f,
|
10
9
|
buttons: _
|
11
|
-
},
|
10
|
+
}, I = ({
|
12
11
|
isDeleteButtonDisabled: d,
|
13
12
|
isLoading: m,
|
14
13
|
onCancel: c,
|
@@ -50,5 +49,5 @@ const F = "_metadataInstanceFormFooter_17478_1", f = "_buttonsContainer_17478_8"
|
|
50
49
|
});
|
51
50
|
};
|
52
51
|
export {
|
53
|
-
|
52
|
+
I as MetadataInstanceFormFooter
|
54
53
|
};
|
@@ -1,42 +1,41 @@
|
|
1
|
-
import "../../../../../../
|
2
|
-
import {
|
3
|
-
import
|
4
|
-
import p from "
|
5
|
-
import { MetadataInstanceFormAutofillButton as u } from "../metadata-instance-form-autofill-button/metadata-instance-form-autofill-button.js";
|
1
|
+
import { u } from "../../../../../../chunks/index.js";
|
2
|
+
import { InlineNotice as I, Text as o } from "@box/blueprint-web";
|
3
|
+
import g from "../../../interactive-header-text/interactive-header-text.js";
|
4
|
+
import { MetadataInstanceFormAutofillButton as p } from "../metadata-instance-form-autofill-button/metadata-instance-form-autofill-button.js";
|
6
5
|
import e from "./messages.js";
|
7
6
|
import { jsxs as a, Fragment as H, jsx as r } from "react/jsx-runtime";
|
8
|
-
const x = "_metadataInstanceFormHeader_13lxr_1", F = "_title_13lxr_9", s = {
|
7
|
+
import '../../../../../../styles/metadata-instance-form-header.css';const x = "_metadataInstanceFormHeader_13lxr_1", F = "_title_13lxr_9", s = {
|
9
8
|
metadataInstanceFormHeader: x,
|
10
9
|
title: F
|
11
|
-
},
|
12
|
-
areAiSuggestionsAvailable:
|
10
|
+
}, B = ({
|
11
|
+
areAiSuggestionsAvailable: n,
|
13
12
|
hasSuggestions: i,
|
14
13
|
isAiSuggestionsFeatureEnabled: m,
|
15
14
|
isLoading: c,
|
16
15
|
templateName: l,
|
17
16
|
onAutofill: d
|
18
17
|
}) => {
|
19
|
-
const t =
|
18
|
+
const t = u(), f = l ?? t.formatMessage(e.customInstanceTitle);
|
20
19
|
return /* @__PURE__ */ a(H, {
|
21
20
|
children: [/* @__PURE__ */ a("div", {
|
22
21
|
className: s.metadataInstanceFormHeader,
|
23
|
-
children: [/* @__PURE__ */ r(
|
22
|
+
children: [/* @__PURE__ */ r(g, {
|
24
23
|
className: s.title,
|
25
24
|
title: f
|
26
|
-
}), m ? /* @__PURE__ */ r(
|
27
|
-
areAiSuggestionsAvailable:
|
25
|
+
}), m ? /* @__PURE__ */ r(p, {
|
26
|
+
areAiSuggestionsAvailable: n,
|
28
27
|
isLoading: c,
|
29
28
|
onAutofill: d
|
30
29
|
}) : null]
|
31
|
-
}), i &&
|
32
|
-
children: /* @__PURE__ */ a(
|
30
|
+
}), i && n ? /* @__PURE__ */ r("div", {
|
31
|
+
children: /* @__PURE__ */ a(I, {
|
33
32
|
variant: "info",
|
34
33
|
variantIconAriaLabel: t.formatMessage(e.aiSuggestionNoticeHeader),
|
35
|
-
children: [/* @__PURE__ */ r(
|
34
|
+
children: [/* @__PURE__ */ r(o, {
|
36
35
|
as: "p",
|
37
36
|
variant: "bodyDefaultBold",
|
38
37
|
children: t.formatMessage(e.aiSuggestionNoticeHeader)
|
39
|
-
}), /* @__PURE__ */ a(
|
38
|
+
}), /* @__PURE__ */ a(o, {
|
40
39
|
as: "p",
|
41
40
|
children: [t.formatMessage(e.aiSuggestionNoticeBody), " "]
|
42
41
|
})]
|
@@ -45,5 +44,5 @@ const x = "_metadataInstanceFormHeader_13lxr_1", F = "_title_13lxr_9", s = {
|
|
45
44
|
});
|
46
45
|
};
|
47
46
|
export {
|
48
|
-
|
47
|
+
B as MetadataInstanceFormHeader
|
49
48
|
};
|
@@ -1,18 +1,17 @@
|
|
1
|
-
import "
|
2
|
-
import {
|
3
|
-
import { getVisibleTemplates as r } from "../../utils/utils.js";
|
1
|
+
import { MetadataInstance as c } from "./subcomponents/metadata-instance/metadata-instance.js";
|
2
|
+
import { getVisibleTemplates as d } from "../../utils/utils.js";
|
4
3
|
import { jsx as a } from "react/jsx-runtime";
|
5
|
-
const
|
6
|
-
metadataInstanceList:
|
7
|
-
},
|
4
|
+
import '../../../../styles/metadata-instance-list.css';const o = "_metadataInstanceList_bd83w_1", r = {
|
5
|
+
metadataInstanceList: o
|
6
|
+
}, l = ({
|
8
7
|
areAiSuggestionsAvailable: s,
|
9
8
|
isAiSuggestionsFeatureEnabled: e,
|
10
9
|
onEdit: n,
|
11
10
|
templateInstances: i,
|
12
11
|
taxonomyNodeFetcher: m
|
13
12
|
}) => /* @__PURE__ */ a("div", {
|
14
|
-
className:
|
15
|
-
children:
|
13
|
+
className: r.metadataInstanceList,
|
14
|
+
children: d(i).map((t) => /* @__PURE__ */ a(c, {
|
16
15
|
areAiSuggestionsAvailable: s,
|
17
16
|
isAiSuggestionsFeatureEnabled: e,
|
18
17
|
onEdit: n,
|
@@ -21,5 +20,5 @@ const c = "_metadataInstanceList_bd83w_1", d = {
|
|
21
20
|
}, t.id))
|
22
21
|
});
|
23
22
|
export {
|
24
|
-
|
23
|
+
l as MetadataInstanceList
|
25
24
|
};
|