@box/metadata-template-editor 1.20.9 → 1.20.11

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 (95) hide show
  1. package/dist/chunks/chip.js +21 -0
  2. package/dist/chunks/dropdown-field-configuration.js +62 -0
  3. package/dist/chunks/field-context-menu.js +90 -0
  4. package/dist/chunks/field-selector.js +23 -0
  5. package/dist/chunks/field-type-dropdown.js +31 -0
  6. package/dist/chunks/levels-chain.js +125 -0
  7. package/dist/chunks/metadata-field-configurator.module.js +17 -16
  8. package/dist/chunks/metadata-field-list.js +229 -0
  9. package/dist/chunks/metadata-template-editor-form.js +107 -0
  10. package/dist/chunks/metadata-template-editor-modal.js +77 -0
  11. package/dist/chunks/metadata-template-editor.js +157 -0
  12. package/dist/chunks/sortable-option-list.js +231 -0
  13. package/dist/chunks/taxonomy-field-configuration.js +126 -0
  14. package/dist/chunks/taxonomy-field-configurator-initial-state.js +48 -0
  15. package/dist/chunks/taxonomy-selector.js +90 -0
  16. package/dist/chunks/types.js +22 -33
  17. package/dist/esm/index.js +13 -34
  18. package/dist/esm/lib/components/field-selector/field-selector.js +2 -39
  19. package/dist/esm/lib/components/field-selector/index.js +2 -4
  20. package/dist/esm/lib/components/field-selector/messages.js +10 -12
  21. package/dist/esm/lib/components/field-type-dropdown/field-type-dropdown.js +2 -47
  22. package/dist/esm/lib/components/field-type-dropdown/index.js +2 -4
  23. package/dist/esm/lib/components/field-type-dropdown/messages.js +10 -12
  24. package/dist/esm/lib/components/field-type-tiles/field-type-tiles.js +32 -39
  25. package/dist/esm/lib/components/field-type-tiles/index.js +2 -4
  26. package/dist/esm/lib/components/field-type-tiles/messages.js +10 -12
  27. package/dist/esm/lib/components/metadata-field-configurator/components/confirmation-modal/confirmation-modal.js +32 -45
  28. package/dist/esm/lib/components/metadata-field-configurator/components/confirmation-modal/messages.js +14 -16
  29. package/dist/esm/lib/components/metadata-field-configurator/components/field-action-slot/field-action-slot.js +62 -79
  30. package/dist/esm/lib/components/metadata-field-configurator/components/field-context-menu/field-context-menu.js +2 -115
  31. package/dist/esm/lib/components/metadata-field-configurator/components/field-edit-content/field-edit-content.js +83 -100
  32. package/dist/esm/lib/components/metadata-field-configurator/components/levels-chain/chip.js +2 -33
  33. package/dist/esm/lib/components/metadata-field-configurator/components/levels-chain/index.js +2 -4
  34. package/dist/esm/lib/components/metadata-field-configurator/components/levels-chain/levels-chain.js +2 -118
  35. package/dist/esm/lib/components/metadata-field-configurator/components/levels-chain/utils.js +16 -33
  36. package/dist/esm/lib/components/metadata-field-configurator/components/type-specific-configuration/dropdown/__mocks__/getInitialValues.js +34 -32
  37. package/dist/esm/lib/components/metadata-field-configurator/components/type-specific-configuration/dropdown/dropdown-default-values.js +10 -14
  38. package/dist/esm/lib/components/metadata-field-configurator/components/type-specific-configuration/dropdown/dropdown-field-configuration.js +2 -66
  39. package/dist/esm/lib/components/metadata-field-configurator/components/type-specific-configuration/dropdown/sortable-option-list.js +2 -294
  40. package/dist/esm/lib/components/metadata-field-configurator/components/type-specific-configuration/index.js +3 -6
  41. package/dist/esm/lib/components/metadata-field-configurator/components/type-specific-configuration/taxonomy/taxonomy-default-values.js +11 -15
  42. package/dist/esm/lib/components/metadata-field-configurator/components/type-specific-configuration/taxonomy/taxonomy-field-configuration.js +2 -149
  43. package/dist/esm/lib/components/metadata-field-configurator/components/type-specific-configuration/taxonomy/taxonomy-field-configurator-initial-state.js +2 -54
  44. package/dist/esm/lib/components/metadata-field-configurator/components/type-specific-configuration/taxonomy/taxonomy-selector-messages.js +34 -36
  45. package/dist/esm/lib/components/metadata-field-configurator/components/type-specific-configuration/taxonomy/taxonomy-selector.js +2 -103
  46. package/dist/esm/lib/components/metadata-field-configurator/components/type-specific-configuration/taxonomy/useTaxonomySelect.js +15 -19
  47. package/dist/esm/lib/components/metadata-field-configurator/components/type-specific-configuration/taxonomy/utils.js +2 -4
  48. package/dist/esm/lib/components/metadata-field-configurator/context/field-configurator-context.js +60 -66
  49. package/dist/esm/lib/components/metadata-field-configurator/context/field-extensions-context.js +5 -8
  50. package/dist/esm/lib/components/metadata-field-configurator/context/taxonomy-options-context.js +14 -20
  51. package/dist/esm/lib/components/metadata-field-configurator/hooks/useFieldConfiguratorBehavior.js +99 -118
  52. package/dist/esm/lib/components/metadata-field-configurator/hooks/useFieldValidation.js +52 -66
  53. package/dist/esm/lib/components/metadata-field-configurator/hooks/useTaxonomyFetch.js +23 -26
  54. package/dist/esm/lib/components/metadata-field-configurator/hooks/useTemplateFieldSchema.js +34 -43
  55. package/dist/esm/lib/components/metadata-field-configurator/index.js +5 -11
  56. package/dist/esm/lib/components/metadata-field-configurator/messages/configurator-messages.js +131 -134
  57. package/dist/esm/lib/components/metadata-field-configurator/messages/dropdown-messages.js +34 -36
  58. package/dist/esm/lib/components/metadata-field-configurator/messages/levels-chain-messages.js +14 -16
  59. package/dist/esm/lib/components/metadata-field-configurator/messages/taxonomy-messages.js +34 -36
  60. package/dist/esm/lib/components/metadata-field-configurator/metadata-field-configurator.js +94 -153
  61. package/dist/esm/lib/components/metadata-field-configurator/utils.js +42 -49
  62. package/dist/esm/lib/components/metadata-field-list/index.js +2 -5
  63. package/dist/esm/lib/components/metadata-field-list/metadata-field-list.js +2 -279
  64. package/dist/esm/lib/components/metadata-template-editor-form/metadata-template-editor-form.js +2 -137
  65. package/dist/esm/lib/components/metadata-template-editor-modal/index.js +2 -4
  66. package/dist/esm/lib/components/metadata-template-editor-modal/metadata-template-editor-modal.js +2 -103
  67. package/dist/esm/lib/hooks/useMetadataTemplateFormSchema.js +13 -15
  68. package/dist/esm/lib/hooks/useTemplateNameSchema.js +8 -10
  69. package/dist/esm/lib/index.js +7 -14
  70. package/dist/esm/lib/messages.js +114 -116
  71. package/dist/esm/lib/metadata-template-editor.js +2 -182
  72. package/dist/esm/lib/utils/constants.js +2 -8
  73. package/dist/esm/lib/utils/field-options/field-type-icon.js +14 -33
  74. package/dist/esm/lib/utils/field-options/index.js +4 -9
  75. package/dist/esm/lib/utils/field-options/messages.js +43 -46
  76. package/dist/esm/lib/utils/field-options/useFieldOptions.js +14 -18
  77. package/dist/esm/lib/utils/key-generation.js +16 -27
  78. package/dist/esm/lib/utils/template-type-conversion/convertLocalConfiguratorToTemplateField.js +63 -77
  79. package/dist/esm/lib/utils/template-type-conversion/convertTemplateFieldToLocalConfigurator.js +69 -89
  80. package/dist/esm/lib/utils/template-type-conversion/generateJSONPatchTemplateOperations.js +150 -169
  81. package/dist/esm/lib/utils/template-type-conversion/mapFieldsWithUniqueKeys.js +8 -13
  82. package/dist/styles/chip.css +1 -1
  83. package/dist/styles/dropdown-field-configuration.css +1 -1
  84. package/dist/styles/field-context-menu.css +1 -1
  85. package/dist/styles/levels-chain.css +1 -1
  86. package/dist/styles/metadata-field-configurator.css +1 -1
  87. package/dist/styles/metadata-field-list.css +1 -1
  88. package/dist/styles/metadata-template-editor-form.css +1 -1
  89. package/dist/styles/metadata-template-editor-modal.css +1 -1
  90. package/dist/styles/metadata-template-editor.css +1 -1
  91. package/dist/styles/sortable-option-list.css +1 -1
  92. package/dist/styles/taxonomy-field-configuration.css +1 -1
  93. package/dist/styles/taxonomy-field-configurator-initial-state.css +1 -1
  94. package/dist/styles/taxonomy-selector.css +1 -1
  95. package/package.json +6 -6
@@ -0,0 +1,48 @@
1
+ import { useFieldConfigurator as e } from "../esm/lib/components/metadata-field-configurator/context/field-configurator-context.js";
2
+ import t from "../esm/lib/components/metadata-field-configurator/messages/taxonomy-messages.js";
3
+ import { useTaxonomySelect as n } from "../esm/lib/components/metadata-field-configurator/components/type-specific-configuration/taxonomy/useTaxonomySelect.js";
4
+ import { filterTaxonomiesByValue as r } from "../esm/lib/components/metadata-field-configurator/components/type-specific-configuration/taxonomy/utils.js";
5
+ import { t as i } from "./taxonomy-selector.js";
6
+ import { Text as a } from "@box/blueprint-web";
7
+ import { FormattedMessage as o } from "react-intl";
8
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
9
+ import "react";
10
+ import '../styles/taxonomy-field-configurator-initial-state.css';var l = {
11
+ taxonomyFieldConfiguratorInitialState: "_taxonomyFieldConfiguratorInitialState_il5v7_1",
12
+ subheader: "_subheader_il5v7_10"
13
+ }, u = () => {
14
+ let { values: u, setFieldValue: d } = e(), { onTaxonomySelect: f } = n({
15
+ values: u,
16
+ setFieldValue: d
17
+ });
18
+ return /* @__PURE__ */ c("div", {
19
+ className: l.taxonomyFieldConfiguratorInitialState,
20
+ children: [
21
+ /* @__PURE__ */ s(a, {
22
+ as: "h1",
23
+ color: "textOnLightDefault",
24
+ variant: "titleMedium",
25
+ children: /* @__PURE__ */ s(o, { ...t.callToActionHeader })
26
+ }),
27
+ /* @__PURE__ */ s(a, {
28
+ as: "p",
29
+ className: l.subheader,
30
+ color: "textOnLightDefault",
31
+ variant: "bodyDefault",
32
+ children: /* @__PURE__ */ s(o, { ...t.callToActionSubheader })
33
+ }),
34
+ /* @__PURE__ */ s(i, {
35
+ data: r(u.taxonomy.availableTaxonomies, u.taxonomy.taxonomySearchValue),
36
+ onClick: f,
37
+ resetValueOnHide: !0,
38
+ onSearchValue: (e) => {
39
+ d("taxonomy", {
40
+ ...u.taxonomy,
41
+ taxonomySearchValue: e
42
+ });
43
+ }
44
+ })
45
+ ]
46
+ });
47
+ };
48
+ export { u as t };
@@ -0,0 +1,90 @@
1
+ import { useTaxonomyOptions as e } from "../esm/lib/components/metadata-field-configurator/context/taxonomy-options-context.js";
2
+ import t from "../esm/lib/components/metadata-field-configurator/components/type-specific-configuration/taxonomy/taxonomy-selector-messages.js";
3
+ import { Button as n, LoadingIndicator as r, Popover as i, Text as a, TextInput as o } from "@box/blueprint-web";
4
+ import { useIntl as s } from "react-intl";
5
+ import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
6
+ import { Plus as d } from "@box/blueprint-web-assets/icons/Fill";
7
+ import { useState as f } from "react";
8
+ import '../styles/taxonomy-selector.css';var p = {
9
+ taxonomySelectorLabel: "_taxonomySelectorLabel_b3aww_1",
10
+ taxonomySelectorSeparator: "_taxonomySelectorSeparator_b3aww_6",
11
+ listWrapper: "_listWrapper_b3aww_14",
12
+ listWrapperWithPadding: "_listWrapperWithPadding_b3aww_19",
13
+ taxonomyItem: "_taxonomyItem_b3aww_24",
14
+ statusContainer: "_statusContainer_b3aww_30"
15
+ }, m = ({ data: m, onClick: h, onSearchValue: g, triggerButton: _, disabled: v, resetValueOnHide: y }) => {
16
+ let { formatMessage: b } = s(), { status: x, onSelectorOpen: S } = e(), [C, w] = f(""), [T, E] = f(!1), D = (e) => {
17
+ w(e), g(e);
18
+ }, O = (e) => {
19
+ E(e), e && S(), !e && y && (w(""), g(""));
20
+ }, k = (e) => {
21
+ h(e), E(!1);
22
+ }, A = _ ?? /* @__PURE__ */ l(n, {
23
+ variant: "secondary",
24
+ size: "large",
25
+ endIcon: d,
26
+ "aria-label": b(t.taxonomySelectorAriaLabel),
27
+ children: b(t.taxonomySelector)
28
+ });
29
+ return /* @__PURE__ */ u(i.Root, {
30
+ modal: !1,
31
+ open: T,
32
+ onOpenChange: O,
33
+ children: [/* @__PURE__ */ l(i.Trigger, {
34
+ disabled: v,
35
+ children: A
36
+ }), /* @__PURE__ */ l(i.ContentContainer, {
37
+ align: "start",
38
+ "aria-label": b(t.taxonomySelector),
39
+ children: x === "loading" ? /* @__PURE__ */ l("div", {
40
+ className: p.statusContainer,
41
+ children: /* @__PURE__ */ l(r, { "aria-label": b(t.loadingTaxonomies) })
42
+ }) : x === "error" ? /* @__PURE__ */ u("div", {
43
+ className: p.statusContainer,
44
+ children: [/* @__PURE__ */ l(a, {
45
+ as: "p",
46
+ variant: "bodyDefault",
47
+ color: "textOnLightSecondary",
48
+ children: b(t.loadTaxonomiesError)
49
+ }), /* @__PURE__ */ l(n, {
50
+ variant: "secondary",
51
+ size: "small",
52
+ onClick: S,
53
+ children: b(t.retryLoadTaxonomies)
54
+ })]
55
+ }) : /* @__PURE__ */ u(c, { children: [
56
+ /* @__PURE__ */ l("div", {
57
+ className: `${p.listWrapper} ${p.listWrapperWithPadding}`,
58
+ children: /* @__PURE__ */ l(o, {
59
+ label: b(t.searchTaxonomiesInputPlaceholder),
60
+ placeholder: b(t.searchTaxonomiesInputPlaceholder),
61
+ value: C,
62
+ onChange: (e) => D(e.target.value),
63
+ hideLabel: !0,
64
+ "aria-label": b(t.searchTaxonomiesInputPlaceholder)
65
+ })
66
+ }),
67
+ /* @__PURE__ */ l(a, {
68
+ as: "span",
69
+ variant: "caption",
70
+ color: "textOnLightSecondary",
71
+ className: p.taxonomySelectorLabel,
72
+ children: b(t.allTaxonomies)
73
+ }),
74
+ /* @__PURE__ */ l("div", {
75
+ className: p.listWrapper,
76
+ children: m.map((e) => /* @__PURE__ */ l(n, {
77
+ type: "button",
78
+ variant: "quaternary",
79
+ size: "large",
80
+ disabled: e?.levels?.length === 0,
81
+ onClick: () => k(e),
82
+ className: p.taxonomyItem,
83
+ children: e.label
84
+ }, e.id))
85
+ })
86
+ ] })
87
+ })]
88
+ });
89
+ };
90
+ export { m as t };
@@ -1,34 +1,23 @@
1
- let u = /* @__PURE__ */ (function(t) {
2
- return t.Create = "create", t.Edit = "edit", t;
3
- })({}), i = /* @__PURE__ */ (function(t) {
4
- return t.Text = "text", t.Number = "number", t.Date = "date", t.Dropdown = "dropdown", t.Taxonomy = "taxonomy", t;
5
- })({}), d = /* @__PURE__ */ (function(t) {
6
- return t.RequireSpecific = "requireSpecific", t.AllowAny = "allowAny", t;
7
- })({}), c = /* @__PURE__ */ (function(t) {
8
- return t.Float = "float", t.Taxonomy = "taxonomy", t.MultiSelect = "multiSelect", t.Date = "date", t.String = "string", t.Enum = "enum", t;
9
- })({}), n = /* @__PURE__ */ (function(t) {
10
- return t.EditTemplate = "editTemplate", t;
11
- })({}), e = /* @__PURE__ */ (function(t) {
12
- return t.AddField = "addField", t.ReorderFields = "reorderFields", t.EditField = "editField", t.RemoveField = "removeField", t;
13
- })({}), o = /* @__PURE__ */ (function(t) {
14
- return t.AddEnumOption = "addEnumOption", t.ReorderEnumOptions = "reorderEnumOptions", t.EditEnumOption = "editEnumOption", t.RemoveEnumOption = "removeEnumOption", t;
15
- })({}), r = /* @__PURE__ */ (function(t) {
16
- return t.AddMultiSelectOption = "addMultiSelectOption", t.ReorderMultiSelectOptions = "reorderMultiSelectOptions", t.EditMultiSelectOption = "editMultiSelectOption", t.RemoveMultiSelectOption = "removeMultiSelectOption", t;
17
- })({});
18
- const l = {
19
- ...n,
20
- ...e,
21
- ...o,
22
- ...r
23
- };
24
- export {
25
- c as A,
26
- o as E,
27
- i as F,
28
- u as M,
29
- d as T,
30
- n as a,
31
- l as b,
32
- e as c,
33
- r as d
1
+ var e = /* @__PURE__ */ function(e) {
2
+ return e.Create = "create", e.Edit = "edit", e;
3
+ }({}), t = /* @__PURE__ */ function(e) {
4
+ return e.Text = "text", e.Number = "number", e.Date = "date", e.Dropdown = "dropdown", e.Taxonomy = "taxonomy", e;
5
+ }({}), n = /* @__PURE__ */ function(e) {
6
+ return e.RequireSpecific = "requireSpecific", e.AllowAny = "allowAny", e;
7
+ }({}), r = /* @__PURE__ */ function(e) {
8
+ return e.Float = "float", e.Taxonomy = "taxonomy", e.MultiSelect = "multiSelect", e.Date = "date", e.String = "string", e.Enum = "enum", e;
9
+ }({}), i = /* @__PURE__ */ function(e) {
10
+ return e.EditTemplate = "editTemplate", e;
11
+ }({}), a = /* @__PURE__ */ function(e) {
12
+ return e.AddField = "addField", e.ReorderFields = "reorderFields", e.EditField = "editField", e.RemoveField = "removeField", e;
13
+ }({}), o = /* @__PURE__ */ function(e) {
14
+ return e.AddEnumOption = "addEnumOption", e.ReorderEnumOptions = "reorderEnumOptions", e.EditEnumOption = "editEnumOption", e.RemoveEnumOption = "removeEnumOption", e;
15
+ }({}), s = /* @__PURE__ */ function(e) {
16
+ return e.AddMultiSelectOption = "addMultiSelectOption", e.ReorderMultiSelectOptions = "reorderMultiSelectOptions", e.EditMultiSelectOption = "editMultiSelectOption", e.RemoveMultiSelectOption = "removeMultiSelectOption", e;
17
+ }({}), c = {
18
+ ...i,
19
+ ...a,
20
+ ...o,
21
+ ...s
34
22
  };
23
+ export { t as a, n as c, a as i, i as l, r as n, e as o, o as r, s, c as t };
package/dist/esm/index.js CHANGED
@@ -1,34 +1,13 @@
1
- import { MetadataTemplateEditor as a } from "./lib/metadata-template-editor.js";
2
- import { b as r, A as i, E as l, c as d, F as p, M as s, d as m, T as x, a as F } from "../chunks/types.js";
3
- import { FieldTypeTiles as n } from "./lib/components/field-type-tiles/field-type-tiles.js";
4
- import { MetadataFieldList as M, MetadataFieldList as u } from "./lib/components/metadata-field-list/metadata-field-list.js";
5
- import { FieldExtensionsContext as c, useFieldExtensions as y } from "./lib/components/metadata-field-configurator/context/field-extensions-context.js";
6
- import { FieldSelector as S } from "./lib/components/field-selector/field-selector.js";
7
- import { FieldTypeDropdown as D } from "./lib/components/field-type-dropdown/field-type-dropdown.js";
8
- import { MetadataFieldConfigurator as C } from "./lib/components/metadata-field-configurator/metadata-field-configurator.js";
9
- import { MetadataTemplateEditorModal as g } from "./lib/components/metadata-template-editor-modal/metadata-template-editor-modal.js";
10
- import { createDefaultFieldValues as w } from "./lib/components/metadata-field-configurator/utils.js";
11
- import { useTemplateFieldSchema as j } from "./lib/components/metadata-field-configurator/hooks/useTemplateFieldSchema.js";
12
- export {
13
- r as AllOps,
14
- i as ApiMetadataTemplateFieldType,
15
- l as EnumOperations,
16
- c as FieldExtensionsContext,
17
- d as FieldOperations,
18
- S as FieldSelector,
19
- p as FieldType,
20
- D as FieldTypeDropdown,
21
- n as FieldTypeTiles,
22
- C as MetadataFieldConfigurator,
23
- M as MetadataFieldList,
24
- u as MetadataFieldListDefault,
25
- a as MetadataTemplateEditor,
26
- g as MetadataTemplateEditorModal,
27
- s as MetadataTemplateEditorMode,
28
- m as MultiSelectOperations,
29
- x as TaxonomySelection,
30
- F as TemplateOperations,
31
- w as createDefaultFieldValues,
32
- y as useFieldExtensions,
33
- j as useTemplateFieldSchema
34
- };
1
+ import { t as e } from "../chunks/field-selector.js";
2
+ import { a as t, c as n, i as r, l as i, n as a, o, r as s, s as c, t as l } from "../chunks/types.js";
3
+ import { t as u } from "../chunks/field-type-dropdown.js";
4
+ import { FieldTypeTiles as d } from "./lib/components/field-type-tiles/field-type-tiles.js";
5
+ import { useTemplateFieldSchema as f } from "./lib/components/metadata-field-configurator/hooks/useTemplateFieldSchema.js";
6
+ import { FieldExtensionsContext as p, useFieldExtensions as m } from "./lib/components/metadata-field-configurator/context/field-extensions-context.js";
7
+ import { createDefaultFieldValues as h } from "./lib/components/metadata-field-configurator/utils.js";
8
+ import { MetadataFieldConfigurator as g } from "./lib/components/metadata-field-configurator/metadata-field-configurator.js";
9
+ import { t as _ } from "../chunks/metadata-field-list.js";
10
+ import { t as v } from "../chunks/metadata-template-editor.js";
11
+ import { t as y } from "../chunks/metadata-template-editor-modal.js";
12
+ import "./lib/components/metadata-template-editor-modal/index.js";
13
+ export { l as AllOps, a as ApiMetadataTemplateFieldType, s as EnumOperations, p as FieldExtensionsContext, r as FieldOperations, e as FieldSelector, t as FieldType, u as FieldTypeDropdown, d as FieldTypeTiles, g as MetadataFieldConfigurator, _ as MetadataFieldList, _ as MetadataFieldListDefault, v as MetadataTemplateEditor, y as MetadataTemplateEditorModal, o as MetadataTemplateEditorMode, c as MultiSelectOperations, n as TaxonomySelection, i as TemplateOperations, h as createDefaultFieldValues, m as useFieldExtensions, f as useTemplateFieldSchema };
@@ -1,39 +1,2 @@
1
- import { DropdownMenu as e, TextButton as c } from "@box/blueprint-web";
2
- import { useIntl as m } from "react-intl";
3
- import { ChevronDown as d } from "@box/blueprint-web-assets/icons/Medium";
4
- import i from "./messages.js";
5
- import { jsxs as s, jsx as r } from "react/jsx-runtime";
6
- import '../../../../styles/field-selector.css';const a = "_fieldSelectorTrigger_cj5ij_1", g = {
7
- fieldSelectorTrigger: a
8
- };
9
- function T({
10
- fields: n,
11
- onSelect: l
12
- }) {
13
- const {
14
- formatMessage: t
15
- } = m();
16
- return /* @__PURE__ */ s(e.Root, {
17
- modal: !1,
18
- children: [/* @__PURE__ */ r(e.Trigger, {
19
- children: /* @__PURE__ */ r(c, {
20
- icon: d,
21
- className: g.fieldSelectorTrigger,
22
- variant: "bodyDefaultSemibold",
23
- color: "textOnLightSecondary",
24
- children: t(i.selectField)
25
- })
26
- }), /* @__PURE__ */ r(e.Content, {
27
- children: n.map((o) => /* @__PURE__ */ r(e.Item, {
28
- onClick: () => l(o.id),
29
- children: /* @__PURE__ */ r(e.Item.MainContent, {
30
- label: o.name || t(i.unnamedField)
31
- })
32
- }, o.id))
33
- })]
34
- });
35
- }
36
- export {
37
- T as FieldSelector,
38
- T as default
39
- };
1
+ import { t as e } from "../../../../chunks/field-selector.js";
2
+ export { e as FieldSelector, e as default };
@@ -1,4 +1,2 @@
1
- import { FieldSelector as r } from "./field-selector.js";
2
- export {
3
- r as FieldSelector
4
- };
1
+ import { t as e } from "../../../../chunks/field-selector.js";
2
+ export { e as FieldSelector };
@@ -1,14 +1,12 @@
1
1
  import { defineMessages as e } from "react-intl";
2
- const d = e({
3
- selectField: {
4
- id: "groupSharedFeatures.metadataTemplateEditor.fieldSelector.selectField",
5
- defaultMessage: "Select a Field"
6
- },
7
- unnamedField: {
8
- id: "groupSharedFeatures.metadataTemplateEditor.fieldSelector.unnamedField",
9
- defaultMessage: "(Unnamed field)"
10
- }
2
+ var t = e({
3
+ selectField: {
4
+ id: "groupSharedFeatures.metadataTemplateEditor.fieldSelector.selectField",
5
+ defaultMessage: "Select a Field"
6
+ },
7
+ unnamedField: {
8
+ id: "groupSharedFeatures.metadataTemplateEditor.fieldSelector.unnamedField",
9
+ defaultMessage: "(Unnamed field)"
10
+ }
11
11
  });
12
- export {
13
- d as default
14
- };
12
+ export { t as default };
@@ -1,47 +1,2 @@
1
- import { useIntl as s } from "react-intl";
2
- import { DropdownMenu as e, Button as m } from "@box/blueprint-web";
3
- import { Plus as c } from "@box/blueprint-web-assets/icons/Fill";
4
- import { fieldTypeDropdownMessages as a } from "./messages.js";
5
- import { jsxs as i, jsx as t } from "react/jsx-runtime";
6
- import { useFieldOptions as p } from "../../utils/field-options/useFieldOptions.js";
7
- import '../../../../styles/field-type-dropdown.css';const f = "_addField_1bl6g_1", u = {
8
- addField: f
9
- };
10
- function M({
11
- onFieldAdd: n,
12
- trigger: d
13
- }) {
14
- const {
15
- formatMessage: r
16
- } = s(), l = p();
17
- return /* @__PURE__ */ i(e.Root, {
18
- modal: !1,
19
- children: [/* @__PURE__ */ t(e.Trigger, {
20
- children: d ?? /* @__PURE__ */ t(m, {
21
- className: u.addField,
22
- variant: "secondary",
23
- size: "large",
24
- startIcon: c,
25
- "aria-label": r(a.addFieldAriaLabel),
26
- children: r(a.addField)
27
- })
28
- }), /* @__PURE__ */ t(e.Content, {
29
- children: l.availableFieldTypes.map((o) => /* @__PURE__ */ i(e.Item, {
30
- onClick: () => n(o),
31
- children: [/* @__PURE__ */ t(e.Item.StartElement, {
32
- children: /* @__PURE__ */ t(o.Icon, {
33
- fontSize: "15px",
34
- "aria-hidden": "true"
35
- })
36
- }), /* @__PURE__ */ t(e.Item.MainContent, {
37
- caption: o.description,
38
- label: String(o.label)
39
- })]
40
- }, o.type))
41
- })]
42
- });
43
- }
44
- export {
45
- M as FieldTypeDropdown,
46
- M as default
47
- };
1
+ import { t as e } from "../../../../chunks/field-type-dropdown.js";
2
+ export { e as FieldTypeDropdown, e as default };
@@ -1,4 +1,2 @@
1
- import { FieldTypeDropdown as p } from "./field-type-dropdown.js";
2
- export {
3
- p as FieldTypeDropdown
4
- };
1
+ import { t as e } from "../../../../chunks/field-type-dropdown.js";
2
+ export { e as FieldTypeDropdown };
@@ -1,14 +1,12 @@
1
1
  import { defineMessages as e } from "react-intl";
2
- const a = e({
3
- addField: {
4
- id: "groupSharedFeatures.metadataTemplateEditor.fieldTypeDropdown.addField",
5
- defaultMessage: "Add field"
6
- },
7
- addFieldAriaLabel: {
8
- id: "groupSharedFeatures.metadataTemplateEditor.fieldTypeDropdown.addFieldAriaLabel",
9
- defaultMessage: "Add field"
10
- }
2
+ var t = e({
3
+ addField: {
4
+ id: "groupSharedFeatures.metadataTemplateEditor.fieldTypeDropdown.addField",
5
+ defaultMessage: "Add field"
6
+ },
7
+ addFieldAriaLabel: {
8
+ id: "groupSharedFeatures.metadataTemplateEditor.fieldTypeDropdown.addFieldAriaLabel",
9
+ defaultMessage: "Add field"
10
+ }
11
11
  });
12
- export {
13
- a as fieldTypeDropdownMessages
14
- };
12
+ export { t as fieldTypeDropdownMessages };
@@ -1,40 +1,33 @@
1
- import { RadioTiles as l } from "@box/blueprint-web";
2
- import { SurfaceSurfaceBrand as p } from "@box/blueprint-web-assets/tokens/tokens";
3
- import { useIntl as d } from "react-intl";
4
- import { emptyStateMessages as m } from "./messages.js";
5
- import { jsx as t } from "react/jsx-runtime";
6
- import { useFieldOptions as c } from "../../utils/field-options/useFieldOptions.js";
7
- function g({
8
- onFieldAdd: o
9
- }) {
10
- const {
11
- formatMessage: r
12
- } = d(), a = c(), n = (e) => {
13
- const i = a.availableFieldTypes.find((s) => s.type === e.target.value);
14
- i && o(i);
15
- };
16
- return /* @__PURE__ */ t("div", {
17
- "data-testid": "md-template-type-picker-tiles",
18
- children: /* @__PURE__ */ t(l, {
19
- name: "field-type-picker",
20
- value: void 0,
21
- columns: 5,
22
- "aria-label": r(m.selectFieldTypeAriaLabel),
23
- onChange: n,
24
- children: a.availableFieldTypes.map((e) => /* @__PURE__ */ t(l.Option, {
25
- value: e.type,
26
- label: e.label,
27
- icon: /* @__PURE__ */ t(e.Icon, {
28
- height: 32,
29
- width: 32,
30
- color: p,
31
- "aria-hidden": !0
32
- })
33
- }, e.type))
34
- })
35
- });
1
+ import { useFieldOptions as e } from "../../utils/field-options/useFieldOptions.js";
2
+ import { emptyStateMessages as t } from "./messages.js";
3
+ import { RadioTiles as n } from "@box/blueprint-web";
4
+ import { useIntl as r } from "react-intl";
5
+ import { jsx as i } from "react/jsx-runtime";
6
+ import { SurfaceSurfaceBrand as a } from "@box/blueprint-web-assets/tokens/tokens";
7
+ function o({ onFieldAdd: o }) {
8
+ let { formatMessage: s } = r(), c = e();
9
+ return /* @__PURE__ */ i("div", {
10
+ "data-testid": "md-template-type-picker-tiles",
11
+ children: /* @__PURE__ */ i(n, {
12
+ name: "field-type-picker",
13
+ value: void 0,
14
+ columns: 5,
15
+ "aria-label": s(t.selectFieldTypeAriaLabel),
16
+ onChange: (e) => {
17
+ let t = c.availableFieldTypes.find((t) => t.type === e.target.value);
18
+ t && o(t);
19
+ },
20
+ children: c.availableFieldTypes.map((e) => /* @__PURE__ */ i(n.Option, {
21
+ value: e.type,
22
+ label: e.label,
23
+ icon: /* @__PURE__ */ i(e.Icon, {
24
+ height: 32,
25
+ width: 32,
26
+ color: a,
27
+ "aria-hidden": !0
28
+ })
29
+ }, e.type))
30
+ })
31
+ });
36
32
  }
37
- export {
38
- g as FieldTypeTiles,
39
- g as default
40
- };
33
+ export { o as FieldTypeTiles, o as default };
@@ -1,4 +1,2 @@
1
- import { FieldTypeTiles as l } from "./field-type-tiles.js";
2
- export {
3
- l as FieldTypeTiles
4
- };
1
+ import { FieldTypeTiles as e } from "./field-type-tiles.js";
2
+ export { e as FieldTypeTiles };
@@ -1,14 +1,12 @@
1
1
  import { defineMessages as e } from "react-intl";
2
- const a = e({
3
- heading: {
4
- id: "groupSharedFeatures.metadataTemplateEditor.emptyState.heading",
5
- defaultMessage: "Add your first field"
6
- },
7
- selectFieldTypeAriaLabel: {
8
- id: "groupSharedFeatures.metadataTemplateEditor.emptyState.selectFieldTypeAriaLabel",
9
- defaultMessage: "Select the field type."
10
- }
2
+ var t = e({
3
+ heading: {
4
+ id: "groupSharedFeatures.metadataTemplateEditor.emptyState.heading",
5
+ defaultMessage: "Add your first field"
6
+ },
7
+ selectFieldTypeAriaLabel: {
8
+ id: "groupSharedFeatures.metadataTemplateEditor.emptyState.selectFieldTypeAriaLabel",
9
+ defaultMessage: "Select the field type."
10
+ }
11
11
  });
12
- export {
13
- a as emptyStateMessages
14
- };
12
+ export { t as emptyStateMessages };
@@ -1,46 +1,33 @@
1
- import { Modal as e } from "@box/blueprint-web";
2
- import { useIntl as m } from "react-intl";
3
- import n from "./messages.js";
4
- import { jsx as o, jsxs as l } from "react/jsx-runtime";
5
- const B = ({
6
- onClose: t,
7
- onConfirm: a,
8
- title: i,
9
- body: c,
10
- confirmLabel: s,
11
- cancelLabel: d
12
- }) => {
13
- const {
14
- formatMessage: r
15
- } = m();
16
- return /* @__PURE__ */ o(e, {
17
- onOpenChange: t,
18
- open: !0,
19
- children: /* @__PURE__ */ l(e.Content, {
20
- size: "small",
21
- children: [/* @__PURE__ */ o(e.Header, {
22
- children: i
23
- }), /* @__PURE__ */ o(e.ScrollableContainer, {
24
- children: /* @__PURE__ */ o(e.Body, {
25
- className: "confirmationModal-body",
26
- children: c
27
- })
28
- }), /* @__PURE__ */ l(e.Footer, {
29
- children: [/* @__PURE__ */ o(e.Footer.SecondaryButton, {
30
- onClick: t,
31
- size: "large",
32
- children: d ?? r(n.cancelButtonText)
33
- }), /* @__PURE__ */ o(e.Footer.PrimaryButton, {
34
- onClick: a,
35
- size: "large",
36
- children: s ?? r(n.confirmButtonText)
37
- })]
38
- }), /* @__PURE__ */ o(e.Close, {
39
- "aria-label": r(n.closeButtonAriaLabel)
40
- })]
41
- })
42
- });
43
- };
44
- export {
45
- B as default
1
+ import e from "./messages.js";
2
+ import { Modal as t } from "@box/blueprint-web";
3
+ import { useIntl as n } from "react-intl";
4
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
+ import "react";
6
+ var a = ({ onClose: a, onConfirm: o, title: s, body: c, confirmLabel: l, cancelLabel: u }) => {
7
+ let { formatMessage: d } = n();
8
+ return /* @__PURE__ */ r(t, {
9
+ onOpenChange: a,
10
+ open: !0,
11
+ children: /* @__PURE__ */ i(t.Content, {
12
+ size: "small",
13
+ children: [
14
+ /* @__PURE__ */ r(t.Header, { children: s }),
15
+ /* @__PURE__ */ r(t.ScrollableContainer, { children: /* @__PURE__ */ r(t.Body, {
16
+ className: "confirmationModal-body",
17
+ children: c
18
+ }) }),
19
+ /* @__PURE__ */ i(t.Footer, { children: [/* @__PURE__ */ r(t.Footer.SecondaryButton, {
20
+ onClick: a,
21
+ size: "large",
22
+ children: u ?? d(e.cancelButtonText)
23
+ }), /* @__PURE__ */ r(t.Footer.PrimaryButton, {
24
+ onClick: o,
25
+ size: "large",
26
+ children: l ?? d(e.confirmButtonText)
27
+ })] }),
28
+ /* @__PURE__ */ r(t.Close, { "aria-label": d(e.closeButtonAriaLabel) })
29
+ ]
30
+ })
31
+ });
46
32
  };
33
+ export { a as default };
@@ -1,18 +1,16 @@
1
1
  import { defineMessages as e } from "react-intl";
2
- const t = e({
3
- cancelButtonText: {
4
- id: "groupSharedFeatures.metadataTemplateEditor.confirmationModal.cancelButtonText",
5
- defaultMessage: "Cancel"
6
- },
7
- closeButtonAriaLabel: {
8
- id: "groupSharedFeatures.metadataTemplateEditor.confirmationModal.closeButtonAriaLabel",
9
- defaultMessage: "Close"
10
- },
11
- confirmButtonText: {
12
- id: "groupSharedFeatures.metadataTemplateEditor.confirmationModal.confirmButtonText",
13
- defaultMessage: "Confirm"
14
- }
2
+ var t = e({
3
+ cancelButtonText: {
4
+ id: "groupSharedFeatures.metadataTemplateEditor.confirmationModal.cancelButtonText",
5
+ defaultMessage: "Cancel"
6
+ },
7
+ closeButtonAriaLabel: {
8
+ id: "groupSharedFeatures.metadataTemplateEditor.confirmationModal.closeButtonAriaLabel",
9
+ defaultMessage: "Close"
10
+ },
11
+ confirmButtonText: {
12
+ id: "groupSharedFeatures.metadataTemplateEditor.confirmationModal.confirmButtonText",
13
+ defaultMessage: "Confirm"
14
+ }
15
15
  });
16
- export {
17
- t as default
18
- };
16
+ export { t as default };