@wildwinter/app-shell 0.22.0 → 0.24.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/index.d.cts CHANGED
@@ -221,12 +221,25 @@ declare function mountSettingsDialog(opts: SettingsDialogOptions): SettingsDialo
221
221
 
222
222
  interface PinButtonOptions {
223
223
  pinned: boolean;
224
- /** Persist the choice (the button keeps its own visual state). */
224
+ /** Persist the choice. The button reflects the click itself. */
225
225
  onToggle: (on: boolean) => void;
226
226
  }
227
+ /** A pin and the handle to drive it, the same shape `saveIndicator` returns. */
228
+ interface PinButton {
229
+ el: HTMLButtonElement;
230
+ /**
231
+ * Reflect a pin state decided ELSEWHERE, without calling `onToggle`.
232
+ *
233
+ * The state is not always the button's to choose: main re-pins a helper window
234
+ * on Reset View, and the window is told after the fact. Before this existed a
235
+ * host had to reach in and set the class, the aria and the title by hand,
236
+ * which is three chances to disagree with the button about what it is showing.
237
+ */
238
+ set: (pinned: boolean) => void;
239
+ }
227
240
  /** The always-on-top pin: `.swin-pin`, aria-pressed, and a tooltip that says
228
241
  * what a click will do (the richest of the family's variants, kept). */
229
- declare function pinButton(opts: PinButtonOptions): HTMLButtonElement;
242
+ declare function pinButton(opts: PinButtonOptions): PinButton;
230
243
 
231
244
  interface ConfirmOptions {
232
245
  title: string;
@@ -681,4 +694,4 @@ interface StepperBarOptions {
681
694
  /** Draw (or hide) the bar in `host`. Idempotent: call it again with new state. */
682
695
  declare function renderStepperBar(host: HTMLElement, opts: StepperBarOptions): void;
683
696
 
684
- export { type AboutOptions, type AnchoredPanel, type AnchoredPanelOptions, type Child, type Comment, type CommentMessage, type CommentsOptions, type ConfirmOptions, type DocLine, type DupGuard, type ElProps, type GameIdEditorOptions, type IconName, type IconSvgName, type Identity, type IdentityOptions, type JobProgressOptions, type JobProgressView, type Notes, type NotesEditorOptions, PALETTE, PALETTE_SIZE, type PaneShell, type PaneShellOptions, type PaneShellState, type PaneSide, type PaneSideConfig, type PinButtonOptions, type SaveController, type SaveControllerOptions, type SaveIndicator, type SaveStatus, type SettingsDialog, type SettingsDialogOptions, type SettingsSection, type SettingsSectionHandle, type ShardVc, type StaleBarOptions, type StepperBarOptions, type StepperItem, type StepperTone, type TipRect, type TooltipOptions, type VcMap, askIdentity, closeAnchoredPanel, closeWithExit, colourFor, colourIndex, confirmDialog, createSaveController, dupGuard, el, expandableRow, focusNewRow, foldVc, gameIdify, hideTip, icon, iconBtn, iconSvg, initTooltips, isValidGameId, labelled, lockControls, lockNotice, mountJobProgress, mountPaneShell, mountSettingsDialog, moveItem, openAnchoredPanel, openComments, openGameIdEditor, openNotesEditor, paintVcBadges, pinButton, placeAnchored, renderStepperBar, saveIndicator, showAbout, staleBar, tagChips, tipAt, tipBold, vcBadgeFor };
697
+ export { type AboutOptions, type AnchoredPanel, type AnchoredPanelOptions, type Child, type Comment, type CommentMessage, type CommentsOptions, type ConfirmOptions, type DocLine, type DupGuard, type ElProps, type GameIdEditorOptions, type IconName, type IconSvgName, type Identity, type IdentityOptions, type JobProgressOptions, type JobProgressView, type Notes, type NotesEditorOptions, PALETTE, PALETTE_SIZE, type PaneShell, type PaneShellOptions, type PaneShellState, type PaneSide, type PaneSideConfig, type PinButton, type PinButtonOptions, type SaveController, type SaveControllerOptions, type SaveIndicator, type SaveStatus, type SettingsDialog, type SettingsDialogOptions, type SettingsSection, type SettingsSectionHandle, type ShardVc, type StaleBarOptions, type StepperBarOptions, type StepperItem, type StepperTone, type TipRect, type TooltipOptions, type VcMap, askIdentity, closeAnchoredPanel, closeWithExit, colourFor, colourIndex, confirmDialog, createSaveController, dupGuard, el, expandableRow, focusNewRow, foldVc, gameIdify, hideTip, icon, iconBtn, iconSvg, initTooltips, isValidGameId, labelled, lockControls, lockNotice, mountJobProgress, mountPaneShell, mountSettingsDialog, moveItem, openAnchoredPanel, openComments, openGameIdEditor, openNotesEditor, paintVcBadges, pinButton, placeAnchored, renderStepperBar, saveIndicator, showAbout, staleBar, tagChips, tipAt, tipBold, vcBadgeFor };
package/dist/index.d.ts CHANGED
@@ -221,12 +221,25 @@ declare function mountSettingsDialog(opts: SettingsDialogOptions): SettingsDialo
221
221
 
222
222
  interface PinButtonOptions {
223
223
  pinned: boolean;
224
- /** Persist the choice (the button keeps its own visual state). */
224
+ /** Persist the choice. The button reflects the click itself. */
225
225
  onToggle: (on: boolean) => void;
226
226
  }
227
+ /** A pin and the handle to drive it, the same shape `saveIndicator` returns. */
228
+ interface PinButton {
229
+ el: HTMLButtonElement;
230
+ /**
231
+ * Reflect a pin state decided ELSEWHERE, without calling `onToggle`.
232
+ *
233
+ * The state is not always the button's to choose: main re-pins a helper window
234
+ * on Reset View, and the window is told after the fact. Before this existed a
235
+ * host had to reach in and set the class, the aria and the title by hand,
236
+ * which is three chances to disagree with the button about what it is showing.
237
+ */
238
+ set: (pinned: boolean) => void;
239
+ }
227
240
  /** The always-on-top pin: `.swin-pin`, aria-pressed, and a tooltip that says
228
241
  * what a click will do (the richest of the family's variants, kept). */
229
- declare function pinButton(opts: PinButtonOptions): HTMLButtonElement;
242
+ declare function pinButton(opts: PinButtonOptions): PinButton;
230
243
 
231
244
  interface ConfirmOptions {
232
245
  title: string;
@@ -681,4 +694,4 @@ interface StepperBarOptions {
681
694
  /** Draw (or hide) the bar in `host`. Idempotent: call it again with new state. */
682
695
  declare function renderStepperBar(host: HTMLElement, opts: StepperBarOptions): void;
683
696
 
684
- export { type AboutOptions, type AnchoredPanel, type AnchoredPanelOptions, type Child, type Comment, type CommentMessage, type CommentsOptions, type ConfirmOptions, type DocLine, type DupGuard, type ElProps, type GameIdEditorOptions, type IconName, type IconSvgName, type Identity, type IdentityOptions, type JobProgressOptions, type JobProgressView, type Notes, type NotesEditorOptions, PALETTE, PALETTE_SIZE, type PaneShell, type PaneShellOptions, type PaneShellState, type PaneSide, type PaneSideConfig, type PinButtonOptions, type SaveController, type SaveControllerOptions, type SaveIndicator, type SaveStatus, type SettingsDialog, type SettingsDialogOptions, type SettingsSection, type SettingsSectionHandle, type ShardVc, type StaleBarOptions, type StepperBarOptions, type StepperItem, type StepperTone, type TipRect, type TooltipOptions, type VcMap, askIdentity, closeAnchoredPanel, closeWithExit, colourFor, colourIndex, confirmDialog, createSaveController, dupGuard, el, expandableRow, focusNewRow, foldVc, gameIdify, hideTip, icon, iconBtn, iconSvg, initTooltips, isValidGameId, labelled, lockControls, lockNotice, mountJobProgress, mountPaneShell, mountSettingsDialog, moveItem, openAnchoredPanel, openComments, openGameIdEditor, openNotesEditor, paintVcBadges, pinButton, placeAnchored, renderStepperBar, saveIndicator, showAbout, staleBar, tagChips, tipAt, tipBold, vcBadgeFor };
697
+ export { type AboutOptions, type AnchoredPanel, type AnchoredPanelOptions, type Child, type Comment, type CommentMessage, type CommentsOptions, type ConfirmOptions, type DocLine, type DupGuard, type ElProps, type GameIdEditorOptions, type IconName, type IconSvgName, type Identity, type IdentityOptions, type JobProgressOptions, type JobProgressView, type Notes, type NotesEditorOptions, PALETTE, PALETTE_SIZE, type PaneShell, type PaneShellOptions, type PaneShellState, type PaneSide, type PaneSideConfig, type PinButton, type PinButtonOptions, type SaveController, type SaveControllerOptions, type SaveIndicator, type SaveStatus, type SettingsDialog, type SettingsDialogOptions, type SettingsSection, type SettingsSectionHandle, type ShardVc, type StaleBarOptions, type StepperBarOptions, type StepperItem, type StepperTone, type TipRect, type TooltipOptions, type VcMap, askIdentity, closeAnchoredPanel, closeWithExit, colourFor, colourIndex, confirmDialog, createSaveController, dupGuard, el, expandableRow, focusNewRow, foldVc, gameIdify, hideTip, icon, iconBtn, iconSvg, initTooltips, isValidGameId, labelled, lockControls, lockNotice, mountJobProgress, mountPaneShell, mountSettingsDialog, moveItem, openAnchoredPanel, openComments, openGameIdEditor, openNotesEditor, paintVcBadges, pinButton, placeAnchored, renderStepperBar, saveIndicator, showAbout, staleBar, tagChips, tipAt, tipBold, vcBadgeFor };
package/dist/index.js CHANGED
@@ -473,7 +473,10 @@ function pinButton(opts) {
473
473
  reflect();
474
474
  opts.onToggle(pinned);
475
475
  });
476
- return b;
476
+ return { el: b, set: (next) => {
477
+ pinned = next;
478
+ reflect();
479
+ } };
477
480
  }
478
481
 
479
482
  // src/exit.ts