layerchart 2.0.0-next.29 → 2.0.0-next.30
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/components/AnnotationPoint.svelte +16 -9
- package/dist/components/TransformControls.svelte +16 -20
- package/dist/components/index.js +1 -1
- package/dist/components/tooltip/TooltipContext.svelte +5 -1
- package/dist/components/tooltip/TooltipContext.svelte.d.ts +1 -1
- package/dist/docs/Blockquote.svelte +3 -3
- package/dist/docs/Preview.svelte +6 -3
- package/dist/docs/ViewSourceButton.svelte +2 -2
- package/package.json +2 -3
|
@@ -88,23 +88,30 @@
|
|
|
88
88
|
? 'start'
|
|
89
89
|
: 'middle',
|
|
90
90
|
});
|
|
91
|
-
</script>
|
|
92
91
|
|
|
93
|
-
|
|
94
|
-
cx={point.x}
|
|
95
|
-
cy={point.y}
|
|
96
|
-
{r}
|
|
97
|
-
onpointermove={(e) => {
|
|
92
|
+
function onPointerMove(e: PointerEvent | MouseEvent | TouchEvent) {
|
|
98
93
|
if (details) {
|
|
99
94
|
e.stopPropagation();
|
|
100
95
|
ctx.tooltip.show(e, { annotation: { label, details } });
|
|
101
96
|
}
|
|
102
|
-
}
|
|
103
|
-
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function onPointerLeave(e: PointerEvent | MouseEvent | TouchEvent) {
|
|
104
100
|
if (details) {
|
|
101
|
+
e.stopPropagation();
|
|
105
102
|
ctx.tooltip.hide();
|
|
106
103
|
}
|
|
107
|
-
}
|
|
104
|
+
}
|
|
105
|
+
</script>
|
|
106
|
+
|
|
107
|
+
<Circle
|
|
108
|
+
cx={point.x}
|
|
109
|
+
cy={point.y}
|
|
110
|
+
{r}
|
|
111
|
+
onmousemove={onPointerMove}
|
|
112
|
+
ontouchmove={onPointerMove}
|
|
113
|
+
onmouseleave={onPointerLeave}
|
|
114
|
+
ontouchend={onPointerLeave}
|
|
108
115
|
{...props?.circle}
|
|
109
116
|
class={cls('stroke-surface-100', props?.circle?.class)}
|
|
110
117
|
/>
|
|
@@ -34,18 +34,14 @@
|
|
|
34
34
|
import { Button, Icon, MenuButton, Tooltip } from 'svelte-ux';
|
|
35
35
|
import { cls } from '@layerstack/tailwind';
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
import
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
mdiResize,
|
|
46
|
-
mdiArrowExpandAll,
|
|
47
|
-
mdiCancel,
|
|
48
|
-
} from '@mdi/js';
|
|
37
|
+
import LucideFocus from '~icons/lucide/focus';
|
|
38
|
+
import LucideChevronDown from '~icons/lucide/chevron-down';
|
|
39
|
+
import LucideCircleOff from '~icons/lucide/circle-off';
|
|
40
|
+
import LucideImageUpscale from '~icons/lucide/image-upscale';
|
|
41
|
+
import LucideMove from '~icons/lucide/move';
|
|
42
|
+
import LucideUndo2 from '~icons/lucide/undo-2';
|
|
43
|
+
import LucideZoomIn from '~icons/lucide/zoom-in';
|
|
44
|
+
import LucideZoomOut from '~icons/lucide/zoom-out';
|
|
49
45
|
|
|
50
46
|
import { getTransformContext } from './TransformContext.svelte';
|
|
51
47
|
import type { Without } from '../utils/types.js';
|
|
@@ -113,7 +109,7 @@
|
|
|
113
109
|
{#if show.includes('zoomIn')}
|
|
114
110
|
<Tooltip title="Zoom in">
|
|
115
111
|
<Button
|
|
116
|
-
icon={
|
|
112
|
+
icon={LucideZoomIn}
|
|
117
113
|
on:click={() => transform.zoomIn()}
|
|
118
114
|
{size}
|
|
119
115
|
class="text-surface-content p-2"
|
|
@@ -124,7 +120,7 @@
|
|
|
124
120
|
{#if show.includes('zoomOut')}
|
|
125
121
|
<Tooltip title="Zoom out">
|
|
126
122
|
<Button
|
|
127
|
-
icon={
|
|
123
|
+
icon={LucideZoomOut}
|
|
128
124
|
on:click={() => transform.zoomOut()}
|
|
129
125
|
{size}
|
|
130
126
|
class="text-surface-content p-2"
|
|
@@ -135,7 +131,7 @@
|
|
|
135
131
|
{#if show.includes('center')}
|
|
136
132
|
<Tooltip title="Center">
|
|
137
133
|
<Button
|
|
138
|
-
icon={
|
|
134
|
+
icon={LucideFocus}
|
|
139
135
|
on:click={() => transform.translateCenter()}
|
|
140
136
|
{size}
|
|
141
137
|
class="text-surface-content p-2"
|
|
@@ -146,7 +142,7 @@
|
|
|
146
142
|
{#if show.includes('reset')}
|
|
147
143
|
<Tooltip title="Reset">
|
|
148
144
|
<Button
|
|
149
|
-
icon={
|
|
145
|
+
icon={LucideUndo2}
|
|
150
146
|
on:click={() => transform.reset()}
|
|
151
147
|
{size}
|
|
152
148
|
class="text-surface-content p-2"
|
|
@@ -159,9 +155,9 @@
|
|
|
159
155
|
<MenuButton
|
|
160
156
|
iconOnly
|
|
161
157
|
options={[
|
|
162
|
-
{ label: 'None', value: 'none', icon:
|
|
163
|
-
{ label: 'Zoom', value: 'scale', icon:
|
|
164
|
-
{ label: 'Move', value: 'translate', icon:
|
|
158
|
+
{ label: 'None', value: 'none', icon: LucideCircleOff },
|
|
159
|
+
{ label: 'Zoom', value: 'scale', icon: LucideImageUpscale },
|
|
160
|
+
{ label: 'Move', value: 'translate', icon: LucideMove },
|
|
165
161
|
]}
|
|
166
162
|
menuProps={{ placement: menuPlacementByOrientationAndPlacement[orientation][placement] }}
|
|
167
163
|
menuIcon={null}
|
|
@@ -171,7 +167,7 @@
|
|
|
171
167
|
class="text-surface-content"
|
|
172
168
|
>
|
|
173
169
|
<svelte:fragment slot="selection" let:value>
|
|
174
|
-
<Icon data={value?.icon ??
|
|
170
|
+
<Icon data={value?.icon ?? LucideChevronDown} />
|
|
175
171
|
</svelte:fragment>
|
|
176
172
|
</MenuButton>
|
|
177
173
|
</Tooltip>
|
package/dist/components/index.js
CHANGED
|
@@ -128,7 +128,7 @@ export * as Tooltip from './tooltip/index.js';
|
|
|
128
128
|
export * from './tooltip/TooltipContext.svelte';
|
|
129
129
|
export { default as TransformContext } from './TransformContext.svelte';
|
|
130
130
|
export * from './TransformContext.svelte';
|
|
131
|
-
// export { default as TransformControls } from './TransformControls.svelte'; // TODO: Restore once no longer using `
|
|
131
|
+
// export { default as TransformControls } from './TransformControls.svelte'; // TODO: Restore once no longer using `svelte-ux` or `~icons` (as they are dev dependencies)
|
|
132
132
|
export { default as Tree } from './Tree.svelte';
|
|
133
133
|
export * from './Tree.svelte';
|
|
134
134
|
export { default as Treemap } from './Treemap.svelte';
|
|
@@ -22,7 +22,11 @@
|
|
|
22
22
|
y: number;
|
|
23
23
|
data: T | null;
|
|
24
24
|
payload: TooltipPayload[];
|
|
25
|
-
show(
|
|
25
|
+
show(
|
|
26
|
+
e: PointerEvent | MouseEvent | TouchEvent,
|
|
27
|
+
tooltipData?: any,
|
|
28
|
+
payload?: TooltipPayload
|
|
29
|
+
): void;
|
|
26
30
|
hide(e?: PointerEvent): void;
|
|
27
31
|
mode: TooltipMode;
|
|
28
32
|
isHoveringTooltipArea: boolean;
|
|
@@ -6,7 +6,7 @@ export type TooltipContextValue<T = any> = {
|
|
|
6
6
|
y: number;
|
|
7
7
|
data: T | null;
|
|
8
8
|
payload: TooltipPayload[];
|
|
9
|
-
show(e: PointerEvent, tooltipData?: any, payload?: TooltipPayload): void;
|
|
9
|
+
show(e: PointerEvent | MouseEvent | TouchEvent, tooltipData?: any, payload?: TooltipPayload): void;
|
|
10
10
|
hide(e?: PointerEvent): void;
|
|
11
11
|
mode: TooltipMode;
|
|
12
12
|
isHoveringTooltipArea: boolean;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { mdiInformation } from '@mdi/js';
|
|
3
|
-
import { Icon } from 'svelte-ux';
|
|
4
2
|
import { cls } from '@layerstack/tailwind';
|
|
5
3
|
|
|
4
|
+
import LucideInfo from '~icons/lucide/info';
|
|
5
|
+
|
|
6
6
|
const { children } = $props();
|
|
7
7
|
</script>
|
|
8
8
|
|
|
@@ -12,6 +12,6 @@
|
|
|
12
12
|
'[&>a]:font-medium [&>a]:underline [&>a]:decoration-dashed [&>a]:decoration-primary/50 [&>a]:underline-offset-2'
|
|
13
13
|
)}
|
|
14
14
|
>
|
|
15
|
-
<
|
|
15
|
+
<LucideInfo class="text-primary" />
|
|
16
16
|
{@render children()}
|
|
17
17
|
</div>
|
package/dist/docs/Preview.svelte
CHANGED
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
// TODO: No longer copy from svelte-ux after prismjs is migrated to ESM (commonjs causes issue with Vite from another library)
|
|
4
4
|
import Prism from 'prismjs';
|
|
5
5
|
import 'prism-svelte';
|
|
6
|
-
|
|
6
|
+
|
|
7
|
+
import LucideCode from '~icons/lucide/code';
|
|
8
|
+
import LucideTable from '~icons/lucide/table';
|
|
7
9
|
|
|
8
10
|
import { Button, CopyButton, Dialog, Toggle, Tooltip } from 'svelte-ux';
|
|
9
11
|
import { cls } from '@layerstack/tailwind';
|
|
@@ -68,7 +70,7 @@
|
|
|
68
70
|
|
|
69
71
|
{#if code}
|
|
70
72
|
<Button
|
|
71
|
-
icon={
|
|
73
|
+
icon={LucideCode}
|
|
72
74
|
class="text-surface-content/70 py-1"
|
|
73
75
|
on:click={() => (showCode = !showCode)}
|
|
74
76
|
>
|
|
@@ -78,7 +80,8 @@
|
|
|
78
80
|
|
|
79
81
|
{#if data}
|
|
80
82
|
<Toggle let:on={open} let:toggle let:toggleOff>
|
|
81
|
-
<Button icon={
|
|
83
|
+
<Button icon={LucideTable} class="text-surface-content/70 py-1" on:click={toggle}
|
|
84
|
+
>View data</Button
|
|
82
85
|
>
|
|
83
86
|
<Dialog
|
|
84
87
|
{open}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { ComponentProps } from 'svelte';
|
|
3
3
|
import { Button, Dialog, Toggle, Tooltip } from 'svelte-ux';
|
|
4
|
-
import
|
|
4
|
+
import LucideGithub from '~icons/lucide/github.svelte';
|
|
5
5
|
|
|
6
6
|
import Code from './Code.svelte';
|
|
7
7
|
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
{#if href}
|
|
32
|
-
<Button icon={
|
|
32
|
+
<Button icon={LucideGithub} variant="fill-light" color="primary" {href} target="_blank">
|
|
33
33
|
View on Github
|
|
34
34
|
</Button>
|
|
35
35
|
{/if}
|
package/package.json
CHANGED
|
@@ -4,11 +4,10 @@
|
|
|
4
4
|
"author": "Sean Lynch <techniq35@gmail.com>",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "techniq/layerchart",
|
|
7
|
-
"version": "2.0.0-next.
|
|
7
|
+
"version": "2.0.0-next.30",
|
|
8
8
|
"devDependencies": {
|
|
9
9
|
"@changesets/cli": "^2.29.4",
|
|
10
10
|
"@iconify-json/lucide": "^1.2.48",
|
|
11
|
-
"@mdi/js": "^7.4.47",
|
|
12
11
|
"@rollup/plugin-dsv": "^3.0.5",
|
|
13
12
|
"@sveltejs/adapter-cloudflare": "^7.0.4",
|
|
14
13
|
"@sveltejs/kit": "^2.21.5",
|
|
@@ -56,7 +55,7 @@
|
|
|
56
55
|
"svelte": "5.34.1",
|
|
57
56
|
"svelte-check": "^4.2.1",
|
|
58
57
|
"svelte-json-tree": "^2.2.0",
|
|
59
|
-
"svelte-ux": "2.0.0-next.
|
|
58
|
+
"svelte-ux": "2.0.0-next.14",
|
|
60
59
|
"svelte2tsx": "^0.7.39",
|
|
61
60
|
"tailwindcss": "^4.1.10",
|
|
62
61
|
"topojson-client": "^3.1.0",
|