@box/metadata-editor 1.50.0 → 1.51.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.
@@ -1,64 +1,75 @@
1
- import { Card as b, Divider as n } from "@box/blueprint-web";
2
- import { useState as g } from "react";
3
- import { useAutofill as H } from "../../../../utils/autofill-context.js";
4
- import { MetadataEmptyState as _ } from "../../../metadata-empty-state/metadata-empty-state.js";
5
- import { MetadataInstanceContent as M } from "../metadata-instance-content/metadata-instance-content.js";
6
- import { MetadataInstanceFooter as N } from "../metadata-instance-footer/metadata-instance-footer.js";
7
- import { MetadataInstanceHeader as x } from "../metadata-instance-header/metadata-instance-header.js";
8
- import { jsxs as r, jsx as o, Fragment as u } from "react/jsx-runtime";
9
- import '../../../../../../styles/metadata-instance.css';const F = "_topDivider_tzhlb_1", j = "_bottomDivider_tzhlb_5", p = {
10
- topDivider: F,
11
- bottomDivider: j
12
- }, G = ({
1
+ import { Card as x, Divider as v } from "@box/blueprint-web";
2
+ import { useState as S } from "react";
3
+ import { useAutofill as F } from "../../../../utils/autofill-context.js";
4
+ import { getFieldsNeedingReview as H } from "../../../../utils/confidence-score/get-fields-needing-review.js";
5
+ import { MetadataEmptyState as M } from "../../../metadata-empty-state/metadata-empty-state.js";
6
+ import { MetadataInstanceContent as R } 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 C } from "../metadata-instance-header/metadata-instance-header.js";
9
+ import { MetadataInstanceReviewNotice as j } from "../../../metadata-instance-review-notice/metadata-instance-review-notice.js";
10
+ import { jsxs as d, jsx as t, Fragment as p } from "react/jsx-runtime";
11
+ import '../../../../../../styles/metadata-instance.css';const T = "_topDivider_1xnom_1", k = "_reviewNotice_1xnom_5", B = "_bottomDivider_1xnom_9", l = {
12
+ topDivider: T,
13
+ reviewNotice: k,
14
+ bottomDivider: B
15
+ }, X = ({
13
16
  areAiSuggestionsAvailable: y,
14
- isAiSuggestionsFeatureEnabled: l,
15
- isBetaLanguageEnabled: c,
16
- onEdit: d,
17
- templateInstance: t,
17
+ isAiSuggestionsFeatureEnabled: n,
18
+ isBetaLanguageEnabled: f,
19
+ onEdit: s,
20
+ templateInstance: e,
18
21
  taxonomyNodeFetcher: h,
19
- isAdvancedExtractAgentEnabled: v = !1,
20
- isConfidenceScoreReviewEnabled: E
22
+ isAdvancedExtractAgentEnabled: N = !1,
23
+ isConfidenceScoreReviewEnabled: m = !1
21
24
  }) => {
22
- const i = t.fields, m = (e) => !e.value || Array.isArray(e.value) && e.value.length === 0, f = i.every(m), V = i.some(m), A = i.length > 0, [a, s] = g(!0), {
23
- getAiSuggestions: D
24
- } = H(), S = (e) => {
25
- d(t), D(t.templateKey, t.scope, e);
25
+ const i = e.fields, c = (o) => !o.value || Array.isArray(o.value) && o.value.length === 0, g = i.every(c), w = i.some(c), E = i.length > 0, u = H(i).length, V = m && u > 0, [r, a] = S(!0), {
26
+ getAiSuggestions: A
27
+ } = F(), D = (o) => {
28
+ s(e), A(e.templateKey, e.scope, o);
29
+ }, _ = () => {
30
+ s(e, !0);
26
31
  };
27
- return /* @__PURE__ */ r(b, {
28
- children: [/* @__PURE__ */ o(x, {
32
+ return /* @__PURE__ */ d(x, {
33
+ children: [/* @__PURE__ */ t(C, {
29
34
  areAiSuggestionsAvailable: y,
30
- canEdit: t.canEdit,
31
- isAdvancedExtractAgentEnabled: v,
32
- isAiSuggestionsFeatureEnabled: l,
33
- isBetaLanguageEnabled: c,
34
- onAutofill: S,
35
- onEdit: () => d(t),
36
- templateName: t?.displayName
37
- }), /* @__PURE__ */ o(n, {
38
- className: p.topDivider
39
- }), a && f ? /* @__PURE__ */ o(_, {
40
- isAnyEmptyValueHidden: A,
41
- isBoxAiSuggestionsFeatureEnabled: l,
35
+ canEdit: e.canEdit,
36
+ isAdvancedExtractAgentEnabled: N,
37
+ isAiSuggestionsFeatureEnabled: n,
38
+ isBetaLanguageEnabled: f,
39
+ onAutofill: D,
40
+ onEdit: () => s(e),
41
+ templateName: e?.displayName
42
+ }), /* @__PURE__ */ t(v, {
43
+ className: l.topDivider
44
+ }), V && /* @__PURE__ */ t("div", {
45
+ className: l.reviewNotice,
46
+ children: /* @__PURE__ */ t(j, {
47
+ fieldsNeedingReviewCount: u,
48
+ onTextToggleClick: _
49
+ })
50
+ }), r && g ? /* @__PURE__ */ t(M, {
51
+ isAnyEmptyValueHidden: E,
52
+ isBoxAiSuggestionsFeatureEnabled: n,
42
53
  level: "instance",
43
- onShowEmptyValues: () => s(!1)
44
- }) : /* @__PURE__ */ r(u, {
45
- children: [/* @__PURE__ */ o(M, {
46
- isConfidenceScoreReviewEnabled: E,
47
- shouldHideEmptyValues: a,
54
+ onShowEmptyValues: () => a(!1)
55
+ }) : /* @__PURE__ */ d(p, {
56
+ children: [/* @__PURE__ */ t(R, {
57
+ isConfidenceScoreReviewEnabled: m,
58
+ shouldHideEmptyValues: r,
48
59
  taxonomyNodeFetcher: h,
49
- templateInstance: t
50
- }), V && /* @__PURE__ */ r(u, {
51
- children: [/* @__PURE__ */ o(n, {
52
- className: p.bottomDivider
53
- }), /* @__PURE__ */ o(N, {
54
- isAnyEmptyValueHidden: a,
55
- onHideEmptyValues: () => s(!0),
56
- onShowEmptyValues: () => s(!1)
60
+ templateInstance: e
61
+ }), w && /* @__PURE__ */ d(p, {
62
+ children: [/* @__PURE__ */ t(v, {
63
+ className: l.bottomDivider
64
+ }), /* @__PURE__ */ t(b, {
65
+ isAnyEmptyValueHidden: r,
66
+ onHideEmptyValues: () => a(!0),
67
+ onShowEmptyValues: () => a(!1)
57
68
  })]
58
69
  })]
59
70
  })]
60
71
  });
61
72
  };
62
73
  export {
63
- G as MetadataInstance
74
+ X as MetadataInstance
64
75
  };
@@ -1 +1 @@
1
- ._topDivider_tzhlb_1{margin-block-end:var(--space-4)}._bottomDivider_tzhlb_5{margin-block-start:var(--space-4)}
1
+ ._topDivider_1xnom_1,._reviewNotice_1xnom_5{margin-block-end:var(--bp-space-040)}._bottomDivider_1xnom_9{margin-block-start:var(--bp-space-040)}
@@ -15,4 +15,4 @@ export declare const ComboboxWithApiPagination: import('react').ForwardRefExotic
15
15
  experimentalVirtualization?: boolean;
16
16
  className?: string;
17
17
  displaySingleSelectionAsChip?: boolean;
18
- } & import('@box/blueprint-web').Labelable & import('react').RefAttributes<HTMLInputElement>>;
18
+ } & import('@box/blueprint-web/lib-esm/util-components/labelable/types').Labelable & import('react').RefAttributes<HTMLInputElement>>;
@@ -1,4 +1,4 @@
1
- import { Labelable } from '@box/blueprint-web/src/lib/util-components/labelable/types';
1
+ import { Labelable } from '@box/blueprint-web/lib-esm/util-components/labelable/types';
2
2
  import { ReactElement } from 'react';
3
3
  export interface PaginationQueryInput {
4
4
  marker?: string;
@@ -4,7 +4,7 @@ export type MetadataInstanceProps = {
4
4
  areAiSuggestionsAvailable: boolean;
5
5
  isAiSuggestionsFeatureEnabled: boolean;
6
6
  isBetaLanguageEnabled: boolean;
7
- onEdit: (templateInstance: MetadataTemplateInstance) => void;
7
+ onEdit: (templateInstance: MetadataTemplateInstance, shouldEnableReviewFilter?: boolean) => void;
8
8
  templateInstance: MetadataTemplateInstance;
9
9
  taxonomyNodeFetcher: TaxonomyNodeFetcher;
10
10
  isAdvancedExtractAgentEnabled?: boolean;
@@ -6,7 +6,7 @@ export type MetadataInstanceListProps = {
6
6
  isBetaLanguageEnabled: boolean;
7
7
  isAdvancedExtractAgentEnabled?: boolean;
8
8
  isConfidenceScoreReviewEnabled?: boolean;
9
- onEdit: (templateInstacne: MetadataTemplateInstance) => void;
9
+ onEdit: (templateInstance: MetadataTemplateInstance, shouldEnableReviewFilter?: boolean) => void;
10
10
  templateInstances: MetadataTemplateInstance[];
11
11
  taxonomyNodeFetcher: TaxonomyNodeFetcher;
12
12
  };
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@box/metadata-editor",
3
- "version": "1.50.0",
3
+ "version": "1.51.1",
4
4
  "peerDependencies": {
5
5
  "@ariakit/react": "0.4.15",
6
- "@box/box-ai-agent-selector": "^1.38.0",
7
- "@box/blueprint-web": "^13.3.0",
8
- "@box/blueprint-web-assets": "^4.101.14",
9
- "@box/combobox-with-api": "^1.41.1",
6
+ "@box/box-ai-agent-selector": "^1.38.2",
7
+ "@box/blueprint-web": "^13.3.2",
8
+ "@box/blueprint-web-assets": "^4.101.16",
9
+ "@box/combobox-with-api": "^1.41.3",
10
10
  "formik": "^2.0.3",
11
11
  "lodash": "^4.17.15",
12
12
  "react": "^17.0.0 || ^18.0.0",
@@ -15,11 +15,11 @@
15
15
  },
16
16
  "devDependencies": {
17
17
  "@ariakit/react": "0.4.15",
18
- "@box/box-ai-agent-selector": "^1.38.0",
19
- "@box/babel-plugin-target-attributes": "1.5.0",
20
- "@box/blueprint-web": "^13.3.0",
21
- "@box/blueprint-web-assets": "^4.101.14",
22
- "@box/storybook-utils": "^0.16.51",
18
+ "@box/box-ai-agent-selector": "^1.38.2",
19
+ "@box/babel-plugin-target-attributes": "1.5.2",
20
+ "@box/blueprint-web": "^13.3.2",
21
+ "@box/blueprint-web-assets": "^4.101.16",
22
+ "@box/storybook-utils": "^0.16.53",
23
23
  "@testing-library/react": "^15.0.6",
24
24
  "react": "^18.3.0",
25
25
  "react-dom": "^18.3.0",