@box/metadata-editor 1.54.3 → 1.55.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.
@@ -1,37 +1,33 @@
1
- import { Focusable as a, Status as m, Tooltip as f } from "@box/blueprint-web";
1
+ import { Tooltip as c, Status as a } from "@box/blueprint-web";
2
2
  import { BoxAiLogo as r } from "@box/blueprint-web-assets/icons/Logo";
3
- import { SurfaceStatusSurfaceGray as p } from "@box/blueprint-web-assets/tokens/tokens";
4
- import { useIntl as u } from "react-intl";
5
- import { jsx as t } from "react/jsx-runtime";
6
- import { getConfidenceScoreTooltip as s } from "../../../../utils/confidence-score/get-confidence-score-tooltip.js";
7
- function S({
8
- confidenceScore: o,
3
+ import { SurfaceStatusSurfaceGray as m } from "@box/blueprint-web-assets/tokens/tokens";
4
+ import { useIntl as f } from "react-intl";
5
+ import { jsx as o } from "react/jsx-runtime";
6
+ import { getConfidenceScoreTooltip as p } from "../../../../utils/confidence-score/get-confidence-score-tooltip.js";
7
+ function T({
8
+ confidenceScore: t,
9
9
  className: e
10
10
  }) {
11
11
  const {
12
12
  formatMessage: i
13
- } = u();
14
- if (!o)
15
- return /* @__PURE__ */ t(r, {
13
+ } = f();
14
+ if (!t)
15
+ return /* @__PURE__ */ o(r, {
16
16
  className: e
17
17
  });
18
- const n = s(i, o), c = o.isAccepted ? /* @__PURE__ */ t(a, {
19
- children: /* @__PURE__ */ t(r, {
20
- className: e
21
- })
22
- }) : /* @__PURE__ */ t(m, {
23
- hideText: !0,
24
- icon: r,
25
- interactive: !0,
26
- text: "",
27
- color: p,
28
- "data-testid": "ai-confidence-badge"
29
- });
30
- return /* @__PURE__ */ t(f, {
18
+ const n = p(i, t);
19
+ return /* @__PURE__ */ o(c, {
31
20
  content: n,
32
- children: c
21
+ children: /* @__PURE__ */ o(a, {
22
+ hideText: !0,
23
+ icon: r,
24
+ interactive: !0,
25
+ text: "",
26
+ color: m,
27
+ "data-testid": "ai-confidence-badge"
28
+ })
33
29
  });
34
30
  }
35
31
  export {
36
- S as AiLogoBadge
32
+ T as AiLogoBadge
37
33
  };
@@ -57,6 +57,18 @@ export type ConfidenceScoreData = {
57
57
  /** Whether the user has explicitly accepted this field value */
58
58
  isAccepted: boolean;
59
59
  };
60
+ export type MetadataBoundingBox = {
61
+ left: number;
62
+ top: number;
63
+ right: number;
64
+ bottom: number;
65
+ };
66
+ export type MetadataTargetLocationEntry = {
67
+ itemId: string;
68
+ page: number;
69
+ text: string;
70
+ boundingBox?: MetadataBoundingBox;
71
+ };
60
72
  export type MetadataTemplateField = {
61
73
  description?: string;
62
74
  aiSuggestion?: MetadataFieldValue;
@@ -73,8 +85,7 @@ export type MetadataTemplateField = {
73
85
  taxonomyKey?: string;
74
86
  taxonomyId?: string;
75
87
  levels?: Level[];
76
- /** Todo: format is unknown for now, TBD */
77
- targetLocation?: Record<string, unknown>;
88
+ targetLocation?: MetadataTargetLocationEntry[];
78
89
  type: MetadataTemplateFieldType;
79
90
  updateMode?: MetadataUpdateMode;
80
91
  value?: MetadataFormFieldValue;
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@box/metadata-editor",
3
- "version": "1.54.3",
3
+ "version": "1.55.0",
4
4
  "peerDependencies": {
5
5
  "@ariakit/react": "0.4.15",
6
- "@box/box-ai-agent-selector": "^1.38.33",
7
- "@box/blueprint-web": "^13.8.4",
8
- "@box/blueprint-web-assets": "^4.109.3",
9
- "@box/combobox-with-api": "^1.41.34",
6
+ "@box/box-ai-agent-selector": "^1.38.34",
7
+ "@box/blueprint-web": "^13.9.0",
8
+ "@box/blueprint-web-assets": "^4.109.4",
9
+ "@box/combobox-with-api": "^1.41.35",
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.33",
18
+ "@box/box-ai-agent-selector": "^1.38.34",
19
19
  "@box/babel-plugin-target-attributes": "1.5.7",
20
- "@box/blueprint-web": "^13.8.4",
21
- "@box/blueprint-web-assets": "^4.109.3",
22
- "@box/storybook-utils": "^0.16.83",
20
+ "@box/blueprint-web": "^13.9.0",
21
+ "@box/blueprint-web-assets": "^4.109.4",
22
+ "@box/storybook-utils": "^0.16.84",
23
23
  "@testing-library/react": "^15.0.6",
24
24
  "react": "^18.3.0",
25
25
  "react-dom": "^18.3.0",