@box/metadata-editor 1.67.6 → 1.68.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.
- package/dist/chunks/interactive-text.module.js +5 -0
- package/dist/chunks/metadata-instance-entry.js +1 -1
- package/dist/chunks/utils.js +67 -37
- package/dist/esm/lib/components/interactive-text/interactive-text.js +18 -2
- package/dist/styles/interactive-text.css +1 -1
- package/dist/styles/utils.css +1 -1
- package/dist/types/lib/test-utils/index.d.ts +1 -0
- package/dist/types/lib/test-utils/mock-resize-observer.d.ts +5 -0
- package/package.json +1 -1
- package/dist/chunks/interactive-text.js +0 -17
|
@@ -4,7 +4,7 @@ import { checkIfHasBoundingBoxes as n } from "../esm/lib/utils/check-if-has-boun
|
|
|
4
4
|
import { getConfidenceScoreTooltip as r } from "../esm/lib/utils/confidence-score/get-confidence-score-tooltip.js";
|
|
5
5
|
import { t as i } from "./shared-field-styles.module.js";
|
|
6
6
|
import { convertISOStringToUTCDate as a } from "../esm/lib/utils/convertDate.js";
|
|
7
|
-
import
|
|
7
|
+
import o from "../esm/lib/components/interactive-text/interactive-text.js";
|
|
8
8
|
import s from "../esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/messages.js";
|
|
9
9
|
import { MetadataEntryDisplay as c } from "../esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/metadata-entry-display.js";
|
|
10
10
|
import { Status as l, Text as u, Tooltip as d } from "@box/blueprint-web";
|
package/dist/chunks/utils.js
CHANGED
|
@@ -1,53 +1,83 @@
|
|
|
1
1
|
import { isConfidenceScoreNeedingReview as e } from "../esm/lib/utils/confidence-score/is-confidence-score-needing-review.js";
|
|
2
2
|
import { convertISOStringtoRFC3339String as t } from "../esm/lib/utils/convertDate.js";
|
|
3
|
-
import { t as n } from "./interactive-text.js";
|
|
3
|
+
import { t as n } from "./interactive-text.module.js";
|
|
4
4
|
import { AiLogoBadge as r } from "../esm/lib/components/metadata-editor-fields/components/ai-logo-badge/ai-logo-badge.js";
|
|
5
5
|
import { LowConfidenceBadge as i } from "../esm/lib/components/metadata-editor-fields/components/low-confidence-badge/low-confidence-badge.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
children: [
|
|
30
|
-
|
|
31
|
-
className:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
6
|
+
import { Tooltip as a, useForkRef as o, useIsEllipsized as s } from "@box/blueprint-web";
|
|
7
|
+
import { createElement as c, memo as l, useRef as u } from "react";
|
|
8
|
+
import { Focusable as d } from "@ariakit/react";
|
|
9
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
10
|
+
import m from "clsx";
|
|
11
|
+
import '../styles/utils.css';var h = {
|
|
12
|
+
noAttributesText: "_noAttributesText_19lyy_2",
|
|
13
|
+
fieldWrapper: "_fieldWrapper_19lyy_6",
|
|
14
|
+
hasSuggestion: "_hasSuggestion_19lyy_11",
|
|
15
|
+
hasConfidenceReview: "_hasConfidenceReview_19lyy_16",
|
|
16
|
+
error: "_error_19lyy_25",
|
|
17
|
+
dateField: "_dateField_19lyy_44",
|
|
18
|
+
aiApproved: "_aiApproved_19lyy_49",
|
|
19
|
+
comboboxContainer: "_comboboxContainer_19lyy_49",
|
|
20
|
+
labelWrapper: "_labelWrapper_19lyy_95",
|
|
21
|
+
labelText: "_labelText_19lyy_101",
|
|
22
|
+
labelTruncated: "_labelTruncated_19lyy_104",
|
|
23
|
+
labelIcon: "_labelIcon_19lyy_111",
|
|
24
|
+
labelTooltipStack: "_labelTooltipStack_19lyy_118"
|
|
25
|
+
};
|
|
26
|
+
function g({ as: e, fieldDescription: t, fieldName: r, labelClassName: i, labelRef: l, ...h }) {
|
|
27
|
+
let g = u(null), _ = o(g, l);
|
|
28
|
+
return /* @__PURE__ */ f(a, {
|
|
29
|
+
content: s(g) ? /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("div", { children: r }), /* @__PURE__ */ f("div", { children: t })] }) : t,
|
|
30
|
+
children: /* @__PURE__ */ f(d, { render: /* @__PURE__ */ c(e, {
|
|
31
|
+
className: m(i, n.interactiveTextHint),
|
|
32
|
+
...h,
|
|
33
|
+
ref: _
|
|
34
|
+
}, r) })
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function _({ as: e, fieldName: t, labelClassName: n, labelRef: r, ...i }) {
|
|
38
|
+
let l = u(null), p = o(l, r), m = s(l) ? t : void 0, h = /* @__PURE__ */ c(e, {
|
|
39
|
+
className: n,
|
|
40
|
+
...i,
|
|
41
|
+
ref: p
|
|
42
|
+
}, t);
|
|
43
|
+
return m ? /* @__PURE__ */ f(a, {
|
|
44
|
+
content: m,
|
|
45
|
+
children: /* @__PURE__ */ f(d, { render: h })
|
|
46
|
+
}) : h;
|
|
47
|
+
}
|
|
48
|
+
var v = /* @__PURE__ */ l(function({ fieldName: t, fieldDescription: n, isAiSuggestionApplied: a, as: o, confidenceScore: s, labelProps: c }) {
|
|
49
|
+
let { className: l, ref: u, ...d } = c, v = m(l || h.labelText, h.labelTruncated), y = !!s && e(s), b = () => s && y ? /* @__PURE__ */ f(i, {}) : a || s ? /* @__PURE__ */ f(r, {
|
|
50
|
+
className: h.labelIcon,
|
|
51
|
+
confidenceScore: s
|
|
52
|
+
}) : null, x = n ? /* @__PURE__ */ f(g, {
|
|
53
|
+
as: o,
|
|
54
|
+
fieldDescription: n,
|
|
55
|
+
fieldName: t,
|
|
56
|
+
labelClassName: v,
|
|
57
|
+
labelRef: u,
|
|
58
|
+
...d
|
|
59
|
+
}) : /* @__PURE__ */ f(_, {
|
|
60
|
+
as: o,
|
|
61
|
+
fieldName: t,
|
|
62
|
+
labelClassName: v,
|
|
63
|
+
labelRef: u,
|
|
64
|
+
...d
|
|
65
|
+
});
|
|
66
|
+
return /* @__PURE__ */ p("div", {
|
|
67
|
+
className: h.labelWrapper,
|
|
68
|
+
children: [x, b()]
|
|
39
69
|
});
|
|
40
70
|
}, (e, t) => {
|
|
41
71
|
let n = e.labelProps, r = t.labelProps;
|
|
42
72
|
return e.fieldName === t.fieldName && e.fieldDescription === t.fieldDescription && e.isAiSuggestionApplied === t.isAiSuggestionApplied && e.confidenceScore === t.confidenceScore && e.as === t.as && n.className === r.className && n.htmlFor === r.htmlFor && n.id === r.id;
|
|
43
|
-
}),
|
|
73
|
+
}), y = (e, t, n = !1, r = "label", i) => (a) => /* @__PURE__ */ f(v, {
|
|
44
74
|
as: r,
|
|
45
75
|
confidenceScore: i,
|
|
46
76
|
fieldDescription: t,
|
|
47
77
|
fieldName: e,
|
|
48
78
|
isAiSuggestionApplied: n,
|
|
49
79
|
labelProps: a
|
|
50
|
-
}),
|
|
80
|
+
}), b = (e) => {
|
|
51
81
|
try {
|
|
52
82
|
let n = t(e), r = new Date(n);
|
|
53
83
|
return isNaN(r.getTime()) ? null : n;
|
|
@@ -55,4 +85,4 @@ import '../styles/utils.css';var u = {
|
|
|
55
85
|
return null;
|
|
56
86
|
}
|
|
57
87
|
};
|
|
58
|
-
export {
|
|
88
|
+
export { b as n, h as r, y as t };
|
|
@@ -1,2 +1,18 @@
|
|
|
1
|
-
import { t as e } from "../../../../chunks/interactive-text.js";
|
|
2
|
-
|
|
1
|
+
import { t as e } from "../../../../chunks/interactive-text.module.js";
|
|
2
|
+
import { Text as t, Tooltip as n } from "@box/blueprint-web";
|
|
3
|
+
import { Focusable as r } from "@ariakit/react";
|
|
4
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
5
|
+
import a from "clsx";
|
|
6
|
+
var o = ({ tooltipText: o, className: s, children: c, ...l }) => {
|
|
7
|
+
let { as: u = "span" } = l;
|
|
8
|
+
return /* @__PURE__ */ i(n, {
|
|
9
|
+
content: o,
|
|
10
|
+
children: /* @__PURE__ */ i(r, { render: /* @__PURE__ */ i(t, {
|
|
11
|
+
as: u,
|
|
12
|
+
className: a(e.interactiveText, s),
|
|
13
|
+
...l,
|
|
14
|
+
children: c
|
|
15
|
+
}) })
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
export { o as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._interactiveText_1szjz_1{width:fit-content}._interactiveText_1szjz_1,._interactiveTextHint_1szjz_6{text-underline-offset:2px;-webkit-text-decoration:dashed underline var(--gray-50) .5px!important;text-decoration:dashed underline var(--gray-50) .5px!important}._interactiveText_1szjz_1:hover,._interactiveTextHint_1szjz_6:hover{color:var(--gray-100);-webkit-text-decoration-color:var(--gray-100)!important;text-decoration-color:var(--gray-100)!important}
|
package/dist/styles/utils.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._noAttributesText_19lyy_2{text-align:center}._fieldWrapper_19lyy_6{isolation:isolate;position:relative}._fieldWrapper_19lyy_6 ._hasSuggestion_19lyy_11>input,._fieldWrapper_19lyy_6 ._hasSuggestion_19lyy_11>button,._fieldWrapper_19lyy_6 ._hasSuggestion_19lyy_11>div[role=group]>div,._fieldWrapper_19lyy_6 ._hasSuggestion_19lyy_11>div>div,._fieldWrapper_19lyy_6 ._hasSuggestion_19lyy_11>div>input,._fieldWrapper_19lyy_6 ._hasConfidenceReview_19lyy_16>input,._fieldWrapper_19lyy_6 ._hasConfidenceReview_19lyy_16>button,._fieldWrapper_19lyy_6 ._hasConfidenceReview_19lyy_16>div[role=group]>div,._fieldWrapper_19lyy_6 ._hasConfidenceReview_19lyy_16>div>div,._fieldWrapper_19lyy_6 ._hasConfidenceReview_19lyy_16>div>input{border-bottom:none!important;border-bottom-right-radius:0!important;border-bottom-left-radius:0!important}._fieldWrapper_19lyy_6 ._hasSuggestion_19lyy_11>input:not(:disabled,:focus-visible,._error_19lyy_25):hover,._fieldWrapper_19lyy_6 ._hasSuggestion_19lyy_11>button:not(:disabled,:focus-visible,._error_19lyy_25):hover,._fieldWrapper_19lyy_6 ._hasSuggestion_19lyy_11>div[role=group]>div:not(:disabled,:focus-visible,._error_19lyy_25):hover,._fieldWrapper_19lyy_6 ._hasSuggestion_19lyy_11>div>div:not(:disabled,:focus-visible,._error_19lyy_25):hover,._fieldWrapper_19lyy_6 ._hasSuggestion_19lyy_11>div>input:not(:disabled,:focus-visible,._error_19lyy_25):hover,._fieldWrapper_19lyy_6 ._hasConfidenceReview_19lyy_16>input:not(:disabled,:focus-visible,._error_19lyy_25):hover,._fieldWrapper_19lyy_6 ._hasConfidenceReview_19lyy_16>button:not(:disabled,:focus-visible,._error_19lyy_25):hover,._fieldWrapper_19lyy_6 ._hasConfidenceReview_19lyy_16>div[role=group]>div:not(:disabled,:focus-visible,._error_19lyy_25):hover,._fieldWrapper_19lyy_6 ._hasConfidenceReview_19lyy_16>div>div:not(:disabled,:focus-visible,._error_19lyy_25):hover,._fieldWrapper_19lyy_6 ._hasConfidenceReview_19lyy_16>div>input:not(:disabled,:focus-visible,._error_19lyy_25):hover{border-bottom:none}._fieldWrapper_19lyy_6 ._hasSuggestion_19lyy_11 div[role=group]>div,._fieldWrapper_19lyy_6 ._hasConfidenceReview_19lyy_16 div[role=group]>div{margin-right:var(--bp-border-01);margin-left:var(--bp-border-01)}._fieldWrapper_19lyy_6 ._dateField_19lyy_44>div[role=group]>div{padding-inline:var(--bp-space-030);background:var(--bp-surface-input-surface)}._fieldWrapper_19lyy_6 ._aiApproved_19lyy_49>._comboboxContainer_19lyy_49,._fieldWrapper_19lyy_6 ._aiApproved_19lyy_49>input,._fieldWrapper_19lyy_6 ._aiApproved_19lyy_49>button,._fieldWrapper_19lyy_6 ._aiApproved_19lyy_49>div[role=group]>div,._fieldWrapper_19lyy_6 ._aiApproved_19lyy_49>div>div,._fieldWrapper_19lyy_6 ._aiApproved_19lyy_49>div>input{outline:none;box-sizing:border-box!important;border:double var(--bp-border-01) transparent!important;background-image:linear-gradient(#fff,#fff),linear-gradient(135deg,#fe03dc 0%,#2784fa 100%)!important;background-origin:border-box!important;background-clip:padding-box,border-box!important}._fieldWrapper_19lyy_6 ._hasConfidenceReview_19lyy_16>._comboboxContainer_19lyy_49,._fieldWrapper_19lyy_6 ._hasConfidenceReview_19lyy_16>input,._fieldWrapper_19lyy_6 ._hasConfidenceReview_19lyy_16>button,._fieldWrapper_19lyy_6 ._hasConfidenceReview_19lyy_16>div[role=group]>div,._fieldWrapper_19lyy_6 ._hasConfidenceReview_19lyy_16>div>div,._fieldWrapper_19lyy_6 ._hasConfidenceReview_19lyy_16>div>input{outline:none;box-sizing:border-box!important;border:double var(--bp-border-01) transparent!important;padding-top:var(--bp-border-01)!important;background-image:linear-gradient(#fff,#fff),linear-gradient(135deg,#fe03dc 0%,#2784fa 100%)!important;background-origin:border-box!important;background-clip:padding-box,border-box!important;border-bottom:none!important;border-bottom-right-radius:0!important;border-bottom-left-radius:0!important}._fieldWrapper_19lyy_6 ._hasConfidenceReview_19lyy_16>input:focus-visible,._fieldWrapper_19lyy_6 ._hasConfidenceReview_19lyy_16>button:focus-visible,._fieldWrapper_19lyy_6 ._hasConfidenceReview_19lyy_16>div[role=group]>div:focus-within,._fieldWrapper_19lyy_6 ._hasConfidenceReview_19lyy_16>div>div:focus-within,._fieldWrapper_19lyy_6 ._hasConfidenceReview_19lyy_16>div>input:focus-visible{outline:0;background:#fff!important;border:.125rem solid #2486fc!important;border-bottom:none!important;padding-top:0!important}._labelWrapper_19lyy_95{justify-content:space-between;align-items:baseline;width:100%;display:flex}._labelWrapper_19lyy_95 ._labelText_19lyy_101{flex:unset!important}._labelWrapper_19lyy_95 ._labelTruncated_19lyy_104{white-space:nowrap;text-overflow:ellipsis;min-width:0;overflow:hidden;flex:0 auto!important}._labelWrapper_19lyy_95 ._labelIcon_19lyy_111{width:var(--bp-space-040);height:var(--bp-space-040);margin-inline:var(--bp-space-030);flex-shrink:0}._labelTooltipStack_19lyy_118{align-items:flex-start;gap:var(--bp-space-010,.25rem);text-align:left;flex-direction:column;display:flex}
|
package/package.json
CHANGED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Text as e, Tooltip as t } from "@box/blueprint-web";
|
|
2
|
-
import { Focusable as n } from "@ariakit/react";
|
|
3
|
-
import { jsx as r } from "react/jsx-runtime";
|
|
4
|
-
import i from "clsx";
|
|
5
|
-
import '../styles/interactive-text.css';var a = { interactiveText: "_interactiveText_1i8lr_1" }, o = ({ tooltipText: o, className: s, children: c, ...l }) => {
|
|
6
|
-
let { as: u = "span" } = l;
|
|
7
|
-
return /* @__PURE__ */ r(t, {
|
|
8
|
-
content: o,
|
|
9
|
-
children: /* @__PURE__ */ r(n, { render: /* @__PURE__ */ r(e, {
|
|
10
|
-
as: u,
|
|
11
|
-
className: i(a.interactiveText, s),
|
|
12
|
-
...l,
|
|
13
|
-
children: c
|
|
14
|
-
}) })
|
|
15
|
-
});
|
|
16
|
-
};
|
|
17
|
-
export { o as t };
|