@autumnsgrove/groveengine 0.9.0 → 0.9.1
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/components/OnboardingChecklist.svelte +1 -0
- package/dist/components/WispPanel.svelte +67 -13
- package/dist/components/admin/FloatingToolbar.svelte +2 -1
- package/dist/components/admin/MarkdownEditor.svelte +239 -616
- package/dist/components/admin/composables/index.d.ts +0 -3
- package/dist/components/admin/composables/index.js +2 -3
- package/dist/components/admin/composables/useDraftManager.svelte.d.ts +2 -0
- package/dist/components/admin/composables/useDraftManager.svelte.js +24 -2
- package/dist/components/admin/composables/useEditorTheme.svelte.d.ts +3 -290
- package/dist/components/admin/composables/useEditorTheme.svelte.js +17 -134
- package/dist/components/custom/ContentWithGutter.svelte +20 -17
- package/dist/components/custom/GutterItem.svelte +11 -3
- package/dist/components/custom/MobileTOC.svelte +4 -1
- package/dist/components/custom/TableOfContents.svelte +1 -0
- package/dist/config/wisp.d.ts +42 -73
- package/dist/config/wisp.js +83 -71
- package/dist/server/index.d.ts +16 -1
- package/dist/server/index.js +18 -4
- package/dist/server/inference-client.d.ts +17 -1
- package/dist/server/inference-client.js +178 -155
- package/dist/server/logger.d.ts +6 -0
- package/dist/server/logger.js +6 -0
- package/dist/server/rate-limits/config.d.ts +135 -0
- package/dist/server/rate-limits/config.js +73 -0
- package/dist/server/rate-limits/index.d.ts +13 -0
- package/dist/server/rate-limits/index.js +13 -0
- package/dist/server/rate-limits/middleware.d.ts +79 -0
- package/dist/server/rate-limits/middleware.js +116 -0
- package/dist/server/services/cache.d.ts +1 -1
- package/dist/server/services/cache.js +1 -1
- package/dist/server/services/database.d.ts +1 -1
- package/dist/server/services/storage.d.ts +11 -1
- package/dist/server/services/storage.js +16 -2
- package/dist/server/services/turnstile.d.ts +5 -3
- package/dist/server/services/turnstile.js +27 -20
- package/dist/server/services/users.d.ts +1 -1
- package/dist/server/services/users.js +1 -1
- package/dist/ui/components/charts/ActivityOverview.svelte +1 -0
- package/dist/ui/components/charts/RepoBreakdown.svelte +3 -3
- package/dist/ui/components/chrome/Footer.svelte +21 -10
- package/dist/ui/components/chrome/MobileMenu.svelte +101 -9
- package/dist/ui/components/chrome/MobileMenu.svelte.d.ts +3 -1
- package/dist/ui/components/chrome/defaults.d.ts +16 -0
- package/dist/ui/components/chrome/defaults.js +62 -15
- package/dist/ui/components/chrome/types.d.ts +12 -3
- package/dist/ui/components/content/RoadmapPreview.svelte +3 -3
- package/dist/ui/components/forms/SearchInput.svelte +1 -0
- package/dist/ui/components/gallery/ImageGallery.svelte +0 -4
- package/dist/ui/components/gallery/Lightbox.svelte +1 -4
- package/dist/ui/components/gallery/Lightbox.svelte.d.ts +2 -2
- package/dist/ui/components/gallery/ZoomableImage.svelte +32 -20
- package/dist/ui/components/icons/IconLegend.svelte +2 -0
- package/dist/ui/components/icons/IconLegend.svelte.d.ts +2 -2
- package/dist/ui/components/icons/lucide.d.ts +3 -3
- package/dist/ui/components/icons/lucide.js +3 -3
- package/dist/ui/components/nature/GroveDivider.svelte +137 -0
- package/dist/ui/components/nature/GroveDivider.svelte.d.ts +34 -0
- package/dist/ui/components/nature/index.d.ts +1 -0
- package/dist/ui/components/nature/index.js +2 -0
- package/dist/ui/components/ui/Accordion.svelte +2 -0
- package/dist/ui/components/ui/Button.svelte +2 -0
- package/dist/ui/components/ui/CollapsibleSection.svelte +2 -0
- package/dist/ui/components/ui/CollapsibleSection.svelte.d.ts +2 -0
- package/dist/ui/components/ui/GlassButton.svelte +2 -0
- package/dist/ui/components/ui/GlassCard.svelte +11 -9
- package/dist/ui/components/ui/GlassLogo.svelte +1 -7
- package/dist/ui/components/ui/GlassLogo.svelte.d.ts +1 -1
- package/dist/ui/components/ui/GlassNavbar.svelte +2 -2
- package/dist/ui/components/ui/Input.svelte +2 -0
- package/dist/ui/components/ui/Select.svelte +2 -0
- package/dist/ui/components/ui/index.d.ts +1 -0
- package/dist/ui/components/ui/index.js +2 -0
- package/dist/ui/components/ui/types.d.ts +5 -0
- package/dist/ui/components/ui/types.js +4 -0
- package/dist/ui/index.d.ts +12 -11
- package/dist/ui/index.js +13 -11
- package/dist/ui/stores/theme.d.ts +1 -1
- package/dist/ui/vineyard/index.js +1 -0
- package/dist/utils/csrf.js +7 -4
- package/dist/utils/markdown.d.ts +1 -0
- package/dist/utils/markdown.js +9 -3
- package/dist/utils/sanitize.d.ts +1 -2
- package/dist/utils/sanitize.js +59 -8
- package/dist/utils.d.ts +2 -2
- package/package.json +2 -1
- package/dist/components/admin/composables/useAmbientSounds.svelte.d.ts +0 -103
- package/dist/components/admin/composables/useAmbientSounds.svelte.js +0 -226
- package/dist/components/admin/composables/useSnippets.svelte.d.ts +0 -54
- package/dist/components/admin/composables/useSnippets.svelte.js +0 -154
- package/dist/components/admin/composables/useWritingSession.svelte.d.ts +0 -71
- package/dist/components/admin/composables/useWritingSession.svelte.js +0 -137
- package/dist/server/services/__mocks__/cloudflare.d.ts +0 -54
|
@@ -12,6 +12,51 @@
|
|
|
12
12
|
* @property {(original: string, suggestion: string) => void} onApplyFix - Callback when user applies a fix
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
+
/**
|
|
16
|
+
* @typedef {Object} GrammarSuggestion
|
|
17
|
+
* @property {string} original
|
|
18
|
+
* @property {string} suggestion
|
|
19
|
+
* @property {string} [reason]
|
|
20
|
+
* @property {string} [severity]
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @typedef {Object} ToneTrait
|
|
25
|
+
* @property {string} trait
|
|
26
|
+
* @property {number} score
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @typedef {Object} WispTone
|
|
31
|
+
* @property {string} [analysis]
|
|
32
|
+
* @property {ToneTrait[]} [traits]
|
|
33
|
+
* @property {string[]} [suggestions]
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* @typedef {Object} WispReadability
|
|
38
|
+
* @property {number} [fleschKincaid]
|
|
39
|
+
* @property {string} [readingTime]
|
|
40
|
+
* @property {number} [wordCount]
|
|
41
|
+
* @property {number} [sentenceCount]
|
|
42
|
+
* @property {{ average: number, longest: number }} [sentenceStats]
|
|
43
|
+
* @property {string[]} [suggestions]
|
|
44
|
+
*/
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @typedef {Object} WispMeta
|
|
48
|
+
* @property {number} [tokensUsed]
|
|
49
|
+
* @property {number} [cost]
|
|
50
|
+
*/
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* @typedef {Object} WispResults
|
|
54
|
+
* @property {{ overallScore?: number, suggestions?: GrammarSuggestion[] }} [grammar]
|
|
55
|
+
* @property {WispTone} [tone]
|
|
56
|
+
* @property {WispReadability} [readability]
|
|
57
|
+
* @property {WispMeta} [meta]
|
|
58
|
+
*/
|
|
59
|
+
|
|
15
60
|
/** @type {Props} */
|
|
16
61
|
let {
|
|
17
62
|
content = "",
|
|
@@ -27,7 +72,9 @@
|
|
|
27
72
|
|
|
28
73
|
// Analysis state
|
|
29
74
|
let isAnalyzing = $state(false);
|
|
75
|
+
/** @type {string | null} */
|
|
30
76
|
let analysisError = $state(null);
|
|
77
|
+
/** @type {WispResults | null} */
|
|
31
78
|
let results = $state(null);
|
|
32
79
|
let activeTab = $state("grammar");
|
|
33
80
|
let selectedMode = $state("quick"); // quick or thorough
|
|
@@ -87,7 +134,7 @@
|
|
|
87
134
|
let currentVibe = $derived(() => {
|
|
88
135
|
if (isAnalyzing) return vibes.analyzing;
|
|
89
136
|
if (analysisError) return vibes.error;
|
|
90
|
-
if (results?.grammar?.overallScore >= 90) return vibes.grammarGood;
|
|
137
|
+
if ((results?.grammar?.overallScore ?? 0) >= 90) return vibes.grammarGood;
|
|
91
138
|
if (results?.tone) return vibes.toneWarm;
|
|
92
139
|
if (results) return vibes.success;
|
|
93
140
|
return vibes.idle;
|
|
@@ -138,6 +185,7 @@
|
|
|
138
185
|
];
|
|
139
186
|
|
|
140
187
|
let vibeIndex = $state(0);
|
|
188
|
+
/** @type {HTMLElement | null} */
|
|
141
189
|
let panelRef = $state(null);
|
|
142
190
|
|
|
143
191
|
// Content length status
|
|
@@ -161,6 +209,7 @@
|
|
|
161
209
|
});
|
|
162
210
|
|
|
163
211
|
// Handle keyboard navigation
|
|
212
|
+
/** @param {KeyboardEvent} e */
|
|
164
213
|
function handleKeydown(e) {
|
|
165
214
|
if (e.key === "Escape" && isOpen) {
|
|
166
215
|
e.preventDefault();
|
|
@@ -220,6 +269,7 @@
|
|
|
220
269
|
}
|
|
221
270
|
|
|
222
271
|
// Apply a grammar fix
|
|
272
|
+
/** @param {GrammarSuggestion} suggestion */
|
|
223
273
|
function applyFix(suggestion) {
|
|
224
274
|
onApplyFix(suggestion.original, suggestion.suggestion);
|
|
225
275
|
// Remove from list
|
|
@@ -253,6 +303,7 @@
|
|
|
253
303
|
}
|
|
254
304
|
|
|
255
305
|
// Severity colors
|
|
306
|
+
/** @param {string} [severity] */
|
|
256
307
|
function getSeverityClass(severity) {
|
|
257
308
|
switch (severity) {
|
|
258
309
|
case "error": return "severity-error";
|
|
@@ -262,6 +313,7 @@
|
|
|
262
313
|
}
|
|
263
314
|
|
|
264
315
|
// Format score as visual bar
|
|
316
|
+
/** @param {number | null | undefined} score */
|
|
265
317
|
function formatScore(score) {
|
|
266
318
|
if (score === null || score === undefined) return "░░░░░░░░░░";
|
|
267
319
|
const filled = Math.round(score / 10);
|
|
@@ -427,7 +479,7 @@
|
|
|
427
479
|
<span class="score-num">{results.grammar.overallScore ?? "—"}</span>
|
|
428
480
|
</div>
|
|
429
481
|
|
|
430
|
-
{#if results.grammar.suggestions?.length > 0}
|
|
482
|
+
{#if (results.grammar.suggestions?.length ?? 0) > 0}
|
|
431
483
|
<div class="suggestions">
|
|
432
484
|
{#each results.grammar.suggestions as suggestion}
|
|
433
485
|
<div class="suggestion {getSeverityClass(suggestion.severity)}">
|
|
@@ -456,7 +508,7 @@
|
|
|
456
508
|
<div class="tab-content">
|
|
457
509
|
<p class="tone-analysis">{results.tone.analysis}</p>
|
|
458
510
|
|
|
459
|
-
{#if results.tone.traits?.length > 0}
|
|
511
|
+
{#if (results.tone.traits?.length ?? 0) > 0}
|
|
460
512
|
<div class="traits">
|
|
461
513
|
{#each results.tone.traits as trait}
|
|
462
514
|
<div class="trait">
|
|
@@ -470,7 +522,7 @@
|
|
|
470
522
|
</div>
|
|
471
523
|
{/if}
|
|
472
524
|
|
|
473
|
-
{#if results.tone.suggestions?.length > 0}
|
|
525
|
+
{#if (results.tone.suggestions?.length ?? 0) > 0}
|
|
474
526
|
<div class="tone-suggestions">
|
|
475
527
|
{#each results.tone.suggestions as sug}
|
|
476
528
|
<p class="tone-sug">• {sug}</p>
|
|
@@ -500,17 +552,19 @@
|
|
|
500
552
|
<span class="stat-label">sentences</span>
|
|
501
553
|
<span class="stat-value">{results.readability.sentenceCount}</span>
|
|
502
554
|
</div>
|
|
503
|
-
|
|
504
|
-
<
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
<
|
|
509
|
-
|
|
510
|
-
|
|
555
|
+
{#if results.readability.sentenceStats}
|
|
556
|
+
<div class="stat">
|
|
557
|
+
<span class="stat-label">avg sentence</span>
|
|
558
|
+
<span class="stat-value">{results.readability.sentenceStats.average} words</span>
|
|
559
|
+
</div>
|
|
560
|
+
<div class="stat">
|
|
561
|
+
<span class="stat-label">longest</span>
|
|
562
|
+
<span class="stat-value">{results.readability.sentenceStats.longest} words</span>
|
|
563
|
+
</div>
|
|
564
|
+
{/if}
|
|
511
565
|
</div>
|
|
512
566
|
|
|
513
|
-
{#if results.readability.suggestions?.length > 0}
|
|
567
|
+
{#if (results.readability.suggestions?.length ?? 0) > 0}
|
|
514
568
|
<div class="readability-suggestions">
|
|
515
569
|
{#each results.readability.suggestions as sug}
|
|
516
570
|
<p class="read-sug">• {sug}</p>
|
|
@@ -170,8 +170,9 @@
|
|
|
170
170
|
insertLinePrefix("### ");
|
|
171
171
|
}
|
|
172
172
|
|
|
173
|
+
/** @param {MouseEvent} e */
|
|
173
174
|
function handleClickOutside(e) {
|
|
174
|
-
if (toolbarRef && !toolbarRef.contains(e.target) && e.target !== textareaRef) {
|
|
175
|
+
if (toolbarRef && !toolbarRef.contains(/** @type {Node} */ (e.target)) && e.target !== textareaRef) {
|
|
175
176
|
isVisible = false;
|
|
176
177
|
}
|
|
177
178
|
}
|