@mtngtools/frame-vue 0.0.21-experimental.0 → 0.0.24-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
 
@@ -371,10 +371,15 @@ var _hoisted_1$4 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
371
371
  sidePanelMaxBottomTall: { default: "60vh" },
372
372
  headerHideWidthThreshold: { default: "50rem" },
373
373
  headerHideHeightThreshold: { default: "40rem" },
374
- disableSidePanel: {
375
- type: Boolean,
376
- default: !1
374
+ displaySidePanel: {
375
+ type: [
376
+ Boolean,
377
+ Function,
378
+ Object
379
+ ],
380
+ default: !0
377
381
  },
382
+ displaySidePanelWindowFn: {},
378
383
  hideSidePanelIcons: {
379
384
  type: Boolean,
380
385
  default: !1
@@ -387,36 +392,40 @@ var _hoisted_1$4 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
387
392
  "sidePanelAvailableStates",
388
393
  "defaultSlotResize"
389
394
  ],
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;
395
+ setup(e, { expose: t, emit: n }) {
396
+ 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);
397
+ function S() {
398
+ let e = g.value;
394
399
  if (!e) return;
395
- let t = n.enforceSlotSizingQuerySelector ? Array.from(e.querySelectorAll(n.enforceSlotSizingQuerySelector)) : Array.from(e.children), r = `${b.value}px`;
400
+ let t = r.enforceSlotSizingQuerySelector ? Array.from(e.querySelectorAll(r.enforceSlotSizingQuerySelector)) : Array.from(e.children), n = `${x.value}px`;
396
401
  t.forEach((e) => {
397
- e.style.height !== r && (e.style.height = r);
402
+ e.style.height !== n && (e.style.height = n);
398
403
  });
399
404
  }
400
- let x = ref("none"), S = ref("none"), C = ref([]), w = ref("none"), T = ref(!0), E = ref(!1), ne = {
405
+ let C = ref("none"), w = ref("none"), T = ref([]), E = ref("none"), D = ref(!0), O = ref(!1), te = {
401
406
  sm: 640,
402
407
  md: 768,
403
408
  lg: 1024,
404
409
  xl: 1280,
405
410
  "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);
411
+ }, ne = computed(() => {
412
+ if (typeof window < "u" && r.displaySidePanelWindowFn && typeof window[r.displaySidePanelWindowFn] == "function") return !!window[r.displaySidePanelWindowFn]();
413
+ let e = unref(r.displaySidePanel);
414
+ return typeof e == "function" ? e() : !!e;
415
+ }), 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(() => {
416
+ let e = se.value + ce.value;
417
+ return M.value >= e;
418
+ }), ue = computed(() => Math.max(0, M.value - oe.value)), de = computed(() => {
419
+ if (w.value !== "bottom") return r.sidePanelMinBottom;
420
+ let e = K(r.sidePanelMinBottom, _.value, v.value), t = Math.min(e, F.value);
412
421
  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 ? {
422
+ }), F = computed(() => {
423
+ let e = K(w.value === "bottom" && E.value === "tall-bottom" ? r.sidePanelMaxBottomTall : r.sidePanelMaxBottom, _.value, v.value);
424
+ return Math.max(0, Math.min(e, ue.value));
425
+ }), 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
426
  opacity: 0,
418
427
  pointerEvents: "none"
419
- } : {}), I = computed(() => !D.value || A.value || S.value === "none" || S.value === "minimized" || S.value === "right" || S.value === "bottom" ? null : {
428
+ } : {}), L = computed(() => !k.value || N.value || w.value === "none" || w.value === "minimized" || w.value === "right" || w.value === "bottom" ? null : {
420
429
  position: "absolute",
421
430
  top: 0,
422
431
  right: 0,
@@ -424,16 +433,16 @@ var _hoisted_1$4 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
424
433
  left: 0,
425
434
  zIndex: 10,
426
435
  pointerEvents: "none"
427
- }), L = computed(() => !D.value || S.value === "none" || S.value === "full" ? { gridTemplate: "1fr / 1fr" } : S.value === "right" ? {
436
+ }), R = computed(() => !k.value || w.value === "none" || w.value === "full" ? { gridTemplate: "1fr / 1fr" } : w.value === "right" ? {
428
437
  gridTemplateRows: "1fr",
429
- gridTemplateColumns: `minmax(0, 1fr) max(${n.sidePanelMinRight}, ${M.value})`
430
- } : S.value === "bottom" ? {
431
- gridTemplateRows: `minmax(0, 1fr) ${F.value}`,
438
+ gridTemplateColumns: `minmax(0, 1fr) max(${r.sidePanelMinRight}, ${re.value})`
439
+ } : w.value === "bottom" ? {
440
+ gridTemplateRows: `minmax(0, 1fr) ${I.value}`,
432
441
  gridTemplateColumns: "1fr"
433
- } : S.value === "minimized" ? {
442
+ } : w.value === "minimized" ? {
434
443
  gridTemplateRows: "1fr max-content",
435
444
  gridTemplateColumns: "1fr"
436
- } : { gridTemplate: "1fr / 1fr" }), fe = computed(() => {
445
+ } : { gridTemplate: "1fr / 1fr" }), pe = computed(() => {
437
446
  let e = {
438
447
  minWidth: 0,
439
448
  minHeight: 0,
@@ -442,13 +451,13 @@ var _hoisted_1$4 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
442
451
  placeSelf: "stretch",
443
452
  zIndex: 20
444
453
  };
445
- if (D.value) {
446
- if (S.value === "right") return {
454
+ if (k.value) {
455
+ if (w.value === "right") return {
447
456
  ...e,
448
457
  gridColumn: "2 / 3",
449
458
  gridRow: "1 / 2"
450
459
  };
451
- if (S.value === "full") return {
460
+ if (w.value === "full") return {
452
461
  ...e,
453
462
  gridColumn: "1 / 2",
454
463
  gridRow: "1 / 2"
@@ -459,7 +468,7 @@ var _hoisted_1$4 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
459
468
  gridColumn: "1 / 2",
460
469
  gridRow: "2 / 3"
461
470
  };
462
- }), pe = computed(() => {
471
+ }), me = computed(() => {
463
472
  let e = {
464
473
  position: "fixed",
465
474
  top: 0,
@@ -468,7 +477,7 @@ var _hoisted_1$4 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
468
477
  left: 0,
469
478
  overflow: "hidden"
470
479
  };
471
- return O.value ? {
480
+ return A.value ? {
472
481
  ...e,
473
482
  display: "grid",
474
483
  gridTemplateRows: "auto 1fr"
@@ -476,11 +485,11 @@ var _hoisted_1$4 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
476
485
  ...e,
477
486
  display: "block"
478
487
  };
479
- }), me = computed(() => O.value ? {
488
+ }), he = computed(() => A.value ? {
480
489
  position: "relative",
481
490
  zIndex: 0,
482
491
  display: "grid",
483
- ...L.value,
492
+ ...R.value,
484
493
  gridRow: "2 / 3",
485
494
  minWidth: 0,
486
495
  minHeight: 0,
@@ -489,7 +498,7 @@ var _hoisted_1$4 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
489
498
  position: "absolute",
490
499
  zIndex: 0,
491
500
  display: "grid",
492
- ...L.value,
501
+ ...R.value,
493
502
  minWidth: 0,
494
503
  minHeight: 0,
495
504
  overflow: "hidden",
@@ -497,9 +506,9 @@ var _hoisted_1$4 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
497
506
  right: "0",
498
507
  bottom: "0",
499
508
  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];
509
+ }), ge = computed(() => !N.value || D.value), z = null, B, V, H = null, U = "", W = !1;
510
+ function G(e) {
511
+ let t = te[e];
503
512
  if (t !== void 0) return t;
504
513
  if (e.endsWith("px")) {
505
514
  let t = Number.parseFloat(e);
@@ -508,7 +517,7 @@ var _hoisted_1$4 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
508
517
  let n = Number.parseFloat(e);
509
518
  return Number.isFinite(n) ? n : 0;
510
519
  }
511
- function ge(e, t) {
520
+ function _e(e, t) {
512
521
  if (typeof e == "number") return Number.isFinite(e) && e > 0 ? e : t;
513
522
  let n = String(e).trim();
514
523
  if (n.includes("/")) {
@@ -518,7 +527,7 @@ var _hoisted_1$4 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
518
527
  let r = Number.parseFloat(n);
519
528
  return Number.isFinite(r) && r > 0 ? r : t;
520
529
  }
521
- function G(e, t, n) {
530
+ function K(e, t, n) {
522
531
  let r = e.trim();
523
532
  if (r.endsWith("px")) {
524
533
  let e = Number.parseFloat(r);
@@ -535,9 +544,9 @@ var _hoisted_1$4 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
535
544
  let i = Number.parseFloat(r);
536
545
  return Number.isFinite(i) ? i : 0;
537
546
  }
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", {
547
+ function ve() {
548
+ 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;
549
+ return n < r.autoBottomAspectRatioBreakpoint && o ? (E.value = "tall-bottom", {
541
550
  states: [
542
551
  "auto",
543
552
  "full",
@@ -545,7 +554,7 @@ var _hoisted_1$4 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
545
554
  "minimized"
546
555
  ],
547
556
  resolved: "bottom"
548
- }) : i > n.autoRightAspectRatioBreakpoint ? (w.value = "wide-right", {
557
+ }) : i > r.autoRightAspectRatioBreakpoint ? (E.value = "wide-right", {
549
558
  states: [
550
559
  "auto",
551
560
  "full",
@@ -553,7 +562,7 @@ var _hoisted_1$4 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
553
562
  "minimized"
554
563
  ],
555
564
  resolved: "right"
556
- }) : (w.value = "mixed", e >= a ? {
565
+ }) : (E.value = "mixed", e >= a ? {
557
566
  states: o ? [
558
567
  "auto",
559
568
  "full",
@@ -576,74 +585,74 @@ var _hoisted_1$4 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
576
585
  resolved: "full"
577
586
  });
578
587
  }
579
- function ve(e, t, n) {
580
- e === t || t === "none" || !D.value || r("sidePanelTransition", {
588
+ function ye(e, t, n) {
589
+ e === t || t === "none" || !k.value || i("sidePanelTransition", {
581
590
  from: e,
582
591
  to: t,
583
592
  reason: n
584
593
  });
585
594
  }
586
- function K(e = !1) {
595
+ function q(e = !1) {
587
596
  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
597
+ availableStates: k.value ? [...j.value] : [],
598
+ sidePanelMode: k.value ? C.value : "none",
599
+ sidePanelModeResolved: k.value ? w.value : "none",
600
+ overlayOnly: N.value
592
601
  };
593
- if (!D.value) {
594
- if (U) return;
595
- U = !0, r("sidePanelAvailableStates", t);
602
+ if (!k.value) {
603
+ if (W) return;
604
+ W = !0, i("sidePanelAvailableStates", t);
596
605
  return;
597
606
  }
598
- U = !1;
607
+ W = !1;
599
608
  let n = JSON.stringify(t);
600
- !e && n === H || (H = n, r("sidePanelAvailableStates", t));
609
+ !e && n === U || (U = n, i("sidePanelAvailableStates", t));
601
610
  }
602
- function q(e) {
603
- let t = S.value;
604
- if (!D.value) {
605
- x.value = "none", S.value = "none", C.value = [], K();
611
+ function be(e) {
612
+ let t = w.value;
613
+ if (!k.value) {
614
+ C.value = "none", w.value = "none", T.value = [], q();
606
615
  return;
607
616
  }
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);
617
+ let n = ve();
618
+ T.value = n.states;
619
+ let r = C.value === "none" ? "auto" : C.value;
620
+ 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
621
  }
613
622
  function J(e, t = !1) {
614
- if (z &&= (clearTimeout(z), void 0), t || !E.value) {
615
- q(e);
623
+ if (B &&= (clearTimeout(B), void 0), t || !O.value) {
624
+ be(e);
616
625
  return;
617
626
  }
618
- z = setTimeout(() => {
619
- q(e);
620
- }, n.layoutDebounceMs);
627
+ B = setTimeout(() => {
628
+ be(e);
629
+ }, r.layoutDebounceMs);
621
630
  }
622
631
  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);
632
+ if (!k.value) return;
633
+ let t = T.value.includes(e) ? e : "auto";
634
+ t !== C.value && (C.value = t, i("update:sidePanelPosition", t)), J("set-side-panel-mode", !0);
626
635
  }
627
- function ye() {
628
- !D.value || !A.value || Y("minimized");
636
+ function xe() {
637
+ !k.value || !N.value || Y("minimized");
629
638
  }
630
639
  function X() {
631
- B &&= (clearTimeout(B), void 0);
640
+ V &&= (clearTimeout(V), void 0);
632
641
  }
633
642
  function Z() {
634
- if (X(), !A.value || j.value || S.value === "none") {
635
- T.value = !0;
643
+ if (X(), !N.value || P.value || w.value === "none") {
644
+ D.value = !0;
636
645
  return;
637
646
  }
638
- B = setTimeout(() => {
639
- T.value = !1;
640
- }, n.autoHideTimeout);
647
+ V = setTimeout(() => {
648
+ D.value = !1;
649
+ }, r.autoHideTimeout);
641
650
  }
642
651
  function Q() {
643
- T.value = !0, Z();
652
+ D.value = !0, Z();
644
653
  }
645
- function be() {
646
- if (!a.value) return;
654
+ function Se() {
655
+ if (!d.value) return;
647
656
  let e = [
648
657
  "mousemove",
649
658
  "click",
@@ -653,67 +662,70 @@ var _hoisted_1$4 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
653
662
  ], t = () => {
654
663
  Q();
655
664
  };
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);
665
+ for (let n of e) d.value.addEventListener(n, t, { passive: !0 });
666
+ H = () => {
667
+ if (d.value) for (let n of e) d.value.removeEventListener(n, t);
659
668
  };
660
669
  }
661
670
  function $() {
662
- g.value = window.innerWidth, _.value = window.innerHeight, J("viewport-resize");
671
+ _.value = window.innerWidth, v.value = window.innerHeight, J("viewport-resize");
663
672
  }
664
- return watch(() => n.sidePanelPosition, (e) => {
665
- if (!D.value) {
666
- x.value = "none";
673
+ function Ce() {
674
+ _.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);
675
+ }
676
+ return t({ refresh: Ce }), watch(() => r.sidePanelPosition, (e) => {
677
+ if (!k.value) {
678
+ C.value = "none";
667
679
  return;
668
680
  }
669
- x.value = e, J("prop-sync");
670
- }, { immediate: !0 }), watch(D, (e) => {
681
+ C.value = e, J("prop-sync");
682
+ }, { immediate: !0 }), watch(k, (e) => {
671
683
  if (!e) {
672
- x.value = "none", S.value = "none", C.value = [], K();
684
+ C.value = "none", w.value = "none", T.value = [], q();
673
685
  return;
674
686
  }
675
- x.value = n.sidePanelPosition, J("slot-state-change", !0);
687
+ C.value = r.sidePanelPosition, J("slot-state-change", !0);
676
688
  }, { immediate: !0 }), watch(() => [
677
- A.value,
678
- n.autoHideTimeout,
679
- S.value
689
+ N.value,
690
+ r.autoHideTimeout,
691
+ w.value
680
692
  ], () => {
681
- if (S.value === "full") {
693
+ if (w.value === "full") {
682
694
  Z();
683
695
  return;
684
696
  }
685
697
  Q();
686
- }), watch(j, (e, t) => {
698
+ }), watch(P, (e, t) => {
687
699
  if (e) {
688
- T.value = !0, X();
700
+ D.value = !0, X();
689
701
  return;
690
702
  }
691
703
  t && Q();
692
704
  }), watch(() => [
693
- y.value,
694
705
  b.value,
695
- S.value,
696
- D.value
706
+ x.value,
707
+ w.value,
708
+ k.value
697
709
  ], () => {
698
- !D.value || S.value === "none" || r("defaultSlotResize", {
699
- width: y.value,
700
- height: b.value
710
+ !k.value || w.value === "none" || i("defaultSlotResize", {
711
+ width: b.value,
712
+ height: x.value
701
713
  });
702
714
  }), 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);
715
+ O.value = !0, $(), window.addEventListener("resize", $), Se(), Q(), await nextTick(), z = new ResizeObserver(() => {
716
+ y.value = p.value?.offsetHeight ?? 0, b.value = g.value?.offsetWidth ?? 0, x.value = g.value?.offsetHeight ?? 0, S(), J("slot-measure");
717
+ }), 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
718
  }), onBeforeUnmount(() => {
707
- window.removeEventListener("resize", $), V?.(), V = null, R?.disconnect(), R = null, X(), z &&= (clearTimeout(z), void 0);
708
- }), (t, r) => (openBlock(), createElementBlock("section", {
719
+ window.removeEventListener("resize", $), H?.(), H = null, z?.disconnect(), z = null, X(), B &&= (clearTimeout(B), void 0);
720
+ }), (t, n) => (openBlock(), createElementBlock("section", {
709
721
  ref_key: "rootRef",
710
- ref: a,
722
+ ref: d,
711
723
  class: "bg-black text-neutral-100",
712
- style: normalizeStyle({ ...pe.value })
713
- }, [O.value ? withDirectives((openBlock(), createElementBlock("header", {
724
+ style: normalizeStyle({ ...me.value })
725
+ }, [A.value ? withDirectives((openBlock(), createElementBlock("header", {
714
726
  key: 0,
715
727
  ref_key: "headerRef",
716
- ref: d,
728
+ ref: p,
717
729
  class: "",
718
730
  style: {
719
731
  position: "relative",
@@ -722,15 +734,15 @@ var _hoisted_1$4 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
722
734
  zIndex: 40
723
735
  }
724
736
  }, [(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)]),
737
+ 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
738
  _: 1
727
- })), createElementVNode("div", _hoisted_1, [renderSlot(t.$slots, "header")])], 512)), [[vShow, he.value]]) : createCommentVNode("", !0), createElementVNode("article", {
739
+ })), createElementVNode("div", _hoisted_1, [renderSlot(t.$slots, "header")])], 512)), [[vShow, ge.value]]) : createCommentVNode("", !0), createElementVNode("article", {
728
740
  class: "",
729
- style: normalizeStyle({ ...me.value })
741
+ style: normalizeStyle({ ...he.value })
730
742
  }, [
731
743
  createElementVNode("main", {
732
744
  ref_key: "defaultRef",
733
- ref: p,
745
+ ref: g,
734
746
  class: "slot-content-container",
735
747
  style: normalizeStyle({
736
748
  position: "relative",
@@ -744,34 +756,34 @@ var _hoisted_1$4 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
744
756
  gridColumn: "1 / 2",
745
757
  gridRow: "1 / 2",
746
758
  zIndex: 0,
747
- ...de.value
759
+ ...fe.value
748
760
  })
749
761
  }, [renderSlot(t.$slots, "default")], 4),
750
- I.value ? (openBlock(), createElementBlock("div", {
762
+ L.value ? (openBlock(), createElementBlock("div", {
751
763
  key: 0,
752
764
  class: "bg-black",
753
765
  style: normalizeStyle({
754
- ...I.value,
766
+ ...L.value,
755
767
  gridColumn: "1 / 2",
756
768
  gridRow: "1 / 2"
757
769
  })
758
770
  }, null, 4)) : createCommentVNode("", !0),
759
- D.value && S.value !== "none" ? (openBlock(), createElementBlock("div", {
771
+ k.value && w.value !== "none" ? (openBlock(), createElementBlock("div", {
760
772
  key: 1,
761
773
  class: "",
762
- style: normalizeStyle(fe.value)
774
+ style: normalizeStyle(pe.value)
763
775
  }, [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,
776
+ "side-panel-mode": C.value,
777
+ "side-panel-mode-resolved": w.value,
778
+ "available-states": j.value,
779
+ "overlay-only": N.value,
768
780
  "hide-icons": e.hideSidePanelIcons,
769
781
  "min-width": e.sidePanelMinRight,
770
- "max-width": M.value,
771
- "min-height": ue.value,
772
- "max-height": F.value,
782
+ "max-width": re.value,
783
+ "min-height": de.value,
784
+ "max-height": I.value,
773
785
  onSetSidePanelMode: Y,
774
- onCloseSidePanel: ye
786
+ onCloseSidePanel: xe
775
787
  }, {
776
788
  default: withCtx(() => [renderSlot(t.$slots, "sidePanelContent")]),
777
789
  _: 3
@@ -788,7 +800,7 @@ var _hoisted_1$4 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
788
800
  ])], 4)) : createCommentVNode("", !0)
789
801
  ], 4)], 4));
790
802
  }
791
- }), [["__scopeId", "data-v-6d5f1013"]]), LoggedInOut_default = /* @__PURE__ */ defineComponent({
803
+ }), [["__scopeId", "data-v-3fd50542"]]), LoggedInOut_default = /* @__PURE__ */ defineComponent({
792
804
  __name: "LoggedInOut",
793
805
  props: {
794
806
  initiallyLoggedIn: { type: Boolean },
@@ -832,5 +844,62 @@ var _hoisted_1$4 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
832
844
  setLoggedIn: f
833
845
  }), (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
846
  }
847
+ }), VanillaIf_default = /* @__PURE__ */ defineComponent({
848
+ __name: "VanillaIf",
849
+ props: { show: { type: [
850
+ Boolean,
851
+ Function,
852
+ Object
853
+ ] } },
854
+ setup(e) {
855
+ let t = e, n = ref(!1), r = ref(!1), i = null;
856
+ function o() {
857
+ i &&= (clearInterval(i), null);
858
+ }
859
+ function s() {
860
+ let e = unref(t.show);
861
+ if (typeof e == "function") try {
862
+ let t = e();
863
+ return typeof t == "boolean" ? {
864
+ ready: !0,
865
+ value: t
866
+ } : {
867
+ ready: !1,
868
+ value: !1
869
+ };
870
+ } catch (e) {
871
+ if (e instanceof ReferenceError || e instanceof TypeError) return {
872
+ ready: !1,
873
+ value: !1
874
+ };
875
+ throw e;
876
+ }
877
+ return typeof e == "boolean" ? {
878
+ ready: !0,
879
+ value: e
880
+ } : e == null ? {
881
+ ready: !1,
882
+ value: !1
883
+ } : {
884
+ ready: !0,
885
+ value: !!e
886
+ };
887
+ }
888
+ function c() {
889
+ let { ready: e, value: t } = s();
890
+ e ? (r.value = t, n.value = !0, o()) : i ||= setInterval(() => {
891
+ let e = s();
892
+ e.ready && (r.value = e.value, n.value = !0, o());
893
+ }, 50);
894
+ }
895
+ let l = s();
896
+ return l.ready && (n.value = !0, r.value = l.value), watch(() => t.show, () => {
897
+ n.value = !1, o(), c();
898
+ }, { deep: !0 }), onMounted(() => {
899
+ n.value || c();
900
+ }), onUnmounted(() => {
901
+ o();
902
+ }), (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);
903
+ }
835
904
  });
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 };
905
+ 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