@bigbluebutton/tlschema 2.0.0-alpha.19

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 (261) hide show
  1. package/LICENSE +190 -0
  2. package/dist-cjs/TLStore.js +133 -0
  3. package/dist-cjs/TLStore.js.map +7 -0
  4. package/dist-cjs/assets/TLBaseAsset.js +37 -0
  5. package/dist-cjs/assets/TLBaseAsset.js.map +7 -0
  6. package/dist-cjs/assets/TLBookmarkAsset.js +38 -0
  7. package/dist-cjs/assets/TLBookmarkAsset.js.map +7 -0
  8. package/dist-cjs/assets/TLImageAsset.js +76 -0
  9. package/dist-cjs/assets/TLImageAsset.js.map +7 -0
  10. package/dist-cjs/assets/TLVideoAsset.js +76 -0
  11. package/dist-cjs/assets/TLVideoAsset.js.map +7 -0
  12. package/dist-cjs/createPresenceStateDerivation.js +68 -0
  13. package/dist-cjs/createPresenceStateDerivation.js.map +7 -0
  14. package/dist-cjs/createTLSchema.js +68 -0
  15. package/dist-cjs/createTLSchema.js.map +7 -0
  16. package/dist-cjs/index.d.ts +1414 -0
  17. package/dist-cjs/index.js +142 -0
  18. package/dist-cjs/index.js.map +7 -0
  19. package/dist-cjs/misc/TLColor.js +36 -0
  20. package/dist-cjs/misc/TLColor.js.map +7 -0
  21. package/dist-cjs/misc/TLCursor.js +55 -0
  22. package/dist-cjs/misc/TLCursor.js.map +7 -0
  23. package/dist-cjs/misc/TLHandle.js +36 -0
  24. package/dist-cjs/misc/TLHandle.js.map +7 -0
  25. package/dist-cjs/misc/TLOpacity.js +30 -0
  26. package/dist-cjs/misc/TLOpacity.js.map +7 -0
  27. package/dist-cjs/misc/TLScribble.js +40 -0
  28. package/dist-cjs/misc/TLScribble.js.map +7 -0
  29. package/dist-cjs/misc/geometry-types.js +37 -0
  30. package/dist-cjs/misc/geometry-types.js.map +7 -0
  31. package/dist-cjs/misc/id-validator.js +33 -0
  32. package/dist-cjs/misc/id-validator.js.map +7 -0
  33. package/dist-cjs/records/TLAsset.js +74 -0
  34. package/dist-cjs/records/TLAsset.js.map +7 -0
  35. package/dist-cjs/records/TLCamera.js +74 -0
  36. package/dist-cjs/records/TLCamera.js.map +7 -0
  37. package/dist-cjs/records/TLDocument.js +82 -0
  38. package/dist-cjs/records/TLDocument.js.map +7 -0
  39. package/dist-cjs/records/TLInstance.js +452 -0
  40. package/dist-cjs/records/TLInstance.js.map +7 -0
  41. package/dist-cjs/records/TLPage.js +74 -0
  42. package/dist-cjs/records/TLPage.js.map +7 -0
  43. package/dist-cjs/records/TLPageState.js +209 -0
  44. package/dist-cjs/records/TLPageState.js.map +7 -0
  45. package/dist-cjs/records/TLPointer.js +76 -0
  46. package/dist-cjs/records/TLPointer.js.map +7 -0
  47. package/dist-cjs/records/TLPresence.js +170 -0
  48. package/dist-cjs/records/TLPresence.js.map +7 -0
  49. package/dist-cjs/records/TLRecord.js +17 -0
  50. package/dist-cjs/records/TLRecord.js.map +7 -0
  51. package/dist-cjs/records/TLShape.js +147 -0
  52. package/dist-cjs/records/TLShape.js.map +7 -0
  53. package/dist-cjs/shapes/TLArrowShape.js +156 -0
  54. package/dist-cjs/shapes/TLArrowShape.js.map +7 -0
  55. package/dist-cjs/shapes/TLBaseShape.js +52 -0
  56. package/dist-cjs/shapes/TLBaseShape.js.map +7 -0
  57. package/dist-cjs/shapes/TLBookmarkShape.js +57 -0
  58. package/dist-cjs/shapes/TLBookmarkShape.js.map +7 -0
  59. package/dist-cjs/shapes/TLDrawShape.js +89 -0
  60. package/dist-cjs/shapes/TLDrawShape.js.map +7 -0
  61. package/dist-cjs/shapes/TLEmbedShape.js +709 -0
  62. package/dist-cjs/shapes/TLEmbedShape.js.map +7 -0
  63. package/dist-cjs/shapes/TLFrameShape.js +33 -0
  64. package/dist-cjs/shapes/TLFrameShape.js.map +7 -0
  65. package/dist-cjs/shapes/TLGeoShape.js +230 -0
  66. package/dist-cjs/shapes/TLGeoShape.js.map +7 -0
  67. package/dist-cjs/shapes/TLGroupShape.js +28 -0
  68. package/dist-cjs/shapes/TLGroupShape.js.map +7 -0
  69. package/dist-cjs/shapes/TLHighlightShape.js +38 -0
  70. package/dist-cjs/shapes/TLHighlightShape.js.map +7 -0
  71. package/dist-cjs/shapes/TLImageShape.js +69 -0
  72. package/dist-cjs/shapes/TLImageShape.js.map +7 -0
  73. package/dist-cjs/shapes/TLLineShape.js +70 -0
  74. package/dist-cjs/shapes/TLLineShape.js.map +7 -0
  75. package/dist-cjs/shapes/TLNoteShape.js +144 -0
  76. package/dist-cjs/shapes/TLNoteShape.js.map +7 -0
  77. package/dist-cjs/shapes/TLTextShape.js +67 -0
  78. package/dist-cjs/shapes/TLTextShape.js.map +7 -0
  79. package/dist-cjs/shapes/TLVideoShape.js +53 -0
  80. package/dist-cjs/shapes/TLVideoShape.js.map +7 -0
  81. package/dist-cjs/store-migrations.js +81 -0
  82. package/dist-cjs/store-migrations.js.map +7 -0
  83. package/dist-cjs/styles/StyleProp.js +94 -0
  84. package/dist-cjs/styles/StyleProp.js.map +7 -0
  85. package/dist-cjs/styles/TLColorStyle.js +283 -0
  86. package/dist-cjs/styles/TLColorStyle.js.map +7 -0
  87. package/dist-cjs/styles/TLDashStyle.js +29 -0
  88. package/dist-cjs/styles/TLDashStyle.js.map +7 -0
  89. package/dist-cjs/styles/TLFillStyle.js +29 -0
  90. package/dist-cjs/styles/TLFillStyle.js.map +7 -0
  91. package/dist-cjs/styles/TLFontStyle.js +36 -0
  92. package/dist-cjs/styles/TLFontStyle.js.map +7 -0
  93. package/dist-cjs/styles/TLHorizontalAlignStyle.js +29 -0
  94. package/dist-cjs/styles/TLHorizontalAlignStyle.js.map +7 -0
  95. package/dist-cjs/styles/TLSizeStyle.js +29 -0
  96. package/dist-cjs/styles/TLSizeStyle.js.map +7 -0
  97. package/dist-cjs/styles/TLVerticalAlignStyle.js +29 -0
  98. package/dist-cjs/styles/TLVerticalAlignStyle.js.map +7 -0
  99. package/dist-cjs/translations/languages.js +59 -0
  100. package/dist-cjs/translations/languages.js.map +7 -0
  101. package/dist-cjs/translations/translations.js +63 -0
  102. package/dist-cjs/translations/translations.js.map +7 -0
  103. package/dist-cjs/util-types.js +17 -0
  104. package/dist-cjs/util-types.js.map +7 -0
  105. package/dist-esm/TLStore.mjs +113 -0
  106. package/dist-esm/TLStore.mjs.map +7 -0
  107. package/dist-esm/assets/TLBaseAsset.mjs +17 -0
  108. package/dist-esm/assets/TLBaseAsset.mjs.map +7 -0
  109. package/dist-esm/assets/TLBookmarkAsset.mjs +18 -0
  110. package/dist-esm/assets/TLBookmarkAsset.mjs.map +7 -0
  111. package/dist-esm/assets/TLImageAsset.mjs +56 -0
  112. package/dist-esm/assets/TLImageAsset.mjs.map +7 -0
  113. package/dist-esm/assets/TLVideoAsset.mjs +56 -0
  114. package/dist-esm/assets/TLVideoAsset.mjs.map +7 -0
  115. package/dist-esm/createPresenceStateDerivation.mjs +48 -0
  116. package/dist-esm/createPresenceStateDerivation.mjs.map +7 -0
  117. package/dist-esm/createTLSchema.mjs +48 -0
  118. package/dist-esm/createTLSchema.mjs.map +7 -0
  119. package/dist-esm/index.d.mts +1414 -0
  120. package/dist-esm/index.mjs +193 -0
  121. package/dist-esm/index.mjs.map +7 -0
  122. package/dist-esm/misc/TLColor.mjs +16 -0
  123. package/dist-esm/misc/TLColor.mjs.map +7 -0
  124. package/dist-esm/misc/TLCursor.mjs +35 -0
  125. package/dist-esm/misc/TLCursor.mjs.map +7 -0
  126. package/dist-esm/misc/TLHandle.mjs +16 -0
  127. package/dist-esm/misc/TLHandle.mjs.map +7 -0
  128. package/dist-esm/misc/TLOpacity.mjs +10 -0
  129. package/dist-esm/misc/TLOpacity.mjs.map +7 -0
  130. package/dist-esm/misc/TLScribble.mjs +20 -0
  131. package/dist-esm/misc/TLScribble.mjs.map +7 -0
  132. package/dist-esm/misc/geometry-types.mjs +17 -0
  133. package/dist-esm/misc/geometry-types.mjs.map +7 -0
  134. package/dist-esm/misc/id-validator.mjs +13 -0
  135. package/dist-esm/misc/id-validator.mjs.map +7 -0
  136. package/dist-esm/records/TLAsset.mjs +57 -0
  137. package/dist-esm/records/TLAsset.mjs.map +7 -0
  138. package/dist-esm/records/TLCamera.mjs +54 -0
  139. package/dist-esm/records/TLCamera.mjs.map +7 -0
  140. package/dist-esm/records/TLDocument.mjs +62 -0
  141. package/dist-esm/records/TLDocument.mjs.map +7 -0
  142. package/dist-esm/records/TLInstance.mjs +432 -0
  143. package/dist-esm/records/TLInstance.mjs.map +7 -0
  144. package/dist-esm/records/TLPage.mjs +54 -0
  145. package/dist-esm/records/TLPage.mjs.map +7 -0
  146. package/dist-esm/records/TLPageState.mjs +189 -0
  147. package/dist-esm/records/TLPageState.mjs.map +7 -0
  148. package/dist-esm/records/TLPointer.mjs +56 -0
  149. package/dist-esm/records/TLPointer.mjs.map +7 -0
  150. package/dist-esm/records/TLPresence.mjs +150 -0
  151. package/dist-esm/records/TLPresence.mjs.map +7 -0
  152. package/dist-esm/records/TLRecord.mjs +1 -0
  153. package/dist-esm/records/TLRecord.mjs.map +7 -0
  154. package/dist-esm/records/TLShape.mjs +127 -0
  155. package/dist-esm/records/TLShape.mjs.map +7 -0
  156. package/dist-esm/shapes/TLArrowShape.mjs +136 -0
  157. package/dist-esm/shapes/TLArrowShape.mjs.map +7 -0
  158. package/dist-esm/shapes/TLBaseShape.mjs +32 -0
  159. package/dist-esm/shapes/TLBaseShape.mjs.map +7 -0
  160. package/dist-esm/shapes/TLBookmarkShape.mjs +37 -0
  161. package/dist-esm/shapes/TLBookmarkShape.mjs.map +7 -0
  162. package/dist-esm/shapes/TLDrawShape.mjs +69 -0
  163. package/dist-esm/shapes/TLDrawShape.mjs.map +7 -0
  164. package/dist-esm/shapes/TLEmbedShape.mjs +689 -0
  165. package/dist-esm/shapes/TLEmbedShape.mjs.map +7 -0
  166. package/dist-esm/shapes/TLFrameShape.mjs +13 -0
  167. package/dist-esm/shapes/TLFrameShape.mjs.map +7 -0
  168. package/dist-esm/shapes/TLGeoShape.mjs +212 -0
  169. package/dist-esm/shapes/TLGeoShape.mjs.map +7 -0
  170. package/dist-esm/shapes/TLGroupShape.mjs +8 -0
  171. package/dist-esm/shapes/TLGroupShape.mjs.map +7 -0
  172. package/dist-esm/shapes/TLHighlightShape.mjs +18 -0
  173. package/dist-esm/shapes/TLHighlightShape.mjs.map +7 -0
  174. package/dist-esm/shapes/TLImageShape.mjs +49 -0
  175. package/dist-esm/shapes/TLImageShape.mjs.map +7 -0
  176. package/dist-esm/shapes/TLLineShape.mjs +50 -0
  177. package/dist-esm/shapes/TLLineShape.mjs.map +7 -0
  178. package/dist-esm/shapes/TLNoteShape.mjs +126 -0
  179. package/dist-esm/shapes/TLNoteShape.mjs.map +7 -0
  180. package/dist-esm/shapes/TLTextShape.mjs +47 -0
  181. package/dist-esm/shapes/TLTextShape.mjs.map +7 -0
  182. package/dist-esm/shapes/TLVideoShape.mjs +33 -0
  183. package/dist-esm/shapes/TLVideoShape.mjs.map +7 -0
  184. package/dist-esm/store-migrations.mjs +61 -0
  185. package/dist-esm/store-migrations.mjs.map +7 -0
  186. package/dist-esm/styles/StyleProp.mjs +74 -0
  187. package/dist-esm/styles/StyleProp.mjs.map +7 -0
  188. package/dist-esm/styles/TLColorStyle.mjs +263 -0
  189. package/dist-esm/styles/TLColorStyle.mjs.map +7 -0
  190. package/dist-esm/styles/TLDashStyle.mjs +9 -0
  191. package/dist-esm/styles/TLDashStyle.mjs.map +7 -0
  192. package/dist-esm/styles/TLFillStyle.mjs +9 -0
  193. package/dist-esm/styles/TLFillStyle.mjs.map +7 -0
  194. package/dist-esm/styles/TLFontStyle.mjs +16 -0
  195. package/dist-esm/styles/TLFontStyle.mjs.map +7 -0
  196. package/dist-esm/styles/TLHorizontalAlignStyle.mjs +9 -0
  197. package/dist-esm/styles/TLHorizontalAlignStyle.mjs.map +7 -0
  198. package/dist-esm/styles/TLSizeStyle.mjs +9 -0
  199. package/dist-esm/styles/TLSizeStyle.mjs.map +7 -0
  200. package/dist-esm/styles/TLVerticalAlignStyle.mjs +9 -0
  201. package/dist-esm/styles/TLVerticalAlignStyle.mjs.map +7 -0
  202. package/dist-esm/translations/languages.mjs +39 -0
  203. package/dist-esm/translations/languages.mjs.map +7 -0
  204. package/dist-esm/translations/translations.mjs +43 -0
  205. package/dist-esm/translations/translations.mjs.map +7 -0
  206. package/dist-esm/util-types.mjs +1 -0
  207. package/dist-esm/util-types.mjs.map +7 -0
  208. package/package.json +64 -0
  209. package/src/TLStore.ts +160 -0
  210. package/src/assets/TLBaseAsset.ts +44 -0
  211. package/src/assets/TLBookmarkAsset.ts +31 -0
  212. package/src/assets/TLImageAsset.ts +73 -0
  213. package/src/assets/TLVideoAsset.ts +73 -0
  214. package/src/createPresenceStateDerivation.ts +53 -0
  215. package/src/createTLSchema.ts +65 -0
  216. package/src/index.ts +168 -0
  217. package/src/migrations.test.ts +1768 -0
  218. package/src/misc/TLColor.ts +28 -0
  219. package/src/misc/TLCursor.ts +54 -0
  220. package/src/misc/TLHandle.ts +41 -0
  221. package/src/misc/TLOpacity.ts +11 -0
  222. package/src/misc/TLScribble.ts +39 -0
  223. package/src/misc/geometry-types.ts +37 -0
  224. package/src/misc/id-validator.ts +14 -0
  225. package/src/records/TLAsset.ts +80 -0
  226. package/src/records/TLCamera.ts +74 -0
  227. package/src/records/TLDocument.ts +77 -0
  228. package/src/records/TLInstance.ts +493 -0
  229. package/src/records/TLPage.ts +72 -0
  230. package/src/records/TLPageState.ts +216 -0
  231. package/src/records/TLPointer.ts +74 -0
  232. package/src/records/TLPresence.ts +179 -0
  233. package/src/records/TLRecord.ts +21 -0
  234. package/src/records/TLShape.ts +214 -0
  235. package/src/shapes/TLArrowShape.ts +160 -0
  236. package/src/shapes/TLBaseShape.ts +67 -0
  237. package/src/shapes/TLBookmarkShape.ts +44 -0
  238. package/src/shapes/TLDrawShape.ts +89 -0
  239. package/src/shapes/TLEmbedShape.ts +754 -0
  240. package/src/shapes/TLFrameShape.ts +18 -0
  241. package/src/shapes/TLGeoShape.ts +226 -0
  242. package/src/shapes/TLGroupShape.ts +14 -0
  243. package/src/shapes/TLHighlightShape.ts +24 -0
  244. package/src/shapes/TLImageShape.ts +59 -0
  245. package/src/shapes/TLLineShape.ts +61 -0
  246. package/src/shapes/TLNoteShape.ts +137 -0
  247. package/src/shapes/TLTextShape.ts +55 -0
  248. package/src/shapes/TLVideoShape.ts +40 -0
  249. package/src/store-migrations.ts +63 -0
  250. package/src/styles/StyleProp.ts +105 -0
  251. package/src/styles/TLColorStyle.ts +296 -0
  252. package/src/styles/TLDashStyle.ts +11 -0
  253. package/src/styles/TLFillStyle.ts +11 -0
  254. package/src/styles/TLFontStyle.ts +19 -0
  255. package/src/styles/TLHorizontalAlignStyle.ts +11 -0
  256. package/src/styles/TLSizeStyle.ts +11 -0
  257. package/src/styles/TLVerticalAlignStyle.ts +11 -0
  258. package/src/translations/languages.ts +39 -0
  259. package/src/translations/translations.test.ts +43 -0
  260. package/src/translations/translations.ts +73 -0
  261. package/src/util-types.ts +2 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/shapes/TLEmbedShape.ts"],
4
+ "sourcesContent": ["import { defineMigrations } from '@bigbluebutton/store'\nimport { T } from '@bigbluebutton/validate'\nimport { ShapePropsType, TLBaseShape } from './TLBaseShape'\n\n// Only allow multiplayer embeds. If we add additional routes later for example '/help' this won't match\nconst TLDRAW_APP_RE = /(^\\/r\\/[^/]+\\/?$)/\n\nconst safeParseUrl = (url: string) => {\n\ttry {\n\t\treturn new URL(url)\n\t} catch (err) {\n\t\treturn\n\t}\n}\n\n/** @public */\nexport const EMBED_DEFINITIONS = [\n\t{\n\t\ttype: 'tldraw',\n\t\ttitle: 'tldraw',\n\t\thostnames: ['beta.tldraw.com', 'tldraw.com'],\n\t\tminWidth: 300,\n\t\tminHeight: 300,\n\t\twidth: 720,\n\t\theight: 500,\n\t\tdoesResize: true,\n\t\tcanUnmount: true,\n\t\ttoEmbedUrl: (url) => {\n\t\t\tconst urlObj = safeParseUrl(url)\n\t\t\tif (urlObj && urlObj.pathname.match(TLDRAW_APP_RE)) {\n\t\t\t\treturn url\n\t\t\t}\n\t\t\treturn\n\t\t},\n\t\tfromEmbedUrl: (url) => {\n\t\t\tconst urlObj = safeParseUrl(url)\n\t\t\tif (urlObj && urlObj.pathname.match(TLDRAW_APP_RE)) {\n\t\t\t\treturn url\n\t\t\t}\n\t\t\treturn\n\t\t},\n\t},\n\t{\n\t\ttype: 'figma',\n\t\ttitle: 'Figma',\n\t\thostnames: ['figma.com'],\n\t\twidth: 720,\n\t\theight: 500,\n\t\tdoesResize: true,\n\t\tcanUnmount: true,\n\t\ttoEmbedUrl: (url) => {\n\t\t\tif (\n\t\t\t\t!!url.match(\n\t\t\t\t\t// eslint-disable-next-line no-useless-escape\n\t\t\t\t\t/https:\\/\\/([\\w\\.-]+\\.)?figma.com\\/(file|proto)\\/([0-9a-zA-Z]{22,128})(?:\\/.*)?$/\n\t\t\t\t) &&\n\t\t\t\t!url.includes('figma.com/embed')\n\t\t\t) {\n\t\t\t\treturn `https://www.figma.com/embed?embed_host=share&url=${url}`\n\t\t\t}\n\t\t\treturn\n\t\t},\n\t\tfromEmbedUrl: (url) => {\n\t\t\tconst urlObj = safeParseUrl(url)\n\t\t\tif (urlObj && urlObj.pathname.match(/^\\/embed\\/?$/)) {\n\t\t\t\tconst outUrl = urlObj.searchParams.get('url')\n\t\t\t\tif (outUrl) {\n\t\t\t\t\treturn outUrl\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn\n\t\t},\n\t},\n\t{\n\t\ttype: 'google_maps',\n\t\ttitle: 'Google Maps',\n\t\thostnames: ['google.*'],\n\t\twidth: 720,\n\t\theight: 500,\n\t\tdoesResize: true,\n\t\tcanUnmount: false,\n\t\ttoEmbedUrl: (url) => {\n\t\t\tif (url.includes('/maps/')) {\n\t\t\t\tconst match = url.match(/@(.*),(.*),(.*)z/)\n\t\t\t\tlet result: string\n\t\t\t\tif (match) {\n\t\t\t\t\tconst [, lat, lng, z] = match\n\t\t\t\t\tconst host = new URL(url).host.replace('www.', '')\n\t\t\t\t\tresult = `https://${host}/maps/embed/v1/view?key=${process.env.NEXT_PUBLIC_GC_API_KEY}&center=${lat},${lng}&zoom=${z}`\n\t\t\t\t} else {\n\t\t\t\t\tresult = ''\n\t\t\t\t}\n\n\t\t\t\treturn result\n\t\t\t}\n\t\t\treturn\n\t\t},\n\t\tfromEmbedUrl: (url) => {\n\t\t\tconst urlObj = safeParseUrl(url)\n\t\t\tif (!urlObj) return\n\n\t\t\tconst matches = urlObj.pathname.match(/^\\/maps\\/embed\\/v1\\/view\\/?$/)\n\t\t\tif (matches && urlObj.searchParams.has('center') && urlObj.searchParams.get('zoom')) {\n\t\t\t\tconst zoom = urlObj.searchParams.get('zoom')\n\t\t\t\tconst [lat, lon] = urlObj.searchParams.get('center')!.split(',')\n\t\t\t\treturn `https://www.google.com/maps/@${lat},${lon},${zoom}z`\n\t\t\t}\n\t\t\treturn\n\t\t},\n\t},\n\t{\n\t\ttype: 'val_town',\n\t\ttitle: 'Val Town',\n\t\thostnames: ['val.town'],\n\t\tminWidth: 260,\n\t\tminHeight: 100,\n\t\twidth: 720,\n\t\theight: 500,\n\t\tdoesResize: true,\n\t\tcanUnmount: false,\n\t\ttoEmbedUrl: (url) => {\n\t\t\tconst urlObj = safeParseUrl(url)\n\t\t\t// e.g. extract \"steveruizok.mathFact\" from https://www.val.town/v/steveruizok.mathFact\n\t\t\tconst matches = urlObj && urlObj.pathname.match(/\\/v\\/([^/]+)\\/?/)\n\t\t\tif (matches) {\n\t\t\t\treturn `https://www.val.town/embed/${matches[1]}`\n\t\t\t}\n\t\t\treturn\n\t\t},\n\t\tfromEmbedUrl: (url) => {\n\t\t\tconst urlObj = safeParseUrl(url)\n\t\t\t// e.g. extract \"steveruizok.mathFact\" from https://www.val.town/v/steveruizok.mathFact\n\t\t\tconst matches = urlObj && urlObj.pathname.match(/\\/embed\\/([^/]+)\\/?/)\n\t\t\tif (matches) {\n\t\t\t\treturn `https://www.val.town/v/${matches[1]}`\n\t\t\t}\n\t\t\treturn\n\t\t},\n\t},\n\t{\n\t\ttype: 'codesandbox',\n\t\ttitle: 'CodeSandbox',\n\t\thostnames: ['codesandbox.io'],\n\t\tminWidth: 300,\n\t\tminHeight: 300,\n\t\twidth: 720,\n\t\theight: 500,\n\t\tdoesResize: true,\n\t\tcanUnmount: false,\n\t\ttoEmbedUrl: (url) => {\n\t\t\tconst urlObj = safeParseUrl(url)\n\t\t\tconst matches = urlObj && urlObj.pathname.match(/\\/s\\/([^/]+)\\/?/)\n\t\t\tif (matches) {\n\t\t\t\treturn `https://codesandbox.io/embed/${matches[1]}`\n\t\t\t}\n\t\t\treturn\n\t\t},\n\t\tfromEmbedUrl: (url) => {\n\t\t\tconst urlObj = safeParseUrl(url)\n\t\t\tconst matches = urlObj && urlObj.pathname.match(/\\/embed\\/([^/]+)\\/?/)\n\t\t\tif (matches) {\n\t\t\t\treturn `https://codesandbox.io/s/${matches[1]}`\n\t\t\t}\n\t\t\treturn\n\t\t},\n\t},\n\t{\n\t\ttype: 'codepen',\n\t\ttitle: 'Codepen',\n\t\thostnames: ['codepen.io'],\n\t\tminWidth: 300,\n\t\tminHeight: 300,\n\t\twidth: 520,\n\t\theight: 400,\n\t\tdoesResize: true,\n\t\tcanUnmount: false,\n\t\ttoEmbedUrl: (url) => {\n\t\t\tconst CODEPEN_URL_REGEXP = /https:\\/\\/codepen.io\\/([^/]+)\\/pen\\/([^/]+)/\n\t\t\tconst matches = url.match(CODEPEN_URL_REGEXP)\n\t\t\tif (matches) {\n\t\t\t\tconst [_, user, id] = matches\n\t\t\t\treturn `https://codepen.io/${user}/embed/${id}`\n\t\t\t}\n\t\t\treturn\n\t\t},\n\t\tfromEmbedUrl: (url) => {\n\t\t\tconst CODEPEN_EMBED_REGEXP = /https:\\/\\/codepen.io\\/([^/]+)\\/embed\\/([^/]+)/\n\t\t\tconst matches = url.match(CODEPEN_EMBED_REGEXP)\n\t\t\tif (matches) {\n\t\t\t\tconst [_, user, id] = matches\n\t\t\t\treturn `https://codepen.io/${user}/pen/${id}`\n\t\t\t}\n\t\t\treturn\n\t\t},\n\t},\n\t{\n\t\ttype: 'scratch',\n\t\ttitle: 'Scratch',\n\t\thostnames: ['scratch.mit.edu'],\n\t\twidth: 520,\n\t\theight: 400,\n\t\tdoesResize: false,\n\t\tcanUnmount: false,\n\t\ttoEmbedUrl: (url) => {\n\t\t\tconst SCRATCH_URL_REGEXP = /https?:\\/\\/scratch.mit.edu\\/projects\\/([^/]+)/\n\t\t\tconst matches = url.match(SCRATCH_URL_REGEXP)\n\t\t\tif (matches) {\n\t\t\t\tconst [_, id] = matches\n\t\t\t\treturn `https://scratch.mit.edu/projects/embed/${id}`\n\t\t\t}\n\t\t\treturn\n\t\t},\n\t\tfromEmbedUrl: (url) => {\n\t\t\tconst SCRATCH_EMBED_REGEXP = /https:\\/\\/scratch.mit.edu\\/projects\\/embed\\/([^/]+)/\n\t\t\tconst matches = url.match(SCRATCH_EMBED_REGEXP)\n\t\t\tif (matches) {\n\t\t\t\tconst [_, id] = matches\n\t\t\t\treturn `https://scratch.mit.edu/projects/${id}`\n\t\t\t}\n\t\t\treturn\n\t\t},\n\t},\n\t{\n\t\ttype: 'youtube',\n\t\ttitle: 'YouTube',\n\t\thostnames: ['*.youtube.com', 'youtube.com', 'youtu.be'],\n\t\twidth: 800,\n\t\theight: 450,\n\t\tdoesResize: true,\n\t\tcanUnmount: false,\n\t\toverridePermissions: {\n\t\t\t'allow-presentation': true,\n\t\t},\n\t\tisAspectRatioLocked: true,\n\t\ttoEmbedUrl: (url) => {\n\t\t\tconst urlObj = safeParseUrl(url)\n\t\t\tif (!urlObj) return\n\n\t\t\tconst hostname = urlObj.hostname.replace(/^www./, '')\n\t\t\tif (hostname === 'youtu.be') {\n\t\t\t\tconst videoId = urlObj.pathname.split('/').filter(Boolean)[0]\n\t\t\t\treturn `https://www.youtube.com/embed/${videoId}`\n\t\t\t} else if (\n\t\t\t\t(hostname === 'youtube.com' || hostname === 'm.youtube.com') &&\n\t\t\t\turlObj.pathname.match(/^\\/watch/)\n\t\t\t) {\n\t\t\t\tconst videoId = urlObj.searchParams.get('v')\n\t\t\t\treturn `https://www.youtube.com/embed/${videoId}`\n\t\t\t}\n\t\t\treturn\n\t\t},\n\t\tfromEmbedUrl: (url) => {\n\t\t\tconst urlObj = safeParseUrl(url)\n\t\t\tif (!urlObj) return\n\n\t\t\tconst hostname = urlObj.hostname.replace(/^www./, '')\n\t\t\tif (hostname === 'youtube.com') {\n\t\t\t\tconst matches = urlObj.pathname.match(/^\\/embed\\/([^/]+)\\/?/)\n\t\t\t\tif (matches) {\n\t\t\t\t\treturn `https://www.youtube.com/watch?v=${matches[1]}`\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn\n\t\t},\n\t},\n\t{\n\t\ttype: 'google_calendar',\n\t\ttitle: 'Google Calendar',\n\t\thostnames: ['calendar.google.*'],\n\t\twidth: 720,\n\t\theight: 500,\n\t\tminWidth: 460,\n\t\tminHeight: 360,\n\t\tdoesResize: true,\n\t\tcanUnmount: false,\n\t\tinstructionLink: 'https://support.google.com/calendar/answer/41207?hl=en',\n\t\ttoEmbedUrl: (url) => {\n\t\t\tconst urlObj = safeParseUrl(url)\n\t\t\tconst cidQs = urlObj?.searchParams.get('cid')\n\n\t\t\tif (urlObj?.pathname.match(/\\/calendar\\/u\\/0/) && cidQs) {\n\t\t\t\turlObj.pathname = '/calendar/embed'\n\n\t\t\t\tconst keys = Array.from(urlObj.searchParams.keys())\n\t\t\t\tfor (const key of keys) {\n\t\t\t\t\turlObj.searchParams.delete(key)\n\t\t\t\t}\n\t\t\t\turlObj.searchParams.set('src', cidQs)\n\t\t\t\treturn urlObj.href\n\t\t\t}\n\t\t\treturn\n\t\t},\n\t\tfromEmbedUrl: (url) => {\n\t\t\tconst urlObj = safeParseUrl(url)\n\t\t\tconst srcQs = urlObj?.searchParams.get('src')\n\n\t\t\tif (urlObj?.pathname.match(/\\/calendar\\/embed/) && srcQs) {\n\t\t\t\turlObj.pathname = '/calendar/u/0'\n\t\t\t\tconst keys = Array.from(urlObj.searchParams.keys())\n\t\t\t\tfor (const key of keys) {\n\t\t\t\t\turlObj.searchParams.delete(key)\n\t\t\t\t}\n\t\t\t\turlObj.searchParams.set('cid', srcQs)\n\t\t\t\treturn urlObj.href\n\t\t\t}\n\t\t\treturn\n\t\t},\n\t},\n\t{\n\t\ttype: 'google_slides',\n\t\ttitle: 'Google Slides',\n\t\thostnames: ['docs.google.*'],\n\t\twidth: 720,\n\t\theight: 500,\n\t\tminWidth: 460,\n\t\tminHeight: 360,\n\t\tdoesResize: true,\n\t\tcanUnmount: false,\n\t\ttoEmbedUrl: (url) => {\n\t\t\tconst urlObj = safeParseUrl(url)\n\n\t\t\tif (urlObj?.pathname.match(/^\\/presentation/) && urlObj?.pathname.match(/\\/pub\\/?$/)) {\n\t\t\t\turlObj.pathname = urlObj.pathname.replace(/\\/pub$/, '/embed')\n\t\t\t\tconst keys = Array.from(urlObj.searchParams.keys())\n\t\t\t\tfor (const key of keys) {\n\t\t\t\t\turlObj.searchParams.delete(key)\n\t\t\t\t}\n\t\t\t\treturn urlObj.href\n\t\t\t}\n\t\t\treturn\n\t\t},\n\t\tfromEmbedUrl: (url) => {\n\t\t\tconst urlObj = safeParseUrl(url)\n\n\t\t\tif (urlObj?.pathname.match(/^\\/presentation/) && urlObj?.pathname.match(/\\/embed\\/?$/)) {\n\t\t\t\turlObj.pathname = urlObj.pathname.replace(/\\/embed$/, '/pub')\n\t\t\t\tconst keys = Array.from(urlObj.searchParams.keys())\n\t\t\t\tfor (const key of keys) {\n\t\t\t\t\turlObj.searchParams.delete(key)\n\t\t\t\t}\n\t\t\t\treturn urlObj.href\n\t\t\t}\n\t\t\treturn\n\t\t},\n\t},\n\t{\n\t\ttype: 'github_gist',\n\t\ttitle: 'GitHub Gist',\n\t\thostnames: ['gist.github.com'],\n\t\twidth: 720,\n\t\theight: 500,\n\t\tdoesResize: true,\n\t\tcanUnmount: true,\n\t\ttoEmbedUrl: (url) => {\n\t\t\tconst urlObj = safeParseUrl(url)\n\t\t\tif (urlObj && urlObj.pathname.match(/\\/([^/]+)\\/([^/]+)/)) {\n\t\t\t\tif (!url.split('/').pop()) return\n\t\t\t\treturn url\n\t\t\t}\n\t\t\treturn\n\t\t},\n\t\tfromEmbedUrl: (url) => {\n\t\t\tconst urlObj = safeParseUrl(url)\n\t\t\tif (urlObj && urlObj.pathname.match(/\\/([^/]+)\\/([^/]+)/)) {\n\t\t\t\tif (!url.split('/').pop()) return\n\t\t\t\treturn url\n\t\t\t}\n\t\t\treturn\n\t\t},\n\t},\n\t{\n\t\ttype: 'replit',\n\t\ttitle: 'Replit',\n\t\thostnames: ['replit.com'],\n\t\twidth: 720,\n\t\theight: 500,\n\t\tdoesResize: true,\n\t\tcanUnmount: false,\n\t\ttoEmbedUrl: (url) => {\n\t\t\tconst urlObj = safeParseUrl(url)\n\t\t\tif (urlObj && urlObj.pathname.match(/\\/@([^/]+)\\/([^/]+)/)) {\n\t\t\t\treturn `${url}?embed=true`\n\t\t\t}\n\t\t\treturn\n\t\t},\n\t\tfromEmbedUrl: (url) => {\n\t\t\tconst urlObj = safeParseUrl(url)\n\t\t\tif (\n\t\t\t\turlObj &&\n\t\t\t\turlObj.pathname.match(/\\/@([^/]+)\\/([^/]+)/) &&\n\t\t\t\turlObj.searchParams.has('embed')\n\t\t\t) {\n\t\t\t\turlObj.searchParams.delete('embed')\n\t\t\t\treturn urlObj.href\n\t\t\t}\n\t\t\treturn\n\t\t},\n\t},\n\t{\n\t\ttype: 'felt',\n\t\ttitle: 'Felt',\n\t\thostnames: ['felt.com'],\n\t\twidth: 720,\n\t\theight: 500,\n\t\tdoesResize: true,\n\t\tcanUnmount: false,\n\t\ttoEmbedUrl: (url) => {\n\t\t\tconst urlObj = safeParseUrl(url)\n\t\t\tif (urlObj && urlObj.pathname.match(/^\\/map\\//)) {\n\t\t\t\treturn urlObj.origin + '/embed' + urlObj.pathname\n\t\t\t}\n\t\t\treturn\n\t\t},\n\t\tfromEmbedUrl: (url) => {\n\t\t\tconst urlObj = safeParseUrl(url)\n\t\t\tif (urlObj && urlObj.pathname.match(/^\\/embed\\/map\\//)) {\n\t\t\t\turlObj.pathname = urlObj.pathname.replace(/^\\/embed/, '')\n\t\t\t\treturn urlObj.href\n\t\t\t}\n\t\t\treturn\n\t\t},\n\t},\n\t{\n\t\ttype: 'spotify',\n\t\ttitle: 'Spotify',\n\t\thostnames: ['open.spotify.com'],\n\t\twidth: 720,\n\t\theight: 500,\n\t\tminHeight: 500,\n\t\toverrideOutlineRadius: 12,\n\t\tdoesResize: true,\n\t\tcanUnmount: false,\n\t\ttoEmbedUrl: (url) => {\n\t\t\tconst urlObj = safeParseUrl(url)\n\t\t\tif (urlObj && urlObj.pathname.match(/^\\/(artist|album)\\//)) {\n\t\t\t\treturn urlObj.origin + '/embed' + urlObj.pathname\n\t\t\t}\n\t\t\treturn\n\t\t},\n\t\tfromEmbedUrl: (url) => {\n\t\t\tconst urlObj = safeParseUrl(url)\n\t\t\tif (urlObj && urlObj.pathname.match(/^\\/embed\\/(artist|album)\\//)) {\n\t\t\t\treturn urlObj.origin + urlObj.pathname.replace(/^\\/embed/, '')\n\t\t\t}\n\t\t\treturn\n\t\t},\n\t},\n\t{\n\t\ttype: 'vimeo',\n\t\ttitle: 'Vimeo',\n\t\thostnames: ['vimeo.com', 'player.vimeo.com'],\n\t\twidth: 640,\n\t\theight: 360,\n\t\tdoesResize: true,\n\t\tcanUnmount: false,\n\t\tisAspectRatioLocked: true,\n\t\ttoEmbedUrl: (url) => {\n\t\t\tconst urlObj = safeParseUrl(url)\n\t\t\tif (urlObj && urlObj.hostname === 'vimeo.com') {\n\t\t\t\tif (urlObj.pathname.match(/^\\/[0-9]+/)) {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t'https://player.vimeo.com/video/' + urlObj.pathname.split('/')[1] + '?title=0&byline=0'\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn\n\t\t},\n\t\tfromEmbedUrl: (url) => {\n\t\t\tconst urlObj = safeParseUrl(url)\n\t\t\tif (urlObj && urlObj.hostname === 'player.vimeo.com') {\n\t\t\t\tconst matches = urlObj.pathname.match(/^\\/video\\/([^/]+)\\/?$/)\n\t\t\t\tif (matches) {\n\t\t\t\t\treturn 'https://vimeo.com/' + matches[1]\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn\n\t\t},\n\t},\n\t{\n\t\ttype: 'excalidraw',\n\t\ttitle: 'Excalidraw',\n\t\thostnames: ['excalidraw.com'],\n\t\twidth: 720,\n\t\theight: 500,\n\t\tdoesResize: true,\n\t\tcanUnmount: false,\n\t\tisAspectRatioLocked: true,\n\t\ttoEmbedUrl: (url) => {\n\t\t\tconst urlObj = safeParseUrl(url)\n\t\t\tif (urlObj && urlObj.hash.match(/#room=/)) {\n\t\t\t\treturn url\n\t\t\t}\n\t\t\treturn\n\t\t},\n\t\tfromEmbedUrl: (url) => {\n\t\t\tconst urlObj = safeParseUrl(url)\n\t\t\tif (urlObj && urlObj.hash.match(/#room=/)) {\n\t\t\t\treturn url\n\t\t\t}\n\t\t\treturn\n\t\t},\n\t},\n\t{\n\t\ttype: 'observable',\n\t\ttitle: 'Observable',\n\t\thostnames: ['observablehq.com'],\n\t\twidth: 720,\n\t\theight: 500,\n\t\tdoesResize: true,\n\t\tcanUnmount: false,\n\t\tisAspectRatioLocked: false,\n\t\tbackgroundColor: '#fff',\n\t\ttoEmbedUrl: (url) => {\n\t\t\tconst urlObj = safeParseUrl(url)\n\t\t\tif (urlObj && urlObj.pathname.match(/^\\/@([^/]+)\\/([^/]+)\\/?$/)) {\n\t\t\t\treturn `${urlObj.origin}/embed${urlObj.pathname}?cell=*`\n\t\t\t}\n\t\t\tif (urlObj && urlObj.pathname.match(/^\\/d\\/([^/]+)\\/?$/)) {\n\t\t\t\tconst pathName = urlObj.pathname.replace(/^\\/d/, '')\n\t\t\t\treturn `${urlObj.origin}/embed${pathName}?cell=*`\n\t\t\t}\n\n\t\t\treturn\n\t\t},\n\t\tfromEmbedUrl: (url) => {\n\t\t\tconst urlObj = safeParseUrl(url)\n\t\t\tif (urlObj && urlObj.pathname.match(/^\\/embed\\/@([^/]+)\\/([^/]+)\\/?$/)) {\n\t\t\t\treturn `${urlObj.origin}${urlObj.pathname.replace('/embed', '')}#cell-*`\n\t\t\t}\n\t\t\tif (urlObj && urlObj.pathname.match(/^\\/embed\\/([^/]+)\\/?$/)) {\n\t\t\t\treturn `${urlObj.origin}${urlObj.pathname.replace('/embed', '/d')}#cell-*`\n\t\t\t}\n\n\t\t\treturn\n\t\t},\n\t},\n] as const satisfies readonly EmbedDefinition[]\n\n/**\n * Permissions with note inline from\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#attr-sandbox\n *\n * @public\n */\nexport const embedShapePermissionDefaults = {\n\t// ========================================================================================\n\t// Disabled permissions\n\t// ========================================================================================\n\t// [MDN] Experimental: Allows for downloads to occur without a gesture from the user.\n\t// [REASON] Disabled because otherwise the <iframe/> trick the user on behalf of us to performing an action\n\t'allow-downloads-without-user-activation': false,\n\t// [MDN] Allows for downloads to occur with a gesture from the user.\n\t// [REASON] Disabled because otherwise the <iframe/> trick the user on behalf of us to performing an action\n\t'allow-downloads': false,\n\t// [MDN] Lets the resource open modal windows.\n\t// [REASON] The <iframe/> could 'window.prompt(\"Enter your tldraw password\")'\n\t'allow-modals': false,\n\t// [MDN] Lets the resource lock the screen orientation.\n\t// [REASON] Would interfer with tldraw interface\n\t'allow-orientation-lock': false,\n\t// [MDN] Lets the resource use the Pointer Lock API.\n\t// [REASON] Maybe we should allow this for games embeds (scratch/codepen/codesandbox)\n\t'allow-pointer-lock': false,\n\t// [MDN] Allows popups (such as window.open(), target=\"_blank\", or showModalDialog()). If this keyword is not used, the popup will silently fail to open.\n\t// [REASON] We shouldn't allow popups as a embed could pretend to be us by opening a mocked version of tldraw. This is very unobvious when it is performed as an action within out app\n\t'allow-popups': true,\n\t// [MDN] Lets the sandboxed document open new windows without those windows inheriting the sandboxing. For example, this can safely sandbox an advertisement without forcing the same restrictions upon the page the ad links to.\n\t// [REASON] We're alread disabling popups.\n\t'allow-popups-to-escape-sandbox': false,\n\t// [MDN] Lets the resource start a presentation session.\n\t// [REASON] Prevents embed from navigating away from tldraw and pretending to be us\n\t'allow-presentation': false,\n\t// [MDN] Experimental: Lets the resource request access to the parent's storage capabilities with the Storage Access API.\n\t// [REASON] We don't want anyone else to access our storage\n\t'allow-storage-access-by-user-activation': false,\n\t// [MDN] Lets the resource navigate the top-level browsing context (the one named _top).\n\t// [REASON] Prevents embed from navigating away from tldraw and pretending to be us\n\t'allow-top-navigation': false,\n\t// [MDN] Lets the resource navigate the top-level browsing context, but only if initiated by a user gesture.\n\t// [REASON] Prevents embed from navigating away from tldraw and pretending to be us\n\t'allow-top-navigation-by-user-activation': false,\n\t// ========================================================================================\n\t// Enabled permissions\n\t// ========================================================================================\n\t// [MDN] Lets the resource run scripts (but not create popup windows).\n\t'allow-scripts': true,\n\t// [MDN] If this token is not used, the resource is treated as being from a special origin that always fails the same-origin policy (potentially preventing access to data storage/cookies and some JavaScript APIs).\n\t'allow-same-origin': true,\n\t// [MDN] Allows the resource to submit forms. If this keyword is not used, form submission is blocked.\n\t'allow-forms': true,\n} as const\n\n/** @public */\nexport type TLEmbedShapePermissions = { [K in keyof typeof embedShapePermissionDefaults]?: boolean }\n\n/** @public */\nexport const embedShapeProps = {\n\tw: T.nonZeroNumber,\n\th: T.nonZeroNumber,\n\turl: T.string,\n}\n\n/** @public */\nexport type TLEmbedShapeProps = ShapePropsType<typeof embedShapeProps>\n\n/** @public */\nexport type TLEmbedShape = TLBaseShape<'embed', TLEmbedShapeProps>\n\n/** @public */\nexport type EmbedDefinition = {\n\treadonly type: string\n\treadonly title: string\n\treadonly hostnames: readonly string[]\n\treadonly minWidth?: number\n\treadonly minHeight?: number\n\treadonly width: number\n\treadonly height: number\n\treadonly doesResize: boolean\n\treadonly canUnmount: boolean\n\treadonly isAspectRatioLocked?: boolean\n\treadonly overridePermissions?: TLEmbedShapePermissions\n\treadonly instructionLink?: string\n\treadonly backgroundColor?: string\n\t// TODO: FIXME this is ugly be required because some embeds have their own border radius for example spotify embeds\n\treadonly overrideOutlineRadius?: number\n\treadonly toEmbedUrl: (url: string) => string | undefined\n\treadonly fromEmbedUrl: (url: string) => string | undefined\n}\n\nconst Versions = {\n\tGenOriginalUrlInEmbed: 1,\n\tRemoveDoesResize: 2,\n\tRemoveTmpOldUrl: 3,\n\tRemovePermissionOverrides: 4,\n} as const\n\n/** @internal */\nexport const embedShapeMigrations = defineMigrations({\n\tcurrentVersion: Versions.RemovePermissionOverrides,\n\tmigrators: {\n\t\t[Versions.GenOriginalUrlInEmbed]: {\n\t\t\t// add tmpOldUrl property\n\t\t\tup: (shape) => {\n\t\t\t\tconst url = shape.props.url\n\t\t\t\tconst host = new URL(url).host.replace('www.', '')\n\t\t\t\tlet originalUrl\n\t\t\t\tfor (const localEmbedDef of EMBED_DEFINITIONS) {\n\t\t\t\t\tif ((localEmbedDef as EmbedDefinition).hostnames.includes(host)) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\toriginalUrl = localEmbedDef.fromEmbedUrl(url)\n\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\tconsole.warn(err)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\t...shape,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...shape.props,\n\t\t\t\t\t\ttmpOldUrl: shape.props.url,\n\t\t\t\t\t\turl: originalUrl ?? '',\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t},\n\t\t\t// remove tmpOldUrl property\n\t\t\tdown: (shape) => {\n\t\t\t\tlet newUrl = shape.props.tmpOldUrl\n\t\t\t\tif (!newUrl || newUrl === '') {\n\t\t\t\t\tconst url = shape.props.url\n\t\t\t\t\tconst host = new URL(url).host.replace('www.', '')\n\n\t\t\t\t\tfor (const localEmbedDef of EMBED_DEFINITIONS) {\n\t\t\t\t\t\tif ((localEmbedDef as EmbedDefinition).hostnames.includes(host)) {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tnewUrl = localEmbedDef.toEmbedUrl(url)\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\tconsole.warn(err)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\t\t\t\tconst { tmpOldUrl, ...props } = shape.props\n\t\t\t\treturn {\n\t\t\t\t\t...shape,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...props,\n\t\t\t\t\t\turl: newUrl ?? '',\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t\t[Versions.RemoveDoesResize]: {\n\t\t\tup: (shape) => {\n\t\t\t\tconst { doesResize: _, ...props } = shape.props\n\t\t\t\treturn {\n\t\t\t\t\t...shape,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...props,\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t},\n\t\t\tdown: (shape) => {\n\t\t\t\treturn {\n\t\t\t\t\t...shape,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...shape.props,\n\t\t\t\t\t\tdoesResize: true,\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t\t[Versions.RemoveTmpOldUrl]: {\n\t\t\tup: (shape) => {\n\t\t\t\tconst { tmpOldUrl: _, ...props } = shape.props\n\t\t\t\treturn {\n\t\t\t\t\t...shape,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...props,\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t},\n\t\t\tdown: (shape) => {\n\t\t\t\treturn {\n\t\t\t\t\t...shape,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...shape.props,\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t\t[Versions.RemovePermissionOverrides]: {\n\t\t\tup: (shape) => {\n\t\t\t\tconst { overridePermissions: _, ...props } = shape.props\n\t\t\t\treturn {\n\t\t\t\t\t...shape,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...props,\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t},\n\t\t\tdown: (shape) => {\n\t\t\t\treturn {\n\t\t\t\t\t...shape,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...shape.props,\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t},\n})\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAiC;AACjC,sBAAkB;AAIlB,MAAM,gBAAgB;AAEtB,MAAM,eAAe,CAAC,QAAgB;AACrC,MAAI;AACH,WAAO,IAAI,IAAI,GAAG;AAAA,EACnB,SAAS,KAAK;AACb;AAAA,EACD;AACD;AAGO,MAAM,oBAAoB;AAAA,EAChC;AAAA,IACC,MAAM;AAAA,IACN,OAAO;AAAA,IACP,WAAW,CAAC,mBAAmB,YAAY;AAAA,IAC3C,UAAU;AAAA,IACV,WAAW;AAAA,IACX,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,YAAY,CAAC,QAAQ;AACpB,YAAM,SAAS,aAAa,GAAG;AAC/B,UAAI,UAAU,OAAO,SAAS,MAAM,aAAa,GAAG;AACnD,eAAO;AAAA,MACR;AACA;AAAA,IACD;AAAA,IACA,cAAc,CAAC,QAAQ;AACtB,YAAM,SAAS,aAAa,GAAG;AAC/B,UAAI,UAAU,OAAO,SAAS,MAAM,aAAa,GAAG;AACnD,eAAO;AAAA,MACR;AACA;AAAA,IACD;AAAA,EACD;AAAA,EACA;AAAA,IAC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D;AAAA,MACA,MAAM,CAAC,UAAU;AAChB,eAAO;AAAA,UACN,GAAG;AAAA,UACH,OAAO;AAAA,YACN,GAAG,MAAM;AAAA,UACV;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,IACA,CAAC,SAAS,yBAAyB,GAAG;AAAA,MACrC,IAAI,CAAC,UAAU;AACd,cAAM,EAAE,qBAAqB,GAAG,GAAG,MAAM,IAAI,MAAM;AACnD,eAAO;AAAA,UACN,GAAG;AAAA,UACH,OAAO;AAAA,YACN,GAAG;AAAA,UACJ;AAAA,QACD;AAAA,MACD;AAAA,MACA,MAAM,CAAC,UAAU;AAChB,eAAO;AAAA,UACN,GAAG;AAAA,UACH,OAAO;AAAA,YACN,GAAG,MAAM;AAAA,UACV;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACD,CAAC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var TLFrameShape_exports = {};
20
+ __export(TLFrameShape_exports, {
21
+ frameShapeMigrations: () => frameShapeMigrations,
22
+ frameShapeProps: () => frameShapeProps
23
+ });
24
+ module.exports = __toCommonJS(TLFrameShape_exports);
25
+ var import_store = require("@bigbluebutton/store");
26
+ var import_validate = require("@bigbluebutton/validate");
27
+ const frameShapeProps = {
28
+ w: import_validate.T.nonZeroNumber,
29
+ h: import_validate.T.nonZeroNumber,
30
+ name: import_validate.T.string
31
+ };
32
+ const frameShapeMigrations = (0, import_store.defineMigrations)({});
33
+ //# sourceMappingURL=TLFrameShape.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/shapes/TLFrameShape.ts"],
4
+ "sourcesContent": ["import { defineMigrations } from '@bigbluebutton/store'\nimport { T } from '@bigbluebutton/validate'\nimport { ShapePropsType, TLBaseShape } from './TLBaseShape'\n\n/** @public */\nexport const frameShapeProps = {\n\tw: T.nonZeroNumber,\n\th: T.nonZeroNumber,\n\tname: T.string,\n}\n\ntype TLFrameShapeProps = ShapePropsType<typeof frameShapeProps>\n\n/** @public */\nexport type TLFrameShape = TLBaseShape<'frame', TLFrameShapeProps>\n\n/** @internal */\nexport const frameShapeMigrations = defineMigrations({})\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAiC;AACjC,sBAAkB;AAIX,MAAM,kBAAkB;AAAA,EAC9B,GAAG,kBAAE;AAAA,EACL,GAAG,kBAAE;AAAA,EACL,MAAM,kBAAE;AACT;AAQO,MAAM,2BAAuB,+BAAiB,CAAC,CAAC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,230 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var TLGeoShape_exports = {};
20
+ __export(TLGeoShape_exports, {
21
+ GeoShapeGeoStyle: () => GeoShapeGeoStyle,
22
+ GeoShapeVersions: () => Versions,
23
+ geoShapeMigrations: () => geoShapeMigrations,
24
+ geoShapeProps: () => geoShapeProps
25
+ });
26
+ module.exports = __toCommonJS(TLGeoShape_exports);
27
+ var import_store = require("@bigbluebutton/store");
28
+ var import_validate = require("@bigbluebutton/validate");
29
+ var import_StyleProp = require("../styles/StyleProp");
30
+ var import_TLColorStyle = require("../styles/TLColorStyle");
31
+ var import_TLDashStyle = require("../styles/TLDashStyle");
32
+ var import_TLFillStyle = require("../styles/TLFillStyle");
33
+ var import_TLFontStyle = require("../styles/TLFontStyle");
34
+ var import_TLHorizontalAlignStyle = require("../styles/TLHorizontalAlignStyle");
35
+ var import_TLSizeStyle = require("../styles/TLSizeStyle");
36
+ var import_TLVerticalAlignStyle = require("../styles/TLVerticalAlignStyle");
37
+ const GeoShapeGeoStyle = import_StyleProp.StyleProp.defineEnum("tldraw:geo", {
38
+ defaultValue: "rectangle",
39
+ values: [
40
+ "cloud",
41
+ "rectangle",
42
+ "ellipse",
43
+ "triangle",
44
+ "diamond",
45
+ "pentagon",
46
+ "hexagon",
47
+ "octagon",
48
+ "star",
49
+ "rhombus",
50
+ "rhombus-2",
51
+ "oval",
52
+ "trapezoid",
53
+ "arrow-right",
54
+ "arrow-left",
55
+ "arrow-up",
56
+ "arrow-down",
57
+ "x-box",
58
+ "check-box"
59
+ ]
60
+ });
61
+ const geoShapeProps = {
62
+ geo: GeoShapeGeoStyle,
63
+ labelColor: import_TLColorStyle.DefaultLabelColorStyle,
64
+ color: import_TLColorStyle.DefaultColorStyle,
65
+ fill: import_TLFillStyle.DefaultFillStyle,
66
+ dash: import_TLDashStyle.DefaultDashStyle,
67
+ size: import_TLSizeStyle.DefaultSizeStyle,
68
+ font: import_TLFontStyle.DefaultFontStyle,
69
+ align: import_TLHorizontalAlignStyle.DefaultHorizontalAlignStyle,
70
+ verticalAlign: import_TLVerticalAlignStyle.DefaultVerticalAlignStyle,
71
+ url: import_validate.T.string,
72
+ w: import_validate.T.nonZeroNumber,
73
+ h: import_validate.T.nonZeroNumber,
74
+ growY: import_validate.T.positiveNumber,
75
+ text: import_validate.T.string
76
+ };
77
+ const Versions = {
78
+ AddUrlProp: 1,
79
+ AddLabelColor: 2,
80
+ RemoveJustify: 3,
81
+ AddCheckBox: 4,
82
+ AddVerticalAlign: 5,
83
+ MigrateLegacyAlign: 6,
84
+ AddCloud: 7
85
+ };
86
+ const geoShapeMigrations = (0, import_store.defineMigrations)({
87
+ currentVersion: Versions.AddCloud,
88
+ migrators: {
89
+ [Versions.AddUrlProp]: {
90
+ up: (shape) => {
91
+ return { ...shape, props: { ...shape.props, url: "" } };
92
+ },
93
+ down: (shape) => {
94
+ const { url: _, ...props } = shape.props;
95
+ return { ...shape, props };
96
+ }
97
+ },
98
+ [Versions.AddLabelColor]: {
99
+ up: (record) => {
100
+ return {
101
+ ...record,
102
+ props: {
103
+ ...record.props,
104
+ labelColor: "black"
105
+ }
106
+ };
107
+ },
108
+ down: (record) => {
109
+ const { labelColor: _, ...props } = record.props;
110
+ return {
111
+ ...record,
112
+ props
113
+ };
114
+ }
115
+ },
116
+ [Versions.RemoveJustify]: {
117
+ up: (shape) => {
118
+ let newAlign = shape.props.align;
119
+ if (newAlign === "justify") {
120
+ newAlign = "start";
121
+ }
122
+ return {
123
+ ...shape,
124
+ props: {
125
+ ...shape.props,
126
+ align: newAlign
127
+ }
128
+ };
129
+ },
130
+ down: (shape) => {
131
+ return { ...shape };
132
+ }
133
+ },
134
+ [Versions.AddCheckBox]: {
135
+ up: (shape) => {
136
+ return { ...shape };
137
+ },
138
+ down: (shape) => {
139
+ return {
140
+ ...shape,
141
+ props: {
142
+ ...shape.props,
143
+ geo: shape.props.geo === "check-box" ? "rectangle" : shape.props.geo
144
+ }
145
+ };
146
+ }
147
+ },
148
+ [Versions.AddVerticalAlign]: {
149
+ up: (shape) => {
150
+ return {
151
+ ...shape,
152
+ props: {
153
+ ...shape.props,
154
+ verticalAlign: "middle"
155
+ }
156
+ };
157
+ },
158
+ down: (shape) => {
159
+ const { verticalAlign: _, ...props } = shape.props;
160
+ return {
161
+ ...shape,
162
+ props
163
+ };
164
+ }
165
+ },
166
+ [Versions.MigrateLegacyAlign]: {
167
+ up: (shape) => {
168
+ let newAlign;
169
+ switch (shape.props.align) {
170
+ case "start":
171
+ newAlign = "start-legacy";
172
+ break;
173
+ case "end":
174
+ newAlign = "end-legacy";
175
+ break;
176
+ default:
177
+ newAlign = "middle-legacy";
178
+ break;
179
+ }
180
+ return {
181
+ ...shape,
182
+ props: {
183
+ ...shape.props,
184
+ align: newAlign
185
+ }
186
+ };
187
+ },
188
+ down: (shape) => {
189
+ let oldAlign;
190
+ switch (shape.props.align) {
191
+ case "start-legacy":
192
+ oldAlign = "start";
193
+ break;
194
+ case "end-legacy":
195
+ oldAlign = "end";
196
+ break;
197
+ case "middle-legacy":
198
+ oldAlign = "middle";
199
+ break;
200
+ default:
201
+ oldAlign = shape.props.align;
202
+ }
203
+ return {
204
+ ...shape,
205
+ props: {
206
+ ...shape.props,
207
+ align: oldAlign
208
+ }
209
+ };
210
+ }
211
+ },
212
+ [Versions.AddCloud]: {
213
+ up: (shape) => {
214
+ return shape;
215
+ },
216
+ down: (shape) => {
217
+ if (shape.props.geo === "cloud") {
218
+ return {
219
+ ...shape,
220
+ props: {
221
+ ...shape.props,
222
+ geo: "rectangle"
223
+ }
224
+ };
225
+ }
226
+ }
227
+ }
228
+ }
229
+ });
230
+ //# sourceMappingURL=TLGeoShape.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/shapes/TLGeoShape.ts"],
4
+ "sourcesContent": ["import { defineMigrations } from '@bigbluebutton/store'\nimport { T } from '@bigbluebutton/validate'\nimport { StyleProp } from '../styles/StyleProp'\nimport { DefaultColorStyle, DefaultLabelColorStyle } from '../styles/TLColorStyle'\nimport { DefaultDashStyle } from '../styles/TLDashStyle'\nimport { DefaultFillStyle } from '../styles/TLFillStyle'\nimport { DefaultFontStyle } from '../styles/TLFontStyle'\nimport {\n\tDefaultHorizontalAlignStyle,\n\tTLDefaultHorizontalAlignStyle,\n} from '../styles/TLHorizontalAlignStyle'\nimport { DefaultSizeStyle } from '../styles/TLSizeStyle'\nimport { DefaultVerticalAlignStyle } from '../styles/TLVerticalAlignStyle'\nimport { ShapePropsType, TLBaseShape } from './TLBaseShape'\n\n/** @public */\nexport const GeoShapeGeoStyle = StyleProp.defineEnum('tldraw:geo', {\n\tdefaultValue: 'rectangle',\n\tvalues: [\n\t\t'cloud',\n\t\t'rectangle',\n\t\t'ellipse',\n\t\t'triangle',\n\t\t'diamond',\n\t\t'pentagon',\n\t\t'hexagon',\n\t\t'octagon',\n\t\t'star',\n\t\t'rhombus',\n\t\t'rhombus-2',\n\t\t'oval',\n\t\t'trapezoid',\n\t\t'arrow-right',\n\t\t'arrow-left',\n\t\t'arrow-up',\n\t\t'arrow-down',\n\t\t'x-box',\n\t\t'check-box',\n\t],\n})\n\n/** @public */\nexport type TLGeoShapeGeoStyle = T.TypeOf<typeof GeoShapeGeoStyle>\n\n/** @public */\nexport const geoShapeProps = {\n\tgeo: GeoShapeGeoStyle,\n\tlabelColor: DefaultLabelColorStyle,\n\tcolor: DefaultColorStyle,\n\tfill: DefaultFillStyle,\n\tdash: DefaultDashStyle,\n\tsize: DefaultSizeStyle,\n\tfont: DefaultFontStyle,\n\talign: DefaultHorizontalAlignStyle,\n\tverticalAlign: DefaultVerticalAlignStyle,\n\turl: T.string,\n\tw: T.nonZeroNumber,\n\th: T.nonZeroNumber,\n\tgrowY: T.positiveNumber,\n\ttext: T.string,\n}\n\n/** @public */\nexport type TLGeoShapeProps = ShapePropsType<typeof geoShapeProps>\n\n/** @public */\nexport type TLGeoShape = TLBaseShape<'geo', TLGeoShapeProps>\n\nconst Versions = {\n\tAddUrlProp: 1,\n\tAddLabelColor: 2,\n\tRemoveJustify: 3,\n\tAddCheckBox: 4,\n\tAddVerticalAlign: 5,\n\tMigrateLegacyAlign: 6,\n\tAddCloud: 7,\n} as const\n\nexport { Versions as GeoShapeVersions }\n\n/** @internal */\nexport const geoShapeMigrations = defineMigrations({\n\tcurrentVersion: Versions.AddCloud,\n\tmigrators: {\n\t\t[Versions.AddUrlProp]: {\n\t\t\tup: (shape) => {\n\t\t\t\treturn { ...shape, props: { ...shape.props, url: '' } }\n\t\t\t},\n\t\t\tdown: (shape) => {\n\t\t\t\tconst { url: _, ...props } = shape.props\n\t\t\t\treturn { ...shape, props }\n\t\t\t},\n\t\t},\n\t\t[Versions.AddLabelColor]: {\n\t\t\tup: (record) => {\n\t\t\t\treturn {\n\t\t\t\t\t...record,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...record.props,\n\t\t\t\t\t\tlabelColor: 'black',\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t},\n\t\t\tdown: (record) => {\n\t\t\t\tconst { labelColor: _, ...props } = record.props\n\t\t\t\treturn {\n\t\t\t\t\t...record,\n\t\t\t\t\tprops,\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t\t[Versions.RemoveJustify]: {\n\t\t\tup: (shape) => {\n\t\t\t\tlet newAlign = shape.props.align\n\t\t\t\tif (newAlign === 'justify') {\n\t\t\t\t\tnewAlign = 'start'\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\t...shape,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...shape.props,\n\t\t\t\t\t\talign: newAlign,\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t},\n\t\t\tdown: (shape) => {\n\t\t\t\treturn { ...shape }\n\t\t\t},\n\t\t},\n\t\t[Versions.AddCheckBox]: {\n\t\t\tup: (shape) => {\n\t\t\t\treturn { ...shape }\n\t\t\t},\n\t\t\tdown: (shape) => {\n\t\t\t\treturn {\n\t\t\t\t\t...shape,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...shape.props,\n\t\t\t\t\t\tgeo: shape.props.geo === 'check-box' ? 'rectangle' : shape.props.geo,\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t\t[Versions.AddVerticalAlign]: {\n\t\t\tup: (shape) => {\n\t\t\t\treturn {\n\t\t\t\t\t...shape,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...shape.props,\n\t\t\t\t\t\tverticalAlign: 'middle',\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t},\n\t\t\tdown: (shape) => {\n\t\t\t\tconst { verticalAlign: _, ...props } = shape.props\n\t\t\t\treturn {\n\t\t\t\t\t...shape,\n\t\t\t\t\tprops,\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t\t[Versions.MigrateLegacyAlign]: {\n\t\t\tup: (shape) => {\n\t\t\t\tlet newAlign: TLDefaultHorizontalAlignStyle\n\t\t\t\tswitch (shape.props.align) {\n\t\t\t\t\tcase 'start':\n\t\t\t\t\t\tnewAlign = 'start-legacy'\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase 'end':\n\t\t\t\t\t\tnewAlign = 'end-legacy'\n\t\t\t\t\t\tbreak\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tnewAlign = 'middle-legacy'\n\t\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\t...shape,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...shape.props,\n\t\t\t\t\t\talign: newAlign,\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t},\n\t\t\tdown: (shape) => {\n\t\t\t\tlet oldAlign: TLDefaultHorizontalAlignStyle\n\t\t\t\tswitch (shape.props.align) {\n\t\t\t\t\tcase 'start-legacy':\n\t\t\t\t\t\toldAlign = 'start'\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase 'end-legacy':\n\t\t\t\t\t\toldAlign = 'end'\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase 'middle-legacy':\n\t\t\t\t\t\toldAlign = 'middle'\n\t\t\t\t\t\tbreak\n\t\t\t\t\tdefault:\n\t\t\t\t\t\toldAlign = shape.props.align\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\t...shape,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...shape.props,\n\t\t\t\t\t\talign: oldAlign,\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t\t[Versions.AddCloud]: {\n\t\t\tup: (shape) => {\n\t\t\t\treturn shape\n\t\t\t},\n\t\t\tdown: (shape) => {\n\t\t\t\tif (shape.props.geo === 'cloud') {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...shape,\n\t\t\t\t\t\tprops: {\n\t\t\t\t\t\t\t...shape.props,\n\t\t\t\t\t\t\tgeo: 'rectangle',\n\t\t\t\t\t\t},\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t},\n})\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAiC;AACjC,sBAAkB;AAClB,uBAA0B;AAC1B,0BAA0D;AAC1D,yBAAiC;AACjC,yBAAiC;AACjC,yBAAiC;AACjC,oCAGO;AACP,yBAAiC;AACjC,kCAA0C;AAInC,MAAM,mBAAmB,2BAAU,WAAW,cAAc;AAAA,EAClE,cAAc;AAAA,EACd,QAAQ;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,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A,YACN,GAAG,MAAM;AAAA,YACT,OAAO;AAAA,UACR;AAAA,QACD;AAAA,MACD;AAAA,MACA,MAAM,CAAC,UAAU;AAChB,YAAI;AACJ,gBAAQ,MAAM,MAAM,OAAO;AAAA,UAC1B,KAAK;AACJ,uBAAW;AACX;AAAA,UACD,KAAK;AACJ,uBAAW;AACX;AAAA,UACD,KAAK;AACJ,uBAAW;AACX;AAAA,UACD;AACC,uBAAW,MAAM,MAAM;AAAA,QACzB;AACA,eAAO;AAAA,UACN,GAAG;AAAA,UACH,OAAO;AAAA,YACN,GAAG,MAAM;AAAA,YACT,OAAO;AAAA,UACR;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,IACA,CAAC,SAAS,QAAQ,GAAG;AAAA,MACpB,IAAI,CAAC,UAAU;AACd,eAAO;AAAA,MACR;AAAA,MACA,MAAM,CAAC,UAAU;AAChB,YAAI,MAAM,MAAM,QAAQ,SAAS;AAChC,iBAAO;AAAA,YACN,GAAG;AAAA,YACH,OAAO;AAAA,cACN,GAAG,MAAM;AAAA,cACT,KAAK;AAAA,YACN;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACD,CAAC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var TLGroupShape_exports = {};
20
+ __export(TLGroupShape_exports, {
21
+ groupShapeMigrations: () => groupShapeMigrations,
22
+ groupShapeProps: () => groupShapeProps
23
+ });
24
+ module.exports = __toCommonJS(TLGroupShape_exports);
25
+ var import_store = require("@bigbluebutton/store");
26
+ const groupShapeProps = {};
27
+ const groupShapeMigrations = (0, import_store.defineMigrations)({});
28
+ //# sourceMappingURL=TLGroupShape.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/shapes/TLGroupShape.ts"],
4
+ "sourcesContent": ["import { defineMigrations } from '@bigbluebutton/store'\nimport { ShapeProps, TLBaseShape } from './TLBaseShape'\n\n/** @public */\nexport type TLGroupShapeProps = { [key in never]: undefined }\n\n/** @public */\nexport type TLGroupShape = TLBaseShape<'group', TLGroupShapeProps>\n\n/** @internal */\nexport const groupShapeProps: ShapeProps<TLGroupShape> = {}\n\n/** @internal */\nexport const groupShapeMigrations = defineMigrations({})\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAiC;AAU1B,MAAM,kBAA4C,CAAC;AAGnD,MAAM,2BAAuB,+BAAiB,CAAC,CAAC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var TLHighlightShape_exports = {};
20
+ __export(TLHighlightShape_exports, {
21
+ highlightShapeMigrations: () => highlightShapeMigrations,
22
+ highlightShapeProps: () => highlightShapeProps
23
+ });
24
+ module.exports = __toCommonJS(TLHighlightShape_exports);
25
+ var import_store = require("@bigbluebutton/store");
26
+ var import_validate = require("@bigbluebutton/validate");
27
+ var import_TLColorStyle = require("../styles/TLColorStyle");
28
+ var import_TLSizeStyle = require("../styles/TLSizeStyle");
29
+ var import_TLDrawShape = require("./TLDrawShape");
30
+ const highlightShapeProps = {
31
+ color: import_TLColorStyle.DefaultColorStyle,
32
+ size: import_TLSizeStyle.DefaultSizeStyle,
33
+ segments: import_validate.T.arrayOf(import_TLDrawShape.DrawShapeSegment),
34
+ isComplete: import_validate.T.boolean,
35
+ isPen: import_validate.T.boolean
36
+ };
37
+ const highlightShapeMigrations = (0, import_store.defineMigrations)({});
38
+ //# sourceMappingURL=TLHighlightShape.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/shapes/TLHighlightShape.ts"],
4
+ "sourcesContent": ["import { defineMigrations } from '@bigbluebutton/store'\nimport { T } from '@bigbluebutton/validate'\nimport { DefaultColorStyle } from '../styles/TLColorStyle'\nimport { DefaultSizeStyle } from '../styles/TLSizeStyle'\nimport { ShapePropsType, TLBaseShape } from './TLBaseShape'\nimport { DrawShapeSegment } from './TLDrawShape'\n\n/** @public */\nexport const highlightShapeProps = {\n\tcolor: DefaultColorStyle,\n\tsize: DefaultSizeStyle,\n\tsegments: T.arrayOf(DrawShapeSegment),\n\tisComplete: T.boolean,\n\tisPen: T.boolean,\n}\n\n/** @public */\nexport type TLHighlightShapeProps = ShapePropsType<typeof highlightShapeProps>\n\n/** @public */\nexport type TLHighlightShape = TLBaseShape<'highlight', TLHighlightShapeProps>\n\n/** @internal */\nexport const highlightShapeMigrations = defineMigrations({})\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAiC;AACjC,sBAAkB;AAClB,0BAAkC;AAClC,yBAAiC;AAEjC,yBAAiC;AAG1B,MAAM,sBAAsB;AAAA,EAClC,OAAO;AAAA,EACP,MAAM;AAAA,EACN,UAAU,kBAAE,QAAQ,mCAAgB;AAAA,EACpC,YAAY,kBAAE;AAAA,EACd,OAAO,kBAAE;AACV;AASO,MAAM,+BAA2B,+BAAiB,CAAC,CAAC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var TLImageShape_exports = {};
20
+ __export(TLImageShape_exports, {
21
+ ImageShapeCrop: () => ImageShapeCrop,
22
+ imageShapeMigrations: () => imageShapeMigrations,
23
+ imageShapeProps: () => imageShapeProps
24
+ });
25
+ module.exports = __toCommonJS(TLImageShape_exports);
26
+ var import_store = require("@bigbluebutton/store");
27
+ var import_validate = require("@bigbluebutton/validate");
28
+ var import_TLBaseAsset = require("../assets/TLBaseAsset");
29
+ var import_geometry_types = require("../misc/geometry-types");
30
+ const ImageShapeCrop = import_validate.T.object({
31
+ topLeft: import_geometry_types.vec2dModelValidator,
32
+ bottomRight: import_geometry_types.vec2dModelValidator
33
+ });
34
+ const imageShapeProps = {
35
+ w: import_validate.T.nonZeroNumber,
36
+ h: import_validate.T.nonZeroNumber,
37
+ playing: import_validate.T.boolean,
38
+ url: import_validate.T.string,
39
+ assetId: import_TLBaseAsset.assetIdValidator.nullable(),
40
+ crop: ImageShapeCrop.nullable()
41
+ };
42
+ const Versions = {
43
+ AddUrlProp: 1,
44
+ AddCropProp: 2
45
+ };
46
+ const imageShapeMigrations = (0, import_store.defineMigrations)({
47
+ currentVersion: Versions.AddCropProp,
48
+ migrators: {
49
+ [Versions.AddUrlProp]: {
50
+ up: (shape) => {
51
+ return { ...shape, props: { ...shape.props, url: "" } };
52
+ },
53
+ down: (shape) => {
54
+ const { url: _, ...props } = shape.props;
55
+ return { ...shape, props };
56
+ }
57
+ },
58
+ [Versions.AddCropProp]: {
59
+ up: (shape) => {
60
+ return { ...shape, props: { ...shape.props, crop: null } };
61
+ },
62
+ down: (shape) => {
63
+ const { crop: _, ...props } = shape.props;
64
+ return { ...shape, props };
65
+ }
66
+ }
67
+ }
68
+ });
69
+ //# sourceMappingURL=TLImageShape.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/shapes/TLImageShape.ts"],
4
+ "sourcesContent": ["import { defineMigrations } from '@bigbluebutton/store'\nimport { T } from '@bigbluebutton/validate'\nimport { assetIdValidator } from '../assets/TLBaseAsset'\nimport { vec2dModelValidator } from '../misc/geometry-types'\nimport { ShapePropsType, TLBaseShape } from './TLBaseShape'\n\n/** @public */\nexport const ImageShapeCrop = T.object({\n\ttopLeft: vec2dModelValidator,\n\tbottomRight: vec2dModelValidator,\n})\n/** @public */\nexport type TLImageShapeCrop = T.TypeOf<typeof ImageShapeCrop>\n\n/** @public */\nexport const imageShapeProps = {\n\tw: T.nonZeroNumber,\n\th: T.nonZeroNumber,\n\tplaying: T.boolean,\n\turl: T.string,\n\tassetId: assetIdValidator.nullable(),\n\tcrop: ImageShapeCrop.nullable(),\n}\n\n/** @public */\nexport type TLImageShapeProps = ShapePropsType<typeof imageShapeProps>\n\n/** @public */\nexport type TLImageShape = TLBaseShape<'image', TLImageShapeProps>\n\nconst Versions = {\n\tAddUrlProp: 1,\n\tAddCropProp: 2,\n} as const\n\n/** @internal */\nexport const imageShapeMigrations = defineMigrations({\n\tcurrentVersion: Versions.AddCropProp,\n\tmigrators: {\n\t\t[Versions.AddUrlProp]: {\n\t\t\tup: (shape) => {\n\t\t\t\treturn { ...shape, props: { ...shape.props, url: '' } }\n\t\t\t},\n\t\t\tdown: (shape) => {\n\t\t\t\tconst { url: _, ...props } = shape.props\n\t\t\t\treturn { ...shape, props }\n\t\t\t},\n\t\t},\n\t\t[Versions.AddCropProp]: {\n\t\t\tup: (shape) => {\n\t\t\t\treturn { ...shape, props: { ...shape.props, crop: null } }\n\t\t\t},\n\t\t\tdown: (shape) => {\n\t\t\t\tconst { crop: _, ...props } = shape.props\n\t\t\t\treturn { ...shape, props }\n\t\t\t},\n\t\t},\n\t},\n})\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAiC;AACjC,sBAAkB;AAClB,yBAAiC;AACjC,4BAAoC;AAI7B,MAAM,iBAAiB,kBAAE,OAAO;AAAA,EACtC,SAAS;AAAA,EACT,aAAa;AACd,CAAC;AAKM,MAAM,kBAAkB;AAAA,EAC9B,GAAG,kBAAE;AAAA,EACL,GAAG,kBAAE;AAAA,EACL,SAAS,kBAAE;AAAA,EACX,KAAK,kBAAE;AAAA,EACP,SAAS,oCAAiB,SAAS;AAAA,EACnC,MAAM,eAAe,SAAS;AAC/B;AAQA,MAAM,WAAW;AAAA,EAChB,YAAY;AAAA,EACZ,aAAa;AACd;AAGO,MAAM,2BAAuB,+BAAiB;AAAA,EACpD,gBAAgB,SAAS;AAAA,EACzB,WAAW;AAAA,IACV,CAAC,SAAS,UAAU,GAAG;AAAA,MACtB,IAAI,CAAC,UAAU;AACd,eAAO,EAAE,GAAG,OAAO,OAAO,EAAE,GAAG,MAAM,OAAO,KAAK,GAAG,EAAE;AAAA,MACvD;AAAA,MACA,MAAM,CAAC,UAAU;AAChB,cAAM,EAAE,KAAK,GAAG,GAAG,MAAM,IAAI,MAAM;AACnC,eAAO,EAAE,GAAG,OAAO,MAAM;AAAA,MAC1B;AAAA,IACD;AAAA,IACA,CAAC,SAAS,WAAW,GAAG;AAAA,MACvB,IAAI,CAAC,UAAU;AACd,eAAO,EAAE,GAAG,OAAO,OAAO,EAAE,GAAG,MAAM,OAAO,MAAM,KAAK,EAAE;AAAA,MAC1D;AAAA,MACA,MAAM,CAAC,UAAU;AAChB,cAAM,EAAE,MAAM,GAAG,GAAG,MAAM,IAAI,MAAM;AACpC,eAAO,EAAE,GAAG,OAAO,MAAM;AAAA,MAC1B;AAAA,IACD;AAAA,EACD;AACD,CAAC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var TLLineShape_exports = {};
20
+ __export(TLLineShape_exports, {
21
+ LineShapeSplineStyle: () => LineShapeSplineStyle,
22
+ lineShapeMigrations: () => lineShapeMigrations,
23
+ lineShapeProps: () => lineShapeProps,
24
+ lineShapeVersions: () => lineShapeVersions
25
+ });
26
+ module.exports = __toCommonJS(TLLineShape_exports);
27
+ var import_store = require("@bigbluebutton/store");
28
+ var import_utils = require("@bigbluebutton/utils");
29
+ var import_validate = require("@bigbluebutton/validate");
30
+ var import_TLHandle = require("../misc/TLHandle");
31
+ var import_StyleProp = require("../styles/StyleProp");
32
+ var import_TLColorStyle = require("../styles/TLColorStyle");
33
+ var import_TLDashStyle = require("../styles/TLDashStyle");
34
+ var import_TLSizeStyle = require("../styles/TLSizeStyle");
35
+ const LineShapeSplineStyle = import_StyleProp.StyleProp.defineEnum("tldraw:spline", {
36
+ defaultValue: "line",
37
+ values: ["cubic", "line"]
38
+ });
39
+ const lineShapeProps = {
40
+ color: import_TLColorStyle.DefaultColorStyle,
41
+ dash: import_TLDashStyle.DefaultDashStyle,
42
+ size: import_TLSizeStyle.DefaultSizeStyle,
43
+ spline: LineShapeSplineStyle,
44
+ handles: import_validate.T.dict(import_validate.T.string, import_TLHandle.handleValidator)
45
+ };
46
+ const lineShapeVersions = {
47
+ AddSnapHandles: 1
48
+ };
49
+ const lineShapeMigrations = (0, import_store.defineMigrations)({
50
+ currentVersion: lineShapeVersions.AddSnapHandles,
51
+ migrators: {
52
+ [lineShapeVersions.AddSnapHandles]: {
53
+ up: (record) => {
54
+ const handles = (0, import_utils.deepCopy)(record.props.handles);
55
+ for (const id in handles) {
56
+ handles[id].canSnap = true;
57
+ }
58
+ return { ...record, props: { ...record.props, handles } };
59
+ },
60
+ down: (record) => {
61
+ const handles = (0, import_utils.deepCopy)(record.props.handles);
62
+ for (const id in handles) {
63
+ delete handles[id].canSnap;
64
+ }
65
+ return { ...record, props: { ...record.props, handles } };
66
+ }
67
+ }
68
+ }
69
+ });
70
+ //# sourceMappingURL=TLLineShape.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/shapes/TLLineShape.ts"],
4
+ "sourcesContent": ["import { defineMigrations } from '@bigbluebutton/store'\nimport { deepCopy } from '@bigbluebutton/utils'\nimport { T } from '@bigbluebutton/validate'\nimport { handleValidator } from '../misc/TLHandle'\nimport { StyleProp } from '../styles/StyleProp'\nimport { DefaultColorStyle } from '../styles/TLColorStyle'\nimport { DefaultDashStyle } from '../styles/TLDashStyle'\nimport { DefaultSizeStyle } from '../styles/TLSizeStyle'\nimport { ShapePropsType, TLBaseShape } from './TLBaseShape'\n\n/** @public */\nexport const LineShapeSplineStyle = StyleProp.defineEnum('tldraw:spline', {\n\tdefaultValue: 'line',\n\tvalues: ['cubic', 'line'],\n})\n\n/** @public */\nexport type TLLineShapeSplineStyle = T.TypeOf<typeof LineShapeSplineStyle>\n\n/** @public */\nexport const lineShapeProps = {\n\tcolor: DefaultColorStyle,\n\tdash: DefaultDashStyle,\n\tsize: DefaultSizeStyle,\n\tspline: LineShapeSplineStyle,\n\thandles: T.dict(T.string, handleValidator),\n}\n\n/** @public */\nexport type TLLineShapeProps = ShapePropsType<typeof lineShapeProps>\n\n/** @public */\nexport type TLLineShape = TLBaseShape<'line', TLLineShapeProps>\n\n/** @internal */\nexport const lineShapeVersions = {\n\tAddSnapHandles: 1,\n} as const\n\n/** @internal */\nexport const lineShapeMigrations = defineMigrations({\n\tcurrentVersion: lineShapeVersions.AddSnapHandles,\n\tmigrators: {\n\t\t[lineShapeVersions.AddSnapHandles]: {\n\t\t\tup: (record: any) => {\n\t\t\t\tconst handles = deepCopy(record.props.handles as Record<string, any>)\n\t\t\t\tfor (const id in handles) {\n\t\t\t\t\thandles[id].canSnap = true\n\t\t\t\t}\n\t\t\t\treturn { ...record, props: { ...record.props, handles } }\n\t\t\t},\n\t\t\tdown: (record: any) => {\n\t\t\t\tconst handles = deepCopy(record.props.handles as Record<string, any>)\n\t\t\t\tfor (const id in handles) {\n\t\t\t\t\tdelete handles[id].canSnap\n\t\t\t\t}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