diff --git a/.changeset/olive-rules-repeat.md b/.changeset/olive-rules-repeat.md deleted file mode 100644 index d9865cbb2..000000000 --- a/.changeset/olive-rules-repeat.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -"@hyperbook/markdown": minor -"hyperbook": minor -"hyperbook-studio": minor ---- - -Rework how bookmarks store their label, so bookmarks show what the page shows. - -A bookmark label used to be baked into an `onclick` attribute of the bookmark -button and rendered with `innerHTML`. Labels are now read from the rendered -heading when a bookmark is saved, and stored as parts instead of markup: - -```js -[{ text: "Getting started " }, { text: "🐧", emoji: "1f427" }]; -``` - -The bookmark list builds its entries from those parts with the DOM, so nothing -that was stored is parsed as HTML, and an emoji that is rendered as an image -stays an image in the bookmark list. Emojis are stored by id, never by URL, so -bookmarks survive a change of the `basePath`. - -This also fixes bookmarking a heading that contains a quote or a backslash. -Those characters ended up inside a JavaScript string in the `onclick` -attribute and made the button throw a syntax error. - -The bookmark indicator is no longer the 🔖 emoji. Both the button on a heading -and the marker in the bookmark list are drawn from the stylesheet with a mask, -so the control looks the same on every platform, takes the color of the -heading it belongs to in light and dark mode, and does not change when the -emoji style changes. A bookmarked heading now shows a filled icon instead of only a less -transparent one. - -Breaking: - -- `hyperbook.ui.toggleBookmark(key, label)` no longer takes a label: - `hyperbook.ui.toggleBookmark(key)`. The label comes from the heading. -- Bookmark buttons no longer carry an inline `onclick`. They are handled by a - delegated listener and carry `data-key`, `data-label`, `aria-label` and - `aria-pressed`. -- Bookmark buttons are empty. The icon comes from `.bookmark` in the - stylesheet, so a custom style that replaced the emoji has to be updated. -- The store moves to version 6. Labels of existing bookmarks are migrated to - the new shape, and a plain label is still rendered, so nothing is lost. diff --git a/.changeset/tricky-donuts-smile.md b/.changeset/tricky-donuts-smile.md deleted file mode 100644 index 817c950a8..000000000 --- a/.changeset/tricky-donuts-smile.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -"@hyperbook/types": patch -"hyperbook": patch -"hyperbook-studio": patch ---- - -Fix `mailto:` and `tel:` links in markdown. `makeUrl` only passed through URLs -containing `://` or starting with `data:`, so `[Write us](mailto:a@b.c)` was -resolved against the base path and became `href="/mailto:a@b.c"`. Any URL with -a scheme is now passed through untouched. diff --git a/.changeset/wild-pugs-invite.md b/.changeset/wild-pugs-invite.md deleted file mode 100644 index f57eeec6e..000000000 --- a/.changeset/wild-pugs-invite.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -"@hyperbook/markdown": patch -"@hyperbook/types": patch -"hyperbook": patch -"hyperbook-studio": patch ---- - -Add `elements.emoji.style`. Emojis are drawn by the reader's operating system, -so the same emoji looks different on Windows, macOS, Android and Linux. Setting -the style to `twemoji` replaces them with Twemoji images at build time, so a -hyperbook looks the same on every platform. This covers emojis in the content -as well as icons from the config, leaves code untouched, and only copies the -emojis a book actually uses into its output. The default stays `native`. diff --git a/packages/create/CHANGELOG.md b/packages/create/CHANGELOG.md index a0827d1b6..c7304841c 100644 --- a/packages/create/CHANGELOG.md +++ b/packages/create/CHANGELOG.md @@ -1,5 +1,12 @@ # create-hyperbook +## 0.3.9 + +### Patch Changes + +- Updated dependencies [[`20de8fe`](https://github.com/openpatch/hyperbook/commit/20de8fe89fdb753246c8f15b713a40b6f3682b1f), [`20de8fe`](https://github.com/openpatch/hyperbook/commit/20de8fe89fdb753246c8f15b713a40b6f3682b1f)]: + - @hyperbook/types@0.23.2 + ## 0.3.8 ### Patch Changes diff --git a/packages/create/package.json b/packages/create/package.json index b525c4626..1ffe9ed66 100644 --- a/packages/create/package.json +++ b/packages/create/package.json @@ -1,6 +1,6 @@ { "name": "create-hyperbook", - "version": "0.3.8", + "version": "0.3.9", "description": "Shared logic for creating new Hyperbook projects", "platform": "node", "main": "./dist/index.js", diff --git a/packages/hyperbook/CHANGELOG.md b/packages/hyperbook/CHANGELOG.md index 480c48a9b..e6becccdf 100644 --- a/packages/hyperbook/CHANGELOG.md +++ b/packages/hyperbook/CHANGELOG.md @@ -1,5 +1,61 @@ # hyperbook +## 0.101.0 + +### Minor Changes + +- [#1153](https://github.com/openpatch/hyperbook/pull/1153) [`20de8fe`](https://github.com/openpatch/hyperbook/commit/20de8fe89fdb753246c8f15b713a40b6f3682b1f) Thanks [@mikebarkmin](https://github.com/mikebarkmin)! - Rework how bookmarks store their label, so bookmarks show what the page shows. + + A bookmark label used to be baked into an `onclick` attribute of the bookmark + button and rendered with `innerHTML`. Labels are now read from the rendered + heading when a bookmark is saved, and stored as parts instead of markup: + + ```js + [{ text: "Getting started " }, { text: "🐧", emoji: "1f427" }]; + ``` + + The bookmark list builds its entries from those parts with the DOM, so nothing + that was stored is parsed as HTML, and an emoji that is rendered as an image + stays an image in the bookmark list. Emojis are stored by id, never by URL, so + bookmarks survive a change of the `basePath`. + + This also fixes bookmarking a heading that contains a quote or a backslash. + Those characters ended up inside a JavaScript string in the `onclick` + attribute and made the button throw a syntax error. + + The bookmark indicator is no longer the 🔖 emoji. Both the button on a heading + and the marker in the bookmark list are drawn from the stylesheet with a mask, + so the control looks the same on every platform, takes the color of the + heading it belongs to in light and dark mode, and does not change when the + emoji style changes. A bookmarked heading now shows a filled icon instead of only a less + transparent one. + + Breaking: + + - `hyperbook.ui.toggleBookmark(key, label)` no longer takes a label: + `hyperbook.ui.toggleBookmark(key)`. The label comes from the heading. + - Bookmark buttons no longer carry an inline `onclick`. They are handled by a + delegated listener and carry `data-key`, `data-label`, `aria-label` and + `aria-pressed`. + - Bookmark buttons are empty. The icon comes from `.bookmark` in the + stylesheet, so a custom style that replaced the emoji has to be updated. + - The store moves to version 6. Labels of existing bookmarks are migrated to + the new shape, and a plain label is still rendered, so nothing is lost. + +### Patch Changes + +- [#1153](https://github.com/openpatch/hyperbook/pull/1153) [`20de8fe`](https://github.com/openpatch/hyperbook/commit/20de8fe89fdb753246c8f15b713a40b6f3682b1f) Thanks [@mikebarkmin](https://github.com/mikebarkmin)! - Fix `mailto:` and `tel:` links in markdown. `makeUrl` only passed through URLs + containing `://` or starting with `data:`, so `[Write us](mailto:a@b.c)` was + resolved against the base path and became `href="/mailto:a@b.c"`. Any URL with + a scheme is now passed through untouched. + +- [#1153](https://github.com/openpatch/hyperbook/pull/1153) [`20de8fe`](https://github.com/openpatch/hyperbook/commit/20de8fe89fdb753246c8f15b713a40b6f3682b1f) Thanks [@mikebarkmin](https://github.com/mikebarkmin)! - Add `elements.emoji.style`. Emojis are drawn by the reader's operating system, + so the same emoji looks different on Windows, macOS, Android and Linux. Setting + the style to `twemoji` replaces them with Twemoji images at build time, so a + hyperbook looks the same on every platform. This covers emojis in the content + as well as icons from the config, leaves code untouched, and only copies the + emojis a book actually uses into its output. The default stays `native`. + ## 0.100.6 ### Patch Changes diff --git a/packages/hyperbook/package.json b/packages/hyperbook/package.json index 987fb4055..b62b371da 100644 --- a/packages/hyperbook/package.json +++ b/packages/hyperbook/package.json @@ -1,6 +1,6 @@ { "name": "hyperbook", - "version": "0.100.6", + "version": "0.101.0", "author": "Mike Barkmin", "homepage": "https://github.com/openpatch/hyperbook#readme", "license": "MIT", diff --git a/packages/markdown/CHANGELOG.md b/packages/markdown/CHANGELOG.md index fe323f69d..86c47e789 100644 --- a/packages/markdown/CHANGELOG.md +++ b/packages/markdown/CHANGELOG.md @@ -1,5 +1,56 @@ # @hyperbook/markdown +## 0.72.0 + +### Minor Changes + +- [#1153](https://github.com/openpatch/hyperbook/pull/1153) [`20de8fe`](https://github.com/openpatch/hyperbook/commit/20de8fe89fdb753246c8f15b713a40b6f3682b1f) Thanks [@mikebarkmin](https://github.com/mikebarkmin)! - Rework how bookmarks store their label, so bookmarks show what the page shows. + + A bookmark label used to be baked into an `onclick` attribute of the bookmark + button and rendered with `innerHTML`. Labels are now read from the rendered + heading when a bookmark is saved, and stored as parts instead of markup: + + ```js + [{ text: "Getting started " }, { text: "🐧", emoji: "1f427" }]; + ``` + + The bookmark list builds its entries from those parts with the DOM, so nothing + that was stored is parsed as HTML, and an emoji that is rendered as an image + stays an image in the bookmark list. Emojis are stored by id, never by URL, so + bookmarks survive a change of the `basePath`. + + This also fixes bookmarking a heading that contains a quote or a backslash. + Those characters ended up inside a JavaScript string in the `onclick` + attribute and made the button throw a syntax error. + + The bookmark indicator is no longer the 🔖 emoji. Both the button on a heading + and the marker in the bookmark list are drawn from the stylesheet with a mask, + so the control looks the same on every platform, takes the color of the + heading it belongs to in light and dark mode, and does not change when the + emoji style changes. A bookmarked heading now shows a filled icon instead of only a less + transparent one. + + Breaking: + + - `hyperbook.ui.toggleBookmark(key, label)` no longer takes a label: + `hyperbook.ui.toggleBookmark(key)`. The label comes from the heading. + - Bookmark buttons no longer carry an inline `onclick`. They are handled by a + delegated listener and carry `data-key`, `data-label`, `aria-label` and + `aria-pressed`. + - Bookmark buttons are empty. The icon comes from `.bookmark` in the + stylesheet, so a custom style that replaced the emoji has to be updated. + - The store moves to version 6. Labels of existing bookmarks are migrated to + the new shape, and a plain label is still rendered, so nothing is lost. + +### Patch Changes + +- [#1153](https://github.com/openpatch/hyperbook/pull/1153) [`20de8fe`](https://github.com/openpatch/hyperbook/commit/20de8fe89fdb753246c8f15b713a40b6f3682b1f) Thanks [@mikebarkmin](https://github.com/mikebarkmin)! - Add `elements.emoji.style`. Emojis are drawn by the reader's operating system, + so the same emoji looks different on Windows, macOS, Android and Linux. Setting + the style to `twemoji` replaces them with Twemoji images at build time, so a + hyperbook looks the same on every platform. This covers emojis in the content + as well as icons from the config, leaves code untouched, and only copies the + emojis a book actually uses into its output. The default stays `native`. + ## 0.71.6 ### Patch Changes diff --git a/packages/markdown/package.json b/packages/markdown/package.json index 587d22763..de6a36a1e 100644 --- a/packages/markdown/package.json +++ b/packages/markdown/package.json @@ -1,6 +1,6 @@ { "name": "@hyperbook/markdown", - "version": "0.71.6", + "version": "0.72.0", "author": "Mike Barkmin", "homepage": "https://github.com/openpatch/hyperbook#readme", "license": "MIT", diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index 260f7a170..4bfb8c12e 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -1,5 +1,21 @@ # @hyperbook/types +## 0.23.2 + +### Patch Changes + +- [#1153](https://github.com/openpatch/hyperbook/pull/1153) [`20de8fe`](https://github.com/openpatch/hyperbook/commit/20de8fe89fdb753246c8f15b713a40b6f3682b1f) Thanks [@mikebarkmin](https://github.com/mikebarkmin)! - Fix `mailto:` and `tel:` links in markdown. `makeUrl` only passed through URLs + containing `://` or starting with `data:`, so `[Write us](mailto:a@b.c)` was + resolved against the base path and became `href="/mailto:a@b.c"`. Any URL with + a scheme is now passed through untouched. + +- [#1153](https://github.com/openpatch/hyperbook/pull/1153) [`20de8fe`](https://github.com/openpatch/hyperbook/commit/20de8fe89fdb753246c8f15b713a40b6f3682b1f) Thanks [@mikebarkmin](https://github.com/mikebarkmin)! - Add `elements.emoji.style`. Emojis are drawn by the reader's operating system, + so the same emoji looks different on Windows, macOS, Android and Linux. Setting + the style to `twemoji` replaces them with Twemoji images at build time, so a + hyperbook looks the same on every platform. This covers emojis in the content + as well as icons from the config, leaves code untouched, and only copies the + emojis a book actually uses into its output. The default stays `native`. + ## 0.23.1 ### Patch Changes diff --git a/packages/types/package.json b/packages/types/package.json index 28eec0b33..d3daff95f 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@hyperbook/types", - "version": "0.23.1", + "version": "0.23.2", "author": "Mike Barkmin", "homepage": "https://github.com/openpatch/hyperbook#readme", "license": "MIT", diff --git a/platforms/vscode/CHANGELOG.md b/platforms/vscode/CHANGELOG.md index f0ac917fb..9e2ef80b9 100644 --- a/platforms/vscode/CHANGELOG.md +++ b/platforms/vscode/CHANGELOG.md @@ -1,5 +1,65 @@ # @hyperbook/vscode-extension +## 0.52.0 + +### Minor Changes + +- [#1153](https://github.com/openpatch/hyperbook/pull/1153) [`20de8fe`](https://github.com/openpatch/hyperbook/commit/20de8fe89fdb753246c8f15b713a40b6f3682b1f) Thanks [@mikebarkmin](https://github.com/mikebarkmin)! - Rework how bookmarks store their label, so bookmarks show what the page shows. + + A bookmark label used to be baked into an `onclick` attribute of the bookmark + button and rendered with `innerHTML`. Labels are now read from the rendered + heading when a bookmark is saved, and stored as parts instead of markup: + + ```js + [{ text: "Getting started " }, { text: "🐧", emoji: "1f427" }]; + ``` + + The bookmark list builds its entries from those parts with the DOM, so nothing + that was stored is parsed as HTML, and an emoji that is rendered as an image + stays an image in the bookmark list. Emojis are stored by id, never by URL, so + bookmarks survive a change of the `basePath`. + + This also fixes bookmarking a heading that contains a quote or a backslash. + Those characters ended up inside a JavaScript string in the `onclick` + attribute and made the button throw a syntax error. + + The bookmark indicator is no longer the 🔖 emoji. Both the button on a heading + and the marker in the bookmark list are drawn from the stylesheet with a mask, + so the control looks the same on every platform, takes the color of the + heading it belongs to in light and dark mode, and does not change when the + emoji style changes. A bookmarked heading now shows a filled icon instead of only a less + transparent one. + + Breaking: + + - `hyperbook.ui.toggleBookmark(key, label)` no longer takes a label: + `hyperbook.ui.toggleBookmark(key)`. The label comes from the heading. + - Bookmark buttons no longer carry an inline `onclick`. They are handled by a + delegated listener and carry `data-key`, `data-label`, `aria-label` and + `aria-pressed`. + - Bookmark buttons are empty. The icon comes from `.bookmark` in the + stylesheet, so a custom style that replaced the emoji has to be updated. + - The store moves to version 6. Labels of existing bookmarks are migrated to + the new shape, and a plain label is still rendered, so nothing is lost. + +### Patch Changes + +- [#1153](https://github.com/openpatch/hyperbook/pull/1153) [`20de8fe`](https://github.com/openpatch/hyperbook/commit/20de8fe89fdb753246c8f15b713a40b6f3682b1f) Thanks [@mikebarkmin](https://github.com/mikebarkmin)! - Fix `mailto:` and `tel:` links in markdown. `makeUrl` only passed through URLs + containing `://` or starting with `data:`, so `[Write us](mailto:a@b.c)` was + resolved against the base path and became `href="/mailto:a@b.c"`. Any URL with + a scheme is now passed through untouched. + +- [#1153](https://github.com/openpatch/hyperbook/pull/1153) [`20de8fe`](https://github.com/openpatch/hyperbook/commit/20de8fe89fdb753246c8f15b713a40b6f3682b1f) Thanks [@mikebarkmin](https://github.com/mikebarkmin)! - Add `elements.emoji.style`. Emojis are drawn by the reader's operating system, + so the same emoji looks different on Windows, macOS, Android and Linux. Setting + the style to `twemoji` replaces them with Twemoji images at build time, so a + hyperbook looks the same on every platform. This covers emojis in the content + as well as icons from the config, leaves code untouched, and only copies the + emojis a book actually uses into its output. The default stays `native`. +- Updated dependencies [[`20de8fe`](https://github.com/openpatch/hyperbook/commit/20de8fe89fdb753246c8f15b713a40b6f3682b1f), [`20de8fe`](https://github.com/openpatch/hyperbook/commit/20de8fe89fdb753246c8f15b713a40b6f3682b1f)]: + - @hyperbook/markdown@0.72.0 + - create-hyperbook@0.3.9 + - @hyperbook/fs@0.25.1 + ## 0.51.9 ### Patch Changes diff --git a/platforms/vscode/package.json b/platforms/vscode/package.json index 8c1288abc..14ebfa333 100644 --- a/platforms/vscode/package.json +++ b/platforms/vscode/package.json @@ -11,7 +11,7 @@ }, "homepage": "https://hyperbook.openpatch.org", "main": "./out/extension.js", - "version": "0.51.9", + "version": "0.52.0", "engines": { "vscode": "^1.71.0" },