@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,129 +1,94 @@
1
- import { createContext as i, useMemo as l } from "react";
2
- import { useTemplateBrowserActions as d } from "./use-template-browser-actions.js";
3
- import { jsx as C } from "react/jsx-runtime";
4
- const B = /* @__PURE__ */ i(null);
5
- function H({
6
- children: n,
7
- namespaceFQN: t,
8
- path: o
9
- }) {
10
- const e = l(() => ({
11
- namespaceFQN: t,
12
- path: o
13
- }), [t, o]);
14
- return /* @__PURE__ */ C(B.Provider, {
15
- value: e,
16
- children: n
17
- });
1
+ import { useTemplateBrowserActions as e } from "./use-template-browser-actions.js";
2
+ import { createContext as t, useMemo as n } from "react";
3
+ import { jsx as r } from "react/jsx-runtime";
4
+ var i = /* @__PURE__ */ t(null);
5
+ function a({ children: e, namespaceFQN: t, path: a }) {
6
+ let o = n(() => ({
7
+ namespaceFQN: t,
8
+ path: a
9
+ }), [t, a]);
10
+ return /* @__PURE__ */ r(i.Provider, {
11
+ value: o,
12
+ children: e
13
+ });
18
14
  }
19
- const s = /* @__PURE__ */ i(null);
20
- function J({
21
- children: n,
22
- namespaces: t,
23
- templates: o,
24
- isNamespacesExhausted: e,
25
- namespaceNextMarker: r,
26
- templateNextMarker: u,
27
- isFetching: v,
28
- isFetchingMore: c,
29
- initialLoadError: S,
30
- browseError: P,
31
- loadMoreError: f
32
- }) {
33
- const x = l(() => ({
34
- namespaces: t,
35
- templates: o,
36
- isNamespacesExhausted: e,
37
- namespaceNextMarker: r,
38
- templateNextMarker: u,
39
- isFetching: v,
40
- isFetchingMore: c,
41
- initialLoadError: S,
42
- browseError: P,
43
- loadMoreError: f
44
- }), [t, o, e, r, u, v, c, S, P, f]);
45
- return /* @__PURE__ */ C(s.Provider, {
46
- value: x,
47
- children: n
48
- });
15
+ var o = /* @__PURE__ */ t(null);
16
+ function s({ children: e, namespaces: t, templates: i, isNamespacesExhausted: a, namespaceNextMarker: s, templateNextMarker: c, isFetching: l, isFetchingMore: u, initialLoadError: d, browseError: f, loadMoreError: p }) {
17
+ let m = n(() => ({
18
+ namespaces: t,
19
+ templates: i,
20
+ isNamespacesExhausted: a,
21
+ namespaceNextMarker: s,
22
+ templateNextMarker: c,
23
+ isFetching: l,
24
+ isFetchingMore: u,
25
+ initialLoadError: d,
26
+ browseError: f,
27
+ loadMoreError: p
28
+ }), [
29
+ t,
30
+ i,
31
+ a,
32
+ s,
33
+ c,
34
+ l,
35
+ u,
36
+ d,
37
+ f,
38
+ p
39
+ ]);
40
+ return /* @__PURE__ */ r(o.Provider, {
41
+ value: m,
42
+ children: e
43
+ });
49
44
  }
50
- const w = /* @__PURE__ */ i(null);
51
- function K({
52
- children: n,
53
- searchValue: t,
54
- searchQuery: o,
55
- searchResults: e,
56
- searchNextMarker: r,
57
- isFetchingSearch: u,
58
- searchError: v
59
- }) {
60
- const c = l(() => ({
61
- searchValue: t,
62
- searchQuery: o,
63
- searchResults: e,
64
- searchNextMarker: r,
65
- isFetchingSearch: u,
66
- searchError: v
67
- }), [t, o, e, r, u, v]);
68
- return /* @__PURE__ */ C(w.Provider, {
69
- value: c,
70
- children: n
71
- });
45
+ var c = /* @__PURE__ */ t(null);
46
+ function l({ children: e, searchValue: t, searchQuery: i, searchResults: a, searchNextMarker: o, isFetchingSearch: s, searchError: l }) {
47
+ let u = n(() => ({
48
+ searchValue: t,
49
+ searchQuery: i,
50
+ searchResults: a,
51
+ searchNextMarker: o,
52
+ isFetchingSearch: s,
53
+ searchError: l
54
+ }), [
55
+ t,
56
+ i,
57
+ a,
58
+ o,
59
+ s,
60
+ l
61
+ ]);
62
+ return /* @__PURE__ */ r(c.Provider, {
63
+ value: u,
64
+ children: e
65
+ });
72
66
  }
73
- const m = /* @__PURE__ */ i(null);
74
- function O({
75
- children: n,
76
- selectedTemplateId: t
77
- }) {
78
- const o = l(() => ({
79
- selectedTemplateId: t
80
- }), [t]);
81
- return /* @__PURE__ */ C(m.Provider, {
82
- value: o,
83
- children: n
84
- });
67
+ var u = /* @__PURE__ */ t(null);
68
+ function d({ children: e, selectedTemplateId: t }) {
69
+ let i = n(() => ({ selectedTemplateId: t }), [t]);
70
+ return /* @__PURE__ */ r(u.Provider, {
71
+ value: i,
72
+ children: e
73
+ });
85
74
  }
86
- const A = /* @__PURE__ */ i(null);
87
- function T({
88
- children: n,
89
- isLoading: t = !1,
90
- isDisabled: o = !1
91
- }) {
92
- const e = l(() => ({
93
- isLoading: t,
94
- isDisabled: o
95
- }), [t, o]);
96
- return /* @__PURE__ */ C(A.Provider, {
97
- value: e,
98
- children: n
99
- });
75
+ var f = /* @__PURE__ */ t(null);
76
+ function p({ children: e, isLoading: t = !1, isDisabled: i = !1 }) {
77
+ let a = n(() => ({
78
+ isLoading: t,
79
+ isDisabled: i
80
+ }), [t, i]);
81
+ return /* @__PURE__ */ r(f.Provider, {
82
+ value: a,
83
+ children: e
84
+ });
100
85
  }
101
- const j = /* @__PURE__ */ i(null);
102
- function U({
103
- children: n,
104
- itemsServiceRef: t,
105
- eventServiceRef: o,
106
- stateRef: e,
107
- dispatch: r,
108
- levelCache: u
109
- }) {
110
- const v = d(t, o, e, r, u);
111
- return /* @__PURE__ */ C(j.Provider, {
112
- value: v,
113
- children: n
114
- });
86
+ var m = /* @__PURE__ */ t(null);
87
+ function h({ children: t, itemsServiceRef: n, eventServiceRef: i, stateRef: a, dispatch: o, levelCache: s }) {
88
+ let c = e(n, i, a, o, s);
89
+ return /* @__PURE__ */ r(m.Provider, {
90
+ value: c,
91
+ children: t
92
+ });
115
93
  }
116
- export {
117
- s as BrowseStateContext,
118
- J as BrowseStateContextProvider,
119
- j as BrowserActionsContext,
120
- U as BrowserActionsContextProvider,
121
- A as ConsumerStateContext,
122
- T as ConsumerStateContextProvider,
123
- B as NavigationStateContext,
124
- H as NavigationStateContextProvider,
125
- w as SearchStateContext,
126
- K as SearchStateContextProvider,
127
- m as SelectionStateContext,
128
- O as SelectionStateContextProvider
129
- };
94
+ export { o as BrowseStateContext, s as BrowseStateContextProvider, m as BrowserActionsContext, h as BrowserActionsContextProvider, f as ConsumerStateContext, p as ConsumerStateContextProvider, i as NavigationStateContext, a as NavigationStateContextProvider, c as SearchStateContext, l as SearchStateContextProvider, u as SelectionStateContext, d as SelectionStateContextProvider };
@@ -1,46 +1,33 @@
1
- import { useContext as e } from "react";
2
- import { BrowseStateContext as r, BrowserActionsContext as o, ConsumerStateContext as n, NavigationStateContext as a, SearchStateContext as s, SelectionStateContext as u } from "./contexts.js";
3
- function c() {
4
- const t = e(a);
5
- if (t === null)
6
- throw new Error("useNavigationState must be used within a MetadataTemplateBrowserProvider");
7
- return t;
1
+ import { BrowseStateContext as e, BrowserActionsContext as t, ConsumerStateContext as n, NavigationStateContext as r, SearchStateContext as i, SelectionStateContext as a } from "./contexts.js";
2
+ import { useContext as o } from "react";
3
+ function s() {
4
+ let e = o(r);
5
+ if (e === null) throw Error("useNavigationState must be used within a MetadataTemplateBrowserProvider");
6
+ return e;
8
7
  }
9
- function S() {
10
- const t = e(r);
11
- if (t === null)
12
- throw new Error("useBrowseState must be used within a MetadataTemplateBrowserProvider");
13
- return t;
8
+ function c() {
9
+ let t = o(e);
10
+ if (t === null) throw Error("useBrowseState must be used within a MetadataTemplateBrowserProvider");
11
+ return t;
14
12
  }
15
13
  function l() {
16
- const t = e(s);
17
- if (t === null)
18
- throw new Error("useSearchState must be used within a MetadataTemplateBrowserProvider");
19
- return t;
14
+ let e = o(i);
15
+ if (e === null) throw Error("useSearchState must be used within a MetadataTemplateBrowserProvider");
16
+ return e;
20
17
  }
21
- function m() {
22
- const t = e(u);
23
- if (t === null)
24
- throw new Error("useSelectionState must be used within a MetadataTemplateBrowserProvider");
25
- return t;
18
+ function u() {
19
+ let e = o(a);
20
+ if (e === null) throw Error("useSelectionState must be used within a MetadataTemplateBrowserProvider");
21
+ return e;
26
22
  }
27
23
  function d() {
28
- const t = e(n);
29
- if (t === null)
30
- throw new Error("useConsumerState must be used within a ConsumerStateContextProvider");
31
- return t;
24
+ let e = o(n);
25
+ if (e === null) throw Error("useConsumerState must be used within a ConsumerStateContextProvider");
26
+ return e;
32
27
  }
33
- function h() {
34
- const t = e(o);
35
- if (t === null)
36
- throw new Error("useBrowserActions must be used within a MetadataTemplateBrowserProvider");
37
- return t;
28
+ function f() {
29
+ let e = o(t);
30
+ if (e === null) throw Error("useBrowserActions must be used within a MetadataTemplateBrowserProvider");
31
+ return e;
38
32
  }
39
- export {
40
- S as useBrowseState,
41
- h as useBrowserActions,
42
- d as useConsumerState,
43
- c as useNavigationState,
44
- l as useSearchState,
45
- m as useSelectionState
46
- };
33
+ export { c as useBrowseState, f as useBrowserActions, d as useConsumerState, s as useNavigationState, l as useSearchState, u as useSelectionState };
@@ -1,17 +1,5 @@
1
- import { browserReducer as r, initialState as o } from "./reducer.js";
2
- import { ConsumerStateContext as s, ConsumerStateContextProvider as u } from "./contexts.js";
1
+ import { browserReducer as e, initialState as t } from "./reducer.js";
2
+ import { ConsumerStateContext as n, ConsumerStateContextProvider as r } from "./contexts.js";
3
3
  import { MetadataTemplateBrowserProvider as i } from "./provider.js";
4
- import { useBrowseState as m, useBrowserActions as x, useConsumerState as p, useNavigationState as C, useSearchState as c, useSelectionState as d } from "./hooks.js";
5
- export {
6
- s as ConsumerStateContext,
7
- u as ConsumerStateContextProvider,
8
- i as MetadataTemplateBrowserProvider,
9
- r as browserReducer,
10
- o as initialState,
11
- m as useBrowseState,
12
- x as useBrowserActions,
13
- p as useConsumerState,
14
- C as useNavigationState,
15
- c as useSearchState,
16
- d as useSelectionState
17
- };
4
+ import { useBrowseState as a, useBrowserActions as o, useConsumerState as s, useNavigationState as c, useSearchState as l, useSelectionState as u } from "./hooks.js";
5
+ export { n as ConsumerStateContext, r as ConsumerStateContextProvider, i as MetadataTemplateBrowserProvider, e as browserReducer, t as initialState, a as useBrowseState, o as useBrowserActions, s as useConsumerState, c as useNavigationState, l as useSearchState, u as useSelectionState };
@@ -1,59 +1,51 @@
1
- import { useReducer as m, useRef as t } from "react";
2
- import { NavigationStateContextProvider as u, BrowseStateContextProvider as x, SearchStateContextProvider as M, SelectionStateContextProvider as N, BrowserActionsContextProvider as E } from "./contexts.js";
3
- import { browserReducer as f, initialState as S } from "./reducer.js";
4
- import { jsx as r } from "react/jsx-runtime";
5
- function w({
6
- children: n,
7
- namespaceFQN: h,
8
- itemsService: a,
9
- eventService: s,
10
- initialSelectedTemplateId: l
11
- }) {
12
- const [e, d] = m(f, {
13
- ...S,
14
- namespaceFQN: h,
15
- selectedTemplateId: l ?? null
16
- }), o = t(e);
17
- o.current = e;
18
- const p = t(/* @__PURE__ */ new Map()), c = t(a);
19
- c.current = a;
20
- const i = t(s);
21
- return i.current = s, /* @__PURE__ */ r(u, {
22
- namespaceFQN: e.namespaceFQN,
23
- path: e.path,
24
- children: /* @__PURE__ */ r(x, {
25
- namespaces: e.namespaces,
26
- templates: e.templates,
27
- isNamespacesExhausted: e.isNamespacesExhausted,
28
- namespaceNextMarker: e.namespaceNextMarker,
29
- templateNextMarker: e.templateNextMarker,
30
- isFetching: e.isFetching,
31
- isFetchingMore: e.isFetchingMore,
32
- initialLoadError: e.initialLoadError,
33
- browseError: e.browseError,
34
- loadMoreError: e.loadMoreError,
35
- children: /* @__PURE__ */ r(M, {
36
- searchValue: e.searchValue,
37
- searchQuery: e.searchQuery,
38
- searchResults: e.searchResults,
39
- searchNextMarker: e.searchNextMarker,
40
- isFetchingSearch: e.isFetchingSearch,
41
- searchError: e.searchError,
42
- children: /* @__PURE__ */ r(N, {
43
- selectedTemplateId: e.selectedTemplateId,
44
- children: /* @__PURE__ */ r(E, {
45
- itemsServiceRef: c,
46
- eventServiceRef: i,
47
- stateRef: o,
48
- dispatch: d,
49
- levelCache: p,
50
- children: n
51
- })
52
- })
53
- })
54
- })
55
- });
1
+ import { browserReducer as e, initialState as t } from "./reducer.js";
2
+ import { BrowseStateContextProvider as n, BrowserActionsContextProvider as r, NavigationStateContextProvider as i, SearchStateContextProvider as a, SelectionStateContextProvider as o } from "./contexts.js";
3
+ import { useReducer as s, useRef as c } from "react";
4
+ import { jsx as l } from "react/jsx-runtime";
5
+ function u({ children: u, namespaceFQN: d, itemsService: f, eventService: p, initialSelectedTemplateId: m }) {
6
+ let [h, g] = s(e, {
7
+ ...t,
8
+ namespaceFQN: d,
9
+ selectedTemplateId: m ?? null
10
+ }), _ = c(h);
11
+ _.current = h;
12
+ let v = c(/* @__PURE__ */ new Map()), y = c(f);
13
+ y.current = f;
14
+ let b = c(p);
15
+ return b.current = p, /* @__PURE__ */ l(i, {
16
+ namespaceFQN: h.namespaceFQN,
17
+ path: h.path,
18
+ children: /* @__PURE__ */ l(n, {
19
+ namespaces: h.namespaces,
20
+ templates: h.templates,
21
+ isNamespacesExhausted: h.isNamespacesExhausted,
22
+ namespaceNextMarker: h.namespaceNextMarker,
23
+ templateNextMarker: h.templateNextMarker,
24
+ isFetching: h.isFetching,
25
+ isFetchingMore: h.isFetchingMore,
26
+ initialLoadError: h.initialLoadError,
27
+ browseError: h.browseError,
28
+ loadMoreError: h.loadMoreError,
29
+ children: /* @__PURE__ */ l(a, {
30
+ searchValue: h.searchValue,
31
+ searchQuery: h.searchQuery,
32
+ searchResults: h.searchResults,
33
+ searchNextMarker: h.searchNextMarker,
34
+ isFetchingSearch: h.isFetchingSearch,
35
+ searchError: h.searchError,
36
+ children: /* @__PURE__ */ l(o, {
37
+ selectedTemplateId: h.selectedTemplateId,
38
+ children: /* @__PURE__ */ l(r, {
39
+ itemsServiceRef: y,
40
+ eventServiceRef: b,
41
+ stateRef: _,
42
+ dispatch: g,
43
+ levelCache: v,
44
+ children: u
45
+ })
46
+ })
47
+ })
48
+ })
49
+ });
56
50
  }
57
- export {
58
- w as MetadataTemplateBrowserProvider
59
- };
51
+ export { u as MetadataTemplateBrowserProvider };