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,834 @@
1
+ import { registerIcon, getIcon } from './chunk-HZ422LTR.js';
2
+ import { initialsOf } from './chunk-E47762NY.js';
3
+ import { definer, OfficeElement, controlStyles } from './chunk-5A4REH6T.js';
4
+ import { html, nothing, unsafeCSS, svg } from 'lit';
5
+ import { repeat } from 'lit/directives/repeat.js';
6
+ import { live } from 'lit/directives/live.js';
7
+
8
+ // raw-css:/home/runner/work/ooxml/ooxml/packages/ui/src/teams/reset.css?raw
9
+ var reset_default = ":host {\n box-sizing: border-box;\n font: var(--office-font-size) var(--office-font);\n color: var(--office-foreground);\n}\n*,\n*::before,\n*::after {\n box-sizing: inherit;\n}\nbutton {\n font: inherit;\n color: inherit;\n cursor: pointer;\n}\nbutton:focus-visible,\ntextarea:focus-visible,\ninput:focus-visible {\n outline: var(--office-focus-width) solid var(--office-ring);\n outline-offset: var(--office-focus-offset);\n}\nsvg.icon {\n width: 1.25em;\n height: 1.25em;\n flex: none;\n fill: none;\n stroke: currentColor;\n stroke-width: var(--office-icon-stroke);\n stroke-linecap: round;\n stroke-linejoin: round;\n}\n";
10
+
11
+ // src/teams/base.ts
12
+ var withStyles = (css) => {
13
+ const [common, own] = controlStyles(css);
14
+ return [common, unsafeCSS(reset_default), own];
15
+ };
16
+ var TeamsElement = class extends OfficeElement {
17
+ static syncUpdates = false;
18
+ };
19
+ function colorFor(id) {
20
+ let hue = 0;
21
+ for (const ch of id) hue = (hue * 31 + ch.charCodeAt(0)) % 360;
22
+ return `hsl(${hue} 45% 42%)`;
23
+ }
24
+ var DAY_MS = 864e5;
25
+ function formatTime(ts) {
26
+ return new Date(ts).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" });
27
+ }
28
+ function dayLabel(ts, now = Date.now()) {
29
+ const start = (t) => new Date(t).setHours(0, 0, 0, 0);
30
+ const diff = Math.round((start(now) - start(ts)) / DAY_MS);
31
+ if (diff === 0) return "Today";
32
+ if (diff === 1) return "Yesterday";
33
+ return new Date(ts).toLocaleDateString([], { weekday: "long", month: "long", day: "numeric" });
34
+ }
35
+ function formatSize(bytes) {
36
+ if (bytes === void 0) return "";
37
+ if (bytes < 1024) return `${bytes} B`;
38
+ if (bytes < 1048576) return `${Math.round(bytes / 1024)} KB`;
39
+ return `${(bytes / 1048576).toFixed(1)} MB`;
40
+ }
41
+ var GLYPHS = {
42
+ send: "M3 10 17 3l-4 14-3-6Zm7 1 7-8",
43
+ paperclip: "M15 9.5l-5.5 5.5a3.5 3.5 0 0 1-5-5l6-6a2.3 2.3 0 0 1 3.3 3.3l-6 6a1.2 1.2 0 0 1-1.7-1.7L11 6",
44
+ smile: "M3 10a7 7 0 1 0 14 0 7 7 0 1 0-14 0M7.5 8v.5M12.5 8v.5M7 12c1.5 2 4.5 2 6 0",
45
+ reply: "M8 4 3 9l5 5M3 9h9a5 5 0 0 1 5 5v2",
46
+ hash: "M7.5 3 6 17M14 3l-1.5 14M4 7.5h13M3 12.5h13",
47
+ users: "M7 9a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM2.5 16c0-2.5 2-4 4.5-4s4.5 1.5 4.5 4M13 8.5a2 2 0 1 0 0-4M14 12c2 .3 3.5 1.6 3.5 4",
48
+ phone: "M5 3h3l1.5 4-2 1.2a8 8 0 0 0 4.3 4.3L13 10.5l4 1.5v3a2 2 0 0 1-2 2A12 12 0 0 1 3 5a2 2 0 0 1 2-2Z",
49
+ folder: "M3 5.5h5l1.5 2H17v8H3Z",
50
+ calendar: "M3.5 5h13v11.5h-13ZM3.5 8.5h13M7 3v3M13 3v3",
51
+ more: "M5 10h.01M10 10h.01M15 10h.01",
52
+ mic: "M10 3a2.5 2.5 0 0 0-2.5 2.5v4a2.5 2.5 0 0 0 5 0v-4A2.5 2.5 0 0 0 10 3ZM5 9.5a5 5 0 0 0 10 0M10 14.5V17",
53
+ micOff: "M10 3a2.5 2.5 0 0 0-2.5 2.5v4a2.5 2.5 0 0 0 5 0v-4A2.5 2.5 0 0 0 10 3ZM5 9.5a5 5 0 0 0 10 0M10 14.5V17M3 3l14 14",
54
+ video: "M3 6h9v8H3ZM12 9l5-3v8l-5-3",
55
+ videoOff: "M3 6h9v8H3ZM12 9l5-3v8l-5-3M3 3l14 14",
56
+ screenShare: "M3 4h14v9H3ZM7 17h6M10 13v4M10 10V6M8 8l2-2 2 2",
57
+ hand: "M7 10V4.5a1 1 0 0 1 2 0V9M9 9V3.5a1 1 0 0 1 2 0V9M11 9V4.5a1 1 0 0 1 2 0V10M13 8.5a1 1 0 0 1 2 0V12a5 5 0 0 1-5 5h-.5A4.5 4.5 0 0 1 5 13.5L4 10.5a1 1 0 0 1 2-.5l1 2",
58
+ phoneOff: "M3 11c4-3 10-3 14 0l-1.5 2.5-3-1V10a9 9 0 0 0-5 0v2.5l-3 1Z",
59
+ chat: "M3 4h14v9H8l-5 4z"
60
+ };
61
+ for (const [name, d] of Object.entries(GLYPHS)) registerIcon(name, d);
62
+ function icon(name) {
63
+ const found = getIcon(name);
64
+ if (!found) return "";
65
+ return html`<svg class="icon" viewBox=${found.viewBox ?? "0 0 20 20"} aria-hidden="true">
66
+ ${svg`<path d=${found.d}></path>`}
67
+ </svg>`;
68
+ }
69
+
70
+ // raw-css:/home/runner/work/ooxml/ooxml/packages/ui/src/teams/app-rail.css?raw
71
+ var app_rail_default = ":host {\n display: block;\n width: 5em;\n background: var(--office-teams-rail);\n border-inline-end: var(--office-border-width) solid var(--office-teams-divider);\n}\nul {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: var(--office-space-1);\n margin: 0;\n padding: var(--office-space-2) 0;\n list-style: none;\n}\nbutton {\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: var(--office-space-0);\n width: 4.4em;\n padding: var(--office-space-2) 0;\n border: 0;\n border-radius: var(--office-radius-md);\n background: transparent;\n color: var(--office-teams-text-subtle);\n}\nbutton:hover {\n background: var(--office-selected);\n}\nbutton[aria-current='page'] {\n color: var(--office-teams-brand);\n font-weight: var(--office-font-weight-bold);\n}\nbutton[aria-current='page']::before {\n content: '';\n position: absolute;\n inset-inline-start: calc(-1 * var(--office-space-1));\n inset-block: 20%;\n width: var(--office-space-1);\n border-radius: var(--office-radius-full);\n background: var(--office-teams-brand);\n}\n.glyph {\n position: relative;\n display: grid;\n place-items: center;\n font-size: 1.3em;\n}\n.label {\n font-size: var(--office-font-size-2xs);\n}\n.badge {\n position: absolute;\n inset-block-start: -0.4em;\n inset-inline-end: -0.9em;\n min-width: 1.5em;\n padding: 0 var(--office-space-1);\n border-radius: var(--office-radius-full);\n background: var(--office-teams-brand);\n color: var(--office-teams-brand-foreground);\n font-size: var(--office-font-size-3xs);\n line-height: 1.6;\n text-align: center;\n}\n";
72
+
73
+ // src/teams/app-rail.ts
74
+ var OfficeUiAppRail = class extends TeamsElement {
75
+ static styles = withStyles(app_rail_default);
76
+ static properties = {
77
+ items: { attribute: false },
78
+ selected: { type: String }
79
+ };
80
+ constructor() {
81
+ super();
82
+ this.items = [];
83
+ this.selected = "";
84
+ }
85
+ connectedCallback() {
86
+ super.connectedCallback();
87
+ this.setAttribute("role", "navigation");
88
+ this.setAttribute("aria-label", "App bar");
89
+ }
90
+ render() {
91
+ return html`
92
+ <ul>
93
+ ${this.items.map(
94
+ (item) => html`
95
+ <li>
96
+ <button
97
+ type="button"
98
+ aria-label=${item.label}
99
+ aria-current=${this.selected === item.id ? "page" : "false"}
100
+ @click=${() => this.fire("office-rail-select", { id: item.id })}
101
+ >
102
+ <span class="glyph">
103
+ ${icon(item.icon)}
104
+ ${item.badge ? html`<span class="badge">${item.badge > 99 ? "99+" : item.badge}</span>` : ""}
105
+ </span>
106
+ <span class="label">${item.label}</span>
107
+ </button>
108
+ </li>
109
+ `
110
+ )}
111
+ </ul>
112
+ `;
113
+ }
114
+ };
115
+ var defineAppRail = definer("office-ui-app-rail", () => OfficeUiAppRail);
116
+
117
+ // raw-css:/home/runner/work/ooxml/ooxml/packages/ui/src/teams/avatar.css?raw
118
+ var avatar_default = ":host {\n --_size: 2.3em;\n position: relative;\n display: inline-block;\n width: var(--_size);\n height: var(--_size);\n flex: none;\n}\n:host([size='sm']) {\n --_size: 1.7em;\n}\n:host([size='lg']) {\n --_size: 3em;\n}\n:host([size='xl']) {\n --_size: 6em;\n}\n\n.face {\n display: grid;\n place-items: center;\n width: 100%;\n height: 100%;\n border-radius: var(--office-radius-full);\n color: var(--office-call-foreground);\n font-size: calc(var(--_size) * 0.38);\n font-weight: var(--office-font-weight-bold);\n user-select: none;\n}\n\n.presence {\n position: absolute;\n inset-inline-end: 0;\n inset-block-end: 0;\n width: 32%;\n height: 32%;\n min-width: 0.5em;\n min-height: 0.5em;\n border-radius: var(--office-radius-full);\n border: var(--office-border-width-thick) solid var(--office-background);\n background: var(--office-presence-offline);\n}\n.presence[data-presence='available'] {\n background: var(--office-presence-available);\n}\n.presence[data-presence='busy'] {\n background: var(--office-presence-busy);\n}\n.presence[data-presence='away'] {\n background: var(--office-presence-away);\n}\n";
119
+
120
+ // src/teams/avatar.ts
121
+ var PRESENCE_LABEL = {
122
+ available: "Available",
123
+ busy: "Busy",
124
+ away: "Away",
125
+ offline: "Offline"
126
+ };
127
+ var OfficeUiAvatar = class extends TeamsElement {
128
+ static styles = withStyles(avatar_default);
129
+ static properties = {
130
+ name: { type: String },
131
+ seed: { type: String },
132
+ color: { type: String },
133
+ size: { type: String, reflect: true },
134
+ presence: { type: String, reflect: true }
135
+ };
136
+ constructor() {
137
+ super();
138
+ this.name = "";
139
+ this.seed = "";
140
+ this.color = "";
141
+ this.size = "md";
142
+ this.presence = "";
143
+ }
144
+ willUpdate(changed) {
145
+ if (changed.has("name") || changed.has("presence")) {
146
+ this.setAttribute("role", "img");
147
+ const status = this.presence ? `, ${PRESENCE_LABEL[this.presence]}` : "";
148
+ this.setAttribute("aria-label", `${this.name}${status}`);
149
+ }
150
+ }
151
+ render() {
152
+ const background = this.color || colorFor(this.seed || this.name);
153
+ return html`
154
+ <span class="face" style="background:${background}">${initialsOf(this.name)}</span>
155
+ ${this.presence ? html`<span
156
+ class="presence"
157
+ data-presence=${this.presence}
158
+ title=${PRESENCE_LABEL[this.presence]}
159
+ ></span>` : ""}
160
+ `;
161
+ }
162
+ };
163
+ var defineAvatar = definer("office-ui-avatar", () => OfficeUiAvatar);
164
+
165
+ // raw-css:/home/runner/work/ooxml/ooxml/packages/ui/src/teams/call-controls.css?raw
166
+ var call_controls_default = ":host {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--office-space-4);\n padding: var(--office-space-2) var(--office-space-4);\n background: var(--office-call-background);\n color: var(--office-call-foreground);\n}\n.info {\n display: flex;\n align-items: center;\n gap: var(--office-space-3);\n min-width: 0;\n color: var(--office-call-muted-foreground);\n}\n.heading {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\ntime {\n font-variant-numeric: tabular-nums;\n}\n.actions {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: flex-end;\n gap: var(--office-space-1-5);\n}\nbutton {\n display: inline-flex;\n align-items: center;\n gap: var(--office-space-2);\n height: 2.6em;\n padding: 0 var(--office-space-3);\n border: 0;\n border-radius: var(--office-radius-md);\n background: transparent;\n color: inherit;\n font-size: var(--office-font-size-sm);\n}\nbutton:hover:not(:disabled) {\n background: var(--office-call-control-hover);\n}\nbutton[aria-pressed='true'] {\n background: var(--office-call-control);\n color: var(--office-call-foreground);\n box-shadow: inset 0 calc(-1 * var(--office-border-width-thick)) 0 var(--office-teams-brand);\n}\nbutton[data-off='true'] {\n color: var(--office-call-danger);\n}\nbutton:disabled {\n opacity: 0.45;\n cursor: not-allowed;\n}\n.leave {\n background: var(--office-call-danger);\n color: var(--office-call-foreground);\n}\n.leave:hover:not(:disabled) {\n background: var(--office-call-danger-hover);\n}\n@media (max-width: 767px) {\n .text {\n display: none;\n }\n .info {\n display: none;\n }\n}\n";
167
+
168
+ // src/teams/call-controls.ts
169
+ var formatElapsed = (ms) => {
170
+ const total = Math.max(0, Math.floor(ms / 1e3));
171
+ const pad = (n) => String(n).padStart(2, "0");
172
+ const h = Math.floor(total / 3600);
173
+ return `${h ? `${h}:` : ""}${pad(Math.floor(total % 3600 / 60))}:${pad(total % 60)}`;
174
+ };
175
+ var OfficeUiCallControls = class extends TeamsElement {
176
+ static styles = withStyles(call_controls_default);
177
+ static properties = {
178
+ heading: { type: String },
179
+ startedAt: { type: Number, attribute: "started-at" },
180
+ mic: { type: Boolean },
181
+ camera: { type: Boolean },
182
+ screen: { type: Boolean },
183
+ hand: { type: Boolean },
184
+ panel: { type: String },
185
+ shareUnavailable: { type: Boolean, attribute: "share-unavailable" },
186
+ now: { state: true }
187
+ };
188
+ timer;
189
+ constructor() {
190
+ super();
191
+ this.heading = "";
192
+ this.startedAt = 0;
193
+ this.mic = false;
194
+ this.camera = false;
195
+ this.screen = false;
196
+ this.hand = false;
197
+ this.panel = "";
198
+ this.shareUnavailable = false;
199
+ this.now = Date.now();
200
+ }
201
+ connectedCallback() {
202
+ super.connectedCallback();
203
+ this.setAttribute("role", "toolbar");
204
+ this.setAttribute("aria-label", "Meeting controls");
205
+ this.timer = setInterval(() => this.now = Date.now(), 1e3);
206
+ }
207
+ disconnectedCallback() {
208
+ clearInterval(this.timer);
209
+ super.disconnectedCallback();
210
+ }
211
+ willUpdate(_changed) {
212
+ if (!this.startedAt) this.now = this.startedAt;
213
+ }
214
+ button(action, label, glyph, state = {}) {
215
+ return html`
216
+ <button
217
+ type="button"
218
+ data-action=${action}
219
+ data-off=${String(Boolean(state.off))}
220
+ aria-label=${label}
221
+ aria-pressed=${state.on === void 0 ? nothing : String(state.on)}
222
+ title=${label}
223
+ ?disabled=${state.disabled}
224
+ @click=${() => this.fire("office-call-action", { action })}
225
+ >
226
+ ${icon(glyph)}<span class="text">${label}</span>
227
+ </button>
228
+ `;
229
+ }
230
+ render() {
231
+ return html`
232
+ <div class="info">
233
+ <span class="heading">${this.heading}</span
234
+ >${this.startedAt ? html`<time>${formatElapsed(this.now - this.startedAt)}</time>` : nothing}
235
+ </div>
236
+ <div class="actions">
237
+ ${this.button("chat", "Chat", "chat", { on: this.panel === "chat" })}
238
+ ${this.button("people", "People", "users", { on: this.panel === "people" })}
239
+ ${this.button("hand", this.hand ? "Lower" : "Raise", "hand", { on: this.hand })}
240
+ ${this.button("camera", this.camera ? "Camera off" : "Camera on", this.camera ? "video" : "videoOff", { off: !this.camera })}
241
+ ${this.button("mic", this.mic ? "Mute" : "Unmute", this.mic ? "mic" : "micOff", { off: !this.mic })}
242
+ ${this.button("screen", this.screen ? "Stop sharing" : "Share", "screenShare", { on: this.screen, disabled: this.shareUnavailable })}
243
+ <button
244
+ type="button"
245
+ class="leave"
246
+ aria-label="Leave call"
247
+ @click=${() => this.fire("office-call-action", { action: "leave" })}
248
+ >
249
+ ${icon("phoneOff")}<span class="text">Leave</span>
250
+ </button>
251
+ </div>
252
+ `;
253
+ }
254
+ };
255
+ var defineCallControls = definer("office-ui-call-controls", () => OfficeUiCallControls);
256
+
257
+ // raw-css:/home/runner/work/ooxml/ooxml/packages/ui/src/teams/call-grid.css?raw
258
+ var call_grid_default = ":host {\n display: block;\n min-height: 0;\n background: var(--office-call-background);\n color: var(--office-call-foreground);\n}\n.empty {\n display: grid;\n place-items: center;\n height: 100%;\n margin: 0;\n color: var(--office-call-muted-foreground);\n}\n.grid {\n display: grid;\n gap: var(--office-space-2);\n height: 100%;\n padding: var(--office-space-2);\n grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr));\n grid-auto-rows: minmax(0, 1fr);\n}\n.grid[data-spotlight='true'] {\n grid-template-columns: minmax(0, 4fr) minmax(0, 1fr);\n grid-template-rows: repeat(var(--rows, 1), minmax(0, 1fr));\n}\n.grid[data-spotlight='true'] .tile[data-main='true'] {\n grid-row: 1 / span var(--rows, 1);\n}\n\n.tile {\n position: relative;\n display: grid;\n place-items: center;\n min-height: 6em;\n overflow: hidden;\n border-radius: var(--office-radius-lg);\n background: var(--office-call-tile);\n}\nvideo {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n object-fit: cover;\n background: var(--office-call-background);\n}\n.tile[data-screen='true'] video {\n object-fit: contain;\n}\n.tile[data-self='true'] video {\n transform: scaleX(-1);\n}\n.tile[data-self='true'][data-screen='true'] video {\n transform: none;\n}\n\n.name {\n position: absolute;\n inset-inline-start: var(--office-space-2);\n inset-block-end: var(--office-space-2);\n display: flex;\n align-items: center;\n gap: var(--office-space-1-5);\n max-width: calc(100% - 2 * var(--office-space-2));\n padding: var(--office-space-0) var(--office-space-2);\n border-radius: var(--office-radius-md);\n background: var(--office-call-scrim);\n font-size: var(--office-font-size-sm);\n}\n.name span:last-child {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.muted {\n display: grid;\n color: var(--office-call-danger);\n}\n.hand {\n position: absolute;\n inset-block-start: var(--office-space-2);\n inset-inline-end: var(--office-space-2);\n font-size: 1.5em;\n}\n.status {\n position: absolute;\n inset-block-start: var(--office-space-2);\n inset-inline-start: var(--office-space-2);\n padding: 0 var(--office-space-2);\n border-radius: var(--office-radius-md);\n background: var(--office-call-scrim);\n font-size: var(--office-font-size-xs);\n}\n";
259
+
260
+ // src/teams/call-grid.ts
261
+ var gridColumns = (n) => Math.max(1, Math.ceil(Math.sqrt(n)));
262
+ var OfficeUiCallGrid = class extends TeamsElement {
263
+ static styles = withStyles(call_grid_default);
264
+ static properties = { participants: { attribute: false } };
265
+ constructor() {
266
+ super();
267
+ this.participants = [];
268
+ }
269
+ connectedCallback() {
270
+ super.connectedCallback();
271
+ this.setAttribute("role", "list");
272
+ this.setAttribute("aria-label", "Participants");
273
+ }
274
+ render() {
275
+ const people = this.participants;
276
+ if (people.length === 0) return html`<p class="empty">Nobody is in the call</p>`;
277
+ const sharer = people.find((p) => p.screen);
278
+ const spotlight = sharer !== void 0 && people.length > 1;
279
+ const ordered = sharer ? [sharer, ...people.filter((p) => p !== sharer)] : people;
280
+ const style = `--cols:${gridColumns(people.length)};--rows:${Math.max(1, people.length - 1)}`;
281
+ return html`
282
+ <div class="grid" data-spotlight=${String(spotlight)} style=${style}>
283
+ ${repeat(
284
+ ordered,
285
+ (p) => p.id,
286
+ (p, i) => this.tile(p, spotlight && i === 0)
287
+ )}
288
+ </div>
289
+ `;
290
+ }
291
+ tile(p, main) {
292
+ const showVideo = Boolean(p.stream) && (p.video || p.screen || !p.self);
293
+ const showAvatar = !showVideo || !p.video && !p.screen;
294
+ return html`
295
+ <div
296
+ class="tile"
297
+ role="listitem"
298
+ data-self=${String(Boolean(p.self))}
299
+ data-screen=${String(Boolean(p.screen))}
300
+ data-main=${String(main)}
301
+ >
302
+ ${showVideo ? html`<video
303
+ autoplay
304
+ playsinline
305
+ .muted=${Boolean(p.self)}
306
+ .srcObject=${p.stream ?? null}
307
+ ></video>` : nothing}
308
+ ${showAvatar ? html`<office-ui-avatar size="xl" name=${p.name} seed=${p.id}></office-ui-avatar>` : nothing}
309
+ <div class="name">
310
+ ${p.audio === false ? html`<span class="muted">${icon("micOff")}</span>` : nothing}
311
+ <span>${p.self ? `${p.name} (you)` : p.name}</span>
312
+ </div>
313
+ ${p.hand ? html`<span class="hand" role="img" aria-label="Hand raised">✋</span>` : nothing}
314
+ ${!p.self && p.connection && p.connection !== "connected" ? html`<span class="status"
315
+ >${p.connection === "failed" ? "Connection failed" : "Connecting\u2026"}</span
316
+ >` : nothing}
317
+ </div>
318
+ `;
319
+ }
320
+ };
321
+ var defineCallGrid = definer("office-ui-call-grid", () => OfficeUiCallGrid);
322
+
323
+ // raw-css:/home/runner/work/ooxml/ooxml/packages/ui/src/teams/channel-list.css?raw
324
+ var channel_list_default = ":host {\n display: block;\n overflow: auto;\n}\n.team {\n display: flex;\n align-items: center;\n padding: var(--office-space-1) var(--office-space-2) var(--office-space-1) var(--office-space-1);\n}\n.toggle {\n display: flex;\n flex: 1;\n align-items: center;\n gap: var(--office-space-1);\n min-width: 0;\n padding: var(--office-space-2);\n border: 0;\n border-radius: var(--office-radius);\n background: transparent;\n font-weight: var(--office-font-weight-bold);\n text-align: start;\n}\n.toggle:hover,\n.add:hover {\n background: var(--office-selected);\n}\n.chevron {\n display: grid;\n transition: transform var(--office-duration-fast);\n}\n.chevron[data-open='true'] {\n transform: rotate(90deg);\n}\n.name {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.add {\n display: grid;\n place-items: center;\n width: 2em;\n height: 2em;\n border: 0;\n border-radius: var(--office-radius);\n background: transparent;\n color: var(--office-teams-text-subtle);\n}\nul {\n margin: 0;\n padding: 0 var(--office-space-2);\n list-style: none;\n}\nul[hidden] {\n display: none;\n}\n.row {\n position: relative;\n display: flex;\n align-items: center;\n gap: var(--office-space-2);\n width: 100%;\n padding: var(--office-space-2) var(--office-space-3) var(--office-space-2) var(--office-space-5);\n border: 0;\n border-radius: var(--office-radius);\n background: transparent;\n color: var(--office-teams-text-subtle);\n text-align: start;\n}\n.row:hover {\n background: var(--office-selected);\n}\n.row[aria-current='true'] {\n background: var(--office-teams-brand-subtle);\n color: var(--office-foreground);\n font-weight: var(--office-font-weight-bold);\n}\n.row[aria-current='true']::before {\n content: '';\n position: absolute;\n inset-inline-start: 0;\n inset-block: 20%;\n width: var(--office-space-1);\n border-radius: var(--office-radius-full);\n background: var(--office-teams-brand);\n}\n.row[data-unread='true'] {\n color: var(--office-foreground);\n font-weight: var(--office-font-weight-bold);\n}\n.title {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.live {\n display: grid;\n color: var(--office-call-live);\n}\n.count {\n min-width: 1.6em;\n padding: 0 var(--office-space-1);\n border-radius: var(--office-radius-full);\n background: var(--office-teams-brand);\n color: var(--office-teams-brand-foreground);\n font-size: var(--office-font-size-xs);\n line-height: 1.6;\n text-align: center;\n}\n";
325
+
326
+ // src/teams/channel-list.ts
327
+ var OfficeUiChannelList = class extends TeamsElement {
328
+ static styles = withStyles(channel_list_default);
329
+ static properties = {
330
+ heading: { type: String },
331
+ channels: { attribute: false },
332
+ selectedId: { type: String, attribute: "selected-id" },
333
+ collapsed: { state: true }
334
+ };
335
+ constructor() {
336
+ super();
337
+ this.heading = "Channels";
338
+ this.channels = [];
339
+ this.selectedId = "";
340
+ this.collapsed = false;
341
+ }
342
+ render() {
343
+ return html`
344
+ <div class="team">
345
+ <button
346
+ class="toggle"
347
+ type="button"
348
+ aria-expanded=${String(!this.collapsed)}
349
+ @click=${() => this.collapsed = !this.collapsed}
350
+ >
351
+ <span class="chevron" data-open=${String(!this.collapsed)}>${icon("chevronRight")}</span>
352
+ <span class="name">${this.heading}</span>
353
+ </button>
354
+ <button
355
+ class="add"
356
+ type="button"
357
+ title="Add channel"
358
+ aria-label="Add channel"
359
+ @click=${() => this.fire("office-channel-create", {})}
360
+ >
361
+ ${icon("plus")}
362
+ </button>
363
+ </div>
364
+ <ul ?hidden=${this.collapsed}>
365
+ ${this.channels.map(
366
+ (c) => html`
367
+ <li>
368
+ <button
369
+ class="row"
370
+ type="button"
371
+ aria-current=${c.id === this.selectedId ? "true" : "false"}
372
+ data-unread=${c.unread ? "true" : "false"}
373
+ @click=${() => this.fire("office-channel-select", { id: c.id })}
374
+ >
375
+ ${icon(c.kind === "direct" ? "message" : "hash")}
376
+ <span class="title">${c.name}</span>
377
+ ${c.live ? html`<span class="live" title="Call in progress">${icon("video")}</span>` : ""}
378
+ ${c.unread ? html`<span class="count">${c.unread > 99 ? "99+" : c.unread}</span>` : ""}
379
+ </button>
380
+ </li>
381
+ `
382
+ )}
383
+ </ul>
384
+ `;
385
+ }
386
+ };
387
+ var defineChannelList = definer("office-ui-channel-list", () => OfficeUiChannelList);
388
+
389
+ // raw-css:/home/runner/work/ooxml/ooxml/packages/ui/src/teams/chat-composer.css?raw
390
+ var chat_composer_default = ":host {\n display: block;\n padding: 0 var(--office-space-5) var(--office-space-4);\n}\n.typing {\n min-height: 1.4em;\n color: var(--office-teams-text-subtle);\n font-size: var(--office-font-size-xs);\n}\n.box {\n position: relative;\n border: var(--office-border-width) solid var(--office-teams-divider);\n border-block-end: var(--office-border-width-thick) solid var(--office-teams-divider);\n border-radius: var(--office-radius-md);\n background: var(--office-field-background);\n}\n.box:focus-within {\n border-block-end-color: var(--office-teams-brand);\n}\n.banner {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: var(--office-space-1) var(--office-space-3);\n border-bottom: var(--office-border-width) solid var(--office-teams-divider);\n background: var(--office-teams-panel);\n font-size: var(--office-font-size-sm);\n}\ntextarea {\n display: block;\n width: 100%;\n min-height: 3.2em;\n max-height: 12em;\n padding: var(--office-space-3);\n border: 0;\n outline: 0;\n resize: none;\n background: transparent;\n color: inherit;\n font: inherit;\n field-sizing: content;\n}\n.bar {\n display: flex;\n align-items: center;\n gap: var(--office-space-1);\n padding: 0 var(--office-space-2) var(--office-space-2);\n}\n.spacer {\n flex: 1;\n}\n.bar button,\n.banner button,\n.pending button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: var(--office-space-1);\n min-width: 2.2em;\n height: 2.2em;\n border: 0;\n border-radius: var(--office-radius);\n background: transparent;\n color: var(--office-teams-text-subtle);\n}\n.bar button:hover:not(:disabled),\n.banner button:hover {\n background: var(--office-selected);\n color: var(--office-foreground);\n}\n.bar button:disabled {\n opacity: 0.45;\n cursor: not-allowed;\n}\n.bar .send:not(:disabled) {\n color: var(--office-teams-brand);\n}\n.pending {\n display: flex;\n flex-wrap: wrap;\n gap: var(--office-space-1);\n margin: 0;\n padding: 0 var(--office-space-3);\n list-style: none;\n}\n.pending button {\n padding: 0 var(--office-space-2);\n border: var(--office-border-width) solid var(--office-teams-divider);\n background: var(--office-teams-panel);\n font-size: var(--office-font-size-sm);\n color: var(--office-foreground);\n}\n.emoji {\n position: relative;\n}\n.picker {\n position: absolute;\n inset-block-end: calc(100% + var(--office-space-1));\n inset-inline-start: 0;\n z-index: 2;\n display: grid;\n grid-template-columns: repeat(5, 1fr);\n gap: var(--office-space-0);\n padding: var(--office-space-2);\n border: var(--office-border-width) solid var(--office-teams-divider);\n border-radius: var(--office-radius-md);\n background: var(--office-popover);\n box-shadow: var(--office-shadow-teams);\n}\n.picker button {\n font-size: 1.3em;\n}\n";
391
+
392
+ // src/teams/chat-composer.ts
393
+ var EMOJI = [
394
+ "\u{1F600}",
395
+ "\u{1F604}",
396
+ "\u{1F602}",
397
+ "\u{1F642}",
398
+ "\u{1F609}",
399
+ "\u{1F60D}",
400
+ "\u{1F914}",
401
+ "\u{1F62E}",
402
+ "\u{1F622}",
403
+ "\u{1F621}",
404
+ "\u{1F44D}",
405
+ "\u{1F44E}",
406
+ "\u{1F44F}",
407
+ "\u{1F64F}",
408
+ "\u{1F4AA}",
409
+ "\u{1F389}",
410
+ "\u{1F525}",
411
+ "\u2764\uFE0F",
412
+ "\u2705",
413
+ "\u{1F440}"
414
+ ];
415
+ var MAX_FILES = 10;
416
+ var OfficeUiChatComposer = class extends TeamsElement {
417
+ static styles = withStyles(chat_composer_default);
418
+ static properties = {
419
+ typing: { attribute: false },
420
+ replyingTo: { attribute: false },
421
+ editing: { type: Boolean },
422
+ disabled: { type: Boolean, reflect: true },
423
+ placeholder: { type: String },
424
+ value: { type: String },
425
+ files: { state: true },
426
+ emojiOpen: { state: true }
427
+ };
428
+ lastTyping = 0;
429
+ constructor() {
430
+ super();
431
+ this.typing = [];
432
+ this.replyingTo = null;
433
+ this.editing = false;
434
+ this.disabled = false;
435
+ this.placeholder = "Type a message";
436
+ this.value = "";
437
+ this.files = [];
438
+ this.emojiOpen = false;
439
+ }
440
+ updated(changed) {
441
+ if (changed.has("replyingTo") || changed.has("editing")) {
442
+ if (this.replyingTo !== null || this.editing)
443
+ this.renderRoot.querySelector("textarea")?.focus();
444
+ }
445
+ }
446
+ get canSend() {
447
+ return !this.disabled && (this.value.trim() !== "" || this.files.length > 0);
448
+ }
449
+ submit() {
450
+ if (!this.canSend) return;
451
+ const { value: text, files } = this;
452
+ this.value = "";
453
+ this.files = [];
454
+ this.emojiOpen = false;
455
+ this.fire("office-chat-send", { text, files });
456
+ }
457
+ onInput(event) {
458
+ this.value = event.target.value;
459
+ const now = Date.now();
460
+ if (now - this.lastTyping > 2e3) {
461
+ this.lastTyping = now;
462
+ this.fire("office-chat-typing", {});
463
+ }
464
+ }
465
+ onKeydown(event) {
466
+ if (event.key === "Enter" && !event.shiftKey && !event.isComposing) {
467
+ event.preventDefault();
468
+ this.submit();
469
+ } else if (event.key === "Escape" && (this.replyingTo !== null || this.editing)) {
470
+ this.fire("office-chat-cancel", {});
471
+ }
472
+ }
473
+ pick(event) {
474
+ const input = event.target;
475
+ this.files = [...this.files, ...Array.from(input.files ?? [])].slice(0, MAX_FILES);
476
+ input.value = "";
477
+ }
478
+ typingLine() {
479
+ const n = this.typing.slice(0, 3);
480
+ if (n.length === 0) return "";
481
+ return n.length === 1 ? `${n[0]} is typing\u2026` : `${n.join(", ")} are typing\u2026`;
482
+ }
483
+ render() {
484
+ const banner = this.editing ? "Editing message" : this.replyingTo !== null ? `Replying to ${this.replyingTo}` : "";
485
+ return html`
486
+ <div class="typing" aria-live="polite">${this.typingLine()}</div>
487
+ <div class="box">
488
+ ${banner ? html`<div class="banner">
489
+ <span>${banner}</span>
490
+ <button
491
+ type="button"
492
+ aria-label="Cancel"
493
+ @click=${() => this.fire("office-chat-cancel", {})}
494
+ >
495
+ ${icon("close")}
496
+ </button>
497
+ </div>` : nothing}
498
+ <textarea
499
+ rows="1"
500
+ aria-label="Message"
501
+ .value=${live(this.value)}
502
+ placeholder=${this.placeholder}
503
+ ?disabled=${this.disabled}
504
+ @input=${this.onInput}
505
+ @keydown=${this.onKeydown}
506
+ ></textarea>
507
+ ${this.files.length ? html`<ul class="pending">
508
+ ${this.files.map(
509
+ (f, i) => html`<li>
510
+ <button
511
+ type="button"
512
+ aria-label=${`Remove ${f.name}`}
513
+ @click=${() => this.files = this.files.filter((_, j) => j !== i)}
514
+ >
515
+ ${f.name} ${icon("close")}
516
+ </button>
517
+ </li>`
518
+ )}
519
+ </ul>` : nothing}
520
+ <div class="bar">
521
+ <button
522
+ type="button"
523
+ title="Attach files"
524
+ aria-label="Attach files"
525
+ ?disabled=${this.disabled}
526
+ @click=${() => this.renderRoot.querySelector("input[type=file]")?.click()}
527
+ >
528
+ ${icon("paperclip")}
529
+ </button>
530
+ <div class="emoji">
531
+ <button
532
+ type="button"
533
+ title="Emoji"
534
+ aria-label="Emoji"
535
+ aria-expanded=${String(this.emojiOpen)}
536
+ ?disabled=${this.disabled}
537
+ @click=${() => this.emojiOpen = !this.emojiOpen}
538
+ >
539
+ ${icon("smile")}
540
+ </button>
541
+ ${this.emojiOpen ? html`<div class="picker" role="menu">
542
+ ${EMOJI.map(
543
+ (e) => html`<button
544
+ type="button"
545
+ role="menuitem"
546
+ @click=${() => {
547
+ this.value += e;
548
+ this.emojiOpen = false;
549
+ this.renderRoot.querySelector("textarea")?.focus();
550
+ }}
551
+ >
552
+ ${e}
553
+ </button>`
554
+ )}
555
+ </div>` : nothing}
556
+ </div>
557
+ <span class="spacer"></span>
558
+ <button
559
+ type="button"
560
+ class="send"
561
+ title="Send"
562
+ aria-label="Send message"
563
+ ?disabled=${!this.canSend}
564
+ @click=${this.submit}
565
+ >
566
+ ${icon("send")}
567
+ </button>
568
+ </div>
569
+ <input type="file" multiple hidden @change=${this.pick} />
570
+ </div>
571
+ `;
572
+ }
573
+ };
574
+ var defineChatComposer = definer("office-ui-chat-composer", () => OfficeUiChatComposer);
575
+
576
+ // raw-css:/home/runner/work/ooxml/ooxml/packages/ui/src/teams/chat-list.css?raw
577
+ var chat_list_default = ":host {\n display: block;\n min-height: 0;\n overflow: auto;\n padding: var(--office-space-2) var(--office-space-5);\n}\n.empty {\n margin: var(--office-space-6) 0;\n color: var(--office-teams-text-subtle);\n text-align: center;\n}\n\n.day {\n display: flex;\n align-items: center;\n gap: var(--office-space-3);\n margin: var(--office-space-4) 0 var(--office-space-2);\n color: var(--office-teams-text-subtle);\n font-size: var(--office-font-size-xs);\n}\n.day::before,\n.day::after {\n content: '';\n flex: 1;\n height: var(--office-border-width);\n background: var(--office-teams-divider);\n}\n\n.msg {\n position: relative;\n display: grid;\n grid-template-columns: 2.3em minmax(0, 1fr);\n column-gap: var(--office-space-3);\n padding: var(--office-space-0) 0;\n}\n.msg[data-grouped='false'] {\n margin-top: var(--office-space-3);\n}\n.gutter {\n padding-top: var(--office-space-1);\n}\nheader {\n display: flex;\n align-items: baseline;\n gap: var(--office-space-2);\n margin-bottom: var(--office-space-0);\n}\n.author {\n font-weight: var(--office-font-weight-bold);\n}\ntime,\n.edited,\n.file-size {\n color: var(--office-teams-text-subtle);\n font-size: var(--office-font-size-xs);\n}\n\n.bubble {\n display: inline-block;\n max-width: min(100%, 44em);\n padding: var(--office-space-2) var(--office-space-3);\n border-radius: var(--office-radius-md);\n background: var(--office-teams-bubble);\n line-height: var(--office-line-height);\n overflow-wrap: anywhere;\n}\n.text {\n white-space: pre-wrap;\n}\n.msg[data-own='true'] .bubble {\n background: var(--office-teams-bubble-own);\n}\n.deleted {\n color: var(--office-teams-text-subtle);\n font-style: italic;\n}\nblockquote {\n margin: 0 0 var(--office-space-1);\n padding-inline-start: var(--office-space-2);\n border-inline-start: var(--office-border-width-thick) solid var(--office-teams-brand);\n color: var(--office-teams-text-subtle);\n font-size: var(--office-font-size-sm);\n white-space: normal;\n}\nblockquote strong {\n display: block;\n color: var(--office-foreground);\n}\n\n.files {\n display: flex;\n flex-wrap: wrap;\n gap: var(--office-space-2);\n margin-top: var(--office-space-2);\n white-space: normal;\n}\n.file {\n display: flex;\n align-items: center;\n gap: var(--office-space-3);\n min-width: 14em;\n padding: var(--office-space-2) var(--office-space-3);\n border: var(--office-border-width) solid var(--office-teams-divider);\n border-radius: var(--office-radius-md);\n background: var(--office-background);\n text-align: start;\n}\n.file:hover {\n border-color: var(--office-teams-brand);\n}\n.badge {\n display: grid;\n place-items: center;\n width: 2.2em;\n height: 2.2em;\n border-radius: var(--office-radius);\n background: var(--office-file-other);\n color: var(--office-call-foreground);\n font-weight: var(--office-font-weight-bold);\n}\n.badge[data-kind='docx'] {\n background: var(--office-file-docx);\n}\n.badge[data-kind='xlsx'] {\n background: var(--office-file-xlsx);\n}\n.badge[data-kind='pptx'] {\n background: var(--office-file-pptx);\n}\n.badge[data-kind='vsdx'] {\n background: var(--office-file-vsdx);\n}\n.meta {\n display: grid;\n}\n\n.reactions {\n display: flex;\n flex-wrap: wrap;\n gap: var(--office-space-1);\n margin-top: var(--office-space-1);\n}\n.pill {\n display: inline-flex;\n gap: var(--office-space-1);\n padding: 0 var(--office-space-2);\n border: var(--office-border-width) solid var(--office-teams-divider);\n border-radius: var(--office-radius-full);\n background: var(--office-background);\n font-size: var(--office-font-size-sm);\n}\n.pill[aria-pressed='true'] {\n border-color: var(--office-teams-brand);\n background: var(--office-teams-brand-subtle);\n}\n\n.toolbar {\n position: absolute;\n inset-block-start: calc(-1 * var(--office-space-3));\n inset-inline-end: 0;\n display: none;\n gap: var(--office-space-0);\n padding: var(--office-space-0);\n border: var(--office-border-width) solid var(--office-teams-divider);\n border-radius: var(--office-radius-md);\n background: var(--office-popover);\n box-shadow: var(--office-shadow-teams);\n}\n.msg:hover .toolbar,\n.msg:focus-within .toolbar {\n display: flex;\n}\n.toolbar button {\n display: grid;\n place-items: center;\n min-width: 2em;\n height: 2em;\n border: 0;\n border-radius: var(--office-radius-sm);\n background: transparent;\n}\n.toolbar button:hover {\n background: var(--office-selected);\n}\n";
578
+
579
+ // src/teams/chat-list.ts
580
+ var QUICK_REACTIONS = ["\u{1F44D}", "\u2764\uFE0F", "\u{1F602}", "\u{1F62E}", "\u{1F622}", "\u{1F389}"];
581
+ var KIND_LETTER = {
582
+ docx: "W",
583
+ xlsx: "X",
584
+ pptx: "P",
585
+ vsdx: "V",
586
+ other: "F"
587
+ };
588
+ var GROUP_MS = 5 * 6e4;
589
+ var OfficeUiChatList = class extends TeamsElement {
590
+ static styles = withStyles(chat_list_default);
591
+ static properties = {
592
+ messages: { attribute: false },
593
+ selfId: { type: String, attribute: "self-id" }
594
+ };
595
+ stickToBottom = true;
596
+ constructor() {
597
+ super();
598
+ this.messages = [];
599
+ this.selfId = "";
600
+ }
601
+ connectedCallback() {
602
+ super.connectedCallback();
603
+ this.setAttribute("role", "log");
604
+ this.setAttribute("aria-live", "polite");
605
+ this.setAttribute("aria-label", "Messages");
606
+ this.addEventListener("scroll", () => {
607
+ this.stickToBottom = this.scrollHeight - this.scrollTop - this.clientHeight < 64;
608
+ });
609
+ }
610
+ updated() {
611
+ if (this.stickToBottom) this.scrollTop = this.scrollHeight;
612
+ }
613
+ render() {
614
+ if (this.messages.length === 0) return html`<p class="empty">No messages yet. Say hello.</p>`;
615
+ const byId = new Map(this.messages.map((m) => [m.id, m]));
616
+ const rows = [];
617
+ let previous;
618
+ for (const m of this.messages) {
619
+ if (!previous || dayLabel(previous.ts) !== dayLabel(m.ts))
620
+ rows.push(html`<div class="day"><span>${dayLabel(m.ts)}</span></div>`);
621
+ const grouped = previous !== void 0 && previous.authorId === m.authorId && m.ts - previous.ts < GROUP_MS && !m.replyTo && dayLabel(previous.ts) === dayLabel(m.ts);
622
+ rows.push(this.message(m, grouped, byId.get(m.replyTo ?? "")));
623
+ previous = m;
624
+ }
625
+ return html`${rows}`;
626
+ }
627
+ message(m, grouped, parent) {
628
+ const own = m.authorId === this.selfId;
629
+ const reactions = Object.entries(m.reactions ?? {}).filter(([, users]) => users.length > 0);
630
+ return html`
631
+ <article class="msg" data-own=${String(own)} data-grouped=${String(grouped)}>
632
+ <div class="gutter">
633
+ ${grouped ? nothing : html`<office-ui-avatar name=${m.authorName} seed=${m.authorId}></office-ui-avatar>`}
634
+ </div>
635
+ <div class="body">
636
+ ${grouped ? nothing : html`<header>
637
+ <span class="author">${m.authorName}</span>
638
+ <time>${formatTime(m.ts)}</time>
639
+ </header>`}
640
+ <div class="bubble">
641
+ ${parent ? html`<blockquote>
642
+ <strong>${parent.authorName}</strong
643
+ >${parent.deleted ? "This message was deleted" : parent.text.slice(0, 120)}
644
+ </blockquote>` : nothing}
645
+ ${m.deleted ? html`<span class="deleted">This message was deleted</span>` : html`<span class="text">${m.text}</span>${m.editedAt ? html` <span class="edited">(edited)</span>` : nothing}`}
646
+ ${!m.deleted && m.attachments?.length ? this.files(m.attachments) : nothing}
647
+ </div>
648
+ ${!m.deleted && reactions.length ? html`<div class="reactions">
649
+ ${reactions.map(
650
+ ([emoji, users]) => html`
651
+ <button
652
+ type="button"
653
+ class="pill"
654
+ aria-pressed=${String(users.includes(this.selfId))}
655
+ aria-label=${`${emoji} ${users.length}`}
656
+ @click=${() => this.fire("office-chat-react", { messageId: m.id, emoji })}
657
+ >
658
+ <span>${emoji}</span><span>${users.length}</span>
659
+ </button>
660
+ `
661
+ )}
662
+ </div>` : nothing}
663
+ ${m.deleted ? nothing : this.toolbar(m, own)}
664
+ </div>
665
+ </article>
666
+ `;
667
+ }
668
+ toolbar(m, own) {
669
+ return html`
670
+ <div class="toolbar" role="toolbar" aria-label="Message actions">
671
+ ${QUICK_REACTIONS.slice(0, 4).map(
672
+ (emoji) => html`<button
673
+ type="button"
674
+ aria-label=${`React ${emoji}`}
675
+ @click=${() => this.fire("office-chat-react", { messageId: m.id, emoji })}
676
+ >
677
+ ${emoji}
678
+ </button>`
679
+ )}
680
+ <button
681
+ type="button"
682
+ title="Reply"
683
+ aria-label="Reply"
684
+ @click=${() => this.fire("office-chat-reply", { messageId: m.id })}
685
+ >
686
+ ${icon("reply")}
687
+ </button>
688
+ ${own ? html`<button
689
+ type="button"
690
+ title="Edit"
691
+ aria-label="Edit"
692
+ @click=${() => this.fire("office-chat-edit", { messageId: m.id })}
693
+ >
694
+ ${icon("pencil")}
695
+ </button>
696
+ <button
697
+ type="button"
698
+ title="Delete"
699
+ aria-label="Delete"
700
+ @click=${() => this.fire("office-chat-delete", { messageId: m.id })}
701
+ >
702
+ ${icon("trash")}
703
+ </button>` : nothing}
704
+ </div>
705
+ `;
706
+ }
707
+ files(files) {
708
+ return html`<div class="files">
709
+ ${files.map(
710
+ (a) => html`
711
+ <button
712
+ type="button"
713
+ class="file"
714
+ aria-label=${`Open ${a.name}`}
715
+ @click=${() => this.fire("office-chat-open-file", { attachment: a })}
716
+ >
717
+ <span class="badge" data-kind=${a.kind}>${KIND_LETTER[a.kind]}</span>
718
+ <span class="meta">
719
+ <span class="file-name">${a.name}</span>
720
+ <span class="file-size">${a.kind.toUpperCase()} ${formatSize(a.size)}</span>
721
+ </span>
722
+ </button>
723
+ `
724
+ )}
725
+ </div>`;
726
+ }
727
+ };
728
+ var defineChatList = definer("office-ui-chat-list", () => OfficeUiChatList);
729
+
730
+ // raw-css:/home/runner/work/ooxml/ooxml/packages/ui/src/teams/prejoin.css?raw
731
+ var prejoin_default = ":host {\n display: grid;\n place-items: center;\n padding: var(--office-space-5);\n background: var(--office-teams-panel);\n}\n.card {\n display: grid;\n grid-template-columns: minmax(0, 3fr) minmax(16em, 2fr);\n width: min(60em, 100%);\n overflow: hidden;\n border-radius: var(--office-radius-lg);\n background: var(--office-background);\n box-shadow: var(--office-shadow-teams);\n}\n.stage {\n position: relative;\n display: grid;\n place-content: center;\n justify-items: center;\n gap: var(--office-space-3);\n min-height: 18em;\n background: var(--office-call-background);\n color: var(--office-call-muted-foreground);\n}\n.stage video {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n object-fit: cover;\n transform: scaleX(-1);\n}\n.panel {\n display: flex;\n flex-direction: column;\n gap: var(--office-space-3);\n padding: var(--office-space-5);\n}\nh2 {\n margin: 0;\n font-size: var(--office-font-size-lg);\n}\n.for {\n margin: 0;\n color: var(--office-teams-text-subtle);\n}\n.switch {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: var(--office-space-3);\n border: var(--office-border-width) solid var(--office-teams-divider);\n border-radius: var(--office-radius-md);\n cursor: pointer;\n}\n.what {\n display: inline-flex;\n align-items: center;\n gap: var(--office-space-2);\n}\n.switch input {\n position: absolute;\n inset: 0;\n margin: 0;\n opacity: 0;\n cursor: pointer;\n}\n.track {\n position: relative;\n width: 2.6em;\n height: 1.4em;\n border-radius: var(--office-radius-full);\n background: var(--office-border);\n transition: background var(--office-duration-fast);\n}\n.track::after {\n content: '';\n position: absolute;\n inset-block-start: 0.2em;\n inset-inline-start: 0.2em;\n width: 1em;\n height: 1em;\n border-radius: 50%;\n background: var(--office-background);\n transition: transform var(--office-duration-fast);\n}\n.switch input:checked ~ .track {\n background: var(--office-teams-brand);\n}\n.switch input:checked ~ .track::after {\n transform: translateX(1.2em);\n}\n.switch:has(input:focus-visible) {\n outline: var(--office-focus-width) solid var(--office-ring);\n}\n.actions {\n display: flex;\n justify-content: flex-end;\n gap: var(--office-space-2);\n margin-top: auto;\n}\n.actions button {\n padding: var(--office-space-2) var(--office-space-5);\n border: var(--office-border-width) solid var(--office-teams-divider);\n border-radius: var(--office-radius-md);\n background: var(--office-background);\n font-weight: var(--office-font-weight-bold);\n}\n.actions .join {\n border-color: transparent;\n background: var(--office-teams-brand);\n color: var(--office-teams-brand-foreground);\n}\n.actions .join:hover:not(:disabled) {\n background: var(--office-teams-brand-hover);\n}\n.actions button:disabled {\n opacity: 0.6;\n cursor: wait;\n}\n@media (max-width: 767px) {\n .card {\n grid-template-columns: 1fr;\n }\n}\n";
732
+
733
+ // src/teams/prejoin.ts
734
+ var OfficeUiPrejoin = class extends TeamsElement {
735
+ static styles = withStyles(prejoin_default);
736
+ static properties = {
737
+ heading: { type: String },
738
+ name: { type: String },
739
+ preview: { attribute: false },
740
+ audio: { type: Boolean },
741
+ video: { type: Boolean },
742
+ busy: { type: Boolean }
743
+ };
744
+ constructor() {
745
+ super();
746
+ this.heading = "";
747
+ this.name = "";
748
+ this.preview = null;
749
+ this.audio = true;
750
+ this.video = true;
751
+ this.busy = false;
752
+ }
753
+ toggle(label, glyph, on, key) {
754
+ return html`
755
+ <label class="switch">
756
+ <span class="what">${icon(glyph)} ${label}</span>
757
+ <input
758
+ type="checkbox"
759
+ role="switch"
760
+ .checked=${on}
761
+ aria-label=${label}
762
+ @change=${(e) => this.fire("office-prejoin-change", { [key]: e.target.checked })}
763
+ />
764
+ <span class="track" aria-hidden="true"></span>
765
+ </label>
766
+ `;
767
+ }
768
+ render() {
769
+ const showVideo = this.video && this.preview;
770
+ return html`
771
+ <section class="card">
772
+ <div class="stage">
773
+ ${showVideo ? html`<video
774
+ autoplay
775
+ playsinline
776
+ muted
777
+ .muted=${true}
778
+ .srcObject=${this.preview}
779
+ ></video>` : html`<office-ui-avatar size="xl" name=${this.name}></office-ui-avatar>
780
+ <p>${this.video ? "Starting camera\u2026" : "Your camera is turned off"}</p>`}
781
+ </div>
782
+ <div class="panel">
783
+ <h2>Choose your audio and video settings</h2>
784
+ <p class="for">${this.heading}</p>
785
+ ${this.toggle("Camera", this.video ? "video" : "videoOff", this.video, "video")}
786
+ ${this.toggle("Microphone", this.audio ? "mic" : "micOff", this.audio, "audio")}
787
+ <div class="actions">
788
+ <button
789
+ type="button"
790
+ class="cancel"
791
+ @click=${() => this.fire("office-prejoin-cancel", {})}
792
+ >
793
+ Cancel
794
+ </button>
795
+ <button
796
+ type="button"
797
+ class="join"
798
+ ?disabled=${this.busy}
799
+ @click=${() => this.fire("office-prejoin-join", {})}
800
+ >
801
+ ${this.busy ? "Joining\u2026" : "Join now"}
802
+ </button>
803
+ </div>
804
+ ${nothing}
805
+ </div>
806
+ </section>
807
+ `;
808
+ }
809
+ };
810
+ var definePrejoin = definer("office-ui-prejoin", () => OfficeUiPrejoin);
811
+
812
+ // src/teams/index.ts
813
+ var TEAMS_TAGS = [
814
+ "office-ui-avatar",
815
+ "office-ui-app-rail",
816
+ "office-ui-channel-list",
817
+ "office-ui-chat-list",
818
+ "office-ui-chat-composer",
819
+ "office-ui-prejoin",
820
+ "office-ui-call-grid",
821
+ "office-ui-call-controls"
822
+ ];
823
+ function registerTeams() {
824
+ defineAvatar();
825
+ defineAppRail();
826
+ defineChannelList();
827
+ defineChatList();
828
+ defineChatComposer();
829
+ definePrejoin();
830
+ defineCallGrid();
831
+ defineCallControls();
832
+ }
833
+
834
+ 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 };