@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,118 @@
1
+ import { type JSONContent } from '@tiptap/core';
2
+ export type ActiveSidebar = 'images' | 'layers' | null;
3
+ export type Image = {
4
+ id: string;
5
+ src: string;
6
+ width: number;
7
+ height: number;
8
+ };
9
+ export type Dragged = {
10
+ id: string;
11
+ hidden: boolean;
12
+ sticky: boolean;
13
+ image: Image;
14
+ x: number;
15
+ y: number;
16
+ offsetX: number;
17
+ offsetY: number;
18
+ initialScale: number;
19
+ scale: number | null;
20
+ };
21
+ export type CursorTooltip = {
22
+ x: number;
23
+ y: number;
24
+ text: string;
25
+ };
26
+ interface BaseLayer {
27
+ id: string;
28
+ x: number;
29
+ y: number;
30
+ width: number;
31
+ height: number;
32
+ rotate: number | null;
33
+ opacity: number | null;
34
+ sortOrder: number;
35
+ }
36
+ export interface HtmlLayer extends BaseLayer {
37
+ type: 'html';
38
+ scale: number | null;
39
+ html: JSONContent;
40
+ }
41
+ export type LayerBorder = {
42
+ borderStyle: 'solid' | 'dashed' | 'dotted' | null;
43
+ borderWidth: number | null;
44
+ borderColor: string | null;
45
+ };
46
+ export interface ImageLayer extends BaseLayer, LayerBorder {
47
+ type: 'image';
48
+ scale: number | null;
49
+ image: Image;
50
+ offsetX: number | null;
51
+ offsetY: number | null;
52
+ cornerRadius: number | null;
53
+ flipX: boolean;
54
+ flipY: boolean;
55
+ }
56
+ export type Layer = HtmlLayer | ImageLayer;
57
+ export type Slide = {
58
+ id: string;
59
+ backgroundColor: string | null;
60
+ layers: Layer[];
61
+ sortOrder: number;
62
+ };
63
+ export type ActiveAction = {
64
+ type: string;
65
+ cursor?: string;
66
+ tooltip?: CursorTooltip | null;
67
+ clientX: number;
68
+ clientY: number;
69
+ layer: Layer;
70
+ };
71
+ export type SlideAddAction = {
72
+ type: 'slideAdd';
73
+ slide: Slide;
74
+ };
75
+ export type SlideRemoveAction = {
76
+ type: 'slideRemove';
77
+ slide: Slide;
78
+ newSlide?: Slide;
79
+ };
80
+ export type LayerAddAction = {
81
+ type: 'layerAdd' | 'layerRemove';
82
+ layer: Layer;
83
+ };
84
+ export type SlideChangesAction = {
85
+ type: 'slide';
86
+ undo: object;
87
+ redo: object;
88
+ };
89
+ export type LayerChangesAction = {
90
+ type: 'layer';
91
+ layer: {
92
+ id: string;
93
+ type: string;
94
+ };
95
+ undo: object;
96
+ redo: object;
97
+ };
98
+ export type Action = SlideAddAction | SlideRemoveAction | LayerAddAction | SlideChangesAction | LayerChangesAction;
99
+ export type HistoryAction = Action & {
100
+ slideId: string;
101
+ };
102
+ interface BaseLayerGuide {
103
+ id: string;
104
+ type: string;
105
+ style: 'solid' | 'dashed' | 'dotted';
106
+ }
107
+ export interface LineLayerGuide extends BaseLayerGuide {
108
+ type: 'horizontal' | 'vertical';
109
+ x: number;
110
+ y: number;
111
+ length: number;
112
+ }
113
+ export interface BoxLayerGuide extends BaseLayerGuide {
114
+ type: 'box';
115
+ inset: number;
116
+ }
117
+ export type ActiveLayerGuide = LineLayerGuide | BoxLayerGuide;
118
+ export {};
@@ -0,0 +1 @@
1
+ import {} from '@tiptap/core';
@@ -0,0 +1,5 @@
1
+ import type { Slide } from './types.js';
2
+ export declare const arraysEqual: (a: unknown[], b: unknown[]) => boolean;
3
+ export declare const checkImage: (url: string) => Promise<HTMLImageElement>;
4
+ export declare const getSlides: () => Slide[];
5
+ export declare const cognitionSlideToJson: (slide: any) => Slide;
@@ -0,0 +1,348 @@
1
+ import uniqid from 'uniqid';
2
+ export const arraysEqual = (a, b) => {
3
+ // Check if the arrays have the same length
4
+ if (a.length !== b.length) {
5
+ return false;
6
+ }
7
+ // Compare each element of the arrays
8
+ for (let i = 0; i < a.length; i++) {
9
+ if (a[i] !== b[i]) {
10
+ return false;
11
+ }
12
+ }
13
+ // If all elements are equal, return true
14
+ return true;
15
+ };
16
+ export const checkImage = (url) => new Promise((resolve, reject) => {
17
+ // check that is a valid url
18
+ // then if valid url
19
+ const image = new Image();
20
+ image.crossOrigin = 'anonymous';
21
+ image.src = url;
22
+ image.onload = () => resolve(image);
23
+ image.onerror = reject;
24
+ });
25
+ export const getSlides = () => [
26
+ {
27
+ id: uniqid(),
28
+ backgroundColor: '#5ce1e6',
29
+ sortOrder: 1,
30
+ layers: [
31
+ {
32
+ id: uniqid(),
33
+ x: 200,
34
+ y: 250,
35
+ width: 1400,
36
+ height: 200,
37
+ type: 'html',
38
+ sortOrder: 1,
39
+ scale: null,
40
+ rotate: null,
41
+ opacity: null,
42
+ html: {
43
+ type: 'doc',
44
+ content: [
45
+ {
46
+ type: 'bulletList',
47
+ attrs: {
48
+ fontSize: 80,
49
+ },
50
+ content: [
51
+ {
52
+ type: 'listItem',
53
+ content: [
54
+ {
55
+ type: 'paragraph',
56
+ content: [
57
+ {
58
+ type: 'text',
59
+ text: 'first',
60
+ },
61
+ ],
62
+ },
63
+ ],
64
+ },
65
+ {
66
+ type: 'listItem',
67
+ content: [
68
+ {
69
+ type: 'paragraph',
70
+ content: [
71
+ {
72
+ type: 'text',
73
+ text: 'second',
74
+ },
75
+ ],
76
+ },
77
+ ],
78
+ },
79
+ {
80
+ type: 'listItem',
81
+ content: [
82
+ {
83
+ type: 'paragraph',
84
+ content: [
85
+ {
86
+ type: 'text',
87
+ text: 'third',
88
+ },
89
+ ],
90
+ },
91
+ ],
92
+ },
93
+ ],
94
+ },
95
+ {
96
+ type: 'paragraph',
97
+ attrs: {
98
+ fontSize: 120,
99
+ },
100
+ content: [
101
+ {
102
+ type: 'text',
103
+ text: 'Second ',
104
+ },
105
+ {
106
+ type: 'text',
107
+ marks: [
108
+ {
109
+ type: 'textStyle',
110
+ attrs: {
111
+ color: '#b91c1c',
112
+ },
113
+ },
114
+ ],
115
+ text: 'text layer',
116
+ },
117
+ {
118
+ type: 'text',
119
+ text: ' with some text to check overlapping!',
120
+ },
121
+ ],
122
+ },
123
+ ],
124
+ },
125
+ },
126
+ {
127
+ id: uniqid(),
128
+ x: 200,
129
+ y: 300,
130
+ width: 400,
131
+ height: 200,
132
+ type: 'html',
133
+ sortOrder: 2,
134
+ scale: 2,
135
+ rotate: 45,
136
+ opacity: null,
137
+ html: {
138
+ type: 'doc',
139
+ content: [
140
+ {
141
+ type: 'paragraph',
142
+ attrs: {
143
+ color: '#ff914d',
144
+ lineHeight: 1.2,
145
+ fontSize: 112,
146
+ textAlign: 'center',
147
+ textTransform: 'uppercase',
148
+ },
149
+ content: [
150
+ {
151
+ type: 'text',
152
+ text: 'Some text',
153
+ marks: [{ type: 'bold' }],
154
+ },
155
+ ],
156
+ },
157
+ ],
158
+ },
159
+ },
160
+ {
161
+ id: uniqid(),
162
+ x: 1100,
163
+ y: 100,
164
+ width: 600,
165
+ height: 200,
166
+ type: 'html',
167
+ sortOrder: 3,
168
+ scale: null,
169
+ rotate: null,
170
+ opacity: null,
171
+ html: {
172
+ type: 'doc',
173
+ content: [
174
+ {
175
+ type: 'paragraph',
176
+ attrs: {
177
+ fontSize: 128,
178
+ textTransform: 'uppercase',
179
+ },
180
+ content: [
181
+ {
182
+ type: 'text',
183
+ text: 'Another one',
184
+ marks: [{ type: 'bold' }],
185
+ },
186
+ ],
187
+ },
188
+ {
189
+ type: 'paragraph',
190
+ attrs: {
191
+ fontSize: 64,
192
+ textAlign: 'right',
193
+ },
194
+ content: [
195
+ {
196
+ type: 'text',
197
+ text: 'Second paragraph',
198
+ },
199
+ ],
200
+ },
201
+ ],
202
+ },
203
+ },
204
+ ],
205
+ },
206
+ ];
207
+ const buildParagraphContent = ({ text, fontSize = 40, textAlign, }) => ({
208
+ type: 'paragraph',
209
+ attrs: {
210
+ ...(fontSize && { fontSize }),
211
+ ...(textAlign && { textAlign }),
212
+ },
213
+ content: [{ type: 'text', text }],
214
+ });
215
+ const buildBulletListContent = ({ bullets }) => ({
216
+ type: 'bulletList',
217
+ content: bullets.map((bullet) => ({
218
+ type: 'listItem',
219
+ attrs: {
220
+ fontSize: 40,
221
+ },
222
+ content: [buildParagraphContent({ text: bullet })],
223
+ })),
224
+ });
225
+ const buildHeadlineLayer = ({ sortOrder, text, isTitle, withSubheadline, }) => ({
226
+ id: uniqid(),
227
+ x: 200,
228
+ y: isTitle ? (withSubheadline ? 300 : 450) : 50,
229
+ width: 1520,
230
+ height: 200,
231
+ type: 'html',
232
+ sortOrder,
233
+ scale: null,
234
+ rotate: null,
235
+ opacity: null,
236
+ html: {
237
+ type: 'doc',
238
+ content: [
239
+ {
240
+ type: 'paragraph',
241
+ attrs: {
242
+ fontSize: isTitle ? 120 : 74.6666666667,
243
+ textAlign: 'center',
244
+ },
245
+ content: [{ type: 'text', text, marks: [{ type: 'bold' }] }],
246
+ },
247
+ ],
248
+ },
249
+ });
250
+ const buildSubheadlineLayer = ({ sortOrder, text, }) => ({
251
+ id: uniqid(),
252
+ x: 400,
253
+ y: 500,
254
+ width: 1120,
255
+ height: 200,
256
+ type: 'html',
257
+ sortOrder,
258
+ scale: null,
259
+ rotate: null,
260
+ opacity: null,
261
+ html: {
262
+ type: 'doc',
263
+ content: [buildParagraphContent({ text, fontSize: 80, textAlign: 'center' })],
264
+ },
265
+ });
266
+ const buildHtmlLayerParagraphFields = ({ text }) => ({
267
+ html: {
268
+ type: 'doc',
269
+ content: [buildParagraphContent({ text })],
270
+ },
271
+ });
272
+ const buildHtmlLayerBulletsFields = ({ bullets }) => ({
273
+ html: {
274
+ type: 'doc',
275
+ content: [buildBulletListContent({ bullets })],
276
+ },
277
+ });
278
+ const buildImageLayerFields = (image) => ({
279
+ image,
280
+ });
281
+ const buildColumnLayer = ({ sortOrder, slide, isRight, }) => {
282
+ const type = slide[isRight ? 'right_type' : 'left_type'];
283
+ return {
284
+ id: uniqid(),
285
+ x: isRight ? 1020 : 100,
286
+ y: 220,
287
+ width: 800,
288
+ height: 800,
289
+ type: type === 'image' ? 'image' : 'html',
290
+ sortOrder,
291
+ scale: null,
292
+ rotate: null,
293
+ opacity: null,
294
+ ...(type === 'image'
295
+ ? buildImageLayerFields(slide[isRight ? 'right_image' : 'left_image'])
296
+ : type === 'bullets'
297
+ ? buildHtmlLayerBulletsFields({
298
+ bullets: slide[isRight ? 'right_bullets' : 'left_bullets'],
299
+ })
300
+ : buildHtmlLayerParagraphFields({ text: slide[isRight ? 'right_text' : 'left_text'] })),
301
+ };
302
+ };
303
+ let slideSortOrder = 1;
304
+ export const cognitionSlideToJson = (slide) => {
305
+ let sortOrder = 1;
306
+ const layers = [];
307
+ if (slide.type === 'title') {
308
+ layers.push(buildHeadlineLayer({
309
+ sortOrder: sortOrder++,
310
+ text: slide.headline,
311
+ isTitle: true,
312
+ withSubheadline: !!slide.subheadline,
313
+ }));
314
+ if (slide.subheadline) {
315
+ layers.push(buildSubheadlineLayer({ sortOrder: sortOrder++, text: slide.subheadline }));
316
+ }
317
+ }
318
+ else if (slide.type === 'columns') {
319
+ layers.push(buildHeadlineLayer({ sortOrder: sortOrder++, text: slide.headline }));
320
+ layers.push(buildColumnLayer({ sortOrder: sortOrder++, slide }));
321
+ layers.push(buildColumnLayer({ sortOrder: sortOrder++, slide, isRight: true }));
322
+ }
323
+ else if (slide.type === 'bullets') {
324
+ layers.push(buildHeadlineLayer({ sortOrder: sortOrder++, text: slide.headline }));
325
+ layers.push({
326
+ id: uniqid(),
327
+ x: 560,
328
+ y: 220,
329
+ width: 800,
330
+ height: 800,
331
+ type: 'html',
332
+ sortOrder: sortOrder++,
333
+ scale: null,
334
+ rotate: null,
335
+ opacity: null,
336
+ html: {
337
+ type: 'doc',
338
+ content: [buildBulletListContent({ bullets: slide.bullets })],
339
+ },
340
+ });
341
+ }
342
+ return {
343
+ id: uniqid(),
344
+ sortOrder: slideSortOrder++,
345
+ backgroundColor: '#5ce1e6',
346
+ layers,
347
+ };
348
+ };
@@ -0,0 +1,94 @@
1
+ <script lang="ts" module>
2
+ import type { WithElementRef } from 'bits-ui';
3
+ import type { HTMLAnchorAttributes, HTMLButtonAttributes } from 'svelte/elements';
4
+ import { type VariantProps, tv } from 'tailwind-variants';
5
+
6
+ export const buttonVariants = tv({
7
+ base: 'inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',
8
+ // ring-offset-background focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2
9
+ variants: {
10
+ variant: {
11
+ default: 'bg-primary text-primary-foreground hover:bg-primary/90',
12
+ destructive: 'bg-destructive text-destructive-foreground hover:bg-destructive/90',
13
+ outline: 'border-input bg-background hover:bg-accent hover:text-accent-foreground border',
14
+ secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80',
15
+ ghost: 'hover:bg-accent hover:text-accent-foreground',
16
+ link: 'text-primary underline-offset-4 hover:underline',
17
+ },
18
+ size: {
19
+ default: 'h-10 px-4 py-2',
20
+ xs: 'h-8 rounded-md px-2',
21
+ sm: 'h-9 rounded-md px-3',
22
+ lg: 'h-11 rounded-md px-8',
23
+ icon: 'h-10 w-10',
24
+ 'icon-xs': 'h-8 w-8',
25
+ },
26
+ active: {
27
+ true: '',
28
+ },
29
+ },
30
+ compoundVariants: [
31
+ {
32
+ active: true,
33
+ variant: 'outline',
34
+ class: 'border-2 border-primary',
35
+ },
36
+ {
37
+ active: true,
38
+ variant: 'ghost',
39
+ class: 'bg-primary/15 text-accent-foreground hover:bg-primary/15',
40
+ },
41
+ ],
42
+ defaultVariants: {
43
+ variant: 'default',
44
+ size: 'default',
45
+ },
46
+ });
47
+
48
+ export type ButtonVariant = VariantProps<typeof buttonVariants>['variant'];
49
+ export type ButtonSize = VariantProps<typeof buttonVariants>['size'];
50
+ export type ButtonActive = VariantProps<typeof buttonVariants>['active'];
51
+
52
+ export type ButtonProps = WithElementRef<HTMLButtonAttributes> &
53
+ WithElementRef<HTMLAnchorAttributes> & {
54
+ variant?: ButtonVariant;
55
+ size?: ButtonSize;
56
+ active?: ButtonActive;
57
+ };
58
+ </script>
59
+
60
+ <script lang="ts">
61
+ import { cn } from '../../../utils.js';
62
+
63
+ let {
64
+ class: className,
65
+ variant = 'default',
66
+ size = 'default',
67
+ active = false,
68
+ ref = $bindable(null),
69
+ href = undefined,
70
+ type = 'button',
71
+ children,
72
+ ...restProps
73
+ }: ButtonProps = $props();
74
+ </script>
75
+
76
+ {#if href}
77
+ <a
78
+ bind:this={ref}
79
+ class={cn(buttonVariants({ variant, size, active }), className)}
80
+ {href}
81
+ {...restProps}
82
+ >
83
+ {@render children?.()}
84
+ </a>
85
+ {:else}
86
+ <button
87
+ bind:this={ref}
88
+ class={cn(buttonVariants({ variant, size, active }), className)}
89
+ {type}
90
+ {...restProps}
91
+ >
92
+ {@render children?.()}
93
+ </button>
94
+ {/if}