@alloy-js/json 0.5.0 → 0.7.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/CHANGELOG.md +15 -0
- package/babel.config.cjs +4 -1
- package/dist/src/components/JsonArray.d.ts +19 -8
- package/dist/src/components/JsonArray.d.ts.map +1 -1
- package/dist/src/components/JsonArray.js +67 -43
- package/dist/src/components/JsonArray.js.map +1 -1
- package/dist/src/components/JsonObject.d.ts +9 -1
- package/dist/src/components/JsonObject.d.ts.map +1 -1
- package/dist/src/components/JsonObject.js +47 -24
- package/dist/src/components/JsonObject.js.map +1 -1
- package/dist/src/components/JsonValue.d.ts +5 -0
- package/dist/src/components/JsonValue.d.ts.map +1 -1
- package/dist/src/components/JsonValue.js +7 -6
- package/dist/src/components/JsonValue.js.map +1 -1
- package/dist/src/components/SourceFile.d.ts.map +1 -1
- package/dist/src/components/SourceFile.js.map +1 -1
- package/dist/src/components/stc/index.d.ts +5 -5
- package/dist/test/array.test.d.ts.map +1 -1
- package/dist/test/utils.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -5
- package/src/components/JsonArray.tsx +68 -42
- package/src/components/JsonObject.tsx +59 -31
- package/src/components/JsonValue.tsx +17 -6
- package/src/components/SourceFile.tsx +10 -7
- package/temp/api.json +211 -7
- package/test/array.test.tsx +36 -6
- package/test/object.test.tsx +40 -11
- package/test/reference.test.tsx +50 -41
- package/test/utils.tsx +7 -5
- package/test/vitest.d.ts +7 -1
- package/vitest.config.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog - @alloy-js/json
|
|
2
2
|
|
|
3
|
+
## 0.7.0
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- [#61](https://github.com/alloy-framework/alloy/pull/61) Allow specifying multiple refkeys for values.
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## 0.6.0
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
- [#56](https://github.com/alloy-framework/alloy/pull/56) Emitted code is now formatted properly.
|
|
15
|
+
- [#55](https://github.com/alloy-framework/alloy/pull/55) Objects and arrays now properly handle reactive JS values.
|
|
16
|
+
|
|
17
|
+
|
|
3
18
|
|
|
4
19
|
|
|
5
20
|
## 0.5.0
|
package/babel.config.cjs
CHANGED
|
@@ -4,6 +4,11 @@ export interface JsonArrayPropsBase {
|
|
|
4
4
|
* elsewhere via this refkey.
|
|
5
5
|
**/
|
|
6
6
|
refkey?: Refkey;
|
|
7
|
+
/**
|
|
8
|
+
* The refkeys for the JSON array. When provided, this array can be referenced
|
|
9
|
+
* elsewhere via any of these refkeys.
|
|
10
|
+
**/
|
|
11
|
+
refkeys?: Refkey[];
|
|
7
12
|
}
|
|
8
13
|
/**
|
|
9
14
|
* Create a JSON Array by serializing the given JavaScript array to JSON.
|
|
@@ -33,18 +38,24 @@ export type JsonArrayProps = JsonArrayPropsWithJsValue | JsonArrayPropsWithChild
|
|
|
33
38
|
* @see {@link @alloy-js/core#(MemberScopeContext:variable)}
|
|
34
39
|
*/
|
|
35
40
|
export declare function JsonArray(props: JsonArrayProps): Children;
|
|
36
|
-
|
|
41
|
+
/**
|
|
42
|
+
* Create a JSON Array element by providing a JS value that will be serialized
|
|
43
|
+
* to JSON.
|
|
44
|
+
*/
|
|
45
|
+
export interface JsonArrayElementPropsWithJsValue {
|
|
46
|
+
jsValue: unknown;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Create a JSON Array element by providing children.
|
|
50
|
+
*/
|
|
51
|
+
export interface JsonArrayElementPropsWithChildren {
|
|
37
52
|
children: Children;
|
|
38
53
|
}
|
|
54
|
+
export type JsonArrayElementProps = JsonArrayElementPropsWithJsValue | JsonArrayElementPropsWithChildren;
|
|
39
55
|
/**
|
|
40
56
|
* Create a JSON Array element. This component should be used inside of a
|
|
41
|
-
* {@link JsonArray} component.
|
|
42
|
-
*
|
|
43
|
-
* @remarks
|
|
44
|
-
*
|
|
45
|
-
* It does not add any syntax, but is required in
|
|
46
|
-
* order to establish the correct scope for the array element, allowing
|
|
47
|
-
* references to array elements to work properly.
|
|
57
|
+
* {@link JsonArray} component. Can either be provided `children`, or a JS
|
|
58
|
+
* value which will be serialized to JSON.
|
|
48
59
|
*
|
|
49
60
|
* @see {@link @alloy-js/core#(MemberDeclarationContext:variable)}
|
|
50
61
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JsonArray.d.ts","sourceRoot":"","sources":["../../../src/components/JsonArray.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"JsonArray.d.ts","sourceRoot":"","sources":["../../../src/components/JsonArray.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQR,MAAM,EAGP,MAAM,gBAAgB,CAAC;AAIxB,MAAM,WAAW,kBAAkB;IACjC;;QAEI;IACJ,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;QAGI;IACJ,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,yBAA0B,SAAQ,kBAAkB;IACnE;;OAEG;IACH,OAAO,EAAE,OAAO,EAAE,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,0BAA2B,SAAQ,kBAAkB;IACpE;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,MAAM,MAAM,cAAc,GACtB,yBAAyB,GACzB,0BAA0B,CAAC;AAE/B;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,YA6C9C;AAED;;;GAGG;AACH,MAAM,WAAW,gCAAgC;IAC/C,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,iCAAiC;IAChD,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED,MAAM,MAAM,qBAAqB,GAC7B,gCAAgC,GAChC,iCAAiC,CAAC;AAEtC;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,YA6B5D"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { createIntrinsic as _$createIntrinsic } from "@alloy-js/core/jsx-runtime";
|
|
1
2
|
import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
3
|
import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
|
|
3
|
-
import { Indent
|
|
4
|
-
import { mapJoin, MemberDeclaration, MemberScope, OutputSymbolFlags, useMemberDeclaration, useMemberScope } from "@alloy-js/core";
|
|
4
|
+
import { For, Indent, List, MemberDeclaration, MemberScope, onCleanup, OutputSymbolFlags, useMemberDeclaration, useMemberScope } from "@alloy-js/core";
|
|
5
5
|
import { createJsonOutputSymbol } from "../symbols/json-symbol.js";
|
|
6
6
|
import { JsonValue } from "./JsonValue.js";
|
|
7
7
|
|
|
@@ -28,59 +28,71 @@ export function JsonArray(props) {
|
|
|
28
28
|
const binder = memberSymbol.binder;
|
|
29
29
|
binder.addStaticMembersToSymbol(memberSymbol);
|
|
30
30
|
if (props.refkey) {
|
|
31
|
-
memberSymbol.
|
|
31
|
+
memberSymbol.refkeys = [...(props.refkey ? [props.refkey] : []), ...(props.refkeys ?? [])];
|
|
32
32
|
}
|
|
33
33
|
if (!("jsValue" in props)) {
|
|
34
34
|
return _$createComponent(MemberScope, {
|
|
35
35
|
owner: memberSymbol,
|
|
36
36
|
get children() {
|
|
37
|
-
return
|
|
37
|
+
return _$createIntrinsic("group", {
|
|
38
38
|
get children() {
|
|
39
|
-
return ["
|
|
39
|
+
return ["[", _$createComponent(Indent, {
|
|
40
|
+
"break": "soft",
|
|
41
|
+
trailingBreak: true,
|
|
42
|
+
get children() {
|
|
43
|
+
return _$createComponent(List, {
|
|
44
|
+
comma: true,
|
|
45
|
+
line: true,
|
|
46
|
+
get children() {
|
|
47
|
+
return props.children;
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}), "]"];
|
|
40
52
|
}
|
|
41
|
-
}), "\n]"];
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
const jsValue = props.jsValue ?? [];
|
|
46
|
-
if (jsValue.length === 0) {
|
|
47
|
-
return "[]";
|
|
48
|
-
}
|
|
49
|
-
const elements = mapJoin(jsValue, value => {
|
|
50
|
-
return _$createComponent(JsonArrayElement, {
|
|
51
|
-
get children() {
|
|
52
|
-
return _$createComponent(JsonValue, {
|
|
53
|
-
jsValue: value
|
|
54
53
|
});
|
|
55
54
|
}
|
|
56
55
|
});
|
|
57
|
-
}, {
|
|
58
|
-
joiner: ",\n"
|
|
59
|
-
});
|
|
60
|
-
let contents;
|
|
61
|
-
if (jsValue.length === 1) {
|
|
62
|
-
contents = ["[", elements, "]"];
|
|
63
|
-
} else {
|
|
64
|
-
contents = ["[", _$createComponent(_$Indent, {
|
|
65
|
-
get children() {
|
|
66
|
-
return ["\n", elements];
|
|
67
|
-
}
|
|
68
|
-
}), "\n]"];
|
|
69
56
|
}
|
|
57
|
+
const jsValue = props.jsValue ?? [];
|
|
70
58
|
return _$createComponent(MemberScope, {
|
|
71
59
|
owner: memberSymbol,
|
|
72
|
-
children
|
|
60
|
+
get children() {
|
|
61
|
+
return _$createIntrinsic("group", {
|
|
62
|
+
get children() {
|
|
63
|
+
return ["[", _$createComponent(Indent, {
|
|
64
|
+
"break": "soft",
|
|
65
|
+
trailingBreak: true,
|
|
66
|
+
get children() {
|
|
67
|
+
return _$createComponent(For, {
|
|
68
|
+
each: jsValue,
|
|
69
|
+
comma: true,
|
|
70
|
+
line: true,
|
|
71
|
+
children: value => _$createComponent(JsonArrayElement, {
|
|
72
|
+
jsValue: value
|
|
73
|
+
})
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}), "]"];
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}
|
|
73
80
|
});
|
|
74
81
|
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Create a JSON Array element by providing a JS value that will be serialized
|
|
85
|
+
* to JSON.
|
|
86
|
+
*/
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Create a JSON Array element by providing children.
|
|
90
|
+
*/
|
|
91
|
+
|
|
75
92
|
/**
|
|
76
93
|
* Create a JSON Array element. This component should be used inside of a
|
|
77
|
-
* {@link JsonArray} component.
|
|
78
|
-
*
|
|
79
|
-
* @remarks
|
|
80
|
-
*
|
|
81
|
-
* It does not add any syntax, but is required in
|
|
82
|
-
* order to establish the correct scope for the array element, allowing
|
|
83
|
-
* references to array elements to work properly.
|
|
94
|
+
* {@link JsonArray} component. Can either be provided `children`, or a JS
|
|
95
|
+
* value which will be serialized to JSON.
|
|
84
96
|
*
|
|
85
97
|
* @see {@link @alloy-js/core#(MemberDeclarationContext:variable)}
|
|
86
98
|
*/
|
|
@@ -97,11 +109,23 @@ export function JsonArrayElement(props) {
|
|
|
97
109
|
name,
|
|
98
110
|
flags: OutputSymbolFlags.StaticMember
|
|
99
111
|
});
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
get children() {
|
|
103
|
-
return props.children;
|
|
104
|
-
}
|
|
112
|
+
onCleanup(() => {
|
|
113
|
+
sym.binder.deleteSymbol(sym);
|
|
105
114
|
});
|
|
115
|
+
function wrap(children) {
|
|
116
|
+
return _$createComponent(MemberDeclaration, {
|
|
117
|
+
symbol: sym,
|
|
118
|
+
children: children
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
if (!("jsValue" in props)) {
|
|
122
|
+
return wrap(() => props.children);
|
|
123
|
+
} else {
|
|
124
|
+
return wrap(_$createComponent(JsonValue, {
|
|
125
|
+
get jsValue() {
|
|
126
|
+
return props.jsValue;
|
|
127
|
+
}
|
|
128
|
+
}));
|
|
129
|
+
}
|
|
106
130
|
}
|
|
107
131
|
//# sourceMappingURL=JsonArray.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JsonArray.js","names":["
|
|
1
|
+
{"version":3,"file":"JsonArray.js","names":["For","Indent","List","MemberDeclaration","MemberScope","onCleanup","OutputSymbolFlags","useMemberDeclaration","useMemberScope","createJsonOutputSymbol","JsonValue","JsonArray","props","memberSymbol","Error","binder","addStaticMembersToSymbol","refkey","refkeys","_$createComponent","owner","children","_$createIntrinsic","trailingBreak","comma","line","jsValue","each","value","JsonArrayElement","memberScope","staticMembers","name","String","symbols","size","sym","flags","StaticMember","deleteSymbol","wrap","symbol"],"sources":["../../../src/components/JsonArray.tsx"],"sourcesContent":[null],"mappings":";;;AAAA,SAEEA,GAAG,EACHC,MAAM,EACNC,IAAI,EACJC,iBAAiB,EACjBC,WAAW,EACXC,SAAS,EACTC,iBAAiB,EAEjBC,oBAAoB,EACpBC,cAAc,QACT,gBAAgB;AACvB,SAASC,sBAAsB,QAAQ,2BAA2B;AAClE,SAASC,SAAS;;AAelB;AACA;AACA;;AAQA;AACA;AACA;AACA;;AAaA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,SAASA,CAACC,KAAqB,EAAE;EAC/C,MAAMC,YAAY,GAAGN,oBAAoB,CAAC,CAAC;EAC3C,IAAI,CAACM,YAAY,EAAE;IACjB,MAAM,IAAIC,KAAK,CAAC,4BAA4B,CAAC;EAC/C;EACA,MAAMC,MAAM,GAAGF,YAAY,CAACE,MAAM;EAClCA,MAAM,CAACC,wBAAwB,CAACH,YAAY,CAAC;EAC7C,IAAID,KAAK,CAACK,MAAM,EAAE;IAChBJ,YAAY,CAACK,OAAO,GAAG,CACrB,IAAIN,KAAK,CAACK,MAAM,GAAG,CAACL,KAAK,CAACK,MAAM,CAAC,GAAG,EAAE,CAAC,EACvC,IAAIL,KAAK,CAACM,OAAO,IAAI,EAAE,CAAC,CACzB;EACH;EAEA,IAAI,EAAE,SAAS,IAAIN,KAAK,CAAC,EAAE;IACzB,OAAAO,iBAAA,CACGf,WAAW;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ACG,OAAO,CAACC,IAAI,CAAC;EAE3D,MAAMC,GAAG,GAAG3B,sBAAsB,CAAC;IACjCuB,IAAI;IACJK,KAAK,EAAE/B,iBAAiB,CAACgC;EAC3B,CAAC,CAAC;EAEFjC,SAAS,CAAC,MAAM;IACd+B,GAAG,CAACrB,MAAM,CAACwB,YAAY,CAACH,GAAG,CAAC;EAC9B,CAAC,CAAC;EAEF,SAASI,IAAIA,CAACnB,QAAkB,EAAE;IAChC,OAAAF,iBAAA,CAAQhB,iBAAiB;MAACsC,MAAM,EAAEL,GAAG;MAAAf,QAAA,EAAGA;IAAQ;EAClD;EACA,IAAI,EAAE,SAAS,IAAIT,KAAK,CAAC,EAAE;IACzB,OAAO4B,IAAI,CAAC,MAAM5B,KAAK,CAACS,QAAQ,CAAC;EACnC,CAAC,MAAM;IACL,OAAOmB,IAAI,CAAArB,iBAAA,CAAET,SAAS;MAAA,IAACgB,OAAOA,CAAA;QAAA,OAAEd,KAAK,CAACc,OAAO;MAAA;IAAA,EAAI,CAAC;EACpD;AACF","ignoreList":[]}
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import { Children, Refkey } from "@alloy-js/core";
|
|
2
2
|
export interface JsonObjectPropsBase {
|
|
3
|
-
/** The refkey for the JSON
|
|
3
|
+
/** The refkey for the JSON object. When provided, this value can be referenced
|
|
4
4
|
* elsewhere via this refkey.
|
|
5
5
|
**/
|
|
6
6
|
refkey?: Refkey;
|
|
7
|
+
/**
|
|
8
|
+
* The refkeys for the JSON object. When provided, this value can be
|
|
9
|
+
* referenced elsewhere via any of these refkeys.
|
|
10
|
+
**/
|
|
11
|
+
refkeys?: Refkey[];
|
|
12
|
+
style?: {
|
|
13
|
+
concise?: boolean;
|
|
14
|
+
};
|
|
7
15
|
}
|
|
8
16
|
/**
|
|
9
17
|
* Create a JSON object by providing children that define the object's contents.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JsonObject.d.ts","sourceRoot":"","sources":["../../../src/components/JsonObject.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"JsonObject.d.ts","sourceRoot":"","sources":["../../../src/components/JsonObject.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EASR,MAAM,EAEP,MAAM,gBAAgB,CAAC;AAIxB,MAAM,WAAW,mBAAmB;IAClC;;QAEI;IACJ,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;QAGI;IACJ,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAEnB,KAAK,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;CAC/B;AAED;;;;GAIG;AACH,MAAM,WAAW,2BAA4B,SAAQ,mBAAmB;IACtE;;;OAGG;IACH,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,0BAA2B,SAAQ,mBAAmB;IACrE;;;OAGG;IACH,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/E;AAED,MAAM,MAAM,eAAe,GACvB,2BAA2B,GAC3B,0BAA0B,CAAC;AAE/B;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,YA0DhD;AAED;;;GAGG;AACH,MAAM,WAAW,+BAA+B;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,8BAA8B;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,MAAM,mBAAmB,GAC3B,+BAA+B,GAC/B,8BAA8B,CAAC;AAEnC;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,mBAAmB,YAuB5D"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { createIntrinsic as _$createIntrinsic } from "@alloy-js/core/jsx-runtime";
|
|
1
2
|
import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
3
|
import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import { computed, mapJoin, MemberDeclaration, MemberScope, OutputSymbolFlags, useMemberDeclaration } from "@alloy-js/core";
|
|
4
|
+
import { computed, For, Indent, List, MemberDeclaration, MemberScope, onCleanup, OutputSymbolFlags, useMemberDeclaration } from "@alloy-js/core";
|
|
5
5
|
import { createJsonOutputSymbol } from "../symbols/json-symbol.js";
|
|
6
6
|
import { JsonValue } from "./JsonValue.js";
|
|
7
7
|
|
|
@@ -30,50 +30,70 @@ export function JsonObject(props) {
|
|
|
30
30
|
const binder = memberSymbol.binder;
|
|
31
31
|
binder.addStaticMembersToSymbol(memberSymbol);
|
|
32
32
|
if (props.refkey) {
|
|
33
|
-
memberSymbol.
|
|
33
|
+
memberSymbol.refkeys = [...(props.refkey ? [props.refkey] : []), ...(props.refkeys ?? [])];
|
|
34
34
|
}
|
|
35
35
|
if (!("jsValue" in props)) {
|
|
36
36
|
return _$createComponent(MemberScope, {
|
|
37
37
|
owner: memberSymbol,
|
|
38
38
|
get children() {
|
|
39
|
-
return
|
|
39
|
+
return _$createIntrinsic("group", {
|
|
40
40
|
get children() {
|
|
41
|
-
return ["
|
|
41
|
+
return ["{", _$createComponent(Indent, {
|
|
42
|
+
get ["break"]() {
|
|
43
|
+
return props.style?.concise ? "soft" : "hard";
|
|
44
|
+
},
|
|
45
|
+
trailingBreak: true,
|
|
46
|
+
get children() {
|
|
47
|
+
return _$createComponent(List, {
|
|
48
|
+
comma: true,
|
|
49
|
+
softline: true,
|
|
50
|
+
get children() {
|
|
51
|
+
return props.children;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}), "}"];
|
|
42
56
|
}
|
|
43
|
-
})
|
|
57
|
+
});
|
|
44
58
|
}
|
|
45
59
|
});
|
|
46
60
|
}
|
|
47
|
-
const
|
|
61
|
+
const entries = computed(() => {
|
|
48
62
|
const jsValue = props.jsValue;
|
|
49
|
-
let properties;
|
|
50
63
|
if (Array.isArray(jsValue)) {
|
|
51
|
-
|
|
64
|
+
return jsValue;
|
|
52
65
|
} else if (jsValue instanceof Map) {
|
|
53
|
-
|
|
66
|
+
return [...jsValue.entries()];
|
|
54
67
|
} else if (jsValue !== undefined) {
|
|
55
|
-
|
|
68
|
+
return globalThis.Object.entries(jsValue);
|
|
56
69
|
} else {
|
|
57
|
-
|
|
70
|
+
return [];
|
|
58
71
|
}
|
|
59
|
-
const elements = mapJoin(properties, ([name, value]) => {
|
|
60
|
-
return _$createComponent(JsonObjectProperty, {
|
|
61
|
-
name: name,
|
|
62
|
-
jsValue: value
|
|
63
|
-
});
|
|
64
|
-
}, {
|
|
65
|
-
joiner: ",\n"
|
|
66
|
-
});
|
|
67
|
-
return elements;
|
|
68
72
|
});
|
|
69
73
|
return _$createComponent(MemberScope, {
|
|
70
74
|
owner: memberSymbol,
|
|
71
75
|
get children() {
|
|
72
|
-
return
|
|
76
|
+
return _$createIntrinsic("group", {
|
|
73
77
|
get children() {
|
|
74
|
-
return ["
|
|
78
|
+
return ["{", _$createComponent(Indent, {
|
|
79
|
+
get ["break"]() {
|
|
80
|
+
return props.style?.concise ? "soft" : "hard";
|
|
81
|
+
},
|
|
82
|
+
trailingBreak: true,
|
|
83
|
+
get children() {
|
|
84
|
+
return _$createComponent(For, {
|
|
85
|
+
each: entries,
|
|
86
|
+
comma: true,
|
|
87
|
+
softline: true,
|
|
88
|
+
children: ([name, value]) => _$createComponent(JsonObjectProperty, {
|
|
89
|
+
name: name,
|
|
90
|
+
jsValue: value
|
|
91
|
+
})
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
}), "}"];
|
|
75
95
|
}
|
|
76
|
-
})
|
|
96
|
+
});
|
|
77
97
|
}
|
|
78
98
|
});
|
|
79
99
|
}
|
|
@@ -99,6 +119,9 @@ export function JsonObjectProperty(props) {
|
|
|
99
119
|
name: props.name,
|
|
100
120
|
flags: OutputSymbolFlags.StaticMember
|
|
101
121
|
});
|
|
122
|
+
onCleanup(() => {
|
|
123
|
+
sym.binder.deleteSymbol(sym);
|
|
124
|
+
});
|
|
102
125
|
const wrap = children => {
|
|
103
126
|
return _$createComponent(MemberDeclaration, {
|
|
104
127
|
symbol: sym,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JsonObject.js","names":["computed","
|
|
1
|
+
{"version":3,"file":"JsonObject.js","names":["computed","For","Indent","List","MemberDeclaration","MemberScope","onCleanup","OutputSymbolFlags","useMemberDeclaration","createJsonOutputSymbol","JsonValue","JsonObject","props","memberSymbol","Error","binder","addStaticMembersToSymbol","refkey","refkeys","_$createComponent","owner","children","_$createIntrinsic","break","style","concise","trailingBreak","comma","softline","entries","jsValue","Array","isArray","Map","undefined","globalThis","Object","each","name","value","JsonObjectProperty","sym","flags","StaticMember","deleteSymbol","wrap","symbol","_$memo"],"sources":["../../../src/components/JsonObject.tsx"],"sourcesContent":[null],"mappings":";;;AAAA,SAEEA,QAAQ,EACRC,GAAG,EACHC,MAAM,EACNC,IAAI,EACJC,iBAAiB,EACjBC,WAAW,EACXC,SAAS,EACTC,iBAAiB,EAEjBC,oBAAoB,QACf,gBAAgB;AACvB,SAASC,sBAAsB,QAAQ,2BAA2B;AAClE,SAASC,SAAS;;AAiBlB;AACA;AACA;AACA;AACA;;AASA;AACA;AACA;;AAaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,UAAUA,CAACC,KAAsB,EAAE;EACjD,MAAMC,YAAY,GAAGL,oBAAoB,CAAC,CAAC;EAC3C,IAAI,CAACK,YAAY,EAAE;IACjB,MAAM,IAAIC,KAAK,CAAC,4BAA4B,CAAC;EAC/C;EACA,MAAMC,MAAM,GAAGF,YAAY,CAACE,MAAM;EAClCA,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AAE;IACzB,OAAOiC,IAAI,CAACjC,KAAK,CAACS,QAAQ,CAAC;EAC7B;EAEA,OAAOwB,IAAI,CAAA1B,iBAAA,CAAET,SAAS;IAAA,IAACoB,OAAOA,CAAA;MAAA,OAAElB,KAAK,CAACkB,OAAO;IAAA;EAAA,EAAI,CAAC;AACpD","ignoreList":[]}
|
|
@@ -5,6 +5,11 @@ export interface JsonValueProps {
|
|
|
5
5
|
* elsewhere via this refkey.
|
|
6
6
|
**/
|
|
7
7
|
refkey?: Refkey;
|
|
8
|
+
/**
|
|
9
|
+
* The refkeys for the JSON value. When provided, these values can be
|
|
10
|
+
* referenced elsewhere via any of these refkeys.
|
|
11
|
+
**/
|
|
12
|
+
refkeys?: Refkey[];
|
|
8
13
|
/**
|
|
9
14
|
* The JS value to serialize to JSON. When provided, thi
|
|
10
15
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JsonValue.d.ts","sourceRoot":"","sources":["../../../src/components/JsonValue.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAwB,MAAM,gBAAgB,CAAC;AAI9D,MAAM,WAAW,cAAc;IAC7B;;;QAGI;IACJ,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"JsonValue.d.ts","sourceRoot":"","sources":["../../../src/components/JsonValue.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAwB,MAAM,gBAAgB,CAAC;AAI9D,MAAM,WAAW,cAAc;IAC7B;;;QAGI;IACJ,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;QAGI;IACJ,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAEnB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,qCA6B9C"}
|
|
@@ -10,16 +10,17 @@ import { JsonObject } from "./JsonObject.js";
|
|
|
10
10
|
* appropriate.
|
|
11
11
|
*/
|
|
12
12
|
export function JsonValue(props) {
|
|
13
|
+
const refkeys = [...(props.refkey ? [props.refkey] : []), ...(props.refkeys ?? [])];
|
|
13
14
|
if (props.jsValue === null) {
|
|
14
|
-
setMemberRefkey(
|
|
15
|
+
setMemberRefkey(refkeys);
|
|
15
16
|
return "null";
|
|
16
17
|
}
|
|
17
18
|
if (typeof props.jsValue === "number" || typeof props.jsValue === "boolean") {
|
|
18
|
-
setMemberRefkey(
|
|
19
|
+
setMemberRefkey(refkeys);
|
|
19
20
|
return String(props.jsValue);
|
|
20
21
|
}
|
|
21
22
|
if (typeof props.jsValue === "string") {
|
|
22
|
-
setMemberRefkey(
|
|
23
|
+
setMemberRefkey(refkeys);
|
|
23
24
|
return `"${props.jsValue}"`;
|
|
24
25
|
}
|
|
25
26
|
if (Array.isArray(props.jsValue)) {
|
|
@@ -38,12 +39,12 @@ export function JsonValue(props) {
|
|
|
38
39
|
}
|
|
39
40
|
throw new Error("Cannot emit js value with type of " + typeof props.jsValue);
|
|
40
41
|
}
|
|
41
|
-
function setMemberRefkey(
|
|
42
|
-
if (
|
|
42
|
+
function setMemberRefkey(keys) {
|
|
43
|
+
if (keys.length === 0) return;
|
|
43
44
|
const member = useMemberDeclaration();
|
|
44
45
|
if (!member) {
|
|
45
46
|
throw new Error("Missing member declaration.");
|
|
46
47
|
}
|
|
47
|
-
member.
|
|
48
|
+
member.refkeys = keys;
|
|
48
49
|
}
|
|
49
50
|
//# sourceMappingURL=JsonValue.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JsonValue.js","names":["useMemberDeclaration","JsonArray","JsonObject","JsonValue","props","
|
|
1
|
+
{"version":3,"file":"JsonValue.js","names":["useMemberDeclaration","JsonArray","JsonObject","JsonValue","props","refkeys","refkey","jsValue","setMemberRefkey","String","Array","isArray","_$createComponent","Error","keys","length","member"],"sources":["../../../src/components/JsonValue.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAAiBA,oBAAoB,QAAQ,gBAAgB;AAC7D,SAASC,SAAS;AAClB,SAASC,UAAU;AAqBnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,SAASA,CAACC,KAAqB,EAAE;EAC/C,MAAMC,OAAO,GAAG,CACd,IAAID,KAAK,CAACE,MAAM,GAAG,CAACF,KAAK,CAACE,MAAM,CAAC,GAAG,EAAE,CAAC,EACvC,IAAIF,KAAK,CAACC,OAAO,IAAI,EAAE,CAAC,CACzB;EACD,IAAID,KAAK,CAACG,OAAO,KAAK,IAAI,EAAE;IAC1BC,eAAe,CAACH,OAAO,CAAC;IACxB,OAAO,MAAM;EACf;EAEA,IAAI,OAAOD,KAAK,CAACG,OAAO,KAAK,QAAQ,IAAI,OAAOH,KAAK,CAACG,OAAO,KAAK,SAAS,EAAE;IAC3EC,eAAe,CAACH,OAAO,CAAC;IACxB,OAAOI,MAAM,CAACL,KAAK,CAACG,OAAO,CAAC;EAC9B;EAEA,IAAI,OAAOH,KAAK,CAACG,OAAO,KAAK,QAAQ,EAAE;IACrCC,eAAe,CAACH,OAAO,CAAC;IACxB,OAAO,IAAID,KAAK,CAACG,OAAO,GAAG;EAC7B;EAEA,IAAIG,KAAK,CAACC,OAAO,CAACP,KAAK,CAACG,OAAO,CAAC,EAAE;IAChC,OAAAK,iBAAA,CAAQX,SAAS;MAAA,IAACM,OAAOA,CAAA;QAAA,OAAEH,KAAK,CAACG,OAAO;MAAA;IAAA;EAC1C;EAEA,IAAI,OAAOH,KAAK,CAACG,OAAO,KAAK,QAAQ,EAAE;IACrC,OAAAK,iBAAA,CAAQV,UAAU;MAAA,IAACK,OAAOA,CAAA;QAAA,OAAEH,KAAK,CAACG,OAAO;MAAA;IAAA;EAC3C;EAEA,MAAM,IAAIM,KAAK,CAAC,oCAAoC,GAAG,OAAOT,KAAK,CAACG,OAAO,CAAC;AAC9E;AAEA,SAASC,eAAeA,CAACM,IAAc,EAAE;EACvC,IAAIA,IAAI,CAACC,MAAM,KAAK,CAAC,EAAE;EACvB,MAAMC,MAAM,GAAGhB,oBAAoB,CAAC,CAAC;EACrC,IAAI,CAACgB,MAAM,EAAE;IACX,MAAM,IAAIH,KAAK,CAAC,6BAA6B,CAAC;EAChD;EAEAG,MAAM,CAACX,OAAO,GAAGS,IAAI;AACvB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SourceFile.d.ts","sourceRoot":"","sources":["../../../src/components/SourceFile.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAIT,MAAM,gBAAgB,CAAC;AAKxB,MAAM,WAAW,eAAe;IAC9B,qEAAqE;IACrE,IAAI,EAAE,MAAM,CAAC;IAEb,sCAAsC;IACtC,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"SourceFile.d.ts","sourceRoot":"","sources":["../../../src/components/SourceFile.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAIT,MAAM,gBAAgB,CAAC;AAKxB,MAAM,WAAW,eAAe;IAC9B,qEAAqE;IACrE,IAAI,EAAE,MAAM,CAAC;IAEb,sCAAsC;IACtC,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,YAwBhD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SourceFile.js","names":["SourceFile","CoreSourceFile","createSourceFileTap","MemberDeclaration","JsonFileContext","createJsonOutputSymbol","Reference","props","jsonValueSym","name","fileContext","symbol","path","SfTapper","context","_$createComponent","filetype","reference","children","Provider","value"],"sources":["../../../src/components/SourceFile.tsx"],"sourcesContent":[null],"mappings":";;AAAA,SAEEA,UAAU,IAAIC,cAAc,EAC5BC,mBAAmB,EACnBC,iBAAiB,QACZ,gBAAgB;AACvB,SAASC,eAAe,QAAQ,+BAA+B;AAC/D,SAASC,sBAAsB,QAAQ,2BAA2B;AAClE,SAASC,SAAS;AAUlB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASN,UAAUA,CAACO,KAAsB,EAAE;EACjD,MAAMC,YAAY,GAAGH,sBAAsB,CAAC;IAC1CI,IAAI,EAAE;EACR,CAAC,CAAC;EAEF,MAAMC,WAA4B,GAAG;IACnCC,MAAM,EAAEH,YAAY;IACpBI,IAAI,EAAEL,KAAK,CAACK;EACd,CAAC;EAED,MAAMC,QAAQ,GAAGX,mBAAmB,CAAEY,OAAO,IAAK;IAChDN,YAAY,CAACC,IAAI,GAAGK,OAAO,CAACF,IAAI;EAClC,CAAC,CAAC;EAEF,OAAAG,iBAAA,
|
|
1
|
+
{"version":3,"file":"SourceFile.js","names":["SourceFile","CoreSourceFile","createSourceFileTap","MemberDeclaration","JsonFileContext","createJsonOutputSymbol","Reference","props","jsonValueSym","name","fileContext","symbol","path","SfTapper","context","_$createComponent","filetype","reference","children","Provider","value"],"sources":["../../../src/components/SourceFile.tsx"],"sourcesContent":[null],"mappings":";;AAAA,SAEEA,UAAU,IAAIC,cAAc,EAC5BC,mBAAmB,EACnBC,iBAAiB,QACZ,gBAAgB;AACvB,SAASC,eAAe,QAAQ,+BAA+B;AAC/D,SAASC,sBAAsB,QAAQ,2BAA2B;AAClE,SAASC,SAAS;AAUlB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASN,UAAUA,CAACO,KAAsB,EAAE;EACjD,MAAMC,YAAY,GAAGH,sBAAsB,CAAC;IAC1CI,IAAI,EAAE;EACR,CAAC,CAAC;EAEF,MAAMC,WAA4B,GAAG;IACnCC,MAAM,EAAEH,YAAY;IACpBI,IAAI,EAAEL,KAAK,CAACK;EACd,CAAC;EAED,MAAMC,QAAQ,GAAGX,mBAAmB,CAAEY,OAAO,IAAK;IAChDN,YAAY,CAACC,IAAI,GAAGK,OAAO,CAACF,IAAI;EAClC,CAAC,CAAC;EAEF,OAAAG,iBAAA,CACGd,cAAc;IAACe,QAAQ;IAAA,IAAQJ,IAAIA,CAAA;MAAA,OAAEL,KAAK,CAACK,IAAI;IAAA;IAAEK,SAAS,EAAEX,SAAS;IAAA,IAAAY,SAAA;MAAA,QAAAH,iBAAA,CACnEF,QAAQ,OAAAE,iBAAA,CACRX,eAAe,CAACe,QAAQ;QAACC,KAAK,EAAEV,WAAW;QAAA,IAAAQ,SAAA;UAAA,OAAAH,iBAAA,CACzCZ,iBAAiB;YAACQ,MAAM,EAAEH,YAAY;YAAA,IAAAU,SAAA;cAAA,OACpCX,KAAK,CAACW,QAAQ;YAAA;UAAA;QAAA;MAAA;IAAA;EAAA;AAKzB","ignoreList":[]}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import * as Jsx from "../index.js";
|
|
2
|
-
export declare const JsonArray: (props?: Jsx.
|
|
2
|
+
export declare const JsonArray: (props?: Jsx.JsonArrayPropsWithJsValue | (Omit<Jsx.JsonArrayPropsWithChildren, "children"> & Partial<Pick<Jsx.JsonArrayPropsWithChildren, "children">>) | undefined) => import("@alloy-js/core").ComponentCreator<Jsx.JsonArrayProps> & {
|
|
3
3
|
code(template: TemplateStringsArray, ...substitutions: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<Jsx.JsonArrayProps>;
|
|
4
4
|
children(...children: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<Jsx.JsonArrayProps>;
|
|
5
5
|
};
|
|
6
|
-
export declare const JsonArrayElement: (props?: Jsx.
|
|
6
|
+
export declare const JsonArrayElement: (props?: Jsx.JsonArrayElementPropsWithJsValue | (Omit<Jsx.JsonArrayElementPropsWithChildren, "children"> & Partial<Pick<Jsx.JsonArrayElementPropsWithChildren, "children">>) | undefined) => import("@alloy-js/core").ComponentCreator<Jsx.JsonArrayElementProps> & {
|
|
7
7
|
code(template: TemplateStringsArray, ...substitutions: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<Jsx.JsonArrayElementProps>;
|
|
8
8
|
children(...children: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<Jsx.JsonArrayElementProps>;
|
|
9
9
|
};
|
|
10
|
-
export declare const JsonObject: (props?: Jsx.
|
|
10
|
+
export declare const JsonObject: (props?: Jsx.JsonObjectPropsWithJsValue | (Omit<Jsx.JsonObjectPropsWithChildren, "children"> & Partial<Pick<Jsx.JsonObjectPropsWithChildren, "children">>) | undefined) => import("@alloy-js/core").ComponentCreator<Jsx.JsonObjectProps> & {
|
|
11
11
|
code(template: TemplateStringsArray, ...substitutions: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<Jsx.JsonObjectProps>;
|
|
12
12
|
children(...children: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<Jsx.JsonObjectProps>;
|
|
13
13
|
};
|
|
14
|
-
export declare const JsonObjectProperty: (props: Jsx.
|
|
14
|
+
export declare const JsonObjectProperty: (props: Jsx.ObjectPropertyPropsWithJsValue | (Omit<Jsx.ObjectPropertyPropsWithChildren, "children"> & Partial<Pick<Jsx.ObjectPropertyPropsWithChildren, "children">>)) => import("@alloy-js/core").ComponentCreator<Jsx.ObjectPropertyProps> & {
|
|
15
15
|
code(template: TemplateStringsArray, ...substitutions: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<Jsx.ObjectPropertyProps>;
|
|
16
16
|
children(...children: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<Jsx.ObjectPropertyProps>;
|
|
17
17
|
};
|
|
@@ -23,7 +23,7 @@ export declare const Reference: (props: Jsx.ReferenceProps) => import("@alloy-js
|
|
|
23
23
|
code(template: TemplateStringsArray, ...substitutions: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<Jsx.ReferenceProps>;
|
|
24
24
|
children(...children: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<Jsx.ReferenceProps>;
|
|
25
25
|
};
|
|
26
|
-
export declare const SourceFile: (props: Jsx.SourceFileProps) => import("@alloy-js/core").ComponentCreator<Jsx.SourceFileProps> & {
|
|
26
|
+
export declare const SourceFile: (props: Omit<Jsx.SourceFileProps, "children"> & Partial<Pick<Jsx.SourceFileProps, "children">>) => import("@alloy-js/core").ComponentCreator<Jsx.SourceFileProps> & {
|
|
27
27
|
code(template: TemplateStringsArray, ...substitutions: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<Jsx.SourceFileProps>;
|
|
28
28
|
children(...children: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<Jsx.SourceFileProps>;
|
|
29
29
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"array.test.d.ts","sourceRoot":"","sources":["../../test/array.test.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"array.test.d.ts","sourceRoot":"","sources":["../../test/array.test.tsx"],"names":[],"mappings":"AACA,OAAO,wBAAwB,CAAC"}
|
package/dist/test/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../test/utils.tsx"],"names":[],"mappings":"AAIA,wBAAgB,QAAQ,CAAC,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../test/utils.tsx"],"names":[],"mappings":"AAIA,wBAAgB,QAAQ,CAAC,OAAO,EAAE,OAAO,qCAQxC"}
|