@visualli/core 0.2.15 → 0.2.17
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/{chunk-4R5LZUVK.js → chunk-2JCBDPOL.js} +2 -2
- package/dist/{chunk-COKCN5NW.js → chunk-3RLUS5K7.js} +15 -5
- package/dist/chunk-3RLUS5K7.js.map +1 -0
- package/dist/{chunk-EASI6BW7.js → chunk-3UZU4SK5.js} +17 -3
- package/dist/chunk-3UZU4SK5.js.map +1 -0
- package/dist/{chunk-URWZU4I5.js → chunk-6GAKZATW.js} +2 -2
- package/dist/{chunk-RDHSLWMU.js → chunk-6LHBNFP4.js} +2 -1
- package/dist/{chunk-RDHSLWMU.js.map → chunk-6LHBNFP4.js.map} +1 -1
- package/dist/{chunk-C5IC52GJ.js → chunk-EGXQEULM.js} +4 -4
- package/dist/{chunk-OOTXA4BA.js → chunk-T3SFVKHY.js} +2 -2
- package/dist/{chunk-KP57ODE7.js → chunk-YU3KV4UY.js} +2 -2
- package/dist/config/index.cjs +15 -1
- package/dist/config/index.cjs.map +1 -1
- package/dist/config/index.d.cts +4 -4
- package/dist/config/index.d.ts +4 -4
- package/dist/config/index.js +2 -2
- package/dist/constants/index.cjs.map +1 -1
- package/dist/constants/index.d.cts +2 -2
- package/dist/constants/index.d.ts +2 -2
- package/dist/constants/index.js +2 -2
- package/dist/{designSystem-D-iI9c23.d.cts → designSystem-D1TEwtFB.d.cts} +1 -0
- package/dist/{designSystem-D-iI9c23.d.ts → designSystem-D1TEwtFB.d.ts} +1 -0
- package/dist/{ideaSize-Dj7qGmuk.d.cts → ideaSize-BNzONHMD.d.cts} +1 -1
- package/dist/{ideaSize-BD-vUcOU.d.ts → ideaSize-D3bwx7nU.d.ts} +1 -1
- package/dist/{index-uqNXf5yF.d.cts → index-CpNpxxTi.d.cts} +1 -1
- package/dist/{index-Bi8djF7z.d.ts → index-b1eML2o2.d.ts} +1 -1
- package/dist/index.cjs +85 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +80 -23
- package/dist/index.d.ts +80 -23
- package/dist/index.js +60 -11
- package/dist/index.js.map +1 -1
- package/dist/layout/index.d.cts +2 -2
- package/dist/layout/index.d.ts +2 -2
- package/dist/{mindmap-BbQrM6Pm.d.cts → mindmap-BkGXWW3M.d.cts} +1 -1
- package/dist/{mindmap-BU-aLrAR.d.ts → mindmap-GAjdtx5S.d.ts} +1 -1
- package/dist/parser/index.cjs +15 -1
- package/dist/parser/index.cjs.map +1 -1
- package/dist/parser/index.d.cts +3 -3
- package/dist/parser/index.d.ts +3 -3
- package/dist/parser/index.js +4 -4
- package/dist/performance/index.cjs.map +1 -1
- package/dist/performance/index.js +2 -2
- package/dist/theme/index.cjs +1 -0
- package/dist/theme/index.cjs.map +1 -1
- package/dist/theme/index.d.cts +2 -2
- package/dist/theme/index.d.ts +2 -2
- package/dist/theme/index.js +2 -2
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/viewport/index.cjs.map +1 -1
- package/dist/viewport/index.d.cts +2 -2
- package/dist/viewport/index.d.ts +2 -2
- package/dist/viewport/index.js +2 -2
- package/package.json +2 -2
- package/src/generated/designSystem.ts +1 -0
- package/src/generated/geometry/container.ts +51 -2
- package/src/generated/geometry/idea.ts +12 -1
- package/src/generated/geometry/interaction.ts +29 -4
- package/src/index.ts +3 -3
- package/src/utils/navigation.ts +13 -8
- package/dist/chunk-COKCN5NW.js.map +0 -1
- package/dist/chunk-EASI6BW7.js.map +0 -1
- /package/dist/{chunk-4R5LZUVK.js.map → chunk-2JCBDPOL.js.map} +0 -0
- /package/dist/{chunk-URWZU4I5.js.map → chunk-6GAKZATW.js.map} +0 -0
- /package/dist/{chunk-C5IC52GJ.js.map → chunk-EGXQEULM.js.map} +0 -0
- /package/dist/{chunk-OOTXA4BA.js.map → chunk-T3SFVKHY.js.map} +0 -0
- /package/dist/{chunk-KP57ODE7.js.map → chunk-YU3KV4UY.js.map} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RenderConfig, N as NodeSelection, F as FlatNode, M as MindMapConnection, V as ViewportState } from './mindmap-
|
|
2
|
-
export { E as ELLIPSE, a as IDEA, I as IdeaKind, L as LABEL_GROWTH, b as MindMapConfig, c as MindMapData, d as MindMapNode, e as NodeMap, S as ShapeProfile, f as SpatialBounds, T as TopLevelConnection, i as ideaSize, l as labelGrowth, g as labelLayout, h as layoutGrowth, j as lineWidthsInShape, w as wrapInShape, k as wrapLines } from './mindmap-
|
|
1
|
+
import { R as RenderConfig, N as NodeSelection, F as FlatNode, M as MindMapConnection, V as ViewportState } from './mindmap-BkGXWW3M.cjs';
|
|
2
|
+
export { E as ELLIPSE, a as IDEA, I as IdeaKind, L as LABEL_GROWTH, b as MindMapConfig, c as MindMapData, d as MindMapNode, e as NodeMap, S as ShapeProfile, f as SpatialBounds, T as TopLevelConnection, i as ideaSize, l as labelGrowth, g as labelLayout, h as layoutGrowth, j as lineWidthsInShape, w as wrapInShape, k as wrapLines } from './mindmap-BkGXWW3M.cjs';
|
|
3
3
|
import { V as VisualliDocument } from './document-MEJEfxl3.cjs';
|
|
4
4
|
export { S as SemanticAnchor, a as VisualliMeta } from './document-MEJEfxl3.cjs';
|
|
5
5
|
import { V as VisualliLayer } from './layer-B2A3Ki48.cjs';
|
|
@@ -13,9 +13,9 @@ export { WorldBounds, calculateViewportBounds, clampZoom, focusOnNode, isNodeInV
|
|
|
13
13
|
export { FPSMonitor, MemoryMonitor, MemoryStats, PerformanceProfiler } from './performance/index.cjs';
|
|
14
14
|
import * as zustand_vanilla from 'zustand/vanilla';
|
|
15
15
|
export { BLOB_SHAPES, ConnectorGeometry, MAX_RINGS, NodeLike, RINGS, SHAPE, arrowPath, blobPath, blobProfile, blobRadius, connectorGeometry, drawBlob, edgePath, nodeBounds, nodeRadii, outlineRadius, ringCount, ringsFor, shapeForLevel, shapeOfLevel } from './config/index.cjs';
|
|
16
|
-
export { I as IdeaMeasure, a as approximateMeasure, i as ideaKindOf } from './ideaSize-
|
|
17
|
-
export { C as CUSTOM, a as Comfort, I as IMMERSION, b as IdeaColor, M as Metrics, R as ResolvedComfort, T as TOPIC_ORDER, c as ThemeEnv, d as ThemeFamily, e as ThemeInput, f as TopicStyle, g as customColor, h as getTokens, i as ideaColor, j as ideaStyle, k as isContrastTheme, l as isDarkTheme, m as isFocusTheme, n as isThemeName, o as labelScale, p as metricsFor, r as resolveComfort, q as resolveTheme, t as token, s as topicFor, u as topicFromName, v as topicStyle } from './index-
|
|
18
|
-
export { C as CANVAS_STYLE, D as DESIGN_SYSTEM_VERSION, M as METRICS, b as METRICS_REDUCED_MOTION, c as THEME_NAMES, d as TOKENS, e as TOPICS, f as TYPE_STYLES, a as ThemeName, T as TopicName } from './designSystem-
|
|
16
|
+
export { I as IdeaMeasure, a as approximateMeasure, i as ideaKindOf } from './ideaSize-BNzONHMD.cjs';
|
|
17
|
+
export { C as CUSTOM, a as Comfort, I as IMMERSION, b as IdeaColor, M as Metrics, R as ResolvedComfort, T as TOPIC_ORDER, c as ThemeEnv, d as ThemeFamily, e as ThemeInput, f as TopicStyle, g as customColor, h as getTokens, i as ideaColor, j as ideaStyle, k as isContrastTheme, l as isDarkTheme, m as isFocusTheme, n as isThemeName, o as labelScale, p as metricsFor, r as resolveComfort, q as resolveTheme, t as token, s as topicFor, u as topicFromName, v as topicStyle } from './index-CpNpxxTi.cjs';
|
|
18
|
+
export { C as CANVAS_STYLE, D as DESIGN_SYSTEM_VERSION, M as METRICS, b as METRICS_REDUCED_MOTION, c as THEME_NAMES, d as TOKENS, e as TOPICS, f as TYPE_STYLES, a as ThemeName, T as TopicName } from './designSystem-D1TEwtFB.cjs';
|
|
19
19
|
export { Connection, Container, Extension, Layer, Meta, Node } from '@visualli/bindings';
|
|
20
20
|
|
|
21
21
|
interface BoundingBox {
|
|
@@ -166,8 +166,11 @@ declare const FRAME: {
|
|
|
166
166
|
/** Room beyond each idea's outermost ring (RINGS[2].scale, 1.3 × its half size): its stroke, hover lift and a little air. */ readonly ring: 0.3;
|
|
167
167
|
readonly clearX: 16;
|
|
168
168
|
readonly clearY: 16;
|
|
169
|
-
/** Room beyond each container hull for its dashed line and the name pill straddling it
|
|
169
|
+
/** Room beyond each container hull for its dashed line and the name pill straddling it: at least `hullX` / `hullY`
|
|
170
|
+
* (a one-line pill), more when the pill reaches further (a 2 - 3 line name): half its largest drawn height plus
|
|
171
|
+
* `pillAir`. A pill on a side edge may reach further sideways; the framing doesn't reserve that. */ readonly hullX: 24;
|
|
170
172
|
readonly hullY: 40;
|
|
173
|
+
readonly pillAir: 12;
|
|
171
174
|
};
|
|
172
175
|
type FrameBox = {
|
|
173
176
|
x0: number;
|
|
@@ -175,13 +178,16 @@ type FrameBox = {
|
|
|
175
178
|
x1: number;
|
|
176
179
|
y1: number;
|
|
177
180
|
};
|
|
178
|
-
/** The box a layer is framed by: every idea (`rx` / `ry` its half size) and every container hull.
|
|
181
|
+
/** The box a layer is framed by: every idea (`rx` / `ry` its half size) and every container hull. A hull's `pillH` is
|
|
182
|
+
* its name pill's height at the largest drawn size (container.ts pillScaled at PILL.maxGrow). */
|
|
179
183
|
declare function layerBounds(ideas: ReadonlyArray<{
|
|
180
184
|
x: number;
|
|
181
185
|
y: number;
|
|
182
186
|
rx: number;
|
|
183
187
|
ry: number;
|
|
184
|
-
}>, hulls?: ReadonlyArray<FrameBox
|
|
188
|
+
}>, hulls?: ReadonlyArray<FrameBox & {
|
|
189
|
+
pillH?: number;
|
|
190
|
+
}>): FrameBox;
|
|
185
191
|
/** Fit to view: the scale that shows `bounds` in an area of `width` × `height` (never beyond VIEW.fitMax), and the
|
|
186
192
|
* world point to centre. */
|
|
187
193
|
declare function fitView(bounds: FrameBox, width: number, height: number): {
|
|
@@ -262,6 +268,10 @@ declare const TRAIL: {
|
|
|
262
268
|
readonly stroke: 1.25;
|
|
263
269
|
readonly currentStroke: 1.75;
|
|
264
270
|
};
|
|
271
|
+
/** How an idea draws while a highlight is on (VisualMap `highlight`, or picking ideas for a group or a connector):
|
|
272
|
+
* `ids` are the highlighted ideas. A non-empty list: those are 'selected' and every other idea 'dimmed'. An empty list:
|
|
273
|
+
* every idea 'dimmed' while `picking` (nothing chosen yet), else no highlight (null). No list: null. */
|
|
274
|
+
declare function ideaHighlight(ids: readonly string[] | null | undefined, picking: boolean, id: string): 'selected' | 'dimmed' | null;
|
|
265
275
|
/** How an input answers: a mouse hovers (peeks and terms open on hover); touch and pen tap. Null for unknown pointers. */
|
|
266
276
|
declare function pointerModeFor(pointerType: string): 'hover' | 'touch' | null;
|
|
267
277
|
/** Whether a pointer of this type opens a term on hover (PointerEvent.pointerType). */
|
|
@@ -286,18 +296,22 @@ interface FitResult {
|
|
|
286
296
|
centerY: number;
|
|
287
297
|
zoomLevel: number;
|
|
288
298
|
}
|
|
289
|
-
/**
|
|
290
|
-
|
|
299
|
+
/** A container as the fit sees it: its members and, when it has a name, the name's pill at 1x (`w` × `h`, the design
|
|
300
|
+
* system's pillLayout: the host measures it with the real face). The hull widens for the pill and the framing leaves
|
|
301
|
+
* room for it (containerHull, layerBounds). Without it the container is framed by its hull alone. */
|
|
302
|
+
interface FitContainer {
|
|
291
303
|
nodeIds: string[];
|
|
292
|
-
|
|
304
|
+
pill?: {
|
|
305
|
+
w: number;
|
|
306
|
+
h: number;
|
|
307
|
+
} | null;
|
|
308
|
+
}
|
|
309
|
+
/** The box a layer is framed by: its ideas (their real sizes) and the hulls of its `containers`. */
|
|
310
|
+
declare function layerFrame(nodes: ReadonlyArray<FlatNode>, containers?: ReadonlyArray<FitContainer>): FrameBox;
|
|
293
311
|
/** The zoom that fits a layer's ideas (and container hulls) into a canvas of `canvasWidth` × `canvasHeight`. */
|
|
294
|
-
declare function calculateFitZoom(nodes: FlatNode[], canvasWidth: number, canvasHeight: number, containers?: ReadonlyArray<
|
|
295
|
-
nodeIds: string[];
|
|
296
|
-
}>): number;
|
|
312
|
+
declare function calculateFitZoom(nodes: FlatNode[], canvasWidth: number, canvasHeight: number, containers?: ReadonlyArray<FitContainer>): number;
|
|
297
313
|
/** The world point a fitted layer is centred on: the middle of its frame. */
|
|
298
|
-
declare function calculateFitCenter(nodes: FlatNode[], containers?: ReadonlyArray<{
|
|
299
|
-
nodeIds: string[];
|
|
300
|
-
}>): {
|
|
314
|
+
declare function calculateFitCenter(nodes: FlatNode[], containers?: ReadonlyArray<FitContainer>): {
|
|
301
315
|
x: number;
|
|
302
316
|
y: number;
|
|
303
317
|
};
|
|
@@ -318,9 +332,7 @@ declare function getContainersForLayer(doc: VisualliDocument, layerId: string):
|
|
|
318
332
|
* layer fits the free area and sits centred in it (the design system's fitViewInset); the viewport centre returned is
|
|
319
333
|
* the world point at the middle of the canvas, as the viewport store keeps it.
|
|
320
334
|
*/
|
|
321
|
-
declare function calculateFitView(nodes: FlatNode[], canvasWidth: number, canvasHeight: number, containers?: ReadonlyArray<
|
|
322
|
-
nodeIds: string[];
|
|
323
|
-
}>, insets?: FrameInsets): FitResult;
|
|
335
|
+
declare function calculateFitView(nodes: FlatNode[], canvasWidth: number, canvasHeight: number, containers?: ReadonlyArray<FitContainer>, insets?: FrameInsets): FitResult;
|
|
324
336
|
|
|
325
337
|
interface CullingOptions {
|
|
326
338
|
nodes: FlatNode[];
|
|
@@ -483,12 +495,57 @@ declare const HULL_CLEAR: {
|
|
|
483
495
|
readonly x: 50;
|
|
484
496
|
readonly y: 51;
|
|
485
497
|
};
|
|
498
|
+
/** The name pill (1x, world units = CSS px): the `note` face 26px bold (× the label scale), line-height 1.1, padding
|
|
499
|
+
* and border as the CSS draws them. It grows with the name up to `maxWidth` (padding and border included), then wraps
|
|
500
|
+
* to at most `maxLines` lines; an ellipsis only past that. Zooming grows the text with the label growth (up to
|
|
501
|
+
* `maxGrow`) but never the padding or border, and never re-wraps. `.vi-map__group-label`'s max-width equals
|
|
502
|
+
* `maxWidth` (the build checks it). */
|
|
503
|
+
declare const PILL: {
|
|
504
|
+
readonly fontPx: 26;
|
|
505
|
+
readonly lineHeight: 1.1;
|
|
506
|
+
readonly padX: 22;
|
|
507
|
+
readonly padTop: 6;
|
|
508
|
+
readonly padBottom: 8;
|
|
509
|
+
readonly border: 1.5;
|
|
510
|
+
readonly maxWidth: 420;
|
|
511
|
+
readonly maxLines: 3;
|
|
512
|
+
readonly maxGrow: 1.3;
|
|
513
|
+
};
|
|
514
|
+
/** The pill's fixed chrome (padding + border): width and height that don't scale with the text. */
|
|
515
|
+
declare const PILL_CHROME: {
|
|
516
|
+
readonly w: number;
|
|
517
|
+
readonly h: number;
|
|
518
|
+
};
|
|
519
|
+
type PillSize = {
|
|
520
|
+
lines: string[];
|
|
521
|
+
w: number;
|
|
522
|
+
h: number;
|
|
523
|
+
};
|
|
524
|
+
/** Wraps a container's name into its pill at 1x. `measure(text, px)` is the width of `text` in the note face at `px`
|
|
525
|
+
* (an injected canvas measure, like wrapLines in idea.ts); `scale` is the label scale (1.15 in large type). Words wrap
|
|
526
|
+
* greedily inside `maxWidth`; a word wider than that gets its own line (and is clipped). Past `maxLines` the last
|
|
527
|
+
* line ends in an ellipsis. `w` is the widest line plus the chrome (at most `maxWidth`), `h` the lines plus the chrome. */
|
|
528
|
+
declare function pillLayout(name: string, measure: (text: string, px: number) => number, scale?: number): PillSize;
|
|
529
|
+
/** The pill as drawn at label growth `k` (1 to PILL.maxGrow): the text grows, the padding and border don't. */
|
|
530
|
+
declare function pillScaled(p: {
|
|
531
|
+
w: number;
|
|
532
|
+
h: number;
|
|
533
|
+
}, k: number): {
|
|
534
|
+
w: number;
|
|
535
|
+
h: number;
|
|
536
|
+
};
|
|
486
537
|
/** The hull around a group's ideas: `padX` / `padY` beyond their centres, or more for an idea that has grown to show
|
|
487
|
-
* its label (`rx` / `ry`, its half size: then its outline plus HULL_CLEAR).
|
|
538
|
+
* its label (`rx` / `ry`, its half size: then its outline plus HULL_CLEAR). With the name's `pill` (its 1x size,
|
|
539
|
+
* from pillLayout) the hull is also widened, symmetrically about its centre, so that the pill at its largest drawn
|
|
540
|
+
* size (PILL.maxGrow) fits on the straight part of an edge: pill width + 2 × the corner radius. Hull and pill then
|
|
541
|
+
* never change while zooming. Without a pill the hull is as before. */
|
|
488
542
|
declare function containerHull(members: ReadonlyArray<Pt & {
|
|
489
543
|
rx?: number;
|
|
490
544
|
ry?: number;
|
|
491
|
-
}
|
|
545
|
+
}>, pill?: {
|
|
546
|
+
w: number;
|
|
547
|
+
h: number;
|
|
548
|
+
} | null): Hull | null;
|
|
492
549
|
/** Candidate spots for a w × h pill, in preference order: bottom center (the default look), top center, the thirds of
|
|
493
550
|
* bottom and top, then the sides. Spots keep the whole pill on the straight part of an edge, clear of the corners. */
|
|
494
551
|
declare function labelCandidates(hull: Hull, w: number, h: number): {
|
|
@@ -522,4 +579,4 @@ declare function ideaDetail(screenWidth: number, emphasised?: boolean): IdeaDeta
|
|
|
522
579
|
/** Whether idea shadows are drawn with this many ideas in view. */
|
|
523
580
|
declare function shadowsShown(visibleIdeas: number): boolean;
|
|
524
581
|
|
|
525
|
-
export { BACK, type Bezier, type BoundingBox, type ContainerGroupInfo, type CullingOptions, DETAIL, EASE, FEATURE_FLAGS, FIT_ROOM, FRAME, type FitResult, FlatNode, type FrameBox, type FrameInsets, GESTURE, HULL, HULL_CLEAR, type Hull, type IRenderConfigStore, type ISelectionStore, type ISpatialIndex, type IdeaDetail, type Box as LabelBox, type LabelPlacement, type LabelSide, type LayerVia, MOTION, MindMapConnection, NodeSelection, PEEK, PEEK_PLACEMENT, type Pt, RBushSpatialIndex, RenderConfig, SHEET, TERM, TRAIL, VIEW, ViewportState, VisualliDocument, VisualliLayer, bloomOffset, calculateFitCenter, calculateFitView, calculateFitZoom, connectorDelay, connectorSamples, containerHull, cssEase, ease as easeBezier, fitView, fitViewInset, getChildLayerForNode, getConnectionsForLayer, getContainersForLayer, getLayerForNavigation, getViewportVisibleNodes, hoverOpensTerm, ideaDetail, intersectsViewport, labelCandidates, layerBlooms, layerBounds, layerFrame, layerReveal, motionVars, peekPosition, pinchZoom, placeContainerLabel, pointerModeFor, renderConfigStore, revealDelay, revealSlot, revealTotal, selectionStore, shadowsShown, swapDelay, zoomAround };
|
|
582
|
+
export { BACK, type Bezier, type BoundingBox, type ContainerGroupInfo, type CullingOptions, DETAIL, EASE, FEATURE_FLAGS, FIT_ROOM, FRAME, type FitContainer, type FitResult, FlatNode, type FrameBox, type FrameInsets, GESTURE, HULL, HULL_CLEAR, type Hull, type IRenderConfigStore, type ISelectionStore, type ISpatialIndex, type IdeaDetail, type Box as LabelBox, type LabelPlacement, type LabelSide, type LayerVia, MOTION, MindMapConnection, NodeSelection, PEEK, PEEK_PLACEMENT, PILL, PILL_CHROME, type PillSize, type Pt, RBushSpatialIndex, RenderConfig, SHEET, TERM, TRAIL, VIEW, ViewportState, VisualliDocument, VisualliLayer, bloomOffset, calculateFitCenter, calculateFitView, calculateFitZoom, connectorDelay, connectorSamples, containerHull, cssEase, ease as easeBezier, fitView, fitViewInset, getChildLayerForNode, getConnectionsForLayer, getContainersForLayer, getLayerForNavigation, getViewportVisibleNodes, hoverOpensTerm, ideaDetail, ideaHighlight, intersectsViewport, labelCandidates, layerBlooms, layerBounds, layerFrame, layerReveal, motionVars, peekPosition, pillLayout, pillScaled, pinchZoom, placeContainerLabel, pointerModeFor, renderConfigStore, revealDelay, revealSlot, revealTotal, selectionStore, shadowsShown, swapDelay, zoomAround };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RenderConfig, N as NodeSelection, F as FlatNode, M as MindMapConnection, V as ViewportState } from './mindmap-
|
|
2
|
-
export { E as ELLIPSE, a as IDEA, I as IdeaKind, L as LABEL_GROWTH, b as MindMapConfig, c as MindMapData, d as MindMapNode, e as NodeMap, S as ShapeProfile, f as SpatialBounds, T as TopLevelConnection, i as ideaSize, l as labelGrowth, g as labelLayout, h as layoutGrowth, j as lineWidthsInShape, w as wrapInShape, k as wrapLines } from './mindmap-
|
|
1
|
+
import { R as RenderConfig, N as NodeSelection, F as FlatNode, M as MindMapConnection, V as ViewportState } from './mindmap-GAjdtx5S.js';
|
|
2
|
+
export { E as ELLIPSE, a as IDEA, I as IdeaKind, L as LABEL_GROWTH, b as MindMapConfig, c as MindMapData, d as MindMapNode, e as NodeMap, S as ShapeProfile, f as SpatialBounds, T as TopLevelConnection, i as ideaSize, l as labelGrowth, g as labelLayout, h as layoutGrowth, j as lineWidthsInShape, w as wrapInShape, k as wrapLines } from './mindmap-GAjdtx5S.js';
|
|
3
3
|
import { V as VisualliDocument } from './document-BFBwn93X.js';
|
|
4
4
|
export { S as SemanticAnchor, a as VisualliMeta } from './document-BFBwn93X.js';
|
|
5
5
|
import { V as VisualliLayer } from './layer-B2A3Ki48.js';
|
|
@@ -13,9 +13,9 @@ export { WorldBounds, calculateViewportBounds, clampZoom, focusOnNode, isNodeInV
|
|
|
13
13
|
export { FPSMonitor, MemoryMonitor, MemoryStats, PerformanceProfiler } from './performance/index.js';
|
|
14
14
|
import * as zustand_vanilla from 'zustand/vanilla';
|
|
15
15
|
export { BLOB_SHAPES, ConnectorGeometry, MAX_RINGS, NodeLike, RINGS, SHAPE, arrowPath, blobPath, blobProfile, blobRadius, connectorGeometry, drawBlob, edgePath, nodeBounds, nodeRadii, outlineRadius, ringCount, ringsFor, shapeForLevel, shapeOfLevel } from './config/index.js';
|
|
16
|
-
export { I as IdeaMeasure, a as approximateMeasure, i as ideaKindOf } from './ideaSize-
|
|
17
|
-
export { C as CUSTOM, a as Comfort, I as IMMERSION, b as IdeaColor, M as Metrics, R as ResolvedComfort, T as TOPIC_ORDER, c as ThemeEnv, d as ThemeFamily, e as ThemeInput, f as TopicStyle, g as customColor, h as getTokens, i as ideaColor, j as ideaStyle, k as isContrastTheme, l as isDarkTheme, m as isFocusTheme, n as isThemeName, o as labelScale, p as metricsFor, r as resolveComfort, q as resolveTheme, t as token, s as topicFor, u as topicFromName, v as topicStyle } from './index-
|
|
18
|
-
export { C as CANVAS_STYLE, D as DESIGN_SYSTEM_VERSION, M as METRICS, b as METRICS_REDUCED_MOTION, c as THEME_NAMES, d as TOKENS, e as TOPICS, f as TYPE_STYLES, a as ThemeName, T as TopicName } from './designSystem-
|
|
16
|
+
export { I as IdeaMeasure, a as approximateMeasure, i as ideaKindOf } from './ideaSize-D3bwx7nU.js';
|
|
17
|
+
export { C as CUSTOM, a as Comfort, I as IMMERSION, b as IdeaColor, M as Metrics, R as ResolvedComfort, T as TOPIC_ORDER, c as ThemeEnv, d as ThemeFamily, e as ThemeInput, f as TopicStyle, g as customColor, h as getTokens, i as ideaColor, j as ideaStyle, k as isContrastTheme, l as isDarkTheme, m as isFocusTheme, n as isThemeName, o as labelScale, p as metricsFor, r as resolveComfort, q as resolveTheme, t as token, s as topicFor, u as topicFromName, v as topicStyle } from './index-b1eML2o2.js';
|
|
18
|
+
export { C as CANVAS_STYLE, D as DESIGN_SYSTEM_VERSION, M as METRICS, b as METRICS_REDUCED_MOTION, c as THEME_NAMES, d as TOKENS, e as TOPICS, f as TYPE_STYLES, a as ThemeName, T as TopicName } from './designSystem-D1TEwtFB.js';
|
|
19
19
|
export { Connection, Container, Extension, Layer, Meta, Node } from '@visualli/bindings';
|
|
20
20
|
|
|
21
21
|
interface BoundingBox {
|
|
@@ -166,8 +166,11 @@ declare const FRAME: {
|
|
|
166
166
|
/** Room beyond each idea's outermost ring (RINGS[2].scale, 1.3 × its half size): its stroke, hover lift and a little air. */ readonly ring: 0.3;
|
|
167
167
|
readonly clearX: 16;
|
|
168
168
|
readonly clearY: 16;
|
|
169
|
-
/** Room beyond each container hull for its dashed line and the name pill straddling it
|
|
169
|
+
/** Room beyond each container hull for its dashed line and the name pill straddling it: at least `hullX` / `hullY`
|
|
170
|
+
* (a one-line pill), more when the pill reaches further (a 2 - 3 line name): half its largest drawn height plus
|
|
171
|
+
* `pillAir`. A pill on a side edge may reach further sideways; the framing doesn't reserve that. */ readonly hullX: 24;
|
|
170
172
|
readonly hullY: 40;
|
|
173
|
+
readonly pillAir: 12;
|
|
171
174
|
};
|
|
172
175
|
type FrameBox = {
|
|
173
176
|
x0: number;
|
|
@@ -175,13 +178,16 @@ type FrameBox = {
|
|
|
175
178
|
x1: number;
|
|
176
179
|
y1: number;
|
|
177
180
|
};
|
|
178
|
-
/** The box a layer is framed by: every idea (`rx` / `ry` its half size) and every container hull.
|
|
181
|
+
/** The box a layer is framed by: every idea (`rx` / `ry` its half size) and every container hull. A hull's `pillH` is
|
|
182
|
+
* its name pill's height at the largest drawn size (container.ts pillScaled at PILL.maxGrow). */
|
|
179
183
|
declare function layerBounds(ideas: ReadonlyArray<{
|
|
180
184
|
x: number;
|
|
181
185
|
y: number;
|
|
182
186
|
rx: number;
|
|
183
187
|
ry: number;
|
|
184
|
-
}>, hulls?: ReadonlyArray<FrameBox
|
|
188
|
+
}>, hulls?: ReadonlyArray<FrameBox & {
|
|
189
|
+
pillH?: number;
|
|
190
|
+
}>): FrameBox;
|
|
185
191
|
/** Fit to view: the scale that shows `bounds` in an area of `width` × `height` (never beyond VIEW.fitMax), and the
|
|
186
192
|
* world point to centre. */
|
|
187
193
|
declare function fitView(bounds: FrameBox, width: number, height: number): {
|
|
@@ -262,6 +268,10 @@ declare const TRAIL: {
|
|
|
262
268
|
readonly stroke: 1.25;
|
|
263
269
|
readonly currentStroke: 1.75;
|
|
264
270
|
};
|
|
271
|
+
/** How an idea draws while a highlight is on (VisualMap `highlight`, or picking ideas for a group or a connector):
|
|
272
|
+
* `ids` are the highlighted ideas. A non-empty list: those are 'selected' and every other idea 'dimmed'. An empty list:
|
|
273
|
+
* every idea 'dimmed' while `picking` (nothing chosen yet), else no highlight (null). No list: null. */
|
|
274
|
+
declare function ideaHighlight(ids: readonly string[] | null | undefined, picking: boolean, id: string): 'selected' | 'dimmed' | null;
|
|
265
275
|
/** How an input answers: a mouse hovers (peeks and terms open on hover); touch and pen tap. Null for unknown pointers. */
|
|
266
276
|
declare function pointerModeFor(pointerType: string): 'hover' | 'touch' | null;
|
|
267
277
|
/** Whether a pointer of this type opens a term on hover (PointerEvent.pointerType). */
|
|
@@ -286,18 +296,22 @@ interface FitResult {
|
|
|
286
296
|
centerY: number;
|
|
287
297
|
zoomLevel: number;
|
|
288
298
|
}
|
|
289
|
-
/**
|
|
290
|
-
|
|
299
|
+
/** A container as the fit sees it: its members and, when it has a name, the name's pill at 1x (`w` × `h`, the design
|
|
300
|
+
* system's pillLayout: the host measures it with the real face). The hull widens for the pill and the framing leaves
|
|
301
|
+
* room for it (containerHull, layerBounds). Without it the container is framed by its hull alone. */
|
|
302
|
+
interface FitContainer {
|
|
291
303
|
nodeIds: string[];
|
|
292
|
-
|
|
304
|
+
pill?: {
|
|
305
|
+
w: number;
|
|
306
|
+
h: number;
|
|
307
|
+
} | null;
|
|
308
|
+
}
|
|
309
|
+
/** The box a layer is framed by: its ideas (their real sizes) and the hulls of its `containers`. */
|
|
310
|
+
declare function layerFrame(nodes: ReadonlyArray<FlatNode>, containers?: ReadonlyArray<FitContainer>): FrameBox;
|
|
293
311
|
/** The zoom that fits a layer's ideas (and container hulls) into a canvas of `canvasWidth` × `canvasHeight`. */
|
|
294
|
-
declare function calculateFitZoom(nodes: FlatNode[], canvasWidth: number, canvasHeight: number, containers?: ReadonlyArray<
|
|
295
|
-
nodeIds: string[];
|
|
296
|
-
}>): number;
|
|
312
|
+
declare function calculateFitZoom(nodes: FlatNode[], canvasWidth: number, canvasHeight: number, containers?: ReadonlyArray<FitContainer>): number;
|
|
297
313
|
/** The world point a fitted layer is centred on: the middle of its frame. */
|
|
298
|
-
declare function calculateFitCenter(nodes: FlatNode[], containers?: ReadonlyArray<{
|
|
299
|
-
nodeIds: string[];
|
|
300
|
-
}>): {
|
|
314
|
+
declare function calculateFitCenter(nodes: FlatNode[], containers?: ReadonlyArray<FitContainer>): {
|
|
301
315
|
x: number;
|
|
302
316
|
y: number;
|
|
303
317
|
};
|
|
@@ -318,9 +332,7 @@ declare function getContainersForLayer(doc: VisualliDocument, layerId: string):
|
|
|
318
332
|
* layer fits the free area and sits centred in it (the design system's fitViewInset); the viewport centre returned is
|
|
319
333
|
* the world point at the middle of the canvas, as the viewport store keeps it.
|
|
320
334
|
*/
|
|
321
|
-
declare function calculateFitView(nodes: FlatNode[], canvasWidth: number, canvasHeight: number, containers?: ReadonlyArray<
|
|
322
|
-
nodeIds: string[];
|
|
323
|
-
}>, insets?: FrameInsets): FitResult;
|
|
335
|
+
declare function calculateFitView(nodes: FlatNode[], canvasWidth: number, canvasHeight: number, containers?: ReadonlyArray<FitContainer>, insets?: FrameInsets): FitResult;
|
|
324
336
|
|
|
325
337
|
interface CullingOptions {
|
|
326
338
|
nodes: FlatNode[];
|
|
@@ -483,12 +495,57 @@ declare const HULL_CLEAR: {
|
|
|
483
495
|
readonly x: 50;
|
|
484
496
|
readonly y: 51;
|
|
485
497
|
};
|
|
498
|
+
/** The name pill (1x, world units = CSS px): the `note` face 26px bold (× the label scale), line-height 1.1, padding
|
|
499
|
+
* and border as the CSS draws them. It grows with the name up to `maxWidth` (padding and border included), then wraps
|
|
500
|
+
* to at most `maxLines` lines; an ellipsis only past that. Zooming grows the text with the label growth (up to
|
|
501
|
+
* `maxGrow`) but never the padding or border, and never re-wraps. `.vi-map__group-label`'s max-width equals
|
|
502
|
+
* `maxWidth` (the build checks it). */
|
|
503
|
+
declare const PILL: {
|
|
504
|
+
readonly fontPx: 26;
|
|
505
|
+
readonly lineHeight: 1.1;
|
|
506
|
+
readonly padX: 22;
|
|
507
|
+
readonly padTop: 6;
|
|
508
|
+
readonly padBottom: 8;
|
|
509
|
+
readonly border: 1.5;
|
|
510
|
+
readonly maxWidth: 420;
|
|
511
|
+
readonly maxLines: 3;
|
|
512
|
+
readonly maxGrow: 1.3;
|
|
513
|
+
};
|
|
514
|
+
/** The pill's fixed chrome (padding + border): width and height that don't scale with the text. */
|
|
515
|
+
declare const PILL_CHROME: {
|
|
516
|
+
readonly w: number;
|
|
517
|
+
readonly h: number;
|
|
518
|
+
};
|
|
519
|
+
type PillSize = {
|
|
520
|
+
lines: string[];
|
|
521
|
+
w: number;
|
|
522
|
+
h: number;
|
|
523
|
+
};
|
|
524
|
+
/** Wraps a container's name into its pill at 1x. `measure(text, px)` is the width of `text` in the note face at `px`
|
|
525
|
+
* (an injected canvas measure, like wrapLines in idea.ts); `scale` is the label scale (1.15 in large type). Words wrap
|
|
526
|
+
* greedily inside `maxWidth`; a word wider than that gets its own line (and is clipped). Past `maxLines` the last
|
|
527
|
+
* line ends in an ellipsis. `w` is the widest line plus the chrome (at most `maxWidth`), `h` the lines plus the chrome. */
|
|
528
|
+
declare function pillLayout(name: string, measure: (text: string, px: number) => number, scale?: number): PillSize;
|
|
529
|
+
/** The pill as drawn at label growth `k` (1 to PILL.maxGrow): the text grows, the padding and border don't. */
|
|
530
|
+
declare function pillScaled(p: {
|
|
531
|
+
w: number;
|
|
532
|
+
h: number;
|
|
533
|
+
}, k: number): {
|
|
534
|
+
w: number;
|
|
535
|
+
h: number;
|
|
536
|
+
};
|
|
486
537
|
/** The hull around a group's ideas: `padX` / `padY` beyond their centres, or more for an idea that has grown to show
|
|
487
|
-
* its label (`rx` / `ry`, its half size: then its outline plus HULL_CLEAR).
|
|
538
|
+
* its label (`rx` / `ry`, its half size: then its outline plus HULL_CLEAR). With the name's `pill` (its 1x size,
|
|
539
|
+
* from pillLayout) the hull is also widened, symmetrically about its centre, so that the pill at its largest drawn
|
|
540
|
+
* size (PILL.maxGrow) fits on the straight part of an edge: pill width + 2 × the corner radius. Hull and pill then
|
|
541
|
+
* never change while zooming. Without a pill the hull is as before. */
|
|
488
542
|
declare function containerHull(members: ReadonlyArray<Pt & {
|
|
489
543
|
rx?: number;
|
|
490
544
|
ry?: number;
|
|
491
|
-
}
|
|
545
|
+
}>, pill?: {
|
|
546
|
+
w: number;
|
|
547
|
+
h: number;
|
|
548
|
+
} | null): Hull | null;
|
|
492
549
|
/** Candidate spots for a w × h pill, in preference order: bottom center (the default look), top center, the thirds of
|
|
493
550
|
* bottom and top, then the sides. Spots keep the whole pill on the straight part of an edge, clear of the corners. */
|
|
494
551
|
declare function labelCandidates(hull: Hull, w: number, h: number): {
|
|
@@ -522,4 +579,4 @@ declare function ideaDetail(screenWidth: number, emphasised?: boolean): IdeaDeta
|
|
|
522
579
|
/** Whether idea shadows are drawn with this many ideas in view. */
|
|
523
580
|
declare function shadowsShown(visibleIdeas: number): boolean;
|
|
524
581
|
|
|
525
|
-
export { BACK, type Bezier, type BoundingBox, type ContainerGroupInfo, type CullingOptions, DETAIL, EASE, FEATURE_FLAGS, FIT_ROOM, FRAME, type FitResult, FlatNode, type FrameBox, type FrameInsets, GESTURE, HULL, HULL_CLEAR, type Hull, type IRenderConfigStore, type ISelectionStore, type ISpatialIndex, type IdeaDetail, type Box as LabelBox, type LabelPlacement, type LabelSide, type LayerVia, MOTION, MindMapConnection, NodeSelection, PEEK, PEEK_PLACEMENT, type Pt, RBushSpatialIndex, RenderConfig, SHEET, TERM, TRAIL, VIEW, ViewportState, VisualliDocument, VisualliLayer, bloomOffset, calculateFitCenter, calculateFitView, calculateFitZoom, connectorDelay, connectorSamples, containerHull, cssEase, ease as easeBezier, fitView, fitViewInset, getChildLayerForNode, getConnectionsForLayer, getContainersForLayer, getLayerForNavigation, getViewportVisibleNodes, hoverOpensTerm, ideaDetail, intersectsViewport, labelCandidates, layerBlooms, layerBounds, layerFrame, layerReveal, motionVars, peekPosition, pinchZoom, placeContainerLabel, pointerModeFor, renderConfigStore, revealDelay, revealSlot, revealTotal, selectionStore, shadowsShown, swapDelay, zoomAround };
|
|
582
|
+
export { BACK, type Bezier, type BoundingBox, type ContainerGroupInfo, type CullingOptions, DETAIL, EASE, FEATURE_FLAGS, FIT_ROOM, FRAME, type FitContainer, type FitResult, FlatNode, type FrameBox, type FrameInsets, GESTURE, HULL, HULL_CLEAR, type Hull, type IRenderConfigStore, type ISelectionStore, type ISpatialIndex, type IdeaDetail, type Box as LabelBox, type LabelPlacement, type LabelSide, type LayerVia, MOTION, MindMapConnection, NodeSelection, PEEK, PEEK_PLACEMENT, PILL, PILL_CHROME, type PillSize, type Pt, RBushSpatialIndex, RenderConfig, SHEET, TERM, TRAIL, VIEW, ViewportState, VisualliDocument, VisualliLayer, bloomOffset, calculateFitCenter, calculateFitView, calculateFitZoom, connectorDelay, connectorSamples, containerHull, cssEase, ease as easeBezier, fitView, fitViewInset, getChildLayerForNode, getConnectionsForLayer, getContainersForLayer, getLayerForNavigation, getViewportVisibleNodes, hoverOpensTerm, ideaDetail, ideaHighlight, intersectsViewport, labelCandidates, layerBlooms, layerBounds, layerFrame, layerReveal, motionVars, peekPosition, pillLayout, pillScaled, pinchZoom, placeContainerLabel, pointerModeFor, renderConfigStore, revealDelay, revealSlot, revealTotal, selectionStore, shadowsShown, swapDelay, zoomAround };
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
setViewportCenter,
|
|
10
10
|
worldToScreen,
|
|
11
11
|
zoomViewport
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-YU3KV4UY.js";
|
|
13
13
|
import "./chunk-LSPDGEVE.js";
|
|
14
14
|
import {
|
|
15
15
|
DEFAULT_RENDER_CONFIG,
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
getRecommendedRenderConfig,
|
|
23
23
|
getRenderConfigForQuality,
|
|
24
24
|
isFeatureEnabled
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-2JCBDPOL.js";
|
|
26
26
|
import {
|
|
27
27
|
checkCollision,
|
|
28
28
|
getNodeBounds,
|
|
@@ -49,7 +49,7 @@ import {
|
|
|
49
49
|
parseVisualliFile,
|
|
50
50
|
parseVisualliFromMongoDB,
|
|
51
51
|
resolveNodeOverlaps
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-EGXQEULM.js";
|
|
53
53
|
import {
|
|
54
54
|
BLOB_SHAPES,
|
|
55
55
|
ELLIPSE,
|
|
@@ -81,7 +81,7 @@ import {
|
|
|
81
81
|
shapeOfLevel,
|
|
82
82
|
wrapInShape,
|
|
83
83
|
wrapLines
|
|
84
|
-
} from "./chunk-
|
|
84
|
+
} from "./chunk-3UZU4SK5.js";
|
|
85
85
|
import {
|
|
86
86
|
LAYOUT_SPACING
|
|
87
87
|
} from "./chunk-N7HCYULH.js";
|
|
@@ -96,7 +96,7 @@ import {
|
|
|
96
96
|
FPSMonitor,
|
|
97
97
|
MemoryMonitor,
|
|
98
98
|
PerformanceProfiler
|
|
99
|
-
} from "./chunk-
|
|
99
|
+
} from "./chunk-T3SFVKHY.js";
|
|
100
100
|
import {
|
|
101
101
|
BACK,
|
|
102
102
|
CIRCULAR_REFERENCE_MAX_DEPTH,
|
|
@@ -152,12 +152,13 @@ import {
|
|
|
152
152
|
fitView,
|
|
153
153
|
fitViewInset,
|
|
154
154
|
hoverOpensTerm,
|
|
155
|
+
ideaHighlight,
|
|
155
156
|
layerBounds,
|
|
156
157
|
peekPosition,
|
|
157
158
|
pinchZoom,
|
|
158
159
|
pointerModeFor,
|
|
159
160
|
zoomAround
|
|
160
|
-
} from "./chunk-
|
|
161
|
+
} from "./chunk-3RLUS5K7.js";
|
|
161
162
|
import {
|
|
162
163
|
CUSTOM,
|
|
163
164
|
IMMERSION,
|
|
@@ -178,7 +179,7 @@ import {
|
|
|
178
179
|
topicFor,
|
|
179
180
|
topicFromName,
|
|
180
181
|
topicStyle
|
|
181
|
-
} from "./chunk-
|
|
182
|
+
} from "./chunk-6GAKZATW.js";
|
|
182
183
|
import {
|
|
183
184
|
CANVAS_STYLE,
|
|
184
185
|
DESIGN_SYSTEM_VERSION,
|
|
@@ -188,7 +189,7 @@ import {
|
|
|
188
189
|
TOKENS,
|
|
189
190
|
TOPICS,
|
|
190
191
|
TYPE_STYLES
|
|
191
|
-
} from "./chunk-
|
|
192
|
+
} from "./chunk-6LHBNFP4.js";
|
|
192
193
|
import "./chunk-VLGR5PZX.js";
|
|
193
194
|
|
|
194
195
|
// src/spatial/spatialIndex.ts
|
|
@@ -292,7 +293,43 @@ var renderConfigStore = createStore((set, get) => ({
|
|
|
292
293
|
var HULL = { padX: 150, padY: 125, radius: 48 };
|
|
293
294
|
var WEIGHT = { idea: 1e3, label: 1e3, connector: 60, preference: 1 };
|
|
294
295
|
var HULL_CLEAR = { x: 50, y: 51 };
|
|
295
|
-
|
|
296
|
+
var PILL = {
|
|
297
|
+
fontPx: 26,
|
|
298
|
+
lineHeight: 1.1,
|
|
299
|
+
padX: 22,
|
|
300
|
+
padTop: 6,
|
|
301
|
+
padBottom: 8,
|
|
302
|
+
border: 1.5,
|
|
303
|
+
maxWidth: 420,
|
|
304
|
+
maxLines: 3,
|
|
305
|
+
maxGrow: 1.3
|
|
306
|
+
};
|
|
307
|
+
var PILL_CHROME = { w: 2 * PILL.padX + 2 * PILL.border, h: PILL.padTop + PILL.padBottom + 2 * PILL.border };
|
|
308
|
+
function pillLayout(name, measure, scale = 1) {
|
|
309
|
+
const px = PILL.fontPx * scale, room = PILL.maxWidth - PILL_CHROME.w, m = (s) => measure(s, px);
|
|
310
|
+
const words = name.split(/\s+/).filter(Boolean);
|
|
311
|
+
let lines = [], cur = "";
|
|
312
|
+
for (const w of words) {
|
|
313
|
+
const next = cur ? `${cur} ${w}` : w;
|
|
314
|
+
if (cur && m(next) > room) {
|
|
315
|
+
lines.push(cur);
|
|
316
|
+
cur = w;
|
|
317
|
+
} else cur = next;
|
|
318
|
+
}
|
|
319
|
+
if (cur) lines.push(cur);
|
|
320
|
+
if (!lines.length) lines = [""];
|
|
321
|
+
if (lines.length > PILL.maxLines) {
|
|
322
|
+
let last = lines.slice(PILL.maxLines - 1).join(" ");
|
|
323
|
+
while (last.length > 1 && m(last + "\u2026") > room) last = last.slice(0, -1);
|
|
324
|
+
lines = [...lines.slice(0, PILL.maxLines - 1), last.replace(/\s+$/, "") + "\u2026"];
|
|
325
|
+
}
|
|
326
|
+
const widest = Math.max(...lines.map(m));
|
|
327
|
+
return { lines, w: Math.min(PILL.maxWidth, widest + PILL_CHROME.w), h: lines.length * px * PILL.lineHeight + PILL_CHROME.h };
|
|
328
|
+
}
|
|
329
|
+
function pillScaled(p, k) {
|
|
330
|
+
return { w: (p.w - PILL_CHROME.w) * k + PILL_CHROME.w, h: (p.h - PILL_CHROME.h) * k + PILL_CHROME.h };
|
|
331
|
+
}
|
|
332
|
+
function containerHull(members, pill) {
|
|
296
333
|
if (!members.length) return null;
|
|
297
334
|
let x0 = Infinity, y0 = Infinity, x1 = -Infinity, y1 = -Infinity;
|
|
298
335
|
for (const m of members) {
|
|
@@ -302,6 +339,13 @@ function containerHull(members) {
|
|
|
302
339
|
y0 = Math.min(y0, m.y - py);
|
|
303
340
|
y1 = Math.max(y1, m.y + py);
|
|
304
341
|
}
|
|
342
|
+
if (pill) {
|
|
343
|
+
const need = pillScaled(pill, PILL.maxGrow).w + 2 * HULL.radius, cx = (x0 + x1) / 2;
|
|
344
|
+
if (x1 - x0 < need) {
|
|
345
|
+
x0 = cx - need / 2;
|
|
346
|
+
x1 = cx + need / 2;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
305
349
|
return { x0, x1, y0, y1, radius: HULL.radius };
|
|
306
350
|
}
|
|
307
351
|
function labelCandidates(hull, w, h) {
|
|
@@ -385,8 +429,8 @@ function layerFrame(nodes, containers = []) {
|
|
|
385
429
|
const hull = containerHull(c.nodeIds.flatMap((id) => {
|
|
386
430
|
const n = byId.get(id);
|
|
387
431
|
return n ? [{ x: n.x, y: n.y, rx: n.width / 2, ry: n.height / 2 }] : [];
|
|
388
|
-
}));
|
|
389
|
-
if (hull) hulls.push(hull);
|
|
432
|
+
}), c.pill);
|
|
433
|
+
if (hull) hulls.push(c.pill ? { ...hull, pillH: pillScaled(c.pill, PILL.maxGrow).h } : hull);
|
|
390
434
|
}
|
|
391
435
|
return layerBounds(nodes.map((n) => ({ x: n.x, y: n.y, rx: n.width / 2, ry: n.height / 2 })), hulls);
|
|
392
436
|
}
|
|
@@ -677,6 +721,8 @@ export {
|
|
|
677
721
|
PEEK,
|
|
678
722
|
PEEK_PLACEMENT,
|
|
679
723
|
PERFORMANCE_TOAST_COOLDOWN,
|
|
724
|
+
PILL,
|
|
725
|
+
PILL_CHROME,
|
|
680
726
|
PerformanceProfiler,
|
|
681
727
|
QUALITY_HIGH,
|
|
682
728
|
QUALITY_LEVELS,
|
|
@@ -766,6 +812,7 @@ export {
|
|
|
766
812
|
hoverOpensTerm,
|
|
767
813
|
ideaColor,
|
|
768
814
|
ideaDetail,
|
|
815
|
+
ideaHighlight,
|
|
769
816
|
ideaKindOf,
|
|
770
817
|
ideaSize,
|
|
771
818
|
ideaStyle,
|
|
@@ -797,6 +844,8 @@ export {
|
|
|
797
844
|
parseVisualliFile,
|
|
798
845
|
parseVisualliFromMongoDB,
|
|
799
846
|
peekPosition,
|
|
847
|
+
pillLayout,
|
|
848
|
+
pillScaled,
|
|
800
849
|
pinchZoom,
|
|
801
850
|
placeContainerLabel,
|
|
802
851
|
pointerModeFor,
|