@loaders.gl/mvt 4.3.0-alpha.7 → 4.3.0-beta.1

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.
@@ -133,7 +133,7 @@
133
133
  var SHIFT_LEFT_32 = (1 << 16) * (1 << 16);
134
134
  var SHIFT_RIGHT_32 = 1 / SHIFT_LEFT_32;
135
135
  var TEXT_DECODER_MIN_LENGTH = 12;
136
- var utf8TextDecoder = typeof TextDecoder === "undefined" ? null : new TextDecoder("utf8");
136
+ var utf8TextDecoder = typeof TextDecoder === "undefined" ? null : new TextDecoder("utf-8");
137
137
  Pbf.prototype = {
138
138
  destroy: function() {
139
139
  this.buf = null;
@@ -771,52 +771,6 @@
771
771
  }
772
772
  });
773
773
 
774
- // ../../node_modules/@babel/runtime/helpers/esm/typeof.js
775
- function _typeof(obj) {
776
- "@babel/helpers - typeof";
777
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
778
- return typeof obj2;
779
- } : function(obj2) {
780
- return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
781
- }, _typeof(obj);
782
- }
783
-
784
- // ../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js
785
- function _toPrimitive(input, hint) {
786
- if (_typeof(input) !== "object" || input === null)
787
- return input;
788
- var prim = input[Symbol.toPrimitive];
789
- if (prim !== void 0) {
790
- var res = prim.call(input, hint || "default");
791
- if (_typeof(res) !== "object")
792
- return res;
793
- throw new TypeError("@@toPrimitive must return a primitive value.");
794
- }
795
- return (hint === "string" ? String : Number)(input);
796
- }
797
-
798
- // ../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
799
- function _toPropertyKey(arg) {
800
- var key = _toPrimitive(arg, "string");
801
- return _typeof(key) === "symbol" ? key : String(key);
802
- }
803
-
804
- // ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
805
- function _defineProperty(obj, key, value) {
806
- key = _toPropertyKey(key);
807
- if (key in obj) {
808
- Object.defineProperty(obj, key, {
809
- value,
810
- enumerable: true,
811
- configurable: true,
812
- writable: true
813
- });
814
- } else {
815
- obj[key] = value;
816
- }
817
- return obj;
818
- }
819
-
820
774
  // ../../node_modules/@math.gl/polygon/dist/polygon-utils.js
821
775
  var DimIndex = {
822
776
  x: 0,
@@ -824,11 +778,7 @@
824
778
  z: 2
825
779
  };
826
780
  function getPolygonSignedArea(points, options = {}) {
827
- const {
828
- start = 0,
829
- end = points.length,
830
- plane = "xy"
831
- } = options;
781
+ const { start = 0, end = points.length, plane = "xy" } = options;
832
782
  const dim = options.size || 2;
833
783
  let area2 = 0;
834
784
  const i0 = DimIndex[plane[0]];
@@ -882,12 +832,7 @@
882
832
  let i;
883
833
  let last;
884
834
  if (area2 === void 0) {
885
- area2 = getPolygonSignedArea(data, {
886
- start,
887
- end,
888
- size: dim,
889
- plane
890
- });
835
+ area2 = getPolygonSignedArea(data, { start, end, size: dim, plane });
891
836
  }
892
837
  let i0 = DimIndex[plane[0]];
893
838
  let i1 = DimIndex[plane[1]];
@@ -1222,7 +1167,10 @@
1222
1167
  return (cx - px) * (ay - py) >= (ax - px) * (cy - py) && (ax - px) * (by - py) >= (bx - px) * (ay - py) && (bx - px) * (cy - py) >= (cx - px) * (by - py);
1223
1168
  }
1224
1169
  function isValidDiagonal(a, b) {
1225
- return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && (locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b) && (area(a.prev, a, b.prev) || area(a, b.prev, b)) || equals(a, b) && area(a.prev, a, a.next) > 0 && area(b.prev, b, b.next) > 0);
1170
+ return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && // dones't intersect other edges
1171
+ (locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b) && // locally visible
1172
+ (area(a.prev, a, b.prev) || area(a, b.prev, b)) || // does not create opposite-facing sectors
1173
+ equals(a, b) && area(a.prev, a, a.next) > 0 && area(b.prev, b, b.next) > 0);
1226
1174
  }
1227
1175
  function area(p, q, r) {
1228
1176
  return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);
@@ -1315,15 +1263,12 @@
1315
1263
  }
1316
1264
  var Vertex = class {
1317
1265
  constructor(i, x, y) {
1318
- _defineProperty(this, "i", void 0);
1319
- _defineProperty(this, "x", void 0);
1320
- _defineProperty(this, "y", void 0);
1321
- _defineProperty(this, "prev", null);
1322
- _defineProperty(this, "next", null);
1323
- _defineProperty(this, "z", 0);
1324
- _defineProperty(this, "prevZ", null);
1325
- _defineProperty(this, "nextZ", null);
1326
- _defineProperty(this, "steiner", false);
1266
+ this.prev = null;
1267
+ this.next = null;
1268
+ this.z = 0;
1269
+ this.prevZ = null;
1270
+ this.nextZ = null;
1271
+ this.steiner = false;
1327
1272
  this.i = i;
1328
1273
  this.x = x;
1329
1274
  this.y = y;
@@ -1618,39 +1563,37 @@
1618
1563
  return constructor === Float64Array || Math.fround(x) !== x ? Float64Array : Float32Array;
1619
1564
  }
1620
1565
 
1566
+ // ../../node_modules/@probe.gl/log/node_modules/@probe.gl/env/dist/lib/globals.js
1567
+ var window_ = globalThis;
1568
+ var document_ = globalThis.document || {};
1569
+ var process_ = globalThis.process || {};
1570
+ var console_ = globalThis.console;
1571
+ var navigator_ = globalThis.navigator || {};
1572
+
1621
1573
  // ../../node_modules/@probe.gl/log/node_modules/@probe.gl/env/dist/lib/is-electron.js
1622
1574
  function isElectron(mockUserAgent) {
1623
- if (typeof window !== "undefined" && typeof window.process === "object" && window.process.type === "renderer") {
1575
+ if (typeof window !== "undefined" && window.process?.type === "renderer") {
1624
1576
  return true;
1625
1577
  }
1626
- if (typeof process !== "undefined" && typeof process.versions === "object" && Boolean(process.versions["electron"])) {
1578
+ if (typeof process !== "undefined" && Boolean(process.versions?.["electron"])) {
1627
1579
  return true;
1628
1580
  }
1629
- const realUserAgent = typeof navigator === "object" && typeof navigator.userAgent === "string" && navigator.userAgent;
1581
+ const realUserAgent = typeof navigator !== "undefined" && navigator.userAgent;
1630
1582
  const userAgent = mockUserAgent || realUserAgent;
1631
- if (userAgent && userAgent.indexOf("Electron") >= 0) {
1632
- return true;
1633
- }
1634
- return false;
1583
+ return Boolean(userAgent && userAgent.indexOf("Electron") >= 0);
1635
1584
  }
1636
1585
 
1637
1586
  // ../../node_modules/@probe.gl/log/node_modules/@probe.gl/env/dist/lib/is-browser.js
1638
1587
  function isBrowser() {
1639
- const isNode = typeof process === "object" && String(process) === "[object process]" && !process.browser;
1588
+ const isNode = (
1589
+ // @ts-expect-error
1590
+ typeof process === "object" && String(process) === "[object process]" && !process?.browser
1591
+ );
1640
1592
  return !isNode || isElectron();
1641
1593
  }
1642
1594
 
1643
- // ../../node_modules/@probe.gl/log/node_modules/@probe.gl/env/dist/lib/globals.js
1644
- var self_ = globalThis.self || globalThis.window || globalThis.global;
1645
- var window_ = globalThis.window || globalThis.self || globalThis.global;
1646
- var document_ = globalThis.document || {};
1647
- var process_ = globalThis.process || {};
1648
- var console_ = globalThis.console;
1649
- var navigator_ = globalThis.navigator || {};
1650
-
1651
- // ../../node_modules/@probe.gl/log/node_modules/@probe.gl/env/dist/utils/globals.js
1652
- var VERSION = true ? "4.3.0-alpha.6" : "untranspiled source";
1653
- var isBrowser2 = isBrowser();
1595
+ // ../../node_modules/@probe.gl/log/node_modules/@probe.gl/env/dist/index.js
1596
+ var VERSION = true ? "4.0.7" : "untranspiled source";
1654
1597
 
1655
1598
  // ../../node_modules/@probe.gl/log/dist/utils/local-storage.js
1656
1599
  function getStorage(type) {
@@ -1665,11 +1608,7 @@
1665
1608
  }
1666
1609
  }
1667
1610
  var LocalStorage = class {
1668
- constructor(id, defaultConfig) {
1669
- let type = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "sessionStorage";
1670
- _defineProperty(this, "storage", void 0);
1671
- _defineProperty(this, "id", void 0);
1672
- _defineProperty(this, "config", void 0);
1611
+ constructor(id, defaultConfig, type = "sessionStorage") {
1673
1612
  this.storage = getStorage(type);
1674
1613
  this.id = id;
1675
1614
  this.config = defaultConfig;
@@ -1685,6 +1624,7 @@
1685
1624
  this.storage.setItem(this.id, serialized);
1686
1625
  }
1687
1626
  }
1627
+ // Get config from persistent store, if available
1688
1628
  _loadConfiguration() {
1689
1629
  let configuration = {};
1690
1630
  if (this.storage) {
@@ -1700,31 +1640,19 @@
1700
1640
  function formatTime(ms) {
1701
1641
  let formatted;
1702
1642
  if (ms < 10) {
1703
- formatted = "".concat(ms.toFixed(2), "ms");
1643
+ formatted = `${ms.toFixed(2)}ms`;
1704
1644
  } else if (ms < 100) {
1705
- formatted = "".concat(ms.toFixed(1), "ms");
1645
+ formatted = `${ms.toFixed(1)}ms`;
1706
1646
  } else if (ms < 1e3) {
1707
- formatted = "".concat(ms.toFixed(0), "ms");
1647
+ formatted = `${ms.toFixed(0)}ms`;
1708
1648
  } else {
1709
- formatted = "".concat((ms / 1e3).toFixed(2), "s");
1649
+ formatted = `${(ms / 1e3).toFixed(2)}s`;
1710
1650
  }
1711
1651
  return formatted;
1712
1652
  }
1713
- function leftPad(string) {
1714
- let length = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 8;
1653
+ function leftPad(string, length = 8) {
1715
1654
  const padLength = Math.max(length - string.length, 0);
1716
- return "".concat(" ".repeat(padLength)).concat(string);
1717
- }
1718
- function formatImage(image, message, scale) {
1719
- let maxWidth = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 600;
1720
- const imageUrl = image.src.replace(/\(/g, "%28").replace(/\)/g, "%29");
1721
- if (image.width > maxWidth) {
1722
- scale = Math.min(scale, maxWidth / image.width);
1723
- }
1724
- const width = image.width * scale;
1725
- const height = image.height * scale;
1726
- const style = ["font-size:1px;", "padding:".concat(Math.floor(height / 2), "px ").concat(Math.floor(width / 2), "px;"), "line-height:".concat(height, "px;"), "background:url(".concat(imageUrl, ");"), "background-size:".concat(width, "px ").concat(height, "px;"), "color:transparent;"].join("");
1727
- return ["".concat(message, " %c+"), style];
1655
+ return `${" ".repeat(padLength)}${string}`;
1728
1656
  }
1729
1657
 
1730
1658
  // ../../node_modules/@probe.gl/log/dist/utils/color.js
@@ -1759,19 +1687,18 @@
1759
1687
  if (!isBrowser && typeof string === "string") {
1760
1688
  if (color) {
1761
1689
  const colorCode = getColor(color);
1762
- string = "\x1B[".concat(colorCode, "m").concat(string, "\x1B[39m");
1690
+ string = `\x1B[${colorCode}m${string}\x1B[39m`;
1763
1691
  }
1764
1692
  if (background) {
1765
1693
  const colorCode = getColor(background);
1766
- string = "\x1B[".concat(colorCode + BACKGROUND_INCREMENT, "m").concat(string, "\x1B[49m");
1694
+ string = `\x1B[${colorCode + BACKGROUND_INCREMENT}m${string}\x1B[49m`;
1767
1695
  }
1768
1696
  }
1769
1697
  return string;
1770
1698
  }
1771
1699
 
1772
1700
  // ../../node_modules/@probe.gl/log/dist/utils/autobind.js
1773
- function autobind(obj) {
1774
- let predefined = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ["constructor"];
1701
+ function autobind(obj, predefined = ["constructor"]) {
1775
1702
  const proto = Object.getPrototypeOf(obj);
1776
1703
  const propNames = Object.getOwnPropertyNames(proto);
1777
1704
  const object = obj;
@@ -1796,11 +1723,9 @@
1796
1723
  function getHiResTimestamp() {
1797
1724
  let timestamp;
1798
1725
  if (isBrowser() && window_.performance) {
1799
- var _window$performance, _window$performance$n;
1800
- timestamp = window_ === null || window_ === void 0 ? void 0 : (_window$performance = window_.performance) === null || _window$performance === void 0 ? void 0 : (_window$performance$n = _window$performance.now) === null || _window$performance$n === void 0 ? void 0 : _window$performance$n.call(_window$performance);
1726
+ timestamp = window_?.performance?.now?.();
1801
1727
  } else if ("hrtime" in process_) {
1802
- var _process$hrtime;
1803
- const timeParts = process_ === null || process_ === void 0 ? void 0 : (_process$hrtime = process_.hrtime) === null || _process$hrtime === void 0 ? void 0 : _process$hrtime.call(process_);
1728
+ const timeParts = process_?.hrtime?.();
1804
1729
  timestamp = timeParts[0] * 1e3 + timeParts[1] / 1e6;
1805
1730
  } else {
1806
1731
  timestamp = Date.now();
@@ -1823,27 +1748,18 @@
1823
1748
  function noop() {
1824
1749
  }
1825
1750
  var cache = {};
1826
- var ONCE = {
1827
- once: true
1828
- };
1751
+ var ONCE = { once: true };
1829
1752
  var Log = class {
1830
- constructor() {
1831
- let {
1832
- id
1833
- } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
1834
- id: ""
1835
- };
1836
- _defineProperty(this, "id", void 0);
1837
- _defineProperty(this, "VERSION", VERSION);
1838
- _defineProperty(this, "_startTs", getHiResTimestamp());
1839
- _defineProperty(this, "_deltaTs", getHiResTimestamp());
1840
- _defineProperty(this, "_storage", void 0);
1841
- _defineProperty(this, "userData", {});
1842
- _defineProperty(this, "LOG_THROTTLE_TIMEOUT", 0);
1753
+ constructor({ id } = { id: "" }) {
1754
+ this.VERSION = VERSION;
1755
+ this._startTs = getHiResTimestamp();
1756
+ this._deltaTs = getHiResTimestamp();
1757
+ this.userData = {};
1758
+ this.LOG_THROTTLE_TIMEOUT = 0;
1843
1759
  this.id = id;
1844
1760
  this.userData = {};
1845
- this._storage = new LocalStorage("__probe-".concat(this.id, "__"), DEFAULT_LOG_CONFIGURATION);
1846
- this.timeStamp("".concat(this.id, " started"));
1761
+ this._storage = new LocalStorage(`__probe-${this.id}__`, DEFAULT_LOG_CONFIGURATION);
1762
+ this.timeStamp(`${this.id} started`);
1847
1763
  autobind(this);
1848
1764
  Object.seal(this);
1849
1765
  }
@@ -1859,42 +1775,44 @@
1859
1775
  getLevel() {
1860
1776
  return this._storage.config.level;
1861
1777
  }
1778
+ /** @return milliseconds, with fractions */
1862
1779
  getTotal() {
1863
1780
  return Number((getHiResTimestamp() - this._startTs).toPrecision(10));
1864
1781
  }
1782
+ /** @return milliseconds, with fractions */
1865
1783
  getDelta() {
1866
1784
  return Number((getHiResTimestamp() - this._deltaTs).toPrecision(10));
1867
1785
  }
1786
+ /** @deprecated use logLevel */
1868
1787
  set priority(newPriority) {
1869
1788
  this.level = newPriority;
1870
1789
  }
1790
+ /** @deprecated use logLevel */
1871
1791
  get priority() {
1872
1792
  return this.level;
1873
1793
  }
1794
+ /** @deprecated use logLevel */
1874
1795
  getPriority() {
1875
1796
  return this.level;
1876
1797
  }
1877
- enable() {
1878
- let enabled = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
1879
- this._storage.setConfiguration({
1880
- enabled
1881
- });
1798
+ // Configure
1799
+ enable(enabled = true) {
1800
+ this._storage.setConfiguration({ enabled });
1882
1801
  return this;
1883
1802
  }
1884
1803
  setLevel(level) {
1885
- this._storage.setConfiguration({
1886
- level
1887
- });
1804
+ this._storage.setConfiguration({ level });
1888
1805
  return this;
1889
1806
  }
1807
+ /** return the current status of the setting */
1890
1808
  get(setting) {
1891
1809
  return this._storage.config[setting];
1892
1810
  }
1811
+ // update the status of the setting
1893
1812
  set(setting, value) {
1894
- this._storage.setConfiguration({
1895
- [setting]: value
1896
- });
1813
+ this._storage.setConfiguration({ [setting]: value });
1897
1814
  }
1815
+ /** Logs the current settings as a table */
1898
1816
  settings() {
1899
1817
  if (console.table) {
1900
1818
  console.table(this._storage.config);
@@ -1902,8 +1820,11 @@
1902
1820
  console.log(this._storage.config);
1903
1821
  }
1904
1822
  }
1823
+ // Unconditional logging
1905
1824
  assert(condition, message) {
1906
- assert(condition, message);
1825
+ if (!condition) {
1826
+ throw new Error(message || "Assertion failed");
1827
+ }
1907
1828
  }
1908
1829
  warn(message) {
1909
1830
  return this._getLogFunction(0, message, originalConsole.warn, arguments, ONCE);
@@ -1911,11 +1832,13 @@
1911
1832
  error(message) {
1912
1833
  return this._getLogFunction(0, message, originalConsole.error, arguments);
1913
1834
  }
1835
+ /** Print a deprecation warning */
1914
1836
  deprecated(oldUsage, newUsage) {
1915
- return this.warn("`".concat(oldUsage, "` is deprecated and will be removed in a later version. Use `").concat(newUsage, "` instead"));
1837
+ return this.warn(`\`${oldUsage}\` is deprecated and will be removed in a later version. Use \`${newUsage}\` instead`);
1916
1838
  }
1839
+ /** Print a removal warning */
1917
1840
  removed(oldUsage, newUsage) {
1918
- return this.error("`".concat(oldUsage, "` has been removed. Use `").concat(newUsage, "` instead"));
1841
+ return this.error(`\`${oldUsage}\` has been removed. Use \`${newUsage}\` instead`);
1919
1842
  }
1920
1843
  probe(logLevel, message) {
1921
1844
  return this._getLogFunction(logLevel, message, originalConsole.log, arguments, {
@@ -1932,6 +1855,7 @@
1932
1855
  once(logLevel, message) {
1933
1856
  return this._getLogFunction(logLevel, message, originalConsole.debug || originalConsole.info, arguments, ONCE);
1934
1857
  }
1858
+ /** Logs an object as a table */
1935
1859
  table(logLevel, table, columns) {
1936
1860
  if (table) {
1937
1861
  return this._getLogFunction(logLevel, table, console.table || noop, columns && [columns], {
@@ -1940,27 +1864,6 @@
1940
1864
  }
1941
1865
  return noop;
1942
1866
  }
1943
- image(_ref) {
1944
- let {
1945
- logLevel,
1946
- priority,
1947
- image,
1948
- message = "",
1949
- scale = 1
1950
- } = _ref;
1951
- if (!this._shouldLog(logLevel || priority)) {
1952
- return noop;
1953
- }
1954
- return isBrowser() ? logImageInBrowser({
1955
- image,
1956
- message,
1957
- scale
1958
- }) : logImageInNode({
1959
- image,
1960
- message,
1961
- scale
1962
- });
1963
- }
1964
1867
  time(logLevel, message) {
1965
1868
  return this._getLogFunction(logLevel, message, console.time ? console.time : console.info);
1966
1869
  }
@@ -1970,30 +1873,19 @@
1970
1873
  timeStamp(logLevel, message) {
1971
1874
  return this._getLogFunction(logLevel, message, console.timeStamp || noop);
1972
1875
  }
1973
- group(logLevel, message) {
1974
- let opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
1975
- collapsed: false
1976
- };
1977
- const options = normalizeArguments({
1978
- logLevel,
1979
- message,
1980
- opts
1981
- });
1982
- const {
1983
- collapsed
1984
- } = opts;
1876
+ group(logLevel, message, opts = { collapsed: false }) {
1877
+ const options = normalizeArguments({ logLevel, message, opts });
1878
+ const { collapsed } = opts;
1985
1879
  options.method = (collapsed ? console.groupCollapsed : console.group) || console.info;
1986
1880
  return this._getLogFunction(options);
1987
1881
  }
1988
- groupCollapsed(logLevel, message) {
1989
- let opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
1990
- return this.group(logLevel, message, Object.assign({}, opts, {
1991
- collapsed: true
1992
- }));
1882
+ groupCollapsed(logLevel, message, opts = {}) {
1883
+ return this.group(logLevel, message, Object.assign({}, opts, { collapsed: true }));
1993
1884
  }
1994
1885
  groupEnd(logLevel) {
1995
1886
  return this._getLogFunction(logLevel, "", console.groupEnd || noop);
1996
1887
  }
1888
+ // EXPERIMENTAL
1997
1889
  withGroup(logLevel, message, func) {
1998
1890
  this.group(logLevel, message)();
1999
1891
  try {
@@ -2007,17 +1899,14 @@
2007
1899
  console.trace();
2008
1900
  }
2009
1901
  }
1902
+ // PRIVATE METHODS
1903
+ /** Deduces log level from a variety of arguments */
2010
1904
  _shouldLog(logLevel) {
2011
1905
  return this.isEnabled() && this.getLevel() >= normalizeLogLevel(logLevel);
2012
1906
  }
2013
1907
  _getLogFunction(logLevel, message, method, args, opts) {
2014
1908
  if (this._shouldLog(logLevel)) {
2015
- opts = normalizeArguments({
2016
- logLevel,
2017
- message,
2018
- args,
2019
- opts
2020
- });
1909
+ opts = normalizeArguments({ logLevel, message, args, opts });
2021
1910
  method = method || opts.method;
2022
1911
  assert(method);
2023
1912
  opts.total = this.getTotal();
@@ -2037,7 +1926,7 @@
2037
1926
  return noop;
2038
1927
  }
2039
1928
  };
2040
- _defineProperty(Log, "VERSION", VERSION);
1929
+ Log.VERSION = VERSION;
2041
1930
  function normalizeLogLevel(logLevel) {
2042
1931
  if (!logLevel) {
2043
1932
  return 0;
@@ -2057,10 +1946,7 @@
2057
1946
  return resolvedLevel;
2058
1947
  }
2059
1948
  function normalizeArguments(opts) {
2060
- const {
2061
- logLevel,
2062
- message
2063
- } = opts;
1949
+ const { logLevel, message } = opts;
2064
1950
  opts.logLevel = normalizeLogLevel(logLevel);
2065
1951
  const args = opts.args ? Array.from(opts.args) : [];
2066
1952
  while (args.length && args.shift() !== message) {
@@ -2083,55 +1969,16 @@
2083
1969
  }
2084
1970
  const messageType = typeof opts.message;
2085
1971
  assert(messageType === "string" || messageType === "object");
2086
- return Object.assign(opts, {
2087
- args
2088
- }, opts.opts);
1972
+ return Object.assign(opts, { args }, opts.opts);
2089
1973
  }
2090
1974
  function decorateMessage(id, message, opts) {
2091
1975
  if (typeof message === "string") {
2092
1976
  const time = opts.time ? leftPad(formatTime(opts.total)) : "";
2093
- message = opts.time ? "".concat(id, ": ").concat(time, " ").concat(message) : "".concat(id, ": ").concat(message);
1977
+ message = opts.time ? `${id}: ${time} ${message}` : `${id}: ${message}`;
2094
1978
  message = addColor(message, opts.color, opts.background);
2095
1979
  }
2096
1980
  return message;
2097
1981
  }
2098
- function logImageInNode(_ref2) {
2099
- let {
2100
- image,
2101
- message = "",
2102
- scale = 1
2103
- } = _ref2;
2104
- console.warn("removed");
2105
- return noop;
2106
- }
2107
- function logImageInBrowser(_ref3) {
2108
- let {
2109
- image,
2110
- message = "",
2111
- scale = 1
2112
- } = _ref3;
2113
- if (typeof image === "string") {
2114
- const img = new Image();
2115
- img.onload = () => {
2116
- const args = formatImage(img, message, scale);
2117
- console.log(...args);
2118
- };
2119
- img.src = image;
2120
- return noop;
2121
- }
2122
- const element = image.nodeName || "";
2123
- if (element.toLowerCase() === "img") {
2124
- console.log(...formatImage(image, message, scale));
2125
- return noop;
2126
- }
2127
- if (element.toLowerCase() === "canvas") {
2128
- const img = new Image();
2129
- img.onload = () => console.log(...formatImage(img, message, scale));
2130
- img.src = image.toDataURL();
2131
- return noop;
2132
- }
2133
- return noop;
2134
- }
2135
1982
  function getTableHeader(table) {
2136
1983
  for (const key in table) {
2137
1984
  for (const title in table[key]) {
@@ -2141,13 +1988,14 @@
2141
1988
  return "empty";
2142
1989
  }
2143
1990
 
1991
+ // ../../node_modules/@probe.gl/log/dist/init.js
1992
+ globalThis.probe = {};
1993
+
2144
1994
  // ../../node_modules/@probe.gl/log/dist/index.js
2145
- var dist_default = new Log({
2146
- id: "@probe.gl/log"
2147
- });
1995
+ var dist_default = new Log({ id: "@probe.gl/log" });
2148
1996
 
2149
1997
  // ../loader-utils/src/lib/log-utils/log.ts
2150
- var VERSION2 = true ? "4.3.0-alpha.6" : "latest";
1998
+ var VERSION2 = true ? "4.3.0-alpha.8" : "latest";
2151
1999
  var version = VERSION2[0] >= "0" && VERSION2[0] <= "9" ? `v${VERSION2}` : "";
2152
2000
  function createLog() {
2153
2001
  const log2 = new Log({ id: "loaders.gl" });
@@ -3019,7 +2867,7 @@
3019
2867
  }
3020
2868
 
3021
2869
  // src/mvt-loader.ts
3022
- var VERSION3 = true ? "4.3.0-alpha.6" : "latest";
2870
+ var VERSION3 = true ? "4.3.0-alpha.8" : "latest";
3023
2871
  var MVTWorkerLoader = {
3024
2872
  dataType: null,
3025
2873
  batchType: null,
@@ -1,5 +1,5 @@
1
- import type { VectorTileSourceProps, GetTileDataParameters, GetTileParameters, LoaderWithParser } from '@loaders.gl/loader-utils';
2
1
  import { VectorTileSource, TileSourceMetadata } from '@loaders.gl/loader-utils';
2
+ import type { VectorTileSourceProps, GetTileDataParameters, GetTileParameters, LoaderWithParser } from '@loaders.gl/loader-utils';
3
3
  import { Schema, GeoJSONTable, Feature, BinaryFeatureCollection } from '@loaders.gl/schema';
4
4
  import { Stats } from '@probe.gl/stats';
5
5
  import type { ProtoFeature } from "./lib/vector-tiler/features/proto-feature.js";
@@ -1 +1 @@
1
- {"version":3,"file":"table-tile-source.d.ts","sourceRoot":"","sources":["../src/table-tile-source.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,qBAAqB,EACrB,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAC,gBAAgB,EAAE,kBAAkB,EAAM,MAAM,0BAA0B,CAAC;AAC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AAA;KAAC,GAAG,YAAY,GAAG,IAAI;IAa9E;;;OAGG;IACH,eAAe,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI;IAuC1C;;;OAGG;IAEH,YAAY,CAAC,SAAS,EAAE;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAC,GAAG,SAAS,GAAG,IAAI;IAkD5E;;;;;;;OAOG;IAEH,SAAS,CACP,QAAQ,EAAE,YAAY,EAAE,EACxB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,EAAE,CAAC,EAAE,MAAM,EACX,EAAE,CAAC,EAAE,MAAM,EACX,EAAE,CAAC,EAAE,MAAM,GACV,IAAI;CAkHR"}
@@ -4,7 +4,7 @@
4
4
  import { parseTileJSON } from "./lib/parse-tilejson.js";
5
5
  // __VERSION__ is injected by babel-plugin-version-inline
6
6
  // @ts-ignore TS2304: Cannot find name '__VERSION__'.
7
- const VERSION = typeof "4.3.0-alpha.6" !== 'undefined' ? "4.3.0-alpha.6" : 'latest';
7
+ const VERSION = typeof "4.3.0-alpha.8" !== 'undefined' ? "4.3.0-alpha.8" : 'latest';
8
8
  /**
9
9
  * Loader for TileJSON metadata
10
10
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@loaders.gl/mvt",
3
3
  "description": "Loader for Mapbox Vector Tiles",
4
- "version": "4.3.0-alpha.7",
4
+ "version": "4.3.0-beta.1",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "publishConfig": {
@@ -44,11 +44,11 @@
44
44
  "build-worker": "esbuild src/workers/mvt-worker.ts --bundle --outfile=dist/mvt-worker.js --define:__VERSION__=\\\"$npm_package_version\\\""
45
45
  },
46
46
  "dependencies": {
47
- "@loaders.gl/gis": "4.3.0-alpha.7",
48
- "@loaders.gl/images": "4.3.0-alpha.7",
49
- "@loaders.gl/loader-utils": "4.3.0-alpha.7",
50
- "@loaders.gl/schema": "4.3.0-alpha.7",
51
- "@math.gl/polygon": "^4.0.0",
47
+ "@loaders.gl/gis": "4.3.0-beta.1",
48
+ "@loaders.gl/images": "4.3.0-beta.1",
49
+ "@loaders.gl/loader-utils": "4.3.0-beta.1",
50
+ "@loaders.gl/schema": "4.3.0-beta.1",
51
+ "@math.gl/polygon": "^4.1.0",
52
52
  "@probe.gl/stats": "^4.0.0",
53
53
  "pbf": "^3.2.1"
54
54
  },
@@ -58,5 +58,5 @@
58
58
  "peerDependencies": {
59
59
  "@loaders.gl/core": "^4.0.0"
60
60
  },
61
- "gitHead": "73fb27872d89f3804dca37ebd568c6ba9609a98f"
61
+ "gitHead": "992d24e7d4e3015a91fa1cbfe87ee7dc1b333322"
62
62
  }