securemark 0.240.0 → 0.241.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 (89) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/design.md +2 -2
  3. package/dist/securemark.js +1260 -2745
  4. package/gulpfile.js +1 -1
  5. package/index.d.ts +0 -1
  6. package/package-lock.json +285 -160
  7. package/package.json +8 -8
  8. package/src/combinator/control/manipulation/fallback.ts +0 -1
  9. package/src/combinator/control/manipulation/indent.ts +3 -3
  10. package/src/combinator/data/parser/some.ts +28 -6
  11. package/src/combinator/data/parser.ts +21 -16
  12. package/src/debug.test.ts +1 -1
  13. package/src/parser/api/bind.test.ts +1 -1
  14. package/src/parser/api/parse.test.ts +7 -1
  15. package/src/parser/api/parse.ts +1 -1
  16. package/src/parser/block/blockquote.ts +1 -1
  17. package/src/parser/block/codeblock.ts +1 -1
  18. package/src/parser/block/dlist.ts +1 -1
  19. package/src/parser/block/extension/aside.ts +1 -1
  20. package/src/parser/block/extension/example.ts +1 -1
  21. package/src/parser/block/extension/figbase.ts +1 -1
  22. package/src/parser/block/extension/figure.ts +21 -20
  23. package/src/parser/block/extension/message.ts +1 -1
  24. package/src/parser/block/extension/placeholder.ts +1 -1
  25. package/src/parser/block/extension/table.test.ts +1 -1
  26. package/src/parser/block/extension/table.ts +1 -1
  27. package/src/parser/block/heading.ts +1 -1
  28. package/src/parser/block/horizontalrule.ts +1 -1
  29. package/src/parser/block/ilist.ts +1 -1
  30. package/src/parser/block/mathblock.ts +1 -1
  31. package/src/parser/block/olist.ts +8 -8
  32. package/src/parser/block/paragraph.ts +1 -1
  33. package/src/parser/block/reply/cite.ts +1 -1
  34. package/src/parser/block/reply/quote.ts +1 -1
  35. package/src/parser/block/reply.ts +1 -1
  36. package/src/parser/block/table.ts +1 -1
  37. package/src/parser/block/ulist.ts +1 -1
  38. package/src/parser/block.ts +1 -1
  39. package/src/parser/header.ts +1 -1
  40. package/src/parser/inline/annotation.ts +2 -2
  41. package/src/parser/inline/autolink/account.ts +1 -1
  42. package/src/parser/inline/autolink/anchor.ts +1 -1
  43. package/src/parser/inline/autolink/channel.ts +1 -1
  44. package/src/parser/inline/autolink/email.ts +1 -1
  45. package/src/parser/inline/autolink/hashnum.ts +1 -1
  46. package/src/parser/inline/autolink/hashtag.ts +1 -1
  47. package/src/parser/inline/bracket.test.ts +5 -1
  48. package/src/parser/inline/bracket.ts +3 -3
  49. package/src/parser/inline/code.ts +1 -1
  50. package/src/parser/inline/comment.ts +2 -2
  51. package/src/parser/inline/deletion.ts +1 -1
  52. package/src/parser/inline/emphasis.ts +1 -1
  53. package/src/parser/inline/emstrong.ts +1 -1
  54. package/src/parser/inline/extension/index.ts +1 -1
  55. package/src/parser/inline/extension/indexee.ts +1 -1
  56. package/src/parser/inline/extension/indexer.ts +1 -1
  57. package/src/parser/inline/extension/label.ts +1 -1
  58. package/src/parser/inline/extension/placeholder.ts +1 -1
  59. package/src/parser/inline/html.ts +1 -1
  60. package/src/parser/inline/htmlentity.ts +1 -1
  61. package/src/parser/inline/insertion.ts +1 -1
  62. package/src/parser/inline/link.ts +1 -1
  63. package/src/parser/inline/mark.ts +1 -1
  64. package/src/parser/inline/math.ts +1 -1
  65. package/src/parser/inline/media.ts +1 -1
  66. package/src/parser/inline/reference.ts +2 -2
  67. package/src/parser/inline/ruby.ts +1 -1
  68. package/src/parser/inline/strong.ts +1 -1
  69. package/src/parser/inline/template.ts +1 -1
  70. package/src/parser/inline.test.ts +4 -0
  71. package/src/parser/locale.ts +1 -1
  72. package/src/parser/processor/figure.test.ts +1 -1
  73. package/src/parser/processor/figure.ts +1 -1
  74. package/src/parser/processor/footnote.test.ts +1 -1
  75. package/src/parser/processor/footnote.ts +5 -4
  76. package/src/parser/source/text.ts +1 -1
  77. package/src/renderer/render/math.ts +1 -1
  78. package/src/renderer/render/media/audio.ts +1 -1
  79. package/src/renderer/render/media/image.ts +1 -1
  80. package/src/renderer/render/media/pdf.ts +1 -1
  81. package/src/renderer/render/media/twitter.ts +21 -23
  82. package/src/renderer/render/media/video.ts +1 -1
  83. package/src/renderer/render/media/youtube.ts +1 -1
  84. package/src/renderer/render/media.test.ts +1 -1
  85. package/src/util/quote.ts +1 -1
  86. package/src/util/toc.test.ts +1 -1
  87. package/src/util/toc.ts +1 -1
  88. package/src/util.ts +0 -1
  89. package/src/util/sync.ts +0 -57
package/src/util/sync.ts DELETED
@@ -1,57 +0,0 @@
1
- import { undefined, window, document } from 'spica/global';
2
- import { abs, ceil, sign } from 'spica/alias';
3
- import { aggregate } from 'spica/arrow';
4
- import { clear } from 'spica/function';
5
- import { bind, once } from 'typed-dom';
6
-
7
- export function sync(
8
- editor: HTMLElement,
9
- viewer: HTMLElement,
10
- bottom: Element | null = viewer.firstElementChild,
11
- ): () => void {
12
- let hover = document.activeElement?.contains(editor) ?? true;
13
- let scroll = editor.scrollTop;
14
- return clear(aggregate(
15
- once(viewer, 'mousemove', () => {
16
- hover = false;
17
- }, passive),
18
- once(viewer, 'mousedown', () => {
19
- hover = false;
20
- }, passive),
21
- once(viewer, 'wheel', () => {
22
- hover = false;
23
- }, passive),
24
- bind(editor, 'input', () => {
25
- hover = true;
26
- }, passive),
27
- bind(editor, 'keydown', () => {
28
- hover = true;
29
- }, passive),
30
- bind(editor, 'mouseenter', () => {
31
- hover = true;
32
- }, passive),
33
- bind(editor, 'mouseleave', () => {
34
- hover = false;
35
- }, passive),
36
- bind(editor, 'scroll', () => {
37
- if (!hover) return scroll = editor.scrollTop, undefined;
38
- const delta = editor.scrollTop - scroll;
39
- switch (scroll += delta) {
40
- case 0:
41
- return void viewer.scrollTo({ top: 0 });
42
- default:
43
- const last = bottom?.previousElementSibling as HTMLElement | null;
44
- const viewer_scrollHeight = last
45
- ? last.offsetTop + last.offsetHeight + +window.getComputedStyle(last).marginBottom.slice(0, -2)
46
- : viewer.scrollHeight;
47
- return void viewer.scrollBy({
48
- top: sign(delta) * ceil(
49
- + abs(delta)
50
- * (viewer_scrollHeight - viewer.clientHeight)
51
- / (editor.scrollHeight - editor.clientHeight)),
52
- });
53
- }
54
- }, passive)));
55
- }
56
-
57
- const passive = { passive: true };