ooxml-ui 0.29.0 → 0.29.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.
@@ -58,6 +58,10 @@ export declare class OfficeUiBackstage extends OfficeElement {
58
58
  backLabel: string | null;
59
59
  private picked;
60
60
  constructor();
61
+ /** The controls Tab visits while open, in order: back, the navigation, then the shown page. */
62
+ private tabStops;
63
+ /** Keeps Tab inside the open File view: past the last control it returns to the first. */
64
+ private trapTab;
61
65
  get selected(): string;
62
66
  set selected(id: string | null);
63
67
  /** Open on a page (default: the selected one) and focus its item. */
@@ -736,12 +736,36 @@ var OfficeUiBackstage = class extends OfficeElement {
736
736
  this.label = null;
737
737
  this.backLabel = null;
738
738
  this.addEventListener("keydown", (event) => {
739
- if (event.key !== "Escape" || !present(this.open)) return;
739
+ if (!present(this.open)) return;
740
+ if (event.key === "Tab") return this.trapTab(event);
741
+ if (event.key !== "Escape") return;
740
742
  event.preventDefault();
741
743
  event.stopPropagation();
742
744
  this.requestClose("escape");
743
745
  });
744
746
  }
747
+ /** The controls Tab visits while open, in order: back, the navigation, then the shown page. */
748
+ tabStops() {
749
+ const chrome = [...this.renderRoot.querySelectorAll("button:not([disabled])")];
750
+ const page = [...this.children].filter((child) => child instanceof HTMLElement && !child.hidden).flatMap((child) => [
751
+ ...child.querySelectorAll(
752
+ 'a[href], button, input, select, textarea, [tabindex]:not([tabindex="-1"])'
753
+ )
754
+ ]).filter((control) => !control.disabled);
755
+ return [...chrome, ...page].filter((control) => control.getClientRects().length > 0);
756
+ }
757
+ /** Keeps Tab inside the open File view: past the last control it returns to the first. */
758
+ trapTab(event) {
759
+ const stops = this.tabStops();
760
+ if (stops.length === 0) return;
761
+ const root = this.getRootNode();
762
+ const current = this.shadowRoot?.activeElement ?? root.activeElement;
763
+ const index = stops.findIndex((control) => control === current || control.contains(current));
764
+ const last = stops.length - 1;
765
+ if (event.shiftKey ? index > 0 : index < last) return;
766
+ event.preventDefault();
767
+ stops[event.shiftKey ? last : 0]?.focus();
768
+ }
745
769
  get selected() {
746
770
  return this.picked ?? "";
747
771
  }
@@ -1717,7 +1741,13 @@ var OfficeUiGallery = class extends OfficeElement {
1717
1741
  /** The open popup; while closed it is not in the DOM, so this is a detached hidden placeholder. */
1718
1742
  get popup() {
1719
1743
  this.ensureRendered();
1720
- return this.querySelector(".popup") ?? this.closedPopup;
1744
+ const open = this.querySelector(".popup");
1745
+ if (open) return open;
1746
+ const attribute = this.constructor.popupAttribute;
1747
+ const id = this.state?.id;
1748
+ if (id === void 0) this.closedPopup.removeAttribute(attribute);
1749
+ else this.closedPopup.setAttribute(attribute, id);
1750
+ return this.closedPopup;
1721
1751
  }
1722
1752
  closedPopup = Object.assign(this.ownerDocument.createElement("div"), {
1723
1753
  className: "popup",
@@ -3430,9 +3460,8 @@ var OfficeUiSelect = class extends OfficeElement {
3430
3460
  choices: { state: true },
3431
3461
  opened: { state: true }
3432
3462
  };
3433
- static get observedAttributes() {
3434
- return [...super.observedAttributes, "aria-label", "variant", "data-font-picker"];
3435
- }
3463
+ /** Attributes the trigger renders from: a change repaints it (a relabel on a language switch). */
3464
+ static watched = ["aria-label", "variant", "data-font-picker"];
3436
3465
  internals;
3437
3466
  observer;
3438
3467
  menuId = `office-ui-select-options-${++uid2}`;
@@ -1,5 +1,5 @@
1
1
  import { installOfficeUiTheme } from './chunk-7QLJS57B.js';
2
- import { registerControls } from './chunk-G4ZGQYBH.js';
2
+ import { registerControls } from './chunk-BDKMSBK6.js';
3
3
  import { registerIcon, getIcon } from './chunk-HZ422LTR.js';
4
4
  import { initialsOf, definePresence } from './chunk-V6W5DKJ6.js';
5
5
  import { definer, OfficeElement, controlStyles } from './chunk-ZWBP2WTC.js';
@@ -1,7 +1,7 @@
1
1
  import { defineSmartArt } from './chunk-4VQ6S7QJ.js';
2
- import { TEAMS_TAGS, registerTeams } from './chunk-AJ2J734X.js';
2
+ import { TEAMS_TAGS, registerTeams } from './chunk-GHQPE2LA.js';
3
3
  import { installOfficeUiTheme } from './chunk-7QLJS57B.js';
4
- import { registerControls } from './chunk-G4ZGQYBH.js';
4
+ import { registerControls } from './chunk-BDKMSBK6.js';
5
5
  import { definePresence } from './chunk-V6W5DKJ6.js';
6
6
 
7
7
  // src/index.ts
package/dist/controls.js CHANGED
@@ -1,4 +1,4 @@
1
- export { CONTROL_DEFINERS, DEFAULT_OFFICE_PROFILE, EMPTY_MENU_STATE, OFFICE_AVATAR_SWATCHES, OFFICE_PROFILE_STORAGE_KEY, OFFICE_TITLE_BAR_SEARCH_LIMIT, OFFICE_TOAST_VISIBLE_LIMIT, assignKeyTips, attachKeyTips, clampFlyoutPosition, clampOptionNumber, clearOfficeProfile, createRibbonOverflow, defineAccount, defineBackstage, defineButton, defineCheckbox, defineCommandSearch, defineContextMenu, defineDialog, defineDialogFooter, defineFindBar, defineGallery, defineIcon, defineMenuButton, defineMenuItem, defineMenuSeparator, defineOptionsDialog, definePasteOptions, definePrintPreview, defineRadio, defineReadOnlyBanner, defineRibbon, defineRibbonGroup, defineRibbonSection, defineRibbonStack, defineRibbonToggle, defineRuler, defineSearchField, defineSelect, defineStatusBar, defineStatusItem, defineSwitch, defineTabStrip, defineTitleBar, defineToasts, defineToolbar, defineZoomSlider, nextEnabledIndex, parseSvgPreview, profileInitials, readOfficeProfile, registerControls, rulerDivisions, runKeyTips, sanitizeOfficeProfile, typeAheadIndex, writeOfficeProfile } from './chunk-G4ZGQYBH.js';
1
+ export { CONTROL_DEFINERS, DEFAULT_OFFICE_PROFILE, EMPTY_MENU_STATE, OFFICE_AVATAR_SWATCHES, OFFICE_PROFILE_STORAGE_KEY, OFFICE_TITLE_BAR_SEARCH_LIMIT, OFFICE_TOAST_VISIBLE_LIMIT, assignKeyTips, attachKeyTips, clampFlyoutPosition, clampOptionNumber, clearOfficeProfile, createRibbonOverflow, defineAccount, defineBackstage, defineButton, defineCheckbox, defineCommandSearch, defineContextMenu, defineDialog, defineDialogFooter, defineFindBar, defineGallery, defineIcon, defineMenuButton, defineMenuItem, defineMenuSeparator, defineOptionsDialog, definePasteOptions, definePrintPreview, defineRadio, defineReadOnlyBanner, defineRibbon, defineRibbonGroup, defineRibbonSection, defineRibbonStack, defineRibbonToggle, defineRuler, defineSearchField, defineSelect, defineStatusBar, defineStatusItem, defineSwitch, defineTabStrip, defineTitleBar, defineToasts, defineToolbar, defineZoomSlider, nextEnabledIndex, parseSvgPreview, profileInitials, readOfficeProfile, registerControls, rulerDivisions, runKeyTips, sanitizeOfficeProfile, typeAheadIndex, writeOfficeProfile } from './chunk-BDKMSBK6.js';
2
2
  import './chunk-HZ422LTR.js';
3
3
  import './chunk-V6W5DKJ6.js';
4
4
  import './chunk-ZWBP2WTC.js';
package/dist/docx.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { defineSmartArt } from './chunk-4VQ6S7QJ.js';
2
2
  import { shadcnBridge } from './chunk-7QLJS57B.js';
3
- import { createRibbonOverflow, defineRibbon, defineDialog, defineSearchField, defineSwitch, defineTitleBar, defineBackstage, defineStatusBar, defineZoomSlider, defineContextMenu, runKeyTips, assignKeyTips } from './chunk-G4ZGQYBH.js';
3
+ import { createRibbonOverflow, defineRibbon, defineDialog, defineSearchField, defineSwitch, defineTitleBar, defineBackstage, defineStatusBar, defineZoomSlider, defineContextMenu, runKeyTips, assignKeyTips } from './chunk-BDKMSBK6.js';
4
4
  import { registerIcon } from './chunk-HZ422LTR.js';
5
5
  import './chunk-V6W5DKJ6.js';
6
6
  import './chunk-ZWBP2WTC.js';
@@ -20557,7 +20557,10 @@ function attachEditorInteractions(core, frame) {
20557
20557
  if (region === "document") return toDocument();
20558
20558
  const root = regionElement(region);
20559
20559
  if (region === "ribbon" && root) return root.focusTab();
20560
- (root?.querySelector("button:not([hidden])") ?? root)?.focus();
20560
+ const buttons = [
20561
+ ...(root?.shadowRoot ?? root)?.querySelectorAll("button:not([hidden])") ?? []
20562
+ ];
20563
+ (buttons.find((button3) => button3.getClientRects().length > 0) ?? root)?.focus();
20561
20564
  };
20562
20565
  const layers = [
20563
20566
  { element: void 0, isOpen: () => menu.isOpen, close: () => menu.close(), selfHandled: true },
@@ -67,7 +67,8 @@ export declare class OfficeUiSelect extends OfficeElement {
67
67
  active: number;
68
68
  choices: SelectChoice[];
69
69
  opened: boolean;
70
- static get observedAttributes(): string[];
70
+ /** Attributes the trigger renders from: a change repaints it (a relabel on a language switch). */
71
+ static watched: string[];
71
72
  private readonly internals;
72
73
  private readonly observer;
73
74
  private readonly menuId;
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
- export { OFFICE_UI_TAGS, registerOfficeUi } from './chunk-A56QI2OA.js';
1
+ export { OFFICE_UI_TAGS, registerOfficeUi } from './chunk-KAPSBHAS.js';
2
2
  export { OfficeUiSmartArt, defineSmartArt, renderDiagramDrawing } from './chunk-4VQ6S7QJ.js';
3
- export { EMOJI, OfficeUiAppRail, OfficeUiAvatar, OfficeUiCallControls, OfficeUiCallGrid, OfficeUiChannelList, OfficeUiChatComposer, OfficeUiChatList, OfficeUiPrejoin, QUICK_REACTIONS, TEAMS_TAGS, TeamsApp, TeamsController, TeamsElement, TeamsSettings, applyTeamsProps, colorFor, createTeams, dayLabel, defineAppRail, defineAvatar, defineCallControls, defineCallGrid, defineChannelList, defineChatComposer, defineChatList, definePrejoin, defineTeamsApp, defineTeamsSettings, formatElapsed, formatSize, formatTime, icon, listenTeamsEvents, loadConfig, loadIdentity, parseIceLines, registerTeams, safeStorage, saveConfig, saveIdentity, withStyles } from './chunk-AJ2J734X.js';
3
+ export { EMOJI, OfficeUiAppRail, OfficeUiAvatar, OfficeUiCallControls, OfficeUiCallGrid, OfficeUiChannelList, OfficeUiChatComposer, OfficeUiChatList, OfficeUiPrejoin, QUICK_REACTIONS, TEAMS_TAGS, TeamsApp, TeamsController, TeamsElement, TeamsSettings, applyTeamsProps, colorFor, createTeams, dayLabel, defineAppRail, defineAvatar, defineCallControls, defineCallGrid, defineChannelList, defineChatComposer, defineChatList, definePrejoin, defineTeamsApp, defineTeamsSettings, formatElapsed, formatSize, formatTime, icon, listenTeamsEvents, loadConfig, loadIdentity, parseIceLines, registerTeams, safeStorage, saveConfig, saveIdentity, withStyles } from './chunk-GHQPE2LA.js';
4
4
  export { THEME_CSS, THEME_STYLE_ID, installOfficeUiTheme, shadcnBridge, themeBridge } from './chunk-7QLJS57B.js';
5
- export { CONTROL_DEFINERS, DEFAULT_OFFICE_PROFILE, EMPTY_MENU_STATE, OFFICE_AVATAR_SWATCHES, OFFICE_PROFILE_STORAGE_KEY, OFFICE_TITLE_BAR_SEARCH_LIMIT, OFFICE_TOAST_VISIBLE_LIMIT, assignKeyTips, attachKeyTips, clampFlyoutPosition, clampOptionNumber, clearOfficeProfile, createRibbonOverflow, defineAccount, defineBackstage, defineButton, defineCheckbox, defineCommandSearch, defineContextMenu, defineDialog, defineDialogFooter, defineFindBar, defineGallery, defineIcon, defineMenuButton, defineMenuItem, defineMenuSeparator, defineOptionsDialog, definePasteOptions, definePrintPreview, defineRadio, defineReadOnlyBanner, defineRibbon, defineRibbonGroup, defineRibbonSection, defineRibbonStack, defineRibbonToggle, defineRuler, defineSearchField, defineSelect, defineStatusBar, defineStatusItem, defineSwitch, defineTabStrip, defineTitleBar, defineToasts, defineToolbar, defineZoomSlider, glyph, nextEnabledIndex, parseSvgPreview, profileInitials, readOfficeProfile, registerControls, rulerDivisions, runKeyTips, sanitizeOfficeProfile, typeAheadIndex, writeOfficeProfile } from './chunk-G4ZGQYBH.js';
5
+ export { CONTROL_DEFINERS, DEFAULT_OFFICE_PROFILE, EMPTY_MENU_STATE, OFFICE_AVATAR_SWATCHES, OFFICE_PROFILE_STORAGE_KEY, OFFICE_TITLE_BAR_SEARCH_LIMIT, OFFICE_TOAST_VISIBLE_LIMIT, assignKeyTips, attachKeyTips, clampFlyoutPosition, clampOptionNumber, clearOfficeProfile, createRibbonOverflow, defineAccount, defineBackstage, defineButton, defineCheckbox, defineCommandSearch, defineContextMenu, defineDialog, defineDialogFooter, defineFindBar, defineGallery, defineIcon, defineMenuButton, defineMenuItem, defineMenuSeparator, defineOptionsDialog, definePasteOptions, definePrintPreview, defineRadio, defineReadOnlyBanner, defineRibbon, defineRibbonGroup, defineRibbonSection, defineRibbonStack, defineRibbonToggle, defineRuler, defineSearchField, defineSelect, defineStatusBar, defineStatusItem, defineSwitch, defineTabStrip, defineTitleBar, defineToasts, defineToolbar, defineZoomSlider, glyph, nextEnabledIndex, parseSvgPreview, profileInitials, readOfficeProfile, registerControls, rulerDivisions, runKeyTips, sanitizeOfficeProfile, typeAheadIndex, writeOfficeProfile } from './chunk-BDKMSBK6.js';
6
6
  export { createIconSvg, getIcon, listIcons, paintIcon, registerIcon } from './chunk-HZ422LTR.js';
7
7
  export { OfficeUiPresence, definePresence, initialsOf, participantsFromAwareness } from './chunk-V6W5DKJ6.js';
8
8
  export { CONTRACT_REVISION, OfficeElement, controlStyles, flag, readFlag, triState, valueOn, withTokens } from './chunk-ZWBP2WTC.js';
package/dist/teams.js CHANGED
@@ -1,6 +1,6 @@
1
- export { EMOJI, OfficeUiAppRail, OfficeUiAvatar, OfficeUiCallControls, OfficeUiCallGrid, OfficeUiChannelList, OfficeUiChatComposer, OfficeUiChatList, OfficeUiPrejoin, QUICK_REACTIONS, TEAMS_TAGS, TeamsApp, TeamsController, TeamsElement, TeamsSettings, applyTeamsProps, colorFor, createTeams, dayLabel, defineAppRail, defineAvatar, defineCallControls, defineCallGrid, defineChannelList, defineChatComposer, defineChatList, definePrejoin, defineTeamsApp, defineTeamsSettings, formatElapsed, formatSize, formatTime, icon, listenTeamsEvents, loadConfig, loadIdentity, parseIceLines, registerTeams, safeStorage, saveConfig, saveIdentity, withStyles } from './chunk-AJ2J734X.js';
1
+ export { EMOJI, OfficeUiAppRail, OfficeUiAvatar, OfficeUiCallControls, OfficeUiCallGrid, OfficeUiChannelList, OfficeUiChatComposer, OfficeUiChatList, OfficeUiPrejoin, QUICK_REACTIONS, TEAMS_TAGS, TeamsApp, TeamsController, TeamsElement, TeamsSettings, applyTeamsProps, colorFor, createTeams, dayLabel, defineAppRail, defineAvatar, defineCallControls, defineCallGrid, defineChannelList, defineChatComposer, defineChatList, definePrejoin, defineTeamsApp, defineTeamsSettings, formatElapsed, formatSize, formatTime, icon, listenTeamsEvents, loadConfig, loadIdentity, parseIceLines, registerTeams, safeStorage, saveConfig, saveIdentity, withStyles } from './chunk-GHQPE2LA.js';
2
2
  import './chunk-7QLJS57B.js';
3
- import './chunk-G4ZGQYBH.js';
3
+ import './chunk-BDKMSBK6.js';
4
4
  import './chunk-HZ422LTR.js';
5
5
  import './chunk-V6W5DKJ6.js';
6
6
  import './chunk-ZWBP2WTC.js';
package/dist/visio.js CHANGED
@@ -1,4 +1,4 @@
1
- import { attachKeyTips, registerControls, readOfficeProfile, sanitizeOfficeProfile, writeOfficeProfile } from './chunk-G4ZGQYBH.js';
1
+ import { attachKeyTips, registerControls, readOfficeProfile, sanitizeOfficeProfile, writeOfficeProfile } from './chunk-BDKMSBK6.js';
2
2
  import { getIcon, registerIcon } from './chunk-HZ422LTR.js';
3
3
  import { definePresence } from './chunk-V6W5DKJ6.js';
4
4
  import './chunk-ZWBP2WTC.js';
package/dist/xlsx.js CHANGED
@@ -1,8 +1,8 @@
1
- import './chunk-A56QI2OA.js';
1
+ import './chunk-KAPSBHAS.js';
2
2
  import { defineSmartArt } from './chunk-4VQ6S7QJ.js';
3
- import './chunk-AJ2J734X.js';
3
+ import './chunk-GHQPE2LA.js';
4
4
  import './chunk-7QLJS57B.js';
5
- import { createRibbonOverflow, defineBackstage, defineRibbon, defineTitleBar, defineStatusBar, defineZoomSlider, defineDialog, runKeyTips, assignKeyTips, defineCheckbox, defineContextMenu } from './chunk-G4ZGQYBH.js';
5
+ import { createRibbonOverflow, defineBackstage, defineRibbon, defineTitleBar, defineStatusBar, defineZoomSlider, defineDialog, runKeyTips, assignKeyTips, defineCheckbox, defineContextMenu } from './chunk-BDKMSBK6.js';
6
6
  import { getIcon, registerIcon } from './chunk-HZ422LTR.js';
7
7
  import './chunk-V6W5DKJ6.js';
8
8
  import './chunk-ZWBP2WTC.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ooxml-ui",
3
- "version": "0.29.0",
3
+ "version": "0.29.1",
4
4
  "description": "Shared, format-neutral web components and styles for the Office viewers (Word, PowerPoint, Excel)",
5
5
  "keywords": [
6
6
  "custom-elements",
@@ -101,7 +101,7 @@
101
101
  "dependencies": {
102
102
  "emf-converter": "4.8.9",
103
103
  "lit": "^3.3.3",
104
- "ooxml-core": "^0.20.0",
104
+ "ooxml-core": "^0.21.0",
105
105
  "prosemirror-collab": "^1.3.1",
106
106
  "prosemirror-commands": "^1.7.2",
107
107
  "prosemirror-history": "^1.5.1",