@max-ts/svelte 1.12.2 → 1.12.3

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.
@@ -6,7 +6,7 @@ import * as $ from "svelte/internal/client";
6
6
  //#region src/components/Tooltip/Tooltip.svelte
7
7
  var root_5 = $.from_svg(`<svg viewBox="0 0 7.68 4.35" xmlns="http://www.w3.org/2000/svg"><path d="m 0.52372243,0.10910656 c -0.1676883,0 -0.3188698,0.10099765 -0.38304509,0.25594925 -0.0641698,0.1548964 -0.0287017,0.3332318 0.0898753,0.4518088 L 3.5473966,4.1337031 c 0.077725,0.07778 0.1832001,0.1214516 0.2931533,0.1214516 0.1099531,0 0.2154286,-0.043672 0.2932085,-0.1214516 L 7.4505968,0.81686461 c 0.118577,-0.118577 0.1540119,-0.2969124 0.089831,-0.4518088 C 7.476247,0.21010421 7.3251098,0.10910656 7.1573882,0.10910656 Z" fill="inherit"></path></svg>`);
8
8
  var root_2 = $.from_html(`<div role="tooltip" data-slot="tooltip-content"><!> <!></div>`);
9
- var root = $.from_html(`<span style="display: contents;" data-slot="tooltip-trigger"><!></span> <!>`, 1);
9
+ var root = $.from_html(`<!> <!>`, 1);
10
10
  function Tooltip($$anchor, $$props) {
11
11
  $.push($$props, true);
12
12
  let offset = $.prop($$props, "offset", 3, 10), placement = $.prop($$props, "placement", 3, "top"), arrow = $.prop($$props, "arrow", 3, false), delayDuration = $.prop($$props, "delayDuration", 3, 200);
@@ -24,12 +24,9 @@ function Tooltip($$anchor, $$props) {
24
24
  $.user_effect(() => () => store.destroy());
25
25
  var fragment = root();
26
26
  $.event("keydown", $.window, (e) => e.key === "Escape" && store.open && store.hide());
27
- var span = $.first_child(fragment);
28
- var node = $.child(span);
29
- $.snippet(node, () => $$props.children ?? $.noop);
30
- $.reset(span);
31
- $.attach(span, () => store.attachTrigger);
32
- var node_1 = $.sibling(span, 2);
27
+ var node = $.first_child(fragment);
28
+ $.snippet(node, () => $$props.children ?? $.noop, () => ({ attach: store.attachTrigger }));
29
+ var node_1 = $.sibling(node, 2);
33
30
  var consequent_2 = ($$anchor) => {
34
31
  Portal($$anchor, {
35
32
  children: ($$anchor, $$slotProps) => {
@@ -90,7 +87,6 @@ function Tooltip($$anchor, $$props) {
90
87
  $.if(node_1, ($$render) => {
91
88
  if (store.visible) $$render(consequent_2);
92
89
  });
93
- $.template_effect(() => $.set_class(span, 1, $.clsx($$props.class)));
94
90
  $.append($$anchor, fragment);
95
91
  $.pop();
96
92
  }
@@ -3,10 +3,11 @@ import type { Snippet } from 'svelte';
3
3
  export type TooltipProps = {
4
4
  delayDuration?: number;
5
5
  content?: Snippet<[]> | string;
6
- children?: Snippet<[]>;
6
+ children?: Snippet<[{
7
+ attach: (node: HTMLElement) => void;
8
+ }]>;
7
9
  arrow?: boolean;
8
10
  offset?: number;
9
- class?: string;
10
11
  arrowClass?: string;
11
12
  contentClass?: string;
12
13
  placement?: Placement;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@max-ts/svelte",
3
- "version": "1.12.2",
3
+ "version": "1.12.3",
4
4
  "type": "module",
5
5
  "description": "Svelte component library.",
6
6
  "author": "Tsepelev Maksim",