@mapvx/web-components 0.0.20 → 0.0.21
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/cjs/back_arrow-DNrh84z6.cjs +2 -0
- package/dist/cjs/class-map-DsgSsfJZ.cjs +12 -0
- package/dist/cjs/{consume-CE1TVLg-.cjs → consume-BqcKIzaR.cjs} +2 -2
- package/dist/cjs/custom-map-d_XJ3r-x.cjs +8 -0
- package/dist/cjs/floor-selector-Bs-_2vdJ.cjs +15 -0
- package/dist/cjs/{lazy-load-DHtTuPrp.cjs → lazy-load-jYim30I-.cjs} +2 -2
- package/dist/cjs/map-view-with-modal.cjs +10 -3
- package/dist/cjs/maplibre-gl-BNL6ASmq.cjs +2 -0
- package/dist/cjs/qr-modal-C0-FMRdg.cjs +16 -0
- package/dist/cjs/{route-options-H5wyZZ4h.cjs → route-options-IY7Qxb9z.cjs} +3 -3
- package/dist/cjs/route-view-totems.cjs +7 -6
- package/dist/es/assets/back_arrow-B4vxoqtW.js +4 -0
- package/dist/es/assets/{components-y75xh-dL.js → components-BX-NvkMO.js} +39 -18
- package/dist/es/assets/{map-view-with-modal-B5Mk49H1.js → map-view-with-modal-Dpg6IjBv.js} +12 -4
- package/dist/es/assets/maplibre-gl-BKzNcqp_.js +4 -0
- package/dist/es/assets/{route-view-totems-C8X6pCW7.js → route-view-totems-DXCPYztz.js} +17 -18
- package/dist/es/assets/{utils-C2SiQIHC.js → utils-FyhZTuD9.js} +340 -40
- package/dist/es/index.js +2 -2
- package/dist/es/route-view-totems.js +2 -2
- package/dist/iife/map-view-with-modal.js +14 -7
- package/dist/iife/route-view-totems.js +13 -12
- package/package.json +8 -7
- package/dist/cjs/back_arrow-Cb1GjmUe.cjs +0 -2
- package/dist/cjs/custom-map-C_Cpnb0N.cjs +0 -8
- package/dist/cjs/floor-selector-D6YcNzdw.cjs +0 -20
- package/dist/cjs/maplibre-gl-P-Xd6Hdn.cjs +0 -2
- package/dist/cjs/qr-modal-CkWqbgpG.cjs +0 -16
- package/dist/es/assets/back_arrow-CUOAm8Zc.js +0 -4
- package/dist/es/assets/maplibre-gl-KgJ_zm92.js +0 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i, s as sdkContext } from './components-
|
|
2
|
-
import { R as RollbarController } from './route-view-totems-
|
|
1
|
+
import { i, s as sdkContext } from './components-BX-NvkMO.js';
|
|
2
|
+
import { R as RollbarController } from './route-view-totems-DXCPYztz.js';
|
|
3
3
|
|
|
4
4
|
var dist = {exports: {}};
|
|
5
5
|
|
|
@@ -5696,10 +5696,12 @@ function requireDist () {
|
|
|
5696
5696
|
CssElement: () => (/* reexport */ cssCustomization_namespaceObject.CssElement),
|
|
5697
5697
|
CssScreen: () => (/* reexport */ cssCustomization_namespaceObject.CssScreen),
|
|
5698
5698
|
CssTheme: () => (/* reexport */ cssCustomization_namespaceObject.CssTheme),
|
|
5699
|
+
DaysOfTheWeek: () => (/* reexport */ openingHours_namespaceObject.DaysOfTheWeek),
|
|
5699
5700
|
DrawRouteConfiguration: () => (/* reexport */ routeConfiguration_namespaceObject.DrawRouteConfiguration),
|
|
5700
5701
|
FitOptions: () => (/* reexport */ fitOptions_namespaceObject.FitOptions),
|
|
5701
5702
|
GetRouteConfiguration: () => (/* reexport */ routeConfiguration_namespaceObject.GetRouteConfiguration),
|
|
5702
5703
|
GradientStyle: () => (/* reexport */ routeStyle_namespaceObject.GradientStyle),
|
|
5704
|
+
HealthResponse: () => (/* reexport */ healthResponse_namespaceObject.HealthResponse),
|
|
5703
5705
|
IdLocation: () => (/* reexport */ routeConfiguration_namespaceObject.IdLocation),
|
|
5704
5706
|
InnerFloor: () => (/* reexport */ innerFloors_namespaceObject.InnerFloor),
|
|
5705
5707
|
Institution: () => (/* reexport */ Institution),
|
|
@@ -5719,21 +5721,29 @@ function requireDist () {
|
|
|
5719
5721
|
MultiLanguage: () => (/* reexport */ multilanguage_namespaceObject.MultiLanguage),
|
|
5720
5722
|
NestedCategory: () => (/* reexport */ categories_namespaceObject.NestedCategory),
|
|
5721
5723
|
OpeningHours: () => (/* reexport */ openingHours_namespaceObject.OpeningHours),
|
|
5724
|
+
OpeningTime: () => (/* reexport */ openingHours_namespaceObject.OpeningTime),
|
|
5722
5725
|
PhoneCategory: () => (/* reexport */ categories_namespaceObject.PhoneCategory),
|
|
5723
5726
|
PlaceCategory: () => (/* reexport */ categories_namespaceObject.PlaceCategory),
|
|
5724
5727
|
ProductCategory: () => (/* reexport */ categories_namespaceObject.ProductCategory),
|
|
5725
5728
|
Property: () => (/* reexport */ property_namespaceObject.Property),
|
|
5729
|
+
RealtimeSchedule: () => (/* reexport */ transport_namespaceObject.RealtimeSchedule),
|
|
5726
5730
|
RouteLocation: () => (/* reexport */ routeConfiguration_namespaceObject.RouteLocation),
|
|
5727
5731
|
RouteStyle: () => (/* reexport */ routeStyle_namespaceObject.RouteStyle),
|
|
5732
|
+
Schedule: () => (/* reexport */ transport_namespaceObject.Schedule),
|
|
5728
5733
|
SolidStyle: () => (/* reexport */ routeStyle_namespaceObject.SolidStyle),
|
|
5729
5734
|
TextCategory: () => (/* reexport */ categories_namespaceObject.TextCategory),
|
|
5730
5735
|
TextPosition: () => (/* reexport */ TextPosition),
|
|
5731
5736
|
UrlCategory: () => (/* reexport */ categories_namespaceObject.UrlCategory),
|
|
5732
5737
|
initializeSDK: () => (/* reexport */ initializeSDK),
|
|
5733
5738
|
isBasicWithIcon: () => (/* reexport */ isBasicWithIcon),
|
|
5734
|
-
isBasicWithLogo: () => (/* reexport */ isBasicWithLogo)
|
|
5739
|
+
isBasicWithLogo: () => (/* reexport */ isBasicWithLogo),
|
|
5740
|
+
loadCustomization: () => (/* reexport */ loadCustomization)
|
|
5735
5741
|
});
|
|
5736
5742
|
|
|
5743
|
+
// NAMESPACE OBJECT: ./src/interfaces/healthResponse.ts
|
|
5744
|
+
var healthResponse_namespaceObject = {};
|
|
5745
|
+
__webpack_require__.r(healthResponse_namespaceObject);
|
|
5746
|
+
|
|
5737
5747
|
// NAMESPACE OBJECT: ./src/models/marker.ts
|
|
5738
5748
|
var marker_namespaceObject = {};
|
|
5739
5749
|
__webpack_require__.r(marker_namespaceObject);
|
|
@@ -5766,6 +5776,13 @@ function requireDist () {
|
|
|
5766
5776
|
n: () => (PropertyUtils)
|
|
5767
5777
|
});
|
|
5768
5778
|
|
|
5779
|
+
// NAMESPACE OBJECT: ./src/models/transport.ts
|
|
5780
|
+
var transport_namespaceObject = {};
|
|
5781
|
+
__webpack_require__.r(transport_namespaceObject);
|
|
5782
|
+
__webpack_require__.d(transport_namespaceObject, {
|
|
5783
|
+
Q: () => (LzTransport)
|
|
5784
|
+
});
|
|
5785
|
+
|
|
5769
5786
|
// NAMESPACE OBJECT: ./src/map/map.ts
|
|
5770
5787
|
var map_namespaceObject = {};
|
|
5771
5788
|
__webpack_require__.r(map_namespaceObject);
|
|
@@ -7351,7 +7368,7 @@ function requireDist () {
|
|
|
7351
7368
|
countly_default().init({
|
|
7352
7369
|
app_key: logger_countly.apiKey,
|
|
7353
7370
|
url: logger_countly.url,
|
|
7354
|
-
app_version: "2.
|
|
7371
|
+
app_version: "2.19.0-beta.2",
|
|
7355
7372
|
session_update: 10,
|
|
7356
7373
|
debug: false,
|
|
7357
7374
|
require_consent: false,
|
|
@@ -7947,6 +7964,10 @@ function requireDist () {
|
|
|
7947
7964
|
* Tags for place
|
|
7948
7965
|
*/
|
|
7949
7966
|
|
|
7967
|
+
/**
|
|
7968
|
+
* Metadata of the place.
|
|
7969
|
+
*/
|
|
7970
|
+
|
|
7950
7971
|
/**
|
|
7951
7972
|
* Creates a new place instance with the parameters specified in the data.
|
|
7952
7973
|
* @hidden
|
|
@@ -7997,6 +8018,7 @@ function requireDist () {
|
|
|
7997
8018
|
this.properties = PropertyUtils.parseProperties((_rawPlace$properties2 = rawPlace.properties) !== null && _rawPlace$properties2 !== void 0 ? _rawPlace$properties2 : []);
|
|
7998
8019
|
this.parentId = rawPlace.parent_id;
|
|
7999
8020
|
this.parentType = rawPlace.parent_type;
|
|
8021
|
+
this.metadata = rawPlace.metadata;
|
|
8000
8022
|
}
|
|
8001
8023
|
|
|
8002
8024
|
/**
|
|
@@ -8123,6 +8145,8 @@ function requireDist () {
|
|
|
8123
8145
|
}
|
|
8124
8146
|
return properties;
|
|
8125
8147
|
} catch (err) {
|
|
8148
|
+
console.log(err);
|
|
8149
|
+
console.log(response);
|
|
8126
8150
|
return [];
|
|
8127
8151
|
}
|
|
8128
8152
|
}
|
|
@@ -8279,7 +8303,7 @@ function requireDist () {
|
|
|
8279
8303
|
var Requester = /*#__PURE__*/function () {
|
|
8280
8304
|
function Requester(lang) {
|
|
8281
8305
|
requester_classCallCheck(this, Requester);
|
|
8282
|
-
requester_defineProperty(this, "baseUrl", "https://
|
|
8306
|
+
requester_defineProperty(this, "baseUrl", "https://api.mapvx.com/sdk/");
|
|
8283
8307
|
requester_defineProperty(this, "baseUrlMapVx", "https://api.mapvx.com/api/");
|
|
8284
8308
|
this.lang = lang;
|
|
8285
8309
|
}
|
|
@@ -8295,7 +8319,7 @@ function requireDist () {
|
|
|
8295
8319
|
}
|
|
8296
8320
|
|
|
8297
8321
|
/**
|
|
8298
|
-
*
|
|
8322
|
+
* Make a request using {@link fetch}.
|
|
8299
8323
|
* @param resourceUrl Path to endpoint
|
|
8300
8324
|
* @param params should have the token included plus any extra parameter that the url needs
|
|
8301
8325
|
* @param options option for fetch method
|
|
@@ -8918,24 +8942,61 @@ function requireDist () {
|
|
|
8918
8942
|
}
|
|
8919
8943
|
return fetchCssCustomization;
|
|
8920
8944
|
}()
|
|
8945
|
+
}, {
|
|
8946
|
+
key: "postHealth",
|
|
8947
|
+
value: function () {
|
|
8948
|
+
var _postHealth = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee16(token, healthPingId, placeId, totemId, status) {
|
|
8949
|
+
var requestData, params, options;
|
|
8950
|
+
return _regeneratorRuntime().wrap(function _callee16$(_context16) {
|
|
8951
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
8952
|
+
case 0:
|
|
8953
|
+
requestData = JSON.stringify({
|
|
8954
|
+
healthPingId: healthPingId,
|
|
8955
|
+
placeId: placeId,
|
|
8956
|
+
totemId: totemId,
|
|
8957
|
+
status: status
|
|
8958
|
+
});
|
|
8959
|
+
params = {
|
|
8960
|
+
token: token
|
|
8961
|
+
};
|
|
8962
|
+
options = {
|
|
8963
|
+
method: "POST",
|
|
8964
|
+
headers: {
|
|
8965
|
+
accept: "application/json",
|
|
8966
|
+
"Content-Type": "application/json"
|
|
8967
|
+
},
|
|
8968
|
+
body: requestData
|
|
8969
|
+
};
|
|
8970
|
+
return _context16.abrupt("return", Requester.fetchFromUrl(this.baseUrlMapVx + "health", params, options));
|
|
8971
|
+
case 4:
|
|
8972
|
+
case "end":
|
|
8973
|
+
return _context16.stop();
|
|
8974
|
+
}
|
|
8975
|
+
}, _callee16, this);
|
|
8976
|
+
}));
|
|
8977
|
+
function postHealth(_x36, _x37, _x38, _x39, _x40) {
|
|
8978
|
+
return _postHealth.apply(this, arguments);
|
|
8979
|
+
}
|
|
8980
|
+
return postHealth;
|
|
8981
|
+
}()
|
|
8921
8982
|
}], [{
|
|
8922
8983
|
key: "fetchFromUrl",
|
|
8923
8984
|
value: (function () {
|
|
8924
|
-
var _fetchFromUrl = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
8985
|
+
var _fetchFromUrl = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee17(resourceUrl, params, options) {
|
|
8925
8986
|
var finalUrl;
|
|
8926
|
-
return _regeneratorRuntime().wrap(function
|
|
8927
|
-
while (1) switch (
|
|
8987
|
+
return _regeneratorRuntime().wrap(function _callee17$(_context17) {
|
|
8988
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
8928
8989
|
case 0:
|
|
8929
8990
|
finalUrl = new URL(resourceUrl);
|
|
8930
8991
|
finalUrl.search = new URLSearchParams(params).toString();
|
|
8931
|
-
return
|
|
8992
|
+
return _context17.abrupt("return", fetch(finalUrl.toString(), options));
|
|
8932
8993
|
case 3:
|
|
8933
8994
|
case "end":
|
|
8934
|
-
return
|
|
8995
|
+
return _context17.stop();
|
|
8935
8996
|
}
|
|
8936
|
-
},
|
|
8997
|
+
}, _callee17);
|
|
8937
8998
|
}));
|
|
8938
|
-
function fetchFromUrl(
|
|
8999
|
+
function fetchFromUrl(_x41, _x42, _x43) {
|
|
8939
9000
|
return _fetchFromUrl.apply(this, arguments);
|
|
8940
9001
|
}
|
|
8941
9002
|
return fetchFromUrl;
|
|
@@ -9331,7 +9392,7 @@ function requireDist () {
|
|
|
9331
9392
|
Error.captureStackTrace(error);
|
|
9332
9393
|
}
|
|
9333
9394
|
_this4.logWarning(error, {
|
|
9334
|
-
functionName: "
|
|
9395
|
+
functionName: "getCachedPlaces",
|
|
9335
9396
|
id: id
|
|
9336
9397
|
});
|
|
9337
9398
|
}
|
|
@@ -9947,6 +10008,44 @@ function requireDist () {
|
|
|
9947
10008
|
}
|
|
9948
10009
|
return fetchAndParseCssCustomization;
|
|
9949
10010
|
}()
|
|
10011
|
+
}, {
|
|
10012
|
+
key: "postAndParseHealthPing",
|
|
10013
|
+
value: function () {
|
|
10014
|
+
var _postAndParseHealthPing = repository_asyncToGenerator(/*#__PURE__*/repository_regeneratorRuntime().mark(function _callee16(healthPingId, placeId, totemId, status) {
|
|
10015
|
+
var response, responseData, data;
|
|
10016
|
+
return repository_regeneratorRuntime().wrap(function _callee16$(_context16) {
|
|
10017
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
10018
|
+
case 0:
|
|
10019
|
+
_context16.next = 2;
|
|
10020
|
+
return this.requester.postHealth(this.token, healthPingId, placeId, totemId, status);
|
|
10021
|
+
case 2:
|
|
10022
|
+
response = _context16.sent;
|
|
10023
|
+
if (response.ok) {
|
|
10024
|
+
_context16.next = 8;
|
|
10025
|
+
break;
|
|
10026
|
+
}
|
|
10027
|
+
_context16.next = 6;
|
|
10028
|
+
return response.json();
|
|
10029
|
+
case 6:
|
|
10030
|
+
responseData = _context16.sent;
|
|
10031
|
+
throw new Error("Post failed with status ".concat(response.status, ": ").concat(responseData));
|
|
10032
|
+
case 8:
|
|
10033
|
+
_context16.next = 10;
|
|
10034
|
+
return response.json();
|
|
10035
|
+
case 10:
|
|
10036
|
+
data = _context16.sent;
|
|
10037
|
+
return _context16.abrupt("return", data);
|
|
10038
|
+
case 12:
|
|
10039
|
+
case "end":
|
|
10040
|
+
return _context16.stop();
|
|
10041
|
+
}
|
|
10042
|
+
}, _callee16, this);
|
|
10043
|
+
}));
|
|
10044
|
+
function postAndParseHealthPing(_x21, _x22, _x23, _x24) {
|
|
10045
|
+
return _postAndParseHealthPing.apply(this, arguments);
|
|
10046
|
+
}
|
|
10047
|
+
return postAndParseHealthPing;
|
|
10048
|
+
}()
|
|
9950
10049
|
}]);
|
|
9951
10050
|
}(Loggeable);
|
|
9952
10051
|
function map_typeof(o) { "@babel/helpers - typeof"; return map_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, map_typeof(o); }
|
|
@@ -10424,6 +10523,22 @@ function requireDist () {
|
|
|
10424
10523
|
throw new Error("Failed to remove marker");
|
|
10425
10524
|
}
|
|
10426
10525
|
}
|
|
10526
|
+
}, {
|
|
10527
|
+
key: "removeAllMarkers",
|
|
10528
|
+
value: function removeAllMarkers() {
|
|
10529
|
+
try {
|
|
10530
|
+
this.markers.forEach(function (marker) {
|
|
10531
|
+
marker.remove();
|
|
10532
|
+
});
|
|
10533
|
+
this.markers = [];
|
|
10534
|
+
this.logEvent("removeAllMarkers");
|
|
10535
|
+
} catch (error) {
|
|
10536
|
+
this.logWarning(error, {
|
|
10537
|
+
functionName: "removeAllMarkers"
|
|
10538
|
+
});
|
|
10539
|
+
throw new Error("Failed to remove all markers");
|
|
10540
|
+
}
|
|
10541
|
+
}
|
|
10427
10542
|
|
|
10428
10543
|
/**
|
|
10429
10544
|
* Use it to change the current layer
|
|
@@ -12040,6 +12155,38 @@ function requireDist () {
|
|
|
12040
12155
|
}
|
|
12041
12156
|
return getCssCustomization;
|
|
12042
12157
|
}()
|
|
12158
|
+
}, {
|
|
12159
|
+
key: "notifyHealth",
|
|
12160
|
+
value: function () {
|
|
12161
|
+
var _notifyHealth = sdk_asyncToGenerator(/*#__PURE__*/sdk_regeneratorRuntime().mark(function _callee14(healthPingId, placeId, totemId, status) {
|
|
12162
|
+
var health;
|
|
12163
|
+
return sdk_regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
12164
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
12165
|
+
case 0:
|
|
12166
|
+
_context14.prev = 0;
|
|
12167
|
+
_context14.next = 3;
|
|
12168
|
+
return this.repository.postAndParseHealthPing(healthPingId, placeId, totemId, status);
|
|
12169
|
+
case 3:
|
|
12170
|
+
health = _context14.sent;
|
|
12171
|
+
return _context14.abrupt("return", health);
|
|
12172
|
+
case 7:
|
|
12173
|
+
_context14.prev = 7;
|
|
12174
|
+
_context14.t0 = _context14["catch"](0);
|
|
12175
|
+
this.logWarning(_context14.t0, {
|
|
12176
|
+
functionName: "notifyHealth"
|
|
12177
|
+
});
|
|
12178
|
+
throw new Error("Failed to notify health");
|
|
12179
|
+
case 11:
|
|
12180
|
+
case "end":
|
|
12181
|
+
return _context14.stop();
|
|
12182
|
+
}
|
|
12183
|
+
}, _callee14, this, [[0, 7]]);
|
|
12184
|
+
}));
|
|
12185
|
+
function notifyHealth(_x19, _x20, _x21, _x22) {
|
|
12186
|
+
return _notifyHealth.apply(this, arguments);
|
|
12187
|
+
}
|
|
12188
|
+
return notifyHealth;
|
|
12189
|
+
}()
|
|
12043
12190
|
}], [{
|
|
12044
12191
|
key: "getLang",
|
|
12045
12192
|
value: function getLang() {
|
|
@@ -12047,6 +12194,113 @@ function requireDist () {
|
|
|
12047
12194
|
}
|
|
12048
12195
|
}]);
|
|
12049
12196
|
}(Loggeable);
|
|
12197
|
+
function update_css_slicedToArray(r, e) { return update_css_arrayWithHoles(r) || update_css_iterableToArrayLimit(r, e) || update_css_unsupportedIterableToArray(r, e) || update_css_nonIterableRest(); }
|
|
12198
|
+
function update_css_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
12199
|
+
function update_css_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return update_css_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? update_css_arrayLikeToArray(r, a) : void 0; } }
|
|
12200
|
+
function update_css_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
12201
|
+
function update_css_iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = true, o = false; try { if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = true, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12202
|
+
function update_css_arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
12203
|
+
/**
|
|
12204
|
+
* Load a CSS customization of a project.
|
|
12205
|
+
*
|
|
12206
|
+
* This function create a new HTML Style Element and add it to the current document.
|
|
12207
|
+
* Also activate the customization adding the first theme name to the body of the document.
|
|
12208
|
+
*
|
|
12209
|
+
* @param data The CSS customization data.
|
|
12210
|
+
*/
|
|
12211
|
+
function loadCustomization(data) {
|
|
12212
|
+
var style = document.createElement("style");
|
|
12213
|
+
style.textContent = "";
|
|
12214
|
+
for (var _i = 0, _Object$entries = Object.entries(data); _i < _Object$entries.length; _i++) {
|
|
12215
|
+
var _Object$entries$_i = update_css_slicedToArray(_Object$entries[_i], 2),
|
|
12216
|
+
themeName = _Object$entries$_i[0],
|
|
12217
|
+
themeData = _Object$entries$_i[1];
|
|
12218
|
+
var cssClass = loadTheme(themeName, themeData);
|
|
12219
|
+
style.textContent += cssClass;
|
|
12220
|
+
}
|
|
12221
|
+
document.head.appendChild(style);
|
|
12222
|
+
var firstThemeName = Object.keys(data).at(0);
|
|
12223
|
+
if (firstThemeName != null) {
|
|
12224
|
+
document.body.classList.add(firstThemeName);
|
|
12225
|
+
}
|
|
12226
|
+
}
|
|
12227
|
+
|
|
12228
|
+
/**
|
|
12229
|
+
* Process a theme.
|
|
12230
|
+
*
|
|
12231
|
+
* @param themeName The name of the Theme.
|
|
12232
|
+
* @param themeData The data of the Theme.
|
|
12233
|
+
* @returns A string with the processed theme to use on a CSS file.
|
|
12234
|
+
*/
|
|
12235
|
+
function loadTheme(themeName, themeData) {
|
|
12236
|
+
var cssClass = ".".concat(themeName, " {\n");
|
|
12237
|
+
var definitions = themeData.definitions;
|
|
12238
|
+
if (definitions != null) {
|
|
12239
|
+
cssClass = loadDefinitions(definitions, cssClass);
|
|
12240
|
+
}
|
|
12241
|
+
for (var _i2 = 0, _Object$entries2 = Object.entries((_themeData$screens = themeData.screens) !== null && _themeData$screens !== void 0 ? _themeData$screens : {}); _i2 < _Object$entries2.length; _i2++) {
|
|
12242
|
+
var _themeData$screens;
|
|
12243
|
+
var _Object$entries2$_i = update_css_slicedToArray(_Object$entries2[_i2], 2),
|
|
12244
|
+
screenName = _Object$entries2$_i[0],
|
|
12245
|
+
screenData = _Object$entries2$_i[1];
|
|
12246
|
+
for (var _i3 = 0, _Object$entries3 = Object.entries(screenData); _i3 < _Object$entries3.length; _i3++) {
|
|
12247
|
+
var _Object$entries3$_i = update_css_slicedToArray(_Object$entries3[_i3], 2),
|
|
12248
|
+
componentName = _Object$entries3$_i[0],
|
|
12249
|
+
componentData = _Object$entries3$_i[1];
|
|
12250
|
+
for (var _i4 = 0, _Object$entries4 = Object.entries(componentData); _i4 < _Object$entries4.length; _i4++) {
|
|
12251
|
+
var _Object$entries4$_i = update_css_slicedToArray(_Object$entries4[_i4], 2),
|
|
12252
|
+
elementName = _Object$entries4$_i[0],
|
|
12253
|
+
elementData = _Object$entries4$_i[1];
|
|
12254
|
+
for (var _i5 = 0, _Object$entries5 = Object.entries(elementData); _i5 < _Object$entries5.length; _i5++) {
|
|
12255
|
+
var _Object$entries5$_i = update_css_slicedToArray(_Object$entries5[_i5], 2),
|
|
12256
|
+
propertyName = _Object$entries5$_i[0],
|
|
12257
|
+
propertyValue = _Object$entries5$_i[1];
|
|
12258
|
+
cssClass += " --".concat(screenName, "-").concat(componentName, "-").concat(elementName, "-").concat(propertyName, ": ").concat(propertyValue, ";\n");
|
|
12259
|
+
}
|
|
12260
|
+
}
|
|
12261
|
+
}
|
|
12262
|
+
}
|
|
12263
|
+
cssClass += "}\n";
|
|
12264
|
+
return cssClass;
|
|
12265
|
+
}
|
|
12266
|
+
/**
|
|
12267
|
+
* Process the definitions of a theme.
|
|
12268
|
+
*
|
|
12269
|
+
* @param definitions The definitions of the theme.
|
|
12270
|
+
* @param cssClass The string object that will contain the processed theme
|
|
12271
|
+
* @returns The cssClass string mutated with the processed definitions.
|
|
12272
|
+
*/
|
|
12273
|
+
function loadDefinitions(definitions, cssClass) {
|
|
12274
|
+
for (var _i6 = 0, _Object$entries6 = Object.entries((_definitions$colors = definitions.colors) !== null && _definitions$colors !== void 0 ? _definitions$colors : {}); _i6 < _Object$entries6.length; _i6++) {
|
|
12275
|
+
var _definitions$colors;
|
|
12276
|
+
var _Object$entries6$_i = update_css_slicedToArray(_Object$entries6[_i6], 2),
|
|
12277
|
+
colorName = _Object$entries6$_i[0],
|
|
12278
|
+
colorData = _Object$entries6$_i[1];
|
|
12279
|
+
for (var _i7 = 0, _Object$entries7 = Object.entries(colorData); _i7 < _Object$entries7.length; _i7++) {
|
|
12280
|
+
var _Object$entries7$_i = update_css_slicedToArray(_Object$entries7[_i7], 2),
|
|
12281
|
+
colorIntensity = _Object$entries7$_i[0],
|
|
12282
|
+
colorValue = _Object$entries7$_i[1];
|
|
12283
|
+
cssClass += " --definitions-colors-".concat(colorName, "-").concat(colorIntensity, ": ").concat(colorValue, ";\n");
|
|
12284
|
+
}
|
|
12285
|
+
}
|
|
12286
|
+
for (var _i8 = 0, _Object$entries8 = Object.entries((_definitions$shadows = definitions.shadows) !== null && _definitions$shadows !== void 0 ? _definitions$shadows : {}); _i8 < _Object$entries8.length; _i8++) {
|
|
12287
|
+
var _definitions$shadows;
|
|
12288
|
+
var _Object$entries8$_i = update_css_slicedToArray(_Object$entries8[_i8], 2),
|
|
12289
|
+
shadowName = _Object$entries8$_i[0],
|
|
12290
|
+
shadowValue = _Object$entries8$_i[1];
|
|
12291
|
+
cssClass += " --definitions-shadows-".concat(shadowName, ": ").concat(shadowValue, ";\n");
|
|
12292
|
+
}
|
|
12293
|
+
for (var _i9 = 0, _Object$entries9 = Object.entries((_definitions$textFont = definitions.textFonts) !== null && _definitions$textFont !== void 0 ? _definitions$textFont : {}); _i9 < _Object$entries9.length; _i9++) {
|
|
12294
|
+
var _definitions$textFont;
|
|
12295
|
+
var _Object$entries9$_i = update_css_slicedToArray(_Object$entries9[_i9], 2),
|
|
12296
|
+
fontName = _Object$entries9$_i[0],
|
|
12297
|
+
fontValue = _Object$entries9$_i[1];
|
|
12298
|
+
cssClass += " --definitions-textFonts-".concat(fontName, ": ").concat(fontValue, ";\n");
|
|
12299
|
+
}
|
|
12300
|
+
return cssClass;
|
|
12301
|
+
}
|
|
12302
|
+
|
|
12303
|
+
|
|
12050
12304
|
|
|
12051
12305
|
|
|
12052
12306
|
|
|
@@ -12099,7 +12353,7 @@ class SDKController {
|
|
|
12099
12353
|
this.host.addController(this);
|
|
12100
12354
|
this.contextProvider = new i(this.host, {
|
|
12101
12355
|
context: sdkContext,
|
|
12102
|
-
initialValue: { enabledFloors: [], markers: [] }
|
|
12356
|
+
initialValue: { enabledFloors: [], markers: [], cameraInitialized: false }
|
|
12103
12357
|
});
|
|
12104
12358
|
}
|
|
12105
12359
|
initialize(apiKey, locale, parentPlaceId) {
|
|
@@ -12180,7 +12434,8 @@ class SDKController {
|
|
|
12180
12434
|
this.contextProvider.setValue({
|
|
12181
12435
|
...this.contextProvider.value,
|
|
12182
12436
|
route,
|
|
12183
|
-
enabledFloors
|
|
12437
|
+
enabledFloors,
|
|
12438
|
+
isRouteAnimating: false
|
|
12184
12439
|
});
|
|
12185
12440
|
} catch (error) {
|
|
12186
12441
|
RollbarController.getInstance().warning("Error loading route", { error, originId, destinationId });
|
|
@@ -12314,6 +12569,28 @@ class SDKController {
|
|
|
12314
12569
|
mapReady: ready
|
|
12315
12570
|
});
|
|
12316
12571
|
}
|
|
12572
|
+
setCameraInitialized(initialized) {
|
|
12573
|
+
this.contextProvider.setValue({
|
|
12574
|
+
...this.contextProvider.value,
|
|
12575
|
+
cameraInitialized: initialized
|
|
12576
|
+
});
|
|
12577
|
+
}
|
|
12578
|
+
resetData() {
|
|
12579
|
+
this.contextProvider.setValue({
|
|
12580
|
+
...this.contextProvider.value,
|
|
12581
|
+
originId: void 0,
|
|
12582
|
+
destinationId: void 0,
|
|
12583
|
+
destination: void 0,
|
|
12584
|
+
route: void 0,
|
|
12585
|
+
enabledFloors: this.enabledFloors,
|
|
12586
|
+
currentFloor: this.contextProvider.value.parentPlace?.innerFloors?.[0],
|
|
12587
|
+
markers: [],
|
|
12588
|
+
accessibleRoute: false,
|
|
12589
|
+
isRouteAnimating: false,
|
|
12590
|
+
cameraInitialized: false
|
|
12591
|
+
});
|
|
12592
|
+
this.host.requestUpdate();
|
|
12593
|
+
}
|
|
12317
12594
|
}
|
|
12318
12595
|
|
|
12319
12596
|
const popupCSS = "@keyframes fadeIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}.popup{background:#fff;filter:drop-shadow(0 1px 4px rgba(0,0,0,.2));padding:15px;border-radius:10px;border:1px solid #cccccc;min-width:180px;position:relative;transform:translateY(-50%)}.popup:after{content:\"\";position:absolute;bottom:-10px;left:50%;transform:translate(-50%);width:0;height:0;border-left:10px solid transparent;border-right:10px solid transparent;border-top:10px solid white;z-index:1}.popup:before{content:\"\";position:absolute;bottom:-11px;left:50%;transform:translate(-50%);width:0;height:0;border-left:11px solid transparent;border-right:11px solid transparent;border-top:11px solid #cccccc;z-index:0}.popup-content{display:flex;flex-direction:column;gap:4px}.popup-logo{width:100%;object-fit:contain;object-position:center;height:60px;overflow:hidden;align-self:center;max-width:100%}.popup-name{position:relative;color:#000;text-align:center;letter-spacing:-1.1719905853px;margin-top:10px;max-width:250px;font:700 23px/23px Poppins,-apple-system,Roboto,Helvetica,sans-serif}.popup-category{color:#555;position:relative;color:#000;text-align:center;letter-spacing:-.5859952927px;white-space:nowrap;margin:5px 0 20px;font:400 12px/14px Poppins,-apple-system,Roboto,Helvetica,sans-serif}@media (max-width: 991px){.popup-category{margin-bottom:40px;white-space:initial}}";
|
|
@@ -12398,7 +12675,6 @@ class MarkerController {
|
|
|
12398
12675
|
floorId = content.floorId;
|
|
12399
12676
|
if (data instanceof distExports.LzPlace) {
|
|
12400
12677
|
content.name = data.title;
|
|
12401
|
-
content.category = data.localizedCategory ?? "";
|
|
12402
12678
|
const service_tags = [
|
|
12403
12679
|
"baños-general",
|
|
12404
12680
|
"baño-accesible",
|
|
@@ -12427,6 +12703,20 @@ class MarkerController {
|
|
|
12427
12703
|
} else {
|
|
12428
12704
|
content.logo = data.logo?.light ?? "";
|
|
12429
12705
|
}
|
|
12706
|
+
if (data.metadata?.category && data.metadata?.category?.length > 0) {
|
|
12707
|
+
let categories = [];
|
|
12708
|
+
data.metadata?.category?.forEach((category) => {
|
|
12709
|
+
const name = category;
|
|
12710
|
+
if (!categories.map((c) => c.toLocaleLowerCase()).includes(name.toLocaleLowerCase())) {
|
|
12711
|
+
categories.push(name);
|
|
12712
|
+
}
|
|
12713
|
+
});
|
|
12714
|
+
content.category = categories.join(", ");
|
|
12715
|
+
} else if (service && data.localizedCategory && data.category !== "1abcdefc29a36339150cf670") {
|
|
12716
|
+
content.category = data.localizedCategory;
|
|
12717
|
+
} else {
|
|
12718
|
+
content.category = "";
|
|
12719
|
+
}
|
|
12430
12720
|
content.position = data.position;
|
|
12431
12721
|
floorId = data.inFloor(floors)?.key;
|
|
12432
12722
|
}
|
|
@@ -12457,7 +12747,7 @@ class MarkerController {
|
|
|
12457
12747
|
});
|
|
12458
12748
|
this.map?.setPlacesAsSelected(
|
|
12459
12749
|
this.markersIds.map((m) => m.id),
|
|
12460
|
-
"#
|
|
12750
|
+
"#3146bc"
|
|
12461
12751
|
);
|
|
12462
12752
|
const currentFloor = this.map?.getCurrentFloor();
|
|
12463
12753
|
const coordinates = this.markersIds.filter((m) => m.floorId === currentFloor).map((m) => m.coordinate);
|
|
@@ -12509,9 +12799,8 @@ class RouteAnimationController {
|
|
|
12509
12799
|
this.lzMap = map;
|
|
12510
12800
|
}
|
|
12511
12801
|
setCurrentFloor(floorId) {
|
|
12512
|
-
this._currentMapFloor = floorId;
|
|
12513
12802
|
const coordinates = this.route?.legs.flatMap(
|
|
12514
|
-
(leg) => leg.steps.filter((step) => step.startInsideFloor === floorId).flatMap((step) => step.coordinates)
|
|
12803
|
+
(leg) => leg.steps.filter((step) => step.startInsideFloor === floorId || step.endInsideFloor === floorId).flatMap((step) => step.coordinates)
|
|
12515
12804
|
) ?? [];
|
|
12516
12805
|
if (coordinates.length > 0) {
|
|
12517
12806
|
this.lzMap?.fitCoordinates(coordinates, {
|
|
@@ -12523,6 +12812,7 @@ class RouteAnimationController {
|
|
|
12523
12812
|
}
|
|
12524
12813
|
});
|
|
12525
12814
|
}
|
|
12815
|
+
this.handlers.onFloorChange(floorId);
|
|
12526
12816
|
}
|
|
12527
12817
|
setParentPlace(place) {
|
|
12528
12818
|
this.parentPlace = place;
|
|
@@ -12533,26 +12823,27 @@ class RouteAnimationController {
|
|
|
12533
12823
|
startRouteAnimation(route) {
|
|
12534
12824
|
if (!this.connected || !this.lzMap || this.isAnimatingRoute) return;
|
|
12535
12825
|
this.isAnimatingRoute = true;
|
|
12826
|
+
this.stepAnimationDate = /* @__PURE__ */ new Date();
|
|
12536
12827
|
const animationConfig = {
|
|
12537
12828
|
minimumSpeed: 20,
|
|
12538
12829
|
callBack: (status) => {
|
|
12830
|
+
this.stepAnimationDate = /* @__PURE__ */ new Date();
|
|
12539
12831
|
if (status.isFinished) {
|
|
12540
12832
|
this.stopAnimatedRoute();
|
|
12541
12833
|
this.handlers.onRouteAnimationFinished();
|
|
12834
|
+
return;
|
|
12542
12835
|
}
|
|
12543
|
-
const
|
|
12544
|
-
|
|
12545
|
-
const
|
|
12546
|
-
if (this.
|
|
12547
|
-
const
|
|
12548
|
-
const currentFloor = this.parentPlace.innerFloors.find((floor) => floor.key === endFloor);
|
|
12549
|
-
this.setCurrentFloor(endFloor);
|
|
12550
|
-
this.handlers.onFloorChange(endFloor);
|
|
12836
|
+
const startFloor = status.step?.startInsideFloor;
|
|
12837
|
+
const endFloor = status.step?.endInsideFloor;
|
|
12838
|
+
const newFloor = this.parentPlace?.innerFloors.find((floor) => floor.key === endFloor);
|
|
12839
|
+
if (this.isAnimatingRoute && startFloor && endFloor && startFloor !== endFloor) {
|
|
12840
|
+
const currentFloor = this.parentPlace?.innerFloors.find((floor) => floor.key === startFloor);
|
|
12551
12841
|
this.lzMap?.pauseAnimateRoute();
|
|
12552
|
-
const
|
|
12553
|
-
const timeDiff =
|
|
12554
|
-
|
|
12555
|
-
const
|
|
12842
|
+
const currentDate = /* @__PURE__ */ new Date();
|
|
12843
|
+
const timeDiff = currentDate.getTime() - this.stepAnimationDate.getTime();
|
|
12844
|
+
this.stepAnimationDate = currentDate;
|
|
12845
|
+
const isGoingUp = !!currentFloor && !!newFloor && currentFloor.level < newFloor.level;
|
|
12846
|
+
const isElevator = status.step?.elevatorStep ?? false;
|
|
12556
12847
|
let iconPath;
|
|
12557
12848
|
if (isGoingUp) {
|
|
12558
12849
|
iconPath = isElevator ? elevatorUpIcon : stairsUpIcon;
|
|
@@ -12561,7 +12852,7 @@ class RouteAnimationController {
|
|
|
12561
12852
|
}
|
|
12562
12853
|
const modal = {
|
|
12563
12854
|
iconPath,
|
|
12564
|
-
title: this.createChangeFloorMessage(isGoingUp, isElevator,
|
|
12855
|
+
title: this.createChangeFloorMessage(isGoingUp, isElevator, newFloor?.name ?? "")
|
|
12565
12856
|
};
|
|
12566
12857
|
if (timeDiff > this.minUpdateTimeInterval) {
|
|
12567
12858
|
this.showMapModal(modal);
|
|
@@ -12591,15 +12882,20 @@ class RouteAnimationController {
|
|
|
12591
12882
|
if (firstFloor) {
|
|
12592
12883
|
this.setCurrentFloor(firstFloor);
|
|
12593
12884
|
}
|
|
12594
|
-
this.lzMap.
|
|
12885
|
+
this.lzMap.startAnimateRouteV2(route, drawingConfig, animationConfig);
|
|
12595
12886
|
this.route = route;
|
|
12596
12887
|
this.handlers.onStartRouteAnimation();
|
|
12597
12888
|
}
|
|
12598
12889
|
removeRoute() {
|
|
12599
12890
|
if (!this.lzMap) return;
|
|
12891
|
+
this.lzMap.pauseAnimateRoute();
|
|
12600
12892
|
this.lzMap.removeRoute();
|
|
12601
12893
|
this.route = void 0;
|
|
12894
|
+
if (this.animatedRoute) {
|
|
12895
|
+
clearTimeout(this.animatedRoute);
|
|
12896
|
+
}
|
|
12602
12897
|
this.animatedRoute = void 0;
|
|
12898
|
+
this.isAnimatingRoute = false;
|
|
12603
12899
|
}
|
|
12604
12900
|
isAnimating() {
|
|
12605
12901
|
return this.isAnimatingRoute;
|
|
@@ -12607,9 +12903,9 @@ class RouteAnimationController {
|
|
|
12607
12903
|
stopAnimatedRoute() {
|
|
12608
12904
|
if (this.isAnimatingRoute) {
|
|
12609
12905
|
clearTimeout(this.animatedRoute);
|
|
12906
|
+
this.dismissChangeFloorAlert();
|
|
12610
12907
|
this.animatedRoute = void 0;
|
|
12611
12908
|
this.isAnimatingRoute = false;
|
|
12612
|
-
this.dismissChangeFloorAlert();
|
|
12613
12909
|
}
|
|
12614
12910
|
}
|
|
12615
12911
|
getCurrentRoute() {
|
|
@@ -12625,10 +12921,14 @@ class RouteAnimationController {
|
|
|
12625
12921
|
}
|
|
12626
12922
|
showMapModal(modal) {
|
|
12627
12923
|
this.handlers.onShowMapModal(modal);
|
|
12628
|
-
this.
|
|
12629
|
-
|
|
12630
|
-
this.
|
|
12631
|
-
|
|
12924
|
+
this.host.requestUpdate();
|
|
12925
|
+
return new Promise((resolve) => {
|
|
12926
|
+
this.animatedRoute = setTimeout(() => {
|
|
12927
|
+
this.lzMap?.resumeAnimateRoute();
|
|
12928
|
+
this.dismissChangeFloorAlert();
|
|
12929
|
+
resolve();
|
|
12930
|
+
}, this.minUpdateTimeInterval);
|
|
12931
|
+
});
|
|
12632
12932
|
}
|
|
12633
12933
|
createChangeFloorMessage(isGoingUp, isElevator, floorName) {
|
|
12634
12934
|
let isGoingUpStr;
|
|
@@ -12647,4 +12947,4 @@ class RouteAnimationController {
|
|
|
12647
12947
|
}
|
|
12648
12948
|
|
|
12649
12949
|
export { MarkerController as M, RouteAnimationController as R, SDKController as S };
|
|
12650
|
-
//# sourceMappingURL=utils-
|
|
12950
|
+
//# sourceMappingURL=utils-FyhZTuD9.js.map
|
package/dist/es/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { b as RouteViewTotems } from './assets/route-view-totems-
|
|
2
|
-
export { M as MapViewWithModal } from './assets/map-view-with-modal-
|
|
1
|
+
export { b as RouteViewTotems } from './assets/route-view-totems-DXCPYztz.js';
|
|
2
|
+
export { M as MapViewWithModal } from './assets/map-view-with-modal-Dpg6IjBv.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { b as RouteViewTotems } from './assets/route-view-totems-
|
|
2
|
-
import './assets/utils-
|
|
1
|
+
export { b as RouteViewTotems } from './assets/route-view-totems-DXCPYztz.js';
|
|
2
|
+
import './assets/utils-FyhZTuD9.js';
|
|
3
3
|
//# sourceMappingURL=route-view-totems.js.map
|