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/.eslintrc.js +2 -0
- package/.ncurc.js +8 -0
- package/CHANGES.md +32 -0
- package/README.md +21 -16
- package/dist/WorkInfo-es.js +4659 -0
- package/dist/activateCallback-es.js +158 -0
- package/dist/index-es.js +83 -85
- package/dist/index-es.min.js +1 -1
- package/dist/index-umd.js +84 -86
- package/dist/index-umd.min.js +1 -1
- package/package.json +44 -44
- package/resources/index.js +1 -1
- package/resources/utils/Metadata.js +6 -1
- package/resources/utils/ServiceWorker.js +3 -1
- package/resources/workDisplay.js +0 -1
- package/server/main-cjs.js +186 -26
- package/server/main.js +1 -3
- package/sw-sample.js +17 -24
- package/.remarkrc +0 -11
- package/dist/WorkInfo-umd.js +0 -4666
- package/dist/activateCallback-umd.js +0 -166
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
|
-
|
|
14
|
-
|
|
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]
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
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
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
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
|
-
|
|
1963
|
+
var result = this.parseArgument(nestingLevel, expectingCloseTag);
|
|
1976
1964
|
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1965
|
+
if (result.err) {
|
|
1966
|
+
return result;
|
|
1967
|
+
}
|
|
1980
1968
|
|
|
1981
|
-
|
|
1982
|
-
|
|
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
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
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
|
-
|
|
2190
|
-
|
|
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
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
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
|
-
|
|
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
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
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
|
-
|
|
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
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
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
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
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
|
-
|
|
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;
|
|
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
|
-
|
|
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
|
|
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
|
+
}));
|