@wildwinter/app-shell 0.33.1 → 0.34.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/{chunk-YLINCOQD.js → chunk-QDPFU4WX.js} +7 -3
- package/dist/chunk-QDPFU4WX.js.map +1 -0
- package/dist/index.cjs +70 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +38 -2
- package/dist/index.d.ts +38 -2
- package/dist/index.js +65 -2
- package/dist/index.js.map +1 -1
- package/dist/menu.cjs +5 -0
- package/dist/menu.cjs.map +1 -1
- package/dist/menu.d.cts +20 -1
- package/dist/menu.d.ts +20 -1
- package/dist/menu.js +1 -1
- package/dist/pane-shell.css +37 -0
- package/dist/pane-shell.css.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-YLINCOQD.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { EDIT_MENU, MenuLabel, PANE_MENU } from './menu.cjs';
|
|
1
|
+
export { EDIT_MENU, GO_MENU, MenuLabel, PANE_MENU } from './menu.cjs';
|
|
2
2
|
export { JOB_PROGRESS, JobProgress } from './job.cjs';
|
|
3
3
|
|
|
4
4
|
type Child = Node | string | null | undefined;
|
|
@@ -831,4 +831,40 @@ interface StepperBarOptions {
|
|
|
831
831
|
/** Draw (or hide) the bar in `host`. Idempotent: call it again with new state. */
|
|
832
832
|
declare function renderStepperBar(host: HTMLElement, opts: StepperBarOptions): void;
|
|
833
833
|
|
|
834
|
-
|
|
834
|
+
interface NavHistoryOptions<Place> {
|
|
835
|
+
/** Same DOCUMENT: a visit whose place is `same` as the newest entry
|
|
836
|
+
* REPLACES it (keeping the freshest tab) instead of stacking. */
|
|
837
|
+
same(a: Place, b: Place): boolean;
|
|
838
|
+
/** Still restorable? Checked as an entry is stepped onto; a stale one is
|
|
839
|
+
* dropped and the step continues past it. Default: everything is. */
|
|
840
|
+
usable?(p: Place): boolean;
|
|
841
|
+
/** Entries beyond this age off the far end (default 100). */
|
|
842
|
+
cap?: number;
|
|
843
|
+
}
|
|
844
|
+
interface NavHistory<Place> {
|
|
845
|
+
/** Record the place being left, before an ordinary navigation. */
|
|
846
|
+
visit(place: Place): void;
|
|
847
|
+
/** Step back: hands over the current place (it becomes the forward entry)
|
|
848
|
+
* and returns the place to restore, or undefined at the far end. */
|
|
849
|
+
back(current: Place): Place | undefined;
|
|
850
|
+
forward(current: Place): Place | undefined;
|
|
851
|
+
/** Whether the arrows light. Optimistic: a side holding only stale entries
|
|
852
|
+
* still reports true, and the press quietly discards them (the alternative
|
|
853
|
+
* is validating the whole stack on every paint). */
|
|
854
|
+
canBack(): boolean;
|
|
855
|
+
canForward(): boolean;
|
|
856
|
+
}
|
|
857
|
+
declare function createNavHistory<Place>(opts: NavHistoryOptions<Place>): NavHistory<Place>;
|
|
858
|
+
/**
|
|
859
|
+
* The quiet arrow pair, VS Code's shape: two plain chevrons sitting to the
|
|
860
|
+
* left of the app's normal navigation, each greyed when there is nowhere to
|
|
861
|
+
* go. One component so the pair looks and sits the same in every app of the
|
|
862
|
+
* family; the caller re-`set`s it whenever a navigation may have changed what
|
|
863
|
+
* the arrows can do.
|
|
864
|
+
*/
|
|
865
|
+
declare function historyNav(onBack: () => void, onForward: () => void): {
|
|
866
|
+
el: HTMLElement;
|
|
867
|
+
set(canBack: boolean, canForward: boolean): void;
|
|
868
|
+
};
|
|
869
|
+
|
|
870
|
+
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 NavHistory, type NavHistoryOptions, type Notes, type NotesEditorOptions, PALETTE, PALETTE_SIZE, PROPERTY_NAME_HINT, type PaneShell, type PaneShellOptions, type PaneShellState, type PaneSide, type PaneSideConfig, type PinButton, type PinButtonOptions, type PropertyRefOptions, RESERVED_PROPERTY_NAMES, 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, bindPropertyName, bindPropertyRef, closeAnchoredPanel, closeWithExit, colourFor, colourIndex, confirmDialog, createNavHistory, createSaveController, dupGuard, el, expandableRow, firstIllegalPropertyName, focusNewRow, foldVc, gameIdify, hideTip, historyNav, icon, iconBtn, iconSvg, initTooltips, isCaseOnlyPropertyName, isValidGameId, isValidPropertyName, labelled, lockControls, lockNotice, mountJobProgress, mountPaneShell, mountSettingsDialog, moveItem, openAnchoredPanel, openComments, openGameIdEditor, openNotesEditor, paintVcBadges, pinButton, placeAnchored, propertyNameProblem, propertyNameify, propertyRefProblem, renderStepperBar, revalidatePropertyRefs, saveIndicator, showAbout, staleBar, tagChips, tipAt, tipBold, vcBadgeFor };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { EDIT_MENU, MenuLabel, PANE_MENU } from './menu.js';
|
|
1
|
+
export { EDIT_MENU, GO_MENU, MenuLabel, PANE_MENU } from './menu.js';
|
|
2
2
|
export { JOB_PROGRESS, JobProgress } from './job.js';
|
|
3
3
|
|
|
4
4
|
type Child = Node | string | null | undefined;
|
|
@@ -831,4 +831,40 @@ interface StepperBarOptions {
|
|
|
831
831
|
/** Draw (or hide) the bar in `host`. Idempotent: call it again with new state. */
|
|
832
832
|
declare function renderStepperBar(host: HTMLElement, opts: StepperBarOptions): void;
|
|
833
833
|
|
|
834
|
-
|
|
834
|
+
interface NavHistoryOptions<Place> {
|
|
835
|
+
/** Same DOCUMENT: a visit whose place is `same` as the newest entry
|
|
836
|
+
* REPLACES it (keeping the freshest tab) instead of stacking. */
|
|
837
|
+
same(a: Place, b: Place): boolean;
|
|
838
|
+
/** Still restorable? Checked as an entry is stepped onto; a stale one is
|
|
839
|
+
* dropped and the step continues past it. Default: everything is. */
|
|
840
|
+
usable?(p: Place): boolean;
|
|
841
|
+
/** Entries beyond this age off the far end (default 100). */
|
|
842
|
+
cap?: number;
|
|
843
|
+
}
|
|
844
|
+
interface NavHistory<Place> {
|
|
845
|
+
/** Record the place being left, before an ordinary navigation. */
|
|
846
|
+
visit(place: Place): void;
|
|
847
|
+
/** Step back: hands over the current place (it becomes the forward entry)
|
|
848
|
+
* and returns the place to restore, or undefined at the far end. */
|
|
849
|
+
back(current: Place): Place | undefined;
|
|
850
|
+
forward(current: Place): Place | undefined;
|
|
851
|
+
/** Whether the arrows light. Optimistic: a side holding only stale entries
|
|
852
|
+
* still reports true, and the press quietly discards them (the alternative
|
|
853
|
+
* is validating the whole stack on every paint). */
|
|
854
|
+
canBack(): boolean;
|
|
855
|
+
canForward(): boolean;
|
|
856
|
+
}
|
|
857
|
+
declare function createNavHistory<Place>(opts: NavHistoryOptions<Place>): NavHistory<Place>;
|
|
858
|
+
/**
|
|
859
|
+
* The quiet arrow pair, VS Code's shape: two plain chevrons sitting to the
|
|
860
|
+
* left of the app's normal navigation, each greyed when there is nowhere to
|
|
861
|
+
* go. One component so the pair looks and sits the same in every app of the
|
|
862
|
+
* family; the caller re-`set`s it whenever a navigation may have changed what
|
|
863
|
+
* the arrows can do.
|
|
864
|
+
*/
|
|
865
|
+
declare function historyNav(onBack: () => void, onForward: () => void): {
|
|
866
|
+
el: HTMLElement;
|
|
867
|
+
set(canBack: boolean, canForward: boolean): void;
|
|
868
|
+
};
|
|
869
|
+
|
|
870
|
+
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 NavHistory, type NavHistoryOptions, type Notes, type NotesEditorOptions, PALETTE, PALETTE_SIZE, PROPERTY_NAME_HINT, type PaneShell, type PaneShellOptions, type PaneShellState, type PaneSide, type PaneSideConfig, type PinButton, type PinButtonOptions, type PropertyRefOptions, RESERVED_PROPERTY_NAMES, 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, bindPropertyName, bindPropertyRef, closeAnchoredPanel, closeWithExit, colourFor, colourIndex, confirmDialog, createNavHistory, createSaveController, dupGuard, el, expandableRow, firstIllegalPropertyName, focusNewRow, foldVc, gameIdify, hideTip, historyNav, icon, iconBtn, iconSvg, initTooltips, isCaseOnlyPropertyName, isValidGameId, isValidPropertyName, labelled, lockControls, lockNotice, mountJobProgress, mountPaneShell, mountSettingsDialog, moveItem, openAnchoredPanel, openComments, openGameIdEditor, openNotesEditor, paintVcBadges, pinButton, placeAnchored, propertyNameProblem, propertyNameify, propertyRefProblem, renderStepperBar, revalidatePropertyRefs, saveIndicator, showAbout, staleBar, tagChips, tipAt, tipBold, vcBadgeFor };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { JOB_PROGRESS } from './chunk-MDGOIT3O.js';
|
|
2
|
-
export { EDIT_MENU, PANE_MENU } from './chunk-
|
|
2
|
+
export { EDIT_MENU, GO_MENU, PANE_MENU } from './chunk-QDPFU4WX.js';
|
|
3
3
|
|
|
4
4
|
// src/tooltip.ts
|
|
5
5
|
var B_OPEN = "";
|
|
@@ -1683,6 +1683,69 @@ function renderStepperBar(host, opts) {
|
|
|
1683
1683
|
);
|
|
1684
1684
|
}
|
|
1685
1685
|
|
|
1686
|
-
|
|
1686
|
+
// src/nav-history.ts
|
|
1687
|
+
function createNavHistory(opts) {
|
|
1688
|
+
const cap = opts.cap ?? 100;
|
|
1689
|
+
const usable = opts.usable ?? (() => true);
|
|
1690
|
+
let past = [];
|
|
1691
|
+
let ahead = [];
|
|
1692
|
+
const step = (from, to, current2) => {
|
|
1693
|
+
for (; ; ) {
|
|
1694
|
+
const p = from.pop();
|
|
1695
|
+
if (p === void 0) return void 0;
|
|
1696
|
+
if (!usable(p)) continue;
|
|
1697
|
+
if (opts.same(p, current2)) continue;
|
|
1698
|
+
to.push(current2);
|
|
1699
|
+
return p;
|
|
1700
|
+
}
|
|
1701
|
+
};
|
|
1702
|
+
return {
|
|
1703
|
+
visit(place2) {
|
|
1704
|
+
ahead = [];
|
|
1705
|
+
const top = past[past.length - 1];
|
|
1706
|
+
if (top !== void 0 && opts.same(top, place2)) past[past.length - 1] = place2;
|
|
1707
|
+
else past.push(place2);
|
|
1708
|
+
if (past.length > cap) past = past.slice(past.length - cap);
|
|
1709
|
+
},
|
|
1710
|
+
back(current2) {
|
|
1711
|
+
return step(past, ahead, current2);
|
|
1712
|
+
},
|
|
1713
|
+
forward(current2) {
|
|
1714
|
+
return step(ahead, past, current2);
|
|
1715
|
+
},
|
|
1716
|
+
canBack() {
|
|
1717
|
+
return past.length > 0;
|
|
1718
|
+
},
|
|
1719
|
+
canForward() {
|
|
1720
|
+
return ahead.length > 0;
|
|
1721
|
+
}
|
|
1722
|
+
};
|
|
1723
|
+
}
|
|
1724
|
+
function historyNav(onBack, onForward) {
|
|
1725
|
+
const btn = (glyph, tip2, onClick) => {
|
|
1726
|
+
const b = document.createElement("button");
|
|
1727
|
+
b.type = "button";
|
|
1728
|
+
b.className = "shell-histnav-btn";
|
|
1729
|
+
b.textContent = glyph;
|
|
1730
|
+
b.dataset["tip"] = tip2;
|
|
1731
|
+
b.setAttribute("aria-label", tip2);
|
|
1732
|
+
b.addEventListener("click", onClick);
|
|
1733
|
+
return b;
|
|
1734
|
+
};
|
|
1735
|
+
const back = btn("\u2039", "Back", onBack);
|
|
1736
|
+
const forward = btn("\u203A", "Forward", onForward);
|
|
1737
|
+
const el2 = document.createElement("span");
|
|
1738
|
+
el2.className = "shell-histnav";
|
|
1739
|
+
el2.append(back, forward);
|
|
1740
|
+
return {
|
|
1741
|
+
el: el2,
|
|
1742
|
+
set(canBack, canForward) {
|
|
1743
|
+
back.disabled = !canBack;
|
|
1744
|
+
forward.disabled = !canForward;
|
|
1745
|
+
}
|
|
1746
|
+
};
|
|
1747
|
+
}
|
|
1748
|
+
|
|
1749
|
+
export { PALETTE, PALETTE_SIZE, PROPERTY_NAME_HINT, RESERVED_PROPERTY_NAMES, askIdentity, bindPropertyName, bindPropertyRef, closeAnchoredPanel, closeWithExit, colourFor, colourIndex, confirmDialog, createNavHistory, createSaveController, dupGuard, el, expandableRow, firstIllegalPropertyName, focusNewRow, foldVc, gameIdify, hideTip, historyNav, icon, iconBtn, iconSvg, initTooltips, isCaseOnlyPropertyName, isValidGameId, isValidPropertyName, labelled, lockControls, lockNotice, mountJobProgress, mountPaneShell, mountSettingsDialog, moveItem, openAnchoredPanel, openComments, openGameIdEditor, openNotesEditor, paintVcBadges, pinButton, placeAnchored, propertyNameProblem, propertyNameify, propertyRefProblem, renderStepperBar, revalidatePropertyRefs, saveIndicator, showAbout, staleBar, tagChips, tipAt, tipBold, vcBadgeFor };
|
|
1687
1750
|
//# sourceMappingURL=index.js.map
|
|
1688
1751
|
//# sourceMappingURL=index.js.map
|