@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.
- package/LICENSE +190 -0
- package/dist-cjs/TLStore.js +133 -0
- package/dist-cjs/TLStore.js.map +7 -0
- package/dist-cjs/assets/TLBaseAsset.js +37 -0
- package/dist-cjs/assets/TLBaseAsset.js.map +7 -0
- package/dist-cjs/assets/TLBookmarkAsset.js +38 -0
- package/dist-cjs/assets/TLBookmarkAsset.js.map +7 -0
- package/dist-cjs/assets/TLImageAsset.js +76 -0
- package/dist-cjs/assets/TLImageAsset.js.map +7 -0
- package/dist-cjs/assets/TLVideoAsset.js +76 -0
- package/dist-cjs/assets/TLVideoAsset.js.map +7 -0
- package/dist-cjs/createPresenceStateDerivation.js +68 -0
- package/dist-cjs/createPresenceStateDerivation.js.map +7 -0
- package/dist-cjs/createTLSchema.js +68 -0
- package/dist-cjs/createTLSchema.js.map +7 -0
- package/dist-cjs/index.d.ts +1414 -0
- package/dist-cjs/index.js +142 -0
- package/dist-cjs/index.js.map +7 -0
- package/dist-cjs/misc/TLColor.js +36 -0
- package/dist-cjs/misc/TLColor.js.map +7 -0
- package/dist-cjs/misc/TLCursor.js +55 -0
- package/dist-cjs/misc/TLCursor.js.map +7 -0
- package/dist-cjs/misc/TLHandle.js +36 -0
- package/dist-cjs/misc/TLHandle.js.map +7 -0
- package/dist-cjs/misc/TLOpacity.js +30 -0
- package/dist-cjs/misc/TLOpacity.js.map +7 -0
- package/dist-cjs/misc/TLScribble.js +40 -0
- package/dist-cjs/misc/TLScribble.js.map +7 -0
- package/dist-cjs/misc/geometry-types.js +37 -0
- package/dist-cjs/misc/geometry-types.js.map +7 -0
- package/dist-cjs/misc/id-validator.js +33 -0
- package/dist-cjs/misc/id-validator.js.map +7 -0
- package/dist-cjs/records/TLAsset.js +74 -0
- package/dist-cjs/records/TLAsset.js.map +7 -0
- package/dist-cjs/records/TLCamera.js +74 -0
- package/dist-cjs/records/TLCamera.js.map +7 -0
- package/dist-cjs/records/TLDocument.js +82 -0
- package/dist-cjs/records/TLDocument.js.map +7 -0
- package/dist-cjs/records/TLInstance.js +452 -0
- package/dist-cjs/records/TLInstance.js.map +7 -0
- package/dist-cjs/records/TLPage.js +74 -0
- package/dist-cjs/records/TLPage.js.map +7 -0
- package/dist-cjs/records/TLPageState.js +209 -0
- package/dist-cjs/records/TLPageState.js.map +7 -0
- package/dist-cjs/records/TLPointer.js +76 -0
- package/dist-cjs/records/TLPointer.js.map +7 -0
- package/dist-cjs/records/TLPresence.js +170 -0
- package/dist-cjs/records/TLPresence.js.map +7 -0
- package/dist-cjs/records/TLRecord.js +17 -0
- package/dist-cjs/records/TLRecord.js.map +7 -0
- package/dist-cjs/records/TLShape.js +147 -0
- package/dist-cjs/records/TLShape.js.map +7 -0
- package/dist-cjs/shapes/TLArrowShape.js +156 -0
- package/dist-cjs/shapes/TLArrowShape.js.map +7 -0
- package/dist-cjs/shapes/TLBaseShape.js +52 -0
- package/dist-cjs/shapes/TLBaseShape.js.map +7 -0
- package/dist-cjs/shapes/TLBookmarkShape.js +57 -0
- package/dist-cjs/shapes/TLBookmarkShape.js.map +7 -0
- package/dist-cjs/shapes/TLDrawShape.js +89 -0
- package/dist-cjs/shapes/TLDrawShape.js.map +7 -0
- package/dist-cjs/shapes/TLEmbedShape.js +709 -0
- package/dist-cjs/shapes/TLEmbedShape.js.map +7 -0
- package/dist-cjs/shapes/TLFrameShape.js +33 -0
- package/dist-cjs/shapes/TLFrameShape.js.map +7 -0
- package/dist-cjs/shapes/TLGeoShape.js +230 -0
- package/dist-cjs/shapes/TLGeoShape.js.map +7 -0
- package/dist-cjs/shapes/TLGroupShape.js +28 -0
- package/dist-cjs/shapes/TLGroupShape.js.map +7 -0
- package/dist-cjs/shapes/TLHighlightShape.js +38 -0
- package/dist-cjs/shapes/TLHighlightShape.js.map +7 -0
- package/dist-cjs/shapes/TLImageShape.js +69 -0
- package/dist-cjs/shapes/TLImageShape.js.map +7 -0
- package/dist-cjs/shapes/TLLineShape.js +70 -0
- package/dist-cjs/shapes/TLLineShape.js.map +7 -0
- package/dist-cjs/shapes/TLNoteShape.js +144 -0
- package/dist-cjs/shapes/TLNoteShape.js.map +7 -0
- package/dist-cjs/shapes/TLTextShape.js +67 -0
- package/dist-cjs/shapes/TLTextShape.js.map +7 -0
- package/dist-cjs/shapes/TLVideoShape.js +53 -0
- package/dist-cjs/shapes/TLVideoShape.js.map +7 -0
- package/dist-cjs/store-migrations.js +81 -0
- package/dist-cjs/store-migrations.js.map +7 -0
- package/dist-cjs/styles/StyleProp.js +94 -0
- package/dist-cjs/styles/StyleProp.js.map +7 -0
- package/dist-cjs/styles/TLColorStyle.js +283 -0
- package/dist-cjs/styles/TLColorStyle.js.map +7 -0
- package/dist-cjs/styles/TLDashStyle.js +29 -0
- package/dist-cjs/styles/TLDashStyle.js.map +7 -0
- package/dist-cjs/styles/TLFillStyle.js +29 -0
- package/dist-cjs/styles/TLFillStyle.js.map +7 -0
- package/dist-cjs/styles/TLFontStyle.js +36 -0
- package/dist-cjs/styles/TLFontStyle.js.map +7 -0
- package/dist-cjs/styles/TLHorizontalAlignStyle.js +29 -0
- package/dist-cjs/styles/TLHorizontalAlignStyle.js.map +7 -0
- package/dist-cjs/styles/TLSizeStyle.js +29 -0
- package/dist-cjs/styles/TLSizeStyle.js.map +7 -0
- package/dist-cjs/styles/TLVerticalAlignStyle.js +29 -0
- package/dist-cjs/styles/TLVerticalAlignStyle.js.map +7 -0
- package/dist-cjs/translations/languages.js +59 -0
- package/dist-cjs/translations/languages.js.map +7 -0
- package/dist-cjs/translations/translations.js +63 -0
- package/dist-cjs/translations/translations.js.map +7 -0
- package/dist-cjs/util-types.js +17 -0
- package/dist-cjs/util-types.js.map +7 -0
- package/dist-esm/TLStore.mjs +113 -0
- package/dist-esm/TLStore.mjs.map +7 -0
- package/dist-esm/assets/TLBaseAsset.mjs +17 -0
- package/dist-esm/assets/TLBaseAsset.mjs.map +7 -0
- package/dist-esm/assets/TLBookmarkAsset.mjs +18 -0
- package/dist-esm/assets/TLBookmarkAsset.mjs.map +7 -0
- package/dist-esm/assets/TLImageAsset.mjs +56 -0
- package/dist-esm/assets/TLImageAsset.mjs.map +7 -0
- package/dist-esm/assets/TLVideoAsset.mjs +56 -0
- package/dist-esm/assets/TLVideoAsset.mjs.map +7 -0
- package/dist-esm/createPresenceStateDerivation.mjs +48 -0
- package/dist-esm/createPresenceStateDerivation.mjs.map +7 -0
- package/dist-esm/createTLSchema.mjs +48 -0
- package/dist-esm/createTLSchema.mjs.map +7 -0
- package/dist-esm/index.d.mts +1414 -0
- package/dist-esm/index.mjs +193 -0
- package/dist-esm/index.mjs.map +7 -0
- package/dist-esm/misc/TLColor.mjs +16 -0
- package/dist-esm/misc/TLColor.mjs.map +7 -0
- package/dist-esm/misc/TLCursor.mjs +35 -0
- package/dist-esm/misc/TLCursor.mjs.map +7 -0
- package/dist-esm/misc/TLHandle.mjs +16 -0
- package/dist-esm/misc/TLHandle.mjs.map +7 -0
- package/dist-esm/misc/TLOpacity.mjs +10 -0
- package/dist-esm/misc/TLOpacity.mjs.map +7 -0
- package/dist-esm/misc/TLScribble.mjs +20 -0
- package/dist-esm/misc/TLScribble.mjs.map +7 -0
- package/dist-esm/misc/geometry-types.mjs +17 -0
- package/dist-esm/misc/geometry-types.mjs.map +7 -0
- package/dist-esm/misc/id-validator.mjs +13 -0
- package/dist-esm/misc/id-validator.mjs.map +7 -0
- package/dist-esm/records/TLAsset.mjs +57 -0
- package/dist-esm/records/TLAsset.mjs.map +7 -0
- package/dist-esm/records/TLCamera.mjs +54 -0
- package/dist-esm/records/TLCamera.mjs.map +7 -0
- package/dist-esm/records/TLDocument.mjs +62 -0
- package/dist-esm/records/TLDocument.mjs.map +7 -0
- package/dist-esm/records/TLInstance.mjs +432 -0
- package/dist-esm/records/TLInstance.mjs.map +7 -0
- package/dist-esm/records/TLPage.mjs +54 -0
- package/dist-esm/records/TLPage.mjs.map +7 -0
- package/dist-esm/records/TLPageState.mjs +189 -0
- package/dist-esm/records/TLPageState.mjs.map +7 -0
- package/dist-esm/records/TLPointer.mjs +56 -0
- package/dist-esm/records/TLPointer.mjs.map +7 -0
- package/dist-esm/records/TLPresence.mjs +150 -0
- package/dist-esm/records/TLPresence.mjs.map +7 -0
- package/dist-esm/records/TLRecord.mjs +1 -0
- package/dist-esm/records/TLRecord.mjs.map +7 -0
- package/dist-esm/records/TLShape.mjs +127 -0
- package/dist-esm/records/TLShape.mjs.map +7 -0
- package/dist-esm/shapes/TLArrowShape.mjs +136 -0
- package/dist-esm/shapes/TLArrowShape.mjs.map +7 -0
- package/dist-esm/shapes/TLBaseShape.mjs +32 -0
- package/dist-esm/shapes/TLBaseShape.mjs.map +7 -0
- package/dist-esm/shapes/TLBookmarkShape.mjs +37 -0
- package/dist-esm/shapes/TLBookmarkShape.mjs.map +7 -0
- package/dist-esm/shapes/TLDrawShape.mjs +69 -0
- package/dist-esm/shapes/TLDrawShape.mjs.map +7 -0
- package/dist-esm/shapes/TLEmbedShape.mjs +689 -0
- package/dist-esm/shapes/TLEmbedShape.mjs.map +7 -0
- package/dist-esm/shapes/TLFrameShape.mjs +13 -0
- package/dist-esm/shapes/TLFrameShape.mjs.map +7 -0
- package/dist-esm/shapes/TLGeoShape.mjs +212 -0
- package/dist-esm/shapes/TLGeoShape.mjs.map +7 -0
- package/dist-esm/shapes/TLGroupShape.mjs +8 -0
- package/dist-esm/shapes/TLGroupShape.mjs.map +7 -0
- package/dist-esm/shapes/TLHighlightShape.mjs +18 -0
- package/dist-esm/shapes/TLHighlightShape.mjs.map +7 -0
- package/dist-esm/shapes/TLImageShape.mjs +49 -0
- package/dist-esm/shapes/TLImageShape.mjs.map +7 -0
- package/dist-esm/shapes/TLLineShape.mjs +50 -0
- package/dist-esm/shapes/TLLineShape.mjs.map +7 -0
- package/dist-esm/shapes/TLNoteShape.mjs +126 -0
- package/dist-esm/shapes/TLNoteShape.mjs.map +7 -0
- package/dist-esm/shapes/TLTextShape.mjs +47 -0
- package/dist-esm/shapes/TLTextShape.mjs.map +7 -0
- package/dist-esm/shapes/TLVideoShape.mjs +33 -0
- package/dist-esm/shapes/TLVideoShape.mjs.map +7 -0
- package/dist-esm/store-migrations.mjs +61 -0
- package/dist-esm/store-migrations.mjs.map +7 -0
- package/dist-esm/styles/StyleProp.mjs +74 -0
- package/dist-esm/styles/StyleProp.mjs.map +7 -0
- package/dist-esm/styles/TLColorStyle.mjs +263 -0
- package/dist-esm/styles/TLColorStyle.mjs.map +7 -0
- package/dist-esm/styles/TLDashStyle.mjs +9 -0
- package/dist-esm/styles/TLDashStyle.mjs.map +7 -0
- package/dist-esm/styles/TLFillStyle.mjs +9 -0
- package/dist-esm/styles/TLFillStyle.mjs.map +7 -0
- package/dist-esm/styles/TLFontStyle.mjs +16 -0
- package/dist-esm/styles/TLFontStyle.mjs.map +7 -0
- package/dist-esm/styles/TLHorizontalAlignStyle.mjs +9 -0
- package/dist-esm/styles/TLHorizontalAlignStyle.mjs.map +7 -0
- package/dist-esm/styles/TLSizeStyle.mjs +9 -0
- package/dist-esm/styles/TLSizeStyle.mjs.map +7 -0
- package/dist-esm/styles/TLVerticalAlignStyle.mjs +9 -0
- package/dist-esm/styles/TLVerticalAlignStyle.mjs.map +7 -0
- package/dist-esm/translations/languages.mjs +39 -0
- package/dist-esm/translations/languages.mjs.map +7 -0
- package/dist-esm/translations/translations.mjs +43 -0
- package/dist-esm/translations/translations.mjs.map +7 -0
- package/dist-esm/util-types.mjs +1 -0
- package/dist-esm/util-types.mjs.map +7 -0
- package/package.json +64 -0
- package/src/TLStore.ts +160 -0
- package/src/assets/TLBaseAsset.ts +44 -0
- package/src/assets/TLBookmarkAsset.ts +31 -0
- package/src/assets/TLImageAsset.ts +73 -0
- package/src/assets/TLVideoAsset.ts +73 -0
- package/src/createPresenceStateDerivation.ts +53 -0
- package/src/createTLSchema.ts +65 -0
- package/src/index.ts +168 -0
- package/src/migrations.test.ts +1768 -0
- package/src/misc/TLColor.ts +28 -0
- package/src/misc/TLCursor.ts +54 -0
- package/src/misc/TLHandle.ts +41 -0
- package/src/misc/TLOpacity.ts +11 -0
- package/src/misc/TLScribble.ts +39 -0
- package/src/misc/geometry-types.ts +37 -0
- package/src/misc/id-validator.ts +14 -0
- package/src/records/TLAsset.ts +80 -0
- package/src/records/TLCamera.ts +74 -0
- package/src/records/TLDocument.ts +77 -0
- package/src/records/TLInstance.ts +493 -0
- package/src/records/TLPage.ts +72 -0
- package/src/records/TLPageState.ts +216 -0
- package/src/records/TLPointer.ts +74 -0
- package/src/records/TLPresence.ts +179 -0
- package/src/records/TLRecord.ts +21 -0
- package/src/records/TLShape.ts +214 -0
- package/src/shapes/TLArrowShape.ts +160 -0
- package/src/shapes/TLBaseShape.ts +67 -0
- package/src/shapes/TLBookmarkShape.ts +44 -0
- package/src/shapes/TLDrawShape.ts +89 -0
- package/src/shapes/TLEmbedShape.ts +754 -0
- package/src/shapes/TLFrameShape.ts +18 -0
- package/src/shapes/TLGeoShape.ts +226 -0
- package/src/shapes/TLGroupShape.ts +14 -0
- package/src/shapes/TLHighlightShape.ts +24 -0
- package/src/shapes/TLImageShape.ts +59 -0
- package/src/shapes/TLLineShape.ts +61 -0
- package/src/shapes/TLNoteShape.ts +137 -0
- package/src/shapes/TLTextShape.ts +55 -0
- package/src/shapes/TLVideoShape.ts +40 -0
- package/src/store-migrations.ts +63 -0
- package/src/styles/StyleProp.ts +105 -0
- package/src/styles/TLColorStyle.ts +296 -0
- package/src/styles/TLDashStyle.ts +11 -0
- package/src/styles/TLFillStyle.ts +11 -0
- package/src/styles/TLFontStyle.ts +19 -0
- package/src/styles/TLHorizontalAlignStyle.ts +11 -0
- package/src/styles/TLSizeStyle.ts +11 -0
- package/src/styles/TLVerticalAlignStyle.ts +11 -0
- package/src/translations/languages.ts +39 -0
- package/src/translations/translations.test.ts +43 -0
- package/src/translations/translations.ts +73 -0
- 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}¢er=${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,SAAS,wBAAwB;AACjC,SAAS,SAAS;AAIlB,MAAM,gBAAgB;AAEtB,MAAM,eAAe,CAAC,QAAgB;AACrC,MAAI;AACH,WAAO,IAAI,IAAI,GAAG;AAAA,EAC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S,gBAAgB,GAAG;AAAA,MAC5B,IAAI,CAAC,UAAU;AACd,cAAM,EAAE,YAAY,GAAG,GAAG,MAAM,IAAI,MAAM;AAC1C,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,YACT,YAAY;AAAA,UACb;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,IACA,CAAC,SAAS,eAAe,GAAG;AAAA,MAC3B,IAAI,CAAC,UAAU;AACd,cAAM,EAAE,WAAW,GAAG,GAAG,MAAM,IAAI,MAAM;AACzC,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,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,13 @@
|
|
|
1
|
+
import { defineMigrations } from "@bigbluebutton/store";
|
|
2
|
+
import { T } from "@bigbluebutton/validate";
|
|
3
|
+
const frameShapeProps = {
|
|
4
|
+
w: T.nonZeroNumber,
|
|
5
|
+
h: T.nonZeroNumber,
|
|
6
|
+
name: T.string
|
|
7
|
+
};
|
|
8
|
+
const frameShapeMigrations = defineMigrations({});
|
|
9
|
+
export {
|
|
10
|
+
frameShapeMigrations,
|
|
11
|
+
frameShapeProps
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=TLFrameShape.mjs.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,SAAS,wBAAwB;AACjC,SAAS,SAAS;AAIX,MAAM,kBAAkB;AAAA,EAC9B,GAAG,EAAE;AAAA,EACL,GAAG,EAAE;AAAA,EACL,MAAM,EAAE;AACT;AAQO,MAAM,uBAAuB,iBAAiB,CAAC,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { defineMigrations } from "@bigbluebutton/store";
|
|
2
|
+
import { T } from "@bigbluebutton/validate";
|
|
3
|
+
import { StyleProp } from "../styles/StyleProp.mjs";
|
|
4
|
+
import { DefaultColorStyle, DefaultLabelColorStyle } from "../styles/TLColorStyle.mjs";
|
|
5
|
+
import { DefaultDashStyle } from "../styles/TLDashStyle.mjs";
|
|
6
|
+
import { DefaultFillStyle } from "../styles/TLFillStyle.mjs";
|
|
7
|
+
import { DefaultFontStyle } from "../styles/TLFontStyle.mjs";
|
|
8
|
+
import {
|
|
9
|
+
DefaultHorizontalAlignStyle
|
|
10
|
+
} from "../styles/TLHorizontalAlignStyle.mjs";
|
|
11
|
+
import { DefaultSizeStyle } from "../styles/TLSizeStyle.mjs";
|
|
12
|
+
import { DefaultVerticalAlignStyle } from "../styles/TLVerticalAlignStyle.mjs";
|
|
13
|
+
const GeoShapeGeoStyle = StyleProp.defineEnum("tldraw:geo", {
|
|
14
|
+
defaultValue: "rectangle",
|
|
15
|
+
values: [
|
|
16
|
+
"cloud",
|
|
17
|
+
"rectangle",
|
|
18
|
+
"ellipse",
|
|
19
|
+
"triangle",
|
|
20
|
+
"diamond",
|
|
21
|
+
"pentagon",
|
|
22
|
+
"hexagon",
|
|
23
|
+
"octagon",
|
|
24
|
+
"star",
|
|
25
|
+
"rhombus",
|
|
26
|
+
"rhombus-2",
|
|
27
|
+
"oval",
|
|
28
|
+
"trapezoid",
|
|
29
|
+
"arrow-right",
|
|
30
|
+
"arrow-left",
|
|
31
|
+
"arrow-up",
|
|
32
|
+
"arrow-down",
|
|
33
|
+
"x-box",
|
|
34
|
+
"check-box"
|
|
35
|
+
]
|
|
36
|
+
});
|
|
37
|
+
const geoShapeProps = {
|
|
38
|
+
geo: GeoShapeGeoStyle,
|
|
39
|
+
labelColor: DefaultLabelColorStyle,
|
|
40
|
+
color: DefaultColorStyle,
|
|
41
|
+
fill: DefaultFillStyle,
|
|
42
|
+
dash: DefaultDashStyle,
|
|
43
|
+
size: DefaultSizeStyle,
|
|
44
|
+
font: DefaultFontStyle,
|
|
45
|
+
align: DefaultHorizontalAlignStyle,
|
|
46
|
+
verticalAlign: DefaultVerticalAlignStyle,
|
|
47
|
+
url: T.string,
|
|
48
|
+
w: T.nonZeroNumber,
|
|
49
|
+
h: T.nonZeroNumber,
|
|
50
|
+
growY: T.positiveNumber,
|
|
51
|
+
text: T.string
|
|
52
|
+
};
|
|
53
|
+
const Versions = {
|
|
54
|
+
AddUrlProp: 1,
|
|
55
|
+
AddLabelColor: 2,
|
|
56
|
+
RemoveJustify: 3,
|
|
57
|
+
AddCheckBox: 4,
|
|
58
|
+
AddVerticalAlign: 5,
|
|
59
|
+
MigrateLegacyAlign: 6,
|
|
60
|
+
AddCloud: 7
|
|
61
|
+
};
|
|
62
|
+
const geoShapeMigrations = defineMigrations({
|
|
63
|
+
currentVersion: Versions.AddCloud,
|
|
64
|
+
migrators: {
|
|
65
|
+
[Versions.AddUrlProp]: {
|
|
66
|
+
up: (shape) => {
|
|
67
|
+
return { ...shape, props: { ...shape.props, url: "" } };
|
|
68
|
+
},
|
|
69
|
+
down: (shape) => {
|
|
70
|
+
const { url: _, ...props } = shape.props;
|
|
71
|
+
return { ...shape, props };
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
[Versions.AddLabelColor]: {
|
|
75
|
+
up: (record) => {
|
|
76
|
+
return {
|
|
77
|
+
...record,
|
|
78
|
+
props: {
|
|
79
|
+
...record.props,
|
|
80
|
+
labelColor: "black"
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
},
|
|
84
|
+
down: (record) => {
|
|
85
|
+
const { labelColor: _, ...props } = record.props;
|
|
86
|
+
return {
|
|
87
|
+
...record,
|
|
88
|
+
props
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
[Versions.RemoveJustify]: {
|
|
93
|
+
up: (shape) => {
|
|
94
|
+
let newAlign = shape.props.align;
|
|
95
|
+
if (newAlign === "justify") {
|
|
96
|
+
newAlign = "start";
|
|
97
|
+
}
|
|
98
|
+
return {
|
|
99
|
+
...shape,
|
|
100
|
+
props: {
|
|
101
|
+
...shape.props,
|
|
102
|
+
align: newAlign
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
},
|
|
106
|
+
down: (shape) => {
|
|
107
|
+
return { ...shape };
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
[Versions.AddCheckBox]: {
|
|
111
|
+
up: (shape) => {
|
|
112
|
+
return { ...shape };
|
|
113
|
+
},
|
|
114
|
+
down: (shape) => {
|
|
115
|
+
return {
|
|
116
|
+
...shape,
|
|
117
|
+
props: {
|
|
118
|
+
...shape.props,
|
|
119
|
+
geo: shape.props.geo === "check-box" ? "rectangle" : shape.props.geo
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
[Versions.AddVerticalAlign]: {
|
|
125
|
+
up: (shape) => {
|
|
126
|
+
return {
|
|
127
|
+
...shape,
|
|
128
|
+
props: {
|
|
129
|
+
...shape.props,
|
|
130
|
+
verticalAlign: "middle"
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
},
|
|
134
|
+
down: (shape) => {
|
|
135
|
+
const { verticalAlign: _, ...props } = shape.props;
|
|
136
|
+
return {
|
|
137
|
+
...shape,
|
|
138
|
+
props
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
[Versions.MigrateLegacyAlign]: {
|
|
143
|
+
up: (shape) => {
|
|
144
|
+
let newAlign;
|
|
145
|
+
switch (shape.props.align) {
|
|
146
|
+
case "start":
|
|
147
|
+
newAlign = "start-legacy";
|
|
148
|
+
break;
|
|
149
|
+
case "end":
|
|
150
|
+
newAlign = "end-legacy";
|
|
151
|
+
break;
|
|
152
|
+
default:
|
|
153
|
+
newAlign = "middle-legacy";
|
|
154
|
+
break;
|
|
155
|
+
}
|
|
156
|
+
return {
|
|
157
|
+
...shape,
|
|
158
|
+
props: {
|
|
159
|
+
...shape.props,
|
|
160
|
+
align: newAlign
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
},
|
|
164
|
+
down: (shape) => {
|
|
165
|
+
let oldAlign;
|
|
166
|
+
switch (shape.props.align) {
|
|
167
|
+
case "start-legacy":
|
|
168
|
+
oldAlign = "start";
|
|
169
|
+
break;
|
|
170
|
+
case "end-legacy":
|
|
171
|
+
oldAlign = "end";
|
|
172
|
+
break;
|
|
173
|
+
case "middle-legacy":
|
|
174
|
+
oldAlign = "middle";
|
|
175
|
+
break;
|
|
176
|
+
default:
|
|
177
|
+
oldAlign = shape.props.align;
|
|
178
|
+
}
|
|
179
|
+
return {
|
|
180
|
+
...shape,
|
|
181
|
+
props: {
|
|
182
|
+
...shape.props,
|
|
183
|
+
align: oldAlign
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
[Versions.AddCloud]: {
|
|
189
|
+
up: (shape) => {
|
|
190
|
+
return shape;
|
|
191
|
+
},
|
|
192
|
+
down: (shape) => {
|
|
193
|
+
if (shape.props.geo === "cloud") {
|
|
194
|
+
return {
|
|
195
|
+
...shape,
|
|
196
|
+
props: {
|
|
197
|
+
...shape.props,
|
|
198
|
+
geo: "rectangle"
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
export {
|
|
207
|
+
GeoShapeGeoStyle,
|
|
208
|
+
Versions as GeoShapeVersions,
|
|
209
|
+
geoShapeMigrations,
|
|
210
|
+
geoShapeProps
|
|
211
|
+
};
|
|
212
|
+
//# sourceMappingURL=TLGeoShape.mjs.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,SAAS,wBAAwB;AACjC,SAAS,SAAS;AAClB,SAAS,iBAAiB;AAC1B,SAAS,mBAAmB,8BAA8B;AAC1D,SAAS,wBAAwB;AACjC,SAAS,wBAAwB;AACjC,SAAS,wBAAwB;AACjC;AAAA,EACC;AAAA,OAEM;AACP,SAAS,wBAAwB;AACjC,SAAS,iCAAiC;AAInC,MAAM,mBAAmB,UAAU,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,IACA;AAAA,IACA;AAAA,EACD;AACD,CAAC;AAMM,MAAM,gBAAgB;AAAA,EAC5B,KAAK;AAAA,EACL,YAAY;AAAA,EACZ,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AAAA,EACP,eAAe;AAAA,EACf,KAAK,EAAE;AAAA,EACP,GAAG,EAAE;AAAA,EACL,GAAG,EAAE;AAAA,EACL,OAAO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AO;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,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,SAAS,wBAAwB;AAU1B,MAAM,kBAA4C,CAAC;AAGnD,MAAM,uBAAuB,iBAAiB,CAAC,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { defineMigrations } from "@bigbluebutton/store";
|
|
2
|
+
import { T } from "@bigbluebutton/validate";
|
|
3
|
+
import { DefaultColorStyle } from "../styles/TLColorStyle.mjs";
|
|
4
|
+
import { DefaultSizeStyle } from "../styles/TLSizeStyle.mjs";
|
|
5
|
+
import { DrawShapeSegment } from "./TLDrawShape.mjs";
|
|
6
|
+
const highlightShapeProps = {
|
|
7
|
+
color: DefaultColorStyle,
|
|
8
|
+
size: DefaultSizeStyle,
|
|
9
|
+
segments: T.arrayOf(DrawShapeSegment),
|
|
10
|
+
isComplete: T.boolean,
|
|
11
|
+
isPen: T.boolean
|
|
12
|
+
};
|
|
13
|
+
const highlightShapeMigrations = defineMigrations({});
|
|
14
|
+
export {
|
|
15
|
+
highlightShapeMigrations,
|
|
16
|
+
highlightShapeProps
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=TLHighlightShape.mjs.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,SAAS,wBAAwB;AACjC,SAAS,SAAS;AAClB,SAAS,yBAAyB;AAClC,SAAS,wBAAwB;AAEjC,SAAS,wBAAwB;AAG1B,MAAM,sBAAsB;AAAA,EAClC,OAAO;AAAA,EACP,MAAM;AAAA,EACN,UAAU,EAAE,QAAQ,gBAAgB;AAAA,EACpC,YAAY,EAAE;AAAA,EACd,OAAO,EAAE;AACV;AASO,MAAM,2BAA2B,iBAAiB,CAAC,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { defineMigrations } from "@bigbluebutton/store";
|
|
2
|
+
import { T } from "@bigbluebutton/validate";
|
|
3
|
+
import { assetIdValidator } from "../assets/TLBaseAsset.mjs";
|
|
4
|
+
import { vec2dModelValidator } from "../misc/geometry-types.mjs";
|
|
5
|
+
const ImageShapeCrop = T.object({
|
|
6
|
+
topLeft: vec2dModelValidator,
|
|
7
|
+
bottomRight: vec2dModelValidator
|
|
8
|
+
});
|
|
9
|
+
const imageShapeProps = {
|
|
10
|
+
w: T.nonZeroNumber,
|
|
11
|
+
h: T.nonZeroNumber,
|
|
12
|
+
playing: T.boolean,
|
|
13
|
+
url: T.string,
|
|
14
|
+
assetId: assetIdValidator.nullable(),
|
|
15
|
+
crop: ImageShapeCrop.nullable()
|
|
16
|
+
};
|
|
17
|
+
const Versions = {
|
|
18
|
+
AddUrlProp: 1,
|
|
19
|
+
AddCropProp: 2
|
|
20
|
+
};
|
|
21
|
+
const imageShapeMigrations = defineMigrations({
|
|
22
|
+
currentVersion: Versions.AddCropProp,
|
|
23
|
+
migrators: {
|
|
24
|
+
[Versions.AddUrlProp]: {
|
|
25
|
+
up: (shape) => {
|
|
26
|
+
return { ...shape, props: { ...shape.props, url: "" } };
|
|
27
|
+
},
|
|
28
|
+
down: (shape) => {
|
|
29
|
+
const { url: _, ...props } = shape.props;
|
|
30
|
+
return { ...shape, props };
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
[Versions.AddCropProp]: {
|
|
34
|
+
up: (shape) => {
|
|
35
|
+
return { ...shape, props: { ...shape.props, crop: null } };
|
|
36
|
+
},
|
|
37
|
+
down: (shape) => {
|
|
38
|
+
const { crop: _, ...props } = shape.props;
|
|
39
|
+
return { ...shape, props };
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
export {
|
|
45
|
+
ImageShapeCrop,
|
|
46
|
+
imageShapeMigrations,
|
|
47
|
+
imageShapeProps
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=TLImageShape.mjs.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,SAAS,wBAAwB;AACjC,SAAS,SAAS;AAClB,SAAS,wBAAwB;AACjC,SAAS,2BAA2B;AAI7B,MAAM,iBAAiB,EAAE,OAAO;AAAA,EACtC,SAAS;AAAA,EACT,aAAa;AACd,CAAC;AAKM,MAAM,kBAAkB;AAAA,EAC9B,GAAG,EAAE;AAAA,EACL,GAAG,EAAE;AAAA,EACL,SAAS,EAAE;AAAA,EACX,KAAK,EAAE;AAAA,EACP,SAAS,iBAAiB,SAAS;AAAA,EACnC,MAAM,eAAe,SAAS;AAC/B;AAQA,MAAM,WAAW;AAAA,EAChB,YAAY;AAAA,EACZ,aAAa;AACd;AAGO,MAAM,uBAAuB,iBAAiB;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,50 @@
|
|
|
1
|
+
import { defineMigrations } from "@bigbluebutton/store";
|
|
2
|
+
import { deepCopy } from "@bigbluebutton/utils";
|
|
3
|
+
import { T } from "@bigbluebutton/validate";
|
|
4
|
+
import { handleValidator } from "../misc/TLHandle.mjs";
|
|
5
|
+
import { StyleProp } from "../styles/StyleProp.mjs";
|
|
6
|
+
import { DefaultColorStyle } from "../styles/TLColorStyle.mjs";
|
|
7
|
+
import { DefaultDashStyle } from "../styles/TLDashStyle.mjs";
|
|
8
|
+
import { DefaultSizeStyle } from "../styles/TLSizeStyle.mjs";
|
|
9
|
+
const LineShapeSplineStyle = StyleProp.defineEnum("tldraw:spline", {
|
|
10
|
+
defaultValue: "line",
|
|
11
|
+
values: ["cubic", "line"]
|
|
12
|
+
});
|
|
13
|
+
const lineShapeProps = {
|
|
14
|
+
color: DefaultColorStyle,
|
|
15
|
+
dash: DefaultDashStyle,
|
|
16
|
+
size: DefaultSizeStyle,
|
|
17
|
+
spline: LineShapeSplineStyle,
|
|
18
|
+
handles: T.dict(T.string, handleValidator)
|
|
19
|
+
};
|
|
20
|
+
const lineShapeVersions = {
|
|
21
|
+
AddSnapHandles: 1
|
|
22
|
+
};
|
|
23
|
+
const lineShapeMigrations = defineMigrations({
|
|
24
|
+
currentVersion: lineShapeVersions.AddSnapHandles,
|
|
25
|
+
migrators: {
|
|
26
|
+
[lineShapeVersions.AddSnapHandles]: {
|
|
27
|
+
up: (record) => {
|
|
28
|
+
const handles = deepCopy(record.props.handles);
|
|
29
|
+
for (const id in handles) {
|
|
30
|
+
handles[id].canSnap = true;
|
|
31
|
+
}
|
|
32
|
+
return { ...record, props: { ...record.props, handles } };
|
|
33
|
+
},
|
|
34
|
+
down: (record) => {
|
|
35
|
+
const handles = deepCopy(record.props.handles);
|
|
36
|
+
for (const id in handles) {
|
|
37
|
+
delete handles[id].canSnap;
|
|
38
|
+
}
|
|
39
|
+
return { ...record, props: { ...record.props, handles } };
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
export {
|
|
45
|
+
LineShapeSplineStyle,
|
|
46
|
+
lineShapeMigrations,
|
|
47
|
+
lineShapeProps,
|
|
48
|
+
lineShapeVersions
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=TLLineShape.mjs.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}\n\t\t\t\treturn { ...record, props: { ...record.props, handles } }\n\t\t\t},\n\t\t},\n\t},\n})\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,wBAAwB;AACjC,SAAS,gBAAgB;AACzB,SAAS,SAAS;AAClB,SAAS,uBAAuB;AAChC,SAAS,iBAAiB;AAC1B,SAAS,yBAAyB;AAClC,SAAS,wBAAwB;AACjC,SAAS,wBAAwB;AAI1B,MAAM,uBAAuB,UAAU,WAAW,iBAAiB;AAAA,EACzE,cAAc;AAAA,EACd,QAAQ,CAAC,SAAS,MAAM;AACzB,CAAC;AAMM,MAAM,iBAAiB;AAAA,EAC7B,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,SAAS,EAAE,KAAK,EAAE,QAAQ,eAAe;AAC1C;AASO,MAAM,oBAAoB;AAAA,EAChC,gBAAgB;AACjB;AAGO,MAAM,sBAAsB,iBAAiB;AAAA,EACnD,gBAAgB,kBAAkB;AAAA,EAClC,WAAW;AAAA,IACV,CAAC,kBAAkB,cAAc,GAAG;AAAA,MACnC,IAAI,CAAC,WAAgB;AACpB,cAAM,UAAU,SAAS,OAAO,MAAM,OAA8B;AACpE,mBAAW,MAAM,SAAS;AACzB,kBAAQ,EAAE,EAAE,UAAU;AAAA,QACvB;AACA,eAAO,EAAE,GAAG,QAAQ,OAAO,EAAE,GAAG,OAAO,OAAO,QAAQ,EAAE;AAAA,MACzD;AAAA,MACA,MAAM,CAAC,WAAgB;AACtB,cAAM,UAAU,SAAS,OAAO,MAAM,OAA8B;AACpE,mBAAW,MAAM,SAAS;AACzB,iBAAO,QAAQ,EAAE,EAAE;AAAA,QACpB;AACA,eAAO,EAAE,GAAG,QAAQ,OAAO,EAAE,GAAG,OAAO,OAAO,QAAQ,EAAE;AAAA,MACzD;AAAA,IACD;AAAA,EACD;AACD,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { defineMigrations } from "@bigbluebutton/store";
|
|
2
|
+
import { T } from "@bigbluebutton/validate";
|
|
3
|
+
import { DefaultColorStyle } from "../styles/TLColorStyle.mjs";
|
|
4
|
+
import { DefaultFontStyle } from "../styles/TLFontStyle.mjs";
|
|
5
|
+
import {
|
|
6
|
+
DefaultHorizontalAlignStyle
|
|
7
|
+
} from "../styles/TLHorizontalAlignStyle.mjs";
|
|
8
|
+
import { DefaultSizeStyle } from "../styles/TLSizeStyle.mjs";
|
|
9
|
+
import { DefaultVerticalAlignStyle } from "../styles/TLVerticalAlignStyle.mjs";
|
|
10
|
+
const noteShapeProps = {
|
|
11
|
+
color: DefaultColorStyle,
|
|
12
|
+
size: DefaultSizeStyle,
|
|
13
|
+
font: DefaultFontStyle,
|
|
14
|
+
align: DefaultHorizontalAlignStyle,
|
|
15
|
+
verticalAlign: DefaultVerticalAlignStyle,
|
|
16
|
+
growY: T.positiveNumber,
|
|
17
|
+
url: T.string,
|
|
18
|
+
text: T.string
|
|
19
|
+
};
|
|
20
|
+
const Versions = {
|
|
21
|
+
AddUrlProp: 1,
|
|
22
|
+
RemoveJustify: 2,
|
|
23
|
+
MigrateLegacyAlign: 3,
|
|
24
|
+
AddVerticalAlign: 4
|
|
25
|
+
};
|
|
26
|
+
const noteShapeMigrations = defineMigrations({
|
|
27
|
+
currentVersion: Versions.AddVerticalAlign,
|
|
28
|
+
migrators: {
|
|
29
|
+
[Versions.AddUrlProp]: {
|
|
30
|
+
up: (shape) => {
|
|
31
|
+
return { ...shape, props: { ...shape.props, url: "" } };
|
|
32
|
+
},
|
|
33
|
+
down: (shape) => {
|
|
34
|
+
const { url: _, ...props } = shape.props;
|
|
35
|
+
return { ...shape, props };
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
[Versions.RemoveJustify]: {
|
|
39
|
+
up: (shape) => {
|
|
40
|
+
let newAlign = shape.props.align;
|
|
41
|
+
if (newAlign === "justify") {
|
|
42
|
+
newAlign = "start";
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
...shape,
|
|
46
|
+
props: {
|
|
47
|
+
...shape.props,
|
|
48
|
+
align: newAlign
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
},
|
|
52
|
+
down: (shape) => {
|
|
53
|
+
return { ...shape };
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
[Versions.MigrateLegacyAlign]: {
|
|
57
|
+
up: (shape) => {
|
|
58
|
+
let newAlign;
|
|
59
|
+
switch (shape.props.align) {
|
|
60
|
+
case "start":
|
|
61
|
+
newAlign = "start-legacy";
|
|
62
|
+
break;
|
|
63
|
+
case "end":
|
|
64
|
+
newAlign = "end-legacy";
|
|
65
|
+
break;
|
|
66
|
+
default:
|
|
67
|
+
newAlign = "middle-legacy";
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
return {
|
|
71
|
+
...shape,
|
|
72
|
+
props: {
|
|
73
|
+
...shape.props,
|
|
74
|
+
align: newAlign
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
},
|
|
78
|
+
down: (shape) => {
|
|
79
|
+
let oldAlign;
|
|
80
|
+
switch (shape.props.align) {
|
|
81
|
+
case "start-legacy":
|
|
82
|
+
oldAlign = "start";
|
|
83
|
+
break;
|
|
84
|
+
case "end-legacy":
|
|
85
|
+
oldAlign = "end";
|
|
86
|
+
break;
|
|
87
|
+
case "middle-legacy":
|
|
88
|
+
oldAlign = "middle";
|
|
89
|
+
break;
|
|
90
|
+
default:
|
|
91
|
+
oldAlign = shape.props.align;
|
|
92
|
+
}
|
|
93
|
+
return {
|
|
94
|
+
...shape,
|
|
95
|
+
props: {
|
|
96
|
+
...shape.props,
|
|
97
|
+
align: oldAlign
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
[Versions.AddVerticalAlign]: {
|
|
103
|
+
up: (shape) => {
|
|
104
|
+
return {
|
|
105
|
+
...shape,
|
|
106
|
+
props: {
|
|
107
|
+
...shape.props,
|
|
108
|
+
verticalAlign: "middle"
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
},
|
|
112
|
+
down: (shape) => {
|
|
113
|
+
const { verticalAlign: _, ...props } = shape.props;
|
|
114
|
+
return {
|
|
115
|
+
...shape,
|
|
116
|
+
props
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
export {
|
|
123
|
+
noteShapeMigrations,
|
|
124
|
+
noteShapeProps
|
|
125
|
+
};
|
|
126
|
+
//# sourceMappingURL=TLNoteShape.mjs.map
|