@twip/web 0.0.0-canary-7dfb59b → 0.0.0-canary-1644e0a
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 +13 -0
- package/dist/commands.d.ts +9 -0
- package/dist/commands.js +1 -0
- package/dist/twip_wasm.wasm +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -32,6 +32,19 @@ await editor.destroy();
|
|
|
32
32
|
|
|
33
33
|
In Node, workers and tests, `HeadlessEditor.create()` gives the same API with no DOM.
|
|
34
34
|
|
|
35
|
+
## Your own field types
|
|
36
|
+
|
|
37
|
+
A field whose type isn't one of Word's reads as a bookmark reference, and with no result it shows "Error! Bookmark
|
|
38
|
+
not defined.", as in Word. Declare the types your application fills itself after each `open`:
|
|
39
|
+
|
|
40
|
+
```ts
|
|
41
|
+
await editor.commands.setApplicationFieldTypes({ types: ['CUSTOMVALUE', 'CUSTOMTEXT'] });
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Their fields then keep their results, show nothing when empty (their `setFieldLabels` label, else «first argument»,
|
|
45
|
+
in design mode) and are listed by `fieldsUpdateRequested` on `updateFields`, for `setFieldResults` to fill. Types
|
|
46
|
+
compare without case; each call replaces the list, and `[]` clears it. Setting it doesn't mark the document modified.
|
|
47
|
+
|
|
35
48
|
## Serving the engine's files yourself
|
|
36
49
|
|
|
37
50
|
The engine runs from files in the package's `dist/`: `worker.js`, `twip-wasm.js`, `twip_wasm.wasm`, and the
|
package/dist/commands.d.ts
CHANGED
|
@@ -508,6 +508,15 @@ export interface Commands {
|
|
|
508
508
|
setSubTemplateRules(options: {
|
|
509
509
|
rules: ReferenceRule[];
|
|
510
510
|
}): Promise<void>;
|
|
511
|
+
/**
|
|
512
|
+
* The application's own field types (a code's first word, compared without case), replacing those set before:
|
|
513
|
+
* their fields keep their results, show their labels in design mode ({@link Commands.setFieldLabels}, else
|
|
514
|
+
* «first argument»), are listed by `fieldsUpdateRequested` and are never read as bookmark references
|
|
515
|
+
* ("Error! Bookmark not defined."). `[]` clears them. Set it after each `open`, as the rules. View.
|
|
516
|
+
*/
|
|
517
|
+
setApplicationFieldTypes(options: {
|
|
518
|
+
types: string[];
|
|
519
|
+
}): Promise<void>;
|
|
511
520
|
/** Shows references' sub-template bodies in their place, or their fields (default: every reference). View. */
|
|
512
521
|
setSubTemplateView(options: {
|
|
513
522
|
ids?: ElementId[];
|
package/dist/commands.js
CHANGED
package/dist/twip_wasm.wasm
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twip/web",
|
|
3
|
-
"version": "0.0.0-canary-
|
|
3
|
+
"version": "0.0.0-canary-1644e0a",
|
|
4
4
|
"description": "The Twip DOCX editor for the browser and Node: a managed, framework-independent editor over the WebAssembly engine.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|