Pane facade ​
Pane creates a jolly-pane and is the entry point of the facade. It is a container: it has every add*() method.
ts
new Pane(options?: PaneOptions)
interface PaneOptions extends FieldLayoutOptions {
title?: string; // the jolly-pane heading
key?: string; // persistence and group identity, required to join a group
icon?: IconName;
tone?: IconTone;
container?: HTMLElement; // mount here instead of floating
grow?: boolean; // fill and scroll the container, default true
floating?: boolean; // float inside container, see below
collapsible?: boolean;
locked?: boolean; // keep the authored place in a dock layout
storageKey?: string; // persistence namespace
labelWidth?: string; // --jolly-label-width
hidden?: boolean;
floatWidth?: number;
floatHeight?: number;
}
interface FieldLayoutOptions {
labelPosition?: "inline" | "top" | "auto";
stackBelow?: number;
}storageKeydefaults to the page path plus the title, so renaming the pane drops what it remembered.hiddenon a floating pane is persisted, and a stored value wins.pane.presencesets thePresenceSourceof thejolly-pane.dispose()removes the pane, its window and the scope it created.
Floating and mounted panes ​
Without container, the pane floats under document.body:
text
document.body
└── jolly-scope
└── jolly-floating
└── jolly-panepane.elementis thejolly-floating.- The scope sets
--jolly-label-widthtolabelWidth, default16ch.
With container, only the jolly-pane is appended:
pane.elementis thejolly-pane.- The container must already be under a theme scope.
--jolly-label-widthdefaults toautothere. PasslabelWidthto align the value columns.
ts
const pane = new Pane({
title: "Inspector",
container: document.querySelector("#inspector"),
grow: false
});Field layout ​
labelPosition and stackBelow become the default of every binding and note in the pane, folders included. Options given to addBinding() or addNote() win. See label position.
ts
const pane = new Pane({
title: "Inspector",
labelPosition: "auto",
stackBelow: 220
});Floating inside a dock layout ​
A pane floating under document.body belongs to no layout and cannot be docked. Pass the layout as container with floating:
ts
const pane = new Pane({
title: "Performance",
key: "performance",
container: document.querySelector("jolly-dock-layout"),
floating: true
});- The layout adopts the window on its next sync and stores its geometry.
- The window docks into any dock or group, addressed by
key. - Docking removes the window, so
pane.elementcan be detached.hiddenanddispose()act on the current window, or on thejolly-panewhile docked.
FacadeHost ​
Adds builders inside an element the facade did not create, such as a pane authored in HTML.
ts
new FacadeHost(element: HTMLElement)
FacadeHost.query(selector: string, root?: ParentNode): FacadeHost
const host = FacadeHost.query("jolly-pane[key=general]");
const folder = host.addFolder({ title: "Performance" });- Several hosts can contribute to one element.
dispose()disposes what the host added and leaves the element.query()throws when the selector matches nothing.