@imjp/writenex-astro 0.1.0 → 1.3.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.
Files changed (99) hide show
  1. package/README.md +13 -13
  2. package/dist/{chunk-CYLDJ3HZ.js → chunk-GIS7XEJF.js} +4 -4
  3. package/dist/{chunk-CYLDJ3HZ.js.map → chunk-GIS7XEJF.js.map} +1 -1
  4. package/dist/{chunk-7XU5X6CW.js → chunk-GUUSVFBP.js} +12 -12
  5. package/dist/chunk-GUUSVFBP.js.map +1 -0
  6. package/dist/{chunk-XNTQTTJU.js → chunk-JFQQJPDF.js} +2 -2
  7. package/dist/{chunk-XNTQTTJU.js.map → chunk-JFQQJPDF.js.map} +1 -1
  8. package/dist/{chunk-CF2XXJFF.js → chunk-OWYFIQFK.js} +436 -436
  9. package/dist/chunk-OWYFIQFK.js.map +1 -0
  10. package/dist/{chunk-5PM6EQE5.js → chunk-S2OUQLMK.js} +7 -5
  11. package/dist/chunk-S2OUQLMK.js.map +1 -0
  12. package/dist/{chunk-AAOQHQPU.js → chunk-TQAYIZOA.js} +5 -5
  13. package/dist/{chunk-AAOQHQPU.js.map → chunk-TQAYIZOA.js.map} +1 -1
  14. package/dist/{chunk-CRPZUUDU.js → chunk-YBCPOLMY.js} +1 -1
  15. package/dist/{chunk-CRPZUUDU.js.map → chunk-YBCPOLMY.js.map} +1 -1
  16. package/dist/client/index.css +1 -1
  17. package/dist/client/index.css.map +1 -1
  18. package/dist/client/index.d.ts +19 -0
  19. package/dist/client/index.js +159 -147
  20. package/dist/client/index.js.map +1 -1
  21. package/dist/client/styles.css +2 -8
  22. package/dist/config/index.d.ts +2 -2
  23. package/dist/config/index.js +2 -2
  24. package/dist/{config-BmEdBDo_.d.ts → config-CliL0CoN.d.ts} +1 -1
  25. package/dist/{content-BWR52vD-.d.ts → content-TuL3GT66.d.ts} +1 -1
  26. package/dist/discovery/index.d.ts +2 -2
  27. package/dist/discovery/index.js +3 -3
  28. package/dist/filesystem/index.d.ts +703 -703
  29. package/dist/filesystem/index.js +4 -4
  30. package/dist/filesystem/index.js.map +1 -1
  31. package/dist/index.d.ts +4 -4
  32. package/dist/index.js +7 -7
  33. package/dist/index.js.map +1 -1
  34. package/dist/{loader-55LWCXHA.js → loader-VGNXC2XJ.js} +3 -3
  35. package/dist/schema-DDJyoVkj.d.ts +189 -0
  36. package/dist/server/index.d.ts +37 -37
  37. package/dist/server/index.js +5 -5
  38. package/package.json +17 -18
  39. package/src/client/App.tsx +18 -18
  40. package/src/client/components/ConfigPanel/ConfigPanel.tsx +14 -13
  41. package/src/client/components/CreateContentModal/CreateContentModal.tsx +1 -1
  42. package/src/client/components/Editor/Editor.tsx +27 -27
  43. package/src/client/components/Editor/ImageDialog.tsx +4 -3
  44. package/src/client/components/Editor/LinkDialog.tsx +7 -6
  45. package/src/client/components/Editor/index.ts +1 -1
  46. package/src/client/components/FrontmatterForm/FrontmatterForm.css +1 -1
  47. package/src/client/components/FrontmatterForm/FrontmatterForm.tsx +1 -1
  48. package/src/client/components/Header/Header.tsx +8 -8
  49. package/src/client/components/KeyboardShortcuts/KeyboardShortcuts.tsx +1 -1
  50. package/src/client/components/LazyEditor.tsx +1 -1
  51. package/src/client/components/LiveRegion/index.ts +1 -1
  52. package/src/client/components/SearchReplace/SearchReplacePanel.tsx +5 -5
  53. package/src/client/components/SearchReplace/index.ts +1 -1
  54. package/src/client/components/SelectCollectionModal/SelectCollectionModal.tsx +2 -2
  55. package/src/client/components/Sidebar/Sidebar.tsx +6 -6
  56. package/src/client/components/SkipLink/index.ts +1 -1
  57. package/src/client/components/UnsavedChangesModal/UnsavedChangesModal.tsx +1 -1
  58. package/src/client/components/VersionHistory/DiffViewer.tsx +18 -11
  59. package/src/client/components/VersionHistory/VersionActions.tsx +6 -6
  60. package/src/client/components/VersionHistory/VersionHistoryPanel.tsx +10 -10
  61. package/src/client/components/VersionHistory/index.ts +2 -2
  62. package/src/client/context/ApiContext.tsx +2 -2
  63. package/src/client/context/ThemeContext.tsx +2 -2
  64. package/src/client/hooks/useApi.ts +1 -1
  65. package/src/client/hooks/useFocusTrap.ts +1 -1
  66. package/src/client/hooks/useSearch.ts +1 -1
  67. package/src/client/hooks/useVersionHistory.ts +2 -2
  68. package/src/client/index.tsx +1 -1
  69. package/src/client/styles.css +2 -8
  70. package/src/config/defaults.ts +4 -4
  71. package/src/config/index.ts +14 -16
  72. package/src/config/loader.ts +6 -4
  73. package/src/config/schema.ts +8 -4
  74. package/src/core/index.ts +1 -1
  75. package/src/discovery/collections.ts +3 -3
  76. package/src/discovery/index.ts +9 -11
  77. package/src/discovery/patterns.ts +2 -2
  78. package/src/discovery/schema.ts +1 -1
  79. package/src/filesystem/images.ts +3 -3
  80. package/src/filesystem/index.ts +74 -79
  81. package/src/filesystem/reader.ts +2 -2
  82. package/src/filesystem/version-config.ts +10 -10
  83. package/src/filesystem/versions.ts +9 -9
  84. package/src/filesystem/watcher.ts +1 -1
  85. package/src/filesystem/writer.ts +6 -6
  86. package/src/global.d.ts +39 -0
  87. package/src/index.ts +10 -10
  88. package/src/integration.ts +2 -2
  89. package/src/server/assets.ts +3 -3
  90. package/src/server/cache.ts +1 -1
  91. package/src/server/index.ts +12 -15
  92. package/src/server/middleware.ts +3 -3
  93. package/src/server/routes.ts +28 -28
  94. package/src/types/index.ts +24 -28
  95. package/dist/chunk-5PM6EQE5.js.map +0 -1
  96. package/dist/chunk-7XU5X6CW.js.map +0 -1
  97. package/dist/chunk-CF2XXJFF.js.map +0 -1
  98. package/dist/loader-CrdnaAWR.d.ts +0 -327
  99. /package/dist/{loader-55LWCXHA.js.map → loader-VGNXC2XJ.js.map} +0 -0
@@ -8,27 +8,27 @@
8
8
  * @module @writenex/astro/client/components/ConfigPanel
9
9
  */
10
10
 
11
- import { useCallback, useEffect, useRef, useState } from "react";
12
11
  import {
13
- X,
14
- Settings,
12
+ Check,
13
+ ChevronDown,
14
+ Copy,
15
+ ExternalLink,
15
16
  Folder,
16
17
  Image,
17
18
  Info,
18
- ExternalLink,
19
- Copy,
20
- Check,
21
- ChevronDown,
19
+ Settings,
20
+ X,
22
21
  } from "lucide-react";
23
- import { useFocusTrap } from "../../hooks/useFocusTrap";
24
- import type { Collection, WritenexClientConfig } from "../../hooks/useApi";
22
+ import { useCallback, useEffect, useRef, useState } from "react";
25
23
  import { useSharedApi } from "../../context/ApiContext";
24
+ import type { Collection, WritenexClientConfig } from "../../hooks/useApi";
25
+ import { useFocusTrap } from "../../hooks/useFocusTrap";
26
26
  import {
27
- openInEditor,
27
+ type EditorType,
28
28
  getAvailableEditors,
29
29
  getPreferredEditor,
30
+ openInEditor,
30
31
  setPreferredEditor,
31
- type EditorType,
32
32
  } from "../../utils/openInEditor";
33
33
  import "./ConfigPanel.css";
34
34
 
@@ -71,8 +71,9 @@ export function ConfigPanel({
71
71
  const [configPath, setConfigPath] = useState<string | null>(null);
72
72
  const [hasConfigFile, setHasConfigFile] = useState(false);
73
73
  const [copied, setCopied] = useState(false);
74
- const [selectedEditor, setSelectedEditor] =
75
- useState<EditorType>(getPreferredEditor());
74
+ const [selectedEditor, setSelectedEditor] = useState<EditorType>(
75
+ getPreferredEditor()
76
+ );
76
77
  const [showEditorDropdown, setShowEditorDropdown] = useState(false);
77
78
 
78
79
  // Fetch config path when modal opens
@@ -8,8 +8,8 @@
8
8
  * @module @writenex/astro/client/components/CreateContentModal
9
9
  */
10
10
 
11
+ import { FileText, X } from "lucide-react";
11
12
  import { useCallback, useEffect, useRef, useState } from "react";
12
- import { X, FileText } from "lucide-react";
13
13
  import { useFocusTrap } from "../../hooks/useFocusTrap";
14
14
  import "./CreateContentModal.css";
15
15
 
@@ -8,42 +8,42 @@
8
8
  * @module @writenex/astro/client/components/Editor
9
9
  */
10
10
 
11
- import { useCallback, useEffect, useRef, useState } from "react";
12
- import { FileText, Plus } from "lucide-react";
13
11
  import {
14
- MDXEditor,
15
- headingsPlugin,
16
- listsPlugin,
17
- quotePlugin,
18
- thematicBreakPlugin,
19
- markdownShortcutPlugin,
20
- linkPlugin,
21
- linkDialogPlugin,
22
- imagePlugin,
23
- tablePlugin,
12
+ addComposerChild$,
13
+ BlockTypeSelect,
14
+ BoldItalicUnderlineToggles,
15
+ CodeToggle,
16
+ CreateLink,
24
17
  codeBlockPlugin,
25
18
  codeMirrorPlugin,
26
- toolbarPlugin,
19
+ DiffSourceToggleWrapper,
27
20
  diffSourcePlugin,
28
- frontmatterPlugin,
29
- searchPlugin,
30
- editorSearchTerm$,
31
21
  editorSearchCursor$,
32
- usePublisher,
33
- addComposerChild$,
34
- BoldItalicUnderlineToggles,
35
- BlockTypeSelect,
36
- CreateLink,
22
+ editorSearchTerm$,
23
+ frontmatterPlugin,
24
+ headingsPlugin,
25
+ InsertCodeBlock,
37
26
  InsertImage,
38
27
  InsertTable,
39
- ListsToggle,
40
- UndoRedo,
41
- CodeToggle,
42
28
  InsertThematicBreak,
43
- InsertCodeBlock,
44
- DiffSourceToggleWrapper,
29
+ imagePlugin,
30
+ ListsToggle,
31
+ linkDialogPlugin,
32
+ linkPlugin,
33
+ listsPlugin,
34
+ MDXEditor,
45
35
  type MDXEditorMethods,
36
+ markdownShortcutPlugin,
37
+ quotePlugin,
38
+ searchPlugin,
39
+ tablePlugin,
40
+ thematicBreakPlugin,
41
+ toolbarPlugin,
42
+ UndoRedo,
43
+ usePublisher,
46
44
  } from "@mdxeditor/editor";
45
+ import { FileText, Plus } from "lucide-react";
46
+ import { useCallback, useEffect, useRef, useState } from "react";
47
47
  import "@mdxeditor/editor/style.css";
48
48
  import "./Editor.css";
49
49
  import { ImageDialog } from "./ImageDialog";
@@ -138,7 +138,7 @@ function SearchBridge(): null {
138
138
  */
139
139
  function createSearchBridgePlugin() {
140
140
  return {
141
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
141
+ // biome-ignore lint/suspicious/noExplicitAny: third party type
142
142
  init: (realm: any) => {
143
143
  realm.pub(addComposerChild$, SearchBridge);
144
144
  },
@@ -17,15 +17,16 @@
17
17
  * @module @writenex/astro/client/components/Editor/ImageDialog
18
18
  */
19
19
 
20
- import { useState, useRef, useEffect, useCallback } from "react";
21
- import { usePublisher, useCellValue } from "@mdxeditor/editor";
22
20
  import {
23
- insertImage$,
24
21
  closeImageDialog$,
25
22
  imageDialogState$,
23
+ insertImage$,
26
24
  saveImage$,
25
+ useCellValue,
26
+ usePublisher,
27
27
  } from "@mdxeditor/editor";
28
28
  import { Image as ImageIcon, Link as LinkIcon, Upload, X } from "lucide-react";
29
+ import { useCallback, useEffect, useRef, useState } from "react";
29
30
  import { useFocusTrap } from "../../hooks/useFocusTrap";
30
31
  import "./ImageDialog.css";
31
32
 
@@ -17,16 +17,17 @@
17
17
  * @module @writenex/astro/client/components/Editor/LinkDialog
18
18
  */
19
19
 
20
- import { useState, useCallback, useEffect, useRef } from "react";
21
- import { usePublisher, useCellValue } from "@mdxeditor/editor";
22
20
  import {
23
- linkDialogState$,
24
21
  cancelLinkEdit$,
25
- updateLink$,
26
- switchFromPreviewToLinkEdit$,
22
+ linkDialogState$,
27
23
  removeLink$,
24
+ switchFromPreviewToLinkEdit$,
25
+ updateLink$,
26
+ useCellValue,
27
+ usePublisher,
28
28
  } from "@mdxeditor/editor";
29
- import { Link as LinkIcon, Trash2, Edit2, Copy, X } from "lucide-react";
29
+ import { Copy, Edit2, Link as LinkIcon, Trash2, X } from "lucide-react";
30
+ import { useCallback, useEffect, useRef, useState } from "react";
30
31
  import { useFocusTrap } from "../../hooks/useFocusTrap";
31
32
  import "./LinkDialog.css";
32
33
 
@@ -3,4 +3,4 @@
3
3
  * @module @writenex/astro/client/components/Editor
4
4
  */
5
5
 
6
- export { Editor, EditorLoading, EditorEmpty } from "./Editor";
6
+ export { Editor, EditorEmpty, EditorLoading } from "./Editor";
@@ -409,7 +409,7 @@
409
409
 
410
410
  /* Date input calendar icon - no invert for light mode */
411
411
  .wn-light
412
- .wn-frontmatter-input[type="date"]::-webkit-calendar-picker-indicator {
412
+ .wn-frontmatter-input[type="date"]::-webkit-calendar-picker-indicator {
413
413
  filter: none;
414
414
  opacity: 0.6;
415
415
  }
@@ -8,8 +8,8 @@
8
8
  * @module @writenex/astro/client/components/FrontmatterForm
9
9
  */
10
10
 
11
+ import { AlertCircle, Info, X } from "lucide-react";
11
12
  import { useCallback, useState } from "react";
12
- import { X, Info, AlertCircle } from "lucide-react";
13
13
  import type { CollectionSchema, SchemaField } from "../../../types";
14
14
  import "./FrontmatterForm.css";
15
15
 
@@ -7,20 +7,20 @@
7
7
  * @module @writenex/astro/client/components/Header
8
8
  */
9
9
 
10
- import { useState, useRef, useEffect } from "react";
11
10
  import {
12
- Keyboard,
13
- Settings,
14
11
  Folder,
12
+ History,
15
13
  Info,
16
- Search,
17
- Sun,
18
- Moon,
14
+ Keyboard,
19
15
  Monitor,
20
- History,
16
+ Moon,
21
17
  Plus,
18
+ Search,
19
+ Settings,
20
+ Sun,
22
21
  } from "lucide-react";
23
- import { useTheme, type Theme } from "../../context/ThemeContext";
22
+ import { useEffect, useRef, useState } from "react";
23
+ import { type Theme, useTheme } from "../../context/ThemeContext";
24
24
  import "./Header.css";
25
25
 
26
26
  /**
@@ -8,8 +8,8 @@
8
8
  * @module @writenex/astro/client/components/KeyboardShortcuts
9
9
  */
10
10
 
11
- import { useEffect, useRef } from "react";
12
11
  import { X } from "lucide-react";
12
+ import { useEffect, useRef } from "react";
13
13
  import { useFocusTrap } from "../../hooks/useFocusTrap";
14
14
  import {
15
15
  formatShortcut,
@@ -8,7 +8,7 @@
8
8
  * @module @writenex/astro/client/components/LazyEditor
9
9
  */
10
10
 
11
- import { lazy, Suspense, memo } from "react";
11
+ import { lazy, memo, Suspense } from "react";
12
12
  import { EditorLoading } from "./Editor/Editor";
13
13
 
14
14
  /**
@@ -3,5 +3,5 @@
3
3
  * @module @writenex/astro/client/components/LiveRegion
4
4
  */
5
5
 
6
- export { LiveRegion } from "./LiveRegion";
7
6
  export type { LiveRegionProps } from "./LiveRegion";
7
+ export { LiveRegion } from "./LiveRegion";
@@ -7,17 +7,17 @@
7
7
  * @module @writenex/astro/client/components/SearchReplace
8
8
  */
9
9
 
10
- import { useState, useCallback, useEffect, useRef } from "react";
11
10
  import {
12
- X,
13
- ChevronUp,
14
- ChevronDown,
15
11
  CaseSensitive,
16
- WholeWord,
12
+ ChevronDown,
13
+ ChevronUp,
17
14
  Regex,
18
15
  Replace,
19
16
  ReplaceAll,
17
+ WholeWord,
18
+ X,
20
19
  } from "lucide-react";
20
+ import { useCallback, useEffect, useRef, useState } from "react";
21
21
  import "./SearchReplacePanel.css";
22
22
 
23
23
  /**
@@ -4,4 +4,4 @@
4
4
  * @module @writenex/astro/client/components/SearchReplace
5
5
  */
6
6
 
7
- export { SearchReplacePanel, type SearchOptions } from "./SearchReplacePanel";
7
+ export { type SearchOptions, SearchReplacePanel } from "./SearchReplacePanel";
@@ -7,10 +7,10 @@
7
7
  * @module @writenex/astro/client/components/SelectCollectionModal
8
8
  */
9
9
 
10
+ import { ChevronRight, Folder, X } from "lucide-react";
10
11
  import { useCallback, useEffect, useRef, useState } from "react";
11
- import { X, Folder, ChevronRight } from "lucide-react";
12
- import { useFocusTrap } from "../../hooks/useFocusTrap";
13
12
  import type { Collection } from "../../hooks/useApi";
13
+ import { useFocusTrap } from "../../hooks/useFocusTrap";
14
14
  import "./SelectCollectionModal.css";
15
15
 
16
16
  /**
@@ -13,19 +13,19 @@
13
13
  * @module @writenex/astro/client/components/Sidebar
14
14
  */
15
15
 
16
- import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react";
17
16
  import {
18
- X,
17
+ CheckCircle,
19
18
  FileEdit,
20
19
  Folder,
21
20
  Plus,
22
- CheckCircle,
23
21
  RefreshCw,
24
22
  Search,
23
+ X,
25
24
  } from "lucide-react";
25
+ import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react";
26
+ import { useAnnounce } from "../../hooks/useAnnounce";
26
27
  import type { Collection, ContentSummary } from "../../hooks/useApi";
27
28
  import { useArrowNavigation } from "../../hooks/useArrowNavigation";
28
- import { useAnnounce } from "../../hooks/useAnnounce";
29
29
  import "./Sidebar.css";
30
30
 
31
31
  /**
@@ -233,7 +233,7 @@ export function Sidebar({
233
233
 
234
234
  useEffect(() => {
235
235
  setSearchQuery("");
236
- }, [selectedCollection]);
236
+ }, []);
237
237
 
238
238
  const draftCount = useMemo(
239
239
  () => contentItems.filter((item) => item.draft).length,
@@ -344,7 +344,7 @@ export function Sidebar({
344
344
  // Reset content focus index when filtered items change
345
345
  useEffect(() => {
346
346
  setContentFocusIndex(0);
347
- }, [filteredItems.length]);
347
+ }, []);
348
348
 
349
349
  // Announce search results when they change
350
350
  useEffect(() => {
@@ -3,5 +3,5 @@
3
3
  * @module @writenex/astro/client/components/SkipLink
4
4
  */
5
5
 
6
- export { SkipLink } from "./SkipLink";
7
6
  export type { SkipLinkProps } from "./SkipLink";
7
+ export { SkipLink } from "./SkipLink";
@@ -9,8 +9,8 @@
9
9
  * @module @writenex/astro/client/components/UnsavedChangesModal
10
10
  */
11
11
 
12
+ import { AlertTriangle, X } from "lucide-react";
12
13
  import { useCallback, useEffect, useRef } from "react";
13
- import { X, AlertTriangle } from "lucide-react";
14
14
  import { useFocusTrap } from "../../hooks/useFocusTrap";
15
15
  import "./UnsavedChangesModal.css";
16
16
 
@@ -8,8 +8,8 @@
8
8
  * @module @writenex/astro/client/components/VersionHistory/DiffViewer
9
9
  */
10
10
 
11
- import { useState, useMemo, useEffect, useRef } from "react";
12
- import { X, Columns, AlignLeft } from "lucide-react";
11
+ import { AlignLeft, Columns, X } from "lucide-react";
12
+ import { useEffect, useMemo, useRef, useState } from "react";
13
13
  import { useFocusTrap } from "../../hooks/useFocusTrap";
14
14
  import "./DiffViewer.css";
15
15
 
@@ -56,16 +56,20 @@ function computeDiff(oldText: string, newText: string): DiffLine[] {
56
56
  // Build LCS table
57
57
  const m = oldLines.length;
58
58
  const n = newLines.length;
59
- const dp: number[][] = Array(m + 1)
60
- .fill(null)
61
- .map(() => Array(n + 1).fill(0));
59
+ const dp: number[][] = Array.from(
60
+ { length: m + 1 },
61
+ () => Array(n + 1).fill(0) as number[]
62
+ ) as number[][];
62
63
 
63
64
  for (let i = 1; i <= m; i++) {
64
65
  for (let j = 1; j <= n; j++) {
66
+ const prevDiag = (dp[i - 1]?.[j - 1] ?? 0) as number;
67
+ const prevUp = (dp[i - 1]?.[j] ?? 0) as number;
68
+ const prevLeft = (dp[i]?.[j - 1] ?? 0) as number;
65
69
  if (oldLines[i - 1] === newLines[j - 1]) {
66
- dp[i][j] = dp[i - 1][j - 1] + 1;
70
+ dp[i]![j] = prevDiag + 1;
67
71
  } else {
68
- dp[i][j] = Math.max(dp[i - 1][j], dp[i][j - 1]);
72
+ dp[i]![j] = Math.max(prevUp, prevLeft);
69
73
  }
70
74
  }
71
75
  }
@@ -79,23 +83,26 @@ function computeDiff(oldText: string, newText: string): DiffLine[] {
79
83
  if (i > 0 && j > 0 && oldLines[i - 1] === newLines[j - 1]) {
80
84
  stack.push({
81
85
  type: "unchanged",
82
- content: oldLines[i - 1],
86
+ content: oldLines[i - 1] ?? "",
83
87
  oldLineNum: i,
84
88
  newLineNum: j,
85
89
  });
86
90
  i--;
87
91
  j--;
88
- } else if (j > 0 && (i === 0 || dp[i][j - 1] >= dp[i - 1][j])) {
92
+ } else if (
93
+ j > 0 &&
94
+ (i === 0 || (dp[i]?.[j - 1] ?? 0) >= (dp[i - 1]?.[j] ?? 0))
95
+ ) {
89
96
  stack.push({
90
97
  type: "added",
91
- content: newLines[j - 1],
98
+ content: newLines[j - 1] ?? "",
92
99
  newLineNum: j,
93
100
  });
94
101
  j--;
95
102
  } else if (i > 0) {
96
103
  stack.push({
97
104
  type: "removed",
98
- content: oldLines[i - 1],
105
+ content: oldLines[i - 1] ?? "",
99
106
  oldLineNum: i,
100
107
  });
101
108
  i--;
@@ -8,18 +8,18 @@
8
8
  * @module @writenex/astro/client/components/VersionHistory/VersionActions
9
9
  */
10
10
 
11
- import { useState, useEffect, useRef } from "react";
12
11
  import {
13
- RotateCcw,
14
- GitCompare,
12
+ AlertTriangle,
15
13
  Download,
16
- Trash2,
14
+ GitCompare,
17
15
  Loader2,
18
- AlertTriangle,
16
+ RotateCcw,
17
+ Trash2,
19
18
  X,
20
19
  } from "lucide-react";
21
- import { useFocusTrap } from "../../hooks/useFocusTrap";
20
+ import { useEffect, useRef, useState } from "react";
22
21
  import type { VersionEntry } from "../../../types";
22
+ import { useFocusTrap } from "../../hooks/useFocusTrap";
23
23
  import "./VersionActions.css";
24
24
 
25
25
  /**
@@ -7,26 +7,26 @@
7
7
  * @module @writenex/astro/client/components/VersionHistory/VersionHistoryPanel
8
8
  */
9
9
 
10
- import { useEffect, useState, useRef } from "react";
11
10
  import {
12
- X,
13
- History,
11
+ AlertTriangle,
14
12
  Clock,
15
- Tag,
16
- RefreshCw,
13
+ History,
17
14
  Loader2,
15
+ RefreshCw,
16
+ Tag,
18
17
  Trash2,
19
- AlertTriangle,
18
+ X,
20
19
  } from "lucide-react";
20
+ import { useEffect, useRef, useState } from "react";
21
21
  import type { VersionEntry } from "../../../types";
22
+ import { useSharedVersionApi } from "../../context/ApiContext";
23
+ import { useFocusTrap } from "../../hooks/useFocusTrap";
22
24
  import {
23
- useVersionHistory,
24
25
  type DiffData,
26
+ useVersionHistory,
25
27
  } from "../../hooks/useVersionHistory";
26
- import { useSharedVersionApi } from "../../context/ApiContext";
27
- import { useFocusTrap } from "../../hooks/useFocusTrap";
28
- import { VersionActions } from "./VersionActions";
29
28
  import { DiffViewer } from "./DiffViewer";
29
+ import { VersionActions } from "./VersionActions";
30
30
  import "./VersionHistoryPanel.css";
31
31
 
32
32
  /**
@@ -4,6 +4,6 @@
4
4
  * @module @writenex/astro/client/components/VersionHistory
5
5
  */
6
6
 
7
- export { VersionHistoryPanel } from "./VersionHistoryPanel";
8
- export { VersionActions } from "./VersionActions";
9
7
  export { DiffViewer } from "./DiffViewer";
8
+ export { VersionActions } from "./VersionActions";
9
+ export { VersionHistoryPanel } from "./VersionHistoryPanel";
@@ -9,10 +9,10 @@
9
9
 
10
10
  import {
11
11
  createContext,
12
+ type ReactElement,
13
+ type ReactNode,
12
14
  useContext,
13
15
  useMemo,
14
- type ReactNode,
15
- type ReactElement,
16
16
  } from "react";
17
17
  import { createApiClient } from "../hooks/useApi";
18
18
  import { createVersionApiClient } from "../hooks/useVersionHistory";
@@ -9,11 +9,11 @@
9
9
 
10
10
  import {
11
11
  createContext,
12
+ type ReactNode,
13
+ useCallback,
12
14
  useContext,
13
15
  useEffect,
14
16
  useState,
15
- useCallback,
16
- type ReactNode,
17
17
  } from "react";
18
18
 
19
19
  /**
@@ -8,7 +8,7 @@
8
8
  * @module @writenex/astro/client/hooks/useApi
9
9
  */
10
10
 
11
- import { useState, useCallback, useMemo } from "react";
11
+ import { useCallback, useMemo, useState } from "react";
12
12
 
13
13
  /**
14
14
  * Collection data from API
@@ -19,8 +19,8 @@
19
19
 
20
20
  import { useCallback, useEffect, useRef } from "react";
21
21
  import {
22
- getFocusableElements,
23
22
  getFirstFocusable,
23
+ getFocusableElements,
24
24
  getLastFocusable,
25
25
  } from "../utils/focus";
26
26
 
@@ -6,7 +6,7 @@
6
6
  * @module @writenex/astro/client/hooks/useSearch
7
7
  */
8
8
 
9
- import { useState, useCallback } from "react";
9
+ import { useCallback, useState } from "react";
10
10
  import type { SearchOptions } from "../components/SearchReplace";
11
11
 
12
12
  /**
@@ -7,8 +7,8 @@
7
7
  * @module @writenex/astro/client/hooks/useVersionHistory
8
8
  */
9
9
 
10
- import { useState, useCallback, useMemo } from "react";
11
- import type { VersionEntry, Version } from "../../types";
10
+ import { useCallback, useMemo, useState } from "react";
11
+ import type { Version, VersionEntry } from "../../types";
12
12
 
13
13
  /**
14
14
  * Version history API client configuration
@@ -10,8 +10,8 @@
10
10
  import { StrictMode } from "react";
11
11
  import { createRoot } from "react-dom/client";
12
12
  import { App } from "./App";
13
- import { ThemeProvider } from "./context/ThemeContext";
14
13
  import { ApiProvider } from "./context/ApiContext";
14
+ import { ThemeProvider } from "./context/ThemeContext";
15
15
 
16
16
  /**
17
17
  * Configuration injected by the server
@@ -35,14 +35,8 @@ body,
35
35
 
36
36
  body {
37
37
  font-family:
38
- "Plus Jakarta Sans",
39
- system-ui,
40
- -apple-system,
41
- "Segoe UI",
42
- Roboto,
43
- "Helvetica Neue",
44
- Arial,
45
- sans-serif;
38
+ "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto,
39
+ "Helvetica Neue", Arial, sans-serif;
46
40
  font-size: var(--wn-font-base);
47
41
  line-height: 1.5;
48
42
  background-color: var(--wn-zinc-950);
@@ -9,12 +9,12 @@
9
9
  */
10
10
 
11
11
  import type {
12
- WritenexConfig,
13
- ImageConfig,
14
- EditorConfig,
15
- DiscoveryConfig,
16
12
  CollectionConfig,
13
+ DiscoveryConfig,
14
+ EditorConfig,
15
+ ImageConfig,
17
16
  VersionHistoryConfig,
17
+ WritenexConfig,
18
18
  } from "@/types";
19
19
 
20
20
  /**