@bigbluebutton/tldraw 2.0.0-alpha.24 → 2.0.0-alpha.25
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/dist-cjs/index.d.ts +9 -1
- package/dist-cjs/lib/defaultShapeUtils.js +3 -1
- package/dist-cjs/lib/defaultShapeUtils.js.map +2 -2
- package/dist-cjs/lib/shapes/arrow/ArrowShapeUtil.js.map +2 -2
- package/dist-cjs/lib/shapes/poll/PollShapeTool.js +30 -0
- package/dist-cjs/lib/shapes/poll/PollShapeTool.js.map +7 -0
- package/dist-cjs/lib/shapes/poll/PollShapeUtil.js +121 -0
- package/dist-cjs/lib/shapes/poll/PollShapeUtil.js.map +7 -0
- package/dist-cjs/lib/shapes/poll/components/poll-content.js +101 -0
- package/dist-cjs/lib/shapes/poll/components/poll-content.js.map +7 -0
- package/dist-cjs/lib/shapes/poll/components/styles.js +53 -0
- package/dist-cjs/lib/shapes/poll/components/styles.js.map +7 -0
- package/dist-cjs/lib/shapes/poll/poll-shape-migrations.js +45 -0
- package/dist-cjs/lib/shapes/poll/poll-shape-migrations.js.map +7 -0
- package/dist-cjs/lib/shapes/poll/poll-shape-props.js +39 -0
- package/dist-cjs/lib/shapes/poll/poll-shape-props.js.map +7 -0
- package/dist-cjs/lib/shapes/poll/poll-shape-types.js +17 -0
- package/dist-cjs/lib/shapes/poll/poll-shape-types.js.map +7 -0
- package/dist-cjs/lib/tools/HandTool/HandTool.js +3 -3
- package/dist-cjs/lib/tools/HandTool/HandTool.js.map +2 -2
- package/dist-cjs/lib/ui/components/ContextMenu.js +0 -1
- package/dist-cjs/lib/ui/components/ContextMenu.js.map +2 -2
- package/dist-cjs/lib/ui/hooks/useTranslation/TLUiTranslationKey.js.map +1 -1
- package/dist-cjs/lib/ui/hooks/useTranslation/defaultTranslation.js +6 -1
- package/dist-cjs/lib/ui/hooks/useTranslation/defaultTranslation.js.map +2 -2
- package/dist-esm/index.d.mts +9 -1
- package/dist-esm/lib/defaultShapeUtils.mjs +3 -1
- package/dist-esm/lib/defaultShapeUtils.mjs.map +2 -2
- package/dist-esm/lib/shapes/arrow/ArrowShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/shapes/poll/PollShapeTool.mjs +10 -0
- package/dist-esm/lib/shapes/poll/PollShapeTool.mjs.map +7 -0
- package/dist-esm/lib/shapes/poll/PollShapeUtil.mjs +97 -0
- package/dist-esm/lib/shapes/poll/PollShapeUtil.mjs.map +7 -0
- package/dist-esm/lib/shapes/poll/components/poll-content.mjs +71 -0
- package/dist-esm/lib/shapes/poll/components/poll-content.mjs.map +7 -0
- package/dist-esm/lib/shapes/poll/components/styles.mjs +23 -0
- package/dist-esm/lib/shapes/poll/components/styles.mjs.map +7 -0
- package/dist-esm/lib/shapes/poll/poll-shape-migrations.mjs +25 -0
- package/dist-esm/lib/shapes/poll/poll-shape-migrations.mjs.map +7 -0
- package/dist-esm/lib/shapes/poll/poll-shape-props.mjs +19 -0
- package/dist-esm/lib/shapes/poll/poll-shape-props.mjs.map +7 -0
- package/dist-esm/lib/shapes/poll/poll-shape-types.mjs +1 -0
- package/dist-esm/lib/shapes/poll/poll-shape-types.mjs.map +7 -0
- package/dist-esm/lib/tools/HandTool/HandTool.mjs +3 -3
- package/dist-esm/lib/tools/HandTool/HandTool.mjs.map +2 -2
- package/dist-esm/lib/ui/components/ContextMenu.mjs +0 -1
- package/dist-esm/lib/ui/components/ContextMenu.mjs.map +2 -2
- package/dist-esm/lib/ui/hooks/useTranslation/defaultTranslation.mjs +6 -1
- package/dist-esm/lib/ui/hooks/useTranslation/defaultTranslation.mjs.map +2 -2
- package/package.json +4 -3
- package/src/lib/Tldraw.test.tsx +9 -13
- package/src/lib/defaultShapeUtils.ts +2 -0
- package/src/lib/shapes/arrow/ArrowShapeUtil.tsx +1 -1
- package/src/lib/shapes/line/__snapshots__/LineShapeUtil.test.ts.snap +6 -6
- package/src/lib/shapes/poll/PollShapeTool.tsx +7 -0
- package/src/lib/shapes/poll/PollShapeUtil.tsx +108 -0
- package/src/lib/shapes/poll/components/poll-content.tsx +100 -0
- package/src/lib/shapes/poll/components/styles.ts +21 -0
- package/src/lib/shapes/poll/poll-shape-migrations.ts +23 -0
- package/src/lib/shapes/poll/poll-shape-props.ts +17 -0
- package/src/lib/shapes/poll/poll-shape-types.ts +21 -0
- package/src/lib/tools/HandTool/HandTool.ts +4 -5
- package/src/lib/ui/components/ContextMenu.tsx +1 -1
- package/src/lib/ui/hooks/useTranslation/TLUiTranslationKey.ts +5 -0
- package/src/lib/ui/hooks/useTranslation/defaultTranslation.ts +5 -0
- package/src/test/Editor.test.tsx +2 -2
- package/src/test/HandTool.test.ts +55 -56
- package/src/test/TLSessionStateSnapshot.test.ts +5 -5
- package/src/test/TestEditor.ts +4 -1
- package/src/test/TldrawEditor.test.tsx +28 -30
- package/src/test/__snapshots__/resizing.test.ts.snap +8 -8
- package/src/test/commands/__snapshots__/packShapes.test.ts.snap +20 -20
- package/src/test/commands/__snapshots__/zoomToFit.test.ts.snap +2 -2
- package/src/test/commands/createShapes.test.ts +1 -1
- package/src/test/commands/putContent.test.ts +4 -4
- package/src/test/commands/updateShapes.test.ts +1 -1
- package/src/test/resizing.test.ts +203 -203
- package/src/test/selection-omnibus.test.ts +41 -41
- package/src/test/test-jsx.tsx +7 -3
- package/src/test/translating.test.ts +42 -42
package/dist-cjs/index.d.ts
CHANGED
|
@@ -838,6 +838,7 @@ export declare class GeoShapeUtil extends BaseBoxShapeUtil<TLGeoShape> {
|
|
|
838
838
|
isLocked: boolean;
|
|
839
839
|
opacity: number;
|
|
840
840
|
meta: JsonObject;
|
|
841
|
+
whiteboardId?: string | undefined;
|
|
841
842
|
id: TLShapeId;
|
|
842
843
|
typeName: "shape";
|
|
843
844
|
} | undefined;
|
|
@@ -867,6 +868,7 @@ export declare class GeoShapeUtil extends BaseBoxShapeUtil<TLGeoShape> {
|
|
|
867
868
|
isLocked: boolean;
|
|
868
869
|
opacity: number;
|
|
869
870
|
meta: JsonObject;
|
|
871
|
+
whiteboardId?: string | undefined;
|
|
870
872
|
id: TLShapeId;
|
|
871
873
|
typeName: "shape";
|
|
872
874
|
} | undefined;
|
|
@@ -883,6 +885,7 @@ export declare class GeoShapeUtil extends BaseBoxShapeUtil<TLGeoShape> {
|
|
|
883
885
|
isLocked: boolean;
|
|
884
886
|
opacity: number;
|
|
885
887
|
meta: JsonObject;
|
|
888
|
+
whiteboardId?: string | undefined;
|
|
886
889
|
id: TLShapeId;
|
|
887
890
|
typeName: "shape";
|
|
888
891
|
} | {
|
|
@@ -898,6 +901,7 @@ export declare class GeoShapeUtil extends BaseBoxShapeUtil<TLGeoShape> {
|
|
|
898
901
|
isLocked: boolean;
|
|
899
902
|
opacity: number;
|
|
900
903
|
meta: JsonObject;
|
|
904
|
+
whiteboardId?: string | undefined;
|
|
901
905
|
id: TLShapeId;
|
|
902
906
|
typeName: "shape";
|
|
903
907
|
} | undefined;
|
|
@@ -1315,6 +1319,7 @@ export declare class NoteShapeUtil extends ShapeUtil<TLNoteShape> {
|
|
|
1315
1319
|
isLocked: boolean;
|
|
1316
1320
|
opacity: number;
|
|
1317
1321
|
meta: JsonObject;
|
|
1322
|
+
whiteboardId?: string | undefined;
|
|
1318
1323
|
id: TLShapeId;
|
|
1319
1324
|
typeName: "shape";
|
|
1320
1325
|
} | undefined;
|
|
@@ -1338,6 +1343,7 @@ export declare class NoteShapeUtil extends ShapeUtil<TLNoteShape> {
|
|
|
1338
1343
|
isLocked: boolean;
|
|
1339
1344
|
opacity: number;
|
|
1340
1345
|
meta: JsonObject;
|
|
1346
|
+
whiteboardId?: string | undefined;
|
|
1341
1347
|
id: TLShapeId;
|
|
1342
1348
|
typeName: "shape";
|
|
1343
1349
|
} | undefined;
|
|
@@ -1954,6 +1960,7 @@ export declare class TextShapeUtil extends ShapeUtil<TLTextShape> {
|
|
|
1954
1960
|
autoSize: boolean;
|
|
1955
1961
|
};
|
|
1956
1962
|
meta: JsonObject;
|
|
1963
|
+
whiteboardId?: string | undefined;
|
|
1957
1964
|
id: TLShapeId;
|
|
1958
1965
|
typeName: "shape";
|
|
1959
1966
|
} | undefined;
|
|
@@ -1978,6 +1985,7 @@ export declare class TextShapeUtil extends ShapeUtil<TLTextShape> {
|
|
|
1978
1985
|
isLocked: boolean;
|
|
1979
1986
|
opacity: number;
|
|
1980
1987
|
meta: JsonObject;
|
|
1988
|
+
whiteboardId?: string | undefined;
|
|
1981
1989
|
id: TLShapeId;
|
|
1982
1990
|
typeName: "shape";
|
|
1983
1991
|
} | undefined;
|
|
@@ -2595,7 +2603,7 @@ export declare type TLUiTranslation = {
|
|
|
2595
2603
|
export declare type TLUiTranslationContextType = TLUiTranslation;
|
|
2596
2604
|
|
|
2597
2605
|
/** @public */
|
|
2598
|
-
export declare type TLUiTranslationKey = 'action.align-bottom' | 'action.align-center-horizontal.short' | 'action.align-center-horizontal' | 'action.align-center-vertical.short' | 'action.align-center-vertical' | 'action.align-left' | 'action.align-right' | 'action.align-top' | 'action.back-to-content' | 'action.bring-forward' | 'action.bring-to-front' | 'action.convert-to-bookmark' | 'action.convert-to-embed' | 'action.copy-as-json.short' | 'action.copy-as-json' | 'action.copy-as-png.short' | 'action.copy-as-png' | 'action.copy-as-svg.short' | 'action.copy-as-svg' | 'action.copy' | 'action.cut' | 'action.delete' | 'action.distribute-horizontal.short' | 'action.distribute-horizontal' | 'action.distribute-vertical.short' | 'action.distribute-vertical' | 'action.duplicate' | 'action.edit-link' | 'action.exit-pen-mode' | 'action.export-as-json.short' | 'action.export-as-json' | 'action.export-as-png.short' | 'action.export-as-png' | 'action.export-as-svg.short' | 'action.export-as-svg' | 'action.fit-frame-to-content' | 'action.flip-horizontal.short' | 'action.flip-horizontal' | 'action.flip-vertical.short' | 'action.flip-vertical' | 'action.fork-project' | 'action.group' | 'action.insert-embed' | 'action.insert-media' | 'action.leave-shared-project' | 'action.new-project' | 'action.new-shared-project' | 'action.open-cursor-chat' | 'action.open-embed-link' | 'action.open-file' | 'action.pack' | 'action.paste' | 'action.print' | 'action.redo' | 'action.remove-frame' | 'action.rotate-ccw' | 'action.rotate-cw' | 'action.save-copy' | 'action.select-all' | 'action.select-none' | 'action.send-backward' | 'action.send-to-back' | 'action.share-project' | 'action.stack-horizontal.short' | 'action.stack-horizontal' | 'action.stack-vertical.short' | 'action.stack-vertical' | 'action.stop-following' | 'action.stretch-horizontal.short' | 'action.stretch-horizontal' | 'action.stretch-vertical.short' | 'action.stretch-vertical' | 'action.toggle-auto-size' | 'action.toggle-dark-mode.menu' | 'action.toggle-dark-mode' | 'action.toggle-debug-mode.menu' | 'action.toggle-debug-mode' | 'action.toggle-edge-scrolling.menu' | 'action.toggle-edge-scrolling' | 'action.toggle-focus-mode.menu' | 'action.toggle-focus-mode' | 'action.toggle-grid.menu' | 'action.toggle-grid' | 'action.toggle-lock' | 'action.toggle-reduce-motion.menu' | 'action.toggle-reduce-motion' | 'action.toggle-snap-mode.menu' | 'action.toggle-snap-mode' | 'action.toggle-tool-lock.menu' | 'action.toggle-tool-lock' | 'action.toggle-transparent.context-menu' | 'action.toggle-transparent.menu' | 'action.toggle-transparent' | 'action.undo' | 'action.ungroup' | 'action.unlock-all' | 'action.zoom-in' | 'action.zoom-out' | 'action.zoom-to-100' | 'action.zoom-to-fit' | 'action.zoom-to-selection' | 'actions-menu.title' | 'align-style.end' | 'align-style.justify' | 'align-style.middle' | 'align-style.start' | 'arrowheadEnd-style.arrow' | 'arrowheadEnd-style.bar' | 'arrowheadEnd-style.diamond' | 'arrowheadEnd-style.dot' | 'arrowheadEnd-style.inverted' | 'arrowheadEnd-style.none' | 'arrowheadEnd-style.pipe' | 'arrowheadEnd-style.square' | 'arrowheadEnd-style.triangle' | 'arrowheadStart-style.arrow' | 'arrowheadStart-style.bar' | 'arrowheadStart-style.diamond' | 'arrowheadStart-style.dot' | 'arrowheadStart-style.inverted' | 'arrowheadStart-style.none' | 'arrowheadStart-style.pipe' | 'arrowheadStart-style.square' | 'arrowheadStart-style.triangle' | 'color-style.black' | 'color-style.blue' | 'color-style.green' | 'color-style.grey' | 'color-style.light-blue' | 'color-style.light-green' | 'color-style.light-red' | 'color-style.light-violet' | 'color-style.orange' | 'color-style.red' | 'color-style.violet' | 'color-style.yellow' | 'context-menu.arrange' | 'context-menu.copy-as' | 'context-menu.export-as' | 'context-menu.move-to-page' | 'context-menu.reorder' | 'context.pages.new-page' | 'cursor-chat.type-to-chat' | 'dash-style.dashed' | 'dash-style.dotted' | 'dash-style.draw' | 'dash-style.solid' | 'debug-panel.more' | 'edit-link-dialog.cancel' | 'edit-link-dialog.clear' | 'edit-link-dialog.detail' | 'edit-link-dialog.invalid-url' | 'edit-link-dialog.save' | 'edit-link-dialog.title' | 'edit-link-dialog.url' | 'edit-pages-dialog.move-down' | 'edit-pages-dialog.move-up' | 'embed-dialog.back' | 'embed-dialog.cancel' | 'embed-dialog.create' | 'embed-dialog.instruction' | 'embed-dialog.invalid-url' | 'embed-dialog.title' | 'embed-dialog.url' | 'file-system.confirm-clear.cancel' | 'file-system.confirm-clear.continue' | 'file-system.confirm-clear.description' | 'file-system.confirm-clear.dont-show-again' | 'file-system.confirm-clear.title' | 'file-system.confirm-open.cancel' | 'file-system.confirm-open.description' | 'file-system.confirm-open.dont-show-again' | 'file-system.confirm-open.open' | 'file-system.confirm-open.title' | 'file-system.file-open-error.file-format-version-too-new' | 'file-system.file-open-error.generic-corrupted-file' | 'file-system.file-open-error.not-a-tldraw-file' | 'file-system.file-open-error.title' | 'file-system.shared-document-file-open-error.description' | 'file-system.shared-document-file-open-error.title' | 'fill-style.none' | 'fill-style.pattern' | 'fill-style.semi' | 'fill-style.solid' | 'focus-mode.toggle-focus-mode' | 'font-style.draw' | 'font-style.mono' | 'font-style.sans' | 'font-style.serif' | 'geo-style.arrow-down' | 'geo-style.arrow-left' | 'geo-style.arrow-right' | 'geo-style.arrow-up' | 'geo-style.check-box' | 'geo-style.cloud' | 'geo-style.diamond' | 'geo-style.ellipse' | 'geo-style.hexagon' | 'geo-style.octagon' | 'geo-style.oval' | 'geo-style.pentagon' | 'geo-style.rectangle' | 'geo-style.rhombus-2' | 'geo-style.rhombus' | 'geo-style.star' | 'geo-style.trapezoid' | 'geo-style.triangle' | 'geo-style.x-box' | 'help-menu.about' | 'help-menu.discord' | 'help-menu.github' | 'help-menu.keyboard-shortcuts' | 'help-menu.title' | 'help-menu.twitter' | 'home-project-dialog.description' | 'home-project-dialog.ok' | 'home-project-dialog.title' | 'menu.copy-as' | 'menu.edit' | 'menu.export-as' | 'menu.file' | 'menu.language' | 'menu.preferences' | 'menu.title' | 'menu.view' | 'navigation-zone.toggle-minimap' | 'navigation-zone.zoom' | 'opacity-style.0.1' | 'opacity-style.0.25' | 'opacity-style.0.5' | 'opacity-style.0.75' | 'opacity-style.1' | 'page-menu.create-new-page' | 'page-menu.edit-done' | 'page-menu.edit-start' | 'page-menu.go-to-page' | 'page-menu.max-page-count-reached' | 'page-menu.new-page-initial-name' | 'page-menu.submenu.delete' | 'page-menu.submenu.duplicate-page' | 'page-menu.submenu.move-down' | 'page-menu.submenu.move-up' | 'page-menu.submenu.rename' | 'page-menu.submenu.title' | 'page-menu.title' | 'people-menu.change-color' | 'people-menu.change-name' | 'people-menu.follow' | 'people-menu.following' | 'people-menu.invite' | 'people-menu.leading' | 'people-menu.title' | 'people-menu.user' | 'rename-project-dialog.cancel' | 'rename-project-dialog.rename' | 'rename-project-dialog.title' | 'share-menu.copy-link-note' | 'share-menu.copy-link' | 'share-menu.copy-readonly-link-note' | 'share-menu.copy-readonly-link' | 'share-menu.create-snapshot-link' | 'share-menu.default-project-name' | 'share-menu.fork-note' | 'share-menu.offline-note' | 'share-menu.project-too-large' | 'share-menu.readonly-link' | 'share-menu.save-note' | 'share-menu.share-project' | 'share-menu.snapshot-link-note' | 'share-menu.title' | 'share-menu.upload-failed' | 'sharing.confirm-leave.cancel' | 'sharing.confirm-leave.description' | 'sharing.confirm-leave.dont-show-again' | 'sharing.confirm-leave.leave' | 'sharing.confirm-leave.title' | 'shortcuts-dialog.collaboration' | 'shortcuts-dialog.edit' | 'shortcuts-dialog.file' | 'shortcuts-dialog.preferences' | 'shortcuts-dialog.title' | 'shortcuts-dialog.tools' | 'shortcuts-dialog.transform' | 'shortcuts-dialog.view' | 'size-style.l' | 'size-style.m' | 'size-style.s' | 'size-style.xl' | 'spline-style.cubic' | 'spline-style.line' | 'status.offline' | 'status.online' | 'style-panel.align' | 'style-panel.arrowhead-end' | 'style-panel.arrowhead-start' | 'style-panel.arrowheads' | 'style-panel.color' | 'style-panel.dash' | 'style-panel.fill' | 'style-panel.font' | 'style-panel.geo' | 'style-panel.mixed' | 'style-panel.opacity' | 'style-panel.position' | 'style-panel.size' | 'style-panel.spline' | 'style-panel.title' | 'style-panel.vertical-align' | 'toast.close' | 'toast.error.copy-fail.desc' | 'toast.error.copy-fail.title' | 'toast.error.export-fail.desc' | 'toast.error.export-fail.title' | 'tool-panel.drawing' | 'tool-panel.more' | 'tool-panel.shapes' | 'tool.arrow-down' | 'tool.arrow-left' | 'tool.arrow-right' | 'tool.arrow-up' | 'tool.arrow' | 'tool.asset' | 'tool.check-box' | 'tool.cloud' | 'tool.diamond' | 'tool.draw' | 'tool.ellipse' | 'tool.embed' | 'tool.eraser' | 'tool.frame' | 'tool.hand' | 'tool.hexagon' | 'tool.highlight' | 'tool.laser' | 'tool.line' | 'tool.note' | 'tool.octagon' | 'tool.oval' | 'tool.pentagon' | 'tool.rectangle' | 'tool.rhombus' | 'tool.select' | 'tool.star' | 'tool.text' | 'tool.trapezoid' | 'tool.triangle' | 'tool.x-box' | 'vscode.file-open.backup-failed' | 'vscode.file-open.backup-saved' | 'vscode.file-open.backup' | 'vscode.file-open.desc' | 'vscode.file-open.dont-show-again' | 'vscode.file-open.open';
|
|
2606
|
+
export declare type TLUiTranslationKey = 'action.align-bottom' | 'action.align-center-horizontal.short' | 'action.align-center-horizontal' | 'action.align-center-vertical.short' | 'action.align-center-vertical' | 'action.align-left' | 'action.align-right' | 'action.align-top' | 'action.back-to-content' | 'action.bring-forward' | 'action.bring-to-front' | 'action.convert-to-bookmark' | 'action.convert-to-embed' | 'action.copy-as-json.short' | 'action.copy-as-json' | 'action.copy-as-png.short' | 'action.copy-as-png' | 'action.copy-as-svg.short' | 'action.copy-as-svg' | 'action.copy' | 'action.cut' | 'action.delete' | 'action.distribute-horizontal.short' | 'action.distribute-horizontal' | 'action.distribute-vertical.short' | 'action.distribute-vertical' | 'action.duplicate' | 'action.edit-link' | 'action.exit-pen-mode' | 'action.export-as-json.short' | 'action.export-as-json' | 'action.export-as-png.short' | 'action.export-as-png' | 'action.export-as-svg.short' | 'action.export-as-svg' | 'action.fit-frame-to-content' | 'action.flip-horizontal.short' | 'action.flip-horizontal' | 'action.flip-vertical.short' | 'action.flip-vertical' | 'action.fork-project' | 'action.group' | 'action.insert-embed' | 'action.insert-media' | 'action.leave-shared-project' | 'action.new-project' | 'action.new-shared-project' | 'action.open-cursor-chat' | 'action.open-embed-link' | 'action.open-file' | 'action.pack' | 'action.paste' | 'action.print' | 'action.redo' | 'action.remove-frame' | 'action.rotate-ccw' | 'action.rotate-cw' | 'action.save-copy' | 'action.select-all' | 'action.select-none' | 'action.send-backward' | 'action.send-to-back' | 'action.share-project' | 'action.stack-horizontal.short' | 'action.stack-horizontal' | 'action.stack-vertical.short' | 'action.stack-vertical' | 'action.stop-following' | 'action.stretch-horizontal.short' | 'action.stretch-horizontal' | 'action.stretch-vertical.short' | 'action.stretch-vertical' | 'action.toggle-auto-size' | 'action.toggle-dark-mode.menu' | 'action.toggle-dark-mode' | 'action.toggle-debug-mode.menu' | 'action.toggle-debug-mode' | 'action.toggle-edge-scrolling.menu' | 'action.toggle-edge-scrolling' | 'action.toggle-focus-mode.menu' | 'action.toggle-focus-mode' | 'action.toggle-grid.menu' | 'action.toggle-grid' | 'action.toggle-lock' | 'action.toggle-reduce-motion.menu' | 'action.toggle-reduce-motion' | 'action.toggle-snap-mode.menu' | 'action.toggle-snap-mode' | 'action.toggle-tool-lock.menu' | 'action.toggle-tool-lock' | 'action.toggle-transparent.context-menu' | 'action.toggle-transparent.menu' | 'action.toggle-transparent' | 'action.undo' | 'action.ungroup' | 'action.unlock-all' | 'action.zoom-in' | 'action.zoom-out' | 'action.zoom-to-100' | 'action.zoom-to-fit' | 'action.zoom-to-selection' | 'actions-menu.title' | 'align-style.end' | 'align-style.justify' | 'align-style.middle' | 'align-style.start' | 'app.poll.abstention' | 'app.poll.f' | 'app.poll.n' | 'app.poll.t' | 'app.poll.y' | 'arrowheadEnd-style.arrow' | 'arrowheadEnd-style.bar' | 'arrowheadEnd-style.diamond' | 'arrowheadEnd-style.dot' | 'arrowheadEnd-style.inverted' | 'arrowheadEnd-style.none' | 'arrowheadEnd-style.pipe' | 'arrowheadEnd-style.square' | 'arrowheadEnd-style.triangle' | 'arrowheadStart-style.arrow' | 'arrowheadStart-style.bar' | 'arrowheadStart-style.diamond' | 'arrowheadStart-style.dot' | 'arrowheadStart-style.inverted' | 'arrowheadStart-style.none' | 'arrowheadStart-style.pipe' | 'arrowheadStart-style.square' | 'arrowheadStart-style.triangle' | 'color-style.black' | 'color-style.blue' | 'color-style.green' | 'color-style.grey' | 'color-style.light-blue' | 'color-style.light-green' | 'color-style.light-red' | 'color-style.light-violet' | 'color-style.orange' | 'color-style.red' | 'color-style.violet' | 'color-style.yellow' | 'context-menu.arrange' | 'context-menu.copy-as' | 'context-menu.export-as' | 'context-menu.move-to-page' | 'context-menu.reorder' | 'context.pages.new-page' | 'cursor-chat.type-to-chat' | 'dash-style.dashed' | 'dash-style.dotted' | 'dash-style.draw' | 'dash-style.solid' | 'debug-panel.more' | 'edit-link-dialog.cancel' | 'edit-link-dialog.clear' | 'edit-link-dialog.detail' | 'edit-link-dialog.invalid-url' | 'edit-link-dialog.save' | 'edit-link-dialog.title' | 'edit-link-dialog.url' | 'edit-pages-dialog.move-down' | 'edit-pages-dialog.move-up' | 'embed-dialog.back' | 'embed-dialog.cancel' | 'embed-dialog.create' | 'embed-dialog.instruction' | 'embed-dialog.invalid-url' | 'embed-dialog.title' | 'embed-dialog.url' | 'file-system.confirm-clear.cancel' | 'file-system.confirm-clear.continue' | 'file-system.confirm-clear.description' | 'file-system.confirm-clear.dont-show-again' | 'file-system.confirm-clear.title' | 'file-system.confirm-open.cancel' | 'file-system.confirm-open.description' | 'file-system.confirm-open.dont-show-again' | 'file-system.confirm-open.open' | 'file-system.confirm-open.title' | 'file-system.file-open-error.file-format-version-too-new' | 'file-system.file-open-error.generic-corrupted-file' | 'file-system.file-open-error.not-a-tldraw-file' | 'file-system.file-open-error.title' | 'file-system.shared-document-file-open-error.description' | 'file-system.shared-document-file-open-error.title' | 'fill-style.none' | 'fill-style.pattern' | 'fill-style.semi' | 'fill-style.solid' | 'focus-mode.toggle-focus-mode' | 'font-style.draw' | 'font-style.mono' | 'font-style.sans' | 'font-style.serif' | 'geo-style.arrow-down' | 'geo-style.arrow-left' | 'geo-style.arrow-right' | 'geo-style.arrow-up' | 'geo-style.check-box' | 'geo-style.cloud' | 'geo-style.diamond' | 'geo-style.ellipse' | 'geo-style.hexagon' | 'geo-style.octagon' | 'geo-style.oval' | 'geo-style.pentagon' | 'geo-style.rectangle' | 'geo-style.rhombus-2' | 'geo-style.rhombus' | 'geo-style.star' | 'geo-style.trapezoid' | 'geo-style.triangle' | 'geo-style.x-box' | 'help-menu.about' | 'help-menu.discord' | 'help-menu.github' | 'help-menu.keyboard-shortcuts' | 'help-menu.title' | 'help-menu.twitter' | 'home-project-dialog.description' | 'home-project-dialog.ok' | 'home-project-dialog.title' | 'menu.copy-as' | 'menu.edit' | 'menu.export-as' | 'menu.file' | 'menu.language' | 'menu.preferences' | 'menu.title' | 'menu.view' | 'navigation-zone.toggle-minimap' | 'navigation-zone.zoom' | 'opacity-style.0.1' | 'opacity-style.0.25' | 'opacity-style.0.5' | 'opacity-style.0.75' | 'opacity-style.1' | 'page-menu.create-new-page' | 'page-menu.edit-done' | 'page-menu.edit-start' | 'page-menu.go-to-page' | 'page-menu.max-page-count-reached' | 'page-menu.new-page-initial-name' | 'page-menu.submenu.delete' | 'page-menu.submenu.duplicate-page' | 'page-menu.submenu.move-down' | 'page-menu.submenu.move-up' | 'page-menu.submenu.rename' | 'page-menu.submenu.title' | 'page-menu.title' | 'people-menu.change-color' | 'people-menu.change-name' | 'people-menu.follow' | 'people-menu.following' | 'people-menu.invite' | 'people-menu.leading' | 'people-menu.title' | 'people-menu.user' | 'rename-project-dialog.cancel' | 'rename-project-dialog.rename' | 'rename-project-dialog.title' | 'share-menu.copy-link-note' | 'share-menu.copy-link' | 'share-menu.copy-readonly-link-note' | 'share-menu.copy-readonly-link' | 'share-menu.create-snapshot-link' | 'share-menu.default-project-name' | 'share-menu.fork-note' | 'share-menu.offline-note' | 'share-menu.project-too-large' | 'share-menu.readonly-link' | 'share-menu.save-note' | 'share-menu.share-project' | 'share-menu.snapshot-link-note' | 'share-menu.title' | 'share-menu.upload-failed' | 'sharing.confirm-leave.cancel' | 'sharing.confirm-leave.description' | 'sharing.confirm-leave.dont-show-again' | 'sharing.confirm-leave.leave' | 'sharing.confirm-leave.title' | 'shortcuts-dialog.collaboration' | 'shortcuts-dialog.edit' | 'shortcuts-dialog.file' | 'shortcuts-dialog.preferences' | 'shortcuts-dialog.title' | 'shortcuts-dialog.tools' | 'shortcuts-dialog.transform' | 'shortcuts-dialog.view' | 'size-style.l' | 'size-style.m' | 'size-style.s' | 'size-style.xl' | 'spline-style.cubic' | 'spline-style.line' | 'status.offline' | 'status.online' | 'style-panel.align' | 'style-panel.arrowhead-end' | 'style-panel.arrowhead-start' | 'style-panel.arrowheads' | 'style-panel.color' | 'style-panel.dash' | 'style-panel.fill' | 'style-panel.font' | 'style-panel.geo' | 'style-panel.mixed' | 'style-panel.opacity' | 'style-panel.position' | 'style-panel.size' | 'style-panel.spline' | 'style-panel.title' | 'style-panel.vertical-align' | 'toast.close' | 'toast.error.copy-fail.desc' | 'toast.error.copy-fail.title' | 'toast.error.export-fail.desc' | 'toast.error.export-fail.title' | 'tool-panel.drawing' | 'tool-panel.more' | 'tool-panel.shapes' | 'tool.arrow-down' | 'tool.arrow-left' | 'tool.arrow-right' | 'tool.arrow-up' | 'tool.arrow' | 'tool.asset' | 'tool.check-box' | 'tool.cloud' | 'tool.diamond' | 'tool.draw' | 'tool.ellipse' | 'tool.embed' | 'tool.eraser' | 'tool.frame' | 'tool.hand' | 'tool.hexagon' | 'tool.highlight' | 'tool.laser' | 'tool.line' | 'tool.note' | 'tool.octagon' | 'tool.oval' | 'tool.pentagon' | 'tool.rectangle' | 'tool.rhombus' | 'tool.select' | 'tool.star' | 'tool.text' | 'tool.trapezoid' | 'tool.triangle' | 'tool.x-box' | 'vscode.file-open.backup-failed' | 'vscode.file-open.backup-saved' | 'vscode.file-open.backup' | 'vscode.file-open.desc' | 'vscode.file-open.dont-show-again' | 'vscode.file-open.open';
|
|
2599
2607
|
|
|
2600
2608
|
/** @public */
|
|
2601
2609
|
declare interface TLUiTranslationProviderProps {
|
|
@@ -31,6 +31,7 @@ var import_HighlightShapeUtil = require("./shapes/highlight/HighlightShapeUtil")
|
|
|
31
31
|
var import_ImageShapeUtil = require("./shapes/image/ImageShapeUtil");
|
|
32
32
|
var import_LineShapeUtil = require("./shapes/line/LineShapeUtil");
|
|
33
33
|
var import_NoteShapeUtil = require("./shapes/note/NoteShapeUtil");
|
|
34
|
+
var import_PollShapeUtil = require("./shapes/poll/PollShapeUtil");
|
|
34
35
|
var import_TextShapeUtil = require("./shapes/text/TextShapeUtil");
|
|
35
36
|
var import_VideoShapeUtil = require("./shapes/video/VideoShapeUtil");
|
|
36
37
|
const defaultShapeUtils = [
|
|
@@ -45,6 +46,7 @@ const defaultShapeUtils = [
|
|
|
45
46
|
import_HighlightShapeUtil.HighlightShapeUtil,
|
|
46
47
|
import_EmbedShapeUtil.EmbedShapeUtil,
|
|
47
48
|
import_ImageShapeUtil.ImageShapeUtil,
|
|
48
|
-
import_VideoShapeUtil.VideoShapeUtil
|
|
49
|
+
import_VideoShapeUtil.VideoShapeUtil,
|
|
50
|
+
import_PollShapeUtil.PollShapeUtil
|
|
49
51
|
];
|
|
50
52
|
//# sourceMappingURL=defaultShapeUtils.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/lib/defaultShapeUtils.ts"],
|
|
4
|
-
"sourcesContent": ["import { TLAnyShapeUtilConstructor } from '@bigbluebutton/editor'\nimport { ArrowShapeUtil } from './shapes/arrow/ArrowShapeUtil'\nimport { BookmarkShapeUtil } from './shapes/bookmark/BookmarkShapeUtil'\nimport { DrawShapeUtil } from './shapes/draw/DrawShapeUtil'\nimport { EmbedShapeUtil } from './shapes/embed/EmbedShapeUtil'\nimport { FrameShapeUtil } from './shapes/frame/FrameShapeUtil'\nimport { GeoShapeUtil } from './shapes/geo/GeoShapeUtil'\nimport { HighlightShapeUtil } from './shapes/highlight/HighlightShapeUtil'\nimport { ImageShapeUtil } from './shapes/image/ImageShapeUtil'\nimport { LineShapeUtil } from './shapes/line/LineShapeUtil'\nimport { NoteShapeUtil } from './shapes/note/NoteShapeUtil'\nimport { TextShapeUtil } from './shapes/text/TextShapeUtil'\nimport { VideoShapeUtil } from './shapes/video/VideoShapeUtil'\n\n/** @public */\nexport const defaultShapeUtils: TLAnyShapeUtilConstructor[] = [\n\tTextShapeUtil,\n\tBookmarkShapeUtil,\n\tDrawShapeUtil,\n\tGeoShapeUtil,\n\tNoteShapeUtil,\n\tLineShapeUtil,\n\tFrameShapeUtil,\n\tArrowShapeUtil,\n\tHighlightShapeUtil,\n\tEmbedShapeUtil,\n\tImageShapeUtil,\n\tVideoShapeUtil,\n]\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,4BAA+B;AAC/B,+BAAkC;AAClC,2BAA8B;AAC9B,4BAA+B;AAC/B,4BAA+B;AAC/B,0BAA6B;AAC7B,gCAAmC;AACnC,4BAA+B;AAC/B,2BAA8B;AAC9B,2BAA8B;AAC9B,2BAA8B;AAC9B,4BAA+B;AAGxB,MAAM,oBAAiD;AAAA,EAC7D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;",
|
|
4
|
+
"sourcesContent": ["import { TLAnyShapeUtilConstructor } from '@bigbluebutton/editor'\nimport { ArrowShapeUtil } from './shapes/arrow/ArrowShapeUtil'\nimport { BookmarkShapeUtil } from './shapes/bookmark/BookmarkShapeUtil'\nimport { DrawShapeUtil } from './shapes/draw/DrawShapeUtil'\nimport { EmbedShapeUtil } from './shapes/embed/EmbedShapeUtil'\nimport { FrameShapeUtil } from './shapes/frame/FrameShapeUtil'\nimport { GeoShapeUtil } from './shapes/geo/GeoShapeUtil'\nimport { HighlightShapeUtil } from './shapes/highlight/HighlightShapeUtil'\nimport { ImageShapeUtil } from './shapes/image/ImageShapeUtil'\nimport { LineShapeUtil } from './shapes/line/LineShapeUtil'\nimport { NoteShapeUtil } from './shapes/note/NoteShapeUtil'\nimport { PollShapeUtil } from './shapes/poll/PollShapeUtil'\nimport { TextShapeUtil } from './shapes/text/TextShapeUtil'\nimport { VideoShapeUtil } from './shapes/video/VideoShapeUtil'\n\n/** @public */\nexport const defaultShapeUtils: TLAnyShapeUtilConstructor[] = [\n\tTextShapeUtil,\n\tBookmarkShapeUtil,\n\tDrawShapeUtil,\n\tGeoShapeUtil,\n\tNoteShapeUtil,\n\tLineShapeUtil,\n\tFrameShapeUtil,\n\tArrowShapeUtil,\n\tHighlightShapeUtil,\n\tEmbedShapeUtil,\n\tImageShapeUtil,\n\tVideoShapeUtil,\n\tPollShapeUtil,\n]\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,4BAA+B;AAC/B,+BAAkC;AAClC,2BAA8B;AAC9B,4BAA+B;AAC/B,4BAA+B;AAC/B,0BAA6B;AAC7B,gCAAmC;AACnC,4BAA+B;AAC/B,2BAA8B;AAC9B,2BAA8B;AAC9B,2BAA8B;AAC9B,2BAA8B;AAC9B,4BAA+B;AAGxB,MAAM,oBAAiD;AAAA,EAC7D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/lib/shapes/arrow/ArrowShapeUtil.tsx"],
|
|
4
|
-
"sourcesContent": ["import {\n\tArc2d,\n\tBox2d,\n\tDefaultFontFamilies,\n\tEdge2d,\n\tGroup2d,\n\tRectangle2d,\n\tSVGContainer,\n\tShapeUtil,\n\tSvgExportContext,\n\tTLArrowShape,\n\tTLArrowShapeArrowheadStyle,\n\tTLDefaultColorStyle,\n\tTLDefaultColorTheme,\n\tTLDefaultFillStyle,\n\tTLHandle,\n\tTLOnEditEndHandler,\n\tTLOnHandleChangeHandler,\n\tTLOnResizeHandler,\n\tTLOnTranslateStartHandler,\n\tTLShapePartial,\n\tTLShapeUtilCanvasSvgDef,\n\tTLShapeUtilFlag,\n\tVec2d,\n\tarrowShapeMigrations,\n\tarrowShapeProps,\n\tdeepCopy,\n\tgetArrowTerminalsInArrowSpace,\n\tgetArrowheadPathForType,\n\tgetCurvedArrowHandlePath,\n\tgetDefaultColorTheme,\n\tgetSolidCurvedArrowPath,\n\tgetSolidStraightArrowPath,\n\tgetStraightArrowHandlePath,\n\ttoDomPrecision,\n\tuseIsEditing,\n} from '@bigbluebutton/editor'\nimport React from 'react'\nimport { ShapeFill, getShapeFillSvg, useDefaultColorTheme } from '../shared/ShapeFill'\nimport { createTextSvgElementFromSpans } from '../shared/createTextSvgElementFromSpans'\nimport {\n\tARROW_LABEL_FONT_SIZES,\n\tFONT_FAMILIES,\n\tSTROKE_SIZES,\n\tTEXT_PROPS,\n} from '../shared/default-shape-constants'\nimport {\n\tgetFillDefForCanvas,\n\tgetFillDefForExport,\n\tgetFontDefForExport,\n} from '../shared/defaultStyleDefs'\nimport { getPerfectDashProps } from '../shared/getPerfectDashProps'\nimport { ArrowTextLabel } from './components/ArrowTextLabel'\n\nlet globalRenderIndex = 0\n\nexport const ARROW_END_OFFSET = 0.1\n\n/** @public */\nexport class ArrowShapeUtil extends ShapeUtil<TLArrowShape> {\n\tstatic override type = 'arrow' as const\n\tstatic override props = arrowShapeProps\n\tstatic override migrations = arrowShapeMigrations\n\n\toverride canEdit = () => true\n\toverride canBind = () => false\n\toverride canSnap = () => false\n\toverride hideResizeHandles: TLShapeUtilFlag<TLArrowShape> = () => true\n\toverride hideRotateHandle: TLShapeUtilFlag<TLArrowShape> = () => true\n\toverride hideSelectionBoundsBg: TLShapeUtilFlag<TLArrowShape> = () => true\n\toverride hideSelectionBoundsFg: TLShapeUtilFlag<TLArrowShape> = () => true\n\n\toverride getDefaultProps(): TLArrowShape['props'] {\n\t\treturn {\n\t\t\tdash: 'draw',\n\t\t\tsize: 'm',\n\t\t\tfill: 'none',\n\t\t\tcolor: 'black',\n\t\t\tlabelColor: 'black',\n\t\t\tbend: 0,\n\t\t\tstart: { type: 'point', x: 0, y: 0 },\n\t\t\tend: { type: 'point', x: 2, y: 0 },\n\t\t\tarrowheadStart: 'none',\n\t\t\tarrowheadEnd: 'arrow',\n\t\t\ttext: '',\n\t\t\tfont: 'draw',\n\t\t}\n\t}\n\n\tgetGeometry(shape: TLArrowShape) {\n\t\tconst info = this.editor.getArrowInfo(shape)!\n\n\t\tconst bodyGeom = info.isStraight\n\t\t\t? new Edge2d({\n\t\t\t\t\tstart: Vec2d.From(info.start.point),\n\t\t\t\t\tend: Vec2d.From(info.end.point),\n\t\t\t })\n\t\t\t: new Arc2d({\n\t\t\t\t\tcenter: Vec2d.Cast(info.handleArc.center),\n\t\t\t\t\tradius: info.handleArc.radius,\n\t\t\t\t\tstart: Vec2d.Cast(info.start.point),\n\t\t\t\t\tend: Vec2d.Cast(info.end.point),\n\t\t\t\t\tsweepFlag: info.bodyArc.sweepFlag,\n\t\t\t\t\tlargeArcFlag: info.bodyArc.largeArcFlag,\n\t\t\t })\n\n\t\tlet labelGeom: Rectangle2d | undefined\n\n\t\tif (shape.props.text.trim()) {\n\t\t\tconst bodyBounds = bodyGeom.bounds\n\n\t\t\tconst { w, h } = this.editor.textMeasure.measureText(shape.props.text, {\n\t\t\t\t...TEXT_PROPS,\n\t\t\t\tfontFamily: FONT_FAMILIES[shape.props.font],\n\t\t\t\tfontSize: ARROW_LABEL_FONT_SIZES[shape.props.size],\n\t\t\t\tmaxWidth: null,\n\t\t\t})\n\n\t\t\tlet width = w\n\t\t\tlet height = h\n\n\t\t\tif (bodyBounds.width > bodyBounds.height) {\n\t\t\t\twidth = Math.max(Math.min(w, 64), Math.min(bodyBounds.width - 64, w))\n\n\t\t\t\tconst { w: squishedWidth, h: squishedHeight } = this.editor.textMeasure.measureText(\n\t\t\t\t\tshape.props.text,\n\t\t\t\t\t{\n\t\t\t\t\t\t...TEXT_PROPS,\n\t\t\t\t\t\tfontFamily: FONT_FAMILIES[shape.props.font],\n\t\t\t\t\t\tfontSize: ARROW_LABEL_FONT_SIZES[shape.props.size],\n\t\t\t\t\t\tmaxWidth: width,\n\t\t\t\t\t}\n\t\t\t\t)\n\n\t\t\t\twidth = squishedWidth\n\t\t\t\theight = squishedHeight\n\t\t\t}\n\n\t\t\tif (width > 16 * ARROW_LABEL_FONT_SIZES[shape.props.size]) {\n\t\t\t\twidth = 16 * ARROW_LABEL_FONT_SIZES[shape.props.size]\n\n\t\t\t\tconst { w: squishedWidth, h: squishedHeight } = this.editor.textMeasure.measureText(\n\t\t\t\t\tshape.props.text,\n\t\t\t\t\t{\n\t\t\t\t\t\t...TEXT_PROPS,\n\t\t\t\t\t\tfontFamily: FONT_FAMILIES[shape.props.font],\n\t\t\t\t\t\tfontSize: ARROW_LABEL_FONT_SIZES[shape.props.size],\n\t\t\t\t\t\tmaxWidth: width,\n\t\t\t\t\t}\n\t\t\t\t)\n\n\t\t\t\twidth = squishedWidth\n\t\t\t\theight = squishedHeight\n\t\t\t}\n\n\t\t\tlabelGeom = new Rectangle2d({\n\t\t\t\tx: info.middle.x - width / 2 - 4.25,\n\t\t\t\ty: info.middle.y - height / 2 - 4.25,\n\t\t\t\twidth: width + 8.5,\n\t\t\t\theight: height + 8.5,\n\t\t\t\tisFilled: true,\n\t\t\t\tisLabel: true,\n\t\t\t})\n\t\t}\n\n\t\treturn new Group2d({\n\t\t\tchildren: labelGeom ? [bodyGeom, labelGeom] : [bodyGeom],\n\t\t\tisSnappable: false,\n\t\t})\n\t}\n\n\toverride getHandles(shape: TLArrowShape): TLHandle[] {\n\t\tconst info = this.editor.getArrowInfo(shape)!\n\t\treturn [\n\t\t\t{\n\t\t\t\tid: 'start',\n\t\t\t\ttype: 'vertex',\n\t\t\t\tindex: 'a0',\n\t\t\t\tx: info.start.handle.x,\n\t\t\t\ty: info.start.handle.y,\n\t\t\t\tcanBind: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'middle',\n\t\t\t\ttype: 'virtual',\n\t\t\t\tindex: 'a2',\n\t\t\t\tx: info.middle.x,\n\t\t\t\ty: info.middle.y,\n\t\t\t\tcanBind: false,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'end',\n\t\t\t\ttype: 'vertex',\n\t\t\t\tindex: 'a3',\n\t\t\t\tx: info.end.handle.x,\n\t\t\t\ty: info.end.handle.y,\n\t\t\t\tcanBind: true,\n\t\t\t},\n\t\t]\n\t}\n\n\toverride onHandleChange: TLOnHandleChangeHandler<TLArrowShape> = (\n\t\tshape,\n\t\t{ handle, isPrecise }\n\t) => {\n\t\tconst handleId = handle.id as 'start' | 'middle' | 'end'\n\n\t\tif (handleId === 'middle') {\n\t\t\t// Bending the arrow...\n\t\t\tconst { start, end } = getArrowTerminalsInArrowSpace(this.editor, shape)\n\n\t\t\tconst delta = Vec2d.Sub(end, start)\n\t\t\tconst v = Vec2d.Per(delta)\n\n\t\t\tconst med = Vec2d.Med(end, start)\n\t\t\tconst A = Vec2d.Sub(med, v)\n\t\t\tconst B = Vec2d.Add(med, v)\n\n\t\t\tconst point = Vec2d.NearestPointOnLineSegment(A, B, handle, false)\n\t\t\tlet bend = Vec2d.Dist(point, med)\n\t\t\tif (Vec2d.Clockwise(point, end, med)) bend *= -1\n\t\t\treturn { id: shape.id, type: shape.type, props: { bend } }\n\t\t}\n\n\t\t// Start or end, pointing the arrow...\n\n\t\tconst next = deepCopy(shape) as TLArrowShape\n\n\t\tconst pageTransform = this.editor.getShapePageTransform(next.id)!\n\t\tconst pointInPageSpace = pageTransform.applyToPoint(handle)\n\n\t\tif (this.editor.inputs.ctrlKey) {\n\t\t\t// todo: maybe double check that this isn't equal to the other handle too?\n\t\t\t// Skip binding\n\t\t\tnext.props[handleId] = {\n\t\t\t\ttype: 'point',\n\t\t\t\tx: handle.x,\n\t\t\t\ty: handle.y,\n\t\t\t}\n\t\t\treturn next\n\t\t}\n\n\t\tconst point = this.editor.getShapePageTransform(shape.id)!.applyToPoint(handle)\n\n\t\tconst target = this.editor.getShapeAtPoint(point, {\n\t\t\thitInside: true,\n\t\t\thitFrameInside: true,\n\t\t\tmargin: 0,\n\t\t\tfilter: (targetShape) => {\n\t\t\t\treturn !targetShape.isLocked && this.editor.getShapeUtil(targetShape).canBind(targetShape)\n\t\t\t},\n\t\t})\n\n\t\tif (!target) {\n\t\t\t// todo: maybe double check that this isn't equal to the other handle too?\n\t\t\tnext.props[handleId] = {\n\t\t\t\ttype: 'point',\n\t\t\t\tx: handle.x,\n\t\t\t\ty: handle.y,\n\t\t\t}\n\t\t\treturn next\n\t\t}\n\n\t\t// we've got a target! the handle is being dragged over a shape, bind to it\n\n\t\tconst targetGeometry = this.editor.getShapeGeometry(target)\n\t\tconst targetBounds = Box2d.ZeroFix(targetGeometry.bounds)\n\t\tconst pointInTargetSpace = this.editor.getPointInShapeSpace(target, pointInPageSpace)\n\n\t\tlet precise = isPrecise\n\n\t\tif (!precise) {\n\t\t\t// If we're switching to a new bound shape, then precise only if moving slowly\n\t\t\tconst prevHandle = next.props[handleId]\n\t\t\tif (\n\t\t\t\tprevHandle.type === 'point' ||\n\t\t\t\t(prevHandle.type === 'binding' && target.id !== prevHandle.boundShapeId)\n\t\t\t) {\n\t\t\t\tprecise = this.editor.inputs.pointerVelocity.len() < 0.5\n\t\t\t}\n\t\t}\n\n\t\tif (!isPrecise) {\n\t\t\tif (!targetGeometry.isClosed) {\n\t\t\t\tprecise = true\n\t\t\t}\n\n\t\t\t// Double check that we're not going to be doing an imprecise snap on\n\t\t\t// the same shape twice, as this would result in a zero length line\n\t\t\tconst otherHandle = next.props[handleId === 'start' ? 'end' : 'start']\n\t\t\tif (\n\t\t\t\totherHandle.type === 'binding' &&\n\t\t\t\ttarget.id === otherHandle.boundShapeId &&\n\t\t\t\totherHandle.isPrecise\n\t\t\t) {\n\t\t\t\tprecise = true\n\t\t\t}\n\t\t}\n\n\t\tconst normalizedAnchor = {\n\t\t\tx: (pointInTargetSpace.x - targetBounds.minX) / targetBounds.width,\n\t\t\ty: (pointInTargetSpace.y - targetBounds.minY) / targetBounds.height,\n\t\t}\n\n\t\tif (precise) {\n\t\t\t// Turn off precision if we're within a certain distance to the center of the shape.\n\t\t\t// Funky math but we want the snap distance to be 4 at the minimum and either\n\t\t\t// 16 or 15% of the smaller dimension of the target shape, whichever is smaller\n\t\t\tif (\n\t\t\t\tVec2d.Dist(pointInTargetSpace, targetBounds.center) <\n\t\t\t\tMath.max(4, Math.min(Math.min(targetBounds.width, targetBounds.height) * 0.15, 16)) /\n\t\t\t\t\tthis.editor.getZoomLevel()\n\t\t\t) {\n\t\t\t\tnormalizedAnchor.x = 0.5\n\t\t\t\tnormalizedAnchor.y = 0.5\n\t\t\t}\n\t\t}\n\n\t\tnext.props[handleId] = {\n\t\t\ttype: 'binding',\n\t\t\tboundShapeId: target.id,\n\t\t\tnormalizedAnchor: normalizedAnchor,\n\t\t\tisPrecise: precise,\n\t\t\tisExact: this.editor.inputs.altKey,\n\t\t}\n\n\t\tif (next.props.start.type === 'binding' && next.props.end.type === 'binding') {\n\t\t\tif (next.props.start.boundShapeId === next.props.end.boundShapeId) {\n\t\t\t\tif (Vec2d.Equals(next.props.start.normalizedAnchor, next.props.end.normalizedAnchor)) {\n\t\t\t\t\tnext.props.end.normalizedAnchor.x += 0.05\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn next\n\t}\n\n\toverride onTranslateStart: TLOnTranslateStartHandler<TLArrowShape> = (shape) => {\n\t\tconst startBindingId =\n\t\t\tshape.props.start.type === 'binding' ? shape.props.start.boundShapeId : null\n\t\tconst endBindingId = shape.props.end.type === 'binding' ? shape.props.end.boundShapeId : null\n\n\t\t// If at least one bound shape is in the selection, do nothing;\n\t\t// If no bound shapes are in the selection, unbind any bound shapes\n\n\t\tconst selectedShapeIds = this.editor.getSelectedShapeIds()\n\n\t\tif (\n\t\t\t(startBindingId &&\n\t\t\t\t(selectedShapeIds.includes(startBindingId) ||\n\t\t\t\t\tthis.editor.isAncestorSelected(startBindingId))) ||\n\t\t\t(endBindingId &&\n\t\t\t\t(selectedShapeIds.includes(endBindingId) || this.editor.isAncestorSelected(endBindingId)))\n\t\t) {\n\t\t\treturn\n\t\t}\n\n\t\tconst { start, end } = getArrowTerminalsInArrowSpace(this.editor, shape)\n\n\t\treturn {\n\t\t\tid: shape.id,\n\t\t\ttype: shape.type,\n\t\t\tprops: {\n\t\t\t\t...shape.props,\n\t\t\t\tstart: {\n\t\t\t\t\ttype: 'point',\n\t\t\t\t\tx: start.x,\n\t\t\t\t\ty: start.y,\n\t\t\t\t},\n\t\t\t\tend: {\n\t\t\t\t\ttype: 'point',\n\t\t\t\t\tx: end.x,\n\t\t\t\t\ty: end.y,\n\t\t\t\t},\n\t\t\t},\n\t\t}\n\t}\n\n\toverride onResize: TLOnResizeHandler<TLArrowShape> = (shape, info) => {\n\t\tconst { scaleX, scaleY } = info\n\n\t\tconst terminals = getArrowTerminalsInArrowSpace(this.editor, shape)\n\n\t\tconst { start, end } = deepCopy<TLArrowShape['props']>(shape.props)\n\t\tlet { bend } = shape.props\n\n\t\t// Rescale start handle if it's not bound to a shape\n\t\tif (start.type === 'point') {\n\t\t\tstart.x = terminals.start.x * scaleX\n\t\t\tstart.y = terminals.start.y * scaleY\n\t\t}\n\n\t\t// Rescale end handle if it's not bound to a shape\n\t\tif (end.type === 'point') {\n\t\t\tend.x = terminals.end.x * scaleX\n\t\t\tend.y = terminals.end.y * scaleY\n\t\t}\n\n\t\t// todo: we should only change the normalized anchor positions\n\t\t// of the shape's handles if the bound shape is also being resized\n\n\t\tconst mx = Math.abs(scaleX)\n\t\tconst my = Math.abs(scaleY)\n\n\t\tif (scaleX < 0 && scaleY >= 0) {\n\t\t\tif (bend !== 0) {\n\t\t\t\tbend *= -1\n\t\t\t\tbend *= Math.max(mx, my)\n\t\t\t}\n\n\t\t\tif (start.type === 'binding') {\n\t\t\t\tstart.normalizedAnchor.x = 1 - start.normalizedAnchor.x\n\t\t\t}\n\n\t\t\tif (end.type === 'binding') {\n\t\t\t\tend.normalizedAnchor.x = 1 - end.normalizedAnchor.x\n\t\t\t}\n\t\t} else if (scaleX >= 0 && scaleY < 0) {\n\t\t\tif (bend !== 0) {\n\t\t\t\tbend *= -1\n\t\t\t\tbend *= Math.max(mx, my)\n\t\t\t}\n\n\t\t\tif (start.type === 'binding') {\n\t\t\t\tstart.normalizedAnchor.y = 1 - start.normalizedAnchor.y\n\t\t\t}\n\n\t\t\tif (end.type === 'binding') {\n\t\t\t\tend.normalizedAnchor.y = 1 - end.normalizedAnchor.y\n\t\t\t}\n\t\t} else if (scaleX >= 0 && scaleY >= 0) {\n\t\t\tif (bend !== 0) {\n\t\t\t\tbend *= Math.max(mx, my)\n\t\t\t}\n\t\t} else if (scaleX < 0 && scaleY < 0) {\n\t\t\tif (bend !== 0) {\n\t\t\t\tbend *= Math.max(mx, my)\n\t\t\t}\n\n\t\t\tif (start.type === 'binding') {\n\t\t\t\tstart.normalizedAnchor.x = 1 - start.normalizedAnchor.x\n\t\t\t\tstart.normalizedAnchor.y = 1 - start.normalizedAnchor.y\n\t\t\t}\n\n\t\t\tif (end.type === 'binding') {\n\t\t\t\tend.normalizedAnchor.x = 1 - end.normalizedAnchor.x\n\t\t\t\tend.normalizedAnchor.y = 1 - end.normalizedAnchor.y\n\t\t\t}\n\t\t}\n\n\t\tconst next = {\n\t\t\tprops: {\n\t\t\t\tstart,\n\t\t\t\tend,\n\t\t\t\tbend,\n\t\t\t},\n\t\t}\n\n\t\treturn next\n\t}\n\n\toverride onDoubleClickHandle = (\n\t\tshape: TLArrowShape,\n\t\thandle: TLHandle\n\t): TLShapePartial<TLArrowShape> | void => {\n\t\tswitch (handle.id) {\n\t\t\tcase 'start': {\n\t\t\t\treturn {\n\t\t\t\t\tid: shape.id,\n\t\t\t\t\ttype: shape.type,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...shape.props,\n\t\t\t\t\t\tarrowheadStart: shape.props.arrowheadStart === 'none' ? 'arrow' : 'none',\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t}\n\t\t\tcase 'end': {\n\t\t\t\treturn {\n\t\t\t\t\tid: shape.id,\n\t\t\t\t\ttype: shape.type,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...shape.props,\n\t\t\t\t\t\tarrowheadEnd: shape.props.arrowheadEnd === 'none' ? 'arrow' : 'none',\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tcomponent(shape: TLArrowShape) {\n\t\t// Not a class component, but eslint can't tell that :(\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tconst theme = useDefaultColorTheme()\n\t\tconst onlySelectedShape = this.editor.getOnlySelectedShape()\n\t\tconst shouldDisplayHandles =\n\t\t\tthis.editor.isInAny(\n\t\t\t\t'select.idle',\n\t\t\t\t'select.pointing_handle',\n\t\t\t\t'select.dragging_handle',\n\t\t\t\t'arrow.dragging'\n\t\t\t) && !this.editor.getInstanceState().isReadonly\n\n\t\tconst info = this.editor.getArrowInfo(shape)\n\t\tconst bounds = Box2d.ZeroFix(this.editor.getShapeGeometry(shape).bounds)\n\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tconst changeIndex = React.useMemo<number>(() => {\n\t\t\treturn this.editor.environment.isSafari ? (globalRenderIndex += 1) : 0\n\t\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t}, [shape])\n\n\t\tif (!info?.isValid) return null\n\n\t\tconst strokeWidth = STROKE_SIZES[shape.props.size]\n\n\t\tconst as = info.start.arrowhead && getArrowheadPathForType(info, 'start', strokeWidth)\n\t\tconst ae = info.end.arrowhead && getArrowheadPathForType(info, 'end', strokeWidth)\n\n\t\tconst path = info.isStraight ? getSolidStraightArrowPath(info) : getSolidCurvedArrowPath(info)\n\n\t\tlet handlePath: null | JSX.Element = null\n\n\t\tif (onlySelectedShape === shape && shouldDisplayHandles) {\n\t\t\tconst sw = 2\n\t\t\tconst { strokeDasharray, strokeDashoffset } = getPerfectDashProps(\n\t\t\t\tinfo.isStraight\n\t\t\t\t\t? Vec2d.Dist(info.start.handle, info.end.handle)\n\t\t\t\t\t: Math.abs(info.handleArc.length),\n\t\t\t\tsw,\n\t\t\t\t{\n\t\t\t\t\tend: 'skip',\n\t\t\t\t\tstart: 'skip',\n\t\t\t\t\tlengthRatio: 2.5,\n\t\t\t\t}\n\t\t\t)\n\n\t\t\thandlePath =\n\t\t\t\tshape.props.start.type === 'binding' || shape.props.end.type === 'binding' ? (\n\t\t\t\t\t<path\n\t\t\t\t\t\tclassName=\"tl-arrow-hint\"\n\t\t\t\t\t\td={info.isStraight ? getStraightArrowHandlePath(info) : getCurvedArrowHandlePath(info)}\n\t\t\t\t\t\tstrokeDasharray={strokeDasharray}\n\t\t\t\t\t\tstrokeDashoffset={strokeDashoffset}\n\t\t\t\t\t\tstrokeWidth={sw}\n\t\t\t\t\t\tmarkerStart={\n\t\t\t\t\t\t\tshape.props.start.type === 'binding'\n\t\t\t\t\t\t\t\t? shape.props.start.isExact\n\t\t\t\t\t\t\t\t\t? ''\n\t\t\t\t\t\t\t\t\t: shape.props.start.isPrecise\n\t\t\t\t\t\t\t\t\t? 'url(#arrowhead-cross)'\n\t\t\t\t\t\t\t\t\t: 'url(#arrowhead-dot)'\n\t\t\t\t\t\t\t\t: ''\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmarkerEnd={\n\t\t\t\t\t\t\tshape.props.end.type === 'binding'\n\t\t\t\t\t\t\t\t? shape.props.end.isExact\n\t\t\t\t\t\t\t\t\t? ''\n\t\t\t\t\t\t\t\t\t: shape.props.end.isPrecise\n\t\t\t\t\t\t\t\t\t? 'url(#arrowhead-cross)'\n\t\t\t\t\t\t\t\t\t: 'url(#arrowhead-dot)'\n\t\t\t\t\t\t\t\t: ''\n\t\t\t\t\t\t}\n\t\t\t\t\t\topacity={0.16}\n\t\t\t\t\t/>\n\t\t\t\t) : null\n\t\t}\n\n\t\tconst { strokeDasharray, strokeDashoffset } = getPerfectDashProps(\n\t\t\tinfo.isStraight ? info.length : Math.abs(info.bodyArc.length),\n\t\t\tstrokeWidth,\n\t\t\t{\n\t\t\t\tstyle: shape.props.dash,\n\t\t\t}\n\t\t)\n\n\t\tconst labelGeometry = shape.props.text.trim()\n\t\t\t? (this.editor.getShapeGeometry<Group2d>(shape).children[1] as Rectangle2d)\n\t\t\t: null\n\n\t\tconst maskStartArrowhead = !(\n\t\t\tinfo.start.arrowhead === 'none' || info.start.arrowhead === 'arrow'\n\t\t)\n\t\tconst maskEndArrowhead = !(info.end.arrowhead === 'none' || info.end.arrowhead === 'arrow')\n\n\t\t// NOTE: I know right setting `changeIndex` hacky-as right! But we need this because otherwise safari loses\n\t\t// the mask, see <https://linear.app/tldraw/issue/TLD-1500/changing-arrow-color-makes-line-pass-through-text>\n\t\tconst maskId = (shape.id + '_clip_' + changeIndex).replace(':', '_')\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<SVGContainer id={shape.id} style={{ minWidth: 50, minHeight: 50 }}>\n\t\t\t\t\t{/* Yep */}\n\t\t\t\t\t<defs>\n\t\t\t\t\t\t<mask id={maskId}>\n\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\tx={toDomPrecision(-100 + bounds.minX)}\n\t\t\t\t\t\t\t\ty={toDomPrecision(-100 + bounds.minY)}\n\t\t\t\t\t\t\t\twidth={toDomPrecision(bounds.width + 200)}\n\t\t\t\t\t\t\t\theight={toDomPrecision(bounds.height + 200)}\n\t\t\t\t\t\t\t\tfill=\"white\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{labelGeometry && (\n\t\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\t\tx={labelGeometry.x}\n\t\t\t\t\t\t\t\t\ty={labelGeometry.y}\n\t\t\t\t\t\t\t\t\twidth={labelGeometry.w}\n\t\t\t\t\t\t\t\t\theight={labelGeometry.h}\n\t\t\t\t\t\t\t\t\tfill=\"black\"\n\t\t\t\t\t\t\t\t\trx={4}\n\t\t\t\t\t\t\t\t\try={4}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{as && maskStartArrowhead && (\n\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\td={as}\n\t\t\t\t\t\t\t\t\tfill={info.start.arrowhead === 'arrow' ? 'none' : 'black'}\n\t\t\t\t\t\t\t\t\tstroke=\"none\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{ae && maskEndArrowhead && (\n\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\td={ae}\n\t\t\t\t\t\t\t\t\tfill={info.end.arrowhead === 'arrow' ? 'none' : 'black'}\n\t\t\t\t\t\t\t\t\tstroke=\"none\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</mask>\n\t\t\t\t\t</defs>\n\t\t\t\t\t<g\n\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\tstroke={theme[shape.props.color].solid}\n\t\t\t\t\t\tstrokeWidth={strokeWidth}\n\t\t\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\t\t\tpointerEvents=\"none\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{handlePath}\n\t\t\t\t\t\t{/* firefox will clip if you provide a maskURL even if there is no mask matching that URL in the DOM */}\n\t\t\t\t\t\t<g mask={`url(#${maskId})`}>\n\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\tx={toDomPrecision(bounds.minX - 100)}\n\t\t\t\t\t\t\t\ty={toDomPrecision(bounds.minY - 100)}\n\t\t\t\t\t\t\t\twidth={toDomPrecision(bounds.width + 200)}\n\t\t\t\t\t\t\t\theight={toDomPrecision(bounds.height + 200)}\n\t\t\t\t\t\t\t\topacity={0}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\td={path}\n\t\t\t\t\t\t\t\tstrokeDasharray={strokeDasharray}\n\t\t\t\t\t\t\t\tstrokeDashoffset={strokeDashoffset}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</g>\n\t\t\t\t\t\t{as && maskStartArrowhead && shape.props.fill !== 'none' && (\n\t\t\t\t\t\t\t<ShapeFill theme={theme} d={as} color={shape.props.color} fill={shape.props.fill} />\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{ae && maskEndArrowhead && shape.props.fill !== 'none' && (\n\t\t\t\t\t\t\t<ShapeFill theme={theme} d={ae} color={shape.props.color} fill={shape.props.fill} />\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{as && <path d={as} />}\n\t\t\t\t\t\t{ae && <path d={ae} />}\n\t\t\t\t\t</g>\n\t\t\t\t</SVGContainer>\n\t\t\t\t<ArrowTextLabel\n\t\t\t\t\tid={shape.id}\n\t\t\t\t\ttext={shape.props.text}\n\t\t\t\t\tfont={shape.props.font}\n\t\t\t\t\tsize={shape.props.size}\n\t\t\t\t\tposition={info.middle}\n\t\t\t\t\twidth={labelGeometry?.w ?? 0}\n\t\t\t\t\tlabelColor={theme[shape.props.labelColor].solid}\n\t\t\t\t/>\n\t\t\t</>\n\t\t)\n\t}\n\n\tindicator(shape: TLArrowShape) {\n\t\tconst { start, end } = getArrowTerminalsInArrowSpace(this.editor, shape)\n\n\t\tconst info = this.editor.getArrowInfo(shape)\n\t\tconst geometry = this.editor.getShapeGeometry<Group2d>(shape)\n\t\tconst bounds = geometry.bounds\n\n\t\tconst labelGeometry = shape.props.text.trim() ? (geometry.children[1] as Rectangle2d) : null\n\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tconst isEditing = useIsEditing(shape.id)\n\n\t\tif (!info) return null\n\t\tif (Vec2d.Equals(start, end)) return null\n\n\t\tconst strokeWidth = STROKE_SIZES[shape.props.size]\n\n\t\tconst as = info.start.arrowhead && getArrowheadPathForType(info, 'start', strokeWidth)\n\t\tconst ae = info.end.arrowhead && getArrowheadPathForType(info, 'end', strokeWidth)\n\n\t\tconst path = info.isStraight ? getSolidStraightArrowPath(info) : getSolidCurvedArrowPath(info)\n\n\t\tconst includeMask =\n\t\t\t(as && info.start.arrowhead !== 'arrow') ||\n\t\t\t(ae && info.end.arrowhead !== 'arrow') ||\n\t\t\t!!labelGeometry\n\n\t\tconst maskId = (shape.id + '_clip').replace(':', '_')\n\n\t\tif (isEditing && labelGeometry) {\n\t\t\treturn (\n\t\t\t\t<rect\n\t\t\t\t\tx={toDomPrecision(labelGeometry.x)}\n\t\t\t\t\ty={toDomPrecision(labelGeometry.y)}\n\t\t\t\t\twidth={labelGeometry.w}\n\t\t\t\t\theight={labelGeometry.h}\n\t\t\t\t\trx={3.5}\n\t\t\t\t\try={3.5}\n\t\t\t\t/>\n\t\t\t)\n\t\t}\n\n\t\treturn (\n\t\t\t<g>\n\t\t\t\t{includeMask && (\n\t\t\t\t\t<defs>\n\t\t\t\t\t\t<mask id={maskId}>\n\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\tx={bounds.minX - 100}\n\t\t\t\t\t\t\t\ty={bounds.minY - 100}\n\t\t\t\t\t\t\t\twidth={bounds.w + 200}\n\t\t\t\t\t\t\t\theight={bounds.h + 200}\n\t\t\t\t\t\t\t\tfill=\"white\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{labelGeometry && (\n\t\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\t\tx={toDomPrecision(labelGeometry.x)}\n\t\t\t\t\t\t\t\t\ty={toDomPrecision(labelGeometry.y)}\n\t\t\t\t\t\t\t\t\twidth={labelGeometry.w}\n\t\t\t\t\t\t\t\t\theight={labelGeometry.h}\n\t\t\t\t\t\t\t\t\tfill=\"black\"\n\t\t\t\t\t\t\t\t\trx={3.5}\n\t\t\t\t\t\t\t\t\try={3.5}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{as && (\n\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\td={as}\n\t\t\t\t\t\t\t\t\tfill={info.start.arrowhead === 'arrow' ? 'none' : 'black'}\n\t\t\t\t\t\t\t\t\tstroke=\"none\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{ae && (\n\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\td={ae}\n\t\t\t\t\t\t\t\t\tfill={info.end.arrowhead === 'arrow' ? 'none' : 'black'}\n\t\t\t\t\t\t\t\t\tstroke=\"none\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</mask>\n\t\t\t\t\t</defs>\n\t\t\t\t)}\n\t\t\t\t{/* firefox will clip if you provide a maskURL even if there is no mask matching that URL in the DOM */}\n\t\t\t\t<g {...(includeMask ? { mask: `url(#${maskId})` } : undefined)}>\n\t\t\t\t\t{/* This rect needs to be here if we're creating a mask due to an svg quirk on Chrome */}\n\t\t\t\t\t{includeMask && (\n\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\tx={bounds.minX - 100}\n\t\t\t\t\t\t\ty={bounds.minY - 100}\n\t\t\t\t\t\t\twidth={bounds.width + 200}\n\t\t\t\t\t\t\theight={bounds.height + 200}\n\t\t\t\t\t\t\topacity={0}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\n\t\t\t\t\t<path d={path} />\n\t\t\t\t</g>\n\t\t\t\t{as && <path d={as} />}\n\t\t\t\t{ae && <path d={ae} />}\n\t\t\t\t{labelGeometry && (\n\t\t\t\t\t<rect\n\t\t\t\t\t\tx={toDomPrecision(labelGeometry.x)}\n\t\t\t\t\t\ty={toDomPrecision(labelGeometry.y)}\n\t\t\t\t\t\twidth={labelGeometry.w}\n\t\t\t\t\t\theight={labelGeometry.h}\n\t\t\t\t\t\trx={3.5}\n\t\t\t\t\t\try={3.5}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</g>\n\t\t)\n\t}\n\n\toverride onEditEnd: TLOnEditEndHandler<TLArrowShape> = (shape) => {\n\t\tconst {\n\t\t\tid,\n\t\t\ttype,\n\t\t\tprops: { text },\n\t\t} = shape\n\n\t\tif (text.trimEnd() !== shape.props.text) {\n\t\t\tthis.editor.updateShapes<TLArrowShape>([\n\t\t\t\t{\n\t\t\t\t\tid,\n\t\t\t\t\ttype,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\ttext: text.trimEnd(),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t])\n\t\t}\n\t}\n\n\toverride toSvg(shape: TLArrowShape, ctx: SvgExportContext) {\n\t\tconst theme = getDefaultColorTheme({ isDarkMode: this.editor.user.getIsDarkMode() })\n\t\tctx.addExportDef(getFillDefForExport(shape.props.fill, theme))\n\n\t\tconst color = theme[shape.props.color].solid\n\n\t\tconst info = this.editor.getArrowInfo(shape)\n\n\t\tconst strokeWidth = STROKE_SIZES[shape.props.size]\n\n\t\t// Group for arrow\n\t\tconst g = document.createElementNS('http://www.w3.org/2000/svg', 'g')\n\t\tif (!info) return g\n\n\t\t// Arrowhead start path\n\t\tconst as = info.start.arrowhead && getArrowheadPathForType(info, 'start', strokeWidth)\n\t\t// Arrowhead end path\n\t\tconst ae = info.end.arrowhead && getArrowheadPathForType(info, 'end', strokeWidth)\n\n\t\tconst geometry = this.editor.getShapeGeometry<Group2d>(shape)\n\t\tconst bounds = geometry.bounds\n\n\t\tconst labelGeometry = shape.props.text.trim() ? (geometry.children[1] as Rectangle2d) : null\n\n\t\tconst maskId = (shape.id + '_clip').replace(':', '_')\n\n\t\t// If we have any arrowheads, then mask the arrowheads\n\t\tif (as || ae || !!labelGeometry) {\n\t\t\t// Create mask for arrowheads\n\n\t\t\t// Create defs\n\t\t\tconst defs = document.createElementNS('http://www.w3.org/2000/svg', 'defs')\n\n\t\t\t// Create mask\n\t\t\tconst mask = document.createElementNS('http://www.w3.org/2000/svg', 'mask')\n\t\t\tmask.id = maskId\n\n\t\t\t// Create large white shape for mask\n\t\t\tconst rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect')\n\t\t\trect.setAttribute('x', bounds.minX - 100 + '')\n\t\t\trect.setAttribute('y', bounds.minY - 100 + '')\n\t\t\trect.setAttribute('width', bounds.width + 200 + '')\n\t\t\trect.setAttribute('height', bounds.height + 200 + '')\n\t\t\trect.setAttribute('fill', 'white')\n\t\t\tmask.appendChild(rect)\n\n\t\t\t// add arrowhead start mask\n\t\t\tif (as) mask.appendChild(getArrowheadSvgMask(as, info.start.arrowhead))\n\n\t\t\t// add arrowhead end mask\n\t\t\tif (ae) mask.appendChild(getArrowheadSvgMask(ae, info.end.arrowhead))\n\n\t\t\t// Mask out text label if text is present\n\t\t\tif (labelGeometry) {\n\t\t\t\tconst labelMask = document.createElementNS('http://www.w3.org/2000/svg', 'rect')\n\t\t\t\tlabelMask.setAttribute('x', labelGeometry.x + '')\n\t\t\t\tlabelMask.setAttribute('y', labelGeometry.y + '')\n\t\t\t\tlabelMask.setAttribute('width', labelGeometry.w + '')\n\t\t\t\tlabelMask.setAttribute('height', labelGeometry.h + '')\n\t\t\t\tlabelMask.setAttribute('fill', 'black')\n\n\t\t\t\tmask.appendChild(labelMask)\n\t\t\t}\n\n\t\t\tdefs.appendChild(mask)\n\t\t\tg.appendChild(defs)\n\t\t}\n\n\t\tconst g2 = document.createElementNS('http://www.w3.org/2000/svg', 'g')\n\t\tg2.setAttribute('mask', `url(#${maskId})`)\n\t\tg.appendChild(g2)\n\n\t\t// Dumb mask fix thing\n\t\tconst rect2 = document.createElementNS('http://www.w3.org/2000/svg', 'rect')\n\t\trect2.setAttribute('x', '-100')\n\t\trect2.setAttribute('y', '-100')\n\t\trect2.setAttribute('width', bounds.width + 200 + '')\n\t\trect2.setAttribute('height', bounds.height + 200 + '')\n\t\trect2.setAttribute('fill', 'transparent')\n\t\trect2.setAttribute('stroke', 'none')\n\t\tg2.appendChild(rect2)\n\n\t\t// Arrowhead body path\n\t\tconst path = getArrowSvgPath(\n\t\t\tinfo.isStraight ? getSolidStraightArrowPath(info) : getSolidCurvedArrowPath(info),\n\t\t\tcolor,\n\t\t\tstrokeWidth\n\t\t)\n\n\t\tconst { strokeDasharray, strokeDashoffset } = getPerfectDashProps(\n\t\t\tinfo.isStraight ? info.length : Math.abs(info.bodyArc.length),\n\t\t\tstrokeWidth,\n\t\t\t{\n\t\t\t\tstyle: shape.props.dash,\n\t\t\t}\n\t\t)\n\n\t\tpath.setAttribute('stroke-dasharray', strokeDasharray)\n\t\tpath.setAttribute('stroke-dashoffset', strokeDashoffset)\n\n\t\tg2.appendChild(path)\n\n\t\t// Arrowhead start path\n\t\tif (as) {\n\t\t\tg.appendChild(\n\t\t\t\tgetArrowheadSvgPath(\n\t\t\t\t\tas,\n\t\t\t\t\tshape.props.color,\n\t\t\t\t\tstrokeWidth,\n\t\t\t\t\tshape.props.arrowheadStart === 'arrow' ? 'none' : shape.props.fill,\n\t\t\t\t\ttheme\n\t\t\t\t)\n\t\t\t)\n\t\t}\n\t\t// Arrowhead end path\n\t\tif (ae) {\n\t\t\tg.appendChild(\n\t\t\t\tgetArrowheadSvgPath(\n\t\t\t\t\tae,\n\t\t\t\t\tshape.props.color,\n\t\t\t\t\tstrokeWidth,\n\t\t\t\t\tshape.props.arrowheadEnd === 'arrow' ? 'none' : shape.props.fill,\n\t\t\t\t\ttheme\n\t\t\t\t)\n\t\t\t)\n\t\t}\n\n\t\t// Text Label\n\t\tif (labelGeometry) {\n\t\t\tctx.addExportDef(getFontDefForExport(shape.props.font))\n\n\t\t\tconst opts = {\n\t\t\t\tfontSize: ARROW_LABEL_FONT_SIZES[shape.props.size],\n\t\t\t\tlineHeight: TEXT_PROPS.lineHeight,\n\t\t\t\tfontFamily: DefaultFontFamilies[shape.props.font],\n\t\t\t\tpadding: 0,\n\t\t\t\ttextAlign: 'middle' as const,\n\t\t\t\twidth: labelGeometry.w - 8,\n\t\t\t\tverticalTextAlign: 'middle' as const,\n\t\t\t\theight: labelGeometry.h,\n\t\t\t\tfontStyle: 'normal',\n\t\t\t\tfontWeight: 'normal',\n\t\t\t\toverflow: 'wrap' as const,\n\t\t\t}\n\n\t\t\tconst textElm = createTextSvgElementFromSpans(\n\t\t\t\tthis.editor,\n\t\t\t\tthis.editor.textMeasure.measureTextSpans(shape.props.text, opts),\n\t\t\t\topts\n\t\t\t)\n\t\t\ttextElm.setAttribute('fill', theme[shape.props.labelColor].solid)\n\n\t\t\tconst children = Array.from(textElm.children) as unknown as SVGTSpanElement[]\n\n\t\t\tchildren.forEach((child) => {\n\t\t\t\tconst x = parseFloat(child.getAttribute('x') || '0')\n\t\t\t\tconst y = parseFloat(child.getAttribute('y') || '0')\n\n\t\t\t\tchild.setAttribute('x', x + 4 + labelGeometry.x + 'px')\n\t\t\t\tchild.setAttribute('y', y + labelGeometry.y + 'px')\n\t\t\t})\n\n\t\t\tconst textBgEl = textElm.cloneNode(true) as SVGTextElement\n\t\t\ttextBgEl.setAttribute('stroke-width', '2')\n\t\t\ttextBgEl.setAttribute('fill', theme.background)\n\t\t\ttextBgEl.setAttribute('stroke', theme.background)\n\n\t\t\tg.appendChild(textBgEl)\n\t\t\tg.appendChild(textElm)\n\t\t}\n\n\t\treturn g\n\t}\n\n\toverride getCanvasSvgDefs(): TLShapeUtilCanvasSvgDef[] {\n\t\treturn [getFillDefForCanvas()]\n\t}\n}\n\nfunction getArrowheadSvgMask(d: string, arrowhead: TLArrowShapeArrowheadStyle) {\n\tconst path = document.createElementNS('http://www.w3.org/2000/svg', 'path')\n\tpath.setAttribute('d', d)\n\tpath.setAttribute('fill', arrowhead === 'arrow' ? 'none' : 'black')\n\tpath.setAttribute('stroke', 'none')\n\treturn path\n}\n\nfunction getArrowSvgPath(d: string, color: string, strokeWidth: number) {\n\tconst path = document.createElementNS('http://www.w3.org/2000/svg', 'path')\n\tpath.setAttribute('d', d)\n\tpath.setAttribute('fill', 'none')\n\tpath.setAttribute('stroke', color)\n\tpath.setAttribute('stroke-width', strokeWidth + '')\n\treturn path\n}\n\nfunction getArrowheadSvgPath(\n\td: string,\n\tcolor: TLDefaultColorStyle,\n\tstrokeWidth: number,\n\tfill: TLDefaultFillStyle,\n\ttheme: TLDefaultColorTheme\n) {\n\tconst path = document.createElementNS('http://www.w3.org/2000/svg', 'path')\n\tpath.setAttribute('d', d)\n\tpath.setAttribute('fill', 'none')\n\tpath.setAttribute('stroke', theme[color].solid)\n\tpath.setAttribute('stroke-width', strokeWidth + '')\n\n\t// Get the fill element, if any\n\tconst shapeFill = getShapeFillSvg({\n\t\td,\n\t\tfill,\n\t\tcolor,\n\t\ttheme,\n\t})\n\n\tif (shapeFill) {\n\t\t// If there is a fill element, return a group containing the fill and the path\n\t\tconst g = document.createElementNS('http://www.w3.org/2000/svg', 'g')\n\t\tg.appendChild(shapeFill)\n\t\tg.appendChild(path)\n\t\treturn g\n\t} else {\n\t\t// Otherwise, just return the path\n\t\treturn path\n\t}\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA0hBK;AA1hBL,oBAoCO;AACP,mBAAkB;AAClB,uBAAiE;AACjE,2CAA8C;AAC9C,qCAKO;AACP,8BAIO;AACP,iCAAoC;AACpC,4BAA+B;AAE/B,IAAI,oBAAoB;AAEjB,MAAM,mBAAmB;AAGzB,MAAM,uBAAuB,wBAAwB;AAAA,EAC3D,OAAgB,OAAO;AAAA,EACvB,OAAgB,QAAQ;AAAA,EACxB,OAAgB,aAAa;AAAA,EAEpB,UAAU,MAAM;AAAA,EAChB,UAAU,MAAM;AAAA,EAChB,UAAU,MAAM;AAAA,EAChB,oBAAmD,MAAM;AAAA,EACzD,mBAAkD,MAAM;AAAA,EACxD,wBAAuD,MAAM;AAAA,EAC7D,wBAAuD,MAAM;AAAA,EAE7D,kBAAyC;AACjD,WAAO;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,MACN,OAAO;AAAA,MACP,YAAY;AAAA,MACZ,MAAM;AAAA,MACN,OAAO,EAAE,MAAM,SAAS,GAAG,GAAG,GAAG,EAAE;AAAA,MACnC,KAAK,EAAE,MAAM,SAAS,GAAG,GAAG,GAAG,EAAE;AAAA,MACjC,gBAAgB;AAAA,MAChB,cAAc;AAAA,MACd,MAAM;AAAA,MACN,MAAM;AAAA,IACP;AAAA,EACD;AAAA,EAEA,YAAY,OAAqB;AAChC,UAAM,OAAO,KAAK,OAAO,aAAa,KAAK;AAE3C,UAAM,WAAW,KAAK,aACnB,IAAI,qBAAO;AAAA,MACX,OAAO,oBAAM,KAAK,KAAK,MAAM,KAAK;AAAA,MA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EAAE;AAClD,SAAO;AACR;AAEA,SAAS,oBACR,GACA,OACA,aACA,MACA,OACC;AACD,QAAM,OAAO,SAAS,gBAAgB,8BAA8B,MAAM;AAC1E,OAAK,aAAa,KAAK,CAAC;AACxB,OAAK,aAAa,QAAQ,MAAM;AAChC,OAAK,aAAa,UAAU,MAAM,KAAK,EAAE,KAAK;AAC9C,OAAK,aAAa,gBAAgB,cAAc,EAAE;AAGlD,QAAM,gBAAY,kCAAgB;AAAA,IACjC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAC;AAED,MAAI,WAAW;AAEd,UAAM,IAAI,SAAS,gBAAgB,8BAA8B,GAAG;AACpE,MAAE,YAAY,SAAS;AACvB,MAAE,YAAY,IAAI;AAClB,WAAO;AAAA,EACR,OAAO;AAEN,WAAO;AAAA,EACR;AACD;",
|
|
4
|
+
"sourcesContent": ["import {\n\tArc2d,\n\tBox2d,\n\tDefaultFontFamilies,\n\tEdge2d,\n\tGroup2d,\n\tRectangle2d,\n\tSVGContainer,\n\tShapeUtil,\n\tSvgExportContext,\n\tTLArrowShape,\n\tTLArrowShapeArrowheadStyle,\n\tTLDefaultColorStyle,\n\tTLDefaultColorTheme,\n\tTLDefaultFillStyle,\n\tTLHandle,\n\tTLOnEditEndHandler,\n\tTLOnHandleChangeHandler,\n\tTLOnResizeHandler,\n\tTLOnTranslateStartHandler,\n\tTLShapePartial,\n\tTLShapeUtilCanvasSvgDef,\n\tTLShapeUtilFlag,\n\tVec2d,\n\tarrowShapeMigrations,\n\tarrowShapeProps,\n\tdeepCopy,\n\tgetArrowTerminalsInArrowSpace,\n\tgetArrowheadPathForType,\n\tgetCurvedArrowHandlePath,\n\tgetDefaultColorTheme,\n\tgetSolidCurvedArrowPath,\n\tgetSolidStraightArrowPath,\n\tgetStraightArrowHandlePath,\n\ttoDomPrecision,\n\tuseIsEditing,\n} from '@bigbluebutton/editor'\nimport React from 'react'\nimport { ShapeFill, getShapeFillSvg, useDefaultColorTheme } from '../shared/ShapeFill'\nimport { createTextSvgElementFromSpans } from '../shared/createTextSvgElementFromSpans'\nimport {\n\tARROW_LABEL_FONT_SIZES,\n\tFONT_FAMILIES,\n\tSTROKE_SIZES,\n\tTEXT_PROPS,\n} from '../shared/default-shape-constants'\nimport {\n\tgetFillDefForCanvas,\n\tgetFillDefForExport,\n\tgetFontDefForExport,\n} from '../shared/defaultStyleDefs'\nimport { getPerfectDashProps } from '../shared/getPerfectDashProps'\nimport { ArrowTextLabel } from './components/ArrowTextLabel'\n\nlet globalRenderIndex = 0\n\nexport const ARROW_END_OFFSET = 0.1\n\n/** @public */\nexport class ArrowShapeUtil extends ShapeUtil<TLArrowShape> {\n\tstatic override type = 'arrow' as const\n\tstatic override props = arrowShapeProps\n\tstatic override migrations = arrowShapeMigrations\n\n\toverride canEdit = () => true\n\toverride canBind = () => false\n\toverride canSnap = () => false\n\toverride hideResizeHandles: TLShapeUtilFlag<TLArrowShape> = () => true\n\toverride hideRotateHandle: TLShapeUtilFlag<TLArrowShape> = () => true\n\toverride hideSelectionBoundsBg: TLShapeUtilFlag<TLArrowShape> = () => true\n\toverride hideSelectionBoundsFg: TLShapeUtilFlag<TLArrowShape> = () => true\n\n\toverride getDefaultProps(): TLArrowShape['props'] {\n\t\treturn {\n\t\t\tdash: 'draw',\n\t\t\tsize: 'm',\n\t\t\tfill: 'none',\n\t\t\tcolor: 'black',\n\t\t\tlabelColor: 'black',\n\t\t\tbend: 0,\n\t\t\tstart: { type: 'point', x: 0, y: 0 },\n\t\t\tend: { type: 'point', x: 2, y: 0 },\n\t\t\tarrowheadStart: 'none',\n\t\t\tarrowheadEnd: 'arrow',\n\t\t\ttext: '',\n\t\t\tfont: 'draw',\n\t\t}\n\t}\n\n\tgetGeometry(shape: TLArrowShape) {\n\t\tconst info = this.editor.getArrowInfo(shape)!\n\n\t\tconst bodyGeom = info.isStraight\n\t\t\t? new Edge2d({\n\t\t\t\t\tstart: Vec2d.From(info.start.point),\n\t\t\t\t\tend: Vec2d.From(info.end.point),\n\t\t\t })\n\t\t\t: new Arc2d({\n\t\t\t\t\tcenter: Vec2d.Cast(info.handleArc.center),\n\t\t\t\t\tradius: info.handleArc.radius,\n\t\t\t\t\tstart: Vec2d.Cast(info.start.point),\n\t\t\t\t\tend: Vec2d.Cast(info.end.point),\n\t\t\t\t\tsweepFlag: info.bodyArc.sweepFlag,\n\t\t\t\t\tlargeArcFlag: info.bodyArc.largeArcFlag,\n\t\t\t })\n\n\t\tlet labelGeom: Rectangle2d | undefined\n\n\t\tif (shape.props.text.trim()) {\n\t\t\tconst bodyBounds = bodyGeom.bounds\n\n\t\t\tconst { w, h } = this.editor.textMeasure.measureText(shape.props.text, {\n\t\t\t\t...TEXT_PROPS,\n\t\t\t\tfontFamily: FONT_FAMILIES[shape.props.font],\n\t\t\t\tfontSize: ARROW_LABEL_FONT_SIZES[shape.props.size],\n\t\t\t\tmaxWidth: null,\n\t\t\t})\n\n\t\t\tlet width = w\n\t\t\tlet height = h\n\n\t\t\tif (bodyBounds.width > bodyBounds.height) {\n\t\t\t\twidth = Math.max(Math.min(w, 64), Math.min(bodyBounds.width - 64, w))\n\n\t\t\t\tconst { w: squishedWidth, h: squishedHeight } = this.editor.textMeasure.measureText(\n\t\t\t\t\tshape.props.text,\n\t\t\t\t\t{\n\t\t\t\t\t\t...TEXT_PROPS,\n\t\t\t\t\t\tfontFamily: FONT_FAMILIES[shape.props.font],\n\t\t\t\t\t\tfontSize: ARROW_LABEL_FONT_SIZES[shape.props.size],\n\t\t\t\t\t\tmaxWidth: width,\n\t\t\t\t\t}\n\t\t\t\t)\n\n\t\t\t\twidth = squishedWidth\n\t\t\t\theight = squishedHeight\n\t\t\t}\n\n\t\t\tif (width > 16 * ARROW_LABEL_FONT_SIZES[shape.props.size]) {\n\t\t\t\twidth = 16 * ARROW_LABEL_FONT_SIZES[shape.props.size]\n\n\t\t\t\tconst { w: squishedWidth, h: squishedHeight } = this.editor.textMeasure.measureText(\n\t\t\t\t\tshape.props.text,\n\t\t\t\t\t{\n\t\t\t\t\t\t...TEXT_PROPS,\n\t\t\t\t\t\tfontFamily: FONT_FAMILIES[shape.props.font],\n\t\t\t\t\t\tfontSize: ARROW_LABEL_FONT_SIZES[shape.props.size],\n\t\t\t\t\t\tmaxWidth: width,\n\t\t\t\t\t}\n\t\t\t\t)\n\n\t\t\t\twidth = squishedWidth\n\t\t\t\theight = squishedHeight\n\t\t\t}\n\n\t\t\tlabelGeom = new Rectangle2d({\n\t\t\t\tx: info.middle.x - width / 2 - 4.25,\n\t\t\t\ty: info.middle.y - height / 2 - 4.25,\n\t\t\t\twidth: width + 8.5,\n\t\t\t\theight: height + 8.5,\n\t\t\t\tisFilled: true,\n\t\t\t\tisLabel: true,\n\t\t\t})\n\t\t}\n\n\t\treturn new Group2d({\n\t\t\tchildren: labelGeom ? [bodyGeom, labelGeom] : [bodyGeom],\n\t\t\tisSnappable: false,\n\t\t})\n\t}\n\n\toverride getHandles(shape: TLArrowShape): TLHandle[] {\n\t\tconst info = this.editor.getArrowInfo(shape)!\n\t\treturn [\n\t\t\t{\n\t\t\t\tid: 'start',\n\t\t\t\ttype: 'vertex',\n\t\t\t\tindex: 'a0',\n\t\t\t\tx: info.start.handle.x,\n\t\t\t\ty: info.start.handle.y,\n\t\t\t\tcanBind: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'middle',\n\t\t\t\ttype: 'virtual',\n\t\t\t\tindex: 'a2',\n\t\t\t\tx: info.middle.x,\n\t\t\t\ty: info.middle.y,\n\t\t\t\tcanBind: false,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'end',\n\t\t\t\ttype: 'vertex',\n\t\t\t\tindex: 'a3',\n\t\t\t\tx: info.end.handle.x,\n\t\t\t\ty: info.end.handle.y,\n\t\t\t\tcanBind: true,\n\t\t\t},\n\t\t]\n\t}\n\n\toverride onHandleChange: TLOnHandleChangeHandler<TLArrowShape> = (\n\t\tshape,\n\t\t{ handle, isPrecise }\n\t) => {\n\t\tconst handleId = handle.id as 'start' | 'middle' | 'end'\n\n\t\tif (handleId === 'middle') {\n\t\t\t// Bending the arrow...\n\t\t\tconst { start, end } = getArrowTerminalsInArrowSpace(this.editor, shape)\n\n\t\t\tconst delta = Vec2d.Sub(end, start)\n\t\t\tconst v = Vec2d.Per(delta)\n\n\t\t\tconst med = Vec2d.Med(end, start)\n\t\t\tconst A = Vec2d.Sub(med, v)\n\t\t\tconst B = Vec2d.Add(med, v)\n\n\t\t\tconst point = Vec2d.NearestPointOnLineSegment(A, B, handle, false)\n\t\t\tlet bend = Vec2d.Dist(point, med)\n\t\t\tif (Vec2d.Clockwise(point, end, med)) bend *= -1\n\t\t\treturn { id: shape.id, type: shape.type, props: { bend } }\n\t\t}\n\n\t\t// Start or end, pointing the arrow...\n\n\t\tconst next = deepCopy(shape) as TLArrowShape\n\n\t\tconst pageTransform = this.editor.getShapePageTransform(next.id)!\n\t\tconst pointInPageSpace = pageTransform.applyToPoint(handle)\n\n\t\tif (this.editor.inputs.ctrlKey) {\n\t\t\t// todo: maybe double check that this isn't equal to the other handle too?\n\t\t\t// Skip binding\n\t\t\tnext.props[handleId] = {\n\t\t\t\ttype: 'point',\n\t\t\t\tx: handle.x,\n\t\t\t\ty: handle.y,\n\t\t\t}\n\t\t\treturn next\n\t\t}\n\n\t\tconst point = this.editor.getShapePageTransform(shape.id)!.applyToPoint(handle)\n\n\t\tconst target = this.editor.getShapeAtPoint(point, {\n\t\t\thitInside: true,\n\t\t\thitFrameInside: true,\n\t\t\tmargin: 0,\n\t\t\tfilter: (targetShape) => {\n\t\t\t\treturn !targetShape.isLocked && this.editor.getShapeUtil(targetShape).canBind(targetShape)\n\t\t\t},\n\t\t})\n\n\t\tif (!target) {\n\t\t\t// todo: maybe double check that this isn't equal to the other handle too?\n\t\t\tnext.props[handleId] = {\n\t\t\t\ttype: 'point',\n\t\t\t\tx: handle.x,\n\t\t\t\ty: handle.y,\n\t\t\t}\n\t\t\treturn next\n\t\t}\n\n\t\t// we've got a target! the handle is being dragged over a shape, bind to it\n\n\t\tconst targetGeometry = this.editor.getShapeGeometry(target)\n\t\tconst targetBounds = Box2d.ZeroFix(targetGeometry.bounds)\n\t\tconst pointInTargetSpace = this.editor.getPointInShapeSpace(target, pointInPageSpace)\n\n\t\tlet precise = isPrecise\n\n\t\tif (!precise) {\n\t\t\t// If we're switching to a new bound shape, then precise only if moving slowly\n\t\t\tconst prevHandle = next.props[handleId]\n\t\t\tif (\n\t\t\t\tprevHandle.type === 'point' ||\n\t\t\t\t(prevHandle.type === 'binding' && target.id !== prevHandle.boundShapeId)\n\t\t\t) {\n\t\t\t\tprecise = this.editor.inputs.pointerVelocity.len() < 0.5\n\t\t\t}\n\t\t}\n\n\t\tif (!isPrecise) {\n\t\t\tif (!targetGeometry.isClosed) {\n\t\t\t\tprecise = true\n\t\t\t}\n\n\t\t\t// Double check that we're not going to be doing an imprecise snap on\n\t\t\t// the same shape twice, as this would result in a zero length line\n\t\t\tconst otherHandle = next.props[handleId === 'start' ? 'end' : 'start']\n\t\t\tif (\n\t\t\t\totherHandle.type === 'binding' &&\n\t\t\t\ttarget.id === otherHandle.boundShapeId &&\n\t\t\t\totherHandle.isPrecise\n\t\t\t) {\n\t\t\t\tprecise = true\n\t\t\t}\n\t\t}\n\n\t\tconst normalizedAnchor = {\n\t\t\tx: (pointInTargetSpace.x - targetBounds.minX) / targetBounds.width,\n\t\t\ty: (pointInTargetSpace.y - targetBounds.minY) / targetBounds.height,\n\t\t}\n\n\t\tif (precise) {\n\t\t\t// Turn off precision if we're within a certain distance to the center of the shape.\n\t\t\t// Funky math but we want the snap distance to be 4 at the minimum and either\n\t\t\t// 16 or 15% of the smaller dimension of the target shape, whichever is smaller\n\t\t\tif (\n\t\t\t\tVec2d.Dist(pointInTargetSpace, targetBounds.center) <\n\t\t\t\tMath.max(4, Math.min(Math.min(targetBounds.width, targetBounds.height) * 0.15, 16)) /\n\t\t\t\t\tthis.editor.getZoomLevel()\n\t\t\t) {\n\t\t\t\tnormalizedAnchor.x = 0.5\n\t\t\t\tnormalizedAnchor.y = 0.5\n\t\t\t}\n\t\t}\n\n\t\tnext.props[handleId] = {\n\t\t\ttype: 'binding',\n\t\t\tboundShapeId: target.id,\n\t\t\tnormalizedAnchor: normalizedAnchor,\n\t\t\tisPrecise: precise,\n\t\t\tisExact: this.editor.inputs.altKey,\n\t\t}\n\n\t\tif (next.props.start.type === 'binding' && next.props.end.type === 'binding') {\n\t\t\tif (next.props.start.boundShapeId === next.props.end.boundShapeId) {\n\t\t\t\tif (Vec2d.Equals(next.props.start.normalizedAnchor, next.props.end.normalizedAnchor)) {\n\t\t\t\t\tnext.props.end.normalizedAnchor.x += 0.05\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn next\n\t}\n\n\toverride onTranslateStart: TLOnTranslateStartHandler<TLArrowShape> = (shape) => {\n\t\tconst startBindingId =\n\t\t\tshape.props.start.type === 'binding' ? shape.props.start.boundShapeId : null\n\t\tconst endBindingId = shape.props.end.type === 'binding' ? shape.props.end.boundShapeId : null\n\n\t\t// If at least one bound shape is in the selection, do nothing;\n\t\t// If no bound shapes are in the selection, unbind any bound shapes\n\n\t\tconst selectedShapeIds = this.editor.getSelectedShapeIds()\n\n\t\tif (\n\t\t\t(startBindingId &&\n\t\t\t\t(selectedShapeIds.includes(startBindingId) ||\n\t\t\t\t\tthis.editor.isAncestorSelected(startBindingId))) ||\n\t\t\t(endBindingId &&\n\t\t\t\t(selectedShapeIds.includes(endBindingId) || this.editor.isAncestorSelected(endBindingId)))\n\t\t) {\n\t\t\treturn\n\t\t}\n\n\t\tconst { start, end } = getArrowTerminalsInArrowSpace(this.editor, shape)\n\n\t\treturn {\n\t\t\tid: shape.id,\n\t\t\ttype: shape.type,\n\t\t\tprops: {\n\t\t\t\t...shape.props,\n\t\t\t\tstart: {\n\t\t\t\t\ttype: 'point',\n\t\t\t\t\tx: start.x,\n\t\t\t\t\ty: start.y,\n\t\t\t\t},\n\t\t\t\tend: {\n\t\t\t\t\ttype: 'point',\n\t\t\t\t\tx: end.x,\n\t\t\t\t\ty: end.y,\n\t\t\t\t},\n\t\t\t},\n\t\t}\n\t}\n\n\toverride onResize: TLOnResizeHandler<TLArrowShape> = (shape, info) => {\n\t\tconst { scaleX, scaleY } = info\n\n\t\tconst terminals = getArrowTerminalsInArrowSpace(this.editor, shape)\n\n\t\tconst { start, end } = deepCopy<TLArrowShape['props']>(shape.props)\n\t\tlet { bend } = shape.props\n\n\t\t// Rescale start handle if it's not bound to a shape\n\t\tif (start.type === 'point') {\n\t\t\tstart.x = terminals.start.x * scaleX\n\t\t\tstart.y = terminals.start.y * scaleY\n\t\t}\n\n\t\t// Rescale end handle if it's not bound to a shape\n\t\tif (end.type === 'point') {\n\t\t\tend.x = terminals.end.x * scaleX\n\t\t\tend.y = terminals.end.y * scaleY\n\t\t}\n\n\t\t// todo: we should only change the normalized anchor positions\n\t\t// of the shape's handles if the bound shape is also being resized\n\n\t\tconst mx = Math.abs(scaleX)\n\t\tconst my = Math.abs(scaleY)\n\n\t\tif (scaleX < 0 && scaleY >= 0) {\n\t\t\tif (bend !== 0) {\n\t\t\t\tbend *= -1\n\t\t\t\tbend *= Math.max(mx, my)\n\t\t\t}\n\n\t\t\tif (start.type === 'binding') {\n\t\t\t\tstart.normalizedAnchor.x = 1 - start.normalizedAnchor.x\n\t\t\t}\n\n\t\t\tif (end.type === 'binding') {\n\t\t\t\tend.normalizedAnchor.x = 1 - end.normalizedAnchor.x\n\t\t\t}\n\t\t} else if (scaleX >= 0 && scaleY < 0) {\n\t\t\tif (bend !== 0) {\n\t\t\t\tbend *= -1\n\t\t\t\tbend *= Math.max(mx, my)\n\t\t\t}\n\n\t\t\tif (start.type === 'binding') {\n\t\t\t\tstart.normalizedAnchor.y = 1 - start.normalizedAnchor.y\n\t\t\t}\n\n\t\t\tif (end.type === 'binding') {\n\t\t\t\tend.normalizedAnchor.y = 1 - end.normalizedAnchor.y\n\t\t\t}\n\t\t} else if (scaleX >= 0 && scaleY >= 0) {\n\t\t\tif (bend !== 0) {\n\t\t\t\tbend *= Math.max(mx, my)\n\t\t\t}\n\t\t} else if (scaleX < 0 && scaleY < 0) {\n\t\t\tif (bend !== 0) {\n\t\t\t\tbend *= Math.max(mx, my)\n\t\t\t}\n\n\t\t\tif (start.type === 'binding') {\n\t\t\t\tstart.normalizedAnchor.x = 1 - start.normalizedAnchor.x\n\t\t\t\tstart.normalizedAnchor.y = 1 - start.normalizedAnchor.y\n\t\t\t}\n\n\t\t\tif (end.type === 'binding') {\n\t\t\t\tend.normalizedAnchor.x = 1 - end.normalizedAnchor.x\n\t\t\t\tend.normalizedAnchor.y = 1 - end.normalizedAnchor.y\n\t\t\t}\n\t\t}\n\n\t\tconst next = {\n\t\t\tprops: {\n\t\t\t\tstart,\n\t\t\t\tend,\n\t\t\t\tbend,\n\t\t\t},\n\t\t}\n\n\t\treturn next\n\t}\n\n\toverride onDoubleClickHandle = (\n\t\tshape: TLArrowShape,\n\t\thandle: TLHandle\n\t): TLShapePartial<TLArrowShape> | void => {\n\t\tswitch (handle.id) {\n\t\t\tcase 'start': {\n\t\t\t\treturn {\n\t\t\t\t\tid: shape.id,\n\t\t\t\t\ttype: shape.type,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...shape.props,\n\t\t\t\t\t\tarrowheadStart: shape.props.arrowheadStart === 'none' ? 'arrow' : 'none',\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t}\n\t\t\tcase 'end': {\n\t\t\t\treturn {\n\t\t\t\t\tid: shape.id,\n\t\t\t\t\ttype: shape.type,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...shape.props,\n\t\t\t\t\t\tarrowheadEnd: shape.props.arrowheadEnd === 'none' ? 'arrow' : 'none',\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tcomponent(shape: TLArrowShape) {\n\t\t// Not a class component, but eslint can't tell that :(\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tconst theme = useDefaultColorTheme()\n\t\tconst onlySelectedShape = this.editor.getOnlySelectedShape()\n\t\tconst shouldDisplayHandles =\n\t\t\tthis.editor.isInAny(\n\t\t\t\t'select.idle',\n\t\t\t\t'select.pointing_handle',\n\t\t\t\t'select.dragging_handle',\n\t\t\t\t'arrow.dragging'\n\t\t\t) && !this.editor.getInstanceState().isReadonly\n\n\t\tconst info = this.editor.getArrowInfo(shape)\n\t\tconst bounds = Box2d.ZeroFix(this.editor.getShapeGeometry(shape).bounds)\n\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tconst changeIndex = React.useMemo<number>(() => {\n\t\t\treturn this.editor.environment.isSafari ? (globalRenderIndex += 1) : 0\n\t\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t}, [shape])\n\n\t\tif (!info?.isValid) return null\n\n\t\tconst strokeWidth = STROKE_SIZES[shape.props.size]\n\n\t\tconst as = info.start.arrowhead && getArrowheadPathForType(info, 'start', strokeWidth)\n\t\tconst ae = info.end.arrowhead && getArrowheadPathForType(info, 'end', strokeWidth)\n\n\t\tconst path = info.isStraight ? getSolidStraightArrowPath(info) : getSolidCurvedArrowPath(info)\n\n\t\tlet handlePath: null | React.JSX.Element = null\n\n\t\tif (onlySelectedShape === shape && shouldDisplayHandles) {\n\t\t\tconst sw = 2\n\t\t\tconst { strokeDasharray, strokeDashoffset } = getPerfectDashProps(\n\t\t\t\tinfo.isStraight\n\t\t\t\t\t? Vec2d.Dist(info.start.handle, info.end.handle)\n\t\t\t\t\t: Math.abs(info.handleArc.length),\n\t\t\t\tsw,\n\t\t\t\t{\n\t\t\t\t\tend: 'skip',\n\t\t\t\t\tstart: 'skip',\n\t\t\t\t\tlengthRatio: 2.5,\n\t\t\t\t}\n\t\t\t)\n\n\t\t\thandlePath =\n\t\t\t\tshape.props.start.type === 'binding' || shape.props.end.type === 'binding' ? (\n\t\t\t\t\t<path\n\t\t\t\t\t\tclassName=\"tl-arrow-hint\"\n\t\t\t\t\t\td={info.isStraight ? getStraightArrowHandlePath(info) : getCurvedArrowHandlePath(info)}\n\t\t\t\t\t\tstrokeDasharray={strokeDasharray}\n\t\t\t\t\t\tstrokeDashoffset={strokeDashoffset}\n\t\t\t\t\t\tstrokeWidth={sw}\n\t\t\t\t\t\tmarkerStart={\n\t\t\t\t\t\t\tshape.props.start.type === 'binding'\n\t\t\t\t\t\t\t\t? shape.props.start.isExact\n\t\t\t\t\t\t\t\t\t? ''\n\t\t\t\t\t\t\t\t\t: shape.props.start.isPrecise\n\t\t\t\t\t\t\t\t\t? 'url(#arrowhead-cross)'\n\t\t\t\t\t\t\t\t\t: 'url(#arrowhead-dot)'\n\t\t\t\t\t\t\t\t: ''\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmarkerEnd={\n\t\t\t\t\t\t\tshape.props.end.type === 'binding'\n\t\t\t\t\t\t\t\t? shape.props.end.isExact\n\t\t\t\t\t\t\t\t\t? ''\n\t\t\t\t\t\t\t\t\t: shape.props.end.isPrecise\n\t\t\t\t\t\t\t\t\t? 'url(#arrowhead-cross)'\n\t\t\t\t\t\t\t\t\t: 'url(#arrowhead-dot)'\n\t\t\t\t\t\t\t\t: ''\n\t\t\t\t\t\t}\n\t\t\t\t\t\topacity={0.16}\n\t\t\t\t\t/>\n\t\t\t\t) : null\n\t\t}\n\n\t\tconst { strokeDasharray, strokeDashoffset } = getPerfectDashProps(\n\t\t\tinfo.isStraight ? info.length : Math.abs(info.bodyArc.length),\n\t\t\tstrokeWidth,\n\t\t\t{\n\t\t\t\tstyle: shape.props.dash,\n\t\t\t}\n\t\t)\n\n\t\tconst labelGeometry = shape.props.text.trim()\n\t\t\t? (this.editor.getShapeGeometry<Group2d>(shape).children[1] as Rectangle2d)\n\t\t\t: null\n\n\t\tconst maskStartArrowhead = !(\n\t\t\tinfo.start.arrowhead === 'none' || info.start.arrowhead === 'arrow'\n\t\t)\n\t\tconst maskEndArrowhead = !(info.end.arrowhead === 'none' || info.end.arrowhead === 'arrow')\n\n\t\t// NOTE: I know right setting `changeIndex` hacky-as right! But we need this because otherwise safari loses\n\t\t// the mask, see <https://linear.app/tldraw/issue/TLD-1500/changing-arrow-color-makes-line-pass-through-text>\n\t\tconst maskId = (shape.id + '_clip_' + changeIndex).replace(':', '_')\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<SVGContainer id={shape.id} style={{ minWidth: 50, minHeight: 50 }}>\n\t\t\t\t\t{/* Yep */}\n\t\t\t\t\t<defs>\n\t\t\t\t\t\t<mask id={maskId}>\n\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\tx={toDomPrecision(-100 + bounds.minX)}\n\t\t\t\t\t\t\t\ty={toDomPrecision(-100 + bounds.minY)}\n\t\t\t\t\t\t\t\twidth={toDomPrecision(bounds.width + 200)}\n\t\t\t\t\t\t\t\theight={toDomPrecision(bounds.height + 200)}\n\t\t\t\t\t\t\t\tfill=\"white\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{labelGeometry && (\n\t\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\t\tx={labelGeometry.x}\n\t\t\t\t\t\t\t\t\ty={labelGeometry.y}\n\t\t\t\t\t\t\t\t\twidth={labelGeometry.w}\n\t\t\t\t\t\t\t\t\theight={labelGeometry.h}\n\t\t\t\t\t\t\t\t\tfill=\"black\"\n\t\t\t\t\t\t\t\t\trx={4}\n\t\t\t\t\t\t\t\t\try={4}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{as && maskStartArrowhead && (\n\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\td={as}\n\t\t\t\t\t\t\t\t\tfill={info.start.arrowhead === 'arrow' ? 'none' : 'black'}\n\t\t\t\t\t\t\t\t\tstroke=\"none\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{ae && maskEndArrowhead && (\n\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\td={ae}\n\t\t\t\t\t\t\t\t\tfill={info.end.arrowhead === 'arrow' ? 'none' : 'black'}\n\t\t\t\t\t\t\t\t\tstroke=\"none\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</mask>\n\t\t\t\t\t</defs>\n\t\t\t\t\t<g\n\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\tstroke={theme[shape.props.color].solid}\n\t\t\t\t\t\tstrokeWidth={strokeWidth}\n\t\t\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\t\t\tpointerEvents=\"none\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{handlePath}\n\t\t\t\t\t\t{/* firefox will clip if you provide a maskURL even if there is no mask matching that URL in the DOM */}\n\t\t\t\t\t\t<g mask={`url(#${maskId})`}>\n\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\tx={toDomPrecision(bounds.minX - 100)}\n\t\t\t\t\t\t\t\ty={toDomPrecision(bounds.minY - 100)}\n\t\t\t\t\t\t\t\twidth={toDomPrecision(bounds.width + 200)}\n\t\t\t\t\t\t\t\theight={toDomPrecision(bounds.height + 200)}\n\t\t\t\t\t\t\t\topacity={0}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\td={path}\n\t\t\t\t\t\t\t\tstrokeDasharray={strokeDasharray}\n\t\t\t\t\t\t\t\tstrokeDashoffset={strokeDashoffset}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</g>\n\t\t\t\t\t\t{as && maskStartArrowhead && shape.props.fill !== 'none' && (\n\t\t\t\t\t\t\t<ShapeFill theme={theme} d={as} color={shape.props.color} fill={shape.props.fill} />\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{ae && maskEndArrowhead && shape.props.fill !== 'none' && (\n\t\t\t\t\t\t\t<ShapeFill theme={theme} d={ae} color={shape.props.color} fill={shape.props.fill} />\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{as && <path d={as} />}\n\t\t\t\t\t\t{ae && <path d={ae} />}\n\t\t\t\t\t</g>\n\t\t\t\t</SVGContainer>\n\t\t\t\t<ArrowTextLabel\n\t\t\t\t\tid={shape.id}\n\t\t\t\t\ttext={shape.props.text}\n\t\t\t\t\tfont={shape.props.font}\n\t\t\t\t\tsize={shape.props.size}\n\t\t\t\t\tposition={info.middle}\n\t\t\t\t\twidth={labelGeometry?.w ?? 0}\n\t\t\t\t\tlabelColor={theme[shape.props.labelColor].solid}\n\t\t\t\t/>\n\t\t\t</>\n\t\t)\n\t}\n\n\tindicator(shape: TLArrowShape) {\n\t\tconst { start, end } = getArrowTerminalsInArrowSpace(this.editor, shape)\n\n\t\tconst info = this.editor.getArrowInfo(shape)\n\t\tconst geometry = this.editor.getShapeGeometry<Group2d>(shape)\n\t\tconst bounds = geometry.bounds\n\n\t\tconst labelGeometry = shape.props.text.trim() ? (geometry.children[1] as Rectangle2d) : null\n\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tconst isEditing = useIsEditing(shape.id)\n\n\t\tif (!info) return null\n\t\tif (Vec2d.Equals(start, end)) return null\n\n\t\tconst strokeWidth = STROKE_SIZES[shape.props.size]\n\n\t\tconst as = info.start.arrowhead && getArrowheadPathForType(info, 'start', strokeWidth)\n\t\tconst ae = info.end.arrowhead && getArrowheadPathForType(info, 'end', strokeWidth)\n\n\t\tconst path = info.isStraight ? getSolidStraightArrowPath(info) : getSolidCurvedArrowPath(info)\n\n\t\tconst includeMask =\n\t\t\t(as && info.start.arrowhead !== 'arrow') ||\n\t\t\t(ae && info.end.arrowhead !== 'arrow') ||\n\t\t\t!!labelGeometry\n\n\t\tconst maskId = (shape.id + '_clip').replace(':', '_')\n\n\t\tif (isEditing && labelGeometry) {\n\t\t\treturn (\n\t\t\t\t<rect\n\t\t\t\t\tx={toDomPrecision(labelGeometry.x)}\n\t\t\t\t\ty={toDomPrecision(labelGeometry.y)}\n\t\t\t\t\twidth={labelGeometry.w}\n\t\t\t\t\theight={labelGeometry.h}\n\t\t\t\t\trx={3.5}\n\t\t\t\t\try={3.5}\n\t\t\t\t/>\n\t\t\t)\n\t\t}\n\n\t\treturn (\n\t\t\t<g>\n\t\t\t\t{includeMask && (\n\t\t\t\t\t<defs>\n\t\t\t\t\t\t<mask id={maskId}>\n\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\tx={bounds.minX - 100}\n\t\t\t\t\t\t\t\ty={bounds.minY - 100}\n\t\t\t\t\t\t\t\twidth={bounds.w + 200}\n\t\t\t\t\t\t\t\theight={bounds.h + 200}\n\t\t\t\t\t\t\t\tfill=\"white\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{labelGeometry && (\n\t\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\t\tx={toDomPrecision(labelGeometry.x)}\n\t\t\t\t\t\t\t\t\ty={toDomPrecision(labelGeometry.y)}\n\t\t\t\t\t\t\t\t\twidth={labelGeometry.w}\n\t\t\t\t\t\t\t\t\theight={labelGeometry.h}\n\t\t\t\t\t\t\t\t\tfill=\"black\"\n\t\t\t\t\t\t\t\t\trx={3.5}\n\t\t\t\t\t\t\t\t\try={3.5}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{as && (\n\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\td={as}\n\t\t\t\t\t\t\t\t\tfill={info.start.arrowhead === 'arrow' ? 'none' : 'black'}\n\t\t\t\t\t\t\t\t\tstroke=\"none\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{ae && (\n\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\td={ae}\n\t\t\t\t\t\t\t\t\tfill={info.end.arrowhead === 'arrow' ? 'none' : 'black'}\n\t\t\t\t\t\t\t\t\tstroke=\"none\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</mask>\n\t\t\t\t\t</defs>\n\t\t\t\t)}\n\t\t\t\t{/* firefox will clip if you provide a maskURL even if there is no mask matching that URL in the DOM */}\n\t\t\t\t<g {...(includeMask ? { mask: `url(#${maskId})` } : undefined)}>\n\t\t\t\t\t{/* This rect needs to be here if we're creating a mask due to an svg quirk on Chrome */}\n\t\t\t\t\t{includeMask && (\n\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\tx={bounds.minX - 100}\n\t\t\t\t\t\t\ty={bounds.minY - 100}\n\t\t\t\t\t\t\twidth={bounds.width + 200}\n\t\t\t\t\t\t\theight={bounds.height + 200}\n\t\t\t\t\t\t\topacity={0}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\n\t\t\t\t\t<path d={path} />\n\t\t\t\t</g>\n\t\t\t\t{as && <path d={as} />}\n\t\t\t\t{ae && <path d={ae} />}\n\t\t\t\t{labelGeometry && (\n\t\t\t\t\t<rect\n\t\t\t\t\t\tx={toDomPrecision(labelGeometry.x)}\n\t\t\t\t\t\ty={toDomPrecision(labelGeometry.y)}\n\t\t\t\t\t\twidth={labelGeometry.w}\n\t\t\t\t\t\theight={labelGeometry.h}\n\t\t\t\t\t\trx={3.5}\n\t\t\t\t\t\try={3.5}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</g>\n\t\t)\n\t}\n\n\toverride onEditEnd: TLOnEditEndHandler<TLArrowShape> = (shape) => {\n\t\tconst {\n\t\t\tid,\n\t\t\ttype,\n\t\t\tprops: { text },\n\t\t} = shape\n\n\t\tif (text.trimEnd() !== shape.props.text) {\n\t\t\tthis.editor.updateShapes<TLArrowShape>([\n\t\t\t\t{\n\t\t\t\t\tid,\n\t\t\t\t\ttype,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\ttext: text.trimEnd(),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t])\n\t\t}\n\t}\n\n\toverride toSvg(shape: TLArrowShape, ctx: SvgExportContext) {\n\t\tconst theme = getDefaultColorTheme({ isDarkMode: this.editor.user.getIsDarkMode() })\n\t\tctx.addExportDef(getFillDefForExport(shape.props.fill, theme))\n\n\t\tconst color = theme[shape.props.color].solid\n\n\t\tconst info = this.editor.getArrowInfo(shape)\n\n\t\tconst strokeWidth = STROKE_SIZES[shape.props.size]\n\n\t\t// Group for arrow\n\t\tconst g = document.createElementNS('http://www.w3.org/2000/svg', 'g')\n\t\tif (!info) return g\n\n\t\t// Arrowhead start path\n\t\tconst as = info.start.arrowhead && getArrowheadPathForType(info, 'start', strokeWidth)\n\t\t// Arrowhead end path\n\t\tconst ae = info.end.arrowhead && getArrowheadPathForType(info, 'end', strokeWidth)\n\n\t\tconst geometry = this.editor.getShapeGeometry<Group2d>(shape)\n\t\tconst bounds = geometry.bounds\n\n\t\tconst labelGeometry = shape.props.text.trim() ? (geometry.children[1] as Rectangle2d) : null\n\n\t\tconst maskId = (shape.id + '_clip').replace(':', '_')\n\n\t\t// If we have any arrowheads, then mask the arrowheads\n\t\tif (as || ae || !!labelGeometry) {\n\t\t\t// Create mask for arrowheads\n\n\t\t\t// Create defs\n\t\t\tconst defs = document.createElementNS('http://www.w3.org/2000/svg', 'defs')\n\n\t\t\t// Create mask\n\t\t\tconst mask = document.createElementNS('http://www.w3.org/2000/svg', 'mask')\n\t\t\tmask.id = maskId\n\n\t\t\t// Create large white shape for mask\n\t\t\tconst rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect')\n\t\t\trect.setAttribute('x', bounds.minX - 100 + '')\n\t\t\trect.setAttribute('y', bounds.minY - 100 + '')\n\t\t\trect.setAttribute('width', bounds.width + 200 + '')\n\t\t\trect.setAttribute('height', bounds.height + 200 + '')\n\t\t\trect.setAttribute('fill', 'white')\n\t\t\tmask.appendChild(rect)\n\n\t\t\t// add arrowhead start mask\n\t\t\tif (as) mask.appendChild(getArrowheadSvgMask(as, info.start.arrowhead))\n\n\t\t\t// add arrowhead end mask\n\t\t\tif (ae) mask.appendChild(getArrowheadSvgMask(ae, info.end.arrowhead))\n\n\t\t\t// Mask out text label if text is present\n\t\t\tif (labelGeometry) {\n\t\t\t\tconst labelMask = document.createElementNS('http://www.w3.org/2000/svg', 'rect')\n\t\t\t\tlabelMask.setAttribute('x', labelGeometry.x + '')\n\t\t\t\tlabelMask.setAttribute('y', labelGeometry.y + '')\n\t\t\t\tlabelMask.setAttribute('width', labelGeometry.w + '')\n\t\t\t\tlabelMask.setAttribute('height', labelGeometry.h + '')\n\t\t\t\tlabelMask.setAttribute('fill', 'black')\n\n\t\t\t\tmask.appendChild(labelMask)\n\t\t\t}\n\n\t\t\tdefs.appendChild(mask)\n\t\t\tg.appendChild(defs)\n\t\t}\n\n\t\tconst g2 = document.createElementNS('http://www.w3.org/2000/svg', 'g')\n\t\tg2.setAttribute('mask', `url(#${maskId})`)\n\t\tg.appendChild(g2)\n\n\t\t// Dumb mask fix thing\n\t\tconst rect2 = document.createElementNS('http://www.w3.org/2000/svg', 'rect')\n\t\trect2.setAttribute('x', '-100')\n\t\trect2.setAttribute('y', '-100')\n\t\trect2.setAttribute('width', bounds.width + 200 + '')\n\t\trect2.setAttribute('height', bounds.height + 200 + '')\n\t\trect2.setAttribute('fill', 'transparent')\n\t\trect2.setAttribute('stroke', 'none')\n\t\tg2.appendChild(rect2)\n\n\t\t// Arrowhead body path\n\t\tconst path = getArrowSvgPath(\n\t\t\tinfo.isStraight ? getSolidStraightArrowPath(info) : getSolidCurvedArrowPath(info),\n\t\t\tcolor,\n\t\t\tstrokeWidth\n\t\t)\n\n\t\tconst { strokeDasharray, strokeDashoffset } = getPerfectDashProps(\n\t\t\tinfo.isStraight ? info.length : Math.abs(info.bodyArc.length),\n\t\t\tstrokeWidth,\n\t\t\t{\n\t\t\t\tstyle: shape.props.dash,\n\t\t\t}\n\t\t)\n\n\t\tpath.setAttribute('stroke-dasharray', strokeDasharray)\n\t\tpath.setAttribute('stroke-dashoffset', strokeDashoffset)\n\n\t\tg2.appendChild(path)\n\n\t\t// Arrowhead start path\n\t\tif (as) {\n\t\t\tg.appendChild(\n\t\t\t\tgetArrowheadSvgPath(\n\t\t\t\t\tas,\n\t\t\t\t\tshape.props.color,\n\t\t\t\t\tstrokeWidth,\n\t\t\t\t\tshape.props.arrowheadStart === 'arrow' ? 'none' : shape.props.fill,\n\t\t\t\t\ttheme\n\t\t\t\t)\n\t\t\t)\n\t\t}\n\t\t// Arrowhead end path\n\t\tif (ae) {\n\t\t\tg.appendChild(\n\t\t\t\tgetArrowheadSvgPath(\n\t\t\t\t\tae,\n\t\t\t\t\tshape.props.color,\n\t\t\t\t\tstrokeWidth,\n\t\t\t\t\tshape.props.arrowheadEnd === 'arrow' ? 'none' : shape.props.fill,\n\t\t\t\t\ttheme\n\t\t\t\t)\n\t\t\t)\n\t\t}\n\n\t\t// Text Label\n\t\tif (labelGeometry) {\n\t\t\tctx.addExportDef(getFontDefForExport(shape.props.font))\n\n\t\t\tconst opts = {\n\t\t\t\tfontSize: ARROW_LABEL_FONT_SIZES[shape.props.size],\n\t\t\t\tlineHeight: TEXT_PROPS.lineHeight,\n\t\t\t\tfontFamily: DefaultFontFamilies[shape.props.font],\n\t\t\t\tpadding: 0,\n\t\t\t\ttextAlign: 'middle' as const,\n\t\t\t\twidth: labelGeometry.w - 8,\n\t\t\t\tverticalTextAlign: 'middle' as const,\n\t\t\t\theight: labelGeometry.h,\n\t\t\t\tfontStyle: 'normal',\n\t\t\t\tfontWeight: 'normal',\n\t\t\t\toverflow: 'wrap' as const,\n\t\t\t}\n\n\t\t\tconst textElm = createTextSvgElementFromSpans(\n\t\t\t\tthis.editor,\n\t\t\t\tthis.editor.textMeasure.measureTextSpans(shape.props.text, opts),\n\t\t\t\topts\n\t\t\t)\n\t\t\ttextElm.setAttribute('fill', theme[shape.props.labelColor].solid)\n\n\t\t\tconst children = Array.from(textElm.children) as unknown as SVGTSpanElement[]\n\n\t\t\tchildren.forEach((child) => {\n\t\t\t\tconst x = parseFloat(child.getAttribute('x') || '0')\n\t\t\t\tconst y = parseFloat(child.getAttribute('y') || '0')\n\n\t\t\t\tchild.setAttribute('x', x + 4 + labelGeometry.x + 'px')\n\t\t\t\tchild.setAttribute('y', y + labelGeometry.y + 'px')\n\t\t\t})\n\n\t\t\tconst textBgEl = textElm.cloneNode(true) as SVGTextElement\n\t\t\ttextBgEl.setAttribute('stroke-width', '2')\n\t\t\ttextBgEl.setAttribute('fill', theme.background)\n\t\t\ttextBgEl.setAttribute('stroke', theme.background)\n\n\t\t\tg.appendChild(textBgEl)\n\t\t\tg.appendChild(textElm)\n\t\t}\n\n\t\treturn g\n\t}\n\n\toverride getCanvasSvgDefs(): TLShapeUtilCanvasSvgDef[] {\n\t\treturn [getFillDefForCanvas()]\n\t}\n}\n\nfunction getArrowheadSvgMask(d: string, arrowhead: TLArrowShapeArrowheadStyle) {\n\tconst path = document.createElementNS('http://www.w3.org/2000/svg', 'path')\n\tpath.setAttribute('d', d)\n\tpath.setAttribute('fill', arrowhead === 'arrow' ? 'none' : 'black')\n\tpath.setAttribute('stroke', 'none')\n\treturn path\n}\n\nfunction getArrowSvgPath(d: string, color: string, strokeWidth: number) {\n\tconst path = document.createElementNS('http://www.w3.org/2000/svg', 'path')\n\tpath.setAttribute('d', d)\n\tpath.setAttribute('fill', 'none')\n\tpath.setAttribute('stroke', color)\n\tpath.setAttribute('stroke-width', strokeWidth + '')\n\treturn path\n}\n\nfunction getArrowheadSvgPath(\n\td: string,\n\tcolor: TLDefaultColorStyle,\n\tstrokeWidth: number,\n\tfill: TLDefaultFillStyle,\n\ttheme: TLDefaultColorTheme\n) {\n\tconst path = document.createElementNS('http://www.w3.org/2000/svg', 'path')\n\tpath.setAttribute('d', d)\n\tpath.setAttribute('fill', 'none')\n\tpath.setAttribute('stroke', theme[color].solid)\n\tpath.setAttribute('stroke-width', strokeWidth + '')\n\n\t// Get the fill element, if any\n\tconst shapeFill = getShapeFillSvg({\n\t\td,\n\t\tfill,\n\t\tcolor,\n\t\ttheme,\n\t})\n\n\tif (shapeFill) {\n\t\t// If there is a fill element, return a group containing the fill and the path\n\t\tconst g = document.createElementNS('http://www.w3.org/2000/svg', 'g')\n\t\tg.appendChild(shapeFill)\n\t\tg.appendChild(path)\n\t\treturn g\n\t} else {\n\t\t// Otherwise, just return the path\n\t\treturn path\n\t}\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA0hBK;AA1hBL,oBAoCO;AACP,mBAAkB;AAClB,uBAAiE;AACjE,2CAA8C;AAC9C,qCAKO;AACP,8BAIO;AACP,iCAAoC;AACpC,4BAA+B;AAE/B,IAAI,oBAAoB;AAEjB,MAAM,mBAAmB;AAGzB,MAAM,uBAAuB,wBAAwB;AAAA,EAC3D,OAAgB,OAAO;AAAA,EACvB,OAAgB,QAAQ;AAAA,EACxB,OAAgB,aAAa;AAAA,EAEpB,UAAU,MAAM;AAAA,EAChB,UAAU,MAAM;AAAA,EAChB,UAAU,MAAM;AAAA,EAChB,oBAAmD,MAAM;AAAA,EACzD,mBAAkD,MAAM;AAAA,EACxD,wBAAuD,MAAM;AAAA,EAC7D,wBAAuD,MAAM;AAAA,EAE7D,kBAAyC;AACjD,WAAO;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,MACN,OAAO;AAAA,MACP,YAAY;AAAA,MACZ,MAAM;AAAA,MACN,OAAO,EAAE,MAAM,SAAS,GAAG,GAAG,GAAG,EAAE;AAAA,MACnC,KAAK,EAAE,MAAM,SAAS,GAAG,GAAG,GAAG,EAAE;AAAA,MACjC,gBAAgB;AAAA,MAChB,cAAc;AAAA,MACd,MAAM;AAAA,MACN,MAAM;AAAA,IACP;AAAA,EACD;AAAA,EAEA,YAAY,OAAqB;AAChC,UAAM,OAAO,KAAK,OAAO,aAAa,KAAK;AAE3C,UAAM,WAAW,KAAK,aACnB,IAAI,qBAAO;AAAA,MACX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Aa,UAAU,KAAK;AACjC,OAAK,aAAa,gBAAgB,cAAc,EAAE;AAClD,SAAO;AACR;AAEA,SAAS,oBACR,GACA,OACA,aACA,MACA,OACC;AACD,QAAM,OAAO,SAAS,gBAAgB,8BAA8B,MAAM;AAC1E,OAAK,aAAa,KAAK,CAAC;AACxB,OAAK,aAAa,QAAQ,MAAM;AAChC,OAAK,aAAa,UAAU,MAAM,KAAK,EAAE,KAAK;AAC9C,OAAK,aAAa,gBAAgB,cAAc,EAAE;AAGlD,QAAM,gBAAY,kCAAgB;AAAA,IACjC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAC;AAED,MAAI,WAAW;AAEd,UAAM,IAAI,SAAS,gBAAgB,8BAA8B,GAAG;AACpE,MAAE,YAAY,SAAS;AACvB,MAAE,YAAY,IAAI;AAClB,WAAO;AAAA,EACR,OAAO;AAEN,WAAO;AAAA,EACR;AACD;",
|
|
6
6
|
"names": ["point", "React", "strokeDasharray", "strokeDashoffset"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
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 PollShapeTool_exports = {};
|
|
20
|
+
__export(PollShapeTool_exports, {
|
|
21
|
+
PollShapeTool: () => PollShapeTool
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(PollShapeTool_exports);
|
|
24
|
+
var import_editor = require("@bigbluebutton/editor");
|
|
25
|
+
class PollShapeTool extends import_editor.BaseBoxShapeTool {
|
|
26
|
+
static id = "poll";
|
|
27
|
+
static initial = "idle";
|
|
28
|
+
shapeType = "poll";
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=PollShapeTool.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/lib/shapes/poll/PollShapeTool.tsx"],
|
|
4
|
+
"sourcesContent": ["import { BaseBoxShapeTool } from '@bigbluebutton/editor'\n\nexport class PollShapeTool extends BaseBoxShapeTool {\n\tstatic override id = 'poll'\n\tstatic override initial = 'idle'\n\toverride shapeType = 'poll'\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAiC;AAE1B,MAAM,sBAAsB,+BAAiB;AAAA,EACnD,OAAgB,KAAK;AAAA,EACrB,OAAgB,UAAU;AAAA,EACjB,YAAY;AACtB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var PollShapeUtil_exports = {};
|
|
30
|
+
__export(PollShapeUtil_exports, {
|
|
31
|
+
PollShapeUtil: () => PollShapeUtil,
|
|
32
|
+
default: () => PollShapeUtil_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(PollShapeUtil_exports);
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var import_editor = require("@bigbluebutton/editor");
|
|
37
|
+
var import_poll_content = __toESM(require("./components/poll-content"));
|
|
38
|
+
var import_poll_shape_migrations = require("./poll-shape-migrations");
|
|
39
|
+
var import_poll_shape_props = require("./poll-shape-props");
|
|
40
|
+
class PollShapeUtil extends import_editor.ShapeUtil {
|
|
41
|
+
static type = "poll";
|
|
42
|
+
static props = import_poll_shape_props.pollShapeProps;
|
|
43
|
+
static migrations = import_poll_shape_migrations.pollShapeMigrations;
|
|
44
|
+
isAspectRatioLocked = (_shape) => false;
|
|
45
|
+
canResize = (_shape) => true;
|
|
46
|
+
canBind = (_shape) => true;
|
|
47
|
+
getDefaultProps() {
|
|
48
|
+
return {
|
|
49
|
+
w: 300,
|
|
50
|
+
h: 300,
|
|
51
|
+
color: "black",
|
|
52
|
+
fill: "white",
|
|
53
|
+
question: "",
|
|
54
|
+
numRespondents: 0,
|
|
55
|
+
numResponders: 0,
|
|
56
|
+
questionText: "",
|
|
57
|
+
questionType: "",
|
|
58
|
+
answers: []
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
getGeometry(shape) {
|
|
62
|
+
return new import_editor.Rectangle2d({
|
|
63
|
+
width: shape.props.w,
|
|
64
|
+
height: shape.props.h,
|
|
65
|
+
isFilled: true
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
component(shape) {
|
|
69
|
+
const { bounds } = this.editor.getShapeGeometry(shape);
|
|
70
|
+
const theme = (0, import_editor.getDefaultColorTheme)({
|
|
71
|
+
isDarkMode: this.editor.user.getIsDarkMode()
|
|
72
|
+
});
|
|
73
|
+
const pollMetadata = JSON.stringify({
|
|
74
|
+
id: shape.id,
|
|
75
|
+
question: shape.props.question,
|
|
76
|
+
numRespondents: shape.props.numRespondents,
|
|
77
|
+
numResponders: shape.props.numResponders,
|
|
78
|
+
questionText: shape.props.questionText,
|
|
79
|
+
questionType: shape.props.questionType,
|
|
80
|
+
answers: shape.props.answers
|
|
81
|
+
});
|
|
82
|
+
const adjustedHeight = shape.props.questionText.length > 0 ? bounds.height - 75 : bounds.height;
|
|
83
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
84
|
+
import_editor.HTMLContainer,
|
|
85
|
+
{
|
|
86
|
+
id: shape.id,
|
|
87
|
+
style: {
|
|
88
|
+
border: "1px solid #8B9AA8",
|
|
89
|
+
borderRadius: "4px",
|
|
90
|
+
boxShadow: "0px 0px 4px 0px rgba(0, 0, 0, 0.20)",
|
|
91
|
+
display: "flex",
|
|
92
|
+
flexDirection: "column",
|
|
93
|
+
alignItems: "center",
|
|
94
|
+
justifyContent: "center",
|
|
95
|
+
pointerEvents: "all",
|
|
96
|
+
backgroundColor: theme[shape.props.color].semi,
|
|
97
|
+
color: theme[shape.props.color].solid
|
|
98
|
+
},
|
|
99
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
100
|
+
"div",
|
|
101
|
+
{
|
|
102
|
+
style: {
|
|
103
|
+
width: `${bounds.width}px`,
|
|
104
|
+
overflow: "hidden",
|
|
105
|
+
position: "relative"
|
|
106
|
+
},
|
|
107
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_poll_content.default, { metadata: pollMetadata, height: adjustedHeight })
|
|
108
|
+
}
|
|
109
|
+
)
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
indicator(shape) {
|
|
114
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { width: shape.props.w, height: shape.props.h });
|
|
115
|
+
}
|
|
116
|
+
onResize = (shape, info) => {
|
|
117
|
+
return (0, import_editor.resizeBox)(shape, info);
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
var PollShapeUtil_default = PollShapeUtil;
|
|
121
|
+
//# sourceMappingURL=PollShapeUtil.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/lib/shapes/poll/PollShapeUtil.tsx"],
|
|
4
|
+
"sourcesContent": ["import {\n\tHTMLContainer,\n\tRectangle2d,\n\tShapeUtil,\n\tTLOnResizeHandler,\n\tgetDefaultColorTheme,\n\tresizeBox,\n} from '@bigbluebutton/editor'\n\nimport ChatPollContent from './components/poll-content'\nimport { pollShapeMigrations } from './poll-shape-migrations'\nimport { pollShapeProps } from './poll-shape-props'\nimport { IPollShape } from './poll-shape-types'\n\nexport class PollShapeUtil extends ShapeUtil<IPollShape> {\n\tstatic override type = 'poll' as const\n\n\tstatic override props = pollShapeProps\n\n\tstatic override migrations = pollShapeMigrations\n\n\toverride isAspectRatioLocked = (_shape: IPollShape) => false\n\n\toverride canResize = (_shape: IPollShape) => true\n\n\toverride canBind = (_shape: IPollShape) => true\n\n\tgetDefaultProps(): IPollShape['props'] {\n\t\treturn {\n\t\t\tw: 300,\n\t\t\th: 300,\n\t\t\tcolor: 'black',\n\t\t\tfill: 'white',\n\t\t\tquestion: '',\n\t\t\tnumRespondents: 0,\n\t\t\tnumResponders: 0,\n\t\t\tquestionText: '',\n\t\t\tquestionType: '',\n\t\t\tanswers: [],\n\t\t}\n\t}\n\n\tgetGeometry(shape: IPollShape) {\n\t\treturn new Rectangle2d({\n\t\t\twidth: shape.props.w,\n\t\t\theight: shape.props.h,\n\t\t\tisFilled: true,\n\t\t})\n\t}\n\n\tcomponent(shape: IPollShape) {\n\t\tconst { bounds } = this.editor.getShapeGeometry(shape)\n\t\tconst theme = getDefaultColorTheme({\n\t\t\tisDarkMode: this.editor.user.getIsDarkMode(),\n\t\t})\n\n\t\t// const contentRef = React.useRef<HTMLDivElement>(null)\n\t\tconst pollMetadata = JSON.stringify({\n\t\t\tid: shape.id,\n\t\t\tquestion: shape.props.question,\n\t\t\tnumRespondents: shape.props.numRespondents,\n\t\t\tnumResponders: shape.props.numResponders,\n\t\t\tquestionText: shape.props.questionText,\n\t\t\tquestionType: shape.props.questionType,\n\t\t\tanswers: shape.props.answers,\n\t\t})\n\n\t\tconst adjustedHeight = shape.props.questionText.length > 0 ? bounds.height - 75 : bounds.height\n\n\t\treturn (\n\t\t\t<HTMLContainer\n\t\t\t\tid={shape.id}\n\t\t\t\tstyle={{\n\t\t\t\t\tborder: '1px solid #8B9AA8',\n\t\t\t\t\tborderRadius: '4px',\n\t\t\t\t\tboxShadow: '0px 0px 4px 0px rgba(0, 0, 0, 0.20)',\n\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\tflexDirection: 'column',\n\t\t\t\t\talignItems: 'center',\n\t\t\t\t\tjustifyContent: 'center',\n\t\t\t\t\tpointerEvents: 'all',\n\t\t\t\t\tbackgroundColor: theme[shape.props.color].semi,\n\t\t\t\t\tcolor: theme[shape.props.color].solid,\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\twidth: `${bounds.width}px`,\n\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t\tposition: 'relative',\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<ChatPollContent metadata={pollMetadata} height={adjustedHeight} />\n\t\t\t\t</div>\n\t\t\t</HTMLContainer>\n\t\t)\n\t}\n\n\tindicator(shape: IPollShape) {\n\t\treturn <rect width={shape.props.w} height={shape.props.h} />\n\t}\n\n\toverride onResize: TLOnResizeHandler<IPollShape> = (shape, info) => {\n\t\treturn resizeBox(shape, info)\n\t}\n}\n\nexport default PollShapeUtil\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA4FK;AA5FL,oBAOO;AAEP,0BAA4B;AAC5B,mCAAoC;AACpC,8BAA+B;AAGxB,MAAM,sBAAsB,wBAAsB;AAAA,EACxD,OAAgB,OAAO;AAAA,EAEvB,OAAgB,QAAQ;AAAA,EAExB,OAAgB,aAAa;AAAA,EAEpB,sBAAsB,CAAC,WAAuB;AAAA,EAE9C,YAAY,CAAC,WAAuB;AAAA,EAEpC,UAAU,CAAC,WAAuB;AAAA,EAE3C,kBAAuC;AACtC,WAAO;AAAA,MACN,GAAG;AAAA,MACH,GAAG;AAAA,MACH,OAAO;AAAA,MACP,MAAM;AAAA,MACN,UAAU;AAAA,MACV,gBAAgB;AAAA,MAChB,eAAe;AAAA,MACf,cAAc;AAAA,MACd,cAAc;AAAA,MACd,SAAS,CAAC;AAAA,IACX;AAAA,EACD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