@haoxin-web/excalidraw 1.0.21 → 1.0.23
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/dev/{chunk-5LGCONU6.js → chunk-ITD5AOM3.js} +3 -3
- package/dist/dev/{chunk-J55ZSMLS.js → chunk-NHZFLEMT.js} +2 -2
- package/dist/dev/data/{image-4T2DPV7H.js → image-EFEZBK6B.js} +3 -3
- package/dist/dev/index.css.map +2 -2
- package/dist/dev/index.js +927 -303
- package/dist/dev/index.js.map +4 -4
- package/dist/dev/subset-shared.chunk.js +1 -1
- package/dist/dev/subset-worker.chunk.js +1 -1
- package/dist/prod/{chunk-UB3N3ODO.js → chunk-GANJJ4PJ.js} +1 -1
- package/dist/prod/{chunk-MGDE5ZMU.js → chunk-TG36IG4W.js} +2 -2
- package/dist/prod/data/image-ERM7RAOD.js +1 -0
- package/dist/prod/index.js +27 -27
- package/dist/prod/subset-shared.chunk.js +1 -1
- package/dist/prod/subset-worker.chunk.js +1 -1
- package/dist/types/excalidraw/components/ExternalLeftToolbar.d.ts +8 -0
- package/dist/types/excalidraw/components/LayerUI.d.ts +2 -1
- package/dist/types/excalidraw/index.d.ts +5 -0
- package/dist/types/excalidraw/types.d.ts +102 -0
- package/docs/left-toolbar-commands.mdx +380 -0
- package/docs/remote-annotation-integration.mdx +170 -0
- package/package.json +3 -2
- package/dist/prod/data/image-SVXFZHEK.js +0 -1
- /package/dist/dev/{chunk-5LGCONU6.js.map → chunk-ITD5AOM3.js.map} +0 -0
- /package/dist/dev/{chunk-J55ZSMLS.js.map → chunk-NHZFLEMT.js.map} +0 -0
- /package/dist/dev/data/{image-4T2DPV7H.js.map → image-EFEZBK6B.js.map} +0 -0
package/dist/dev/index.js
CHANGED
|
@@ -69,10 +69,10 @@ import {
|
|
|
69
69
|
serializeLibraryAsJSON,
|
|
70
70
|
strokeEllipseWithRotation,
|
|
71
71
|
strokeRectWithRotation
|
|
72
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-ITD5AOM3.js";
|
|
73
73
|
import {
|
|
74
74
|
define_import_meta_env_default
|
|
75
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-NHZFLEMT.js";
|
|
76
76
|
import {
|
|
77
77
|
en_default
|
|
78
78
|
} from "./chunk-ZSSURRA2.js";
|
|
@@ -86,7 +86,7 @@ import {
|
|
|
86
86
|
} from "./chunk-XDFCUUT6.js";
|
|
87
87
|
|
|
88
88
|
// index.tsx
|
|
89
|
-
import
|
|
89
|
+
import React49, { useEffect as useEffect49 } from "react";
|
|
90
90
|
import { DEFAULT_UI_OPTIONS, isShallowEqual as isShallowEqual9 } from "@haoxin-web/excalidraw-common";
|
|
91
91
|
|
|
92
92
|
// components/App.tsx
|
|
@@ -889,19 +889,42 @@ var CalloutIcon = createIcon(
|
|
|
889
889
|
tablerIconProps
|
|
890
890
|
);
|
|
891
891
|
var HollowArrowIcon = createIcon(
|
|
892
|
-
/* @__PURE__ */ jsxs("
|
|
893
|
-
/* @__PURE__ */ jsx(
|
|
894
|
-
|
|
892
|
+
/* @__PURE__ */ jsxs("g", { fill: "none", stroke: "currentColor", children: [
|
|
893
|
+
/* @__PURE__ */ jsx(
|
|
894
|
+
"path",
|
|
895
|
+
{
|
|
896
|
+
d: "M6 8 L6 16 L18 16 L18 18 L22 12 L18 6 L18 8 L6 8 Z",
|
|
897
|
+
strokeWidth: "1.5",
|
|
898
|
+
fill: "none"
|
|
899
|
+
}
|
|
900
|
+
),
|
|
901
|
+
/* @__PURE__ */ jsx(
|
|
902
|
+
"path",
|
|
903
|
+
{
|
|
904
|
+
d: "M7 8.5 L7 15.5 L17 15.5 L17 17 L21 12 L17 7 L17 8.5 L7 8.5 Z",
|
|
905
|
+
strokeWidth: "0.5",
|
|
906
|
+
opacity: "0.3",
|
|
907
|
+
fill: "none"
|
|
908
|
+
}
|
|
909
|
+
)
|
|
895
910
|
] }),
|
|
896
|
-
|
|
911
|
+
tablerIconProps
|
|
897
912
|
);
|
|
898
913
|
var HollowDoubleArrowIcon = createIcon(
|
|
899
|
-
/* @__PURE__ */ jsxs("
|
|
900
|
-
/* @__PURE__ */ jsx("path", { d: "
|
|
901
|
-
/* @__PURE__ */ jsx(
|
|
902
|
-
|
|
914
|
+
/* @__PURE__ */ jsxs("g", { fill: "none", stroke: "currentColor", children: [
|
|
915
|
+
/* @__PURE__ */ jsx("path", { d: "M8 8 L8 16 L4 12 L8 8 Z", fill: "none", strokeWidth: "1.5" }),
|
|
916
|
+
/* @__PURE__ */ jsx(
|
|
917
|
+
"path",
|
|
918
|
+
{
|
|
919
|
+
d: "M8 10 L16 10 M8 14 L16 14",
|
|
920
|
+
fill: "none",
|
|
921
|
+
strokeLinecap: "round",
|
|
922
|
+
strokeWidth: "1.5"
|
|
923
|
+
}
|
|
924
|
+
),
|
|
925
|
+
/* @__PURE__ */ jsx("path", { d: "M16 8 L16 16 L20 12 L16 8 Z", strokeWidth: "1.5", fill: "none" })
|
|
903
926
|
] }),
|
|
904
|
-
|
|
927
|
+
tablerIconProps
|
|
905
928
|
);
|
|
906
929
|
var ArrowIcon = createIcon(
|
|
907
930
|
/* @__PURE__ */ jsxs("g", { strokeWidth: "1.5", children: [
|
|
@@ -2415,18 +2438,38 @@ var ArrowRightIcon = createIcon(
|
|
|
2415
2438
|
modifiedTablerIconProps
|
|
2416
2439
|
);
|
|
2417
2440
|
var OutlineArrowIcon = createIcon(
|
|
2418
|
-
/* @__PURE__ */ jsxs(
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2441
|
+
/* @__PURE__ */ jsxs(
|
|
2442
|
+
"g",
|
|
2443
|
+
{
|
|
2444
|
+
strokeWidth: 1.5,
|
|
2445
|
+
fill: "none",
|
|
2446
|
+
stroke: "currentColor",
|
|
2447
|
+
strokeLinecap: "round",
|
|
2448
|
+
strokeLinejoin: "round",
|
|
2449
|
+
children: [
|
|
2450
|
+
/* @__PURE__ */ jsx("path", { d: "M5 12h10" }),
|
|
2451
|
+
/* @__PURE__ */ jsx("path", { d: "M11 8l4 4l-4 4" })
|
|
2452
|
+
]
|
|
2453
|
+
}
|
|
2454
|
+
),
|
|
2422
2455
|
tablerIconProps
|
|
2423
2456
|
);
|
|
2424
2457
|
var OutlineDoubleArrowIcon = createIcon(
|
|
2425
|
-
/* @__PURE__ */ jsxs(
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2458
|
+
/* @__PURE__ */ jsxs(
|
|
2459
|
+
"g",
|
|
2460
|
+
{
|
|
2461
|
+
strokeWidth: 1.5,
|
|
2462
|
+
fill: "none",
|
|
2463
|
+
stroke: "currentColor",
|
|
2464
|
+
strokeLinecap: "round",
|
|
2465
|
+
strokeLinejoin: "round",
|
|
2466
|
+
children: [
|
|
2467
|
+
/* @__PURE__ */ jsx("path", { d: "M5 12h14" }),
|
|
2468
|
+
/* @__PURE__ */ jsx("path", { d: "M9 8l-4 4l4 4" }),
|
|
2469
|
+
/* @__PURE__ */ jsx("path", { d: "M15 8l4 4l-4 4" })
|
|
2470
|
+
]
|
|
2471
|
+
}
|
|
2472
|
+
),
|
|
2430
2473
|
tablerIconProps
|
|
2431
2474
|
);
|
|
2432
2475
|
var laserPointerToolIcon = createIcon(
|
|
@@ -9180,7 +9223,7 @@ var exportCanvas = async (type, elements, appState, files, {
|
|
|
9180
9223
|
let blob = canvasToBlob(tempCanvas);
|
|
9181
9224
|
if (appState.exportEmbedScene) {
|
|
9182
9225
|
blob = blob.then(
|
|
9183
|
-
(blob2) => import("./data/image-
|
|
9226
|
+
(blob2) => import("./data/image-EFEZBK6B.js").then(
|
|
9184
9227
|
({ encodePngMetadata: encodePngMetadata2 }) => encodePngMetadata2({
|
|
9185
9228
|
blob: blob2,
|
|
9186
9229
|
metadata: serializeAsJSON(elements, appState, files, "local")
|
|
@@ -25763,8 +25806,16 @@ var MainMenu_default = MainMenu;
|
|
|
25763
25806
|
import { useEffect as useEffect33, useRef as useRef28, useState as useState27 } from "react";
|
|
25764
25807
|
import clsx46 from "clsx";
|
|
25765
25808
|
import { isTextElement as isTextElement14 } from "@haoxin-web/excalidraw-element";
|
|
25766
|
-
import {
|
|
25767
|
-
|
|
25809
|
+
import {
|
|
25810
|
+
getBoundTextElement as getBoundTextElement9,
|
|
25811
|
+
getContainerElement as getContainerElement5,
|
|
25812
|
+
redrawTextBoundingBox as redrawTextBoundingBox7,
|
|
25813
|
+
newElementWith as newElementWith11
|
|
25814
|
+
} from "@haoxin-web/excalidraw-element";
|
|
25815
|
+
import {
|
|
25816
|
+
DEFAULT_ELEMENT_STROKE_COLOR_PALETTE as DEFAULT_ELEMENT_STROKE_COLOR_PALETTE2,
|
|
25817
|
+
STROKE_WIDTH as STROKE_WIDTH2
|
|
25818
|
+
} from "@haoxin-web/excalidraw-common";
|
|
25768
25819
|
import { jsx as jsx108, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
25769
25820
|
var LeftToolFlyouts = ({
|
|
25770
25821
|
appState,
|
|
@@ -25898,7 +25949,25 @@ var LeftToolFlyouts = ({
|
|
|
25898
25949
|
const selected = elements.find((el) => selectedIds[el.id]);
|
|
25899
25950
|
const selectedType = selected?.type;
|
|
25900
25951
|
const openForLineGroup = openGroup === "line" && (activeTool === "line" || activeTool === "arrow" || selectedType === "line" || selectedType === "arrow");
|
|
25901
|
-
const openForShapesGroup = openGroup === "shapes" && [
|
|
25952
|
+
const openForShapesGroup = openGroup === "shapes" && [
|
|
25953
|
+
"rectangle",
|
|
25954
|
+
"diamond",
|
|
25955
|
+
"ellipse",
|
|
25956
|
+
"triangle",
|
|
25957
|
+
"pentagon",
|
|
25958
|
+
"callout",
|
|
25959
|
+
"hollow_arrow",
|
|
25960
|
+
"hollow_double_arrow"
|
|
25961
|
+
].includes(activeTool) || openGroup === "shapes" && [
|
|
25962
|
+
"rectangle",
|
|
25963
|
+
"diamond",
|
|
25964
|
+
"ellipse",
|
|
25965
|
+
"triangle",
|
|
25966
|
+
"pentagon",
|
|
25967
|
+
"callout",
|
|
25968
|
+
"hollow_arrow",
|
|
25969
|
+
"hollow_double_arrow"
|
|
25970
|
+
].includes(selectedType);
|
|
25902
25971
|
const openForText = openGroup === "text" && (activeTool === "text" || selectedType === "text");
|
|
25903
25972
|
const openForFreedraw = openGroup === "freedraw" && (activeTool === "freedraw" || selectedType === "freedraw");
|
|
25904
25973
|
const isHighlighter = (appState.currentItemOpacity ?? 100) < 100;
|
|
@@ -25939,14 +26008,20 @@ var LeftToolFlyouts = ({
|
|
|
25939
26008
|
}
|
|
25940
26009
|
});
|
|
25941
26010
|
nextMap.set(updated.id, updated);
|
|
25942
|
-
const container = getContainerElement5(
|
|
26011
|
+
const container = getContainerElement5(
|
|
26012
|
+
updated,
|
|
26013
|
+
app.scene.getNonDeletedElementsMap()
|
|
26014
|
+
);
|
|
25943
26015
|
redrawTextBoundingBox7(updated, container, app.scene);
|
|
25944
26016
|
};
|
|
25945
26017
|
for (const el of selected2) {
|
|
25946
26018
|
if (isTextElement14(el)) {
|
|
25947
26019
|
applyTo(el);
|
|
25948
26020
|
} else {
|
|
25949
|
-
const bound = getBoundTextElement9(
|
|
26021
|
+
const bound = getBoundTextElement9(
|
|
26022
|
+
el,
|
|
26023
|
+
app.scene.getNonDeletedElementsMap()
|
|
26024
|
+
);
|
|
25950
26025
|
if (bound) {
|
|
25951
26026
|
applyTo(bound);
|
|
25952
26027
|
}
|
|
@@ -25973,19 +26048,31 @@ var LeftToolFlyouts = ({
|
|
|
25973
26048
|
app.setActiveTool({ type: "line", locked: true });
|
|
25974
26049
|
} else if (type === "arrow") {
|
|
25975
26050
|
app.setActiveTool({ type: "arrow", locked: true });
|
|
25976
|
-
app.setState({
|
|
26051
|
+
app.setState({
|
|
26052
|
+
currentItemStartArrowhead: null,
|
|
26053
|
+
currentItemEndArrowhead: "arrow"
|
|
26054
|
+
});
|
|
25977
26055
|
} else {
|
|
25978
26056
|
app.setActiveTool({ type: "arrow", locked: true });
|
|
25979
|
-
app.setState({
|
|
26057
|
+
app.setState({
|
|
26058
|
+
currentItemStartArrowhead: "arrow",
|
|
26059
|
+
currentItemEndArrowhead: "arrow"
|
|
26060
|
+
});
|
|
25980
26061
|
}
|
|
25981
26062
|
};
|
|
25982
26063
|
const setArrowTypeOutline = (type) => {
|
|
25983
26064
|
if (type === "arrow") {
|
|
25984
26065
|
app.setActiveTool({ type: "arrow", locked: true });
|
|
25985
|
-
app.setState({
|
|
26066
|
+
app.setState({
|
|
26067
|
+
currentItemStartArrowhead: null,
|
|
26068
|
+
currentItemEndArrowhead: "triangle_outline"
|
|
26069
|
+
});
|
|
25986
26070
|
} else {
|
|
25987
26071
|
app.setActiveTool({ type: "arrow", locked: true });
|
|
25988
|
-
app.setState({
|
|
26072
|
+
app.setState({
|
|
26073
|
+
currentItemStartArrowhead: "triangle_outline",
|
|
26074
|
+
currentItemEndArrowhead: "triangle_outline"
|
|
26075
|
+
});
|
|
25989
26076
|
}
|
|
25990
26077
|
};
|
|
25991
26078
|
const renderStrokeColor = () => {
|
|
@@ -26008,7 +26095,11 @@ var LeftToolFlyouts = ({
|
|
|
26008
26095
|
elements,
|
|
26009
26096
|
appState,
|
|
26010
26097
|
palette: DEFAULT_ELEMENT_STROKE_COLOR_PALETTE2,
|
|
26011
|
-
updateData: (formData) => actionManager.executeAction(
|
|
26098
|
+
updateData: (formData) => actionManager.executeAction(
|
|
26099
|
+
actionChangeStrokeColor,
|
|
26100
|
+
"ui",
|
|
26101
|
+
formData
|
|
26102
|
+
)
|
|
26012
26103
|
}
|
|
26013
26104
|
);
|
|
26014
26105
|
};
|
|
@@ -26019,7 +26110,7 @@ var LeftToolFlyouts = ({
|
|
|
26019
26110
|
app.setState({ currentItemOpacity: enable ? 50 : 100 });
|
|
26020
26111
|
};
|
|
26021
26112
|
return /* @__PURE__ */ jsxs60("div", { className: "LeftToolFlyouts", children: [
|
|
26022
|
-
openForLineGroup && /* @__PURE__ */ jsx108(Island, { className: "left-flyout left-flyout--line", children: /* @__PURE__ */ jsxs60(Stack_default.Col, { gap: 2, align: "
|
|
26113
|
+
openForLineGroup && /* @__PURE__ */ jsx108(Island, { className: "left-flyout left-flyout--line", children: /* @__PURE__ */ jsxs60(Stack_default.Col, { gap: 2, align: "start", children: [
|
|
26023
26114
|
/* @__PURE__ */ jsxs60("div", { className: "arrow-row", children: [
|
|
26024
26115
|
/* @__PURE__ */ jsx108(
|
|
26025
26116
|
ToolButton,
|
|
@@ -26060,44 +26151,63 @@ var LeftToolFlyouts = ({
|
|
|
26060
26151
|
] }),
|
|
26061
26152
|
/* @__PURE__ */ jsx108("div", { className: "left-flyout__separator" }),
|
|
26062
26153
|
/* @__PURE__ */ jsx108("div", { className: "left-flyout__title", children: t("labels.strokeWidth") }),
|
|
26063
|
-
/* @__PURE__ */ jsxs60(
|
|
26064
|
-
|
|
26065
|
-
|
|
26066
|
-
|
|
26067
|
-
|
|
26068
|
-
|
|
26069
|
-
|
|
26070
|
-
|
|
26071
|
-
|
|
26072
|
-
|
|
26073
|
-
|
|
26074
|
-
|
|
26075
|
-
|
|
26076
|
-
|
|
26077
|
-
|
|
26078
|
-
|
|
26079
|
-
|
|
26080
|
-
|
|
26081
|
-
|
|
26082
|
-
|
|
26083
|
-
|
|
26084
|
-
|
|
26085
|
-
|
|
26086
|
-
|
|
26087
|
-
|
|
26088
|
-
|
|
26089
|
-
|
|
26090
|
-
|
|
26091
|
-
|
|
26092
|
-
|
|
26093
|
-
|
|
26094
|
-
|
|
26095
|
-
|
|
26096
|
-
|
|
26097
|
-
|
|
26098
|
-
|
|
26099
|
-
|
|
26100
|
-
|
|
26154
|
+
/* @__PURE__ */ jsxs60(
|
|
26155
|
+
"div",
|
|
26156
|
+
{
|
|
26157
|
+
className: "buttonList",
|
|
26158
|
+
style: { display: "flex", gap: 6, justifyContent: "flex-start" },
|
|
26159
|
+
children: [
|
|
26160
|
+
/* @__PURE__ */ jsx108(
|
|
26161
|
+
ToolButton,
|
|
26162
|
+
{
|
|
26163
|
+
type: "icon",
|
|
26164
|
+
"aria-label": t("labels.thin"),
|
|
26165
|
+
icon: StrokeWidthBaseIcon,
|
|
26166
|
+
selected: selectedStrokeWidth === STROKE_WIDTH2.thin,
|
|
26167
|
+
name: "left-flyout-line-strokeWidth",
|
|
26168
|
+
title: t("labels.thin"),
|
|
26169
|
+
onClick: () => actionManager.executeAction(
|
|
26170
|
+
actionChangeStrokeWidth,
|
|
26171
|
+
"ui",
|
|
26172
|
+
STROKE_WIDTH2.thin
|
|
26173
|
+
)
|
|
26174
|
+
}
|
|
26175
|
+
),
|
|
26176
|
+
/* @__PURE__ */ jsx108(
|
|
26177
|
+
ToolButton,
|
|
26178
|
+
{
|
|
26179
|
+
type: "icon",
|
|
26180
|
+
"aria-label": t("labels.bold"),
|
|
26181
|
+
icon: StrokeWidthBoldIcon,
|
|
26182
|
+
selected: selectedStrokeWidth === STROKE_WIDTH2.bold,
|
|
26183
|
+
name: "left-flyout-line-strokeWidth",
|
|
26184
|
+
title: t("labels.bold"),
|
|
26185
|
+
onClick: () => actionManager.executeAction(
|
|
26186
|
+
actionChangeStrokeWidth,
|
|
26187
|
+
"ui",
|
|
26188
|
+
STROKE_WIDTH2.bold
|
|
26189
|
+
)
|
|
26190
|
+
}
|
|
26191
|
+
),
|
|
26192
|
+
/* @__PURE__ */ jsx108(
|
|
26193
|
+
ToolButton,
|
|
26194
|
+
{
|
|
26195
|
+
type: "icon",
|
|
26196
|
+
"aria-label": t("labels.extraBold"),
|
|
26197
|
+
icon: StrokeWidthExtraBoldIcon,
|
|
26198
|
+
selected: selectedStrokeWidth === STROKE_WIDTH2.extraBold,
|
|
26199
|
+
name: "left-flyout-line-strokeWidth",
|
|
26200
|
+
title: t("labels.extraBold"),
|
|
26201
|
+
onClick: () => actionManager.executeAction(
|
|
26202
|
+
actionChangeStrokeWidth,
|
|
26203
|
+
"ui",
|
|
26204
|
+
STROKE_WIDTH2.extraBold
|
|
26205
|
+
)
|
|
26206
|
+
}
|
|
26207
|
+
)
|
|
26208
|
+
]
|
|
26209
|
+
}
|
|
26210
|
+
),
|
|
26101
26211
|
/* @__PURE__ */ jsx108("div", { className: "left-flyout__title", children: "\u989C\u8272" }),
|
|
26102
26212
|
renderStrokeColor()
|
|
26103
26213
|
] }) }),
|
|
@@ -26131,68 +26241,111 @@ var LeftToolFlyouts = ({
|
|
|
26131
26241
|
};
|
|
26132
26242
|
return null;
|
|
26133
26243
|
})(),
|
|
26134
|
-
/* @__PURE__ */ jsxs60(
|
|
26135
|
-
|
|
26136
|
-
|
|
26137
|
-
|
|
26138
|
-
|
|
26139
|
-
|
|
26140
|
-
|
|
26141
|
-
|
|
26142
|
-
|
|
26143
|
-
|
|
26144
|
-
|
|
26145
|
-
|
|
26146
|
-
|
|
26147
|
-
|
|
26148
|
-
|
|
26149
|
-
|
|
26150
|
-
|
|
26151
|
-
|
|
26152
|
-
|
|
26153
|
-
|
|
26154
|
-
|
|
26155
|
-
|
|
26156
|
-
|
|
26157
|
-
|
|
26158
|
-
|
|
26159
|
-
|
|
26160
|
-
|
|
26161
|
-
|
|
26162
|
-
|
|
26163
|
-
|
|
26164
|
-
|
|
26165
|
-
|
|
26166
|
-
|
|
26167
|
-
|
|
26168
|
-
|
|
26169
|
-
|
|
26170
|
-
|
|
26171
|
-
|
|
26172
|
-
|
|
26173
|
-
|
|
26174
|
-
|
|
26175
|
-
|
|
26176
|
-
|
|
26177
|
-
|
|
26178
|
-
|
|
26179
|
-
|
|
26180
|
-
|
|
26181
|
-
|
|
26182
|
-
|
|
26183
|
-
|
|
26184
|
-
|
|
26185
|
-
|
|
26186
|
-
|
|
26187
|
-
|
|
26188
|
-
|
|
26189
|
-
|
|
26190
|
-
|
|
26191
|
-
|
|
26192
|
-
|
|
26193
|
-
|
|
26194
|
-
|
|
26195
|
-
|
|
26244
|
+
/* @__PURE__ */ jsxs60(
|
|
26245
|
+
"div",
|
|
26246
|
+
{
|
|
26247
|
+
className: "shapes-grid",
|
|
26248
|
+
style: { gridTemplateColumns: "repeat(5, 1fr)" },
|
|
26249
|
+
children: [
|
|
26250
|
+
/* @__PURE__ */ jsx108(
|
|
26251
|
+
ToolButton,
|
|
26252
|
+
{
|
|
26253
|
+
type: "radio",
|
|
26254
|
+
"aria-label": t("toolBar.rectangle"),
|
|
26255
|
+
icon: RectangleIcon,
|
|
26256
|
+
checked: activeTool === "rectangle",
|
|
26257
|
+
name: "left-flyout-shapes",
|
|
26258
|
+
title: t("toolBar.rectangle"),
|
|
26259
|
+
onChange: () => app.setActiveTool({ type: "rectangle", locked: true })
|
|
26260
|
+
}
|
|
26261
|
+
),
|
|
26262
|
+
/* @__PURE__ */ jsx108(
|
|
26263
|
+
ToolButton,
|
|
26264
|
+
{
|
|
26265
|
+
type: "radio",
|
|
26266
|
+
"aria-label": t("toolBar.ellipse"),
|
|
26267
|
+
icon: EllipseIcon,
|
|
26268
|
+
checked: activeTool === "ellipse",
|
|
26269
|
+
name: "left-flyout-shapes",
|
|
26270
|
+
title: t("toolBar.ellipse"),
|
|
26271
|
+
onChange: () => app.setActiveTool({ type: "ellipse", locked: true })
|
|
26272
|
+
}
|
|
26273
|
+
),
|
|
26274
|
+
/* @__PURE__ */ jsx108(
|
|
26275
|
+
ToolButton,
|
|
26276
|
+
{
|
|
26277
|
+
type: "radio",
|
|
26278
|
+
"aria-label": t("toolBar.diamond"),
|
|
26279
|
+
icon: DiamondIcon,
|
|
26280
|
+
checked: activeTool === "diamond",
|
|
26281
|
+
name: "left-flyout-shapes",
|
|
26282
|
+
title: t("toolBar.diamond"),
|
|
26283
|
+
onChange: () => app.setActiveTool({ type: "diamond", locked: true })
|
|
26284
|
+
}
|
|
26285
|
+
),
|
|
26286
|
+
/* @__PURE__ */ jsx108(
|
|
26287
|
+
ToolButton,
|
|
26288
|
+
{
|
|
26289
|
+
type: "radio",
|
|
26290
|
+
"aria-label": t("toolBar.triangle"),
|
|
26291
|
+
icon: TriangleIcon,
|
|
26292
|
+
checked: activeTool === "triangle",
|
|
26293
|
+
name: "left-flyout-shapes",
|
|
26294
|
+
title: t("toolBar.triangle"),
|
|
26295
|
+
onChange: () => app.setActiveTool({ type: "triangle", locked: true })
|
|
26296
|
+
}
|
|
26297
|
+
),
|
|
26298
|
+
/* @__PURE__ */ jsx108(
|
|
26299
|
+
ToolButton,
|
|
26300
|
+
{
|
|
26301
|
+
type: "radio",
|
|
26302
|
+
"aria-label": t("toolBar.pentagon"),
|
|
26303
|
+
icon: PentagonIcon,
|
|
26304
|
+
checked: activeTool === "pentagon",
|
|
26305
|
+
name: "left-flyout-shapes",
|
|
26306
|
+
title: t("toolBar.pentagon"),
|
|
26307
|
+
onChange: () => app.setActiveTool({ type: "pentagon", locked: true })
|
|
26308
|
+
}
|
|
26309
|
+
),
|
|
26310
|
+
/* @__PURE__ */ jsx108(
|
|
26311
|
+
ToolButton,
|
|
26312
|
+
{
|
|
26313
|
+
type: "radio",
|
|
26314
|
+
"aria-label": t("toolBar.callout"),
|
|
26315
|
+
icon: CalloutIcon,
|
|
26316
|
+
checked: activeTool === "callout",
|
|
26317
|
+
name: "left-flyout-shapes",
|
|
26318
|
+
title: t("toolBar.callout"),
|
|
26319
|
+
onChange: () => app.setActiveTool({ type: "callout" })
|
|
26320
|
+
}
|
|
26321
|
+
),
|
|
26322
|
+
/* @__PURE__ */ jsx108(
|
|
26323
|
+
ToolButton,
|
|
26324
|
+
{
|
|
26325
|
+
type: "radio",
|
|
26326
|
+
"aria-label": t("toolBar.hollowArrow"),
|
|
26327
|
+
icon: HollowArrowIcon,
|
|
26328
|
+
checked: activeTool === "hollow_arrow",
|
|
26329
|
+
name: "left-flyout-shapes",
|
|
26330
|
+
title: t("toolBar.hollowArrow"),
|
|
26331
|
+
onChange: () => app.setActiveTool({ type: "hollow_arrow" })
|
|
26332
|
+
}
|
|
26333
|
+
),
|
|
26334
|
+
/* @__PURE__ */ jsx108(
|
|
26335
|
+
ToolButton,
|
|
26336
|
+
{
|
|
26337
|
+
type: "radio",
|
|
26338
|
+
"aria-label": t("toolBar.hollowDoubleArrow"),
|
|
26339
|
+
icon: HollowDoubleArrowIcon,
|
|
26340
|
+
checked: activeTool === "hollow_double_arrow",
|
|
26341
|
+
name: "left-flyout-shapes",
|
|
26342
|
+
title: t("toolBar.hollowDoubleArrow"),
|
|
26343
|
+
onChange: () => app.setActiveTool({ type: "hollow_double_arrow" })
|
|
26344
|
+
}
|
|
26345
|
+
)
|
|
26346
|
+
]
|
|
26347
|
+
}
|
|
26348
|
+
),
|
|
26196
26349
|
/* @__PURE__ */ jsx108("div", { className: "left-flyout__separator" }),
|
|
26197
26350
|
/* @__PURE__ */ jsx108("div", { className: "left-flyout__title", style: { marginTop: 8 }, children: t("labels.stroke") }),
|
|
26198
26351
|
renderStrokeColor(),
|
|
@@ -26209,12 +26362,20 @@ var LeftToolFlyouts = ({
|
|
|
26209
26362
|
true,
|
|
26210
26363
|
(hasSelection) => !hasSelection ? appState.currentItemBackgroundColor : null
|
|
26211
26364
|
),
|
|
26212
|
-
onChange: (color) => actionManager.executeAction(
|
|
26213
|
-
|
|
26214
|
-
|
|
26365
|
+
onChange: (color) => actionManager.executeAction(
|
|
26366
|
+
actionChangeBackgroundColor,
|
|
26367
|
+
"ui",
|
|
26368
|
+
{
|
|
26369
|
+
currentItemBackgroundColor: color
|
|
26370
|
+
}
|
|
26371
|
+
),
|
|
26215
26372
|
elements,
|
|
26216
26373
|
appState,
|
|
26217
|
-
updateData: (formData) => actionManager.executeAction(
|
|
26374
|
+
updateData: (formData) => actionManager.executeAction(
|
|
26375
|
+
actionChangeBackgroundColor,
|
|
26376
|
+
"ui",
|
|
26377
|
+
formData
|
|
26378
|
+
)
|
|
26218
26379
|
}
|
|
26219
26380
|
),
|
|
26220
26381
|
/* @__PURE__ */ jsx108("div", { className: "left-flyout__title", style: { marginTop: 6 }, children: t("labels.fill") }),
|
|
@@ -26232,85 +26393,123 @@ var LeftToolFlyouts = ({
|
|
|
26232
26393
|
};
|
|
26233
26394
|
return null;
|
|
26234
26395
|
})(),
|
|
26235
|
-
/* @__PURE__ */ jsxs60(
|
|
26236
|
-
|
|
26237
|
-
|
|
26238
|
-
|
|
26239
|
-
|
|
26240
|
-
|
|
26241
|
-
|
|
26242
|
-
|
|
26243
|
-
|
|
26244
|
-
|
|
26245
|
-
|
|
26246
|
-
|
|
26247
|
-
|
|
26248
|
-
|
|
26249
|
-
|
|
26250
|
-
|
|
26251
|
-
|
|
26252
|
-
|
|
26253
|
-
|
|
26254
|
-
|
|
26255
|
-
|
|
26256
|
-
|
|
26257
|
-
|
|
26258
|
-
|
|
26259
|
-
|
|
26260
|
-
|
|
26261
|
-
|
|
26262
|
-
|
|
26263
|
-
|
|
26264
|
-
|
|
26265
|
-
|
|
26266
|
-
|
|
26267
|
-
|
|
26268
|
-
|
|
26269
|
-
|
|
26270
|
-
|
|
26271
|
-
|
|
26272
|
-
|
|
26396
|
+
/* @__PURE__ */ jsxs60(
|
|
26397
|
+
"div",
|
|
26398
|
+
{
|
|
26399
|
+
className: "buttonList",
|
|
26400
|
+
style: { display: "flex", gap: 6, justifyContent: "flex-start" },
|
|
26401
|
+
children: [
|
|
26402
|
+
/* @__PURE__ */ jsx108(
|
|
26403
|
+
ToolButton,
|
|
26404
|
+
{
|
|
26405
|
+
type: "icon",
|
|
26406
|
+
"aria-label": t("labels.hachure"),
|
|
26407
|
+
icon: FillHachureIcon,
|
|
26408
|
+
selected: globalThis.__leftShapesFormCache?.fillStyleValue === "hachure",
|
|
26409
|
+
name: "left-flyout-fillStyle",
|
|
26410
|
+
title: t("labels.hachure"),
|
|
26411
|
+
onClick: () => actionManager.executeAction(
|
|
26412
|
+
actionChangeFillStyle,
|
|
26413
|
+
"ui",
|
|
26414
|
+
"hachure"
|
|
26415
|
+
)
|
|
26416
|
+
}
|
|
26417
|
+
),
|
|
26418
|
+
/* @__PURE__ */ jsx108(
|
|
26419
|
+
ToolButton,
|
|
26420
|
+
{
|
|
26421
|
+
type: "icon",
|
|
26422
|
+
"aria-label": t("labels.crossHatch"),
|
|
26423
|
+
icon: FillCrossHatchIcon,
|
|
26424
|
+
selected: globalThis.__leftShapesFormCache?.fillStyleValue === "cross-hatch",
|
|
26425
|
+
name: "left-flyout-fillStyle",
|
|
26426
|
+
title: t("labels.crossHatch"),
|
|
26427
|
+
onClick: () => actionManager.executeAction(
|
|
26428
|
+
actionChangeFillStyle,
|
|
26429
|
+
"ui",
|
|
26430
|
+
"cross-hatch"
|
|
26431
|
+
)
|
|
26432
|
+
}
|
|
26433
|
+
),
|
|
26434
|
+
/* @__PURE__ */ jsx108(
|
|
26435
|
+
ToolButton,
|
|
26436
|
+
{
|
|
26437
|
+
type: "icon",
|
|
26438
|
+
"aria-label": t("labels.solid"),
|
|
26439
|
+
icon: FillSolidIcon,
|
|
26440
|
+
selected: globalThis.__leftShapesFormCache?.fillStyleValue === "solid",
|
|
26441
|
+
name: "left-flyout-fillStyle",
|
|
26442
|
+
title: t("labels.solid"),
|
|
26443
|
+
onClick: () => actionManager.executeAction(
|
|
26444
|
+
actionChangeFillStyle,
|
|
26445
|
+
"ui",
|
|
26446
|
+
"solid"
|
|
26447
|
+
)
|
|
26448
|
+
}
|
|
26449
|
+
)
|
|
26450
|
+
]
|
|
26451
|
+
}
|
|
26452
|
+
),
|
|
26273
26453
|
/* @__PURE__ */ jsx108("div", { className: "left-flyout__title", children: t("labels.strokeWidth") }),
|
|
26274
|
-
/* @__PURE__ */ jsxs60(
|
|
26275
|
-
|
|
26276
|
-
|
|
26277
|
-
|
|
26278
|
-
|
|
26279
|
-
|
|
26280
|
-
|
|
26281
|
-
|
|
26282
|
-
|
|
26283
|
-
|
|
26284
|
-
|
|
26285
|
-
|
|
26286
|
-
|
|
26287
|
-
|
|
26288
|
-
|
|
26289
|
-
|
|
26290
|
-
|
|
26291
|
-
|
|
26292
|
-
|
|
26293
|
-
|
|
26294
|
-
|
|
26295
|
-
|
|
26296
|
-
|
|
26297
|
-
|
|
26298
|
-
|
|
26299
|
-
|
|
26300
|
-
|
|
26301
|
-
|
|
26302
|
-
|
|
26303
|
-
|
|
26304
|
-
|
|
26305
|
-
|
|
26306
|
-
|
|
26307
|
-
|
|
26308
|
-
|
|
26309
|
-
|
|
26310
|
-
|
|
26311
|
-
|
|
26454
|
+
/* @__PURE__ */ jsxs60(
|
|
26455
|
+
"div",
|
|
26456
|
+
{
|
|
26457
|
+
className: "buttonList",
|
|
26458
|
+
style: { display: "flex", gap: 6, justifyContent: "flex-start" },
|
|
26459
|
+
children: [
|
|
26460
|
+
/* @__PURE__ */ jsx108(
|
|
26461
|
+
ToolButton,
|
|
26462
|
+
{
|
|
26463
|
+
type: "icon",
|
|
26464
|
+
"aria-label": t("labels.thin"),
|
|
26465
|
+
icon: StrokeWidthBaseIcon,
|
|
26466
|
+
selected: selectedStrokeWidth === STROKE_WIDTH2.thin,
|
|
26467
|
+
name: "left-flyout-strokeWidth",
|
|
26468
|
+
title: t("labels.thin"),
|
|
26469
|
+
onClick: () => actionManager.executeAction(
|
|
26470
|
+
actionChangeStrokeWidth,
|
|
26471
|
+
"ui",
|
|
26472
|
+
STROKE_WIDTH2.thin
|
|
26473
|
+
)
|
|
26474
|
+
}
|
|
26475
|
+
),
|
|
26476
|
+
/* @__PURE__ */ jsx108(
|
|
26477
|
+
ToolButton,
|
|
26478
|
+
{
|
|
26479
|
+
type: "icon",
|
|
26480
|
+
"aria-label": t("labels.bold"),
|
|
26481
|
+
icon: StrokeWidthBoldIcon,
|
|
26482
|
+
selected: selectedStrokeWidth === STROKE_WIDTH2.bold,
|
|
26483
|
+
name: "left-flyout-strokeWidth",
|
|
26484
|
+
title: t("labels.bold"),
|
|
26485
|
+
onClick: () => actionManager.executeAction(
|
|
26486
|
+
actionChangeStrokeWidth,
|
|
26487
|
+
"ui",
|
|
26488
|
+
STROKE_WIDTH2.bold
|
|
26489
|
+
)
|
|
26490
|
+
}
|
|
26491
|
+
),
|
|
26492
|
+
/* @__PURE__ */ jsx108(
|
|
26493
|
+
ToolButton,
|
|
26494
|
+
{
|
|
26495
|
+
type: "icon",
|
|
26496
|
+
"aria-label": t("labels.extraBold"),
|
|
26497
|
+
icon: StrokeWidthExtraBoldIcon,
|
|
26498
|
+
selected: selectedStrokeWidth === STROKE_WIDTH2.extraBold,
|
|
26499
|
+
name: "left-flyout-strokeWidth",
|
|
26500
|
+
title: t("labels.extraBold"),
|
|
26501
|
+
onClick: () => actionManager.executeAction(
|
|
26502
|
+
actionChangeStrokeWidth,
|
|
26503
|
+
"ui",
|
|
26504
|
+
STROKE_WIDTH2.extraBold
|
|
26505
|
+
)
|
|
26506
|
+
}
|
|
26507
|
+
)
|
|
26508
|
+
]
|
|
26509
|
+
}
|
|
26510
|
+
)
|
|
26312
26511
|
] }),
|
|
26313
|
-
openForText && /* @__PURE__ */ jsx108(Island, { className: "left-flyout left-flyout--text", children: /* @__PURE__ */ jsxs60(Stack_default.Col, { gap: 2, align: "
|
|
26512
|
+
openForText && /* @__PURE__ */ jsx108(Island, { className: "left-flyout left-flyout--text", children: /* @__PURE__ */ jsxs60(Stack_default.Col, { gap: 2, align: "start", children: [
|
|
26314
26513
|
/* @__PURE__ */ jsx108("div", { className: "left-flyout__title", children: "\u6837\u5F0F" }),
|
|
26315
26514
|
/* @__PURE__ */ jsxs60("div", { className: "text-style-row", style: { display: "flex", gap: 8 }, children: [
|
|
26316
26515
|
/* @__PURE__ */ jsx108(
|
|
@@ -26325,7 +26524,9 @@ var LeftToolFlyouts = ({
|
|
|
26325
26524
|
const value = !appState.currentTextBold;
|
|
26326
26525
|
app.setState({ currentTextBold: value });
|
|
26327
26526
|
syncWysiwygStyle();
|
|
26328
|
-
updateSelectedTextStyle({
|
|
26527
|
+
updateSelectedTextStyle({
|
|
26528
|
+
bold: !appState.currentTextBold
|
|
26529
|
+
});
|
|
26329
26530
|
updateCurrentTextDefaults({ bold: value });
|
|
26330
26531
|
}
|
|
26331
26532
|
}
|
|
@@ -26342,7 +26543,9 @@ var LeftToolFlyouts = ({
|
|
|
26342
26543
|
const value = !appState.currentTextItalic;
|
|
26343
26544
|
app.setState({ currentTextItalic: value });
|
|
26344
26545
|
syncWysiwygStyle();
|
|
26345
|
-
updateSelectedTextStyle({
|
|
26546
|
+
updateSelectedTextStyle({
|
|
26547
|
+
italic: !appState.currentTextItalic
|
|
26548
|
+
});
|
|
26346
26549
|
updateCurrentTextDefaults({ italic: value });
|
|
26347
26550
|
}
|
|
26348
26551
|
}
|
|
@@ -26387,83 +26590,118 @@ var LeftToolFlyouts = ({
|
|
|
26387
26590
|
)
|
|
26388
26591
|
] }),
|
|
26389
26592
|
/* @__PURE__ */ jsx108("div", { className: "left-flyout__title", children: "\u5B57\u53F7" }),
|
|
26390
|
-
/* @__PURE__ */ jsx108(
|
|
26391
|
-
|
|
26392
|
-
|
|
26393
|
-
"
|
|
26394
|
-
{
|
|
26395
|
-
|
|
26396
|
-
|
|
26397
|
-
|
|
26398
|
-
|
|
26399
|
-
padding: "0 10px",
|
|
26400
|
-
borderRadius: 8,
|
|
26401
|
-
background: selected2 ? "#2178ff" : "transparent",
|
|
26402
|
-
color: selected2 ? "#fff" : "var(--text-primary-color)",
|
|
26403
|
-
border: selected2 ? "1px solid #2178ff" : "1px solid var(--button-border-color)",
|
|
26404
|
-
transition: "background 0.12s ease"
|
|
26405
|
-
},
|
|
26406
|
-
onMouseEnter: (e) => {
|
|
26407
|
-
if (selected2)
|
|
26408
|
-
e.currentTarget.style.background = "rgba(33,120,255,0.85)";
|
|
26409
|
-
},
|
|
26410
|
-
onMouseLeave: (e) => {
|
|
26411
|
-
if (selected2)
|
|
26412
|
-
e.currentTarget.style.background = "#2178ff";
|
|
26413
|
-
},
|
|
26414
|
-
onClick: () => {
|
|
26415
|
-
actionManager.executeAction(actionChangeFontSize, "ui", size);
|
|
26416
|
-
},
|
|
26417
|
-
children: /* @__PURE__ */ jsx108("span", { style: { fontSize: 12 }, children: size })
|
|
26593
|
+
/* @__PURE__ */ jsx108(
|
|
26594
|
+
"div",
|
|
26595
|
+
{
|
|
26596
|
+
className: "text-size-row",
|
|
26597
|
+
style: {
|
|
26598
|
+
display: "flex",
|
|
26599
|
+
gap: 6,
|
|
26600
|
+
alignItems: "center",
|
|
26601
|
+
justifyContent: "flex-start"
|
|
26418
26602
|
},
|
|
26419
|
-
size
|
|
26420
|
-
|
|
26421
|
-
|
|
26603
|
+
children: [10, 12, 16, 24, 36].map((size) => {
|
|
26604
|
+
const selected2 = appState.currentItemFontSize === size;
|
|
26605
|
+
return /* @__PURE__ */ jsx108(
|
|
26606
|
+
"button",
|
|
26607
|
+
{
|
|
26608
|
+
className: clsx46("text-size-chip", { selected: selected2 }),
|
|
26609
|
+
style: {
|
|
26610
|
+
minWidth: 32,
|
|
26611
|
+
height: 28,
|
|
26612
|
+
padding: "0 10px",
|
|
26613
|
+
borderRadius: 8,
|
|
26614
|
+
background: selected2 ? "#2178ff" : "transparent",
|
|
26615
|
+
color: selected2 ? "#fff" : "var(--text-primary-color)",
|
|
26616
|
+
border: selected2 ? "1px solid #2178ff" : "1px solid var(--button-border-color)",
|
|
26617
|
+
transition: "background 0.12s ease"
|
|
26618
|
+
},
|
|
26619
|
+
onMouseEnter: (e) => {
|
|
26620
|
+
if (selected2)
|
|
26621
|
+
e.currentTarget.style.background = "rgba(33,120,255,0.85)";
|
|
26622
|
+
},
|
|
26623
|
+
onMouseLeave: (e) => {
|
|
26624
|
+
if (selected2)
|
|
26625
|
+
e.currentTarget.style.background = "#2178ff";
|
|
26626
|
+
},
|
|
26627
|
+
onClick: () => {
|
|
26628
|
+
actionManager.executeAction(
|
|
26629
|
+
actionChangeFontSize,
|
|
26630
|
+
"ui",
|
|
26631
|
+
size
|
|
26632
|
+
);
|
|
26633
|
+
},
|
|
26634
|
+
children: /* @__PURE__ */ jsx108("span", { style: { fontSize: 12 }, children: size })
|
|
26635
|
+
},
|
|
26636
|
+
size
|
|
26637
|
+
);
|
|
26638
|
+
})
|
|
26639
|
+
}
|
|
26640
|
+
),
|
|
26422
26641
|
/* @__PURE__ */ jsx108("div", { className: "left-flyout__title", children: "\u5BF9\u9F50\u65B9\u5F0F" }),
|
|
26423
|
-
/* @__PURE__ */ jsxs60(
|
|
26424
|
-
|
|
26425
|
-
|
|
26426
|
-
|
|
26427
|
-
|
|
26428
|
-
|
|
26429
|
-
|
|
26430
|
-
|
|
26431
|
-
|
|
26432
|
-
|
|
26433
|
-
|
|
26434
|
-
|
|
26435
|
-
|
|
26436
|
-
|
|
26437
|
-
|
|
26438
|
-
|
|
26439
|
-
|
|
26440
|
-
|
|
26441
|
-
|
|
26442
|
-
|
|
26443
|
-
|
|
26444
|
-
|
|
26445
|
-
|
|
26446
|
-
|
|
26447
|
-
|
|
26448
|
-
|
|
26449
|
-
|
|
26450
|
-
|
|
26451
|
-
|
|
26452
|
-
|
|
26453
|
-
|
|
26454
|
-
|
|
26455
|
-
|
|
26456
|
-
|
|
26457
|
-
|
|
26458
|
-
|
|
26459
|
-
|
|
26460
|
-
|
|
26461
|
-
|
|
26462
|
-
|
|
26463
|
-
|
|
26464
|
-
|
|
26465
|
-
|
|
26466
|
-
|
|
26642
|
+
/* @__PURE__ */ jsxs60(
|
|
26643
|
+
"div",
|
|
26644
|
+
{
|
|
26645
|
+
className: "text-align-row",
|
|
26646
|
+
style: { display: "flex", gap: 6, justifyContent: "flex-start" },
|
|
26647
|
+
children: [
|
|
26648
|
+
/* @__PURE__ */ jsx108(
|
|
26649
|
+
ToolButton,
|
|
26650
|
+
{
|
|
26651
|
+
type: "radio",
|
|
26652
|
+
"aria-label": t("labels.left"),
|
|
26653
|
+
name: "text-align",
|
|
26654
|
+
title: t("labels.left"),
|
|
26655
|
+
icon: TextAlignLeftIcon,
|
|
26656
|
+
checked: appState.currentItemTextAlign === "left",
|
|
26657
|
+
onChange: () => {
|
|
26658
|
+
actionManager.executeAction(
|
|
26659
|
+
actionChangeTextAlign,
|
|
26660
|
+
"ui",
|
|
26661
|
+
"left"
|
|
26662
|
+
);
|
|
26663
|
+
}
|
|
26664
|
+
}
|
|
26665
|
+
),
|
|
26666
|
+
/* @__PURE__ */ jsx108(
|
|
26667
|
+
ToolButton,
|
|
26668
|
+
{
|
|
26669
|
+
type: "radio",
|
|
26670
|
+
"aria-label": t("labels.center"),
|
|
26671
|
+
name: "text-align",
|
|
26672
|
+
title: t("labels.center"),
|
|
26673
|
+
icon: TextAlignCenterIcon,
|
|
26674
|
+
checked: appState.currentItemTextAlign === "center",
|
|
26675
|
+
onChange: () => {
|
|
26676
|
+
actionManager.executeAction(
|
|
26677
|
+
actionChangeTextAlign,
|
|
26678
|
+
"ui",
|
|
26679
|
+
"center"
|
|
26680
|
+
);
|
|
26681
|
+
}
|
|
26682
|
+
}
|
|
26683
|
+
),
|
|
26684
|
+
/* @__PURE__ */ jsx108(
|
|
26685
|
+
ToolButton,
|
|
26686
|
+
{
|
|
26687
|
+
type: "radio",
|
|
26688
|
+
"aria-label": t("labels.right"),
|
|
26689
|
+
name: "text-align",
|
|
26690
|
+
title: t("labels.right"),
|
|
26691
|
+
icon: TextAlignRightIcon,
|
|
26692
|
+
checked: appState.currentItemTextAlign === "right",
|
|
26693
|
+
onChange: () => {
|
|
26694
|
+
actionManager.executeAction(
|
|
26695
|
+
actionChangeTextAlign,
|
|
26696
|
+
"ui",
|
|
26697
|
+
"right"
|
|
26698
|
+
);
|
|
26699
|
+
}
|
|
26700
|
+
}
|
|
26701
|
+
)
|
|
26702
|
+
]
|
|
26703
|
+
}
|
|
26704
|
+
),
|
|
26467
26705
|
/* @__PURE__ */ jsx108("div", { className: "left-flyout__separator" }),
|
|
26468
26706
|
renderStrokeColor()
|
|
26469
26707
|
] }) }),
|
|
@@ -26495,13 +26733,38 @@ var LeftToolFlyouts = ({
|
|
|
26495
26733
|
)
|
|
26496
26734
|
] }),
|
|
26497
26735
|
/* @__PURE__ */ jsx108("div", { className: "left-flyout__title", children: t("labels.strokeWidth") }),
|
|
26498
|
-
/* @__PURE__ */ jsx108("div", { className: "width-choices", children: [
|
|
26736
|
+
/* @__PURE__ */ jsx108("div", { className: "width-choices", children: [
|
|
26737
|
+
STROKE_WIDTH2.thin,
|
|
26738
|
+
STROKE_WIDTH2.bold,
|
|
26739
|
+
STROKE_WIDTH2.extraBold,
|
|
26740
|
+
6
|
|
26741
|
+
].map((w) => /* @__PURE__ */ jsx108(
|
|
26499
26742
|
"button",
|
|
26500
26743
|
{
|
|
26501
|
-
className: clsx46("stroke-width-preview", {
|
|
26744
|
+
className: clsx46("stroke-width-preview", {
|
|
26745
|
+
selected: appState.currentItemStrokeWidth === w
|
|
26746
|
+
}),
|
|
26502
26747
|
title: `${t("labels.strokeWidth")} ${w}`,
|
|
26503
26748
|
onClick: () => setStrokeWidth(w),
|
|
26504
|
-
children: /* @__PURE__ */ jsx108(
|
|
26749
|
+
children: /* @__PURE__ */ jsx108(
|
|
26750
|
+
"svg",
|
|
26751
|
+
{
|
|
26752
|
+
width: "24",
|
|
26753
|
+
height: "16",
|
|
26754
|
+
viewBox: "0 0 24 16",
|
|
26755
|
+
"aria-hidden": "true",
|
|
26756
|
+
children: /* @__PURE__ */ jsx108(
|
|
26757
|
+
"path",
|
|
26758
|
+
{
|
|
26759
|
+
d: "M2 12 C 6 2, 14 14, 22 6",
|
|
26760
|
+
fill: "none",
|
|
26761
|
+
stroke: "currentColor",
|
|
26762
|
+
strokeWidth: Math.max(1, Number(w)),
|
|
26763
|
+
strokeLinecap: "round"
|
|
26764
|
+
}
|
|
26765
|
+
)
|
|
26766
|
+
}
|
|
26767
|
+
)
|
|
26505
26768
|
},
|
|
26506
26769
|
String(w)
|
|
26507
26770
|
)) }),
|
|
@@ -31924,7 +32187,8 @@ var LayerUI = ({
|
|
|
31924
32187
|
generateLinkForSelection,
|
|
31925
32188
|
showZoomActions,
|
|
31926
32189
|
showPanActions,
|
|
31927
|
-
showToolBar = true
|
|
32190
|
+
showToolBar = true,
|
|
32191
|
+
showTopLeftToolbar = true
|
|
31928
32192
|
}) => {
|
|
31929
32193
|
const device = useDevice();
|
|
31930
32194
|
const tunnels = useInitializeTunnels();
|
|
@@ -32239,7 +32503,7 @@ var LayerUI = ({
|
|
|
32239
32503
|
showToolBar
|
|
32240
32504
|
}
|
|
32241
32505
|
),
|
|
32242
|
-
!device.editor.isMobile && !appState.viewModeEnabled &&
|
|
32506
|
+
!device.editor.isMobile && !appState.viewModeEnabled && showTopLeftToolbar && /* @__PURE__ */ jsx145(
|
|
32243
32507
|
TopLeftToolbar,
|
|
32244
32508
|
{
|
|
32245
32509
|
appState,
|
|
@@ -37574,6 +37838,168 @@ var App = class _App extends React46.Component {
|
|
|
37574
37838
|
this.store = new Store(this);
|
|
37575
37839
|
this.history = new History(this.store);
|
|
37576
37840
|
if (excalidrawAPI) {
|
|
37841
|
+
const updateLeftToolbarStyle = (patch) => {
|
|
37842
|
+
this.setState(patch);
|
|
37843
|
+
};
|
|
37844
|
+
const selectLineVariant = (variant = "line") => {
|
|
37845
|
+
if (variant === "line") {
|
|
37846
|
+
this.setActiveTool({ type: TOOL_TYPE4.line });
|
|
37847
|
+
return;
|
|
37848
|
+
}
|
|
37849
|
+
this.setActiveTool({ type: TOOL_TYPE4.arrow });
|
|
37850
|
+
if (variant === "arrow") {
|
|
37851
|
+
updateLeftToolbarStyle({
|
|
37852
|
+
currentItemStartArrowhead: null,
|
|
37853
|
+
currentItemEndArrowhead: "arrow"
|
|
37854
|
+
});
|
|
37855
|
+
return;
|
|
37856
|
+
}
|
|
37857
|
+
if (variant === "doubleArrow") {
|
|
37858
|
+
updateLeftToolbarStyle({
|
|
37859
|
+
currentItemStartArrowhead: "arrow",
|
|
37860
|
+
currentItemEndArrowhead: "arrow"
|
|
37861
|
+
});
|
|
37862
|
+
return;
|
|
37863
|
+
}
|
|
37864
|
+
if (variant === "outlineArrow") {
|
|
37865
|
+
updateLeftToolbarStyle({
|
|
37866
|
+
currentItemStartArrowhead: null,
|
|
37867
|
+
currentItemEndArrowhead: "triangle_outline"
|
|
37868
|
+
});
|
|
37869
|
+
return;
|
|
37870
|
+
}
|
|
37871
|
+
updateLeftToolbarStyle({
|
|
37872
|
+
currentItemStartArrowhead: "triangle_outline",
|
|
37873
|
+
currentItemEndArrowhead: "triangle_outline"
|
|
37874
|
+
});
|
|
37875
|
+
};
|
|
37876
|
+
const leftToolbarApi = {
|
|
37877
|
+
selectSelection: () => {
|
|
37878
|
+
this.setActiveTool({ type: TOOL_TYPE4.selection });
|
|
37879
|
+
},
|
|
37880
|
+
selectFreedraw: (opts) => {
|
|
37881
|
+
this.setActiveTool({ type: TOOL_TYPE4.freedraw });
|
|
37882
|
+
if (!opts) {
|
|
37883
|
+
return;
|
|
37884
|
+
}
|
|
37885
|
+
const patch = {};
|
|
37886
|
+
const variant = opts.variant ?? "pen";
|
|
37887
|
+
patch.currentItemOpacity = variant === "highlighter" ? 50 : 100;
|
|
37888
|
+
if (typeof opts.strokeWidth === "number") {
|
|
37889
|
+
patch.currentItemStrokeWidth = opts.strokeWidth;
|
|
37890
|
+
}
|
|
37891
|
+
if (typeof opts.strokeColor === "string") {
|
|
37892
|
+
patch.currentItemStrokeColor = opts.strokeColor;
|
|
37893
|
+
}
|
|
37894
|
+
updateLeftToolbarStyle(patch);
|
|
37895
|
+
},
|
|
37896
|
+
selectLine: (opts) => {
|
|
37897
|
+
const variant = opts?.variant ?? "line";
|
|
37898
|
+
selectLineVariant(variant);
|
|
37899
|
+
if (!opts) {
|
|
37900
|
+
return;
|
|
37901
|
+
}
|
|
37902
|
+
const patch = {};
|
|
37903
|
+
if (typeof opts.strokeWidth === "number") {
|
|
37904
|
+
patch.currentItemStrokeWidth = opts.strokeWidth;
|
|
37905
|
+
}
|
|
37906
|
+
if (typeof opts.strokeColor === "string") {
|
|
37907
|
+
patch.currentItemStrokeColor = opts.strokeColor;
|
|
37908
|
+
}
|
|
37909
|
+
updateLeftToolbarStyle(patch);
|
|
37910
|
+
},
|
|
37911
|
+
selectShape: (shape, opts) => {
|
|
37912
|
+
const nextShape = shape ?? "rectangle";
|
|
37913
|
+
this.setActiveTool({ type: nextShape });
|
|
37914
|
+
if (!opts) {
|
|
37915
|
+
return;
|
|
37916
|
+
}
|
|
37917
|
+
const patch = {};
|
|
37918
|
+
if (typeof opts.strokeWidth === "number") {
|
|
37919
|
+
patch.currentItemStrokeWidth = opts.strokeWidth;
|
|
37920
|
+
}
|
|
37921
|
+
if (typeof opts.strokeColor === "string") {
|
|
37922
|
+
patch.currentItemStrokeColor = opts.strokeColor;
|
|
37923
|
+
}
|
|
37924
|
+
if (typeof opts.backgroundColor === "string") {
|
|
37925
|
+
patch.currentItemBackgroundColor = opts.backgroundColor;
|
|
37926
|
+
}
|
|
37927
|
+
if (opts.fillStyle) {
|
|
37928
|
+
patch.currentItemFillStyle = opts.fillStyle;
|
|
37929
|
+
}
|
|
37930
|
+
updateLeftToolbarStyle(patch);
|
|
37931
|
+
},
|
|
37932
|
+
selectText: (opts) => {
|
|
37933
|
+
this.setActiveTool({ type: TOOL_TYPE4.text });
|
|
37934
|
+
if (!opts) {
|
|
37935
|
+
return;
|
|
37936
|
+
}
|
|
37937
|
+
const patch = {};
|
|
37938
|
+
if (typeof opts.fontSize === "number") {
|
|
37939
|
+
patch.currentItemFontSize = opts.fontSize;
|
|
37940
|
+
}
|
|
37941
|
+
if (opts.textAlign) {
|
|
37942
|
+
patch.currentItemTextAlign = opts.textAlign;
|
|
37943
|
+
}
|
|
37944
|
+
if (typeof opts.strokeColor === "string") {
|
|
37945
|
+
patch.currentItemStrokeColor = opts.strokeColor;
|
|
37946
|
+
}
|
|
37947
|
+
if (typeof opts.bold === "boolean") {
|
|
37948
|
+
patch.currentTextBold = opts.bold;
|
|
37949
|
+
}
|
|
37950
|
+
if (typeof opts.italic === "boolean") {
|
|
37951
|
+
patch.currentTextItalic = opts.italic;
|
|
37952
|
+
}
|
|
37953
|
+
if (typeof opts.underline === "boolean") {
|
|
37954
|
+
patch.currentTextUnderline = opts.underline;
|
|
37955
|
+
}
|
|
37956
|
+
if (typeof opts.strikethrough === "boolean") {
|
|
37957
|
+
patch.currentTextStrikethrough = opts.strikethrough;
|
|
37958
|
+
}
|
|
37959
|
+
updateLeftToolbarStyle(patch);
|
|
37960
|
+
},
|
|
37961
|
+
selectEraser: () => {
|
|
37962
|
+
this.setActiveTool({ type: TOOL_TYPE4.eraser });
|
|
37963
|
+
},
|
|
37964
|
+
updateStyle: (patch) => {
|
|
37965
|
+
updateLeftToolbarStyle(patch);
|
|
37966
|
+
},
|
|
37967
|
+
dispatch: (command) => {
|
|
37968
|
+
switch (command.type) {
|
|
37969
|
+
case "selectSelection":
|
|
37970
|
+
leftToolbarApi.selectSelection();
|
|
37971
|
+
return;
|
|
37972
|
+
case "selectFreedraw":
|
|
37973
|
+
leftToolbarApi.selectFreedraw(command.payload);
|
|
37974
|
+
return;
|
|
37975
|
+
case "selectLine":
|
|
37976
|
+
leftToolbarApi.selectLine(command.payload);
|
|
37977
|
+
return;
|
|
37978
|
+
case "selectShape":
|
|
37979
|
+
leftToolbarApi.selectShape(
|
|
37980
|
+
command.payload?.shape,
|
|
37981
|
+
command.payload && {
|
|
37982
|
+
strokeWidth: command.payload.strokeWidth,
|
|
37983
|
+
strokeColor: command.payload.strokeColor,
|
|
37984
|
+
backgroundColor: command.payload.backgroundColor,
|
|
37985
|
+
fillStyle: command.payload.fillStyle
|
|
37986
|
+
}
|
|
37987
|
+
);
|
|
37988
|
+
return;
|
|
37989
|
+
case "selectText":
|
|
37990
|
+
leftToolbarApi.selectText(command.payload);
|
|
37991
|
+
return;
|
|
37992
|
+
case "selectEraser":
|
|
37993
|
+
leftToolbarApi.selectEraser();
|
|
37994
|
+
return;
|
|
37995
|
+
case "updateStyle":
|
|
37996
|
+
leftToolbarApi.updateStyle(command.payload);
|
|
37997
|
+
return;
|
|
37998
|
+
default:
|
|
37999
|
+
return;
|
|
38000
|
+
}
|
|
38001
|
+
}
|
|
38002
|
+
};
|
|
37577
38003
|
const api = {
|
|
37578
38004
|
updateScene: this.updateScene,
|
|
37579
38005
|
updateSceneSilently: this.updateSceneSilently,
|
|
@@ -37600,6 +38026,7 @@ var App = class _App extends React46.Component {
|
|
|
37600
38026
|
setToast: this.setToast,
|
|
37601
38027
|
id: this.id,
|
|
37602
38028
|
setActiveTool: this.setActiveTool,
|
|
38029
|
+
leftToolbar: leftToolbarApi,
|
|
37603
38030
|
setCursor: this.setCursor,
|
|
37604
38031
|
resetCursor: this.resetCursor,
|
|
37605
38032
|
updateFrameRendering: this.updateFrameRendering,
|
|
@@ -38065,6 +38492,7 @@ var App = class _App extends React46.Component {
|
|
|
38065
38492
|
showZoomActions: this.props.showZoomActions,
|
|
38066
38493
|
showPanActions: this.props.showPanActions,
|
|
38067
38494
|
showToolBar: this.props.showToolBar,
|
|
38495
|
+
showTopLeftToolbar: this.props.showTopLeftToolbar,
|
|
38068
38496
|
children: this.props.children
|
|
38069
38497
|
}
|
|
38070
38498
|
),
|
|
@@ -41291,15 +41719,207 @@ import {
|
|
|
41291
41719
|
viewportCoordsToSceneCoords as viewportCoordsToSceneCoords5
|
|
41292
41720
|
} from "@haoxin-web/excalidraw-common";
|
|
41293
41721
|
|
|
41294
|
-
// components/
|
|
41722
|
+
// components/ExternalLeftToolbar.tsx
|
|
41723
|
+
import { useState as useState40 } from "react";
|
|
41295
41724
|
import { jsx as jsx161, jsxs as jsxs88 } from "react/jsx-runtime";
|
|
41725
|
+
var SHAPE_OPTIONS = [
|
|
41726
|
+
"rectangle",
|
|
41727
|
+
"ellipse",
|
|
41728
|
+
"diamond",
|
|
41729
|
+
"triangle",
|
|
41730
|
+
"pentagon",
|
|
41731
|
+
"callout",
|
|
41732
|
+
"hollow_arrow",
|
|
41733
|
+
"hollow_double_arrow"
|
|
41734
|
+
];
|
|
41735
|
+
var LINE_VARIANTS = [
|
|
41736
|
+
"line",
|
|
41737
|
+
"arrow",
|
|
41738
|
+
"doubleArrow",
|
|
41739
|
+
"outlineArrow",
|
|
41740
|
+
"outlineDoubleArrow"
|
|
41741
|
+
];
|
|
41742
|
+
var FREEDRAW_VARIANTS = ["pen", "highlighter"];
|
|
41743
|
+
var ExternalLeftToolbar = ({
|
|
41744
|
+
excalidrawAPI,
|
|
41745
|
+
className,
|
|
41746
|
+
style
|
|
41747
|
+
}) => {
|
|
41748
|
+
const [shape, setShape] = useState40("rectangle");
|
|
41749
|
+
const [lineVariant, setLineVariant] = useState40("line");
|
|
41750
|
+
const [freedrawVariant, setFreedrawVariant] = useState40("pen");
|
|
41751
|
+
const [strokeWidth, setStrokeWidth] = useState40(2);
|
|
41752
|
+
const [strokeColor, setStrokeColor] = useState40("#1f1f1f");
|
|
41753
|
+
const disabled = !excalidrawAPI;
|
|
41754
|
+
return /* @__PURE__ */ jsxs88(
|
|
41755
|
+
"div",
|
|
41756
|
+
{
|
|
41757
|
+
className,
|
|
41758
|
+
style: {
|
|
41759
|
+
display: "flex",
|
|
41760
|
+
flexDirection: "column",
|
|
41761
|
+
gap: 8,
|
|
41762
|
+
padding: 10,
|
|
41763
|
+
border: "1px solid #e5e7eb",
|
|
41764
|
+
borderRadius: 10,
|
|
41765
|
+
width: 220,
|
|
41766
|
+
background: "#fff",
|
|
41767
|
+
...style
|
|
41768
|
+
},
|
|
41769
|
+
children: [
|
|
41770
|
+
/* @__PURE__ */ jsxs88("div", { style: { display: "flex", gap: 8 }, children: [
|
|
41771
|
+
/* @__PURE__ */ jsx161(
|
|
41772
|
+
"button",
|
|
41773
|
+
{
|
|
41774
|
+
type: "button",
|
|
41775
|
+
disabled,
|
|
41776
|
+
onClick: () => excalidrawAPI?.leftToolbar.selectSelection(),
|
|
41777
|
+
children: "Selection"
|
|
41778
|
+
}
|
|
41779
|
+
),
|
|
41780
|
+
/* @__PURE__ */ jsx161(
|
|
41781
|
+
"button",
|
|
41782
|
+
{
|
|
41783
|
+
type: "button",
|
|
41784
|
+
disabled,
|
|
41785
|
+
onClick: () => excalidrawAPI?.leftToolbar.selectEraser(),
|
|
41786
|
+
children: "Eraser"
|
|
41787
|
+
}
|
|
41788
|
+
)
|
|
41789
|
+
] }),
|
|
41790
|
+
/* @__PURE__ */ jsxs88("div", { style: { display: "flex", gap: 8, alignItems: "center" }, children: [
|
|
41791
|
+
/* @__PURE__ */ jsx161("label", { style: { minWidth: 70 }, children: "Freedraw" }),
|
|
41792
|
+
/* @__PURE__ */ jsx161(
|
|
41793
|
+
"select",
|
|
41794
|
+
{
|
|
41795
|
+
value: freedrawVariant,
|
|
41796
|
+
onChange: (e) => setFreedrawVariant(e.target.value),
|
|
41797
|
+
children: FREEDRAW_VARIANTS.map((item) => /* @__PURE__ */ jsx161("option", { value: item, children: item }, item))
|
|
41798
|
+
}
|
|
41799
|
+
),
|
|
41800
|
+
/* @__PURE__ */ jsx161(
|
|
41801
|
+
"button",
|
|
41802
|
+
{
|
|
41803
|
+
type: "button",
|
|
41804
|
+
disabled,
|
|
41805
|
+
onClick: () => excalidrawAPI?.leftToolbar.selectFreedraw({
|
|
41806
|
+
variant: freedrawVariant,
|
|
41807
|
+
strokeWidth,
|
|
41808
|
+
strokeColor
|
|
41809
|
+
}),
|
|
41810
|
+
children: "Apply"
|
|
41811
|
+
}
|
|
41812
|
+
)
|
|
41813
|
+
] }),
|
|
41814
|
+
/* @__PURE__ */ jsxs88("div", { style: { display: "flex", gap: 8, alignItems: "center" }, children: [
|
|
41815
|
+
/* @__PURE__ */ jsx161("label", { style: { minWidth: 70 }, children: "Line" }),
|
|
41816
|
+
/* @__PURE__ */ jsx161(
|
|
41817
|
+
"select",
|
|
41818
|
+
{
|
|
41819
|
+
value: lineVariant,
|
|
41820
|
+
onChange: (e) => setLineVariant(e.target.value),
|
|
41821
|
+
children: LINE_VARIANTS.map((item) => /* @__PURE__ */ jsx161("option", { value: item, children: item }, item))
|
|
41822
|
+
}
|
|
41823
|
+
),
|
|
41824
|
+
/* @__PURE__ */ jsx161(
|
|
41825
|
+
"button",
|
|
41826
|
+
{
|
|
41827
|
+
type: "button",
|
|
41828
|
+
disabled,
|
|
41829
|
+
onClick: () => excalidrawAPI?.leftToolbar.selectLine({
|
|
41830
|
+
variant: lineVariant,
|
|
41831
|
+
strokeWidth,
|
|
41832
|
+
strokeColor
|
|
41833
|
+
}),
|
|
41834
|
+
children: "Apply"
|
|
41835
|
+
}
|
|
41836
|
+
)
|
|
41837
|
+
] }),
|
|
41838
|
+
/* @__PURE__ */ jsxs88("div", { style: { display: "flex", gap: 8, alignItems: "center" }, children: [
|
|
41839
|
+
/* @__PURE__ */ jsx161("label", { style: { minWidth: 70 }, children: "Shape" }),
|
|
41840
|
+
/* @__PURE__ */ jsx161(
|
|
41841
|
+
"select",
|
|
41842
|
+
{
|
|
41843
|
+
value: shape,
|
|
41844
|
+
onChange: (e) => setShape(e.target.value),
|
|
41845
|
+
children: SHAPE_OPTIONS.map((item) => /* @__PURE__ */ jsx161("option", { value: item, children: item }, item))
|
|
41846
|
+
}
|
|
41847
|
+
),
|
|
41848
|
+
/* @__PURE__ */ jsx161(
|
|
41849
|
+
"button",
|
|
41850
|
+
{
|
|
41851
|
+
type: "button",
|
|
41852
|
+
disabled,
|
|
41853
|
+
onClick: () => excalidrawAPI?.leftToolbar.selectShape(shape, {
|
|
41854
|
+
strokeWidth,
|
|
41855
|
+
strokeColor
|
|
41856
|
+
}),
|
|
41857
|
+
children: "Apply"
|
|
41858
|
+
}
|
|
41859
|
+
)
|
|
41860
|
+
] }),
|
|
41861
|
+
/* @__PURE__ */ jsxs88("div", { style: { display: "flex", gap: 8, alignItems: "center" }, children: [
|
|
41862
|
+
/* @__PURE__ */ jsx161("label", { style: { minWidth: 70 }, children: "Text" }),
|
|
41863
|
+
/* @__PURE__ */ jsx161(
|
|
41864
|
+
"button",
|
|
41865
|
+
{
|
|
41866
|
+
type: "button",
|
|
41867
|
+
disabled,
|
|
41868
|
+
onClick: () => excalidrawAPI?.leftToolbar.selectText({
|
|
41869
|
+
strokeColor
|
|
41870
|
+
}),
|
|
41871
|
+
children: "Text Tool"
|
|
41872
|
+
}
|
|
41873
|
+
)
|
|
41874
|
+
] }),
|
|
41875
|
+
/* @__PURE__ */ jsxs88("div", { style: { display: "flex", gap: 8, alignItems: "center" }, children: [
|
|
41876
|
+
/* @__PURE__ */ jsx161("label", { style: { minWidth: 70 }, children: "Stroke" }),
|
|
41877
|
+
/* @__PURE__ */ jsx161(
|
|
41878
|
+
"input",
|
|
41879
|
+
{
|
|
41880
|
+
type: "number",
|
|
41881
|
+
min: 1,
|
|
41882
|
+
max: 20,
|
|
41883
|
+
value: strokeWidth,
|
|
41884
|
+
onChange: (e) => setStrokeWidth(Number(e.target.value || 1)),
|
|
41885
|
+
style: { width: 60 }
|
|
41886
|
+
}
|
|
41887
|
+
),
|
|
41888
|
+
/* @__PURE__ */ jsx161(
|
|
41889
|
+
"input",
|
|
41890
|
+
{
|
|
41891
|
+
type: "color",
|
|
41892
|
+
value: strokeColor,
|
|
41893
|
+
onChange: (e) => setStrokeColor(e.target.value)
|
|
41894
|
+
}
|
|
41895
|
+
),
|
|
41896
|
+
/* @__PURE__ */ jsx161(
|
|
41897
|
+
"button",
|
|
41898
|
+
{
|
|
41899
|
+
type: "button",
|
|
41900
|
+
disabled,
|
|
41901
|
+
onClick: () => excalidrawAPI?.leftToolbar.updateStyle({
|
|
41902
|
+
currentItemStrokeWidth: strokeWidth,
|
|
41903
|
+
currentItemStrokeColor: strokeColor
|
|
41904
|
+
}),
|
|
41905
|
+
children: "Sync"
|
|
41906
|
+
}
|
|
41907
|
+
)
|
|
41908
|
+
] })
|
|
41909
|
+
]
|
|
41910
|
+
}
|
|
41911
|
+
);
|
|
41912
|
+
};
|
|
41913
|
+
|
|
41914
|
+
// components/TTDDialog/TTDDialogTrigger.tsx
|
|
41915
|
+
import { jsx as jsx162, jsxs as jsxs89 } from "react/jsx-runtime";
|
|
41296
41916
|
var TTDDialogTrigger = ({
|
|
41297
41917
|
children,
|
|
41298
41918
|
icon
|
|
41299
41919
|
}) => {
|
|
41300
41920
|
const { TTDDialogTriggerTunnel } = useTunnels();
|
|
41301
41921
|
const setAppState = useExcalidrawSetAppState();
|
|
41302
|
-
return /* @__PURE__ */
|
|
41922
|
+
return /* @__PURE__ */ jsx162(TTDDialogTriggerTunnel.In, { children: /* @__PURE__ */ jsxs89(
|
|
41303
41923
|
DropdownMenu_default.Item,
|
|
41304
41924
|
{
|
|
41305
41925
|
onSelect: () => {
|
|
@@ -41309,7 +41929,7 @@ var TTDDialogTrigger = ({
|
|
|
41309
41929
|
icon: icon ?? brainIcon,
|
|
41310
41930
|
children: [
|
|
41311
41931
|
children ?? t("labels.textToDiagram"),
|
|
41312
|
-
/* @__PURE__ */
|
|
41932
|
+
/* @__PURE__ */ jsx162(DropdownMenu_default.Item.Badge, { children: "AI" })
|
|
41313
41933
|
]
|
|
41314
41934
|
}
|
|
41315
41935
|
) });
|
|
@@ -41334,7 +41954,7 @@ var DiagramToCodePlugin = (props) => {
|
|
|
41334
41954
|
// index.tsx
|
|
41335
41955
|
import { isElementLink as isElementLink3 } from "@haoxin-web/excalidraw-element";
|
|
41336
41956
|
import { setCustomTextMetricsProvider } from "@haoxin-web/excalidraw-element";
|
|
41337
|
-
import { jsx as
|
|
41957
|
+
import { jsx as jsx163 } from "react/jsx-runtime";
|
|
41338
41958
|
polyfill_default();
|
|
41339
41959
|
var ExcalidrawBase = (props) => {
|
|
41340
41960
|
console.log("\u4F7F\u7528\u4E86\u7EC4\u4EF6=====Excalidraw component initialized");
|
|
@@ -41374,7 +41994,8 @@ var ExcalidrawBase = (props) => {
|
|
|
41374
41994
|
renderScrollbars,
|
|
41375
41995
|
showZoomActions,
|
|
41376
41996
|
showPanActions,
|
|
41377
|
-
showToolBar
|
|
41997
|
+
showToolBar,
|
|
41998
|
+
showTopLeftToolbar
|
|
41378
41999
|
} = props;
|
|
41379
42000
|
const canvasActions = props.UIOptions?.canvasActions;
|
|
41380
42001
|
const UIOptions = {
|
|
@@ -41410,7 +42031,7 @@ var ExcalidrawBase = (props) => {
|
|
|
41410
42031
|
document.removeEventListener("touchmove", handleTouchMove);
|
|
41411
42032
|
};
|
|
41412
42033
|
}, []);
|
|
41413
|
-
return /* @__PURE__ */
|
|
42034
|
+
return /* @__PURE__ */ jsx163(EditorJotaiProvider, { store: editorJotaiStore, children: /* @__PURE__ */ jsx163(InitializeApp, { langCode, theme, children: /* @__PURE__ */ jsx163(
|
|
41414
42035
|
App_default,
|
|
41415
42036
|
{
|
|
41416
42037
|
onChange,
|
|
@@ -41449,6 +42070,7 @@ var ExcalidrawBase = (props) => {
|
|
|
41449
42070
|
showZoomActions,
|
|
41450
42071
|
showPanActions,
|
|
41451
42072
|
showToolBar,
|
|
42073
|
+
showTopLeftToolbar,
|
|
41452
42074
|
children
|
|
41453
42075
|
}
|
|
41454
42076
|
) }) });
|
|
@@ -41488,7 +42110,7 @@ var areEqual5 = (prevProps, nextProps) => {
|
|
|
41488
42110
|
});
|
|
41489
42111
|
return isUIOptionsSame && isShallowEqual9(prev, next);
|
|
41490
42112
|
};
|
|
41491
|
-
var Excalidraw =
|
|
42113
|
+
var Excalidraw = React49.memo(ExcalidrawBase, areEqual5);
|
|
41492
42114
|
Excalidraw.displayName = "Excalidraw";
|
|
41493
42115
|
export {
|
|
41494
42116
|
Button,
|
|
@@ -41498,6 +42120,7 @@ export {
|
|
|
41498
42120
|
DiagramToCodePlugin,
|
|
41499
42121
|
Ellipsify,
|
|
41500
42122
|
Excalidraw,
|
|
42123
|
+
ExternalLeftToolbar,
|
|
41501
42124
|
FONT_FAMILY5 as FONT_FAMILY,
|
|
41502
42125
|
FooterCenter_default as Footer,
|
|
41503
42126
|
LiveCollaborationTrigger_default as LiveCollaborationTrigger,
|
|
@@ -41510,6 +42133,7 @@ export {
|
|
|
41510
42133
|
TTDDialog,
|
|
41511
42134
|
TTDDialogTrigger,
|
|
41512
42135
|
UserIdleState2 as UserIdleState,
|
|
42136
|
+
UserList,
|
|
41513
42137
|
WelcomeScreen_default as WelcomeScreen,
|
|
41514
42138
|
bumpVersion,
|
|
41515
42139
|
convertToExcalidrawElements,
|