@gjsify/adwaita-core 0.51.1 → 0.53.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.
Files changed (64) hide show
  1. package/lib/esm/accent.js +1 -1
  2. package/lib/esm/appearance.js +2 -0
  3. package/lib/esm/apple-accent.js +1 -0
  4. package/lib/esm/box.js +1 -0
  5. package/lib/esm/conformance/accent.js +1 -1
  6. package/lib/esm/conformance/appearance.js +4 -0
  7. package/lib/esm/conformance/box.js +1 -0
  8. package/lib/esm/conformance/dialog.js +1 -1
  9. package/lib/esm/conformance/index.js +1 -1
  10. package/lib/esm/conformance/label.js +1 -0
  11. package/lib/esm/conformance/rows.js +1 -1
  12. package/lib/esm/conformance/shared-trees.js +1 -1
  13. package/lib/esm/conformance/tags.js +1 -0
  14. package/lib/esm/conformance/value-lists.js +1 -0
  15. package/lib/esm/dialog.js +1 -1
  16. package/lib/esm/gio-menu.js +1 -0
  17. package/lib/esm/gtk-adjustment.js +1 -0
  18. package/lib/esm/gtk-string-list.js +1 -0
  19. package/lib/esm/index.js +1 -1
  20. package/lib/esm/label.js +1 -0
  21. package/lib/esm/markup.js +4 -0
  22. package/lib/esm/rows.js +1 -1
  23. package/lib/esm/shortcut-format.js +1 -0
  24. package/lib/esm/source.js +1 -0
  25. package/lib/esm/tags.js +1 -0
  26. package/lib/esm/tokens.generated.js +1 -1
  27. package/lib/types/accent.d.ts +36 -0
  28. package/lib/types/appearance.d.ts +60 -0
  29. package/lib/types/appearance.spec.d.ts +2 -0
  30. package/lib/types/apple-accent.d.ts +18 -0
  31. package/lib/types/apple-accent.spec.d.ts +2 -0
  32. package/lib/types/box.d.ts +18 -0
  33. package/lib/types/box.spec.d.ts +2 -0
  34. package/lib/types/conformance/accent.d.ts +21 -0
  35. package/lib/types/conformance/appearance.d.ts +13 -0
  36. package/lib/types/conformance/box.d.ts +21 -0
  37. package/lib/types/conformance/dialog.d.ts +123 -1
  38. package/lib/types/conformance/index.d.ts +18 -8
  39. package/lib/types/conformance/label.d.ts +115 -0
  40. package/lib/types/conformance/list.d.ts +1 -1
  41. package/lib/types/conformance/rows.d.ts +29 -0
  42. package/lib/types/conformance/shared-trees.d.ts +155 -5
  43. package/lib/types/conformance/tags.d.ts +46 -0
  44. package/lib/types/conformance/value-lists.d.ts +19 -0
  45. package/lib/types/dialog.d.ts +163 -0
  46. package/lib/types/gio-menu.d.ts +46 -0
  47. package/lib/types/gtk-adjustment.d.ts +73 -0
  48. package/lib/types/gtk-adjustment.spec.d.ts +2 -0
  49. package/lib/types/gtk-string-list.d.ts +70 -0
  50. package/lib/types/gtk-string-list.spec.d.ts +2 -0
  51. package/lib/types/index.d.ts +21 -5
  52. package/lib/types/label.d.ts +135 -0
  53. package/lib/types/label.spec.d.ts +2 -0
  54. package/lib/types/markup.d.ts +14 -0
  55. package/lib/types/markup.spec.d.ts +2 -0
  56. package/lib/types/rows.d.ts +20 -0
  57. package/lib/types/shortcut-format.d.ts +25 -0
  58. package/lib/types/shortcut-format.spec.d.ts +2 -0
  59. package/lib/types/source.d.ts +94 -0
  60. package/lib/types/source.spec.d.ts +2 -0
  61. package/lib/types/tags.d.ts +48 -0
  62. package/lib/types/tags.spec.d.ts +2 -0
  63. package/lib/types/tokens.generated.d.ts +1 -1
  64. package/package.json +12 -4
@@ -14,22 +14,33 @@ export { RadioGroupState, resolveCheckState } from './checks.js';
14
14
  export type { AdwCheckState, RadioGroupChange, RadioGroupListener } from './checks.js';
15
15
  export { AdwBreakpoint, evaluateBreakpointCondition, parseBreakpointCondition } from './breakpoint.js';
16
16
  export type { AdwBreakpointHandlers, BreakpointBound, BreakpointConditionGroup, BreakpointConditionLeaf, BreakpointConditionNode, BreakpointDimension, BreakpointSize, } from './breakpoint.js';
17
- export { ADW_ACCENT_BG_COLORS, ADW_ACCENT_COLOR_NAMES, ADW_ACCENT_FG_COLOR, ADW_DEFAULT_ACCENT_COLOR, adwaitaAccent, adwaitaAccentBgColor, adwaitaAccentColor, adwaitaStandaloneColor, isAdwAccentColorName, onAdwaitaAccentChanged, setAdwaitaAccent, } from './accent.js';
18
- export type { AdwAccentColorName } from './accent.js';
17
+ export { ADW_ACCENT_BG_COLORS, ADW_ACCENT_COLOR_NAMES, ADW_ACCENT_FG_COLOR, ADW_DEFAULT_ACCENT_COLOR, adwaitaAccent, adwaitaAccentBgColor, adwaitaAccentColor, adwaitaStandaloneColor, formatAdwRgb, isAdwAccentColorName, nearestAccent, onAdwaitaAccentChanged, parseAdwRgb, setAdwaitaAccent, } from './accent.js';
18
+ export type { AdwAccentColorName, AdwRgb } from './accent.js';
19
+ export { APPLE_ACCENT_COLORS, APPLE_MULTICOLOR_ACCENT, adwAccentFromAppleAccentColor } from './apple-accent.js';
20
+ export { ADW_ACCENT_META, ADW_ACCENT_META_SYSTEM, ADW_COLOR_SCHEME_META, ADW_SYSTEM_COLOR_SCHEMES, appearanceFromMeta, isAdwSystemColorScheme, parseDesktopAppearance, renderAppearanceMeta, } from './appearance.js';
21
+ export type { AdwSystemColorScheme, AppearanceMeta, DesktopAppearance } from './appearance.js';
19
22
  export { DEFAULT_ICON_COLOR, DEFAULT_ICON_COLOR_DARK, adwaitaColorScheme, isThemeIconColor, onAdwaitaColorSchemeChanged, setAdwaitaColorScheme, themeIconColor, toggleAdwaitaColorScheme, } from './color-scheme.js';
20
23
  export type { AdwColorScheme } from './color-scheme.js';
21
24
  export { ADW_DATA_GRID_ROW_VARIANTS, DATA_GRID_CELL_CLASS, DATA_GRID_ROW_CLASS, dataGridCellText, dataGridColumnAlign, dataGridColumnClasses, dataGridRowInteractive, dataGridTrackTemplate, dataGridTracks, normalizeDataGridColumns, normalizeDataGridVariant, } from './data-grid.js';
22
25
  export type { AdwDataGridAlign, AdwDataGridCellValue, AdwDataGridColumn, AdwDataGridRow, AdwDataGridRowVariant, DataGridTrack, } from './data-grid.js';
23
26
  export { AdwToast, AdwToastQueue, DEFAULT_TOAST_TIMEOUT } from './toast.js';
24
27
  export type { AdwToastOptions, AdwToastQueueHandlers, AdwToastQueueOptions, ToastScheduler, ToastTimerHandle, } from './toast.js';
25
- export { AdwAlertResponses, BottomSheetPresentation, resolveBottomSheetClose } from './dialog.js';
26
- export type { AdwAlertResponse, AdwResponseAppearance, AdwResponseOptions, BottomSheetCloseOutcome, BottomSheetCloseSource, BottomSheetCloseState, BottomSheetPresentationListener, BottomSheetPresentationOptions, BottomSheetTeardownCallback, OrderedConfirmResponses, } from './dialog.js';
28
+ export { AdwAlertResponses, BottomSheetPresentation, resolveBottomSheetChrome, resolveBottomSheetClose, resolveBottomSheetOpen, resolveBottomSheetSwipeTracker, } from './dialog.js';
29
+ export type { AdwAlertResponse, AdwResponseAppearance, AdwResponseOptions, BottomSheetChrome, BottomSheetChromeState, BottomSheetCloseOutcome, BottomSheetCloseSource, BottomSheetCloseState, BottomSheetLayer, BottomSheetOpenOutcome, BottomSheetOpenSource, BottomSheetOpenState, BottomSheetPresentationListener, BottomSheetPresentationOptions, BottomSheetSwipeTrackerConfig, BottomSheetSwipeTrackerState, BottomSheetTeardownCallback, OrderedConfirmResponses, } from './dialog.js';
27
30
  export { ADW_COMBO_NO_SELECTION, clampListSelection, listItemsChanged, normalizeComboOptions, parseListModel, } from './list.js';
28
31
  export type { AdwComboOption, AdwComboOptionInput, AdwListItemsChanged, AdwListModel, AdwListModelInput, } from './list.js';
29
32
  export { ADW_ADJUSTMENT_DEFAULTS, adjustmentRange, clampAdjustmentValue, normalizeAdjustment, parseAdjustment, snapAdjustmentValue, SpinState, } from './adjustment.js';
30
33
  export type { AdwAdjustment, AdwAdjustmentInput, SpinStateChange, SpinStateListener, SpinStateRangeListener, } from './adjustment.js';
31
- export { ComboState, ExpanderState, ToggleGroupState } from './rows.js';
34
+ export { GtkAdjustment } from './gtk-adjustment.js';
35
+ export type { GtkAdjustmentProps } from './gtk-adjustment.js';
36
+ export { GtkStringList } from './gtk-string-list.js';
37
+ export type { GtkStringListProps } from './gtk-string-list.js';
38
+ export { ComboState, ExpanderState, ToggleGroupState, keptToggles, toggleIndexOfName } from './rows.js';
32
39
  export type { ComboItemsListener, ComboStateChange, ComboStateListener, ExpanderStateListener, ToggleGroupStateChange, ToggleGroupStateListener, } from './rows.js';
40
+ export { DEFAULT_BOX_SPACING, normalizeBoxOrientation, normalizeBoxSpacing } from './box.js';
41
+ export type { BoxOrientation } from './box.js';
42
+ export { DEFAULT_LABEL_ELLIPSIZE, DEFAULT_LABEL_LINES, DEFAULT_LABEL_MAX_WIDTH_CHARS, DEFAULT_LABEL_WIDTH_CHARS, DEFAULT_LABEL_WRAP_MODE, DEFAULT_LABEL_XALIGN, DEFAULT_LABEL_YALIGN, LABEL_ELLIPSIZE_MODES, LABEL_JUSTIFICATIONS, LABEL_WRAP_MODES, labelDisplayText, labelEffectiveLines, labelEllipsizeOverflowValue, labelMarkupIsUnparseable, labelWidthCharsExtent, labelYalignAlignItems, normalizeLabelEllipsize, normalizeLabelJustify, normalizeLabelLines, normalizeLabelMaxWidthChars, normalizeLabelWidthChars, normalizeLabelWrapMode, normalizeLabelXalign, normalizeLabelYalign, } from './label.js';
43
+ export type { LabelAlignItems, LabelEllipsizeMode, LabelJustification, LabelWidthCharsExtent, LabelWrapMode, } from './label.js';
33
44
  export { glibClamp, gStrStrip, stringIsNotEmpty } from './glib.js';
34
45
  export { ViewStackState, normalizeIconName, resolvePageTitle } from './view-stack.js';
35
46
  export type { AdwViewStackPageInfo, AdwViewStackPageSpec, ViewStackStateChange, ViewStackStateListener, } from './view-stack.js';
@@ -44,12 +55,15 @@ export { ADW_SPINNER_CYCLES_PER_LOOP, ADW_SPINNER_CYCLE_LENGTH, ADW_SPINNER_CONT
44
55
  export type { SpinnerArc } from './spinner.js';
45
56
  export { parseAccelerator, parseShortcutLabel, shortcutKeycaps } from './shortcut-label.js';
46
57
  export type { ShortcutKeycap, ShortcutLabelNode, ShortcutLabelOptions, ShortcutLabelParse } from './shortcut-label.js';
58
+ export { formatAcceleratorLabel, formatManifestShortcut } from './shortcut-format.js';
59
+ export type { ShortcutPlatform } from './shortcut-format.js';
47
60
  export { ADW_LENGTH_UNITS, DEFAULT_DPI, adwLengthToPx, normalizeLengthUnit } from './length-unit.js';
48
61
  export type { AdwLengthUnit } from './length-unit.js';
49
62
  export { ADW_SWIPE_BORDER, DEFAULT_MAX_SIDEBAR_WIDTH, DEFAULT_MIN_SIDEBAR_WIDTH, DEFAULT_SIDEBAR_WIDTH_FRACTION, DEFAULT_SIDEBAR_WIDTH_UNIT, INSTANT_SPLIT_VIEW_ANIMATOR, NAVIGATION_SPLIT_VIEW_CRITICALS, NavigationSplitViewState, OverlaySplitViewState, isSidebarAtVisualStart, layoutNavigationSplitView, layoutOverlaySplitView, measureSplitViewHorizontal, resolveNaturalSidebarWidth, resolveNavigationAction, resolveNavigationSidebarWidth, resolveNavigationStack, resolveOverlaySidebarWidth, resolveSidebarBounds, resolveSwipeArea, resolveSwipeRelease, resolveSwipeSnapPoints, resolveSwipeStart, swipeCancelProgress, tagsConflict, } from './split-view.js';
50
63
  export type { AdwPackType, AdwTextDirection, NavigationActionInput, NavigationActionResult, NavigationPageRef, NavigationSplitViewChange, NavigationSplitViewHandlers, NavigationSplitViewLayout, NavigationSplitViewListener, NavigationSplitViewOptions, NavigationSplitViewProperty, NavigationStackPlan, OverlaySplitViewChange, OverlaySplitViewLayout, OverlaySplitViewListener, OverlaySplitViewOptions, OverlaySplitViewProperty, SidebarBounds, SidebarWidthInput, SidebarWidthSpec, SplitViewAnimation, SplitViewAnimationRequest, SplitViewAnimator, SplitViewMeasureInput, SplitViewPane, SplitViewPaneRect, SwipeReleasePlan, } from './split-view.js';
51
64
  export { DEFAULT_DROPDOWN_TOOLTIP, SPLIT_BUTTON_DISABLED_OPACITY, SplitButtonState, isSplitButtonDirection, menuButtonArrowIcon, menuButtonPopupDirection, resolveDropdownTooltip, splitButtonArrowIcon, splitButtonPopupDirection, splitButtonRootState, splitButtonStyleClasses, } from './split-button.js';
52
65
  export type { AdwArrowIcon, SplitButtonChange, SplitButtonContentMode, SplitButtonDirection, SplitButtonHalfState, SplitButtonListener, SplitButtonProperty, SplitButtonStyleClass, } from './split-button.js';
66
+ export { GioMenu, GioMenuItem } from './gio-menu.js';
53
67
  export { ADW_MENU_SURFACE_NATIVESCRIPT, ADW_MENU_SURFACE_WEB, assertMenuRenderable, flattenMenu, menuItemAt, menuNodeAt, menuRefusals, normalizeMenuModel, parseDetailedAction, parseMenuModel, resolveMenuItemState, } from './menu.js';
54
68
  export type { AdwDetailedAction, AdwMenuAction, AdwMenuActions, AdwMenuDisplayHint, AdwMenuEntryInput, AdwMenuFlatRow, AdwMenuHiddenWhen, AdwMenuInput, AdwMenuItem, AdwMenuItemInput, AdwMenuItemRole, AdwMenuItemState, AdwMenuModel, AdwMenuNode, AdwMenuPath, AdwMenuRefusal, AdwMenuSection, AdwMenuSectionInput, AdwMenuSubmenu, AdwMenuSubmenuInput, AdwMenuSurface, AdwMenuTextDirection, } from './menu.js';
55
69
  export { DEFAULT_INDICATOR_DESCRIPTION_STRINGS, INLINE_VIEW_SWITCHER_DISPLAY_MODES, VIEW_SWITCHER_BADGE_LIMIT, VIEW_SWITCHER_DRAG_SWITCH_DELAY, VIEW_SWITCHER_FALLBACK_ICON, VIEW_SWITCHER_NO_SELECTION, VIEW_SWITCHER_POLICIES, ViewSwitcherBarState, ViewSwitcherDragSwitch, ViewSwitcherState, buildInlineToggles, buildViewSwitcherButtons, createViewSwitcherPage, inlineToggleTooltip, isInlineViewSwitcherDisplayMode, isViewSwitcherButtonVisible, isViewSwitcherPolicy, pageIndexForToggle, shouldRevealViewSwitcherBar, stripMnemonic, toggleIndexForPage, viewSwitcherBadgeLabel, viewSwitcherButtonOrientation, viewSwitcherIconName, viewSwitcherIndicatorDescription, viewSwitcherLabel, viewSwitcherPageFromStackPage, viewSwitcherPagesFromStack, } from './view-switcher.js';
@@ -74,3 +88,5 @@ export { POPOVER_ITEM_RADIUS, POPOVER_MENU_PADDING, POPOVER_PADDING, POPOVER_RAD
74
88
  export type { PopoverKeyAction, PopoverKeyContext, PopoverKeyResolution, PopoverStateChange, PopoverStateListener, } from './popover.js';
75
89
  export { ADW_WRAP_BOX_DEFAULT_ALIGN, ADW_WRAP_BOX_DEFAULT_JUSTIFY, ADW_WRAP_BOX_DEFAULT_JUSTIFY_LAST_LINE, ADW_WRAP_BOX_DEFAULT_LENGTH_UNIT, ADW_WRAP_BOX_DEFAULT_PACK_DIRECTION, ADW_WRAP_BOX_DEFAULT_SPACING, ADW_WRAP_BOX_DEFAULT_WRAP_POLICY, ADW_WRAP_BOX_JUSTIFY_MODES, ADW_WRAP_BOX_NATURAL_LINE_LENGTH_UNSET, ADW_WRAP_BOX_PACK_DIRECTIONS, ADW_WRAP_POLICIES, normalizeNaturalLineLength, normalizeWrapBoxAlign, normalizeWrapBoxJustify, normalizeWrapBoxLengthUnit, normalizeWrapBoxPackDirection, normalizeWrapBoxSpacing, normalizeWrapPolicy, resolveWrapBoxChildOrder, resolveWrapBoxLine, wrapBoxChildFlex, wrapBoxFlexStyle, wrapBoxLengthToPx, wrapPolicyFlexShrink, } from './wrap-box.js';
76
90
  export type { AdwWrapBoxJustify, AdwWrapBoxOrientation, AdwWrapBoxPackDirection, AdwWrapPolicy, WrapBoxChildFlex, WrapBoxChildOrderOp, WrapBoxFlexInput, WrapBoxFlexStyle, WrapBoxLineLayout, } from './wrap-box.js';
91
+ export { ADW_SOURCE_6502_DIRECTIVES, ADW_SOURCE_6502_LINE_COMMENT, ADW_SOURCE_6502_OPCODES, ADW_SOURCE_6502_REGISTERS, ADW_SOURCE_6502_TOKEN_ROLES, ADW_SOURCE_HEX_STRIDE, ADW_SOURCE_PALETTE_DARK, ADW_SOURCE_PALETTE_LIGHT, ADW_SOURCE_SYNTAX_ROLES, classifyAsm6502Word, formatHexAddress, formatLineNumber, stripSourceWhitespace, tokenizeAsm6502, } from './source.js';
92
+ export type { AdwSourcePalette, AdwSourceSyntaxRole, AdwSourceTokenClass, AdwSourceTokenStream } from './source.js';
@@ -0,0 +1,135 @@
1
+ /** `Gtk.Label:xalign`'s default — `0.5` in the pspec: a label centres its text. */
2
+ export declare const DEFAULT_LABEL_XALIGN = 0.5;
3
+ /** `Gtk.Justification`'s four nicks, in enum order. */
4
+ export declare const LABEL_JUSTIFICATIONS: readonly ["left", "right", "center", "fill"];
5
+ export type LabelJustification = (typeof LABEL_JUSTIFICATIONS)[number];
6
+ /**
7
+ * The string a label shows for a given `label` and the two flags that transform it.
8
+ *
9
+ * ORDER FOLLOWS THE C: markup is reduced first, the mnemonic marker second.
10
+ * `gtk_label_set_markup_with_mnemonic` parses the markup and then takes the underscore out
11
+ * of the resulting TEXT, so an `_` inside a tag's attributes is not a mnemonic. Doing it
12
+ * the other way round would let `<span font_desc="Sans">` lose its underscore and stop
13
+ * parsing.
14
+ */
15
+ export declare function labelDisplayText(label: string, useMarkup: boolean, useUnderline: boolean): string;
16
+ /** Whether `label` carries markup that could not be reduced, so the raw string is shown. */
17
+ export declare function labelMarkupIsUnparseable(label: string, useMarkup: boolean): boolean;
18
+ /**
19
+ * `Gtk.Label:xalign` as the label holds it. `gtk_label_set_xalign` CLAMPs to 0…1 itself,
20
+ * so an out-of-range value lands on the nearer end; only an unparseable one is the default.
21
+ */
22
+ export declare function normalizeLabelXalign(value: unknown): number;
23
+ /** `Gtk.Label:justify` from its nick. An unknown nick leaves the default, `left`. */
24
+ export declare function normalizeLabelJustify(value: unknown): LabelJustification;
25
+ /** `Gtk.Label:yalign`'s default — `0.5`, the same pspec shape as `xalign`. */
26
+ export declare const DEFAULT_LABEL_YALIGN = 0.5;
27
+ /**
28
+ * `Gtk.Label:yalign` as the label holds it. `gtk_label_set_yalign` CLAMPs to 0…1 itself,
29
+ * the same shape `normalizeLabelXalign` already carries for `xalign`.
30
+ */
31
+ export declare function normalizeLabelYalign(value: unknown): number;
32
+ /** The one CSS `align-items` keyword a `yalign` zone maps to. */
33
+ export type LabelAlignItems = 'flex-start' | 'center' | 'flex-end';
34
+ /**
35
+ * `yalign`'s three-zone CSS mapping — the DECLARED divergence past `yalign`'s three exact
36
+ * values (0, 0.5, 1): CSS `align-items` has three keywords and no ratio the way `xalign`'s
37
+ * `flex-grow` gives the main axis one (`_labels.scss`'s header has the full reasoning for
38
+ * why a second spacer pair is not the fix). This is the NEAREST of the three — the
39
+ * boundary between "nearest 0" and "nearest 0.5" is their midpoint, `0.25`, and
40
+ * symmetrically `0.75` between "nearest 0.5" and "nearest 1"; a value sitting exactly on a
41
+ * boundary is equidistant and reads as the CENTRE zone (`<`/`>`, not `<=`/`>=`), the same
42
+ * "high bound first" tie a strict inequality gives {@link glibClamp} at its own edges.
43
+ */
44
+ export declare function labelYalignAlignItems(yalign: number): LabelAlignItems;
45
+ /** `Pango.EllipsizeMode`'s four nicks, in enum order. */
46
+ export declare const LABEL_ELLIPSIZE_MODES: readonly ["none", "start", "middle", "end"];
47
+ export type LabelEllipsizeMode = (typeof LABEL_ELLIPSIZE_MODES)[number];
48
+ /** `Gtk.Label:ellipsize`'s default — `none`, no ellipsization. */
49
+ export declare const DEFAULT_LABEL_ELLIPSIZE: LabelEllipsizeMode;
50
+ /** `Gtk.Label:ellipsize` from its nick. An unknown nick leaves the default, `none`. */
51
+ export declare function normalizeLabelEllipsize(value: unknown): LabelEllipsizeMode;
52
+ /**
53
+ * `Gtk.Label:ellipsize` as the ONE truncating value CSS `text-overflow` and
54
+ * NativeScript's `textOverflow` can both hold — each accepts only `clip` or `ellipsis`,
55
+ * neither has a start- or middle-truncating mode of its own.
56
+ *
57
+ * `start` and `middle` are held on the PROPERTY faithfully: `normalizeLabelEllipsize`
58
+ * never lies about what was asked for, and a consumer reading `label.ellipsize` back gets
59
+ * exactly that nick. What a renderer can DRAW is a different question, answered here once
60
+ * for both renderers so neither invents its own fallback: every non-`none` mode draws an
61
+ * END ellipsis, the nearer of the two values a platform actually has — never a silent
62
+ * `clip`, which would drop the same characters with no indication at all that anything is
63
+ * missing. A DECLARED divergence, not a guessed one: `LABEL_ELLIPSIZE_OVERFLOW_VECTORS`
64
+ * pins this fallback, the same way `LABEL_DISPLAY_TEXT_VECTORS` pins use-markup's.
65
+ */
66
+ export declare function labelEllipsizeOverflowValue(ellipsize: LabelEllipsizeMode): 'clip' | 'ellipsis';
67
+ /** `Pango.WrapMode`'s three nicks, in enum order. */
68
+ export declare const LABEL_WRAP_MODES: readonly ["word", "char", "word-char"];
69
+ export type LabelWrapMode = (typeof LABEL_WRAP_MODES)[number];
70
+ /** `Gtk.Label:wrap-mode`'s default — `word`, wrap on word boundaries. */
71
+ export declare const DEFAULT_LABEL_WRAP_MODE: LabelWrapMode;
72
+ /** `Gtk.Label:wrap-mode` from its nick. An unknown nick leaves the default, `word`. */
73
+ export declare function normalizeLabelWrapMode(value: unknown): LabelWrapMode;
74
+ /** `Gtk.Label:width-chars`'s default — `-1`, the width is calculated automatically. */
75
+ export declare const DEFAULT_LABEL_WIDTH_CHARS = -1;
76
+ /** `Gtk.Label:width-chars` as the label holds it. See {@link normalizeLabelCharCount}. */
77
+ export declare function normalizeLabelWidthChars(value: unknown): number;
78
+ /** `Gtk.Label:max-width-chars`'s default — `-1`, the width is calculated automatically. */
79
+ export declare const DEFAULT_LABEL_MAX_WIDTH_CHARS = -1;
80
+ /** `Gtk.Label:max-width-chars` as the label holds it. See {@link normalizeLabelCharCount}. */
81
+ export declare function normalizeLabelMaxWidthChars(value: unknown): number;
82
+ /** `Gtk.Label:lines`'s default — `-1`, no line limit. */
83
+ export declare const DEFAULT_LABEL_LINES = -1;
84
+ /** `Gtk.Label:lines` as the label holds it. See {@link normalizeLabelCharCount}. */
85
+ export declare function normalizeLabelLines(value: unknown): number;
86
+ /**
87
+ * `Gtk.Label:lines` — the line count Pango will actually show before it ellipsizes, or
88
+ * `null` when nothing caps it at all.
89
+ *
90
+ * THE PSPEC'S OWN WORDS ARE IMPRECISE, MEASURED AGAINST WHAT GTK DOES. "Has no effect if
91
+ * the label is not wrapping or ellipsized" reads as `wrap || ellipsize !== 'none'` — this
92
+ * function's first, WRONG implementation — but `gtk_label_ensure_layout` (gtklabel.c) only
93
+ * ever calls `pango_layout_set_height(layout, -self->lines)`, and `wrap` plays NO PART in
94
+ * whether Pango HONOURS that call: measured on gjs 1.88.1 / gtk 4.22.5, a real
95
+ * `Gtk.Label` with `wrap=TRUE, ellipsize=NONE, lines=2`, allocated 100px wide, laid out
96
+ * **15 lines** — the `lines` hint sits there unused, because Pango only consults a
97
+ * layout's height/line-count when ELLIPSIZATION is active; wrapping alone never asks
98
+ * Pango to stop. The same label with `wrap=FALSE, ellipsize=END, lines=2` (the case the
99
+ * old implementation returned `null`, "no effect", for) laid out exactly **2 lines**,
100
+ * ellipsized — `wrap` is `false` there and it changed nothing: `ellipsize || wrap` in the
101
+ * C is the gate on whether the layout gets a WIDTH at all (a `Gtk.Label:ellipsize`
102
+ * request supplies its own width, exactly like `wrap` does), not on whether `lines` has
103
+ * an effect. So `wrap` is not a parameter here — passing it would invite exactly the
104
+ * misreading the pspec's prose does.
105
+ *
106
+ * WHAT AN UNSET `lines` (`≤ 0`) MEANS ONCE ELLIPSIZE IS ACTIVE IS NOT "UNLIMITED" — it is
107
+ * Pango's OWN default: `gtk_label_set_lines` only calls `pango_layout_set_height` when
108
+ * `lines > 0`, so an unset `lines` leaves Pango's height at ITS default, which
109
+ * `PangoLayout` documents as "the first line will be shown" — measured: `lines` absent
110
+ * (or `0`) with `ellipsize=END` laid out to exactly **1 line**, same as `lines=1`
111
+ * explicitly. `lines < 0` (GTK's own "unlimited" spelling once `lines` IS being read,
112
+ * i.e. while ellipsize is active) was never reachable through this function in the first
113
+ * place, since {@link normalizeLabelLines} floors at `-1` and this reads it before any
114
+ * positive check — folded into the `lines > 0 ? lines : 1` branch below.
115
+ */
116
+ export declare function labelEffectiveLines(lines: number, ellipsize: LabelEllipsizeMode): number | null;
117
+ /** One `width-chars` + `max-width-chars` pair and the `ch`-unit extent a renderer draws. */
118
+ export interface LabelWidthCharsExtent {
119
+ /** `width-chars`, in `ch` — the MINIMUM width — or `null` while it is unset (`-1`). */
120
+ minCh: number | null;
121
+ /**
122
+ * `MAX(width-chars, max-width-chars)`, in `ch` — the NATURAL/maximum width — or `null`
123
+ * while `max-width-chars` is unset. `width-chars` alone sets no maximum: GTK reads it
124
+ * only as a floor under `max-width-chars`, never as a ceiling by itself.
125
+ */
126
+ maxCh: number | null;
127
+ }
128
+ /**
129
+ * `get_default_widths` (gtklabel.c): the label's MINIMUM width is `width-chars` alone; its
130
+ * NATURAL width is `MAX(width-chars, max-width-chars)`, and that MAX is read only while
131
+ * `max-width-chars` is set — `width-chars` without a maximum has nothing to be a floor
132
+ * under. Either property at its default (`-1`) drops out of the pair it belongs to, the
133
+ * same "negative means auto" rule both share.
134
+ */
135
+ export declare function labelWidthCharsExtent(widthChars: number, maxWidthChars: number): LabelWidthCharsExtent;
@@ -0,0 +1,2 @@
1
+ declare const _default: () => Promise<void>;
2
+ export default _default;
@@ -0,0 +1,14 @@
1
+ import type { SharedTreeNode } from './conformance/shared-trees.js';
2
+ /**
3
+ * The tree as `<adw-*>`/`<gtk-*>` markup: what `buildSharedTree` would build, spelled as the
4
+ * HTML a page could hold instead. Parsed into a document, it yields the same elements with
5
+ * the same attributes, classes and `slot=` as `mountSharedTree(node)` does.
6
+ */
7
+ export declare function sharedTreeHtml(node: SharedTreeNode): string;
8
+ /**
9
+ * The tree as a NativeScript XML template: what the port's `build` would build, spelled as
10
+ * markup NativeScript's `Builder` loads. The root declares NativeScript's default namespace
11
+ * and one `xmlns` barrel per library the tree uses — no more, since each is a module the app
12
+ * then has to provide.
13
+ */
14
+ export declare function sharedTreeNativeScriptXml(node: SharedTreeNode): string;
@@ -0,0 +1,2 @@
1
+ declare const _default: () => Promise<void>;
2
+ export default _default;
@@ -222,3 +222,23 @@ export declare class ToggleGroupState {
222
222
  /** Number of segments. */
223
223
  get count(): number;
224
224
  }
225
+ /**
226
+ * The toggles a group keeps, in add order.
227
+ *
228
+ * A NAME IS UNIQUE, AND THE SECOND CLAIM IS REFUSED WHOLE. `add_toggle` looks the name up
229
+ * before adding and, when another toggle already carries it, prints a `g_critical` and
230
+ * drops the toggle — it is never added, so it draws no button and takes no index
231
+ * (adw-toggle-group.c:849). An unnamed toggle is always kept.
232
+ */
233
+ export declare function keptToggles<T extends {
234
+ readonly name?: string | null;
235
+ }>(toggles: readonly T[]): T[];
236
+ /**
237
+ * The toggle `adw_toggle_group_set_active_name` selects: its index among the names of the
238
+ * KEPT toggles ({@link keptToggles}), or `-1` when none carries `name`.
239
+ *
240
+ * `-1` is not a selection. The C answers a name nothing carries with a `g_critical` and
241
+ * returns (:2001) — the active toggle stays where it was — so a renderer leaves its
242
+ * selection alone on `-1` rather than clearing it.
243
+ */
244
+ export declare function toggleIndexOfName(names: readonly (string | null | undefined)[], name: string): number;
@@ -0,0 +1,25 @@
1
+ /** `'mac'` picks Apple's glyphs and modifier order; `'other'` leaves the input alone. */
2
+ export type ShortcutPlatform = 'mac' | 'other';
3
+ /**
4
+ * `raw` as a WebExtension manifest or `browser.commands.getAll()` spells it
5
+ * (e.g. `"Alt+Shift+B"`, `"MacCtrl+Shift+B"`). Empty input stays empty:
6
+ * whether that means "show nothing" or "show a fallback" is a decision for
7
+ * the caller, not this formatter. A value some engine already rendered as
8
+ * glyphs (Safari, Chromium in places) passes through unchanged — formatting
9
+ * it twice would be wrong twice — and so does every non-mac platform, because
10
+ * that IS how Windows/Linux/ChromeOS show it.
11
+ */
12
+ export declare function formatManifestShortcut(raw: string, platform: ShortcutPlatform): string;
13
+ /**
14
+ * `accelerator` as GTK spells it (`"<Control><Shift>b"`, `"<Primary>q"`,
15
+ * `"<Alt>F4"`). Delegates the actual parse to `shortcutKeycaps` so the
16
+ * modifier table — including `<Primary>` resolving to ⌘ on mac and `<Control>`
17
+ * staying ⌃, GTK's own macOS behaviour — lives in exactly one place. Returns
18
+ * the accelerator unchanged if it fails to parse (an unknown modifier, an
19
+ * unterminated `<`).
20
+ *
21
+ * Non-mac renders the GTK-style human label (`"Ctrl+Shift+B"`, `+`-joined,
22
+ * letter keys upper-cased); mac renders Apple's glyphs in HIG order with no
23
+ * separator (`"⌃⇧B"`), matching `formatManifestShortcut`.
24
+ */
25
+ export declare function formatAcceleratorLabel(accelerator: string, platform: ShortcutPlatform): string;
@@ -0,0 +1,2 @@
1
+ declare const _default: () => Promise<void>;
2
+ export default _default;
@@ -0,0 +1,94 @@
1
+ /**
2
+ * The read/advance surface a stream tokenizer needs from its host editor — the
3
+ * exact eight members {@link tokenizeAsm6502} touches, with CodeMirror's
4
+ * `StringStream` signatures, so passing one satisfies this structurally.
5
+ *
6
+ * `next()` returns `string | void` rather than `string | undefined` because
7
+ * that is what `StringStream` declares, and `void` is not assignable to
8
+ * `undefined`: narrowing here would reject the very class this exists to accept.
9
+ */
10
+ export interface AdwSourceTokenStream {
11
+ /** The text consumed since the current token started. */
12
+ current(): string;
13
+ /** Consume the whitespace run ahead of the cursor; true if any was there. */
14
+ eatSpace(): boolean;
15
+ /** Consume while characters match; true if any were consumed. */
16
+ eatWhile(match: string | RegExp | ((ch: string) => boolean)): boolean;
17
+ /** True at the end of the line. */
18
+ eol(): boolean;
19
+ /** Read one character and advance. */
20
+ next(): string | void;
21
+ /** The character at the cursor, without advancing. */
22
+ peek(): string | undefined;
23
+ /** Jump to the end of the line. */
24
+ skipToEnd(): void;
25
+ /** True at the start of the line — what makes a bare word a label. */
26
+ sol(): boolean;
27
+ }
28
+ /** The token classes {@link tokenizeAsm6502} can emit. */
29
+ export type AdwSourceTokenClass = 'comment' | 'directive' | 'identifier' | 'label' | 'number' | 'opcode' | 'operator' | 'register' | 'string';
30
+ /** The 56 official NMOS 6502 mnemonics (uppercased for case-insensitive match). */
31
+ export declare const ADW_SOURCE_6502_OPCODES: ReadonlySet<string>;
32
+ /** The registers that appear as bare operands (`ASL A`, `LDA $00,X`). */
33
+ export declare const ADW_SOURCE_6502_REGISTERS: ReadonlySet<string>;
34
+ /** Assembler pseudo-ops. `define`/`dcb` are the easy6502 dialect; the rest are
35
+ * common cross-assembler directives (with the leading dot handled separately). */
36
+ export declare const ADW_SOURCE_6502_DIRECTIVES: ReadonlySet<string>;
37
+ /** The comment introducer 6502 assembly uses, for an editor's comment command. */
38
+ export declare const ADW_SOURCE_6502_LINE_COMMENT = ";";
39
+ /**
40
+ * Classify an identifier-shaped token. Pure + side-effect-free so it is unit
41
+ * testable without a stream at all. `atLineStart` decides whether an unknown
42
+ * word is a label DEFINITION (column 0) or a symbol REFERENCE.
43
+ */
44
+ export declare function classifyAsm6502Word(word: string, atLineStart: boolean): AdwSourceTokenClass;
45
+ /**
46
+ * Tokenize one token from `stream`. Returns a token class or `null` for
47
+ * whitespace and unclassified punctuation, which is the contract a CodeMirror
48
+ * `StreamParser.token` wants — and, being typed on
49
+ * {@link AdwSourceTokenStream}, the contract any other editor can meet too.
50
+ */
51
+ export declare function tokenizeAsm6502(stream: AdwSourceTokenStream): AdwSourceTokenClass | null;
52
+ /**
53
+ * The colourable roles a token class maps onto. Fewer than the token classes,
54
+ * because a language names tokens after its own grammar (`opcode`) while a
55
+ * colour scheme names them after what a reader sees (`keyword`) — and the
56
+ * second set is what a scheme, a stylesheet or another language shares.
57
+ */
58
+ export type AdwSourceSyntaxRole = 'comment' | 'directive' | 'keyword' | 'label' | 'number' | 'operator' | 'register' | 'string';
59
+ /** The roles in the order a generated stylesheet emits them. */
60
+ export declare const ADW_SOURCE_SYNTAX_ROLES: readonly AdwSourceSyntaxRole[];
61
+ /** One colour per {@link AdwSourceSyntaxRole}, as a CSS-parsable colour. */
62
+ export type AdwSourcePalette = Readonly<Record<AdwSourceSyntaxRole, string>>;
63
+ /**
64
+ * Which role paints a token class. `identifier` maps to `null`: a plain symbol
65
+ * reference is deliberately UNCOLOURED, taking the view's foreground, exactly
66
+ * as the native GtkSourceView scheme leaves it.
67
+ */
68
+ export declare const ADW_SOURCE_6502_TOKEN_ROLES: Readonly<Record<AdwSourceTokenClass, AdwSourceSyntaxRole | null>>;
69
+ /** Light-scheme syntax colours (Adwaita named palette). */
70
+ export declare const ADW_SOURCE_PALETTE_LIGHT: AdwSourcePalette;
71
+ /** Dark-scheme syntax colours (Adwaita named palette). */
72
+ export declare const ADW_SOURCE_PALETTE_DARK: AdwSourcePalette;
73
+ /** Bytes represented per visual line in the hex monitor / hexdump gutter. */
74
+ export declare const ADW_SOURCE_HEX_STRIDE = 16;
75
+ /**
76
+ * Format a 1-based line number as a 4-digit uppercase hex address, the way the
77
+ * native GtkSourceView hex gutter renders monitor/hexdump rows: each row advances
78
+ * the address by `stride` bytes from `start` (the base address of the first row,
79
+ * e.g. 0x0600 for a 6502 program). `lineNo` is 1-based, per CodeMirror's
80
+ * `formatNumber` contract.
81
+ */
82
+ export declare function formatHexAddress(lineNo: number, start: number, stride?: number): string;
83
+ /**
84
+ * Format a 1-based line number for the normal (decimal) gutter, offset so
85
+ * `start` is the value shown on the first line — the web twin of the native
86
+ * renderer's `line + startValue`.
87
+ */
88
+ export declare function formatLineNumber(lineNo: number, start?: number): string;
89
+ /**
90
+ * Strip every whitespace character from `text` — the copy-without-spaces
91
+ * transform the native hex monitor applies so a copied address/byte run pastes
92
+ * as a compact hex string. Mirrors `text.replace(/\s/g, '')` in the GTK widget.
93
+ */
94
+ export declare function stripSourceWhitespace(text: string): string;
@@ -0,0 +1,2 @@
1
+ declare const _default: () => Promise<void>;
2
+ export default _default;
@@ -0,0 +1,48 @@
1
+ /**
2
+ * `AdwPreferencesGroup` -> `adw-preferences-group`.
3
+ *
4
+ * THE RULE: the last capital of an acronym run opens the next word, which is why `GLArea`
5
+ * is `gl-area` and not `g-l-area`. The first version of this function was a naive
6
+ * `([a-z0-9])([A-Z])` split, and `GtkGLArea` caught it — it produced `gtk-glarea` where
7
+ * `gtk-host` stamps `gtk-gl-area`, which is why arm 11 of `check-generated-website-data.mjs`
8
+ * holds the `scripts/` restatement against every row of the generated table rather than
9
+ * against a handful of tags a corpus happens to use today.
10
+ *
11
+ * NOT AN INVERSE OF ANYTHING. Tag -> GType is lossy in exactly that case — `gtk-gl-area`
12
+ * reads back as `GtkGlArea` and no case rule can know better — so a reverse lookup has to be
13
+ * a table read backwards, never a second rule.
14
+ */
15
+ export declare const hostTagOf: (gtype: string) => string;
16
+ /**
17
+ * `buttonLabel` -> `button-label`.
18
+ *
19
+ * NOT AN ALIAS TABLE and not a second transform beside {@link hostTagOf}: a case rule over
20
+ * the authored property NAME, with no entry to give a name it does not recognise. A markup
21
+ * renderer's tree builder turns an authored prop into a DOM attribute with this rule, and
22
+ * arm 13 of `check-generated-website-data.mjs` reads a gallery fence's attributes back
23
+ * through the `scripts/` restatement of it, so the two stay one spelling rather than two.
24
+ */
25
+ export declare const attributeOf: (prop: string) => string;
26
+ /**
27
+ * `maximum-size` -> `maximumSize`: a GObject property name as the JavaScript member a
28
+ * NativeScript widget declares for it.
29
+ *
30
+ * A `.blp` projects its properties under their GIR spelling, because that is what GtkBuilder
31
+ * and the `<adw-*>` attributes read. The NativeScript port names the same property in camel
32
+ * case (`Adw.Clamp:maximum-size` is `AdwClamp.maximumSize`), so a builder handed a projected
33
+ * tree needs this rule to find the member, and without it every hyphenated property of a real
34
+ * `.blp` is refused as reaching nothing. GObject treats `_` and `-` in a property name as one
35
+ * separator, so both close a word here. Idempotent on a camel-case name, which is how the
36
+ * gallery's hand-authored trees already spell theirs.
37
+ */
38
+ export declare const propertyOf: (name: string) => string;
39
+ /**
40
+ * `GtkWidget`'s four margins, as the CSS property each one is — `start`/`end` the LOGICAL
41
+ * edges `gtk_widget_set_margin_start` documents, `top`/`bottom` physical as in GTK.
42
+ *
43
+ * A markup renderer writes them as inline style, because an attribute cannot carry a length
44
+ * into a stylesheet portably (`attr()` with a type is not in every engine). ONE table for the
45
+ * two places that do it: `buildSharedTree` in `@gjsify/adwaita-web`, and `sharedTreeHtml` in
46
+ * `./markup.ts`, whose markup has to parse back to exactly what that builder made.
47
+ */
48
+ export declare const GTK_WIDGET_MARGIN_CSS: Readonly<Record<string, string>>;
@@ -0,0 +1,2 @@
1
+ declare const _default: () => Promise<void>;
2
+ export default _default;
@@ -31,4 +31,4 @@ export declare const ADWAITA_DARK_ONLY_TOKENS: readonly string[];
31
31
  */
32
32
  export declare const ADWAITA_UNRESOLVED_TOKENS: readonly string[];
33
33
  /** How many tokens the light contract carries — derived, never typed. */
34
- export declare const ADWAITA_TOKEN_COUNT = 68;
34
+ export declare const ADWAITA_TOKEN_COUNT = 69;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjsify/adwaita-core",
3
- "version": "0.51.1",
3
+ "version": "0.53.0",
4
4
  "description": "Headless Adwaita widget behavior (breakpoint condition grammar + apply/unapply state machine, color-scheme observable, avatar derivation) shared by the web and NativeScript Adwaita renderers — pure TS, no platform imports",
5
5
  "type": "module",
6
6
  "module": "lib/esm/index.js",
@@ -17,6 +17,14 @@
17
17
  "./tokens": {
18
18
  "types": "./lib/types/tokens.d.ts",
19
19
  "default": "./lib/esm/tokens.js"
20
+ },
21
+ "./tags": {
22
+ "types": "./lib/types/tags.d.ts",
23
+ "default": "./lib/esm/tags.js"
24
+ },
25
+ "./markup": {
26
+ "types": "./lib/types/markup.d.ts",
27
+ "default": "./lib/esm/markup.js"
20
28
  }
21
29
  },
22
30
  "files": [
@@ -36,7 +44,7 @@
36
44
  "test:gjs": "gjsify run test.gjs.mjs",
37
45
  "test:node": "node test.node.mjs",
38
46
  "test:bun": "bun test.node.mjs",
39
- "test:deno": "deno run -A --no-lock --node-modules-dir=none test.node.mjs",
47
+ "test:deno": "deno run -A --no-lock --node-modules-dir=none --min-dep-age=0 test.node.mjs",
40
48
  "test:cross-runtime": "gjsify run build:test:node && gjsify run test:node && gjsify run test:bun && gjsify run test:deno"
41
49
  },
42
50
  "keywords": [
@@ -50,8 +58,8 @@
50
58
  "headless"
51
59
  ],
52
60
  "devDependencies": {
53
- "@gjsify/cli": "^0.51.1",
54
- "@gjsify/unit": "^0.51.1",
61
+ "@gjsify/cli": "^0.53.0",
62
+ "@gjsify/unit": "^0.53.0",
55
63
  "@types/node": "^25.9.2",
56
64
  "typescript": "^6.0.3"
57
65
  },