create-weave-frontend-app 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (272) hide show
  1. package/README.md +11 -0
  2. package/dist/chunk-HZJMO45D.js +437 -0
  3. package/dist/create-app.d.ts +14 -0
  4. package/dist/create-app.js +6 -0
  5. package/dist/index.d.ts +1 -0
  6. package/dist/index.js +106 -0
  7. package/package.json +65 -0
  8. package/template/+nextjs+azure-web-pubsub/README.md +36 -0
  9. package/template/+nextjs+azure-web-pubsub/api/del-image.ts +8 -0
  10. package/template/+nextjs+azure-web-pubsub/api/get-images.ts +15 -0
  11. package/template/+nextjs+azure-web-pubsub/api/post-image.ts +14 -0
  12. package/template/+nextjs+azure-web-pubsub/api/post-remove-background.ts +10 -0
  13. package/template/+nextjs+azure-web-pubsub/app/error/page.tsx +10 -0
  14. package/template/+nextjs+azure-web-pubsub/app/favicon.ico +0 -0
  15. package/template/+nextjs+azure-web-pubsub/app/globals.css +193 -0
  16. package/template/+nextjs+azure-web-pubsub/app/layout.tsx +46 -0
  17. package/template/+nextjs+azure-web-pubsub/app/page.tsx +7 -0
  18. package/template/+nextjs+azure-web-pubsub/app/providers.tsx +18 -0
  19. package/template/+nextjs+azure-web-pubsub/app/room/[roomId]/page.tsx +5 -0
  20. package/template/+nextjs+azure-web-pubsub/assets/images/home.png +0 -0
  21. package/template/+nextjs+azure-web-pubsub/assets/images/logo.png +0 -0
  22. package/template/+nextjs+azure-web-pubsub/components/actions/align-elements-tool/align-elements-tool.ts +94 -0
  23. package/template/+nextjs+azure-web-pubsub/components/actions/color-token-tool/color-token-tool.ts +164 -0
  24. package/template/+nextjs+azure-web-pubsub/components/actions/color-token-tool/constants.ts +5 -0
  25. package/template/+nextjs+azure-web-pubsub/components/actions/color-token-tool/types.ts +12 -0
  26. package/template/+nextjs+azure-web-pubsub/components/error/error.tsx +62 -0
  27. package/template/+nextjs+azure-web-pubsub/components/error/errors.ts +35 -0
  28. package/template/+nextjs+azure-web-pubsub/components/home/home.tsx +92 -0
  29. package/template/+nextjs+azure-web-pubsub/components/home-components/home-showcase-animation.tsx +119 -0
  30. package/template/+nextjs+azure-web-pubsub/components/home-components/login-form.tsx +117 -0
  31. package/template/+nextjs+azure-web-pubsub/components/nodes/color-token/color-token.ts +171 -0
  32. package/template/+nextjs+azure-web-pubsub/components/room/room.layout.tsx +115 -0
  33. package/template/+nextjs+azure-web-pubsub/components/room/room.tsx +125 -0
  34. package/template/+nextjs+azure-web-pubsub/components/room-components/color-tokens-library/color-token.tsx +31 -0
  35. package/template/+nextjs+azure-web-pubsub/components/room-components/color-tokens-library/color-tokens-library.tsx +64 -0
  36. package/template/+nextjs+azure-web-pubsub/components/room-components/connected-users.tsx +152 -0
  37. package/template/+nextjs+azure-web-pubsub/components/room-components/connection-status.tsx +52 -0
  38. package/template/+nextjs+azure-web-pubsub/components/room-components/context-menu.tsx +152 -0
  39. package/template/+nextjs+azure-web-pubsub/components/room-components/frames-library/frames-library.image.tsx +48 -0
  40. package/template/+nextjs+azure-web-pubsub/components/room-components/frames-library/frames-library.presentation-image.tsx +61 -0
  41. package/template/+nextjs+azure-web-pubsub/components/room-components/frames-library/frames-library.tsx +316 -0
  42. package/template/+nextjs+azure-web-pubsub/components/room-components/frames-library/utils.ts +27 -0
  43. package/template/+nextjs+azure-web-pubsub/components/room-components/help/help-arrange.tsx +69 -0
  44. package/template/+nextjs+azure-web-pubsub/components/room-components/help/help-drawer.tsx +140 -0
  45. package/template/+nextjs+azure-web-pubsub/components/room-components/help/help-edit.tsx +80 -0
  46. package/template/+nextjs+azure-web-pubsub/components/room-components/help/help-selection.tsx +30 -0
  47. package/template/+nextjs+azure-web-pubsub/components/room-components/help/help-shortcut-element.tsx +24 -0
  48. package/template/+nextjs+azure-web-pubsub/components/room-components/help/help-tools.tsx +89 -0
  49. package/template/+nextjs+azure-web-pubsub/components/room-components/help/help-view.tsx +30 -0
  50. package/template/+nextjs+azure-web-pubsub/components/room-components/help/help-zoom.tsx +46 -0
  51. package/template/+nextjs+azure-web-pubsub/components/room-components/help/shortcut-element.tsx +42 -0
  52. package/template/+nextjs+azure-web-pubsub/components/room-components/hooks/use-context-menu.tsx +514 -0
  53. package/template/+nextjs+azure-web-pubsub/components/room-components/hooks/use-get-azure-web-pubsub-provider.ts +78 -0
  54. package/template/+nextjs+azure-web-pubsub/components/room-components/hooks/use-get-os.ts +12 -0
  55. package/template/+nextjs+azure-web-pubsub/components/room-components/hooks/use-get-weave-js-props.tsx +120 -0
  56. package/template/+nextjs+azure-web-pubsub/components/room-components/hooks/use-handle-route-params.ts +30 -0
  57. package/template/+nextjs+azure-web-pubsub/components/room-components/hooks/use-key-down.ts +29 -0
  58. package/template/+nextjs+azure-web-pubsub/components/room-components/hooks/use-keyboard-handler.tsx +557 -0
  59. package/template/+nextjs+azure-web-pubsub/components/room-components/images-library/images-library.tsx +146 -0
  60. package/template/+nextjs+azure-web-pubsub/components/room-components/inputs/input-color.tsx +101 -0
  61. package/template/+nextjs+azure-web-pubsub/components/room-components/inputs/input-font-family.tsx +99 -0
  62. package/template/+nextjs+azure-web-pubsub/components/room-components/inputs/input-number.tsx +61 -0
  63. package/template/+nextjs+azure-web-pubsub/components/room-components/inputs/input-text.tsx +51 -0
  64. package/template/+nextjs+azure-web-pubsub/components/room-components/inputs/number-input.tsx +107 -0
  65. package/template/+nextjs+azure-web-pubsub/components/room-components/node-properties/appearance-properties.tsx +119 -0
  66. package/template/+nextjs+azure-web-pubsub/components/room-components/node-properties/color-token-properties.tsx +108 -0
  67. package/template/+nextjs+azure-web-pubsub/components/room-components/node-properties/crop-properties.tsx +156 -0
  68. package/template/+nextjs+azure-web-pubsub/components/room-components/node-properties/fill-properties.tsx +115 -0
  69. package/template/+nextjs+azure-web-pubsub/components/room-components/node-properties/frame-properties.tsx +100 -0
  70. package/template/+nextjs+azure-web-pubsub/components/room-components/node-properties/image-properties.tsx +57 -0
  71. package/template/+nextjs+azure-web-pubsub/components/room-components/node-properties/position-properties.tsx +156 -0
  72. package/template/+nextjs+azure-web-pubsub/components/room-components/node-properties/size-properties.tsx +131 -0
  73. package/template/+nextjs+azure-web-pubsub/components/room-components/node-properties/stroke-properties.tsx +327 -0
  74. package/template/+nextjs+azure-web-pubsub/components/room-components/node-properties/text-properties.tsx +467 -0
  75. package/template/+nextjs+azure-web-pubsub/components/room-components/overlay/multiuse-overlay.tsx +127 -0
  76. package/template/+nextjs+azure-web-pubsub/components/room-components/overlay/node-properties.tsx +98 -0
  77. package/template/+nextjs+azure-web-pubsub/components/room-components/overlay/overlay-animation-wrapper.tsx +31 -0
  78. package/template/+nextjs+azure-web-pubsub/components/room-components/overlay/room-information-overlay.tsx +247 -0
  79. package/template/+nextjs+azure-web-pubsub/components/room-components/overlay/room-users-overlay.tsx +31 -0
  80. package/template/+nextjs+azure-web-pubsub/components/room-components/overlay/tools-overlay.tsx +289 -0
  81. package/template/+nextjs+azure-web-pubsub/components/room-components/overlay/variants.ts +58 -0
  82. package/template/+nextjs+azure-web-pubsub/components/room-components/overlay/zoom-handler-overlay.tsx +447 -0
  83. package/template/+nextjs+azure-web-pubsub/components/room-components/room-error.tsx +37 -0
  84. package/template/+nextjs+azure-web-pubsub/components/room-components/room-loader/room-loader.tsx +98 -0
  85. package/template/+nextjs+azure-web-pubsub/components/room-components/selection-information.tsx +74 -0
  86. package/template/+nextjs+azure-web-pubsub/components/room-components/toggle-icon-button.tsx +60 -0
  87. package/template/+nextjs+azure-web-pubsub/components/room-components/toolbar/toolbar-button.tsx +60 -0
  88. package/template/+nextjs+azure-web-pubsub/components/room-components/toolbar/toolbar-toggle-button.tsx +40 -0
  89. package/template/+nextjs+azure-web-pubsub/components/room-components/toolbar/toolbar.tsx +28 -0
  90. package/template/+nextjs+azure-web-pubsub/components/room-components/upload-file.tsx +130 -0
  91. package/template/+nextjs+azure-web-pubsub/components/room-components/with-instance-node.tsx +53 -0
  92. package/template/+nextjs+azure-web-pubsub/components/ui/accordion.tsx +66 -0
  93. package/template/+nextjs+azure-web-pubsub/components/ui/avatar.tsx +53 -0
  94. package/template/+nextjs+azure-web-pubsub/components/ui/button.tsx +58 -0
  95. package/template/+nextjs+azure-web-pubsub/components/ui/card.tsx +68 -0
  96. package/template/+nextjs+azure-web-pubsub/components/ui/checkbox.tsx +32 -0
  97. package/template/+nextjs+azure-web-pubsub/components/ui/color-picker/color-picker-component.tsx +69 -0
  98. package/template/+nextjs+azure-web-pubsub/components/ui/color-picker/context/color-picker-context.tsx +28 -0
  99. package/template/+nextjs+azure-web-pubsub/components/ui/color-picker/editor/color-picker-format-editor.tsx +34 -0
  100. package/template/+nextjs+azure-web-pubsub/components/ui/color-picker/index.ts +7 -0
  101. package/template/+nextjs+azure-web-pubsub/components/ui/color-picker/selector/color-picker-alpha.tsx +79 -0
  102. package/template/+nextjs+azure-web-pubsub/components/ui/color-picker/selector/color-picker-eyedropper.tsx +95 -0
  103. package/template/+nextjs+azure-web-pubsub/components/ui/color-picker/selector/color-picker-format-selector.tsx +50 -0
  104. package/template/+nextjs+azure-web-pubsub/components/ui/color-picker/selector/color-picker-hue.tsx +67 -0
  105. package/template/+nextjs+azure-web-pubsub/components/ui/color-picker/selector/color-picker-saturation.tsx +145 -0
  106. package/template/+nextjs+azure-web-pubsub/components/ui/color-picker/text-inputs/color-picker-alpha-percentage.tsx +60 -0
  107. package/template/+nextjs+azure-web-pubsub/components/ui/color-picker/text-inputs/color-picker-hexa.tsx +65 -0
  108. package/template/+nextjs+azure-web-pubsub/components/ui/color-picker/text-inputs/color-picker-rgba.tsx +62 -0
  109. package/template/+nextjs+azure-web-pubsub/components/ui/command.tsx +177 -0
  110. package/template/+nextjs+azure-web-pubsub/components/ui/dialog.tsx +135 -0
  111. package/template/+nextjs+azure-web-pubsub/components/ui/drawer.tsx +132 -0
  112. package/template/+nextjs+azure-web-pubsub/components/ui/dropdown-menu.tsx +201 -0
  113. package/template/+nextjs+azure-web-pubsub/components/ui/form.tsx +167 -0
  114. package/template/+nextjs+azure-web-pubsub/components/ui/input.tsx +21 -0
  115. package/template/+nextjs+azure-web-pubsub/components/ui/label.tsx +24 -0
  116. package/template/+nextjs+azure-web-pubsub/components/ui/popover.tsx +48 -0
  117. package/template/+nextjs+azure-web-pubsub/components/ui/reactbits/Backgrounds/Dither/Dither.tsx +350 -0
  118. package/template/+nextjs+azure-web-pubsub/components/ui/reactbits/Backgrounds/Threads/Threads.tsx +239 -0
  119. package/template/+nextjs+azure-web-pubsub/components/ui/reactbits/TextAnimations/RotatingText/RotatingText.tsx +276 -0
  120. package/template/+nextjs+azure-web-pubsub/components/ui/scroll-area.tsx +58 -0
  121. package/template/+nextjs+azure-web-pubsub/components/ui/select.tsx +185 -0
  122. package/template/+nextjs+azure-web-pubsub/components/ui/sheet.tsx +139 -0
  123. package/template/+nextjs+azure-web-pubsub/components/ui/sonner.tsx +25 -0
  124. package/template/+nextjs+azure-web-pubsub/components/ui/tabs.tsx +66 -0
  125. package/template/+nextjs+azure-web-pubsub/components/ui/tooltip.tsx +61 -0
  126. package/template/+nextjs+azure-web-pubsub/components/utils/constants.ts +118 -0
  127. package/template/+nextjs+azure-web-pubsub/components/utils/logo.tsx +34 -0
  128. package/template/+nextjs+azure-web-pubsub/components.json +21 -0
  129. package/template/+nextjs+azure-web-pubsub/example.env +2 -0
  130. package/template/+nextjs+azure-web-pubsub/example.gitignore +44 -0
  131. package/template/+nextjs+azure-web-pubsub/jsrepo.json +11 -0
  132. package/template/+nextjs+azure-web-pubsub/lib/utils.ts +43 -0
  133. package/template/+nextjs+azure-web-pubsub/new-types.d.ts +8 -0
  134. package/template/+nextjs+azure-web-pubsub/next-env.d.ts +5 -0
  135. package/template/+nextjs+azure-web-pubsub/next.config.js +52 -0
  136. package/template/+nextjs+azure-web-pubsub/postcss.config.mjs +5 -0
  137. package/template/+nextjs+azure-web-pubsub/store/store.ts +241 -0
  138. package/template/+nextjs+azure-web-pubsub/tsconfig.json +37 -0
  139. package/template/+nextjs+azure-web-pubsub/vitest.config.mts +10 -0
  140. package/template/+nextjs+websockets/README.md +39 -0
  141. package/template/+nextjs+websockets/api/del-image.ts +8 -0
  142. package/template/+nextjs+websockets/api/get-images.ts +15 -0
  143. package/template/+nextjs+websockets/api/post-image.ts +14 -0
  144. package/template/+nextjs+websockets/api/post-remove-background.ts +10 -0
  145. package/template/+nextjs+websockets/app/error/page.tsx +10 -0
  146. package/template/+nextjs+websockets/app/favicon.ico +0 -0
  147. package/template/+nextjs+websockets/app/globals.css +193 -0
  148. package/template/+nextjs+websockets/app/layout.tsx +46 -0
  149. package/template/+nextjs+websockets/app/page.tsx +7 -0
  150. package/template/+nextjs+websockets/app/providers.tsx +18 -0
  151. package/template/+nextjs+websockets/app/room/[roomId]/page.tsx +5 -0
  152. package/template/+nextjs+websockets/assets/images/home.png +0 -0
  153. package/template/+nextjs+websockets/assets/images/logo.png +0 -0
  154. package/template/+nextjs+websockets/components/actions/align-elements-tool/align-elements-tool.ts +94 -0
  155. package/template/+nextjs+websockets/components/actions/color-token-tool/color-token-tool.ts +164 -0
  156. package/template/+nextjs+websockets/components/actions/color-token-tool/constants.ts +5 -0
  157. package/template/+nextjs+websockets/components/actions/color-token-tool/types.ts +12 -0
  158. package/template/+nextjs+websockets/components/error/error.tsx +62 -0
  159. package/template/+nextjs+websockets/components/error/errors.ts +35 -0
  160. package/template/+nextjs+websockets/components/home/home.tsx +92 -0
  161. package/template/+nextjs+websockets/components/home-components/home-showcase-animation.tsx +119 -0
  162. package/template/+nextjs+websockets/components/home-components/login-form.tsx +117 -0
  163. package/template/+nextjs+websockets/components/nodes/color-token/color-token.ts +171 -0
  164. package/template/+nextjs+websockets/components/room/room.layout.tsx +115 -0
  165. package/template/+nextjs+websockets/components/room/room.tsx +125 -0
  166. package/template/+nextjs+websockets/components/room-components/color-tokens-library/color-token.tsx +31 -0
  167. package/template/+nextjs+websockets/components/room-components/color-tokens-library/color-tokens-library.tsx +64 -0
  168. package/template/+nextjs+websockets/components/room-components/connected-users.tsx +152 -0
  169. package/template/+nextjs+websockets/components/room-components/connection-status.tsx +52 -0
  170. package/template/+nextjs+websockets/components/room-components/context-menu.tsx +152 -0
  171. package/template/+nextjs+websockets/components/room-components/frames-library/frames-library.image.tsx +48 -0
  172. package/template/+nextjs+websockets/components/room-components/frames-library/frames-library.presentation-image.tsx +61 -0
  173. package/template/+nextjs+websockets/components/room-components/frames-library/frames-library.tsx +316 -0
  174. package/template/+nextjs+websockets/components/room-components/frames-library/utils.ts +27 -0
  175. package/template/+nextjs+websockets/components/room-components/help/help-arrange.tsx +69 -0
  176. package/template/+nextjs+websockets/components/room-components/help/help-drawer.tsx +140 -0
  177. package/template/+nextjs+websockets/components/room-components/help/help-edit.tsx +80 -0
  178. package/template/+nextjs+websockets/components/room-components/help/help-selection.tsx +30 -0
  179. package/template/+nextjs+websockets/components/room-components/help/help-shortcut-element.tsx +24 -0
  180. package/template/+nextjs+websockets/components/room-components/help/help-tools.tsx +89 -0
  181. package/template/+nextjs+websockets/components/room-components/help/help-view.tsx +30 -0
  182. package/template/+nextjs+websockets/components/room-components/help/help-zoom.tsx +46 -0
  183. package/template/+nextjs+websockets/components/room-components/help/shortcut-element.tsx +42 -0
  184. package/template/+nextjs+websockets/components/room-components/hooks/use-context-menu.tsx +514 -0
  185. package/template/+nextjs+websockets/components/room-components/hooks/use-get-os.ts +12 -0
  186. package/template/+nextjs+websockets/components/room-components/hooks/use-get-weave-js-props.tsx +120 -0
  187. package/template/+nextjs+websockets/components/room-components/hooks/use-get-websockets-provider.ts +79 -0
  188. package/template/+nextjs+websockets/components/room-components/hooks/use-handle-route-params.ts +30 -0
  189. package/template/+nextjs+websockets/components/room-components/hooks/use-key-down.ts +29 -0
  190. package/template/+nextjs+websockets/components/room-components/hooks/use-keyboard-handler.tsx +557 -0
  191. package/template/+nextjs+websockets/components/room-components/images-library/images-library.tsx +146 -0
  192. package/template/+nextjs+websockets/components/room-components/inputs/input-color.tsx +101 -0
  193. package/template/+nextjs+websockets/components/room-components/inputs/input-font-family.tsx +99 -0
  194. package/template/+nextjs+websockets/components/room-components/inputs/input-number.tsx +61 -0
  195. package/template/+nextjs+websockets/components/room-components/inputs/input-text.tsx +51 -0
  196. package/template/+nextjs+websockets/components/room-components/inputs/number-input.tsx +107 -0
  197. package/template/+nextjs+websockets/components/room-components/node-properties/appearance-properties.tsx +119 -0
  198. package/template/+nextjs+websockets/components/room-components/node-properties/color-token-properties.tsx +108 -0
  199. package/template/+nextjs+websockets/components/room-components/node-properties/crop-properties.tsx +156 -0
  200. package/template/+nextjs+websockets/components/room-components/node-properties/fill-properties.tsx +115 -0
  201. package/template/+nextjs+websockets/components/room-components/node-properties/frame-properties.tsx +100 -0
  202. package/template/+nextjs+websockets/components/room-components/node-properties/image-properties.tsx +57 -0
  203. package/template/+nextjs+websockets/components/room-components/node-properties/position-properties.tsx +156 -0
  204. package/template/+nextjs+websockets/components/room-components/node-properties/size-properties.tsx +131 -0
  205. package/template/+nextjs+websockets/components/room-components/node-properties/stroke-properties.tsx +327 -0
  206. package/template/+nextjs+websockets/components/room-components/node-properties/text-properties.tsx +467 -0
  207. package/template/+nextjs+websockets/components/room-components/overlay/multiuse-overlay.tsx +127 -0
  208. package/template/+nextjs+websockets/components/room-components/overlay/node-properties.tsx +98 -0
  209. package/template/+nextjs+websockets/components/room-components/overlay/overlay-animation-wrapper.tsx +31 -0
  210. package/template/+nextjs+websockets/components/room-components/overlay/room-information-overlay.tsx +247 -0
  211. package/template/+nextjs+websockets/components/room-components/overlay/room-users-overlay.tsx +31 -0
  212. package/template/+nextjs+websockets/components/room-components/overlay/tools-overlay.tsx +289 -0
  213. package/template/+nextjs+websockets/components/room-components/overlay/variants.ts +58 -0
  214. package/template/+nextjs+websockets/components/room-components/overlay/zoom-handler-overlay.tsx +447 -0
  215. package/template/+nextjs+websockets/components/room-components/room-error.tsx +37 -0
  216. package/template/+nextjs+websockets/components/room-components/room-loader/room-loader.tsx +98 -0
  217. package/template/+nextjs+websockets/components/room-components/selection-information.tsx +74 -0
  218. package/template/+nextjs+websockets/components/room-components/toggle-icon-button.tsx +60 -0
  219. package/template/+nextjs+websockets/components/room-components/toolbar/toolbar-button.tsx +60 -0
  220. package/template/+nextjs+websockets/components/room-components/toolbar/toolbar-toggle-button.tsx +40 -0
  221. package/template/+nextjs+websockets/components/room-components/toolbar/toolbar.tsx +28 -0
  222. package/template/+nextjs+websockets/components/room-components/upload-file.tsx +130 -0
  223. package/template/+nextjs+websockets/components/room-components/with-instance-node.tsx +53 -0
  224. package/template/+nextjs+websockets/components/ui/accordion.tsx +66 -0
  225. package/template/+nextjs+websockets/components/ui/avatar.tsx +53 -0
  226. package/template/+nextjs+websockets/components/ui/button.tsx +58 -0
  227. package/template/+nextjs+websockets/components/ui/card.tsx +68 -0
  228. package/template/+nextjs+websockets/components/ui/checkbox.tsx +32 -0
  229. package/template/+nextjs+websockets/components/ui/color-picker/color-picker-component.tsx +69 -0
  230. package/template/+nextjs+websockets/components/ui/color-picker/context/color-picker-context.tsx +28 -0
  231. package/template/+nextjs+websockets/components/ui/color-picker/editor/color-picker-format-editor.tsx +34 -0
  232. package/template/+nextjs+websockets/components/ui/color-picker/index.ts +7 -0
  233. package/template/+nextjs+websockets/components/ui/color-picker/selector/color-picker-alpha.tsx +79 -0
  234. package/template/+nextjs+websockets/components/ui/color-picker/selector/color-picker-eyedropper.tsx +95 -0
  235. package/template/+nextjs+websockets/components/ui/color-picker/selector/color-picker-format-selector.tsx +50 -0
  236. package/template/+nextjs+websockets/components/ui/color-picker/selector/color-picker-hue.tsx +67 -0
  237. package/template/+nextjs+websockets/components/ui/color-picker/selector/color-picker-saturation.tsx +145 -0
  238. package/template/+nextjs+websockets/components/ui/color-picker/text-inputs/color-picker-alpha-percentage.tsx +60 -0
  239. package/template/+nextjs+websockets/components/ui/color-picker/text-inputs/color-picker-hexa.tsx +65 -0
  240. package/template/+nextjs+websockets/components/ui/color-picker/text-inputs/color-picker-rgba.tsx +62 -0
  241. package/template/+nextjs+websockets/components/ui/command.tsx +177 -0
  242. package/template/+nextjs+websockets/components/ui/dialog.tsx +135 -0
  243. package/template/+nextjs+websockets/components/ui/drawer.tsx +132 -0
  244. package/template/+nextjs+websockets/components/ui/dropdown-menu.tsx +201 -0
  245. package/template/+nextjs+websockets/components/ui/form.tsx +167 -0
  246. package/template/+nextjs+websockets/components/ui/input.tsx +21 -0
  247. package/template/+nextjs+websockets/components/ui/label.tsx +24 -0
  248. package/template/+nextjs+websockets/components/ui/popover.tsx +48 -0
  249. package/template/+nextjs+websockets/components/ui/reactbits/Backgrounds/Dither/Dither.tsx +350 -0
  250. package/template/+nextjs+websockets/components/ui/reactbits/Backgrounds/Threads/Threads.tsx +239 -0
  251. package/template/+nextjs+websockets/components/ui/reactbits/TextAnimations/RotatingText/RotatingText.tsx +276 -0
  252. package/template/+nextjs+websockets/components/ui/scroll-area.tsx +58 -0
  253. package/template/+nextjs+websockets/components/ui/select.tsx +185 -0
  254. package/template/+nextjs+websockets/components/ui/sheet.tsx +139 -0
  255. package/template/+nextjs+websockets/components/ui/sonner.tsx +25 -0
  256. package/template/+nextjs+websockets/components/ui/tabs.tsx +66 -0
  257. package/template/+nextjs+websockets/components/ui/tooltip.tsx +61 -0
  258. package/template/+nextjs+websockets/components/utils/constants.ts +118 -0
  259. package/template/+nextjs+websockets/components/utils/logo.tsx +34 -0
  260. package/template/+nextjs+websockets/components.json +21 -0
  261. package/template/+nextjs+websockets/example.env +2 -0
  262. package/template/+nextjs+websockets/example.gitignore +44 -0
  263. package/template/+nextjs+websockets/jsrepo.json +11 -0
  264. package/template/+nextjs+websockets/lib/utils.ts +43 -0
  265. package/template/+nextjs+websockets/new-types.d.ts +8 -0
  266. package/template/+nextjs+websockets/next-env.d.ts +5 -0
  267. package/template/+nextjs+websockets/next.config.js +52 -0
  268. package/template/+nextjs+websockets/postcss.config.mjs +5 -0
  269. package/template/+nextjs+websockets/store/store.ts +241 -0
  270. package/template/+nextjs+websockets/tsconfig.json +37 -0
  271. package/template/+nextjs+websockets/vitest.config.mts +10 -0
  272. package/template/package.json +81 -0
@@ -0,0 +1,101 @@
1
+ "use client";
2
+
3
+ import React, { useState, useEffect } from "react";
4
+ import { Input } from "@/components/ui/input";
5
+ import {
6
+ ColorPicker,
7
+ ColorPickerAlpha,
8
+ ColorPickerEyeDropper,
9
+ ColorPickerFormatEditor,
10
+ ColorPickerHue,
11
+ ColorPickerFormatSelector,
12
+ ColorPickerSaturation,
13
+ } from "@/components/ui/color-picker";
14
+ import {
15
+ Popover,
16
+ PopoverContent,
17
+ PopoverTrigger,
18
+ } from "@/components/ui/popover";
19
+
20
+ type InputColorProps = {
21
+ label?: string;
22
+ value: string;
23
+ onChange: (value: string) => void;
24
+ };
25
+
26
+ export const InputColor = ({
27
+ label,
28
+ value,
29
+ onChange,
30
+ }: Readonly<InputColorProps>) => {
31
+ const [actualValue, setActualValue] = useState<string>(value);
32
+
33
+ useEffect(() => {
34
+ setActualValue(value);
35
+ }, [value]);
36
+
37
+ const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
38
+ setActualValue(e.target.value);
39
+ };
40
+
41
+ const handleBlur = () => {
42
+ onChange(actualValue);
43
+ };
44
+
45
+ return (
46
+ <div className="flex flex-col items-start justify-start relative">
47
+ {label && (
48
+ <div className="text-zinc-600 mb-1 text-[11px] font-noto-sans-mono font-light">
49
+ {label}
50
+ </div>
51
+ )}
52
+ <div className="w-full flex items-center relative">
53
+ <Popover>
54
+ <PopoverTrigger>
55
+ <div
56
+ className="cursor-pointer shrink-0 w-[32px] h-[32px] mr-1 border border-zinc-200 rounded-none"
57
+ style={{ background: `#${actualValue}` }}
58
+ />
59
+ </PopoverTrigger>
60
+ <PopoverContent>
61
+ <ColorPicker
62
+ value={`#${actualValue}`}
63
+ onChange={(color) => {
64
+ onChange((color as string).slice(1));
65
+ }}
66
+ >
67
+ <ColorPickerSaturation />
68
+ <div className="flex items-center gap-4">
69
+ <ColorPickerEyeDropper />
70
+ <div className="w-full grid gap-1">
71
+ <ColorPickerHue />
72
+ <ColorPickerAlpha />
73
+ </div>
74
+ </div>
75
+ <div className="flex items-center gap-2">
76
+ <ColorPickerFormatSelector />
77
+ <ColorPickerFormatEditor />
78
+ </div>
79
+ </ColorPicker>
80
+ </PopoverContent>
81
+ </Popover>
82
+
83
+ <Input
84
+ type="text"
85
+ className="w-full py-0 h-[32px] rounded-none !text-xs font-normal text-gray-700 text-right focus:outline-none bg-transparent shadow-none"
86
+ value={actualValue}
87
+ onChange={handleInputChange}
88
+ onBlur={handleBlur}
89
+ onKeyDown={(e) => {
90
+ if (e.key === "Enter") {
91
+ e.preventDefault();
92
+ e.stopPropagation();
93
+ const input = e.target as HTMLInputElement;
94
+ input.blur();
95
+ }
96
+ }}
97
+ />
98
+ </div>
99
+ </div>
100
+ );
101
+ };
@@ -0,0 +1,99 @@
1
+ import {
2
+ Command,
3
+ CommandEmpty,
4
+ CommandGroup,
5
+ CommandInput,
6
+ CommandItem,
7
+ CommandList,
8
+ } from "@/components/ui/command";
9
+ import {
10
+ Popover,
11
+ PopoverContent,
12
+ PopoverTrigger,
13
+ } from "@/components/ui/popover";
14
+ import { Check, ChevronDown } from "lucide-react";
15
+
16
+ import { Button } from "@/components/ui/button";
17
+ import { useEffect, useRef, useState } from "react";
18
+ import { FONTS } from "@/components/utils/constants";
19
+
20
+ function InputFontFamily({
21
+ value,
22
+ onChange,
23
+ }: {
24
+ value: string;
25
+ onChange: (value: string) => void;
26
+ }) {
27
+ const [selectedFont, setSelectedFont] = useState<string>(value);
28
+ const [open, setOpen] = useState(false);
29
+ const lastSelectedFontFamily = useRef<string>(value);
30
+
31
+ useEffect(() => {
32
+ if (onChange && selectedFont !== lastSelectedFontFamily.current) {
33
+ lastSelectedFontFamily.current = selectedFont;
34
+ onChange(selectedFont);
35
+ }
36
+ }, [selectedFont, onChange]);
37
+
38
+ return (
39
+ <div className="flex flex-col items-start justify-start relative">
40
+ <div className="text-zinc-600 mb-1 text-[11px] font-noto-sans-mono font-light">
41
+ Font Family
42
+ </div>
43
+ <Popover open={open} onOpenChange={setOpen}>
44
+ <PopoverTrigger className="w-full">
45
+ <Button
46
+ variant="outline"
47
+ role="combobox"
48
+ aria-expanded={open}
49
+ className="w-full h-[32px] rounded-none !text-xs text-gray-700 justify-between font-normal bg-transparent shadow-none"
50
+ style={{ fontFamily: selectedFont }}
51
+ >
52
+ {selectedFont}
53
+ <ChevronDown className="ml-2 h-4 w-4 shrink-0 opacity-50" />
54
+ </Button>
55
+ </PopoverTrigger>
56
+ <PopoverContent className="rounded-none p-0 w-[var(--radix-popover-trigger-width)]">
57
+ <Command>
58
+ <CommandInput
59
+ className="!text-xs text-gray-700 justify-between font-normal bg-transparent shadow-none"
60
+ placeholder="Search font..."
61
+ />
62
+ <CommandList>
63
+ <CommandEmpty>
64
+ <span className="!text-xs text-gray-700 justify-between font-normal bg-transparent shadow-none">
65
+ No font found.
66
+ </span>
67
+ </CommandEmpty>
68
+ <CommandGroup>
69
+ {FONTS.map((font) => (
70
+ <CommandItem
71
+ key={font.id}
72
+ value={font.name}
73
+ onSelect={() => {
74
+ setSelectedFont(font.name);
75
+ setOpen(false);
76
+ }}
77
+ className="flex items-center"
78
+ >
79
+ <span
80
+ className="!text-xs text-gray-700 justify-between font-normal bg-transparent shadow-none"
81
+ style={{ fontFamily: font.name }}
82
+ >
83
+ {font.name}
84
+ </span>
85
+ {selectedFont === font.id && (
86
+ <Check className="ml-auto h-4 w-4" />
87
+ )}
88
+ </CommandItem>
89
+ ))}
90
+ </CommandGroup>
91
+ </CommandList>
92
+ </Command>
93
+ </PopoverContent>
94
+ </Popover>
95
+ </div>
96
+ );
97
+ }
98
+
99
+ export default InputFontFamily;
@@ -0,0 +1,61 @@
1
+ "use client";
2
+
3
+ import React from "react";
4
+ import { NumberInput } from "./number-input";
5
+
6
+ type InputNumberProps = {
7
+ label?: string;
8
+ disabled?: boolean;
9
+ value: number;
10
+ onChange?: (value: number) => void;
11
+ min?: number;
12
+ max?: number;
13
+ };
14
+
15
+ export const InputNumber = ({
16
+ label,
17
+ value,
18
+ onChange,
19
+ disabled = false,
20
+ min = -Infinity,
21
+ max = Infinity,
22
+ }: Readonly<InputNumberProps>) => {
23
+ const [actualValue, setActualValue] = React.useState<string>(`${value}`);
24
+
25
+ React.useEffect(() => {
26
+ setActualValue(`${value}`);
27
+ }, [value]);
28
+
29
+ const handleBlur = () => {
30
+ let numberToSave = actualValue === "" ? "0" : actualValue;
31
+ numberToSave = numberToSave.replace(/^0+/, "");
32
+ if (isNaN(parseFloat(numberToSave))) {
33
+ numberToSave = "0";
34
+ }
35
+ onChange?.(parseFloat(actualValue));
36
+ };
37
+
38
+ return (
39
+ <NumberInput
40
+ label={label}
41
+ disabled={disabled}
42
+ min={min}
43
+ max={max}
44
+ decimalScale={2}
45
+ className="w-full text-xs font-normal text-gray-700 text-right focus:outline-none bg-transparent"
46
+ value={Number(actualValue)}
47
+ onChange={(e) => {
48
+ setActualValue(e.target.value);
49
+ }}
50
+ onKeyDown={(e) => {
51
+ if (e.key === "Enter") {
52
+ e.preventDefault();
53
+ e.stopPropagation();
54
+ const input = e.target as HTMLInputElement;
55
+ input.blur();
56
+ }
57
+ }}
58
+ onBlur={handleBlur}
59
+ />
60
+ );
61
+ };
@@ -0,0 +1,51 @@
1
+ "use client";
2
+
3
+ import React from "react";
4
+ import { Input } from "@/components/ui/input";
5
+
6
+ type InputTextProps = {
7
+ label: string;
8
+ value: string;
9
+ onChange: (value: string) => void;
10
+ };
11
+
12
+ export const InputText = ({
13
+ label,
14
+ value,
15
+ onChange,
16
+ }: Readonly<InputTextProps>) => {
17
+ const [actualValue, setActualValue] = React.useState<string>(`${value}`);
18
+
19
+ React.useEffect(() => {
20
+ setActualValue(`${value}`);
21
+ }, [value]);
22
+
23
+ return (
24
+ <div className="flex flex-col items-start justify-start relative">
25
+ {label && (
26
+ <div className="text-zinc-600 mb-1 text-[11px] font-noto-sans-mono font-light">
27
+ {label}
28
+ </div>
29
+ )}
30
+ <Input
31
+ type="text"
32
+ className="w-full py-0 h-[32px] rounded-none !text-xs font-normal text-gray-700 text-left focus:outline-none bg-transparent shadow-none"
33
+ value={actualValue}
34
+ onChange={(e) => {
35
+ setActualValue(e.target.value);
36
+ }}
37
+ onKeyDown={(e) => {
38
+ if (e.key === "Enter") {
39
+ e.preventDefault();
40
+ e.stopPropagation();
41
+ const input = e.target as HTMLInputElement;
42
+ input.blur();
43
+ }
44
+ }}
45
+ onBlur={() => {
46
+ onChange(actualValue);
47
+ }}
48
+ />
49
+ </div>
50
+ );
51
+ };
@@ -0,0 +1,107 @@
1
+ import React from "react";
2
+ import { NumericFormat, NumericFormatProps } from "react-number-format";
3
+ import { Input } from "@/components/ui/input";
4
+
5
+ export interface NumberInputProps
6
+ extends Omit<NumericFormatProps, "value" | "onValueChange"> {
7
+ label?: string;
8
+ stepper?: number;
9
+ thousandSeparator?: string;
10
+ placeholder?: string;
11
+ defaultValue?: number;
12
+ min?: number;
13
+ max?: number;
14
+ value?: number; // Controlled value
15
+ suffix?: string;
16
+ prefix?: string;
17
+ onValueChange?: (value: number | undefined) => void;
18
+ fixedDecimalScale?: boolean;
19
+ decimalScale?: number;
20
+ }
21
+
22
+ export const NumberInput = React.forwardRef<HTMLInputElement, NumberInputProps>(
23
+ (
24
+ {
25
+ label,
26
+ thousandSeparator,
27
+ placeholder,
28
+ defaultValue,
29
+ min = -Infinity,
30
+ max = Infinity,
31
+ onValueChange,
32
+ fixedDecimalScale = false,
33
+ decimalScale = 0,
34
+ value: controlledValue,
35
+ ...props
36
+ },
37
+ ref
38
+ ) => {
39
+ const [value, setValue] = React.useState<number | undefined>(
40
+ controlledValue ?? defaultValue
41
+ );
42
+
43
+ React.useEffect(() => {
44
+ if (controlledValue !== undefined) {
45
+ setValue(controlledValue);
46
+ }
47
+ }, [controlledValue]);
48
+
49
+ const handleChange = (values: {
50
+ value: string;
51
+ floatValue: number | undefined;
52
+ }) => {
53
+ const newValue =
54
+ values.floatValue === undefined ? undefined : values.floatValue;
55
+ setValue(newValue);
56
+ if (onValueChange) {
57
+ onValueChange(newValue);
58
+ }
59
+ };
60
+
61
+ const handleBlur = () => {
62
+ if (value !== undefined) {
63
+ if (value < min) {
64
+ setValue(min);
65
+ (ref as React.RefObject<HTMLInputElement>).current!.value =
66
+ String(min);
67
+ } else if (value > max) {
68
+ setValue(max);
69
+ (ref as React.RefObject<HTMLInputElement>).current!.value =
70
+ String(max);
71
+ }
72
+ }
73
+ };
74
+
75
+ return (
76
+ <div className="flex flex-col items-start justify-start relative">
77
+ {label && (
78
+ <div className="text-zinc-600 mb-1 text-[11px] font-noto-sans-mono font-light">
79
+ {label}
80
+ </div>
81
+ )}
82
+
83
+ <div className="w-full flex items-center relative">
84
+ <NumericFormat
85
+ value={value}
86
+ onValueChange={handleChange}
87
+ thousandSeparator={thousandSeparator}
88
+ decimalScale={decimalScale}
89
+ fixedDecimalScale={fixedDecimalScale}
90
+ allowNegative={min < 0}
91
+ valueIsNumericString
92
+ onBlur={handleBlur}
93
+ max={max}
94
+ min={min}
95
+ customInput={Input}
96
+ placeholder={placeholder}
97
+ getInputRef={ref}
98
+ {...props}
99
+ className="w-full py-0 h-[32px] rounded-none !text-xs font-normal text-gray-700 text-right focus:outline-none bg-transparent shadow-none"
100
+ />
101
+ </div>
102
+ </div>
103
+ );
104
+ }
105
+ );
106
+
107
+ NumberInput.displayName = "NumberInput";
@@ -0,0 +1,119 @@
1
+ 'use client';
2
+
3
+ import React from 'react';
4
+ import { cn } from '@/lib/utils';
5
+ import { WeaveStateElement } from '@inditextech/weave-types';
6
+ import { InputNumber } from '../inputs/input-number';
7
+ import { useWeave } from '@inditextech/weave-react';
8
+ import { useCollaborationRoom } from '@/store/store';
9
+
10
+ export function AppearanceProperties() {
11
+ const instance = useWeave((state) => state.instance);
12
+ const node = useWeave((state) => state.selection.node);
13
+ const actualAction = useWeave((state) => state.actions.actual);
14
+
15
+ const nodePropertiesAction = useCollaborationRoom(
16
+ (state) => state.nodeProperties.action
17
+ );
18
+
19
+ const nodeCreateProps = useCollaborationRoom(
20
+ (state) => state.nodeProperties.createProps
21
+ );
22
+
23
+ const [actualNode, setActualNode] = React.useState<
24
+ WeaveStateElement | undefined
25
+ >(node);
26
+
27
+ React.useEffect(() => {
28
+ if (!instance) return;
29
+ if (actualAction && nodePropertiesAction === 'create') {
30
+ setActualNode({
31
+ key: 'creating',
32
+ type: 'undefined',
33
+ props: {
34
+ ...nodeCreateProps,
35
+ },
36
+ });
37
+ }
38
+ if (node && nodePropertiesAction === 'update') {
39
+ setActualNode(node);
40
+ }
41
+ if (!actualAction && !node) {
42
+ setActualNode(undefined);
43
+ }
44
+ }, [instance, actualAction, node, nodePropertiesAction, nodeCreateProps]);
45
+
46
+ const updateElement = React.useCallback(
47
+ (updatedNode: WeaveStateElement) => {
48
+ if (!instance) return;
49
+ if (actualAction && nodePropertiesAction === 'create') {
50
+ instance.updatePropsAction(actualAction, updatedNode.props);
51
+ }
52
+ if (nodePropertiesAction === 'update') {
53
+ instance.updateNode(updatedNode);
54
+ }
55
+ },
56
+ [instance, actualAction, nodePropertiesAction]
57
+ );
58
+
59
+ if (!instance || !actualAction || !actualNode) return null;
60
+
61
+ if (!actualAction && !actualNode) return null;
62
+
63
+ if (['colorTokenTool', 'frameTool'].includes(actualAction)) return null;
64
+
65
+ return (
66
+ <div className="border-b border-zinc-200">
67
+ <div className="w-full flex justify-between items-center gap-3 p-4 py-3">
68
+ <div className="cursor-pointer hover:no-underline items-center py-0">
69
+ <span className="text-xs font-noto-sans-mono font-light">
70
+ Appearance
71
+ </span>
72
+ </div>
73
+ </div>
74
+ <div className="px-4 pb-4">
75
+ <div className="grid grid-cols-2 gap-3 w-full">
76
+ <div
77
+ className={cn({
78
+ ['col-span-1']: ['rectangle'].includes(actualNode.type),
79
+ ['col-span-2']: !['rectangle'].includes(actualNode.type),
80
+ })}
81
+ >
82
+ <InputNumber
83
+ label="Opacity (%)"
84
+ max={100}
85
+ min={0}
86
+ value={(actualNode.props.opacity ?? 1) * 100}
87
+ onChange={(value) => {
88
+ const updatedNode: WeaveStateElement = {
89
+ ...actualNode,
90
+ props: {
91
+ ...actualNode.props,
92
+ opacity: value / 100,
93
+ },
94
+ };
95
+ updateElement(updatedNode);
96
+ }}
97
+ />
98
+ </div>
99
+ {['rectangle'].includes(actualNode.type) && (
100
+ <InputNumber
101
+ label="Corner Radius (px)"
102
+ value={actualNode.props.cornerRadius ?? 0}
103
+ onChange={(value) => {
104
+ const updatedNode: WeaveStateElement = {
105
+ ...actualNode,
106
+ props: {
107
+ ...actualNode.props,
108
+ cornerRadius: value,
109
+ },
110
+ };
111
+ updateElement(updatedNode);
112
+ }}
113
+ />
114
+ )}
115
+ </div>
116
+ </div>
117
+ </div>
118
+ );
119
+ }
@@ -0,0 +1,108 @@
1
+ 'use client';
2
+
3
+ import React from 'react';
4
+ import { WeaveStateElement } from '@inditextech/weave-types';
5
+ import { useWeave } from '@inditextech/weave-react';
6
+ import { useCollaborationRoom } from '@/store/store';
7
+ import { InputColor } from '../inputs/input-color';
8
+
9
+ export function ColorTokenProperties() {
10
+ const instance = useWeave((state) => state.instance);
11
+ const node = useWeave((state) => state.selection.node);
12
+ const actualAction = useWeave((state) => state.actions.actual);
13
+
14
+ const nodePropertiesAction = useCollaborationRoom(
15
+ (state) => state.nodeProperties.action
16
+ );
17
+
18
+ const nodeCreateProps = useCollaborationRoom(
19
+ (state) => state.nodeProperties.createProps
20
+ );
21
+
22
+ const [actualNode, setActualNode] = React.useState<
23
+ WeaveStateElement | undefined
24
+ >(node);
25
+
26
+ React.useEffect(() => {
27
+ if (!instance) return;
28
+ if (actualAction && nodePropertiesAction === 'create') {
29
+ setActualNode({
30
+ key: 'creating',
31
+ type: 'undefined',
32
+ props: {
33
+ ...nodeCreateProps,
34
+ },
35
+ });
36
+ }
37
+ if (node && nodePropertiesAction === 'update') {
38
+ setActualNode(node);
39
+ }
40
+ if (!actualAction && !node) {
41
+ setActualNode(undefined);
42
+ }
43
+ }, [instance, actualAction, node, nodePropertiesAction, nodeCreateProps]);
44
+
45
+ const updateElement = React.useCallback(
46
+ (updatedNode: WeaveStateElement) => {
47
+ if (!instance) return;
48
+ if (actualAction && nodePropertiesAction === 'create') {
49
+ instance.updatePropsAction(actualAction, updatedNode.props);
50
+ }
51
+ if (nodePropertiesAction === 'update') {
52
+ instance.updateNode(updatedNode);
53
+ }
54
+ },
55
+ [instance, actualAction, nodePropertiesAction]
56
+ );
57
+
58
+ if (!instance || !actualNode) return null;
59
+
60
+ if (!actualAction && !actualNode) return null;
61
+
62
+ if (
63
+ actualAction &&
64
+ ['selectionTool'].includes(actualAction) &&
65
+ !['colorToken'].includes(actualNode.type)
66
+ ) {
67
+ return null;
68
+ }
69
+
70
+ if (
71
+ actualAction &&
72
+ !['selectionTool', 'colorTokenTool'].includes(actualAction)
73
+ )
74
+ return null;
75
+
76
+ return (
77
+ <div className="border-b border-zinc-200">
78
+ <div className="w-full flex justify-between items-center gap-3 p-4 py-3">
79
+ <div className="cursor-pointer hover:no-underline items-center py-0">
80
+ <span className="text-xs font-noto-sans-mono font-light">
81
+ Color Token
82
+ </span>
83
+ </div>
84
+ </div>
85
+ <div className="px-4 pb-4">
86
+ <div className="grid grid-cols-1 gap-3 w-full">
87
+ <InputColor
88
+ label="Color (#RGB)"
89
+ value={`${(actualNode.props.colorToken ?? '#000000').replace(
90
+ '#',
91
+ ''
92
+ )}`}
93
+ onChange={(value) => {
94
+ const updatedNode: WeaveStateElement = {
95
+ ...actualNode,
96
+ props: {
97
+ ...actualNode.props,
98
+ colorToken: `#${value}`,
99
+ },
100
+ };
101
+ updateElement(updatedNode);
102
+ }}
103
+ />
104
+ </div>
105
+ </div>
106
+ </div>
107
+ );
108
+ }