chore(zIndexMode): use basic as default
This commit is contained in:
@@ -29,7 +29,7 @@ const getInitialState = ({
|
|||||||
maxZoom = 2,
|
maxZoom = 2,
|
||||||
nodeOrigin,
|
nodeOrigin,
|
||||||
nodeExtent,
|
nodeExtent,
|
||||||
zIndexMode = 'auto',
|
zIndexMode = 'basic',
|
||||||
}: {
|
}: {
|
||||||
nodes?: Node[];
|
nodes?: Node[];
|
||||||
edges?: Edge[];
|
edges?: Edge[];
|
||||||
|
|||||||
@@ -696,7 +696,7 @@ export interface ReactFlowProps<NodeType extends Node = Node, EdgeType extends E
|
|||||||
* Used to define how z-indexing is calculated for nodes and edges.
|
* Used to define how z-indexing is calculated for nodes and edges.
|
||||||
* 'auto' is for selections and sub flows, 'basic' for selections only, and 'manual' for no auto z-indexing.
|
* 'auto' is for selections and sub flows, 'basic' for selections only, and 'manual' for no auto z-indexing.
|
||||||
*
|
*
|
||||||
* @default 'auto'
|
* @default 'basic'
|
||||||
*/
|
*/
|
||||||
zIndexMode?: ZIndexMode;
|
zIndexMode?: ZIndexMode;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -505,7 +505,7 @@ export type SvelteFlowProps<
|
|||||||
* Used to define how z-indexing is calculated for nodes and edges.
|
* Used to define how z-indexing is calculated for nodes and edges.
|
||||||
* 'auto' is for selections and sub flows, 'basic' for selections only, and 'manual' for no auto z-indexing.
|
* 'auto' is for selections and sub flows, 'basic' for selections only, and 'manual' for no auto z-indexing.
|
||||||
*
|
*
|
||||||
* @default 'auto'
|
* @default 'basic'
|
||||||
*/
|
*/
|
||||||
zIndexMode?: ZIndexMode;
|
zIndexMode?: ZIndexMode;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ export function getInitialStore<NodeType extends Node = Node, EdgeType extends E
|
|||||||
panZoom: PanZoomInstance | null = $state.raw(null);
|
panZoom: PanZoomInstance | null = $state.raw(null);
|
||||||
width = $state.raw<number>(signals.width ?? 0);
|
width = $state.raw<number>(signals.width ?? 0);
|
||||||
height = $state.raw<number>(signals.height ?? 0);
|
height = $state.raw<number>(signals.height ?? 0);
|
||||||
zIndexMode = $state.raw<ZIndexMode>(signals.props.zIndexMode ?? 'auto');
|
zIndexMode = $state.raw<ZIndexMode>(signals.props.zIndexMode ?? 'basic');
|
||||||
|
|
||||||
nodesInitialized: boolean = $derived.by(() => {
|
nodesInitialized: boolean = $derived.by(() => {
|
||||||
const nodesInitialized = adoptUserNodes(signals.nodes, this.nodeLookup, this.parentLookup, {
|
const nodesInitialized = adoptUserNodes(signals.nodes, this.nodeLookup, this.parentLookup, {
|
||||||
|
|||||||
@@ -375,6 +375,5 @@ export type OnBeforeDeleteBase<NodeType extends NodeBase = NodeBase, EdgeType ex
|
|||||||
* `manual` mode does not apply any automatic z-indexing.
|
* `manual` mode does not apply any automatic z-indexing.
|
||||||
*
|
*
|
||||||
* @public
|
* @public
|
||||||
* @default 'auto'
|
|
||||||
*/
|
*/
|
||||||
export type ZIndexMode = 'auto' | 'basic' | 'manual';
|
export type ZIndexMode = 'auto' | 'basic' | 'manual';
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ export function getElevatedEdgeZIndex({
|
|||||||
selected = false,
|
selected = false,
|
||||||
zIndex,
|
zIndex,
|
||||||
elevateOnSelect = false,
|
elevateOnSelect = false,
|
||||||
zIndexMode = 'auto',
|
zIndexMode = 'basic',
|
||||||
}: GetEdgeZIndexParams): number {
|
}: GetEdgeZIndexParams): number {
|
||||||
const manualZIndexMode = isManualZIndexMode(zIndexMode);
|
const manualZIndexMode = isManualZIndexMode(zIndexMode);
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ const defaultOptions = {
|
|||||||
nodeOrigin: [0, 0] as NodeOrigin,
|
nodeOrigin: [0, 0] as NodeOrigin,
|
||||||
nodeExtent: infiniteExtent,
|
nodeExtent: infiniteExtent,
|
||||||
elevateNodesOnSelect: true,
|
elevateNodesOnSelect: true,
|
||||||
zIndexMode: 'auto' as ZIndexMode,
|
zIndexMode: 'basic' as ZIndexMode,
|
||||||
defaults: {},
|
defaults: {},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user