textbrowser 0.39.0 → 0.40.3

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/index-umd.js CHANGED
@@ -2,21 +2,16 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
3
  typeof define === 'function' && define.amd ? define(factory) :
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.TextBrowser = factory());
5
- }(this, (function () { 'use strict';
5
+ })(this, (function () { 'use strict';
6
6
 
7
7
  function ownKeys(object, enumerableOnly) {
8
8
  var keys = Object.keys(object);
9
9
 
10
10
  if (Object.getOwnPropertySymbols) {
11
11
  var symbols = Object.getOwnPropertySymbols(object);
12
-
13
- if (enumerableOnly) {
14
- symbols = symbols.filter(function (sym) {
15
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
16
- });
17
- }
18
-
19
- keys.push.apply(keys, symbols);
12
+ enumerableOnly && (symbols = symbols.filter(function (sym) {
13
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
14
+ })), keys.push.apply(keys, symbols);
20
15
  }
21
16
 
22
17
  return keys;
@@ -24,19 +19,12 @@
24
19
 
25
20
  function _objectSpread2(target) {
26
21
  for (var i = 1; i < arguments.length; i++) {
27
- var source = arguments[i] != null ? arguments[i] : {};
28
-
29
- if (i % 2) {
30
- ownKeys(Object(source), true).forEach(function (key) {
31
- _defineProperty(target, key, source[key]);
32
- });
33
- } else if (Object.getOwnPropertyDescriptors) {
34
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
35
- } else {
36
- ownKeys(Object(source)).forEach(function (key) {
37
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
38
- });
39
- }
22
+ var source = null != arguments[i] ? arguments[i] : {};
23
+ i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
24
+ _defineProperty(target, key, source[key]);
25
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
26
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
27
+ });
40
28
  }
41
29
 
42
30
  return target;
@@ -1491,15 +1479,15 @@
1491
1479
  result.maximumSignificantDigits = g1.length;
1492
1480
  } // @@@+ case
1493
1481
  else if (g2 === '+') {
1494
- result.minimumSignificantDigits = g1.length;
1495
- } // .### case
1496
- else if (g1[0] === '#') {
1497
- result.maximumSignificantDigits = g1.length;
1498
- } // .@@## or .@@@ case
1499
- else {
1500
- result.minimumSignificantDigits = g1.length;
1501
- result.maximumSignificantDigits = g1.length + (typeof g2 === 'string' ? g2.length : 0);
1502
- }
1482
+ result.minimumSignificantDigits = g1.length;
1483
+ } // .### case
1484
+ else if (g1[0] === '#') {
1485
+ result.maximumSignificantDigits = g1.length;
1486
+ } // .@@## or .@@@ case
1487
+ else {
1488
+ result.minimumSignificantDigits = g1.length;
1489
+ result.maximumSignificantDigits = g1.length + (typeof g2 === 'string' ? g2.length : 0);
1490
+ }
1503
1491
 
1504
1492
  return '';
1505
1493
  });
@@ -1739,15 +1727,15 @@
1739
1727
  result.minimumFractionDigits = g1.length;
1740
1728
  } // .### case
1741
1729
  else if (g3 && g3[0] === '#') {
1742
- result.maximumFractionDigits = g3.length;
1743
- } // .00## case
1744
- else if (g4 && g5) {
1745
- result.minimumFractionDigits = g4.length;
1746
- result.maximumFractionDigits = g4.length + g5.length;
1747
- } else {
1748
- result.minimumFractionDigits = g1.length;
1749
- result.maximumFractionDigits = g1.length;
1750
- }
1730
+ result.maximumFractionDigits = g3.length;
1731
+ } // .00## case
1732
+ else if (g4 && g5) {
1733
+ result.minimumFractionDigits = g4.length;
1734
+ result.maximumFractionDigits = g4.length + g5.length;
1735
+ } else {
1736
+ result.minimumFractionDigits = g1.length;
1737
+ result.maximumFractionDigits = g1.length;
1738
+ }
1751
1739
 
1752
1740
  return '';
1753
1741
  });
@@ -1972,14 +1960,14 @@
1972
1960
  if (char === 123
1973
1961
  /* `{` */
1974
1962
  ) {
1975
- var result = this.parseArgument(nestingLevel, expectingCloseTag);
1963
+ var result = this.parseArgument(nestingLevel, expectingCloseTag);
1976
1964
 
1977
- if (result.err) {
1978
- return result;
1979
- }
1965
+ if (result.err) {
1966
+ return result;
1967
+ }
1980
1968
 
1981
- elements.push(result.val);
1982
- } else if (char === 125
1969
+ elements.push(result.val);
1970
+ } else if (char === 125
1983
1971
  /* `}` */
1984
1972
  && nestingLevel > 0) {
1985
1973
  break;
@@ -1996,12 +1984,12 @@
1996
1984
  /* `<` */
1997
1985
  && !this.ignoreTag && this.peek() === 47 // char code for '/'
1998
1986
  ) {
1999
- if (expectingCloseTag) {
2000
- break;
2001
- } else {
2002
- return this.error(error.ErrorKind.UNMATCHED_CLOSING_TAG, createLocation(this.clonePosition(), this.clonePosition()));
2003
- }
2004
- } else if (char === 60
1987
+ if (expectingCloseTag) {
1988
+ break;
1989
+ } else {
1990
+ return this.error(error.ErrorKind.UNMATCHED_CLOSING_TAG, createLocation(this.clonePosition(), this.clonePosition()));
1991
+ }
1992
+ } else if (char === 60
2005
1993
  /* `<` */
2006
1994
  && !this.ignoreTag && _isAlpha(this.peek() || 0)) {
2007
1995
  var result = this.parseTag(nestingLevel, parentArgType);
@@ -2186,8 +2174,8 @@
2186
2174
  if (this.isEOF() || this.char() !== 39
2187
2175
  /* `'` */
2188
2176
  ) {
2189
- return null;
2190
- } // Parse escaped char following the apostrophe, or early return if there is no escaped char.
2177
+ return null;
2178
+ } // Parse escaped char following the apostrophe, or early return if there is no escaped char.
2191
2179
  // Check if is valid escaped character
2192
2180
 
2193
2181
 
@@ -2231,18 +2219,18 @@
2231
2219
  if (ch === 39
2232
2220
  /* `'` */
2233
2221
  ) {
2234
- if (this.peek() === 39
2235
- /* `'` */
2236
- ) {
2237
- codePoints.push(39); // Bump one more time because we need to skip 2 characters.
2222
+ if (this.peek() === 39
2223
+ /* `'` */
2224
+ ) {
2225
+ codePoints.push(39); // Bump one more time because we need to skip 2 characters.
2238
2226
 
2239
- this.bump();
2240
- } else {
2241
- // Optional closing apostrophe.
2242
- this.bump();
2243
- break;
2244
- }
2227
+ this.bump();
2245
2228
  } else {
2229
+ // Optional closing apostrophe.
2230
+ this.bump();
2231
+ break;
2232
+ }
2233
+ } else {
2246
2234
  codePoints.push(ch);
2247
2235
  }
2248
2236
 
@@ -2288,9 +2276,9 @@
2288
2276
  if (this.char() === 125
2289
2277
  /* `}` */
2290
2278
  ) {
2291
- this.bump();
2292
- return this.error(error.ErrorKind.EMPTY_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));
2293
- } // argument name
2279
+ this.bump();
2280
+ return this.error(error.ErrorKind.EMPTY_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));
2281
+ } // argument name
2294
2282
 
2295
2283
 
2296
2284
  var value = this.parseIdentifierIfPossible().value;
@@ -2569,8 +2557,8 @@
2569
2557
  if (this.isEOF() || this.char() !== 125
2570
2558
  /* `}` */
2571
2559
  ) {
2572
- return this.error(error.ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));
2573
- }
2560
+ return this.error(error.ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));
2561
+ }
2574
2562
 
2575
2563
  this.bump(); // `}`
2576
2564
 
@@ -2780,10 +2768,10 @@
2780
2768
  && ch <= 57
2781
2769
  /* `9` */
2782
2770
  ) {
2783
- hasDigits = true;
2784
- decimal = decimal * 10 + (ch - 48);
2785
- this.bump();
2786
- } else {
2771
+ hasDigits = true;
2772
+ decimal = decimal * 10 + (ch - 48);
2773
+ this.bump();
2774
+ } else {
2787
2775
  break;
2788
2776
  }
2789
2777
  }
@@ -2867,10 +2855,10 @@
2867
2855
  if (code === 10
2868
2856
  /* '\n' */
2869
2857
  ) {
2870
- this.position.line += 1;
2871
- this.position.column = 1;
2872
- this.position.offset += 1;
2873
- } else {
2858
+ this.position.line += 1;
2859
+ this.position.column = 1;
2860
+ this.position.offset += 1;
2861
+ } else {
2874
2862
  this.position.column += 1; // 0 ~ 0x10000 -> unicode BMP, otherwise skip the surrogate pair.
2875
2863
 
2876
2864
  this.position.offset += code < 0x10000 ? 1 : 2;
@@ -15185,7 +15173,12 @@
15185
15173
  // Todo: Allow use of dbs and fileGroup together in base directories?
15186
15174
 
15187
15175
  const getMetadata = async (file, property, basePath) => {
15188
- return (await JsonRefs.resolveRefsAt((basePath || getCurrDir()) + file + (property ? '#/' + property : ''), {
15176
+ const url = new URL(basePath || getCurrDir());
15177
+ url.search = ''; // Clear out query string, e.g., `?fbclid` from Facebook
15178
+
15179
+ url.pathname = file;
15180
+ url.hash = property ? '#/' + property : '';
15181
+ return (await JsonRefs.resolveRefsAt(url.toString(), {
15189
15182
  loaderOptions: {
15190
15183
  processContent(res, callback) {
15191
15184
  callback(undefined, JSON.parse(res.text || // `.metadata` not a recognized extension, so
@@ -16033,7 +16026,9 @@ any indication it is installing.
16033
16026
  let r;
16034
16027
 
16035
16028
  try {
16036
- r = await navigator.serviceWorker.register(serviceWorkerPath);
16029
+ r = await navigator.serviceWorker.register(serviceWorkerPath, {
16030
+ type: 'module'
16031
+ });
16037
16032
  } catch (err) {
16038
16033
  console.log('serviceWorkerPath', serviceWorkerPath);
16039
16034
  await dialogs.alert(`
@@ -17970,8 +17965,7 @@ body {
17970
17965
  groupsToWorks
17971
17966
  }) {
17972
17967
  const il = localizeParamNames ? key => l(['params', key]) : key => key;
17973
- const iil = localizeParamNames ? key => l(['params', 'indexed', key]) : key => key; // eslint-disable-next-line unicorn/prefer-prototype-methods -- Convenient
17974
-
17968
+ const iil = localizeParamNames ? key => l(['params', 'indexed', key]) : key => key;
17975
17969
  const localeFromLangData = languages.localeFromLangData.bind(languages);
17976
17970
  const imfLang = IMF({
17977
17971
  locales: lang.map(localeFromLangData),
@@ -18311,6 +18305,8 @@ body {
18311
18305
  /* 'فارسی', Persian */
18312
18306
  'glk',
18313
18307
  /* 'گیلکی', Gilaki */
18308
+ 'he',
18309
+ /* 'עברית', Hebrew */
18314
18310
  'ku',
18315
18311
  /* 'Kurdî / كوردی', Kurdish */
18316
18312
  'mzn',
@@ -18325,8 +18321,10 @@ body {
18325
18321
  /* 'سنڌي', Sindhi */
18326
18322
  'ug',
18327
18323
  /* 'Uyghurche / ئۇيغۇرچە', Uyghur */
18328
- 'ur'
18324
+ 'ur',
18329
18325
  /* 'اردو', Urdu */
18326
+ 'yi'
18327
+ /* 'ייִדיש', Yiddish */
18330
18328
  ],
18331
18329
  writable: false,
18332
18330
  enumerable: true,
@@ -18388,8 +18386,8 @@ body {
18388
18386
  if (i === max || // No more field sets to check
18389
18387
  anchors.length // Already had anchors found
18390
18388
  ) {
18391
- breakout = true;
18392
- }
18389
+ breakout = true;
18390
+ }
18393
18391
 
18394
18392
  break;
18395
18393
  }
@@ -19440,7 +19438,7 @@ body {
19440
19438
  // rememberRefusal();
19441
19439
  resolve();
19442
19440
  return;
19443
- // eslint-disable-next-line radar/no-duplicated-branches
19441
+ // eslint-disable-next-line sonarjs/no-duplicated-branches
19444
19442
 
19445
19443
  case 'default':
19446
19444
  resolve();
@@ -19906,4 +19904,4 @@ body {
19906
19904
 
19907
19905
  return TextBrowser;
19908
19906
 
19909
- })));
19907
+ }));