stickyflow 0.5.0 → 0.6.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 +16 -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-IEHE6WVN.js → chunk-4G2R7PEL.js} +319 -45
- package/dist/chunk-4G2R7PEL.js.map +1 -0
- package/dist/{chunk-L3VJXZFD.cjs → chunk-4LENHH6C.cjs} +15 -15
- package/dist/{chunk-L3VJXZFD.cjs.map → chunk-4LENHH6C.cjs.map} +1 -1
- package/dist/{chunk-LTGF5OHP.js → chunk-FVHVOJS2.js} +395 -89
- package/dist/chunk-FVHVOJS2.js.map +1 -0
- package/dist/{chunk-TWDLOXRM.cjs → chunk-JIJMZMGY.cjs} +18 -18
- package/dist/{chunk-TWDLOXRM.cjs.map → chunk-JIJMZMGY.cjs.map} +1 -1
- package/dist/{chunk-VK3T6O5Z.cjs → chunk-KTNCDNDB.cjs} +33 -33
- package/dist/{chunk-VK3T6O5Z.cjs.map → chunk-KTNCDNDB.cjs.map} +1 -1
- package/dist/{chunk-BODZN3ZI.js → chunk-MFNUJA26.js} +4 -4
- package/dist/{chunk-BODZN3ZI.js.map → chunk-MFNUJA26.js.map} +1 -1
- package/dist/{chunk-7VW2XKVB.js → chunk-ULQZ6CZW.js} +3 -3
- package/dist/{chunk-7VW2XKVB.js.map → chunk-ULQZ6CZW.js.map} +1 -1
- package/dist/{chunk-ZMLQIMJK.cjs → chunk-WQRT5PVT.cjs} +993 -687
- package/dist/chunk-WQRT5PVT.cjs.map +1 -0
- package/dist/{chunk-G7NRK5AG.js → chunk-WRDVNMFS.js} +5 -5
- package/dist/{chunk-G7NRK5AG.js.map → chunk-WRDVNMFS.js.map} +1 -1
- package/dist/{chunk-XY2GZUHC.cjs → chunk-XJ4W6TW4.cjs} +326 -44
- package/dist/chunk-XJ4W6TW4.cjs.map +1 -0
- package/dist/index.cjs +49 -29
- package/dist/index.d.cts +52 -7
- package/dist/index.d.ts +52 -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-Db0eSz_s.d.cts} +36 -15
- package/dist/{render-CgX_y15a.d.cts → render-Db0eSz_s.d.ts} +36 -15
- package/dist/{runtime-reWgr7MP.d.cts → runtime-BhivvBeL.d.cts} +2 -2
- package/dist/{runtime-DnUxca3Y.d.ts → runtime-n2yG-_j-.d.ts} +2 -2
- package/dist/{runtimeTypes-D60w6nyF.d.cts → runtimeTypes-CrkMHvVi.d.cts} +2 -2
- package/dist/{runtimeTypes-CEBGueYM.d.ts → runtimeTypes-DnI7mRF5.d.ts} +2 -2
- package/dist/stickyflow-diagram.global.js +35 -35
- package/dist/stickyflow-diagram.global.js.map +1 -1
- package/dist/{types-DvhMpqrL.d.cts → types-BHfUKT4s.d.cts} +1 -1
- package/dist/{types-DYLC_lsk.d.ts → types-D4cH4f1a.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-IEHE6WVN.js.map +0 -1
- package/dist/chunk-LTGF5OHP.js.map +0 -1
- package/dist/chunk-XY2GZUHC.cjs.map +0 -1
- package/dist/chunk-ZMLQIMJK.cjs.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunkWQRT5PVT_cjs = require('./chunk-WQRT5PVT.cjs');
|
|
4
|
+
var chunk4LENHH6C_cjs = require('./chunk-4LENHH6C.cjs');
|
|
5
|
+
var chunkXJ4W6TW4_cjs = require('./chunk-XJ4W6TW4.cjs');
|
|
6
6
|
|
|
7
7
|
// src/runtime/viewer/components/rollingNumberDom.ts
|
|
8
8
|
var HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
|
|
@@ -162,12 +162,12 @@ function componentDigits(surface) {
|
|
|
162
162
|
function componentStyle(surface) {
|
|
163
163
|
const encoded = surface.getAttribute("data-sf-widget-style");
|
|
164
164
|
if (!encoded) {
|
|
165
|
-
return
|
|
165
|
+
return chunkXJ4W6TW4_cjs.DEFAULT_ROLLING_NUMBER_STYLE;
|
|
166
166
|
}
|
|
167
167
|
try {
|
|
168
|
-
return { ...
|
|
168
|
+
return { ...chunkXJ4W6TW4_cjs.DEFAULT_ROLLING_NUMBER_STYLE, ...JSON.parse(encoded) };
|
|
169
169
|
} catch {
|
|
170
|
-
return
|
|
170
|
+
return chunkXJ4W6TW4_cjs.DEFAULT_ROLLING_NUMBER_STYLE;
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
function positiveInteger(value) {
|
|
@@ -191,7 +191,7 @@ function setRollingNumber(surface, value, animate) {
|
|
|
191
191
|
return false;
|
|
192
192
|
}
|
|
193
193
|
const previousValue = surface.getAttribute("data-sf-widget-value") ?? "";
|
|
194
|
-
const nextValue =
|
|
194
|
+
const nextValue = chunkXJ4W6TW4_cjs.formatRollingNumber(value, positiveInteger(surface.getAttribute("data-sf-widget-digits")));
|
|
195
195
|
if (previousValue === nextValue) {
|
|
196
196
|
return true;
|
|
197
197
|
}
|
|
@@ -667,7 +667,7 @@ function mountDisplay(container, svgString) {
|
|
|
667
667
|
}
|
|
668
668
|
|
|
669
669
|
// src/runtime/viewer/events.ts
|
|
670
|
-
var Emitter2 = class extends
|
|
670
|
+
var Emitter2 = class extends chunk4LENHH6C_cjs.Emitter {
|
|
671
671
|
};
|
|
672
672
|
|
|
673
673
|
// src/runtime/viewer/export/raster.ts
|
|
@@ -757,11 +757,11 @@ function svgElement(document, name, attributes) {
|
|
|
757
757
|
function readComponentStyle(surface) {
|
|
758
758
|
try {
|
|
759
759
|
return {
|
|
760
|
-
...
|
|
760
|
+
...chunkXJ4W6TW4_cjs.DEFAULT_ROLLING_NUMBER_STYLE,
|
|
761
761
|
...JSON.parse(surface.getAttribute("data-sf-widget-style") ?? "{}")
|
|
762
762
|
};
|
|
763
763
|
} catch {
|
|
764
|
-
return
|
|
764
|
+
return chunkXJ4W6TW4_cjs.DEFAULT_ROLLING_NUMBER_STYLE;
|
|
765
765
|
}
|
|
766
766
|
}
|
|
767
767
|
function cellsOf(box, plain, fontSize = 0) {
|
|
@@ -901,7 +901,7 @@ function serializeSvgSnapshot(svg, captures) {
|
|
|
901
901
|
// src/runtime/viewer/interaction/changeFlash.ts
|
|
902
902
|
function createChangeFlash(svg) {
|
|
903
903
|
const timers = /* @__PURE__ */ new Map();
|
|
904
|
-
const flash = (ownerIds, color2 =
|
|
904
|
+
const flash = (ownerIds, color2 = chunk4LENHH6C_cjs.CHANGE_COLOR) => {
|
|
905
905
|
const ids = [...new Set(ownerIds)];
|
|
906
906
|
if (ids.length === 0) {
|
|
907
907
|
return;
|
|
@@ -909,7 +909,7 @@ function createChangeFlash(svg) {
|
|
|
909
909
|
const doc = svg.ownerDocument;
|
|
910
910
|
const reducedMotion = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches ?? false;
|
|
911
911
|
for (const id of ids) {
|
|
912
|
-
const primary =
|
|
912
|
+
const primary = chunk4LENHH6C_cjs.findOwnerNode(svg, id, chunk4LENHH6C_cjs.isPrimary);
|
|
913
913
|
if (!primary) {
|
|
914
914
|
continue;
|
|
915
915
|
}
|
|
@@ -920,10 +920,10 @@ function createChangeFlash(svg) {
|
|
|
920
920
|
for (const stale of svg.querySelectorAll(`[data-sf-change-overlay="${CSS.escape(id)}"]`)) {
|
|
921
921
|
stale.remove();
|
|
922
922
|
}
|
|
923
|
-
const overlay = primary.getAttribute("data-sf-role") === "link" ?
|
|
923
|
+
const overlay = primary.getAttribute("data-sf-role") === "link" ? chunk4LENHH6C_cjs.linkChangeOverlay(doc, primary, id, color2) : chunk4LENHH6C_cjs.shapeChangeOverlay(doc, primary, id, color2);
|
|
924
924
|
svg.appendChild(overlay);
|
|
925
|
-
|
|
926
|
-
const duration = reducedMotion ?
|
|
925
|
+
chunk4LENHH6C_cjs.startChangeFade(overlay, reducedMotion);
|
|
926
|
+
const duration = reducedMotion ? chunk4LENHH6C_cjs.REDUCED_MOTION_DURATION_MS : chunk4LENHH6C_cjs.FLASH_DURATION_MS;
|
|
927
927
|
timers.set(
|
|
928
928
|
id,
|
|
929
929
|
setTimeout(() => {
|
|
@@ -1010,7 +1010,7 @@ var OwnerPointerController = class {
|
|
|
1010
1010
|
this.#selection = selection;
|
|
1011
1011
|
}
|
|
1012
1012
|
hover(event) {
|
|
1013
|
-
const owner =
|
|
1013
|
+
const owner = chunk4LENHH6C_cjs.resolveOwner(event.target);
|
|
1014
1014
|
this.#emitter.emit(
|
|
1015
1015
|
"ownerHover",
|
|
1016
1016
|
owner ? { diagramId: this.#diagramId, owner, modifiers: modifiersOf(event) } : { diagramId: this.#diagramId, owner: null }
|
|
@@ -1018,7 +1018,7 @@ var OwnerPointerController = class {
|
|
|
1018
1018
|
}
|
|
1019
1019
|
select(event) {
|
|
1020
1020
|
const target = event.target;
|
|
1021
|
-
const owner =
|
|
1021
|
+
const owner = chunk4LENHH6C_cjs.resolveOwner(target);
|
|
1022
1022
|
if (!owner) {
|
|
1023
1023
|
this.#clearWhenOutsideOverlay(target);
|
|
1024
1024
|
return;
|
|
@@ -1039,7 +1039,7 @@ var OwnerPointerController = class {
|
|
|
1039
1039
|
owner,
|
|
1040
1040
|
modifiers
|
|
1041
1041
|
});
|
|
1042
|
-
const node =
|
|
1042
|
+
const node = chunk4LENHH6C_cjs.findOwnerNode(this.#svg, owner.id, chunk4LENHH6C_cjs.isPrimary);
|
|
1043
1043
|
if (node && !node.hasAttribute("tabindex")) {
|
|
1044
1044
|
node.setAttribute("tabindex", "-1");
|
|
1045
1045
|
}
|
|
@@ -1067,12 +1067,12 @@ var PointerInteractionSession = class {
|
|
|
1067
1067
|
}
|
|
1068
1068
|
#onPointerDown = (event) => {
|
|
1069
1069
|
const target = event.target;
|
|
1070
|
-
const overContent = Boolean(
|
|
1070
|
+
const overContent = Boolean(chunk4LENHH6C_cjs.resolveOwner(target)) || isSelectionOverlayControl(target);
|
|
1071
1071
|
this.#down = {
|
|
1072
1072
|
x: event.clientX,
|
|
1073
1073
|
y: event.clientY,
|
|
1074
1074
|
moved: false,
|
|
1075
|
-
panable:
|
|
1075
|
+
panable: chunk4LENHH6C_cjs.isCameraGesture(event) || !overContent
|
|
1076
1076
|
};
|
|
1077
1077
|
};
|
|
1078
1078
|
#onPointerMove = (event) => {
|
|
@@ -1100,7 +1100,7 @@ var PointerInteractionSession = class {
|
|
|
1100
1100
|
if (!this.#down.moved) {
|
|
1101
1101
|
return false;
|
|
1102
1102
|
}
|
|
1103
|
-
if (this.#down.panable &&
|
|
1103
|
+
if (this.#down.panable && chunk4LENHH6C_cjs.isCameraGesture(event)) {
|
|
1104
1104
|
this.#display.panBy(event.movementX, event.movementY);
|
|
1105
1105
|
}
|
|
1106
1106
|
return true;
|
|
@@ -1124,15 +1124,15 @@ function paintSelectionOverlays(svg, selectedIds, owners) {
|
|
|
1124
1124
|
}
|
|
1125
1125
|
const document = svg.ownerDocument;
|
|
1126
1126
|
for (const id of selectedIds) {
|
|
1127
|
-
const primary =
|
|
1127
|
+
const primary = chunk4LENHH6C_cjs.findOwnerNode(svg, id, chunk4LENHH6C_cjs.isPrimary);
|
|
1128
1128
|
if (!primary) {
|
|
1129
1129
|
continue;
|
|
1130
1130
|
}
|
|
1131
1131
|
const owner = owners.get(id);
|
|
1132
|
-
const overlay = owner?.role === "link" ?
|
|
1132
|
+
const overlay = owner?.role === "link" ? chunk4LENHH6C_cjs.linkSelectionOverlay(document, primary, id, svg) : owner?.role === "path" ? chunk4LENHH6C_cjs.pathSelectionOverlay(document, primary, id, svg) : owner?.role === "isometric" ? chunk4LENHH6C_cjs.isometricSelectionOverlay(document, primary, id, svg) : chunk4LENHH6C_cjs.shapeSelectionOverlay(document, primary, id, svg, owner ? chunk4LENHH6C_cjs.DERIVED_HEIGHT_ROLES.has(owner.role) : false);
|
|
1133
1133
|
svg.appendChild(overlay);
|
|
1134
1134
|
if (owner?.role === "shape" && selectedIds.size === 1) {
|
|
1135
|
-
svg.appendChild(
|
|
1135
|
+
svg.appendChild(chunk4LENHH6C_cjs.quickDuplicateBubbles(document, primary, id, svg));
|
|
1136
1136
|
}
|
|
1137
1137
|
}
|
|
1138
1138
|
}
|
|
@@ -1171,7 +1171,7 @@ var SelectionController = class {
|
|
|
1171
1171
|
selectIds(ids) {
|
|
1172
1172
|
for (const id of ids) {
|
|
1173
1173
|
const element = this.#svg.querySelector(`[data-sf-id="${CSS.escape(id)}"]`);
|
|
1174
|
-
const owner =
|
|
1174
|
+
const owner = chunk4LENHH6C_cjs.resolveOwner(element);
|
|
1175
1175
|
if (owner) {
|
|
1176
1176
|
this.remember(owner);
|
|
1177
1177
|
}
|
|
@@ -1183,7 +1183,7 @@ var SelectionController = class {
|
|
|
1183
1183
|
// src/runtime/viewer/interaction/wheel.ts
|
|
1184
1184
|
function bindWheelZoom(display, selection) {
|
|
1185
1185
|
const onWheel = (event) => {
|
|
1186
|
-
if (!
|
|
1186
|
+
if (!chunk4LENHH6C_cjs.isCameraGesture(event)) {
|
|
1187
1187
|
return;
|
|
1188
1188
|
}
|
|
1189
1189
|
event.preventDefault();
|
|
@@ -3358,21 +3358,21 @@ function mountShaderSurfaces(svg) {
|
|
|
3358
3358
|
|
|
3359
3359
|
// src/runtime/viewer/source.ts
|
|
3360
3360
|
function renderViewerSource(next, defaultRenderOptions) {
|
|
3361
|
-
const svg = next.svg ?? (next.source != null ?
|
|
3361
|
+
const svg = next.svg ?? (next.source != null ? chunkWQRT5PVT_cjs.render(next.source, { ...next.renderOptions ?? defaultRenderOptions, linkHitAreas: true }).svg : null);
|
|
3362
3362
|
if (svg == null) {
|
|
3363
3363
|
throw new Error("createViewer: provide either `source` (SFL) or `svg`.");
|
|
3364
3364
|
}
|
|
3365
3365
|
return svg;
|
|
3366
3366
|
}
|
|
3367
3367
|
function assertCreateViewerContract(svg) {
|
|
3368
|
-
const version =
|
|
3369
|
-
if (!
|
|
3368
|
+
const version = chunk4LENHH6C_cjs.parseContractVersion(svg);
|
|
3369
|
+
if (!chunk4LENHH6C_cjs.isContractCompatible(version)) {
|
|
3370
3370
|
throw new Error(`createViewer: incompatible DOM contract (svg=${version}). Renderer and viewer versions differ.`);
|
|
3371
3371
|
}
|
|
3372
3372
|
}
|
|
3373
3373
|
function assertViewerUpdateContract(svg) {
|
|
3374
|
-
const version =
|
|
3375
|
-
if (!
|
|
3374
|
+
const version = chunk4LENHH6C_cjs.parseContractVersion(svg);
|
|
3375
|
+
if (!chunk4LENHH6C_cjs.isContractCompatible(version)) {
|
|
3376
3376
|
throw new Error(`viewer.update: incompatible DOM contract (svg=${version}). Renderer and viewer versions differ.`);
|
|
3377
3377
|
}
|
|
3378
3378
|
}
|
|
@@ -3727,5 +3727,5 @@ exports.connectInteraction = connectInteraction;
|
|
|
3727
3727
|
exports.createViewer = createViewer;
|
|
3728
3728
|
exports.registerShaderProgram = registerShaderProgram;
|
|
3729
3729
|
exports.shaderProgram = shaderProgram;
|
|
3730
|
-
//# sourceMappingURL=chunk-
|
|
3731
|
-
//# sourceMappingURL=chunk-
|
|
3730
|
+
//# sourceMappingURL=chunk-KTNCDNDB.cjs.map
|
|
3731
|
+
//# sourceMappingURL=chunk-KTNCDNDB.cjs.map
|