vintage-frames 0.19.0 → 0.19.1

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.
@@ -8416,7 +8416,7 @@
8416
8416
  "declarations": [
8417
8417
  {
8418
8418
  "kind": "class",
8419
- "description": "`<vf-menu-bar>` — the System 7 menu bar: white strip, 1px black bottom\nrule, slotted `<vf-menu>` children laid out from the left. `rounded` adds\nthe classic screen-corner mask to the top corners.\n\nCoordinates its menus: pressing a label opens that menu (and inverts the\nlabel); while any menu is open, hovering another label switches to it;\nEscape, an outside click, or item selection closes. ArrowLeft/ArrowRight\nmove between menus while one is open; ArrowDown/ArrowUp move focus through\nthe open menu's items, Home/End jump to its first/last, and typed letters\nrun the shared Finder first-letter type-ahead (src/type-ahead.ts).\n\nThe bar also owns the **press-drag-release** gesture (see src/menu-press.ts)\n— press a title, slide onto a command, release over it — because one press\nmay travel across several of its menus. `vf-select` drives its popup by the\nsame mechanic.",
8419
+ "description": "`<vf-menu-bar>` — the System 7 menu bar: white strip, 1px black bottom\nrule, slotted `<vf-menu>` children laid out from the left. `rounded` adds\nthe classic screen-corner mask to the top corners.\n\nCoordinates its menus: pressing a label opens that menu (and inverts the\nlabel); while any menu is open, hovering another label switches to it;\nEscape, an outside click, or item selection closes. While a menu is open\nthe keyboard is src/menu-navigation.ts's: ArrowDown/ArrowUp move focus\nthrough the open menu's items, Home/End jump to its first/last, typed\nletters run the shared Finder first-letter type-ahead (src/type-ahead.ts),\nArrowRight opens an item's submenu and ArrowLeft closes it, and at the top\nlevel ArrowLeft/ArrowRight move between menus.\n\nThe bar also owns the **press-drag-release** gesture (see src/menu-press.ts)\n— press a title, slide onto a command, release over it — because one press\nmay travel across several of its menus. `vf-select` drives its popup by the\nsame mechanic.",
8420
8420
  "name": "VfMenuBar",
8421
8421
  "cssProperties": [
8422
8422
  {
@@ -8693,7 +8693,8 @@
8693
8693
  {
8694
8694
  "kind": "field",
8695
8695
  "name": "#onDocKeydown",
8696
- "privacy": "private"
8696
+ "privacy": "private",
8697
+ "description": "The open menu's keyboard and its submenus', src/menu-navigation.ts's.\n#onBarKeydown's arrows and Home/End only run while no menu is open."
8697
8698
  },
8698
8699
  {
8699
8700
  "kind": "field",
@@ -8720,25 +8721,6 @@
8720
8721
  ],
8721
8722
  "description": "Opens the previous/next menu in the bar, wrapping at the ends."
8722
8723
  },
8723
- {
8724
- "kind": "method",
8725
- "name": "#moveItemFocus",
8726
- "privacy": "private",
8727
- "return": {
8728
- "type": {
8729
- "text": "void"
8730
- }
8731
- },
8732
- "parameters": [
8733
- {
8734
- "name": "direction",
8735
- "type": {
8736
- "text": "1 | -1"
8737
- }
8738
- }
8739
- ],
8740
- "description": "Moves keyboard focus through the open menu's enabled items, wrapping."
8741
- },
8742
8724
  {
8743
8725
  "kind": "field",
8744
8726
  "name": "top",
@@ -8912,7 +8894,7 @@
8912
8894
  "declarations": [
8913
8895
  {
8914
8896
  "kind": "class",
8915
- "description": "`<vf-menu-item>` — a single command inside a `<vf-menu>` panel.\n\nRenders the classic System 7 menu row: optional ✓ check in the\n`--vf-select-gutter` left column (16px, shared with vf-select/vf-option),\nlabel, and the keyboard shortcut left-aligned in a right-anchored column,\nso every ⌘ lands at the same x. On activation the item performs the classic\n3-blink inversion (~250ms), then dispatches `vf-menu-select` and asks its\nancestors to close the menu.\n\nTakes `top`/`left` like every other element (VfPositioned), for the\nconsumer who wants a row somewhere other than a pulldown. Inside its parent\n`<vf-menu>` the panel is as wide as its widest row and stacks them in flow,\nso stating an origin takes that row out of both: it no longer contributes to\nthe panel's width and the rows below close the gap. The placement doing what\nit says — but not how a pulldown is laid out.",
8897
+ "description": "`<vf-menu-item>` — a single command inside a `<vf-menu>` panel.\n\nRenders the classic System 7 menu row: optional ✓ check in the\n`--vf-select-gutter` left column (16px, shared with vf-select/vf-option),\nlabel, and the keyboard shortcut left-aligned in a right-anchored column,\nso every ⌘ lands at the same x. On activation the item performs the classic\n3-blink inversion (~250ms), then dispatches `vf-menu-select` and asks its\nancestors to close the menu.\n\nA `<vf-menu>` in the `submenu` slot makes the item open a submenu: it ends\nin ▶ where a shortcut would go, and choosing it opens the submenu beside\nit rather than firing `vf-menu-select`. The item stays highlighted while\nits submenu is open.\n\nTakes `top`/`left` like every other element (VfPositioned), for the\nconsumer who wants a row somewhere other than a pulldown. Inside its parent\n`<vf-menu>` the panel is as wide as its widest row and stacks them in flow,\nso stating an origin takes that row out of both: it no longer contributes to\nthe panel's width and the rows below close the gap. The placement doing what\nit says — but not how a pulldown is laid out.",
8916
8898
  "name": "VfMenuItem",
8917
8899
  "cssProperties": [
8918
8900
  {
@@ -8947,12 +8929,20 @@
8947
8929
  {
8948
8930
  "description": "The shortcut text, left-aligned in the shared column.",
8949
8931
  "name": "shortcut"
8932
+ },
8933
+ {
8934
+ "description": "The ▶ of an item that opens a submenu.",
8935
+ "name": "arrow"
8950
8936
  }
8951
8937
  ],
8952
8938
  "slots": [
8953
8939
  {
8954
8940
  "description": "The item label.",
8955
8941
  "name": ""
8942
+ },
8943
+ {
8944
+ "description": "A `vf-menu`, the submenu the item opens.",
8945
+ "name": "submenu"
8956
8946
  }
8957
8947
  ],
8958
8948
  "members": [
@@ -8992,10 +8982,21 @@
8992
8982
  "text": "boolean"
8993
8983
  },
8994
8984
  "default": "false",
8995
- "description": "Transient highlight — the full-row inversion the press-drag gesture paints\non the row under the pointer (`:hover` can't: under touch the pointer is\ncaptured by the title the press started on). Managed by the menu, mirroring\n`vf-option[active]`; not part of the authoring API.",
8985
+ "description": "Transient highlight — the full-row inversion on the row under the pointer\nwhile its menu is open, button down or not (`:hover` can't: under touch\nthe pointer is captured by the title the press started on), or on the\nitem whose submenu is open while the pointer is elsewhere. Managed by the\nmenu, mirroring `vf-option[active]`; not part of the authoring API.",
8996
8986
  "attribute": "active",
8997
8987
  "reflects": true
8998
8988
  },
8989
+ {
8990
+ "kind": "field",
8991
+ "name": "expanded",
8992
+ "type": {
8993
+ "text": "boolean"
8994
+ },
8995
+ "default": "false",
8996
+ "description": "Whether this item's submenu is open. Reflected, and announced as\n`aria-expanded`. Managed by the menu (VfMenu.expand), like\nactive; not part of the authoring API.",
8997
+ "attribute": "expanded",
8998
+ "reflects": true
8999
+ },
8999
9000
  {
9000
9001
  "kind": "field",
9001
9002
  "name": "checkable",
@@ -9023,7 +9024,7 @@
9023
9024
  "type": {
9024
9025
  "text": "string | undefined"
9025
9026
  },
9026
- "description": "Value reported in the `vf-menu-select` event detail. Defaults to the item's\ntrimmed text content when unset.",
9027
+ "description": "Value reported in the `vf-menu-select` event detail. Defaults to the item's\nlabelText when unset.",
9027
9028
  "attribute": "value"
9028
9029
  },
9029
9030
  {
@@ -9036,6 +9037,34 @@
9036
9037
  "default": "null",
9037
9038
  "description": "`'on' | 'off'` while the selection blink runs, otherwise `null`."
9038
9039
  },
9040
+ {
9041
+ "kind": "field",
9042
+ "name": "_hasSubmenu",
9043
+ "type": {
9044
+ "text": "boolean"
9045
+ },
9046
+ "privacy": "private",
9047
+ "default": "false",
9048
+ "description": "Whether a `vf-menu` sits in the `submenu` slot."
9049
+ },
9050
+ {
9051
+ "kind": "field",
9052
+ "name": "submenu",
9053
+ "type": {
9054
+ "text": "VfMenu | null"
9055
+ },
9056
+ "description": "The submenu this item opens: the `vf-menu` in its `submenu` slot, or null.",
9057
+ "readonly": true
9058
+ },
9059
+ {
9060
+ "kind": "field",
9061
+ "name": "labelText",
9062
+ "type": {
9063
+ "text": "string"
9064
+ },
9065
+ "description": "The item's label as text: what its default slot holds, trimmed, without\nthe rows of a submenu. The default value and the menus'\ntype-ahead read it, and it names an item that opens a submenu.",
9066
+ "readonly": true
9067
+ },
9039
9068
  {
9040
9069
  "kind": "field",
9041
9070
  "name": "#blinkHandle",
@@ -9099,7 +9128,37 @@
9099
9128
  "text": "void"
9100
9129
  }
9101
9130
  },
9102
- "description": "Mirrors shortcut as the host's `aria-keyshortcuts`, normalised from\nthe Mac display glyphs to the ARIA grammar (\"⌘⇧S\" → \"Meta+Shift+S\"). A\nconsumer's own attribute overrides this the way it overrides the role."
9131
+ "description": "Mirrors shortcut as the host's `aria-keyshortcuts`, normalised from\nthe Mac display glyphs to the ARIA grammar (\"⌘⇧S\" → \"Meta+Shift+S\"). A\nconsumer's own attribute overrides this the way it overrides the role.\nAn item that opens a submenu has ▶ where the shortcut would be, and no key."
9132
+ },
9133
+ {
9134
+ "kind": "field",
9135
+ "name": "#syncSubmenu",
9136
+ "privacy": "private",
9137
+ "description": "An item that opens a submenu says so (`aria-haspopup`, `aria-expanded`)\nand is named by its label alone: a name computed from its content would\ntake in the open submenu's rows."
9138
+ },
9139
+ {
9140
+ "kind": "field",
9141
+ "name": "#onSubmenuSlotChange",
9142
+ "privacy": "private"
9143
+ },
9144
+ {
9145
+ "kind": "method",
9146
+ "name": "#fromSubmenu",
9147
+ "privacy": "private",
9148
+ "return": {
9149
+ "type": {
9150
+ "text": "boolean"
9151
+ }
9152
+ },
9153
+ "parameters": [
9154
+ {
9155
+ "name": "event",
9156
+ "type": {
9157
+ "text": "Event"
9158
+ }
9159
+ }
9160
+ ],
9161
+ "description": "Whether `event` came from inside this item's submenu, so belongs to a row there."
9103
9162
  },
9104
9163
  {
9105
9164
  "kind": "method",
@@ -9120,7 +9179,15 @@
9120
9179
  "type": {
9121
9180
  "text": "void"
9122
9181
  }
9123
- }
9182
+ },
9183
+ "parameters": [
9184
+ {
9185
+ "name": "event",
9186
+ "type": {
9187
+ "text": "PointerEvent"
9188
+ }
9189
+ }
9190
+ ]
9124
9191
  },
9125
9192
  {
9126
9193
  "kind": "method",
@@ -9139,7 +9206,7 @@
9139
9206
  }
9140
9207
  }
9141
9208
  ],
9142
- "description": "The gesture latch is read *now* — it is about a press that already\nresolved this click — but the activation itself defers to the end of the\npath, so `preventDefault()` on the item (or above it) cancels the command\nthe way it cancels a native control's. See deferActivation."
9209
+ "description": "The gesture latch is read *now* — it is about a press that already\nresolved this click — but the activation itself defers to the end of the\npath, so `preventDefault()` on the item (or above it) cancels the command\nthe way it cancels a native control's. See deferActivation.\nA click on a row of this item's submenu bubbles through here, and is\nthat row's alone."
9143
9210
  },
9144
9211
  {
9145
9212
  "kind": "method",
@@ -9173,7 +9240,7 @@
9173
9240
  "text": "void"
9174
9241
  }
9175
9242
  },
9176
- "description": "Runs the classic 3-blink inversion, then dispatches `vf-menu-select` and an\ninternal `vf-menu-close-request` so ancestor menu/menu-bar close. Public\nbecause the menu's press gesture activates the row a drag was released\nover, which the row's own `click` never sees (a press that started on the\ntitle dispatches its click above both of them). No-op while disabled or\nalready blinking."
9243
+ "description": "Runs the classic 3-blink inversion, then dispatches `vf-menu-select` and an\ninternal `vf-menu-close-request` so ancestor menu/menu-bar close. Public\nbecause the menu's press gesture activates the row a drag was released\nover, which the row's own `click` never sees (a press that started on the\ntitle dispatches its click above both of them). No-op while disabled or\nalready blinking.\n\nAn item that opens a submenu is never chosen: it opens the submenu and\nmoves focus to its first enabled item, as Enter, Space and → do."
9177
9244
  },
9178
9245
  {
9179
9246
  "kind": "method",
@@ -9283,9 +9350,18 @@
9283
9350
  "text": "boolean"
9284
9351
  },
9285
9352
  "default": "false",
9286
- "description": "Transient highlight — the full-row inversion the press-drag gesture paints\non the row under the pointer (`:hover` can't: under touch the pointer is\ncaptured by the title the press started on). Managed by the menu, mirroring\n`vf-option[active]`; not part of the authoring API.",
9353
+ "description": "Transient highlight — the full-row inversion on the row under the pointer\nwhile its menu is open, button down or not (`:hover` can't: under touch\nthe pointer is captured by the title the press started on), or on the\nitem whose submenu is open while the pointer is elsewhere. Managed by the\nmenu, mirroring `vf-option[active]`; not part of the authoring API.",
9287
9354
  "fieldName": "active"
9288
9355
  },
9356
+ {
9357
+ "name": "expanded",
9358
+ "type": {
9359
+ "text": "boolean"
9360
+ },
9361
+ "default": "false",
9362
+ "description": "Whether this item's submenu is open. Reflected, and announced as\n`aria-expanded`. Managed by the menu (VfMenu.expand), like\nactive; not part of the authoring API.",
9363
+ "fieldName": "expanded"
9364
+ },
9289
9365
  {
9290
9366
  "name": "checkable",
9291
9367
  "type": {
@@ -9309,7 +9385,7 @@
9309
9385
  "type": {
9310
9386
  "text": "string | undefined"
9311
9387
  },
9312
- "description": "Value reported in the `vf-menu-select` event detail. Defaults to the item's\ntrimmed text content when unset.",
9388
+ "description": "Value reported in the `vf-menu-select` event detail. Defaults to the item's\nlabelText when unset.",
9313
9389
  "fieldName": "value"
9314
9390
  },
9315
9391
  {
@@ -9401,7 +9477,7 @@
9401
9477
  "declarations": [
9402
9478
  {
9403
9479
  "kind": "class",
9404
- "description": "`<vf-menu>` — a pull-down menu: a bar label plus a dropped panel of\n`<vf-menu-item>` / `<vf-separator>` children.\n\nInside a `<vf-menu-bar>` the bar coordinates open state (only one menu open,\nhover-switching, outside-click/Escape dismissal) and owns the pointer\ngesture, which may travel between its menus. Used standalone, the menu\ntoggles itself on label click and manages its own dismissal, its own press\ngesture and item keyboard navigation (ArrowUp/ArrowDown, Home/End, and the\nshared first-letter type-ahead — src/type-ahead.ts) while open.\n\nPointer — the two styles `vf-select` supports, on the same terms (see\nsrc/menu-press.ts): the System 7 press-drag-release (press the title, slide\nonto a command, release over it) and a modern quick tap that leaves the menu\ndropped for a second click.\n\nTakes `top`/`left` like every other element (VfPositioned) — the\nnatural fit being a standalone menu, which is a free-standing menu button and\nplaces like any other control. The panel is anchored to the host's own box\n(`top: 100%`), so it follows a placed menu down without any further work.\nInside a `<vf-menu-bar>`, the bar lays its titles out in flow — placing one\nlifts it off the bar and the titles beside it close the gap. Slotted straight\ninto a `<vf-desktop>`, a free-standing menu sits on the desktop's menu tier\nabove every window, palettes included, as a bar does.",
9480
+ "description": "`<vf-menu>` — a pull-down menu: a bar label plus a dropped panel of\n`<vf-menu-item>` / `<vf-separator>` children.\n\nInside a `<vf-menu-bar>` the bar coordinates open state (only one menu open,\nhover-switching, outside-click/Escape dismissal) and owns the pointer\ngesture, which may travel between its menus. Used standalone, the menu\ntoggles itself on label click and manages its own dismissal, its own press\ngesture and item keyboard navigation (ArrowUp/ArrowDown, Home/End, and the\nshared first-letter type-ahead — src/type-ahead.ts) while open.\n\nPointer — the two styles `vf-select` supports, on the same terms (see\nsrc/menu-press.ts): the System 7 press-drag-release (press the title, slide\nonto a command, release over it) and a modern quick tap that leaves the menu\ndropped for a second click.\n\nA `vf-menu` in a `vf-menu-item`'s `submenu` slot is a **submenu**: no title,\nonly its panel, opened beside its item by the menu holding the item\n(expand). The pointer resting on the item opens it in either style,\nand so do a click or tap on the item, →, Enter and Space. It overlaps its\nparent as System 7.5's did: its first row level with its item, its frame\n5px inside the parent's right edge, covering the parent's frame and\nshadow. It opens on the side its parent opened toward, the right first,\nflips where that side has no room, and moves up to fit the screen. Menus\nnest to any depth.\n\nTakes `top`/`left` like every other element (VfPositioned) — the\nnatural fit being a standalone menu, which is a free-standing menu button and\nplaces like any other control. The panel is anchored to the host's own box\n(`top: 100%`), so it follows a placed menu down without any further work.\nInside a `<vf-menu-bar>`, the bar lays its titles out in flow — placing one\nlifts it off the bar and the titles beside it close the gap. Slotted straight\ninto a `<vf-desktop>`, a free-standing menu sits on the desktop's menu tier\nabove every window, palettes included, as a bar does.",
9405
9481
  "name": "VfMenu",
9406
9482
  "cssProperties": [
9407
9483
  {
@@ -9576,6 +9652,137 @@
9576
9652
  "description": "Whether a `vf-menu-bar` is coordinating this menu.",
9577
9653
  "readonly": true
9578
9654
  },
9655
+ {
9656
+ "kind": "field",
9657
+ "name": "#isSubmenu",
9658
+ "privacy": "private",
9659
+ "type": {
9660
+ "text": "boolean"
9661
+ },
9662
+ "description": "Whether this menu is a submenu: in a `vf-menu-item`'s `submenu` slot.",
9663
+ "readonly": true
9664
+ },
9665
+ {
9666
+ "kind": "field",
9667
+ "name": "_panelEl",
9668
+ "type": {
9669
+ "text": "HTMLElement | null"
9670
+ },
9671
+ "privacy": "private"
9672
+ },
9673
+ {
9674
+ "kind": "field",
9675
+ "name": "panelRect",
9676
+ "type": {
9677
+ "text": "DOMRect | null"
9678
+ },
9679
+ "description": "Viewport rect of the dropped panel, or `null` while closed. The press\ngesture hit-tests the open menus by their panels, deepest first.",
9680
+ "readonly": true
9681
+ },
9682
+ {
9683
+ "kind": "field",
9684
+ "name": "#expanded",
9685
+ "privacy": "private",
9686
+ "type": {
9687
+ "text": "VfMenuItem | null"
9688
+ },
9689
+ "default": "null",
9690
+ "description": "The item whose submenu is open."
9691
+ },
9692
+ {
9693
+ "kind": "field",
9694
+ "name": "#pointer",
9695
+ "privacy": "private",
9696
+ "type": {
9697
+ "text": "VfMenuItem | null | undefined"
9698
+ },
9699
+ "default": "undefined",
9700
+ "description": "Where the pointer is: on a row, on none of this panel (null), or not in it (undefined)."
9701
+ },
9702
+ {
9703
+ "kind": "field",
9704
+ "name": "#side",
9705
+ "privacy": "private",
9706
+ "type": {
9707
+ "text": "'left' | 'right'"
9708
+ },
9709
+ "default": "'right'",
9710
+ "description": "The side this menu opened toward, which its own submenus open toward first."
9711
+ },
9712
+ {
9713
+ "kind": "field",
9714
+ "name": "expandedItem",
9715
+ "type": {
9716
+ "text": "VfMenuItem | null"
9717
+ },
9718
+ "description": "The item in this menu whose submenu is open, or `null`.",
9719
+ "readonly": true
9720
+ },
9721
+ {
9722
+ "kind": "method",
9723
+ "name": "expand",
9724
+ "return": {
9725
+ "type": {
9726
+ "text": "void"
9727
+ }
9728
+ },
9729
+ "parameters": [
9730
+ {
9731
+ "name": "item",
9732
+ "type": {
9733
+ "text": "VfMenuItem | null"
9734
+ }
9735
+ },
9736
+ {
9737
+ "name": "options",
9738
+ "default": "{}",
9739
+ "type": {
9740
+ "text": "{ focus?: boolean }"
9741
+ }
9742
+ }
9743
+ ],
9744
+ "description": "Opens `item`'s submenu, closing the one open in this menu and everything\nunder it; `null` closes it. With `focus`, keyboard focus goes on to the\nsubmenu's first enabled item. The press gesture, the keyboard and an\nitem's `activate()` all open submenus through here. Does nothing while\nthis menu is closed, or for a disabled item or one without a submenu."
9745
+ },
9746
+ {
9747
+ "kind": "method",
9748
+ "name": "pointerOver",
9749
+ "return": {
9750
+ "type": {
9751
+ "text": "void"
9752
+ }
9753
+ },
9754
+ "parameters": [
9755
+ {
9756
+ "name": "row",
9757
+ "type": {
9758
+ "text": "VfMenuItem | null | undefined"
9759
+ }
9760
+ }
9761
+ ],
9762
+ "description": "Where the pointer is, from the press gesture: on `row` of this menu's\npanel, on none of its rows (`null`), or not in its panel (`undefined`).\nThe row under the pointer is highlighted; with the pointer elsewhere, the\nitem whose submenu is open is. Not part of the authoring API."
9763
+ },
9764
+ {
9765
+ "kind": "method",
9766
+ "name": "#paintRows",
9767
+ "privacy": "private",
9768
+ "return": {
9769
+ "type": {
9770
+ "text": "void"
9771
+ }
9772
+ },
9773
+ "description": "Lights the one row this menu highlights: the pointer's, else the open submenu's item."
9774
+ },
9775
+ {
9776
+ "kind": "method",
9777
+ "name": "#place",
9778
+ "privacy": "private",
9779
+ "return": {
9780
+ "type": {
9781
+ "text": "void"
9782
+ }
9783
+ },
9784
+ "description": "Places a submenu just opened: on the side its parent opened toward,\nflipped where that side has no room and the other has, and raised by\nwhole system px to fit above the screen's bottom, never past its top.\nWritten onto the panel directly, before the frame paints."
9785
+ },
9579
9786
  {
9580
9787
  "kind": "field",
9581
9788
  "name": "#internals",
@@ -9651,25 +9858,6 @@
9651
9858
  "name": "#onDocKeydown",
9652
9859
  "privacy": "private"
9653
9860
  },
9654
- {
9655
- "kind": "method",
9656
- "name": "#moveItemFocus",
9657
- "privacy": "private",
9658
- "return": {
9659
- "type": {
9660
- "text": "void"
9661
- }
9662
- },
9663
- "parameters": [
9664
- {
9665
- "name": "direction",
9666
- "type": {
9667
- "text": "1 | -1"
9668
- }
9669
- }
9670
- ],
9671
- "description": "Moves keyboard focus through the enabled items, wrapping at the ends."
9672
- },
9673
9861
  {
9674
9862
  "kind": "field",
9675
9863
  "name": "#docListeners",
@@ -9687,7 +9875,7 @@
9687
9875
  "text": "void"
9688
9876
  }
9689
9877
  },
9690
- "description": "In a bar the host is `role=\"none\"`: the `menubar`'s items are the shadow\n`.label`s (`menuitem`), and while browsers do compute that ownership\nthrough a role-less generic, declaring it keeps the chain explicit.\nStandalone, the host stays role-less — the label is a `button` there."
9878
+ "description": "In a bar the host is `role=\"none\"`: the `menubar`'s items are the shadow\n`.label`s (`menuitem`), and while browsers do compute that ownership\nthrough a role-less generic, declaring it keeps the chain explicit. A\nsubmenu's host is `role=\"none\"` too: its item is the `menuitem`, its\npanel the `menu`. Standalone, the host stays role-less — the label is a\n`button` there."
9691
9879
  },
9692
9880
  {
9693
9881
  "kind": "field",
@@ -70,7 +70,7 @@ function g(t) {
70
70
  _.length && this.error(`${n.name} imports ${_.join(", ")}. An application imports ${f.join(", ")} and its own files.`);
71
71
  try {
72
72
  let t = await h(y);
73
- if (!i("0.19.0", t)) throw Error(`package.json requires vintage-frames ${t}, and the build is on ${e}: move the range`);
73
+ if (!i("0.19.1", t)) throw Error(`package.json requires vintage-frames ${t}, and the build is on ${e}: move the range`);
74
74
  b = await a({
75
75
  manifest: {
76
76
  id: n.id,
@@ -7,10 +7,12 @@ declare const VfMenuBar_base: (new (...args: any[]) => import("../position.js").
7
7
  *
8
8
  * Coordinates its menus: pressing a label opens that menu (and inverts the
9
9
  * label); while any menu is open, hovering another label switches to it;
10
- * Escape, an outside click, or item selection closes. ArrowLeft/ArrowRight
11
- * move between menus while one is open; ArrowDown/ArrowUp move focus through
12
- * the open menu's items, Home/End jump to its first/last, and typed letters
13
- * run the shared Finder first-letter type-ahead (src/type-ahead.ts).
10
+ * Escape, an outside click, or item selection closes. While a menu is open
11
+ * the keyboard is src/menu-navigation.ts's: ArrowDown/ArrowUp move focus
12
+ * through the open menu's items, Home/End jump to its first/last, typed
13
+ * letters run the shared Finder first-letter type-ahead (src/type-ahead.ts),
14
+ * ArrowRight opens an item's submenu and ArrowLeft closes it, and at the top
15
+ * level ArrowLeft/ArrowRight move between menus.
14
16
  *
15
17
  * The bar also owns the **press-drag-release** gesture (see src/menu-press.ts)
16
18
  * — press a title, slide onto a command, release over it — because one press
@@ -8,11 +8,12 @@ import { GridSnapController as o } from "../grid-snap.js";
8
8
  import { DocumentListenersController as s } from "../document-listeners.js";
9
9
  import { SCREEN_CORNER as c, steppedCornerClip as l } from "../pixel-frame.js";
10
10
  import { TypeAheadBuffer as u } from "../type-ahead.js";
11
- import { MenuPressController as d } from "../menu-press.js";
12
- import { LitElement as f, css as p, html as m, unsafeCSS as h } from "lit";
13
- import { property as g, queryAssignedElements as _, state as v } from "lit/decorators.js";
11
+ import { navigateMenus as d } from "../menu-navigation.js";
12
+ import { MenuPressController as f } from "../menu-press.js";
13
+ import { LitElement as p, css as m, html as h, unsafeCSS as g } from "lit";
14
+ import { property as _, queryAssignedElements as v, state as y } from "lit/decorators.js";
14
15
  //#region src/components/vf-menu-bar.ts
15
- var y = class extends r(f) {
16
+ var b = class extends r(p) {
16
17
  constructor(...e) {
17
18
  super(...e), this.scale = new t(this), this.gridSnap = new o(this), this.label = "", this.rounded = !1, this.shortcuts = !1, this._hasEnd = !1, this.#e = null, this.#t = this.attachInternals(), this.#n = new u(), this.#r = null, this.#i = new s(this, () => [[
18
19
  document,
@@ -24,7 +25,7 @@ var y = class extends r(f) {
24
25
  "keydown",
25
26
  this.#_,
26
27
  !0
27
- ]]), this.#a = new d(this, {
28
+ ]]), this.#a = new f(this, {
28
29
  menus: () => this._menus,
29
30
  open: (e) => this.#m(e),
30
31
  close: () => this.#h()
@@ -43,39 +44,15 @@ var y = class extends r(f) {
43
44
  }, this.#g = (e) => {
44
45
  e.composedPath().includes(this) || this.#h();
45
46
  }, this.#_ = (e) => {
46
- if (!(e.defaultPrevented || !this.#e)) switch (e.key) {
47
- case "Escape":
48
- e.preventDefault(), this.#e.focus(), this.#h();
49
- break;
50
- case "Tab":
51
- this.#h();
52
- break;
53
- case "ArrowLeft":
54
- case "ArrowRight":
55
- e.preventDefault(), this.#y(e.key === "ArrowRight" ? 1 : -1);
56
- break;
57
- case "ArrowDown":
58
- case "ArrowUp":
59
- e.preventDefault(), this.#b(e.key === "ArrowDown" ? 1 : -1);
60
- break;
61
- case "Home":
62
- case "End": {
63
- e.preventDefault();
64
- let t = this.#e.items;
65
- t[e.key === "Home" ? 0 : t.length - 1]?.focus();
66
- break;
67
- }
68
- default: {
69
- if (e.key.length !== 1 || e.key === " " || e.metaKey || e.ctrlKey || e.altKey) break;
70
- e.preventDefault();
71
- let t = this.#e.items, n = t.indexOf(document.activeElement);
72
- t[this.#n.feed(e.key, n, t.map((e) => ({
73
- text: e.textContent ?? "",
74
- disabled: !1
75
- })))]?.focus();
76
- break;
77
- }
78
- }
47
+ let t = this.#e;
48
+ t && d(e, {
49
+ menu: t,
50
+ typeAhead: this.#n,
51
+ close: (e) => {
52
+ e && t.focus(), this.#h();
53
+ },
54
+ switchMenu: (e) => this.#y(e)
55
+ });
79
56
  }, this.#v = (e) => {
80
57
  if (this.#e) return;
81
58
  let t = this._menus;
@@ -105,7 +82,7 @@ var y = class extends r(f) {
105
82
  this.styles = [
106
83
  i,
107
84
  a,
108
- p`
85
+ m`
109
86
  :host {
110
87
  display: block;
111
88
  /* 19 white system px over the 1px black rule — Menus.png's bar strip
@@ -177,11 +154,11 @@ var y = class extends r(f) {
177
154
  }
178
155
  :host([rounded]) .bar::before {
179
156
  left: 0;
180
- clip-path: ${h(l(c, "left"))};
157
+ clip-path: ${g(l(c, "left"))};
181
158
  }
182
159
  :host([rounded]) .bar::after {
183
160
  right: 0;
184
- clip-path: ${h(l(c, "right"))};
161
+ clip-path: ${g(l(c, "right"))};
185
162
  }
186
163
  `
187
164
  ];
@@ -206,7 +183,7 @@ var y = class extends r(f) {
206
183
  e.has("label") && (this.#t.ariaLabel = this.label || null);
207
184
  }
208
185
  render() {
209
- return m`
186
+ return h`
210
187
  <div class="bar vf-snap vf-rule-bottom" part="bar" role="presentation">
211
188
  <slot @slotchange=${this.#c}></slot>
212
189
  <slot
@@ -235,11 +212,11 @@ var y = class extends r(f) {
235
212
  #p;
236
213
  #m(e) {
237
214
  for (let t of this._menus) t !== e && (t.open = !1);
238
- e.open = !0, this.#e = e, this.#r = e, this.#n.reset(), this.#l(), this.#i.attach();
215
+ e.open = !0, this.#e = e, this.#r = e, this.#n.reset(), this.#l(), this.#i.attach(), this.#a.track(!0);
239
216
  }
240
217
  #h() {
241
218
  for (let e of this._menus) e.open = !1;
242
- this.#e = null, this.#n.reset(), this.#i.detach(), this.#l();
219
+ this.#e = null, this.#n.reset(), this.#i.detach(), this.#a.track(!1), this.#l();
243
220
  }
244
221
  #g;
245
222
  #_;
@@ -250,23 +227,16 @@ var y = class extends r(f) {
250
227
  let n = t[(t.indexOf(this.#e) + e + t.length) % t.length];
251
228
  n && n !== this.#e && (this.#m(n), n.focus());
252
229
  }
253
- #b(e) {
254
- if (!this.#e) return;
255
- let t = this.#e.items;
256
- if (t.length === 0) return;
257
- let n = t.indexOf(document.activeElement), r;
258
- r = n < 0 ? e === 1 ? 0 : t.length - 1 : (n + e + t.length) % t.length, t[r]?.focus();
259
- }
260
230
  };
261
- n([g()], y.prototype, "label", void 0), n([g({
231
+ n([_()], b.prototype, "label", void 0), n([_({
262
232
  type: Boolean,
263
233
  reflect: !0
264
- })], y.prototype, "rounded", void 0), n([g({
234
+ })], b.prototype, "rounded", void 0), n([_({
265
235
  type: Boolean,
266
236
  reflect: !0
267
- })], y.prototype, "shortcuts", void 0), n([_({
237
+ })], b.prototype, "shortcuts", void 0), n([v({
268
238
  selector: "vf-menu",
269
239
  flatten: !0
270
- })], y.prototype, "_menus", void 0), n([v()], y.prototype, "_hasEnd", void 0), y = n([e("vf-menu-bar")], y);
240
+ })], b.prototype, "_menus", void 0), n([y()], b.prototype, "_hasEnd", void 0), b = n([e("vf-menu-bar")], b);
271
241
  //#endregion
272
- export { y as VfMenuBar };
242
+ export { b as VfMenuBar };