@kritzel/engine 0.4.31

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 (373) hide show
  1. package/LICENSE.md +50 -0
  2. package/dist/cjs/app-globals-V2Kpy_OQ.js +5 -0
  3. package/dist/cjs/engine.constants-CakmdKMW.js +28206 -0
  4. package/dist/cjs/index-BbbWU2aN.js +1742 -0
  5. package/dist/cjs/index.cjs.js +4232 -0
  6. package/dist/cjs/kritzel-awareness-cursors_5.cjs.entry.js +28004 -0
  7. package/dist/cjs/loader.cjs.js +13 -0
  8. package/dist/cjs/stencil.cjs.js +25 -0
  9. package/dist/collection/classes/core/core.class.js +1389 -0
  10. package/dist/collection/classes/core/reviver.class.js +124 -0
  11. package/dist/collection/classes/core/store.class.js +337 -0
  12. package/dist/collection/classes/core/viewport.class.js +794 -0
  13. package/dist/collection/classes/core/workspace.class.js +112 -0
  14. package/dist/collection/classes/handlers/base.handler.js +20 -0
  15. package/dist/collection/classes/handlers/context-menu.handler.js +170 -0
  16. package/dist/collection/classes/handlers/hover.handler.js +35 -0
  17. package/dist/collection/classes/handlers/key.handler.js +162 -0
  18. package/dist/collection/classes/handlers/line-handle.handler.js +475 -0
  19. package/dist/collection/classes/handlers/move.handler.js +295 -0
  20. package/dist/collection/classes/handlers/resize.handler.js +327 -0
  21. package/dist/collection/classes/handlers/rotation.handler.js +174 -0
  22. package/dist/collection/classes/handlers/selection.handler.js +526 -0
  23. package/dist/collection/classes/managers/anchor.manager.js +1476 -0
  24. package/dist/collection/classes/managers/browser-permission.manager.js +64 -0
  25. package/dist/collection/classes/managers/clipboard.manager.js +346 -0
  26. package/dist/collection/classes/managers/clipboard.types.js +1 -0
  27. package/dist/collection/classes/managers/cursor.manager.js +139 -0
  28. package/dist/collection/classes/managers/license.manager.js +341 -0
  29. package/dist/collection/classes/managers/localization.manager.js +227 -0
  30. package/dist/collection/classes/managers/theme.manager.js +206 -0
  31. package/dist/collection/classes/objects/base-object.class.js +462 -0
  32. package/dist/collection/classes/objects/dynamic-object.class.js +437 -0
  33. package/dist/collection/classes/objects/group.class.js +590 -0
  34. package/dist/collection/classes/objects/image.class.js +500 -0
  35. package/dist/collection/classes/objects/line.class.js +789 -0
  36. package/dist/collection/classes/objects/path.class.js +578 -0
  37. package/dist/collection/classes/objects/selection-box.class.js +32 -0
  38. package/dist/collection/classes/objects/selection-group.class.js +752 -0
  39. package/dist/collection/classes/objects/shape.class.js +628 -0
  40. package/dist/collection/classes/objects/text.class.js +461 -0
  41. package/dist/collection/classes/providers/assets/asset-resolver.class.js +536 -0
  42. package/dist/collection/classes/providers/assets/http-asset-provider.class.js +111 -0
  43. package/dist/collection/classes/providers/assets/indexeddb-asset-provider.class.js +241 -0
  44. package/dist/collection/classes/providers/assets/presigned-asset-provider.class.js +86 -0
  45. package/dist/collection/classes/providers/paste-intent/event-paste-intent.provider.js +48 -0
  46. package/dist/collection/classes/providers/paste-intent/ios-paste-intent.provider.js +16 -0
  47. package/dist/collection/classes/providers/paste-intent/navigator-paste-intent.provider.js +86 -0
  48. package/dist/collection/classes/providers/sync/broadcast-sync-provider.class.js +100 -0
  49. package/dist/collection/classes/providers/sync/hocuspocus-sync-provider.class.js +333 -0
  50. package/dist/collection/classes/providers/sync/in-memory-sync-provider.class.js +69 -0
  51. package/dist/collection/classes/providers/sync/indexeddb-sync-provider.class.js +39 -0
  52. package/dist/collection/classes/providers/sync/websocket-sync-provider.class.js +110 -0
  53. package/dist/collection/classes/registries/dynamic-object-renderer.registry.js +52 -0
  54. package/dist/collection/classes/registries/font-registry.class.js +161 -0
  55. package/dist/collection/classes/registries/icon-registry.class.js +118 -0
  56. package/dist/collection/classes/registries/paste-intent-provider.registry.js +26 -0
  57. package/dist/collection/classes/registries/tool.registry.js +69 -0
  58. package/dist/collection/classes/structures/app-state-map.structure.js +461 -0
  59. package/dist/collection/classes/structures/object-map.structure.js +1103 -0
  60. package/dist/collection/classes/structures/quadtree.structure.js +251 -0
  61. package/dist/collection/classes/tools/base-tool.class.js +88 -0
  62. package/dist/collection/classes/tools/brush-tool.class.js +236 -0
  63. package/dist/collection/classes/tools/eraser-tool.class.js +133 -0
  64. package/dist/collection/classes/tools/image-tool.class.js +152 -0
  65. package/dist/collection/classes/tools/line-tool.class.js +249 -0
  66. package/dist/collection/classes/tools/selection-tool.class.js +611 -0
  67. package/dist/collection/classes/tools/shape-tool.class.js +251 -0
  68. package/dist/collection/classes/tools/text-tool.class.js +179 -0
  69. package/dist/collection/collection-manifest.json +17 -0
  70. package/dist/collection/components/kritzel-awareness-cursors/kritzel-awareness-cursors.css +115 -0
  71. package/dist/collection/components/kritzel-awareness-cursors/kritzel-awareness-cursors.js +380 -0
  72. package/dist/collection/components/kritzel-cursor-trail/kritzel-cursor-trail.css +10 -0
  73. package/dist/collection/components/kritzel-cursor-trail/kritzel-cursor-trail.js +153 -0
  74. package/dist/collection/components/kritzel-engine/kritzel-engine.css +81 -0
  75. package/dist/collection/components/kritzel-engine/kritzel-engine.js +6345 -0
  76. package/dist/collection/components/kritzel-icon/kritzel-icon.css +18 -0
  77. package/dist/collection/components/kritzel-icon/kritzel-icon.js +93 -0
  78. package/dist/collection/components/kritzel-watermark/kritzel-watermark.css +29 -0
  79. package/dist/collection/components/kritzel-watermark/kritzel-watermark.js +83 -0
  80. package/dist/collection/configs/default-asset-storage.config.js +9 -0
  81. package/dist/collection/configs/default-brush-tool.config.js +9 -0
  82. package/dist/collection/configs/default-engine-config.js +73 -0
  83. package/dist/collection/configs/default-line-tool.config.js +12 -0
  84. package/dist/collection/configs/default-shape-tool.config.js +15 -0
  85. package/dist/collection/configs/default-sync.config.js +6 -0
  86. package/dist/collection/configs/default-text-tool.config.js +12 -0
  87. package/dist/collection/constants/color-palette.constants.js +40 -0
  88. package/dist/collection/constants/core.constants.js +1 -0
  89. package/dist/collection/constants/engine.constants.js +4 -0
  90. package/dist/collection/constants/license.constants.js +25 -0
  91. package/dist/collection/constants/schema.constants.js +4 -0
  92. package/dist/collection/constants/storage.constants.js +1 -0
  93. package/dist/collection/constants/stroke-size.constants.js +2 -0
  94. package/dist/collection/constants/text-tool-fonts.constants.js +18 -0
  95. package/dist/collection/constants/version.js +6 -0
  96. package/dist/collection/enums/alignment.enum.js +9 -0
  97. package/dist/collection/enums/event-button.enum.js +6 -0
  98. package/dist/collection/enums/handle-type.enum.js +7 -0
  99. package/dist/collection/enums/shape-type.enum.js +6 -0
  100. package/dist/collection/events/active-workspace-change.event.js +1 -0
  101. package/dist/collection/events/editor-is-ready.event.js +1 -0
  102. package/dist/collection/events/login.event.js +1 -0
  103. package/dist/collection/helpers/alignment.helper.js +73 -0
  104. package/dist/collection/helpers/class.helper.js +5 -0
  105. package/dist/collection/helpers/color.helper.js +106 -0
  106. package/dist/collection/helpers/cursor.helper.js +57 -0
  107. package/dist/collection/helpers/devices.helper.js +28 -0
  108. package/dist/collection/helpers/event.helper.js +58 -0
  109. package/dist/collection/helpers/geometry.helper.js +149 -0
  110. package/dist/collection/helpers/html.helper.js +116 -0
  111. package/dist/collection/helpers/image-file.helper.js +6 -0
  112. package/dist/collection/helpers/keyboard.helper.js +55 -0
  113. package/dist/collection/helpers/localization.helper.js +25 -0
  114. package/dist/collection/helpers/math.helper.js +8 -0
  115. package/dist/collection/helpers/migration.helper.js +45 -0
  116. package/dist/collection/helpers/object.helper.js +29 -0
  117. package/dist/collection/helpers/svg-export.helper.js +655 -0
  118. package/dist/collection/helpers/theme.helper.js +77 -0
  119. package/dist/collection/helpers/tool-config.helper.js +63 -0
  120. package/dist/collection/helpers/wheel.helper.js +113 -0
  121. package/dist/collection/index.js +107 -0
  122. package/dist/collection/interfaces/anchor.interface.js +1 -0
  123. package/dist/collection/interfaces/arrow-head.interface.js +1 -0
  124. package/dist/collection/interfaces/asset-provider.interface.js +1 -0
  125. package/dist/collection/interfaces/asset-storage-config.interface.js +1 -0
  126. package/dist/collection/interfaces/asset.interface.js +1 -0
  127. package/dist/collection/interfaces/bounding-box.interface.js +1 -0
  128. package/dist/collection/interfaces/clonable.interface.js +1 -0
  129. package/dist/collection/interfaces/context-menu-item.interface.js +1 -0
  130. package/dist/collection/interfaces/context-menu-state.interface.js +1 -0
  131. package/dist/collection/interfaces/debug-info.interface.js +1 -0
  132. package/dist/collection/interfaces/dialog.interface.js +1 -0
  133. package/dist/collection/interfaces/document-metadata.interface.js +1 -0
  134. package/dist/collection/interfaces/dynamic-object-renderer.interface.js +1 -0
  135. package/dist/collection/interfaces/engine-state.interface.js +1 -0
  136. package/dist/collection/interfaces/font.interface.js +1 -0
  137. package/dist/collection/interfaces/localization.interface.js +1 -0
  138. package/dist/collection/interfaces/login-config.interface.js +1 -0
  139. package/dist/collection/interfaces/master-detail.interface.js +1 -0
  140. package/dist/collection/interfaces/menu-item.interface.js +1 -0
  141. package/dist/collection/interfaces/migration.interface.js +1 -0
  142. package/dist/collection/interfaces/notification.interface.js +1 -0
  143. package/dist/collection/interfaces/object-change-event.interface.js +1 -0
  144. package/dist/collection/interfaces/object-export.interface.js +1 -0
  145. package/dist/collection/interfaces/object.interface.js +1 -0
  146. package/dist/collection/interfaces/paste-intent-provider.interface.js +1 -0
  147. package/dist/collection/interfaces/point.interface.js +1 -0
  148. package/dist/collection/interfaces/polygon.interface.js +1 -0
  149. package/dist/collection/interfaces/remote-cursor.interface.js +1 -0
  150. package/dist/collection/interfaces/selection-state.interface.js +1 -0
  151. package/dist/collection/interfaces/serializable.interface.js +1 -0
  152. package/dist/collection/interfaces/settings.interface.js +1 -0
  153. package/dist/collection/interfaces/share.interface.js +1 -0
  154. package/dist/collection/interfaces/shortcut.interface.js +1 -0
  155. package/dist/collection/interfaces/sync-config.interface.js +21 -0
  156. package/dist/collection/interfaces/sync-provider.interface.js +1 -0
  157. package/dist/collection/interfaces/theme.interface.js +1 -0
  158. package/dist/collection/interfaces/tool-config.interface.js +1 -0
  159. package/dist/collection/interfaces/tool-type.interface.js +1 -0
  160. package/dist/collection/interfaces/tool.interface.js +1 -0
  161. package/dist/collection/interfaces/toolbar-item.interface.js +1 -0
  162. package/dist/collection/interfaces/undo-state.interface.js +1 -0
  163. package/dist/collection/interfaces/user.interface.js +1 -0
  164. package/dist/collection/interfaces/viewport-state.interface.js +1 -0
  165. package/dist/collection/locales/de-locale.js +119 -0
  166. package/dist/collection/locales/en-locale.js +120 -0
  167. package/dist/collection/locales/fr-locale.js +119 -0
  168. package/dist/collection/migrations/app-state.migrations.js +47 -0
  169. package/dist/collection/migrations/workspace.migrations.js +67 -0
  170. package/dist/collection/themes/dark-theme.js +340 -0
  171. package/dist/collection/themes/light-theme.js +346 -0
  172. package/dist/collection/types/deep-readonly.type.js +1 -0
  173. package/dist/collection/types/state.types.js +1 -0
  174. package/dist/components/index.d.ts +47 -0
  175. package/dist/components/index.js +4143 -0
  176. package/dist/components/kritzel-awareness-cursors.d.ts +11 -0
  177. package/dist/components/kritzel-awareness-cursors.js +6 -0
  178. package/dist/components/kritzel-cursor-trail.d.ts +11 -0
  179. package/dist/components/kritzel-cursor-trail.js +6 -0
  180. package/dist/components/kritzel-engine.d.ts +11 -0
  181. package/dist/components/kritzel-engine.js +52641 -0
  182. package/dist/components/kritzel-icon.d.ts +11 -0
  183. package/dist/components/kritzel-icon.js +6 -0
  184. package/dist/components/kritzel-watermark.d.ts +11 -0
  185. package/dist/components/kritzel-watermark.js +6 -0
  186. package/dist/components/p-B2Htv9ou.js +49 -0
  187. package/dist/components/p-BvRGQvVI.js +3456 -0
  188. package/dist/components/p-CfSx6HU_.js +1469 -0
  189. package/dist/components/p-YP8wAcF4.js +122 -0
  190. package/dist/components/p-fx6msYHJ.js +167 -0
  191. package/dist/esm/app-globals-DQuL1Twl.js +3 -0
  192. package/dist/esm/engine.constants-Bl5-pbq-.js +28143 -0
  193. package/dist/esm/index-BU9Mv7y0.js +1715 -0
  194. package/dist/esm/index.js +4134 -0
  195. package/dist/esm/kritzel-awareness-cursors_5.entry.js +27978 -0
  196. package/dist/esm/loader.js +11 -0
  197. package/dist/esm/stencil.js +21 -0
  198. package/dist/index.cjs.js +1 -0
  199. package/dist/index.js +1 -0
  200. package/dist/stencil/index.esm.js +4134 -0
  201. package/dist/stencil/p-BU9Mv7y0.js +1702 -0
  202. package/dist/stencil/p-Bl5-pbq-.js +28143 -0
  203. package/dist/stencil/p-DQuL1Twl.js +3 -0
  204. package/dist/stencil/p-f0a8b7af.entry.js +27978 -0
  205. package/dist/stencil/stencil.esm.js +21 -0
  206. package/dist/types/classes/core/core.class.d.ts +532 -0
  207. package/dist/types/classes/core/reviver.class.d.ts +32 -0
  208. package/dist/types/classes/core/store.class.d.ts +198 -0
  209. package/dist/types/classes/core/viewport.class.d.ts +256 -0
  210. package/dist/types/classes/core/workspace.class.d.ts +95 -0
  211. package/dist/types/classes/handlers/base.handler.d.ts +18 -0
  212. package/dist/types/classes/handlers/context-menu.handler.d.ts +67 -0
  213. package/dist/types/classes/handlers/hover.handler.d.ts +23 -0
  214. package/dist/types/classes/handlers/key.handler.d.ts +44 -0
  215. package/dist/types/classes/handlers/line-handle.handler.d.ts +115 -0
  216. package/dist/types/classes/handlers/move.handler.d.ts +94 -0
  217. package/dist/types/classes/handlers/resize.handler.d.ts +95 -0
  218. package/dist/types/classes/handlers/rotation.handler.d.ts +50 -0
  219. package/dist/types/classes/handlers/selection.handler.d.ts +153 -0
  220. package/dist/types/classes/managers/anchor.manager.d.ts +513 -0
  221. package/dist/types/classes/managers/browser-permission.manager.d.ts +41 -0
  222. package/dist/types/classes/managers/clipboard.manager.d.ts +71 -0
  223. package/dist/types/classes/managers/clipboard.types.d.ts +23 -0
  224. package/dist/types/classes/managers/cursor.manager.d.ts +66 -0
  225. package/dist/types/classes/managers/license.manager.d.ts +147 -0
  226. package/dist/types/classes/managers/localization.manager.d.ts +145 -0
  227. package/dist/types/classes/managers/theme.manager.d.ts +112 -0
  228. package/dist/types/classes/objects/base-object.class.d.ts +266 -0
  229. package/dist/types/classes/objects/dynamic-object.class.d.ts +148 -0
  230. package/dist/types/classes/objects/group.class.d.ts +231 -0
  231. package/dist/types/classes/objects/image.class.d.ts +246 -0
  232. package/dist/types/classes/objects/line.class.d.ts +285 -0
  233. package/dist/types/classes/objects/path.class.d.ts +220 -0
  234. package/dist/types/classes/objects/selection-box.class.d.ts +19 -0
  235. package/dist/types/classes/objects/selection-group.class.d.ts +267 -0
  236. package/dist/types/classes/objects/shape.class.d.ts +322 -0
  237. package/dist/types/classes/objects/text.class.d.ts +197 -0
  238. package/dist/types/classes/providers/assets/asset-resolver.class.d.ts +141 -0
  239. package/dist/types/classes/providers/assets/http-asset-provider.class.d.ts +79 -0
  240. package/dist/types/classes/providers/assets/indexeddb-asset-provider.class.d.ts +69 -0
  241. package/dist/types/classes/providers/assets/presigned-asset-provider.class.d.ts +69 -0
  242. package/dist/types/classes/providers/paste-intent/event-paste-intent.provider.d.ts +8 -0
  243. package/dist/types/classes/providers/paste-intent/ios-paste-intent.provider.d.ts +6 -0
  244. package/dist/types/classes/providers/paste-intent/navigator-paste-intent.provider.d.ts +9 -0
  245. package/dist/types/classes/providers/sync/broadcast-sync-provider.class.d.ts +23 -0
  246. package/dist/types/classes/providers/sync/hocuspocus-sync-provider.class.d.ts +163 -0
  247. package/dist/types/classes/providers/sync/in-memory-sync-provider.class.d.ts +39 -0
  248. package/dist/types/classes/providers/sync/indexeddb-sync-provider.class.d.ts +25 -0
  249. package/dist/types/classes/providers/sync/websocket-sync-provider.class.d.ts +63 -0
  250. package/dist/types/classes/registries/dynamic-object-renderer.registry.d.ts +32 -0
  251. package/dist/types/classes/registries/font-registry.class.d.ts +19 -0
  252. package/dist/types/classes/registries/icon-registry.class.d.ts +39 -0
  253. package/dist/types/classes/registries/paste-intent-provider.registry.d.ts +10 -0
  254. package/dist/types/classes/registries/tool.registry.d.ts +53 -0
  255. package/dist/types/classes/structures/app-state-map.structure.d.ts +171 -0
  256. package/dist/types/classes/structures/object-map.structure.d.ts +403 -0
  257. package/dist/types/classes/structures/quadtree.structure.d.ts +128 -0
  258. package/dist/types/classes/tools/base-tool.class.d.ts +72 -0
  259. package/dist/types/classes/tools/brush-tool.class.d.ts +68 -0
  260. package/dist/types/classes/tools/eraser-tool.class.d.ts +38 -0
  261. package/dist/types/classes/tools/image-tool.class.d.ts +74 -0
  262. package/dist/types/classes/tools/line-tool.class.d.ts +63 -0
  263. package/dist/types/classes/tools/selection-tool.class.d.ts +188 -0
  264. package/dist/types/classes/tools/shape-tool.class.d.ts +90 -0
  265. package/dist/types/classes/tools/text-tool.class.d.ts +66 -0
  266. package/dist/types/components/kritzel-awareness-cursors/kritzel-awareness-cursors.d.ts +29 -0
  267. package/dist/types/components/kritzel-cursor-trail/kritzel-cursor-trail.d.ts +19 -0
  268. package/dist/types/components/kritzel-engine/kritzel-engine.d.ts +695 -0
  269. package/dist/types/components/kritzel-icon/kritzel-icon.d.ts +6 -0
  270. package/dist/types/components/kritzel-watermark/kritzel-watermark.d.ts +20 -0
  271. package/dist/types/components.d.ts +981 -0
  272. package/dist/types/configs/default-asset-storage.config.d.ts +8 -0
  273. package/dist/types/configs/default-brush-tool.config.d.ts +2 -0
  274. package/dist/types/configs/default-engine-config.d.ts +2 -0
  275. package/dist/types/configs/default-line-tool.config.d.ts +2 -0
  276. package/dist/types/configs/default-shape-tool.config.d.ts +2 -0
  277. package/dist/types/configs/default-sync.config.d.ts +5 -0
  278. package/dist/types/configs/default-text-tool.config.d.ts +2 -0
  279. package/dist/types/constants/color-palette.constants.d.ts +31 -0
  280. package/dist/types/constants/core.constants.d.ts +0 -0
  281. package/dist/types/constants/engine.constants.d.ts +4 -0
  282. package/dist/types/constants/license.constants.d.ts +25 -0
  283. package/dist/types/constants/schema.constants.d.ts +4 -0
  284. package/dist/types/constants/storage.constants.d.ts +1 -0
  285. package/dist/types/constants/stroke-size.constants.d.ts +2 -0
  286. package/dist/types/constants/text-tool-fonts.constants.d.ts +3 -0
  287. package/dist/types/constants/version.d.ts +6 -0
  288. package/dist/types/enums/alignment.enum.d.ts +8 -0
  289. package/dist/types/enums/event-button.enum.d.ts +5 -0
  290. package/dist/types/enums/handle-type.enum.d.ts +6 -0
  291. package/dist/types/enums/shape-type.enum.d.ts +5 -0
  292. package/dist/types/events/active-workspace-change.event.d.ts +7 -0
  293. package/dist/types/events/editor-is-ready.event.d.ts +18 -0
  294. package/dist/types/events/login.event.d.ts +3 -0
  295. package/dist/types/helpers/alignment.helper.d.ts +21 -0
  296. package/dist/types/helpers/class.helper.d.ts +3 -0
  297. package/dist/types/helpers/color.helper.d.ts +34 -0
  298. package/dist/types/helpers/cursor.helper.d.ts +22 -0
  299. package/dist/types/helpers/devices.helper.d.ts +8 -0
  300. package/dist/types/helpers/event.helper.d.ts +6 -0
  301. package/dist/types/helpers/geometry.helper.d.ts +38 -0
  302. package/dist/types/helpers/html.helper.d.ts +8 -0
  303. package/dist/types/helpers/image-file.helper.d.ts +3 -0
  304. package/dist/types/helpers/keyboard.helper.d.ts +6 -0
  305. package/dist/types/helpers/localization.helper.d.ts +18 -0
  306. package/dist/types/helpers/math.helper.d.ts +4 -0
  307. package/dist/types/helpers/migration.helper.d.ts +30 -0
  308. package/dist/types/helpers/object.helper.d.ts +9 -0
  309. package/dist/types/helpers/svg-export.helper.d.ts +231 -0
  310. package/dist/types/helpers/theme.helper.d.ts +42 -0
  311. package/dist/types/helpers/tool-config.helper.d.ts +4 -0
  312. package/dist/types/helpers/wheel.helper.d.ts +9 -0
  313. package/dist/types/index.d.ts +109 -0
  314. package/dist/types/interfaces/anchor.interface.d.ts +147 -0
  315. package/dist/types/interfaces/arrow-head.interface.d.ts +27 -0
  316. package/dist/types/interfaces/asset-provider.interface.d.ts +88 -0
  317. package/dist/types/interfaces/asset-storage-config.interface.d.ts +40 -0
  318. package/dist/types/interfaces/asset.interface.d.ts +43 -0
  319. package/dist/types/interfaces/bounding-box.interface.d.ts +8 -0
  320. package/dist/types/interfaces/clonable.interface.d.ts +3 -0
  321. package/dist/types/interfaces/context-menu-item.interface.d.ts +25 -0
  322. package/dist/types/interfaces/context-menu-state.interface.d.ts +16 -0
  323. package/dist/types/interfaces/debug-info.interface.d.ts +7 -0
  324. package/dist/types/interfaces/dialog.interface.d.ts +4 -0
  325. package/dist/types/interfaces/document-metadata.interface.d.ts +6 -0
  326. package/dist/types/interfaces/dynamic-object-renderer.interface.d.ts +40 -0
  327. package/dist/types/interfaces/engine-state.interface.d.ts +82 -0
  328. package/dist/types/interfaces/font.interface.d.ts +15 -0
  329. package/dist/types/interfaces/localization.interface.d.ts +143 -0
  330. package/dist/types/interfaces/login-config.interface.d.ts +24 -0
  331. package/dist/types/interfaces/master-detail.interface.d.ts +14 -0
  332. package/dist/types/interfaces/menu-item.interface.d.ts +27 -0
  333. package/dist/types/interfaces/migration.interface.d.ts +16 -0
  334. package/dist/types/interfaces/notification.interface.d.ts +10 -0
  335. package/dist/types/interfaces/object-change-event.interface.d.ts +31 -0
  336. package/dist/types/interfaces/object-export.interface.d.ts +20 -0
  337. package/dist/types/interfaces/object.interface.d.ts +53 -0
  338. package/dist/types/interfaces/paste-intent-provider.interface.d.ts +10 -0
  339. package/dist/types/interfaces/point.interface.d.ts +4 -0
  340. package/dist/types/interfaces/polygon.interface.d.ts +7 -0
  341. package/dist/types/interfaces/remote-cursor.interface.d.ts +18 -0
  342. package/dist/types/interfaces/selection-state.interface.d.ts +7 -0
  343. package/dist/types/interfaces/serializable.interface.d.ts +5 -0
  344. package/dist/types/interfaces/settings.interface.d.ts +25 -0
  345. package/dist/types/interfaces/share.interface.d.ts +9 -0
  346. package/dist/types/interfaces/shortcut.interface.d.ts +10 -0
  347. package/dist/types/interfaces/sync-config.interface.d.ts +41 -0
  348. package/dist/types/interfaces/sync-provider.interface.d.ts +66 -0
  349. package/dist/types/interfaces/theme.interface.d.ts +553 -0
  350. package/dist/types/interfaces/tool-config.interface.d.ts +24 -0
  351. package/dist/types/interfaces/tool-type.interface.d.ts +1 -0
  352. package/dist/types/interfaces/tool.interface.d.ts +8 -0
  353. package/dist/types/interfaces/toolbar-item.interface.d.ts +66 -0
  354. package/dist/types/interfaces/undo-state.interface.d.ts +6 -0
  355. package/dist/types/interfaces/user.interface.d.ts +22 -0
  356. package/dist/types/interfaces/viewport-state.interface.d.ts +7 -0
  357. package/dist/types/locales/de-locale.d.ts +5 -0
  358. package/dist/types/locales/en-locale.d.ts +6 -0
  359. package/dist/types/locales/fr-locale.d.ts +5 -0
  360. package/dist/types/migrations/app-state.migrations.d.ts +11 -0
  361. package/dist/types/migrations/workspace.migrations.d.ts +11 -0
  362. package/dist/types/stencil-public-runtime.d.ts +1873 -0
  363. package/dist/types/themes/dark-theme.d.ts +5 -0
  364. package/dist/types/themes/light-theme.d.ts +5 -0
  365. package/dist/types/types/deep-readonly.type.d.ts +7 -0
  366. package/dist/types/types/state.types.d.ts +3 -0
  367. package/loader/cdn.js +1 -0
  368. package/loader/index.cjs.js +1 -0
  369. package/loader/index.d.ts +24 -0
  370. package/loader/index.es2017.js +1 -0
  371. package/loader/index.js +2 -0
  372. package/package.json +101 -0
  373. package/readme.md +11 -0
@@ -0,0 +1,251 @@
1
+ import { KritzelShape } from "../objects/shape.class";
2
+ import { KritzelBaseTool } from "./base-tool.class";
3
+ import { KritzelEventHelper } from "../../helpers/event.helper";
4
+ import { ShapeType } from "../../enums/shape-type.enum";
5
+ import { DEFAULT_COLOR_PALETTE } from "../../constants/color-palette.constants";
6
+ import { DEFAULT_STROKE_SIZES } from "../../constants/stroke-size.constants";
7
+ /**
8
+ * Shape tool for drawing geometric shapes (rectangles, ellipses, etc.) on the canvas.
9
+ * Creates shapes by tracking a drag gesture to define the bounding box.
10
+ * Supports configurable shape type, fill color, stroke color, stroke width, opacity, and text properties.
11
+ * Automatically switches to selection tool after shape completion.
12
+ */
13
+ export class KritzelShapeTool extends KritzelBaseTool {
14
+ toolType = 'shape';
15
+ /** The type of shape to create (rectangle, ellipse, etc.) */
16
+ shapeType = ShapeType.Rectangle;
17
+ /** The fill color of the shape (supports theme-aware light/dark colors) */
18
+ fillColor = { light: 'transparent', dark: 'transparent' };
19
+ /** The stroke color of the shape border */
20
+ strokeColor = DEFAULT_COLOR_PALETTE[0];
21
+ /** The stroke width of the shape border in pixels */
22
+ strokeWidth = 4;
23
+ /** The opacity of the shape (0-1) */
24
+ opacity = 1;
25
+ /** The font family for text inside the shape */
26
+ fontFamily = 'Arial';
27
+ /** The font size for text inside the shape in pixels */
28
+ fontSize = 16;
29
+ /** The font color for text inside the shape */
30
+ fontColor = DEFAULT_COLOR_PALETTE[0];
31
+ /** Available color palette for the shape tool */
32
+ palette = [...DEFAULT_COLOR_PALETTE];
33
+ /** Available stroke size presets for the shape tool */
34
+ sizes = [...DEFAULT_STROKE_SIZES];
35
+ /** X coordinate where the shape drawing started */
36
+ startX = 0;
37
+ /** Y coordinate where the shape drawing started */
38
+ startY = 0;
39
+ /** Whether currently drawing a shape */
40
+ isDrawing = false;
41
+ /** Reference to the shape being drawn */
42
+ currentShape = null;
43
+ /**
44
+ * Creates a new instance of KritzelShapeTool.
45
+ * @param core - The KritzelCore instance that provides access to application state and functionality
46
+ */
47
+ constructor(core) {
48
+ super(core);
49
+ }
50
+ /**
51
+ * Handles pointer down events to start drawing a new shape or edit an existing one.
52
+ * If clicking on an existing shape, enters edit mode to modify its text content.
53
+ * Otherwise, begins drawing a new shape at the pointer position.
54
+ * @param event - The PointerEvent containing pointer position and input type information
55
+ */
56
+ handlePointerDown(event) {
57
+ if (event.cancelable) {
58
+ event.preventDefault();
59
+ }
60
+ if (event.pointerType === 'mouse') {
61
+ const path = event.composedPath().slice(1);
62
+ const objectElement = path.find(element => element.classList && element.classList.contains('object'));
63
+ const object = this._core.findObjectById(objectElement?.id);
64
+ const activeShape = this._core.store.activeShape;
65
+ if (activeShape === null && object instanceof KritzelShape) {
66
+ object.edit(event);
67
+ return;
68
+ }
69
+ if (activeShape !== null && object instanceof KritzelShape) {
70
+ activeShape.save();
71
+ object.edit(event);
72
+ return;
73
+ }
74
+ if (activeShape !== null && object instanceof KritzelShape === false) {
75
+ this._core.resetActiveShape();
76
+ this._core.store.setState('activeTool', this._core.toolRegistry.getTool('selection'));
77
+ return;
78
+ }
79
+ if (KritzelEventHelper.isLeftClick(event) === false) {
80
+ return;
81
+ }
82
+ this.startDrawing(event.clientX, event.clientY);
83
+ }
84
+ if (event.pointerType === 'touch' || event.pointerType === 'pen') {
85
+ const activePointers = Array.from(this._core.store.state.pointers.values());
86
+ const path = event.composedPath().slice(1);
87
+ const objectElement = path.find(element => element.classList && element.classList.contains('object'));
88
+ const object = this._core.findObjectById(objectElement?.id);
89
+ const activeShape = this._core.store.activeShape;
90
+ if (activeShape === null && object instanceof KritzelShape) {
91
+ object.edit(event);
92
+ return;
93
+ }
94
+ if (activeShape !== null && object instanceof KritzelShape) {
95
+ activeShape.save();
96
+ object.edit(event);
97
+ return;
98
+ }
99
+ if (activeShape !== null && object instanceof KritzelShape === false) {
100
+ this._core.resetActiveShape();
101
+ this._core.store.setState('activeTool', this._core.toolRegistry.getTool('selection'));
102
+ return;
103
+ }
104
+ if (activePointers.length > 1) {
105
+ return;
106
+ }
107
+ const clientX = Math.round(activePointers[0].clientX);
108
+ const clientY = Math.round(activePointers[0].clientY);
109
+ this.startDrawing(clientX, clientY);
110
+ }
111
+ }
112
+ /**
113
+ * Handles pointer move events to update the shape size while drawing.
114
+ * Updates the current shape's dimensions based on the distance from the start point.
115
+ * Only processes events when actively drawing a shape.
116
+ * @param event - The PointerEvent containing the current pointer position
117
+ */
118
+ handlePointerMove(event) {
119
+ if (event.cancelable) {
120
+ event.preventDefault();
121
+ }
122
+ if (!this.isDrawing || !this.currentShape) {
123
+ return;
124
+ }
125
+ if (event.pointerType === 'mouse') {
126
+ this.updateShapeSize(event.clientX, event.clientY);
127
+ }
128
+ if (event.pointerType === 'touch' || event.pointerType === 'pen') {
129
+ const activePointers = Array.from(this._core.store.state.pointers.values());
130
+ if (activePointers.length === 1) {
131
+ const clientX = Math.round(activePointers[0].clientX);
132
+ const clientY = Math.round(activePointers[0].clientY);
133
+ this.updateShapeSize(clientX, clientY);
134
+ }
135
+ }
136
+ }
137
+ /**
138
+ * Handles pointer up events to complete the shape drawing.
139
+ * Finalizes the shape if large enough, or removes it if too small (accidental click).
140
+ * Switches to selection tool with the shape selected after completion.
141
+ * @param event - The PointerEvent indicating the end of the drawing gesture
142
+ */
143
+ handlePointerUp(event) {
144
+ if (event.cancelable) {
145
+ event.preventDefault();
146
+ }
147
+ if (!this.isDrawing || !this.currentShape) {
148
+ return;
149
+ }
150
+ this.finishDrawing();
151
+ }
152
+ /**
153
+ * Initializes the shape drawing process at the given screen coordinates.
154
+ * Creates a new KritzelShape object with initial dimensions of 1x1 pixel.
155
+ * Follows the same coordinate pattern as LineTool/BrushTool for consistency.
156
+ * @param clientX - The X coordinate in screen/client space
157
+ * @param clientY - The Y coordinate in screen/client space
158
+ */
159
+ startDrawing(clientX, clientY) {
160
+ // Store screen coordinates (relative to host element)
161
+ const viewportScale = this._core.store.state.scale;
162
+ const lockScale = this._core.store.state.lockDrawingScale;
163
+ const divider = lockScale ? viewportScale : 1;
164
+ this.startX = (clientX - this._core.store.offsetX) / divider;
165
+ this.startY = (clientY - this._core.store.offsetY) / divider;
166
+ this.isDrawing = true;
167
+ // Create shape using screen coordinates, following Path/Line pattern
168
+ this.currentShape = KritzelShape.create(this._core, {
169
+ x: this.startX,
170
+ y: this.startY,
171
+ translateX: -this._core.store.state.translateX / divider,
172
+ translateY: -this._core.store.state.translateY / divider,
173
+ width: 1,
174
+ height: 1,
175
+ shapeType: this.shapeType,
176
+ fillColor: this.fillColor,
177
+ strokeColor: this.strokeColor,
178
+ strokeWidth: this.strokeWidth,
179
+ opacity: this.opacity,
180
+ fontSize: this.fontSize,
181
+ fontFamily: this.fontFamily,
182
+ scale: lockScale ? 1 : viewportScale,
183
+ });
184
+ this._core.store.objects.insert(this.currentShape);
185
+ this._core.store.objects?.setActiveDrawingObject(this.currentShape.id);
186
+ this._core.rerender();
187
+ }
188
+ /**
189
+ * Updates the shape's dimensions based on the current pointer position.
190
+ * Calculates the bounding box from start point to current point and updates
191
+ * the shape's position and size accordingly. Handles negative drag directions.
192
+ * @param clientX - The current X coordinate in screen/client space
193
+ * @param clientY - The current Y coordinate in screen/client space
194
+ */
195
+ updateShapeSize(clientX, clientY) {
196
+ if (!this.currentShape) {
197
+ return;
198
+ }
199
+ const viewportScale = this._core.store.state.scale;
200
+ const lockScale = this._core.store.state.lockDrawingScale;
201
+ const divider = lockScale ? viewportScale : 1;
202
+ const currentX = (clientX - this._core.store.offsetX) / divider;
203
+ const currentY = (clientY - this._core.store.offsetY) / divider;
204
+ // Calculate bounding box in screen coordinates
205
+ const minX = Math.min(this.startX, currentX);
206
+ const minY = Math.min(this.startY, currentY);
207
+ const width = Math.abs(currentX - this.startX);
208
+ const height = Math.abs(currentY - this.startY);
209
+ // Update shape with screen coordinates
210
+ this.currentShape.x = minX;
211
+ this.currentShape.y = minY;
212
+ this.currentShape.width = Math.max(1, width);
213
+ this.currentShape.height = Math.max(1, height);
214
+ // Recalculate world-space translateX/Y
215
+ // Reset translateX/Y to initial value before updateDimensions
216
+ this.currentShape.translateX = -this._core.store.state.translateX / divider;
217
+ this.currentShape.translateY = -this._core.store.state.translateY / divider;
218
+ this.currentShape.updateDimensions();
219
+ this._core.store.objects.update(this.currentShape);
220
+ }
221
+ /**
222
+ * Completes the shape drawing process.
223
+ * Removes shapes smaller than 10x10 pixels (accidental clicks).
224
+ * For valid shapes, assigns z-index, updates the store, emits change event,
225
+ * selects the shape, and switches to selection tool.
226
+ */
227
+ finishDrawing() {
228
+ if (!this.currentShape) {
229
+ return;
230
+ }
231
+ // Remove shape if it's too small (likely an accidental click)
232
+ // Compare in screen space
233
+ if (this.currentShape.width < 10 && this.currentShape.height < 10) {
234
+ const shapeId = this.currentShape.id;
235
+ this._core.store.objects.remove(o => o.id === shapeId);
236
+ }
237
+ else {
238
+ this.currentShape.zIndex = this._core.store.currentZIndex;
239
+ this._core.store.objects.update(this.currentShape);
240
+ this._core.engine.emitObjectsChange();
241
+ this._core.engine.emitObjectsAdded([this.currentShape]);
242
+ this._core.selectObjects([this.currentShape]);
243
+ this._core.store.setState('activeTool', this._core.toolRegistry.getTool('selection'));
244
+ }
245
+ this.isDrawing = false;
246
+ this._core.store.objects?.setActiveDrawingObject(null);
247
+ this.currentShape = null;
248
+ this._core.store.objects?.stopUndoCapturing();
249
+ this._core.rerender();
250
+ }
251
+ }
@@ -0,0 +1,179 @@
1
+ import { KritzelText } from "../objects/text.class";
2
+ import { KritzelBaseTool } from "./base-tool.class";
3
+ import { KritzelEventHelper } from "../../helpers/event.helper";
4
+ import { DEFAULT_COLOR_PALETTE } from "../../constants/color-palette.constants";
5
+ import { DEFAULT_FONT_SIZES } from "../../constants/stroke-size.constants";
6
+ /**
7
+ * Text tool for creating and editing text objects on the canvas.
8
+ * Clicking creates a new text object at the pointer position and enters edit mode.
9
+ * Clicking on an existing text object enters edit mode for that object.
10
+ * Supports configurable font family, size, color, and opacity.
11
+ */
12
+ export class KritzelTextTool extends KritzelBaseTool {
13
+ toolType = 'text';
14
+ /** Backing field for {@link fontFamily}. */
15
+ _fontFamily = 'Arial';
16
+ /** Backing field for {@link fontSize}. */
17
+ _fontSize = 16;
18
+ /** Backing field for {@link fontColor}. */
19
+ _fontColor = DEFAULT_COLOR_PALETTE[0];
20
+ /** Backing field for {@link opacity}. */
21
+ _opacity = 1;
22
+ /** The font family for new text objects. */
23
+ get fontFamily() {
24
+ return this._core?.store?.activeText?.fontFamily ?? this._fontFamily;
25
+ }
26
+ set fontFamily(value) {
27
+ this._fontFamily = value;
28
+ this.applyToActiveText({ fontFamily: value });
29
+ }
30
+ /** The font size for new text objects in pixels. */
31
+ get fontSize() {
32
+ return this._core?.store?.activeText?.fontSize ?? this._fontSize;
33
+ }
34
+ set fontSize(value) {
35
+ this._fontSize = value;
36
+ this.applyToActiveText({ fontSize: value });
37
+ }
38
+ /** The font color for new text objects (supports theme-aware light/dark colors). */
39
+ get fontColor() {
40
+ return this._core?.store?.activeText?.fontColor ?? this._fontColor;
41
+ }
42
+ set fontColor(value) {
43
+ this._fontColor = value;
44
+ this.applyToActiveText({ fontColor: value });
45
+ }
46
+ /** The opacity of new text objects (0-1). */
47
+ get opacity() {
48
+ return this._core?.store?.activeText?.opacity ?? this._opacity;
49
+ }
50
+ set opacity(value) {
51
+ this._opacity = value;
52
+ this.applyToActiveText({ opacity: value });
53
+ }
54
+ /** Available color palette for the text tool */
55
+ palette = [...DEFAULT_COLOR_PALETTE];
56
+ /** Available font size presets for the text tool */
57
+ sizes = [...DEFAULT_FONT_SIZES];
58
+ /** Optional custom font options supplied through tool config. */
59
+ availableFonts;
60
+ /**
61
+ * Creates a new instance of KritzelTextTool.
62
+ * @param core - The KritzelCore instance that provides access to application state and functionality
63
+ */
64
+ constructor(core) {
65
+ super(core);
66
+ }
67
+ /**
68
+ * Propagates a property change to the text object that is currently being edited, if any.
69
+ * Mirrors the selection tool pattern of pushing tool-config changes down to live objects,
70
+ * but scoped to the single text in edit mode rather than the current selection.
71
+ */
72
+ applyToActiveText(updatedProperties) {
73
+ const activeText = this._core?.store?.activeText;
74
+ if (!activeText)
75
+ return;
76
+ this._core.updateObject(activeText, updatedProperties);
77
+ this._core.rerender();
78
+ }
79
+ /**
80
+ * Handles pointer down events for text creation and editing.
81
+ * If clicking on an existing text object, enters edit mode for that object.
82
+ * If there's an active text being edited and clicking elsewhere, saves the active text
83
+ * and switches to selection tool. If clicking on empty space, creates a new text object
84
+ * at that position and enters edit mode.
85
+ * @param event - The PointerEvent containing pointer position and input type information
86
+ */
87
+ handlePointerDown(event) {
88
+ if (event.cancelable) {
89
+ event.preventDefault();
90
+ }
91
+ if (event.pointerType === 'mouse') {
92
+ const path = event.composedPath().slice(1);
93
+ const objectElement = path.find(element => element.classList && element.classList.contains('object'));
94
+ const object = objectElement?.id ? this._core.findObjectById(objectElement.id) : null;
95
+ const activeText = this._core.store.activeText;
96
+ if (activeText === null && object instanceof KritzelText) {
97
+ object.edit(event);
98
+ return;
99
+ }
100
+ if (activeText !== null && object instanceof KritzelText) {
101
+ activeText.save();
102
+ object.edit(event);
103
+ return;
104
+ }
105
+ if (activeText !== null && object instanceof KritzelText === false) {
106
+ this._core.resetActiveText();
107
+ this._core.store.setState('activeTool', this._core.toolRegistry.getTool('selection'));
108
+ return;
109
+ }
110
+ if (KritzelEventHelper.isLeftClick(event) === false) {
111
+ return;
112
+ }
113
+ const clientX = event.clientX - this._core.store.offsetX;
114
+ const clientY = event.clientY - this._core.store.offsetY;
115
+ const viewportScale = this._core.store.state.scale;
116
+ const lockScale = this._core.store.state.lockDrawingScale;
117
+ const text = KritzelText.create(this._core, this.fontSize, this.fontFamily, lockScale ? 1 : viewportScale);
118
+ text.fontColor = this.fontColor;
119
+ text.opacity = this.opacity;
120
+ text.translateX = (clientX - this._core.store.state.translateX) / viewportScale;
121
+ text.translateY = (clientY - this._core.store.state.translateY) / viewportScale;
122
+ text.zIndex = this._core.store.currentZIndex;
123
+ text.isNewlyCreated = true;
124
+ this._core.store.objects.insert(text);
125
+ this._core.rerender();
126
+ text.edit(event);
127
+ }
128
+ if (event.pointerType === 'touch' || event.pointerType === 'pen') {
129
+ const activePointers = Array.from(this._core.store.state.pointers.values());
130
+ const path = event.composedPath().slice(1);
131
+ const objectElement = path.find(element => element.classList && element.classList.contains('object'));
132
+ const object = objectElement?.id ? this._core.findObjectById(objectElement.id) : null;
133
+ const activeText = this._core.store.activeText;
134
+ if (activeText === null && object instanceof KritzelText) {
135
+ object.edit(event);
136
+ return;
137
+ }
138
+ if (activeText !== null && object instanceof KritzelText) {
139
+ activeText.save();
140
+ object.edit(event);
141
+ return;
142
+ }
143
+ if (activeText !== null && object instanceof KritzelText === false) {
144
+ this._core.resetActiveText();
145
+ this._core.store.setState('activeTool', this._core.toolRegistry.getTool('selection'));
146
+ return;
147
+ }
148
+ if (activePointers.length > 1) {
149
+ return;
150
+ }
151
+ const clientX = Math.round(activePointers[0].clientX - this._core.store.offsetX);
152
+ const clientY = Math.round(activePointers[0].clientY - this._core.store.offsetY);
153
+ const viewportScale = this._core.store.state.scale;
154
+ const lockScale = this._core.store.state.lockDrawingScale;
155
+ const text = KritzelText.create(this._core, this.fontSize, this.fontFamily, lockScale ? 1 : viewportScale);
156
+ text.fontColor = this.fontColor;
157
+ text.opacity = this.opacity;
158
+ text.translateX = (clientX - this._core.store.state.translateX) / viewportScale;
159
+ text.translateY = (clientY - this._core.store.state.translateY) / viewportScale;
160
+ text.zIndex = this._core.store.currentZIndex;
161
+ text.isNewlyCreated = true;
162
+ this._core.store.objects.insert(text);
163
+ this._core.rerender();
164
+ text.edit(event);
165
+ }
166
+ }
167
+ /**
168
+ * Handles pointer up events for text editing focus management.
169
+ * If there's an active text that is mounted but doesn't have focus,
170
+ * focuses the text editor at the pointer position to allow typing.
171
+ * @param event - The PointerEvent containing the pointer position for focus placement
172
+ */
173
+ handlePointerUp(event) {
174
+ const activeText = this._core.store.activeText;
175
+ if (activeText && activeText.isMounted && !activeText.editor?.hasFocus()) {
176
+ activeText.focus({ x: event.clientX, y: event.clientY });
177
+ }
178
+ }
179
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "entries": [
3
+ "components/kritzel-engine/kritzel-engine.js",
4
+ "components/kritzel-awareness-cursors/kritzel-awareness-cursors.js",
5
+ "components/kritzel-cursor-trail/kritzel-cursor-trail.js",
6
+ "components/kritzel-icon/kritzel-icon.js",
7
+ "components/kritzel-watermark/kritzel-watermark.js"
8
+ ],
9
+ "mixins": [],
10
+ "compiler": {
11
+ "name": "@stencil/core",
12
+ "version": "4.44.2",
13
+ "typescriptVersion": "5.8.3"
14
+ },
15
+ "collections": [],
16
+ "bundles": []
17
+ }
@@ -0,0 +1,115 @@
1
+ :host {
2
+ display: block;
3
+ position: fixed;
4
+ top: 0;
5
+ left: 0;
6
+ width: 100vw;
7
+ height: 100vh;
8
+ pointer-events: none;
9
+ z-index: 1;
10
+ }
11
+
12
+ .awareness-cursor {
13
+ position: absolute;
14
+ top: 0;
15
+ left: 0;
16
+ transition: transform var(--kritzel-awareness-cursor-transition-duration, 100ms) ease-out,
17
+ opacity 300ms ease;
18
+ will-change: transform;
19
+ }
20
+
21
+ .awareness-cursor.stale {
22
+ opacity: 0;
23
+ }
24
+
25
+ .awareness-cursor.tracking-object {
26
+ transition-duration: 0ms;
27
+ }
28
+
29
+ .cursor-arrow {
30
+ filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
31
+ }
32
+
33
+ .cursor-label {
34
+ position: absolute;
35
+ left: 16px;
36
+ top: 16px;
37
+ white-space: nowrap;
38
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
39
+ font-size: var(--kritzel-awareness-cursor-label-font-size, 12px);
40
+ color: var(--kritzel-awareness-cursor-label-text-color, #ffffff);
41
+ padding: 2px 8px;
42
+ border-radius: 4px;
43
+ line-height: 1.4;
44
+ font-weight: 500;
45
+ pointer-events: none;
46
+ user-select: none;
47
+ }
48
+
49
+ .edge-indicator {
50
+ position: absolute;
51
+ top: -12px;
52
+ left: -12px;
53
+ width: 24px;
54
+ height: 24px;
55
+ display: flex;
56
+ align-items: center;
57
+ justify-content: center;
58
+ transition: transform var(--kritzel-awareness-cursor-transition-duration, 100ms) ease-out,
59
+ opacity 300ms ease;
60
+ will-change: transform;
61
+ pointer-events: auto;
62
+ user-select: none;
63
+ cursor: pointer;
64
+ }
65
+
66
+ .edge-indicator.stale {
67
+ opacity: 0;
68
+ }
69
+
70
+ .edge-indicator.tracking-object {
71
+ transition-duration: 0ms;
72
+ }
73
+
74
+ .edge-arrow {
75
+ position: absolute;
76
+ filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.3));
77
+ transition: opacity 300ms ease;
78
+ }
79
+
80
+ .edge-arrow.stale {
81
+ opacity: 0;
82
+ }
83
+
84
+ .edge-label {
85
+ position: absolute;
86
+ white-space: nowrap;
87
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
88
+ font-size: var(--kritzel-awareness-cursor-label-font-size, 12px);
89
+ color: var(--kritzel-awareness-cursor-label-text-color, #ffffff);
90
+ padding: 2px 8px;
91
+ border-radius: 4px;
92
+ line-height: 1.4;
93
+ font-weight: 500;
94
+ pointer-events: none;
95
+ opacity: 0;
96
+ transform-origin: center;
97
+ transition: opacity 150ms ease;
98
+ }
99
+
100
+ .edge-indicator:hover .edge-label {
101
+ opacity: 1;
102
+ }
103
+
104
+ .remote-selection-box {
105
+ position: absolute;
106
+ top: 0;
107
+ left: 0;
108
+ border-width: 2px;
109
+ border-style: solid;
110
+ pointer-events: none;
111
+ will-change: transform, width, height;
112
+ transition: transform var(--kritzel-awareness-cursor-transition-duration, 100ms) ease-out,
113
+ width var(--kritzel-awareness-cursor-transition-duration, 100ms) ease-out,
114
+ height var(--kritzel-awareness-cursor-transition-duration, 100ms) ease-out;
115
+ }