Skip to content

Commit

Permalink
Update frontend dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
core23 committed Feb 26, 2023
1 parent 9c7f441 commit ba9eb2d
Show file tree
Hide file tree
Showing 5 changed files with 965 additions and 1,542 deletions.
12 changes: 12 additions & 0 deletions assets/.size-limit.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{
"path": "./dist/*.js",
"gzip": false,
"limit": "165 KB"
},
{
"path": "./dist/*.css",
"gzip": false,
"limit": "30 KB"
}
]
40 changes: 4 additions & 36 deletions assets/dist/googlemaps_controller.js
Original file line number Diff line number Diff line change
@@ -1,56 +1,36 @@
'use strict';

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;

var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));

var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));

var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));

var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));

var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));

var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));

var _stimulus = require("@hotwired/stimulus");

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }

function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }

var _default = /*#__PURE__*/function (_Controller) {
(0, _inherits2["default"])(_default, _Controller);

var _super = _createSuper(_default);

function _default() {
(0, _classCallCheck2["default"])(this, _default);
return _super.apply(this, arguments);
}

(0, _createClass2["default"])(_default, [{
key: "connect",
value: function connect() {
var _this = this;

this._prepareApi(this.apiKeyValue).then(function () {
_this.element.style.height = _this.heightValue + 'px';

var options = _objectSpread(_objectSpread({}, _this.defaultOptions), {}, {
latitude: _this.latitudeValue,
longitude: _this.longitudeValue,
Expand All @@ -64,13 +44,12 @@ var _default = /*#__PURE__*/function (_Controller) {
lng: _this.longitudeValue,
lat: _this.latitudeValue
}
}); // eslint-disable-next-line

});

// eslint-disable-next-line
_this.map = new google.maps.Map(_this.element, options);
var map = _this.map;
var markers = [_this._createMarker(options.center)];

_this._dispatchEvent('googlemaps:connect', {
map: map,
markers: markers
Expand All @@ -84,17 +63,15 @@ var _default = /*#__PURE__*/function (_Controller) {
map: this.map,
position: position
};

if (this.titleValue) {
markerOptions.title = this.titleValue;
}

if (this.iconValue) {
// eslint-disable-next-line
markerOptions.icon = new google.maps.MarkerImage(this.iconValue);
} // eslint-disable-next-line

}

// eslint-disable-next-line
return new google.maps.Marker(markerOptions);
}
}, {
Expand All @@ -115,36 +92,29 @@ var _default = /*#__PURE__*/function (_Controller) {
}, false);
el.src = src;
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(el);

window.googleMapsInitialized = function () {
resolve(src);
};
});
};

_context.next = 3;
return get('https://maps.googleapis.com/maps/api/js?key=' + apiKey + '&callback=googleMapsInitialized');

case 3:
myPromises = _context.sent;
_context.next = 6;
return Promise.all(myPromises);

case 6:
return _context.abrupt("return", _context.sent);

case 7:
case "end":
return _context.stop();
}
}
}, _callee);
}));

function _prepareApi(_x) {
return _prepareApi2.apply(this, arguments);
}

return _prepareApi;
}()
}, {
Expand All @@ -153,7 +123,6 @@ var _default = /*#__PURE__*/function (_Controller) {
if (!this.map) {
return;
}

this.map.remove();
}
}, {
Expand All @@ -169,7 +138,6 @@ var _default = /*#__PURE__*/function (_Controller) {
}]);
return _default;
}(_stimulus.Controller);

exports["default"] = _default;
(0, _defineProperty2["default"])(_default, "values", {
latitude: Number,
Expand Down
25 changes: 0 additions & 25 deletions assets/dist/openstreetmap_controller.js
Original file line number Diff line number Diff line change
@@ -1,51 +1,33 @@
'use strict';

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

var _typeof = require("@babel/runtime/helpers/typeof");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));

var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));

var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));

var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));

var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));

var _stimulus = require("@hotwired/stimulus");

function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }

function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }

var _default = /*#__PURE__*/function (_Controller) {
(0, _inherits2["default"])(_default, _Controller);

var _super = _createSuper(_default);

function _default() {
(0, _classCallCheck2["default"])(this, _default);
return _super.apply(this, arguments);
}

(0, _createClass2["default"])(_default, [{
key: "connect",
value: function connect() {
var _this = this;

var position = [this.latitudeValue, this.longitudeValue];
var options = {
center: position,
Expand All @@ -72,16 +54,13 @@ var _default = /*#__PURE__*/function (_Controller) {
var markerOptions = {
icon: icon
};

var marker = _this._createMarker(L, map, position, markerOptions);

_this._dispatchEvent('openstreetmap:addMarker', {
map: map,
layer: layer,
marker: marker
});
});

_this._dispatchEvent('openstreetmap:connect', {
map: map,
layer: layer
Expand All @@ -92,7 +71,6 @@ var _default = /*#__PURE__*/function (_Controller) {
key: "_createMarker",
value: function _createMarker(L, map, position, markerOptions) {
var marker = L.marker(position, markerOptions).addTo(map);

if (this.titleValue) {
marker.bindPopup(this.titleValue);
var isClicked = false;
Expand Down Expand Up @@ -121,7 +99,6 @@ var _default = /*#__PURE__*/function (_Controller) {
}
});
}

return marker;
}
}, {
Expand All @@ -130,7 +107,6 @@ var _default = /*#__PURE__*/function (_Controller) {
if (!this.map) {
return;
}

this.map.off();
this.map.remove();
}
Expand All @@ -147,7 +123,6 @@ var _default = /*#__PURE__*/function (_Controller) {
}]);
return _default;
}(_stimulus.Controller);

exports["default"] = _default;
(0, _defineProperty2["default"])(_default, "values", {
latitude: Number,
Expand Down
27 changes: 9 additions & 18 deletions assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,24 @@
},
"devDependencies": {
"@babel/cli": "^7.17.10",
"@babel/core": "^7.18.2",
"@babel/core": "^7.20.12",
"@babel/preset-env": "^7.20.2",
"@babel/eslint-parser": "^7.18.2",
"@babel/plugin-proposal-class-properties": "^7.16.7",
"@babel/plugin-transform-runtime": "^7.18.2",
"@babel/preset-env": "^7.18.2",
"@hotwired/stimulus": "^3.0.1",
"@size-limit/preset-small-lib": "^6.0.4",
"@size-limit/esbuild": "^8.1.1",
"@size-limit/preset-small-lib": "^8.1.2",
"@symfony/stimulus-testing": "^2.0.1",
"eslint": "^8.16.0",
"eslint": "^8.32.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jest": "^27.0.0",
"sass": "^1.52.2",
"prettier": "^2.6.2",
"size-limit": "^8.0.0"
"sass": "^1.57.1",
"sass-loader": "^13.2.0",
"size-limit": "^8.1.2"
},
"scripts": {
"build": "babel src -d dist && yarn sass:build",
Expand All @@ -67,18 +70,6 @@
"jsxBracketSameLine": true,
"singleQuote": true
},
"size-limit": [
{
"path": "./dist/*.js",
"gzip": false,
"limit": "165 KB"
},
{
"path": "./dist/*.css",
"gzip": false,
"limit": "30 KB"
}
],
"jest": {
"testRegex": "test/.*\\.test.js",
"setupFilesAfterEnv": [
Expand Down
Loading

0 comments on commit ba9eb2d

Please sign in to comment.