@powerlines/plugin-alloy 0.26.133 → 0.26.143
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 +0 -1
- package/dist/core/components/single-line-comment.cjs +0 -1
- package/dist/core/components/spacing.cjs +0 -1
- package/dist/core/contexts/context.cjs +0 -1
- package/dist/core/contexts/index.cjs +0 -4
- 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/meta.cjs +0 -1
- package/dist/core/contexts/schema.cjs +0 -31
- package/dist/core/contexts/schema.d.cts +6 -27
- package/dist/core/contexts/schema.d.cts.map +1 -1
- package/dist/core/contexts/schema.d.mts +6 -27
- package/dist/core/contexts/schema.d.mts.map +1 -1
- package/dist/core/contexts/schema.mjs +1 -27
- package/dist/core/contexts/schema.mjs.map +1 -1
- package/dist/core/helpers/code.cjs +0 -1
- package/dist/core/index.cjs +0 -4
- 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/hcl/components/block-declaration.cjs +0 -1
- package/dist/hcl/components/hcl-file.cjs +0 -1
- package/dist/hcl/components/packer-file.cjs +0 -1
- package/dist/hcl/components/terraform-file.cjs +0 -1
- package/dist/helpers/create-builtin.cjs +0 -1
- package/dist/helpers/refkey.cjs +0 -1
- package/dist/helpers/typescript.cjs +0 -1
- package/dist/markdown/components/front-matter.cjs +0 -1
- package/dist/markdown/components/heading.cjs +0 -1
- package/dist/markdown/components/markdown-file.cjs +0 -1
- package/dist/markdown/components/markdown-table.cjs +0 -1
- package/dist/markdown/contexts/markdown-table.cjs +0 -1
- package/dist/render.cjs +0 -1
- package/dist/typescript/components/builtin-file.cjs +0 -1
- package/dist/typescript/components/class-declaration.cjs +0 -1
- package/dist/typescript/components/dynamic-import-statement.cjs +0 -1
- package/dist/typescript/components/interface-declaration.cjs +22 -17
- package/dist/typescript/components/interface-declaration.d.cts +15 -18
- package/dist/typescript/components/interface-declaration.d.cts.map +1 -1
- package/dist/typescript/components/interface-declaration.d.mts +15 -18
- package/dist/typescript/components/interface-declaration.d.mts.map +1 -1
- package/dist/typescript/components/interface-declaration.mjs +23 -17
- package/dist/typescript/components/interface-declaration.mjs.map +1 -1
- package/dist/typescript/components/object-declaration.cjs +6 -7
- package/dist/typescript/components/object-declaration.d.cts +7 -7
- package/dist/typescript/components/object-declaration.d.cts.map +1 -1
- package/dist/typescript/components/object-declaration.d.mts +7 -7
- package/dist/typescript/components/object-declaration.d.mts.map +1 -1
- package/dist/typescript/components/object-declaration.mjs +7 -7
- package/dist/typescript/components/object-declaration.mjs.map +1 -1
- package/dist/typescript/components/property-name.cjs +0 -1
- package/dist/typescript/components/record-expression.cjs +0 -1
- package/dist/typescript/components/tsdoc-schema.cjs +43 -50
- package/dist/typescript/components/tsdoc-schema.d.cts +7 -7
- package/dist/typescript/components/tsdoc-schema.d.cts.map +1 -1
- package/dist/typescript/components/tsdoc-schema.d.mts +7 -7
- package/dist/typescript/components/tsdoc-schema.d.mts.map +1 -1
- package/dist/typescript/components/tsdoc-schema.mjs +43 -49
- package/dist/typescript/components/tsdoc-schema.mjs.map +1 -1
- package/dist/typescript/components/tsdoc.cjs +21 -22
- package/dist/typescript/components/tsdoc.d.cts +11 -11
- package/dist/typescript/components/tsdoc.d.cts.map +1 -1
- package/dist/typescript/components/tsdoc.d.mts +11 -11
- package/dist/typescript/components/tsdoc.d.mts.map +1 -1
- package/dist/typescript/components/tsdoc.mjs +21 -21
- package/dist/typescript/components/tsdoc.mjs.map +1 -1
- package/dist/typescript/components/type-declaration.cjs +0 -1
- package/dist/typescript/components/type-parameters.cjs +0 -1
- package/dist/typescript/components/typescript-file.cjs +0 -1
- package/dist/typescript/contexts/lexical-scope.cjs +0 -1
- package/dist/typescript/contexts/member-scope.cjs +0 -1
- package/dist/typescript/helpers/get-call-signature-props.cjs +0 -1
- package/dist/yaml/components/yaml-file.cjs +0 -1
- package/package.json +8 -8
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
3
2
|
const require_core_components_spacing = require('../../core/components/spacing.cjs');
|
|
4
3
|
const require_typescript_components_tsdoc = require('./tsdoc.cjs');
|
|
5
4
|
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
@@ -8,6 +7,7 @@ let _stryke_string_format_title_case = require("@stryke/string-format/title-case
|
|
|
8
7
|
let _stryke_type_checks_is_undefined = require("@stryke/type-checks/is-undefined");
|
|
9
8
|
let _stryke_type_checks = require("@stryke/type-checks");
|
|
10
9
|
let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
|
|
10
|
+
let _powerlines_schema = require("@powerlines/schema");
|
|
11
11
|
|
|
12
12
|
//#region src/typescript/components/tsdoc-schema.tsx
|
|
13
13
|
/**
|
|
@@ -20,18 +20,17 @@ function TSDocObjectSchema(props) {
|
|
|
20
20
|
"schema"
|
|
21
21
|
]);
|
|
22
22
|
if (!(0, _stryke_type_checks.isSetObject)(schema)) return null;
|
|
23
|
-
const title = (0, _alloy_js_core.computed)(() => schema
|
|
24
|
-
const computedHeading = (0, _alloy_js_core.computed)(() => heading || schema
|
|
25
|
-
const alias = (0, _alloy_js_core.computed)(() => schema
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
const isHidden = (0, _alloy_js_core.computed)(() => schema.metadata?.isHidden);
|
|
23
|
+
const title = (0, _alloy_js_core.computed)(() => schema?.title || (0, _stryke_string_format_title_case.titleCase)(schema?.name));
|
|
24
|
+
const computedHeading = (0, _alloy_js_core.computed)(() => heading || schema?.description || title.value);
|
|
25
|
+
const alias = (0, _alloy_js_core.computed)(() => schema?.alias);
|
|
26
|
+
const tags = (0, _alloy_js_core.computed)(() => schema?.tags);
|
|
27
|
+
const readOnly = (0, _alloy_js_core.computed)(() => schema?.readOnly);
|
|
28
|
+
const internal = (0, _alloy_js_core.computed)(() => schema?.internal);
|
|
29
|
+
const runtime = (0, _alloy_js_core.computed)(() => schema?.runtime);
|
|
30
|
+
const ignore = (0, _alloy_js_core.computed)(() => schema?.ignore);
|
|
31
|
+
const hidden = (0, _alloy_js_core.computed)(() => schema?.hidden);
|
|
33
32
|
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)(
|
|
33
|
+
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)(tags.value) && tags.value.length > 0 || !(0, _stryke_type_checks_is_undefined.isUndefined)(readOnly.value) || !(0, _stryke_type_checks_is_undefined.isUndefined)(internal.value) || !(0, _stryke_type_checks_is_undefined.isUndefined)(runtime.value) || !(0, _stryke_type_checks_is_undefined.isUndefined)(ignore.value) || !(0, _stryke_type_checks_is_undefined.isUndefined)(hidden.value));
|
|
35
34
|
return (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_tsdoc.TSDoc, (0, _alloy_js_core_jsx_runtime.mergeProps)(rest, {
|
|
36
35
|
get heading() {
|
|
37
36
|
return (0, _alloy_js_core_jsx_runtime.memo)(() => !!(0, _stryke_type_checks_is_set_string.isSetString)(computedHeading.value))() ? computedHeading.value.trim() : computedHeading.value;
|
|
@@ -44,7 +43,7 @@ function TSDocObjectSchema(props) {
|
|
|
44
43
|
get children() {
|
|
45
44
|
return (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_tsdoc.TSDocAttributesTags, {
|
|
46
45
|
get type() {
|
|
47
|
-
return schema
|
|
46
|
+
return (0, _powerlines_schema.getPrimarySchemaType)(schema);
|
|
48
47
|
},
|
|
49
48
|
get title() {
|
|
50
49
|
return title.value;
|
|
@@ -52,26 +51,23 @@ function TSDocObjectSchema(props) {
|
|
|
52
51
|
get alias() {
|
|
53
52
|
return alias.value;
|
|
54
53
|
},
|
|
55
|
-
get
|
|
56
|
-
return
|
|
54
|
+
get tags() {
|
|
55
|
+
return tags.value;
|
|
57
56
|
},
|
|
58
|
-
get
|
|
59
|
-
return
|
|
57
|
+
get readOnly() {
|
|
58
|
+
return Boolean(readOnly.value);
|
|
60
59
|
},
|
|
61
|
-
get
|
|
62
|
-
return Boolean(
|
|
60
|
+
get internal() {
|
|
61
|
+
return Boolean(internal.value);
|
|
63
62
|
},
|
|
64
|
-
get
|
|
65
|
-
return Boolean(
|
|
63
|
+
get runtime() {
|
|
64
|
+
return Boolean(runtime.value);
|
|
66
65
|
},
|
|
67
|
-
get
|
|
68
|
-
return Boolean(
|
|
66
|
+
get ignore() {
|
|
67
|
+
return Boolean(ignore.value);
|
|
69
68
|
},
|
|
70
|
-
get
|
|
71
|
-
return Boolean(
|
|
72
|
-
},
|
|
73
|
-
get isHidden() {
|
|
74
|
-
return Boolean(isHidden.value);
|
|
69
|
+
get hidden() {
|
|
70
|
+
return Boolean(hidden.value);
|
|
75
71
|
}
|
|
76
72
|
});
|
|
77
73
|
}
|
|
@@ -101,9 +97,9 @@ function TSDocObjectSchema(props) {
|
|
|
101
97
|
function TSDocSchemaProperty(props) {
|
|
102
98
|
const [{ children, schema }, rest] = (0, _alloy_js_core.splitProps)(props, ["children", "schema"]);
|
|
103
99
|
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
|
|
100
|
+
const hasAttributes = (0, _alloy_js_core.computed)(() => (0, _stryke_type_checks_is_set_string.isSetString)(schema?.title) || !(0, _stryke_type_checks_is_undefined.isUndefined)(schema?.alias) && schema?.alias.length > 0 || !(0, _stryke_type_checks_is_undefined.isUndefined)(schema?.tags) && schema?.tags.length > 0 || !(0, _stryke_type_checks_is_undefined.isUndefined)(schema?.readOnly) || !(0, _stryke_type_checks_is_undefined.isUndefined)(schema?.internal) || !(0, _stryke_type_checks_is_undefined.isUndefined)(schema?.runtime) || !(0, _stryke_type_checks_is_undefined.isUndefined)(schema?.ignore) || !(0, _stryke_type_checks_is_undefined.isUndefined)(schema?.hidden) || !(0, _stryke_type_checks_is_undefined.isUndefined)(schema?.default));
|
|
105
101
|
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
|
|
102
|
+
return schema?.description;
|
|
107
103
|
} }, rest, { get children() {
|
|
108
104
|
return [(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
109
105
|
get when() {
|
|
@@ -112,37 +108,34 @@ function TSDocSchemaProperty(props) {
|
|
|
112
108
|
get children() {
|
|
113
109
|
return (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_tsdoc.TSDocAttributesTags, {
|
|
114
110
|
get type() {
|
|
115
|
-
return schema
|
|
111
|
+
return (0, _powerlines_schema.getPrimarySchemaType)(schema);
|
|
116
112
|
},
|
|
117
113
|
get title() {
|
|
118
|
-
return schema
|
|
114
|
+
return schema?.title;
|
|
119
115
|
},
|
|
120
116
|
get alias() {
|
|
121
|
-
return schema
|
|
122
|
-
},
|
|
123
|
-
get resourceId() {
|
|
124
|
-
return schema.metadata?.resourceId;
|
|
117
|
+
return schema?.alias;
|
|
125
118
|
},
|
|
126
|
-
get
|
|
127
|
-
return schema
|
|
119
|
+
get tags() {
|
|
120
|
+
return schema?.tags;
|
|
128
121
|
},
|
|
129
|
-
get
|
|
130
|
-
return schema
|
|
122
|
+
get readOnly() {
|
|
123
|
+
return schema?.readOnly;
|
|
131
124
|
},
|
|
132
|
-
get
|
|
133
|
-
return schema
|
|
125
|
+
get internal() {
|
|
126
|
+
return schema?.internal;
|
|
134
127
|
},
|
|
135
|
-
get
|
|
136
|
-
return schema
|
|
128
|
+
get runtime() {
|
|
129
|
+
return schema?.runtime;
|
|
137
130
|
},
|
|
138
|
-
get
|
|
139
|
-
return schema
|
|
131
|
+
get ignore() {
|
|
132
|
+
return schema?.ignore;
|
|
140
133
|
},
|
|
141
|
-
get
|
|
142
|
-
return schema
|
|
134
|
+
get hidden() {
|
|
135
|
+
return schema?.hidden;
|
|
143
136
|
},
|
|
144
|
-
get
|
|
145
|
-
return schema
|
|
137
|
+
get ["default"]() {
|
|
138
|
+
return schema?.default;
|
|
146
139
|
}
|
|
147
140
|
});
|
|
148
141
|
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { TSDocProps } from "./tsdoc.cjs";
|
|
2
|
-
import {
|
|
2
|
+
import { JsonSchema, JsonSchemaProperty } from "@powerlines/schema";
|
|
3
3
|
|
|
4
4
|
//#region src/typescript/components/tsdoc-schema.d.ts
|
|
5
|
-
interface TSDocObjectSchemaProps extends TSDocProps {
|
|
6
|
-
schema:
|
|
5
|
+
interface TSDocObjectSchemaProps<T extends Record<string, any> = Record<string, any>> extends TSDocProps {
|
|
6
|
+
schema: JsonSchema<T>;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
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
10
|
*/
|
|
11
|
-
declare function TSDocObjectSchema(props: TSDocObjectSchemaProps): import("@alloy-js/core").Children;
|
|
12
|
-
interface TSDocSchemaPropertyProps extends TSDocProps {
|
|
13
|
-
schema:
|
|
11
|
+
declare function TSDocObjectSchema<T extends Record<string, any> = Record<string, any>>(props: TSDocObjectSchemaProps<T>): import("@alloy-js/core").Children;
|
|
12
|
+
interface TSDocSchemaPropertyProps<T extends Record<string, any> = Record<string, any>> extends TSDocProps {
|
|
13
|
+
schema: JsonSchemaProperty<T>;
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
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
17
|
*/
|
|
18
|
-
declare function TSDocSchemaProperty(props: TSDocSchemaPropertyProps): import("@alloy-js/core").Children;
|
|
18
|
+
declare function TSDocSchemaProperty<T extends Record<string, any> = Record<string, any>>(props: TSDocSchemaPropertyProps<T>): import("@alloy-js/core").Children;
|
|
19
19
|
//#endregion
|
|
20
20
|
export { TSDocObjectSchema, TSDocObjectSchemaProps, TSDocSchemaProperty, TSDocSchemaPropertyProps };
|
|
21
21
|
//# sourceMappingURL=tsdoc-schema.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tsdoc-schema.d.cts","names":[],"sources":["../../../src/typescript/components/tsdoc-schema.tsx"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"tsdoc-schema.d.cts","names":[],"sources":["../../../src/typescript/components/tsdoc-schema.tsx"],"mappings":";;;;UAqCiB,sBAAA,WACL,MAAA,gBAAsB,MAAA,uBACxB,UAAA;EACR,MAAA,EAAQ,UAAA,CAAW,CAAA;AAAA;;;;iBAML,iBAAA,WACJ,MAAA,gBAAsB,MAAA,cAAA,CAChC,KAAA,EAAO,sBAAA,CAAuB,CAAA,6BAAE,QAAA;AAAA,UA8EjB,wBAAA,WACL,MAAA,gBAAsB,MAAA,uBACxB,UAAA;EACR,MAAA,EAAQ,kBAAA,CAAmB,CAAA;AAAA;;;;iBAMb,mBAAA,WACJ,MAAA,gBAAsB,MAAA,cAAA,CAChC,KAAA,EAAO,wBAAA,CAAyB,CAAA,6BAAE,QAAA"}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { TSDocProps } from "./tsdoc.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { JsonSchema, JsonSchemaProperty } from "@powerlines/schema";
|
|
3
3
|
|
|
4
4
|
//#region src/typescript/components/tsdoc-schema.d.ts
|
|
5
|
-
interface TSDocObjectSchemaProps extends TSDocProps {
|
|
6
|
-
schema:
|
|
5
|
+
interface TSDocObjectSchemaProps<T extends Record<string, any> = Record<string, any>> extends TSDocProps {
|
|
6
|
+
schema: JsonSchema<T>;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
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
10
|
*/
|
|
11
|
-
declare function TSDocObjectSchema(props: TSDocObjectSchemaProps): import("@alloy-js/core").Children;
|
|
12
|
-
interface TSDocSchemaPropertyProps extends TSDocProps {
|
|
13
|
-
schema:
|
|
11
|
+
declare function TSDocObjectSchema<T extends Record<string, any> = Record<string, any>>(props: TSDocObjectSchemaProps<T>): import("@alloy-js/core").Children;
|
|
12
|
+
interface TSDocSchemaPropertyProps<T extends Record<string, any> = Record<string, any>> extends TSDocProps {
|
|
13
|
+
schema: JsonSchemaProperty<T>;
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
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
17
|
*/
|
|
18
|
-
declare function TSDocSchemaProperty(props: TSDocSchemaPropertyProps): import("@alloy-js/core").Children;
|
|
18
|
+
declare function TSDocSchemaProperty<T extends Record<string, any> = Record<string, any>>(props: TSDocSchemaPropertyProps<T>): import("@alloy-js/core").Children;
|
|
19
19
|
//#endregion
|
|
20
20
|
export { TSDocObjectSchema, TSDocObjectSchemaProps, TSDocSchemaProperty, TSDocSchemaPropertyProps };
|
|
21
21
|
//# sourceMappingURL=tsdoc-schema.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tsdoc-schema.d.mts","names":[],"sources":["../../../src/typescript/components/tsdoc-schema.tsx"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"tsdoc-schema.d.mts","names":[],"sources":["../../../src/typescript/components/tsdoc-schema.tsx"],"mappings":";;;;UAqCiB,sBAAA,WACL,MAAA,gBAAsB,MAAA,uBACxB,UAAA;EACR,MAAA,EAAQ,UAAA,CAAW,CAAA;AAAA;;;;iBAML,iBAAA,WACJ,MAAA,gBAAsB,MAAA,cAAA,CAChC,KAAA,EAAO,sBAAA,CAAuB,CAAA,6BAAE,QAAA;AAAA,UA8EjB,wBAAA,WACL,MAAA,gBAAsB,MAAA,uBACxB,UAAA;EACR,MAAA,EAAQ,kBAAA,CAAmB,CAAA;AAAA;;;;iBAMb,mBAAA,WACJ,MAAA,gBAAsB,MAAA,cAAA,CAChC,KAAA,EAAO,wBAAA,CAAyB,CAAA,6BAAE,QAAA"}
|
|
@@ -6,6 +6,7 @@ import { titleCase } from "@stryke/string-format/title-case";
|
|
|
6
6
|
import { isUndefined } from "@stryke/type-checks/is-undefined";
|
|
7
7
|
import { isSetObject } from "@stryke/type-checks";
|
|
8
8
|
import { isSetString } from "@stryke/type-checks/is-set-string";
|
|
9
|
+
import { getPrimarySchemaType } from "@powerlines/schema";
|
|
9
10
|
|
|
10
11
|
//#region src/typescript/components/tsdoc-schema.tsx
|
|
11
12
|
/**
|
|
@@ -18,18 +19,17 @@ function TSDocObjectSchema(props) {
|
|
|
18
19
|
"schema"
|
|
19
20
|
]);
|
|
20
21
|
if (!isSetObject(schema)) return null;
|
|
21
|
-
const title = computed(() => schema
|
|
22
|
-
const computedHeading = computed(() => heading || schema
|
|
23
|
-
const alias = computed(() => schema
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
const isHidden = computed(() => schema.metadata?.isHidden);
|
|
22
|
+
const title = computed(() => schema?.title || titleCase(schema?.name));
|
|
23
|
+
const computedHeading = computed(() => heading || schema?.description || title.value);
|
|
24
|
+
const alias = computed(() => schema?.alias);
|
|
25
|
+
const tags = computed(() => schema?.tags);
|
|
26
|
+
const readOnly = computed(() => schema?.readOnly);
|
|
27
|
+
const internal = computed(() => schema?.internal);
|
|
28
|
+
const runtime = computed(() => schema?.runtime);
|
|
29
|
+
const ignore = computed(() => schema?.ignore);
|
|
30
|
+
const hidden = computed(() => schema?.hidden);
|
|
31
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(
|
|
32
|
+
const hasAttributes = computed(() => isSetString(title.value) || !isUndefined(alias.value) && alias.value.length > 0 || !isUndefined(tags.value) && tags.value.length > 0 || !isUndefined(readOnly.value) || !isUndefined(internal.value) || !isUndefined(runtime.value) || !isUndefined(ignore.value) || !isUndefined(hidden.value));
|
|
33
33
|
return createComponent(TSDoc, mergeProps(rest, {
|
|
34
34
|
get heading() {
|
|
35
35
|
return memo(() => !!isSetString(computedHeading.value))() ? computedHeading.value.trim() : computedHeading.value;
|
|
@@ -42,7 +42,7 @@ function TSDocObjectSchema(props) {
|
|
|
42
42
|
get children() {
|
|
43
43
|
return createComponent(TSDocAttributesTags, {
|
|
44
44
|
get type() {
|
|
45
|
-
return schema
|
|
45
|
+
return getPrimarySchemaType(schema);
|
|
46
46
|
},
|
|
47
47
|
get title() {
|
|
48
48
|
return title.value;
|
|
@@ -50,26 +50,23 @@ function TSDocObjectSchema(props) {
|
|
|
50
50
|
get alias() {
|
|
51
51
|
return alias.value;
|
|
52
52
|
},
|
|
53
|
-
get
|
|
54
|
-
return
|
|
53
|
+
get tags() {
|
|
54
|
+
return tags.value;
|
|
55
55
|
},
|
|
56
|
-
get
|
|
57
|
-
return
|
|
56
|
+
get readOnly() {
|
|
57
|
+
return Boolean(readOnly.value);
|
|
58
58
|
},
|
|
59
|
-
get
|
|
60
|
-
return Boolean(
|
|
59
|
+
get internal() {
|
|
60
|
+
return Boolean(internal.value);
|
|
61
61
|
},
|
|
62
|
-
get
|
|
63
|
-
return Boolean(
|
|
62
|
+
get runtime() {
|
|
63
|
+
return Boolean(runtime.value);
|
|
64
64
|
},
|
|
65
|
-
get
|
|
66
|
-
return Boolean(
|
|
65
|
+
get ignore() {
|
|
66
|
+
return Boolean(ignore.value);
|
|
67
67
|
},
|
|
68
|
-
get
|
|
69
|
-
return Boolean(
|
|
70
|
-
},
|
|
71
|
-
get isHidden() {
|
|
72
|
-
return Boolean(isHidden.value);
|
|
68
|
+
get hidden() {
|
|
69
|
+
return Boolean(hidden.value);
|
|
73
70
|
}
|
|
74
71
|
});
|
|
75
72
|
}
|
|
@@ -99,9 +96,9 @@ function TSDocObjectSchema(props) {
|
|
|
99
96
|
function TSDocSchemaProperty(props) {
|
|
100
97
|
const [{ children, schema }, rest] = splitProps(props, ["children", "schema"]);
|
|
101
98
|
if (!isSetObject(schema)) return null;
|
|
102
|
-
const hasAttributes = computed(() => isSetString(schema
|
|
99
|
+
const hasAttributes = computed(() => isSetString(schema?.title) || !isUndefined(schema?.alias) && schema?.alias.length > 0 || !isUndefined(schema?.tags) && schema?.tags.length > 0 || !isUndefined(schema?.readOnly) || !isUndefined(schema?.internal) || !isUndefined(schema?.runtime) || !isUndefined(schema?.ignore) || !isUndefined(schema?.hidden) || !isUndefined(schema?.default));
|
|
103
100
|
return createComponent(TSDoc, mergeProps({ get heading() {
|
|
104
|
-
return schema
|
|
101
|
+
return schema?.description;
|
|
105
102
|
} }, rest, { get children() {
|
|
106
103
|
return [createComponent(Show, {
|
|
107
104
|
get when() {
|
|
@@ -110,37 +107,34 @@ function TSDocSchemaProperty(props) {
|
|
|
110
107
|
get children() {
|
|
111
108
|
return createComponent(TSDocAttributesTags, {
|
|
112
109
|
get type() {
|
|
113
|
-
return schema
|
|
110
|
+
return getPrimarySchemaType(schema);
|
|
114
111
|
},
|
|
115
112
|
get title() {
|
|
116
|
-
return schema
|
|
113
|
+
return schema?.title;
|
|
117
114
|
},
|
|
118
115
|
get alias() {
|
|
119
|
-
return schema
|
|
120
|
-
},
|
|
121
|
-
get resourceId() {
|
|
122
|
-
return schema.metadata?.resourceId;
|
|
116
|
+
return schema?.alias;
|
|
123
117
|
},
|
|
124
|
-
get
|
|
125
|
-
return schema
|
|
118
|
+
get tags() {
|
|
119
|
+
return schema?.tags;
|
|
126
120
|
},
|
|
127
|
-
get
|
|
128
|
-
return schema
|
|
121
|
+
get readOnly() {
|
|
122
|
+
return schema?.readOnly;
|
|
129
123
|
},
|
|
130
|
-
get
|
|
131
|
-
return schema
|
|
124
|
+
get internal() {
|
|
125
|
+
return schema?.internal;
|
|
132
126
|
},
|
|
133
|
-
get
|
|
134
|
-
return schema
|
|
127
|
+
get runtime() {
|
|
128
|
+
return schema?.runtime;
|
|
135
129
|
},
|
|
136
|
-
get
|
|
137
|
-
return schema
|
|
130
|
+
get ignore() {
|
|
131
|
+
return schema?.ignore;
|
|
138
132
|
},
|
|
139
|
-
get
|
|
140
|
-
return schema
|
|
133
|
+
get hidden() {
|
|
134
|
+
return schema?.hidden;
|
|
141
135
|
},
|
|
142
|
-
get
|
|
143
|
-
return schema
|
|
136
|
+
get ["default"]() {
|
|
137
|
+
return schema?.default;
|
|
144
138
|
}
|
|
145
139
|
});
|
|
146
140
|
}
|
|
@@ -1 +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":"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"}
|
|
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\";\nimport {\n getPrimarySchemaType,\n JsonSchema,\n JsonSchemaProperty\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<\n T extends Record<string, any> = Record<string, any>\n> extends TSDocProps {\n schema: JsonSchema<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 TSDocObjectSchema<\n T extends Record<string, any> = Record<string, any>\n>(props: TSDocObjectSchemaProps<T>) {\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(() => schema?.title || titleCase(schema?.name));\n const computedHeading = computed(\n () => heading || schema?.description || title.value\n );\n\n const alias = computed(() => schema?.alias);\n const tags = computed(() => schema?.tags);\n const readOnly = computed(() => schema?.readOnly);\n const internal = computed(() => schema?.internal);\n const runtime = computed(() => schema?.runtime);\n const ignore = computed(() => schema?.ignore);\n const hidden = computed(() => schema?.hidden);\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(tags.value) && tags.value.length > 0) ||\n !isUndefined(readOnly.value) ||\n !isUndefined(internal.value) ||\n !isUndefined(runtime.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 type={getPrimarySchemaType<T>(schema)}\n title={title.value}\n alias={alias.value}\n tags={tags.value}\n readOnly={Boolean(readOnly.value)}\n internal={Boolean(internal.value)}\n runtime={Boolean(runtime.value)}\n ignore={Boolean(ignore.value)}\n hidden={Boolean(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\nexport interface TSDocSchemaPropertyProps<\n T extends Record<string, any> = Record<string, any>\n> extends TSDocProps {\n schema: JsonSchemaProperty<T>;\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<\n T extends Record<string, any> = Record<string, any>\n>(props: TSDocSchemaPropertyProps<T>) {\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?.title) ||\n (!isUndefined(schema?.alias) && schema?.alias.length > 0) ||\n (!isUndefined(schema?.tags) && schema?.tags.length > 0) ||\n !isUndefined(schema?.readOnly) ||\n !isUndefined(schema?.internal) ||\n !isUndefined(schema?.runtime) ||\n !isUndefined(schema?.ignore) ||\n !isUndefined(schema?.hidden) ||\n !isUndefined(schema?.default)\n );\n\n return (\n <TSDoc heading={schema?.description} {...rest}>\n <Show when={hasAttributes.value}>\n <TSDocAttributesTags\n type={getPrimarySchemaType<T>(schema)}\n title={schema?.title}\n alias={schema?.alias}\n tags={schema?.tags}\n readOnly={schema?.readOnly}\n internal={schema?.internal}\n runtime={schema?.runtime}\n ignore={schema?.ignore}\n hidden={schema?.hidden}\n default={schema?.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":"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"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
3
2
|
const require_core_contexts_context = require('../../core/contexts/context.cjs');
|
|
4
3
|
const require_core_components_spacing = require('../../core/components/spacing.cjs');
|
|
5
4
|
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
@@ -261,16 +260,16 @@ function TSDocRuntime() {
|
|
|
261
260
|
* Generates a TypeScript interface property for the given reflection class.
|
|
262
261
|
*/
|
|
263
262
|
function TSDocAttributesTags(props) {
|
|
264
|
-
const [{ type, alias,
|
|
263
|
+
const [{ type, alias, tags, readOnly, internal, ignore, hidden, runtime, default: defaultValue }] = (0, _alloy_js_core.splitProps)(props, [
|
|
265
264
|
"type",
|
|
266
265
|
"alias",
|
|
267
|
-
"
|
|
268
|
-
"
|
|
269
|
-
"
|
|
270
|
-
"
|
|
271
|
-
"
|
|
272
|
-
"
|
|
273
|
-
"
|
|
266
|
+
"tags",
|
|
267
|
+
"readOnly",
|
|
268
|
+
"internal",
|
|
269
|
+
"ignore",
|
|
270
|
+
"hidden",
|
|
271
|
+
"runtime",
|
|
272
|
+
"default"
|
|
274
273
|
]);
|
|
275
274
|
const title = (0, _alloy_js_core.computed)(() => props.title?.trim() || "");
|
|
276
275
|
const domain = (0, _alloy_js_core.computed)(() => props.resourceId?.trim() || "");
|
|
@@ -310,50 +309,50 @@ function TSDocAttributesTags(props) {
|
|
|
310
309
|
}),
|
|
311
310
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
312
311
|
get when() {
|
|
313
|
-
return (0, _alloy_js_core_jsx_runtime.memo)(() => !!(!(0, _stryke_type_checks_is_undefined.isUndefined)(
|
|
312
|
+
return (0, _alloy_js_core_jsx_runtime.memo)(() => !!(!(0, _stryke_type_checks_is_undefined.isUndefined)(tags) && tags.length > 0))() && tags.some((g) => (0, _stryke_type_checks_is_set_string.isSetString)(g?.trim()));
|
|
314
313
|
},
|
|
315
314
|
get children() {
|
|
316
315
|
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
|
|
317
316
|
get each() {
|
|
318
|
-
return
|
|
317
|
+
return tags?.filter((g) => (0, _stryke_type_checks_is_set_string.isSetString)(g?.trim())) ?? [];
|
|
319
318
|
},
|
|
320
|
-
children: (
|
|
319
|
+
children: (tag) => (0, _alloy_js_core_jsx_runtime.createComponent)(TSDocGroup, { children: tag })
|
|
321
320
|
});
|
|
322
321
|
}
|
|
323
322
|
}),
|
|
324
323
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
325
|
-
when:
|
|
324
|
+
when: readOnly === true,
|
|
326
325
|
get children() {
|
|
327
326
|
return (0, _alloy_js_core_jsx_runtime.createComponent)(TSDocReadonly, {});
|
|
328
327
|
}
|
|
329
328
|
}),
|
|
330
329
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
331
|
-
when:
|
|
330
|
+
when: internal === true,
|
|
332
331
|
get children() {
|
|
333
332
|
return (0, _alloy_js_core_jsx_runtime.createComponent)(TSDocInternal, {});
|
|
334
333
|
}
|
|
335
334
|
}),
|
|
336
335
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
337
|
-
when:
|
|
336
|
+
when: ignore === true,
|
|
338
337
|
get children() {
|
|
339
338
|
return (0, _alloy_js_core_jsx_runtime.createComponent)(TSDocIgnore, {});
|
|
340
339
|
}
|
|
341
340
|
}),
|
|
342
341
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
343
|
-
when:
|
|
342
|
+
when: hidden === true,
|
|
344
343
|
get children() {
|
|
345
344
|
return (0, _alloy_js_core_jsx_runtime.createComponent)(TSDocHidden, {});
|
|
346
345
|
}
|
|
347
346
|
}),
|
|
348
347
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
349
|
-
when:
|
|
348
|
+
when: runtime === true,
|
|
350
349
|
get children() {
|
|
351
350
|
return (0, _alloy_js_core_jsx_runtime.createComponent)(TSDocRuntime, {});
|
|
352
351
|
}
|
|
353
352
|
}),
|
|
354
353
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
355
354
|
get when() {
|
|
356
|
-
return (0, _alloy_js_core_jsx_runtime.memo)(() => !!(
|
|
355
|
+
return (0, _alloy_js_core_jsx_runtime.memo)(() => !!(runtime !== true && !(0, _stryke_type_checks_is_undefined.isUndefined)(type)))() && !(0, _stryke_type_checks_is_undefined.isUndefined)(defaultValue);
|
|
357
356
|
},
|
|
358
357
|
get children() {
|
|
359
358
|
return (0, _alloy_js_core_jsx_runtime.createComponent)(TSDocDefaultValue, {
|
|
@@ -377,8 +376,8 @@ function TSDocParam(props) {
|
|
|
377
376
|
get optional() {
|
|
378
377
|
return props.optional;
|
|
379
378
|
},
|
|
380
|
-
get
|
|
381
|
-
return props.
|
|
379
|
+
get ["default"]() {
|
|
380
|
+
return props.default;
|
|
382
381
|
}
|
|
383
382
|
}),
|
|
384
383
|
(0, _alloy_js_core_jsx_runtime.createComponent)(TSDocParamDescription, { get children() {
|
|
@@ -397,10 +396,10 @@ function TSDocParamName(props) {
|
|
|
397
396
|
(0, _alloy_js_core_jsx_runtime.memo)(() => props.name),
|
|
398
397
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
399
398
|
get when() {
|
|
400
|
-
return Boolean(props.
|
|
399
|
+
return Boolean(props.default);
|
|
401
400
|
},
|
|
402
401
|
get children() {
|
|
403
|
-
return ["=", (0, _alloy_js_core_jsx_runtime.memo)(() => props.
|
|
402
|
+
return ["=", (0, _alloy_js_core_jsx_runtime.memo)(() => props.default)];
|
|
404
403
|
}
|
|
405
404
|
}),
|
|
406
405
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
@@ -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 { JsonSchemaPrimitiveType } from "@powerlines/schema/types";
|
|
5
5
|
|
|
6
6
|
//#region src/typescript/components/tsdoc.d.ts
|
|
7
7
|
interface TSDocProps extends ComponentProps {
|
|
@@ -46,7 +46,7 @@ declare function TSDocPermission(props: ComponentProps): Children;
|
|
|
46
46
|
*/
|
|
47
47
|
declare function TSDocGroup(props: ComponentProps): Children;
|
|
48
48
|
interface TSDocDefaultValueProps extends ComponentProps {
|
|
49
|
-
type?:
|
|
49
|
+
type?: JsonSchemaPrimitiveType;
|
|
50
50
|
defaultValue: any;
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
@@ -94,17 +94,17 @@ declare function TSDocHidden(): Children;
|
|
|
94
94
|
*/
|
|
95
95
|
declare function TSDocRuntime(): Children;
|
|
96
96
|
interface TSDocAttributesTagsProps {
|
|
97
|
-
type?:
|
|
98
|
-
|
|
97
|
+
type?: JsonSchemaPrimitiveType;
|
|
98
|
+
default?: any;
|
|
99
99
|
title?: string;
|
|
100
100
|
alias?: string[];
|
|
101
|
-
|
|
101
|
+
tags?: string[];
|
|
102
102
|
resourceId?: string;
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
103
|
+
readOnly?: boolean;
|
|
104
|
+
internal?: boolean;
|
|
105
|
+
ignore?: boolean;
|
|
106
|
+
hidden?: boolean;
|
|
107
|
+
runtime?: boolean;
|
|
108
108
|
}
|
|
109
109
|
/**
|
|
110
110
|
* Generates a TypeScript interface property for the given reflection class.
|
|
@@ -114,7 +114,7 @@ interface TSDocParamProps {
|
|
|
114
114
|
name: Children;
|
|
115
115
|
children?: Children;
|
|
116
116
|
optional?: boolean;
|
|
117
|
-
|
|
117
|
+
default?: Children;
|
|
118
118
|
}
|
|
119
119
|
/**
|
|
120
120
|
* Create a TSDoc parameter set off with `@param`.
|