@activecollab/components 2.0.588 → 2.0.590
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/components/CommandPalette/CommandPalette.js +90 -62
- package/dist/cjs/components/CommandPalette/CommandPalette.js.map +1 -1
- package/dist/cjs/components/CommandPalette/CommandPalette.styles.js +34 -16
- package/dist/cjs/components/CommandPalette/CommandPalette.styles.js.map +1 -1
- package/dist/cjs/components/CommandPalette/CommandPaletteCommandItem.js +1 -0
- package/dist/cjs/components/CommandPalette/CommandPaletteCommandItem.js.map +1 -1
- package/dist/cjs/components/CommandPalette/CommandPaletteHeader.js +40 -9
- package/dist/cjs/components/CommandPalette/CommandPaletteHeader.js.map +1 -1
- package/dist/cjs/components/CommandPalette/CommandPaletteItem.js +13 -4
- package/dist/cjs/components/CommandPalette/CommandPaletteItem.js.map +1 -1
- package/dist/cjs/components/CommandPalette/CommandPaletteVirtualList.js +125 -0
- package/dist/cjs/components/CommandPalette/CommandPaletteVirtualList.js.map +1 -0
- package/dist/cjs/components/CommandPalette/context/SelectedContext.js.map +1 -1
- package/dist/cjs/components/GlobalStyle.js +1 -1
- package/dist/cjs/components/GlobalStyle.js.map +1 -1
- package/dist/cjs/components/ObjectLayout/ObjectLayout.js +5 -1
- package/dist/cjs/components/ObjectLayout/ObjectLayout.js.map +1 -1
- package/dist/cjs/components/ObjectLayout/Styles.js +17 -10
- package/dist/cjs/components/ObjectLayout/Styles.js.map +1 -1
- package/dist/cjs/components/PropertyList/PropertyList.js +12 -1
- package/dist/cjs/components/PropertyList/PropertyList.js.map +1 -1
- package/dist/cjs/components/PropertyList/Styles.js +58 -51
- package/dist/cjs/components/PropertyList/Styles.js.map +1 -1
- package/dist/cjs/components/Section/Section.js +4 -1
- package/dist/cjs/components/Section/Section.js.map +1 -1
- package/dist/cjs/components/Section/Styles.js +7 -3
- package/dist/cjs/components/Section/Styles.js.map +1 -1
- package/dist/cjs/components/TicketPerforation/TicketPerforation.js +7 -5
- package/dist/cjs/components/TicketPerforation/TicketPerforation.js.map +1 -1
- package/dist/cjs/presentation/whiteboard/elementToolbars.js +192 -1
- package/dist/cjs/presentation/whiteboard/elementToolbars.js.map +1 -1
- package/dist/cjs/presentation/whiteboard/inspector.js +6 -1
- package/dist/cjs/presentation/whiteboard/inspector.js.map +1 -1
- package/dist/cjs/presentation/whiteboard/lineElements.js +982 -0
- package/dist/cjs/presentation/whiteboard/lineElements.js.map +1 -0
- package/dist/cjs/presentation/whiteboard/lineInspector.js +301 -0
- package/dist/cjs/presentation/whiteboard/lineInspector.js.map +1 -0
- package/dist/cjs/presentation/whiteboard/lineModel.js +596 -0
- package/dist/cjs/presentation/whiteboard/lineModel.js.map +1 -0
- package/dist/cjs/presentation/whiteboard/outline.js +31 -12
- package/dist/cjs/presentation/whiteboard/outline.js.map +1 -1
- package/dist/cjs/presentation/whiteboardModern/toolDock.js +11 -17
- package/dist/cjs/presentation/whiteboardModern/toolDock.js.map +1 -1
- package/dist/esm/components/CommandPalette/CommandPalette.d.ts +13 -3
- package/dist/esm/components/CommandPalette/CommandPalette.d.ts.map +1 -1
- package/dist/esm/components/CommandPalette/CommandPalette.js +77 -53
- package/dist/esm/components/CommandPalette/CommandPalette.js.map +1 -1
- package/dist/esm/components/CommandPalette/CommandPalette.styles.d.ts +9 -2
- package/dist/esm/components/CommandPalette/CommandPalette.styles.d.ts.map +1 -1
- package/dist/esm/components/CommandPalette/CommandPalette.styles.js +30 -14
- package/dist/esm/components/CommandPalette/CommandPalette.styles.js.map +1 -1
- package/dist/esm/components/CommandPalette/CommandPaletteCommandItem.d.ts.map +1 -1
- package/dist/esm/components/CommandPalette/CommandPaletteCommandItem.js +1 -0
- package/dist/esm/components/CommandPalette/CommandPaletteCommandItem.js.map +1 -1
- package/dist/esm/components/CommandPalette/CommandPaletteHeader.d.ts +3 -1
- package/dist/esm/components/CommandPalette/CommandPaletteHeader.d.ts.map +1 -1
- package/dist/esm/components/CommandPalette/CommandPaletteHeader.js +40 -9
- package/dist/esm/components/CommandPalette/CommandPaletteHeader.js.map +1 -1
- package/dist/esm/components/CommandPalette/CommandPaletteItem.d.ts +7 -1
- package/dist/esm/components/CommandPalette/CommandPaletteItem.d.ts.map +1 -1
- package/dist/esm/components/CommandPalette/CommandPaletteItem.js +14 -5
- package/dist/esm/components/CommandPalette/CommandPaletteItem.js.map +1 -1
- package/dist/esm/components/CommandPalette/CommandPaletteVirtualList.d.ts +21 -0
- package/dist/esm/components/CommandPalette/CommandPaletteVirtualList.d.ts.map +1 -0
- package/dist/esm/components/CommandPalette/CommandPaletteVirtualList.js +104 -0
- package/dist/esm/components/CommandPalette/CommandPaletteVirtualList.js.map +1 -0
- package/dist/esm/components/CommandPalette/context/SelectedContext.d.ts +5 -0
- package/dist/esm/components/CommandPalette/context/SelectedContext.d.ts.map +1 -1
- package/dist/esm/components/CommandPalette/context/SelectedContext.js.map +1 -1
- package/dist/esm/components/GlobalStyle.d.ts.map +1 -1
- package/dist/esm/components/GlobalStyle.js +1 -1
- package/dist/esm/components/GlobalStyle.js.map +1 -1
- package/dist/esm/components/ObjectLayout/ObjectLayout.d.ts +2 -0
- package/dist/esm/components/ObjectLayout/ObjectLayout.d.ts.map +1 -1
- package/dist/esm/components/ObjectLayout/ObjectLayout.js +5 -1
- package/dist/esm/components/ObjectLayout/ObjectLayout.js.map +1 -1
- package/dist/esm/components/ObjectLayout/Styles.d.ts +1 -0
- package/dist/esm/components/ObjectLayout/Styles.d.ts.map +1 -1
- package/dist/esm/components/ObjectLayout/Styles.js +16 -9
- package/dist/esm/components/ObjectLayout/Styles.js.map +1 -1
- package/dist/esm/components/PropertyList/PropertyList.d.ts +6 -0
- package/dist/esm/components/PropertyList/PropertyList.d.ts.map +1 -1
- package/dist/esm/components/PropertyList/PropertyList.js +12 -1
- package/dist/esm/components/PropertyList/PropertyList.js.map +1 -1
- package/dist/esm/components/PropertyList/Styles.d.ts +2 -0
- package/dist/esm/components/PropertyList/Styles.d.ts.map +1 -1
- package/dist/esm/components/PropertyList/Styles.js +58 -51
- package/dist/esm/components/PropertyList/Styles.js.map +1 -1
- package/dist/esm/components/Section/Section.d.ts +2 -0
- package/dist/esm/components/Section/Section.d.ts.map +1 -1
- package/dist/esm/components/Section/Section.js +4 -1
- package/dist/esm/components/Section/Section.js.map +1 -1
- package/dist/esm/components/Section/Styles.d.ts +3 -1
- package/dist/esm/components/Section/Styles.d.ts.map +1 -1
- package/dist/esm/components/Section/Styles.js +6 -2
- package/dist/esm/components/Section/Styles.js.map +1 -1
- package/dist/esm/components/TicketPerforation/TicketPerforation.d.ts +2 -0
- package/dist/esm/components/TicketPerforation/TicketPerforation.d.ts.map +1 -1
- package/dist/esm/components/TicketPerforation/TicketPerforation.js +7 -5
- package/dist/esm/components/TicketPerforation/TicketPerforation.js.map +1 -1
- package/dist/esm/presentation/whiteboard/elementToolbars.d.ts +22 -0
- package/dist/esm/presentation/whiteboard/elementToolbars.d.ts.map +1 -1
- package/dist/esm/presentation/whiteboard/elementToolbars.js +151 -2
- package/dist/esm/presentation/whiteboard/elementToolbars.js.map +1 -1
- package/dist/esm/presentation/whiteboard/inspector.d.ts +10 -2
- package/dist/esm/presentation/whiteboard/inspector.d.ts.map +1 -1
- package/dist/esm/presentation/whiteboard/inspector.js +6 -2
- package/dist/esm/presentation/whiteboard/inspector.js.map +1 -1
- package/dist/esm/presentation/whiteboard/lineElements.d.ts +23 -0
- package/dist/esm/presentation/whiteboard/lineElements.d.ts.map +1 -0
- package/dist/esm/presentation/whiteboard/lineElements.js +851 -0
- package/dist/esm/presentation/whiteboard/lineElements.js.map +1 -0
- package/dist/esm/presentation/whiteboard/lineInspector.d.ts +9 -0
- package/dist/esm/presentation/whiteboard/lineInspector.d.ts.map +1 -0
- package/dist/esm/presentation/whiteboard/lineInspector.js +224 -0
- package/dist/esm/presentation/whiteboard/lineInspector.js.map +1 -0
- package/dist/esm/presentation/whiteboard/lineModel.d.ts +132 -0
- package/dist/esm/presentation/whiteboard/lineModel.d.ts.map +1 -0
- package/dist/esm/presentation/whiteboard/lineModel.js +555 -0
- package/dist/esm/presentation/whiteboard/lineModel.js.map +1 -0
- package/dist/esm/presentation/whiteboard/outline.d.ts +4 -2
- package/dist/esm/presentation/whiteboard/outline.d.ts.map +1 -1
- package/dist/esm/presentation/whiteboard/outline.js +20 -7
- package/dist/esm/presentation/whiteboard/outline.js.map +1 -1
- package/dist/esm/presentation/whiteboardModern/toolDock.d.ts +2 -2
- package/dist/esm/presentation/whiteboardModern/toolDock.d.ts.map +1 -1
- package/dist/esm/presentation/whiteboardModern/toolDock.js +12 -18
- package/dist/esm/presentation/whiteboardModern/toolDock.js.map +1 -1
- package/dist/index.js +385 -166
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,555 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
// mirrors: new-activecollab-front Whiteboards connection `style` (ArrowFormattingToolbar defaults); corner_radius: no payload yet
|
|
5
|
+
|
|
6
|
+
// mirrors: no payload yet
|
|
7
|
+
|
|
8
|
+
// mirrors: no payload yet
|
|
9
|
+
|
|
10
|
+
// mirrors: new-activecollab-front Whiteboards connectionShape (type, start_element_id, end_element_id, start_anchor, end_anchor, style); line fields, waypoints and label: no payload yet
|
|
11
|
+
|
|
12
|
+
export const MAX_WAYPOINTS = 20;
|
|
13
|
+
export const LINE_HIT_WIDTH = 10;
|
|
14
|
+
export const LINE_DEFAULT_LENGTH = 160;
|
|
15
|
+
export const LINE_TYPE_OPTIONS = [{
|
|
16
|
+
id: "line",
|
|
17
|
+
name: "Straight"
|
|
18
|
+
}, {
|
|
19
|
+
id: "curved",
|
|
20
|
+
name: "Curved"
|
|
21
|
+
}, {
|
|
22
|
+
id: "elbow",
|
|
23
|
+
name: "Elbow"
|
|
24
|
+
}];
|
|
25
|
+
export const LINE_END_OPTIONS = [{
|
|
26
|
+
id: "none",
|
|
27
|
+
name: "None"
|
|
28
|
+
}, {
|
|
29
|
+
id: "arrow",
|
|
30
|
+
name: "Arrow"
|
|
31
|
+
}, {
|
|
32
|
+
id: "dot",
|
|
33
|
+
name: "Dot"
|
|
34
|
+
}, {
|
|
35
|
+
id: "square",
|
|
36
|
+
name: "Square"
|
|
37
|
+
}, {
|
|
38
|
+
id: "rotatedSquare",
|
|
39
|
+
name: "Rotated Square"
|
|
40
|
+
}, {
|
|
41
|
+
id: "circle",
|
|
42
|
+
name: "Circle"
|
|
43
|
+
}];
|
|
44
|
+
export const LINE_PATTERN_OPTIONS = [{
|
|
45
|
+
id: "solid",
|
|
46
|
+
name: "Solid"
|
|
47
|
+
}, {
|
|
48
|
+
id: "dashed",
|
|
49
|
+
name: "Dashed"
|
|
50
|
+
}, {
|
|
51
|
+
id: "dotted",
|
|
52
|
+
name: "Dotted"
|
|
53
|
+
}];
|
|
54
|
+
export const ANCHOR_OPTIONS = [{
|
|
55
|
+
id: "center",
|
|
56
|
+
name: "Center"
|
|
57
|
+
}, {
|
|
58
|
+
id: "top-left",
|
|
59
|
+
name: "Top Left"
|
|
60
|
+
}, {
|
|
61
|
+
id: "top",
|
|
62
|
+
name: "Top"
|
|
63
|
+
}, {
|
|
64
|
+
id: "top-right",
|
|
65
|
+
name: "Top Right"
|
|
66
|
+
}, {
|
|
67
|
+
id: "right",
|
|
68
|
+
name: "Right"
|
|
69
|
+
}, {
|
|
70
|
+
id: "bottom-right",
|
|
71
|
+
name: "Bottom Right"
|
|
72
|
+
}, {
|
|
73
|
+
id: "bottom",
|
|
74
|
+
name: "Bottom"
|
|
75
|
+
}, {
|
|
76
|
+
id: "bottom-left",
|
|
77
|
+
name: "Bottom Left"
|
|
78
|
+
}, {
|
|
79
|
+
id: "left",
|
|
80
|
+
name: "Left"
|
|
81
|
+
}];
|
|
82
|
+
export const optionName = (options, id) => {
|
|
83
|
+
var _options$find$name, _options$find;
|
|
84
|
+
return (_options$find$name = (_options$find = options.find(option => option.id === id)) == null ? void 0 : _options$find.name) != null ? _options$find$name : "";
|
|
85
|
+
};
|
|
86
|
+
export const DEFAULT_LINE_STYLE = {
|
|
87
|
+
stroke: "default",
|
|
88
|
+
stroke_opacity: 100,
|
|
89
|
+
stroke_width: 2,
|
|
90
|
+
stroke_pattern: "solid",
|
|
91
|
+
arrow_start: "none",
|
|
92
|
+
arrow_end: "none",
|
|
93
|
+
corner_radius: 0
|
|
94
|
+
};
|
|
95
|
+
export const DEFAULT_LABEL = {
|
|
96
|
+
text: "",
|
|
97
|
+
position: 0.5,
|
|
98
|
+
font_size: 13,
|
|
99
|
+
bold: false,
|
|
100
|
+
italic: false,
|
|
101
|
+
underline: false,
|
|
102
|
+
strikethrough: false
|
|
103
|
+
};
|
|
104
|
+
export const dashArray = (pattern, width) => pattern === "dashed" ? width * 4 + " " + width * 3 : pattern === "dotted" ? width + " " + width * 2 : undefined;
|
|
105
|
+
const distance = (a, b) => Math.hypot(b.x - a.x, b.y - a.y);
|
|
106
|
+
const towards = (from, to, length) => {
|
|
107
|
+
const total = distance(from, to) || 1;
|
|
108
|
+
return {
|
|
109
|
+
x: from.x + (to.x - from.x) * length / total,
|
|
110
|
+
y: from.y + (to.y - from.y) * length / total
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
const midpoint = (a, b) => ({
|
|
114
|
+
x: (a.x + b.x) / 2,
|
|
115
|
+
y: (a.y + b.y) / 2
|
|
116
|
+
});
|
|
117
|
+
const dedupe = points => points.filter((point, index) => index === 0 || distance(points[index - 1], point) > 0.5);
|
|
118
|
+
export const anchorPoint = (box, anchor, toward) => {
|
|
119
|
+
const cx = box.x + box.width / 2;
|
|
120
|
+
const cy = box.y + box.height / 2;
|
|
121
|
+
const left = box.x;
|
|
122
|
+
const right = box.x + box.width;
|
|
123
|
+
const top = box.y;
|
|
124
|
+
const bottom = box.y + box.height;
|
|
125
|
+
switch (anchor) {
|
|
126
|
+
case "top-left":
|
|
127
|
+
return {
|
|
128
|
+
x: left,
|
|
129
|
+
y: top
|
|
130
|
+
};
|
|
131
|
+
case "top":
|
|
132
|
+
return {
|
|
133
|
+
x: cx,
|
|
134
|
+
y: top
|
|
135
|
+
};
|
|
136
|
+
case "top-right":
|
|
137
|
+
return {
|
|
138
|
+
x: right,
|
|
139
|
+
y: top
|
|
140
|
+
};
|
|
141
|
+
case "right":
|
|
142
|
+
return {
|
|
143
|
+
x: right,
|
|
144
|
+
y: cy
|
|
145
|
+
};
|
|
146
|
+
case "bottom-right":
|
|
147
|
+
return {
|
|
148
|
+
x: right,
|
|
149
|
+
y: bottom
|
|
150
|
+
};
|
|
151
|
+
case "bottom":
|
|
152
|
+
return {
|
|
153
|
+
x: cx,
|
|
154
|
+
y: bottom
|
|
155
|
+
};
|
|
156
|
+
case "bottom-left":
|
|
157
|
+
return {
|
|
158
|
+
x: left,
|
|
159
|
+
y: bottom
|
|
160
|
+
};
|
|
161
|
+
case "left":
|
|
162
|
+
return {
|
|
163
|
+
x: left,
|
|
164
|
+
y: cy
|
|
165
|
+
};
|
|
166
|
+
default:
|
|
167
|
+
{
|
|
168
|
+
const dx = toward.x - cx;
|
|
169
|
+
const dy = toward.y - cy;
|
|
170
|
+
const scale = Math.min(dx ? box.width / 2 / Math.abs(dx) : Infinity, dy ? box.height / 2 / Math.abs(dy) : Infinity);
|
|
171
|
+
return Number.isFinite(scale) ? {
|
|
172
|
+
x: cx + dx * scale,
|
|
173
|
+
y: cy + dy * scale
|
|
174
|
+
} : {
|
|
175
|
+
x: cx,
|
|
176
|
+
y: cy
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
export const elbowAxis = (start, end, anchor) => {
|
|
182
|
+
if (anchor === "left" || anchor === "right") {
|
|
183
|
+
return "h";
|
|
184
|
+
}
|
|
185
|
+
if (anchor === "top" || anchor === "bottom") {
|
|
186
|
+
return "v";
|
|
187
|
+
}
|
|
188
|
+
return Math.abs(end.x - start.x) >= Math.abs(end.y - start.y) ? "h" : "v";
|
|
189
|
+
};
|
|
190
|
+
export const barIsVertical = (index, axis) => index % 2 === 0 === (axis === "h");
|
|
191
|
+
export const elbowRoute = (start, end, bars, axis) => {
|
|
192
|
+
const effective = bars.length ? bars : [midpoint(start, end)];
|
|
193
|
+
const points = [start];
|
|
194
|
+
let current = start;
|
|
195
|
+
effective.forEach((bar, index) => {
|
|
196
|
+
current = barIsVertical(index, axis) ? {
|
|
197
|
+
x: bar.x,
|
|
198
|
+
y: current.y
|
|
199
|
+
} : {
|
|
200
|
+
x: current.x,
|
|
201
|
+
y: bar.y
|
|
202
|
+
};
|
|
203
|
+
points.push(current);
|
|
204
|
+
});
|
|
205
|
+
points.push(barIsVertical(effective.length - 1, axis) ? {
|
|
206
|
+
x: current.x,
|
|
207
|
+
y: end.y
|
|
208
|
+
} : {
|
|
209
|
+
x: end.x,
|
|
210
|
+
y: current.y
|
|
211
|
+
});
|
|
212
|
+
points.push(end);
|
|
213
|
+
return points;
|
|
214
|
+
};
|
|
215
|
+
export const roundedPolylinePath = (raw, radius) => {
|
|
216
|
+
const points = dedupe(raw);
|
|
217
|
+
if (points.length < 2) {
|
|
218
|
+
return "";
|
|
219
|
+
}
|
|
220
|
+
let d = "M " + points[0].x + " " + points[0].y;
|
|
221
|
+
for (let index = 1; index < points.length - 1; index += 1) {
|
|
222
|
+
const before = points[index - 1];
|
|
223
|
+
const corner = points[index];
|
|
224
|
+
const after = points[index + 1];
|
|
225
|
+
const size = Math.min(radius, distance(before, corner) / 2, distance(corner, after) / 2);
|
|
226
|
+
if (size < 0.5) {
|
|
227
|
+
d += " L " + corner.x + " " + corner.y;
|
|
228
|
+
} else {
|
|
229
|
+
const enter = towards(corner, before, size);
|
|
230
|
+
const leave = towards(corner, after, size);
|
|
231
|
+
d += " L " + enter.x + " " + enter.y + " Q " + corner.x + " " + corner.y + " " + leave.x + " " + leave.y;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
const last = points[points.length - 1];
|
|
235
|
+
return d + " L " + last.x + " " + last.y;
|
|
236
|
+
};
|
|
237
|
+
export const splineSegments = points => points.slice(0, -1).map((from, index) => {
|
|
238
|
+
var _points, _points2;
|
|
239
|
+
const before = (_points = points[index - 1]) != null ? _points : from;
|
|
240
|
+
const to = points[index + 1];
|
|
241
|
+
const after = (_points2 = points[index + 2]) != null ? _points2 : to;
|
|
242
|
+
return {
|
|
243
|
+
from,
|
|
244
|
+
c1: {
|
|
245
|
+
x: from.x + (to.x - before.x) / 6,
|
|
246
|
+
y: from.y + (to.y - before.y) / 6
|
|
247
|
+
},
|
|
248
|
+
c2: {
|
|
249
|
+
x: to.x - (after.x - from.x) / 6,
|
|
250
|
+
y: to.y - (after.y - from.y) / 6
|
|
251
|
+
},
|
|
252
|
+
to
|
|
253
|
+
};
|
|
254
|
+
});
|
|
255
|
+
const cubicAt = (segment, t) => {
|
|
256
|
+
const u = 1 - t;
|
|
257
|
+
const a = u * u * u;
|
|
258
|
+
const b = 3 * u * u * t;
|
|
259
|
+
const c = 3 * u * t * t;
|
|
260
|
+
const e = t * t * t;
|
|
261
|
+
return {
|
|
262
|
+
x: a * segment.from.x + b * segment.c1.x + c * segment.c2.x + e * segment.to.x,
|
|
263
|
+
y: a * segment.from.y + b * segment.c1.y + c * segment.c2.y + e * segment.to.y
|
|
264
|
+
};
|
|
265
|
+
};
|
|
266
|
+
const angleOf = (from, to) => Math.atan2(to.y - from.y, to.x - from.x);
|
|
267
|
+
export const lineGeometry = (line, start, end) => {
|
|
268
|
+
if (line.type === "curved" && line.waypoints.curved.length) {
|
|
269
|
+
const segments = splineSegments([start, ...line.waypoints.curved, end]);
|
|
270
|
+
const samples = [start];
|
|
271
|
+
const sampleSegments = [0];
|
|
272
|
+
segments.forEach((segment, index) => {
|
|
273
|
+
for (let step = 1; step <= 16; step += 1) {
|
|
274
|
+
samples.push(cubicAt(segment, step / 16));
|
|
275
|
+
sampleSegments.push(index);
|
|
276
|
+
}
|
|
277
|
+
});
|
|
278
|
+
const first = segments[0];
|
|
279
|
+
const last = segments[segments.length - 1];
|
|
280
|
+
return {
|
|
281
|
+
d: segments.reduce((path, segment) => path + " C " + segment.c1.x + " " + segment.c1.y + " " + segment.c2.x + " " + segment.c2.y + " " + segment.to.x + " " + segment.to.y, "M " + start.x + " " + start.y),
|
|
282
|
+
samples,
|
|
283
|
+
sampleSegments,
|
|
284
|
+
route: [start, ...line.waypoints.curved, end],
|
|
285
|
+
startAngle: angleOf(first.c1, start),
|
|
286
|
+
endAngle: angleOf(last.c2, end)
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
if (line.type === "elbow") {
|
|
290
|
+
var _clean$, _clean;
|
|
291
|
+
const route = elbowRoute(start, end, line.waypoints.elbow, elbowAxis(start, end, line.start_anchor));
|
|
292
|
+
const clean = dedupe(route);
|
|
293
|
+
const sampleSegments = route.map((_, index) => Math.max(0, index - 1));
|
|
294
|
+
return {
|
|
295
|
+
d: roundedPolylinePath(route, line.style.corner_radius),
|
|
296
|
+
samples: route,
|
|
297
|
+
sampleSegments,
|
|
298
|
+
route,
|
|
299
|
+
startAngle: angleOf((_clean$ = clean[1]) != null ? _clean$ : end, start),
|
|
300
|
+
endAngle: angleOf((_clean = clean[clean.length - 2]) != null ? _clean : start, end)
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
return {
|
|
304
|
+
d: "M " + start.x + " " + start.y + " L " + end.x + " " + end.y,
|
|
305
|
+
samples: [start, end],
|
|
306
|
+
sampleSegments: [0, 0],
|
|
307
|
+
route: [start, end],
|
|
308
|
+
startAngle: angleOf(end, start),
|
|
309
|
+
endAngle: angleOf(start, end)
|
|
310
|
+
};
|
|
311
|
+
};
|
|
312
|
+
const cumulative = samples => samples.reduce((acc, point, index) => [...acc, index === 0 ? 0 : acc[index - 1] + distance(samples[index - 1], point)], []);
|
|
313
|
+
export const pointAtFraction = (samples, fraction) => {
|
|
314
|
+
const lengths = cumulative(samples);
|
|
315
|
+
const target = lengths[lengths.length - 1] * fraction;
|
|
316
|
+
const index = lengths.findIndex(length => length >= target);
|
|
317
|
+
if (index <= 0) {
|
|
318
|
+
return samples[0];
|
|
319
|
+
}
|
|
320
|
+
const span = lengths[index] - lengths[index - 1] || 1;
|
|
321
|
+
const t = (target - lengths[index - 1]) / span;
|
|
322
|
+
return {
|
|
323
|
+
x: samples[index - 1].x + (samples[index].x - samples[index - 1].x) * t,
|
|
324
|
+
y: samples[index - 1].y + (samples[index].y - samples[index - 1].y) * t
|
|
325
|
+
};
|
|
326
|
+
};
|
|
327
|
+
export const projectOnSamples = (samples, sampleSegments, point) => {
|
|
328
|
+
const lengths = cumulative(samples);
|
|
329
|
+
const total = lengths[lengths.length - 1] || 1;
|
|
330
|
+
let best = {
|
|
331
|
+
fraction: 0,
|
|
332
|
+
segment: 0,
|
|
333
|
+
point: samples[0],
|
|
334
|
+
gap: Infinity
|
|
335
|
+
};
|
|
336
|
+
for (let index = 1; index < samples.length; index += 1) {
|
|
337
|
+
const a = samples[index - 1];
|
|
338
|
+
const b = samples[index];
|
|
339
|
+
const length = distance(a, b);
|
|
340
|
+
const t = length ? Math.max(0, Math.min(1, ((point.x - a.x) * (b.x - a.x) + (point.y - a.y) * (b.y - a.y)) / (length * length))) : 0;
|
|
341
|
+
const on = {
|
|
342
|
+
x: a.x + (b.x - a.x) * t,
|
|
343
|
+
y: a.y + (b.y - a.y) * t
|
|
344
|
+
};
|
|
345
|
+
const gap = distance(on, point);
|
|
346
|
+
if (gap < best.gap) {
|
|
347
|
+
best = {
|
|
348
|
+
fraction: (lengths[index - 1] + length * t) / total,
|
|
349
|
+
segment: sampleSegments[index],
|
|
350
|
+
point: on,
|
|
351
|
+
gap
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
return {
|
|
356
|
+
fraction: best.fraction,
|
|
357
|
+
segment: best.segment,
|
|
358
|
+
point: best.point
|
|
359
|
+
};
|
|
360
|
+
};
|
|
361
|
+
export const elbowSegmentIndex = (route, point) => {
|
|
362
|
+
let bestIndex = 0;
|
|
363
|
+
let bestGap = Infinity;
|
|
364
|
+
for (let index = 0; index < route.length - 1; index += 1) {
|
|
365
|
+
const projection = projectOnSamples([route[index], route[index + 1]], [index, index], point);
|
|
366
|
+
const gap = distance(projection.point, point);
|
|
367
|
+
if (gap < bestGap) {
|
|
368
|
+
bestGap = gap;
|
|
369
|
+
bestIndex = index;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
return bestIndex;
|
|
373
|
+
};
|
|
374
|
+
export const withLineType = (line, type, start, end) => {
|
|
375
|
+
if (type === "line" || line.waypoints[type].length) {
|
|
376
|
+
return _extends({}, line, {
|
|
377
|
+
type
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
const middle = midpoint(start, end);
|
|
381
|
+
const length = distance(start, end) || 1;
|
|
382
|
+
const bend = Math.min(48, length / 3);
|
|
383
|
+
const seeded = type === "curved" ? {
|
|
384
|
+
x: middle.x + (end.y - start.y) / length * bend,
|
|
385
|
+
y: middle.y - (end.x - start.x) / length * bend
|
|
386
|
+
} : middle;
|
|
387
|
+
return _extends({}, line, {
|
|
388
|
+
type,
|
|
389
|
+
waypoints: _extends({}, line.waypoints, {
|
|
390
|
+
[type]: [seeded]
|
|
391
|
+
})
|
|
392
|
+
});
|
|
393
|
+
};
|
|
394
|
+
export const constrainAngle = (from, to) => {
|
|
395
|
+
const length = distance(from, to);
|
|
396
|
+
const step = Math.PI / 4;
|
|
397
|
+
const angle = Math.round(angleOf(from, to) / step) * step;
|
|
398
|
+
return {
|
|
399
|
+
x: Math.round(from.x + Math.cos(angle) * length),
|
|
400
|
+
y: Math.round(from.y + Math.sin(angle) * length)
|
|
401
|
+
};
|
|
402
|
+
};
|
|
403
|
+
export const lineEndGlyph = (type, at, angle, width, color) => {
|
|
404
|
+
const size = 4 + width * 2;
|
|
405
|
+
const length = 8 + width * 2;
|
|
406
|
+
const spread = Math.PI / 6;
|
|
407
|
+
switch (type) {
|
|
408
|
+
case "arrow":
|
|
409
|
+
return /*#__PURE__*/React.createElement("polygon", {
|
|
410
|
+
points: at.x + "," + at.y + " " + (at.x - length * Math.cos(angle - spread)) + "," + (at.y - length * Math.sin(angle - spread)) + " " + (at.x - length * Math.cos(angle + spread)) + "," + (at.y - length * Math.sin(angle + spread)),
|
|
411
|
+
style: {
|
|
412
|
+
fill: color
|
|
413
|
+
}
|
|
414
|
+
});
|
|
415
|
+
case "dot":
|
|
416
|
+
return /*#__PURE__*/React.createElement("circle", {
|
|
417
|
+
cx: at.x,
|
|
418
|
+
cy: at.y,
|
|
419
|
+
r: size / 2,
|
|
420
|
+
style: {
|
|
421
|
+
fill: color
|
|
422
|
+
}
|
|
423
|
+
});
|
|
424
|
+
case "square":
|
|
425
|
+
return /*#__PURE__*/React.createElement("rect", {
|
|
426
|
+
x: at.x - size / 2,
|
|
427
|
+
y: at.y - size / 2,
|
|
428
|
+
width: size,
|
|
429
|
+
height: size,
|
|
430
|
+
style: {
|
|
431
|
+
fill: color
|
|
432
|
+
}
|
|
433
|
+
});
|
|
434
|
+
case "rotatedSquare":
|
|
435
|
+
return /*#__PURE__*/React.createElement("rect", {
|
|
436
|
+
x: at.x - size / 2,
|
|
437
|
+
y: at.y - size / 2,
|
|
438
|
+
width: size,
|
|
439
|
+
height: size,
|
|
440
|
+
transform: "rotate(45 " + at.x + " " + at.y + ")",
|
|
441
|
+
style: {
|
|
442
|
+
fill: color
|
|
443
|
+
}
|
|
444
|
+
});
|
|
445
|
+
case "circle":
|
|
446
|
+
return /*#__PURE__*/React.createElement("circle", {
|
|
447
|
+
cx: at.x,
|
|
448
|
+
cy: at.y,
|
|
449
|
+
r: size / 2,
|
|
450
|
+
strokeWidth: Math.max(1.5, width * 0.75),
|
|
451
|
+
style: {
|
|
452
|
+
fill: "var(--page-paper-main)",
|
|
453
|
+
stroke: color
|
|
454
|
+
}
|
|
455
|
+
});
|
|
456
|
+
default:
|
|
457
|
+
return null;
|
|
458
|
+
}
|
|
459
|
+
};
|
|
460
|
+
const GLYPH_PROPS = {
|
|
461
|
+
width: 20,
|
|
462
|
+
height: 20,
|
|
463
|
+
viewBox: "0 0 20 20",
|
|
464
|
+
fill: "none",
|
|
465
|
+
style: {
|
|
466
|
+
stroke: "currentColor"
|
|
467
|
+
},
|
|
468
|
+
strokeWidth: 1.5,
|
|
469
|
+
strokeLinecap: "round",
|
|
470
|
+
strokeLinejoin: "round"
|
|
471
|
+
};
|
|
472
|
+
const TYPE_PATHS = {
|
|
473
|
+
line: "M3 17 L17 3",
|
|
474
|
+
curved: "M3 16 C 9 16, 11 4, 17 4",
|
|
475
|
+
elbow: "M3 16 H10 V4 H17"
|
|
476
|
+
};
|
|
477
|
+
|
|
478
|
+
// ds-exception: no line-type glyphs in src/components/Icons — Design System task
|
|
479
|
+
export const LineTypeGlyph = _ref => {
|
|
480
|
+
let type = _ref.type;
|
|
481
|
+
return /*#__PURE__*/React.createElement("svg", GLYPH_PROPS, /*#__PURE__*/React.createElement("path", {
|
|
482
|
+
d: TYPE_PATHS[type]
|
|
483
|
+
}));
|
|
484
|
+
};
|
|
485
|
+
|
|
486
|
+
// ds-exception: no line-end glyphs in src/components/Icons — Design System task
|
|
487
|
+
export const LineEndGlyph = _ref2 => {
|
|
488
|
+
let type = _ref2.type,
|
|
489
|
+
side = _ref2.side;
|
|
490
|
+
const tip = side === "end" ? {
|
|
491
|
+
x: 17,
|
|
492
|
+
y: 10
|
|
493
|
+
} : {
|
|
494
|
+
x: 3,
|
|
495
|
+
y: 10
|
|
496
|
+
};
|
|
497
|
+
return /*#__PURE__*/React.createElement("svg", GLYPH_PROPS, /*#__PURE__*/React.createElement("path", {
|
|
498
|
+
d: "M3 10 H17",
|
|
499
|
+
strokeDasharray: type === "none" ? "2 2" : undefined
|
|
500
|
+
}), lineEndGlyph(type, tip, side === "end" ? 0 : Math.PI, 1.5, "currentColor"));
|
|
501
|
+
};
|
|
502
|
+
|
|
503
|
+
// ds-exception: no stroke-pattern glyphs in src/components/Icons — Design System task
|
|
504
|
+
export const LinePatternGlyph = _ref3 => {
|
|
505
|
+
let pattern = _ref3.pattern;
|
|
506
|
+
return /*#__PURE__*/React.createElement("svg", _extends({}, GLYPH_PROPS, {
|
|
507
|
+
strokeWidth: 2,
|
|
508
|
+
strokeLinecap: "butt"
|
|
509
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
510
|
+
d: "M2 10 H18",
|
|
511
|
+
strokeDasharray: dashArray(pattern, 2)
|
|
512
|
+
}));
|
|
513
|
+
};
|
|
514
|
+
|
|
515
|
+
// ds-exception: no stroke-thickness glyphs in src/components/Icons — Design System task
|
|
516
|
+
export const LineThicknessGlyph = _ref4 => {
|
|
517
|
+
let width = _ref4.width;
|
|
518
|
+
return /*#__PURE__*/React.createElement("svg", _extends({}, GLYPH_PROPS, {
|
|
519
|
+
strokeWidth: width
|
|
520
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
521
|
+
d: "M3 10 H17"
|
|
522
|
+
}));
|
|
523
|
+
};
|
|
524
|
+
|
|
525
|
+
// ds-exception: no corner-radius glyph in src/components/Icons — Design System task
|
|
526
|
+
export const CornerRadiusGlyph = _ref5 => {
|
|
527
|
+
let radius = _ref5.radius;
|
|
528
|
+
const size = Math.min(10, radius / 4);
|
|
529
|
+
return /*#__PURE__*/React.createElement("svg", GLYPH_PROPS, /*#__PURE__*/React.createElement("path", {
|
|
530
|
+
d: size ? "M4 17 V" + (4 + size) + " A" + size + " " + size + " 0 0 1 " + (4 + size) + " 4 H17" : "M4 17 V4 H17"
|
|
531
|
+
}));
|
|
532
|
+
};
|
|
533
|
+
const boxCenter = box => ({
|
|
534
|
+
x: box.x + box.width / 2,
|
|
535
|
+
y: box.y + box.height / 2
|
|
536
|
+
});
|
|
537
|
+
export const resolveEndpoints = (line, boxOf) => {
|
|
538
|
+
var _line$start_anchor, _bends$, _line$end_anchor, _bends;
|
|
539
|
+
if (line.kind !== "connector") {
|
|
540
|
+
return {
|
|
541
|
+
start: line.start,
|
|
542
|
+
end: line.end
|
|
543
|
+
};
|
|
544
|
+
}
|
|
545
|
+
const from = line.start_element_id ? boxOf(line.start_element_id) : null;
|
|
546
|
+
const to = line.end_element_id ? boxOf(line.end_element_id) : null;
|
|
547
|
+
const fromCenter = from ? boxCenter(from) : line.start;
|
|
548
|
+
const toCenter = to ? boxCenter(to) : line.end;
|
|
549
|
+
const bends = line.type === "curved" ? line.waypoints.curved : [];
|
|
550
|
+
return {
|
|
551
|
+
start: from ? anchorPoint(from, (_line$start_anchor = line.start_anchor) != null ? _line$start_anchor : "center", (_bends$ = bends[0]) != null ? _bends$ : toCenter) : line.start,
|
|
552
|
+
end: to ? anchorPoint(to, (_line$end_anchor = line.end_anchor) != null ? _line$end_anchor : "center", (_bends = bends[bends.length - 1]) != null ? _bends : fromCenter) : line.end
|
|
553
|
+
};
|
|
554
|
+
};
|
|
555
|
+
//# sourceMappingURL=lineModel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lineModel.js","names":["React","MAX_WAYPOINTS","LINE_HIT_WIDTH","LINE_DEFAULT_LENGTH","LINE_TYPE_OPTIONS","id","name","LINE_END_OPTIONS","LINE_PATTERN_OPTIONS","ANCHOR_OPTIONS","optionName","options","_options$find$name","_options$find","find","option","DEFAULT_LINE_STYLE","stroke","stroke_opacity","stroke_width","stroke_pattern","arrow_start","arrow_end","corner_radius","DEFAULT_LABEL","text","position","font_size","bold","italic","underline","strikethrough","dashArray","pattern","width","undefined","distance","a","b","Math","hypot","x","y","towards","from","to","length","total","midpoint","dedupe","points","filter","point","index","anchorPoint","box","anchor","toward","cx","cy","height","left","right","top","bottom","dx","dy","scale","min","abs","Infinity","Number","isFinite","elbowAxis","start","end","barIsVertical","axis","elbowRoute","bars","effective","current","forEach","bar","push","roundedPolylinePath","raw","radius","d","before","corner","after","size","enter","leave","last","splineSegments","slice","map","_points","_points2","c1","c2","cubicAt","segment","t","u","c","e","angleOf","atan2","lineGeometry","line","type","waypoints","curved","segments","samples","sampleSegments","step","first","reduce","path","route","startAngle","endAngle","_clean$","_clean","elbow","start_anchor","clean","_","max","style","cumulative","acc","pointAtFraction","fraction","lengths","target","findIndex","span","projectOnSamples","best","gap","on","elbowSegmentIndex","bestIndex","bestGap","projection","withLineType","_extends","middle","bend","seeded","constrainAngle","PI","angle","round","cos","sin","lineEndGlyph","at","color","spread","createElement","fill","r","transform","strokeWidth","GLYPH_PROPS","viewBox","strokeLinecap","strokeLinejoin","TYPE_PATHS","LineTypeGlyph","_ref","LineEndGlyph","_ref2","side","tip","strokeDasharray","LinePatternGlyph","_ref3","LineThicknessGlyph","_ref4","CornerRadiusGlyph","_ref5","boxCenter","resolveEndpoints","boxOf","_line$start_anchor","_bends$","_line$end_anchor","_bends","kind","start_element_id","end_element_id","fromCenter","toCenter","bends","end_anchor"],"sources":["../../../../src/presentation/whiteboard/lineModel.tsx"],"sourcesContent":["import React, { ReactElement } from \"react\";\n\nexport interface Point {\n x: number;\n y: number;\n}\n\nexport interface Box {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\nexport type LineType = \"line\" | \"curved\" | \"elbow\";\nexport type LineEndType =\n | \"none\"\n | \"arrow\"\n | \"dot\"\n | \"square\"\n | \"rotatedSquare\"\n | \"circle\";\nexport type LinePattern = \"solid\" | \"dashed\" | \"dotted\";\nexport type ConnectionAnchor =\n | \"center\"\n | \"top-left\"\n | \"top\"\n | \"top-right\"\n | \"right\"\n | \"bottom-right\"\n | \"bottom\"\n | \"bottom-left\"\n | \"left\";\n\n// mirrors: new-activecollab-front Whiteboards connection `style` (ArrowFormattingToolbar defaults); corner_radius: no payload yet\nexport interface LineStyle {\n stroke: string;\n stroke_opacity: number;\n stroke_width: number;\n stroke_pattern: LinePattern;\n arrow_start: LineEndType;\n arrow_end: LineEndType;\n corner_radius: number;\n}\n\n// mirrors: no payload yet\nexport interface LineLabel {\n text: string;\n position: number;\n font_size: number;\n bold: boolean;\n italic: boolean;\n underline: boolean;\n strikethrough: boolean;\n}\n\n// mirrors: no payload yet\nexport interface LineWaypoints {\n curved: Point[];\n elbow: Point[];\n}\n\n// mirrors: new-activecollab-front Whiteboards connectionShape (type, start_element_id, end_element_id, start_anchor, end_anchor, style); line fields, waypoints and label: no payload yet\nexport interface BoardLine {\n id: string;\n kind: \"line\" | \"connector\";\n name: string | null;\n type: LineType;\n start: Point;\n end: Point;\n start_element_id?: string;\n end_element_id?: string;\n start_anchor?: ConnectionAnchor;\n end_anchor?: ConnectionAnchor;\n waypoints: LineWaypoints;\n style: LineStyle;\n label: LineLabel | null;\n}\n\nexport const MAX_WAYPOINTS = 20;\nexport const LINE_HIT_WIDTH = 10;\nexport const LINE_DEFAULT_LENGTH = 160;\n\nexport const LINE_TYPE_OPTIONS: { id: LineType; name: string }[] = [\n { id: \"line\", name: \"Straight\" },\n { id: \"curved\", name: \"Curved\" },\n { id: \"elbow\", name: \"Elbow\" },\n];\n\nexport const LINE_END_OPTIONS: { id: LineEndType; name: string }[] = [\n { id: \"none\", name: \"None\" },\n { id: \"arrow\", name: \"Arrow\" },\n { id: \"dot\", name: \"Dot\" },\n { id: \"square\", name: \"Square\" },\n { id: \"rotatedSquare\", name: \"Rotated Square\" },\n { id: \"circle\", name: \"Circle\" },\n];\n\nexport const LINE_PATTERN_OPTIONS: { id: LinePattern; name: string }[] = [\n { id: \"solid\", name: \"Solid\" },\n { id: \"dashed\", name: \"Dashed\" },\n { id: \"dotted\", name: \"Dotted\" },\n];\n\nexport const ANCHOR_OPTIONS: { id: ConnectionAnchor; name: string }[] = [\n { id: \"center\", name: \"Center\" },\n { id: \"top-left\", name: \"Top Left\" },\n { id: \"top\", name: \"Top\" },\n { id: \"top-right\", name: \"Top Right\" },\n { id: \"right\", name: \"Right\" },\n { id: \"bottom-right\", name: \"Bottom Right\" },\n { id: \"bottom\", name: \"Bottom\" },\n { id: \"bottom-left\", name: \"Bottom Left\" },\n { id: \"left\", name: \"Left\" },\n];\n\nexport const optionName = <T extends string>(\n options: { id: T; name: string }[],\n id: T | undefined\n): string => options.find((option) => option.id === id)?.name ?? \"\";\n\nexport const DEFAULT_LINE_STYLE: LineStyle = {\n stroke: \"default\",\n stroke_opacity: 100,\n stroke_width: 2,\n stroke_pattern: \"solid\",\n arrow_start: \"none\",\n arrow_end: \"none\",\n corner_radius: 0,\n};\n\nexport const DEFAULT_LABEL: LineLabel = {\n text: \"\",\n position: 0.5,\n font_size: 13,\n bold: false,\n italic: false,\n underline: false,\n strikethrough: false,\n};\n\nexport const dashArray = (\n pattern: LinePattern,\n width: number\n): string | undefined =>\n pattern === \"dashed\"\n ? `${width * 4} ${width * 3}`\n : pattern === \"dotted\"\n ? `${width} ${width * 2}`\n : undefined;\n\nconst distance = (a: Point, b: Point): number =>\n Math.hypot(b.x - a.x, b.y - a.y);\n\nconst towards = (from: Point, to: Point, length: number): Point => {\n const total = distance(from, to) || 1;\n\n return {\n x: from.x + ((to.x - from.x) * length) / total,\n y: from.y + ((to.y - from.y) * length) / total,\n };\n};\n\nconst midpoint = (a: Point, b: Point): Point => ({\n x: (a.x + b.x) / 2,\n y: (a.y + b.y) / 2,\n});\n\nconst dedupe = (points: Point[]): Point[] =>\n points.filter(\n (point, index) => index === 0 || distance(points[index - 1], point) > 0.5\n );\n\nexport const anchorPoint = (\n box: Box,\n anchor: ConnectionAnchor,\n toward: Point\n): Point => {\n const cx = box.x + box.width / 2;\n const cy = box.y + box.height / 2;\n const left = box.x;\n const right = box.x + box.width;\n const top = box.y;\n const bottom = box.y + box.height;\n\n switch (anchor) {\n case \"top-left\":\n return { x: left, y: top };\n case \"top\":\n return { x: cx, y: top };\n case \"top-right\":\n return { x: right, y: top };\n case \"right\":\n return { x: right, y: cy };\n case \"bottom-right\":\n return { x: right, y: bottom };\n case \"bottom\":\n return { x: cx, y: bottom };\n case \"bottom-left\":\n return { x: left, y: bottom };\n case \"left\":\n return { x: left, y: cy };\n default: {\n const dx = toward.x - cx;\n const dy = toward.y - cy;\n const scale = Math.min(\n dx ? box.width / 2 / Math.abs(dx) : Infinity,\n dy ? box.height / 2 / Math.abs(dy) : Infinity\n );\n\n return Number.isFinite(scale)\n ? { x: cx + dx * scale, y: cy + dy * scale }\n : { x: cx, y: cy };\n }\n }\n};\n\nexport const elbowAxis = (\n start: Point,\n end: Point,\n anchor?: ConnectionAnchor\n): \"h\" | \"v\" => {\n if (anchor === \"left\" || anchor === \"right\") {\n return \"h\";\n }\n\n if (anchor === \"top\" || anchor === \"bottom\") {\n return \"v\";\n }\n\n return Math.abs(end.x - start.x) >= Math.abs(end.y - start.y) ? \"h\" : \"v\";\n};\n\nexport const barIsVertical = (index: number, axis: \"h\" | \"v\"): boolean =>\n (index % 2 === 0) === (axis === \"h\");\n\nexport const elbowRoute = (\n start: Point,\n end: Point,\n bars: Point[],\n axis: \"h\" | \"v\"\n): Point[] => {\n const effective = bars.length ? bars : [midpoint(start, end)];\n const points = [start];\n let current = start;\n\n effective.forEach((bar, index) => {\n current = barIsVertical(index, axis)\n ? { x: bar.x, y: current.y }\n : { x: current.x, y: bar.y };\n points.push(current);\n });\n\n points.push(\n barIsVertical(effective.length - 1, axis)\n ? { x: current.x, y: end.y }\n : { x: end.x, y: current.y }\n );\n points.push(end);\n\n return points;\n};\n\nexport const roundedPolylinePath = (raw: Point[], radius: number): string => {\n const points = dedupe(raw);\n\n if (points.length < 2) {\n return \"\";\n }\n\n let d = `M ${points[0].x} ${points[0].y}`;\n\n for (let index = 1; index < points.length - 1; index += 1) {\n const before = points[index - 1];\n const corner = points[index];\n const after = points[index + 1];\n const size = Math.min(\n radius,\n distance(before, corner) / 2,\n distance(corner, after) / 2\n );\n\n if (size < 0.5) {\n d += ` L ${corner.x} ${corner.y}`;\n } else {\n const enter = towards(corner, before, size);\n const leave = towards(corner, after, size);\n d += ` L ${enter.x} ${enter.y} Q ${corner.x} ${corner.y} ${leave.x} ${leave.y}`;\n }\n }\n\n const last = points[points.length - 1];\n\n return `${d} L ${last.x} ${last.y}`;\n};\n\ninterface CubicSegment {\n from: Point;\n c1: Point;\n c2: Point;\n to: Point;\n}\n\nexport const splineSegments = (points: Point[]): CubicSegment[] =>\n points.slice(0, -1).map((from, index) => {\n const before = points[index - 1] ?? from;\n const to = points[index + 1];\n const after = points[index + 2] ?? to;\n\n return {\n from,\n c1: {\n x: from.x + (to.x - before.x) / 6,\n y: from.y + (to.y - before.y) / 6,\n },\n c2: {\n x: to.x - (after.x - from.x) / 6,\n y: to.y - (after.y - from.y) / 6,\n },\n to,\n };\n });\n\nconst cubicAt = (segment: CubicSegment, t: number): Point => {\n const u = 1 - t;\n const a = u * u * u;\n const b = 3 * u * u * t;\n const c = 3 * u * t * t;\n const e = t * t * t;\n\n return {\n x:\n a * segment.from.x +\n b * segment.c1.x +\n c * segment.c2.x +\n e * segment.to.x,\n y:\n a * segment.from.y +\n b * segment.c1.y +\n c * segment.c2.y +\n e * segment.to.y,\n };\n};\n\nconst angleOf = (from: Point, to: Point): number =>\n Math.atan2(to.y - from.y, to.x - from.x);\n\nexport interface LineGeometry {\n d: string;\n samples: Point[];\n sampleSegments: number[];\n route: Point[];\n startAngle: number;\n endAngle: number;\n}\n\nexport const lineGeometry = (\n line: BoardLine,\n start: Point,\n end: Point\n): LineGeometry => {\n if (line.type === \"curved\" && line.waypoints.curved.length) {\n const segments = splineSegments([start, ...line.waypoints.curved, end]);\n const samples: Point[] = [start];\n const sampleSegments: number[] = [0];\n\n segments.forEach((segment, index) => {\n for (let step = 1; step <= 16; step += 1) {\n samples.push(cubicAt(segment, step / 16));\n sampleSegments.push(index);\n }\n });\n\n const first = segments[0];\n const last = segments[segments.length - 1];\n\n return {\n d: segments.reduce(\n (path, segment) =>\n `${path} C ${segment.c1.x} ${segment.c1.y} ${segment.c2.x} ${segment.c2.y} ${segment.to.x} ${segment.to.y}`,\n `M ${start.x} ${start.y}`\n ),\n samples,\n sampleSegments,\n route: [start, ...line.waypoints.curved, end],\n startAngle: angleOf(first.c1, start),\n endAngle: angleOf(last.c2, end),\n };\n }\n\n if (line.type === \"elbow\") {\n const route = elbowRoute(\n start,\n end,\n line.waypoints.elbow,\n elbowAxis(start, end, line.start_anchor)\n );\n const clean = dedupe(route);\n const sampleSegments = route.map((_, index) => Math.max(0, index - 1));\n\n return {\n d: roundedPolylinePath(route, line.style.corner_radius),\n samples: route,\n sampleSegments,\n route,\n startAngle: angleOf(clean[1] ?? end, start),\n endAngle: angleOf(clean[clean.length - 2] ?? start, end),\n };\n }\n\n return {\n d: `M ${start.x} ${start.y} L ${end.x} ${end.y}`,\n samples: [start, end],\n sampleSegments: [0, 0],\n route: [start, end],\n startAngle: angleOf(end, start),\n endAngle: angleOf(start, end),\n };\n};\n\nconst cumulative = (samples: Point[]): number[] =>\n samples.reduce<number[]>(\n (acc, point, index) => [\n ...acc,\n index === 0 ? 0 : acc[index - 1] + distance(samples[index - 1], point),\n ],\n []\n );\n\nexport const pointAtFraction = (samples: Point[], fraction: number): Point => {\n const lengths = cumulative(samples);\n const target = lengths[lengths.length - 1] * fraction;\n const index = lengths.findIndex((length) => length >= target);\n\n if (index <= 0) {\n return samples[0];\n }\n\n const span = lengths[index] - lengths[index - 1] || 1;\n const t = (target - lengths[index - 1]) / span;\n\n return {\n x: samples[index - 1].x + (samples[index].x - samples[index - 1].x) * t,\n y: samples[index - 1].y + (samples[index].y - samples[index - 1].y) * t,\n };\n};\n\nexport interface Projection {\n fraction: number;\n segment: number;\n point: Point;\n}\n\nexport const projectOnSamples = (\n samples: Point[],\n sampleSegments: number[],\n point: Point\n): Projection => {\n const lengths = cumulative(samples);\n const total = lengths[lengths.length - 1] || 1;\n let best: Projection & { gap: number } = {\n fraction: 0,\n segment: 0,\n point: samples[0],\n gap: Infinity,\n };\n\n for (let index = 1; index < samples.length; index += 1) {\n const a = samples[index - 1];\n const b = samples[index];\n const length = distance(a, b);\n const t = length\n ? Math.max(\n 0,\n Math.min(\n 1,\n ((point.x - a.x) * (b.x - a.x) + (point.y - a.y) * (b.y - a.y)) /\n (length * length)\n )\n )\n : 0;\n const on = { x: a.x + (b.x - a.x) * t, y: a.y + (b.y - a.y) * t };\n const gap = distance(on, point);\n\n if (gap < best.gap) {\n best = {\n fraction: (lengths[index - 1] + length * t) / total,\n segment: sampleSegments[index],\n point: on,\n gap,\n };\n }\n }\n\n return { fraction: best.fraction, segment: best.segment, point: best.point };\n};\n\nexport const elbowSegmentIndex = (route: Point[], point: Point): number => {\n let bestIndex = 0;\n let bestGap = Infinity;\n\n for (let index = 0; index < route.length - 1; index += 1) {\n const projection = projectOnSamples(\n [route[index], route[index + 1]],\n [index, index],\n point\n );\n const gap = distance(projection.point, point);\n\n if (gap < bestGap) {\n bestGap = gap;\n bestIndex = index;\n }\n }\n\n return bestIndex;\n};\n\nexport const withLineType = (\n line: BoardLine,\n type: LineType,\n start: Point,\n end: Point\n): BoardLine => {\n if (type === \"line\" || line.waypoints[type].length) {\n return { ...line, type };\n }\n\n const middle = midpoint(start, end);\n const length = distance(start, end) || 1;\n const bend = Math.min(48, length / 3);\n const seeded =\n type === \"curved\"\n ? {\n x: middle.x + ((end.y - start.y) / length) * bend,\n y: middle.y - ((end.x - start.x) / length) * bend,\n }\n : middle;\n\n return {\n ...line,\n type,\n waypoints: { ...line.waypoints, [type]: [seeded] },\n };\n};\n\nexport const constrainAngle = (from: Point, to: Point): Point => {\n const length = distance(from, to);\n const step = Math.PI / 4;\n const angle = Math.round(angleOf(from, to) / step) * step;\n\n return {\n x: Math.round(from.x + Math.cos(angle) * length),\n y: Math.round(from.y + Math.sin(angle) * length),\n };\n};\n\nexport const lineEndGlyph = (\n type: LineEndType,\n at: Point,\n angle: number,\n width: number,\n color: string\n): ReactElement | null => {\n const size = 4 + width * 2;\n const length = 8 + width * 2;\n const spread = Math.PI / 6;\n\n switch (type) {\n case \"arrow\":\n return (\n <polygon\n points={`${at.x},${at.y} ${\n at.x - length * Math.cos(angle - spread)\n },${at.y - length * Math.sin(angle - spread)} ${\n at.x - length * Math.cos(angle + spread)\n },${at.y - length * Math.sin(angle + spread)}`}\n style={{ fill: color }}\n />\n );\n case \"dot\":\n return (\n <circle cx={at.x} cy={at.y} r={size / 2} style={{ fill: color }} />\n );\n case \"square\":\n return (\n <rect\n x={at.x - size / 2}\n y={at.y - size / 2}\n width={size}\n height={size}\n style={{ fill: color }}\n />\n );\n case \"rotatedSquare\":\n return (\n <rect\n x={at.x - size / 2}\n y={at.y - size / 2}\n width={size}\n height={size}\n transform={`rotate(45 ${at.x} ${at.y})`}\n style={{ fill: color }}\n />\n );\n case \"circle\":\n return (\n <circle\n cx={at.x}\n cy={at.y}\n r={size / 2}\n strokeWidth={Math.max(1.5, width * 0.75)}\n style={{ fill: \"var(--page-paper-main)\", stroke: color }}\n />\n );\n default:\n return null;\n }\n};\n\nconst GLYPH_PROPS = {\n width: 20,\n height: 20,\n viewBox: \"0 0 20 20\",\n fill: \"none\",\n style: { stroke: \"currentColor\" },\n strokeWidth: 1.5,\n strokeLinecap: \"round\" as const,\n strokeLinejoin: \"round\" as const,\n};\n\nconst TYPE_PATHS: Record<LineType, string> = {\n line: \"M3 17 L17 3\",\n curved: \"M3 16 C 9 16, 11 4, 17 4\",\n elbow: \"M3 16 H10 V4 H17\",\n};\n\n// ds-exception: no line-type glyphs in src/components/Icons — Design System task\nexport const LineTypeGlyph = ({ type }: { type: LineType }): ReactElement => (\n <svg {...GLYPH_PROPS}>\n <path d={TYPE_PATHS[type]} />\n </svg>\n);\n\n// ds-exception: no line-end glyphs in src/components/Icons — Design System task\nexport const LineEndGlyph = ({\n type,\n side,\n}: {\n type: LineEndType;\n side: \"start\" | \"end\";\n}): ReactElement => {\n const tip = side === \"end\" ? { x: 17, y: 10 } : { x: 3, y: 10 };\n\n return (\n <svg {...GLYPH_PROPS}>\n <path\n d=\"M3 10 H17\"\n strokeDasharray={type === \"none\" ? \"2 2\" : undefined}\n />\n {lineEndGlyph(\n type,\n tip,\n side === \"end\" ? 0 : Math.PI,\n 1.5,\n \"currentColor\"\n )}\n </svg>\n );\n};\n\n// ds-exception: no stroke-pattern glyphs in src/components/Icons — Design System task\nexport const LinePatternGlyph = ({\n pattern,\n}: {\n pattern: LinePattern;\n}): ReactElement => (\n <svg {...GLYPH_PROPS} strokeWidth={2} strokeLinecap=\"butt\">\n <path d=\"M2 10 H18\" strokeDasharray={dashArray(pattern, 2)} />\n </svg>\n);\n\n// ds-exception: no stroke-thickness glyphs in src/components/Icons — Design System task\nexport const LineThicknessGlyph = ({\n width,\n}: {\n width: number;\n}): ReactElement => (\n <svg {...GLYPH_PROPS} strokeWidth={width}>\n <path d=\"M3 10 H17\" />\n </svg>\n);\n\n// ds-exception: no corner-radius glyph in src/components/Icons — Design System task\nexport const CornerRadiusGlyph = ({\n radius,\n}: {\n radius: number;\n}): ReactElement => {\n const size = Math.min(10, radius / 4);\n\n return (\n <svg {...GLYPH_PROPS}>\n <path\n d={\n size\n ? `M4 17 V${4 + size} A${size} ${size} 0 0 1 ${4 + size} 4 H17`\n : \"M4 17 V4 H17\"\n }\n />\n </svg>\n );\n};\n\nconst boxCenter = (box: Box): Point => ({\n x: box.x + box.width / 2,\n y: box.y + box.height / 2,\n});\n\nexport const resolveEndpoints = (\n line: BoardLine,\n boxOf: (id: string) => Box | null\n): { start: Point; end: Point } => {\n if (line.kind !== \"connector\") {\n return { start: line.start, end: line.end };\n }\n\n const from = line.start_element_id ? boxOf(line.start_element_id) : null;\n const to = line.end_element_id ? boxOf(line.end_element_id) : null;\n const fromCenter = from ? boxCenter(from) : line.start;\n const toCenter = to ? boxCenter(to) : line.end;\n const bends = line.type === \"curved\" ? line.waypoints.curved : [];\n\n return {\n start: from\n ? anchorPoint(from, line.start_anchor ?? \"center\", bends[0] ?? toCenter)\n : line.start,\n end: to\n ? anchorPoint(\n to,\n line.end_anchor ?? \"center\",\n bends[bends.length - 1] ?? fromCenter\n )\n : line.end,\n };\n};\n"],"mappings":";AAAA,OAAOA,KAAK,MAAwB,OAAO;;AAkC3C;;AAWA;;AAWA;;AAMA;;AAiBA,OAAO,M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A,GAAEQ,KAAK,CAAC,CAAC,CAAC,YAAAR,OAAA,GAAIO,QAAQ,CAAC,GACtEvF,IAAI,CAACtC,KAAK;IACdC,GAAG,EAAE9B,EAAE,GACHS,WAAW,CACTT,EAAE,GAAAoJ,gBAAA,GACFjF,IAAI,CAACyF,UAAU,YAAAR,gBAAA,GAAI,QAAQ,GAAAC,MAAA,GAC3BM,KAAK,CAACA,KAAK,CAAC1J,MAAM,GAAG,CAAC,CAAC,YAAAoJ,MAAA,GAAII,UAC7B,CAAC,GACDtF,IAAI,CAACrC;EACX,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ReactElement } from "react";
|
|
2
2
|
import { ProjectElementDef } from "./projectElements";
|
|
3
|
-
export type OutlineElementType = "circle" | "roundedRectangle" | "triangle" | "postit" | "text" | "freehand" | "link" | "file" | "task" | "project" | "person";
|
|
3
|
+
export type OutlineElementType = "circle" | "roundedRectangle" | "triangle" | "postit" | "text" | "freehand" | "link" | "file" | "task" | "project" | "person" | "line" | "connector";
|
|
4
4
|
export type OutlineIcon = React.ComponentType<React.SVGProps<SVGSVGElement>>;
|
|
5
5
|
export declare const OUTLINE_TYPE_ICONS: Record<OutlineElementType, OutlineIcon>;
|
|
6
6
|
export declare const OUTLINE_TYPE_LABELS: Record<OutlineElementType, string>;
|
|
@@ -104,6 +104,8 @@ export interface LeftSidebarProps {
|
|
|
104
104
|
projectElements: ProjectElementDef[];
|
|
105
105
|
locks: Record<string, boolean>;
|
|
106
106
|
onToggleElementLock: (id: string) => void;
|
|
107
|
+
extraRows?: OutlineElement[];
|
|
108
|
+
onRenameExtraRow?: (id: string, name: string) => void;
|
|
107
109
|
}
|
|
108
|
-
export declare const LeftSidebar: ({ selectedId, onSelect, activePanel, onPanelChange, sidebarOpen, onToggleSidebar, boardName, onRenameBoard, projectElements, locks, onToggleElementLock, }: LeftSidebarProps) => ReactElement;
|
|
110
|
+
export declare const LeftSidebar: ({ selectedId, onSelect, activePanel, onPanelChange, sidebarOpen, onToggleSidebar, boardName, onRenameBoard, projectElements, locks, onToggleElementLock, extraRows, onRenameExtraRow, }: LeftSidebarProps) => ReactElement;
|
|
109
111
|
//# sourceMappingURL=outline.d.ts.map
|