@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,10 +1,6 @@
1
1
  import { defineMessages as e } from "react-intl";
2
- const s = e({
3
- navigateAriaLabel: {
4
- id: "groupSharedFeatures.metadataTemplateBrowser.namespaceRow.navigateAriaLabel",
5
- defaultMessage: "Navigate into {displayName}"
6
- }
7
- });
8
- export {
9
- s as messages
10
- };
2
+ var t = e({ navigateAriaLabel: {
3
+ id: "groupSharedFeatures.metadataTemplateBrowser.namespaceRow.navigateAriaLabel",
4
+ defaultMessage: "Navigate into {displayName}"
5
+ } });
6
+ export { t as messages };
@@ -1,32 +1,22 @@
1
- import { IconButton as e } from "@box/blueprint-web";
2
- import { ChevronRight as a, Folder as m } from "@box/blueprint-web-assets/icons/Medium";
3
- import { useIntl as s } from "react-intl";
4
- import { messages as l } from "./messages.js";
5
- import { jsx as i } from "react/jsx-runtime";
6
- import { useConsumerState as n } from "../../contexts/hooks.js";
7
- import { BrowserRow as d } from "../browser-row/browser-row.js";
8
- function w({
9
- namespace: o
10
- }) {
11
- const {
12
- formatMessage: r
13
- } = s(), {
14
- isDisabled: t
15
- } = n();
16
- return /* @__PURE__ */ i(d, {
17
- id: o.id,
18
- leadingIcon: /* @__PURE__ */ i(m, {}),
19
- title: o.displayName,
20
- trailingSlot: /* @__PURE__ */ i(e, {
21
- "aria-label": r(l.navigateAriaLabel, {
22
- displayName: o.displayName
23
- }),
24
- disabled: t,
25
- icon: a,
26
- size: "x-small"
27
- })
28
- });
1
+ import { useConsumerState as e } from "../../contexts/hooks.js";
2
+ import { t } from "../../../../chunks/browser-row.js";
3
+ import { messages as n } from "./messages.js";
4
+ import { IconButton as r } from "@box/blueprint-web";
5
+ import { useIntl as i } from "react-intl";
6
+ import { jsx as a } from "react/jsx-runtime";
7
+ import { ChevronRight as o, Folder as s } from "@box/blueprint-web-assets/icons/Medium";
8
+ function c({ namespace: c }) {
9
+ let { formatMessage: l } = i(), { isDisabled: u } = e();
10
+ return /* @__PURE__ */ a(t, {
11
+ id: c.id,
12
+ leadingIcon: /* @__PURE__ */ a(s, {}),
13
+ title: c.displayName,
14
+ trailingSlot: /* @__PURE__ */ a(r, {
15
+ "aria-label": l(n.navigateAriaLabel, { displayName: c.displayName }),
16
+ disabled: u,
17
+ icon: o,
18
+ size: "x-small"
19
+ })
20
+ });
29
21
  }
30
- export {
31
- w as NamespaceRow
32
- };
22
+ export { c as NamespaceRow };
@@ -1,4 +1,2 @@
1
- import { SearchList as o } from "./search-list.js";
2
- export {
3
- o as SearchList
4
- };
1
+ import { SearchList as e } from "./search-list.js";
2
+ export { e as SearchList };
@@ -1,22 +1,20 @@
1
1
  import { defineMessages as e } from "react-intl";
2
- const t = e({
3
- listAriaLabel: {
4
- id: "groupSharedFeatures.metadataTemplateBrowser.searchList.listAriaLabel",
5
- defaultMessage: "Search results"
6
- },
7
- emptyStateHeading: {
8
- id: "groupSharedFeatures.metadataTemplateBrowser.searchList.emptyStateHeading",
9
- defaultMessage: "We couldn't find what you're looking for"
10
- },
11
- emptyStateBody: {
12
- id: "groupSharedFeatures.metadataTemplateBrowser.searchList.emptyStateBody",
13
- defaultMessage: "Try using simpler search terms and then filtering the results."
14
- },
15
- searchErrorBody: {
16
- id: "groupSharedFeatures.metadataTemplateBrowser.searchList.searchErrorBody",
17
- defaultMessage: "Something went wrong while searching."
18
- }
2
+ var t = e({
3
+ listAriaLabel: {
4
+ id: "groupSharedFeatures.metadataTemplateBrowser.searchList.listAriaLabel",
5
+ defaultMessage: "Search results"
6
+ },
7
+ emptyStateHeading: {
8
+ id: "groupSharedFeatures.metadataTemplateBrowser.searchList.emptyStateHeading",
9
+ defaultMessage: "We couldn't find what you're looking for"
10
+ },
11
+ emptyStateBody: {
12
+ id: "groupSharedFeatures.metadataTemplateBrowser.searchList.emptyStateBody",
13
+ defaultMessage: "Try using simpler search terms and then filtering the results."
14
+ },
15
+ searchErrorBody: {
16
+ id: "groupSharedFeatures.metadataTemplateBrowser.searchList.searchErrorBody",
17
+ defaultMessage: "Something went wrong while searching."
18
+ }
19
19
  });
20
- export {
21
- t as messages
22
- };
20
+ export { t as messages };
@@ -1,76 +1,54 @@
1
- import { EmptyState as T, Text as m } from "@box/blueprint-web";
2
- import { CustomTemplate as E } from "@box/blueprint-web-assets/illustrations/Small";
3
- import { useCallback as L } from "react";
4
- import { useIntl as b } from "react-intl";
5
- import { T as n } from "../../../../chunks/types.js";
6
- import { messages as o } from "./messages.js";
7
- import { jsx as r } from "react/jsx-runtime";
8
- import { useSearchState as R, useBrowseState as w, useBrowserActions as x } from "../../contexts/hooks.js";
9
- import { TemplateRow as B } from "../template-row/template-row.js";
10
- import { LoaderSkeleton as I } from "../loader-skeleton/loader-skeleton.js";
11
- import { ErrorState as k } from "../error-state/error-state.js";
12
- import { VirtualizedGridList as v } from "../virtualized-grid-list/virtualized-grid-list.js";
13
- function K({
14
- onAction: l,
15
- selectedKeys: c
16
- }) {
17
- const {
18
- formatMessage: e
19
- } = b(), {
20
- searchResults: a,
21
- searchNextMarker: p,
22
- isFetchingSearch: d,
23
- searchError: h
24
- } = R(), {
25
- isFetchingMore: f,
26
- loadMoreError: u
27
- } = w(), {
28
- loadMore: i,
29
- retry: S,
30
- editTemplate: s
31
- } = x(), y = p !== void 0, M = L((t) => /* @__PURE__ */ r(B, {
32
- onEdit: s,
33
- template: t.template,
34
- variant: n.Search
35
- }), [s]);
36
- if (d)
37
- return /* @__PURE__ */ r(I, {});
38
- if (h !== null)
39
- return /* @__PURE__ */ r(k, {
40
- body: e(o.searchErrorBody),
41
- onRetry: S
42
- });
43
- if (a.length === 0)
44
- return /* @__PURE__ */ r(T, {
45
- body: /* @__PURE__ */ r(m, {
46
- as: "p",
47
- children: e(o.emptyStateBody)
48
- }),
49
- heading: /* @__PURE__ */ r(m, {
50
- as: "p",
51
- children: e(o.emptyStateHeading)
52
- }),
53
- illustration: E,
54
- size: "small"
55
- });
56
- const g = a.map((t) => ({
57
- id: t.id,
58
- template: t
59
- }));
60
- return /* @__PURE__ */ r(v, {
61
- ariaLabel: e(o.listAriaLabel),
62
- isFetchingMore: f,
63
- items: g,
64
- listType: n.Search,
65
- loadMoreError: u,
66
- onAction: l,
67
- hasMoreItems: y,
68
- onLoadMore: i,
69
- onRetry: i,
70
- selectedKeys: c,
71
- children: M
72
- });
1
+ import { useBrowseState as e, useBrowserActions as t, useSearchState as n } from "../../contexts/hooks.js";
2
+ import { t as r } from "../../../../chunks/types.js";
3
+ import { ErrorState as i } from "../error-state/error-state.js";
4
+ import { t as a } from "../../../../chunks/loader-skeleton.js";
5
+ import { TemplateRow as o } from "../template-row/template-row.js";
6
+ import { t as s } from "../../../../chunks/virtualized-grid-list.js";
7
+ import { messages as c } from "./messages.js";
8
+ import { EmptyState as l, Text as u } from "@box/blueprint-web";
9
+ import { useIntl as d } from "react-intl";
10
+ import { useCallback as f } from "react";
11
+ import { jsx as p } from "react/jsx-runtime";
12
+ import { CustomTemplate as m } from "@box/blueprint-web-assets/illustrations/Small";
13
+ function h({ onAction: h, selectedKeys: g }) {
14
+ let { formatMessage: _ } = d(), { searchResults: v, searchNextMarker: y, isFetchingSearch: b, searchError: x } = n(), { isFetchingMore: S, loadMoreError: C } = e(), { loadMore: w, retry: T, editTemplate: E } = t(), D = y !== void 0, O = f((e) => /* @__PURE__ */ p(o, {
15
+ onEdit: E,
16
+ template: e.template,
17
+ variant: r.Search
18
+ }), [E]);
19
+ if (b) return /* @__PURE__ */ p(a, {});
20
+ if (x !== null) return /* @__PURE__ */ p(i, {
21
+ body: _(c.searchErrorBody),
22
+ onRetry: T
23
+ });
24
+ if (v.length === 0) return /* @__PURE__ */ p(l, {
25
+ body: /* @__PURE__ */ p(u, {
26
+ as: "p",
27
+ children: _(c.emptyStateBody)
28
+ }),
29
+ heading: /* @__PURE__ */ p(u, {
30
+ as: "p",
31
+ children: _(c.emptyStateHeading)
32
+ }),
33
+ illustration: m,
34
+ size: "small"
35
+ });
36
+ let k = v.map((e) => ({
37
+ id: e.id,
38
+ template: e
39
+ }));
40
+ return /* @__PURE__ */ p(s, {
41
+ ariaLabel: _(c.listAriaLabel),
42
+ isFetchingMore: S,
43
+ items: k,
44
+ listType: r.Search,
45
+ loadMoreError: C,
46
+ onAction: h,
47
+ hasMoreItems: D,
48
+ onLoadMore: w,
49
+ onRetry: w,
50
+ selectedKeys: g,
51
+ children: O
52
+ });
73
53
  }
74
- export {
75
- K as SearchList
76
- };
54
+ export { h as SearchList };
@@ -1,4 +1,2 @@
1
- import { TemplateRow as m } from "./template-row.js";
2
- export {
3
- m as TemplateRow
4
- };
1
+ import { TemplateRow as e } from "./template-row.js";
2
+ export { e as TemplateRow };
@@ -1,10 +1,6 @@
1
1
  import { defineMessages as e } from "react-intl";
2
- const t = e({
3
- editAriaLabel: {
4
- id: "groupSharedFeatures.metadataTemplateBrowser.templateRow.editAriaLabel",
5
- defaultMessage: "Edit {displayName}"
6
- }
7
- });
8
- export {
9
- t as messages
10
- };
2
+ var t = e({ editAriaLabel: {
3
+ id: "groupSharedFeatures.metadataTemplateBrowser.templateRow.editAriaLabel",
4
+ defaultMessage: "Edit {displayName}"
5
+ } });
6
+ export { t as messages };
@@ -1,70 +1,49 @@
1
- import { IconButton as m, Text as c } from "@box/blueprint-web";
2
- import { Pencil as p } from "@box/blueprint-web-assets/icons/Fill";
3
- import { Metadata as f } from "@box/blueprint-web-assets/icons/Medium";
4
- import { useCallback as h, Fragment as u } from "react";
5
- import { useIntl as g } from "react-intl";
6
- import { T as v } from "../../../../chunks/types.js";
7
- import { messages as b } from "./messages.js";
8
- import { jsx as i, jsxs as x } from "react/jsx-runtime";
9
- import { useConsumerState as y } from "../../contexts/hooks.js";
10
- import { BrowserRow as S } from "../browser-row/browser-row.js";
11
- const w = (o) => {
12
- if (!o.ancestors || o.ancestors.length === 0)
13
- return;
14
- const n = o.ancestors.length - 1;
15
- return o.ancestors.map((r, a) => /* @__PURE__ */ x(u, {
16
- children: [a > 0 && /* @__PURE__ */ i(c, {
17
- "aria-hidden": "true",
18
- as: "span",
19
- color: "textOnLightSecondary",
20
- variant: "caption",
21
- children: " / "
22
- }), /* @__PURE__ */ i(c, {
23
- as: "span",
24
- color: "textOnLightSecondary",
25
- variant: a === n ? "captionBold" : "caption",
26
- children: r.displayName
27
- })]
28
- }, r.fqn));
1
+ import { useConsumerState as e } from "../../contexts/hooks.js";
2
+ import { t } from "../../../../chunks/types.js";
3
+ import { t as n } from "../../../../chunks/browser-row.js";
4
+ import { messages as r } from "./messages.js";
5
+ import { IconButton as i, Text as a } from "@box/blueprint-web";
6
+ import { useIntl as o } from "react-intl";
7
+ import { Fragment as s, useCallback as c } from "react";
8
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
9
+ import { Metadata as d } from "@box/blueprint-web-assets/icons/Medium";
10
+ import { Pencil as f } from "@box/blueprint-web-assets/icons/Fill";
11
+ var p = (e) => {
12
+ if (!e.ancestors || e.ancestors.length === 0) return;
13
+ let t = e.ancestors.length - 1;
14
+ return e.ancestors.map((e, n) => /* @__PURE__ */ u(s, { children: [n > 0 && /* @__PURE__ */ l(a, {
15
+ "aria-hidden": "true",
16
+ as: "span",
17
+ color: "textOnLightSecondary",
18
+ variant: "caption",
19
+ children: " / "
20
+ }), /* @__PURE__ */ l(a, {
21
+ as: "span",
22
+ color: "textOnLightSecondary",
23
+ variant: n === t ? "captionBold" : "caption",
24
+ children: e.displayName
25
+ })] }, e.fqn));
29
26
  };
30
- function j({
31
- template: o,
32
- variant: n,
33
- onEdit: r
34
- }) {
35
- const {
36
- formatMessage: a
37
- } = g(), {
38
- isDisabled: d
39
- } = y(), l = h((t) => {
40
- t.stopPropagation(), r(o.id);
41
- }, [r, o.id]), s = n === v.Search, e = !!o.canEdit;
42
- return /* @__PURE__ */ i(S, {
43
- id: o.id,
44
- isTrailingSlotHoverOnly: e,
45
- leadingIcon: s ? void 0 : /* @__PURE__ */ i(f, {}),
46
- subtitle: s ? w(o) : void 0,
47
- title: o.displayName,
48
- trailingSlot: e ? (
49
- // onPointerDown stops React Aria from registering a press on the
50
- // GridListItem — without it, the onSelectionChange bridge in
51
- // VirtualizedGridList routes the click through onAction even though
52
- // onClick.stopPropagation() is called (pointer events fire first).
53
- /* @__PURE__ */ i("div", {
54
- onPointerDown: (t) => t.stopPropagation(),
55
- children: /* @__PURE__ */ i(m, {
56
- "aria-label": a(b.editAriaLabel, {
57
- displayName: o.displayName
58
- }),
59
- disabled: d,
60
- icon: p,
61
- onClick: l,
62
- size: "x-small"
63
- })
64
- })
65
- ) : void 0
66
- });
27
+ function m({ template: a, variant: s, onEdit: u }) {
28
+ let { formatMessage: m } = o(), { isDisabled: h } = e(), g = c((e) => {
29
+ e.stopPropagation(), u(a.id);
30
+ }, [u, a.id]), _ = s === t.Search, v = !!a.canEdit;
31
+ return /* @__PURE__ */ l(n, {
32
+ id: a.id,
33
+ isTrailingSlotHoverOnly: v,
34
+ leadingIcon: _ ? void 0 : /* @__PURE__ */ l(d, {}),
35
+ subtitle: _ ? p(a) : void 0,
36
+ title: a.displayName,
37
+ trailingSlot: v ? /* @__PURE__ */ l("div", {
38
+ onPointerDown: (e) => e.stopPropagation(),
39
+ children: /* @__PURE__ */ l(i, {
40
+ "aria-label": m(r.editAriaLabel, { displayName: a.displayName }),
41
+ disabled: h,
42
+ icon: f,
43
+ onClick: g,
44
+ size: "x-small"
45
+ })
46
+ }) : void 0
47
+ });
67
48
  }
68
- export {
69
- j as TemplateRow
70
- };
49
+ export { m as TemplateRow };
@@ -1,49 +1,2 @@
1
- import { useRef as f, useEffect as p } from "react";
2
- import { GridListItem as L } from "react-aria-components";
3
- import { useIntl as A } from "react-intl";
4
- import { LOAD_MORE_SENTINEL_ID as h } from "../../constants.js";
5
- import { messages as E } from "./messages.js";
6
- import { jsx as _ } from "react/jsx-runtime";
7
- import '../../../../styles/grid-list-load-more-sentinel.css';const I = "_sentinel_im31a_1", b = {
8
- sentinel: I
9
- };
10
- function D({
11
- onLoadMore: r,
12
- scrollContainerRef: n
13
- }) {
14
- const s = f(r);
15
- s.current = r;
16
- const {
17
- formatMessage: c
18
- } = A(), m = c(E.loadMoreSentinelAriaLabel);
19
- return p(() => {
20
- const e = n.current;
21
- let t, i = !1;
22
- const o = () => {
23
- if (!e || i)
24
- return;
25
- const {
26
- scrollTop: u,
27
- scrollHeight: d,
28
- clientHeight: a
29
- } = e;
30
- d - u - a <= a && (i = !0, s.current());
31
- }, l = () => {
32
- cancelAnimationFrame(t), t = requestAnimationFrame(o);
33
- };
34
- return e?.addEventListener("scroll", l, {
35
- passive: !0
36
- }), t = requestAnimationFrame(o), () => {
37
- e?.removeEventListener("scroll", l), cancelAnimationFrame(t);
38
- };
39
- }, [n]), /* @__PURE__ */ _(L, {
40
- "aria-hidden": "true",
41
- className: b.sentinel,
42
- id: h,
43
- isDisabled: !0,
44
- textValue: m
45
- });
46
- }
47
- export {
48
- D as GridListLoadMoreSentinel
49
- };
1
+ import { t as e } from "../../../../chunks/grid-list-load-more-sentinel.js";
2
+ export { e as GridListLoadMoreSentinel };
@@ -1,4 +1,2 @@
1
- import { VirtualizedGridList as t } from "./virtualized-grid-list.js";
2
- export {
3
- t as VirtualizedGridList
4
- };
1
+ import { t as e } from "../../../../chunks/virtualized-grid-list.js";
2
+ export { e as VirtualizedGridList };
@@ -1,10 +1,6 @@
1
1
  import { defineMessages as e } from "react-intl";
2
- const r = e({
3
- loadMoreSentinelAriaLabel: {
4
- id: "groupSharedFeatures.metadataTemplateBrowser.virtualizedGridList.loadMoreSentinelAriaLabel",
5
- defaultMessage: "Load more items"
6
- }
7
- });
8
- export {
9
- r as messages
10
- };
2
+ var t = e({ loadMoreSentinelAriaLabel: {
3
+ id: "groupSharedFeatures.metadataTemplateBrowser.virtualizedGridList.loadMoreSentinelAriaLabel",
4
+ defaultMessage: "Load more items"
5
+ } });
6
+ export { t as messages };
@@ -1,66 +1,2 @@
1
- import { useMemo as h, useRef as O, useCallback as f } from "react";
2
- import { ListLayout as T, Virtualizer as w, GridList as C, Collection as M } from "react-aria-components";
3
- import { LOAD_MORE_ERROR_ROW_ID as G } from "../../constants.js";
4
- import { T as H } from "../../../../chunks/types.js";
5
- import { GridListLoadMoreSentinel as A } from "./grid-list-load-more-sentinel.js";
6
- import { jsx as t, jsxs as D } from "react/jsx-runtime";
7
- import { useConsumerState as I } from "../../contexts/hooks.js";
8
- import { LoadMoreLoadingRow as W } from "../load-more-feedback/load-more-loading-row.js";
9
- import { LoadMoreErrorRow as b } from "../load-more-feedback/load-more-error-row.js";
10
- import '../../../../styles/virtualized-grid-list.css';const x = "_list_dukvn_1", V = {
11
- list: x
12
- }, j = 40, k = 58, v = 2;
13
- function Y({
14
- ariaLabel: d,
15
- items: R,
16
- onAction: e,
17
- children: _,
18
- onLoadMore: L,
19
- hasMoreItems: p,
20
- isFetchingMore: l,
21
- loadMoreError: a,
22
- onRetry: i,
23
- selectedKeys: r,
24
- listType: m
25
- }) {
26
- const {
27
- isDisabled: n
28
- } = I(), E = h(() => new T({
29
- estimatedRowHeight: m === H.Browse ? j : k,
30
- gap: v
31
- }), [m]), c = O(null), u = f((o) => {
32
- if (o === G) {
33
- n || i();
34
- return;
35
- }
36
- e(o);
37
- }, [n, e, i]), S = f((o) => {
38
- if (o === "all")
39
- return;
40
- const [s] = o;
41
- s !== void 0 && !r.has(String(s)) && u(s);
42
- }, [u, r]), g = p && !l && a === null && !n;
43
- return /* @__PURE__ */ t(w, {
44
- layout: E,
45
- children: /* @__PURE__ */ D(C, {
46
- ref: c,
47
- "aria-label": d,
48
- className: V.list,
49
- onSelectionChange: S,
50
- selectedKeys: r,
51
- selectionMode: "single",
52
- children: [/* @__PURE__ */ t(M, {
53
- items: R,
54
- children: _
55
- }), l && /* @__PURE__ */ t(W, {}), a !== null && /* @__PURE__ */ t(b, {
56
- onRetry: i
57
- }), g && /* @__PURE__ */ t(A, {
58
- onLoadMore: L,
59
- scrollContainerRef: c
60
- })]
61
- })
62
- });
63
- }
64
- export {
65
- Y as VirtualizedGridList
66
- };
1
+ import { t as e } from "../../../../chunks/virtualized-grid-list.js";
2
+ export { e as VirtualizedGridList };
@@ -1,14 +1,2 @@
1
- const _ = "LOAD_MORE_ERROR_ROW_ID", O = "LOAD_MORE_LOADING_ROW_ID", R = "LOAD_MORE_SENTINEL_ID", E = 200, s = 500, e = {
2
- entries: []
3
- }, D = {
4
- entries: []
5
- };
6
- export {
7
- _ as LOAD_MORE_ERROR_ROW_ID,
8
- O as LOAD_MORE_LOADING_ROW_ID,
9
- R as LOAD_MORE_SENTINEL_ID,
10
- E as PAGE_SIZE,
11
- s as SEARCH_DEBOUNCE_MS,
12
- e as emptyNamespacesResponse,
13
- D as emptyTemplatesResponse
14
- };
1
+ var e = "LOAD_MORE_ERROR_ROW_ID", t = "LOAD_MORE_LOADING_ROW_ID", n = "LOAD_MORE_SENTINEL_ID", r = 200, i = 500, a = { entries: [] }, o = { entries: [] };
2
+ export { e as LOAD_MORE_ERROR_ROW_ID, t as LOAD_MORE_LOADING_ROW_ID, n as LOAD_MORE_SENTINEL_ID, r as PAGE_SIZE, i as SEARCH_DEBOUNCE_MS, a as emptyNamespacesResponse, o as emptyTemplatesResponse };