@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.
Files changed (92) hide show
  1. package/dist/components/OnboardingChecklist.svelte +1 -0
  2. package/dist/components/WispPanel.svelte +67 -13
  3. package/dist/components/admin/FloatingToolbar.svelte +2 -1
  4. package/dist/components/admin/MarkdownEditor.svelte +239 -616
  5. package/dist/components/admin/composables/index.d.ts +0 -3
  6. package/dist/components/admin/composables/index.js +2 -3
  7. package/dist/components/admin/composables/useDraftManager.svelte.d.ts +2 -0
  8. package/dist/components/admin/composables/useDraftManager.svelte.js +24 -2
  9. package/dist/components/admin/composables/useEditorTheme.svelte.d.ts +3 -290
  10. package/dist/components/admin/composables/useEditorTheme.svelte.js +17 -134
  11. package/dist/components/custom/ContentWithGutter.svelte +20 -17
  12. package/dist/components/custom/GutterItem.svelte +11 -3
  13. package/dist/components/custom/MobileTOC.svelte +4 -1
  14. package/dist/components/custom/TableOfContents.svelte +1 -0
  15. package/dist/config/wisp.d.ts +42 -73
  16. package/dist/config/wisp.js +83 -71
  17. package/dist/server/index.d.ts +16 -1
  18. package/dist/server/index.js +18 -4
  19. package/dist/server/inference-client.d.ts +17 -1
  20. package/dist/server/inference-client.js +178 -155
  21. package/dist/server/logger.d.ts +6 -0
  22. package/dist/server/logger.js +6 -0
  23. package/dist/server/rate-limits/config.d.ts +135 -0
  24. package/dist/server/rate-limits/config.js +73 -0
  25. package/dist/server/rate-limits/index.d.ts +13 -0
  26. package/dist/server/rate-limits/index.js +13 -0
  27. package/dist/server/rate-limits/middleware.d.ts +79 -0
  28. package/dist/server/rate-limits/middleware.js +116 -0
  29. package/dist/server/services/cache.d.ts +1 -1
  30. package/dist/server/services/cache.js +1 -1
  31. package/dist/server/services/database.d.ts +1 -1
  32. package/dist/server/services/storage.d.ts +11 -1
  33. package/dist/server/services/storage.js +16 -2
  34. package/dist/server/services/turnstile.d.ts +5 -3
  35. package/dist/server/services/turnstile.js +27 -20
  36. package/dist/server/services/users.d.ts +1 -1
  37. package/dist/server/services/users.js +1 -1
  38. package/dist/ui/components/charts/ActivityOverview.svelte +1 -0
  39. package/dist/ui/components/charts/RepoBreakdown.svelte +3 -3
  40. package/dist/ui/components/chrome/Footer.svelte +21 -10
  41. package/dist/ui/components/chrome/MobileMenu.svelte +101 -9
  42. package/dist/ui/components/chrome/MobileMenu.svelte.d.ts +3 -1
  43. package/dist/ui/components/chrome/defaults.d.ts +16 -0
  44. package/dist/ui/components/chrome/defaults.js +62 -15
  45. package/dist/ui/components/chrome/types.d.ts +12 -3
  46. package/dist/ui/components/content/RoadmapPreview.svelte +3 -3
  47. package/dist/ui/components/forms/SearchInput.svelte +1 -0
  48. package/dist/ui/components/gallery/ImageGallery.svelte +0 -4
  49. package/dist/ui/components/gallery/Lightbox.svelte +1 -4
  50. package/dist/ui/components/gallery/Lightbox.svelte.d.ts +2 -2
  51. package/dist/ui/components/gallery/ZoomableImage.svelte +32 -20
  52. package/dist/ui/components/icons/IconLegend.svelte +2 -0
  53. package/dist/ui/components/icons/IconLegend.svelte.d.ts +2 -2
  54. package/dist/ui/components/icons/lucide.d.ts +3 -3
  55. package/dist/ui/components/icons/lucide.js +3 -3
  56. package/dist/ui/components/nature/GroveDivider.svelte +137 -0
  57. package/dist/ui/components/nature/GroveDivider.svelte.d.ts +34 -0
  58. package/dist/ui/components/nature/index.d.ts +1 -0
  59. package/dist/ui/components/nature/index.js +2 -0
  60. package/dist/ui/components/ui/Accordion.svelte +2 -0
  61. package/dist/ui/components/ui/Button.svelte +2 -0
  62. package/dist/ui/components/ui/CollapsibleSection.svelte +2 -0
  63. package/dist/ui/components/ui/CollapsibleSection.svelte.d.ts +2 -0
  64. package/dist/ui/components/ui/GlassButton.svelte +2 -0
  65. package/dist/ui/components/ui/GlassCard.svelte +11 -9
  66. package/dist/ui/components/ui/GlassLogo.svelte +1 -7
  67. package/dist/ui/components/ui/GlassLogo.svelte.d.ts +1 -1
  68. package/dist/ui/components/ui/GlassNavbar.svelte +2 -2
  69. package/dist/ui/components/ui/Input.svelte +2 -0
  70. package/dist/ui/components/ui/Select.svelte +2 -0
  71. package/dist/ui/components/ui/index.d.ts +1 -0
  72. package/dist/ui/components/ui/index.js +2 -0
  73. package/dist/ui/components/ui/types.d.ts +5 -0
  74. package/dist/ui/components/ui/types.js +4 -0
  75. package/dist/ui/index.d.ts +12 -11
  76. package/dist/ui/index.js +13 -11
  77. package/dist/ui/stores/theme.d.ts +1 -1
  78. package/dist/ui/vineyard/index.js +1 -0
  79. package/dist/utils/csrf.js +7 -4
  80. package/dist/utils/markdown.d.ts +1 -0
  81. package/dist/utils/markdown.js +9 -3
  82. package/dist/utils/sanitize.d.ts +1 -2
  83. package/dist/utils/sanitize.js +59 -8
  84. package/dist/utils.d.ts +2 -2
  85. package/package.json +2 -1
  86. package/dist/components/admin/composables/useAmbientSounds.svelte.d.ts +0 -103
  87. package/dist/components/admin/composables/useAmbientSounds.svelte.js +0 -226
  88. package/dist/components/admin/composables/useSnippets.svelte.d.ts +0 -54
  89. package/dist/components/admin/composables/useSnippets.svelte.js +0 -154
  90. package/dist/components/admin/composables/useWritingSession.svelte.d.ts +0 -71
  91. package/dist/components/admin/composables/useWritingSession.svelte.js +0 -137
  92. package/dist/server/services/__mocks__/cloudflare.d.ts +0 -54
@@ -32,6 +32,7 @@
32
32
  <button
33
33
  onclick={onDismiss}
34
34
  class="text-foreground-subtle hover:text-foreground transition-colors"
35
+ aria-label="Dismiss getting started checklist"
35
36
  title="Dismiss checklist"
36
37
  >
37
38
  <X size={16} />
@@ -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
- <div class="stat">
504
- <span class="stat-label">avg sentence</span>
505
- <span class="stat-value">{results.readability.sentenceStats.average} words</span>
506
- </div>
507
- <div class="stat">
508
- <span class="stat-label">longest</span>
509
- <span class="stat-value">{results.readability.sentenceStats.longest} words</span>
510
- </div>
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
  }