tldraw 3.15.0-canary.e3f6387b7e04 → 3.15.0-canary.ee0606e7631e
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.js +1 -1
- package/dist-cjs/lib/canvas/TldrawCropHandles.js +1 -1
- package/dist-cjs/lib/canvas/TldrawCropHandles.js.map +2 -2
- package/dist-cjs/lib/canvas/TldrawHandles.js +1 -1
- package/dist-cjs/lib/canvas/TldrawHandles.js.map +2 -2
- package/dist-cjs/lib/canvas/TldrawOverlays.js +1 -1
- package/dist-cjs/lib/canvas/TldrawOverlays.js.map +2 -2
- package/dist-cjs/lib/canvas/TldrawSelectionForeground.js +279 -271
- package/dist-cjs/lib/canvas/TldrawSelectionForeground.js.map +2 -2
- package/dist-cjs/lib/shapes/shared/PlainTextLabel.js +1 -0
- package/dist-cjs/lib/shapes/shared/PlainTextLabel.js.map +2 -2
- package/dist-cjs/lib/shapes/shared/RichTextLabel.js +1 -0
- package/dist-cjs/lib/shapes/shared/RichTextLabel.js.map +2 -2
- package/dist-cjs/lib/ui/components/NavigationPanel/DefaultNavigationPanel.js +3 -4
- package/dist-cjs/lib/ui/components/NavigationPanel/DefaultNavigationPanel.js.map +2 -2
- package/dist-cjs/lib/ui/version.js +3 -3
- package/dist-cjs/lib/ui/version.js.map +1 -1
- package/dist-esm/index.mjs +1 -1
- package/dist-esm/lib/canvas/TldrawCropHandles.mjs +1 -1
- package/dist-esm/lib/canvas/TldrawCropHandles.mjs.map +2 -2
- package/dist-esm/lib/canvas/TldrawHandles.mjs +1 -1
- package/dist-esm/lib/canvas/TldrawHandles.mjs.map +2 -2
- package/dist-esm/lib/canvas/TldrawOverlays.mjs +1 -1
- package/dist-esm/lib/canvas/TldrawOverlays.mjs.map +2 -2
- package/dist-esm/lib/canvas/TldrawSelectionForeground.mjs +279 -271
- package/dist-esm/lib/canvas/TldrawSelectionForeground.mjs.map +2 -2
- package/dist-esm/lib/shapes/shared/PlainTextLabel.mjs +1 -0
- package/dist-esm/lib/shapes/shared/PlainTextLabel.mjs.map +2 -2
- package/dist-esm/lib/shapes/shared/RichTextLabel.mjs +1 -0
- package/dist-esm/lib/shapes/shared/RichTextLabel.mjs.map +2 -2
- package/dist-esm/lib/ui/components/NavigationPanel/DefaultNavigationPanel.mjs +3 -4
- package/dist-esm/lib/ui/components/NavigationPanel/DefaultNavigationPanel.mjs.map +2 -2
- package/dist-esm/lib/ui/version.mjs +3 -3
- package/dist-esm/lib/ui/version.mjs.map +1 -1
- package/package.json +3 -3
- package/src/lib/canvas/TldrawCropHandles.tsx +1 -1
- package/src/lib/canvas/TldrawHandles.tsx +5 -1
- package/src/lib/canvas/TldrawOverlays.tsx +1 -1
- package/src/lib/canvas/TldrawSelectionForeground.tsx +5 -1
- package/src/lib/shapes/shared/PlainTextLabel.tsx +1 -0
- package/src/lib/shapes/shared/RichTextLabel.tsx +1 -0
- package/src/lib/ui/components/NavigationPanel/DefaultNavigationPanel.tsx +3 -4
- package/src/lib/ui/version.ts +3 -3
- package/src/lib/ui.css +0 -14
- package/tldraw.css +2 -16
package/dist-cjs/index.js
CHANGED
|
@@ -534,7 +534,7 @@ var import_buildFromV1Document = require("./lib/utils/tldr/buildFromV1Document")
|
|
|
534
534
|
var import_file = require("./lib/utils/tldr/file");
|
|
535
535
|
(0, import_editor.registerTldrawLibraryVersion)(
|
|
536
536
|
"tldraw",
|
|
537
|
-
"3.15.0-canary.
|
|
537
|
+
"3.15.0-canary.ee0606e7631e",
|
|
538
538
|
"cjs"
|
|
539
539
|
);
|
|
540
540
|
//# sourceMappingURL=index.js.map
|
|
@@ -44,7 +44,7 @@ function TldrawCropHandles({
|
|
|
44
44
|
const cropStrokeWidth = (0, import_editor.toDomPrecision)(size / 3);
|
|
45
45
|
const offset = cropStrokeWidth / 2;
|
|
46
46
|
const msg = (0, import_useTranslation.useTranslation)();
|
|
47
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { className: "tl-overlays__item", children: [
|
|
47
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { className: "tl-overlays__item", "aria-hidden": "true", children: [
|
|
48
48
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
49
49
|
"polyline",
|
|
50
50
|
{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/lib/canvas/TldrawCropHandles.tsx"],
|
|
4
|
-
"sourcesContent": ["import { toDomPrecision } from '@tldraw/editor'\nimport classNames from 'classnames'\nimport { useTranslation } from '../ui/hooks/useTranslation/useTranslation'\n\nexport interface TldrawCropHandlesProps {\n\tsize: number\n\twidth: number\n\theight: number\n\thideAlternateHandles: boolean\n}\n\nexport function TldrawCropHandles({\n\tsize,\n\twidth,\n\theight,\n\thideAlternateHandles,\n}: TldrawCropHandlesProps) {\n\tconst cropStrokeWidth = toDomPrecision(size / 3)\n\tconst offset = cropStrokeWidth / 2\n\tconst msg = useTranslation()\n\n\treturn (\n\t\t<svg className=\"tl-overlays__item\">\n\t\t\t{/* Top left */}\n\t\t\t<polyline\n\t\t\t\tclassName=\"tl-corner-crop-handle\"\n\t\t\t\tpoints={`\n\t\t\t\t\t\t${toDomPrecision(0 - offset)},${toDomPrecision(size)} \n\t\t\t\t\t\t${toDomPrecision(0 - offset)},${toDomPrecision(0 - offset)} \n\t\t\t\t\t\t${toDomPrecision(size)},${toDomPrecision(0 - offset)}`}\n\t\t\t\tstrokeWidth={cropStrokeWidth}\n\t\t\t\tdata-testid=\"selection.crop.top_left\"\n\t\t\t\trole=\"button\"\n\t\t\t\taria-label={msg('handle.crop.top-left')}\n\t\t\t/>\n\t\t\t{/* Top */}\n\t\t\t<line\n\t\t\t\tclassName={classNames('tl-corner-crop-edge-handle', {\n\t\t\t\t\t'tl-hidden': hideAlternateHandles,\n\t\t\t\t})}\n\t\t\t\tx1={toDomPrecision(width / 2 - size)}\n\t\t\t\ty1={toDomPrecision(0 - offset)}\n\t\t\t\tx2={toDomPrecision(width / 2 + size)}\n\t\t\t\ty2={toDomPrecision(0 - offset)}\n\t\t\t\tstrokeWidth={cropStrokeWidth}\n\t\t\t\tdata-testid=\"selection.crop.top\"\n\t\t\t\trole=\"button\"\n\t\t\t\taria-label={msg('handle.crop.top')}\n\t\t\t/>\n\t\t\t{/* Top right */}\n\t\t\t<polyline\n\t\t\t\tclassName={classNames('tl-corner-crop-handle', {\n\t\t\t\t\t'tl-hidden': hideAlternateHandles,\n\t\t\t\t})}\n\t\t\t\tpoints={`\n\t\t\t\t\t\t${toDomPrecision(width - size)},${toDomPrecision(0 - offset)} \n\t\t\t\t\t\t${toDomPrecision(width + offset)},${toDomPrecision(0 - offset)} \n\t\t\t\t\t\t${toDomPrecision(width + offset)},${toDomPrecision(size)}`}\n\t\t\t\tstrokeWidth={cropStrokeWidth}\n\t\t\t\tdata-testid=\"selection.crop.top_right\"\n\t\t\t\trole=\"button\"\n\t\t\t\taria-label={msg('handle.crop.top-right')}\n\t\t\t/>\n\t\t\t{/* Right */}\n\t\t\t<line\n\t\t\t\tclassName={classNames('tl-corner-crop-edge-handle', {\n\t\t\t\t\t'tl-hidden': hideAlternateHandles,\n\t\t\t\t})}\n\t\t\t\tx1={toDomPrecision(width + offset)}\n\t\t\t\ty1={toDomPrecision(height / 2 - size)}\n\t\t\t\tx2={toDomPrecision(width + offset)}\n\t\t\t\ty2={toDomPrecision(height / 2 + size)}\n\t\t\t\tstrokeWidth={cropStrokeWidth}\n\t\t\t\tdata-testid=\"selection.crop.right\"\n\t\t\t\trole=\"button\"\n\t\t\t\taria-label={msg('handle.crop.right')}\n\t\t\t/>\n\t\t\t{/* Bottom right */}\n\t\t\t<polyline\n\t\t\t\tclassName=\"tl-corner-crop-handle\"\n\t\t\t\tpoints={`\n\t\t\t\t\t\t${toDomPrecision(width + offset)},${toDomPrecision(height - size)} \n\t\t\t\t\t\t${toDomPrecision(width + offset)},${toDomPrecision(height + offset)}\n\t\t\t\t\t\t${toDomPrecision(width - size)},${toDomPrecision(height + offset)}`}\n\t\t\t\tstrokeWidth={cropStrokeWidth}\n\t\t\t\tdata-testid=\"selection.crop.bottom_right\"\n\t\t\t\trole=\"button\"\n\t\t\t\taria-label={msg('handle.crop.bottom-right')}\n\t\t\t/>\n\t\t\t{/* Bottom */}\n\t\t\t<line\n\t\t\t\tclassName={classNames('tl-corner-crop-edge-handle', {\n\t\t\t\t\t'tl-hidden': hideAlternateHandles,\n\t\t\t\t})}\n\t\t\t\tx1={toDomPrecision(width / 2 - size)}\n\t\t\t\ty1={toDomPrecision(height + offset)}\n\t\t\t\tx2={toDomPrecision(width / 2 + size)}\n\t\t\t\ty2={toDomPrecision(height + offset)}\n\t\t\t\tstrokeWidth={cropStrokeWidth}\n\t\t\t\tdata-testid=\"selection.crop.bottom\"\n\t\t\t\trole=\"button\"\n\t\t\t\taria-label={msg('handle.crop.bottom')}\n\t\t\t/>\n\t\t\t{/* Bottom left */}\n\t\t\t<polyline\n\t\t\t\tclassName={classNames('tl-corner-crop-handle', {\n\t\t\t\t\t'tl-hidden': hideAlternateHandles,\n\t\t\t\t})}\n\t\t\t\tpoints={`\n\t\t\t\t\t\t${toDomPrecision(0 + size)},${toDomPrecision(height + offset)} \n\t\t\t\t\t\t${toDomPrecision(0 - offset)},${toDomPrecision(height + offset)}\n\t\t\t\t\t\t${toDomPrecision(0 - offset)},${toDomPrecision(height - size)}`}\n\t\t\t\tstrokeWidth={cropStrokeWidth}\n\t\t\t\tdata-testid=\"selection.crop.bottom_left\"\n\t\t\t\trole=\"button\"\n\t\t\t\taria-label={msg('handle.crop.bottom-left')}\n\t\t\t/>\n\t\t\t{/* Left */}\n\t\t\t<line\n\t\t\t\tclassName={classNames('tl-corner-crop-edge-handle', {\n\t\t\t\t\t'tl-hidden': hideAlternateHandles,\n\t\t\t\t})}\n\t\t\t\tx1={toDomPrecision(0 - offset)}\n\t\t\t\ty1={toDomPrecision(height / 2 - size)}\n\t\t\t\tx2={toDomPrecision(0 - offset)}\n\t\t\t\ty2={toDomPrecision(height / 2 + size)}\n\t\t\t\tstrokeWidth={cropStrokeWidth}\n\t\t\t\tdata-testid=\"selection.crop.left\"\n\t\t\t\trole=\"button\"\n\t\t\t\taria-label={msg('handle.crop.left')}\n\t\t\t/>\n\t\t</svg>\n\t)\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAsBE;AAtBF,oBAA+B;AAC/B,wBAAuB;AACvB,4BAA+B;AASxB,SAAS,kBAAkB;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAA2B;AAC1B,QAAM,sBAAkB,8BAAe,OAAO,CAAC;AAC/C,QAAM,SAAS,kBAAkB;AACjC,QAAM,UAAM,sCAAe;AAE3B,SACC,6CAAC,SAAI,WAAU,
|
|
4
|
+
"sourcesContent": ["import { toDomPrecision } from '@tldraw/editor'\nimport classNames from 'classnames'\nimport { useTranslation } from '../ui/hooks/useTranslation/useTranslation'\n\nexport interface TldrawCropHandlesProps {\n\tsize: number\n\twidth: number\n\theight: number\n\thideAlternateHandles: boolean\n}\n\nexport function TldrawCropHandles({\n\tsize,\n\twidth,\n\theight,\n\thideAlternateHandles,\n}: TldrawCropHandlesProps) {\n\tconst cropStrokeWidth = toDomPrecision(size / 3)\n\tconst offset = cropStrokeWidth / 2\n\tconst msg = useTranslation()\n\n\treturn (\n\t\t<svg className=\"tl-overlays__item\" aria-hidden=\"true\">\n\t\t\t{/* Top left */}\n\t\t\t<polyline\n\t\t\t\tclassName=\"tl-corner-crop-handle\"\n\t\t\t\tpoints={`\n\t\t\t\t\t\t${toDomPrecision(0 - offset)},${toDomPrecision(size)} \n\t\t\t\t\t\t${toDomPrecision(0 - offset)},${toDomPrecision(0 - offset)} \n\t\t\t\t\t\t${toDomPrecision(size)},${toDomPrecision(0 - offset)}`}\n\t\t\t\tstrokeWidth={cropStrokeWidth}\n\t\t\t\tdata-testid=\"selection.crop.top_left\"\n\t\t\t\trole=\"button\"\n\t\t\t\taria-label={msg('handle.crop.top-left')}\n\t\t\t/>\n\t\t\t{/* Top */}\n\t\t\t<line\n\t\t\t\tclassName={classNames('tl-corner-crop-edge-handle', {\n\t\t\t\t\t'tl-hidden': hideAlternateHandles,\n\t\t\t\t})}\n\t\t\t\tx1={toDomPrecision(width / 2 - size)}\n\t\t\t\ty1={toDomPrecision(0 - offset)}\n\t\t\t\tx2={toDomPrecision(width / 2 + size)}\n\t\t\t\ty2={toDomPrecision(0 - offset)}\n\t\t\t\tstrokeWidth={cropStrokeWidth}\n\t\t\t\tdata-testid=\"selection.crop.top\"\n\t\t\t\trole=\"button\"\n\t\t\t\taria-label={msg('handle.crop.top')}\n\t\t\t/>\n\t\t\t{/* Top right */}\n\t\t\t<polyline\n\t\t\t\tclassName={classNames('tl-corner-crop-handle', {\n\t\t\t\t\t'tl-hidden': hideAlternateHandles,\n\t\t\t\t})}\n\t\t\t\tpoints={`\n\t\t\t\t\t\t${toDomPrecision(width - size)},${toDomPrecision(0 - offset)} \n\t\t\t\t\t\t${toDomPrecision(width + offset)},${toDomPrecision(0 - offset)} \n\t\t\t\t\t\t${toDomPrecision(width + offset)},${toDomPrecision(size)}`}\n\t\t\t\tstrokeWidth={cropStrokeWidth}\n\t\t\t\tdata-testid=\"selection.crop.top_right\"\n\t\t\t\trole=\"button\"\n\t\t\t\taria-label={msg('handle.crop.top-right')}\n\t\t\t/>\n\t\t\t{/* Right */}\n\t\t\t<line\n\t\t\t\tclassName={classNames('tl-corner-crop-edge-handle', {\n\t\t\t\t\t'tl-hidden': hideAlternateHandles,\n\t\t\t\t})}\n\t\t\t\tx1={toDomPrecision(width + offset)}\n\t\t\t\ty1={toDomPrecision(height / 2 - size)}\n\t\t\t\tx2={toDomPrecision(width + offset)}\n\t\t\t\ty2={toDomPrecision(height / 2 + size)}\n\t\t\t\tstrokeWidth={cropStrokeWidth}\n\t\t\t\tdata-testid=\"selection.crop.right\"\n\t\t\t\trole=\"button\"\n\t\t\t\taria-label={msg('handle.crop.right')}\n\t\t\t/>\n\t\t\t{/* Bottom right */}\n\t\t\t<polyline\n\t\t\t\tclassName=\"tl-corner-crop-handle\"\n\t\t\t\tpoints={`\n\t\t\t\t\t\t${toDomPrecision(width + offset)},${toDomPrecision(height - size)} \n\t\t\t\t\t\t${toDomPrecision(width + offset)},${toDomPrecision(height + offset)}\n\t\t\t\t\t\t${toDomPrecision(width - size)},${toDomPrecision(height + offset)}`}\n\t\t\t\tstrokeWidth={cropStrokeWidth}\n\t\t\t\tdata-testid=\"selection.crop.bottom_right\"\n\t\t\t\trole=\"button\"\n\t\t\t\taria-label={msg('handle.crop.bottom-right')}\n\t\t\t/>\n\t\t\t{/* Bottom */}\n\t\t\t<line\n\t\t\t\tclassName={classNames('tl-corner-crop-edge-handle', {\n\t\t\t\t\t'tl-hidden': hideAlternateHandles,\n\t\t\t\t})}\n\t\t\t\tx1={toDomPrecision(width / 2 - size)}\n\t\t\t\ty1={toDomPrecision(height + offset)}\n\t\t\t\tx2={toDomPrecision(width / 2 + size)}\n\t\t\t\ty2={toDomPrecision(height + offset)}\n\t\t\t\tstrokeWidth={cropStrokeWidth}\n\t\t\t\tdata-testid=\"selection.crop.bottom\"\n\t\t\t\trole=\"button\"\n\t\t\t\taria-label={msg('handle.crop.bottom')}\n\t\t\t/>\n\t\t\t{/* Bottom left */}\n\t\t\t<polyline\n\t\t\t\tclassName={classNames('tl-corner-crop-handle', {\n\t\t\t\t\t'tl-hidden': hideAlternateHandles,\n\t\t\t\t})}\n\t\t\t\tpoints={`\n\t\t\t\t\t\t${toDomPrecision(0 + size)},${toDomPrecision(height + offset)} \n\t\t\t\t\t\t${toDomPrecision(0 - offset)},${toDomPrecision(height + offset)}\n\t\t\t\t\t\t${toDomPrecision(0 - offset)},${toDomPrecision(height - size)}`}\n\t\t\t\tstrokeWidth={cropStrokeWidth}\n\t\t\t\tdata-testid=\"selection.crop.bottom_left\"\n\t\t\t\trole=\"button\"\n\t\t\t\taria-label={msg('handle.crop.bottom-left')}\n\t\t\t/>\n\t\t\t{/* Left */}\n\t\t\t<line\n\t\t\t\tclassName={classNames('tl-corner-crop-edge-handle', {\n\t\t\t\t\t'tl-hidden': hideAlternateHandles,\n\t\t\t\t})}\n\t\t\t\tx1={toDomPrecision(0 - offset)}\n\t\t\t\ty1={toDomPrecision(height / 2 - size)}\n\t\t\t\tx2={toDomPrecision(0 - offset)}\n\t\t\t\ty2={toDomPrecision(height / 2 + size)}\n\t\t\t\tstrokeWidth={cropStrokeWidth}\n\t\t\t\tdata-testid=\"selection.crop.left\"\n\t\t\t\trole=\"button\"\n\t\t\t\taria-label={msg('handle.crop.left')}\n\t\t\t/>\n\t\t</svg>\n\t)\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAsBE;AAtBF,oBAA+B;AAC/B,wBAAuB;AACvB,4BAA+B;AASxB,SAAS,kBAAkB;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAA2B;AAC1B,QAAM,sBAAkB,8BAAe,OAAO,CAAC;AAC/C,QAAM,SAAS,kBAAkB;AACjC,QAAM,UAAM,sCAAe;AAE3B,SACC,6CAAC,SAAI,WAAU,qBAAoB,eAAY,QAE9C;AAAA;AAAA,MAAC;AAAA;AAAA,QACA,WAAU;AAAA,QACV,QAAQ;AAAA,YACJ,8BAAe,IAAI,MAAM,CAAC,QAAI,8BAAe,IAAI,CAAC;AAAA,YAClD,8BAAe,IAAI,MAAM,CAAC,QAAI,8BAAe,IAAI,MAAM,CAAC;AAAA,YACxD,8BAAe,IAAI,CAAC,QAAI,8BAAe,IAAI,MAAM,CAAC;AAAA,QACtD,aAAa;AAAA,QACb,eAAY;AAAA,QACZ,MAAK;AAAA,QACL,cAAY,IAAI,sBAAsB;AAAA;AAAA,IACvC;AAAA,IAEA;AAAA,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BAAe,IAAI,MAAM;AAAA,QAC7B,QAAI,8BAAe,SAAS,IAAI,IAAI;AAAA,QACpC,QAAI,8BAAe,IAAI,MAAM;AAAA,QAC7B,QAAI,8BAAe,SAAS,IAAI,IAAI;AAAA,QACpC,aAAa;AAAA,QACb,eAAY;AAAA,QACZ,MAAK;AAAA,QACL,cAAY,IAAI,kBAAkB;AAAA;AAAA,IACnC;AAAA,KACD;AAEF;",
|
|
6
6
|
"names": ["classNames"]
|
|
7
7
|
}
|
|
@@ -40,6 +40,6 @@ function TldrawHandles({ children }) {
|
|
|
40
40
|
[editor]
|
|
41
41
|
);
|
|
42
42
|
if (!shouldDisplayHandles) return null;
|
|
43
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { className: "tl-user-handles tl-overlays__item", children });
|
|
43
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { className: "tl-user-handles tl-overlays__item", "aria-hidden": "true", children });
|
|
44
44
|
}
|
|
45
45
|
//# sourceMappingURL=TldrawHandles.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/lib/canvas/TldrawHandles.tsx"],
|
|
4
|
-
"sourcesContent": ["import { TLHandlesProps, useEditor, useValue } from '@tldraw/editor'\n\n/** @public @react */\nexport function TldrawHandles({ children }: TLHandlesProps) {\n\tconst editor = useEditor()\n\n\t// todo: maybe display note shape handles here?\n\n\tconst shouldDisplayHandles = useValue(\n\t\t'shouldDisplayHandles',\n\t\t() => {\n\t\t\tif (editor.isInAny('select.idle', 'select.pointing_handle', 'select.pointing_shape')) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tif (editor.isInAny('select.editing_shape')) {\n\t\t\t\tconst onlySelectedShape = editor.getOnlySelectedShape()\n\t\t\t\treturn onlySelectedShape && editor.isShapeOfType(onlySelectedShape, 'note')\n\t\t\t}\n\t\t\treturn false\n\t\t},\n\t\t[editor]\n\t)\n\n\tif (!shouldDisplayHandles) return null\n\n\treturn <svg className=\"tl-user-handles tl-overlays__item\"
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
4
|
+
"sourcesContent": ["import { TLHandlesProps, useEditor, useValue } from '@tldraw/editor'\n\n/** @public @react */\nexport function TldrawHandles({ children }: TLHandlesProps) {\n\tconst editor = useEditor()\n\n\t// todo: maybe display note shape handles here?\n\n\tconst shouldDisplayHandles = useValue(\n\t\t'shouldDisplayHandles',\n\t\t() => {\n\t\t\tif (editor.isInAny('select.idle', 'select.pointing_handle', 'select.pointing_shape')) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tif (editor.isInAny('select.editing_shape')) {\n\t\t\t\tconst onlySelectedShape = editor.getOnlySelectedShape()\n\t\t\t\treturn onlySelectedShape && editor.isShapeOfType(onlySelectedShape, 'note')\n\t\t\t}\n\t\t\treturn false\n\t\t},\n\t\t[editor]\n\t)\n\n\tif (!shouldDisplayHandles) return null\n\n\treturn (\n\t\t<svg className=\"tl-user-handles tl-overlays__item\" aria-hidden=\"true\">\n\t\t\t{children}\n\t\t</svg>\n\t)\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA0BE;AA1BF,oBAAoD;AAG7C,SAAS,cAAc,EAAE,SAAS,GAAmB;AAC3D,QAAM,aAAS,yBAAU;AAIzB,QAAM,2BAAuB;AAAA,IAC5B;AAAA,IACA,MAAM;AACL,UAAI,OAAO,QAAQ,eAAe,0BAA0B,uBAAuB,GAAG;AACrF,eAAO;AAAA,MACR;AACA,UAAI,OAAO,QAAQ,sBAAsB,GAAG;AAC3C,cAAM,oBAAoB,OAAO,qBAAqB;AACtD,eAAO,qBAAqB,OAAO,cAAc,mBAAmB,MAAM;AAAA,MAC3E;AACA,aAAO;AAAA,IACR;AAAA,IACA,CAAC,MAAM;AAAA,EACR;AAEA,MAAI,CAAC,qBAAsB,QAAO;AAElC,SACC,4CAAC,SAAI,WAAU,qCAAoC,eAAY,QAC7D,UACF;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -59,7 +59,7 @@ function TldrawArrowHints() {
|
|
|
59
59
|
const showEdgeHints = !isExact && arrowKind === "elbow";
|
|
60
60
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
61
61
|
ShapeIndicator && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ShapeIndicator, { shapeId: targetInfo.target.id }),
|
|
62
|
-
showEdgeHints && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { className: "tl-overlays__item", children: [
|
|
62
|
+
showEdgeHints && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { className: "tl-overlays__item", "aria-hidden": "true", children: [
|
|
63
63
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
64
64
|
"circle",
|
|
65
65
|
{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/lib/canvas/TldrawOverlays.tsx"],
|
|
4
|
-
"sourcesContent": ["import { useEditor, useEditorComponents, useValue } from '@tldraw/editor'\nimport { getArrowTargetState } from '../shapes/arrow/arrowTargetState'\nimport { DraggingHandle } from '../tools/SelectTool/childStates/DraggingHandle'\nimport { PointingHandle } from '../tools/SelectTool/childStates/PointingHandle'\n\n/** @public @react */\nexport function TldrawOverlays() {\n\tconst editor = useEditor()\n\n\tconst shouldShowArrowHints = useValue(\n\t\t'should show arrow hints',\n\t\t() => {\n\t\t\tif (editor.isInAny('arrow.idle', 'arrow.pointing')) return true\n\n\t\t\tif (editor.isIn('select.pointing_handle')) {\n\t\t\t\tconst node: PointingHandle = editor.getStateDescendant('select.pointing_handle')!\n\t\t\t\tif (\n\t\t\t\t\tnode.info.shape.type === 'arrow' &&\n\t\t\t\t\t(node.info.handle.id === 'start' || node.info.handle.id === 'end')\n\t\t\t\t) {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (editor.isIn('select.dragging_handle')) {\n\t\t\t\tconst node: DraggingHandle = editor.getStateDescendant('select.dragging_handle')!\n\t\t\t\tif (\n\t\t\t\t\tnode.info.shape.type === 'arrow' &&\n\t\t\t\t\t(node.info.handle.id === 'start' || node.info.handle.id === 'end')\n\t\t\t\t) {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false\n\t\t},\n\t\t[editor]\n\t)\n\n\tif (!shouldShowArrowHints) return null\n\n\treturn <TldrawArrowHints />\n}\n\n/** @public @react */\nexport function TldrawArrowHints() {\n\tconst editor = useEditor()\n\tconst { ShapeIndicator } = useEditorComponents()\n\n\tconst targetInfo = useValue('arrow target info', () => getArrowTargetState(editor), [editor])\n\n\tif (!targetInfo) return null\n\n\tconst { handlesInPageSpace, snap, anchorInPageSpace, arrowKind, isExact, isPrecise } = targetInfo\n\n\tconst showEdgeHints = !isExact && arrowKind === 'elbow'\n\n\treturn (\n\t\t<>\n\t\t\t{ShapeIndicator && <ShapeIndicator shapeId={targetInfo.target.id} />}\n\n\t\t\t{showEdgeHints && (\n\t\t\t\t<svg className=\"tl-overlays__item\">\n\t\t\t\t\t<circle\n\t\t\t\t\t\tcx={anchorInPageSpace.x}\n\t\t\t\t\t\tcy={anchorInPageSpace.y}\n\t\t\t\t\t\tclassName={`tl-arrow-hint-snap tl-arrow-hint-snap__${isPrecise ? (snap ?? 'none') : 'none'}`}\n\t\t\t\t\t/>\n\n\t\t\t\t\t{Object.entries(handlesInPageSpace).map(([side, handle]) => {\n\t\t\t\t\t\tif (!handle.isEnabled) return null\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<circle\n\t\t\t\t\t\t\t\tkey={side}\n\t\t\t\t\t\t\t\tcx={handle.point.x}\n\t\t\t\t\t\t\t\tcy={handle.point.y}\n\t\t\t\t\t\t\t\t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AAM,gBAAgB,CAAC,WAAW,cAAc;AAEhD,SACC,4EACE;AAAA,sBAAkB,4CAAC,kBAAe,SAAS,WAAW,OAAO,IAAI;AAAA,IAEjE,iBACA,6CAAC,SAAI,WAAU,
|
|
4
|
+
"sourcesContent": ["import { useEditor, useEditorComponents, useValue } from '@tldraw/editor'\nimport { getArrowTargetState } from '../shapes/arrow/arrowTargetState'\nimport { DraggingHandle } from '../tools/SelectTool/childStates/DraggingHandle'\nimport { PointingHandle } from '../tools/SelectTool/childStates/PointingHandle'\n\n/** @public @react */\nexport function TldrawOverlays() {\n\tconst editor = useEditor()\n\n\tconst shouldShowArrowHints = useValue(\n\t\t'should show arrow hints',\n\t\t() => {\n\t\t\tif (editor.isInAny('arrow.idle', 'arrow.pointing')) return true\n\n\t\t\tif (editor.isIn('select.pointing_handle')) {\n\t\t\t\tconst node: PointingHandle = editor.getStateDescendant('select.pointing_handle')!\n\t\t\t\tif (\n\t\t\t\t\tnode.info.shape.type === 'arrow' &&\n\t\t\t\t\t(node.info.handle.id === 'start' || node.info.handle.id === 'end')\n\t\t\t\t) {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (editor.isIn('select.dragging_handle')) {\n\t\t\t\tconst node: DraggingHandle = editor.getStateDescendant('select.dragging_handle')!\n\t\t\t\tif (\n\t\t\t\t\tnode.info.shape.type === 'arrow' &&\n\t\t\t\t\t(node.info.handle.id === 'start' || node.info.handle.id === 'end')\n\t\t\t\t) {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false\n\t\t},\n\t\t[editor]\n\t)\n\n\tif (!shouldShowArrowHints) return null\n\n\treturn <TldrawArrowHints />\n}\n\n/** @public @react */\nexport function TldrawArrowHints() {\n\tconst editor = useEditor()\n\tconst { ShapeIndicator } = useEditorComponents()\n\n\tconst targetInfo = useValue('arrow target info', () => getArrowTargetState(editor), [editor])\n\n\tif (!targetInfo) return null\n\n\tconst { handlesInPageSpace, snap, anchorInPageSpace, arrowKind, isExact, isPrecise } = targetInfo\n\n\tconst showEdgeHints = !isExact && arrowKind === 'elbow'\n\n\treturn (\n\t\t<>\n\t\t\t{ShapeIndicator && <ShapeIndicator shapeId={targetInfo.target.id} />}\n\n\t\t\t{showEdgeHints && (\n\t\t\t\t<svg className=\"tl-overlays__item\" aria-hidden=\"true\">\n\t\t\t\t\t<circle\n\t\t\t\t\t\tcx={anchorInPageSpace.x}\n\t\t\t\t\t\tcy={anchorInPageSpace.y}\n\t\t\t\t\t\tclassName={`tl-arrow-hint-snap tl-arrow-hint-snap__${isPrecise ? (snap ?? 'none') : 'none'}`}\n\t\t\t\t\t/>\n\n\t\t\t\t\t{Object.entries(handlesInPageSpace).map(([side, handle]) => {\n\t\t\t\t\t\tif (!handle.isEnabled) return null\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<circle\n\t\t\t\t\t\t\t\tkey={side}\n\t\t\t\t\t\t\t\tcx={handle.point.x}\n\t\t\t\t\t\t\t\tcy={handle.point.y}\n\t\t\t\t\t\t\t\tclassName=\"tl-arrow-hint-handle\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)\n\t\t\t\t\t})}\n\t\t\t\t</svg>\n\t\t\t)}\n\t\t</>\n\t)\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyCQ;AAzCR,oBAAyD;AACzD,8BAAoC;AAK7B,SAAS,iBAAiB;AAChC,QAAM,aAAS,yBAAU;AAEzB,QAAM,2BAAuB;AAAA,IAC5B;AAAA,IACA,MAAM;AACL,UAAI,OAAO,QAAQ,cAAc,gBAAgB,EAAG,QAAO;AAE3D,UAAI,OAAO,KAAK,wBAAwB,GAAG;AAC1C,cAAM,OAAuB,OAAO,mBAAmB,wBAAwB;AAC/E,YACC,KAAK,KAAK,MAAM,SAAS,YACxB,KAAK,KAAK,OAAO,OAAO,WAAW,KAAK,KAAK,OAAO,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