@tickernelz/paperclip-pro-server 2026.926.2 → 2026.926.4

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 (106) hide show
  1. package/dist/build-info.json +1 -1
  2. package/dist/routes/agents.d.ts.map +1 -1
  3. package/dist/routes/agents.js +18 -4
  4. package/dist/routes/agents.js.map +1 -1
  5. package/dist/routes/issues.d.ts.map +1 -1
  6. package/dist/routes/issues.js +7 -0
  7. package/dist/routes/issues.js.map +1 -1
  8. package/dist/routes/openapi.d.ts.map +1 -1
  9. package/dist/routes/openapi.js +21 -8
  10. package/dist/routes/openapi.js.map +1 -1
  11. package/dist/routes/paperclip-mcp.d.ts.map +1 -1
  12. package/dist/routes/paperclip-mcp.js +23 -2
  13. package/dist/routes/paperclip-mcp.js.map +1 -1
  14. package/dist/services/issues.d.ts +5 -0
  15. package/dist/services/issues.d.ts.map +1 -1
  16. package/dist/services/issues.js +15 -1
  17. package/dist/services/issues.js.map +1 -1
  18. package/node_modules/micromark/dev/lib/compile.d.ts.map +1 -1
  19. package/node_modules/micromark/dev/lib/compile.js +14 -4
  20. package/node_modules/micromark/dev/lib/create-tokenizer.d.ts.map +1 -1
  21. package/node_modules/micromark/dev/lib/create-tokenizer.js +7 -6
  22. package/node_modules/micromark/dev/lib/initialize/document.js +25 -21
  23. package/node_modules/micromark/dev/lib/initialize/text.d.ts.map +1 -1
  24. package/node_modules/micromark/dev/lib/initialize/text.js +10 -6
  25. package/node_modules/micromark/dev/lib/preprocess.d.ts.map +1 -1
  26. package/node_modules/micromark/dev/lib/preprocess.js +19 -21
  27. package/node_modules/micromark/lib/compile.d.ts.map +1 -1
  28. package/node_modules/micromark/lib/compile.js +37 -29
  29. package/node_modules/micromark/lib/create-tokenizer.d.ts.map +1 -1
  30. package/node_modules/micromark/lib/create-tokenizer.js +37 -35
  31. package/node_modules/micromark/lib/initialize/document.js +21 -13
  32. package/node_modules/micromark/lib/initialize/text.d.ts.map +1 -1
  33. package/node_modules/micromark/lib/initialize/text.js +7 -3
  34. package/node_modules/micromark/lib/preprocess.d.ts.map +1 -1
  35. package/node_modules/micromark/lib/preprocess.js +16 -19
  36. package/node_modules/micromark/package.json +2 -15
  37. package/node_modules/micromark-core-commonmark/dev/lib/attention.js +18 -24
  38. package/node_modules/micromark-core-commonmark/dev/lib/code-fenced.d.ts.map +1 -1
  39. package/node_modules/micromark-core-commonmark/dev/lib/code-fenced.js +1 -43
  40. package/node_modules/micromark-core-commonmark/dev/lib/code-indented.js +19 -43
  41. package/node_modules/micromark-core-commonmark/dev/lib/heading-atx.js +2 -6
  42. package/node_modules/micromark-core-commonmark/dev/lib/html-flow.d.ts.map +1 -1
  43. package/node_modules/micromark-core-commonmark/dev/lib/html-flow.js +2 -53
  44. package/node_modules/micromark-core-commonmark/dev/lib/label-end.js +14 -12
  45. package/node_modules/micromark-core-commonmark/dev/lib/label-start-image.d.ts.map +1 -1
  46. package/node_modules/micromark-core-commonmark/dev/lib/label-start-image.js +14 -5
  47. package/node_modules/micromark-core-commonmark/dev/lib/label-start-link.d.ts.map +1 -1
  48. package/node_modules/micromark-core-commonmark/dev/lib/label-start-link.js +14 -5
  49. package/node_modules/micromark-core-commonmark/dev/lib/partial-non-lazy-continuation.d.ts +4 -0
  50. package/node_modules/micromark-core-commonmark/dev/lib/partial-non-lazy-continuation.d.ts.map +1 -0
  51. package/node_modules/micromark-core-commonmark/dev/lib/partial-non-lazy-continuation.js +67 -0
  52. package/node_modules/micromark-core-commonmark/dev/lib/setext-underline.d.ts.map +1 -1
  53. package/node_modules/micromark-core-commonmark/dev/lib/setext-underline.js +8 -5
  54. package/node_modules/micromark-core-commonmark/lib/attention.js +14 -24
  55. package/node_modules/micromark-core-commonmark/lib/code-fenced.d.ts.map +1 -1
  56. package/node_modules/micromark-core-commonmark/lib/code-fenced.js +1 -39
  57. package/node_modules/micromark-core-commonmark/lib/code-indented.js +11 -29
  58. package/node_modules/micromark-core-commonmark/lib/heading-atx.js +2 -6
  59. package/node_modules/micromark-core-commonmark/lib/html-flow.d.ts.map +1 -1
  60. package/node_modules/micromark-core-commonmark/lib/html-flow.js +2 -51
  61. package/node_modules/micromark-core-commonmark/lib/label-end.js +11 -10
  62. package/node_modules/micromark-core-commonmark/lib/label-start-image.d.ts.map +1 -1
  63. package/node_modules/micromark-core-commonmark/lib/label-start-image.js +11 -3
  64. package/node_modules/micromark-core-commonmark/lib/label-start-link.d.ts.map +1 -1
  65. package/node_modules/micromark-core-commonmark/lib/label-start-link.js +11 -3
  66. package/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.d.ts +4 -0
  67. package/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.d.ts.map +1 -0
  68. package/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.js +61 -0
  69. package/node_modules/micromark-core-commonmark/lib/setext-underline.d.ts.map +1 -1
  70. package/node_modules/micromark-core-commonmark/lib/setext-underline.js +7 -5
  71. package/node_modules/micromark-core-commonmark/package.json +4 -16
  72. package/node_modules/micromark-factory-space/dev/index.d.ts +24 -1
  73. package/node_modules/micromark-factory-space/dev/index.d.ts.map +1 -1
  74. package/node_modules/micromark-factory-space/dev/index.js +58 -3
  75. package/node_modules/micromark-factory-space/index.d.ts +24 -1
  76. package/node_modules/micromark-factory-space/index.d.ts.map +1 -1
  77. package/node_modules/micromark-factory-space/index.js +55 -3
  78. package/node_modules/micromark-factory-space/package.json +1 -10
  79. package/node_modules/micromark-factory-space/readme.md +25 -25
  80. package/node_modules/micromark-util-edit-map/dev/index.d.ts +78 -0
  81. package/node_modules/micromark-util-edit-map/dev/index.d.ts.map +1 -0
  82. package/node_modules/micromark-util-edit-map/dev/index.js +237 -0
  83. package/node_modules/micromark-util-edit-map/index.d.ts +78 -0
  84. package/node_modules/micromark-util-edit-map/index.d.ts.map +1 -0
  85. package/node_modules/micromark-util-edit-map/index.js +225 -0
  86. package/node_modules/micromark-util-edit-map/license +22 -0
  87. package/node_modules/micromark-util-edit-map/package.json +48 -0
  88. package/node_modules/micromark-util-edit-map/readme.md +234 -0
  89. package/node_modules/micromark-util-types/index.d.ts +6 -3
  90. package/node_modules/micromark-util-types/package.json +2 -36
  91. package/node_modules/ws/lib/websocket.js +17 -3
  92. package/node_modules/ws/package.json +1 -1
  93. package/package.json +20 -20
  94. package/skills/paperclip/references/api-reference.md +2 -2
  95. package/ui-dist/assets/{Agents.production-5Tba_pW_.js → Agents.production-DYgcR2ZQ.js} +2 -2
  96. package/ui-dist/assets/{CompanyActivity.production-CONFWTe1.js → CompanyActivity.production-MiS7fCCl.js} +1 -1
  97. package/ui-dist/assets/{CompanyExport-CiOVCS4y.js → CompanyExport-C-7PQaz8.js} +1 -1
  98. package/ui-dist/assets/{CompanySkills.production-gv4ej6PI.js → CompanySkills.production-D3xms9bg.js} +1 -1
  99. package/ui-dist/assets/{Costs.production-C6rOIGNV.js → Costs.production-DdIIwVUT.js} +1 -1
  100. package/ui-dist/assets/{OrgChart.production-DYeuFtY_.js → OrgChart.production-hVW6TgEL.js} +1 -1
  101. package/ui-dist/assets/{RoutineDetail.production-Bt4IHfSD.js → RoutineDetail.production-MBJ3aeg2.js} +1 -1
  102. package/ui-dist/assets/{Routines.production-BBxSwg2A.js → Routines.production-LQRGr5dX.js} +1 -1
  103. package/ui-dist/assets/{definition-B49KTmLW.js → definition-INtTKxdn.js} +1 -1
  104. package/ui-dist/assets/{index-BRCs87uX.js → index-DbWxivZc.js} +161 -161
  105. package/ui-dist/index.html +1 -1
  106. package/ui-dist/sw.js +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["compile.js"],"names":[],"mappings":"AA6DA;;;GAGG;AACH,kCAHW,cAAc,GAAG,IAAI,GAAG,SAAS,GAC/B,OAAO,CAgkCnB;;YA/lCa,OAAO,GAAG,SAAS;cACnB,MAAM,GAAG,SAAS;YAClB,MAAM,GAAG,SAAS;kBAClB,MAAM,GAAG,SAAS;kBAClB,MAAM,GAAG,SAAS;YAClB,MAAM,GAAG,SAAS;;oCAVtB,sBAAsB;6BAAtB,sBAAsB"}
1
+ {"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["compile.js"],"names":[],"mappings":"AA6DA;;;GAGG;AACH,kCAHW,cAAc,GAAG,IAAI,GAAG,SAAS,GAC/B,OAAO,CA0kCnB;;YAzmCa,OAAO,GAAG,SAAS;cACnB,MAAM,GAAG,SAAS;YAClB,MAAM,GAAG,SAAS;kBAClB,MAAM,GAAG,SAAS;kBAClB,MAAM,GAAG,SAAS;YAClB,MAAM,GAAG,SAAS;;oCAVtB,sBAAsB;6BAAtB,sBAAsB"}
@@ -364,7 +364,7 @@ export function compile(options) {
364
364
  } else {
365
365
  containerBalance--
366
366
  }
367
- } else
367
+ } else {
368
368
  switch (event[1].type) {
369
369
  case types.listItemPrefix: {
370
370
  if (event[0] === 'exit') {
@@ -396,6 +396,7 @@ export function compile(options) {
396
396
  atMarker = undefined
397
397
  }
398
398
  }
399
+ }
399
400
  }
400
401
 
401
402
  slice[0][1]._loose = loose
@@ -431,7 +432,10 @@ export function compile(options) {
431
432
 
432
433
  /** @type {CompileContext['tag']} */
433
434
  function tag(value) {
434
- if (!tags) return
435
+ if (!tags) {
436
+ return
437
+ }
438
+
435
439
  setData('lastWasTag', true)
436
440
  buffers[buffers.length - 1].push(value)
437
441
  }
@@ -689,7 +693,10 @@ export function compile(options) {
689
693
  }
690
694
 
691
695
  tag('</code></pre>')
692
- if (count !== undefined && count < 2) lineEndingIfNeeded()
696
+ if (count !== undefined && count < 2) {
697
+ lineEndingIfNeeded()
698
+ }
699
+
693
700
  setData('flowCodeSeenData')
694
701
  setData('fencesCount')
695
702
  setData('slurpOneLineEnding')
@@ -909,7 +916,10 @@ export function compile(options) {
909
916
  */
910
917
  function onexitatxheadingsequence(token) {
911
918
  // Exit for further sequences.
912
- if (getData('headingRank')) return
919
+ if (getData('headingRank')) {
920
+ return
921
+ }
922
+
913
923
  setData('headingRank', this.sliceSerialize(token).length)
914
924
  lineEndingIfNeeded()
915
925
  tag('<h' + getData('headingRank') + '>')
@@ -1 +1 @@
1
- {"version":3,"file":"create-tokenizer.d.ts","sourceRoot":"","sources":["create-tokenizer.js"],"names":[],"mappings":"AAgDA;;;;;;;;;;;;;;;;;GAiBG;AACH,wCATW,YAAY,cAEZ,gBAAgB,SAEhB,IAAI,CAAC,KAAK,EAAE,cAAc,GAAG,QAAQ,CAAC,GAAG,SAAS,GAEhD,eAAe,CAwhB3B;;;;4BApkBY,SAAS;;;;;;;;aAKR,OAAO;;;;UAEP,MAAM;;;;;uCAKT,SAAS,QAET,IAAI,KAEF,SAAS;kCAtBZ,sBAAsB;sCAAtB,sBAAsB;2BAAtB,sBAAsB;qCAAtB,sBAAsB;+BAAtB,sBAAsB"}
1
+ {"version":3,"file":"create-tokenizer.d.ts","sourceRoot":"","sources":["create-tokenizer.js"],"names":[],"mappings":"AAgDA;;;;;;;;;;;;;;;;;GAiBG;AACH,wCATW,YAAY,cAEZ,gBAAgB,SAEhB,IAAI,CAAC,KAAK,EAAE,cAAc,GAAG,QAAQ,CAAC,GAAG,SAAS,GAEhD,eAAe,CAqhB3B;;;;4BAjkBY,SAAS;;;;;;;;aAKR,OAAO;;;;UAEP,MAAM;;;;;uCAKT,SAAS,QAET,IAAI,KAEF,SAAS;kCAtBZ,sBAAsB;sCAAtB,sBAAsB;2BAAtB,sBAAsB;qCAAtB,sBAAsB;+BAAtB,sBAAsB"}
@@ -199,15 +199,12 @@ export function createTokenizer(parser, initialize, from) {
199
199
  * Nothing.
200
200
  */
201
201
  function main() {
202
- /** @type {number} */
203
- let chunkIndex
204
-
205
202
  while (point._index < chunks.length) {
206
203
  const chunk = chunks[point._index]
207
204
 
208
205
  // If we’re in a buffer chunk, loop through it.
209
206
  if (typeof chunk === 'string') {
210
- chunkIndex = point._index
207
+ const chunkIndex = point._index
211
208
 
212
209
  if (point._bufferIndex < 0) {
213
210
  point._bufferIndex = 0
@@ -669,7 +666,7 @@ function serializeChunks(chunks, expandTabs) {
669
666
 
670
667
  if (typeof chunk === 'string') {
671
668
  value = chunk
672
- } else
669
+ } else {
673
670
  switch (chunk) {
674
671
  case codes.carriageReturn: {
675
672
  value = values.cr
@@ -696,7 +693,10 @@ function serializeChunks(chunks, expandTabs) {
696
693
  }
697
694
 
698
695
  case codes.virtualSpace: {
699
- if (!expandTabs && atTab) continue
696
+ if (!expandTabs && atTab) {
697
+ continue
698
+ }
699
+
700
700
  value = values.space
701
701
 
702
702
  break
@@ -708,6 +708,7 @@ function serializeChunks(chunks, expandTabs) {
708
708
  value = String.fromCharCode(chunk)
709
709
  }
710
710
  }
711
+ }
711
712
 
712
713
  atTab = chunk === codes.horizontalTab
713
714
  result.push(value)
@@ -20,7 +20,7 @@
20
20
  import {ok as assert} from 'devlop'
21
21
  import {factorySpace} from 'micromark-factory-space'
22
22
  import {markdownLineEnding} from 'micromark-util-character'
23
- import {splice} from 'micromark-util-chunked'
23
+ import {EditMap} from 'micromark-util-edit-map'
24
24
  import {codes, constants, types} from 'micromark-util-symbol'
25
25
 
26
26
  /** @type {InitialConstruct} */
@@ -128,16 +128,12 @@ function initializeDocument(effects) {
128
128
  index++
129
129
  }
130
130
 
131
+ const editMap = new EditMap()
131
132
  // Inject the exits earlier (they’re still also at the end).
132
- splice(
133
- self.events,
134
- indexBeforeFlow + 1,
135
- 0,
136
- self.events.slice(indexBeforeExits)
137
- )
138
-
133
+ editMap.add(indexBeforeFlow + 1, 0, self.events.slice(indexBeforeExits))
139
134
  // Discard the duplicate exits.
140
- self.events.length = index
135
+ editMap.add(indexBeforeExits, index - indexBeforeExits, [])
136
+ editMap.consume(self.events)
141
137
 
142
138
  return checkNewContainers(code)
143
139
  }
@@ -188,7 +184,10 @@ function initializeDocument(effects) {
188
184
 
189
185
  /** @type {State} */
190
186
  function thereIsANewContainer(code) {
191
- if (childFlow) closeFlow()
187
+ if (childFlow) {
188
+ closeFlow()
189
+ }
190
+
192
191
  exitContainers(continued)
193
192
  return documentContinued(code)
194
193
  }
@@ -230,7 +229,10 @@ function initializeDocument(effects) {
230
229
  /** @type {State} */
231
230
  function flowStart(code) {
232
231
  if (code === codes.eof) {
233
- if (childFlow) closeFlow()
232
+ if (childFlow) {
233
+ closeFlow()
234
+ }
235
+
234
236
  exitContainers(0)
235
237
  effects.consume(code)
236
238
  return
@@ -279,9 +281,15 @@ function initializeDocument(effects) {
279
281
  function writeToChild(token, endOfFile) {
280
282
  assert(childFlow, 'expected `childFlow` to be defined when continuing')
281
283
  const stream = self.sliceStream(token)
282
- if (endOfFile) stream.push(null)
284
+ if (endOfFile) {
285
+ stream.push(null)
286
+ }
287
+
283
288
  token.previous = childToken
284
- if (childToken) childToken.next = token
289
+ if (childToken) {
290
+ childToken.next = token
291
+ }
292
+
285
293
  childToken = token
286
294
  childFlow.defineSkip(token.start)
287
295
  childFlow.write(stream)
@@ -373,16 +381,12 @@ function initializeDocument(effects) {
373
381
  index++
374
382
  }
375
383
 
384
+ const editMap = new EditMap()
376
385
  // Inject the exits earlier (they’re still also at the end).
377
- splice(
378
- self.events,
379
- indexBeforeFlow + 1,
380
- 0,
381
- self.events.slice(indexBeforeExits)
382
- )
383
-
386
+ editMap.add(indexBeforeFlow + 1, 0, self.events.slice(indexBeforeExits))
384
387
  // Discard the duplicate exits.
385
- self.events.length = index
388
+ editMap.add(indexBeforeExits, index - indexBeforeExits, [])
389
+ editMap.consume(self.events)
386
390
  }
387
391
  }
388
392
 
@@ -1 +1 @@
1
- {"version":3,"file":"text.d.ts","sourceRoot":"","sources":["text.js"],"names":[],"mappings":";;;AAeA,sCAAiD;AACjD,oCAA6C;8BARnC,sBAAsB;sCAAtB,sBAAsB"}
1
+ {"version":3,"file":"text.d.ts","sourceRoot":"","sources":["text.js"],"names":[],"mappings":";;;AAgBA,sCAAiD;AACjD,oCAA6C;8BATnC,sBAAsB;sCAAtB,sBAAsB"}
@@ -10,6 +10,7 @@
10
10
  */
11
11
 
12
12
  import {ok as assert} from 'devlop'
13
+ import {EditMap} from 'micromark-util-edit-map'
13
14
  import {codes, constants, types} from 'micromark-util-symbol'
14
15
 
15
16
  export const resolver = {resolveAll: createResolver()}
@@ -153,6 +154,7 @@ function createResolver(extraResolver) {
153
154
  * @type {Resolver}
154
155
  */
155
156
  function resolveAllLineSuffixes(events, context) {
157
+ const editMap = new EditMap()
156
158
  let eventIndex = 0 // Skip first.
157
159
 
158
160
  while (++eventIndex <= events.length) {
@@ -180,7 +182,10 @@ function resolveAllLineSuffixes(events, context) {
180
182
  bufferIndex--
181
183
  }
182
184
 
183
- if (bufferIndex) break
185
+ if (bufferIndex) {
186
+ break
187
+ }
188
+
184
189
  bufferIndex = -1
185
190
  }
186
191
  // Number
@@ -226,13 +231,10 @@ function resolveAllLineSuffixes(events, context) {
226
231
  if (data.start.offset === data.end.offset) {
227
232
  Object.assign(data, token)
228
233
  } else {
229
- events.splice(
230
- eventIndex,
231
- 0,
234
+ editMap.add(eventIndex, 0, [
232
235
  ['enter', token, context],
233
236
  ['exit', token, context]
234
- )
235
- eventIndex += 2
237
+ ])
236
238
  }
237
239
  }
238
240
 
@@ -240,5 +242,7 @@ function resolveAllLineSuffixes(events, context) {
240
242
  }
241
243
  }
242
244
 
245
+ editMap.consume(events)
246
+
243
247
  return events
244
248
  }
@@ -1 +1 @@
1
- {"version":3,"file":"preprocess.d.ts","sourceRoot":"","sources":["preprocess.js"],"names":[],"mappings":"AAqBA;;;GAGG;AACH,8BAHa,YAAY,CAsHxB;;;;mCArIU,KAAK,aAEL,QAAQ,GAAG,IAAI,GAAG,SAAS,QAE3B,OAAO,GAAG,IAAI,GAAG,SAAS,KAExB,KAAK,CAAC,KAAK,CAAC;2BAZsB,sBAAsB;8BAAtB,sBAAsB;2BAAtB,sBAAsB"}
1
+ {"version":3,"file":"preprocess.d.ts","sourceRoot":"","sources":["preprocess.js"],"names":[],"mappings":"AAqBA;;;GAGG;AACH,8BAHa,YAAY,CAoHxB;;;;mCAnIU,KAAK,aAEL,QAAQ,GAAG,IAAI,GAAG,SAAS,QAE3B,OAAO,GAAG,IAAI,GAAG,SAAS,KAExB,KAAK,CAAC,KAAK,CAAC;2BAZsB,sBAAsB;8BAAtB,sBAAsB;2BAAtB,sBAAsB"}
@@ -36,26 +36,15 @@ export function preprocess() {
36
36
  /** @type {Preprocessor} */
37
37
  // eslint-disable-next-line complexity
38
38
  function preprocessor(value, encoding, end) {
39
- /** @type {Array<Chunk>} */
40
- const chunks = []
41
- /** @type {RegExpMatchArray | null} */
42
- let match
43
- /** @type {number} */
44
- let next
45
- /** @type {number} */
46
- let startPosition
47
- /** @type {number} */
48
- let endPosition
49
- /** @type {Code} */
50
- let code
51
-
52
39
  value =
53
40
  buffer +
54
41
  (typeof value === 'string'
55
42
  ? value.toString()
56
43
  : new TextDecoder(encoding || undefined).decode(value))
57
44
 
58
- startPosition = 0
45
+ /** @type {Array<Chunk>} */
46
+ const chunks = []
47
+ let startPosition = 0
59
48
  buffer = ''
60
49
 
61
50
  if (start) {
@@ -69,10 +58,10 @@ export function preprocess() {
69
58
 
70
59
  while (startPosition < value.length) {
71
60
  search.lastIndex = startPosition
72
- match = search.exec(value)
73
- endPosition =
61
+ const match = search.exec(value)
62
+ const endPosition =
74
63
  match && match.index !== undefined ? match.index : value.length
75
- code = value.charCodeAt(endPosition)
64
+ const code = value.charCodeAt(endPosition)
76
65
 
77
66
  if (!match) {
78
67
  buffer = value.slice(startPosition)
@@ -106,9 +95,12 @@ export function preprocess() {
106
95
  }
107
96
 
108
97
  case codes.ht: {
109
- next = Math.ceil(column / constants.tabSize) * constants.tabSize
98
+ const next =
99
+ Math.ceil(column / constants.tabSize) * constants.tabSize
110
100
  chunks.push(codes.horizontalTab)
111
- while (column++ < next) chunks.push(codes.virtualSpace)
101
+ while (column++ < next) {
102
+ chunks.push(codes.virtualSpace)
103
+ }
112
104
 
113
105
  break
114
106
  }
@@ -131,8 +123,14 @@ export function preprocess() {
131
123
  }
132
124
 
133
125
  if (end) {
134
- if (atCarriageReturn) chunks.push(codes.carriageReturn)
135
- if (buffer) chunks.push(buffer)
126
+ if (atCarriageReturn) {
127
+ chunks.push(codes.carriageReturn)
128
+ }
129
+
130
+ if (buffer) {
131
+ chunks.push(buffer)
132
+ }
133
+
136
134
  chunks.push(codes.eof)
137
135
  }
138
136
 
@@ -1 +1 @@
1
- {"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["compile.js"],"names":[],"mappings":"AA6DA;;;GAGG;AACH,kCAHW,cAAc,GAAG,IAAI,GAAG,SAAS,GAC/B,OAAO,CAgkCnB;;YA/lCa,OAAO,GAAG,SAAS;cACnB,MAAM,GAAG,SAAS;YAClB,MAAM,GAAG,SAAS;kBAClB,MAAM,GAAG,SAAS;kBAClB,MAAM,GAAG,SAAS;YAClB,MAAM,GAAG,SAAS;;oCAVtB,sBAAsB;6BAAtB,sBAAsB"}
1
+ {"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["compile.js"],"names":[],"mappings":"AA6DA;;;GAGG;AACH,kCAHW,cAAc,GAAG,IAAI,GAAG,SAAS,GAC/B,OAAO,CA0kCnB;;YAzmCa,OAAO,GAAG,SAAS;cACnB,MAAM,GAAG,SAAS;YAClB,MAAM,GAAG,SAAS;kBAClB,MAAM,GAAG,SAAS;kBAClB,MAAM,GAAG,SAAS;YAClB,MAAM,GAAG,SAAS;;oCAVtB,sBAAsB;6BAAtB,sBAAsB"}
@@ -345,35 +345,37 @@ export function compile(options) {
345
345
  } else {
346
346
  containerBalance--;
347
347
  }
348
- } else switch (event[1].type) {
349
- case "listItemPrefix":
350
- {
351
- if (event[0] === 'exit') {
352
- atMarker = true;
348
+ } else {
349
+ switch (event[1].type) {
350
+ case "listItemPrefix":
351
+ {
352
+ if (event[0] === 'exit') {
353
+ atMarker = true;
354
+ }
355
+ break;
356
+ }
357
+ case "linePrefix":
358
+ {
359
+ // Ignore
360
+
361
+ break;
353
362
  }
354
- break;
355
- }
356
- case "linePrefix":
357
- {
358
- // Ignore
359
-
360
- break;
361
- }
362
- case "lineEndingBlank":
363
- {
364
- if (event[0] === 'enter' && !containerBalance) {
365
- if (atMarker) {
366
- atMarker = undefined;
367
- } else {
368
- loose = true;
363
+ case "lineEndingBlank":
364
+ {
365
+ if (event[0] === 'enter' && !containerBalance) {
366
+ if (atMarker) {
367
+ atMarker = undefined;
368
+ } else {
369
+ loose = true;
370
+ }
369
371
  }
372
+ break;
370
373
  }
371
- break;
372
- }
373
- default:
374
- {
375
- atMarker = undefined;
376
- }
374
+ default:
375
+ {
376
+ atMarker = undefined;
377
+ }
378
+ }
377
379
  }
378
380
  }
379
381
  slice[0][1]._loose = loose;
@@ -408,7 +410,9 @@ export function compile(options) {
408
410
 
409
411
  /** @type {CompileContext['tag']} */
410
412
  function tag(value) {
411
- if (!tags) return;
413
+ if (!tags) {
414
+ return;
415
+ }
412
416
  setData('lastWasTag', true);
413
417
  buffers[buffers.length - 1].push(value);
414
418
  }
@@ -645,7 +649,9 @@ export function compile(options) {
645
649
  lineEndingIfNeeded();
646
650
  }
647
651
  tag('</code></pre>');
648
- if (count !== undefined && count < 2) lineEndingIfNeeded();
652
+ if (count !== undefined && count < 2) {
653
+ lineEndingIfNeeded();
654
+ }
649
655
  setData('flowCodeSeenData');
650
656
  setData('fencesCount');
651
657
  setData('slurpOneLineEnding');
@@ -838,7 +844,9 @@ export function compile(options) {
838
844
  */
839
845
  function onexitatxheadingsequence(token) {
840
846
  // Exit for further sequences.
841
- if (getData('headingRank')) return;
847
+ if (getData('headingRank')) {
848
+ return;
849
+ }
842
850
  setData('headingRank', this.sliceSerialize(token).length);
843
851
  lineEndingIfNeeded();
844
852
  tag('<h' + getData('headingRank') + '>');
@@ -1 +1 @@
1
- {"version":3,"file":"create-tokenizer.d.ts","sourceRoot":"","sources":["create-tokenizer.js"],"names":[],"mappings":"AAgDA;;;;;;;;;;;;;;;;;GAiBG;AACH,wCATW,YAAY,cAEZ,gBAAgB,SAEhB,IAAI,CAAC,KAAK,EAAE,cAAc,GAAG,QAAQ,CAAC,GAAG,SAAS,GAEhD,eAAe,CAwhB3B;;;;4BApkBY,SAAS;;;;;;;;aAKR,OAAO;;;;UAEP,MAAM;;;;;uCAKT,SAAS,QAET,IAAI,KAEF,SAAS;kCAtBZ,sBAAsB;sCAAtB,sBAAsB;2BAAtB,sBAAsB;qCAAtB,sBAAsB;+BAAtB,sBAAsB"}
1
+ {"version":3,"file":"create-tokenizer.d.ts","sourceRoot":"","sources":["create-tokenizer.js"],"names":[],"mappings":"AAgDA;;;;;;;;;;;;;;;;;GAiBG;AACH,wCATW,YAAY,cAEZ,gBAAgB,SAEhB,IAAI,CAAC,KAAK,EAAE,cAAc,GAAG,QAAQ,CAAC,GAAG,SAAS,GAEhD,eAAe,CAqhB3B;;;;4BAjkBY,SAAS;;;;;;;;aAKR,OAAO;;;;UAEP,MAAM;;;;;uCAKT,SAAS,QAET,IAAI,KAEF,SAAS;kCAtBZ,sBAAsB;sCAAtB,sBAAsB;2BAAtB,sBAAsB;qCAAtB,sBAAsB;+BAAtB,sBAAsB"}
@@ -201,14 +201,12 @@ export function createTokenizer(parser, initialize, from) {
201
201
  * Nothing.
202
202
  */
203
203
  function main() {
204
- /** @type {number} */
205
- let chunkIndex;
206
204
  while (point._index < chunks.length) {
207
205
  const chunk = chunks[point._index];
208
206
 
209
207
  // If we’re in a buffer chunk, loop through it.
210
208
  if (typeof chunk === 'string') {
211
- chunkIndex = point._index;
209
+ const chunkIndex = point._index;
212
210
  if (point._bufferIndex < 0) {
213
211
  point._bufferIndex = 0;
214
212
  }
@@ -571,38 +569,42 @@ function serializeChunks(chunks, expandTabs) {
571
569
  let value;
572
570
  if (typeof chunk === 'string') {
573
571
  value = chunk;
574
- } else switch (chunk) {
575
- case -5:
576
- {
577
- value = "\r";
578
- break;
579
- }
580
- case -4:
581
- {
582
- value = "\n";
583
- break;
584
- }
585
- case -3:
586
- {
587
- value = "\r" + "\n";
588
- break;
589
- }
590
- case -2:
591
- {
592
- value = expandTabs ? " " : "\t";
593
- break;
594
- }
595
- case -1:
596
- {
597
- if (!expandTabs && atTab) continue;
598
- value = " ";
599
- break;
600
- }
601
- default:
602
- {
603
- // Currently only replacement character.
604
- value = String.fromCharCode(chunk);
605
- }
572
+ } else {
573
+ switch (chunk) {
574
+ case -5:
575
+ {
576
+ value = "\r";
577
+ break;
578
+ }
579
+ case -4:
580
+ {
581
+ value = "\n";
582
+ break;
583
+ }
584
+ case -3:
585
+ {
586
+ value = "\r" + "\n";
587
+ break;
588
+ }
589
+ case -2:
590
+ {
591
+ value = expandTabs ? " " : "\t";
592
+ break;
593
+ }
594
+ case -1:
595
+ {
596
+ if (!expandTabs && atTab) {
597
+ continue;
598
+ }
599
+ value = " ";
600
+ break;
601
+ }
602
+ default:
603
+ {
604
+ // Currently only replacement character.
605
+ value = String.fromCharCode(chunk);
606
+ }
607
+ }
606
608
  }
607
609
  atTab = chunk === -2;
608
610
  result.push(value);
@@ -19,7 +19,7 @@
19
19
 
20
20
  import { factorySpace } from 'micromark-factory-space';
21
21
  import { markdownLineEnding } from 'micromark-util-character';
22
- import { splice } from 'micromark-util-chunked';
22
+ import { EditMap } from 'micromark-util-edit-map';
23
23
  /** @type {InitialConstruct} */
24
24
  export const document = {
25
25
  tokenize: initializeDocument
@@ -108,12 +108,12 @@ function initializeDocument(effects) {
108
108
  };
109
109
  index++;
110
110
  }
111
-
111
+ const editMap = new EditMap();
112
112
  // Inject the exits earlier (they’re still also at the end).
113
- splice(self.events, indexBeforeFlow + 1, 0, self.events.slice(indexBeforeExits));
114
-
113
+ editMap.add(indexBeforeFlow + 1, 0, self.events.slice(indexBeforeExits));
115
114
  // Discard the duplicate exits.
116
- self.events.length = index;
115
+ editMap.add(indexBeforeExits, index - indexBeforeExits, []);
116
+ editMap.consume(self.events);
117
117
  return checkNewContainers(code);
118
118
  }
119
119
  return start(code);
@@ -156,7 +156,9 @@ function initializeDocument(effects) {
156
156
 
157
157
  /** @type {State} */
158
158
  function thereIsANewContainer(code) {
159
- if (childFlow) closeFlow();
159
+ if (childFlow) {
160
+ closeFlow();
161
+ }
160
162
  exitContainers(continued);
161
163
  return documentContinued(code);
162
164
  }
@@ -186,7 +188,9 @@ function initializeDocument(effects) {
186
188
  /** @type {State} */
187
189
  function flowStart(code) {
188
190
  if (code === null) {
189
- if (childFlow) closeFlow();
191
+ if (childFlow) {
192
+ closeFlow();
193
+ }
190
194
  exitContainers(0);
191
195
  effects.consume(code);
192
196
  return;
@@ -230,9 +234,13 @@ function initializeDocument(effects) {
230
234
  */
231
235
  function writeToChild(token, endOfFile) {
232
236
  const stream = self.sliceStream(token);
233
- if (endOfFile) stream.push(null);
237
+ if (endOfFile) {
238
+ stream.push(null);
239
+ }
234
240
  token.previous = childToken;
235
- if (childToken) childToken.next = token;
241
+ if (childToken) {
242
+ childToken.next = token;
243
+ }
236
244
  childToken = token;
237
245
  childFlow.defineSkip(token.start);
238
246
  childFlow.write(stream);
@@ -315,12 +323,12 @@ function initializeDocument(effects) {
315
323
  };
316
324
  index++;
317
325
  }
318
-
326
+ const editMap = new EditMap();
319
327
  // Inject the exits earlier (they’re still also at the end).
320
- splice(self.events, indexBeforeFlow + 1, 0, self.events.slice(indexBeforeExits));
321
-
328
+ editMap.add(indexBeforeFlow + 1, 0, self.events.slice(indexBeforeExits));
322
329
  // Discard the duplicate exits.
323
- self.events.length = index;
330
+ editMap.add(indexBeforeExits, index - indexBeforeExits, []);
331
+ editMap.consume(self.events);
324
332
  }
325
333
  }
326
334
 
@@ -1 +1 @@
1
- {"version":3,"file":"text.d.ts","sourceRoot":"","sources":["text.js"],"names":[],"mappings":";;;AAeA,sCAAiD;AACjD,oCAA6C;8BARnC,sBAAsB;sCAAtB,sBAAsB"}
1
+ {"version":3,"file":"text.d.ts","sourceRoot":"","sources":["text.js"],"names":[],"mappings":";;;AAgBA,sCAAiD;AACjD,oCAA6C;8BATnC,sBAAsB;sCAAtB,sBAAsB"}
@@ -9,6 +9,7 @@
9
9
  * } from 'micromark-util-types'
10
10
  */
11
11
 
12
+ import { EditMap } from 'micromark-util-edit-map';
12
13
  export const resolver = {
13
14
  resolveAll: createResolver()
14
15
  };
@@ -142,6 +143,7 @@ function createResolver(extraResolver) {
142
143
  * @type {Resolver}
143
144
  */
144
145
  function resolveAllLineSuffixes(events, context) {
146
+ const editMap = new EditMap();
145
147
  let eventIndex = 0; // Skip first.
146
148
 
147
149
  while (++eventIndex <= events.length) {
@@ -161,7 +163,9 @@ function resolveAllLineSuffixes(events, context) {
161
163
  size++;
162
164
  bufferIndex--;
163
165
  }
164
- if (bufferIndex) break;
166
+ if (bufferIndex) {
167
+ break;
168
+ }
165
169
  bufferIndex = -1;
166
170
  }
167
171
  // Number
@@ -201,12 +205,12 @@ function resolveAllLineSuffixes(events, context) {
201
205
  if (data.start.offset === data.end.offset) {
202
206
  Object.assign(data, token);
203
207
  } else {
204
- events.splice(eventIndex, 0, ['enter', token, context], ['exit', token, context]);
205
- eventIndex += 2;
208
+ editMap.add(eventIndex, 0, [['enter', token, context], ['exit', token, context]]);
206
209
  }
207
210
  }
208
211
  eventIndex++;
209
212
  }
210
213
  }
214
+ editMap.consume(events);
211
215
  return events;
212
216
  }
@@ -1 +1 @@
1
- {"version":3,"file":"preprocess.d.ts","sourceRoot":"","sources":["preprocess.js"],"names":[],"mappings":"AAqBA;;;GAGG;AACH,8BAHa,YAAY,CAsHxB;;;;mCArIU,KAAK,aAEL,QAAQ,GAAG,IAAI,GAAG,SAAS,QAE3B,OAAO,GAAG,IAAI,GAAG,SAAS,KAExB,KAAK,CAAC,KAAK,CAAC;2BAZsB,sBAAsB;8BAAtB,sBAAsB;2BAAtB,sBAAsB"}
1
+ {"version":3,"file":"preprocess.d.ts","sourceRoot":"","sources":["preprocess.js"],"names":[],"mappings":"AAqBA;;;GAGG;AACH,8BAHa,YAAY,CAoHxB;;;;mCAnIU,KAAK,aAEL,QAAQ,GAAG,IAAI,GAAG,SAAS,QAE3B,OAAO,GAAG,IAAI,GAAG,SAAS,KAExB,KAAK,CAAC,KAAK,CAAC;2BAZsB,sBAAsB;8BAAtB,sBAAsB;2BAAtB,sBAAsB"}