playlight-sdk 0.0.9 → 0.1.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.
@@ -595,7 +595,7 @@ function flush_tasks() {
595
595
  N = [], run_all(e2);
596
596
  }();
597
597
  }
598
- let B = false, A = false, D = null, z = false, W = false;
598
+ let D = false, B = false, A = null, z = false, W = false;
599
599
  function set_is_destroying_effect(e2) {
600
600
  W = e2;
601
601
  }
@@ -645,14 +645,14 @@ function check_dirtiness(e2) {
645
645
  return false;
646
646
  }
647
647
  function handle_error(e2, t2, n2, o2) {
648
- if (B) {
649
- if (null === n2 && (B = false), /**
648
+ if (D) {
649
+ if (null === n2 && (D = false), /**
650
650
  * @param {Effect} effect
651
651
  */
652
652
  function should_rethrow_error(e3) {
653
653
  return !(e3.f & y || null !== e3.parent && e3.parent.f & p);
654
654
  }(t2)) throw e2;
655
- } else null !== n2 && (B = true), function propagate_error(e3, t3) {
655
+ } else null !== n2 && (D = true), function propagate_error(e3, t3) {
656
656
  for (var n3 = t3; null !== n3; ) {
657
657
  if (n3.f & p) try {
658
658
  return void n3.fn(e3);
@@ -661,7 +661,7 @@ function handle_error(e2, t2, n2, o2) {
661
661
  }
662
662
  n3 = n3.parent;
663
663
  }
664
- throw B = false, e3;
664
+ throw D = false, e3;
665
665
  }(e2, t2);
666
666
  }
667
667
  function schedule_possible_effect_self_invalidation(e2, t2, n2 = true) {
@@ -768,8 +768,8 @@ function infinite_loop_guard() {
768
768
  throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
769
769
  }();
770
770
  } catch (e2) {
771
- if (null === D) throw e2;
772
- handle_error(e2, D, null);
771
+ if (null === A) throw e2;
772
+ handle_error(e2, A, null);
773
773
  }
774
774
  }
775
775
  function flush_queued_root_effects() {
@@ -785,7 +785,7 @@ function flush_queued_root_effects() {
785
785
  }
786
786
  }
787
787
  } finally {
788
- A = false, z = e2, D = null;
788
+ B = false, z = e2, A = null;
789
789
  }
790
790
  }
791
791
  function flush_queued_effects(e2) {
@@ -811,8 +811,8 @@ function flush_queued_effects(e2) {
811
811
  }
812
812
  }
813
813
  function schedule_effect(e2) {
814
- A || (A = true, queueMicrotask(flush_queued_root_effects));
815
- for (var t2 = D = e2; null !== t2.parent; ) {
814
+ B || (B = true, queueMicrotask(flush_queued_root_effects));
815
+ for (var t2 = A = e2; null !== t2.parent; ) {
816
816
  var n2 = (t2 = t2.parent).f;
817
817
  if (96 & n2) {
818
818
  if (!(n2 & g)) return;
@@ -852,7 +852,7 @@ async function tick() {
852
852
  await Promise.resolve(), // By calling flushSync we guarantee that any pending state changes are applied after one tick.
853
853
  // TODO look into whether we can make flushing subsequent updates synchronously in the future.
854
854
  function flushSync(e2) {
855
- for (flush_tasks(); L.length > 0; ) A = true, flush_queued_root_effects(), flush_tasks();
855
+ for (flush_tasks(); L.length > 0; ) B = true, flush_queued_root_effects(), flush_tasks();
856
856
  }();
857
857
  }
858
858
  function get$1(e2) {
@@ -2623,7 +2623,7 @@ const je = function toastFunction(e2, t2) {
2623
2623
  dismiss: Ee.dismiss,
2624
2624
  loading: Ee.loading
2625
2625
  });
2626
- var Be = /* @__PURE__ */ template('<button aria-label="Close toast" data-close-button=""><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg></button>'), Ae = /* @__PURE__ */ template('<div data-icon=""><!> <!></div>'), De = /* @__PURE__ */ template('<div data-title=""><!></div>'), ze = /* @__PURE__ */ template('<div data-description=""><!></div>'), We = /* @__PURE__ */ template('<button data-button="" data-cancel=""> </button>'), Le = /* @__PURE__ */ template('<button data-button=""> </button>'), Fe = /* @__PURE__ */ template('<!> <div data-content=""><!> <!></div> <!> <!>', 1), Ge = /* @__PURE__ */ template('<li aria-atomic="true" role="status" data-sonner-toast=""><!> <!></li>');
2626
+ var De = /* @__PURE__ */ template('<button aria-label="Close toast" data-close-button=""><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg></button>'), Be = /* @__PURE__ */ template('<div data-icon=""><!> <!></div>'), Ae = /* @__PURE__ */ template('<div data-title=""><!></div>'), ze = /* @__PURE__ */ template('<div data-description=""><!></div>'), We = /* @__PURE__ */ template('<button data-button="" data-cancel=""> </button>'), Le = /* @__PURE__ */ template('<button data-button=""> </button>'), Fe = /* @__PURE__ */ template('<!> <div data-content=""><!> <!></div> <!> <!>', 1), Ge = /* @__PURE__ */ template('<li aria-atomic="true" role="status" data-sonner-toast=""><!> <!></li>');
2627
2627
  function Toast(e2, t2) {
2628
2628
  const n2 = legacy_rest_props(t2, ["children", "$$slots", "$$events", "$$legacy"]);
2629
2629
  push(t2, false);
@@ -2643,7 +2643,7 @@ function Toast(e2, t2) {
2643
2643
  info: "",
2644
2644
  loading: ""
2645
2645
  }, { toasts: b2, heights: y2, removeHeight: $2, setHeight: w2, remove: x2 } = Ee;
2646
- let k2 = prop(t2, "toast", 9), C2 = prop(t2, "index", 9), S2 = prop(t2, "expanded", 9), M2 = prop(t2, "invert", 13), q2 = prop(t2, "position", 9), I2 = prop(t2, "visibleToasts", 9), P2 = prop(t2, "expandByDefault", 9), T2 = prop(t2, "closeButton", 9), O2 = prop(t2, "interacting", 9), E2 = prop(t2, "cancelButtonStyle", 9, ""), j2 = prop(t2, "actionButtonStyle", 9, ""), N2 = prop(t2, "duration", 9, 4e3), B2 = prop(t2, "descriptionClass", 9, ""), A2 = prop(t2, "classes", 29, () => ({})), D2 = prop(t2, "unstyled", 9, false), z2 = mutable_state(false, true), W2 = mutable_state(false, true), L2 = mutable_state(false, true), F2 = mutable_state(false, true), G2 = mutable_state(0, true), H2 = mutable_state(0, true), R2 = mutable_state(void 0, true), V2 = mutable_state(0, true), K2 = 0, U2 = 0, Z2 = null;
2646
+ let k2 = prop(t2, "toast", 9), C2 = prop(t2, "index", 9), S2 = prop(t2, "expanded", 9), M2 = prop(t2, "invert", 13), q2 = prop(t2, "position", 9), I2 = prop(t2, "visibleToasts", 9), P2 = prop(t2, "expandByDefault", 9), T2 = prop(t2, "closeButton", 9), O2 = prop(t2, "interacting", 9), E2 = prop(t2, "cancelButtonStyle", 9, ""), j2 = prop(t2, "actionButtonStyle", 9, ""), N2 = prop(t2, "duration", 9, 4e3), D2 = prop(t2, "descriptionClass", 9, ""), B2 = prop(t2, "classes", 29, () => ({})), A2 = prop(t2, "unstyled", 9, false), z2 = mutable_state(false, true), W2 = mutable_state(false, true), L2 = mutable_state(false, true), F2 = mutable_state(false, true), G2 = mutable_state(0, true), H2 = mutable_state(0, true), R2 = mutable_state(void 0, true), V2 = mutable_state(0, true), K2 = 0, U2 = 0, Z2 = null;
2647
2647
  function deleteToast() {
2648
2648
  set(W2, true), // Save the offset for the exit swipe animation
2649
2649
  set(G2, get$1(V2)), $2(k2().id), setTimeout(() => {
@@ -2666,10 +2666,10 @@ function Toast(e2, t2) {
2666
2666
  toastId: k2().id,
2667
2667
  height: e3
2668
2668
  }), () => $2(k2().id);
2669
- }), legacy_pre_effect(() => deep_read_state(A2()), () => {
2670
- A2({
2669
+ }), legacy_pre_effect(() => deep_read_state(B2()), () => {
2670
+ B2({
2671
2671
  ...m2,
2672
- ...A2()
2672
+ ...B2()
2673
2673
  });
2674
2674
  }), legacy_pre_effect(() => deep_read_state(C2()), () => {
2675
2675
  set(s2, 0 === C2());
@@ -2751,12 +2751,12 @@ function Toast(e2, t2) {
2751
2751
  let te2;
2752
2752
  set_attribute(ee2, "tabindex", 0);
2753
2753
  var ne2 = child(ee2), consequent = (e3) => {
2754
- var t3 = Be();
2754
+ var t3 = De();
2755
2755
  template_effect((e4) => {
2756
2756
  set_attribute(t3, "data-disabled", get$1(g2)), set_class(t3, 1, e4);
2757
2757
  }, [() => {
2758
2758
  var _a2, _b2, _c2;
2759
- return clsx(cn((_a2 = A2()) == null ? void 0 : _a2.closeButton, (_c2 = (_b2 = k2()) == null ? void 0 : _b2.classes) == null ? void 0 : _c2.closeButton));
2759
+ return clsx(cn((_a2 = B2()) == null ? void 0 : _a2.closeButton, (_c2 = (_b2 = k2()) == null ? void 0 : _b2.classes) == null ? void 0 : _c2.closeButton));
2760
2760
  }], derived_safe_equal), event("click", t3, function(...e4) {
2761
2761
  var _a2;
2762
2762
  (_a2 = get$1(g2) ? void 0 : () => {
@@ -2779,7 +2779,7 @@ function Toast(e2, t2) {
2779
2779
  }), append(e3, t3);
2780
2780
  }, alternate = (e3) => {
2781
2781
  var n3 = Fe(), o3 = first_child(n3), consequent_8 = (e4) => {
2782
- var n4 = Ae(), o4 = child(n4), consequent_2 = (e5) => {
2782
+ var n4 = Be(), o4 = child(n4), consequent_2 = (e5) => {
2783
2783
  var n5 = comment();
2784
2784
  slot(first_child(n5), t2, "loading-icon", {}, null), append(e5, n5);
2785
2785
  };
@@ -2832,7 +2832,7 @@ function Toast(e2, t2) {
2832
2832
  ("default" !== get$1(u2) || k2().icon || k2().promise) && e4(consequent_8);
2833
2833
  });
2834
2834
  var i3 = sibling(o3, 2), s3 = child(i3), consequent_10 = (e4) => {
2835
- var t3 = De(), n4 = child(t3), consequent_9 = (e5) => {
2835
+ var t3 = Ae(), n4 = child(t3), consequent_9 = (e5) => {
2836
2836
  var t4 = comment();
2837
2837
  component(first_child(t4), () => k2().title, (e6, t5) => {
2838
2838
  t5(e6, spread_props(() => k2().componentProps));
@@ -2845,7 +2845,7 @@ function Toast(e2, t2) {
2845
2845
  "string" != typeof k2().title ? e5(consequent_9) : e5(alternate_5, false);
2846
2846
  }), template_effect((e5) => set_class(t3, 1, e5), [() => {
2847
2847
  var _a2, _b2, _c2;
2848
- return clsx(cn((_a2 = A2()) == null ? void 0 : _a2.title, (_c2 = (_b2 = k2()) == null ? void 0 : _b2.classes) == null ? void 0 : _c2.title));
2848
+ return clsx(cn((_a2 = B2()) == null ? void 0 : _a2.title, (_c2 = (_b2 = k2()) == null ? void 0 : _b2.classes) == null ? void 0 : _c2.title));
2849
2849
  }], derived_safe_equal), append(e4, t3);
2850
2850
  };
2851
2851
  if_block(s3, (e4) => {
@@ -2865,7 +2865,7 @@ function Toast(e2, t2) {
2865
2865
  "string" != typeof k2().description ? e5(consequent_11) : e5(alternate_6, false);
2866
2866
  }), template_effect((e5) => set_class(t3, 1, e5), [() => {
2867
2867
  var _a2, _b2;
2868
- return clsx(cn(B2(), get$1(d2), (_a2 = A2()) == null ? void 0 : _a2.description, (_b2 = k2().classes) == null ? void 0 : _b2.description));
2868
+ return clsx(cn(D2(), get$1(d2), (_a2 = B2()) == null ? void 0 : _a2.description, (_b2 = k2().classes) == null ? void 0 : _b2.description));
2869
2869
  }], derived_safe_equal), append(e4, t3);
2870
2870
  };
2871
2871
  if_block(a3, (e4) => {
@@ -2877,7 +2877,7 @@ function Toast(e2, t2) {
2877
2877
  set_style(t3, E2()), set_class(t3, 1, e5), set_text(n4, k2().cancel.label);
2878
2878
  }, [() => {
2879
2879
  var _a2, _b2, _c2;
2880
- return clsx(cn((_a2 = A2()) == null ? void 0 : _a2.cancelButton, (_c2 = (_b2 = k2()) == null ? void 0 : _b2.classes) == null ? void 0 : _c2.cancelButton));
2880
+ return clsx(cn((_a2 = B2()) == null ? void 0 : _a2.cancelButton, (_c2 = (_b2 = k2()) == null ? void 0 : _b2.classes) == null ? void 0 : _c2.cancelButton));
2881
2881
  }], derived_safe_equal), event("click", t3, () => {
2882
2882
  var _a2;
2883
2883
  deleteToast(), ((_a2 = k2().cancel) == null ? void 0 : _a2.onClick) && k2().cancel.onClick();
@@ -2892,7 +2892,7 @@ function Toast(e2, t2) {
2892
2892
  set_style(t3, j2()), set_class(t3, 1, e5), set_text(n4, k2().action.label);
2893
2893
  }, [() => {
2894
2894
  var _a2, _b2, _c2;
2895
- return clsx(cn((_a2 = A2()) == null ? void 0 : _a2.actionButton, (_c2 = (_b2 = k2()) == null ? void 0 : _b2.classes) == null ? void 0 : _c2.actionButton));
2895
+ return clsx(cn((_a2 = B2()) == null ? void 0 : _a2.actionButton, (_c2 = (_b2 = k2()) == null ? void 0 : _b2.classes) == null ? void 0 : _c2.actionButton));
2896
2896
  }], derived_safe_equal), event("click", t3, (e5) => {
2897
2897
  var _a2;
2898
2898
  (_a2 = k2().action) == null ? void 0 : _a2.onClick(e5), e5.defaultPrevented || deleteToast();
@@ -2906,7 +2906,7 @@ function Toast(e2, t2) {
2906
2906
  k2().component ? e3(consequent_1) : e3(alternate, false);
2907
2907
  }), bind_this(ee2, (e3) => set(R2, e3), () => get$1(R2)), template_effect((e3, t3, i3) => {
2908
2908
  var _a2;
2909
- set_attribute(ee2, "aria-live", k2().important ? "assertive" : "polite"), set_class(ee2, 1, e3), set_attribute(ee2, "data-styled", !(k2().component || ((_a2 = k2()) == null ? void 0 : _a2.unstyled) || D2())), set_attribute(ee2, "data-mounted", get$1(z2)), set_attribute(ee2, "data-promise", t3), set_attribute(ee2, "data-removed", get$1(W2)), set_attribute(ee2, "data-visible", get$1(a2)), set_attribute(ee2, "data-y-position", get$1(_2)[0]), set_attribute(ee2, "data-x-position", get$1(_2)[1]), set_attribute(ee2, "data-index", C2()), set_attribute(ee2, "data-front", get$1(s2)), set_attribute(ee2, "data-swiping", get$1(L2)), set_attribute(ee2, "data-type", get$1(u2)), set_attribute(ee2, "data-invert", M2()), set_attribute(ee2, "data-swipe-out", get$1(F2)), set_attribute(ee2, "data-expanded", i3), te2 = set_style(ee2, `${n2.style} ${k2().style}`, te2, {
2909
+ set_attribute(ee2, "aria-live", k2().important ? "assertive" : "polite"), set_class(ee2, 1, e3), set_attribute(ee2, "data-styled", !(k2().component || ((_a2 = k2()) == null ? void 0 : _a2.unstyled) || A2())), set_attribute(ee2, "data-mounted", get$1(z2)), set_attribute(ee2, "data-promise", t3), set_attribute(ee2, "data-removed", get$1(W2)), set_attribute(ee2, "data-visible", get$1(a2)), set_attribute(ee2, "data-y-position", get$1(_2)[0]), set_attribute(ee2, "data-x-position", get$1(_2)[1]), set_attribute(ee2, "data-index", C2()), set_attribute(ee2, "data-front", get$1(s2)), set_attribute(ee2, "data-swiping", get$1(L2)), set_attribute(ee2, "data-type", get$1(u2)), set_attribute(ee2, "data-invert", M2()), set_attribute(ee2, "data-swipe-out", get$1(F2)), set_attribute(ee2, "data-expanded", i3), te2 = set_style(ee2, `${n2.style} ${k2().style}`, te2, {
2910
2910
  "--index": C2(),
2911
2911
  "--toasts-before": C2(),
2912
2912
  "--z-index": store_get(b2, "$toasts", o2).length - C2(),
@@ -2915,7 +2915,7 @@ function Toast(e2, t2) {
2915
2915
  });
2916
2916
  }, [() => {
2917
2917
  var _a2, _b2, _c2, _d, _e2, _f;
2918
- return clsx(cn(n2.class, get$1(f2), (_a2 = A2()) == null ? void 0 : _a2.toast, (_c2 = (_b2 = k2()) == null ? void 0 : _b2.classes) == null ? void 0 : _c2.toast, (_d = A2()) == null ? void 0 : _d[get$1(u2)], (_f = (_e2 = k2()) == null ? void 0 : _e2.classes) == null ? void 0 : _f[get$1(u2)]));
2918
+ return clsx(cn(n2.class, get$1(f2), (_a2 = B2()) == null ? void 0 : _a2.toast, (_c2 = (_b2 = k2()) == null ? void 0 : _b2.classes) == null ? void 0 : _c2.toast, (_d = B2()) == null ? void 0 : _d[get$1(u2)], (_f = (_e2 = k2()) == null ? void 0 : _e2.classes) == null ? void 0 : _f[get$1(u2)]));
2919
2919
  }, () => Boolean(k2().promise), () => Boolean(S2() || P2() && get$1(z2))], derived_safe_equal), event("pointerdown", ee2, function onPointerDown(e3) {
2920
2920
  if (get$1(g2)) return;
2921
2921
  set(G2, get$1(V2));
@@ -3710,7 +3710,7 @@ function DiscoveryOverlay(e2, t2) {
3710
3710
  })), append(e2, m2), pop(), o2();
3711
3711
  }
3712
3712
  delegate(["click"]);
3713
- var ft = /* @__PURE__ */ template('<div class="fixed top-0 left-0 right-0 h-2 z-99990"></div>');
3713
+ var ft = /* @__PURE__ */ template('<div class="fixed top-0 right-0 left-0 z-99990 h-2"></div>');
3714
3714
  delegate(["mouseover"]);
3715
3715
  var dt = /* @__PURE__ */ template("<!> <!> <!> <!>", 1);
3716
3716
  function App(e2, t2) {
@@ -3752,22 +3752,17 @@ function App(e2, t2) {
3752
3752
  });
3753
3753
  !function ExitIntentDetector(e3, t3) {
3754
3754
  push(t3, true);
3755
- let n3, o3 = prop(t3, "enabled", 3, true), i3 = false;
3755
+ let n3, o3 = prop(t3, "enabled", 3, true), i3 = 0;
3756
3756
  onMount(() => {
3757
3757
  "undefined" != typeof window && (n3 = window.innerHeight);
3758
3758
  });
3759
3759
  var s3 = ft();
3760
- event("mouseleave", P, () => {
3761
- i3 = false;
3762
- }), event("mousemove", P, (e4) => {
3763
- const t4 = e4.clientY;
3764
- if (!i3) return i3 = true, void (n3 = t4);
3765
- n3 = t4;
3760
+ event("mousemove", P, (e4) => {
3761
+ n3 = e4.clientY, i3 = Date.now();
3766
3762
  }), s3.__mouseover = (e4) => {
3767
3763
  var _a3;
3768
- const s4 = e4.clientY;
3769
- s4 < n3 && i3 && o3() && !localStorage.getItem("playlight_exit_intent_disabled_by_user") && ((_a3 = t3.onIntent) == null ? void 0 : _a3.call(t3)), // Update lastMouseY after checking
3770
- n3 = s4;
3764
+ const s4 = e4.clientY, a3 = Date.now();
3765
+ s4 < n3 && a3 - i3 < 100 && o3() && !localStorage.getItem("playlight_exit_intent_disabled_by_user") && ((_a3 = t3.onIntent) == null ? void 0 : _a3.call(t3));
3771
3766
  }, append(e3, s3), pop();
3772
3767
  }(u2, {
3773
3768
  get enabled() {