@powerlines/plugin-alloy 0.26.220 → 0.26.221
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/index.d.cts +3 -2
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +3 -2
- package/dist/markdown/components/markdown-table.cjs +8 -3
- package/dist/markdown/components/markdown-table.d.cts +13 -0
- package/dist/markdown/components/markdown-table.d.cts.map +1 -1
- package/dist/markdown/components/markdown-table.d.mts +13 -0
- package/dist/markdown/components/markdown-table.mjs +8 -3
- package/package.json +7 -7
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BuiltinSourceFileContext, ComponentProps, ComponentPropsWithChildren, CopyFileOutputContext, CopyOutputFile, OutputDirectory, OutputFile, ReflectionOverrideInterface, RenderBuiltinContext, RenderContext, RenderEntryContext, RenderOutputContext, SourceFileHeaderProps, TypescriptFileImportItem, TypescriptFileImports, WriteOutputFile } from "./types/components.cjs";
|
|
2
|
+
import { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig } from "./types/plugin.cjs";
|
|
2
3
|
import { Plugin } from "powerlines";
|
|
3
4
|
|
|
4
5
|
//#region src/index.d.ts
|
|
@@ -15,5 +16,5 @@ declare module "powerlines" {
|
|
|
15
16
|
*/
|
|
16
17
|
declare const plugin: <TContext extends AlloyPluginContext = AlloyPluginContext>(options?: AlloyPluginOptions) => Plugin<TContext>[];
|
|
17
18
|
//#endregion
|
|
18
|
-
export { plugin as default, plugin };
|
|
19
|
+
export { type AlloyPluginContext, type AlloyPluginOptions, type AlloyPluginResolvedConfig, type AlloyPluginUserConfig, type BuiltinSourceFileContext, type ComponentProps, type ComponentPropsWithChildren, type CopyFileOutputContext, type CopyOutputFile, type OutputDirectory, type OutputFile, type ReflectionOverrideInterface, type RenderBuiltinContext, type RenderContext, type RenderEntryContext, type RenderOutputContext, type SourceFileHeaderProps, type TypescriptFileImportItem, type TypescriptFileImports, type WriteOutputFile, plugin as default, plugin };
|
|
19
20
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;;YA0BY,MAAA;IACR,KAAA,GAAQ,kBAAkB;EAAA;AAAA;;;;;;;cAUjB,MAAA,oBACM,kBAAA,GAAqB,kBAAA,EAEtC,OAAA,GAAS,kBAAA,KA2DJ,MAAA,CAAO,QAAA"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BuiltinSourceFileContext, ComponentProps, ComponentPropsWithChildren, CopyFileOutputContext, CopyOutputFile, OutputDirectory, OutputFile, ReflectionOverrideInterface, RenderBuiltinContext, RenderContext, RenderEntryContext, RenderOutputContext, SourceFileHeaderProps, TypescriptFileImportItem, TypescriptFileImports, WriteOutputFile } from "./types/components.mjs";
|
|
2
|
+
import { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig } from "./types/plugin.mjs";
|
|
2
3
|
import { Plugin } from "powerlines";
|
|
3
4
|
|
|
4
5
|
//#region src/index.d.ts
|
|
@@ -15,5 +16,5 @@ declare module "powerlines" {
|
|
|
15
16
|
*/
|
|
16
17
|
declare const plugin: <TContext extends AlloyPluginContext = AlloyPluginContext>(options?: AlloyPluginOptions) => Plugin<TContext>[];
|
|
17
18
|
//#endregion
|
|
18
|
-
export { plugin as default, plugin };
|
|
19
|
+
export { type AlloyPluginContext, type AlloyPluginOptions, type AlloyPluginResolvedConfig, type AlloyPluginUserConfig, type BuiltinSourceFileContext, type ComponentProps, type ComponentPropsWithChildren, type CopyFileOutputContext, type CopyOutputFile, type OutputDirectory, type OutputFile, type ReflectionOverrideInterface, type RenderBuiltinContext, type RenderContext, type RenderEntryContext, type RenderOutputContext, type SourceFileHeaderProps, type TypescriptFileImportItem, type TypescriptFileImports, type WriteOutputFile, plugin as default, plugin };
|
|
19
20
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -10,8 +10,13 @@ let _stryke_type_checks_is_undefined = require("@stryke/type-checks/is-undefined
|
|
|
10
10
|
* Component that provides a context for rendering markdown tables.
|
|
11
11
|
*/
|
|
12
12
|
function MarkdownTable(props) {
|
|
13
|
-
const [{ children, data }] = (0, _alloy_js_core.splitProps)(props, [
|
|
14
|
-
|
|
13
|
+
const [{ children, columns, data }] = (0, _alloy_js_core.splitProps)(props, [
|
|
14
|
+
"children",
|
|
15
|
+
"columns",
|
|
16
|
+
"data"
|
|
17
|
+
]);
|
|
18
|
+
if (data.length === 0) return null;
|
|
19
|
+
const cols = (0, _alloy_js_core.computed)(() => columns && columns.length > 0 ? columns : Object.keys(data[0] ?? {}).map((name, index) => ({
|
|
15
20
|
index,
|
|
16
21
|
name,
|
|
17
22
|
align: "left",
|
|
@@ -20,7 +25,7 @@ function MarkdownTable(props) {
|
|
|
20
25
|
return (0, _alloy_js_core_jsx_runtime.createComponent)(require_markdown_contexts_markdown_table.MarkdownTableContext.Provider, {
|
|
21
26
|
get value() {
|
|
22
27
|
return {
|
|
23
|
-
columns:
|
|
28
|
+
columns: cols.value,
|
|
24
29
|
data
|
|
25
30
|
};
|
|
26
31
|
},
|
|
@@ -3,6 +3,19 @@ import { MarkdownTableColumnContextInterface } from "../contexts/markdown-table.
|
|
|
3
3
|
|
|
4
4
|
//#region src/markdown/components/markdown-table.d.ts
|
|
5
5
|
interface MarkdownTableProps<T extends Record<string, any> = Record<string, any>> extends ComponentProps {
|
|
6
|
+
/**
|
|
7
|
+
* An optional array of column definitions. If not provided, columns will be inferred from the keys of the first data object.
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* This prop allows you to explicitly define the columns of the markdown table, including their order, alignment, and width. If this prop is not provided, the component will attempt to infer the columns from the keys of the first object in the `data` array. Each column definition should include the `name` of the column (which corresponds to a key in the data objects), an optional `align` property to specify text alignment (left, right, or center), and an optional `width` property to specify the width of the column in characters.
|
|
11
|
+
*/
|
|
12
|
+
columns?: MarkdownTableColumnContextInterface<T>[];
|
|
13
|
+
/**
|
|
14
|
+
* An array of data objects to be rendered in the markdown table. Each object should have keys corresponding to the column names.
|
|
15
|
+
*
|
|
16
|
+
* @remarks
|
|
17
|
+
* This prop is required and should contain an array of objects representing the rows of the markdown table. Each object should have keys that correspond to the `name` properties defined in the `columns` prop (or inferred from the first object if `columns` is not provided). The values of these keys will be rendered in the respective columns of the table. If the `data` array is empty, the component will render nothing.
|
|
18
|
+
*/
|
|
6
19
|
data: T[];
|
|
7
20
|
}
|
|
8
21
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown-table.d.cts","names":[],"sources":["../../../src/markdown/components/markdown-table.tsx"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"markdown-table.d.cts","names":[],"sources":["../../../src/markdown/components/markdown-table.tsx"],"mappings":";;;;UA6BiB,kBAAA,WACL,MAAA,gBAAsB,MAAA,uBACxB,cAAA;;AAFV;;;;;EASE,OAAA,GAAU,mCAAA,CAAoC,CAAA;EAApC;;;;;;EAQV,IAAA,EAAM,CAAA;AAAA;;;;iBAMQ,aAAA,WACJ,MAAA,gBAAsB,MAAA,eAChC,KAAA,EAAO,kBAAA,CAAmB,CAAA,6BAAE,QAAA;AAAA,KAkClB,wBAAA,GAA2B,cAAA,GACrC,OAAA,CAAQ,IAAA,CAAK,mCAAA,cACb,QAAA,CAAS,IAAA,CAAK,mCAAA;EACZ,KAAA;AAAA;AA7CK;AAMT;;AANS,iBAmDO,mBAAA,CAAoB,KAAA,EAAO,wBAAwB,4BAAA,QAAA;;;;iBA6CnD,yBAAA,CAA0B,KAAA,EAAO,wBAAwB,4BAAA,QAAA"}
|
|
@@ -3,6 +3,19 @@ import { MarkdownTableColumnContextInterface } from "../contexts/markdown-table.
|
|
|
3
3
|
|
|
4
4
|
//#region src/markdown/components/markdown-table.d.ts
|
|
5
5
|
interface MarkdownTableProps<T extends Record<string, any> = Record<string, any>> extends ComponentProps {
|
|
6
|
+
/**
|
|
7
|
+
* An optional array of column definitions. If not provided, columns will be inferred from the keys of the first data object.
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* This prop allows you to explicitly define the columns of the markdown table, including their order, alignment, and width. If this prop is not provided, the component will attempt to infer the columns from the keys of the first object in the `data` array. Each column definition should include the `name` of the column (which corresponds to a key in the data objects), an optional `align` property to specify text alignment (left, right, or center), and an optional `width` property to specify the width of the column in characters.
|
|
11
|
+
*/
|
|
12
|
+
columns?: MarkdownTableColumnContextInterface<T>[];
|
|
13
|
+
/**
|
|
14
|
+
* An array of data objects to be rendered in the markdown table. Each object should have keys corresponding to the column names.
|
|
15
|
+
*
|
|
16
|
+
* @remarks
|
|
17
|
+
* This prop is required and should contain an array of objects representing the rows of the markdown table. Each object should have keys that correspond to the `name` properties defined in the `columns` prop (or inferred from the first object if `columns` is not provided). The values of these keys will be rendered in the respective columns of the table. If the `data` array is empty, the component will render nothing.
|
|
18
|
+
*/
|
|
6
19
|
data: T[];
|
|
7
20
|
}
|
|
8
21
|
/**
|
|
@@ -9,8 +9,13 @@ import { isUndefined } from "@stryke/type-checks/is-undefined";
|
|
|
9
9
|
* Component that provides a context for rendering markdown tables.
|
|
10
10
|
*/
|
|
11
11
|
function MarkdownTable(props) {
|
|
12
|
-
const [{ children, data }] = splitProps(props, [
|
|
13
|
-
|
|
12
|
+
const [{ children, columns, data }] = splitProps(props, [
|
|
13
|
+
"children",
|
|
14
|
+
"columns",
|
|
15
|
+
"data"
|
|
16
|
+
]);
|
|
17
|
+
if (data.length === 0) return null;
|
|
18
|
+
const cols = computed(() => columns && columns.length > 0 ? columns : Object.keys(data[0] ?? {}).map((name, index) => ({
|
|
14
19
|
index,
|
|
15
20
|
name,
|
|
16
21
|
align: "left",
|
|
@@ -19,7 +24,7 @@ function MarkdownTable(props) {
|
|
|
19
24
|
return createComponent(MarkdownTableContext.Provider, {
|
|
20
25
|
get value() {
|
|
21
26
|
return {
|
|
22
|
-
columns:
|
|
27
|
+
columns: cols.value,
|
|
23
28
|
data
|
|
24
29
|
};
|
|
25
30
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-alloy",
|
|
3
|
-
"version": "0.26.
|
|
3
|
+
"version": "0.26.221",
|
|
4
4
|
"description": "A package containing various Alloy framework components and helper utilities.",
|
|
5
5
|
"keywords": ["alloy-js", "powerlines", "powerlines-plugin"],
|
|
6
6
|
"homepage": "https://stormsoftware.com",
|
|
@@ -906,8 +906,8 @@
|
|
|
906
906
|
"@alloy-js/json": "^0.23.0",
|
|
907
907
|
"@alloy-js/markdown": "^0.23.0",
|
|
908
908
|
"@alloy-js/typescript": "^0.23.0",
|
|
909
|
-
"@powerlines/deepkit": "0.9.
|
|
910
|
-
"@powerlines/plugin-babel": "0.13.
|
|
909
|
+
"@powerlines/deepkit": "0.9.82",
|
|
910
|
+
"@powerlines/plugin-babel": "0.13.124",
|
|
911
911
|
"@storm-software/config-tools": "^1.190.40",
|
|
912
912
|
"@stryke/capnp": "^0.12.111",
|
|
913
913
|
"@stryke/convert": "^0.7.15",
|
|
@@ -920,16 +920,16 @@
|
|
|
920
920
|
"@stryke/types": "^0.12.12",
|
|
921
921
|
"@stryke/unique-id": "^0.3.96",
|
|
922
922
|
"defu": "^6.1.7",
|
|
923
|
-
"powerlines": "0.47.
|
|
923
|
+
"powerlines": "0.47.128",
|
|
924
924
|
"prettier": "^3.8.3",
|
|
925
925
|
"unctx": "^2.5.0"
|
|
926
926
|
},
|
|
927
927
|
"devDependencies": {
|
|
928
|
-
"@powerlines/plugin-plugin": "0.12.
|
|
929
|
-
"@types/node": "^25.9.
|
|
928
|
+
"@powerlines/plugin-plugin": "0.12.540",
|
|
929
|
+
"@types/node": "^25.9.2"
|
|
930
930
|
},
|
|
931
931
|
"peerDependencies": { "@alloy-js/babel-preset": ">=0.3.0" },
|
|
932
932
|
"peerDependenciesMeta": { "@alloy-js/babel-preset": { "optional": false } },
|
|
933
933
|
"publishConfig": { "access": "public" },
|
|
934
|
-
"gitHead": "
|
|
934
|
+
"gitHead": "c5d53659563ee53a4d919ab56b16cd18b0c9090b"
|
|
935
935
|
}
|