stickyflow 0.5.0 → 0.7.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.
- package/CHANGELOG.md +43 -0
- package/dist/binding/index.cjs +9 -9
- package/dist/binding/index.d.cts +4 -4
- package/dist/binding/index.d.ts +4 -4
- package/dist/binding/index.js +3 -3
- package/dist/{chunk-ZMLQIMJK.cjs → chunk-A73UJ5AQ.cjs} +1537 -738
- package/dist/chunk-A73UJ5AQ.cjs.map +1 -0
- package/dist/{chunk-VK3T6O5Z.cjs → chunk-BUOWM3LC.cjs} +745 -62
- package/dist/chunk-BUOWM3LC.cjs.map +1 -0
- package/dist/{chunk-L3VJXZFD.cjs → chunk-EKAWJFJQ.cjs} +15 -15
- package/dist/{chunk-L3VJXZFD.cjs.map → chunk-EKAWJFJQ.cjs.map} +1 -1
- package/dist/{chunk-BODZN3ZI.js → chunk-JCRPLPKV.js} +156 -23
- package/dist/chunk-JCRPLPKV.js.map +1 -0
- package/dist/{chunk-IEHE6WVN.js → chunk-JQK4IGXJ.js} +489 -51
- package/dist/chunk-JQK4IGXJ.js.map +1 -0
- package/dist/{chunk-XY2GZUHC.cjs → chunk-KXYSO6GC.cjs} +498 -50
- package/dist/chunk-KXYSO6GC.cjs.map +1 -0
- package/dist/{chunk-G7NRK5AG.js → chunk-MUKIGLR5.js} +717 -34
- package/dist/chunk-MUKIGLR5.js.map +1 -0
- package/dist/{chunk-TWDLOXRM.cjs → chunk-OWNVXKXN.cjs} +170 -37
- package/dist/chunk-OWNVXKXN.cjs.map +1 -0
- package/dist/{chunk-LTGF5OHP.js → chunk-SDMQRSRW.js} +941 -143
- package/dist/chunk-SDMQRSRW.js.map +1 -0
- package/dist/{chunk-7VW2XKVB.js → chunk-ZNHYW47T.js} +3 -3
- package/dist/{chunk-7VW2XKVB.js.map → chunk-ZNHYW47T.js.map} +1 -1
- package/dist/index.cjs +57 -29
- package/dist/index.d.cts +80 -7
- package/dist/index.d.ts +80 -7
- package/dist/index.js +5 -5
- package/dist/interaction/index.cjs +245 -235
- package/dist/interaction/index.cjs.map +1 -1
- package/dist/interaction/index.d.cts +3 -2
- package/dist/interaction/index.d.ts +3 -2
- package/dist/interaction/index.js +17 -7
- package/dist/interaction/index.js.map +1 -1
- package/dist/{render-CgX_y15a.d.ts → render-BU2uYzjG.d.cts} +40 -16
- package/dist/{render-CgX_y15a.d.cts → render-BU2uYzjG.d.ts} +40 -16
- package/dist/{runtime-reWgr7MP.d.cts → runtime-B7KiTmn8.d.cts} +2 -2
- package/dist/{runtime-DnUxca3Y.d.ts → runtime-BPzyD-Nd.d.ts} +2 -2
- package/dist/{runtimeTypes-D60w6nyF.d.cts → runtimeTypes-BIP70z72.d.cts} +3 -2
- package/dist/{runtimeTypes-CEBGueYM.d.ts → runtimeTypes-DalvhScn.d.ts} +3 -2
- package/dist/stickyflow-diagram.global.js +387 -36
- package/dist/stickyflow-diagram.global.js.map +1 -1
- package/dist/{types-DYLC_lsk.d.ts → types-DMWs27Hn.d.ts} +1 -1
- package/dist/{types-DvhMpqrL.d.cts → types-D_2NZ6lL.d.cts} +1 -1
- package/dist/viewer/index.cjs +9 -9
- package/dist/viewer/index.d.cts +5 -4
- package/dist/viewer/index.d.ts +5 -4
- package/dist/viewer/index.js +4 -4
- package/dist/web-component/index.cjs +6 -6
- package/dist/web-component/index.d.cts +2 -2
- package/dist/web-component/index.d.ts +2 -2
- package/dist/web-component/index.js +4 -4
- package/package.json +1 -1
- package/dist/chunk-BODZN3ZI.js.map +0 -1
- package/dist/chunk-G7NRK5AG.js.map +0 -1
- package/dist/chunk-IEHE6WVN.js.map +0 -1
- package/dist/chunk-LTGF5OHP.js.map +0 -1
- package/dist/chunk-TWDLOXRM.cjs.map +0 -1
- package/dist/chunk-VK3T6O5Z.cjs.map +0 -1
- package/dist/chunk-XY2GZUHC.cjs.map +0 -1
- package/dist/chunk-ZMLQIMJK.cjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { O as OwnerRef, E as Emitter$1, V as Viewer, U as Unsubscribe } from '../types-
|
|
2
|
-
import {
|
|
1
|
+
import { O as OwnerRef, E as Emitter$1, V as Viewer, U as Unsubscribe } from '../types-D_2NZ6lL.cjs';
|
|
2
|
+
import { Z as Side, I as IsometricFace } from '../render-BU2uYzjG.cjs';
|
|
3
3
|
|
|
4
4
|
interface TextChangeEvent {
|
|
5
5
|
owner: OwnerRef;
|
|
@@ -202,6 +202,7 @@ interface InsertPathOptions {
|
|
|
202
202
|
points: Array<{
|
|
203
203
|
x: number;
|
|
204
204
|
y: number;
|
|
205
|
+
tension?: number;
|
|
205
206
|
}>;
|
|
206
207
|
closed?: boolean;
|
|
207
208
|
tension?: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { O as OwnerRef, E as Emitter$1, V as Viewer, U as Unsubscribe } from '../types-
|
|
2
|
-
import {
|
|
1
|
+
import { O as OwnerRef, E as Emitter$1, V as Viewer, U as Unsubscribe } from '../types-DMWs27Hn.js';
|
|
2
|
+
import { Z as Side, I as IsometricFace } from '../render-BU2uYzjG.js';
|
|
3
3
|
|
|
4
4
|
interface TextChangeEvent {
|
|
5
5
|
owner: OwnerRef;
|
|
@@ -202,6 +202,7 @@ interface InsertPathOptions {
|
|
|
202
202
|
points: Array<{
|
|
203
203
|
x: number;
|
|
204
204
|
y: number;
|
|
205
|
+
tension?: number;
|
|
205
206
|
}>;
|
|
206
207
|
closed?: boolean;
|
|
207
208
|
tension?: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { screenRectOf, Emitter, resolveOwner, isCameraGesture, pointerUserPoint, clearAlignmentGuides, updateAlignmentGuides, pxPerUnit, findOwnerNode, isPrimary, SVG_NAMESPACE, isTextLabel, findSnapCandidateBounds, symbolDeclaredBounds, updateQuickDuplicateBubbles, isometricGeometryOf, ISO_HALO_ATTR, ISO_DUPLICATE_BUBBLES_ATTR, updateHalo, axisArrowPlacements, updateAxisArrowGroup, PATH_HALO_ATTR, findAllOwnerNodes, findIsometricApexCandidates, DERIVED_HEIGHT_ROLES, resizeHandlePositions, pathGeometryOf } from '../chunk-
|
|
2
|
-
import { sflToCanvasState, isIsometricObject, tokenizeSource, roundedOrthogonalPathData, seriesLabelOffsetXProp, seriesLabelOffsetYProp, radarVertexPoint, AXIS_SIN, AXIS_COS, freeformPathData, CORNER_RADIUS_ATTR, isometricFaces, roundedPolygonPath, isometricTopFaceCenter, calculateLinkRoute, pointAtPort, roundedBarPath, barShapePath, formatBarLabel, LABEL_WIDTH, LEADER_INSET, clipSegmentToRect, radarValueAtPoint, radarSeriesPath, estimateTextWidth, wrapText, personLabelArea, isometricFaceCenter, PATH_POINT_INDEX_ATTR, linePathData, barLabelSize, BAR_LABEL, pillPath, getLineMidpoint, labelGapDash, pillCornerRadius, SQUARE_CORNER_ATTR, cornersRoundedRectPath, localShapePath, relativeOffsetOnRectangleSide, edgePointToward, SYMBOL_POINTS_ATTR, SYMBOL_TENSION_ATTR } from '../chunk-
|
|
1
|
+
import { screenRectOf, Emitter, resolveOwner, isCameraGesture, pointerUserPoint, clearAlignmentGuides, updateAlignmentGuides, pxPerUnit, findOwnerNode, isPrimary, SVG_NAMESPACE, isTextLabel, findSnapCandidateBounds, symbolDeclaredBounds, updateQuickDuplicateBubbles, isometricGeometryOf, ISO_HALO_ATTR, ISO_DUPLICATE_BUBBLES_ATTR, updateHalo, axisArrowPlacements, updateAxisArrowGroup, PATH_HALO_ATTR, findAllOwnerNodes, findIsometricApexCandidates, DERIVED_HEIGHT_ROLES, resizeHandlePositions, pathGeometryOf } from '../chunk-ZNHYW47T.js';
|
|
2
|
+
import { sflToCanvasState, isIsometricObject, tokenizeSource, roundedOrthogonalPathData, seriesLabelOffsetXProp, seriesLabelOffsetYProp, radarVertexPoint, AXIS_SIN, AXIS_COS, freeformPathData, CORNER_RADIUS_ATTR, isometricFaces, roundedPolygonPath, isometricTopFaceCenter, calculateLinkRoute, pointAtPort, roundedBarPath, barShapePath, formatBarLabel, LABEL_WIDTH, LEADER_INSET, clipSegmentToRect, radarValueAtPoint, radarSeriesPath, estimateTextWidth, wrapText, personLabelArea, isometricFaceCenter, PATH_POINT_INDEX_ATTR, linePathData, barLabelSize, BAR_LABEL, pillPath, getLineMidpoint, labelGapDash, pillCornerRadius, SQUARE_CORNER_ATTR, cornersRoundedRectPath, localShapePath, relativeOffsetOnRectangleSide, edgePointToward, SYMBOL_POINTS_ATTR, SYMBOL_TENSION_ATTR } from '../chunk-JQK4IGXJ.js';
|
|
3
3
|
|
|
4
4
|
// src/runtime/interaction/chartValue/coordinates.ts
|
|
5
5
|
function pointerUserY(svg, event) {
|
|
@@ -6707,7 +6707,10 @@ function resolveCanvasObjectInsertionTarget(sfl, lines, parentId) {
|
|
|
6707
6707
|
// src/runtime/interaction/sflPatch/canvasObjectPatch/pathBlockText.ts
|
|
6708
6708
|
function buildPathBlock(options, origin, baseIndent) {
|
|
6709
6709
|
const bodyIndent = `${baseIndent} `;
|
|
6710
|
-
const points = options.points.map((point) =>
|
|
6710
|
+
const points = options.points.map((point) => {
|
|
6711
|
+
const pair = `${round1(point.x - origin.x)}, ${round1(point.y - origin.y)}`;
|
|
6712
|
+
return point.tension === void 0 ? `[${pair}]` : `[${pair}, ${round1(point.tension)}]`;
|
|
6713
|
+
}).join(", ");
|
|
6711
6714
|
const block = [`${baseIndent}Path ${options.id} {`, `${bodyIndent}points: [${points}]`];
|
|
6712
6715
|
if (options.closed) {
|
|
6713
6716
|
block.push(`${bodyIndent}closed: true`);
|
|
@@ -7118,11 +7121,12 @@ function readSpan(lines, span) {
|
|
|
7118
7121
|
].join("\n");
|
|
7119
7122
|
}
|
|
7120
7123
|
function formatPoints(points) {
|
|
7121
|
-
|
|
7124
|
+
const one = (point) => point.tension === void 0 ? `[${round1(point.x)}, ${round1(point.y)}]` : `[${round1(point.x)}, ${round1(point.y)}, ${round1(point.tension)}]`;
|
|
7125
|
+
return `[${points.map(one).join(", ")}]`;
|
|
7122
7126
|
}
|
|
7123
7127
|
|
|
7124
7128
|
// src/runtime/interaction/sflPatch/changes/moveChange.ts
|
|
7125
|
-
var POINT_PAIR = /\[\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s
|
|
7129
|
+
var POINT_PAIR = /\[\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*(,\s*-?[\d.]+\s*)?\]/g;
|
|
7126
7130
|
function movePathPoints(lines, range, dx, dy) {
|
|
7127
7131
|
const span = pointsSpan(lines, range);
|
|
7128
7132
|
if (span === null) {
|
|
@@ -7130,7 +7134,7 @@ function movePathPoints(lines, range, dx, dy) {
|
|
|
7130
7134
|
}
|
|
7131
7135
|
const shifted = readSpan(lines, span).replace(
|
|
7132
7136
|
POINT_PAIR,
|
|
7133
|
-
(_match, x, y) => `[${round1(Number(x) + dx)}, ${round1(Number(y) + dy)}]`
|
|
7137
|
+
(_match, x, y, rest) => `[${round1(Number(x) + dx)}, ${round1(Number(y) + dy)}${rest ? `, ${rest.replace(/^,\s*/, "").trim()}` : ""}]`
|
|
7134
7138
|
);
|
|
7135
7139
|
replacePropertyValue(lines, span, shifted);
|
|
7136
7140
|
}
|
|
@@ -7176,7 +7180,13 @@ function applyPathPointChange(sfl, event) {
|
|
|
7176
7180
|
if (!span) {
|
|
7177
7181
|
return sfl;
|
|
7178
7182
|
}
|
|
7179
|
-
const
|
|
7183
|
+
const kept = canvasObject.objectType === "path" ? canvasObject.path?.points : void 0;
|
|
7184
|
+
const sameCount = kept?.length === event.points.length;
|
|
7185
|
+
const relative = event.points.map((point, index) => {
|
|
7186
|
+
const tension = sameCount ? kept?.[index]?.tension : void 0;
|
|
7187
|
+
const moved = { x: point.x - origin.x, y: point.y - origin.y };
|
|
7188
|
+
return tension === void 0 ? moved : { ...moved, tension };
|
|
7189
|
+
});
|
|
7180
7190
|
replacePropertyValue(lines, span, formatPoints(relative));
|
|
7181
7191
|
return lines.join("\n");
|
|
7182
7192
|
}
|