textbrowser 0.45.2 → 0.46.1
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 -0
- package/CHANGES.md +13 -0
- package/README.md +19 -15
- package/dist/WorkInfo-es.js +2118 -3640
- package/dist/index-es.js +11279 -12611
- package/dist/index-es.min.js +11 -16
- package/locales/ar.json +211 -209
- package/locales/en-US.json +212 -209
- package/locales/fa.json +211 -209
- package/locales/ru.json +211 -209
- package/package.json +45 -46
- package/resources/index.js +72 -50
- package/resources/resultsDisplay.js +40 -30
- package/resources/templates/index.js +133 -120
- package/resources/templates/resultsDisplayClient.js +2 -0
- package/resources/templates/workDisplay.js +195 -174
- package/resources/templates/workSelect.js +7 -7
- package/resources/user-sample.js +0 -2
- package/resources/user.js +0 -2
- package/resources/utils/IntlURLSearchParams.js +1 -1
- package/resources/utils/Languages.js +9 -4
- package/resources/utils/Metadata.js +13 -8
- package/resources/utils/Params.js +11 -9
- package/resources/utils/Plugin.js +4 -4
- package/resources/utils/WorkInfo.js +28 -13
- package/resources/utils/dialogs.js +8 -6
- package/resources/utils/getLocaleFallbackResults.js +26 -0
- package/resources/vendor/json-refs-min.js +15 -0
- package/resources/workDisplay.js +52 -46
- package/resources/workSelect.js +44 -23
- package/server/main.js +40 -32
- package/sw-sample.js +1 -1
- package/resources/utils/getIMFFallbackResults.js +0 -47
package/.eslintrc.cjs
CHANGED
package/CHANGES.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# CHANGES to `textbrowser`
|
|
2
2
|
|
|
3
|
+
## 0.46.1
|
|
4
|
+
|
|
5
|
+
- fix: regression with live data
|
|
6
|
+
|
|
7
|
+
## 0.46.0
|
|
8
|
+
|
|
9
|
+
- BREAKING chore: require Node 14.19.1+
|
|
10
|
+
- feat: routine to utilize updated `json-refs`
|
|
11
|
+
- feat: `imf` -> `intl-dom`
|
|
12
|
+
- refactor: linting/TS fixes
|
|
13
|
+
- chore: update babel/core, indexeddbshim, jsdom, babel/core deps.
|
|
14
|
+
- chore: update devDeps.
|
|
15
|
+
|
|
3
16
|
## 0.45.2
|
|
4
17
|
|
|
5
18
|
- fix: issue with `next`
|
package/README.md
CHANGED
|
@@ -6,7 +6,9 @@ potentially intimidating to those unfamiliar with how to work it. There are
|
|
|
6
6
|
also some bugs to iron out such as with localization.*
|
|
7
7
|
|
|
8
8
|
See the [web app within an app using TextBrowser](https://bahai-browser.org/)
|
|
9
|
-
or see some videos [introducing the app](https://bahai-library.com/zamir_textbrowser_bahaiwritings_browser).
|
|
9
|
+
or see some videos [introducing the app](https://bahai-library.com/zamir_textbrowser_bahaiwritings_browser). For use with [shortcuts](https://bahai-library.com/zamir_efficient_searches_shortcuts),
|
|
10
|
+
see the [video](https://bahai-library.com/zamir/shortcuts/Efficient-Searches-and-Shortcuts-5-SD-480p.webm)
|
|
11
|
+
at 5:25.
|
|
10
12
|
|
|
11
13
|
*TextBrowser* supports power-user browsing of arbitrary multi-linear
|
|
12
14
|
texts following the "offline first" motto.
|
|
@@ -567,7 +569,7 @@ methods.
|
|
|
567
569
|
the plug-in (from `files.json`). `applicableFieldLang` is the default
|
|
568
570
|
lang when there is no target language or plugin lang; it is the `lang`
|
|
569
571
|
of the applicable field.
|
|
570
|
-
- `getFieldAliasOrName({locales,
|
|
572
|
+
- `getFieldAliasOrName({locales, workI18n, targetLanguage, applicableField, applicableFieldI18N, meta, metaApplicableField, targetLanguageI18N})` -
|
|
571
573
|
Called for each plug-in (after `getTargetLanguage`). Sets the `fieldInfo`
|
|
572
574
|
`fieldAliasOrName` which is used for labeling the field. Besides
|
|
573
575
|
properties shared with other methods, `getFieldAliasOrName` is passed
|
|
@@ -575,8 +577,8 @@ methods.
|
|
|
575
577
|
- `locales` - The app `lang` array (URL-specified `lang` languages or
|
|
576
578
|
fallback-specified ones from `navigator.languages` that are
|
|
577
579
|
supported by the app)
|
|
578
|
-
- `
|
|
579
|
-
on `files.json` locale strings.
|
|
580
|
+
- `workI18n` - An [intl-dom](https://github.com/brettz9/intl-dom) locale
|
|
581
|
+
formatter based on `files.json` locale strings.
|
|
580
582
|
- `applicableFieldI18N` - The localized metadata `fieldnames` `applicableField`
|
|
581
583
|
- `targetLanguageI18N` - The localized name of `targetLanguage`
|
|
582
584
|
- `targetLanguage` - The result of `getTargetLanguage` (or the
|
|
@@ -745,9 +747,6 @@ it supports the following arguments:
|
|
|
745
747
|
|
|
746
748
|
## To-dos (Highest priority)
|
|
747
749
|
|
|
748
|
-
1. Document and add **screen-casts** along with one for developers showing
|
|
749
|
-
JSON format, metadata, and schemas); also use with shortcuts (including
|
|
750
|
-
Bahá'í Library Online ones)
|
|
751
750
|
1. Progressive web app? / Electron?
|
|
752
751
|
1. Adapt approach of <https://suttacentral.net/offline> in providing form for
|
|
753
752
|
choice of items to offline (also add to individual work pages).
|
|
@@ -758,15 +757,15 @@ it supports the following arguments:
|
|
|
758
757
|
1. Also have `&checked1=Yes` omitted when generating results display
|
|
759
758
|
(since now defaulting to this)
|
|
760
759
|
1. Drop unused fields in URL by default
|
|
761
|
-
1. Switch from IMF i18n to [intl-dom](https://github.com/brettz9/intl-dom) and
|
|
762
|
-
as needed [i18nizeElement](https://github.com/brettz9/i18nizeElement)
|
|
763
760
|
1. Ensure works with `pnpm` in all environments (didn't work when deployed,
|
|
764
761
|
but would need to recall the problem and resolve)
|
|
765
|
-
1.
|
|
766
|
-
to localize language names (and can avoid direction if
|
|
762
|
+
1. Waiting: Avoid `rtl-detect` if
|
|
767
763
|
[intl-locale-info proposal](https://github.com/tc39/proposal-intl-locale-info)
|
|
768
|
-
|
|
769
|
-
|
|
764
|
+
gets implemented)
|
|
765
|
+
1. [`navigator.storage.estimate`](https://developers.google.com/web/updates/2017/08/estimating-available-storage-space)
|
|
766
|
+
1. Consider using `Intl.DisplayNames` (`type: 'language'`) with plugins so
|
|
767
|
+
can, e.g., show language visibly into which a targeted content language
|
|
768
|
+
field was translated? Avoid need for `languages.json` codes and directions?
|
|
770
769
|
1. For plugins, allow export of `stylesheets` array to add to
|
|
771
770
|
`loadStylesheets`, so they don't have to do the importing and executing.
|
|
772
771
|
1. **Progress meter** with hidden console to avoid intimidating loading
|
|
@@ -1120,8 +1119,13 @@ it supports the following arguments:
|
|
|
1120
1119
|
|
|
1121
1120
|
## To-dos (Lower priority)
|
|
1122
1121
|
|
|
1123
|
-
1.
|
|
1124
|
-
|
|
1122
|
+
1. Use or publish [rollup-plugin-postprocess](git+https://github.com/brettz9/rollup-plugin-postprocess.git#update)
|
|
1123
|
+
as stable version?
|
|
1124
|
+
1. Check if still getting superagent warning:
|
|
1125
|
+
<https://github.com/whitlockjc/path-loader/issues/17> (if `json-refs` can
|
|
1126
|
+
be updated to stable version)
|
|
1127
|
+
1. Use [i18nizeElement](https://github.com/brettz9/i18nizeElement)? (probably
|
|
1128
|
+
not as need RTL detection for more than setting on element)
|
|
1125
1129
|
1. **Remember columns enabled**, etc. since last visit, and/or saved as
|
|
1126
1130
|
preferences.
|
|
1127
1131
|
1. Allow copy-pasting a search as a custom web protocol (make
|