@tomehq/theme 0.6.2 → 0.6.4

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.
@@ -1069,7 +1069,7 @@ function Shell({
1069
1069
  }, [currentPageId]);
1070
1070
  useLayoutEffect(() => {
1071
1071
  if (!htmlContentRef.current || !pageHtml) return;
1072
- const stripped = pageHtml.replace(/<h1[^>]*>[\s\S]*?<\/h1>\s*/, "");
1072
+ const stripped = pageHtml.replace(/<h1\b[^>]*>(?:[^<]|<(?!\/h1>))*<\/h1>\s*/, "");
1073
1073
  htmlContentRef.current.innerHTML = stripped;
1074
1074
  lastHtmlRef.current = stripped;
1075
1075
  }, [pageHtml, currentPageId]);
package/dist/entry.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  entry_default
3
- } from "./chunk-NIWVZJLG.js";
3
+ } from "./chunk-XTCRYWCB.js";
4
4
  export {
5
5
  entry_default as default
6
6
  };
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  Shell,
4
4
  THEME_PRESETS,
5
5
  entry_default
6
- } from "./chunk-NIWVZJLG.js";
6
+ } from "./chunk-XTCRYWCB.js";
7
7
  export {
8
8
  AiChat,
9
9
  entry_default as App,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tomehq/theme",
3
- "version": "0.6.2",
3
+ "version": "0.6.4",
4
4
  "description": "Tome default theme and React app shell",
5
5
  "type": "module",
6
6
  "main": "./src/index.tsx",
@@ -9,8 +9,8 @@
9
9
  "./entry": "./src/entry.tsx"
10
10
  },
11
11
  "dependencies": {
12
- "@tomehq/components": "0.6.2",
13
- "@tomehq/core": "0.6.2"
12
+ "@tomehq/components": "0.6.4",
13
+ "@tomehq/core": "0.6.4"
14
14
  },
15
15
  "peerDependencies": {
16
16
  "react": "^18.0.0 || ^19.0.0",
@@ -32,11 +32,11 @@
32
32
  "@testing-library/user-event": "^14.6.1",
33
33
  "@types/react": "^19.0.0",
34
34
  "@types/react-dom": "^19.0.0",
35
- "jsdom": "^28.1.0",
35
+ "jsdom": "^29.0.0",
36
36
  "react": "^19.0.0",
37
37
  "react-dom": "^19.0.0",
38
38
  "tsup": "^8.0.0",
39
- "typescript": "^5.5.0"
39
+ "typescript": "^6.0.0"
40
40
  },
41
41
  "license": "MIT",
42
42
  "repository": {
package/src/Shell.tsx CHANGED
@@ -36,8 +36,6 @@ const Icon = ({ d, size = 16 }: { d: string; size?: number }) => (
36
36
  const SearchIcon = () => <Icon d="M11 19a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM21 21l-4.3-4.3" />;
37
37
  const ChevRight = () => <Icon d="M9 18l6-6-6-6" size={14} />;
38
38
  const ChevDown = () => <Icon d="M6 9l6 6 6-6" size={14} />;
39
- const CopyIcon = () => <Icon d="M9 9h13v13H9zM5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" size={14} />;
40
- const CheckIcon = () => <Icon d="M20 6L9 17l-5-5" size={14} />;
41
39
  const MenuIcon = () => <Icon d="M3 12h18M3 6h18M3 18h18" size={20} />;
42
40
  const XIcon = () => <Icon d="M18 6L6 18M6 6l12 12" size={18} />;
43
41
  const MoonIcon = () => <Icon d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" />;
@@ -614,7 +612,7 @@ export function Shell({
614
612
  // useLayoutEffect ensures innerHTML is set synchronously before paint — no flash
615
613
  useLayoutEffect(() => {
616
614
  if (!htmlContentRef.current || !pageHtml) return;
617
- const stripped = pageHtml.replace(/<h1[^>]*>[\s\S]*?<\/h1>\s*/, "");
615
+ const stripped = pageHtml.replace(/<h1\b[^>]*>(?:[^<]|<(?!\/h1>))*<\/h1>\s*/, "");
618
616
  htmlContentRef.current.innerHTML = stripped;
619
617
  lastHtmlRef.current = stripped;
620
618
  }, [pageHtml, currentPageId]);
@@ -1,4 +1,3 @@
1
- import React from "react";
2
1
  import { describe, it, expect, vi, beforeEach, afterEach } from "vitest";
3
2
  import { render, act } from "@testing-library/react";
4
3
 
@@ -31,27 +30,6 @@ vi.mock("virtual:tome/config", () => ({
31
30
  },
32
31
  }));
33
32
 
34
- const mockRoutes = [
35
- {
36
- id: "index",
37
- urlPath: "/",
38
- filePath: "pages/index.md",
39
- frontmatter: { title: "Home", description: "Welcome" },
40
- },
41
- {
42
- id: "quickstart",
43
- urlPath: "/quickstart",
44
- filePath: "pages/quickstart.md",
45
- frontmatter: { title: "Quick Start", description: "Get started" },
46
- },
47
- {
48
- id: "api-reference",
49
- urlPath: "/api",
50
- filePath: "__api-reference__",
51
- frontmatter: { title: "API Reference", description: "API docs" },
52
- },
53
- ];
54
-
55
33
  const mockNavigation = [
56
34
  { section: "Guide", pages: [{ id: "index", title: "Home", urlPath: "/" }] },
57
35
  ];
package/src/entry.tsx CHANGED
@@ -7,7 +7,6 @@ import {
7
7
  computeEditUrl,
8
8
  resolveInitialPageId,
9
9
  detectCurrentVersion,
10
- NavigationCancelledError,
11
10
  type LoadedPage,
12
11
  } from "./entry-helpers.js";
13
12