@power-plant/alloy-js 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +265 -0
  3. package/dist/code-Cw63m9E5.d.mts +29 -0
  4. package/dist/code-Cw63m9E5.d.mts.map +1 -0
  5. package/dist/code-DwEnLBw3.d.cts +29 -0
  6. package/dist/code-DwEnLBw3.d.cts.map +1 -0
  7. package/dist/components-Lfo1yjgU.d.cts +57 -0
  8. package/dist/components-Lfo1yjgU.d.cts.map +1 -0
  9. package/dist/components-Lfo1yjgU.d.mts +57 -0
  10. package/dist/components-Lfo1yjgU.d.mts.map +1 -0
  11. package/dist/core/components/index.cjs +1 -0
  12. package/dist/core/components/index.d.cts +5 -0
  13. package/dist/core/components/index.d.mts +5 -0
  14. package/dist/core/components/index.mjs +1 -0
  15. package/dist/core/components/output.cjs +1 -0
  16. package/dist/core/components/output.d.cts +2 -0
  17. package/dist/core/components/output.d.mts +2 -0
  18. package/dist/core/components/output.mjs +2 -0
  19. package/dist/core/components/output.mjs.map +1 -0
  20. package/dist/core/components/single-line-comment.cjs +1 -0
  21. package/dist/core/components/single-line-comment.d.cts +2 -0
  22. package/dist/core/components/single-line-comment.d.mts +2 -0
  23. package/dist/core/components/single-line-comment.mjs +2 -0
  24. package/dist/core/components/single-line-comment.mjs.map +1 -0
  25. package/dist/core/components/source-file.cjs +1 -0
  26. package/dist/core/components/source-file.d.cts +2 -0
  27. package/dist/core/components/source-file.d.mts +2 -0
  28. package/dist/core/components/source-file.mjs +1 -0
  29. package/dist/core/components/spacing.cjs +1 -0
  30. package/dist/core/components/spacing.d.cts +2 -0
  31. package/dist/core/components/spacing.d.mts +2 -0
  32. package/dist/core/components/spacing.mjs +2 -0
  33. package/dist/core/components/spacing.mjs.map +1 -0
  34. package/dist/core/contexts/execution.cjs +1 -0
  35. package/dist/core/contexts/execution.d.cts +2 -0
  36. package/dist/core/contexts/execution.d.mts +2 -0
  37. package/dist/core/contexts/execution.mjs +2 -0
  38. package/dist/core/contexts/execution.mjs.map +1 -0
  39. package/dist/core/contexts/index.cjs +1 -0
  40. package/dist/core/contexts/index.d.cts +5 -0
  41. package/dist/core/contexts/index.d.mts +5 -0
  42. package/dist/core/contexts/index.mjs +1 -0
  43. package/dist/core/contexts/meta.cjs +1 -0
  44. package/dist/core/contexts/meta.d.cts +2 -0
  45. package/dist/core/contexts/meta.d.mts +2 -0
  46. package/dist/core/contexts/meta.mjs +2 -0
  47. package/dist/core/contexts/meta.mjs.map +1 -0
  48. package/dist/core/contexts/schema.cjs +1 -0
  49. package/dist/core/contexts/schema.d.cts +2 -0
  50. package/dist/core/contexts/schema.d.mts +2 -0
  51. package/dist/core/contexts/schema.mjs +2 -0
  52. package/dist/core/contexts/schema.mjs.map +1 -0
  53. package/dist/core/contexts/session.cjs +1 -0
  54. package/dist/core/contexts/session.d.cts +2 -0
  55. package/dist/core/contexts/session.d.mts +2 -0
  56. package/dist/core/contexts/session.mjs +2 -0
  57. package/dist/core/contexts/session.mjs.map +1 -0
  58. package/dist/core/contexts/spec.cjs +1 -0
  59. package/dist/core/contexts/spec.d.cts +23 -0
  60. package/dist/core/contexts/spec.d.cts.map +1 -0
  61. package/dist/core/contexts/spec.d.mts +23 -0
  62. package/dist/core/contexts/spec.d.mts.map +1 -0
  63. package/dist/core/contexts/spec.mjs +2 -0
  64. package/dist/core/contexts/spec.mjs.map +1 -0
  65. package/dist/core/helpers/code.cjs +1 -0
  66. package/dist/core/helpers/code.d.cts +2 -0
  67. package/dist/core/helpers/code.d.mts +2 -0
  68. package/dist/core/helpers/code.mjs +2 -0
  69. package/dist/core/helpers/code.mjs.map +1 -0
  70. package/dist/core/helpers/index.cjs +1 -0
  71. package/dist/core/helpers/index.d.cts +2 -0
  72. package/dist/core/helpers/index.d.mts +2 -0
  73. package/dist/core/helpers/index.mjs +1 -0
  74. package/dist/core/index.cjs +1 -0
  75. package/dist/core/index.d.cts +10 -0
  76. package/dist/core/index.d.mts +10 -0
  77. package/dist/core/index.mjs +1 -0
  78. package/dist/core/types/components.cjs +0 -0
  79. package/dist/core/types/components.d.cts +2 -0
  80. package/dist/core/types/components.d.mts +2 -0
  81. package/dist/core/types/components.mjs +0 -0
  82. package/dist/core/types/index.cjs +1 -0
  83. package/dist/core/types/index.d.cts +2 -0
  84. package/dist/core/types/index.d.mts +2 -0
  85. package/dist/core/types/index.mjs +1 -0
  86. package/dist/execution-CqOWMsST.d.cts +24 -0
  87. package/dist/execution-CqOWMsST.d.cts.map +1 -0
  88. package/dist/execution-CqOWMsST.d.mts +24 -0
  89. package/dist/execution-CqOWMsST.d.mts.map +1 -0
  90. package/dist/index.cjs +47 -0
  91. package/dist/index.d.cts +22 -0
  92. package/dist/index.d.cts.map +1 -0
  93. package/dist/index.d.mts +22 -0
  94. package/dist/index.d.mts.map +1 -0
  95. package/dist/index.mjs +48 -0
  96. package/dist/index.mjs.map +1 -0
  97. package/dist/meta-CDUo2qw9.d.cts +24 -0
  98. package/dist/meta-CDUo2qw9.d.cts.map +1 -0
  99. package/dist/meta-CDUo2qw9.d.mts +24 -0
  100. package/dist/meta-CDUo2qw9.d.mts.map +1 -0
  101. package/dist/output-Cd9yv0DZ.d.cts +25 -0
  102. package/dist/output-Cd9yv0DZ.d.cts.map +1 -0
  103. package/dist/output-D_ovZIyg.d.mts +25 -0
  104. package/dist/output-D_ovZIyg.d.mts.map +1 -0
  105. package/dist/render-Bh6nE1bo.cjs +1 -0
  106. package/dist/render-UH3hN5fr.mjs +2 -0
  107. package/dist/render-UH3hN5fr.mjs.map +1 -0
  108. package/dist/render.cjs +1 -0
  109. package/dist/render.d.cts +22 -0
  110. package/dist/render.d.cts.map +1 -0
  111. package/dist/render.d.mts +22 -0
  112. package/dist/render.d.mts.map +1 -0
  113. package/dist/render.mjs +1 -0
  114. package/dist/schema-pTK0-GHm.d.cts +39 -0
  115. package/dist/schema-pTK0-GHm.d.cts.map +1 -0
  116. package/dist/schema-pTK0-GHm.d.mts +39 -0
  117. package/dist/schema-pTK0-GHm.d.mts.map +1 -0
  118. package/dist/session-CyeJNmog.d.cts +63 -0
  119. package/dist/session-CyeJNmog.d.cts.map +1 -0
  120. package/dist/session-CyeJNmog.d.mts +63 -0
  121. package/dist/session-CyeJNmog.d.mts.map +1 -0
  122. package/dist/single-line-comment-CLBiy5aI.d.mts +20 -0
  123. package/dist/single-line-comment-CLBiy5aI.d.mts.map +1 -0
  124. package/dist/single-line-comment-WhWXKvku.d.cts +20 -0
  125. package/dist/single-line-comment-WhWXKvku.d.cts.map +1 -0
  126. package/dist/source-file-CW1A6SJ9.d.cts +24 -0
  127. package/dist/source-file-CW1A6SJ9.d.cts.map +1 -0
  128. package/dist/source-file-Cn1xO9t5.d.mts +24 -0
  129. package/dist/source-file-Cn1xO9t5.d.mts.map +1 -0
  130. package/dist/source-file-K_2P7eFP.cjs +1 -0
  131. package/dist/source-file-t3itBybg.mjs +2 -0
  132. package/dist/source-file-t3itBybg.mjs.map +1 -0
  133. package/dist/spacing-CGrdAoZW.d.cts +21 -0
  134. package/dist/spacing-CGrdAoZW.d.cts.map +1 -0
  135. package/dist/spacing-CGrdAoZW.d.mts +21 -0
  136. package/dist/spacing-CGrdAoZW.d.mts.map +1 -0
  137. package/package.json +337 -0
@@ -0,0 +1,22 @@
1
+ import { Children } from "@alloy-js/core";
2
+ import { ExecutionContext, GeneratorFunctionResult } from "@power-plant/core";
3
+
4
+ //#region src/render.d.ts
5
+ /**
6
+ * A function to render children components within the [Alloy](https://alloy-framework.github.io) context, and register any generated documents on the execution context.
7
+ *
8
+ * @example
9
+ * ```tsx
10
+ * import { render } from "@power-plant/alloy-js/render";
11
+ *
12
+ * await render(context, spec, <> ... </>);
13
+ * ```
14
+ *
15
+ * @param context - The Power Plant execution context.
16
+ * @param children - The children components to render.
17
+ * @returns A promise that resolves when rendering is complete.
18
+ */
19
+ declare function render<TSpec, TOptions extends object, TReturns = void>(context: ExecutionContext<TSpec, TOptions, TReturns>, spec: TSpec, children: Children): Promise<GeneratorFunctionResult<TSpec, TOptions>>;
20
+ //#endregion
21
+ export { render };
22
+ //# sourceMappingURL=render.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render.d.mts","names":[],"sources":["../src/render.tsx"],"mappings":""}
@@ -0,0 +1 @@
1
+ import{t as e}from"./render-UH3hN5fr.mjs";export{e as render};
@@ -0,0 +1,39 @@
1
+ import { ComponentContext } from "@alloy-js/core";
2
+ import { JsonSchemaLike } from "@power-plant/schema";
3
+
4
+ //#region src/core/contexts/schema.d.ts
5
+ /**
6
+ * The schema context used in template rendering.
7
+ */
8
+ declare const SchemaContext: ComponentContext<JsonSchemaLike>;
9
+ /**
10
+ * Hook to access the schema context.
11
+ *
12
+ * @returns A reactive version of the current schema.
13
+ */
14
+ declare function useSchema(): JsonSchemaLike;
15
+ /**
16
+ * Hook to safely access the schema context.
17
+ *
18
+ * @returns The schema context or undefined if not set.
19
+ */
20
+ declare function useSchemaSafe(): JsonSchemaLike | undefined;
21
+ /**
22
+ * The schema property context used in template rendering.
23
+ */
24
+ declare const SchemaPropertyContext: ComponentContext<JsonSchemaLike>;
25
+ /**
26
+ * Hook to access the Schema Property context.
27
+ *
28
+ * @returns A reactive version of the current schema property.
29
+ */
30
+ declare function useSchemaProperty(): JsonSchemaLike;
31
+ /**
32
+ * Hook to safely access the schema property context.
33
+ *
34
+ * @returns The schema property context or undefined if not set.
35
+ */
36
+ declare function useSchemaPropertySafe(): JsonSchemaLike | undefined;
37
+ //#endregion
38
+ export { useSchemaPropertySafe as a, useSchemaProperty as i, SchemaPropertyContext as n, useSchemaSafe as o, useSchema as r, SchemaContext as t };
39
+ //# sourceMappingURL=schema-pTK0-GHm.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-pTK0-GHm.d.cts","names":[],"sources":["../src/core/contexts/schema.ts"],"mappings":";;;;;;AAyBA;cAAa,aAAA,EAAe,gBAAgB,CAAC,cAAA;;;AAAc;AAQ3D;;iBAAgB,SAAA,IAAa,cAAc;;AAAA;AAgB3C;;;iBAAgB,aAAA,IAAiB,cAAc;AAAA;AAO/C;;AAP+C,cAOlC,qBAAA,EAAuB,gBAAgB,CAAC,cAAA;;AAAc;AAQnE;;;iBAAgB,iBAAA,IAAiB,cAAA;AAAA;AAgBjC;;;;AAhBiC,iBAgBjB,qBAAA,IAAyB,cAAc"}
@@ -0,0 +1,39 @@
1
+ import { ComponentContext } from "@alloy-js/core";
2
+ import { JsonSchemaLike } from "@power-plant/schema";
3
+
4
+ //#region src/core/contexts/schema.d.ts
5
+ /**
6
+ * The schema context used in template rendering.
7
+ */
8
+ declare const SchemaContext: ComponentContext<JsonSchemaLike>;
9
+ /**
10
+ * Hook to access the schema context.
11
+ *
12
+ * @returns A reactive version of the current schema.
13
+ */
14
+ declare function useSchema(): JsonSchemaLike;
15
+ /**
16
+ * Hook to safely access the schema context.
17
+ *
18
+ * @returns The schema context or undefined if not set.
19
+ */
20
+ declare function useSchemaSafe(): JsonSchemaLike | undefined;
21
+ /**
22
+ * The schema property context used in template rendering.
23
+ */
24
+ declare const SchemaPropertyContext: ComponentContext<JsonSchemaLike>;
25
+ /**
26
+ * Hook to access the Schema Property context.
27
+ *
28
+ * @returns A reactive version of the current schema property.
29
+ */
30
+ declare function useSchemaProperty(): JsonSchemaLike;
31
+ /**
32
+ * Hook to safely access the schema property context.
33
+ *
34
+ * @returns The schema property context or undefined if not set.
35
+ */
36
+ declare function useSchemaPropertySafe(): JsonSchemaLike | undefined;
37
+ //#endregion
38
+ export { useSchemaPropertySafe as a, useSchemaProperty as i, SchemaPropertyContext as n, useSchemaSafe as o, useSchema as r, SchemaContext as t };
39
+ //# sourceMappingURL=schema-pTK0-GHm.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-pTK0-GHm.d.mts","names":[],"sources":["../src/core/contexts/schema.ts"],"mappings":""}
@@ -0,0 +1,63 @@
1
+ import { ComponentContext } from "@alloy-js/core";
2
+ import { Device, SessionContext, Tenant, User } from "@power-plant/core";
3
+
4
+ //#region src/core/contexts/session.d.ts
5
+ /**
6
+ * The session context used to access the session data.
7
+ */
8
+ declare const SessionContext$1: ComponentContext<SessionContext>;
9
+ /**
10
+ * Hook to access the session context.
11
+ *
12
+ * @returns The session context.
13
+ * @throws An error if the session context is not set.
14
+ */
15
+ declare function useSession(): SessionContext;
16
+ /**
17
+ * Hook to safely access the session context.
18
+ *
19
+ * @returns The session context or undefined if not set.
20
+ */
21
+ declare function useSessionSafe(): SessionContext | undefined;
22
+ /**
23
+ * Hook to access the device context.
24
+ *
25
+ * @returns The device.
26
+ * @throws An error if the device is not set.
27
+ */
28
+ declare function useDevice(): Device;
29
+ /**
30
+ * Hook to safely access the device context.
31
+ *
32
+ * @returns The device or undefined if not set.
33
+ */
34
+ declare function useDeviceSafe(): Device | undefined;
35
+ /**
36
+ * Hook to access the user context.
37
+ *
38
+ * @returns The user.
39
+ * @throws An error if the user is not set.
40
+ */
41
+ declare function useUser(): User;
42
+ /**
43
+ * Hook to safely access the user context.
44
+ *
45
+ * @returns The user or undefined if not set.
46
+ */
47
+ declare function useUserSafe(): User | undefined;
48
+ /**
49
+ * Hook to access the tenant context.
50
+ *
51
+ * @returns The tenant.
52
+ * @throws An error if the tenant is not set.
53
+ */
54
+ declare function useTenant(): Tenant;
55
+ /**
56
+ * Hook to safely access the tenant context.
57
+ *
58
+ * @returns The tenant or undefined if not set.
59
+ */
60
+ declare function useTenantSafe(): Tenant | undefined;
61
+ //#endregion
62
+ export { useSessionSafe as a, useUser as c, useSession as i, useUserSafe as l, useDevice as n, useTenant as o, useDeviceSafe as r, useTenantSafe as s, SessionContext$1 as t };
63
+ //# sourceMappingURL=session-CyeJNmog.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-CyeJNmog.d.cts","names":[],"sources":["../src/core/contexts/session.ts"],"mappings":";;;;;;AA8BA;cAAa,gBAAA,EAAgB,gBAAgB,CAAC,cAAA;;;AAAkB;AAShE;;;iBAAgB,UAAA,IAAc,cAAkB;AAAA;AAgBhD;;;;AAhBgD,iBAgBhC,cAAA,IAAkB,cAAkB;AAUpD;;;;AAAmC;AAWnC;AAXA,iBAAgB,SAAA,IAAa,MAAM;;;AAWI;AAYvC;;iBAZgB,aAAA,IAAiB,MAAM;;AAYR;AAW/B;;;;iBAXgB,OAAA,IAAW,IAAI;AAuB/B;;;;AAAmC;AAAnC,iBAZgB,WAAA,IAAe,IAAI;;;;AAuBI;;;iBAXvB,SAAA,IAAa,MAAM;;;;;;iBAWnB,aAAA,IAAiB,MAAM"}
@@ -0,0 +1,63 @@
1
+ import { ComponentContext } from "@alloy-js/core";
2
+ import { Device, SessionContext, Tenant, User } from "@power-plant/core";
3
+
4
+ //#region src/core/contexts/session.d.ts
5
+ /**
6
+ * The session context used to access the session data.
7
+ */
8
+ declare const SessionContext$1: ComponentContext<SessionContext>;
9
+ /**
10
+ * Hook to access the session context.
11
+ *
12
+ * @returns The session context.
13
+ * @throws An error if the session context is not set.
14
+ */
15
+ declare function useSession(): SessionContext;
16
+ /**
17
+ * Hook to safely access the session context.
18
+ *
19
+ * @returns The session context or undefined if not set.
20
+ */
21
+ declare function useSessionSafe(): SessionContext | undefined;
22
+ /**
23
+ * Hook to access the device context.
24
+ *
25
+ * @returns The device.
26
+ * @throws An error if the device is not set.
27
+ */
28
+ declare function useDevice(): Device;
29
+ /**
30
+ * Hook to safely access the device context.
31
+ *
32
+ * @returns The device or undefined if not set.
33
+ */
34
+ declare function useDeviceSafe(): Device | undefined;
35
+ /**
36
+ * Hook to access the user context.
37
+ *
38
+ * @returns The user.
39
+ * @throws An error if the user is not set.
40
+ */
41
+ declare function useUser(): User;
42
+ /**
43
+ * Hook to safely access the user context.
44
+ *
45
+ * @returns The user or undefined if not set.
46
+ */
47
+ declare function useUserSafe(): User | undefined;
48
+ /**
49
+ * Hook to access the tenant context.
50
+ *
51
+ * @returns The tenant.
52
+ * @throws An error if the tenant is not set.
53
+ */
54
+ declare function useTenant(): Tenant;
55
+ /**
56
+ * Hook to safely access the tenant context.
57
+ *
58
+ * @returns The tenant or undefined if not set.
59
+ */
60
+ declare function useTenantSafe(): Tenant | undefined;
61
+ //#endregion
62
+ export { useSessionSafe as a, useUser as c, useSession as i, useUserSafe as l, useDevice as n, useTenant as o, useDeviceSafe as r, useTenantSafe as s, SessionContext$1 as t };
63
+ //# sourceMappingURL=session-CyeJNmog.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-CyeJNmog.d.mts","names":[],"sources":["../src/core/contexts/session.ts"],"mappings":""}
@@ -0,0 +1,20 @@
1
+ import { t as ComponentProps } from "./components-Lfo1yjgU.mjs";
2
+
3
+ //#region src/core/components/single-line-comment.d.ts
4
+ type SingleLineCommentVariant = "double-slash" | "triple-slash" | "slash-star" | "slash-star-star" | "markdown" | "yaml" | "hcl";
5
+ interface SingleLineCommentProps extends ComponentProps {
6
+ /**
7
+ * The variant of the single line comment.
8
+ *
9
+ * @defaultValue "double-slash"
10
+ */
11
+ variant?: SingleLineCommentVariant;
12
+ }
13
+ /**
14
+ * A single line comment block. The children are rendered as a prose element, which means that they
15
+ * are broken into multiple lines
16
+ */
17
+ declare function SingleLineComment(props: SingleLineCommentProps): import("@alloy-js/core").Children;
18
+ //#endregion
19
+ export { SingleLineCommentProps as n, SingleLineCommentVariant as r, SingleLineComment as t };
20
+ //# sourceMappingURL=single-line-comment-CLBiy5aI.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"single-line-comment-CLBiy5aI.d.mts","names":[],"sources":["../src/core/components/single-line-comment.tsx"],"mappings":""}
@@ -0,0 +1,20 @@
1
+ import { t as ComponentProps } from "./components-Lfo1yjgU.cjs";
2
+
3
+ //#region src/core/components/single-line-comment.d.ts
4
+ type SingleLineCommentVariant = "double-slash" | "triple-slash" | "slash-star" | "slash-star-star" | "markdown" | "yaml" | "hcl";
5
+ interface SingleLineCommentProps extends ComponentProps {
6
+ /**
7
+ * The variant of the single line comment.
8
+ *
9
+ * @defaultValue "double-slash"
10
+ */
11
+ variant?: SingleLineCommentVariant;
12
+ }
13
+ /**
14
+ * A single line comment block. The children are rendered as a prose element, which means that they
15
+ * are broken into multiple lines
16
+ */
17
+ declare function SingleLineComment(props: SingleLineCommentProps): import("@alloy-js/core").Children;
18
+ //#endregion
19
+ export { SingleLineCommentProps as n, SingleLineCommentVariant as r, SingleLineComment as t };
20
+ //# sourceMappingURL=single-line-comment-WhWXKvku.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"single-line-comment-WhWXKvku.d.cts","names":[],"sources":["../src/core/components/single-line-comment.tsx"],"mappings":";;;KAqBY,wBAAA;AAAA,UASK,sBAAA,SAA+B,cAAc;EATlD;;;;AAAwB;EAelC,OAAA,GAAU,wBAAA;AAAA;;;;;iBAOI,iBAAA,CAAkB,KAAA,EAAO,sBAAsB,4BAAA,QAAA"}
@@ -0,0 +1,24 @@
1
+ import { t as ComponentProps } from "./components-Lfo1yjgU.cjs";
2
+ import { SourceFileProps } from "@alloy-js/core";
3
+ import { MetaConfig } from "@power-plant/core";
4
+
5
+ //#region src/core/components/source-file.d.ts
6
+ type SourceFileProps$1<TSpec, TOptions extends object> = SourceFileProps & ComponentProps & {
7
+ /**
8
+ * The metadata associated with the source file.
9
+ *
10
+ * @remarks
11
+ * The values stored in the metadata will be available in the rendering context.
12
+ */
13
+ meta?: MetaConfig<TSpec, TOptions>;
14
+ };
15
+ /**
16
+ * A base component representing a generated source file.
17
+ *
18
+ * @param props - The properties for the source file.
19
+ * @returns The rendered source file component.
20
+ */
21
+ declare function SourceFile<TSpec, TOptions extends object>(props: SourceFileProps$1<TSpec, TOptions>): import("@alloy-js/core").Children;
22
+ //#endregion
23
+ export { SourceFileProps$1 as n, SourceFile as t };
24
+ //# sourceMappingURL=source-file-CW1A6SJ9.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-file-CW1A6SJ9.d.cts","names":[],"sources":["../src/core/components/source-file.tsx"],"mappings":";;;;;KAkCY,iBAAA,mCAGR,eAAA,GACF,cAAA;;AAJF;;;;;EAWI,IAAA,GAAO,UAAA,CAAW,KAAA,EAAO,QAAA;AAAA;;;;;;;iBASb,UAAA,iCACd,KAAA,EAAO,iBAAA,CAAgB,KAAA,EAAO,QAAA,6BAAS,QAAA"}
@@ -0,0 +1,24 @@
1
+ import { t as ComponentProps } from "./components-Lfo1yjgU.mjs";
2
+ import { SourceFileProps } from "@alloy-js/core";
3
+ import { MetaConfig } from "@power-plant/core";
4
+
5
+ //#region src/core/components/source-file.d.ts
6
+ type SourceFileProps$1<TSpec, TOptions extends object> = SourceFileProps & ComponentProps & {
7
+ /**
8
+ * The metadata associated with the source file.
9
+ *
10
+ * @remarks
11
+ * The values stored in the metadata will be available in the rendering context.
12
+ */
13
+ meta?: MetaConfig<TSpec, TOptions>;
14
+ };
15
+ /**
16
+ * A base component representing a generated source file.
17
+ *
18
+ * @param props - The properties for the source file.
19
+ * @returns The rendered source file component.
20
+ */
21
+ declare function SourceFile<TSpec, TOptions extends object>(props: SourceFileProps$1<TSpec, TOptions>): import("@alloy-js/core").Children;
22
+ //#endregion
23
+ export { SourceFileProps$1 as n, SourceFile as t };
24
+ //# sourceMappingURL=source-file-Cn1xO9t5.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-file-Cn1xO9t5.d.mts","names":[],"sources":["../src/core/components/source-file.tsx"],"mappings":""}
@@ -0,0 +1 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));const l=require("./core/contexts/meta.cjs");let u=require("@alloy-js/core/jsx-runtime"),d=require("@alloy-js/core"),f=require("defu");f=c(f,1);function p(){return typeof process<`u`&&typeof process.cwd==`function`?process.cwd().replace(/\\/g,`/`):`/`}const m=/^[A-Z]:\//i,h=/^[A-Z]:$/i,g=/^[/\\]{2}/,_=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^~[/\\]|^[A-Z]:[/\\]/i;function v(e){return _.test(b(e))}function y(e){return v(e)}function b(e){return e.startsWith(`\\\\?\\`)?e:e.replace(/\\/g,`/`)}function x(e,t){let n=b(e.replaceAll(/\\/g,`/`).replace(/\/*$/,``))?.toLowerCase(),r=b(t.replaceAll(/\\/g,`/`).replace(/\/*$/,``))?.toLowerCase();return e!==t&&n!==r&&n.startsWith(`${r}/`)}function S(e=``){return e&&e.replace(/\\/g,`/`).replace(m,e=>e.toUpperCase())}function C(e){if(!e||e.length===0)return`.`;e=S(e);let t=e.match(g),n=y(e),r=e[e.length-1]===`/`;return e=T(e,!n),e.length===0?n?`/`:r?`./`:`.`:(r&&(e+=`/`),h.test(e)&&(e+=`/`),t?n?`//${e}`:`//./${e}`:n&&!y(e)?`/${e}`:e)}function w(...e){let t=``;for(let n of e)n&&b(n).replaceAll(/\//g,``)!==`.`&&(t?t=b(n).replaceAll(/\//g,``)===`..`?b(t).replace(/\/+$/,``).replace(/\/*[^/]+$/,``):`${b(t).replace(/\/+$/,``)}/${b(n).replace(/^\/+/,``)}`:b(n).replaceAll(/\//g,``)!==`..`&&(t=n));return C(t)}function T(e,t){let n=``,r=0,i=-1,a=0,o=null;for(let s=0;s<=e.length;++s){if(s<e.length)o=e[s];else if(o===`/`)break;else o=`/`;if(o===`/`){if(!(i===s-1||a===1))if(a===2){if(n.length<2||r!==2||n[n.length-1]!==`.`||n[n.length-2]!==`.`){if(n.length>2){let e=n.lastIndexOf(`/`);e===-1?(n=``,r=0):(n=n.slice(0,e),r=n.length-1-n.lastIndexOf(`/`)),i=s,a=0;continue}else if(n.length>0){n=``,r=0,i=s,a=0;continue}}t&&(n+=n.length>0?`/..`:`..`,r=2)}else n.length>0?n+=`/${e.slice(i+1,s)}`:n=e.slice(i+1,s),r=s-i-1;i=s,a=0}else o===`.`&&a!==-1?++a:a=-1}return n}function E(e,t=p(),n={}){return b(n.skipIfAlreadyParent!==!1&&x(e,t)?e:w(t,e))}function D(e){let[{children:t,meta:n,path:r,header:i,filetype:a,reference:o}]=(0,d.splitProps)(e,[`children`,`meta`,`path`,`header`,`filetype`,`reference`]),s=l.useMeta(),c=(0,d.useContext)(d.SourceDirectoryContext),p={path:E(r,c.path),filetype:a,reference:o};c?.addContent(p);let m=(0,d.useFormatOptions)({printWidth:e.printWidth,tabWidth:e.tabWidth,useTabs:e.useTabs,insertFinalNewLine:e.insertFinalNewLine}),h=(0,d.getContext)();return h.meta=(0,f.default)({sourceFile:p,printOptions:m},n??{}),s&&(s[p.path]={...n??{}}),(0,u.createComponent)(d.SourceFileContext.Provider,{value:p,get children(){return[(0,u.createComponent)(d.Show,{when:i!==void 0,get children(){return[i,(0,u.createIntrinsic)(`hbr`,{})]}}),t]}})}Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return D}});
@@ -0,0 +1,2 @@
1
+ import{useMeta as e}from"./core/contexts/meta.mjs";import{createComponent as t,createIntrinsic as n}from"@alloy-js/core/jsx-runtime";import{Show as r,SourceDirectoryContext as i,SourceFileContext as a,getContext as o,splitProps as s,useContext as c,useFormatOptions as l}from"@alloy-js/core";import u from"defu";function d(){return typeof process<`u`&&typeof process.cwd==`function`?process.cwd().replace(/\\/g,`/`):`/`}const f=/^[A-Z]:\//i,p=/^[A-Z]:$/i,m=/^[/\\]{2}/,h=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^~[/\\]|^[A-Z]:[/\\]/i;function g(e){return h.test(v(e))}function _(e){return g(e)}function v(e){return e.startsWith(`\\\\?\\`)?e:e.replace(/\\/g,`/`)}function y(e,t){let n=v(e.replaceAll(/\\/g,`/`).replace(/\/*$/,``))?.toLowerCase(),r=v(t.replaceAll(/\\/g,`/`).replace(/\/*$/,``))?.toLowerCase();return e!==t&&n!==r&&n.startsWith(`${r}/`)}function b(e=``){return e&&e.replace(/\\/g,`/`).replace(f,e=>e.toUpperCase())}function x(e){if(!e||e.length===0)return`.`;e=b(e);let t=e.match(m),n=_(e),r=e[e.length-1]===`/`;return e=C(e,!n),e.length===0?n?`/`:r?`./`:`.`:(r&&(e+=`/`),p.test(e)&&(e+=`/`),t?n?`//${e}`:`//./${e}`:n&&!_(e)?`/${e}`:e)}function S(...e){let t=``;for(let n of e)n&&v(n).replaceAll(/\//g,``)!==`.`&&(t?t=v(n).replaceAll(/\//g,``)===`..`?v(t).replace(/\/+$/,``).replace(/\/*[^/]+$/,``):`${v(t).replace(/\/+$/,``)}/${v(n).replace(/^\/+/,``)}`:v(n).replaceAll(/\//g,``)!==`..`&&(t=n));return x(t)}function C(e,t){let n=``,r=0,i=-1,a=0,o=null;for(let s=0;s<=e.length;++s){if(s<e.length)o=e[s];else if(o===`/`)break;else o=`/`;if(o===`/`){if(!(i===s-1||a===1))if(a===2){if(n.length<2||r!==2||n[n.length-1]!==`.`||n[n.length-2]!==`.`){if(n.length>2){let e=n.lastIndexOf(`/`);e===-1?(n=``,r=0):(n=n.slice(0,e),r=n.length-1-n.lastIndexOf(`/`)),i=s,a=0;continue}else if(n.length>0){n=``,r=0,i=s,a=0;continue}}t&&(n+=n.length>0?`/..`:`..`,r=2)}else n.length>0?n+=`/${e.slice(i+1,s)}`:n=e.slice(i+1,s),r=s-i-1;i=s,a=0}else o===`.`&&a!==-1?++a:a=-1}return n}function w(e,t=d(),n={}){return v(n.skipIfAlreadyParent!==!1&&y(e,t)?e:S(t,e))}function T(d){let[{children:f,meta:p,path:m,header:h,filetype:g,reference:_}]=s(d,[`children`,`meta`,`path`,`header`,`filetype`,`reference`]),v=e(),y=c(i),b={path:w(m,y.path),filetype:g,reference:_};y?.addContent(b);let x=l({printWidth:d.printWidth,tabWidth:d.tabWidth,useTabs:d.useTabs,insertFinalNewLine:d.insertFinalNewLine}),S=o();return S.meta=u({sourceFile:b,printOptions:x},p??{}),v&&(v[b.path]={...p??{}}),t(a.Provider,{value:b,get children(){return[t(r,{when:h!==void 0,get children(){return[h,n(`hbr`,{})]}}),f]}})}export{d as i,y as n,v as r,T as t};
2
+ //# sourceMappingURL=source-file-t3itBybg.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-file-t3itBybg.mjs","names":[],"sources":[],"mappings":""}
@@ -0,0 +1,21 @@
1
+ //#region src/core/components/spacing.d.ts
2
+ interface SpacingProps {
3
+ /**
4
+ * A scale factor that determines the amount of vertical space to be added.
5
+ *
6
+ * @remarks
7
+ * The default value is 1, which corresponds to a standard spacing. A value of 2 would double the spacing, while a value of 0.5 would halve it.
8
+ *
9
+ * @defaultValue 1
10
+ */
11
+ scale?: number;
12
+ }
13
+ /**
14
+ * A simple component that renders two horizontal breaks to create vertical spacing between elements.
15
+ */
16
+ declare function Spacing({
17
+ scale
18
+ }: SpacingProps): import("@alloy-js/core").Children;
19
+ //#endregion
20
+ export { SpacingProps as n, Spacing as t };
21
+ //# sourceMappingURL=spacing-CGrdAoZW.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spacing-CGrdAoZW.d.cts","names":[],"sources":["../src/core/components/spacing.tsx"],"mappings":";UAoBiB,YAAA;EAAA;;;;AASV;AAMP;;;EANE,KAAK;AAAA;;;;iBAMS,OAAA;EAAU;AAAA,GAAa,YAAY,4BAAA,QAAA"}
@@ -0,0 +1,21 @@
1
+ //#region src/core/components/spacing.d.ts
2
+ interface SpacingProps {
3
+ /**
4
+ * A scale factor that determines the amount of vertical space to be added.
5
+ *
6
+ * @remarks
7
+ * The default value is 1, which corresponds to a standard spacing. A value of 2 would double the spacing, while a value of 0.5 would halve it.
8
+ *
9
+ * @defaultValue 1
10
+ */
11
+ scale?: number;
12
+ }
13
+ /**
14
+ * A simple component that renders two horizontal breaks to create vertical spacing between elements.
15
+ */
16
+ declare function Spacing({
17
+ scale
18
+ }: SpacingProps): import("@alloy-js/core").Children;
19
+ //#endregion
20
+ export { SpacingProps as n, Spacing as t };
21
+ //# sourceMappingURL=spacing-CGrdAoZW.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spacing-CGrdAoZW.d.mts","names":[],"sources":["../src/core/components/spacing.tsx"],"mappings":""}