@esportsplus/ui 0.61.0 → 0.62.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 (678) hide show
  1. package/.audit/audit.json +2 -42
  2. package/.audit/check-scss.mjs +2 -2
  3. package/.audit/rules-audit.md +1 -12
  4. package/README.md +18 -17
  5. package/RULES.md +30 -0
  6. package/build/components/accordion/index.d.ts +5 -1
  7. package/build/components/accordion/index.js +29 -27
  8. package/build/components/accordion/scss/index.scss +1 -1
  9. package/build/components/announcement/index.d.ts +720 -2164
  10. package/build/components/announcement/index.js +12 -9
  11. package/build/components/announcement/scss/index.scss +1 -1
  12. package/build/components/breadcrumb/index.d.ts +4 -1
  13. package/build/components/breadcrumb/index.js +54 -49
  14. package/build/components/breadcrumb/scss/index.scss +1 -1
  15. package/build/components/button/copy.d.ts +1 -10
  16. package/build/components/button/copy.js +14 -11
  17. package/build/components/button/faces.d.ts +2 -1
  18. package/build/components/button/faces.js +9 -10
  19. package/build/components/button/kbd.d.ts +2 -10
  20. package/build/components/button/kbd.js +17 -15
  21. package/build/components/button/morph/index.d.ts +1443 -2165
  22. package/build/components/button/morph/save.d.ts +1 -10
  23. package/build/components/button/morph/save.js +5 -5
  24. package/build/components/button/morph/template.d.ts +2 -1
  25. package/build/components/button/morph/template.js +49 -29
  26. package/build/components/button/scss/index.scss +1 -1
  27. package/build/components/button/sidebar.d.ts +1 -10
  28. package/build/components/button/sidebar.js +14 -12
  29. package/build/components/button/split.d.ts +6 -1
  30. package/build/components/button/split.js +16 -11
  31. package/build/components/capslock/index.d.ts +1 -10
  32. package/build/components/capslock/index.js +16 -13
  33. package/build/components/capslock/scss/index.scss +1 -1
  34. package/build/components/card/scss/index.scss +1 -1
  35. package/build/components/cc/index.d.ts +4 -1
  36. package/build/components/cc/index.js +203 -161
  37. package/build/components/cc/scss/index.scss +1 -1
  38. package/build/components/chat/minimap/index.d.ts +12 -1
  39. package/build/components/chat/minimap/index.js +98 -74
  40. package/build/components/checkbox/group.d.ts +2 -10
  41. package/build/components/checkbox/group.js +39 -29
  42. package/build/components/checkbox/options.d.ts +5005 -6440
  43. package/build/components/checkbox/options.js +72 -44
  44. package/build/components/checkbox/scss/index.scss +1 -1
  45. package/build/components/color-picker/index.d.ts +10 -1
  46. package/build/components/color-picker/index.js +99 -82
  47. package/build/components/color-picker/scss/index.scss +1 -1
  48. package/build/components/command/palette.d.ts +13 -5
  49. package/build/components/command/palette.js +141 -130
  50. package/build/components/command/scss/index.scss +1 -1
  51. package/build/components/command/search.d.ts +2 -20
  52. package/build/components/command/search.js +17 -16
  53. package/build/components/container/scss/index.scss +1 -1
  54. package/build/components/counter/index.d.ts +1 -10
  55. package/build/components/counter/index.js +34 -31
  56. package/build/components/counter/scss/index.scss +1 -1
  57. package/build/components/dock/index.d.ts +4 -1
  58. package/build/components/dock/index.js +154 -114
  59. package/build/components/dock/scss/index.scss +1 -1
  60. package/build/components/editor/code/editor.d.ts +1 -10
  61. package/build/components/editor/code/features.d.ts +3 -3
  62. package/build/components/editor/code/features.js +65 -52
  63. package/build/components/editor/code/field.d.ts +1 -1
  64. package/build/components/editor/code/find.d.ts +4 -4
  65. package/build/components/editor/code/find.js +39 -37
  66. package/build/components/editor/code/folding.d.ts +1 -1
  67. package/build/components/editor/code/goto.d.ts +2 -1
  68. package/build/components/editor/code/goto.js +7 -7
  69. package/build/components/editor/code/gutter.js +12 -12
  70. package/build/components/editor/code/html.d.ts +4 -0
  71. package/build/components/editor/code/html.js +8 -0
  72. package/build/components/editor/code/minimap.d.ts +4 -10
  73. package/build/components/editor/code/minimap.js +18 -13
  74. package/build/components/editor/code/rows.js +6 -12
  75. package/build/components/editor/code/search.d.ts +1 -2
  76. package/build/components/editor/code/search.js +1 -1
  77. package/build/components/editor/code/services/index.d.ts +1 -1
  78. package/build/components/editor/code/services/index.js +27 -23
  79. package/build/components/editor/code/services/model.d.ts +1 -5
  80. package/build/components/editor/code/services/model.js +1 -1
  81. package/build/components/editor/code/services/session.d.ts +3 -2
  82. package/build/components/editor/code/services/session.js +1 -4
  83. package/build/components/editor/code/syntax.d.ts +1 -1
  84. package/build/components/editor/code/view.d.ts +2 -1
  85. package/build/components/editor/code/view.js +50 -39
  86. package/build/components/editor/diffs/merge.d.ts +1 -10
  87. package/build/components/editor/diffs/merge.js +126 -102
  88. package/build/components/editor/diffs/render.d.ts +1 -2
  89. package/build/components/editor/diffs/render.js +2 -8
  90. package/build/components/editor/diffs/view.d.ts +1 -10
  91. package/build/components/editor/diffs/view.js +112 -105
  92. package/build/components/editor/markdown/editing.d.ts +1 -1
  93. package/build/components/editor/markdown/erase.js +1 -1
  94. package/build/components/editor/markdown/format.d.ts +23 -0
  95. package/build/components/editor/markdown/format.js +319 -0
  96. package/build/components/editor/markdown/html.d.ts +1 -1
  97. package/build/components/editor/markdown/inline.d.ts +1 -1
  98. package/build/components/editor/markdown/inline.js +6 -5
  99. package/build/components/editor/markdown/layout.d.ts +1 -3
  100. package/build/components/editor/markdown/layout.js +1 -1
  101. package/build/components/editor/markdown/model.d.ts +3 -9
  102. package/build/components/editor/markdown/model.js +1 -8
  103. package/build/components/editor/markdown/render.d.ts +2 -1
  104. package/build/components/editor/markdown/render.js +278 -247
  105. package/build/components/editor/markdown/template.d.ts +1 -10
  106. package/build/components/editor/markdown/toolbar.d.ts +32 -0
  107. package/build/components/editor/markdown/toolbar.js +556 -0
  108. package/build/components/editor/markdown/view.d.ts +12 -1
  109. package/build/components/editor/markdown/view.js +154 -60
  110. package/build/components/editor/tree/compact.d.ts +2 -1
  111. package/build/components/editor/tree/compact.js +12 -11
  112. package/build/components/editor/tree/drag.d.ts +3 -2
  113. package/build/components/editor/tree/drag.js +29 -26
  114. package/build/components/editor/tree/edit.d.ts +1 -1
  115. package/build/components/editor/tree/edit.js +10 -9
  116. package/build/components/editor/tree/find.d.ts +1 -1
  117. package/build/components/editor/tree/find.js +10 -6
  118. package/build/components/editor/tree/icons.d.ts +1 -1
  119. package/build/components/editor/tree/icons.js +1 -1
  120. package/build/components/editor/tree/lazy.d.ts +2 -1
  121. package/build/components/editor/tree/lazy.js +17 -16
  122. package/build/components/editor/tree/sticky.d.ts +3 -2
  123. package/build/components/editor/tree/sticky.js +7 -6
  124. package/build/components/editor/tree/template.d.ts +2 -1
  125. package/build/components/editor/tree/template.js +144 -157
  126. package/build/components/editor/viewer/model.js +1 -7
  127. package/build/components/editor/viewer/template.d.ts +1 -10
  128. package/build/components/editor/viewer/template.js +74 -65
  129. package/build/components/editor/workspace/navigate.d.ts +2 -1
  130. package/build/components/editor/workspace/navigate.js +2 -4
  131. package/build/components/editor/workspace/session.d.ts +2 -1
  132. package/build/components/editor/workspace/session.js +14 -9
  133. package/build/components/editor/workspace/shortcuts.js +39 -33
  134. package/build/components/editor/workspace/status.js +2 -2
  135. package/build/components/editor/workspace/statusbar.d.ts +2 -1
  136. package/build/components/editor/workspace/statusbar.js +49 -48
  137. package/build/components/editor/workspace/strip.js +6 -5
  138. package/build/components/editor/workspace/template.d.ts +2 -10
  139. package/build/components/editor/workspace/template.js +149 -144
  140. package/build/components/error/index.d.ts +1 -10
  141. package/build/components/error/index.js +64 -32
  142. package/build/components/error/scss/index.scss +1 -1
  143. package/build/components/filter/index.js +138 -74
  144. package/build/components/filter/scss/index.scss +1 -1
  145. package/build/components/form/action.d.ts +2 -2
  146. package/build/components/form/action.js +12 -9
  147. package/build/components/frame/scss/index.scss +1 -1
  148. package/build/components/group/index.d.ts +3 -1
  149. package/build/components/group/index.js +10 -7
  150. package/build/components/group/scss/index.scss +1 -1
  151. package/build/components/heatmap/index.d.ts +5 -2
  152. package/build/components/heatmap/index.js +72 -59
  153. package/build/components/heatmap/scss/index.scss +1 -1
  154. package/build/components/highlight/index.d.ts +1 -10
  155. package/build/components/highlight/index.js +21 -19
  156. package/build/components/highlight/scss/index.scss +1 -1
  157. package/build/components/icon/index.d.ts +1 -10
  158. package/build/components/icon/index.js +11 -10
  159. package/build/components/image/lazyload.d.ts +2 -1
  160. package/build/components/image/lazyload.js +29 -26
  161. package/build/components/image/scss/index.scss +1 -1
  162. package/build/components/index.d.ts +0 -3
  163. package/build/components/index.js +0 -3
  164. package/build/components/inline-edit/index.d.ts +5 -1
  165. package/build/components/inline-edit/index.js +34 -27
  166. package/build/components/inline-edit/rich.d.ts +10 -15
  167. package/build/components/inline-edit/rich.js +81 -1193
  168. package/build/components/inline-edit/scss/index.scss +1 -1
  169. package/build/components/inline-edit/status.d.ts +3 -2
  170. package/build/components/inline-edit/status.js +22 -18
  171. package/build/components/input/field.d.ts +2 -1
  172. package/build/components/input/field.js +12 -9
  173. package/build/components/input/scrub.d.ts +4 -1
  174. package/build/components/input/scrub.js +25 -20
  175. package/build/components/input/scss/index.scss +1 -1
  176. package/build/components/input/tag.d.ts +4 -2
  177. package/build/components/input/tag.js +58 -53
  178. package/build/components/link/scss/index.scss +1 -1
  179. package/build/components/loading/index.d.ts +2 -1
  180. package/build/components/loading/index.js +6 -3
  181. package/build/components/loading/scss/index.scss +1 -1
  182. package/build/components/marquee/index.d.ts +2 -1
  183. package/build/components/marquee/index.js +77 -72
  184. package/build/components/marquee/scss/index.scss +1 -1
  185. package/build/components/marquee/velocity.js +4 -3
  186. package/build/components/metric/flash.d.ts +2 -1
  187. package/build/components/metric/flash.js +25 -25
  188. package/build/components/metric/index.d.ts +13 -2
  189. package/build/components/metric/index.js +60 -56
  190. package/build/components/metric/scss/index.scss +1 -1
  191. package/build/components/nav/scss/index.scss +1 -1
  192. package/build/components/nav/spy.js +9 -6
  193. package/build/components/nav/toc.d.ts +1 -10
  194. package/build/components/nav/tree.d.ts +3 -1
  195. package/build/components/nav/tree.js +60 -58
  196. package/build/components/notification/index.d.ts +1 -10
  197. package/build/components/notification/index.js +26 -36
  198. package/build/components/notification/scss/index.scss +1 -1
  199. package/build/components/overlay/index.d.ts +4 -5
  200. package/build/components/overlay/index.js +399 -196
  201. package/build/components/overlay/popup.d.ts +5 -6
  202. package/build/components/overlay/popup.js +80 -39
  203. package/build/components/overlay/scss/index.scss +1 -1
  204. package/build/components/pagination/arrows.d.ts +2 -1
  205. package/build/components/pagination/arrows.js +48 -45
  206. package/build/components/pagination/cards.d.ts +5 -2
  207. package/build/components/pagination/cards.js +70 -45
  208. package/build/components/pagination/dots.d.ts +3 -1
  209. package/build/components/pagination/dots.js +29 -24
  210. package/build/components/pagination/index.d.ts +2 -1
  211. package/build/components/pagination/index.js +27 -28
  212. package/build/components/pagination/scss/index.scss +1 -1
  213. package/build/components/panels/dnd.js +30 -22
  214. package/build/components/panels/group.d.ts +3 -2
  215. package/build/components/panels/group.js +134 -131
  216. package/build/components/panels/index.d.ts +2 -10
  217. package/build/components/panels/index.js +84 -80
  218. package/build/components/panels/resize.js +39 -3
  219. package/build/components/panels/scss/index.scss +1 -1
  220. package/build/components/panels/subtree.d.ts +2 -1
  221. package/build/components/panels/subtree.js +8 -7
  222. package/build/components/preview/buttons.d.ts +2 -10
  223. package/build/components/preview/buttons.js +6 -6
  224. package/build/components/preview/code.d.ts +1 -10
  225. package/build/components/preview/code.js +6 -6
  226. package/build/components/preview/header.d.ts +2 -10
  227. package/build/components/preview/header.js +15 -12
  228. package/build/components/preview/index.d.ts +13 -8680
  229. package/build/components/preview/index.js +22 -22
  230. package/build/components/preview/scss/index.scss +1 -1
  231. package/build/components/preview/source.d.ts +1 -10
  232. package/build/components/preview/source.js +18 -15
  233. package/build/components/preview/stage.d.ts +2 -10
  234. package/build/components/preview/stage.js +19 -15
  235. package/build/components/progress/index.d.ts +2 -1
  236. package/build/components/progress/index.js +30 -26
  237. package/build/components/progress/scss/index.scss +1 -1
  238. package/build/components/progress/text.d.ts +2 -1
  239. package/build/components/progress/text.js +27 -25
  240. package/build/components/range/filter.d.ts +2 -1
  241. package/build/components/range/filter.js +126 -127
  242. package/build/components/range/index.d.ts +2 -1
  243. package/build/components/range/index.js +17 -22
  244. package/build/components/range/scss/index.scss +1 -1
  245. package/build/components/relative-time/index.d.ts +3 -1
  246. package/build/components/relative-time/index.js +56 -41
  247. package/build/components/relative-time/scss/index.scss +1 -1
  248. package/build/components/root/scss/index.scss +1 -1
  249. package/build/components/select/expand.d.ts +44 -0
  250. package/build/components/select/expand.js +215 -0
  251. package/build/components/select/index.d.ts +18 -9
  252. package/build/components/select/index.js +108 -81
  253. package/build/components/select/scss/index.scss +1 -1
  254. package/build/components/shell/index.d.ts +2 -1
  255. package/build/components/shell/index.js +127 -109
  256. package/build/components/shell/scss/index.scss +1 -1
  257. package/build/components/shortcut-recorder/index.js +46 -43
  258. package/build/components/shortcut-recorder/scss/index.scss +1 -1
  259. package/build/components/sortable/index.d.ts +2 -714
  260. package/build/components/sortable/index.js +75 -64
  261. package/build/components/sortable/scss/index.scss +1 -1
  262. package/build/components/story/index.d.ts +4 -10
  263. package/build/components/story/index.js +121 -63
  264. package/build/components/story/scss/index.scss +1 -1
  265. package/build/components/surface-field/engine.js +51 -53
  266. package/build/components/surface-field/index.d.ts +2180 -2921
  267. package/build/components/surface-field/index.js +42 -38
  268. package/build/components/surface-field/scss/index.scss +1 -1
  269. package/build/components/surface-field/surface.d.ts +1 -10
  270. package/build/components/surface-field/surface.js +42 -36
  271. package/build/components/tasklist/index.d.ts +8 -1
  272. package/build/components/tasklist/index.js +63 -46
  273. package/build/components/tasklist/scss/index.scss +1 -1
  274. package/build/components/textarea/index.d.ts +722 -2170
  275. package/build/components/textarea/index.js +67 -91
  276. package/build/components/textarea/scss/index.scss +1 -1
  277. package/build/components/theme/cards.d.ts +4 -0
  278. package/build/components/theme/cards.js +21 -0
  279. package/build/components/theme/index.d.ts +12 -3
  280. package/build/components/theme/index.js +38 -14
  281. package/build/components/theme/reveal.d.ts +6 -0
  282. package/build/components/theme/reveal.js +100 -0
  283. package/build/components/theme/scss/index.scss +1 -1
  284. package/build/components/{theme-picker → theme}/shared.d.ts +4 -4
  285. package/build/components/{theme-picker → theme}/shared.js +5 -3
  286. package/build/components/theme/swatches.d.ts +4 -0
  287. package/build/components/theme/swatches.js +21 -0
  288. package/build/components/theme/toggle.d.ts +15 -0
  289. package/build/components/theme/toggle.js +33 -0
  290. package/build/components/toast/index.d.ts +6 -2
  291. package/build/components/toast/index.js +62 -50
  292. package/build/components/toast/scss/index.scss +1 -1
  293. package/build/components/tooltip/menu.d.ts +10 -2
  294. package/build/components/tooltip/menu.js +194 -179
  295. package/build/components/tooltip/onclick.d.ts +1 -10
  296. package/build/components/tooltip/onclick.js +25 -27
  297. package/build/components/tooltip/onhover.d.ts +8 -709
  298. package/build/components/tooltip/onhover.js +60 -60
  299. package/build/components/tooltip/scss/index.scss +1 -1
  300. package/build/components/tooltip/shared.d.ts +5 -3
  301. package/build/components/tooltip/shared.js +201 -91
  302. package/build/components/tooltip/utilities.d.ts +10 -4
  303. package/build/components/tooltip/utilities.js +95 -18
  304. package/build/components/typewriter/index.d.ts +2855 -1413
  305. package/build/components/typewriter/index.js +17 -18
  306. package/build/components/typewriter/retype.d.ts +2 -1
  307. package/build/components/typewriter/retype.js +21 -18
  308. package/build/components/typewriter/rotate.d.ts +2 -1
  309. package/build/components/typewriter/rotate.js +34 -29
  310. package/build/components/typewriter/scss/index.scss +1 -1
  311. package/build/components/uptime/index.d.ts +2 -1
  312. package/build/components/uptime/index.js +51 -47
  313. package/build/components/uptime/scss/index.scss +1 -1
  314. package/build/components/usage-meter/index.d.ts +719 -2161
  315. package/build/components/usage-meter/index.js +23 -20
  316. package/build/components/usage-meter/scss/index.scss +1 -1
  317. package/build/modifiers/border/scss/index.scss +1 -1
  318. package/build/modifiers/box-shadow/scss/index.scss +1 -1
  319. package/build/modifiers/color/scss/index.scss +1 -1
  320. package/build/modifiers/disabled/scss/index.scss +2 -0
  321. package/build/modifiers/glass/index.d.ts +3 -2
  322. package/build/modifiers/glass/index.js +7 -7
  323. package/build/modifiers/glass/scss/index.scss +1 -1
  324. package/build/modifiers/scrollbar/index.d.ts +13 -13
  325. package/build/modifiers/scrollbar/index.js +74 -90
  326. package/build/modifiers/scrollbar/scss/index.scss +1 -1
  327. package/build/shared/animation.d.ts +1 -1
  328. package/build/shared/animation.js +5 -3
  329. package/build/shared/dispatch.d.ts +7 -0
  330. package/build/shared/dispatch.js +25 -0
  331. package/build/shared/drag.d.ts +2 -4
  332. package/build/shared/press.d.ts +1 -1
  333. package/build/shared/press.js +5 -3
  334. package/build/shared/resize.js +2 -25
  335. package/build/shared/transition.d.ts +1 -1
  336. package/build/shared/transition.js +2 -2
  337. package/build/shared/visible.js +1 -24
  338. package/package.json +10 -11
  339. package/src/components/accordion/index.ts +2 -4
  340. package/src/components/accordion/scss/index.scss +17 -14
  341. package/src/components/accordion/scss/variables.scss +6 -7
  342. package/src/components/announcement/scss/index.scss +8 -13
  343. package/src/components/announcement/scss/variables.scss +12 -8
  344. package/src/components/breadcrumb/index.ts +4 -4
  345. package/src/components/breadcrumb/scss/index.scss +12 -12
  346. package/src/components/breadcrumb/scss/variables.scss +5 -12
  347. package/src/components/button/copy.ts +1 -1
  348. package/src/components/button/kbd.ts +8 -7
  349. package/src/components/button/morph/save.ts +2 -2
  350. package/src/components/button/morph/template.ts +18 -20
  351. package/src/components/button/scss/index.scss +84 -59
  352. package/src/components/button/scss/variables.scss +44 -29
  353. package/src/components/button/sidebar.ts +2 -2
  354. package/src/components/button/split.ts +7 -8
  355. package/src/components/capslock/index.ts +4 -4
  356. package/src/components/capslock/scss/index.scss +4 -2
  357. package/src/components/capslock/scss/variables.scss +14 -15
  358. package/src/components/card/scss/index.scss +10 -19
  359. package/src/components/card/scss/variables.scss +6 -2
  360. package/src/components/cc/index.ts +32 -33
  361. package/src/components/cc/scss/index.scss +37 -7
  362. package/src/components/cc/scss/variables.scss +13 -10
  363. package/src/components/chat/minimap/index.ts +14 -13
  364. package/src/components/chat/minimap/scss/index.scss +19 -28
  365. package/src/components/chat/minimap/scss/variables.scss +33 -29
  366. package/src/components/checkbox/group.ts +5 -5
  367. package/src/components/checkbox/options.ts +2 -2
  368. package/src/components/checkbox/scss/index.scss +10 -6
  369. package/src/components/checkbox/scss/variables.scss +59 -44
  370. package/src/components/clipboard/write.ts +2 -1
  371. package/src/components/color-picker/index.ts +9 -11
  372. package/src/components/color-picker/scss/index.scss +2 -2
  373. package/src/components/color-picker/scss/variables.scss +26 -41
  374. package/src/components/command/palette.ts +15 -29
  375. package/src/components/command/scss/index.scss +8 -13
  376. package/src/components/command/scss/variables.scss +8 -8
  377. package/src/components/command/search.ts +3 -8
  378. package/src/components/container/scss/index.scss +2 -4
  379. package/src/components/container/scss/variables.scss +0 -2
  380. package/src/components/counter/index.ts +2 -1
  381. package/src/components/counter/scss/index.scss +2 -1
  382. package/src/components/counter/scss/variables.scss +3 -9
  383. package/src/components/dock/index.ts +17 -8
  384. package/src/components/dock/scss/index.scss +26 -56
  385. package/src/components/dock/scss/variables.scss +11 -20
  386. package/src/components/editor/code/features.ts +4 -5
  387. package/src/components/editor/code/field.ts +1 -1
  388. package/src/components/editor/code/find.ts +1 -1
  389. package/src/components/editor/code/folding.ts +1 -1
  390. package/src/components/editor/code/html.ts +17 -0
  391. package/src/components/editor/code/minimap.ts +7 -5
  392. package/src/components/editor/code/rows.ts +1 -14
  393. package/src/components/editor/code/scss/_editor.scss +10 -23
  394. package/src/components/editor/code/scss/_features.scss +17 -26
  395. package/src/components/editor/code/scss/_minimap.scss +29 -0
  396. package/src/components/editor/code/scss/_services.scss +4 -7
  397. package/src/components/editor/code/scss/index.scss +0 -1
  398. package/src/components/editor/code/scss/variables.scss +22 -14
  399. package/src/components/editor/code/search.ts +1 -1
  400. package/src/components/editor/code/services/completion.ts +1 -0
  401. package/src/components/editor/code/services/hover.ts +1 -0
  402. package/src/components/editor/code/services/index.ts +1 -1
  403. package/src/components/editor/code/services/model.ts +1 -1
  404. package/src/components/editor/code/services/session.ts +1 -4
  405. package/src/components/editor/code/syntax.ts +1 -1
  406. package/src/components/editor/diffs/merge.ts +3 -3
  407. package/src/components/editor/diffs/render.ts +2 -17
  408. package/src/components/editor/diffs/scss/_diffs.scss +22 -57
  409. package/src/components/editor/diffs/scss/_merge.scss +8 -29
  410. package/src/components/editor/diffs/scss/variables.scss +1 -10
  411. package/src/components/editor/diffs/view.ts +4 -5
  412. package/src/components/editor/markdown/editing.ts +1 -1
  413. package/src/components/editor/markdown/erase.ts +3 -3
  414. package/src/components/editor/markdown/format.ts +517 -0
  415. package/src/components/editor/markdown/html.ts +1 -1
  416. package/src/components/editor/markdown/inline.ts +9 -6
  417. package/src/components/editor/markdown/layout.ts +1 -1
  418. package/src/components/editor/markdown/model.ts +2 -17
  419. package/src/components/editor/markdown/render.ts +3 -2
  420. package/src/components/editor/markdown/scss/index.scss +132 -57
  421. package/src/components/editor/markdown/scss/variables.scss +124 -4
  422. package/src/components/editor/markdown/toolbar.ts +628 -0
  423. package/src/components/editor/markdown/view.ts +121 -10
  424. package/src/components/editor/tree/drag.ts +16 -15
  425. package/src/components/editor/tree/icons.ts +1 -1
  426. package/src/components/editor/tree/scss/index.scss +69 -44
  427. package/src/components/editor/tree/scss/variables.scss +75 -44
  428. package/src/components/editor/tree/sticky.ts +1 -1
  429. package/src/components/editor/tree/template.ts +2 -2
  430. package/src/components/editor/viewer/model.ts +1 -14
  431. package/src/components/editor/viewer/scss/_viewer.scss +22 -72
  432. package/src/components/editor/viewer/scss/index.scss +1 -1
  433. package/src/components/editor/viewer/scss/variables.scss +1 -3
  434. package/src/components/editor/viewer/template.ts +4 -2
  435. package/src/components/editor/workspace/navigate.ts +3 -6
  436. package/src/components/editor/workspace/scss/_keybindings.scss +9 -7
  437. package/src/components/editor/workspace/scss/_status.scss +14 -38
  438. package/src/components/editor/workspace/scss/_tabs.scss +6 -3
  439. package/src/components/editor/workspace/scss/index.scss +38 -33
  440. package/src/components/editor/workspace/scss/variables.scss +57 -53
  441. package/src/components/editor/workspace/session.ts +20 -13
  442. package/src/components/editor/workspace/status.ts +2 -2
  443. package/src/components/editor/workspace/template.ts +12 -21
  444. package/src/components/error/index.ts +36 -18
  445. package/src/components/error/scss/index.scss +3 -1
  446. package/src/components/error/scss/variables.scss +1 -0
  447. package/src/components/filter/index.ts +146 -99
  448. package/src/components/filter/scss/variables.scss +1 -1
  449. package/src/components/form/action.ts +1 -1
  450. package/src/components/frame/scss/index.scss +10 -6
  451. package/src/components/frame/scss/variables.scss +11 -6
  452. package/src/components/grid/scss/index.scss +1 -1
  453. package/src/components/grid/scss/variables.scss +1 -1
  454. package/src/components/heatmap/index.ts +2 -2
  455. package/src/components/heatmap/scss/index.scss +22 -17
  456. package/src/components/heatmap/scss/variables.scss +16 -34
  457. package/src/components/highlight/index.ts +0 -1
  458. package/src/components/highlight/scss/index.scss +13 -21
  459. package/src/components/highlight/scss/variables.scss +12 -14
  460. package/src/components/icon/index.ts +0 -4
  461. package/src/components/icon/scss/index.scss +2 -0
  462. package/src/components/image/lazyload.ts +1 -1
  463. package/src/components/image/scss/index.scss +14 -13
  464. package/src/components/image/scss/variables.scss +16 -12
  465. package/src/components/index.ts +0 -3
  466. package/src/components/inline-edit/index.ts +6 -5
  467. package/src/components/inline-edit/rich.ts +85 -1400
  468. package/src/components/inline-edit/scss/index.scss +24 -191
  469. package/src/components/inline-edit/scss/variables.scss +24 -191
  470. package/src/components/inline-edit/status.ts +6 -3
  471. package/src/components/input/field.ts +2 -2
  472. package/src/components/input/scrub.ts +1 -5
  473. package/src/components/input/scss/_scrub.scss +7 -0
  474. package/src/components/input/scss/_tag.scss +4 -2
  475. package/src/components/input/scss/index.scss +1 -2
  476. package/src/components/input/scss/variables.scss +14 -21
  477. package/src/components/input/tag.ts +6 -7
  478. package/src/components/json/download.ts +2 -1
  479. package/src/components/link/scss/index.scss +0 -1
  480. package/src/components/loading/index.ts +1 -1
  481. package/src/components/loading/scss/index.scss +4 -4
  482. package/src/components/loading/scss/variables.scss +4 -4
  483. package/src/components/marquee/index.ts +5 -5
  484. package/src/components/marquee/scss/index.scss +6 -4
  485. package/src/components/marquee/scss/variables.scss +3 -4
  486. package/src/components/marquee/velocity.ts +7 -3
  487. package/src/components/metric/flash.ts +1 -1
  488. package/src/components/metric/index.ts +5 -13
  489. package/src/components/metric/scss/_flash.scss +9 -4
  490. package/src/components/metric/scss/index.scss +11 -9
  491. package/src/components/metric/scss/variables.scss +73 -73
  492. package/src/components/nav/scss/index.scss +2 -1
  493. package/src/components/nav/scss/variables.scss +9 -11
  494. package/src/components/nav/spy.ts +15 -8
  495. package/src/components/nav/tree.ts +28 -30
  496. package/src/components/notification/index.ts +37 -16
  497. package/src/components/notification/scss/index.scss +32 -17
  498. package/src/components/notification/scss/variables.scss +12 -12
  499. package/src/components/overlay/index.ts +212 -142
  500. package/src/components/overlay/popup.ts +89 -52
  501. package/src/components/overlay/scss/index.scss +68 -85
  502. package/src/components/overlay/scss/variables.scss +15 -12
  503. package/src/components/pagination/cards.ts +1 -2
  504. package/src/components/pagination/index.ts +1 -7
  505. package/src/components/pagination/scss/index.scss +12 -12
  506. package/src/components/pagination/scss/variables.scss +33 -21
  507. package/src/components/panels/dnd.ts +35 -29
  508. package/src/components/panels/group.ts +5 -13
  509. package/src/components/panels/index.ts +4 -6
  510. package/src/components/panels/resize.ts +30 -4
  511. package/src/components/panels/scss/index.scss +13 -28
  512. package/src/components/panels/scss/variables.scss +3 -3
  513. package/src/components/preview/code.ts +1 -1
  514. package/src/components/preview/index.ts +12 -7
  515. package/src/components/preview/scss/index.scss +30 -15
  516. package/src/components/preview/scss/variables.scss +56 -34
  517. package/src/components/progress/scss/index.scss +14 -11
  518. package/src/components/progress/scss/variables.scss +34 -31
  519. package/src/components/progress/text.ts +9 -8
  520. package/src/components/range/filter.ts +9 -11
  521. package/src/components/range/index.ts +2 -9
  522. package/src/components/range/scss/_filter.scss +4 -3
  523. package/src/components/range/scss/_slider.scss +2 -1
  524. package/src/components/range/scss/variables.scss +2 -16
  525. package/src/components/relative-time/index.ts +15 -16
  526. package/src/components/relative-time/scss/index.scss +8 -4
  527. package/src/components/relative-time/scss/variables.scss +7 -3
  528. package/src/components/root/scss/index.scss +3 -0
  529. package/src/components/root/scss/variables.scss +11 -11
  530. package/src/components/select/expand.ts +272 -0
  531. package/src/components/select/index.ts +142 -119
  532. package/src/components/select/scss/index.scss +79 -7
  533. package/src/components/select/scss/variables.scss +67 -3
  534. package/src/components/shell/index.ts +73 -50
  535. package/src/components/shell/scss/index.scss +34 -47
  536. package/src/components/shell/scss/variables.scss +16 -16
  537. package/src/components/shortcut-recorder/index.ts +14 -17
  538. package/src/components/shortcut-recorder/scss/index.scss +15 -10
  539. package/src/components/shortcut-recorder/scss/variables.scss +4 -7
  540. package/src/components/sortable/index.ts +25 -28
  541. package/src/components/sortable/scss/index.scss +28 -27
  542. package/src/components/sortable/scss/variables.scss +12 -7
  543. package/src/components/story/index.ts +110 -47
  544. package/src/components/story/scss/index.scss +13 -18
  545. package/src/components/story/scss/variables.scss +4 -16
  546. package/src/components/surface-field/engine.ts +71 -72
  547. package/src/components/surface-field/index.ts +17 -20
  548. package/src/components/surface-field/scss/index.scss +9 -11
  549. package/src/components/surface-field/scss/variables.scss +20 -23
  550. package/src/components/surface-field/surface.ts +4 -3
  551. package/src/components/tasklist/index.ts +1 -6
  552. package/src/components/tasklist/scss/index.scss +22 -26
  553. package/src/components/tasklist/scss/variables.scss +14 -20
  554. package/src/components/textarea/index.ts +49 -91
  555. package/src/components/textarea/scss/index.scss +20 -15
  556. package/src/components/textarea/scss/variables.scss +15 -0
  557. package/src/components/theme/cards.ts +19 -0
  558. package/src/components/theme/index.ts +58 -17
  559. package/src/components/theme/reveal.ts +190 -0
  560. package/src/components/theme/scss/index.scss +109 -0
  561. package/src/components/theme/scss/variables.scss +153 -3
  562. package/src/components/{theme-picker → theme}/shared.ts +9 -6
  563. package/src/components/theme/swatches.ts +15 -0
  564. package/src/components/theme/toggle.ts +47 -0
  565. package/src/components/toast/index.ts +2 -3
  566. package/src/components/toast/scss/index.scss +63 -0
  567. package/src/components/toast/scss/variables.scss +121 -16
  568. package/src/components/tooltip/menu.ts +141 -131
  569. package/src/components/tooltip/onclick.ts +16 -21
  570. package/src/components/tooltip/onhover.ts +5 -8
  571. package/src/components/tooltip/scss/index.scss +534 -56
  572. package/src/components/tooltip/scss/variables.scss +64 -13
  573. package/src/components/tooltip/shared.ts +129 -87
  574. package/src/components/tooltip/utilities.ts +75 -24
  575. package/src/components/typewriter/index.ts +7 -10
  576. package/src/components/typewriter/rotate.ts +11 -7
  577. package/src/components/typewriter/scss/index.scss +2 -0
  578. package/src/components/typewriter/scss/variables.scss +1 -1
  579. package/src/components/uptime/index.ts +12 -6
  580. package/src/components/uptime/scss/index.scss +86 -75
  581. package/src/components/uptime/scss/variables.scss +82 -51
  582. package/src/components/usage-meter/index.ts +1 -1
  583. package/src/components/usage-meter/scss/index.scss +0 -3
  584. package/src/components/usage-meter/scss/variables.scss +13 -14
  585. package/src/css-utilities/background.scss +9 -1
  586. package/src/css-utilities/border.scss +3 -0
  587. package/src/css-utilities/box-shadow.scss +3 -2
  588. package/src/css-utilities/color.scss +13 -3
  589. package/src/css-utilities/disabled.scss +12 -0
  590. package/src/css-utilities/font/geist/index.scss +2 -1
  591. package/src/css-utilities/font/montserrat/index.scss +1 -1
  592. package/src/css-utilities/group.scss +1 -2
  593. package/src/css-utilities/icon.scss +1 -0
  594. package/src/css-utilities/layer.scss +2 -1
  595. package/src/css-utilities/skeleton.scss +4 -1
  596. package/src/css-utilities/surface.scss +97 -108
  597. package/src/css-utilities/text.scss +13 -13
  598. package/src/modifiers/background/scss/variables.scss +2 -4
  599. package/src/modifiers/border/scss/variables.scss +6 -8
  600. package/src/modifiers/disabled/scss/index.scss +5 -0
  601. package/src/modifiers/glass/index.ts +2 -1
  602. package/src/modifiers/glass/scss/index.scss +8 -11
  603. package/src/modifiers/glass/scss/variables.scss +1 -0
  604. package/src/modifiers/scrollbar/index.ts +94 -113
  605. package/src/modifiers/scrollbar/scss/index.scss +20 -2
  606. package/src/modifiers/scrollbar/scss/variables.scss +2 -2
  607. package/src/normalize/scss/index.scss +1 -0
  608. package/src/shared/anchor.ts +1 -1
  609. package/src/shared/animation.ts +6 -4
  610. package/src/shared/dispatch.ts +42 -0
  611. package/src/shared/drag.ts +2 -1
  612. package/src/shared/press.ts +7 -5
  613. package/src/shared/resize.ts +4 -35
  614. package/src/shared/scss/list.scss +1 -2
  615. package/src/shared/transition.ts +2 -2
  616. package/src/shared/visible.ts +3 -35
  617. package/src/tokens/scss/color.scss +16 -20
  618. package/src/tokens/scss/focus.scss +5 -0
  619. package/src/tokens/scss/font-size.scss +1 -2
  620. package/src/tokens/scss/index.scss +1 -0
  621. package/src/tokens/scss/scale.scss +4 -8
  622. package/src/tokens/scss/size.scss +3 -3
  623. package/src/tokens/scss/spacer.scss +1 -1
  624. package/src/tokens/scss/state.scss +11 -30
  625. package/vite-env.d.ts +1 -1
  626. package/vite.config.ts +10 -8
  627. package/build/components/datalist/index.d.ts +0 -42
  628. package/build/components/datalist/index.js +0 -186
  629. package/build/components/datalist/scss/index.scss +0 -2
  630. package/build/components/inline-edit/format.d.ts +0 -29
  631. package/build/components/inline-edit/format.js +0 -112
  632. package/build/components/inline-edit/history.d.ts +0 -14
  633. package/build/components/inline-edit/history.js +0 -40
  634. package/build/components/inline-edit/markdown.d.ts +0 -7
  635. package/build/components/inline-edit/markdown.js +0 -314
  636. package/build/components/inline-edit/model.d.ts +0 -61
  637. package/build/components/inline-edit/model.js +0 -192
  638. package/build/components/inline-edit/selection.d.ts +0 -7
  639. package/build/components/inline-edit/selection.js +0 -114
  640. package/build/components/inline-edit/utilities.d.ts +0 -4
  641. package/build/components/inline-edit/utilities.js +0 -12
  642. package/build/components/sticky-header/index.d.ts +0 -2166
  643. package/build/components/sticky-header/index.js +0 -58
  644. package/build/components/sticky-header/scss/index.scss +0 -2
  645. package/build/components/theme-picker/cards.d.ts +0 -13
  646. package/build/components/theme-picker/cards.js +0 -17
  647. package/build/components/theme-picker/index.d.ts +0 -12
  648. package/build/components/theme-picker/index.js +0 -7
  649. package/build/components/theme-picker/scss/index.scss +0 -2
  650. package/build/components/theme-picker/swatches.d.ts +0 -13
  651. package/build/components/theme-picker/swatches.js +0 -17
  652. package/build/components/theme-picker/toggle.d.ts +0 -19
  653. package/build/components/theme-picker/toggle.js +0 -109
  654. package/src/components/datalist/index.ts +0 -256
  655. package/src/components/datalist/scss/index.scss +0 -104
  656. package/src/components/datalist/scss/variables.scss +0 -43
  657. package/src/components/inline-edit/format.ts +0 -183
  658. package/src/components/inline-edit/history.ts +0 -71
  659. package/src/components/inline-edit/markdown.ts +0 -485
  660. package/src/components/inline-edit/model.ts +0 -366
  661. package/src/components/inline-edit/selection.ts +0 -188
  662. package/src/components/inline-edit/utilities.ts +0 -18
  663. package/src/components/sticky-header/index.ts +0 -78
  664. package/src/components/sticky-header/scss/index.scss +0 -141
  665. package/src/components/sticky-header/scss/variables.scss +0 -78
  666. package/src/components/theme-picker/cards.ts +0 -19
  667. package/src/components/theme-picker/index.ts +0 -12
  668. package/src/components/theme-picker/scss/index.scss +0 -174
  669. package/src/components/theme-picker/scss/variables.scss +0 -220
  670. package/src/components/theme-picker/swatches.ts +0 -15
  671. package/src/components/theme-picker/toggle.ts +0 -150
  672. package/src/components/tooltip/scss/_center.scss +0 -9
  673. package/src/components/tooltip/scss/_east.scss +0 -33
  674. package/src/components/tooltip/scss/_menu.scss +0 -325
  675. package/src/components/tooltip/scss/_north.scss +0 -33
  676. package/src/components/tooltip/scss/_shared.scss +0 -112
  677. package/src/components/tooltip/scss/_south.scss +0 -33
  678. package/src/components/tooltip/scss/_west.scss +0 -33
@@ -1,1233 +1,121 @@
1
+ import * as reactivity_u0 from '@esportsplus/reactivity';
2
+ import { effect, read, signal, write } from '@esportsplus/reactivity';
1
3
  import * as template_u1 from '@esportsplus/template';
2
4
  import { component } from '@esportsplus/template';
3
- import * as reactivity_u0 from '@esportsplus/reactivity';
4
- import { ReactiveArray, effect, flush, read, signal, untrack, write } from '@esportsplus/reactivity';
5
- import faces from '../button/faces.js';
6
- import checkbox from '../checkbox/index.js';
7
- import clipboard from '../clipboard/write.js';
5
+ import markdown from '../editor/markdown/index.js';
8
6
  import icon from '../icon/index.js';
9
- import input from '../input/index.js';
10
- import selectInput from '../select/index.js';
11
- import tooltip from '../tooltip/index.js';
12
7
  import { mac } from '../../shared/platform.js';
13
- import { observe } from '../../shared/resize.js';
14
- import { viewport } from '../../shared/viewport.js';
15
- import { active, check, clear, extent, kindAt, link, setKind, toggle, unformat } from './format.js';
16
- import history from './history.js';
17
- import { parse, serialize } from './markdown.js';
18
- import { caret, empty, insert, length, list, nest, order, paste, remove, slice, sort, split, styleAt, text } from './model.js';
19
- import { capture, elements, restore, target, written } from './selection.js';
20
8
  import status, { INLINE_EDIT_STATUS } from './status.js';
21
- import { INLINE_LINE_BREAKS, safe } from './utilities.js';
22
- import boldSvg from '@esportsplus/ui/svg/bold.svg';
23
9
  import checkSvg from '@esportsplus/ui/svg/check.svg';
24
- import clearSvg from '@esportsplus/ui/svg/clear-format.svg';
25
- import closeSvg from '@esportsplus/ui/svg/close.svg';
26
- import codeSvg from '@esportsplus/ui/svg/code.svg';
27
- import copySvg from '@esportsplus/ui/svg/copy.svg';
28
- import highlightSvg from '@esportsplus/ui/svg/highlight.svg';
29
- import italicSvg from '@esportsplus/ui/svg/italic.svg';
30
- import linkSvg from '@esportsplus/ui/svg/link.svg';
31
- import openSvg from '@esportsplus/ui/svg/external-link.svg';
32
10
  import pencilSvg from '@esportsplus/ui/svg/pencil.svg';
33
- import strikeSvg from '@esportsplus/ui/svg/strikethrough.svg';
34
- import unlinkSvg from '@esportsplus/ui/svg/unlink.svg';
35
- import '../button/scss/index.scss';
36
- import '../select/scss/index.scss';
37
11
  import './scss/index.scss';
38
- const template_1rmqqqz5 = template_u1.template(`<strong>`);
39
- const template_1rmqqqz8 = template_u1.template(`<code>`);
40
- const template_1rmqqqzb = template_u1.template(`<mark>`);
41
- const template_1rmqqqze = template_u1.template(`<em>`);
42
- const template_1rmqqqzh = template_u1.template(`<a>`);
43
- const template_1rmqqqzk = template_u1.template(`<s>`);
44
- const template_1rmqqqzn = template_u1.template(`<ul>`);
45
- const template_1rmqqqzq = template_u1.template(`<ol>`);
46
- const template_1rmqqqzt = template_u1.template(`<ul data-task>`);
47
- const template_1rmqqqzw = template_u1.template(`<!--$-->`);
48
- const template_1rmqqqzy = template_u1.template(`<br data-filler>`);
49
- const template_1rmqqqz10 = template_u1.template(`<li data-block>`);
50
- const template_1rmqqqz13 = template_u1.template(`<pre data-block>`);
51
- const template_1rmqqqz16 = template_u1.template(`<h1 data-block>`);
52
- const template_1rmqqqz19 = template_u1.template(`<h2 data-block>`);
53
- const template_1rmqqqz1c = template_u1.template(`<h3 data-block>`);
54
- const template_1rmqqqz1f = template_u1.template(`<blockquote data-block>`);
55
- const template_1rmqqqz1i = template_u1.template(`<li data-block><span class='inline-edit-task' contenteditable='false'>`);
56
- const template_1rmqqqz1m = template_u1.template(`<p data-block>`);
57
- const template_1rmqqqz1p = template_u1.template(`<button class='button button--feedback inline-edit-toolbar-button' type='button'>`);
58
- const template_1rmqqqz1r = template_u1.template(`<br>`);
59
- const template_1rmqqqz1t = template_u1.template(`<div class='inline-edit'><div class='inline-edit-editor' contenteditable='true' role='textbox'></div><div class='tooltip tooltip--context inline-edit-anchor'><div aria-label='Formatting' class='tooltip-content tooltip-content--context inline-edit-toolbar' role='toolbar'><div class='inline-edit-toolbar-format'><!--$--><!--$--><!--$--><!--$--></div></div></div><span aria-hidden='true' class='inline-edit-icon'><!--$--></span><span aria-live='polite' class='inline-edit-label'>`);
60
- const template_1rmqqqz27 = template_u1.template(`<!--$--><!--$-->`);
61
- const template_1rmqqqz2a = template_u1.template(`<span aria-hidden='true' class='inline-edit-toolbar-divider'>`);
62
- const template_1rmqqqz2c = template_u1.template(`<div class='inline-edit-toolbar-link'><!--$--><button aria-label='Apply link' class='button button--feedback inline-edit-toolbar-button' type='button'></button><button aria-label='Open link in a new tab' class='button button--feedback inline-edit-toolbar-button' type='button'></button><button aria-label='Remove link' class='button button--feedback inline-edit-toolbar-button inline-edit-toolbar-unlink' type='button'>`);
63
- class ReactiveObject_1rmqqqz0 extends reactivity_u0.ReactiveObject {
64
- #active = this[reactivity_u0.SIGNAL](false);
65
- #error = this[reactivity_u0.SIGNAL]('');
66
- #selected = this[reactivity_u0.SIGNAL]('paragraph');
67
- constructor() {
68
- super(null);
69
- }
70
- get active() {
71
- return reactivity_u0.read(this.#active);
72
- }
73
- set active(_v0) {
74
- reactivity_u0.write(this.#active, _v0);
75
- }
76
- get error() {
77
- return reactivity_u0.read(this.#error);
78
- }
79
- set error(_v1) {
80
- reactivity_u0.write(this.#error, _v1);
81
- }
82
- get selected() {
83
- return reactivity_u0.read(this.#selected);
84
- }
85
- set selected(_v2) {
86
- reactivity_u0.write(this.#selected, _v2);
87
- }
88
- }
89
- class ReactiveObject_1rmqqqz1 extends reactivity_u0.ReactiveObject {
90
- #existing = this[reactivity_u0.SIGNAL](false);
91
- #invalid = this[reactivity_u0.SIGNAL](false);
92
- #url = this[reactivity_u0.SIGNAL]('');
93
- constructor() {
94
- super(null);
95
- }
96
- get existing() {
97
- return reactivity_u0.read(this.#existing);
98
- }
99
- set existing(_v0) {
100
- reactivity_u0.write(this.#existing, _v0);
101
- }
102
- get invalid() {
103
- return reactivity_u0.read(this.#invalid);
104
- }
105
- set invalid(_v1) {
106
- reactivity_u0.write(this.#invalid, _v1);
107
- }
108
- get url() {
109
- return reactivity_u0.read(this.#url);
110
- }
111
- set url(_v2) {
112
- reactivity_u0.write(this.#url, _v2);
113
- }
114
- }
115
- class ReactiveObject_1rmqqqz2 extends reactivity_u0.ReactiveObject {
116
- #copied;
117
- #focus = this[reactivity_u0.SIGNAL](0);
118
- #live = this[reactivity_u0.SIGNAL]('');
119
- constructor(_p0) {
120
- super(null);
121
- this.#copied = this[reactivity_u0.SIGNAL](_p0);
122
- }
123
- get copied() {
124
- return reactivity_u0.read(this.#copied);
125
- }
126
- set copied(_v0) {
127
- reactivity_u0.write(this.#copied, _v0);
128
- }
129
- get focus() {
130
- return reactivity_u0.read(this.#focus);
131
- }
132
- set focus(_v1) {
133
- reactivity_u0.write(this.#focus, _v1);
134
- }
135
- get live() {
136
- return reactivity_u0.read(this.#live);
137
- }
138
- set live(_v2) {
139
- reactivity_u0.write(this.#live, _v2);
140
- }
141
- }
142
- class ReactiveObject_1rmqqqz3 extends reactivity_u0.ReactiveObject {
143
- #instant = this[reactivity_u0.SIGNAL](false);
144
- #link = this[reactivity_u0.SIGNAL](false);
145
- #open = this[reactivity_u0.SIGNAL](false);
146
- #origin = this[reactivity_u0.SIGNAL]('');
147
- #x = this[reactivity_u0.SIGNAL](0);
148
- #y = this[reactivity_u0.SIGNAL](0);
149
- constructor() {
150
- super(null);
151
- }
152
- get instant() {
153
- return reactivity_u0.read(this.#instant);
154
- }
155
- set instant(_v0) {
156
- reactivity_u0.write(this.#instant, _v0);
157
- }
158
- get link() {
159
- return reactivity_u0.read(this.#link);
160
- }
161
- set link(_v1) {
162
- reactivity_u0.write(this.#link, _v1);
163
- }
164
- get open() {
165
- return reactivity_u0.read(this.#open);
166
- }
167
- set open(_v2) {
168
- reactivity_u0.write(this.#open, _v2);
169
- }
170
- get origin() {
171
- return reactivity_u0.read(this.#origin);
172
- }
173
- set origin(_v3) {
174
- reactivity_u0.write(this.#origin, _v3);
175
- }
176
- get x() {
177
- return reactivity_u0.read(this.#x);
178
- }
179
- set x(_v4) {
180
- reactivity_u0.write(this.#x, _v4);
181
- }
182
- get y() {
183
- return reactivity_u0.read(this.#y);
184
- }
185
- set y(_v5) {
186
- reactivity_u0.write(this.#y, _v5);
187
- }
188
- }
189
- const URL_SCHEME = /^[a-z][a-z\d+.-]*:/i;
190
- const RELATIVE_URL = /^[/#?]/;
191
- const EMAIL = /^[^\s/@]+@[^\s/@]+\.[^\s/@]+$/;
192
- const MAC_SHORTCUT = /(⇧?)(\w)$/;
193
- const ACTIONS = [
194
- { action: 'bold', label: 'Bold', shortcut: 'B' },
195
- { action: 'italic', label: 'Italic', shortcut: 'I' },
196
- { action: 'strike', label: 'Strikethrough', shortcut: 'Shift+X' },
197
- { action: 'code', label: 'Code', shortcut: 'E' },
198
- { action: 'highlight', label: 'Highlight', shortcut: 'Shift+H' },
199
- { action: 'link', label: 'Link', shortcut: 'K' },
200
- { action: 'clear', label: 'Clear formatting' },
201
- { action: 'copy', label: 'Copy as markdown' }
202
- ];
12
+ const template_1rmqqqz1 = template_u1.template(`<div><!--$--><span aria-hidden='true' class='inline-edit-icon'><!--$-->`, true);
203
13
  const BASE = ['bold', 'italic', 'link', 'copy'];
204
- const COPIED_FOR = 1400;
205
- const FORMATS = {
206
- formatBold: 'bold',
207
- formatItalic: 'italic',
208
- formatStrikeThrough: 'strike'
209
- };
210
- const GAP = 8;
211
- const HINT = Symbol();
212
- const ICONS = {
213
- apply: checkSvg,
214
- bold: boldSvg,
215
- clear: clearSvg,
216
- code: codeSvg,
217
- highlight: highlightSvg,
218
- italic: italicSvg,
219
- link: linkSvg,
220
- open: openSvg,
221
- strike: strikeSvg,
222
- unlink: unlinkSvg
223
- };
224
14
  const INLINE_EDIT_RICH_EDITOR = Symbol.for('@esportsplus/ui/inline-edit.rich.editor');
225
- const INLINE_EDIT_RICH_TOOLBAR = Symbol.for('@esportsplus/ui/inline-edit.rich.toolbar');
226
- const KINDS = [
227
- { label: 'Text', value: 'paragraph' },
228
- { feature: 'heading', label: 'Heading 1', value: 'h1' },
229
- { feature: 'heading', label: 'Heading 2', value: 'h2' },
230
- { feature: 'heading', label: 'Heading 3', value: 'h3' },
231
- { feature: 'quote', label: 'Quote', value: 'quote' },
232
- { feature: 'codeblock', label: 'Code block', value: 'codeblock' },
233
- { feature: 'bullet', label: 'Bulleted list', value: 'bullet' },
234
- { feature: 'ordered', label: 'Numbered list', value: 'ordered' },
235
- { feature: 'task', label: 'Checklist', value: 'task' }
236
- ];
237
- const TOOLTIP_DELAY = 700;
238
- function address(value) {
239
- let href = value.trim();
240
- if (href && !URL_SCHEME.test(href) && !RELATIVE_URL.test(href)) {
241
- href = (EMAIL.test(href) ? 'mailto:' : 'https://') + href;
242
- }
243
- return href && safe(href) ? href : '';
244
- }
245
- function around(doc, pos, type) {
246
- let backward = type.includes('Backward'), value = text(doc[pos.block].runs), to;
247
- if (backward && pos.offset === 0) {
248
- return pos.block > 0 ? { end: pos, start: { block: pos.block - 1, offset: length(doc[pos.block - 1].runs) } } : null;
249
- }
250
- if (!backward && pos.offset === value.length) {
251
- return pos.block < doc.length - 1 ? { end: { block: pos.block + 1, offset: 0 }, start: pos } : null;
252
- }
253
- if (type.includes('Line')) {
254
- let edge = backward ? value.lastIndexOf('\n', pos.offset - 1) + 1 : value.indexOf('\n', pos.offset);
255
- if (edge < 0) {
256
- edge = value.length;
257
- }
258
- to = edge === pos.offset ? pos.offset + (backward ? -1 : 1) : edge;
259
- }
260
- else {
261
- to = boundary(value, pos.offset, backward, type.includes('Word') ? 'word' : 'grapheme');
262
- }
263
- let other = { block: pos.block, offset: to };
264
- return backward ? { end: pos, start: other } : { end: other, start: pos };
265
- }
266
- function boundary(value, offset, backward, granularity) {
267
- let edge = backward ? 0 : value.length;
268
- for (let { index, isWordLike, segment } of new Intl.Segmenter(undefined, { granularity }).segment(value)) {
269
- let counts = granularity === 'grapheme' || isWordLike;
270
- if (backward && index < offset && counts) {
271
- edge = index;
272
- }
273
- else if (!backward && index + segment.length > offset && counts) {
274
- return Math.max(index + segment.length, offset + 1);
275
- }
276
- }
277
- return edge;
278
- }
279
- function collapsed(span) {
280
- return span.start.block === span.end.block && span.start.offset === span.end.offset;
281
- }
282
- function follows(view, next) {
283
- if (view.block === next) {
284
- return true;
285
- }
286
- if (view.block.key !== next.key || view.block.kind !== next.kind || view.block.runs !== next.runs) {
287
- return false;
288
- }
289
- view.block = next;
290
- write(view.checked, next.checked);
291
- return true;
292
- }
293
- function glyph(action) {
294
- return icon({ 'aria-hidden': 'true', class: 'inline-edit-toolbar-icon' }, ICONS[action]);
295
- }
296
- function hint(label, shortcut) {
297
- if (!shortcut) {
298
- return label;
299
- }
300
- return mac()
301
- ? `${label} ${shortcut.replace('Shift+', '⇧')}`.replace(MAC_SHORTCUT, '$1⌘$2')
302
- : `${label} Ctrl+${shortcut}`;
303
- }
304
- function inline(trees) {
305
- return trees.map((tree) => {
306
- if ('text' in tree) {
307
- return lines(tree.text);
308
- }
309
- let children = inline(tree.children);
310
- switch (tree.mark) {
311
- case 'bold':
312
- return (() => {
313
- let root_1rmqqqz4 = template_1rmqqqz5(), element_1rmqqqz6 = root_1rmqqqz4.firstChild;
314
- template_u1.slot(element_1rmqqqz6, children, 1);
315
- return root_1rmqqqz4;
316
- })();
317
- case 'code':
318
- return (() => {
319
- let root_1rmqqqz7 = template_1rmqqqz8(), element_1rmqqqz9 = root_1rmqqqz7.firstChild;
320
- template_u1.slot(element_1rmqqqz9, children, 1);
321
- return root_1rmqqqz7;
322
- })();
323
- case 'highlight':
324
- return (() => {
325
- let root_1rmqqqza = template_1rmqqqzb(), element_1rmqqqzc = root_1rmqqqza.firstChild;
326
- template_u1.slot(element_1rmqqqzc, children, 1);
327
- return root_1rmqqqza;
328
- })();
329
- case 'italic':
330
- return (() => {
331
- let root_1rmqqqzd = template_1rmqqqze(), element_1rmqqqzf = root_1rmqqqzd.firstChild;
332
- template_u1.slot(element_1rmqqqzf, children, 1);
333
- return root_1rmqqqzd;
334
- })();
335
- case 'link':
336
- return (() => {
337
- let root_1rmqqqzg = template_1rmqqqzh(), element_1rmqqqzi = root_1rmqqqzg.firstChild;
338
- template_u1.slot(element_1rmqqqzi, children, 1);
339
- template_u1.setProperty(element_1rmqqqzi, 'href', tree.href);
340
- return root_1rmqqqzg;
341
- })();
342
- default:
343
- return (() => {
344
- let root_1rmqqqzj = template_1rmqqqzk(), element_1rmqqqzl = root_1rmqqqzj.firstChild;
345
- template_u1.slot(element_1rmqqqzl, children, 1);
346
- return root_1rmqqqzj;
347
- })();
348
- }
349
- });
350
- }
351
- function lines(value) {
352
- let out = [], parts = value.split('\n');
353
- for (let i = 0, n = parts.length; i < n; i++) {
354
- if (i > 0) {
355
- out.push(template_1rmqqqz1r());
356
- }
357
- if (parts[i]) {
358
- out.push(parts[i]);
359
- }
360
- }
361
- return out;
362
- }
363
- function partition(doc) {
364
- let out = [];
365
- for (let i = 0, n = doc.length; i < n; i++) {
366
- let kind = (list(doc[i].kind) ? doc[i].kind : 'block'), last = out[out.length - 1];
367
- if (last && last.kind === kind) {
368
- last.blocks.push(doc[i]);
369
- }
370
- else {
371
- out.push({ blocks: [doc[i]], kind });
372
- }
373
- }
374
- return out;
375
- }
376
- function shift(pos, { end, start }) {
377
- if (pos.block < end.block || (pos.block === end.block && pos.offset <= end.offset)) {
378
- return pos;
379
- }
380
- if (pos.block === end.block) {
381
- return { block: start.block, offset: start.offset + pos.offset - end.offset };
382
- }
383
- return { block: pos.block - (end.block - start.block), offset: pos.offset };
384
- }
385
- function spans(a, b) {
386
- return !!a
387
- && a.start.block === b.start.block
388
- && a.start.offset === b.start.offset
389
- && a.end.block === b.end.block
390
- && a.end.offset === b.end.offset;
391
- }
392
- function view(block) {
393
- return { block, checked: signal(block.checked) };
394
- }
395
- export default component(function ({ features: whitelist = BASE, label, multiline = false, onsave, placeholder = '', status: indicator = false, value = '', state = reactivity_u0.reactive({ editing: false, saved: false, value }), ...attributes }) {
396
- let features = new Set(multiline ? whitelist : whitelist.filter((feature) => !KINDS.some((k) => k.feature === feature))), actions = ACTIONS.filter(({ action }) => features.has(action)), block = new ReactiveObject_1rmqqqz0(), doc = signal(parse(state.value, features, multiline)), hyperlink = new ReactiveObject_1rmqqqz1(), keyshortcuts = actions
397
- .flatMap(({ shortcut }) => shortcut ? ['Control', 'Meta'].map((mod) => `${mod}+${shortcut}`) : [])
398
- .concat(multiline ? ['Control+Enter', 'Meta+Enter'] : [])
399
- .join(' '), kinds = KINDS.filter((k) => !k.feature || features.has(k.feature)), local = new ReactiveObject_1rmqqqz2('idle'), marks = actions.filter(({ action }) => action !== 'clear' && action !== 'copy'), panel = new ReactiveObject_1rmqqqz3(), pressed = reactivity_u0.reactive(Object.fromEntries(marks.map(({ action }) => [action, false]))), pristine = signal(serialize(read(doc), features, multiline)), saving = status.saver(state, indicator, () => serialize(read(doc), features, multiline) !== read(pristine), onsave), sections = new ReactiveArray(partition(read(doc)).map(section)), slot = new template_u1.ArraySlot(sections, group), steps = history(), tip = tooltip.shared({ delay: { open: TOOLTIP_DELAY } });
400
- let composing = null, copyTimer, dismissed = false, dragged = null, editor, frame = 0, items = [], keys, pressing = false, root, saved = null, selection = null, settling, shown = 'paragraph', toolbar, unobserve, url;
401
- effect(() => {
402
- let next = block.selected;
403
- if (next !== shown) {
404
- untrack(() => turn(next));
405
- }
406
- });
15
+ const KEYBINDINGS = { 'Mod+Enter': null };
16
+ const SPACES = /\s+/g;
17
+ export default component(function ({ features = BASE, label, multiline = false, onsave, placeholder = '', status: indicator = false, value = '', state = reactivity_u0.reactive({ editing: false, saved: false, value }), ...attributes }) {
18
+ let apple = mac(), controller, current = signal(state.value), pristine = signal(state.value), root, saving = status.saver(state, indicator, () => clean(read(current)) !== read(pristine), onsave), defaults = this?.attributes?.[INLINE_EDIT_RICH_EDITOR], own = attributes[INLINE_EDIT_RICH_EDITOR], options = {
19
+ inline: true,
20
+ keybindings: KEYBINDINGS,
21
+ label,
22
+ placeholder,
23
+ singleLine: !multiline,
24
+ toolbar: features
25
+ };
407
26
  effect(() => state.value, (next, previous) => {
408
27
  if (previous !== undefined && !state.editing && next !== read(pristine)) {
409
- load(next);
28
+ write(pristine, next);
29
+ controller?.setValue(next);
410
30
  }
411
31
  });
412
- function apply(href) {
413
- let span = current();
414
- if (!editor || !span) {
415
- return;
416
- }
417
- if (href !== null) {
418
- href = address(href);
419
- if (!href) {
420
- hyperlink.invalid = true;
421
- return;
422
- }
423
- }
424
- back();
425
- change(link(read(doc), span, href), 'other');
426
- local.live = href ? 'Link set' : 'Link removed';
427
- }
428
- function back() {
429
- panel.link = false;
430
- editor?.focus({ preventScroll: true });
431
- let span = current();
432
- if (span) {
433
- select({ anchor: span.start, focus: span.end });
434
- let range = live();
435
- if (range) {
436
- place(range);
437
- }
438
- }
439
- }
440
- function change(edit, kind) {
441
- steps.push({ doc: read(doc), selection }, edit.selection, kind);
442
- commit(edit.doc);
443
- select(edit.selection);
444
- }
445
- function clip(e, cut) {
446
- let range = live(), now = editor ? capture(editor) : null;
447
- if (!range || range.collapsed || !now || !e.clipboardData) {
448
- return;
449
- }
450
- let holder = document.createElement('div'), span = order(now);
451
- holder.append(range.cloneContents());
452
- e.preventDefault();
453
- e.clipboardData.setData('text/html', holder.innerHTML);
454
- e.clipboardData.setData('text/plain', serialize(excerpt(span), features, multiline));
455
- if (cut) {
456
- change(remove(read(doc), span), 'other');
457
- }
458
- }
459
- function commit(next) {
460
- write(doc, next);
461
- let parts = partition(next), end = 0, m = parts.length, n = sections.$length, start = 0;
462
- while (start < n && start < m && sections[start].kind === parts[start].kind) {
463
- patch(sections[start].items, parts[start].blocks);
464
- start++;
465
- }
466
- while (end < n - start && end < m - start && sections[n - 1 - end].kind === parts[m - 1 - end].kind) {
467
- patch(sections[n - 1 - end].items, parts[m - 1 - end].blocks);
468
- end++;
469
- }
470
- if (start + end < n || start + end < m) {
471
- sections.splice(start, n - start - end, ...parts.slice(start, m - end).map(section));
472
- }
473
- slot.flush();
474
- for (let i = 0, o = sections.$length; i < o; i++) {
475
- sections[i].slot?.flush();
476
- }
477
- flush();
478
- }
479
- async function copy() {
480
- let span = current();
481
- if (!span) {
482
- return;
483
- }
484
- clearTimeout(copyTimer);
485
- local.copied = 'success';
486
- local.live = 'Copied';
487
- copyTimer = setTimeout(() => {
488
- local.copied = 'idle';
489
- }, COPIED_FOR);
490
- if (!(await clipboard(serialize(excerpt(span), features, multiline)))) {
491
- local.copied = 'error';
492
- local.live = 'Couldn\'t copy';
493
- }
494
- }
495
- function current() {
496
- let blocks = read(doc);
497
- if (!saved || collapsed(saved) || !blocks[saved.end.block]) {
498
- return null;
499
- }
500
- return saved;
501
- }
502
- function dismiss() {
503
- dismissed = true;
504
- show(false);
505
- }
506
- function drop(e, at) {
507
- let from = dragged;
508
- dragged = null;
509
- if (!from) {
510
- land(at, e.dataTransfer?.getData('text/plain') ?? '');
511
- return;
512
- }
513
- let pos = at.start, inside = (pos.block > from.start.block || (pos.block === from.start.block && pos.offset >= from.start.offset))
514
- && (pos.block < from.end.block || (pos.block === from.end.block && pos.offset <= from.end.offset));
515
- if (inside) {
516
- return;
517
- }
518
- let moved = excerpt(from), rest = remove(read(doc), from).doc, to = shift(pos, from);
519
- change(paste(rest, { end: to, start: to }, moved), 'other');
520
- }
521
- function edit(e) {
522
- let type = e.inputType;
523
- if (e.isComposing || type === 'insertCompositionText' || type === 'deleteCompositionText' || type === 'insertFromComposition') {
524
- return;
525
- }
526
- e.preventDefault();
527
- resolve();
528
- if (!editor) {
529
- return;
530
- }
531
- let now = capture(editor), range = e.getTargetRanges()[0], span = (range && target(editor, range)) || (now && order(now));
532
- if (!span) {
533
- return;
534
- }
535
- let format = FORMATS[type];
536
- if (format) {
537
- if (features.has(format) && !collapsed(span)) {
538
- change(toggle(read(doc), span, format), 'other');
539
- }
540
- return;
541
- }
542
- switch (type) {
543
- case 'deleteByDrag':
544
- dragged = span;
545
- return;
546
- case 'formatRemove':
547
- if (features.has('clear') && !collapsed(span)) {
548
- change(clear(read(doc), span), 'other');
549
- }
550
- return;
551
- case 'historyRedo':
552
- redo();
553
- return;
554
- case 'historyUndo':
555
- undo();
556
- return;
557
- case 'insertFromDrop':
558
- drop(e, span);
559
- return;
560
- case 'insertFromPaste':
561
- land(span, e.dataTransfer?.getData('text/plain') ?? '');
562
- return;
563
- case 'insertLineBreak':
564
- case 'insertParagraph':
565
- if (!multiline) {
566
- finish(true, true);
567
- }
568
- else if (type === 'insertParagraph') {
569
- change(split(read(doc), span), 'other');
570
- }
571
- else {
572
- typed(span, '\n');
573
- }
574
- return;
575
- case 'insertOrderedList':
576
- case 'insertUnorderedList': {
577
- let kind = type === 'insertOrderedList' ? 'ordered' : 'bullet';
578
- if (features.has(kind)) {
579
- change(setKind(read(doc), span, kind), 'other');
580
- }
581
- return;
582
- }
583
- }
584
- if (type.startsWith('insert')) {
585
- typed(span, e.data ?? e.dataTransfer?.getData('text/plain') ?? '');
586
- }
587
- else if (type.startsWith('delete')) {
588
- erase(type, span, now);
589
- }
590
- }
591
- function erase(type, span, now) {
592
- let blocks = read(doc), at = now && now.anchor.block === now.focus.block && now.anchor.offset === now.focus.offset ? now.focus : null;
593
- if (type === 'deleteContentBackward' && at?.offset === 0) {
594
- let next = unformat(blocks, at.block);
595
- if (next) {
596
- change(next, 'other');
597
- return;
598
- }
599
- }
600
- let reach = collapsed(span) && at ? around(blocks, at, type) : span;
601
- if (reach && !collapsed(reach)) {
602
- change(remove(blocks, reach), type === 'deleteByCut' ? 'other' : 'delete');
603
- }
604
- }
605
- function excerpt(span) {
606
- let part = slice(read(doc), span);
607
- if (part.length === 1) {
608
- part[0] = { ...part[0], checked: false, kind: 'paragraph' };
609
- }
610
- return part;
32
+ function clean(text) {
33
+ return multiline ? text.trim() : text.replace(SPACES, ' ').trim();
611
34
  }
612
35
  function finish(commit, keyboard) {
613
- if (!editor || !state.editing) {
36
+ if (!state.editing || !controller) {
614
37
  return;
615
38
  }
616
- resolve();
617
39
  state.editing = false;
618
- panel.link = false;
619
- show(false);
620
40
  if (commit) {
621
41
  save();
622
42
  }
623
- load(state.value);
624
- if (keyboard) {
625
- editor.blur();
626
- }
627
- }
628
- function focus(index) {
629
- local.focus = (index + items.length) % items.length;
630
- items[local.focus]?.focus();
631
- }
632
- function group(section) {
633
- let slot = new template_u1.ArraySlot(section.items, item);
634
- section.slot = slot;
635
- switch (section.kind) {
636
- case 'bullet':
637
- return (() => {
638
- let root_1rmqqqzm = template_1rmqqqzn(), element_1rmqqqzo = root_1rmqqqzm.firstChild;
639
- template_u1.slot(element_1rmqqqzo, slot, 1);
640
- return root_1rmqqqzm;
641
- })();
642
- case 'ordered':
643
- return (() => {
644
- let root_1rmqqqzp = template_1rmqqqzq(), element_1rmqqqzr = root_1rmqqqzp.firstChild;
645
- template_u1.slot(element_1rmqqqzr, slot, 1);
646
- return root_1rmqqqzp;
647
- })();
648
- case 'task':
649
- return (() => {
650
- let root_1rmqqqzs = template_1rmqqqzt(), element_1rmqqqzu = root_1rmqqqzs.firstChild;
651
- template_u1.slot(element_1rmqqqzu, slot, 1);
652
- return root_1rmqqqzs;
653
- })();
654
- default:
655
- return (() => {
656
- let root_1rmqqqzv = template_1rmqqqzw(), element_1rmqqqzx = root_1rmqqqzv.firstChild;
657
- template_u1.slot(element_1rmqqqzx, slot);
658
- return root_1rmqqqzv;
659
- })();
660
- }
661
- }
662
- function inspect(span) {
663
- let blocks = read(doc);
664
- for (let i = 0, n = marks.length; i < n; i++) {
665
- let mark = marks[i].action;
666
- pressed[mark] = active(blocks, span, mark);
667
- }
668
- shown = kindAt(blocks, span);
669
- block.selected = shown;
670
- }
671
- function item(view) {
672
- let { kind, runs } = view.block, characters = text(runs), body = [inline(nest(runs)), (!characters || characters.endsWith('\n')) && template_1rmqqqzy()];
673
- switch (kind) {
674
- case 'bullet':
675
- case 'ordered':
676
- return (() => {
677
- let root_1rmqqqzz = template_1rmqqqz10(), element_1rmqqqz11 = root_1rmqqqzz.firstChild;
678
- template_u1.slot(element_1rmqqqz11, body, 1);
679
- return root_1rmqqqzz;
680
- })();
681
- case 'codeblock':
682
- return (() => {
683
- let root_1rmqqqz12 = template_1rmqqqz13(), element_1rmqqqz14 = root_1rmqqqz12.firstChild;
684
- template_u1.slot(element_1rmqqqz14, body, 1);
685
- return root_1rmqqqz12;
686
- })();
687
- case 'h1':
688
- return (() => {
689
- let root_1rmqqqz15 = template_1rmqqqz16(), element_1rmqqqz17 = root_1rmqqqz15.firstChild;
690
- template_u1.slot(element_1rmqqqz17, body, 1);
691
- return root_1rmqqqz15;
692
- })();
693
- case 'h2':
694
- return (() => {
695
- let root_1rmqqqz18 = template_1rmqqqz19(), element_1rmqqqz1a = root_1rmqqqz18.firstChild;
696
- template_u1.slot(element_1rmqqqz1a, body, 1);
697
- return root_1rmqqqz18;
698
- })();
699
- case 'h3':
700
- return (() => {
701
- let root_1rmqqqz1b = template_1rmqqqz1c(), element_1rmqqqz1d = root_1rmqqqz1b.firstChild;
702
- template_u1.slot(element_1rmqqqz1d, body, 1);
703
- return root_1rmqqqz1b;
704
- })();
705
- case 'quote':
706
- return (() => {
707
- let root_1rmqqqz1e = template_1rmqqqz1f(), element_1rmqqqz1g = root_1rmqqqz1e.firstChild;
708
- template_u1.slot(element_1rmqqqz1g, body, 1);
709
- return root_1rmqqqz1e;
710
- })();
711
- case 'task':
712
- return (() => {
713
- let root_1rmqqqz1h = template_1rmqqqz1i(), element_1rmqqqz1j = root_1rmqqqz1h.firstChild, element_1rmqqqz1k = element_1rmqqqz1j.firstElementChild;
714
- template_u1.slot(element_1rmqqqz1k, checkbox({
715
- [checkbox.input]: {
716
- 'aria-label': 'Done',
717
- checked: () => read(view.checked),
718
- onchange: (e) => tick(view, e.currentTarget.checked)
719
- }
720
- }), 1);
721
- template_u1.slot(element_1rmqqqz1j, body, 2);
722
- template_u1.setProperty(element_1rmqqqz1j, 'data-checked', () => read(view.checked) ? 'true' : 'false');
723
- return root_1rmqqqz1h;
724
- })();
725
- default:
726
- return (() => {
727
- let root_1rmqqqz1l = template_1rmqqqz1m(), element_1rmqqqz1n = root_1rmqqqz1l.firstChild;
728
- template_u1.slot(element_1rmqqqz1n, body, 1);
729
- return root_1rmqqqz1l;
730
- })();
731
- }
732
- }
733
- function land(span, value) {
734
- if (!value) {
735
- return;
736
- }
737
- let blocks = read(doc), host = blocks[span.start.block], style = styleAt(host.runs, span.start.offset);
738
- if (host.kind === 'codeblock' || style.marks.includes('code')) {
739
- change(insert(blocks, span, [{ ...style, text: host.kind === 'codeblock' ? value : value.replace(INLINE_LINE_BREAKS, ' ') }]), 'other');
740
- return;
741
- }
742
- let pasted = parse(value, features, multiline && value.includes('\n'));
743
- if (pasted.length === 1 && pasted[0].kind === 'paragraph') {
744
- if (!pasted[0].runs.length) {
745
- return;
746
- }
747
- pasted[0] = {
748
- ...pasted[0],
749
- runs: pasted[0].runs.map((run) => ({ href: run.href || style.href, marks: sort([...style.marks, ...run.marks]), text: run.text }))
750
- };
751
- }
752
- change(paste(blocks, span, pasted), 'other');
753
- }
754
- function leave(e) {
755
- if (!root?.contains(e.relatedTarget)) {
756
- finish(true, false);
757
- }
758
- }
759
- function linker() {
760
- let span = current();
761
- if (!editor || !span || !toolbar || !url) {
762
- return;
763
- }
764
- let found = extent(read(doc), span);
765
- if (found) {
766
- saved = found.span;
767
- select({ anchor: found.span.start, focus: found.span.end });
768
- }
769
- panel.link = true;
770
- hyperlink.existing = !!found;
771
- hyperlink.invalid = false;
772
- hyperlink.url = found?.href ?? '';
773
- let range = live();
774
- if (range) {
775
- place(range);
776
- }
777
- flush();
778
- url.focus({ preventScroll: true });
779
- url.select();
780
- }
781
- function live() {
782
- let native = window.getSelection();
783
- return native && native.rangeCount > 0 ? native.getRangeAt(0) : null;
784
- }
785
- function load(markdown) {
786
- let next = parse(markdown, features, multiline);
787
- steps.clear();
788
- write(pristine, serialize(next, features, multiline));
789
- commit(next);
790
- }
791
- function navigate(e) {
792
- if (e.target === url) {
793
- if (e.key === 'Enter') {
794
- e.preventDefault();
795
- apply(url.value);
796
- }
797
- else if (e.key === 'Escape') {
798
- e.preventDefault();
799
- back();
800
- }
801
- return;
802
- }
803
- if (e.key === 'ArrowLeft' || e.key === 'ArrowRight') {
804
- e.preventDefault();
805
- focus(local.focus + (e.key === 'ArrowRight' ? 1 : -1));
806
- }
807
- else if (e.key === 'Home' || e.key === 'End') {
808
- e.preventDefault();
809
- focus(e.key === 'Home' ? 0 : -1);
43
+ else {
44
+ controller.setValue(read(pristine));
810
45
  }
811
- else if (e.key === 'Escape' && !block.active) {
812
- e.preventDefault();
813
- dismiss();
814
- editor?.focus({ preventScroll: true });
815
- let span = current();
816
- if (span) {
817
- select({ anchor: span.start, focus: span.end });
46
+ if (keyboard) {
47
+ let active = root?.ownerDocument.activeElement;
48
+ if (active instanceof HTMLElement && root?.contains(active)) {
49
+ active.blur();
818
50
  }
819
51
  }
820
52
  }
821
- function patch(items, next) {
822
- let end = 0, m = next.length, n = items.$length, start = 0;
823
- while (start < n && start < m && follows(items[start], next[start])) {
824
- start++;
825
- }
826
- while (end < n - start && end < m - start && follows(items[n - 1 - end], next[m - 1 - end])) {
827
- end++;
828
- }
829
- if (start + end < n || start + end < m) {
830
- items.splice(start, n - start - end, ...next.slice(start, m - end).map(view));
831
- }
832
- }
833
- function place(range) {
834
- if (!root || !toolbar) {
835
- return;
836
- }
837
- let bounds = range.getBoundingClientRect(), box = root.getBoundingClientRect(), h = toolbar.offsetHeight, lines = [...range.getClientRects()].filter((rect) => rect.width > 0), w = toolbar.offsetWidth;
838
- let first = lines[0] ?? bounds, last = lines[lines.length - 1] ?? bounds;
839
- let below = first.top < h + GAP, center = bounds.left + bounds.width / 2, x = Math.min(Math.max(center - w / 2, GAP), viewport().width - w - GAP);
840
- panel.origin = `${center - x}px ${below ? 0 : h}px`;
841
- panel.x = x - box.left;
842
- panel.y = below ? last.bottom - box.top + GAP : first.top - box.top - h - GAP;
843
- if (!panel.open) {
844
- panel.instant = true;
845
- flush();
846
- void toolbar.offsetWidth;
847
- panel.instant = false;
848
- }
849
- }
850
- function redo() {
851
- let entry = steps.redo({ doc: read(doc), selection });
852
- if (entry) {
853
- revert(entry);
854
- }
855
- }
856
- function resolve() {
857
- clearTimeout(settling);
858
- if (!composing || !editor) {
859
- return;
860
- }
861
- let { block: i, element } = composing, blocks = read(doc);
862
- composing = null;
863
- if (!blocks[i] || !element.isConnected) {
864
- sections.splice(0, sections.$length, ...partition(blocks).map(section));
865
- commit(blocks);
866
- return;
867
- }
868
- let after = written(element), before = text(blocks[i].runs), end = 0, now = capture(editor), start = 0;
869
- while (start < before.length && start < after.length && before[start] === after[start]) {
870
- start++;
871
- }
872
- while (end < before.length - start && end < after.length - start && before[before.length - 1 - end] === after[after.length - 1 - end]) {
873
- end++;
874
- }
875
- let next = insert(blocks, { end: { block: i, offset: before.length - end }, start: { block: i, offset: start } }, [{ ...styleAt(blocks[i].runs, start), text: after.slice(start, after.length - end) }]), at = now && now.focus.block === i ? now.focus : next.selection.focus;
876
- next.doc[i] = { ...next.doc[i], runs: next.doc[i].runs.slice() };
877
- if (before === after) {
878
- commit(next.doc);
879
- select(caret(at));
880
- return;
881
- }
882
- change({ doc: next.doc, selection: caret(at) }, 'type');
883
- }
884
- function revert(entry) {
885
- commit(entry.doc);
886
- if (entry.selection) {
887
- select(entry.selection);
888
- }
889
- }
890
53
  function save() {
891
- let next = serialize(read(doc), features, multiline);
54
+ let next = clean(read(current));
892
55
  if (next === read(pristine)) {
893
56
  return;
894
57
  }
895
58
  write(pristine, next);
896
- saving.save(next);
897
- }
898
- function section({ blocks, kind }) {
899
- return { items: new ReactiveArray(blocks.map(view)), kind };
900
- }
901
- function select(next) {
902
- selection = next;
903
- if (editor && document.activeElement === editor) {
904
- restore(editor, next);
905
- }
906
- }
907
- function settle() {
908
- if (!pressing) {
909
- return;
910
- }
911
- pressing = false;
912
- cancelAnimationFrame(frame);
913
- frame = requestAnimationFrame(sync);
914
- }
915
- function show(next, instant = false) {
916
- panel.open = next;
917
- if (instant) {
918
- panel.instant = true;
919
- }
920
- }
921
- function sync() {
922
- if (!editor || !toolbar) {
923
- return;
924
- }
925
- let now = capture(editor);
926
- if (now) {
927
- selection = now;
928
- }
929
- if (composing || (!actions.length && kinds.length < 2)) {
930
- return;
931
- }
932
- let range = live();
933
- if (toolbar.contains(document.activeElement) || panel.link) {
934
- return;
935
- }
936
- if (!now || !range || range.collapsed || !editor.contains(range.commonAncestorContainer)) {
937
- if (panel.open) {
938
- show(false);
939
- }
940
- return;
941
- }
942
- if (pressing) {
943
- return;
944
- }
945
- let span = order(now);
946
- if (dismissed) {
947
- if (spans(saved, span)) {
948
- return;
949
- }
950
- dismissed = false;
951
- }
952
- saved = span;
953
- place(range);
954
- inspect(span);
955
- if (!panel.open) {
956
- local.focus = 0;
957
- show(true);
958
- }
959
- }
960
- function tick(view, value) {
961
- let blocks = read(doc), index = blocks.findIndex((b) => b.key === view.block.key);
962
- if (index < 0) {
963
- return;
964
- }
965
- change({ doc: check(blocks, index, value), selection: selection ?? caret({ block: index, offset: 0 }) }, 'other');
966
- if (!state.editing) {
967
- save();
968
- }
969
- }
970
- function trigger(action) {
971
- let span = current();
972
- if (!span) {
973
- return;
974
- }
975
- switch (action) {
976
- case 'clear':
977
- change(clear(read(doc), span), 'other');
978
- local.live = 'Formatting cleared';
979
- break;
980
- case 'copy':
981
- void copy();
982
- return;
983
- case 'link':
984
- linker();
985
- return;
986
- default:
987
- change(toggle(read(doc), span, action), 'other');
988
- }
989
- inspect(span);
990
- }
991
- function turn(kind) {
992
- let span = current();
993
- if (!editor || !span) {
994
- return;
995
- }
996
- shown = kind;
997
- editor.focus({ preventScroll: true });
998
- change(setKind(read(doc), span, kind), 'other');
999
- }
1000
- function typed(span, value) {
1001
- if (!multiline) {
1002
- value = value.replace(INLINE_LINE_BREAKS, ' ');
1003
- }
1004
- if (!value) {
1005
- return;
1006
- }
1007
- let blocks = read(doc), style = styleAt(blocks[span.start.block].runs, span.start.offset + (collapsed(span) ? 0 : 1));
1008
- change(insert(blocks, span, [{ ...style, text: value }]), 'type');
1009
- }
1010
- function undo() {
1011
- let entry = steps.undo({ doc: read(doc), selection });
1012
- if (entry) {
1013
- revert(entry);
59
+ if (controller && controller.document.value !== next) {
60
+ controller.setValue(next);
1014
61
  }
62
+ saving.save(next);
1015
63
  }
1016
- let button = ({ action, label, shortcut }, content, index) => {
1017
- let root_1rmqqqz1o = template_1rmqqqz1p(), element_1rmqqqz1q = root_1rmqqqz1o.firstChild;
1018
- template_u1.slot(element_1rmqqqz1q, content, 1);
1019
- template_u1.setProperty(element_1rmqqqz1q, 'aria-label', label);
1020
- template_u1.setProperty(element_1rmqqqz1q, 'tabindex', () => local.focus === index ? '0' : '-1');
1021
- template_u1.setProperties(element_1rmqqqz1q, action === 'clear' || action === 'copy' ? {} : { 'aria-pressed': () => pressed[action] ? 'true' : 'false' });
1022
- template_u1.delegate(element_1rmqqqz1q, 'click', () => trigger(action));
1023
- template_u1.onconnect(element_1rmqqqz1q, (element) => {
1024
- element[HINT] = action === 'copy' ? () => local.copied === 'success' ? 'Copied' : label : hint(label, shortcut);
1025
- items[index] = element;
1026
- });
1027
- return root_1rmqqqz1o;
1028
- };
1029
- let lead = kinds.length > 1 ? 1 : 0, tools = actions.filter(({ action }) => action === 'clear' || action === 'copy');
1030
- return (() => {
1031
- let root_1rmqqqz1s = template_1rmqqqz1t(), element_1rmqqqz1u = root_1rmqqqz1s.firstChild, element_1rmqqqz1v = element_1rmqqqz1u.firstElementChild, element_1rmqqqz1w = element_1rmqqqz1v.nextElementSibling, element_1rmqqqz1x = element_1rmqqqz1w.firstElementChild, element_1rmqqqz1y = element_1rmqqqz1x.firstElementChild, element_1rmqqqz1z = element_1rmqqqz1y.firstChild, element_1rmqqqz20 = element_1rmqqqz1z.nextSibling, element_1rmqqqz21 = element_1rmqqqz20.nextSibling, element_1rmqqqz22 = element_1rmqqqz21.nextSibling, element_1rmqqqz23 = element_1rmqqqz1w.nextElementSibling.firstChild, element_1rmqqqz24 = element_1rmqqqz1w.nextElementSibling, element_1rmqqqz25 = element_1rmqqqz24.nextElementSibling;
1032
- template_u1.slot(element_1rmqqqz1v, slot, 1);
1033
- template_u1.slot(element_1rmqqqz1z, kinds.length > 1 && (() => {
1034
- let root_1rmqqqz26 = template_1rmqqqz27(), element_1rmqqqz28 = root_1rmqqqz26.firstChild, element_1rmqqqz29 = element_1rmqqqz28.nextSibling;
1035
- template_u1.slot(element_1rmqqqz28, selectInput({
1036
- [selectInput.trigger]: {
1037
- onconnect: (element) => {
1038
- items[0] = element;
1039
- },
1040
- tabindex: () => local.focus === 0 ? '0' : '-1'
1041
- },
1042
- class: 'inline-edit-toolbar-block',
1043
- label: 'Text style',
1044
- options: kinds,
1045
- state: block
1046
- }));
1047
- template_u1.slot(element_1rmqqqz29, (marks.length > 0 || tools.length > 0) && template_1rmqqqz2a());
1048
- return root_1rmqqqz26;
1049
- })());
1050
- template_u1.slot(element_1rmqqqz20, marks.map((item, i) => button(item, glyph(item.action), lead + i)));
1051
- template_u1.slot(element_1rmqqqz21, marks.length > 0 && tools.length > 0 && template_1rmqqqz2a());
1052
- template_u1.slot(element_1rmqqqz22, tools.map((item, i) => button(item, item.action === 'copy'
1053
- ? faces(() => local.copied, [
1054
- { content: icon({ 'aria-hidden': 'true', class: 'button-icon' }, copySvg), key: 'idle' },
1055
- { content: icon({ 'aria-hidden': 'true', class: 'button-icon button-icon--draw' }, checkSvg), key: 'success', tone: 'success' },
1056
- { content: icon({ 'aria-hidden': 'true', class: 'button-icon button-icon--draw' }, closeSvg), key: 'error', tone: 'error' }
1057
- ])
1058
- : glyph(item.action), lead + marks.length + i)));
1059
- template_u1.slot(element_1rmqqqz1y, tip.render(), 2);
1060
- template_u1.slot(element_1rmqqqz1x, features.has('link') && (() => {
1061
- let root_1rmqqqz2b = template_1rmqqqz2c(), element_1rmqqqz2d = root_1rmqqqz2b.firstChild.firstChild, element_1rmqqqz2e = root_1rmqqqz2b.firstChild.firstElementChild, element_1rmqqqz2f = element_1rmqqqz2e.nextElementSibling, element_1rmqqqz2g = element_1rmqqqz2f.nextElementSibling;
1062
- template_u1.slot(element_1rmqqqz2d, input({
1063
- 'aria-invalid': () => hyperlink.invalid && 'true',
1064
- 'aria-label': 'Link address',
1065
- class: 'inline-edit-toolbar-url',
1066
- onconnect: (element) => {
1067
- url = element;
1068
- },
1069
- oninput: (e) => {
1070
- hyperlink.url = e.currentTarget.value;
1071
- },
1072
- placeholder: 'Paste or type a link',
1073
- type: 'url',
1074
- value: () => hyperlink.url
1075
- }));
1076
- template_u1.slot(element_1rmqqqz2e, glyph('apply'), 1);
1077
- template_u1.slot(element_1rmqqqz2f, glyph('open'), 1);
1078
- template_u1.slot(element_1rmqqqz2g, glyph('unlink'), 1);
1079
- template_u1.setProperty(element_1rmqqqz2g, 'hidden', () => !hyperlink.existing);
1080
- template_u1.delegate(element_1rmqqqz2g, 'click', () => apply(null));
1081
- template_u1.delegate(element_1rmqqqz2f, 'click', () => {
1082
- let href = address(hyperlink.url);
1083
- if (href) {
1084
- window.open(href, '_blank', 'noopener');
64
+ {
65
+ let root_1rmqqqz0 = template_1rmqqqz1(), element_1rmqqqz2 = root_1rmqqqz0.firstChild, element_1rmqqqz3 = root_1rmqqqz0.firstElementChild.firstChild, element_1rmqqqz4 = root_1rmqqqz0.firstElementChild;
66
+ template_u1.slot(element_1rmqqqz2, markdown({
67
+ ...defaults,
68
+ ...own,
69
+ class: ['inline-edit-editor', defaults?.class ?? [], own?.class ?? []].flat(),
70
+ controller: (next) => {
71
+ controller = next;
72
+ },
73
+ onChange: (next) => {
74
+ write(current, next);
75
+ if (!state.editing) {
76
+ save();
1085
77
  }
1086
- });
1087
- template_u1.delegate(element_1rmqqqz2e, 'click', () => apply(hyperlink.url));
1088
- return root_1rmqqqz2b;
1089
- })(), 2);
1090
- template_u1.slot(element_1rmqqqz23, icon({ class: 'inline-edit-icon-pencil' }, pencilSvg));
1091
- template_u1.slot(element_1rmqqqz24, icon({ class: 'inline-edit-icon-check' }, checkSvg), 2);
1092
- new template_u1.EffectSlot(element_1rmqqqz25, () => local.live, 1);
1093
- template_u1.slot(element_1rmqqqz1u, saving.status && status.render(saving.status, this?.attributes?.[INLINE_EDIT_STATUS], attributes[INLINE_EDIT_STATUS]), 2);
1094
- template_u1.setProperties(element_1rmqqqz1y, tip.delegate({ content: (trigger) => trigger[HINT], edge: true, selector: '.inline-edit-toolbar-button' }));
1095
- template_u1.setProperties(element_1rmqqqz1x, this?.attributes?.[INLINE_EDIT_RICH_TOOLBAR]);
1096
- template_u1.setProperties(element_1rmqqqz1x, attributes[INLINE_EDIT_RICH_TOOLBAR]);
1097
- template_u1.setProperty(element_1rmqqqz1x, 'aria-hidden', () => panel.open ? 'false' : 'true');
1098
- template_u1.setList(element_1rmqqqz1x, 'class', [
1099
- () => panel.instant && 'inline-edit-toolbar--instant',
1100
- () => panel.link && 'inline-edit-toolbar--link'
1101
- ]);
1102
- template_u1.setProperty(element_1rmqqqz1x, 'inert', () => !panel.open);
1103
- template_u1.onconnect(element_1rmqqqz1x, (element) => {
1104
- toolbar = element;
1105
- keys = new AbortController();
1106
- element.addEventListener('keydown', navigate, { signal: keys.signal });
1107
- });
1108
- template_u1.delegate(element_1rmqqqz1x, 'mousedown', (e) => {
1109
- if (e.target.tagName !== 'INPUT') {
1110
- e.preventDefault();
1111
- }
1112
- });
1113
- template_u1.setList(element_1rmqqqz1x, 'style', () => `--toolbar-origin: ${panel.origin}; --toolbar-x: ${panel.x}px; --toolbar-y: ${panel.y}px;`);
1114
- template_u1.setList(element_1rmqqqz1w, 'class', () => panel.open && '--active');
1115
- template_u1.setProperty(element_1rmqqqz1v, 'aria-label', label);
1116
- template_u1.setProperty(element_1rmqqqz1v, 'aria-multiline', multiline ? 'true' : 'false');
1117
- template_u1.setProperty(element_1rmqqqz1v, 'aria-keyshortcuts', keyshortcuts);
1118
- template_u1.setProperty(element_1rmqqqz1v, 'aria-placeholder', placeholder);
1119
- template_u1.setProperty(element_1rmqqqz1v, 'data-placeholder', placeholder);
1120
- template_u1.setProperties(element_1rmqqqz1v, this?.attributes?.[INLINE_EDIT_RICH_EDITOR]);
1121
- template_u1.setProperties(element_1rmqqqz1v, attributes[INLINE_EDIT_RICH_EDITOR]);
1122
- template_u1.delegate(element_1rmqqqz1v, 'beforeinput', edit);
1123
- template_u1.delegate(element_1rmqqqz1v, 'compositionend', () => {
1124
- clearTimeout(settling);
1125
- settling = setTimeout(resolve, 0);
1126
- });
1127
- template_u1.delegate(element_1rmqqqz1v, 'compositionstart', () => {
1128
- resolve();
1129
- let now = editor ? capture(editor) : null;
1130
- if (!editor || !now) {
1131
- return;
1132
- }
1133
- let span = order(now);
1134
- if (span.start.block !== span.end.block) {
1135
- change(remove(read(doc), span), 'delete');
1136
- }
1137
- composing = { block: span.start.block, element: elements(editor)[span.start.block] };
1138
- show(false, true);
1139
- });
1140
- template_u1.onconnect(element_1rmqqqz1v, (element) => {
1141
- editor = element;
1142
- });
1143
- template_u1.delegate(element_1rmqqqz1v, 'copy', (e) => clip(e, false));
1144
- template_u1.delegate(element_1rmqqqz1v, 'cut', (e) => clip(e, true));
1145
- template_u1.on(element_1rmqqqz1v, 'focus', () => {
1146
- state.editing = true;
1147
- panel.link = false;
1148
- });
1149
- template_u1.delegate(element_1rmqqqz1v, 'keydown', (e) => {
1150
- if (e.isComposing) {
1151
- return;
1152
- }
1153
- resolve();
1154
- let key = e.key.toLowerCase(), mod = e.metaKey || e.ctrlKey;
1155
- if (mod && !e.altKey && (key === 'y' || key === 'z')) {
1156
- e.preventDefault();
1157
- if (key === 'y' || e.shiftKey) {
1158
- redo();
78
+ },
79
+ options,
80
+ value: state.value
81
+ }));
82
+ template_u1.slot(element_1rmqqqz3, icon({ class: 'inline-edit-icon-pencil' }, pencilSvg));
83
+ template_u1.slot(element_1rmqqqz4, icon({ class: 'inline-edit-icon-check' }, checkSvg), 1);
84
+ template_u1.slot(root_1rmqqqz0, saving.status && status.render(saving.status, this?.attributes?.[INLINE_EDIT_STATUS], attributes[INLINE_EDIT_STATUS]), 1);
85
+ template_u1.setProperties(root_1rmqqqz0, this?.attributes);
86
+ let attributes_1rmqqqz5 = attributes;
87
+ template_u1.setProperties(root_1rmqqqz0, attributes_1rmqqqz5, true);
88
+ template_u1.onconnect(root_1rmqqqz0, (element, on) => {
89
+ root = element;
90
+ on(element, 'focusin', () => {
91
+ state.editing = true;
92
+ }, { direct: true });
93
+ on(element, 'focusout', (e) => {
94
+ if (!root?.contains(e.relatedTarget)) {
95
+ finish(true, false);
1159
96
  }
1160
- else {
1161
- undo();
97
+ }, { direct: true });
98
+ on(element, 'keydown', (e) => {
99
+ if (e.defaultPrevented || e.isComposing) {
100
+ return;
1162
101
  }
1163
- return;
1164
- }
1165
- if (mod && !e.altKey && key !== 'enter') {
1166
- let action = ACTIONS.find(({ shortcut }) => shortcut?.toLowerCase() === (e.shiftKey ? 'shift+' : '') + key)?.action;
1167
- if (action && features.has(action)) {
102
+ if (e.key === 'Escape') {
1168
103
  e.preventDefault();
1169
- trigger(action);
1170
- }
1171
- return;
1172
- }
1173
- if (e.key === 'Escape') {
1174
- e.preventDefault();
1175
- if (panel.open) {
1176
- dismiss();
1177
- }
1178
- else {
1179
104
  finish(false, true);
1180
105
  }
1181
- return;
1182
- }
1183
- if (e.key === 'Enter' && (mod || !multiline)) {
1184
- e.preventDefault();
1185
- finish(true, true);
1186
- return;
1187
- }
1188
- if (panel.open && !mod && (e.key.length === 1 || e.key === 'Backspace' || e.key === 'Delete' || e.key === 'Enter')) {
1189
- show(false, true);
1190
- }
1191
- });
1192
- template_u1.delegate(element_1rmqqqz1v, 'paste', (e) => {
1193
- e.preventDefault();
1194
- resolve();
1195
- let now = editor ? capture(editor) : null;
1196
- if (now) {
1197
- land(order(now), e.clipboardData?.getData('text/plain') ?? '');
1198
- }
1199
- });
1200
- template_u1.delegate(element_1rmqqqz1v, 'pointerdown', (e) => {
1201
- if (e.button === 0) {
1202
- pressing = true;
1203
- }
1204
- });
1205
- template_u1.setProperties(element_1rmqqqz1u, this?.attributes);
1206
- template_u1.setProperties(element_1rmqqqz1u, attributes);
1207
- template_u1.setList(element_1rmqqqz1u, 'class', [
1208
- multiline && 'inline-edit--multiline',
1209
- () => state.editing && '--active',
1210
- () => state.saved && 'inline-edit--saved',
1211
- () => empty(read(doc)) && 'inline-edit--empty'
1212
- ]);
1213
- template_u1.onconnect(element_1rmqqqz1u, (element) => {
1214
- root = element;
1215
- unobserve?.();
1216
- unobserve = observe(element, sync);
1217
- });
1218
- template_u1.ondisconnect(element_1rmqqqz1u, () => {
1219
- cancelAnimationFrame(frame);
1220
- clearTimeout(copyTimer);
1221
- clearTimeout(settling);
1222
- keys?.abort();
1223
- unobserve?.();
1224
- unobserve = undefined;
1225
- saving.dispose();
106
+ else if (e.key === 'Enter' && (!multiline || (apple ? e.metaKey : e.ctrlKey))) {
107
+ e.preventDefault();
108
+ finish(true, true);
109
+ }
110
+ }, { direct: true });
1226
111
  });
1227
- template_u1.ondocument(element_1rmqqqz1u, 'selectionchange', sync);
1228
- template_u1.on(element_1rmqqqz1u, 'focusout', leave);
1229
- template_u1.onwindow(element_1rmqqqz1u, 'pointercancel', settle);
1230
- template_u1.onwindow(element_1rmqqqz1u, 'pointerup', settle);
1231
- return root_1rmqqqz1s;
1232
- })();
1233
- }, { editor: INLINE_EDIT_RICH_EDITOR, status: INLINE_EDIT_STATUS, toolbar: INLINE_EDIT_RICH_TOOLBAR });
112
+ template_u1.ondisconnect(root_1rmqqqz0, saving.dispose);
113
+ template_u1.setClass(root_1rmqqqz0, ["inline-edit inline-edit--rich", attributes_1rmqqqz5?.class, [
114
+ multiline && 'inline-edit--multiline',
115
+ () => state.editing && '--active',
116
+ () => state.saved && 'inline-edit--saved'
117
+ ]]);
118
+ template_u1.setStyle(root_1rmqqqz0, ["", attributes_1rmqqqz5?.style]);
119
+ return root_1rmqqqz0;
120
+ }
121
+ }, { editor: INLINE_EDIT_RICH_EDITOR, status: INLINE_EDIT_STATUS });