|
41 | 41 | Compartment, |
42 | 42 | type Extension |
43 | 43 | } from '@codemirror/state'; |
| 44 | + import type { Text as CmText } from '@codemirror/state'; |
44 | 45 | import { onMount, onDestroy } from 'svelte'; |
45 | 46 | import Id, { truncateId } from '$lib/components/id.svelte'; |
46 | 47 | import { Icon, Layout, Skeleton, Tooltip } from '@appwrite.io/pink-svelte'; |
|
421 | 422 | if (isPaste) return false; |
422 | 423 |
|
423 | 424 | update.changes.iterChanges( |
424 | | - (fromA: number, toA: number, fromB: number, toB: number, inserted: Text) => { |
| 425 | + (fromA: number, toA: number, fromB: number, toB: number, inserted: CmText) => { |
425 | 426 | if (did) return; |
426 | 427 |
|
427 | 428 | // Only trigger on insertion (not deletion) |
|
472 | 473 | function ensureTimestampsAtBottom( |
473 | 474 | expectedFields: Array<{ key: '$id' | '$createdAt' | '$updatedAt'; text: string }>, |
474 | 475 | hits: Map<string, Hit>, |
475 | | - doc: Text, |
| 476 | + doc: CmText, |
476 | 477 | content: string, |
477 | 478 | closeIdx: number, |
478 | 479 | indent: string |
|
664 | 665 | } |
665 | 666 |
|
666 | 667 | // In-place patch: ensure top-level $ system fields reflect originals without reformatting the whole doc |
667 | | - function applySystemFieldsPatch(view: EditorView, doc: Text, parsed: JsonValue): boolean { |
| 668 | + function applySystemFieldsPatch(view: EditorView, doc: CmText, parsed: JsonValue): boolean { |
668 | 669 | if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) return false; |
669 | 670 | const obj = parsed as JsonObject; |
670 | 671 | const expectedFields: Array<{ key: '$id' | '$createdAt' | '$updatedAt'; text: string }> = [ |
|
0 commit comments