markloom 0.5.0 → 0.6.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 (67) hide show
  1. package/PACKAGES.md +26 -0
  2. package/README.md +20 -2
  3. package/collab.md +44 -7
  4. package/dist/ai/index.cjs +4 -4
  5. package/dist/ai/index.d.cts +5 -4
  6. package/dist/ai/index.d.ts +5 -4
  7. package/dist/ai/index.js +3 -3
  8. package/dist/ai/theme.css +66 -102
  9. package/dist/{chunk-YJAWPRJW.cjs → chunk-ACFYBYZJ.cjs} +2817 -903
  10. package/dist/chunk-CGYCJORO.js +759 -0
  11. package/dist/chunk-EADZKEU4.cjs +498 -0
  12. package/dist/chunk-EJSFZHGT.js +24 -0
  13. package/dist/{chunk-SLRD6FMP.cjs → chunk-I5VK4U7J.cjs} +122 -73
  14. package/dist/{chunk-WUHTCCAE.js → chunk-KYZJIOOL.js} +2403 -489
  15. package/dist/chunk-QEVME6ZU.cjs +759 -0
  16. package/dist/{chunk-MFYF2A6U.js → chunk-SNFF6X45.js} +51 -1
  17. package/dist/{chunk-JMOJU5EU.js → chunk-TB2OY3D4.js} +69 -20
  18. package/dist/{chunk-4TMHVNL6.cjs → chunk-TWD5T4YC.cjs} +155 -105
  19. package/dist/{chunk-JS527FDV.cjs → chunk-U3JZDFL4.cjs} +49 -9
  20. package/dist/{chunk-RLTHVQNQ.js → chunk-VSBIMMI7.js} +45 -5
  21. package/dist/chunk-YBAT343I.js +498 -0
  22. package/dist/chunk-ZKQSQSSM.cjs +24 -0
  23. package/dist/{client-BNams4wv.d.cts → client-CLYq17SW.d.ts} +70 -7
  24. package/dist/{client-A0ZQJnyR.d.ts → client-DAth8pPq.d.cts} +70 -7
  25. package/dist/collab/index.cjs +22 -4
  26. package/dist/collab/index.d.cts +24 -3
  27. package/dist/collab/index.d.ts +24 -3
  28. package/dist/collab/index.js +24 -6
  29. package/dist/{controller-BkY1VPzc.d.ts → controller-6AJ36G52.d.ts} +108 -8
  30. package/dist/{controller-CVIZI--A.d.cts → controller-BIOO_XKJ.d.cts} +108 -8
  31. package/dist/index.cjs +57 -7
  32. package/dist/index.d.cts +18 -5
  33. package/dist/index.d.ts +18 -5
  34. package/dist/index.js +54 -4
  35. package/dist/io/index.cjs +1413 -0
  36. package/dist/io/index.d.cts +33 -0
  37. package/dist/io/index.d.ts +33 -0
  38. package/dist/io/index.js +1413 -0
  39. package/dist/react/index.cjs +8 -8
  40. package/dist/react/index.d.cts +5 -4
  41. package/dist/react/index.d.ts +5 -4
  42. package/dist/react/index.js +7 -7
  43. package/dist/{rebase-batch-8rL_aXEE.d.ts → rebase-batch-DlerAcFN.d.ts} +11 -9
  44. package/dist/{rebase-batch-bYnBJpRO.d.cts → rebase-batch-PjENQ742.d.cts} +11 -9
  45. package/dist/suggest-Bk4zLzuv.d.ts +120 -0
  46. package/dist/suggest-BkGGiPKA.d.cts +120 -0
  47. package/dist/types-COUweEav.d.cts +30 -0
  48. package/dist/types-COUweEav.d.ts +30 -0
  49. package/dist/versions-9mG1epfB.d.cts +51 -0
  50. package/dist/versions-Bubyo4pt.d.ts +51 -0
  51. package/dist/view/index.cjs +56 -12
  52. package/dist/view/index.d.cts +203 -11
  53. package/dist/view/index.d.ts +203 -11
  54. package/dist/view/index.js +52 -8
  55. package/dist/view/theme.css +1840 -1526
  56. package/io.md +38 -0
  57. package/package.json +21 -5
  58. package/dist/chunk-6DCI7AL3.js +0 -208
  59. package/dist/chunk-AC5E42NH.cjs +0 -208
  60. package/dist/chunk-GQ2HHRGI.cjs +0 -16
  61. package/dist/chunk-LA5SBCGQ.js +0 -16
  62. package/dist/chunk-LEYAQNJA.js +0 -220
  63. package/dist/chunk-YXQDCW4Y.cjs +0 -220
  64. package/dist/comments-DlExS6f-.d.cts +0 -43
  65. package/dist/comments-PhnR7Gkn.d.ts +0 -43
  66. package/dist/step-BrvHIK7O.d.cts +0 -65
  67. package/dist/step-BrvHIK7O.d.ts +0 -65
package/dist/index.d.ts CHANGED
@@ -1,7 +1,9 @@
1
- import { E as ElementNode, P as Path, S as Step, N as Node, a as Position } from './step-BrvHIK7O.js';
2
- export { D as DeleteText, b as Doc, I as InsertText, M as Mark, R as ReplaceNode, c as Selection, d as SpliceChildren, T as TextNode, e as apply, f as applyAll, i as invert, g as invertAll, h as isElement, j as isInlineAtom, k as isText, m as moveBlock } from './step-BrvHIK7O.js';
3
- export { C as CommentAuthor, a as CommentMessage, b as CommentRenderState, c as CommentThread, d as Commit, H as History, e as amend, f as commentIdsInDoc, g as commit, i as init, r as redo, s as stripCommentMarks, u as undo } from './comments-PhnR7Gkn.js';
4
- export { B as Bias, m as makeBias, c as rebase, r as rebaseBatchOver, a as rebaseOne, b as rebaseStepsThrough, t as transformRemoteAgainstPending } from './rebase-batch-8rL_aXEE.js';
1
+ import { S as Step } from './versions-Bubyo4pt.js';
2
+ export { D as DeleteText, a as DocVersion, I as InsertText, R as ReplaceNode, b as SpliceChildren, c as apply, d as applyAll, g as getVersion, i as invert, e as invertAll, m as moveBlock, p as pushVersion, r as removeVersion, s as snapshotDoc } from './versions-Bubyo4pt.js';
3
+ import { E as ElementNode, P as Path, N as Node, a as Position } from './types-COUweEav.js';
4
+ export { D as Doc, M as Mark, S as Selection, T as TextNode, i as isElement, b as isInlineAtom, c as isText } from './types-COUweEav.js';
5
+ export { C as CommentAuthor, a as CommentMessage, b as CommentRenderState, c as CommentThread, d as Commit, H as History, S as SearchOpts, e as SuggestAuthor, f as SuggestHit, g as SuggestKind, T as TextMatch, h as acceptSuggestion, i as amend, j as applyForeign, k as applyReplaceAll, l as commentIdsInDoc, m as commit, n as dropSuggestText, o as findText, p as init, q as isSuggestMark, r as listSuggestions, s as markSuggestRange, t as rangeForDelete, u as rangeIsSuggestInsert, v as redo, w as rejectSuggestion, x as replaceAll, y as replaceMatch, z as stripCommentMarks, A as stripSuggestMarks, B as suggestIdsInDoc, D as suggestMark, E as undo } from './suggest-Bk4zLzuv.js';
6
+ export { B as Bias, m as makeBias, d as rebase, r as rebaseBatchOver, a as rebaseOne, b as rebaseStepsThrough, t as transformRemoteAgainstPending } from './rebase-batch-DlerAcFN.js';
5
7
 
6
8
  interface TableShape {
7
9
  rows: number;
@@ -87,6 +89,9 @@ declare const tableSchema: {
87
89
  declare function mdToDoc(md: string): ElementNode;
88
90
  declare function htmlToBlocks(html: string): ElementNode[] | null;
89
91
  declare function isRichHtmlBlocks(blocks: ElementNode[]): boolean;
92
+ declare function isPlainTransportHtml(blocks: ElementNode[]): boolean;
93
+ declare function mdStructureBeatsTransport(plain: string): boolean;
94
+ declare function preferMarkdownPaste(plain: string, htmlBlocks: ElementNode[]): boolean;
90
95
  declare function embedHtml(n: ElementNode): string;
91
96
  declare function tableHasExtras(n: ElementNode): boolean;
92
97
  declare function tableToHtml(n: ElementNode): string;
@@ -162,6 +167,14 @@ declare function mapSelection(step: Step, sel: {
162
167
  anchor: Position;
163
168
  head: Position;
164
169
  };
170
+ declare function mapSelectionThrough<S extends {
171
+ anchor: Position;
172
+ head: Position;
173
+ }>(sel: S | null | undefined, steps: readonly Step[]): S | undefined;
174
+ declare function resolveTxAfter<S extends {
175
+ anchor: Position;
176
+ head: Position;
177
+ }>(before: S | null | undefined, after: S | null | undefined, steps: readonly Step[], gaps?: readonly Step[]): S | undefined;
165
178
  declare function normalizePosition(doc: ElementNode, pos: Position): Position;
166
179
 
167
180
  interface DocStats {
@@ -179,4 +192,4 @@ interface TocEntry {
179
192
  }
180
193
  declare function outline(doc: ElementNode): TocEntry[];
181
194
 
182
- export { type DocStats, ElementNode, type Grid, type IdIndex, Node, type NodeChange, type NodeSpec, Path, Position, type Resolved, type Schema, Step, type TableShape, type TocEntry, type Violation, appendText, arrowCell, basicSchema, buildGrid, buildIdIndex, calloutToHtml, caretCell, cellCaret, cellText, checkSchema, checkTable, clearCells, colspanOf, deleteCol, deleteRow, deleteTableBlock, diffById, docStats, docToMd, embedHtml, firstLeafPath, firstViolation, hasSpan, htmlToBlocks, insertAfter, insertCol, insertRow, invariants, isRichHtmlBlocks, lastLeafEnd, makeTable, mapPosition, mapSelection, mdToDoc, mergeCells, moveCol, moveRow, nextCell, nodeAt, normalizePosition, normalizeToLeaf, outline, pathOfId, replaceAt, resolve, rewriteNode, rowspanOf, setAlign, setCellStyle, setColWidths, setFreeze, spliceAt, splitCell, tableAt, tableColWidths, tableHasExtras, tableSchema, tableShape, tableToHtml, validate, validateAll };
195
+ export { type DocStats, ElementNode, type Grid, type IdIndex, Node, type NodeChange, type NodeSpec, Path, Position, type Resolved, type Schema, Step, type TableShape, type TocEntry, type Violation, appendText, arrowCell, basicSchema, buildGrid, buildIdIndex, calloutToHtml, caretCell, cellCaret, cellText, checkSchema, checkTable, clearCells, colspanOf, deleteCol, deleteRow, deleteTableBlock, diffById, docStats, docToMd, embedHtml, firstLeafPath, firstViolation, hasSpan, htmlToBlocks, insertAfter, insertCol, insertRow, invariants, isPlainTransportHtml, isRichHtmlBlocks, lastLeafEnd, makeTable, mapPosition, mapSelection, mapSelectionThrough, mdStructureBeatsTransport, mdToDoc, mergeCells, moveCol, moveRow, nextCell, nodeAt, normalizePosition, normalizeToLeaf, outline, pathOfId, preferMarkdownPaste, replaceAt, resolve, resolveTxAfter, rewriteNode, rowspanOf, setAlign, setCellStyle, setColWidths, setFreeze, spliceAt, splitCell, tableAt, tableColWidths, tableHasExtras, tableSchema, tableShape, tableToHtml, validate, validateAll };
package/dist/index.js CHANGED
@@ -1,15 +1,35 @@
1
1
  import {
2
+ acceptSuggestion,
2
3
  amend,
4
+ applyForeign,
5
+ applyReplaceAll,
3
6
  commentIdsInDoc,
4
7
  commit,
8
+ dropSuggestText,
9
+ findText,
5
10
  firstViolation,
11
+ getVersion,
6
12
  init,
7
13
  invariants,
14
+ isSuggestMark,
15
+ listSuggestions,
16
+ markSuggestRange,
8
17
  outline,
18
+ pushVersion,
19
+ rangeForDelete,
20
+ rangeIsSuggestInsert,
9
21
  redo,
22
+ rejectSuggestion,
23
+ removeVersion,
24
+ replaceAll,
25
+ replaceMatch,
26
+ snapshotDoc,
10
27
  stripCommentMarks,
28
+ stripSuggestMarks,
29
+ suggestIdsInDoc,
30
+ suggestMark,
11
31
  undo
12
- } from "./chunk-LEYAQNJA.js";
32
+ } from "./chunk-CGYCJORO.js";
13
33
  import {
14
34
  appendText,
15
35
  apply,
@@ -40,9 +60,11 @@ import {
40
60
  insertRow,
41
61
  invert,
42
62
  invertAll,
63
+ isPlainTransportHtml,
43
64
  isRichHtmlBlocks,
44
65
  lastLeafEnd,
45
66
  makeTable,
67
+ mdStructureBeatsTransport,
46
68
  mdToDoc,
47
69
  mergeCells,
48
70
  moveBlock,
@@ -52,6 +74,7 @@ import {
52
74
  nodeAt,
53
75
  normalizeToLeaf,
54
76
  pathOfId,
77
+ preferMarkdownPaste,
55
78
  replaceAt,
56
79
  resolve,
57
80
  rewriteNode,
@@ -70,23 +93,25 @@ import {
70
93
  tableToHtml,
71
94
  validate,
72
95
  validateAll
73
- } from "./chunk-MFYF2A6U.js";
96
+ } from "./chunk-SNFF6X45.js";
74
97
  import {
75
98
  makeBias,
76
99
  mapPosition,
77
100
  mapSelection,
101
+ mapSelectionThrough,
78
102
  normalizePosition,
79
103
  rebase,
80
104
  rebaseBatchOver,
81
105
  rebaseOne,
82
106
  rebaseStepsThrough,
107
+ resolveTxAfter,
83
108
  transformRemoteAgainstPending
84
- } from "./chunk-RLTHVQNQ.js";
109
+ } from "./chunk-VSBIMMI7.js";
85
110
  import {
86
111
  isElement,
87
112
  isInlineAtom,
88
113
  isText
89
- } from "./chunk-LA5SBCGQ.js";
114
+ } from "./chunk-EJSFZHGT.js";
90
115
 
91
116
  // src/tree/stats.ts
92
117
  function rawText(node) {
@@ -117,10 +142,13 @@ function docStats(doc) {
117
142
  return { chars: [...rawText(doc)].length, words: countWords(spacedText(doc)), blocks: doc.children.length };
118
143
  }
119
144
  export {
145
+ acceptSuggestion,
120
146
  amend,
121
147
  appendText,
122
148
  apply,
123
149
  applyAll,
150
+ applyForeign,
151
+ applyReplaceAll,
124
152
  arrowCell,
125
153
  basicSchema,
126
154
  buildGrid,
@@ -141,9 +169,12 @@ export {
141
169
  diffById,
142
170
  docStats,
143
171
  docToMd,
172
+ dropSuggestText,
144
173
  embedHtml,
174
+ findText,
145
175
  firstLeafPath,
146
176
  firstViolation,
177
+ getVersion,
147
178
  hasSpan,
148
179
  htmlToBlocks,
149
180
  init,
@@ -155,13 +186,19 @@ export {
155
186
  invertAll,
156
187
  isElement,
157
188
  isInlineAtom,
189
+ isPlainTransportHtml,
158
190
  isRichHtmlBlocks,
191
+ isSuggestMark,
159
192
  isText,
160
193
  lastLeafEnd,
194
+ listSuggestions,
161
195
  makeBias,
162
196
  makeTable,
163
197
  mapPosition,
164
198
  mapSelection,
199
+ mapSelectionThrough,
200
+ markSuggestRange,
201
+ mdStructureBeatsTransport,
165
202
  mdToDoc,
166
203
  mergeCells,
167
204
  moveBlock,
@@ -173,22 +210,35 @@ export {
173
210
  normalizeToLeaf,
174
211
  outline,
175
212
  pathOfId,
213
+ preferMarkdownPaste,
214
+ pushVersion,
215
+ rangeForDelete,
216
+ rangeIsSuggestInsert,
176
217
  rebase,
177
218
  rebaseBatchOver,
178
219
  rebaseOne,
179
220
  rebaseStepsThrough,
180
221
  redo,
222
+ rejectSuggestion,
223
+ removeVersion,
224
+ replaceAll,
181
225
  replaceAt,
226
+ replaceMatch,
182
227
  resolve,
228
+ resolveTxAfter,
183
229
  rewriteNode,
184
230
  rowspanOf,
185
231
  setAlign,
186
232
  setCellStyle,
187
233
  setColWidths,
188
234
  setFreeze,
235
+ snapshotDoc,
189
236
  spliceAt,
190
237
  splitCell,
191
238
  stripCommentMarks,
239
+ stripSuggestMarks,
240
+ suggestIdsInDoc,
241
+ suggestMark,
192
242
  tableAt,
193
243
  tableColWidths,
194
244
  tableHasExtras,