@es-joy/jsoe 0.27.0 → 0.28.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/CHANGES.md +37 -0
- package/README.md +3 -1
- package/badges/coverage-badge.svg +1 -1
- package/badges/tests-badge.svg +1 -0
- package/dist/formats/schema.d.ts +11 -0
- package/dist/formats/schema.d.ts.map +1 -1
- package/dist/formats/structuredCloning.d.ts.map +1 -1
- package/dist/fundamentalTypes/arrayType.d.ts.map +1 -1
- package/dist/fundamentalTypes/stringType.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/typeChoices.d.ts +32 -2
- package/dist/typeChoices.d.ts.map +1 -1
- package/dist/types.d.ts +8 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/rawTypesonEditor.d.ts +110 -0
- package/dist/utils/rawTypesonEditor.d.ts.map +1 -0
- package/dist/vendor-imports.d.ts +4 -0
- package/docs/proposals/raw-typeson-edit-view.md +575 -0
- package/mmr.json +6 -0
- package/package.json +34 -12
- package/pnpm-workspace.yaml +32 -30
- package/src/formats/schema.js +10 -15
- package/src/formats/structuredCloning.js +24 -17
- package/src/fundamentalTypes/arrayType.js +119 -23
- package/src/fundamentalTypes/blobType.js +16 -16
- package/src/fundamentalTypes/fileType.js +13 -13
- package/src/fundamentalTypes/regexpType.js +1 -1
- package/src/fundamentalTypes/stringType.js +5 -0
- package/src/jsoe.css +12 -0
- package/src/subTypes/blobHTMLType.js +1 -1
- package/src/superTypes/dommatrixType.js +1 -1
- package/src/superTypes/errorsSpecialType.js +1 -1
- package/src/typeChoices.js +37 -10
- package/src/types.js +13 -8
- package/src/utils/media.js +3 -3
- package/src/utils/rawTypesonEditor.js +669 -0
- package/src/vendor-imports.js +12 -0
- package/tsconfig.json +1 -1
- package/typings/json-6.d.ts +12 -0
- package/vendor/@codemirror/autocomplete/dist/index.js +2125 -0
- package/vendor/@codemirror/commands/dist/index.js +1826 -0
- package/vendor/@codemirror/lang-javascript/dist/index.js +513 -0
- package/vendor/@codemirror/language/dist/index.js +2693 -0
- package/vendor/@codemirror/lint/dist/index.js +956 -0
- package/vendor/@codemirror/search/dist/index.js +1238 -0
- package/vendor/@codemirror/state/dist/index.js +3947 -0
- package/vendor/@codemirror/view/dist/index.js +11867 -0
- package/vendor/@lezer/common/dist/index.js +2202 -0
- package/vendor/@lezer/highlight/dist/index.js +927 -0
- package/vendor/@lezer/javascript/dist/index.js +192 -0
- package/vendor/@lezer/lr/dist/index.js +1889 -0
- package/vendor/@marijn/find-cluster-break/src/index.js +87 -0
- package/vendor/codemirror/dist/index.js +96 -0
- package/vendor/crelt/index.js +28 -0
- package/vendor/jamilih/dist/jml.mjs +898 -25
- package/vendor/json-6/dist/index.mjs +1783 -0
- package/vendor/style-mod/src/style-mod.js +172 -0
- package/vendor/w3c-keyname/index.js +119 -0
- package/vendor/zod/classic/checks.d.ts +1 -1
- package/vendor/zod/classic/checks.js +1 -1
- package/vendor/zod/classic/schemas.d.ts +2 -6
- package/vendor/zod/classic/schemas.js +9 -13
- package/vendor/zod/core/api.d.ts +8 -4
- package/vendor/zod/core/api.js +11 -23
- package/vendor/zod/core/checks.d.ts +16 -0
- package/vendor/zod/core/checks.js +31 -0
- package/vendor/zod/core/compile.js +20 -24
- package/vendor/zod/core/core.js +1 -1
- package/vendor/zod/core/json-schema-processors.d.ts +0 -1
- package/vendor/zod/core/json-schema-processors.js +8 -43
- package/vendor/zod/core/memoizer.js +2 -5
- package/vendor/zod/core/regexes.d.ts +1 -0
- package/vendor/zod/core/regexes.js +2 -0
- package/vendor/zod/core/schemas.d.ts +8 -23
- package/vendor/zod/core/schemas.js +39 -80
- package/vendor/zod/core/to-json-schema.d.ts +0 -3
- package/vendor/zod/core/to-json-schema.js +1 -1
- package/vendor/zod/core/util.js +0 -4
- package/vendor/zod/core/versions.js +1 -1
- package/vendor/zod/core/visit.js +0 -12
- package/vendor/zod/locales/ar.js +1 -0
- package/vendor/zod/locales/az.js +1 -0
- package/vendor/zod/locales/be.js +1 -0
- package/vendor/zod/locales/bg.js +1 -0
- package/vendor/zod/locales/bn.js +1 -0
- package/vendor/zod/locales/ca.js +1 -0
- package/vendor/zod/locales/ckb.js +1 -0
- package/vendor/zod/locales/cs.js +1 -0
- package/vendor/zod/locales/da.js +1 -0
- package/vendor/zod/locales/de.js +1 -0
- package/vendor/zod/locales/el.js +1 -0
- package/vendor/zod/locales/en.js +1 -0
- package/vendor/zod/locales/eo.js +1 -0
- package/vendor/zod/locales/es.js +1 -0
- package/vendor/zod/locales/fa.js +1 -0
- package/vendor/zod/locales/fi.js +1 -0
- package/vendor/zod/locales/fr-CA.js +1 -0
- package/vendor/zod/locales/fr.js +1 -0
- package/vendor/zod/locales/gu.js +1 -0
- package/vendor/zod/locales/he.js +1 -0
- package/vendor/zod/locales/hi.js +1 -0
- package/vendor/zod/locales/hr.js +1 -0
- package/vendor/zod/locales/hu.js +1 -0
- package/vendor/zod/locales/hy.js +1 -0
- package/vendor/zod/locales/id.js +1 -0
- package/vendor/zod/locales/is.js +1 -0
- package/vendor/zod/locales/it.js +1 -0
- package/vendor/zod/locales/ja.js +1 -0
- package/vendor/zod/locales/ka.js +1 -0
- package/vendor/zod/locales/km.js +1 -0
- package/vendor/zod/locales/kn.js +1 -0
- package/vendor/zod/locales/ko.js +1 -0
- package/vendor/zod/locales/lt.js +1 -0
- package/vendor/zod/locales/mk.js +1 -0
- package/vendor/zod/locales/ms.js +1 -0
- package/vendor/zod/locales/ne.js +1 -0
- package/vendor/zod/locales/nl.js +1 -0
- package/vendor/zod/locales/nn.js +1 -0
- package/vendor/zod/locales/no.js +1 -0
- package/vendor/zod/locales/ota.js +1 -0
- package/vendor/zod/locales/pl.js +1 -0
- package/vendor/zod/locales/ps.js +1 -0
- package/vendor/zod/locales/pt-BR.js +1 -0
- package/vendor/zod/locales/pt.js +1 -0
- package/vendor/zod/locales/ro.js +1 -0
- package/vendor/zod/locales/ru.js +1 -0
- package/vendor/zod/locales/sk.js +1 -0
- package/vendor/zod/locales/sl.js +1 -0
- package/vendor/zod/locales/sv.js +1 -0
- package/vendor/zod/locales/ta.js +1 -0
- package/vendor/zod/locales/tg.js +1 -0
- package/vendor/zod/locales/th.js +1 -0
- package/vendor/zod/locales/tk.js +1 -0
- package/vendor/zod/locales/tr.js +1 -0
- package/vendor/zod/locales/uk.js +1 -0
- package/vendor/zod/locales/ur.js +1 -0
- package/vendor/zod/locales/uz.js +1 -0
- package/vendor/zod/locales/vi.js +1 -0
- package/vendor/zod/locales/yo.js +1 -0
- package/vendor/zod/locales/zh-CN.js +1 -0
- package/vendor/zod/locales/zh-TW.js +1 -0
- package/vendor/zod/mini/checks.d.ts +1 -1
- package/vendor/zod/mini/checks.js +1 -1
- package/vendor/zod/mini/schemas.d.ts +2 -5
- package/vendor/zod/mini/schemas.js +9 -11
- package/vendor/zodexy/dist/esm/index.js +4 -33
- package/vendor/zodexy/dist/schema.zodexy.json +1 -17
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@es-joy/jsoe",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -28,20 +28,38 @@
|
|
|
28
28
|
]
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
+
"@codemirror/autocomplete": "^6.20.3",
|
|
32
|
+
"@codemirror/commands": "^6.11.0",
|
|
33
|
+
"@codemirror/lang-javascript": "^6.2.5",
|
|
34
|
+
"@codemirror/language": "^6.12.4",
|
|
35
|
+
"@codemirror/lint": "^6.9.7",
|
|
36
|
+
"@codemirror/search": "^6.7.2",
|
|
37
|
+
"@codemirror/state": "^6.7.4",
|
|
38
|
+
"@codemirror/view": "^6.43.11",
|
|
39
|
+
"@lezer/common": "^1.5.2",
|
|
40
|
+
"@lezer/highlight": "^1.2.3",
|
|
41
|
+
"@lezer/javascript": "^1.5.4",
|
|
42
|
+
"@lezer/lr": "^1.4.10",
|
|
43
|
+
"@marijn/find-cluster-break": "^1.0.4",
|
|
31
44
|
"@node-static/node-static": "^0.9.2",
|
|
32
45
|
"acorn": "^8.18.0",
|
|
33
|
-
"
|
|
46
|
+
"codemirror": "^6.0.2",
|
|
47
|
+
"crelt": "^1.0.7",
|
|
48
|
+
"jamilih": "0.70.0",
|
|
49
|
+
"json-6": "^1.1.4",
|
|
34
50
|
"mime": "^4.1.0",
|
|
35
51
|
"sceditor": "3.2.1",
|
|
52
|
+
"style-mod": "^4.1.3",
|
|
36
53
|
"typeson-registry": "14.6.1",
|
|
37
|
-
"
|
|
38
|
-
"
|
|
54
|
+
"w3c-keyname": "^2.2.8",
|
|
55
|
+
"zod": "^4.6.4",
|
|
56
|
+
"zodexy": "^0.32.0"
|
|
39
57
|
},
|
|
40
58
|
"devDependencies": {
|
|
41
|
-
"@babel/core": "^8.0.
|
|
59
|
+
"@babel/core": "^8.0.5",
|
|
42
60
|
"@babel/plugin-transform-modules-commonjs": "^8.0.1",
|
|
43
|
-
"@babel/preset-env": "^8.0.
|
|
44
|
-
"@babel/register": "^8.0.
|
|
61
|
+
"@babel/preset-env": "^8.0.5",
|
|
62
|
+
"@babel/register": "^8.0.5",
|
|
45
63
|
"@cypress/code-coverage": "^4.0.3",
|
|
46
64
|
"@rollup/plugin-babel": "^7.1.0",
|
|
47
65
|
"@rollup/plugin-commonjs": "^29.0.3",
|
|
@@ -56,15 +74,17 @@
|
|
|
56
74
|
"cypress-axe": "^1.7.0",
|
|
57
75
|
"cypress-terminal-report": "^7.3.3",
|
|
58
76
|
"eslint": "^10.10.0",
|
|
59
|
-
"eslint-config-ash-nazg": "^43.1.
|
|
77
|
+
"eslint-config-ash-nazg": "^43.1.10",
|
|
60
78
|
"fast-deep-equal": "^3.1.3",
|
|
61
79
|
"jsdom": "^30.0.1",
|
|
62
80
|
"license-badger": "^0.23.0",
|
|
81
|
+
"mocha-badge-generator": "^0.13.0",
|
|
82
|
+
"mocha-multi-reporters": "^1.5.2",
|
|
63
83
|
"npm-run-all": "^4.1.5",
|
|
64
84
|
"nyc": "^18.0.0",
|
|
65
85
|
"open-cli": "^9.0.0",
|
|
66
86
|
"rimraf": "^6.1.3",
|
|
67
|
-
"rollup": "4.63.
|
|
87
|
+
"rollup": "4.63.2",
|
|
68
88
|
"rollup-plugin-istanbul": "^5.0.0",
|
|
69
89
|
"rollup-plugin-node-builtins": "^2.1.2",
|
|
70
90
|
"typescript": "^6.0.3",
|
|
@@ -115,13 +135,15 @@
|
|
|
115
135
|
"copy-zodexy": "cp -R node_modules/zodexy/dist/esm vendor/zodexy/dist && cp node_modules/zodexy/dist/schema.zodexy.json vendor/zodexy/dist/schema.zodexy.json",
|
|
116
136
|
"copy-acorn": "cp -R node_modules/acorn/dist vendor/acorn",
|
|
117
137
|
"copy-mime": "mkdir -p vendor/mime/dist/types && cp node_modules/mime/dist/types/standard.js vendor/mime/dist/types/standard.js && cp node_modules/mime/dist/types/other.js vendor/mime/dist/types/other.js",
|
|
118
|
-
"copy": "
|
|
138
|
+
"copy-json6": "mkdir -p vendor/json-6/dist && cp node_modules/json-6/dist/index.mjs vendor/json-6/dist/index.mjs",
|
|
139
|
+
"copy-codemirror": "mkdir -p vendor/codemirror/dist vendor/@codemirror/lang-javascript/dist vendor/@codemirror/state/dist vendor/@codemirror/view/dist vendor/@codemirror/language/dist vendor/@codemirror/commands/dist vendor/@codemirror/search/dist vendor/@codemirror/autocomplete/dist vendor/@codemirror/lint/dist vendor/@lezer/common/dist vendor/@lezer/highlight/dist vendor/@lezer/lr/dist vendor/@lezer/javascript/dist vendor/@marijn/find-cluster-break/src vendor/crelt vendor/style-mod/src vendor/w3c-keyname && cp node_modules/codemirror/dist/index.js vendor/codemirror/dist/index.js && cp node_modules/@codemirror/lang-javascript/dist/index.js vendor/@codemirror/lang-javascript/dist/index.js && cp node_modules/@codemirror/state/dist/index.js vendor/@codemirror/state/dist/index.js && cp node_modules/@codemirror/view/dist/index.js vendor/@codemirror/view/dist/index.js && cp node_modules/@codemirror/language/dist/index.js vendor/@codemirror/language/dist/index.js && cp node_modules/@codemirror/commands/dist/index.js vendor/@codemirror/commands/dist/index.js && cp node_modules/@codemirror/search/dist/index.js vendor/@codemirror/search/dist/index.js && cp node_modules/@codemirror/autocomplete/dist/index.js vendor/@codemirror/autocomplete/dist/index.js && cp node_modules/@codemirror/lint/dist/index.js vendor/@codemirror/lint/dist/index.js && cp node_modules/@lezer/common/dist/index.js vendor/@lezer/common/dist/index.js && cp node_modules/@lezer/highlight/dist/index.js vendor/@lezer/highlight/dist/index.js && cp node_modules/@lezer/lr/dist/index.js vendor/@lezer/lr/dist/index.js && cp node_modules/@lezer/javascript/dist/index.js vendor/@lezer/javascript/dist/index.js && cp node_modules/@marijn/find-cluster-break/src/index.js vendor/@marijn/find-cluster-break/src/index.js && cp node_modules/crelt/index.js vendor/crelt/index.js && cp node_modules/style-mod/src/style-mod.js vendor/style-mod/src/style-mod.js && cp node_modules/w3c-keyname/index.js vendor/w3c-keyname/index.js",
|
|
140
|
+
"copy": "run-p copy-jamilih copy-typeson-registry copy-zod copy-zodexy copy-acorn copy-mime copy-json6 copy-codemirror",
|
|
119
141
|
"instrument": "NODE_OPTIONS=--max-old-space-size=8192 run-s -c instrument-remove instrument-add copy-index rollup",
|
|
120
142
|
"coveradge": "coveradge badges/coverage-badge.svg",
|
|
121
143
|
"cypress:log": "ELECTRON_ENABLE_LOGGING=1 cypress run; npm run report",
|
|
122
|
-
"cypress": "rm -Rf .nyc_output && cypress run --browser chrome --spec cypress/e2e/all.cy.js; npm run report && npm run coveradge",
|
|
144
|
+
"cypress": "rm -Rf .nyc_output && cypress run --browser chrome --reporter=mocha-multi-reporters --reporter-options configFile=mmr.json --spec cypress/e2e/all.cy.js; npm run report && npm run coveradge",
|
|
123
145
|
"cypress:record": "cypress run --browser chrome --record --parallel",
|
|
124
|
-
"cypress:sample-spec": "rm -Rf .nyc_output && cypress run --browser chrome --spec cypress/e2e/subTypes/true.cy.js; npm run report && npm run coveradge",
|
|
146
|
+
"cypress:sample-spec": "rm -Rf .nyc_output && cypress run --browser chrome --reporter=mocha-multi-reporters --reporter-options configFile=mmr.json --spec cypress/e2e/subTypes/true.cy.js; npm run report && npm run coveradge",
|
|
125
147
|
"report": "nyc report",
|
|
126
148
|
"test": "npm run eslint && npm run rollup && npm run cypress"
|
|
127
149
|
}
|
package/pnpm-workspace.yaml
CHANGED
|
@@ -10,40 +10,40 @@ minimumReleaseAgeExclude:
|
|
|
10
10
|
- cypress@15.20.1 || 15.21.0 || 16.0.0
|
|
11
11
|
- '@es-joy/jsdoccomment@0.95.0 || 0.95.1'
|
|
12
12
|
- '@typescript-eslint/types@8.67.0 || 8.69.0'
|
|
13
|
-
- eslint-config-ash-nazg@42.3.0 || 42.5.0 || 43.0.1 || 43.1.0 || 43.1.2 || 43.1.5 || 43.1.6
|
|
14
|
-
- eslint-plugin-jsdoc@64.1.0 || 64.2.1 || 64.3.0 || 64.3.2 || 64.3.3
|
|
13
|
+
- eslint-config-ash-nazg@42.3.0 || 42.5.0 || 43.0.1 || 43.1.0 || 43.1.2 || 43.1.5 || 43.1.6 || 43.1.10
|
|
14
|
+
- eslint-plugin-jsdoc@64.1.0 || 64.2.1 || 64.3.0 || 64.3.2 || 64.3.3 || 64.3.10
|
|
15
15
|
- jsdoc-type-pratt-parser@9.1.1 || 9.1.2
|
|
16
|
-
- zodexy@0.21.1 || 0.21.2 || 0.22.0 || 0.23.0 || 0.24.0 || 0.24.1 || 0.25.0 || 0.26.0 || 0.26.1 || 0.27.0 || 0.30.0 || 0.30.1 || 0.31.0
|
|
16
|
+
- zodexy@0.21.1 || 0.21.2 || 0.22.0 || 0.23.0 || 0.24.0 || 0.24.1 || 0.25.0 || 0.26.0 || 0.26.1 || 0.27.0 || 0.30.0 || 0.30.1 || 0.31.0 || 0.31.1 || 0.32.0
|
|
17
17
|
- typeson-registry@13.0.1 || 13.1.0 || 14.4.0 || 14.5.0
|
|
18
18
|
- typeson@10.1.1 || 10.2.0 || 10.3.0
|
|
19
|
-
- '@rollup/rollup-android-arm-eabi@4.63.1'
|
|
20
|
-
- '@rollup/rollup-android-arm64@4.63.1'
|
|
21
|
-
- '@rollup/rollup-darwin-arm64@4.63.1'
|
|
22
|
-
- '@rollup/rollup-darwin-x64@4.63.1'
|
|
23
|
-
- '@rollup/rollup-freebsd-arm64@4.63.1'
|
|
24
|
-
- '@rollup/rollup-freebsd-x64@4.63.1'
|
|
25
|
-
- '@rollup/rollup-linux-arm-gnueabihf@4.63.1'
|
|
26
|
-
- '@rollup/rollup-linux-arm-musleabihf@4.63.1'
|
|
27
|
-
- '@rollup/rollup-linux-arm64-gnu@4.63.1'
|
|
28
|
-
- '@rollup/rollup-linux-arm64-musl@4.63.1'
|
|
29
|
-
- '@rollup/rollup-linux-loong64-gnu@4.63.1'
|
|
30
|
-
- '@rollup/rollup-linux-loong64-musl@4.63.1'
|
|
31
|
-
- '@rollup/rollup-linux-ppc64-gnu@4.63.1'
|
|
32
|
-
- '@rollup/rollup-linux-ppc64-musl@4.63.1'
|
|
33
|
-
- '@rollup/rollup-linux-riscv64-gnu@4.63.1'
|
|
34
|
-
- '@rollup/rollup-linux-riscv64-musl@4.63.1'
|
|
35
|
-
- '@rollup/rollup-linux-s390x-gnu@4.63.1'
|
|
36
|
-
- '@rollup/rollup-linux-x64-gnu@4.63.1'
|
|
37
|
-
- '@rollup/rollup-linux-x64-musl@4.63.1'
|
|
38
|
-
- '@rollup/rollup-openbsd-x64@4.63.1'
|
|
39
|
-
- '@rollup/rollup-openharmony-arm64@4.63.1'
|
|
40
|
-
- '@rollup/rollup-win32-arm64-msvc@4.63.1'
|
|
41
|
-
- '@rollup/rollup-win32-ia32-msvc@4.63.1'
|
|
42
|
-
- '@rollup/rollup-win32-x64-gnu@4.63.1'
|
|
43
|
-
- '@rollup/rollup-win32-x64-msvc@4.63.1'
|
|
19
|
+
- '@rollup/rollup-android-arm-eabi@4.63.1 || 4.63.2'
|
|
20
|
+
- '@rollup/rollup-android-arm64@4.63.1 || 4.63.2'
|
|
21
|
+
- '@rollup/rollup-darwin-arm64@4.63.1 || 4.63.2'
|
|
22
|
+
- '@rollup/rollup-darwin-x64@4.63.1 || 4.63.2'
|
|
23
|
+
- '@rollup/rollup-freebsd-arm64@4.63.1 || 4.63.2'
|
|
24
|
+
- '@rollup/rollup-freebsd-x64@4.63.1 || 4.63.2'
|
|
25
|
+
- '@rollup/rollup-linux-arm-gnueabihf@4.63.1 || 4.63.2'
|
|
26
|
+
- '@rollup/rollup-linux-arm-musleabihf@4.63.1 || 4.63.2'
|
|
27
|
+
- '@rollup/rollup-linux-arm64-gnu@4.63.1 || 4.63.2'
|
|
28
|
+
- '@rollup/rollup-linux-arm64-musl@4.63.1 || 4.63.2'
|
|
29
|
+
- '@rollup/rollup-linux-loong64-gnu@4.63.1 || 4.63.2'
|
|
30
|
+
- '@rollup/rollup-linux-loong64-musl@4.63.1 || 4.63.2'
|
|
31
|
+
- '@rollup/rollup-linux-ppc64-gnu@4.63.1 || 4.63.2'
|
|
32
|
+
- '@rollup/rollup-linux-ppc64-musl@4.63.1 || 4.63.2'
|
|
33
|
+
- '@rollup/rollup-linux-riscv64-gnu@4.63.1 || 4.63.2'
|
|
34
|
+
- '@rollup/rollup-linux-riscv64-musl@4.63.1 || 4.63.2'
|
|
35
|
+
- '@rollup/rollup-linux-s390x-gnu@4.63.1 || 4.63.2'
|
|
36
|
+
- '@rollup/rollup-linux-x64-gnu@4.63.1 || 4.63.2'
|
|
37
|
+
- '@rollup/rollup-linux-x64-musl@4.63.1 || 4.63.2'
|
|
38
|
+
- '@rollup/rollup-openbsd-x64@4.63.1 || 4.63.2'
|
|
39
|
+
- '@rollup/rollup-openharmony-arm64@4.63.1 || 4.63.2'
|
|
40
|
+
- '@rollup/rollup-win32-arm64-msvc@4.63.1 || 4.63.2'
|
|
41
|
+
- '@rollup/rollup-win32-ia32-msvc@4.63.1 || 4.63.2'
|
|
42
|
+
- '@rollup/rollup-win32-x64-gnu@4.63.1 || 4.63.2'
|
|
43
|
+
- '@rollup/rollup-win32-x64-msvc@4.63.1 || 4.63.2'
|
|
44
44
|
- eslint-plugin-escompat@3.11.6 || 3.12.0
|
|
45
|
-
- rollup@4.63.1
|
|
46
|
-
- zod@4.5.2 || 4.5.4 || 4.6.1
|
|
45
|
+
- rollup@4.63.1 || 4.63.2
|
|
46
|
+
- zod@4.5.2 || 4.5.4 || 4.6.1 || 4.6.3 || 4.6.4
|
|
47
47
|
- '@typescript-eslint/eslint-plugin@8.69.0'
|
|
48
48
|
- '@typescript-eslint/parser@8.69.0'
|
|
49
49
|
- '@typescript-eslint/project-service@8.69.0'
|
|
@@ -56,3 +56,5 @@ minimumReleaseAgeExclude:
|
|
|
56
56
|
- typescript-eslint@8.69.0
|
|
57
57
|
- '@types/node@26.4.1'
|
|
58
58
|
- '@node-static/node-static@0.9.2'
|
|
59
|
+
- mocha-multi-reporters@1.5.2
|
|
60
|
+
- '@eslint-community/eslint-plugin-eslint-comments@4.8.1'
|
package/src/formats/schema.js
CHANGED
|
@@ -43,10 +43,6 @@ const zodexToStructuredCloningTypeMap = new Map([
|
|
|
43
43
|
['array', 'arrayNonindexKeys'],
|
|
44
44
|
|
|
45
45
|
['object', 'object'],
|
|
46
|
-
// `z.properties()` (Zod 4.5+) is a bare named-property shape: like `object`
|
|
47
|
-
// but with no `catchall`/`symbols` and, in Zod, no unknown-key stripping.
|
|
48
|
-
// jsoe edits it through the same `object` UI, keyed off the schema `type`.
|
|
49
|
-
['properties', 'object'],
|
|
50
46
|
|
|
51
47
|
['tuple', 'array'],
|
|
52
48
|
['record', 'object'],
|
|
@@ -194,13 +190,15 @@ const dezerializerCodecs = {
|
|
|
194
190
|
};
|
|
195
191
|
|
|
196
192
|
/**
|
|
193
|
+
* Exported for reuse by `src/utils/rawTypesonEditor.js`, which must enforce
|
|
194
|
+
* the same schema conformance check before accepting a raw-edited value.
|
|
197
195
|
* @param {InstanceType<typeof import('../types.js').default>} types
|
|
198
196
|
* @param {ZodexSchema} schemaObject
|
|
199
197
|
* @param {ZodexSchema} originalShape
|
|
200
198
|
* @param {unknown} value
|
|
201
199
|
* @returns {ReturnType<ReturnType<typeof dezerialize>['safeParse']>}
|
|
202
200
|
*/
|
|
203
|
-
function parseValue (types, schemaObject, originalShape, value) {
|
|
201
|
+
export function parseValue (types, schemaObject, originalShape, value) {
|
|
204
202
|
return dezerialize(schemaObject, {
|
|
205
203
|
checks: getChecks(types),
|
|
206
204
|
codecs: dezerializerCodecs,
|
|
@@ -386,13 +384,12 @@ function mergeMeta (target, source) {
|
|
|
386
384
|
|
|
387
385
|
/**
|
|
388
386
|
* Whether a schema node carries a fixed bag of named property schemas under
|
|
389
|
-
* `properties` - `object
|
|
390
|
-
* across an intersection and both drive the `object` editor UI.
|
|
387
|
+
* `properties` - i.e., `object`.
|
|
391
388
|
* @param {ZodexSchema['type']|undefined} type
|
|
392
389
|
* @returns {boolean}
|
|
393
390
|
*/
|
|
394
391
|
function isPropertyBagType (type) {
|
|
395
|
-
return type === 'object'
|
|
392
|
+
return type === 'object';
|
|
396
393
|
}
|
|
397
394
|
|
|
398
395
|
/**
|
|
@@ -611,7 +608,6 @@ export function getTypesForSchema (schemaObject, originalJSON) {
|
|
|
611
608
|
originalJSON
|
|
612
609
|
);
|
|
613
610
|
}
|
|
614
|
-
case 'properties':
|
|
615
611
|
case 'object': {
|
|
616
612
|
const set = new Set();
|
|
617
613
|
// const {properties} = schemaObject;
|
|
@@ -934,13 +930,12 @@ const schema = {
|
|
|
934
930
|
|
|
935
931
|
switch (parentSchema?.type) {
|
|
936
932
|
case 'object':
|
|
937
|
-
case 'properties':
|
|
938
933
|
// A key outside the declared shape: an `object` pins it to its
|
|
939
|
-
// `catchall` if it has one; otherwise
|
|
940
|
-
//
|
|
941
|
-
//
|
|
942
|
-
//
|
|
943
|
-
//
|
|
934
|
+
// `catchall` if it has one; otherwise its control is offered the
|
|
935
|
+
// unconstrained type choice - as a `looseRecord`'s non-conforming
|
|
936
|
+
// entry is - rather than the bare "unschema'd" fallback. A strict
|
|
937
|
+
// `object` will still strip the key on parse; this only governs how
|
|
938
|
+
// it is edited.
|
|
944
939
|
currentSchema = /** @type {import('zodexy').SzObject} */ (
|
|
945
940
|
parentSchema
|
|
946
941
|
).properties[
|
|
@@ -274,23 +274,30 @@ const encapsulateObserver = (stateObj) => {
|
|
|
274
274
|
// console.log('but could set to', schema);
|
|
275
275
|
// console.log('arrayOrObjectPropertyName', arrayOrObjectPropertyName);
|
|
276
276
|
|
|
277
|
-
if (!
|
|
278
|
-
//
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
277
|
+
if (!parents['']) {
|
|
278
|
+
// A caller repopulating an *existing* container in place (e.g. the raw
|
|
279
|
+
// Typeson/JSON6 editor replacing one control's children after a
|
|
280
|
+
// bulk edit, `src/utils/rawTypesonEditor.js`) pre-seeds
|
|
281
|
+
// `stateObj.rootUI` with that container so it is reused here instead
|
|
282
|
+
// of a fresh one being built.
|
|
283
|
+
if (!stateObj.rootUI) {
|
|
284
|
+
// console.log('vvvv0', newType, newValue);
|
|
285
|
+
stateObj.rootUI = types?.getUIForModeAndType({
|
|
286
|
+
readonly,
|
|
287
|
+
typeNamespace,
|
|
288
|
+
type: newType,
|
|
289
|
+
bringIntoFocus: false,
|
|
290
|
+
buildTypeChoices,
|
|
291
|
+
format,
|
|
292
|
+
specificSchemaObject: schema,
|
|
293
|
+
schemaContent,
|
|
294
|
+
value: newValue,
|
|
295
|
+
hasValue: true,
|
|
296
|
+
// Not currently in use but may be convenient for a
|
|
297
|
+
// type wanting the serialized data
|
|
298
|
+
replaced
|
|
299
|
+
});
|
|
300
|
+
}
|
|
294
301
|
parents[''] = /**
|
|
295
302
|
* @type {HTMLElement &
|
|
296
303
|
* {$addAndSetArrayElement: AddAndSetArrayElement}}
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
schemaLabel, lastTypeChild, deprecatedClassSuffix
|
|
8
8
|
} from '../utils/schemaMeta.js';
|
|
9
9
|
import dialogs from '../utils/dialogs.js';
|
|
10
|
+
import {openRawEditorDialog} from '../utils/rawTypesonEditor.js';
|
|
10
11
|
import {
|
|
11
12
|
resolveJSONPointer, getJSONPointerParts, reduceJSONPointerParts
|
|
12
13
|
} from '../utils/jsonPointer.js';
|
|
@@ -266,7 +267,7 @@ const arrayType = {
|
|
|
266
267
|
return {value: retObj, remnant: stringVal};
|
|
267
268
|
},
|
|
268
269
|
getValue ({root, stateObj, currentPath = ''}) {
|
|
269
|
-
/* istanbul ignore if */
|
|
270
|
+
/* istanbul ignore if -- TS guard */
|
|
270
271
|
if (!stateObj) {
|
|
271
272
|
throw new Error('TS guard'); // TS guard
|
|
272
273
|
}
|
|
@@ -428,6 +429,13 @@ const arrayType = {
|
|
|
428
429
|
specificSchemaObject?.type === 'looseRecord';
|
|
429
430
|
const tupleMode = specificSchemaObject?.type === 'tuple';
|
|
430
431
|
|
|
432
|
+
// See `docs/proposals/raw-typeson-edit-view.md` §1 for the scope
|
|
433
|
+
// rationale (why `filelist` is included, why record/tuple count).
|
|
434
|
+
const isRawEditable = types.showRawTypesonControls &&
|
|
435
|
+
((type === 'object' || type === 'array' ||
|
|
436
|
+
type === 'set' || type === 'map' || type === 'filelist') ||
|
|
437
|
+
recordMode || tupleMode);
|
|
438
|
+
|
|
431
439
|
/**
|
|
432
440
|
* @param {{
|
|
433
441
|
* itemIndex: number,
|
|
@@ -660,6 +668,31 @@ const arrayType = {
|
|
|
660
668
|
target
|
|
661
669
|
).textContent = arrayContents.hidden ? '+' : '-';
|
|
662
670
|
}}}, ['-']],
|
|
671
|
+
...(isRawEditable
|
|
672
|
+
? /** @type {import('jamilih').JamilihArray[]} */ ([
|
|
673
|
+
nbsp.repeat(2),
|
|
674
|
+
['button', {
|
|
675
|
+
class: 'viewRawTypeson',
|
|
676
|
+
$on: {click (/** @type {Event} */ e) {
|
|
677
|
+
e.preventDefault();
|
|
678
|
+
openRawEditorDialog({
|
|
679
|
+
types,
|
|
680
|
+
format: /** @type {import('../formats.js').AvailableFormat} */ (
|
|
681
|
+
format
|
|
682
|
+
),
|
|
683
|
+
type: /** @type {import('../types.js').AvailableArbitraryType} */ (
|
|
684
|
+
type
|
|
685
|
+
),
|
|
686
|
+
root: /** @type {HTMLDivElement} */ (div),
|
|
687
|
+
topRoot: /** @type {HTMLDivElement} */ (topRoot),
|
|
688
|
+
typeNamespace,
|
|
689
|
+
specificSchemaObject,
|
|
690
|
+
readonly: true
|
|
691
|
+
});
|
|
692
|
+
}}
|
|
693
|
+
}, ['View raw']]
|
|
694
|
+
])
|
|
695
|
+
: []),
|
|
663
696
|
['div', {class: 'arrayContents'}, [
|
|
664
697
|
!recordMode && this.array
|
|
665
698
|
? ['div', {
|
|
@@ -724,6 +757,13 @@ const arrayType = {
|
|
|
724
757
|
specificSchemaObject?.type === 'looseRecord';
|
|
725
758
|
const tupleMode = specificSchemaObject?.type === 'tuple';
|
|
726
759
|
|
|
760
|
+
// See `docs/proposals/raw-typeson-edit-view.md` §1 for the scope
|
|
761
|
+
// rationale (why `filelist` is included, why record/tuple count).
|
|
762
|
+
const isRawEditable = types.showRawTypesonControls &&
|
|
763
|
+
((type === 'object' || type === 'array' ||
|
|
764
|
+
type === 'set' || type === 'map' || type === 'filelist') ||
|
|
765
|
+
recordMode || tupleMode);
|
|
766
|
+
|
|
727
767
|
// A `record` refines `object` but, for legend numbering/reordering, behaves
|
|
728
768
|
// like the array-based types did when it was its own (`array: true`) type.
|
|
729
769
|
const parentIsArrayLike = parentTypeObject.array || recordMode;
|
|
@@ -1380,7 +1420,7 @@ const arrayType = {
|
|
|
1380
1420
|
const method = latest ? 'after' : 'before';
|
|
1381
1421
|
// Ensure move *after* splice that will occur after this
|
|
1382
1422
|
setTimeout(() => {
|
|
1383
|
-
/* istanbul ignore if */
|
|
1423
|
+
/* istanbul ignore if -- Should be present */
|
|
1384
1424
|
if (!nearest) {
|
|
1385
1425
|
return;
|
|
1386
1426
|
}
|
|
@@ -1631,21 +1671,19 @@ const arrayType = {
|
|
|
1631
1671
|
const objectSchema = /** @type {import('zodexy').SzObject} */ (
|
|
1632
1672
|
specificSchemaObject
|
|
1633
1673
|
);
|
|
1634
|
-
const schemaType = specificSchemaObject?.type;
|
|
1635
1674
|
const propSchema = objectSchema?.properties?.[/** @type {string} */ (
|
|
1636
1675
|
propName
|
|
1637
1676
|
)];
|
|
1638
1677
|
if (
|
|
1639
1678
|
!propSchema &&
|
|
1640
|
-
|
|
1641
|
-
(schemaType === 'object' && !objectSchema.catchall))
|
|
1679
|
+
specificSchemaObject?.type === 'object' && !objectSchema.catchall
|
|
1642
1680
|
) {
|
|
1643
|
-
// A key outside the declared shape of a `z.
|
|
1644
|
-
//
|
|
1645
|
-
//
|
|
1646
|
-
//
|
|
1647
|
-
//
|
|
1648
|
-
//
|
|
1681
|
+
// A key outside the declared shape of a `catchall`-less `z.object()`
|
|
1682
|
+
// (which strips it on parse but still shows it while editing):
|
|
1683
|
+
// offer the unconstrained type choice rather than an unschema'd
|
|
1684
|
+
// control, as a `looseRecord`'s non-conforming entry gets. An
|
|
1685
|
+
// `object` `catchall` takes precedence (handled where the
|
|
1686
|
+
// per-property schema is chosen elsewhere).
|
|
1649
1687
|
return /** @type {import('zodexy').SzType} */ ({type: 'unknown'});
|
|
1650
1688
|
}
|
|
1651
1689
|
return propSchema;
|
|
@@ -2358,6 +2396,34 @@ const arrayType = {
|
|
|
2358
2396
|
).textContent = arrayContents.hidden ? '+' : '-';
|
|
2359
2397
|
}}}, ['-']];
|
|
2360
2398
|
|
|
2399
|
+
const rawEditButton = isRawEditable
|
|
2400
|
+
? [
|
|
2401
|
+
nbsp.repeat(2),
|
|
2402
|
+
['button', {
|
|
2403
|
+
class: 'editRawTypeson',
|
|
2404
|
+
$on: {click (/** @type {Event} */ e) {
|
|
2405
|
+
e.preventDefault();
|
|
2406
|
+
openRawEditorDialog({
|
|
2407
|
+
types,
|
|
2408
|
+
format: /** @type {import('../formats.js').AvailableFormat} */ (
|
|
2409
|
+
format
|
|
2410
|
+
),
|
|
2411
|
+
type: /** @type {import('../types.js').AvailableArbitraryType} */ (
|
|
2412
|
+
type
|
|
2413
|
+
),
|
|
2414
|
+
root: /** @type {HTMLDivElement} */ (div),
|
|
2415
|
+
// By click time `topRoot ||= div` below has already run if
|
|
2416
|
+
// this control is itself the root.
|
|
2417
|
+
topRoot: /** @type {HTMLDivElement} */ (topRoot),
|
|
2418
|
+
typeNamespace,
|
|
2419
|
+
specificSchemaObject,
|
|
2420
|
+
readonly: false
|
|
2421
|
+
});
|
|
2422
|
+
}}
|
|
2423
|
+
}, ['Edit raw']]
|
|
2424
|
+
]
|
|
2425
|
+
: [];
|
|
2426
|
+
|
|
2361
2427
|
const arrayContents = /** @type {import('jamilih').JamilihArray} */ (
|
|
2362
2428
|
['div', {class: 'arrayContents'}, [
|
|
2363
2429
|
arrayContentsFirstChild,
|
|
@@ -2433,7 +2499,8 @@ const arrayType = {
|
|
|
2433
2499
|
* $getTypeChoices: () => HTMLSelectElement & {
|
|
2434
2500
|
* $setType: import('../typeChoices.js').SetType,
|
|
2435
2501
|
* $getTypeRoot: import('../formatAndTypeChoices.js').TypeRootGetter
|
|
2436
|
-
* }
|
|
2502
|
+
* },
|
|
2503
|
+
* $resetItemIndex: () => void
|
|
2437
2504
|
* }} DivArrayOrObjectHolder
|
|
2438
2505
|
*/
|
|
2439
2506
|
|
|
@@ -2585,6 +2652,40 @@ const arrayType = {
|
|
|
2585
2652
|
this.$getAddArrayElement().previousElementSibling
|
|
2586
2653
|
);
|
|
2587
2654
|
},
|
|
2655
|
+
/**
|
|
2656
|
+
* Resets the `itemIndex`/legend-numbering counter back to its
|
|
2657
|
+
* empty-container baseline (`itemAdjust - 1`, the same value
|
|
2658
|
+
* it's initialized to before any item is ever added — *not*
|
|
2659
|
+
* the `-1` the "x All" button below hardcodes, which is only
|
|
2660
|
+
* correct for arrays; an object's baseline is `0`). Exposed so
|
|
2661
|
+
* a caller that repopulates this container's children from
|
|
2662
|
+
* outside this closure (bypassing the normal per-item
|
|
2663
|
+
* add/remove handlers that keep `itemIndex` in sync as they
|
|
2664
|
+
* go) — currently only
|
|
2665
|
+
* `src/utils/rawTypesonEditor.js`'s `commitValueToContainer`,
|
|
2666
|
+
* after a raw-value edit replaces every child — ends up with
|
|
2667
|
+
* exactly the same numbering a fresh container holding the
|
|
2668
|
+
* same new items would have, rather than continuing from
|
|
2669
|
+
* wherever the replaced content had left off (or, using the
|
|
2670
|
+
* wrong baseline, starting one lower than a fresh container
|
|
2671
|
+
* would: a single-property object's only property would be
|
|
2672
|
+
* renumbered from "1" to "0" by a bulk edit that didn't even
|
|
2673
|
+
* change its key, for example).
|
|
2674
|
+
* @this {DivArrayOrObjectHolder}
|
|
2675
|
+
* @returns {void}
|
|
2676
|
+
*/
|
|
2677
|
+
$resetItemIndex () {
|
|
2678
|
+
if (sparse) {
|
|
2679
|
+
decrementItemIndex(
|
|
2680
|
+
/**
|
|
2681
|
+
* @type {HTMLDivElement & {
|
|
2682
|
+
* $getPropertyInputs: GetPropertyInputs
|
|
2683
|
+
}} */ (this.$getArrayItems())
|
|
2684
|
+
);
|
|
2685
|
+
} else {
|
|
2686
|
+
itemIndex = itemAdjust - 1;
|
|
2687
|
+
}
|
|
2688
|
+
},
|
|
2588
2689
|
/**
|
|
2589
2690
|
* @this {DivArrayOrObjectHolder}
|
|
2590
2691
|
* @returns {HTMLSelectElement & {
|
|
@@ -2630,16 +2731,10 @@ const arrayType = {
|
|
|
2630
2731
|
}
|
|
2631
2732
|
}, /** @type {import('jamilih').JamilihChildren} */ ([
|
|
2632
2733
|
[specificSchemaObject ? 'span' : 'b', {
|
|
2633
|
-
title: schemaLabel(specificSchemaObject) ?? (
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
specificSchemaObject?.type === 'properties'
|
|
2638
|
-
? 'Properties'
|
|
2639
|
-
: DOM.initialCaps(
|
|
2640
|
-
/** @type {import('../types.js').AvailableType} */
|
|
2641
|
-
(itemType)
|
|
2642
|
-
).replace(/s$/u, ''))
|
|
2734
|
+
title: schemaLabel(specificSchemaObject) ?? DOM.initialCaps(
|
|
2735
|
+
/** @type {import('../types.js').AvailableType} */
|
|
2736
|
+
(itemType)
|
|
2737
|
+
).replace(/s$/u, '')
|
|
2643
2738
|
}, [
|
|
2644
2739
|
specificSchemaObject
|
|
2645
2740
|
? '—'
|
|
@@ -2659,7 +2754,7 @@ const arrayType = {
|
|
|
2659
2754
|
* @this {HTMLInputElement}
|
|
2660
2755
|
*/
|
|
2661
2756
|
change () {
|
|
2662
|
-
/* istanbul ignore if */
|
|
2757
|
+
/* istanbul ignore if -- TS */
|
|
2663
2758
|
if (!this.files) {
|
|
2664
2759
|
return;
|
|
2665
2760
|
}
|
|
@@ -2684,6 +2779,7 @@ const arrayType = {
|
|
|
2684
2779
|
}]
|
|
2685
2780
|
: '',
|
|
2686
2781
|
minusButton,
|
|
2782
|
+
...rawEditButton,
|
|
2687
2783
|
arrayContents
|
|
2688
2784
|
]))
|
|
2689
2785
|
);
|
|
@@ -117,7 +117,7 @@ function binaryButton (value, editable) {
|
|
|
117
117
|
['textarea', {
|
|
118
118
|
class: 'view-binary'
|
|
119
119
|
}, [
|
|
120
|
-
/* istanbul ignore next */
|
|
120
|
+
/* istanbul ignore next -- Guard */
|
|
121
121
|
/** @type {string|null} */ (reader.result) ?? ''
|
|
122
122
|
]]
|
|
123
123
|
]]
|
|
@@ -127,11 +127,11 @@ function binaryButton (value, editable) {
|
|
|
127
127
|
// Seems not feasible to accurately simulate
|
|
128
128
|
reader.addEventListener(
|
|
129
129
|
'error',
|
|
130
|
-
/* istanbul ignore next */
|
|
130
|
+
/* istanbul ignore next -- See comment above */
|
|
131
131
|
async function () {
|
|
132
|
-
/* istanbul ignore
|
|
132
|
+
/* istanbul ignore nex -- See comment abovet */
|
|
133
133
|
console.error(reader.error);
|
|
134
|
-
/* istanbul ignore next */
|
|
134
|
+
/* istanbul ignore next -- See comment above */
|
|
135
135
|
await dialogs.alert(/** @type {string} */ (
|
|
136
136
|
/** @type {DOMException} */ (reader.error).message
|
|
137
137
|
));
|
|
@@ -205,7 +205,7 @@ const blobType = {
|
|
|
205
205
|
'Text source',
|
|
206
206
|
['br'],
|
|
207
207
|
['textarea', {class: 'view-text'}, [
|
|
208
|
-
/* istanbul ignore next */
|
|
208
|
+
/* istanbul ignore next -- Guard */
|
|
209
209
|
/** @type {string|null} */ (reader.result) ?? ''
|
|
210
210
|
]]
|
|
211
211
|
]));
|
|
@@ -213,11 +213,11 @@ const blobType = {
|
|
|
213
213
|
// Seems not feasible to accurately simulate
|
|
214
214
|
reader.addEventListener(
|
|
215
215
|
'error',
|
|
216
|
-
/* istanbul ignore next */
|
|
216
|
+
/* istanbul ignore next -- See comment above */
|
|
217
217
|
function () {
|
|
218
|
-
/* istanbul ignore next */
|
|
218
|
+
/* istanbul ignore next -- See comment above */
|
|
219
219
|
console.error(reader.error);
|
|
220
|
-
/* istanbul ignore next */
|
|
220
|
+
/* istanbul ignore next -- See comment above */
|
|
221
221
|
div.append(
|
|
222
222
|
/** @type {DOMException} */ (reader.error).message
|
|
223
223
|
);
|
|
@@ -400,7 +400,7 @@ const blobType = {
|
|
|
400
400
|
blob
|
|
401
401
|
).slice(8, -1) === 'Blob'
|
|
402
402
|
? /** @type {Blob} */ (blob)
|
|
403
|
-
/* istanbul ignore next */
|
|
403
|
+
/* istanbul ignore next -- Guard */
|
|
404
404
|
: undefined;
|
|
405
405
|
}
|
|
406
406
|
}
|
|
@@ -619,7 +619,7 @@ const blobType = {
|
|
|
619
619
|
|
|
620
620
|
if (constraints) {
|
|
621
621
|
const mediaStream = await getUserMedia(constraints);
|
|
622
|
-
/* istanbul ignore if */
|
|
622
|
+
/* istanbul ignore if -- Should be present */
|
|
623
623
|
if (!mediaStream) {
|
|
624
624
|
await dialogs.alert('Error getting user media');
|
|
625
625
|
return;
|
|
@@ -667,7 +667,7 @@ const blobType = {
|
|
|
667
667
|
const mediaStream = await startScreenCapture(
|
|
668
668
|
screenShareConstraints
|
|
669
669
|
);
|
|
670
|
-
/* istanbul ignore if */
|
|
670
|
+
/* istanbul ignore if -- Should be present */
|
|
671
671
|
if (!mediaStream) {
|
|
672
672
|
await dialogs.alert('Error getting user media');
|
|
673
673
|
return;
|
|
@@ -747,7 +747,7 @@ const blobType = {
|
|
|
747
747
|
'video.previewMedia'
|
|
748
748
|
));
|
|
749
749
|
|
|
750
|
-
/* istanbul ignore if */
|
|
750
|
+
/* istanbul ignore if -- Should be present */
|
|
751
751
|
if (!previewMedia.srcObject) {
|
|
752
752
|
dialogs.alert('No stream found to record');
|
|
753
753
|
return;
|
|
@@ -782,11 +782,11 @@ const blobType = {
|
|
|
782
782
|
|
|
783
783
|
try {
|
|
784
784
|
mediaRecorder.start();
|
|
785
|
-
/* istanbul ignore next */
|
|
785
|
+
/* istanbul ignore next -- Should not err */
|
|
786
786
|
} catch {
|
|
787
|
-
/* istanbul ignore next */
|
|
787
|
+
/* istanbul ignore next -- Should not err */
|
|
788
788
|
dialogs.alert('Error starting media recorder');
|
|
789
|
-
/* istanbul ignore next */
|
|
789
|
+
/* istanbul ignore next -- Should not err */
|
|
790
790
|
return;
|
|
791
791
|
}
|
|
792
792
|
mediaRecorder.addEventListener('stop', () => {
|
|
@@ -923,7 +923,7 @@ const blobType = {
|
|
|
923
923
|
($e(videoContainer, 'img.photo'));
|
|
924
924
|
|
|
925
925
|
canvas.toBlob((blob) => {
|
|
926
|
-
/* istanbul ignore if */
|
|
926
|
+
/* istanbul ignore if -- Should not err */
|
|
927
927
|
if (!blob) {
|
|
928
928
|
dialogs.alert('Error converting canvas to Blob');
|
|
929
929
|
return;
|