@trintel/zooy 1.6.0 → 1.7.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.
package/dist/zooy.es.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { n as le, t as R } from "./chunks/component-library-registry-DB5UeqC2.js";
2
- import { a as Me, c as we, d as O, f as ee, i as be, l as Le, m as Oe, n as Ie, o as Re, p as ce, s as b, t as ye, u as te } from "./chunks/tree-utils-CIi6B6uU.js";
3
- import { i as Ae, t as Pe } from "./chunks/zoo-Cztpe9qH.js";
2
+ import { a as Me, c as be, d as O, f as ee, i as we, l as Le, m as Oe, n as Ie, o as Re, p as ce, s as w, t as ye, u as te } from "./chunks/tree-utils-CIi6B6uU.js";
3
+ import { i as Ae, t as Pe } from "./chunks/zoo-CaW98OQn.js";
4
4
  import { identity as C, isDef as F, isDefAndNotNull as j, isNumber as se, isUndefined as Ne, randomId as f, stripLeadingChar as he, toNumber as ie, whatType as Ve } from "badu";
5
5
  import { mergeRight as Ue } from "ramda";
6
6
  var L = class extends EventTarget {
@@ -244,7 +244,7 @@ var L = class extends EventTarget {
244
244
  l.TOUCHEND
245
245
  ], ze = (e) => ke.includes(e.type), z = (e) => (ze(e) && (e.clientX = e.targetTouches[0].clientX, e.clientY = e.targetTouches[0].clientY), e), xe = (e, t, s, i) => (r) => {
246
246
  r.preventDefault();
247
- const o = z(r), c = o.currentTarget, [p, v] = we(c), m = o.clientX - p, S = o.clientY - v, n = e(p, v, m, S, c), a = s(p, v, m, S, c), h = t(p, v, m, S, c);
247
+ const o = z(r), c = o.currentTarget, [p, v] = be(c), m = o.clientX - p, S = o.clientY - v, n = e(p, v, m, S, c), a = s(p, v, m, S, c), h = t(p, v, m, S, c);
248
248
  let u = Be(h, c, m, S);
249
249
  ["x", "ew"].includes(i) ? u = Fe(h, c, m, S) : ["y", "ns"].includes(i) && (u = $e(h, c, m, S));
250
250
  let E = !1;
@@ -389,7 +389,7 @@ var L = class extends EventTarget {
389
389
  }, Qe = (e, t) => {
390
390
  const s = new Request(e);
391
391
  return fetch(s, t).then(I).then(J);
392
- }, w = (e, t = void 0) => (s) => (U("").then(C), s.name === "AbortError" ? console.info(e, "ABORTED!") : console.error(e, s), t), x = class {
392
+ }, b = (e, t = void 0) => (s) => (U("").then(C), s.name === "AbortError" ? console.info(e, "ABORTED!") : console.error(e, s), t), x = class {
393
393
  constructor(e) {
394
394
  this.user_ = {}, this.jwt = "", e && this.updateProfileFromJwt(e).then(() => {
395
395
  });
@@ -418,23 +418,23 @@ var L = class extends EventTarget {
418
418
  return t && (e = e + " " + t), e;
419
419
  }
420
420
  formSubmit(e) {
421
- const t = new Request(e.uri.toString()), s = e.processSubmitReply.bind(e), i = w("Form submit error");
421
+ const t = new Request(e.uri.toString()), s = e.processSubmitReply.bind(e), i = b("Form submit error");
422
422
  return q().then(() => fetch(t, Ke(this.jwt, e, e.abortController.signal))).then(Ye(e)).then(U).then(Xe).then(s).catch(i);
423
423
  }
424
424
  putNoBody(e, t = void 0, s = !1) {
425
- const i = w("putNobody error");
425
+ const i = b("putNobody error");
426
426
  return Qe(e, ve("PUT", this.jwt, s, t)).catch(i);
427
427
  }
428
428
  fetch(e, t = void 0) {
429
- const s = new Request(e.toString()), i = w(`UMan Text GET Fetch: ${e}`);
429
+ const s = new Request(e.toString()), i = b(`UMan Text GET Fetch: ${e}`);
430
430
  return q().then(() => fetch(s, ne(this.jwt, t))).then(I).then(U).then(J).catch(i);
431
431
  }
432
432
  fetchAndSplit(e, t = void 0) {
433
- const s = w(`fetchAndSplit: ${e}`);
433
+ const s = b(`fetchAndSplit: ${e}`);
434
434
  return this.fetch(e, t).then(Le).catch(s);
435
435
  }
436
436
  async fetchJson(e, t = void 0, s = void 0) {
437
- const i = new Request(e.toString()), r = w(`fetchJson: ${e}`, s), o = ne(this.jwt, t);
437
+ const i = new Request(e.toString()), r = b(`fetchJson: ${e}`, s), o = ne(this.jwt, t);
438
438
  await q();
439
439
  let c;
440
440
  try {
@@ -445,19 +445,19 @@ var L = class extends EventTarget {
445
445
  return await U(), c;
446
446
  }
447
447
  patchJson(e, t, s = void 0) {
448
- const i = new Request(e.toString()), r = w(`patchJson: ${e}`), o = V(this.jwt, t, "PATCH", s);
448
+ const i = new Request(e.toString()), r = b(`patchJson: ${e}`), o = V(this.jwt, t, "PATCH", s);
449
449
  return fetch(i, o).then(I).then(P).catch(r);
450
450
  }
451
451
  postJson(e, t, s = void 0) {
452
- const i = new Request(e.toString()), r = w(`postJson: ${e}`), o = V(this.jwt, t, "POST", s);
452
+ const i = new Request(e.toString()), r = b(`postJson: ${e}`), o = V(this.jwt, t, "POST", s);
453
453
  return fetch(i, o).then(I).then(P).catch(r);
454
454
  }
455
455
  putJson(e, t, s = void 0) {
456
- const i = new Request(e.toString()), r = w(`putJson: ${e}`), o = V(this.jwt, t, "PUT", s);
456
+ const i = new Request(e.toString()), r = b(`putJson: ${e}`), o = V(this.jwt, t, "PUT", s);
457
457
  return fetch(i, o).then(I).then(P).catch(r);
458
458
  }
459
459
  delJson(e, t, s = void 0) {
460
- const i = new Request(e.toString()), r = w(`delJson: ${e}`), o = V(this.jwt, t, "DELETE", s);
460
+ const i = new Request(e.toString()), r = b(`delJson: ${e}`), o = V(this.jwt, t, "DELETE", s);
461
461
  return fetch(i, o).then(I).then(P).catch(r);
462
462
  }
463
463
  }, G = class extends y {
@@ -468,7 +468,7 @@ var L = class extends EventTarget {
468
468
  return d.READY;
469
469
  }
470
470
  constructor(e) {
471
- super(), this.qParamMap_ = /* @__PURE__ */ new Map(), this.uri_ = "", e && this.parseUri(e), this.evalScripts = Me(this), this.evalModules = be(this), this.redirected = !1, this.responseObject = {
471
+ super(), this.qParamMap_ = /* @__PURE__ */ new Map(), this.uri_ = "", e && this.parseUri(e), this.evalScripts = Me(this), this.evalModules = we(this), this.redirected = !1, this.responseObject = {
472
472
  html: null,
473
473
  scripts: null
474
474
  }, this.user_ = void 0, "AbortController" in window ? this.abortController = new AbortController() : this.abortController = {
@@ -552,25 +552,21 @@ var L = class extends EventTarget {
552
552
  }
553
553
  onViewDataBroadcast(e) {
554
554
  }
555
- async parseContent(e) {
556
- if (this.debugMe("Enable interactions. Panel:", e), R.has("mdc")) {
555
+ parseContent(e) {
556
+ if (this.debugMe("Enable interactions. Panel:", e), typeof window.customElements < "u" && R.has("carbon")) {
557
+ const n = R.get("carbon");
558
+ n.render.call(this, e, n.cache).catch((a) => console.error("[Zooy] Carbon initialization failed:", a));
559
+ }
560
+ if (R.has("mdc")) {
557
561
  const n = R.get("mdc");
558
562
  n.render.call(this, e, n.cache);
559
563
  }
560
- if (typeof window.customElements < "u" && R.has("carbon")) {
561
- const n = R.get("carbon");
562
- try {
563
- await n.render.call(this, e, n.cache);
564
- } catch (a) {
565
- console.error("[Zooy] Carbon initialization failed:", a);
566
- }
567
- }
568
564
  e.classList.contains("zoo__modal-base") && e.classList.contains("close_on_click") && this.listen(e, l.CLICK, (n) => {
569
565
  n.target === e && this.dispatchPanelEvent("destroy_me");
570
566
  }), [...e.querySelectorAll(".zoo__button:not(.external):not(.mdc-data-table__row)")].forEach((n) => {
571
567
  this.listen(n, l.CLICK, (a) => {
572
568
  a.stopPropagation();
573
- const h = a.currentTarget, u = b(h);
569
+ const h = a.currentTarget, u = w(h);
574
570
  this.dispatchPanelEvent(u.zv, Object.assign({
575
571
  orgEvt: a,
576
572
  trigger: h,
@@ -581,7 +577,7 @@ var L = class extends EventTarget {
581
577
  this.listen(n, l.CLICK, (a) => {
582
578
  const h = a.currentTarget;
583
579
  a.preventDefault(), a.stopPropagation();
584
- const u = b(h), E = u.zv || "href";
580
+ const u = w(h), E = u.zv || "href";
585
581
  this.dispatchPanelEvent(E, Object.assign({
586
582
  orgEvt: a,
587
583
  trigger: a.target,
@@ -591,7 +587,7 @@ var L = class extends EventTarget {
591
587
  }), [...e.querySelectorAll("form.intercept_submit")].forEach((n) => {
592
588
  n.noValidate = !0, this.listen(n, l.SUBMIT, (a) => {
593
589
  a.preventDefault(), a.stopPropagation();
594
- const h = b(n), u = Re(n.elements);
590
+ const h = w(n), u = Re(n.elements);
595
591
  this.dispatchPanelEvent(h.zv, Object.assign({
596
592
  orgEvt: a,
597
593
  trigger: a.target,
@@ -600,7 +596,7 @@ var L = class extends EventTarget {
600
596
  }, h));
601
597
  });
602
598
  }), [...e.querySelectorAll(".zoo__toggle_class_driver")].forEach((n) => {
603
- const a = b(n), h = a.toggle_class_target_id, u = a.toggle_class, E = e.querySelector(`#${h}`);
599
+ const a = w(n), h = a.toggle_class_target_id, u = a.toggle_class, E = e.querySelector(`#${h}`);
604
600
  E && u && n.addEventListener(l.CLICK, (g) => {
605
601
  g.stopPropagation(), E.classList.toggle(u);
606
602
  });
@@ -617,13 +613,13 @@ var L = class extends EventTarget {
617
613
  n.preventDefault(), n.target.classList.remove("drag_over");
618
614
  }, v = (n) => {
619
615
  n.dataTransfer.dropEffect = "move";
620
- const a = b(n.target);
616
+ const a = w(n.target);
621
617
  n.dataTransfer.setData("text/plain", JSON.stringify(a)), n.target.classList.add("drag_in_progress");
622
618
  }, m = (n) => {
623
619
  n.target.classList.remove("drag_in_progress");
624
620
  }, S = (n) => {
625
621
  p(n), n.stopPropagation();
626
- const a = JSON.parse(n.dataTransfer.getData("text/plain")), h = b(n.target);
622
+ const a = JSON.parse(n.dataTransfer.getData("text/plain")), h = w(n.target);
627
623
  return this.dispatchPanelEvent("drop_on", { custom: {
628
624
  on: h,
629
625
  from: a
@@ -634,7 +630,7 @@ var L = class extends EventTarget {
634
630
  }), s.forEach((n) => {
635
631
  this.listen(n, l.DRAGSTART, v), this.listen(n, l.DRAGEND, m);
636
632
  }), [...e.querySelectorAll(".zoo_async_json")].forEach((n) => {
637
- const a = b(n), h = a.href, u = this.onAsyncJsonReply.bind(this, n, a);
633
+ const a = w(n), h = a.href, u = this.onAsyncJsonReply.bind(this, n, a);
638
634
  this.user.fetchJson(h, this.abortController.signal).then(u);
639
635
  const E = a.z_json_reusable;
640
636
  E && (this.jsonCallFuncs = this.jsonCallFuncs || {}, this.jsonCallFuncs[E] = () => {
@@ -645,7 +641,7 @@ var L = class extends EventTarget {
645
641
  this.user.fetchJson(h, this.abortController.signal).then(u);
646
642
  }, g * 60 * 1e3);
647
643
  }), [...e.querySelectorAll(".zoo_async_html")].forEach((n) => {
648
- const a = b(n), h = a.href;
644
+ const a = w(n), h = a.href;
649
645
  this.user.fetchAndSplit(h, this.abortController.signal).then((E) => {
650
646
  n.appendChild(E.html), this.parseContent(n), this.evalScripts(E.scripts), this.evalModules(E.modules), this.onAsyncHtmlReply(n, a);
651
647
  });
@@ -1266,7 +1262,7 @@ var L = class extends EventTarget {
1266
1262
  };
1267
1263
  };
1268
1264
  async function ot(e = {}) {
1269
- const { registerCarbonLibrary: t } = await import("./chunks/register-BW7XFFn2.js");
1265
+ const { registerCarbonLibrary: t } = await import("./chunks/register-DhnyuYDK.js");
1270
1266
  return t(e);
1271
1267
  }
1272
1268
  async function at() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trintel/zooy",
3
- "version": "1.6.0",
3
+ "version": "1.7.1",
4
4
  "description": "UI Building Blocks",
5
5
  "license": "Apache-2.0",
6
6
  "author": {