@box/metadata-editor 0.65.0 → 0.65.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.
@@ -1,50 +1,50 @@
|
|
1
1
|
import "../../../../../../styles/metadata-instance.css";
|
2
|
-
import {
|
3
|
-
import {
|
4
|
-
import { useAutofill as
|
5
|
-
import {
|
6
|
-
import { MetadataInstanceContent as
|
7
|
-
import { MetadataInstanceFooter as
|
8
|
-
import {
|
9
|
-
import { jsxs as
|
10
|
-
const
|
11
|
-
topDivider:
|
12
|
-
bottomDivider:
|
13
|
-
},
|
2
|
+
import { Card as h, Divider as l } from "@box/blueprint-web";
|
3
|
+
import { useState as D } from "react";
|
4
|
+
import { useAutofill as V } from "../../../../utils/autofill-context.js";
|
5
|
+
import { MetadataEmptyState as A } from "../../../metadata-empty-state/metadata-empty-state.js";
|
6
|
+
import { MetadataInstanceContent as S } from "../metadata-instance-content/metadata-instance-content.js";
|
7
|
+
import { MetadataInstanceFooter as b } from "../metadata-instance-footer/metadata-instance-footer.js";
|
8
|
+
import { MetadataInstanceHeader as H } from "../metadata-instance-header/metadata-instance-header.js";
|
9
|
+
import { jsxs as d, jsx as t, Fragment as u } from "react/jsx-runtime";
|
10
|
+
const _ = "_topDivider_tzhlb_1", g = "_bottomDivider_tzhlb_5", n = {
|
11
|
+
topDivider: _,
|
12
|
+
bottomDivider: g
|
13
|
+
}, K = ({
|
14
14
|
areAiSuggestionsAvailable: p,
|
15
|
-
isAiSuggestionsFeatureEnabled:
|
16
|
-
onEdit:
|
17
|
-
templateInstance:
|
15
|
+
isAiSuggestionsFeatureEnabled: a,
|
16
|
+
onEdit: m,
|
17
|
+
templateInstance: o
|
18
18
|
}) => {
|
19
|
-
const
|
20
|
-
getAiSuggestions:
|
21
|
-
} =
|
22
|
-
|
23
|
-
|
19
|
+
const i = o.fields, y = i.every((s) => !s.value), f = i.some((s) => !s.value), c = i.length > 0, [e, r] = D(!0), {
|
20
|
+
getAiSuggestions: v
|
21
|
+
} = V(), E = () => {
|
22
|
+
m(o), v(o.templateKey, i);
|
23
|
+
};
|
24
|
+
return /* @__PURE__ */ d(h, {
|
25
|
+
children: [/* @__PURE__ */ t(H, {
|
24
26
|
areAiSuggestionsAvailable: p,
|
25
|
-
canEdit:
|
26
|
-
isAiSuggestionsFeatureEnabled:
|
27
|
-
onAutofill:
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
templateName: t == null ? void 0 : t.displayName
|
32
|
-
}), /* @__PURE__ */ o(m, {
|
27
|
+
canEdit: o.canEdit,
|
28
|
+
isAiSuggestionsFeatureEnabled: a,
|
29
|
+
onAutofill: E,
|
30
|
+
onEdit: () => m(o),
|
31
|
+
templateName: o == null ? void 0 : o.displayName
|
32
|
+
}), /* @__PURE__ */ t(l, {
|
33
33
|
className: n.topDivider
|
34
|
-
}),
|
34
|
+
}), e && y ? /* @__PURE__ */ t(A, {
|
35
35
|
isAnyEmptyValueHidden: c,
|
36
|
-
isBoxAiSuggestionsFeatureEnabled:
|
36
|
+
isBoxAiSuggestionsFeatureEnabled: a,
|
37
37
|
level: "instance",
|
38
38
|
onShowEmptyValues: () => r(!1)
|
39
|
-
}) : /* @__PURE__ */
|
40
|
-
children: [/* @__PURE__ */
|
41
|
-
shouldHideEmptyValues:
|
42
|
-
templateInstance:
|
43
|
-
}), f && /* @__PURE__ */
|
44
|
-
children: [/* @__PURE__ */
|
39
|
+
}) : /* @__PURE__ */ d(u, {
|
40
|
+
children: [/* @__PURE__ */ t(S, {
|
41
|
+
shouldHideEmptyValues: e,
|
42
|
+
templateInstance: o
|
43
|
+
}), f && /* @__PURE__ */ d(u, {
|
44
|
+
children: [/* @__PURE__ */ t(l, {
|
45
45
|
className: n.bottomDivider
|
46
|
-
}), /* @__PURE__ */
|
47
|
-
isAnyEmptyValueHidden:
|
46
|
+
}), /* @__PURE__ */ t(b, {
|
47
|
+
isAnyEmptyValueHidden: e,
|
48
48
|
onHideEmptyValues: () => r(!0),
|
49
49
|
onShowEmptyValues: () => r(!1)
|
50
50
|
})]
|
@@ -53,5 +53,5 @@ const H = "_topDivider_tzhlb_1", _ = "_bottomDivider_tzhlb_5", n = {
|
|
53
53
|
});
|
54
54
|
};
|
55
55
|
export {
|
56
|
-
|
56
|
+
K as MetadataInstance
|
57
57
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@box/metadata-editor",
|
3
|
-
"version": "0.65.
|
3
|
+
"version": "0.65.2",
|
4
4
|
"peerDependencies": {
|
5
5
|
"@ariakit/react": "0.4.5",
|
6
6
|
"@box/blueprint-web": "^7.30.3",
|
@@ -14,7 +14,7 @@
|
|
14
14
|
"devDependencies": {
|
15
15
|
"@ariakit/react": "0.4.5",
|
16
16
|
"@box/babel-plugin-target-attributes": "1.3.0",
|
17
|
-
"@box/blueprint-web": "^7.33.
|
17
|
+
"@box/blueprint-web": "^7.33.1",
|
18
18
|
"@box/blueprint-web-assets": "^4.27.0",
|
19
19
|
"@box/storybook-utils": "^0.6.1",
|
20
20
|
"@testing-library/react": "^15.0.6",
|
@@ -53,5 +53,5 @@
|
|
53
53
|
"**/*.css"
|
54
54
|
],
|
55
55
|
"license": "SEE LICENSE IN LICENSE",
|
56
|
-
"gitHead": "
|
56
|
+
"gitHead": "e77ce4a2951397e35430076450d0390e3ef81d46"
|
57
57
|
}
|
@@ -24,6 +24,8 @@ declare const customTemplateInstance: MetadataTemplateInstance;
|
|
24
24
|
declare const customTemplateInstanceWithoutEmptyValues: MetadataTemplateInstance;
|
25
25
|
declare const emptyCustomTemplateInstance: MetadataTemplateInstance;
|
26
26
|
declare const customTemplateInstanceWithAllFieldsEmpty: MetadataTemplateInstance;
|
27
|
+
declare const templateInstanceWithoutEditPermissions: MetadataTemplateInstance;
|
28
|
+
declare const customTemplateInstanceWithoutEditPermissions: MetadataTemplateInstance;
|
27
29
|
declare const templateInstancesList: MetadataTemplateInstance[];
|
28
30
|
declare const allFieldsWithAiSuggestions: MetadataTemplateField[];
|
29
31
|
declare const allFieldsSuggestions: AutofillSuggestions;
|
@@ -33,4 +35,4 @@ declare const firstTemplateInstanceFieldsWithSuggestions: MetadataTemplateField[
|
|
33
35
|
declare const secondTemplateInstance: MetadataTemplate;
|
34
36
|
declare const secondTemplateSuggestions: AutofillSuggestions;
|
35
37
|
declare const secondTemplateInstanceFieldsWithSuggestions: MetadataTemplateField[];
|
36
|
-
export { allFieldsTemplate, allFieldsTemplateInstance, customTemplate, customTemplateInstance, customTemplateInstanceWithAllFieldsEmpty, customTemplateInstanceWithoutEmptyValues, dateField, emptyCustomTemplateInstance, emptyTemplateInstance, enumField, fields, floatField, hiddenField, multiSelectField, noFieldsTemplate, nonHiddenFieldsTemplate, nonHiddenFieldsWithValuesTemplate, noValueField,
|
38
|
+
export { allFieldsSuggestions, allFieldsTemplate, allFieldsTemplateInstance, allFieldsWithAiSuggestions, customTemplate, customTemplateInstance, customTemplateInstanceWithAllFieldsEmpty, customTemplateInstanceWithoutEditPermissions, customTemplateInstanceWithoutEmptyValues, dateField, emptyCustomTemplateInstance, emptyTemplateInstance, enumField, fields, firstTemplateInstance, firstTemplateInstanceFieldsWithSuggestions, firstTemplateSuggestions, floatField, hiddenField, multiSelectField, noFieldsTemplate, nonHiddenFieldsTemplate, nonHiddenFieldsWithValuesTemplate, noValueField, secondTemplateInstance, secondTemplateInstanceFieldsWithSuggestions, secondTemplateSuggestions, stringField, taxonomyMultiSelectSingleLevelField, taxonomySingleSelectSingleLevelField, templateInstancesList, templateInstanceWithAllFieldsEmpty, templateInstanceWithoutEditPermissions, templateInstanceWithoutEmptyValues, templateOptions, templates, };
|