@daasboard/editor 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +5 -0
- package/README.md +6 -2
- package/dist/camera/CameraInput.d.ts +106 -0
- package/dist/camera/CameraInput.js +398 -0
- package/dist/clipboard/ObjectClipboard.d.ts +40 -0
- package/dist/clipboard/ObjectClipboard.js +243 -0
- package/dist/clipboard/PasteCommitError.d.ts +4 -0
- package/dist/clipboard/PasteCommitError.js +7 -0
- package/dist/clipboard/carrier.d.ts +5 -0
- package/dist/clipboard/carrier.js +59 -0
- package/dist/clipboard/objects.d.ts +21 -0
- package/dist/clipboard/objects.js +362 -0
- package/dist/clipboard/placement.d.ts +11 -0
- package/dist/clipboard/placement.js +21 -0
- package/dist/clipboard/systemImages.d.ts +1 -0
- package/dist/clipboard/systemImages.js +24 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +22 -0
- package/dist/input/TouchInput.d.ts +159 -0
- package/dist/input/TouchInput.js +656 -0
- package/dist/input/visiblePart.d.ts +8 -0
- package/dist/input/visiblePart.js +15 -0
- package/dist/interaction/InteractionLayer.d.ts +83 -0
- package/dist/interaction/InteractionLayer.js +520 -0
- package/dist/props/PropertyController.d.ts +130 -0
- package/dist/props/PropertyController.js +1448 -0
- package/dist/props/PropertyRegistry.d.ts +38 -0
- package/dist/props/PropertyRegistry.js +21 -0
- package/dist/props/builtinProperties.d.ts +23 -0
- package/dist/props/builtinProperties.js +350 -0
- package/dist/props/defaults.d.ts +6 -0
- package/dist/props/defaults.js +29 -0
- package/dist/selection/SelectionModel.d.ts +25 -0
- package/dist/selection/SelectionModel.js +79 -0
- package/dist/text/CanvasEditorView.d.ts +99 -0
- package/dist/text/CanvasEditorView.js +308 -0
- package/dist/text/InputSink.d.ts +157 -0
- package/dist/text/InputSink.js +841 -0
- package/dist/text/TextEditSession.d.ts +173 -0
- package/dist/text/TextEditSession.js +1328 -0
- package/dist/text/clipboard.d.ts +11 -0
- package/dist/text/clipboard.js +489 -0
- package/dist/text/commands.d.ts +48 -0
- package/dist/text/commands.js +329 -0
- package/dist/text/contextMirror.d.ts +51 -0
- package/dist/text/contextMirror.js +292 -0
- package/dist/text/flat.d.ts +35 -0
- package/dist/text/flat.js +556 -0
- package/dist/text/graphemes.d.ts +16 -0
- package/dist/text/graphemes.js +219 -0
- package/dist/text/index.d.ts +13 -0
- package/dist/text/index.js +13 -0
- package/dist/text/inputReducer.d.ts +24 -0
- package/dist/text/inputReducer.js +44 -0
- package/dist/text/keymap.d.ts +17 -0
- package/dist/text/keymap.js +148 -0
- package/dist/text/schema.d.ts +12 -0
- package/dist/text/schema.js +44 -0
- package/dist/text/sessionFocus.d.ts +20 -0
- package/dist/text/sessionFocus.js +51 -0
- package/dist/text/types.d.ts +114 -0
- package/dist/text/types.js +1 -0
- package/dist/tools/CreateTool.d.ts +78 -0
- package/dist/tools/CreateTool.js +258 -0
- package/dist/tools/SelectTool.d.ts +155 -0
- package/dist/tools/SelectTool.js +808 -0
- package/dist/tools/ToolManager.d.ts +63 -0
- package/dist/tools/ToolManager.js +146 -0
- package/dist/tools/connectorEndpoints.d.ts +17 -0
- package/dist/tools/connectorEndpoints.js +53 -0
- package/dist/tools/frameRotation.d.ts +8 -0
- package/dist/tools/frameRotation.js +66 -0
- package/dist/tools/gradientHandles.d.ts +67 -0
- package/dist/tools/gradientHandles.js +110 -0
- package/dist/tools/presetPaths.d.ts +5 -0
- package/dist/tools/presetPaths.js +49 -0
- package/dist/tools/snapResize.d.ts +7 -0
- package/dist/tools/snapResize.js +65 -0
- package/dist/tools/snapping.d.ts +30 -0
- package/dist/tools/snapping.js +280 -0
- package/dist/tools/transform.d.ts +52 -0
- package/dist/tools/transform.js +277 -0
- package/package.json +36 -3
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
import { CONTAINER_KINDS, normalize, normalizeNode, normalizeTextContent, resolveStyle, sceneState, validateThumbHash } from "@daasboard/doc";
|
|
2
|
+
export const OBJECTS_MIME = "application/x-daas-objects+json";
|
|
3
|
+
export const MAX_CLIPBOARD_BYTES = 2 * 1024 * 1024;
|
|
4
|
+
export const MAX_CLIPBOARD_OBJECTS = 10_000;
|
|
5
|
+
export const MAX_CLIPBOARD_DEPTH = 256;
|
|
6
|
+
export const MAX_ASSET_SHARE_URL_LENGTH = 4096;
|
|
7
|
+
const KINDS = new Set(["rect", "ellipse", "path", "text", "image", "connector", "frame", "section", "group", "sticky", "embed", "instance"]);
|
|
8
|
+
const ARROWS = ["none", "arrow", "triangle", "triangle-open", "triangle-skinny", "circle", "circle-open", "diamond", "diamond-open", "square", "square-open", "bar", "crow"];
|
|
9
|
+
const ALIGN = ["left", "center", "right", "justify"];
|
|
10
|
+
const CASE = ["none", "upper", "lower"];
|
|
11
|
+
const record = (v) => !!v && typeof v === "object" && !Array.isArray(v);
|
|
12
|
+
const finite = (v) => typeof v === "number" && Number.isFinite(v);
|
|
13
|
+
const positive = (v) => finite(v) && v > 0;
|
|
14
|
+
const nonnegative = (v) => finite(v) && v >= 0;
|
|
15
|
+
const word = (v) => typeof v === "string" && v.length > 0;
|
|
16
|
+
const oneOf = (v, values) => typeof v === "string" && values.includes(v);
|
|
17
|
+
const point = (v) => Array.isArray(v) && v.length === 2 && v.every(finite);
|
|
18
|
+
const color = (v) => typeof v === "string" && /^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i.test(v);
|
|
19
|
+
const safeKey = (v) => !["__proto__", "constructor", "prototype"].includes(v);
|
|
20
|
+
const cleanText = (v) => v.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDFFF]/g, (s) => s.length === 2 ? s : "\uFFFD").replace(/\r\n?/g, "\n").replace(/[^\P{Cc}\t\n]/gu, "");
|
|
21
|
+
function safeUrl(v) {
|
|
22
|
+
if (!word(v))
|
|
23
|
+
return undefined;
|
|
24
|
+
const url = v.trim();
|
|
25
|
+
if (!url || /[\u0000-\u0020\u007f]/u.test(url))
|
|
26
|
+
return undefined;
|
|
27
|
+
const scheme = /^([a-z][a-z0-9+.-]*):/i.exec(url)?.[1]?.toLowerCase();
|
|
28
|
+
return !scheme || ["http", "https", "mailto", "tel"].includes(scheme) ? url : undefined;
|
|
29
|
+
}
|
|
30
|
+
function paint(v) {
|
|
31
|
+
if (color(v))
|
|
32
|
+
return v;
|
|
33
|
+
if (!record(v) || !Array.isArray(v.stops))
|
|
34
|
+
return undefined;
|
|
35
|
+
const stops = v.stops.filter((s) => record(s) && finite(s.at) && s.at >= 0 && s.at <= 1 && color(s.color))
|
|
36
|
+
.map((s) => ({ at: s.at, color: s.color }));
|
|
37
|
+
if (stops.length < 2)
|
|
38
|
+
return undefined;
|
|
39
|
+
if (v.type === "linear" && point(v.start) && point(v.end))
|
|
40
|
+
return { type: "linear", start: [...v.start], end: [...v.end], stops };
|
|
41
|
+
if (v.type !== "radial")
|
|
42
|
+
return undefined;
|
|
43
|
+
return { type: "radial", stops, ...(finite(v.cx) ? { cx: v.cx } : {}), ...(finite(v.cy) ? { cy: v.cy } : {}), ...(positive(v.r) ? { r: v.r } : {}) };
|
|
44
|
+
}
|
|
45
|
+
function fill(v) {
|
|
46
|
+
return Array.isArray(v) ? v.map(paint).filter((p) => p !== undefined) : paint(v);
|
|
47
|
+
}
|
|
48
|
+
function style(v) {
|
|
49
|
+
const out = {};
|
|
50
|
+
const f = fill(v.fill);
|
|
51
|
+
if (f !== undefined)
|
|
52
|
+
out.fill = f;
|
|
53
|
+
for (const key of ["stroke", "shadowColor", "color"])
|
|
54
|
+
if (color(v[key]))
|
|
55
|
+
out[key] = v[key];
|
|
56
|
+
for (const key of ["shadowX", "shadowY", "shadowSpread", "letterSpacing"])
|
|
57
|
+
if (finite(v[key]))
|
|
58
|
+
out[key] = v[key];
|
|
59
|
+
for (const key of ["strokeWidth", "radiusTopLeft", "radiusTopRight", "radiusBottomRight", "radiusBottomLeft", "shadowBlur", "bendRadius", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft"])
|
|
60
|
+
if (nonnegative(v[key]))
|
|
61
|
+
out[key] = v[key];
|
|
62
|
+
for (const key of ["fontSize", "lineHeight"])
|
|
63
|
+
if (positive(v[key]))
|
|
64
|
+
out[key] = v[key];
|
|
65
|
+
for (const key of ["strokeTop", "strokeRight", "strokeBottom", "strokeLeft", "shadowOn", "italic", "underline", "strike"])
|
|
66
|
+
if (typeof v[key] === "boolean")
|
|
67
|
+
out[key] = v[key];
|
|
68
|
+
if (finite(v.opacity) && v.opacity >= 0 && v.opacity <= 1)
|
|
69
|
+
out.opacity = v.opacity;
|
|
70
|
+
if (finite(v.fontWeight) && v.fontWeight >= 100 && v.fontWeight <= 900)
|
|
71
|
+
out.fontWeight = v.fontWeight;
|
|
72
|
+
if (word(v.fontFamily))
|
|
73
|
+
out.fontFamily = v.fontFamily;
|
|
74
|
+
if (Array.isArray(v.dash) && v.dash.length > 0 && v.dash.length % 2 === 0 && v.dash.every(nonnegative)
|
|
75
|
+
&& positive(v.dash.reduce((sum, interval) => sum + interval, 0)))
|
|
76
|
+
out.dash = [...v.dash];
|
|
77
|
+
for (const [key, values] of Object.entries({ strokeAlign: ["center", "inside", "outside"], strokeCapStart: ["butt", "round", "square"], strokeCapEnd: ["butt", "round", "square"], strokeJoin: ["miter", "round", "bevel"], lineStart: ARROWS, lineEnd: ARROWS, textCase: CASE, align: ALIGN, valign: ["top", "middle", "bottom"] })) {
|
|
78
|
+
if (oneOf(v[key], values))
|
|
79
|
+
out[key] = v[key];
|
|
80
|
+
}
|
|
81
|
+
return out;
|
|
82
|
+
}
|
|
83
|
+
function textContent(v) {
|
|
84
|
+
if (!record(v) || !Array.isArray(v.paragraphs))
|
|
85
|
+
return undefined;
|
|
86
|
+
const paragraphs = [];
|
|
87
|
+
for (const value of v.paragraphs) {
|
|
88
|
+
if (!record(value) || !Array.isArray(value.runs))
|
|
89
|
+
continue;
|
|
90
|
+
const runs = [];
|
|
91
|
+
for (const valueRun of value.runs) {
|
|
92
|
+
if (!record(valueRun) || typeof valueRun.text !== "string")
|
|
93
|
+
continue;
|
|
94
|
+
const r = { text: cleanText(valueRun.text) };
|
|
95
|
+
if (finite(valueRun.weight) && valueRun.weight >= 100 && valueRun.weight <= 900)
|
|
96
|
+
r.weight = valueRun.weight;
|
|
97
|
+
for (const key of ["italic", "underline", "strike"])
|
|
98
|
+
if (typeof valueRun[key] === "boolean")
|
|
99
|
+
r[key] = valueRun[key];
|
|
100
|
+
if (color(valueRun.color))
|
|
101
|
+
r.color = valueRun.color;
|
|
102
|
+
if (positive(valueRun.size))
|
|
103
|
+
r.size = Math.max(4, Math.min(400, valueRun.size));
|
|
104
|
+
if (word(valueRun.family))
|
|
105
|
+
r.family = valueRun.family;
|
|
106
|
+
if (finite(valueRun.letterSpacing))
|
|
107
|
+
r.letterSpacing = valueRun.letterSpacing;
|
|
108
|
+
if (oneOf(valueRun.textCase, CASE))
|
|
109
|
+
r.textCase = valueRun.textCase;
|
|
110
|
+
const link = safeUrl(valueRun.link);
|
|
111
|
+
if (link)
|
|
112
|
+
r.link = link;
|
|
113
|
+
runs.push(r);
|
|
114
|
+
}
|
|
115
|
+
const p = { runs };
|
|
116
|
+
if (oneOf(value.align, ALIGN))
|
|
117
|
+
p.align = value.align;
|
|
118
|
+
if (positive(value.lineHeight))
|
|
119
|
+
p.lineHeight = value.lineHeight;
|
|
120
|
+
if (oneOf(value.list, ["bullet", "number", "task"]))
|
|
121
|
+
p.list = value.list;
|
|
122
|
+
if (finite(value.indent))
|
|
123
|
+
p.indent = Math.max(0, Math.min(8, Math.round(value.indent)));
|
|
124
|
+
if (p.list === "number" && nonnegative(value.start) && Number.isInteger(value.start))
|
|
125
|
+
p.start = value.start;
|
|
126
|
+
if (p.list === "task" && value.checked === true)
|
|
127
|
+
p.checked = true;
|
|
128
|
+
paragraphs.push(p);
|
|
129
|
+
}
|
|
130
|
+
return normalizeTextContent({ paragraphs });
|
|
131
|
+
}
|
|
132
|
+
function image(v) {
|
|
133
|
+
if (!record(v) || typeof v.hash !== "string" || v.hash.length !== 64 || !/^[0-9a-f]{64}$/.test(v.hash) || !positive(v.w) || !positive(v.h) || !word(v.mime))
|
|
134
|
+
return undefined;
|
|
135
|
+
const out = { hash: v.hash, w: v.w, h: v.h, mime: v.mime };
|
|
136
|
+
if (validateThumbHash(v.thumb))
|
|
137
|
+
out.thumb = v.thumb;
|
|
138
|
+
if (Array.isArray(v.crop) && v.crop.length === 4 && v.crop.every(finite) && nonnegative(v.crop[2]) && nonnegative(v.crop[3]))
|
|
139
|
+
out.crop = [...v.crop];
|
|
140
|
+
return out;
|
|
141
|
+
}
|
|
142
|
+
function embed(v) {
|
|
143
|
+
if (!record(v))
|
|
144
|
+
return undefined;
|
|
145
|
+
const url = safeUrl(v.url);
|
|
146
|
+
if (!url)
|
|
147
|
+
return undefined;
|
|
148
|
+
const out = { url };
|
|
149
|
+
const embedUrl = safeUrl(v.embedUrl);
|
|
150
|
+
if (embedUrl)
|
|
151
|
+
out.embedUrl = embedUrl;
|
|
152
|
+
if (typeof v.title === "string")
|
|
153
|
+
out.title = v.title;
|
|
154
|
+
for (const key of ["icon", "preview"]) {
|
|
155
|
+
const ref = image(v[key]);
|
|
156
|
+
if (ref)
|
|
157
|
+
out[key] = ref;
|
|
158
|
+
}
|
|
159
|
+
return out;
|
|
160
|
+
}
|
|
161
|
+
function path(v) {
|
|
162
|
+
if (!Array.isArray(v))
|
|
163
|
+
return undefined;
|
|
164
|
+
const result = [];
|
|
165
|
+
const keys = { M: ["x", "y"], L: ["x", "y"], Q: ["cx", "cy", "x", "y"], C: ["c1x", "c1y", "c2x", "c2y", "x", "y"], Z: [] };
|
|
166
|
+
for (const cmd of v) {
|
|
167
|
+
if (!record(cmd) || typeof cmd.t !== "string" || !Object.hasOwn(keys, cmd.t))
|
|
168
|
+
return undefined;
|
|
169
|
+
const fields = keys[cmd.t];
|
|
170
|
+
if (!fields.every((k) => finite(cmd[k])))
|
|
171
|
+
return undefined;
|
|
172
|
+
result.push(Object.fromEntries([["t", cmd.t], ...fields.map((k) => [k, cmd[k]])]));
|
|
173
|
+
}
|
|
174
|
+
return result;
|
|
175
|
+
}
|
|
176
|
+
function endpoint(v) {
|
|
177
|
+
if (!record(v))
|
|
178
|
+
return {};
|
|
179
|
+
const out = {};
|
|
180
|
+
if (word(v.ref))
|
|
181
|
+
out.ref = v.ref;
|
|
182
|
+
if (word(v.anchor))
|
|
183
|
+
out.anchor = v.anchor;
|
|
184
|
+
else if (oneOf(v.side, ["t", "r", "b", "l", "c"]))
|
|
185
|
+
out.side = v.side;
|
|
186
|
+
return out;
|
|
187
|
+
}
|
|
188
|
+
function node(v) {
|
|
189
|
+
if (!record(v) || !word(v.id) || !KINDS.has(v.kind) || ![v.x, v.y, v.w, v.h, v.rot].every(finite) || !record(v.style))
|
|
190
|
+
return undefined;
|
|
191
|
+
if (!nonnegative(v.w) || !nonnegative(v.h) || !finite(v.x + v.w) || !finite(v.y + v.h))
|
|
192
|
+
return undefined;
|
|
193
|
+
if (v.parent !== undefined && v.parent !== null && !word(v.parent))
|
|
194
|
+
return undefined;
|
|
195
|
+
const rawStyle = Object.fromEntries(Object.entries(v.style).filter(([key]) => safeKey(key)));
|
|
196
|
+
const raw = { kind: v.kind, xywh: [v.x, v.y, v.w, v.h], rot: v.rot, style: style(resolveStyle(rawStyle)) };
|
|
197
|
+
for (const key of ["hidden", "locked", "autoWidth", "autoHeight", "clip"])
|
|
198
|
+
if (typeof v[key] === "boolean")
|
|
199
|
+
raw[key] = v[key];
|
|
200
|
+
if (typeof v.name === "string")
|
|
201
|
+
raw.name = v.name;
|
|
202
|
+
raw.text = textContent(v.text);
|
|
203
|
+
raw.path = path(v.path);
|
|
204
|
+
raw.image = image(v.image);
|
|
205
|
+
raw.embed = embed(v.embed);
|
|
206
|
+
if (record(v.inst)) {
|
|
207
|
+
const inst = {};
|
|
208
|
+
if (record(v.inst.def) && word(v.inst.def.lib) && word(v.inst.def.node))
|
|
209
|
+
inst.def = { lib: v.inst.def.lib, node: v.inst.def.node };
|
|
210
|
+
if (typeof v.inst.defName === "string")
|
|
211
|
+
inst.defName = v.inst.defName;
|
|
212
|
+
raw.inst = inst;
|
|
213
|
+
}
|
|
214
|
+
if (record(v.anchors))
|
|
215
|
+
raw.anchors = Object.fromEntries(Object.entries(v.anchors).filter(([id, p]) => safeKey(id) && point(p)).map(([id, p]) => [id, [...p]]));
|
|
216
|
+
if (v.kind === "connector") {
|
|
217
|
+
const c = record(v.conn) ? v.conn : {};
|
|
218
|
+
const conn = {
|
|
219
|
+
route: oneOf(c.route, ["straight", "ortho", "curve"]) ? c.route : "straight",
|
|
220
|
+
start: endpoint(c.start), end: endpoint(c.end),
|
|
221
|
+
startAt: point(c.startAt) ? [...c.startAt] : [v.x, v.y],
|
|
222
|
+
endAt: point(c.endAt) ? [...c.endAt] : [v.x + v.w, v.y + v.h],
|
|
223
|
+
};
|
|
224
|
+
if (Array.isArray(c.points) && c.points.every(point))
|
|
225
|
+
conn.points = c.points.map((p) => [...p]);
|
|
226
|
+
raw.conn = conn;
|
|
227
|
+
}
|
|
228
|
+
return normalizeNode(v.id, raw, { x: 0, y: 0 }, typeof v.parent === "string" ? v.parent : null).object;
|
|
229
|
+
}
|
|
230
|
+
function objects(values, closedGraph = false) {
|
|
231
|
+
const entries = new Map();
|
|
232
|
+
const duplicateIds = new Set();
|
|
233
|
+
const presentIds = new Set(values.filter(record).map((v) => v.id).filter(word));
|
|
234
|
+
for (const value of values) {
|
|
235
|
+
const o = node(value);
|
|
236
|
+
if (!o)
|
|
237
|
+
continue;
|
|
238
|
+
if (entries.has(o.id))
|
|
239
|
+
duplicateIds.add(o.id);
|
|
240
|
+
entries.set(o.id, o);
|
|
241
|
+
}
|
|
242
|
+
for (const id of duplicateIds)
|
|
243
|
+
entries.delete(id);
|
|
244
|
+
const invalid = new Set();
|
|
245
|
+
const rejectParentChains = () => {
|
|
246
|
+
for (const o of entries.values()) {
|
|
247
|
+
const seen = new Set();
|
|
248
|
+
for (let current = o; current; current = current.parent ? entries.get(current.parent) : undefined) {
|
|
249
|
+
if (seen.has(current.id) || seen.size >= MAX_CLIPBOARD_DEPTH || invalid.has(current.id)
|
|
250
|
+
|| (current.parent && (closedGraph || presentIds.has(current.parent)) && !entries.has(current.parent))) {
|
|
251
|
+
invalid.add(o.id);
|
|
252
|
+
break;
|
|
253
|
+
}
|
|
254
|
+
seen.add(current.id);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
rejectParentChains();
|
|
259
|
+
if (closedGraph) {
|
|
260
|
+
for (const o of entries.values()) {
|
|
261
|
+
if (!o.conn)
|
|
262
|
+
continue;
|
|
263
|
+
for (const end of ["start", "end"]) {
|
|
264
|
+
const ref = o.conn[end].ref;
|
|
265
|
+
if (ref && (!entries.has(ref) || invalid.has(ref) || entries.get(ref)?.kind === "connector"))
|
|
266
|
+
invalid.add(o.id);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
rejectParentChains();
|
|
270
|
+
}
|
|
271
|
+
for (const id of invalid)
|
|
272
|
+
entries.delete(id);
|
|
273
|
+
for (const o of entries.values()) {
|
|
274
|
+
const parent = o.parent ? entries.get(o.parent) : undefined;
|
|
275
|
+
if (!parent || !CONTAINER_KINDS.has(parent.kind))
|
|
276
|
+
o.parent = null;
|
|
277
|
+
if (o.conn) {
|
|
278
|
+
for (const end of ["start", "end"]) {
|
|
279
|
+
const ref = o.conn[end].ref;
|
|
280
|
+
const target = ref ? entries.get(ref) : undefined;
|
|
281
|
+
if (!target || target.kind === "connector")
|
|
282
|
+
o.conn[end] = {};
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
const normalized = normalize(sceneState({ objects: entries, order: [...entries.keys()] }));
|
|
287
|
+
return normalized.order.map((id) => normalized.objects.get(id));
|
|
288
|
+
}
|
|
289
|
+
export function validateObjects(values) {
|
|
290
|
+
try {
|
|
291
|
+
return Array.isArray(values) && values.length <= MAX_CLIPBOARD_OBJECTS ? objects(values) : [];
|
|
292
|
+
}
|
|
293
|
+
catch {
|
|
294
|
+
return [];
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
function withinLimit(raw) {
|
|
298
|
+
return raw.length <= MAX_CLIPBOARD_BYTES && new TextEncoder().encode(raw).byteLength <= MAX_CLIPBOARD_BYTES;
|
|
299
|
+
}
|
|
300
|
+
export function clipboardImageHashes(source) {
|
|
301
|
+
return new Set(source.flatMap((object) => [object.image, object.embed?.icon, object.embed?.preview]
|
|
302
|
+
.filter((ref) => !!ref).map((ref) => ref.hash)));
|
|
303
|
+
}
|
|
304
|
+
function assetShares(value, source) {
|
|
305
|
+
if (!record(value))
|
|
306
|
+
return undefined;
|
|
307
|
+
const hashes = clipboardImageHashes(source);
|
|
308
|
+
const entries = Object.entries(value);
|
|
309
|
+
if (entries.length > hashes.size)
|
|
310
|
+
return undefined;
|
|
311
|
+
const shares = [];
|
|
312
|
+
for (const [hash, share] of entries) {
|
|
313
|
+
if (!/^[0-9a-f]{64}$/.test(hash) || !hashes.has(hash) || !record(share)
|
|
314
|
+
|| typeof share.url !== "string" || share.url.length > MAX_ASSET_SHARE_URL_LENGTH
|
|
315
|
+
|| /[\u0000-\u0020\u007f]/u.test(share.url) || !Number.isSafeInteger(share.expires)
|
|
316
|
+
|| share.expires <= 0)
|
|
317
|
+
continue;
|
|
318
|
+
try {
|
|
319
|
+
const url = new URL(share.url);
|
|
320
|
+
if (url.protocol !== "https:" || url.username || url.password || url.hash)
|
|
321
|
+
continue;
|
|
322
|
+
shares.push([hash, { url: share.url, expires: share.expires }]);
|
|
323
|
+
}
|
|
324
|
+
catch { }
|
|
325
|
+
}
|
|
326
|
+
return shares.length ? Object.fromEntries(shares) : undefined;
|
|
327
|
+
}
|
|
328
|
+
export function decodeObjectPayload(raw) {
|
|
329
|
+
try {
|
|
330
|
+
if (typeof raw !== "string" || !withinLimit(raw))
|
|
331
|
+
return null;
|
|
332
|
+
const payload = JSON.parse(raw);
|
|
333
|
+
if (!record(payload) || payload.version !== 1 || !Array.isArray(payload.objects) || payload.objects.length > MAX_CLIPBOARD_OBJECTS)
|
|
334
|
+
return null;
|
|
335
|
+
const source = objects(payload.objects, true);
|
|
336
|
+
const assets = assetShares(payload.assets, source);
|
|
337
|
+
return { version: 1, objects: source, ...(assets ? { assets } : {}) };
|
|
338
|
+
}
|
|
339
|
+
catch {
|
|
340
|
+
return null;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
export function decodeObjects(raw) {
|
|
344
|
+
return decodeObjectPayload(raw)?.objects ?? [];
|
|
345
|
+
}
|
|
346
|
+
export function encodeObjects(source, shares) {
|
|
347
|
+
try {
|
|
348
|
+
if (source.length === 0 || source.length > MAX_CLIPBOARD_OBJECTS)
|
|
349
|
+
return null;
|
|
350
|
+
const payload = { version: 1, objects: objects([...source]) };
|
|
351
|
+
if (!payload.objects.length)
|
|
352
|
+
return null;
|
|
353
|
+
const assets = assetShares(shares, payload.objects);
|
|
354
|
+
if (assets)
|
|
355
|
+
payload.assets = assets;
|
|
356
|
+
const raw = JSON.stringify(payload);
|
|
357
|
+
return withinLimit(raw) ? raw : null;
|
|
358
|
+
}
|
|
359
|
+
catch {
|
|
360
|
+
return null;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type Point, type Rect, type SceneObject } from "@daasboard/render-core";
|
|
2
|
+
export declare function clipboardBounds(objects: readonly SceneObject[]): Rect | null;
|
|
3
|
+
export interface PasteOptions {
|
|
4
|
+
select?: boolean;
|
|
5
|
+
offset?: Point;
|
|
6
|
+
at?: Point;
|
|
7
|
+
viewport?: Rect;
|
|
8
|
+
parent?: string | null;
|
|
9
|
+
parents?: Readonly<Record<string, string | null>>;
|
|
10
|
+
}
|
|
11
|
+
export declare function pasteOffset(objects: readonly SceneObject[], options?: PasteOptions): Point;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { rectUnion, rotatedBounds } from "@daasboard/render-core";
|
|
2
|
+
export function clipboardBounds(objects) {
|
|
3
|
+
let bounds = null;
|
|
4
|
+
for (const object of objects) {
|
|
5
|
+
const box = rotatedBounds(object, object.rot);
|
|
6
|
+
bounds = bounds ? rectUnion(bounds, box) : box;
|
|
7
|
+
}
|
|
8
|
+
return bounds;
|
|
9
|
+
}
|
|
10
|
+
export function pasteOffset(objects, options = {}) {
|
|
11
|
+
if (options.offset)
|
|
12
|
+
return options.offset;
|
|
13
|
+
const bounds = clipboardBounds(objects);
|
|
14
|
+
if (!bounds)
|
|
15
|
+
return { x: 0, y: 0 };
|
|
16
|
+
const view = options.viewport;
|
|
17
|
+
const visible = !view || (bounds.x + bounds.w >= view.x && bounds.y + bounds.h >= view.y
|
|
18
|
+
&& bounds.x <= view.x + view.w && bounds.y <= view.y + view.h);
|
|
19
|
+
const at = options.at ?? (!visible && view ? { x: view.x + view.w / 2, y: view.y + view.h / 2 } : undefined);
|
|
20
|
+
return at ? { x: at.x - bounds.x - bounds.w / 2, y: at.y - bounds.y - bounds.h / 2 } : { x: 0, y: 0 };
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function clipboardImageFiles(data: Pick<DataTransfer, "types" | "files" | "getData">, ownerDocument: Document): File[];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { parseClipboard } from "../text/clipboard.js";
|
|
2
|
+
import { carriedObjects } from "./carrier.js";
|
|
3
|
+
import { MAX_CLIPBOARD_BYTES, OBJECTS_MIME } from "./objects.js";
|
|
4
|
+
export function clipboardImageFiles(data, ownerDocument) {
|
|
5
|
+
if (data.types.includes(OBJECTS_MIME))
|
|
6
|
+
return [];
|
|
7
|
+
const files = [...data.files].filter((file) => file.type.startsWith("image/"));
|
|
8
|
+
if (!files.length)
|
|
9
|
+
return [];
|
|
10
|
+
const html = data.getData("text/html");
|
|
11
|
+
if (!html)
|
|
12
|
+
return files;
|
|
13
|
+
if (html.length > MAX_CLIPBOARD_BYTES || new TextEncoder().encode(html).length > MAX_CLIPBOARD_BYTES)
|
|
14
|
+
return [];
|
|
15
|
+
if (carriedObjects(html, ownerDocument) !== undefined)
|
|
16
|
+
return [];
|
|
17
|
+
try {
|
|
18
|
+
const rich = parseClipboard({ text: "", html }, ownerDocument);
|
|
19
|
+
return rich?.content.textBetween(0, rich.content.size).trim() ? [] : files;
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
return [];
|
|
23
|
+
}
|
|
24
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export { type DocumentAdapter, type Transaction, type PropPath, getPath, setPath } from "@daasboard/doc";
|
|
2
|
+
export type { SceneObject, Style, ObjectKind, FillValue, FillPaint, LinearGradient, RadialGradient, GradientStop, EmbedRef, ImageRef } from "@daasboard/render-core";
|
|
3
|
+
export { MemoryDocument } from "@daasboard/doc";
|
|
4
|
+
export { SelectionModel, keepSelectionInDocument, type TextRange } from "./selection/SelectionModel.js";
|
|
5
|
+
export { PropertyRegistry, type PropertyDescriptor, type PropType } from "./props/PropertyRegistry.js";
|
|
6
|
+
export { aggregateMembers, builtinProperties, canHaveText } from "./props/builtinProperties.js";
|
|
7
|
+
export { defaultStyle, defaultSize } from "./props/defaults.js";
|
|
8
|
+
export { PropertyController, planZOrder, type PropertyValue, type Patch, type PatchFn, type CommandSpec, type CommitPreviewOptions, type CreateOptions, type InsertImagesOptions, type NewObject } from "./props/PropertyController.js";
|
|
9
|
+
export { SelectTool, type PointerInfo, type SelectPress, type SelectToolState, type SelectToolOptions } from "./tools/SelectTool.js";
|
|
10
|
+
export { CreateTool, CREATE_KINDS, CREATE_TOOL_NAMES, type CreateKind, type CreatePress, type CreateToolName, type CreateToolOptions, type CreateToolState, type CreationPreview } from "./tools/CreateTool.js";
|
|
11
|
+
export { PRESET_NAMES, PRESET_PATHS, isPresetName, type PresetName } from "./tools/presetPaths.js";
|
|
12
|
+
export { ToolManager, TOOL_NAMES, type ToolName, type ToolManagerOptions, type ToolManagerState, type ToolPress } from "./tools/ToolManager.js";
|
|
13
|
+
export { transformBounds, handleFrame, handlesSuppressed, handlePositions, handleAt, cursorFor, resizeBounds, mapBoxInto, normalizeAngle, snapAngle, rotatePoint, nearestSide, isTransformable, pointerHit, pointerProfile, HANDLE_SIZE_PX, HANDLE_MIN_SIDE_PX, ROTATE_HANDLE_GAP_PX, ROTATE_SNAP_DEG, MIN_SIZE, RESIZE_HANDLES, type HandleFrame, type HandleKind, type HandleProfile, type ResizeHandle, type ResizeMods, type ToolCursor, } from "./tools/transform.js";
|
|
14
|
+
export { endpointMarkers, endpointAt, endpointsDraggable, type ConnectorEnd, type ConnectorEndpointRef, type EndpointMarker } from "./tools/connectorEndpoints.js";
|
|
15
|
+
export { InteractionLayer, SELECTION_KNOB_PX, SELECTION_KNOB_GAP_PX, SELECTION_REACH_PX, SELECTION_INNER_REACH_PX, type InteractionDrawOptions, type ToolChromeState, type SelectionHandleHit } from "./interaction/InteractionLayer.js";
|
|
16
|
+
export * from "./text/index.js";
|
|
17
|
+
export { CameraInput, listenTrackpadGestures, wheelZoomKind, releaseSpeed, zoomAbout, clampZoom, MIN_ZOOM, MAX_ZOOM, PINCH_UNITS, NOTCH_RATE, KINETIC_MS, type CameraInputOptions, type CameraInputStats, type WheelInput, type GestureInput, type WheelZoomKind, type PinchSample, } from "./camera/CameraInput.js";
|
|
18
|
+
export { TouchInput, normalizeTouchOptions, flingVelocity, TOUCH_SLOP_PX, PEN_SLOP_PX, LONG_PRESS_MS, DOUBLE_TAP_MS, DOUBLE_TAP_PX, PINCH_MIN_PX, FLING_FIT_MS, FLING_MEAN_MS, FLING_MIN_SPEED, FLING_RELEASE_MS, FLING_DECAY, type TouchInputOptions, type TouchInputStats, type TouchHost, type TouchOptions, type TouchSettings, type TouchCanvasDrag, type TouchObjectDrag, type TouchTarget, type TouchPress, type TouchFeature, type TouchPoint, type TouchPointerEvent, type TouchPointerSample, type PanSample, } from "./input/TouchInput.js";
|
|
19
|
+
export { CARET_MARGIN_PX, visiblePart, revealCaret } from "./input/visiblePart.js";
|
|
20
|
+
export { OBJECTS_MIME, MAX_CLIPBOARD_BYTES, MAX_CLIPBOARD_OBJECTS, encodeObjects, decodeObjects, type ObjectClipboardPayload } from "./clipboard/objects.js";
|
|
21
|
+
export { clipboardBounds, pasteOffset, type PasteOptions } from "./clipboard/placement.js";
|
|
22
|
+
export { createObjectClipboard, PASTED_TEXT_WIDTH, type ObjectClipboard, type ObjectClipboardOptions, type ObjectClipboardContent, type ObjectPasteResult, type ClipboardWriter, type ClipboardSource } from "./clipboard/ObjectClipboard.js";
|
|
23
|
+
export { clipboardImageFiles } from "./clipboard/systemImages.js";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export { getPath, setPath } from "@daasboard/doc";
|
|
2
|
+
export { MemoryDocument } from "@daasboard/doc";
|
|
3
|
+
export { SelectionModel, keepSelectionInDocument } from "./selection/SelectionModel.js";
|
|
4
|
+
export { PropertyRegistry } from "./props/PropertyRegistry.js";
|
|
5
|
+
export { aggregateMembers, builtinProperties, canHaveText } from "./props/builtinProperties.js";
|
|
6
|
+
export { defaultStyle, defaultSize } from "./props/defaults.js";
|
|
7
|
+
export { PropertyController, planZOrder } from "./props/PropertyController.js";
|
|
8
|
+
export { SelectTool } from "./tools/SelectTool.js";
|
|
9
|
+
export { CreateTool, CREATE_KINDS, CREATE_TOOL_NAMES } from "./tools/CreateTool.js";
|
|
10
|
+
export { PRESET_NAMES, PRESET_PATHS, isPresetName } from "./tools/presetPaths.js";
|
|
11
|
+
export { ToolManager, TOOL_NAMES } from "./tools/ToolManager.js";
|
|
12
|
+
export { transformBounds, handleFrame, handlesSuppressed, handlePositions, handleAt, cursorFor, resizeBounds, mapBoxInto, normalizeAngle, snapAngle, rotatePoint, nearestSide, isTransformable, pointerHit, pointerProfile, HANDLE_SIZE_PX, HANDLE_MIN_SIDE_PX, ROTATE_HANDLE_GAP_PX, ROTATE_SNAP_DEG, MIN_SIZE, RESIZE_HANDLES, } from "./tools/transform.js";
|
|
13
|
+
export { endpointMarkers, endpointAt, endpointsDraggable } from "./tools/connectorEndpoints.js";
|
|
14
|
+
export { InteractionLayer, SELECTION_KNOB_PX, SELECTION_KNOB_GAP_PX, SELECTION_REACH_PX, SELECTION_INNER_REACH_PX } from "./interaction/InteractionLayer.js";
|
|
15
|
+
export * from "./text/index.js";
|
|
16
|
+
export { CameraInput, listenTrackpadGestures, wheelZoomKind, releaseSpeed, zoomAbout, clampZoom, MIN_ZOOM, MAX_ZOOM, PINCH_UNITS, NOTCH_RATE, KINETIC_MS, } from "./camera/CameraInput.js";
|
|
17
|
+
export { TouchInput, normalizeTouchOptions, flingVelocity, TOUCH_SLOP_PX, PEN_SLOP_PX, LONG_PRESS_MS, DOUBLE_TAP_MS, DOUBLE_TAP_PX, PINCH_MIN_PX, FLING_FIT_MS, FLING_MEAN_MS, FLING_MIN_SPEED, FLING_RELEASE_MS, FLING_DECAY, } from "./input/TouchInput.js";
|
|
18
|
+
export { CARET_MARGIN_PX, visiblePart, revealCaret } from "./input/visiblePart.js";
|
|
19
|
+
export { OBJECTS_MIME, MAX_CLIPBOARD_BYTES, MAX_CLIPBOARD_OBJECTS, encodeObjects, decodeObjects } from "./clipboard/objects.js";
|
|
20
|
+
export { clipboardBounds, pasteOffset } from "./clipboard/placement.js";
|
|
21
|
+
export { createObjectClipboard, PASTED_TEXT_WIDTH } from "./clipboard/ObjectClipboard.js";
|
|
22
|
+
export { clipboardImageFiles } from "./clipboard/systemImages.js";
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { type Point, type SchedulerTimers } from "@daasboard/render-core";
|
|
2
|
+
export declare const TOUCH_SLOP_PX = 10;
|
|
3
|
+
export declare const PEN_SLOP_PX = 6;
|
|
4
|
+
export declare const LONG_PRESS_MS = 500;
|
|
5
|
+
export declare const DOUBLE_TAP_MS = 300;
|
|
6
|
+
export declare const DOUBLE_TAP_PX = 24;
|
|
7
|
+
export declare const PINCH_MIN_PX = 16;
|
|
8
|
+
export declare const FLING_FIT_MS = 80;
|
|
9
|
+
export declare const FLING_MEAN_MS = 30;
|
|
10
|
+
export declare const FLING_MIN_SPEED = 0.2;
|
|
11
|
+
export declare const FLING_RELEASE_MS = 50;
|
|
12
|
+
export declare const FLING_DECAY = 0.995;
|
|
13
|
+
export type TouchCanvasDrag = "select" | "pan";
|
|
14
|
+
export type TouchObjectDrag = "move" | "pan";
|
|
15
|
+
export interface TouchOptions {
|
|
16
|
+
canvasDrag?: TouchCanvasDrag;
|
|
17
|
+
objectDrag?: TouchObjectDrag;
|
|
18
|
+
}
|
|
19
|
+
export interface TouchSettings {
|
|
20
|
+
readonly canvasDrag: TouchCanvasDrag;
|
|
21
|
+
readonly objectDrag: TouchObjectDrag;
|
|
22
|
+
}
|
|
23
|
+
export declare function normalizeTouchOptions(value: unknown, name?: string): TouchSettings;
|
|
24
|
+
export interface TouchPointerSample {
|
|
25
|
+
readonly clientX: number;
|
|
26
|
+
readonly clientY: number;
|
|
27
|
+
readonly timeStamp?: number;
|
|
28
|
+
}
|
|
29
|
+
export interface TouchPointerEvent extends TouchPointerSample {
|
|
30
|
+
readonly pointerId: number;
|
|
31
|
+
readonly pointerType: string;
|
|
32
|
+
readonly button: number;
|
|
33
|
+
readonly buttons: number;
|
|
34
|
+
readonly shiftKey?: boolean;
|
|
35
|
+
readonly altKey?: boolean;
|
|
36
|
+
readonly ctrlKey?: boolean;
|
|
37
|
+
readonly metaKey?: boolean;
|
|
38
|
+
readonly isPrimary?: boolean;
|
|
39
|
+
getCoalescedEvents?(): readonly TouchPointerSample[];
|
|
40
|
+
}
|
|
41
|
+
export interface TouchPoint {
|
|
42
|
+
readonly pointerId: number;
|
|
43
|
+
readonly pointer: "touch" | "pen";
|
|
44
|
+
readonly clientX: number;
|
|
45
|
+
readonly clientY: number;
|
|
46
|
+
readonly shiftKey: boolean;
|
|
47
|
+
readonly altKey: boolean;
|
|
48
|
+
readonly ctrlKey: boolean;
|
|
49
|
+
readonly metaKey: boolean;
|
|
50
|
+
readonly timeStamp: number;
|
|
51
|
+
}
|
|
52
|
+
export type TouchTarget = "pan" | "text" | "tool" | "gradient" | "handle" | "selected" | "object" | "canvas";
|
|
53
|
+
export interface TouchPress {
|
|
54
|
+
readonly target: TouchTarget;
|
|
55
|
+
readonly hit?: unknown;
|
|
56
|
+
}
|
|
57
|
+
export type TouchFeature = "pan" | "zoom" | "menu" | "tool";
|
|
58
|
+
export interface TouchHost {
|
|
59
|
+
target(p: TouchPoint): TouchTarget | TouchPress;
|
|
60
|
+
press(p: TouchPoint, clicks: number, hit?: unknown): void;
|
|
61
|
+
move(p: TouchPoint): void;
|
|
62
|
+
release(p: TouchPoint): void;
|
|
63
|
+
cancel(): void;
|
|
64
|
+
doubleTap(p: TouchPoint): void;
|
|
65
|
+
hover(p: TouchPoint): void;
|
|
66
|
+
longPress(p: TouchPoint): void;
|
|
67
|
+
menu(p: TouchPoint): void;
|
|
68
|
+
secondary(p: TouchPoint): void;
|
|
69
|
+
pan(dx: number, dy: number): void;
|
|
70
|
+
zoom(ln: number, at: Point): void;
|
|
71
|
+
motion(kind: "pan" | "fling", active: boolean): void;
|
|
72
|
+
stopMotion(): boolean;
|
|
73
|
+
enabled(feature: TouchFeature): boolean;
|
|
74
|
+
}
|
|
75
|
+
export interface TouchInputOptions {
|
|
76
|
+
host: TouchHost;
|
|
77
|
+
local(clientX: number, clientY: number): Point;
|
|
78
|
+
touch?: TouchOptions;
|
|
79
|
+
timers?: SchedulerTimers;
|
|
80
|
+
}
|
|
81
|
+
export interface TouchInputStats {
|
|
82
|
+
taps: number;
|
|
83
|
+
doubleTaps: number;
|
|
84
|
+
longPresses: number;
|
|
85
|
+
drags: number;
|
|
86
|
+
pans: number;
|
|
87
|
+
pinches: number;
|
|
88
|
+
flings: number;
|
|
89
|
+
finishes: number;
|
|
90
|
+
cancels: number;
|
|
91
|
+
}
|
|
92
|
+
export interface PanSample {
|
|
93
|
+
t: number;
|
|
94
|
+
x: number;
|
|
95
|
+
y: number;
|
|
96
|
+
}
|
|
97
|
+
export declare function flingVelocity(samples: readonly PanSample[], end: number): Point | null;
|
|
98
|
+
export declare class TouchInput {
|
|
99
|
+
private readonly o;
|
|
100
|
+
readonly settings: TouchSettings;
|
|
101
|
+
readonly stats: TouchInputStats;
|
|
102
|
+
private readonly host;
|
|
103
|
+
private readonly timers;
|
|
104
|
+
private gesture;
|
|
105
|
+
private readonly ignored;
|
|
106
|
+
private handedOver;
|
|
107
|
+
private tapping;
|
|
108
|
+
private lastTap;
|
|
109
|
+
private fling;
|
|
110
|
+
private zoomFrame;
|
|
111
|
+
private finish;
|
|
112
|
+
private disposed;
|
|
113
|
+
constructor(o: TouchInputOptions);
|
|
114
|
+
get active(): boolean;
|
|
115
|
+
get moving(): boolean;
|
|
116
|
+
touching(): boolean;
|
|
117
|
+
pointerDown(e: TouchPointerEvent): boolean;
|
|
118
|
+
pointerMove(e: TouchPointerEvent): void;
|
|
119
|
+
pointerUp(e: TouchPointerEvent): void;
|
|
120
|
+
pointerCancel(e: TouchPointerEvent): void;
|
|
121
|
+
lostPointerCapture(e: Pick<TouchPointerEvent, "pointerId">): void;
|
|
122
|
+
key(key: string): boolean;
|
|
123
|
+
cancelPress(): void;
|
|
124
|
+
cancel(): void;
|
|
125
|
+
flush(): void;
|
|
126
|
+
stop(): boolean;
|
|
127
|
+
dispose(): void;
|
|
128
|
+
private contacts;
|
|
129
|
+
private contact;
|
|
130
|
+
private newContact;
|
|
131
|
+
private point;
|
|
132
|
+
private track;
|
|
133
|
+
private beyond;
|
|
134
|
+
private ignore;
|
|
135
|
+
private unignore;
|
|
136
|
+
private ignoring;
|
|
137
|
+
private forget;
|
|
138
|
+
private penHeld;
|
|
139
|
+
private clicksFor;
|
|
140
|
+
private stopMotion;
|
|
141
|
+
private fingerDown;
|
|
142
|
+
private firstFinger;
|
|
143
|
+
private secondFinger;
|
|
144
|
+
private longPress;
|
|
145
|
+
private drag;
|
|
146
|
+
private pans;
|
|
147
|
+
private handOver;
|
|
148
|
+
private endPress;
|
|
149
|
+
private tapped;
|
|
150
|
+
private clearTimer;
|
|
151
|
+
private penDown;
|
|
152
|
+
private camera;
|
|
153
|
+
private follow;
|
|
154
|
+
private lift;
|
|
155
|
+
private readonly flingStep;
|
|
156
|
+
private readonly finishStep;
|
|
157
|
+
private abort;
|
|
158
|
+
private time;
|
|
159
|
+
}
|