@es-joy/jsoe 0.28.0 → 0.28.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.
- package/CHANGES.md +8 -0
- package/badges/coverage-badge.svg +1 -1
- package/badges/tests-badge.svg +1 -1
- package/dist/deepEqual.d.ts +3 -0
- package/dist/deepEqual.d.ts.map +1 -0
- package/dist/formats/schema.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/search/queryTree.d.ts +180 -0
- package/dist/search/queryTree.d.ts.map +1 -0
- package/dist/search/queryTreeBuilders.d.ts +156 -0
- package/dist/search/queryTreeBuilders.d.ts.map +1 -0
- package/dist/search/searchDispatch.d.ts +77 -0
- package/dist/search/searchDispatch.d.ts.map +1 -0
- package/dist/typeChoices.d.ts.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/rawTypesonEditor.d.ts.map +1 -1
- package/docs/proposals/search-plan.md +166 -0
- package/package.json +22 -9
- package/pnpm-workspace.yaml +31 -30
- package/src/formats/schema.js +8 -14
- package/src/fundamentalTypes/arrayType.js +14 -22
- 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/subTypes/blobHTMLType.js +1 -1
- package/src/superTypes/dommatrixType.js +1 -1
- package/src/superTypes/errorsSpecialType.js +1 -1
- package/src/typeChoices.js +1 -3
- package/src/types.js +0 -6
- package/src/utils/media.js +3 -3
- package/src/utils/rawTypesonEditor.js +12 -2
- package/tsconfig.json +1 -1
- package/vendor/jamilih/dist/jml.mjs +898 -25
- 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
|
@@ -232,7 +232,7 @@ function binaryButton (
|
|
|
232
232
|
['textarea', {
|
|
233
233
|
class: 'view-binary'
|
|
234
234
|
}, [
|
|
235
|
-
/* istanbul ignore next */
|
|
235
|
+
/* istanbul ignore next -- Guard */
|
|
236
236
|
/** @type {string|null} */ (reader.result) ?? ''
|
|
237
237
|
]]
|
|
238
238
|
]]
|
|
@@ -242,11 +242,11 @@ function binaryButton (
|
|
|
242
242
|
// Seems not feasible to accurately simulate
|
|
243
243
|
reader.addEventListener(
|
|
244
244
|
'error',
|
|
245
|
-
/* istanbul ignore next */
|
|
245
|
+
/* istanbul ignore next -- Should not err */
|
|
246
246
|
async function () {
|
|
247
|
-
/* istanbul ignore next */
|
|
247
|
+
/* istanbul ignore next -- Should not err */
|
|
248
248
|
console.error(reader.error);
|
|
249
|
-
/* istanbul ignore next */
|
|
249
|
+
/* istanbul ignore next -- Should not err */
|
|
250
250
|
await dialogs.alert(/** @type {string} */ (
|
|
251
251
|
/** @type {DOMException} */ (reader.error).message
|
|
252
252
|
));
|
|
@@ -341,7 +341,7 @@ const fileType = {
|
|
|
341
341
|
'Text source',
|
|
342
342
|
['br'],
|
|
343
343
|
['textarea', {class: 'view-text'}, [
|
|
344
|
-
/* istanbul ignore next */
|
|
344
|
+
/* istanbul ignore next -- Guard */
|
|
345
345
|
/** @type {string|null} */ (reader.result) ?? ''
|
|
346
346
|
]]
|
|
347
347
|
]));
|
|
@@ -349,11 +349,11 @@ const fileType = {
|
|
|
349
349
|
// Seems not feasible to accurately simulate
|
|
350
350
|
reader.addEventListener(
|
|
351
351
|
'error',
|
|
352
|
-
/* istanbul ignore next */
|
|
352
|
+
/* istanbul ignore next -- Should not err */
|
|
353
353
|
function () {
|
|
354
|
-
/* istanbul ignore next */
|
|
354
|
+
/* istanbul ignore next -- Should not err */
|
|
355
355
|
console.error(reader.error);
|
|
356
|
-
/* istanbul ignore next */
|
|
356
|
+
/* istanbul ignore next -- Should not err */
|
|
357
357
|
div.append(
|
|
358
358
|
/** @type {DOMException} */ (reader.error).message
|
|
359
359
|
);
|
|
@@ -882,7 +882,7 @@ const fileType = {
|
|
|
882
882
|
|
|
883
883
|
if (constraints) {
|
|
884
884
|
const mediaStream = await getUserMedia(constraints);
|
|
885
|
-
/* istanbul ignore if */
|
|
885
|
+
/* istanbul ignore if -- Should be present */
|
|
886
886
|
if (!mediaStream) {
|
|
887
887
|
await dialogs.alert('Error getting user media');
|
|
888
888
|
return;
|
|
@@ -930,7 +930,7 @@ const fileType = {
|
|
|
930
930
|
const mediaStream = await startScreenCapture(
|
|
931
931
|
screenShareConstraints
|
|
932
932
|
);
|
|
933
|
-
/* istanbul ignore if */
|
|
933
|
+
/* istanbul ignore if -- Should not err */
|
|
934
934
|
if (!mediaStream) {
|
|
935
935
|
await dialogs.alert('Error getting user media');
|
|
936
936
|
return;
|
|
@@ -1010,7 +1010,7 @@ const fileType = {
|
|
|
1010
1010
|
'video.previewMedia'
|
|
1011
1011
|
));
|
|
1012
1012
|
|
|
1013
|
-
/* istanbul ignore if */
|
|
1013
|
+
/* istanbul ignore if -- Should not err */
|
|
1014
1014
|
if (!previewMedia.srcObject) {
|
|
1015
1015
|
dialogs.alert('No stream found to record');
|
|
1016
1016
|
return;
|
|
@@ -1044,7 +1044,7 @@ const fileType = {
|
|
|
1044
1044
|
|
|
1045
1045
|
try {
|
|
1046
1046
|
mediaRecorder.start();
|
|
1047
|
-
} catch /* istanbul ignore next */ {
|
|
1047
|
+
} catch /* istanbul ignore next -- Should not err */ {
|
|
1048
1048
|
dialogs.alert('Error starting media recorder');
|
|
1049
1049
|
return;
|
|
1050
1050
|
}
|
|
@@ -1195,7 +1195,7 @@ const fileType = {
|
|
|
1195
1195
|
($e(videoContainer, 'img.photo'));
|
|
1196
1196
|
|
|
1197
1197
|
canvas.toBlob((blob) => {
|
|
1198
|
-
/* istanbul ignore if */
|
|
1198
|
+
/* istanbul ignore if -- Should not err */
|
|
1199
1199
|
if (!blob) {
|
|
1200
1200
|
dialogs.alert('Error converting canvas to Blob');
|
|
1201
1201
|
return;
|
|
@@ -128,6 +128,11 @@ const stringType = {
|
|
|
128
128
|
}
|
|
129
129
|
if (kind) {
|
|
130
130
|
switch (kind) {
|
|
131
|
+
case 'currency_code':
|
|
132
|
+
if (!regexes.currencyCode.test(value)) {
|
|
133
|
+
return `Value doesn't match currency code pattern.`;
|
|
134
|
+
}
|
|
135
|
+
break;
|
|
131
136
|
case 'credit_card':
|
|
132
137
|
if (!regexes.creditCard.test(value)) {
|
|
133
138
|
return `Value doesn't match credit card pattern.`;
|
|
@@ -127,7 +127,7 @@ const blobHTMLType = {
|
|
|
127
127
|
jml('textarea', {name: `${typeNamespace}-blobHTML`})
|
|
128
128
|
);
|
|
129
129
|
textarea.sceditorInstance = {
|
|
130
|
-
/* istanbul ignore next */
|
|
130
|
+
/* istanbul ignore next -- Guard */
|
|
131
131
|
val () {
|
|
132
132
|
throw new Error('Not yet instantiated');
|
|
133
133
|
}
|
|
@@ -36,7 +36,7 @@ if (typeof AggregateError !== 'undefined') {
|
|
|
36
36
|
specialErrorsMap.set('AggregateError', AggregateError);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
/* istanbul ignore next 5 */
|
|
39
|
+
/* istanbul ignore next 5 -- May not exist */
|
|
40
40
|
// @ts-expect-error Only use if available
|
|
41
41
|
if (typeof InternalError !== 'undefined') {
|
|
42
42
|
// @ts-expect-error Only use if available
|
package/src/typeChoices.js
CHANGED
|
@@ -193,9 +193,7 @@ function deriveXorBranchLabel (schemaObj, optText, idx) {
|
|
|
193
193
|
return String(values[0]);
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
|
-
if (schemaObj &&
|
|
197
|
-
(schemaObj.type === 'object' || schemaObj.type === 'properties')
|
|
198
|
-
) {
|
|
196
|
+
if (schemaObj && schemaObj.type === 'object') {
|
|
199
197
|
const {properties} = /** @type {import('zodexy').SzObject} */ (schemaObj);
|
|
200
198
|
const keys = properties && typeof properties === 'object'
|
|
201
199
|
? Object.keys(properties)
|
package/src/types.js
CHANGED
|
@@ -732,12 +732,6 @@ class Types {
|
|
|
732
732
|
// `record`/`tuple` are not shown as their own pull-down entries; they render
|
|
733
733
|
// as `Object`/`Array` (their schema, incl. child descriptions, informs the
|
|
734
734
|
// layout — see `arrayType.js`).
|
|
735
|
-
// `z.properties()` likewise renders through the `object` type/UI; when the
|
|
736
|
-
// schema supplies no label of its own, name it "Properties" so it is not
|
|
737
|
-
// shown as an indistinguishable "Object".
|
|
738
|
-
if (type === 'object' && schemaContent?.type === 'properties') {
|
|
739
|
-
optInfo[0] = 'Properties';
|
|
740
|
-
}
|
|
741
735
|
|
|
742
736
|
const schemaContentLabel = resolveSchemaMeta(schemaContent).label;
|
|
743
737
|
if (schemaContentLabel) {
|
package/src/utils/media.js
CHANGED
|
@@ -77,9 +77,9 @@ async function getUserMedia (constraints) {
|
|
|
77
77
|
try {
|
|
78
78
|
stream = await navigator.mediaDevices.getUserMedia(constraints);
|
|
79
79
|
} catch (err) {
|
|
80
|
-
/* istanbul ignore next */
|
|
80
|
+
/* istanbul ignore next -- Should be present */
|
|
81
81
|
console.error('err', err);
|
|
82
|
-
/* istanbul ignore next */
|
|
82
|
+
/* istanbul ignore next -- Should be present */
|
|
83
83
|
return null;
|
|
84
84
|
}
|
|
85
85
|
return stream;
|
|
@@ -96,7 +96,7 @@ async function startScreenCapture (displayMediaOptions) {
|
|
|
96
96
|
captureStream =
|
|
97
97
|
await navigator.mediaDevices.getDisplayMedia(displayMediaOptions);
|
|
98
98
|
} catch (err) {
|
|
99
|
-
/* istanbul ignore next */
|
|
99
|
+
/* istanbul ignore next -- Should not err */
|
|
100
100
|
console.error(`Error: ${err}`);
|
|
101
101
|
}
|
|
102
102
|
return captureStream;
|
|
@@ -613,11 +613,22 @@ export async function openRawEditorDialog ({
|
|
|
613
613
|
['div', {class: editorClass}]
|
|
614
614
|
];
|
|
615
615
|
|
|
616
|
+
// `dialogs.js`'s default `remove` behavior detaches the `<dialog>` from
|
|
617
|
+
// the document on close, but never tears down the `EditorView` mounted
|
|
618
|
+
// into it; left as-is, every "Edit raw"/"View raw" use leaks a live
|
|
619
|
+
// `EditorView` (and its internal `ResizeObserver`/DOM observers) bound
|
|
620
|
+
// to an already-detached subtree. Destroy it alongside the dialog.
|
|
621
|
+
const close = () => {
|
|
622
|
+
view.destroy();
|
|
623
|
+
};
|
|
624
|
+
|
|
616
625
|
const dialog = readonly
|
|
617
626
|
// @ts-expect-error TS bug
|
|
618
|
-
? dialogs.makeCancelDialog({children})
|
|
627
|
+
? dialogs.makeCancelDialog({children, close})
|
|
619
628
|
: dialogs.makeSubmitDialog({
|
|
620
629
|
submitText: 'Save',
|
|
630
|
+
// @ts-expect-error TS bug
|
|
631
|
+
close,
|
|
621
632
|
async submit ({dialog: dlg}) {
|
|
622
633
|
const text = view.state.doc.toString();
|
|
623
634
|
showError(dlg, '');
|
|
@@ -652,7 +663,6 @@ export async function openRawEditorDialog ({
|
|
|
652
663
|
}
|
|
653
664
|
dlg.close();
|
|
654
665
|
},
|
|
655
|
-
// @ts-expect-error TS bug
|
|
656
666
|
children
|
|
657
667
|
});
|
|
658
668
|
|
package/tsconfig.json
CHANGED
|
@@ -16,5 +16,5 @@
|
|
|
16
16
|
"outDir": "dist"
|
|
17
17
|
},
|
|
18
18
|
"include": ["src/**/*.js", "typings/sceditor.d.ts", "typings/json-6.d.ts"],
|
|
19
|
-
"exclude": ["node_modules", "src/deepEqual.js"
|
|
19
|
+
"exclude": ["node_modules", "src/deepEqual.js"]
|
|
20
20
|
}
|