@punica/editor 1.6.9 → 1.6.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@punica/editor",
3
- "version": "1.6.9",
3
+ "version": "1.6.11",
4
4
  "description": "Punica Editor",
5
5
  "private": false,
6
6
  "type": "module",
@@ -10,6 +10,13 @@ declare module 'punica' {
10
10
  alignment: Alignment;
11
11
  title: string;
12
12
  icon: string;
13
+ /**
14
+ * Live state of whatever the item reflects, drawn as a status dot in
15
+ * front of the icon (`running`/`busy` pulse). Put the state here rather
16
+ * than spelling it out in `label` — a ▶/▷ character is indistinguishable
17
+ * at this size and font-dependent.
18
+ */
19
+ status?: View.Helpers.StatusDotState;
13
20
  /** Command (or capability) id executed when the item is clicked. */
14
21
  command?: string;
15
22
  capability?: string;
@@ -437,6 +437,33 @@ declare module 'punica' {
437
437
  // right-aligned meta, and no inline buttons — per-row actions live in
438
438
  // a right-click context menu (attachContextMenu).
439
439
 
440
+ /**
441
+ * The one status-glyph vocabulary in the shell: a card dot, a
442
+ * status-bar item's state and a server row all speak it, so "running"
443
+ * looks the same everywhere. `busy` covers work with a known end
444
+ * (an engine download); `success` is a finished run, not a live one.
445
+ */
446
+ type StatusDotState =
447
+ | 'running'
448
+ | 'busy'
449
+ | 'paused'
450
+ | 'stopped'
451
+ | 'idle'
452
+ | 'error'
453
+ | 'success'
454
+ | 'warning';
455
+
456
+ interface StatusDotOptions {
457
+ /**
458
+ * Animate the dot. Reserved for surfaces showing a single subject —
459
+ * a list of blinking rows is noise. Ignored under
460
+ * `prefers-reduced-motion`.
461
+ */
462
+ pulse?: boolean;
463
+ /** Extra class names appended to the dot. */
464
+ className?: string;
465
+ }
466
+
440
467
  interface SidebarCardOptions {
441
468
  /** Stable row id → data-node-id; the context-menu row resolver key. */
442
469
  id: string;
@@ -445,14 +472,7 @@ declare module 'punica' {
445
472
  /** Muted subtitle under the title. */
446
473
  sub?: string;
447
474
  /** Status dot variant; takes precedence over `icon`. */
448
- dot?:
449
- | 'running'
450
- | 'paused'
451
- | 'stopped'
452
- | 'idle'
453
- | 'error'
454
- | 'success'
455
- | 'warning';
475
+ dot?: StatusDotState;
456
476
  /** FontAwesome icon class for the left glyph when there is no dot. */
457
477
  icon?: string;
458
478
  /** Optional right-aligned monospace meta (ports, size, …). */
@@ -485,6 +505,15 @@ declare module 'punica' {
485
505
  /** Build one standard sidebar/panel list card. */
486
506
  function createSidebarCard(options: SidebarCardOptions): HTMLElement;
487
507
 
508
+ /**
509
+ * Build one status dot. Use this rather than a hand-rolled circle (or a
510
+ * ▶/▷ character in a label) so every surface reports state identically.
511
+ */
512
+ function createStatusDot(
513
+ state: StatusDotState,
514
+ options?: StatusDotOptions
515
+ ): HTMLElement;
516
+
488
517
  /** Build an uppercase section header with a trailing divider rule. */
489
518
  function createGroupHeader(
490
519
  options: GroupHeaderOptions | string