string;
@@ -29,7 +29,7 @@ export type MiniMapProps = {
*/
position?: PanelPosition;
/** Class applied to container */
- class?: string;
+ class?: ClassValue;
/** Style applied to container */
style?: string;
/** The aria-label applied to container */
diff --git a/packages/svelte/src/lib/plugins/NodeResizer/ResizeControl.svelte b/packages/svelte/src/lib/plugins/NodeResizer/ResizeControl.svelte
index a962d083..0c21ddf9 100644
--- a/packages/svelte/src/lib/plugins/NodeResizer/ResizeControl.svelte
+++ b/packages/svelte/src/lib/plugins/NodeResizer/ResizeControl.svelte
@@ -1,6 +1,5 @@
diff --git a/packages/svelte/src/lib/plugins/NodeResizer/types.ts b/packages/svelte/src/lib/plugins/NodeResizer/types.ts
index bcb924ae..87934a25 100644
--- a/packages/svelte/src/lib/plugins/NodeResizer/types.ts
+++ b/packages/svelte/src/lib/plugins/NodeResizer/types.ts
@@ -1,3 +1,5 @@
+import type { Snippet } from 'svelte';
+import type { ClassValue } from 'svelte/elements';
import type {
ControlPosition,
ResizeControlVariant,
@@ -6,7 +8,6 @@ import type {
OnResize,
OnResizeEnd
} from '@xyflow/system';
-import type { Snippet } from 'svelte';
export type NodeResizerProps = {
/** Id of the node it is resizing
@@ -68,7 +69,7 @@ export type ResizeControlProps = Pick<
* @example ResizeControlVariant.Handle, ResizeControlVariant.Line
*/
variant?: ResizeControlVariant;
- class?: string;
+ class?: ClassValue;
style?: string;
children?: Snippet;
};
diff --git a/packages/svelte/src/lib/store/initial-store.svelte.ts b/packages/svelte/src/lib/store/initial-store.svelte.ts
index 1ed91bd4..0c937bd8 100644
--- a/packages/svelte/src/lib/store/initial-store.svelte.ts
+++ b/packages/svelte/src/lib/store/initial-store.svelte.ts
@@ -155,9 +155,9 @@ export const getInitialStore = (signals: StoreSignals) => {
};
});
- domNode: HTMLDivElement | null = $derived(signals.domNode ?? null);
- width: number = $derived(signals.width ?? signals.props.width ?? 0);
- height: number = $derived(signals.height ?? signals.props.height ?? 0);
+ domNode = $state(null);
+ width = $state(signals.width ?? 0);
+ height = $state(signals.height ?? 0);
flowId: string = $derived(signals.props.id ?? '1');
minZoom: number = $derived(signals.props.minZoom ?? 0.5);
diff --git a/packages/svelte/src/lib/store/types.ts b/packages/svelte/src/lib/store/types.ts
index 9009a93b..408769e1 100644
--- a/packages/svelte/src/lib/store/types.ts
+++ b/packages/svelte/src/lib/store/types.ts
@@ -39,7 +39,6 @@ export type SvelteFlowStoreActions = {
export type StoreSignals = {
props: Partial;
- domNode?: HTMLDivElement;
width?: number;
height?: number;
nodes: Node[];
diff --git a/packages/svelte/src/lib/types/edges.ts b/packages/svelte/src/lib/types/edges.ts
index decabe5e..a21a19a1 100644
--- a/packages/svelte/src/lib/types/edges.ts
+++ b/packages/svelte/src/lib/types/edges.ts
@@ -9,6 +9,7 @@ import type {
} from '@xyflow/system';
import type { Node } from '$lib/types';
+import type { ClassValue } from 'svelte/elements';
/**
* The Edge type is mainly used for the `edges` that get passed to the SvelteFlow component.
@@ -20,7 +21,7 @@ export type Edge<
label?: string;
labelStyle?: string;
style?: string;
- class?: string;
+ class?: ClassValue;
};
export type BaseEdgeProps = Pick<
@@ -42,7 +43,7 @@ export type BaseEdgeProps = Pick<
* @example 'url(#arrow)'
*/
markerEnd?: string;
- class?: string;
+ class?: ClassValue;
};
type SmoothStepEdge = Record> = Edge<
diff --git a/packages/svelte/src/lib/types/general.ts b/packages/svelte/src/lib/types/general.ts
index ca6921a1..82462762 100644
--- a/packages/svelte/src/lib/types/general.ts
+++ b/packages/svelte/src/lib/types/general.ts
@@ -1,4 +1,5 @@
import type { Snippet } from 'svelte';
+import type { ClassValue } from 'svelte/elements';
import type { ShortcutModifierDefinition } from '@svelte-put/shortcut';
import type {
FitViewOptionsBase,
@@ -24,7 +25,7 @@ export type ConnectionData = {
};
export type HandleProps = HandlePropsSystem & {
- class?: string;
+ class?: ClassValue;
style?: string;
onconnect?: (connections: Connection[]) => void;
ondisconnect?: (connections: Connection[]) => void;
diff --git a/packages/svelte/src/lib/types/nodes.ts b/packages/svelte/src/lib/types/nodes.ts
index 6bd851fb..77f2d55a 100644
--- a/packages/svelte/src/lib/types/nodes.ts
+++ b/packages/svelte/src/lib/types/nodes.ts
@@ -1,4 +1,5 @@
import type { Component } from 'svelte';
+import type { ClassValue } from 'svelte/elements';
import type { InternalNodeBase, NodeBase, NodeProps as NodePropsBase } from '@xyflow/system';
/**
@@ -17,7 +18,7 @@ export type Node<
NodeData extends Record = Record,
NodeType extends string = string
> = NodeBase & {
- class?: string;
+ class?: ClassValue;
style?: string;
};
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 2005e91e..65163442 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -293,9 +293,6 @@ importers:
'@xyflow/system':
specifier: workspace:*
version: link:../system
- classcat:
- specifier: ^5.0.5
- version: 5.0.5
devDependencies:
'@sveltejs/adapter-auto':
specifier: ^4.0.0
@@ -2255,11 +2252,6 @@ packages:
engines: {node: '>=0.4.0'}
hasBin: true
- acorn@8.11.3:
- resolution: {integrity: sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==}
- engines: {node: '>=0.4.0'}
- hasBin: true
-
acorn@8.14.0:
resolution: {integrity: sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==}
engines: {node: '>=0.4.0'}
@@ -2618,9 +2610,6 @@ packages:
classcat@5.0.4:
resolution: {integrity: sha512-sbpkOw6z413p+HDGcBENe498WM9woqWHiJxCq7nvmxe9WmrUmqfAcxpIwAiMtM5Q3AhYkzXcNQHqsWq0mND51g==}
- classcat@5.0.5:
- resolution: {integrity: sha512-JhZUT7JFcQy/EzW605k/ktHtncoo9vnyW/2GspNYwFlN1C/WmjuV/xtS04e9SOkL2sTdw0VAZ2UGCcQ9lR6p6w==}
-
clean-stack@2.2.0:
resolution: {integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==}
engines: {node: '>=6'}
@@ -7562,7 +7551,7 @@ snapshots:
'@eslint/eslintrc@2.1.4':
dependencies:
ajv: 6.12.6
- debug: 4.3.4(supports-color@8.1.1)
+ debug: 4.3.4
espree: 9.6.1
globals: 13.23.0
ignore: 5.3.0
@@ -7598,7 +7587,7 @@ snapshots:
'@humanwhocodes/config-array@0.11.14':
dependencies:
'@humanwhocodes/object-schema': 2.0.2
- debug: 4.3.4(supports-color@8.1.1)
+ debug: 4.3.4
minimatch: 3.1.2
transitivePeerDependencies:
- supports-color
@@ -8466,8 +8455,6 @@ snapshots:
acorn@8.11.2: {}
- acorn@8.11.3: {}
-
acorn@8.14.0: {}
aggregate-error@3.1.0:
@@ -8938,8 +8925,6 @@ snapshots:
classcat@5.0.4: {}
- classcat@5.0.5: {}
-
clean-stack@2.2.0: {}
cli-boxes@3.0.0: {}
@@ -9337,6 +9322,10 @@ snapshots:
optionalDependencies:
supports-color: 8.1.1
+ debug@4.3.4:
+ dependencies:
+ ms: 2.1.2
+
debug@4.3.4(supports-color@8.1.1):
dependencies:
ms: 2.1.2
@@ -9995,7 +9984,7 @@ snapshots:
ajv: 6.12.6
chalk: 4.1.2
cross-spawn: 7.0.3
- debug: 4.3.4(supports-color@8.1.1)
+ debug: 4.3.4
doctrine: 3.0.0
escape-string-regexp: 4.0.0
eslint-scope: 7.2.2
@@ -13103,7 +13092,7 @@ snapshots:
terser@5.31.0:
dependencies:
'@jridgewell/source-map': 0.3.6
- acorn: 8.11.3
+ acorn: 8.14.0
commander: 2.20.3
source-map-support: 0.5.21
@@ -13474,7 +13463,7 @@ snapshots:
vite@6.0.10(@types/node@20.14.6)(terser@5.31.0):
dependencies:
esbuild: 0.24.2
- postcss: 8.4.49
+ postcss: 8.5.1
rollup: 4.25.0
optionalDependencies:
'@types/node': 20.14.6