@powerlines/plugin-alloy 0.14.0
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/LICENSE +201 -0
- package/README.md +304 -0
- package/dist/builtin-file-BU93ve2k.d.cts +34 -0
- package/dist/builtin-file-CG53y-09.d.mts +34 -0
- package/dist/builtin-file-CkwxD4el.mjs +37 -0
- package/dist/builtin-file-DLVCgiye.cjs +43 -0
- package/dist/capnp-8yVLwAox.cjs +364 -0
- package/dist/capnp-CKLYTfgy.d.mts +87 -0
- package/dist/capnp-CNythuSw.mjs +267 -0
- package/dist/capnp-wJ2_HpAN.d.cts +87 -0
- package/dist/chunk-CbDLau6x.cjs +34 -0
- package/dist/components-B0A7LpQD.d.cts +142 -0
- package/dist/components-B2kXCrty.d.mts +142 -0
- package/dist/components-BOkkDhM9.cjs +0 -0
- package/dist/components-BXrpeD8J.cjs +0 -0
- package/dist/components-C3qpgLKV.mjs +1 -0
- package/dist/components-CBtEhH9k.mjs +1 -0
- package/dist/components-Cj5gaIV0.cjs +0 -0
- package/dist/components-HMVhsFQl.mjs +1 -0
- package/dist/components-I0ydtjfW.cjs +0 -0
- package/dist/components-ajocJcib.mjs +1 -0
- package/dist/context-BIduC1bB.cjs +44 -0
- package/dist/context-BO25KgR_.d.cts +1668 -0
- package/dist/context-CBG6Pv09.d.cts +26 -0
- package/dist/context-Cx38_mgI.mjs +26 -0
- package/dist/context-DzaJOnXh.d.mts +26 -0
- package/dist/context-GtZoIVx8.d.mts +1670 -0
- package/dist/contexts-BSRk0whx.cjs +0 -0
- package/dist/contexts-X44bRyOp.mjs +1 -0
- package/dist/contexts-XuEdvZdE.mjs +1 -0
- package/dist/contexts-uXFW3CIa.cjs +0 -0
- package/dist/core/components/index.cjs +9 -0
- package/dist/core/components/index.d.cts +7 -0
- package/dist/core/components/index.d.mts +7 -0
- package/dist/core/components/index.mjs +7 -0
- package/dist/core/components/output.cjs +4 -0
- package/dist/core/components/output.d.cts +3 -0
- package/dist/core/components/output.d.mts +3 -0
- package/dist/core/components/output.mjs +4 -0
- package/dist/core/components/single-line-comment.cjs +3 -0
- package/dist/core/components/single-line-comment.d.cts +4 -0
- package/dist/core/components/single-line-comment.d.mts +4 -0
- package/dist/core/components/single-line-comment.mjs +3 -0
- package/dist/core/components/source-file.cjs +3 -0
- package/dist/core/components/source-file.d.cts +4 -0
- package/dist/core/components/source-file.d.mts +4 -0
- package/dist/core/components/source-file.mjs +3 -0
- package/dist/core/contexts/context.cjs +5 -0
- package/dist/core/contexts/context.d.cts +3 -0
- package/dist/core/contexts/context.d.mts +3 -0
- package/dist/core/contexts/context.mjs +3 -0
- package/dist/core/contexts/index.cjs +15 -0
- package/dist/core/contexts/index.d.cts +6 -0
- package/dist/core/contexts/index.d.mts +6 -0
- package/dist/core/contexts/index.mjs +5 -0
- package/dist/core/contexts/reflection.cjs +10 -0
- package/dist/core/contexts/reflection.d.cts +4 -0
- package/dist/core/contexts/reflection.d.mts +4 -0
- package/dist/core/contexts/reflection.mjs +3 -0
- package/dist/core/index.cjs +23 -0
- package/dist/core/index.d.cts +11 -0
- package/dist/core/index.d.mts +11 -0
- package/dist/core/index.mjs +10 -0
- package/dist/core-B57eQAue.mjs +1 -0
- package/dist/core-DzEmU6tL.cjs +0 -0
- package/dist/create-builtin-Bpswa0ZT.d.cts +15 -0
- package/dist/create-builtin-CP9mN5P-.mjs +18 -0
- package/dist/create-builtin-_3GNADDt.cjs +24 -0
- package/dist/create-builtin-wEbNOWNw.d.mts +15 -0
- package/dist/dynamic-import-statement-BhY2a13r.d.cts +32 -0
- package/dist/dynamic-import-statement-DoTHSt57.mjs +28 -0
- package/dist/dynamic-import-statement-DyVWBclX.d.mts +32 -0
- package/dist/dynamic-import-statement-JVLyMPXr.cjs +34 -0
- package/dist/entry-file-B159R5XY.d.cts +27 -0
- package/dist/entry-file-BA75rAwb.cjs +41 -0
- package/dist/entry-file-Bw1mgMP3.mjs +34 -0
- package/dist/entry-file-DfFhEkLi.d.mts +27 -0
- package/dist/helpers/capnp.cjs +19 -0
- package/dist/helpers/capnp.d.cts +3 -0
- package/dist/helpers/capnp.d.mts +3 -0
- package/dist/helpers/capnp.mjs +4 -0
- package/dist/helpers/create-builtin.cjs +3 -0
- package/dist/helpers/create-builtin.d.cts +2 -0
- package/dist/helpers/create-builtin.d.mts +2 -0
- package/dist/helpers/create-builtin.mjs +3 -0
- package/dist/helpers/index.cjs +26 -0
- package/dist/helpers/index.d.cts +7 -0
- package/dist/helpers/index.d.mts +7 -0
- package/dist/helpers/index.mjs +8 -0
- package/dist/helpers/refkey.cjs +3 -0
- package/dist/helpers/refkey.d.cts +2 -0
- package/dist/helpers/refkey.d.mts +2 -0
- package/dist/helpers/refkey.mjs +3 -0
- package/dist/helpers/typescript.cjs +4 -0
- package/dist/helpers/typescript.d.cts +2 -0
- package/dist/helpers/typescript.d.mts +2 -0
- package/dist/helpers/typescript.mjs +4 -0
- package/dist/helpers-BrA1Dy07.mjs +1 -0
- package/dist/helpers-Cten3PJk.cjs +0 -0
- package/dist/index-BINnViIh.d.mts +1 -0
- package/dist/index-BJ8-FA6N.d.cts +1 -0
- package/dist/index-BRJ_6A42.d.mts +1 -0
- package/dist/index-BXpMZvwA.d.cts +1 -0
- package/dist/index-Bi0Yc4v2.d.cts +1 -0
- package/dist/index-BrGZHEgX.d.mts +1 -0
- package/dist/index-BwFl_eS0.d.mts +1 -0
- package/dist/index-C1ihAKnV.d.cts +1 -0
- package/dist/index-CLTQPxoD.d.mts +1 -0
- package/dist/index-CoUVmp_Q.d.mts +1 -0
- package/dist/index-D1aKd2tO.d.cts +1 -0
- package/dist/index-D4d_pZLu.d.cts +1 -0
- package/dist/index-DBGd4WeR.d.mts +1 -0
- package/dist/index-DdxxIAKU.d.cts +1 -0
- package/dist/index-Deol7ZWO.d.mts +1 -0
- package/dist/index-DpEKQcoR.d.cts +1 -0
- package/dist/index-DrZ2Dh-H.d.cts +1 -0
- package/dist/index-MEuojd-r.d.cts +1 -0
- package/dist/index-bHnO4ZKt.d.mts +1 -0
- package/dist/index-lIMqGGJz.d.mts +1 -0
- package/dist/index.cjs +446 -0
- package/dist/index.d.cts +45 -0
- package/dist/index.d.mts +45 -0
- package/dist/index.mjs +361 -0
- package/dist/markdown/components/index.cjs +13 -0
- package/dist/markdown/components/index.d.cts +8 -0
- package/dist/markdown/components/index.d.mts +8 -0
- package/dist/markdown/components/index.mjs +9 -0
- package/dist/markdown/components/markdown-file.cjs +7 -0
- package/dist/markdown/components/markdown-file.d.cts +5 -0
- package/dist/markdown/components/markdown-file.d.mts +5 -0
- package/dist/markdown/components/markdown-file.mjs +6 -0
- package/dist/markdown/components/markdown-table.cjs +6 -0
- package/dist/markdown/components/markdown-table.d.cts +5 -0
- package/dist/markdown/components/markdown-table.d.mts +5 -0
- package/dist/markdown/components/markdown-table.mjs +4 -0
- package/dist/markdown/contexts/index.cjs +7 -0
- package/dist/markdown/contexts/index.d.cts +3 -0
- package/dist/markdown/contexts/index.d.mts +3 -0
- package/dist/markdown/contexts/index.mjs +4 -0
- package/dist/markdown/contexts/markdown-table.cjs +6 -0
- package/dist/markdown/contexts/markdown-table.d.cts +2 -0
- package/dist/markdown/contexts/markdown-table.d.mts +2 -0
- package/dist/markdown/contexts/markdown-table.mjs +3 -0
- package/dist/markdown/index.cjs +19 -0
- package/dist/markdown/index.d.cts +10 -0
- package/dist/markdown/index.d.mts +10 -0
- package/dist/markdown/index.mjs +11 -0
- package/dist/markdown-BTQE0AI9.cjs +0 -0
- package/dist/markdown-DMddlO1y.mjs +1 -0
- package/dist/markdown-file-BFbbzD59.mjs +90 -0
- package/dist/markdown-file-Bsuu9aIk.d.cts +23 -0
- package/dist/markdown-file-CB6u4Cp1.d.mts +23 -0
- package/dist/markdown-file-CzGNj_Ex.cjs +102 -0
- package/dist/markdown-table-2qP_4eLk.mjs +33 -0
- package/dist/markdown-table-BOWM26Kb.cjs +57 -0
- package/dist/markdown-table-BUxH6aRh.mjs +77 -0
- package/dist/markdown-table-CMaQVkwJ.d.mts +27 -0
- package/dist/markdown-table-CZMEY6IR.d.cts +37 -0
- package/dist/markdown-table-DFaNSBRn.cjs +95 -0
- package/dist/markdown-table-SvbpUdq-.d.cts +27 -0
- package/dist/markdown-table-kFQoqKQt.d.mts +37 -0
- package/dist/output-ChpN7bQM.d.cts +18 -0
- package/dist/output-CnofBsl0.cjs +38 -0
- package/dist/output-D9RlZeCO.d.mts +18 -0
- package/dist/output-DEdXZ94G.mjs +32 -0
- package/dist/plugin-C0DspKAF.d.mts +34 -0
- package/dist/plugin-DU0K2-Om.mjs +1 -0
- package/dist/plugin-DYBdUgTF.d.cts +34 -0
- package/dist/plugin-Fx-uJ4It.cjs +0 -0
- package/dist/record-expression-BOCZ9iqR.d.mts +12 -0
- package/dist/record-expression-DM_zSqE_.d.cts +12 -0
- package/dist/record-expression-DNVzCKgo.cjs +17 -0
- package/dist/record-expression-DxS_DiPc.mjs +11 -0
- package/dist/refkey-B0XSqdGY.d.mts +13 -0
- package/dist/refkey-B6A9kh_u.cjs +21 -0
- package/dist/refkey-CP7MJMac.d.cts +13 -0
- package/dist/refkey-CV0mIj0Y.mjs +15 -0
- package/dist/reflection-BSbFFYZO.cjs +108 -0
- package/dist/reflection-Bka9prwJ.d.mts +52 -0
- package/dist/reflection-CBMQ1FQo.mjs +60 -0
- package/dist/reflection-CkVyW69y.d.cts +52 -0
- package/dist/single-line-comment-BMPq6OR0.cjs +25 -0
- package/dist/single-line-comment-BjL_Z4Qn.d.cts +22 -0
- package/dist/single-line-comment-C5CtHQhi.mjs +19 -0
- package/dist/single-line-comment-DZAmp_BZ.d.mts +22 -0
- package/dist/source-file-4J1OvLed.d.cts +31 -0
- package/dist/source-file-BBbuhOKz.d.mts +31 -0
- package/dist/source-file-CCYwl5pI.mjs +52 -0
- package/dist/source-file-DTd1KgD5.cjs +59 -0
- package/dist/tsdoc-BFPYF-Fh.cjs +487 -0
- package/dist/tsdoc-BmyOQBxT.mjs +367 -0
- package/dist/tsdoc-C39LB5Mn.d.cts +152 -0
- package/dist/tsdoc-OE37Ht2l.d.mts +152 -0
- package/dist/tsdoc-reflection-3ZoV_Mjz.d.cts +18 -0
- package/dist/tsdoc-reflection-3hSdGY1e.mjs +97 -0
- package/dist/tsdoc-reflection-BQN8iUG1.cjs +115 -0
- package/dist/tsdoc-reflection-BtEk3cDW.d.mts +18 -0
- package/dist/types/components.cjs +1 -0
- package/dist/types/components.d.cts +3 -0
- package/dist/types/components.d.mts +3 -0
- package/dist/types/components.mjs +3 -0
- package/dist/types/index.cjs +3 -0
- package/dist/types/index.d.cts +5 -0
- package/dist/types/index.d.mts +5 -0
- package/dist/types/index.mjs +5 -0
- package/dist/types/plugin.cjs +1 -0
- package/dist/types/plugin.d.cts +3 -0
- package/dist/types/plugin.d.mts +3 -0
- package/dist/types/plugin.mjs +3 -0
- package/dist/types-BBEDEYnP.cjs +0 -0
- package/dist/types-BWlfXHs2.mjs +1 -0
- package/dist/typescript/components/builtin-file.cjs +9 -0
- package/dist/typescript/components/builtin-file.d.cts +7 -0
- package/dist/typescript/components/builtin-file.d.mts +7 -0
- package/dist/typescript/components/builtin-file.mjs +9 -0
- package/dist/typescript/components/dynamic-import-statement.cjs +3 -0
- package/dist/typescript/components/dynamic-import-statement.d.cts +2 -0
- package/dist/typescript/components/dynamic-import-statement.d.mts +2 -0
- package/dist/typescript/components/dynamic-import-statement.mjs +3 -0
- package/dist/typescript/components/entry-file.cjs +7 -0
- package/dist/typescript/components/entry-file.d.cts +6 -0
- package/dist/typescript/components/entry-file.d.mts +6 -0
- package/dist/typescript/components/entry-file.mjs +7 -0
- package/dist/typescript/components/index.cjs +50 -0
- package/dist/typescript/components/index.d.cts +14 -0
- package/dist/typescript/components/index.d.mts +14 -0
- package/dist/typescript/components/index.mjs +17 -0
- package/dist/typescript/components/record-expression.cjs +3 -0
- package/dist/typescript/components/record-expression.d.cts +2 -0
- package/dist/typescript/components/record-expression.d.mts +2 -0
- package/dist/typescript/components/record-expression.mjs +3 -0
- package/dist/typescript/components/tsdoc-reflection.cjs +9 -0
- package/dist/typescript/components/tsdoc-reflection.d.cts +5 -0
- package/dist/typescript/components/tsdoc-reflection.d.mts +5 -0
- package/dist/typescript/components/tsdoc-reflection.mjs +7 -0
- package/dist/typescript/components/tsdoc.cjs +24 -0
- package/dist/typescript/components/tsdoc.d.cts +4 -0
- package/dist/typescript/components/tsdoc.d.mts +4 -0
- package/dist/typescript/components/tsdoc.mjs +5 -0
- package/dist/typescript/components/typescript-file.cjs +8 -0
- package/dist/typescript/components/typescript-file.d.cts +5 -0
- package/dist/typescript/components/typescript-file.d.mts +5 -0
- package/dist/typescript/components/typescript-file.mjs +6 -0
- package/dist/typescript/components/typescript-interface.cjs +9 -0
- package/dist/typescript/components/typescript-interface.d.cts +4 -0
- package/dist/typescript/components/typescript-interface.d.mts +4 -0
- package/dist/typescript/components/typescript-interface.mjs +8 -0
- package/dist/typescript/components/typescript-object.cjs +9 -0
- package/dist/typescript/components/typescript-object.d.cts +4 -0
- package/dist/typescript/components/typescript-object.d.mts +4 -0
- package/dist/typescript/components/typescript-object.mjs +8 -0
- package/dist/typescript/index.cjs +51 -0
- package/dist/typescript/index.d.cts +15 -0
- package/dist/typescript/index.d.mts +15 -0
- package/dist/typescript/index.mjs +18 -0
- package/dist/typescript-45caIUPa.mjs +1 -0
- package/dist/typescript-BrZsJqvc.mjs +45 -0
- package/dist/typescript-CXP7Oa6_.d.cts +25 -0
- package/dist/typescript-DG1-qdBQ.d.mts +25 -0
- package/dist/typescript-DV5akLQO.cjs +0 -0
- package/dist/typescript-DcqKlMoH.cjs +51 -0
- package/dist/typescript-file-6Y81yLyB.cjs +157 -0
- package/dist/typescript-file-BR9I7R1v.d.cts +47 -0
- package/dist/typescript-file-BWq9GIUt.d.mts +47 -0
- package/dist/typescript-file-y6oF016h.mjs +139 -0
- package/dist/typescript-interface-AydoCmGY.mjs +52 -0
- package/dist/typescript-interface-CKjljRFu.d.mts +25 -0
- package/dist/typescript-interface-Codd49Sl.cjs +64 -0
- package/dist/typescript-interface-fGS4VBnW.d.cts +25 -0
- package/dist/typescript-object-C-BmpHfk.mjs +93 -0
- package/dist/typescript-object-CxC5Qo5P.d.cts +26 -0
- package/dist/typescript-object-DOrJkpcM.cjs +105 -0
- package/dist/typescript-object-I6Huh12F.d.mts +26 -0
- package/dist/utilities-CnaPrauh.mjs +109 -0
- package/dist/utilities-llRqOC4l.cjs +133 -0
- package/package.json +411 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { n as usePowerlines } from "./context-Cx38_mgI.mjs";
|
|
2
|
+
import { t as SingleLineComment } from "./single-line-comment-C5CtHQhi.mjs";
|
|
3
|
+
import { t as SourceFile } from "./source-file-CCYwl5pI.mjs";
|
|
4
|
+
import { Show, code, getContext, splitProps } from "@alloy-js/core";
|
|
5
|
+
import { Fragment, jsx, jsxs } from "@alloy-js/core/jsx-runtime";
|
|
6
|
+
import { titleCase } from "@stryke/string-format/title-case";
|
|
7
|
+
import { Link } from "@alloy-js/markdown";
|
|
8
|
+
|
|
9
|
+
//#region src/markdown/components/markdown-file.tsx
|
|
10
|
+
/**
|
|
11
|
+
* A base component representing a Powerlines generated markdown source file.
|
|
12
|
+
*
|
|
13
|
+
* @param props - The properties for the source file.
|
|
14
|
+
* @returns The rendered source file component.
|
|
15
|
+
*/
|
|
16
|
+
function MarkdownFile(props) {
|
|
17
|
+
const [{ children, preset }, rest] = splitProps(props, ["children", "preset"]);
|
|
18
|
+
const nodeContext = getContext();
|
|
19
|
+
nodeContext.meta ??= {};
|
|
20
|
+
nodeContext.meta.output = { preset };
|
|
21
|
+
return /* @__PURE__ */ jsx(SourceFile, {
|
|
22
|
+
header: /* @__PURE__ */ jsx(MarkdownFileHeader, {}),
|
|
23
|
+
...rest,
|
|
24
|
+
filetype: "md",
|
|
25
|
+
reference: Link,
|
|
26
|
+
children: /* @__PURE__ */ jsx(Show, {
|
|
27
|
+
when: Boolean(children),
|
|
28
|
+
children
|
|
29
|
+
})
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Renders the header for a Powerlines Typescript source file.
|
|
34
|
+
*
|
|
35
|
+
* @param props - The properties for the source file header.
|
|
36
|
+
* @returns The rendered source file header.
|
|
37
|
+
*/
|
|
38
|
+
function MarkdownFileHeader(props) {
|
|
39
|
+
const [{ children, disableEslint = true, disableBiome = true, disablePrettier = false }] = splitProps(props, [
|
|
40
|
+
"children",
|
|
41
|
+
"disableEslint",
|
|
42
|
+
"disableBiome",
|
|
43
|
+
"disablePrettier"
|
|
44
|
+
]);
|
|
45
|
+
const context = usePowerlines();
|
|
46
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
47
|
+
/* @__PURE__ */ jsxs(Show, {
|
|
48
|
+
when: Boolean(disableEslint),
|
|
49
|
+
children: [/* @__PURE__ */ jsx(SingleLineComment, {
|
|
50
|
+
variant: "markdown",
|
|
51
|
+
children: "eslint-disable"
|
|
52
|
+
}), /* @__PURE__ */ jsx("hbr", {})]
|
|
53
|
+
}),
|
|
54
|
+
/* @__PURE__ */ jsxs(Show, {
|
|
55
|
+
when: Boolean(disablePrettier),
|
|
56
|
+
children: [/* @__PURE__ */ jsx(SingleLineComment, {
|
|
57
|
+
variant: "markdown",
|
|
58
|
+
children: "prettier-ignore"
|
|
59
|
+
}), /* @__PURE__ */ jsx("hbr", {})]
|
|
60
|
+
}),
|
|
61
|
+
/* @__PURE__ */ jsxs(Show, {
|
|
62
|
+
when: Boolean(disableBiome),
|
|
63
|
+
children: [/* @__PURE__ */ jsx(SingleLineComment, {
|
|
64
|
+
variant: "markdown",
|
|
65
|
+
children: "biome-ignore lint: disable"
|
|
66
|
+
}), /* @__PURE__ */ jsx("hbr", {})]
|
|
67
|
+
}),
|
|
68
|
+
/* @__PURE__ */ jsx(Show, {
|
|
69
|
+
when: Boolean(disableEslint) || Boolean(disablePrettier) || Boolean(disableBiome),
|
|
70
|
+
children: /* @__PURE__ */ jsx("hbr", {})
|
|
71
|
+
}),
|
|
72
|
+
/* @__PURE__ */ jsx(Show, {
|
|
73
|
+
when: Boolean(children),
|
|
74
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [children, /* @__PURE__ */ jsx("hbr", {})] })
|
|
75
|
+
}),
|
|
76
|
+
/* @__PURE__ */ jsx(SingleLineComment, {
|
|
77
|
+
variant: "markdown",
|
|
78
|
+
children: code`Generated by ${titleCase(context?.config.framework) || "Powerlines"}`
|
|
79
|
+
}),
|
|
80
|
+
/* @__PURE__ */ jsx("hbr", {}),
|
|
81
|
+
/* @__PURE__ */ jsx(SingleLineComment, {
|
|
82
|
+
variant: "markdown",
|
|
83
|
+
children: code`NOTE: Do not edit this file manually - it will be overwritten automatically by the "prepare" command`
|
|
84
|
+
}),
|
|
85
|
+
/* @__PURE__ */ jsx("hbr", {})
|
|
86
|
+
] });
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
//#endregion
|
|
90
|
+
export { MarkdownFileHeader as n, MarkdownFile as t };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { n as ComponentProps, p as SourceFileHeaderProps } from "./components-B0A7LpQD.cjs";
|
|
2
|
+
import { n as SourceFileProps$1 } from "./source-file-4J1OvLed.cjs";
|
|
3
|
+
import * as _alloy_js_core12 from "@alloy-js/core";
|
|
4
|
+
|
|
5
|
+
//#region src/markdown/components/markdown-file.d.ts
|
|
6
|
+
type MarkdownFileProps = Omit<SourceFileProps$1, "filetype"> & ComponentProps;
|
|
7
|
+
/**
|
|
8
|
+
* A base component representing a Powerlines generated markdown source file.
|
|
9
|
+
*
|
|
10
|
+
* @param props - The properties for the source file.
|
|
11
|
+
* @returns The rendered source file component.
|
|
12
|
+
*/
|
|
13
|
+
declare function MarkdownFile(props: MarkdownFileProps): _alloy_js_core12.Children;
|
|
14
|
+
/**
|
|
15
|
+
* Renders the header for a Powerlines Typescript source file.
|
|
16
|
+
*
|
|
17
|
+
* @param props - The properties for the source file header.
|
|
18
|
+
* @returns The rendered source file header.
|
|
19
|
+
*/
|
|
20
|
+
declare function MarkdownFileHeader(props: SourceFileHeaderProps): _alloy_js_core12.Children;
|
|
21
|
+
declare type __ΩMarkdownFileProps = any[];
|
|
22
|
+
//#endregion
|
|
23
|
+
export { __ΩMarkdownFileProps as i, MarkdownFileHeader as n, MarkdownFileProps as r, MarkdownFile as t };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { n as ComponentProps, p as SourceFileHeaderProps } from "./components-B2kXCrty.mjs";
|
|
2
|
+
import { n as SourceFileProps$1 } from "./source-file-BBbuhOKz.mjs";
|
|
3
|
+
import * as _alloy_js_core15 from "@alloy-js/core";
|
|
4
|
+
|
|
5
|
+
//#region src/markdown/components/markdown-file.d.ts
|
|
6
|
+
type MarkdownFileProps = Omit<SourceFileProps$1, "filetype"> & ComponentProps;
|
|
7
|
+
/**
|
|
8
|
+
* A base component representing a Powerlines generated markdown source file.
|
|
9
|
+
*
|
|
10
|
+
* @param props - The properties for the source file.
|
|
11
|
+
* @returns The rendered source file component.
|
|
12
|
+
*/
|
|
13
|
+
declare function MarkdownFile(props: MarkdownFileProps): _alloy_js_core15.Children;
|
|
14
|
+
/**
|
|
15
|
+
* Renders the header for a Powerlines Typescript source file.
|
|
16
|
+
*
|
|
17
|
+
* @param props - The properties for the source file header.
|
|
18
|
+
* @returns The rendered source file header.
|
|
19
|
+
*/
|
|
20
|
+
declare function MarkdownFileHeader(props: SourceFileHeaderProps): _alloy_js_core15.Children;
|
|
21
|
+
declare type __ΩMarkdownFileProps = any[];
|
|
22
|
+
//#endregion
|
|
23
|
+
export { __ΩMarkdownFileProps as i, MarkdownFileHeader as n, MarkdownFileProps as r, MarkdownFile as t };
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
const require_chunk = require('./chunk-CbDLau6x.cjs');
|
|
2
|
+
const require_context = require('./context-BIduC1bB.cjs');
|
|
3
|
+
const require_single_line_comment = require('./single-line-comment-BMPq6OR0.cjs');
|
|
4
|
+
const require_source_file = require('./source-file-DTd1KgD5.cjs');
|
|
5
|
+
let __alloy_js_core = require("@alloy-js/core");
|
|
6
|
+
let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
7
|
+
let __stryke_string_format_title_case = require("@stryke/string-format/title-case");
|
|
8
|
+
let __alloy_js_markdown = require("@alloy-js/markdown");
|
|
9
|
+
|
|
10
|
+
//#region src/markdown/components/markdown-file.tsx
|
|
11
|
+
/**
|
|
12
|
+
* A base component representing a Powerlines generated markdown source file.
|
|
13
|
+
*
|
|
14
|
+
* @param props - The properties for the source file.
|
|
15
|
+
* @returns The rendered source file component.
|
|
16
|
+
*/
|
|
17
|
+
function MarkdownFile(props) {
|
|
18
|
+
const [{ children, preset }, rest] = (0, __alloy_js_core.splitProps)(props, ["children", "preset"]);
|
|
19
|
+
const nodeContext = (0, __alloy_js_core.getContext)();
|
|
20
|
+
nodeContext.meta ??= {};
|
|
21
|
+
nodeContext.meta.output = { preset };
|
|
22
|
+
return /* @__PURE__ */ (0, __alloy_js_core_jsx_runtime.jsx)(require_source_file.SourceFile, {
|
|
23
|
+
header: /* @__PURE__ */ (0, __alloy_js_core_jsx_runtime.jsx)(MarkdownFileHeader, {}),
|
|
24
|
+
...rest,
|
|
25
|
+
filetype: "md",
|
|
26
|
+
reference: __alloy_js_markdown.Link,
|
|
27
|
+
children: /* @__PURE__ */ (0, __alloy_js_core_jsx_runtime.jsx)(__alloy_js_core.Show, {
|
|
28
|
+
when: Boolean(children),
|
|
29
|
+
children
|
|
30
|
+
})
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Renders the header for a Powerlines Typescript source file.
|
|
35
|
+
*
|
|
36
|
+
* @param props - The properties for the source file header.
|
|
37
|
+
* @returns The rendered source file header.
|
|
38
|
+
*/
|
|
39
|
+
function MarkdownFileHeader(props) {
|
|
40
|
+
const [{ children, disableEslint = true, disableBiome = true, disablePrettier = false }] = (0, __alloy_js_core.splitProps)(props, [
|
|
41
|
+
"children",
|
|
42
|
+
"disableEslint",
|
|
43
|
+
"disableBiome",
|
|
44
|
+
"disablePrettier"
|
|
45
|
+
]);
|
|
46
|
+
const context = require_context.usePowerlines();
|
|
47
|
+
return /* @__PURE__ */ (0, __alloy_js_core_jsx_runtime.jsxs)(__alloy_js_core_jsx_runtime.Fragment, { children: [
|
|
48
|
+
/* @__PURE__ */ (0, __alloy_js_core_jsx_runtime.jsxs)(__alloy_js_core.Show, {
|
|
49
|
+
when: Boolean(disableEslint),
|
|
50
|
+
children: [/* @__PURE__ */ (0, __alloy_js_core_jsx_runtime.jsx)(require_single_line_comment.SingleLineComment, {
|
|
51
|
+
variant: "markdown",
|
|
52
|
+
children: "eslint-disable"
|
|
53
|
+
}), /* @__PURE__ */ (0, __alloy_js_core_jsx_runtime.jsx)("hbr", {})]
|
|
54
|
+
}),
|
|
55
|
+
/* @__PURE__ */ (0, __alloy_js_core_jsx_runtime.jsxs)(__alloy_js_core.Show, {
|
|
56
|
+
when: Boolean(disablePrettier),
|
|
57
|
+
children: [/* @__PURE__ */ (0, __alloy_js_core_jsx_runtime.jsx)(require_single_line_comment.SingleLineComment, {
|
|
58
|
+
variant: "markdown",
|
|
59
|
+
children: "prettier-ignore"
|
|
60
|
+
}), /* @__PURE__ */ (0, __alloy_js_core_jsx_runtime.jsx)("hbr", {})]
|
|
61
|
+
}),
|
|
62
|
+
/* @__PURE__ */ (0, __alloy_js_core_jsx_runtime.jsxs)(__alloy_js_core.Show, {
|
|
63
|
+
when: Boolean(disableBiome),
|
|
64
|
+
children: [/* @__PURE__ */ (0, __alloy_js_core_jsx_runtime.jsx)(require_single_line_comment.SingleLineComment, {
|
|
65
|
+
variant: "markdown",
|
|
66
|
+
children: "biome-ignore lint: disable"
|
|
67
|
+
}), /* @__PURE__ */ (0, __alloy_js_core_jsx_runtime.jsx)("hbr", {})]
|
|
68
|
+
}),
|
|
69
|
+
/* @__PURE__ */ (0, __alloy_js_core_jsx_runtime.jsx)(__alloy_js_core.Show, {
|
|
70
|
+
when: Boolean(disableEslint) || Boolean(disablePrettier) || Boolean(disableBiome),
|
|
71
|
+
children: /* @__PURE__ */ (0, __alloy_js_core_jsx_runtime.jsx)("hbr", {})
|
|
72
|
+
}),
|
|
73
|
+
/* @__PURE__ */ (0, __alloy_js_core_jsx_runtime.jsx)(__alloy_js_core.Show, {
|
|
74
|
+
when: Boolean(children),
|
|
75
|
+
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", {})] })
|
|
76
|
+
}),
|
|
77
|
+
/* @__PURE__ */ (0, __alloy_js_core_jsx_runtime.jsx)(require_single_line_comment.SingleLineComment, {
|
|
78
|
+
variant: "markdown",
|
|
79
|
+
children: __alloy_js_core.code`Generated by ${(0, __stryke_string_format_title_case.titleCase)(context?.config.framework) || "Powerlines"}`
|
|
80
|
+
}),
|
|
81
|
+
/* @__PURE__ */ (0, __alloy_js_core_jsx_runtime.jsx)("hbr", {}),
|
|
82
|
+
/* @__PURE__ */ (0, __alloy_js_core_jsx_runtime.jsx)(require_single_line_comment.SingleLineComment, {
|
|
83
|
+
variant: "markdown",
|
|
84
|
+
children: __alloy_js_core.code`NOTE: Do not edit this file manually - it will be overwritten automatically by the "prepare" command`
|
|
85
|
+
}),
|
|
86
|
+
/* @__PURE__ */ (0, __alloy_js_core_jsx_runtime.jsx)("hbr", {})
|
|
87
|
+
] });
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
//#endregion
|
|
91
|
+
Object.defineProperty(exports, 'MarkdownFile', {
|
|
92
|
+
enumerable: true,
|
|
93
|
+
get: function () {
|
|
94
|
+
return MarkdownFile;
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
Object.defineProperty(exports, 'MarkdownFileHeader', {
|
|
98
|
+
enumerable: true,
|
|
99
|
+
get: function () {
|
|
100
|
+
return MarkdownFileHeader;
|
|
101
|
+
}
|
|
102
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { createContext, createNamedContext, useContext } from "@alloy-js/core";
|
|
2
|
+
|
|
3
|
+
//#region src/markdown/contexts/markdown-table.ts
|
|
4
|
+
/**
|
|
5
|
+
* The Powerlines context used in template rendering.
|
|
6
|
+
*/
|
|
7
|
+
const MarkdownTableColumnContext = createNamedContext("markdown-table-column", {});
|
|
8
|
+
/**
|
|
9
|
+
* Hook to access the Powerlines Context.
|
|
10
|
+
*
|
|
11
|
+
* @returns The Context.
|
|
12
|
+
*/
|
|
13
|
+
function useMarkdownTableColumn() {
|
|
14
|
+
return useContext(MarkdownTableColumnContext);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The Powerlines context used in template rendering.
|
|
18
|
+
*/
|
|
19
|
+
const MarkdownTableContext = createContext({
|
|
20
|
+
columns: [],
|
|
21
|
+
data: []
|
|
22
|
+
});
|
|
23
|
+
/**
|
|
24
|
+
* Hook to access the Powerlines Context.
|
|
25
|
+
*
|
|
26
|
+
* @returns The Context.
|
|
27
|
+
*/
|
|
28
|
+
function useMarkdownTable() {
|
|
29
|
+
return useContext(MarkdownTableContext);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
export { useMarkdownTableColumn as i, MarkdownTableContext as n, useMarkdownTable as r, MarkdownTableColumnContext as t };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
const require_chunk = require('./chunk-CbDLau6x.cjs');
|
|
2
|
+
let __alloy_js_core = require("@alloy-js/core");
|
|
3
|
+
|
|
4
|
+
//#region src/markdown/contexts/markdown-table.ts
|
|
5
|
+
/**
|
|
6
|
+
* The Powerlines context used in template rendering.
|
|
7
|
+
*/
|
|
8
|
+
const MarkdownTableColumnContext = (0, __alloy_js_core.createNamedContext)("markdown-table-column", {});
|
|
9
|
+
/**
|
|
10
|
+
* Hook to access the Powerlines Context.
|
|
11
|
+
*
|
|
12
|
+
* @returns The Context.
|
|
13
|
+
*/
|
|
14
|
+
function useMarkdownTableColumn() {
|
|
15
|
+
return (0, __alloy_js_core.useContext)(MarkdownTableColumnContext);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The Powerlines context used in template rendering.
|
|
19
|
+
*/
|
|
20
|
+
const MarkdownTableContext = (0, __alloy_js_core.createContext)({
|
|
21
|
+
columns: [],
|
|
22
|
+
data: []
|
|
23
|
+
});
|
|
24
|
+
/**
|
|
25
|
+
* Hook to access the Powerlines Context.
|
|
26
|
+
*
|
|
27
|
+
* @returns The Context.
|
|
28
|
+
*/
|
|
29
|
+
function useMarkdownTable() {
|
|
30
|
+
return (0, __alloy_js_core.useContext)(MarkdownTableContext);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
//#endregion
|
|
34
|
+
Object.defineProperty(exports, 'MarkdownTableColumnContext', {
|
|
35
|
+
enumerable: true,
|
|
36
|
+
get: function () {
|
|
37
|
+
return MarkdownTableColumnContext;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
Object.defineProperty(exports, 'MarkdownTableContext', {
|
|
41
|
+
enumerable: true,
|
|
42
|
+
get: function () {
|
|
43
|
+
return MarkdownTableContext;
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
Object.defineProperty(exports, 'useMarkdownTable', {
|
|
47
|
+
enumerable: true,
|
|
48
|
+
get: function () {
|
|
49
|
+
return useMarkdownTable;
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
Object.defineProperty(exports, 'useMarkdownTableColumn', {
|
|
53
|
+
enumerable: true,
|
|
54
|
+
get: function () {
|
|
55
|
+
return useMarkdownTableColumn;
|
|
56
|
+
}
|
|
57
|
+
});
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { n as MarkdownTableContext, r as useMarkdownTable } from "./markdown-table-2qP_4eLk.mjs";
|
|
2
|
+
import { Prose, Show, code, computed, splitProps } from "@alloy-js/core";
|
|
3
|
+
import { isUndefined } from "@stryke/type-checks/is-undefined";
|
|
4
|
+
import { Fragment, jsx, jsxs } from "@alloy-js/core/jsx-runtime";
|
|
5
|
+
import { titleCase } from "@stryke/string-format/title-case";
|
|
6
|
+
|
|
7
|
+
//#region src/markdown/components/markdown-table.tsx
|
|
8
|
+
/**
|
|
9
|
+
* Component that provides a context for rendering markdown tables.
|
|
10
|
+
*/
|
|
11
|
+
function MarkdownTable(props) {
|
|
12
|
+
const [{ children, data }] = splitProps(props, ["children", "data"]);
|
|
13
|
+
const columns = computed(() => Object.keys(data).map((name, index) => ({
|
|
14
|
+
index,
|
|
15
|
+
name,
|
|
16
|
+
align: "left",
|
|
17
|
+
width: 20
|
|
18
|
+
})));
|
|
19
|
+
return /* @__PURE__ */ jsx(MarkdownTableContext.Provider, {
|
|
20
|
+
value: {
|
|
21
|
+
columns: columns.value,
|
|
22
|
+
data
|
|
23
|
+
},
|
|
24
|
+
children: /* @__PURE__ */ jsx(Show, {
|
|
25
|
+
when: Boolean(children),
|
|
26
|
+
children
|
|
27
|
+
})
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Component that provides a context for rendering markdown tables.
|
|
32
|
+
*/
|
|
33
|
+
function MarkdownTableColumn(props) {
|
|
34
|
+
const [{ children, width, align, name }] = splitProps(props, [
|
|
35
|
+
"children",
|
|
36
|
+
"width",
|
|
37
|
+
"align",
|
|
38
|
+
"name"
|
|
39
|
+
]);
|
|
40
|
+
const tableContext = useMarkdownTable();
|
|
41
|
+
const columnRef = computed(() => tableContext?.columns.find((c) => c.name === name));
|
|
42
|
+
const indexRef = computed(() => columnRef.value?.index ?? 0);
|
|
43
|
+
const alignRef = computed(() => columnRef.value?.align ?? align ?? "left");
|
|
44
|
+
const widthRef = computed(() => columnRef.value?.width ?? width ?? 20);
|
|
45
|
+
const textLength = computed(() => {
|
|
46
|
+
return (children ? children.toString() : "").length;
|
|
47
|
+
});
|
|
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
|
+
] });
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Component that provides a context for rendering markdown tables.
|
|
62
|
+
*/
|
|
63
|
+
function MarkdownTableColumnHeader(props) {
|
|
64
|
+
const [{ children, name }, rest] = splitProps(props, ["children", "name"]);
|
|
65
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(MarkdownTableColumn, {
|
|
66
|
+
...rest,
|
|
67
|
+
name,
|
|
68
|
+
children: /* @__PURE__ */ jsx(Show, {
|
|
69
|
+
fallback: titleCase(name, { useDescriptions: false }),
|
|
70
|
+
when: !isUndefined(children),
|
|
71
|
+
children
|
|
72
|
+
})
|
|
73
|
+
}) });
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
//#endregion
|
|
77
|
+
export { MarkdownTableColumn as n, MarkdownTableColumnHeader as r, MarkdownTable as t };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { n as ComponentProps } from "./components-B2kXCrty.mjs";
|
|
2
|
+
import { n as MarkdownTableColumnContextInterface } from "./markdown-table-kFQoqKQt.mjs";
|
|
3
|
+
import * as _alloy_js_core10 from "@alloy-js/core";
|
|
4
|
+
|
|
5
|
+
//#region src/markdown/components/markdown-table.d.ts
|
|
6
|
+
interface MarkdownTableProps<T extends Record<string, any> = Record<string, any>> extends ComponentProps {
|
|
7
|
+
data: T[];
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Component that provides a context for rendering markdown tables.
|
|
11
|
+
*/
|
|
12
|
+
declare function MarkdownTable<T extends Record<string, any> = Record<string, any>>(props: MarkdownTableProps<T>): _alloy_js_core10.Children;
|
|
13
|
+
type MarkdownTableColumnProps = ComponentProps & Partial<Pick<MarkdownTableColumnContextInterface, "align">> & Required<Pick<MarkdownTableColumnContextInterface, "name">> & {
|
|
14
|
+
width?: number;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Component that provides a context for rendering markdown tables.
|
|
18
|
+
*/
|
|
19
|
+
declare function MarkdownTableColumn(props: MarkdownTableColumnProps): _alloy_js_core10.Children;
|
|
20
|
+
/**
|
|
21
|
+
* Component that provides a context for rendering markdown tables.
|
|
22
|
+
*/
|
|
23
|
+
declare function MarkdownTableColumnHeader(props: MarkdownTableColumnProps): _alloy_js_core10.Children;
|
|
24
|
+
declare type __ΩMarkdownTableProps = any[];
|
|
25
|
+
declare type __ΩMarkdownTableColumnProps = any[];
|
|
26
|
+
//#endregion
|
|
27
|
+
export { MarkdownTableProps as a, MarkdownTableColumnProps as i, MarkdownTableColumn as n, __ΩMarkdownTableColumnProps as o, MarkdownTableColumnHeader as r, __ΩMarkdownTableProps as s, MarkdownTable as t };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ComponentContext } from "@alloy-js/core";
|
|
2
|
+
|
|
3
|
+
//#region src/markdown/contexts/markdown-table.d.ts
|
|
4
|
+
interface MarkdownTableColumnContextInterface<T extends Record<string, any> = Record<string, any>> {
|
|
5
|
+
index: number;
|
|
6
|
+
name: keyof T;
|
|
7
|
+
align: "left" | "right" | "center";
|
|
8
|
+
width: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The Powerlines context used in template rendering.
|
|
12
|
+
*/
|
|
13
|
+
declare const MarkdownTableColumnContext: ComponentContext<MarkdownTableColumnContextInterface>;
|
|
14
|
+
/**
|
|
15
|
+
* Hook to access the Powerlines Context.
|
|
16
|
+
*
|
|
17
|
+
* @returns The Context.
|
|
18
|
+
*/
|
|
19
|
+
declare function useMarkdownTableColumn(): MarkdownTableColumnContextInterface<Record<string, any>> | undefined;
|
|
20
|
+
interface MarkdownTableContextInterface<T extends Record<string, any> = Record<string, any>> {
|
|
21
|
+
columns: MarkdownTableColumnContextInterface<T>[];
|
|
22
|
+
data: T[];
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The Powerlines context used in template rendering.
|
|
26
|
+
*/
|
|
27
|
+
declare const MarkdownTableContext: ComponentContext<MarkdownTableContextInterface>;
|
|
28
|
+
/**
|
|
29
|
+
* Hook to access the Powerlines Context.
|
|
30
|
+
*
|
|
31
|
+
* @returns The Context.
|
|
32
|
+
*/
|
|
33
|
+
declare function useMarkdownTable(): MarkdownTableContextInterface<Record<string, any>> | undefined;
|
|
34
|
+
declare type __ΩMarkdownTableColumnContextInterface = any[];
|
|
35
|
+
declare type __ΩMarkdownTableContextInterface = any[];
|
|
36
|
+
//#endregion
|
|
37
|
+
export { __ΩMarkdownTableColumnContextInterface as a, useMarkdownTableColumn as c, MarkdownTableContextInterface as i, MarkdownTableColumnContextInterface as n, __ΩMarkdownTableContextInterface as o, MarkdownTableContext as r, useMarkdownTable as s, MarkdownTableColumnContext as t };
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
const require_chunk = require('./chunk-CbDLau6x.cjs');
|
|
2
|
+
const require_markdown_table = require('./markdown-table-BOWM26Kb.cjs');
|
|
3
|
+
let __alloy_js_core = require("@alloy-js/core");
|
|
4
|
+
let __stryke_type_checks_is_undefined = require("@stryke/type-checks/is-undefined");
|
|
5
|
+
let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
6
|
+
let __stryke_string_format_title_case = require("@stryke/string-format/title-case");
|
|
7
|
+
|
|
8
|
+
//#region src/markdown/components/markdown-table.tsx
|
|
9
|
+
/**
|
|
10
|
+
* Component that provides a context for rendering markdown tables.
|
|
11
|
+
*/
|
|
12
|
+
function MarkdownTable(props) {
|
|
13
|
+
const [{ children, data }] = (0, __alloy_js_core.splitProps)(props, ["children", "data"]);
|
|
14
|
+
const columns = (0, __alloy_js_core.computed)(() => Object.keys(data).map((name, index) => ({
|
|
15
|
+
index,
|
|
16
|
+
name,
|
|
17
|
+
align: "left",
|
|
18
|
+
width: 20
|
|
19
|
+
})));
|
|
20
|
+
return /* @__PURE__ */ (0, __alloy_js_core_jsx_runtime.jsx)(require_markdown_table.MarkdownTableContext.Provider, {
|
|
21
|
+
value: {
|
|
22
|
+
columns: columns.value,
|
|
23
|
+
data
|
|
24
|
+
},
|
|
25
|
+
children: /* @__PURE__ */ (0, __alloy_js_core_jsx_runtime.jsx)(__alloy_js_core.Show, {
|
|
26
|
+
when: Boolean(children),
|
|
27
|
+
children
|
|
28
|
+
})
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Component that provides a context for rendering markdown tables.
|
|
33
|
+
*/
|
|
34
|
+
function MarkdownTableColumn(props) {
|
|
35
|
+
const [{ children, width, align, name }] = (0, __alloy_js_core.splitProps)(props, [
|
|
36
|
+
"children",
|
|
37
|
+
"width",
|
|
38
|
+
"align",
|
|
39
|
+
"name"
|
|
40
|
+
]);
|
|
41
|
+
const tableContext = require_markdown_table.useMarkdownTable();
|
|
42
|
+
const columnRef = (0, __alloy_js_core.computed)(() => tableContext?.columns.find((c) => c.name === name));
|
|
43
|
+
const indexRef = (0, __alloy_js_core.computed)(() => columnRef.value?.index ?? 0);
|
|
44
|
+
const alignRef = (0, __alloy_js_core.computed)(() => columnRef.value?.align ?? align ?? "left");
|
|
45
|
+
const widthRef = (0, __alloy_js_core.computed)(() => columnRef.value?.width ?? width ?? 20);
|
|
46
|
+
const textLength = (0, __alloy_js_core.computed)(() => {
|
|
47
|
+
return (children ? children.toString() : "").length;
|
|
48
|
+
});
|
|
49
|
+
return /* @__PURE__ */ (0, __alloy_js_core_jsx_runtime.jsxs)(__alloy_js_core.Prose, { children: [
|
|
50
|
+
/* @__PURE__ */ (0, __alloy_js_core_jsx_runtime.jsx)(__alloy_js_core.Show, {
|
|
51
|
+
when: indexRef.value === 0,
|
|
52
|
+
children: "|"
|
|
53
|
+
}),
|
|
54
|
+
/* @__PURE__ */ (0, __alloy_js_core_jsx_runtime.jsx)(__alloy_js_core.Show, {
|
|
55
|
+
when: Boolean(children),
|
|
56
|
+
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) : " "}` })
|
|
57
|
+
}),
|
|
58
|
+
"|"
|
|
59
|
+
] });
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Component that provides a context for rendering markdown tables.
|
|
63
|
+
*/
|
|
64
|
+
function MarkdownTableColumnHeader(props) {
|
|
65
|
+
const [{ children, name }, rest] = (0, __alloy_js_core.splitProps)(props, ["children", "name"]);
|
|
66
|
+
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, {
|
|
67
|
+
...rest,
|
|
68
|
+
name,
|
|
69
|
+
children: /* @__PURE__ */ (0, __alloy_js_core_jsx_runtime.jsx)(__alloy_js_core.Show, {
|
|
70
|
+
fallback: (0, __stryke_string_format_title_case.titleCase)(name, { useDescriptions: false }),
|
|
71
|
+
when: !(0, __stryke_type_checks_is_undefined.isUndefined)(children),
|
|
72
|
+
children
|
|
73
|
+
})
|
|
74
|
+
}) });
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
//#endregion
|
|
78
|
+
Object.defineProperty(exports, 'MarkdownTable', {
|
|
79
|
+
enumerable: true,
|
|
80
|
+
get: function () {
|
|
81
|
+
return MarkdownTable;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
Object.defineProperty(exports, 'MarkdownTableColumn', {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
get: function () {
|
|
87
|
+
return MarkdownTableColumn;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
Object.defineProperty(exports, 'MarkdownTableColumnHeader', {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
get: function () {
|
|
93
|
+
return MarkdownTableColumnHeader;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { n as ComponentProps } from "./components-B0A7LpQD.cjs";
|
|
2
|
+
import { n as MarkdownTableColumnContextInterface } from "./markdown-table-CZMEY6IR.cjs";
|
|
3
|
+
import * as _alloy_js_core9 from "@alloy-js/core";
|
|
4
|
+
|
|
5
|
+
//#region src/markdown/components/markdown-table.d.ts
|
|
6
|
+
interface MarkdownTableProps<T extends Record<string, any> = Record<string, any>> extends ComponentProps {
|
|
7
|
+
data: T[];
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Component that provides a context for rendering markdown tables.
|
|
11
|
+
*/
|
|
12
|
+
declare function MarkdownTable<T extends Record<string, any> = Record<string, any>>(props: MarkdownTableProps<T>): _alloy_js_core9.Children;
|
|
13
|
+
type MarkdownTableColumnProps = ComponentProps & Partial<Pick<MarkdownTableColumnContextInterface, "align">> & Required<Pick<MarkdownTableColumnContextInterface, "name">> & {
|
|
14
|
+
width?: number;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Component that provides a context for rendering markdown tables.
|
|
18
|
+
*/
|
|
19
|
+
declare function MarkdownTableColumn(props: MarkdownTableColumnProps): _alloy_js_core9.Children;
|
|
20
|
+
/**
|
|
21
|
+
* Component that provides a context for rendering markdown tables.
|
|
22
|
+
*/
|
|
23
|
+
declare function MarkdownTableColumnHeader(props: MarkdownTableColumnProps): _alloy_js_core9.Children;
|
|
24
|
+
declare type __ΩMarkdownTableProps = any[];
|
|
25
|
+
declare type __ΩMarkdownTableColumnProps = any[];
|
|
26
|
+
//#endregion
|
|
27
|
+
export { MarkdownTableProps as a, MarkdownTableColumnProps as i, MarkdownTableColumn as n, __ΩMarkdownTableColumnProps as o, MarkdownTableColumnHeader as r, __ΩMarkdownTableProps as s, MarkdownTable as t };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ComponentContext } from "@alloy-js/core";
|
|
2
|
+
|
|
3
|
+
//#region src/markdown/contexts/markdown-table.d.ts
|
|
4
|
+
interface MarkdownTableColumnContextInterface<T extends Record<string, any> = Record<string, any>> {
|
|
5
|
+
index: number;
|
|
6
|
+
name: keyof T;
|
|
7
|
+
align: "left" | "right" | "center";
|
|
8
|
+
width: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The Powerlines context used in template rendering.
|
|
12
|
+
*/
|
|
13
|
+
declare const MarkdownTableColumnContext: ComponentContext<MarkdownTableColumnContextInterface>;
|
|
14
|
+
/**
|
|
15
|
+
* Hook to access the Powerlines Context.
|
|
16
|
+
*
|
|
17
|
+
* @returns The Context.
|
|
18
|
+
*/
|
|
19
|
+
declare function useMarkdownTableColumn(): MarkdownTableColumnContextInterface<Record<string, any>> | undefined;
|
|
20
|
+
interface MarkdownTableContextInterface<T extends Record<string, any> = Record<string, any>> {
|
|
21
|
+
columns: MarkdownTableColumnContextInterface<T>[];
|
|
22
|
+
data: T[];
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The Powerlines context used in template rendering.
|
|
26
|
+
*/
|
|
27
|
+
declare const MarkdownTableContext: ComponentContext<MarkdownTableContextInterface>;
|
|
28
|
+
/**
|
|
29
|
+
* Hook to access the Powerlines Context.
|
|
30
|
+
*
|
|
31
|
+
* @returns The Context.
|
|
32
|
+
*/
|
|
33
|
+
declare function useMarkdownTable(): MarkdownTableContextInterface<Record<string, any>> | undefined;
|
|
34
|
+
declare type __ΩMarkdownTableColumnContextInterface = any[];
|
|
35
|
+
declare type __ΩMarkdownTableContextInterface = any[];
|
|
36
|
+
//#endregion
|
|
37
|
+
export { __ΩMarkdownTableColumnContextInterface as a, useMarkdownTableColumn as c, MarkdownTableContextInterface as i, MarkdownTableColumnContextInterface as n, __ΩMarkdownTableContextInterface as o, MarkdownTableContext as r, useMarkdownTable as s, MarkdownTableColumnContext as t };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { n as PluginContext } from "./context-BO25KgR_.cjs";
|
|
2
|
+
import * as _alloy_js_core16 from "@alloy-js/core";
|
|
3
|
+
import { OutputProps } from "@alloy-js/core";
|
|
4
|
+
|
|
5
|
+
//#region src/core/components/output.d.ts
|
|
6
|
+
interface OutputProps$1<TContext extends PluginContext = PluginContext> extends OutputProps {
|
|
7
|
+
/**
|
|
8
|
+
* The current Powerlines process context.
|
|
9
|
+
*/
|
|
10
|
+
context: TContext;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Output component for rendering the Powerlines plugin's output files via templates.
|
|
14
|
+
*/
|
|
15
|
+
declare function Output<TContext extends PluginContext = PluginContext>(props: OutputProps$1<TContext>): _alloy_js_core16.Children;
|
|
16
|
+
declare type __ΩOutputProps = any[];
|
|
17
|
+
//#endregion
|
|
18
|
+
export { OutputProps$1 as n, __ΩOutputProps as r, Output as t };
|