wordinweb 0.1.1 → 0.1.3
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/LICENSE +45 -118
- package/README.md +12 -21
- package/package.json +2 -2
package/LICENSE
CHANGED
|
@@ -1,137 +1,64 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
<https://polyformproject.org/licenses/noncommercial/1.0.0>
|
|
1
|
+
# WordInWeb Small Business License 1.0
|
|
4
2
|
|
|
5
3
|
Copyright (c) 2026 WordInWeb contributors
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
for permission.
|
|
10
|
-
|
|
11
|
-
## Acceptance
|
|
12
|
-
|
|
13
|
-
In order to get any license under these terms, you must agree
|
|
14
|
-
to them as both strict obligations and conditions to all
|
|
15
|
-
your licenses.
|
|
16
|
-
|
|
17
|
-
## Copyright License
|
|
18
|
-
|
|
19
|
-
The licensor grants you a copyright license for the
|
|
20
|
-
software to do everything you might do with the software
|
|
21
|
-
that would otherwise infringe the licensor's copyright
|
|
22
|
-
in it for any permitted purpose. However, you may
|
|
23
|
-
only distribute the software according to [Distribution
|
|
24
|
-
License](#distribution-license) and make changes or new works
|
|
25
|
-
based on the software according to [Changes and New Works
|
|
26
|
-
License](#changes-and-new-works-license).
|
|
27
|
-
|
|
28
|
-
## Distribution License
|
|
29
|
-
|
|
30
|
-
The licensor grants you an additional copyright license
|
|
31
|
-
to distribute copies of the software. Your license
|
|
32
|
-
to distribute covers distributing the software with
|
|
33
|
-
changes and new works permitted by [Changes and New Works
|
|
34
|
-
License](#changes-and-new-works-license).
|
|
35
|
-
|
|
36
|
-
## Notices
|
|
37
|
-
|
|
38
|
-
You must ensure that anyone who gets a copy of any part of
|
|
39
|
-
the software from you also gets a copy of these terms or the
|
|
40
|
-
URL for them above, as well as copies of any plain-text lines
|
|
41
|
-
beginning with `Required Notice:` that the licensor provided
|
|
42
|
-
with the software. For example:
|
|
43
|
-
|
|
44
|
-
> Required Notice: Copyright WordInWeb contributors.
|
|
45
|
-
|
|
46
|
-
## Changes and New Works License
|
|
47
|
-
|
|
48
|
-
The licensor grants you an additional copyright license to
|
|
49
|
-
make changes and new works based on the software for any
|
|
50
|
-
permitted purpose.
|
|
51
|
-
|
|
52
|
-
## Patent License
|
|
53
|
-
|
|
54
|
-
The licensor grants you a patent license for the software that
|
|
55
|
-
covers patent claims the licensor can license, or becomes able
|
|
56
|
-
to license, that you would infringe by using the software.
|
|
57
|
-
|
|
58
|
-
## Noncommercial Purposes
|
|
59
|
-
|
|
60
|
-
Any noncommercial purpose is a permitted purpose.
|
|
61
|
-
|
|
62
|
-
## Personal Uses
|
|
63
|
-
|
|
64
|
-
Personal use for research, experiment, and testing for
|
|
65
|
-
the benefit of public knowledge, personal study, private
|
|
66
|
-
entertainment, hobby projects, amateur pursuits, or religious
|
|
67
|
-
observance, without any anticipated commercial application,
|
|
68
|
-
is use for a permitted purpose.
|
|
69
|
-
|
|
70
|
-
## Noncommercial Organizations
|
|
71
|
-
|
|
72
|
-
Use by any charitable organization, educational institution,
|
|
73
|
-
public research organization, public safety or health
|
|
74
|
-
organization, environmental protection organization,
|
|
75
|
-
or government institution is use for a permitted purpose
|
|
76
|
-
regardless of the source of funding or obligations resulting
|
|
77
|
-
from the funding.
|
|
78
|
-
|
|
79
|
-
## Fair Use
|
|
5
|
+
This is a source-available license. It is not the MIT License and is not an
|
|
6
|
+
Open Source Initiative approved license.
|
|
80
7
|
|
|
81
|
-
|
|
82
|
-
law. These terms do not limit them.
|
|
8
|
+
## Eligible Users
|
|
83
9
|
|
|
84
|
-
|
|
10
|
+
You are eligible to use the Software under this license if you are:
|
|
85
11
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
12
|
+
1. an individual using the Software on your own behalf;
|
|
13
|
+
2. a nonprofit organization, educational institution, public research
|
|
14
|
+
organization, or government institution; or
|
|
15
|
+
3. a for-profit organization that, together with its Affiliates, has both:
|
|
16
|
+
- no more than 1,000,000 USD in Gross Revenue for its most recently
|
|
17
|
+
completed fiscal year; and
|
|
18
|
+
- no more than 2,000,000 USD in aggregate Funding Raised.
|
|
90
19
|
|
|
91
|
-
|
|
20
|
+
An individual using the Software on behalf of an organization is eligible only
|
|
21
|
+
if that organization is eligible.
|
|
92
22
|
|
|
93
|
-
|
|
94
|
-
contributes to infringement of any patent, your patent license
|
|
95
|
-
for the software granted under these terms ends immediately. If
|
|
96
|
-
your company makes such a claim, your patent license ends
|
|
97
|
-
immediately for work on behalf of your company.
|
|
23
|
+
## Permission
|
|
98
24
|
|
|
99
|
-
|
|
25
|
+
Subject to the eligibility requirements above, permission is hereby granted,
|
|
26
|
+
free of charge, to any person obtaining a copy of this software and associated
|
|
27
|
+
documentation files (the "Software"), to deal in the Software without
|
|
28
|
+
restriction, including without limitation the rights to use, copy, modify,
|
|
29
|
+
merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
|
30
|
+
to permit persons to whom the Software is furnished to do so, subject to the
|
|
31
|
+
following conditions:
|
|
100
32
|
|
|
101
|
-
The
|
|
102
|
-
|
|
103
|
-
not covered by your licenses, your licenses can nonetheless
|
|
104
|
-
continue if you come into full compliance with these terms,
|
|
105
|
-
and take practical steps to correct past violations, within
|
|
106
|
-
32 days of receiving notice. Otherwise, all your licenses
|
|
107
|
-
end immediately.
|
|
33
|
+
The above copyright notice and this permission notice shall be included in all
|
|
34
|
+
copies or substantial portions of the Software.
|
|
108
35
|
|
|
109
|
-
##
|
|
36
|
+
## Larger Companies
|
|
110
37
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
or nature of the software, under any kind of legal claim.***
|
|
38
|
+
A for-profit organization that exceeds either eligibility threshold is not
|
|
39
|
+
licensed under these terms. Use by such an organization requires a separate
|
|
40
|
+
commercial license from the copyright holder.
|
|
115
41
|
|
|
116
42
|
## Definitions
|
|
117
43
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
44
|
+
"Affiliate" means any entity that controls, is controlled by, or is under
|
|
45
|
+
common control with an organization. "Control" means the direct or indirect
|
|
46
|
+
power to direct an entity's management or policies, whether through ownership,
|
|
47
|
+
contract, or otherwise.
|
|
121
48
|
|
|
122
|
-
|
|
123
|
-
|
|
49
|
+
"Gross Revenue" means all revenue recognized before expenses, deductions, and
|
|
50
|
+
taxes.
|
|
124
51
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
or are under common control with that organization. **Control**
|
|
129
|
-
means ownership of substantially all the assets of an entity,
|
|
130
|
-
or the power to direct its management and policies by vote,
|
|
131
|
-
contract, or otherwise. Control can be direct or indirect.
|
|
52
|
+
"Funding Raised" means the aggregate gross proceeds received since formation
|
|
53
|
+
from external financing, including equity, debt, convertible instruments,
|
|
54
|
+
SAFEs, grants, and similar financing.
|
|
132
55
|
|
|
133
|
-
|
|
134
|
-
software under these terms.
|
|
56
|
+
## Disclaimer
|
|
135
57
|
|
|
136
|
-
|
|
137
|
-
|
|
58
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
59
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
60
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
61
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
62
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
63
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
64
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# WordInWeb
|
|
2
2
|
|
|
3
|
+
[**Live demo →**](https://wordinweb-parity.callerinfo.workers.dev/)
|
|
4
|
+
|
|
3
5
|
A Word/.docx viewer and editor for the web, embeddable as a single React component.
|
|
4
6
|
|
|
5
7
|
```tsx
|
|
@@ -12,7 +14,7 @@ Editing is in an Alpha state and is strictly opt-in via the `editable` flag; the
|
|
|
12
14
|
|
|
13
15
|
If you discover an edge case or perf issue create an issue and include the offending Word file.
|
|
14
16
|
|
|
15
|
-
Part of the broader roadmap is to migrate away from DOM rendering to
|
|
17
|
+
Part of the broader roadmap is to migrate away from DOM rendering to canvas rendering, or a hybrid of the two. Editing performance can suffer on very long documents.
|
|
16
18
|
|
|
17
19
|
---
|
|
18
20
|
|
|
@@ -83,7 +85,9 @@ export function Editor() {
|
|
|
83
85
|
| Prop | Type | Default | What it does |
|
|
84
86
|
| --- | --- | --- | --- |
|
|
85
87
|
| `source` | `ArrayBuffer \| Uint8Array \| Blob \| string` | — | The document: raw bytes, a `File`/`Blob`, or a URL to fetch. |
|
|
86
|
-
| `zoom` | `number` | `1` |
|
|
88
|
+
| `zoom` | `number` | `1` | Maximum zoom factor (`1` = 100%). |
|
|
89
|
+
| `fitWidth` | `boolean` | `true` | Scale wide pages down to fit the viewer without horizontal scrolling. Never enlarges beyond `zoom`. |
|
|
90
|
+
| `narrowWidth` | `number` | `820` | Container width in pixels where comments switch to the compact treatment. |
|
|
87
91
|
| `editable` | `boolean` | `false` | Enable editing (selection formatting, typing, save-back). Off = pure viewer. |
|
|
88
92
|
| `showComments` | `boolean` | `true` | Render review comments (range highlights + margin balloons). |
|
|
89
93
|
| `revisions` | `"final" \| "markup"` | `"final"` | Tracked-changes display: clean final text, or insertions underlined / deletions struck. |
|
|
@@ -129,6 +133,7 @@ The object passed to `onReady`. Every command operates on the current selection
|
|
|
129
133
|
**Suggesting mode (tracked changes)**
|
|
130
134
|
- `setSuggesting(on, author?)` — when on, edits record as OOXML `w:ins`/`w:del` instead of mutating text directly, and the view switches to markup.
|
|
131
135
|
- `isSuggesting()`, `acceptRevisionAtCaret()`, `rejectRevisionAtCaret()`.
|
|
136
|
+
- `revisionCount()`, `acceptAllRevisions()`, `rejectAllRevisions()`.
|
|
132
137
|
|
|
133
138
|
**Find & replace**
|
|
134
139
|
- `find(query, { matchCase? })` → match count (selects the first).
|
|
@@ -214,8 +219,6 @@ Or in a stylesheet:
|
|
|
214
219
|
|
|
215
220
|
WordInWeb never converts the document to flowing HTML. It parses the OOXML into a typed model, runs a layout engine that breaks lines with real canvas metrics and paginates like Word, and renders each primitive as one absolutely-positioned element, so the browser does zero reflow. Editing mutates the retained XML tree and re-serializes only the parts it models, leaving everything else byte-for-byte intact.
|
|
216
221
|
|
|
217
|
-
See [`BLOG.md`](BLOG.md) for the pipeline and the parity work.
|
|
218
|
-
|
|
219
222
|
## Fonts
|
|
220
223
|
|
|
221
224
|
Text is measured on a canvas before layout, so line breaks depend on the real font metrics. For Word parity, register the bundled OFL substitutes in your app entry:
|
|
@@ -229,14 +232,6 @@ import "@fontsource/caladea/400.css"; // Cambria metrics
|
|
|
229
232
|
import "@fontsource/caladea/700.css";
|
|
230
233
|
```
|
|
231
234
|
|
|
232
|
-
> **The Microsoft fonts in the separate parity demo are demo-only assets.** They
|
|
233
|
-
> are included to reproduce this project's experimental parity results, but
|
|
234
|
-
> they are not part of the WordInWeb library and should not be copied into
|
|
235
|
-
> another application.
|
|
236
|
-
> Applications using WordInWeb must source and license their own fonts. Without
|
|
237
|
-
> the same fonts, the viewer falls back to substitutes and glyphs or line breaks
|
|
238
|
-
> may differ from Word.
|
|
239
|
-
|
|
240
235
|
For your own application, source your own fonts.
|
|
241
236
|
|
|
242
237
|
```css
|
|
@@ -253,14 +248,6 @@ Add a separate `@font-face` rule for every weight and style you use.
|
|
|
253
248
|
|
|
254
249
|
When the browser can't render a requested face, `onMissingFonts` reports it so you can warn the user that the on-screen layout may drift from Word.
|
|
255
250
|
|
|
256
|
-
## Package structure
|
|
257
|
-
|
|
258
|
-
The repository keeps the parser and layout engine in an internal `core` workspace for development. The published `wordinweb` package bundles that workspace with the React components, so applications install one package.
|
|
259
|
-
|
|
260
|
-
The demo, browser tests, fixture corpus, and Word parity references live in the
|
|
261
|
-
separate [wordinweb-parity](https://github.com/theRealestAEP/wordinweb-parity)
|
|
262
|
-
repository. That repository links this one as a Git submodule.
|
|
263
|
-
|
|
264
251
|
## Development
|
|
265
252
|
|
|
266
253
|
```bash
|
|
@@ -278,4 +265,8 @@ and compared page-by-page. The test corpus and instructions are in
|
|
|
278
265
|
|
|
279
266
|
## License
|
|
280
267
|
|
|
281
|
-
|
|
268
|
+
WordInWeb Small Business License 1.0 — MIT-style permissions for individuals,
|
|
269
|
+
nonprofits, educational and public-research organizations, governments, and
|
|
270
|
+
companies with no more than $1 million in annual revenue and $2 million in
|
|
271
|
+
total funding. Larger companies require a separate commercial license. See
|
|
272
|
+
`LICENSE`.
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wordinweb",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "React component for high-fidelity DOCX viewing",
|
|
5
|
-
"license": "
|
|
5
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git+https://github.com/theRealestAEP/wordinweb.git",
|