@squeed/flow-sdk 0.1.14 → 0.1.15

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.js CHANGED
@@ -26232,40 +26232,35 @@ function KW() {
26232
26232
  if (a.dom_container)
26233
26233
  this._nodes_dom_container = a.dom_container;
26234
26234
  else {
26235
- let s = document.createElement("div");
26236
- s.style.position = "absolute", s.style.zIndex = 10, i.querySelector("canvas").parentNode.appendChild(s), this._nodes_dom_container = s;
26237
- }
26238
- this._resize_observer = new ResizeObserver((s) => {
26239
- for (let l of s) {
26240
- let u = l.target, c = u.__cy_id;
26241
- n.getElementById(c).style({ width: u.offsetWidth, height: u.offsetHeight, shape: "rectangle" });
26242
- }
26243
- }), n.on("add", "node", (s) => {
26244
- this._add_node(s.target);
26245
- }), n.on("remove", "node", (s) => {
26246
- this._remove_node(s.target);
26235
+ let o = document.createElement("div");
26236
+ o.style.position = "absolute", o.style.zIndex = 10, i.querySelector("canvas").parentNode.appendChild(o), this._nodes_dom_container = o;
26237
+ }
26238
+ this._resize_observer = new ResizeObserver((o) => {
26239
+ for (let s of o) {
26240
+ let l = s.target, u = l.__cy_id;
26241
+ n.getElementById(u).style({ width: l.offsetWidth, height: l.offsetHeight, shape: "rectangle" });
26242
+ }
26243
+ }), n.on("add", "node", (o) => {
26244
+ this._add_node(o.target);
26245
+ }), n.on("remove", "node", (o) => {
26246
+ this._remove_node(o.target);
26247
26247
  });
26248
- for (let s of n.nodes())
26249
- this._add_node(s);
26250
- this._nodes_dom_container.style.willChange = "transform", this._nodes_dom_container.style.backfaceVisibility = "hidden";
26251
- let o = null;
26252
- n.on("pan zoom", () => {
26253
- o === null && (o = requestAnimationFrame(() => {
26254
- o = null;
26255
- let s = n.pan(), l = n.zoom(), u = "translate3d(" + s.x + "px," + s.y + "px,0) scale(" + l + ")";
26256
- this._nodes_dom_container.style.transform = u;
26257
- }));
26258
- }), this._panZoomRafId = o, n.on("position bounds", "node", (s) => {
26259
- let l = s.target, u = l.id();
26260
- if (!this._node_dom[u])
26248
+ for (let o of n.nodes())
26249
+ this._add_node(o);
26250
+ n.on("pan zoom", (o) => {
26251
+ let s = n.pan(), l = n.zoom(), u = "translate(" + s.x + "px," + s.y + "px) scale(" + l + ")";
26252
+ this._nodes_dom_container.style.msTransform = u, this._nodes_dom_container.style.transform = u;
26253
+ }), n.on("position bounds", "node", (o) => {
26254
+ let s = o.target, l = s.id();
26255
+ if (!this._node_dom[l])
26261
26256
  return;
26262
- let c = this._node_dom[u], d = `translate(-50%, -50%) translate3d(${l.position("x").toFixed(2)}px, ${l.position("y").toFixed(2)}px, 0)`;
26263
- c.style.transform = d, c.style.display = "inline", c.style.position = "absolute", c.style["z-index"] = 10;
26257
+ let u = this._node_dom[l], c = `translate(-50%, -50%) translate(${s.position("x").toFixed(2)}px, ${s.position("y").toFixed(2)}px)`;
26258
+ 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;
26264
26259
  });
26265
26260
  }
26266
26261
  _add_node(n) {
26267
26262
  let a = n.data();
26268
- a.dom && (a.skip_node_append !== !0 && this._nodes_dom_container.appendChild(a.dom), a.dom.__cy_id = n.id(), a.dom.style.willChange = "transform", a.dom.style.backfaceVisibility = "hidden", this._node_dom[n.id()] = a.dom, this._resize_observer.observe(a.dom));
26263
+ 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));
26269
26264
  }
26270
26265
  _remove_node(n) {
26271
26266
  let a = n.id(), i = this._node_dom[a];
@@ -26292,7 +26287,7 @@ function KW() {
26292
26287
  this._resize_observer.unobserve(this._node_dom[n]);
26293
26288
  for (; this._nodes_dom_container.firstChild; )
26294
26289
  this._nodes_dom_container.removeChild(this._nodes_dom_container.firstChild);
26295
- 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._panZoomRafId !== null && cancelAnimationFrame(this._panZoomRafId), this._cy = null, this._params = null, this._nodes_dom_container = null, this._resize_observer = null;
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._cy = null, this._params = null, this._nodes_dom_container = null, this._resize_observer = null;
26296
26291
  }
26297
26292
  }
26298
26293
  function e(t) {