@pixerate/editor 0.53.0 → 0.54.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 +14 -6
- package/dist/agent/index.cjs.map +1 -1
- package/dist/agent/index.d.cts +4 -3
- package/dist/agent/index.d.ts +4 -3
- package/dist/agent/index.js +12 -4
- package/dist/agent/index.js.map +1 -1
- package/dist/animation/index.cjs +15 -1
- package/dist/animation/index.cjs.map +1 -1
- package/dist/animation/index.d.cts +3 -226
- package/dist/animation/index.d.ts +3 -226
- package/dist/animation/index.js +14 -0
- package/dist/bridge/cli.cjs +36 -0
- package/dist/bridge/cli.cjs.map +1 -0
- package/dist/bridge/cli.d.cts +1 -0
- package/dist/bridge/cli.d.ts +1 -0
- package/dist/bridge/cli.js +36 -0
- package/dist/bridge/cli.js.map +1 -0
- package/dist/bridge/index.cjs +16 -0
- package/dist/bridge/index.cjs.map +1 -0
- package/dist/bridge/index.d.cts +65 -0
- package/dist/bridge/index.d.ts +65 -0
- package/dist/bridge/index.js +16 -0
- package/dist/bridge/index.js.map +1 -0
- package/dist/bridge-client-C5OziCRK.d.cts +148 -0
- package/dist/bridge-client-C5dRjrz5.d.ts +148 -0
- package/dist/canvas/index.cjs +1308 -528
- package/dist/canvas/index.cjs.map +1 -1
- package/dist/canvas/index.d.cts +309 -5
- package/dist/canvas/index.d.ts +309 -5
- package/dist/canvas/index.js +1295 -515
- package/dist/canvas/index.js.map +1 -1
- package/dist/chart/index.cjs +34 -76
- package/dist/chart/index.cjs.map +1 -1
- package/dist/chart/index.d.cts +9 -38
- package/dist/chart/index.d.ts +9 -38
- package/dist/chart/index.js +23 -65
- package/dist/chart/index.js.map +1 -1
- package/dist/chunk-AWKPSOSX.js +401 -0
- package/dist/chunk-AWKPSOSX.js.map +1 -0
- package/dist/chunk-B6DSIEXA.js +96 -0
- package/dist/chunk-B6DSIEXA.js.map +1 -0
- package/dist/chunk-EGFUVXKK.cjs +96 -0
- package/dist/chunk-EGFUVXKK.cjs.map +1 -0
- package/dist/{chunk-AMWXSYCI.js → chunk-GPWNYQ7R.js} +2 -370
- package/dist/chunk-GPWNYQ7R.js.map +1 -0
- package/dist/chunk-H5K77C7Y.cjs +3848 -0
- package/dist/chunk-H5K77C7Y.cjs.map +1 -0
- package/dist/chunk-K73CKYUM.cjs +458 -0
- package/dist/chunk-K73CKYUM.cjs.map +1 -0
- package/dist/chunk-NV22EMOZ.cjs +401 -0
- package/dist/chunk-NV22EMOZ.cjs.map +1 -0
- package/dist/chunk-PTMIGXZ2.js +467 -0
- package/dist/chunk-PTMIGXZ2.js.map +1 -0
- package/dist/chunk-QIWFEEWG.cjs +467 -0
- package/dist/chunk-QIWFEEWG.cjs.map +1 -0
- package/dist/chunk-WWJNC7SX.js +3848 -0
- package/dist/chunk-WWJNC7SX.js.map +1 -0
- package/dist/commands/index.d.cts +1 -1
- package/dist/commands/index.d.ts +1 -1
- package/dist/diagram/index.cjs +1146 -0
- package/dist/diagram/index.cjs.map +1 -0
- package/dist/diagram/index.d.cts +787 -0
- package/dist/diagram/index.d.ts +787 -0
- package/dist/diagram/index.js +1146 -0
- package/dist/diagram/index.js.map +1 -0
- package/dist/{easing-DTmX99QG.d.cts → easing-CNGk-W6d.d.cts} +1 -1
- package/dist/{easing-DTmX99QG.d.ts → easing-CNGk-W6d.d.ts} +1 -1
- package/dist/generation/index.d.cts +2 -2
- package/dist/generation/index.d.ts +2 -2
- package/dist/image-editor/index.d.cts +1 -1
- package/dist/image-editor/index.d.ts +1 -1
- package/dist/parameters/index.d.cts +1 -1
- package/dist/parameters/index.d.ts +1 -1
- package/dist/player-DSMjdgQ9.d.cts +225 -0
- package/dist/player-DdfVrKWq.d.ts +225 -0
- package/dist/presence-Cb6WhcrQ.d.cts +77 -0
- package/dist/presence-Cb6WhcrQ.d.ts +77 -0
- package/dist/{registry-CSlH4iUn.d.ts → registry-7AZFuand.d.ts} +1 -1
- package/dist/{registry-B4l-lYts.d.cts → registry-DIpIaCkH.d.cts} +1 -1
- package/dist/tools/index.cjs +10 -2
- package/dist/tools/index.cjs.map +1 -1
- package/dist/tools/index.d.cts +3 -74
- package/dist/tools/index.d.ts +3 -74
- package/dist/tools/index.js +12 -4
- package/dist/types-BULrFyuQ.d.cts +316 -0
- package/dist/types-BULrFyuQ.d.ts +316 -0
- package/dist/vector/index.d.cts +1 -1
- package/dist/vector/index.d.ts +1 -1
- package/package.json +14 -1
- package/dist/chunk-AMWXSYCI.js.map +0 -1
- package/dist/chunk-XFYUFVAX.cjs +0 -826
- package/dist/chunk-XFYUFVAX.cjs.map +0 -1
package/dist/chart/index.d.cts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { C as ChartValueScale, a as ChartNumberFormat, b as ChartValue, c as ChartRect, d as ChartErrorBars, e as ChartErrorBarType, f as ChartScene, g as ChartSpec, h as ChartLayoutOptions, i as ChartTheme, j as ChartWarning, k as ChartAxis, l as ChartLegend, m as ChartType, n as ChartStacking, o as ChartSeries, p as ChartIssue, q as ChartController, r as ChartSelection, s as ChartSpecPatch } from '../controller-CX0QfSv0.cjs';
|
|
2
2
|
export { t as CHART_AXIS_KINDS, u as CHART_AXIS_SCALES, v as CHART_CURVES, w as CHART_LABEL_POSITIONS, x as CHART_LEGEND_POSITIONS, y as CHART_MARKERS, z as CHART_NUMBER_STYLES, A as CHART_ORIENTATIONS, B as CHART_SERIES_TYPES, D as CHART_STACKINGS, E as CHART_TRENDLINE_TYPES, F as CHART_TYPES, G as CHART_TYPE_LABELS, H as CSS_VARIABLE_CHART_THEME, I as ChartActionResult, J as ChartCircleMark, K as ChartControllerOptions, L as ChartCurve, M as ChartDomSpec, N as ChartEditOptions, O as ChartFamily, P as ChartLabelPosition, Q as ChartLegendPosition, R as ChartLineMark, S as ChartMark, T as ChartMarkRole, U as ChartMarker, V as ChartOrientation, W as ChartPathMark, X as ChartRectMark, Y as ChartSeriesInput, Z as ChartSeriesPatch, _ as ChartSeriesType, $ as ChartSparklineKind, a0 as ChartSparklineOptions, a1 as ChartState, a2 as ChartSvgOptions, a3 as ChartTableData, a4 as ChartTableOptions, a5 as ChartTextMark, a6 as ChartTextMeasure, a7 as ChartTrendFit, a8 as ChartTrendline, a9 as ChartTrendlineType, aa as DEFAULT_CHART_PALETTE, ab as DEFAULT_CHART_THEME, ac as chartColorInputValue, ad as chartColorsByCategory, ae as chartDataFromTable, af as chartDataToTable, ag as chartFamily, ah as chartMovingAverage, ai as chartPointColor, aj as chartSceneToDomSpec, ak as chartSceneToSvg, al as chartSeriesColor, am as chartSeriesType, an as chartSliceColor, ao as chartSupportsTrendlines, ap as chartTextBaseline, aq as chartTextTransform, ar as chartToSvg, as as chartTrendlineName, at as cloneChartSeries, au as cloneChartSpec, av as contrastingTextColor, aw as createChartController, ax as createChartSpec, ay as defaultChartAxis, az as estimateChartTextWidth, aA as fitChartTrendline, aB as isCartesianChart, aC as isXyChart, aD as layoutSparkline, aE as normalizeChartAxis, aF as normalizeChartErrorBars, aG as normalizeChartSpec, aH as normalizeChartTrendline, aI as normalizeChartValues, aJ as parseChartValue, aK as sameChartSelection, aL as sparklineToSvg, aM as trendNumberText, aN as uniqueChartSeriesId } from '../controller-CX0QfSv0.cjs';
|
|
3
3
|
import { C as CommandSpec } from '../registry-CaR7LC6W.cjs';
|
|
4
|
-
import { A as AgentToolProvider } from '../registry-
|
|
4
|
+
import { A as AgentToolProvider } from '../registry-DIpIaCkH.cjs';
|
|
5
|
+
import { e as PresenceClock, g as PresenceStore, d as PresenceActorInfo, c as PresenceActor, f as PresenceState, h as createInstantPresenceClock } from '../presence-Cb6WhcrQ.cjs';
|
|
5
6
|
import { Z as ZipReadOptions } from '../zip-4nG0YAH7.cjs';
|
|
6
7
|
import '../HistoryManager-DeQQMBCj.cjs';
|
|
7
8
|
import '../types-DsiXGmjo.cjs';
|
|
@@ -774,42 +775,17 @@ interface ChartOoxmlWriteResult {
|
|
|
774
775
|
*/
|
|
775
776
|
declare function chartToOoxml(spec: ChartSpec): ChartOoxmlWriteResult;
|
|
776
777
|
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
name: string;
|
|
780
|
-
color: string;
|
|
781
|
-
/** Cursor position in scene coordinates. */
|
|
782
|
-
x: number;
|
|
783
|
-
y: number;
|
|
784
|
-
/** The button is down (dragging). */
|
|
785
|
-
pressed: boolean;
|
|
786
|
-
/** A short note shown next to the cursor (what the agent is doing). */
|
|
787
|
-
message?: string;
|
|
788
|
-
}
|
|
789
|
-
interface ChartPresenceState {
|
|
790
|
-
actors: readonly ChartPresenceActor[];
|
|
791
|
-
}
|
|
778
|
+
type ChartPresenceActor = PresenceActor;
|
|
779
|
+
type ChartPresenceState = PresenceState;
|
|
792
780
|
/** Cursor positions and notes of agents acting on a chart, for an overlay. */
|
|
793
|
-
declare class ChartPresence {
|
|
794
|
-
private state;
|
|
795
|
-
private readonly listeners;
|
|
796
|
-
getState: () => ChartPresenceState;
|
|
797
|
-
subscribe: (listener: (state: ChartPresenceState) => void) => (() => void);
|
|
798
|
-
/** Adds or changes an actor. */
|
|
799
|
-
set(actor: Pick<ChartPresenceActor, 'id'> & Partial<ChartPresenceActor>): void;
|
|
800
|
-
remove(id: string): void;
|
|
781
|
+
declare class ChartPresence extends PresenceStore {
|
|
801
782
|
}
|
|
802
783
|
declare const CHART_PRESENCE_COLORS: readonly string[];
|
|
803
784
|
/** Time for performances: real timers, or an instant clock for tests and recordings. */
|
|
804
|
-
|
|
805
|
-
now(): number;
|
|
806
|
-
wait(ms: number): Promise<void>;
|
|
807
|
-
}
|
|
785
|
+
type ChartClock = PresenceClock;
|
|
808
786
|
declare const realChartClock: ChartClock;
|
|
809
787
|
/** A clock whose waits finish at once while its time still advances (repeatable performances). */
|
|
810
|
-
declare
|
|
811
|
-
elapsed(): number;
|
|
812
|
-
};
|
|
788
|
+
declare const createInstantChartClock: typeof createInstantPresenceClock;
|
|
813
789
|
/** What an agent asks for. Each command commits as one undo step. */
|
|
814
790
|
type ChartAgentCommand = {
|
|
815
791
|
kind: 'setValue';
|
|
@@ -877,11 +853,7 @@ interface ChartDirectorOptions {
|
|
|
877
853
|
/** Hide each actor's cursor this long after its last command (ms, default 1500; 0 keeps it). */
|
|
878
854
|
linger?: number;
|
|
879
855
|
}
|
|
880
|
-
|
|
881
|
-
id: string;
|
|
882
|
-
name?: string;
|
|
883
|
-
color?: string;
|
|
884
|
-
}
|
|
856
|
+
type ChartDirectorActor = PresenceActorInfo;
|
|
885
857
|
type ChartPerformanceResult = {
|
|
886
858
|
ok: true;
|
|
887
859
|
command: ChartAgentCommand;
|
|
@@ -900,9 +872,8 @@ declare class ChartDirector {
|
|
|
900
872
|
private readonly controller;
|
|
901
873
|
readonly presence: ChartPresence;
|
|
902
874
|
private readonly options;
|
|
903
|
-
private readonly queues;
|
|
904
875
|
private readonly clock;
|
|
905
|
-
private
|
|
876
|
+
private readonly queue;
|
|
906
877
|
constructor(controller: ChartController, presence: ChartPresence, options: ChartDirectorOptions);
|
|
907
878
|
/** Acts out `commands` in order for `actor`. Resolves with one result per command. */
|
|
908
879
|
perform(actor: ChartDirectorActor, commands: readonly ChartAgentCommand[]): Promise<ChartPerformanceResult[]>;
|
package/dist/chart/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { C as ChartValueScale, a as ChartNumberFormat, b as ChartValue, c as ChartRect, d as ChartErrorBars, e as ChartErrorBarType, f as ChartScene, g as ChartSpec, h as ChartLayoutOptions, i as ChartTheme, j as ChartWarning, k as ChartAxis, l as ChartLegend, m as ChartType, n as ChartStacking, o as ChartSeries, p as ChartIssue, q as ChartController, r as ChartSelection, s as ChartSpecPatch } from '../controller-DscWQbjO.js';
|
|
2
2
|
export { t as CHART_AXIS_KINDS, u as CHART_AXIS_SCALES, v as CHART_CURVES, w as CHART_LABEL_POSITIONS, x as CHART_LEGEND_POSITIONS, y as CHART_MARKERS, z as CHART_NUMBER_STYLES, A as CHART_ORIENTATIONS, B as CHART_SERIES_TYPES, D as CHART_STACKINGS, E as CHART_TRENDLINE_TYPES, F as CHART_TYPES, G as CHART_TYPE_LABELS, H as CSS_VARIABLE_CHART_THEME, I as ChartActionResult, J as ChartCircleMark, K as ChartControllerOptions, L as ChartCurve, M as ChartDomSpec, N as ChartEditOptions, O as ChartFamily, P as ChartLabelPosition, Q as ChartLegendPosition, R as ChartLineMark, S as ChartMark, T as ChartMarkRole, U as ChartMarker, V as ChartOrientation, W as ChartPathMark, X as ChartRectMark, Y as ChartSeriesInput, Z as ChartSeriesPatch, _ as ChartSeriesType, $ as ChartSparklineKind, a0 as ChartSparklineOptions, a1 as ChartState, a2 as ChartSvgOptions, a3 as ChartTableData, a4 as ChartTableOptions, a5 as ChartTextMark, a6 as ChartTextMeasure, a7 as ChartTrendFit, a8 as ChartTrendline, a9 as ChartTrendlineType, aa as DEFAULT_CHART_PALETTE, ab as DEFAULT_CHART_THEME, ac as chartColorInputValue, ad as chartColorsByCategory, ae as chartDataFromTable, af as chartDataToTable, ag as chartFamily, ah as chartMovingAverage, ai as chartPointColor, aj as chartSceneToDomSpec, ak as chartSceneToSvg, al as chartSeriesColor, am as chartSeriesType, an as chartSliceColor, ao as chartSupportsTrendlines, ap as chartTextBaseline, aq as chartTextTransform, ar as chartToSvg, as as chartTrendlineName, at as cloneChartSeries, au as cloneChartSpec, av as contrastingTextColor, aw as createChartController, ax as createChartSpec, ay as defaultChartAxis, az as estimateChartTextWidth, aA as fitChartTrendline, aB as isCartesianChart, aC as isXyChart, aD as layoutSparkline, aE as normalizeChartAxis, aF as normalizeChartErrorBars, aG as normalizeChartSpec, aH as normalizeChartTrendline, aI as normalizeChartValues, aJ as parseChartValue, aK as sameChartSelection, aL as sparklineToSvg, aM as trendNumberText, aN as uniqueChartSeriesId } from '../controller-DscWQbjO.js';
|
|
3
3
|
import { C as CommandSpec } from '../registry-rVtFJjRM.js';
|
|
4
|
-
import { A as AgentToolProvider } from '../registry-
|
|
4
|
+
import { A as AgentToolProvider } from '../registry-7AZFuand.js';
|
|
5
|
+
import { e as PresenceClock, g as PresenceStore, d as PresenceActorInfo, c as PresenceActor, f as PresenceState, h as createInstantPresenceClock } from '../presence-Cb6WhcrQ.js';
|
|
5
6
|
import { Z as ZipReadOptions } from '../zip-4nG0YAH7.js';
|
|
6
7
|
import '../HistoryManager-DWSLd6Tf.js';
|
|
7
8
|
import '../types-DsiXGmjo.js';
|
|
@@ -774,42 +775,17 @@ interface ChartOoxmlWriteResult {
|
|
|
774
775
|
*/
|
|
775
776
|
declare function chartToOoxml(spec: ChartSpec): ChartOoxmlWriteResult;
|
|
776
777
|
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
name: string;
|
|
780
|
-
color: string;
|
|
781
|
-
/** Cursor position in scene coordinates. */
|
|
782
|
-
x: number;
|
|
783
|
-
y: number;
|
|
784
|
-
/** The button is down (dragging). */
|
|
785
|
-
pressed: boolean;
|
|
786
|
-
/** A short note shown next to the cursor (what the agent is doing). */
|
|
787
|
-
message?: string;
|
|
788
|
-
}
|
|
789
|
-
interface ChartPresenceState {
|
|
790
|
-
actors: readonly ChartPresenceActor[];
|
|
791
|
-
}
|
|
778
|
+
type ChartPresenceActor = PresenceActor;
|
|
779
|
+
type ChartPresenceState = PresenceState;
|
|
792
780
|
/** Cursor positions and notes of agents acting on a chart, for an overlay. */
|
|
793
|
-
declare class ChartPresence {
|
|
794
|
-
private state;
|
|
795
|
-
private readonly listeners;
|
|
796
|
-
getState: () => ChartPresenceState;
|
|
797
|
-
subscribe: (listener: (state: ChartPresenceState) => void) => (() => void);
|
|
798
|
-
/** Adds or changes an actor. */
|
|
799
|
-
set(actor: Pick<ChartPresenceActor, 'id'> & Partial<ChartPresenceActor>): void;
|
|
800
|
-
remove(id: string): void;
|
|
781
|
+
declare class ChartPresence extends PresenceStore {
|
|
801
782
|
}
|
|
802
783
|
declare const CHART_PRESENCE_COLORS: readonly string[];
|
|
803
784
|
/** Time for performances: real timers, or an instant clock for tests and recordings. */
|
|
804
|
-
|
|
805
|
-
now(): number;
|
|
806
|
-
wait(ms: number): Promise<void>;
|
|
807
|
-
}
|
|
785
|
+
type ChartClock = PresenceClock;
|
|
808
786
|
declare const realChartClock: ChartClock;
|
|
809
787
|
/** A clock whose waits finish at once while its time still advances (repeatable performances). */
|
|
810
|
-
declare
|
|
811
|
-
elapsed(): number;
|
|
812
|
-
};
|
|
788
|
+
declare const createInstantChartClock: typeof createInstantPresenceClock;
|
|
813
789
|
/** What an agent asks for. Each command commits as one undo step. */
|
|
814
790
|
type ChartAgentCommand = {
|
|
815
791
|
kind: 'setValue';
|
|
@@ -877,11 +853,7 @@ interface ChartDirectorOptions {
|
|
|
877
853
|
/** Hide each actor's cursor this long after its last command (ms, default 1500; 0 keeps it). */
|
|
878
854
|
linger?: number;
|
|
879
855
|
}
|
|
880
|
-
|
|
881
|
-
id: string;
|
|
882
|
-
name?: string;
|
|
883
|
-
color?: string;
|
|
884
|
-
}
|
|
856
|
+
type ChartDirectorActor = PresenceActorInfo;
|
|
885
857
|
type ChartPerformanceResult = {
|
|
886
858
|
ok: true;
|
|
887
859
|
command: ChartAgentCommand;
|
|
@@ -900,9 +872,8 @@ declare class ChartDirector {
|
|
|
900
872
|
private readonly controller;
|
|
901
873
|
readonly presence: ChartPresence;
|
|
902
874
|
private readonly options;
|
|
903
|
-
private readonly queues;
|
|
904
875
|
private readonly clock;
|
|
905
|
-
private
|
|
876
|
+
private readonly queue;
|
|
906
877
|
constructor(controller: ChartController, presence: ChartPresence, options: ChartDirectorOptions);
|
|
907
878
|
/** Acts out `commands` in order for `actor`. Resolves with one result per command. */
|
|
908
879
|
perform(actor: ChartDirectorActor, commands: readonly ChartAgentCommand[]): Promise<ChartPerformanceResult[]>;
|
package/dist/chart/index.js
CHANGED
|
@@ -142,6 +142,14 @@ import {
|
|
|
142
142
|
parseCsv
|
|
143
143
|
} from "../chunk-664LQYFJ.js";
|
|
144
144
|
import "../chunk-QVZZGT4X.js";
|
|
145
|
+
import {
|
|
146
|
+
PRESENCE_COLORS,
|
|
147
|
+
PerformanceQueue,
|
|
148
|
+
PresenceStore,
|
|
149
|
+
createInstantPresenceClock,
|
|
150
|
+
realPresenceClock,
|
|
151
|
+
tweenPresenceCursor
|
|
152
|
+
} from "../chunk-B6DSIEXA.js";
|
|
145
153
|
|
|
146
154
|
// src/chart/raster.ts
|
|
147
155
|
var CHART_RASTER_MAX_SIZE = 1024;
|
|
@@ -1629,44 +1637,11 @@ function blendChartScenes(from, to, t) {
|
|
|
1629
1637
|
var easeChartTween = (t) => 1 - Math.pow(1 - Math.max(0, Math.min(1, t)), 3);
|
|
1630
1638
|
|
|
1631
1639
|
// src/chart/presence.ts
|
|
1632
|
-
var ChartPresence = class {
|
|
1633
|
-
state = { actors: [] };
|
|
1634
|
-
listeners = /* @__PURE__ */ new Set();
|
|
1635
|
-
getState = () => this.state;
|
|
1636
|
-
subscribe = (listener) => {
|
|
1637
|
-
this.listeners.add(listener);
|
|
1638
|
-
return () => {
|
|
1639
|
-
this.listeners.delete(listener);
|
|
1640
|
-
};
|
|
1641
|
-
};
|
|
1642
|
-
/** Adds or changes an actor. */
|
|
1643
|
-
set(actor) {
|
|
1644
|
-
const current = this.state.actors.find((a) => a.id === actor.id);
|
|
1645
|
-
const next = { name: actor.id, color: CHART_PRESENCE_COLORS[this.state.actors.length % CHART_PRESENCE_COLORS.length], x: 0, y: 0, pressed: false, ...current, ...actor };
|
|
1646
|
-
this.state = { actors: current ? this.state.actors.map((a) => a.id === actor.id ? next : a) : [...this.state.actors, next] };
|
|
1647
|
-
this.listeners.forEach((l) => l(this.state));
|
|
1648
|
-
}
|
|
1649
|
-
remove(id) {
|
|
1650
|
-
if (!this.state.actors.some((a) => a.id === id)) return;
|
|
1651
|
-
this.state = { actors: this.state.actors.filter((a) => a.id !== id) };
|
|
1652
|
-
this.listeners.forEach((l) => l(this.state));
|
|
1653
|
-
}
|
|
1654
|
-
};
|
|
1655
|
-
var CHART_PRESENCE_COLORS = ["#7c3aed", "#db2777", "#0891b2", "#ea580c", "#16a34a"];
|
|
1656
|
-
var realChartClock = {
|
|
1657
|
-
now: () => Date.now(),
|
|
1658
|
-
wait: (ms) => new Promise((resolve2) => setTimeout(resolve2, Math.max(0, ms)))
|
|
1640
|
+
var ChartPresence = class extends PresenceStore {
|
|
1659
1641
|
};
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
now: () => t,
|
|
1664
|
-
wait: async (ms) => {
|
|
1665
|
-
t += Math.max(0, ms);
|
|
1666
|
-
},
|
|
1667
|
-
elapsed: () => t - start
|
|
1668
|
-
};
|
|
1669
|
-
}
|
|
1642
|
+
var CHART_PRESENCE_COLORS = PRESENCE_COLORS;
|
|
1643
|
+
var realChartClock = realPresenceClock;
|
|
1644
|
+
var createInstantChartClock = createInstantPresenceClock;
|
|
1670
1645
|
function chartPointAnchor(scene, seriesId, index) {
|
|
1671
1646
|
const mark = scene.marks.find((m) => (m.role === "bar" || m.role === "point") && m.target?.kind === "point" && m.target.seriesId === seriesId && m.target.index === index);
|
|
1672
1647
|
if (!mark) return null;
|
|
@@ -1733,35 +1708,25 @@ var ChartDirector = class {
|
|
|
1733
1708
|
this.presence = presence;
|
|
1734
1709
|
this.options = options;
|
|
1735
1710
|
this.clock = options.clock ?? realChartClock;
|
|
1711
|
+
this.queue = new PerformanceQueue(presence, {
|
|
1712
|
+
clock: this.clock,
|
|
1713
|
+
linger: options.linger,
|
|
1714
|
+
beginGesture: (key) => controller.beginGesture(key),
|
|
1715
|
+
endGesture: () => controller.endGesture()
|
|
1716
|
+
});
|
|
1736
1717
|
}
|
|
1737
1718
|
controller;
|
|
1738
1719
|
presence;
|
|
1739
1720
|
options;
|
|
1740
|
-
queues = /* @__PURE__ */ new Map();
|
|
1741
1721
|
clock;
|
|
1742
|
-
|
|
1722
|
+
queue;
|
|
1743
1723
|
/** Acts out `commands` in order for `actor`. Resolves with one result per command. */
|
|
1744
1724
|
perform(actor, commands) {
|
|
1745
|
-
|
|
1746
|
-
const run = prev.then(async () => {
|
|
1725
|
+
return this.queue.run(actor, async () => {
|
|
1747
1726
|
const results = [];
|
|
1748
|
-
|
|
1749
|
-
this.controller.beginGesture(`agent:${actor.id}:${++this.calls}`);
|
|
1750
|
-
try {
|
|
1751
|
-
for (const command of commands) results.push(await this.performOne(actor.id, command));
|
|
1752
|
-
} finally {
|
|
1753
|
-
this.controller.endGesture();
|
|
1754
|
-
this.presence.set({ id: actor.id, message: void 0, pressed: false });
|
|
1755
|
-
}
|
|
1756
|
-
const linger = this.options.linger ?? 1500;
|
|
1757
|
-
if (linger > 0) {
|
|
1758
|
-
await this.clock.wait(linger);
|
|
1759
|
-
if (this.queues.get(actor.id) === run) this.presence.remove(actor.id);
|
|
1760
|
-
}
|
|
1727
|
+
for (const command of commands) results.push(await this.performOne(actor.id, command));
|
|
1761
1728
|
return results;
|
|
1762
1729
|
});
|
|
1763
|
-
this.queues.set(actor.id, run.catch(() => void 0));
|
|
1764
|
-
return run;
|
|
1765
1730
|
}
|
|
1766
1731
|
stale(command) {
|
|
1767
1732
|
const spec = this.controller.getSpec();
|
|
@@ -1773,15 +1738,8 @@ var ChartDirector = class {
|
|
|
1773
1738
|
}
|
|
1774
1739
|
return null;
|
|
1775
1740
|
}
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
for (let f = 1; f <= frames; f++) {
|
|
1779
|
-
const t = f / frames;
|
|
1780
|
-
const e = 1 - Math.pow(1 - t, 3);
|
|
1781
|
-
this.presence.set({ id, x: from.x + (to.x - from.x) * e, y: from.y + (to.y - from.y) * e });
|
|
1782
|
-
each?.(e);
|
|
1783
|
-
await this.clock.wait(ms / frames);
|
|
1784
|
-
}
|
|
1741
|
+
move(id, from, to, ms, each) {
|
|
1742
|
+
return tweenPresenceCursor(this.presence, this.clock, id, from, to, ms, each);
|
|
1785
1743
|
}
|
|
1786
1744
|
async performOne(id, command) {
|
|
1787
1745
|
const stale = this.stale(command);
|