unicode-input-toolconverter 0.2.0 → 0.2.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.
Files changed (143) hide show
  1. package/.nyc_output/out.json +8980 -1849
  2. package/CHANGES.md +15 -1
  3. package/README.md +6 -11
  4. package/_locales/en-US/messages.json +153 -6
  5. package/_locales/hu-HU/messages.json +153 -6
  6. package/_locales/pt-BR/messages.json +153 -6
  7. package/_locales/sv-SE/messages.json +153 -6
  8. package/babel.config.json +0 -1
  9. package/browser_action/characterSelection.js +18 -11
  10. package/browser_action/charrefConverters.js +286 -79
  11. package/browser_action/chartBuild.js +97 -27
  12. package/browser_action/encodingBehaviors.js +10 -7
  13. package/browser_action/entityBehaviors.js +42 -16
  14. package/browser_action/index-es.html +13 -1
  15. package/browser_action/index-instrumented.html +13 -1
  16. package/browser_action/index-pages.html +13 -1
  17. package/browser_action/index.html +13 -1
  18. package/browser_action/index.iife.min.js +9 -1
  19. package/browser_action/index.iife.min.js.map +1 -1
  20. package/browser_action/index.instrumented.iife.min.js +1 -1
  21. package/browser_action/index.instrumented.iife.min.js.map +1 -1
  22. package/browser_action/index.js +5 -5
  23. package/browser_action/preferences/prefDefaults.js +12 -3
  24. package/browser_action/service-worker/sw-activateCallback.js +1 -2
  25. package/browser_action/service-worker/sw-resources.json +6 -4
  26. package/browser_action/templateUtils/elements.js +12 -1
  27. package/browser_action/templateUtils/fill.js +6 -0
  28. package/browser_action/templateUtils/validation.js +4 -1
  29. package/browser_action/templates/chartBuild.js +167 -102
  30. package/browser_action/templates/index.js +227 -53
  31. package/browser_action/templatesElementCustomization/widgets.js +40 -15
  32. package/browser_action/unicode/UnicodeConverter.js +99 -73
  33. package/browser_action/unicode/charrefunicodeDb.js +100 -50
  34. package/browser_action/unicode/getScriptInfoForCodePoint.js +13 -4
  35. package/browser_action/unicode/hangul.js +27 -20
  36. package/browser_action/unicode/lastScriptNames.json +1 -1
  37. package/browser_action/unicode/parseUnihanFromTextFileStrings.js +44 -25
  38. package/browser_action/unicode/unicodeFieldInfo.js +112 -90
  39. package/browser_action/unicode/unicodeScripts.js +409 -35
  40. package/browser_action/unicode/unihan.js +4 -3
  41. package/browser_action/unicode/unihanDbPopulate.js +7 -2
  42. package/browser_action/unicode/unihanFields.js +34 -0
  43. package/browser_action/unicodecharref.js +353 -190
  44. package/browser_action/utils/DOMUtils.js +95 -34
  45. package/browser_action/utils/FetchUtils.js +7 -6
  46. package/browser_action/utils/TextUtils.js +4 -4
  47. package/browser_action/utils/TypedArrayUtils.js +9 -5
  48. package/browser_action/utils/semicolonSeparatedToArray.js +3 -3
  49. package/browser_action/utils/setupServiceWorker.js +2 -2
  50. package/eslint.config.js +11 -0
  51. package/icons/openWindow16.png +0 -0
  52. package/icons/openWindow24.png +0 -0
  53. package/lib/background.html +7 -0
  54. package/lib/background.js +2 -2
  55. package/package.json +80 -70
  56. package/pnpm-workspace.yaml +8 -0
  57. package/server.js +66 -51
  58. package/sw.js +97 -56
  59. package/tools/entities-import.js +4 -1
  60. package/tools/findEsResources.js +33 -10
  61. package/tools/fix-sw-resources-vendor-paths.js +60 -0
  62. package/tools/list-locales.js +2 -2
  63. package/tools/parseUnicodeCharts.js +126 -60
  64. package/tools/ucd-import.js +1 -10
  65. package/tools/unicode-charts.html +49 -20
  66. package/tools/unihan-import.js +45 -15
  67. package/tools/write-sw-version.js +16 -0
  68. package/tsconfig.json +23 -0
  69. package/typings/__coverage__.d.ts +5 -0
  70. package/typings/apple-system-profiler.d.ts +17 -0
  71. package/typings/commands.d.ts +19 -0
  72. package/typings/json-6.d.ts +4 -0
  73. package/typings/rollup-plugin-istanbul.d.ts +3 -0
  74. package/vendor/camelcase/index.d.ts +154 -0
  75. package/vendor/camelcase/index.js +137 -23
  76. package/vendor/fflate/esm/browser.d.ts +1539 -0
  77. package/vendor/fflate/esm/browser.js +82 -55
  78. package/vendor/intl-dom/dist/Formatter.d.ts +120 -0
  79. package/vendor/intl-dom/dist/Formatter.d.ts.map +1 -0
  80. package/vendor/intl-dom/dist/collation.d.ts +42 -0
  81. package/vendor/intl-dom/dist/collation.d.ts.map +1 -0
  82. package/vendor/intl-dom/dist/defaultAllSubstitutions.d.ts +52 -0
  83. package/vendor/intl-dom/dist/defaultAllSubstitutions.d.ts.map +1 -0
  84. package/vendor/intl-dom/dist/defaultInsertNodes.d.ts +96 -0
  85. package/vendor/intl-dom/dist/defaultInsertNodes.d.ts.map +1 -0
  86. package/vendor/intl-dom/dist/defaultKeyCheckerConverter.d.ts +17 -0
  87. package/vendor/intl-dom/dist/defaultKeyCheckerConverter.d.ts.map +1 -0
  88. package/vendor/intl-dom/dist/defaultLocaleResolver.d.ts +285 -0
  89. package/vendor/intl-dom/dist/defaultLocaleResolver.d.ts.map +1 -0
  90. package/vendor/intl-dom/dist/findLocaleStrings.d.ts +88 -0
  91. package/vendor/intl-dom/dist/findLocaleStrings.d.ts.map +1 -0
  92. package/vendor/intl-dom/dist/getDOMForLocaleString.d.ts +67 -0
  93. package/vendor/intl-dom/dist/getDOMForLocaleString.d.ts.map +1 -0
  94. package/vendor/intl-dom/dist/getMessageForKeyByStyle.d.ts +73 -0
  95. package/vendor/intl-dom/dist/getMessageForKeyByStyle.d.ts.map +1 -0
  96. package/vendor/intl-dom/dist/getStringFromMessageAndDefaults.d.ts +26 -0
  97. package/vendor/intl-dom/dist/getStringFromMessageAndDefaults.d.ts.map +1 -0
  98. package/vendor/intl-dom/dist/i18n.d.ts +113 -0
  99. package/vendor/intl-dom/dist/i18n.d.ts.map +1 -0
  100. package/vendor/intl-dom/dist/index.d.ts +92 -0
  101. package/vendor/intl-dom/dist/index.d.ts.map +1 -0
  102. package/vendor/intl-dom/dist/index.esm.d.ts +34 -0
  103. package/vendor/intl-dom/dist/index.esm.js +854 -896
  104. package/vendor/intl-dom/dist/index.esm.min.js +4 -0
  105. package/vendor/intl-dom/dist/index.esm.min.js.map +1 -0
  106. package/vendor/intl-dom/dist/index.umd.js +2953 -0
  107. package/vendor/intl-dom/dist/index.umd.min.js +4 -0
  108. package/vendor/intl-dom/dist/index.umd.min.js.map +1 -0
  109. package/vendor/intl-dom/dist/promiseChainForValues.d.ts +34 -0
  110. package/vendor/intl-dom/dist/promiseChainForValues.d.ts.map +1 -0
  111. package/vendor/intl-dom/dist/shared.d.ts +20 -0
  112. package/vendor/intl-dom/dist/shared.d.ts.map +1 -0
  113. package/vendor/intl-dom/dist/utils.d.ts +53 -0
  114. package/vendor/intl-dom/dist/utils.d.ts.map +1 -0
  115. package/vendor/jamilih/dist/jml.d.mts +468 -0
  116. package/vendor/jamilih/dist/{jml-es.js → jml.mjs} +1489 -343
  117. package/vendor/jquery/dist/jquery.js +1677 -2713
  118. package/vendor/json-6/dist/index.mjs +2 -0
  119. package/vendor/miller-columns/CHANGES.md +185 -0
  120. package/vendor/miller-columns/LICENSE-MIT.txt +21 -0
  121. package/vendor/miller-columns/README.md +249 -0
  122. package/vendor/miller-columns/demos/index.html +69 -0
  123. package/vendor/miller-columns/demos/index.js +72 -0
  124. package/vendor/miller-columns/dist/index-es.js +748 -0
  125. package/vendor/miller-columns/dist/index-es.min.d.ts +25 -0
  126. package/vendor/miller-columns/dist/index-es.min.js +7 -1
  127. package/vendor/miller-columns/dist/index-umd.js +757 -0
  128. package/vendor/miller-columns/dist/index-umd.min.js +7 -0
  129. package/vendor/miller-columns/dist/index.d.ts +25 -0
  130. package/vendor/miller-columns/dist/millerColumns.d.ts +10 -0
  131. package/vendor/miller-columns/eslint.config.js +46 -0
  132. package/vendor/miller-columns/fix-declarations.js +18 -0
  133. package/vendor/miller-columns/miller-columns.css +24 -1
  134. package/vendor/miller-columns/package.json +73 -0
  135. package/vendor/miller-columns/pnpm-workspace.yaml +2 -0
  136. package/vendor/miller-columns/src/index.js +642 -0
  137. package/vendor/miller-columns/src/millerColumns.ts +12 -0
  138. package/vendor/miller-columns/tsconfig-prod.json +23 -0
  139. package/vendor/miller-columns/tsconfig.json +21 -0
  140. package/vendor/simple-prefs/dist/index.esm.d.ts +1 -0
  141. package/vendor/simple-prefs/dist/index.esm.js +164 -216
  142. package/vendor/simple-prefs/dist/simple-prefs.d.ts +117 -0
  143. package/lgtm.yml +0 -5
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable camelcase -- i18n */
2
- import {jml, body, $, $$, nbsp} from '../../vendor/jamilih/dist/jml-es.js';
2
+ import {jml, body, $, $$, nbsp} from 'jamilih/dist/jml.js';
3
3
  import {fill} from '../templateUtils/fill.js';
4
4
  import {safeLink} from '../templateUtils/validation.js';
5
5
  // import encodings from '../encodings.js';
@@ -8,13 +8,21 @@ import unicodecharref from '../unicodecharref.js';
8
8
  import CharrefConverterBridges from '../charrefConverters.js';
9
9
  import {registerDTD} from '../entityBehaviors.js';
10
10
 
11
+ /**
12
+ * @param {{
13
+ * _: import('intl-dom').I18NCallback<string>,
14
+ * fonts: string[]
15
+ * }} cfg
16
+ */
11
17
  const indexTemplate = function ({_, fonts}) {
12
- $('html').lang = _.resolvedLocale;
18
+ /** @type {HTMLHtmlElement} */
19
+ ($('html')).lang = _.resolvedLocale;
13
20
  document.title = _('uresults_title');
14
21
  jml('div', {
15
22
  role: 'main'
16
23
  }, [
17
- ['div', {
24
+ /** @type {import('jamilih/dist/jml.js').JamilihArray} */
25
+ (['div', {
18
26
  id: 'unicodeTabBox',
19
27
  style: 'width: 700px;',
20
28
  class: 'tabbox'
@@ -59,10 +67,14 @@ const indexTemplate = function ({_, fonts}) {
59
67
  class: 'searchBox',
60
68
  $on: {
61
69
  async change () {
62
- await unicodecharref.startset(this);
70
+ await unicodecharref.startset(
71
+ /** @type {HTMLInputElement} */ (this)
72
+ );
63
73
  },
64
74
  async input () {
65
- await unicodecharref.startset(this);
75
+ await unicodecharref.startset(
76
+ /** @type {HTMLInputElement} */ (this)
77
+ );
66
78
  }
67
79
  }
68
80
  }],
@@ -71,10 +83,16 @@ const indexTemplate = function ({_, fonts}) {
71
83
  class: 'searchBox',
72
84
  $on: {
73
85
  async change () {
74
- await unicodecharref.searchUnicode(this);
86
+ await unicodecharref.searchUnicode(
87
+ /** @type {HTMLInputElement} */
88
+ (this)
89
+ );
75
90
  },
76
91
  async input () {
77
- await unicodecharref.searchUnicode(this);
92
+ await unicodecharref.searchUnicode(
93
+ /** @type {HTMLInputElement} */
94
+ (this)
95
+ );
78
96
  }
79
97
  }
80
98
  }],
@@ -83,10 +101,16 @@ const indexTemplate = function ({_, fonts}) {
83
101
  class: 'searchBox',
84
102
  $on: {
85
103
  change () {
86
- unicodecharref.searchUnihan(this);
104
+ unicodecharref.searchUnihan(
105
+ /** @type {HTMLInputElement} */
106
+ (this)
107
+ );
87
108
  },
88
109
  input () {
89
- unicodecharref.searchUnihan(this);
110
+ unicodecharref.searchUnihan(
111
+ /** @type {HTMLInputElement} */
112
+ (this)
113
+ );
90
114
  }
91
115
  }
92
116
  }]
@@ -177,7 +201,12 @@ const indexTemplate = function ({_, fonts}) {
177
201
  class: 'charthbox',
178
202
  $on: {
179
203
  async click (e) {
180
- await unicodecharref.onlyentsyesflip(e);
204
+ await unicodecharref.onlyentsyesflip(
205
+ /**
206
+ * @type {Event & {target: HTMLInputElement}}
207
+ */
208
+ (e)
209
+ );
181
210
  }
182
211
  }
183
212
  }],
@@ -192,7 +221,12 @@ const indexTemplate = function ({_, fonts}) {
192
221
  id: 'rowsset',
193
222
  $on: {
194
223
  async change (e) {
195
- await unicodecharref.rowsset(e);
224
+ await unicodecharref.rowsset(
225
+ /**
226
+ * @type {Event & {target: HTMLInputElement}}
227
+ */
228
+ (e)
229
+ );
196
230
  }
197
231
  }
198
232
  }]
@@ -204,7 +238,12 @@ const indexTemplate = function ({_, fonts}) {
204
238
  id: 'colsset',
205
239
  $on: {
206
240
  async change (e) {
207
- await unicodecharref.colsset(e);
241
+ await unicodecharref.colsset(
242
+ /**
243
+ * @type {Event & {target: HTMLInputElement}}
244
+ */
245
+ (e)
246
+ );
208
247
  }
209
248
  }
210
249
  }]
@@ -218,7 +257,12 @@ const indexTemplate = function ({_, fonts}) {
218
257
  class: 'charthbox',
219
258
  $on: {
220
259
  async click (e) {
221
- await unicodecharref.entflip(e);
260
+ await unicodecharref.entflip(
261
+ /**
262
+ * @type {Event & {target: HTMLInputElement}}
263
+ */
264
+ (e)
265
+ );
222
266
  }
223
267
  }
224
268
  }],
@@ -232,7 +276,12 @@ const indexTemplate = function ({_, fonts}) {
232
276
  class: 'charthbox',
233
277
  $on: {
234
278
  async click (e) {
235
- await unicodecharref.decflip(e);
279
+ await unicodecharref.decflip(
280
+ /**
281
+ * @type {Event & {target: HTMLInputElement}}
282
+ */
283
+ (e)
284
+ );
236
285
  }
237
286
  }
238
287
  }],
@@ -246,7 +295,12 @@ const indexTemplate = function ({_, fonts}) {
246
295
  class: 'charthbox',
247
296
  $on: {
248
297
  async click (e) {
249
- await unicodecharref.hexflip(e);
298
+ await unicodecharref.hexflip(
299
+ /**
300
+ * @type {Event & {target: HTMLInputElement}}
301
+ */
302
+ (e)
303
+ );
250
304
  }
251
305
  }
252
306
  }],
@@ -260,7 +314,12 @@ const indexTemplate = function ({_, fonts}) {
260
314
  class: 'charthbox',
261
315
  $on: {
262
316
  async click (e) {
263
- await unicodecharref.unicodeflip(e);
317
+ await unicodecharref.unicodeflip(
318
+ /**
319
+ * @type {Event & {target: HTMLInputElement}}
320
+ */
321
+ (e)
322
+ );
264
323
  }
265
324
  }
266
325
  }],
@@ -275,7 +334,12 @@ const indexTemplate = function ({_, fonts}) {
275
334
  class: 'charthbox',
276
335
  $on: {
277
336
  async click (e) {
278
- await unicodecharref.middleflip(e);
337
+ await unicodecharref.middleflip(
338
+ /**
339
+ * @type {Event & {target: HTMLInputElement}}
340
+ */
341
+ (e)
342
+ );
279
343
  }
280
344
  }
281
345
  }],
@@ -289,7 +353,12 @@ const indexTemplate = function ({_, fonts}) {
289
353
  class: 'charthbox',
290
354
  $on: {
291
355
  async click (e) {
292
- await unicodecharref.buttonflip(e);
356
+ await unicodecharref.buttonflip(
357
+ /**
358
+ * @type {Event & {target: HTMLInputElement}}
359
+ */
360
+ (e)
361
+ );
293
362
  }
294
363
  }
295
364
  }],
@@ -301,7 +370,7 @@ const indexTemplate = function ({_, fonts}) {
301
370
  nbsp.repeat(2),
302
371
  ['button', {class: 'fontsize', $on: {
303
372
  click () {
304
- unicodecharref.tblfontsize(+1);
373
+ unicodecharref.tblfontsize(1);
305
374
  }
306
375
  }}, [_('plus')]],
307
376
  nbsp,
@@ -321,8 +390,12 @@ const indexTemplate = function ({_, fonts}) {
321
390
  id: 'font',
322
391
  size: '12',
323
392
  $custom: {
393
+ /**
394
+ * @param {string} val
395
+ */
324
396
  $setFontFamily (val) {
325
- $('#insertText').style.fontFamily = val;
397
+ /** @type {HTMLTextAreaElement} */
398
+ ($('#insertText')).style.fontFamily = val;
326
399
  // Form elements don't inherit, so find these
327
400
  // manually
328
401
  $$('#chart_table button[name="unicode"]').
@@ -333,8 +406,21 @@ const indexTemplate = function ({_, fonts}) {
333
406
  },
334
407
  $on: {
335
408
  async change (e) {
336
- await unicodecharref.setprefs(e);
337
- this.$setFontFamily(this.value);
409
+ await unicodecharref.setprefs(
410
+ /**
411
+ * @type {Event & {target: HTMLInputElement}}
412
+ */
413
+ (e)
414
+ );
415
+ /**
416
+ * @type {HTMLInputElement & {
417
+ * $setFontFamily: (val: string) => void
418
+ * }}
419
+ */
420
+ (this).$setFontFamily(
421
+ /** @type {HTMLInputElement} */
422
+ (this).value
423
+ );
338
424
  }
339
425
  }
340
426
  }],
@@ -342,8 +428,20 @@ const indexTemplate = function ({_, fonts}) {
342
428
  ? [
343
429
  ['br'],
344
430
  ['select', {id: 'font-list', $on: {
431
+ /**
432
+ * @this {HTMLSelectElement}
433
+ */
345
434
  async change () {
346
- $('#font').value = this.value;
435
+ const font =
436
+ /**
437
+ * @type {HTMLInputElement & {
438
+ * $setFontFamily: (val: string) => void
439
+ * }}
440
+ */ (
441
+ $('#font')
442
+ );
443
+ font.value =
444
+ (this).value;
347
445
  await unicodecharref.setprefs({
348
446
  target: {
349
447
  type: 'select-one',
@@ -351,7 +449,7 @@ const indexTemplate = function ({_, fonts}) {
351
449
  value: this.value
352
450
  }
353
451
  });
354
- $('#font').$setFontFamily(this.value);
452
+ font.$setFontFamily(this.value);
355
453
  }
356
454
  }}, [
357
455
  ['option', [
@@ -377,9 +475,19 @@ const indexTemplate = function ({_, fonts}) {
377
475
  id: 'lang',
378
476
  size: '5',
379
477
  $on: {
478
+ /**
479
+ * @this {HTMLInputElement}
480
+ * @param {Event} e
481
+ */
380
482
  async change (e) {
381
- await unicodecharref.setprefs(e);
382
- $('#chart_table').lang = this.value;
483
+ await unicodecharref.setprefs(
484
+ /**
485
+ * @type {Event & {target: HTMLInputElement}}
486
+ */
487
+ (e)
488
+ );
489
+ /** @type {HTMLElement} */
490
+ ($('#chart_table')).lang = this.value;
383
491
  }
384
492
  }
385
493
  }]
@@ -436,7 +544,12 @@ const indexTemplate = function ({_, fonts}) {
436
544
  type: 'checkbox',
437
545
  $on: {
438
546
  async click (e) {
439
- await unicodecharref.setImagePref(e);
547
+ await unicodecharref.setImagePref(
548
+ /**
549
+ * @type {Event & {target: HTMLInputElement}}
550
+ */
551
+ (e)
552
+ );
440
553
  }
441
554
  }
442
555
  }],
@@ -472,7 +585,8 @@ const indexTemplate = function ({_, fonts}) {
472
585
  ['div', [
473
586
  ['button', {id: 'clearoutput', $on: {
474
587
  click () {
475
- $('#insertText').value = '';
588
+ /** @type {HTMLTextAreaElement} */
589
+ ($('#insertText')).value = '';
476
590
  }
477
591
  }}, [
478
592
  _('button_clearoutput')
@@ -533,7 +647,12 @@ const indexTemplate = function ({_, fonts}) {
533
647
  id: 'showAllDetailedView',
534
648
  $on: {
535
649
  async click (e) {
536
- await unicodecharref.setprefs(e);
650
+ await unicodecharref.setprefs(
651
+ /**
652
+ * @type {Event & {target: HTMLInputElement}}
653
+ */
654
+ (e)
655
+ );
537
656
  }
538
657
  }
539
658
  }],
@@ -570,9 +689,9 @@ const indexTemplate = function ({_, fonts}) {
570
689
  _(key),
571
690
  nbsp.repeat(2),
572
691
  [
573
- key.includes('case_Mapping') ||
574
- key === 'decompositionMapping' ||
575
- key === 'numericType'
692
+ key === 'decompositionMapping' ||
693
+ key === 'numericType' ||
694
+ key.includes('case_Mapping')
576
695
  ? 'span'
577
696
  : 'input',
578
697
  {
@@ -599,7 +718,12 @@ const indexTemplate = function ({_, fonts}) {
599
718
  id: 'showAllDetailedCJKView',
600
719
  $on: {
601
720
  async click (e) {
602
- await unicodecharref.setprefs(e);
721
+ await unicodecharref.setprefs(
722
+ /**
723
+ * @type {Event & {target: HTMLInputElement}}
724
+ */
725
+ (e)
726
+ );
603
727
  }
604
728
  }
605
729
  }],
@@ -823,7 +947,7 @@ const indexTemplate = function ({_, fonts}) {
823
947
  nbsp.repeat(2),
824
948
  ['button', {class: 'fontsize', $on: {
825
949
  click () {
826
- unicodecharref.fontsizetextbox(+1);
950
+ unicodecharref.fontsizetextbox(1);
827
951
  }
828
952
  }}, [
829
953
  _('plus')
@@ -875,7 +999,7 @@ const indexTemplate = function ({_, fonts}) {
875
999
  hidden: true
876
1000
  }, [
877
1001
  ['label', [
878
- ['progressmeter', {id: 'progress_element'}]
1002
+ ['progress', {id: 'progress_element'}]
879
1003
  ]],
880
1004
  ['button', {
881
1005
  id: 'closeDownloadProgressBox',
@@ -896,9 +1020,7 @@ const indexTemplate = function ({_, fonts}) {
896
1020
  const url = new URL(location.href);
897
1021
  navigator.registerProtocolHandler(
898
1022
  'web+unicode',
899
- url.protocol + '://' + url.host + url.pathname + '?customProtocol=%s',
900
- // Deprecated title arg but required for some browsers
901
- 'Unicode'
1023
+ url.protocol + '://' + url.host + url.pathname + '?customProtocol=%s'
902
1024
  );
903
1025
  }
904
1026
  }}, [
@@ -910,7 +1032,12 @@ const indexTemplate = function ({_, fonts}) {
910
1032
  _('initialTab_label'), nbsp.repeat(3),
911
1033
  ['select', {id: 'initialTab', $on: {
912
1034
  async change (e) {
913
- await unicodecharref.setprefs(e);
1035
+ await unicodecharref.setprefs(
1036
+ /**
1037
+ * @type {Event & {target: HTMLInputElement}}
1038
+ */
1039
+ (e)
1040
+ );
914
1041
  }
915
1042
  }}, [
916
1043
  ['option', {
@@ -942,7 +1069,12 @@ const indexTemplate = function ({_, fonts}) {
942
1069
  class: 'topofpanel',
943
1070
  $on: {
944
1071
  async click (e) {
945
- await unicodecharref.hexLettersCasing(e);
1072
+ await unicodecharref.hexLettersCasing(
1073
+ /**
1074
+ * @type {Event & {target: HTMLInputElement}}
1075
+ */
1076
+ (e)
1077
+ );
946
1078
  }
947
1079
  }
948
1080
  }],
@@ -956,7 +1088,12 @@ const indexTemplate = function ({_, fonts}) {
956
1088
  id: 'asciiLt128',
957
1089
  $on: {
958
1090
  async click (e) {
959
- await unicodecharref.setprefs(e);
1091
+ await unicodecharref.setprefs(
1092
+ /**
1093
+ * @type {Event & {target: HTMLInputElement}}
1094
+ */
1095
+ (e)
1096
+ );
960
1097
  }
961
1098
  }
962
1099
  }],
@@ -971,7 +1108,12 @@ const indexTemplate = function ({_, fonts}) {
971
1108
  class: 'topofpanel',
972
1109
  $on: {
973
1110
  async click (e) {
974
- await unicodecharref.setprefs(e);
1111
+ await unicodecharref.setprefs(
1112
+ /**
1113
+ * @type {Event & {target: HTMLInputElement}}
1114
+ */
1115
+ (e)
1116
+ );
975
1117
  }
976
1118
  }
977
1119
  }],
@@ -986,7 +1128,12 @@ const indexTemplate = function ({_, fonts}) {
986
1128
  class: 'topofpanel',
987
1129
  $on: {
988
1130
  async click (e) {
989
- await unicodecharref.setprefs(e);
1131
+ await unicodecharref.setprefs(
1132
+ /**
1133
+ * @type {Event & {target: HTMLInputElement}}
1134
+ */
1135
+ (e)
1136
+ );
990
1137
  }
991
1138
  }
992
1139
  }],
@@ -1001,7 +1148,12 @@ const indexTemplate = function ({_, fonts}) {
1001
1148
  class: 'topofpanel',
1002
1149
  $on: {
1003
1150
  async click (e) {
1004
- await unicodecharref.setprefs(e);
1151
+ await unicodecharref.setprefs(
1152
+ /**
1153
+ * @type {Event & {target: HTMLInputElement}}
1154
+ */
1155
+ (e)
1156
+ );
1005
1157
  }
1006
1158
  }
1007
1159
  }],
@@ -1016,7 +1168,12 @@ const indexTemplate = function ({_, fonts}) {
1016
1168
  class: 'topofpanel',
1017
1169
  $on: {
1018
1170
  async click (e) {
1019
- await unicodecharref.setprefs(e);
1171
+ await unicodecharref.setprefs(
1172
+ /**
1173
+ * @type {Event & {target: HTMLInputElement}}
1174
+ */
1175
+ (e)
1176
+ );
1020
1177
  }
1021
1178
  }
1022
1179
  }],
@@ -1049,7 +1206,12 @@ const indexTemplate = function ({_, fonts}) {
1049
1206
  class: 'topofpanel',
1050
1207
  $on: {
1051
1208
  async click (e) {
1052
- await unicodecharref.setprefs(e);
1209
+ await unicodecharref.setprefs(
1210
+ /**
1211
+ * @type {Event & {target: HTMLInputElement}}
1212
+ */
1213
+ (e)
1214
+ );
1053
1215
  }
1054
1216
  }
1055
1217
  }],
@@ -1062,7 +1224,12 @@ const indexTemplate = function ({_, fonts}) {
1062
1224
  id: 'CSSWhitespace',
1063
1225
  $on: {
1064
1226
  async change (e) {
1065
- await unicodecharref.cssWhitespace(e);
1227
+ await unicodecharref.cssWhitespace(
1228
+ /**
1229
+ * @type {Event & {target: HTMLInputElement}}
1230
+ */
1231
+ (e)
1232
+ );
1066
1233
  }
1067
1234
  }
1068
1235
  }, [
@@ -1192,7 +1359,7 @@ const indexTemplate = function ({_, fonts}) {
1192
1359
  ]],
1193
1360
  ['div', {style: 'text-align: center; margin-top: 10px;'}, [
1194
1361
  ['button', {class: 'dtdbutton', $on: {click () {
1195
- unicodecharref.insertent('DTDtextbox');
1362
+ unicodecharref.insertent();
1196
1363
  }}}, [
1197
1364
  _('DTD_insertent')
1198
1365
  ]]
@@ -1203,7 +1370,12 @@ const indexTemplate = function ({_, fonts}) {
1203
1370
  type: 'checkbox',
1204
1371
  $on: {
1205
1372
  async click (e) {
1206
- await unicodecharref.append2htmlflip(e);
1373
+ await unicodecharref.append2htmlflip(
1374
+ /**
1375
+ * @type {Event & {target: HTMLInputElement}}
1376
+ */
1377
+ (e)
1378
+ );
1207
1379
  }
1208
1380
  }
1209
1381
  }],
@@ -1281,7 +1453,7 @@ const indexTemplate = function ({_, fonts}) {
1281
1453
  About_ial_onetongue_link: jml('a', {
1282
1454
  class: 'text-link',
1283
1455
  target: '_blank',
1284
- href: 'http://onetongue.com'
1456
+ href: 'https://onetongue.com'
1285
1457
  }, [
1286
1458
  _('About_ial_onetongue_linkText')
1287
1459
  ])
@@ -1289,14 +1461,16 @@ const indexTemplate = function ({_, fonts}) {
1289
1461
  ]]
1290
1462
  ]]
1291
1463
  ]]
1292
- ]]
1464
+ ]])
1293
1465
  ], body);
1294
1466
 
1295
1467
  // See why intl-dom not apparently keeping event handlers
1296
- $('#donationbutton').addEventListener('click', () => {
1468
+ /** @type {HTMLButtonElement} */
1469
+ ($('#donationbutton')).addEventListener('click', () => {
1297
1470
  window.open(
1298
1471
  'https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=brettz9%40yahoo%2ecom&no_shipping=0&no_note=1&tax=0&currency_code=USD&bn=PP%2dDonationsBF&charset=UTF%2d8',
1299
- 'bzamirdonation'
1472
+ 'bzamirdonation',
1473
+ 'noopener'
1300
1474
  );
1301
1475
  });
1302
1476
  };
@@ -1,31 +1,51 @@
1
- import {jml, $$} from '../../vendor/jamilih/dist/jml-es.js';
1
+ import {jml, $$} from 'jamilih/dist/jml.js';
2
2
 
3
+ /**
4
+ * @typedef {HTMLElement & {
5
+ * $getTabs: () => HTMLElement[],
6
+ * $getTabPanels: () => HTMLElement[],
7
+ * $selectTabForTabPanel: (tabPanel: HTMLDivElement) => void
8
+ * $selectTab: (tab: Element) => void,
9
+ * $selectedTab: () => HTMLElement
10
+ * }} TabBox
11
+ */
12
+
13
+ /**
14
+ * @param {string} sel The selector
15
+ */
3
16
  export const makeTabBox = function (sel) {
4
- $$(sel).forEach(function (tabbox) {
17
+ /**
18
+ * @type {TabBox[]}
19
+ */
20
+ ($$(sel)).forEach(function (tabbox) {
5
21
  tabbox.$getTabs = function () {
6
- return [...this.querySelector('.tabs').children].filter((child) => {
22
+ return /** @type {HTMLElement[]} */ ([...(/** @type {HTMLElement} */ (
23
+ this.querySelector('.tabs')
24
+ )).children].filter((child) => {
7
25
  return child.classList.contains('tab');
8
- });
26
+ }));
9
27
  };
10
28
  tabbox.$getTabPanels = function () {
11
- return [...this.children].filter((tabPanel) => {
12
- return tabPanel.classList.contains('tabpanel');
13
- });
29
+ return /** @type {HTMLElement[]} */ (
30
+ [...this.children].filter((tabPanel) => {
31
+ return tabPanel.classList.contains('tabpanel');
32
+ })
33
+ );
14
34
  };
15
35
  tabbox.$selectTabForTabPanel = function (tabPanel) {
16
36
  const tabs = tabbox.$getTabs();
17
37
  const tab = tabs.find((tb) => {
18
38
  return tb.dataset.label === tabPanel.dataset.label;
19
39
  });
20
- return tabbox.$selectTab(tab);
40
+ tabbox.$selectTab(/** @type {Element} */ (tab));
21
41
  };
22
42
  tabbox.$selectTab = function (tab) {
23
43
  const tabs = tabbox.$getTabs();
24
44
  tabbox.$getTabPanels().forEach((tabPanel, i) => {
25
45
  const childTab = tabs[i];
26
46
  if (tab === childTab) {
27
- childTab.dataset.selected = true;
28
- tabPanel.dataset.selected = true;
47
+ childTab.dataset.selected = 'true';
48
+ tabPanel.dataset.selected = 'true';
29
49
  } else {
30
50
  delete childTab.dataset.selected;
31
51
  delete tabPanel.dataset.selected;
@@ -33,11 +53,14 @@ export const makeTabBox = function (sel) {
33
53
  });
34
54
  };
35
55
  tabbox.$selectedTab = function (/* tab */) {
36
- return tabbox.$getTabPanels().find(({dataset: {selected}}) => {
37
- return selected;
38
- });
56
+ return /** @type {HTMLElement} */ (
57
+ tabbox.$getTabPanels().find(({dataset: {selected}}) => {
58
+ return selected;
59
+ })
60
+ );
39
61
  };
40
- tabbox.querySelector('.tabs').prepend(...tabbox.$getTabPanels().map(({
62
+ /** @type {HTMLElement} */
63
+ (tabbox.querySelector('.tabs')).prepend(...tabbox.$getTabPanels().map(({
41
64
  dataset: {title, selected, label}
42
65
  }) => {
43
66
  // Set to h1 for accessibility, though styles will reduce default size
@@ -50,7 +73,9 @@ export const makeTabBox = function (sel) {
50
73
  tabbox.$selectTab(this);
51
74
  }
52
75
  }
53
- }, [label]);
76
+ }, [
77
+ /** @type {string} */ (label)
78
+ ]);
54
79
  }), jml('br', {style: 'clear: left;'}));
55
80
  });
56
81
  };