@box/metadata-template-browser 1.17.8 → 1.17.10

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 (68) hide show
  1. package/dist/chunks/breadcrumb-navigation.js +35 -0
  2. package/dist/chunks/browser-row.js +52 -0
  3. package/dist/chunks/grid-list-load-more-sentinel.js +31 -0
  4. package/dist/chunks/load-more-error-row.js +36 -0
  5. package/dist/chunks/load-more-loading-row.js +26 -0
  6. package/dist/chunks/loader-skeleton.js +16 -0
  7. package/dist/chunks/metadata-template-browser-container.js +31 -0
  8. package/dist/chunks/metadata-template-browser-controller.js +36 -0
  9. package/dist/chunks/metadata-template-browser-list-box.js +57 -0
  10. package/dist/chunks/types.js +4 -6
  11. package/dist/chunks/virtualized-grid-list.js +54 -0
  12. package/dist/esm/index.js +2 -4
  13. package/dist/esm/lib/components/breadcrumb-navigation/breadcrumb-navigation.js +2 -51
  14. package/dist/esm/lib/components/breadcrumb-navigation/index.js +2 -4
  15. package/dist/esm/lib/components/breadcrumb-navigation/messages.js +14 -16
  16. package/dist/esm/lib/components/browse-list/browse-list.js +57 -82
  17. package/dist/esm/lib/components/browse-list/index.js +1 -3
  18. package/dist/esm/lib/components/browse-list/messages.js +14 -16
  19. package/dist/esm/lib/components/browser-row/browser-row.js +2 -63
  20. package/dist/esm/lib/components/browser-row/index.js +2 -4
  21. package/dist/esm/lib/components/error-state/error-state.js +22 -31
  22. package/dist/esm/lib/components/error-state/index.js +2 -4
  23. package/dist/esm/lib/components/error-state/messages.js +5 -9
  24. package/dist/esm/lib/components/index.js +12 -24
  25. package/dist/esm/lib/components/load-more-feedback/index.js +3 -6
  26. package/dist/esm/lib/components/load-more-feedback/load-more-error-row.js +2 -44
  27. package/dist/esm/lib/components/load-more-feedback/load-more-loading-row.js +2 -34
  28. package/dist/esm/lib/components/load-more-feedback/messages.js +18 -20
  29. package/dist/esm/lib/components/loader-skeleton/index.js +2 -4
  30. package/dist/esm/lib/components/loader-skeleton/loader-skeleton.js +2 -26
  31. package/dist/esm/lib/components/messages.js +26 -28
  32. package/dist/esm/lib/components/metadata-template-browser-container.js +2 -35
  33. package/dist/esm/lib/components/metadata-template-browser-controller.js +2 -58
  34. package/dist/esm/lib/components/metadata-template-browser-list-box/index.js +2 -4
  35. package/dist/esm/lib/components/metadata-template-browser-list-box/metadata-template-browser-list-box.js +2 -65
  36. package/dist/esm/lib/components/namespace-row/index.js +2 -4
  37. package/dist/esm/lib/components/namespace-row/messages.js +5 -9
  38. package/dist/esm/lib/components/namespace-row/namespace-row.js +21 -31
  39. package/dist/esm/lib/components/search-list/index.js +2 -4
  40. package/dist/esm/lib/components/search-list/messages.js +18 -20
  41. package/dist/esm/lib/components/search-list/search-list.js +53 -75
  42. package/dist/esm/lib/components/template-row/index.js +2 -4
  43. package/dist/esm/lib/components/template-row/messages.js +5 -9
  44. package/dist/esm/lib/components/template-row/template-row.js +47 -68
  45. package/dist/esm/lib/components/virtualized-grid-list/grid-list-load-more-sentinel.js +2 -49
  46. package/dist/esm/lib/components/virtualized-grid-list/index.js +2 -4
  47. package/dist/esm/lib/components/virtualized-grid-list/messages.js +5 -9
  48. package/dist/esm/lib/components/virtualized-grid-list/virtualized-grid-list.js +2 -66
  49. package/dist/esm/lib/constants.js +2 -14
  50. package/dist/esm/lib/contexts/contexts.js +88 -123
  51. package/dist/esm/lib/contexts/hooks.js +25 -38
  52. package/dist/esm/lib/contexts/index.js +4 -16
  53. package/dist/esm/lib/contexts/provider.js +50 -58
  54. package/dist/esm/lib/contexts/reducer.js +151 -178
  55. package/dist/esm/lib/contexts/use-template-browser-actions.js +224 -263
  56. package/dist/esm/lib/hooks/use-is-initial-browse-loading.js +5 -15
  57. package/dist/esm/lib/metadata-template-browser.js +16 -25
  58. package/dist/styles/breadcrumb-navigation.css +1 -1
  59. package/dist/styles/browser-row.css +1 -1
  60. package/dist/styles/grid-list-load-more-sentinel.css +1 -1
  61. package/dist/styles/load-more-error-row.css +1 -1
  62. package/dist/styles/load-more-loading-row.css +1 -1
  63. package/dist/styles/loader-skeleton.css +1 -1
  64. package/dist/styles/metadata-template-browser-container.css +1 -1
  65. package/dist/styles/metadata-template-browser-controller.css +1 -1
  66. package/dist/styles/metadata-template-browser-list-box.css +1 -1
  67. package/dist/styles/virtualized-grid-list.css +1 -1
  68. package/package.json +6 -6
@@ -1,18 +1,16 @@
1
1
  import { defineMessages as e } from "react-intl";
2
- const t = e({
3
- listAriaLabel: {
4
- id: "groupSharedFeatures.metadataTemplateBrowser.browseList.listAriaLabel",
5
- defaultMessage: "Metadata templates"
6
- },
7
- browseErrorBody: {
8
- id: "groupSharedFeatures.metadataTemplateBrowser.browseList.browseErrorBody",
9
- defaultMessage: "Something went wrong while loading this namespace."
10
- },
11
- emptyStateBody: {
12
- id: "groupSharedFeatures.metadataTemplateBrowser.browseList.emptyStateBody",
13
- defaultMessage: "There are no templates or namespaces in this folder."
14
- }
2
+ var t = e({
3
+ listAriaLabel: {
4
+ id: "groupSharedFeatures.metadataTemplateBrowser.browseList.listAriaLabel",
5
+ defaultMessage: "Metadata templates"
6
+ },
7
+ browseErrorBody: {
8
+ id: "groupSharedFeatures.metadataTemplateBrowser.browseList.browseErrorBody",
9
+ defaultMessage: "Something went wrong while loading this namespace."
10
+ },
11
+ emptyStateBody: {
12
+ id: "groupSharedFeatures.metadataTemplateBrowser.browseList.emptyStateBody",
13
+ defaultMessage: "There are no templates or namespaces in this folder."
14
+ }
15
15
  });
16
- export {
17
- t as messages
18
- };
16
+ export { t as messages };
@@ -1,63 +1,2 @@
1
- import { EllipsizableText as _ } from "@box/blueprint-web";
2
- import a from "clsx";
3
- import { GridListItem as b } from "react-aria-components";
4
- import { jsx as i, jsxs as r } from "react/jsx-runtime";
5
- import { useConsumerState as y } from "../../contexts/hooks.js";
6
- import '../../../../styles/browser-row.css';const g = "_row_ybl3t_2", v = "_trailingSlotHoverOnly_ybl3t_15", u = "_item_ybl3t_19", p = "_disabled_ybl3t_40", S = "_leadingIcon_ybl3t_59", h = "_content_ybl3t_66", N = "_trailingSlot_ybl3t_15", f = "_subtitle_ybl3t_77", t = {
7
- row: g,
8
- trailingSlotHoverOnly: v,
9
- item: u,
10
- disabled: p,
11
- leadingIcon: S,
12
- content: h,
13
- trailingSlot: N,
14
- subtitle: f
15
- };
16
- function C({
17
- id: c,
18
- leadingIcon: l,
19
- title: e,
20
- subtitle: n,
21
- trailingSlot: o,
22
- isTrailingSlotHoverOnly: d
23
- }) {
24
- const {
25
- isDisabled: s
26
- } = y(), m = a(t.trailingSlot, {
27
- [t.trailingSlotHoverOnly]: d
28
- });
29
- return /* @__PURE__ */ i(b, {
30
- className: a(t.item, {
31
- [t.disabled]: s
32
- }),
33
- id: c,
34
- isDisabled: s,
35
- textValue: e,
36
- children: /* @__PURE__ */ r("div", {
37
- className: t.row,
38
- children: [l !== void 0 && /* @__PURE__ */ i("div", {
39
- "aria-hidden": "true",
40
- className: t.leadingIcon,
41
- "data-testid": "leading-icon",
42
- children: l
43
- }), /* @__PURE__ */ r("div", {
44
- className: t.content,
45
- children: [/* @__PURE__ */ i(_, {
46
- as: "span",
47
- lineClamp: 1,
48
- variant: "bodyDefault",
49
- children: e
50
- }), n && /* @__PURE__ */ i("div", {
51
- className: t.subtitle,
52
- children: n
53
- })]
54
- }), o !== void 0 && /* @__PURE__ */ i("div", {
55
- className: m,
56
- children: o
57
- })]
58
- })
59
- });
60
- }
61
- export {
62
- C as BrowserRow
63
- };
1
+ import { t as e } from "../../../../chunks/browser-row.js";
2
+ export { e as BrowserRow };
@@ -1,4 +1,2 @@
1
- import { BrowserRow as e } from "./browser-row.js";
2
- export {
3
- e as BrowserRow
4
- };
1
+ import { t as e } from "../../../../chunks/browser-row.js";
2
+ export { e as BrowserRow };
@@ -1,32 +1,23 @@
1
- import { EmptyState as t, Text as s } from "@box/blueprint-web";
2
- import { CustomTemplate as a } from "@box/blueprint-web-assets/illustrations/Small";
3
- import { useIntl as l } from "react-intl";
4
- import { messages as n } from "./messages.js";
5
- import { jsx as r } from "react/jsx-runtime";
6
- import { useConsumerState as p } from "../../contexts/hooks.js";
7
- function h({
8
- body: o,
9
- onRetry: e
10
- }) {
11
- const {
12
- formatMessage: m
13
- } = l(), {
14
- isDisabled: i
15
- } = p();
16
- return /* @__PURE__ */ r(t, {
17
- body: /* @__PURE__ */ r(s, {
18
- as: "p",
19
- children: o
20
- }),
21
- illustration: a,
22
- size: "small",
23
- children: /* @__PURE__ */ r(t.PrimaryAction, {
24
- disabled: i,
25
- onClick: e,
26
- children: m(n.retryLabel)
27
- })
28
- });
1
+ import { useConsumerState as e } from "../../contexts/hooks.js";
2
+ import { messages as t } from "./messages.js";
3
+ import { EmptyState as n, Text as r } from "@box/blueprint-web";
4
+ import { useIntl as i } from "react-intl";
5
+ import { jsx as a } from "react/jsx-runtime";
6
+ import { CustomTemplate as o } from "@box/blueprint-web-assets/illustrations/Small";
7
+ function s({ body: s, onRetry: c }) {
8
+ let { formatMessage: l } = i(), { isDisabled: u } = e();
9
+ return /* @__PURE__ */ a(n, {
10
+ body: /* @__PURE__ */ a(r, {
11
+ as: "p",
12
+ children: s
13
+ }),
14
+ illustration: o,
15
+ size: "small",
16
+ children: /* @__PURE__ */ a(n.PrimaryAction, {
17
+ disabled: u,
18
+ onClick: c,
19
+ children: l(t.retryLabel)
20
+ })
21
+ });
29
22
  }
30
- export {
31
- h as ErrorState
32
- };
23
+ export { s as ErrorState };
@@ -1,4 +1,2 @@
1
- import { ErrorState as t } from "./error-state.js";
2
- export {
3
- t as ErrorState
4
- };
1
+ import { ErrorState as e } from "./error-state.js";
2
+ export { e as ErrorState };
@@ -1,10 +1,6 @@
1
1
  import { defineMessages as e } from "react-intl";
2
- const a = e({
3
- retryLabel: {
4
- id: "groupSharedFeatures.metadataTemplateBrowser.errorState.retryLabel",
5
- defaultMessage: "Try again"
6
- }
7
- });
8
- export {
9
- a as messages
10
- };
2
+ var t = e({ retryLabel: {
3
+ id: "groupSharedFeatures.metadataTemplateBrowser.errorState.retryLabel",
4
+ defaultMessage: "Try again"
5
+ } });
6
+ export { t as messages };
@@ -1,24 +1,12 @@
1
- import { MetadataTemplateBrowserContainer as o } from "./metadata-template-browser-container.js";
2
- import { MetadataTemplateBrowserController as a } from "./metadata-template-browser-controller.js";
3
- import { BreadcrumbNavigation as p } from "./breadcrumb-navigation/breadcrumb-navigation.js";
4
- import { BrowseList as f } from "./browse-list/browse-list.js";
5
- import { ErrorState as s } from "./error-state/error-state.js";
6
- import { LoaderSkeleton as d } from "./loader-skeleton/loader-skeleton.js";
7
- import { MetadataTemplateBrowserListBox as B } from "./metadata-template-browser-list-box/metadata-template-browser-list-box.js";
8
- import { NamespaceRow as L } from "./namespace-row/namespace-row.js";
9
- import { SearchList as c } from "./search-list/search-list.js";
10
- import { TemplateRow as S } from "./template-row/template-row.js";
11
- import { VirtualizedGridList as C } from "./virtualized-grid-list/virtualized-grid-list.js";
12
- export {
13
- p as BreadcrumbNavigation,
14
- f as BrowseList,
15
- s as ErrorState,
16
- d as LoaderSkeleton,
17
- o as MetadataTemplateBrowserContainer,
18
- a as MetadataTemplateBrowserController,
19
- B as MetadataTemplateBrowserListBox,
20
- L as NamespaceRow,
21
- c as SearchList,
22
- S as TemplateRow,
23
- C as VirtualizedGridList
24
- };
1
+ import { t as e } from "../../../chunks/breadcrumb-navigation.js";
2
+ import { ErrorState as t } from "./error-state/error-state.js";
3
+ import { t as n } from "../../../chunks/loader-skeleton.js";
4
+ import { NamespaceRow as r } from "./namespace-row/namespace-row.js";
5
+ import { TemplateRow as i } from "./template-row/template-row.js";
6
+ import { t as a } from "../../../chunks/virtualized-grid-list.js";
7
+ import { BrowseList as o } from "./browse-list/browse-list.js";
8
+ import { SearchList as s } from "./search-list/search-list.js";
9
+ import { t as c } from "../../../chunks/metadata-template-browser-container.js";
10
+ import { t as l } from "../../../chunks/metadata-template-browser-list-box.js";
11
+ import { t as u } from "../../../chunks/metadata-template-browser-controller.js";
12
+ export { e as BreadcrumbNavigation, o as BrowseList, t as ErrorState, n as LoaderSkeleton, c as MetadataTemplateBrowserContainer, u as MetadataTemplateBrowserController, l as MetadataTemplateBrowserListBox, r as NamespaceRow, s as SearchList, i as TemplateRow, a as VirtualizedGridList };
@@ -1,6 +1,3 @@
1
- import { LoadMoreErrorRow as e } from "./load-more-error-row.js";
2
- import { LoadMoreLoadingRow as d } from "./load-more-loading-row.js";
3
- export {
4
- e as LoadMoreErrorRow,
5
- d as LoadMoreLoadingRow
6
- };
1
+ import { t as e } from "../../../../chunks/load-more-error-row.js";
2
+ import { t } from "../../../../chunks/load-more-loading-row.js";
3
+ export { e as LoadMoreErrorRow, t as LoadMoreLoadingRow };
@@ -1,44 +1,2 @@
1
- import { InlineNotice as m, TextButton as c } from "@box/blueprint-web";
2
- import { Loader as l } from "@box/blueprint-web-assets/icons/Fill";
3
- import { GridListItem as d } from "react-aria-components";
4
- import { useIntl as p } from "react-intl";
5
- import { LOAD_MORE_ERROR_ROW_ID as f } from "../../constants.js";
6
- import { messages as o } from "./messages.js";
7
- import { jsx as t, jsxs as _ } from "react/jsx-runtime";
8
- import { useConsumerState as u } from "../../contexts/hooks.js";
9
- import '../../../../styles/load-more-error-row.css';const b = "_container_1bidp_1", L = "_item_1bidp_9", i = {
10
- container: b,
11
- item: L
12
- };
13
- function O({
14
- onRetry: n
15
- }) {
16
- const {
17
- formatMessage: r
18
- } = p(), {
19
- isDisabled: e
20
- } = u(), a = (s) => {
21
- s.stopPropagation(), !e && n();
22
- };
23
- return /* @__PURE__ */ t(d, {
24
- className: i.item,
25
- id: f,
26
- textValue: r(o.loadMoreErrorBody),
27
- children: /* @__PURE__ */ _("div", {
28
- className: i.container,
29
- children: [/* @__PURE__ */ t(m, {
30
- variant: "error",
31
- variantIconAriaLabel: r(o.errorIconAriaLabel),
32
- children: r(o.loadMoreErrorBody)
33
- }), /* @__PURE__ */ t(c, {
34
- disabled: e,
35
- icon: l,
36
- onClick: a,
37
- children: r(o.retryLabel)
38
- })]
39
- })
40
- });
41
- }
42
- export {
43
- O as LoadMoreErrorRow
44
- };
1
+ import { t as e } from "../../../../chunks/load-more-error-row.js";
2
+ export { e as LoadMoreErrorRow };
@@ -1,34 +1,2 @@
1
- import { Ghost as r } from "@box/blueprint-web";
2
- import { useIntl as i } from "react-intl";
3
- import { GridListItem as a } from "react-aria-components";
4
- import { LOAD_MORE_LOADING_ROW_ID as s } from "../../constants.js";
5
- import { messages as n } from "./messages.js";
6
- import { jsx as o, jsxs as m } from "react/jsx-runtime";
7
- import '../../../../styles/load-more-loading-row.css';const l = "_container_1rh3v_1", c = {
8
- container: l
9
- };
10
- function _() {
11
- const {
12
- formatMessage: e
13
- } = i(), t = e(n.loadingRowAriaLabel);
14
- return /* @__PURE__ */ o(a, {
15
- "aria-busy": "true",
16
- "aria-label": t,
17
- id: s,
18
- isDisabled: !0,
19
- textValue: t,
20
- children: /* @__PURE__ */ m("div", {
21
- className: c.container,
22
- children: [/* @__PURE__ */ o(r, {
23
- height: 16
24
- }), /* @__PURE__ */ o(r, {
25
- height: 16
26
- }), /* @__PURE__ */ o(r, {
27
- height: 16
28
- })]
29
- })
30
- });
31
- }
32
- export {
33
- _ as LoadMoreLoadingRow
34
- };
1
+ import { t as e } from "../../../../chunks/load-more-loading-row.js";
2
+ export { e as LoadMoreLoadingRow };
@@ -1,22 +1,20 @@
1
1
  import { defineMessages as e } from "react-intl";
2
- const r = e({
3
- loadingRowAriaLabel: {
4
- id: "groupSharedFeatures.metadataTemplateBrowser.loadMoreFeedback.loadingRowAriaLabel",
5
- defaultMessage: "Loading more items"
6
- },
7
- errorIconAriaLabel: {
8
- id: "groupSharedFeatures.metadataTemplateBrowser.loadMoreFeedback.errorIconAriaLabel",
9
- defaultMessage: "Error"
10
- },
11
- loadMoreErrorBody: {
12
- id: "groupSharedFeatures.metadataTemplateBrowser.loadMoreFeedback.loadMoreErrorBody",
13
- defaultMessage: "Failed to load more items."
14
- },
15
- retryLabel: {
16
- id: "groupSharedFeatures.metadataTemplateBrowser.loadMoreFeedback.retryLabel",
17
- defaultMessage: "Try again"
18
- }
2
+ var t = e({
3
+ loadingRowAriaLabel: {
4
+ id: "groupSharedFeatures.metadataTemplateBrowser.loadMoreFeedback.loadingRowAriaLabel",
5
+ defaultMessage: "Loading more items"
6
+ },
7
+ errorIconAriaLabel: {
8
+ id: "groupSharedFeatures.metadataTemplateBrowser.loadMoreFeedback.errorIconAriaLabel",
9
+ defaultMessage: "Error"
10
+ },
11
+ loadMoreErrorBody: {
12
+ id: "groupSharedFeatures.metadataTemplateBrowser.loadMoreFeedback.loadMoreErrorBody",
13
+ defaultMessage: "Failed to load more items."
14
+ },
15
+ retryLabel: {
16
+ id: "groupSharedFeatures.metadataTemplateBrowser.loadMoreFeedback.retryLabel",
17
+ defaultMessage: "Try again"
18
+ }
19
19
  });
20
- export {
21
- r as messages
22
- };
20
+ export { t as messages };
@@ -1,4 +1,2 @@
1
- import { LoaderSkeleton as r } from "./loader-skeleton.js";
2
- export {
3
- r as LoaderSkeleton
4
- };
1
+ import { t as e } from "../../../../chunks/loader-skeleton.js";
2
+ export { e as LoaderSkeleton };
@@ -1,26 +1,2 @@
1
- import { Ghost as t } from "@box/blueprint-web";
2
- import { useIntl as a } from "react-intl";
3
- import { messages as s } from "../messages.js";
4
- import { jsx as e } from "react/jsx-runtime";
5
- import '../../../../styles/loader-skeleton.css';const l = "_loaderSkeleton_hxe4x_1", n = {
6
- loaderSkeleton: l
7
- }, i = 16, m = 20;
8
- function _() {
9
- const {
10
- formatMessage: o
11
- } = a();
12
- return /* @__PURE__ */ e("div", {
13
- "aria-busy": "true",
14
- "aria-label": o(s.loadingAriaLabel),
15
- className: n.loaderSkeleton,
16
- role: "status",
17
- children: Array.from({
18
- length: m
19
- }, (c, r) => /* @__PURE__ */ e(t, {
20
- height: i
21
- }, r))
22
- });
23
- }
24
- export {
25
- _ as LoaderSkeleton
26
- };
1
+ import { t as e } from "../../../../chunks/loader-skeleton.js";
2
+ export { e as LoaderSkeleton };
@@ -1,30 +1,28 @@
1
1
  import { defineMessages as e } from "react-intl";
2
- const t = e({
3
- searchInputPlaceholder: {
4
- id: "groupSharedFeatures.metadataTemplateBrowser.container.searchInputPlaceholder",
5
- defaultMessage: "Search templates"
6
- },
7
- searchInputAriaLabel: {
8
- id: "groupSharedFeatures.metadataTemplateBrowser.container.searchInputAriaLabel",
9
- defaultMessage: "Search templates"
10
- },
11
- searchInputClearAriaLabel: {
12
- id: "groupSharedFeatures.metadataTemplateBrowser.container.searchInputClearAriaLabel",
13
- defaultMessage: "Clear search"
14
- },
15
- loadingAriaLabel: {
16
- id: "groupSharedFeatures.metadataTemplateBrowser.container.loadingAriaLabel",
17
- defaultMessage: "Loading templates"
18
- },
19
- initialEmptyStateBody: {
20
- id: "groupSharedFeatures.metadataTemplateBrowser.container.initialEmptyStateBody",
21
- defaultMessage: "At the moment, there are no metadata templates ready for use. You can create the first one by reaching out to your Admin."
22
- },
23
- initialLoadErrorBody: {
24
- id: "groupSharedFeatures.metadataTemplateBrowser.container.initialLoadErrorBody",
25
- defaultMessage: "Something went wrong while loading templates."
26
- }
2
+ var t = e({
3
+ searchInputPlaceholder: {
4
+ id: "groupSharedFeatures.metadataTemplateBrowser.container.searchInputPlaceholder",
5
+ defaultMessage: "Search templates"
6
+ },
7
+ searchInputAriaLabel: {
8
+ id: "groupSharedFeatures.metadataTemplateBrowser.container.searchInputAriaLabel",
9
+ defaultMessage: "Search templates"
10
+ },
11
+ searchInputClearAriaLabel: {
12
+ id: "groupSharedFeatures.metadataTemplateBrowser.container.searchInputClearAriaLabel",
13
+ defaultMessage: "Clear search"
14
+ },
15
+ loadingAriaLabel: {
16
+ id: "groupSharedFeatures.metadataTemplateBrowser.container.loadingAriaLabel",
17
+ defaultMessage: "Loading templates"
18
+ },
19
+ initialEmptyStateBody: {
20
+ id: "groupSharedFeatures.metadataTemplateBrowser.container.initialEmptyStateBody",
21
+ defaultMessage: "At the moment, there are no metadata templates ready for use. You can create the first one by reaching out to your Admin."
22
+ },
23
+ initialLoadErrorBody: {
24
+ id: "groupSharedFeatures.metadataTemplateBrowser.container.initialLoadErrorBody",
25
+ defaultMessage: "Something went wrong while loading templates."
26
+ }
27
27
  });
28
- export {
29
- t as messages
30
- };
28
+ export { t as messages };
@@ -1,35 +1,2 @@
1
- import { SearchInput as i } from "@box/blueprint-web";
2
- import { useIntl as c } from "react-intl";
3
- import { useIsInitialBrowseLoading as m } from "../hooks/use-is-initial-browse-loading.js";
4
- import { messages as a } from "./messages.js";
5
- import { jsxs as l, jsx as r } from "react/jsx-runtime";
6
- import { useConsumerState as p, useBrowserActions as u } from "../contexts/hooks.js";
7
- import { BreadcrumbNavigation as h } from "./breadcrumb-navigation/breadcrumb-navigation.js";
8
- import { MetadataTemplateBrowserListBox as I } from "./metadata-template-browser-list-box/metadata-template-browser-list-box.js";
9
- import '../../../styles/metadata-template-browser-container.css';const d = "_container_qa97y_1", f = "_searchInput_qa97y_9", s = {
10
- container: d,
11
- searchInput: f
12
- };
13
- function x() {
14
- const {
15
- formatMessage: e
16
- } = c(), {
17
- isDisabled: o
18
- } = p(), {
19
- setSearchValue: n
20
- } = u(), t = m();
21
- return /* @__PURE__ */ l("div", {
22
- className: s.container,
23
- children: [/* @__PURE__ */ r(i, {
24
- className: s.searchInput,
25
- disabled: o || t,
26
- onChange: n,
27
- placeholder: e(a.searchInputPlaceholder),
28
- searchInputAriaLabel: e(a.searchInputAriaLabel),
29
- searchInputClearAriaLabel: e(a.searchInputClearAriaLabel)
30
- }), !t && /* @__PURE__ */ r(h, {}), /* @__PURE__ */ r(I, {})]
31
- });
32
- }
33
- export {
34
- x as MetadataTemplateBrowserContainer
35
- };
1
+ import { t as e } from "../../../chunks/metadata-template-browser-container.js";
2
+ export { e as MetadataTemplateBrowserContainer };
@@ -1,58 +1,2 @@
1
- import { MetadataTemplateBrowserContainer as g } from "./metadata-template-browser-container.js";
2
- import { EmptyState as E, Text as B } from "@box/blueprint-web";
3
- import { NoTemplates as L } from "@box/blueprint-web-assets/illustrations/Medium";
4
- import { useRef as w, useEffect as S } from "react";
5
- import { useIntl as x } from "react-intl";
6
- import { messages as a } from "./messages.js";
7
- import { jsxs as C, jsx as t } from "react/jsx-runtime";
8
- import { useConsumerState as I, useBrowserActions as R, useNavigationState as T, useBrowseState as M } from "../contexts/hooks.js";
9
- import { ErrorState as N } from "./error-state/error-state.js";
10
- import "./breadcrumb-navigation/breadcrumb-navigation.js";
11
- import "./browse-list/browse-list.js";
12
- import "./loader-skeleton/loader-skeleton.js";
13
- import "./metadata-template-browser-list-box/metadata-template-browser-list-box.js";
14
- import "./namespace-row/namespace-row.js";
15
- import "./search-list/search-list.js";
16
- import "./template-row/template-row.js";
17
- import "./virtualized-grid-list/virtualized-grid-list.js";
18
- import '../../../styles/metadata-template-browser-controller.css';const _ = "_container_14phx_1", b = {
19
- container: _
20
- };
21
- function W() {
22
- const {
23
- isLoading: o
24
- } = I(), {
25
- formatMessage: e
26
- } = x(), {
27
- initialLoad: s,
28
- retry: m
29
- } = R(), {
30
- path: p
31
- } = T(), {
32
- isFetching: l,
33
- initialLoadError: c,
34
- namespaces: d,
35
- templates: f
36
- } = M(), i = w(!1);
37
- S(() => {
38
- !o && !i.current && (i.current = !0, s());
39
- }, [o, s]);
40
- const u = d.length > 0 || f.length > 0, r = c !== null, h = p.length === 0, n = !l && !o && !u && !r && h, y = !r && !n;
41
- return /* @__PURE__ */ C("div", {
42
- className: b.container,
43
- children: [r && /* @__PURE__ */ t(N, {
44
- body: e(a.initialLoadErrorBody),
45
- onRetry: m
46
- }), n && /* @__PURE__ */ t(E, {
47
- body: /* @__PURE__ */ t(B, {
48
- as: "p",
49
- children: e(a.initialEmptyStateBody)
50
- }),
51
- illustration: L,
52
- size: "small"
53
- }), y && /* @__PURE__ */ t(g, {})]
54
- });
55
- }
56
- export {
57
- W as MetadataTemplateBrowserController
58
- };
1
+ import { t as e } from "../../../chunks/metadata-template-browser-controller.js";
2
+ export { e as MetadataTemplateBrowserController };
@@ -1,4 +1,2 @@
1
- import { MetadataTemplateBrowserListBox as a } from "./metadata-template-browser-list-box.js";
2
- export {
3
- a as MetadataTemplateBrowserListBox
4
- };
1
+ import { t as e } from "../../../../chunks/metadata-template-browser-list-box.js";
2
+ export { e as MetadataTemplateBrowserListBox };
@@ -1,65 +1,2 @@
1
- import x from "clsx";
2
- import { useCallback as _, useMemo as g } from "react";
3
- import { useIsInitialBrowseLoading as L } from "../../hooks/use-is-initial-browse-loading.js";
4
- import { jsx as s, jsxs as v } from "react/jsx-runtime";
5
- import { useConsumerState as A, useSearchState as I, useBrowseState as N, useSelectionState as T, useBrowserActions as W } from "../../contexts/hooks.js";
6
- import { LoaderSkeleton as q } from "../loader-skeleton/loader-skeleton.js";
7
- import { BrowseList as j } from "../browse-list/browse-list.js";
8
- import { SearchList as k } from "../search-list/search-list.js";
9
- import '../../../../styles/metadata-template-browser-list-box.css';const y = "_listBox_1qbmg_1", C = "_browseWrapper_1qbmg_9", M = "_hidden_1qbmg_16", o = {
10
- listBox: y,
11
- browseWrapper: C,
12
- hidden: M
13
- };
14
- function H() {
15
- const {
16
- isDisabled: a
17
- } = A(), w = L(), {
18
- searchValue: B,
19
- searchResults: c
20
- } = I(), {
21
- namespaces: l,
22
- templates: m
23
- } = N(), {
24
- selectedTemplateId: i
25
- } = T(), {
26
- selectTemplate: r,
27
- navigateTo: d
28
- } = W(), t = B.length > 0, p = _((S) => {
29
- if (a)
30
- return;
31
- const n = String(S);
32
- if (t) {
33
- const e = c.find((b) => b.id === n);
34
- e && r(e);
35
- return;
36
- }
37
- const u = m.find((e) => e.id === n);
38
- if (u) {
39
- r(u);
40
- return;
41
- }
42
- const h = l.find((e) => e.id === n);
43
- h && d(h);
44
- }, [a, t, c, m, l, r, d]), f = g(() => i ? /* @__PURE__ */ new Set([i]) : /* @__PURE__ */ new Set(), [i]);
45
- return w ? /* @__PURE__ */ s("div", {
46
- className: o.listBox,
47
- children: /* @__PURE__ */ s(q, {})
48
- }) : /* @__PURE__ */ v("div", {
49
- className: o.listBox,
50
- children: [/* @__PURE__ */ s("div", {
51
- "aria-hidden": t,
52
- className: x(o.browseWrapper, t && o.hidden),
53
- children: /* @__PURE__ */ s(j, {
54
- onAction: p,
55
- selectedKeys: f
56
- })
57
- }), t && /* @__PURE__ */ s(k, {
58
- onAction: p,
59
- selectedKeys: f
60
- })]
61
- });
62
- }
63
- export {
64
- H as MetadataTemplateBrowserListBox
65
- };
1
+ import { t as e } from "../../../../chunks/metadata-template-browser-list-box.js";
2
+ export { e as MetadataTemplateBrowserListBox };
@@ -1,4 +1,2 @@
1
- import { NamespaceRow as a } from "./namespace-row.js";
2
- export {
3
- a as NamespaceRow
4
- };
1
+ import { NamespaceRow as e } from "./namespace-row.js";
2
+ export { e as NamespaceRow };