@box/metadata-editor 0.88.0 → 0.88.1
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/metadata-instance-form-card-wrapper.js +2 -2
- package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/metadata-instance-form.js +12 -12
- package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-autofill-button/metadata-instance-form-autofill-button.js +1 -1
- package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/metadata-instance-form-header.js +2 -2
- package/esm/lib/components/metadata-instance-list/metadata-instance-list.js +15 -13
- package/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance/metadata-instance.js +35 -34
- package/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-header/metadata-instance-header.js +1 -1
- package/package.json +2 -2
- package/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/types.d.ts +2 -2
- 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-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-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 +1 -0
- 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/subcomponents/metadata-instance-header/types.d.ts +1 -1
- package/types/lib/components/metadata-instance-list/types.d.ts +1 -0
@@ -15,7 +15,7 @@ import '../styles/metadata-instance-form-card-wrapper.css';const y = "_metadataI
|
|
15
15
|
className: n,
|
16
16
|
formRef: g,
|
17
17
|
isAiSuggestionsFeatureEnabled: m,
|
18
|
-
|
18
|
+
isBetaLanguageEnabled: d,
|
19
19
|
isDeleteButtonDisabled: c,
|
20
20
|
suggestions: l,
|
21
21
|
isFetchingSuggestions: s,
|
@@ -35,8 +35,8 @@ import '../styles/metadata-instance-form-card-wrapper.css';const y = "_metadataI
|
|
35
35
|
children: [/* @__PURE__ */ t(C, {
|
36
36
|
areAiSuggestionsAvailable: o,
|
37
37
|
hasSuggestions: _,
|
38
|
-
iaBetaLanguageEnabled: d,
|
39
38
|
isAiSuggestionsFeatureEnabled: m && !h,
|
39
|
+
isBetaLanguageEnabled: d,
|
40
40
|
isLoading: s,
|
41
41
|
onAutofill: p,
|
42
42
|
templateName: a == null ? void 0 : a.displayName
|
@@ -14,9 +14,9 @@ import { jsx as r, jsxs as Z } from "react/jsx-runtime";
|
|
14
14
|
const lo = (h) => {
|
15
15
|
const {
|
16
16
|
areAiSuggestionsAvailable: C,
|
17
|
-
customRef:
|
17
|
+
customRef: a,
|
18
18
|
isAiSuggestionsFeatureEnabled: n,
|
19
|
-
|
19
|
+
isBetaLanguageEnabled: M,
|
20
20
|
isDeleteButtonDisabled: S,
|
21
21
|
isUnsavedChangesModalOpen: E = !1,
|
22
22
|
MetadataInstanceFormCustomWrapper: c,
|
@@ -28,7 +28,7 @@ const lo = (h) => {
|
|
28
28
|
setIsUnsavedChangesModalOpen: s,
|
29
29
|
taxonomyOptionsFetcher: e
|
30
30
|
} = h, A = c ?? Y, [O, m] = p(!1), {
|
31
|
-
isFetchingSuggestions:
|
31
|
+
isFetchingSuggestions: i,
|
32
32
|
getAiSuggestions: v,
|
33
33
|
clearSuggestions: u,
|
34
34
|
suggestions: x
|
@@ -48,23 +48,23 @@ const lo = (h) => {
|
|
48
48
|
}
|
49
49
|
}, l = k(null), [g, L] = p(null);
|
50
50
|
d(() => {
|
51
|
-
L(
|
52
|
-
}, [
|
51
|
+
L(a ?? l.current);
|
52
|
+
}, [a, o == null ? void 0 : o.templateKey, o == null ? void 0 : o.scope]);
|
53
53
|
const N = V(() => {
|
54
|
-
if (
|
54
|
+
if (i)
|
55
55
|
return /* @__PURE__ */ r($, {});
|
56
56
|
const t = (o == null ? void 0 : o.fields.length) === 0;
|
57
57
|
return f ? /* @__PURE__ */ r(G, {
|
58
|
-
isLoading:
|
58
|
+
isLoading: i
|
59
59
|
}) : t ? /* @__PURE__ */ r(q, {
|
60
60
|
isBoxAiSuggestionsFeatureEnabled: n,
|
61
61
|
level: "instance"
|
62
62
|
}) : /* @__PURE__ */ r(J, {
|
63
|
-
disableForm:
|
64
|
-
portalElement:
|
63
|
+
disableForm: i,
|
64
|
+
portalElement: a ?? g,
|
65
65
|
taxonomyOptionsFetcher: e
|
66
66
|
});
|
67
|
-
}, [o == null ? void 0 : o.fields.length, f,
|
67
|
+
}, [o == null ? void 0 : o.fields.length, f, i, a, g, e, n]);
|
68
68
|
return /* @__PURE__ */ r(W, {
|
69
69
|
initialValues: B,
|
70
70
|
onSubmit: P,
|
@@ -80,10 +80,10 @@ const lo = (h) => {
|
|
80
80
|
getAiSuggestions: v,
|
81
81
|
handleCancel: R,
|
82
82
|
handleDelete: U,
|
83
|
-
iaBetaLanguageEnabled: M,
|
84
83
|
isAiSuggestionsFeatureEnabled: n,
|
84
|
+
isBetaLanguageEnabled: M,
|
85
85
|
isDeleteButtonDisabled: S,
|
86
|
-
isFetchingSuggestions:
|
86
|
+
isFetchingSuggestions: i,
|
87
87
|
isFormDirty: K,
|
88
88
|
selectedTemplateInstance: o,
|
89
89
|
suggestions: x,
|
@@ -10,7 +10,7 @@ import '../../../../../../styles/metadata-instance-form-autofill-button.css';con
|
|
10
10
|
loadingIndicator: T
|
11
11
|
}, w = ({
|
12
12
|
areAiSuggestionsAvailable: B,
|
13
|
-
|
13
|
+
isBetaLanguageEnabled: b,
|
14
14
|
isLoading: r,
|
15
15
|
variant: A = "secondary-button",
|
16
16
|
onAutofill: I
|
@@ -11,7 +11,7 @@ import '../../../../../../styles/metadata-instance-form-header.css';const F = "_
|
|
11
11
|
areAiSuggestionsAvailable: r,
|
12
12
|
hasSuggestions: m,
|
13
13
|
isAiSuggestionsFeatureEnabled: c,
|
14
|
-
|
14
|
+
isBetaLanguageEnabled: n,
|
15
15
|
isLoading: l,
|
16
16
|
templateName: d,
|
17
17
|
onAutofill: f
|
@@ -25,7 +25,7 @@ import '../../../../../../styles/metadata-instance-form-header.css';const F = "_
|
|
25
25
|
title: I
|
26
26
|
}), c ? /* @__PURE__ */ o(H, {
|
27
27
|
areAiSuggestionsAvailable: r,
|
28
|
-
|
28
|
+
isBetaLanguageEnabled: n,
|
29
29
|
isLoading: l,
|
30
30
|
onAutofill: f
|
31
31
|
}) : null]
|
@@ -1,24 +1,26 @@
|
|
1
|
-
import { MetadataInstance as
|
2
|
-
import { getVisibleTemplates as
|
1
|
+
import { MetadataInstance as d } from "./subcomponents/metadata-instance/metadata-instance.js";
|
2
|
+
import { getVisibleTemplates as o } from "../../utils/utils.js";
|
3
3
|
import { jsx as a } from "react/jsx-runtime";
|
4
|
-
import '../../../../styles/metadata-instance-list.css';const
|
5
|
-
metadataInstanceList:
|
6
|
-
},
|
4
|
+
import '../../../../styles/metadata-instance-list.css';const r = "_metadataInstanceList_bd83w_1", p = {
|
5
|
+
metadataInstanceList: r
|
6
|
+
}, f = ({
|
7
7
|
areAiSuggestionsAvailable: s,
|
8
8
|
isAiSuggestionsFeatureEnabled: e,
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
isBetaLanguageEnabled: n,
|
10
|
+
onEdit: i,
|
11
|
+
templateInstances: m,
|
12
|
+
taxonomyNodeFetcher: c
|
12
13
|
}) => /* @__PURE__ */ a("div", {
|
13
|
-
className:
|
14
|
-
children:
|
14
|
+
className: p.metadataInstanceList,
|
15
|
+
children: o(m).map((t) => /* @__PURE__ */ a(d, {
|
15
16
|
areAiSuggestionsAvailable: s,
|
16
17
|
isAiSuggestionsFeatureEnabled: e,
|
17
|
-
|
18
|
-
|
18
|
+
isBetaLanguageEnabled: n,
|
19
|
+
onEdit: i,
|
20
|
+
taxonomyNodeFetcher: c,
|
19
21
|
templateInstance: t
|
20
22
|
}, t.id))
|
21
23
|
});
|
22
24
|
export {
|
23
|
-
|
25
|
+
f as MetadataInstanceList
|
24
26
|
};
|
@@ -1,59 +1,60 @@
|
|
1
|
-
import { Card as
|
2
|
-
import { useState as
|
3
|
-
import { useAutofill as
|
4
|
-
import { MetadataEmptyState as
|
5
|
-
import { MetadataInstanceContent as
|
6
|
-
import { MetadataInstanceFooter as
|
7
|
-
import { MetadataInstanceHeader as
|
8
|
-
import { jsxs as
|
9
|
-
import '../../../../../../styles/metadata-instance.css';const
|
10
|
-
topDivider:
|
11
|
-
bottomDivider:
|
12
|
-
},
|
1
|
+
import { Card as D, Divider as u } from "@box/blueprint-web";
|
2
|
+
import { useState as S } from "react";
|
3
|
+
import { useAutofill as b } from "../../../../utils/autofill-context.js";
|
4
|
+
import { MetadataEmptyState as g } from "../../../metadata-empty-state/metadata-empty-state.js";
|
5
|
+
import { MetadataInstanceContent as H } from "../metadata-instance-content/metadata-instance-content.js";
|
6
|
+
import { MetadataInstanceFooter as _ } from "../metadata-instance-footer/metadata-instance-footer.js";
|
7
|
+
import { MetadataInstanceHeader as M } from "../metadata-instance-header/metadata-instance-header.js";
|
8
|
+
import { jsxs as a, jsx as t, Fragment as n } from "react/jsx-runtime";
|
9
|
+
import '../../../../../../styles/metadata-instance.css';const N = "_topDivider_tzhlb_1", x = "_bottomDivider_tzhlb_5", y = {
|
10
|
+
topDivider: N,
|
11
|
+
bottomDivider: x
|
12
|
+
}, k = ({
|
13
13
|
areAiSuggestionsAvailable: p,
|
14
14
|
isAiSuggestionsFeatureEnabled: d,
|
15
|
+
isBetaLanguageEnabled: c,
|
15
16
|
onEdit: l,
|
16
17
|
templateInstance: o,
|
17
|
-
taxonomyNodeFetcher:
|
18
|
+
taxonomyNodeFetcher: h
|
18
19
|
}) => {
|
19
|
-
const
|
20
|
-
getAiSuggestions:
|
21
|
-
} =
|
22
|
-
l(o),
|
20
|
+
const i = o.fields, m = (s) => !s.value || Array.isArray(s.value) && s.value.length === 0, v = i.every(m), E = i.some(m), f = i.length > 0, [e, r] = S(!0), {
|
21
|
+
getAiSuggestions: V
|
22
|
+
} = b(), A = () => {
|
23
|
+
l(o), V(o.templateKey, o.scope);
|
23
24
|
};
|
24
|
-
return /* @__PURE__ */
|
25
|
-
children: [/* @__PURE__ */ t(
|
25
|
+
return /* @__PURE__ */ a(D, {
|
26
|
+
children: [/* @__PURE__ */ t(M, {
|
26
27
|
areAiSuggestionsAvailable: p,
|
27
28
|
canEdit: o.canEdit,
|
28
|
-
iaBetaLanguageEnabled: !1,
|
29
29
|
isAiSuggestionsFeatureEnabled: d,
|
30
|
-
|
30
|
+
isBetaLanguageEnabled: c,
|
31
|
+
onAutofill: A,
|
31
32
|
onEdit: () => l(o),
|
32
33
|
templateName: o == null ? void 0 : o.displayName
|
33
34
|
}), /* @__PURE__ */ t(u, {
|
34
35
|
className: y.topDivider
|
35
|
-
}),
|
36
|
-
isAnyEmptyValueHidden:
|
36
|
+
}), e && v ? /* @__PURE__ */ t(g, {
|
37
|
+
isAnyEmptyValueHidden: f,
|
37
38
|
isBoxAiSuggestionsFeatureEnabled: d,
|
38
39
|
level: "instance",
|
39
|
-
onShowEmptyValues: () =>
|
40
|
-
}) : /* @__PURE__ */
|
41
|
-
children: [/* @__PURE__ */ t(
|
42
|
-
shouldHideEmptyValues:
|
43
|
-
taxonomyNodeFetcher:
|
40
|
+
onShowEmptyValues: () => r(!1)
|
41
|
+
}) : /* @__PURE__ */ a(n, {
|
42
|
+
children: [/* @__PURE__ */ t(H, {
|
43
|
+
shouldHideEmptyValues: e,
|
44
|
+
taxonomyNodeFetcher: h,
|
44
45
|
templateInstance: o
|
45
|
-
}),
|
46
|
+
}), E && /* @__PURE__ */ a(n, {
|
46
47
|
children: [/* @__PURE__ */ t(u, {
|
47
48
|
className: y.bottomDivider
|
48
|
-
}), /* @__PURE__ */ t(
|
49
|
-
isAnyEmptyValueHidden:
|
50
|
-
onHideEmptyValues: () =>
|
51
|
-
onShowEmptyValues: () =>
|
49
|
+
}), /* @__PURE__ */ t(_, {
|
50
|
+
isAnyEmptyValueHidden: e,
|
51
|
+
onHideEmptyValues: () => r(!0),
|
52
|
+
onShowEmptyValues: () => r(!1)
|
52
53
|
})]
|
53
54
|
})]
|
54
55
|
})]
|
55
56
|
});
|
56
57
|
};
|
57
58
|
export {
|
58
|
-
|
59
|
+
k as MetadataInstance
|
59
60
|
};
|
@@ -13,7 +13,7 @@ import '../../../../../../styles/metadata-instance-header.css';const b = "_metad
|
|
13
13
|
areAiSuggestionsAvailable: c,
|
14
14
|
canEdit: l,
|
15
15
|
isAiSuggestionsFeatureEnabled: d,
|
16
|
-
|
16
|
+
isBetaLanguageEnabled: m,
|
17
17
|
onEdit: u,
|
18
18
|
onAutofill: f,
|
19
19
|
templateName: n
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@box/metadata-editor",
|
3
|
-
"version": "0.88.
|
3
|
+
"version": "0.88.1",
|
4
4
|
"peerDependencies": {
|
5
5
|
"@ariakit/react": "0.4.15",
|
6
6
|
"@box/blueprint-web": "^7.30.3",
|
@@ -53,5 +53,5 @@
|
|
53
53
|
"**/*.css"
|
54
54
|
],
|
55
55
|
"license": "SEE LICENSE IN LICENSE",
|
56
|
-
"gitHead": "
|
56
|
+
"gitHead": "0ab4c8a654fe2eacfd9ed55dec81f84ec7e7ab66"
|
57
57
|
}
|
@@ -4,7 +4,7 @@ import { FormValues } from '../../types';
|
|
4
4
|
export type MetadataInstanceFormProps = {
|
5
5
|
areAiSuggestionsAvailable: boolean;
|
6
6
|
isAiSuggestionsFeatureEnabled: boolean;
|
7
|
-
|
7
|
+
isBetaLanguageEnabled: boolean;
|
8
8
|
isDeleteButtonDisabled: boolean;
|
9
9
|
isUnsavedChangesModalOpen: boolean;
|
10
10
|
selectedTemplateInstance: MetadataTemplateInstance | null;
|
@@ -23,7 +23,7 @@ export type MetadataInstanceFormWrapperProps<T> = {
|
|
23
23
|
children: React.ReactNode;
|
24
24
|
formValues: FormValues;
|
25
25
|
isAiSuggestionsFeatureEnabled: boolean;
|
26
|
-
|
26
|
+
isBetaLanguageEnabled: boolean;
|
27
27
|
isDeleteButtonDisabled: boolean;
|
28
28
|
isFetchingSuggestions: boolean;
|
29
29
|
isFormDirty: boolean;
|
@@ -1,2 +1,2 @@
|
|
1
1
|
import { MetadataInstanceFormAutofillButtonProps } from './types';
|
2
|
-
export declare const MetadataInstanceFormAutofillButton: ({ areAiSuggestionsAvailable,
|
2
|
+
export declare const MetadataInstanceFormAutofillButton: ({ areAiSuggestionsAvailable, isBetaLanguageEnabled, isLoading, variant, onAutofill, }: MetadataInstanceFormAutofillButtonProps) => import("react/jsx-runtime").JSX.Element;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { MetadataTemplateField, MetadataTemplateInstance } from '../../../../types';
|
2
2
|
export type MetadataInstanceFormAutofillButtonProps = {
|
3
3
|
areAiSuggestionsAvailable: boolean;
|
4
|
-
|
4
|
+
isBetaLanguageEnabled: boolean;
|
5
5
|
isLoading: boolean;
|
6
6
|
onAutofill?: (templateKey: MetadataTemplateInstance['templateKey'], scope: MetadataTemplateInstance['scope']) => Promise<MetadataTemplateField[]>;
|
7
7
|
variant?: 'secondary-button' | 'icon-button';
|
@@ -1,2 +1,2 @@
|
|
1
1
|
import { MetadataInstanceFormHeaderProps } from './types';
|
2
|
-
export declare const MetadataInstanceFormHeader: ({ areAiSuggestionsAvailable, hasSuggestions, isAiSuggestionsFeatureEnabled,
|
2
|
+
export declare const MetadataInstanceFormHeader: ({ areAiSuggestionsAvailable, hasSuggestions, isAiSuggestionsFeatureEnabled, isBetaLanguageEnabled, isLoading, templateName, onAutofill, }: MetadataInstanceFormHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
@@ -3,7 +3,7 @@ export type MetadataInstanceFormHeaderProps = {
|
|
3
3
|
areAiSuggestionsAvailable: boolean;
|
4
4
|
hasSuggestions: boolean;
|
5
5
|
isAiSuggestionsFeatureEnabled: boolean;
|
6
|
-
|
6
|
+
isBetaLanguageEnabled: boolean;
|
7
7
|
isLoading: boolean;
|
8
8
|
onAutofill?: (templateKey: MetadataTemplateInstance['templateKey'], scope: MetadataTemplateInstance['scope']) => Promise<MetadataTemplateField[]>;
|
9
9
|
templateName?: string;
|
@@ -1,2 +1,2 @@
|
|
1
1
|
import { MetadataInstanceListProps } from './types';
|
2
|
-
export declare const MetadataInstanceList: ({ areAiSuggestionsAvailable, isAiSuggestionsFeatureEnabled, onEdit, templateInstances, taxonomyNodeFetcher, }: MetadataInstanceListProps) => import("react/jsx-runtime").JSX.Element;
|
2
|
+
export declare const MetadataInstanceList: ({ areAiSuggestionsAvailable, isAiSuggestionsFeatureEnabled, isBetaLanguageEnabled, onEdit, templateInstances, taxonomyNodeFetcher, }: MetadataInstanceListProps) => import("react/jsx-runtime").JSX.Element;
|
@@ -1,2 +1,2 @@
|
|
1
1
|
import { MetadataInstanceProps } from './types';
|
2
|
-
export declare const MetadataInstance: ({ areAiSuggestionsAvailable, isAiSuggestionsFeatureEnabled, onEdit, templateInstance, taxonomyNodeFetcher, }: MetadataInstanceProps) => import("react/jsx-runtime").JSX.Element;
|
2
|
+
export declare const MetadataInstance: ({ areAiSuggestionsAvailable, isAiSuggestionsFeatureEnabled, isBetaLanguageEnabled, onEdit, templateInstance, taxonomyNodeFetcher, }: MetadataInstanceProps) => import("react/jsx-runtime").JSX.Element;
|
package/types/lib/components/metadata-instance-list/subcomponents/metadata-instance/types.d.ts
CHANGED
@@ -3,6 +3,7 @@ import { TaxonomyNodeFetcher } from '../metadata-instance-entry/types';
|
|
3
3
|
export type MetadataInstanceProps = {
|
4
4
|
areAiSuggestionsAvailable: boolean;
|
5
5
|
isAiSuggestionsFeatureEnabled: boolean;
|
6
|
+
isBetaLanguageEnabled: boolean;
|
6
7
|
onEdit: (templateInstance: MetadataTemplateInstance) => void;
|
7
8
|
templateInstance: MetadataTemplateInstance;
|
8
9
|
taxonomyNodeFetcher: TaxonomyNodeFetcher;
|
@@ -1,2 +1,2 @@
|
|
1
1
|
import { MetadataInstanceHeaderProps } from './types';
|
2
|
-
export declare const MetadataInstanceHeader: ({ areAiSuggestionsAvailable, canEdit, isAiSuggestionsFeatureEnabled,
|
2
|
+
export declare const MetadataInstanceHeader: ({ areAiSuggestionsAvailable, canEdit, isAiSuggestionsFeatureEnabled, isBetaLanguageEnabled, onEdit, onAutofill, templateName, }: MetadataInstanceHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
@@ -2,7 +2,7 @@ export type MetadataInstanceHeaderProps = {
|
|
2
2
|
areAiSuggestionsAvailable: boolean;
|
3
3
|
canEdit: boolean;
|
4
4
|
isAiSuggestionsFeatureEnabled: boolean;
|
5
|
-
|
5
|
+
isBetaLanguageEnabled: boolean;
|
6
6
|
onEdit: () => void;
|
7
7
|
onAutofill: () => void;
|
8
8
|
templateName?: string;
|
@@ -3,6 +3,7 @@ import { TaxonomyNodeFetcher } from './subcomponents/metadata-instance-entry/typ
|
|
3
3
|
export type MetadataInstanceListProps = {
|
4
4
|
areAiSuggestionsAvailable: boolean;
|
5
5
|
isAiSuggestionsFeatureEnabled: boolean;
|
6
|
+
isBetaLanguageEnabled: boolean;
|
6
7
|
onEdit: (templateInstacne: MetadataTemplateInstance) => void;
|
7
8
|
templateInstances: MetadataTemplateInstance[];
|
8
9
|
taxonomyNodeFetcher: TaxonomyNodeFetcher;
|