@peteai/presentation-editor 0.0.1

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 (291) hide show
  1. package/README.md +58 -0
  2. package/dist/components/presentation-editor/app.css +12 -0
  3. package/dist/components/presentation-editor/cognition-slides.d.ts +56 -0
  4. package/dist/components/presentation-editor/cognition-slides.js +182 -0
  5. package/dist/components/presentation-editor/cursor-tooltip.svelte +29 -0
  6. package/dist/components/presentation-editor/cursor-tooltip.svelte.d.ts +18 -0
  7. package/dist/components/presentation-editor/dragged.svelte +31 -0
  8. package/dist/components/presentation-editor/dragged.svelte.d.ts +18 -0
  9. package/dist/components/presentation-editor/header.svelte +66 -0
  10. package/dist/components/presentation-editor/header.svelte.d.ts +8 -0
  11. package/dist/components/presentation-editor/index.d.ts +2 -0
  12. package/dist/components/presentation-editor/index.js +2 -0
  13. package/dist/components/presentation-editor/layers/active-background-border.svelte +16 -0
  14. package/dist/components/presentation-editor/layers/active-background-border.svelte.d.ts +18 -0
  15. package/dist/components/presentation-editor/layers/active-layer-border.svelte +30 -0
  16. package/dist/components/presentation-editor/layers/active-layer-border.svelte.d.ts +8 -0
  17. package/dist/components/presentation-editor/layers/buttons/border-button/border-button.svelte +231 -0
  18. package/dist/components/presentation-editor/layers/buttons/border-button/border-button.svelte.d.ts +7 -0
  19. package/dist/components/presentation-editor/layers/buttons/border-button/index.d.ts +2 -0
  20. package/dist/components/presentation-editor/layers/buttons/border-button/index.js +2 -0
  21. package/dist/components/presentation-editor/layers/buttons/corner-radius-button/corner-radius-button.svelte +88 -0
  22. package/dist/components/presentation-editor/layers/buttons/corner-radius-button/corner-radius-button.svelte.d.ts +7 -0
  23. package/dist/components/presentation-editor/layers/buttons/corner-radius-button/index.d.ts +2 -0
  24. package/dist/components/presentation-editor/layers/buttons/corner-radius-button/index.js +2 -0
  25. package/dist/components/presentation-editor/layers/buttons/flip-button/flip-button.svelte +39 -0
  26. package/dist/components/presentation-editor/layers/buttons/flip-button/flip-button.svelte.d.ts +7 -0
  27. package/dist/components/presentation-editor/layers/buttons/flip-button/index.d.ts +2 -0
  28. package/dist/components/presentation-editor/layers/buttons/flip-button/index.js +2 -0
  29. package/dist/components/presentation-editor/layers/buttons/opacity-button/index.d.ts +2 -0
  30. package/dist/components/presentation-editor/layers/buttons/opacity-button/index.js +2 -0
  31. package/dist/components/presentation-editor/layers/buttons/opacity-button/opacity-button.svelte +93 -0
  32. package/dist/components/presentation-editor/layers/buttons/opacity-button/opacity-button.svelte.d.ts +7 -0
  33. package/dist/components/presentation-editor/layers/controls/corner-scale-control/corner-scale-control.svelte +179 -0
  34. package/dist/components/presentation-editor/layers/controls/corner-scale-control/corner-scale-control.svelte.d.ts +184 -0
  35. package/dist/components/presentation-editor/layers/controls/corner-scale-control/index.d.ts +2 -0
  36. package/dist/components/presentation-editor/layers/controls/corner-scale-control/index.js +4 -0
  37. package/dist/components/presentation-editor/layers/controls/rotate-control/index.d.ts +2 -0
  38. package/dist/components/presentation-editor/layers/controls/rotate-control/index.js +4 -0
  39. package/dist/components/presentation-editor/layers/controls/rotate-control/rotate-control.svelte +105 -0
  40. package/dist/components/presentation-editor/layers/controls/rotate-control/rotate-control.svelte.d.ts +7 -0
  41. package/dist/components/presentation-editor/layers/controls/side-resize-control/index.d.ts +2 -0
  42. package/dist/components/presentation-editor/layers/controls/side-resize-control/index.js +4 -0
  43. package/dist/components/presentation-editor/layers/controls/side-resize-control/side-resize-control.svelte +220 -0
  44. package/dist/components/presentation-editor/layers/controls/side-resize-control/side-resize-control.svelte.d.ts +215 -0
  45. package/dist/components/presentation-editor/layers/controls/side-scale-control/index.d.ts +2 -0
  46. package/dist/components/presentation-editor/layers/controls/side-scale-control/index.js +4 -0
  47. package/dist/components/presentation-editor/layers/controls/side-scale-control/side-scale-control.svelte +141 -0
  48. package/dist/components/presentation-editor/layers/controls/side-scale-control/side-scale-control.svelte.d.ts +114 -0
  49. package/dist/components/presentation-editor/layers/hovered-layer.svelte +34 -0
  50. package/dist/components/presentation-editor/layers/hovered-layer.svelte.d.ts +7 -0
  51. package/dist/components/presentation-editor/layers/index.d.ts +10 -0
  52. package/dist/components/presentation-editor/layers/index.js +22 -0
  53. package/dist/components/presentation-editor/layers/layer-button.svelte +38 -0
  54. package/dist/components/presentation-editor/layers/layer-button.svelte.d.ts +8 -0
  55. package/dist/components/presentation-editor/layers/layer-thumb-wrapper.svelte +36 -0
  56. package/dist/components/presentation-editor/layers/layer-thumb-wrapper.svelte.d.ts +15 -0
  57. package/dist/components/presentation-editor/layers/layer-wrapper.svelte +288 -0
  58. package/dist/components/presentation-editor/layers/layer-wrapper.svelte.d.ts +10 -0
  59. package/dist/components/presentation-editor/layers/types/background/background-content.svelte +11 -0
  60. package/dist/components/presentation-editor/layers/types/background/background-content.svelte.d.ts +7 -0
  61. package/dist/components/presentation-editor/layers/types/background/background-layer-buttons.svelte +81 -0
  62. package/dist/components/presentation-editor/layers/types/background/background-layer-buttons.svelte.d.ts +18 -0
  63. package/dist/components/presentation-editor/layers/types/background/background-layer-thumb.svelte +12 -0
  64. package/dist/components/presentation-editor/layers/types/background/background-layer-thumb.svelte.d.ts +7 -0
  65. package/dist/components/presentation-editor/layers/types/background/background-layer.svelte +103 -0
  66. package/dist/components/presentation-editor/layers/types/background/background-layer.svelte.d.ts +7 -0
  67. package/dist/components/presentation-editor/layers/types/background/index.d.ts +5 -0
  68. package/dist/components/presentation-editor/layers/types/background/index.js +7 -0
  69. package/dist/components/presentation-editor/layers/types/html/buttons/alignment-button/alignment-button.svelte +45 -0
  70. package/dist/components/presentation-editor/layers/types/html/buttons/alignment-button/alignment-button.svelte.d.ts +7 -0
  71. package/dist/components/presentation-editor/layers/types/html/buttons/alignment-button/index.d.ts +2 -0
  72. package/dist/components/presentation-editor/layers/types/html/buttons/alignment-button/index.js +2 -0
  73. package/dist/components/presentation-editor/layers/types/html/buttons/bold-button/bold-button.svelte +19 -0
  74. package/dist/components/presentation-editor/layers/types/html/buttons/bold-button/bold-button.svelte.d.ts +7 -0
  75. package/dist/components/presentation-editor/layers/types/html/buttons/bold-button/index.d.ts +2 -0
  76. package/dist/components/presentation-editor/layers/types/html/buttons/bold-button/index.js +2 -0
  77. package/dist/components/presentation-editor/layers/types/html/buttons/case-button/case-button.svelte +37 -0
  78. package/dist/components/presentation-editor/layers/types/html/buttons/case-button/case-button.svelte.d.ts +7 -0
  79. package/dist/components/presentation-editor/layers/types/html/buttons/case-button/index.d.ts +2 -0
  80. package/dist/components/presentation-editor/layers/types/html/buttons/case-button/index.js +2 -0
  81. package/dist/components/presentation-editor/layers/types/html/buttons/color-button/color-button.svelte +88 -0
  82. package/dist/components/presentation-editor/layers/types/html/buttons/color-button/color-button.svelte.d.ts +7 -0
  83. package/dist/components/presentation-editor/layers/types/html/buttons/color-button/index.d.ts +2 -0
  84. package/dist/components/presentation-editor/layers/types/html/buttons/color-button/index.js +2 -0
  85. package/dist/components/presentation-editor/layers/types/html/buttons/font-size-button/font-size-button.svelte +132 -0
  86. package/dist/components/presentation-editor/layers/types/html/buttons/font-size-button/font-size-button.svelte.d.ts +9 -0
  87. package/dist/components/presentation-editor/layers/types/html/buttons/font-size-button/index.d.ts +2 -0
  88. package/dist/components/presentation-editor/layers/types/html/buttons/font-size-button/index.js +2 -0
  89. package/dist/components/presentation-editor/layers/types/html/buttons/italic-button/index.d.ts +2 -0
  90. package/dist/components/presentation-editor/layers/types/html/buttons/italic-button/index.js +2 -0
  91. package/dist/components/presentation-editor/layers/types/html/buttons/italic-button/italic-button.svelte +19 -0
  92. package/dist/components/presentation-editor/layers/types/html/buttons/italic-button/italic-button.svelte.d.ts +7 -0
  93. package/dist/components/presentation-editor/layers/types/html/buttons/list-button/index.d.ts +2 -0
  94. package/dist/components/presentation-editor/layers/types/html/buttons/list-button/index.js +2 -0
  95. package/dist/components/presentation-editor/layers/types/html/buttons/list-button/list-button.svelte +37 -0
  96. package/dist/components/presentation-editor/layers/types/html/buttons/list-button/list-button.svelte.d.ts +7 -0
  97. package/dist/components/presentation-editor/layers/types/html/buttons/strikethrough-button/index.d.ts +2 -0
  98. package/dist/components/presentation-editor/layers/types/html/buttons/strikethrough-button/index.js +2 -0
  99. package/dist/components/presentation-editor/layers/types/html/buttons/strikethrough-button/strikethrough-button.svelte +19 -0
  100. package/dist/components/presentation-editor/layers/types/html/buttons/strikethrough-button/strikethrough-button.svelte.d.ts +7 -0
  101. package/dist/components/presentation-editor/layers/types/html/buttons/underline-button/index.d.ts +2 -0
  102. package/dist/components/presentation-editor/layers/types/html/buttons/underline-button/index.js +2 -0
  103. package/dist/components/presentation-editor/layers/types/html/buttons/underline-button/underline-button.svelte +20 -0
  104. package/dist/components/presentation-editor/layers/types/html/buttons/underline-button/underline-button.svelte.d.ts +7 -0
  105. package/dist/components/presentation-editor/layers/types/html/editor/Editor.d.ts +4 -0
  106. package/dist/components/presentation-editor/layers/types/html/editor/Editor.js +4 -0
  107. package/dist/components/presentation-editor/layers/types/html/editor/createEditor.d.ts +5 -0
  108. package/dist/components/presentation-editor/layers/types/html/editor/createEditor.js +18 -0
  109. package/dist/components/presentation-editor/layers/types/html/editor/editor-content.svelte +60 -0
  110. package/dist/components/presentation-editor/layers/types/html/editor/editor-content.svelte.d.ts +5 -0
  111. package/dist/components/presentation-editor/layers/types/html/editor/index.d.ts +3 -0
  112. package/dist/components/presentation-editor/layers/types/html/editor/index.js +3 -0
  113. package/dist/components/presentation-editor/layers/types/html/editor/types.d.ts +10 -0
  114. package/dist/components/presentation-editor/layers/types/html/editor/types.js +1 -0
  115. package/dist/components/presentation-editor/layers/types/html/editor.css +7 -0
  116. package/dist/components/presentation-editor/layers/types/html/extensions/font-size/font-size.d.ts +20 -0
  117. package/dist/components/presentation-editor/layers/types/html/extensions/font-size/font-size.js +44 -0
  118. package/dist/components/presentation-editor/layers/types/html/extensions/font-size/index.d.ts +3 -0
  119. package/dist/components/presentation-editor/layers/types/html/extensions/font-size/index.js +3 -0
  120. package/dist/components/presentation-editor/layers/types/html/extensions/line-height/index.d.ts +3 -0
  121. package/dist/components/presentation-editor/layers/types/html/extensions/line-height/index.js +3 -0
  122. package/dist/components/presentation-editor/layers/types/html/extensions/line-height/line-height.d.ts +22 -0
  123. package/dist/components/presentation-editor/layers/types/html/extensions/line-height/line-height.js +44 -0
  124. package/dist/components/presentation-editor/layers/types/html/extensions/selection/index.d.ts +3 -0
  125. package/dist/components/presentation-editor/layers/types/html/extensions/selection/index.js +3 -0
  126. package/dist/components/presentation-editor/layers/types/html/extensions/selection/selection.d.ts +3 -0
  127. package/dist/components/presentation-editor/layers/types/html/extensions/selection/selection.js +30 -0
  128. package/dist/components/presentation-editor/layers/types/html/extensions/text-transform/index.d.ts +3 -0
  129. package/dist/components/presentation-editor/layers/types/html/extensions/text-transform/index.js +3 -0
  130. package/dist/components/presentation-editor/layers/types/html/extensions/text-transform/text-transform.d.ts +20 -0
  131. package/dist/components/presentation-editor/layers/types/html/extensions/text-transform/text-transform.js +50 -0
  132. package/dist/components/presentation-editor/layers/types/html/extensions/unstyled-list/index.d.ts +3 -0
  133. package/dist/components/presentation-editor/layers/types/html/extensions/unstyled-list/index.js +3 -0
  134. package/dist/components/presentation-editor/layers/types/html/extensions/unstyled-list/unstyled-list.d.ts +47 -0
  135. package/dist/components/presentation-editor/layers/types/html/extensions/unstyled-list/unstyled-list.js +74 -0
  136. package/dist/components/presentation-editor/layers/types/html/html-content.svelte +21 -0
  137. package/dist/components/presentation-editor/layers/types/html/html-content.svelte.d.ts +5 -0
  138. package/dist/components/presentation-editor/layers/types/html/html-layer-active.svelte +159 -0
  139. package/dist/components/presentation-editor/layers/types/html/html-layer-active.svelte.d.ts +8 -0
  140. package/dist/components/presentation-editor/layers/types/html/html-layer-buttons.svelte +42 -0
  141. package/dist/components/presentation-editor/layers/types/html/html-layer-buttons.svelte.d.ts +10 -0
  142. package/dist/components/presentation-editor/layers/types/html/html-layer-thumb.svelte +24 -0
  143. package/dist/components/presentation-editor/layers/types/html/html-layer-thumb.svelte.d.ts +8 -0
  144. package/dist/components/presentation-editor/layers/types/html/html-layer.svelte +97 -0
  145. package/dist/components/presentation-editor/layers/types/html/html-layer.svelte.d.ts +7 -0
  146. package/dist/components/presentation-editor/layers/types/html/index.d.ts +7 -0
  147. package/dist/components/presentation-editor/layers/types/html/index.js +58 -0
  148. package/dist/components/presentation-editor/layers/types/image/image-content.svelte +96 -0
  149. package/dist/components/presentation-editor/layers/types/image/image-content.svelte.d.ts +8 -0
  150. package/dist/components/presentation-editor/layers/types/image/image-layer-active.svelte +39 -0
  151. package/dist/components/presentation-editor/layers/types/image/image-layer-active.svelte.d.ts +7 -0
  152. package/dist/components/presentation-editor/layers/types/image/image-layer-buttons.svelte +21 -0
  153. package/dist/components/presentation-editor/layers/types/image/image-layer-buttons.svelte.d.ts +7 -0
  154. package/dist/components/presentation-editor/layers/types/image/image-layer-thumb.svelte +13 -0
  155. package/dist/components/presentation-editor/layers/types/image/image-layer-thumb.svelte.d.ts +8 -0
  156. package/dist/components/presentation-editor/layers/types/image/image-layer.svelte +80 -0
  157. package/dist/components/presentation-editor/layers/types/image/image-layer.svelte.d.ts +7 -0
  158. package/dist/components/presentation-editor/layers/types/image/index.d.ts +5 -0
  159. package/dist/components/presentation-editor/layers/types/image/index.js +5 -0
  160. package/dist/components/presentation-editor/layers/utils.d.ts +32 -0
  161. package/dist/components/presentation-editor/layers/utils.js +92 -0
  162. package/dist/components/presentation-editor/presentation-editor.svelte +336 -0
  163. package/dist/components/presentation-editor/presentation-editor.svelte.d.ts +7 -0
  164. package/dist/components/presentation-editor/presentation-editor.svelte.js +352 -0
  165. package/dist/components/presentation-editor/sidebar/images-library.svelte +108 -0
  166. package/dist/components/presentation-editor/sidebar/images-library.svelte.d.ts +3 -0
  167. package/dist/components/presentation-editor/sidebar/layers.svelte +94 -0
  168. package/dist/components/presentation-editor/sidebar/layers.svelte.d.ts +18 -0
  169. package/dist/components/presentation-editor/sidebar/sidebar.svelte +20 -0
  170. package/dist/components/presentation-editor/sidebar/sidebar.svelte.d.ts +7 -0
  171. package/dist/components/presentation-editor/sidebar/uploads-image.svelte +64 -0
  172. package/dist/components/presentation-editor/sidebar/uploads-image.svelte.d.ts +5 -0
  173. package/dist/components/presentation-editor/slide-editor.svelte +106 -0
  174. package/dist/components/presentation-editor/slide-editor.svelte.d.ts +7 -0
  175. package/dist/components/presentation-editor/slide-inner.svelte +53 -0
  176. package/dist/components/presentation-editor/slide-inner.svelte.d.ts +18 -0
  177. package/dist/components/presentation-editor/slides-navigation/buttons/slide-delete-button.svelte +32 -0
  178. package/dist/components/presentation-editor/slides-navigation/buttons/slide-delete-button.svelte.d.ts +10 -0
  179. package/dist/components/presentation-editor/slides-navigation/buttons/slide-duplicate-button.svelte +34 -0
  180. package/dist/components/presentation-editor/slides-navigation/buttons/slide-duplicate-button.svelte.d.ts +10 -0
  181. package/dist/components/presentation-editor/slides-navigation/slide-preview.svelte +134 -0
  182. package/dist/components/presentation-editor/slides-navigation/slide-preview.svelte.d.ts +11 -0
  183. package/dist/components/presentation-editor/slides-navigation/slides-navigation.svelte +100 -0
  184. package/dist/components/presentation-editor/slides-navigation/slides-navigation.svelte.d.ts +3 -0
  185. package/dist/components/presentation-editor/snapping-guides.svelte +41 -0
  186. package/dist/components/presentation-editor/snapping-guides.svelte.d.ts +8 -0
  187. package/dist/components/presentation-editor/types.d.ts +118 -0
  188. package/dist/components/presentation-editor/types.js +1 -0
  189. package/dist/components/presentation-editor/utils.d.ts +5 -0
  190. package/dist/components/presentation-editor/utils.js +348 -0
  191. package/dist/components/ui/button/button.svelte +94 -0
  192. package/dist/components/ui/button/button.svelte.d.ts +155 -0
  193. package/dist/components/ui/button/index.d.ts +2 -0
  194. package/dist/components/ui/button/index.js +4 -0
  195. package/dist/components/ui/context-menu/context-menu-checkbox-item.svelte +40 -0
  196. package/dist/components/ui/context-menu/context-menu-checkbox-item.svelte.d.ts +8 -0
  197. package/dist/components/ui/context-menu/context-menu-content.svelte +24 -0
  198. package/dist/components/ui/context-menu/context-menu-content.svelte.d.ts +7 -0
  199. package/dist/components/ui/context-menu/context-menu-group-heading.svelte +19 -0
  200. package/dist/components/ui/context-menu/context-menu-group-heading.svelte.d.ts +7 -0
  201. package/dist/components/ui/context-menu/context-menu-item.svelte +23 -0
  202. package/dist/components/ui/context-menu/context-menu-item.svelte.d.ts +7 -0
  203. package/dist/components/ui/context-menu/context-menu-radio-item.svelte +30 -0
  204. package/dist/components/ui/context-menu/context-menu-radio-item.svelte.d.ts +4 -0
  205. package/dist/components/ui/context-menu/context-menu-separator.svelte +16 -0
  206. package/dist/components/ui/context-menu/context-menu-separator.svelte.d.ts +4 -0
  207. package/dist/components/ui/context-menu/context-menu-shortcut.svelte +20 -0
  208. package/dist/components/ui/context-menu/context-menu-shortcut.svelte.d.ts +5 -0
  209. package/dist/components/ui/context-menu/context-menu-sub-content.svelte +19 -0
  210. package/dist/components/ui/context-menu/context-menu-sub-content.svelte.d.ts +4 -0
  211. package/dist/components/ui/context-menu/context-menu-sub-trigger.svelte +28 -0
  212. package/dist/components/ui/context-menu/context-menu-sub-trigger.svelte.d.ts +7 -0
  213. package/dist/components/ui/context-menu/index.d.ts +16 -0
  214. package/dist/components/ui/context-menu/index.js +18 -0
  215. package/dist/components/ui/dialog/dialog-content.svelte +38 -0
  216. package/dist/components/ui/dialog/dialog-content.svelte.d.ts +9 -0
  217. package/dist/components/ui/dialog/dialog-description.svelte +16 -0
  218. package/dist/components/ui/dialog/dialog-description.svelte.d.ts +4 -0
  219. package/dist/components/ui/dialog/dialog-footer.svelte +20 -0
  220. package/dist/components/ui/dialog/dialog-footer.svelte.d.ts +5 -0
  221. package/dist/components/ui/dialog/dialog-header.svelte +20 -0
  222. package/dist/components/ui/dialog/dialog-header.svelte.d.ts +5 -0
  223. package/dist/components/ui/dialog/dialog-overlay.svelte +19 -0
  224. package/dist/components/ui/dialog/dialog-overlay.svelte.d.ts +4 -0
  225. package/dist/components/ui/dialog/dialog-title.svelte +16 -0
  226. package/dist/components/ui/dialog/dialog-title.svelte.d.ts +4 -0
  227. package/dist/components/ui/dialog/index.d.ts +12 -0
  228. package/dist/components/ui/dialog/index.js +14 -0
  229. package/dist/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte +40 -0
  230. package/dist/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte.d.ts +8 -0
  231. package/dist/components/ui/dropdown-menu/dropdown-menu-content.svelte +21 -0
  232. package/dist/components/ui/dropdown-menu/dropdown-menu-content.svelte.d.ts +4 -0
  233. package/dist/components/ui/dropdown-menu/dropdown-menu-group-heading.svelte +19 -0
  234. package/dist/components/ui/dropdown-menu/dropdown-menu-group-heading.svelte.d.ts +7 -0
  235. package/dist/components/ui/dropdown-menu/dropdown-menu-item.svelte +23 -0
  236. package/dist/components/ui/dropdown-menu/dropdown-menu-item.svelte.d.ts +7 -0
  237. package/dist/components/ui/dropdown-menu/dropdown-menu-label.svelte +23 -0
  238. package/dist/components/ui/dropdown-menu/dropdown-menu-label.svelte.d.ts +8 -0
  239. package/dist/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte +30 -0
  240. package/dist/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte.d.ts +4 -0
  241. package/dist/components/ui/dropdown-menu/dropdown-menu-separator.svelte +16 -0
  242. package/dist/components/ui/dropdown-menu/dropdown-menu-separator.svelte.d.ts +4 -0
  243. package/dist/components/ui/dropdown-menu/dropdown-menu-shortcut.svelte +20 -0
  244. package/dist/components/ui/dropdown-menu/dropdown-menu-shortcut.svelte.d.ts +5 -0
  245. package/dist/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte +19 -0
  246. package/dist/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte.d.ts +4 -0
  247. package/dist/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte +28 -0
  248. package/dist/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte.d.ts +7 -0
  249. package/dist/components/ui/dropdown-menu/index.d.ts +25 -0
  250. package/dist/components/ui/dropdown-menu/index.js +17 -0
  251. package/dist/components/ui/input/index.d.ts +2 -0
  252. package/dist/components/ui/input/index.js +4 -0
  253. package/dist/components/ui/input/input.svelte +22 -0
  254. package/dist/components/ui/input/input.svelte.d.ts +5 -0
  255. package/dist/components/ui/label/index.d.ts +2 -0
  256. package/dist/components/ui/label/index.js +4 -0
  257. package/dist/components/ui/label/label.svelte +19 -0
  258. package/dist/components/ui/label/label.svelte.d.ts +4 -0
  259. package/dist/components/ui/popover/index.d.ts +6 -0
  260. package/dist/components/ui/popover/index.js +8 -0
  261. package/dist/components/ui/popover/popover-content.svelte +25 -0
  262. package/dist/components/ui/popover/popover-content.svelte.d.ts +4 -0
  263. package/dist/components/ui/scroll-area/index.d.ts +3 -0
  264. package/dist/components/ui/scroll-area/index.js +5 -0
  265. package/dist/components/ui/scroll-area/scroll-area-scrollbar.svelte +29 -0
  266. package/dist/components/ui/scroll-area/scroll-area-scrollbar.svelte.d.ts +4 -0
  267. package/dist/components/ui/scroll-area/scroll-area.svelte +34 -0
  268. package/dist/components/ui/scroll-area/scroll-area.svelte.d.ts +10 -0
  269. package/dist/components/ui/separator/index.d.ts +2 -0
  270. package/dist/components/ui/separator/index.js +4 -0
  271. package/dist/components/ui/separator/separator.svelte +22 -0
  272. package/dist/components/ui/separator/separator.svelte.d.ts +4 -0
  273. package/dist/components/ui/slider/index.d.ts +2 -0
  274. package/dist/components/ui/slider/index.js +4 -0
  275. package/dist/components/ui/slider/slider.svelte +34 -0
  276. package/dist/components/ui/slider/slider.svelte.d.ts +4 -0
  277. package/dist/components/ui/toggle/index.d.ts +3 -0
  278. package/dist/components/ui/toggle/index.js +5 -0
  279. package/dist/components/ui/toggle/toggle.svelte +51 -0
  280. package/dist/components/ui/toggle/toggle.svelte.d.ts +90 -0
  281. package/dist/components/ui/tooltip/index.d.ts +6 -0
  282. package/dist/components/ui/tooltip/index.js +8 -0
  283. package/dist/components/ui/tooltip/tooltip-content.svelte +21 -0
  284. package/dist/components/ui/tooltip/tooltip-content.svelte.d.ts +4 -0
  285. package/dist/index.d.ts +9 -0
  286. package/dist/index.js +8 -0
  287. package/dist/plugin.d.ts +5 -0
  288. package/dist/plugin.js +154 -0
  289. package/dist/utils.d.ts +6 -0
  290. package/dist/utils.js +31 -0
  291. package/package.json +99 -0
@@ -0,0 +1,7 @@
1
+ import type { Editor } from '../../editor/Editor.js';
2
+ interface Props {
3
+ editor: Editor;
4
+ }
5
+ declare const StrikethroughButton: import("svelte").Component<Props, {}, "">;
6
+ type StrikethroughButton = ReturnType<typeof StrikethroughButton>;
7
+ export default StrikethroughButton;
@@ -0,0 +1,2 @@
1
+ import UnderlineButton from './underline-button.svelte';
2
+ export { UnderlineButton };
@@ -0,0 +1,2 @@
1
+ import UnderlineButton from './underline-button.svelte';
2
+ export { UnderlineButton };
@@ -0,0 +1,20 @@
1
+ <script lang="ts">
2
+ import type { Editor } from '../../editor/index.js';
3
+ import UnderlineIcon from 'lucide-svelte/icons/underline';
4
+ import { Toggle } from '../../../../../../ui/toggle/index.js';
5
+
6
+ interface Props {
7
+ editor: Editor;
8
+ }
9
+
10
+ let { editor }: Props = $props();
11
+ </script>
12
+
13
+ <Toggle
14
+ size="xs"
15
+ pressed={editor.isActive('underline')}
16
+ onPressedChange={(val) =>
17
+ val ? editor.commands.setUnderline() : editor.commands.unsetUnderline()}
18
+ >
19
+ <UnderlineIcon class="h-6 w-6" />
20
+ </Toggle>
@@ -0,0 +1,7 @@
1
+ import type { Editor } from '../../editor/index.js';
2
+ interface Props {
3
+ editor: Editor;
4
+ }
5
+ declare const UnderlineButton: import("svelte").Component<Props, {}, "">;
6
+ type UnderlineButton = ReturnType<typeof UnderlineButton>;
7
+ export default UnderlineButton;
@@ -0,0 +1,4 @@
1
+ import { Editor as CoreEditor } from '@tiptap/core';
2
+ export declare class Editor extends CoreEditor {
3
+ contentElement: HTMLElement | null;
4
+ }
@@ -0,0 +1,4 @@
1
+ import { Editor as CoreEditor } from '@tiptap/core';
2
+ export class Editor extends CoreEditor {
3
+ contentElement = null;
4
+ }
@@ -0,0 +1,5 @@
1
+ import type { EditorOptions } from '@tiptap/core';
2
+ import { type Readable } from 'svelte/store';
3
+ import { Editor } from './Editor.js';
4
+ declare const createEditor: (options: Partial<EditorOptions>) => Readable<Editor>;
5
+ export default createEditor;
@@ -0,0 +1,18 @@
1
+ import { readable } from 'svelte/store';
2
+ import { Editor } from './Editor.js';
3
+ import { tick } from 'svelte';
4
+ const createEditor = (options) => {
5
+ const editor = new Editor(options);
6
+ return readable(editor, (set) => {
7
+ editor.on('transaction', () => {
8
+ tick().then(() => {
9
+ set(editor);
10
+ });
11
+ });
12
+ return () => {
13
+ console.log('destroying editor');
14
+ editor.destroy();
15
+ };
16
+ });
17
+ };
18
+ export default createEditor;
@@ -0,0 +1,60 @@
1
+ <script lang="ts">
2
+ import { onDestroy, onMount, tick } from 'svelte';
3
+ import type { ComponentInputProps } from './types.js';
4
+
5
+ type Props = ComponentInputProps<{}>;
6
+
7
+ const { editor, children }: Props = $props();
8
+ let element: HTMLElement;
9
+
10
+ const init = async () => {
11
+ console.log('init editor content', editor);
12
+ await tick();
13
+ if (!element) {
14
+ return;
15
+ }
16
+
17
+ if (!editor?.options.element) {
18
+ return;
19
+ }
20
+
21
+ if (editor.contentElement) {
22
+ return;
23
+ }
24
+
25
+ element.append(...Array.from(editor.options.element.childNodes));
26
+ editor.setOptions({ element });
27
+
28
+ editor.contentElement = element;
29
+
30
+ editor.commands.focus('all');
31
+ };
32
+
33
+ onMount(init);
34
+
35
+ onDestroy(() => {
36
+ console.log('destroy editor content', editor);
37
+ if (!editor) {
38
+ return;
39
+ }
40
+
41
+ editor.contentElement = null;
42
+
43
+ if (!editor.options.element.firstChild) {
44
+ return;
45
+ }
46
+
47
+ const newElement = document.createElement('div');
48
+ newElement.append(...Array.from(editor.options.element.childNodes));
49
+
50
+ editor.setOptions({
51
+ element: newElement,
52
+ });
53
+ });
54
+ </script>
55
+
56
+ <div bind:this={element}></div>
57
+
58
+ {#if children}
59
+ {@render children()}
60
+ {/if}
@@ -0,0 +1,5 @@
1
+ import type { ComponentInputProps } from './types.js';
2
+ type Props = ComponentInputProps<{}>;
3
+ declare const EditorContent: import("svelte").Component<Props, {}, "">;
4
+ type EditorContent = ReturnType<typeof EditorContent>;
5
+ export default EditorContent;
@@ -0,0 +1,3 @@
1
+ export * from './Editor.js';
2
+ export { default as createEditor } from './createEditor.js';
3
+ export { default as EditorContent } from './editor-content.svelte';
@@ -0,0 +1,3 @@
1
+ export * from './Editor.js';
2
+ export { default as createEditor } from './createEditor.js';
3
+ export { default as EditorContent } from './editor-content.svelte';
@@ -0,0 +1,10 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { Editor } from './Editor.js';
3
+ export interface TiptapNodeViewContext {
4
+ onDragStart: (event: DragEvent) => void;
5
+ }
6
+ export type ComponentInputProps<T> = Partial<T> & {
7
+ editor: Editor;
8
+ class?: string;
9
+ children?: Snippet;
10
+ };
@@ -0,0 +1,7 @@
1
+ .ProseMirror {
2
+ @apply caret-black outline-0 selection:bg-black/10 dark:caret-white dark:selection:bg-white/20;
3
+
4
+ .selection {
5
+ @apply bg-black/10 dark:bg-white/20;
6
+ }
7
+ }
@@ -0,0 +1,20 @@
1
+ import { Extension } from '@tiptap/core';
2
+ import '@tiptap/extension-text-style';
3
+ export type FontSizeOptions = {
4
+ types: string[];
5
+ };
6
+ declare module '@tiptap/core' {
7
+ interface Commands<ReturnType> {
8
+ fontSize: {
9
+ /**
10
+ * Set the font size
11
+ */
12
+ setFontSize: (fontSize: number) => ReturnType;
13
+ /**
14
+ * Unset the font size
15
+ */
16
+ unsetFontSize: () => ReturnType;
17
+ };
18
+ }
19
+ }
20
+ export declare const FontSize: Extension<FontSizeOptions, any>;
@@ -0,0 +1,44 @@
1
+ import { Extension } from '@tiptap/core';
2
+ import '@tiptap/extension-text-style';
3
+ export const FontSize = Extension.create({
4
+ name: 'fontSize',
5
+ addOptions() {
6
+ return {
7
+ types: [],
8
+ };
9
+ },
10
+ addGlobalAttributes() {
11
+ return [
12
+ {
13
+ types: this.options.types,
14
+ attributes: {
15
+ fontSize: {
16
+ default: null,
17
+ parseHTML: (element) => element.style.fontSize?.replace(/['"\D]+/g, ''),
18
+ renderHTML: (attributes) => {
19
+ if (!attributes.fontSize) {
20
+ return {};
21
+ }
22
+ return {
23
+ style: `font-size: ${attributes.fontSize}px`,
24
+ };
25
+ },
26
+ },
27
+ },
28
+ },
29
+ ];
30
+ },
31
+ addCommands() {
32
+ return {
33
+ setFontSize: (fontSize) => ({
34
+ // chain,
35
+ commands, }) => {
36
+ return this.options.types.every((type) => commands.updateAttributes(type, { fontSize }));
37
+ // return chain().setMark('textStyle', { fontSize }).run();
38
+ },
39
+ unsetFontSize: () => ({ chain }) => {
40
+ return chain().setMark('textStyle', { fontSize: null }).removeEmptyTextStyle().run();
41
+ },
42
+ };
43
+ },
44
+ });
@@ -0,0 +1,3 @@
1
+ import { FontSize } from './font-size.js';
2
+ export * from './font-size.js';
3
+ export default FontSize;
@@ -0,0 +1,3 @@
1
+ import { FontSize } from './font-size.js';
2
+ export * from './font-size.js';
3
+ export default FontSize;
@@ -0,0 +1,3 @@
1
+ import { LineHeight } from './line-height.js';
2
+ export * from './line-height.js';
3
+ export default LineHeight;
@@ -0,0 +1,3 @@
1
+ import { LineHeight } from './line-height.js';
2
+ export * from './line-height.js';
3
+ export default LineHeight;
@@ -0,0 +1,22 @@
1
+ import { Extension } from '@tiptap/core';
2
+ export interface LineHeightOptions {
3
+ types: string[];
4
+ min: number;
5
+ max: number;
6
+ defaultHeight: number;
7
+ }
8
+ declare module '@tiptap/core' {
9
+ interface Commands<ReturnType> {
10
+ lineHeight: {
11
+ /**
12
+ * Set the line height attribute
13
+ */
14
+ setLineHeight: (height: number) => ReturnType;
15
+ /**
16
+ * Unset the text align attribute
17
+ */
18
+ unsetLineHeight: () => ReturnType;
19
+ };
20
+ }
21
+ }
22
+ export declare const LineHeight: Extension<LineHeightOptions, any>;
@@ -0,0 +1,44 @@
1
+ import { Extension } from '@tiptap/core';
2
+ export const LineHeight = Extension.create({
3
+ name: 'lineHeight',
4
+ addOptions() {
5
+ return {
6
+ types: ['heading', 'paragraph'],
7
+ min: 0.5,
8
+ max: 2.5,
9
+ defaultHeight: 1.4,
10
+ };
11
+ },
12
+ addGlobalAttributes() {
13
+ return [
14
+ {
15
+ types: this.options.types,
16
+ attributes: {
17
+ lineHeight: {
18
+ default: this.options.defaultHeight,
19
+ parseHTML: (element) => element.style.lineHeight,
20
+ renderHTML: (attributes) => {
21
+ // if (attributes.lineHeight === this.options.defaultHeight) {
22
+ // return {};
23
+ // }
24
+ return { style: `line-height: ${attributes.lineHeight}` };
25
+ },
26
+ },
27
+ },
28
+ },
29
+ ];
30
+ },
31
+ addCommands() {
32
+ return {
33
+ setLineHeight: (height) => ({ commands }) => {
34
+ if (this.options.min > height || this.options.max < height) {
35
+ return false;
36
+ }
37
+ return this.options.types.every((type) => commands.updateAttributes(type, { lineHeight: height }));
38
+ },
39
+ unsetLineHeight: () => ({ commands }) => {
40
+ return this.options.types.every((type) => commands.resetAttributes(type, 'lineHeight'));
41
+ },
42
+ };
43
+ },
44
+ });
@@ -0,0 +1,3 @@
1
+ import { Selection } from './selection.js';
2
+ export * from './selection.js';
3
+ export default Selection;
@@ -0,0 +1,3 @@
1
+ import { Selection } from './selection.js';
2
+ export * from './selection.js';
3
+ export default Selection;
@@ -0,0 +1,3 @@
1
+ import { Extension } from '@tiptap/core';
2
+ export declare const Selection: Extension<any, any>;
3
+ export default Selection;
@@ -0,0 +1,30 @@
1
+ import { Extension } from '@tiptap/core';
2
+ import { Plugin, PluginKey } from '@tiptap/pm/state';
3
+ import { Decoration, DecorationSet } from '@tiptap/pm/view';
4
+ export const Selection = Extension.create({
5
+ name: 'selection',
6
+ addProseMirrorPlugins() {
7
+ const { editor } = this;
8
+ return [
9
+ new Plugin({
10
+ key: new PluginKey('selection'),
11
+ props: {
12
+ decorations(state) {
13
+ if (state.selection.empty) {
14
+ return null;
15
+ }
16
+ if (editor.isFocused === true) {
17
+ return null;
18
+ }
19
+ return DecorationSet.create(state.doc, [
20
+ Decoration.inline(state.selection.from, state.selection.to, {
21
+ class: 'selection',
22
+ }),
23
+ ]);
24
+ },
25
+ },
26
+ }),
27
+ ];
28
+ },
29
+ });
30
+ export default Selection;
@@ -0,0 +1,3 @@
1
+ import { TextTransform } from './text-transform.js';
2
+ export * from './text-transform.js';
3
+ export default TextTransform;
@@ -0,0 +1,3 @@
1
+ import { TextTransform } from './text-transform.js';
2
+ export * from './text-transform.js';
3
+ export default TextTransform;
@@ -0,0 +1,20 @@
1
+ import { Extension } from '@tiptap/core';
2
+ import '@tiptap/extension-text-style';
3
+ export type TextTransformOptions = {
4
+ types: string[];
5
+ };
6
+ declare module '@tiptap/core' {
7
+ interface Commands<ReturnType> {
8
+ textTransform: {
9
+ /**
10
+ * Set the text transform
11
+ */
12
+ setTextTransform: (textTransform: string) => ReturnType;
13
+ /**
14
+ * Unset the text transform
15
+ */
16
+ unsetTextTransform: () => ReturnType;
17
+ };
18
+ }
19
+ }
20
+ export declare const TextTransform: Extension<TextTransformOptions, any>;
@@ -0,0 +1,50 @@
1
+ import { Extension } from '@tiptap/core';
2
+ import '@tiptap/extension-text-style';
3
+ export const TextTransform = Extension.create({
4
+ name: 'textTransform',
5
+ addOptions() {
6
+ return {
7
+ types: [],
8
+ };
9
+ },
10
+ addGlobalAttributes() {
11
+ return [
12
+ {
13
+ types: this.options.types,
14
+ attributes: {
15
+ textTransform: {
16
+ default: null,
17
+ parseHTML: (element) => element.style.textTransform,
18
+ renderHTML: (attributes) => {
19
+ if (!attributes.textTransform) {
20
+ return {};
21
+ }
22
+ return {
23
+ style: `text-transform: ${attributes.textTransform}`,
24
+ };
25
+ },
26
+ },
27
+ },
28
+ },
29
+ ];
30
+ },
31
+ addCommands() {
32
+ return {
33
+ setTextTransform: (textTransform) => ({
34
+ // chain,
35
+ commands, }) => {
36
+ return this.options.types.every((type) => commands.updateAttributes(type, { textTransform }));
37
+ // return chain().setMark('textTransform', { textTransform }).run();
38
+ },
39
+ unsetTextTransform: () => ({
40
+ // chain,
41
+ commands, }) => {
42
+ return this.options.types.every((type) => commands.updateAttributes(type, { textTransform: null }));
43
+ // return chain()
44
+ // .setMark('textTransform', { textTransform: null })
45
+ // .removeEmptyTextStyle()
46
+ // .run();
47
+ },
48
+ };
49
+ },
50
+ });
@@ -0,0 +1,3 @@
1
+ import { UnstyledList } from './unstyled-list.js';
2
+ export * from './unstyled-list.js';
3
+ export default UnstyledList;
@@ -0,0 +1,3 @@
1
+ import { UnstyledList } from './unstyled-list.js';
2
+ export * from './unstyled-list.js';
3
+ export default UnstyledList;
@@ -0,0 +1,47 @@
1
+ import { Node } from '@tiptap/core';
2
+ export interface UnstyledListOptions {
3
+ /**
4
+ * The node name for the list items
5
+ * @default 'listItem'
6
+ * @example 'paragraph'
7
+ */
8
+ itemTypeName: string;
9
+ /**
10
+ * HTML attributes to add to the unstyled list element
11
+ * @default {}
12
+ * @example { class: 'foo' }
13
+ */
14
+ HTMLAttributes: Record<string, any>;
15
+ /**
16
+ * Keep the marks when splitting the list
17
+ * @default false
18
+ * @example true
19
+ */
20
+ keepMarks: boolean;
21
+ /**
22
+ * Keep the attributes when splitting the list
23
+ * @default false
24
+ * @example true
25
+ */
26
+ keepAttributes: boolean;
27
+ }
28
+ declare module '@tiptap/core' {
29
+ interface Commands<ReturnType> {
30
+ unstyledList: {
31
+ /**
32
+ * Toggle a unstyled list
33
+ */
34
+ toggleUnstyledList: () => ReturnType;
35
+ };
36
+ }
37
+ }
38
+ /**
39
+ * Matches a unstyled list to a dash or asterisk.
40
+ */
41
+ export declare const inputRegex: RegExp;
42
+ /**
43
+ * This extension allows you to create unstyled lists.
44
+ * This requires the ListItem extension
45
+ * @see https://tiptap.dev/api/nodes/list-item.
46
+ */
47
+ export declare const UnstyledList: Node<UnstyledListOptions, any>;
@@ -0,0 +1,74 @@
1
+ import { mergeAttributes, Node, wrappingInputRule } from '@tiptap/core';
2
+ import ListItem from '@tiptap/extension-list-item';
3
+ import TextStyle from '@tiptap/extension-text-style';
4
+ /**
5
+ * Matches a unstyled list to a dash or asterisk.
6
+ */
7
+ export const inputRegex = /^\s*([-+*])\s$/;
8
+ /**
9
+ * This extension allows you to create unstyled lists.
10
+ * This requires the ListItem extension
11
+ * @see https://tiptap.dev/api/nodes/list-item.
12
+ */
13
+ export const UnstyledList = Node.create({
14
+ name: 'unstyledList',
15
+ addOptions() {
16
+ return {
17
+ itemTypeName: 'listItem',
18
+ HTMLAttributes: {},
19
+ keepMarks: false,
20
+ keepAttributes: false,
21
+ };
22
+ },
23
+ group: 'block list',
24
+ content() {
25
+ return `${this.options.itemTypeName}+`;
26
+ },
27
+ parseHTML() {
28
+ return [{ tag: 'ul' }];
29
+ },
30
+ renderHTML({ HTMLAttributes }) {
31
+ return ['ul', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
32
+ },
33
+ addCommands() {
34
+ return {
35
+ toggleUnstyledList: () => ({ commands, chain }) => {
36
+ const selection = this.editor.view.state.selection;
37
+ console.log('selection', selection.from, selection.to, selection);
38
+ if (this.options.keepAttributes) {
39
+ console.log(TextStyle.name, this.editor.getAttributes(TextStyle.name));
40
+ console.log('fontSize', this.editor.getAttributes('fontSize'));
41
+ return chain()
42
+ .toggleList(this.name, this.options.itemTypeName, this.options.keepMarks)
43
+ .updateAttributes(ListItem.name, this.editor.getAttributes(TextStyle.name))
44
+ .run();
45
+ }
46
+ return commands.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks);
47
+ },
48
+ };
49
+ },
50
+ addKeyboardShortcuts() {
51
+ return {
52
+ 'Mod-Shift-9': () => this.editor.commands.toggleUnstyledList(),
53
+ };
54
+ },
55
+ addInputRules() {
56
+ let inputRule = wrappingInputRule({
57
+ find: inputRegex,
58
+ type: this.type,
59
+ });
60
+ if (this.options.keepMarks || this.options.keepAttributes) {
61
+ inputRule = wrappingInputRule({
62
+ find: inputRegex,
63
+ type: this.type,
64
+ keepMarks: this.options.keepMarks,
65
+ keepAttributes: this.options.keepAttributes,
66
+ getAttributes: () => {
67
+ return this.editor.getAttributes(TextStyle.name);
68
+ },
69
+ editor: this.editor,
70
+ });
71
+ }
72
+ return [inputRule];
73
+ },
74
+ });
@@ -0,0 +1,21 @@
1
+ <script lang="ts">
2
+ import { BROWSER } from 'esm-env';
3
+ import { generateHTML, type JSONContent } from '@tiptap/core';
4
+ import { extensions } from './index.js';
5
+
6
+ let { html } = $props();
7
+
8
+ const getHtml = (html: JSONContent) => {
9
+ try {
10
+ return generateHTML(html, extensions);
11
+ } catch (err) {
12
+ console.error(err);
13
+ return '<p></p>';
14
+ }
15
+ };
16
+ </script>
17
+
18
+ {#if BROWSER}
19
+ <!-- eslint-disable svelte/no-at-html-tags -->
20
+ {@html getHtml(html)}
21
+ {/if}
@@ -0,0 +1,5 @@
1
+ declare const HtmlContent: import("svelte").Component<{
2
+ html: any;
3
+ }, {}, "">;
4
+ type HtmlContent = ReturnType<typeof HtmlContent>;
5
+ export default HtmlContent;