ooxml-ui 0.1.10 → 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.
- package/README.md +42 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,17 +1,47 @@
|
|
|
1
1
|
# ooxml-ui
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/ooxml-ui)
|
|
4
|
+
[](https://github.com/ChristopherVR/ooxml/blob/main/LICENSE)
|
|
5
|
+
[](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
|
|
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
|
-
##
|
|
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
|
|
32
|
+
|
|
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)
|
|
15
45
|
|
|
16
46
|
| Entry | Contents |
|
|
17
47
|
| ------------------- | --------------------------------------------------------------------------------------- |
|
|
@@ -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
|
-
##
|
|
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
|
-
|
|
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.
|