@devgateway/dvz-ui-react 1.5.4 → 1.6.1

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 (70) hide show
  1. package/dist/cjs/common.css +1 -1
  2. package/dist/cjs/embeddable/chart/Bar.js +1 -1
  3. package/dist/cjs/embeddable/chart/Line.js +1 -1
  4. package/dist/cjs/embeddable/chart/Pie.js +1 -1
  5. package/dist/cjs/embeddable/chart/colors/ManualColors.js +1 -1
  6. package/dist/cjs/embeddable/chart/data/Bar.js +1 -1
  7. package/dist/cjs/embeddable/chart/index.js +1 -1
  8. package/dist/cjs/embeddable/common/colors/ManualColors.js +1 -1
  9. package/dist/cjs/embeddable/d3Map/BaseLayer.js +1 -1
  10. package/dist/cjs/embeddable/d3Map/DataLayer.js +1 -1
  11. package/dist/cjs/embeddable/filtered-posts/NoData.js +2 -2
  12. package/dist/cjs/embeddable/filtered-posts/index.js +1 -1
  13. package/dist/cjs/embeddable/filtered-posts/utils.js +1 -1
  14. package/dist/cjs/embeddable/posts-filter/CategoricalFilter.js +1 -0
  15. package/dist/cjs/embeddable/posts-filter/PostsFilterDropdown.js +1 -1
  16. package/dist/cjs/embeddable/posts-filter/YearFilter.js +1 -0
  17. package/dist/cjs/embeddable/posts-filter/index.js +1 -1
  18. package/dist/cjs/embeddable/posts-filters-reset-button/index.js +1 -1
  19. package/dist/cjs/embeddable/posts-pagination/index.js +1 -1
  20. package/dist/cjs/embeddable/reducers/data-api.js +1 -1
  21. package/dist/cjs/embeddable/reducers/data.js +1 -1
  22. package/dist/cjs/embeddable/reducers/embeddable-api.js +1 -1
  23. package/dist/cjs/embeddable/time-line/mobile.js +1 -1
  24. package/dist/cjs/embeddable/vertical-featuredtabs/index.js +2 -2
  25. package/dist/cjs/index.js +1 -1
  26. package/dist/cjs/layout/Layout.js +1 -1
  27. package/dist/cjs/styles.css +1 -1
  28. package/dist/esm/common.css +1 -1
  29. package/dist/esm/embeddable/chart/Bar.js +253 -235
  30. package/dist/esm/embeddable/chart/Line.js +122 -121
  31. package/dist/esm/embeddable/chart/Pie.js +82 -81
  32. package/dist/esm/embeddable/chart/colors/ManualColors.js +33 -33
  33. package/dist/esm/embeddable/chart/data/Bar.js +18 -16
  34. package/dist/esm/embeddable/chart/index.js +298 -286
  35. package/dist/esm/embeddable/common/colors/ManualColors.js +22 -22
  36. package/dist/esm/embeddable/d3Map/BaseLayer.js +4 -1
  37. package/dist/esm/embeddable/d3Map/DataLayer.js +5 -1
  38. package/dist/esm/embeddable/filtered-posts/NoData.js +25 -18
  39. package/dist/esm/embeddable/filtered-posts/index.js +136 -92
  40. package/dist/esm/embeddable/filtered-posts/utils.js +3 -2
  41. package/dist/esm/embeddable/posts-filter/CategoricalFilter.js +72 -0
  42. package/dist/esm/embeddable/posts-filter/PostsFilterDropdown.js +106 -92
  43. package/dist/esm/embeddable/posts-filter/YearFilter.js +60 -0
  44. package/dist/esm/embeddable/posts-filter/index.js +160 -191
  45. package/dist/esm/embeddable/posts-filters-reset-button/index.js +21 -15
  46. package/dist/esm/embeddable/posts-pagination/index.js +36 -33
  47. package/dist/esm/embeddable/reducers/data-api.js +35 -35
  48. package/dist/esm/embeddable/reducers/data.js +116 -107
  49. package/dist/esm/embeddable/reducers/embeddable-api.js +8 -8
  50. package/dist/esm/embeddable/time-line/mobile.js +119 -118
  51. package/dist/esm/embeddable/vertical-featuredtabs/index.js +202 -131
  52. package/dist/esm/index.js +66 -64
  53. package/dist/esm/layout/Layout.js +8 -6
  54. package/dist/esm/styles.css +1 -1
  55. package/dist/types/dvz-ui/src/embeddable/chart/colors/ManualColors.d.ts +1 -1
  56. package/dist/types/dvz-ui/src/embeddable/filtered-posts/NoData.d.ts +1 -0
  57. package/dist/types/dvz-ui/src/embeddable/filtered-posts/index.d.ts +2 -1
  58. package/dist/types/dvz-ui/src/embeddable/filtered-posts/utils.d.ts +3 -0
  59. package/dist/types/dvz-ui/src/embeddable/posts-filter/CategoricalFilter.d.ts +9 -0
  60. package/dist/types/dvz-ui/src/embeddable/posts-filter/PostsFilterDropdown.d.ts +1 -0
  61. package/dist/types/dvz-ui/src/embeddable/posts-filter/YearFilter.d.ts +12 -0
  62. package/dist/types/dvz-ui/src/embeddable/posts-filter/index.d.ts +2 -0
  63. package/dist/types/dvz-ui/src/embeddable/reducers/data-api.d.ts +3 -1
  64. package/dist/types/dvz-ui/src/embeddable/reducers/data.d.ts +5 -0
  65. package/dist/types/dvz-ui/src/embeddable/time-line/mobile.d.ts +2 -1
  66. package/dist/types/dvz-ui/src/translations/af.json.d.ts +1 -2
  67. package/dist/types/dvz-ui/src/translations/am.json.d.ts +35 -35
  68. package/dist/types/dvz-ui/src/translations/index.d.ts +2 -1
  69. package/dist/types/dvz-ui/src/utils/data.d.ts +2 -0
  70. package/package.json +3 -2
@@ -1,125 +1,197 @@
1
- import { jsx as r, jsxs as x } from "react/jsx-runtime";
2
- import V, { useState as S, useEffect as L, useRef as O, useLayoutEffect as K } from "react";
3
- import { Container as q, Accordion as j, Icon as U } from "semantic-ui-react";
4
- import { PostProvider as X, PostConsumer as J, MediaProvider as Y, MediaConsumer as G, PostIcon as Q, PostContent as F } from "@devgateway/wp-react-lib";
5
- import { connect as Z } from "react-redux";
1
+ import { jsx as r, jsxs as S } from "react/jsx-runtime";
2
+ import K, { useState as M, useEffect as L, useRef as q, useLayoutEffect as U } from "react";
3
+ import { Container as F, Accordion as j, Icon as X } from "semantic-ui-react";
4
+ import { PostProvider as J, PostConsumer as Y, MediaProvider as G, MediaConsumer as Q, PostIcon as Z, PostContent as O } from "@devgateway/wp-react-lib";
5
+ import { connect as ee } from "react-redux";
6
6
  import H from "../connected-templates/PostIntro.js";
7
- const ee = ({ posts: i, activeItem: d, setActive: g, colors: p }) => {
8
- const [u, f] = S(i.findIndex((o) => o.slug === d)), [c, w] = S(null), l = (o, n, s) => {
9
- document.querySelectorAll(o).forEach((t) => {
10
- t.querySelector(n) && t.classList.add(s);
7
+ const te = ({
8
+ posts: i,
9
+ activeItem: d,
10
+ setActive: p,
11
+ colors: g
12
+ }) => {
13
+ const [m, f] = M(
14
+ i.findIndex((n) => n.slug === d)
15
+ ), [c, w] = M(null), l = (n, o, s) => {
16
+ document.querySelectorAll(n).forEach((t) => {
17
+ t.querySelector(o) && t.classList.add(s);
11
18
  });
12
19
  };
13
20
  L(() => {
14
21
  if (c) {
15
- const o = c.getBoundingClientRect().top + window.scrollY;
22
+ const n = c.getBoundingClientRect().top + window.scrollY;
16
23
  window.scrollTo({
17
- top: o,
24
+ top: n,
18
25
  behavior: "smooth"
19
26
  });
20
27
  }
21
- l(".ui.fluid.container.viz.featured.tabs", ".accordion", "has-accordion"), l(".ui.fluid.container.viz.featured.tabs", "blockquote", "has-blockquote"), l(".ui.fluid.container.viz.featured.tabs", ".accordion .accordion-post-ft-title", "has-accordion-title"), l(".ui.fluid.container.viz.featured.tabs", ".accordion .accordion-post-vft-content", "has-accordion-content"), l(".ui.fluid.container.viz.featured.tabs", ".vt-accordion-post-intro figure", "has-vt-accordion-figure"), l(".ui.fluid.container.viz.featured.tabs", ".content.active.accordion-post-content .wp-block-columns", "has-wp-block-columns");
28
+ l(
29
+ ".ui.fluid.container.viz.featured.tabs",
30
+ ".accordion",
31
+ "has-accordion"
32
+ ), l(
33
+ ".ui.fluid.container.viz.featured.tabs",
34
+ "blockquote",
35
+ "has-blockquote"
36
+ ), l(
37
+ ".ui.fluid.container.viz.featured.tabs",
38
+ ".accordion .accordion-post-ft-title",
39
+ "has-accordion-title"
40
+ ), l(
41
+ ".ui.fluid.container.viz.featured.tabs",
42
+ ".accordion .accordion-post-vft-content",
43
+ "has-accordion-content"
44
+ ), l(
45
+ ".ui.fluid.container.viz.featured.tabs",
46
+ ".vt-accordion-post-intro figure",
47
+ "has-vt-accordion-figure"
48
+ ), l(
49
+ ".ui.fluid.container.viz.featured.tabs",
50
+ ".content.active.accordion-post-content .wp-block-columns",
51
+ "has-wp-block-columns"
52
+ );
22
53
  }, [c]), L(() => {
23
- let o;
24
- const n = [], s = (e) => {
54
+ let n;
55
+ const o = [], s = (e) => {
25
56
  setTimeout(() => {
26
57
  var h;
27
58
  const t = e.querySelectorAll(
28
- ".accordion .legends.container.has-standard-12-font-size.bottom, .legends.container.items-section"
59
+ ".accordion .legends.container.has-standard-12-font-size.bottom, .legends.container.items-section:not(.legends.container.top .items-section)"
29
60
  );
30
61
  if (t.length !== 0)
31
- for (const m of t) {
32
- const I = m.closest(".ui.fluid.container.content"), v = I ? I.querySelector(".data-source") : null;
33
- if (!v || m.offsetParent === null || v.offsetParent === null || m.offsetHeight === 0 || v.offsetHeight === 0)
62
+ for (const u of t) {
63
+ if (u.closest(".legends.container.top"))
64
+ continue;
65
+ const P = u.closest(
66
+ ".ui.fluid.container.content"
67
+ ), v = P ? P.querySelector(".data-source") : null;
68
+ if (!v || u.offsetParent === null || v.offsetParent === null || u.offsetHeight === 0 || v.offsetHeight === 0)
69
+ continue;
70
+ const A = v.getBoundingClientRect(), y = u.getBoundingClientRect();
71
+ if (y.top === 0 || y.bottom === 0 || A.top === 0 || Math.abs(y.top) > 1e4 || Math.abs(A.top) > 1e4)
34
72
  continue;
35
- const k = v.getBoundingClientRect(), P = m.getBoundingClientRect(), B = window.getComputedStyle(v), y = window.getComputedStyle(m), _ = parseFloat(B.marginTop) || 0, N = parseFloat(y.marginBottom) || 0, A = P.bottom + N, R = k.top - _;
36
- if (A > R) {
37
- const a = A - R;
73
+ const B = window.getComputedStyle(v), T = window.getComputedStyle(u), _ = parseFloat(B.marginTop) || 0, $ = parseFloat(T.marginBottom) || 0, E = y.bottom + $, R = A.top - _;
74
+ if (E > R) {
75
+ const a = E - R;
38
76
  v.style.marginTop = `${a + 20}px`;
39
77
  }
40
- const T = (h = m.closest(
78
+ const x = (h = u.closest(
41
79
  ".wp-block-column.is-layout-flow.wp-block-column-is-layout-flow"
42
80
  )) == null ? void 0 : h.nextElementSibling;
43
- if (T) {
44
- const a = T.getBoundingClientRect(), b = window.getComputedStyle(T), E = Number.parseFloat(b.marginTop) || 0, $ = a.top - E;
45
- if (A > $) {
46
- const z = A - $;
47
- T.style.marginTop = `${z + 20}px`;
81
+ if (x) {
82
+ const a = x.getBoundingClientRect(), b = window.getComputedStyle(x), N = Number.parseFloat(b.marginTop) || 0, k = a.top - N;
83
+ if (E > k) {
84
+ const z = E - k;
85
+ x.style.marginTop = `${z + 20}px`;
48
86
  }
49
87
  }
50
- const M = m.closest(".chart.container");
51
- if (M) {
52
- const a = M.getBoundingClientRect(), b = window.getComputedStyle(M), E = Number.parseFloat(b.marginBottom) || 0, $ = a.bottom + E, z = Number.parseFloat(y.marginTop) || 0, D = P.top - z;
53
- if (D < $) {
54
- const W = $ - D;
55
- m.style.marginTop = `${W + 20}px`;
88
+ const I = u.closest(".chart.container");
89
+ if (I) {
90
+ const a = I.getBoundingClientRect(), b = window.getComputedStyle(I), N = Number.parseFloat(b.marginBottom) || 0, k = a.bottom + N, z = Number.parseFloat(T.marginTop) || 0, D = y.top - z;
91
+ if (D < k) {
92
+ const W = k - D, V = Math.min(W + 20, 200);
93
+ u.style.marginTop = `${V}px`;
56
94
  }
57
95
  }
58
96
  }
59
- }, 10);
97
+ }, 150);
60
98
  };
61
- return u !== -1 && (o = setTimeout(() => {
99
+ return m !== -1 && (n = setTimeout(() => {
62
100
  document.querySelectorAll(".accordion").forEach((t) => s(t));
63
101
  }, 0)), () => {
64
- clearTimeout(o), n.forEach((e) => e.disconnect());
102
+ clearTimeout(n), o.forEach((e) => e.disconnect());
65
103
  };
66
- }, [u]);
67
- const C = (o, n) => {
68
- const { index: s } = n, e = u === s ? -1 : s;
69
- f(e), g(i[s].slug), e !== -1 && w(o.currentTarget);
104
+ }, [m]);
105
+ const C = (n, o) => {
106
+ const { index: s } = o, e = m === s ? -1 : s;
107
+ f(e), p(i[s].slug), e !== -1 && w(n.currentTarget);
70
108
  };
71
- return /* @__PURE__ */ r(j, { fluid: !0, styled: !0, children: i.map((o, n) => {
109
+ return /* @__PURE__ */ r(j, { fluid: !0, styled: !0, children: i.map((n, o) => {
72
110
  var e;
73
- const s = (e = o.meta_fields) != null && e.icon ? o.meta_fields.icon[0] : null;
74
- return /* @__PURE__ */ x(V.Fragment, { children: [
111
+ const s = (e = n.meta_fields) != null && e.icon ? n.meta_fields.icon[0] : null;
112
+ return /* @__PURE__ */ S(K.Fragment, { children: [
75
113
  /* @__PURE__ */ r(
76
114
  j.Title,
77
115
  {
78
- active: u === n,
79
- index: n,
80
- onClick: (t) => C(t, { index: n }),
81
- style: { backgroundColor: p[`color_${n}`] },
82
- children: /* @__PURE__ */ x("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", width: "100%" }, children: [
83
- /* @__PURE__ */ x("div", { style: { display: "flex", alignItems: "center" }, children: [
84
- s && /* @__PURE__ */ r(Y, { id: s, children: /* @__PURE__ */ r(G, { children: /* @__PURE__ */ r(Q, { className: "icon" }) }) }),
85
- /* @__PURE__ */ r(H, { post: o, className: "vt-accordion-post-intro" })
86
- ] }),
87
- /* @__PURE__ */ r(U, { name: "chevron down" })
88
- ] })
116
+ active: m === o,
117
+ index: o,
118
+ onClick: (t) => C(t, { index: o }),
119
+ style: { backgroundColor: g[`color_${o}`] },
120
+ children: /* @__PURE__ */ S(
121
+ "div",
122
+ {
123
+ style: {
124
+ display: "flex",
125
+ alignItems: "center",
126
+ justifyContent: "space-between",
127
+ width: "100%"
128
+ },
129
+ children: [
130
+ /* @__PURE__ */ S("div", { style: { display: "flex", alignItems: "center" }, children: [
131
+ s && /* @__PURE__ */ r(G, { id: s, children: /* @__PURE__ */ r(Q, { children: /* @__PURE__ */ r(Z, { className: "icon" }) }) }),
132
+ /* @__PURE__ */ r(H, { post: n, className: "vt-accordion-post-intro" })
133
+ ] }),
134
+ /* @__PURE__ */ r(X, { name: "chevron down" })
135
+ ]
136
+ }
137
+ )
89
138
  }
90
139
  ),
91
- /* @__PURE__ */ r(j.Content, { className: "accordion-post-content accordion-post-vft-content", active: u === n, children: /* @__PURE__ */ r(F, { post: o }) })
92
- ] }, o.id);
140
+ /* @__PURE__ */ r(
141
+ j.Content,
142
+ {
143
+ className: "accordion-post-content accordion-post-vft-content",
144
+ active: m === o,
145
+ children: /* @__PURE__ */ r(O, { post: n })
146
+ }
147
+ )
148
+ ] }, n.id);
93
149
  }) });
94
- }, te = ({
150
+ }, ne = ({
95
151
  post: i,
96
152
  count: d,
97
- backgroundColor: g,
98
- active: p,
99
- dimensions: u,
153
+ backgroundColor: p,
154
+ active: g,
155
+ dimensions: m,
100
156
  height: f,
101
157
  coverWidth: c,
102
158
  index: w,
103
159
  editing: l,
104
160
  clickToExpandLabel: C
105
161
  }) => {
106
- const o = i._embedded ? i._embedded["wp:featuredmedia"] : null, [n, s] = S(!1), e = l ? d - w : 1;
107
- return /* @__PURE__ */ x("div", { className: "content-area", children: [
108
- /* @__PURE__ */ x(
162
+ const n = i._embedded ? i._embedded["wp:featuredmedia"] : null, [o, s] = M(!1), e = l ? d - w : 1;
163
+ return /* @__PURE__ */ S("div", { className: "content-area", children: [
164
+ /* @__PURE__ */ S(
109
165
  "div",
110
166
  {
111
167
  className: "cover",
112
168
  style: {
113
169
  width: `${c}px`,
114
- backgroundColor: g,
115
- backgroundImage: `url(${o ? o[0].source_url : ""})`
170
+ backgroundColor: p,
171
+ backgroundImage: `url(${n ? n[0].source_url : ""})`
116
172
  },
117
173
  onMouseEnter: () => s(!0),
118
174
  onMouseLeave: () => s(!1),
119
175
  children: [
120
- /* @__PURE__ */ r("div", { className: "rotator", style: { width: `${f}px`, transform: `translate(${c / 2}px, 0px) rotate(90deg)` }, children: /* @__PURE__ */ r(H, { post: i }) }),
121
- /* @__PURE__ */ x("div", { className: "overlay-label-container", children: [
122
- /* @__PURE__ */ r("div", { className: `overlay-label ${n && !p ? "visible" : ""}`, children: C || "CLICK TO EXPAND" }),
176
+ /* @__PURE__ */ r(
177
+ "div",
178
+ {
179
+ className: "rotator",
180
+ style: {
181
+ width: `${f}px`,
182
+ transform: `translate(${c / 2}px, 0px) rotate(90deg)`
183
+ },
184
+ children: /* @__PURE__ */ r(H, { post: i })
185
+ }
186
+ ),
187
+ /* @__PURE__ */ S("div", { className: "overlay-label-container", children: [
188
+ /* @__PURE__ */ r(
189
+ "div",
190
+ {
191
+ className: `overlay-label ${o && !g ? "visible" : ""}`,
192
+ children: C || "CLICK TO EXPAND"
193
+ }
194
+ ),
123
195
  /* @__PURE__ */ r("div", { className: "arrow-svg" })
124
196
  ] })
125
197
  ]
@@ -128,62 +200,62 @@ const ee = ({ posts: i, activeItem: d, setActive: g, colors: p }) => {
128
200
  /* @__PURE__ */ r(
129
201
  "div",
130
202
  {
131
- className: `collapsable-content ${p ? "expanded" : "collapsed"}`,
203
+ className: `collapsable-content ${g ? "expanded" : "collapsed"}`,
132
204
  style: {
133
205
  backgroundColor: "#f9f9f9",
134
- width: `${u.width - c * d}px`,
206
+ width: `${m.width - c * d}px`,
135
207
  marginLeft: `${c * e}px`
136
208
  },
137
- children: /* @__PURE__ */ r(F, { post: i })
209
+ children: /* @__PURE__ */ r(O, { post: i })
138
210
  }
139
211
  )
140
212
  ] });
141
213
  }, oe = ({
142
214
  editing: i,
143
215
  posts: d,
144
- height: g,
145
- colors: p,
146
- coverWidth: u,
216
+ height: p,
217
+ colors: g,
218
+ coverWidth: m,
147
219
  clickToExpandLabel: f
148
220
  }) => {
149
- const [c, w] = S(null), l = O(null), [C, o] = S({ width: 0, height: 0 }), n = O(null), s = (e) => {
221
+ const [c, w] = M(null), l = q(null), [C, n] = M({ width: 0, height: 0 }), o = q(null), s = (e) => {
150
222
  c !== e && w(e);
151
223
  };
152
224
  return L(() => {
153
225
  d.length > 0 && c === null && i && w(d[0].slug);
154
- }, [d, c, i]), K(() => {
155
- var e, t, h, m;
156
- (e = l.current) != null && e.parentElement && o({
157
- width: i ? ((h = (t = l.current.parentElement) == null ? void 0 : t.parentElement) == null ? void 0 : h.offsetWidth) ?? 0 : ((m = l.current.parentElement) == null ? void 0 : m.offsetWidth) ?? 0,
226
+ }, [d, c, i]), U(() => {
227
+ var e, t, h, u;
228
+ (e = l.current) != null && e.parentElement && n({
229
+ width: i ? ((h = (t = l.current.parentElement) == null ? void 0 : t.parentElement) == null ? void 0 : h.offsetWidth) ?? 0 : ((u = l.current.parentElement) == null ? void 0 : u.offsetWidth) ?? 0,
158
230
  height: l.current.offsetHeight
159
- }), n.current && (n.current.style.overflow = i ? "visible" : "hidden");
231
+ }), o.current && (o.current.style.overflow = i ? "visible" : "hidden");
160
232
  }, [i]), /* @__PURE__ */ r(
161
- q,
233
+ F,
162
234
  {
163
235
  fluid: !0,
164
236
  className: "vertical featured tabs",
165
- ref: n,
237
+ ref: o,
166
238
  children: d == null ? void 0 : d.map((e, t) => {
167
239
  const h = c ? e.slug === c : t === 0;
168
- return /* @__PURE__ */ x(
240
+ return /* @__PURE__ */ S(
169
241
  "div",
170
242
  {
171
243
  ref: l,
172
244
  onClick: () => s(e.slug),
173
245
  className: h ? "item expanded" : "item collapsed",
174
246
  style: {
175
- minHeight: `${g}px`,
176
- minWidth: `${u}px`
247
+ minHeight: `${p}px`,
248
+ minWidth: `${m}px`
177
249
  },
178
250
  children: [
179
251
  /* @__PURE__ */ r("a", { id: e.slug }),
180
252
  /* @__PURE__ */ r(
181
- te,
253
+ ne,
182
254
  {
183
255
  editing: i,
184
- coverWidth: u,
185
- height: g,
186
- backgroundColor: p[`color_${t}`],
256
+ coverWidth: m,
257
+ height: p,
258
+ backgroundColor: g[`color_${t}`],
187
259
  count: d.length,
188
260
  dimensions: C,
189
261
  active: h,
@@ -199,46 +271,48 @@ const ee = ({ posts: i, activeItem: d, setActive: g, colors: p }) => {
199
271
  })
200
272
  }
201
273
  );
202
- }, ne = (i) => {
203
- var T, M;
274
+ }, re = (i) => {
275
+ var x, I;
204
276
  let {
205
277
  "data-height": d,
206
- "data-type": g,
207
- "data-taxonomy": p,
208
- "data-categories": u,
278
+ "data-type": p,
279
+ "data-taxonomy": g,
280
+ "data-categories": m,
209
281
  "data-count": f,
210
282
  "data-colors": c,
211
283
  "data-cover-width": w = 50,
212
284
  "data-read-more-label": l = "READ More",
213
285
  "data-click-to-expand-label": C = "CLICK TO EXPAND",
214
- "data-preview-mode": o = "Desktop",
215
- editing: n,
286
+ "data-preview-mode": n = "Desktop",
287
+ editing: o,
216
288
  parent: s,
217
289
  unique: e,
218
290
  pageModuleProps: t
219
291
  } = i;
220
- t != null && t.previewMode && (t != null && t.editing) && (o = t.previewMode, n = t.editing);
221
- const h = i.intl.locale, m = u || "[]", [I, v] = S((((T = window == null ? void 0 : window.visualViewport) == null ? void 0 : T.width) || window.innerWidth) <= 1365);
222
- console.log("isMobileOrTablet:", I);
223
- const k = () => {
224
- var a, b, E;
225
- return ((a = window.screen.orientation) == null ? void 0 : a.type) || ((((b = window == null ? void 0 : window.visualViewport) == null ? void 0 : b.width) || window.innerWidth) > (((E = window == null ? void 0 : window.visualViewport) == null ? void 0 : E.height) || window.innerHeight) ? "landscape-primary" : "portrait-primary");
226
- }, [P, B] = S(k()), y = () => {
292
+ t != null && t.previewMode && (t != null && t.editing) && (n = t.previewMode, o = t.editing);
293
+ const h = i.intl.locale, u = m || "[]", [P, v] = M(
294
+ (((x = window == null ? void 0 : window.visualViewport) == null ? void 0 : x.width) || window.innerWidth) <= 1365
295
+ ), A = () => {
296
+ var a, b, N;
297
+ return ((a = window.screen.orientation) == null ? void 0 : a.type) || ((((b = window == null ? void 0 : window.visualViewport) == null ? void 0 : b.width) || window.innerWidth) > (((N = window == null ? void 0 : window.visualViewport) == null ? void 0 : N.height) || window.innerHeight) ? "landscape-primary" : "portrait-primary");
298
+ }, [y, B] = M(A()), T = () => {
227
299
  setTimeout(() => {
228
300
  var a;
229
- B(k()), v((((a = window == null ? void 0 : window.visualViewport) == null ? void 0 : a.width) || window.innerWidth) <= 1365);
301
+ B(A()), v(
302
+ (((a = window == null ? void 0 : window.visualViewport) == null ? void 0 : a.width) || window.innerWidth) <= 1365
303
+ );
230
304
  }, 100);
231
305
  };
232
306
  L(() => (window.screen.orientation && window.screen.orientation.addEventListener(
233
307
  "change",
234
- y
235
- ), window.addEventListener("resize", y), () => {
236
- window.removeEventListener("resize", y), window.screen.orientation && window.screen.orientation.removeEventListener(
308
+ T
309
+ ), window.addEventListener("resize", T), () => {
310
+ window.removeEventListener("resize", T), window.screen.orientation && window.screen.orientation.removeEventListener(
237
311
  "change",
238
- y
312
+ T
239
313
  );
240
314
  }), []);
241
- const _ = (a) => n ? a : decodeURIComponent(a), N = (a) => {
315
+ const _ = (a) => o ? a : decodeURIComponent(a), $ = (a) => {
242
316
  if (!a) return null;
243
317
  try {
244
318
  return JSON.parse(_(a));
@@ -247,40 +321,40 @@ const ee = ({ posts: i, activeItem: d, setActive: g, colors: p }) => {
247
321
  error:${b}`);
248
322
  }
249
323
  return null;
250
- }, A = o !== "Desktop" && n, R = I && !n;
324
+ }, E = n !== "Desktop" && o, R = P && !o;
251
325
  return /* @__PURE__ */ r(
252
- q,
326
+ F,
253
327
  {
254
328
  style: { maxWidth: "100%" },
255
- className: `viz featured tabs ${n ? "editing" : ""}`,
329
+ className: `viz featured tabs ${o ? "editing" : ""}`,
256
330
  fluid: !0,
257
331
  children: /* @__PURE__ */ r(
258
- X,
332
+ J,
259
333
  {
260
- type: g,
334
+ type: p,
261
335
  locale: h,
262
- taxonomy: p,
263
- categories: N(m),
336
+ taxonomy: g,
337
+ categories: $(u),
264
338
  store: `vertical_tabs${s}_${e}`,
265
339
  page: 1,
266
340
  perPage: f,
267
- children: /* @__PURE__ */ r(J, { children: R || A ? /* @__PURE__ */ r(
268
- ee,
341
+ children: /* @__PURE__ */ r(Y, { children: R || E ? /* @__PURE__ */ r(
342
+ te,
269
343
  {
270
344
  posts: f,
271
- activeItem: (M = f == null ? void 0 : f[0]) == null ? void 0 : M.slug,
272
- colors: N(c),
345
+ activeItem: (I = f == null ? void 0 : f[0]) == null ? void 0 : I.slug,
346
+ colors: $(c),
273
347
  setActive: () => {
274
348
  }
275
349
  }
276
350
  ) : /* @__PURE__ */ r(
277
351
  oe,
278
352
  {
279
- editing: n,
353
+ editing: o,
280
354
  coverWidth: w,
281
355
  moreLabel: l,
282
356
  clickToExpandLabel: C,
283
- colors: N(c),
357
+ colors: $(c),
284
358
  height: d,
285
359
  posts: f
286
360
  }
@@ -288,15 +362,12 @@ const ee = ({ posts: i, activeItem: d, setActive: g, colors: p }) => {
288
362
  }
289
363
  )
290
364
  },
291
- P + Math.random()
365
+ y + Math.random()
292
366
  );
293
- }, re = (i, d) => {
294
- const g = i.getIn([
295
- "data",
296
- "pageModuleProps"
297
- ]), p = {};
298
- return g && (p.pageModuleProps = g), p;
299
- }, ie = {}, me = Z(re, ie)(ne);
367
+ }, ie = (i, d) => {
368
+ const p = i.getIn(["data", "pageModuleProps"]), g = {};
369
+ return p && (g.pageModuleProps = p), g;
370
+ }, ae = {}, pe = ee(ie, ae)(re);
300
371
  export {
301
- me as default
372
+ pe as default
302
373
  };
package/dist/esm/index.js CHANGED
@@ -1,75 +1,77 @@
1
- import { components as f, customizer as p, getComponentByNameIgnoreCase as s, reducers as m } from "./embeddable/index.js";
1
+ import { components as s, customizer as p, getComponentByNameIgnoreCase as m, reducers as n } from "./embeddable/index.js";
2
2
  import { Config as l } from "./conf/index.js";
3
3
  import { default as u } from "./layout/ResponsiveContainer.js";
4
- import { default as d } from "./layout/ScrollTop.js";
5
- import { default as C } from "./layout/containers/PreviewPageContainer.js";
4
+ import { default as c } from "./layout/ScrollTop.js";
5
+ import { default as S } from "./layout/containers/PreviewPageContainer.js";
6
6
  import { default as g } from "./layout/containers/PreviewTypeContainer.js";
7
- import { default as P } from "./layout/containers/SlugContainer.js";
8
- import { default as h } from "./layout/containers/SlugPostContainer.js";
9
- import { CustomizerWrapper as w } from "./layout/Customizer.js";
10
- import { default as I } from "./layout/Layout.js";
11
- import { default as A } from "./layout/PreviewComponent.js";
12
- import { default as H } from "./layout/Favicon.js";
13
- import { default as N } from "./layout/SSRFavicon.js";
14
- import { default as k } from "./layout/Loading.js";
15
- import { default as U } from "./layout/CustomSemanticSearch.js";
16
- import { default as b } from "./layout/Header.js";
17
- import { default as E } from "./layout/SearchControl.js";
18
- import { default as Y } from "./layout/LangSwitcher.js";
19
- import { default as j } from "./layout/Footer.js";
20
- import { default as G } from "./layout/ClassicHeader.js";
21
- import { default as K } from "./layout/FlexWrapDetector.js";
22
- import { default as V } from "./layout/FloatingMenuHeader.js";
23
- import { withTracker as Z } from "./tracker/withGoogleAnalytics.js";
24
- import { store as ee } from "./redux/store.js";
25
- import { useAppDispatch as oe, useAppSelector as te } from "./redux/hooks.js";
26
- import { UPDATE as fe, initialState as pe, intlReducer as se, updateIntl as me } from "./lib/react-intl-redux/index.js";
27
- import { combineReducers as le } from "./lib/redux-immutable/index.js";
28
- import * as e from "./translations/en.json.js";
29
- import * as r from "./translations/fr.json.js";
7
+ import { default as h } from "./layout/containers/SlugContainer.js";
8
+ import { default as R } from "./layout/containers/SlugPostContainer.js";
9
+ import { CustomizerWrapper as F } from "./layout/Customizer.js";
10
+ import { default as y } from "./layout/Layout.js";
11
+ import { default as D } from "./layout/PreviewComponent.js";
12
+ import { default as L } from "./layout/Favicon.js";
13
+ import { default as O } from "./layout/SSRFavicon.js";
14
+ import { default as z } from "./layout/Loading.js";
15
+ import { default as W } from "./layout/CustomSemanticSearch.js";
16
+ import { default as B } from "./layout/Header.js";
17
+ import { default as M } from "./layout/SearchControl.js";
18
+ import { default as _ } from "./layout/LangSwitcher.js";
19
+ import { default as q } from "./layout/Footer.js";
20
+ import { default as J } from "./layout/ClassicHeader.js";
21
+ import { default as Q } from "./layout/FlexWrapDetector.js";
22
+ import { default as X } from "./layout/FloatingMenuHeader.js";
23
+ import { withTracker as $ } from "./tracker/withGoogleAnalytics.js";
24
+ import { store as er } from "./redux/store.js";
25
+ import { useAppDispatch as tr, useAppSelector as ar } from "./redux/hooks.js";
26
+ import { UPDATE as sr, initialState as pr, intlReducer as mr, updateIntl as nr } from "./lib/react-intl-redux/index.js";
27
+ import { combineReducers as lr } from "./lib/redux-immutable/index.js";
28
+ import * as r from "./translations/en.json.js";
29
+ import * as e from "./translations/fr.json.js";
30
30
  import * as o from "./translations/af.json.js";
31
- import { COUNTRY_OPTIONS as ue } from "./countries.js";
32
- import { default as de } from "./lib/react-intl-redux/providers/Provider.js";
33
- import { default as Ce } from "./lib/react-intl-redux/providers/IntlProvider.js";
31
+ import * as t from "./translations/am.json.js";
32
+ import { COUNTRY_OPTIONS as ur } from "./countries.js";
33
+ import { default as cr } from "./lib/react-intl-redux/providers/Provider.js";
34
+ import { default as Sr } from "./lib/react-intl-redux/providers/IntlProvider.js";
34
35
  export {
35
- ue as COUNTRY_OPTIONS,
36
- G as ClassicHeader,
36
+ ur as COUNTRY_OPTIONS,
37
+ J as ClassicHeader,
37
38
  l as Config,
38
- U as CustomSemanticSearch,
39
- w as CustomizerWrapper,
40
- H as Favicon,
41
- K as FlexWrapDetector,
42
- V as FloatingMenuHeader,
43
- j as Footer,
44
- b as Header,
45
- Ce as IntlProvider,
46
- Y as LangSwitcher,
47
- k as Loading,
48
- A as PreviewComponent,
49
- C as PreviewPageContainer,
39
+ W as CustomSemanticSearch,
40
+ F as CustomizerWrapper,
41
+ L as Favicon,
42
+ Q as FlexWrapDetector,
43
+ X as FloatingMenuHeader,
44
+ q as Footer,
45
+ B as Header,
46
+ Sr as IntlProvider,
47
+ _ as LangSwitcher,
48
+ z as Loading,
49
+ D as PreviewComponent,
50
+ S as PreviewPageContainer,
50
51
  g as PreviewTypeContainer,
51
- de as Provider,
52
+ cr as Provider,
52
53
  u as ResponsiveContainer,
53
- I as RootLayout,
54
- N as SSRFavicon,
55
- d as ScrollToTop,
56
- E as SearchControl,
57
- P as SlugContainer,
58
- h as SlugPostContainer,
59
- fe as UPDATE,
54
+ y as RootLayout,
55
+ O as SSRFavicon,
56
+ c as ScrollToTop,
57
+ M as SearchControl,
58
+ h as SlugContainer,
59
+ R as SlugPostContainer,
60
+ sr as UPDATE,
60
61
  o as afrikaansTranslations,
61
- le as combineReducers,
62
- f as components,
62
+ t as amharicTranslations,
63
+ lr as combineReducers,
64
+ s as components,
63
65
  p as customizer,
64
- e as englishTranslations,
65
- r as frenchTranslations,
66
- s as getComponentByNameIgnoreCase,
67
- pe as initialState,
68
- se as intlReducer,
69
- m as reducers,
70
- ee as store,
71
- me as updateIntl,
72
- oe as useAppDispatch,
73
- te as useAppSelector,
74
- Z as withTracker
66
+ r as englishTranslations,
67
+ e as frenchTranslations,
68
+ m as getComponentByNameIgnoreCase,
69
+ pr as initialState,
70
+ mr as intlReducer,
71
+ n as reducers,
72
+ er as store,
73
+ nr as updateIntl,
74
+ tr as useAppDispatch,
75
+ ar as useAppSelector,
76
+ $ as withTracker
75
77
  };