textbrowser 0.48.0 → 0.48.2
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.cjs +3 -1
- package/CHANGES.md +11 -0
- package/README.md +2 -6
- package/dist/WorkInfo-es.js +972 -344
- package/dist/activateCallback-es.js +2 -2
- package/dist/index-es.js +2713 -1105
- package/dist/index-es.min.js +4 -4
- package/dist/sw-helper.js +10 -6
- package/index.html +2 -0
- package/package.json +33 -33
- package/resources/activateCallback.js +2 -2
- package/resources/index.js +4 -4
- package/resources/resultsDisplay.js +44 -39
- package/resources/templates/languageSelect.js +3 -3
- package/resources/templates/resultsDisplayServerOrClient.js +76 -65
- package/resources/templates/workDisplay.js +123 -103
- package/resources/templates/workSelect.js +4 -4
- package/resources/utils/IntlURLSearchParams.js +1 -1
- package/resources/utils/Languages.js +3 -1
- package/resources/utils/Metadata.js +22 -21
- package/resources/utils/Plugin.js +4 -4
- package/resources/utils/ServiceWorker.js +7 -11
- package/resources/utils/WorkInfo.js +4 -4
- package/resources/utils/dialogs.js +2 -1
- package/resources/utils/getLocaleFallbackResults.js +3 -3
- package/resources/utils/sanitize.js +3 -3
- package/resources/workDisplay.js +13 -14
- package/resources/workSelect.js +3 -2
- package/server/main.js +6 -4
- package/dist/index-umd.js +0 -18864
- package/dist/index-umd.min.js +0 -19
- /package/dist/assets/{index-c987c995.css → index-_11XnUty.css} +0 -0
- /package/dist/assets/{languages-fcf1c836.json → languages-1sAACTKG.json} +0 -0
package/resources/workDisplay.js
CHANGED
|
@@ -31,15 +31,15 @@ export default async function workDisplay ({
|
|
|
31
31
|
);
|
|
32
32
|
|
|
33
33
|
async function _displayWork ({
|
|
34
|
-
workI18n, metadataObj, getFieldAliasOrName,
|
|
34
|
+
workI18n, metadataObj, getFieldAliasOrName, schemaItems, // schemaObj,
|
|
35
35
|
fieldInfo, metadata, pluginsForWork, groupsToWorks
|
|
36
36
|
}) {
|
|
37
37
|
const lParam = localizeParamNames
|
|
38
|
-
? key => l(['params', key])
|
|
39
|
-
: key => key;
|
|
38
|
+
? (key) => l(['params', key])
|
|
39
|
+
: (key) => key;
|
|
40
40
|
const lIndexedParam = localizeParamNames
|
|
41
|
-
? key => l(['params', 'indexed', key])
|
|
42
|
-
: key => key;
|
|
41
|
+
? (key) => l(['params', 'indexed', key])
|
|
42
|
+
: (key) => key;
|
|
43
43
|
|
|
44
44
|
// Returns element with localized option text (as Jamilih), with
|
|
45
45
|
// optional fallback direction
|
|
@@ -56,15 +56,14 @@ export default async function workDisplay ({
|
|
|
56
56
|
};
|
|
57
57
|
|
|
58
58
|
// Returns plain text node or element (as Jamilih) with fallback direction
|
|
59
|
-
const lDirectional = (key, substitutions) =>
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
);
|
|
59
|
+
const lDirectional = (key, substitutions) => l(
|
|
60
|
+
key,
|
|
61
|
+
substitutions
|
|
62
|
+
// formats
|
|
63
|
+
// Restore if `intl-dom` supports
|
|
64
|
+
// fallback: ({message}) =>
|
|
65
|
+
// Templates.workDisplay.bdo({fallbackDirection, message})
|
|
66
|
+
);
|
|
68
67
|
|
|
69
68
|
const fieldMatchesLocale = metadata.getFieldMatchesLocale({
|
|
70
69
|
namespace: this.namespace,
|
package/resources/workSelect.js
CHANGED
|
@@ -19,8 +19,9 @@ export default async function workSelect ({
|
|
|
19
19
|
const metadataObjs = await getJSON(works.groups.reduce((arr, fileGroup) => {
|
|
20
20
|
const metadataBaseDir = (works.metadataBaseDirectory || '') +
|
|
21
21
|
(fileGroup.metadataBaseDirectory || '') + '/';
|
|
22
|
-
return fileGroup.files.reduce((ar, fileData) =>
|
|
23
|
-
|
|
22
|
+
return fileGroup.files.reduce((ar, fileData) => [
|
|
23
|
+
...ar, metadataBaseDir + fileData.metadataFile
|
|
24
|
+
],
|
|
24
25
|
arr);
|
|
25
26
|
}, []));
|
|
26
27
|
|
package/server/main.js
CHANGED
|
@@ -7,7 +7,7 @@ import statik from '@brettz9/node-static';
|
|
|
7
7
|
import fetch from 'node-fetch';
|
|
8
8
|
import commandLineArgs from 'command-line-args';
|
|
9
9
|
import DOMParser from 'dom-parser';
|
|
10
|
-
import setGlobalVars from 'indexeddbshim/dist/indexeddbshim-UnicodeIdentifiers-node.
|
|
10
|
+
import setGlobalVars from 'indexeddbshim/dist/indexeddbshim-UnicodeIdentifiers-node.cjs';
|
|
11
11
|
import {getJSON} from 'simple-get-json';
|
|
12
12
|
import {setFetch} from 'intl-dom';
|
|
13
13
|
|
|
@@ -138,9 +138,11 @@ const srv = http.createServer(async (req, res) => {
|
|
|
138
138
|
res,
|
|
139
139
|
// For express, we'll first give a chance to other static servers
|
|
140
140
|
// they might supply
|
|
141
|
-
userParams.expressServer
|
|
142
|
-
|
|
143
|
-
|
|
141
|
+
userParams.expressServer
|
|
142
|
+
? () => {
|
|
143
|
+
// Empty
|
|
144
|
+
}
|
|
145
|
+
: next
|
|
144
146
|
);
|
|
145
147
|
};
|
|
146
148
|
if (userParams.expressServer) {
|