pacem 0.40.0-faras → 0.40.0-gerrha

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.
Files changed (56) hide show
  1. package/dist/css/pacem-dark-content.min.css +1 -1
  2. package/dist/css/pacem-dark-shell.min.css +1 -1
  3. package/dist/css/pacem-dark.min.css +1 -1
  4. package/dist/css/pacem-light-content.min.css +1 -1
  5. package/dist/css/pacem-light-shell.min.css +1 -1
  6. package/dist/css/pacem-light.min.css +1 -1
  7. package/dist/css/pacem-phousys-content.min.css +1 -1
  8. package/dist/css/pacem-phousys-shell.min.css +1 -1
  9. package/dist/css/pacem-phousys.min.css +1 -1
  10. package/dist/js/azure-maps.d.ts +3 -3
  11. package/dist/js/pacem-2d.d.ts +1 -1
  12. package/dist/js/pacem-2d.js +1 -1
  13. package/dist/js/pacem-2d.min.js +1 -1
  14. package/dist/js/pacem-3d.d.ts +1 -1
  15. package/dist/js/pacem-3d.js +1 -1
  16. package/dist/js/pacem-3d.min.js +1 -1
  17. package/dist/js/pacem-charts.d.ts +1 -1
  18. package/dist/js/pacem-charts.js +1 -1
  19. package/dist/js/pacem-charts.min.js +1 -1
  20. package/dist/js/pacem-cms.d.ts +1 -1
  21. package/dist/js/pacem-cms.js +1 -1
  22. package/dist/js/pacem-cms.min.js +1 -1
  23. package/dist/js/pacem-core.d.ts +4 -2
  24. package/dist/js/pacem-core.js +94 -27
  25. package/dist/js/pacem-core.min.js +2 -2
  26. package/dist/js/pacem-foundation.d.ts +1 -1
  27. package/dist/js/pacem-foundation.js +1 -1
  28. package/dist/js/pacem-foundation.min.js +1 -1
  29. package/dist/js/pacem-fx.d.ts +1 -1
  30. package/dist/js/pacem-fx.js +1 -1
  31. package/dist/js/pacem-fx.min.js +1 -1
  32. package/dist/js/pacem-logging.d.ts +1 -1
  33. package/dist/js/pacem-logging.js +1 -1
  34. package/dist/js/pacem-logging.min.js +1 -1
  35. package/dist/js/pacem-maps.d.ts +10 -1
  36. package/dist/js/pacem-maps.js +39 -3
  37. package/dist/js/pacem-maps.min.js +2 -2
  38. package/dist/js/pacem-media.d.ts +1 -1
  39. package/dist/js/pacem-media.js +1 -1
  40. package/dist/js/pacem-media.min.js +1 -1
  41. package/dist/js/pacem-networking.js +1 -1
  42. package/dist/js/pacem-networking.min.js +1 -1
  43. package/dist/js/pacem-numerical.d.ts +1 -1
  44. package/dist/js/pacem-numerical.js +1 -1
  45. package/dist/js/pacem-numerical.min.js +1 -1
  46. package/dist/js/pacem-plus.d.ts +1 -1
  47. package/dist/js/pacem-plus.js +1 -1
  48. package/dist/js/pacem-plus.min.js +1 -1
  49. package/dist/js/pacem-scaffolding.d.ts +1 -1
  50. package/dist/js/pacem-scaffolding.js +1 -1
  51. package/dist/js/pacem-scaffolding.min.js +1 -1
  52. package/dist/js/pacem-ui.d.ts +1 -1
  53. package/dist/js/pacem-ui.js +1 -1
  54. package/dist/js/pacem-ui.min.js +1 -1
  55. package/dist/js/swagger-types.d.ts +1 -1
  56. package/package.json +2 -3
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.40.0-faras (https://js.pacem.it)
2
+ * pacem v0.40.0-gerrha (https://js.pacem.it)
3
3
  * Copyright 2023 Pacem (https://pacem.it)
4
4
  * Licensed under MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.40.0-faras (https://js.pacem.it)
2
+ * pacem v0.40.0-gerrha (https://js.pacem.it)
3
3
  * Copyright 2023 Pacem (https://pacem.it)
4
4
  * Licensed under MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.40.0-faras (https://js.pacem.it)
2
+ * pacem v0.40.0-gerrha (https://js.pacem.it)
3
3
  * Copyright 2023 Pacem (https://pacem.it)
4
4
  * Licensed under MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.40.0-faras (https://js.pacem.it)
2
+ * pacem v0.40.0-gerrha (https://js.pacem.it)
3
3
  * Copyright 2023 Pacem (https://pacem.it)
4
4
  * Licensed under MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.40.0-faras (https://js.pacem.it)
2
+ * pacem v0.40.0-gerrha (https://js.pacem.it)
3
3
  * Copyright 2023 Pacem (https://pacem.it)
4
4
  * Licensed under MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.40.0-faras (https://js.pacem.it)
2
+ * pacem v0.40.0-gerrha (https://js.pacem.it)
3
3
  * Copyright 2023 Pacem (https://pacem.it)
4
4
  * Licensed under MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.40.0-faras (https://js.pacem.it)
2
+ * pacem v0.40.0-gerrha (https://js.pacem.it)
3
3
  * Copyright 2023 Pacem (https://pacem.it)
4
4
  * Licensed under MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.40.0-faras (https://js.pacem.it)
2
+ * pacem v0.40.0-gerrha (https://js.pacem.it)
3
3
  * Copyright 2023 Pacem (https://pacem.it)
4
4
  * Licensed under MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.40.0-faras (https://js.pacem.it)
2
+ * pacem v0.40.0-gerrha (https://js.pacem.it)
3
3
  * Copyright 2023 Pacem (https://pacem.it)
4
4
  * Licensed under MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.40.0-faras (https://js.pacem.it)
2
+ * pacem v0.40.0-gerrha (https://js.pacem.it)
3
3
  * Copyright 2023 Pacem (https://pacem.it)
4
4
  * Licensed under MIT
5
5
  */
@@ -3378,7 +3378,7 @@ declare namespace atlas {
3378
3378
  * @param eventType The event name.
3379
3379
  * @param callback The event handler callback.
3380
3380
  */
3381
- add(eventType: "boxzoomstart" | "boxzoomend" | "dragstart" | "drag" | "dragend" | "load" | "movestart" | "move" | "moveend" | "pitchstart" | "pitch" | "pitchend" | "ready" | "render" | "resize" | "rotatestart" | "rotate" | "rotateend" | "styledata" | "tokenacquired" | "zoomstart" | "zoom" | "zoomend", callback: (e: MapEvent) => void): void;
3381
+ add(eventType: "boxzoomstart" | "boxzoomend" | "dragstart" | "drag" | "dragend" | "idle" | "load" | "movestart" | "move" | "moveend" | "pitchstart" | "pitch" | "pitchend" | "ready" | "render" | "resize" | "rotatestart" | "rotate" | "rotateend" | "styledata" | "tokenacquired" | "zoomstart" | "zoom" | "zoomend", callback: (e: MapEvent) => void): void;
3382
3382
  /**
3383
3383
  * Adds a touch event to the map.
3384
3384
  * @param eventType The touch event name.
@@ -3443,7 +3443,7 @@ declare namespace atlas {
3443
3443
  * @param eventType The event name.
3444
3444
  * @param callback The event handler callback.
3445
3445
  */
3446
- addOnce(eventType: "boxzoomstart" | "boxzoomend" | "dragstart" | "drag" | "dragend" | "load" | "movestart" | "move" | "moveend" | "pitchstart" | "pitch" | "pitchend" | "ready" | "render" | "resize" | "rotatestart" | "rotate" | "rotateend" | "styledata" | "tokenacquired" | "zoomstart" | "zoom" | "zoomend", callback: (e: MapEvent) => void): any;
3446
+ addOnce(eventType: "boxzoomstart" | "boxzoomend" | "dragstart" | "drag" | "dragend" | "idle" | "load" | "movestart" | "move" | "moveend" | "pitchstart" | "pitch" | "pitchend" | "ready" | "render" | "resize" | "rotatestart" | "rotate" | "rotateend" | "styledata" | "tokenacquired" | "zoomstart" | "zoom" | "zoomend", callback: (e: MapEvent) => void): any;
3447
3447
  /**
3448
3448
  * Adds a touch event to the map.
3449
3449
  * @param eventType The touch event name.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.40.0-faras (https://js.pacem.it)
2
+ * pacem v0.40.0-gerrha (https://js.pacem.it)
3
3
  * Copyright 2023 Pacem (https://pacem.it)
4
4
  * Licensed under MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.40.0-faras (https://js.pacem.it)
2
+ * pacem v0.40.0-gerrha (https://js.pacem.it)
3
3
  * Copyright 2023 Pacem (https://pacem.it)
4
4
  * Licensed under MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.40.0-faras (https://js.pacem.it)
2
+ * pacem v0.40.0-gerrha (https://js.pacem.it)
3
3
  * Copyright 2023 Pacem (https://pacem.it)
4
4
  * Licensed under MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.40.0-faras (https://js.pacem.it)
2
+ * pacem v0.40.0-gerrha (https://js.pacem.it)
3
3
  * Copyright 2023 Pacem (https://pacem.it)
4
4
  * Licensed under MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.40.0-faras (https://js.pacem.it)
2
+ * pacem v0.40.0-gerrha (https://js.pacem.it)
3
3
  * Copyright 2023 Pacem (https://pacem.it)
4
4
  * Licensed under MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.40.0-faras (https://js.pacem.it)
2
+ * pacem v0.40.0-gerrha (https://js.pacem.it)
3
3
  * Copyright 2023 Pacem (https://pacem.it)
4
4
  * Licensed under MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.40.0-faras (https://js.pacem.it)
2
+ * pacem v0.40.0-gerrha (https://js.pacem.it)
3
3
  * Copyright 2023 Pacem (https://pacem.it)
4
4
  * Licensed under MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.40.0-faras (https://js.pacem.it)
2
+ * pacem v0.40.0-gerrha (https://js.pacem.it)
3
3
  * Copyright 2023 Pacem (https://pacem.it)
4
4
  * Licensed under MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.40.0-faras (https://js.pacem.it)
2
+ * pacem v0.40.0-gerrha (https://js.pacem.it)
3
3
  * Copyright 2023 Pacem (https://pacem.it)
4
4
  * Licensed under MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.40.0-faras (https://js.pacem.it)
2
+ * pacem v0.40.0-gerrha (https://js.pacem.it)
3
3
  * Copyright 2023 Pacem (https://pacem.it)
4
4
  * Licensed under MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.40.0-faras (https://js.pacem.it)
2
+ * pacem v0.40.0-gerrha (https://js.pacem.it)
3
3
  * Copyright 2023 Pacem (https://pacem.it)
4
4
  * Licensed under MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.40.0-faras (https://js.pacem.it)
2
+ * pacem v0.40.0-gerrha (https://js.pacem.it)
3
3
  * Copyright 2023 Pacem (https://pacem.it)
4
4
  * Licensed under MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.40.0-faras (https://js.pacem.it)
2
+ * pacem v0.40.0-gerrha (https://js.pacem.it)
3
3
  * Copyright 2023 Pacem (https://pacem.it)
4
4
  * Licensed under MIT
5
5
  */
@@ -219,8 +219,10 @@ declare namespace Pacem {
219
219
  * Snapshots a DOM element and returns its blob image representation.
220
220
  * @param el Element to snapshot
221
221
  * @param background Background color to replace the original
222
+ * @param type Output mimetype (image/png, image/jpeg, images/webp, ...)
223
+ * @param quality Quality ratio between 0..1
222
224
  */
223
- static snapshotElement(el: HTMLElement | SVGElement, background?: string): PromiseLike<Blob>;
225
+ static snapshotElement(el: HTMLElement | SVGElement, background?: string, type?: string, quality?: number): PromiseLike<Blob>;
224
226
  static download(content: Blob, filename?: string, mime?: string): PromiseLike<void>;
225
227
  static download(url: string, filename?: string, mime?: string): PromiseLike<void>;
226
228
  static download(url: string, options: DownloadOptions): PromiseLike<void>;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.40.0-faras (https://js.pacem.it)
2
+ * pacem v0.40.0-gerrha (https://js.pacem.it)
3
3
  * Copyright 2023 Pacem (https://pacem.it)
4
4
  * Licensed under MIT
5
5
  */
@@ -568,8 +568,10 @@ var Pacem;
568
568
  * Snapshots a DOM element and returns its blob image representation.
569
569
  * @param el Element to snapshot
570
570
  * @param background Background color to replace the original
571
+ * @param type Output mimetype (image/png, image/jpeg, images/webp, ...)
572
+ * @param quality Quality ratio between 0..1
571
573
  */
572
- static snapshotElement(el, background) {
574
+ static snapshotElement(el, background, type = 'image/png', quality) {
573
575
  function drawCanvas(img) {
574
576
  return new Promise(resolve => {
575
577
  const canvas = document.createElement('canvas');
@@ -583,41 +585,106 @@ var Pacem;
583
585
  ctx.drawImage(img, 0, 0);
584
586
  return canvas.toBlob(b => {
585
587
  resolve(b);
586
- }, 'image/png');
588
+ }, type, quality);
587
589
  });
588
590
  }
589
591
  if (el instanceof HTMLCanvasElement) {
590
592
  return drawCanvas(el);
591
593
  }
592
594
  return new Promise((resolve, _) => {
593
- if (!(el instanceof SVGElement)) {
595
+ const isSvg = el instanceof SVGElement;
596
+ if (!isSvg) {
594
597
  var doc = document.implementation.createHTMLDocument('');
595
598
  doc.write(el.outerHTML);
596
599
  doc.documentElement.setAttribute('xmlns', doc.documentElement.namespaceURI);
597
- const node = document.evaluate(".//" + el.localName, doc.body, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
600
+ const xpath = document.evaluate(".//" + el.localName, doc.body, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
601
+ const node = xpath;
598
602
  node.setAttribute('xmlns', doc.documentElement.namespaceURI);
599
- node.style.cssText = getComputedStyle(el).cssText;
600
- // Get well-formed markup
601
- const svg = document.createElementNS("http://www.w3.org/2000/svg", 'svg');
602
- const size = Utils.offset(el);
603
- svg.setAttribute('width', size.width.toString());
604
- svg.setAttribute('height', size.height.toString());
605
- svg.innerHTML = '<foreignObject width="100%" height="100%">' +
606
- node.outerHTML +
607
- '</foreignObject>';
608
- el = svg;
609
- }
610
- const data = new XMLSerializer().serializeToString(el);
611
- var domURL = this._domURL;
612
- var img = new Image();
613
- img.crossOrigin = 'anonymous';
614
- var svg = new Blob([data], { type: 'image/svg+xml' });
615
- var url = domURL.createObjectURL(svg);
616
- img.onload = () => {
617
- drawCanvas(img).then(resolve);
618
- domURL.revokeObjectURL(url);
619
- };
620
- img.src = url;
603
+ const loadPromises = [];
604
+ function addLoadPromise(img) {
605
+ const p = new Promise((resolve0, _) => {
606
+ fetch(img.src)
607
+ .then(r => r.blob())
608
+ .then(blob => Utils.blobToDataURL(blob))
609
+ .then(url => {
610
+ img.src = url;
611
+ resolve0();
612
+ });
613
+ });
614
+ loadPromises.push(p);
615
+ }
616
+ function copyCanvas(copy, srcCanvas) {
617
+ const p = new Promise((resolve0, _) => {
618
+ const img = new Image();
619
+ img.crossOrigin = 'anonymous';
620
+ img.width = srcCanvas.width;
621
+ img.height = srcCanvas.height;
622
+ img.style.cssText = copy.style.cssText;
623
+ img.onload = () => {
624
+ copy.replaceWith(img);
625
+ resolve0();
626
+ };
627
+ img.src = srcCanvas.toDataURL();
628
+ });
629
+ loadPromises.push(p);
630
+ }
631
+ function applyCss(copy, src) {
632
+ const css = getComputedStyle(src);
633
+ for (let j = 0; j < css.length; j++) {
634
+ const item = css.item(j);
635
+ copy.style[item] = css[item];
636
+ }
637
+ }
638
+ function recSetupCopy(copy, src) {
639
+ // assign css text
640
+ applyCss(copy, src);
641
+ // bitmaps
642
+ if (copy instanceof HTMLImageElement) {
643
+ addLoadPromise(copy);
644
+ }
645
+ else if (copy instanceof HTMLCanvasElement) {
646
+ copyCanvas(copy, src);
647
+ }
648
+ // recursion
649
+ const childLength = copy.children.length;
650
+ for (let i = 0; i < childLength; i++) {
651
+ const copy1 = copy.children.item(i), src1 = src.children.item(i);
652
+ if (copy1.tagName === src1.tagName) {
653
+ recSetupCopy(copy1, src1);
654
+ }
655
+ }
656
+ }
657
+ recSetupCopy(node, el);
658
+ Promise.all(loadPromises).then(_ => {
659
+ // Get well-formed markup
660
+ const svg = document.createElementNS("http://www.w3.org/2000/svg", 'svg');
661
+ const size = Utils.offset(el);
662
+ svg.setAttribute('viewBox', `0 0 ${size.width} ${size.height}`);
663
+ svg.setAttribute('width', size.width.toString());
664
+ svg.setAttribute('height', size.height.toString());
665
+ svg.innerHTML = `<foreignObject width="${size.width}" height="${size.height}">${node.outerHTML}</foreignObject>`;
666
+ el = svg;
667
+ execute();
668
+ });
669
+ }
670
+ else {
671
+ execute();
672
+ }
673
+ function execute() {
674
+ const data = new XMLSerializer().serializeToString(el);
675
+ const img = new Image();
676
+ img.crossOrigin = 'anonymous';
677
+ // switching from blob to data url (see: https://bugs.chromium.org/p/chromium/issues/detail?id=294129)
678
+ //const domURL = this._domURL;
679
+ //var svg = new Blob([data], { type: 'image/svg+xml' });
680
+ //var url = domURL.createObjectURL(svg);
681
+ const url = 'data:image/svg+xml;charset=utf8,' + encodeURIComponent(data);
682
+ img.onload = () => {
683
+ drawCanvas(img).then(resolve);
684
+ //domURL.revokeObjectURL(url);
685
+ };
686
+ img.src = url;
687
+ }
621
688
  });
622
689
  }
623
690
  static download(arg0, arg1, mime = "application/download") {