@gjsify/adwaita-core 0.31.0 → 0.33.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/lib/esm/about-dialog.js +3 -0
- package/lib/esm/action-row.js +1 -0
- package/lib/esm/avatar.js +1 -0
- package/lib/esm/banner.js +1 -0
- package/lib/esm/button-content.js +1 -0
- package/lib/esm/carousel.js +1 -0
- package/lib/esm/checks.js +1 -0
- package/lib/esm/chrome.js +1 -0
- package/lib/esm/conformance/about-dialog.js +6 -0
- package/lib/esm/conformance/action-row.js +1 -0
- package/lib/esm/conformance/avatar.js +1 -0
- package/lib/esm/conformance/banner.js +1 -0
- package/lib/esm/conformance/button-content.js +1 -0
- package/lib/esm/conformance/carousel.js +1 -0
- package/lib/esm/conformance/checks.js +1 -0
- package/lib/esm/conformance/chrome.js +1 -0
- package/lib/esm/conformance/data-grid.js +1 -0
- package/lib/esm/conformance/dialog.js +1 -0
- package/lib/esm/conformance/entry-row.js +1 -0
- package/lib/esm/conformance/index.js +1 -0
- package/lib/esm/conformance/navigation-view.js +1 -0
- package/lib/esm/conformance/popover.js +1 -0
- package/lib/esm/conformance/preferences.js +1 -0
- package/lib/esm/conformance/rows.js +1 -0
- package/lib/esm/conformance/sidebar.js +1 -0
- package/lib/esm/conformance/spinner.js +1 -0
- package/lib/esm/conformance/split-button.js +1 -0
- package/lib/esm/conformance/split-view.js +1 -0
- package/lib/esm/conformance/tab-view.js +1 -0
- package/lib/esm/conformance/view-stack.js +1 -0
- package/lib/esm/conformance/view-switcher.js +1 -0
- package/lib/esm/conformance/wrap-box.js +1 -0
- package/lib/esm/data-grid.js +1 -0
- package/lib/esm/dialog.js +1 -1
- package/lib/esm/easing.js +1 -0
- package/lib/esm/entry-row.js +1 -0
- package/lib/esm/glib.js +1 -0
- package/lib/esm/index.js +1 -1
- package/lib/esm/length-unit.js +1 -0
- package/lib/esm/navigation-view.js +1 -0
- package/lib/esm/popover.js +1 -0
- package/lib/esm/preferences.js +1 -0
- package/lib/esm/rows.js +1 -1
- package/lib/esm/sidebar.js +1 -0
- package/lib/esm/spinner.js +1 -0
- package/lib/esm/split-button.js +1 -0
- package/lib/esm/split-view.js +1 -0
- package/lib/esm/tab-view.js +1 -0
- package/lib/esm/view-stack.js +1 -0
- package/lib/esm/view-switcher.js +1 -0
- package/lib/esm/wrap-box.js +1 -0
- package/lib/types/about-dialog.d.ts +391 -0
- package/lib/types/about-dialog.spec.d.ts +2 -0
- package/lib/types/action-row.d.ts +270 -0
- package/lib/types/action-row.spec.d.ts +2 -0
- package/lib/types/avatar.d.ts +112 -0
- package/lib/types/avatar.spec.d.ts +2 -0
- package/lib/types/banner.d.ts +104 -0
- package/lib/types/banner.spec.d.ts +2 -0
- package/lib/types/button-content.d.ts +141 -0
- package/lib/types/button-content.spec.d.ts +2 -0
- package/lib/types/carousel.d.ts +535 -0
- package/lib/types/carousel.spec.d.ts +2 -0
- package/lib/types/checks.d.ts +63 -0
- package/lib/types/checks.spec.d.ts +2 -0
- package/lib/types/chrome.d.ts +355 -0
- package/lib/types/chrome.spec.d.ts +2 -0
- package/lib/types/conformance/about-dialog.d.ts +314 -0
- package/lib/types/conformance/action-row.d.ts +186 -0
- package/lib/types/conformance/avatar.d.ts +61 -0
- package/lib/types/conformance/banner.d.ts +91 -0
- package/lib/types/conformance/button-content.d.ts +110 -0
- package/lib/types/conformance/carousel.d.ts +298 -0
- package/lib/types/conformance/checks.d.ts +29 -0
- package/lib/types/conformance/chrome.d.ts +207 -0
- package/lib/types/conformance/data-grid.d.ts +136 -0
- package/lib/types/conformance/dialog.d.ts +97 -0
- package/lib/types/conformance/entry-row.d.ts +187 -0
- package/lib/types/conformance/index.d.ts +46 -0
- package/lib/types/conformance/navigation-view.d.ts +235 -0
- package/lib/types/conformance/popover.d.ts +58 -0
- package/lib/types/conformance/preferences.d.ts +184 -0
- package/lib/types/conformance/rows.d.ts +74 -0
- package/lib/types/conformance/sidebar.d.ts +182 -0
- package/lib/types/conformance/spinner.d.ts +66 -0
- package/lib/types/conformance/split-button.d.ts +193 -0
- package/lib/types/conformance/split-view.d.ts +301 -0
- package/lib/types/conformance/tab-view.d.ts +449 -0
- package/lib/types/conformance/view-stack.d.ts +121 -0
- package/lib/types/conformance/view-switcher.d.ts +443 -0
- package/lib/types/conformance/wrap-box.d.ts +185 -0
- package/lib/types/data-grid.d.ts +140 -0
- package/lib/types/data-grid.spec.d.ts +2 -0
- package/lib/types/dialog.d.ts +144 -0
- package/lib/types/easing.d.ts +21 -0
- package/lib/types/entry-row.d.ts +308 -0
- package/lib/types/entry-row.spec.d.ts +2 -0
- package/lib/types/glib.d.ts +49 -0
- package/lib/types/index.d.ts +50 -4
- package/lib/types/length-unit.d.ts +24 -0
- package/lib/types/navigation-view.d.ts +343 -0
- package/lib/types/navigation-view.spec.d.ts +2 -0
- package/lib/types/popover.d.ts +155 -0
- package/lib/types/popover.spec.d.ts +2 -0
- package/lib/types/preferences.d.ts +349 -0
- package/lib/types/preferences.spec.d.ts +2 -0
- package/lib/types/rows.d.ts +96 -8
- package/lib/types/sidebar.d.ts +308 -0
- package/lib/types/sidebar.spec.d.ts +2 -0
- package/lib/types/spinner.d.ts +117 -0
- package/lib/types/spinner.spec.d.ts +2 -0
- package/lib/types/split-button.d.ts +316 -0
- package/lib/types/split-button.spec.d.ts +2 -0
- package/lib/types/split-view.d.ts +703 -0
- package/lib/types/split-view.spec.d.ts +2 -0
- package/lib/types/tab-view.d.ts +616 -0
- package/lib/types/tab-view.spec.d.ts +2 -0
- package/lib/types/view-stack.d.ts +278 -0
- package/lib/types/view-stack.spec.d.ts +2 -0
- package/lib/types/view-switcher.d.ts +524 -0
- package/lib/types/view-switcher.spec.d.ts +2 -0
- package/lib/types/wrap-box.d.ts +200 -0
- package/lib/types/wrap-box.spec.d.ts +2 -0
- package/package.json +8 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=[{name:`icon-name (test_adw_split_button_icon_name, tests/test-split-button.c:17-55)`,steps:[{op:`icon-name`,value:`document-open-symbolic`,changed:!0,notified:[`icon-name`],mode:`icon`,label:null,iconName:`document-open-symbolic`,styleClasses:[`image-button`],rule:`first icon on an empty button notifies icon-name only (:31-32)`},{op:`icon-name`,value:`document-open-symbolic`,changed:!1,notified:[],mode:`icon`,label:null,iconName:`document-open-symbolic`,styleClasses:[`image-button`],rule:"same icon again is a no-op — `if (!g_strcmp0 …) return` (:34-36 / c:756-757)"},{op:`icon-name`,value:`edit-find-symbolic`,changed:!0,notified:[`child`,`icon-name`],mode:`icon`,label:null,iconName:`edit-find-symbolic`,styleClasses:[`image-button`],rule:`icon→icon still notifies child: the internal GtkImage is non-NULL (:38-40 / c:762-763)`},{op:`label`,value:`Open`,changed:!0,notified:[`icon-name`,`child`,`label`],mode:`label`,label:`Open`,iconName:null,styleClasses:[`text-button`],rule:`setting the label CLEARS the icon — get_icon_name() is NULL after (:42-44)`},{op:`icon-name`,value:`document-open-symbolic`,changed:!0,notified:[`label`,`child`,`icon-name`],mode:`icon`,label:null,iconName:`document-open-symbolic`,styleClasses:[`image-button`],rule:`and back: setting the icon CLEARS the label (:46-48)`},{op:`child`,value:`child1`,changed:!0,notified:[`icon-name`,`child`],mode:`child`,label:null,iconName:null,styleClasses:[],rule:`a child clears both, and carries neither style class (:50-52)`}]},{name:`label (test_adw_split_button_label, tests/test-split-button.c:57-95)`,steps:[{op:`label`,value:`Open`,changed:!0,notified:[`label`],mode:`label`,label:`Open`,iconName:null,styleClasses:[`text-button`],rule:`first label on an empty button notifies label only (:71-72)`},{op:`label`,value:`Open`,changed:!1,notified:[],mode:`label`,label:`Open`,iconName:null,styleClasses:[`text-button`],rule:`same label again is a no-op (:74-76 / c:668-669)`},{op:`label`,value:`Find`,changed:!0,notified:[`child`,`label`],mode:`label`,label:`Find`,iconName:null,styleClasses:[`text-button`],rule:`label→label notifies child: the internal GtkLabel is non-NULL (:78-80 / c:674-675)`},{op:`icon-name`,value:`document-open-symbolic`,changed:!0,notified:[`label`,`child`,`icon-name`],mode:`icon`,label:null,iconName:`document-open-symbolic`,styleClasses:[`image-button`],rule:`setting the icon CLEARS the label — get_label() is NULL after (:82-84)`},{op:`label`,value:`Open`,changed:!0,notified:[`icon-name`,`child`,`label`],mode:`label`,label:`Open`,iconName:null,styleClasses:[`text-button`],rule:`and back again (:86-88)`},{op:`child`,value:`child1`,changed:!0,notified:[`label`,`child`],mode:`child`,label:null,iconName:null,styleClasses:[],rule:`a child clears the label (:90-92)`}]},{name:`child (test_adw_split_button_child, tests/test-split-button.c:125-170)`,steps:[{op:`child`,value:null,changed:!1,notified:[],mode:`empty`,label:null,iconName:null,styleClasses:[],rule:`clearing an already-empty button is a no-op (:143-144 / c:806-807)`},{op:`child`,value:`child1`,changed:!0,notified:[`child`],mode:`child`,label:null,iconName:null,styleClasses:[],rule:`first child notifies child only (:146-148)`},{op:`child`,value:`child2`,changed:!0,notified:[`child`],mode:`child`,label:null,iconName:null,styleClasses:[],rule:`child→child notifies once; neither label nor icon was set (:150-152)`},{op:`label`,value:`Open`,changed:!0,notified:[`child`,`label`],mode:`label`,label:`Open`,iconName:null,styleClasses:[`text-button`],rule:`the label replaces the app child — get_child() is no longer it (:154-159)`},{op:`child`,value:`child3`,changed:!0,notified:[`label`,`child`],mode:`child`,label:null,iconName:null,styleClasses:[],rule:`a child clears the label back out (:161-163)`},{op:`icon-name`,value:`document-open-symbolic`,changed:!0,notified:[`child`,`icon-name`],mode:`icon`,label:null,iconName:`document-open-symbolic`,styleClasses:[`image-button`],rule:`the icon replaces the app child (:165-167)`}]},{name:`empty + whitespace labels (derived from adw-split-button.c:151-159, not asserted upstream)`,steps:[{op:`label`,value:``,changed:!0,notified:[`label`],mode:`label`,label:``,iconName:null,styleClasses:[],rule:"an empty label is SET (non-NULL) but `label[0]` is NUL — no text-button class (c:156)"},{op:`icon-name`,value:``,changed:!0,notified:[`label`,`child`,`icon-name`],mode:`icon`,label:null,iconName:``,styleClasses:[],rule:`the empty label is still a non-NULL pointer, so it is notified as cleared (c:760-761)`},{op:`label`,value:` `,changed:!0,notified:[`icon-name`,`child`,`label`],mode:`label`,label:` `,iconName:null,styleClasses:[`text-button`],rule:"whitespace is a valid label: nothing trims, and `label[0]` is a space (c:156-159)"},{op:`label`,value:` `,changed:!1,notified:[],mode:`label`,label:` `,iconName:null,styleClasses:[`text-button`],rule:`g_strcmp0 is a byte compare — the same two spaces are the same label`},{op:`label`,value:`Änderungen speichern…`,changed:!0,notified:[`child`,`label`],mode:`label`,label:`Änderungen speichern…`,iconName:null,styleClasses:[`text-button`],rule:`non-ASCII is stored verbatim — no normalisation, no escaping (c:661-682)`}]}],t=[{label:`Open`,iconName:null,classes:[`text-button`],rule:`a label gives text-button (c:156-159)`},{label:null,iconName:`document-open-symbolic`,classes:[`image-button`],rule:`an icon gives image-button (c:151-154)`},{label:``,iconName:null,classes:[],rule:"`label[0]` is NUL — an empty label carries NO class"},{label:null,iconName:``,classes:[],rule:"`icon_name[0]` is NUL — an empty icon name carries NO class"},{label:` `,iconName:null,classes:[`text-button`],rule:`two spaces are a non-empty label — no trimming`},{label:` `,iconName:null,classes:[`text-button`],rule:`any non-NUL first byte counts, tab included`},{label:null,iconName:null,classes:[],rule:`a child (or nothing) carries neither class (c:145-165)`},{label:`Open`,iconName:`document-open-symbolic`,classes:[`image-button`,`text-button`],rule:`the two branches are independent and evaluated icon-first (c:151-159)`}],n=[{tooltip:``,text:`More Options`,markup:!1,rule:`unset/cleared restores the translated default as TEXT`},{tooltip:`Some tooltip`,text:`Some tooltip`,markup:!0,rule:`a set tooltip is markup (c:1046-1047)`},{tooltip:`Some <b>tooltip</b>`,text:`Some <b>tooltip</b>`,markup:!0,rule:`Pango markup passes through unescaped (c:428)`},{tooltip:` `,text:` `,markup:!0,rule:"`*tooltip` is a space — non-NUL, so it is a real tooltip"}],r=[{direction:`down`,arrowIcon:`pan-down-symbolic`,popupDirection:`down`,rule:"the default (c:420); glyph from `menubutton arrow.down`, not overridden (_buttons.scss:457-459)"},{direction:`up`,arrowIcon:`pan-up-symbolic`,popupDirection:`up`,rule:"`menubutton arrow.up`, not overridden (_buttons.scss:460-462)"},{direction:`left`,arrowIcon:`pan-start-symbolic`,popupDirection:`left`,rule:`left uses pan-START, not pan-left (_buttons.scss:463-465)`},{direction:`right`,arrowIcon:`pan-end-symbolic`,popupDirection:`right`,rule:`right uses pan-END (_buttons.scss:466-468)`},{direction:`none`,arrowIcon:`pan-down-symbolic`,popupDirection:`down`,rule:"WINNING selector `splitbutton > menubutton > button > arrow.none` (_buttons.scss:621-623) OVERRIDES `menubutton arrow.none` (:454-456): inside a split button `none` draws pan-down, NOT open-menu — and pops down (c:415), so it is indistinguishable from `down`"}],i=[{direction:`none`,arrowIcon:`open-menu-symbolic`,popupDirection:`down`,rule:"`menubutton arrow.none` (_buttons.scss:454-456) — the hamburger, unopposed here; placement still down (c:415 via the shared GtkMenuButton, c:971/:997)"},{direction:`down`,arrowIcon:`pan-down-symbolic`,popupDirection:`down`,rule:"`menubutton arrow.down` (_buttons.scss:457-459) — identical to the split button row"},{direction:`up`,arrowIcon:`pan-up-symbolic`,popupDirection:`up`,rule:"`menubutton arrow.up` (_buttons.scss:460-462)"},{direction:`left`,arrowIcon:`pan-start-symbolic`,popupDirection:`left`,rule:"`menubutton arrow.left` (_buttons.scss:463-465)"},{direction:`right`,arrowIcon:`pan-end-symbolic`,popupDirection:`right`,rule:"`menubutton arrow.right` (_buttons.scss:466-468)"}],a={active:!1,checked:!1,keyboardActivating:!1},o=[{action:a,dropdown:a,active:!1,checked:!1,rule:`idle folds to idle`},{action:{...a,active:!0},dropdown:a,active:!0,checked:!1,rule:`a pressed action half makes the WHOLE control active (c:134-137)`},{action:a,dropdown:{...a,active:!0},active:!0,checked:!1,rule:`so does a pressed dropdown half — the flags are OR-ed (c:127-128)`},{action:a,dropdown:{...a,checked:!0},active:!1,checked:!0,rule:`an open menu checks the arrow half, and the root with it (c:139-142)`},{action:{...a,keyboardActivating:!0},dropdown:a,active:!0,checked:!1,rule:`the keyboard-activating CSS class counts as ACTIVE (c:130-135)`},{action:{...a,active:!0},dropdown:{...a,checked:!0},active:!0,checked:!0,rule:`active and checked are independent folds`}],s=[{json:`[{"label":"Save as…","action":"app.save-as"}]`,entries:[{label:`Save as…`,action:`app.save-as`}],rule:`the GTK shape: (label, detailed action) pairs (c:385-388)`},{json:`[{"label":"Copy","action":"app.copy"},{"label":"Copy","action":"app.copy-special"}]`,entries:[{label:`Copy`,action:`app.copy`},{label:`Copy`,action:`app.copy-special`}],rule:`duplicate labels are legal and must NOT collapse`},{json:`[{"label":"About","id":"about","icon":"help-about-symbolic"}]`,entries:[{label:`About`,id:`about`,icon:`help-about-symbolic`}],rule:`the menu-button extras (id/icon) share the same entry type`},{json:null,entries:[],rule:`no attribute → no menu`},{json:``,entries:[],rule:`an empty attribute → no menu`},{json:`not json at all`,entries:[],rule:`malformed JSON degrades to no menu, it does not throw`},{json:`{"label":"Save"}`,entries:[],rule:`a non-array root is rejected wholesale`},{json:`[]`,entries:[],rule:`an empty array is an empty menu`},{json:`[{"action":"app.x"},null,42,["label"]]`,entries:[],rule:"entries without a `label` key are dropped"},{json:`[{"label":42,"action":7}]`,entries:[{label:`42`}],rule:`the label is String()-coerced; a non-string action is dropped rather than leaked`}],c=[{label:`Copy`,action:`app.copy`},{label:`Copy`,action:`app.copy-special`}],l=[{entries:c,index:1,activated:{label:`Copy`,action:`app.copy-special`},rule:`the SECOND of two identically labelled entries — the indexOf bug`},{entries:c,index:0,activated:{label:`Copy`,action:`app.copy`},rule:`position 0`},{entries:c,index:2,activated:null,rule:`a position past n_items has no item`},{entries:c,index:-1,activated:null,rule:`a negative position has no item`},{entries:c,index:.5,activated:null,rule:`a fractional position is not a position`},{entries:[],index:0,activated:null,rule:`no menu model → nothing to activate`}],u=[{entries:[],popover:!1,enabled:!1,canOpen:!1,rule:`neither → insensitive dropdown; an empty entry list is the renderers’ spelling of "no menu", so a menu-less button must not open an empty popover`},{entries:[{label:`Save as…`,action:`app.save-as`}],popover:!1,enabled:!0,canOpen:!0,rule:`a menu model makes the dropdown live`},{entries:[],popover:!0,enabled:!0,canOpen:!0,rule:`so does a popover on its own`},{entries:[{label:`Save as…`}],popover:!0,enabled:!0,canOpen:!0,rule:`setting one dissociates the other, but the dropdown stays live (c:390-403)`}];export{i as MENU_BUTTON_DIRECTION_VECTORS,e as SPLIT_BUTTON_CONTENT_VECTORS,r as SPLIT_BUTTON_DIRECTION_VECTORS,u as SPLIT_BUTTON_DROPDOWN_VECTORS,l as SPLIT_BUTTON_MENU_ACTIVATION_VECTORS,s as SPLIT_BUTTON_MENU_PARSE_VECTORS,o as SPLIT_BUTTON_ROOT_STATE_VECTORS,t as SPLIT_BUTTON_STYLE_CLASS_VECTORS,n as SPLIT_BUTTON_TOOLTIP_VECTORS};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=[{unit:`px`,value:180,dpi:96,px:180,rule:`px is a passthrough`},{unit:`px`,value:180,dpi:120,px:180,rule:`px ignores the text scale entirely`},{unit:`sp`,value:180,dpi:96,px:180,rule:`sp at the default dpi is a passthrough`},{unit:`sp`,value:180,dpi:120,px:225,rule:`sp scales with the text scale factor (dpi/96)`},{unit:`pt`,value:180,dpi:96,px:240,rule:`pt is dpi/72 — the classic 4/3 at 96 dpi`},{unit:`pt`,value:180,dpi:120,px:300,rule:`pt scales too`},{unit:`sp`,value:0,dpi:120,px:0,rule:`0 is a legal min/max width and survives conversion`}],t=[{x:250,low:180,high:280,clamped:250,rule:`inside the range, untouched`},{x:150,low:180,high:280,clamped:180,rule:`below low is raised`},{x:500,low:180,high:280,clamped:280,rule:`above high is capped`},{x:75,low:180,high:100,clamped:180,rule:`INVERTED bounds, below both: high fails, low wins`},{x:150,low:180,high:100,clamped:100,rule:`INVERTED bounds, above high: high is tested FIRST`},{x:180,low:180,high:280,clamped:180,rule:`exactly low`},{x:280,low:180,high:280,clamped:280,rule:`exactly high`}],n=[{spec:{},sidebarChildMin:0,ceil:!0,min:180,max:280,rule:`libadwaita defaults, 180sp/280sp at 96 dpi`},{spec:{},sidebarChildMin:0,ceil:!1,min:180,max:280,rule:`measure agrees at the default dpi`},{spec:{minSidebarWidth:181,sidebarWidthUnit:`sp`,dpi:100},sidebarChildMin:0,ceil:!1,min:188,max:291,rule:`MEASURE truncates the int assignment: 181*100/96 = 188.54 → 188`},{spec:{minSidebarWidth:181,sidebarWidthUnit:`sp`,dpi:100},sidebarChildMin:0,ceil:!0,min:189,max:292,rule:`ALLOCATE ceils the same conversion → 189; a real 1px asymmetry at dpi ≠ 96`},{spec:{minSidebarWidth:300,maxSidebarWidth:200},sidebarChildMin:0,ceil:!0,min:300,max:300,rule:`max is raised to min BEFORE anything else, never inverted here`},{spec:{},sidebarChildMin:400,ceil:!0,min:400,max:400,rule:`the sidebar child's own minimum wins over max-sidebar-width`},{spec:{minSidebarWidth:0,maxSidebarWidth:0},sidebarChildMin:0,ceil:!0,min:0,max:0,rule:`0 is a legal bound (pspec range [0, G_MAXDOUBLE]) — never a default fallback`}],r=[{widget:`navigation`,spec:{},totalWidth:1e3,contentMin:0,sidebarChildMin:0,collapsed:!1,width:250,rule:`trunc(1000 * 0.25) sits inside [180, 280]`},{widget:`navigation`,spec:{},totalWidth:600,contentMin:0,sidebarChildMin:0,collapsed:!1,width:180,rule:`trunc(150) is raised to min-sidebar-width`},{widget:`navigation`,spec:{},totalWidth:2e3,contentMin:0,sidebarChildMin:0,collapsed:!1,width:280,rule:`trunc(500) is capped at max-sidebar-width`},{widget:`navigation`,spec:{},totalWidth:1e3,contentMin:900,sidebarChildMin:0,collapsed:!1,width:100,rule:`the max BOUND drops to width - contentMin = 100`},{widget:`navigation`,spec:{},totalWidth:300,contentMin:200,sidebarChildMin:0,collapsed:!1,width:180,rule:`bounds INVERT (min 180 > max 100); GLib CLAMP keeps the sidebar at its minimum`},{widget:`overlay`,spec:{},totalWidth:300,contentMin:200,sidebarChildMin:0,collapsed:!1,width:100,rule:`SAME INPUT as the row above: the overlay caps the RESULT, so it yields 100, not 180`},{widget:`navigation`,spec:{minSidebarWidth:300,maxSidebarWidth:200},totalWidth:1e3,contentMin:0,sidebarChildMin:0,collapsed:!1,width:300,rule:`max below min is raised to min first`},{widget:`navigation`,spec:{},totalWidth:1e3,contentMin:0,sidebarChildMin:400,collapsed:!1,width:400,rule:`the sidebar child's own minimum overrides max-sidebar-width`},{widget:`navigation`,spec:{sidebarWidthFraction:0},totalWidth:1e3,contentMin:0,sidebarChildMin:0,collapsed:!1,width:180,rule:`fraction 0 still gets min-sidebar-width`},{widget:`navigation`,spec:{sidebarWidthFraction:1},totalWidth:1e3,contentMin:0,sidebarChildMin:0,collapsed:!1,width:280,rule:`fraction 1 is capped at max-sidebar-width (the allocate path is well-defined)`},{widget:`overlay`,spec:{},totalWidth:1e3,contentMin:0,sidebarChildMin:0,collapsed:!1,width:250,rule:`uncollapsed the overlay agrees with the navigation widget when nothing binds`},{widget:`overlay`,spec:{},totalWidth:320,contentMin:0,sidebarChildMin:0,collapsed:!0,width:280,rule:`COLLAPSED ignores the fraction and clamps the VIEW width — 320 → max 280`},{widget:`overlay`,spec:{},totalWidth:150,contentMin:0,sidebarChildMin:0,collapsed:!0,width:180,rule:`collapsed on a very narrow view, the sidebar is legitimately WIDER than the view`},{widget:`overlay`,spec:{sidebarWidthUnit:`sp`,dpi:120},totalWidth:1e3,contentMin:0,sidebarChildMin:0,collapsed:!1,width:250,rule:`at 120 dpi the bounds become [225, 350] and 250 fits between them`},{widget:`overlay`,spec:{sidebarWidthUnit:`sp`,dpi:120},totalWidth:800,contentMin:0,sidebarChildMin:0,collapsed:!1,width:225,rule:`same dpi, trunc(200) is raised to the scaled minimum 180sp = 225px`}],i=[{contentNatural:800,min:180,max:280,fraction:.25,natural:267,rule:`ceil(800 * 0.25 / 0.75) = 267`},{contentNatural:200,min:180,max:280,fraction:.25,natural:180,rule:`ceil(66.67) = 67, raised to min`},{contentNatural:2e3,min:180,max:280,fraction:.25,natural:280,rule:`ceil(666.67) = 667, capped at max`},{contentNatural:800,min:180,max:280,fraction:0,natural:180,rule:`fraction 0 asks for nothing → min`},{contentNatural:800,min:180,max:280,fraction:1,natural:280,rule:`fraction 1 divides by zero in C (UB); the limit is +inf, so the clamp gives max`},{contentNatural:0,min:180,max:280,fraction:1,natural:280,rule:`fraction 1 with no content is C 0/0 = NaN; the deviation keeps it at max`}],a=[{min:180,max:280,sidebarNatural:267,contentMin:400,contentNatural:800,showProgress:1,minimum:580,natural:1067,rule:`fully shown: the sidebar contributes its whole min/natural`},{min:180,max:280,sidebarNatural:267,contentMin:400,contentNatural:800,showProgress:.5,minimum:490,natural:933,rule:`half revealed: trunc(180*0.5)=90 and trunc(267*0.5)=133`},{min:180,max:280,sidebarNatural:267,contentMin:400,contentNatural:800,showProgress:0,minimum:400,natural:800,rule:`hidden: the sidebar contributes nothing to the request`},{min:180,max:280,sidebarNatural:267,contentMin:400,contentNatural:800,showProgress:1.4,minimum:580,natural:1067,rule:`overshoot is clamped to 1 for the request — CLAMP(show_progress, 0, 1)`}],o=[{totalWidth:1e3,sidebarWidth:250,sidebarPosition:`start`,direction:`ltr`,sidebar:{x:0,width:250},content:{x:250,width:750},rule:`the ordinary LTR docked layout`},{totalWidth:1e3,sidebarWidth:250,sidebarPosition:`end`,direction:`ltr`,sidebar:{x:750,width:250},content:{x:0,width:750},rule:`sidebar-position: end docks the sidebar to the right edge`},{totalWidth:1e3,sidebarWidth:250,sidebarPosition:`start`,direction:`rtl`,sidebar:{x:750,width:250},content:{x:0,width:750},rule:`RTL mirrors: 'start' is the RIGHT edge — get_start_or_end returns GTK_PACK_END`},{totalWidth:1e3,sidebarWidth:250,sidebarPosition:`end`,direction:`rtl`,sidebar:{x:0,width:250},content:{x:250,width:750},rule:`RTL mirrors: 'end' is the LEFT edge`}],s=[{totalWidth:1e3,sidebarWidth:250,showProgress:1,collapsed:!1,sidebarPosition:`start`,direction:`ltr`,layout:{sidebar:{x:0,width:250},content:{x:250,width:750},shieldVisible:!1,sidebarPainted:!0,shadowProgress:1,shadowSide:`left`},rule:`docked and shown — the same rects the navigation widget produces`},{totalWidth:1e3,sidebarWidth:250,showProgress:.5,collapsed:!1,sidebarPosition:`start`,direction:`ltr`,layout:{sidebar:{x:-125,width:250},content:{x:125,width:875},shieldVisible:!1,sidebarPainted:!0,shadowProgress:1,shadowSide:`left`},rule:`docked mid-slide: the pane hangs off the left edge and the content follows it`},{totalWidth:1e3,sidebarWidth:250,showProgress:0,collapsed:!1,sidebarPosition:`start`,direction:`ltr`,layout:{sidebar:{x:-250,width:250},content:{x:0,width:1e3},shieldVisible:!1,sidebarPainted:!1,shadowProgress:1,shadowSide:`left`},rule:`docked and hidden: the offset is the FRESH width, so no dead strip can appear`},{totalWidth:1e3,sidebarWidth:250,showProgress:1.2,collapsed:!1,sidebarPosition:`start`,direction:`ltr`,layout:{sidebar:{x:0,width:300},content:{x:250,width:750},shieldVisible:!1,sidebarPainted:!0,shadowProgress:1,shadowSide:`left`},rule:`OVERSHOOT: the pane widens to 300 and the offset pins to the measured 250`},{totalWidth:1e3,sidebarWidth:250,showProgress:.5,collapsed:!1,sidebarPosition:`end`,direction:`ltr`,layout:{sidebar:{x:875,width:250},content:{x:0,width:875},shieldVisible:!1,sidebarPainted:!0,shadowProgress:1,shadowSide:`right`},rule:`docked at the end edge, mid-slide: the pane hangs off the RIGHT edge`},{totalWidth:400,sidebarWidth:280,showProgress:.5,collapsed:!0,sidebarPosition:`start`,direction:`ltr`,layout:{sidebar:{x:-140,width:280},content:{x:0,width:400},shieldVisible:!0,sidebarPainted:!0,shadowProgress:.5,shadowSide:`left`},rule:`collapsed mid-reveal: the content keeps the whole view and the shield is live`},{totalWidth:400,sidebarWidth:280,showProgress:1,collapsed:!0,sidebarPosition:`end`,direction:`ltr`,layout:{sidebar:{x:120,width:280},content:{x:0,width:400},shieldVisible:!0,sidebarPainted:!0,shadowProgress:0,shadowSide:`right`},rule:`collapsed, fully open at the end edge: the shadow is at full strength`},{totalWidth:400,sidebarWidth:280,showProgress:0,collapsed:!0,sidebarPosition:`start`,direction:`ltr`,layout:{sidebar:{x:-280,width:280},content:{x:0,width:400},shieldVisible:!1,sidebarPainted:!1,shadowProgress:1,shadowSide:`left`},rule:`collapsed and closed: nothing is painted and the shield takes no input`},{totalWidth:400,sidebarWidth:280,showProgress:1,collapsed:!0,sidebarPosition:`start`,direction:`rtl`,layout:{sidebar:{x:120,width:280},content:{x:0,width:400},shieldVisible:!0,sidebarPainted:!0,shadowProgress:0,shadowSide:`right`},rule:`collapsed under RTL: a 'start' sidebar overlays from the RIGHT`}],c=[{sidebarTag:null,contentTag:null,conflict:!1,rule:`two untagged pages never collide`},{sidebarTag:`a`,contentTag:null,conflict:!1,rule:`an absent tag never matches a present one`},{sidebarTag:null,contentTag:`a`,conflict:!1,rule:`and the same the other way round`},{sidebarTag:`a`,contentTag:`a`,conflict:!0,rule:`identical tags collide`},{sidebarTag:`a`,contentTag:`b`,conflict:!1,rule:`different tags are fine`},{sidebarTag:``,contentTag:``,conflict:!0,rule:`two EMPTY-STRING tags DO collide — "" is not absent`},{sidebarTag:``,contentTag:null,conflict:!1,rule:`but an empty tag does not match an absent one`},{sidebarTag:`A`,contentTag:`a`,conflict:!1,rule:`strcmp is case-sensitive`},{sidebarTag:`Ü`,contentTag:`Ü`,conflict:!1,rule:`byte-exact: precomposed vs decomposed U-umlaut are DIFFERENT tags - no NFC normalisation`},{sidebarTag:`Ü`,contentTag:`Ü`,conflict:!0,rule:`the same encoding of U-umlaut does collide`}],l=[{hasSidebar:!0,hasContent:!0,sidebarPosition:`start`,showContent:!1,changingPage:!1,plan:{stack:[`sidebar`],transition:`replace`,page:null},rule:`start-rooted, showing the sidebar`},{hasSidebar:!0,hasContent:!0,sidebarPosition:`start`,showContent:!0,changingPage:!1,plan:{stack:[`sidebar`,`content`],transition:`replace`,page:null},rule:`start-rooted, content pushed on top`},{hasSidebar:!0,hasContent:!0,sidebarPosition:`end`,showContent:!1,changingPage:!1,plan:{stack:[`content`,`sidebar`],transition:`replace`,page:null},rule:`with 'end' the CONTENT is the root, so hiding it means pushing the sidebar OVER it`},{hasSidebar:!0,hasContent:!0,sidebarPosition:`end`,showContent:!0,changingPage:!1,plan:{stack:[`content`],transition:`replace`,page:null},rule:`with 'end' showing the content is the ROOT state`},{hasSidebar:!0,hasContent:!1,sidebarPosition:`start`,showContent:!0,changingPage:!1,plan:{stack:[`sidebar`],transition:`replace`,page:null},rule:`a LONE sidebar stays visible even with show-content — both ports render blank here`},{hasSidebar:!1,hasContent:!0,sidebarPosition:`start`,showContent:!1,changingPage:!1,plan:{stack:[`content`],transition:`replace`,page:null},rule:`a LONE content stays visible even without show-content`},{hasSidebar:!1,hasContent:!0,sidebarPosition:`end`,showContent:!0,changingPage:!1,plan:{stack:[`content`],transition:`replace`,page:null},rule:`lone content, end-packed`},{hasSidebar:!1,hasContent:!1,sidebarPosition:`start`,showContent:!1,changingPage:!1,plan:{stack:[],transition:`replace`,page:null},rule:`no children, no stack`},{hasSidebar:!0,hasContent:!0,sidebarPosition:`start`,showContent:!0,changingPage:!0,plan:{stack:[`sidebar`,`content`],transition:`push`,page:`content`},rule:`animated: same final stack as the static branch, reached by a PUSH`},{hasSidebar:!0,hasContent:!0,sidebarPosition:`start`,showContent:!1,changingPage:!0,plan:{stack:[`sidebar`],transition:`pop`,page:`content`},rule:`animated back: replace([sidebar, content]) then pop`},{hasSidebar:!0,hasContent:!0,sidebarPosition:`end`,showContent:!0,changingPage:!0,plan:{stack:[`content`],transition:`pop`,page:`sidebar`},rule:`animated with 'end': showing the content is a POP, not a push`},{hasSidebar:!0,hasContent:!0,sidebarPosition:`end`,showContent:!1,changingPage:!0,plan:{stack:[`content`,`sidebar`],transition:`push`,page:`sidebar`},rule:`animated with 'end': hiding the content PUSHES the sidebar`},{hasSidebar:!0,hasContent:!1,sidebarPosition:`start`,showContent:!0,changingPage:!0,plan:{stack:[`sidebar`],transition:`replace`,page:null},rule:`the animated branch needs BOTH children; with one it falls back to replace`}],u=[{action:`push`,tag:`detail`,sidebarTag:`list`,contentTag:`detail`,showContent:!1,collapsed:!0,result:{kind:`set-show-content`,showContent:!0},rule:`the content tag shows the content`},{action:`push`,tag:`detail`,sidebarTag:`list`,contentTag:`detail`,showContent:!0,collapsed:!0,result:{kind:`already-in-stack`,tag:`detail`},rule:`collapsed AND already showing it: pushing again is a programming error`},{action:`push`,tag:`detail`,sidebarTag:`list`,contentTag:`detail`,showContent:!0,collapsed:!1,result:{kind:`set-show-content`,showContent:!0},rule:`uncollapsed both panes are visible, so the same push is a harmless no-op set`},{action:`push`,tag:`list`,sidebarTag:`list`,contentTag:`detail`,showContent:!1,collapsed:!1,result:{kind:`already-in-stack`,tag:`list`},rule:`pushing the SIDEBAR's tag is always an error, collapsed or not`},{action:`push`,tag:`other`,sidebarTag:`list`,contentTag:`detail`,showContent:!1,collapsed:!1,result:{kind:`delegate`},rule:`an unknown tag goes to the parent BEFORE it may become a critical`},{action:`push`,tag:``,sidebarTag:null,contentTag:null,showContent:!1,collapsed:!1,result:{kind:`delegate`},rule:`untagged pages never match — g_strcmp0("", NULL) is non-zero`},{action:`push`,tag:`shared`,sidebarTag:`shared`,contentTag:`shared`,showContent:!1,collapsed:!0,result:{kind:`set-show-content`,showContent:!0},rule:`the CONTENT tag is tested first, so it wins a (guarded-against) collision`},{action:`pop`,hasSidebar:!0,hasContent:!0,showContent:!0,collapsed:!1,result:{kind:`set-show-content`,showContent:!1},rule:`pop works uncollapsed too — it just flips show-content back`},{action:`pop`,hasSidebar:!1,hasContent:!0,showContent:!0,collapsed:!0,result:{kind:`delegate`},rule:`pop needs BOTH children; otherwise the parent gets it`},{action:`pop`,hasSidebar:!0,hasContent:!0,showContent:!1,collapsed:!0,result:{kind:`delegate`},rule:`already at the root: nothing to pop, so it propagates`}],d=[{initial:{},before:{showSidebar:!0,collapsed:!1,showProgress:1,shieldVisible:!1,sidebarFocusable:!0,contentFocusable:!0},setCollapsed:!0,after:{showSidebar:!1,collapsed:!0,showProgress:0,shieldVisible:!1,sidebarFocusable:!1,contentFocusable:!0},notifications:[`show-sidebar`,`collapsed`],rule:`DEFAULTS: show-sidebar TRUE / progress 1; collapsing auto-hides an unpinned sidebar`},{initial:{pinSidebar:!0},before:{showSidebar:!0,collapsed:!1,showProgress:1,shieldVisible:!1,sidebarFocusable:!0,contentFocusable:!0},setCollapsed:!0,after:{showSidebar:!0,collapsed:!0,showProgress:1,shieldVisible:!0,sidebarFocusable:!0,contentFocusable:!1},notifications:[`collapsed`],rule:`pin-sidebar suppresses the coupling entirely — the sidebar stays up as an overlay`},{initial:{collapsed:!0,showSidebar:!1},before:{showSidebar:!1,collapsed:!0,showProgress:0,shieldVisible:!1,sidebarFocusable:!1,contentFocusable:!0},setCollapsed:!1,after:{showSidebar:!0,collapsed:!1,showProgress:1,shieldVisible:!1,sidebarFocusable:!0,contentFocusable:!0},notifications:[`show-sidebar`,`collapsed`],rule:`uncollapsing re-shows an unpinned sidebar; constructing hidden starts settled at progress 0`},{initial:{collapsed:!0,showSidebar:!0},before:{showSidebar:!0,collapsed:!0,showProgress:1,shieldVisible:!0,sidebarFocusable:!0,contentFocusable:!1},setCollapsed:!0,after:{showSidebar:!0,collapsed:!0,showProgress:1,shieldVisible:!0,sidebarFocusable:!0,contentFocusable:!1},notifications:[],rule:`setting the value it already has changes nothing and notifies nothing`}],f=[{showProgress:0,enableShowGesture:!1,enableHideGesture:!0,swipeActive:!1,snapPoints:[0],rule:`closed with opening disabled: nowhere to go but closed`},{showProgress:1,enableShowGesture:!0,enableHideGesture:!1,swipeActive:!1,snapPoints:[1],rule:`open with closing disabled: nowhere to go but open`},{showProgress:.5,enableShowGesture:!1,enableHideGesture:!1,swipeActive:!1,snapPoints:[0,1],rule:`mid-flight both ends are reachable regardless of the gesture flags`},{showProgress:0,enableShowGesture:!1,enableHideGesture:!1,swipeActive:!0,snapPoints:[0,1],rule:`a swipe in progress unlocks both ends so it can always be completed or cancelled`}],p=[{showProgress:1,collapsed:!1,direction:`forward`,enableShowGesture:!0,enableHideGesture:!0,detected:!1,rule:`forward on an open DOCKED sidebar belongs to the content, not to us`},{showProgress:1,collapsed:!0,direction:`forward`,enableShowGesture:!0,enableHideGesture:!0,detected:!0,rule:`the same gesture on a COLLAPSED overlay is ours`},{showProgress:0,collapsed:!1,direction:`forward`,enableShowGesture:!1,enableHideGesture:!0,detected:!1,rule:`closed with the show gesture disabled`},{showProgress:1,collapsed:!0,direction:`back`,enableShowGesture:!0,enableHideGesture:!1,detected:!1,rule:`open with the hide gesture disabled`},{showProgress:.5,collapsed:!1,direction:`forward`,enableShowGesture:!1,enableHideGesture:!1,detected:!0,rule:`a mid-flight swipe is ALWAYS resumable — the flags only guard the two ends`}],m=[{to:1,showSidebar:!0,kind:`animate`,showSidebarAfter:!0,rule:`released where it already was: settle only, no notify`},{to:0,showSidebar:!0,kind:`set-show-sidebar`,showSidebarAfter:!1,rule:`swiped closed: a real show-sidebar change`},{to:1,showSidebar:!1,kind:`set-show-sidebar`,showSidebarAfter:!0,rule:`swiped open: a real show-sidebar change`},{to:0,showSidebar:!1,kind:`animate`,showSidebarAfter:!1,rule:`cancelled back to closed: settle only`}],h=[{showProgress:.5,cancelProgress:1,rule:`C round() is half-AWAY-from-zero`},{showProgress:.4999,cancelProgress:0,rule:`just below the half`},{showProgress:1.2,cancelProgress:1,rule:`an upper overshoot snaps back to open`},{showProgress:0,cancelProgress:0,rule:`already closed`},{showProgress:-.5,cancelProgress:-1,rule:`a lower overshoot: JS Math.round(-0.5) is -0, C round(-0.5) is -1`}],g=[{isDrag:!1,sidebarWidth:280,showProgress:1,totalWidth:400,totalHeight:800,sidebarPosition:`start`,direction:`ltr`,area:{x:0,y:0,width:0,height:0},rule:`a non-drag (scroll/keyboard) swipe has no area at all`},{isDrag:!0,sidebarWidth:280,showProgress:0,totalWidth:400,totalHeight:800,sidebarPosition:`start`,direction:`ltr`,area:{x:0,y:0,width:32,height:800},rule:`closed: only the ADW_SWIPE_BORDER edge strip is grabbable`},{isDrag:!0,sidebarWidth:280,showProgress:1,totalWidth:400,totalHeight:800,sidebarPosition:`end`,direction:`ltr`,area:{x:120,y:0,width:280,height:800},rule:`open at the end edge: the whole revealed width is grabbable, flush right`},{isDrag:!0,sidebarWidth:280,showProgress:1,totalWidth:400,totalHeight:800,sidebarPosition:`start`,direction:`rtl`,area:{x:120,y:0,width:280,height:800},rule:`RTL mirrors the strip: a 'start' sidebar is grabbed from the RIGHT`}];export{e as ADW_LENGTH_UNIT_VECTORS,t as GLIB_CLAMP_VECTORS,i as NATURAL_SIDEBAR_WIDTH_VECTORS,u as NAVIGATION_ACTION_VECTORS,o as NAVIGATION_SPLIT_VIEW_LAYOUT_VECTORS,l as NAVIGATION_STACK_VECTORS,d as OVERLAY_COLLAPSE_VECTORS,s as OVERLAY_SPLIT_VIEW_LAYOUT_VECTORS,g as OVERLAY_SWIPE_AREA_VECTORS,h as OVERLAY_SWIPE_CANCEL_VECTORS,m as OVERLAY_SWIPE_RELEASE_VECTORS,f as OVERLAY_SWIPE_SNAP_POINT_VECTORS,p as OVERLAY_SWIPE_START_VECTORS,n as SIDEBAR_BOUNDS_VECTORS,r as SIDEBAR_WIDTH_VECTORS,a as SPLIT_VIEW_MEASURE_VECTORS,c as TAGS_CONFLICT_VECTORS};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";const e=[{id:`P0`,pinned:!0},{id:`P1`,pinned:!0},{id:`A`},{id:`B`}],AUTO_SELECT=e=>[{selectedId:e,selectedIndex:0,previousId:null,interactive:!1}],t=[{rule:`closing the selected page selects the NEXT one and removes it — web removed nothing at all, so every close was permanently denied`,derivedFrom:`close_page_cb confirms a non-pinned page (adw-tab-view.c:1990-1991); select_previous_page falls through to adw_tab_view_select_next_page (:1893) which succeeds at pos 1 < n_pages-1 (:3753); detach_page removes at :1915`,pages:[{id:`A`},{id:`B`},{id:`C`}],setupChanges:AUTO_SELECT(`A`),ops:[{kind:`select`,id:`B`},{kind:`closePage`,id:`B`}],opResults:[!0,!0],changes:[{selectedId:`B`,selectedIndex:1,previousId:`A`,interactive:!0},{selectedId:`C`,selectedIndex:2,previousId:`B`,interactive:!1}],pagesChanges:[{kind:`detached`,id:`B`,position:1,previousPosition:1}],order:[`A`,`C`],nPinnedPages:0,selectedId:`C`,selectedIndex:1},{rule:`closing the LAST page falls back to the previous one`,derivedFrom:`select_next_page returns FALSE at pos >= n_pages-1 (adw-tab-view.c:3753), so select_previous_page runs (:1896, :3723)`,pages:[{id:`A`},{id:`B`},{id:`C`}],setupChanges:AUTO_SELECT(`A`),ops:[{kind:`select`,id:`C`},{kind:`closePage`,id:`C`}],opResults:[!0,!0],changes:[{selectedId:`C`,selectedIndex:2,previousId:`A`,interactive:!0},{selectedId:`B`,selectedIndex:1,previousId:`C`,interactive:!1}],order:[`A`,`B`],nPinnedPages:0,selectedId:`B`,selectedIndex:1},{rule:`closing a page BEFORE the selection keeps the same page selected, shifts its index down, and emits NOTHING`,derivedFrom:`select_previous_page early-returns because page != selected_page (adw-tab-view.c:1864-1865), so set_selected_page and its notify (:1854) are never reached`,pages:[{id:`A`},{id:`B`},{id:`C`}],setupChanges:AUTO_SELECT(`A`),ops:[{kind:`select`,id:`C`},{kind:`closePage`,id:`A`}],opResults:[!0,!0],changes:[{selectedId:`C`,selectedIndex:2,previousId:`A`,interactive:!0}],order:[`B`,`C`],nPinnedPages:0,selectedId:`C`,selectedIndex:1},{rule:`closing the ONLY page empties the view: no selection, index -1 — both ports reported index 0 for a page-less view, and NS refused the close outright`,derivedFrom:"detach_page: `if (self->n_pages == 1) set_selected_page (self, NULL, !in_dispose);` (adw-tab-view.c:1912-1913)",pages:[{id:`A`}],setupChanges:AUTO_SELECT(`A`),ops:[{kind:`closePage`,id:`A`}],opResults:[!0],changes:[{selectedId:null,selectedIndex:-1,previousId:`A`,interactive:!1}],pagesChanges:[{kind:`detached`,id:`A`,position:0,previousPosition:0}],order:[],nPinnedPages:0,selectedId:null,selectedIndex:-1},{rule:`a page opened from a parent falls back to the SIBLING opened before it, not to the next page`,derivedFrom:`select_previous_page: parent is set and pos > 0, prev is a descendant of the parent -> select prev (adw-tab-view.c:1869-1878)`,pages:[{id:`P`},{id:`C1`,parentId:`P`},{id:`C2`,parentId:`P`}],setupChanges:AUTO_SELECT(`P`),ops:[{kind:`select`,id:`C2`},{kind:`closePage`,id:`C2`}],opResults:[!0,!0],changes:[{selectedId:`C2`,selectedIndex:2,previousId:`P`,interactive:!0},{selectedId:`C1`,selectedIndex:1,previousId:`C2`,interactive:!1}],order:[`P`,`C1`],nPinnedPages:0,selectedId:`C1`,selectedIndex:1},{rule:`closing a tab you opened from another tab lands back on the OPENER, not on the next tab — the rule both ports lack entirely`,derivedFrom:`is_descendant_of returns TRUE for page == parent because the while-loop exits immediately (adw-tab-view.c:1735-1742), so prev == parent hits the descendant branch (:1874-1877) instead of falling through to select_next_page`,pages:[{id:`P`},{id:`X`,parentId:`P`},{id:`Y`}],setupChanges:AUTO_SELECT(`P`),ops:[{kind:`select`,id:`X`},{kind:`closePage`,id:`X`}],opResults:[!0,!0],changes:[{selectedId:`X`,selectedIndex:1,previousId:`P`,interactive:!0},{selectedId:`P`,selectedIndex:0,previousId:`X`,interactive:!1}],order:[`P`,`Y`],nPinnedPages:0,selectedId:`P`,selectedIndex:0},{rule:`with a PINNED parent the previous page is a different pinned tab, so the parent is selected directly`,derivedFrom:`prev is not a descendant of the parent, but prev.pinned && parent.pinned holds -> select the parent (adw-tab-view.c:1880-1890). A page opened from a pinned parent is placed after the LAST pinned page, which is why the previous page need not be the parent.`,pages:[{id:`P0`,pinned:!0},{id:`P1`,pinned:!0},{id:`X`,parentId:`P0`}],setupChanges:AUTO_SELECT(`P0`),ops:[{kind:`select`,id:`X`},{kind:`closePage`,id:`X`}],opResults:[!0,!0],changes:[{selectedId:`X`,selectedIndex:2,previousId:`P0`,interactive:!0},{selectedId:`P0`,selectedIndex:0,previousId:`X`,interactive:!1}],order:[`P0`,`P1`],nPinnedPages:2,selectedId:`P0`,selectedIndex:0},{rule:`a PINNED page is denied by the default handler: nothing is removed and the page is no longer closing`,derivedFrom:"close_page_cb calls close_page_finish with `!adw_tab_page_get_pinned (page)` (adw-tab-view.c:1990-1991); close_page_finish clears the flag then returns on !confirm (:4428-4431)",pages:[{id:`A`,pinned:!0},{id:`B`}],setupChanges:AUTO_SELECT(`A`),ops:[{kind:`closePage`,id:`A`}],opResults:[!0],changes:[],closeAttempts:[`A`],order:[`A`,`B`],nPinnedPages:1,selectedId:`A`,selectedIndex:0,closing:[]},{rule:`a deferred close is re-entrant-safe: the second request is ignored and the handler does NOT run again — the seam that lets an app show "save before closing?"`,derivedFrom:"`if (page->closing) return;` (adw-tab-view.c:4396-4397); close_page_finish clears the flag and returns without detaching when confirm is FALSE (:4428-4431)",pages:[{id:`A`},{id:`B`},{id:`C`}],handler:`defer`,setupChanges:AUTO_SELECT(`A`),ops:[{kind:`closePage`,id:`B`},{kind:`closePage`,id:`B`},{kind:`closePageFinish`,id:`B`,confirm:!1}],opResults:[!0,!1,!1],changes:[],closeAttempts:[`B`],order:[`A`,`B`,`C`],nPinnedPages:0,selectedId:`A`,selectedIndex:0,closing:[]},{rule:`a deferred close that is later CONFIRMED detaches the page, successor rule and all`,derivedFrom:`close_page_finish with confirm TRUE calls detach_page (adw-tab-view.c:4436)`,pages:[{id:`A`},{id:`B`},{id:`C`}],handler:`defer`,setupChanges:AUTO_SELECT(`A`),ops:[{kind:`select`,id:`B`},{kind:`closePage`,id:`B`},{kind:`closePageFinish`,id:`B`,confirm:!0}],opResults:[!0,!0,!0],changes:[{selectedId:`B`,selectedIndex:1,previousId:`A`,interactive:!0},{selectedId:`C`,selectedIndex:2,previousId:`B`,interactive:!1}],closeAttempts:[`B`],order:[`A`,`C`],nPinnedPages:0,selectedId:`C`,selectedIndex:1,closing:[]},{rule:`closePagesAfter walks DESCENDING — the order is part of the spec, because each confirmed close shifts every later index`,derivedFrom:"`for (i = self->n_pages - 1; i > pos; i--)` (adw-tab-view.c:4511)",pages:[{id:`A`},{id:`B`},{id:`C`},{id:`D`}],setupChanges:AUTO_SELECT(`A`),ops:[{kind:`closePagesAfter`,id:`B`}],opResults:[null],changes:[],closeAttempts:[`D`,`C`],order:[`A`,`B`],nPinnedPages:0,selectedId:`A`,selectedIndex:0},{rule:`closePagesBefore walks DESCENDING too`,derivedFrom:"`for (i = pos - 1; i >= 0; i--)` (adw-tab-view.c:4485)",pages:[{id:`A`},{id:`B`},{id:`C`},{id:`D`}],setupChanges:AUTO_SELECT(`A`),ops:[{kind:`select`,id:`D`},{kind:`closePagesBefore`,id:`C`}],opResults:[!0,null],changes:[{selectedId:`D`,selectedIndex:3,previousId:`A`,interactive:!0}],closeAttempts:[`B`,`A`],order:[`C`,`D`],nPinnedPages:0,selectedId:`D`,selectedIndex:1},{rule:`closeOtherPages skips the kept page and leaves the selection on it throughout`,derivedFrom:"`for (i = self->n_pages - 1; i >= 0; i--)` with `if (p == page) continue;` (adw-tab-view.c:4456-4462)",pages:[{id:`A`},{id:`B`},{id:`C`}],setupChanges:AUTO_SELECT(`A`),ops:[{kind:`select`,id:`B`},{kind:`closeOtherPages`,id:`B`}],opResults:[!0,null],changes:[{selectedId:`B`,selectedIndex:1,previousId:`A`,interactive:!0}],closeAttempts:[`C`,`A`],order:[`B`],nPinnedPages:0,selectedId:`B`,selectedIndex:0},{rule:`pinning moves the page to the end of the pinned prefix and grows the prefix`,derivedFrom:`old_pos 2 removed, new_pos = n_pinned_pages = 1, insert at 1, n_pinned = new_pos + 1 = 2 (adw-tab-view.c:4062-4077)`,pages:[{id:`A`,pinned:!0},{id:`B`},{id:`C`}],setupChanges:AUTO_SELECT(`A`),ops:[{kind:`setPinned`,id:`C`,pinned:!0}],opResults:[1],changes:[],pagesChanges:[{kind:`pinned`,id:`C`,position:1,previousPosition:2}],order:[`A`,`C`,`B`],nPinnedPages:2,selectedId:`A`,selectedIndex:0},{rule:`unpinning moves the page to just BEFORE the other non-pinned pages`,derivedFrom:`old_pos 0 removed, new_pos = 2 - 1 = 1, insert at 1, n_pinned = new_pos + 0 = 1 (adw-tab-view.c:4066-4077)`,pages:[{id:`A`,pinned:!0},{id:`B`,pinned:!0},{id:`C`},{id:`D`}],setupChanges:AUTO_SELECT(`A`),ops:[{kind:`setPinned`,id:`A`,pinned:!1}],opResults:[1],changes:[],pagesChanges:[{kind:`pinned`,id:`A`,position:1,previousPosition:0}],order:[`B`,`A`,`C`,`D`],nPinnedPages:1,selectedId:`A`,selectedIndex:1},{rule:`unpinning the LAST pinned page changes the count without moving anything — new_pos lands exactly where the page already was`,derivedFrom:`old_pos 1 removed -> [A,C]; new_pos = 2 - 1 = 1; insert at 1 -> [A,B,C]; n_pinned = 1 (adw-tab-view.c:4066-4077)`,pages:[{id:`A`,pinned:!0},{id:`B`,pinned:!0},{id:`C`}],setupChanges:AUTO_SELECT(`A`),ops:[{kind:`setPinned`,id:`B`,pinned:!1}],opResults:[1],changes:[],pagesChanges:[{kind:`pinned`,id:`B`,position:1,previousPosition:1}],order:[`A`,`B`,`C`],nPinnedPages:1,selectedId:`A`,selectedIndex:0},{rule:`pinning an already-pinned page is a no-op that emits nothing`,derivedFrom:"`if (adw_tab_page_get_pinned (page) == pinned) return;` (adw-tab-view.c:4059-4060)",pages:[{id:`A`,pinned:!0},{id:`B`}],setupChanges:AUTO_SELECT(`A`),ops:[{kind:`setPinned`,id:`A`,pinned:!0}],opResults:[-1],changes:[],pagesChanges:[],order:[`A`,`B`],nPinnedPages:1,selectedId:`A`,selectedIndex:0},{rule:`addPage inserts after the parent AND after every consecutive descendant of it, so links opened from one tab keep their order`,derivedFrom:`position starts at pos(P) = 0, then the do/while advances past every consecutive descendant of P and stops at X (adw-tab-view.c:4208-4217)`,pages:[{id:`P`},{id:`C1`,parentId:`P`},{id:`C2`,parentId:`P`},{id:`X`}],setupChanges:AUTO_SELECT(`P`),ops:[{kind:`addPage`,page:{id:`N`},parentId:`P`}],opResults:[3],changes:[],pagesChanges:[{kind:`attached`,id:`N`,position:3,previousPosition:-1}],order:[`P`,`C1`,`C2`,`N`,`X`],nPinnedPages:0,selectedId:`P`,selectedIndex:0},{rule:`a PINNED parent inserts after the last pinned page, and the new page is itself NOT pinned`,derivedFrom:`a pinned parent sets position = n_pinned_pages - 1 = 1 and the loop increments to 2 (adw-tab-view.c:4205-4217); create_and_insert_page is called with pinned = FALSE (:4222)`,pages:e,setupChanges:AUTO_SELECT(`P0`),ops:[{kind:`addPage`,page:{id:`N`},parentId:`P0`}],opResults:[2],changes:[],order:[`P0`,`P1`,`N`,`A`,`B`],nPinnedPages:2,selectedId:`P0`,selectedIndex:0},{rule:`a null parent appends`,derivedFrom:"`position = self->n_pages;` for a NULL parent (adw-tab-view.c:4219)",pages:[{id:`A`},{id:`B`}],setupChanges:AUTO_SELECT(`A`),ops:[{kind:`addPage`,page:{id:`N`},parentId:null}],opResults:[2],changes:[],order:[`A`,`B`,`N`],nPinnedPages:0,selectedId:`A`,selectedIndex:0},{rule:`the FIRST page added auto-selects and notifies; the second does not — and the attach is heard before the selection, so a renderer has built the tab by then`,derivedFrom:"insert_page auto-selects only when there is no selection: `if (!self->selected_page) set_selected_page (self, page, FALSE);` (adw-tab-view.c:1953-1954), inside the freeze/thaw that follows attach_page's page-attached signal (:1748-1778)",pages:[],setupChanges:[],ops:[{kind:`appendPage`,page:{id:`A`}},{kind:`appendPage`,page:{id:`B`}}],opResults:[0,1],changes:[{selectedId:`A`,selectedIndex:0,previousId:null,interactive:!1}],pagesChanges:[{kind:`attached`,id:`A`,position:0,previousPosition:-1},{kind:`attached`,id:`B`,position:1,previousPosition:-1}],order:[`A`,`B`],nPinnedPages:0,selectedId:`A`,selectedIndex:0},{rule:`a non-pinned insert BEFORE a pinned page is refused outright, not clamped`,derivedFrom:"`g_return_val_if_fail (position >= self->n_pinned_pages, NULL)` (adw-tab-view.c:4246)",pages:e,setupChanges:AUTO_SELECT(`P0`),ops:[{kind:`insertPage`,page:{id:`N`},position:1}],opResults:[-1],changes:[],pagesChanges:[],order:[`P0`,`P1`,`A`,`B`],nPinnedPages:2,selectedId:`P0`,selectedIndex:0,diagnostics:[`adw_tab_view_insert: assertion 'position >= self->n_pinned_pages' failed`]},{rule:`a pinned insert AFTER a non-pinned page is refused outright`,derivedFrom:"`g_return_val_if_fail (position <= self->n_pinned_pages, NULL)` (adw-tab-view.c:4313)",pages:e,setupChanges:AUTO_SELECT(`P0`),ops:[{kind:`insertPinnedPage`,page:{id:`N`},position:3}],opResults:[-1],changes:[],order:[`P0`,`P1`,`A`,`B`],nPinnedPages:2,selectedId:`P0`,selectedIndex:0,diagnostics:[`adw_tab_view_insert_pinned: assertion 'position <= self->n_pinned_pages' failed`]},{rule:`prepend inserts at the pinned boundary and shifts the selection with its page`,derivedFrom:"`create_and_insert_page (self, child, NULL, self->n_pinned_pages, FALSE)` (adw-tab-view.c:4268)",pages:e,setupChanges:AUTO_SELECT(`P0`),ops:[{kind:`select`,id:`A`},{kind:`prependPage`,page:{id:`N`}}],opResults:[!0,2],changes:[{selectedId:`A`,selectedIndex:2,previousId:`P0`,interactive:!0}],order:[`P0`,`P1`,`N`,`A`,`B`],nPinnedPages:2,selectedId:`A`,selectedIndex:3},{rule:`appendPinnedPage grows the pinned prefix and pushes the non-pinned pages back`,derivedFrom:"`create_and_insert_page (self, child, NULL, self->n_pinned_pages, TRUE)` (adw-tab-view.c:4356)",pages:e,setupChanges:AUTO_SELECT(`P0`),ops:[{kind:`appendPinnedPage`,page:{id:`P2`}}],opResults:[2],changes:[],order:[`P0`,`P1`,`P2`,`A`,`B`],nPinnedPages:3,selectedId:`P0`,selectedIndex:0},{rule:`selectFirst from the FIRST non-pinned tab hops the partition boundary into pinned territory`,derivedFrom:`pos = n_pinned_pages = 2 gives A itself, and since !pinned it falls back to nth(0) (adw-tab-view.c:3776-3782)`,pages:e,setupChanges:AUTO_SELECT(`P0`),ops:[{kind:`select`,id:`A`},{kind:`selectFirst`}],opResults:[!0,!0],changes:[{selectedId:`A`,selectedIndex:2,previousId:`P0`,interactive:!0},{selectedId:`P0`,selectedIndex:0,previousId:`A`,interactive:!0}],order:[`P0`,`P1`,`A`,`B`],nPinnedPages:2,selectedId:`P0`,selectedIndex:0},{rule:`selectFirst from a later non-pinned tab stops at the first NON-pinned one, not at index 0`,derivedFrom:`pos = n_pinned_pages = 2 gives A, which is not the selected page, so no fallback (adw-tab-view.c:3776-3781)`,pages:e,setupChanges:AUTO_SELECT(`P0`),ops:[{kind:`select`,id:`B`},{kind:`selectFirst`}],opResults:[!0,!0],changes:[{selectedId:`B`,selectedIndex:3,previousId:`P0`,interactive:!0},{selectedId:`A`,selectedIndex:2,previousId:`B`,interactive:!0}],order:[`P0`,`P1`,`A`,`B`],nPinnedPages:2,selectedId:`A`,selectedIndex:2},{rule:`selectFirst on the first PINNED tab does nothing — the hop only exists in the non-pinned direction`,derivedFrom:`pinned -> pos = 0 -> page == selected_page and the !pinned fallback does not apply (adw-tab-view.c:3776, :3784-3785)`,pages:e,setupChanges:AUTO_SELECT(`P0`),ops:[{kind:`selectFirst`}],opResults:[!1],changes:[],order:[`P0`,`P1`,`A`,`B`],nPinnedPages:2,selectedId:`P0`,selectedIndex:0},{rule:`selectLast from the LAST pinned tab hops to the last non-pinned one`,derivedFrom:`pinned -> pos = n_pinned_pages - 1 = 1 gives P1 itself, and since pinned it falls back to nth(n_pages - 1) (adw-tab-view.c:3805-3811)`,pages:e,setupChanges:AUTO_SELECT(`P0`),ops:[{kind:`select`,id:`P1`},{kind:`selectLast`}],opResults:[!0,!0],changes:[{selectedId:`P1`,selectedIndex:1,previousId:`P0`,interactive:!0},{selectedId:`B`,selectedIndex:3,previousId:`P1`,interactive:!0}],order:[`P0`,`P1`,`A`,`B`],nPinnedPages:2,selectedId:`B`,selectedIndex:3},{rule:`selectLast on the last non-pinned tab does nothing`,derivedFrom:`!pinned -> pos = n_pages - 1 = 3 gives B, no fallback for non-pinned, page == selected (adw-tab-view.c:3805, :3813-3814)`,pages:e,setupChanges:AUTO_SELECT(`P0`),ops:[{kind:`select`,id:`B`},{kind:`selectLast`}],opResults:[!0,!1],changes:[{selectedId:`B`,selectedIndex:3,previousId:`P0`,interactive:!0}],order:[`P0`,`P1`,`A`,`B`],nPinnedPages:2,selectedId:`B`,selectedIndex:3},{rule:`selectNext STOPS at the last page — it does not wrap`,derivedFrom:"`if (pos >= self->n_pages - 1) return FALSE;` (adw-tab-view.c:3753-3754)",pages:[{id:`A`},{id:`B`},{id:`C`}],setupChanges:AUTO_SELECT(`A`),ops:[{kind:`select`,id:`C`},{kind:`selectNext`}],opResults:[!0,!1],changes:[{selectedId:`C`,selectedIndex:2,previousId:`A`,interactive:!0}],order:[`A`,`B`,`C`],nPinnedPages:0,selectedId:`C`,selectedIndex:2},{rule:`Ctrl+Tab WRAPS where selectNext stops`,derivedFrom:`select_page_cb forward branch: on select_next failure with last == FALSE it selects nth(0) (adw-tab-view.c:2035-2041)`,pages:[{id:`A`},{id:`B`},{id:`C`}],setupChanges:AUTO_SELECT(`A`),ops:[{kind:`select`,id:`C`},{kind:`cycleNext`}],opResults:[!0,!0],changes:[{selectedId:`C`,selectedIndex:2,previousId:`A`,interactive:!0},{selectedId:`A`,selectedIndex:0,previousId:`C`,interactive:!0}],order:[`A`,`B`,`C`],nPinnedPages:0,selectedId:`A`,selectedIndex:0},{rule:`Ctrl+Shift+Tab wraps backwards to the last page`,derivedFrom:`select_page_cb backward branch: on select_previous failure with last == FALSE it selects nth(n_pages - 1) (adw-tab-view.c:2022-2028)`,pages:[{id:`A`},{id:`B`},{id:`C`}],setupChanges:AUTO_SELECT(`A`),ops:[{kind:`cyclePrevious`}],opResults:[!0],changes:[{selectedId:`C`,selectedIndex:2,previousId:`A`,interactive:!0}],order:[`A`,`B`,`C`],nPinnedPages:0,selectedId:`C`,selectedIndex:2},{rule:`Ctrl+Tab on a single-page view does nothing and rings nothing — the shortcut propagates to whatever contains the view`,derivedFrom:"`if (self->n_pages <= 1) return GDK_EVENT_PROPAGATE;` (adw-tab-view.c:2008)",pages:[{id:`A`}],setupChanges:AUTO_SELECT(`A`),ops:[{kind:`cycleNext`},{kind:`cyclePrevious`}],opResults:[!1,!1],changes:[],order:[`A`],nPinnedPages:0,selectedId:`A`,selectedIndex:0},{rule:`Alt+0 maps to page index 9 and is ignored on a shorter view`,derivedFrom:"`if (n_page >= self->n_pages) return GDK_EVENT_PROPAGATE;` with Alt+0 mapped to n_page 9 (adw-tab-view.c:2145, :2149-2150)",pages:[{id:`A`},{id:`B`},{id:`C`}],setupChanges:AUTO_SELECT(`A`),ops:[{kind:`selectNth`,n:9}],opResults:[!1],changes:[],order:[`A`,`B`,`C`],nPinnedPages:0,selectedId:`A`,selectedIndex:0},{rule:`Alt+1 on the already-selected page changes nothing and notifies nothing`,derivedFrom:"`if (adw_tab_view_get_selected_page (self) == page) return GDK_EVENT_PROPAGATE;` (adw-tab-view.c:2158-2159)",pages:[{id:`A`},{id:`B`},{id:`C`}],setupChanges:AUTO_SELECT(`A`),ops:[{kind:`selectNth`,n:0}],opResults:[!1],changes:[],order:[`A`,`B`,`C`],nPinnedPages:0,selectedId:`A`,selectedIndex:0},{rule:`REGRESSION PIN — a negative and a FRACTIONAL index are both refused. NS stored 1.7, so no page index matched it, every page collapsed and a notify still fired with selected: 1.7`,derivedFrom:"adw_tab_view_get_nth_page takes an `int` and asserts `position >= 0` / `position < n_pages` (adw-tab-view.c:4126-4134); no fractional and no clamping path exists anywhere in the file",pages:[{id:`A`},{id:`B`},{id:`C`}],setupChanges:AUTO_SELECT(`A`),ops:[{kind:`selectNth`,n:-1},{kind:`selectNth`,n:1.7},{kind:`selectNth`,n:99}],opResults:[!1,!1,!1],changes:[],order:[`A`,`B`,`C`],nPinnedPages:0,selectedId:`A`,selectedIndex:0},{rule:`selection is keyed by IDENTITY, so two tabs with the same title are still distinguishable`,derivedFrom:`libadwaita keys selection by AdwTabPage pointer, never by title (adw_tab_view_set_selected_page, adw-tab-view.c:3682-3695); the string id is the platform-neutral stand-in`,pages:[{id:`page-1`,title:`Untitled`},{id:`page-2`,title:`Untitled`}],setupChanges:AUTO_SELECT(`page-1`),ops:[{kind:`select`,id:`page-2`}],opResults:[!0],changes:[{selectedId:`page-2`,selectedIndex:1,previousId:`page-1`,interactive:!0}],order:[`page-1`,`page-2`],nPinnedPages:0,selectedId:`page-2`,selectedIndex:1},{rule:`selecting an unknown id leaves the selection alone and records the precondition C asserts`,derivedFrom:"`g_return_if_fail (page_belongs_to_this_view (self, selected_page))` (adw-tab-view.c:3689)",pages:[{id:`A`},{id:`B`}],setupChanges:AUTO_SELECT(`A`),ops:[{kind:`select`,id:`does-not-exist`}],opResults:[!1],changes:[],order:[`A`,`B`],nPinnedPages:0,selectedId:`A`,selectedIndex:0,diagnostics:[`adw_tab_view_set_selected_page: assertion 'page_belongs_to_this_view (self, selected_page)' failed`]},{rule:`selecting null is legal ONLY while the view is empty`,derivedFrom:`the n_pages > 0 branch requires a real page; only the else branch accepts NULL (adw-tab-view.c:3687-3693)`,pages:[{id:`A`},{id:`B`}],setupChanges:AUTO_SELECT(`A`),ops:[{kind:`select`,id:null}],opResults:[!1],changes:[],order:[`A`,`B`],nPinnedPages:0,selectedId:`A`,selectedIndex:0,diagnostics:[`adw_tab_view_set_selected_page: assertion 'ADW_IS_TAB_PAGE (selected_page)' failed`]},{rule:`the first NON-pinned tab cannot be dragged backwards into pinned territory`,derivedFrom:"first = n_pinned_pages = 2, pos = 2, `if (pos <= first) return FALSE;` (adw-tab-view.c:4597-4600)",pages:e,setupChanges:AUTO_SELECT(`P0`),ops:[{kind:`reorderBackward`,id:`A`}],opResults:[!1],changes:[],pagesChanges:[],order:[`P0`,`P1`,`A`,`B`],nPinnedPages:2,selectedId:`P0`,selectedIndex:0},{rule:`the last PINNED tab cannot be dragged forwards out of the pinned prefix`,derivedFrom:"last = n_pinned_pages - 1 = 1, pos = 1, `if (pos >= last) return FALSE;` (adw-tab-view.c:4628-4631)",pages:e,setupChanges:AUTO_SELECT(`P0`),ops:[{kind:`reorderForward`,id:`P1`}],opResults:[!1],changes:[],order:[`P0`,`P1`,`A`,`B`],nPinnedPages:2,selectedId:`P0`,selectedIndex:0},{rule:`reorderFirst on a page already first in its partition returns false rather than moving it into the other partition`,derivedFrom:`reorder_first targets pos = n_pinned_pages = 2, which equals A's position, and reorder_page returns FALSE when original_pos == position (adw-tab-view.c:4657, :4552-4553)`,pages:e,setupChanges:AUTO_SELECT(`P0`),ops:[{kind:`reorderFirst`,id:`A`}],opResults:[!1],changes:[],order:[`P0`,`P1`,`A`,`B`],nPinnedPages:2,selectedId:`P0`,selectedIndex:0},{rule:`reorderLast on a pinned page stops at the END OF THE PINNED PREFIX, and the selection follows the page it is on`,derivedFrom:`pinned -> pos = n_pinned_pages - 1 = 1 (adw-tab-view.c:4683), then reorder_page moves it (:4557-4558)`,pages:e,setupChanges:AUTO_SELECT(`P0`),ops:[{kind:`reorderLast`,id:`P0`}],opResults:[!0],changes:[],pagesChanges:[{kind:`reordered`,id:`P0`,position:1,previousPosition:0}],order:[`P1`,`P0`,`A`,`B`],nPinnedPages:2,selectedId:`P0`,selectedIndex:1},{rule:`reorderPage moves a page and emits a reordered change — and notifies NO selection change, because the selected page never changed`,derivedFrom:`remove at original_pos then insert at position, then emit page-reordered (adw-tab-view.c:4553-4561)`,pages:[{id:`A`},{id:`B`},{id:`C`}],setupChanges:AUTO_SELECT(`A`),ops:[{kind:`reorder`,id:`A`,position:2}],opResults:[!0],changes:[],pagesChanges:[{kind:`reordered`,id:`A`,position:2,previousPosition:0}],order:[`B`,`C`,`A`],nPinnedPages:0,selectedId:`A`,selectedIndex:2},{rule:`reordering a non-pinned page into the pinned prefix is refused`,derivedFrom:"non-pinned branch: `g_return_val_if_fail (position >= self->n_pinned_pages, FALSE)` (adw-tab-view.c:4546)",pages:e,setupChanges:AUTO_SELECT(`P0`),ops:[{kind:`reorder`,id:`A`,position:1}],opResults:[!1],changes:[],order:[`P0`,`P1`,`A`,`B`],nPinnedPages:2,selectedId:`P0`,selectedIndex:0,diagnostics:[`adw_tab_view_reorder_page: assertion 'position >= self->n_pinned_pages' failed`]},{rule:`detaching a parent re-points its children at the GRANDparent, so the successor rule keeps working for them`,derivedFrom:`page_parent_notify_cb re-parents to the grandparent when the parent page is finalized (adw-tab-view.c:293-303); detach_page drops the last reference (:1915, :1938)`,pages:[{id:`G`},{id:`P`,parentId:`G`},{id:`C`,parentId:`P`},{id:`Z`}],setupChanges:AUTO_SELECT(`G`),ops:[{kind:`detach`,id:`P`},{kind:`select`,id:`C`},{kind:`closePage`,id:`C`}],opResults:[!0,!0,!0],changes:[{selectedId:`C`,selectedIndex:1,previousId:`G`,interactive:!0},{selectedId:`G`,selectedIndex:0,previousId:`C`,interactive:!1}],order:[`G`,`Z`],nPinnedPages:0,selectedId:`G`,selectedIndex:0},{rule:`a page title is LIVE: setting it emits an updated change, and null coerces to the empty string`,derivedFrom:'`g_set_str (&self->title, title ? title : "")` then notify::title (adw-tab-view.c:3021-3024), which AdwTab connects to in order to re-render the label (adw-tab.c:930-931)',pages:[{id:`A`,title:`One`},{id:`B`,title:`Two`}],setupChanges:AUTO_SELECT(`A`),ops:[{kind:`setTitle`,id:`B`,title:`Renamed`},{kind:`setTitle`,id:`B`,title:`Renamed`},{kind:`setTitle`,id:`B`,title:null}],opResults:[!0,!1,!0],changes:[],pagesChanges:[{kind:`updated`,id:`B`,position:1,previousPosition:1},{kind:`updated`,id:`B`,position:1,previousPosition:1}],order:[`A`,`B`],nPinnedPages:0,selectedId:`A`,selectedIndex:0},{rule:`a duplicate page id is refused — two pages sharing an id would be two pages sharing an AdwTabPage pointer`,derivedFrom:`every lookup in adw-tab-view.c compares AdwTabPage POINTERS (get_page_position, :4160-4165), a relation the string id stands in for; C cannot reach a duplicate, so refusing is the only unambiguous reading`,pages:[{id:`A`},{id:`B`}],setupChanges:AUTO_SELECT(`A`),ops:[{kind:`appendPage`,page:{id:`A`}}],opResults:[-1],changes:[],pagesChanges:[],order:[`A`,`B`],nPinnedPages:0,selectedId:`A`,selectedIndex:0,diagnostics:[`adw_tab_view_insert: assertion 'page id 'A' is unique' failed`]}];function seedTabViewPages(e,t){for(let n of t){let t={id:n.id,title:n.title};n.parentId===void 0?n.pinned?e.appendPinnedPage(t):e.appendPage(t):e.addPage(t,n.parentId)}}function applyTabViewOp(e,t){switch(t.kind){case`select`:return e.setSelectedPage(t.id);case`selectNth`:return e.selectNthPage(t.n);case`selectPrevious`:return e.selectPreviousPage();case`selectNext`:return e.selectNextPage();case`selectFirst`:return e.selectFirstPage();case`selectLast`:return e.selectLastPage();case`cycleNext`:return e.cycleNextPage();case`cyclePrevious`:return e.cyclePreviousPage();case`addPage`:return e.addPage({id:t.page.id,title:t.page.title},t.parentId);case`insertPage`:return e.insertPage({id:t.page.id,title:t.page.title},t.position);case`prependPage`:return e.prependPage({id:t.page.id,title:t.page.title});case`appendPage`:return e.appendPage({id:t.page.id,title:t.page.title});case`insertPinnedPage`:return e.insertPinnedPage({id:t.page.id,title:t.page.title},t.position);case`prependPinnedPage`:return e.prependPinnedPage({id:t.page.id,title:t.page.title});case`appendPinnedPage`:return e.appendPinnedPage({id:t.page.id,title:t.page.title});case`setPinned`:return e.setPagePinned(t.id,t.pinned);case`closePage`:return e.closePage(t.id);case`closePageFinish`:return e.closePageFinish(t.id,t.confirm);case`closeOtherPages`:return e.closeOtherPages(t.id),null;case`closePagesBefore`:return e.closePagesBefore(t.id),null;case`closePagesAfter`:return e.closePagesAfter(t.id),null;case`detach`:return e.detachPage(t.id)!==null;case`reorder`:return e.reorderPage(t.id,t.position);case`reorderBackward`:return e.reorderBackward(t.id);case`reorderForward`:return e.reorderForward(t.id);case`reorderFirst`:return e.reorderFirst(t.id);case`reorderLast`:return e.reorderLast(t.id);case`setTitle`:return e.setPageTitle(t.id,t.title)}}function tabViewOrder(e){return e.pages.map(e=>e.id)}function tabViewClosing(e){return e.pages.filter(t=>e.isClosing(t.id)).map(e=>e.id)}const n=[{rule:`closing a page that is not selected moves nothing`,derivedFrom:"`if (page != self->selected_page) return;` (adw-tab-view.c:1864-1865)",pages:[{id:`A`},{id:`B`},{id:`C`}],closingId:`A`,selectedId:`C`,successorId:`C`},{rule:`a parentless page falls to the NEXT page`,derivedFrom:"`if (adw_tab_view_select_next_page (self)) return;` (adw-tab-view.c:1893-1894)",pages:[{id:`A`},{id:`B`},{id:`C`}],closingId:`B`,selectedId:`B`,successorId:`C`},{rule:`the last page falls to the previous one`,derivedFrom:`select_next_page fails, so adw_tab_view_select_previous_page runs (adw-tab-view.c:1896)`,pages:[{id:`A`},{id:`B`},{id:`C`}],closingId:`C`,selectedId:`C`,successorId:`B`},{rule:`the only page leaves nothing selected`,derivedFrom:`neither select_next_page nor select_previous_page can move; detach_page then sets NULL (adw-tab-view.c:1912-1913)`,pages:[{id:`A`}],closingId:`A`,selectedId:`A`,successorId:null},{rule:`a page IS its own descendant, so "the previous page is the opener" selects the opener`,derivedFrom:`is_descendant_of exits the while-loop immediately for page == parent (adw-tab-view.c:1735-1742), reached from :1874`,pages:[{id:`P`},{id:`X`,parentId:`P`},{id:`Y`}],closingId:`X`,selectedId:`X`,successorId:`P`},{rule:`a sibling opened from the same parent wins over the next page`,derivedFrom:`is_descendant_of (prev_page, parent) with prev_page.parent == parent (adw-tab-view.c:1874-1877)`,pages:[{id:`P`},{id:`C1`,parentId:`P`},{id:`C2`,parentId:`P`},{id:`Z`}],closingId:`C2`,selectedId:`C2`,successorId:`C1`},{rule:`an INDIRECT descendant counts — the walk follows the whole parent chain`,derivedFrom:"`while (page && page != parent) page = adw_tab_page_get_parent (page);` (adw-tab-view.c:1738-1739)",pages:[{id:`P`},{id:`C1`,parentId:`P`},{id:`G1`,parentId:`C1`},{id:`C2`,parentId:`P`}],closingId:`C2`,selectedId:`C2`,successorId:`G1`},{rule:`when the previous page is a DIFFERENT pinned tab, the pinned parent is selected instead`,derivedFrom:"`if (adw_tab_page_get_pinned (prev_page) && adw_tab_page_get_pinned (parent))` (adw-tab-view.c:1885-1890)",pages:[{id:`P0`,pinned:!0},{id:`P1`,pinned:!0},{id:`X`,parentId:`P0`}],closingId:`X`,selectedId:`X`,successorId:`P0`},{rule:`an unrelated previous page with a NON-pinned parent falls through to the ordinary next/previous rule`,derivedFrom:`neither the descendant branch nor the both-pinned branch fires, so :1893-1896 decides`,pages:[{id:`P`},{id:`U`},{id:`X`,parentId:`P`},{id:`Z`}],closingId:`X`,selectedId:`X`,successorId:`Z`},{rule:`a page with a parent that is FIRST in the list skips the parent rules entirely (pos > 0 fails)`,derivedFrom:"`if (parent && pos > 0)` (adw-tab-view.c:1867)",pages:[{id:`X`,parentId:`P`},{id:`Y`}],closingId:`X`,selectedId:`X`,successorId:`Y`}],r=[{rule:`a page IS its own descendant — the loop condition fails before the first step`,pages:[{id:`P`}],pageId:`P`,parentId:`P`,descendant:!0},{rule:`a direct child is a descendant`,pages:[{id:`P`},{id:`C`,parentId:`P`}],pageId:`C`,parentId:`P`,descendant:!0},{rule:`an indirect child is a descendant`,pages:[{id:`P`},{id:`C`,parentId:`P`},{id:`G`,parentId:`C`}],pageId:`G`,parentId:`P`,descendant:!0},{rule:`an unrelated page is not`,pages:[{id:`P`},{id:`U`}],pageId:`U`,parentId:`P`,descendant:!1},{rule:`the relation is not symmetric — the parent is not a descendant of its child`,pages:[{id:`P`},{id:`C`,parentId:`P`}],pageId:`P`,parentId:`C`,descendant:!1},{rule:`a null page reaches nothing`,pages:[{id:`P`}],pageId:null,parentId:`P`,descendant:!1}],i=[{autohide:!0,nPages:1,nPinnedPages:0,isTransferringPage:!1,revealed:!1,rule:`a lone ordinary tab hides the bar`},{autohide:!0,nPages:2,nPinnedPages:0,isTransferringPage:!1,revealed:!0,rule:`two tabs keep it up`},{autohide:!0,nPages:1,nPinnedPages:1,isTransferringPage:!1,revealed:!0,rule:`a single PINNED tab keeps the bar revealed — the clause missing from the web port`},{autohide:!0,nPages:0,nPinnedPages:0,isTransferringPage:!0,revealed:!0,rule:`a tab transfer in flight keeps the bar up so there is somewhere to drop`},{autohide:!0,nPages:0,nPinnedPages:0,isTransferringPage:!1,revealed:!1,rule:`an empty view with autohide hides the bar`},{autohide:!1,nPages:0,nPinnedPages:0,isTransferringPage:!1,revealed:!0,rule:`autohide off short-circuits to revealed, even with no pages at all`}],a=[{hovering:!1,fullyVisible:!0,selected:!0,dragging:!1,pinned:!1,visible:!0,rule:`the selected tab always shows it`},{hovering:!0,fullyVisible:!0,selected:!1,dragging:!1,pinned:!1,visible:!0,rule:`a fully-visible hovered tab shows it`},{hovering:!0,fullyVisible:!1,selected:!1,dragging:!1,pinned:!1,visible:!1,rule:`a hovered but partially scrolled-out tab does NOT`},{hovering:!1,fullyVisible:!0,selected:!1,dragging:!0,pinned:!1,visible:!0,rule:`a dragged tab shows it even unhovered`},{hovering:!1,fullyVisible:!0,selected:!1,dragging:!1,pinned:!1,visible:!1,rule:`an idle background tab shows nothing`},{hovering:!0,fullyVisible:!0,selected:!0,dragging:!0,pinned:!0,visible:!1,rule:`a PINNED tab never shows a close button, whatever else is true`}],o=[{tooltip:``,title:`Rechnungen 2026 – Übersicht 日本語`,text:`Rechnungen 2026 – Übersicht 日本語`,markup:!1,rule:`the title fallback is plain text and non-ASCII survives byte for byte`},{tooltip:`<b>build failed</b>`,title:`main.c`,text:`<b>build failed</b>`,markup:!0,rule:`a non-empty tooltip wins and is MARKUP — a renderer must not push it through an HTML sink`},{tooltip:``,title:``,text:``,markup:!1,rule:`no tooltip and no title is the empty string, not undefined`},{tooltip:` `,title:`main.c`,text:` `,markup:!0,rule:`only the EMPTY string falls back — g_strcmp0 (tooltip, "") is the whole test, so a space is a tooltip`}],s=[{icon:`text-x-generic`,indicatorIcon:null,loading:!0,pinned:!1,defaultIcon:`application-x-executable`,resolvedIcon:`text-x-generic`,spinner:!0,iconVisible:!0,indicatorVisible:!1,rule:`loading draws a spinner in the slot WITHOUT dropping the icon name`},{icon:null,indicatorIcon:null,loading:!1,pinned:!0,defaultIcon:`application-x-executable`,resolvedIcon:`application-x-executable`,spinner:!1,iconVisible:!0,indicatorVisible:!1,rule:`a pinned page with no icon falls back to the view default-icon`},{icon:null,indicatorIcon:null,loading:!1,pinned:!1,defaultIcon:`application-x-executable`,resolvedIcon:null,spinner:!1,iconVisible:!1,indicatorVisible:!1,rule:`the default-icon fallback is PINNED-only — an ordinary tab with no icon shows none`},{icon:`text-x-generic`,indicatorIcon:`media-record`,loading:!1,pinned:!0,defaultIcon:`application-x-executable`,resolvedIcon:`text-x-generic`,spinner:!1,iconVisible:!1,indicatorVisible:!0,rule:`on a pinned tab the indicator REPLACES the icon — a pinned tab is a single-glyph chip`},{icon:`text-x-generic`,indicatorIcon:`media-record`,loading:!1,pinned:!1,defaultIcon:null,resolvedIcon:`text-x-generic`,spinner:!1,iconVisible:!0,indicatorVisible:!0,rule:`an ordinary tab shows icon AND indicator side by side`},{icon:null,indicatorIcon:null,loading:!0,pinned:!0,defaultIcon:`application-x-executable`,resolvedIcon:null,spinner:!0,iconVisible:!0,indicatorVisible:!1,rule:`a LOADING pinned page does not pick up the default icon — only the !loading branch assigns it`}],c=[{rule:`an omitted title is the empty string, never undefined — NS rendered the literal text "undefined" for a page without one`,derivedFrom:`adw_tab_page_set_title, adw-tab-view.c:3021`,spec:{id:`a`},title:``,tooltip:``,icon:null,indicatorIcon:null,loading:!1,needsAttention:!1},{rule:`an explicit null title coerces to the empty string too`,derivedFrom:'`title ? title : ""` (adw-tab-view.c:3021)',spec:{id:`a`,title:null},title:``,tooltip:``,icon:null,indicatorIcon:null,loading:!1,needsAttention:!1},{rule:`a non-ASCII title is stored byte for byte, with no normalization`,derivedFrom:`g_set_str copies the UTF-8 string verbatim (adw-tab-view.c:3021)`,spec:{id:`a`,title:`Übersicht 日本語`},title:`Übersicht 日本語`,tooltip:``,icon:null,indicatorIcon:null,loading:!1,needsAttention:!1},{rule:`an absent icon stays NULL — unlike a view-stack icon name, which resolves to the empty string`,derivedFrom:"PAGE_PROP_ICON is a GIcon, and update_icons branches on `gicon != NULL` (adw-tab.c:194)",spec:{id:`a`,icon:null,indicatorIcon:null},title:``,tooltip:``,icon:null,indicatorIcon:null,loading:!1,needsAttention:!1},{rule:`every declared field survives`,derivedFrom:`adw_tab_page_set_{title,tooltip,icon,indicator_icon,loading,needs_attention} (adw-tab-view.c:3016-3352)`,spec:{id:`a`,title:`main.c`,tooltip:`<b>build failed</b>`,icon:`text-x-generic`,indicatorIcon:`media-record`,loading:!0,needsAttention:!0},title:`main.c`,tooltip:`<b>build failed</b>`,icon:`text-x-generic`,indicatorIcon:`media-record`,loading:!0,needsAttention:!0}];export{i as TABS_REVEALED_VECTORS,a as TAB_CLOSE_VISIBLE_VECTORS,r as TAB_DESCENDANT_VECTORS,s as TAB_ICON_STATE_VECTORS,c as TAB_PAGE_DESCRIPTOR_VECTORS,n as TAB_SUCCESSOR_VECTORS,o as TAB_TOOLTIP_VECTORS,t as TAB_VIEW_VECTORS,applyTabViewOp,seedTabViewPages,tabViewClosing,tabViewOrder};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=`Übersicht`,t=`Übersicht`,n=[{rule:`the first page added becomes visible — and the auto-pick NOTIFIES (both ports were silent here, which is why every bound switcher needed a manual refresh())`,derivedFrom:`add_page, adw-view-stack.c:1149-1151 → set_visible_child notify at :1038-1039`,pages:[{name:`learn`},{name:`code`}],setupChanges:[{index:0,name:`learn`,title:`learn`,interactive:!1}],ops:[],opResults:[],changes:[],visibleIndex:0,visibleName:`learn`,visibleTitle:`learn`,count:2},{rule:`the first VISIBLE page wins, not the first added`,derivedFrom:"add_page's `gtk_widget_get_visible (page->widget)` gate, adw-view-stack.c:1149-1151",pages:[{name:`a`,visible:!1},{name:`b`}],setupChanges:[{index:1,name:`b`,title:`b`,interactive:!1}],ops:[],opResults:[],changes:[],visibleIndex:1,visibleName:`b`,visibleTitle:`b`,count:2},{rule:`with every page hidden nothing is selected and nothing is emitted`,derivedFrom:`set_visible_child NULL scan finds no visible page (adw-view-stack.c:961-974), then returns at :976-977 with both NULL`,pages:[{name:`a`,visible:!1},{name:`b`,visible:!1}],setupChanges:[],ops:[],opResults:[],changes:[],visibleIndex:-1,visibleName:``,visibleTitle:``,count:2},{rule:`an index past the end is refused`,derivedFrom:"adw_view_stack_pages_select_item, adw-view-stack.c:682-683 `if (position >= children->len) return FALSE;`",pages:[{name:`learn`},{name:`code`}],setupChanges:[{index:0,name:`learn`,title:`learn`,interactive:!1}],ops:[{kind:`selectIndex`,index:2}],opResults:[!1],changes:[],visibleIndex:0,visibleName:`learn`,visibleTitle:`learn`,count:2},{rule:`a negative index is refused`,derivedFrom:`adw_view_stack_pages_select_item takes a guint, adw-view-stack.c:675-677 — -1 wraps to G_MAXUINT and fails the bound check at :682`,pages:[{name:`learn`},{name:`code`}],setupChanges:[{index:0,name:`learn`,title:`learn`,interactive:!1}],ops:[{kind:`selectIndex`,index:-1}],opResults:[!1],changes:[],visibleIndex:0,visibleName:`learn`,visibleTitle:`learn`,count:2},{rule:`REGRESSION PIN — a fractional index is refused. Both ports guarded with Number.isFinite, so 1.5 was stored, no page matched it, the whole stack went blank and a bogus notify still fired`,derivedFrom:`adw_view_stack_pages_select_item(GtkSelectionModel*, guint position, gboolean), adw-view-stack.c:675-683 — a fractional position cannot exist`,pages:[{name:`a`},{name:`b`},{name:`c`}],setupChanges:[{index:0,name:`a`,title:`a`,interactive:!1}],ops:[{kind:`selectIndex`,index:1.5}],opResults:[!1],changes:[],visibleIndex:0,visibleName:`a`,visibleTitle:`a`,count:3},{rule:`NaN, Infinity and a numeric STRING are refused too — the guint contract admits integers only`,derivedFrom:`adw_view_stack_pages_select_item, adw-view-stack.c:675-683`,pages:[{name:`a`},{name:`b`},{name:`c`}],setupChanges:[{index:0,name:`a`,title:`a`,interactive:!1}],ops:[{kind:`selectIndex`,index:NaN},{kind:`selectIndex`,index:1/0},{kind:`selectIndex`,index:`1`}],opResults:[!1,!1,!1],changes:[],visibleIndex:0,visibleName:`a`,visibleTitle:`a`,count:3},{rule:`selecting the same index twice notifies once`,derivedFrom:"set_visible_child idempotence guard, adw-view-stack.c:976-977 `if (page == self->visible_child) return;`",pages:[{name:`a`},{name:`b`},{name:`c`}],setupChanges:[{index:0,name:`a`,title:`a`,interactive:!1}],ops:[{kind:`selectIndex`,index:1},{kind:`selectIndex`,index:1}],opResults:[!0,!1],changes:[{index:1,name:`b`,title:`b`,interactive:!0}],visibleIndex:1,visibleName:`b`,visibleTitle:`b`,count:3},{rule:`an unknown name leaves the selection alone and records the warning C prints`,derivedFrom:`adw_view_stack_set_visible_child_name, adw-view-stack.c:2409-2412 (g_warning, then return)`,pages:[{name:`learn`},{name:`code`},{name:`debug`}],setupChanges:[{index:0,name:`learn`,title:`learn`,interactive:!1}],ops:[{kind:`selectName`,name:`missing`}],opResults:[!1],changes:[],visibleIndex:0,visibleName:`learn`,visibleTitle:`learn`,count:3,diagnostics:[`Child name 'missing' not found in AdwViewStack`]},{rule:`null and undefined are SILENT no-ops — no selection change and, unlike an unknown name, no diagnostic`,derivedFrom:"adw_view_stack_set_visible_child_name, adw-view-stack.c:2404-2405 — `if (name == NULL) return;` sits BEFORE find_page_for_name and its warning",pages:[{name:`a`},{name:`b`},{name:`c`}],setupChanges:[{index:0,name:`a`,title:`a`,interactive:!1}],ops:[{kind:`selectName`,name:null},{kind:`selectName`,name:void 0}],opResults:[!1,!1],changes:[],visibleIndex:0,visibleName:`a`,visibleTitle:`a`,count:3,diagnostics:[]},{rule:`an EMPTY name is a legal lookup matching a page literally named '' — not 'no name' (web's declarative path used a falsy check and silently showed page 0)`,derivedFrom:'find_page_for_name, adw-view-stack.c:901 `g_strcmp0 (page->name, name) == 0` — g_strcmp0("", "") is 0; only NULL is special-cased, at :2404',pages:[{name:`a`},{name:``},{name:`c`}],setupChanges:[{index:0,name:`a`,title:`a`,interactive:!1}],ops:[{kind:`selectName`,name:``}],opResults:[!0],changes:[{index:1,name:``,title:``,interactive:!0}],visibleIndex:1,visibleName:``,visibleTitle:``,count:3},{rule:`a duplicate name is still added, warned about, and resolves to the FIRST match`,derivedFrom:`add_page warns but only breaks out of the check loop and still adds (adw-view-stack.c:1115-1126 + :1136); find_page_for_name returns on the first match (:898-905)`,pages:[{name:`dup`,title:`First`},{name:`other`},{name:`dup`,title:`Second`}],setupChanges:[{index:0,name:`dup`,title:`First`,interactive:!1}],ops:[{kind:`selectName`,name:`other`},{kind:`selectName`,name:`dup`}],opResults:[!0,!0],changes:[{index:1,name:`other`,title:`other`,interactive:!0},{index:0,name:`dup`,title:`First`,interactive:!0}],visibleIndex:0,visibleName:`dup`,visibleTitle:`First`,count:3,duplicateNames:[`dup`],diagnostics:[`While adding page: duplicate child name in AdwViewStack: dup`]},{rule:`name matching is an exact, UNNORMALIZED compare — the NFD spelling of a name does not match its NFC page`,derivedFrom:`find_page_for_name, adw-view-stack.c:901 — g_strcmp0 is a byte compare over UTF-8, with no Unicode normalization`,pages:[{name:`other`},{name:e}],setupChanges:[{index:0,name:`other`,title:`other`,interactive:!1}],ops:[{kind:`selectName`,name:e},{kind:`selectName`,name:t}],opResults:[!0,!1],changes:[{index:1,name:e,title:e,interactive:!0}],visibleIndex:1,visibleName:e,visibleTitle:e,count:2,diagnostics:[`Child name '${t}' not found in AdwViewStack`]},{rule:`hiding the selected page falls back to the first still-visible one, notifying as an auto-pick`,derivedFrom:"update_child_visible, adw-view-stack.c:1071-1072 `else if (self->visible_child == page && !visible) set_visible_child (self, NULL);` → the first-visible scan at :961-974",pages:[{name:`a`},{name:`b`}],setupChanges:[{index:0,name:`a`,title:`a`,interactive:!1}],ops:[{kind:`selectIndex`,index:1},{kind:`setPageVisible`,name:`b`,visible:!1}],opResults:[!0,!0],changes:[{index:1,name:`b`,title:`b`,interactive:!0},{index:0,name:`a`,title:`a`,interactive:!1}],visibleIndex:0,visibleName:`a`,visibleTitle:`a`,count:2},{rule:`hiding the selected FIRST page moves the selection forward — the fallback scan skips the page it just hid`,derivedFrom:`set_visible_child NULL scan, adw-view-stack.c:961-974, reached from update_child_visible :1071-1072`,pages:[{name:`a`},{name:`b`}],setupChanges:[{index:0,name:`a`,title:`a`,interactive:!1}],ops:[{kind:`setPageVisible`,name:`a`,visible:!1}],opResults:[!0],changes:[{index:1,name:`b`,title:`b`,interactive:!1}],visibleIndex:1,visibleName:`b`,visibleTitle:`b`,count:2},{rule:`hiding the LAST visible page selects nothing — and unlike a remove, this DOES notify`,derivedFrom:`update_child_visible :1071-1072 → set_visible_child(self, NULL) with a non-NULL visible_child, which falls through to the notify at :1038-1039`,pages:[{name:`a`}],setupChanges:[{index:0,name:`a`,title:`a`,interactive:!1}],ops:[{kind:`setPageVisible`,name:`a`,visible:!1}],opResults:[!0],changes:[{index:-1,name:``,title:``,interactive:!1}],visibleIndex:-1,visibleName:``,visibleTitle:``,count:1},{rule:`making a page visible while nothing is selected selects it`,derivedFrom:"update_child_visible, adw-view-stack.c:1069-1070 `if (self->visible_child == NULL && visible) set_visible_child (self, page);`",pages:[{name:`a`,visible:!1},{name:`b`,visible:!1}],setupChanges:[],ops:[{kind:`setPageVisible`,name:`b`,visible:!0}],opResults:[!0],changes:[{index:1,name:`b`,title:`b`,interactive:!1}],visibleIndex:1,visibleName:`b`,visibleTitle:`b`,count:2},{rule:`making a page visible while ANOTHER is already selected moves nothing`,derivedFrom:`update_child_visible, adw-view-stack.c:1069-1072 — neither branch fires while visible_child is set and stays set`,pages:[{name:`a`,visible:!1},{name:`b`}],setupChanges:[{index:1,name:`b`,title:`b`,interactive:!1}],ops:[{kind:`setPageVisible`,name:`a`,visible:!0}],opResults:[!1],changes:[],visibleIndex:1,visibleName:`b`,visibleTitle:`b`,count:2},{rule:`setting the visible flag to the value it already has returns early`,derivedFrom:"adw_view_stack_page_set_visible, adw-view-stack.c — `if (visible == self->visible) return;` before update_child_visible",pages:[{name:`a`},{name:`b`}],setupChanges:[{index:0,name:`a`,title:`a`,interactive:!1}],ops:[{kind:`setPageVisible`,name:`a`,visible:!0}],opResults:[!1],changes:[],visibleIndex:0,visibleName:`a`,visibleTitle:`a`,count:2},{rule:`flipping an unknown page's visibility changes nothing and records the not-found warning`,derivedFrom:`update_child_visible is only ever reached through a real AdwViewStackPage (adw-view-stack.c:1095-1107); the name lookup that fails is find_page_for_name :891-906 + the g_warning at :2410`,pages:[{name:`a`},{name:`b`}],setupChanges:[{index:0,name:`a`,title:`a`,interactive:!1}],ops:[{kind:`setPageVisible`,name:`missing`,visible:!0}],opResults:[!1],changes:[],visibleIndex:0,visibleName:`a`,visibleTitle:`a`,count:2,diagnostics:[`Child name 'missing' not found in AdwViewStack`]},{rule:`a hidden page cannot be selected by name — the lookup succeeds and the commit is then skipped, silently`,derivedFrom:"adw_view_stack_set_visible_child_name, adw-view-stack.c:2415 `if (gtk_widget_get_visible (page->widget)) set_visible_child (self, page);`",pages:[{name:`a`},{name:`b`,visible:!1}],setupChanges:[{index:0,name:`a`,title:`a`,interactive:!1}],ops:[{kind:`selectName`,name:`b`}],opResults:[!1],changes:[],visibleIndex:0,visibleName:`a`,visibleTitle:`a`,count:2,diagnostics:[]},{rule:`removing the VISIBLE page clears the selection without re-picking and WITHOUT notifying`,derivedFrom:"stack_remove, adw-view-stack.c:1202-1203 `if (self->visible_child == page) self->visible_child = NULL;` — the function never calls set_visible_child on that path",pages:[{name:`a`},{name:`b`},{name:`c`}],setupChanges:[{index:0,name:`a`,title:`a`,interactive:!1}],ops:[{kind:`selectIndex`,index:1},{kind:`removePage`,name:`b`}],opResults:[!0,!0],changes:[{index:1,name:`b`,title:`b`,interactive:!0}],visibleIndex:-1,visibleName:``,visibleTitle:``,count:2},{rule:`removing a LATER page leaves the selection where it is`,derivedFrom:`stack_remove, adw-view-stack.c:1202 — the guard only fires for the visible page`,pages:[{name:`a`},{name:`b`},{name:`c`}],setupChanges:[{index:0,name:`a`,title:`a`,interactive:!1}],ops:[{kind:`removePage`,name:`c`}],opResults:[!0],changes:[],visibleIndex:0,visibleName:`a`,visibleTitle:`a`,count:2},{rule:`removing an EARLIER page keeps the same page selected and shifts its index down — C holds a pointer, not a slot`,derivedFrom:`stack_remove, adw-view-stack.c:1192-1209 — visible_child is an AdwViewStackPage* untouched unless it IS the removed page`,pages:[{name:`a`},{name:`b`},{name:`c`}],setupChanges:[{index:0,name:`a`,title:`a`,interactive:!1}],ops:[{kind:`selectIndex`,index:2},{kind:`removePage`,name:`a`}],opResults:[!0,!0],changes:[{index:2,name:`c`,title:`c`,interactive:!0}],visibleIndex:1,visibleName:`c`,visibleTitle:`c`,count:2},{rule:`removing an unknown name changes nothing`,derivedFrom:"stack_remove, adw-view-stack.c:1192-1194 `page = find_page_for_widget (...); if (!page) return;`",pages:[{name:`a`},{name:`b`}],setupChanges:[{index:0,name:`a`,title:`a`,interactive:!1}],ops:[{kind:`removePage`,name:`missing`}],opResults:[!1],changes:[],visibleIndex:0,visibleName:`a`,visibleTitle:`a`,count:2},{rule:`removing the first of two duplicates makes the second reachable by that name`,derivedFrom:`find_page_for_name returns the first match (adw-view-stack.c:898-905); stack_remove then removes exactly one page (:1209)`,pages:[{name:`dup`,title:`First`},{name:`dup`,title:`Second`}],setupChanges:[{index:0,name:`dup`,title:`First`,interactive:!1}],ops:[{kind:`removePage`,name:`dup`},{kind:`selectName`,name:`dup`}],opResults:[!0,!0],changes:[{index:0,name:`dup`,title:`Second`,interactive:!0}],visibleIndex:0,visibleName:`dup`,visibleTitle:`Second`,count:1,duplicateNames:[],diagnostics:[`While adding page: duplicate child name in AdwViewStack: dup`]},{rule:`an empty stack selects nothing — -1, not 0, so "nothing is selected" is distinguishable from "page 0 is selected"`,derivedFrom:`adw_view_stack_get_visible_child_name returns NULL while visible_child is NULL (adw-view-stack.c:2379-2385); select_item bound check :682-683 with children->len == 0`,pages:[],setupChanges:[],ops:[{kind:`selectIndex`,index:0}],opResults:[!1],changes:[],visibleIndex:-1,visibleName:``,visibleTitle:``,count:0}],r=[{rule:`an omitted title falls back to the name`,derivedFrom:`add_internal, adw-view-stack.c:1170-1172 — C stores NULL; the name fallback is a deliberate, shared port deviation`,page:{name:`learn`},title:`learn`,icon:``,visible:!0},{rule:`an explicit title wins`,derivedFrom:`adw_view_stack_add_titled, adw-view-stack.c:2219`,page:{name:`learn`,title:`Learn`},title:`Learn`,icon:``,visible:!0},{rule:`an EXPLICITLY empty title stays empty — only an absent one falls back`,derivedFrom:'add_internal, adw-view-stack.c:1171 `page->title = g_strdup (title);` — "" is a title, NULL is not',page:{name:`learn`,title:``},title:``,icon:``,visible:!0},{rule:"a `-symbolic` suffix is stripped from the icon NAME",derivedFrom:`PAGE_PROP_ICON_NAME is a name string, adw-view-stack.c:393-396 + :1887-1912`,page:{name:`learn`,icon:`go-next-symbolic`},title:`learn`,icon:`go-next`,visible:!0},{rule:`a name without the suffix is passed through untouched`,derivedFrom:`PAGE_PROP_ICON_NAME, adw-view-stack.c:393-396`,page:{name:`learn`,icon:`view-refresh`},title:`learn`,icon:`view-refresh`,visible:!0},{rule:"an absent icon is the EMPTY STRING, never undefined — a switcher reads `.icon.length`",derivedFrom:`PAGE_PROP_ICON_NAME defaults to NULL (adw-view-stack.c:393-396); "" is the agreed JS stand-in both renderers already assume`,page:{name:`learn`},title:`learn`,icon:``,visible:!0},{rule:"a page declared hidden keeps `visible: false` in its descriptor",derivedFrom:`PAGE_PROP_VISIBLE, adw-view-stack.c — default TRUE, set by adw_view_stack_page_set_visible`,page:{name:`learn`,visible:!1},title:`learn`,icon:``,visible:!1},{rule:`a page named "" resolves to an empty title, not to a synthesized one`,derivedFrom:"add_internal, adw-view-stack.c:1170-1171 — the name is stored verbatim; web used to invent `page-<index>`",page:{name:``},title:``,icon:``,visible:!0}],i=[{icon:`go-next-symbolic`,normalized:`go-next`,rule:`the suffix is stripped`},{icon:`view-refresh`,normalized:`view-refresh`,rule:`a plain name is untouched`},{icon:void 0,normalized:``,rule:`undefined becomes the empty string`},{icon:null,normalized:``,rule:`null becomes the empty string`},{icon:``,normalized:``,rule:`the empty string stays empty`},{icon:`go-symbolic-next`,normalized:`go-symbolic-next`,rule:"the match is END-anchored — a mid-name `-symbolic` survives"},{icon:`go-next-symbolic-symbolic`,normalized:`go-next-symbolic`,rule:`exactly ONE suffix is stripped, not repeated`},{icon:`symbolic`,normalized:`symbolic`,rule:`the separating hyphen is part of the suffix`},{icon:`a b`,normalized:``,rule:`a SPACE is two class tokens — the second one used to be injected`},{icon:`go-next-symbolic evil`,normalized:``,rule:"the strip runs first and does not rescue it — `-symbolic` is not the end of the string"},{icon:`go_next`,normalized:`go_next`,rule:`an underscore is a legal identifier character`},{icon:`GoNext2`,normalized:`GoNext2`,rule:`case and digits are legal`},{icon:`org.gnome.Builder`,normalized:``,rule:`a reverse-DNS application icon is not one token — it never had a mask class either`},{icon:`icon"onload=x`,normalized:``,rule:`a quote cannot reach an attribute value`},{icon:` go-next `,normalized:``,rule:`surrounding whitespace is not trimmed away, it is rejected`}];export{i as VIEW_STACK_ICON_NAME_VECTORS,r as VIEW_STACK_PAGE_VECTORS,n as VIEW_STACK_VECTORS};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";const e=[{label:`_Files`,stripped:`Files`,rule:`a single accel marker is removed`},{label:`Fi__les`,stripped:`Fi_les`,rule:`a DOUBLED marker collapses to one literal underscore`},{label:`R&D`,stripped:`R&D`,rule:`escape → parse is entity-neutral, so an ampersand survives`},{label:`Ü_bersicht`,stripped:`Übersicht`,rule:`non-ASCII is untouched; only the marker goes`},{label:``,stripped:``,rule:`empty in, empty out`},{label:`a_b_c`,stripped:`abc`,rule:`every lone marker is removed, not just the first`},{label:`Files_`,stripped:`Files`,rule:`a trailing lone marker marks nothing and is dropped`},{label:`__`,stripped:`_`,rule:`a doubled marker with nothing after it is still one underscore`},{label:`No mnemonic`,stripped:`No mnemonic`,rule:`a title without markers is copied verbatim`}],t=[{iconName:null,resolved:`image-missing`,rule:`REGRESSION PIN — a NULL icon name falls back, it does not vanish`},{iconName:``,resolved:`image-missing`,rule:"REGRESSION PIN — `icon_name && *icon_name` fails on '' too"},{iconName:void 0,resolved:`image-missing`,rule:`an absent property reads as NULL`},{iconName:`go-home-symbolic`,resolved:`go-home-symbolic`,rule:`a real name passes through, suffix included`},{iconName:`image-missing`,resolved:`image-missing`,rule:`the fallback name is itself a valid name`}],n=[{visible:!0,title:`Home`,iconName:null,buttonVisible:!0,rule:`a title alone is enough`},{visible:!0,title:null,iconName:`go-home-symbolic`,buttonVisible:!0,rule:`an icon alone is enough`},{visible:!0,title:null,iconName:null,buttonVisible:!1,rule:`REGRESSION PIN — both NULL hides the button entirely; both ports rendered an empty clickable box`},{visible:!0,title:``,iconName:null,buttonVisible:!0,rule:"REGRESSION PIN — the test is `title != NULL`, and '' is NOT NULL, so an empty-title page keeps its button"},{visible:!0,title:null,iconName:``,buttonVisible:!0,rule:`an EMPTY icon name is not NULL either — the button stays, showing the image-missing fallback`},{visible:!1,title:`Home`,iconName:`go-home-symbolic`,buttonVisible:!1,rule:`page visibility gates everything else`},{visible:!1,title:null,iconName:null,buttonVisible:!1,rule:`hidden and empty is still hidden`}],r=[{badgeNumber:0,needsAttention:!1,badgeLabel:``,description:``,rule:`no badge, no attention, no text`},{badgeNumber:0,needsAttention:!0,badgeLabel:``,description:`Attention requested.`,rule:`the dot has no label but does have a description`},{badgeNumber:1,needsAttention:!1,badgeLabel:`1`,description:`Has a badge: 1.`,rule:`the smallest badge`},{badgeNumber:7,needsAttention:!1,badgeLabel:`7`,description:`Has a badge: 7.`,rule:`a plain count`},{badgeNumber:7,needsAttention:!0,badgeLabel:`7`,description:`Has a badge: 7. Attention requested.`,rule:`both clauses — the BADGE one comes first`},{badgeNumber:999,needsAttention:!1,badgeLabel:`999`,description:`Has a badge: 999.`,rule:`999 is not > 999, so it still prints`},{badgeNumber:1e3,needsAttention:!1,badgeLabel:`999+`,description:`Has a badge: more than 999.`,rule:`above the limit the count collapses`},{badgeNumber:1e3,needsAttention:!0,badgeLabel:`999+`,description:`Has a badge: more than 999. Attention requested.`,rule:`the overflow clause composes the same way`}],i=[{reveal:!0,pages:[{visible:!0},{visible:!0}],revealed:!0,rule:`two visible pages reveal it`},{reveal:!0,pages:[{visible:!0}],revealed:!1,rule:"REGRESSION PIN — `count > 1`, so a single page never reveals the bar"},{reveal:!0,pages:[],revealed:!1,rule:`an empty stack keeps the count at 0`},{reveal:!1,pages:[{visible:!0},{visible:!0},{visible:!0}],revealed:!1,rule:"with `reveal` FALSE the count loop never runs"},{reveal:!0,pages:[{visible:!0},{visible:!1},{visible:!1}],revealed:!1,rule:`only pages with visible==TRUE count, so 1 of 3 stays collapsed`},{reveal:!0,pages:[{visible:!1},{visible:!1},{visible:!0},{visible:!0}],revealed:!0,rule:`2 visible out of 4 is enough, wherever they sit`}],a=[{rule:`REGRESSION PIN — a fresh bar is NOT revealed (the NativeScript port started life visible)`,derivedFrom:`PROP_REVEAL defaults to FALSE, adw-view-switcher-bar.c:256-259 + the init call at :277`,steps:[],stepResults:[],states:[],changes:[]},{rule:"reveal + two visible pages shows the bar; dropping to one page hides it again while `reveal` stays true",derivedFrom:`update_bar_revealed re-run from set_reveal (:383) and from items-changed (:340-343)`,steps:[{kind:`pages`,pages:[{visible:!0},{visible:!0}]},{kind:`reveal`,value:!0},{kind:`pages`,pages:[{visible:!0}]}],stepResults:[!1,!0,!0],states:[{reveal:!1,revealed:!1},{reveal:!0,revealed:!0},{reveal:!0,revealed:!1}],changes:[{reveal:!0,revealed:!0},{reveal:!0,revealed:!1}]},{rule:`REGRESSION PIN — revealing a one-page stack does nothing until a second page appears`,derivedFrom:"update_bar_revealed, adw-view-switcher-bar.c:125 `gtk_action_bar_set_revealed (…, count > 1)`",steps:[{kind:`pages`,pages:[{visible:!0}]},{kind:`reveal`,value:!0},{kind:`pages`,pages:[{visible:!0},{visible:!0}]}],stepResults:[!1,!0,!0],states:[{reveal:!1,revealed:!1},{reveal:!0,revealed:!1},{reveal:!0,revealed:!0}],changes:[{reveal:!0,revealed:!0}]},{rule:"setting `reveal` to the value it already has is a silent no-op",derivedFrom:`adw_view_switcher_bar_set_reveal, adw-view-switcher-bar.c:379-380`,steps:[{kind:`pages`,pages:[{visible:!0},{visible:!0}]},{kind:`reveal`,value:!1}],stepResults:[!1,!1],states:[{reveal:!1,revealed:!1},{reveal:!1,revealed:!1}],changes:[]},{rule:"hiding pages under a revealed bar collapses it without touching `reveal`",derivedFrom:`update_bar_revealed counts adw_view_stack_page_get_visible only, :116-120`,steps:[{kind:`reveal`,value:!0},{kind:`pages`,pages:[{visible:!0},{visible:!0},{visible:!0}]},{kind:`pages`,pages:[{visible:!0},{visible:!1},{visible:!1}]}],stepResults:[!0,!0,!0],states:[{reveal:!0,revealed:!1},{reveal:!0,revealed:!0},{reveal:!0,revealed:!1}],changes:[{reveal:!0,revealed:!0},{reveal:!0,revealed:!1}]}],o=[{title:`_Files`,useUnderline:!0,displayMode:`labels`,tooltip:``,rule:`labels mode clears the tooltip`},{title:`_Files`,useUnderline:!0,displayMode:`both`,tooltip:``,rule:`both mode clears it too`},{title:`_Files`,useUnderline:!0,displayMode:`icons`,tooltip:`Files`,rule:`REGRESSION PIN — icons mode strips the mnemonic instead of showing the underscore`},{title:`_Files`,useUnderline:!1,displayMode:`icons`,tooltip:`_Files`,rule:`without use-underline the title is copied verbatim, underscore included`},{title:`R&D`,useUnderline:!1,displayMode:`icons`,tooltip:`R&D`,rule:`C stores the markup-escaped form because GTK tooltips are markup; the renderer-neutral value is plain text`},{title:null,useUnderline:!1,displayMode:`icons`,tooltip:``,rule:`a NULL title has no tooltip`},{title:``,useUnderline:!1,displayMode:`icons`,tooltip:``,rule:`an empty title has no tooltip either`}],s=[{rule:`REGRESSION PIN — a page with neither title nor icon keeps its slot but its button is HIDDEN, and a page with only an icon still gets one`,derivedFrom:`update_button, adw-view-switcher.c:178 + the icon fallback at adw-view-switcher-button.c:399-405`,pages:[{name:`a`,title:`Home`},{name:`b`},{name:`c`,iconName:`go-home-symbolic`}],selected:0,policy:`narrow`,buttons:[{pageIndex:0,name:`a`,label:`Home`,iconName:`image-missing`,visible:!0,selected:!0,orientation:`vertical`,badgeLabel:``,needsAttention:!1,description:``},{pageIndex:1,name:`b`,label:``,iconName:`image-missing`,visible:!1,selected:!1,orientation:`vertical`,badgeLabel:``,needsAttention:!1,description:``},{pageIndex:2,name:`c`,label:``,iconName:`go-home-symbolic`,visible:!0,selected:!1,orientation:`vertical`,badgeLabel:``,needsAttention:!1,description:``}]},{rule:`REGRESSION PIN — an EMPTY title keeps its button, and the wide policy lays every button out horizontally`,derivedFrom:"adw-view-switcher.c:178 (`title != NULL`) + the orientation ternary at :219-220, :534-537",pages:[{name:`a`,title:``},{name:`b`,title:`B`}],selected:1,policy:`wide`,buttons:[{pageIndex:0,name:`a`,label:``,iconName:`image-missing`,visible:!0,selected:!1,orientation:`horizontal`,badgeLabel:``,needsAttention:!1,description:``},{pageIndex:1,name:`b`,label:`B`,iconName:`image-missing`,visible:!0,selected:!0,orientation:`horizontal`,badgeLabel:``,needsAttention:!1,description:``}]},{rule:`a hidden page hides its button no matter what it carries`,derivedFrom:"adw-view-switcher.c:178 — the `visible &&` clause short-circuits",pages:[{name:`a`,title:`A`},{name:`b`,title:`B`,iconName:`go-next-symbolic`,visible:!1}],selected:0,policy:`narrow`,buttons:[{pageIndex:0,name:`a`,label:`A`,iconName:`image-missing`,visible:!0,selected:!0,orientation:`vertical`,badgeLabel:``,needsAttention:!1,description:``},{pageIndex:1,name:`b`,label:`B`,iconName:`go-next-symbolic`,visible:!1,selected:!1,orientation:`vertical`,badgeLabel:``,needsAttention:!1,description:``}]},{rule:`badges and needs-attention reach the button, with the description AdwIndicatorBin derives`,derivedFrom:`update_button binds both onto the button (adw-view-switcher.c:161-176) → adw-indicator-bin.c:58-113`,pages:[{name:`a`,title:`Inbox`,badgeNumber:7},{name:`b`,title:`Spam`,badgeNumber:1e3,needsAttention:!0},{name:`c`,title:`Sent`,needsAttention:!0}],selected:0,policy:`wide`,buttons:[{pageIndex:0,name:`a`,label:`Inbox`,iconName:`image-missing`,visible:!0,selected:!0,orientation:`horizontal`,badgeLabel:`7`,needsAttention:!1,description:`Has a badge: 7.`},{pageIndex:1,name:`b`,label:`Spam`,iconName:`image-missing`,visible:!0,selected:!1,orientation:`horizontal`,badgeLabel:`999+`,needsAttention:!0,description:`Has a badge: more than 999. Attention requested.`},{pageIndex:2,name:`c`,label:`Sent`,iconName:`image-missing`,visible:!0,selected:!1,orientation:`horizontal`,badgeLabel:``,needsAttention:!0,description:`Attention requested.`}]},{rule:`REGRESSION PIN — use-underline decides whether the accel marker is part of the painted label`,derivedFrom:`update_button binds title + use-underline onto the button, whose template label carries use-underline (adw-view-switcher-button.ui)`,pages:[{name:`a`,title:`_Files`,useUnderline:!0},{name:`b`,title:`_Files`}],selected:0,policy:`narrow`,buttons:[{pageIndex:0,name:`a`,label:`Files`,iconName:`image-missing`,visible:!0,selected:!0,orientation:`vertical`,badgeLabel:``,needsAttention:!1,description:``},{pageIndex:1,name:`b`,label:`_Files`,iconName:`image-missing`,visible:!0,selected:!1,orientation:`vertical`,badgeLabel:``,needsAttention:!1,description:``}]},{rule:`with nothing selected no button is marked selected — -1 is a real state, not "page 0"`,derivedFrom:`add_child reads gtk_selection_model_is_selected per page (adw-view-switcher.c:209-217)`,pages:[{name:`a`,title:`A`}],selected:-1,policy:`narrow`,buttons:[{pageIndex:0,name:`a`,label:`A`,iconName:`image-missing`,visible:!0,selected:!1,orientation:`vertical`,badgeLabel:``,needsAttention:!1,description:``}]}],c=[{rule:`REGRESSION PIN — a hidden page produces NO toggle, so toggleIndex and pageIndex diverge`,derivedFrom:`populate_group + add_toggle, adw-inline-view-switcher.c:370-378, :346`,pages:[{name:`a`,title:`A`},{name:`b`,title:`B`,visible:!1},{name:`c`,title:`C`},{name:`d`,title:`D`}],displayMode:`labels`,toggles:[{toggleIndex:0,pageIndex:0,name:`a`,label:`A`,iconName:`image-missing`,showIcon:!1,showLabel:!0,tooltip:``,badgeLabel:``,needsAttention:!1,description:``},{toggleIndex:1,pageIndex:2,name:`c`,label:`C`,iconName:`image-missing`,showIcon:!1,showLabel:!0,tooltip:``,badgeLabel:``,needsAttention:!1,description:``},{toggleIndex:2,pageIndex:3,name:`d`,label:`D`,iconName:`image-missing`,showIcon:!1,showLabel:!0,tooltip:``,badgeLabel:``,needsAttention:!1,description:``}],toggleIndexByPage:[0,-1,1,2],pageIndexByToggle:[0,2,3]},{rule:`icons mode builds no label and DOES set a mnemonic-stripped tooltip`,derivedFrom:`update_toggle ICONS branch (adw-inline-view-switcher.c:270-288) + update_tooltip (:163-192)`,pages:[{name:`a`,title:`_Files`,useUnderline:!0,iconName:`folder-symbolic`},{name:`b`,title:`R&D`}],displayMode:`icons`,toggles:[{toggleIndex:0,pageIndex:0,name:`a`,label:`Files`,iconName:`folder-symbolic`,showIcon:!0,showLabel:!1,tooltip:`Files`,badgeLabel:``,needsAttention:!1,description:``},{toggleIndex:1,pageIndex:1,name:`b`,label:`R&D`,iconName:`image-missing`,showIcon:!0,showLabel:!1,tooltip:`R&D`,badgeLabel:``,needsAttention:!1,description:``}],toggleIndexByPage:[0,1],pageIndexByToggle:[0,1]},{rule:`both mode builds icon AND label, and clears the tooltip`,derivedFrom:`update_toggle BOTH branch, adw-inline-view-switcher.c:289-319 (adw_toggle_set_tooltip "" at :310)`,pages:[{name:`a`,title:`A`,iconName:`go-home-symbolic`,badgeNumber:3,needsAttention:!0}],displayMode:`both`,toggles:[{toggleIndex:0,pageIndex:0,name:`a`,label:`A`,iconName:`go-home-symbolic`,showIcon:!0,showLabel:!0,tooltip:``,badgeLabel:`3`,needsAttention:!0,description:`Has a badge: 3. Attention requested.`}],toggleIndexByPage:[0],pageIndexByToggle:[0]},{rule:`with every page hidden there are no toggles at all and nothing maps`,derivedFrom:`populate_group leaves the group empty and calls set_active(GTK_INVALID_LIST_POSITION), :370-390`,pages:[{name:`a`,title:`A`,visible:!1},{name:`b`,title:`B`,visible:!1}],displayMode:`labels`,toggles:[],toggleIndexByPage:[-1,-1],pageIndexByToggle:[]},{rule:`the title-or-icon rule does NOT apply here — a page with neither still gets a toggle`,derivedFrom:`populate_group gates on adw_view_stack_page_get_visible alone (:374); the title/icon predicate lives only in AdwViewSwitcher.update_button`,pages:[{name:`a`},{name:`b`,title:`B`}],displayMode:`labels`,toggles:[{toggleIndex:0,pageIndex:0,name:`a`,label:``,iconName:`image-missing`,showIcon:!1,showLabel:!0,tooltip:``,badgeLabel:``,needsAttention:!1,description:``},{toggleIndex:1,pageIndex:1,name:`b`,label:`B`,iconName:`image-missing`,showIcon:!1,showLabel:!0,tooltip:``,badgeLabel:``,needsAttention:!1,description:``}],toggleIndexByPage:[0,1],pageIndexByToggle:[0,1]}],l=[{rule:`the first page is selected automatically, and that auto-pick NOTIFIES`,derivedFrom:`add_page, adw-view-stack.c:1149-1151 → the notify at :1038-1039`,pages:[{name:`a`,title:`A`},{name:`b`,title:`B`},{name:`c`,title:`C`}],setupChanges:[{selected:0,name:`a`,title:`A`,interactive:!1}],ops:[],opResults:[],changes:[],selected:0,selectedName:`a`,selectedTitle:`A`},{rule:`activating another tab selects its page and reports the activation as interactive`,derivedFrom:`on_button_toggled → gtk_selection_model_select_item, adw-view-switcher.c:134-139`,pages:[{name:`a`,title:`A`},{name:`b`,title:`B`},{name:`c`,title:`C`}],setupChanges:[{selected:0,name:`a`,title:`A`,interactive:!1}],ops:[{kind:`selectIndex`,index:2}],opResults:[!0],changes:[{selected:2,name:`c`,title:`C`,interactive:!0}],selected:2,selectedName:`c`,selectedTitle:`C`},{rule:`activating the ALREADY-active tab is a net no-op`,derivedFrom:`on_button_toggled, adw-view-switcher.c:140-146 — deactivating the active toggle re-reads the model and restores the button`,pages:[{name:`a`,title:`A`},{name:`b`,title:`B`},{name:`c`,title:`C`}],setupChanges:[{selected:0,name:`a`,title:`A`,interactive:!1}],ops:[{kind:`selectIndex`,index:0}],opResults:[!1],changes:[],selected:0,selectedName:`a`,selectedTitle:`A`},{rule:`REGRESSION PIN — an index past the end is REFUSED, not clamped to the last page (the browser switcher clamped)`,derivedFrom:`adw_view_stack_pages_select_item, adw-view-stack.c:682-684 — returns FALSE, no clamp anywhere`,pages:[{name:`a`,title:`A`},{name:`b`,title:`B`},{name:`c`,title:`C`}],setupChanges:[{selected:0,name:`a`,title:`A`,interactive:!1}],ops:[{kind:`selectIndex`,index:5}],opResults:[!1],changes:[],selected:0,selectedName:`a`,selectedTitle:`A`},{rule:`REGRESSION PIN — a negative index is REFUSED, not clamped to the first page (the browser switcher clamped)`,derivedFrom:`positions are guint, so -1 wraps to G_MAXUINT and fails the bound check at adw-view-stack.c:682`,pages:[{name:`a`,title:`A`},{name:`b`,title:`B`},{name:`c`,title:`C`}],setupChanges:[{selected:0,name:`a`,title:`A`,interactive:!1}],ops:[{kind:`selectIndex`,index:1},{kind:`selectIndex`,index:-1}],opResults:[!0,!1],changes:[{selected:1,name:`b`,title:`B`,interactive:!0}],selected:1,selectedName:`b`,selectedTitle:`B`},{rule:`REGRESSION PIN — a fractional index is refused; both ports stored it and then matched no page, blanking the widget`,derivedFrom:`adw_view_stack_pages_select_item takes a guint position, adw-view-stack.c:675-683`,pages:[{name:`a`,title:`A`},{name:`b`,title:`B`},{name:`c`,title:`C`}],setupChanges:[{selected:0,name:`a`,title:`A`,interactive:!1}],ops:[{kind:`selectIndex`,index:1.5},{kind:`selectIndex`,index:NaN}],opResults:[!1,!1],changes:[],selected:0,selectedName:`a`,selectedTitle:`A`},{rule:`selecting by name works and an unknown name changes nothing`,derivedFrom:`adw_view_stack_set_visible_child_name, adw-view-stack.c:2404-2415 (g_warning at :2410)`,pages:[{name:`a`,title:`A`},{name:`b`,title:`B`},{name:`c`,title:`C`}],setupChanges:[{selected:0,name:`a`,title:`A`,interactive:!1}],ops:[{kind:`selectName`,name:`c`},{kind:`selectName`,name:`missing`}],opResults:[!0,!1],changes:[{selected:2,name:`c`,title:`C`,interactive:!0}],selected:2,selectedName:`c`,selectedTitle:`C`,diagnostics:[`Child name 'missing' not found in AdwViewStack`]},{rule:`the first VISIBLE page is auto-selected, not the first declared`,derivedFrom:`add_page's visibility gate, adw-view-stack.c:1149-1151`,pages:[{name:`a`,title:`A`,visible:!1},{name:`b`,title:`B`}],setupChanges:[{selected:1,name:`b`,title:`B`,interactive:!1}],ops:[],opResults:[],changes:[],selected:1,selectedName:`b`,selectedTitle:`B`},{rule:`hiding the selected page falls back to the first still-visible one, as an auto-pick`,derivedFrom:`update_child_visible → set_visible_child(NULL) scan, adw-view-stack.c:1071-1072, :961-974`,pages:[{name:`a`,title:`A`},{name:`b`,title:`B`}],setupChanges:[{selected:0,name:`a`,title:`A`,interactive:!1}],ops:[{kind:`setPageVisible`,name:`a`,visible:!1}],opResults:[!0],changes:[{selected:1,name:`b`,title:`B`,interactive:!1}],selected:1,selectedName:`b`,selectedTitle:`B`},{rule:`a hidden page cannot be selected — the switcher may still show its (hidden) slot, but the selection refuses`,derivedFrom:`adw_view_stack_set_visible_child_name, adw-view-stack.c:2415`,pages:[{name:`a`,title:`A`},{name:`b`,title:`B`,visible:!1}],setupChanges:[{selected:0,name:`a`,title:`A`,interactive:!1}],ops:[{kind:`selectIndex`,index:1}],opResults:[!1],changes:[],selected:0,selectedName:`a`,selectedTitle:`A`},{rule:`with every page hidden nothing is selected and nothing is emitted`,derivedFrom:`the set_visible_child NULL scan finds nothing, adw-view-stack.c:961-977`,pages:[{name:`a`,title:`A`,visible:!1},{name:`b`,title:`B`,visible:!1}],setupChanges:[],ops:[],opResults:[],changes:[],selected:-1,selectedName:``,selectedTitle:``},{rule:`the reported title is the PAINTED label, so a mnemonic title reports its stripped form`,derivedFrom:`the button label carries use-underline (adw-view-switcher-button.ui) → adw_strip_mnemonic semantics`,pages:[{name:`a`,title:`_Files`,useUnderline:!0},{name:`b`,title:`B`}],setupChanges:[{selected:0,name:`a`,title:`Files`,interactive:!1}],ops:[],opResults:[],changes:[],selected:0,selectedName:`a`,selectedTitle:`Files`}],u=[{rule:`the selection follows the PAGE across an insert before it, so its index shifts`,derivedFrom:`adw_view_stack_pages_is_selected compares page identity, adw-view-stack.c:660-672`,pages:[{name:`a`,title:`A`},{name:`b`,title:`B`},{name:`c`,title:`C`}],select:`b`,nextPages:[{name:`x`,title:`X`},{name:`a`,title:`A`},{name:`b`,title:`B`},{name:`c`,title:`C`}],changes:[{selected:2,name:`b`,title:`B`,interactive:!1}],selected:2,selectedName:`b`},{rule:`a rebuild that DROPS the selected page falls back to the first visible one`,derivedFrom:`items_changed_cb → clear + populate (adw-view-switcher.c:258-263) over the auto-pick at adw-view-stack.c:1149-1151`,pages:[{name:`a`,title:`A`},{name:`b`,title:`B`},{name:`c`,title:`C`}],select:`b`,nextPages:[{name:`a`,title:`A`},{name:`c`,title:`C`}],changes:[{selected:0,name:`a`,title:`A`,interactive:!1}],selected:0,selectedName:`a`},{rule:`a rebuild that leaves the selected page where it was emits nothing`,derivedFrom:`set_visible_child idempotence guard, adw-view-stack.c:976-977`,pages:[{name:`a`,title:`A`},{name:`b`,title:`B`},{name:`c`,title:`C`}],select:`b`,nextPages:[{name:`a`,title:`A`},{name:`b`,title:`B`},{name:`c`,title:`C`}],changes:[],selected:1,selectedName:`b`},{rule:`a page that survives the rebuild but is now HIDDEN loses the selection to the auto-pick`,derivedFrom:`the restore goes through select_item, which refuses a hidden page (adw-view-stack.c:2415)`,pages:[{name:`a`,title:`A`},{name:`b`,title:`B`}],select:`b`,nextPages:[{name:`a`,title:`A`},{name:`b`,title:`B`,visible:!1}],changes:[{selected:0,name:`a`,title:`A`,interactive:!1}],selected:0,selectedName:`a`},{rule:`rebuilding to an empty list selects nothing and says so`,derivedFrom:`select_item bound check with children->len == 0, adw-view-stack.c:682-683`,pages:[{name:`a`,title:`A`}],nextPages:[],changes:[{selected:-1,name:``,title:``,interactive:!1}],selected:-1,selectedName:``}],d=[{rule:`499 ms of dwell is not enough`,derivedFrom:`TIMEOUT_EXPAND 500 with g_timeout_add_once, adw-view-switcher-button.c:14, :85-89`,pages:[{name:`a`,title:`A`},{name:`b`,title:`B`},{name:`c`,title:`C`}],initial:0,steps:[{kind:`enter`,index:2},{kind:`advance`,ms:499}],changes:[],selected:0},{rule:`500 ms of dwell switches to the hovered page, exactly as a click would`,derivedFrom:`switch_timeout_cb, adw-view-switcher-button.c:58-63; the inline twin at adw-inline-view-switcher.c:194-204`,pages:[{name:`a`,title:`A`},{name:`b`,title:`B`},{name:`c`,title:`C`}],initial:0,steps:[{kind:`enter`,index:2},{kind:`advance`,ms:500}],changes:[{selected:2,name:`c`,title:`C`,interactive:!0}],selected:2},{rule:`hovering the ALREADY-active tab arms nothing at all`,derivedFrom:`drag_enter_cb early-returns on an active button, adw-view-switcher-button.c:82-83 (:219 inline)`,pages:[{name:`a`,title:`A`},{name:`b`,title:`B`},{name:`c`,title:`C`}],initial:0,steps:[{kind:`enter`,index:0},{kind:`advance`,ms:1e3}],changes:[],selected:0},{rule:`leaving before the dwell elapses cancels the pending switch`,derivedFrom:`drag_leave_cb removes the source, adw-view-switcher-button.c:93-96; adw-inline-view-switcher.c:228-236`,pages:[{name:`a`,title:`A`},{name:`b`,title:`B`},{name:`c`,title:`C`}],initial:0,steps:[{kind:`enter`,index:2},{kind:`leave`,index:2},{kind:`advance`,ms:1e3}],changes:[],selected:0},{rule:`each button owns its OWN timer — leaving one does not disarm another`,derivedFrom:'the timer is stored per widget: `self->switch_timer` (adw-view-switcher-button.c:50) and the per-toggle "switch-timer" data (adw-inline-view-switcher.c:223-224)',pages:[{name:`a`,title:`A`},{name:`b`,title:`B`},{name:`c`,title:`C`}],initial:0,steps:[{kind:`enter`,index:1},{kind:`enter`,index:2},{kind:`leave`,index:1},{kind:`advance`,ms:500}],changes:[{selected:2,name:`c`,title:`C`,interactive:!0}],selected:2},{rule:`a dwell over a HIDDEN page fires but selects nothing — the selection guard still applies`,derivedFrom:`switch_timeout_cb activates the toggle, whose select_item is refused for a hidden page (adw-view-stack.c:2415)`,pages:[{name:`a`,title:`A`},{name:`b`,title:`B`,visible:!1}],initial:0,steps:[{kind:`enter`,index:1},{kind:`advance`,ms:500}],changes:[],selected:0}];function createViewSwitcherClock(){let e=0,t=1,n=new Map;return{schedule(r,i){let a=t++;return n.set(a,{at:e+i,callback:r}),a},cancel(e){typeof e==`number`&&n.delete(e)},advance(t){e+=t;let r=[...n.entries()].filter(([,t])=>t.at<=e).sort(([e,t],[n,r])=>t.at-r.at||e-n);for(let[e,t]of r)n.has(e)&&(n.delete(e),t.callback())},get pending(){return n.size}}}export{c as INLINE_TOGGLE_VECTORS,o as INLINE_TOOLTIP_VECTORS,r as VIEW_SWITCHER_BADGE_VECTORS,i as VIEW_SWITCHER_BAR_REVEAL_VECTORS,a as VIEW_SWITCHER_BAR_VECTORS,s as VIEW_SWITCHER_BUTTON_VECTORS,n as VIEW_SWITCHER_BUTTON_VISIBILITY_VECTORS,d as VIEW_SWITCHER_DRAG_VECTORS,t as VIEW_SWITCHER_ICON_VECTORS,e as VIEW_SWITCHER_MNEMONIC_VECTORS,u as VIEW_SWITCHER_REBUILD_VECTORS,l as VIEW_SWITCHER_SELECTION_VECTORS,createViewSwitcherClock};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=[{justify:`none`,justifyLastLine:!1,align:0,lastLine:!1,childrenInLine:3,layout:{justify:`none`,growChildren:!1,growGaps:!1,align:0},rule:`the defaults: nothing grows, the line packs at the start of the main axis`},{justify:`none`,justifyLastLine:!1,align:.5,lastLine:!1,childrenInLine:3,layout:{justify:`none`,growChildren:!1,growGaps:!1,align:.5},rule:`align 0.5 offsets the line block by half the leftover — MAIN axis, not cross`},{justify:`none`,justifyLastLine:!1,align:1,lastLine:!0,childrenInLine:3,layout:{justify:`none`,growChildren:!1,growGaps:!1,align:1},rule:`align 1 packs the line at the END of the main axis (:717-725)`},{justify:`none`,justifyLastLine:!0,align:.25,lastLine:!0,childrenInLine:3,layout:{justify:`none`,growChildren:!1,growGaps:!1,align:.25},rule:`justify-last-line is inert while justify is none — there is nothing to justify`},{justify:`fill`,justifyLastLine:!1,align:0,lastLine:!1,childrenInLine:3,layout:{justify:`fill`,growChildren:!0,growGaps:!1,align:0},rule:`FILL grows every child and keeps spacing constant (:317-319, :326-341)`},{justify:`fill`,justifyLastLine:!1,align:1,lastLine:!1,childrenInLine:3,layout:{justify:`fill`,growChildren:!0,growGaps:!1,align:0},rule:`a justified line consumes the leftover, so align is reported as 0 (:716-725 is gated)`},{justify:`fill`,justifyLastLine:!1,align:.5,lastLine:!0,childrenInLine:3,layout:{justify:`none`,growChildren:!1,growGaps:!1,align:.5},rule:`the final line falls back to NONE and to align (:397-400) — the C default`},{justify:`fill`,justifyLastLine:!0,align:.5,lastLine:!0,childrenInLine:3,layout:{justify:`fill`,growChildren:!0,growGaps:!1,align:0},rule:`justify-last-line lifts the gate, so the final line fills like any other`},{justify:`fill`,justifyLastLine:!0,align:0,lastLine:!0,childrenInLine:1,layout:{justify:`fill`,growChildren:!0,growGaps:!1,align:0},rule:`FILL has no single-child special case — one child simply takes the line`},{justify:`spread`,justifyLastLine:!1,align:0,lastLine:!1,childrenInLine:3,layout:{justify:`spread`,growChildren:!1,growGaps:!0,align:0},rule:`SPREAD keeps allocated_size at minimum_size and widens the gaps (:338-339)`},{justify:`spread`,justifyLastLine:!1,align:0,lastLine:!1,childrenInLine:2,layout:{justify:`spread`,growChildren:!1,growGaps:!0,align:0},rule:`two children still spread — the guard is n_children > 1`},{justify:`spread`,justifyLastLine:!1,align:0,lastLine:!1,childrenInLine:1,layout:{justify:`spread`,growChildren:!0,growGaps:!1,align:0},rule:`a LONE child in a spread line is stretched instead (:338, adw-wrap-box.c:349-352)`},{justify:`spread`,justifyLastLine:!1,align:0,lastLine:!0,childrenInLine:3,layout:{justify:`none`,growChildren:!1,growGaps:!1,align:0},rule:`DEFAULT single-line wrap box: its only line is the last, so spread does nothing`},{justify:`spread`,justifyLastLine:!1,align:1,lastLine:!0,childrenInLine:3,layout:{justify:`none`,growChildren:!1,growGaps:!1,align:1},rule:`the un-justified final line honours align, which is why the two interact`},{justify:`spread`,justifyLastLine:!0,align:1,lastLine:!0,childrenInLine:3,layout:{justify:`spread`,growChildren:!1,growGaps:!0,align:0},rule:`justify-last-line spreads the final line and drops align on the floor`},{justify:`spread`,justifyLastLine:!0,align:0,lastLine:!0,childrenInLine:1,layout:{justify:`spread`,growChildren:!0,growGaps:!1,align:0},rule:`the lone-child stretch survives the last-line gate being lifted`}],t=[{value:0,spacing:0,rule:`the default is 0 — no spacing at all, on every renderer`},{value:6,spacing:6,rule:`a plain positive value passes through`},{value:-1,spacing:0,rule:`a negative value is clamped to 0 (adw-wrap-box.c:587-588)`},{value:-12,spacing:0,rule:`the clamp is a floor, not an absolute value`},{value:`12`,spacing:12,rule:`a numeric string parses (HTML attribute / XML layout)`},{value:`-4`,spacing:0,rule:`a negative numeric string is clamped, not propagated`},{value:``,spacing:0,rule:`an empty value is the default, not NaN`},{value:null,spacing:0,rule:`an absent property is the default`},{value:`abc`,spacing:0,rule:`a non-numeric value is 0 — NaN must never reach a layout`},{value:NaN,spacing:0,rule:`NaN has no int counterpart in C; the ports agree on 0`},{value:1/0,spacing:0,rule:`infinity is not an int either`}],n=[{from:0,value:6,notifies:!0,rule:`a real change notifies`},{from:6,value:6,notifies:!1,rule:`setting the same value is an early return (:592-593)`},{from:0,value:-5,notifies:!1,rule:`clamped to the value already held — no notification`},{from:6,value:-5,notifies:!0,rule:`clamped to 0, which IS a change from 6`},{from:0,value:`abc`,notifies:!1,rule:`garbage normalises to the value already held`},{from:6,value:``,notifies:!0,rule:`clearing the property falls back to the default 0`}],r=[`child-spacing`,`child-spacing-unit`,`pack-direction`,`align`,`justify`,`justify-last-line`,`line-spacing`,`line-spacing-unit`,`line-homogeneous`,`natural-line-length`,`natural-line-length-unit`,`wrap-reverse`,`wrap-policy`,`orientation`],i=[{value:null,policy:`natural`,flexShrink:0,rule:`the default is natural — wrap before shrinking`},{value:`natural`,policy:`natural`,flexShrink:0,rule:`natural forbids the shrink CSS would otherwise allow by default`},{value:`minimum`,policy:`minimum`,flexShrink:1,rule:`minimum squeezes children before wrapping`},{value:`Minimum`,policy:`natural`,flexShrink:0,rule:`the enum gate is case-sensitive, as GObject is`},{value:`shrink`,policy:`natural`,flexShrink:0,rule:`an unknown value leaves the property at its default`}],a=[{value:12,unit:`px`,dpi:96,px:12,rule:`px is a passthrough at any dpi`},{value:12,unit:`px`,dpi:144,px:12,rule:`and stays one when the text scale changes — that is the point of px`},{value:12,unit:`sp`,dpi:96,px:12,rule:`sp is a passthrough at the default dpi`},{value:12,unit:`sp`,dpi:144,px:18,rule:`sp scales with gtk-xft-dpi — 12 * 144 / 96`},{value:12,unit:`pt`,dpi:96,px:16,rule:`pt is the familiar 4/3 ratio at 96 dpi`},{value:0,unit:`pt`,dpi:144,px:0,rule:`zero converts to zero in every unit`},{value:12,unit:`em`,dpi:96,px:12,rule:`an unknown unit falls back to the wrap box default, px`},{value:12,unit:null,dpi:96,px:12,rule:`an absent unit is the default too`},{value:-1,unit:`sp`,dpi:144,px:-1,rule:`the natural-line-length sentinel is NOT converted (adw-wrap-layout.c:562 gates on >= 0)`}],o=[{value:null,length:-1,rule:`absent means unset — the box asks for what its children need`},{value:-1,length:-1,rule:`the sentinel itself`},{value:0,length:0,rule:`zero is IN range and is not the sentinel — a box that asks for nothing`},{value:400,length:400,rule:`a plain length passes through`},{value:`400`,length:400,rule:`a numeric string parses (HTML attribute / XML layout)`},{value:400.7,length:400,rule:`the property is an int, so a fraction truncates`},{value:-5,length:-1,rule:`below the declared minimum lands on unset, not on 0`},{value:`wide`,length:-1,rule:`a non-numeric value is unset — NaN must never reach a layout`}],s=[{op:`insert-after`,children:[`a`,`b`,`c`],child:`d`,sibling:`b`,result:[`a`,`b`,`d`,`c`],rule:`insert after a middle sibling`},{op:`insert-after`,children:[`a`,`b`],child:`d`,sibling:`b`,result:[`a`,`b`,`d`],rule:`after the last sibling is an append`},{op:`insert-after`,children:[`a`,`b`],child:`d`,sibling:null,result:[`d`,`a`,`b`],rule:`a NULL sibling PREPENDS — gtk_widget_insert_after inserts at the first position`},{op:`insert-after`,children:[],child:`d`,sibling:null,result:[`d`],rule:`into an empty box, where first and last coincide`},{op:`insert-after`,children:[`a`,`b`],child:`a`,sibling:`b`,result:null,rule:`refused: the child already has a parent (:1289)`},{op:`insert-after`,children:[`a`],child:`d`,sibling:`z`,result:null,rule:`refused: the sibling is not a child of this box (:1293)`},{op:`reorder-after`,children:[`a`,`b`,`c`],child:`a`,sibling:`c`,result:[`b`,`c`,`a`],rule:`moving forward removes first, so the target index is read AFTER the removal`},{op:`reorder-after`,children:[`a`,`b`,`c`],child:`c`,sibling:`a`,result:[`a`,`c`,`b`],rule:`and moving backward lands directly behind the sibling`},{op:`reorder-after`,children:[`a`,`b`,`c`],child:`c`,sibling:null,result:[`c`,`a`,`b`],rule:`a NULL sibling moves the child to the FRONT — the same rule as insert`},{op:`reorder-after`,children:[`a`,`b`],child:`a`,sibling:`a`,result:null,rule:`refused: child == sibling is an explicit early return (:1329)`},{op:`reorder-after`,children:[`a`,`b`],child:`z`,sibling:`a`,result:null,rule:`refused: reordering something that is not a child`},{op:`reorder-after`,children:[`a`,`b`,`c`],child:`b`,sibling:`b`,result:null,rule:`the self-check runs before the membership one, so it refuses rather than no-ops`}];export{s as WRAP_BOX_CHILD_ORDER_VECTORS,a as WRAP_BOX_LENGTH_VECTORS,e as WRAP_BOX_LINE_VECTORS,o as WRAP_BOX_NATURAL_LENGTH_VECTORS,r as WRAP_BOX_NOTIFY_PROPERTIES,i as WRAP_BOX_POLICY_VECTORS,n as WRAP_BOX_SPACING_NOTIFY_VECTORS,t as WRAP_BOX_SPACING_VECTORS};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";const e=[`normal`,`section`,`subtotal`,`total`],t=`adw-data-grid-cell`,n=`adw-data-grid-row`,r=new Set(e);function dataGridTracks(e){let t=e.some(e=>e.width!==void 0||e.flex!==void 0);return e.map((e,n)=>e.width===void 0?e.flex===void 0?!t&&n===0?{kind:`slack`}:{kind:`auto`}:{kind:`flex`,weight:e.flex}:{kind:`fixed`,css:e.width})}function dataGridTrackTemplate(e){return e.map(e=>{switch(e.kind){case`fixed`:return e.css;case`flex`:return`${e.weight}fr`;case`slack`:return`minmax(0px, 1fr)`;case`auto`:return`auto`}}).join(` `)}function dataGridColumnAlign(e){return e.align??(e.numeric?`end`:`start`)}function dataGridColumnClasses(e){let n=[t,`align-${dataGridColumnAlign(e)}`];return e.numeric&&n.push(`numeric`),e.monospace&&n.push(`mono`),n}function dataGridCellText(e){return e==null?``:String(e)}function normalizeDataGridVariant(e){return typeof e==`string`&&r.has(e)?e:`normal`}function normalizeDataGridColumns(e){return Array.isArray(e)?e.filter(e=>typeof e==`object`&&!!e&&`key`in e).map(e=>({key:String(e.key),label:e.label===void 0?void 0:String(e.label),align:e.align,width:e.width===void 0?void 0:String(e.width),flex:typeof e.flex==`number`?e.flex:void 0,monospace:e.monospace===!0,numeric:e.numeric===!0})):[]}function dataGridRowInteractive(e,t,n){return e===`normal`&&t!==!1&&(t===!0||n)}export{e as ADW_DATA_GRID_ROW_VARIANTS,t as DATA_GRID_CELL_CLASS,n as DATA_GRID_ROW_CLASS,dataGridCellText,dataGridColumnAlign,dataGridColumnClasses,dataGridRowInteractive,dataGridTrackTemplate,dataGridTracks,normalizeDataGridColumns,normalizeDataGridVariant};
|
package/lib/esm/dialog.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./_virtual/_rolldown/runtime.js";var AdwAlertResponses=class{constructor(e=``,t=``){this._responses=[],this._defaultResponse=null,this._closeResponse=`close`,this._heading=e??``,this._body=t??``}get heading(){return this._heading}set heading(e){this._heading=e??``}get body(){return this._body}set body(e){this._body=e??``}addResponse(e,t,n={}){let r=this._responses.find(t=>t.id===e);if(r){r.label=t,n.appearance!==void 0&&(r.appearance=n.appearance),n.enabled!==void 0&&(r.enabled=n.enabled);return}this._responses.push({id:e,label:t,appearance:n.appearance??`default`,enabled:n.enabled??!0})}addResponses(...e){for(let t=0;t+1<e.length;t+=2)this.addResponse(e[t],e[t+1])}hasResponse(e){return this._responses.some(t=>t.id===e)}setResponseAppearance(e,t){let n=this._responses.find(t=>t.id===e);n&&(n.appearance=t)}getResponseAppearance(e){return this._responses.find(t=>t.id===e)?.appearance??`default`}setResponseEnabled(e,t){let n=this._responses.find(t=>t.id===e);n&&(n.enabled=t)}getResponseEnabled(e){return this._responses.find(t=>t.id===e)?.enabled??!0}get responses(){return this._responses}get defaultResponse(){return this._defaultResponse}set defaultResponse(e){this._defaultResponse=e}get closeResponse(){return this._closeResponse}set closeResponse(e){this._closeResponse=e||`close`}get usesActionSheet(){return this._responses.length>3}orderResponses(){let e=this._responses.find(e=>e.id===this._defaultResponse)??this._responses[0],t=this._responses.filter(t=>t!==e);return{ok:e,cancel:t[t.length-1],neutral:t.length>=2?t[0]:void 0}}resolveById(e){return e!=null&&this.hasResponse(e)?e:this._closeResponse}resolveLabel(e){return e==null?this._closeResponse:this.resolveById(this._responses.find(t=>t.label===e)?.id)}};export{AdwAlertResponses};
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";var AdwAlertResponses=class{constructor(e=``,t=``){this._responses=[],this._defaultResponse=null,this._closeResponse=`close`,this._heading=e??``,this._body=t??``}get heading(){return this._heading}set heading(e){this._heading=e??``}get body(){return this._body}set body(e){this._body=e??``}addResponse(e,t,n={}){let r=this._responses.find(t=>t.id===e);if(r){r.label=t,n.appearance!==void 0&&(r.appearance=n.appearance),n.enabled!==void 0&&(r.enabled=n.enabled);return}this._responses.push({id:e,label:t,appearance:n.appearance??`default`,enabled:n.enabled??!0})}addResponses(...e){for(let t=0;t+1<e.length;t+=2)this.addResponse(e[t],e[t+1])}hasResponse(e){return this._responses.some(t=>t.id===e)}setResponseAppearance(e,t){let n=this._responses.find(t=>t.id===e);n&&(n.appearance=t)}getResponseAppearance(e){return this._responses.find(t=>t.id===e)?.appearance??`default`}setResponseEnabled(e,t){let n=this._responses.find(t=>t.id===e);n&&(n.enabled=t)}getResponseEnabled(e){return this._responses.find(t=>t.id===e)?.enabled??!0}get responses(){return this._responses}get defaultResponse(){return this._defaultResponse}set defaultResponse(e){this._defaultResponse=e}get closeResponse(){return this._closeResponse}set closeResponse(e){this._closeResponse=e||`close`}get usesActionSheet(){return this._responses.length>3}orderResponses(){let e=this._responses.find(e=>e.id===this._defaultResponse)??this._responses[0],t=this._responses.filter(t=>t!==e);return{ok:e,cancel:t[t.length-1],neutral:t.length>=2?t[0]:void 0}}resolveById(e){return e!=null&&this.hasResponse(e)?e:this._closeResponse}resolveLabel(e){return e==null?this._closeResponse:this.resolveById(this._responses.find(t=>t.label===e)?.id)}};function resolveBottomSheetClose(e,t){let n=!!t.open,r=!!t.canClose;switch(e){case`drag-handle`:return`ignored`;case`swipe`:return n&&r?`close`:`ignored`;case`dimming`:return n?r?`close`:`close-attempt`:`ignored`;case`close-button`:return r?n?`close`:`delegate`:`close-attempt`;case`escape`:return r&&n?`close`:`close-attempt`}}var BottomSheetPresentation=class{constructor(e={}){this._open=!1,this._canClose=!0,this._hasBeenOpen=!1,this._listeners=new Set,this._onClosing=e.onClosing,this._onClosed=e.onClosed}subscribe(e){return this._listeners.add(e),()=>{this._listeners.delete(e)}}_emit(){for(let e of[...this._listeners])e(this._open)}get open(){return this._open}get canClose(){return this._canClose}get hasBeenOpen(){return this._hasBeenOpen}setCanClose(e){let t=!!e;return t===this._canClose?!1:(this._canClose=t,!0)}setOpen(e){let t=!!e;return this._open===t?(!this._hasBeenOpen&&!t&&(this._onClosing?.(),this._onClosed?.()),!1):(this._open=t,t&&(this._hasBeenOpen=!0),!t&&(this._onClosing?.(),this._open!==t)?!1:(this._emit(),!0))}requestClose(e){let t=resolveBottomSheetClose(e,this);return t===`close`&&this.setOpen(!1),t}finishClose(){return this._open?!1:(this._onClosed?.(),!0)}};export{AdwAlertResponses,BottomSheetPresentation,resolveBottomSheetClose};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";function adwLerp(e,t,n){return e*(1-n)+t*n}function inverseLerp(e,t,n){return(n-e)/(t-e)}function easeOutCubic(e){let t=e-1;return t*t*t+1}function easeInOutSine(e){return-.5*(Math.cos(Math.PI*e)-1)}export{adwLerp,easeInOutSine,easeOutCubic,inverseLerp};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";const e=150,t=3,n=65535,r=`adw-entry-edit-symbolic`,i=`adw-entry-apply-symbolic`,a=`Apply`,o=`view-reveal-symbolic`,s=`view-conceal-symbolic`,c=`Show Password`,l=`Hide Password`,u=`caps-lock-symbolic`,d=`Caps Lock is on`;function entryTextLength(e){return[...e??``].length}function clampEntryText(e,t){let n=e??``;if(!Number.isFinite(t)||t<=0)return n;let r=``,i=0;for(let e of n){if(i>=t)break;r+=e,i++}return r}var EntryRowState=class{constructor(){this._text=``,this._maxLength=0,this._editing=!1,this._editable=!0,this._showApplyButton=!1,this._showIndicator=!1,this._textChanged=!1,this._activatesDefault=!1,this._listeners=new Set}subscribe(e){return this._listeners.add(e),()=>{this._listeners.delete(e)}}_update(){let e=this.state;for(let t of[...this._listeners])t(e)}get state(){let e=entryTextLength(this._text),t=e===0&&!(this._editing&&this._editable)&&!this._textChanged;return{text:this._text,textLength:e,empty:t,editing:this._editing,editable:this._editable,textChanged:this._textChanged,editIconVisible:!this._textChanged&&(!this._editing||!this._editable),editIconSensitive:this._editable,indicatorVisible:this._editing&&this._showIndicator,applyButtonVisible:this._textChanged,emptyTarget:+!t}}get text(){return this._text}setText(e){let t=clampEntryText(e??``,this._maxLength);return t===this._text?!1:(this._text=t,this._latchAndUpdate(),!0)}_latchAndUpdate(){this._showApplyButton&&this._editing&&(this._textChanged=!0),this._update()}get textLength(){return entryTextLength(this._text)}get maxLength(){return this._maxLength}setMaxLength(e){let t=Number.isFinite(e)?Math.min(n,Math.max(0,Math.trunc(e))):0;if(t===this._maxLength)return!1;this._maxLength=t;let r=clampEntryText(this._text,t);return r!==this._text&&(this._text=r,this._latchAndUpdate()),!0}get editing(){return this._editing}setEditing(e){let t=!!e;return t===this._editing?!1:(this._editing=t,this._update(),!0)}get editable(){return this._editable}setEditable(e){let t=!!e;return t===this._editable?!1:(this._editable=t,this._update(),!0)}get showApplyButton(){return this._showApplyButton}setShowApplyButton(e){let t=!!e;return t===this._showApplyButton?!1:(this._showApplyButton=t,!t&&this._textChanged&&(this._textChanged=!1,this._update()),!0)}setShowIndicator(e){this._showIndicator=!!e,this._update()}get activatesDefault(){return this._activatesDefault}setActivatesDefault(e){let t=!!e;return t===this._activatesDefault?!1:(this._activatesDefault=t,!0)}get textChanged(){return this._textChanged}apply(){this._textChanged=!1,this._update()}activate(){return this._textChanged?(this.apply(),{signal:`apply`}):{signal:`entry-activated`,activateDefault:this._activatesDefault}}},PasswordEntryRowState=class{constructor(e){this._revealed=!1,this._capsLockOn=!1,this._listeners=new Set,this._entry=e}subscribe(e){return this._listeners.add(e),()=>{this._listeners.delete(e)}}_emit(){let e=this.state;for(let t of[...this._listeners])t(e)}get state(){return{revealed:this._revealed,capsLockOn:this._capsLockOn,peekIconName:this._revealed?s:o,peekLabel:this._revealed?l:c,indicatorIconName:u,indicatorTooltip:d}}get revealed(){return this._revealed}setRevealed(e){let t=!!e;return t===this._revealed?!1:(this._revealed=t,this._pushIndicator(),this._emit(),!0)}togglePeek(){return this.setRevealed(!this._revealed)}get capsLockOn(){return this._capsLockOn}setCapsLockOn(e){let t=!!e;return t===this._capsLockOn?!1:(this._capsLockOn=t,this._pushIndicator(),this._emit(),!0)}_pushIndicator(){this._entry.setShowIndicator(!this._revealed&&this._capsLockOn)}};export{u as CAPS_LOCK_ICON_NAME,d as CAPS_LOCK_TOOLTIP,e as EMPTY_ANIMATION_DURATION_MS,i as ENTRY_ROW_APPLY_ICON_NAME,a as ENTRY_ROW_APPLY_TOOLTIP,r as ENTRY_ROW_EDIT_ICON_NAME,n as ENTRY_ROW_MAX_LENGTH_LIMIT,t as ENTRY_ROW_TITLE_SPACING,EntryRowState,s as PASSWORD_CONCEAL_ICON_NAME,l as PASSWORD_CONCEAL_LABEL,o as PASSWORD_REVEAL_ICON_NAME,c as PASSWORD_REVEAL_LABEL,PasswordEntryRowState,clampEntryText,entryTextLength};
|
package/lib/esm/glib.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";const e=/^[ \t\n\v\f\r]+|[ \t\n\v\f\r]+$/g;function gStrStrip(t){return t.replace(e,``)}function stringIsNotEmpty(e){return e!=null&&e.length>0}function glibClamp(e,t,n){return e>n?n:e<t?t:e}function stripMnemonic(e){let t=[...e],n=``,r=0;for(;r<t.length;){if(t[r]!==`_`){n+=t[r],r+=1;continue}let e=t[r+1];if(e===void 0)return n;n+=e===`_`?`_`:e,r+=2}return n}export{gStrStrip,glibClamp,stringIsNotEmpty,stripMnemonic};
|
package/lib/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{AdwBreakpoint as e,evaluateBreakpointCondition as t,parseBreakpointCondition as n}from"./breakpoint.js";import{DEFAULT_ICON_COLOR as r,DEFAULT_ICON_COLOR_DARK as i,adwaitaColorScheme as a,isThemeIconColor as o,onAdwaitaColorSchemeChanged as s,setAdwaitaColorScheme as c,themeIconColor as l,toggleAdwaitaColorScheme as u}from"./color-scheme.js";import{AdwAlertResponses as d}from"./dialog.js";import{AdwToast as f,AdwToastQueue as p,DEFAULT_TOAST_TIMEOUT as m}from"./toast.js";import{ComboState as h,ExpanderState as g,SpinState as _,ToggleGroupState as v}from"./rows.js";export{d as AdwAlertResponses,e as AdwBreakpoint,f as AdwToast,p as AdwToastQueue,h as ComboState,r as DEFAULT_ICON_COLOR,i as DEFAULT_ICON_COLOR_DARK,m as DEFAULT_TOAST_TIMEOUT,g as ExpanderState,_ as SpinState,v as ToggleGroupState,a as adwaitaColorScheme,t as evaluateBreakpointCondition,o as isThemeIconColor,s as onAdwaitaColorSchemeChanged,n as parseBreakpointCondition,c as setAdwaitaColorScheme,l as themeIconColor,u as toggleAdwaitaColorScheme};
|
|
1
|
+
import{gStrStrip as e,glibClamp as t,stringIsNotEmpty as n,stripMnemonic as r}from"./glib.js";import{ADW_ABOUT_DIALOG_LABELS as i,ADW_CREDITS_SECTION_TITLES as a,ADW_LICENSES as o,ADW_LICENSE_ALIASES as s,ADW_LICENSE_DEFAULTS as c,ADW_LICENSE_WARRANTY_TEMPLATE as l,ADW_TRANSLATOR_CREDITS_SENTINELS as u,GTK_LICENSE as d,aboutDialogVisibility as f,creditsSections as p,isLicenseType as m,legalSectionVisible as h,licenseText as g,licenseTypeForSpdxId as _,parseCreditPerson as v,setLicense as y,setLicenseType as b,translatorCreditsPeople as x}from"./about-dialog.js";import{ActionRowState as S,BUTTON_ROW_ACTIVATABLE as C,ButtonRowState as w,SwitchRowState as T,WindowTitleState as E,deriveRowLabels as D}from"./action-row.js";import{AVATAR_COLORS as O,AVATAR_COLOR_COUNT as k,avatarColor as A,avatarColorClass as j,avatarFontSize as M,avatarInitials as N,avatarMaxFontSize as P,avatarMode as F,flattenAvatarGradient as I,gStrHash as L,randomAvatarColorClass as R}from"./avatar.js";import{ADW_BANNER_BUTTON_STYLES as z,ADW_BANNER_BUTTON_STYLE_CLASSES as B,ADW_BANNER_DEFAULTS as V,bannerButtonStyleClasses as H,bannerButtonText as U,bannerButtonVisible as W,bannerRenderState as G,isBannerButtonStyle as K,parseBannerButtonStyle as q}from"./banner.js";import{AdwBreakpoint as J,evaluateBreakpointCondition as Y,parseBreakpointCondition as X}from"./breakpoint.js";import{ADW_BUTTON_CONTENT_DEFAULTS as Z,BUTTON_CONTENT_FALLBACK_ICON as Q,BUTTON_CONTENT_STYLE_CLASS as $,buttonContentEllipsize as ee,buttonContentIconExpands as te,buttonContentIconIsEmpty as ne,buttonContentIconName as re,buttonContentLabelText as ie,buttonContentLabelVisible as ae,buttonContentRenderState as oe,buttonContentStyleTargetIndex as se}from"./button-content.js";import{CAROUSEL_SCROLL_TIMEOUT_MS as ce,CAROUSEL_SETTLE_EPSILON as le,CarouselState as ue,carouselClampPosition as de,carouselClosestSnapPoint as fe,carouselNavigateTarget as pe,carouselPageAtPosition as me,carouselRange as he,carouselReorderShift as ge,carouselSizesFromSnapPoints as _e,carouselSnapPoints as ve,carouselWheelStep as ye}from"./carousel.js";import{RadioGroupState as be,resolveCheckState as xe}from"./checks.js";import{adwLerp as Se,easeInOutSine as Ce,easeOutCubic as we,inverseLerp as Te}from"./easing.js";import{ADW_CLAMP_DEFAULTS as Ee,ADW_CLAMP_SIZE_CLASSES as De,ADW_SPINNER_MAX_SIZE as Oe,ADW_SPINNER_MIN_SIZE as ke,ADW_TOOLBAR_BAR_CLASSES as Ae,ADW_TOOLBAR_VIEW_CLASSES as je,ADW_TOOLBAR_VIEW_DEFAULTS as Me,clampAllocate as Ne,clampChildSize as Pe,clampSizeFromChild as Fe,clampThresholds as Ie,normalizeClampSize as Le,parseToolbarStyle as Re,resolveSpinnerSize as ze,spinnerGeometry as Be,toolbarBarStyleClasses as Ve,toolbarViewAllocate as He,toolbarViewClasses as Ue,toolbarViewContentForSize as We,toolbarViewMeasure as Ge}from"./chrome.js";import{DEFAULT_ICON_COLOR as Ke,DEFAULT_ICON_COLOR_DARK as qe,adwaitaColorScheme as Je,isThemeIconColor as Ye,onAdwaitaColorSchemeChanged as Xe,setAdwaitaColorScheme as Ze,themeIconColor as Qe,toggleAdwaitaColorScheme as $e}from"./color-scheme.js";import{ADW_DATA_GRID_ROW_VARIANTS as et,DATA_GRID_CELL_CLASS as tt,DATA_GRID_ROW_CLASS as nt,dataGridCellText as rt,dataGridColumnAlign as it,dataGridColumnClasses as at,dataGridRowInteractive as ot,dataGridTrackTemplate as st,dataGridTracks as ct,normalizeDataGridColumns as lt,normalizeDataGridVariant as ut}from"./data-grid.js";import{AdwAlertResponses as dt,BottomSheetPresentation as ft,resolveBottomSheetClose as pt}from"./dialog.js";import{CAPS_LOCK_ICON_NAME as mt,CAPS_LOCK_TOOLTIP as ht,EMPTY_ANIMATION_DURATION_MS as gt,ENTRY_ROW_APPLY_ICON_NAME as _t,ENTRY_ROW_APPLY_TOOLTIP as vt,ENTRY_ROW_EDIT_ICON_NAME as yt,ENTRY_ROW_MAX_LENGTH_LIMIT as bt,ENTRY_ROW_TITLE_SPACING as xt,EntryRowState as St,PASSWORD_CONCEAL_ICON_NAME as Ct,PASSWORD_CONCEAL_LABEL as wt,PASSWORD_REVEAL_ICON_NAME as Tt,PASSWORD_REVEAL_LABEL as Et,PasswordEntryRowState as Dt,clampEntryText as Ot,entryTextLength as kt}from"./entry-row.js";import{AdwToast as At,AdwToastQueue as jt,DEFAULT_TOAST_TIMEOUT as Mt}from"./toast.js";import{ADW_COMBO_NO_SELECTION as Nt,ComboState as Pt,ExpanderState as Ft,SpinState as It,ToggleGroupState as Lt,normalizeComboOptions as Rt}from"./rows.js";import{ViewStackState as zt,normalizeIconName as Bt,resolvePageTitle as Vt}from"./view-stack.js";import{BACK_BUTTON_FALLBACK_TOOLTIP as Ht,NavigationViewState as Ut,describeNavigationDiagnostic as Wt}from"./navigation-view.js";import{ADW_SIDEBAR_NO_SELECTION as Gt,SidebarState as Kt,adjustSidebarSelection as qt,clampSidebarSelection as Jt,flattenSidebarItems as Yt,sidebarHeaders as Xt}from"./sidebar.js";import{ADW_SPINNER_CONTRACT_DISTANCE as Zt,ADW_SPINNER_CYCLES_PER_LOOP as Qt,ADW_SPINNER_CYCLE_LENGTH as $t,ADW_SPINNER_EXTEND_DISTANCE as en,ADW_SPINNER_IDLE_DISTANCE as tn,ADW_SPINNER_MAX_ARC_LENGTH as nn,ADW_SPINNER_MIN_ARC_LENGTH as rn,ADW_SPINNER_N_CYCLES as an,ADW_SPINNER_OVERLAP_DISTANCE as on,ADW_SPINNER_SPIN_DURATION_MS as sn,ADW_SPINNER_START_ANGLE as cn,ADW_SPINNER_STILL_PROGRESS as ln,ADW_SPINNER_TRACK_OPACITY as un,normalizeSpinnerAngle as dn,spinnerArc as fn,spinnerArcEnd as pn,spinnerArcStart as mn,spinnerProgressAt as hn}from"./spinner.js";import{ADW_LENGTH_UNITS as gn,DEFAULT_DPI as _n,adwLengthToPx as vn,normalizeLengthUnit as yn}from"./length-unit.js";import{ADW_SWIPE_BORDER as bn,DEFAULT_MAX_SIDEBAR_WIDTH as xn,DEFAULT_MIN_SIDEBAR_WIDTH as Sn,DEFAULT_SIDEBAR_WIDTH_FRACTION as Cn,DEFAULT_SIDEBAR_WIDTH_UNIT as wn,INSTANT_SPLIT_VIEW_ANIMATOR as Tn,NAVIGATION_SPLIT_VIEW_CRITICALS as En,NavigationSplitViewState as Dn,OverlaySplitViewState as On,isSidebarAtVisualStart as kn,layoutNavigationSplitView as An,layoutOverlaySplitView as jn,measureSplitViewHorizontal as Mn,resolveNaturalSidebarWidth as Nn,resolveNavigationAction as Pn,resolveNavigationSidebarWidth as Fn,resolveNavigationStack as In,resolveOverlaySidebarWidth as Ln,resolveSidebarBounds as Rn,resolveSwipeArea as zn,resolveSwipeRelease as Bn,resolveSwipeSnapPoints as Vn,resolveSwipeStart as Hn,swipeCancelProgress as Un,tagsConflict as Wn}from"./split-view.js";import{DEFAULT_DROPDOWN_TOOLTIP as Gn,SPLIT_BUTTON_DISABLED_OPACITY as Kn,SplitButtonState as qn,isSplitButtonDirection as Jn,menuButtonArrowIcon as Yn,menuButtonPopupDirection as Xn,parseMenuEntries as Zn,resolveDropdownTooltip as Qn,splitButtonArrowIcon as $n,splitButtonPopupDirection as er,splitButtonRootState as tr,splitButtonStyleClasses as nr}from"./split-button.js";import{DEFAULT_INDICATOR_DESCRIPTION_STRINGS as rr,INLINE_VIEW_SWITCHER_DISPLAY_MODES as ir,VIEW_SWITCHER_BADGE_LIMIT as ar,VIEW_SWITCHER_DRAG_SWITCH_DELAY as or,VIEW_SWITCHER_FALLBACK_ICON as sr,VIEW_SWITCHER_NO_SELECTION as cr,VIEW_SWITCHER_POLICIES as lr,ViewSwitcherBarState as ur,ViewSwitcherDragSwitch as dr,ViewSwitcherState as fr,buildInlineToggles as pr,buildViewSwitcherButtons as mr,createViewSwitcherPage as hr,inlineToggleTooltip as gr,isInlineViewSwitcherDisplayMode as _r,isViewSwitcherButtonVisible as vr,isViewSwitcherPolicy as yr,pageIndexForToggle as br,shouldRevealViewSwitcherBar as xr,toggleIndexForPage as Sr,viewSwitcherBadgeLabel as Cr,viewSwitcherButtonOrientation as wr,viewSwitcherIconName as Tr,viewSwitcherIndicatorDescription as Er,viewSwitcherLabel as Dr,viewSwitcherPageFromStackPage as Or,viewSwitcherPagesFromStack as kr}from"./view-switcher.js";import{DEFAULT_TAB_AUTOHIDE as Ar,TabViewState as jr,isDescendantOfPage as Mr,successorAfterClose as Nr,tabCloseVisible as Pr,tabIconState as Fr,tabTooltip as Ir,tabTooltipIsMarkup as Lr,tabsRevealed as Rr}from"./tab-view.js";import{UNTITLED_PAGE_LABEL as zr,collectSearchRows as Br,countVisiblePages as Vr,createSearchRowSubtitle as Hr,defaultCaseFolder as Ur,derivePreferencesGroupHeader as Wr,escapeMarkup as Gr,makeComparable as Kr,rowMatchesQuery as qr,searchPreferences as Jr,stripMarkup as Yr}from"./preferences.js";import{POPOVER_ITEM_RADIUS as Xr,POPOVER_MENU_PADDING as Zr,POPOVER_PADDING as Qr,POPOVER_RADIUS as $r,PopoverState as ei,resolvePopoverKey as ti}from"./popover.js";import{ADW_WRAP_BOX_DEFAULT_ALIGN as ni,ADW_WRAP_BOX_DEFAULT_JUSTIFY as ri,ADW_WRAP_BOX_DEFAULT_JUSTIFY_LAST_LINE as ii,ADW_WRAP_BOX_DEFAULT_LENGTH_UNIT as ai,ADW_WRAP_BOX_DEFAULT_PACK_DIRECTION as oi,ADW_WRAP_BOX_DEFAULT_SPACING as si,ADW_WRAP_BOX_DEFAULT_WRAP_POLICY as ci,ADW_WRAP_BOX_JUSTIFY_MODES as li,ADW_WRAP_BOX_NATURAL_LINE_LENGTH_UNSET as ui,ADW_WRAP_BOX_PACK_DIRECTIONS as di,ADW_WRAP_POLICIES as fi,normalizeNaturalLineLength as pi,normalizeWrapBoxAlign as mi,normalizeWrapBoxJustify as hi,normalizeWrapBoxLengthUnit as gi,normalizeWrapBoxPackDirection as _i,normalizeWrapBoxSpacing as vi,normalizeWrapPolicy as yi,resolveWrapBoxChildOrder as bi,resolveWrapBoxLine as xi,wrapBoxLengthToPx as Si,wrapPolicyFlexShrink as Ci}from"./wrap-box.js";export{i as ADW_ABOUT_DIALOG_LABELS,z as ADW_BANNER_BUTTON_STYLES,B as ADW_BANNER_BUTTON_STYLE_CLASSES,V as ADW_BANNER_DEFAULTS,Z as ADW_BUTTON_CONTENT_DEFAULTS,Ee as ADW_CLAMP_DEFAULTS,De as ADW_CLAMP_SIZE_CLASSES,Nt as ADW_COMBO_NO_SELECTION,a as ADW_CREDITS_SECTION_TITLES,et as ADW_DATA_GRID_ROW_VARIANTS,gn as ADW_LENGTH_UNITS,o as ADW_LICENSES,s as ADW_LICENSE_ALIASES,c as ADW_LICENSE_DEFAULTS,l as ADW_LICENSE_WARRANTY_TEMPLATE,Gt as ADW_SIDEBAR_NO_SELECTION,Zt as ADW_SPINNER_CONTRACT_DISTANCE,Qt as ADW_SPINNER_CYCLES_PER_LOOP,$t as ADW_SPINNER_CYCLE_LENGTH,en as ADW_SPINNER_EXTEND_DISTANCE,tn as ADW_SPINNER_IDLE_DISTANCE,nn as ADW_SPINNER_MAX_ARC_LENGTH,Oe as ADW_SPINNER_MAX_SIZE,rn as ADW_SPINNER_MIN_ARC_LENGTH,ke as ADW_SPINNER_MIN_SIZE,an as ADW_SPINNER_N_CYCLES,on as ADW_SPINNER_OVERLAP_DISTANCE,sn as ADW_SPINNER_SPIN_DURATION_MS,cn as ADW_SPINNER_START_ANGLE,ln as ADW_SPINNER_STILL_PROGRESS,un as ADW_SPINNER_TRACK_OPACITY,bn as ADW_SWIPE_BORDER,Ae as ADW_TOOLBAR_BAR_CLASSES,je as ADW_TOOLBAR_VIEW_CLASSES,Me as ADW_TOOLBAR_VIEW_DEFAULTS,u as ADW_TRANSLATOR_CREDITS_SENTINELS,ni as ADW_WRAP_BOX_DEFAULT_ALIGN,ri as ADW_WRAP_BOX_DEFAULT_JUSTIFY,ii as ADW_WRAP_BOX_DEFAULT_JUSTIFY_LAST_LINE,ai as ADW_WRAP_BOX_DEFAULT_LENGTH_UNIT,oi as ADW_WRAP_BOX_DEFAULT_PACK_DIRECTION,si as ADW_WRAP_BOX_DEFAULT_SPACING,ci as ADW_WRAP_BOX_DEFAULT_WRAP_POLICY,li as ADW_WRAP_BOX_JUSTIFY_MODES,ui as ADW_WRAP_BOX_NATURAL_LINE_LENGTH_UNSET,di as ADW_WRAP_BOX_PACK_DIRECTIONS,fi as ADW_WRAP_POLICIES,O as AVATAR_COLORS,k as AVATAR_COLOR_COUNT,S as ActionRowState,dt as AdwAlertResponses,J as AdwBreakpoint,At as AdwToast,jt as AdwToastQueue,Ht as BACK_BUTTON_FALLBACK_TOOLTIP,Q as BUTTON_CONTENT_FALLBACK_ICON,$ as BUTTON_CONTENT_STYLE_CLASS,C as BUTTON_ROW_ACTIVATABLE,ft as BottomSheetPresentation,w as ButtonRowState,mt as CAPS_LOCK_ICON_NAME,ht as CAPS_LOCK_TOOLTIP,ce as CAROUSEL_SCROLL_TIMEOUT_MS,le as CAROUSEL_SETTLE_EPSILON,ue as CarouselState,Pt as ComboState,tt as DATA_GRID_CELL_CLASS,nt as DATA_GRID_ROW_CLASS,_n as DEFAULT_DPI,Gn as DEFAULT_DROPDOWN_TOOLTIP,Ke as DEFAULT_ICON_COLOR,qe as DEFAULT_ICON_COLOR_DARK,rr as DEFAULT_INDICATOR_DESCRIPTION_STRINGS,xn as DEFAULT_MAX_SIDEBAR_WIDTH,Sn as DEFAULT_MIN_SIDEBAR_WIDTH,Cn as DEFAULT_SIDEBAR_WIDTH_FRACTION,wn as DEFAULT_SIDEBAR_WIDTH_UNIT,Ar as DEFAULT_TAB_AUTOHIDE,Mt as DEFAULT_TOAST_TIMEOUT,gt as EMPTY_ANIMATION_DURATION_MS,_t as ENTRY_ROW_APPLY_ICON_NAME,vt as ENTRY_ROW_APPLY_TOOLTIP,yt as ENTRY_ROW_EDIT_ICON_NAME,bt as ENTRY_ROW_MAX_LENGTH_LIMIT,xt as ENTRY_ROW_TITLE_SPACING,St as EntryRowState,Ft as ExpanderState,d as GTK_LICENSE,ir as INLINE_VIEW_SWITCHER_DISPLAY_MODES,Tn as INSTANT_SPLIT_VIEW_ANIMATOR,En as NAVIGATION_SPLIT_VIEW_CRITICALS,Dn as NavigationSplitViewState,Ut as NavigationViewState,On as OverlaySplitViewState,Ct as PASSWORD_CONCEAL_ICON_NAME,wt as PASSWORD_CONCEAL_LABEL,Tt as PASSWORD_REVEAL_ICON_NAME,Et as PASSWORD_REVEAL_LABEL,Xr as POPOVER_ITEM_RADIUS,Zr as POPOVER_MENU_PADDING,Qr as POPOVER_PADDING,$r as POPOVER_RADIUS,Dt as PasswordEntryRowState,ei as PopoverState,be as RadioGroupState,Kn as SPLIT_BUTTON_DISABLED_OPACITY,Kt as SidebarState,It as SpinState,qn as SplitButtonState,T as SwitchRowState,jr as TabViewState,Lt as ToggleGroupState,zr as UNTITLED_PAGE_LABEL,ar as VIEW_SWITCHER_BADGE_LIMIT,or as VIEW_SWITCHER_DRAG_SWITCH_DELAY,sr as VIEW_SWITCHER_FALLBACK_ICON,cr as VIEW_SWITCHER_NO_SELECTION,lr as VIEW_SWITCHER_POLICIES,zt as ViewStackState,ur as ViewSwitcherBarState,dr as ViewSwitcherDragSwitch,fr as ViewSwitcherState,E as WindowTitleState,f as aboutDialogVisibility,qt as adjustSidebarSelection,vn as adwLengthToPx,Se as adwLerp,Je as adwaitaColorScheme,A as avatarColor,j as avatarColorClass,M as avatarFontSize,N as avatarInitials,P as avatarMaxFontSize,F as avatarMode,H as bannerButtonStyleClasses,U as bannerButtonText,W as bannerButtonVisible,G as bannerRenderState,pr as buildInlineToggles,mr as buildViewSwitcherButtons,ee as buttonContentEllipsize,te as buttonContentIconExpands,ne as buttonContentIconIsEmpty,re as buttonContentIconName,ie as buttonContentLabelText,ae as buttonContentLabelVisible,oe as buttonContentRenderState,se as buttonContentStyleTargetIndex,de as carouselClampPosition,fe as carouselClosestSnapPoint,pe as carouselNavigateTarget,me as carouselPageAtPosition,he as carouselRange,ge as carouselReorderShift,_e as carouselSizesFromSnapPoints,ve as carouselSnapPoints,ye as carouselWheelStep,Ne as clampAllocate,Pe as clampChildSize,Ot as clampEntryText,Jt as clampSidebarSelection,Fe as clampSizeFromChild,Ie as clampThresholds,Br as collectSearchRows,Vr as countVisiblePages,Hr as createSearchRowSubtitle,hr as createViewSwitcherPage,p as creditsSections,rt as dataGridCellText,it as dataGridColumnAlign,at as dataGridColumnClasses,ot as dataGridRowInteractive,st as dataGridTrackTemplate,ct as dataGridTracks,Ur as defaultCaseFolder,Wr as derivePreferencesGroupHeader,D as deriveRowLabels,Wt as describeNavigationDiagnostic,Ce as easeInOutSine,we as easeOutCubic,kt as entryTextLength,Gr as escapeMarkup,Y as evaluateBreakpointCondition,I as flattenAvatarGradient,Yt as flattenSidebarItems,L as gStrHash,e as gStrStrip,t as glibClamp,gr as inlineToggleTooltip,Te as inverseLerp,K as isBannerButtonStyle,Mr as isDescendantOfPage,_r as isInlineViewSwitcherDisplayMode,m as isLicenseType,kn as isSidebarAtVisualStart,Jn as isSplitButtonDirection,Ye as isThemeIconColor,vr as isViewSwitcherButtonVisible,yr as isViewSwitcherPolicy,An as layoutNavigationSplitView,jn as layoutOverlaySplitView,h as legalSectionVisible,g as licenseText,_ as licenseTypeForSpdxId,Kr as makeComparable,Mn as measureSplitViewHorizontal,Yn as menuButtonArrowIcon,Xn as menuButtonPopupDirection,Le as normalizeClampSize,Rt as normalizeComboOptions,lt as normalizeDataGridColumns,ut as normalizeDataGridVariant,Bt as normalizeIconName,yn as normalizeLengthUnit,pi as normalizeNaturalLineLength,dn as normalizeSpinnerAngle,mi as normalizeWrapBoxAlign,hi as normalizeWrapBoxJustify,gi as normalizeWrapBoxLengthUnit,_i as normalizeWrapBoxPackDirection,vi as normalizeWrapBoxSpacing,yi as normalizeWrapPolicy,Xe as onAdwaitaColorSchemeChanged,br as pageIndexForToggle,q as parseBannerButtonStyle,X as parseBreakpointCondition,v as parseCreditPerson,Zn as parseMenuEntries,Re as parseToolbarStyle,R as randomAvatarColorClass,pt as resolveBottomSheetClose,xe as resolveCheckState,Qn as resolveDropdownTooltip,Nn as resolveNaturalSidebarWidth,Pn as resolveNavigationAction,Fn as resolveNavigationSidebarWidth,In as resolveNavigationStack,Ln as resolveOverlaySidebarWidth,Vt as resolvePageTitle,ti as resolvePopoverKey,Rn as resolveSidebarBounds,ze as resolveSpinnerSize,zn as resolveSwipeArea,Bn as resolveSwipeRelease,Vn as resolveSwipeSnapPoints,Hn as resolveSwipeStart,bi as resolveWrapBoxChildOrder,xi as resolveWrapBoxLine,qr as rowMatchesQuery,Jr as searchPreferences,Ze as setAdwaitaColorScheme,y as setLicense,b as setLicenseType,xr as shouldRevealViewSwitcherBar,Xt as sidebarHeaders,fn as spinnerArc,pn as spinnerArcEnd,mn as spinnerArcStart,Be as spinnerGeometry,hn as spinnerProgressAt,$n as splitButtonArrowIcon,er as splitButtonPopupDirection,tr as splitButtonRootState,nr as splitButtonStyleClasses,n as stringIsNotEmpty,Yr as stripMarkup,r as stripMnemonic,Nr as successorAfterClose,Un as swipeCancelProgress,Pr as tabCloseVisible,Fr as tabIconState,Ir as tabTooltip,Lr as tabTooltipIsMarkup,Rr as tabsRevealed,Wn as tagsConflict,Qe as themeIconColor,$e as toggleAdwaitaColorScheme,Sr as toggleIndexForPage,Ve as toolbarBarStyleClasses,He as toolbarViewAllocate,Ue as toolbarViewClasses,We as toolbarViewContentForSize,Ge as toolbarViewMeasure,x as translatorCreditsPeople,Cr as viewSwitcherBadgeLabel,wr as viewSwitcherButtonOrientation,Tr as viewSwitcherIconName,Er as viewSwitcherIndicatorDescription,Dr as viewSwitcherLabel,Or as viewSwitcherPageFromStackPage,kr as viewSwitcherPagesFromStack,Si as wrapBoxLengthToPx,Ci as wrapPolicyFlexShrink};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";const e=[`px`,`pt`,`sp`],t=96;function adwLengthToPx(e,t,n=96){switch(e){case`pt`:return t*n/72;case`sp`:return t*n/96;default:return t}}function normalizeLengthUnit(t,n){return e.includes(t)?t:n}export{e as ADW_LENGTH_UNITS,t as DEFAULT_DPI,adwLengthToPx,normalizeLengthUnit};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";const e=`Back`;function describeNavigationDiagnostic(e){switch(e.code){case`duplicate-tag`:return`Duplicate page tag in AdwNavigationView: ${e.tag}`;case`already-in-stack`:return e.tag===void 0?`Page '${e.title}' is already in navigation stack`:`Page with the tag '${e.tag}' is already in navigation stack`;case`tag-not-found`:return`No page with the tag '${e.tag}' found in AdwNavigationView`;case`not-in-stack`:return`Page '${e.title}' is not in the navigation stack`}}var NavigationViewState=class{constructor(e={}){this._registry=new Map,this._tags=new Map,this._stack=[],this._listeners=new Set,this._pendingRemoval=null,this._animateTransitions=e.animateTransitions??!0,this._popOnEscape=e.popOnEscape??!0,this._onDiagnostic=e.onDiagnostic??null}subscribe(e){return this._listeners.add(e),()=>{this._listeners.delete(e)}}get stack(){return[...this._stack]}get depth(){return this._stack.length}get pages(){return[...this._registry.keys()]}get visiblePage(){return this._stack.length===0?null:this._stack[this._stack.length-1]}get visiblePageTag(){let e=this.visiblePage;return e===null?null:this.tagOf(e)}get animateTransitions(){return this._animateTransitions}get popOnEscape(){return this._popOnEscape}setAnimateTransitions(e){let t=!!e;return t===this._animateTransitions?!1:(this._animateTransitions=t,!0)}setPopOnEscape(e){let t=!!e;return t===this._popOnEscape?!1:(this._popOnEscape=t,!0)}isRegistered(e){return this._registry.has(e)}isInStack(e){return this._stack.includes(e)}isRemoveOnPop(e){return this._registry.get(e)?.removeOnPop===!0}tagOf(e){return this._registry.get(e)?.tag??null}titleOf(e){return this._registry.get(e)?.title??``}canPopOf(e){return this._registry.get(e)?.canPop??!0}findPage(e){return this._tags.get(e)??null}getPreviousPage(e){let t=this._stack.indexOf(e);return t<=0?null:this._stack[t-1]}add(e,t={}){let n=this._registry.get(e);return n===void 0?this._addPage(e,t,!0):n.removeOnPop&&this._stack.includes(e)?(n.removeOnPop=!1,!0):(n.tag!==null&&this._diagnose({code:`duplicate-tag`,tag:n.tag}),!1)}remove(e){let t=this._registry.get(e);return t===void 0?!1:(this._pendingRemoval===e&&(this._pendingRemoval=null),this._stack.includes(e)?(t.removeOnPop=!0,!0):(this._unregister(e),!0))}setTag(e,t){let n=this._registry.get(e);if(n===void 0)return!1;let r=t??null;return r===n.tag?!1:r!==null&&this._tags.has(r)?(this._diagnose({code:`duplicate-tag`,tag:r}),!1):(n.tag!==null&&this._tags.delete(n.tag),n.tag=r,r!==null&&this._tags.set(r,e),!0)}setTitle(e,t){if(typeof t!=`string`)return!1;let n=this._registry.get(e);return n===void 0||n.title===t?!1:(n.title=t,!0)}setCanPop(e,t){let n=this._registry.get(e);if(n===void 0)return!1;let r=!!t;return r===n.canPop?!1:(n.canPop=r,!0)}push(e,t={}){return this._maybeAddPage(e,t)?this._pushToStack(e,`push`,this._animateTransitions,!1):!1}pushByTag(e){let t=this.findPage(e);return t===null?(this._diagnose({code:`tag-not-found`,tag:e}),!1):this._pushToStack(t,`push`,this._animateTransitions,!0)}pop(){let e=this.visiblePage;if(e===null)return!1;let t=this.getPreviousPage(e);return t===null?!1:(this._popFromStack(t,this._animateTransitions),!0)}popToPage(e){return e===this.visiblePage?!1:this._stack.includes(e)?(this._popFromStack(e,this._animateTransitions),!0):(this._diagnose({code:`not-in-stack`,title:this.titleOf(e)}),!1)}popToTag(e){let t=this.findPage(e);return t===null?(this._diagnose({code:`tag-not-found`,tag:e}),!1):this.popToPage(t)}replace(e,t){let n=this.visiblePage,r=n,i=n!==null,a=!1,o=[],s=new Set;for(let t of e)t!=null&&s.add(t);for(let e=this._stack.length-1;e>=0;e--){let t=this._stack[e],n=this._registry.get(t);n===void 0||!n.removeOnPop||s.has(t)||(t===r&&(a=n.tag!==null,r=null),this._unregister(t)&&o.push(t))}this._stack.length=0;let c=new Set;for(let n of e)if(n!=null){if(c.has(n)){this._diagnose({code:`already-in-stack`,title:this.titleOf(n)});continue}this._maybeAddPage(n,t?.(n)??{})&&(c.add(n),this._stack.push(n))}let l=this.visiblePage,u;u=l===null?r===null?{animate:!1,tagNotify:i&&a,removeAfterTransition:null}:this._beginSwitch(r,null,!0,!1,o):r===l?{animate:!1,tagNotify:!1,removeAfterTransition:null}:this._beginSwitch(r,l,!0,!1,o),this._emitChange(`replace`,n,!0,[],o,u)}replaceWithTags(e){let t=e.map(e=>{let t=this.findPage(e);return t===null&&this._diagnose({code:`tag-not-found`,tag:e}),t});this.replace(t)}finishTransition(){let e=this._resolvePendingRemoval();return e===null?[]:[e]}canGoBack(){let e=this.visiblePage;return e===null||!this.canPopOf(e)?!1:this.getPreviousPage(e)!==null}backButtonTooltip(t=e){if(!this.canGoBack())return null;let n=this.getPreviousPage(this.visiblePage);if(n===null)return null;let r=this.titleOf(n);return r.length>0?r:t}popFromShortcut(){let e=this.visiblePage;return e===null?`propagate`:this.canPopOf(e)?this.pop()?`stop`:`propagate`:`stop`}popFromEscape(){return this._popOnEscape?this.popFromShortcut():`propagate`}_diagnose(e){this._onDiagnostic?.(e)}_emit(e){for(let t of[...this._listeners])t(e)}_emitChange(e,t,n,r,i,a){let o=this.visiblePage;this._emit({stack:[...this._stack],visiblePage:o,visiblePageTag:o===null?null:this.tagOf(o),previousVisiblePage:t,reason:e,popped:[...r],removed:[...i],removeAfterTransition:a.removeAfterTransition,animate:a.animate,pop:n,tagNotify:a.tagNotify})}_addPage(e,t,n){let r=t.tag??null;return r!==null&&this._tags.has(r)?(this._diagnose({code:`duplicate-tag`,tag:r}),!1):(this._registry.set(e,{tag:r,title:t.title??``,canPop:t.canPop===void 0?!0:!!t.canPop,removeOnPop:!1}),r!==null&&this._tags.set(r,e),n&&this._stack.length===0&&this._pushToStack(e,`add`,!1,!1),!0)}_maybeAddPage(e,t){if(this._registry.has(e))return!0;let n=t.tag??null;if(n!==null&&this._tags.has(n))return this._diagnose({code:`duplicate-tag`,tag:n}),!1;if(!this._addPage(e,t,!1))return!1;let r=this._registry.get(e);return r!==void 0&&(r.removeOnPop=!0),!0}_pushToStack(e,t,n,r){if(this._stack.includes(e))return this._diagnose(r?{code:`already-in-stack`,tag:this.tagOf(e)}:{code:`already-in-stack`,title:this.titleOf(e)}),!1;let i=this.visiblePage,a=[];this._stack.push(e);let o=this._beginSwitch(i,e,!1,n,a);return this._emitChange(t,i,!1,[],a,o),!0}_popFromStack(e,t){let n=this.visiblePage;if(e===n)return;let r=this._stack.indexOf(e),i=this._stack.slice(r+1).reverse();this._stack.length=r+1;let a=[],o=this._beginSwitch(n,e,!0,t,a);for(let e of i)e!==n&&this._registry.get(e)?.removeOnPop===!0&&this._unregister(e)&&a.push(e);this._emitChange(`pop`,n,!0,i,a,o)}_beginSwitch(e,t,n,r,i){if(this._pendingRemoval!==null&&this._pendingRemoval!==e){let e=this._resolvePendingRemoval();e!==null&&i.push(e)}let a=null;return n&&e!==null&&this._registry.get(e)?.removeOnPop===!0&&!this._stack.includes(e)&&(a=e,this._pendingRemoval=e),{animate:r&&e!==null,tagNotify:e!==null&&this.tagOf(e)!==null||t!==null&&this.tagOf(t)!==null,removeAfterTransition:a}}_resolvePendingRemoval(){let e=this._pendingRemoval;if(e===null)return null;if(this._pendingRemoval=null,this._stack.includes(e)){let t=this._registry.get(e);return t!==void 0&&(t.removeOnPop=!0),null}return this._unregister(e)?e:null}_unregister(e){let t=this._registry.get(e);return t===void 0?!1:(t.tag!==null&&this._tags.get(t.tag)===e&&this._tags.delete(t.tag),this._registry.delete(e),!0)}};export{e as BACK_BUTTON_FALLBACK_TOOLTIP,NavigationViewState,describeNavigationDiagnostic};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";const e=8,t=6,n=15,r=9;var PopoverState=class{constructor(){this._open=!1,this._listeners=new Set}subscribe(e){return this._listeners.add(e),()=>{this._listeners.delete(e)}}_emit(e){let t={open:this._open,interactive:e};for(let e of[...this._listeners])e(t)}_setOpen(e,t){return e===this._open?!1:(this._open=e,this._emit(t),!0)}get open(){return this._open}popup(){return this._setOpen(!0,!1)}popdown(){return this._setOpen(!1,!1)}toggle(){return this._setOpen(!this._open,!0)}dismiss(){return this._setOpen(!1,!0)}};function resolvePopoverKey(e,t){if(e===`Escape`)return{action:`close`,index:-1};let n=Number.isFinite(t.itemCount)?Math.max(0,Math.trunc(t.itemCount)):0;if(n===0)return{action:`none`,index:-1};let r=t.currentIndex,i=Number.isFinite(r)&&r>=0&&r<n?Math.trunc(r):-1,a=t.hasSearch===!0&&i<0;switch(e){case`ArrowDown`:return{action:`focus`,index:i<0?0:(i+1)%n};case`ArrowUp`:return{action:`focus`,index:i<0?n-1:(i-1+n)%n};case`Home`:return a?{action:`none`,index:-1}:{action:`focus`,index:0};case`End`:return a?{action:`none`,index:-1}:{action:`focus`,index:n-1};case`Enter`:case` `:return i<0?{action:`none`,index:-1}:{action:`activate`,index:i};default:return{action:`none`,index:-1}}}export{r as POPOVER_ITEM_RADIUS,t as POPOVER_MENU_PADDING,e as POPOVER_PADDING,n as POPOVER_RADIUS,PopoverState,resolvePopoverKey};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";import{stringIsNotEmpty as e,stripMnemonic as t}from"./glib.js";const n=new Map([[`µ`,`μ`],[`ß`,`ss`],[`ʼn`,`ʼn`],[`ſ`,`s`],[`ǰ`,`ǰ`],[`ͅ`,`ι`],[`ΐ`,`ΐ`],[`ΰ`,`ΰ`],[`ς`,`σ`],[`ϐ`,`β`],[`ϑ`,`θ`],[`ϕ`,`φ`],[`ϖ`,`π`],[`ϰ`,`κ`],[`ϱ`,`ρ`],[`ϵ`,`ε`],[`և`,`եւ`],[`ᲀ`,`в`],[`ᲁ`,`д`],[`ᲂ`,`о`],[`ᲃ`,`с`],[`ᲄ`,`т`],[`ᲅ`,`т`],[`ᲆ`,`ъ`],[`ᲇ`,`ѣ`],[`ᲈ`,`ꙋ`],[`ẖ`,`ẖ`],[`ẗ`,`ẗ`],[`ẘ`,`ẘ`],[`ẙ`,`ẙ`],[`ẚ`,`aʾ`],[`ẛ`,`ṡ`],[`ὐ`,`ὐ`],[`ὒ`,`ὒ`],[`ὔ`,`ὔ`],[`ὖ`,`ὖ`],[`ᾀ`,`ἀι`],[`ᾁ`,`ἁι`],[`ᾂ`,`ἂι`],[`ᾃ`,`ἃι`],[`ᾄ`,`ἄι`],[`ᾅ`,`ἅι`],[`ᾆ`,`ἆι`],[`ᾇ`,`ἇι`],[`ᾐ`,`ἠι`],[`ᾑ`,`ἡι`],[`ᾒ`,`ἢι`],[`ᾓ`,`ἣι`],[`ᾔ`,`ἤι`],[`ᾕ`,`ἥι`],[`ᾖ`,`ἦι`],[`ᾗ`,`ἧι`],[`ᾠ`,`ὠι`],[`ᾡ`,`ὡι`],[`ᾢ`,`ὢι`],[`ᾣ`,`ὣι`],[`ᾤ`,`ὤι`],[`ᾥ`,`ὥι`],[`ᾦ`,`ὦι`],[`ᾧ`,`ὧι`],[`ᾲ`,`ὰι`],[`ᾳ`,`αι`],[`ᾴ`,`άι`],[`ᾶ`,`ᾶ`],[`ᾷ`,`ᾶι`],[`ι`,`ι`],[`ῂ`,`ὴι`],[`ῃ`,`ηι`],[`ῄ`,`ήι`],[`ῆ`,`ῆ`],[`ῇ`,`ῆι`],[`ῒ`,`ῒ`],[`ΐ`,`ΐ`],[`ῖ`,`ῖ`],[`ῗ`,`ῗ`],[`ῢ`,`ῢ`],[`ΰ`,`ΰ`],[`ῤ`,`ῤ`],[`ῦ`,`ῦ`],[`ῧ`,`ῧ`],[`ῲ`,`ὼι`],[`ῳ`,`ωι`],[`ῴ`,`ώι`],[`ῶ`,`ῶ`],[`ῷ`,`ῶι`],[`ff`,`ff`],[`fi`,`fi`],[`fl`,`fl`],[`ffi`,`ffi`],[`ffl`,`ffl`],[`ſt`,`st`],[`st`,`st`],[`ﬓ`,`մն`],[`ﬔ`,`մե`],[`ﬕ`,`մի`],[`ﬖ`,`վն`],[`ﬗ`,`մխ`]]);function foldCherokee(e){if(e>=43888&&e<=43967)return String.fromCodePoint(e-43888+5024);if(e>=5112&&e<=5117)return String.fromCodePoint(e-8)}const defaultCaseFolder=e=>{let t=``;for(let r of e.toLowerCase()){let e=r.codePointAt(0);if(e<181){t+=r;continue}t+=n.get(r)??foldCherokee(e)??r}return t},r=new Set([`markup`,`span`,`b`,`big`,`i`,`s`,`sub`,`sup`,`small`,`tt`,`u`]),i=new Map([[`amp`,`&`],[`lt`,`<`],[`gt`,`>`],[`quot`,`"`],[`apos`,`'`]]),a=/[A-Za-z_:]/,o=/[A-Za-z0-9._:-]/,s=/[ \t\r\n]/;function escapeMarkup(e){let t=``;for(let n of e)switch(n){case`&`:t+=`&`;break;case`<`:t+=`<`;break;case`>`:t+=`>`;break;case`'`:t+=`'`;break;case`"`:t+=`"`;break;default:{let e=n.codePointAt(0);t+=e>=1&&e<=8||e>=11&&e<=12||e>=14&&e<=31||e===127?`&#x${e.toString(16)};`:n}}return t}function passthroughEnd(e,t){return e.startsWith(`<!--`,t)?{terminator:`-->`}:e.startsWith(`<![CDATA[`,t)?{terminator:`]]>`}:e.startsWith(`<!`,t)||e.startsWith(`<?`,t)?{terminator:`>`}:null}function readEntity(e,t){let n=e.indexOf(`;`,t);if(n<0)return null;let r=e.slice(t+1,n);if(r.length===0)return null;if(r.startsWith(`#`)){let e=r[1]===`x`||r[1]===`X`,t=e?r.slice(2):r.slice(1);if(t.length===0||!(e?/^[0-9a-fA-F]+$/:/^[0-9]+$/).test(t))return null;let i=Number.parseInt(t,e?16:10);return i<=0||i>1114111||i>=55296&&i<=57343?null:{value:String.fromCodePoint(i),next:n+1}}let a=i.get(r);return a===void 0?null:{value:a,next:n+1}}function readTag(e,t){let n=t+1,r=e[n]===`/`;if(r&&(n+=1),n>=e.length||!a.test(e[n]))return null;let i=n;for(;n<e.length&&o.test(e[n]);)n+=1;let c=e.slice(i,n),l=!1,u=!1;for(;n<e.length;){for(;n<e.length&&s.test(e[n]);)n+=1;let t=e[n];if(t===void 0)return null;if(t===`>`)return{name:c,closing:r,selfClosing:u,hasAttributes:l,next:n+1};if(t===`/`)return r||e[n+1]!==`>`?null:(u=!0,{name:c,closing:r,selfClosing:u,hasAttributes:l,next:n+2});if(r||!a.test(t))return null;for(;n<e.length&&o.test(e[n]);)n+=1;for(;n<e.length&&s.test(e[n]);)n+=1;if(e[n]!==`=`)return null;for(n+=1;n<e.length&&s.test(e[n]);)n+=1;let i=e[n];if(i!==`"`&&i!==`'`)return null;let d=e.indexOf(i,n+1);if(d<0)return null;n=d+1,l=!0}return null}function stripMarkup(e){let t=``,n=[],i=0;for(;i<e.length;){let a=e[i];if(a===`&`){let n=readEntity(e,i);if(!n)return null;t+=n.value,i=n.next;continue}if(a!==`<`){t+=a,i+=1;continue}let o=passthroughEnd(e,i);if(o){let t=e.indexOf(o.terminator,i+2);if(t<0)return null;i=t+o.terminator.length;continue}let s=readTag(e,i);if(!s||!r.has(s.name)||s.hasAttributes&&s.name!==`span`)return null;if(s.closing){if(n.pop()!==s.name)return null}else s.selfClosing||n.push(s.name);i=s.next}return n.length===0?t:null}function makeComparable(e,n={},r=defaultCaseFolder){let i=r(e??``);return(n.useMarkup??!0)&&(i=stripMarkup(i)??i),(n.allowUnderline??!0)&&(n.useUnderline??!1)&&(i=t(i)),i}function displayedLabelText(e,t){let n=e??``;return t?stripMarkup(n)??n:n}function derivePreferencesGroupHeader(t){let n=t.useMarkup??!0,r=e(displayedLabelText(t.title,n)),i=e(displayedLabelText(t.description,n)),a=t.hasHeaderSuffix??!1;return{titleVisible:r,descriptionVisible:i,headerVisible:r||i||a,singleLine:!i&&(a||r),listboxVisible:(t.rowCount??0)>0}}function countVisiblePages(e){let t=0;for(let n of e)n.visible!==!1&&(t+=1);return t}function collectSearchRows(e){let t=[];for(let n of e)if(n.visible!==!1){for(let e of n.groups)if(e.visible!==!1)for(let r of e.rows)r.visible!==!1&&r.title!==``&&t.push({page:n,group:e,row:r})}return t}function rowMatchesQuery(e,t,n=defaultCaseFolder){let r=n(t??``),i={useMarkup:e.useMarkup,useUnderline:e.useUnderline};return makeComparable(e.title,{...i,allowUnderline:!0},n).includes(r)?!0:e.isActionRow?makeComparable(e.subtitle,{...i,allowUnderline:!1},n).includes(r):!1}const c=`Untitled page`;function createSearchRowSubtitle(e){let n=e.groupTitle??null;n===``&&(n=null);let r=null;return e.pageTitle!==void 0&&e.pageTitle!==null&&(r=e.pageUseUnderline?t(e.pageTitle):e.pageTitle,(e.rowUseMarkup??!0)&&(r=escapeMarkup(r)),r===``&&(r=null)),n===null?r:e.nVisiblePages<=1?n:`${r??e.untitledPageLabel??`Untitled page`} → ${n}`}function searchPreferences(e,t,n={}){let r=n.fold??defaultCaseFolder,i=countVisiblePages(e),a=[];for(let{page:o,group:s,row:c}of collectSearchRows(e))rowMatchesQuery(c,t,r)&&a.push({title:c.title,subtitle:createSearchRowSubtitle({groupTitle:s.title,pageTitle:o.title??``,pageUseUnderline:o.useUnderline,rowUseMarkup:c.useMarkup,nVisiblePages:i,untitledPageLabel:n.untitledPageLabel}),useMarkup:c.useMarkup??!0,useUnderline:c.useUnderline??!1,page:o,group:s,row:c});return a}export{c as UNTITLED_PAGE_LABEL,collectSearchRows,countVisiblePages,createSearchRowSubtitle,defaultCaseFolder,derivePreferencesGroupHeader,escapeMarkup,makeComparable,rowMatchesQuery,searchPreferences,stripMarkup,t as stripMnemonic};
|
package/lib/esm/rows.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./_virtual/_rolldown/runtime.js";var ExpanderState=class{constructor(){this._expanded=!1,this._listeners=new Set}subscribe(e){return this._listeners.add(e),()=>{this._listeners.delete(e)}}_emit(){for(let e of[...this._listeners])e(this._expanded)}get expanded(){return this._expanded}setExpanded(e){let t=!!e;return t===this._expanded?!1:(this._expanded=t,this._emit(),!0)}toggle(){return this.setExpanded(!this._expanded)}expand(){return this.setExpanded(!0)}collapse(){return this.setExpanded(!1)}},ComboState=class{constructor(){this._options=[],this._selected=0,this._listeners=new Set}subscribe(e){return this._listeners.add(e),()=>{this._listeners.delete(e)}}_emit(e){let t={selected:this._selected,value:this.selectedValue,label:this.selectedLabel,interactive:e};for(let e of[...this._listeners])e(t)}_setIndex(e,t){return e===this._selected?!1:(this._selected=e,this._emit(t),!0)}get options(){return this._options}setOptions(e){this._options=Array.isArray(e)?e:[],this.
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";var ExpanderState=class{constructor(){this._expanded=!1,this._listeners=new Set}subscribe(e){return this._listeners.add(e),()=>{this._listeners.delete(e)}}_emit(){for(let e of[...this._listeners])e(this._expanded)}get expanded(){return this._expanded}setExpanded(e){let t=!!e;return t===this._expanded?!1:(this._expanded=t,this._emit(),!0)}toggle(){return this.setExpanded(!this._expanded)}expand(){return this.setExpanded(!0)}collapse(){return this.setExpanded(!1)}};function normalizeComboOptions(e){return Array.isArray(e)?e.map(e=>{if(typeof e==`string`)return{value:e,label:e};let t=e?.value===void 0?String(e?.label??``):String(e.value);return{value:t,label:e?.label===void 0?t:String(e.label)}}):[]}const e=-1;var ComboState=class{constructor(){this._options=[],this._selected=0,this._listeners=new Set}subscribe(e){return this._listeners.add(e),()=>{this._listeners.delete(e)}}_emit(e){let t={selected:this._selected,value:this.selectedValue,label:this.selectedLabel,interactive:e};for(let e of[...this._listeners])e(t)}_setIndex(e,t){return e===this._selected?!1:(this._selected=e,this._emit(t),!0)}get options(){return this._options}setOptions(e){this._options=Array.isArray(e)?e:[],this.hasIndex(this._selected)||(this._selected=this._options.length===0?-1:0),this._emit(!1)}get selectedIndex(){return this._selected}get presentsChooser(){return this._options.length>1}setSelectedIndex(e){return this._setIndex(Number.isFinite(e)?e:0,!1)}get selectedValue(){return this._options[this._selected]?.value??``}get selectedLabel(){return this._options[this._selected]?.label??``}setSelectedValue(e){let t=this._options.findIndex(t=>t.value===e);return t>=0?this.setSelectedIndex(t):!1}hasIndex(e){return Number.isFinite(e)&&e>=0&&e<this._options.length}select(e){return!this.hasIndex(e)||e===this._selected?!1:this._setIndex(e,!0)}get count(){return this._options.length}},SpinState=class{constructor(){this._value=0,this._min=0,this._max=100,this._step=1,this._listeners=new Set}subscribe(e){return this._listeners.add(e),()=>{this._listeners.delete(e)}}_emit(e){let t={value:this._value,interactive:e};for(let e of[...this._listeners])e(t)}_clamp(e){return Math.min(this._max,Math.max(this._min,e))}_bump(e){let t=this._clamp(this._value+e);return t===this._value?!1:(this._value=t,this._emit(!0),!0)}_reclamp(){let e=this._clamp(this._value);return e===this._value?!1:(this._value=e,this._emit(!1),!0)}get value(){return this._value}get min(){return this._min}get max(){return this._max}get step(){return this._step}setValue(e){let t=this._clamp(Number.isFinite(e)?e:0);return t===this._value?!1:(this._value=t,this._emit(!1),!0)}setMin(e){return this._min=Number.isFinite(e)?e:0,this._reclamp()}setMax(e){return this._max=Number.isFinite(e)?e:0,this._reclamp()}setStep(e){this._step=Number.isFinite(e)&&e>0?e:1}increment(){return this._bump(this._step)}decrement(){return this._bump(-this._step)}},ToggleGroupState=class{constructor(){this._labels=[],this._selected=0,this._listeners=new Set}subscribe(e){return this._listeners.add(e),()=>{this._listeners.delete(e)}}_emit(){let e={selected:this._selected,value:this.selectedValue};for(let t of[...this._listeners])t(e)}get labels(){return this._labels}setLabels(e){this._labels=Array.isArray(e)?e:[],this._selected>=this._labels.length&&(this._selected=0)}get selected(){return this._selected}setSelected(e){let t=Number.isFinite(e)?e:0;return t===this._selected||t<0||t>=this._labels.length?!1:(this._selected=t,this._emit(),!0)}get selectedValue(){return this._labels[this._selected]??``}get count(){return this._labels.length}};export{e as ADW_COMBO_NO_SELECTION,ComboState,ExpanderState,SpinState,ToggleGroupState,normalizeComboOptions};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";import{stringIsNotEmpty as e}from"./glib.js";const t=-1;function clampSidebarSelection(e,t){return!Number.isInteger(e)||e<0||e>=t?-1:e}function adjustSidebarSelection(e,t,n,r,i,a){if(t===0&&n>0)return clampSidebarSelection(0,n);let o=e>>>0,s=r>>>0;return s<=o&&s+i>o?-1:s<=o?clampSidebarSelection(o+a-i>>>0,n):e}function flattenSidebarItems(t,n){let r=[],i=[],a=0;return t.forEach((t,o)=>{i.push(a),t.items.forEach((t,i)=>{let s=a+i;n&&!n(t,s)||r.push({index:s,sectionIndex:o,sectionItemIndex:i,item:t,titleVisible:e(t.title),subtitleVisible:e(t.subtitle),iconVisible:e(t.iconName)})}),a+=t.items.length}),{items:r,sectionFirstIndex:i}}function deriveSidebarHeaders(e,t){let n=[],r=null;for(let i of t){if(r===i.sectionIndex)continue;let t=r===null;r=i.sectionIndex;let a=e[i.sectionIndex]?.title??``;t&&a.length===0||n.push({sectionIndex:i.sectionIndex,kind:a.length>0?`title`:`separator`,title:a,first:t})}return n}function sidebarHeaders(e,t){return deriveSidebarHeaders(e,flattenSidebarItems(e,t).items)}var SidebarState=class{constructor(){this._mode=`sidebar`,this._sections=[],this._filter=null,this._selected=-1,this._items=[],this._sectionFirstIndex=[],this._visibleItems=[],this._headers=[],this._listeners=new Set}subscribe(e){return this._listeners.add(e),()=>{this._listeners.delete(e)}}_emit(e,t){let n={selected:this._selected,previous:e,item:this.selectedItem,interactive:t};for(let e of[...this._listeners])e(n)}_applySelected(e,t){if(e===this._selected)return!1;let n=this._selected;return this._selected=e,this._emit(n,t),!0}_invalidate(){let e=flattenSidebarItems(this._sections),t=this._filter;this._items=e.items,this._sectionFirstIndex=e.sectionFirstIndex,this._visibleItems=t?this._items.filter(e=>t(e.item,e.index)):this._items,this._headers=deriveSidebarHeaders(this._sections,this._visibleItems)}get mode(){return this._mode}setMode(e){return e===this._mode?!1:(this._mode=e,!0)}get selectionVisible(){return this._mode===`sidebar`}get sections(){return this._sections}setSections(e){let t=this.count;this._sections=[...e],this._invalidate();let n=adjustSidebarSelection(adjustSidebarSelection(this._selected,t,0,0,t,0),0,this.count,0,0,this.count);this._applySelected(n,!1)}insertSection(e,t){let n=this.count,r=this._sections.length,i=Number.isInteger(t)&&t>=0&&t<r?t:r;this._sections.splice(i,0,e),this._invalidate();let a=this._sectionFirstIndex[i]??0,o=adjustSidebarSelection(this._selected,n,this.count,a,0,e.items.length);return this._applySelected(o,!1),i}removeSectionAt(e){let t=this.sectionAt(e);if(!t)return!1;let n=this.count,r=this._sectionFirstIndex[e]??0,i=t.items.length;return this._sections.splice(e,1),this._invalidate(),this._applySelected(adjustSidebarSelection(this._selected,n,this.count,r,i,0),!1),!0}removeAllSections(){let e=this.count;this._sections=[],this._invalidate(),this._applySelected(adjustSidebarSelection(this._selected,e,0,0,e,0),!1)}refresh(){this._invalidate()}sectionAt(e){if(!(!Number.isInteger(e)||e<0))return this._sections[e]}sectionFirstIndex(e){return this._sectionFirstIndex[e]??0}get count(){return this._items.length}get items(){return this._items}itemAt(e){if(!(!Number.isInteger(e)||e<0))return this._items[e]?.item}get filter(){return this._filter}setFilter(e){e!==this._filter&&(this._filter=e,this._invalidate())}get visibleItems(){return this._visibleItems}get headers(){return this._headers}get isEmpty(){return this._visibleItems.length===0}get selected(){return this._selected}get selectedItem(){return this.itemAt(this._selected)}setSelected(e){return this._applySelected(clampSidebarSelection(e,this.count),!1)}activate(e){let t=this._visibleItems.find(t=>t.index===e);return!t||t.item.visible===!1||t.item.enabled===!1?{index:e,activated:!1,selectionChanged:!1}:{index:e,activated:!0,selectionChanged:this._applySelected(clampSidebarSelection(e,this.count),!0)}}};export{t as ADW_SIDEBAR_NO_SELECTION,SidebarState,adjustSidebarSelection,clampSidebarSelection,flattenSidebarItems,sidebarHeaders};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";import{adwLerp as e,easeInOutSine as t}from"./easing.js";const n=1200,r=Math.PI*.35,i=.15,a=Math.PI*.015,o=Math.PI*.9,s=Math.PI*.9,c=Math.PI*.7,l=Math.PI*1.1,u=Math.PI*1.35,d=53,f=s+l+u-c,p=53*Math.PI*2/f,m=l-c/2;function normalizeSpinnerAngle(e){let t=e;for(;t<0;)t+=Math.PI*2;for(;t>Math.PI*2;)t-=Math.PI*2;return t}function spinnerArcStart(n){let r=n%f,i=r>l?1:t(r/l);return e(a,o,i)-r*o/f}function spinnerArcEnd(n){let r=n%f,i=l-c,d;return d=r<i?0:r>f-s?1:t((r-i)/u),e(0,o-a,d)-r*o/f}function spinnerArc(e){let t=e,n=normalizeSpinnerAngle(t+spinnerArcStart(t)+r),i=normalizeSpinnerAngle(t+spinnerArcEnd(t)+r),a=n-i;for(;a<=0;)a+=Math.PI*2;return{start:n,end:i,length:a}}function spinnerProgressAt(e){let t=n*53;return(e%t+t)%t/n*Math.PI*2}export{u as ADW_SPINNER_CONTRACT_DISTANCE,p as ADW_SPINNER_CYCLES_PER_LOOP,f as ADW_SPINNER_CYCLE_LENGTH,l as ADW_SPINNER_EXTEND_DISTANCE,s as ADW_SPINNER_IDLE_DISTANCE,o as ADW_SPINNER_MAX_ARC_LENGTH,a as ADW_SPINNER_MIN_ARC_LENGTH,d as ADW_SPINNER_N_CYCLES,c as ADW_SPINNER_OVERLAP_DISTANCE,n as ADW_SPINNER_SPIN_DURATION_MS,r as ADW_SPINNER_START_ANGLE,m as ADW_SPINNER_STILL_PROGRESS,i as ADW_SPINNER_TRACK_OPACITY,normalizeSpinnerAngle,spinnerArc,spinnerArcEnd,spinnerArcStart,spinnerProgressAt};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";const e=`More Options`,t=.5,n={none:`open-menu-symbolic`,down:`pan-down-symbolic`,up:`pan-up-symbolic`,left:`pan-start-symbolic`,right:`pan-end-symbolic`},r={...n,none:`pan-down-symbolic`},i=[`none`,`up`,`down`,`left`,`right`];function splitButtonStyleClasses(e,t){let n=[];return t!==null&&t.length>0&&n.push(`image-button`),e!==null&&e.length>0&&n.push(`text-button`),n}function resolveDropdownTooltip(t){return typeof t==`string`&&t.length>0?{text:t,markup:!0}:{text:e,markup:!1}}function menuButtonArrowIcon(e){return n[e]??n.down}function splitButtonArrowIcon(e){return r[e]??r.down}function splitButtonPopupDirection(e){return e===`none`||!i.includes(e)?`down`:e}const a=splitButtonPopupDirection;function isSplitButtonDirection(e){return typeof e==`string`&&i.includes(e)}function splitButtonRootState(e,t){return{active:e.active||t.active||e.keyboardActivating||t.keyboardActivating,checked:e.checked||t.checked}}function parseMenuEntries(e){if(!e)return[];let t;try{t=JSON.parse(e)}catch{return[]}if(!Array.isArray(t))return[];let n=[];for(let e of t){if(typeof e!=`object`||!e||!(`label`in e))continue;let t=e,r={label:String(t.label)};typeof t.action==`string`&&(r.action=t.action),typeof t.id==`string`&&(r.id=t.id),typeof t.icon==`string`&&(r.icon=t.icon),n.push(r)}return n}function internalContent(e){return Object.freeze({adwInternalContent:e})}function derivedPopover(){return Object.freeze({adwDerivedPopover:!0})}var SplitButtonState=class{constructor(){this._mode=`empty`,this._label=null,this._iconName=null,this._child=null,this._useUnderline=!1,this._menuModel=null,this._popover=null,this._direction=`down`,this._dropdownTooltip=``,this._open=!1,this._listeners=new Set}subscribe(e){return this._listeners.add(e),()=>{this._listeners.delete(e)}}_emit(e,t){let n={mode:this._mode,label:this._label,iconName:this._iconName,child:this._child,styleClasses:this.styleClasses,dropdownEnabled:this.dropdownEnabled,open:this._open,notified:e,interactive:t};for(let e of[...this._listeners])e(n)}get mode(){return this._mode}get label(){return this._label}setLabel(e){if(typeof e!=`string`||e===this._label)return!1;let t=[];return this._iconName!==null&&t.push(`icon-name`),this._child!==null&&t.push(`child`),this._child=this._mode===`label`?this._child:internalContent(`label`),this._mode=`label`,this._label=e,this._iconName=null,t.push(`label`),this._emit(t,!1),!0}get iconName(){return this._iconName}setIconName(e){if(typeof e!=`string`||e===this._iconName)return!1;let t=[];return this._label!==null&&t.push(`label`),this._child!==null&&t.push(`child`),this._child=this._mode===`icon`?this._child:internalContent(`icon`),this._mode=`icon`,this._iconName=e,this._label=null,t.push(`icon-name`),this._emit(t,!1),!0}get child(){return this._child}setChild(e){let t=e??null;if(t===this._child)return!1;let n=[];return this._label!==null&&n.push(`label`),this._iconName!==null&&n.push(`icon-name`),this._mode=t===null?`empty`:`child`,this._child=t,this._label=null,this._iconName=null,n.push(`child`),this._emit(n,!1),!0}get styleClasses(){return splitButtonStyleClasses(this._label,this._iconName)}get useUnderline(){return this._useUnderline}setUseUnderline(e){let t=!!e;return t===this._useUnderline?!1:(this._useUnderline=t,this._emit([`use-underline`],!1),!0)}get menuModel(){return this._menuModel}setMenuModel(e){let t=e&&e.length>0?e:null;if(t===this._menuModel)return!1;let n=t===null?null:derivedPopover(),r=[];return n!==this._popover&&r.push(`popover`),r.push(`menu-model`),this._menuModel=t,this._popover=n,this.dropdownEnabled||(this._open=!1),this._emit(r,!1),!0}get popover(){return this._popover}setPopover(e){let t=e??null;if(t===this._popover)return!1;let n=[];return this._menuModel!==null&&n.push(`menu-model`),n.push(`popover`),this._menuModel=null,this._popover=t,this.dropdownEnabled||(this._open=!1),this._emit(n,!1),!0}get dropdownEnabled(){return this._menuModel!==null||this._popover!==null}get direction(){return this._direction}setDirection(e){return!isSplitButtonDirection(e)||e===this._direction?!1:(this._direction=e,this._emit([`direction`],!1),!0)}get arrowIcon(){return splitButtonArrowIcon(this._direction)}get dropdownTooltip(){return this._dropdownTooltip}setDropdownTooltip(e){return typeof e!=`string`||e===this._dropdownTooltip?!1:(this._dropdownTooltip=e,this._emit([`dropdown-tooltip`],!1),!0)}get open(){return this._open}_setOpen(e,t){return e&&!this.dropdownEnabled||e===this._open?!1:(this._open=e,this._emit([],t),!0)}openMenu(){return this._setOpen(!0,!1)}closeMenu(){return this._setOpen(!1,!1)}toggleMenu(){return this._setOpen(!this._open,!0)}activateMenuEntry(e){let t=this._menuModel;if(t===null||!Number.isInteger(e)||e<0||e>=t.length)return null;let n=t[e];return this._setOpen(!1,!0),n}};export{e as DEFAULT_DROPDOWN_TOOLTIP,t as SPLIT_BUTTON_DISABLED_OPACITY,SplitButtonState,isSplitButtonDirection,menuButtonArrowIcon,a as menuButtonPopupDirection,parseMenuEntries,resolveDropdownTooltip,splitButtonArrowIcon,splitButtonPopupDirection,splitButtonRootState,splitButtonStyleClasses};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";import{glibClamp as e}from"./glib.js";import{adwLengthToPx as t}from"./length-unit.js";const n=180,r=280,i=.25,a=`sp`,o=32;function isSidebarAtVisualStart(e,t=`ltr`){return e===`start`==(t!==`rtl`)}function fractionOf(e){return e.sidebarWidthFraction??.25}function resolveSidebarBounds(e,n=0,r={}){let i=e.sidebarWidthUnit??`sp`,a=e.dpi??96,o=r.ceil?Math.ceil:Math.trunc,s=t(i,e.minSidebarWidth??180,a),c=t(i,e.maxSidebarWidth??280,a),l=o(Math.max(n,s));return{min:l,max:o(Math.max(l,c))}}function resolveNaturalSidebarWidth(t,n,r){return r>=1?n.max:e(Math.ceil(t*r/(1-r)),n.min,n.max)}function resolveNavigationSidebarWidth(t){let n=resolveSidebarBounds(t,t.sidebarChildMin??0,{ceil:!0}),r=Math.min(n.max,t.totalWidth-(t.contentMin??0));return e(Math.trunc(t.totalWidth*fractionOf(t)),n.min,r)}function resolveOverlaySidebarWidth(t){let n=resolveSidebarBounds(t,t.sidebarChildMin??0,{ceil:!0});if(t.collapsed)return e(t.totalWidth,n.min,n.max);let r=e(Math.trunc(t.totalWidth*fractionOf(t)),n.min,n.max);return Math.min(r,t.totalWidth-(t.contentMin??0))}function measureSplitViewHorizontal(t){let n=e(t.showProgress??1,0,1);return{minimum:Math.trunc(t.bounds.min*n)+t.contentMin,natural:Math.trunc(t.sidebarNatural*n)+t.contentNatural}}function layoutNavigationSplitView(e){let{totalWidth:t,sidebarWidth:n}=e,r=t-n;return isSidebarAtVisualStart(e.sidebarPosition??`start`,e.direction??`ltr`)?{sidebar:{x:0,width:n},content:{x:n,width:r}}:{sidebar:{x:r,width:n},content:{x:0,width:r}}}function layoutOverlaySplitView(e){let{totalWidth:t,showProgress:n,collapsed:r}=e,i=e.sidebarWidth,a=isSidebarAtVisualStart(e.sidebarPosition??`start`,e.direction??`ltr`),o=i,s=Math.trunc(i*n),c=s>i,l={shieldVisible:r&&n>0,sidebarPainted:n>0,shadowProgress:1-Math.min(n,+!!r),shadowSide:a?`left`:`right`};return r?(c&&(o=s),{sidebar:{x:a?c?0:s-i:t-s,width:o},content:{x:0,width:t},...l}):(c&&(o=s,s=i),a?{sidebar:{x:s-i,width:o},content:{x:s,width:t-s},...l}:{sidebar:{x:t-(c?o:s),width:o},content:{x:0,width:t-s},...l})}function tagsConflict(e,t){return e==null||t==null?!1:e===t}function resolveNavigationStack(e){let{hasSidebar:t,hasContent:n,showContent:r}=e,i=e.sidebarPosition===`end`;if(e.changingPage&&t&&n)return r?i?{stack:[`content`],transition:`pop`,page:`sidebar`}:{stack:[`sidebar`,`content`],transition:`push`,page:`content`}:i?{stack:[`content`,`sidebar`],transition:`push`,page:`sidebar`}:{stack:[`sidebar`],transition:`pop`,page:`content`};let a=[];return i?(n&&a.push(`content`),t&&(!r||!n)&&a.push(`sidebar`)):(t&&a.push(`sidebar`),n&&(r||!t)&&a.push(`content`)),{stack:a,transition:`replace`,page:null}}function resolveNavigationAction(e){if(e.action===`pop`)return e.showContent&&e.hasSidebar&&e.hasContent?{kind:`set-show-content`,showContent:!1}:{kind:`delegate`};let{tag:t}=e;return e.contentTag!==null&&e.contentTag!==void 0&&t===e.contentTag?e.showContent&&e.collapsed?{kind:`already-in-stack`,tag:t}:{kind:`set-show-content`,showContent:!0}:e.sidebarTag!==null&&e.sidebarTag!==void 0&&t===e.sidebarTag?{kind:`already-in-stack`,tag:t}:{kind:`delegate`}}const s={alreadyInStack:e=>`Page with the tag '${e}' is already in the navigation stack`,notFound:e=>`No page with the tag '${e}' found in AdwNavigationSplitView`,sidebarCollision:e=>`Trying to add sidebar with the tag '${e}' to AdwNavigationSplitView, but content already has the same tag`,contentCollision:e=>`Trying to add content with the tag '${e}' to AdwNavigationSplitView, but sidebar already has the same tag`,sidebarTagCollision:e=>`Trying to set the sidebar's tag to '${e}', but the content already has the same tag`,contentTagCollision:e=>`Trying to set the content's tag to '${e}', but the sidebar already has the same tag`};var NavigationSplitViewState=class{constructor(e={}){this._sidebar=null,this._content=null,this._sidebarTag=null,this._contentTag=null,this._listeners=new Set,this._sidebarPosition=e.sidebarPosition??`start`,this._collapsed=e.collapsed??!1,this._showContent=e.showContent??!1,this._handlers={onCritical:e.onCritical,onDelegate:e.onDelegate}}subscribe(e){return this._listeners.add(e),()=>{this._listeners.delete(e)}}_emit(e,t,n=!1){let r={property:e,interactive:n,plan:t};for(let e of[...this._listeners])e(r)}_critical(e){this._handlers.onCritical?.(e)}_plan(e=!1){return resolveNavigationStack({hasSidebar:this._sidebar!==null,hasContent:this._content!==null,sidebarPosition:this._sidebarPosition,showContent:this._showContent,changingPage:e})}get collapsed(){return this._collapsed}get showContent(){return this._showContent}get sidebarPosition(){return this._sidebarPosition}get sidebar(){return this._sidebar}get content(){return this._content}get sidebarTag(){return this._sidebarTag}get contentTag(){return this._contentTag}get stack(){return this._plan()}get visiblePane(){let{stack:e}=this._plan();return e[e.length-1]??null}setSidebar(e){if(e===this._sidebar)return!1;let t=e?.tag??null;return tagsConflict(t,this._contentTag)?(this._critical(s.sidebarCollision(t)),!1):(this._sidebar=e,this._sidebarTag=t,this._emit(`sidebar`,this._plan()),!0)}setContent(e){if(e===this._content)return!1;let t=e?.tag??null;return tagsConflict(this._sidebarTag,t)?(this._critical(s.contentCollision(t)),!1):(this._content=e,this._contentTag=t,this._emit(`content`,this._plan()),!0)}setTag(e,t){return e===`sidebar`?(this._sidebarTag=t,tagsConflict(this._sidebarTag,this._contentTag)?(this._critical(s.sidebarTagCollision(t)),this._sidebarTag=null,!1):!0):(this._contentTag=t,tagsConflict(this._sidebarTag,this._contentTag)?(this._critical(s.contentTagCollision(t)),this._contentTag=null,!1):!0)}setSidebarPosition(e){return e===this._sidebarPosition?!1:(this._sidebarPosition=e,this._emit(`sidebar-position`,this._plan()),!0)}setCollapsed(e){let t=!!e;return t===this._collapsed?!1:(this._collapsed=t,this._emit(`collapsed`,this._plan()),!0)}setShowContent(e,t=!1){let n=!!e;if(n===this._showContent)return!1;this._showContent=n;let r=this._collapsed&&this._sidebar!==null&&this._content!==null;return this._emit(`show-content`,this._plan(r),t),!0}push(e){return this._runAction(resolveNavigationAction({action:`push`,tag:e,sidebarTag:this._sidebarTag,contentTag:this._contentTag,showContent:this._showContent,collapsed:this._collapsed}),`push`,e)}pop(){return this._runAction(resolveNavigationAction({action:`pop`,hasSidebar:this._sidebar!==null,hasContent:this._content!==null,showContent:this._showContent}),`pop`)}_runAction(e,t,n){switch(e.kind){case`set-show-content`:return this.setShowContent(e.showContent,!0),e;case`already-in-stack`:return this._critical(s.alreadyInStack(e.tag)),e;default:return this._handlers.onDelegate?.(t,n)||t===`pop`?e:(this._critical(s.notFound(n??``)),{kind:`not-found`,tag:n??``})}}};const c={animate(e){return e.onValue(e.to),e.onDone(),{cancel:()=>{}}}};var OverlaySplitViewState=class{constructor(e={}){this._swipeActive=!1,this._animation=null,this._listeners=new Set,this._showSidebar=e.showSidebar??!0,this._collapsed=e.collapsed??!1,this._pinSidebar=e.pinSidebar??!1,this._sidebarPosition=e.sidebarPosition??`start`,this._enableShowGesture=e.enableShowGesture??!0,this._enableHideGesture=e.enableHideGesture??!0,this._showProgress=+!!this._showSidebar,this._animator=e.animator??c}subscribe(e){return this._listeners.add(e),()=>{this._listeners.delete(e)}}_emit(e,t=!1){let n={property:e,showSidebar:this._showSidebar,collapsed:this._collapsed,showProgress:this._showProgress,shieldVisible:this.shieldVisible,interactive:t};for(let e of[...this._listeners])e(n)}get showSidebar(){return this._showSidebar}get collapsed(){return this._collapsed}get pinSidebar(){return this._pinSidebar}get sidebarPosition(){return this._sidebarPosition}get enableShowGesture(){return this._enableShowGesture}get enableHideGesture(){return this._enableHideGesture}get showProgress(){return this._showProgress}get shieldVisible(){return this._collapsed&&this._showProgress>0}get sidebarPainted(){return this._showProgress>0}get sidebarFocusable(){return!this._collapsed||this._showSidebar}get contentFocusable(){return!this._collapsed||!this._showSidebar}setShowSidebar(e,t={}){let n=!!e;if(n===this._showSidebar)return!1;this._showSidebar=n;let r=+!!n,i=t.animate??!0;return i||(this._cancelAnimation(),this._showProgress=r),this._emit(`show-sidebar`,t.interactive??!1),i&&!this._swipeActive&&this._startAnimation(r,t.velocity??0),!0}setCollapsed(e){let t=!!e;return t===this._collapsed?!1:(this._collapsed=t,this._pinSidebar||this.setShowSidebar(!t,{animate:!1}),this._emit(`collapsed`),!0)}setPinSidebar(e){let t=!!e;return t===this._pinSidebar?!1:(this._pinSidebar=t,this._emit(`pin-sidebar`),!0)}setSidebarPosition(e){return e===this._sidebarPosition?!1:(this._sidebarPosition=e,this._emit(`sidebar-position`),!0)}setEnableShowGesture(e){let t=!!e;return t===this._enableShowGesture?!1:(this._enableShowGesture=t,!0)}setEnableHideGesture(e){let t=!!e;return t===this._enableHideGesture?!1:(this._enableHideGesture=t,!0)}setShowProgress(e){this._showProgress=e,this._emit(`show-progress`)}escape(){return this._showProgress<2**-52||!this._collapsed?!1:(this.setShowSidebar(!1,{interactive:!0}),!0)}dismissShield(){return this.setShowSidebar(!1,{interactive:!0})}get swipeActive(){return this._swipeActive}beginSwipe(){this._cancelAnimation(),this._swipeActive=!0}endSwipe(e,t=0){if(!this._swipeActive)return{kind:`animate`,to:this._showProgress};this._swipeActive=!1;let n=resolveSwipeRelease({to:e,showSidebar:this._showSidebar});return n.kind===`animate`?this._startAnimation(n.to,t):this.setShowSidebar(n.showSidebar,{velocity:t,interactive:!0}),n}get snapPoints(){return resolveSwipeSnapPoints({showProgress:this._showProgress,enableShowGesture:this._enableShowGesture,enableHideGesture:this._enableHideGesture,swipeActive:this._swipeActive})}_cancelAnimation(){this._animation?.cancel(),this._animation=null}_startAnimation(e,t){this._cancelAnimation();let n=!1,r=this._animator.animate({from:this._showProgress,to:e,velocity:t,clamp:e<.5,onValue:e=>this.setShowProgress(e),onDone:()=>{n=!0,this._animation=null}});n||(this._animation=r)}};function resolveSwipeSnapPoints(e){let t=e.showProgress>0||e.enableShowGesture||e.swipeActive,n=e.showProgress<1||e.enableHideGesture||e.swipeActive;return t&&n?[0,1]:[+!!t]}function resolveSwipeStart(e){let t=Math.abs(e.showProgress-1)<2**-52||e.showProgress>1,n=Math.abs(e.showProgress)<2**-52||e.showProgress<0;return!(t&&!e.collapsed&&e.direction===`forward`||n&&!e.enableShowGesture||t&&!e.enableHideGesture)}function resolveSwipeRelease(e){return e.to>0===e.showSidebar?{kind:`animate`,to:e.to}:{kind:`set-show-sidebar`,showSidebar:e.to>0}}function swipeCancelProgress(e){let t=e<0?-Math.round(-e):Math.round(e);return t===0?0:t}function resolveSwipeArea(e){if(!e.isDrag)return{x:0,y:0,width:0,height:0};let t=Math.max(Math.trunc(e.sidebarWidth*e.showProgress),32);return{x:isSidebarAtVisualStart(e.sidebarPosition??`start`,e.direction??`ltr`)?0:e.totalWidth-t,y:0,width:t,height:e.totalHeight}}export{o as ADW_SWIPE_BORDER,r as DEFAULT_MAX_SIDEBAR_WIDTH,n as DEFAULT_MIN_SIDEBAR_WIDTH,i as DEFAULT_SIDEBAR_WIDTH_FRACTION,a as DEFAULT_SIDEBAR_WIDTH_UNIT,c as INSTANT_SPLIT_VIEW_ANIMATOR,s as NAVIGATION_SPLIT_VIEW_CRITICALS,NavigationSplitViewState,OverlaySplitViewState,isSidebarAtVisualStart,layoutNavigationSplitView,layoutOverlaySplitView,measureSplitViewHorizontal,resolveNaturalSidebarWidth,resolveNavigationAction,resolveNavigationSidebarWidth,resolveNavigationStack,resolveOverlaySidebarWidth,resolveSidebarBounds,resolveSwipeArea,resolveSwipeRelease,resolveSwipeSnapPoints,resolveSwipeStart,swipeCancelProgress,tagsConflict};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";import{ViewStackState as e}from"./view-stack.js";const t=!0;function tabsRevealed(e){return e.autohide?e.nPages>1||e.nPinnedPages>=1||e.isTransferringPage:!0}function tabCloseVisible(e){return e.pinned?!1:e.hovering&&e.fullyVisible||e.selected||e.dragging}function tabTooltip(e){return e.tooltip===``?e.title:e.tooltip}function tabTooltipIsMarkup(e){return e.tooltip!==``}function tabIconState(e,t){let n=e.indicatorIcon,r=e.icon;return!e.loading&&e.pinned&&r===null&&(r=t),{icon:r,spinner:e.loading,iconVisible:(r!==null||e.loading)&&(!e.pinned||n===null),indicatorVisible:n!==null}}function isDescendantOfPage(e,t,n){let r=t;for(;r!==null&&r!==n;)r=e.find(e=>e.id===r)?.parentId??null;return r===n}function successorAfterClose(e,t,n){if(t!==n)return n;let r=e.findIndex(e=>e.id===t);if(r<0)return n;let i=e[r].parentId;if(i!==null&&r>0){let t=e[r-1];if(isDescendantOfPage(e,t.id,i))return t.id;let n=e.find(e=>e.id===i);if(n&&t.pinned&&n.pinned)return n.id}return r<e.length-1?e[r+1].id:r>0?e[r-1].id:null}function assertionDiagnostic(e,t){return`${e}: assertion '${t}' failed`}var TabViewState=class{constructor(t={}){this._stack=new e,this._selectionListeners=new Set,this._pagesListeners=new Set,this._diagnostics=[],this._selectedId=null,this._deferSelection=!1,this._deferredSelection=null,this._pagesSource=null,this._pagesView=null,this._handlers=t,this._stack.subscribe(e=>{let t=this._selectedId,n=e.page?.content?.id??null;this._selectedId=n;let r={selectedId:n,selectedIndex:e.index,previousId:t,interactive:e.interactive};this._deferSelection?this._deferredSelection=r:this._emitSelection(r)})}subscribe(e){return this._selectionListeners.add(e),()=>{this._selectionListeners.delete(e)}}subscribePages(e){return this._pagesListeners.add(e),()=>{this._pagesListeners.delete(e)}}_emitSelection(e){for(let t of[...this._selectionListeners])t(e)}_emitPages(e){for(let t of[...this._pagesListeners])t(e)}_flushDeferredSelection(){let e=this._deferredSelection;e&&(this._deferredSelection=null,this._emitSelection(e))}get pages(){let e=this._stack.pages;return(this._pagesSource!==e||this._pagesView===null)&&(this._pagesSource=e,this._pagesView=Object.freeze(e.map(e=>e.content))),this._pagesView}get nPages(){return this._stack.count}get nPinnedPages(){let e=this.pages.findIndex(e=>!e.pinned);return e<0?this.pages.length:e}getNthPage(e){return!Number.isInteger(e)||e<0||e>=this.nPages?null:this.pages[e]}getPagePosition(e){return this._stack.indexOfName(e)}getPage(e){return this._recordOf(e)}isClosing(e){return this._recordOf(e)?.closing??!1}get diagnostics(){return this._diagnostics}get selectedId(){return this._stack.visiblePage?.content?.id??null}get selectedIndex(){return this._stack.visibleIndex}get selectedPage(){return this._stack.visiblePage?.content??null}setSelectedPage(e,t=!0){if(e===null)return this.nPages>0&&this._diagnostics.push(assertionDiagnostic(`adw_tab_view_set_selected_page`,`ADW_IS_TAB_PAGE (selected_page)`)),!1;let n=this.getPagePosition(e);return n<0?(this._diagnostics.push(assertionDiagnostic(`adw_tab_view_set_selected_page`,`page_belongs_to_this_view (self, selected_page)`)),!1):this._stack.setVisibleIndex(n,t)}selectNthPage(e){return this._stack.setVisibleIndex(e,!0)}selectPreviousPage(){let e=this.selectedIndex;return e<=0?!1:this._stack.setVisibleIndex(e-1,!0)}selectNextPage(){let e=this.selectedIndex;return e<0||e>=this.nPages-1?!1:this._stack.setVisibleIndex(e+1,!0)}selectFirstPage(){let e=this.selectedPage;if(!e)return!1;let t=e.pinned,n=this.getNthPage(t?0:this.nPinnedPages);return n===e&&!t&&(n=this.getNthPage(0)),!n||n===e?!1:this.setSelectedPage(n.id)}selectLastPage(){let e=this.selectedPage;if(!e)return!1;let t=e.pinned,n=this.getNthPage((t?this.nPinnedPages:this.nPages)-1);return n===e&&t&&(n=this.getNthPage(this.nPages-1)),!n||n===e?!1:this.setSelectedPage(n.id)}cycleNextPage(){return!this.selectedPage||this.nPages<=1?!1:this.selectNextPage()?!0:this._stack.setVisibleIndex(0,!0)}cyclePreviousPage(){return!this.selectedPage||this.nPages<=1?!1:this.selectPreviousPage()?!0:this._stack.setVisibleIndex(this.nPages-1,!0)}addPage(e,t=null){if(t===null)return this._insert(e,this.nPages,!1,null);let n=this.getPagePosition(t);if(n<0)return this._diagnostics.push(assertionDiagnostic(`adw_tab_view_add_page`,`page_belongs_to_this_view (self, parent)`)),-1;let r=this.pages[n].pinned?this.nPinnedPages-1:n;do if(r++,r>=this.nPages)break;while(isDescendantOfPage(this.pages,this.pages[r].id,t));return this._insert(e,r,!1,t)}insertPage(e,t){return!Number.isInteger(t)||t<this.nPinnedPages?(this._diagnostics.push(assertionDiagnostic(`adw_tab_view_insert`,`position >= self->n_pinned_pages`)),-1):t>this.nPages?(this._diagnostics.push(assertionDiagnostic(`adw_tab_view_insert`,`position <= self->n_pages`)),-1):this._insert(e,t,!1,null)}prependPage(e){return this._insert(e,this.nPinnedPages,!1,null)}appendPage(e){return this._insert(e,this.nPages,!1,null)}insertPinnedPage(e,t){return!Number.isInteger(t)||t<0?(this._diagnostics.push(assertionDiagnostic(`adw_tab_view_insert_pinned`,`position >= 0`)),-1):t>this.nPinnedPages?(this._diagnostics.push(assertionDiagnostic(`adw_tab_view_insert_pinned`,`position <= self->n_pinned_pages`)),-1):this._insert(e,t,!0,null)}prependPinnedPage(e){return this._insert(e,0,!0,null)}appendPinnedPage(e){return this._insert(e,this.nPinnedPages,!0,null)}_insert(e,t,n,r){if(this.getPagePosition(e.id)>=0)return this._diagnostics.push(assertionDiagnostic(`adw_tab_view_insert`,`page id '${e.id}' is unique`)),-1;let i={id:e.id,title:e.title??``,tooltip:e.tooltip??``,icon:e.icon??null,indicatorIcon:e.indicatorIcon??null,loading:e.loading??!1,needsAttention:e.needsAttention??!1,pinned:n,parentId:r,closing:!1,content:e.content};return this._deferSelection=!0,this._stack.insertPage({name:i.id,content:i},t),this._deferSelection=!1,this._emitPages({kind:`attached`,id:i.id,position:t,previousPosition:-1}),this._flushDeferredSelection(),t}setPagePinned(e,t){let n=this.getPagePosition(e);if(n<0)return this._diagnostics.push(assertionDiagnostic(`adw_tab_view_set_page_pinned`,`page_belongs_to_this_view (self, page)`)),-1;let r=this._recordAt(n),i=!!t;if(r.pinned===i)return-1;let a=i?this.nPinnedPages:this.nPinnedPages-1;return r.pinned=i,n!==a&&this._stack.movePage(n,a),this._emitPages({kind:`pinned`,id:e,position:a,previousPosition:n}),a}closePage(e){let t=this._recordOf(e);if(!t)return this._diagnostics.push(assertionDiagnostic(`adw_tab_view_close_page`,`page_belongs_to_this_view (self, page)`)),!1;if(t.closing)return!1;t.closing=!0;let n=this._handlers.onClosePage?this._handlers.onClosePage(t):!t.pinned;return n!==`defer`&&this.closePageFinish(e,n),!0}closePageFinish(e,t){let n=this._recordOf(e);return n?n.closing?(n.closing=!1,t?this.detachPage(e)!==null:!1):(this._diagnostics.push(assertionDiagnostic(`adw_tab_view_close_page_finish`,`page->closing`)),!1):(this._diagnostics.push(assertionDiagnostic(`adw_tab_view_close_page_finish`,`page_belongs_to_this_view (self, page)`)),!1)}detachPage(e){let t=this.getPagePosition(e);if(t<0)return this._diagnostics.push(assertionDiagnostic(`adw_tab_view_detach_page`,`page_belongs_to_this_view (self, page)`)),null;let n=this._recordAt(t),r=successorAfterClose(this.pages,e,this.selectedId);r!==null&&r!==this.selectedId&&this.setSelectedPage(r,!1);let i=this.selectedId===e;this._stack.removePage(e);for(let t of this._records())t.parentId===e&&(t.parentId=n.parentId);return i&&(this._selectedId=null,this._emitSelection({selectedId:null,selectedIndex:-1,previousId:e,interactive:!1})),this._emitPages({kind:`detached`,id:e,position:t,previousPosition:t}),n}closeOtherPages(e){let t=this.getPagePosition(e);if(t<0){this._diagnostics.push(assertionDiagnostic(`adw_tab_view_close_other_pages`,`page_belongs_to_this_view (self, page)`));return}let n=this.pages.map(e=>e.id);for(let e=n.length-1;e>=0;e--)e!==t&&this.closePage(n[e])}closePagesBefore(e){let t=this.getPagePosition(e);if(t<0){this._diagnostics.push(assertionDiagnostic(`adw_tab_view_close_pages_before`,`page_belongs_to_this_view (self, page)`));return}let n=this.pages.map(e=>e.id);for(let e=t-1;e>=0;e--)this.closePage(n[e])}closePagesAfter(e){let t=this.getPagePosition(e);if(t<0){this._diagnostics.push(assertionDiagnostic(`adw_tab_view_close_pages_after`,`page_belongs_to_this_view (self, page)`));return}let n=this.pages.map(e=>e.id);for(let e=n.length-1;e>t;e--)this.closePage(n[e])}reorderPage(e,t){let n=this.getPagePosition(e);if(n<0)return this._diagnostics.push(assertionDiagnostic(`adw_tab_view_reorder_page`,`page_belongs_to_this_view (self, page)`)),!1;let r=this.pages[n].pinned,i=r?0:this.nPinnedPages,a=r?this.nPinnedPages:this.nPages;return!Number.isInteger(t)||t<i||t>=a?(this._diagnostics.push(assertionDiagnostic(`adw_tab_view_reorder_page`,r?`position < self->n_pinned_pages`:`position >= self->n_pinned_pages`)),!1):n===t?!1:(this._stack.movePage(n,t),this._emitPages({kind:`reordered`,id:e,position:t,previousPosition:n}),!0)}reorderBackward(e){let t=this.getPagePosition(e);return t<0?this._reorderMissing(e):t<=(this.pages[t].pinned?0:this.nPinnedPages)?!1:this.reorderPage(e,t-1)}reorderForward(e){let t=this.getPagePosition(e);return t<0?this._reorderMissing(e):t>=(this.pages[t].pinned?this.nPinnedPages:this.nPages)-1?!1:this.reorderPage(e,t+1)}reorderFirst(e){let t=this.getPagePosition(e);return t<0?this._reorderMissing(e):this.reorderPage(e,this.pages[t].pinned?0:this.nPinnedPages)}reorderLast(e){let t=this.getPagePosition(e);return t<0?this._reorderMissing(e):this.reorderPage(e,(this.pages[t].pinned?this.nPinnedPages:this.nPages)-1)}_reorderMissing(e){return this._diagnostics.push(assertionDiagnostic(`adw_tab_view_reorder_page`,`page_belongs_to_this_view (self, '${e}')`)),!1}setPageTitle(e,t){return this._update(e,e=>{let n=t??``;return e.title===n?!1:(e.title=n,!0)})}setPageTooltip(e,t){return this._update(e,e=>{let n=t??``;return e.tooltip===n?!1:(e.tooltip=n,!0)})}setPageIcon(e,t){return this._update(e,e=>e.icon===t?!1:(e.icon=t,!0))}setPageIndicatorIcon(e,t){return this._update(e,e=>e.indicatorIcon===t?!1:(e.indicatorIcon=t,!0))}setPageLoading(e,t){return this._update(e,e=>{let n=!!t;return e.loading===n?!1:(e.loading=n,!0)})}setPageNeedsAttention(e,t){return this._update(e,e=>{let n=!!t;return e.needsAttention===n?!1:(e.needsAttention=n,!0)})}_update(e,t){let n=this.getPagePosition(e);return n<0?(this._diagnostics.push(assertionDiagnostic(`adw_tab_page_set_property`,`ADW_IS_TAB_PAGE (self)`)),!1):t(this._recordAt(n))?(this._emitPages({kind:`updated`,id:e,position:n,previousPosition:n}),!0):!1}_records(){return this._stack.pages.map(e=>e.content)}_recordAt(e){return this._stack.pages[e].content}_recordOf(e){let t=this.getPagePosition(e);return t<0?null:this._recordAt(t)}};export{t as DEFAULT_TAB_AUTOHIDE,TabViewState,isDescendantOfPage,successorAfterClose,tabCloseVisible,tabIconState,tabTooltip,tabTooltipIsMarkup,tabsRevealed};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";function resolvePageTitle(e,t){return e??t}const e=/^[A-Za-z0-9_-]+$/;function normalizeIconName(t){let n=(t??``).replace(/-symbolic$/,``);return e.test(n)?n:``}function nameNotFoundDiagnostic(e){return`Child name '${e}' not found in AdwViewStack`}function duplicateNameDiagnostic(e){return`While adding page: duplicate child name in AdwViewStack: ${e}`}var ViewStackState=class{constructor(){this._pages=[],this._visibleIndex=-1,this._listeners=new Set,this._diagnostics=[],this._pagesView=null}subscribe(e){return this._listeners.add(e),()=>{this._listeners.delete(e)}}_emit(e){let t=this._pageAt(this._visibleIndex),n={index:this._visibleIndex,name:t?.name??``,title:t?.title??``,page:t,interactive:e};for(let e of[...this._listeners])e(n)}_pageAt(e){return e>=0&&e<this._pages.length?this._pages[e]:void 0}_firstVisibleIndex(){return this._pages.findIndex(e=>e.visible)}_record(e){return{name:e.name,title:resolvePageTitle(e.title,e.name),icon:normalizeIconName(e.icon),content:e.content,visible:e.visible??!0,badgeNumber:Number.isFinite(e.badgeNumber)?Math.trunc(e.badgeNumber):0,needsAttention:e.needsAttention===!0,useUnderline:e.useUnderline===!0}}get pages(){return this._pagesView??=Object.freeze(this._pages.slice()),this._pagesView}get count(){return this._pages.length}indexOfName(e){return this._pages.findIndex(t=>t.name===e)}isSelected(e){return!Number.isInteger(e)||e<0||e>=this._pages.length?!1:e===this._visibleIndex}addPage(e){return this._insertRecord(this._record(e),this._pages.length)}insertPage(e,t){return!Number.isInteger(t)||t<0||t>this._pages.length?null:this._insertRecord(this._record(e),t)}_insertRecord(e,t){return this.indexOfName(e.name)>=0&&this._diagnostics.push(duplicateNameDiagnostic(e.name)),this._pages.splice(t,0,e),this._pagesView=null,this._visibleIndex<0?(e.visible&&(this._visibleIndex=t,this._emit(!1)),e):(t<=this._visibleIndex&&(this._visibleIndex+=1),e)}movePage(e,t){if(!Number.isInteger(e)||!Number.isInteger(t)||e<0||e>=this._pages.length||t<0||t>=this._pages.length||e===t)return!1;let[n]=this._pages.splice(e,1);if(this._pages.splice(t,0,n),this._pagesView=null,this._visibleIndex===e)this._visibleIndex=t;else{let n=this._visibleIndex;n>e&&--n,n>=t&&(n+=1),this._visibleIndex=n}return!0}removePage(e){let t=this.indexOfName(e);return t<0?!1:(this._pages.splice(t,1),this._pagesView=null,t===this._visibleIndex?this._visibleIndex=-1:t<this._visibleIndex&&--this._visibleIndex,!0)}get visibleIndex(){return this._visibleIndex}setVisibleIndex(e,t=!0){return!Number.isInteger(e)||e<0||e>=this._pages.length||e===this._visibleIndex||!this._pages[e].visible?!1:(this._visibleIndex=e,this._emit(t),!0)}get visibleName(){return this._pageAt(this._visibleIndex)?.name??``}setVisibleName(e,t=!0){if(e==null)return!1;let n=this.indexOfName(e);return n<0?(this._diagnostics.push(nameNotFoundDiagnostic(e)),!1):this.setVisibleIndex(n,t)}get visiblePage(){return this._pageAt(this._visibleIndex)}get visibleTitle(){return this._pageAt(this._visibleIndex)?.title??``}setPageVisible(e,t){let n=this.indexOfName(e);if(n<0)return this._diagnostics.push(nameNotFoundDiagnostic(e)),!1;let r=this._pages[n],i=!!t;return r.visible===i?!1:(r.visible=i,this._visibleIndex<0&&i?(this._visibleIndex=n,this._emit(!1),!0):this._visibleIndex===n&&!i?(this._visibleIndex=this._firstVisibleIndex(),this._emit(!1),!0):!1)}get duplicateNames(){let e=new Set,t=[];for(let n of this._pages)e.has(n.name)?t.includes(n.name)||t.push(n.name):e.add(n.name);return t}get diagnostics(){return this._diagnostics}};export{ViewStackState,normalizeIconName,resolvePageTitle};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";import{stripMnemonic as e}from"./glib.js";import{ViewStackState as t}from"./view-stack.js";const n=-1,r=`image-missing`,i=500,a=999,o=[`narrow`,`wide`],s=[`labels`,`icons`,`both`];function isViewSwitcherPolicy(e){return e===`narrow`||e===`wide`}function isInlineViewSwitcherDisplayMode(e){return e===`labels`||e===`icons`||e===`both`}function createViewSwitcherPage(e){return{name:e.name,title:e.title??null,iconName:e.iconName??null,visible:e.visible??!0,useUnderline:e.useUnderline??!1,badgeNumber:normalizeBadgeNumber(e.badgeNumber),needsAttention:e.needsAttention??!1}}function viewSwitcherPageFromStackPage(e){return createViewSwitcherPage({name:e.name,title:e.title,iconName:e.icon.length>0?e.icon:null,visible:e.visible,badgeNumber:e.badgeNumber,needsAttention:e.needsAttention,useUnderline:e.useUnderline})}function viewSwitcherPagesFromStack(e){return e.map(e=>viewSwitcherPageFromStackPage(e))}function isViewSwitcherButtonVisible(e){return e.visible&&(isPresent(e.title)||isPresent(e.iconName))}function viewSwitcherIconName(e){return isPresent(e)&&e.length>0?e:r}function viewSwitcherLabel(t){return isPresent(t.title)?t.useUnderline?e(t.title):t.title:``}function viewSwitcherBadgeLabel(e){let t=normalizeBadgeNumber(e);return t>999?`999+`:t===0?``:String(t)}const c={attentionRequested:`Attention requested.`,badgeOverflow:`Has a badge: more than 999.`,badge:e=>`Has a badge: ${e}.`};function viewSwitcherIndicatorDescription(e,t,n=c){let r=normalizeBadgeNumber(t),i=e?n.attentionRequested:``,a=``;return r>999?a=n.badgeOverflow:r>0&&(a=n.badge(r)),i&&a?`${a} ${i}`:i||a}function inlineToggleTooltip(e,t){return t===`icons`?viewSwitcherLabel(e):``}function shouldRevealViewSwitcherBar(e,t){if(!e)return!1;let n=0;for(let e of t)if(e.visible&&(n++,n>1))return!0;return!1}function viewSwitcherButtonOrientation(e){return e===`wide`?`horizontal`:`vertical`}function buildViewSwitcherButtons(e,t,n,r=c){let i=viewSwitcherButtonOrientation(n);return e.map((e,n)=>({pageIndex:n,name:e.name,label:viewSwitcherLabel(e),iconName:viewSwitcherIconName(e.iconName),visible:isViewSwitcherButtonVisible(e),selected:n===t,orientation:i,badgeLabel:viewSwitcherBadgeLabel(e.badgeNumber),needsAttention:e.needsAttention,description:viewSwitcherIndicatorDescription(e.needsAttention,e.badgeNumber,r)}))}function buildInlineToggles(e,t,n=c){let r=t!==`labels`,i=t!==`icons`,a=[];return e.forEach((e,o)=>{e.visible&&a.push({toggleIndex:a.length,pageIndex:o,name:e.name,label:viewSwitcherLabel(e),iconName:viewSwitcherIconName(e.iconName),showIcon:r,showLabel:i,tooltip:inlineToggleTooltip(e,t),badgeLabel:viewSwitcherBadgeLabel(e.badgeNumber),needsAttention:e.needsAttention,description:viewSwitcherIndicatorDescription(e.needsAttention,e.badgeNumber,n)})}),a}function toggleIndexForPage(e,t){if(!Number.isInteger(t)||t<0||t>=e.length||!e[t].visible)return-1;let n=0;for(let r=0;r<t;r++)e[r].visible&&n++;return n}function pageIndexForToggle(e,t){if(!Number.isInteger(t)||t<0)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r].visible){if(n===t)return r;n++}return-1}var ViewSwitcherDragSwitch=class{constructor(e){this._timers=new Map,this._scheduler=e.scheduler,this._onSwitch=e.onSwitch,this._delay=e.delay??500}enter(e,t){if(!Number.isInteger(e)||e<0||e===t||this._timers.has(e))return!1;let n=this._scheduler.schedule(()=>{this._timers.delete(e),this._onSwitch(e)},this._delay);return this._timers.set(e,n),!0}leave(e){let t=this._timers.get(e);t!==void 0&&(this._timers.delete(e),this._scheduler.cancel(t))}cancel(){for(let e of this._timers.values())this._scheduler.cancel(e);this._timers.clear()}get pending(){return[...this._timers.keys()].sort((e,t)=>e-t)}},ViewSwitcherState=class{constructor(e={}){this._pages=[],this._pagesView=null,this._stack=new t,this._listeners=new Set,this._drag=e.scheduler?new ViewSwitcherDragSwitch({scheduler:e.scheduler,delay:e.dragSwitchDelay,onSwitch:e=>{this.setSelected(e)}}):null,this._subscribeStack()}subscribe(e){return this._listeners.add(e),()=>{this._listeners.delete(e)}}get pages(){return this._pagesView??=Object.freeze(this._pages.slice()),this._pagesView}setPages(e){let n=this.selected,r=n>=0?this.selectedName:null;this._pages=e.map(e=>createViewSwitcherPage(e)),this._pagesView=null;let i=new t;for(let e of this._pages)i.addPage({name:e.name,title:e.title,visible:e.visible});if(r!==null){let e=i.indexOfName(r);e>=0&&i.setVisibleIndex(e,!1)}this._stack=i,this._subscribeStack(),this._drag?.cancel(),(this.selected!==n||this.selectedName!==(r??``))&&this._emit(!1)}get selected(){return this._stack.visibleIndex}get selectedName(){return this._stack.visibleName}get selectedPage(){return this._pages[this.selected]}get count(){return this._pages.length}setSelected(e,t=!0){return this._stack.setVisibleIndex(e,t)}selectName(e,t=!0){return this._stack.setVisibleName(e,t)}setPageVisible(e,t){let n=this._pages.findIndex(t=>t.name===e);if(n<0)return!1;let r=this._pages[n],i=!!t;return r.visible===i?!1:(this._pages[n]={...r,visible:i},this._pagesView=null,this._stack.setPageVisible(e,i))}dragEnter(e){this._drag?.enter(e,this.selected)}dragLeave(e){this._drag?.leave(e)}cancelDrag(){this._drag?.cancel()}get pendingDragSwitches(){return this._drag?.pending??[]}get diagnostics(){return this._stack.diagnostics}_subscribeStack(){this._stack.subscribe(e=>this._emit(e.interactive))}_emit(e){let t=this.selectedPage,n={selected:this.selected,name:t?.name??``,title:t?viewSwitcherLabel(t):``,interactive:e};for(let e of[...this._listeners])e(n)}},ViewSwitcherBarState=class{constructor(){this._reveal=!1,this._revealed=!1,this._pages=[],this._listeners=new Set}subscribe(e){return this._listeners.add(e),()=>{this._listeners.delete(e)}}get reveal(){return this._reveal}get revealed(){return this._revealed}setReveal(e){let t=!!e;return t===this._reveal?!1:(this._reveal=t,this._refresh(),!0)}setPages(e){return this._pages=e,this._refresh()}_refresh(){let e=shouldRevealViewSwitcherBar(this._reveal,this._pages);if(e===this._revealed)return!1;this._revealed=e;let t={reveal:this._reveal,revealed:this._revealed};for(let e of[...this._listeners])e(t);return!0}};function isPresent(e){return e!=null}function normalizeBadgeNumber(e){return typeof e!=`number`||!Number.isFinite(e)?0:Math.max(0,Math.trunc(e))}export{c as DEFAULT_INDICATOR_DESCRIPTION_STRINGS,s as INLINE_VIEW_SWITCHER_DISPLAY_MODES,a as VIEW_SWITCHER_BADGE_LIMIT,i as VIEW_SWITCHER_DRAG_SWITCH_DELAY,r as VIEW_SWITCHER_FALLBACK_ICON,n as VIEW_SWITCHER_NO_SELECTION,o as VIEW_SWITCHER_POLICIES,ViewSwitcherBarState,ViewSwitcherDragSwitch,ViewSwitcherState,buildInlineToggles,buildViewSwitcherButtons,createViewSwitcherPage,inlineToggleTooltip,isInlineViewSwitcherDisplayMode,isViewSwitcherButtonVisible,isViewSwitcherPolicy,pageIndexForToggle,shouldRevealViewSwitcherBar,e as stripMnemonic,toggleIndexForPage,viewSwitcherBadgeLabel,viewSwitcherButtonOrientation,viewSwitcherIconName,viewSwitcherIndicatorDescription,viewSwitcherLabel,viewSwitcherPageFromStackPage,viewSwitcherPagesFromStack};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";import{adwLengthToPx as e,normalizeLengthUnit as t}from"./length-unit.js";const n=[`none`,`fill`,`spread`],r=[`minimum`,`natural`],i=0,a=0,o=`none`,s=!1,c=`natural`,l=-1,u=`px`,d=`start-to-end`,f=[`start-to-end`,`end-to-start`];function normalizeWrapBoxSpacing(e){let t=typeof e==`number`?e:Number.parseFloat(String(e??``));return!Number.isFinite(t)||t<0?0:t}function normalizeWrapBoxAlign(e){let t=typeof e==`number`?e:Number.parseFloat(String(e??``));return Number.isFinite(t)?Math.min(1,Math.max(0,t)):0}function normalizeWrapBoxJustify(e){return n.includes(e)?e:o}function normalizeWrapPolicy(e){return r.includes(e)?e:c}function normalizeNaturalLineLength(e){let t=typeof e==`number`?e:Number.parseFloat(String(e??``));return!Number.isFinite(t)||t<0?-1:Math.trunc(t)}function normalizeWrapBoxLengthUnit(e){return t(e,`px`)}function normalizeWrapBoxPackDirection(e){return f.includes(e)?e:d}function wrapBoxLengthToPx(t,n,r=96){return t<0?-1:e(n,t,r)}function resolveWrapBoxLine(e){let t=e.lastLine&&!e.justifyLastLine?`none`:e.justify;if(t===`none`)return{justify:`none`,growChildren:!1,growGaps:!1,align:e.align};let n=t===`spread`&&e.childrenInLine>1;return{justify:t,growChildren:!n,growGaps:n,align:0}}function wrapPolicyFlexShrink(e){return+(e===`minimum`)}function resolveWrapBoxChildOrder(e){let{children:t,child:n,op:r}=e,i=e.sibling??null;if(i!==null&&i===n)return null;let a=t.indexOf(n);if(r===`insert-after`&&a!==-1||r===`reorder-after`&&a===-1)return null;let o=a===-1?[...t]:t.filter((e,t)=>t!==a);if(i===null)return[n,...o];let s=o.indexOf(i);return s===-1?null:[...o.slice(0,s+1),n,...o.slice(s+1)]}export{a as ADW_WRAP_BOX_DEFAULT_ALIGN,o as ADW_WRAP_BOX_DEFAULT_JUSTIFY,s as ADW_WRAP_BOX_DEFAULT_JUSTIFY_LAST_LINE,u as ADW_WRAP_BOX_DEFAULT_LENGTH_UNIT,d as ADW_WRAP_BOX_DEFAULT_PACK_DIRECTION,i as ADW_WRAP_BOX_DEFAULT_SPACING,c as ADW_WRAP_BOX_DEFAULT_WRAP_POLICY,n as ADW_WRAP_BOX_JUSTIFY_MODES,l as ADW_WRAP_BOX_NATURAL_LINE_LENGTH_UNSET,f as ADW_WRAP_BOX_PACK_DIRECTIONS,r as ADW_WRAP_POLICIES,normalizeNaturalLineLength,normalizeWrapBoxAlign,normalizeWrapBoxJustify,normalizeWrapBoxLengthUnit,normalizeWrapBoxPackDirection,normalizeWrapBoxSpacing,normalizeWrapPolicy,resolveWrapBoxChildOrder,resolveWrapBoxLine,wrapBoxLengthToPx,wrapPolicyFlexShrink};
|