@dfds-ui/google-places 1.1.15 → 2.0.0-alpha.6c7d825d

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/AddressSelect.js CHANGED
@@ -1,75 +1,60 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
1
2
  var _excluded = ["name", "disabled", "error", "size", "types", "onFocus", "onBlur", "onChange", "location", "radius", "countries"];
2
-
3
3
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
-
4
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
5
5
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
6
-
7
6
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
8
-
9
7
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
10
-
11
8
  function _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."); }
12
-
13
9
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
14
-
15
10
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
16
-
17
11
  function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
18
-
19
12
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
20
-
21
13
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
22
-
23
14
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
24
-
25
15
  import React, { useState } from 'react';
26
16
  import { AsyncSearchableSelect } from '@dfds-ui/react-components';
27
17
  import debounce from 'lodash.debounce';
28
18
  import { useAddressPredictions } from './GooglePlaces';
29
19
  import { jsx as ___EmotionJSX } from "@emotion/react";
30
-
31
20
  var AddressSelect = function AddressSelect(_ref) {
32
21
  var name = _ref.name,
33
- disabled = _ref.disabled,
34
- error = _ref.error,
35
- _ref$size = _ref.size,
36
- size = _ref$size === void 0 ? 'medium' : _ref$size,
37
- types = _ref.types,
38
- onFocus = _ref.onFocus,
39
- onBlur = _ref.onBlur,
40
- onChange = _ref.onChange,
41
- location = _ref.location,
42
- radius = _ref.radius,
43
- _ref$countries = _ref.countries,
44
- countries = _ref$countries === void 0 ? [] : _ref$countries,
45
- rest = _objectWithoutProperties(_ref, _excluded);
46
-
22
+ disabled = _ref.disabled,
23
+ error = _ref.error,
24
+ _ref$size = _ref.size,
25
+ size = _ref$size === void 0 ? 'medium' : _ref$size,
26
+ types = _ref.types,
27
+ onFocus = _ref.onFocus,
28
+ onBlur = _ref.onBlur,
29
+ onChange = _ref.onChange,
30
+ location = _ref.location,
31
+ radius = _ref.radius,
32
+ _ref$countries = _ref.countries,
33
+ countries = _ref$countries === void 0 ? [] : _ref$countries,
34
+ rest = _objectWithoutProperties(_ref, _excluded);
47
35
  var _useState = useState([]),
48
- _useState2 = _slicedToArray(_useState, 2),
49
- predictions = _useState2[0],
50
- setPredictions = _useState2[1];
51
-
36
+ _useState2 = _slicedToArray(_useState, 2),
37
+ predictions = _useState2[0],
38
+ setPredictions = _useState2[1];
52
39
  var _useAddressPrediction = useAddressPredictions('', {
53
- types: types,
54
- location: location,
55
- radius: radius,
56
- components: {
57
- countries: countries
58
- }
59
- }),
60
- available = _useAddressPrediction.available,
61
- getPlacePredictions = _useAddressPrediction.getPlacePredictions;
62
-
40
+ types: types,
41
+ location: location,
42
+ radius: radius,
43
+ components: {
44
+ countries: countries
45
+ }
46
+ }),
47
+ available = _useAddressPrediction.available,
48
+ getPlacePredictions = _useAddressPrediction.getPlacePredictions;
63
49
  var loadOptions = /*#__PURE__*/function () {
64
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(input, callback) {
50
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(input, callback) {
65
51
  var placePredictions, options;
66
- return regeneratorRuntime.wrap(function _callee$(_context) {
52
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
67
53
  while (1) {
68
54
  switch (_context.prev = _context.next) {
69
55
  case 0:
70
56
  _context.next = 2;
71
57
  return getPlacePredictions(input);
72
-
73
58
  case 2:
74
59
  placePredictions = _context.sent;
75
60
  setPredictions(placePredictions);
@@ -80,7 +65,6 @@ var AddressSelect = function AddressSelect(_ref) {
80
65
  };
81
66
  });
82
67
  callback(options);
83
-
84
68
  case 6:
85
69
  case "end":
86
70
  return _context.stop();
@@ -88,18 +72,15 @@ var AddressSelect = function AddressSelect(_ref) {
88
72
  }
89
73
  }, _callee);
90
74
  }));
91
-
92
75
  return function loadOptions(_x, _x2) {
93
76
  return _ref2.apply(this, arguments);
94
77
  };
95
78
  }();
96
-
97
79
  var handleChange = function handleChange(value) {
98
80
  if (onChange) {
99
81
  onChange(value, predictions);
100
82
  }
101
83
  };
102
-
103
84
  return ___EmotionJSX(AsyncSearchableSelect, _extends({
104
85
  disabled: disabled || !available,
105
86
  name: name,
@@ -111,5 +92,4 @@ var AddressSelect = function AddressSelect(_ref) {
111
92
  onBlur: onBlur
112
93
  }, rest));
113
94
  };
114
-
115
95
  export default AddressSelect;
package/GooglePlaces.js CHANGED
@@ -1,15 +1,9 @@
1
1
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
-
3
2
  function _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."); }
4
-
5
3
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
6
-
7
4
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
8
-
9
5
  function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
10
-
11
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
-
13
7
  /// <reference types="@types/googlemaps" />
14
8
  import React, { createContext, useState, useContext, useRef, useEffect } from 'react';
15
9
  import { useScript } from '@dfds-ui/hooks';
@@ -19,30 +13,25 @@ export var GooglePlacesAPIContext = /*#__PURE__*/createContext({
19
13
  });
20
14
  export var GooglePlacesAPIProvider = function GooglePlacesAPIProvider(_ref) {
21
15
  var _window, _window$google;
22
-
23
16
  var children = _ref.children,
24
- apiKey = _ref.apiKey,
25
- language = _ref.language,
26
- _ref$libraries = _ref.libraries,
27
- libraries = _ref$libraries === void 0 ? 'places' : _ref$libraries;
17
+ apiKey = _ref.apiKey,
18
+ language = _ref.language,
19
+ _ref$libraries = _ref.libraries,
20
+ libraries = _ref$libraries === void 0 ? 'places' : _ref$libraries;
28
21
  // We want to prevent the google maps api to be loaded more than once
29
22
  var isGoogleMapsDefined = typeof window !== 'undefined' && Boolean((_window = window) === null || _window === void 0 ? void 0 : (_window$google = _window.google) === null || _window$google === void 0 ? void 0 : _window$google.maps);
30
23
  var languageParam = language ? "&language=".concat(language) : '';
31
24
  var scriptUrl = "https://maps.googleapis.com/maps/api/js?key=".concat(apiKey, "&libraries=").concat(libraries).concat(languageParam);
32
-
33
25
  var _useScript = useScript(scriptUrl, isGoogleMapsDefined),
34
- _useScript2 = _slicedToArray(_useScript, 2),
35
- loaded = _useScript2[0],
36
- error = _useScript2[1];
37
-
26
+ _useScript2 = _slicedToArray(_useScript, 2),
27
+ loaded = _useScript2[0],
28
+ error = _useScript2[1];
38
29
  var _useState = useState(false),
39
- _useState2 = _slicedToArray(_useState, 2),
40
- available = _useState2[0],
41
- setAvailable = _useState2[1];
42
-
30
+ _useState2 = _slicedToArray(_useState, 2),
31
+ available = _useState2[0],
32
+ setAvailable = _useState2[1];
43
33
  useEffect(function () {
44
34
  setAvailable(loaded && !error);
45
-
46
35
  if (error) {
47
36
  throw new Error('Google Places API script failed to load');
48
37
  }
@@ -55,33 +44,26 @@ export var GooglePlacesAPIProvider = function GooglePlacesAPIProvider(_ref) {
55
44
  };
56
45
  export var useGooglePlacesAPI = function useGooglePlacesAPI() {
57
46
  var context = useContext(GooglePlacesAPIContext);
58
-
59
47
  if (context === undefined) {
60
48
  throw new Error('useGooglePlaces must be used inside of GooglePlacesAPIProvider');
61
49
  }
62
-
63
50
  return context;
64
51
  };
65
52
  export var useAddressPredictions = function useAddressPredictions(input, _ref2) {
66
53
  var types = _ref2.types,
67
- location = _ref2.location,
68
- radius = _ref2.radius,
69
- components = _ref2.components;
70
-
54
+ location = _ref2.location,
55
+ radius = _ref2.radius,
56
+ components = _ref2.components;
71
57
  var _useState3 = useState([]),
72
- _useState4 = _slicedToArray(_useState3, 2),
73
- predictions = _useState4[0],
74
- setPredictions = _useState4[1];
75
-
58
+ _useState4 = _slicedToArray(_useState3, 2),
59
+ predictions = _useState4[0],
60
+ setPredictions = _useState4[1];
76
61
  var _useGooglePlacesAPI = useGooglePlacesAPI(),
77
- available = _useGooglePlacesAPI.available;
78
-
62
+ available = _useGooglePlacesAPI.available;
79
63
  var autocomplete = useRef();
80
-
81
64
  if (!autocomplete.current && available && typeof window !== 'undefined') {
82
65
  autocomplete.current = new google.maps.places.AutocompleteService();
83
66
  }
84
-
85
67
  function getPlacePredictions(input) {
86
68
  return new Promise(function (resolve) {
87
69
  autocomplete.current.getPlacePredictions({
@@ -101,19 +83,17 @@ export var useAddressPredictions = function useAddressPredictions(input, _ref2)
101
83
  }
102
84
  }, function (predictions) {
103
85
  var _predictions;
104
-
105
86
  predictions = (_predictions = predictions) !== null && _predictions !== void 0 ? _predictions : [];
106
87
  setPredictions(predictions);
107
88
  resolve(predictions);
108
89
  });
109
90
  });
110
91
  }
111
-
112
92
  useEffect(function () {
113
93
  if (input !== '') {
114
94
  void getPlacePredictions(input);
115
- } // eslint-disable-next-line react-hooks/exhaustive-deps
116
-
95
+ }
96
+ // eslint-disable-next-line react-hooks/exhaustive-deps
117
97
  }, [input]);
118
98
  return {
119
99
  available: available,
@@ -4,79 +4,55 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _react = _interopRequireWildcard(require("react"));
9
-
10
8
  var _reactComponents = require("@dfds-ui/react-components");
11
-
12
9
  var _lodash = _interopRequireDefault(require("lodash.debounce"));
13
-
14
10
  var _GooglePlaces = require("./GooglePlaces");
15
-
16
11
  var _react2 = require("@emotion/react");
17
-
18
12
  const _excluded = ["name", "disabled", "error", "size", "types", "onFocus", "onBlur", "onChange", "location", "radius", "countries"];
19
-
20
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
-
22
14
  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); }
23
-
24
15
  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; }
25
-
26
16
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
27
-
28
17
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
29
-
30
18
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
31
-
32
19
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
33
-
34
20
  function _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."); }
35
-
36
21
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
37
-
38
22
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
39
-
40
23
  function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
41
-
42
24
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
43
-
44
25
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
45
-
46
26
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
47
-
48
27
  const AddressSelect = _ref => {
49
28
  let name = _ref.name,
50
- disabled = _ref.disabled,
51
- error = _ref.error,
52
- _ref$size = _ref.size,
53
- size = _ref$size === void 0 ? 'medium' : _ref$size,
54
- types = _ref.types,
55
- onFocus = _ref.onFocus,
56
- onBlur = _ref.onBlur,
57
- onChange = _ref.onChange,
58
- location = _ref.location,
59
- radius = _ref.radius,
60
- _ref$countries = _ref.countries,
61
- countries = _ref$countries === void 0 ? [] : _ref$countries,
62
- rest = _objectWithoutProperties(_ref, _excluded);
63
-
29
+ disabled = _ref.disabled,
30
+ error = _ref.error,
31
+ _ref$size = _ref.size,
32
+ size = _ref$size === void 0 ? 'medium' : _ref$size,
33
+ types = _ref.types,
34
+ onFocus = _ref.onFocus,
35
+ onBlur = _ref.onBlur,
36
+ onChange = _ref.onChange,
37
+ location = _ref.location,
38
+ radius = _ref.radius,
39
+ _ref$countries = _ref.countries,
40
+ countries = _ref$countries === void 0 ? [] : _ref$countries,
41
+ rest = _objectWithoutProperties(_ref, _excluded);
64
42
  const _useState = (0, _react.useState)([]),
65
- _useState2 = _slicedToArray(_useState, 2),
66
- predictions = _useState2[0],
67
- setPredictions = _useState2[1];
68
-
43
+ _useState2 = _slicedToArray(_useState, 2),
44
+ predictions = _useState2[0],
45
+ setPredictions = _useState2[1];
69
46
  const _useAddressPrediction = (0, _GooglePlaces.useAddressPredictions)('', {
70
- types,
71
- location,
72
- radius,
73
- components: {
74
- countries
75
- }
76
- }),
77
- available = _useAddressPrediction.available,
78
- getPlacePredictions = _useAddressPrediction.getPlacePredictions;
79
-
47
+ types,
48
+ location,
49
+ radius,
50
+ components: {
51
+ countries
52
+ }
53
+ }),
54
+ available = _useAddressPrediction.available,
55
+ getPlacePredictions = _useAddressPrediction.getPlacePredictions;
80
56
  const loadOptions = /*#__PURE__*/function () {
81
57
  var _ref2 = _asyncToGenerator(function* (input, callback) {
82
58
  const placePredictions = yield getPlacePredictions(input);
@@ -87,18 +63,15 @@ const AddressSelect = _ref => {
87
63
  }));
88
64
  callback(options);
89
65
  });
90
-
91
66
  return function loadOptions(_x, _x2) {
92
67
  return _ref2.apply(this, arguments);
93
68
  };
94
69
  }();
95
-
96
70
  const handleChange = value => {
97
71
  if (onChange) {
98
72
  onChange(value, predictions);
99
73
  }
100
74
  };
101
-
102
75
  return (0, _react2.jsx)(_reactComponents.AsyncSearchableSelect, _extends({
103
76
  disabled: disabled || !available,
104
77
  name: name,
@@ -110,6 +83,5 @@ const AddressSelect = _ref => {
110
83
  onBlur: onBlur
111
84
  }, rest));
112
85
  };
113
-
114
86
  var _default = AddressSelect;
115
87
  exports.default = _default;
@@ -3,35 +3,22 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useAddressPredictions = exports.useGooglePlacesAPI = exports.GooglePlacesAPIProvider = exports.GooglePlacesAPIContext = void 0;
7
-
6
+ exports.useGooglePlacesAPI = exports.useAddressPredictions = exports.GooglePlacesAPIProvider = exports.GooglePlacesAPIContext = void 0;
8
7
  var _react = _interopRequireWildcard(require("react"));
9
-
10
8
  var _hooks = require("@dfds-ui/hooks");
11
-
12
9
  var _react2 = require("@emotion/react");
13
-
14
10
  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); }
15
-
16
11
  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; }
17
-
18
12
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
19
-
20
13
  function _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."); }
21
-
22
14
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
23
-
24
15
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
25
-
26
16
  function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
27
-
28
17
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
29
-
30
18
  const GooglePlacesAPIContext = /*#__PURE__*/(0, _react.createContext)({
31
19
  available: false
32
20
  });
33
21
  exports.GooglePlacesAPIContext = GooglePlacesAPIContext;
34
-
35
22
  const GooglePlacesAPIProvider = ({
36
23
  children,
37
24
  apiKey,
@@ -39,25 +26,20 @@ const GooglePlacesAPIProvider = ({
39
26
  libraries = 'places'
40
27
  }) => {
41
28
  var _window, _window$google;
42
-
43
29
  // We want to prevent the google maps api to be loaded more than once
44
30
  const isGoogleMapsDefined = typeof window !== 'undefined' && Boolean((_window = window) === null || _window === void 0 ? void 0 : (_window$google = _window.google) === null || _window$google === void 0 ? void 0 : _window$google.maps);
45
31
  const languageParam = language ? `&language=${language}` : '';
46
32
  const scriptUrl = `https://maps.googleapis.com/maps/api/js?key=${apiKey}&libraries=${libraries}${languageParam}`;
47
-
48
33
  const _useScript = (0, _hooks.useScript)(scriptUrl, isGoogleMapsDefined),
49
- _useScript2 = _slicedToArray(_useScript, 2),
50
- loaded = _useScript2[0],
51
- error = _useScript2[1];
52
-
34
+ _useScript2 = _slicedToArray(_useScript, 2),
35
+ loaded = _useScript2[0],
36
+ error = _useScript2[1];
53
37
  const _useState = (0, _react.useState)(false),
54
- _useState2 = _slicedToArray(_useState, 2),
55
- available = _useState2[0],
56
- setAvailable = _useState2[1];
57
-
38
+ _useState2 = _slicedToArray(_useState, 2),
39
+ available = _useState2[0],
40
+ setAvailable = _useState2[1];
58
41
  (0, _react.useEffect)(() => {
59
42
  setAvailable(loaded && !error);
60
-
61
43
  if (error) {
62
44
  throw new Error('Google Places API script failed to load');
63
45
  }
@@ -68,21 +50,15 @@ const GooglePlacesAPIProvider = ({
68
50
  }
69
51
  }, children);
70
52
  };
71
-
72
53
  exports.GooglePlacesAPIProvider = GooglePlacesAPIProvider;
73
-
74
54
  const useGooglePlacesAPI = () => {
75
55
  const context = (0, _react.useContext)(GooglePlacesAPIContext);
76
-
77
56
  if (context === undefined) {
78
57
  throw new Error('useGooglePlaces must be used inside of GooglePlacesAPIProvider');
79
58
  }
80
-
81
59
  return context;
82
60
  };
83
-
84
61
  exports.useGooglePlacesAPI = useGooglePlacesAPI;
85
-
86
62
  const useAddressPredictions = (input, {
87
63
  types,
88
64
  location,
@@ -90,19 +66,15 @@ const useAddressPredictions = (input, {
90
66
  components
91
67
  }) => {
92
68
  const _useState3 = (0, _react.useState)([]),
93
- _useState4 = _slicedToArray(_useState3, 2),
94
- predictions = _useState4[0],
95
- setPredictions = _useState4[1];
96
-
69
+ _useState4 = _slicedToArray(_useState3, 2),
70
+ predictions = _useState4[0],
71
+ setPredictions = _useState4[1];
97
72
  const _useGooglePlacesAPI = useGooglePlacesAPI(),
98
- available = _useGooglePlacesAPI.available;
99
-
73
+ available = _useGooglePlacesAPI.available;
100
74
  const autocomplete = (0, _react.useRef)();
101
-
102
75
  if (!autocomplete.current && available && typeof window !== 'undefined') {
103
76
  autocomplete.current = new google.maps.places.AutocompleteService();
104
77
  }
105
-
106
78
  function getPlacePredictions(input) {
107
79
  return new Promise(resolve => {
108
80
  autocomplete.current.getPlacePredictions({
@@ -118,19 +90,17 @@ const useAddressPredictions = (input, {
118
90
  }
119
91
  }, predictions => {
120
92
  var _predictions;
121
-
122
93
  predictions = (_predictions = predictions) !== null && _predictions !== void 0 ? _predictions : [];
123
94
  setPredictions(predictions);
124
95
  resolve(predictions);
125
96
  });
126
97
  });
127
98
  }
128
-
129
99
  (0, _react.useEffect)(() => {
130
100
  if (input !== '') {
131
101
  void getPlacePredictions(input);
132
- } // eslint-disable-next-line react-hooks/exhaustive-deps
133
-
102
+ }
103
+ // eslint-disable-next-line react-hooks/exhaustive-deps
134
104
  }, [input]);
135
105
  return {
136
106
  available,
@@ -138,5 +108,4 @@ const useAddressPredictions = (input, {
138
108
  getPlacePredictions
139
109
  };
140
110
  };
141
-
142
111
  exports.useAddressPredictions = useAddressPredictions;
package/cjs/index.js CHANGED
@@ -12,9 +12,7 @@ Object.defineProperty(exports, "AddressSelect", {
12
12
  return _AddressSelect.default;
13
13
  }
14
14
  });
15
-
16
15
  var _GooglePlaces = require("./GooglePlaces");
17
-
18
16
  Object.keys(_GooglePlaces).forEach(function (key) {
19
17
  if (key === "default" || key === "__esModule") return;
20
18
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
@@ -26,9 +24,7 @@ Object.keys(_GooglePlaces).forEach(function (key) {
26
24
  }
27
25
  });
28
26
  });
29
-
30
27
  var _AddressSelect = _interopRequireWildcard(require("./AddressSelect"));
31
-
32
28
  Object.keys(_AddressSelect).forEach(function (key) {
33
29
  if (key === "default" || key === "__esModule") return;
34
30
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
@@ -40,7 +36,5 @@ Object.keys(_AddressSelect).forEach(function (key) {
40
36
  }
41
37
  });
42
38
  });
43
-
44
39
  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); }
45
-
46
40
  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; }
package/package.json CHANGED
@@ -3,26 +3,26 @@
3
3
  "description": "Components using Google places",
4
4
  "license": "MIT",
5
5
  "private": false,
6
- "version": "1.1.15",
6
+ "version": "2.0.0-alpha.6c7d825d",
7
7
  "sideEffects": false,
8
8
  "main": "./cjs/index.js",
9
9
  "module": "./index.js",
10
10
  "esnext": "./index.js",
11
11
  "typings": "./index.d.ts",
12
12
  "peerDependencies": {
13
- "react": ">= 16.8.0",
14
- "react-dom": ">= 16.8.0"
13
+ "react": ">= 17.0.2",
14
+ "react-dom": ">= 17.0.2"
15
15
  },
16
16
  "dependencies": {
17
- "@dfds-ui/colors": "1.1.15",
18
- "@dfds-ui/hooks": "1.1.15",
19
- "@dfds-ui/icons": "1.1.15",
20
- "@dfds-ui/react-components": "1.1.15",
21
- "@types/googlemaps": "3.38.1",
22
- "@types/lodash.debounce": "^4.0.6",
17
+ "@dfds-ui/colors": "2.0.0-alpha.6c7d825d",
18
+ "@dfds-ui/hooks": "2.0.0-alpha.6c7d825d",
19
+ "@dfds-ui/icons": "2.0.0-alpha.6c7d825d",
20
+ "@dfds-ui/react-components": "2.0.0-alpha.6c7d825d",
21
+ "@types/googlemaps": "3.43.3",
22
+ "@types/lodash.debounce": "^4.0.7",
23
23
  "lodash.debounce": "^4.0.8"
24
24
  },
25
- "gitHead": "5bc4b26ef4753412be4ab1f268814789289981e4",
25
+ "gitHead": "6c7d825df2a246b7515c442d43dc88179a6e397a",
26
26
  "publishConfig": {
27
27
  "access": "public"
28
28
  }