ooxml-ui 0.13.0 → 0.15.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.
package/dist/controls.js CHANGED
@@ -1,5 +1,5 @@
1
- export { CONTROL_DEFINERS, DEFAULT_OFFICE_PROFILE, OFFICE_AVATAR_SWATCHES, OFFICE_PROFILE_STORAGE_KEY, OFFICE_TOAST_VISIBLE_LIMIT, attachKeyTips, clampOptionNumber, clearOfficeProfile, defineAccount, defineBackstage, defineButton, defineCheckbox, defineCommandSearch, defineContextMenu, defineDialog, defineDialogFooter, defineFindBar, defineMenuButton, defineMenuItem, defineMenuSeparator, defineOptionsDialog, definePasteOptions, definePrintPreview, defineRadio, defineReadOnlyBanner, defineRibbon, defineRibbonGroup, defineRibbonStack, defineRibbonToggle, defineRuler, defineSearchField, defineSelect, defineStatusBar, defineStatusItem, defineSwitch, defineTabStrip, defineToasts, defineToolbar, defineZoomSlider, profileInitials, readOfficeProfile, registerControls, rulerDivisions, sanitizeOfficeProfile, writeOfficeProfile } from './chunk-JROJGF7A.js';
2
- export { defineIcon } from './chunk-4NUKVNSJ.js';
3
- import './chunk-NOQAM6ZS.js';
4
- import './chunk-D6EREKYF.js';
5
- import './chunk-MDW2Y5UN.js';
1
+ export { CONTROL_DEFINERS, DEFAULT_OFFICE_PROFILE, OFFICE_AVATAR_SWATCHES, OFFICE_PROFILE_STORAGE_KEY, OFFICE_TOAST_VISIBLE_LIMIT, attachKeyTips, clampOptionNumber, clearOfficeProfile, defineAccount, defineBackstage, defineButton, defineCheckbox, defineCommandSearch, defineContextMenu, defineDialog, defineDialogFooter, defineFindBar, defineMenuButton, defineMenuItem, defineMenuSeparator, defineOptionsDialog, definePasteOptions, definePrintPreview, defineRadio, defineReadOnlyBanner, defineRibbon, defineRibbonGroup, defineRibbonStack, defineRibbonToggle, defineRuler, defineSearchField, defineSelect, defineStatusBar, defineStatusItem, defineSwitch, defineTabStrip, defineToasts, defineToolbar, defineZoomSlider, profileInitials, readOfficeProfile, registerControls, rulerDivisions, sanitizeOfficeProfile, writeOfficeProfile } from './chunk-ZBFAPBNU.js';
2
+ export { defineIcon } from './chunk-VUXNXH4Q.js';
3
+ import './chunk-VYF7LGXZ.js';
4
+ import './chunk-NDEB6EBU.js';
5
+ import './chunk-4MT4OIAJ.js';
package/dist/icons.js CHANGED
@@ -1,3 +1,3 @@
1
- export { ICON_CSS, createIconSvg, defineIcon, getIcon, listIcons, paintIcon, registerIcon } from './chunk-4NUKVNSJ.js';
2
- import './chunk-D6EREKYF.js';
3
- import './chunk-MDW2Y5UN.js';
1
+ export { ICON_CSS, createIconSvg, defineIcon, getIcon, listIcons, paintIcon, registerIcon } from './chunk-VUXNXH4Q.js';
2
+ import './chunk-NDEB6EBU.js';
3
+ import './chunk-4MT4OIAJ.js';
package/dist/index.js CHANGED
@@ -1,14 +1,14 @@
1
- import { installOfficeUiTheme } from './chunk-LI6OV55P.js';
2
- export { THEME_CSS, THEME_STYLE_ID, installOfficeUiTheme } from './chunk-LI6OV55P.js';
3
- import { registerControls } from './chunk-JROJGF7A.js';
4
- export { CONTROL_DEFINERS, DEFAULT_OFFICE_PROFILE, OFFICE_AVATAR_SWATCHES, OFFICE_PROFILE_STORAGE_KEY, OFFICE_TOAST_VISIBLE_LIMIT, attachKeyTips, clampOptionNumber, clearOfficeProfile, defineAccount, defineBackstage, defineButton, defineCheckbox, defineCommandSearch, defineContextMenu, defineDialog, defineDialogFooter, defineFindBar, defineMenuButton, defineMenuItem, defineMenuSeparator, defineOptionsDialog, definePasteOptions, definePrintPreview, defineRadio, defineReadOnlyBanner, defineRibbon, defineRibbonGroup, defineRibbonStack, defineRibbonToggle, defineRuler, defineSearchField, defineSelect, defineStatusBar, defineStatusItem, defineSwitch, defineTabStrip, defineToasts, defineToolbar, defineZoomSlider, profileInitials, readOfficeProfile, registerControls, rulerDivisions, sanitizeOfficeProfile, writeOfficeProfile } from './chunk-JROJGF7A.js';
5
- export { ICON_CSS, createIconSvg, defineIcon, getIcon, listIcons, paintIcon, registerIcon } from './chunk-4NUKVNSJ.js';
6
- import { definePresence } from './chunk-NOQAM6ZS.js';
7
- export { definePresence, initialsOf, participantsFromAwareness } from './chunk-NOQAM6ZS.js';
8
- import { defineSmartArt } from './chunk-SDFQ7U2I.js';
9
- export { defineSmartArt, renderDiagramDrawing } from './chunk-SDFQ7U2I.js';
10
- export { CONTRACT_REVISION } from './chunk-D6EREKYF.js';
11
- export { COMPACT, FOCUS_RING, OFFICE_TOKENS, TOUCH, tok } from './chunk-MDW2Y5UN.js';
1
+ import { installOfficeUiTheme } from './chunk-F4TM7U4P.js';
2
+ export { THEME_CSS, THEME_STYLE_ID, installOfficeUiTheme } from './chunk-F4TM7U4P.js';
3
+ import { registerControls } from './chunk-ZBFAPBNU.js';
4
+ export { CONTROL_DEFINERS, DEFAULT_OFFICE_PROFILE, OFFICE_AVATAR_SWATCHES, OFFICE_PROFILE_STORAGE_KEY, OFFICE_TOAST_VISIBLE_LIMIT, attachKeyTips, clampOptionNumber, clearOfficeProfile, defineAccount, defineBackstage, defineButton, defineCheckbox, defineCommandSearch, defineContextMenu, defineDialog, defineDialogFooter, defineFindBar, defineMenuButton, defineMenuItem, defineMenuSeparator, defineOptionsDialog, definePasteOptions, definePrintPreview, defineRadio, defineReadOnlyBanner, defineRibbon, defineRibbonGroup, defineRibbonStack, defineRibbonToggle, defineRuler, defineSearchField, defineSelect, defineStatusBar, defineStatusItem, defineSwitch, defineTabStrip, defineToasts, defineToolbar, defineZoomSlider, profileInitials, readOfficeProfile, registerControls, rulerDivisions, sanitizeOfficeProfile, writeOfficeProfile } from './chunk-ZBFAPBNU.js';
5
+ export { ICON_CSS, createIconSvg, defineIcon, getIcon, listIcons, paintIcon, registerIcon } from './chunk-VUXNXH4Q.js';
6
+ import { definePresence } from './chunk-VYF7LGXZ.js';
7
+ export { definePresence, initialsOf, participantsFromAwareness } from './chunk-VYF7LGXZ.js';
8
+ import { defineSmartArt } from './chunk-A46H2JBV.js';
9
+ export { defineSmartArt, renderDiagramDrawing } from './chunk-A46H2JBV.js';
10
+ export { CONTRACT_REVISION } from './chunk-NDEB6EBU.js';
11
+ export { COMPACT, FOCUS_RING, OFFICE_TOKENS, TOUCH, tok } from './chunk-4MT4OIAJ.js';
12
12
 
13
13
  // src/index.ts
14
14
  var OFFICE_UI_TAGS = [
package/dist/presence.js CHANGED
@@ -1,3 +1,3 @@
1
- export { definePresence, initialsOf, participantsFromAwareness } from './chunk-NOQAM6ZS.js';
2
- import './chunk-D6EREKYF.js';
3
- import './chunk-MDW2Y5UN.js';
1
+ export { definePresence, initialsOf, participantsFromAwareness } from './chunk-VYF7LGXZ.js';
2
+ import './chunk-NDEB6EBU.js';
3
+ import './chunk-4MT4OIAJ.js';
package/dist/ribbon.d.ts CHANGED
@@ -1,7 +1,14 @@
1
1
  /**
2
- * Labelled group of ribbon commands: `role="group"`, `label` attribute is caption and name.
3
- * `launcher="<command>"` adds Office's corner dialog launcher, which emits `office-command`
4
- * `{ command }`; `launcher-disabled` disables it.
2
+ * Labelled group of ribbon commands: `role="group"`, `label` is the caption and name. `launcher`
3
+ * adds Office's corner dialog launcher (`launcher="<command>"` emits `office-command`
4
+ * `{ command }`; `launcher-label` names it; `launcher-disabled` disables it). For narrow windows
5
+ * an overflow controller sets `data-collapsed` (the group becomes one button showing `icon` and
6
+ * the label; activating it emits `office-ribbon-collapse-toggle`) and `data-open` (its commands
7
+ * open in a popup at `--office-ribbon-collapse-x/-y`). The group marks itself `data-compact-row`
8
+ * when every command is one line tall (they centre vertically) and `data-stack` when it holds only
9
+ * small drop-down galleries (`[mode="dropdown"]` without `data-command-large`), which stack in
10
+ * columns. Static `launcherEvent`/`collapseEvent` and `launcherDetail()` let a product subclass
11
+ * keep its published events.
5
12
  */
6
13
  export declare const defineRibbonGroup: import("./registry.js").Definer;
7
14
  /**
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Popup helpers of `office-ui-select`. Moved from pptx-viewer
3
+ * (`packages/shared/src/web-components/select-menu.ts`, `select-trigger.ts`).
4
+ */
5
+ /** Mutations that can change a select's value, labels or font preview. */
6
+ export declare const SELECT_OPTION_ATTRIBUTES: string[];
7
+ /** The flattened option data the popup renders. */
8
+ export interface SelectChoice {
9
+ value: string;
10
+ label: string;
11
+ disabled: boolean;
12
+ hidden: boolean;
13
+ group: string;
14
+ displayLabel?: string;
15
+ description?: string;
16
+ fontFamily?: string;
17
+ }
18
+ /** Flatten `<option>` children, keeping optgroup labels and disabled or hidden state. */
19
+ export declare function collectSelectChoices(options: HTMLOptionElement[]): SelectChoice[];
20
+ /** Build the popup's options (only while it is open or has been opened). */
21
+ export declare function renderSelectMenu(menu: HTMLElement, choices: SelectChoice[], value: string): void;
22
+ /**
23
+ * Prefer below the trigger, flipping above when that offers more room. Margins, the gap and the
24
+ * height cap come from `--office-space-2`, `--office-space-1` and `--office-select-max-height`
25
+ * (`--office-font-picker-max-height` for a font family picker).
26
+ */
27
+ export declare function positionSelectMenu(menu: HTMLElement, trigger: HTMLElement, host: HTMLElement): void;
28
+ /** Expose the keyboard target while keeping the selected state separate. */
29
+ export declare function markSelectActive(menu: HTMLElement, trigger: HTMLElement, active: number, open: boolean): void;
30
+ /** The next enabled, visible option when moving with the arrow keys (wrapping). */
31
+ export declare function nextSelectActive(choices: SelectChoice[], active: number, step: number): number;
32
+ /** Options a PageUp/PageDown press moves, like the visible rows of a native listbox. */
33
+ export declare const SELECT_PAGE_SIZE = 8;
34
+ /** Jump a page of options up (-1) or down (+1), clamped to the nearest enabled option. */
35
+ export declare function pageSelectActive(choices: SelectChoice[], active: number, direction: 1 | -1): number;
36
+ /** Trigger with an `icon` slot, the value text and a chevron. */
37
+ export declare function createSelectTrigger(doc: Document): {
38
+ trigger: HTMLButtonElement;
39
+ text: HTMLSpanElement;
40
+ };
41
+ /** Optional editable content (`slot="custom"`) stays in the light DOM so hosts own its events. */
42
+ export declare function prependSelectCustomSlot(host: HTMLElement, menu: HTMLElement): void;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * `office-ui-select` styles, moved from pptx-viewer (`select-styles.ts`, `select-ribbon-styles.ts`)
3
+ * and expressed in tokens. `variant="ribbon-font"` and `variant="ribbon-icon"` are the compact
4
+ * ribbon combo and icon picker; `data-font-picker="family"` widens and lengthens the popup.
5
+ */
6
+ export declare const SELECT_CSS: string;
package/dist/select.d.ts CHANGED
@@ -1,13 +1,19 @@
1
+ /** A programmatic choice; `<option>` elements satisfy the same shape. */
1
2
  export interface OfficeSelectOption {
2
3
  value: string;
3
4
  label: string;
4
5
  disabled?: boolean;
5
6
  }
6
7
  /**
7
- * Single-select dropdown. Properties: `options` (array), `value`, `disabled`, `selectedIndex`;
8
- * attributes `value`, `disabled`, `aria-label`. Trigger has `role="combobox"` and the popup is a
9
- * `listbox`. Keyboard: ArrowDown/Up (open, move), Home, End, Enter/Space (choose), Escape
10
- * (close), printable keys (typeahead); disabled options are skipped. `input` then `change`
11
- * bubble when the user picks; setting a property is silent.
8
+ * Single-select combobox. Moved from pptx-viewer `pptx-ui-select` (the declarative, most complete
9
+ * implementation). Choices come from `<option>` / `<optgroup>` children (with `data-display-label`,
10
+ * `data-description` and font previews through `style="font-family"`), or from the `options`
11
+ * property when there are none. `value`, `disabled`, `selectedIndex`, `aria-label`;
12
+ * `variant="ribbon-font"` (compact ribbon combo that accepts unlisted values, such as a typed font
13
+ * size) or `"ribbon-icon"`; `data-font-picker="family|size"`; an `icon` slot and a `custom` slot at
14
+ * the top of the popup. Keyboard: arrows, Home, End, PageUp/PageDown (8 options), typeahead,
15
+ * Enter/Space, Escape, Tab; disabled and hidden choices are skipped. The popup is a top-layer
16
+ * `popover`, flipped above the trigger when there is more room. `input` then `change` bubble on a
17
+ * user choice; setting a property is silent. Form-associated.
12
18
  */
13
19
  export declare const defineSelect: import("./registry.js").Definer;
package/dist/smartart.js CHANGED
@@ -1,3 +1,3 @@
1
- export { defineSmartArt, renderDiagramDrawing } from './chunk-SDFQ7U2I.js';
2
- import './chunk-D6EREKYF.js';
3
- import './chunk-MDW2Y5UN.js';
1
+ export { defineSmartArt, renderDiagramDrawing } from './chunk-A46H2JBV.js';
2
+ import './chunk-NDEB6EBU.js';
3
+ import './chunk-4MT4OIAJ.js';
package/dist/theme.js CHANGED
@@ -1,2 +1,2 @@
1
- export { THEME_CSS, THEME_STYLE_ID, installOfficeUiTheme } from './chunk-LI6OV55P.js';
2
- export { COMPACT, FOCUS_RING, OFFICE_TOKENS, TOUCH, tok } from './chunk-MDW2Y5UN.js';
1
+ export { THEME_CSS, THEME_STYLE_ID, installOfficeUiTheme } from './chunk-F4TM7U4P.js';
2
+ export { COMPACT, FOCUS_RING, OFFICE_TOKENS, TOUCH, tok } from './chunk-4MT4OIAJ.js';
package/dist/tokens.d.ts CHANGED
@@ -124,6 +124,28 @@ export declare const OFFICE_TOKENS: {
124
124
  readonly '--office-ribbon-tab-height': "35px";
125
125
  readonly '--office-ribbon-group-gap': "2px";
126
126
  readonly '--office-ribbon-group-height': "78px";
127
+ readonly '--office-ribbon-group-padding': "4px 8px 2px";
128
+ readonly '--office-ribbon-separator-inset': "0px";
129
+ readonly '--office-ribbon-separator': "color-mix(in srgb, var(--office-border, #d1d5db) 60%, transparent)";
130
+ readonly '--office-ribbon-caption-size': "10px";
131
+ readonly '--office-ribbon-caption-padding': "2px 0 0";
132
+ readonly '--office-launcher-inset-end': "-6px";
133
+ readonly '--office-launcher-inset-bottom': "-1px";
134
+ readonly '--office-ribbon-compact-row-max': "36px";
135
+ readonly '--office-ribbon-stack-max-height': "80px";
136
+ readonly '--office-ribbon-collapse-x': "8px";
137
+ readonly '--office-ribbon-collapse-y': "120px";
138
+ readonly '--office-command-icon-color': "currentColor";
139
+ readonly '--office-command-large-height': "66px";
140
+ readonly '--office-command-large-min-width': "48px";
141
+ readonly '--office-command-large-max-width': "80px";
142
+ readonly '--office-command-large-icon': "32px";
143
+ readonly '--office-command-small-icon': "16px";
144
+ readonly '--office-command-tall-height': "62px";
145
+ readonly '--office-command-tall-min-width': "40px";
146
+ readonly '--office-command-tall-icon': "30px";
147
+ readonly '--office-command-active': "color-mix(in srgb, var(--office-accent, #2563eb) 15%, transparent)";
148
+ readonly '--office-collapsed-group-min-width': "56px";
127
149
  readonly '--office-ribbon-caption-line-height': "12px";
128
150
  readonly '--office-ribbon-row-height': "22px";
129
151
  readonly '--office-ribbon-file-min-width': "52px";
@@ -162,6 +184,15 @@ export declare const OFFICE_TOKENS: {
162
184
  readonly '--office-search-popup-min-width': "240px";
163
185
  readonly '--office-search-popup-max-height': "320px";
164
186
  readonly '--office-select-max-height': "240px";
187
+ readonly '--office-select-background': "var(--office-background, #ffffff)";
188
+ readonly '--office-select-menu-min-width': "90px";
189
+ readonly '--office-select-option-active': "color-mix(in srgb, var(--office-accent, #2563eb) 20%, var(--office-popover, #ffffff))";
190
+ readonly '--office-select-ribbon-menu-width': "192px";
191
+ readonly '--office-font-picker-max-height': "320px";
192
+ readonly '--office-font-picker-width': "256px";
193
+ readonly '--office-chevron-size': "6px";
194
+ readonly '--office-ribbon-combo-height': "28px";
195
+ readonly '--office-ribbon-icon-select-width': "36px";
165
196
  readonly '--office-search-width': "320px";
166
197
  readonly '--office-print-preview-width': "420px";
167
198
  readonly '--office-find-max-width': "640px";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ooxml-ui",
3
- "version": "0.13.0",
3
+ "version": "0.15.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",