@joint/core 4.1.0 → 4.1.2

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/geometry.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! JointJS v4.1.0 (2024-11-27) - JavaScript diagramming library
1
+ /*! JointJS v4.1.2 (2025-01-16) - JavaScript diagramming library
2
2
 
3
3
 
4
4
  This Source Code Form is subject to the terms of the Mozilla Public
@@ -1,4 +1,4 @@
1
- /*! JointJS v4.1.0 (2024-11-27) - JavaScript diagramming library
1
+ /*! JointJS v4.1.2 (2025-01-16) - JavaScript diagramming library
2
2
 
3
3
 
4
4
  This Source Code Form is subject to the terms of the Mozilla Public
package/dist/joint.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- /*! JointJS v4.1.0 (2024-11-27) - JavaScript diagramming library
1
+ /*! JointJS v4.1.2 (2025-01-16) - JavaScript diagramming library
2
2
 
3
3
 
4
4
  This Source Code Form is subject to the terms of the Mozilla Public
@@ -1001,7 +1001,7 @@ export declare namespace dia {
1001
1001
 
1002
1002
  export type UnsetCallback<V> = (
1003
1003
  this: V,
1004
- node: Element,
1004
+ node: DOMElement,
1005
1005
  nodeAttributes: { [name: string]: any },
1006
1006
  cellView: V
1007
1007
  ) => string | Array<string> | null | void;
@@ -1010,7 +1010,7 @@ export declare namespace dia {
1010
1010
  this: V,
1011
1011
  attributeValue: any,
1012
1012
  refBBox: g.Rect,
1013
- node: Element,
1013
+ node: DOMElement,
1014
1014
  nodeAttributes: { [name: string]: any },
1015
1015
  cellView: V
1016
1016
  ) => { [key: string]: any } | string | number | void;
@@ -1019,7 +1019,7 @@ export declare namespace dia {
1019
1019
  this: V,
1020
1020
  attributeValue: any,
1021
1021
  refBBox: g.Rect,
1022
- node: Element,
1022
+ node: DOMElement,
1023
1023
  nodeAttributes: { [name: string]: any },
1024
1024
  cellView: V
1025
1025
  ) => dia.Point | null | void;
@@ -1028,7 +1028,7 @@ export declare namespace dia {
1028
1028
  this: V,
1029
1029
  attributeValue: any,
1030
1030
  nodeBBox: g.Rect,
1031
- node: Element,
1031
+ node: DOMElement,
1032
1032
  nodeAttributes: { [name: string]: any },
1033
1033
  cellView: V
1034
1034
  ) => dia.Point | null | void;
@@ -1529,7 +1529,7 @@ export declare namespace dia {
1529
1529
 
1530
1530
  isNodeConnection(node: SVGElement): boolean;
1531
1531
 
1532
- getEventTarget(evt: dia.Event, opt?: { fromPoint?: boolean }): Element;
1532
+ getEventTarget(evt: dia.Event, opt?: { fromPoint?: boolean }): DOMElement;
1533
1533
 
1534
1534
  checkMouseleave(evt: dia.Event): void;
1535
1535
 
@@ -1650,7 +1650,7 @@ export declare namespace dia {
1650
1650
 
1651
1651
  export class ElementView<E extends Element = Element> extends CellViewGeneric<E> {
1652
1652
 
1653
- update(element?: E, renderingOnlyAttrs?: { [key: string]: any }): void;
1653
+ update(element?: DOMElement, renderingOnlyAttrs?: { [key: string]: any }): void;
1654
1654
 
1655
1655
  setInteractivity(value: boolean | ElementView.InteractivityOptions): void;
1656
1656
 
@@ -1659,9 +1659,9 @@ export declare namespace dia {
1659
1659
  getTargetParentView(evt: dia.Event): CellView | null;
1660
1660
 
1661
1661
  findPortNode(portId: string | number): SVGElement | null;
1662
- findPortNode(portId: string | number, selector: string): E | null;
1662
+ findPortNode(portId: string | number, selector: string): DOMElement | null;
1663
1663
 
1664
- findPortNodes(portId: string | number, groupSelector: string): E[];
1664
+ findPortNodes(portId: string | number, groupSelector: string): DOMElement[];
1665
1665
 
1666
1666
  protected renderMarkup(): void;
1667
1667
 
@@ -1810,9 +1810,9 @@ export declare namespace dia {
1810
1810
  getEndMagnet(endType: dia.LinkEnd): SVGElement | null;
1811
1811
 
1812
1812
  findLabelNode(labelIndex: string | number): SVGElement | null;
1813
- findLabelNode(labelIndex: string | number, selector: string): Element | null;
1813
+ findLabelNode(labelIndex: string | number, selector: string): DOMElement | null;
1814
1814
 
1815
- findLabelNodes(labelIndex: string | number, groupSelector: string): Element[];
1815
+ findLabelNodes(labelIndex: string | number, groupSelector: string): DOMElement[];
1816
1816
 
1817
1817
  removeRedundantLinearVertices(opt?: dia.ModelSetOptions): number;
1818
1818
 
@@ -2757,6 +2757,8 @@ export declare namespace dia {
2757
2757
  }
2758
2758
  }
2759
2759
 
2760
+ declare type DOMElement = Element;
2761
+
2760
2762
  export declare namespace elementTools {
2761
2763
 
2762
2764
  export namespace Button {
@@ -4234,7 +4236,7 @@ export declare namespace mvc {
4234
4236
  export type Dom = unknown;
4235
4237
  // The following types represent the DOM elements that can be passed to the
4236
4238
  // $() function.
4237
- export type $Element<T extends Element = Element> = string | T | T[] | Dom;
4239
+ export type $Element<T extends DOMElement = DOMElement> = string | T | T[] | Dom;
4238
4240
  export type $HTMLElement = $Element<HTMLElement>;
4239
4241
  export type $SVGElement = $Element<SVGElement>;
4240
4242
 
@@ -4242,7 +4244,7 @@ export declare namespace mvc {
4242
4244
  duration?: number;
4243
4245
  delay?: number;
4244
4246
  easing?: string;
4245
- complete?: (this: Element) => void;
4247
+ complete?: (this: DOMElement) => void;
4246
4248
  }
4247
4249
 
4248
4250
  export interface Event {
@@ -4265,7 +4267,7 @@ export declare namespace mvc {
4265
4267
  screenX: number | undefined;
4266
4268
  screenY: number | undefined;
4267
4269
  /** @deprecated */
4268
- toElement: Element | undefined;
4270
+ toElement: DOMElement | undefined;
4269
4271
  // PointerEvent
4270
4272
  pointerId: number | undefined;
4271
4273
  pointerType: string | undefined;
@@ -4630,7 +4632,7 @@ export declare namespace mvc {
4630
4632
 
4631
4633
  }
4632
4634
 
4633
- export interface ViewBaseOptions<TModel extends (Model | undefined) = Model, TElement extends Element = HTMLElement> {
4635
+ export interface ViewBaseOptions<TModel extends (Model | undefined) = Model, TElement extends DOMElement = HTMLElement> {
4634
4636
  model?: TModel | undefined;
4635
4637
  // TODO: quickfix, this can't be fixed easy. The collection does not need to have the same model as the parent view.
4636
4638
  collection?: Collection<any> | undefined; // was: Collection<TModel>;
@@ -4644,7 +4646,7 @@ export declare namespace mvc {
4644
4646
 
4645
4647
  export type ViewBaseEventListener = (event: mvc.Event) => void;
4646
4648
 
4647
- export class ViewBase<TModel extends (Model | undefined) = Model, TElement extends Element = HTMLElement> extends EventsMixin implements Events {
4649
+ export class ViewBase<TModel extends (Model | undefined) = Model, TElement extends DOMElement = HTMLElement> extends EventsMixin implements Events {
4648
4650
  /**
4649
4651
  * Do not use, prefer TypeScript's extend functionality.
4650
4652
  */
@@ -4696,7 +4698,7 @@ export declare namespace mvc {
4696
4698
  protected _setAttributes(attributes: Record<string, any>): void;
4697
4699
  }
4698
4700
 
4699
- export interface ViewOptions<T extends (mvc.Model | undefined), E extends Element = HTMLElement> extends mvc.ViewBaseOptions<T, E> {
4701
+ export interface ViewOptions<T extends (mvc.Model | undefined), E extends DOMElement = HTMLElement> extends mvc.ViewBaseOptions<T, E> {
4700
4702
  theme?: string;
4701
4703
  [key: string]: any;
4702
4704
  }
@@ -4705,7 +4707,7 @@ export declare namespace mvc {
4705
4707
  [key: string]: any;
4706
4708
  }
4707
4709
 
4708
- export class View<T extends (mvc.Model | undefined), E extends Element = HTMLElement> extends mvc.ViewBase<T, E> {
4710
+ export class View<T extends (mvc.Model | undefined), E extends DOMElement = HTMLElement> extends mvc.ViewBase<T, E> {
4709
4711
 
4710
4712
  constructor(opt?: ViewOptions<T, E>);
4711
4713
 
@@ -4733,7 +4735,7 @@ export declare namespace mvc {
4733
4735
 
4734
4736
  children?: dia.MarkupJSON;
4735
4737
 
4736
- childNodes?: { [key: string]: Element } | null;
4738
+ childNodes?: { [key: string]: DOMElement } | null;
4737
4739
 
4738
4740
  style?: { [key: string]: any };
4739
4741
 
@@ -4745,9 +4747,9 @@ export declare namespace mvc {
4745
4747
 
4746
4748
  undelegateDocumentEvents(): this;
4747
4749
 
4748
- delegateElementEvents(element: Element, events?: mvc.EventsHash, data?: viewEventData): this;
4750
+ delegateElementEvents(element: DOMElement, events?: mvc.EventsHash, data?: viewEventData): this;
4749
4751
 
4750
- undelegateElementEvents(element: Element): this;
4752
+ undelegateElementEvents(element: DOMElement): this;
4751
4753
 
4752
4754
  eventData(evt: dia.Event): viewEventData;
4753
4755
  eventData(evt: dia.Event, data: viewEventData): this;
@@ -4757,7 +4759,7 @@ export declare namespace mvc {
4757
4759
 
4758
4760
  renderChildren(children?: dia.MarkupJSON): this;
4759
4761
 
4760
- findAttribute(attributeName: string, node: Element): string | null;
4762
+ findAttribute(attributeName: string, node: DOMElement): string | null;
4761
4763
 
4762
4764
  confirmUpdate(flag: number, opt: { [key: string]: any }): number;
4763
4765
 
@@ -4765,7 +4767,7 @@ export declare namespace mvc {
4765
4767
 
4766
4768
  isMounted(): boolean;
4767
4769
 
4768
- protected findAttributeNode(attributeName: string, node: Element): Element | null;
4770
+ protected findAttributeNode(attributeName: string, node: DOMElement): DOMElement | null;
4769
4771
 
4770
4772
  protected init(): void;
4771
4773
 
@@ -5244,27 +5246,27 @@ export declare namespace util {
5244
5246
 
5245
5247
  export function imageToDataUri(url: string, callback: (err: Error | null, dataUri: string) => void): void;
5246
5248
 
5247
- export function getElementBBox(el: Element): dia.BBox;
5249
+ export function getElementBBox(el: DOMElement): dia.BBox;
5248
5250
 
5249
5251
  export function sortElements(
5250
5252
  elements: mvc.$Element,
5251
- comparator: (a: Element, b: Element) => number
5252
- ): Element[];
5253
+ comparator: (a: DOMElement, b: DOMElement) => number
5254
+ ): DOMElement[];
5253
5255
 
5254
- export function setAttributesBySelector(el: Element, attrs: { [selector: string]: { [attribute: string]: any }}): void;
5256
+ export function setAttributesBySelector(el: DOMElement, attrs: { [selector: string]: { [attribute: string]: any }}): void;
5255
5257
 
5256
5258
  export function normalizeSides(sides: dia.Sides): dia.PaddingJSON;
5257
5259
 
5258
5260
  export function template(html: string): (data: any) => string;
5259
5261
 
5260
- export function toggleFullScreen(el?: Element): void;
5262
+ export function toggleFullScreen(el?: DOMElement): void;
5261
5263
 
5262
5264
  export function objectDifference(object: object, base: object, opt?: { maxDepth?: number }): object;
5263
5265
 
5264
5266
  export interface DOMJSONDocument {
5265
5267
  fragment: DocumentFragment;
5266
- selectors: { [key: string]: Element };
5267
- groupSelectors: { [key: string]: Element[] };
5268
+ selectors: { [key: string]: DOMElement };
5269
+ groupSelectors: { [key: string]: DOMElement[] };
5268
5270
  }
5269
5271
 
5270
5272
  export function parseDOMJSON(json: dia.MarkupJSON): DOMJSONDocument;
package/dist/joint.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! JointJS v4.1.0 (2024-11-27) - JavaScript diagramming library
1
+ /*! JointJS v4.1.2 (2025-01-16) - JavaScript diagramming library
2
2
 
3
3
 
4
4
  This Source Code Form is subject to the terms of the Mozilla Public
@@ -7255,7 +7255,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
7255
7255
  const Constructor = object.constructor;
7256
7256
  switch (tag) {
7257
7257
  case arrayBufferTag:
7258
- return cloneArrayBuffer(object, isDeep);
7258
+ return cloneArrayBuffer(object);
7259
7259
  case boolTag:
7260
7260
  case dateTag:
7261
7261
  return new Constructor(+object);
@@ -7874,7 +7874,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
7874
7874
  }
7875
7875
  assignMergeValue(object, key, newValue);
7876
7876
  }
7877
- }, keysIn);
7877
+ });
7878
7878
  };
7879
7879
  const baseMergeDeep = (object, source, key, srcIndex, mergeFunc, customizer, stack) => {
7880
7880
  const objValue = safeGet(object, key);
@@ -7964,7 +7964,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
7964
7964
  const length = array == null ? 0 : array.length;
7965
7965
  return length ? array[length - 1] : undefined;
7966
7966
  }
7967
- const createSet = Set && 1 / setToArray(new Set([undefined, -0]))[1] == 1 / 0 ? values => new Set(values) : () => {};
7967
+ const createSet = Set && 1 / setToArray(new Set([undefined, -0]))[1] == 1 / 0 ? values => new Set(values) : () => {/* no-op */};
7968
7968
  function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
7969
7969
  if (isObject$1(objValue) && isObject$1(srcValue)) {
7970
7970
  // Recursively merge objects and arrays (susceptible to call stack limits).
@@ -8758,8 +8758,8 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
8758
8758
  }
8759
8759
  const groupBy = (collection, iteratee) => {
8760
8760
  iteratee = getIteratee(iteratee, 2);
8761
- return reduce(collection, (result, value, key) => {
8762
- key = iteratee(value);
8761
+ return reduce(collection, (result, value) => {
8762
+ const key = iteratee(value);
8763
8763
  if (hasOwnProperty.call(result, key)) {
8764
8764
  result[key].push(value);
8765
8765
  } else {
@@ -9152,8 +9152,8 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
9152
9152
  }
9153
9153
  return ret;
9154
9154
  };
9155
- $.fn.add = function (selector, context) {
9156
- const newElements = $(selector, context).toArray();
9155
+ $.fn.add = function (selector) {
9156
+ const newElements = $(selector).toArray();
9157
9157
  const prevElements = this.toArray();
9158
9158
  const ret = this.pushStack([]);
9159
9159
  $.merge(ret, uniq(prevElements.concat(newElements)));
@@ -9969,8 +9969,8 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
9969
9969
  case 'bottom':
9970
9970
  dy = -(0.25 * llMaxFont) - rLineHeights;
9971
9971
  break;
9972
- default:
9973
9972
  case 'top':
9973
+ default:
9974
9974
  dy = 0.8 * flMaxFont;
9975
9975
  break;
9976
9976
  }
@@ -11817,7 +11817,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
11817
11817
  if (!el) return null;
11818
11818
  if (arguments.length === 0) return el.innerHTML;
11819
11819
  if (html === undefined) return this; // do nothing
11820
- cleanNodesData(dataPriv, el.getElementsByTagName('*'));
11820
+ cleanNodesData(el.getElementsByTagName('*'));
11821
11821
  if (typeof html === 'string' || typeof html === 'number') {
11822
11822
  el.innerHTML = html;
11823
11823
  } else {
@@ -12076,17 +12076,21 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
12076
12076
  // when a statically positioned element is identified
12077
12077
  doc = el.ownerDocument;
12078
12078
  offsetParent = el.offsetParent || doc.documentElement;
12079
- const $parentOffset = $(offsetParent);
12080
- const parentOffsetElementPosition = $parentOffset.css('position') || 'static';
12081
- while (offsetParent && (offsetParent === doc.body || offsetParent === doc.documentElement) && parentOffsetElementPosition === 'static') {
12082
- offsetParent = offsetParent.parentNode;
12079
+ const isStaticallyPositioned = el => {
12080
+ const {
12081
+ position
12082
+ } = el.style;
12083
+ return !position || position === 'static';
12084
+ };
12085
+ while (offsetParent && offsetParent !== doc.documentElement && isStaticallyPositioned(offsetParent)) {
12086
+ offsetParent = offsetParent.offsetParent || doc.documentElement;
12083
12087
  }
12084
- if (offsetParent && offsetParent !== el && offsetParent.nodeType === 1) {
12088
+ if (offsetParent && offsetParent !== el && offsetParent.nodeType === 1 && !isStaticallyPositioned(offsetParent)) {
12085
12089
  // Incorporate borders into its offset, since they are outside its content origin
12086
12090
  const offsetParentStyles = window.getComputedStyle(offsetParent);
12087
12091
  const borderTopWidth = parseFloat(offsetParentStyles.borderTopWidth) || 0;
12088
12092
  const borderLeftWidth = parseFloat(offsetParentStyles.borderLeftWidth) || 0;
12089
- parentOffset = $parentOffset.offset();
12093
+ parentOffset = $(offsetParent).offset();
12090
12094
  parentOffset.top += borderTopWidth;
12091
12095
  parentOffset.left += borderLeftWidth;
12092
12096
  }
@@ -12445,9 +12449,9 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
12445
12449
  const selectors = {};
12446
12450
  const groupSelectors = {};
12447
12451
  const svgNamespace = V.namespace.svg;
12448
- const ns = namespace || svgNamespace;
12452
+ const initialNS = namespace || svgNamespace;
12449
12453
  const fragment = document.createDocumentFragment();
12450
- const parseNode = function (siblingsDef, parentNode, ns) {
12454
+ const parseNode = function (siblingsDef, parentNode, parentNS) {
12451
12455
  for (let i = 0; i < siblingsDef.length; i++) {
12452
12456
  const nodeDef = siblingsDef[i];
12453
12457
 
@@ -12464,7 +12468,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
12464
12468
  let node;
12465
12469
 
12466
12470
  // Namespace URI
12467
- if (nodeDef.hasOwnProperty('namespaceURI')) ns = nodeDef.namespaceURI;
12471
+ const ns = nodeDef.hasOwnProperty('namespaceURI') ? nodeDef.namespaceURI : parentNS;
12468
12472
  node = document.createElementNS(ns, tagName);
12469
12473
  const svg = ns === svgNamespace;
12470
12474
  const wrapperNode = svg ? V(node) : $(node);
@@ -12514,7 +12518,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
12514
12518
  }
12515
12519
  }
12516
12520
  };
12517
- parseNode(json, fragment, ns);
12521
+ parseNode(json, fragment, initialNS);
12518
12522
  return {
12519
12523
  fragment: fragment,
12520
12524
  selectors: selectors,
@@ -13845,7 +13849,9 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
13845
13849
  } = opt || {};
13846
13850
  return findDifference(object, base, 0, maxDepth);
13847
13851
  }
13848
- const noop = function () {};
13852
+ const noop = function () {
13853
+ // Do nothing.
13854
+ };
13849
13855
 
13850
13856
  // Events
13851
13857
  // ---------------
@@ -14316,10 +14322,14 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
14316
14322
  cidPrefix: 'c',
14317
14323
  // preinitialize is an empty function by default. You can override it with a function
14318
14324
  // or object. preinitialize will run before any instantiation logic is run in the Model.
14319
- preinitialize: function () {},
14325
+ preinitialize: function () {
14326
+ // No implementation.
14327
+ },
14320
14328
  // Initialize is an empty function by default. Override it with your own
14321
14329
  // initialization logic.
14322
- initialize: function () {},
14330
+ initialize: function () {
14331
+ // No implementation.
14332
+ },
14323
14333
  // Return a copy of the model's `attributes` object.
14324
14334
  toJSON: function (options) {
14325
14335
  return clone(this.attributes);
@@ -20536,10 +20546,14 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
20536
20546
  },
20537
20547
  // preinitialize is an empty function by default. You can override it with a function
20538
20548
  // or object. preinitialize will run before any instantiation logic is run in the View
20539
- preinitialize: function () {},
20549
+ preinitialize: function () {
20550
+ // No implementation.
20551
+ },
20540
20552
  // Initialize is an empty function by default. Override it with your own
20541
20553
  // initialization logic.
20542
- initialize: function () {},
20554
+ initialize: function () {
20555
+ // No implementation.
20556
+ },
20543
20557
  // **render** is the core function that your view should override, in order
20544
20558
  // to populate its element (`this.el`), with the appropriate HTML. The
20545
20559
  // convention is for **render** to always return `this`.
@@ -20929,7 +20943,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
20929
20943
  for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
20930
20944
  args[_key2 - 2] = arguments[_key2];
20931
20945
  }
20932
- if (V.isObject(evt)) {
20946
+ if (evt && typeof evt === 'object') {
20933
20947
  const [context = null] = args;
20934
20948
  Object.entries(evt).forEach(_ref => {
20935
20949
  let [eventName, cb] = _ref;
@@ -21006,10 +21020,14 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
21006
21020
  model: Model,
21007
21021
  // preinitialize is an empty function by default. You can override it with a function
21008
21022
  // or object. preinitialize will run before any instantiation logic is run in the Collection.
21009
- preinitialize: function () {},
21023
+ preinitialize: function () {
21024
+ // No implementation.
21025
+ },
21010
21026
  // Initialize is an empty function by default. Override it with your own
21011
21027
  // initialization logic.
21012
- initialize: function () {},
21028
+ initialize: function () {
21029
+ // No implementation.
21030
+ },
21013
21031
  // The JSON representation of a Collection is an array of the
21014
21032
  // models' attributes.
21015
21033
  toJSON: function (options) {
@@ -21527,13 +21545,13 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
21527
21545
  cellView,
21528
21546
  nodeSelector
21529
21547
  } = this;
21530
- if (!cellView.isMounted()) {
21548
+ if (cellView.isMounted()) {
21549
+ this.update(cellView, nodeSelector);
21550
+ this.mount();
21551
+ this.transform();
21552
+ } else {
21531
21553
  this.postponedUpdate = true;
21532
- return 0;
21533
21554
  }
21534
- this.update(cellView, nodeSelector);
21535
- this.mount();
21536
- this.transform();
21537
21555
  return 0;
21538
21556
  },
21539
21557
  findNode(cellView) {
@@ -28515,7 +28533,9 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
28515
28533
  /**
28516
28534
  * @abstract
28517
28535
  */
28518
- _initializePorts: function () {},
28536
+ _initializePorts: function () {
28537
+ // implemented in ports.js
28538
+ },
28519
28539
  update: function (_, renderingOnlyAttrs) {
28520
28540
  this.cleanNodesCache();
28521
28541
 
@@ -34469,15 +34489,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
34469
34489
  const tool = tools[i];
34470
34490
  tool.updateVisibility();
34471
34491
  if (!tool.isVisible()) continue;
34472
- if (!this.isRendered) {
34473
- // There is at least one visible tool
34474
- this.isRendered = Array(n).fill(false);
34475
- }
34476
- if (!this.isRendered[i]) {
34477
- // First update executes render()
34478
- tool.render();
34479
- this.isRendered[i] = true;
34480
- } else if (opt.tool !== tool.cid) {
34492
+ if (this.ensureToolRendered(tools, i) && opt.tool !== tool.cid) {
34481
34493
  tool.update();
34482
34494
  }
34483
34495
  }
@@ -34495,6 +34507,19 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
34495
34507
  }
34496
34508
  return this;
34497
34509
  },
34510
+ ensureToolRendered(tools, i) {
34511
+ if (!this.isRendered) {
34512
+ // There is at least one visible tool
34513
+ this.isRendered = Array(tools.length).fill(false);
34514
+ }
34515
+ if (!this.isRendered[i]) {
34516
+ // First update executes render()
34517
+ tools[i].render();
34518
+ this.isRendered[i] = true;
34519
+ return false;
34520
+ }
34521
+ return true;
34522
+ },
34498
34523
  focusTool: function (focusedTool) {
34499
34524
  var tools = this.tools;
34500
34525
  if (!tools) return this;
@@ -34517,7 +34542,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
34517
34542
  tool.show();
34518
34543
  // Check if the tool is conditionally visible too
34519
34544
  if (tool.isVisible()) {
34520
- tool.update();
34545
+ this.ensureToolRendered(tools, i) && tool.update();
34521
34546
  }
34522
34547
  }
34523
34548
  }
@@ -34527,7 +34552,12 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
34527
34552
  return this.focusTool(null);
34528
34553
  },
34529
34554
  show: function () {
34530
- return this.blurTool(null);
34555
+ this.blurTool(null);
34556
+ // If this the first time the tools are shown, make sure they are mounted
34557
+ if (!this.isMounted()) {
34558
+ this.mount();
34559
+ }
34560
+ return this;
34531
34561
  },
34532
34562
  onRemove: function () {
34533
34563
  var tools = this.tools;
@@ -36486,7 +36516,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
36486
36516
  Control: Control
36487
36517
  });
36488
36518
 
36489
- var version = "4.1.0";
36519
+ var version = "4.1.2";
36490
36520
 
36491
36521
  const Vectorizer = V;
36492
36522
  const layout = {