@pixerate/editor-svelte 0.122.0 → 0.123.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.
@@ -87,7 +87,8 @@
87
87
  valueDomain: frozen?.valueDomain,
88
88
  valueDomain2: frozen?.valueDomain2,
89
89
  xDomain: frozen?.xDomain,
90
- readout: frozen?.readout
90
+ readout: frozen?.readout,
91
+ raceFrame: view.current.raceFrame
91
92
  })
92
93
  );
93
94
  $effect(() => {
@@ -71,6 +71,9 @@
71
71
  const spec = $derived(view.current.spec);
72
72
  const selectedSeries = $derived(view.current.selectedSeries);
73
73
  const selection = $derived(view.current.selection);
74
+ const raceFrame = $derived(view.current.raceFrame);
75
+ const racePlaying = $derived(view.current.racePlaying);
76
+ const raceAt = $derived(raceFrame ?? Math.max(0, spec.categories.length - 1));
74
77
  const show = (section: ChartInspectorSection) => !sections || sections.includes(section);
75
78
  const cartesian = $derived(isCartesianChart(spec.type));
76
79
  const family = $derived(chartFamily(spec));
@@ -424,6 +427,35 @@
424
427
  </div>
425
428
  </div>
426
429
  {/if}
430
+ {#if spec.type === 'barrace'}
431
+ <div class="flex items-center gap-2">
432
+ <label for="{idPrefix}-race-top" class="{chartLabelClass} w-20 shrink-0">Bars</label>
433
+ <div class="min-w-0 flex-1">
434
+ <ChartCommitInput id="{idPrefix}-race-top" value={String(spec.raceTopN)} inputmode="numeric" data-option="raceTopN" oncommit={(text) => controller.update({ raceTopN: Number(text) }).ok} />
435
+ </div>
436
+ </div>
437
+ {#if spec.categories.length > 1}
438
+ <div class="flex items-center gap-2">
439
+ <label for="{idPrefix}-race-frame" class="{chartLabelClass} w-20 shrink-0">Time</label>
440
+ <div class="flex min-w-0 flex-1 items-center gap-1">
441
+ <button type="button" class={chartButtonClass} data-action="race-play" aria-label={racePlaying ? 'Pause the race' : 'Play the race'} onclick={() => (racePlaying ? controller.pauseRace() : controller.playRace())}>{racePlaying ? 'Pause' : 'Play'}</button>
442
+ <input
443
+ id="{idPrefix}-race-frame"
444
+ type="range"
445
+ min="0"
446
+ max={spec.categories.length - 1}
447
+ step="0.01"
448
+ value={raceAt}
449
+ data-option="raceFrame"
450
+ aria-valuetext={spec.categories[Math.round(raceAt)]}
451
+ class="min-w-0 flex-1 accent-primary"
452
+ oninput={(e) => controller.setRaceFrame(Number(e.currentTarget.value))}
453
+ />
454
+ <span class="w-12 shrink-0 truncate text-right tabular-nums text-muted-foreground" data-race-time="">{spec.categories[Math.round(raceAt)]}</span>
455
+ </div>
456
+ </div>
457
+ {/if}
458
+ {/if}
427
459
  {#if spec.type === 'sankey'}
428
460
  <div class="flex items-center gap-2">
429
461
  <label for="{idPrefix}-sankey-color" class="{chartLabelClass} w-20 shrink-0">Flows</label>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pixerate/editor-svelte",
3
- "version": "0.122.0",
3
+ "version": "0.123.0",
4
4
  "description": "Svelte bindings and prompt/rich-text components for @pixerate/editor",
5
5
  "author": "Pixerate",
6
6
  "license": "MIT",
@@ -168,7 +168,7 @@
168
168
  "@tiptap/extension-bubble-menu": "^2.27.3",
169
169
  "@tiptap/extension-placeholder": "^2.27.3",
170
170
  "@tiptap/starter-kit": "^2.27.3",
171
- "@pixerate/editor": "0.165.0"
171
+ "@pixerate/editor": "0.166.0"
172
172
  },
173
173
  "peerDependencies": {
174
174
  "@dagrejs/dagre": "^1.1.4",