ooxml-ui 0.20.0 → 0.22.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 (114) hide show
  1. package/README.md +47 -2
  2. package/dist/base.d.ts +118 -0
  3. package/dist/{account.d.ts → chrome/account-profile.d.ts} +0 -6
  4. package/dist/chrome/account.d.ts +17 -0
  5. package/dist/chrome/backstage.d.ts +78 -0
  6. package/dist/chrome/find-bar.d.ts +111 -0
  7. package/dist/chrome/print-preview.d.ts +39 -0
  8. package/dist/chrome/ruler.d.ts +43 -0
  9. package/dist/chrome/status-bar.d.ts +80 -0
  10. package/dist/chrome/status-item.d.ts +40 -0
  11. package/dist/chrome/tab-strip.d.ts +88 -0
  12. package/dist/chrome/title-bar-types.d.ts +75 -0
  13. package/dist/chrome/title-bar.d.ts +81 -0
  14. package/dist/{chunk-7XBKSYGM.js → chunk-2X6QYQ3Q.js} +10 -1
  15. package/dist/{chunk-4JQLQROF.js → chunk-3MDKXKKQ.js} +53 -65
  16. package/dist/chunk-5A4REH6T.js +259 -0
  17. package/dist/chunk-E47762NY.js +90 -0
  18. package/dist/chunk-HNGJI5EZ.js +834 -0
  19. package/dist/{chunk-G3LAGZEW.js → chunk-HSJH6SUW.js} +33 -1
  20. package/dist/{chunk-W5PYFBEZ.js → chunk-HZ422LTR.js} +1 -49
  21. package/dist/chunk-LKLZOPTO.js +4536 -0
  22. package/dist/controls.d.ts +56 -46
  23. package/dist/controls.js +5 -5
  24. package/dist/dialog/dialog-footer.d.ts +40 -0
  25. package/dist/dialog/dialog.d.ts +52 -0
  26. package/dist/{options.d.ts → dialog/options-dialog.d.ts} +46 -1
  27. package/dist/form/checkable.d.ts +49 -0
  28. package/dist/form/checkbox.d.ts +8 -0
  29. package/dist/form/radio.d.ts +68 -0
  30. package/dist/form/search-field.d.ts +54 -0
  31. package/dist/{select-menu.d.ts → form/select-menu.d.ts} +3 -13
  32. package/dist/form/select.d.ts +115 -0
  33. package/dist/form/switch.d.ts +11 -0
  34. package/dist/form/zoom-slider.d.ts +78 -0
  35. package/dist/glyph.d.ts +2 -0
  36. package/dist/icon.d.ts +19 -0
  37. package/dist/icons.d.ts +0 -3
  38. package/dist/icons.js +1 -3
  39. package/dist/index.d.ts +4 -1
  40. package/dist/index.js +16 -12
  41. package/dist/menu/command-search.d.ts +74 -0
  42. package/dist/menu/context-menu.d.ts +89 -0
  43. package/dist/menu/menu-button.d.ts +77 -0
  44. package/dist/menu/menu-item.d.ts +52 -0
  45. package/dist/{menu-model.d.ts → menu/menu-model.d.ts} +2 -0
  46. package/dist/menu/menu-separator.d.ts +7 -0
  47. package/dist/notices/paste-options.d.ts +41 -0
  48. package/dist/notices/read-only-banner.d.ts +53 -0
  49. package/dist/notices/toasts.d.ts +40 -0
  50. package/dist/presence/presence.d.ts +53 -0
  51. package/dist/presence.d.ts +1 -31
  52. package/dist/presence.js +3 -3
  53. package/dist/ribbon/button.d.ts +60 -0
  54. package/dist/ribbon/gallery-styles.d.ts +2 -0
  55. package/dist/ribbon/gallery.d.ts +97 -0
  56. package/dist/ribbon/ribbon-group.d.ts +35 -0
  57. package/dist/{ribbon-section.d.ts → ribbon/ribbon-section.d.ts} +14 -1
  58. package/dist/ribbon/ribbon-stack.d.ts +10 -0
  59. package/dist/ribbon/ribbon-tabs.d.ts +82 -0
  60. package/dist/ribbon/ribbon-toggle.d.ts +49 -0
  61. package/dist/ribbon/ribbon-toolbar.d.ts +15 -0
  62. package/dist/smartart/smartart.d.ts +43 -0
  63. package/dist/smartart.d.ts +1 -14
  64. package/dist/smartart.js +3 -3
  65. package/dist/styles.d.ts +1 -4
  66. package/dist/teams/app-rail.d.ts +29 -0
  67. package/dist/teams/avatar.d.ts +39 -0
  68. package/dist/teams/base.d.ts +17 -0
  69. package/dist/teams/call-controls.d.ts +61 -0
  70. package/dist/teams/call-grid.d.ts +33 -0
  71. package/dist/teams/channel-list.d.ts +40 -0
  72. package/dist/teams/chat-composer.d.ts +60 -0
  73. package/dist/teams/chat-list.d.ts +51 -0
  74. package/dist/teams/icons.d.ts +3 -0
  75. package/dist/teams/index.d.ts +14 -0
  76. package/dist/teams/prejoin.d.ts +40 -0
  77. package/dist/teams.js +5 -0
  78. package/dist/theme.js +2 -2
  79. package/dist/tokens.d.ts +245 -214
  80. package/package.json +12 -6
  81. package/dist/backstage.d.ts +0 -28
  82. package/dist/button.d.ts +0 -14
  83. package/dist/checkable.d.ts +0 -4
  84. package/dist/chrome-controls.d.ts +0 -52
  85. package/dist/chunk-24MMSCKW.js +0 -119
  86. package/dist/chunk-UEJ4F33J.js +0 -78
  87. package/dist/chunk-W7YI5DSJ.js +0 -5970
  88. package/dist/command-search.d.ts +0 -18
  89. package/dist/context-menu.d.ts +0 -20
  90. package/dist/dialog.d.ts +0 -13
  91. package/dist/document-notices.d.ts +0 -55
  92. package/dist/find-bar.d.ts +0 -15
  93. package/dist/gallery-styles.d.ts +0 -7
  94. package/dist/gallery-view.d.ts +0 -53
  95. package/dist/gallery.d.ts +0 -20
  96. package/dist/menu.d.ts +0 -15
  97. package/dist/print-preview.d.ts +0 -11
  98. package/dist/radio.d.ts +0 -1
  99. package/dist/ribbon-tabs.d.ts +0 -14
  100. package/dist/ribbon-toggle.d.ts +0 -1
  101. package/dist/ribbon.d.ts +0 -24
  102. package/dist/ruler.d.ts +0 -10
  103. package/dist/search-field.d.ts +0 -1
  104. package/dist/select-styles.d.ts +0 -6
  105. package/dist/select.d.ts +0 -19
  106. package/dist/status-bar-view.d.ts +0 -50
  107. package/dist/status-bar.d.ts +0 -19
  108. package/dist/tab-strip.d.ts +0 -20
  109. package/dist/title-bar-search.d.ts +0 -43
  110. package/dist/title-bar-strip.d.ts +0 -20
  111. package/dist/title-bar.d.ts +0 -49
  112. package/dist/zoom-slider.d.ts +0 -9
  113. /package/dist/{safe-svg.d.ts → ribbon/safe-svg.d.ts} +0 -0
  114. /package/dist/{smartart-svg.d.ts → smartart/smartart-svg.d.ts} +0 -0
@@ -0,0 +1,78 @@
1
+ import { OfficeElement } from '../base.js';
2
+ /**
3
+ * Office status-bar zoom: zoom out, slider, zoom in, percentage and an optional fit button.
4
+ * Attributes: `value` (percent, default 100), `min` (10), `max` (400), `step` (10, for the
5
+ * buttons), `disabled`, `fit` (shows the fit button; its value is the button's name, e.g.
6
+ * "Fit page to current window"), `label` (group name, default "Zoom"). `out-label`, `in-label` and
7
+ * `slider-label` name the zoom-out button, zoom-in button and slider (English by default), so a
8
+ * product can translate them.
9
+ * User changes emit native `input` (slider drag) and `change` events with `value` updated;
10
+ * the fit button emits `office-command` `{ command: 'zoom-fit' }`. Setting `value` never emits.
11
+ */
12
+ export declare class OfficeUiZoomSlider extends OfficeElement {
13
+ static styles: import("lit").CSSResult[];
14
+ static properties: {
15
+ value: {
16
+ type: NumberConstructor;
17
+ reflect: boolean;
18
+ noAccessor: boolean;
19
+ };
20
+ min: {
21
+ type: NumberConstructor;
22
+ };
23
+ max: {
24
+ type: NumberConstructor;
25
+ };
26
+ step: {
27
+ type: NumberConstructor;
28
+ };
29
+ disabled: {
30
+ type: BooleanConstructor;
31
+ reflect: true;
32
+ converter: {
33
+ fromAttribute: (value: string | null) => boolean;
34
+ toAttribute: (value: unknown) => string | null;
35
+ };
36
+ };
37
+ fit: {
38
+ type: StringConstructor;
39
+ reflect: boolean;
40
+ };
41
+ label: {
42
+ type: StringConstructor;
43
+ };
44
+ outLabel: {
45
+ type: StringConstructor;
46
+ attribute: string;
47
+ };
48
+ inLabel: {
49
+ type: StringConstructor;
50
+ attribute: string;
51
+ };
52
+ sliderLabel: {
53
+ type: StringConstructor;
54
+ attribute: string;
55
+ };
56
+ };
57
+ min: number;
58
+ max: number;
59
+ step: number;
60
+ disabled: boolean;
61
+ fit: string | null;
62
+ label: string | null;
63
+ outLabel: string | null;
64
+ inLabel: string | null;
65
+ sliderLabel: string | null;
66
+ private requested;
67
+ constructor();
68
+ get value(): number;
69
+ set value(next: number);
70
+ private get low();
71
+ private get high();
72
+ /** Office buttons snap to the next multiple of `step`, so 67% steps to 70%, not 77%. */
73
+ private stepBy;
74
+ private commit;
75
+ protected willUpdate(): void;
76
+ protected render(): import("lit").TemplateResult<1>;
77
+ }
78
+ export declare const defineZoomSlider: import("../registry.js").Definer;
@@ -0,0 +1,2 @@
1
+ import { type TemplateResult } from 'lit';
2
+ export declare function glyph(name: string | null | undefined, className?: string, hidden?: boolean): TemplateResult;
package/dist/icon.d.ts ADDED
@@ -0,0 +1,19 @@
1
+ import { OfficeElement } from './base.js';
2
+ /** `<office-ui-icon name="check" label="Done">`: decorative unless `label` is set. */
3
+ export declare class OfficeUiIcon extends OfficeElement {
4
+ static styles: import("lit").CSSResult[];
5
+ static properties: {
6
+ name: {
7
+ type: StringConstructor;
8
+ };
9
+ label: {
10
+ type: StringConstructor;
11
+ };
12
+ };
13
+ name: string;
14
+ label: string;
15
+ constructor();
16
+ protected willUpdate(): void;
17
+ protected render(): import("lit").TemplateResult;
18
+ }
19
+ export declare const defineIcon: import("./registry.js").Definer;
package/dist/icons.d.ts CHANGED
@@ -11,6 +11,3 @@ export declare function listIcons(): string[];
11
11
  export declare function createIconSvg(doc: Document): SVGSVGElement;
12
12
  /** Fill an `<svg>` with a registered icon (empty when unknown). Used by every control. */
13
13
  export declare function paintIcon(svg: SVGElement, name: string | null | undefined): boolean;
14
- export declare const ICON_CSS = "\nsvg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.5;\n\tstroke-linecap: round; stroke-linejoin: round; }\n";
15
- /** `<office-ui-icon name="check" label="Done">`: decorative unless `label` is set. */
16
- export declare const defineIcon: import("./registry.js").Definer;
package/dist/icons.js CHANGED
@@ -1,3 +1 @@
1
- export { ICON_CSS, createIconSvg, defineIcon, getIcon, listIcons, paintIcon, registerIcon } from './chunk-W5PYFBEZ.js';
2
- import './chunk-UEJ4F33J.js';
3
- import './chunk-G3LAGZEW.js';
1
+ export { createIconSvg, getIcon, listIcons, paintIcon, registerIcon } from './chunk-HZ422LTR.js';
package/dist/index.d.ts CHANGED
@@ -1,11 +1,14 @@
1
+ export * from './base.js';
1
2
  export * from './controls.js';
3
+ export * from './glyph.js';
2
4
  export * from './icons.js';
3
5
  export * from './presence.js';
4
6
  export * from './smartart.js';
7
+ export * from './teams/index.js';
5
8
  export * from './theme.js';
6
9
  export { CONTRACT_REVISION, type Definer } from './registry.js';
7
10
  /** Every ooxml-ui tag this package defines, in registration order. */
8
- export declare const OFFICE_UI_TAGS: readonly ["office-ui-icon", "office-ui-button", "office-ui-checkbox", "office-ui-switch", "office-ui-select", "office-ui-ribbon-group", "office-ui-ribbon-stack", "office-ui-menu-item", "office-ui-menu-button", "office-ui-menu-separator", "office-ui-context-menu", "office-ui-command-search", "office-ui-toolbar", "office-ui-dialog", "office-ui-status-bar", "office-ui-status-item", "office-ui-zoom-slider", "office-ui-tab-strip", "office-ui-options-dialog", "office-ui-account", "office-ui-ribbon", "office-ui-find-bar", "office-ui-ruler", "office-ui-backstage", "office-ui-print-preview", "office-ui-radio", "office-ui-search", "office-ui-ribbon-toggle", "office-ui-dialog-footer", "office-ui-toasts", "office-ui-read-only-banner", "office-ui-paste-options", "office-ui-title-bar", "office-ui-ribbon-section", "office-ui-gallery", "office-ui-presence", "office-ui-smartart"];
11
+ export declare const OFFICE_UI_TAGS: readonly ["office-ui-icon", "office-ui-button", "office-ui-checkbox", "office-ui-switch", "office-ui-select", "office-ui-ribbon-group", "office-ui-ribbon-stack", "office-ui-menu-item", "office-ui-menu-button", "office-ui-menu-separator", "office-ui-context-menu", "office-ui-command-search", "office-ui-toolbar", "office-ui-dialog", "office-ui-status-bar", "office-ui-status-item", "office-ui-zoom-slider", "office-ui-tab-strip", "office-ui-options-dialog", "office-ui-account", "office-ui-ribbon", "office-ui-find-bar", "office-ui-ruler", "office-ui-backstage", "office-ui-print-preview", "office-ui-radio", "office-ui-search", "office-ui-ribbon-toggle", "office-ui-dialog-footer", "office-ui-toasts", "office-ui-read-only-banner", "office-ui-paste-options", "office-ui-title-bar", "office-ui-ribbon-section", "office-ui-gallery", "office-ui-presence", "office-ui-smartart", "office-ui-avatar", "office-ui-app-rail", "office-ui-channel-list", "office-ui-chat-list", "office-ui-chat-composer", "office-ui-prejoin", "office-ui-call-grid", "office-ui-call-controls"];
9
12
  /**
10
13
  * Install the theme tokens and define every element. Idempotent and safe to call from every
11
14
  * viewer binding; a no-op where there is no DOM (SSR).
package/dist/index.js CHANGED
@@ -1,14 +1,16 @@
1
- import { installOfficeUiTheme } from './chunk-7XBKSYGM.js';
2
- export { THEME_CSS, THEME_STYLE_ID, installOfficeUiTheme } from './chunk-7XBKSYGM.js';
3
- import { registerControls } from './chunk-W7YI5DSJ.js';
4
- 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, attachKeyTips, clampFlyoutPosition, clampOptionNumber, clearOfficeProfile, defineAccount, defineBackstage, defineButton, defineCheckbox, defineCommandSearch, defineContextMenu, defineDialog, defineDialogFooter, defineFindBar, defineGallery, 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, sanitizeOfficeProfile, typeAheadIndex, writeOfficeProfile } from './chunk-W7YI5DSJ.js';
5
- export { ICON_CSS, createIconSvg, defineIcon, getIcon, listIcons, paintIcon, registerIcon } from './chunk-W5PYFBEZ.js';
6
- import { definePresence } from './chunk-24MMSCKW.js';
7
- export { definePresence, initialsOf, participantsFromAwareness } from './chunk-24MMSCKW.js';
8
- import { defineSmartArt } from './chunk-4JQLQROF.js';
9
- export { defineSmartArt, renderDiagramDrawing } from './chunk-4JQLQROF.js';
10
- export { CONTRACT_REVISION } from './chunk-UEJ4F33J.js';
11
- export { COMPACT, FOCUS_RING, OFFICE_TOKENS, TOUCH, tok } from './chunk-G3LAGZEW.js';
1
+ import { installOfficeUiTheme } from './chunk-2X6QYQ3Q.js';
2
+ export { THEME_CSS, THEME_STYLE_ID, installOfficeUiTheme } from './chunk-2X6QYQ3Q.js';
3
+ import { registerControls } from './chunk-LKLZOPTO.js';
4
+ 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, attachKeyTips, clampFlyoutPosition, clampOptionNumber, clearOfficeProfile, 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, sanitizeOfficeProfile, typeAheadIndex, writeOfficeProfile } from './chunk-LKLZOPTO.js';
5
+ import { defineSmartArt } from './chunk-3MDKXKKQ.js';
6
+ export { OfficeUiSmartArt, defineSmartArt, renderDiagramDrawing } from './chunk-3MDKXKKQ.js';
7
+ import { TEAMS_TAGS, registerTeams } from './chunk-HNGJI5EZ.js';
8
+ export { EMOJI, OfficeUiAppRail, OfficeUiAvatar, OfficeUiCallControls, OfficeUiCallGrid, OfficeUiChannelList, OfficeUiChatComposer, OfficeUiChatList, OfficeUiPrejoin, QUICK_REACTIONS, TEAMS_TAGS, TeamsElement, colorFor, dayLabel, defineAppRail, defineAvatar, defineCallControls, defineCallGrid, defineChannelList, defineChatComposer, defineChatList, definePrejoin, formatElapsed, formatSize, formatTime, icon, registerTeams, withStyles } from './chunk-HNGJI5EZ.js';
9
+ export { createIconSvg, getIcon, listIcons, paintIcon, registerIcon } from './chunk-HZ422LTR.js';
10
+ import { definePresence } from './chunk-E47762NY.js';
11
+ export { OfficeUiPresence, definePresence, initialsOf, participantsFromAwareness } from './chunk-E47762NY.js';
12
+ export { CONTRACT_REVISION, OfficeElement, controlStyles, flag, readFlag, triState, valueOn, withTokens } from './chunk-5A4REH6T.js';
13
+ export { COMPACT, FOCUS_RING, OFFICE_TOKENS, TOUCH, tok } from './chunk-HSJH6SUW.js';
12
14
 
13
15
  // src/index.ts
14
16
  var OFFICE_UI_TAGS = [
@@ -48,7 +50,8 @@ var OFFICE_UI_TAGS = [
48
50
  "office-ui-ribbon-section",
49
51
  "office-ui-gallery",
50
52
  "office-ui-presence",
51
- "office-ui-smartart"
53
+ "office-ui-smartart",
54
+ ...TEAMS_TAGS
52
55
  ];
53
56
  function registerOfficeUi(options = {}) {
54
57
  if (typeof window === "undefined" || !window.customElements) return;
@@ -56,6 +59,7 @@ function registerOfficeUi(options = {}) {
56
59
  registerControls();
57
60
  definePresence();
58
61
  defineSmartArt();
62
+ registerTeams();
59
63
  }
60
64
 
61
65
  export { OFFICE_UI_TAGS, registerOfficeUi };
@@ -0,0 +1,74 @@
1
+ import { type PropertyValues } from 'lit';
2
+ import { OfficeElement } from '../base.js';
3
+ /** One searchable command: label and optional keywords; disabled commands show their reason. */
4
+ export interface OfficeSearchCommand {
5
+ id: string;
6
+ label: string;
7
+ keywords?: string;
8
+ /** Where the command lives, shown under the label (for example "Home › Paragraph"). */
9
+ description?: string;
10
+ disabled?: boolean;
11
+ title?: string;
12
+ }
13
+ /**
14
+ * Office's "Tell me what you want to do" box. Set `commands` (`OfficeSearchCommand[]`); typing
15
+ * lists up to `limit` (default 8) matches by label or keywords in a top-layer listbox.
16
+ * ArrowUp/Down move, Enter or click run an enabled match (`office-command` `{ command }`),
17
+ * Escape closes then clears. Disabled matches stay visible with their reason. Attributes:
18
+ * `placeholder`, `label` (accessible name), `limit`. Setting `commands` never emits.
19
+ */
20
+ export declare class OfficeUiCommandSearch extends OfficeElement {
21
+ static shadowRootOptions: {
22
+ clonable?: boolean;
23
+ customElementRegistry?: CustomElementRegistry | null;
24
+ mode: ShadowRootMode;
25
+ serializable?: boolean;
26
+ slotAssignment?: SlotAssignmentMode;
27
+ delegatesFocus: boolean;
28
+ };
29
+ static styles: import("lit").CSSResult[];
30
+ static properties: {
31
+ placeholder: {
32
+ type: StringConstructor;
33
+ };
34
+ label: {
35
+ type: StringConstructor;
36
+ };
37
+ limit: {
38
+ type: StringConstructor;
39
+ };
40
+ found: {
41
+ state: boolean;
42
+ };
43
+ active: {
44
+ state: boolean;
45
+ };
46
+ isOpen: {
47
+ state: boolean;
48
+ };
49
+ };
50
+ placeholder: string | null;
51
+ label: string | null;
52
+ limit: string | null;
53
+ found: OfficeSearchCommand[];
54
+ active: number;
55
+ isOpen: boolean;
56
+ private items;
57
+ private readonly uid;
58
+ constructor();
59
+ get commands(): OfficeSearchCommand[];
60
+ set commands(value: readonly OfficeSearchCommand[]);
61
+ disconnectedCallback(): void;
62
+ private get input();
63
+ private get list();
64
+ private search;
65
+ private hide;
66
+ private move;
67
+ private choose;
68
+ private onKey;
69
+ /** The listbox is a top-layer popover below the field: show or hide it as `isOpen` changes. */
70
+ protected updated(changed: PropertyValues<this>): void;
71
+ private optionTemplates;
72
+ protected render(): import("lit").TemplateResult<1>;
73
+ }
74
+ export declare const defineCommandSearch: import("../registry.js").Definer;
@@ -0,0 +1,89 @@
1
+ import { type PropertyValues, type TemplateResult } from 'lit';
2
+ import { OfficeElement } from '../base.js';
3
+ import { type OfficeMenuState } from './menu-model.js';
4
+ /**
5
+ * Office's right-click menu, in two modes sharing keyboard, type-ahead and dismissal:
6
+ *
7
+ * - **Children** (self-managed): `office-ui-menu-item` and `office-ui-menu-separator` children.
8
+ * `openAt(x, y)` shows it in the popover top layer, kept inside the viewport; `close()` hides it.
9
+ * Choosing an item closes the menu and its `office-command` bubbles to the host.
10
+ * - **Controlled** (moved from pptx-viewer `pptx-ui-context-menu`): set `state`
11
+ * (`{ x, y, label, items: [{ id, label, separatorBefore?, heading?, danger?, disabled?,
12
+ * checked?, icon? }], markers?, zIndex?, autoFocus? }`). The host is the fixed box at the
13
+ * pointer, clamped into the window. It emits `office-menu-request` `{ id }` when a row is chosen
14
+ * and `office-menu-close` `{ reason: 'escape' | 'outside' | 'tab' }` when dismissed, and never
15
+ * closes itself: the host removes it or clears its items. While open it takes focus on the first
16
+ * enabled row and returns focus to the opener when it goes away, unless something else took it.
17
+ *
18
+ * Arrow keys, Home, End and type-ahead (repeating a letter cycles) move between enabled rows.
19
+ * Static `requestEvent`, `closeEvent` and `markerPattern` let a product keep its published names.
20
+ */
21
+ export declare class OfficeUiContextMenu extends OfficeElement {
22
+ static requestEvent: string;
23
+ static closeEvent: string;
24
+ static markerPattern: RegExp;
25
+ static styles: import("lit").CSSResult[];
26
+ static properties: {
27
+ label: {
28
+ type: StringConstructor;
29
+ };
30
+ open: {
31
+ type: BooleanConstructor;
32
+ reflect: true;
33
+ converter: {
34
+ fromAttribute: (value: string | null) => boolean;
35
+ toAttribute: (value: unknown) => string | null;
36
+ };
37
+ attribute: string;
38
+ };
39
+ };
40
+ label: string | null;
41
+ open: boolean;
42
+ private model;
43
+ private controlled;
44
+ private returnFocus;
45
+ private outside;
46
+ private active;
47
+ private focused;
48
+ private query;
49
+ private queryTimer;
50
+ private markers;
51
+ private listening;
52
+ private opener;
53
+ constructor();
54
+ private get panel();
55
+ private get rows();
56
+ private config;
57
+ connectedCallback(): void;
58
+ disconnectedCallback(): void;
59
+ private typeAhead;
60
+ private isTypeAhead;
61
+ private items;
62
+ /** Show at client coordinates; focus the first enabled item. */
63
+ openAt(x: number, y: number): void;
64
+ close(): void;
65
+ private closed;
66
+ private onChildKey;
67
+ get state(): OfficeMenuState;
68
+ set state(value: OfficeMenuState);
69
+ private deepActive;
70
+ protected willUpdate(changed: PropertyValues<this>): void;
71
+ protected updated(changed: PropertyValues<this>): void;
72
+ /** Position the open menu, listen for dismissal and keep focus on the active row. */
73
+ private settle;
74
+ private applyMarkers;
75
+ private place;
76
+ private focusRow;
77
+ private onRowKey;
78
+ private onRowOver;
79
+ private dismiss;
80
+ private readonly onDocumentKey;
81
+ private readonly onDocumentPointer;
82
+ private listen;
83
+ private stopListening;
84
+ private row;
85
+ /** Rows with their rules and headings; a heading opens a labelled group for the rows after it. */
86
+ private rowTemplates;
87
+ protected render(): TemplateResult<1>;
88
+ }
89
+ export declare const defineContextMenu: import("../registry.js").Definer;
@@ -0,0 +1,77 @@
1
+ import { OfficeElement } from '../base.js';
2
+ /**
3
+ * Dropdown command with a menu of `office-ui-menu-item` children (Office's Find, Layers,
4
+ * Align). With a `command` attribute it is a split button: the main part emits that command
5
+ * and the caret opens the menu. Attributes: `label`, `icon`, `command`, `variant="stacked"`, `icon-only`,
6
+ * `disabled`, `title`, `keyshortcuts`. The menu uses the top layer (`popover`) so ribbon
7
+ * overflow never clips it. Keyboard: Enter, Space or ArrowDown open; arrows, Home and End move;
8
+ * Escape and Tab close; focus returns to the trigger. Choosing an item closes the menu; its
9
+ * `office-command` bubbles to the host.
10
+ */
11
+ export declare class OfficeUiMenuButton extends OfficeElement {
12
+ static styles: import("lit").CSSResult[];
13
+ static properties: {
14
+ label: {
15
+ type: StringConstructor;
16
+ };
17
+ icon: {
18
+ type: StringConstructor;
19
+ };
20
+ command: {
21
+ type: StringConstructor;
22
+ reflect: boolean;
23
+ };
24
+ keyshortcuts: {
25
+ type: StringConstructor;
26
+ };
27
+ disabled: {
28
+ type: BooleanConstructor;
29
+ reflect: true;
30
+ converter: {
31
+ fromAttribute: (value: string | null) => boolean;
32
+ toAttribute: (value: unknown) => string | null;
33
+ };
34
+ };
35
+ iconOnly: {
36
+ type: BooleanConstructor;
37
+ reflect: true;
38
+ converter: {
39
+ fromAttribute: (value: string | null) => boolean;
40
+ toAttribute: (value: unknown) => string | null;
41
+ };
42
+ attribute: string;
43
+ };
44
+ open: {
45
+ state: boolean;
46
+ };
47
+ };
48
+ label: string;
49
+ icon: string | null;
50
+ command: string | null;
51
+ keyshortcuts: string | null;
52
+ disabled: boolean;
53
+ iconOnly: boolean;
54
+ open: boolean;
55
+ private outside;
56
+ /** `title` is a native attribute, so it is watched rather than declared as a property. */
57
+ static get observedAttributes(): string[];
58
+ constructor();
59
+ attributeChangedCallback(name: string, old: string | null, value: string | null): void;
60
+ disconnectedCallback(): void;
61
+ private get panel();
62
+ private get split();
63
+ private get nativePopover();
64
+ private items;
65
+ private toggle;
66
+ private show;
67
+ /** Keep the open menu inside the viewport: flip left of the trigger's right edge if needed. */
68
+ private place;
69
+ private hide;
70
+ private closed;
71
+ private onMain;
72
+ private onTriggerKey;
73
+ private onMenuKey;
74
+ protected willUpdate(): void;
75
+ protected render(): import("lit").TemplateResult<1>;
76
+ }
77
+ export declare const defineMenuButton: import("../registry.js").Definer;
@@ -0,0 +1,52 @@
1
+ import { OfficeElement } from '../base.js';
2
+ /**
3
+ * One menu entry: `command`, `label`, `icon`, `disabled`, `checked` (renders a
4
+ * `menuitemcheckbox`), `title`. Activation emits `office-command` `{ command }`.
5
+ */
6
+ export declare class OfficeUiMenuItem extends OfficeElement {
7
+ static shadowRootOptions: {
8
+ clonable?: boolean;
9
+ customElementRegistry?: CustomElementRegistry | null;
10
+ mode: ShadowRootMode;
11
+ serializable?: boolean;
12
+ slotAssignment?: SlotAssignmentMode;
13
+ delegatesFocus: boolean;
14
+ };
15
+ static styles: import("lit").CSSResult[];
16
+ static properties: {
17
+ label: {
18
+ type: StringConstructor;
19
+ };
20
+ icon: {
21
+ type: StringConstructor;
22
+ };
23
+ command: {
24
+ type: StringConstructor;
25
+ };
26
+ checked: {
27
+ type: StringConstructor;
28
+ };
29
+ disabled: {
30
+ type: BooleanConstructor;
31
+ reflect: true;
32
+ converter: {
33
+ fromAttribute: (value: string | null) => boolean;
34
+ toAttribute: (value: unknown) => string | null;
35
+ };
36
+ };
37
+ };
38
+ label: string;
39
+ icon: string | null;
40
+ command: string | null;
41
+ checked: string | null;
42
+ disabled: boolean;
43
+ /** `title` is a native attribute, so it is watched rather than declared as a property. */
44
+ static get observedAttributes(): string[];
45
+ constructor();
46
+ attributeChangedCallback(name: string, old: string | null, value: string | null): void;
47
+ /** Focus the menuitem itself, so arrow navigation never depends on delegatesFocus. */
48
+ focus(options?: FocusOptions): void;
49
+ private onClick;
50
+ protected render(): import("lit").TemplateResult<1>;
51
+ }
52
+ export declare const defineMenuItem: import("../registry.js").Definer;
@@ -20,6 +20,8 @@ export interface OfficeMenuItem {
20
20
  checked?: boolean;
21
21
  /** A registered icon drawn before the label. */
22
22
  icon?: string;
23
+ /** Tooltip, for example why a disabled row is unavailable. */
24
+ title?: string;
23
25
  }
24
26
  /** Everything a controlled menu needs to draw. */
25
27
  export interface OfficeMenuState {
@@ -0,0 +1,7 @@
1
+ import { OfficeElement } from '../base.js';
2
+ /** A `role="separator"` rule between groups of menu items. */
3
+ export declare class OfficeUiMenuSeparator extends OfficeElement {
4
+ static styles: import("lit").CSSResult[];
5
+ protected willUpdate(): void;
6
+ }
7
+ export declare const defineMenuSeparator: import("../registry.js").Definer;
@@ -0,0 +1,41 @@
1
+ import { OfficeElement } from '../base.js';
2
+ export interface OfficePasteOption {
3
+ /** Echoed back as `format` in the request event. */
4
+ id: string;
5
+ /** Translated label. */
6
+ label: string;
7
+ }
8
+ export interface OfficePasteOptionsState {
9
+ /** Right edge of the pasted object in viewport pixels. */
10
+ left: number;
11
+ /** Bottom edge of the pasted object in viewport pixels. */
12
+ top: number;
13
+ options: readonly OfficePasteOption[];
14
+ /** Toolbar accessible name. */
15
+ label?: string;
16
+ }
17
+ /**
18
+ * `<office-ui-paste-options>`: the Paste Options strip Word, Excel and PowerPoint offer after a
19
+ * paste, anchored one `--office-space-1` step past the pasted object's bottom-right corner (the
20
+ * host is the fixed box). A choice emits `office-paste-options-request` `{ format }` then
21
+ * `office-paste-options-dismiss`; the first pointerdown or keydown outside (Escape inside too)
22
+ * dismisses, armed one task after connecting so the paste gesture does not. Text arrives
23
+ * translated; event names and the test id prefix are static fields a product subclass may override.
24
+ */
25
+ export declare class OfficeUiPasteOptions extends OfficeElement {
26
+ static requestEvent: string;
27
+ static dismissEvent: string;
28
+ static testIdPrefix: string;
29
+ static styles: import("lit").CSSResult[];
30
+ private model;
31
+ get state(): OfficePasteOptionsState;
32
+ set state(value: OfficePasteOptionsState);
33
+ private disarm;
34
+ private dismiss;
35
+ connectedCallback(): void;
36
+ disconnectedCallback(): void;
37
+ private choose;
38
+ protected willUpdate(): void;
39
+ protected render(): import("lit").TemplateResult<1>;
40
+ }
41
+ export declare const definePasteOptions: import("../registry.js").Definer;
@@ -0,0 +1,53 @@
1
+ import { type PropertyValues } from 'lit';
2
+ import { OfficeElement } from '../base.js';
3
+ export interface OfficeReadOnlyBannerState {
4
+ /** Why read-only is recommended; mirrored onto the host's `data-kind`. */
5
+ kind: string | null;
6
+ /** Translated reason. */
7
+ message: string;
8
+ /** Swap Edit anyway / Dismiss for the inline password form. */
9
+ passwordPromptOpen?: boolean;
10
+ /** Translated password error, or null. */
11
+ passwordError?: string | null;
12
+ /** Disables the form while a submitted password is checked. */
13
+ checkingPassword?: boolean;
14
+ labels?: {
15
+ title?: string;
16
+ editAnyway?: string;
17
+ dismiss?: string;
18
+ passwordLabel?: string;
19
+ passwordPlaceholder?: string;
20
+ unlock?: string;
21
+ cancel?: string;
22
+ };
23
+ }
24
+ export type OfficeReadOnlyBannerIntent = {
25
+ id: 'editAnyway' | 'dismiss' | 'cancelPassword';
26
+ } | {
27
+ id: 'submitPassword';
28
+ password: string;
29
+ };
30
+ /**
31
+ * `<office-ui-read-only-banner>`: controlled banner for "read-only recommended", which Word, Excel
32
+ * and PowerPoint all show. The host owns the lock (Edit anyway, Dismiss, the password check); the
33
+ * element owns the markup, the password form and its focus. Each activation emits
34
+ * `office-read-only-request` with an {@link OfficeReadOnlyBannerIntent}. Text arrives translated;
35
+ * the event name and test id prefix are static fields a product subclass may override.
36
+ */
37
+ export declare class OfficeUiReadOnlyBanner extends OfficeElement {
38
+ static requestEvent: string;
39
+ static testIdPrefix: string;
40
+ static styles: import("lit").CSSResult[];
41
+ private model;
42
+ get state(): OfficeReadOnlyBannerState;
43
+ set state(value: OfficeReadOnlyBannerState);
44
+ private promptWasOpen;
45
+ private send;
46
+ private get input();
47
+ private onSubmit;
48
+ protected willUpdate(): void;
49
+ /** The password field takes focus when the prompt opens and is cleared when it closes. */
50
+ protected updated(_changed: PropertyValues<this>): void;
51
+ protected render(): import("lit").TemplateResult<1>;
52
+ }
53
+ export declare const defineReadOnlyBanner: import("../registry.js").Definer;
@@ -0,0 +1,40 @@
1
+ import { type PropertyValues } from 'lit';
2
+ import { OfficeElement } from '../base.js';
3
+ /** Toasts rendered before the rest collapse into a "+N" count. */
4
+ export declare const OFFICE_TOAST_VISIBLE_LIMIT = 5;
5
+ export interface OfficeToast {
6
+ readonly id: string;
7
+ /** Machine-readable code, mirrored to `data-code`. */
8
+ readonly code?: string;
9
+ readonly severity: 'info' | 'warning';
10
+ /** Translated message. */
11
+ readonly message: string;
12
+ }
13
+ export interface OfficeToastsState {
14
+ toasts: readonly OfficeToast[];
15
+ /** Extra toasts a host already trimmed off the list it passes. */
16
+ overflowCount?: number;
17
+ labels?: {
18
+ title?: string;
19
+ dismissAll?: string;
20
+ dismiss?: string;
21
+ };
22
+ }
23
+ /**
24
+ * `<office-ui-toasts>`: a stack of load or compatibility notices. Toasts never auto-hide;
25
+ * dismissal is the host's decision through `office-toasts-request` `{ id: 'dismissAll' }` or
26
+ * `{ id: 'dismiss', toastId }`. The host positions the element. Hidden when empty. Text arrives
27
+ * already translated; the event name and test id prefix are static fields a product subclass
28
+ * may override.
29
+ */
30
+ export declare class OfficeUiToasts extends OfficeElement {
31
+ static requestEvent: string;
32
+ static testIdPrefix: string;
33
+ static styles: import("lit").CSSResult[];
34
+ private model;
35
+ get state(): OfficeToastsState;
36
+ set state(value: OfficeToastsState);
37
+ protected willUpdate(_changed: PropertyValues<this>): void;
38
+ protected render(): import("lit").TemplateResult<1>;
39
+ }
40
+ export declare const defineToasts: import("../registry.js").Definer;