ooxml-ui 0.1.9 → 0.1.11

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 (2) hide show
  1. package/README.md +44 -7
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,20 +1,50 @@
1
1
  # ooxml-ui
2
2
 
3
- Shared, format-neutral web components and styles for the Office viewers (Word, PowerPoint, later
3
+ [![npm version](https://img.shields.io/npm/v/ooxml-ui.svg)](https://www.npmjs.com/package/ooxml-ui)
4
+ [![license](https://img.shields.io/npm/l/ooxml-ui.svg)](https://github.com/ChristopherVR/ooxml/blob/main/LICENSE)
5
+ [![types](https://img.shields.io/npm/types/ooxml-ui.svg)](https://www.npmjs.com/package/ooxml-ui)
6
+
7
+ > Shared Office controls, styles and custom elements for browser applications.
8
+
9
+ [Try the apps](https://christophervr.github.io/ooxml/) | [npm](https://www.npmjs.com/package/ooxml-ui) | [Full docs](https://christophervr.github.io/ooxml/) | [Source](https://github.com/ChristopherVR/ooxml)
10
+
11
+ Shared, format-neutral web components and styles for the Office viewers (Word, PowerPoint and
4
12
  Excel). Vanilla custom elements with shadow-root controls, typed events, no framework and no
5
13
  runtime dependency except `ooxml-core` (types and a few pure helpers).
6
14
 
7
15
  > **You do not install this package.** It is a regular `dependency` of every published editor
8
- > package (`docx-viewer-*`, `pptx-viewer-*`), so installing the editor of your framework pulls it
16
+ > package (`docx-*-viewer`, `pptx-*-viewer` and `xlsx-*-viewer`), so installing the editor of your framework pulls it
9
17
  > in. It is published separately only so that the editors share one copy of the controls. Do not
10
18
  > add it to your own install instructions or `package.json`; import controls through the editor
11
19
  > package, which registers them for you. Importing `ooxml-ui` directly is for
12
20
  > the viewer packages themselves and for people building their own Office-style UI.
13
21
 
14
- ## Entries (ESM only)
22
+ ## Install
23
+
24
+ Applications using a viewer receive this package as a dependency. For a custom
25
+ Office UI, install it directly:
26
+
27
+ ```bash
28
+ npm install ooxml-ui
29
+ ```
30
+
31
+ ## Quick start
15
32
 
16
- | Entry | Contents |
17
- | ----------------------------------- | --------------------------------------------------------------------------------------- |
33
+ ```js
34
+ import { registerOfficeUi } from 'ooxml-ui';
35
+
36
+ registerOfficeUi();
37
+ const button = document.createElement('office-ui-button');
38
+ button.setAttribute('label', 'Save');
39
+ button.setAttribute('command', 'save');
40
+ button.addEventListener('office-command', (event) => console.log(event.detail));
41
+ document.body.append(button);
42
+ ```
43
+
44
+ ## API: entries (ESM only)
45
+
46
+ | Entry | Contents |
47
+ | ------------------- | --------------------------------------------------------------------------------------- |
18
48
  | `ooxml-ui` | everything below plus `registerOfficeUi()` and `OFFICE_UI_TAGS` |
19
49
  | `ooxml-ui/theme` | `THEME_CSS`, `installOfficeUiTheme()` (tokens, dark mode, forced-colors, touch targets) |
20
50
  | `ooxml-ui/icons` | icon registry (`registerIcon`, `getIcon`, `listIcons`) and `<office-ui-icon>` |
@@ -26,7 +56,7 @@ Importing an entry never touches the DOM (SSR-safe). Elements are defined by the
26
56
  `register*` functions, which are idempotent, no-ops without a `window`, and refuse to coexist
27
57
  with an incompatible build of this package.
28
58
 
29
- ## Elements
59
+ ## Features: elements
30
60
 
31
61
  | Tag | Attributes / properties | Events (all bubble, composed) |
32
62
  | ---------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------- |
@@ -68,5 +98,12 @@ bun run build && bun run --cwd packages/ui build # core first: the declaration
68
98
  bun run --cwd packages/ui test:package
69
99
  ```
70
100
 
71
- Licensed under Apache-2.0. Several controls are derived from `pptx-viewer`; see
101
+ ## Documentation
102
+
103
+ [Core and UI source](https://github.com/ChristopherVR/ooxml) |
104
+ [Shared UI plan](https://github.com/ChristopherVR/ooxml/blob/main/docs/ooxml-ui-plan.md)
105
+
106
+ ## License
107
+
108
+ Apache-2.0. Several controls are derived from `pptx-viewer`; see
72
109
  `PROVENANCE.md` at the repository root.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ooxml-ui",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
4
  "description": "Shared, format-neutral web components and styles for the Office viewers (Word, PowerPoint, Excel)",
5
5
  "keywords": [
6
6
  "custom-elements",
@@ -70,7 +70,7 @@
70
70
  "test:package": "node scripts/package-smoke.mjs"
71
71
  },
72
72
  "dependencies": {
73
- "ooxml-core": "^0.10.0"
73
+ "ooxml-core": "^0.11.0"
74
74
  },
75
75
  "devDependencies": {
76
76
  "@types/jsdom": "^21.1.7",