stickyflow 0.10.0 → 0.11.1
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 +26 -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-TECWZVIM.cjs → chunk-4KBU4CFU.cjs} +23 -23
- package/dist/{chunk-TECWZVIM.cjs.map → chunk-4KBU4CFU.cjs.map} +1 -1
- package/dist/{chunk-EGUPN56K.js → chunk-BFQWCOEC.js} +3 -3
- package/dist/{chunk-EGUPN56K.js.map → chunk-BFQWCOEC.js.map} +1 -1
- package/dist/{chunk-VPNOVRWP.js → chunk-DGAVCN4D.js} +262 -15
- package/dist/chunk-DGAVCN4D.js.map +1 -0
- package/dist/{chunk-5PJ55GPG.cjs → chunk-EHH6ZDK6.cjs} +1076 -713
- package/dist/chunk-EHH6ZDK6.cjs.map +1 -0
- package/dist/{chunk-HRU6VOEC.js → chunk-G6IW2IX3.js} +44 -7
- package/dist/chunk-G6IW2IX3.js.map +1 -0
- package/dist/{chunk-SDOHUNBW.js → chunk-TQIYK5OA.js} +435 -72
- package/dist/chunk-TQIYK5OA.js.map +1 -0
- package/dist/{chunk-L7CEX5JV.js → chunk-UD6IG2PG.js} +4 -4
- package/dist/{chunk-L7CEX5JV.js.map → chunk-UD6IG2PG.js.map} +1 -1
- package/dist/{chunk-LSEMXRB5.cjs → chunk-UHKFJBY5.cjs} +44 -7
- package/dist/chunk-UHKFJBY5.cjs.map +1 -0
- package/dist/{chunk-KRSX4UZ7.cjs → chunk-VYQ6N5SI.cjs} +293 -46
- package/dist/chunk-VYQ6N5SI.cjs.map +1 -0
- package/dist/{chunk-SCD3AHMY.cjs → chunk-WZA3DJJH.cjs} +15 -15
- package/dist/{chunk-SCD3AHMY.cjs.map → chunk-WZA3DJJH.cjs.map} +1 -1
- package/dist/index.cjs +36 -36
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +5 -5
- package/dist/interaction/index.cjs +308 -256
- package/dist/interaction/index.cjs.map +1 -1
- package/dist/interaction/index.d.cts +5 -4
- package/dist/interaction/index.d.ts +5 -4
- package/dist/interaction/index.js +74 -23
- package/dist/interaction/index.js.map +1 -1
- package/dist/{render-DU4lYbRl.d.cts → render-BDO4S5uF.d.cts} +16 -0
- package/dist/{render-DU4lYbRl.d.ts → render-BDO4S5uF.d.ts} +16 -0
- package/dist/{runtime-Bkv7QW7H.d.cts → runtime-C-C5v9po.d.cts} +2 -2
- package/dist/{runtime-DJ4K4_HZ.d.ts → runtime-lCAfU-1Q.d.ts} +2 -2
- package/dist/{runtimeTypes-C1shzoyr.d.ts → runtimeTypes-B7p6b1Bi.d.cts} +2 -2
- package/dist/{runtimeTypes-BvJBZLkr.d.cts → runtimeTypes-BDA_CfWh.d.ts} +2 -2
- package/dist/stickyflow-diagram.global.js +197 -44
- package/dist/stickyflow-diagram.global.js.map +1 -1
- package/dist/{types-B5jrEEcF.d.cts → types-CZJzycKw.d.cts} +1 -1
- package/dist/{types-B7IkZ0w4.d.ts → types-Dp8JVZLB.d.ts} +1 -1
- package/dist/viewer/index.cjs +9 -9
- package/dist/viewer/index.d.cts +4 -4
- package/dist/viewer/index.d.ts +4 -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-5PJ55GPG.cjs.map +0 -1
- package/dist/chunk-HRU6VOEC.js.map +0 -1
- package/dist/chunk-KRSX4UZ7.cjs.map +0 -1
- package/dist/chunk-LSEMXRB5.cjs.map +0 -1
- package/dist/chunk-SDOHUNBW.js.map +0 -1
- package/dist/chunk-VPNOVRWP.js.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 { Z as Side, I as IsometricFace } from '../render-
|
|
1
|
+
import { O as OwnerRef, E as Emitter$1, V as Viewer, U as Unsubscribe } from '../types-CZJzycKw.cjs';
|
|
2
|
+
import { Z as Side, I as IsometricFace } from '../render-BDO4S5uF.cjs';
|
|
3
3
|
|
|
4
4
|
interface TextChangeEvent {
|
|
5
5
|
owner: OwnerRef;
|
|
@@ -184,7 +184,7 @@ declare function openColorPopover(options: ColorPopoverOptions): ColorPopoverHan
|
|
|
184
184
|
|
|
185
185
|
interface InsertCanvasObjectOptions {
|
|
186
186
|
id: string;
|
|
187
|
-
kind: 'shape' | 'text' | 'frame' | 'swimlane' | 'isometric';
|
|
187
|
+
kind: 'shape' | 'text' | 'image' | 'frame' | 'swimlane' | 'isometric';
|
|
188
188
|
text?: string;
|
|
189
189
|
x: number;
|
|
190
190
|
y: number;
|
|
@@ -221,6 +221,7 @@ declare function applyLinkReconnectChange(sfl: string, event: LinkReconnectEvent
|
|
|
221
221
|
|
|
222
222
|
declare function applyLinkSegmentChange(sfl: string, event: LinkSegmentChangeEvent): string;
|
|
223
223
|
|
|
224
|
+
declare function applyMoveChanges(sfl: string, events: readonly MoveChangeEvent[]): string;
|
|
224
225
|
declare function applyMoveChange(sfl: string, event: MoveChangeEvent): string;
|
|
225
226
|
|
|
226
227
|
declare function applyPathPointChange(sfl: string, event: PathPointChangeEvent): string;
|
|
@@ -280,4 +281,4 @@ interface EditingOptions {
|
|
|
280
281
|
}
|
|
281
282
|
declare function bindEditing(viewer: Viewer, options?: EditingOptions): Interaction;
|
|
282
283
|
|
|
283
|
-
export { type ChartValueChangeEvent, type ColorEditHandle, type ColorPickerTheme, type ColorPickerThemeOption, type ColorPopoverHandle, type ColorPopoverOptions, type DeleteEvent, type EditableRules, type EditingOptions, type InsertCanvasObjectOptions, type InsertConnectionOptions, type InsertLinkOptions, type InsertPathOptions, type Interaction, type InteractionEventMap, type InteractionEventName, type IsometricQuickDuplicateDirection, type LinkReconnectEvent, type LinkSegmentChangeEvent, type LinkToEvent, type MoveChangeEvent, type PathDrawCompleteEvent, type PathDrawOptions, type PathPoint, type PathPointChangeEvent, type PickerValue, type PropertyChangeEvent, type PropertyEditingHandle, type PropertyEditingOptions, type PropertyValue, type QuickDuplicateEvent, type QuickDuplicateOptions, type RemoveCanvasObjectOptions, type ResizeChangeEvent, type SankeyNodeMoveEvent, type SankeyNodeRenameEvent, type TextChangeEvent, Unsubscribe, applyChartValueChange, applyLinkReconnectChange, applyLinkSegmentChange, applyMoveChange, applyPathPointChange, applyPropertyChange, applyQuickDuplicateChange, applyResizeChange, applySankeyNodeMoveChange, applySankeyNodeRenameChange, applyTextChange, bindEditing, bindPropertyEditing, cssBackground, formatPickerValue, insertCanvasObject, insertConnection, insertLink, insertPath, openColorPopover, readGradientValue, removeCanvasObject, removeLink, resolveTheme, seedFrom };
|
|
284
|
+
export { type ChartValueChangeEvent, type ColorEditHandle, type ColorPickerTheme, type ColorPickerThemeOption, type ColorPopoverHandle, type ColorPopoverOptions, type DeleteEvent, type EditableRules, type EditingOptions, type InsertCanvasObjectOptions, type InsertConnectionOptions, type InsertLinkOptions, type InsertPathOptions, type Interaction, type InteractionEventMap, type InteractionEventName, type IsometricQuickDuplicateDirection, type LinkReconnectEvent, type LinkSegmentChangeEvent, type LinkToEvent, type MoveChangeEvent, type PathDrawCompleteEvent, type PathDrawOptions, type PathPoint, type PathPointChangeEvent, type PickerValue, type PropertyChangeEvent, type PropertyEditingHandle, type PropertyEditingOptions, type PropertyValue, type QuickDuplicateEvent, type QuickDuplicateOptions, type RemoveCanvasObjectOptions, type ResizeChangeEvent, type SankeyNodeMoveEvent, type SankeyNodeRenameEvent, type TextChangeEvent, Unsubscribe, applyChartValueChange, applyLinkReconnectChange, applyLinkSegmentChange, applyMoveChange, applyMoveChanges, applyPathPointChange, applyPropertyChange, applyQuickDuplicateChange, applyResizeChange, applySankeyNodeMoveChange, applySankeyNodeRenameChange, applyTextChange, bindEditing, bindPropertyEditing, cssBackground, formatPickerValue, insertCanvasObject, insertConnection, insertLink, insertPath, openColorPopover, readGradientValue, removeCanvasObject, removeLink, resolveTheme, seedFrom };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { O as OwnerRef, E as Emitter$1, V as Viewer, U as Unsubscribe } from '../types-
|
|
2
|
-
import { Z as Side, I as IsometricFace } from '../render-
|
|
1
|
+
import { O as OwnerRef, E as Emitter$1, V as Viewer, U as Unsubscribe } from '../types-Dp8JVZLB.js';
|
|
2
|
+
import { Z as Side, I as IsometricFace } from '../render-BDO4S5uF.js';
|
|
3
3
|
|
|
4
4
|
interface TextChangeEvent {
|
|
5
5
|
owner: OwnerRef;
|
|
@@ -184,7 +184,7 @@ declare function openColorPopover(options: ColorPopoverOptions): ColorPopoverHan
|
|
|
184
184
|
|
|
185
185
|
interface InsertCanvasObjectOptions {
|
|
186
186
|
id: string;
|
|
187
|
-
kind: 'shape' | 'text' | 'frame' | 'swimlane' | 'isometric';
|
|
187
|
+
kind: 'shape' | 'text' | 'image' | 'frame' | 'swimlane' | 'isometric';
|
|
188
188
|
text?: string;
|
|
189
189
|
x: number;
|
|
190
190
|
y: number;
|
|
@@ -221,6 +221,7 @@ declare function applyLinkReconnectChange(sfl: string, event: LinkReconnectEvent
|
|
|
221
221
|
|
|
222
222
|
declare function applyLinkSegmentChange(sfl: string, event: LinkSegmentChangeEvent): string;
|
|
223
223
|
|
|
224
|
+
declare function applyMoveChanges(sfl: string, events: readonly MoveChangeEvent[]): string;
|
|
224
225
|
declare function applyMoveChange(sfl: string, event: MoveChangeEvent): string;
|
|
225
226
|
|
|
226
227
|
declare function applyPathPointChange(sfl: string, event: PathPointChangeEvent): string;
|
|
@@ -280,4 +281,4 @@ interface EditingOptions {
|
|
|
280
281
|
}
|
|
281
282
|
declare function bindEditing(viewer: Viewer, options?: EditingOptions): Interaction;
|
|
282
283
|
|
|
283
|
-
export { type ChartValueChangeEvent, type ColorEditHandle, type ColorPickerTheme, type ColorPickerThemeOption, type ColorPopoverHandle, type ColorPopoverOptions, type DeleteEvent, type EditableRules, type EditingOptions, type InsertCanvasObjectOptions, type InsertConnectionOptions, type InsertLinkOptions, type InsertPathOptions, type Interaction, type InteractionEventMap, type InteractionEventName, type IsometricQuickDuplicateDirection, type LinkReconnectEvent, type LinkSegmentChangeEvent, type LinkToEvent, type MoveChangeEvent, type PathDrawCompleteEvent, type PathDrawOptions, type PathPoint, type PathPointChangeEvent, type PickerValue, type PropertyChangeEvent, type PropertyEditingHandle, type PropertyEditingOptions, type PropertyValue, type QuickDuplicateEvent, type QuickDuplicateOptions, type RemoveCanvasObjectOptions, type ResizeChangeEvent, type SankeyNodeMoveEvent, type SankeyNodeRenameEvent, type TextChangeEvent, Unsubscribe, applyChartValueChange, applyLinkReconnectChange, applyLinkSegmentChange, applyMoveChange, applyPathPointChange, applyPropertyChange, applyQuickDuplicateChange, applyResizeChange, applySankeyNodeMoveChange, applySankeyNodeRenameChange, applyTextChange, bindEditing, bindPropertyEditing, cssBackground, formatPickerValue, insertCanvasObject, insertConnection, insertLink, insertPath, openColorPopover, readGradientValue, removeCanvasObject, removeLink, resolveTheme, seedFrom };
|
|
284
|
+
export { type ChartValueChangeEvent, type ColorEditHandle, type ColorPickerTheme, type ColorPickerThemeOption, type ColorPopoverHandle, type ColorPopoverOptions, type DeleteEvent, type EditableRules, type EditingOptions, type InsertCanvasObjectOptions, type InsertConnectionOptions, type InsertLinkOptions, type InsertPathOptions, type Interaction, type InteractionEventMap, type InteractionEventName, type IsometricQuickDuplicateDirection, type LinkReconnectEvent, type LinkSegmentChangeEvent, type LinkToEvent, type MoveChangeEvent, type PathDrawCompleteEvent, type PathDrawOptions, type PathPoint, type PathPointChangeEvent, type PickerValue, type PropertyChangeEvent, type PropertyEditingHandle, type PropertyEditingOptions, type PropertyValue, type QuickDuplicateEvent, type QuickDuplicateOptions, type RemoveCanvasObjectOptions, type ResizeChangeEvent, type SankeyNodeMoveEvent, type SankeyNodeRenameEvent, type TextChangeEvent, Unsubscribe, applyChartValueChange, applyLinkReconnectChange, applyLinkSegmentChange, applyMoveChange, applyMoveChanges, applyPathPointChange, applyPropertyChange, applyQuickDuplicateChange, applyResizeChange, applySankeyNodeMoveChange, applySankeyNodeRenameChange, applyTextChange, bindEditing, bindPropertyEditing, cssBackground, formatPickerValue, insertCanvasObject, insertConnection, insertLink, insertPath, openColorPopover, readGradientValue, removeCanvasObject, removeLink, resolveTheme, seedFrom };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { screenRectOf, Emitter, resolveOwner, isCameraGesture, pointerUserPoint, clearAlignmentGuides, updateAlignmentGuides, pxPerUnit, findOwnerNode, isPrimary, SVG_NAMESPACE, isTextLabel, findSnapCandidateBounds, symbolDeclaredBounds, updateQuickDuplicateBubbles, isometricGeometryOf, updateHalo, axisArrowPlacements, updateAxisArrowGroup, PATH_HALO_ATTR, findAllOwnerNodes, findIsometricApexCandidates, DERIVED_HEIGHT_ROLES, resizeHandlePositions, ISO_HALO_ATTR, ISO_DUPLICATE_BUBBLES_ATTR, pathGeometryOf } from '../chunk-
|
|
2
|
-
import { sflToCanvasState, isIsometricObject, rgbToHex, parseHexRgb, rgbToHsv, 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, hsvToRgb, 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, updateHalo, axisArrowPlacements, updateAxisArrowGroup, PATH_HALO_ATTR, findAllOwnerNodes, findIsometricApexCandidates, DERIVED_HEIGHT_ROLES, resizeHandlePositions, ISO_HALO_ATTR, ISO_DUPLICATE_BUBBLES_ATTR, pathGeometryOf } from '../chunk-BFQWCOEC.js';
|
|
2
|
+
import { sflToCanvasState, isIsometricObject, rgbToHex, parseHexRgb, rgbToHsv, 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, hsvToRgb, 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-G6IW2IX3.js';
|
|
3
3
|
|
|
4
4
|
// src/runtime/interaction/chartValue/coordinates.ts
|
|
5
5
|
function pointerUserY(svg, event) {
|
|
@@ -834,6 +834,14 @@ function trackDrag(node, onMove, onEnd) {
|
|
|
834
834
|
var CHANNELS = ["r", "g", "b"];
|
|
835
835
|
var GAP_BELOW_ANCHOR = 6;
|
|
836
836
|
var VIEWPORT_MARGIN = 8;
|
|
837
|
+
function buildEyedropper(parent) {
|
|
838
|
+
const button = el("button", "sf-cp-eyedropper", parent);
|
|
839
|
+
button.type = "button";
|
|
840
|
+
button.title = "Pick a color from the screen";
|
|
841
|
+
button.setAttribute("aria-label", "Pick a color from the screen");
|
|
842
|
+
button.innerHTML = '<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2 22l1-1h3l9-9"/><path d="M3 21v-3l9-9"/><path d="M15 6l3.4-3.4a2.1 2.1 0 1 1 3 3L18 9l.4.4a2.1 2.1 0 1 1-3 3l-3.8-3.8a2.1 2.1 0 1 1 3-3l.4.4z"/></svg>';
|
|
843
|
+
return button;
|
|
844
|
+
}
|
|
837
845
|
function buildSolidControls(root) {
|
|
838
846
|
const area = el("div", "sf-cp-area", root);
|
|
839
847
|
const matrix = el("div", "sf-cp-matrix", area);
|
|
@@ -857,6 +865,7 @@ function buildSolidControls(root) {
|
|
|
857
865
|
const hexInput = el("input", "sf-cp-text", hexRow);
|
|
858
866
|
hexInput.type = "text";
|
|
859
867
|
hexInput.spellcheck = false;
|
|
868
|
+
const eyedropper = "EyeDropper" in window ? buildEyedropper(hexRow) : void 0;
|
|
860
869
|
return {
|
|
861
870
|
matrix,
|
|
862
871
|
matrixCursor,
|
|
@@ -867,7 +876,8 @@ function buildSolidControls(root) {
|
|
|
867
876
|
alphaRow,
|
|
868
877
|
alphaRange,
|
|
869
878
|
alphaNumber,
|
|
870
|
-
hexInput
|
|
879
|
+
hexInput,
|
|
880
|
+
eyedropper
|
|
871
881
|
};
|
|
872
882
|
}
|
|
873
883
|
function buildGradientControls(root, lockStops) {
|
|
@@ -1004,6 +1014,20 @@ function bindAngle(picker) {
|
|
|
1004
1014
|
angleNumber.addEventListener("input", (event) => applyAngle(picker, read(event)));
|
|
1005
1015
|
angleNumber.addEventListener("change", () => commit(picker));
|
|
1006
1016
|
}
|
|
1017
|
+
function bindEyedropper(picker) {
|
|
1018
|
+
const { eyedropper } = picker.view;
|
|
1019
|
+
eyedropper?.addEventListener("click", async () => {
|
|
1020
|
+
const Dropper = window.EyeDropper;
|
|
1021
|
+
try {
|
|
1022
|
+
const hex = normalizeHex((await new Dropper().open()).sRGBHex);
|
|
1023
|
+
if (hex) {
|
|
1024
|
+
applyHex(picker, hex);
|
|
1025
|
+
commit(picker);
|
|
1026
|
+
}
|
|
1027
|
+
} catch {
|
|
1028
|
+
}
|
|
1029
|
+
});
|
|
1030
|
+
}
|
|
1007
1031
|
function bindPickerEvents(picker) {
|
|
1008
1032
|
const { view } = picker;
|
|
1009
1033
|
const disposers = bindAreas(picker);
|
|
@@ -1015,6 +1039,7 @@ function bindPickerEvents(picker) {
|
|
|
1015
1039
|
}
|
|
1016
1040
|
bindAlpha(picker);
|
|
1017
1041
|
bindHex(picker);
|
|
1042
|
+
bindEyedropper(picker);
|
|
1018
1043
|
bindAngle(picker);
|
|
1019
1044
|
return disposers;
|
|
1020
1045
|
}
|
|
@@ -1312,6 +1337,25 @@ var FIELDS_CSS = `
|
|
|
1312
1337
|
}
|
|
1313
1338
|
|
|
1314
1339
|
.sf-cp-number,
|
|
1340
|
+
.sf-cp-eyedropper {
|
|
1341
|
+
flex: none;
|
|
1342
|
+
display: grid;
|
|
1343
|
+
place-items: center;
|
|
1344
|
+
width: 24px;
|
|
1345
|
+
height: 24px;
|
|
1346
|
+
margin-left: auto;
|
|
1347
|
+
padding: 0;
|
|
1348
|
+
border: 1px solid var(--sf-cp-field-border);
|
|
1349
|
+
border-radius: 6px;
|
|
1350
|
+
background: var(--sf-cp-field-bg);
|
|
1351
|
+
color: var(--sf-cp-fg);
|
|
1352
|
+
cursor: pointer;
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
.sf-cp-eyedropper:hover {
|
|
1356
|
+
background: var(--sf-cp-hover);
|
|
1357
|
+
}
|
|
1358
|
+
|
|
1315
1359
|
.sf-cp-text {
|
|
1316
1360
|
flex: none;
|
|
1317
1361
|
width: 52px;
|
|
@@ -5609,6 +5653,10 @@ function applyGeometryPreview(drag, bounds) {
|
|
|
5609
5653
|
return;
|
|
5610
5654
|
}
|
|
5611
5655
|
drag.geometryNodes.forEach((node, index) => {
|
|
5656
|
+
if (node.tagName.toLowerCase() === "image") {
|
|
5657
|
+
applyCompositeScale([node], drag.startBounds, bounds, [drag.baseTransforms[index]]);
|
|
5658
|
+
return;
|
|
5659
|
+
}
|
|
5612
5660
|
applySingleNodeBounds(node, drag.kind, applyInset(bounds, drag.insets[index] ?? NO_INSET));
|
|
5613
5661
|
});
|
|
5614
5662
|
}
|
|
@@ -6363,7 +6411,7 @@ function braceDelta(masked) {
|
|
|
6363
6411
|
}
|
|
6364
6412
|
|
|
6365
6413
|
// src/runtime/interaction/sflPatch/scan/blocks.ts
|
|
6366
|
-
var OWNER_HEADER = /^\s*(Entity|Shape|Text|Container|Chart|Path|Link|Isometric|Widget|Component|Connection|Shader)\s+([A-Za-z_][A-Za-z0-9_]*)\b/;
|
|
6414
|
+
var OWNER_HEADER = /^\s*(Entity|Shape|Text|Image|Container|Chart|Path|Link|Isometric|Widget|Component|Connection|Shader)\s+([A-Za-z_][A-Za-z0-9_]*)\b/;
|
|
6367
6415
|
var VALID_IDENT = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
6368
6416
|
function blockEndIn(masked, startLine) {
|
|
6369
6417
|
let depth = 0;
|
|
@@ -6630,6 +6678,9 @@ function canvasObjectBlockKind(kind) {
|
|
|
6630
6678
|
if (kind === "text") {
|
|
6631
6679
|
return "Text";
|
|
6632
6680
|
}
|
|
6681
|
+
if (kind === "image") {
|
|
6682
|
+
return "Image";
|
|
6683
|
+
}
|
|
6633
6684
|
if (kind === "isometric") {
|
|
6634
6685
|
return "Isometric";
|
|
6635
6686
|
}
|
|
@@ -7190,29 +7241,29 @@ function movePathPoints(lines, range, dx, dy) {
|
|
|
7190
7241
|
);
|
|
7191
7242
|
replacePropertyValue(lines, span, shifted);
|
|
7192
7243
|
}
|
|
7193
|
-
function
|
|
7244
|
+
function applyMoveChanges(sfl, events) {
|
|
7194
7245
|
const state = sflToCanvasState(sfl);
|
|
7195
|
-
const canvasObject = state.canvasObjects.find((candidate) => candidate.id === event.owner.id);
|
|
7196
|
-
if (!canvasObject) {
|
|
7197
|
-
return sfl;
|
|
7198
|
-
}
|
|
7199
|
-
const parent = canvasObject.parentFrameId ? state.canvasObjects.find((candidate) => candidate.id === canvasObject.parentFrameId) : void 0;
|
|
7200
|
-
const originX = parent?.x ?? 0;
|
|
7201
|
-
const originY = parent?.y ?? 0;
|
|
7202
7246
|
const lines = sfl.split("\n");
|
|
7203
|
-
const
|
|
7204
|
-
|
|
7205
|
-
|
|
7206
|
-
|
|
7207
|
-
|
|
7208
|
-
|
|
7209
|
-
|
|
7247
|
+
for (const event of events) {
|
|
7248
|
+
const canvasObject = state.canvasObjects.find((candidate) => candidate.id === event.owner.id);
|
|
7249
|
+
const range = canvasObject ? findOwnerBlock(lines, event.owner.id) : null;
|
|
7250
|
+
if (!canvasObject || !range) {
|
|
7251
|
+
continue;
|
|
7252
|
+
}
|
|
7253
|
+
if (event.owner.role === "path") {
|
|
7254
|
+
movePathPoints(lines, range, event.dx, event.dy);
|
|
7255
|
+
continue;
|
|
7256
|
+
}
|
|
7257
|
+
const parent = canvasObject.parentFrameId ? state.canvasObjects.find((candidate) => candidate.id === canvasObject.parentFrameId) : void 0;
|
|
7258
|
+
setOrInsertLayoutTuples(lines, range, [
|
|
7259
|
+
["position", canvasObject.x - (parent?.x ?? 0) + event.dx, canvasObject.y - (parent?.y ?? 0) + event.dy]
|
|
7260
|
+
]);
|
|
7210
7261
|
}
|
|
7211
|
-
setOrInsertLayoutTuples(lines, range, [
|
|
7212
|
-
["position", canvasObject.x - originX + event.dx, canvasObject.y - originY + event.dy]
|
|
7213
|
-
]);
|
|
7214
7262
|
return lines.join("\n");
|
|
7215
7263
|
}
|
|
7264
|
+
function applyMoveChange(sfl, event) {
|
|
7265
|
+
return applyMoveChanges(sfl, [event]);
|
|
7266
|
+
}
|
|
7216
7267
|
|
|
7217
7268
|
// src/runtime/interaction/sflPatch/changes/pathPointChange.ts
|
|
7218
7269
|
function applyPathPointChange(sfl, event) {
|
|
@@ -7789,6 +7840,6 @@ function bindEditing(viewer, options = {}) {
|
|
|
7789
7840
|
};
|
|
7790
7841
|
}
|
|
7791
7842
|
|
|
7792
|
-
export { applyChartValueChange, applyLinkReconnectChange, applyLinkSegmentChange, applyMoveChange, applyPathPointChange, applyPropertyChange, applyQuickDuplicateChange, applyResizeChange, applySankeyNodeMoveChange, applySankeyNodeRenameChange, applyTextChange, bindEditing, bindPropertyEditing, cssBackground, formatPickerValue, insertCanvasObject, insertConnection, insertLink, insertPath, openColorPopover, readGradientValue, removeCanvasObject, removeLink, resolveTheme, seedFrom };
|
|
7843
|
+
export { applyChartValueChange, applyLinkReconnectChange, applyLinkSegmentChange, applyMoveChange, applyMoveChanges, applyPathPointChange, applyPropertyChange, applyQuickDuplicateChange, applyResizeChange, applySankeyNodeMoveChange, applySankeyNodeRenameChange, applyTextChange, bindEditing, bindPropertyEditing, cssBackground, formatPickerValue, insertCanvasObject, insertConnection, insertLink, insertPath, openColorPopover, readGradientValue, removeCanvasObject, removeLink, resolveTheme, seedFrom };
|
|
7793
7844
|
//# sourceMappingURL=index.js.map
|
|
7794
7845
|
//# sourceMappingURL=index.js.map
|