@tomehq/theme 0.1.0 → 0.1.2

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.
package/CHANGELOG.md ADDED
@@ -0,0 +1,16 @@
1
+ # @tomehq/theme
2
+
3
+ ## 0.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - @tomehq/components@0.1.1
9
+
10
+ ## 0.1.1
11
+
12
+ ### Patch Changes
13
+
14
+ - Fix bugs found in functionality audit: invalid search provider, AI key naming mismatch, hardcoded version. Remove dead billing stubs. Add 57 API route tests.
15
+ - Updated dependencies
16
+ - @tomehq/core@0.1.1
@@ -192,7 +192,7 @@ function AiChat({ provider, model, apiKey, context }) {
192
192
  const [error, setError] = useState(null);
193
193
  const messagesEndRef = useRef(null);
194
194
  const inputRef = useRef(null);
195
- const resolvedKey = apiKey || (typeof window !== "undefined" ? window.__TOME_AI_KEY__ : void 0);
195
+ const resolvedKey = apiKey || (typeof window !== "undefined" ? window.__TOME_AI_API_KEY__ : void 0);
196
196
  const resolvedModel = model || getDefaultModel(provider);
197
197
  useEffect(() => {
198
198
  messagesEndRef.current?.scrollIntoView({ behavior: "smooth" });
@@ -882,7 +882,7 @@ function Shell({
882
882
  ] }, sec.section)) }),
883
883
  /* @__PURE__ */ jsxs2("div", { style: { padding: "12px 16px", borderTop: "1px solid var(--bd)", display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [
884
884
  themeMode === "auto" ? /* @__PURE__ */ jsx2("button", { onClick: () => setDark((d) => !d), style: { background: "none", border: "none", color: "var(--txM)", cursor: "pointer", display: "flex" }, children: isDark ? /* @__PURE__ */ jsx2(SunIcon, {}) : /* @__PURE__ */ jsx2(MoonIcon, {}) }) : /* @__PURE__ */ jsx2("div", {}),
885
- /* @__PURE__ */ jsx2("span", { style: { fontFamily: "var(--font-code)", fontSize: 10, color: "var(--txM)" }, children: "v0.1.0" })
885
+ /* @__PURE__ */ jsx2("span", { style: { fontFamily: "var(--font-code)", fontSize: 10, color: "var(--txM)" }, children: typeof __TOME_VERSION__ !== "undefined" && __TOME_VERSION__ ? `v${__TOME_VERSION__}` : "v0.1.0" })
886
886
  ] })
887
887
  ] }),
888
888
  /* @__PURE__ */ jsxs2("div", { style: { flex: 1, display: "flex", flexDirection: "column", overflow: "hidden" }, children: [
package/dist/entry.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  entry_default
3
- } from "./chunk-MEP7P6A7.js";
3
+ } from "./chunk-JA4PMX6M.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-MEP7P6A7.js";
6
+ } from "./chunk-JA4PMX6M.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.1.0",
3
+ "version": "0.1.2",
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.1.0",
13
- "@tomehq/core": "0.1.0"
12
+ "@tomehq/components": "0.1.1",
13
+ "@tomehq/core": "0.1.1"
14
14
  },
15
15
  "peerDependencies": {
16
16
  "react": "^18.0.0 || ^19.0.0",
@@ -80,12 +80,12 @@ describe("AiChat API key handling", () => {
80
80
  expect(screen.queryByTestId("ai-chat-no-key")).not.toBeInTheDocument();
81
81
  });
82
82
 
83
- it("reads API key from window.__TOME_AI_KEY__ when prop is not set", () => {
84
- (window as any).__TOME_AI_KEY__ = "window-key-456";
83
+ it("reads API key from window.__TOME_AI_API_KEY__ when prop is not set", () => {
84
+ (window as any).__TOME_AI_API_KEY__ = "window-key-456";
85
85
  renderChat({ apiKey: undefined });
86
86
  fireEvent.click(screen.getByTestId("ai-chat-button"));
87
87
  expect(screen.queryByTestId("ai-chat-no-key")).not.toBeInTheDocument();
88
- delete (window as any).__TOME_AI_KEY__;
88
+ delete (window as any).__TOME_AI_API_KEY__;
89
89
  });
90
90
 
91
91
  it("disables input when no API key is available", () => {
package/src/AiChat.tsx CHANGED
@@ -118,7 +118,7 @@ export function AiChat({ provider, model, apiKey, context }: AiChatProps) {
118
118
  const messagesEndRef = useRef<HTMLDivElement>(null);
119
119
  const inputRef = useRef<HTMLInputElement>(null);
120
120
 
121
- const resolvedKey = apiKey || (typeof window !== "undefined" ? (window as any).__TOME_AI_KEY__ : undefined);
121
+ const resolvedKey = apiKey || (typeof window !== "undefined" ? (window as any).__TOME_AI_API_KEY__ : undefined);
122
122
  const resolvedModel = model || getDefaultModel(provider);
123
123
 
124
124
  // Scroll to bottom on new messages
package/src/Shell.tsx CHANGED
@@ -402,7 +402,7 @@ export function Shell({
402
402
  {isDark ? <SunIcon /> : <MoonIcon />}
403
403
  </button>
404
404
  ) : <div />}
405
- <span style={{ fontFamily: "var(--font-code)", fontSize: 10, color: "var(--txM)" }}>v0.1.0</span>
405
+ <span style={{ fontFamily: "var(--font-code)", fontSize: 10, color: "var(--txM)" }}>{typeof __TOME_VERSION__ !== "undefined" && __TOME_VERSION__ ? `v${__TOME_VERSION__}` : "v0.1.0"}</span>
406
406
  </div>
407
407
  </aside>
408
408
 
package/src/global.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  declare const __TOME_AI_API_KEY__: string | undefined;
2
+ declare const __TOME_VERSION__: string | undefined;
2
3
 
3
4
  declare module "virtual:tome/config" {
4
5
  const config: any;