ooxml-ui 0.25.0 → 0.27.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.
@@ -6,6 +6,7 @@ export type OfficeRibbonSelectEvent = CustomEvent<{
6
6
  interface RibbonTab {
7
7
  id: string;
8
8
  label: string;
9
+ contextual: boolean;
9
10
  keytip?: string;
10
11
  keytipPanel?: string;
11
12
  }
@@ -17,8 +18,14 @@ interface RibbonTab {
17
18
  * `search`, `end`. Attributes: `selected`, `label` (tab list name), `file-label` (default "File"),
18
19
  * `no-file`, `file-expanded`, `file-keytip`. A panel with `data-tab-hidden` keeps its content but has
19
20
  * no tab (a contextual tab, or one a customisation removed); if it was selected, the first
20
- * remaining tab takes over. Events: `office-ribbon-select` `{ tab }`
21
+ * remaining tab takes over. `data-contextual` on a panel tints its tab (`--office-ribbon-contextual`),
22
+ * for tools that apply to the selection, such as a table's. Events: `office-ribbon-select` `{ tab }`
21
23
  * (cancelable) and `office-ribbon-file` when File is activated.
24
+ *
25
+ * `collapsible` adds Office's collapse button: `collapsed` hides the panels, a click on a tab then
26
+ * shows its panel over the content (`peek`) until Escape, a command or a click elsewhere. Ctrl+F1 and
27
+ * a double click on a tab toggle it. `collapse-label` names the button. Event:
28
+ * `office-ribbon-collapse` `{ collapsed }`.
22
29
  */
23
30
  export declare class OfficeUiRibbon extends OfficeElement {
24
31
  static styles: import("lit").CSSResult[];
@@ -51,6 +58,34 @@ export declare class OfficeUiRibbon extends OfficeElement {
51
58
  attribute: string;
52
59
  type: StringConstructor;
53
60
  };
61
+ collapsible: {
62
+ type: BooleanConstructor;
63
+ reflect: true;
64
+ converter: {
65
+ fromAttribute: (value: string | null) => boolean;
66
+ toAttribute: (value: unknown) => string | null;
67
+ };
68
+ };
69
+ collapsed: {
70
+ type: BooleanConstructor;
71
+ reflect: true;
72
+ converter: {
73
+ fromAttribute: (value: string | null) => boolean;
74
+ toAttribute: (value: unknown) => string | null;
75
+ };
76
+ };
77
+ peek: {
78
+ type: BooleanConstructor;
79
+ reflect: true;
80
+ converter: {
81
+ fromAttribute: (value: string | null) => boolean;
82
+ toAttribute: (value: unknown) => string | null;
83
+ };
84
+ };
85
+ collapseLabel: {
86
+ attribute: string;
87
+ type: StringConstructor;
88
+ };
54
89
  tabs: {
55
90
  state: boolean;
56
91
  };
@@ -60,6 +95,10 @@ export declare class OfficeUiRibbon extends OfficeElement {
60
95
  noFile: boolean;
61
96
  fileExpanded: string | null;
62
97
  fileKeytip: string | null;
98
+ collapsible: boolean;
99
+ collapsed: boolean;
100
+ peek: boolean;
101
+ collapseLabel: string | null;
63
102
  tabs: RibbonTab[];
64
103
  private chosen;
65
104
  constructor();
@@ -69,13 +108,30 @@ export declare class OfficeUiRibbon extends OfficeElement {
69
108
  focusFile(): void;
70
109
  /** Focus the selected tab. */
71
110
  focusTab(): void;
111
+ /** The rendered tab button of `tab`, or null before the first render. */
112
+ tabButton(tab: string): HTMLButtonElement | null;
113
+ /** The rendered File button, or null before the first render. */
114
+ fileButton(): HTMLButtonElement | null;
115
+ /**
116
+ * Hide or show the tab of panel `tab` for one reason (`contextual`, `custom`, ...). The tab shows
117
+ * only while no reason hides it, so a table's tools and a customisation do not undo each other.
118
+ */
119
+ setTabHidden(tab: string, reason: string, hidden: boolean): void;
72
120
  private panels;
73
121
  /** The panels that have a tab: those not marked `data-tab-hidden`. */
74
122
  private shown;
75
123
  /** Read the tabs off the panels (on connection and whenever the slotted panels change). */
76
124
  private build;
125
+ private setCollapsed;
126
+ private onOutside;
127
+ private onTabDoubleClick;
128
+ /** A command run from an overlaid panel closes it; a menu opener keeps it open. */
129
+ private onPanelClick;
130
+ protected willUpdate(changed: Map<PropertyKey, unknown>): void;
77
131
  private choose;
78
132
  private onTabClick;
133
+ /** Ctrl+F1 and Escape work from anywhere in the ribbon, panels included. */
134
+ private onHostKey;
79
135
  private onKey;
80
136
  /** Rebuild the tab row when a panel's label or visibility flag changes. */
81
137
  private watcher;
package/dist/smartart.js CHANGED
@@ -1,3 +1,3 @@
1
- export { OfficeUiSmartArt, defineSmartArt, renderDiagramDrawing } from './chunk-RVZAYXTI.js';
2
- import './chunk-PCZJV6HQ.js';
3
- import './chunk-HSJH6SUW.js';
1
+ export { OfficeUiSmartArt, defineSmartArt, renderDiagramDrawing } from './chunk-4VQ6S7QJ.js';
2
+ import './chunk-ZWBP2WTC.js';
3
+ import './chunk-7Q7ZS2CC.js';
package/dist/teams.js CHANGED
@@ -1,5 +1,5 @@
1
- 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-TCBUC6BI.js';
1
+ 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-LE4FTRWB.js';
2
2
  import './chunk-HZ422LTR.js';
3
- import './chunk-XQWRKHC2.js';
4
- import './chunk-PCZJV6HQ.js';
5
- import './chunk-HSJH6SUW.js';
3
+ import './chunk-V6W5DKJ6.js';
4
+ import './chunk-ZWBP2WTC.js';
5
+ import './chunk-7Q7ZS2CC.js';
package/dist/theme.js CHANGED
@@ -1,2 +1,2 @@
1
- export { THEME_CSS, THEME_STYLE_ID, installOfficeUiTheme, shadcnBridge, themeBridge } from './chunk-PAPKST6W.js';
2
- export { COMPACT, FOCUS_RING, OFFICE_TOKENS, TOUCH, tok } from './chunk-HSJH6SUW.js';
1
+ export { THEME_CSS, THEME_STYLE_ID, installOfficeUiTheme, shadcnBridge, themeBridge } from './chunk-7QLJS57B.js';
2
+ export { COMPACT, FOCUS_RING, OFFICE_TOKENS, TOUCH, tok } from './chunk-7Q7ZS2CC.js';
package/dist/tokens.d.ts CHANGED
@@ -122,6 +122,7 @@ export declare const OFFICE_TOKENS: {
122
122
  readonly '--office-switch-thumb': 'var(--office-foreground, #1f2937)';
123
123
  readonly '--office-switch-thumb-on': 'var(--office-accent-foreground, #ffffff)';
124
124
  readonly '--office-ribbon-tab-height': '35px';
125
+ readonly '--office-ribbon-contextual': 'var(--office-accent, #2563eb)';
125
126
  readonly '--office-ribbon-group-gap': '2px';
126
127
  readonly '--office-ribbon-group-height': '78px';
127
128
  readonly '--office-ribbon-group-padding': '4px 8px 2px';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ooxml-ui",
3
- "version": "0.25.0",
3
+ "version": "0.27.0",
4
4
  "description": "Shared, format-neutral web components and styles for the Office viewers (Word, PowerPoint, Excel)",
5
5
  "keywords": [
6
6
  "custom-elements",
@@ -23,6 +23,7 @@
23
23
  },
24
24
  "files": [
25
25
  "dist",
26
+ "custom-elements.json",
26
27
  "LICENSE",
27
28
  "NOTICE",
28
29
  "README.md"
@@ -68,7 +69,8 @@
68
69
  "import": "./dist/teams.js",
69
70
  "default": "./dist/teams.js"
70
71
  },
71
- "./package.json": "./package.json"
72
+ "./package.json": "./package.json",
73
+ "./custom-elements.json": "./custom-elements.json"
72
74
  },
73
75
  "publishConfig": {
74
76
  "access": "public"
@@ -78,7 +80,8 @@
78
80
  "prepack": "node scripts/ensure-built.mjs",
79
81
  "typecheck": "tsc -p tsconfig.json --noEmit",
80
82
  "test": "vitest run",
81
- "test:package": "node scripts/package-smoke.mjs"
83
+ "test:package": "node scripts/package-smoke.mjs",
84
+ "gen:manifest": "node scripts/gen-manifest.mjs"
82
85
  },
83
86
  "dependencies": {
84
87
  "lit": "^3.3.3",
@@ -93,5 +96,6 @@
93
96
  },
94
97
  "engines": {
95
98
  "node": ">=22"
96
- }
99
+ },
100
+ "customElements": "custom-elements.json"
97
101
  }