@powerlines/plugin-alloy 0.26.125 → 0.26.127
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/contexts/index.cjs +9 -10
- package/dist/core/contexts/index.d.cts +2 -2
- package/dist/core/contexts/index.d.mts +2 -2
- package/dist/core/contexts/index.mjs +2 -2
- package/dist/core/contexts/{reflection.cjs → schema.cjs} +18 -29
- package/dist/core/contexts/schema.d.cts +48 -0
- package/dist/core/contexts/schema.d.cts.map +1 -0
- package/dist/core/contexts/schema.d.mts +48 -0
- package/dist/core/contexts/schema.d.mts.map +1 -0
- package/dist/core/contexts/schema.mjs +61 -0
- package/dist/core/contexts/schema.mjs.map +1 -0
- package/dist/core/index.cjs +9 -10
- package/dist/core/index.d.cts +2 -2
- package/dist/core/index.d.mts +2 -2
- package/dist/core/index.mjs +2 -2
- package/dist/typescript/components/index.cjs +4 -7
- package/dist/typescript/components/index.d.cts +5 -5
- package/dist/typescript/components/index.d.mts +5 -5
- package/dist/typescript/components/index.mjs +3 -3
- package/dist/typescript/components/interface-declaration.cjs +52 -52
- package/dist/typescript/components/interface-declaration.d.cts +19 -21
- package/dist/typescript/components/interface-declaration.d.cts.map +1 -1
- package/dist/typescript/components/interface-declaration.d.mts +19 -21
- package/dist/typescript/components/interface-declaration.d.mts.map +1 -1
- package/dist/typescript/components/interface-declaration.mjs +52 -52
- package/dist/typescript/components/interface-declaration.mjs.map +1 -1
- package/dist/typescript/components/object-declaration.cjs +40 -56
- package/dist/typescript/components/object-declaration.d.cts +6 -11
- package/dist/typescript/components/object-declaration.d.cts.map +1 -1
- package/dist/typescript/components/object-declaration.d.mts +6 -11
- package/dist/typescript/components/object-declaration.d.mts.map +1 -1
- package/dist/typescript/components/object-declaration.mjs +41 -57
- package/dist/typescript/components/object-declaration.mjs.map +1 -1
- package/dist/typescript/components/tsdoc-schema.cjs +171 -0
- package/dist/typescript/components/tsdoc-schema.d.cts +21 -0
- package/dist/typescript/components/tsdoc-schema.d.cts.map +1 -0
- package/dist/typescript/components/tsdoc-schema.d.mts +21 -0
- package/dist/typescript/components/tsdoc-schema.d.mts.map +1 -0
- package/dist/typescript/components/tsdoc-schema.mjs +169 -0
- package/dist/typescript/components/tsdoc-schema.mjs.map +1 -0
- package/dist/typescript/components/tsdoc.cjs +30 -19
- package/dist/typescript/components/tsdoc.d.cts +16 -12
- package/dist/typescript/components/tsdoc.d.cts.map +1 -1
- package/dist/typescript/components/tsdoc.d.mts +16 -12
- package/dist/typescript/components/tsdoc.d.mts.map +1 -1
- package/dist/typescript/components/tsdoc.mjs +30 -20
- package/dist/typescript/components/tsdoc.mjs.map +1 -1
- package/dist/typescript/index.cjs +4 -7
- package/dist/typescript/index.d.cts +5 -5
- package/dist/typescript/index.d.mts +5 -5
- package/dist/typescript/index.mjs +3 -3
- package/package.json +12 -12
- package/dist/core/contexts/reflection.d.cts +0 -62
- package/dist/core/contexts/reflection.d.cts.map +0 -1
- package/dist/core/contexts/reflection.d.mts +0 -62
- package/dist/core/contexts/reflection.d.mts.map +0 -1
- package/dist/core/contexts/reflection.mjs +0 -71
- package/dist/core/contexts/reflection.mjs.map +0 -1
- package/dist/typescript/components/tsdoc-reflection.cjs +0 -331
- package/dist/typescript/components/tsdoc-reflection.d.cts +0 -41
- package/dist/typescript/components/tsdoc-reflection.d.cts.map +0 -1
- package/dist/typescript/components/tsdoc-reflection.d.mts +0 -41
- package/dist/typescript/components/tsdoc-reflection.d.mts.map +0 -1
- package/dist/typescript/components/tsdoc-reflection.mjs +0 -325
- package/dist/typescript/components/tsdoc-reflection.mjs.map +0 -1
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
const require_core_components_spacing = require('../../core/components/spacing.cjs');
|
|
4
|
+
const require_typescript_components_tsdoc = require('./tsdoc.cjs');
|
|
5
|
+
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
6
|
+
let _alloy_js_core = require("@alloy-js/core");
|
|
7
|
+
let _stryke_string_format_title_case = require("@stryke/string-format/title-case");
|
|
8
|
+
let _stryke_type_checks_is_undefined = require("@stryke/type-checks/is-undefined");
|
|
9
|
+
let _stryke_type_checks = require("@stryke/type-checks");
|
|
10
|
+
let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
|
|
11
|
+
|
|
12
|
+
//#region src/typescript/components/tsdoc-schema.tsx
|
|
13
|
+
/**
|
|
14
|
+
* 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.
|
|
15
|
+
*/
|
|
16
|
+
function TSDocObjectSchema(props) {
|
|
17
|
+
const [{ children, heading, schema }, rest] = (0, _alloy_js_core.splitProps)(props, [
|
|
18
|
+
"heading",
|
|
19
|
+
"children",
|
|
20
|
+
"schema"
|
|
21
|
+
]);
|
|
22
|
+
if (!(0, _stryke_type_checks.isSetObject)(schema)) return null;
|
|
23
|
+
const title = (0, _alloy_js_core.computed)(() => schema.metadata?.title || (0, _stryke_string_format_title_case.titleCase)(schema.metadata?.name));
|
|
24
|
+
const computedHeading = (0, _alloy_js_core.computed)(() => heading || schema.metadata?.description || title.value);
|
|
25
|
+
const alias = (0, _alloy_js_core.computed)(() => schema.metadata?.alias);
|
|
26
|
+
const domain = (0, _alloy_js_core.computed)(() => schema.metadata?.resourceId);
|
|
27
|
+
const groups = (0, _alloy_js_core.computed)(() => schema.metadata?.groups);
|
|
28
|
+
const isReadonly = (0, _alloy_js_core.computed)(() => schema.metadata?.isReadonly);
|
|
29
|
+
const isInternal = (0, _alloy_js_core.computed)(() => schema.metadata?.isInternal);
|
|
30
|
+
const isRuntime = (0, _alloy_js_core.computed)(() => schema.metadata?.isRuntime);
|
|
31
|
+
const isIgnore = (0, _alloy_js_core.computed)(() => schema.metadata?.isIgnore);
|
|
32
|
+
const isHidden = (0, _alloy_js_core.computed)(() => schema.metadata?.isHidden);
|
|
33
|
+
if (!computedHeading.value || (0, _stryke_type_checks_is_set_string.isSetString)(computedHeading.value) && computedHeading.value.trim() === "") return null;
|
|
34
|
+
const hasAttributes = (0, _alloy_js_core.computed)(() => (0, _stryke_type_checks_is_set_string.isSetString)(title.value) || !(0, _stryke_type_checks_is_undefined.isUndefined)(alias.value) && alias.value.length > 0 || !(0, _stryke_type_checks_is_undefined.isUndefined)(groups.value) && groups.value.length > 0 || (0, _stryke_type_checks_is_set_string.isSetString)(domain.value) || !(0, _stryke_type_checks_is_undefined.isUndefined)(isReadonly.value) || !(0, _stryke_type_checks_is_undefined.isUndefined)(isInternal.value) || !(0, _stryke_type_checks_is_undefined.isUndefined)(isRuntime.value) || !(0, _stryke_type_checks_is_undefined.isUndefined)(isIgnore.value) || !(0, _stryke_type_checks_is_undefined.isUndefined)(isHidden.value));
|
|
35
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_tsdoc.TSDoc, (0, _alloy_js_core_jsx_runtime.mergeProps)(rest, {
|
|
36
|
+
get heading() {
|
|
37
|
+
return (0, _alloy_js_core_jsx_runtime.memo)(() => !!(0, _stryke_type_checks_is_set_string.isSetString)(computedHeading.value))() ? computedHeading.value.trim() : computedHeading.value;
|
|
38
|
+
},
|
|
39
|
+
get children() {
|
|
40
|
+
return [(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
41
|
+
get when() {
|
|
42
|
+
return hasAttributes.value;
|
|
43
|
+
},
|
|
44
|
+
get children() {
|
|
45
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_tsdoc.TSDocAttributesTags, {
|
|
46
|
+
get type() {
|
|
47
|
+
return schema.type;
|
|
48
|
+
},
|
|
49
|
+
get title() {
|
|
50
|
+
return title.value;
|
|
51
|
+
},
|
|
52
|
+
get alias() {
|
|
53
|
+
return alias.value;
|
|
54
|
+
},
|
|
55
|
+
get resourceId() {
|
|
56
|
+
return domain.value;
|
|
57
|
+
},
|
|
58
|
+
get groups() {
|
|
59
|
+
return groups.value;
|
|
60
|
+
},
|
|
61
|
+
get isReadonly() {
|
|
62
|
+
return Boolean(isReadonly.value);
|
|
63
|
+
},
|
|
64
|
+
get isInternal() {
|
|
65
|
+
return Boolean(isInternal.value);
|
|
66
|
+
},
|
|
67
|
+
get isRuntime() {
|
|
68
|
+
return Boolean(isRuntime.value);
|
|
69
|
+
},
|
|
70
|
+
get isIgnored() {
|
|
71
|
+
return Boolean(isIgnore.value);
|
|
72
|
+
},
|
|
73
|
+
get isHidden() {
|
|
74
|
+
return Boolean(isHidden.value);
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
79
|
+
get when() {
|
|
80
|
+
return (0, _alloy_js_core_jsx_runtime.memo)(() => !!!(0, _stryke_type_checks_is_undefined.isUndefined)(children))() && (0, _alloy_js_core.childrenArray)(() => children).filter(Boolean).length > 0;
|
|
81
|
+
},
|
|
82
|
+
get children() {
|
|
83
|
+
return [(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
84
|
+
get when() {
|
|
85
|
+
return hasAttributes.value;
|
|
86
|
+
},
|
|
87
|
+
get children() {
|
|
88
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(require_core_components_spacing.Spacing, {});
|
|
89
|
+
}
|
|
90
|
+
}), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.List, { get children() {
|
|
91
|
+
return (0, _alloy_js_core.childrenArray)(() => children);
|
|
92
|
+
} })];
|
|
93
|
+
}
|
|
94
|
+
})];
|
|
95
|
+
}
|
|
96
|
+
}));
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* 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.
|
|
100
|
+
*/
|
|
101
|
+
function TSDocSchemaProperty(props) {
|
|
102
|
+
const [{ children, schema }, rest] = (0, _alloy_js_core.splitProps)(props, ["children", "schema"]);
|
|
103
|
+
if (!(0, _stryke_type_checks.isSetObject)(schema)) return null;
|
|
104
|
+
const hasAttributes = (0, _alloy_js_core.computed)(() => (0, _stryke_type_checks_is_set_string.isSetString)(schema.metadata?.title) || !(0, _stryke_type_checks_is_undefined.isUndefined)(schema.metadata?.alias) && schema.metadata?.alias.length > 0 || !(0, _stryke_type_checks_is_undefined.isUndefined)(schema.metadata?.groups) && schema.metadata?.groups.length > 0 || (0, _stryke_type_checks_is_set_string.isSetString)(schema.metadata?.resourceId) || !(0, _stryke_type_checks_is_undefined.isUndefined)(schema.metadata?.isReadonly) || !(0, _stryke_type_checks_is_undefined.isUndefined)(schema.metadata?.isInternal) || !(0, _stryke_type_checks_is_undefined.isUndefined)(schema.metadata?.isRuntime) || !(0, _stryke_type_checks_is_undefined.isUndefined)(schema.metadata?.isIgnored) || !(0, _stryke_type_checks_is_undefined.isUndefined)(schema.metadata?.isHidden) || !(0, _stryke_type_checks_is_undefined.isUndefined)(schema?.metadata?.default));
|
|
105
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_tsdoc.TSDoc, (0, _alloy_js_core_jsx_runtime.mergeProps)({ get heading() {
|
|
106
|
+
return schema.metadata?.description;
|
|
107
|
+
} }, rest, { get children() {
|
|
108
|
+
return [(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
109
|
+
get when() {
|
|
110
|
+
return hasAttributes.value;
|
|
111
|
+
},
|
|
112
|
+
get children() {
|
|
113
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_tsdoc.TSDocAttributesTags, {
|
|
114
|
+
get type() {
|
|
115
|
+
return schema.type;
|
|
116
|
+
},
|
|
117
|
+
get title() {
|
|
118
|
+
return schema.metadata?.title;
|
|
119
|
+
},
|
|
120
|
+
get alias() {
|
|
121
|
+
return schema.metadata?.alias;
|
|
122
|
+
},
|
|
123
|
+
get resourceId() {
|
|
124
|
+
return schema.metadata?.resourceId;
|
|
125
|
+
},
|
|
126
|
+
get groups() {
|
|
127
|
+
return schema.metadata?.groups;
|
|
128
|
+
},
|
|
129
|
+
get isReadonly() {
|
|
130
|
+
return schema.metadata?.isReadonly;
|
|
131
|
+
},
|
|
132
|
+
get isInternal() {
|
|
133
|
+
return schema.metadata?.isInternal;
|
|
134
|
+
},
|
|
135
|
+
get isRuntime() {
|
|
136
|
+
return schema.metadata?.isRuntime;
|
|
137
|
+
},
|
|
138
|
+
get isIgnored() {
|
|
139
|
+
return schema.metadata?.isIgnored;
|
|
140
|
+
},
|
|
141
|
+
get isHidden() {
|
|
142
|
+
return schema.metadata?.isHidden;
|
|
143
|
+
},
|
|
144
|
+
get defaultValue() {
|
|
145
|
+
return schema.metadata?.default;
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
}), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
150
|
+
get when() {
|
|
151
|
+
return (0, _alloy_js_core_jsx_runtime.memo)(() => !!!(0, _stryke_type_checks_is_undefined.isUndefined)(children))() && (0, _alloy_js_core.childrenArray)(() => children).filter(Boolean).length > 0;
|
|
152
|
+
},
|
|
153
|
+
get children() {
|
|
154
|
+
return [(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
155
|
+
get when() {
|
|
156
|
+
return hasAttributes.value;
|
|
157
|
+
},
|
|
158
|
+
get children() {
|
|
159
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(require_core_components_spacing.Spacing, {});
|
|
160
|
+
}
|
|
161
|
+
}), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.List, { get children() {
|
|
162
|
+
return (0, _alloy_js_core.childrenArray)(() => children);
|
|
163
|
+
} })];
|
|
164
|
+
}
|
|
165
|
+
})];
|
|
166
|
+
} }));
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
//#endregion
|
|
170
|
+
exports.TSDocObjectSchema = TSDocObjectSchema;
|
|
171
|
+
exports.TSDocSchemaProperty = TSDocSchemaProperty;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { TSDocProps } from "./tsdoc.cjs";
|
|
2
|
+
import { JTDSchemaObjectType, JTDSchemaType } from "@powerlines/schema";
|
|
3
|
+
|
|
4
|
+
//#region src/typescript/components/tsdoc-schema.d.ts
|
|
5
|
+
interface TSDocObjectSchemaProps extends TSDocProps {
|
|
6
|
+
schema: JTDSchemaObjectType;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* 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.
|
|
10
|
+
*/
|
|
11
|
+
declare function TSDocObjectSchema(props: TSDocObjectSchemaProps): import("@alloy-js/core").Children;
|
|
12
|
+
interface TSDocSchemaPropertyProps extends TSDocProps {
|
|
13
|
+
schema: JTDSchemaType;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* 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.
|
|
17
|
+
*/
|
|
18
|
+
declare function TSDocSchemaProperty(props: TSDocSchemaPropertyProps): import("@alloy-js/core").Children;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { TSDocObjectSchema, TSDocObjectSchemaProps, TSDocSchemaProperty, TSDocSchemaPropertyProps };
|
|
21
|
+
//# sourceMappingURL=tsdoc-schema.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tsdoc-schema.d.cts","names":[],"sources":["../../../src/typescript/components/tsdoc-schema.tsx"],"mappings":";;;;UAsCiB,sBAAA,SAA+B,UAAU;EACxD,MAAA,EAAQ,mBAAA;AAAA;;;;iBAMM,iBAAA,CAAkB,KAAA,EAAO,sBAAsB,4BAAA,QAAA;AAAA,UAmF9C,wBAAA,SAAiC,UAAU;EAC1D,MAAA,EAAQ,aAAA;AAAA;AA1FmB;AAM7B;;AAN6B,iBAgGb,mBAAA,CAAoB,KAAA,EAAO,wBAAwB,4BAAA,QAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { TSDocProps } from "./tsdoc.mjs";
|
|
2
|
+
import { JTDSchemaObjectType, JTDSchemaType } from "@powerlines/schema";
|
|
3
|
+
|
|
4
|
+
//#region src/typescript/components/tsdoc-schema.d.ts
|
|
5
|
+
interface TSDocObjectSchemaProps extends TSDocProps {
|
|
6
|
+
schema: JTDSchemaObjectType;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* 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.
|
|
10
|
+
*/
|
|
11
|
+
declare function TSDocObjectSchema(props: TSDocObjectSchemaProps): import("@alloy-js/core").Children;
|
|
12
|
+
interface TSDocSchemaPropertyProps extends TSDocProps {
|
|
13
|
+
schema: JTDSchemaType;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* 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.
|
|
17
|
+
*/
|
|
18
|
+
declare function TSDocSchemaProperty(props: TSDocSchemaPropertyProps): import("@alloy-js/core").Children;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { TSDocObjectSchema, TSDocObjectSchemaProps, TSDocSchemaProperty, TSDocSchemaPropertyProps };
|
|
21
|
+
//# sourceMappingURL=tsdoc-schema.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tsdoc-schema.d.mts","names":[],"sources":["../../../src/typescript/components/tsdoc-schema.tsx"],"mappings":";;;;UAsCiB,sBAAA,SAA+B,UAAU;EACxD,MAAA,EAAQ,mBAAA;AAAA;;;;iBAMM,iBAAA,CAAkB,KAAA,EAAO,sBAAsB,4BAAA,QAAA;AAAA,UAmF9C,wBAAA,SAAiC,UAAU;EAC1D,MAAA,EAAQ,aAAA;AAAA;AA1FmB;AAM7B;;AAN6B,iBAgGb,mBAAA,CAAoB,KAAA,EAAO,wBAAwB,4BAAA,QAAA"}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { Spacing } from "../../core/components/spacing.mjs";
|
|
2
|
+
import { TSDoc, TSDocAttributesTags } from "./tsdoc.mjs";
|
|
3
|
+
import { createComponent, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
4
|
+
import { List, Show, childrenArray, computed, splitProps } from "@alloy-js/core";
|
|
5
|
+
import { titleCase } from "@stryke/string-format/title-case";
|
|
6
|
+
import { isUndefined } from "@stryke/type-checks/is-undefined";
|
|
7
|
+
import { isSetObject } from "@stryke/type-checks";
|
|
8
|
+
import { isSetString } from "@stryke/type-checks/is-set-string";
|
|
9
|
+
|
|
10
|
+
//#region src/typescript/components/tsdoc-schema.tsx
|
|
11
|
+
/**
|
|
12
|
+
* 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.
|
|
13
|
+
*/
|
|
14
|
+
function TSDocObjectSchema(props) {
|
|
15
|
+
const [{ children, heading, schema }, rest] = splitProps(props, [
|
|
16
|
+
"heading",
|
|
17
|
+
"children",
|
|
18
|
+
"schema"
|
|
19
|
+
]);
|
|
20
|
+
if (!isSetObject(schema)) return null;
|
|
21
|
+
const title = computed(() => schema.metadata?.title || titleCase(schema.metadata?.name));
|
|
22
|
+
const computedHeading = computed(() => heading || schema.metadata?.description || title.value);
|
|
23
|
+
const alias = computed(() => schema.metadata?.alias);
|
|
24
|
+
const domain = computed(() => schema.metadata?.resourceId);
|
|
25
|
+
const groups = computed(() => schema.metadata?.groups);
|
|
26
|
+
const isReadonly = computed(() => schema.metadata?.isReadonly);
|
|
27
|
+
const isInternal = computed(() => schema.metadata?.isInternal);
|
|
28
|
+
const isRuntime = computed(() => schema.metadata?.isRuntime);
|
|
29
|
+
const isIgnore = computed(() => schema.metadata?.isIgnore);
|
|
30
|
+
const isHidden = computed(() => schema.metadata?.isHidden);
|
|
31
|
+
if (!computedHeading.value || isSetString(computedHeading.value) && computedHeading.value.trim() === "") return null;
|
|
32
|
+
const hasAttributes = computed(() => isSetString(title.value) || !isUndefined(alias.value) && alias.value.length > 0 || !isUndefined(groups.value) && groups.value.length > 0 || isSetString(domain.value) || !isUndefined(isReadonly.value) || !isUndefined(isInternal.value) || !isUndefined(isRuntime.value) || !isUndefined(isIgnore.value) || !isUndefined(isHidden.value));
|
|
33
|
+
return createComponent(TSDoc, mergeProps(rest, {
|
|
34
|
+
get heading() {
|
|
35
|
+
return memo(() => !!isSetString(computedHeading.value))() ? computedHeading.value.trim() : computedHeading.value;
|
|
36
|
+
},
|
|
37
|
+
get children() {
|
|
38
|
+
return [createComponent(Show, {
|
|
39
|
+
get when() {
|
|
40
|
+
return hasAttributes.value;
|
|
41
|
+
},
|
|
42
|
+
get children() {
|
|
43
|
+
return createComponent(TSDocAttributesTags, {
|
|
44
|
+
get type() {
|
|
45
|
+
return schema.type;
|
|
46
|
+
},
|
|
47
|
+
get title() {
|
|
48
|
+
return title.value;
|
|
49
|
+
},
|
|
50
|
+
get alias() {
|
|
51
|
+
return alias.value;
|
|
52
|
+
},
|
|
53
|
+
get resourceId() {
|
|
54
|
+
return domain.value;
|
|
55
|
+
},
|
|
56
|
+
get groups() {
|
|
57
|
+
return groups.value;
|
|
58
|
+
},
|
|
59
|
+
get isReadonly() {
|
|
60
|
+
return Boolean(isReadonly.value);
|
|
61
|
+
},
|
|
62
|
+
get isInternal() {
|
|
63
|
+
return Boolean(isInternal.value);
|
|
64
|
+
},
|
|
65
|
+
get isRuntime() {
|
|
66
|
+
return Boolean(isRuntime.value);
|
|
67
|
+
},
|
|
68
|
+
get isIgnored() {
|
|
69
|
+
return Boolean(isIgnore.value);
|
|
70
|
+
},
|
|
71
|
+
get isHidden() {
|
|
72
|
+
return Boolean(isHidden.value);
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}), createComponent(Show, {
|
|
77
|
+
get when() {
|
|
78
|
+
return memo(() => !!!isUndefined(children))() && childrenArray(() => children).filter(Boolean).length > 0;
|
|
79
|
+
},
|
|
80
|
+
get children() {
|
|
81
|
+
return [createComponent(Show, {
|
|
82
|
+
get when() {
|
|
83
|
+
return hasAttributes.value;
|
|
84
|
+
},
|
|
85
|
+
get children() {
|
|
86
|
+
return createComponent(Spacing, {});
|
|
87
|
+
}
|
|
88
|
+
}), createComponent(List, { get children() {
|
|
89
|
+
return childrenArray(() => children);
|
|
90
|
+
} })];
|
|
91
|
+
}
|
|
92
|
+
})];
|
|
93
|
+
}
|
|
94
|
+
}));
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* 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.
|
|
98
|
+
*/
|
|
99
|
+
function TSDocSchemaProperty(props) {
|
|
100
|
+
const [{ children, schema }, rest] = splitProps(props, ["children", "schema"]);
|
|
101
|
+
if (!isSetObject(schema)) return null;
|
|
102
|
+
const hasAttributes = computed(() => isSetString(schema.metadata?.title) || !isUndefined(schema.metadata?.alias) && schema.metadata?.alias.length > 0 || !isUndefined(schema.metadata?.groups) && schema.metadata?.groups.length > 0 || isSetString(schema.metadata?.resourceId) || !isUndefined(schema.metadata?.isReadonly) || !isUndefined(schema.metadata?.isInternal) || !isUndefined(schema.metadata?.isRuntime) || !isUndefined(schema.metadata?.isIgnored) || !isUndefined(schema.metadata?.isHidden) || !isUndefined(schema?.metadata?.default));
|
|
103
|
+
return createComponent(TSDoc, mergeProps({ get heading() {
|
|
104
|
+
return schema.metadata?.description;
|
|
105
|
+
} }, rest, { get children() {
|
|
106
|
+
return [createComponent(Show, {
|
|
107
|
+
get when() {
|
|
108
|
+
return hasAttributes.value;
|
|
109
|
+
},
|
|
110
|
+
get children() {
|
|
111
|
+
return createComponent(TSDocAttributesTags, {
|
|
112
|
+
get type() {
|
|
113
|
+
return schema.type;
|
|
114
|
+
},
|
|
115
|
+
get title() {
|
|
116
|
+
return schema.metadata?.title;
|
|
117
|
+
},
|
|
118
|
+
get alias() {
|
|
119
|
+
return schema.metadata?.alias;
|
|
120
|
+
},
|
|
121
|
+
get resourceId() {
|
|
122
|
+
return schema.metadata?.resourceId;
|
|
123
|
+
},
|
|
124
|
+
get groups() {
|
|
125
|
+
return schema.metadata?.groups;
|
|
126
|
+
},
|
|
127
|
+
get isReadonly() {
|
|
128
|
+
return schema.metadata?.isReadonly;
|
|
129
|
+
},
|
|
130
|
+
get isInternal() {
|
|
131
|
+
return schema.metadata?.isInternal;
|
|
132
|
+
},
|
|
133
|
+
get isRuntime() {
|
|
134
|
+
return schema.metadata?.isRuntime;
|
|
135
|
+
},
|
|
136
|
+
get isIgnored() {
|
|
137
|
+
return schema.metadata?.isIgnored;
|
|
138
|
+
},
|
|
139
|
+
get isHidden() {
|
|
140
|
+
return schema.metadata?.isHidden;
|
|
141
|
+
},
|
|
142
|
+
get defaultValue() {
|
|
143
|
+
return schema.metadata?.default;
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
}), createComponent(Show, {
|
|
148
|
+
get when() {
|
|
149
|
+
return memo(() => !!!isUndefined(children))() && childrenArray(() => children).filter(Boolean).length > 0;
|
|
150
|
+
},
|
|
151
|
+
get children() {
|
|
152
|
+
return [createComponent(Show, {
|
|
153
|
+
get when() {
|
|
154
|
+
return hasAttributes.value;
|
|
155
|
+
},
|
|
156
|
+
get children() {
|
|
157
|
+
return createComponent(Spacing, {});
|
|
158
|
+
}
|
|
159
|
+
}), createComponent(List, { get children() {
|
|
160
|
+
return childrenArray(() => children);
|
|
161
|
+
} })];
|
|
162
|
+
}
|
|
163
|
+
})];
|
|
164
|
+
} }));
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
//#endregion
|
|
168
|
+
export { TSDocObjectSchema, TSDocSchemaProperty };
|
|
169
|
+
//# sourceMappingURL=tsdoc-schema.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tsdoc-schema.mjs","names":[],"sources":["../../../src/typescript/components/tsdoc-schema.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 computed,\n List,\n Show,\n splitProps\n} from \"@alloy-js/core\";\n\nimport {\n JTDSchemaObjectType,\n JTDSchemaType,\n JTDType\n} from \"@powerlines/schema\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isSetObject } from \"@stryke/type-checks\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\nimport { Spacing } from \"../../core/components/spacing\";\nimport { TSDoc, TSDocAttributesTags, TSDocProps } from \"./tsdoc\";\n\nexport interface TSDocObjectSchemaProps extends TSDocProps {\n schema: JTDSchemaObjectType;\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 TSDocObjectSchema(props: TSDocObjectSchemaProps) {\n const [{ children, heading, schema }, rest] = splitProps(props, [\n \"heading\",\n \"children\",\n \"schema\"\n ]);\n\n if (!isSetObject(schema)) {\n return null;\n }\n\n const title = computed(\n () => schema.metadata?.title || titleCase(schema.metadata?.name)\n );\n const computedHeading = computed(\n () => heading || schema.metadata?.description || title.value\n );\n\n const alias = computed(() => schema.metadata?.alias);\n const domain = computed(() => schema.metadata?.resourceId);\n const groups = computed(() => schema.metadata?.groups);\n const isReadonly = computed(() => schema.metadata?.isReadonly);\n const isInternal = computed(() => schema.metadata?.isInternal);\n const isRuntime = computed(() => schema.metadata?.isRuntime);\n const isIgnore = computed(() => schema.metadata?.isIgnore);\n const isHidden = computed(() => schema.metadata?.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(groups.value) && groups.value.length > 0) ||\n isSetString(domain.value) ||\n !isUndefined(isReadonly.value) ||\n !isUndefined(isInternal.value) ||\n !isUndefined(isRuntime.value) ||\n !isUndefined(isIgnore.value) ||\n !isUndefined(isHidden.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 type={(schema as { type?: JTDType }).type}\n title={title.value}\n alias={alias.value}\n resourceId={domain.value}\n groups={groups.value}\n isReadonly={Boolean(isReadonly.value)}\n isInternal={Boolean(isInternal.value)}\n isRuntime={Boolean(isRuntime.value)}\n isIgnored={Boolean(isIgnore.value)}\n isHidden={Boolean(isHidden.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\nexport interface TSDocSchemaPropertyProps extends TSDocProps {\n schema: JTDSchemaType;\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 TSDocSchemaProperty(props: TSDocSchemaPropertyProps) {\n const [{ children, schema }, rest] = splitProps(props, [\n \"children\",\n \"schema\"\n ]);\n\n if (!isSetObject(schema)) {\n return null;\n }\n\n const hasAttributes = computed(\n () =>\n isSetString(schema.metadata?.title) ||\n (!isUndefined(schema.metadata?.alias) &&\n schema.metadata?.alias.length > 0) ||\n (!isUndefined(schema.metadata?.groups) &&\n schema.metadata?.groups.length > 0) ||\n isSetString(schema.metadata?.resourceId) ||\n !isUndefined(schema.metadata?.isReadonly) ||\n !isUndefined(schema.metadata?.isInternal) ||\n !isUndefined(schema.metadata?.isRuntime) ||\n !isUndefined(schema.metadata?.isIgnored) ||\n !isUndefined(schema.metadata?.isHidden) ||\n !isUndefined(schema?.metadata?.default)\n );\n\n return (\n <TSDoc heading={schema.metadata?.description} {...rest}>\n <Show when={hasAttributes.value}>\n <TSDocAttributesTags\n type={(schema as { type?: JTDType }).type}\n title={schema.metadata?.title}\n alias={schema.metadata?.alias}\n resourceId={schema.metadata?.resourceId}\n groups={schema.metadata?.groups}\n isReadonly={schema.metadata?.isReadonly}\n isInternal={schema.metadata?.isInternal}\n isRuntime={schema.metadata?.isRuntime}\n isIgnored={schema.metadata?.isIgnored}\n isHidden={schema.metadata?.isHidden}\n defaultValue={schema.metadata?.default}\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// export 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// */\n// export 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// resourceId={reflection.getDomain()}\n// permission={reflection.getPermission()}\n// isReadonly={reflection.isReadonly()}\n// isInternal={reflection.isInternal()}\n// isRuntime={reflection.isRuntime()}\n// isIgnored={reflection.isIgnored()}\n// isHidden={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// */\n// export 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":";;;;;;;;;;;;;AA8BA,SAAS,kBAAkB,OAAA;CAC3B,MAAQ,CAAC,EACT,UACA,SACA,UACA,QAAS,WAAe,OAAO;EAAA;EAAK;EAAmB;CAAA,CAAA;CACvD,IAAM,CAAC,YAAS,M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')
|
|
|
4
4
|
const require_core_components_spacing = require('../../core/components/spacing.cjs');
|
|
5
5
|
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
6
6
|
let _alloy_js_core = require("@alloy-js/core");
|
|
7
|
-
let _powerlines_deepkit_utilities = require("@powerlines/deepkit/utilities");
|
|
8
7
|
let _stryke_type_checks_is_undefined = require("@stryke/type-checks/is-undefined");
|
|
8
|
+
let _powerlines_schema_codegen = require("@powerlines/schema/codegen");
|
|
9
9
|
let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
|
|
10
10
|
|
|
11
11
|
//#region src/typescript/components/tsdoc.tsx
|
|
@@ -143,6 +143,16 @@ function TSDocPermission(props) {
|
|
|
143
143
|
}));
|
|
144
144
|
}
|
|
145
145
|
/**
|
|
146
|
+
* Create a TSDoc `@group` tag.
|
|
147
|
+
*/
|
|
148
|
+
function TSDocGroup(props) {
|
|
149
|
+
const [{ children }, rest] = (0, _alloy_js_core.splitProps)(props, ["children"]);
|
|
150
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(TSDocTag, (0, _alloy_js_core_jsx_runtime.mergeProps)(rest, {
|
|
151
|
+
tag: "group",
|
|
152
|
+
children
|
|
153
|
+
}));
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
146
156
|
* Create a TSDoc `@defaultValue` tag.
|
|
147
157
|
*/
|
|
148
158
|
function TSDocDefaultValue(props) {
|
|
@@ -156,7 +166,7 @@ function TSDocDefaultValue(props) {
|
|
|
156
166
|
width: 2,
|
|
157
167
|
get children() {
|
|
158
168
|
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Prose, { get children() {
|
|
159
|
-
return (0,
|
|
169
|
+
return (0, _powerlines_schema_codegen.stringifyValue)(defaultValue, type);
|
|
160
170
|
} });
|
|
161
171
|
}
|
|
162
172
|
});
|
|
@@ -251,19 +261,19 @@ function TSDocRuntime() {
|
|
|
251
261
|
* Generates a TypeScript interface property for the given reflection class.
|
|
252
262
|
*/
|
|
253
263
|
function TSDocAttributesTags(props) {
|
|
254
|
-
const [{ type, alias,
|
|
264
|
+
const [{ type, alias, groups, isReadonly, isInternal, isIgnored, isHidden, isRuntime, defaultValue }] = (0, _alloy_js_core.splitProps)(props, [
|
|
255
265
|
"type",
|
|
256
266
|
"alias",
|
|
257
|
-
"
|
|
258
|
-
"
|
|
259
|
-
"
|
|
260
|
-
"
|
|
261
|
-
"
|
|
262
|
-
"
|
|
267
|
+
"groups",
|
|
268
|
+
"isReadonly",
|
|
269
|
+
"isInternal",
|
|
270
|
+
"isIgnored",
|
|
271
|
+
"isHidden",
|
|
272
|
+
"isRuntime",
|
|
263
273
|
"defaultValue"
|
|
264
274
|
]);
|
|
265
275
|
const title = (0, _alloy_js_core.computed)(() => props.title?.trim() || "");
|
|
266
|
-
const domain = (0, _alloy_js_core.computed)(() => props.
|
|
276
|
+
const domain = (0, _alloy_js_core.computed)(() => props.resourceId?.trim() || "");
|
|
267
277
|
return [
|
|
268
278
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
269
279
|
get when() {
|
|
@@ -300,50 +310,50 @@ function TSDocAttributesTags(props) {
|
|
|
300
310
|
}),
|
|
301
311
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
302
312
|
get when() {
|
|
303
|
-
return (0, _alloy_js_core_jsx_runtime.memo)(() => !!(!(0, _stryke_type_checks_is_undefined.isUndefined)(
|
|
313
|
+
return (0, _alloy_js_core_jsx_runtime.memo)(() => !!(!(0, _stryke_type_checks_is_undefined.isUndefined)(groups) && groups.length > 0))() && groups.some((g) => (0, _stryke_type_checks_is_set_string.isSetString)(g?.trim()));
|
|
304
314
|
},
|
|
305
315
|
get children() {
|
|
306
316
|
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
|
|
307
317
|
get each() {
|
|
308
|
-
return
|
|
318
|
+
return groups?.filter((g) => (0, _stryke_type_checks_is_set_string.isSetString)(g?.trim())) ?? [];
|
|
309
319
|
},
|
|
310
|
-
children: (
|
|
320
|
+
children: (group) => (0, _alloy_js_core_jsx_runtime.createComponent)(TSDocGroup, { children: group })
|
|
311
321
|
});
|
|
312
322
|
}
|
|
313
323
|
}),
|
|
314
324
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
315
|
-
when:
|
|
325
|
+
when: isReadonly === true,
|
|
316
326
|
get children() {
|
|
317
327
|
return (0, _alloy_js_core_jsx_runtime.createComponent)(TSDocReadonly, {});
|
|
318
328
|
}
|
|
319
329
|
}),
|
|
320
330
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
321
|
-
when:
|
|
331
|
+
when: isInternal === true,
|
|
322
332
|
get children() {
|
|
323
333
|
return (0, _alloy_js_core_jsx_runtime.createComponent)(TSDocInternal, {});
|
|
324
334
|
}
|
|
325
335
|
}),
|
|
326
336
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
327
|
-
when:
|
|
337
|
+
when: isIgnored === true,
|
|
328
338
|
get children() {
|
|
329
339
|
return (0, _alloy_js_core_jsx_runtime.createComponent)(TSDocIgnore, {});
|
|
330
340
|
}
|
|
331
341
|
}),
|
|
332
342
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
333
|
-
when:
|
|
343
|
+
when: isHidden === true,
|
|
334
344
|
get children() {
|
|
335
345
|
return (0, _alloy_js_core_jsx_runtime.createComponent)(TSDocHidden, {});
|
|
336
346
|
}
|
|
337
347
|
}),
|
|
338
348
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
339
|
-
when:
|
|
349
|
+
when: isRuntime === true,
|
|
340
350
|
get children() {
|
|
341
351
|
return (0, _alloy_js_core_jsx_runtime.createComponent)(TSDocRuntime, {});
|
|
342
352
|
}
|
|
343
353
|
}),
|
|
344
354
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
345
355
|
get when() {
|
|
346
|
-
return (0, _alloy_js_core_jsx_runtime.memo)(() => !!(
|
|
356
|
+
return (0, _alloy_js_core_jsx_runtime.memo)(() => !!(isRuntime !== true && !(0, _stryke_type_checks_is_undefined.isUndefined)(type)))() && !(0, _stryke_type_checks_is_undefined.isUndefined)(defaultValue);
|
|
347
357
|
},
|
|
348
358
|
get children() {
|
|
349
359
|
return (0, _alloy_js_core_jsx_runtime.createComponent)(TSDocDefaultValue, {
|
|
@@ -480,6 +490,7 @@ exports.TSDocAttributesTags = TSDocAttributesTags;
|
|
|
480
490
|
exports.TSDocDefaultValue = TSDocDefaultValue;
|
|
481
491
|
exports.TSDocDomain = TSDocDomain;
|
|
482
492
|
exports.TSDocExample = TSDocExample;
|
|
493
|
+
exports.TSDocGroup = TSDocGroup;
|
|
483
494
|
exports.TSDocHidden = TSDocHidden;
|
|
484
495
|
exports.TSDocIgnore = TSDocIgnore;
|
|
485
496
|
exports.TSDocInternal = TSDocInternal;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentProps } from "../../types/components.cjs";
|
|
2
2
|
import { Children } from "@alloy-js/core";
|
|
3
3
|
import { JSDocExampleProps, ParameterDescriptor } from "@alloy-js/typescript";
|
|
4
|
-
import {
|
|
4
|
+
import { JTDType } from "@powerlines/schema/types";
|
|
5
5
|
|
|
6
6
|
//#region src/typescript/components/tsdoc.d.ts
|
|
7
7
|
interface TSDocProps extends ComponentProps {
|
|
@@ -41,8 +41,12 @@ declare function TSDocAlias(props: ComponentProps): Children;
|
|
|
41
41
|
* Create a TSDoc `@permission` tag.
|
|
42
42
|
*/
|
|
43
43
|
declare function TSDocPermission(props: ComponentProps): Children;
|
|
44
|
+
/**
|
|
45
|
+
* Create a TSDoc `@group` tag.
|
|
46
|
+
*/
|
|
47
|
+
declare function TSDocGroup(props: ComponentProps): Children;
|
|
44
48
|
interface TSDocDefaultValueProps extends ComponentProps {
|
|
45
|
-
type
|
|
49
|
+
type?: JTDType;
|
|
46
50
|
defaultValue: any;
|
|
47
51
|
}
|
|
48
52
|
/**
|
|
@@ -90,17 +94,17 @@ declare function TSDocHidden(): Children;
|
|
|
90
94
|
*/
|
|
91
95
|
declare function TSDocRuntime(): Children;
|
|
92
96
|
interface TSDocAttributesTagsProps {
|
|
93
|
-
type?:
|
|
97
|
+
type?: JTDType;
|
|
98
|
+
defaultValue?: any;
|
|
94
99
|
title?: string;
|
|
95
100
|
alias?: string[];
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
defaultValue?: any;
|
|
101
|
+
groups?: string[];
|
|
102
|
+
resourceId?: string;
|
|
103
|
+
isReadonly?: boolean;
|
|
104
|
+
isInternal?: boolean;
|
|
105
|
+
isIgnored?: boolean;
|
|
106
|
+
isHidden?: boolean;
|
|
107
|
+
isRuntime?: boolean;
|
|
104
108
|
}
|
|
105
109
|
/**
|
|
106
110
|
* Generates a TypeScript interface property for the given reflection class.
|
|
@@ -157,5 +161,5 @@ interface TSDocModuleProps extends ComponentProps {
|
|
|
157
161
|
*/
|
|
158
162
|
declare function TSDocModule(props: TSDocModuleProps): Children;
|
|
159
163
|
//#endregion
|
|
160
|
-
export { TSDoc, TSDocAlias, TSDocAttributesTags, TSDocAttributesTagsProps, TSDocDefaultValue, TSDocDefaultValueProps, TSDocDomain, TSDocExample, TSDocExampleProps, TSDocHidden, TSDocIgnore, TSDocInternal, TSDocLink, TSDocModule, TSDocModuleProps, TSDocParam, TSDocParamProps, TSDocParams, TSDocParamsProps, TSDocPermission, TSDocProps, TSDocReadonly, TSDocRemarks, TSDocReturns, TSDocRuntime, TSDocTag, TSDocTagProps, TSDocThrows, TSDocTitle };
|
|
164
|
+
export { TSDoc, TSDocAlias, TSDocAttributesTags, TSDocAttributesTagsProps, TSDocDefaultValue, TSDocDefaultValueProps, TSDocDomain, TSDocExample, TSDocExampleProps, TSDocGroup, TSDocHidden, TSDocIgnore, TSDocInternal, TSDocLink, TSDocModule, TSDocModuleProps, TSDocParam, TSDocParamProps, TSDocParams, TSDocParamsProps, TSDocPermission, TSDocProps, TSDocReadonly, TSDocRemarks, TSDocReturns, TSDocRuntime, TSDocTag, TSDocTagProps, TSDocThrows, TSDocTitle };
|
|
161
165
|
//# sourceMappingURL=tsdoc.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tsdoc.d.cts","names":[],"sources":["../../../src/typescript/components/tsdoc.tsx"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"tsdoc.d.cts","names":[],"sources":["../../../src/typescript/components/tsdoc.tsx"],"mappings":";;;;;;UAsCiB,UAAA,SAAmB,cAAc;EAChD,OAAA,GAAU,QAAA;AAAA;;;;iBAMI,KAAA,CAAM,KAAA,EAAO,UAAA,GAAU,QAAA;AAAA,UA6BtB,aAAA,SAAsB,cAAc;EACnD,GAAG;AAAA;AApCe;AAMpB;;AANoB,iBA0CJ,QAAA,CAAS,KAAA,EAAO,aAAA,GAAa,QAAA;AAAA,UAgB5B,gBAAA;EACf,UAAA,EAAY,mBAAmB;AAAA;;;AArDM;iBA2DvB,WAAA,CAAY,KAAA,EAAO,gBAAA,GAAgB,QAAA;;;;iBA2BnC,UAAA,CAAW,KAAA,EAAO,cAAA,GAAc,QAAA;AAlDhD;;;AAAA,iBA+DgB,WAAA,CAAY,KAAA,EAAO,cAAA,GAAc,QAAA;;;;iBAajC,UAAA,CAAW,KAAA,EAAO,cAAA,GAAc,QAAA;AA5EH;AAgB7C;;AAhB6C,iBAyF7B,eAAA,CAAgB,KAAA,EAAO,cAAA,GAAc,QAAA;;AAxEpB;AAMjC;iBA+EgB,UAAA,CAAW,KAAA,EAAO,cAAA,GAAc,QAAA;AAAA,UAU/B,sBAAA,SAA+B,cAAc;EAC5D,IAAA,GAAO,OAAA;EACP,YAAA;AAAA;;;AA3FiD;iBAiGnC,iBAAA,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