Comparing version 1.11.0 to 1.12.0
@@ -8,2 +8,8 @@ # Change Log | ||
## [1.12.0] - 2024-07-15 | ||
### Changed | ||
- `ClassDomReplaceCommand` now support multiple class names, which implies the relevant parameter has been moved as the last one. | ||
## [1.11.0] - 2024-07-02 | ||
@@ -10,0 +16,0 @@ |
@@ -6,9 +6,13 @@ import { ReplacerFactory } from "../../ReplacerFactory.js"; | ||
/** | ||
* A replacer that looks for a class in tags. | ||
* A replacer that looks for HTML class(es) in tags. | ||
*/ | ||
export declare class ClassDomReplaceCommand<T extends HTMLElement = HTMLElement> extends DomReplaceCommand<T> { | ||
protected className: string; | ||
protected replacerFactory: ReplacerFactory<DomReplacer<T>>; | ||
constructor(className: string, replacerFactory: ReplacerFactory<DomReplacer<T>>); | ||
/** | ||
* | ||
* @param replacerFactory The object that creates the replacer when needed. | ||
* @param classNames The classname(s) to look for. | ||
*/ | ||
constructor(replacerFactory: ReplacerFactory<DomReplacer<T>>, ...classNames: string[]); | ||
protected createReplacer(context: HtmlSsgContext): Promise<DomReplacer<T>>; | ||
} |
import { DomReplaceCommand } from "../../DomReplaceCommand.js"; | ||
/** | ||
* A replacer that looks for a class in tags. | ||
* A replacer that looks for HTML class(es) in tags. | ||
*/ | ||
export class ClassDomReplaceCommand extends DomReplaceCommand { | ||
constructor(className, replacerFactory) { | ||
super(`.${className}`); | ||
this.className = className; | ||
/** | ||
* | ||
* @param replacerFactory The object that creates the replacer when needed. | ||
* @param classNames The classname(s) to look for. | ||
*/ | ||
constructor(replacerFactory, ...classNames) { | ||
super(classNames.map(className => '.' + className).join(",")); | ||
this.replacerFactory = replacerFactory; | ||
@@ -10,0 +14,0 @@ } |
@@ -5,3 +5,3 @@ { | ||
"author": "Jérôme Beau <javarome@gmail.com> (https://javarome.com)", | ||
"version": "1.11.0", | ||
"version": "1.12.0", | ||
"description": "Static Site Generation TypeScript API", | ||
@@ -24,3 +24,3 @@ "exports": "./dist/src/index.js", | ||
"test": "rm -Rf out && tsx src/testAll.ts", | ||
"test-one": "rm -Rf out && tsx src/step/content/replace/angular/AngularExpressionReplaceCommandTest.ts", | ||
"test-one": "rm -Rf out && tsx src/step/content/replace/html/class/ClassDomReplaceCommandTest.ts", | ||
"test-ci": "rm -Rf out && tsx src/testAll.ts" | ||
@@ -27,0 +27,0 @@ }, |
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
140766
2207