@squeed/flow-sdk 0.1.7 → 0.1.8
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/index.cjs +18 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +24 -29
- package/dist/index.js.map +1 -1
- package/package.json +7 -6
package/dist/index.js
CHANGED
|
@@ -26227,40 +26227,35 @@ function YW() {
|
|
|
26227
26227
|
if (a.dom_container)
|
|
26228
26228
|
this._nodes_dom_container = a.dom_container;
|
|
26229
26229
|
else {
|
|
26230
|
-
let
|
|
26231
|
-
|
|
26232
|
-
}
|
|
26233
|
-
this._resize_observer = new ResizeObserver((
|
|
26234
|
-
for (let
|
|
26235
|
-
let
|
|
26236
|
-
n.getElementById(
|
|
26237
|
-
}
|
|
26238
|
-
}), n.on("add", "node", (
|
|
26239
|
-
this._add_node(
|
|
26240
|
-
}), n.on("remove", "node", (
|
|
26241
|
-
this._remove_node(
|
|
26230
|
+
let o = document.createElement("div");
|
|
26231
|
+
o.style.position = "absolute", o.style.zIndex = 10, i.querySelector("canvas").parentNode.appendChild(o), this._nodes_dom_container = o;
|
|
26232
|
+
}
|
|
26233
|
+
this._resize_observer = new ResizeObserver((o) => {
|
|
26234
|
+
for (let s of o) {
|
|
26235
|
+
let l = s.target, u = l.__cy_id;
|
|
26236
|
+
n.getElementById(u).style({ width: l.offsetWidth, height: l.offsetHeight, shape: "rectangle" });
|
|
26237
|
+
}
|
|
26238
|
+
}), n.on("add", "node", (o) => {
|
|
26239
|
+
this._add_node(o.target);
|
|
26240
|
+
}), n.on("remove", "node", (o) => {
|
|
26241
|
+
this._remove_node(o.target);
|
|
26242
26242
|
});
|
|
26243
|
-
for (let
|
|
26244
|
-
this._add_node(
|
|
26245
|
-
|
|
26246
|
-
|
|
26247
|
-
|
|
26248
|
-
|
|
26249
|
-
|
|
26250
|
-
|
|
26251
|
-
this._nodes_dom_container.style.transform = u;
|
|
26252
|
-
}));
|
|
26253
|
-
}), this._panZoomRafId = o, n.on("position bounds", "node", (s) => {
|
|
26254
|
-
let l = s.target, u = l.id();
|
|
26255
|
-
if (!this._node_dom[u])
|
|
26243
|
+
for (let o of n.nodes())
|
|
26244
|
+
this._add_node(o);
|
|
26245
|
+
n.on("pan zoom", (o) => {
|
|
26246
|
+
let s = n.pan(), l = n.zoom(), u = "translate(" + s.x + "px," + s.y + "px) scale(" + l + ")";
|
|
26247
|
+
this._nodes_dom_container.style.msTransform = u, this._nodes_dom_container.style.transform = u;
|
|
26248
|
+
}), n.on("position bounds", "node", (o) => {
|
|
26249
|
+
let s = o.target, l = s.id();
|
|
26250
|
+
if (!this._node_dom[l])
|
|
26256
26251
|
return;
|
|
26257
|
-
let
|
|
26258
|
-
c.style.transform =
|
|
26252
|
+
let u = this._node_dom[l], c = `translate(-50%, -50%) translate(${s.position("x").toFixed(2)}px, ${s.position("y").toFixed(2)}px)`;
|
|
26253
|
+
u.style.webkitTransform = c, u.style.msTransform = c, u.style.transform = c, u.style.display = "inline", u.style.position = "absolute", u.style["z-index"] = 10;
|
|
26259
26254
|
});
|
|
26260
26255
|
}
|
|
26261
26256
|
_add_node(n) {
|
|
26262
26257
|
let a = n.data();
|
|
26263
|
-
a.dom && (a.skip_node_append !== !0 && this._nodes_dom_container.appendChild(a.dom), a.dom.__cy_id = n.id(),
|
|
26258
|
+
a.dom && (a.skip_node_append !== !0 && this._nodes_dom_container.appendChild(a.dom), a.dom.__cy_id = n.id(), this._node_dom[n.id()] = a.dom, this._resize_observer.observe(a.dom));
|
|
26264
26259
|
}
|
|
26265
26260
|
_remove_node(n) {
|
|
26266
26261
|
let a = n.id(), i = this._node_dom[a];
|
|
@@ -26287,7 +26282,7 @@ function YW() {
|
|
|
26287
26282
|
this._resize_observer.unobserve(this._node_dom[n]);
|
|
26288
26283
|
for (; this._nodes_dom_container.firstChild; )
|
|
26289
26284
|
this._nodes_dom_container.removeChild(this._nodes_dom_container.firstChild);
|
|
26290
|
-
this._node_dom = {}, this._cy.removeListener("add", "node"), this._cy.removeListener("remove", "node"), this._cy.removeListener("pan zoom"), this._cy.removeListener("position bounds", "node"), this._params.dom_container || this._nodes_dom_container.parentNode.removeChild(this._nodes_dom_container), this.
|
|
26285
|
+
this._node_dom = {}, this._cy.removeListener("add", "node"), this._cy.removeListener("remove", "node"), this._cy.removeListener("pan zoom"), this._cy.removeListener("position bounds", "node"), this._params.dom_container || this._nodes_dom_container.parentNode.removeChild(this._nodes_dom_container), this._cy = null, this._params = null, this._nodes_dom_container = null, this._resize_observer = null;
|
|
26291
26286
|
}
|
|
26292
26287
|
}
|
|
26293
26288
|
function e(t) {
|