@es-joy/jsoe 0.20.1 → 0.20.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 +4 -0
- package/dist/formats/schema.d.ts.map +1 -1
- package/dist/fundamentalTypes/arrayType.d.ts.map +1 -1
- package/dist/index.js +23 -3
- package/dist/typeChoices.d.ts +3 -1
- package/dist/typeChoices.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/formats/schema.js +1 -0
- package/src/fundamentalTypes/arrayType.js +4 -0
- package/src/typeChoices.js +18 -3
package/CHANGES.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/formats/schema.js"],"names":[],"mappings":"AAmMA;;;;GAIG;AACH,gDAJW,WAAW,gBACX,WAAW,GACT,GAAG,CAAC,WAAW,CAAC,
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/formats/schema.js"],"names":[],"mappings":"AAmMA;;;;GAIG;AACH,gDAJW,WAAW,gBACX,WAAW,GACT,GAAG,CAAC,WAAW,CAAC,CAiX5B;;0BA5fY,OAAO,OAAO,EAAE,MAAM;2BAGtB,OAAO,qBAAqB,EAAE,YAAY;;;;oBAnD1C,CAAC,IADD,CAAC,CAAC,MAAM,CAAC,CAAC;iCAMV,OAAO,CAChB,IAAI,CAAC,OAAO,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,CACrC;AAuiBH,6CAA6C;AAC7C,sBADW,OAAO,eAAe,EAAE,MAAM,CA2MvC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arrayType.d.ts","sourceRoot":"","sources":["../../src/fundamentalTypes/arrayType.js"],"names":[],"mappings":";sBAaa,MAAM;mDAKN,KAAK,GAAC,OAAO;oCAGb,MAAM,gBAAgB,EAAE;+BAGxB,MAAM,CAAC,iBAAiB,GAAG;IACvC,SAAa,EAAE,OAAO,mBAAmB,E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AM,CAAC,EAAE,OAAO,GAAC,SAAS,CAAA;CAAC,CAm2EvE"}
|
package/dist/index.js
CHANGED
|
@@ -2634,7 +2634,8 @@ dialogs.setLocale();
|
|
|
2634
2634
|
* type: string,
|
|
2635
2635
|
* baseValue?: import('./formats.js').StructuredCloneValue,
|
|
2636
2636
|
* bringIntoFocus?: boolean,
|
|
2637
|
-
* avoidReport?: boolean
|
|
2637
|
+
* avoidReport?: boolean,
|
|
2638
|
+
* specificSchema?: import('zodex').SzType
|
|
2638
2639
|
* }) => void} SetType
|
|
2639
2640
|
*/
|
|
2640
2641
|
|
|
@@ -2783,8 +2784,22 @@ const buildTypeChoices = ({
|
|
|
2783
2784
|
$custom: {
|
|
2784
2785
|
$getValue,
|
|
2785
2786
|
/** @type {SetType} */
|
|
2786
|
-
$setType ({
|
|
2787
|
-
|
|
2787
|
+
$setType ({
|
|
2788
|
+
type, baseValue, bringIntoFocus, avoidReport, specificSchema
|
|
2789
|
+
}) {
|
|
2790
|
+
if (schemaObjs && specificSchema) {
|
|
2791
|
+
const idx = schemaObjs.map((obj) => {
|
|
2792
|
+
return JSON.stringify(obj);
|
|
2793
|
+
}).indexOf(JSON.stringify(specificSchema));
|
|
2794
|
+
if (idx === -1) {
|
|
2795
|
+
console.log('schemaObjs', schemaObjs, specificSchema);
|
|
2796
|
+
this.value = type;
|
|
2797
|
+
} else {
|
|
2798
|
+
this.selectedIndex = idx + 1;
|
|
2799
|
+
}
|
|
2800
|
+
} else {
|
|
2801
|
+
this.value = type;
|
|
2802
|
+
}
|
|
2788
2803
|
this.$setStyles();
|
|
2789
2804
|
this.$addAndValidateEditUI({baseValue, bringIntoFocus, avoidReport});
|
|
2790
2805
|
},
|
|
@@ -9047,6 +9062,7 @@ function getTypesForSchema (schemaObject, originalJSON) {
|
|
|
9047
9062
|
]);
|
|
9048
9063
|
default: {
|
|
9049
9064
|
if ('$ref' in schemaObject) {
|
|
9065
|
+
// console.log('originalJSON', originalJSON, schemaObject.$ref);
|
|
9050
9066
|
const refObj = resolveJSONPointer({
|
|
9051
9067
|
obj: originalJSON,
|
|
9052
9068
|
path: /** @type {import('zodex').SzRef} */ (schemaObject).$ref
|
|
@@ -12963,6 +12979,10 @@ const arrayType = {
|
|
|
12963
12979
|
const typeChoices = this.$getTypeChoices();
|
|
12964
12980
|
typeChoices.$setType({
|
|
12965
12981
|
type, baseValue: value, bringIntoFocus,
|
|
12982
|
+
specificSchema:
|
|
12983
|
+
schema?.type === 'union' && schemaIdx !== undefined
|
|
12984
|
+
? schema.options[schemaIdx]
|
|
12985
|
+
: schema,
|
|
12966
12986
|
avoidReport: true
|
|
12967
12987
|
});
|
|
12968
12988
|
const root = typeChoices.$getTypeRoot();
|
package/dist/typeChoices.d.ts
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
* type: string,
|
|
4
4
|
* baseValue?: import('./formats.js').StructuredCloneValue,
|
|
5
5
|
* bringIntoFocus?: boolean,
|
|
6
|
-
* avoidReport?: boolean
|
|
6
|
+
* avoidReport?: boolean,
|
|
7
|
+
* specificSchema?: import('zodex').SzType
|
|
7
8
|
* }) => void} SetType
|
|
8
9
|
*/
|
|
9
10
|
/**
|
|
@@ -89,6 +90,7 @@ export type SetType = (cfg: {
|
|
|
89
90
|
baseValue?: import("./formats.js").StructuredCloneValue;
|
|
90
91
|
bringIntoFocus?: boolean;
|
|
91
92
|
avoidReport?: boolean;
|
|
93
|
+
specificSchema?: import("zodex").SzType;
|
|
92
94
|
}) => void;
|
|
93
95
|
export type AddTypeAndEditUI = (info: {
|
|
94
96
|
type: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeChoices.d.ts","sourceRoot":"","sources":["../src/typeChoices.js"],"names":[],"mappings":"AASA
|
|
1
|
+
{"version":3,"file":"typeChoices.d.ts","sourceRoot":"","sources":["../src/typeChoices.js"],"names":[],"mappings":"AASA;;;;;;;;GAQG;AAEH;;;;;;GAMG;AAEH;;;;;;;GAOG;AAEH;;GAEG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AC3B,KAAS,CAAC,EAAE,OAAO,cAAc,EAAE,oBAAoB,CAAC;IACxD,QAAY,CAAC,EAAE,OAAO,CAAC;IACvB,KAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,aAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,cAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,OAAW,CAAC,EAAE,OAAO,YAAY,EAAE,WAAW,CAAC;IAC/C,OAAW,CAAC,EAAE,OAAO,cAAc,EAAE,OAAO,CAAA;IAC5C,KAAS,CAAC,EAAE,OAAO,YAAY,EAAE,OAAO,CAAA;IACxC,MAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAkB,CAAC,EAAE,OAAO,2BAA2B,EAAE,WAAW,CAAC;IACrE,aAAiB,CAAC,EAAE,OAAO,2BAA2B,EAAE,WAAW,CAAC;CACjE,KACS;IACZ,QAAY,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC;IAChE,QAAY,EAAE,QAAQ,CAAC;IACvB,OAAW,EAAE,OAAO,CAAC;IACrB,cAAkB,EAAE,cAAc,CAAC;IACnC,QAAY,EAAE,QAAQ,CAAA;CACnB"}
|
package/package.json
CHANGED
package/src/formats/schema.js
CHANGED
|
@@ -555,6 +555,7 @@ export function getTypesForSchema (schemaObject, originalJSON) {
|
|
|
555
555
|
]);
|
|
556
556
|
default: {
|
|
557
557
|
if ('$ref' in schemaObject) {
|
|
558
|
+
// console.log('originalJSON', originalJSON, schemaObject.$ref);
|
|
558
559
|
const refObj = resolveJSONPointer({
|
|
559
560
|
obj: originalJSON,
|
|
560
561
|
path: /** @type {import('zodex').SzRef} */ (schemaObject).$ref
|
|
@@ -2271,6 +2271,10 @@ const arrayType = {
|
|
|
2271
2271
|
const typeChoices = this.$getTypeChoices();
|
|
2272
2272
|
typeChoices.$setType({
|
|
2273
2273
|
type, baseValue: value, bringIntoFocus,
|
|
2274
|
+
specificSchema:
|
|
2275
|
+
schema?.type === 'union' && schemaIdx !== undefined
|
|
2276
|
+
? schema.options[schemaIdx]
|
|
2277
|
+
: schema,
|
|
2274
2278
|
avoidReport: true
|
|
2275
2279
|
});
|
|
2276
2280
|
const root = typeChoices.$getTypeRoot();
|
package/src/typeChoices.js
CHANGED
|
@@ -12,7 +12,8 @@ import dialogs from './utils/dialogs.js';
|
|
|
12
12
|
* type: string,
|
|
13
13
|
* baseValue?: import('./formats.js').StructuredCloneValue,
|
|
14
14
|
* bringIntoFocus?: boolean,
|
|
15
|
-
* avoidReport?: boolean
|
|
15
|
+
* avoidReport?: boolean,
|
|
16
|
+
* specificSchema?: import('zodex').SzType
|
|
16
17
|
* }) => void} SetType
|
|
17
18
|
*/
|
|
18
19
|
|
|
@@ -161,8 +162,22 @@ export const buildTypeChoices = ({
|
|
|
161
162
|
$custom: {
|
|
162
163
|
$getValue,
|
|
163
164
|
/** @type {SetType} */
|
|
164
|
-
$setType ({
|
|
165
|
-
|
|
165
|
+
$setType ({
|
|
166
|
+
type, baseValue, bringIntoFocus, avoidReport, specificSchema
|
|
167
|
+
}) {
|
|
168
|
+
if (schemaObjs && specificSchema) {
|
|
169
|
+
const idx = schemaObjs.map((obj) => {
|
|
170
|
+
return JSON.stringify(obj);
|
|
171
|
+
}).indexOf(JSON.stringify(specificSchema));
|
|
172
|
+
if (idx === -1) {
|
|
173
|
+
console.log('schemaObjs', schemaObjs, specificSchema);
|
|
174
|
+
this.value = type;
|
|
175
|
+
} else {
|
|
176
|
+
this.selectedIndex = idx + 1;
|
|
177
|
+
}
|
|
178
|
+
} else {
|
|
179
|
+
this.value = type;
|
|
180
|
+
}
|
|
166
181
|
this.$setStyles();
|
|
167
182
|
this.$addAndValidateEditUI({baseValue, bringIntoFocus, avoidReport});
|
|
168
183
|
},
|