@hanzo/browser-extension 1.9.35 → 1.9.46
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/dist/safari/Hanzo AI/Hanzo AI.xcodeproj/project.pbxproj +1059 -0
- package/dist/safari/Hanzo AI/Hanzo AI.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AccentColor.colorset/Contents.json +11 -0
- package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/Contents.json +98 -0
- package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/mac-icon-128@1x.png +0 -0
- package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/mac-icon-128@2x.png +0 -0
- package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/mac-icon-16@1x.png +0 -0
- package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/mac-icon-16@2x.png +0 -0
- package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/mac-icon-256@1x.png +0 -0
- package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/mac-icon-256@2x.png +0 -0
- package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/mac-icon-32@1x.png +0 -0
- package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/mac-icon-32@2x.png +0 -0
- package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/mac-icon-512@1x.png +0 -0
- package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/mac-icon-512@2x.png +0 -0
- package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/universal-icon-1024@1x.png +0 -0
- package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/Contents.json +6 -0
- package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/LargeIcon.imageset/Contents.json +21 -0
- package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/LargeIcon.imageset/icon128.png +0 -0
- package/dist/safari/Hanzo AI/Shared (App)/Resources/Base.lproj/Main.html +20 -0
- package/dist/safari/Hanzo AI/Shared (App)/Resources/Icon.png +0 -0
- package/dist/safari/Hanzo AI/Shared (App)/Resources/Script.js +24 -0
- package/dist/safari/Hanzo AI/Shared (App)/Resources/Style.css +61 -0
- package/dist/safari/Hanzo AI/Shared (App)/ViewController.swift +81 -0
- package/dist/safari/Hanzo AI/Shared (Extension)/SafariWebExtensionHandler.swift +42 -0
- package/dist/safari/Hanzo AI/iOS (App)/AppDelegate.swift +24 -0
- package/dist/safari/Hanzo AI/iOS (App)/Base.lproj/LaunchScreen.storyboard +36 -0
- package/dist/safari/Hanzo AI/iOS (App)/Base.lproj/Main.storyboard +38 -0
- package/dist/safari/Hanzo AI/iOS (App)/Info.plist +27 -0
- package/dist/safari/Hanzo AI/iOS (App)/SceneDelegate.swift +18 -0
- package/dist/safari/Hanzo AI/iOS (Extension)/Info.plist +13 -0
- package/dist/safari/Hanzo AI/macOS (App)/AppDelegate.swift +21 -0
- package/dist/safari/Hanzo AI/macOS (App)/Base.lproj/Main.storyboard +124 -0
- package/dist/safari/Hanzo AI/macOS (App)/Info.plist +8 -0
- package/dist/safari/Hanzo AI/macOS (Extension)/Info.plist +13 -0
- package/package.json +20 -14
- package/src/answer/AnswerEngine.tsx +180 -348
- package/src/answer/Composer.tsx +147 -0
- package/src/answer/Mark.tsx +14 -0
- package/src/answer/Models.tsx +118 -0
- package/src/answer/Rail.tsx +69 -0
- package/src/answer/Source.tsx +26 -0
- package/src/answer/Stories.tsx +27 -0
- package/src/answer/WidgetView.tsx +136 -0
- package/src/manifest.json +4 -1
- package/src/newtab.css +187 -35
- package/src/onboarding.css +78 -0
- package/src/onboarding.html +45 -0
- package/src/popup.html +29 -1
- package/src/sidebar.css +0 -40
- package/src/sidebar.html +5 -11
- package/LICENSE +0 -12
- package/src/chat-widget.tsx +0 -96
- package/src/gui-primitives.tsx +0 -116
package/src/chat-widget.tsx
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { createRoot } from 'react-dom/client';
|
|
3
|
-
import { flushSync } from 'react-dom';
|
|
4
|
-
import {
|
|
5
|
-
Button,
|
|
6
|
-
Card,
|
|
7
|
-
CardContent,
|
|
8
|
-
CardDescription,
|
|
9
|
-
CardHeader,
|
|
10
|
-
CardTitle,
|
|
11
|
-
Textarea,
|
|
12
|
-
} from '@hanzo/gui';
|
|
13
|
-
|
|
14
|
-
function LoginPrompt() {
|
|
15
|
-
return (
|
|
16
|
-
<Card className="chat-modern-login-card">
|
|
17
|
-
<CardHeader>
|
|
18
|
-
<CardTitle>Chat with Zen AI models</CardTitle>
|
|
19
|
-
<CardDescription>Models enabled in Hanzo Cloud are loaded automatically.</CardDescription>
|
|
20
|
-
</CardHeader>
|
|
21
|
-
<CardContent>
|
|
22
|
-
<Button id="auth-btn" className="chat-modern-auth-btn" type="button">
|
|
23
|
-
Sign in
|
|
24
|
-
</Button>
|
|
25
|
-
<Button id="signup-btn" className="secondary-btn" type="button">
|
|
26
|
-
Create account
|
|
27
|
-
</Button>
|
|
28
|
-
<p className="auth-note">
|
|
29
|
-
Browser tools work without sign-in.{' '}
|
|
30
|
-
<a href="https://docs.hanzo.ai" target="_blank" rel="noreferrer">
|
|
31
|
-
Learn more
|
|
32
|
-
</a>
|
|
33
|
-
</p>
|
|
34
|
-
</CardContent>
|
|
35
|
-
</Card>
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function ChatComposer() {
|
|
40
|
-
return (
|
|
41
|
-
<div className="chat-modern-composer">
|
|
42
|
-
<div className="model-selector">
|
|
43
|
-
<select id="model-select">
|
|
44
|
-
<option value="claude-sonnet-4-20250514">Claude Sonnet 4</option>
|
|
45
|
-
<option value="claude-opus-4-20250514">Claude Opus 4</option>
|
|
46
|
-
<option value="gpt-4o">GPT-4o</option>
|
|
47
|
-
<option value="zen-coder-flash">Zen Coder Flash</option>
|
|
48
|
-
<option value="zen-max">Zen Max</option>
|
|
49
|
-
</select>
|
|
50
|
-
</div>
|
|
51
|
-
|
|
52
|
-
<div className="chat-flags">
|
|
53
|
-
<label className="flag-toggle">
|
|
54
|
-
<input type="checkbox" id="rag-enabled" defaultChecked />
|
|
55
|
-
<span>RAG</span>
|
|
56
|
-
</label>
|
|
57
|
-
<label className="flag-toggle">
|
|
58
|
-
<input type="checkbox" id="tab-context-enabled" defaultChecked />
|
|
59
|
-
<span>Tab Context</span>
|
|
60
|
-
</label>
|
|
61
|
-
<span id="rag-status" className="rag-status">
|
|
62
|
-
Ready
|
|
63
|
-
</span>
|
|
64
|
-
</div>
|
|
65
|
-
|
|
66
|
-
<div className="input-row">
|
|
67
|
-
<Textarea id="chat-input" className="chat-modern-input" placeholder="Ask anything..." rows={1} />
|
|
68
|
-
<Button id="send-btn" className="send-btn chat-modern-send" title="Send" type="button">
|
|
69
|
-
<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" aria-hidden="true">
|
|
70
|
-
<path d="M4 10l12-6-6 12-2-6-4-2z" strokeWidth="1.5" fill="currentColor" />
|
|
71
|
-
</svg>
|
|
72
|
-
</Button>
|
|
73
|
-
</div>
|
|
74
|
-
</div>
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export function mountModernChatWidget() {
|
|
79
|
-
const loginTarget = document.getElementById('chat-login-prompt');
|
|
80
|
-
if (loginTarget) {
|
|
81
|
-
loginTarget.innerHTML = '';
|
|
82
|
-
const loginRoot = createRoot(loginTarget);
|
|
83
|
-
flushSync(() => {
|
|
84
|
-
loginRoot.render(<LoginPrompt />);
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
const composerTarget = document.getElementById('chat-composer');
|
|
89
|
-
if (composerTarget) {
|
|
90
|
-
composerTarget.innerHTML = '';
|
|
91
|
-
const composerRoot = createRoot(composerTarget);
|
|
92
|
-
flushSync(() => {
|
|
93
|
-
composerRoot.render(<ChatComposer />);
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
}
|
package/src/gui-primitives.tsx
DELETED
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Local @hanzo/gui primitives shim for the extension.
|
|
3
|
-
*
|
|
4
|
-
* This is the canonical surface the extension's React components import via
|
|
5
|
-
* `@hanzo/gui`. It deliberately does NOT pull in the upstream tamagui-based
|
|
6
|
-
* `@hanzo/gui` package because:
|
|
7
|
-
*
|
|
8
|
-
* 1. content-script + background bundles target the smallest possible
|
|
9
|
-
* payload — RNW + tamagui's runtime is far too heavy for a script
|
|
10
|
-
* injected into every page;
|
|
11
|
-
* 2. Hanzo brand is strict monochrome (see ~/work/hanzo/brand/brand.json,
|
|
12
|
-
* primaryColor #FFFFFF), so no color tokens travel with primitives
|
|
13
|
-
* anyway — pure structural elements styled by sibling CSS;
|
|
14
|
-
* 3. The full tamagui adoption ships in a future feature branch with the
|
|
15
|
-
* compiler + RNW peer dep wired correctly.
|
|
16
|
-
*
|
|
17
|
-
* The build aliases `@hanzo/gui` → this file. When the tamagui adoption
|
|
18
|
-
* lands, swap the alias target to the published `@hanzo/gui` package.
|
|
19
|
-
*
|
|
20
|
-
* Each primitive renders a plain DOM element with a stable, monochrome
|
|
21
|
-
* class hook. All visuals come from sidebar.css / popup.css using the
|
|
22
|
-
* brand token scale (white luminance ladder, no chromatic accents).
|
|
23
|
-
*/
|
|
24
|
-
import React from 'react';
|
|
25
|
-
|
|
26
|
-
type Classy = { className?: string; children?: React.ReactNode };
|
|
27
|
-
|
|
28
|
-
function cx(base: string, extra?: string): string {
|
|
29
|
-
return extra ? `${base} ${extra}` : base;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export function Button(props: React.ButtonHTMLAttributes<HTMLButtonElement>) {
|
|
33
|
-
const { className, children, ...rest } = props;
|
|
34
|
-
return (
|
|
35
|
-
<button {...rest} className={cx('hanzo-gui-btn', className)}>
|
|
36
|
-
{children}
|
|
37
|
-
</button>
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export function Textarea(props: React.TextareaHTMLAttributes<HTMLTextAreaElement>) {
|
|
42
|
-
const { className, children, ...rest } = props;
|
|
43
|
-
return (
|
|
44
|
-
<textarea {...rest} className={cx('hanzo-gui-textarea', className)}>
|
|
45
|
-
{children}
|
|
46
|
-
</textarea>
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export function Input(props: React.InputHTMLAttributes<HTMLInputElement>) {
|
|
51
|
-
const { className, ...rest } = props;
|
|
52
|
-
return <input {...rest} className={cx('hanzo-gui-input', className)} />;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export function Card({ className, children }: Classy) {
|
|
56
|
-
return <div className={cx('hanzo-gui-card', className)}>{children}</div>;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export function CardHeader({ className, children }: Classy) {
|
|
60
|
-
return <div className={cx('hanzo-gui-card-header', className)}>{children}</div>;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export function CardTitle({ className, children }: Classy) {
|
|
64
|
-
return <h3 className={cx('hanzo-gui-card-title', className)}>{children}</h3>;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export function CardDescription({ className, children }: Classy) {
|
|
68
|
-
return <p className={cx('hanzo-gui-card-description', className)}>{children}</p>;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export function CardContent({ className, children }: Classy) {
|
|
72
|
-
return <div className={cx('hanzo-gui-card-content', className)}>{children}</div>;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/* Layout primitives — mirror the names used by the upstream Tamagui-based
|
|
76
|
-
@hanzo/gui (XStack/YStack) so call-sites can be ported without churn
|
|
77
|
-
when the full adoption lands. Pure flexbox under the hood. */
|
|
78
|
-
type Stack = Classy & React.HTMLAttributes<HTMLDivElement> & {
|
|
79
|
-
gap?: number | string;
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
export function XStack({ className, gap, style, children, ...rest }: Stack) {
|
|
83
|
-
const merged: React.CSSProperties = {
|
|
84
|
-
display: 'flex',
|
|
85
|
-
flexDirection: 'row',
|
|
86
|
-
gap,
|
|
87
|
-
...style,
|
|
88
|
-
};
|
|
89
|
-
return (
|
|
90
|
-
<div {...rest} style={merged} className={cx('hanzo-gui-xstack', className)}>
|
|
91
|
-
{children}
|
|
92
|
-
</div>
|
|
93
|
-
);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
export function YStack({ className, gap, style, children, ...rest }: Stack) {
|
|
97
|
-
const merged: React.CSSProperties = {
|
|
98
|
-
display: 'flex',
|
|
99
|
-
flexDirection: 'column',
|
|
100
|
-
gap,
|
|
101
|
-
...style,
|
|
102
|
-
};
|
|
103
|
-
return (
|
|
104
|
-
<div {...rest} style={merged} className={cx('hanzo-gui-ystack', className)}>
|
|
105
|
-
{children}
|
|
106
|
-
</div>
|
|
107
|
-
);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
export function Text({ className, children, ...rest }: Classy & React.HTMLAttributes<HTMLSpanElement>) {
|
|
111
|
-
return (
|
|
112
|
-
<span {...rest} className={cx('hanzo-gui-text', className)}>
|
|
113
|
-
{children}
|
|
114
|
-
</span>
|
|
115
|
-
);
|
|
116
|
-
}
|