sanity-plugin-seo-copilot 0.2.14 → 0.2.16

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.
Files changed (40) hide show
  1. package/README.md +63 -50
  2. package/dist/index.js +868 -797
  3. package/dist/index.mjs +791 -720
  4. package/package.json +9 -8
  5. package/dist/index.js.map +0 -1
  6. package/dist/index.mjs.map +0 -1
  7. package/sanity.json +0 -3
  8. package/src/components/ChatPanel.tsx +0 -311
  9. package/src/components/ConfigContext.tsx +0 -22
  10. package/src/components/FeedbackButton.tsx +0 -218
  11. package/src/components/KeywordBadge.tsx +0 -50
  12. package/src/components/KeywordPanel.tsx +0 -1233
  13. package/src/components/OnboardingPopup.tsx +0 -108
  14. package/src/components/PlacementIndicators.tsx +0 -80
  15. package/src/components/ReportProblemButton.tsx +0 -212
  16. package/src/components/SEOCopilotPanel.tsx +0 -1287
  17. package/src/components/ScoreDonut.tsx +0 -158
  18. package/src/components/SeedKeywordInput.tsx +0 -128
  19. package/src/components/ShimmerLoader.tsx +0 -123
  20. package/src/components/TabBar.tsx +0 -373
  21. package/src/components/styles.ts +0 -158
  22. package/src/components/tabs/AEOTab.tsx +0 -585
  23. package/src/components/tabs/LinkingTab.tsx +0 -446
  24. package/src/components/tabs/MetaTab.tsx +0 -431
  25. package/src/components/tabs/SummaryTab.tsx +0 -405
  26. package/src/components/tabs/TechnicalTab.tsx +0 -933
  27. package/src/hooks/useDocumentContent.ts +0 -48
  28. package/src/hooks/useKeywordAnalysis.ts +0 -292
  29. package/src/hooks/useSEOChat.ts +0 -254
  30. package/src/index.ts +0 -16
  31. package/src/inspector.ts +0 -58
  32. package/src/lib/api.ts +0 -260
  33. package/src/lib/documentExtract.ts +0 -422
  34. package/src/lib/geoAnalysis.ts +0 -122
  35. package/src/lib/persistence.ts +0 -69
  36. package/src/lib/scoring.ts +0 -197
  37. package/src/lib/summary.ts +0 -645
  38. package/src/lib/types.ts +0 -212
  39. package/src/lib/utils.ts +0 -35
  40. package/v2-incompatible.js +0 -10
@@ -1,373 +0,0 @@
1
- import { useState, useRef, useLayoutEffect, useEffect } from "react";
2
- import { PANEL_BG, MJH_BLUE } from "./styles";
3
- import type { TabId } from "../lib/types";
4
-
5
- interface TabDef {
6
- id: TabId;
7
- label: string;
8
- loading?: boolean;
9
- badge?: number;
10
- /** When true, the tab is styled as a "hub" landmark (not the regular flow). */
11
- isHub?: boolean;
12
- /** When true, a small beta marker is shown next to the label. */
13
- beta?: boolean;
14
- }
15
-
16
- // Small BETA pill shown next to the label. Tabs are equal-width and wrap
17
- // vertically when the panel is narrow (see button styles), so all six stay
18
- // visible and the pill never pushes a tab off-screen.
19
- function BetaPill({ active }: { active?: boolean }) {
20
- return (
21
- <span
22
- title="Beta - this tab references Sanity fields and related articles that may need configuration in your live environment, so it needs more testing"
23
- style={{
24
- display: "inline-block",
25
- fontSize: 7.5,
26
- fontWeight: 700,
27
- letterSpacing: "0.03em",
28
- padding: "1px 3px",
29
- borderRadius: 3,
30
- // On the active tab the blue glider sits behind, so flip to a white chip
31
- // (blue text) to stay legible; off the glider it's a blue-tint chip.
32
- background: active ? "rgba(255,255,255,0.92)" : "rgba(0,93,172,0.14)",
33
- color: MJH_BLUE,
34
- textTransform: "uppercase",
35
- lineHeight: 1.1,
36
- verticalAlign: "middle",
37
- marginLeft: 3,
38
- whiteSpace: "nowrap",
39
- }}
40
- >
41
- Beta
42
- </span>
43
- );
44
- }
45
-
46
- // Renders a tab label so it only ever wraps between whole segments, never inside
47
- // a word. A single word ("Summary", "Keywords") never splits. "AEO/GEO" wraps as
48
- // "AEO/" / "GEO" - the slash STAYS on the first line with the preceding text (a
49
- // line never begins with a slash; see brand kit "Label line-breaking"). The Beta
50
- // pill drops onto its own line (below the label) before any word would break.
51
- function TabLabel({ label, beta, active }: { label: string; beta?: boolean; active?: boolean }) {
52
- let body: React.ReactNode;
53
- const slash = label.indexOf("/");
54
- if (slash > 0) {
55
- const head = label.slice(0, slash + 1); // "AEO/" - slash stays on the first line
56
- const tail = label.slice(slash + 1); // "GEO"
57
- body = (
58
- <>
59
- <span style={{ whiteSpace: "nowrap" }}>{head}</span>
60
- <wbr />
61
- <span style={{ whiteSpace: "nowrap" }}>{tail}</span>
62
- </>
63
- );
64
- } else {
65
- // Single word stays whole (no break point inside it); a two-word label like
66
- // "Other Recs" wraps at its space naturally.
67
- body = label;
68
- }
69
- return (
70
- <span>
71
- {body}
72
- {beta && (
73
- <>
74
- <wbr />
75
- <BetaPill active={active} />
76
- </>
77
- )}
78
- </span>
79
- );
80
- }
81
-
82
- interface TabBarProps {
83
- tabs: TabDef[];
84
- activeTab: TabId;
85
- onTabChange: (id: TabId) => void;
86
- }
87
-
88
- // Tab-bar text colors are tuned for the pale-gold PANEL_BG surface - translucent
89
- // black reads as "ink" and stays legible where a light gray would wash out.
90
- const ACTIVE_INK = "#1f2937";
91
- const HUB_INK = "rgba(0,0,0,0.7)";
92
- const INACTIVE_INK = "rgba(0,0,0,0.52)";
93
-
94
- function HubGlyph({ active }: { active: boolean }) {
95
- // 4-cell grid icon - reads as "overview / dashboard" without being heavy-handed.
96
- // White when active (it sits on the blue glider), muted ink otherwise.
97
- const fill = active ? "#ffffff" : HUB_INK;
98
- return (
99
- <svg
100
- width="11"
101
- height="11"
102
- viewBox="0 0 12 12"
103
- fill="none"
104
- style={{ flexShrink: 0 }}
105
- aria-hidden="true"
106
- >
107
- <rect x="1" y="1" width="4" height="4" rx="0.8" fill={fill} />
108
- <rect x="7" y="1" width="4" height="4" rx="0.8" fill={fill} opacity="0.55" />
109
- <rect x="1" y="7" width="4" height="4" rx="0.8" fill={fill} opacity="0.55" />
110
- <rect x="7" y="7" width="4" height="4" rx="0.8" fill={fill} />
111
- </svg>
112
- );
113
- }
114
-
115
- interface IndicatorBox {
116
- left: number;
117
- top: number;
118
- width: number;
119
- height: number;
120
- ready: boolean;
121
- // Slide duration in ms, scaled by how far the indicator travels: a long
122
- // Summary->Meta jump takes LONGER so it glides smoothly instead of whipping
123
- // across; a short neighbour hop stays snappy.
124
- duration: number;
125
- }
126
-
127
- export function TabBar({ tabs, activeTab, onTabChange }: TabBarProps) {
128
- const [hoveredId, setHoveredId] = useState<TabId | null>(null);
129
- const barRef = useRef<HTMLDivElement>(null);
130
- const tabRefs = useRef<Map<TabId, HTMLButtonElement>>(new Map());
131
- const prevActiveRef = useRef<TabId>(activeTab);
132
- // The sliding "liquid glass" indicator that marks the active tab. We measure
133
- // the active button's box relative to the bar and animate to it - this works
134
- // with the responsive wrapping because we read the real rendered box (which
135
- // may sit on a second row on a narrow panel) rather than assuming a layout.
136
- const [ind, setInd] = useState<IndicatorBox>({ left: 0, top: 0, width: 0, height: 0, ready: false, duration: 360 });
137
- // While the panel is actively being resized we track the active tab INSTANTLY
138
- // (no slide/bounce) so the indicator doesn't wobble during a drag. A click sets
139
- // this false, so selecting a tab always slides + bounces. Crucially the
140
- // transition is NEVER "none" (it only swaps bounce <-> instant) - that is what
141
- // keeps every click animating; the old "none" gate was getting reset by a
142
- // reflow on tab-switch, which is why clicks were snapping with zero slide.
143
- const [resizing, setResizing] = useState(false);
144
- // True for a beat right after a click, so a click-induced reflow (a scrollbar
145
- // appearing as tab content changes) isn't mistaken for a resize and doesn't
146
- // cancel the slide that's mid-flight.
147
- const justClickedRef = useRef(false);
148
- const clickTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
149
- const resizeSettleRef = useRef<ReturnType<typeof setTimeout> | null>(null);
150
-
151
- // Signature changes whenever something that can move the active tab changes
152
- // (label wrap, loading dot, beta pill), so the indicator re-measures.
153
- const signature = tabs.map((t) => `${t.id}:${t.label}:${t.loading ? 1 : 0}:${t.beta ? 1 : 0}`).join("|");
154
-
155
- useLayoutEffect(() => {
156
- const bar = barRef.current;
157
- const el = tabRefs.current.get(activeTab);
158
- if (!bar || !el) return;
159
- const br = bar.getBoundingClientRect();
160
- const er = el.getBoundingClientRect();
161
- const next = {
162
- left: er.left - br.left + bar.scrollLeft,
163
- top: er.top - br.top + bar.scrollTop,
164
- width: er.width,
165
- height: er.height,
166
- };
167
- const changed = prevActiveRef.current !== activeTab;
168
- prevActiveRef.current = activeTab;
169
- if (changed) {
170
- // A real selection: drop out of resize mode so this move slides + bounces,
171
- // and shield the next beat so a reflow can't cancel the slide.
172
- setResizing(false);
173
- justClickedRef.current = true;
174
- if (clickTimerRef.current) clearTimeout(clickTimerRef.current);
175
- clickTimerRef.current = setTimeout(() => { justClickedRef.current = false; }, 650);
176
- }
177
- setInd((prev) => {
178
- if (prev.left === next.left && prev.top === next.top && prev.width === next.width && prev.height === next.height && prev.ready) {
179
- return prev;
180
- }
181
- // Scale the slide time to the travel distance: ~constant perceived speed,
182
- // clamped so a neighbour hop is snappy (~280ms) and the longest jump glides
183
- // (~560ms) rather than darting across. Fixes "slides way too fast" on long jumps.
184
- const dist = Math.hypot(next.left - prev.left, next.top - prev.top);
185
- const duration = Math.min(560, Math.max(280, Math.round(250 + dist * 0.6)));
186
- return { ...next, ready: true, duration };
187
- });
188
- return () => {
189
- if (clickTimerRef.current) clearTimeout(clickTimerRef.current);
190
- };
191
- }, [activeTab, signature]);
192
-
193
- // Re-measure when the bar resizes (panel resize -> tabs may reflow / wrap).
194
- useEffect(() => {
195
- const bar = barRef.current;
196
- if (!bar || typeof ResizeObserver === "undefined") return;
197
- const ro = new ResizeObserver(() => {
198
- // A reflow caused by a just-happened click isn't a resize - let the slide
199
- // that's already in flight finish instead of snapping it.
200
- if (justClickedRef.current) return;
201
- const el = tabRefs.current.get(activeTab);
202
- if (!el) return;
203
- const br = bar.getBoundingClientRect();
204
- const er = el.getBoundingClientRect();
205
- // Track instantly while resizing, then settle back to sliding so the next
206
- // click bounces again.
207
- setResizing(true);
208
- if (resizeSettleRef.current) clearTimeout(resizeSettleRef.current);
209
- resizeSettleRef.current = setTimeout(() => setResizing(false), 160);
210
- setInd((prev) => ({
211
- left: er.left - br.left + bar.scrollLeft,
212
- top: er.top - br.top + bar.scrollTop,
213
- width: er.width,
214
- height: er.height,
215
- ready: true,
216
- duration: prev.duration,
217
- }));
218
- });
219
- ro.observe(bar);
220
- return () => {
221
- ro.disconnect();
222
- if (resizeSettleRef.current) clearTimeout(resizeSettleRef.current);
223
- };
224
- }, [activeTab]);
225
-
226
- return (
227
- <div
228
- ref={barRef}
229
- style={{
230
- position: "relative",
231
- display: "flex",
232
- alignItems: "stretch",
233
- background: PANEL_BG,
234
- borderBottom: "1px solid rgba(0,0,0,0.14)",
235
- overflowX: "auto",
236
- overflowY: "hidden",
237
- flexShrink: 0,
238
- }}
239
- role="tablist"
240
- onMouseLeave={() => setHoveredId(null)}
241
- >
242
- {/* Sliding liquid-glass active indicator (behind the tab labels). */}
243
- {ind.ready && (
244
- <div
245
- aria-hidden="true"
246
- style={{
247
- position: "absolute",
248
- left: ind.left,
249
- top: ind.top,
250
- width: ind.width,
251
- height: ind.height,
252
- borderRadius: 9,
253
- background: "linear-gradient(135deg, rgba(0,93,172,0.62), rgba(0,93,172,0.95))",
254
- backdropFilter: "blur(16px) saturate(170%)",
255
- WebkitBackdropFilter: "blur(16px) saturate(170%)",
256
- // Beveled glass: top-left light edge + bottom-right inner shadow + a soft blue glow.
257
- boxShadow:
258
- "inset 1px 1px 3px rgba(255,255,255,0.4), inset -1px -1px 5px rgba(0,0,0,0.28), 0 0 14px rgba(0,93,172,0.40), 0 2px 8px rgba(0,0,0,0.15)",
259
- // Always a DEFINED transition (never "none") - that's what keeps every
260
- // click animating. Normally: a real slide with a gentle bounce that lands
261
- // on arrival (ease-out-back), for the distance-scaled duration so long
262
- // jumps glide instead of darting. While resizing: 0ms = track instantly
263
- // so the indicator doesn't wobble during a drag.
264
- transition: resizing
265
- ? "left 0ms linear, top 0ms linear, width 0ms linear, height 0ms linear"
266
- : `left ${ind.duration}ms cubic-bezier(0.34,1.5,0.64,1), top ${ind.duration}ms cubic-bezier(0.34,1.5,0.64,1), width ${Math.round(ind.duration * 0.82)}ms cubic-bezier(0.22,1,0.36,1), height ${Math.round(ind.duration * 0.82)}ms cubic-bezier(0.22,1,0.36,1)`,
267
- pointerEvents: "none",
268
- zIndex: 0,
269
- }}
270
- />
271
- )}
272
- {tabs.map((tab, index) => {
273
- const isActive = tab.id === activeTab;
274
- const nextTab = tabs[index + 1];
275
- // Visual separator: after a hub tab, before a non-hub tab
276
- const showDivider = tab.isHub && nextTab && !nextTab.isHub;
277
- return (
278
- <div key={tab.id} style={{ display: "flex", alignItems: "stretch", flex: "1 1 auto" }}>
279
- <button
280
- ref={(el) => {
281
- if (el) tabRefs.current.set(tab.id, el);
282
- else tabRefs.current.delete(tab.id);
283
- }}
284
- role="tab"
285
- aria-selected={isActive}
286
- onClick={() => onTabChange(tab.id)}
287
- onMouseEnter={() => setHoveredId(tab.id)}
288
- style={{
289
- position: "relative",
290
- zIndex: 1,
291
- flex: 1,
292
- margin: 3,
293
- padding: "5px 4px",
294
- borderRadius: 9,
295
- // The active highlight is the sliding indicator behind the tab, so the
296
- // active button stays transparent. Hover gets a faint tint; the hub
297
- // keeps its soft landmark fill when it isn't the active tab.
298
- background:
299
- !isActive && hoveredId === tab.id
300
- ? "rgba(255,255,255,0.4)"
301
- : !isActive && tab.isHub
302
- ? "rgba(255,255,255,0.55)"
303
- : "transparent",
304
- border: "none",
305
- cursor: "pointer",
306
- fontSize: 10.5,
307
- fontWeight: isActive ? 700 : tab.isHub ? 600 : 500,
308
- color: isActive ? "#ffffff" : tab.isHub ? HUB_INK : INACTIVE_INK,
309
- letterSpacing: "0.005em",
310
- // normal (not nowrap) lets a multi-word label wrap at its space or
311
- // after the slash on a narrow panel (e.g. "AEO/" over "GEO"). No
312
- // break-word, so a single word like "Summary" never splits mid-word.
313
- whiteSpace: "normal",
314
- textAlign: "center",
315
- lineHeight: 1.25,
316
- transition: "color 150ms, background 150ms",
317
- fontFamily: "inherit",
318
- display: "flex",
319
- alignItems: "center",
320
- justifyContent: "center",
321
- gap: 4,
322
- }}
323
- >
324
- {tab.isHub && <HubGlyph active={isActive} />}
325
- <TabLabel label={tab.label} beta={tab.beta} active={isActive} />
326
- {tab.loading && (
327
- <span
328
- style={{
329
- width: 5,
330
- height: 5,
331
- borderRadius: "50%",
332
- background: "#ffffff",
333
- boxShadow: "0 0 0 1px rgba(0,0,0,0.15)",
334
- animation: "content-pulse 1.4s ease-in-out infinite",
335
- }}
336
- />
337
- )}
338
- {typeof tab.badge === "number" && tab.badge > 0 && !tab.loading && (
339
- <span
340
- style={{
341
- fontSize: 9,
342
- fontWeight: 700,
343
- padding: "1px 5px",
344
- borderRadius: 99,
345
- background: isActive ? ACTIVE_INK : "rgba(0,0,0,0.16)",
346
- color: isActive ? "#ffffff" : "rgba(0,0,0,0.7)",
347
- minWidth: 16,
348
- textAlign: "center",
349
- }}
350
- >
351
- {tab.badge}
352
- </span>
353
- )}
354
- </button>
355
- {showDivider && (
356
- <div
357
- aria-hidden="true"
358
- style={{
359
- width: 1,
360
- alignSelf: "center",
361
- height: 16,
362
- margin: "0 2px",
363
- background: "rgba(0,0,0,0.18)",
364
- zIndex: 1,
365
- }}
366
- />
367
- )}
368
- </div>
369
- );
370
- })}
371
- </div>
372
- );
373
- }
@@ -1,158 +0,0 @@
1
- // Injected CSS for animations and markdown - must be added via <style> tag
2
- export const INJECTED_CSS = `
3
- @keyframes bar-shift-1 {
4
- 0%, 100% { height: 8px; }
5
- 25% { height: 14px; }
6
- 50% { height: 6px; }
7
- 75% { height: 12px; }
8
- }
9
- @keyframes bar-shift-2 {
10
- 0%, 100% { height: 12px; }
11
- 25% { height: 6px; }
12
- 50% { height: 14px; }
13
- 75% { height: 8px; }
14
- }
15
- @keyframes bar-shift-3 {
16
- 0%, 100% { height: 6px; }
17
- 25% { height: 10px; }
18
- 50% { height: 12px; }
19
- 75% { height: 5px; }
20
- }
21
- @keyframes fade-up {
22
- from { opacity: 0; transform: translateY(6px); }
23
- to { opacity: 1; transform: translateY(0); }
24
- }
25
- @keyframes spin {
26
- from { transform: rotate(0deg); }
27
- to { transform: rotate(360deg); }
28
- }
29
- @keyframes content-pulse {
30
- 0%, 100% { opacity: 0.5; }
31
- 50% { opacity: 1; }
32
- }
33
- @keyframes onboard-in {
34
- from { opacity: 0; transform: translateY(-6px) scale(0.97); }
35
- to { opacity: 1; transform: translateY(0) scale(1); }
36
- }
37
- @keyframes onboard-out {
38
- from { opacity: 1; transform: translateY(0) scale(1); }
39
- to { opacity: 0; transform: translateY(-6px) scale(0.97); }
40
- }
41
- @keyframes seo-copilot-sec-float {
42
- 0%, 100% { transform: translateY(0); }
43
- 50% { transform: translateY(-1.5px); }
44
- }
45
- @media (prefers-reduced-motion: reduce) {
46
- .seo-copilot-sec-circle { animation: none !important; }
47
- }
48
- .prose-chat { font-size: 12.5px; line-height: 1.65; color: #475569; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; }
49
- .prose-chat h1 { font-size: 14px; font-weight: 700; color: #1e293b; margin: 10px 0 5px 0; line-height: 1.35; }
50
- .prose-chat h2, .prose-chat h3 { font-size: 13px; font-weight: 700; color: #1e293b; margin: 10px 0 5px 0; line-height: 1.35; }
51
- .prose-chat p { margin: 5px 0; }
52
- .prose-chat ul, .prose-chat ol { margin: 5px 0; padding-left: 18px; }
53
- .prose-chat li { margin: 3px 0; }
54
- .prose-chat strong { font-weight: 600; color: #1e293b; }
55
- .prose-chat hr { border: none; border-top: 1px solid #f1f5f9; margin: 10px 0; }
56
- .prose-chat code { background: #f8fafc; padding: 2px 5px; border-radius: 4px; font-size: 11px; border: 1px solid #f1f5f9; }
57
- .prose-chat a { color: #005DAC; text-decoration: none; border-bottom: 1px solid rgba(0,93,172,0.3); }
58
- .prose-chat a:hover { border-bottom-color: #005DAC; }
59
- .prose-chat table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 8px 0; font-size: 11px; border-radius: 8px; overflow: hidden; border: 1px solid #f1f5f9; }
60
- .prose-chat th { text-align: left; padding: 6px 10px; font-weight: 600; color: #475569; border-bottom: 1px solid #f1f5f9; background: #fafbfc; }
61
- .prose-chat td { padding: 6px 10px; border-bottom: 1px solid #f8fafc; color: #64748b; }
62
- .prose-chat tr:last-child td { border-bottom: none; }
63
-
64
- /* Panel surface - a pale warm-gold base (PANEL_BG, set inline) lifted with a premium
65
- sheen: a soft top-down light pool, a faint warm radial bloom near the top edge, and
66
- a whisper of fine grain so the surface reads as a polished material, not a flat fill.
67
- The solid color is set inline (backgroundColor) so this image layer is never reset. */
68
- .seo-copilot-panel {
69
- background-image:
70
- linear-gradient(180deg, rgba(255,255,255,0.78) 0%, rgba(255,255,255,0.22) 150px, rgba(255,255,255,0) 340px),
71
- radial-gradient(ellipse 130% 48% at 50% -6%, rgba(255,253,244,0.9) 0%, rgba(255,253,244,0) 62%),
72
- url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='nz' x='0' y='0'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23nz)' opacity='0.025'/%3E%3C/svg%3E");
73
- background-size: 100% 100%, 100% 100%, 140px 140px;
74
- background-repeat: no-repeat, no-repeat, repeat;
75
- background-position: center top, center top, center;
76
- }
77
-
78
- /* Thin scrollbars */
79
- .seo-copilot-panel { scrollbar-width: thin; scrollbar-color: #e5e7eb transparent; }
80
- .seo-copilot-panel ::-webkit-scrollbar { width: 4px; }
81
- .seo-copilot-panel ::-webkit-scrollbar-track { background: transparent; }
82
- .seo-copilot-panel ::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 4px; }
83
- .seo-copilot-panel * { scrollbar-width: thin; scrollbar-color: #e5e7eb transparent; }
84
-
85
- /* Dark mode overrides - Sanity adds data-scheme="dark" or [data-ui-color-scheme="dark"] */
86
- @media (prefers-color-scheme: dark) {
87
- .seo-copilot-panel { color-scheme: light; }
88
- }
89
- /* Force light text colors when Sanity is in dark mode - the panel bg stays white but text was washing out */
90
- [data-scheme="dark"] .seo-copilot-panel,
91
- [data-ui-color-scheme="dark"] .seo-copilot-panel {
92
- color: #374151;
93
- }
94
- [data-scheme="dark"] .seo-copilot-panel *,
95
- [data-ui-color-scheme="dark"] .seo-copilot-panel * {
96
- color-scheme: light;
97
- }
98
-
99
- /* Deep-link highlight flash - triggered when jumping from the Summary tab to a card */
100
- @keyframes seo-copilot-flash {
101
- 0% { box-shadow: 0 0 0 2px rgba(230,192,27,0), 0 0 0 6px rgba(230,192,27,0); }
102
- 15% { box-shadow: 0 0 0 2px rgba(230,192,27,0.9), 0 0 0 6px rgba(230,192,27,0.22); }
103
- 100% { box-shadow: 0 0 0 2px rgba(230,192,27,0), 0 0 0 6px rgba(230,192,27,0); }
104
- }
105
- .seo-copilot-flash { animation: seo-copilot-flash 1.3s ease-out; border-radius: 14px; }
106
-
107
- /* Visible focus ring for keyboard nav - browser defaults wash out on this background */
108
- .seo-copilot-panel button:focus-visible,
109
- .seo-copilot-panel [role="tab"]:focus-visible,
110
- .seo-copilot-panel a:focus-visible,
111
- .seo-copilot-panel input:focus-visible,
112
- .seo-copilot-panel textarea:focus-visible {
113
- outline: 2px solid #005DAC;
114
- outline-offset: 2px;
115
- border-radius: 4px;
116
- }
117
-
118
- /* Respect reduced-motion preferences */
119
- @media (prefers-reduced-motion: reduce) {
120
- .seo-copilot-panel *, .seo-copilot-flash {
121
- animation-duration: 0.01ms !important;
122
- animation-iteration-count: 1 !important;
123
- transition-duration: 0.01ms !important;
124
- }
125
- .seo-copilot-flash {
126
- animation: none !important;
127
- box-shadow: 0 0 0 2px rgba(230,192,27,0.9) !important;
128
- }
129
- }
130
- `;
131
-
132
- // Brand colors
133
- export const MJH_GOLD = "#E6C01B";
134
- export const MJH_GOLD_DARK = "#C9A716";
135
- export const MJH_BLUE = "#005DAC";
136
- export const MJH_SLATE = "#4D596A";
137
- export const USER_BLUE = "#DFF4FD";
138
- export const USER_BLUE_BORDER = "#B8E3F9";
139
- // Panel surface fill - a pale warm-gold base behind the white content cards.
140
- // Light enough that the white cards read as raised; the sheen/grain is layered
141
- // on via the .seo-copilot-panel rule in INJECTED_CSS.
142
- export const PANEL_BG = "#F3EAD2";
143
-
144
- // Chat zone backdrop - the AI conversation zone. A cool, subtly multi-shaded
145
- // MJH-blue wash with a soft glow rising from the composer; sets the chat apart
146
- // from the gold analysis zone and reads "AI". ONE token so the collapse/expand
147
- // toggle bar, the messages, and the composer all share a single continuous
148
- // gradient (the toggle is part of the chat zone, not the gold panel).
149
- export const CHAT_ZONE_BG =
150
- "radial-gradient(120% 90% at 50% 106%, rgba(0,93,172,0.22), rgba(0,93,172,0) 62%), linear-gradient(180deg, #EAF2FA 0%, #DCEAF7 50%, #CFE2F4 100%)";
151
-
152
- // Recommendations zone backdrop - mirrors the chat gradient's STRUCTURE in the
153
- // warm GOLD family (analysis / copilot identity). A soft gold bloom near the top
154
- // echoes the chat's bottom glow, giving the recommendations the same gradient
155
- // depth without crossing into the blue chat zone. Gold above, blue below; the
156
- // toggle bar is the seam between the two zones.
157
- export const RECS_ZONE_BG =
158
- "radial-gradient(120% 90% at 50% -8%, rgba(230,192,27,0.26), rgba(230,192,27,0) 60%), linear-gradient(180deg, #FBF4DD 0%, #F0E1B4 52%, #E5D096 100%)";