@pixerate/editor 0.148.0 → 0.150.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/dist/agent/index.cjs +11 -5
- package/dist/agent/index.js +9 -3
- package/dist/animation/index.cjs +4 -2
- package/dist/animation/index.js +3 -1
- package/dist/animation-editor/effect-tools.d.cts +5 -0
- package/dist/animation-editor/effect-tools.d.ts +5 -0
- package/dist/animation-editor/index.cjs +4 -4
- package/dist/animation-editor/index.js +4 -4
- package/dist/animation-editor/playback.d.cts +3 -2
- package/dist/animation-editor/playback.d.ts +3 -2
- package/dist/animation-editor/tools.d.cts +5 -0
- package/dist/animation-editor/tools.d.ts +5 -0
- package/dist/chart/index.cjs +9 -9
- package/dist/chart/index.js +3 -3
- package/dist/chart/playback.d.cts +2 -2
- package/dist/chart/playback.d.ts +2 -2
- package/dist/chart/tools.d.cts +5 -0
- package/dist/chart/tools.d.ts +5 -0
- package/dist/{chunk-HUHBJWTD.js → chunk-6DXDUVSL.js} +17 -1
- package/dist/{chunk-AG2EXVCR.cjs → chunk-ERAGQL2N.cjs} +2 -2
- package/dist/{chunk-D2ENR3LB.cjs → chunk-GMWNBSBS.cjs} +36 -20
- package/dist/{chunk-SA37RU2O.js → chunk-KMU6QJB7.js} +1 -1
- package/dist/{chunk-PEEP2YR7.js → chunk-O2ANJFUF.js} +23 -1
- package/dist/{chunk-UJGAA6AK.cjs → chunk-SWTUM32H.cjs} +23 -1
- package/dist/commands/index.cjs +3 -3
- package/dist/commands/index.js +2 -2
- package/dist/diagram/index.cjs +7 -7
- package/dist/diagram/index.js +1 -1
- package/dist/image-editor/index.cjs +29 -5
- package/dist/image-editor/index.js +28 -4
- package/dist/image-editor/playback.d.cts +22 -3
- package/dist/image-editor/playback.d.ts +22 -3
- package/dist/image-editor/provider-effect-tools.d.cts +5 -0
- package/dist/image-editor/provider-effect-tools.d.ts +5 -0
- package/dist/image-editor/tools.d.cts +5 -0
- package/dist/image-editor/tools.d.ts +5 -0
- package/dist/paint-editor/effect-tools.d.cts +5 -0
- package/dist/paint-editor/effect-tools.d.ts +5 -0
- package/dist/paint-editor/index.cjs +9 -9
- package/dist/paint-editor/index.js +4 -4
- package/dist/paint-editor/playback.d.cts +2 -2
- package/dist/paint-editor/playback.d.ts +2 -2
- package/dist/paint-editor/tools.d.cts +5 -0
- package/dist/paint-editor/tools.d.ts +5 -0
- package/dist/tools/index.cjs +10 -4
- package/dist/tools/index.js +9 -3
- package/dist/tools/playback.d.cts +28 -0
- package/dist/tools/playback.d.ts +28 -0
- package/dist/tools/presence.d.cts +17 -0
- package/dist/tools/presence.d.ts +17 -0
- package/dist/video-editor/effect-tools.d.cts +5 -0
- package/dist/video-editor/effect-tools.d.ts +5 -0
- package/dist/video-editor/index.cjs +4 -4
- package/dist/video-editor/index.js +4 -4
- package/dist/video-editor/playback.d.cts +3 -2
- package/dist/video-editor/playback.d.ts +3 -2
- package/dist/video-editor/tools.d.cts +5 -0
- package/dist/video-editor/tools.d.ts +5 -0
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class;
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkSWTUM32Hcjs = require('./chunk-SWTUM32H.cjs');
|
|
5
5
|
|
|
6
6
|
// src/tools/playback.ts
|
|
7
7
|
var ARG_KINDS = {
|
|
@@ -80,10 +80,24 @@ function unionRects(rects) {
|
|
|
80
80
|
const y = Math.min(...list.map((r) => r.y));
|
|
81
81
|
return { x, y, width: Math.max(...list.map((r) => r.x + r.width)) - x, height: Math.max(...list.map((r) => r.y + r.height)) - y };
|
|
82
82
|
}
|
|
83
|
+
function playbackRectFromClient(rect, fromViewport) {
|
|
84
|
+
if (!rect || !(rect.width > 0) || !(rect.height > 0)) return null;
|
|
85
|
+
const map = _nullishCoalesce(fromViewport, () => ( ((p) => p)));
|
|
86
|
+
const a = map({ x: rect.left, y: rect.top });
|
|
87
|
+
const b = map({ x: rect.left + rect.width, y: rect.top + rect.height });
|
|
88
|
+
return { x: Math.min(a.x, b.x), y: Math.min(a.y, b.y), width: Math.abs(b.x - a.x), height: Math.abs(b.y - a.y) };
|
|
89
|
+
}
|
|
90
|
+
function locatePlaybackChrome(ref, chrome, fromViewport) {
|
|
91
|
+
if (!chrome) return null;
|
|
92
|
+
const own = _optionalChain([chrome, 'access', _3 => _3.locate, 'optionalCall', _4 => _4(ref)]);
|
|
93
|
+
if (own) return own;
|
|
94
|
+
const el = _optionalChain([chrome, 'access', _5 => _5.locateElement, 'optionalCall', _6 => _6(ref)]);
|
|
95
|
+
return el ? playbackRectFromClient(el.getBoundingClientRect(), fromViewport) : null;
|
|
96
|
+
}
|
|
83
97
|
function normalizePlan(plan) {
|
|
84
98
|
if (!plan) return null;
|
|
85
99
|
if (Array.isArray(plan)) return plan.length ? { steps: plan } : null;
|
|
86
|
-
return _optionalChain([plan, 'access',
|
|
100
|
+
return _optionalChain([plan, 'access', _7 => _7.steps, 'optionalAccess', _8 => _8.length]) || plan.surface || plan.readOnly !== void 0 ? plan : null;
|
|
87
101
|
}
|
|
88
102
|
var isErrorResult = (value) => !!value && typeof value === "object" && value.isError === true;
|
|
89
103
|
var center = (r) => ({ x: r.x + r.width / 2, y: r.y + r.height / 2 });
|
|
@@ -105,7 +119,7 @@ var AgentPlayback = (_class = class {
|
|
|
105
119
|
__init7() {this.running = 0}
|
|
106
120
|
__init8() {this.calls = 0}
|
|
107
121
|
constructor(options = {}) {;_class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this);_class.prototype.__init4.call(this);_class.prototype.__init5.call(this);_class.prototype.__init6.call(this);_class.prototype.__init7.call(this);_class.prototype.__init8.call(this);_class.prototype.__init9.call(this);
|
|
108
|
-
this.clock = _nullishCoalesce(options.clock, () => (
|
|
122
|
+
this.clock = _nullishCoalesce(options.clock, () => ( _chunkSWTUM32Hcjs.realPresenceClock));
|
|
109
123
|
this.speed = _nullishCoalesce(options.speed, () => ( 1));
|
|
110
124
|
this.reads = _nullishCoalesce(options.reads, () => ( "skip"));
|
|
111
125
|
this.linger = _nullishCoalesce(options.linger, () => ( 1500));
|
|
@@ -150,7 +164,7 @@ var AgentPlayback = (_class = class {
|
|
|
150
164
|
say(text, options = {}) {
|
|
151
165
|
const actor = this.actorState(options.actor);
|
|
152
166
|
const surface = actor.surface ? this.surfaces.get(actor.surface) : void 0;
|
|
153
|
-
if (!_optionalChain([surface, 'optionalAccess',
|
|
167
|
+
if (!_optionalChain([surface, 'optionalAccess', _9 => _9.presence, 'access', _10 => _10.get, 'call', _11 => _11(actor.info.id)])) return null;
|
|
154
168
|
surface.presence.set({ id: actor.info.id, message: text });
|
|
155
169
|
return actor.surface;
|
|
156
170
|
}
|
|
@@ -168,9 +182,9 @@ var AgentPlayback = (_class = class {
|
|
|
168
182
|
const base = _nullishCoalesce(info, () => ( this.defaultActor));
|
|
169
183
|
let actor = this.actors.get(base.id);
|
|
170
184
|
if (!actor) {
|
|
171
|
-
actor = { info: { ...base, color: _nullishCoalesce(base.color, () => (
|
|
185
|
+
actor = { info: { ...base, color: _nullishCoalesce(base.color, () => ( _chunkSWTUM32Hcjs.PRESENCE_COLORS[this.actors.size % _chunkSWTUM32Hcjs.PRESENCE_COLORS.length])) }, queue: Promise.resolve(), version: 0 };
|
|
172
186
|
this.actors.set(base.id, actor);
|
|
173
|
-
} else if (_optionalChain([info, 'optionalAccess',
|
|
187
|
+
} else if (_optionalChain([info, 'optionalAccess', _12 => _12.name]) && info.name !== actor.info.name) actor.info = { ...actor.info, name: info.name };
|
|
174
188
|
return actor;
|
|
175
189
|
}
|
|
176
190
|
enqueue(actor, run) {
|
|
@@ -195,26 +209,26 @@ var AgentPlayback = (_class = class {
|
|
|
195
209
|
if (tool.plan) {
|
|
196
210
|
try {
|
|
197
211
|
const state = {
|
|
198
|
-
surfaceId: _nullishCoalesce(_optionalChain([fallback, 'optionalAccess',
|
|
199
|
-
locate: (ref) => _nullishCoalesce(_optionalChain([fallback, 'optionalAccess',
|
|
212
|
+
surfaceId: _nullishCoalesce(_optionalChain([fallback, 'optionalAccess', _13 => _13[0]]), () => ( null)),
|
|
213
|
+
locate: (ref) => _nullishCoalesce(_optionalChain([fallback, 'optionalAccess', _14 => _14[1], 'access', _15 => _15.locate, 'optionalCall', _16 => _16(ref)]), () => ( null))
|
|
200
214
|
};
|
|
201
215
|
planned = normalizePlan(tool.plan(call.args, state));
|
|
202
216
|
} catch (e2) {
|
|
203
217
|
planned = null;
|
|
204
218
|
}
|
|
205
219
|
}
|
|
206
|
-
const readOnly = _nullishCoalesce(_optionalChain([planned, 'optionalAccess',
|
|
220
|
+
const readOnly = _nullishCoalesce(_optionalChain([planned, 'optionalAccess', _17 => _17.readOnly]), () => ( _optionalChain([tool, 'access', _18 => _18.annotations, 'optionalAccess', _19 => _19.readOnlyHint]) === true));
|
|
207
221
|
if (readOnly && this.reads === "skip") return next();
|
|
208
|
-
const found = this.surfaceFor(call.provider, _optionalChain([planned, 'optionalAccess',
|
|
222
|
+
const found = this.surfaceFor(call.provider, _optionalChain([planned, 'optionalAccess', _20 => _20.surface]));
|
|
209
223
|
if (!found) return next();
|
|
210
224
|
const [surfaceId, surface] = found;
|
|
211
|
-
const steps = _optionalChain([planned, 'optionalAccess',
|
|
225
|
+
const steps = _optionalChain([planned, 'optionalAccess', _21 => _21.steps, 'optionalAccess', _22 => _22.length]) ? planned.steps : derivePlaybackSteps(call.args, surface.defaultKind);
|
|
212
226
|
const glance = readOnly && this.reads === "glance";
|
|
213
227
|
const played = glance ? steps.filter((s) => GLANCE_STEPS.has(s.type)) : steps;
|
|
214
228
|
if (!played.some((s) => s.type !== "commit")) return next();
|
|
215
229
|
return this.enqueue(actor, async () => {
|
|
216
230
|
if (surface.visible && !surface.visible()) {
|
|
217
|
-
await _optionalChain([surface, 'access',
|
|
231
|
+
await _optionalChain([surface, 'access', _23 => _23.reveal, 'optionalCall', _24 => _24()]);
|
|
218
232
|
if (surface.visible && !surface.visible()) return next();
|
|
219
233
|
}
|
|
220
234
|
return this.play({ call, next, actor, surfaceId, surface, steps: played, readOnly, glance });
|
|
@@ -228,22 +242,22 @@ var AgentPlayback = (_class = class {
|
|
|
228
242
|
const pace = () => Math.max(0.1, this.speed) * (run.glance ? 1.6 : 1);
|
|
229
243
|
const wait = (ms) => instant() || ms <= 0 ? Promise.resolve() : this.clock.wait(ms / pace());
|
|
230
244
|
const presence = surface.presence;
|
|
231
|
-
const locate = (ref) => finiteRect(_nullishCoalesce(_optionalChain([surface, 'access',
|
|
245
|
+
const locate = (ref) => finiteRect(_nullishCoalesce(_optionalChain([surface, 'access', _25 => _25.locate, 'optionalCall', _26 => _26(ref.kind === "item" ? { kind: _nullishCoalesce(surface.defaultKind, () => ( "item")), id: ref.id } : ref)]), () => ( null)));
|
|
232
246
|
const record = (step) => {
|
|
233
247
|
for (const list of this.recordings) list.push({ actor: id, surface: surfaceId, tool: call.name, step });
|
|
234
248
|
};
|
|
235
249
|
this.running++;
|
|
236
250
|
if (this.running === 1) this.listeners.forEach((l) => l());
|
|
237
251
|
try {
|
|
238
|
-
if (actor.surface && actor.surface !== surfaceId) _optionalChain([this, 'access',
|
|
252
|
+
if (actor.surface && actor.surface !== surfaceId) _optionalChain([this, 'access', _27 => _27.surfaces, 'access', _28 => _28.get, 'call', _29 => _29(actor.surface), 'optionalAccess', _30 => _30.presence, 'access', _31 => _31.remove, 'call', _32 => _32(id)]);
|
|
239
253
|
if (!presence.get(id)) {
|
|
240
|
-
const bounds = _nullishCoalesce(_optionalChain([surface, 'access',
|
|
254
|
+
const bounds = _nullishCoalesce(_optionalChain([surface, 'access', _33 => _33.bounds, 'optionalCall', _34 => _34()]), () => ( null));
|
|
241
255
|
let at = actor.viewport && surface.fromViewport ? surface.fromViewport(actor.viewport) : null;
|
|
242
256
|
if (at && bounds) at = { x: Math.min(bounds.x + bounds.width, Math.max(bounds.x, at.x)), y: Math.min(bounds.y + bounds.height, Math.max(bounds.y, at.y)) };
|
|
243
257
|
at ??= bounds ? { x: bounds.x + bounds.width - 48, y: bounds.y + 32 } : null;
|
|
244
258
|
if (!at) {
|
|
245
259
|
const first = run.steps.find((s) => s.type === "move" || s.type === "target" || s.type === "drag");
|
|
246
|
-
const rect = _optionalChain([first, 'optionalAccess',
|
|
260
|
+
const rect = _optionalChain([first, 'optionalAccess', _35 => _35.type]) === "target" ? locate(first.ref) : null;
|
|
247
261
|
at = first && first.type !== "target" ? first.to : rect ? center(rect) : { x: 0, y: 0 };
|
|
248
262
|
}
|
|
249
263
|
presence.set({ id, name: _nullishCoalesce(actor.info.name, () => ( id)), color: actor.info.color, x: at.x, y: at.y, pressed: false });
|
|
@@ -251,7 +265,7 @@ var AgentPlayback = (_class = class {
|
|
|
251
265
|
actor.surface = surfaceId;
|
|
252
266
|
actor.version++;
|
|
253
267
|
const argRefs = playbackRefsFromArgs(call.args, surface.defaultKind);
|
|
254
|
-
if (!readOnly) _optionalChain([surface, 'access',
|
|
268
|
+
if (!readOnly) _optionalChain([surface, 'access', _36 => _36.beginGesture, 'optionalCall', _37 => _37(`agent:${id}:${++this.calls}`)]);
|
|
255
269
|
let result;
|
|
256
270
|
let committed = false;
|
|
257
271
|
try {
|
|
@@ -287,11 +301,11 @@ var AgentPlayback = (_class = class {
|
|
|
287
301
|
await wait(900);
|
|
288
302
|
throw error;
|
|
289
303
|
} finally {
|
|
290
|
-
if (!readOnly) _optionalChain([surface, 'access',
|
|
304
|
+
if (!readOnly) _optionalChain([surface, 'access', _38 => _38.endGesture, 'optionalCall', _39 => _39()]);
|
|
291
305
|
presence.set({ id, pressed: false });
|
|
292
306
|
}
|
|
293
307
|
if (isErrorResult(result)) {
|
|
294
|
-
const text = _nullishCoalesce(_optionalChain([result, 'access',
|
|
308
|
+
const text = _nullishCoalesce(_optionalChain([result, 'access', _40 => _40.content, 'optionalAccess', _41 => _41.find, 'call', _42 => _42((c) => c.type === "text"), 'optionalAccess', _43 => _43.text]), () => ( "The tool failed."));
|
|
295
309
|
presence.set({ id, message: `\u2717 ${text}`.slice(0, 140) });
|
|
296
310
|
await wait(900);
|
|
297
311
|
} else if (!readOnly) {
|
|
@@ -444,4 +458,6 @@ function createPlaybackToolProvider(playback, options = {}) {
|
|
|
444
458
|
|
|
445
459
|
|
|
446
460
|
|
|
447
|
-
|
|
461
|
+
|
|
462
|
+
|
|
463
|
+
exports.playbackRefsFromArgs = playbackRefsFromArgs; exports.playbackRefsFromResult = playbackRefsFromResult; exports.derivePlaybackSteps = derivePlaybackSteps; exports.readingTime = readingTime; exports.unionRects = unionRects; exports.playbackRectFromClient = playbackRectFromClient; exports.locatePlaybackChrome = locatePlaybackChrome; exports.AgentPlayback = AgentPlayback; exports.createAgentPlayback = createAgentPlayback; exports.createPlaybackToolProvider = createPlaybackToolProvider;
|
|
@@ -84,6 +84,27 @@ var PerformanceQueue = class {
|
|
|
84
84
|
return run;
|
|
85
85
|
}
|
|
86
86
|
};
|
|
87
|
+
function trackPresenceDrag(handlers) {
|
|
88
|
+
let start = null;
|
|
89
|
+
return (state) => {
|
|
90
|
+
const actor = start ? state.actors.find((a) => a.id === start.id) : state.actors.find((a) => a.pressed);
|
|
91
|
+
if (!start) {
|
|
92
|
+
if (!actor) return;
|
|
93
|
+
start = { id: actor.id, x: actor.x, y: actor.y };
|
|
94
|
+
}
|
|
95
|
+
if (!actor || !actor.pressed) {
|
|
96
|
+
start = null;
|
|
97
|
+
handlers.onEnd();
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
handlers.onDrag({
|
|
101
|
+
x: Math.min(start.x, actor.x),
|
|
102
|
+
y: Math.min(start.y, actor.y),
|
|
103
|
+
width: Math.abs(actor.x - start.x),
|
|
104
|
+
height: Math.abs(actor.y - start.y)
|
|
105
|
+
});
|
|
106
|
+
};
|
|
107
|
+
}
|
|
87
108
|
|
|
88
109
|
export {
|
|
89
110
|
PRESENCE_COLORS,
|
|
@@ -91,5 +112,6 @@ export {
|
|
|
91
112
|
realPresenceClock,
|
|
92
113
|
createInstantPresenceClock,
|
|
93
114
|
tweenPresenceCursor,
|
|
94
|
-
PerformanceQueue
|
|
115
|
+
PerformanceQueue,
|
|
116
|
+
trackPresenceDrag
|
|
95
117
|
};
|
|
@@ -84,6 +84,28 @@ var PerformanceQueue = (_class2 = class {
|
|
|
84
84
|
return run;
|
|
85
85
|
}
|
|
86
86
|
}, _class2);
|
|
87
|
+
function trackPresenceDrag(handlers) {
|
|
88
|
+
let start = null;
|
|
89
|
+
return (state) => {
|
|
90
|
+
const actor = start ? state.actors.find((a) => a.id === start.id) : state.actors.find((a) => a.pressed);
|
|
91
|
+
if (!start) {
|
|
92
|
+
if (!actor) return;
|
|
93
|
+
start = { id: actor.id, x: actor.x, y: actor.y };
|
|
94
|
+
}
|
|
95
|
+
if (!actor || !actor.pressed) {
|
|
96
|
+
start = null;
|
|
97
|
+
handlers.onEnd();
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
handlers.onDrag({
|
|
101
|
+
x: Math.min(start.x, actor.x),
|
|
102
|
+
y: Math.min(start.y, actor.y),
|
|
103
|
+
width: Math.abs(actor.x - start.x),
|
|
104
|
+
height: Math.abs(actor.y - start.y)
|
|
105
|
+
});
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
|
|
87
109
|
|
|
88
110
|
|
|
89
111
|
|
|
@@ -92,4 +114,4 @@ var PerformanceQueue = (_class2 = class {
|
|
|
92
114
|
|
|
93
115
|
|
|
94
116
|
|
|
95
|
-
exports.PRESENCE_COLORS = PRESENCE_COLORS; exports.PresenceStore = PresenceStore; exports.realPresenceClock = realPresenceClock; exports.createInstantPresenceClock = createInstantPresenceClock; exports.tweenPresenceCursor = tweenPresenceCursor; exports.PerformanceQueue = PerformanceQueue;
|
|
117
|
+
exports.PRESENCE_COLORS = PRESENCE_COLORS; exports.PresenceStore = PresenceStore; exports.realPresenceClock = realPresenceClock; exports.createInstantPresenceClock = createInstantPresenceClock; exports.tweenPresenceCursor = tweenPresenceCursor; exports.PerformanceQueue = PerformanceQueue; exports.trackPresenceDrag = trackPresenceDrag;
|
package/dist/commands/index.cjs
CHANGED
|
@@ -29,8 +29,8 @@ var _chunkGLQQ2VILcjs = require('../chunk-GLQQ2VIL.cjs');
|
|
|
29
29
|
var _chunk4EFNS2HVcjs = require('../chunk-4EFNS2HV.cjs');
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
var
|
|
33
|
-
require('../chunk-
|
|
32
|
+
var _chunkGMWNBSBScjs = require('../chunk-GMWNBSBS.cjs');
|
|
33
|
+
require('../chunk-SWTUM32H.cjs');
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
var _chunkWOFXZ3XUcjs = require('../chunk-WOFXZ3XU.cjs');
|
|
@@ -608,7 +608,7 @@ function createCommandToolProvider(registry, options = {}) {
|
|
|
608
608
|
const surface = _nullishCoalesce(_nullishCoalesce(spec.playbackSurface, () => ( spec.scope)), () => ( (id.includes(".") ? id.slice(0, id.indexOf(".")) : void 0)));
|
|
609
609
|
const planned = _optionalChain([spec, 'access', _24 => _24.plan, 'optionalCall', _25 => _25(context(), _nullishCoalesce(params, () => ( {})))]);
|
|
610
610
|
const own = !planned ? [] : Array.isArray(planned) ? planned : planned.steps;
|
|
611
|
-
const steps = own.length ? own :
|
|
611
|
+
const steps = own.length ? own : _chunkGMWNBSBScjs.derivePlaybackSteps.call(void 0, params);
|
|
612
612
|
return {
|
|
613
613
|
steps,
|
|
614
614
|
...surface ? { surface } : {},
|
package/dist/commands/index.js
CHANGED
|
@@ -29,8 +29,8 @@ import {
|
|
|
29
29
|
} from "../chunk-7KZ2HKKC.js";
|
|
30
30
|
import {
|
|
31
31
|
derivePlaybackSteps
|
|
32
|
-
} from "../chunk-
|
|
33
|
-
import "../chunk-
|
|
32
|
+
} from "../chunk-6DXDUVSL.js";
|
|
33
|
+
import "../chunk-O2ANJFUF.js";
|
|
34
34
|
import {
|
|
35
35
|
validateJsonSchema
|
|
36
36
|
} from "../chunk-V2ZCJRDM.js";
|
package/dist/diagram/index.cjs
CHANGED
|
@@ -128,7 +128,7 @@ require('../chunk-2BSBFBOA.cjs');
|
|
|
128
128
|
|
|
129
129
|
|
|
130
130
|
|
|
131
|
-
var
|
|
131
|
+
var _chunkSWTUM32Hcjs = require('../chunk-SWTUM32H.cjs');
|
|
132
132
|
|
|
133
133
|
|
|
134
134
|
var _chunkFJ2MSI43cjs = require('../chunk-FJ2MSI43.cjs');
|
|
@@ -2313,8 +2313,8 @@ var DiagramDirector = class {
|
|
|
2313
2313
|
this.controller = controller;
|
|
2314
2314
|
this.options = options;
|
|
2315
2315
|
this.presence = presence;
|
|
2316
|
-
this.clock = _nullishCoalesce(options.clock, () => (
|
|
2317
|
-
this.queue = new (0,
|
|
2316
|
+
this.clock = _nullishCoalesce(options.clock, () => ( _chunkSWTUM32Hcjs.realPresenceClock));
|
|
2317
|
+
this.queue = new (0, _chunkSWTUM32Hcjs.PerformanceQueue)(presence, {
|
|
2318
2318
|
clock: this.clock,
|
|
2319
2319
|
linger: options.linger,
|
|
2320
2320
|
beginGesture: (key) => controller.beginGesture(key),
|
|
@@ -2373,7 +2373,7 @@ var DiagramDirector = class {
|
|
|
2373
2373
|
const fresh = changedItems(before, result.document.graph);
|
|
2374
2374
|
const target = fresh.length ? center(this.options.placement(), fresh[fresh.length - 1]) : null;
|
|
2375
2375
|
const actorNow = this.presence.get(actor.id);
|
|
2376
|
-
if (target && actorNow) await
|
|
2376
|
+
if (target && actorNow) await _chunkSWTUM32Hcjs.tweenPresenceCursor.call(void 0, this.presence, this.clock, actor.id, actorNow, target, pause);
|
|
2377
2377
|
else await this.clock.wait(pause);
|
|
2378
2378
|
}
|
|
2379
2379
|
return { ok: true, document: this.controller.getDocument() };
|
|
@@ -2410,7 +2410,7 @@ var DiagramDirector = class {
|
|
|
2410
2410
|
return null;
|
|
2411
2411
|
}
|
|
2412
2412
|
case "move":
|
|
2413
|
-
await
|
|
2413
|
+
await _chunkSWTUM32Hcjs.tweenPresenceCursor.call(void 0, this.presence, this.clock, id, where(), step.to, step.ms);
|
|
2414
2414
|
return null;
|
|
2415
2415
|
case "press":
|
|
2416
2416
|
this.presence.set({ id, pressed: true });
|
|
@@ -2421,7 +2421,7 @@ var DiagramDirector = class {
|
|
|
2421
2421
|
case "drag": {
|
|
2422
2422
|
const start = this.options.placement().positions[step.id];
|
|
2423
2423
|
let problem = null;
|
|
2424
|
-
await
|
|
2424
|
+
await _chunkSWTUM32Hcjs.tweenPresenceCursor.call(void 0, this.presence, this.clock, id, where(), step.to, step.ms, (e) => {
|
|
2425
2425
|
if (problem || !start) return;
|
|
2426
2426
|
const position = [start[0] + (step.position[0] - start[0]) * e, start[1] + (step.position[1] - start[1]) * e];
|
|
2427
2427
|
const result = this.controller.apply({ type: "moveNodes", moves: [{ id: step.id, position }] }, label);
|
|
@@ -2610,4 +2610,4 @@ function planDiagramEdits(source, place, ops, speed = 1) {
|
|
|
2610
2610
|
|
|
2611
2611
|
|
|
2612
2612
|
|
|
2613
|
-
exports.ARCH_METRICS = _chunkZVNAMTFOcjs.ARCH_METRICS; exports.C4_METRICS = _chunkZVNAMTFOcjs.C4_METRICS; exports.CLASS_RELATIONS = _chunkZVNAMTFOcjs.CLASS_RELATIONS; exports.DIRECTIONS = DIRECTIONS; exports.DiagramController = DiagramController; exports.DiagramDirector = DiagramDirector; exports.EDITABLE_DIAGRAM_FAMILIES = EDITABLE_DIAGRAM_FAMILIES; exports.ER_CARDINALITIES = _chunkZVNAMTFOcjs.ER_CARDINALITIES; exports.ER_PATTERNS = _chunkZVNAMTFOcjs.ER_PATTERNS; exports.FAMILY_BLANKS = FAMILY_BLANKS; exports.FAMILY_DESCRIPTIONS = FAMILY_DESCRIPTIONS; exports.FAMILY_TEMPLATES = FAMILY_TEMPLATES; exports.FAMILY_TITLES = FAMILY_TITLES; exports.FLOWCHART_SHAPES = _chunkZVNAMTFOcjs.FLOWCHART_SHAPES; exports.GANTT_CONFIG_KEYS = _chunkZVNAMTFOcjs.GANTT_CONFIG_KEYS; exports.GANTT_METRICS = _chunkZVNAMTFOcjs.GANTT_METRICS; exports.GANTT_TAGS = _chunkZVNAMTFOcjs.GANTT_TAGS; exports.META_COMMENT_PREFIX = _chunkZVNAMTFOcjs.META_COMMENT_PREFIX; exports.META_FRONTMATTER_KEY = _chunkZVNAMTFOcjs.META_FRONTMATTER_KEY; exports.POINT_BOX = _chunkZVNAMTFOcjs.POINT_BOX; exports.PRESENCE_COLORS =
|
|
2613
|
+
exports.ARCH_METRICS = _chunkZVNAMTFOcjs.ARCH_METRICS; exports.C4_METRICS = _chunkZVNAMTFOcjs.C4_METRICS; exports.CLASS_RELATIONS = _chunkZVNAMTFOcjs.CLASS_RELATIONS; exports.DIRECTIONS = DIRECTIONS; exports.DiagramController = DiagramController; exports.DiagramDirector = DiagramDirector; exports.EDITABLE_DIAGRAM_FAMILIES = EDITABLE_DIAGRAM_FAMILIES; exports.ER_CARDINALITIES = _chunkZVNAMTFOcjs.ER_CARDINALITIES; exports.ER_PATTERNS = _chunkZVNAMTFOcjs.ER_PATTERNS; exports.FAMILY_BLANKS = FAMILY_BLANKS; exports.FAMILY_DESCRIPTIONS = FAMILY_DESCRIPTIONS; exports.FAMILY_TEMPLATES = FAMILY_TEMPLATES; exports.FAMILY_TITLES = FAMILY_TITLES; exports.FLOWCHART_SHAPES = _chunkZVNAMTFOcjs.FLOWCHART_SHAPES; exports.GANTT_CONFIG_KEYS = _chunkZVNAMTFOcjs.GANTT_CONFIG_KEYS; exports.GANTT_METRICS = _chunkZVNAMTFOcjs.GANTT_METRICS; exports.GANTT_TAGS = _chunkZVNAMTFOcjs.GANTT_TAGS; exports.META_COMMENT_PREFIX = _chunkZVNAMTFOcjs.META_COMMENT_PREFIX; exports.META_FRONTMATTER_KEY = _chunkZVNAMTFOcjs.META_FRONTMATTER_KEY; exports.POINT_BOX = _chunkZVNAMTFOcjs.POINT_BOX; exports.PRESENCE_COLORS = _chunkSWTUM32Hcjs.PRESENCE_COLORS; exports.PerformanceQueue = _chunkSWTUM32Hcjs.PerformanceQueue; exports.PresenceStore = _chunkSWTUM32Hcjs.PresenceStore; exports.QUADRANT_METRICS = _chunkZVNAMTFOcjs.QUADRANT_METRICS; exports.RADAR_CHART_BOX = _chunkZVNAMTFOcjs.RADAR_CHART_BOX; exports.SEQUENCE_METRICS = _chunkZVNAMTFOcjs.SEQUENCE_METRICS; exports.STATE_SHAPES = _chunkZVNAMTFOcjs.STATE_SHAPES; exports.XY_CHART_BOX = _chunkZVNAMTFOcjs.XY_CHART_BOX; exports.afterIds = _chunkZVNAMTFOcjs.afterIds; exports.applyEdit = _chunkZVNAMTFOcjs.applyEdit; exports.applyEdits = _chunkZVNAMTFOcjs.applyEdits; exports.applyStatementEdit = _chunkZVNAMTFOcjs.applyStatementEdit; exports.architectureAdapter = _chunkZVNAMTFOcjs.architectureAdapter; exports.architectureArrow = _chunkZVNAMTFOcjs.architectureArrow; exports.architectureEdgeRoute = _chunkZVNAMTFOcjs.architectureEdgeRoute; exports.architectureGrammar = _chunkZVNAMTFOcjs.architectureGrammar; exports.architectureLayout = _chunkZVNAMTFOcjs.architectureLayout; exports.architectureUI = architectureUI; exports.c4Adapter = _chunkZVNAMTFOcjs.c4Adapter; exports.c4ArrowHead = _chunkZVNAMTFOcjs.c4ArrowHead; exports.c4BoundaryText = _chunkZVNAMTFOcjs.c4BoundaryText; exports.c4ElementGeometry = _chunkZVNAMTFOcjs.c4ElementGeometry; exports.c4ElementType = _chunkZVNAMTFOcjs.c4ElementType; exports.c4Grammar = _chunkZVNAMTFOcjs.c4Grammar; exports.c4Layout = _chunkZVNAMTFOcjs.c4Layout; exports.c4RelGeometry = _chunkZVNAMTFOcjs.c4RelGeometry; exports.c4Stereotype = _chunkZVNAMTFOcjs.c4Stereotype; exports.c4UI = c4UI; exports.canonicalShape = _chunkZVNAMTFOcjs.canonicalShape; exports.changedItems = changedItems; exports.checkFieldData = checkFieldData; exports.classGrammar = _chunkZVNAMTFOcjs.classGrammar; exports.classUI = classUI; exports.createDiagramEditorDocument = createDiagramEditorDocument; exports.createDiagramToolProvider = createDiagramToolProvider; exports.createInstantPresenceClock = _chunkSWTUM32Hcjs.createInstantPresenceClock; exports.createLineAdapter = _chunkZVNAMTFOcjs.createLineAdapter; exports.createPassthroughAdapter = _chunkZVNAMTFOcjs.createPassthroughAdapter; exports.createStatementAdapter = _chunkZVNAMTFOcjs.createStatementAdapter; exports.describeDiagram = describeDiagram; exports.describeFields = describeFields; exports.detectFamily = _chunkZVNAMTFOcjs.detectFamily; exports.detectFamilyFromHeader = _chunkZVNAMTFOcjs.detectFamilyFromHeader; exports.diagramShapes = diagramShapes; exports.diagramSupportsDirection = diagramSupportsDirection; exports.diagramSupportsGroups = diagramSupportsGroups; exports.draftFrames = draftFrames; exports.dropMetaKeys = _chunkZVNAMTFOcjs.dropMetaKeys; exports.emptyMeta = _chunkZVNAMTFOcjs.emptyMeta; exports.erGrammar = _chunkZVNAMTFOcjs.erGrammar; exports.erUI = erUI; exports.familyUI = familyUI; exports.filterInPlace = _chunkZVNAMTFOcjs.filterInPlace; exports.findMermaidSources = findMermaidSources; exports.flowchartAdapter = _chunkZVNAMTFOcjs.flowchartAdapter; exports.flowchartUI = flowchartUI; exports.formatAxis = _chunkZVNAMTFOcjs.formatAxis; exports.formatChain = _chunkZVNAMTFOcjs.formatChain; exports.formatGanttDate = _chunkZVNAMTFOcjs.formatGanttDate; exports.formatLink = _chunkZVNAMTFOcjs.formatLink; exports.formatNode = _chunkZVNAMTFOcjs.formatNode; exports.ganttAdapter = _chunkZVNAMTFOcjs.ganttAdapter; exports.ganttGeometry = _chunkZVNAMTFOcjs.ganttGeometry; exports.ganttGrammar = _chunkZVNAMTFOcjs.ganttGrammar; exports.ganttUI = ganttUI; exports.getDiagramAdapter = _chunkZVNAMTFOcjs.getDiagramAdapter; exports.getFamilyLayout = _chunkZVNAMTFOcjs.getFamilyLayout; exports.gitGraphAdapter = _chunkZVNAMTFOcjs.gitGraphAdapter; exports.gitGraphGrammar = _chunkZVNAMTFOcjs.gitGraphGrammar; exports.gitGraphUI = gitGraphUI; exports.indentOf = _chunkZVNAMTFOcjs.indentOf; exports.isMetaEmpty = _chunkZVNAMTFOcjs.isMetaEmpty; exports.journeyAdapter = _chunkZVNAMTFOcjs.journeyAdapter; exports.journeyGrammar = _chunkZVNAMTFOcjs.journeyGrammar; exports.journeyLayout = _chunkZVNAMTFOcjs.journeyLayout; exports.journeyUI = journeyUI; exports.mergeMeta = _chunkZVNAMTFOcjs.mergeMeta; exports.mindmapAdapter = _chunkZVNAMTFOcjs.mindmapAdapter; exports.mindmapGrammar = _chunkZVNAMTFOcjs.mindmapGrammar; exports.mindmapUI = mindmapUI; exports.parseAttributes = _chunkZVNAMTFOcjs.parseAttributes; exports.parseChain = _chunkZVNAMTFOcjs.parseChain; exports.parseFlowchartSource = _chunkZVNAMTFOcjs.parseFlowchartSource; exports.parseGanttDate = _chunkZVNAMTFOcjs.parseGanttDate; exports.parseLink = _chunkZVNAMTFOcjs.parseLink; exports.parseMembers = _chunkZVNAMTFOcjs.parseMembers; exports.parseMermaid = _chunkZVNAMTFOcjs.parseMermaid; exports.parseSankey = parseSankey; exports.parseStatement = _chunkZVNAMTFOcjs.parseStatement; exports.parseStatementDocument = _chunkZVNAMTFOcjs.parseStatementDocument; exports.parseTreemap = parseTreemap; exports.pickFieldData = pickFieldData; exports.pieAdapter = _chunkZVNAMTFOcjs.pieAdapter; exports.pieGrammar = _chunkZVNAMTFOcjs.pieGrammar; exports.pieUI = pieUI; exports.planDiagramEdit = planDiagramEdit; exports.planDiagramEdits = planDiagramEdits; exports.pointCentre = _chunkZVNAMTFOcjs.pointCentre; exports.pointPosition = _chunkZVNAMTFOcjs.pointPosition; exports.positionToData = _chunkZVNAMTFOcjs.positionToData; exports.quadrantAdapter = _chunkZVNAMTFOcjs.quadrantAdapter; exports.quadrantGeometry = _chunkZVNAMTFOcjs.quadrantGeometry; exports.quadrantGrammar = _chunkZVNAMTFOcjs.quadrantGrammar; exports.quadrantSpace = _chunkZVNAMTFOcjs.quadrantSpace; exports.quadrantUI = quadrantUI; exports.quote = _chunkZVNAMTFOcjs.quote; exports.quoteLabelIfNeeded = _chunkZVNAMTFOcjs.quoteLabelIfNeeded; exports.radarAdapter = _chunkZVNAMTFOcjs.radarAdapter; exports.radarGrammar = _chunkZVNAMTFOcjs.radarGrammar; exports.radarUI = radarUI; exports.realPresenceClock = _chunkSWTUM32Hcjs.realPresenceClock; exports.registerDiagramAdapter = _chunkZVNAMTFOcjs.registerDiagramAdapter; exports.registerFamilyLayout = _chunkZVNAMTFOcjs.registerFamilyLayout; exports.relationFor = _chunkZVNAMTFOcjs.relationFor; exports.renameMetaKey = _chunkZVNAMTFOcjs.renameMetaKey; exports.resolveShape = _chunkZVNAMTFOcjs.resolveShape; exports.sequenceAdapter = _chunkZVNAMTFOcjs.sequenceAdapter; exports.sequenceGeometry = _chunkZVNAMTFOcjs.sequenceGeometry; exports.sequenceGrammar = _chunkZVNAMTFOcjs.sequenceGrammar; exports.sequenceUI = sequenceUI; exports.serializeMermaid = _chunkZVNAMTFOcjs.serializeMermaid; exports.serializeMeta = _chunkZVNAMTFOcjs.serializeMeta; exports.serializeStatementDocument = _chunkZVNAMTFOcjs.serializeStatementDocument; exports.serviceLabelLines = _chunkZVNAMTFOcjs.serviceLabelLines; exports.sharedFrameLayout = _chunkZVNAMTFOcjs.sharedFrameLayout; exports.slugId = _chunkZVNAMTFOcjs.slugId; exports.spaceInput = _chunkZVNAMTFOcjs.spaceInput; exports.splitOutsideQuotes = _chunkZVNAMTFOcjs.splitOutsideQuotes; exports.splitSource = _chunkZVNAMTFOcjs.splitSource; exports.splitStatements = _chunkZVNAMTFOcjs.splitStatements; exports.stateGrammar = _chunkZVNAMTFOcjs.stateGrammar; exports.stateUI = stateUI; exports.supportTierOf = _chunkZVNAMTFOcjs.supportTierOf; exports.timelineAdapter = _chunkZVNAMTFOcjs.timelineAdapter; exports.timelineGrammar = _chunkZVNAMTFOcjs.timelineGrammar; exports.timelineLayout = _chunkZVNAMTFOcjs.timelineLayout; exports.timelineUI = timelineUI; exports.treemapValue = treemapValue; exports.uniqueId = _chunkZVNAMTFOcjs.uniqueId; exports.unquote = _chunkZVNAMTFOcjs.unquote; exports.validateDiagramEdit = validateDiagramEdit; exports.xyChartAdapter = _chunkZVNAMTFOcjs.xyChartAdapter; exports.xyChartGrammar = _chunkZVNAMTFOcjs.xyChartGrammar; exports.xyChartUI = xyChartUI;
|
package/dist/diagram/index.js
CHANGED