bookish-press 0.4.1 → 0.4.21

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 (395) hide show
  1. package/README.md +3 -1
  2. package/components/Auth.svelte +19 -14
  3. package/components/Auth.svelte.d.ts +4 -4
  4. package/components/Authentication.d.ts +2 -2
  5. package/components/BookPreview.svelte +77 -59
  6. package/components/BookPreview.svelte.d.ts +5 -5
  7. package/components/External.svelte +1 -1
  8. package/components/External.svelte.d.ts +3 -3
  9. package/components/Link.svelte +49 -3
  10. package/components/Link.svelte.d.ts +3 -4
  11. package/components/app/BookList.svelte +19 -0
  12. package/components/app/BookList.svelte.d.ts +18 -0
  13. package/components/app/Button.svelte +49 -0
  14. package/components/app/Button.svelte.d.ts +22 -0
  15. package/components/app/Feedback.svelte +45 -0
  16. package/components/app/Feedback.svelte.d.ts +18 -0
  17. package/components/app/Head.svelte +12 -0
  18. package/components/app/Head.svelte.d.ts +27 -0
  19. package/components/app/Large.svelte +8 -0
  20. package/components/app/Large.svelte.d.ts +27 -0
  21. package/components/app/Lead.svelte +12 -0
  22. package/components/app/Lead.svelte.d.ts +27 -0
  23. package/components/app/Link.svelte +24 -0
  24. package/components/app/Link.svelte.d.ts +20 -0
  25. package/components/app/Options.svelte +24 -0
  26. package/components/app/Options.svelte.d.ts +19 -0
  27. package/components/app/Paragraph.svelte +19 -0
  28. package/components/app/Paragraph.svelte.d.ts +18 -0
  29. package/components/app/Table.svelte +32 -0
  30. package/components/app/Table.svelte.d.ts +27 -0
  31. package/components/app/TextInput.svelte +37 -0
  32. package/components/app/TextInput.svelte.d.ts +22 -0
  33. package/components/app/Writing.svelte +13 -0
  34. package/components/app/Writing.svelte.d.ts +27 -0
  35. package/components/chapter/Atom.svelte +20 -6
  36. package/components/chapter/Atom.svelte.d.ts +3 -3
  37. package/components/chapter/Block.svelte +23 -20
  38. package/components/chapter/Block.svelte.d.ts +4 -4
  39. package/components/chapter/Callout.svelte +38 -7
  40. package/components/chapter/Callout.svelte.d.ts +4 -4
  41. package/components/chapter/CaptionedCode.svelte +66 -23
  42. package/components/chapter/CaptionedCode.svelte.d.ts +4 -4
  43. package/components/chapter/ChapterBody.svelte +61 -9
  44. package/components/chapter/ChapterBody.svelte.d.ts +4 -4
  45. package/components/chapter/Citations.svelte +86 -20
  46. package/components/chapter/Citations.svelte.d.ts +4 -4
  47. package/components/chapter/Code.svelte +152 -21
  48. package/components/chapter/Code.svelte.d.ts +3 -3
  49. package/components/chapter/Comment.svelte +38 -16
  50. package/components/chapter/Comment.svelte.d.ts +3 -3
  51. package/components/chapter/Definition.svelte +52 -18
  52. package/components/chapter/Definition.svelte.d.ts +5 -8
  53. package/components/chapter/Embed.svelte +154 -66
  54. package/components/chapter/Embed.svelte.d.ts +5 -4
  55. package/components/chapter/ErrorMessage.svelte +7 -2
  56. package/components/chapter/ErrorMessage.svelte.d.ts +4 -4
  57. package/components/chapter/ExtendedPrism.d.ts +2 -0
  58. package/components/chapter/ExtendedPrism.js +69 -0
  59. package/components/chapter/Figure.svelte +90 -0
  60. package/components/chapter/Figure.svelte.d.ts +24 -0
  61. package/components/chapter/Footnote.svelte +75 -12
  62. package/components/chapter/Footnote.svelte.d.ts +4 -4
  63. package/components/chapter/Format.svelte +60 -37
  64. package/components/chapter/Format.svelte.d.ts +4 -4
  65. package/components/chapter/InlineCode.svelte +15 -5
  66. package/components/chapter/InlineCode.svelte.d.ts +4 -4
  67. package/components/chapter/Label.svelte +37 -8
  68. package/components/chapter/Label.svelte.d.ts +4 -4
  69. package/components/chapter/Link.svelte +23 -18
  70. package/components/chapter/Link.svelte.d.ts +4 -4
  71. package/components/chapter/List.svelte +75 -8
  72. package/components/chapter/List.svelte.d.ts +4 -4
  73. package/components/chapter/Marginal.svelte +169 -27
  74. package/components/chapter/Marginal.svelte.d.ts +6 -3
  75. package/components/chapter/Paragraph.svelte +74 -6
  76. package/components/chapter/Paragraph.svelte.d.ts +4 -4
  77. package/components/chapter/Positioned.svelte +33 -0
  78. package/components/chapter/Positioned.svelte.d.ts +19 -0
  79. package/components/chapter/Problem.svelte +15 -0
  80. package/components/chapter/Problem.svelte.d.ts +27 -0
  81. package/components/chapter/Python.svelte +68 -21
  82. package/components/chapter/Python.svelte.d.ts +4 -4
  83. package/components/chapter/Quote.svelte +64 -11
  84. package/components/chapter/Quote.svelte.d.ts +4 -4
  85. package/components/chapter/Rule.svelte +12 -1
  86. package/components/chapter/Rule.svelte.d.ts +4 -4
  87. package/components/chapter/Table.svelte +36 -25
  88. package/components/chapter/Table.svelte.d.ts +4 -4
  89. package/components/chapter/Text.svelte +61 -36
  90. package/components/chapter/Text.svelte.d.ts +5 -4
  91. package/components/editor/BookishEditor.svelte +343 -237
  92. package/components/editor/BookishEditor.svelte.d.ts +5 -5
  93. package/components/editor/CalloutEditor.svelte +5 -5
  94. package/components/editor/CalloutEditor.svelte.d.ts +4 -4
  95. package/components/editor/CaptionedCodeEditor.svelte +16 -12
  96. package/components/editor/CaptionedCodeEditor.svelte.d.ts +4 -4
  97. package/components/editor/CaretContext.d.ts +48 -16
  98. package/components/editor/CaretState.d.ts +16 -44
  99. package/components/editor/CaretUtilities.d.ts +2 -2
  100. package/components/editor/CaretView.svelte +80 -0
  101. package/components/editor/CaretView.svelte.d.ts +24 -0
  102. package/components/editor/CitationsEditor.svelte +36 -25
  103. package/components/editor/CitationsEditor.svelte.d.ts +4 -4
  104. package/components/editor/Clipboard.d.ts +2 -2
  105. package/components/editor/Command.d.ts +13 -12
  106. package/components/editor/Commands.d.ts +1 -1
  107. package/components/editor/Commands.js +1114 -571
  108. package/components/editor/ConfirmButton.svelte +18 -12
  109. package/components/editor/ConfirmButton.svelte.d.ts +5 -4
  110. package/components/editor/DefinitionEditor.svelte +29 -21
  111. package/components/editor/DefinitionEditor.svelte.d.ts +4 -4
  112. package/components/editor/EmbedEditor.svelte +93 -43
  113. package/components/editor/EmbedEditor.svelte.d.ts +3 -3
  114. package/components/editor/Icon.svelte +17 -0
  115. package/components/editor/Icon.svelte.d.ts +16 -0
  116. package/components/editor/ImageChooser.svelte +53 -34
  117. package/components/editor/ImageChooser.svelte.d.ts +3 -3
  118. package/components/editor/InlineCodeEditor.svelte +7 -4
  119. package/components/editor/InlineCodeEditor.svelte.d.ts +4 -4
  120. package/components/editor/LabelEditor.svelte +20 -11
  121. package/components/editor/LabelEditor.svelte.d.ts +4 -4
  122. package/components/editor/LanguageEditor.svelte +10 -7
  123. package/components/editor/LanguageEditor.svelte.d.ts +3 -3
  124. package/components/editor/LinkEditor.svelte +64 -39
  125. package/components/editor/LinkEditor.svelte.d.ts +4 -4
  126. package/components/editor/Note.svelte +3 -3
  127. package/components/editor/Note.svelte.d.ts +6 -2
  128. package/components/editor/PositionEditor.svelte +9 -6
  129. package/components/editor/PositionEditor.svelte.d.ts +4 -4
  130. package/components/editor/QuoteEditor.svelte +7 -2
  131. package/components/editor/QuoteEditor.svelte.d.ts +4 -4
  132. package/components/editor/Switch.svelte +55 -28
  133. package/components/editor/Switch.svelte.d.ts +4 -4
  134. package/components/editor/TableEditor.svelte +10 -0
  135. package/components/editor/TableEditor.svelte.d.ts +17 -0
  136. package/components/editor/TextEditor.svelte +83 -45
  137. package/components/editor/TextEditor.svelte.d.ts +5 -4
  138. package/components/editor/Toggle.svelte +11 -8
  139. package/components/editor/Toggle.svelte.d.ts +4 -4
  140. package/components/editor/Toolbar.svelte +192 -144
  141. package/components/editor/Toolbar.svelte.d.ts +5 -8
  142. package/components/editor/ToolbarGroup.svelte +18 -23
  143. package/components/editor/ToolbarGroup.svelte.d.ts +3 -4
  144. package/components/editor/ToolbarSpacer.svelte +8 -1
  145. package/components/editor/ToolbarSpacer.svelte.d.ts +6 -2
  146. package/components/editor/URLEditor.svelte +6 -8
  147. package/components/editor/URLEditor.svelte.d.ts +3 -3
  148. package/components/editor/UndoState.d.ts +3 -3
  149. package/components/editor/icons/annotate.svg +1 -0
  150. package/components/editor/icons/block.svg +1 -0
  151. package/components/editor/icons/bold.svg +1 -0
  152. package/components/editor/icons/bullets.svg +1 -0
  153. package/components/editor/icons/callout.svg +1 -0
  154. package/components/editor/icons/citation.svg +8 -0
  155. package/components/editor/icons/clear.svg +1 -0
  156. package/components/editor/icons/clipboard.svg +1 -0
  157. package/components/editor/icons/code.svg +1 -0
  158. package/components/editor/icons/columnafter.svg +1 -0
  159. package/components/editor/icons/columnbefore.svg +1 -0
  160. package/components/editor/icons/comment.svg +1 -0
  161. package/components/editor/icons/copy.svg +1 -0
  162. package/components/editor/icons/cut.svg +1 -0
  163. package/components/editor/icons/define.svg +7 -0
  164. package/components/editor/icons/deletecolumn.svg +1 -0
  165. package/components/editor/icons/deleterow.svg +1 -0
  166. package/components/editor/icons/footnote.svg +8 -0
  167. package/components/editor/icons/header1.svg +7 -0
  168. package/components/editor/icons/header2.svg +7 -0
  169. package/components/editor/icons/header3.svg +7 -0
  170. package/components/editor/icons/home.svg +1 -0
  171. package/components/editor/icons/indent.svg +1 -0
  172. package/components/editor/icons/italic.svg +1 -0
  173. package/components/editor/icons/label.svg +1 -0
  174. package/components/editor/icons/left.svg +1 -0
  175. package/components/editor/icons/level.svg +1 -0
  176. package/components/editor/icons/link.svg +1 -0
  177. package/components/editor/icons/list.svg +1 -0
  178. package/components/editor/icons/media.svg +1 -0
  179. package/components/editor/icons/middle.svg +1 -0
  180. package/components/editor/icons/numbers.svg +10 -0
  181. package/components/editor/icons/paragraph.svg +1 -0
  182. package/components/editor/icons/paste.svg +10 -0
  183. package/components/editor/icons/quote.svg +1 -0
  184. package/components/editor/icons/redo.svg +1 -0
  185. package/components/editor/icons/right.svg +1 -0
  186. package/components/editor/icons/rowabove.svg +1 -0
  187. package/components/editor/icons/rowbelow.svg +1 -0
  188. package/components/editor/icons/rule.svg +1 -0
  189. package/components/editor/icons/sub.svg +1 -0
  190. package/components/editor/icons/super.svg +1 -0
  191. package/components/editor/icons/table.svg +1 -0
  192. package/components/editor/icons/text.svg +1 -0
  193. package/components/editor/icons/time.svg +1 -0
  194. package/components/editor/icons/undo.svg +1 -0
  195. package/components/editor/icons/unindent.svg +1 -0
  196. package/components/editor/icons/unlink.svg +1 -0
  197. package/components/page/Acknowledgements.svelte +31 -22
  198. package/components/page/Acknowledgements.svelte.d.ts +4 -4
  199. package/components/page/Authors.svelte +34 -14
  200. package/components/page/Authors.svelte.d.ts +6 -6
  201. package/components/page/BulkReferenceEditor.svelte +53 -22
  202. package/components/page/BulkReferenceEditor.svelte.d.ts +4 -4
  203. package/components/page/Chapter.svelte +196 -141
  204. package/components/page/Chapter.svelte.d.ts +3 -3
  205. package/components/page/ChapterContext.d.ts +4 -4
  206. package/components/page/ChapterNumber.svelte +9 -0
  207. package/components/page/ChapterNumber.svelte.d.ts +27 -0
  208. package/components/page/ChapterTitle.svelte +16 -0
  209. package/components/page/ChapterTitle.svelte.d.ts +18 -0
  210. package/components/page/Contexts.d.ts +31 -20
  211. package/components/page/Contexts.js +47 -17
  212. package/components/page/DefinitionView.svelte +115 -86
  213. package/components/page/DefinitionView.svelte.d.ts +3 -3
  214. package/components/page/Description.svelte +27 -18
  215. package/components/page/Description.svelte.d.ts +4 -4
  216. package/components/page/Edition.svelte +127 -75
  217. package/components/page/Edition.svelte.d.ts +4 -4
  218. package/components/page/Editions.svelte +158 -0
  219. package/components/page/Editions.svelte.d.ts +14 -0
  220. package/components/page/Glossary.svelte +57 -48
  221. package/components/page/Glossary.svelte.d.ts +4 -4
  222. package/components/page/Header.svelte +129 -44
  223. package/components/page/Header.svelte.d.ts +6 -6
  224. package/components/page/Index.svelte +114 -80
  225. package/components/page/Index.svelte.d.ts +4 -4
  226. package/components/page/Instructions.svelte +18 -16
  227. package/components/page/Instructions.svelte.d.ts +4 -4
  228. package/components/page/License.svelte +29 -21
  229. package/components/page/License.svelte.d.ts +4 -4
  230. package/components/page/Loading.svelte +102 -12
  231. package/components/page/Loading.svelte.d.ts +6 -2
  232. package/components/page/Media.svelte +77 -51
  233. package/components/page/Media.svelte.d.ts +4 -4
  234. package/components/page/MediaPreview.svelte +26 -8
  235. package/components/page/MediaPreview.svelte.d.ts +3 -3
  236. package/components/page/Muted.svelte +10 -0
  237. package/components/page/Muted.svelte.d.ts +27 -0
  238. package/components/page/Outline.svelte +279 -59
  239. package/components/page/Outline.svelte.d.ts +3 -3
  240. package/components/page/Page.svelte +40 -9
  241. package/components/page/Page.svelte.d.ts +3 -3
  242. package/components/page/PageHeader.svelte +14 -0
  243. package/components/page/PageHeader.svelte.d.ts +18 -0
  244. package/components/page/PageParagraph.svelte +18 -0
  245. package/components/page/PageParagraph.svelte.d.ts +27 -0
  246. package/components/page/PossibleChapter.svelte +7 -7
  247. package/components/page/PossibleChapter.svelte.d.ts +4 -4
  248. package/components/page/PossibleReference.svelte +6 -11
  249. package/components/page/PossibleReference.svelte.d.ts +6 -7
  250. package/components/page/Print.svelte +27 -3
  251. package/components/page/Print.svelte.d.ts +4 -4
  252. package/components/page/Reference.svelte +256 -113
  253. package/components/page/Reference.svelte.d.ts +5 -5
  254. package/components/page/References.svelte +39 -47
  255. package/components/page/References.svelte.d.ts +4 -4
  256. package/components/page/Rows.svelte +54 -0
  257. package/components/page/Rows.svelte.d.ts +27 -0
  258. package/components/page/Search.svelte +86 -63
  259. package/components/page/Search.svelte.d.ts +4 -4
  260. package/components/page/Status.svelte +43 -35
  261. package/components/page/Status.svelte.d.ts +4 -9
  262. package/components/page/SubdomainEditor.svelte +40 -27
  263. package/components/page/SubdomainEditor.svelte.d.ts +4 -4
  264. package/components/page/TableOfContents.svelte +225 -190
  265. package/components/page/TableOfContents.svelte.d.ts +4 -4
  266. package/components/page/TableOfContentsImage.svelte +8 -8
  267. package/components/page/TableOfContentsImage.svelte.d.ts +3 -3
  268. package/components/page/TableOfContentsRow.svelte +96 -33
  269. package/components/page/TableOfContentsRow.svelte.d.ts +4 -4
  270. package/components/page/ThemeEditor.svelte +174 -39
  271. package/components/page/ThemeEditor.svelte.d.ts +4 -4
  272. package/components/page/ThemeEditorPreview.svelte +35 -23
  273. package/components/page/ThemeEditorPreview.svelte.d.ts +5 -5
  274. package/components/page/ThemeSetEditor.svelte +15 -13
  275. package/components/page/ThemeSetEditor.svelte.d.ts +4 -4
  276. package/components/page/ThemeVariableEditor.svelte +24 -15
  277. package/components/page/ThemeVariableEditor.svelte.d.ts +3 -3
  278. package/components/page/Title.svelte +12 -0
  279. package/components/page/Title.svelte.d.ts +27 -0
  280. package/components/page/Unknown.svelte +25 -21
  281. package/components/page/Unknown.svelte.d.ts +4 -4
  282. package/components/page/margins.js +50 -33
  283. package/index.d.ts +14 -0
  284. package/index.js +14 -0
  285. package/models/CRUD.d.ts +17 -0
  286. package/models/CRUD.js +207 -0
  287. package/models/Firebase.d.ts +1 -0
  288. package/models/Firebase.js +21 -15
  289. package/models/book/Book.d.ts +26 -30
  290. package/models/book/Book.js +120 -113
  291. package/models/book/BookMedia.d.ts +3 -3
  292. package/models/book/BookMedia.js +22 -16
  293. package/models/book/BookSaveStatus.d.ts +7 -0
  294. package/models/book/BookSaveStatus.js +8 -0
  295. package/models/book/Chapter.d.ts +46 -39
  296. package/models/book/Chapter.js +180 -198
  297. package/models/book/ChapterID.js +7 -7
  298. package/models/book/Definition.d.ts +1 -1
  299. package/models/book/Edition.d.ts +62 -60
  300. package/models/book/Edition.js +385 -303
  301. package/models/book/Reference.d.ts +24 -0
  302. package/models/book/Reference.js +78 -0
  303. package/models/book/Schema.d.ts +169 -0
  304. package/models/book/Schema.js +114 -0
  305. package/models/book/Theme.d.ts +44 -37
  306. package/models/book/Theme.js +452 -52
  307. package/models/book/ThemeColors.d.ts +1 -1
  308. package/models/book/Words.d.ts +2 -0
  309. package/models/book/Words.js +110 -0
  310. package/models/chapter/AtomNode.d.ts +4 -4
  311. package/models/chapter/AtomNode.js +20 -13
  312. package/models/chapter/BlockNode.d.ts +9 -10
  313. package/models/chapter/BlockNode.js +32 -13
  314. package/models/chapter/BlocksNode.d.ts +10 -10
  315. package/models/chapter/BlocksNode.js +315 -120
  316. package/models/chapter/BlocksNode.test.js +494 -228
  317. package/models/chapter/Bookkeeping.d.ts +1 -1
  318. package/models/chapter/CalloutNode.d.ts +3 -3
  319. package/models/chapter/CalloutNode.js +34 -12
  320. package/models/chapter/Caret.d.ts +9 -7
  321. package/models/chapter/Caret.js +11 -6
  322. package/models/chapter/ChapterNode.d.ts +11 -11
  323. package/models/chapter/ChapterNode.js +70 -33
  324. package/models/chapter/CitationsNode.d.ts +3 -3
  325. package/models/chapter/CitationsNode.js +31 -12
  326. package/models/chapter/CodeNode.d.ts +11 -6
  327. package/models/chapter/CodeNode.js +143 -34
  328. package/models/chapter/CommentNode.d.ts +5 -5
  329. package/models/chapter/CommentNode.js +29 -13
  330. package/models/chapter/DefinitionNode.d.ts +2 -2
  331. package/models/chapter/DefinitionNode.js +15 -7
  332. package/models/chapter/Edit.d.ts +3 -3
  333. package/models/chapter/EmbedNode.d.ts +9 -5
  334. package/models/chapter/EmbedNode.js +108 -35
  335. package/models/chapter/ErrorNode.d.ts +2 -2
  336. package/models/chapter/ErrorNode.js +34 -12
  337. package/models/chapter/FootnoteNode.d.ts +5 -5
  338. package/models/chapter/FootnoteNode.js +34 -16
  339. package/models/chapter/FormatNode.d.ts +10 -10
  340. package/models/chapter/FormatNode.js +237 -106
  341. package/models/chapter/FormatNode.test.js +87 -45
  342. package/models/chapter/InlineCodeNode.d.ts +2 -2
  343. package/models/chapter/InlineCodeNode.js +22 -9
  344. package/models/chapter/LabelNode.d.ts +4 -4
  345. package/models/chapter/LabelNode.js +31 -13
  346. package/models/chapter/LinkNode.d.ts +2 -2
  347. package/models/chapter/LinkNode.js +21 -9
  348. package/models/chapter/ListNode.d.ts +8 -8
  349. package/models/chapter/ListNode.js +99 -38
  350. package/models/chapter/ListNode.test.js +29 -24
  351. package/models/chapter/MetadataNode.d.ts +3 -3
  352. package/models/chapter/MetadataNode.js +13 -5
  353. package/models/chapter/Node.d.ts +5 -3
  354. package/models/chapter/Node.js +76 -29
  355. package/models/chapter/Node.test.js +20 -18
  356. package/models/chapter/ParagraphNode.d.ts +6 -6
  357. package/models/chapter/ParagraphNode.js +84 -29
  358. package/models/chapter/ParagraphNode.test.js +22 -13
  359. package/models/chapter/Parser.d.ts +25 -25
  360. package/models/chapter/Parser.js +201 -189
  361. package/models/chapter/Parser.test.js +16 -16
  362. package/models/chapter/Position.d.ts +1 -1
  363. package/models/chapter/QuoteNode.d.ts +6 -6
  364. package/models/chapter/QuoteNode.js +61 -23
  365. package/models/chapter/RootNode.d.ts +4 -4
  366. package/models/chapter/RuleNode.d.ts +2 -2
  367. package/models/chapter/RuleNode.js +31 -11
  368. package/models/chapter/TableNode.d.ts +8 -6
  369. package/models/chapter/TableNode.js +89 -34
  370. package/models/chapter/TableNode.test.js +22 -24
  371. package/models/chapter/TextNode.d.ts +6 -6
  372. package/models/chapter/TextNode.js +72 -32
  373. package/models/chapter/TextNode.test.js +4 -4
  374. package/models/loadEdition.d.ts +1 -1
  375. package/models/loadEdition.js +10 -6
  376. package/package.json +104 -25
  377. package/util/getSubdomain.js +8 -6
  378. package/util/isMobile.js +1 -1
  379. package/util/mineReference.d.ts +3 -2
  380. package/util/mineReference.js +67 -29
  381. package/util/scrollToEyeLevel.js +6 -1
  382. package/components/chapter/renderPosition.d.ts +0 -3
  383. package/components/chapter/renderPosition.js +0 -4
  384. package/components/editor/ToolbarIcon.svelte +0 -22
  385. package/components/editor/ToolbarIcon.svelte.d.ts +0 -16
  386. package/components/page/Alert.svelte +0 -11
  387. package/components/page/Alert.svelte.d.ts +0 -23
  388. package/components/page/Revisions.svelte +0 -124
  389. package/components/page/Revisions.svelte.d.ts +0 -14
  390. package/models/BookLoader.d.ts +0 -2
  391. package/models/BookLoader.js +0 -67
  392. package/models/Firestore.d.ts +0 -22
  393. package/models/Firestore.js +0 -194
  394. package/models/chapter/ReferenceNode.d.ts +0 -29
  395. package/models/chapter/ReferenceNode.js +0 -48
@@ -1,63 +1,81 @@
1
- <script>import commands from "./Commands";
2
- import TextNode from "../../models/chapter/TextNode";
3
- import AtomNode from "../../models/chapter/AtomNode";
4
- import LinkNode from "../../models/chapter/LinkNode";
5
- import LabelNode from "../../models/chapter/LabelNode";
6
- import InlineCodeNode from "../../models/chapter/InlineCodeNode";
7
- import CitationsNode from "../../models/chapter/CitationsNode";
8
- import DefinitionNode from "../../models/chapter/DefinitionNode";
9
- import CodeNode from "../../models/chapter/CodeNode";
10
- import CalloutNode from "../../models/chapter/CalloutNode";
11
- import EmbedNode from "../../models/chapter/EmbedNode";
12
- import QuoteNode from "../../models/chapter/QuoteNode";
13
- import LabelEditor from "./LabelEditor.svelte";
14
- import InlineCodeEditor from "./InlineCodeEditor.svelte";
15
- import CitationsEditor from "./CitationsEditor.svelte";
16
- import LinkEditor from "./LinkEditor.svelte";
17
- import DefinitionEditor from "./DefinitionEditor.svelte";
18
- import CaptionedCodeEditor from "./CaptionedCodeEditor.svelte";
19
- import CalloutEditor from "./CalloutEditor.svelte";
20
- import QuoteEditor from "./QuoteEditor.svelte";
21
- import EmbedEditor from "./EmbedEditor.svelte";
22
- import ToolbarGroup from "./ToolbarGroup.svelte";
23
- import ToolbarIcon from "./ToolbarIcon.svelte";
24
- import { onMount } from "svelte";
1
+ <script>import commands from './Commands';
2
+ import TextNode from '../../models/chapter/TextNode';
3
+ import AtomNode from '../../models/chapter/AtomNode';
4
+ import LinkNode from '../../models/chapter/LinkNode';
5
+ import LabelNode from '../../models/chapter/LabelNode';
6
+ import InlineCodeNode from '../../models/chapter/InlineCodeNode';
7
+ import CitationsNode from '../../models/chapter/CitationsNode';
8
+ import DefinitionNode from '../../models/chapter/DefinitionNode';
9
+ import CodeNode from '../../models/chapter/CodeNode';
10
+ import CalloutNode from '../../models/chapter/CalloutNode';
11
+ import EmbedNode from '../../models/chapter/EmbedNode';
12
+ import QuoteNode from '../../models/chapter/QuoteNode';
13
+ import LabelEditor from './LabelEditor.svelte';
14
+ import InlineCodeEditor from './InlineCodeEditor.svelte';
15
+ import CitationsEditor from './CitationsEditor.svelte';
16
+ import LinkEditor from './LinkEditor.svelte';
17
+ import DefinitionEditor from './DefinitionEditor.svelte';
18
+ import CaptionedCodeEditor from './CaptionedCodeEditor.svelte';
19
+ import CalloutEditor from './CalloutEditor.svelte';
20
+ import QuoteEditor from './QuoteEditor.svelte';
21
+ import EmbedEditor from './EmbedEditor.svelte';
22
+ import TableEditor from './TableEditor.svelte';
23
+ import ToolbarGroup from './ToolbarGroup.svelte';
24
+ import Icon from './Icon.svelte';
25
+ import Button from '../app/Button.svelte';
26
+ import AnnotateIcon from './icons/annotate.svg?raw';
27
+ import BlockIcon from './icons/block.svg?raw';
28
+ import ClipboardIcon from './icons/clipboard.svg?raw';
29
+ import LevelIcon from './icons/level.svg?raw';
30
+ import ListIcon from './icons/list.svg?raw';
31
+ import TextIcon from './icons/text.svg?raw';
32
+ import TimeIcon from './icons/time.svg?raw';
33
+ import TableIcon from './icons/table.svg?raw';
34
+ import LinkIcon from './icons/link.svg?raw';
35
+ import LabelIcon from './icons/label.svg?raw';
36
+ import CitationIcon from './icons/citation.svg?raw';
37
+ import DefineIcon from './icons/define.svg?raw';
38
+ import CodeIcon from './icons/code.svg?raw';
39
+ import CalloutIcon from './icons/callout.svg?raw';
40
+ import QuoteIcon from './icons/quote.svg?raw';
41
+ import MediaIcon from './icons/media.svg?raw';
42
+ import TableNode from '../../models/chapter/TableNode';
43
+ import { slide } from 'svelte/transition';
25
44
  const keyLabels = {
26
- "Digit0": "0",
27
- "Digit1": "1",
28
- "Digit2": "2",
29
- "Digit3": "3",
30
- "ArrowDown": "↓",
31
- "ArrowUp": "↑",
32
- "ArrowLeft": "←",
33
- "ArrowRight": "→",
34
- "Backspace": "\u232B",
45
+ Digit0: '0',
46
+ Digit1: '1',
47
+ Digit2: '2',
48
+ Digit3: '3',
49
+ ArrowDown: '↓',
50
+ ArrowUp: '↑',
51
+ ArrowLeft: '←',
52
+ ArrowRight: '→',
53
+ Backspace: '\u232B',
35
54
  };
36
55
  const categoryOrder = {
37
- "navigation": 1,
38
- "selection": 2,
39
- "text": 3,
40
- "clipboard": 4,
41
- "annotation": 5,
42
- "paragraph": 6,
43
- "level": 7,
44
- "list": 8,
45
- "table": 9,
46
- "block": 10,
56
+ navigation: 1,
57
+ selection: 2,
58
+ text: 3,
59
+ clipboard: 4,
60
+ annotation: 5,
61
+ paragraph: 6,
62
+ level: 7,
63
+ list: 8,
64
+ table: 9,
65
+ block: 10,
47
66
  };
48
67
  const categoryIcons = {
49
- "text": "text.svg",
50
- "clipboard": "scissors.svg",
51
- "annotation": "hash.svg",
52
- "level": "level.svg",
53
- "block": "block.svg",
54
- "list": "list.svg",
55
- "table": "▦",
56
- "history": "\u2026"
68
+ text: TextIcon,
69
+ clipboard: ClipboardIcon,
70
+ annotation: AnnotateIcon,
71
+ level: LevelIcon,
72
+ block: BlockIcon,
73
+ list: ListIcon,
74
+ table: TableIcon,
75
+ history: TimeIcon,
57
76
  };
58
- export let context = undefined;
59
- export let executor = undefined;
60
- export let visible = false;
77
+ export let caret;
78
+ $: context = caret.context;
61
79
  $: chapter = context?.root;
62
80
  let element = null;
63
81
  let categories = undefined;
@@ -66,57 +84,63 @@ let metaNode = undefined;
66
84
  let calloutNode = undefined;
67
85
  let quoteNode = undefined;
68
86
  let embedNode = undefined;
69
- $: isVisible = visible || containsFocus();
70
- // Listen to focus changes to decide whether the toolbar is visible.
71
- onMount(() => {
72
- window.addEventListener("focus", updateVisible);
73
- window.addEventListener("blur", updateVisible);
74
- return () => {
75
- window.removeEventListener("focus", updateVisible);
76
- window.removeEventListener("blur", updateVisible);
77
- };
78
- });
79
- function containsFocus() { return element !== null && element.contains(document.activeElement); }
80
- function updateVisible() {
81
- isVisible = visible || containsFocus();
82
- }
87
+ let tableNode = undefined;
83
88
  function getShortcutDescription(command) {
84
- const macOS = navigator.platform.indexOf('Mac') > -1;
85
- const controlSymbol = macOS ? "\u2318" : "Ctrl+";
86
- const altSymbol = macOS ? "\u2325" : "Alt+";
87
- const key = command.key ? (Array.isArray(command.key) ? command.key.join("/") : command.key) : command.code ? command.code : "any";
88
- const keyLabel = (key in keyLabels ? keyLabels[key] : key).toLocaleUpperCase();
89
- return `${command.control ? controlSymbol : ""}${command.alt ? altSymbol : ""}${command.shift ? "\u21E7" : ""}${keyLabel}`;
89
+ const macOS = navigator.userAgent.indexOf('Mac') >= 0;
90
+ const controlSymbol = macOS ? '\u2318' : 'Ctrl+';
91
+ const altSymbol = macOS ? '\u2325' : 'Alt+';
92
+ const key = command.key
93
+ ? Array.isArray(command.key)
94
+ ? command.key.join('/')
95
+ : command.key
96
+ : command.code
97
+ ? command.code
98
+ : 'any';
99
+ const keyLabel = (typeof key === 'string'
100
+ ? key in keyLabels
101
+ ? keyLabels[key]
102
+ : key
103
+ : '—').toLocaleUpperCase();
104
+ return `${command.control ? controlSymbol : ''}${command.alt ? altSymbol : ''}${command.shift ? '\u21E7' : ''}${keyLabel}`;
90
105
  }
91
106
  // Update the above when the dependencies below change.
92
107
  $: {
93
108
  if (context !== undefined && chapter) {
94
109
  // Filter the commands by those interactive with a mouse and active.
95
- const visible = commands.filter(command => command.visible === true || (context && command.visible instanceof Function && command.visible(context)));
110
+ const visible = commands.filter((command) => command.visible === true ||
111
+ (context &&
112
+ command.visible instanceof Function &&
113
+ command.visible(context)));
96
114
  // Extract the active categories and sort them
97
- categories =
98
- Array.from(new Set(commands.map(command => command.category)))
99
- .sort((a, b) => a in categoryOrder && b in categoryOrder ? categoryOrder[a] - categoryOrder[b] : 0);
115
+ categories = Array.from(new Set(commands.map((command) => command.category))).sort((a, b) => a in categoryOrder && b in categoryOrder
116
+ ? categoryOrder[a] - categoryOrder[b]
117
+ : 0);
100
118
  // Make a list for each category of commands
101
119
  commandsByCategory = {};
102
- categories.forEach(cat => {
120
+ categories.forEach((cat) => {
103
121
  if (commandsByCategory)
104
- commandsByCategory[cat] = visible.filter(command => command.category === cat);
122
+ commandsByCategory[cat] = visible.filter((command) => command.category === cat);
105
123
  });
106
124
  const caretNode = context.start.node;
107
125
  metaNode =
108
- caretNode instanceof AtomNode ? caretNode :
109
- caretNode instanceof TextNode ? caretNode.getParent(chapter) :
110
- undefined;
111
- calloutNode = caretNode.getClosestParentMatching(chapter, p => p instanceof CalloutNode);
112
- quoteNode = caretNode.getClosestParentMatching(chapter, p => p instanceof QuoteNode);
113
- embedNode = caretNode.getClosestParentMatching(chapter, p => p instanceof EmbedNode);
126
+ caretNode instanceof AtomNode
127
+ ? caretNode
128
+ : caretNode instanceof TextNode
129
+ ? caretNode.getParent(chapter)
130
+ : undefined;
131
+ calloutNode = caretNode.getClosestParentMatching(chapter, (p) => p instanceof CalloutNode);
132
+ quoteNode = caretNode.getClosestParentMatching(chapter, (p) => p instanceof QuoteNode);
133
+ embedNode =
134
+ caretNode instanceof EmbedNode
135
+ ? caretNode
136
+ : caretNode.getClosestParentMatching(chapter, (p) => p instanceof EmbedNode);
137
+ tableNode = caretNode.getClosestParentMatching(chapter, (p) => p instanceof TableNode);
114
138
  }
115
139
  }
116
140
  function handleKeyPress(event) {
117
141
  // Return focus to the editor if someone presses an unhandled enter
118
- if (event.key === "Enter" && element) {
119
- const editor = element.closest(".bookish-editor");
142
+ if ((event.key === 'Escape' || event.key === 'Enter') && element) {
143
+ const editor = element.closest('.bookish-editor');
120
144
  if (editor instanceof HTMLElement) {
121
145
  event.stopPropagation();
122
146
  editor.focus();
@@ -127,76 +151,100 @@ function handleKeyPress(event) {
127
151
  </script>
128
152
 
129
153
  {#if chapter}
130
- <section
131
- class="bookish-editor-toolbar"
132
- on:keypress={handleKeyPress}
133
- style={`margin: ${isVisible ? "0px" : "-20em"};`}
154
+ <section
155
+ class="bookish-editor-toolbar"
134
156
  bind:this={element}
135
- on:mousedown|stopPropagation={ () => element?.focus() }
136
- tabIndex=0
157
+ on:keypress={handleKeyPress}
158
+ on:keydown={handleKeyPress}
159
+ on:mousedown|stopPropagation={() => element?.focus()}
160
+ tabIndex="0"
161
+ transition:slide={{ duration: 200 }}
137
162
  >
138
- {#if context && categories && executor}
139
- {#each categories as cat }
140
- {#if commandsByCategory[cat].length > 0 }
141
- <ToolbarGroup linebreak={false} icon={ cat in categoryIcons ? categoryIcons[cat] : cat.charAt(0).toUpperCase() + cat.slice(1) }>
142
- {#each commandsByCategory[cat] as command }
143
- <button
144
- disabled={command.active === false || (command.active instanceof Function && command.active.call(undefined, context) === false)}
145
- title={command.description + " " + getShortcutDescription(command)}
146
- tabIndex=0
147
- on:click|stopPropagation|preventDefault={() => executor?.call(undefined, command, "")}
148
- on:keypress={event => event.key === " " || event.key === "Enter" ? executor?.call(undefined, command, "") : undefined }
163
+ {#if context && categories}
164
+ {#each categories as cat}
165
+ {#if commandsByCategory[cat].length > 0}
166
+ <ToolbarGroup
167
+ icon={cat in categoryIcons
168
+ ? categoryIcons[cat]
169
+ : cat.charAt(0).toUpperCase() + cat.slice(1)}
170
+ >
171
+ {#each commandsByCategory[cat] as command}
172
+ <Button
173
+ disabled={command.active === false ||
174
+ (command.active instanceof Function &&
175
+ command.active.call(
176
+ undefined,
177
+ context
178
+ ) === false)}
179
+ tooltip={command.description +
180
+ ' ' +
181
+ getShortcutDescription(command)}
182
+ tabIndex="0"
183
+ command={() =>
184
+ caret?.executor.call(
185
+ undefined,
186
+ command,
187
+ ''
188
+ )}
149
189
  >
150
- {#if command.icon }
151
- <ToolbarIcon name={command.icon}/>
152
- {:else if command.label }
153
- {command.label}
154
- {:else}
155
- {command.description }
156
- {/if}
157
- </button>
190
+ <Icon icon={command.icon} />
191
+ </Button>
158
192
  {/each}
193
+ {#if cat === 'table' && tableNode}
194
+ <TableEditor table={tableNode} />
195
+ {/if}
159
196
  </ToolbarGroup>
160
197
  {/if}
161
198
  {/each}
162
199
  {/if}
163
- {#if metaNode instanceof LinkNode}<ToolbarGroup icon="link.svg"><LinkEditor link={metaNode}/></ToolbarGroup>{/if}
164
- {#if metaNode instanceof LabelNode}<ToolbarGroup icon="•"><LabelEditor label={metaNode}/></ToolbarGroup>{/if}
165
- {#if metaNode instanceof InlineCodeNode}<ToolbarGroup icon="code.svg"><InlineCodeEditor code={metaNode}/></ToolbarGroup>{/if}
166
- {#if metaNode instanceof CitationsNode}<ToolbarGroup icon="¹"><CitationsEditor citations={metaNode}/></ToolbarGroup>{/if}
167
- {#if metaNode instanceof DefinitionNode}<ToolbarGroup icon="Aa"><DefinitionEditor definition={metaNode}/></ToolbarGroup>{/if}
168
- {#if metaNode instanceof CodeNode && context}<ToolbarGroup icon="code.svg"><CaptionedCodeEditor code={metaNode}/></ToolbarGroup>{/if}
169
- {#if calloutNode}<ToolbarGroup icon="🄰"><CalloutEditor callout={calloutNode} /></ToolbarGroup>{/if}
170
- {#if quoteNode}<ToolbarGroup icon="quote.svg"><QuoteEditor quote={quoteNode} /></ToolbarGroup>{/if}
171
- {#if embedNode}<ToolbarGroup linebreak icon="media.svg"><EmbedEditor embed={embedNode} /></ToolbarGroup>{/if}
200
+ {#if metaNode instanceof LinkNode}<ToolbarGroup icon={LinkIcon}
201
+ ><LinkEditor link={metaNode} /></ToolbarGroup
202
+ >
203
+ {:else if metaNode instanceof LabelNode}<ToolbarGroup icon={LabelIcon}
204
+ ><LabelEditor label={metaNode} /></ToolbarGroup
205
+ >
206
+ {:else if metaNode instanceof InlineCodeNode}<ToolbarGroup
207
+ icon={CodeIcon}
208
+ ><InlineCodeEditor code={metaNode} /></ToolbarGroup
209
+ >
210
+ {:else if metaNode instanceof CitationsNode}<ToolbarGroup
211
+ icon={CitationIcon}
212
+ ><CitationsEditor citations={metaNode} /></ToolbarGroup
213
+ >
214
+ {:else if metaNode instanceof DefinitionNode}<ToolbarGroup
215
+ icon={DefineIcon}
216
+ ><DefinitionEditor definition={metaNode} /></ToolbarGroup
217
+ >
218
+ {:else if metaNode instanceof CodeNode && context}<ToolbarGroup
219
+ icon={CodeIcon}
220
+ ><CaptionedCodeEditor code={metaNode} /></ToolbarGroup
221
+ >
222
+ {:else if calloutNode}<ToolbarGroup icon={CalloutIcon}
223
+ ><CalloutEditor callout={calloutNode} /></ToolbarGroup
224
+ >
225
+ {:else if quoteNode}<ToolbarGroup icon={QuoteIcon}
226
+ ><QuoteEditor quote={quoteNode} /></ToolbarGroup
227
+ >
228
+ {:else if embedNode}<ToolbarGroup icon={MediaIcon}
229
+ ><EmbedEditor embed={embedNode} /></ToolbarGroup
230
+ >
231
+ {/if}
172
232
  </section>
173
233
  {/if}
174
234
 
175
235
  <style>
176
-
177
236
  .bookish-editor-toolbar {
178
- position: fixed;
179
- top: 0;
180
- left: 0;
181
- right: 0;
237
+ display: flex;
238
+ flex-direction: row;
239
+ flex-wrap: wrap;
240
+ align-items: baseline;
182
241
  background: var(--bookish-background-color);
183
- border: var(--bookish-app-chrome-border-width) solid var(--bookish-app-chrome-border-color);
184
- padding: var(--bookish-app-chrome-padding);
185
- font-family: var(--bookish-app-chrome-font-family);
186
- font-size: var(--bookish-app-chrome-font-size);
187
- z-index: 2;
188
- transition: top 1s;
242
+ padding: var(--app-chrome-padding);
243
+ font-family: var(--app-font);
244
+ font-size: var(--app-chrome-font-size);
189
245
  }
190
246
 
191
- .bookish-editor-toolbar :global(img) {
192
- width: 1em;
193
- height: 1em;
247
+ .bookish-editor-toolbar:focus {
248
+ outline: 2px solid var(--app-interactive-color);
194
249
  }
195
-
196
- .bookish-editor-toolbar :global(hr) {
197
- margin-top: var(--bookish-app-chrome-padding);
198
- margin-bottom: var(--bookish-app-chrome-padding);
199
- line-height: 1em;
200
- }
201
-
202
- </style>
250
+ </style>
@@ -1,20 +1,17 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
- import type Command from "./Command";
3
- import type CaretState from "./CaretState";
2
+ import type CaretState from './CaretState';
4
3
  declare const __propDef: {
5
4
  props: {
6
- context?: CaretState | undefined;
7
- executor?: ((command: Command, key: string) => void) | undefined;
8
- visible?: boolean | undefined;
5
+ caret: CaretState;
9
6
  };
10
7
  events: {
11
8
  [evt: string]: CustomEvent<any>;
12
9
  };
13
10
  slots: {};
14
11
  };
15
- export declare type ToolbarProps = typeof __propDef.props;
16
- export declare type ToolbarEvents = typeof __propDef.events;
17
- export declare type ToolbarSlots = typeof __propDef.slots;
12
+ export type ToolbarProps = typeof __propDef.props;
13
+ export type ToolbarEvents = typeof __propDef.events;
14
+ export type ToolbarSlots = typeof __propDef.slots;
18
15
  export default class Toolbar extends SvelteComponentTyped<ToolbarProps, ToolbarEvents, ToolbarSlots> {
19
16
  }
20
17
  export {};
@@ -1,41 +1,36 @@
1
- <script>import ToolbarIcon from "./ToolbarIcon.svelte";
2
- export let linebreak = false;
1
+ <script>import ToolbarIcon from './Icon.svelte';
2
+ import ToolbarSpacer from './ToolbarSpacer.svelte';
3
3
  export let icon;
4
4
  </script>
5
5
 
6
- {#if linebreak }<br/>{/if}
7
- <span class="bookish-editor-toolbar-group">
8
- <ToolbarIcon name={icon}/><slot></slot>
9
- </span>
6
+ <div class="toolbar-group">
7
+ <ToolbarIcon {icon} /><ToolbarSpacer /><slot />
8
+ </div>
10
9
 
11
10
  <style>
12
- .bookish-editor-toolbar-group {
11
+ .toolbar-group {
13
12
  display: inline-block;
14
- margin-right: calc(2 * var(--bookish-app-chrome-padding));
15
- margin-bottom: var(--bookish-app-chrome-padding);
13
+ padding-bottom: var(--app-chrome-padding);
14
+ margin-right: calc(2 * var(--app-chrome-padding));
16
15
  }
17
16
 
18
- .bookish-editor-toolbar-group :global(button) {
19
- vertical-align: middle;
20
- height: 2.25em;
21
- }
22
-
23
- .bookish-editor-toolbar-group :global(button:first-of-type) {
17
+ .toolbar-group :global(button:first-of-type) {
24
18
  border-top-right-radius: 0;
19
+ border-bottom-right-radius: 0;
25
20
  }
26
21
 
27
- .bookish-editor-toolbar-group :global(button:last-child) {
22
+ .toolbar-group :global(button:last-of-type) {
28
23
  border-bottom-left-radius: 0;
24
+ border-top-left-radius: 0;
29
25
  }
30
26
 
31
- .bookish-editor-toolbar-group :global(button:not(:first-of-type):not(:last-child)) {
27
+ .toolbar-group :global(button:not(:first-of-type):not(:last-of-type)) {
32
28
  border-radius: 0;
33
29
  }
34
30
 
35
- .bookish-editor-toolbar-group :global(input),
36
- .bookish-editor-toolbar-group :global(select) {
37
- margin-left: var(--bookish-app-chrome-padding);
38
- margin-right: var(--bookish-app-chrome-padding);
31
+ .toolbar-group :global(input),
32
+ .toolbar-group :global(select) {
33
+ margin-left: var(--app-chrome-padding);
34
+ margin-right: var(--app-chrome-padding);
39
35
  }
40
-
41
- </style>
36
+ </style>
@@ -1,7 +1,6 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
2
  declare const __propDef: {
3
3
  props: {
4
- linebreak?: boolean | undefined;
5
4
  icon: string;
6
5
  };
7
6
  events: {
@@ -11,9 +10,9 @@ declare const __propDef: {
11
10
  default: {};
12
11
  };
13
12
  };
14
- export declare type ToolbarGroupProps = typeof __propDef.props;
15
- export declare type ToolbarGroupEvents = typeof __propDef.events;
16
- export declare type ToolbarGroupSlots = typeof __propDef.slots;
13
+ export type ToolbarGroupProps = typeof __propDef.props;
14
+ export type ToolbarGroupEvents = typeof __propDef.events;
15
+ export type ToolbarGroupSlots = typeof __propDef.slots;
17
16
  export default class ToolbarGroup extends SvelteComponentTyped<ToolbarGroupProps, ToolbarGroupEvents, ToolbarGroupSlots> {
18
17
  }
19
18
  export {};
@@ -1 +1,8 @@
1
- <span style="display: inline-block, width: 1em"></span>
1
+ <span />
2
+
3
+ <style>
4
+ span {
5
+ display: inline-block;
6
+ width: var(--app-chrome-padding);
7
+ }
8
+ </style>
@@ -1,7 +1,9 @@
1
1
  /** @typedef {typeof __propDef.props} ToolbarSpacerProps */
2
2
  /** @typedef {typeof __propDef.events} ToolbarSpacerEvents */
3
3
  /** @typedef {typeof __propDef.slots} ToolbarSpacerSlots */
4
- export default class ToolbarSpacer extends SvelteComponentTyped<{}, {
4
+ export default class ToolbarSpacer extends SvelteComponentTyped<{
5
+ [x: string]: never;
6
+ }, {
5
7
  [evt: string]: CustomEvent<any>;
6
8
  }, {}> {
7
9
  }
@@ -10,7 +12,9 @@ export type ToolbarSpacerEvents = typeof __propDef.events;
10
12
  export type ToolbarSpacerSlots = typeof __propDef.slots;
11
13
  import { SvelteComponentTyped } from "svelte";
12
14
  declare const __propDef: {
13
- props: {};
15
+ props: {
16
+ [x: string]: never;
17
+ };
14
18
  events: {
15
19
  [evt: string]: CustomEvent<any>;
16
20
  };
@@ -1,15 +1,13 @@
1
- <script>import TextEditor from "./TextEditor.svelte";
1
+ <script>import TextEditor from './TextEditor.svelte';
2
2
  export let url;
3
3
  export let validator;
4
4
  export let edit;
5
5
  </script>
6
6
 
7
7
  <TextEditor
8
- placeholder="url"
9
- startText={url}
8
+ placeholder="url"
9
+ text={url}
10
10
  label="URL editor"
11
- valid={ url => validator(url) }
12
- save={ url => edit(url) }
13
- width={20}
14
- clip={true}
15
- />
11
+ valid={(url) => validator(url)}
12
+ save={(url) => edit(url)}
13
+ />
@@ -10,9 +10,9 @@ declare const __propDef: {
10
10
  };
11
11
  slots: {};
12
12
  };
13
- export declare type UrlEditorProps = typeof __propDef.props;
14
- export declare type UrlEditorEvents = typeof __propDef.events;
15
- export declare type UrlEditorSlots = typeof __propDef.slots;
13
+ export type UrlEditorProps = typeof __propDef.props;
14
+ export type UrlEditorEvents = typeof __propDef.events;
15
+ export type UrlEditorSlots = typeof __propDef.slots;
16
16
  export default class UrlEditor extends SvelteComponentTyped<UrlEditorProps, UrlEditorEvents, UrlEditorSlots> {
17
17
  }
18
18
  export {};
@@ -1,6 +1,6 @@
1
- import type { IndexRange } from "../../models/chapter/Caret";
2
- import type Command from "./Command";
3
- declare type UndoState = {
1
+ import type { IndexRange } from '../../models/chapter/Caret';
2
+ import type Command from './Command';
3
+ type UndoState = {
4
4
  command: Command | undefined;
5
5
  bookdown: string;
6
6
  range: IndexRange;
@@ -0,0 +1 @@
1
+ <svg role="presentation" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14"><g><path d="M7.5,9l-3,.54L5,6.5,10.73.79a1,1,0,0,1,1.42,0l1.06,1.06a1,1,0,0,1,0,1.42Z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path><path d="M12,9.5v3a1,1,0,0,1-1,1H1.5a1,1,0,0,1-1-1V3a1,1,0,0,1,1-1h3" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path></g></svg>
@@ -0,0 +1 @@
1
+ <svg role="presentation" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14"><g><line x1="13.5" y1="1" x2="8" y2="1" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></line><line x1="13.5" y1="4" x2="8" y2="4" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></line><line x1="13.5" y1="7" x2="8" y2="7" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></line><line x1="13.5" y1="13" x2="8" y2="13" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></line><line x1="13.5" y1="10" x2="8" y2="10" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></line><rect x="0.5" y="1" width="5" height="5" rx="0.5" transform="translate(-0.5 6.5) rotate(-90)" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></rect><rect x="0.5" y="8" width="5" height="5" rx="0.5" transform="translate(-7.5 13.5) rotate(-90)" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></rect></g></svg>
@@ -0,0 +1 @@
1
+ <svg role="presentation" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14"><g><path d="M11,3.5a3,3,0,0,0-3-3H4a1,1,0,0,0-1,1v5H8A3,3,0,0,0,11,3.5Z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path><path d="M12,10a3.5,3.5,0,0,1-3.5,3.5H4a1,1,0,0,1-1-1v-6H8.5A3.5,3.5,0,0,1,12,10Z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path></g></svg>
@@ -0,0 +1 @@
1
+ <svg role="presentation" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14"><g><circle cx="1" cy="2.5" r="0.5" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></circle><line x1="4.5" y1="2.5" x2="13.5" y2="2.5" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></line><circle cx="1" cy="7" r="0.5" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></circle><line x1="4.5" y1="7" x2="13.5" y2="7" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></line><circle cx="1" cy="11.5" r="0.5" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></circle><line x1="4.5" y1="11.5" x2="13.5" y2="11.5" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></line></g></svg>
@@ -0,0 +1 @@
1
+ <svg role="presentation" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14"><g><g><path d="M3.5,10.78,6.64,3.45a.39.39,0,0,1,.72,0l3.14,7.33" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path><line x1="4.69" y1="8" x2="9.31" y2="8" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></line></g><rect x="0.5" y="0.5" width="13" height="13" rx="1" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></rect></g></svg>
@@ -0,0 +1,8 @@
1
+ <svg role="presentation" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14">
2
+ <g>
3
+ <path d="M3.5,10.78,6.64,3.45a.39.39,0,0,1,.72,0l3.14,7.33" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path>
4
+ <line x1="4.69" y1="8" x2="9.31" y2="8" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></line>
5
+ <line x1="12" y1="1" x2="12" y2="4" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></line>
6
+ <line x1="12" y1="1" x2="11" y2="1" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></line>
7
+ </g>
8
+ </svg>
@@ -0,0 +1 @@
1
+ <svg role="presentation" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14"><g><line x1="6.24" y1="6.24" x2="4" y2="13.5" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></line><line x1="1.5" y1="13.5" x2="6.5" y2="13.5" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></line><path d="M5,.5h7.5a1,1,0,0,1,1,1V3" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path><line x1="0.5" y1="0.5" x2="13.5" y2="13.5" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></line><line x1="8" y1="0.5" x2="7.23" y2="3" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></line></g></svg>
@@ -0,0 +1 @@
1
+ <svg role="presentation" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14"><g><path d="M9.5,1.5H11a1,1,0,0,1,1,1v10a1,1,0,0,1-1,1H3a1,1,0,0,1-1-1V2.5a1,1,0,0,1,1-1H4.5" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path><rect x="4.5" y="0.5" width="5" height="2.5" rx="1" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></rect></g></svg>
@@ -0,0 +1 @@
1
+ <svg role="presentation" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14"><g><polyline points="4 10.5 0.5 7 4 3.5" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></polyline><polyline points="10 10.5 13.5 7 10 3.5" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></polyline></g></svg>