@powerlines/plugin-alloy 0.25.33 → 0.25.35
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/README.md +1 -1
- package/dist/core/components/output.cjs +17 -10
- package/dist/core/components/output.mjs +17 -10
- package/dist/core/components/output.mjs.map +1 -1
- package/dist/core/components/single-line-comment.cjs +6 -4
- package/dist/core/components/single-line-comment.mjs +6 -4
- package/dist/core/components/single-line-comment.mjs.map +1 -1
- package/dist/core/components/source-file.cjs +10 -6
- package/dist/core/components/source-file.mjs +10 -6
- package/dist/core/components/source-file.mjs.map +1 -1
- package/dist/core/components/spacing.cjs +6 -4
- package/dist/core/components/spacing.mjs +6 -4
- package/dist/core/components/spacing.mjs.map +1 -1
- package/dist/index.cjs +13 -18
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +12 -17
- package/dist/index.mjs.map +1 -1
- package/dist/markdown/components/front-matter.cjs +9 -7
- package/dist/markdown/components/front-matter.mjs +9 -7
- package/dist/markdown/components/front-matter.mjs.map +1 -1
- package/dist/markdown/components/markdown-file.cjs +76 -44
- package/dist/markdown/components/markdown-file.mjs +76 -44
- package/dist/markdown/components/markdown-file.mjs.map +1 -1
- package/dist/markdown/components/markdown-table.cjs +49 -28
- package/dist/markdown/components/markdown-table.mjs +49 -28
- package/dist/markdown/components/markdown-table.mjs.map +1 -1
- package/dist/render.cjs +3 -3
- package/dist/render.mjs +4 -4
- package/dist/render.mjs.map +1 -1
- package/dist/typescript/components/builtin-file.cjs +29 -19
- package/dist/typescript/components/builtin-file.mjs +30 -20
- package/dist/typescript/components/builtin-file.mjs.map +1 -1
- package/dist/typescript/components/class-declaration.cjs +165 -100
- package/dist/typescript/components/class-declaration.mjs +165 -100
- package/dist/typescript/components/class-declaration.mjs.map +1 -1
- package/dist/typescript/components/dynamic-import-statement.cjs +2 -6
- package/dist/typescript/components/dynamic-import-statement.mjs +2 -6
- package/dist/typescript/components/dynamic-import-statement.mjs.map +1 -1
- package/dist/typescript/components/entry-file.cjs +9 -6
- package/dist/typescript/components/entry-file.mjs +10 -7
- package/dist/typescript/components/entry-file.mjs.map +1 -1
- package/dist/typescript/components/infrastructure-file.cjs +9 -6
- package/dist/typescript/components/infrastructure-file.mjs +10 -7
- package/dist/typescript/components/infrastructure-file.mjs.map +1 -1
- package/dist/typescript/components/interface-declaration.cjs +121 -70
- package/dist/typescript/components/interface-declaration.mjs +121 -70
- package/dist/typescript/components/interface-declaration.mjs.map +1 -1
- package/dist/typescript/components/object-declaration.cjs +76 -44
- package/dist/typescript/components/object-declaration.mjs +76 -44
- package/dist/typescript/components/object-declaration.mjs.map +1 -1
- package/dist/typescript/components/property-name.cjs +3 -3
- package/dist/typescript/components/property-name.mjs +3 -3
- package/dist/typescript/components/property-name.mjs.map +1 -1
- package/dist/typescript/components/record-expression.mjs.map +1 -1
- package/dist/typescript/components/tsdoc-reflection.cjs +225 -104
- package/dist/typescript/components/tsdoc-reflection.mjs +225 -104
- package/dist/typescript/components/tsdoc-reflection.mjs.map +1 -1
- package/dist/typescript/components/tsdoc.cjs +255 -160
- package/dist/typescript/components/tsdoc.mjs +255 -160
- package/dist/typescript/components/tsdoc.mjs.map +1 -1
- package/dist/typescript/components/type-declaration.cjs +20 -15
- package/dist/typescript/components/type-declaration.mjs +20 -15
- package/dist/typescript/components/type-declaration.mjs.map +1 -1
- package/dist/typescript/components/type-parameters.cjs +55 -29
- package/dist/typescript/components/type-parameters.mjs +55 -29
- package/dist/typescript/components/type-parameters.mjs.map +1 -1
- package/dist/typescript/components/typescript-file.cjs +145 -80
- package/dist/typescript/components/typescript-file.mjs +145 -80
- package/dist/typescript/components/typescript-file.mjs.map +1 -1
- package/dist/typescript/contexts/lexical-scope.cjs +5 -3
- package/dist/typescript/contexts/lexical-scope.mjs +5 -3
- package/dist/typescript/contexts/lexical-scope.mjs.map +1 -1
- package/dist/typescript/contexts/member-scope.cjs +5 -3
- package/dist/typescript/contexts/member-scope.mjs +5 -3
- package/dist/typescript/contexts/member-scope.mjs.map +1 -1
- package/dist/yaml/components/yaml-file.cjs +92 -47
- package/dist/yaml/components/yaml-file.mjs +92 -47
- package/dist/yaml/components/yaml-file.mjs.map +1 -1
- package/package.json +16 -17
|
@@ -4,8 +4,8 @@ const require_core_contexts_context = require('../../core/contexts/context.cjs')
|
|
|
4
4
|
const require_core_components_single_line_comment = require('../../core/components/single-line-comment.cjs');
|
|
5
5
|
const require_core_components_source_file = require('../../core/components/source-file.cjs');
|
|
6
6
|
const require_markdown_components_front_matter = require('./front-matter.cjs');
|
|
7
|
-
let _alloy_js_core = require("@alloy-js/core");
|
|
8
7
|
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
8
|
+
let _alloy_js_core = require("@alloy-js/core");
|
|
9
9
|
let _stryke_string_format_title_case = require("@stryke/string-format/title-case");
|
|
10
10
|
let powerlines_utils = require("powerlines/utils");
|
|
11
11
|
let _alloy_js_markdown = require("@alloy-js/markdown");
|
|
@@ -24,17 +24,21 @@ function MarkdownFile(props) {
|
|
|
24
24
|
"storage",
|
|
25
25
|
"frontMatter"
|
|
26
26
|
]);
|
|
27
|
-
return
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(require_core_components_source_file.SourceFile, (0, _alloy_js_core_jsx_runtime.mergeProps)({ get header() {
|
|
28
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(MarkdownFileHeader, { frontMatter });
|
|
29
|
+
} }, rest, {
|
|
30
30
|
filetype: "md",
|
|
31
31
|
reference: _alloy_js_markdown.Link,
|
|
32
32
|
storage,
|
|
33
|
-
children
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
get children() {
|
|
34
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
35
|
+
get when() {
|
|
36
|
+
return Boolean(children);
|
|
37
|
+
},
|
|
38
|
+
children
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}));
|
|
38
42
|
}
|
|
39
43
|
/**
|
|
40
44
|
* Renders the header for a Powerlines Typescript source file.
|
|
@@ -51,51 +55,79 @@ function MarkdownFileHeader(props) {
|
|
|
51
55
|
"frontMatter"
|
|
52
56
|
]);
|
|
53
57
|
const context = require_core_contexts_context.usePowerlinesSafe();
|
|
54
|
-
return
|
|
55
|
-
|
|
56
|
-
when
|
|
57
|
-
|
|
58
|
+
return [
|
|
59
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
60
|
+
get when() {
|
|
61
|
+
return (0, _alloy_js_core_jsx_runtime.memo)(() => !!(0, _stryke_type_checks.isSetObject)(frontMatter))() && Object.keys(frontMatter).length > 0;
|
|
62
|
+
},
|
|
63
|
+
get children() {
|
|
64
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(require_markdown_components_front_matter.FrontMatter, { data: frontMatter });
|
|
65
|
+
}
|
|
58
66
|
}),
|
|
59
|
-
|
|
60
|
-
when
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
67
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
68
|
+
get when() {
|
|
69
|
+
return Boolean(disableEslint);
|
|
70
|
+
},
|
|
71
|
+
get children() {
|
|
72
|
+
return [(0, _alloy_js_core_jsx_runtime.createComponent)(require_core_components_single_line_comment.SingleLineComment, {
|
|
73
|
+
variant: "markdown",
|
|
74
|
+
children: "eslint-disable"
|
|
75
|
+
}), (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
|
|
76
|
+
}
|
|
65
77
|
}),
|
|
66
|
-
|
|
67
|
-
when
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
78
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
79
|
+
get when() {
|
|
80
|
+
return Boolean(disablePrettier);
|
|
81
|
+
},
|
|
82
|
+
get children() {
|
|
83
|
+
return [(0, _alloy_js_core_jsx_runtime.createComponent)(require_core_components_single_line_comment.SingleLineComment, {
|
|
84
|
+
variant: "markdown",
|
|
85
|
+
children: "prettier-ignore"
|
|
86
|
+
}), (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
|
|
87
|
+
}
|
|
72
88
|
}),
|
|
73
|
-
|
|
74
|
-
when
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
89
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
90
|
+
get when() {
|
|
91
|
+
return Boolean(disableBiome);
|
|
92
|
+
},
|
|
93
|
+
get children() {
|
|
94
|
+
return [(0, _alloy_js_core_jsx_runtime.createComponent)(require_core_components_single_line_comment.SingleLineComment, {
|
|
95
|
+
variant: "markdown",
|
|
96
|
+
children: "biome-ignore lint: disable"
|
|
97
|
+
}), (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
|
|
98
|
+
}
|
|
79
99
|
}),
|
|
80
|
-
|
|
81
|
-
when
|
|
82
|
-
|
|
100
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
101
|
+
get when() {
|
|
102
|
+
return Boolean(disableEslint) || Boolean(disablePrettier) || Boolean(disableBiome);
|
|
103
|
+
},
|
|
104
|
+
get children() {
|
|
105
|
+
return (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {});
|
|
106
|
+
}
|
|
83
107
|
}),
|
|
84
|
-
|
|
85
|
-
when
|
|
86
|
-
|
|
108
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
109
|
+
get when() {
|
|
110
|
+
return Boolean(children);
|
|
111
|
+
},
|
|
112
|
+
get children() {
|
|
113
|
+
return [children, (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
|
|
114
|
+
}
|
|
87
115
|
}),
|
|
88
|
-
|
|
116
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(require_core_components_single_line_comment.SingleLineComment, {
|
|
89
117
|
variant: "markdown",
|
|
90
|
-
children
|
|
118
|
+
get children() {
|
|
119
|
+
return `Generated by ${(0, _stryke_string_format_title_case.titleCase)(context?.config?.framework) || "Powerlines"}`;
|
|
120
|
+
}
|
|
91
121
|
}),
|
|
92
|
-
|
|
93
|
-
|
|
122
|
+
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
123
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(require_core_components_single_line_comment.SingleLineComment, {
|
|
94
124
|
variant: "markdown",
|
|
95
|
-
children
|
|
125
|
+
get children() {
|
|
126
|
+
return (0, powerlines_utils.getFileHeaderWarning)(context);
|
|
127
|
+
}
|
|
96
128
|
}),
|
|
97
|
-
|
|
98
|
-
]
|
|
129
|
+
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
|
|
130
|
+
];
|
|
99
131
|
}
|
|
100
132
|
|
|
101
133
|
//#endregion
|
|
@@ -2,8 +2,8 @@ import { usePowerlinesSafe } from "../../core/contexts/context.mjs";
|
|
|
2
2
|
import { SingleLineComment } from "../../core/components/single-line-comment.mjs";
|
|
3
3
|
import { SourceFile } from "../../core/components/source-file.mjs";
|
|
4
4
|
import { FrontMatter } from "./front-matter.mjs";
|
|
5
|
+
import { createComponent, createIntrinsic, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
5
6
|
import { Show, splitProps } from "@alloy-js/core";
|
|
6
|
-
import { Fragment, jsx, jsxs } from "@alloy-js/core/jsx-runtime";
|
|
7
7
|
import { titleCase } from "@stryke/string-format/title-case";
|
|
8
8
|
import { getFileHeaderWarning } from "powerlines/utils";
|
|
9
9
|
import { Link } from "@alloy-js/markdown";
|
|
@@ -22,17 +22,21 @@ function MarkdownFile(props) {
|
|
|
22
22
|
"storage",
|
|
23
23
|
"frontMatter"
|
|
24
24
|
]);
|
|
25
|
-
return
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
return createComponent(SourceFile, mergeProps({ get header() {
|
|
26
|
+
return createComponent(MarkdownFileHeader, { frontMatter });
|
|
27
|
+
} }, rest, {
|
|
28
28
|
filetype: "md",
|
|
29
29
|
reference: Link,
|
|
30
30
|
storage,
|
|
31
|
-
children
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
get children() {
|
|
32
|
+
return createComponent(Show, {
|
|
33
|
+
get when() {
|
|
34
|
+
return Boolean(children);
|
|
35
|
+
},
|
|
36
|
+
children
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}));
|
|
36
40
|
}
|
|
37
41
|
/**
|
|
38
42
|
* Renders the header for a Powerlines Typescript source file.
|
|
@@ -49,51 +53,79 @@ function MarkdownFileHeader(props) {
|
|
|
49
53
|
"frontMatter"
|
|
50
54
|
]);
|
|
51
55
|
const context = usePowerlinesSafe();
|
|
52
|
-
return
|
|
53
|
-
|
|
54
|
-
when
|
|
55
|
-
|
|
56
|
+
return [
|
|
57
|
+
createComponent(Show, {
|
|
58
|
+
get when() {
|
|
59
|
+
return memo(() => !!isSetObject(frontMatter))() && Object.keys(frontMatter).length > 0;
|
|
60
|
+
},
|
|
61
|
+
get children() {
|
|
62
|
+
return createComponent(FrontMatter, { data: frontMatter });
|
|
63
|
+
}
|
|
56
64
|
}),
|
|
57
|
-
|
|
58
|
-
when
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
65
|
+
createComponent(Show, {
|
|
66
|
+
get when() {
|
|
67
|
+
return Boolean(disableEslint);
|
|
68
|
+
},
|
|
69
|
+
get children() {
|
|
70
|
+
return [createComponent(SingleLineComment, {
|
|
71
|
+
variant: "markdown",
|
|
72
|
+
children: "eslint-disable"
|
|
73
|
+
}), createIntrinsic("hbr", {})];
|
|
74
|
+
}
|
|
63
75
|
}),
|
|
64
|
-
|
|
65
|
-
when
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
76
|
+
createComponent(Show, {
|
|
77
|
+
get when() {
|
|
78
|
+
return Boolean(disablePrettier);
|
|
79
|
+
},
|
|
80
|
+
get children() {
|
|
81
|
+
return [createComponent(SingleLineComment, {
|
|
82
|
+
variant: "markdown",
|
|
83
|
+
children: "prettier-ignore"
|
|
84
|
+
}), createIntrinsic("hbr", {})];
|
|
85
|
+
}
|
|
70
86
|
}),
|
|
71
|
-
|
|
72
|
-
when
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
87
|
+
createComponent(Show, {
|
|
88
|
+
get when() {
|
|
89
|
+
return Boolean(disableBiome);
|
|
90
|
+
},
|
|
91
|
+
get children() {
|
|
92
|
+
return [createComponent(SingleLineComment, {
|
|
93
|
+
variant: "markdown",
|
|
94
|
+
children: "biome-ignore lint: disable"
|
|
95
|
+
}), createIntrinsic("hbr", {})];
|
|
96
|
+
}
|
|
77
97
|
}),
|
|
78
|
-
|
|
79
|
-
when
|
|
80
|
-
|
|
98
|
+
createComponent(Show, {
|
|
99
|
+
get when() {
|
|
100
|
+
return Boolean(disableEslint) || Boolean(disablePrettier) || Boolean(disableBiome);
|
|
101
|
+
},
|
|
102
|
+
get children() {
|
|
103
|
+
return createIntrinsic("hbr", {});
|
|
104
|
+
}
|
|
81
105
|
}),
|
|
82
|
-
|
|
83
|
-
when
|
|
84
|
-
|
|
106
|
+
createComponent(Show, {
|
|
107
|
+
get when() {
|
|
108
|
+
return Boolean(children);
|
|
109
|
+
},
|
|
110
|
+
get children() {
|
|
111
|
+
return [children, createIntrinsic("hbr", {})];
|
|
112
|
+
}
|
|
85
113
|
}),
|
|
86
|
-
|
|
114
|
+
createComponent(SingleLineComment, {
|
|
87
115
|
variant: "markdown",
|
|
88
|
-
children
|
|
116
|
+
get children() {
|
|
117
|
+
return `Generated by ${titleCase(context?.config?.framework) || "Powerlines"}`;
|
|
118
|
+
}
|
|
89
119
|
}),
|
|
90
|
-
|
|
91
|
-
|
|
120
|
+
createIntrinsic("hbr", {}),
|
|
121
|
+
createComponent(SingleLineComment, {
|
|
92
122
|
variant: "markdown",
|
|
93
|
-
children
|
|
123
|
+
get children() {
|
|
124
|
+
return getFileHeaderWarning(context);
|
|
125
|
+
}
|
|
94
126
|
}),
|
|
95
|
-
|
|
96
|
-
]
|
|
127
|
+
createIntrinsic("hbr", {})
|
|
128
|
+
];
|
|
97
129
|
}
|
|
98
130
|
|
|
99
131
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown-file.mjs","names":[],"sources":["../../../src/markdown/components/markdown-file.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 { Show, splitProps } from \"@alloy-js/core\";\nimport { Link } from \"@alloy-js/markdown\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isSetObject } from \"@stryke/type-checks\";\nimport { getFileHeaderWarning } from \"powerlines/utils\";\nimport { SingleLineComment } from \"../../core/components/single-line-comment\";\nimport { SourceFile, SourceFileProps } from \"../../core/components/source-file\";\nimport { usePowerlinesSafe } from \"../../core/contexts/context\";\nimport { ComponentProps, SourceFileHeaderProps } from \"../../types/components\";\nimport { FrontMatter, FrontMatterProps } from \"./front-matter\";\n\nexport type MarkdownFileProps = Omit<SourceFileProps, \"filetype\"> &\n ComponentProps &\n MarkdownFileHeaderProps;\n\n/**\n * A base component representing a Powerlines generated markdown source file.\n *\n * @param props - The properties for the source file.\n * @returns The rendered source file component.\n */\nexport function MarkdownFile(props: MarkdownFileProps) {\n const [{ children, storage, frontMatter }, rest] = splitProps(props, [\n \"children\",\n \"storage\",\n \"frontMatter\"\n ]);\n\n return (\n <SourceFile\n header={<MarkdownFileHeader frontMatter={frontMatter} />}\n {...rest}\n filetype=\"md\"\n reference={Link}\n storage={storage}>\n <Show when={Boolean(children)}>{children}</Show>\n </SourceFile>\n );\n}\n\nexport type MarkdownFileHeaderProps = SourceFileHeaderProps & {\n frontMatter?: FrontMatterProps[\"data\"];\n};\n\n/**\n * Renders the header for a Powerlines Typescript source file.\n *\n * @param props - The properties for the source file header.\n * @returns The rendered source file header.\n */\nexport function MarkdownFileHeader(props: MarkdownFileHeaderProps) {\n const [\n {\n children,\n disableEslint = true,\n disableBiome = true,\n disablePrettier = false,\n frontMatter\n }\n ] = splitProps(props, [\n \"children\",\n \"disableEslint\",\n \"disableBiome\",\n \"disablePrettier\",\n \"frontMatter\"\n ]);\n\n const context = usePowerlinesSafe();\n\n return (\n <>\n <Show\n when={isSetObject(frontMatter) && Object.keys(frontMatter).length > 0}>\n <FrontMatter data={frontMatter!} />\n </Show>\n <Show when={Boolean(disableEslint)}>\n <SingleLineComment variant=\"markdown\">\n {\"eslint-disable\"}\n </SingleLineComment>\n <hbr />\n </Show>\n <Show when={Boolean(disablePrettier)}>\n <SingleLineComment variant=\"markdown\">\n {\"prettier-ignore\"}\n </SingleLineComment>\n <hbr />\n </Show>\n <Show when={Boolean(disableBiome)}>\n <SingleLineComment variant=\"markdown\">\n {\"biome-ignore lint: disable\"}\n </SingleLineComment>\n <hbr />\n </Show>\n <Show\n when={\n Boolean(disableEslint) ||\n Boolean(disablePrettier) ||\n Boolean(disableBiome)\n }>\n <hbr />\n </Show>\n <Show when={Boolean(children)}>\n <>\n {children}\n <hbr />\n </>\n </Show>\n <SingleLineComment variant=\"markdown\">{`Generated by ${\n titleCase(context?.config?.framework) || \"Powerlines\"\n }`}</SingleLineComment>\n <hbr />\n <SingleLineComment variant=\"markdown\">\n {getFileHeaderWarning(context!)}\n </SingleLineComment>\n <hbr />\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"markdown-file.mjs","names":[],"sources":["../../../src/markdown/components/markdown-file.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 { Show, splitProps } from \"@alloy-js/core\";\nimport { Link } from \"@alloy-js/markdown\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isSetObject } from \"@stryke/type-checks\";\nimport { getFileHeaderWarning } from \"powerlines/utils\";\nimport { SingleLineComment } from \"../../core/components/single-line-comment\";\nimport { SourceFile, SourceFileProps } from \"../../core/components/source-file\";\nimport { usePowerlinesSafe } from \"../../core/contexts/context\";\nimport { ComponentProps, SourceFileHeaderProps } from \"../../types/components\";\nimport { FrontMatter, FrontMatterProps } from \"./front-matter\";\n\nexport type MarkdownFileProps = Omit<SourceFileProps, \"filetype\"> &\n ComponentProps &\n MarkdownFileHeaderProps;\n\n/**\n * A base component representing a Powerlines generated markdown source file.\n *\n * @param props - The properties for the source file.\n * @returns The rendered source file component.\n */\nexport function MarkdownFile(props: MarkdownFileProps) {\n const [{ children, storage, frontMatter }, rest] = splitProps(props, [\n \"children\",\n \"storage\",\n \"frontMatter\"\n ]);\n\n return (\n <SourceFile\n header={<MarkdownFileHeader frontMatter={frontMatter} />}\n {...rest}\n filetype=\"md\"\n reference={Link}\n storage={storage}>\n <Show when={Boolean(children)}>{children}</Show>\n </SourceFile>\n );\n}\n\nexport type MarkdownFileHeaderProps = SourceFileHeaderProps & {\n frontMatter?: FrontMatterProps[\"data\"];\n};\n\n/**\n * Renders the header for a Powerlines Typescript source file.\n *\n * @param props - The properties for the source file header.\n * @returns The rendered source file header.\n */\nexport function MarkdownFileHeader(props: MarkdownFileHeaderProps) {\n const [\n {\n children,\n disableEslint = true,\n disableBiome = true,\n disablePrettier = false,\n frontMatter\n }\n ] = splitProps(props, [\n \"children\",\n \"disableEslint\",\n \"disableBiome\",\n \"disablePrettier\",\n \"frontMatter\"\n ]);\n\n const context = usePowerlinesSafe();\n\n return (\n <>\n <Show\n when={isSetObject(frontMatter) && Object.keys(frontMatter).length > 0}>\n <FrontMatter data={frontMatter!} />\n </Show>\n <Show when={Boolean(disableEslint)}>\n <SingleLineComment variant=\"markdown\">\n {\"eslint-disable\"}\n </SingleLineComment>\n <hbr />\n </Show>\n <Show when={Boolean(disablePrettier)}>\n <SingleLineComment variant=\"markdown\">\n {\"prettier-ignore\"}\n </SingleLineComment>\n <hbr />\n </Show>\n <Show when={Boolean(disableBiome)}>\n <SingleLineComment variant=\"markdown\">\n {\"biome-ignore lint: disable\"}\n </SingleLineComment>\n <hbr />\n </Show>\n <Show\n when={\n Boolean(disableEslint) ||\n Boolean(disablePrettier) ||\n Boolean(disableBiome)\n }>\n <hbr />\n </Show>\n <Show when={Boolean(children)}>\n <>\n {children}\n <hbr />\n </>\n </Show>\n <SingleLineComment variant=\"markdown\">{`Generated by ${\n titleCase(context?.config?.framework) || \"Powerlines\"\n }`}</SingleLineComment>\n <hbr />\n <SingleLineComment variant=\"markdown\">\n {getFileHeaderWarning(context!)}\n </SingleLineComment>\n <hbr />\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAqCA,SAAgB,aAAS,OAAqB;CAC5C,MAAA,CAAA,EACF,UACE,SACE,eACC,QAAQ,WAAA,OAAA;EAAA;EAAA;EAAA;EAAA,CAAA;AACX,QAAG,gBAAW,YAAA,WAAA,EACZ,IAAA,SAAA;+CAEK,aACJ,CAAA;IAEF,EAAE,MAAK;EACN,UAAU;EACV,WAAW;EACF;EACT,IAAG,WAAW;AACZ,UAAA,gBAAU,MAAA;IACb,IAAA,OAAA;AACH,YAAA,QAAA,SAAA;;IAEY;IACV,CAAA;;;;;;;;;;AAcF,SAAM,mBAAmB,OAAA;CACvB,MAAI,CAAA,EACF,UACA,gBAAA,MACA,eAAa,MACb,kBAAU,OACV,iBACC,WAAa,OAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA,CAAA;CAChB,MAAG,UAAA,mBAAgB;AACnB,QAAG;EAAA,gBAAW,MAAA;GACZ,IAAA,OAAA;;;;AAIF,WAAO,gBAAA,aAAA,EACJ,MAAA,aACE,CAAA;;GAEJ,CAAC;EAAE,gBAAe,MAAM;GACvB,IAAI,OAAI;AACN,WAAM,QAAM,cAAQ;;GAEtB,IAAI,WAAW;AACb,WAAI,CAAA,gBAAiB,mBAAA;KACnB,SAAM;KACN,UAAI;KACL,CAAA,EAAA,gBAAmB,OAAA,EAAA,CAAA,CAAA;;GAEvB,CAAC;EAAE,gBAAe,MAAO;GACxB,IAAI,OAAE;AACJ,WAAO,QAAC,gBAAA;;GAEV,IAAG,WAAW;AACZ,WAAG,CAAA,gBAAkB,mBAAkB;KACrC,SAAS;KACT,UAAE;KACH,CAAC,EAAC,gBAAK,OAAA,EAAA,CAAA,CAAA;;GAEX,CAAC;EAAE,gBAAC,MAAA;GACH,IAAI,OAAK;AACP,WAAI,QAAQ,aAAgB;;GAE9B,IAAI,WAAU;AACZ,WAAG,CAAA,gBAAA,mBAAA;KACD,SAAM;KACN,UAAI;KACL,CAAA,EAAA,gBAAmB,OAAS,EAAC,CAAA,CAAA;;GAEjC,CAAC;EAAE,gBAAa,MAAA;GACf,IAAI,OAAO;AACT,WAAI,QAAA,cAAA,IAAA,QAAA,gBAAA,IAAA,QAAA,aAAA;;GAEN,IAAG,WAAA;AACD,WAAE,gBAAmB,OAAQ,EAAA,CAAA;;GAEhC,CAAC;EAAE,gBAAM,MAAA;GACR,IAAG,OAAA;AACD,WAAG,QAAA,SAAqB;;GAE1B,IAAG,WAAK;AACN,WAAA,CAAA,UAAA,gBAAA,OAAA,EAAA,CAAA,CAAA;;GAEN,CAAA;EAAA,gBAAA,mBAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
3
3
|
const require_markdown_contexts_markdown_table = require('../contexts/markdown-table.cjs');
|
|
4
|
-
let _alloy_js_core = require("@alloy-js/core");
|
|
5
4
|
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
5
|
+
let _alloy_js_core = require("@alloy-js/core");
|
|
6
6
|
let _stryke_string_format_title_case = require("@stryke/string-format/title-case");
|
|
7
7
|
let _stryke_type_checks_is_undefined = require("@stryke/type-checks/is-undefined");
|
|
8
8
|
|
|
@@ -18,15 +18,21 @@ function MarkdownTable(props) {
|
|
|
18
18
|
align: "left",
|
|
19
19
|
width: 20
|
|
20
20
|
})));
|
|
21
|
-
return
|
|
22
|
-
value
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(require_markdown_contexts_markdown_table.MarkdownTableContext.Provider, {
|
|
22
|
+
get value() {
|
|
23
|
+
return {
|
|
24
|
+
columns: columns.value,
|
|
25
|
+
data
|
|
26
|
+
};
|
|
25
27
|
},
|
|
26
|
-
children
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
get children() {
|
|
29
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
30
|
+
get when() {
|
|
31
|
+
return Boolean(children);
|
|
32
|
+
},
|
|
33
|
+
children
|
|
34
|
+
});
|
|
35
|
+
}
|
|
30
36
|
});
|
|
31
37
|
}
|
|
32
38
|
/**
|
|
@@ -47,32 +53,47 @@ function MarkdownTableColumn(props) {
|
|
|
47
53
|
const textLength = (0, _alloy_js_core.computed)(() => {
|
|
48
54
|
return (children ? children.toString() : "").length;
|
|
49
55
|
});
|
|
50
|
-
return
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Prose, { get children() {
|
|
57
|
+
return [
|
|
58
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
59
|
+
get when() {
|
|
60
|
+
return indexRef.value === 0;
|
|
61
|
+
},
|
|
62
|
+
children: "|"
|
|
63
|
+
}),
|
|
64
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
65
|
+
get when() {
|
|
66
|
+
return Boolean(children);
|
|
67
|
+
},
|
|
68
|
+
get children() {
|
|
69
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Prose, { get children() {
|
|
70
|
+
return _alloy_js_core.code`${alignRef.value === "left" ? " ".repeat(widthRef.value - textLength.value - 1) : " "}${children}${alignRef.value === "right" ? " ".repeat(widthRef.value - textLength.value - 1) : " "}`;
|
|
71
|
+
} });
|
|
72
|
+
}
|
|
73
|
+
}),
|
|
74
|
+
"|"
|
|
75
|
+
];
|
|
76
|
+
} });
|
|
61
77
|
}
|
|
62
78
|
/**
|
|
63
79
|
* Component that provides a context for rendering markdown tables.
|
|
64
80
|
*/
|
|
65
81
|
function MarkdownTableColumnHeader(props) {
|
|
66
82
|
const [{ children, name }, rest] = (0, _alloy_js_core.splitProps)(props, ["children", "name"]);
|
|
67
|
-
return
|
|
68
|
-
...rest,
|
|
83
|
+
return [(0, _alloy_js_core_jsx_runtime.createComponent)(MarkdownTableColumn, (0, _alloy_js_core_jsx_runtime.mergeProps)(rest, {
|
|
69
84
|
name,
|
|
70
|
-
children
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
85
|
+
get children() {
|
|
86
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
87
|
+
get fallback() {
|
|
88
|
+
return (0, _stryke_string_format_title_case.titleCase)(name, { useDescriptions: false });
|
|
89
|
+
},
|
|
90
|
+
get when() {
|
|
91
|
+
return !(0, _stryke_type_checks_is_undefined.isUndefined)(children);
|
|
92
|
+
},
|
|
93
|
+
children
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
}))];
|
|
76
97
|
}
|
|
77
98
|
|
|
78
99
|
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MarkdownTableContext, useMarkdownTable } from "../contexts/markdown-table.mjs";
|
|
2
|
+
import { createComponent, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
2
3
|
import { Prose, Show, code, computed, splitProps } from "@alloy-js/core";
|
|
3
|
-
import { Fragment, jsx, jsxs } from "@alloy-js/core/jsx-runtime";
|
|
4
4
|
import { titleCase } from "@stryke/string-format/title-case";
|
|
5
5
|
import { isUndefined } from "@stryke/type-checks/is-undefined";
|
|
6
6
|
|
|
@@ -16,15 +16,21 @@ function MarkdownTable(props) {
|
|
|
16
16
|
align: "left",
|
|
17
17
|
width: 20
|
|
18
18
|
})));
|
|
19
|
-
return
|
|
20
|
-
value
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
return createComponent(MarkdownTableContext.Provider, {
|
|
20
|
+
get value() {
|
|
21
|
+
return {
|
|
22
|
+
columns: columns.value,
|
|
23
|
+
data
|
|
24
|
+
};
|
|
23
25
|
},
|
|
24
|
-
children
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
get children() {
|
|
27
|
+
return createComponent(Show, {
|
|
28
|
+
get when() {
|
|
29
|
+
return Boolean(children);
|
|
30
|
+
},
|
|
31
|
+
children
|
|
32
|
+
});
|
|
33
|
+
}
|
|
28
34
|
});
|
|
29
35
|
}
|
|
30
36
|
/**
|
|
@@ -45,32 +51,47 @@ function MarkdownTableColumn(props) {
|
|
|
45
51
|
const textLength = computed(() => {
|
|
46
52
|
return (children ? children.toString() : "").length;
|
|
47
53
|
});
|
|
48
|
-
return
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
54
|
+
return createComponent(Prose, { get children() {
|
|
55
|
+
return [
|
|
56
|
+
createComponent(Show, {
|
|
57
|
+
get when() {
|
|
58
|
+
return indexRef.value === 0;
|
|
59
|
+
},
|
|
60
|
+
children: "|"
|
|
61
|
+
}),
|
|
62
|
+
createComponent(Show, {
|
|
63
|
+
get when() {
|
|
64
|
+
return Boolean(children);
|
|
65
|
+
},
|
|
66
|
+
get children() {
|
|
67
|
+
return createComponent(Prose, { get children() {
|
|
68
|
+
return code`${alignRef.value === "left" ? " ".repeat(widthRef.value - textLength.value - 1) : " "}${children}${alignRef.value === "right" ? " ".repeat(widthRef.value - textLength.value - 1) : " "}`;
|
|
69
|
+
} });
|
|
70
|
+
}
|
|
71
|
+
}),
|
|
72
|
+
"|"
|
|
73
|
+
];
|
|
74
|
+
} });
|
|
59
75
|
}
|
|
60
76
|
/**
|
|
61
77
|
* Component that provides a context for rendering markdown tables.
|
|
62
78
|
*/
|
|
63
79
|
function MarkdownTableColumnHeader(props) {
|
|
64
80
|
const [{ children, name }, rest] = splitProps(props, ["children", "name"]);
|
|
65
|
-
return
|
|
66
|
-
...rest,
|
|
81
|
+
return [createComponent(MarkdownTableColumn, mergeProps(rest, {
|
|
67
82
|
name,
|
|
68
|
-
children
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
83
|
+
get children() {
|
|
84
|
+
return createComponent(Show, {
|
|
85
|
+
get fallback() {
|
|
86
|
+
return titleCase(name, { useDescriptions: false });
|
|
87
|
+
},
|
|
88
|
+
get when() {
|
|
89
|
+
return !isUndefined(children);
|
|
90
|
+
},
|
|
91
|
+
children
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
}))];
|
|
74
95
|
}
|
|
75
96
|
|
|
76
97
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown-table.mjs","names":[],"sources":["../../../src/markdown/components/markdown-table.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 { code, computed, Prose, Show, splitProps } from \"@alloy-js/core\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\nimport { ComponentProps } from \"../../types/components\";\nimport {\n MarkdownTableColumnContextInterface,\n MarkdownTableContext,\n useMarkdownTable\n} from \"../contexts/markdown-table\";\n\nexport interface MarkdownTableProps<\n T extends Record<string, any> = Record<string, any>\n> extends ComponentProps {\n data: T[];\n}\n\n/**\n * Component that provides a context for rendering markdown tables.\n */\nexport function MarkdownTable<\n T extends Record<string, any> = Record<string, any>\n>(props: MarkdownTableProps<T>) {\n const [{ children, data }] = splitProps(props, [\"children\", \"data\"]);\n\n const columns = computed(() =>\n Object.keys(data).map((name: string, index: number) => ({\n index,\n name,\n align: \"left\" as const,\n width: 20\n }))\n );\n\n return (\n <MarkdownTableContext.Provider value={{ columns: columns.value, data }}>\n <Show when={Boolean(children)}>{children}</Show>\n </MarkdownTableContext.Provider>\n );\n}\n\nexport type MarkdownTableColumnProps = ComponentProps &\n Partial<Pick<MarkdownTableColumnContextInterface, \"align\">> &\n Required<Pick<MarkdownTableColumnContextInterface, \"name\">> & {\n width?: number;\n };\n\n/**\n * Component that provides a context for rendering markdown tables.\n */\nexport function MarkdownTableColumn(props: MarkdownTableColumnProps) {\n const [{ children, width, align, name }] = splitProps(props, [\n \"children\",\n \"width\",\n \"align\",\n \"name\"\n ]);\n\n const tableContext = useMarkdownTable();\n const columnRef = computed(() =>\n tableContext?.columns.find(c => c.name === name)\n );\n\n const indexRef = computed(() => columnRef.value?.index ?? 0);\n const alignRef = computed(() => columnRef.value?.align ?? align ?? \"left\");\n const widthRef = computed(() => columnRef.value?.width ?? width ?? 20);\n\n const textLength = computed(() => {\n const content = children ? children.toString() : \"\";\n\n return content.length;\n });\n\n return (\n <Prose>\n <Show when={indexRef.value === 0}>{\"|\"}</Show>\n <Show when={Boolean(children)}>\n <Prose>{code`${\n alignRef.value === \"left\"\n ? \" \".repeat(widthRef.value - textLength.value - 1)\n : \" \"\n }${children}${\n alignRef.value === \"right\"\n ? \" \".repeat(widthRef.value - textLength.value - 1)\n : \" \"\n }`}</Prose>\n </Show>\n {\"|\"}\n </Prose>\n );\n}\n\n/**\n * Component that provides a context for rendering markdown tables.\n */\nexport function MarkdownTableColumnHeader(props: MarkdownTableColumnProps) {\n const [{ children, name }, rest] = splitProps(props, [\"children\", \"name\"]);\n\n return (\n <>\n <MarkdownTableColumn {...rest} name={name}>\n <Show\n fallback={titleCase(name, {\n useDescriptions: false\n })}\n when={!isUndefined(children)}>\n {children}\n </Show>\n </MarkdownTableColumn>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"markdown-table.mjs","names":[],"sources":["../../../src/markdown/components/markdown-table.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 { code, computed, Prose, Show, splitProps } from \"@alloy-js/core\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\nimport { ComponentProps } from \"../../types/components\";\nimport {\n MarkdownTableColumnContextInterface,\n MarkdownTableContext,\n useMarkdownTable\n} from \"../contexts/markdown-table\";\n\nexport interface MarkdownTableProps<\n T extends Record<string, any> = Record<string, any>\n> extends ComponentProps {\n data: T[];\n}\n\n/**\n * Component that provides a context for rendering markdown tables.\n */\nexport function MarkdownTable<\n T extends Record<string, any> = Record<string, any>\n>(props: MarkdownTableProps<T>) {\n const [{ children, data }] = splitProps(props, [\"children\", \"data\"]);\n\n const columns = computed(() =>\n Object.keys(data).map((name: string, index: number) => ({\n index,\n name,\n align: \"left\" as const,\n width: 20\n }))\n );\n\n return (\n <MarkdownTableContext.Provider value={{ columns: columns.value, data }}>\n <Show when={Boolean(children)}>{children}</Show>\n </MarkdownTableContext.Provider>\n );\n}\n\nexport type MarkdownTableColumnProps = ComponentProps &\n Partial<Pick<MarkdownTableColumnContextInterface, \"align\">> &\n Required<Pick<MarkdownTableColumnContextInterface, \"name\">> & {\n width?: number;\n };\n\n/**\n * Component that provides a context for rendering markdown tables.\n */\nexport function MarkdownTableColumn(props: MarkdownTableColumnProps) {\n const [{ children, width, align, name }] = splitProps(props, [\n \"children\",\n \"width\",\n \"align\",\n \"name\"\n ]);\n\n const tableContext = useMarkdownTable();\n const columnRef = computed(() =>\n tableContext?.columns.find(c => c.name === name)\n );\n\n const indexRef = computed(() => columnRef.value?.index ?? 0);\n const alignRef = computed(() => columnRef.value?.align ?? align ?? \"left\");\n const widthRef = computed(() => columnRef.value?.width ?? width ?? 20);\n\n const textLength = computed(() => {\n const content = children ? children.toString() : \"\";\n\n return content.length;\n });\n\n return (\n <Prose>\n <Show when={indexRef.value === 0}>{\"|\"}</Show>\n <Show when={Boolean(children)}>\n <Prose>{code`${\n alignRef.value === \"left\"\n ? \" \".repeat(widthRef.value - textLength.value - 1)\n : \" \"\n }${children}${\n alignRef.value === \"right\"\n ? \" \".repeat(widthRef.value - textLength.value - 1)\n : \" \"\n }`}</Prose>\n </Show>\n {\"|\"}\n </Prose>\n );\n}\n\n/**\n * Component that provides a context for rendering markdown tables.\n */\nexport function MarkdownTableColumnHeader(props: MarkdownTableColumnProps) {\n const [{ children, name }, rest] = splitProps(props, [\"children\", \"name\"]);\n\n return (\n <>\n <MarkdownTableColumn {...rest} name={name}>\n <Show\n fallback={titleCase(name, {\n useDescriptions: false\n })}\n when={!isUndefined(children)}>\n {children}\n </Show>\n </MarkdownTableColumn>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;AA+BA,SAAW,cAAA,OAAA;CACX,MAAA,CAAA,YAEE,UACC,WAAe,OAAA,CAAQ,YAAW,OAAI,CAAA;CACvC,MAAA,UAAA,eAAA,OAAA,KAAA,KAAA,CAAA,KAAA,MAAA,WAAA;EACF;EACI;EACF,OAAO;EACP,OAAS;;AAET,QAAM,gBAAmB,qBAAI,UAAA;EAC3B,IAAA,QAAY;AACV,UAAK;IACL,SAAI,QAAA;IACJ;IACA;;EAEH,IAAA,WAAA;;IAEK,IAAC,OAAA;AACJ,YAAA,QAAoB,SAAS;;IAE5B;IACH,CAAA;;;;;;;AAWH,SAAE,oBAAA,OAAA;CACF,MAAO,CAAA,EACL,UACE,OACA,OACA,UACC,WAAI,OAAA;EAAA;EAAA;EAAA;EAAA;EAAA,CAAA;CACP,MAAE,eAAA,kBAAA;;CAEF,MAAM,WAAA,eAAe,UAAkB,OAAA,SAAA,EAAA;CACvC,MAAM,WAAW,eAAc,UAAA,OAAA,SAAA,SAAA,OAAA;CAC/B,MAAE,WAAc,eAAgB,UAAU,OAAO,SAAA,SAAA,GAAA;CACjD,MAAC,aAAA,eAAA;AAED,+CAAiB;GACjB;AACA,QAAM,gBAAmB,OAAO;AAEhC,SAAM;GAAA,gBAAwB,MAAI;IAChC,IAAM,OAAS;;;IAGf,UAAA;;;IAEI,IAAC,OAAA;AACC,YAAA,QAAA,SAAA;;IAEH,IAAK,WAAM;AACT,YAAO,gBAAM,OAAA,EACZ,IAAA,WAAiB;AACb,aAAI,IAAO,GAAA,SAAS,UAAQ,SAAW,IAAO,OAAE,SAAA,QAAA,WAAA,QAAA,EAAA,GAAA,MAAA,WAAA,SAAA,UAAA,UAAA,IAAA,OAAA,SAAA,QAAA,WAAA,QAAA,EAAA,GAAA;QAEnD,CAAA;;IAEJ,CAAC;GAAE;GAAI;IAEX,CAAC;;;;;;CAOF,MAAA,CAAA,EACC,UACD,QACF,QAAO,WAAS,OAAA,CAAA,YAA0B,OAAO,CAAA;AAC/C,QAAO,CAAC,gBAAkB,qBAAoB,WAAS,MAAW;;EAElE,IAAM,WAAC;AACJ,UAAA,gBAAA,MAAA;IACE,IAAA,WAAA;AACE,YAAA,UAAA,MAAA,EACC,iBAAmB,OAClB,CAAC;;IAEJ,IAAE,OAAO;AACP,YAAC,CAAA,YAAQ,SAAA;;IAEX;IACF,CAAA;;EAEN,CAAA,CAAA,CAAA"}
|
package/dist/render.cjs
CHANGED
|
@@ -2,9 +2,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
2
2
|
const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
|
|
3
3
|
const require_core_components_output = require('./core/components/output.cjs');
|
|
4
4
|
require('./core/index.cjs');
|
|
5
|
-
let _alloy_js_core = require("@alloy-js/core");
|
|
6
5
|
let _stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
|
|
7
6
|
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
7
|
+
let _alloy_js_core = require("@alloy-js/core");
|
|
8
8
|
|
|
9
9
|
//#region src/render.tsx
|
|
10
10
|
/**
|
|
@@ -23,7 +23,7 @@ let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
|
23
23
|
*/
|
|
24
24
|
async function render(context, children) {
|
|
25
25
|
const meta = {};
|
|
26
|
-
const output = await (0, _alloy_js_core.renderAsync)(
|
|
26
|
+
const output = await (0, _alloy_js_core.renderAsync)((0, _alloy_js_core_jsx_runtime.createComponent)(require_core_components_output.Output, {
|
|
27
27
|
context,
|
|
28
28
|
meta,
|
|
29
29
|
children
|
|
@@ -80,7 +80,7 @@ async function render(context, children) {
|
|
|
80
80
|
* @returns The rendered output as a string.
|
|
81
81
|
*/
|
|
82
82
|
function renderString(context, children, options) {
|
|
83
|
-
return (0, _alloy_js_core.printTree)((0, _alloy_js_core.renderTree)(
|
|
83
|
+
return (0, _alloy_js_core.printTree)((0, _alloy_js_core.renderTree)((0, _alloy_js_core_jsx_runtime.createComponent)(require_core_components_output.Output, {
|
|
84
84
|
context,
|
|
85
85
|
children
|
|
86
86
|
})), options);
|