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
@@ -1,52 +0,0 @@
1
- export type OfficeDialogFooterVariant = 'secondary' | 'primary' | 'warning' | 'danger';
2
- export interface OfficeDialogFooterAction {
3
- /** Stable id echoed back in the request event. */
4
- id: string;
5
- /** Translated label and accessible name. */
6
- label: string;
7
- variant?: OfficeDialogFooterVariant;
8
- /** A registered icon name (for example `trash`, `pencil`, `restore`, `print`, `check`). */
9
- icon?: string;
10
- disabled?: boolean;
11
- /** Work in flight: disabled, `aria-busy` and a spinner. */
12
- busy?: boolean;
13
- title?: string;
14
- /** `start` pins a tertiary action (Remove link, Reset all) to the left edge. */
15
- align?: 'start' | 'end';
16
- testId?: string;
17
- }
18
- export interface OfficeDialogFooterState {
19
- actions: readonly OfficeDialogFooterAction[];
20
- }
21
- /**
22
- * `<office-ui-dialog-footer>`: a dialog's action row (Cancel, OK, Apply...). Not a dialog shell.
23
- * Set `state`; each button emits `office-dialog-footer-request` `{ id }`. Buttons are keyed by
24
- * action id and patched in place, so focus survives state changes. `focusAction(id)`.
25
- */
26
- export declare const defineDialogFooter: import("./registry.js").Definer;
27
- /** Toasts rendered before the rest collapse into a "+N" count. */
28
- export declare const OFFICE_TOAST_VISIBLE_LIMIT = 5;
29
- export interface OfficeToast {
30
- readonly id: string;
31
- /** Machine-readable code, mirrored to `data-code`. */
32
- readonly code?: string;
33
- readonly severity: 'info' | 'warning';
34
- /** Translated message. */
35
- readonly message: string;
36
- }
37
- export interface OfficeToastsState {
38
- toasts: readonly OfficeToast[];
39
- /** Extra toasts a host already trimmed off the list it passes. */
40
- overflowCount?: number;
41
- labels?: {
42
- title?: string;
43
- dismissAll?: string;
44
- dismiss?: string;
45
- };
46
- }
47
- /**
48
- * `<office-ui-toasts>`: a stack of load or compatibility notices. Toasts never auto-hide;
49
- * dismissal is the host's decision through `office-toasts-request` `{ id: 'dismissAll' }` or
50
- * `{ id: 'dismiss', toastId }`. The host positions the element. Hidden when empty.
51
- */
52
- export declare const defineToasts: import("./registry.js").Definer;
@@ -1,119 +0,0 @@
1
- import { definer, attachStyles, controlCss, emit } from './chunk-UEJ4F33J.js';
2
- import { tok } from './chunk-G3LAGZEW.js';
3
-
4
- // src/presence.ts
5
- function participantsFromAwareness(states, selfId) {
6
- const out = [];
7
- for (const state of states) {
8
- const user = state?.user;
9
- const id = String(user?.id ?? state?.clientId ?? "");
10
- if (!id || !user?.name) continue;
11
- out.push({
12
- id,
13
- name: user.name,
14
- ...user.color ? { color: user.color } : {},
15
- ...user.status ? { status: user.status } : {},
16
- ...id === selfId || user.self ? { self: true } : {}
17
- });
18
- }
19
- return out;
20
- }
21
- var initialsOf = (name) => {
22
- const parts = name.trim().split(/\s+/).filter(Boolean);
23
- if (parts.length === 0) return "?";
24
- const first = [...parts[0] ?? ""][0] ?? "?";
25
- const last = parts.length > 1 ? [...parts[parts.length - 1] ?? ""][0] ?? "" : "";
26
- return (first + last).toUpperCase();
27
- };
28
- var CSS = `
29
- :host { display: inline-flex; align-items: center; }
30
- ul { display: flex; margin: 0; padding: 0; list-style: none; }
31
- li { margin-inline-start: calc(-1 * ${tok("--office-space-1-5")}); }
32
- li:first-child { margin-inline-start: 0; }
33
- button, .more { box-sizing: border-box; display: inline-grid; place-items: center;
34
- width: ${tok("--office-target-size")}; height: ${tok("--office-target-size")}; padding: 0; border-radius: 50%;
35
- border: ${tok("--office-border-width-thick")} solid ${tok("--office-avatar-color")}; background: ${tok("--office-surface")};
36
- color: ${tok("--office-foreground")}; font: 600 ${tok("--office-font-size-xs")} ${tok("--office-font")}; cursor: pointer; }
37
- .more { cursor: default; border-color: ${tok("--office-border")}; }
38
- button:focus-visible { outline: ${tok("--office-focus-width")} solid ${tok("--office-ring")}; outline-offset: calc(${tok("--office-focus-offset")} / 2); z-index: 1; }
39
- button[data-status="idle"] { opacity: .7; }
40
- button[data-status="away"] { opacity: .45; border-style: dashed; }
41
- @media (forced-colors: active) {
42
- button, .more { border-color: CanvasText; background: Canvas; color: CanvasText; }
43
- button:focus-visible { outline-color: Highlight; }
44
- }
45
- `;
46
- var definePresence = definer("office-ui-presence", () => {
47
- class OfficeUiPresence extends HTMLElement {
48
- static observedAttributes = ["max", "label"];
49
- people = [];
50
- list;
51
- constructor() {
52
- super();
53
- const root = this.attachShadow({ mode: "open" });
54
- attachStyles(root, controlCss(CSS));
55
- this.list = this.ownerDocument.createElement("ul");
56
- this.list.setAttribute("role", "list");
57
- root.append(this.list);
58
- }
59
- connectedCallback() {
60
- this.render();
61
- }
62
- attributeChangedCallback() {
63
- this.render();
64
- }
65
- get participants() {
66
- return this.people;
67
- }
68
- set participants(next) {
69
- this.people = [...next].sort((a, b) => Number(Boolean(b.self)) - Number(Boolean(a.self)));
70
- this.render();
71
- }
72
- get max() {
73
- const n = Number(this.getAttribute("max") ?? 4);
74
- return Number.isFinite(n) && n >= 1 ? Math.floor(n) : 4;
75
- }
76
- render() {
77
- const doc = this.ownerDocument;
78
- this.setAttribute("role", "group");
79
- this.setAttribute(
80
- "aria-label",
81
- this.getAttribute("label") ?? `${this.people.length} collaborators`
82
- );
83
- const shown = this.people.slice(0, this.max);
84
- const items = shown.map((person) => {
85
- const li = doc.createElement("li");
86
- const button = doc.createElement("button");
87
- button.type = "button";
88
- button.textContent = initialsOf(person.name);
89
- button.dataset.id = person.id;
90
- button.dataset.status = person.status ?? "active";
91
- if (person.color) button.style.setProperty("--office-avatar-color", person.color);
92
- const status = person.status && person.status !== "active" ? `, ${person.status}` : "";
93
- button.setAttribute("aria-label", `${person.name}${person.self ? " (you)" : ""}${status}`);
94
- button.title = person.name;
95
- button.addEventListener(
96
- "click",
97
- () => emit(this, "office-presence-select", { id: person.id })
98
- );
99
- li.append(button);
100
- return li;
101
- });
102
- const hidden = this.people.length - shown.length;
103
- if (hidden > 0) {
104
- const li = doc.createElement("li");
105
- const chip = doc.createElement("span");
106
- chip.className = "more";
107
- chip.textContent = `+${hidden}`;
108
- chip.title = this.people.slice(shown.length).map((p) => p.name).join(", ");
109
- chip.setAttribute("aria-label", `${hidden} more: ${chip.title}`);
110
- li.append(chip);
111
- items.push(li);
112
- }
113
- this.list.replaceChildren(...items);
114
- }
115
- }
116
- return OfficeUiPresence;
117
- });
118
-
119
- export { definePresence, initialsOf, participantsFromAwareness };
@@ -1,78 +0,0 @@
1
- import { TOUCH, tok } from './chunk-G3LAGZEW.js';
2
-
3
- // src/registry.ts
4
- var CONTRACT_REVISION = 1;
5
- var CONTRACT_KEY = /* @__PURE__ */ Symbol.for("office-ui.web-control-contract");
6
- function assertContract(registry, tag) {
7
- const revision = registry.get(tag)?.[CONTRACT_KEY];
8
- if (revision !== void 0 && revision !== CONTRACT_REVISION) {
9
- throw new Error(
10
- `Incompatible ${tag} contract (${revision}; expected ${CONTRACT_REVISION}). Load one version of ooxml-ui per window.`
11
- );
12
- }
13
- }
14
- function defineOnce(registry, tag, make) {
15
- assertContract(registry, tag);
16
- if (registry.get(tag)) return;
17
- const ctor = make();
18
- Object.defineProperty(ctor, CONTRACT_KEY, { value: CONTRACT_REVISION });
19
- registry.define(tag, ctor);
20
- }
21
- function browserRegistry() {
22
- return typeof window === "undefined" ? void 0 : window.customElements;
23
- }
24
- function definer(tag, make) {
25
- const define = (registry = browserRegistry()) => {
26
- if (registry) defineOnce(registry, tag, make);
27
- };
28
- return Object.assign(define, { tag });
29
- }
30
- function emit(host, type, detail, cancelable = false) {
31
- return host.dispatchEvent(
32
- new CustomEvent(type, { detail, bubbles: true, composed: true, cancelable })
33
- );
34
- }
35
- function present(value) {
36
- return value === "" || Boolean(value);
37
- }
38
-
39
- // src/styles.ts
40
- var sheetsByDocument = /* @__PURE__ */ new WeakMap();
41
- function attachStyles(root, css) {
42
- const doc = root.host.ownerDocument;
43
- const Sheet = doc.defaultView?.CSSStyleSheet;
44
- if (Sheet && "adoptedStyleSheets" in root && "replaceSync" in Sheet.prototype) {
45
- try {
46
- let sheets = sheetsByDocument.get(doc);
47
- if (!sheets) {
48
- sheets = /* @__PURE__ */ new Map();
49
- sheetsByDocument.set(doc, sheets);
50
- }
51
- let sheet = sheets.get(css);
52
- if (!sheet) {
53
- sheet = new Sheet();
54
- sheet.replaceSync(css);
55
- sheets.set(css, sheet);
56
- }
57
- root.adoptedStyleSheets = [...root.adoptedStyleSheets, sheet];
58
- return;
59
- } catch {
60
- }
61
- }
62
- const style = doc.createElement("style");
63
- style.textContent = css;
64
- root.append(style);
65
- }
66
- var COMMON_CONTROL_CSS = `
67
- :host([hidden]) { display: none !important; }
68
- @media ${TOUCH} {
69
- :host { --office-target-size: ${tok("--office-target-size-touch")}; }
70
- }
71
- @media (forced-colors: active) {
72
- :host(:focus-visible), :focus-visible { outline: ${tok("--office-focus-width")} solid Highlight; outline-offset: ${tok("--office-focus-offset")}; }
73
- }
74
- `;
75
- var controlCss = (css) => `${COMMON_CONTROL_CSS}
76
- ${css}`;
77
-
78
- export { CONTRACT_REVISION, attachStyles, controlCss, definer, emit, present };