wally-ui 1.13.1 → 1.14.0
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/package.json +1 -1
- package/playground/showcase/package-lock.json +48 -0
- package/playground/showcase/package.json +1 -0
- package/playground/showcase/src/app/app.routes.server.ts +4 -0
- package/playground/showcase/src/app/components/ai/ai-chat/ai-chat.html +7 -2
- package/playground/showcase/src/app/components/ai/ai-chat/ai-chat.ts +12 -1
- package/playground/showcase/src/app/components/ai/ai-chat.service.spec.ts +16 -0
- package/playground/showcase/src/app/components/ai/ai-chat.service.ts +6 -0
- package/playground/showcase/src/app/components/ai/ai-composer/ai-composer.html +14 -7
- package/playground/showcase/src/app/components/ai/ai-composer/ai-composer.ts +3 -1
- package/playground/showcase/src/app/components/ai/ai-message/ai-message.css +0 -0
- package/playground/showcase/src/app/components/ai/ai-message/ai-message.html +165 -0
- package/playground/showcase/src/app/components/ai/ai-message/ai-message.spec.ts +23 -0
- package/playground/showcase/src/app/components/ai/ai-message/ai-message.ts +51 -0
- package/playground/showcase/src/app/components/button/button.html +1 -1
- package/playground/showcase/src/app/components/button/button.ts +3 -3
- package/playground/showcase/src/app/components/selection-popover/selection-popover.css +0 -0
- package/playground/showcase/src/app/components/selection-popover/selection-popover.html +27 -0
- package/playground/showcase/src/app/components/selection-popover/selection-popover.spec.ts +23 -0
- package/playground/showcase/src/app/components/selection-popover/selection-popover.ts +205 -0
- package/playground/showcase/src/app/pages/documentation/chat-sdk/chat-sdk.html +1 -1
- package/playground/showcase/src/app/pages/documentation/components/button-docs/button-docs.examples.ts +10 -10
- package/playground/showcase/src/app/pages/documentation/components/button-docs/button-docs.html +2 -2
- package/playground/showcase/src/app/pages/documentation/components/components.html +27 -0
- package/playground/showcase/src/app/pages/documentation/components/components.routes.ts +4 -0
- package/playground/showcase/src/app/pages/documentation/components/selection-popover-docs/selection-popover-docs.css +1 -0
- package/playground/showcase/src/app/pages/documentation/components/selection-popover-docs/selection-popover-docs.examples.ts +324 -0
- package/playground/showcase/src/app/pages/documentation/components/selection-popover-docs/selection-popover-docs.html +506 -0
- package/playground/showcase/src/app/pages/documentation/components/selection-popover-docs/selection-popover-docs.ts +96 -0
- package/playground/showcase/src/app/pages/home/home.html +2 -2
- package/playground/showcase/src/styles.css +1 -0
|
@@ -0,0 +1,506 @@
|
|
|
1
|
+
<main class="min-h-dvh bg-white dark:bg-[#0a0a0a] font-mono" role="main">
|
|
2
|
+
<div class="max-w-4xl mx-auto px-4 py-8 sm:px-6 md:px-8">
|
|
3
|
+
|
|
4
|
+
<!-- Breadcrumb Navigation -->
|
|
5
|
+
<nav class="mb-8" aria-label="Breadcrumb navigation">
|
|
6
|
+
<wally-breadcrumb [items]="breadcrumbItems"></wally-breadcrumb>
|
|
7
|
+
</nav>
|
|
8
|
+
|
|
9
|
+
<!-- Header -->
|
|
10
|
+
<header class="mb-12" role="banner">
|
|
11
|
+
<h1 id="page-title" class="text-3xl sm:text-4xl font-bold text-[#0a0a0a] dark:text-white mb-4 uppercase">
|
|
12
|
+
<span aria-hidden="true">>_ </span>Selection Popover
|
|
13
|
+
</h1>
|
|
14
|
+
<p
|
|
15
|
+
class="text-sm sm:text-base text-neutral-700 dark:text-neutral-300 border-l-2 border-neutral-300 dark:border-neutral-700 pl-4 leading-relaxed">
|
|
16
|
+
Floating action toolbar that appears above selected text, similar to Medium, Notion, and Google Docs. Built with
|
|
17
|
+
Selection API, viewport-aware positioning, and zero-flash rendering for seamless UX.
|
|
18
|
+
</p>
|
|
19
|
+
</header>
|
|
20
|
+
|
|
21
|
+
<!-- AI Assistant Links -->
|
|
22
|
+
<div class="flex flex-wrap gap-0 mt-6 mb-12 border-2 border-neutral-300 dark:border-neutral-700" role="list"
|
|
23
|
+
aria-label="Open documentation in AI coding assistants">
|
|
24
|
+
<a [href]="claudeUrl" target="_blank"
|
|
25
|
+
class="group flex-1 min-w-[200px] flex items-center justify-center gap-2 px-4 py-3 bg-white dark:bg-[#0a0a0a] border-b-2 sm:border-b-0 sm:border-r-2 border-neutral-300 dark:border-neutral-700 hover:bg-[#0a0a0a] dark:hover:bg-white transition-all duration-150 cursor-pointer"
|
|
26
|
+
rel="noopener noreferrer" role="listitem"
|
|
27
|
+
aria-label="Open Selection Popover component documentation in Claude AI assistant (opens in new tab)">
|
|
28
|
+
<svg xmlns="http://www.w3.org/2000/svg"
|
|
29
|
+
class="size-5 text-[#0a0a0a] dark:text-neutral-400 group-hover:text-white dark:group-hover:text-[#0a0a0a] transition-colors duration-150"
|
|
30
|
+
viewBox="0 0 24 24" aria-hidden="true">
|
|
31
|
+
<path fill="currentColor"
|
|
32
|
+
d="m4.714 15.956l4.718-2.648l.079-.23l-.08-.128h-.23l-.79-.048l-2.695-.073l-2.337-.097l-2.265-.122l-.57-.121l-.535-.704l.055-.353l.48-.321l.685.06l1.518.104l2.277.157l1.651.098l2.447.255h.389l.054-.158l-.133-.097l-.103-.098l-2.356-1.596l-2.55-1.688l-1.336-.972l-.722-.491L2 6.223l-.158-1.008l.656-.722l.88.06l.224.061l.893.686l1.906 1.476l2.49 1.833l.364.304l.146-.104l.018-.072l-.164-.274l-1.354-2.446l-1.445-2.49l-.644-1.032l-.17-.619a3 3 0 0 1-.103-.729L6.287.133L6.7 0l.995.134l.42.364l.619 1.415L9.735 4.14l1.555 3.03l.455.898l.243.832l.09.255h.159V9.01l.127-1.706l.237-2.095l.23-2.695l.08-.76l.376-.91l.747-.492l.583.28l.48.685l-.067.444l-.286 1.851l-.558 2.903l-.365 1.942h.213l.243-.242l.983-1.306l1.652-2.064l.728-.82l.85-.904l.547-.431h1.032l.759 1.129l-.34 1.166l-1.063 1.347l-.88 1.142l-1.263 1.7l-.79 1.36l.074.11l.188-.02l2.853-.606l1.542-.28l1.84-.315l.832.388l.09.395l-.327.807l-1.967.486l-2.307.462l-3.436.813l-.043.03l.049.061l1.548.146l.662.036h1.62l3.018.225l.79.522l.473.638l-.08.485l-1.213.62l-1.64-.389l-3.825-.91l-1.31-.329h-.183v.11l1.093 1.068l2.003 1.81l2.508 2.33l.127.578l-.321.455l-.34-.049l-2.204-1.657l-.85-.747l-1.925-1.62h-.127v.17l.443.649l2.343 3.521l.122 1.08l-.17.353l-.607.213l-.668-.122l-1.372-1.924l-1.415-2.168l-1.141-1.943l-.14.08l-.674 7.254l-.316.37l-.728.28l-.607-.461l-.322-.747l.322-1.476l.388-1.924l.316-1.53l.285-1.9l.17-.632l-.012-.042l-.14.018l-1.432 1.967l-2.18 2.945l-1.724 1.845l-.413.164l-.716-.37l.066-.662l.401-.589l2.386-3.036l1.439-1.882l.929-1.086l-.006-.158h-.055L4.138 18.56l-1.13.146l-.485-.456l.06-.746l.231-.243l1.907-1.312Z" />
|
|
33
|
+
</svg>
|
|
34
|
+
<span
|
|
35
|
+
class="text-xs sm:text-sm font-medium text-[#0a0a0a] dark:text-neutral-400 group-hover:text-white dark:group-hover:text-[#0a0a0a] transition-colors duration-150">
|
|
36
|
+
Open in Claude
|
|
37
|
+
</span>
|
|
38
|
+
</a>
|
|
39
|
+
|
|
40
|
+
<a [href]="chatGptUrl" target="_blank"
|
|
41
|
+
class="group flex-1 min-w-[200px] flex items-center justify-center gap-2 px-4 py-3 bg-white dark:bg-[#0a0a0a] hover:bg-[#0a0a0a] dark:hover:bg-white transition-all duration-150 cursor-pointer"
|
|
42
|
+
rel="noopener noreferrer" role="listitem"
|
|
43
|
+
aria-label="Open Selection Popover component documentation in ChatGPT AI assistant (opens in new tab)">
|
|
44
|
+
<svg xmlns="http://www.w3.org/2000/svg"
|
|
45
|
+
class="size-5 text-[#0a0a0a] dark:text-neutral-400 group-hover:text-white dark:group-hover:text-[#0a0a0a] transition-colors duration-150"
|
|
46
|
+
viewBox="0 0 48 48" aria-hidden="true">
|
|
47
|
+
<path fill="none" stroke="currentColor" stroke-width="3" stroke-linejoin="round"
|
|
48
|
+
d="M18.38 27.94v-14.4l11.19-6.46c6.2-3.58 17.3 5.25 12.64 13.33" />
|
|
49
|
+
<path fill="none" stroke="currentColor" stroke-width="3" stroke-linejoin="round"
|
|
50
|
+
d="m18.38 20.94l12.47-7.2l11.19 6.46c6.2 3.58 4.1 17.61-5.23 17.61" />
|
|
51
|
+
<path fill="none" stroke="currentColor" stroke-width="3" stroke-linejoin="round"
|
|
52
|
+
d="m24.44 17.44l12.47 7.2v12.93c0 7.16-13.2 12.36-17.86 4.28" />
|
|
53
|
+
<path fill="none" stroke="currentColor" stroke-width="3" stroke-linejoin="round"
|
|
54
|
+
d="M30.5 21.2v14.14L19.31 41.8c-6.2 3.58-17.3-5.25-12.64-13.33" />
|
|
55
|
+
<path fill="none" stroke="currentColor" stroke-width="3" stroke-linejoin="round"
|
|
56
|
+
d="m30.5 27.94l-12.47 7.2l-11.19-6.46c-6.21-3.59-4.11-17.61 5.22-17.61" />
|
|
57
|
+
<path fill="none" stroke="currentColor" stroke-width="3" stroke-linejoin="round"
|
|
58
|
+
d="m24.44 31.44l-12.47-7.2V11.31c0-7.16 13.2-12.36 17.86-4.28" />
|
|
59
|
+
</svg>
|
|
60
|
+
<span
|
|
61
|
+
class="text-xs sm:text-sm font-medium text-[#0a0a0a] dark:text-neutral-400 group-hover:text-white dark:group-hover:text-[#0a0a0a] transition-colors duration-150">
|
|
62
|
+
Open in ChatGPT
|
|
63
|
+
</span>
|
|
64
|
+
</a>
|
|
65
|
+
</div>
|
|
66
|
+
|
|
67
|
+
<!-- Installation -->
|
|
68
|
+
<section id="installation" class="mb-12" aria-labelledby="installation-heading">
|
|
69
|
+
<h2 id="installation-heading"
|
|
70
|
+
class="text-[10px] sm:text-xs text-neutral-500 dark:text-neutral-500 uppercase tracking-wider mb-4">
|
|
71
|
+
[ Installation ]
|
|
72
|
+
</h2>
|
|
73
|
+
<div
|
|
74
|
+
class="text-xs sm:text-sm text-[#0a0a0a] dark:text-white block bg-neutral-100 dark:bg-[#121212] border border-neutral-300 dark:border-neutral-700 p-3"
|
|
75
|
+
aria-label="Installation command for Selection Popover component">
|
|
76
|
+
<pre><code [innerHTML]="installationCode"></code></pre>
|
|
77
|
+
</div>
|
|
78
|
+
</section>
|
|
79
|
+
|
|
80
|
+
<!-- Import -->
|
|
81
|
+
<section id="import" class="mb-12" aria-labelledby="import-heading">
|
|
82
|
+
<h2 id="import-heading"
|
|
83
|
+
class="text-[10px] sm:text-xs text-neutral-500 dark:text-neutral-500 uppercase tracking-wider mb-4">
|
|
84
|
+
[ Import ]
|
|
85
|
+
</h2>
|
|
86
|
+
<div class="space-y-3">
|
|
87
|
+
<div class="bg-neutral-100 dark:bg-[#121212] border border-neutral-300 dark:border-neutral-700 p-3">
|
|
88
|
+
<pre><code [innerHTML]="importCode" class="text-xs sm:text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
89
|
+
</div>
|
|
90
|
+
<div class="bg-neutral-100 dark:bg-[#121212] border border-neutral-300 dark:border-neutral-700 p-3">
|
|
91
|
+
<pre><code [innerHTML]="componentImportCode" class="text-xs sm:text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
</section>
|
|
95
|
+
|
|
96
|
+
<!-- Basic Usage -->
|
|
97
|
+
<section id="basic-usage" class="mb-12" aria-labelledby="basic-usage-heading">
|
|
98
|
+
<h2 id="basic-usage-heading"
|
|
99
|
+
class="text-[10px] sm:text-xs text-neutral-500 dark:text-neutral-500 uppercase tracking-wider mb-4">
|
|
100
|
+
[ Basic Usage ]
|
|
101
|
+
</h2>
|
|
102
|
+
<div class="bg-neutral-100 dark:bg-[#121212] border border-neutral-300 dark:border-neutral-700 p-3 mb-4">
|
|
103
|
+
<pre><code [innerHTML]="basicUsageCode" class="text-xs sm:text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
104
|
+
</div>
|
|
105
|
+
|
|
106
|
+
<div class="p-8 border-2 border-neutral-300 dark:border-neutral-700 bg-white dark:bg-[#0a0a0a]" role="img"
|
|
107
|
+
aria-label="Live preview of basic selection popover">
|
|
108
|
+
<wally-selection-popover (textSelected)="onTextSelected($event)">
|
|
109
|
+
<article class="prose dark:prose-invert max-w-none">
|
|
110
|
+
<h3 class="text-lg font-bold text-[#0a0a0a] dark:text-white mb-2">Try It Out</h3>
|
|
111
|
+
<p class="text-sm text-neutral-600 dark:text-neutral-400 leading-relaxed">
|
|
112
|
+
Select any text in this paragraph to see the popover appear above your selection. The component
|
|
113
|
+
automatically
|
|
114
|
+
detects text selection and positions the toolbar centered above the selected text. Try selecting text near
|
|
115
|
+
the edges of the screen to see automatic viewport adjustment.
|
|
116
|
+
</p>
|
|
117
|
+
</article>
|
|
118
|
+
</wally-selection-popover>
|
|
119
|
+
|
|
120
|
+
@if (actionMessage()) {
|
|
121
|
+
<p class="text-sm text-green-600 dark:text-green-400 mt-4 font-medium">
|
|
122
|
+
{{ actionMessage() }}
|
|
123
|
+
</p>
|
|
124
|
+
}
|
|
125
|
+
</div>
|
|
126
|
+
</section>
|
|
127
|
+
|
|
128
|
+
<!-- Custom Actions -->
|
|
129
|
+
<section id="custom-actions" class="mb-12" aria-labelledby="custom-actions-heading">
|
|
130
|
+
<h2 id="custom-actions-heading"
|
|
131
|
+
class="text-[10px] sm:text-xs text-neutral-500 dark:text-neutral-500 uppercase tracking-wider mb-4">
|
|
132
|
+
[ Custom Actions ]
|
|
133
|
+
</h2>
|
|
134
|
+
|
|
135
|
+
<!-- Multiple Actions -->
|
|
136
|
+
<article class="mb-8" aria-labelledby="multiple-actions-heading">
|
|
137
|
+
<h3 id="multiple-actions-heading"
|
|
138
|
+
class="text-sm sm:text-base font-bold text-[#0a0a0a] dark:text-white mb-3 uppercase">
|
|
139
|
+
<span aria-hidden="true">> </span>Multiple Custom Actions
|
|
140
|
+
</h3>
|
|
141
|
+
<p class="text-xs sm:text-sm text-neutral-600 dark:text-neutral-400 mb-3 leading-relaxed">
|
|
142
|
+
Add custom action buttons using the <span
|
|
143
|
+
class="bg-neutral-100 dark:bg-neutral-800 px-1 rounded">popoverActions</span> attribute.
|
|
144
|
+
</p>
|
|
145
|
+
<div class="space-y-3 mb-4">
|
|
146
|
+
<div class="bg-neutral-100 dark:bg-[#121212] border border-neutral-300 dark:border-neutral-700 p-3">
|
|
147
|
+
<pre><code [innerHTML]="customActionsCode" class="text-xs sm:text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
148
|
+
</div>
|
|
149
|
+
<div class="bg-neutral-100 dark:bg-[#121212] border border-neutral-300 dark:border-neutral-700 p-3">
|
|
150
|
+
<pre><code [innerHTML]="customActionsTsCode" class="text-xs sm:text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
151
|
+
</div>
|
|
152
|
+
</div>
|
|
153
|
+
<div class="p-8 border-2 border-neutral-300 dark:border-neutral-700 bg-white dark:bg-[#0a0a0a]" role="img"
|
|
154
|
+
aria-label="Live preview of selection popover with custom actions">
|
|
155
|
+
<wally-selection-popover (textSelected)="onTextSelected($event)">
|
|
156
|
+
<div popoverActions class="flex gap-1">
|
|
157
|
+
<button class="px-3 py-2 text-sm text-[#0a0a0a] dark:text-white hover:bg-neutral-100 dark:hover:bg-neutral-800 rounded-lg transition-colors cursor-pointer">
|
|
158
|
+
Ask AI
|
|
159
|
+
</button>
|
|
160
|
+
<button class="px-3 py-2 text-sm text-[#0a0a0a] dark:text-white hover:bg-neutral-100 dark:hover:bg-neutral-800 rounded-lg transition-colors cursor-pointer">
|
|
161
|
+
Copy
|
|
162
|
+
</button>
|
|
163
|
+
<button class="px-3 py-2 text-sm text-[#0a0a0a] dark:text-white hover:bg-neutral-100 dark:hover:bg-neutral-800 rounded-lg transition-colors cursor-pointer">
|
|
164
|
+
Share
|
|
165
|
+
</button>
|
|
166
|
+
</div>
|
|
167
|
+
|
|
168
|
+
<article class="prose dark:prose-invert max-w-none">
|
|
169
|
+
<p class="text-sm text-neutral-600 dark:text-neutral-400">
|
|
170
|
+
Select text to see custom actions: Ask AI, Copy, and Share buttons.
|
|
171
|
+
</p>
|
|
172
|
+
</article>
|
|
173
|
+
</wally-selection-popover>
|
|
174
|
+
</div>
|
|
175
|
+
</article>
|
|
176
|
+
|
|
177
|
+
<!-- With Wally Button -->
|
|
178
|
+
<article class="mb-8" aria-labelledby="wally-button-heading">
|
|
179
|
+
<h3 id="wally-button-heading"
|
|
180
|
+
class="text-sm sm:text-base font-bold text-[#0a0a0a] dark:text-white mb-3 uppercase">
|
|
181
|
+
<span aria-hidden="true">> </span>Using with Wally Button Component
|
|
182
|
+
</h3>
|
|
183
|
+
<p class="text-xs sm:text-sm text-neutral-600 dark:text-neutral-400 mb-3 leading-relaxed">
|
|
184
|
+
Combine with the Button component for consistent styling and accessibility.
|
|
185
|
+
</p>
|
|
186
|
+
<div class="space-y-3 mb-4">
|
|
187
|
+
<div class="bg-neutral-100 dark:bg-[#121212] border border-neutral-300 dark:border-neutral-700 p-3">
|
|
188
|
+
<pre><code [innerHTML]="withWallyButtonCode" class="text-xs sm:text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
189
|
+
</div>
|
|
190
|
+
<div class="bg-neutral-100 dark:bg-[#121212] border border-neutral-300 dark:border-neutral-700 p-3">
|
|
191
|
+
<pre><code [innerHTML]="withWallyButtonTsCode" class="text-xs sm:text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
192
|
+
</div>
|
|
193
|
+
</div>
|
|
194
|
+
<div class="p-8 border-2 border-neutral-300 dark:border-neutral-700 bg-white dark:bg-[#0a0a0a]" role="img"
|
|
195
|
+
aria-label="Live preview of selection popover with Wally Button">
|
|
196
|
+
<wally-selection-popover (textSelected)="askAI($event)">
|
|
197
|
+
<div popoverActions>
|
|
198
|
+
<wally-button variant="ghost">
|
|
199
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
|
|
200
|
+
stroke="currentColor" class="size-4">
|
|
201
|
+
<path stroke-linecap="round" stroke-linejoin="round"
|
|
202
|
+
d="M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 5.25h.008v.008H12v-.008Z" />
|
|
203
|
+
</svg>
|
|
204
|
+
Ask AI
|
|
205
|
+
</wally-button>
|
|
206
|
+
</div>
|
|
207
|
+
|
|
208
|
+
<article class="prose dark:prose-invert max-w-none">
|
|
209
|
+
<p class="text-sm text-neutral-600 dark:text-neutral-400">
|
|
210
|
+
Select text and click "Ask AI" to trigger the custom action.
|
|
211
|
+
</p>
|
|
212
|
+
</article>
|
|
213
|
+
</wally-selection-popover>
|
|
214
|
+
</div>
|
|
215
|
+
</article>
|
|
216
|
+
</section>
|
|
217
|
+
|
|
218
|
+
<!-- Production Examples -->
|
|
219
|
+
<section id="production-examples" class="mb-12" aria-labelledby="production-heading">
|
|
220
|
+
<h2 id="production-heading"
|
|
221
|
+
class="text-[10px] sm:text-xs text-neutral-500 dark:text-neutral-500 uppercase tracking-wider mb-4">
|
|
222
|
+
[ Production Examples ]
|
|
223
|
+
</h2>
|
|
224
|
+
|
|
225
|
+
<!-- Blog Article -->
|
|
226
|
+
<article class="mb-8" aria-labelledby="blog-example-heading">
|
|
227
|
+
<h3 id="blog-example-heading"
|
|
228
|
+
class="text-sm sm:text-base font-bold text-[#0a0a0a] dark:text-white mb-3 uppercase">
|
|
229
|
+
<span aria-hidden="true">> </span>Blog Article with Highlight & Comments
|
|
230
|
+
</h3>
|
|
231
|
+
<div class="space-y-3 mb-4">
|
|
232
|
+
<div class="bg-neutral-100 dark:bg-[#121212] border border-neutral-300 dark:border-neutral-700 p-3">
|
|
233
|
+
<pre><code [innerHTML]="blogExampleCode" class="text-xs sm:text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
234
|
+
</div>
|
|
235
|
+
<div class="bg-neutral-100 dark:bg-[#121212] border border-neutral-300 dark:border-neutral-700 p-3">
|
|
236
|
+
<pre><code [innerHTML]="blogExampleTsCode" class="text-xs sm:text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
237
|
+
</div>
|
|
238
|
+
</div>
|
|
239
|
+
</article>
|
|
240
|
+
|
|
241
|
+
<!-- Documentation Site -->
|
|
242
|
+
<article class="mb-8" aria-labelledby="docs-example-heading">
|
|
243
|
+
<h3 id="docs-example-heading"
|
|
244
|
+
class="text-sm sm:text-base font-bold text-[#0a0a0a] dark:text-white mb-3 uppercase">
|
|
245
|
+
<span aria-hidden="true">> </span>Documentation with AI Explanations
|
|
246
|
+
</h3>
|
|
247
|
+
<div class="bg-neutral-100 dark:bg-[#121212] border border-neutral-300 dark:border-neutral-700 p-3 mb-4">
|
|
248
|
+
<pre><code [innerHTML]="documentationExampleCode" class="text-xs sm:text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
249
|
+
</div>
|
|
250
|
+
</article>
|
|
251
|
+
|
|
252
|
+
<!-- Reading Mode -->
|
|
253
|
+
<article class="mb-8" aria-labelledby="reading-example-heading">
|
|
254
|
+
<h3 id="reading-example-heading"
|
|
255
|
+
class="text-sm sm:text-base font-bold text-[#0a0a0a] dark:text-white mb-3 uppercase">
|
|
256
|
+
<span aria-hidden="true">> </span>Reading Mode with Assistance Tools
|
|
257
|
+
</h3>
|
|
258
|
+
<div class="bg-neutral-100 dark:bg-[#121212] border border-neutral-300 dark:border-neutral-700 p-3 mb-4">
|
|
259
|
+
<pre><code [innerHTML]="readingModeExampleCode" class="text-xs sm:text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
260
|
+
</div>
|
|
261
|
+
</article>
|
|
262
|
+
</section>
|
|
263
|
+
|
|
264
|
+
<!-- Advanced Features -->
|
|
265
|
+
<section id="advanced-features" class="mb-12" aria-labelledby="advanced-heading">
|
|
266
|
+
<h2 id="advanced-heading"
|
|
267
|
+
class="text-[10px] sm:text-xs text-neutral-500 dark:text-neutral-500 uppercase tracking-wider mb-4">
|
|
268
|
+
[ Advanced Features ]
|
|
269
|
+
</h2>
|
|
270
|
+
|
|
271
|
+
<!-- Minimum Selection Length -->
|
|
272
|
+
<article class="mb-8" aria-labelledby="min-length-heading">
|
|
273
|
+
<h3 id="min-length-heading"
|
|
274
|
+
class="text-sm sm:text-base font-bold text-[#0a0a0a] dark:text-white mb-3 uppercase">
|
|
275
|
+
<span aria-hidden="true">> </span>Minimum Selection Length
|
|
276
|
+
</h3>
|
|
277
|
+
<p class="text-xs sm:text-sm text-neutral-600 dark:text-neutral-400 mb-3 leading-relaxed">
|
|
278
|
+
The component requires a minimum of 3 characters to be selected before showing the popover. This prevents
|
|
279
|
+
accidental triggers on short selections.
|
|
280
|
+
</p>
|
|
281
|
+
<div class="bg-neutral-100 dark:bg-[#121212] border border-neutral-300 dark:border-neutral-700 p-3">
|
|
282
|
+
<pre><code [innerHTML]="minSelectionLengthCode" class="text-xs sm:text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
283
|
+
</div>
|
|
284
|
+
</article>
|
|
285
|
+
|
|
286
|
+
<!-- Viewport-Aware Positioning -->
|
|
287
|
+
<article class="mb-8" aria-labelledby="positioning-heading">
|
|
288
|
+
<h3 id="positioning-heading"
|
|
289
|
+
class="text-sm sm:text-base font-bold text-[#0a0a0a] dark:text-white mb-3 uppercase">
|
|
290
|
+
<span aria-hidden="true">> </span>Viewport-Aware Positioning
|
|
291
|
+
</h3>
|
|
292
|
+
<p class="text-xs sm:text-sm text-neutral-600 dark:text-neutral-400 mb-3 leading-relaxed">
|
|
293
|
+
The popover automatically adjusts its position to stay within viewport boundaries. It uses <span
|
|
294
|
+
class="bg-neutral-100 dark:bg-neutral-800 px-1 rounded">position: fixed</span> with <span
|
|
295
|
+
class="bg-neutral-100 dark:bg-neutral-800 px-1 rounded">getBoundingClientRect()</span> for accurate
|
|
296
|
+
positioning.
|
|
297
|
+
</p>
|
|
298
|
+
<div class="bg-neutral-100 dark:bg-[#121212] border border-neutral-300 dark:border-neutral-700 p-3">
|
|
299
|
+
<pre><code [innerHTML]="positioningBehaviorCode" class="text-xs sm:text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
300
|
+
</div>
|
|
301
|
+
</article>
|
|
302
|
+
|
|
303
|
+
<!-- Keyboard Accessibility -->
|
|
304
|
+
<article class="mb-8" aria-labelledby="keyboard-heading">
|
|
305
|
+
<h3 id="keyboard-heading"
|
|
306
|
+
class="text-sm sm:text-base font-bold text-[#0a0a0a] dark:text-white mb-3 uppercase">
|
|
307
|
+
<span aria-hidden="true">> </span>Keyboard Accessibility
|
|
308
|
+
</h3>
|
|
309
|
+
<p class="text-xs sm:text-sm text-neutral-600 dark:text-neutral-400 mb-3 leading-relaxed">
|
|
310
|
+
Full keyboard support with ESC to close, click outside to dismiss, and proper ARIA dialog attributes.
|
|
311
|
+
</p>
|
|
312
|
+
<div class="bg-neutral-100 dark:bg-[#121212] border border-neutral-300 dark:border-neutral-700 p-3">
|
|
313
|
+
<pre><code [innerHTML]="keyboardAccessibilityCode" class="text-xs sm:text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
314
|
+
</div>
|
|
315
|
+
</article>
|
|
316
|
+
|
|
317
|
+
<!-- Event Handling -->
|
|
318
|
+
<article class="mb-8" aria-labelledby="events-heading">
|
|
319
|
+
<h3 id="events-heading" class="text-sm sm:text-base font-bold text-[#0a0a0a] dark:text-white mb-3 uppercase">
|
|
320
|
+
<span aria-hidden="true">> </span>Event Handling
|
|
321
|
+
</h3>
|
|
322
|
+
<p class="text-xs sm:text-sm text-neutral-600 dark:text-neutral-400 mb-3 leading-relaxed">
|
|
323
|
+
The <span class="bg-neutral-100 dark:bg-neutral-800 px-1 rounded">textSelected</span> event fires when any
|
|
324
|
+
custom action is clicked. The popover automatically closes and clears selection after the event.
|
|
325
|
+
</p>
|
|
326
|
+
<div class="space-y-3">
|
|
327
|
+
<div class="bg-neutral-100 dark:bg-[#121212] border border-neutral-300 dark:border-neutral-700 p-3">
|
|
328
|
+
<pre><code [innerHTML]="eventHandlingCode" class="text-xs sm:text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
329
|
+
</div>
|
|
330
|
+
<div class="bg-neutral-100 dark:bg-[#121212] border border-neutral-300 dark:border-neutral-700 p-3">
|
|
331
|
+
<pre><code [innerHTML]="eventHandlingTsCode" class="text-xs sm:text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
332
|
+
</div>
|
|
333
|
+
</div>
|
|
334
|
+
</article>
|
|
335
|
+
</section>
|
|
336
|
+
|
|
337
|
+
<!-- API Reference -->
|
|
338
|
+
<section id="api-reference" class="mb-12" aria-labelledby="api-heading">
|
|
339
|
+
<h2 id="api-heading"
|
|
340
|
+
class="text-[10px] sm:text-xs text-neutral-500 dark:text-neutral-500 uppercase tracking-wider mb-4">
|
|
341
|
+
[ API Reference ]
|
|
342
|
+
</h2>
|
|
343
|
+
|
|
344
|
+
<!-- Output Events -->
|
|
345
|
+
<article class="mb-8" aria-labelledby="output-events-heading">
|
|
346
|
+
<h3 id="output-events-heading"
|
|
347
|
+
class="text-sm sm:text-base font-bold text-[#0a0a0a] dark:text-white mb-4 uppercase">
|
|
348
|
+
<span aria-hidden="true">> </span>Output Events
|
|
349
|
+
</h3>
|
|
350
|
+
<div class="bg-white dark:bg-[#0f0f0f] border-2 border-neutral-300 dark:border-neutral-800 overflow-hidden">
|
|
351
|
+
<div class="overflow-x-auto">
|
|
352
|
+
<table class="w-full text-sm">
|
|
353
|
+
<thead class="bg-gray-50 dark:bg-gray-900">
|
|
354
|
+
<tr>
|
|
355
|
+
<th class="text-left p-4 font-medium text-gray-900 dark:text-gray-100">Event</th>
|
|
356
|
+
<th class="text-left p-4 font-medium text-gray-900 dark:text-gray-100">Payload</th>
|
|
357
|
+
<th class="text-left p-4 font-medium text-gray-900 dark:text-gray-100">Description</th>
|
|
358
|
+
</tr>
|
|
359
|
+
</thead>
|
|
360
|
+
<tbody>
|
|
361
|
+
<tr>
|
|
362
|
+
<td class="p-4 font-mono text-blue-600 dark:text-blue-400">textSelected</td>
|
|
363
|
+
<td class="p-4 font-mono text-purple-600 dark:text-purple-400">string</td>
|
|
364
|
+
<td class="p-4 text-gray-700 dark:text-gray-300">
|
|
365
|
+
Emitted when any custom action is clicked (or fallback button if no custom actions). Receives the
|
|
366
|
+
selected text as payload. Popover automatically closes after this event.
|
|
367
|
+
</td>
|
|
368
|
+
</tr>
|
|
369
|
+
</tbody>
|
|
370
|
+
</table>
|
|
371
|
+
</div>
|
|
372
|
+
</div>
|
|
373
|
+
</article>
|
|
374
|
+
|
|
375
|
+
<!-- Content Projection -->
|
|
376
|
+
<article class="mb-8" aria-labelledby="content-projection-heading">
|
|
377
|
+
<h3 id="content-projection-heading"
|
|
378
|
+
class="text-sm sm:text-base font-bold text-[#0a0a0a] dark:text-white mb-4 uppercase">
|
|
379
|
+
<span aria-hidden="true">> </span>Content Projection Slots
|
|
380
|
+
</h3>
|
|
381
|
+
<div class="bg-white dark:bg-[#0f0f0f] border-2 border-neutral-300 dark:border-neutral-800 overflow-hidden">
|
|
382
|
+
<div class="overflow-x-auto">
|
|
383
|
+
<table class="w-full text-sm">
|
|
384
|
+
<thead class="bg-gray-50 dark:bg-gray-900">
|
|
385
|
+
<tr>
|
|
386
|
+
<th class="text-left p-4 font-medium text-gray-900 dark:text-gray-100">Selector</th>
|
|
387
|
+
<th class="text-left p-4 font-medium text-gray-900 dark:text-gray-100">Description</th>
|
|
388
|
+
</tr>
|
|
389
|
+
</thead>
|
|
390
|
+
<tbody class="divide-y divide-gray-200 dark:divide-gray-700">
|
|
391
|
+
<tr>
|
|
392
|
+
<td class="p-4 font-mono text-blue-600 dark:text-blue-400">popoverActions</td>
|
|
393
|
+
<td class="p-4 text-gray-700 dark:text-gray-300">
|
|
394
|
+
Custom action buttons displayed in the popover. If provided, replaces the default fallback button.
|
|
395
|
+
Use this attribute on a wrapper div containing your custom action buttons.
|
|
396
|
+
</td>
|
|
397
|
+
</tr>
|
|
398
|
+
<tr>
|
|
399
|
+
<td class="p-4 font-mono text-blue-600 dark:text-blue-400">(default)</td>
|
|
400
|
+
<td class="p-4 text-gray-700 dark:text-gray-300">
|
|
401
|
+
The selectable content. Any child elements without specific attributes will be treated as selectable
|
|
402
|
+
content.
|
|
403
|
+
</td>
|
|
404
|
+
</tr>
|
|
405
|
+
</tbody>
|
|
406
|
+
</table>
|
|
407
|
+
</div>
|
|
408
|
+
</div>
|
|
409
|
+
</article>
|
|
410
|
+
|
|
411
|
+
<!-- Behavior & Features -->
|
|
412
|
+
<article class="mb-8" aria-labelledby="behavior-heading">
|
|
413
|
+
<h3 id="behavior-heading" class="text-sm sm:text-base font-bold text-[#0a0a0a] dark:text-white mb-4 uppercase">
|
|
414
|
+
<span aria-hidden="true">> </span>Automatic Behavior
|
|
415
|
+
</h3>
|
|
416
|
+
<div class="bg-white dark:bg-[#0f0f0f] border-2 border-neutral-300 dark:border-neutral-800 overflow-hidden">
|
|
417
|
+
<div class="overflow-x-auto">
|
|
418
|
+
<table class="w-full text-sm">
|
|
419
|
+
<thead class="bg-gray-50 dark:bg-gray-900">
|
|
420
|
+
<tr>
|
|
421
|
+
<th class="text-left p-4 font-medium text-gray-900 dark:text-gray-100">Feature</th>
|
|
422
|
+
<th class="text-left p-4 font-medium text-gray-900 dark:text-gray-100">Description</th>
|
|
423
|
+
</tr>
|
|
424
|
+
</thead>
|
|
425
|
+
<tbody class="divide-y divide-gray-200 dark:divide-gray-700">
|
|
426
|
+
<tr>
|
|
427
|
+
<td class="p-4 font-mono text-blue-600 dark:text-blue-400">Minimum Selection</td>
|
|
428
|
+
<td class="p-4 text-gray-700 dark:text-gray-300">
|
|
429
|
+
Requires 3+ characters selected to show popover (prevents accidental triggers)
|
|
430
|
+
</td>
|
|
431
|
+
</tr>
|
|
432
|
+
<tr>
|
|
433
|
+
<td class="p-4 font-mono text-blue-600 dark:text-blue-400">Zero-Flash Rendering</td>
|
|
434
|
+
<td class="p-4 text-gray-700 dark:text-gray-300">
|
|
435
|
+
Two-step positioning algorithm: renders invisible first, calculates real width, then fades in at
|
|
436
|
+
correct position
|
|
437
|
+
</td>
|
|
438
|
+
</tr>
|
|
439
|
+
<tr>
|
|
440
|
+
<td class="p-4 font-mono text-blue-600 dark:text-blue-400">Viewport Adjustment</td>
|
|
441
|
+
<td class="p-4 text-gray-700 dark:text-gray-300">
|
|
442
|
+
Automatically adjusts horizontal position to stay within viewport (10px padding from edges)
|
|
443
|
+
</td>
|
|
444
|
+
</tr>
|
|
445
|
+
<tr>
|
|
446
|
+
<td class="p-4 font-mono text-blue-600 dark:text-blue-400">Positioning Strategy</td>
|
|
447
|
+
<td class="p-4 text-gray-700 dark:text-gray-300">
|
|
448
|
+
Uses position: fixed + getBoundingClientRect() for viewport-relative positioning (stays in place
|
|
449
|
+
during scroll)
|
|
450
|
+
</td>
|
|
451
|
+
</tr>
|
|
452
|
+
<tr>
|
|
453
|
+
<td class="p-4 font-mono text-blue-600 dark:text-blue-400">Auto-Close</td>
|
|
454
|
+
<td class="p-4 text-gray-700 dark:text-gray-300">
|
|
455
|
+
Closes on ESC key, click outside, or after action execution. Automatically clears browser text
|
|
456
|
+
selection.
|
|
457
|
+
</td>
|
|
458
|
+
</tr>
|
|
459
|
+
<tr>
|
|
460
|
+
<td class="p-4 font-mono text-blue-600 dark:text-blue-400">ARIA Support</td>
|
|
461
|
+
<td class="p-4 text-gray-700 dark:text-gray-300">
|
|
462
|
+
Full accessibility with role="dialog" and aria-label="Selection actions"
|
|
463
|
+
</td>
|
|
464
|
+
</tr>
|
|
465
|
+
</tbody>
|
|
466
|
+
</table>
|
|
467
|
+
</div>
|
|
468
|
+
</div>
|
|
469
|
+
</article>
|
|
470
|
+
</section>
|
|
471
|
+
|
|
472
|
+
<!-- Complete Example -->
|
|
473
|
+
<section id="complete-example" class="mb-12" aria-labelledby="complete-heading">
|
|
474
|
+
<h2 id="complete-heading"
|
|
475
|
+
class="text-[10px] sm:text-xs text-neutral-500 dark:text-neutral-500 uppercase tracking-wider mb-4">
|
|
476
|
+
[ Complete Example ]
|
|
477
|
+
</h2>
|
|
478
|
+
<p class="text-xs sm:text-sm text-neutral-600 dark:text-neutral-400 mb-4 leading-relaxed">
|
|
479
|
+
Full implementation with all features: custom actions, event handling, and content styling.
|
|
480
|
+
</p>
|
|
481
|
+
<div class="space-y-3">
|
|
482
|
+
<div class="bg-neutral-100 dark:bg-[#121212] border border-neutral-300 dark:border-neutral-700 p-3">
|
|
483
|
+
<pre><code [innerHTML]="fullExampleCode" class="text-xs sm:text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
484
|
+
</div>
|
|
485
|
+
<div class="bg-neutral-100 dark:bg-[#121212] border border-neutral-300 dark:border-neutral-700 p-3">
|
|
486
|
+
<pre><code [innerHTML]="fullExampleTsCode" class="text-xs sm:text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
487
|
+
</div>
|
|
488
|
+
</div>
|
|
489
|
+
</section>
|
|
490
|
+
|
|
491
|
+
<!-- Custom Styling -->
|
|
492
|
+
<section id="custom-styling" class="mb-12" aria-labelledby="styling-heading">
|
|
493
|
+
<h2 id="styling-heading"
|
|
494
|
+
class="text-[10px] sm:text-xs text-neutral-500 dark:text-neutral-500 uppercase tracking-wider mb-4">
|
|
495
|
+
[ Custom Styling ]
|
|
496
|
+
</h2>
|
|
497
|
+
<p class="text-xs sm:text-sm text-neutral-600 dark:text-neutral-400 mb-4 leading-relaxed">
|
|
498
|
+
Customize popover action buttons using Tailwind CSS classes for complete design control.
|
|
499
|
+
</p>
|
|
500
|
+
<div class="bg-neutral-100 dark:bg-[#121212] border border-neutral-300 dark:border-neutral-700 p-3">
|
|
501
|
+
<pre><code [innerHTML]="customStylingCode" class="text-xs sm:text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
502
|
+
</div>
|
|
503
|
+
</section>
|
|
504
|
+
|
|
505
|
+
</div>
|
|
506
|
+
</main>
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { Component, signal, WritableSignal } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
import { AiPromptService } from '../../../../core/services/ai-prompt.service';
|
|
4
|
+
import { getFormattedCode } from '../../../../core/utils/prism';
|
|
5
|
+
|
|
6
|
+
import { SelectionPopoverCodeExamples } from './selection-popover-docs.examples';
|
|
7
|
+
|
|
8
|
+
import { Breadcrumb, BreadcrumbItem } from '../../../../components/breadcrumb/breadcrumb';
|
|
9
|
+
import { Button } from '../../../../components/button/button';
|
|
10
|
+
import { SelectionPopover } from '../../../../components/selection-popover/selection-popover';
|
|
11
|
+
|
|
12
|
+
@Component({
|
|
13
|
+
selector: 'app-selection-popover-docs',
|
|
14
|
+
imports: [
|
|
15
|
+
Button,
|
|
16
|
+
Breadcrumb,
|
|
17
|
+
SelectionPopover
|
|
18
|
+
],
|
|
19
|
+
templateUrl: './selection-popover-docs.html',
|
|
20
|
+
styleUrl: './selection-popover-docs.css'
|
|
21
|
+
})
|
|
22
|
+
export class SelectionPopoverDocs {
|
|
23
|
+
breadcrumbItems: BreadcrumbItem[] = [
|
|
24
|
+
{ label: 'Home', url: '/' },
|
|
25
|
+
{ label: 'Documentation', url: '/documentation' },
|
|
26
|
+
{ label: 'Components', url: '/documentation/components' },
|
|
27
|
+
{ label: 'Selection Popover' }
|
|
28
|
+
];
|
|
29
|
+
|
|
30
|
+
// Installation & Import
|
|
31
|
+
installationCode = getFormattedCode(SelectionPopoverCodeExamples.installation, 'bash');
|
|
32
|
+
importCode = getFormattedCode(SelectionPopoverCodeExamples.import, 'typescript');
|
|
33
|
+
componentImportCode = getFormattedCode(SelectionPopoverCodeExamples.componentImport, 'typescript');
|
|
34
|
+
basicUsageCode = getFormattedCode(SelectionPopoverCodeExamples.basicUsage, 'html');
|
|
35
|
+
|
|
36
|
+
// Custom Actions
|
|
37
|
+
customActionsCode = getFormattedCode(SelectionPopoverCodeExamples.customActions, 'html');
|
|
38
|
+
customActionsTsCode = getFormattedCode(SelectionPopoverCodeExamples.customActionsTs, 'typescript');
|
|
39
|
+
withWallyButtonCode = getFormattedCode(SelectionPopoverCodeExamples.withWallyButton, 'html');
|
|
40
|
+
withWallyButtonTsCode = getFormattedCode(SelectionPopoverCodeExamples.withWallyButtonTs, 'typescript');
|
|
41
|
+
|
|
42
|
+
// Production Examples
|
|
43
|
+
blogExampleCode = getFormattedCode(SelectionPopoverCodeExamples.blogExample, 'html');
|
|
44
|
+
blogExampleTsCode = getFormattedCode(SelectionPopoverCodeExamples.blogExampleTs, 'typescript');
|
|
45
|
+
documentationExampleCode = getFormattedCode(SelectionPopoverCodeExamples.documentationExample, 'html');
|
|
46
|
+
readingModeExampleCode = getFormattedCode(SelectionPopoverCodeExamples.readingModeExample, 'html');
|
|
47
|
+
|
|
48
|
+
// Advanced
|
|
49
|
+
minSelectionLengthCode = getFormattedCode(SelectionPopoverCodeExamples.minSelectionLength, 'html');
|
|
50
|
+
positioningBehaviorCode = getFormattedCode(SelectionPopoverCodeExamples.positioningBehavior, 'html');
|
|
51
|
+
keyboardAccessibilityCode = getFormattedCode(SelectionPopoverCodeExamples.keyboardAccessibility, 'html');
|
|
52
|
+
eventHandlingCode = getFormattedCode(SelectionPopoverCodeExamples.eventHandling, 'html');
|
|
53
|
+
eventHandlingTsCode = getFormattedCode(SelectionPopoverCodeExamples.eventHandlingTs, 'typescript');
|
|
54
|
+
|
|
55
|
+
// Full Example
|
|
56
|
+
fullExampleCode = getFormattedCode(SelectionPopoverCodeExamples.fullExample, 'html');
|
|
57
|
+
fullExampleTsCode = getFormattedCode(SelectionPopoverCodeExamples.fullExampleTs, 'typescript');
|
|
58
|
+
|
|
59
|
+
// Styling
|
|
60
|
+
customStylingCode = getFormattedCode(SelectionPopoverCodeExamples.customStyling, 'html');
|
|
61
|
+
|
|
62
|
+
// Interactive examples
|
|
63
|
+
selectedText: WritableSignal<string> = signal<string>('');
|
|
64
|
+
actionMessage: WritableSignal<string> = signal<string>('');
|
|
65
|
+
|
|
66
|
+
constructor(
|
|
67
|
+
private aiPromptService: AiPromptService
|
|
68
|
+
) { }
|
|
69
|
+
|
|
70
|
+
onTextSelected(text: string): void {
|
|
71
|
+
this.selectedText.set(text);
|
|
72
|
+
this.actionMessage.set(`Selected: "${text}"`);
|
|
73
|
+
|
|
74
|
+
// Clear message after 3 seconds
|
|
75
|
+
setTimeout(() => {
|
|
76
|
+
this.actionMessage.set('');
|
|
77
|
+
}, 3000);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
askAI(text: string): void {
|
|
81
|
+
this.selectedText.set(text);
|
|
82
|
+
this.actionMessage.set(`Asking AI about: "${text}"`);
|
|
83
|
+
|
|
84
|
+
setTimeout(() => {
|
|
85
|
+
this.actionMessage.set('');
|
|
86
|
+
}, 3000);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
get claudeUrl(): string {
|
|
90
|
+
return this.aiPromptService.generateClaudeUrl();
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
get chatGptUrl(): string {
|
|
94
|
+
return this.aiPromptService.generateChatGptUrl();
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<main class="min-h-dvh subpixel-antialiased font-mono bg-white dark:bg-[#0a0a0a]" role="main">
|
|
2
2
|
<div class="w-full min-h-dvh flex flex-col items-center justify-center px-4 py-12 sm:px-6 md:px-8 lg:px-12">
|
|
3
|
-
<div class="w-full max-w-4xl">
|
|
3
|
+
<!-- <div class="w-full max-w-4xl">
|
|
4
4
|
<wally-ai-chat></wally-ai-chat>
|
|
5
|
-
</div>
|
|
5
|
+
</div> -->
|
|
6
6
|
|
|
7
7
|
<article class="w-full max-w-3xl">
|
|
8
8
|
<header class="w-full mb-10 sm:mb-12 space-y-6">
|