@mtngtools/frame-vue 0.0.21-experimental.0 → 0.0.23-experimental.0

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/README.md CHANGED
@@ -11,6 +11,7 @@ Vue.js component and composable library for mtngTOOLS. Built for use in Nuxt app
11
11
  | --- | --- |
12
12
  | [`LiveFrame`](./src/components/live/LiveFrame) | Full-screen wrapper for live video players with responsive layout support. |
13
13
  | [`LoggedInOut`](./src/components/LoggedInOut) | Component that toggles content visibility based on authentication status. |
14
+ | [`VanillaIf`](./src/components/VanillaIf) | A `v-if` wrapper that naturally delays rendering until synchronously or asynchronously evaluating its condition. |
14
15
  | [`SidePanelFrame`](./src/components/live/SidePanelFrame) | Wrapper for controlling and displaying side panel content. |
15
16
  | [`SidePanelHeader`](./src/components/live/SidePanelHeader) | Standardized header component for the side panel. |
16
17
  | [`SidePanelButtonGroup`](./src/components/live/SidePanelButtonGroup) | Control group for managing panel selection buttons. |
@@ -33,7 +34,7 @@ pnpm add @mtngtools/frame-vue vue
33
34
  ### Regular Imports
34
35
 
35
36
  ```ts
36
- import { LiveFrame, LoggedInOut } from '@mtngtools/frame-vue';
37
+ import { LiveFrame, LoggedInOut, VanillaIf } from '@mtngtools/frame-vue';
37
38
  ```
38
39
 
39
40
  ### Direct Subpath Imports
@@ -41,7 +42,7 @@ import { LiveFrame, LoggedInOut } from '@mtngtools/frame-vue';
41
42
  For specific needs or smaller bundle sizes, you can import directly from subpaths:
42
43
 
43
44
  ```ts
44
- import { LoggedInOut } from '@mtngtools/frame-vue/components';
45
+ import { LoggedInOut, VanillaIf } from '@mtngtools/frame-vue/components';
45
46
  import { useSimpleLoggedIn } from '@mtngtools/frame-vue/composables';
46
47
  ```
47
48
 
@@ -372,7 +372,11 @@ var _hoisted_1$4 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
372
372
  headerHideWidthThreshold: { default: "50rem" },
373
373
  headerHideHeightThreshold: { default: "40rem" },
374
374
  disableSidePanel: {
375
- type: Boolean,
375
+ type: [
376
+ Boolean,
377
+ Function,
378
+ Object
379
+ ],
376
380
  default: !1
377
381
  },
378
382
  hideSidePanelIcons: {
@@ -387,36 +391,39 @@ var _hoisted_1$4 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
387
391
  "sidePanelAvailableStates",
388
392
  "defaultSlotResize"
389
393
  ],
390
- setup(e, { emit: t }) {
391
- let n = e, r = t, i = useSlots(), a = ref(null), d = ref(null), p = ref(null), g = ref(0), _ = ref(0), v = ref(0), y = ref(0), b = ref(0);
392
- function te() {
393
- let e = p.value;
394
+ setup(e, { expose: t, emit: n }) {
395
+ let r = e, i = n, a = useSlots(), d = ref(null), p = ref(null), g = ref(null), _ = ref(0), v = ref(0), y = ref(0), b = ref(0), x = ref(0);
396
+ function S() {
397
+ let e = g.value;
394
398
  if (!e) return;
395
- let t = n.enforceSlotSizingQuerySelector ? Array.from(e.querySelectorAll(n.enforceSlotSizingQuerySelector)) : Array.from(e.children), r = `${b.value}px`;
399
+ let t = r.enforceSlotSizingQuerySelector ? Array.from(e.querySelectorAll(r.enforceSlotSizingQuerySelector)) : Array.from(e.children), n = `${x.value}px`;
396
400
  t.forEach((e) => {
397
- e.style.height !== r && (e.style.height = r);
401
+ e.style.height !== n && (e.style.height = n);
398
402
  });
399
403
  }
400
- let x = ref("none"), S = ref("none"), C = ref([]), w = ref("none"), T = ref(!0), E = ref(!1), ne = {
404
+ let C = ref("none"), w = ref("none"), T = ref([]), E = ref("none"), D = ref(!0), O = ref(!1), te = {
401
405
  sm: 640,
402
406
  md: 768,
403
407
  lg: 1024,
404
408
  xl: 1280,
405
409
  "2xl": 1536
406
- }, D = computed(() => !!i.sidePanelContent && !n.disableSidePanel), O = computed(() => !!i.header), re = computed(() => C.value.filter((e) => e !== "auto")), k = computed(() => Math.max(0, _.value - v.value)), A = computed(() => g.value < W(n.controlsOverlayOnly)), j = computed(() => g.value === 0 ? !1 : k.value / g.value > 1.1), M = computed(() => S.value === "right" && w.value === "wide-right" ? n.sidePanelMaxRightWide : n.sidePanelMaxRight), N = computed(() => ge(n.mainContentAspectRatio, 16 / 9)), ie = computed(() => y.value > 0 ? y.value : Math.max(1, g.value)), ae = computed(() => ie.value / N.value + 20), oe = computed(() => Math.max(1, g.value) / N.value), se = computed(() => G(n.sidePanelMinBottom, g.value, _.value)), ce = computed(() => {
407
- let e = oe.value + se.value;
408
- return k.value >= e;
409
- }), le = computed(() => Math.max(0, k.value - ae.value)), ue = computed(() => {
410
- if (S.value !== "bottom") return n.sidePanelMinBottom;
411
- let e = G(n.sidePanelMinBottom, g.value, _.value), t = Math.min(e, P.value);
410
+ }, ne = computed(() => {
411
+ let e = unref(r.disableSidePanel);
412
+ return typeof e == "function" ? e() : !!e;
413
+ }), k = computed(() => !!a.sidePanelContent && !ne.value), A = computed(() => !!a.header), j = computed(() => T.value.filter((e) => e !== "auto")), M = computed(() => Math.max(0, v.value - y.value)), N = computed(() => _.value < G(r.controlsOverlayOnly)), P = computed(() => _.value === 0 ? !1 : M.value / _.value > 1.1), re = computed(() => w.value === "right" && E.value === "wide-right" ? r.sidePanelMaxRightWide : r.sidePanelMaxRight), ie = computed(() => _e(r.mainContentAspectRatio, 16 / 9)), ae = computed(() => b.value > 0 ? b.value : Math.max(1, _.value)), oe = computed(() => ae.value / ie.value + 20), se = computed(() => Math.max(1, _.value) / ie.value), ce = computed(() => K(r.sidePanelMinBottom, _.value, v.value)), le = computed(() => {
414
+ let e = se.value + ce.value;
415
+ return M.value >= e;
416
+ }), ue = computed(() => Math.max(0, M.value - oe.value)), de = computed(() => {
417
+ if (w.value !== "bottom") return r.sidePanelMinBottom;
418
+ let e = K(r.sidePanelMinBottom, _.value, v.value), t = Math.min(e, F.value);
412
419
  return `${Math.max(0, Math.floor(t))}px`;
413
- }), P = computed(() => {
414
- let e = G(S.value === "bottom" && w.value === "tall-bottom" ? n.sidePanelMaxBottomTall : n.sidePanelMaxBottom, g.value, _.value);
415
- return Math.max(0, Math.min(e, le.value));
416
- }), F = computed(() => S.value === "bottom" ? `${Math.max(0, Math.floor(P.value))}px` : n.sidePanelMaxBottom), de = computed(() => S.value === "right" || S.value === "bottom" ? {} : S.value === "full" && !A.value ? {
420
+ }), F = computed(() => {
421
+ let e = K(w.value === "bottom" && E.value === "tall-bottom" ? r.sidePanelMaxBottomTall : r.sidePanelMaxBottom, _.value, v.value);
422
+ return Math.max(0, Math.min(e, ue.value));
423
+ }), I = computed(() => w.value === "bottom" ? `${Math.max(0, Math.floor(F.value))}px` : r.sidePanelMaxBottom), fe = computed(() => w.value === "right" || w.value === "bottom" ? {} : w.value === "full" && !N.value ? {
417
424
  opacity: 0,
418
425
  pointerEvents: "none"
419
- } : {}), I = computed(() => !D.value || A.value || S.value === "none" || S.value === "minimized" || S.value === "right" || S.value === "bottom" ? null : {
426
+ } : {}), L = computed(() => !k.value || N.value || w.value === "none" || w.value === "minimized" || w.value === "right" || w.value === "bottom" ? null : {
420
427
  position: "absolute",
421
428
  top: 0,
422
429
  right: 0,
@@ -424,16 +431,16 @@ var _hoisted_1$4 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
424
431
  left: 0,
425
432
  zIndex: 10,
426
433
  pointerEvents: "none"
427
- }), L = computed(() => !D.value || S.value === "none" || S.value === "full" ? { gridTemplate: "1fr / 1fr" } : S.value === "right" ? {
434
+ }), R = computed(() => !k.value || w.value === "none" || w.value === "full" ? { gridTemplate: "1fr / 1fr" } : w.value === "right" ? {
428
435
  gridTemplateRows: "1fr",
429
- gridTemplateColumns: `minmax(0, 1fr) max(${n.sidePanelMinRight}, ${M.value})`
430
- } : S.value === "bottom" ? {
431
- gridTemplateRows: `minmax(0, 1fr) ${F.value}`,
436
+ gridTemplateColumns: `minmax(0, 1fr) max(${r.sidePanelMinRight}, ${re.value})`
437
+ } : w.value === "bottom" ? {
438
+ gridTemplateRows: `minmax(0, 1fr) ${I.value}`,
432
439
  gridTemplateColumns: "1fr"
433
- } : S.value === "minimized" ? {
440
+ } : w.value === "minimized" ? {
434
441
  gridTemplateRows: "1fr max-content",
435
442
  gridTemplateColumns: "1fr"
436
- } : { gridTemplate: "1fr / 1fr" }), fe = computed(() => {
443
+ } : { gridTemplate: "1fr / 1fr" }), pe = computed(() => {
437
444
  let e = {
438
445
  minWidth: 0,
439
446
  minHeight: 0,
@@ -442,13 +449,13 @@ var _hoisted_1$4 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
442
449
  placeSelf: "stretch",
443
450
  zIndex: 20
444
451
  };
445
- if (D.value) {
446
- if (S.value === "right") return {
452
+ if (k.value) {
453
+ if (w.value === "right") return {
447
454
  ...e,
448
455
  gridColumn: "2 / 3",
449
456
  gridRow: "1 / 2"
450
457
  };
451
- if (S.value === "full") return {
458
+ if (w.value === "full") return {
452
459
  ...e,
453
460
  gridColumn: "1 / 2",
454
461
  gridRow: "1 / 2"
@@ -459,7 +466,7 @@ var _hoisted_1$4 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
459
466
  gridColumn: "1 / 2",
460
467
  gridRow: "2 / 3"
461
468
  };
462
- }), pe = computed(() => {
469
+ }), me = computed(() => {
463
470
  let e = {
464
471
  position: "fixed",
465
472
  top: 0,
@@ -468,7 +475,7 @@ var _hoisted_1$4 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
468
475
  left: 0,
469
476
  overflow: "hidden"
470
477
  };
471
- return O.value ? {
478
+ return A.value ? {
472
479
  ...e,
473
480
  display: "grid",
474
481
  gridTemplateRows: "auto 1fr"
@@ -476,11 +483,11 @@ var _hoisted_1$4 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
476
483
  ...e,
477
484
  display: "block"
478
485
  };
479
- }), me = computed(() => O.value ? {
486
+ }), he = computed(() => A.value ? {
480
487
  position: "relative",
481
488
  zIndex: 0,
482
489
  display: "grid",
483
- ...L.value,
490
+ ...R.value,
484
491
  gridRow: "2 / 3",
485
492
  minWidth: 0,
486
493
  minHeight: 0,
@@ -489,7 +496,7 @@ var _hoisted_1$4 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
489
496
  position: "absolute",
490
497
  zIndex: 0,
491
498
  display: "grid",
492
- ...L.value,
499
+ ...R.value,
493
500
  minWidth: 0,
494
501
  minHeight: 0,
495
502
  overflow: "hidden",
@@ -497,9 +504,9 @@ var _hoisted_1$4 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
497
504
  right: "0",
498
505
  bottom: "0",
499
506
  left: "0"
500
- }), he = computed(() => !A.value || T.value), R = null, z, B, V = null, H = "", U = !1;
501
- function W(e) {
502
- let t = ne[e];
507
+ }), ge = computed(() => !N.value || D.value), z = null, B, V, H = null, U = "", W = !1;
508
+ function G(e) {
509
+ let t = te[e];
503
510
  if (t !== void 0) return t;
504
511
  if (e.endsWith("px")) {
505
512
  let t = Number.parseFloat(e);
@@ -508,7 +515,7 @@ var _hoisted_1$4 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
508
515
  let n = Number.parseFloat(e);
509
516
  return Number.isFinite(n) ? n : 0;
510
517
  }
511
- function ge(e, t) {
518
+ function _e(e, t) {
512
519
  if (typeof e == "number") return Number.isFinite(e) && e > 0 ? e : t;
513
520
  let n = String(e).trim();
514
521
  if (n.includes("/")) {
@@ -518,7 +525,7 @@ var _hoisted_1$4 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
518
525
  let r = Number.parseFloat(n);
519
526
  return Number.isFinite(r) && r > 0 ? r : t;
520
527
  }
521
- function G(e, t, n) {
528
+ function K(e, t, n) {
522
529
  let r = e.trim();
523
530
  if (r.endsWith("px")) {
524
531
  let e = Number.parseFloat(r);
@@ -535,9 +542,9 @@ var _hoisted_1$4 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
535
542
  let i = Number.parseFloat(r);
536
543
  return Number.isFinite(i) ? i : 0;
537
544
  }
538
- function _e() {
539
- let e = Math.max(1, g.value), t = Math.max(1, k.value), r = e / t, i = e / t, a = W(n.sidePanelBreakpoint), o = ce.value;
540
- return r < n.autoBottomAspectRatioBreakpoint && o ? (w.value = "tall-bottom", {
545
+ function ve() {
546
+ let e = Math.max(1, _.value), t = Math.max(1, M.value), n = e / t, i = e / t, a = G(r.sidePanelBreakpoint), o = le.value;
547
+ return n < r.autoBottomAspectRatioBreakpoint && o ? (E.value = "tall-bottom", {
541
548
  states: [
542
549
  "auto",
543
550
  "full",
@@ -545,7 +552,7 @@ var _hoisted_1$4 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
545
552
  "minimized"
546
553
  ],
547
554
  resolved: "bottom"
548
- }) : i > n.autoRightAspectRatioBreakpoint ? (w.value = "wide-right", {
555
+ }) : i > r.autoRightAspectRatioBreakpoint ? (E.value = "wide-right", {
549
556
  states: [
550
557
  "auto",
551
558
  "full",
@@ -553,7 +560,7 @@ var _hoisted_1$4 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
553
560
  "minimized"
554
561
  ],
555
562
  resolved: "right"
556
- }) : (w.value = "mixed", e >= a ? {
563
+ }) : (E.value = "mixed", e >= a ? {
557
564
  states: o ? [
558
565
  "auto",
559
566
  "full",
@@ -576,74 +583,74 @@ var _hoisted_1$4 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
576
583
  resolved: "full"
577
584
  });
578
585
  }
579
- function ve(e, t, n) {
580
- e === t || t === "none" || !D.value || r("sidePanelTransition", {
586
+ function ye(e, t, n) {
587
+ e === t || t === "none" || !k.value || i("sidePanelTransition", {
581
588
  from: e,
582
589
  to: t,
583
590
  reason: n
584
591
  });
585
592
  }
586
- function K(e = !1) {
593
+ function q(e = !1) {
587
594
  let t = {
588
- availableStates: D.value ? [...re.value] : [],
589
- sidePanelMode: D.value ? x.value : "none",
590
- sidePanelModeResolved: D.value ? S.value : "none",
591
- overlayOnly: A.value
595
+ availableStates: k.value ? [...j.value] : [],
596
+ sidePanelMode: k.value ? C.value : "none",
597
+ sidePanelModeResolved: k.value ? w.value : "none",
598
+ overlayOnly: N.value
592
599
  };
593
- if (!D.value) {
594
- if (U) return;
595
- U = !0, r("sidePanelAvailableStates", t);
600
+ if (!k.value) {
601
+ if (W) return;
602
+ W = !0, i("sidePanelAvailableStates", t);
596
603
  return;
597
604
  }
598
- U = !1;
605
+ W = !1;
599
606
  let n = JSON.stringify(t);
600
- !e && n === H || (H = n, r("sidePanelAvailableStates", t));
607
+ !e && n === U || (U = n, i("sidePanelAvailableStates", t));
601
608
  }
602
- function q(e) {
603
- let t = S.value;
604
- if (!D.value) {
605
- x.value = "none", S.value = "none", C.value = [], K();
609
+ function be(e) {
610
+ let t = w.value;
611
+ if (!k.value) {
612
+ C.value = "none", w.value = "none", T.value = [], q();
606
613
  return;
607
614
  }
608
- let n = _e();
609
- C.value = n.states;
610
- let i = x.value === "none" ? "auto" : x.value;
611
- i !== "auto" && !C.value.includes(i) ? (x.value = "auto", r("update:sidePanelPosition", "auto")) : x.value = i, S.value = x.value === "auto" ? n.resolved : x.value, ve(t, S.value, e), K(E.value === !1);
615
+ let n = ve();
616
+ T.value = n.states;
617
+ let r = C.value === "none" ? "auto" : C.value;
618
+ r !== "auto" && !T.value.includes(r) ? (C.value = "auto", i("update:sidePanelPosition", "auto")) : C.value = r, w.value = C.value === "auto" ? n.resolved : C.value, ye(t, w.value, e), q(O.value === !1);
612
619
  }
613
620
  function J(e, t = !1) {
614
- if (z &&= (clearTimeout(z), void 0), t || !E.value) {
615
- q(e);
621
+ if (B &&= (clearTimeout(B), void 0), t || !O.value) {
622
+ be(e);
616
623
  return;
617
624
  }
618
- z = setTimeout(() => {
619
- q(e);
620
- }, n.layoutDebounceMs);
625
+ B = setTimeout(() => {
626
+ be(e);
627
+ }, r.layoutDebounceMs);
621
628
  }
622
629
  function Y(e) {
623
- if (!D.value) return;
624
- let t = C.value.includes(e) ? e : "auto";
625
- t !== x.value && (x.value = t, r("update:sidePanelPosition", t)), J("set-side-panel-mode", !0);
630
+ if (!k.value) return;
631
+ let t = T.value.includes(e) ? e : "auto";
632
+ t !== C.value && (C.value = t, i("update:sidePanelPosition", t)), J("set-side-panel-mode", !0);
626
633
  }
627
- function ye() {
628
- !D.value || !A.value || Y("minimized");
634
+ function xe() {
635
+ !k.value || !N.value || Y("minimized");
629
636
  }
630
637
  function X() {
631
- B &&= (clearTimeout(B), void 0);
638
+ V &&= (clearTimeout(V), void 0);
632
639
  }
633
640
  function Z() {
634
- if (X(), !A.value || j.value || S.value === "none") {
635
- T.value = !0;
641
+ if (X(), !N.value || P.value || w.value === "none") {
642
+ D.value = !0;
636
643
  return;
637
644
  }
638
- B = setTimeout(() => {
639
- T.value = !1;
640
- }, n.autoHideTimeout);
645
+ V = setTimeout(() => {
646
+ D.value = !1;
647
+ }, r.autoHideTimeout);
641
648
  }
642
649
  function Q() {
643
- T.value = !0, Z();
650
+ D.value = !0, Z();
644
651
  }
645
- function be() {
646
- if (!a.value) return;
652
+ function Se() {
653
+ if (!d.value) return;
647
654
  let e = [
648
655
  "mousemove",
649
656
  "click",
@@ -653,67 +660,70 @@ var _hoisted_1$4 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
653
660
  ], t = () => {
654
661
  Q();
655
662
  };
656
- for (let n of e) a.value.addEventListener(n, t, { passive: !0 });
657
- V = () => {
658
- if (a.value) for (let n of e) a.value.removeEventListener(n, t);
663
+ for (let n of e) d.value.addEventListener(n, t, { passive: !0 });
664
+ H = () => {
665
+ if (d.value) for (let n of e) d.value.removeEventListener(n, t);
659
666
  };
660
667
  }
661
668
  function $() {
662
- g.value = window.innerWidth, _.value = window.innerHeight, J("viewport-resize");
669
+ _.value = window.innerWidth, v.value = window.innerHeight, J("viewport-resize");
670
+ }
671
+ function Ce() {
672
+ _.value = window.innerWidth, v.value = window.innerHeight, y.value = p.value?.offsetHeight ?? 0, b.value = g.value?.offsetWidth ?? 0, x.value = g.value?.offsetHeight ?? 0, S(), J("manual-refresh", !0);
663
673
  }
664
- return watch(() => n.sidePanelPosition, (e) => {
665
- if (!D.value) {
666
- x.value = "none";
674
+ return t({ refresh: Ce }), watch(() => r.sidePanelPosition, (e) => {
675
+ if (!k.value) {
676
+ C.value = "none";
667
677
  return;
668
678
  }
669
- x.value = e, J("prop-sync");
670
- }, { immediate: !0 }), watch(D, (e) => {
679
+ C.value = e, J("prop-sync");
680
+ }, { immediate: !0 }), watch(k, (e) => {
671
681
  if (!e) {
672
- x.value = "none", S.value = "none", C.value = [], K();
682
+ C.value = "none", w.value = "none", T.value = [], q();
673
683
  return;
674
684
  }
675
- x.value = n.sidePanelPosition, J("slot-state-change", !0);
685
+ C.value = r.sidePanelPosition, J("slot-state-change", !0);
676
686
  }, { immediate: !0 }), watch(() => [
677
- A.value,
678
- n.autoHideTimeout,
679
- S.value
687
+ N.value,
688
+ r.autoHideTimeout,
689
+ w.value
680
690
  ], () => {
681
- if (S.value === "full") {
691
+ if (w.value === "full") {
682
692
  Z();
683
693
  return;
684
694
  }
685
695
  Q();
686
- }), watch(j, (e, t) => {
696
+ }), watch(P, (e, t) => {
687
697
  if (e) {
688
- T.value = !0, X();
698
+ D.value = !0, X();
689
699
  return;
690
700
  }
691
701
  t && Q();
692
702
  }), watch(() => [
693
- y.value,
694
703
  b.value,
695
- S.value,
696
- D.value
704
+ x.value,
705
+ w.value,
706
+ k.value
697
707
  ], () => {
698
- !D.value || S.value === "none" || r("defaultSlotResize", {
699
- width: y.value,
700
- height: b.value
708
+ !k.value || w.value === "none" || i("defaultSlotResize", {
709
+ width: b.value,
710
+ height: x.value
701
711
  });
702
712
  }), onMounted(async () => {
703
- E.value = !0, $(), window.addEventListener("resize", $), be(), Q(), await nextTick(), R = new ResizeObserver(() => {
704
- v.value = d.value?.offsetHeight ?? 0, y.value = p.value?.offsetWidth ?? 0, b.value = p.value?.offsetHeight ?? 0, te(), J("slot-measure");
705
- }), d.value && R.observe(d.value), p.value && (R.observe(p.value), y.value = p.value.offsetWidth, b.value = p.value.offsetHeight), v.value = d.value?.offsetHeight ?? 0, J("mounted", !0);
713
+ O.value = !0, $(), window.addEventListener("resize", $), Se(), Q(), await nextTick(), z = new ResizeObserver(() => {
714
+ y.value = p.value?.offsetHeight ?? 0, b.value = g.value?.offsetWidth ?? 0, x.value = g.value?.offsetHeight ?? 0, S(), J("slot-measure");
715
+ }), p.value && z.observe(p.value), g.value && (z.observe(g.value), b.value = g.value.offsetWidth, x.value = g.value.offsetHeight), y.value = p.value?.offsetHeight ?? 0, J("mounted", !0);
706
716
  }), onBeforeUnmount(() => {
707
- window.removeEventListener("resize", $), V?.(), V = null, R?.disconnect(), R = null, X(), z &&= (clearTimeout(z), void 0);
708
- }), (t, r) => (openBlock(), createElementBlock("section", {
717
+ window.removeEventListener("resize", $), H?.(), H = null, z?.disconnect(), z = null, X(), B &&= (clearTimeout(B), void 0);
718
+ }), (t, n) => (openBlock(), createElementBlock("section", {
709
719
  ref_key: "rootRef",
710
- ref: a,
720
+ ref: d,
711
721
  class: "bg-black text-neutral-100",
712
- style: normalizeStyle({ ...pe.value })
713
- }, [O.value ? withDirectives((openBlock(), createElementBlock("header", {
722
+ style: normalizeStyle({ ...me.value })
723
+ }, [A.value ? withDirectives((openBlock(), createElementBlock("header", {
714
724
  key: 0,
715
725
  ref_key: "headerRef",
716
- ref: d,
726
+ ref: p,
717
727
  class: "",
718
728
  style: {
719
729
  position: "relative",
@@ -722,15 +732,15 @@ var _hoisted_1$4 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
722
732
  zIndex: 40
723
733
  }
724
734
  }, [(openBlock(), createBlock(resolveDynamicComponent("style"), null, {
725
- default: withCtx(() => [createTextVNode(" #header-outer { display: none; } @media (min-width: " + toDisplayString(n.headerHideWidthThreshold) + ") and (min-height: " + toDisplayString(n.headerHideHeightThreshold) + ") { #header-outer { display: block; } } ", 1)]),
735
+ default: withCtx(() => [createTextVNode(" #header-outer { display: none; } @media (min-width: " + toDisplayString(r.headerHideWidthThreshold) + ") and (min-height: " + toDisplayString(r.headerHideHeightThreshold) + ") { #header-outer { display: block; } } ", 1)]),
726
736
  _: 1
727
- })), createElementVNode("div", _hoisted_1, [renderSlot(t.$slots, "header")])], 512)), [[vShow, he.value]]) : createCommentVNode("", !0), createElementVNode("article", {
737
+ })), createElementVNode("div", _hoisted_1, [renderSlot(t.$slots, "header")])], 512)), [[vShow, ge.value]]) : createCommentVNode("", !0), createElementVNode("article", {
728
738
  class: "",
729
- style: normalizeStyle({ ...me.value })
739
+ style: normalizeStyle({ ...he.value })
730
740
  }, [
731
741
  createElementVNode("main", {
732
742
  ref_key: "defaultRef",
733
- ref: p,
743
+ ref: g,
734
744
  class: "slot-content-container",
735
745
  style: normalizeStyle({
736
746
  position: "relative",
@@ -744,34 +754,34 @@ var _hoisted_1$4 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
744
754
  gridColumn: "1 / 2",
745
755
  gridRow: "1 / 2",
746
756
  zIndex: 0,
747
- ...de.value
757
+ ...fe.value
748
758
  })
749
759
  }, [renderSlot(t.$slots, "default")], 4),
750
- I.value ? (openBlock(), createElementBlock("div", {
760
+ L.value ? (openBlock(), createElementBlock("div", {
751
761
  key: 0,
752
762
  class: "bg-black",
753
763
  style: normalizeStyle({
754
- ...I.value,
764
+ ...L.value,
755
765
  gridColumn: "1 / 2",
756
766
  gridRow: "1 / 2"
757
767
  })
758
768
  }, null, 4)) : createCommentVNode("", !0),
759
- D.value && S.value !== "none" ? (openBlock(), createElementBlock("div", {
769
+ k.value && w.value !== "none" ? (openBlock(), createElementBlock("div", {
760
770
  key: 1,
761
771
  class: "",
762
- style: normalizeStyle(fe.value)
772
+ style: normalizeStyle(pe.value)
763
773
  }, [createVNode(SidePanelFrame_default, {
764
- "side-panel-mode": x.value,
765
- "side-panel-mode-resolved": S.value,
766
- "available-states": re.value,
767
- "overlay-only": A.value,
774
+ "side-panel-mode": C.value,
775
+ "side-panel-mode-resolved": w.value,
776
+ "available-states": j.value,
777
+ "overlay-only": N.value,
768
778
  "hide-icons": e.hideSidePanelIcons,
769
779
  "min-width": e.sidePanelMinRight,
770
- "max-width": M.value,
771
- "min-height": ue.value,
772
- "max-height": F.value,
780
+ "max-width": re.value,
781
+ "min-height": de.value,
782
+ "max-height": I.value,
773
783
  onSetSidePanelMode: Y,
774
- onCloseSidePanel: ye
784
+ onCloseSidePanel: xe
775
785
  }, {
776
786
  default: withCtx(() => [renderSlot(t.$slots, "sidePanelContent")]),
777
787
  _: 3
@@ -788,7 +798,7 @@ var _hoisted_1$4 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
788
798
  ])], 4)) : createCommentVNode("", !0)
789
799
  ], 4)], 4));
790
800
  }
791
- }), [["__scopeId", "data-v-6d5f1013"]]), LoggedInOut_default = /* @__PURE__ */ defineComponent({
801
+ }), [["__scopeId", "data-v-4bbac08e"]]), LoggedInOut_default = /* @__PURE__ */ defineComponent({
792
802
  __name: "LoggedInOut",
793
803
  props: {
794
804
  initiallyLoggedIn: { type: Boolean },
@@ -832,5 +842,62 @@ var _hoisted_1$4 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
832
842
  setLoggedIn: f
833
843
  }), (e, t) => !h.value || unref(s) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [unref(r) ? renderSlot(e.$slots, "loggedIn", { key: 0 }) : renderSlot(e.$slots, "loggedOut", { key: 1 })], 64)) : createCommentVNode("", !0);
834
844
  }
845
+ }), VanillaIf_default = /* @__PURE__ */ defineComponent({
846
+ __name: "VanillaIf",
847
+ props: { show: { type: [
848
+ Boolean,
849
+ Function,
850
+ Object
851
+ ] } },
852
+ setup(e) {
853
+ let t = e, n = ref(!1), r = ref(!1), i = null;
854
+ function o() {
855
+ i &&= (clearInterval(i), null);
856
+ }
857
+ function s() {
858
+ let e = unref(t.show);
859
+ if (typeof e == "function") try {
860
+ let t = e();
861
+ return typeof t == "boolean" ? {
862
+ ready: !0,
863
+ value: t
864
+ } : {
865
+ ready: !1,
866
+ value: !1
867
+ };
868
+ } catch (e) {
869
+ if (e instanceof ReferenceError || e instanceof TypeError) return {
870
+ ready: !1,
871
+ value: !1
872
+ };
873
+ throw e;
874
+ }
875
+ return typeof e == "boolean" ? {
876
+ ready: !0,
877
+ value: e
878
+ } : e == null ? {
879
+ ready: !1,
880
+ value: !1
881
+ } : {
882
+ ready: !0,
883
+ value: !!e
884
+ };
885
+ }
886
+ function c() {
887
+ let { ready: e, value: t } = s();
888
+ e ? (r.value = t, n.value = !0, o()) : i ||= setInterval(() => {
889
+ let e = s();
890
+ e.ready && (r.value = e.value, n.value = !0, o());
891
+ }, 50);
892
+ }
893
+ let l = s();
894
+ return l.ready && (n.value = !0, r.value = l.value), watch(() => t.show, () => {
895
+ n.value = !1, o(), c();
896
+ }, { deep: !0 }), onMounted(() => {
897
+ n.value || c();
898
+ }), onUnmounted(() => {
899
+ o();
900
+ }), (e, t) => n.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [r.value ? renderSlot(e.$slots, "default", { key: 0 }) : renderSlot(e.$slots, "else", { key: 1 })], 64)) : createCommentVNode("", !0);
901
+ }
835
902
  });
836
- export { SidePanelButtonGroup_default as a, SidePanelHeader_default as i, LiveFrame_default as n, SidePanelControlButton_default as o, SidePanelFrame_default as r, LoggedInOut_default as t };
903
+ export { SidePanelHeader_default as a, SidePanelFrame_default as i, LoggedInOut_default as n, SidePanelButtonGroup_default as o, LiveFrame_default as r, SidePanelControlButton_default as s, VanillaIf_default as t };
@@ -0,0 +1,23 @@
1
+ import { Ref } from 'vue';
2
+ type __VLS_Props = {
3
+ show: boolean | (() => boolean) | Ref<boolean>;
4
+ };
5
+ declare function __VLS_template(): {
6
+ attrs: Partial<{}>;
7
+ slots: {
8
+ default?(_: {}): any;
9
+ else?(_: {}): any;
10
+ };
11
+ refs: {};
12
+ rootEl: any;
13
+ };
14
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
15
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
16
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
17
+ export default _default;
18
+ type __VLS_WithTemplateSlots<T, S> = T & {
19
+ new (): {
20
+ $slots: S;
21
+ };
22
+ };
23
+ //# sourceMappingURL=VanillaIf.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VanillaIf.vue.d.ts","sourceRoot":"","sources":["../../../src/components/VanillaIf/VanillaIf.vue"],"names":[],"mappings":"AA6GA,OAAO,EAAsC,KAAK,GAAG,EAAS,MAAM,KAAK,CAAA;AAEzE,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,OAAO,GAAG,CAAC,MAAM,OAAO,CAAC,GAAG,GAAG,CAAC,OAAO,CAAC,CAAA;CAC/C,CAAC;AAkGF,iBAAS,cAAc;WA6BT,OAAO,IAA6B;;yBAXrB,GAAG;sBACN,GAAG;;;;EAe5B;AAUD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,kSAMnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAQpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default } from './VanillaIf.vue';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/VanillaIf/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../../src/components/VanillaIf/index.test.ts"],"names":[],"mappings":""}
@@ -1,4 +1,5 @@
1
1
  export * from './live';
2
2
  export { default as LoggedInOut } from './LoggedInOut';
3
+ export { default as VanillaIf } from './VanillaIf';
3
4
  export * from './icons';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,cAAc,SAAS,CAAC"}