diff --git a/.changeset/young-bananas-argue.md b/.changeset/young-bananas-argue.md deleted file mode 100644 index 8389442..0000000 --- a/.changeset/young-bananas-argue.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -"ultrahtml": minor ---- - -Add `ultrahtml/selector` module which exports `querySelector`, `querySelectorAll`, and `matches` functions. - -To use `querySelectorAll`, pass the root `Node` as the first argument and any valid CSS selector as the second argument. Note that if a CSS selector you need is not yet implemented, you are invited to [open an issue](https://github.com/natemoo-re/ultrahtml/issues). - -```js -import { parse } from "ultrahtml"; -import { querySelectorAll, matches } from "ultrahtml/selector"; - -const doc = parse(` - - - Demo - /head> - -

Hello world!

- - -`); -const h1 = querySelector(doc, "h1"); -const match = matches(h1, "h1"); -``` diff --git a/CHANGELOG.md b/CHANGELOG.md index 2abe4f1..598c940 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,31 @@ # ultrahtml +## 0.3.0 + +### Minor Changes + +- 2de70f3: Add `ultrahtml/selector` module which exports `querySelector`, `querySelectorAll`, and `matches` functions. + + To use `querySelectorAll`, pass the root `Node` as the first argument and any valid CSS selector as the second argument. Note that if a CSS selector you need is not yet implemented, you are invited to [open an issue](https://github.com/natemoo-re/ultrahtml/issues). + + ```js + import { parse } from "ultrahtml"; + import { querySelectorAll, matches } from "ultrahtml/selector"; + + const doc = parse(` + + + Demo + /head> + +

Hello world!

+ + + `); + const h1 = querySelector(doc, "h1"); + const match = matches(h1, "h1"); + ``` + ## 0.2.1 ### Patch Changes diff --git a/package.json b/package.json index 377331c..9c9795f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ultrahtml", "type": "module", - "version": "0.2.1", + "version": "0.3.0", "types": "./dist/index.d.ts", "repository": { "type": "git",