locize 4.0.12 → 4.0.14

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/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ### 4.0.14
2
+
3
+ - fix typescript types for startStandalone
4
+
5
+ ### 4.0.13
6
+
7
+ - update i18next-subliminal
8
+
1
9
  ### 4.0.12
2
10
 
3
11
  - locizePlugin: start i18next-subliminal only if popup or in iframe
@@ -20,6 +20,8 @@ export const locizePlugin: LocizePlugin
20
20
  export function locizeEditorPlugin(opt?: {
21
21
  qsProp?: string
22
22
  show?: boolean
23
+ projectId?: string
24
+ version?: string
23
25
  }): LocizePlugin
24
26
 
25
27
  /**
@@ -35,4 +37,9 @@ export function addLocizeSavedHandler(fn: (data: any) => void): void
35
37
  /**
36
38
  * If used without i18next.
37
39
  */
38
- export function startStandalone(): void
40
+ export function startStandalone(opt?: {
41
+ qsProp?: string
42
+ show?: boolean
43
+ projectId?: string
44
+ version?: string
45
+ }): void
@@ -20,6 +20,8 @@ export const locizePlugin: LocizePlugin
20
20
  export function locizeEditorPlugin(opt?: {
21
21
  qsProp?: string
22
22
  show?: boolean
23
+ projectId?: string
24
+ version?: string
23
25
  }): LocizePlugin
24
26
 
25
27
  /**
@@ -35,4 +37,9 @@ export function addLocizeSavedHandler(fn: (data: any) => void): void
35
37
  /**
36
38
  * If used without i18next.
37
39
  */
38
- export function startStandalone(): void
40
+ export function startStandalone(opt?: {
41
+ qsProp?: string
42
+ show?: boolean
43
+ projectId?: string
44
+ version?: string
45
+ }): void
@@ -27,25 +27,20 @@
27
27
 
28
28
  function toPropertyKey(t) {
29
29
  var i = toPrimitive(t, "string");
30
- return "symbol" == _typeof(i) ? i : String(i);
30
+ return "symbol" == _typeof(i) ? i : i + "";
31
31
  }
32
32
 
33
- function _defineProperty(obj, key, value) {
34
- key = toPropertyKey(key);
35
- if (key in obj) {
36
- Object.defineProperty(obj, key, {
37
- value: value,
38
- enumerable: true,
39
- configurable: true,
40
- writable: true
41
- });
42
- } else {
43
- obj[key] = value;
44
- }
45
- return obj;
33
+ function _defineProperty(e, r, t) {
34
+ return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
35
+ value: t,
36
+ enumerable: !0,
37
+ configurable: !0,
38
+ writable: !0
39
+ }) : e[r] = t, e;
46
40
  }
47
41
 
48
- var INVISIBLE_CHARACTERS = ["\u200B", "\u200C"];
42
+ var isBrowser = typeof window !== 'undefined';
43
+ var INVISIBLE_CHARACTERS = isBrowser ? ["\u200C", "\u200D"] : ["\u200B", "\u200C"];
49
44
  var INVISIBLE_REGEX = RegExp("([".concat(INVISIBLE_CHARACTERS.join(''), "]{9})+"), 'gu');
50
45
  var TEMPLATE_MINIMUM_LENGTH = '{"k":"a"}'.length;
51
46
  var invisibleStartMarker = 'subliminal:start';
@@ -142,7 +137,7 @@
142
137
  }
143
138
 
144
139
  function ownKeys$7(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
145
- function _objectSpread$7(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$7(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$7(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
140
+ function _objectSpread$7(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$7(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$7(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
146
141
  var postProcessorName = 'subliminal';
147
142
  var SubliminalPostProcessor = {
148
143
  name: postProcessorName,
@@ -268,8 +263,8 @@
268
263
  data: data$1
269
264
  };
270
265
 
271
- function _arrayWithHoles(arr) {
272
- if (Array.isArray(arr)) return arr;
266
+ function _arrayWithHoles(r) {
267
+ if (Array.isArray(r)) return r;
273
268
  }
274
269
 
275
270
  function _iterableToArrayLimit(r, l) {
@@ -300,27 +295,26 @@
300
295
  }
301
296
  }
302
297
 
303
- function _arrayLikeToArray(arr, len) {
304
- if (len == null || len > arr.length) len = arr.length;
305
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
306
- return arr2;
298
+ function _arrayLikeToArray(r, a) {
299
+ (null == a || a > r.length) && (a = r.length);
300
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
301
+ return n;
307
302
  }
308
303
 
309
- function _unsupportedIterableToArray(o, minLen) {
310
- if (!o) return;
311
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
312
- var n = Object.prototype.toString.call(o).slice(8, -1);
313
- if (n === "Object" && o.constructor) n = o.constructor.name;
314
- if (n === "Map" || n === "Set") return Array.from(o);
315
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
304
+ function _unsupportedIterableToArray(r, a) {
305
+ if (r) {
306
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
307
+ var t = {}.toString.call(r).slice(8, -1);
308
+ 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) ? _arrayLikeToArray(r, a) : void 0;
309
+ }
316
310
  }
317
311
 
318
312
  function _nonIterableRest() {
319
313
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
320
314
  }
321
315
 
322
- function _slicedToArray(arr, i) {
323
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
316
+ function _slicedToArray(r, e) {
317
+ return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
324
318
  }
325
319
 
326
320
  function debounce(func, wait, immediate) {
@@ -649,20 +643,20 @@
649
643
  }
650
644
  api.addHandler('commitKey', handler$7);
651
645
 
652
- function _arrayWithoutHoles(arr) {
653
- if (Array.isArray(arr)) return _arrayLikeToArray(arr);
646
+ function _arrayWithoutHoles(r) {
647
+ if (Array.isArray(r)) return _arrayLikeToArray(r);
654
648
  }
655
649
 
656
- function _iterableToArray(iter) {
657
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
650
+ function _iterableToArray(r) {
651
+ if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
658
652
  }
659
653
 
660
654
  function _nonIterableSpread() {
661
655
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
662
656
  }
663
657
 
664
- function _toConsumableArray(arr) {
665
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
658
+ function _toConsumableArray(r) {
659
+ return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
666
660
  }
667
661
 
668
662
  function handler$6(payload) {
@@ -924,33 +918,26 @@
924
918
  }
925
919
  api.addHandler('requestPopupChanges', handler$4);
926
920
 
927
- function _objectWithoutPropertiesLoose(source, excluded) {
928
- if (source == null) return {};
929
- var target = {};
930
- var sourceKeys = Object.keys(source);
931
- var key, i;
932
- for (i = 0; i < sourceKeys.length; i++) {
933
- key = sourceKeys[i];
934
- if (excluded.indexOf(key) >= 0) continue;
935
- target[key] = source[key];
921
+ function _objectWithoutPropertiesLoose(r, e) {
922
+ if (null == r) return {};
923
+ var t = {};
924
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
925
+ if (-1 !== e.indexOf(n)) continue;
926
+ t[n] = r[n];
936
927
  }
937
- return target;
928
+ return t;
938
929
  }
939
930
 
940
- function _objectWithoutProperties(source, excluded) {
941
- if (source == null) return {};
942
- var target = _objectWithoutPropertiesLoose(source, excluded);
943
- var key, i;
931
+ function _objectWithoutProperties(e, t) {
932
+ if (null == e) return {};
933
+ var o,
934
+ r,
935
+ i = _objectWithoutPropertiesLoose(e, t);
944
936
  if (Object.getOwnPropertySymbols) {
945
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
946
- for (i = 0; i < sourceSymbolKeys.length; i++) {
947
- key = sourceSymbolKeys[i];
948
- if (excluded.indexOf(key) >= 0) continue;
949
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
950
- target[key] = source[key];
951
- }
937
+ var n = Object.getOwnPropertySymbols(e);
938
+ for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
952
939
  }
953
- return target;
940
+ return i;
954
941
  }
955
942
 
956
943
  var _excluded$1 = ["lng", "ns"];