highsoft-ui 1.0.20 → 1.0.22

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.
@@ -247,16 +247,16 @@ function w1({
247
247
  link: t = "a",
248
248
  host: g = "https://www.highcharts.com"
249
249
  }) {
250
- const i = G();
250
+ const o = G();
251
251
  return /* @__PURE__ */ e("div", { className: f(r.sub, r.outer), children: /* @__PURE__ */ e(j, { className: r.subContainer, as: "ul", children: n.map(({ title: a, url: w, icon: x, tag: _, tagVariant: m = "success" }, k) => {
252
252
  w = l(w, g);
253
- const p = window.location.origin, v = new URL(w, p);
253
+ const p = window == null ? void 0 : window.location.origin, v = new URL(w, p);
254
254
  return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ s(
255
255
  t,
256
256
  {
257
257
  href: w,
258
258
  className: f({
259
- [r.selected]: v.origin === p && v.pathname === i.pathname
259
+ [r.selected]: v.origin === p && v.pathname === (o == null ? void 0 : o.pathname)
260
260
  }),
261
261
  children: [
262
262
  x,
@@ -283,7 +283,7 @@ function z1({
283
283
  children: t,
284
284
  notifications: g = [],
285
285
  // TODO: Fetch these from the internets
286
- link: i = "a",
286
+ link: o = "a",
287
287
  host: a = "https://www.highcharts.com"
288
288
  }) {
289
289
  const w = b("(max-width: 374px)"), x = b("(max-width: 849px)"), _ = b("(min-width: 850px) and (max-width: 999px)"), [m, k] = N(!1), [p, v] = N([]);
@@ -294,7 +294,7 @@ function z1({
294
294
  const u = JSON.parse(c);
295
295
  v(
296
296
  g.filter(
297
- (o) => !o.id || !u.closed.includes(o.id)
297
+ (i) => !i.id || !u.closed.includes(i.id)
298
298
  )
299
299
  );
300
300
  } else
@@ -304,11 +304,11 @@ function z1({
304
304
  const M = () => {
305
305
  k(!m);
306
306
  }, O = (c) => {
307
- v(p.filter((o) => !o.id || o.id !== c));
307
+ v(p.filter((i) => !i.id || i.id !== c));
308
308
  const u = localStorage.getItem("notifications");
309
309
  if (u) {
310
- const o = JSON.parse(u);
311
- o.closed.includes(c) || (o.closed.push(c), localStorage.setItem("notifications", JSON.stringify(o)));
310
+ const i = JSON.parse(u);
311
+ i.closed.includes(c) || (i.closed.push(c), localStorage.setItem("notifications", JSON.stringify(i)));
312
312
  } else
313
313
  localStorage.setItem(
314
314
  "notifications",
@@ -319,10 +319,10 @@ function z1({
319
319
  };
320
320
  return /* @__PURE__ */ e(q, { children: /* @__PURE__ */ s("header", { className: r.header, children: [
321
321
  p == null ? void 0 : p.map(
322
- ({ id: c, title: u, description: o, variant: C, closable: y }, P) => /* @__PURE__ */ e(
322
+ ({ id: c, title: u, description: i, variant: C, closable: y }, P) => /* @__PURE__ */ e(
323
323
  J,
324
324
  {
325
- description: o,
325
+ description: i,
326
326
  variant: C,
327
327
  closable: y,
328
328
  onClose: () => O(c),
@@ -333,29 +333,29 @@ function z1({
333
333
  ),
334
334
  /* @__PURE__ */ e("div", { className: f(r.main, r.outer), children: /* @__PURE__ */ s(j, { as: "nav", className: r.container, children: [
335
335
  /* @__PURE__ */ e(
336
- i,
336
+ o,
337
337
  {
338
338
  className: r.logo,
339
339
  href: l("https://www.highcharts.com/", a),
340
340
  children: /* @__PURE__ */ e(z, { showText: !_ && !w })
341
341
  }
342
342
  ),
343
- /* @__PURE__ */ e("ul", { className: r.links, children: W.map(({ title: c, url: u }, o) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
343
+ /* @__PURE__ */ e("ul", { className: r.links, children: W.map(({ title: c, url: u }, i) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
344
344
  h,
345
345
  {
346
346
  variant: "plain",
347
347
  size: 300,
348
- as: i,
348
+ as: o,
349
349
  href: l(u, a),
350
350
  children: c
351
351
  }
352
- ) }, o)) }),
352
+ ) }, i)) }),
353
353
  /* @__PURE__ */ s("div", { className: r.buttons, children: [
354
354
  /* @__PURE__ */ s(
355
355
  h,
356
356
  {
357
357
  variant: "transparent",
358
- as: i,
358
+ as: o,
359
359
  href: l(
360
360
  "https://www.highcharts.com/chat/gpt/",
361
361
  a
@@ -372,7 +372,7 @@ function z1({
372
372
  h,
373
373
  {
374
374
  variant: "brand",
375
- as: i,
375
+ as: o,
376
376
  href: l("https://shop.highcharts.com/account", a),
377
377
  "aria-label": "Login",
378
378
  children: /* @__PURE__ */ e(H, {})
@@ -382,7 +382,7 @@ function z1({
382
382
  h,
383
383
  {
384
384
  variant: "success",
385
- as: i,
385
+ as: o,
386
386
  href: l(
387
387
  "https://www.highcharts.com/download/",
388
388
  a
@@ -407,7 +407,7 @@ function z1({
407
407
  )
408
408
  ] })
409
409
  ] }) }),
410
- !!(n != null && n.length) && /* @__PURE__ */ e(w1, { items: n, link: i, host: a }),
410
+ !!(n != null && n.length) && /* @__PURE__ */ e(w1, { items: n, link: o, host: a }),
411
411
  t,
412
412
  x && /* @__PURE__ */ s(U, { children: [
413
413
  /* @__PURE__ */ e(
@@ -426,7 +426,7 @@ function z1({
426
426
  children: [
427
427
  /* @__PURE__ */ s("div", { className: r.container, children: [
428
428
  /* @__PURE__ */ e(
429
- i,
429
+ o,
430
430
  {
431
431
  className: r.logo,
432
432
  href: l("https://www.highcharts.com/", a),
@@ -438,7 +438,7 @@ function z1({
438
438
  h,
439
439
  {
440
440
  variant: "transparent",
441
- as: i,
441
+ as: o,
442
442
  href: l(
443
443
  "https://www.highcharts.com/chat/gpt/",
444
444
  a
@@ -459,7 +459,7 @@ function z1({
459
459
  {
460
460
  variant: "brand",
461
461
  fullWidth: !0,
462
- as: i,
462
+ as: o,
463
463
  href: l(
464
464
  "https://shop.highcharts.com/account",
465
465
  a
@@ -475,7 +475,7 @@ function z1({
475
475
  {
476
476
  variant: "success",
477
477
  fullWidth: !0,
478
- as: i,
478
+ as: o,
479
479
  href: l(
480
480
  "https://www.highcharts.com/download/",
481
481
  a
@@ -487,16 +487,16 @@ function z1({
487
487
  }
488
488
  )
489
489
  ] }),
490
- /* @__PURE__ */ e("ul", { className: r.links, children: W.map(({ title: c, url: u, icon: o }, C) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ s(
490
+ /* @__PURE__ */ e("ul", { className: r.links, children: W.map(({ title: c, url: u, icon: i }, C) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ s(
491
491
  h,
492
492
  {
493
493
  variant: "plain",
494
494
  size: 500,
495
495
  fullWidth: !0,
496
- as: i,
496
+ as: o,
497
497
  href: l(u, a),
498
498
  children: [
499
- o,
499
+ i,
500
500
  c
501
501
  ]
502
502
  }
package/dist/utils.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { Location } from 'history';
1
2
  export declare function useMediaQuery(query: string): boolean;
2
3
  export declare function useMounted(): boolean;
3
- export declare function useLocation(): import('history').Location;
4
+ export declare function useLocation(): Location | undefined;
package/dist/utils.js CHANGED
@@ -9,11 +9,11 @@ var A = process.env.NODE_ENV !== "production" ? function(n) {
9
9
  } : function(n) {
10
10
  return n;
11
11
  };
12
- function U(n, a) {
12
+ function U(n, o) {
13
13
  {
14
- typeof console < "u" && console.warn(a);
14
+ typeof console < "u" && console.warn(o);
15
15
  try {
16
- throw new Error(a);
16
+ throw new Error(o);
17
17
  } catch {
18
18
  }
19
19
  }
@@ -21,7 +21,7 @@ function U(n, a) {
21
21
  var H = "beforeunload", j = "popstate";
22
22
  function z(n) {
23
23
  n === void 0 && (n = {});
24
- var a = n, o = a.window, r = o === void 0 ? document.defaultView : o, i = r.history;
24
+ var o = n, a = o.window, r = a === void 0 ? document.defaultView : a, i = r.history;
25
25
  function f() {
26
26
  var t = r.location, e = t.pathname, c = t.search, l = t.hash, u = i.state || {};
27
27
  return [u.idx, A({
@@ -166,16 +166,16 @@ function B() {
166
166
  get length() {
167
167
  return n.length;
168
168
  },
169
- push: function(o) {
170
- return n.push(o), function() {
169
+ push: function(a) {
170
+ return n.push(a), function() {
171
171
  n = n.filter(function(r) {
172
- return r !== o;
172
+ return r !== a;
173
173
  });
174
174
  };
175
175
  },
176
- call: function(o) {
176
+ call: function(a) {
177
177
  n.forEach(function(r) {
178
- return r && r(o);
178
+ return r && r(a);
179
179
  });
180
180
  }
181
181
  };
@@ -184,41 +184,41 @@ function C() {
184
184
  return Math.random().toString(36).substr(2, 8);
185
185
  }
186
186
  function K(n) {
187
- var a = n.pathname, o = a === void 0 ? "/" : a, r = n.search, i = r === void 0 ? "" : r, f = n.hash, s = f === void 0 ? "" : f;
188
- return i && i !== "?" && (o += i.charAt(0) === "?" ? i : "?" + i), s && s !== "#" && (o += s.charAt(0) === "#" ? s : "#" + s), o;
187
+ var o = n.pathname, a = o === void 0 ? "/" : o, r = n.search, i = r === void 0 ? "" : r, f = n.hash, s = f === void 0 ? "" : f;
188
+ return i && i !== "?" && (a += i.charAt(0) === "?" ? i : "?" + i), s && s !== "#" && (a += s.charAt(0) === "#" ? s : "#" + s), a;
189
189
  }
190
190
  function Q(n) {
191
- var a = {};
191
+ var o = {};
192
192
  if (n) {
193
- var o = n.indexOf("#");
194
- o >= 0 && (a.hash = n.substr(o), n = n.substr(0, o));
193
+ var a = n.indexOf("#");
194
+ a >= 0 && (o.hash = n.substr(a), n = n.substr(0, a));
195
195
  var r = n.indexOf("?");
196
- r >= 0 && (a.search = n.substr(r), n = n.substr(0, r)), n && (a.pathname = n);
196
+ r >= 0 && (o.search = n.substr(r), n = n.substr(0, r)), n && (o.pathname = n);
197
197
  }
198
- return a;
198
+ return o;
199
199
  }
200
200
  function J(n) {
201
- const [a, o] = P(!1);
201
+ const [o, a] = P(!1);
202
202
  return k(() => {
203
203
  const r = window.matchMedia(n);
204
- o(r.matches);
204
+ a(r.matches);
205
205
  const i = (f) => {
206
- o(f.matches);
206
+ a(f.matches);
207
207
  };
208
208
  return r.addEventListener("change", i), () => r.removeEventListener("change", i);
209
- }, [n]), a;
209
+ }, [n]), o;
210
210
  }
211
211
  function W() {
212
- const [n, a] = P(!1);
212
+ const [n, o] = P(!1);
213
213
  return k(() => {
214
- a(!0);
214
+ o(!0);
215
215
  }, []), n;
216
216
  }
217
217
  function X() {
218
- const n = z(), [a, o] = P(n.location);
219
- return k(() => n.listen(({ location: r }) => {
218
+ const [n, o] = P();
219
+ return k(() => z().listen(({ location: r }) => {
220
220
  o(r);
221
- }), []), a;
221
+ }), []), n;
222
222
  }
223
223
  export {
224
224
  X as useLocation,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "highsoft-ui",
3
- "version": "1.0.20",
3
+ "version": "1.0.22",
4
4
  "description": "Highsoft UI",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",