@powerlines/plugin-alloy 0.26.19 → 0.26.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/components/infrastructure-file.cjs +9 -14
- package/dist/core/components/infrastructure-file.mjs +9 -14
- package/dist/core/components/infrastructure-file.mjs.map +1 -1
- package/dist/core/components/output.cjs +10 -17
- package/dist/core/components/output.mjs +10 -17
- package/dist/core/components/output.mjs.map +1 -1
- package/dist/core/components/single-line-comment.cjs +4 -6
- package/dist/core/components/single-line-comment.mjs +4 -6
- package/dist/core/components/single-line-comment.mjs.map +1 -1
- package/dist/core/components/source-file.cjs +6 -10
- package/dist/core/components/source-file.mjs +6 -10
- package/dist/core/components/source-file.mjs.map +1 -1
- package/dist/core/components/spacing.cjs +4 -6
- package/dist/core/components/spacing.mjs +4 -6
- package/dist/core/components/spacing.mjs.map +1 -1
- package/dist/hcl/components/block-declaration.cjs +8 -12
- package/dist/hcl/components/block-declaration.mjs +8 -12
- package/dist/hcl/components/block-declaration.mjs.map +1 -1
- package/dist/hcl/components/hcl-file.cjs +21 -35
- package/dist/hcl/components/hcl-file.mjs +22 -36
- package/dist/hcl/components/hcl-file.mjs.map +1 -1
- package/dist/hcl/components/packer-file.cjs +8 -8
- package/dist/hcl/components/packer-file.mjs +8 -8
- package/dist/hcl/components/packer-file.mjs.map +1 -1
- package/dist/hcl/components/terraform-file.cjs +8 -8
- package/dist/hcl/components/terraform-file.mjs +8 -8
- package/dist/hcl/components/terraform-file.mjs.map +1 -1
- package/dist/helpers/capnp.cjs +1 -1
- package/dist/helpers/capnp.mjs +1 -1
- package/dist/helpers/capnp.mjs.map +1 -1
- package/dist/index.cjs +7 -12
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +7 -11
- package/dist/index.mjs.map +1 -1
- package/dist/markdown/components/front-matter.cjs +7 -9
- package/dist/markdown/components/front-matter.mjs +7 -9
- package/dist/markdown/components/front-matter.mjs.map +1 -1
- package/dist/markdown/components/markdown-file.cjs +44 -76
- package/dist/markdown/components/markdown-file.mjs +44 -76
- package/dist/markdown/components/markdown-file.mjs.map +1 -1
- package/dist/markdown/components/markdown-table.cjs +28 -49
- package/dist/markdown/components/markdown-table.mjs +28 -49
- package/dist/markdown/components/markdown-table.mjs.map +1 -1
- package/dist/markdown/contexts/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 +20 -30
- package/dist/typescript/components/builtin-file.mjs +20 -30
- package/dist/typescript/components/builtin-file.mjs.map +1 -1
- package/dist/typescript/components/class-declaration.cjs +100 -165
- package/dist/typescript/components/class-declaration.mjs +100 -165
- package/dist/typescript/components/class-declaration.mjs.map +1 -1
- package/dist/typescript/components/dynamic-import-statement.cjs +6 -2
- package/dist/typescript/components/dynamic-import-statement.mjs +6 -2
- package/dist/typescript/components/dynamic-import-statement.mjs.map +1 -1
- package/dist/typescript/components/entry-file.cjs +8 -11
- package/dist/typescript/components/entry-file.mjs +8 -11
- package/dist/typescript/components/entry-file.mjs.map +1 -1
- package/dist/typescript/components/interface-declaration.cjs +74 -127
- package/dist/typescript/components/interface-declaration.mjs +74 -127
- package/dist/typescript/components/interface-declaration.mjs.map +1 -1
- package/dist/typescript/components/object-declaration.cjs +50 -84
- package/dist/typescript/components/object-declaration.mjs +50 -84
- 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 +108 -241
- package/dist/typescript/components/tsdoc-reflection.mjs +108 -241
- package/dist/typescript/components/tsdoc-reflection.mjs.map +1 -1
- package/dist/typescript/components/tsdoc.cjs +168 -265
- package/dist/typescript/components/tsdoc.mjs +168 -265
- package/dist/typescript/components/tsdoc.mjs.map +1 -1
- package/dist/typescript/components/type-declaration.cjs +15 -20
- package/dist/typescript/components/type-declaration.mjs +15 -20
- package/dist/typescript/components/type-declaration.mjs.map +1 -1
- package/dist/typescript/components/type-parameters.cjs +29 -55
- package/dist/typescript/components/type-parameters.mjs +29 -55
- package/dist/typescript/components/type-parameters.mjs.map +1 -1
- package/dist/typescript/components/typescript-file.cjs +74 -135
- package/dist/typescript/components/typescript-file.mjs +74 -135
- package/dist/typescript/components/typescript-file.mjs.map +1 -1
- package/dist/typescript/contexts/lexical-scope.cjs +3 -5
- package/dist/typescript/contexts/lexical-scope.mjs +3 -5
- package/dist/typescript/contexts/lexical-scope.mjs.map +1 -1
- package/dist/typescript/contexts/member-scope.cjs +3 -5
- package/dist/typescript/contexts/member-scope.mjs +3 -5
- package/dist/typescript/contexts/member-scope.mjs.map +1 -1
- package/dist/yaml/components/yaml-file.cjs +47 -92
- package/dist/yaml/components/yaml-file.mjs +47 -92
- package/dist/yaml/components/yaml-file.mjs.map +1 -1
- package/package.json +6 -6
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createComponent, createIntrinsic } from "@alloy-js/core/jsx-runtime";
|
|
2
1
|
import { For, code } from "@alloy-js/core";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "@alloy-js/core/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/markdown/components/front-matter.tsx
|
|
5
5
|
/**
|
|
@@ -8,19 +8,17 @@ import { For, code } from "@alloy-js/core";
|
|
|
8
8
|
* @see https://jekyllrb.com/docs/front-matter/
|
|
9
9
|
*/
|
|
10
10
|
function FrontMatter(props) {
|
|
11
|
-
return [
|
|
11
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
12
12
|
"---",
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return Object.entries(props.data);
|
|
17
|
-
},
|
|
13
|
+
/* @__PURE__ */ jsx("hbr", {}),
|
|
14
|
+
/* @__PURE__ */ jsx(For, {
|
|
15
|
+
each: Object.entries(props.data),
|
|
18
16
|
hardline: true,
|
|
19
17
|
children: ([key, value]) => code`${key}: ${JSON.stringify(value)}`
|
|
20
18
|
}),
|
|
21
19
|
"---",
|
|
22
|
-
|
|
23
|
-
];
|
|
20
|
+
/* @__PURE__ */ jsx("hbr", {})
|
|
21
|
+
] });
|
|
24
22
|
}
|
|
25
23
|
|
|
26
24
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"front-matter.mjs","names":[],"sources":["../../../src/markdown/components/front-matter.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, For } from \"@alloy-js/core\";\n\nexport interface FrontMatterProps {\n data: Record<string, any>;\n}\n\n/**\n * Renders YAML front matter for a markdown file.\n *\n * @see https://jekyllrb.com/docs/front-matter/\n */\nexport function FrontMatter(props: FrontMatterProps) {\n return (\n <>\n {\"---\"}\n <hbr />\n <For each={Object.entries(props.data)} hardline>\n {([key, value]) => code`${key}: ${JSON.stringify(value)}`}\n </For>\n {\"---\"}\n <hbr />\n </>\n );\n}\n"],"mappings":";;;;;;;;;AA6BA,SAAgB,YAAY,OAAyB;AACnD,
|
|
1
|
+
{"version":3,"file":"front-matter.mjs","names":[],"sources":["../../../src/markdown/components/front-matter.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, For } from \"@alloy-js/core\";\n\nexport interface FrontMatterProps {\n data: Record<string, any>;\n}\n\n/**\n * Renders YAML front matter for a markdown file.\n *\n * @see https://jekyllrb.com/docs/front-matter/\n */\nexport function FrontMatter(props: FrontMatterProps) {\n return (\n <>\n {\"---\"}\n <hbr />\n <For each={Object.entries(props.data)} hardline>\n {([key, value]) => code`${key}: ${JSON.stringify(value)}`}\n </For>\n {\"---\"}\n <hbr />\n </>\n );\n}\n"],"mappings":";;;;;;;;;AA6BA,SAAgB,YAAY,OAAyB;AACnD,QACE;EACG;EACD,oBAAC,OAAD,EAAO;EACP,oBAAC,KAAD;GAAK,MAAM,OAAO,QAAQ,MAAM,KAAK;GAAE;cACnC,CAAC,KAAK,WAAW,IAAI,GAAG,IAAI,IAAI,KAAK,UAAU,MAAM;GACnD;EACL;EACD,oBAAC,OAAD,EAAO;EACN"}
|
|
@@ -4,8 +4,8 @@ const require_core_contexts_context = require('../../core/contexts/context.cjs')
|
|
|
4
4
|
const require_core_components_source_file = require('../../core/components/source-file.cjs');
|
|
5
5
|
const require_core_components_single_line_comment = require('../../core/components/single-line-comment.cjs');
|
|
6
6
|
const require_markdown_components_front_matter = require('./front-matter.cjs');
|
|
7
|
-
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
8
7
|
let _alloy_js_core = require("@alloy-js/core");
|
|
8
|
+
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
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,21 +24,17 @@ function MarkdownFile(props) {
|
|
|
24
24
|
"storage",
|
|
25
25
|
"frontMatter"
|
|
26
26
|
]);
|
|
27
|
-
return (0, _alloy_js_core_jsx_runtime.
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_core_components_source_file.SourceFile, {
|
|
28
|
+
header: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(MarkdownFileHeader, { frontMatter }),
|
|
29
|
+
...rest,
|
|
30
30
|
filetype: "md",
|
|
31
31
|
reference: _alloy_js_markdown.Link,
|
|
32
32
|
storage,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
children
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
}));
|
|
33
|
+
children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
|
|
34
|
+
when: Boolean(children),
|
|
35
|
+
children
|
|
36
|
+
})
|
|
37
|
+
});
|
|
42
38
|
}
|
|
43
39
|
/**
|
|
44
40
|
* Renders the header for a Powerlines Typescript source file.
|
|
@@ -55,79 +51,51 @@ function MarkdownFileHeader(props) {
|
|
|
55
51
|
"frontMatter"
|
|
56
52
|
]);
|
|
57
53
|
const context = require_core_contexts_context.usePowerlinesSafe();
|
|
58
|
-
return [
|
|
59
|
-
(0, _alloy_js_core_jsx_runtime.
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
},
|
|
63
|
-
get children() {
|
|
64
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(require_markdown_components_front_matter.FrontMatter, { data: frontMatter });
|
|
65
|
-
}
|
|
54
|
+
return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core_jsx_runtime.Fragment, { children: [
|
|
55
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
|
|
56
|
+
when: (0, _stryke_type_checks.isSetObject)(frontMatter) && Object.keys(frontMatter).length > 0,
|
|
57
|
+
children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_markdown_components_front_matter.FrontMatter, { data: frontMatter })
|
|
66
58
|
}),
|
|
67
|
-
(0, _alloy_js_core_jsx_runtime.
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
variant: "markdown",
|
|
74
|
-
children: "eslint-disable"
|
|
75
|
-
}), (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
|
|
76
|
-
}
|
|
59
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core.Show, {
|
|
60
|
+
when: Boolean(disableEslint),
|
|
61
|
+
children: [/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_core_components_single_line_comment.SingleLineComment, {
|
|
62
|
+
variant: "markdown",
|
|
63
|
+
children: "eslint-disable"
|
|
64
|
+
}), /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {})]
|
|
77
65
|
}),
|
|
78
|
-
(0, _alloy_js_core_jsx_runtime.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
variant: "markdown",
|
|
85
|
-
children: "prettier-ignore"
|
|
86
|
-
}), (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
|
|
87
|
-
}
|
|
66
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core.Show, {
|
|
67
|
+
when: Boolean(disablePrettier),
|
|
68
|
+
children: [/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_core_components_single_line_comment.SingleLineComment, {
|
|
69
|
+
variant: "markdown",
|
|
70
|
+
children: "prettier-ignore"
|
|
71
|
+
}), /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {})]
|
|
88
72
|
}),
|
|
89
|
-
(0, _alloy_js_core_jsx_runtime.
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
variant: "markdown",
|
|
96
|
-
children: "biome-ignore lint: disable"
|
|
97
|
-
}), (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
|
|
98
|
-
}
|
|
73
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core.Show, {
|
|
74
|
+
when: Boolean(disableBiome),
|
|
75
|
+
children: [/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_core_components_single_line_comment.SingleLineComment, {
|
|
76
|
+
variant: "markdown",
|
|
77
|
+
children: "biome-ignore lint: disable"
|
|
78
|
+
}), /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {})]
|
|
99
79
|
}),
|
|
100
|
-
(0, _alloy_js_core_jsx_runtime.
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
},
|
|
104
|
-
get children() {
|
|
105
|
-
return (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {});
|
|
106
|
-
}
|
|
80
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
|
|
81
|
+
when: Boolean(disableEslint) || Boolean(disablePrettier) || Boolean(disableBiome),
|
|
82
|
+
children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {})
|
|
107
83
|
}),
|
|
108
|
-
(0, _alloy_js_core_jsx_runtime.
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
},
|
|
112
|
-
get children() {
|
|
113
|
-
return [children, (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
|
|
114
|
-
}
|
|
84
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
|
|
85
|
+
when: Boolean(children),
|
|
86
|
+
children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core_jsx_runtime.Fragment, { children: [children, /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {})] })
|
|
115
87
|
}),
|
|
116
|
-
(0, _alloy_js_core_jsx_runtime.
|
|
88
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_core_components_single_line_comment.SingleLineComment, {
|
|
117
89
|
variant: "markdown",
|
|
118
|
-
|
|
119
|
-
return `Generated by ${(0, _stryke_string_format_title_case.titleCase)(context?.config?.framework) || "Powerlines"}`;
|
|
120
|
-
}
|
|
90
|
+
children: `Generated by ${(0, _stryke_string_format_title_case.titleCase)(context?.config?.framework) || "Powerlines"}`
|
|
121
91
|
}),
|
|
122
|
-
(0, _alloy_js_core_jsx_runtime.
|
|
123
|
-
(0, _alloy_js_core_jsx_runtime.
|
|
92
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {}),
|
|
93
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_core_components_single_line_comment.SingleLineComment, {
|
|
124
94
|
variant: "markdown",
|
|
125
|
-
|
|
126
|
-
return (0, powerlines_utils.getFileHeaderWarning)(context);
|
|
127
|
-
}
|
|
95
|
+
children: (0, powerlines_utils.getFileHeaderWarning)(context)
|
|
128
96
|
}),
|
|
129
|
-
(0, _alloy_js_core_jsx_runtime.
|
|
130
|
-
];
|
|
97
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {})
|
|
98
|
+
] });
|
|
131
99
|
}
|
|
132
100
|
|
|
133
101
|
//#endregion
|
|
@@ -2,8 +2,8 @@ import { usePowerlinesSafe } from "../../core/contexts/context.mjs";
|
|
|
2
2
|
import { SourceFile } from "../../core/components/source-file.mjs";
|
|
3
3
|
import { SingleLineComment } from "../../core/components/single-line-comment.mjs";
|
|
4
4
|
import { FrontMatter } from "./front-matter.mjs";
|
|
5
|
-
import { createComponent, createIntrinsic, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
6
5
|
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,21 +22,17 @@ function MarkdownFile(props) {
|
|
|
22
22
|
"storage",
|
|
23
23
|
"frontMatter"
|
|
24
24
|
]);
|
|
25
|
-
return
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
return /* @__PURE__ */ jsx(SourceFile, {
|
|
26
|
+
header: /* @__PURE__ */ jsx(MarkdownFileHeader, { frontMatter }),
|
|
27
|
+
...rest,
|
|
28
28
|
filetype: "md",
|
|
29
29
|
reference: Link,
|
|
30
30
|
storage,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
children
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
}));
|
|
31
|
+
children: /* @__PURE__ */ jsx(Show, {
|
|
32
|
+
when: Boolean(children),
|
|
33
|
+
children
|
|
34
|
+
})
|
|
35
|
+
});
|
|
40
36
|
}
|
|
41
37
|
/**
|
|
42
38
|
* Renders the header for a Powerlines Typescript source file.
|
|
@@ -53,79 +49,51 @@ function MarkdownFileHeader(props) {
|
|
|
53
49
|
"frontMatter"
|
|
54
50
|
]);
|
|
55
51
|
const context = usePowerlinesSafe();
|
|
56
|
-
return [
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
},
|
|
61
|
-
get children() {
|
|
62
|
-
return createComponent(FrontMatter, { data: frontMatter });
|
|
63
|
-
}
|
|
52
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
53
|
+
/* @__PURE__ */ jsx(Show, {
|
|
54
|
+
when: isSetObject(frontMatter) && Object.keys(frontMatter).length > 0,
|
|
55
|
+
children: /* @__PURE__ */ jsx(FrontMatter, { data: frontMatter })
|
|
64
56
|
}),
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
variant: "markdown",
|
|
72
|
-
children: "eslint-disable"
|
|
73
|
-
}), createIntrinsic("hbr", {})];
|
|
74
|
-
}
|
|
57
|
+
/* @__PURE__ */ jsxs(Show, {
|
|
58
|
+
when: Boolean(disableEslint),
|
|
59
|
+
children: [/* @__PURE__ */ jsx(SingleLineComment, {
|
|
60
|
+
variant: "markdown",
|
|
61
|
+
children: "eslint-disable"
|
|
62
|
+
}), /* @__PURE__ */ jsx("hbr", {})]
|
|
75
63
|
}),
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
variant: "markdown",
|
|
83
|
-
children: "prettier-ignore"
|
|
84
|
-
}), createIntrinsic("hbr", {})];
|
|
85
|
-
}
|
|
64
|
+
/* @__PURE__ */ jsxs(Show, {
|
|
65
|
+
when: Boolean(disablePrettier),
|
|
66
|
+
children: [/* @__PURE__ */ jsx(SingleLineComment, {
|
|
67
|
+
variant: "markdown",
|
|
68
|
+
children: "prettier-ignore"
|
|
69
|
+
}), /* @__PURE__ */ jsx("hbr", {})]
|
|
86
70
|
}),
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
variant: "markdown",
|
|
94
|
-
children: "biome-ignore lint: disable"
|
|
95
|
-
}), createIntrinsic("hbr", {})];
|
|
96
|
-
}
|
|
71
|
+
/* @__PURE__ */ jsxs(Show, {
|
|
72
|
+
when: Boolean(disableBiome),
|
|
73
|
+
children: [/* @__PURE__ */ jsx(SingleLineComment, {
|
|
74
|
+
variant: "markdown",
|
|
75
|
+
children: "biome-ignore lint: disable"
|
|
76
|
+
}), /* @__PURE__ */ jsx("hbr", {})]
|
|
97
77
|
}),
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
},
|
|
102
|
-
get children() {
|
|
103
|
-
return createIntrinsic("hbr", {});
|
|
104
|
-
}
|
|
78
|
+
/* @__PURE__ */ jsx(Show, {
|
|
79
|
+
when: Boolean(disableEslint) || Boolean(disablePrettier) || Boolean(disableBiome),
|
|
80
|
+
children: /* @__PURE__ */ jsx("hbr", {})
|
|
105
81
|
}),
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
},
|
|
110
|
-
get children() {
|
|
111
|
-
return [children, createIntrinsic("hbr", {})];
|
|
112
|
-
}
|
|
82
|
+
/* @__PURE__ */ jsx(Show, {
|
|
83
|
+
when: Boolean(children),
|
|
84
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [children, /* @__PURE__ */ jsx("hbr", {})] })
|
|
113
85
|
}),
|
|
114
|
-
|
|
86
|
+
/* @__PURE__ */ jsx(SingleLineComment, {
|
|
115
87
|
variant: "markdown",
|
|
116
|
-
|
|
117
|
-
return `Generated by ${titleCase(context?.config?.framework) || "Powerlines"}`;
|
|
118
|
-
}
|
|
88
|
+
children: `Generated by ${titleCase(context?.config?.framework) || "Powerlines"}`
|
|
119
89
|
}),
|
|
120
|
-
|
|
121
|
-
|
|
90
|
+
/* @__PURE__ */ jsx("hbr", {}),
|
|
91
|
+
/* @__PURE__ */ jsx(SingleLineComment, {
|
|
122
92
|
variant: "markdown",
|
|
123
|
-
|
|
124
|
-
return getFileHeaderWarning(context);
|
|
125
|
-
}
|
|
93
|
+
children: getFileHeaderWarning(context)
|
|
126
94
|
}),
|
|
127
|
-
|
|
128
|
-
];
|
|
95
|
+
/* @__PURE__ */ jsx("hbr", {})
|
|
96
|
+
] });
|
|
129
97
|
}
|
|
130
98
|
|
|
131
99
|
//#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":";;;;;;;;;;;;;;;;;;AAuCA,SAAgB,aAAa,OAA0B;CACrD,MAAM,CAAC,EAAE,UAAU,SAAS,eAAe,QAAQ,WAAW,OAAO;EACnE;EACA;EACA;EACD,CAAC;AAEF,QACE,oBAAC,YAAD;EACE,QAAQ,oBAAC,oBAAD,EAAiC,aAAe;EACxD,GAAI;EACJ,UAAS;EACT,WAAW;EACF;YACT,oBAAC,MAAD;GAAM,MAAM,QAAQ,SAAS;GAAG;GAAgB;EACrC;;;;;;;;AAcjB,SAAgB,mBAAmB,OAAgC;CACjE,MAAM,CACJ,EACE,UACA,gBAAgB,MAChB,eAAe,MACf,kBAAkB,OAClB,iBAEA,WAAW,OAAO;EACpB;EACA;EACA;EACA;EACA;EACD,CAAC;CAEF,MAAM,UAAU,mBAAmB;AAEnC,QACE;EACE,oBAAC,MAAD;GACE,MAAM,YAAY,YAAY,IAAI,OAAO,KAAK,YAAY,CAAC,SAAS;aACpE,oBAAC,aAAD,EAAa,MAAM,aAAgB;GAC9B;EACP,qBAAC,MAAD;GAAM,MAAM,QAAQ,cAAc;aAAlC,CACE,oBAAC,mBAAD;IAAmB,SAAQ;cACxB;IACiB,GACpB,oBAAC,OAAD,EAAO,EACF;;EACP,qBAAC,MAAD;GAAM,MAAM,QAAQ,gBAAgB;aAApC,CACE,oBAAC,mBAAD;IAAmB,SAAQ;cACxB;IACiB,GACpB,oBAAC,OAAD,EAAO,EACF;;EACP,qBAAC,MAAD;GAAM,MAAM,QAAQ,aAAa;aAAjC,CACE,oBAAC,mBAAD;IAAmB,SAAQ;cACxB;IACiB,GACpB,oBAAC,OAAD,EAAO,EACF;;EACP,oBAAC,MAAD;GACE,MACE,QAAQ,cAAc,IACtB,QAAQ,gBAAgB,IACxB,QAAQ,aAAa;aAEvB,oBAAC,OAAD,EAAO;GACF;EACP,oBAAC,MAAD;GAAM,MAAM,QAAQ,SAAS;aAC3B,4CACG,UACD,oBAAC,OAAD,EAAO,EACN;GACE;EACP,oBAAC,mBAAD;GAAmB,SAAQ;aAAY,gBACrC,UAAU,SAAS,QAAQ,UAAU,IAAI;GACpB;EACvB,oBAAC,OAAD,EAAO;EACP,oBAAC,mBAAD;GAAmB,SAAQ;aACxB,qBAAqB,QAAS;GACb;EACpB,oBAAC,OAAD,EAAO;EACN"}
|
|
@@ -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_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
5
4
|
let _alloy_js_core = require("@alloy-js/core");
|
|
5
|
+
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
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,21 +18,15 @@ function MarkdownTable(props) {
|
|
|
18
18
|
align: "left",
|
|
19
19
|
width: 20
|
|
20
20
|
})));
|
|
21
|
-
return (0, _alloy_js_core_jsx_runtime.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
data
|
|
26
|
-
};
|
|
21
|
+
return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_markdown_contexts_markdown_table.MarkdownTableContext.Provider, {
|
|
22
|
+
value: {
|
|
23
|
+
columns: columns.value,
|
|
24
|
+
data
|
|
27
25
|
},
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
},
|
|
33
|
-
children
|
|
34
|
-
});
|
|
35
|
-
}
|
|
26
|
+
children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
|
|
27
|
+
when: Boolean(children),
|
|
28
|
+
children
|
|
29
|
+
})
|
|
36
30
|
});
|
|
37
31
|
}
|
|
38
32
|
/**
|
|
@@ -53,47 +47,32 @@ function MarkdownTableColumn(props) {
|
|
|
53
47
|
const textLength = (0, _alloy_js_core.computed)(() => {
|
|
54
48
|
return (children ? children.toString() : "").length;
|
|
55
49
|
});
|
|
56
|
-
return (0, _alloy_js_core_jsx_runtime.
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
})
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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
|
-
} });
|
|
50
|
+
return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core.Prose, { children: [
|
|
51
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
|
|
52
|
+
when: indexRef.value === 0,
|
|
53
|
+
children: "|"
|
|
54
|
+
}),
|
|
55
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
|
|
56
|
+
when: Boolean(children),
|
|
57
|
+
children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Prose, { children: _alloy_js_core.code`${alignRef.value === "left" ? " ".repeat(widthRef.value - textLength.value - 1) : " "}${children}${alignRef.value === "right" ? " ".repeat(widthRef.value - textLength.value - 1) : " "}` })
|
|
58
|
+
}),
|
|
59
|
+
"|"
|
|
60
|
+
] });
|
|
77
61
|
}
|
|
78
62
|
/**
|
|
79
63
|
* Component that provides a context for rendering markdown tables.
|
|
80
64
|
*/
|
|
81
65
|
function MarkdownTableColumnHeader(props) {
|
|
82
66
|
const [{ children, name }, rest] = (0, _alloy_js_core.splitProps)(props, ["children", "name"]);
|
|
83
|
-
return
|
|
67
|
+
return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(MarkdownTableColumn, {
|
|
68
|
+
...rest,
|
|
84
69
|
name,
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
return !(0, _stryke_type_checks_is_undefined.isUndefined)(children);
|
|
92
|
-
},
|
|
93
|
-
children
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
}))];
|
|
70
|
+
children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
|
|
71
|
+
fallback: (0, _stryke_string_format_title_case.titleCase)(name, { useDescriptions: false }),
|
|
72
|
+
when: !(0, _stryke_type_checks_is_undefined.isUndefined)(children),
|
|
73
|
+
children
|
|
74
|
+
})
|
|
75
|
+
}) });
|
|
97
76
|
}
|
|
98
77
|
|
|
99
78
|
//#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";
|
|
3
2
|
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,21 +16,15 @@ function MarkdownTable(props) {
|
|
|
16
16
|
align: "left",
|
|
17
17
|
width: 20
|
|
18
18
|
})));
|
|
19
|
-
return
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
data
|
|
24
|
-
};
|
|
19
|
+
return /* @__PURE__ */ jsx(MarkdownTableContext.Provider, {
|
|
20
|
+
value: {
|
|
21
|
+
columns: columns.value,
|
|
22
|
+
data
|
|
25
23
|
},
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
children
|
|
32
|
-
});
|
|
33
|
-
}
|
|
24
|
+
children: /* @__PURE__ */ jsx(Show, {
|
|
25
|
+
when: Boolean(children),
|
|
26
|
+
children
|
|
27
|
+
})
|
|
34
28
|
});
|
|
35
29
|
}
|
|
36
30
|
/**
|
|
@@ -51,47 +45,32 @@ function MarkdownTableColumn(props) {
|
|
|
51
45
|
const textLength = computed(() => {
|
|
52
46
|
return (children ? children.toString() : "").length;
|
|
53
47
|
});
|
|
54
|
-
return
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
})
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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
|
-
} });
|
|
48
|
+
return /* @__PURE__ */ jsxs(Prose, { children: [
|
|
49
|
+
/* @__PURE__ */ jsx(Show, {
|
|
50
|
+
when: indexRef.value === 0,
|
|
51
|
+
children: "|"
|
|
52
|
+
}),
|
|
53
|
+
/* @__PURE__ */ jsx(Show, {
|
|
54
|
+
when: Boolean(children),
|
|
55
|
+
children: /* @__PURE__ */ jsx(Prose, { children: code`${alignRef.value === "left" ? " ".repeat(widthRef.value - textLength.value - 1) : " "}${children}${alignRef.value === "right" ? " ".repeat(widthRef.value - textLength.value - 1) : " "}` })
|
|
56
|
+
}),
|
|
57
|
+
"|"
|
|
58
|
+
] });
|
|
75
59
|
}
|
|
76
60
|
/**
|
|
77
61
|
* Component that provides a context for rendering markdown tables.
|
|
78
62
|
*/
|
|
79
63
|
function MarkdownTableColumnHeader(props) {
|
|
80
64
|
const [{ children, name }, rest] = splitProps(props, ["children", "name"]);
|
|
81
|
-
return
|
|
65
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(MarkdownTableColumn, {
|
|
66
|
+
...rest,
|
|
82
67
|
name,
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
return !isUndefined(children);
|
|
90
|
-
},
|
|
91
|
-
children
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
}))];
|
|
68
|
+
children: /* @__PURE__ */ jsx(Show, {
|
|
69
|
+
fallback: titleCase(name, { useDescriptions: false }),
|
|
70
|
+
when: !isUndefined(children),
|
|
71
|
+
children
|
|
72
|
+
})
|
|
73
|
+
}) });
|
|
95
74
|
}
|
|
96
75
|
|
|
97
76
|
//#endregion
|