@alloy-js/core
Advanced tools
Comparing version 0.2.0 to 0.3.0
# Changelog - @alloy-js/core | ||
## 0.3.0 | ||
### Features | ||
- [#38](https://github.com/alloy-framework/alloy/pull/38) Add indent prop to source files for setting indent level. | ||
## 0.2.0 | ||
@@ -6,0 +13,0 @@ |
import { Children, ComponentDefinition } from "@alloy-js/core/jsx-runtime"; | ||
import { Refkey } from "../refkey.js"; | ||
export interface SourceFileProps { | ||
/** | ||
* The path of this file relative to its parent directory | ||
*/ | ||
path: string; | ||
/** | ||
* The type of contents in this file. | ||
*/ | ||
filetype: string; | ||
children?: Children[]; | ||
/** | ||
* The component to use to render refkeys references within the file's | ||
* contents. | ||
*/ | ||
reference?: ComponentDefinition<{ | ||
refkey: Refkey; | ||
}>; | ||
/** | ||
* A string representing one indent level, used when reindenting contents of | ||
* this file. | ||
*/ | ||
indent?: string; | ||
} | ||
export declare function SourceFile(props: SourceFileProps): any; | ||
//# sourceMappingURL=SourceFile.d.ts.map |
@@ -6,2 +6,3 @@ import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime"; | ||
import { useContext } from "../context.js"; | ||
import { IndentContext } from "../context/indent.js"; | ||
import { SourceDirectoryContext } from "../context/source-directory.js"; | ||
@@ -23,3 +24,14 @@ import { SourceFileContext } from "../context/source-file.js"; | ||
get children() { | ||
return props.children; | ||
return _$memo(() => !!props.indent)() ? _$createComponent(IndentContext.Provider, { | ||
get value() { | ||
return { | ||
level: 0, | ||
indent: props.indent, | ||
indentString: "" | ||
}; | ||
}, | ||
get children() { | ||
return props.children; | ||
} | ||
}) : props.children; | ||
} | ||
@@ -26,0 +38,0 @@ }); |
{ | ||
"name": "@alloy-js/core", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "./dist/src/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
727417
15859