Skip to content

v0.7.0

Compare
Choose a tag to compare
@1j01 1j01 released this 29 May 20:37
· 145 commits to master since this release

Full Changelog: v0.6.0...v0.7.0

Deprecated

Added

  • AccessKeys API for parsing and rendering labels with access keys (syntax: & defines the following character as the access key, && inserts one literal ampersand)
    • AccessKeys.escape(label) escapes ampersands by doubling them
    • AccessKeys.unescape(label) unescapes ampersands by removing one of each pair
    • AccessKeys.has(label) returns whether the label has an access key
    • AccessKeys.get(label) returns the access key character, or null if there isn't one
    • AccessKeys.remove(label) returns plain text without access key indicator, like AccessKeys.toText() but with a special case to remove parentheticals such as " (&N)" rather than just the ampersand
    • AccessKeys.toText(label) returns plain text without access key syntax
    • AccessKeys.toHTML(label) returns HTML with <span class="menu-hotkey"> around the access key (uses AccessKeys.toFragment for security)
    • AccessKeys.toFragment(label) returns a DocumentFragment with <span class="menu-hotkey"> wrapping the access key character
    • private AccessKeys.indexOf(label) (don't use this)
    • (In the future, the CSS class "menu-hotkey" may be renamed to "access-key", perhaps with a prefix.)
  • Radio menu item support
    • In menu item lists, you can create radio groups by including an object with radioItems, getValue, setValue, and optionally ariaLabel properties.
      • radioItems is an array of menu item specifications, which can also include value for the option value.
    • (Commits: 1, 2, 3, 4)
  • TypeScript types for the whole library
    • Type declarations are included as part of the os-gui package, in os-gui.d.ts
    • You may need to reference the declarations file explicitly in your tsconfig.json's include or files array, or use a /// <reference path="node_modules/os-gui/os-gui.d.ts" /> directive. I'm not sure how exactly this is supposed to work.
  • $Window methods:
    • experimental onFocus, onBlur, and onClosed API for events (looking to remove dependency on jQuery)
    • private addChildWindow($window) (don't use this)
    • private unminimize() (don't use this)
  • $Window properties:
    • closed: Whether the window has been closed.
    • icons: The icons of the window at different sizes, as set by options.icons or setIcons().
    • $minimize: the minimize button
    • $maximize: the maximize button
    • private $title_area (don't use this)
    • private $icon (don't use this)
  • $Window property element (already mentioned but now has a section like other properties)
  • Menu item specification properties:
    • shortcutLabel for defining the label of the shortcut key combination separately from the ariaKeyShortcuts property; this replaces the old shortcut property
    • ariaKeyShortcuts for defining the access key combination for the menu item. Must follow aria-keyshortcuts syntax.
    • label for defining the label of the menu item; this replaces the old item property
    • value (only for radio items) for defining a radio option value
  • Docs for positioning windows

Changed

Fixed

see Changed