textbrowser 0.46.2 → 0.47.0-beta.0
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/.eslintignore +1 -1
- package/.eslintrc.cjs +2 -2
- package/CHANGES.md +9 -0
- package/README.md +18 -151
- package/dist/WorkInfo-es.js +49 -24
- package/dist/index-es.js +49 -24
- package/dist/index-es.min.js +2 -2
- package/files.json +11 -11
- package/general-schemas/files.jsonschema +2 -2
- package/general-schemas/languages.jsonschema +2 -2
- package/general-schemas/site.jsonschema +1 -1
- package/package.json +9 -8
- package/sw-sample.js +5 -4
- package/general-schemas/array-of-arrays.jsonschema +0 -17
- package/general-schemas/locale.jsonschema +0 -22
- package/general-schemas/metadata.jsonschema +0 -148
- package/general-schemas/table-container.jsonschema +0 -15
- package/general-schemas/table.jsonschema +0 -57
package/files.json
CHANGED
|
@@ -240,16 +240,16 @@
|
|
|
240
240
|
"schemaBaseDirectory": "data/writings/schemas",
|
|
241
241
|
"metadataBaseDirectory": "data/writings/metadata",
|
|
242
242
|
"files": [
|
|
243
|
-
{"name": "aqdas", "file": {"$ref": "data/writings/aqdas.json"}, "schemaFile": "aqdas.jsonschema", "metadataFile": "aqdas.metadata"},
|
|
244
|
-
{"name": "bible", "file": {"$ref": "data/writings/Bible.json"}, "schemaFile": "Bible.jsonschema", "metadataFile": "Bible.metadata"},
|
|
245
|
-
{"name": "epistle_to_the_son_of_the_wolf", "file": {"$ref": "data/writings/Epistle to the Son of the Wolf.json"}, "schemaFile": "Epistle to the Son of the Wolf.jsonschema", "metadataFile": "Epistle to the Son of the Wolf.metadata"},
|
|
246
|
-
{"name": "gems_of_divine_mysteries", "file": {"$ref": "data/writings/Gems of Divine Mysteries.json"}, "schemaFile": "Gems of Divine Mysteries.jsonschema", "metadataFile": "Gems of Divine Mysteries.metadata"},
|
|
247
|
-
{"name": "gleanings", "file": {"$ref": "data/writings/gleanings.json"}, "schemaFile": "gleanings.jsonschema", "metadataFile": "gleanings.metadata"},
|
|
248
|
-
{"name": "hidden_words", "file": {"$ref": "data/writings/Hidden Words.json"}, "schemaFile": "Hidden Words.jsonschema", "metadataFile": "Hidden Words.metadata"},
|
|
249
|
-
{"name": "peace", "file": {"$ref": "data/writings/peace.json"}, "schemaFile": "peace.jsonschema", "metadataFile": "peace.metadata"},
|
|
250
|
-
{"name": "pm", "file": {"$ref": "data/writings/pm.json"}, "schemaFile": "pm.jsonschema", "metadataFile": "pm.metadata"},
|
|
251
|
-
{"name": "quran", "file": {"$ref": "data/writings/quran.json"}, "schemaFile": "quran.jsonschema", "metadataFile": "quran.metadata"},
|
|
252
|
-
{"name": "wwtf", "file": {"$ref": "data/writings/wwtf.json"}, "schemaFile": "wwtf.jsonschema", "metadataFile": "wwtf.metadata"}
|
|
243
|
+
{"name": "aqdas", "file": {"$ref": "node_modules/bahaiwritings/data/writings/aqdas.json"}, "schemaFile": "aqdas.jsonschema", "metadataFile": "aqdas.metadata"},
|
|
244
|
+
{"name": "bible", "file": {"$ref": "node_modules/bahaiwritings/data/writings/Bible.json"}, "schemaFile": "Bible.jsonschema", "metadataFile": "Bible.metadata"},
|
|
245
|
+
{"name": "epistle_to_the_son_of_the_wolf", "file": {"$ref": "node_modules/bahaiwritings/data/writings/Epistle to the Son of the Wolf.json"}, "schemaFile": "Epistle to the Son of the Wolf.jsonschema", "metadataFile": "Epistle to the Son of the Wolf.metadata"},
|
|
246
|
+
{"name": "gems_of_divine_mysteries", "file": {"$ref": "node_modules/bahaiwritings/data/writings/Gems of Divine Mysteries.json"}, "schemaFile": "Gems of Divine Mysteries.jsonschema", "metadataFile": "Gems of Divine Mysteries.metadata"},
|
|
247
|
+
{"name": "gleanings", "file": {"$ref": "node_modules/bahaiwritings/data/writings/gleanings.json"}, "schemaFile": "gleanings.jsonschema", "metadataFile": "gleanings.metadata"},
|
|
248
|
+
{"name": "hidden_words", "file": {"$ref": "node_modules/bahaiwritings/data/writings/Hidden Words.json"}, "schemaFile": "Hidden Words.jsonschema", "metadataFile": "Hidden Words.metadata"},
|
|
249
|
+
{"name": "peace", "file": {"$ref": "node_modules/bahaiwritings/data/writings/peace.json"}, "schemaFile": "peace.jsonschema", "metadataFile": "peace.metadata"},
|
|
250
|
+
{"name": "pm", "file": {"$ref": "node_modules/bahaiwritings/data/writings/pm.json"}, "schemaFile": "pm.jsonschema", "metadataFile": "pm.metadata"},
|
|
251
|
+
{"name": "quran", "file": {"$ref": "node_modules/bahaiwritings/data/writings/quran.json"}, "schemaFile": "quran.jsonschema", "metadataFile": "quran.metadata"},
|
|
252
|
+
{"name": "wwtf", "file": {"$ref": "node_modules/bahaiwritings/data/writings/wwtf.json"}, "schemaFile": "wwtf.jsonschema", "metadataFile": "wwtf.metadata"}
|
|
253
253
|
]
|
|
254
254
|
},
|
|
255
255
|
{
|
|
@@ -259,7 +259,7 @@
|
|
|
259
259
|
"schemaBaseDirectory": "data/other-works/schemas",
|
|
260
260
|
"metadataBaseDirectory": "data/other-works/metadata",
|
|
261
261
|
"files": [
|
|
262
|
-
{"name": "lights", "file": {"$ref": "data/other-works/lights.json"}, "schemaFile": "lights.jsonschema", "metadataFile": "lights.metadata"}
|
|
262
|
+
{"name": "lights", "file": {"$ref": "node_modules/bahaiwritings/data/other-works/lights.json"}, "schemaFile": "lights.jsonschema", "metadataFile": "lights.metadata"}
|
|
263
263
|
]
|
|
264
264
|
}
|
|
265
265
|
]
|
|
@@ -177,7 +177,7 @@
|
|
|
177
177
|
}
|
|
178
178
|
},
|
|
179
179
|
{
|
|
180
|
-
"$ref": "locale.jsonschema"
|
|
180
|
+
"$ref": "../node_modules/textbrowser-data-schemas/schemas/locale.jsonschema"
|
|
181
181
|
}
|
|
182
182
|
]
|
|
183
183
|
}
|
|
@@ -205,7 +205,7 @@
|
|
|
205
205
|
"type": "object",
|
|
206
206
|
"properties": {
|
|
207
207
|
"file": {
|
|
208
|
-
"$ref": "table-container.jsonschema"
|
|
208
|
+
"$ref": "../node_modules/textbrowser-data-schemas/schemas/table-container.jsonschema"
|
|
209
209
|
},
|
|
210
210
|
"name": {
|
|
211
211
|
"type": "string"
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"type": "string"
|
|
7
7
|
},
|
|
8
8
|
"localization-strings": {
|
|
9
|
-
"$ref": "locale.jsonschema"
|
|
9
|
+
"$ref": "../node_modules/textbrowser-data-schemas/schemas/locale.jsonschema"
|
|
10
10
|
},
|
|
11
11
|
"languages": {
|
|
12
12
|
"type": "array",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"enum": ["ltr", "rtl"]
|
|
25
25
|
},
|
|
26
26
|
"locale": {
|
|
27
|
-
"$ref": "locale.jsonschema"
|
|
27
|
+
"$ref": "../node_modules/textbrowser-data-schemas/schemas/locale.jsonschema"
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "textbrowser",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.47.0-beta.0",
|
|
4
4
|
"description": "Multilinear text browser",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index-es.min.js",
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
"rollup": "rollup -c",
|
|
16
16
|
"lint": "npm run eslint",
|
|
17
17
|
"eslint": "eslint --ext=js,md,html .",
|
|
18
|
-
"
|
|
18
|
+
"mocha": "mocha --require test/bootstrap/node.js --require chai/register-assert.js test/textbrowserTests.js",
|
|
19
|
+
"node": "npm run eslint && npm run rollup && npm run mocha",
|
|
19
20
|
"open-test": "open-cli http://127.0.0.1:8081/test/",
|
|
20
21
|
"start-open-test": "run-p start open-test",
|
|
21
22
|
"test": "npm run eslint && npm run rollup && npm run start-open-test"
|
|
@@ -47,14 +48,14 @@
|
|
|
47
48
|
"dom-parser": "^0.1.6",
|
|
48
49
|
"form-serialization": "^0.11.0",
|
|
49
50
|
"indexeddbshim": "^10.0.0",
|
|
50
|
-
"intl-dom": "^0.
|
|
51
|
+
"intl-dom": "^0.17.0",
|
|
51
52
|
"jamilih": "0.54.0",
|
|
52
|
-
"jsdom": "^20.0.
|
|
53
|
+
"jsdom": "^20.0.3",
|
|
53
54
|
"json-refs": "^3.0.15",
|
|
54
55
|
"load-stylesheets": "0.10.0",
|
|
55
56
|
"node-fetch": "^2.6.6",
|
|
56
57
|
"rtl-detect": "1.0.4",
|
|
57
|
-
"simple-get-json": "^
|
|
58
|
+
"simple-get-json": "^9.0.0"
|
|
58
59
|
},
|
|
59
60
|
"devDependencies": {
|
|
60
61
|
"@babel/eslint-parser": "^7.19.1",
|
|
@@ -71,7 +72,7 @@
|
|
|
71
72
|
"ajv": "8.11.2",
|
|
72
73
|
"babel-plugin-dynamic-import-node": "^2.3.3",
|
|
73
74
|
"chai": "^4.3.7",
|
|
74
|
-
"eslint": "^8.
|
|
75
|
+
"eslint": "^8.28.0",
|
|
75
76
|
"eslint-config-ash-nazg": "^34.4.0",
|
|
76
77
|
"eslint-config-standard": "^17.0.0",
|
|
77
78
|
"eslint-plugin-array-func": "^3.1.7",
|
|
@@ -88,12 +89,12 @@
|
|
|
88
89
|
"eslint-plugin-sonarjs": "^0.16.0",
|
|
89
90
|
"eslint-plugin-standard": "^4.1.0",
|
|
90
91
|
"eslint-plugin-unicorn": "^44.0.2",
|
|
91
|
-
"fast-json-patch": "3.1.1",
|
|
92
92
|
"json-metaschema": "1.3.0",
|
|
93
93
|
"mocha": "^10.1.0",
|
|
94
94
|
"npm-run-all": "^4.1.5",
|
|
95
95
|
"open-cli": "^7.1.0",
|
|
96
96
|
"rollup": "^3.3.0",
|
|
97
|
-
"rollup-plugin-re": "^1.0.7"
|
|
97
|
+
"rollup-plugin-re": "^1.0.7",
|
|
98
|
+
"textbrowser-data-schemas": "^0.2.0"
|
|
98
99
|
}
|
|
99
100
|
}
|
package/sw-sample.js
CHANGED
|
@@ -130,7 +130,8 @@ const defaultUserStaticFiles = [
|
|
|
130
130
|
'files.json',
|
|
131
131
|
'site.json',
|
|
132
132
|
'resources/user.js'
|
|
133
|
-
// We do not put the user.json here as that is obtained live with
|
|
133
|
+
// We do not put the user.json here as that is obtained live with this
|
|
134
|
+
// service worker via `pathToUserJSON`
|
|
134
135
|
];
|
|
135
136
|
// Todo: We could supply `new URL(fileName, moduleURL).href` to
|
|
136
137
|
// get these as reliable full paths without hard-coding or needing to
|
|
@@ -142,9 +143,9 @@ const textbrowserStaticResourceFiles = [
|
|
|
142
143
|
// Only needed atm for browser validation
|
|
143
144
|
'node_modules/textbrowser/general-schemas/files.jsonschema',
|
|
144
145
|
'node_modules/textbrowser/general-schemas/languages.jsonschema',
|
|
145
|
-
'node_modules/textbrowser
|
|
146
|
-
'node_modules/textbrowser
|
|
147
|
-
'node_modules/textbrowser
|
|
146
|
+
'node_modules/textbrowser-data-schemas/schemas/locale.jsonschema',
|
|
147
|
+
'node_modules/textbrowser-data-schemas/schemas/metadata.jsonschema',
|
|
148
|
+
'node_modules/textbrowser-data-schemas/schemas/table.jsonschema', // Not currently using for validation or meta-data
|
|
148
149
|
*/
|
|
149
150
|
|
|
150
151
|
'node_modules/textbrowser/dist/index-es.js'
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/schema#",
|
|
3
|
-
"type": "object",
|
|
4
|
-
"patternProperties": {
|
|
5
|
-
".*": {
|
|
6
|
-
"anyOf": [
|
|
7
|
-
{
|
|
8
|
-
"type": "string"
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
"type": "array",
|
|
12
|
-
"items": {
|
|
13
|
-
"type": "string"
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
"$ref": "#"
|
|
18
|
-
}
|
|
19
|
-
]
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/schema#",
|
|
3
|
-
"type": "object",
|
|
4
|
-
"definitions": {
|
|
5
|
-
"stringOrIntegerType": {
|
|
6
|
-
"anyOf": [
|
|
7
|
-
{"type": "string"},
|
|
8
|
-
{"type": "integer"}
|
|
9
|
-
]
|
|
10
|
-
},
|
|
11
|
-
"nameType": {
|
|
12
|
-
"anyOf": [
|
|
13
|
-
{"type": "string"},
|
|
14
|
-
{
|
|
15
|
-
"type": "object",
|
|
16
|
-
"properties": {
|
|
17
|
-
"localeKey": {
|
|
18
|
-
"type": "string"
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
]
|
|
23
|
-
},
|
|
24
|
-
"nameSet": {
|
|
25
|
-
"type": "object",
|
|
26
|
-
"properties": {
|
|
27
|
-
"name": {
|
|
28
|
-
"type": "string"
|
|
29
|
-
},
|
|
30
|
-
"set": {
|
|
31
|
-
"type": "array",
|
|
32
|
-
"items": {
|
|
33
|
-
"type": "string"
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
"presort": {
|
|
37
|
-
"type": "boolean"
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
"properties": {
|
|
43
|
-
"localization-strings": {
|
|
44
|
-
"$ref": "locale.jsonschema"
|
|
45
|
-
},
|
|
46
|
-
"table": {
|
|
47
|
-
"type": "object",
|
|
48
|
-
"properties": {
|
|
49
|
-
"browse_fields": {
|
|
50
|
-
"oneOf": [
|
|
51
|
-
{
|
|
52
|
-
"type": "array",
|
|
53
|
-
"items": {
|
|
54
|
-
"oneOf": [
|
|
55
|
-
{"type": "string"},
|
|
56
|
-
{
|
|
57
|
-
"$ref": "#/definitions/nameSet"
|
|
58
|
-
}
|
|
59
|
-
]
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
"$ref": "#/definitions/nameSet"
|
|
64
|
-
}
|
|
65
|
-
]
|
|
66
|
-
},
|
|
67
|
-
"default_view": {
|
|
68
|
-
"type": "object",
|
|
69
|
-
"patternProperties": {
|
|
70
|
-
".*": {
|
|
71
|
-
"anyOf": [
|
|
72
|
-
{"$ref": "#/definitions/stringOrIntegerType"},
|
|
73
|
-
{
|
|
74
|
-
"type": "array",
|
|
75
|
-
"items": {"$ref": "#/definitions/stringOrIntegerType"}
|
|
76
|
-
}
|
|
77
|
-
]
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
"fields": {
|
|
84
|
-
"type": "object",
|
|
85
|
-
"patternProperties": {
|
|
86
|
-
".*": {
|
|
87
|
-
"type": "object",
|
|
88
|
-
"properties": {
|
|
89
|
-
"primary_text_field": {
|
|
90
|
-
"type": "boolean"
|
|
91
|
-
},
|
|
92
|
-
"orig_lang_field": {
|
|
93
|
-
"type": "boolean"
|
|
94
|
-
},
|
|
95
|
-
"lang": {
|
|
96
|
-
"type": "string",
|
|
97
|
-
"format": "language-code"
|
|
98
|
-
},
|
|
99
|
-
"orig_langs": {
|
|
100
|
-
"type": "array",
|
|
101
|
-
"items": {
|
|
102
|
-
"type": "string",
|
|
103
|
-
"format": "language-code"
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
"roman": {
|
|
107
|
-
"type": "boolean"
|
|
108
|
-
},
|
|
109
|
-
"alias": {"$ref": "#/definitions/nameType"},
|
|
110
|
-
"name": {"$ref": "#/definitions/nameType"},
|
|
111
|
-
"prefer_alias": {
|
|
112
|
-
"oneOf": [
|
|
113
|
-
{"type": "boolean"},
|
|
114
|
-
{"type": "string"}
|
|
115
|
-
]
|
|
116
|
-
},
|
|
117
|
-
"fieldvalue-aliases": {
|
|
118
|
-
"type": "object",
|
|
119
|
-
"properties": {
|
|
120
|
-
"localeKey": {
|
|
121
|
-
"type": "string"
|
|
122
|
-
}
|
|
123
|
-
},
|
|
124
|
-
"additionalProperties": false,
|
|
125
|
-
"patternProperties": {
|
|
126
|
-
".*": {
|
|
127
|
-
"anyOf": [
|
|
128
|
-
{},
|
|
129
|
-
{
|
|
130
|
-
"type": "object",
|
|
131
|
-
"patternProperties": {
|
|
132
|
-
".*": {"$ref": "#/definitions/stringOrIntegerType"}
|
|
133
|
-
}
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
"type": "array",
|
|
137
|
-
"items": {"$ref": "#/definitions/stringOrIntegerType"}
|
|
138
|
-
}
|
|
139
|
-
]
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/schema#",
|
|
3
|
-
"type": "object",
|
|
4
|
-
"properties": {
|
|
5
|
-
"schema": {
|
|
6
|
-
"$ref": "table.jsonschema"
|
|
7
|
-
},
|
|
8
|
-
"metadata": {
|
|
9
|
-
"$ref": "metadata.jsonschema"
|
|
10
|
-
},
|
|
11
|
-
"data": {
|
|
12
|
-
"$ref": "array-of-arrays.jsonschema"
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/schema#",
|
|
3
|
-
"definitions": {
|
|
4
|
-
"typeArray": {
|
|
5
|
-
"type": "string",
|
|
6
|
-
"enum": ["array"]
|
|
7
|
-
}
|
|
8
|
-
},
|
|
9
|
-
"type": "object",
|
|
10
|
-
"properties": {
|
|
11
|
-
"$schema": {
|
|
12
|
-
"type": "string"
|
|
13
|
-
},
|
|
14
|
-
"type": {"$ref": "#/definitions/typeArray"},
|
|
15
|
-
"additionalItems": {
|
|
16
|
-
"type": "boolean",
|
|
17
|
-
"enum": [false]
|
|
18
|
-
},
|
|
19
|
-
"items": {
|
|
20
|
-
"type": "object",
|
|
21
|
-
"properties": {
|
|
22
|
-
"type": {"$ref": "#/definitions/typeArray"},
|
|
23
|
-
"items": {
|
|
24
|
-
"type": "array",
|
|
25
|
-
"items": {
|
|
26
|
-
"type": "object",
|
|
27
|
-
"properties": {
|
|
28
|
-
"type": {
|
|
29
|
-
"type": "string",
|
|
30
|
-
"enum": ["string", "integer"]
|
|
31
|
-
},
|
|
32
|
-
"enum": {
|
|
33
|
-
"type": "array",
|
|
34
|
-
"items": {
|
|
35
|
-
"type": "string"
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
"format": {
|
|
39
|
-
"type": "string",
|
|
40
|
-
"enum": ["html"]
|
|
41
|
-
},
|
|
42
|
-
"title": {
|
|
43
|
-
"type": "string"
|
|
44
|
-
},
|
|
45
|
-
"minimum": {
|
|
46
|
-
"type": "integer"
|
|
47
|
-
},
|
|
48
|
-
"maximum": {
|
|
49
|
-
"type": "integer"
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|