@connectorvol/tree 2.1.2 → 4.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.
Files changed (52) hide show
  1. package/dist/(classes)/chessTree.svelte.d.ts +83 -0
  2. package/dist/(classes)/chessTree.svelte.js +198 -0
  3. package/dist/(components)/DrillBreadcrumbs.svelte +135 -0
  4. package/dist/(components)/DrillBreadcrumbs.svelte.d.ts +20 -0
  5. package/dist/(components)/DrillForkSanLabel.svelte +26 -0
  6. package/dist/(components)/DrillForkSanLabel.svelte.d.ts +11 -0
  7. package/dist/(components)/DrillVariationList.svelte +65 -0
  8. package/dist/(components)/DrillVariationList.svelte.d.ts +15 -0
  9. package/dist/(components)/Move.svelte +242 -173
  10. package/dist/(components)/Move.svelte.d.ts +11 -5
  11. package/dist/(components)/MoveComment.svelte +32 -0
  12. package/dist/(components)/MoveComment.svelte.d.ts +11 -0
  13. package/dist/(components)/MoveContextMenu.svelte +73 -0
  14. package/dist/(components)/MoveContextMenu.svelte.d.ts +17 -0
  15. package/dist/(components)/MoveSanWithMenu.svelte +158 -0
  16. package/dist/(components)/MoveSanWithMenu.svelte.d.ts +42 -0
  17. package/dist/(components)/NagBadges.svelte +37 -0
  18. package/dist/(components)/NagBadges.svelte.d.ts +9 -0
  19. package/dist/(components)/TreeViewer.svelte +861 -42
  20. package/dist/(components)/TreeViewer.svelte.d.ts +29 -3
  21. package/dist/(components)/TreeViewerPanelManager.svelte +18 -155
  22. package/dist/(components)/VariantDropdownNavigator.svelte +173 -0
  23. package/dist/(components)/VariantDropdownNavigator.svelte.d.ts +16 -0
  24. package/dist/(components)/VariationGroup.svelte +100 -0
  25. package/dist/(components)/VariationGroup.svelte.d.ts +21 -0
  26. package/dist/(constants)/png.d.ts +1 -1
  27. package/dist/(constants)/png.js +2 -4
  28. package/dist/(models)/nagCatalog.d.ts +36 -0
  29. package/dist/(models)/nagCatalog.js +97 -0
  30. package/dist/(models)/pgnNodeCustomData.d.ts +3 -0
  31. package/dist/(utils)/context.d.ts +10 -3
  32. package/dist/(utils)/context.js +3 -14
  33. package/dist/(utils)/createPreviewHover.d.ts +19 -0
  34. package/dist/(utils)/createPreviewHover.js +37 -0
  35. package/dist/(utils)/nagBadgeStyle.d.ts +1 -0
  36. package/dist/(utils)/nagBadgeStyle.js +1 -0
  37. package/dist/(utils)/scrollToActiveMove.js +6 -5
  38. package/dist/(utils)/transformNag.d.ts +1 -1
  39. package/dist/(utils)/transformNag.js +1 -34
  40. package/dist/(utils)/transformPgnToChessNode.js +13 -0
  41. package/dist/(utils)/treeViewerPanelNavigation.svelte.d.ts +39 -0
  42. package/dist/(utils)/treeViewerPanelNavigation.svelte.js +257 -0
  43. package/dist/components/ui/button/button-variants.d.ts +65 -0
  44. package/dist/components/ui/button/button-variants.js +28 -0
  45. package/dist/components/ui/button/button.svelte +3 -43
  46. package/dist/components/ui/button/button.svelte.d.ts +1 -61
  47. package/dist/components/ui/button/index.d.ts +3 -2
  48. package/dist/components/ui/button/index.js +3 -4
  49. package/dist/components/ui/button-group/button-group-separator.svelte.d.ts +1 -1
  50. package/dist/index.d.ts +2 -1
  51. package/dist/index.js +2 -1
  52. package/package.json +4 -4
@@ -0,0 +1,257 @@
1
+ import { scrollToActiveMoveIfNeeded } from "./scrollToActiveMove.js";
2
+ import { scrollToStart } from "./scrollToStart.js";
3
+ const panelNavByChessTree = new WeakMap();
4
+ /**
5
+ * Представляет фабрику общего состояния навигации по дереву (кнопки панели и клавиши).
6
+ */
7
+ function createTreeViewerPanelNavigation(chessTree) {
8
+ let setChessFenImpl = (_fen) => { };
9
+ let setChessboardFenImpl = (_animationTime) => { };
10
+ /** Представляет привязку колбэков доски к актуальным функциям родительского экрана. */
11
+ function bindCallbacks(setChessFen, setChessboardFen) {
12
+ setChessFenImpl = setChessFen;
13
+ setChessboardFenImpl = setChessboardFen;
14
+ }
15
+ let highlightedButtons = $state({
16
+ previous: false,
17
+ next: false,
18
+ start: false,
19
+ end: false,
20
+ });
21
+ let isPlaying = $state(false);
22
+ let playInterval = null;
23
+ let variantNavigator = null;
24
+ /** Представляет установку ссылки на виджет выбора варианта (рендерится в TreeViewer). */
25
+ function setVariantNavigator(nav) {
26
+ variantNavigator = nav;
27
+ }
28
+ const isCurrentNodeInDrillHeader = () => {
29
+ const crumbs = chessTree.drillForkBreadcrumbs;
30
+ const currentNodeId = chessTree.currentNode.id;
31
+ return crumbs.some((crumb) => crumb.id === currentNodeId);
32
+ };
33
+ const requestDrillExitPrompt = () => {
34
+ chessTree.requestDrillExitPrompt();
35
+ };
36
+ /** Представляет выбор предыдущего узла по дереву. */
37
+ function selectPreviousNode() {
38
+ const parentNode = chessTree.getCurrentNodeParent();
39
+ if (parentNode) {
40
+ chessTree.currentNode = parentNode;
41
+ setChessFenImpl(parentNode.data.fen);
42
+ }
43
+ setChessboardFenImpl();
44
+ setTimeout(() => scrollToActiveMoveIfNeeded(), 50);
45
+ }
46
+ /** Представляет выбор дочернего узла и синхронизацию доски. */
47
+ function selectChildNode(childNode, animationTime = 0) {
48
+ chessTree.currentNode = childNode;
49
+ setChessFenImpl(childNode.data.fen);
50
+ setChessboardFenImpl(animationTime);
51
+ setTimeout(() => scrollToActiveMoveIfNeeded(), 50);
52
+ }
53
+ /** Представляет переход к следующему ходу (первый ребёнок). */
54
+ function selectNextNode(animationTime = 0) {
55
+ const childNode = chessTree.currentNode?.children?.[0];
56
+ if (childNode)
57
+ selectChildNode(childNode, animationTime);
58
+ else {
59
+ setChessboardFenImpl(animationTime);
60
+ setTimeout(() => scrollToActiveMoveIfNeeded(), 50);
61
+ }
62
+ }
63
+ /** Представляет переход к началу главной линии (корневому узлу). */
64
+ function stepToStart() {
65
+ chessTree.currentNode = chessTree.rootNode.moves;
66
+ setChessFenImpl(chessTree.rootNode.moves.data.fen);
67
+ setChessboardFenImpl();
68
+ highlightButton("start");
69
+ setTimeout(() => scrollToStart(), 50);
70
+ }
71
+ /** Представляет переход к концу главной линии. */
72
+ function stepToEnd() {
73
+ let currentNode = chessTree.currentNode;
74
+ while (currentNode.children && currentNode.children.length > 0) {
75
+ currentNode = currentNode.children[0];
76
+ }
77
+ chessTree.currentNode = currentNode;
78
+ setChessFenImpl(currentNode.data.fen);
79
+ setChessboardFenImpl();
80
+ highlightButton("end");
81
+ setTimeout(() => scrollToActiveMoveIfNeeded(), 50);
82
+ }
83
+ /** Представляет кратковременную подсветку кнопки навигации на панели. */
84
+ function highlightButton(button) {
85
+ highlightedButtons[button] = true;
86
+ setTimeout(() => {
87
+ highlightedButtons[button] = false;
88
+ }, 100);
89
+ }
90
+ /** Представляет запуск автопроигрывания ходов. */
91
+ function startAutoPlay() {
92
+ if (isPlaying || !chessTree.currentNode?.children?.length)
93
+ return;
94
+ isPlaying = true;
95
+ playInterval = setInterval(() => {
96
+ const hasNextNode = (chessTree.currentNode?.children?.length ?? 0) > 0;
97
+ if (hasNextNode) {
98
+ selectNextNode(1000);
99
+ }
100
+ else {
101
+ stopAutoPlay();
102
+ }
103
+ }, 1000);
104
+ }
105
+ /** Представляет остановку автопроигрывания ходов. */
106
+ function stopAutoPlay() {
107
+ isPlaying = false;
108
+ if (playInterval !== null) {
109
+ clearInterval(playInterval);
110
+ playInterval = null;
111
+ }
112
+ }
113
+ /** Представляет переключение автопроигрывания. */
114
+ function toggleAutoPlay() {
115
+ if (isPlaying) {
116
+ stopAutoPlay();
117
+ }
118
+ else {
119
+ startAutoPlay();
120
+ }
121
+ }
122
+ /**
123
+ * Представляет проверку: целевой узел остаётся внутри текущего drill-down (если он активен).
124
+ * Возвращает true, если drill-down не активен или target находится внутри ветки drillForkParent.
125
+ */
126
+ const isTargetInsideActiveDrill = (target) => {
127
+ const drillRoot = chessTree.drillForkParent;
128
+ if (!drillRoot)
129
+ return true;
130
+ let current = target;
131
+ while (current) {
132
+ if (current.id === drillRoot.id)
133
+ return true;
134
+ current = chessTree.getNodeParent(current);
135
+ }
136
+ return false;
137
+ };
138
+ /**
139
+ * Представляет переход к вершине текущего дерева вариантов (drill-down уровня).
140
+ * Возвращает true, если drill-down активен и переход выполнен.
141
+ */
142
+ const stepToDrillTop = () => {
143
+ const drillRoot = chessTree.drillForkParent;
144
+ if (!drillRoot)
145
+ return false;
146
+ chessTree.currentNode = drillRoot;
147
+ setChessFenImpl(drillRoot.data.fen);
148
+ setChessboardFenImpl();
149
+ setTimeout(() => scrollToActiveMoveIfNeeded(), 50);
150
+ return true;
151
+ };
152
+ /** Представляет обработчик клавиш окна для навигации по дереву. */
153
+ function onWindowKeyDown(e) {
154
+ if (chessTree.drillExitPromptOpen) {
155
+ return;
156
+ }
157
+ if (variantNavigator?.handleKeyDown(e)) {
158
+ e.preventDefault();
159
+ return;
160
+ }
161
+ if (e.key === "ArrowUp") {
162
+ variantNavigator?.forceClose();
163
+ if (chessTree.isVariationDrillDownActive() &&
164
+ isCurrentNodeInDrillHeader()) {
165
+ requestDrillExitPrompt();
166
+ e.preventDefault();
167
+ return;
168
+ }
169
+ if (!stepToDrillTop()) {
170
+ stepToStart();
171
+ }
172
+ e.preventDefault();
173
+ }
174
+ else if (e.key === "ArrowDown") {
175
+ variantNavigator?.forceClose();
176
+ if (chessTree.isVariationDrillDownActive() &&
177
+ isCurrentNodeInDrillHeader()) {
178
+ requestDrillExitPrompt();
179
+ e.preventDefault();
180
+ return;
181
+ }
182
+ stepToEnd();
183
+ e.preventDefault();
184
+ }
185
+ else if (e.key === "ArrowLeft") {
186
+ variantNavigator?.forceClose();
187
+ if (chessTree.isVariationDrillDownActive() &&
188
+ isCurrentNodeInDrillHeader()) {
189
+ requestDrillExitPrompt();
190
+ e.preventDefault();
191
+ return;
192
+ }
193
+ const parentNode = chessTree.getCurrentNodeParent();
194
+ if (chessTree.isVariationDrillDownActive() &&
195
+ isCurrentNodeInDrillHeader() &&
196
+ (!parentNode || !isTargetInsideActiveDrill(parentNode))) {
197
+ requestDrillExitPrompt();
198
+ }
199
+ else if (parentNode && isTargetInsideActiveDrill(parentNode)) {
200
+ selectPreviousNode();
201
+ highlightButton("previous");
202
+ }
203
+ e.preventDefault();
204
+ }
205
+ else if (e.key === "ArrowRight") {
206
+ const childNode = chessTree.currentNode?.children?.[0];
207
+ if (childNode && !isTargetInsideActiveDrill(childNode)) {
208
+ e.preventDefault();
209
+ return;
210
+ }
211
+ if ((chessTree.currentNode?.children?.length ?? 0) > 1) {
212
+ variantNavigator?.open();
213
+ }
214
+ else {
215
+ variantNavigator?.forceClose();
216
+ selectNextNode();
217
+ highlightButton("next");
218
+ }
219
+ e.preventDefault();
220
+ }
221
+ else if (e.key === " ") {
222
+ variantNavigator?.forceClose();
223
+ toggleAutoPlay();
224
+ e.preventDefault();
225
+ }
226
+ }
227
+ /** Представляет освобождение таймеров автопроигрывания при размонтировании TreeViewer. */
228
+ function dispose() {
229
+ stopAutoPlay();
230
+ }
231
+ return {
232
+ bindCallbacks,
233
+ setVariantNavigator,
234
+ highlightedButtons,
235
+ isPlaying,
236
+ onWindowKeyDown,
237
+ dispose,
238
+ selectPreviousNode,
239
+ selectNextNode,
240
+ selectChildNode,
241
+ stepToStart,
242
+ stepToEnd,
243
+ toggleAutoPlay,
244
+ highlightButton,
245
+ };
246
+ }
247
+ /**
248
+ * Представляет получение или создание общего объекта навигации для пары TreeViewer + TreeViewerPanelManager.
249
+ */
250
+ export function getOrCreateTreeViewerPanelNavigation(chessTree) {
251
+ let nav = panelNavByChessTree.get(chessTree);
252
+ if (!nav) {
253
+ nav = createTreeViewerPanelNavigation(chessTree);
254
+ panelNavByChessTree.set(chessTree, nav);
255
+ }
256
+ return nav;
257
+ }
@@ -0,0 +1,65 @@
1
+ import { type WithElementRef } from "../../../utils.js";
2
+ import type { HTMLAnchorAttributes, HTMLButtonAttributes } from "svelte/elements";
3
+ import { type VariantProps } from "tailwind-variants";
4
+ /** Представляет набор классов Tailwind и вариантов оформления кнопки. */
5
+ export declare const buttonVariants: import("tailwind-variants").TVReturnType<{
6
+ variant: {
7
+ default: string;
8
+ destructive: string;
9
+ outline: string;
10
+ secondary: string;
11
+ ghost: string;
12
+ link: string;
13
+ };
14
+ size: {
15
+ default: string;
16
+ sm: string;
17
+ lg: string;
18
+ icon: string;
19
+ "icon-sm": string;
20
+ "icon-lg": string;
21
+ };
22
+ }, undefined, "focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium outline-none transition-all focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0", {
23
+ variant: {
24
+ default: string;
25
+ destructive: string;
26
+ outline: string;
27
+ secondary: string;
28
+ ghost: string;
29
+ link: string;
30
+ };
31
+ size: {
32
+ default: string;
33
+ sm: string;
34
+ lg: string;
35
+ icon: string;
36
+ "icon-sm": string;
37
+ "icon-lg": string;
38
+ };
39
+ }, undefined, import("tailwind-variants").TVReturnType<{
40
+ variant: {
41
+ default: string;
42
+ destructive: string;
43
+ outline: string;
44
+ secondary: string;
45
+ ghost: string;
46
+ link: string;
47
+ };
48
+ size: {
49
+ default: string;
50
+ sm: string;
51
+ lg: string;
52
+ icon: string;
53
+ "icon-sm": string;
54
+ "icon-lg": string;
55
+ };
56
+ }, undefined, "focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium outline-none transition-all focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0", unknown, unknown, undefined>>;
57
+ /** Представляет допустимый вариант заливки кнопки. */
58
+ export type ButtonVariant = VariantProps<typeof buttonVariants>["variant"];
59
+ /** Представляет допустимый размер кнопки. */
60
+ export type ButtonSize = VariantProps<typeof buttonVariants>["size"];
61
+ /** Представляет пропсы компонента кнопки (элемент button или ссылка). */
62
+ export type ButtonProps = WithElementRef<HTMLButtonAttributes> & WithElementRef<HTMLAnchorAttributes> & {
63
+ variant?: ButtonVariant;
64
+ size?: ButtonSize;
65
+ };
@@ -0,0 +1,28 @@
1
+ import {} from "../../../utils.js";
2
+ import { tv } from "tailwind-variants";
3
+ /** Представляет набор классов Tailwind и вариантов оформления кнопки. */
4
+ export const buttonVariants = tv({
5
+ base: "focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium outline-none transition-all focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
6
+ variants: {
7
+ variant: {
8
+ default: "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
9
+ destructive: "bg-destructive shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60 text-white",
10
+ outline: "bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 border",
11
+ secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
12
+ ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
13
+ link: "text-primary underline-offset-4 hover:underline",
14
+ },
15
+ size: {
16
+ default: "h-9 px-4 py-2 has-[>svg]:px-3",
17
+ sm: "h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",
18
+ lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
19
+ icon: "size-9",
20
+ "icon-sm": "size-8",
21
+ "icon-lg": "size-10",
22
+ },
23
+ },
24
+ defaultVariants: {
25
+ variant: "default",
26
+ size: "default",
27
+ },
28
+ });
@@ -1,47 +1,7 @@
1
- <script lang="ts" module>
2
- import { cn, type WithElementRef } from "../../../utils.js";
3
- import type { HTMLAnchorAttributes, HTMLButtonAttributes } from "svelte/elements";
4
- import { type VariantProps, tv } from "tailwind-variants";
5
-
6
- export const buttonVariants = tv({
7
- base: "focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium outline-none transition-all focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
8
- variants: {
9
- variant: {
10
- default: "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
11
- destructive:
12
- "bg-destructive shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60 text-white",
13
- outline:
14
- "bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 border",
15
- secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
16
- ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
17
- link: "text-primary underline-offset-4 hover:underline",
18
- },
19
- size: {
20
- default: "h-9 px-4 py-2 has-[>svg]:px-3",
21
- sm: "h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",
22
- lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
23
- icon: "size-9",
24
- "icon-sm": "size-8",
25
- "icon-lg": "size-10",
26
- },
27
- },
28
- defaultVariants: {
29
- variant: "default",
30
- size: "default",
31
- },
32
- });
33
-
34
- export type ButtonVariant = VariantProps<typeof buttonVariants>["variant"];
35
- export type ButtonSize = VariantProps<typeof buttonVariants>["size"];
36
-
37
- export type ButtonProps = WithElementRef<HTMLButtonAttributes> &
38
- WithElementRef<HTMLAnchorAttributes> & {
39
- variant?: ButtonVariant;
40
- size?: ButtonSize;
41
- };
42
- </script>
43
-
44
1
  <script lang="ts">
2
+ import { cn } from "../../../utils.js";
3
+ import { buttonVariants, type ButtonProps } from "./button-variants.js";
4
+
45
5
  let {
46
6
  class: className,
47
7
  variant = "default",
@@ -1,64 +1,4 @@
1
- import { type WithElementRef } from "../../../utils.js";
2
- import type { HTMLAnchorAttributes, HTMLButtonAttributes } from "svelte/elements";
3
- import { type VariantProps } from "tailwind-variants";
4
- export declare const buttonVariants: import("tailwind-variants").TVReturnType<{
5
- variant: {
6
- default: string;
7
- destructive: string;
8
- outline: string;
9
- secondary: string;
10
- ghost: string;
11
- link: string;
12
- };
13
- size: {
14
- default: string;
15
- sm: string;
16
- lg: string;
17
- icon: string;
18
- "icon-sm": string;
19
- "icon-lg": string;
20
- };
21
- }, undefined, "focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium outline-none transition-all focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0", {
22
- variant: {
23
- default: string;
24
- destructive: string;
25
- outline: string;
26
- secondary: string;
27
- ghost: string;
28
- link: string;
29
- };
30
- size: {
31
- default: string;
32
- sm: string;
33
- lg: string;
34
- icon: string;
35
- "icon-sm": string;
36
- "icon-lg": string;
37
- };
38
- }, undefined, import("tailwind-variants").TVReturnType<{
39
- variant: {
40
- default: string;
41
- destructive: string;
42
- outline: string;
43
- secondary: string;
44
- ghost: string;
45
- link: string;
46
- };
47
- size: {
48
- default: string;
49
- sm: string;
50
- lg: string;
51
- icon: string;
52
- "icon-sm": string;
53
- "icon-lg": string;
54
- };
55
- }, undefined, "focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium outline-none transition-all focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0", unknown, unknown, undefined>>;
56
- export type ButtonVariant = VariantProps<typeof buttonVariants>["variant"];
57
- export type ButtonSize = VariantProps<typeof buttonVariants>["size"];
58
- export type ButtonProps = WithElementRef<HTMLButtonAttributes> & WithElementRef<HTMLAnchorAttributes> & {
59
- variant?: ButtonVariant;
60
- size?: ButtonSize;
61
- };
1
+ import { type ButtonProps } from "./button-variants.js";
62
2
  declare const Button: import("svelte").Component<ButtonProps, {}, "ref">;
63
3
  type Button = ReturnType<typeof Button>;
64
4
  export default Button;
@@ -1,2 +1,3 @@
1
- import Root, { type ButtonProps, type ButtonSize, type ButtonVariant, buttonVariants } from "./button.svelte";
2
- export { Root, type ButtonProps as Props, Root as Button, buttonVariants, type ButtonProps, type ButtonSize, type ButtonVariant, };
1
+ import Root from "./button.svelte";
2
+ export { Root, Root as Button };
3
+ export { buttonVariants, type ButtonProps, type ButtonProps as Props, type ButtonSize, type ButtonVariant, } from "./button-variants.js";
@@ -1,4 +1,3 @@
1
- import Root, { buttonVariants, } from "./button.svelte";
2
- export { Root,
3
- //
4
- Root as Button, buttonVariants, };
1
+ import Root from "./button.svelte";
2
+ export { Root, Root as Button };
3
+ export { buttonVariants, } from "./button-variants.js";
@@ -1,7 +1,7 @@
1
1
  declare const ButtonGroupSeparator: import("svelte").Component<Omit<{
2
2
  orientation?: import("bits-ui").Orientation;
3
3
  decorative?: boolean;
4
- }, "child" | "children"> & {
4
+ }, "children" | "child"> & {
5
5
  child?: import("svelte").Snippet<[{
6
6
  props: Record<string, unknown>;
7
7
  }]> | undefined;
package/dist/index.d.ts CHANGED
@@ -5,4 +5,5 @@ import TreeViewer from "./(components)/TreeViewer.svelte";
5
5
  import ImportToPgn from "./(components)/ImportToPgn.svelte";
6
6
  import { createPgnFromTree } from "./(utils)/createPgnFromTree.js";
7
7
  import TreeViewerPanelManager from "./(components)/TreeViewerPanelManager.svelte";
8
- export { ChessTree, type ChessTreeNode, type TChessTree, transformPgnToChessNode, TreeViewer, ImportToPgn, createPgnFromTree, TreeViewerPanelManager, };
8
+ import NagBadges from "./(components)/NagBadges.svelte";
9
+ export { ChessTree, type ChessTreeNode, type TChessTree, transformPgnToChessNode, TreeViewer, ImportToPgn, createPgnFromTree, TreeViewerPanelManager, NagBadges, };
package/dist/index.js CHANGED
@@ -4,4 +4,5 @@ import TreeViewer from "./(components)/TreeViewer.svelte";
4
4
  import ImportToPgn from "./(components)/ImportToPgn.svelte";
5
5
  import { createPgnFromTree } from "./(utils)/createPgnFromTree.js";
6
6
  import TreeViewerPanelManager from "./(components)/TreeViewerPanelManager.svelte";
7
- export { ChessTree, transformPgnToChessNode, TreeViewer, ImportToPgn, createPgnFromTree, TreeViewerPanelManager, };
7
+ import NagBadges from "./(components)/NagBadges.svelte";
8
+ export { ChessTree, transformPgnToChessNode, TreeViewer, ImportToPgn, createPgnFromTree, TreeViewerPanelManager, NagBadges, };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@connectorvol/tree",
3
- "version": "2.1.2",
3
+ "version": "4.1.0",
4
4
  "files": [
5
5
  "dist",
6
6
  "!dist/**/*.test.*",
@@ -39,14 +39,14 @@
39
39
  "test:ui": "npx playwright test --ui"
40
40
  },
41
41
  "dependencies": {
42
- "@connectorvol/chessops": "2.0.0",
43
- "@connectorvol/shared": "2.0.0",
42
+ "@connectorvol/chessops": "3.0.0",
43
+ "@connectorvol/shared": "4.0.0",
44
44
  "clsx": "^2.1.1",
45
45
  "tailwind-merge": "3.3.1",
46
46
  "tailwind-variants": "3.1.1"
47
47
  },
48
48
  "devDependencies": {
49
- "@connectorvol/chessboard": "2.1.0",
49
+ "@connectorvol/chessboard": "4.0.0",
50
50
  "@ianvs/prettier-plugin-sort-imports": "4.5.1",
51
51
  "@internationalized/date": "3.9.0",
52
52
  "@lucide/svelte": "^0.553.0",