@box/metadata-editor 1.58.4 → 1.59.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.
Files changed (28) hide show
  1. package/dist/chunks/metadata-instance-form-card-wrapper.js +41 -40
  2. package/dist/chunks/shared-field-styles.module.js +8 -0
  3. package/dist/chunks/utils2.js +33 -33
  4. package/dist/esm/lib/components/metadata-editor-fields/metadata-editor-field-wrapper.js +128 -96
  5. package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/metadata-instance-form.js +110 -106
  6. package/dist/esm/lib/components/metadata-instance-list/metadata-instance-list.js +19 -15
  7. package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance/metadata-instance.js +39 -35
  8. package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-content/metadata-instance-content.js +27 -20
  9. package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/metadata-instance-entry.js +71 -55
  10. package/dist/esm/lib/utils/check-if-has-bounding-boxes.js +4 -0
  11. package/dist/esm/lib/utils/is-interactive-form-element.js +4 -0
  12. package/dist/styles/metadata-instance-content.css +1 -1
  13. package/dist/styles/metadata-instance-form-card-wrapper.css +1 -1
  14. package/dist/styles/shared-field-styles.css +1 -0
  15. package/dist/styles/utils.css +1 -1
  16. package/dist/types/lib/components/metadata-editor-fields/types.d.ts +2 -0
  17. package/dist/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/types.d.ts +2 -0
  18. package/dist/types/lib/components/metadata-instance-list/metadata-instance-list.d.ts +1 -1
  19. package/dist/types/lib/components/metadata-instance-list/subcomponents/metadata-instance/metadata-instance.d.ts +1 -1
  20. package/dist/types/lib/components/metadata-instance-list/subcomponents/metadata-instance/types.d.ts +3 -1
  21. package/dist/types/lib/components/metadata-instance-list/subcomponents/metadata-instance-content/metadata-instance-content.d.ts +1 -1
  22. package/dist/types/lib/components/metadata-instance-list/subcomponents/metadata-instance-content/types.d.ts +3 -1
  23. package/dist/types/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/metadata-instance-entry.d.ts +1 -1
  24. package/dist/types/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/types.d.ts +4 -1
  25. package/dist/types/lib/components/metadata-instance-list/types.d.ts +3 -1
  26. package/dist/types/lib/utils/check-if-has-bounding-boxes.d.ts +2 -0
  27. package/dist/types/lib/utils/is-interactive-form-element.d.ts +1 -0
  28. package/package.json +3 -3
@@ -1,151 +1,155 @@
1
1
  import "../custom-instance-new-field/custom-instance-new-field.js";
2
- import { DeleteConfirmationModal as H } from "../delete-confirmation-modal/delete-confirmation-modal.js";
2
+ import { DeleteConfirmationModal as X } from "../delete-confirmation-modal/delete-confirmation-modal.js";
3
3
  import "../metadata-instance-form-autofill-button/metadata-instance-form-autofill-button.js";
4
4
  import "../metadata-instance-form-header/metadata-instance-form-header.js";
5
- import Q from "clsx";
6
- import { Formik as X, Form as Y } from "formik";
7
- import Z from "lodash/isEqual";
8
- import { useState as S, useEffect as x, useRef as D, useMemo as ee } from "react";
9
- import { TEMPLATE_CUSTOM_PROPERTIES as te } from "../../../../constants.js";
10
- import { useAutofill as ae } from "../../../../utils/autofill-context.js";
11
- import { TemplateInstance as ne } from "../../../metadata-editor-fields/metadata-editor-fields.js";
12
- import { MetadataEmptyState as oe } from "../../../metadata-empty-state/metadata-empty-state.js";
13
- import { AutofillOverlay as se } from "../autofill-overlay/autofill-overlay.js";
14
- import { CustomInstance as re } from "../custom-instance/custom-instance.js";
15
- import { c as ie } from "../../../../../../chunks/utils.js";
16
- import { s as f, M as le } from "../../../../../../chunks/metadata-instance-form-card-wrapper.js";
17
- import { jsx as n, jsxs as v } from "react/jsx-runtime";
18
- import { UnsavedChangesModal as me } from "../../../unsaved-changes-modal/unsaved-changes-modal.js";
19
- const de = ({
20
- dirty: i,
21
- onChange: l,
5
+ import Y from "clsx";
6
+ import { Formik as Z, Form as ee } from "formik";
7
+ import te from "lodash/isEqual";
8
+ import { useState as I, useEffect as v, useRef as w, useMemo as ae } from "react";
9
+ import { TEMPLATE_CUSTOM_PROPERTIES as ne } from "../../../../constants.js";
10
+ import { useAutofill as oe } from "../../../../utils/autofill-context.js";
11
+ import { TemplateInstance as se } from "../../../metadata-editor-fields/metadata-editor-fields.js";
12
+ import { MetadataEmptyState as re } from "../../../metadata-empty-state/metadata-empty-state.js";
13
+ import { AutofillOverlay as ie } from "../autofill-overlay/autofill-overlay.js";
14
+ import { CustomInstance as le } from "../custom-instance/custom-instance.js";
15
+ import { c as me } from "../../../../../../chunks/utils.js";
16
+ import { s as l, M as de } from "../../../../../../chunks/metadata-instance-form-card-wrapper.js";
17
+ import { jsx as n, jsxs as D } from "react/jsx-runtime";
18
+ import { UnsavedChangesModal as ce } from "../../../unsaved-changes-modal/unsaved-changes-modal.js";
19
+ const pe = ({
20
+ dirty: m,
21
+ onChange: d,
22
22
  values: t
23
23
  }) => {
24
- const s = D(t);
25
- return i && !Z(s.current.metadata.fields, t.metadata.fields) && (s.current = t, l(t)), null;
26
- }, we = (i) => {
24
+ const s = w(t);
25
+ return m && !te(s.current.metadata.fields, t.metadata.fields) && (s.current = t, d(t)), null;
26
+ }, Re = (m) => {
27
27
  const {
28
- areAiSuggestionsAvailable: l,
28
+ areAiSuggestionsAvailable: d,
29
29
  customRef: t,
30
30
  isLargeFile: s,
31
- errorCode: m,
32
- isAiSuggestionsFeatureEnabled: d,
33
- isAdvancedExtractAgentEnabled: I = !1,
34
- isBetaLanguageEnabled: w,
35
- isDeleteButtonDisabled: A,
36
- isDeleteConfirmationModalCheckboxEnabled: R,
37
- isMultilevelTaxonomyFieldEnabled: p,
38
- isUnsavedChangesModalOpen: T = !1,
39
- MetadataInstanceFormCustomWrapper: L,
31
+ errorCode: c,
32
+ isAiSuggestionsFeatureEnabled: p,
33
+ isAdvancedExtractAgentEnabled: A = !1,
34
+ isBetaLanguageEnabled: R,
35
+ isDeleteButtonDisabled: T,
36
+ isDeleteConfirmationModalCheckboxEnabled: L,
37
+ isMultilevelTaxonomyFieldEnabled: f,
38
+ isUnsavedChangesModalOpen: k = !1,
39
+ MetadataInstanceFormCustomWrapper: N,
40
40
  selectedTemplateInstance: e,
41
- onCancel: k,
41
+ onCancel: P,
42
42
  onChange: u,
43
- onDelete: N,
44
- onDiscardUnsavedChanges: P,
45
- onSubmit: U,
46
- onToggleReviewFilter: B,
43
+ onDelete: U,
44
+ onDiscardUnsavedChanges: B,
45
+ onSubmit: K,
46
+ onToggleReviewFilter: V,
47
47
  setIsUnsavedChangesModalOpen: g,
48
48
  shouldShowOnlyReviewFields: h = !1,
49
- taxonomyOptionsFetcher: E,
50
- isConfidenceScoreReviewEnabled: c = !1
51
- } = i, K = L ?? le, [V, C] = S(!1), {
49
+ taxonomyOptionsFetcher: C,
50
+ isConfidenceScoreReviewEnabled: r = !1,
51
+ onSelectMetadataField: E,
52
+ selectedMetadataFieldId: F
53
+ } = m, W = N ?? de, [j, M] = I(!1), {
52
54
  isFetchingSuggestions: o,
53
- isLongLoading: F,
54
- getAiSuggestions: W,
55
- clearState: b,
56
- suggestions: j
57
- } = ae();
58
- x(() => () => {
59
- b();
60
- }, [b, e?.id]);
61
- const y = e?.templateKey === te, _ = async (a) => {
62
- await U(a, ie(a, e));
63
- }, $ = (a) => {
64
- a ? g(!0) : k();
65
- }, q = () => {
66
- C(!0);
67
- }, J = {
55
+ isLongLoading: b,
56
+ getAiSuggestions: _,
57
+ clearState: y,
58
+ suggestions: $
59
+ } = oe();
60
+ v(() => () => {
61
+ y();
62
+ }, [y, e?.id]);
63
+ const S = e?.templateKey === ne, q = async (a) => {
64
+ await K(a, me(a, e));
65
+ }, G = (a) => {
66
+ a ? g(!0) : P();
67
+ }, J = () => {
68
+ M(!0);
69
+ }, z = {
68
70
  metadata: {
69
71
  ...e
70
72
  }
71
- }, M = D(null), [O, z] = S(null);
72
- x(() => {
73
- z(t ?? M.current);
73
+ }, O = w(null), [x, H] = I(null);
74
+ v(() => {
75
+ H(t ?? O.current);
74
76
  }, [t, e?.templateKey, e?.scope]);
75
- const G = ee(() => {
77
+ const Q = ae(() => {
76
78
  const a = e?.fields.length === 0;
77
- if (y)
78
- return /* @__PURE__ */ n(re, {
79
+ if (S)
80
+ return /* @__PURE__ */ n(le, {
79
81
  isLoading: o
80
82
  });
81
83
  if (a)
82
- return /* @__PURE__ */ n(oe, {
83
- isBoxAiSuggestionsFeatureEnabled: d,
84
+ return /* @__PURE__ */ n(re, {
85
+ isBoxAiSuggestionsFeatureEnabled: p,
84
86
  level: "instance"
85
87
  });
86
- const r = !!(o || m);
87
- return /* @__PURE__ */ v("div", {
88
- className: Q(f.metadataInstanceFormContent, r && f.showOverlay),
89
- children: [/* @__PURE__ */ n(se, {
90
- errorCode: m,
88
+ const i = !!(o || c);
89
+ return /* @__PURE__ */ D("div", {
90
+ className: Y(l.metadataInstanceFormContent, i && l.showOverlay, r && l.metadataInstanceFormContentReducedGap),
91
+ children: [/* @__PURE__ */ n(ie, {
92
+ errorCode: c,
91
93
  isFetchingSuggestions: o,
92
- isLongLoading: F
93
- }), /* @__PURE__ */ n(ne, {
94
+ isLongLoading: b
95
+ }), /* @__PURE__ */ n(se, {
94
96
  disableForm: o,
95
- isConfidenceScoreReviewEnabled: c,
97
+ isConfidenceScoreReviewEnabled: r,
96
98
  isExternallyOwned: e?.isExternallyOwned,
97
- isMultilevelTaxonomyFieldEnabled: p,
98
- portalElement: t ?? O,
99
- taxonomyOptionsFetcher: E
99
+ isMultilevelTaxonomyFieldEnabled: f,
100
+ onSelectMetadataField: E,
101
+ selectedMetadataFieldId: F,
102
+ portalElement: t ?? x,
103
+ taxonomyOptionsFetcher: C
100
104
  })]
101
105
  });
102
- }, [e?.fields.length, e?.isExternallyOwned, y, o, F, t, O, E, d, c, p, m, h]);
103
- return /* @__PURE__ */ n(X, {
104
- initialValues: J,
105
- onSubmit: _,
106
+ }, [e?.fields.length, e?.isExternallyOwned, S, o, b, t, x, C, p, r, f, c, h, E, F]);
107
+ return /* @__PURE__ */ n(Z, {
108
+ initialValues: z,
109
+ onSubmit: q,
106
110
  children: ({
107
111
  values: a,
108
- dirty: r
109
- }) => /* @__PURE__ */ v(Y, {
110
- children: [/* @__PURE__ */ n(K, {
111
- areAiSuggestionsAvailable: l,
112
- className: f.metadataInstanceForm,
113
- formRef: M,
112
+ dirty: i
113
+ }) => /* @__PURE__ */ D(ee, {
114
+ children: [/* @__PURE__ */ n(W, {
115
+ areAiSuggestionsAvailable: d,
116
+ className: l.metadataInstanceForm,
117
+ formRef: O,
114
118
  formValues: a,
115
- getAiSuggestions: W,
116
- handleCancel: $,
117
- handleDelete: q,
118
- isAdvancedExtractAgentEnabled: I,
119
- isAiSuggestionsFeatureEnabled: d,
120
- isBetaLanguageEnabled: w,
121
- isConfidenceScoreReviewEnabled: c,
122
- isDeleteButtonDisabled: A,
119
+ getAiSuggestions: _,
120
+ handleCancel: G,
121
+ handleDelete: J,
122
+ isAdvancedExtractAgentEnabled: A,
123
+ isAiSuggestionsFeatureEnabled: p,
124
+ isBetaLanguageEnabled: R,
125
+ isConfidenceScoreReviewEnabled: r,
126
+ isDeleteButtonDisabled: T,
123
127
  isFetchingSuggestions: o,
124
- isFormDirty: r,
128
+ isFormDirty: i,
125
129
  isLargeFile: s,
126
- onToggleReviewFilter: B,
130
+ onToggleReviewFilter: V,
127
131
  selectedTemplateInstance: e,
128
132
  shouldShowOnlyReviewFields: h,
129
- suggestions: j,
130
- children: e && G
131
- }), u && /* @__PURE__ */ n(de, {
132
- dirty: r,
133
+ suggestions: $,
134
+ children: e && Q
135
+ }), u && /* @__PURE__ */ n(pe, {
136
+ dirty: i,
133
137
  onChange: u,
134
138
  values: a
135
- }), /* @__PURE__ */ n(me, {
139
+ }), /* @__PURE__ */ n(ce, {
136
140
  onBackToEdit: () => g(!1),
137
- onDiscardChanges: P,
138
- open: T
139
- }), /* @__PURE__ */ n(H, {
140
- isCheckboxEnabled: R,
141
- onConfirm: () => N(e),
142
- onDismiss: () => C(!1),
143
- open: V,
141
+ onDiscardChanges: B,
142
+ open: k
143
+ }), /* @__PURE__ */ n(X, {
144
+ isCheckboxEnabled: L,
145
+ onConfirm: () => U(e),
146
+ onDismiss: () => M(!1),
147
+ open: j,
144
148
  templateName: e?.displayName
145
149
  })]
146
150
  })
147
151
  }, `${e?.scope}.${e?.templateKey}`);
148
152
  };
149
153
  export {
150
- we as MetadataInstanceForm
154
+ Re as MetadataInstanceForm
151
155
  };
@@ -1,31 +1,35 @@
1
- import { getVisibleTemplates as d } from "../../utils/utils.js";
2
- import { MetadataInstance as l } from "./subcomponents/metadata-instance/metadata-instance.js";
1
+ import { getVisibleTemplates as p } from "../../utils/utils.js";
2
+ import { MetadataInstance as f } from "./subcomponents/metadata-instance/metadata-instance.js";
3
3
  import { jsx as a } from "react/jsx-runtime";
4
4
  import "./subcomponents/metadata-instance-header/metadata-instance-header.js";
5
- import '../../../../styles/metadata-instance-list.css';const p = "_metadataInstanceList_bd83w_1", f = {
6
- metadataInstanceList: p
7
- }, x = ({
5
+ import '../../../../styles/metadata-instance-list.css';const I = "_metadataInstanceList_bd83w_1", L = {
6
+ metadataInstanceList: I
7
+ }, g = ({
8
8
  areAiSuggestionsAvailable: s,
9
9
  isAiSuggestionsFeatureEnabled: e,
10
10
  isBetaLanguageEnabled: n,
11
11
  onEdit: i,
12
- templateInstances: m,
13
- taxonomyNodeFetcher: o,
14
- isAdvancedExtractAgentEnabled: r = !1,
15
- isConfidenceScoreReviewEnabled: c = !1
12
+ onSelectMetadataField: m,
13
+ selectedMetadataFieldId: o,
14
+ templateInstances: r,
15
+ taxonomyNodeFetcher: c,
16
+ isAdvancedExtractAgentEnabled: d = !1,
17
+ isConfidenceScoreReviewEnabled: l = !1
16
18
  }) => /* @__PURE__ */ a("div", {
17
- className: f.metadataInstanceList,
18
- children: d(m).map((t) => /* @__PURE__ */ a(l, {
19
+ className: L.metadataInstanceList,
20
+ children: p(r).map((t) => /* @__PURE__ */ a(f, {
19
21
  areAiSuggestionsAvailable: s,
20
- isAdvancedExtractAgentEnabled: r,
22
+ isAdvancedExtractAgentEnabled: d,
21
23
  isAiSuggestionsFeatureEnabled: e,
22
24
  isBetaLanguageEnabled: n,
23
- isConfidenceScoreReviewEnabled: c,
25
+ isConfidenceScoreReviewEnabled: l,
24
26
  onEdit: i,
25
- taxonomyNodeFetcher: o,
27
+ onSelectMetadataField: m,
28
+ selectedMetadataFieldId: o,
29
+ taxonomyNodeFetcher: c,
26
30
  templateInstance: t
27
31
  }, t.id))
28
32
  });
29
33
  export {
30
- x as MetadataInstanceList
34
+ g as MetadataInstanceList
31
35
  };
@@ -1,67 +1,71 @@
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";
1
+ import { Card as F, Divider as v } from "@box/blueprint-web";
2
+ import { useState as H } from "react";
3
+ import { useAutofill as M } from "../../../../utils/autofill-context.js";
4
+ import { getFieldsNeedingReview as R } from "../../../../utils/confidence-score/get-fields-needing-review.js";
5
+ import { MetadataEmptyState as b } from "../../../metadata-empty-state/metadata-empty-state.js";
6
+ import { MetadataInstanceContent as C } from "../metadata-instance-content/metadata-instance-content.js";
7
+ import { MetadataInstanceFooter as j } from "../metadata-instance-footer/metadata-instance-footer.js";
8
+ import { MetadataInstanceHeader as T } from "../metadata-instance-header/metadata-instance-header.js";
9
+ import { MetadataInstanceReviewNotice as k } from "../../../metadata-instance-review-notice/metadata-instance-review-notice.js";
10
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 = ({
11
+ import '../../../../../../styles/metadata-instance.css';const B = "_topDivider_1xnom_1", K = "_reviewNotice_1xnom_5", W = "_bottomDivider_1xnom_9", l = {
12
+ topDivider: B,
13
+ reviewNotice: K,
14
+ bottomDivider: W
15
+ }, Z = ({
16
16
  areAiSuggestionsAvailable: y,
17
17
  isAiSuggestionsFeatureEnabled: n,
18
18
  isBetaLanguageEnabled: f,
19
19
  onEdit: s,
20
+ onSelectMetadataField: h,
21
+ selectedMetadataFieldId: N,
20
22
  templateInstance: e,
21
- taxonomyNodeFetcher: h,
22
- isAdvancedExtractAgentEnabled: N = !1,
23
+ taxonomyNodeFetcher: g,
24
+ isAdvancedExtractAgentEnabled: w = !1,
23
25
  isConfidenceScoreReviewEnabled: m = !1
24
26
  }) => {
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
- }, _ = () => {
27
+ const i = e.fields, c = (o) => !o.value || Array.isArray(o.value) && o.value.length === 0, E = i.every(c), V = i.some(c), A = i.length > 0, u = R(i).length, D = m && u > 0, [r, a] = H(!0), {
28
+ getAiSuggestions: _
29
+ } = M(), x = (o) => {
30
+ s(e), _(e.templateKey, e.scope, o);
31
+ }, S = () => {
30
32
  s(e, !0);
31
33
  };
32
- return /* @__PURE__ */ d(x, {
33
- children: [/* @__PURE__ */ t(C, {
34
+ return /* @__PURE__ */ d(F, {
35
+ children: [/* @__PURE__ */ t(T, {
34
36
  areAiSuggestionsAvailable: y,
35
37
  canEdit: e.canEdit,
36
- isAdvancedExtractAgentEnabled: N,
38
+ isAdvancedExtractAgentEnabled: w,
37
39
  isAiSuggestionsFeatureEnabled: n,
38
40
  isBetaLanguageEnabled: f,
39
- onAutofill: D,
41
+ onAutofill: x,
40
42
  onEdit: () => s(e),
41
43
  templateName: e?.displayName
42
44
  }), /* @__PURE__ */ t(v, {
43
45
  className: l.topDivider
44
- }), V && /* @__PURE__ */ t("div", {
46
+ }), D && /* @__PURE__ */ t("div", {
45
47
  className: l.reviewNotice,
46
- children: /* @__PURE__ */ t(j, {
48
+ children: /* @__PURE__ */ t(k, {
47
49
  fieldsNeedingReviewCount: u,
48
- onTextToggleClick: _
50
+ onTextToggleClick: S
49
51
  })
50
- }), r && g ? /* @__PURE__ */ t(M, {
51
- isAnyEmptyValueHidden: E,
52
+ }), r && E ? /* @__PURE__ */ t(b, {
53
+ isAnyEmptyValueHidden: A,
52
54
  isBoxAiSuggestionsFeatureEnabled: n,
53
55
  level: "instance",
54
56
  onShowEmptyValues: () => a(!1)
55
57
  }) : /* @__PURE__ */ d(p, {
56
- children: [/* @__PURE__ */ t(R, {
58
+ children: [/* @__PURE__ */ t(C, {
57
59
  isConfidenceScoreReviewEnabled: m,
60
+ onSelectMetadataField: h,
61
+ selectedMetadataFieldId: N,
58
62
  shouldHideEmptyValues: r,
59
- taxonomyNodeFetcher: h,
63
+ taxonomyNodeFetcher: g,
60
64
  templateInstance: e
61
- }), w && /* @__PURE__ */ d(p, {
65
+ }), V && /* @__PURE__ */ d(p, {
62
66
  children: [/* @__PURE__ */ t(v, {
63
67
  className: l.bottomDivider
64
- }), /* @__PURE__ */ t(b, {
68
+ }), /* @__PURE__ */ t(j, {
65
69
  isAnyEmptyValueHidden: r,
66
70
  onHideEmptyValues: () => a(!0),
67
71
  onShowEmptyValues: () => a(!1)
@@ -71,5 +75,5 @@ import '../../../../../../styles/metadata-instance.css';const T = "_topDivider_1
71
75
  });
72
76
  };
73
77
  export {
74
- X as MetadataInstance
78
+ Z as MetadataInstance
75
79
  };
@@ -1,33 +1,40 @@
1
- import { MetadataInstanceEntry as r } from "../metadata-instance-entry/metadata-instance-entry.js";
2
- import { jsx as e } from "react/jsx-runtime";
3
- import '../../../../../../styles/metadata-instance-content.css';const m = "_metadataInstanceContent_1a9zf_1", y = {
4
- metadataInstanceContent: m
5
- }, i = ({
6
- shouldHideEmptyValues: a,
7
- templateInstance: n,
8
- taxonomyNodeFetcher: o,
9
- isConfidenceScoreReviewEnabled: s
1
+ import p from "clsx";
2
+ import { MetadataInstanceEntry as y } from "../metadata-instance-entry/metadata-instance-entry.js";
3
+ import { jsx as o } from "react/jsx-runtime";
4
+ import '../../../../../../styles/metadata-instance-content.css';const i = "_metadataInstanceContent_1cb0f_1", C = "_metadataInstanceContentReducedGap_1cb0f_7", c = {
5
+ metadataInstanceContent: i,
6
+ metadataInstanceContentReducedGap: C
7
+ }, _ = ({
8
+ onSelectMetadataField: n,
9
+ selectedMetadataFieldId: s,
10
+ shouldHideEmptyValues: m,
11
+ templateInstance: a,
12
+ taxonomyNodeFetcher: d,
13
+ isConfidenceScoreReviewEnabled: e
10
14
  }) => {
11
15
  const {
12
- fields: c = []
13
- } = n;
14
- return /* @__PURE__ */ e("div", {
15
- className: y.metadataInstanceContent,
16
- children: c.filter((t) => !t.hidden).map((t) => /* @__PURE__ */ e(r, {
16
+ fields: r = []
17
+ } = a;
18
+ return /* @__PURE__ */ o("div", {
19
+ className: p(c.metadataInstanceContent, e && c.metadataInstanceContentReducedGap),
20
+ children: r.filter((t) => !t.hidden).map((t) => /* @__PURE__ */ o(y, {
17
21
  confidenceScore: t.confidenceScore,
18
22
  description: t.description,
19
- isConfidenceScoreReviewEnabled: s,
20
- isExternallyOwned: n.isExternallyOwned,
23
+ isConfidenceScoreReviewEnabled: e,
24
+ isExternallyOwned: a.isExternallyOwned,
25
+ isSelected: s === t.id,
21
26
  name: t.displayName || t.key,
27
+ onClick: n ? () => n(t) : void 0,
22
28
  scope: t.namespace,
23
- shouldHideEmptyValues: a,
29
+ shouldHideEmptyValues: m,
24
30
  taxonomyKey: t.taxonomyKey,
25
- taxonomyNodeFetcher: o,
31
+ taxonomyNodeFetcher: d,
26
32
  type: t.type,
27
- value: t.value
33
+ value: t.value,
34
+ targetLocation: t.targetLocation
28
35
  }, t.id))
29
36
  });
30
37
  };
31
38
  export {
32
- i as MetadataInstanceContent
39
+ _ as MetadataInstanceContent
33
40
  };