@puredesktop/platform-editor 1.0.0-beta.1 → 1.0.0-beta.2

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 (45) hide show
  1. package/package.json +1 -1
  2. package/src/CollapsePanel.tsx +35 -35
  3. package/src/DocumentDiffView.tsx +130 -130
  4. package/src/DocumentEditor.test.ts +118 -118
  5. package/src/DocumentEditor.tsx +2651 -2631
  6. package/src/alignedLineDiff.test.ts +52 -52
  7. package/src/alignedLineDiff.ts +67 -67
  8. package/src/collectionAssetSrc.ts +2 -2
  9. package/src/commentUtils.test.ts +350 -350
  10. package/src/commentUtils.ts +546 -546
  11. package/src/constants/toolKeys.ts +14 -14
  12. package/src/contentFormat.test.ts +27 -27
  13. package/src/contentFormat.ts +18 -18
  14. package/src/editorExtensions.ts +155 -155
  15. package/src/extensions/appliedChangeMark.ts +115 -115
  16. package/src/extensions/autoReviewPrompts.test.ts +529 -529
  17. package/src/extensions/autoReviewPrompts.ts +1442 -1442
  18. package/src/extensions/collectionImage.ts +26 -26
  19. package/src/extensions/collectionImagePaste.ts +215 -215
  20. package/src/extensions/commentMark.ts +223 -223
  21. package/src/extensions/documentAssetIdentity.ts +54 -54
  22. package/src/extensions/figure.ts +92 -92
  23. package/src/extensions/footnote.ts +186 -186
  24. package/src/extensions/indexMarker.ts +88 -88
  25. package/src/extensions/mathEditing.ts +239 -239
  26. package/src/extensions/mermaidBlock.tsx +297 -297
  27. package/src/extensions/slashCommands.test.ts +170 -170
  28. package/src/extensions/slashCommands.ts +746 -746
  29. package/src/extensions/smartTypography.test.ts +74 -74
  30. package/src/extensions/smartTypography.ts +120 -120
  31. package/src/index.ts +138 -137
  32. package/src/insertCollectionImage.test.ts +60 -60
  33. package/src/insertCollectionImage.ts +63 -63
  34. package/src/insertInlineAssetKind.test.ts +67 -67
  35. package/src/insertInlineAssetKind.ts +49 -49
  36. package/src/mermaidPreview.test.ts +54 -54
  37. package/src/mermaidPreview.ts +115 -115
  38. package/src/styled.ts +697 -676
  39. package/src/toolbar/ToolBtn.tsx +77 -63
  40. package/src/toolbar/Toolbar.test.tsx +325 -325
  41. package/src/toolbar/Toolbar.tsx +662 -624
  42. package/src/toolbar/groups/HeadingGroup.tsx +175 -153
  43. package/src/toolbar/overlayTypes.ts +28 -28
  44. package/src/useEditorExtensions.ts +22 -22
  45. package/src/utils/markdownUtils.ts +331 -331
@@ -1,74 +1,74 @@
1
- import { describe, it, expect } from 'vitest'
2
- import { SmartTypographyRules } from './smartTypography.js'
3
-
4
- describe('SmartTypographyRules', () => {
5
- describe('emDash', () => {
6
- it('replaces -- at end of input with em-dash', () => {
7
- expect(SmartTypographyRules.emDash('she said--')).toBe('she said—')
8
- })
9
- it('does not touch a single dash', () => {
10
- expect(SmartTypographyRules.emDash('she said-')).toBe('she said-')
11
- })
12
- })
13
-
14
- describe('ellipsis', () => {
15
- it('replaces ... with …', () => {
16
- expect(SmartTypographyRules.ellipsis('then...')).toBe('then…')
17
- })
18
- it('does not touch two dots', () => {
19
- expect(SmartTypographyRules.ellipsis('then..')).toBe('then..')
20
- })
21
- })
22
-
23
- describe('curly double quotes', () => {
24
- it('opens left double quote at start of input', () => {
25
- expect(SmartTypographyRules.leftDouble('"')).toBe('“')
26
- })
27
- it('opens left double quote after whitespace', () => {
28
- expect(SmartTypographyRules.leftDouble('he said "')).toBe('he said “')
29
- })
30
- it('closes right double quote after a non-space char', () => {
31
- expect(SmartTypographyRules.rightDouble('done"')).toBe('done”')
32
- })
33
- })
34
-
35
- describe('apostrophe', () => {
36
- it("replaces straight apostrophe between letters (don't)", () => {
37
- expect(SmartTypographyRules.apostrophe("don'")).toBe('don’')
38
- })
39
- it("preserves contractions like it's, can't, you're", () => {
40
- expect(SmartTypographyRules.apostrophe("it'")).toBe('it’')
41
- expect(SmartTypographyRules.apostrophe("can'")).toBe('can’')
42
- expect(SmartTypographyRules.apostrophe("you'")).toBe('you’')
43
- })
44
- })
45
-
46
- describe('curly single quotes', () => {
47
- it('opens left single after whitespace', () => {
48
- expect(SmartTypographyRules.leftSingle("she said '")).toBe('she said ‘')
49
- })
50
- it('opens left single at start', () => {
51
- expect(SmartTypographyRules.leftSingle("'")).toBe('‘')
52
- })
53
- it('closes right single after sentence punctuation', () => {
54
- expect(SmartTypographyRules.rightSingle("done.'")).toBe('done.’')
55
- })
56
- })
57
-
58
- describe('collapseDoubleSpace', () => {
59
- it('collapses double space after period', () => {
60
- expect(SmartTypographyRules.collapseDoubleSpace('done. ')).toBe('done. ')
61
- })
62
- it('collapses double space after question mark', () => {
63
- expect(SmartTypographyRules.collapseDoubleSpace('really? ')).toBe(
64
- 'really? ',
65
- )
66
- })
67
- it('collapses double space after exclamation', () => {
68
- expect(SmartTypographyRules.collapseDoubleSpace('wow! ')).toBe('wow! ')
69
- })
70
- it('does not collapse double space after a non-sentence char', () => {
71
- expect(SmartTypographyRules.collapseDoubleSpace('foo, ')).toBe('foo, ')
72
- })
73
- })
74
- })
1
+ import { describe, it, expect } from 'vitest'
2
+ import { SmartTypographyRules } from './smartTypography.js'
3
+
4
+ describe('SmartTypographyRules', () => {
5
+ describe('emDash', () => {
6
+ it('replaces -- at end of input with em-dash', () => {
7
+ expect(SmartTypographyRules.emDash('she said--')).toBe('she said—')
8
+ })
9
+ it('does not touch a single dash', () => {
10
+ expect(SmartTypographyRules.emDash('she said-')).toBe('she said-')
11
+ })
12
+ })
13
+
14
+ describe('ellipsis', () => {
15
+ it('replaces ... with …', () => {
16
+ expect(SmartTypographyRules.ellipsis('then...')).toBe('then…')
17
+ })
18
+ it('does not touch two dots', () => {
19
+ expect(SmartTypographyRules.ellipsis('then..')).toBe('then..')
20
+ })
21
+ })
22
+
23
+ describe('curly double quotes', () => {
24
+ it('opens left double quote at start of input', () => {
25
+ expect(SmartTypographyRules.leftDouble('"')).toBe('“')
26
+ })
27
+ it('opens left double quote after whitespace', () => {
28
+ expect(SmartTypographyRules.leftDouble('he said "')).toBe('he said “')
29
+ })
30
+ it('closes right double quote after a non-space char', () => {
31
+ expect(SmartTypographyRules.rightDouble('done"')).toBe('done”')
32
+ })
33
+ })
34
+
35
+ describe('apostrophe', () => {
36
+ it("replaces straight apostrophe between letters (don't)", () => {
37
+ expect(SmartTypographyRules.apostrophe("don'")).toBe('don’')
38
+ })
39
+ it("preserves contractions like it's, can't, you're", () => {
40
+ expect(SmartTypographyRules.apostrophe("it'")).toBe('it’')
41
+ expect(SmartTypographyRules.apostrophe("can'")).toBe('can’')
42
+ expect(SmartTypographyRules.apostrophe("you'")).toBe('you’')
43
+ })
44
+ })
45
+
46
+ describe('curly single quotes', () => {
47
+ it('opens left single after whitespace', () => {
48
+ expect(SmartTypographyRules.leftSingle("she said '")).toBe('she said ‘')
49
+ })
50
+ it('opens left single at start', () => {
51
+ expect(SmartTypographyRules.leftSingle("'")).toBe('‘')
52
+ })
53
+ it('closes right single after sentence punctuation', () => {
54
+ expect(SmartTypographyRules.rightSingle("done.'")).toBe('done.’')
55
+ })
56
+ })
57
+
58
+ describe('collapseDoubleSpace', () => {
59
+ it('collapses double space after period', () => {
60
+ expect(SmartTypographyRules.collapseDoubleSpace('done. ')).toBe('done. ')
61
+ })
62
+ it('collapses double space after question mark', () => {
63
+ expect(SmartTypographyRules.collapseDoubleSpace('really? ')).toBe(
64
+ 'really? ',
65
+ )
66
+ })
67
+ it('collapses double space after exclamation', () => {
68
+ expect(SmartTypographyRules.collapseDoubleSpace('wow! ')).toBe('wow! ')
69
+ })
70
+ it('does not collapse double space after a non-sentence char', () => {
71
+ expect(SmartTypographyRules.collapseDoubleSpace('foo, ')).toBe('foo, ')
72
+ })
73
+ })
74
+ })
@@ -1,120 +1,120 @@
1
- import { Extension } from '@tiptap/core'
2
- import { InputRule } from '@tiptap/core'
3
-
4
- /**
5
- * Smart typography (#245).
6
- *
7
- * On-type transforms via TipTap InputRules:
8
- * - `--` → em-dash
9
- * - `...` → ellipsis
10
- * - `"X` after a boundary → left double curly quote
11
- * - `X"` → right double curly quote
12
- * - `'` between letters → typographic apostrophe (right single curly)
13
- * - ` 'X` → left single curly
14
- * - `X'` → right single curly
15
- * - `. `, `! `, `? ` → collapse double space after sentence punct
16
- *
17
- * InputRules are TipTap-native and are skipped automatically inside
18
- * code marks and code blocks. Pasted text and existing content are
19
- * not touched — only typed input.
20
- */
21
-
22
- const emDashRule = new InputRule({
23
- find: /--$/,
24
- handler: ({ state, range }) => {
25
- state.tr.replaceWith(range.from, range.to, state.schema.text('—'))
26
- },
27
- })
28
-
29
- const ellipsisRule = new InputRule({
30
- find: /\.\.\.$/,
31
- handler: ({ state, range }) => {
32
- state.tr.replaceWith(range.from, range.to, state.schema.text('…'))
33
- },
34
- })
35
-
36
- // Left double quote: a `"` after start-of-input or whitespace.
37
- const leftDoubleRule = new InputRule({
38
- find: /(^|[\s([{<])"$/,
39
- handler: ({ state, range, match }) => {
40
- const before = match[1]
41
- state.tr.replaceWith(range.from, range.to, state.schema.text(before + '“'))
42
- },
43
- })
44
-
45
- // Right double quote: a `"` directly after a non-space.
46
- const rightDoubleRule = new InputRule({
47
- find: /(\S)"$/,
48
- handler: ({ state, range, match }) => {
49
- const before = match[1]
50
- state.tr.replaceWith(range.from, range.to, state.schema.text(before + '”'))
51
- },
52
- })
53
-
54
- // Apostrophe inside a word (don't, can't, it's).
55
- const apostropheRule = new InputRule({
56
- find: /([A-Za-z])'$/,
57
- handler: ({ state, range, match }) => {
58
- const before = match[1]
59
- state.tr.replaceWith(range.from, range.to, state.schema.text(before + '’'))
60
- },
61
- })
62
-
63
- // Left single quote: a `'` after start-of-input or whitespace.
64
- const leftSingleRule = new InputRule({
65
- find: /(^|[\s([{<])'$/,
66
- handler: ({ state, range, match }) => {
67
- const before = match[1]
68
- state.tr.replaceWith(range.from, range.to, state.schema.text(before + '‘'))
69
- },
70
- })
71
-
72
- // Right single quote / apostrophe after non-letter non-space (e.g. `?').
73
- const rightSingleRule = new InputRule({
74
- find: /([!?.,;:)])'$/,
75
- handler: ({ state, range, match }) => {
76
- const before = match[1]
77
- state.tr.replaceWith(range.from, range.to, state.schema.text(before + '’'))
78
- },
79
- })
80
-
81
- // Double space after sentence punctuation → single.
82
- const collapseDoubleSpaceRule = new InputRule({
83
- find: /([.!?]) $/,
84
- handler: ({ state, range, match }) => {
85
- const punct = match[1]
86
- state.tr.replaceWith(range.from, range.to, state.schema.text(punct + ' '))
87
- },
88
- })
89
-
90
- export const SmartTypography = Extension.create({
91
- name: 'smartTypography',
92
- addInputRules() {
93
- return [
94
- emDashRule,
95
- ellipsisRule,
96
- leftDoubleRule,
97
- rightDoubleRule,
98
- apostropheRule,
99
- leftSingleRule,
100
- rightSingleRule,
101
- collapseDoubleSpaceRule,
102
- ]
103
- },
104
- })
105
-
106
- /**
107
- * Pure transformations exposed for unit-testing the rules without a
108
- * TipTap editor instance. The functions apply the same regexes as the
109
- * input rules to a string suffix and return the transformed suffix.
110
- */
111
- export const SmartTypographyRules = {
112
- emDash: (s: string): string => s.replace(/--$/, '—'),
113
- ellipsis: (s: string): string => s.replace(/\.\.\.$/, '…'),
114
- leftDouble: (s: string): string => s.replace(/(^|[\s([{<])"$/, '$1“'),
115
- rightDouble: (s: string): string => s.replace(/(\S)"$/, '$1”'),
116
- apostrophe: (s: string): string => s.replace(/([A-Za-z])'$/, '$1’'),
117
- leftSingle: (s: string): string => s.replace(/(^|[\s([{<])'$/, '$1‘'),
118
- rightSingle: (s: string): string => s.replace(/([!?.,;:)])'$/, '$1’'),
119
- collapseDoubleSpace: (s: string): string => s.replace(/([.!?]) $/, '$1 '),
120
- }
1
+ import { Extension } from '@tiptap/core'
2
+ import { InputRule } from '@tiptap/core'
3
+
4
+ /**
5
+ * Smart typography (#245).
6
+ *
7
+ * On-type transforms via TipTap InputRules:
8
+ * - `--` → em-dash
9
+ * - `...` → ellipsis
10
+ * - `"X` after a boundary → left double curly quote
11
+ * - `X"` → right double curly quote
12
+ * - `'` between letters → typographic apostrophe (right single curly)
13
+ * - ` 'X` → left single curly
14
+ * - `X'` → right single curly
15
+ * - `. `, `! `, `? ` → collapse double space after sentence punct
16
+ *
17
+ * InputRules are TipTap-native and are skipped automatically inside
18
+ * code marks and code blocks. Pasted text and existing content are
19
+ * not touched — only typed input.
20
+ */
21
+
22
+ const emDashRule = new InputRule({
23
+ find: /--$/,
24
+ handler: ({ state, range }) => {
25
+ state.tr.replaceWith(range.from, range.to, state.schema.text('—'))
26
+ },
27
+ })
28
+
29
+ const ellipsisRule = new InputRule({
30
+ find: /\.\.\.$/,
31
+ handler: ({ state, range }) => {
32
+ state.tr.replaceWith(range.from, range.to, state.schema.text('…'))
33
+ },
34
+ })
35
+
36
+ // Left double quote: a `"` after start-of-input or whitespace.
37
+ const leftDoubleRule = new InputRule({
38
+ find: /(^|[\s([{<])"$/,
39
+ handler: ({ state, range, match }) => {
40
+ const before = match[1]
41
+ state.tr.replaceWith(range.from, range.to, state.schema.text(before + '“'))
42
+ },
43
+ })
44
+
45
+ // Right double quote: a `"` directly after a non-space.
46
+ const rightDoubleRule = new InputRule({
47
+ find: /(\S)"$/,
48
+ handler: ({ state, range, match }) => {
49
+ const before = match[1]
50
+ state.tr.replaceWith(range.from, range.to, state.schema.text(before + '”'))
51
+ },
52
+ })
53
+
54
+ // Apostrophe inside a word (don't, can't, it's).
55
+ const apostropheRule = new InputRule({
56
+ find: /([A-Za-z])'$/,
57
+ handler: ({ state, range, match }) => {
58
+ const before = match[1]
59
+ state.tr.replaceWith(range.from, range.to, state.schema.text(before + '’'))
60
+ },
61
+ })
62
+
63
+ // Left single quote: a `'` after start-of-input or whitespace.
64
+ const leftSingleRule = new InputRule({
65
+ find: /(^|[\s([{<])'$/,
66
+ handler: ({ state, range, match }) => {
67
+ const before = match[1]
68
+ state.tr.replaceWith(range.from, range.to, state.schema.text(before + '‘'))
69
+ },
70
+ })
71
+
72
+ // Right single quote / apostrophe after non-letter non-space (e.g. `?').
73
+ const rightSingleRule = new InputRule({
74
+ find: /([!?.,;:)])'$/,
75
+ handler: ({ state, range, match }) => {
76
+ const before = match[1]
77
+ state.tr.replaceWith(range.from, range.to, state.schema.text(before + '’'))
78
+ },
79
+ })
80
+
81
+ // Double space after sentence punctuation → single.
82
+ const collapseDoubleSpaceRule = new InputRule({
83
+ find: /([.!?]) $/,
84
+ handler: ({ state, range, match }) => {
85
+ const punct = match[1]
86
+ state.tr.replaceWith(range.from, range.to, state.schema.text(punct + ' '))
87
+ },
88
+ })
89
+
90
+ export const SmartTypography = Extension.create({
91
+ name: 'smartTypography',
92
+ addInputRules() {
93
+ return [
94
+ emDashRule,
95
+ ellipsisRule,
96
+ leftDoubleRule,
97
+ rightDoubleRule,
98
+ apostropheRule,
99
+ leftSingleRule,
100
+ rightSingleRule,
101
+ collapseDoubleSpaceRule,
102
+ ]
103
+ },
104
+ })
105
+
106
+ /**
107
+ * Pure transformations exposed for unit-testing the rules without a
108
+ * TipTap editor instance. The functions apply the same regexes as the
109
+ * input rules to a string suffix and return the transformed suffix.
110
+ */
111
+ export const SmartTypographyRules = {
112
+ emDash: (s: string): string => s.replace(/--$/, '—'),
113
+ ellipsis: (s: string): string => s.replace(/\.\.\.$/, '…'),
114
+ leftDouble: (s: string): string => s.replace(/(^|[\s([{<])"$/, '$1“'),
115
+ rightDouble: (s: string): string => s.replace(/(\S)"$/, '$1”'),
116
+ apostrophe: (s: string): string => s.replace(/([A-Za-z])'$/, '$1’'),
117
+ leftSingle: (s: string): string => s.replace(/(^|[\s([{<])'$/, '$1‘'),
118
+ rightSingle: (s: string): string => s.replace(/([!?.,;:)])'$/, '$1’'),
119
+ collapseDoubleSpace: (s: string): string => s.replace(/([.!?]) $/, '$1 '),
120
+ }
package/src/index.ts CHANGED
@@ -1,137 +1,138 @@
1
- export {
2
- DocumentEditor,
3
- type DocumentEditorHandle,
4
- type DocumentEditorProps,
5
- } from './DocumentEditor.js'
6
- export {
7
- buildAlignedLineDiff,
8
- type AlignedDiffLine,
9
- type AlignedDiffLineKind,
10
- type AlignedLineDiffResult,
11
- } from './alignedLineDiff.js'
12
- export {
13
- DocumentDiffView,
14
- type DocumentDiffViewProps,
15
- } from './DocumentDiffView.js'
16
- export {
17
- buildExtensions,
18
- type BuildExtensionsOptions,
19
- type EditorFeatures,
20
- } from './editorExtensions.js'
21
- export { useEditorExtensions } from './useEditorExtensions.js'
22
- export {
23
- resolveEditorContent,
24
- type EditorInputFormat,
25
- } from './contentFormat.js'
26
- export { toHtml, toMd } from './utils/markdownUtils.js'
27
- export {
28
- insertInlineAssetKind,
29
- type InlineAssetInsertKind,
30
- } from './insertInlineAssetKind.js'
31
- export {
32
- MathEditing,
33
- openMathEditor,
34
- insertEditableInlineMath,
35
- insertEditableBlockMath,
36
- } from './extensions/mathEditing.js'
37
- export { COLLECTION_ASSET_SRC_ATTR } from './collectionAssetSrc.js'
38
- export { CollectionImage } from './extensions/collectionImage.js'
39
- export {
40
- createCollectionImagePasteExtension,
41
- type CollectionImagePasteExtensionOptions,
42
- type CollectionImagePastePayload,
43
- } from './extensions/collectionImagePaste.js'
44
- export {
45
- insertCollectionImage,
46
- insertCollectionImageFromBinaryResult,
47
- type InsertCollectionImageOptions,
48
- uint8ArrayToBase64,
49
- } from './insertCollectionImage.js'
50
- export type {
51
- EditorCommentPromptProps,
52
- EditorLinkPromptProps,
53
- EditorToolbarOverlays,
54
- } from './toolbar/overlayTypes.js'
55
-
56
- export { CommentMark } from './extensions/commentMark.js'
57
- export { AppliedChangeMark } from './extensions/appliedChangeMark.js'
58
- export {
59
- AutoReviewPrompts,
60
- AUTO_CLAIM_REVIEW_PROMPT,
61
- AUTO_FACT_CHECK_REVIEW_PROMPT,
62
- EDITORIAL_FRAMEWORK,
63
- applyAutoReviewFindings,
64
- buildAutoReviewPromptBundle,
65
- buildAutoReviewPrompt,
66
- collectAutoReviewParagraphs,
67
- collectScopedAutoReviewParagraphs,
68
- copyAutoReviewPromptsToClipboard,
69
- enabledEditorialTypesForProcess,
70
- parseAutoReviewFindingResponse,
71
- runAutoReview,
72
- validateAutoReviewFindings,
73
- type AppliedAutoReviewFinding,
74
- type ApplyAutoReviewFindingsOptions,
75
- type AutoReviewFindingInput,
76
- type AutoReviewFindingsProvider,
77
- type AutoReviewFindingsProviderRequest,
78
- type AutoReviewFindingResponse,
79
- type AutoReviewFindingSeverity,
80
- type AutoReviewParagraph,
81
- type AutoReviewPromptKind,
82
- type CopyAutoReviewPromptsResult,
83
- type EditorialAnnotationType,
84
- type EditorialDensity,
85
- type EditorialFrameworkEntry,
86
- type EditorialGenreMode,
87
- type EditorialProcess,
88
- type EditorialScope,
89
- type EditorialStrictness,
90
- type RunAutoReviewOptions,
91
- type RunAutoReviewResult,
92
- type ValidatedAutoReviewFinding,
93
- } from './extensions/autoReviewPrompts.js'
94
- export {
95
- applyCommentReplacementById,
96
- COMMENT_TYPES,
97
- COMMENT_REVIEW_STATUSES,
98
- COMMENT_SEVERITIES,
99
- COMMENT_STATUS_LABELS,
100
- COMMENT_TYPE_DEFINITIONS,
101
- COMMENT_TYPE_LABELS,
102
- defaultCommentReviewStatusForType,
103
- defaultCommentSeverityForType,
104
- normalizeCommentReviewStatus,
105
- normalizeCommentSeverity,
106
- normalizeCommentType,
107
- type CommentMarkAttrPatch,
108
- parseCommentReplies,
109
- removeCommentMarksById,
110
- updateCommentMarksById,
111
- serializeCommentReplies,
112
- type CommentReply,
113
- type CommentReviewStatus,
114
- type CommentSeverity,
115
- type CommentType,
116
- } from './commentUtils.js'
117
- export { DocumentAssetIdentity } from './extensions/documentAssetIdentity.js'
118
- export { Figure } from './extensions/figure.js'
119
- export { Footnote } from './extensions/footnote.js'
120
- export { IndexMarker } from './extensions/indexMarker.js'
121
- export { MermaidBlock } from './extensions/mermaidBlock.js'
122
- export {
123
- expandMermaidBlocksForPrint,
124
- extractMermaidSourceFromHtml,
125
- renderMermaidPreviewSvg,
126
- type ExpandMermaidBlocksOptions,
127
- type MermaidPreviewTheme,
128
- type RenderMermaidPreviewSvgOptions,
129
- } from './mermaidPreview.js'
130
- export { SmartTypography } from './extensions/smartTypography.js'
131
- export {
132
- SlashCommands,
133
- createDefaultSlashCommands,
134
- type SlashCommandItem,
135
- type SlashCommandRange,
136
- type SlashCommandRunOptions,
137
- } from './extensions/slashCommands.js'
1
+ export {
2
+ DocumentEditor,
3
+ type DocumentEditorHandle,
4
+ type DocumentEditorProps,
5
+ } from './DocumentEditor.js'
6
+ export {
7
+ buildAlignedLineDiff,
8
+ type AlignedDiffLine,
9
+ type AlignedDiffLineKind,
10
+ type AlignedLineDiffResult,
11
+ } from './alignedLineDiff.js'
12
+ export {
13
+ DocumentDiffView,
14
+ type DocumentDiffViewProps,
15
+ } from './DocumentDiffView.js'
16
+ export {
17
+ buildExtensions,
18
+ type BuildExtensionsOptions,
19
+ type EditorFeatures,
20
+ } from './editorExtensions.js'
21
+ export { useEditorExtensions } from './useEditorExtensions.js'
22
+ export {
23
+ resolveEditorContent,
24
+ type EditorInputFormat,
25
+ } from './contentFormat.js'
26
+ export { toHtml, toMd } from './utils/markdownUtils.js'
27
+ export {
28
+ insertInlineAssetKind,
29
+ type InlineAssetInsertKind,
30
+ } from './insertInlineAssetKind.js'
31
+ export {
32
+ MathEditing,
33
+ openMathEditor,
34
+ insertEditableInlineMath,
35
+ insertEditableBlockMath,
36
+ } from './extensions/mathEditing.js'
37
+ export { COLLECTION_ASSET_SRC_ATTR } from './collectionAssetSrc.js'
38
+ export { CollectionImage } from './extensions/collectionImage.js'
39
+ export {
40
+ createCollectionImagePasteExtension,
41
+ type CollectionImagePasteExtensionOptions,
42
+ type CollectionImagePastePayload,
43
+ } from './extensions/collectionImagePaste.js'
44
+ export {
45
+ insertCollectionImage,
46
+ insertCollectionImageFromBinaryResult,
47
+ type InsertCollectionImageOptions,
48
+ uint8ArrayToBase64,
49
+ } from './insertCollectionImage.js'
50
+ export type {
51
+ EditorCommentPromptProps,
52
+ EditorLinkPromptProps,
53
+ EditorToolbarOverlays,
54
+ } from './toolbar/overlayTypes.js'
55
+ export { ToolbarInlineToolButton } from './toolbar/ToolBtn.js'
56
+
57
+ export { CommentMark } from './extensions/commentMark.js'
58
+ export { AppliedChangeMark } from './extensions/appliedChangeMark.js'
59
+ export {
60
+ AutoReviewPrompts,
61
+ AUTO_CLAIM_REVIEW_PROMPT,
62
+ AUTO_FACT_CHECK_REVIEW_PROMPT,
63
+ EDITORIAL_FRAMEWORK,
64
+ applyAutoReviewFindings,
65
+ buildAutoReviewPromptBundle,
66
+ buildAutoReviewPrompt,
67
+ collectAutoReviewParagraphs,
68
+ collectScopedAutoReviewParagraphs,
69
+ copyAutoReviewPromptsToClipboard,
70
+ enabledEditorialTypesForProcess,
71
+ parseAutoReviewFindingResponse,
72
+ runAutoReview,
73
+ validateAutoReviewFindings,
74
+ type AppliedAutoReviewFinding,
75
+ type ApplyAutoReviewFindingsOptions,
76
+ type AutoReviewFindingInput,
77
+ type AutoReviewFindingsProvider,
78
+ type AutoReviewFindingsProviderRequest,
79
+ type AutoReviewFindingResponse,
80
+ type AutoReviewFindingSeverity,
81
+ type AutoReviewParagraph,
82
+ type AutoReviewPromptKind,
83
+ type CopyAutoReviewPromptsResult,
84
+ type EditorialAnnotationType,
85
+ type EditorialDensity,
86
+ type EditorialFrameworkEntry,
87
+ type EditorialGenreMode,
88
+ type EditorialProcess,
89
+ type EditorialScope,
90
+ type EditorialStrictness,
91
+ type RunAutoReviewOptions,
92
+ type RunAutoReviewResult,
93
+ type ValidatedAutoReviewFinding,
94
+ } from './extensions/autoReviewPrompts.js'
95
+ export {
96
+ applyCommentReplacementById,
97
+ COMMENT_TYPES,
98
+ COMMENT_REVIEW_STATUSES,
99
+ COMMENT_SEVERITIES,
100
+ COMMENT_STATUS_LABELS,
101
+ COMMENT_TYPE_DEFINITIONS,
102
+ COMMENT_TYPE_LABELS,
103
+ defaultCommentReviewStatusForType,
104
+ defaultCommentSeverityForType,
105
+ normalizeCommentReviewStatus,
106
+ normalizeCommentSeverity,
107
+ normalizeCommentType,
108
+ type CommentMarkAttrPatch,
109
+ parseCommentReplies,
110
+ removeCommentMarksById,
111
+ updateCommentMarksById,
112
+ serializeCommentReplies,
113
+ type CommentReply,
114
+ type CommentReviewStatus,
115
+ type CommentSeverity,
116
+ type CommentType,
117
+ } from './commentUtils.js'
118
+ export { DocumentAssetIdentity } from './extensions/documentAssetIdentity.js'
119
+ export { Figure } from './extensions/figure.js'
120
+ export { Footnote } from './extensions/footnote.js'
121
+ export { IndexMarker } from './extensions/indexMarker.js'
122
+ export { MermaidBlock } from './extensions/mermaidBlock.js'
123
+ export {
124
+ expandMermaidBlocksForPrint,
125
+ extractMermaidSourceFromHtml,
126
+ renderMermaidPreviewSvg,
127
+ type ExpandMermaidBlocksOptions,
128
+ type MermaidPreviewTheme,
129
+ type RenderMermaidPreviewSvgOptions,
130
+ } from './mermaidPreview.js'
131
+ export { SmartTypography } from './extensions/smartTypography.js'
132
+ export {
133
+ SlashCommands,
134
+ createDefaultSlashCommands,
135
+ type SlashCommandItem,
136
+ type SlashCommandRange,
137
+ type SlashCommandRunOptions,
138
+ } from './extensions/slashCommands.js'