@box/metadata-editor 0.59.5 → 0.59.6

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,30 +1,31 @@
1
1
  import "../styles/metadata-editor-field-wrapper.css";
2
- import x from "clsx";
3
- import { useFormikContext as _ } from "formik";
4
- import h from "lodash/isUndefined";
5
- import { useState as A } from "react";
6
- import { AiSuggestionField as v } from "../esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/ai-suggestion-field.js";
7
- import { UpdateModeFieldWrapper as k } from "../esm/lib/components/metadata-editor-fields/components/update-mode-field-wrapper/update-mode-field-wrapper.js";
8
- import { editorFieldTypes as F } from "../esm/lib/components/metadata-editor-fields/editor-field-types.js";
9
- import { jsx as o, jsxs as W } from "react/jsx-runtime";
10
- const M = "_noAttributesText_vykxc_1", N = "_fieldWrapper_vykxc_5", T = "_hasSuggestion_vykxc_5", b = "_error_vykxc_13", u = {
11
- noAttributesText: M,
12
- fieldWrapper: N,
13
- hasSuggestion: T,
14
- error: b
2
+ import S from "clsx";
3
+ import { useFormikContext as y } from "formik";
4
+ import F from "lodash/isUndefined";
5
+ import { useState as h } from "react";
6
+ import { AiSuggestionField as A } from "../esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/ai-suggestion-field.js";
7
+ import { UpdateModeFieldWrapper as W } from "../esm/lib/components/metadata-editor-fields/components/update-mode-field-wrapper/update-mode-field-wrapper.js";
8
+ import { editorFieldTypes as M } from "../esm/lib/components/metadata-editor-fields/editor-field-types.js";
9
+ import { jsx as o, jsxs as N } from "react/jsx-runtime";
10
+ const q = "_noAttributesText_1xlmq_1", T = "_fieldWrapper_1xlmq_5", b = "_hasSuggestion_1xlmq_5", v = "_error_1xlmq_13", P = "_dateField_1xlmq_25", a = {
11
+ noAttributesText: q,
12
+ fieldWrapper: T,
13
+ hasSuggestion: b,
14
+ error: v,
15
+ dateField: P
15
16
  }, R = ({
16
17
  disableForm: n,
17
- portalElement: a,
18
+ portalElement: p,
18
19
  field: e,
19
- index: p
20
+ index: d
20
21
  }) => {
21
22
  const {
22
- setFieldValue: d
23
- } = _(), [l, i] = A(!0), r = F[e.type], g = r && !e.hidden, m = !h(e.updateMode), s = `metadata.fields[${p}]`;
24
- if (!g)
23
+ setFieldValue: l
24
+ } = y(), [u, i] = h(!0), r = M[e.type], c = r && !e.hidden, g = !F(e.updateMode), s = `metadata.fields[${d}]`;
25
+ if (!c)
25
26
  return null;
26
- if (m)
27
- return /* @__PURE__ */ o(k, {
27
+ if (g)
28
+ return /* @__PURE__ */ o(W, {
28
29
  fieldNamePrefix: s,
29
30
  fieldType: e.type,
30
31
  children: /* @__PURE__ */ o(r, {
@@ -32,38 +33,41 @@ const M = "_noAttributesText_vykxc_1", N = "_fieldWrapper_vykxc_5", T = "_hasSug
32
33
  disableForm: n,
33
34
  fieldNamePrefix: s,
34
35
  label: e.displayName,
35
- portalElement: a
36
+ portalElement: p
36
37
  })
37
38
  }, e.key);
38
39
  const {
39
40
  aiSuggestion: t,
40
- type: f,
41
- value: y
42
- } = e, c = t && l;
43
- return /* @__PURE__ */ W("div", {
44
- className: u.fieldWrapper,
41
+ type: _,
42
+ value: f
43
+ } = e, m = t && u;
44
+ return /* @__PURE__ */ N("div", {
45
+ className: a.fieldWrapper,
45
46
  children: [/* @__PURE__ */ o(r, {
46
- className: x(c && u.hasSuggestion),
47
+ className: S({
48
+ [a.hasSuggestions]: m,
49
+ [a.dateField]: e.type === "date"
50
+ }),
47
51
  description: e.description,
48
52
  disableForm: n,
49
- fieldNamePrefix: `metadata.fields[${p}]`,
53
+ fieldNamePrefix: `metadata.fields[${d}]`,
50
54
  label: e.displayName,
51
- portalElement: a
52
- }), c && /* @__PURE__ */ o(v, {
55
+ portalElement: p
56
+ }), m && /* @__PURE__ */ o(A, {
53
57
  aiSuggestion: t,
54
58
  onAiSuggestionAppend: () => {
55
- const S = e.type === "multiSelect" ? [y, t].flat() : t;
56
- d(`${s}.value`, S), i(!1);
59
+ const x = e.type === "multiSelect" ? [f, t].flat() : t;
60
+ l(`${s}.value`, x), i(!1);
57
61
  },
58
62
  onAiSuggestionIgnore: () => i(!1),
59
63
  onAiSuggestionReplace: () => {
60
- d(`${s}.value`, t), i(!1);
64
+ l(`${s}.value`, t), i(!1);
61
65
  },
62
- type: f
66
+ type: _
63
67
  })]
64
68
  }, e.key);
65
69
  };
66
70
  export {
67
71
  R as M,
68
- u as s
72
+ a as s
69
73
  };
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@box/metadata-editor",
3
- "version": "0.59.5",
3
+ "version": "0.59.6",
4
4
  "peerDependencies": {
5
5
  "@ariakit/react": "0.4.5",
6
- "@box/blueprint-web": "^7.20.0",
6
+ "@box/blueprint-web": "^7.30.3",
7
7
  "@box/blueprint-web-assets": "^4.21.0",
8
8
  "formik": "^2.0.3",
9
9
  "lodash": "^4.17.15",
@@ -53,5 +53,5 @@
53
53
  "**/*.css"
54
54
  ],
55
55
  "license": "SEE LICENSE IN LICENSE",
56
- "gitHead": "17003345864c877b3029e00f63664c66ca1fd3f1"
56
+ "gitHead": "6665cc401f9bb13d7fc81a5a34fc27bc75535d3d"
57
57
  }
@@ -1 +1 @@
1
- ._noAttributesText_vykxc_1{text-align:center}._fieldWrapper_vykxc_5 ._hasSuggestion_vykxc_5>input,._fieldWrapper_vykxc_5 ._hasSuggestion_vykxc_5>button,._fieldWrapper_vykxc_5 ._hasSuggestion_vykxc_5>div[role=group]>div,._fieldWrapper_vykxc_5 ._hasSuggestion_vykxc_5>div>div{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}._fieldWrapper_vykxc_5 ._hasSuggestion_vykxc_5>input:not(:disabled):not(:focus-visible):not(._error_vykxc_13):hover,._fieldWrapper_vykxc_5 ._hasSuggestion_vykxc_5>button:not(:disabled):not(:focus-visible):not(._error_vykxc_13):hover,._fieldWrapper_vykxc_5 ._hasSuggestion_vykxc_5>div[role=group]>div:not(:disabled):not(:focus-visible):not(._error_vykxc_13):hover,._fieldWrapper_vykxc_5 ._hasSuggestion_vykxc_5>div>div:not(:disabled):not(:focus-visible):not(._error_vykxc_13):hover{border-bottom:none}._fieldWrapper_vykxc_5 ._hasSuggestion_vykxc_5 div[role=group]>div{margin-left:var(--border-1);margin-right:var(--border-1)}
1
+ ._noAttributesText_1xlmq_1{text-align:center}._fieldWrapper_1xlmq_5 ._hasSuggestion_1xlmq_5>input,._fieldWrapper_1xlmq_5 ._hasSuggestion_1xlmq_5>button,._fieldWrapper_1xlmq_5 ._hasSuggestion_1xlmq_5>div[role=group]>div,._fieldWrapper_1xlmq_5 ._hasSuggestion_1xlmq_5>div>div{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}._fieldWrapper_1xlmq_5 ._hasSuggestion_1xlmq_5>input:not(:disabled):not(:focus-visible):not(._error_1xlmq_13):hover,._fieldWrapper_1xlmq_5 ._hasSuggestion_1xlmq_5>button:not(:disabled):not(:focus-visible):not(._error_1xlmq_13):hover,._fieldWrapper_1xlmq_5 ._hasSuggestion_1xlmq_5>div[role=group]>div:not(:disabled):not(:focus-visible):not(._error_1xlmq_13):hover,._fieldWrapper_1xlmq_5 ._hasSuggestion_1xlmq_5>div>div:not(:disabled):not(:focus-visible):not(._error_1xlmq_13):hover{border-bottom:none}._fieldWrapper_1xlmq_5 ._hasSuggestion_1xlmq_5 div[role=group]>div{margin-left:var(--border-1);margin-right:var(--border-1)}._fieldWrapper_1xlmq_5 ._dateField_1xlmq_25>div[role=group]>div{padding-inline:.75rem}