@powerlines/plugin-alloy 0.25.30 → 0.25.32

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.
Files changed (74) hide show
  1. package/dist/_virtual/_rolldown/runtime.mjs +3 -0
  2. package/dist/core/components/output.cjs +12 -7
  3. package/dist/core/components/output.mjs +12 -7
  4. package/dist/core/components/output.mjs.map +1 -1
  5. package/dist/core/components/single-line-comment.cjs +5 -8
  6. package/dist/core/components/single-line-comment.mjs +5 -8
  7. package/dist/core/components/single-line-comment.mjs.map +1 -1
  8. package/dist/core/components/source-file.cjs +8 -7
  9. package/dist/core/components/source-file.mjs +8 -7
  10. package/dist/core/components/source-file.mjs.map +1 -1
  11. package/dist/core/components/spacing.cjs +5 -6
  12. package/dist/core/components/spacing.mjs +5 -6
  13. package/dist/core/components/spacing.mjs.map +1 -1
  14. package/dist/markdown/components/front-matter.cjs +12 -9
  15. package/dist/markdown/components/front-matter.mjs +12 -9
  16. package/dist/markdown/components/front-matter.mjs.map +1 -1
  17. package/dist/markdown/components/markdown-file.cjs +57 -41
  18. package/dist/markdown/components/markdown-file.mjs +57 -41
  19. package/dist/markdown/components/markdown-file.mjs.map +1 -1
  20. package/dist/markdown/components/markdown-table.cjs +31 -20
  21. package/dist/markdown/components/markdown-table.mjs +31 -20
  22. package/dist/markdown/components/markdown-table.mjs.map +1 -1
  23. package/dist/render.cjs +10 -4
  24. package/dist/render.mjs +10 -4
  25. package/dist/render.mjs.map +1 -1
  26. package/dist/typescript/components/builtin-file.cjs +21 -9
  27. package/dist/typescript/components/builtin-file.mjs +21 -9
  28. package/dist/typescript/components/builtin-file.mjs.map +1 -1
  29. package/dist/typescript/components/class-declaration.cjs +112 -79
  30. package/dist/typescript/components/class-declaration.mjs +112 -79
  31. package/dist/typescript/components/class-declaration.mjs.map +1 -1
  32. package/dist/typescript/components/dynamic-import-statement.cjs +6 -1
  33. package/dist/typescript/components/dynamic-import-statement.mjs +6 -1
  34. package/dist/typescript/components/dynamic-import-statement.mjs.map +1 -1
  35. package/dist/typescript/components/entry-file.cjs +7 -3
  36. package/dist/typescript/components/entry-file.mjs +7 -3
  37. package/dist/typescript/components/entry-file.mjs.map +1 -1
  38. package/dist/typescript/components/infrastructure-file.cjs +7 -3
  39. package/dist/typescript/components/infrastructure-file.mjs +7 -3
  40. package/dist/typescript/components/infrastructure-file.mjs.map +1 -1
  41. package/dist/typescript/components/interface-declaration.cjs +83 -47
  42. package/dist/typescript/components/interface-declaration.mjs +83 -47
  43. package/dist/typescript/components/interface-declaration.mjs.map +1 -1
  44. package/dist/typescript/components/object-declaration.cjs +48 -36
  45. package/dist/typescript/components/object-declaration.mjs +48 -36
  46. package/dist/typescript/components/object-declaration.mjs.map +1 -1
  47. package/dist/typescript/components/property-name.cjs +2 -2
  48. package/dist/typescript/components/property-name.mjs +3 -3
  49. package/dist/typescript/components/property-name.mjs.map +1 -1
  50. package/dist/typescript/components/tsdoc-reflection.cjs +112 -54
  51. package/dist/typescript/components/tsdoc-reflection.mjs +112 -54
  52. package/dist/typescript/components/tsdoc-reflection.mjs.map +1 -1
  53. package/dist/typescript/components/tsdoc.cjs +211 -140
  54. package/dist/typescript/components/tsdoc.mjs +211 -140
  55. package/dist/typescript/components/tsdoc.mjs.map +1 -1
  56. package/dist/typescript/components/type-declaration.cjs +17 -9
  57. package/dist/typescript/components/type-declaration.mjs +17 -9
  58. package/dist/typescript/components/type-declaration.mjs.map +1 -1
  59. package/dist/typescript/components/type-parameters.cjs +33 -33
  60. package/dist/typescript/components/type-parameters.mjs +33 -33
  61. package/dist/typescript/components/type-parameters.mjs.map +1 -1
  62. package/dist/typescript/components/typescript-file.cjs +90 -65
  63. package/dist/typescript/components/typescript-file.mjs +90 -65
  64. package/dist/typescript/components/typescript-file.mjs.map +1 -1
  65. package/dist/typescript/contexts/lexical-scope.cjs +5 -1
  66. package/dist/typescript/contexts/lexical-scope.mjs +5 -1
  67. package/dist/typescript/contexts/lexical-scope.mjs.map +1 -1
  68. package/dist/typescript/contexts/member-scope.cjs +5 -2
  69. package/dist/typescript/contexts/member-scope.mjs +5 -2
  70. package/dist/typescript/contexts/member-scope.mjs.map +1 -1
  71. package/dist/yaml/components/yaml-file.cjs +58 -48
  72. package/dist/yaml/components/yaml-file.mjs +58 -48
  73. package/dist/yaml/components/yaml-file.mjs.map +1 -1
  74. package/package.json +6 -6
@@ -3,6 +3,7 @@ const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
3
3
  const require_core_contexts_reflection = require('../../core/contexts/reflection.cjs');
4
4
  const require_typescript_components_tsdoc_reflection = require('./tsdoc-reflection.cjs');
5
5
  let _alloy_js_core = require("@alloy-js/core");
6
+ let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
6
7
  let _powerlines_deepkit_utilities = require("@powerlines/deepkit/utilities");
7
8
  let _stryke_string_format_camel_case = require("@stryke/string-format/camel-case");
8
9
  let _stryke_type_checks_is_undefined = require("@stryke/type-checks/is-undefined");
@@ -35,48 +36,59 @@ function ObjectDeclaration(props) {
35
36
  });
36
37
  if (!props.type) ValueTypeSymbolSlot.moveMembersTo(sym);
37
38
  const keyword = props.var ? "var" : props.let ? "let" : "const";
38
- const type = props.type ? <_alloy_js_typescript.TypeRefContext>
39
- : <TypeSymbolSlot>{props.type}</TypeSymbolSlot>
40
- </_alloy_js_typescript.TypeRefContext> : void 0;
41
- return <_alloy_js_core.Show when={!!props.reflection.value}>
42
- <require_core_contexts_reflection.ReflectionClassContext.Provider value={{
43
- reflection: props.reflection.value,
44
- override: {
45
- name: objectName.value,
46
- type: objectType.value,
47
- defaultValue: props.defaultValue?.value
48
- }
49
- }}>
50
- <_alloy_js_core.Show when={!!objectName.value && !!objectType.value}>
51
- <require_typescript_components_tsdoc_reflection.TSDocReflectionClass reflection={props.reflection.value} />
52
- <_alloy_js_core.Declaration symbol={sym}>
53
- {props.export ? "export " : ""}
54
- {props.default ? "default " : ""}
55
- {keyword} <_alloy_js_core.Name />
56
- {type} ={" "}
57
- <ValueTypeSymbolSlot>
58
- {props.initializer ?? props.children ?? <_alloy_js_typescript.ObjectExpression>
59
- <_alloy_js_core.For each={properties.value ?? []} comma={true} doubleHardline={true}>
60
- {(prop) => <ObjectDeclarationProperty property={prop} />}
61
- </_alloy_js_core.For>
62
- </_alloy_js_typescript.ObjectExpression>}
63
- </ValueTypeSymbolSlot>
64
- </_alloy_js_core.Declaration>
65
- </_alloy_js_core.Show>
66
- <hbr />
67
- </require_core_contexts_reflection.ReflectionClassContext.Provider>
68
- </_alloy_js_core.Show>;
39
+ const type = props.type ? /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_typescript.TypeRefContext, { children: [": ", /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(TypeSymbolSlot, { children: props.type })] }) : void 0;
40
+ return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
41
+ when: !!props.reflection.value,
42
+ children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(require_core_contexts_reflection.ReflectionClassContext.Provider, {
43
+ value: {
44
+ reflection: props.reflection.value,
45
+ override: {
46
+ name: objectName.value,
47
+ type: objectType.value,
48
+ defaultValue: props.defaultValue?.value
49
+ }
50
+ },
51
+ children: [/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core.Show, {
52
+ when: !!objectName.value && !!objectType.value,
53
+ children: [/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_typescript_components_tsdoc_reflection.TSDocReflectionClass, { reflection: props.reflection.value }), /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core.Declaration, {
54
+ symbol: sym,
55
+ children: [
56
+ props.export ? "export " : "",
57
+ props.default ? "default " : "",
58
+ keyword,
59
+ " ",
60
+ /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Name, {}),
61
+ type,
62
+ " =",
63
+ " ",
64
+ /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(ValueTypeSymbolSlot, { children: props.initializer ?? props.children ?? /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.ObjectExpression, { children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.For, {
65
+ each: properties.value ?? [],
66
+ comma: true,
67
+ doubleHardline: true,
68
+ children: (prop) => /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(ObjectDeclarationProperty, { property: prop })
69
+ }) }) })
70
+ ]
71
+ })]
72
+ }), /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {})]
73
+ })
74
+ });
69
75
  }
70
76
  /**
71
77
  * Generates a TypeScript object property for the given reflection class.
72
78
  */
73
79
  function ObjectDeclarationProperty(props) {
74
80
  const [{ property }] = (0, _alloy_js_core.splitProps)(props, ["property"]);
75
- return <require_core_contexts_reflection.ReflectionPropertyContext.Provider value={property}>
76
- <require_typescript_components_tsdoc_reflection.TSDocReflectionProperty reflection={property} />
77
- <_alloy_js_typescript.ObjectProperty name={property.getNameAsString()} value={(0, _powerlines_deepkit_utilities.stringifyDefaultValue)(property)} />
78
- <hbr />
79
- </require_core_contexts_reflection.ReflectionPropertyContext.Provider>;
81
+ return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(require_core_contexts_reflection.ReflectionPropertyContext.Provider, {
82
+ value: property,
83
+ children: [
84
+ /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_typescript_components_tsdoc_reflection.TSDocReflectionProperty, { reflection: property }),
85
+ /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.ObjectProperty, {
86
+ name: property.getNameAsString(),
87
+ value: (0, _powerlines_deepkit_utilities.stringifyDefaultValue)(property)
88
+ }),
89
+ /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {})
90
+ ]
91
+ });
80
92
  }
81
93
 
82
94
  //#endregion
@@ -1,6 +1,7 @@
1
1
  import { ReflectionClassContext, ReflectionPropertyContext } from "../../core/contexts/reflection.mjs";
2
2
  import { TSDocReflectionClass, TSDocReflectionProperty } from "./tsdoc-reflection.mjs";
3
3
  import { Declaration, For, Name, Show, computed, createSymbolSlot, splitProps } from "@alloy-js/core";
4
+ import { jsx, jsxs } from "@alloy-js/core/jsx-runtime";
4
5
  import { stringifyDefaultValue } from "@powerlines/deepkit/utilities";
5
6
  import { camelCase } from "@stryke/string-format/camel-case";
6
7
  import { isUndefined } from "@stryke/type-checks/is-undefined";
@@ -33,48 +34,59 @@ function ObjectDeclaration(props) {
33
34
  });
34
35
  if (!props.type) ValueTypeSymbolSlot.moveMembersTo(sym);
35
36
  const keyword = props.var ? "var" : props.let ? "let" : "const";
36
- const type = props.type ? <TypeRefContext>
37
- : <TypeSymbolSlot>{props.type}</TypeSymbolSlot>
38
- </TypeRefContext> : void 0;
39
- return <Show when={!!props.reflection.value}>
40
- <ReflectionClassContext.Provider value={{
41
- reflection: props.reflection.value,
42
- override: {
43
- name: objectName.value,
44
- type: objectType.value,
45
- defaultValue: props.defaultValue?.value
46
- }
47
- }}>
48
- <Show when={!!objectName.value && !!objectType.value}>
49
- <TSDocReflectionClass reflection={props.reflection.value} />
50
- <Declaration symbol={sym}>
51
- {props.export ? "export " : ""}
52
- {props.default ? "default " : ""}
53
- {keyword} <Name />
54
- {type} ={" "}
55
- <ValueTypeSymbolSlot>
56
- {props.initializer ?? props.children ?? <ObjectExpression>
57
- <For each={properties.value ?? []} comma={true} doubleHardline={true}>
58
- {(prop) => <ObjectDeclarationProperty property={prop} />}
59
- </For>
60
- </ObjectExpression>}
61
- </ValueTypeSymbolSlot>
62
- </Declaration>
63
- </Show>
64
- <hbr />
65
- </ReflectionClassContext.Provider>
66
- </Show>;
37
+ const type = props.type ? /* @__PURE__ */ jsxs(TypeRefContext, { children: [": ", /* @__PURE__ */ jsx(TypeSymbolSlot, { children: props.type })] }) : void 0;
38
+ return /* @__PURE__ */ jsx(Show, {
39
+ when: !!props.reflection.value,
40
+ children: /* @__PURE__ */ jsxs(ReflectionClassContext.Provider, {
41
+ value: {
42
+ reflection: props.reflection.value,
43
+ override: {
44
+ name: objectName.value,
45
+ type: objectType.value,
46
+ defaultValue: props.defaultValue?.value
47
+ }
48
+ },
49
+ children: [/* @__PURE__ */ jsxs(Show, {
50
+ when: !!objectName.value && !!objectType.value,
51
+ children: [/* @__PURE__ */ jsx(TSDocReflectionClass, { reflection: props.reflection.value }), /* @__PURE__ */ jsxs(Declaration, {
52
+ symbol: sym,
53
+ children: [
54
+ props.export ? "export " : "",
55
+ props.default ? "default " : "",
56
+ keyword,
57
+ " ",
58
+ /* @__PURE__ */ jsx(Name, {}),
59
+ type,
60
+ " =",
61
+ " ",
62
+ /* @__PURE__ */ jsx(ValueTypeSymbolSlot, { children: props.initializer ?? props.children ?? /* @__PURE__ */ jsx(ObjectExpression, { children: /* @__PURE__ */ jsx(For, {
63
+ each: properties.value ?? [],
64
+ comma: true,
65
+ doubleHardline: true,
66
+ children: (prop) => /* @__PURE__ */ jsx(ObjectDeclarationProperty, { property: prop })
67
+ }) }) })
68
+ ]
69
+ })]
70
+ }), /* @__PURE__ */ jsx("hbr", {})]
71
+ })
72
+ });
67
73
  }
68
74
  /**
69
75
  * Generates a TypeScript object property for the given reflection class.
70
76
  */
71
77
  function ObjectDeclarationProperty(props) {
72
78
  const [{ property }] = splitProps(props, ["property"]);
73
- return <ReflectionPropertyContext.Provider value={property}>
74
- <TSDocReflectionProperty reflection={property} />
75
- <ObjectProperty name={property.getNameAsString()} value={stringifyDefaultValue(property)} />
76
- <hbr />
77
- </ReflectionPropertyContext.Provider>;
79
+ return /* @__PURE__ */ jsxs(ReflectionPropertyContext.Provider, {
80
+ value: property,
81
+ children: [
82
+ /* @__PURE__ */ jsx(TSDocReflectionProperty, { reflection: property }),
83
+ /* @__PURE__ */ jsx(ObjectProperty, {
84
+ name: property.getNameAsString(),
85
+ value: stringifyDefaultValue(property)
86
+ }),
87
+ /* @__PURE__ */ jsx("hbr", {})
88
+ ]
89
+ });
78
90
  }
79
91
 
80
92
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"object-declaration.mjs","names":["CoreDeclaration"],"sources":["../../../src/typescript/components/object-declaration.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 computed,\n Declaration as CoreDeclaration,\n createSymbolSlot,\n For,\n Name,\n Show,\n splitProps\n} from \"@alloy-js/core\";\nimport {\n createValueSymbol,\n ObjectExpression,\n ObjectProperty,\n TSSymbolFlags,\n TypeRefContext,\n useTSNamePolicy,\n VarDeclarationProps\n} from \"@alloy-js/typescript\";\nimport { stringifyDefaultValue } from \"@powerlines/deepkit/utilities\";\nimport type {\n ReflectionClass,\n ReflectionProperty\n} from \"@powerlines/deepkit/vendor/type\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { pascalCase } from \"@stryke/string-format/pascal-case\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\nimport {\n ReflectionClassContext,\n ReflectionPropertyContext\n} from \"../../core/contexts/reflection\";\nimport { ComponentProps } from \"../../types/components\";\nimport {\n TSDocReflectionClass,\n TSDocReflectionProperty\n} from \"./tsdoc-reflection\";\n\nexport interface ComputedRef<T = any> {\n readonly value: T;\n}\n\nexport interface ObjectDeclarationProps<\n T extends Record<string, any> = Record<string, any>\n> extends VarDeclarationProps {\n reflection?: ComputedRef<ReflectionClass<T>>;\n defaultValue?: ComputedRef<Partial<T> | undefined>;\n}\n\nexport interface ObjectDeclarationPropertyProps extends ComponentProps {\n property: ReflectionProperty;\n}\n\n/**\n * Generates a TypeScript object for the given reflection class.\n */\nexport function ObjectDeclaration<\n T extends Record<string, any> = Record<string, any>\n>(props: ObjectDeclarationProps<T>) {\n if (!props.reflection?.value) {\n return null;\n }\n\n const objectName = computed(() =>\n camelCase(\n (isString(props.name) ? props.name : props.name.toString()) ||\n props.reflection!.value.getName()\n )\n );\n const objectType = computed(\n () => props.type || pascalCase(props.reflection!.value.getName())\n );\n const properties = computed(() =>\n props\n .reflection!.value.getProperties()\n .filter(\n item =>\n !item.isIgnored() &&\n !isUndefined(\n props.defaultValue?.value?.[item.getNameAsString()] ??\n item.getAlias().reduce((ret, alias) => {\n if (\n isUndefined(ret) &&\n !isUndefined(\n (props.defaultValue as Record<string, any>)?.value?.[alias]\n )\n ) {\n return (props.defaultValue as Record<string, any>)?.value?.[\n alias\n ];\n }\n\n return ret;\n }, undefined) ??\n item.getDefaultValue()\n )\n )\n .sort((a, b) =>\n (a.isReadonly() && b.isReadonly()) ||\n (!a.isReadonly() && !b.isReadonly())\n ? a.getNameAsString().localeCompare(b.getNameAsString())\n : a.isReadonly()\n ? 1\n : -1\n )\n );\n\n const TypeSymbolSlot = createSymbolSlot();\n const ValueTypeSymbolSlot = createSymbolSlot();\n const sym = createValueSymbol(props.name, {\n refkeys: props.refkey,\n default: props.default,\n export: props.export,\n metadata: props.metadata,\n tsFlags: props.nullish ? TSSymbolFlags.Nullish : TSSymbolFlags.None,\n type: props.type ? TypeSymbolSlot.firstSymbol : undefined,\n namePolicy: useTSNamePolicy().for(\"variable\")\n });\n\n if (!props.type) {\n ValueTypeSymbolSlot.moveMembersTo(sym);\n }\n\n const keyword = props.var ? \"var\" : props.let ? \"let\" : \"const\";\n const type = props.type ? (\n <TypeRefContext>\n : <TypeSymbolSlot>{props.type}</TypeSymbolSlot>\n </TypeRefContext>\n ) : undefined;\n\n return (\n <Show when={!!props.reflection.value}>\n <ReflectionClassContext.Provider\n value={{\n reflection: props.reflection.value as ReflectionClass<any>,\n override: {\n name: objectName.value,\n type: objectType.value,\n defaultValue: props.defaultValue?.value\n }\n }}>\n <Show when={!!objectName.value && !!objectType.value}>\n <TSDocReflectionClass reflection={props.reflection.value} />\n <CoreDeclaration symbol={sym}>\n {props.export ? \"export \" : \"\"}\n {props.default ? \"default \" : \"\"}\n {keyword} <Name />\n {type} ={\" \"}\n <ValueTypeSymbolSlot>\n {props.initializer ?? props.children ?? (\n <ObjectExpression>\n <For\n each={properties.value ?? []}\n comma={true}\n doubleHardline={true}>\n {prop => <ObjectDeclarationProperty property={prop} />}\n </For>\n </ObjectExpression>\n )}\n </ValueTypeSymbolSlot>\n </CoreDeclaration>\n </Show>\n <hbr />\n </ReflectionClassContext.Provider>\n </Show>\n );\n}\n\n/**\n * Generates a TypeScript object property for the given reflection class.\n */\nexport function ObjectDeclarationProperty(\n props: ObjectDeclarationPropertyProps\n) {\n const [{ property }] = splitProps(props, [\"property\"]);\n\n return (\n <ReflectionPropertyContext.Provider value={property}>\n <TSDocReflectionProperty reflection={property} />\n <ObjectProperty\n name={property.getNameAsString()}\n value={stringifyDefaultValue(property)}\n />\n <hbr />\n </ReflectionPropertyContext.Provider>\n );\n}\n"],"mappings":"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"}
1
+ {"version":3,"file":"object-declaration.mjs","names":["CoreDeclaration"],"sources":["../../../src/typescript/components/object-declaration.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 computed,\n Declaration as CoreDeclaration,\n createSymbolSlot,\n For,\n Name,\n Show,\n splitProps\n} from \"@alloy-js/core\";\nimport {\n createValueSymbol,\n ObjectExpression,\n ObjectProperty,\n TSSymbolFlags,\n TypeRefContext,\n useTSNamePolicy,\n VarDeclarationProps\n} from \"@alloy-js/typescript\";\nimport { stringifyDefaultValue } from \"@powerlines/deepkit/utilities\";\nimport type {\n ReflectionClass,\n ReflectionProperty\n} from \"@powerlines/deepkit/vendor/type\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { pascalCase } from \"@stryke/string-format/pascal-case\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\nimport {\n ReflectionClassContext,\n ReflectionPropertyContext\n} from \"../../core/contexts/reflection\";\nimport { ComponentProps } from \"../../types/components\";\nimport {\n TSDocReflectionClass,\n TSDocReflectionProperty\n} from \"./tsdoc-reflection\";\n\nexport interface ComputedRef<T = any> {\n readonly value: T;\n}\n\nexport interface ObjectDeclarationProps<\n T extends Record<string, any> = Record<string, any>\n> extends VarDeclarationProps {\n reflection?: ComputedRef<ReflectionClass<T>>;\n defaultValue?: ComputedRef<Partial<T> | undefined>;\n}\n\nexport interface ObjectDeclarationPropertyProps extends ComponentProps {\n property: ReflectionProperty;\n}\n\n/**\n * Generates a TypeScript object for the given reflection class.\n */\nexport function ObjectDeclaration<\n T extends Record<string, any> = Record<string, any>\n>(props: ObjectDeclarationProps<T>) {\n if (!props.reflection?.value) {\n return null;\n }\n\n const objectName = computed(() =>\n camelCase(\n (isString(props.name) ? props.name : props.name.toString()) ||\n props.reflection!.value.getName()\n )\n );\n const objectType = computed(\n () => props.type || pascalCase(props.reflection!.value.getName())\n );\n const properties = computed(() =>\n props\n .reflection!.value.getProperties()\n .filter(\n item =>\n !item.isIgnored() &&\n !isUndefined(\n props.defaultValue?.value?.[item.getNameAsString()] ??\n item.getAlias().reduce((ret, alias) => {\n if (\n isUndefined(ret) &&\n !isUndefined(\n (props.defaultValue as Record<string, any>)?.value?.[alias]\n )\n ) {\n return (props.defaultValue as Record<string, any>)?.value?.[\n alias\n ];\n }\n\n return ret;\n }, undefined) ??\n item.getDefaultValue()\n )\n )\n .sort((a, b) =>\n (a.isReadonly() && b.isReadonly()) ||\n (!a.isReadonly() && !b.isReadonly())\n ? a.getNameAsString().localeCompare(b.getNameAsString())\n : a.isReadonly()\n ? 1\n : -1\n )\n );\n\n const TypeSymbolSlot = createSymbolSlot();\n const ValueTypeSymbolSlot = createSymbolSlot();\n const sym = createValueSymbol(props.name, {\n refkeys: props.refkey,\n default: props.default,\n export: props.export,\n metadata: props.metadata,\n tsFlags: props.nullish ? TSSymbolFlags.Nullish : TSSymbolFlags.None,\n type: props.type ? TypeSymbolSlot.firstSymbol : undefined,\n namePolicy: useTSNamePolicy().for(\"variable\")\n });\n\n if (!props.type) {\n ValueTypeSymbolSlot.moveMembersTo(sym);\n }\n\n const keyword = props.var ? \"var\" : props.let ? \"let\" : \"const\";\n const type = props.type ? (\n <TypeRefContext>\n : <TypeSymbolSlot>{props.type}</TypeSymbolSlot>\n </TypeRefContext>\n ) : undefined;\n\n return (\n <Show when={!!props.reflection.value}>\n <ReflectionClassContext.Provider\n value={{\n reflection: props.reflection.value as ReflectionClass<any>,\n override: {\n name: objectName.value,\n type: objectType.value,\n defaultValue: props.defaultValue?.value\n }\n }}>\n <Show when={!!objectName.value && !!objectType.value}>\n <TSDocReflectionClass reflection={props.reflection.value} />\n <CoreDeclaration symbol={sym}>\n {props.export ? \"export \" : \"\"}\n {props.default ? \"default \" : \"\"}\n {keyword} <Name />\n {type} ={\" \"}\n <ValueTypeSymbolSlot>\n {props.initializer ?? props.children ?? (\n <ObjectExpression>\n <For\n each={properties.value ?? []}\n comma={true}\n doubleHardline={true}>\n {prop => <ObjectDeclarationProperty property={prop} />}\n </For>\n </ObjectExpression>\n )}\n </ValueTypeSymbolSlot>\n </CoreDeclaration>\n </Show>\n <hbr />\n </ReflectionClassContext.Provider>\n </Show>\n );\n}\n\n/**\n * Generates a TypeScript object property for the given reflection class.\n */\nexport function ObjectDeclarationProperty(\n props: ObjectDeclarationPropertyProps\n) {\n const [{ property }] = splitProps(props, [\"property\"]);\n\n return (\n <ReflectionPropertyContext.Provider value={property}>\n <TSDocReflectionProperty reflection={property} />\n <ObjectProperty\n name={property.getNameAsString()}\n value={stringifyDefaultValue(property)}\n />\n <hbr />\n </ReflectionPropertyContext.Provider>\n );\n}\n"],"mappings":"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"}
@@ -19,8 +19,8 @@ function PropertyName(props) {
19
19
  else {
20
20
  const declSymbol = (0, _alloy_js_core.useContext)(_alloy_js_core.MemberDeclarationContext);
21
21
  if (!declSymbol) return "(no member declaration context)";
22
- if (declSymbol.isPrivateMemberSymbol) return <>#{declSymbol.name}</>;
23
- else return <>{quoteIfNeeded(declSymbol.name)}</>;
22
+ if (declSymbol.isPrivateMemberSymbol) return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core_jsx_runtime.Fragment, { children: ["#", declSymbol.name] });
23
+ else return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core_jsx_runtime.Fragment, { children: quoteIfNeeded(declSymbol.name) });
24
24
  }
25
25
  }
26
26
  function quoteIfNeeded(name) {
@@ -1,6 +1,6 @@
1
1
  import { isValidJSIdentifier } from "../helpers/utilities.mjs";
2
2
  import { MemberDeclarationContext, useContext } from "@alloy-js/core";
3
- import { memo } from "@alloy-js/core/jsx-runtime";
3
+ import { Fragment, jsx, jsxs, memo } from "@alloy-js/core/jsx-runtime";
4
4
 
5
5
  //#region src/typescript/components/property-name.tsx
6
6
  /**
@@ -17,8 +17,8 @@ function PropertyName(props) {
17
17
  else {
18
18
  const declSymbol = useContext(MemberDeclarationContext);
19
19
  if (!declSymbol) return "(no member declaration context)";
20
- if (declSymbol.isPrivateMemberSymbol) return <>#{declSymbol.name}</>;
21
- else return <>{quoteIfNeeded(declSymbol.name)}</>;
20
+ if (declSymbol.isPrivateMemberSymbol) return /* @__PURE__ */ jsxs(Fragment, { children: ["#", declSymbol.name] });
21
+ else return /* @__PURE__ */ jsx(Fragment, { children: quoteIfNeeded(declSymbol.name) });
22
22
  }
23
23
  }
24
24
  function quoteIfNeeded(name) {
@@ -1 +1 @@
1
- {"version":3,"file":"property-name.mjs","names":[],"sources":["../../../src/typescript/components/property-name.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 { MemberDeclarationContext, useContext } from \"@alloy-js/core\";\nimport { memo } from \"@alloy-js/core/jsx-runtime\";\nimport { TSOutputSymbol } from \"@alloy-js/typescript\";\nimport { isValidJSIdentifier } from \"../helpers/utilities\";\n\nexport interface PropertyNameProps {\n /**\n * The name of the property.\n */\n name?: string;\n\n /**\n * Whether the property is a private property. If `true`, the property will be prefixed with `#`.\n */\n private?: boolean;\n}\n\n/**\n * A TypeScript property name for an interface, class, or object member.\n *\n * @remarks\n * If the name is not a valid JavaScript identifier, it will be quoted. If a `name` prop is provided, it will be used as the property name. Otherwise, the name will be taken from the {@link (MemberDeclarationContext:variable)}.\n */\nexport function PropertyName(props: PropertyNameProps) {\n if (props.name) {\n return memo(() => {\n if (props.private) {\n return `#${props.name}`;\n }\n return quoteIfNeeded(props.name!);\n });\n } else {\n const declSymbol = useContext(MemberDeclarationContext) as TSOutputSymbol;\n if (!declSymbol) {\n return \"(no member declaration context)\";\n }\n\n if (declSymbol.isPrivateMemberSymbol) {\n return <>#{declSymbol.name}</>;\n } else {\n return <>{quoteIfNeeded(declSymbol.name)}</>;\n }\n }\n}\n\nfunction quoteIfNeeded(name: string) {\n if (isValidJSIdentifier(name)) {\n return name;\n } else {\n return `\"${name.replace(/\"/g, '\\\\\"')}\"`;\n }\n}\n"],"mappings":";;;;;;;;;;;AAyCA,SAAgB,aAAa,OAA0B;AACrD,KAAI,MAAM,KACR,QAAO,WAAW;AAChB,MAAI,MAAM,QACR,QAAO,IAAI,MAAM;AAEnB,SAAO,cAAc,MAAM,KAAM;GACjC;MACG;EACL,MAAM,aAAa,WAAW,yBAAyB;AACvD,MAAI,CAAC,WACH,QAAO;AAGT,MAAI,WAAW,sBACb,QAAO,EAAE,EAAE,WAAW,KAAK;MAE3B,QAAO,GAAG,cAAc,WAAW,KAAK,CAAC;;;AAK/C,SAAS,cAAc,MAAc;AACnC,KAAI,oBAAoB,KAAK,CAC3B,QAAO;KAEP,QAAO,IAAI,KAAK,QAAQ,MAAM,OAAM,CAAC"}
1
+ {"version":3,"file":"property-name.mjs","names":[],"sources":["../../../src/typescript/components/property-name.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 { MemberDeclarationContext, useContext } from \"@alloy-js/core\";\nimport { memo } from \"@alloy-js/core/jsx-runtime\";\nimport { TSOutputSymbol } from \"@alloy-js/typescript\";\nimport { isValidJSIdentifier } from \"../helpers/utilities\";\n\nexport interface PropertyNameProps {\n /**\n * The name of the property.\n */\n name?: string;\n\n /**\n * Whether the property is a private property. If `true`, the property will be prefixed with `#`.\n */\n private?: boolean;\n}\n\n/**\n * A TypeScript property name for an interface, class, or object member.\n *\n * @remarks\n * If the name is not a valid JavaScript identifier, it will be quoted. If a `name` prop is provided, it will be used as the property name. Otherwise, the name will be taken from the {@link (MemberDeclarationContext:variable)}.\n */\nexport function PropertyName(props: PropertyNameProps) {\n if (props.name) {\n return memo(() => {\n if (props.private) {\n return `#${props.name}`;\n }\n return quoteIfNeeded(props.name!);\n });\n } else {\n const declSymbol = useContext(MemberDeclarationContext) as TSOutputSymbol;\n if (!declSymbol) {\n return \"(no member declaration context)\";\n }\n\n if (declSymbol.isPrivateMemberSymbol) {\n return <>#{declSymbol.name}</>;\n } else {\n return <>{quoteIfNeeded(declSymbol.name)}</>;\n }\n }\n}\n\nfunction quoteIfNeeded(name: string) {\n if (isValidJSIdentifier(name)) {\n return name;\n } else {\n return `\"${name.replace(/\"/g, '\\\\\"')}\"`;\n }\n}\n"],"mappings":";;;;;;;;;;;AAyCA,SAAgB,aAAa,OAA0B;AACrD,KAAI,MAAM,KACR,QAAO,WAAW;AAChB,MAAI,MAAM,QACR,QAAO,IAAI,MAAM;AAEnB,SAAO,cAAc,MAAM,KAAM;GACjC;MACG;EACL,MAAM,aAAa,WAAW,yBAAyB;AACvD,MAAI,CAAC,WACH,QAAO;AAGT,MAAI,WAAW,sBACb,QAAO,4CAAE,KAAE,WAAW,KAAQ;MAE9B,QAAO,0CAAG,cAAc,WAAW,KAAK,EAAI;;;AAKlD,SAAS,cAAc,MAAc;AACnC,KAAI,oBAAoB,KAAK,CAC3B,QAAO;KAEP,QAAO,IAAI,KAAK,QAAQ,MAAM,OAAM,CAAC"}
@@ -4,6 +4,7 @@ const require_core_contexts_reflection = require('../../core/contexts/reflection
4
4
  const require_core_components_spacing = require('../../core/components/spacing.cjs');
5
5
  const require_typescript_components_tsdoc = require('./tsdoc.cjs');
6
6
  let _alloy_js_core = require("@alloy-js/core");
7
+ let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
7
8
  let _stryke_string_format_title_case = require("@stryke/string-format/title-case");
8
9
  let _stryke_type_checks_is_undefined = require("@stryke/type-checks/is-undefined");
9
10
  let _powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
@@ -33,26 +34,42 @@ function TSDocReflectionClass(props) {
33
34
  const hidden = (0, _alloy_js_core.computed)(() => reflection.isHidden());
34
35
  if (!computedHeading.value || (0, _stryke_type_checks_is_set_string.isSetString)(computedHeading.value) && computedHeading.value.trim() === "") return null;
35
36
  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)(permission.value) && permission.value.length > 0 || (0, _stryke_type_checks_is_set_string.isSetString)(domain.value) || !(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)(ignore.value) || !(0, _stryke_type_checks_is_undefined.isUndefined)(hidden.value));
36
- return <require_typescript_components_tsdoc.TSDoc {...rest} heading={(0, _stryke_type_checks_is_set_string.isSetString)(computedHeading.value) ? computedHeading.value.trim() : computedHeading.value}>
37
- <_alloy_js_core.Show when={hasAttributes.value}>
38
- <require_typescript_components_tsdoc.TSDocAttributesTags title={title.value} alias={alias.value} domain={domain.value} permission={permission.value} readonly={readonly.value} internal={internal.value} ignore={ignore.value} hidden={hidden.value} />
39
- </_alloy_js_core.Show>
40
- <_alloy_js_core.Show when={!(0, _stryke_type_checks_is_undefined.isUndefined)(children) && (0, _alloy_js_core.childrenArray)(() => children).filter(Boolean).length > 0}>
41
- <_alloy_js_core.Show when={hasAttributes.value}>
42
- <require_core_components_spacing.Spacing />
43
- </_alloy_js_core.Show>
44
- <_alloy_js_core.List>{(0, _alloy_js_core.childrenArray)(() => children)}</_alloy_js_core.List>
45
- </_alloy_js_core.Show>
46
- </require_typescript_components_tsdoc.TSDoc>;
37
+ return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(require_typescript_components_tsdoc.TSDoc, {
38
+ ...rest,
39
+ heading: (0, _stryke_type_checks_is_set_string.isSetString)(computedHeading.value) ? computedHeading.value.trim() : computedHeading.value,
40
+ children: [/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
41
+ when: hasAttributes.value,
42
+ children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_typescript_components_tsdoc.TSDocAttributesTags, {
43
+ title: title.value,
44
+ alias: alias.value,
45
+ domain: domain.value,
46
+ permission: permission.value,
47
+ readonly: readonly.value,
48
+ internal: internal.value,
49
+ ignore: ignore.value,
50
+ hidden: hidden.value
51
+ })
52
+ }), /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core.Show, {
53
+ when: !(0, _stryke_type_checks_is_undefined.isUndefined)(children) && (0, _alloy_js_core.childrenArray)(() => children).filter(Boolean).length > 0,
54
+ children: [/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
55
+ when: hasAttributes.value,
56
+ children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_core_components_spacing.Spacing, {})
57
+ }), /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.List, { children: (0, _alloy_js_core.childrenArray)(() => children) })]
58
+ })]
59
+ });
47
60
  }
48
61
  /**
49
62
  * Uses the `useReflectionClass` hook to retrieve the reflection class from the context, and then renders a `TSDocReflectionClass` component with the retrieved reflection class. This is a convenience component that allows you to easily render a TSDoc documentation block for the current reflection class without having to manually retrieve the reflection class from the context.
50
63
  */
51
64
  function TSDocContextClass(props) {
52
65
  const reflectionClass = require_core_contexts_reflection.useReflectionClass();
53
- return <_alloy_js_core.Show when={(0, _stryke_type_checks.isSetObject)(reflectionClass.reflection)}>
54
- <TSDocReflectionClass {...props} reflection={reflectionClass.reflection} />
55
- </_alloy_js_core.Show>;
66
+ return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
67
+ when: (0, _stryke_type_checks.isSetObject)(reflectionClass.reflection),
68
+ children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(TSDocReflectionClass, {
69
+ ...props,
70
+ reflection: reflectionClass.reflection
71
+ })
72
+ });
56
73
  }
57
74
  /**
58
75
  * 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.
@@ -61,26 +78,44 @@ function TSDocReflectionProperty(props) {
61
78
  const [{ children, reflection }, rest] = (0, _alloy_js_core.splitProps)(props, ["children", "reflection"]);
62
79
  if (!(0, _stryke_type_checks.isSetObject)(reflection)) return null;
63
80
  const hasAttributes = (0, _alloy_js_core.computed)(() => (0, _stryke_type_checks_is_set_string.isSetString)(reflection.getTitle()) || !(0, _stryke_type_checks_is_undefined.isUndefined)(reflection.getAlias()) && reflection.getAlias().length > 0 || !(0, _stryke_type_checks_is_undefined.isUndefined)(reflection.getPermission()) && reflection.getPermission().length > 0 || (0, _stryke_type_checks_is_set_string.isSetString)(reflection.getDomain()) || !(0, _stryke_type_checks_is_undefined.isUndefined)(reflection.isReadonly()) || !(0, _stryke_type_checks_is_undefined.isUndefined)(reflection.isInternal()) || !(0, _stryke_type_checks_is_undefined.isUndefined)(reflection.isIgnored()) || !(0, _stryke_type_checks_is_undefined.isUndefined)(reflection.isHidden()) || reflection.hasDefault() && !(0, _stryke_type_checks_is_undefined.isUndefined)(reflection.getDefaultValue()));
64
- return <require_typescript_components_tsdoc.TSDoc heading={reflection.getDescription()} {...rest}>
65
- <_alloy_js_core.Show when={hasAttributes.value}>
66
- <require_typescript_components_tsdoc.TSDocAttributesTags type={reflection} title={reflection.getTitle()} alias={reflection.getAlias()} domain={reflection.getDomain()} permission={reflection.getPermission()} readonly={reflection.isReadonly()} internal={reflection.isInternal()} ignore={reflection.isIgnored()} hidden={reflection.isHidden()} defaultValue={reflection.getDefaultValue()} />
67
- </_alloy_js_core.Show>
68
- <_alloy_js_core.Show when={!(0, _stryke_type_checks_is_undefined.isUndefined)(children) && (0, _alloy_js_core.childrenArray)(() => children).filter(Boolean).length > 0}>
69
- <_alloy_js_core.Show when={hasAttributes.value}>
70
- <require_core_components_spacing.Spacing />
71
- </_alloy_js_core.Show>
72
- <_alloy_js_core.List>{(0, _alloy_js_core.childrenArray)(() => children)}</_alloy_js_core.List>
73
- </_alloy_js_core.Show>
74
- </require_typescript_components_tsdoc.TSDoc>;
81
+ return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(require_typescript_components_tsdoc.TSDoc, {
82
+ heading: reflection.getDescription(),
83
+ ...rest,
84
+ children: [/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
85
+ when: hasAttributes.value,
86
+ children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_typescript_components_tsdoc.TSDocAttributesTags, {
87
+ type: reflection,
88
+ title: reflection.getTitle(),
89
+ alias: reflection.getAlias(),
90
+ domain: reflection.getDomain(),
91
+ permission: reflection.getPermission(),
92
+ readonly: reflection.isReadonly(),
93
+ internal: reflection.isInternal(),
94
+ ignore: reflection.isIgnored(),
95
+ hidden: reflection.isHidden(),
96
+ defaultValue: reflection.getDefaultValue()
97
+ })
98
+ }), /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core.Show, {
99
+ when: !(0, _stryke_type_checks_is_undefined.isUndefined)(children) && (0, _alloy_js_core.childrenArray)(() => children).filter(Boolean).length > 0,
100
+ children: [/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
101
+ when: hasAttributes.value,
102
+ children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_core_components_spacing.Spacing, {})
103
+ }), /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.List, { children: (0, _alloy_js_core.childrenArray)(() => children) })]
104
+ })]
105
+ });
75
106
  }
76
107
  /**
77
108
  * Uses the `useReflectionProperty` hook to retrieve the reflection property from the context, and then renders a `TSDocReflectionProperty` component with the retrieved reflection property. This is a convenience component that allows you to easily render a TSDoc documentation block for the current reflection property without having to manually retrieve the reflection property from the context.
78
109
  */
79
110
  function TSDocContextProperty(props) {
80
111
  const reflection = require_core_contexts_reflection.useReflectionProperty();
81
- return <_alloy_js_core.Show when={(0, _stryke_type_checks.isSetObject)(reflection)}>
82
- <TSDocReflectionProperty {...props} reflection={reflection} />
83
- </_alloy_js_core.Show>;
112
+ return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
113
+ when: (0, _stryke_type_checks.isSetObject)(reflection),
114
+ children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(TSDocReflectionProperty, {
115
+ ...props,
116
+ reflection
117
+ })
118
+ });
84
119
  }
85
120
  /**
86
121
  * 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.
@@ -88,38 +123,61 @@ function TSDocContextProperty(props) {
88
123
  function TSDocReflectionMethod(props) {
89
124
  const [{ children, reflection }, rest] = (0, _alloy_js_core.splitProps)(props, ["children", "reflection"]);
90
125
  if (!(0, _stryke_type_checks.isSetObject)(reflection)) return null;
91
- const heading = (0, _alloy_js_core.computed)(() => reflection.getDescription() || ((0, _stryke_type_checks_is_string.isString)(reflection.getName()) ? _alloy_js_core.code`${String(reflection.getName())} method definition` : void 0));
92
- return <require_typescript_components_tsdoc.TSDoc heading={heading.value} {...rest}>
93
- <require_typescript_components_tsdoc.TSDocAttributesTags title={reflection.getTitle()} alias={reflection.getAlias()} domain={reflection.getDomain()} permission={reflection.getPermission()} readonly={reflection.isReadonly()} internal={reflection.isInternal()} ignore={reflection.isIgnored()} hidden={reflection.isHidden()} />
94
- <_alloy_js_core.Show when={Boolean(children) && (0, _alloy_js_core.childrenArray)(() => children).length > 0}>
95
- <_alloy_js_core.List>{(0, _alloy_js_core.childrenArray)(() => children)}</_alloy_js_core.List>
96
- </_alloy_js_core.Show>
97
- <_alloy_js_core.Show when={reflection.getParameters().length > 0}>
98
- <require_core_components_spacing.Spacing />
99
- <_alloy_js_core.For each={reflection.getParameters()} hardline ender={<hbr />}>
100
- {(param) => <require_typescript_components_tsdoc.TSDocParam name={param.getName()} optional={param.isOptional()} defaultValue={param.hasDefault() ? param.getDefaultValue() : void 0}>
101
- <_alloy_js_core.Show when={Boolean(param.parameter.description)} fallback={_alloy_js_core.code`A parameter to provide a ${param.getName()} value to the function.`}>
102
- {param.parameter.description}
103
- </_alloy_js_core.Show>
104
- </require_typescript_components_tsdoc.TSDocParam>}
105
- </_alloy_js_core.For>
106
- </_alloy_js_core.Show>
107
- <_alloy_js_core.Show when={reflection.getReturnType().kind !== _powerlines_deepkit_vendor_type.ReflectionKind.void}>
108
- <require_core_components_spacing.Spacing />
109
- <require_typescript_components_tsdoc.TSDocReturns>
110
- {_alloy_js_core.code`The return value of the function, which is of type ${(0, _powerlines_deepkit_vendor_type.stringifyType)(reflection.getReturnType())}.`}
111
- </require_typescript_components_tsdoc.TSDocReturns>
112
- </_alloy_js_core.Show>
113
- </require_typescript_components_tsdoc.TSDoc>;
126
+ return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(require_typescript_components_tsdoc.TSDoc, {
127
+ heading: (0, _alloy_js_core.computed)(() => reflection.getDescription() || ((0, _stryke_type_checks_is_string.isString)(reflection.getName()) ? _alloy_js_core.code`${String(reflection.getName())} method definition` : void 0)).value,
128
+ ...rest,
129
+ children: [
130
+ /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_typescript_components_tsdoc.TSDocAttributesTags, {
131
+ title: reflection.getTitle(),
132
+ alias: reflection.getAlias(),
133
+ domain: reflection.getDomain(),
134
+ permission: reflection.getPermission(),
135
+ readonly: reflection.isReadonly(),
136
+ internal: reflection.isInternal(),
137
+ ignore: reflection.isIgnored(),
138
+ hidden: reflection.isHidden()
139
+ }),
140
+ /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
141
+ when: Boolean(children) && (0, _alloy_js_core.childrenArray)(() => children).length > 0,
142
+ children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.List, { children: (0, _alloy_js_core.childrenArray)(() => children) })
143
+ }),
144
+ /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core.Show, {
145
+ when: reflection.getParameters().length > 0,
146
+ children: [/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_core_components_spacing.Spacing, {}), /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.For, {
147
+ each: reflection.getParameters(),
148
+ hardline: true,
149
+ ender: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {}),
150
+ children: (param) => /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_typescript_components_tsdoc.TSDocParam, {
151
+ name: param.getName(),
152
+ optional: param.isOptional(),
153
+ defaultValue: param.hasDefault() ? param.getDefaultValue() : void 0,
154
+ children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
155
+ when: Boolean(param.parameter.description),
156
+ fallback: _alloy_js_core.code`A parameter to provide a ${param.getName()} value to the function.`,
157
+ children: param.parameter.description
158
+ })
159
+ })
160
+ })]
161
+ }),
162
+ /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core.Show, {
163
+ when: reflection.getReturnType().kind !== _powerlines_deepkit_vendor_type.ReflectionKind.void,
164
+ children: [/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_core_components_spacing.Spacing, {}), /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_typescript_components_tsdoc.TSDocReturns, { children: _alloy_js_core.code`The return value of the function, which is of type ${(0, _powerlines_deepkit_vendor_type.stringifyType)(reflection.getReturnType())}.` })]
165
+ })
166
+ ]
167
+ });
114
168
  }
115
169
  /**
116
170
  * 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.
117
171
  */
118
172
  function TSDocContextMethod(props) {
119
173
  const reflection = require_core_contexts_reflection.useReflectionMethod();
120
- return <_alloy_js_core.Show when={(0, _stryke_type_checks.isSetObject)(reflection)}>
121
- <TSDocReflectionMethod {...props} reflection={reflection} />
122
- </_alloy_js_core.Show>;
174
+ return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
175
+ when: (0, _stryke_type_checks.isSetObject)(reflection),
176
+ children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(TSDocReflectionMethod, {
177
+ ...props,
178
+ reflection
179
+ })
180
+ });
123
181
  }
124
182
 
125
183
  //#endregion