@tenphi/renderer 0.23.0 → 0.25.0

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.
@@ -18,6 +18,8 @@ const translations = {
18
18
 
19
19
  <SearchRoot
20
20
  className={Astro.props.class}
21
+ data-search-key={`cookbook-search:${import.meta.env.BASE_URL}:${Astro.locals.cookbookRoute.lang}`}
22
+ data-search-base={import.meta.env.BASE_URL}
21
23
  data-translations={JSON.stringify(translations)}
22
24
  data-strip-trailing-slash={import.meta.env.TRAILING_SLASH === "never" ||
23
25
  undefined}
@@ -82,12 +84,17 @@ const translations = {
82
84
  </SearchRoot>
83
85
  <script>
84
86
  import { initializeSearch } from "../client/search.js";
85
- document.querySelectorAll<HTMLElement>("site-search").forEach((element) => {
86
- initializeSearch(
87
- element,
88
- {},
89
- import.meta.env.DEV,
90
- import.meta.env.BASE_URL,
91
- );
92
- });
87
+ function initialize(): void {
88
+ document.querySelectorAll<HTMLElement>("site-search").forEach((element) => {
89
+ if (element.dataset.searchBase !== import.meta.env.BASE_URL) return;
90
+ initializeSearch(
91
+ element,
92
+ {},
93
+ import.meta.env.DEV,
94
+ import.meta.env.BASE_URL,
95
+ );
96
+ });
97
+ }
98
+ initialize();
99
+ document.addEventListener("astro:page-load", initialize);
93
100
  </script>
@@ -21,6 +21,7 @@ import { MainContentRoot } from "../components/MainContent.styles.js";
21
21
  import { BannerRoot } from "../components/Banner.styles.js";
22
22
  import { TableOfContentsLayoutRoot } from "../components/TableOfContentsLayout.styles.js";
23
23
  import { TableOfContentsRoot } from "../components/TableOfContents.styles.js";
24
+ import AppearanceInit from "../components/AppearanceInit.astro";
24
25
 
25
26
  interface Props {
26
27
  frontmatter: Record<string, any>;
@@ -43,7 +44,6 @@ const indexed = route.id !== "/404" && data.pagefind !== false && !data.draft;
43
44
  <html
44
45
  lang={route.lang}
45
46
  dir={route.dir}
46
- data-theme="dark"
47
47
  data-has-sidebar={route.hasSidebar ? "" : undefined}
48
48
  data-has-toc={route.toc ? "" : undefined}
49
49
  data-has-hero={data.hero ? "" : undefined}
@@ -51,6 +51,9 @@ const indexed = route.id !== "/404" && data.pagefind !== false && !data.draft;
51
51
  <head>
52
52
  <meta charset="utf-8" />
53
53
  <meta name="viewport" content="width=device-width, initial-scale=1" />
54
+ <AppearanceInit />
55
+ <meta name="astro-view-transitions-enabled" content="true" />
56
+ <meta name="astro-view-transitions-fallback" content="swap" />
54
57
  <DocumentStyles />
55
58
  <Head />
56
59
  </head>
@@ -85,6 +88,7 @@ const indexed = route.id !== "/404" && data.pagefind !== false && !data.draft;
85
88
  <MainPaneRoot className="main-pane">
86
89
  <MainContentRoot
87
90
  id="main-content"
91
+ tabIndex={-1}
88
92
  data-pagefind-body={indexed ? "" : undefined}
89
93
  lang={route.entryMeta.lang}
90
94
  dir={route.entryMeta.dir}
@@ -132,6 +136,7 @@ const indexed = route.id !== "/404" && data.pagefind !== false && !data.draft;
132
136
  </div>
133
137
  </PageFrame>
134
138
  <script>
139
+ import "../client/client-navigation.js";
135
140
  import "../client/table-of-contents.js";
136
141
  </script>
137
142
  </body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tenphi/renderer",
3
- "version": "0.23.0",
3
+ "version": "0.25.0",
4
4
  "description": "Astro renderer and Tasty theme for Cookbook",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -61,7 +61,7 @@
61
61
  "@fontsource-variable/jetbrains-mono": "^5.3.0",
62
62
  "@fontsource-variable/onest": "^5.3.0",
63
63
  "@pagefind/default-ui": "1.5.2",
64
- "@tenphi/docs": "0.23.0",
64
+ "@tenphi/docs": "0.25.0",
65
65
  "@tenphi/eslint-plugin-tasty": "1.6.0",
66
66
  "@tenphi/glaze": "2.0.1",
67
67
  "@tenphi/tasty": "3.9.10",