@whitenight_5/web-assistant 0.0.8 → 0.0.9
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.
|
@@ -53,4 +53,4 @@
|
|
|
53
53
|
@keyframes fab-spin {
|
|
54
54
|
to { transform: rotate(360deg); }
|
|
55
55
|
}
|
|
56
|
-
`,a=`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="
|
|
56
|
+
`,a=`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M7.9 20A9 9 0 1 0 4 16.1L2 22Z"/><path d="M8 12h.01"/><path d="M12 12h.01"/><path d="M16 12h.01"/><path d="M18 3 L18.5 6.5 L22 7 L18.5 7.5 L18 11 L17.5 7.5 L14 7 L17.5 6.5 Z"/></svg>`,o=()=>{if(document.getElementById(e))return;let n=document.createElement(`div`);n.id=e,document.body.appendChild(n);let o=n.attachShadow({mode:`open`}),s=document.createElement(`style`);s.textContent=i,o.appendChild(s);let c=document.createElement(`div`);c.id=`confirm-portal`,c.style.cssText=`position:absolute;z-index:50;`;let l=document.createElement(`div`);l.id=`web-assistant-mount`,l.style.cssText=`position:fixed;bottom:96px;right:10px;z-index:9999999;display:none;`;let u=document.createElement(`div`),d=document.createElement(`button`);d.className=`fab-button`,d.innerHTML=a,d.setAttribute(`aria-label`,`Open AI Assistant`),o.appendChild(d);let f=()=>{if(globalThis[t])return;globalThis[t]=!0;let e=document.createElement(`div`);e.className=`fab-loading`,e.innerHTML=`<div class="fab-spinner"></div>`,o.replaceChild(e,d);let i=r+`web-assistant-core.umd.css`,a=document.createElement(`link`);a.rel=`stylesheet`,a.href=i,o.appendChild(a);let s=r+`web-assistant-core.umd.js`,u=document.createElement(`script`);u.src=s,u.onload=()=>{l.style.display=``;let e=new CustomEvent(`web-assistant-core-ready`,{detail:{shadowRoot:o,mountPoint:l,portalTarget:c,host:n}});document.dispatchEvent(e)},document.body.appendChild(u)};d.addEventListener(`click`,f);let p=document.createElement(`div`);p.textContent=`❓ Ask AI`,p.style.cssText=`position:fixed;z-index:2147483646;pointer-events:auto;opacity:0;font-size:13px;color:#FF641E;background:rgba(255,255,255,0.85);padding:2px 8px;border-radius:4px;white-space:nowrap;transition:opacity 0.2s;user-select:none;cursor:pointer;`,o.appendChild(p);let m=null,h=-100,g=-100,_=!1;p.addEventListener(`mouseenter`,()=>{_=!0,m!==null&&clearTimeout(m)}),p.addEventListener(`mouseleave`,()=>{_=!1,m!==null&&clearTimeout(m),p.style.opacity!==`0`&&(m=window.setTimeout(()=>{p.style.opacity=`0`},800))}),document.addEventListener(`mousemove`,e=>{h=e.clientX,g=e.clientY,m!==null&&clearTimeout(m),(_||e.target===p||p.contains(e.target)||!o.contains(e.target))&&(_||(m=p.style.opacity===`0`?window.setTimeout(()=>{globalThis[t]||(p.style.left=`${h+15}px`,p.style.top=`${g+15}px`,p.style.opacity=`0.7`)},1e3):window.setTimeout(()=>{p.style.opacity=`0`},800)))}),p.addEventListener(`click`,e=>{e.stopPropagation(),m!==null&&clearTimeout(m),p.style.opacity=`0`,f()}),l.appendChild(c),l.appendChild(u),o.appendChild(l)};document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,o,{once:!0}):o()});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@whitenight_5/web-assistant",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -18,34 +18,44 @@
|
|
|
18
18
|
"build:dist": "vite build --mode fab && vite build --mode core",
|
|
19
19
|
"prepublishOnly": "pnpm build:dist",
|
|
20
20
|
"lint": "oxlint",
|
|
21
|
-
"preview": "vite preview"
|
|
21
|
+
"preview": "vite preview",
|
|
22
|
+
"postinstall": "patch-package"
|
|
22
23
|
},
|
|
23
24
|
"dependencies": {
|
|
24
25
|
"@ai-sdk/react": "^4.0.69",
|
|
25
26
|
"@assistant-ui/core": "^0.3.17",
|
|
26
27
|
"@assistant-ui/react": "^0.15.18",
|
|
27
28
|
"@assistant-ui/react-ai-sdk": "^1.4.9",
|
|
29
|
+
"@assistant-ui/react-markdown": "^0.14.15",
|
|
28
30
|
"@assistant-ui/store": "^0.3.12",
|
|
29
31
|
"@heroui/react": "^3.2.4",
|
|
30
32
|
"@heroui/styles": "^3.2.4",
|
|
31
33
|
"@mcp-b/smart-dom-reader": "^5.0.1",
|
|
34
|
+
"@radix-ui/react-collapsible": "^1.1.20",
|
|
35
|
+
"@radix-ui/react-slot": "^1.3.3",
|
|
36
|
+
"@radix-ui/react-tooltip": "^1.2.16",
|
|
32
37
|
"@tailwindcss/postcss": "^4.3.3",
|
|
33
38
|
"@tailwindcss/vite": "^4.3.3",
|
|
34
39
|
"ai": "^7.0.66",
|
|
35
40
|
"assistant-stream": "^0.3.41",
|
|
41
|
+
"class-variance-authority": "^0.7.1",
|
|
36
42
|
"clsx": "^2.1.1",
|
|
37
43
|
"dify-ai-provider": "^1.1.1",
|
|
38
44
|
"framer-motion": "^13.1.0",
|
|
39
45
|
"lucide-react": "^1.34.0",
|
|
40
46
|
"m3-ripple": "^1.1.3",
|
|
47
|
+
"motion": "^13.4.0",
|
|
48
|
+
"radix-ui": "^1.6.7",
|
|
41
49
|
"react": "^19.2.8",
|
|
42
50
|
"react-dom": "^19.2.8",
|
|
43
51
|
"react-icons": "^5.7.0",
|
|
44
52
|
"react-stately": "^3.50.0",
|
|
45
53
|
"react-virtuoso": "^4.18.12",
|
|
54
|
+
"remark-gfm": "^4.0.1",
|
|
46
55
|
"tailwindcss": "^4.3.3",
|
|
47
56
|
"tw-shimmer": "^0.4.12",
|
|
48
|
-
"zod": "^4.4.3"
|
|
57
|
+
"zod": "^4.4.3",
|
|
58
|
+
"zustand": "^5.0.15"
|
|
49
59
|
},
|
|
50
60
|
"devDependencies": {
|
|
51
61
|
"@types/node": "^24.13.3",
|
|
@@ -53,6 +63,7 @@
|
|
|
53
63
|
"@types/react-dom": "^19.2.3",
|
|
54
64
|
"@vitejs/plugin-react": "^6.1.1",
|
|
55
65
|
"oxlint": "^1.75.0",
|
|
66
|
+
"patch-package": "^8.0.1",
|
|
56
67
|
"postcss-import": "^17.0.0",
|
|
57
68
|
"postcss-rem-to-pixel": "4.1.2",
|
|
58
69
|
"typescript": "~6.0.2",
|