@box/metadata-editor 0.66.1 → 0.66.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,14 +1,15 @@
1
1
  import "../../../../../../styles/metadata-instance-form-header.css";
2
- import { Text as x, Tooltip as M, Button as _ } from "@box/blueprint-web";
3
- import { BoxAiLogo as H } from "@box/blueprint-web-assets/icons/Logo";
4
- import { useFormikContext as k, getIn as m } from "formik";
5
- import { useIntl as v } from "react-intl";
2
+ import { Tooltip as _, Button as b } from "@box/blueprint-web";
3
+ import { BoxAiLogo as M } from "@box/blueprint-web-assets/icons/Logo";
4
+ import { useFormikContext as T, getIn as m } from "formik";
5
+ import { useIntl as h } from "react-intl";
6
+ import k from "../../../truncated-header-text/truncated-header-text.js";
6
7
  import e from "./messages.js";
7
8
  import { jsxs as A, jsx as n } from "react/jsx-runtime";
8
- const T = "_metadataInstanceFormHeader_1b2cc_1", S = "_title_1b2cc_8", c = {
9
- metadataInstanceFormHeader: T,
9
+ const v = "_metadataInstanceFormHeader_13lxr_1", S = "_title_13lxr_9", c = {
10
+ metadataInstanceFormHeader: v,
10
11
  title: S
11
- }, V = ({
12
+ }, q = ({
12
13
  areAiSuggestionsAvailable: d,
13
14
  isAiSuggestionsFeatureEnabled: u,
14
15
  isLoading: s,
@@ -18,32 +19,30 @@ const T = "_metadataInstanceFormHeader_1b2cc_1", S = "_title_1b2cc_8", c = {
18
19
  const {
19
20
  isSubmitting: p,
20
21
  values: i,
21
- setFieldValue: B
22
- } = k(), t = v(), I = async () => {
22
+ setFieldValue: x
23
+ } = T(), t = h(), B = async () => {
23
24
  const r = m(i, "metadata.fields"), F = m(i, "metadata.templateKey"), a = await g(F, r);
24
- B("metadata.fields", r.map((o) => {
25
- const l = a == null ? void 0 : a.find((h) => h.key === o.key);
25
+ x("metadata.fields", r.map((o) => {
26
+ const l = a == null ? void 0 : a.find((H) => H.key === o.key);
26
27
  return l ? {
27
28
  ...o,
28
29
  aiSuggestion: l.aiSuggestion
29
30
  } : o;
30
31
  }));
31
- }, b = f ?? t.formatMessage(e.customInstanceTitle), y = !d || p || s;
32
+ }, I = f ?? t.formatMessage(e.customInstanceTitle), y = !d || p || s;
32
33
  return /* @__PURE__ */ A("div", {
33
34
  className: c.metadataInstanceFormHeader,
34
- children: [/* @__PURE__ */ n(x, {
35
- as: "h1",
35
+ children: [/* @__PURE__ */ n(k, {
36
36
  className: c.title,
37
- variant: "titleMedium",
38
- children: b
39
- }), u && /* @__PURE__ */ n(M, {
37
+ title: I
38
+ }), u && /* @__PURE__ */ n(_, {
40
39
  content: t.formatMessage(e.autofillButtonTooltip),
41
- children: /* @__PURE__ */ n(_, {
40
+ children: /* @__PURE__ */ n(b, {
42
41
  disabled: y,
43
- icon: H,
42
+ icon: M,
44
43
  loading: s,
45
44
  loadingAriaLabel: t.formatMessage(e.loadingButtonAriaLabel),
46
- onClick: I,
45
+ onClick: B,
47
46
  variant: "secondary",
48
47
  "data-target-id": "Button-autofillButton",
49
48
  children: t.formatMessage(e.autofillButton)
@@ -52,5 +51,5 @@ const T = "_metadataInstanceFormHeader_1b2cc_1", S = "_title_1b2cc_8", c = {
52
51
  });
53
52
  };
54
53
  export {
55
- V as MetadataInstanceFormHeader
54
+ q as MetadataInstanceFormHeader
56
55
  };
@@ -1,54 +1,53 @@
1
1
  import "../../../../../../styles/metadata-instance-header.css";
2
- import { Text as b, Tooltip as i, IconButton as s } from "@box/blueprint-web";
3
- import { Pencil as g } from "@box/blueprint-web-assets/icons/Line";
4
- import { BoxAiLogo as I } from "@box/blueprint-web-assets/icons/Logo";
5
- import { useIntl as _ } from "react-intl";
2
+ import { Tooltip as i, IconButton as r } from "@box/blueprint-web";
3
+ import { Pencil as p } from "@box/blueprint-web-assets/icons/Line";
4
+ import { BoxAiLogo as g } from "@box/blueprint-web-assets/icons/Logo";
5
+ import { useIntl as I } from "react-intl";
6
+ import _ from "../../../truncated-header-text/truncated-header-text.js";
6
7
  import n from "./messages.js";
7
- import { jsxs as r, jsx as a } from "react/jsx-runtime";
8
- const h = "_metadataInstanceHeader_1vbbg_1", p = "_iconButtonsContainer_1vbbg_7", v = "_title_1vbbg_15", e = {
9
- metadataInstanceHeader: h,
10
- iconButtonsContainer: p,
11
- title: v
12
- }, j = ({
8
+ import { jsxs as s, jsx as a } from "react/jsx-runtime";
9
+ const x = "_metadataInstanceHeader_54pdx_1", b = "_iconButtonsContainer_54pdx_6", A = "_title_54pdx_14", e = {
10
+ metadataInstanceHeader: x,
11
+ iconButtonsContainer: b,
12
+ title: A
13
+ }, k = ({
13
14
  areAiSuggestionsAvailable: c,
14
15
  canEdit: l,
15
16
  isAiSuggestionsFeatureEnabled: d,
16
- onEdit: u,
17
- onAutofill: m,
17
+ onEdit: m,
18
+ onAutofill: u,
18
19
  templateName: t
19
20
  }) => {
20
- const o = _(), B = t || o.formatMessage(n.customInstanceTitle), f = d && t;
21
- return /* @__PURE__ */ r("div", {
21
+ const o = I(), f = t || o.formatMessage(n.customInstanceTitle), B = d && t;
22
+ return /* @__PURE__ */ s("div", {
22
23
  className: e.metadataInstanceHeader,
23
- children: [/* @__PURE__ */ a(b, {
24
- as: "h1",
24
+ children: [/* @__PURE__ */ a(_, {
25
25
  className: e.title,
26
- variant: "titleMedium",
27
- children: B
28
- }), l && /* @__PURE__ */ r("div", {
26
+ title: f
27
+ }), l && /* @__PURE__ */ s("div", {
29
28
  className: e.iconButtonsContainer,
30
- children: [f && /* @__PURE__ */ a(i, {
29
+ children: [B && /* @__PURE__ */ a(i, {
31
30
  content: o.formatMessage(n.autofillButtonTooltip, {
32
31
  templateName: t
33
32
  }),
34
- children: /* @__PURE__ */ a(s, {
33
+ children: /* @__PURE__ */ a(r, {
35
34
  "aria-label": o.formatMessage(n.autofillButtonAriaLabel, {
36
35
  templateName: t
37
36
  }),
38
37
  disabled: !c,
39
- icon: I,
40
- onClick: m,
38
+ icon: g,
39
+ onClick: u,
41
40
  variant: "icon-logo",
42
41
  "data-target-id": "IconButton-autofillButtonAriaLabel"
43
42
  })
44
43
  }), /* @__PURE__ */ a(i, {
45
44
  content: o.formatMessage(n.editButtonTooltip),
46
- children: /* @__PURE__ */ a(s, {
45
+ children: /* @__PURE__ */ a(r, {
47
46
  "aria-label": o.formatMessage(n.editButtonAriaLabel, {
48
47
  templateName: t
49
48
  }),
50
- icon: g,
51
- onClick: u,
49
+ icon: p,
50
+ onClick: m,
52
51
  "data-target-id": "IconButton-editButtonAriaLabel"
53
52
  })
54
53
  })]
@@ -56,5 +55,5 @@ const h = "_metadataInstanceHeader_1vbbg_1", p = "_iconButtonsContainer_1vbbg_7"
56
55
  });
57
56
  };
58
57
  export {
59
- j as MetadataInstanceHeader
58
+ k as MetadataInstanceHeader
60
59
  };
@@ -0,0 +1,38 @@
1
+ import "../../../../styles/truncated-header-text.css";
2
+ import { Focusable as l } from "@ariakit/react";
3
+ import { Text as m } from "@box/blueprint-web";
4
+ import { useFullTextTooltip as p } from "@box/blueprint-web/src/lib/utils/useFullTextTooltip";
5
+ import i from "clsx";
6
+ import { useRef as n } from "react";
7
+ import { jsx as e, Fragment as d } from "react/jsx-runtime";
8
+ const c = "_header_d9pl2_1", f = {
9
+ header: c
10
+ }, b = ({
11
+ className: o,
12
+ title: r
13
+ }) => {
14
+ const t = n(null), {
15
+ Wrapper: a,
16
+ wrapperProps: s
17
+ } = p({
18
+ ref: t,
19
+ textValue: r
20
+ });
21
+ return /* @__PURE__ */ e(d, {
22
+ children: /* @__PURE__ */ e(a, {
23
+ ...s,
24
+ children: /* @__PURE__ */ e(l, {
25
+ render: /* @__PURE__ */ e(m, {
26
+ ref: t,
27
+ as: "h1",
28
+ className: i(f.header, o),
29
+ variant: "titleMedium",
30
+ children: r
31
+ })
32
+ })
33
+ })
34
+ });
35
+ };
36
+ export {
37
+ b as default
38
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/metadata-editor",
3
- "version": "0.66.1",
3
+ "version": "0.66.2",
4
4
  "peerDependencies": {
5
5
  "@ariakit/react": "0.4.5",
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": "322d297c0f3b9276c89abc74a8889e21150482e4"
56
+ "gitHead": "68206eae5c0d7a75eebc0c49c911b1cd0b77c419"
57
57
  }
@@ -1 +1 @@
1
- ._metadataInstanceFormHeader_1b2cc_1{display:flex;justify-content:space-between;align-items:center;padding-block-end:var(--space-4);border-block-end:solid var(--gray-10) var(--border-1)}._metadataInstanceFormHeader_1b2cc_1 ._title_1b2cc_8{width:100%}
1
+ ._metadataInstanceFormHeader_13lxr_1{display:flex;justify-content:space-between;align-items:center;padding-block-end:var(--space-4);border-block-end:solid var(--gray-10) var(--border-1);gap:var(--space-2)}._metadataInstanceFormHeader_13lxr_1 ._title_13lxr_9{width:100%}
@@ -1 +1 @@
1
- ._metadataInstanceHeader_1vbbg_1{display:flex;justify-content:flex-end;height:var(--size-10);width:100%}._metadataInstanceHeader_1vbbg_1 ._iconButtonsContainer_1vbbg_7{display:flex;gap:var(--space-1);justify-content:flex-end;align-self:center;margin-block:0 var(--space-2);width:100%}._metadataInstanceHeader_1vbbg_1 ._title_1vbbg_15{align-self:center;margin-block:var(--space-1) var(--space-3);width:100%}
1
+ ._metadataInstanceHeader_54pdx_1{display:flex;justify-content:space-between;height:var(--size-10)}._metadataInstanceHeader_54pdx_1 ._iconButtonsContainer_54pdx_6{display:flex;gap:var(--space-1);justify-content:flex-end;align-self:center;margin-block:0 var(--space-2);padding-left:var(--space-2)}._metadataInstanceHeader_54pdx_1 ._title_54pdx_14{margin-block:var(--space-1) var(--space-3)}
@@ -0,0 +1 @@
1
+ ._header_d9pl2_1{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ export interface TruncatedHeaderTextProps {
3
+ title: string;
4
+ className?: string;
5
+ }
6
+ declare const TruncatedHeaderText: React.FC<TruncatedHeaderTextProps>;
7
+ export default TruncatedHeaderText;