textbrowser 0.54.0 → 0.54.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.
Files changed (91) hide show
  1. package/CHANGES.md +8 -0
  2. package/dist/WorkInfo-es.js +172 -355
  3. package/dist/activateCallback-es.js +0 -1
  4. package/dist/index-es.js +3294 -3414
  5. package/dist/index-es.min.js +4 -4
  6. package/eslint.config.js +2 -2
  7. package/package.json +44 -38
  8. package/resources/activateCallback.js +0 -1
  9. package/resources/index.js +0 -1
  10. package/resources/resultsDisplay.js +1 -9
  11. package/resources/templates/workDisplay.js +0 -1
  12. package/resources/utils/Plugin.js +2 -5
  13. package/resources/utils/WorkInfo.js +7 -15
  14. package/resources/workDisplay.js +0 -1
  15. package/resources/workSelect.js +0 -1
  16. package/server/main.js +15 -7
  17. package/sw-sample.js +0 -2
  18. package/tsconfig.json +2 -1
  19. package/dist/assets/index-_11XnUty.css +0 -9
  20. package/dist/assets/languages-1sAACTKG.json +0 -67
  21. package/dist/dist/WorkInfo-es.d.ts +0 -331
  22. package/dist/dist/WorkInfo-es.d.ts.map +0 -1
  23. package/dist/dist/activateCallback-es.d.ts +0 -17
  24. package/dist/dist/activateCallback-es.d.ts.map +0 -1
  25. package/dist/dist/index-es.d.ts +0 -619
  26. package/dist/dist/index-es.d.ts.map +0 -1
  27. package/dist/dist/sw-helper.d.ts +0 -3
  28. package/dist/dist/sw-helper.d.ts.map +0 -1
  29. package/dist/eslint.config.d.ts +0 -126
  30. package/dist/eslint.config.d.ts.map +0 -1
  31. package/dist/resources/activateCallback.d.ts +0 -23
  32. package/dist/resources/activateCallback.d.ts.map +0 -1
  33. package/dist/resources/index.d.ts +0 -128
  34. package/dist/resources/index.d.ts.map +0 -1
  35. package/dist/resources/resultsDisplay.d.ts +0 -110
  36. package/dist/resources/resultsDisplay.d.ts.map +0 -1
  37. package/dist/resources/templates/index.d.ts +0 -59
  38. package/dist/resources/templates/index.d.ts.map +0 -1
  39. package/dist/resources/templates/languageSelect.d.ts +0 -18
  40. package/dist/resources/templates/languageSelect.d.ts.map +0 -1
  41. package/dist/resources/templates/resultsDisplayClient.d.ts +0 -26
  42. package/dist/resources/templates/resultsDisplayClient.d.ts.map +0 -1
  43. package/dist/resources/templates/resultsDisplayServerOrClient.d.ts +0 -131
  44. package/dist/resources/templates/resultsDisplayServerOrClient.d.ts.map +0 -1
  45. package/dist/resources/templates/utils/dom.d.ts +0 -15
  46. package/dist/resources/templates/utils/dom.d.ts.map +0 -1
  47. package/dist/resources/templates/utils/html.d.ts +0 -3
  48. package/dist/resources/templates/utils/html.d.ts.map +0 -1
  49. package/dist/resources/templates/workDisplay.d.ts +0 -183
  50. package/dist/resources/templates/workDisplay.d.ts.map +0 -1
  51. package/dist/resources/templates/workSelect.d.ts +0 -18
  52. package/dist/resources/templates/workSelect.d.ts.map +0 -1
  53. package/dist/resources/user-sample.d.ts +0 -2
  54. package/dist/resources/user-sample.d.ts.map +0 -1
  55. package/dist/resources/user.d.ts +0 -2
  56. package/dist/resources/user.d.ts.map +0 -1
  57. package/dist/resources/utils/IntlURLSearchParams.d.ts +0 -56
  58. package/dist/resources/utils/IntlURLSearchParams.d.ts.map +0 -1
  59. package/dist/resources/utils/Languages.d.ts +0 -81
  60. package/dist/resources/utils/Languages.d.ts.map +0 -1
  61. package/dist/resources/utils/Metadata.d.ts +0 -133
  62. package/dist/resources/utils/Metadata.d.ts.map +0 -1
  63. package/dist/resources/utils/Params.d.ts +0 -30
  64. package/dist/resources/utils/Params.d.ts.map +0 -1
  65. package/dist/resources/utils/Plugin.d.ts +0 -278
  66. package/dist/resources/utils/Plugin.d.ts.map +0 -1
  67. package/dist/resources/utils/ServiceWorker.d.ts +0 -26
  68. package/dist/resources/utils/ServiceWorker.d.ts.map +0 -1
  69. package/dist/resources/utils/WorkInfo.d.ts +0 -104
  70. package/dist/resources/utils/WorkInfo.d.ts.map +0 -1
  71. package/dist/resources/utils/dialogs.d.ts +0 -155
  72. package/dist/resources/utils/dialogs.d.ts.map +0 -1
  73. package/dist/resources/utils/getLocaleFallbackResults.d.ts +0 -19
  74. package/dist/resources/utils/getLocaleFallbackResults.d.ts.map +0 -1
  75. package/dist/resources/utils/sanitize.d.ts +0 -6
  76. package/dist/resources/utils/sanitize.d.ts.map +0 -1
  77. package/dist/resources/vendor/json-refs-min.d.ts +0 -3
  78. package/dist/resources/vendor/json-refs-min.d.ts.map +0 -1
  79. package/dist/resources/workDisplay.d.ts +0 -81
  80. package/dist/resources/workDisplay.d.ts.map +0 -1
  81. package/dist/resources/workSelect.d.ts +0 -17
  82. package/dist/resources/workSelect.d.ts.map +0 -1
  83. package/dist/rollup.config.d.ts +0 -19
  84. package/dist/rollup.config.d.ts.map +0 -1
  85. package/dist/server/main.d.ts +0 -47
  86. package/dist/server/main.d.ts.map +0 -1
  87. package/dist/sw-helper.d.ts +0 -3
  88. package/dist/sw-helper.d.ts.map +0 -1
  89. package/dist/sw-helper.js +0 -355
  90. package/dist/sw-sample.d.ts +0 -2
  91. package/dist/sw-sample.d.ts.map +0 -1
package/eslint.config.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import ashNazg from 'eslint-config-ash-nazg';
2
2
 
3
- export default [
3
+ export default /** @type {import('eslint').Linter.Config} */ ([
4
4
  {
5
5
  ignores: [
6
6
  'resources/vendor',
@@ -66,4 +66,4 @@ export default [
66
66
  'unicorn/no-array-callback-reference': 0
67
67
  }
68
68
  }
69
- ];
69
+ ]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "textbrowser",
3
- "version": "0.54.0",
3
+ "version": "0.54.2",
4
4
  "description": "Multilinear text browser",
5
5
  "type": "module",
6
6
  "main": "dist/index-es.min.js",
@@ -14,6 +14,19 @@
14
14
  "bin": {
15
15
  "textbrowser": "./server/main.js"
16
16
  },
17
+ "scripts": {
18
+ "tsc": "tsc",
19
+ "server": "./server/main.js --allowPlugins --namespace=test",
20
+ "start": "static -p 8081",
21
+ "rollup": "rollup -c",
22
+ "lint": "npm run eslint",
23
+ "eslint": "eslint .",
24
+ "mocha": "node_modules/.bin/_mocha --require test/bootstrap/node.js --require chai/register-assert.js test/textbrowserTests.js",
25
+ "node": "npm run eslint && npm run rollup && npm run mocha",
26
+ "open-test": "open-cli http://127.0.0.1:8081/test/",
27
+ "start-open-test": "run-p start open-test",
28
+ "test": "npm run eslint && npm run rollup && npm run start-open-test"
29
+ },
17
30
  "browserslist": [
18
31
  "defaults, not op_mini all"
19
32
  ],
@@ -35,62 +48,55 @@
35
48
  "text"
36
49
  ],
37
50
  "dependencies": {
38
- "@babel/core": "^7.28.4",
39
- "command-line-args": "^6.0.1",
51
+ "@babel/core": "^7.29.0",
52
+ "command-line-args": "^6.0.2",
40
53
  "dom-parser": "^1.1.5",
41
54
  "form-serialization": "^0.11.0",
42
55
  "indexeddbshim": "^12.0.0",
43
56
  "intl-dom": "^0.20.0",
44
57
  "intl-locale-textinfo-polyfill": "^3.0.0",
45
- "jamilih": "0.60.0",
46
- "jsdom": "^27.0.0",
58
+ "jamilih": "0.63.1",
59
+ "jsdom": "^29.1.1",
47
60
  "json-refs": "^3.0.15",
48
- "load-stylesheets": "0.12.5",
61
+ "load-stylesheets": "0.13.0",
49
62
  "node-fetch": "^3.3.2",
50
- "serve-static": "^2.2.0",
51
- "simple-get-json": "^10.0.0"
63
+ "serve-static": "^2.2.1",
64
+ "simple-get-json": "^11.0.0"
52
65
  },
53
66
  "devDependencies": {
54
67
  "@babel/plugin-syntax-dynamic-import": "^7.8.3",
55
- "@babel/preset-env": "^7.28.3",
56
- "@rollup/plugin-babel": "^6.0.4",
57
- "@rollup/plugin-commonjs": "^28.0.6",
68
+ "@babel/preset-env": "^7.29.2",
69
+ "@rollup/plugin-babel": "^7.1.0",
70
+ "@rollup/plugin-commonjs": "^29.0.3",
58
71
  "@rollup/plugin-json": "^6.1.0",
59
- "@rollup/plugin-node-resolve": "^16.0.1",
60
- "@rollup/plugin-terser": "^0.4.4",
72
+ "@rollup/plugin-node-resolve": "^16.0.3",
73
+ "@rollup/plugin-terser": "^1.0.0",
61
74
  "@stadtlandnetz/rollup-plugin-postprocess": "^1.1.0",
62
- "@types/chai": "^5.2.2",
63
- "@types/express": "^5.0.3",
75
+ "@types/chai": "^5.2.3",
76
+ "@types/express": "^5.0.6",
64
77
  "@types/json-schema": "^7.0.15",
65
78
  "@types/mocha": "^10.0.10",
66
- "@types/node": "^24.6.2",
67
- "@web/rollup-plugin-import-meta-assets": "^2.3.0",
68
- "ajv": "8.17.1",
79
+ "@types/node": "^26.1.0",
80
+ "@web/rollup-plugin-import-meta-assets": "^2.3.3",
81
+ "ajv": "8.20.0",
69
82
  "babel-plugin-dynamic-import-node": "^2.3.3",
70
- "chai": "^6.2.0",
71
- "eslint": "^9.37.0",
72
- "eslint-config-ash-nazg": "^39.5.0",
83
+ "chai": "^6.2.2",
84
+ "eslint": "^9.39.4",
85
+ "eslint-config-ash-nazg": "^39.11.1",
73
86
  "json-metaschema": "1.3.0",
74
87
  "json-schema": "^0.4.0",
75
- "mocha": "^11.7.4",
88
+ "mocha": "^11.7.6",
76
89
  "npm-run-all": "^4.1.5",
77
- "open-cli": "^8.0.0",
78
- "rollup": "^4.52.4",
90
+ "open-cli": "^9.0.0",
91
+ "rollup": "^4.62.2",
79
92
  "rollup-plugin-re": "^1.0.7",
80
93
  "textbrowser-data-schemas": "^0.2.0",
81
- "typescript": "^5.9.3"
94
+ "typescript": "^6.0.3"
82
95
  },
83
- "scripts": {
84
- "tsc": "tsc",
85
- "server": "./server/main.js --allowPlugins --namespace=test",
86
- "start": "static -p 8081",
87
- "rollup": "rollup -c",
88
- "lint": "npm run eslint",
89
- "eslint": "eslint .",
90
- "mocha": "node_modules/.bin/_mocha --require test/bootstrap/node.js --require chai/register-assert.js test/textbrowserTests.js",
91
- "node": "npm run eslint && npm run rollup && npm run mocha",
92
- "open-test": "open-cli http://127.0.0.1:8081/test/",
93
- "start-open-test": "run-p start open-test",
94
- "test": "npm run eslint && npm run rollup && npm run start-open-test"
96
+ "allowScripts": {
97
+ "fsevents@2.3.2": true,
98
+ "canvas@2.11.2": true,
99
+ "sqlite3@5.1.7": true,
100
+ "unrs-resolver@1.11.1": true
95
101
  }
96
- }
102
+ }
@@ -2,7 +2,6 @@
2
2
  * @file Note that this should be kept as a polyglot client-server file
3
3
  * (besides the server, it is to be invoked by the project service worker).
4
4
  */
5
- /* eslint-env worker -- Worker environment */
6
5
 
7
6
  /**
8
7
  * @typedef {import('./utils/Metadata.js')} MetadataFile
@@ -391,7 +391,6 @@ class TextBrowser {
391
391
  return language in localizationStrings;
392
392
  });
393
393
  return {
394
- // eslint-disable-next-line object-shorthand -- TS
395
394
  locale: /** @type {string} */ (locale),
396
395
  strings: {
397
396
  head: {},
@@ -211,8 +211,8 @@ export const resultsDisplayClient = async function resultsDisplayClient (args) {
211
211
  };
212
212
 
213
213
  /**
214
- * @this {import('../server/main.js').ResultsDisplayServerContext}
215
214
  * This is server-only code, but kept here as the function is similar.
215
+ * @this {import('../server/main.js').ResultsDisplayServerContext}
216
216
  * @param {ResultsDisplayServerOrClientArg & {
217
217
  * serverOutput?: "jamilih"|"html"|"json"|null
218
218
  * }} args
@@ -563,7 +563,6 @@ export const resultsDisplayServerOrClient = async function resultsDisplayServerO
563
563
  return undefined;
564
564
  }
565
565
  const {preferAlias, fieldValueAliasMap} = getFieldNameAndValueAliases({
566
- // eslint-disable-next-line object-shorthand -- TS
567
566
  field: /** @type {string} */ (field),
568
567
  schemaItems, metadataObj, getFieldAliasOrName, lang
569
568
  });
@@ -746,7 +745,6 @@ export const resultsDisplayServerOrClient = async function resultsDisplayServerO
746
745
  );
747
746
  if (plugin.getTargetLanguage) {
748
747
  targetLanguage = plugin.getTargetLanguage({
749
- // eslint-disable-next-line object-shorthand -- TS
750
748
  applicableField: /** @type {string} */ (applicableField),
751
749
  targetLanguage,
752
750
  // Default lang for plug-in (from files.json)
@@ -773,13 +771,10 @@ export const resultsDisplayServerOrClient = async function resultsDisplayServerO
773
771
  ? plugin.getFieldAliasOrName({
774
772
  locales: lang,
775
773
  workI18n,
776
- // eslint-disable-next-line object-shorthand -- TS
777
774
  targetLanguage: /** @type {string} */ (targetLanguage),
778
- // eslint-disable-next-line object-shorthand -- TS
779
775
  applicableField: /** @type {string} */ (applicableField),
780
776
  applicableFieldI18N,
781
777
  meta,
782
- // eslint-disable-next-line object-shorthand -- TS
783
778
  metaApplicableField: /** @type {{[key: string]: string }} */ (
784
779
  metaApplicableField
785
780
  ),
@@ -791,13 +786,10 @@ export const resultsDisplayServerOrClient = async function resultsDisplayServerO
791
786
  pluginName,
792
787
  // locales: lang,
793
788
  workI18n,
794
- // eslint-disable-next-line object-shorthand -- TS
795
789
  targetLanguage: /** @type {string} */ (targetLanguage),
796
- // eslint-disable-next-line object-shorthand -- TS
797
790
  applicableFieldI18N: /** @type {string|string[]} */ (applicableFieldI18N),
798
791
  // Todo: Should have formal way to i18nize meta
799
792
  meta,
800
- // eslint-disable-next-line object-shorthand -- TS
801
793
  metaApplicableField: /** @type {{[key: string]: string }} */ (
802
794
  metaApplicableField
803
795
  )
@@ -1027,7 +1027,6 @@ export default {
1027
1027
  // workI18n,
1028
1028
  paramsSetter, replaceHash,
1029
1029
  getFieldAliasOrNames,
1030
- // eslint-disable-next-line object-shorthand -- TS
1031
1030
  work: /** @type {string} */ (work),
1032
1031
  langs,
1033
1032
  languageI18n,
@@ -120,11 +120,8 @@ export const escapePlugin = ({pluginName, applicableField, targetLanguage}) => {
120
120
  * onByDefault: boolean,
121
121
  * meta: {
122
122
  * [key: string]: string
123
- * },
124
- * [args: string]: {}
123
+ * }
125
124
  * }
126
- * },
127
- * [fieldArgs: string]: {
128
125
  * }
129
126
  * }} PluginFieldMappingForWork
130
127
  */
@@ -169,7 +166,7 @@ export class PluginsForWork {
169
166
  * pluginName: string,
170
167
  * pluginLang: string,
171
168
  * onByDefaultDefault: boolean,
172
- * meta: {}
169
+ * meta: MetaValue
173
170
  * }) => void} cb
174
171
  * @returns {void}
175
172
  */
@@ -61,7 +61,9 @@ import {PluginsForWork, escapePlugin} from './Plugin.js';
61
61
  * INCOMPLETE typing.
62
62
  * @typedef {{
63
63
  * "localization-strings": {
64
- * [key: string]: {}
64
+ * [key: string]: {
65
+ * [key: string]: string
66
+ * }
65
67
  * }
66
68
  * groups: FileGroup[],
67
69
  * plugins: {[key: string]: import('./Plugin.js').PluginInfo},
@@ -167,7 +169,9 @@ export const getWorkData = async function ({
167
169
  /**
168
170
  * @type {{
169
171
  * "localization-strings": {
170
- * [key: string]: {}
172
+ * [key: string]: {
173
+ * [key: string]: string
174
+ * }
171
175
  * }
172
176
  * }}
173
177
  */ (
@@ -189,7 +193,6 @@ export const getWorkData = async function ({
189
193
  return language in localizationStrings;
190
194
  });
191
195
  return {
192
- // eslint-disable-next-line object-shorthand -- TS
193
196
  locale: /** @type {string} */ (locale),
194
197
  strings: {
195
198
  head: {},
@@ -309,7 +312,7 @@ export const getWorkData = async function ({
309
312
  getPlugins
310
313
  ? Promise.all(
311
314
  pluginPaths.map(async (pluginPath) => {
312
- // // eslint-disable-next-line no-unsanitized/method
315
+ // eslint-disable-next-line no-unsanitized/method -- Through trusted plugins
313
316
  return /** @type {import('./Plugin.js').PluginObject} */ await (import(
314
317
  cwd +
315
318
  pluginPath
@@ -373,22 +376,18 @@ export const getWorkData = async function ({
373
376
  );
374
377
  if (plugin.getTargetLanguage) {
375
378
  targetLanguage = plugin.getTargetLanguage({
376
- // eslint-disable-next-line object-shorthand -- TS
377
379
  applicableField: /** @type {string} */ (applicableField),
378
- // eslint-disable-next-line object-shorthand -- TS
379
380
  targetLanguage: /** @type {string} */ (targetLanguage),
380
381
  // Default lang for plug-in (from files.json)
381
382
  pluginLang,
382
383
  // Default lang when no target language or
383
384
  // plugin lang; using the lang of the applicable
384
385
  // field
385
- // eslint-disable-next-line object-shorthand -- TS
386
386
  applicableFieldLang: /** @type {string} */ (applicableFieldLang)
387
387
  });
388
388
  }
389
389
  const field = escapePlugin({
390
390
  pluginName,
391
- // eslint-disable-next-line object-shorthand -- TS
392
391
  applicableField: /** @type {string} */ (applicableField),
393
392
  targetLanguage: /** @type {string} */ (targetLanguage || pluginLang ||
394
393
  applicableFieldLang)
@@ -403,13 +402,10 @@ export const getWorkData = async function ({
403
402
  ? plugin.getFieldAliasOrName({
404
403
  locales: lang,
405
404
  workI18n,
406
- // eslint-disable-next-line object-shorthand -- TS
407
405
  targetLanguage: /** @type {string} */ (targetLanguage),
408
- // eslint-disable-next-line object-shorthand -- TS
409
406
  applicableField: /** @type {string} */ (applicableField),
410
407
  applicableFieldI18N,
411
408
  meta,
412
- // eslint-disable-next-line object-shorthand -- TS
413
409
  metaApplicableField:
414
410
  /**
415
411
  * @type {{
@@ -425,13 +421,10 @@ export const getWorkData = async function ({
425
421
  pluginName,
426
422
  // locales: lang,
427
423
  workI18n,
428
- // eslint-disable-next-line object-shorthand -- TS
429
424
  targetLanguage: /** @type {string} */ (targetLanguage),
430
- // eslint-disable-next-line object-shorthand -- TS
431
425
  applicableFieldI18N: /** @type {string|string[]} */ (applicableFieldI18N),
432
426
  // Todo: Should have formal way to i18nize meta
433
427
  meta,
434
- // eslint-disable-next-line object-shorthand -- TS
435
428
  metaApplicableField:
436
429
  /**
437
430
  * @type {{
@@ -470,7 +463,6 @@ export const getWorkData = async function ({
470
463
  }
471
464
  return {
472
465
  // @ts-expect-error Ok
473
- // eslint-disable-next-line object-shorthand -- TS
474
466
  fileData: /** @type {FileData} */ (fileData),
475
467
  workI18n, getFieldAliasOrName, metadataObj,
476
468
  schemaObj, schemaItems, fieldInfo,
@@ -170,7 +170,6 @@ export default async function workDisplay ({
170
170
  const fieldMatchesLocale = metadata.getFieldMatchesLocale({
171
171
  namespace: this.namespace,
172
172
  preferredLocale, schemaItems,
173
- // eslint-disable-next-line object-shorthand -- TS
174
173
  pluginsForWork: /** @type {import('./utils/Plugin.js').PluginsForWork} */ (
175
174
  pluginsForWork
176
175
  )
@@ -52,7 +52,6 @@ export default async function workSelect ({
52
52
  return language in localizationStrings;
53
53
  });
54
54
  return {
55
- // eslint-disable-next-line object-shorthand -- TS
56
55
  locale: /** @type {string} */ (locale),
57
56
  strings: {
58
57
  head: {},
package/server/main.js CHANGED
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- /* eslint-env node -- Environment here */
4
3
  import http from 'node:http';
5
4
 
6
5
  import statik from 'serve-static';
@@ -224,6 +223,7 @@ const srv = http.createServer(async (req, res) => {
224
223
  * @returns {Promise<void>}
225
224
  */
226
225
  const runHttpServer = async function () {
226
+ // eslint-disable-next-line no-unsanitized/method -- CLI
227
227
  const server = (await import(userParams.httpServer)).default();
228
228
  return await server(
229
229
  req,
@@ -239,6 +239,7 @@ const srv = http.createServer(async (req, res) => {
239
239
  };
240
240
  if (userParams.expressServer) {
241
241
  /** @type {import('express').Application} */
242
+ // eslint-disable-next-line no-unsanitized/method -- CLI
242
243
  const app = (await import(userParams.expressServer)).default();
243
244
 
244
245
  if (userParams.httpServer && (!app._router || !app._router.stack.some(
@@ -281,12 +282,19 @@ const srv = http.createServer(async (req, res) => {
281
282
  return;
282
283
  }
283
284
 
284
- // const languages = (req.headers['accept-language']?.replace(/;q=.*$/, '') ?? 'en-US').split(',');
285
- // // eslint-disable-next-line n/no-unsupported-features/node-builtins -- Polyglot reasons
286
- // globalThis.navigator = {
287
- // language: languages[0],
288
- // languages
289
- // };
285
+ // @ts-expect-error Ok
286
+ // eslint-disable-next-line n/no-unsupported-features/node-builtins -- Polyglot reasons
287
+ delete globalThis.navigator;
288
+ const languages = (req.headers['accept-language']?.replace(/;q=.*$/, '') ?? 'en-US').split(',');
289
+ Object.defineProperty(globalThis, 'navigator', {
290
+ value: {
291
+ language: languages[0],
292
+ languages
293
+ },
294
+ writable: true,
295
+ configurable: true,
296
+ enumerable: false
297
+ });
290
298
 
291
299
  const $p = new IntlURLSearchParams({
292
300
  params: search
package/sw-sample.js CHANGED
@@ -1,5 +1,3 @@
1
- /* eslint-env serviceworker -- Service worker */
2
-
3
1
  // eslint-disable-next-line sonarjs/no-internal-api-use -- Demo
4
2
  import swHelper from './node_modules/textbrowser/dist/sw-helper.js';
5
3
 
package/tsconfig.json CHANGED
@@ -11,7 +11,8 @@
11
11
  "strict": true,
12
12
  "skipLibCheck": true,
13
13
  "target": "es2017",
14
- "outDir": "dist"
14
+ "outDir": "dist",
15
+ "types": ["mocha"]
15
16
  },
16
17
  "include": [
17
18
  "*.js",
@@ -1,9 +0,0 @@
1
- html, body {
2
- height: 100%;
3
- }
4
- .focus {
5
- text-align: center;
6
- }
7
- input[type="number"] {
8
- width: 70px;
9
- }
@@ -1,67 +0,0 @@
1
- {
2
- "localeFileBasePath": "node_modules/textbrowser/locales/",
3
- "localization-strings": {
4
- "en-US": {
5
- "chooselanguage": "Your interface language",
6
- "all-langs": "All languages",
7
- "languages": {
8
- "en-US": "English",
9
- "ar": "Arabic",
10
- "fa": "Persian",
11
- "ru": "Russian"
12
- }
13
- },
14
- "fa": {
15
- "chooselanguage": "زبان انتخاب شده",
16
- "all-langs": "All languages",
17
- "languages": {
18
- "en-US": "English",
19
- "ar": "Arabic",
20
- "fa": "فارسي",
21
- "ru": "Russian"
22
- }
23
- },
24
- "ar": {
25
- "chooselanguage": "لغتك",
26
- "all-langs": "All languages",
27
- "languages": {
28
- "en-US": "English",
29
- "ar": "عربي",
30
- "fa": "Persian",
31
- "ru": "Russian"
32
- }
33
- },
34
- "ru": {
35
- "chooselanguage": "Your interface language",
36
- "all-langs": "Все языки",
37
- "languages": {
38
- "en-US": "Английский",
39
- "ar": "Arabic",
40
- "fa": "Persian",
41
- "ru": "русский"
42
- }
43
- }
44
- },
45
- "languages": [
46
- {
47
- "code": "en-US",
48
- "direction": "ltr",
49
- "locale": {"$ref": "../locales/en-US.json"}
50
- },
51
- {
52
- "code": "fa",
53
- "direction": "rtl",
54
- "locale": {"$ref": "../locales/fa.json"}
55
- },
56
- {
57
- "code": "ar",
58
- "direction": "rtl",
59
- "locale": {"$ref": "../locales/ar.json"}
60
- },
61
- {
62
- "code": "ru",
63
- "direction": "ltr",
64
- "locale": {"$ref": "../locales/ru.json"}
65
- }
66
- ]
67
- }