@powerlines/plugin-alloy 0.25.26 → 0.25.28
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/dist/core/components/output.cjs +7 -19
- package/dist/core/components/output.mjs +7 -19
- package/dist/core/components/output.mjs.map +1 -1
- package/dist/core/components/single-line-comment.cjs +8 -7
- package/dist/core/components/single-line-comment.mjs +8 -7
- package/dist/core/components/single-line-comment.mjs.map +1 -1
- package/dist/core/components/source-file.cjs +7 -12
- package/dist/core/components/source-file.mjs +7 -12
- package/dist/core/components/source-file.mjs.map +1 -1
- package/dist/core/components/spacing.cjs +6 -7
- package/dist/core/components/spacing.mjs +6 -7
- package/dist/core/components/spacing.mjs.map +1 -1
- package/dist/core/contexts/context.mjs.map +1 -1
- package/dist/core/contexts/meta.mjs.map +1 -1
- package/dist/core/contexts/reflection.mjs.map +1 -1
- package/dist/core/helpers/code.mjs.map +1 -1
- package/dist/helpers/capnp.mjs.map +1 -1
- package/dist/helpers/create-builtin.mjs.map +1 -1
- package/dist/helpers/refkey.mjs.map +1 -1
- package/dist/helpers/typescript.mjs.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/markdown/components/front-matter.cjs +9 -14
- package/dist/markdown/components/front-matter.mjs +9 -14
- package/dist/markdown/components/front-matter.mjs.map +1 -1
- package/dist/markdown/components/markdown-file.cjs +41 -89
- package/dist/markdown/components/markdown-file.mjs +41 -89
- package/dist/markdown/components/markdown-file.mjs.map +1 -1
- package/dist/markdown/components/markdown-table.cjs +20 -52
- package/dist/markdown/components/markdown-table.mjs +20 -52
- package/dist/markdown/components/markdown-table.mjs.map +1 -1
- package/dist/markdown/contexts/markdown-table.mjs.map +1 -1
- package/dist/render.cjs +4 -10
- package/dist/render.mjs +4 -10
- package/dist/render.mjs.map +1 -1
- package/dist/typescript/components/builtin-file.cjs +9 -31
- package/dist/typescript/components/builtin-file.mjs +9 -31
- package/dist/typescript/components/builtin-file.mjs.map +1 -1
- package/dist/typescript/components/class-declaration.cjs +80 -193
- package/dist/typescript/components/class-declaration.mjs +80 -193
- package/dist/typescript/components/class-declaration.mjs.map +1 -1
- package/dist/typescript/components/dynamic-import-statement.cjs +1 -2
- package/dist/typescript/components/dynamic-import-statement.mjs +1 -2
- package/dist/typescript/components/dynamic-import-statement.mjs.map +1 -1
- package/dist/typescript/components/entry-file.cjs +3 -10
- package/dist/typescript/components/entry-file.mjs +3 -10
- package/dist/typescript/components/entry-file.mjs.map +1 -1
- package/dist/typescript/components/infrastructure-file.cjs +3 -10
- package/dist/typescript/components/infrastructure-file.mjs +3 -10
- package/dist/typescript/components/infrastructure-file.mjs.map +1 -1
- package/dist/typescript/components/interface-declaration.cjs +47 -134
- package/dist/typescript/components/interface-declaration.mjs +47 -134
- package/dist/typescript/components/interface-declaration.mjs.map +1 -1
- package/dist/typescript/components/object-declaration.cjs +35 -79
- package/dist/typescript/components/object-declaration.mjs +35 -79
- package/dist/typescript/components/object-declaration.mjs.map +1 -1
- package/dist/typescript/components/property-name.cjs +3 -3
- package/dist/typescript/components/property-name.mjs +3 -3
- package/dist/typescript/components/property-name.mjs.map +1 -1
- package/dist/typescript/components/record-expression.mjs.map +1 -1
- package/dist/typescript/components/tsdoc-reflection.cjs +53 -232
- package/dist/typescript/components/tsdoc-reflection.mjs +53 -232
- package/dist/typescript/components/tsdoc-reflection.mjs.map +1 -1
- package/dist/typescript/components/tsdoc.cjs +140 -306
- package/dist/typescript/components/tsdoc.mjs +140 -306
- package/dist/typescript/components/tsdoc.mjs.map +1 -1
- package/dist/typescript/components/type-declaration.cjs +9 -22
- package/dist/typescript/components/type-declaration.mjs +9 -22
- package/dist/typescript/components/type-declaration.mjs.map +1 -1
- package/dist/typescript/components/type-parameters.cjs +33 -60
- package/dist/typescript/components/type-parameters.mjs +33 -60
- package/dist/typescript/components/type-parameters.mjs.map +1 -1
- package/dist/typescript/components/typescript-file.cjs +65 -155
- package/dist/typescript/components/typescript-file.mjs +65 -155
- package/dist/typescript/components/typescript-file.mjs.map +1 -1
- package/dist/typescript/contexts/lexical-scope.cjs +1 -7
- package/dist/typescript/contexts/lexical-scope.mjs +1 -7
- package/dist/typescript/contexts/lexical-scope.mjs.map +1 -1
- package/dist/typescript/contexts/member-scope.cjs +2 -7
- package/dist/typescript/contexts/member-scope.mjs +2 -7
- package/dist/typescript/contexts/member-scope.mjs.map +1 -1
- package/dist/typescript/helpers/get-call-signature-props.mjs.map +1 -1
- package/dist/typescript/helpers/utilities.mjs.map +1 -1
- package/dist/yaml/components/yaml-file.cjs +48 -103
- package/dist/yaml/components/yaml-file.mjs +48 -103
- package/dist/yaml/components/yaml-file.mjs.map +1 -1
- package/package.json +7 -7
- package/dist/_virtual/_rolldown/runtime.mjs +0 -3
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { useReflectionClass, useReflectionMethod, useReflectionProperty } from "../../core/contexts/reflection.mjs";
|
|
2
2
|
import { Spacing } from "../../core/components/spacing.mjs";
|
|
3
3
|
import { TSDoc, TSDocAttributesTags, TSDocParam, TSDocReturns } from "./tsdoc.mjs";
|
|
4
|
-
import { createComponent, createIntrinsic, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
5
4
|
import { For, List, Show, childrenArray, code, computed, splitProps } from "@alloy-js/core";
|
|
6
5
|
import { titleCase } from "@stryke/string-format/title-case";
|
|
7
6
|
import { isUndefined } from "@stryke/type-checks/is-undefined";
|
|
@@ -32,78 +31,26 @@ function TSDocReflectionClass(props) {
|
|
|
32
31
|
const hidden = computed(() => reflection.isHidden());
|
|
33
32
|
if (!computedHeading.value || isSetString(computedHeading.value) && computedHeading.value.trim() === "") return null;
|
|
34
33
|
const hasAttributes = computed(() => isSetString(title.value) || !isUndefined(alias.value) && alias.value.length > 0 || !isUndefined(permission.value) && permission.value.length > 0 || isSetString(domain.value) || !isUndefined(readonly.value) || !isUndefined(internal.value) || !isUndefined(ignore.value) || !isUndefined(hidden.value));
|
|
35
|
-
return
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
get title() {
|
|
47
|
-
return title.value;
|
|
48
|
-
},
|
|
49
|
-
get alias() {
|
|
50
|
-
return alias.value;
|
|
51
|
-
},
|
|
52
|
-
get domain() {
|
|
53
|
-
return domain.value;
|
|
54
|
-
},
|
|
55
|
-
get permission() {
|
|
56
|
-
return permission.value;
|
|
57
|
-
},
|
|
58
|
-
get readonly() {
|
|
59
|
-
return readonly.value;
|
|
60
|
-
},
|
|
61
|
-
get internal() {
|
|
62
|
-
return internal.value;
|
|
63
|
-
},
|
|
64
|
-
get ignore() {
|
|
65
|
-
return ignore.value;
|
|
66
|
-
},
|
|
67
|
-
get hidden() {
|
|
68
|
-
return hidden.value;
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
}), createComponent(Show, {
|
|
73
|
-
get when() {
|
|
74
|
-
return memo(() => !!!isUndefined(children))() && childrenArray(() => children).filter(Boolean).length > 0;
|
|
75
|
-
},
|
|
76
|
-
get children() {
|
|
77
|
-
return [createComponent(Show, {
|
|
78
|
-
get when() {
|
|
79
|
-
return hasAttributes.value;
|
|
80
|
-
},
|
|
81
|
-
get children() {
|
|
82
|
-
return createComponent(Spacing, {});
|
|
83
|
-
}
|
|
84
|
-
}), createComponent(List, { get children() {
|
|
85
|
-
return childrenArray(() => children);
|
|
86
|
-
} })];
|
|
87
|
-
}
|
|
88
|
-
})];
|
|
89
|
-
}
|
|
90
|
-
}));
|
|
34
|
+
return <TSDoc {...rest} heading={isSetString(computedHeading.value) ? computedHeading.value.trim() : computedHeading.value}>
|
|
35
|
+
<Show when={hasAttributes.value}>
|
|
36
|
+
<TSDocAttributesTags title={title.value} alias={alias.value} domain={domain.value} permission={permission.value} readonly={readonly.value} internal={internal.value} ignore={ignore.value} hidden={hidden.value} />
|
|
37
|
+
</Show>
|
|
38
|
+
<Show when={!isUndefined(children) && childrenArray(() => children).filter(Boolean).length > 0}>
|
|
39
|
+
<Show when={hasAttributes.value}>
|
|
40
|
+
<Spacing />
|
|
41
|
+
</Show>
|
|
42
|
+
<List>{childrenArray(() => children)}</List>
|
|
43
|
+
</Show>
|
|
44
|
+
</TSDoc>;
|
|
91
45
|
}
|
|
92
46
|
/**
|
|
93
47
|
* Uses the `useReflectionClass` hook to retrieve the reflection class from the context, and then renders a `TSDocReflectionClass` component with the retrieved reflection class. This is a convenience component that allows you to easily render a TSDoc documentation block for the current reflection class without having to manually retrieve the reflection class from the context.
|
|
94
48
|
*/
|
|
95
49
|
function TSDocContextClass(props) {
|
|
96
50
|
const reflectionClass = useReflectionClass();
|
|
97
|
-
return
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
},
|
|
101
|
-
get children() {
|
|
102
|
-
return createComponent(TSDocReflectionClass, mergeProps(props, { get reflection() {
|
|
103
|
-
return reflectionClass.reflection;
|
|
104
|
-
} }));
|
|
105
|
-
}
|
|
106
|
-
});
|
|
51
|
+
return <Show when={isSetObject(reflectionClass.reflection)}>
|
|
52
|
+
<TSDocReflectionClass {...props} reflection={reflectionClass.reflection} />
|
|
53
|
+
</Show>;
|
|
107
54
|
}
|
|
108
55
|
/**
|
|
109
56
|
* Generates a TSDoc documentation block for the given reflection property. This component will render the description of the reflection as the main content of the documentation block, and will render any additional attributes (such as title, alias, domain, permission, etc.) as tags in the documentation block. If there are child elements provided, they will be rendered as a list below the main content of the documentation block. This is useful for rendering additional details about the reflection that may not be included in the description, such as information about parameters of a method or properties of a class.
|
|
@@ -112,77 +59,26 @@ function TSDocReflectionProperty(props) {
|
|
|
112
59
|
const [{ children, reflection }, rest] = splitProps(props, ["children", "reflection"]);
|
|
113
60
|
if (!isSetObject(reflection)) return null;
|
|
114
61
|
const hasAttributes = computed(() => isSetString(reflection.getTitle()) || !isUndefined(reflection.getAlias()) && reflection.getAlias().length > 0 || !isUndefined(reflection.getPermission()) && reflection.getPermission().length > 0 || isSetString(reflection.getDomain()) || !isUndefined(reflection.isReadonly()) || !isUndefined(reflection.isInternal()) || !isUndefined(reflection.isIgnored()) || !isUndefined(reflection.isHidden()) || reflection.hasDefault() && !isUndefined(reflection.getDefaultValue()));
|
|
115
|
-
return
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
return reflection.getTitle();
|
|
127
|
-
},
|
|
128
|
-
get alias() {
|
|
129
|
-
return reflection.getAlias();
|
|
130
|
-
},
|
|
131
|
-
get domain() {
|
|
132
|
-
return reflection.getDomain();
|
|
133
|
-
},
|
|
134
|
-
get permission() {
|
|
135
|
-
return reflection.getPermission();
|
|
136
|
-
},
|
|
137
|
-
get readonly() {
|
|
138
|
-
return reflection.isReadonly();
|
|
139
|
-
},
|
|
140
|
-
get internal() {
|
|
141
|
-
return reflection.isInternal();
|
|
142
|
-
},
|
|
143
|
-
get ignore() {
|
|
144
|
-
return reflection.isIgnored();
|
|
145
|
-
},
|
|
146
|
-
get hidden() {
|
|
147
|
-
return reflection.isHidden();
|
|
148
|
-
},
|
|
149
|
-
get defaultValue() {
|
|
150
|
-
return reflection.getDefaultValue();
|
|
151
|
-
}
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
}), createComponent(Show, {
|
|
155
|
-
get when() {
|
|
156
|
-
return memo(() => !!!isUndefined(children))() && childrenArray(() => children).filter(Boolean).length > 0;
|
|
157
|
-
},
|
|
158
|
-
get children() {
|
|
159
|
-
return [createComponent(Show, {
|
|
160
|
-
get when() {
|
|
161
|
-
return hasAttributes.value;
|
|
162
|
-
},
|
|
163
|
-
get children() {
|
|
164
|
-
return createComponent(Spacing, {});
|
|
165
|
-
}
|
|
166
|
-
}), createComponent(List, { get children() {
|
|
167
|
-
return childrenArray(() => children);
|
|
168
|
-
} })];
|
|
169
|
-
}
|
|
170
|
-
})];
|
|
171
|
-
} }));
|
|
62
|
+
return <TSDoc heading={reflection.getDescription()} {...rest}>
|
|
63
|
+
<Show when={hasAttributes.value}>
|
|
64
|
+
<TSDocAttributesTags type={reflection} title={reflection.getTitle()} alias={reflection.getAlias()} domain={reflection.getDomain()} permission={reflection.getPermission()} readonly={reflection.isReadonly()} internal={reflection.isInternal()} ignore={reflection.isIgnored()} hidden={reflection.isHidden()} defaultValue={reflection.getDefaultValue()} />
|
|
65
|
+
</Show>
|
|
66
|
+
<Show when={!isUndefined(children) && childrenArray(() => children).filter(Boolean).length > 0}>
|
|
67
|
+
<Show when={hasAttributes.value}>
|
|
68
|
+
<Spacing />
|
|
69
|
+
</Show>
|
|
70
|
+
<List>{childrenArray(() => children)}</List>
|
|
71
|
+
</Show>
|
|
72
|
+
</TSDoc>;
|
|
172
73
|
}
|
|
173
74
|
/**
|
|
174
75
|
* Uses the `useReflectionProperty` hook to retrieve the reflection property from the context, and then renders a `TSDocReflectionProperty` component with the retrieved reflection property. This is a convenience component that allows you to easily render a TSDoc documentation block for the current reflection property without having to manually retrieve the reflection property from the context.
|
|
175
76
|
*/
|
|
176
77
|
function TSDocContextProperty(props) {
|
|
177
78
|
const reflection = useReflectionProperty();
|
|
178
|
-
return
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
},
|
|
182
|
-
get children() {
|
|
183
|
-
return createComponent(TSDocReflectionProperty, mergeProps(props, { reflection }));
|
|
184
|
-
}
|
|
185
|
-
});
|
|
79
|
+
return <Show when={isSetObject(reflection)}>
|
|
80
|
+
<TSDocReflectionProperty {...props} reflection={reflection} />
|
|
81
|
+
</Show>;
|
|
186
82
|
}
|
|
187
83
|
/**
|
|
188
84
|
* Generates a TSDoc documentation block for the given reflection method. This component will render the description of the reflection as the main content of the documentation block, and will render any additional attributes (such as title, alias, domain, permission, etc.) as tags in the documentation block. If there are child elements provided, they will be rendered as a list below the main content of the documentation block. Additionally, this component will render information about the parameters and return type of the method, if available.
|
|
@@ -191,112 +87,37 @@ function TSDocReflectionMethod(props) {
|
|
|
191
87
|
const [{ children, reflection }, rest] = splitProps(props, ["children", "reflection"]);
|
|
192
88
|
if (!isSetObject(reflection)) return null;
|
|
193
89
|
const heading = computed(() => reflection.getDescription() || (isString(reflection.getName()) ? code`${String(reflection.getName())} method definition` : void 0));
|
|
194
|
-
return
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
},
|
|
217
|
-
get ignore() {
|
|
218
|
-
return reflection.isIgnored();
|
|
219
|
-
},
|
|
220
|
-
get hidden() {
|
|
221
|
-
return reflection.isHidden();
|
|
222
|
-
}
|
|
223
|
-
}),
|
|
224
|
-
createComponent(Show, {
|
|
225
|
-
get when() {
|
|
226
|
-
return memo(() => !!Boolean(children))() && childrenArray(() => children).length > 0;
|
|
227
|
-
},
|
|
228
|
-
get children() {
|
|
229
|
-
return createComponent(List, { get children() {
|
|
230
|
-
return childrenArray(() => children);
|
|
231
|
-
} });
|
|
232
|
-
}
|
|
233
|
-
}),
|
|
234
|
-
createComponent(Show, {
|
|
235
|
-
get when() {
|
|
236
|
-
return reflection.getParameters().length > 0;
|
|
237
|
-
},
|
|
238
|
-
get children() {
|
|
239
|
-
return [createComponent(Spacing, {}), createComponent(For, {
|
|
240
|
-
get each() {
|
|
241
|
-
return reflection.getParameters();
|
|
242
|
-
},
|
|
243
|
-
hardline: true,
|
|
244
|
-
get ender() {
|
|
245
|
-
return createIntrinsic("hbr", {});
|
|
246
|
-
},
|
|
247
|
-
children: (param) => createComponent(TSDocParam, {
|
|
248
|
-
get name() {
|
|
249
|
-
return param.getName();
|
|
250
|
-
},
|
|
251
|
-
get optional() {
|
|
252
|
-
return param.isOptional();
|
|
253
|
-
},
|
|
254
|
-
get defaultValue() {
|
|
255
|
-
return memo(() => !!param.hasDefault())() ? param.getDefaultValue() : void 0;
|
|
256
|
-
},
|
|
257
|
-
get children() {
|
|
258
|
-
return createComponent(Show, {
|
|
259
|
-
get when() {
|
|
260
|
-
return Boolean(param.parameter.description);
|
|
261
|
-
},
|
|
262
|
-
get fallback() {
|
|
263
|
-
return code`A parameter to provide a ${param.getName()} value to the function.`;
|
|
264
|
-
},
|
|
265
|
-
get children() {
|
|
266
|
-
return param.parameter.description;
|
|
267
|
-
}
|
|
268
|
-
});
|
|
269
|
-
}
|
|
270
|
-
})
|
|
271
|
-
})];
|
|
272
|
-
}
|
|
273
|
-
}),
|
|
274
|
-
createComponent(Show, {
|
|
275
|
-
get when() {
|
|
276
|
-
return reflection.getReturnType().kind !== ReflectionKind.void;
|
|
277
|
-
},
|
|
278
|
-
get children() {
|
|
279
|
-
return [createComponent(Spacing, {}), createComponent(TSDocReturns, { get children() {
|
|
280
|
-
return code`The return value of the function, which is of type ${stringifyType(reflection.getReturnType())}.`;
|
|
281
|
-
} })];
|
|
282
|
-
}
|
|
283
|
-
})
|
|
284
|
-
];
|
|
285
|
-
} }));
|
|
90
|
+
return <TSDoc heading={heading.value} {...rest}>
|
|
91
|
+
<TSDocAttributesTags title={reflection.getTitle()} alias={reflection.getAlias()} domain={reflection.getDomain()} permission={reflection.getPermission()} readonly={reflection.isReadonly()} internal={reflection.isInternal()} ignore={reflection.isIgnored()} hidden={reflection.isHidden()} />
|
|
92
|
+
<Show when={Boolean(children) && childrenArray(() => children).length > 0}>
|
|
93
|
+
<List>{childrenArray(() => children)}</List>
|
|
94
|
+
</Show>
|
|
95
|
+
<Show when={reflection.getParameters().length > 0}>
|
|
96
|
+
<Spacing />
|
|
97
|
+
<For each={reflection.getParameters()} hardline ender={<hbr />}>
|
|
98
|
+
{(param) => <TSDocParam name={param.getName()} optional={param.isOptional()} defaultValue={param.hasDefault() ? param.getDefaultValue() : void 0}>
|
|
99
|
+
<Show when={Boolean(param.parameter.description)} fallback={code`A parameter to provide a ${param.getName()} value to the function.`}>
|
|
100
|
+
{param.parameter.description}
|
|
101
|
+
</Show>
|
|
102
|
+
</TSDocParam>}
|
|
103
|
+
</For>
|
|
104
|
+
</Show>
|
|
105
|
+
<Show when={reflection.getReturnType().kind !== ReflectionKind.void}>
|
|
106
|
+
<Spacing />
|
|
107
|
+
<TSDocReturns>
|
|
108
|
+
{code`The return value of the function, which is of type ${stringifyType(reflection.getReturnType())}.`}
|
|
109
|
+
</TSDocReturns>
|
|
110
|
+
</Show>
|
|
111
|
+
</TSDoc>;
|
|
286
112
|
}
|
|
287
113
|
/**
|
|
288
114
|
* Uses the `useReflectionMethod` hook to retrieve the reflection method from the context, and then renders a `TSDocReflectionMethod` component with the retrieved reflection method. This is a convenience component that allows you to easily render a TSDoc documentation block for the current reflection method without having to manually retrieve the reflection method from the context.
|
|
289
115
|
*/
|
|
290
116
|
function TSDocContextMethod(props) {
|
|
291
117
|
const reflection = useReflectionMethod();
|
|
292
|
-
return
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
},
|
|
296
|
-
get children() {
|
|
297
|
-
return createComponent(TSDocReflectionMethod, mergeProps(props, { reflection }));
|
|
298
|
-
}
|
|
299
|
-
});
|
|
118
|
+
return <Show when={isSetObject(reflection)}>
|
|
119
|
+
<TSDocReflectionMethod {...props} reflection={reflection} />
|
|
120
|
+
</Show>;
|
|
300
121
|
}
|
|
301
122
|
|
|
302
123
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tsdoc-reflection.mjs","names":["childrenArray","code","computed","For","List","Show","splitProps","ReflectionKind","stringifyType","titleCase","isSetObject","isSetString","isString","isUndefined","Spacing","useReflectionClass","useReflectionMethod","useReflectionProperty","TSDoc","TSDocAttributesTags","TSDocParam","TSDocReturns","TSDocReflectionClass","props","children","heading","reflection","rest","title","getTitle","getName","computedHeading","getDescription","value","alias","getAlias","domain","getDomain","permission","getPermission","readonly","isReadonly","internal","isInternal","ignore","isIgnored","hidden","isHidden","trim","hasAttributes","length","_$createComponent","_$mergeProps","_$memo","when","filter","Boolean","TSDocContextClass","reflectionClass","TSDocReflectionProperty","hasDefault","getDefaultValue","type","defaultValue","TSDocContextProperty","TSDocReflectionMethod","String","undefined","getParameters","each","hardline","ender","_$createIntrinsic","param","name","optional","isOptional","parameter","description","fallback","getReturnType","kind","void","TSDocContextMethod"],"sources":["../../../src/typescript/components/tsdoc-reflection.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n childrenArray,\n code,\n computed,\n For,\n List,\n Show,\n splitProps\n} from \"@alloy-js/core\";\nimport {\n ReflectionClass,\n ReflectionKind,\n ReflectionMethod,\n ReflectionProperty,\n stringifyType\n} from \"@powerlines/deepkit/vendor/type\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isSetObject } from \"@stryke/type-checks\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\nimport { Spacing } from \"../../core/components/spacing\";\nimport {\n useReflectionClass,\n useReflectionMethod,\n useReflectionProperty\n} from \"../../core/contexts/reflection\";\nimport {\n TSDoc,\n TSDocAttributesTags,\n TSDocParam,\n TSDocProps,\n TSDocReturns\n} from \"./tsdoc\";\n\nexport interface TSDocReflectionClassProps<\n T extends Record<string, any> = Record<string, any>\n> extends TSDocProps {\n reflection: ReflectionClass<T>;\n}\n\n/**\n * Generates a TSDoc documentation block for the given reflection class. This component will render the description of the reflection as the main content of the documentation block, and will render any additional attributes (such as title, alias, domain, permission, etc.) as tags in the documentation block. If there are child elements provided, they will be rendered as a list below the main content of the documentation block. This is useful for rendering additional details about the reflection that may not be included in the description, such as information about properties or methods of a class.\n */\nexport function TSDocReflectionClass<\n T extends Record<string, any> = Record<string, any>\n>(props: TSDocReflectionClassProps<T>) {\n const [{ children, heading, reflection }, rest] = splitProps(props, [\n \"heading\",\n \"children\",\n \"reflection\"\n ]);\n\n if (!isSetObject(reflection)) {\n return null;\n }\n\n const title = computed(\n () => reflection.getTitle() || titleCase(reflection.getName())\n );\n const computedHeading = computed(\n () => heading || reflection.getDescription() || title.value\n );\n\n const alias = computed(() => reflection.getAlias());\n const domain = computed(() => reflection.getDomain());\n const permission = computed(() => reflection.getPermission());\n const readonly = computed(() => reflection.isReadonly());\n const internal = computed(() => reflection.isInternal());\n const ignore = computed(() => reflection.isIgnored());\n const hidden = computed(() => reflection.isHidden());\n\n if (\n !computedHeading.value ||\n (isSetString(computedHeading.value) && computedHeading.value.trim() === \"\")\n ) {\n return null;\n }\n\n const hasAttributes = computed(\n () =>\n isSetString(title.value) ||\n (!isUndefined(alias.value) && alias.value.length > 0) ||\n (!isUndefined(permission.value) && permission.value.length > 0) ||\n isSetString(domain.value) ||\n !isUndefined(readonly.value) ||\n !isUndefined(internal.value) ||\n !isUndefined(ignore.value) ||\n !isUndefined(hidden.value)\n );\n\n return (\n <TSDoc\n {...rest}\n heading={\n isSetString(computedHeading.value)\n ? computedHeading.value.trim()\n : computedHeading.value\n }>\n <Show when={hasAttributes.value}>\n <TSDocAttributesTags\n title={title.value}\n alias={alias.value}\n domain={domain.value}\n permission={permission.value}\n readonly={readonly.value}\n internal={internal.value}\n ignore={ignore.value}\n hidden={hidden.value}\n />\n </Show>\n <Show\n when={\n !isUndefined(children) &&\n childrenArray(() => children).filter(Boolean).length > 0\n }>\n <Show when={hasAttributes.value}>\n <Spacing />\n </Show>\n <List>{childrenArray(() => children)}</List>\n </Show>\n </TSDoc>\n );\n}\n\n/**\n * Uses the `useReflectionClass` hook to retrieve the reflection class from the context, and then renders a `TSDocReflectionClass` component with the retrieved reflection class. This is a convenience component that allows you to easily render a TSDoc documentation block for the current reflection class without having to manually retrieve the reflection class from the context.\n */\nexport function TSDocContextClass<\n T extends Record<string, any> = Record<string, any>\n>(props: TSDocProps) {\n const reflectionClass = useReflectionClass<T>();\n\n return (\n <Show when={isSetObject(reflectionClass.reflection)}>\n <TSDocReflectionClass\n {...props}\n reflection={reflectionClass.reflection}\n />\n </Show>\n );\n}\n\nexport interface TSDocReflectionPropertyProps extends TSDocProps {\n reflection: ReflectionProperty;\n}\n\n/**\n * Generates a TSDoc documentation block for the given reflection property. This component will render the description of the reflection as the main content of the documentation block, and will render any additional attributes (such as title, alias, domain, permission, etc.) as tags in the documentation block. If there are child elements provided, they will be rendered as a list below the main content of the documentation block. This is useful for rendering additional details about the reflection that may not be included in the description, such as information about parameters of a method or properties of a class.\n */\nexport function TSDocReflectionProperty(props: TSDocReflectionPropertyProps) {\n const [{ children, reflection }, rest] = splitProps(props, [\n \"children\",\n \"reflection\"\n ]);\n\n if (!isSetObject(reflection)) {\n return null;\n }\n\n const hasAttributes = computed(\n () =>\n isSetString(reflection.getTitle()) ||\n (!isUndefined(reflection.getAlias()) &&\n reflection.getAlias().length > 0) ||\n (!isUndefined(reflection.getPermission()) &&\n reflection.getPermission().length > 0) ||\n isSetString(reflection.getDomain()) ||\n !isUndefined(reflection.isReadonly()) ||\n !isUndefined(reflection.isInternal()) ||\n !isUndefined(reflection.isIgnored()) ||\n !isUndefined(reflection.isHidden()) ||\n (reflection.hasDefault() && !isUndefined(reflection.getDefaultValue()))\n );\n\n return (\n <TSDoc heading={reflection.getDescription()} {...rest}>\n <Show when={hasAttributes.value}>\n <TSDocAttributesTags\n type={reflection}\n title={reflection.getTitle()}\n alias={reflection.getAlias()}\n domain={reflection.getDomain()}\n permission={reflection.getPermission()}\n readonly={reflection.isReadonly()}\n internal={reflection.isInternal()}\n ignore={reflection.isIgnored()}\n hidden={reflection.isHidden()}\n defaultValue={reflection.getDefaultValue()}\n />\n </Show>\n <Show\n when={\n !isUndefined(children) &&\n childrenArray(() => children).filter(Boolean).length > 0\n }>\n <Show when={hasAttributes.value}>\n <Spacing />\n </Show>\n <List>{childrenArray(() => children)}</List>\n </Show>\n </TSDoc>\n );\n}\n\n/**\n * Uses the `useReflectionProperty` hook to retrieve the reflection property from the context, and then renders a `TSDocReflectionProperty` component with the retrieved reflection property. This is a convenience component that allows you to easily render a TSDoc documentation block for the current reflection property without having to manually retrieve the reflection property from the context.\n */\nexport function TSDocContextProperty(props: TSDocProps) {\n const reflection = useReflectionProperty();\n\n return (\n <Show when={isSetObject(reflection)}>\n <TSDocReflectionProperty {...props} reflection={reflection} />\n </Show>\n );\n}\n\nexport interface TSDocReflectionMethodProps extends TSDocProps {\n reflection: ReflectionMethod;\n}\n\n/**\n * Generates a TSDoc documentation block for the given reflection method. This component will render the description of the reflection as the main content of the documentation block, and will render any additional attributes (such as title, alias, domain, permission, etc.) as tags in the documentation block. If there are child elements provided, they will be rendered as a list below the main content of the documentation block. Additionally, this component will render information about the parameters and return type of the method, if available.\n */\nexport function TSDocReflectionMethod(props: TSDocReflectionMethodProps) {\n const [{ children, reflection }, rest] = splitProps(props, [\n \"children\",\n \"reflection\"\n ]);\n\n if (!isSetObject(reflection)) {\n return null;\n }\n\n const heading = computed(\n () =>\n reflection.getDescription() ||\n (isString(reflection.getName())\n ? code`${String(reflection.getName())} method definition`\n : undefined)\n );\n\n return (\n <TSDoc heading={heading.value} {...rest}>\n <TSDocAttributesTags\n title={reflection.getTitle()}\n alias={reflection.getAlias()}\n domain={reflection.getDomain()}\n permission={reflection.getPermission()}\n readonly={reflection.isReadonly()}\n internal={reflection.isInternal()}\n ignore={reflection.isIgnored()}\n hidden={reflection.isHidden()}\n />\n <Show\n when={Boolean(children) && childrenArray(() => children).length > 0}>\n <List>{childrenArray(() => children)}</List>\n </Show>\n <Show when={reflection.getParameters().length > 0}>\n <Spacing />\n <For each={reflection.getParameters()} hardline ender={<hbr />}>\n {param => (\n <TSDocParam\n name={param.getName()}\n optional={param.isOptional()}\n defaultValue={\n param.hasDefault() ? param.getDefaultValue() : undefined\n }>\n <Show\n when={Boolean(param.parameter.description)}\n fallback={code`A parameter to provide a ${param.getName()} value to the function.`}>\n {param.parameter.description}\n </Show>\n </TSDocParam>\n )}\n </For>\n </Show>\n <Show when={reflection.getReturnType().kind !== ReflectionKind.void}>\n <Spacing />\n <TSDocReturns>\n {code`The return value of the function, which is of type ${stringifyType(\n reflection.getReturnType()\n )}.`}\n </TSDocReturns>\n </Show>\n </TSDoc>\n );\n}\n\n/**\n * Uses the `useReflectionMethod` hook to retrieve the reflection method from the context, and then renders a `TSDocReflectionMethod` component with the retrieved reflection method. This is a convenience component that allows you to easily render a TSDoc documentation block for the current reflection method without having to manually retrieve the reflection method from the context.\n */\nexport function TSDocContextMethod(props: TSDocProps) {\n const reflection = useReflectionMethod();\n\n return (\n <Show when={isSetObject(reflection)}>\n <TSDocReflectionMethod {...props} reflection={reflection} />\n </Show>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;SAsOS,4BAAA;;;;;;kBAAA,WAAA;eAAA,0BAAA,UAAA,IAAA,UAAA,WAAA,SAAA;yBAAA,0BAAA,WAAA,gBAAA,IAAA,MAAA;;gBAAA;mCAAA,WAAA,eAAA,CAAA;kBAAA,eAAA,WAAA,YAAA,CAAA;kBAAA,eAAA,WAAA,YAAA,CAAA;gBAAA,eAAA,WAAA,WAAA,CAAA;gBAAA,eAAA,WAAA,UAAA,CAAA;sBAAA;sKAA8B,MAAA,SAAA,iBAAA,OAAA,MAAA,iBAAA,SAAA,uBAAA,SAAA,MAAA,iBAAA,OAAA,MAAA,iBAAA,OAAA;wBAAA,OAAA,WAAA,MAAA;EAAA;;;;2BAc5BwB,M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AAA;AAAAA,eAAAA,WAAAA,CAAAA,CAAAA,MAAAA,YAAAA,CAAAA,EAAAA,GAAAA,MAAAA,iBAAAA,GAAAA;;OAAAA,IAAAA,WAAAA;AAAAA,eAAAA,gBAAc,MAAA;SAAA,IAAA,OAAA;AAAA,iBAAA,QAAA,MAAA,UAAA,YAAA;;SAAA,IAAA,WAAA;AAAA,iBAAA,IAAA,4BAAA,MAAA,SAAA,CAAA;;SAAA,IAAA,WAAA;AAAA,iBAAA,MAAA,UAAA;;SAAA,CAAA;;OAAA,CAAA;;;;;eAAA;AAAA,YAAA,WAAA,eAAA,CAAA,SAAA,eAAA;;IAAA,IAAA,WAAA;AAAA,YAAA,CAAA,yBAAA,EAAA,CAAA,EAAA,8BAAA,EAAA,IAAA,WAAA;AAAA,iBAAA,sDAAA,yBAAA;QAAA,CAAA,CAAA;;IAAA,CAAA;GAAA;IAAA,CAAA,CAAA;;;;;4BAAMwB,OAAAA;oBAAAA,qBAAAA;;aAAAA;AAAAA,UAAAA,YAAAA,WAAAA;;EAAAA,IAAAA,WAAAA;AAAAA,UAAAA"}
|
|
1
|
+
{"version":3,"file":"tsdoc-reflection.mjs","names":[],"sources":["../../../src/typescript/components/tsdoc-reflection.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n childrenArray,\n code,\n computed,\n For,\n List,\n Show,\n splitProps\n} from \"@alloy-js/core\";\nimport {\n ReflectionClass,\n ReflectionKind,\n ReflectionMethod,\n ReflectionProperty,\n stringifyType\n} from \"@powerlines/deepkit/vendor/type\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isSetObject } from \"@stryke/type-checks\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\nimport { Spacing } from \"../../core/components/spacing\";\nimport {\n useReflectionClass,\n useReflectionMethod,\n useReflectionProperty\n} from \"../../core/contexts/reflection\";\nimport {\n TSDoc,\n TSDocAttributesTags,\n TSDocParam,\n TSDocProps,\n TSDocReturns\n} from \"./tsdoc\";\n\nexport interface TSDocReflectionClassProps<\n T extends Record<string, any> = Record<string, any>\n> extends TSDocProps {\n reflection: ReflectionClass<T>;\n}\n\n/**\n * Generates a TSDoc documentation block for the given reflection class. This component will render the description of the reflection as the main content of the documentation block, and will render any additional attributes (such as title, alias, domain, permission, etc.) as tags in the documentation block. If there are child elements provided, they will be rendered as a list below the main content of the documentation block. This is useful for rendering additional details about the reflection that may not be included in the description, such as information about properties or methods of a class.\n */\nexport function TSDocReflectionClass<\n T extends Record<string, any> = Record<string, any>\n>(props: TSDocReflectionClassProps<T>) {\n const [{ children, heading, reflection }, rest] = splitProps(props, [\n \"heading\",\n \"children\",\n \"reflection\"\n ]);\n\n if (!isSetObject(reflection)) {\n return null;\n }\n\n const title = computed(\n () => reflection.getTitle() || titleCase(reflection.getName())\n );\n const computedHeading = computed(\n () => heading || reflection.getDescription() || title.value\n );\n\n const alias = computed(() => reflection.getAlias());\n const domain = computed(() => reflection.getDomain());\n const permission = computed(() => reflection.getPermission());\n const readonly = computed(() => reflection.isReadonly());\n const internal = computed(() => reflection.isInternal());\n const ignore = computed(() => reflection.isIgnored());\n const hidden = computed(() => reflection.isHidden());\n\n if (\n !computedHeading.value ||\n (isSetString(computedHeading.value) && computedHeading.value.trim() === \"\")\n ) {\n return null;\n }\n\n const hasAttributes = computed(\n () =>\n isSetString(title.value) ||\n (!isUndefined(alias.value) && alias.value.length > 0) ||\n (!isUndefined(permission.value) && permission.value.length > 0) ||\n isSetString(domain.value) ||\n !isUndefined(readonly.value) ||\n !isUndefined(internal.value) ||\n !isUndefined(ignore.value) ||\n !isUndefined(hidden.value)\n );\n\n return (\n <TSDoc\n {...rest}\n heading={\n isSetString(computedHeading.value)\n ? computedHeading.value.trim()\n : computedHeading.value\n }>\n <Show when={hasAttributes.value}>\n <TSDocAttributesTags\n title={title.value}\n alias={alias.value}\n domain={domain.value}\n permission={permission.value}\n readonly={readonly.value}\n internal={internal.value}\n ignore={ignore.value}\n hidden={hidden.value}\n />\n </Show>\n <Show\n when={\n !isUndefined(children) &&\n childrenArray(() => children).filter(Boolean).length > 0\n }>\n <Show when={hasAttributes.value}>\n <Spacing />\n </Show>\n <List>{childrenArray(() => children)}</List>\n </Show>\n </TSDoc>\n );\n}\n\n/**\n * Uses the `useReflectionClass` hook to retrieve the reflection class from the context, and then renders a `TSDocReflectionClass` component with the retrieved reflection class. This is a convenience component that allows you to easily render a TSDoc documentation block for the current reflection class without having to manually retrieve the reflection class from the context.\n */\nexport function TSDocContextClass<\n T extends Record<string, any> = Record<string, any>\n>(props: TSDocProps) {\n const reflectionClass = useReflectionClass<T>();\n\n return (\n <Show when={isSetObject(reflectionClass.reflection)}>\n <TSDocReflectionClass\n {...props}\n reflection={reflectionClass.reflection}\n />\n </Show>\n );\n}\n\nexport interface TSDocReflectionPropertyProps extends TSDocProps {\n reflection: ReflectionProperty;\n}\n\n/**\n * Generates a TSDoc documentation block for the given reflection property. This component will render the description of the reflection as the main content of the documentation block, and will render any additional attributes (such as title, alias, domain, permission, etc.) as tags in the documentation block. If there are child elements provided, they will be rendered as a list below the main content of the documentation block. This is useful for rendering additional details about the reflection that may not be included in the description, such as information about parameters of a method or properties of a class.\n */\nexport function TSDocReflectionProperty(props: TSDocReflectionPropertyProps) {\n const [{ children, reflection }, rest] = splitProps(props, [\n \"children\",\n \"reflection\"\n ]);\n\n if (!isSetObject(reflection)) {\n return null;\n }\n\n const hasAttributes = computed(\n () =>\n isSetString(reflection.getTitle()) ||\n (!isUndefined(reflection.getAlias()) &&\n reflection.getAlias().length > 0) ||\n (!isUndefined(reflection.getPermission()) &&\n reflection.getPermission().length > 0) ||\n isSetString(reflection.getDomain()) ||\n !isUndefined(reflection.isReadonly()) ||\n !isUndefined(reflection.isInternal()) ||\n !isUndefined(reflection.isIgnored()) ||\n !isUndefined(reflection.isHidden()) ||\n (reflection.hasDefault() && !isUndefined(reflection.getDefaultValue()))\n );\n\n return (\n <TSDoc heading={reflection.getDescription()} {...rest}>\n <Show when={hasAttributes.value}>\n <TSDocAttributesTags\n type={reflection}\n title={reflection.getTitle()}\n alias={reflection.getAlias()}\n domain={reflection.getDomain()}\n permission={reflection.getPermission()}\n readonly={reflection.isReadonly()}\n internal={reflection.isInternal()}\n ignore={reflection.isIgnored()}\n hidden={reflection.isHidden()}\n defaultValue={reflection.getDefaultValue()}\n />\n </Show>\n <Show\n when={\n !isUndefined(children) &&\n childrenArray(() => children).filter(Boolean).length > 0\n }>\n <Show when={hasAttributes.value}>\n <Spacing />\n </Show>\n <List>{childrenArray(() => children)}</List>\n </Show>\n </TSDoc>\n );\n}\n\n/**\n * Uses the `useReflectionProperty` hook to retrieve the reflection property from the context, and then renders a `TSDocReflectionProperty` component with the retrieved reflection property. This is a convenience component that allows you to easily render a TSDoc documentation block for the current reflection property without having to manually retrieve the reflection property from the context.\n */\nexport function TSDocContextProperty(props: TSDocProps) {\n const reflection = useReflectionProperty();\n\n return (\n <Show when={isSetObject(reflection)}>\n <TSDocReflectionProperty {...props} reflection={reflection} />\n </Show>\n );\n}\n\nexport interface TSDocReflectionMethodProps extends TSDocProps {\n reflection: ReflectionMethod;\n}\n\n/**\n * Generates a TSDoc documentation block for the given reflection method. This component will render the description of the reflection as the main content of the documentation block, and will render any additional attributes (such as title, alias, domain, permission, etc.) as tags in the documentation block. If there are child elements provided, they will be rendered as a list below the main content of the documentation block. Additionally, this component will render information about the parameters and return type of the method, if available.\n */\nexport function TSDocReflectionMethod(props: TSDocReflectionMethodProps) {\n const [{ children, reflection }, rest] = splitProps(props, [\n \"children\",\n \"reflection\"\n ]);\n\n if (!isSetObject(reflection)) {\n return null;\n }\n\n const heading = computed(\n () =>\n reflection.getDescription() ||\n (isString(reflection.getName())\n ? code`${String(reflection.getName())} method definition`\n : undefined)\n );\n\n return (\n <TSDoc heading={heading.value} {...rest}>\n <TSDocAttributesTags\n title={reflection.getTitle()}\n alias={reflection.getAlias()}\n domain={reflection.getDomain()}\n permission={reflection.getPermission()}\n readonly={reflection.isReadonly()}\n internal={reflection.isInternal()}\n ignore={reflection.isIgnored()}\n hidden={reflection.isHidden()}\n />\n <Show\n when={Boolean(children) && childrenArray(() => children).length > 0}>\n <List>{childrenArray(() => children)}</List>\n </Show>\n <Show when={reflection.getParameters().length > 0}>\n <Spacing />\n <For each={reflection.getParameters()} hardline ender={<hbr />}>\n {param => (\n <TSDocParam\n name={param.getName()}\n optional={param.isOptional()}\n defaultValue={\n param.hasDefault() ? param.getDefaultValue() : undefined\n }>\n <Show\n when={Boolean(param.parameter.description)}\n fallback={code`A parameter to provide a ${param.getName()} value to the function.`}>\n {param.parameter.description}\n </Show>\n </TSDocParam>\n )}\n </For>\n </Show>\n <Show when={reflection.getReturnType().kind !== ReflectionKind.void}>\n <Spacing />\n <TSDocReturns>\n {code`The return value of the function, which is of type ${stringifyType(\n reflection.getReturnType()\n )}.`}\n </TSDocReturns>\n </Show>\n </TSDoc>\n );\n}\n\n/**\n * Uses the `useReflectionMethod` hook to retrieve the reflection method from the context, and then renders a `TSDocReflectionMethod` component with the retrieved reflection method. This is a convenience component that allows you to easily render a TSDoc documentation block for the current reflection method without having to manually retrieve the reflection method from the context.\n */\nexport function TSDocContextMethod(props: TSDocProps) {\n const reflection = useReflectionMethod();\n\n return (\n <Show when={isSetObject(reflection)}>\n <TSDocReflectionMethod {...props} reflection={reflection} />\n </Show>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AA8DA,SAAgB,q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