@punica/editor 1.18.0 → 1.19.1

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.18.0",
3
+ "version": "1.19.1",
4
4
  "description": "Punica Editor",
5
5
  "private": false,
6
6
  "type": "module",
@@ -655,6 +655,43 @@ declare module 'punica' {
655
655
  count?: string;
656
656
  }
657
657
 
658
+ interface EmptyStateAction {
659
+ label: string;
660
+ onClick: () => void;
661
+ /** Defaults to `filled` for the first action, `outlined` for the rest. */
662
+ variant?: 'filled' | 'outlined' | 'text';
663
+ }
664
+
665
+ interface EmptyStateOptions {
666
+ /** What is missing, as a noun phrase. */
667
+ title: string;
668
+ /** One sentence on how to fix it. */
669
+ detail?: string;
670
+ /** FontAwesome classes. Drawn in the `panel` variant only. */
671
+ icon?: string;
672
+ /** Icon colour. Defaults to `muted`. */
673
+ tone?: 'muted' | 'warning' | 'error';
674
+ /** Omit for a state with nothing to offer but its text. */
675
+ actions?: EmptyStateAction[];
676
+ /**
677
+ * `panel` (default) — the whole view has nothing. `section` — one
678
+ * section of a multi-section panel, or a popover list.
679
+ */
680
+ variant?: 'panel' | 'section';
681
+ /**
682
+ * Centre against the viewport instead of the container. For a panel
683
+ * whose ancestor columns do not propagate a height, where the state
684
+ * would otherwise sit at the top of the blank area.
685
+ */
686
+ fillViewport?: boolean;
687
+ /**
688
+ * Anything the two text lines cannot carry — a code snippet to paste,
689
+ * a row of chips. Appended inside the centred column, so a caller
690
+ * never has to append a sibling and fight `min-height: 100%`.
691
+ */
692
+ extra?: HTMLElement | HTMLElement[];
693
+ }
694
+
658
695
  interface MenuItemSpec {
659
696
  label: string;
660
697
  value: string;
@@ -690,6 +727,18 @@ declare module 'punica' {
690
727
  options: GroupHeaderOptions | string
691
728
  ): HTMLElement;
692
729
 
730
+ /**
731
+ * Build the shared no-data state: centred on both axes, with an
732
+ * optional icon, an optional sentence and zero or more buttons.
733
+ *
734
+ * Shared because a panel with nothing in it is the first thing a new
735
+ * user sees. Before this, 44 extension repos had each written their own
736
+ * `*-empty*` class, and they disagreed on alignment, colour and whether
737
+ * an empty section is even worth a sentence. CSS is injected once
738
+ * (theme-aware).
739
+ */
740
+ function createEmptyState(options: EmptyStateOptions): HTMLElement;
741
+
693
742
  /**
694
743
  * Wire a right-click context menu on a list container. Items are
695
744
  * rebuilt per right-click (state-aware) from the row under the cursor