@wae/open-word 0.0.0-stage → 0.0.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.
@@ -0,0 +1,521 @@
1
+ /**
2
+ * Authoring types of `@wae/open-word`.
3
+ *
4
+ * This is the declared shape of the authoring surface: `new OpenWord(options?)`
5
+ * creates a session, `create`/`open` return an opened `Document`, and every
6
+ * summary and report is addressed by a stable identity plus a revision.
7
+ *
8
+ * Geometry and layout in the authoring surface are points. The engine stores
9
+ * twips internally; screen pixels never enter the model.
10
+ */
11
+ import type { DocumentFormat, DocumentIntent } from './formats.js';
12
+ /** Hard limits applied before work starts. */
13
+ export interface ResourceBudgets {
14
+ readonly maxDocumentBytes?: number;
15
+ readonly maxAssetBytes?: number;
16
+ readonly maxParagraphs?: number;
17
+ }
18
+ /** Structured diagnostic emitted during import, inspection or export. */
19
+ export interface DocumentDiagnostic {
20
+ readonly code: string;
21
+ readonly severity: 'info' | 'warning' | 'error';
22
+ readonly documentId?: string;
23
+ readonly objectId?: string;
24
+ readonly recoverable: boolean;
25
+ readonly message: string;
26
+ }
27
+ /** Session options. Constructing a session opens no window, file or socket. */
28
+ export interface OpenWordOptions {
29
+ /** BCP-47 tag used for diagnostics and default copy. Defaults to `en`. */
30
+ readonly locale?: string;
31
+ readonly budgets?: ResourceBudgets;
32
+ readonly diagnostics?: (event: DocumentDiagnostic) => void;
33
+ }
34
+ /** Disclosure level. `partial` always ships a loss path and diagnostic codes. */
35
+ export type SupportLevel = 'supported' | 'partial' | 'unsupported';
36
+ /** Inspection rules understood by `inspect()`. */
37
+ export type InspectCheck = 'styles' | 'fonts' | 'images' | 'sections' | 'tables' | 'links';
38
+ /** Per-document render targets. */
39
+ export type RenderFormat = 'svg' | 'png' | 'pdf';
40
+ /**
41
+ * Targets `export()` can write.
42
+ *
43
+ * `.docx` and `.dotx` share one OOXML package writer and differ only in content
44
+ * type and template semantics; `.html`, `.md`, `.txt` and `.rtf` are lossy text
45
+ * projections. RTF export is `partial`: tables degrade to tab-separated rows
46
+ * and pictures and link destinations are dropped with `export.rtf.*` losses.
47
+ */
48
+ export type ExportFormat = 'docx' | 'dotx' | 'pdf' | 'html' | 'md' | 'txt' | 'rtf';
49
+ /** What the installed engine can do, per format and per capability. */
50
+ export interface FormatCapability {
51
+ readonly import: SupportLevel;
52
+ readonly edit: SupportLevel;
53
+ readonly export: SupportLevel;
54
+ /** Loss codes a `partial` route can report, such as `import.rtf.table`. */
55
+ readonly lossCodes?: readonly string[];
56
+ }
57
+ /** Result of `OpenWord.capabilities()`. Read this instead of assuming a method works. */
58
+ export interface DocumentCapabilities {
59
+ readonly engine: {
60
+ readonly package: string;
61
+ readonly version: string;
62
+ };
63
+ /** The native project container; `unsupported` means nothing can be saved yet. */
64
+ readonly project: SupportLevel;
65
+ readonly formats: Readonly<Record<DocumentFormat, FormatCapability>>;
66
+ readonly checks: Readonly<Record<InspectCheck, SupportLevel>>;
67
+ readonly renderers: Readonly<Record<RenderFormat, SupportLevel>>;
68
+ readonly exportTargets: Readonly<Record<ExportFormat, SupportLevel>>;
69
+ }
70
+ /** Options of `OpenWord.create()`. */
71
+ export interface DocumentCreateInput {
72
+ readonly title?: string;
73
+ /** Document file to start from; its blocks become the new document. */
74
+ readonly template?: string;
75
+ readonly author?: string;
76
+ }
77
+ /**
78
+ * Input of `OpenWord.open()`.
79
+ *
80
+ * A path is mandatory, so the engine never guesses whether a string is a file
81
+ * name or serialized content. `intent` defaults to `edit`.
82
+ */
83
+ export interface DocumentOpenInput {
84
+ readonly path: string;
85
+ readonly intent?: DocumentIntent;
86
+ }
87
+ /** One section (page block) of a document summary. */
88
+ export interface DocumentSummarySection {
89
+ readonly index: number;
90
+ readonly id: string;
91
+ readonly title: string | null;
92
+ }
93
+ /** One paragraph of a document summary. */
94
+ export interface DocumentSummaryParagraph {
95
+ readonly index: number;
96
+ readonly sectionIndex: number;
97
+ /** Resolved paragraph style name, or `null` when the engine has none. */
98
+ readonly style: string | null;
99
+ readonly text: string;
100
+ }
101
+ /** One table of a document summary. */
102
+ export interface DocumentSummaryTable {
103
+ readonly index: number;
104
+ readonly sectionIndex: number;
105
+ readonly rows: number;
106
+ readonly columns: number;
107
+ }
108
+ /** Summary of one document at its committed revision. */
109
+ export interface DocumentSummary {
110
+ readonly id: string;
111
+ readonly revision: number;
112
+ readonly title: string | null;
113
+ readonly sections: readonly DocumentSummarySection[];
114
+ readonly paragraphs: readonly DocumentSummaryParagraph[];
115
+ readonly tables: readonly DocumentSummaryTable[];
116
+ }
117
+ /** An opened document at its committed revision. */
118
+ export type Document = DocumentSummary;
119
+ /** One heading in the nested document outline. */
120
+ export interface OutlineItem {
121
+ /** Stable section address: `section-N`. */
122
+ readonly id: string;
123
+ /** Heading level, 1 through 6. */
124
+ readonly level: number;
125
+ /** Heading plain text, or `null` when the heading is empty. */
126
+ readonly title: string | null;
127
+ /** Depth-first position of the section block in document order. */
128
+ readonly blockIndex: number;
129
+ /** Headings nested under this one, in document order. */
130
+ readonly children: readonly OutlineItem[];
131
+ }
132
+ /**
133
+ * Nested heading outline of one document at its committed revision.
134
+ *
135
+ * Every section appears exactly once, nested under the closest preceding
136
+ * heading with a lower level, so a caller can render a table of contents or
137
+ * address a heading without walking the summary.
138
+ */
139
+ export interface DocumentOutline {
140
+ readonly revision: number;
141
+ readonly items: readonly OutlineItem[];
142
+ }
143
+ /** Counts of one document at its committed revision. */
144
+ export interface StatsReport {
145
+ readonly revision: number;
146
+ /** Every reachable block node, in document order. */
147
+ readonly blocks: number;
148
+ /** Paragraph blocks, including table cell paragraphs. */
149
+ readonly paragraphs: number;
150
+ /** Heading count per section level, such as `{ "1": 2 }`. */
151
+ readonly headings: Readonly<Record<string, number>>;
152
+ readonly tables: number;
153
+ /** Rows across every table's header, body and footer bands. */
154
+ readonly tableRows: number;
155
+ /** Whitespace-separated words in titles, paragraphs, list items, code blocks and cells. */
156
+ readonly words: number;
157
+ readonly characters: number;
158
+ readonly charactersWithoutWhitespace: number;
159
+ /** `words / 200`, rounded up. */
160
+ readonly readingMinutes: number;
161
+ }
162
+ /** Options of `OpenWord.inspect()`. */
163
+ export interface InspectOptions {
164
+ readonly checks?: readonly InspectCheck[];
165
+ }
166
+ /** One finding of an inspection run. */
167
+ export interface InspectIssue {
168
+ readonly code: string;
169
+ readonly severity: 'info' | 'warning' | 'error';
170
+ readonly revision: number;
171
+ readonly sectionId?: string;
172
+ readonly objectId?: string;
173
+ readonly recoverable: boolean;
174
+ readonly message: string;
175
+ }
176
+ /** Result of `inspect()`. Structure and rules only, never an aesthetic score. */
177
+ export interface InspectReport {
178
+ readonly revision: number;
179
+ readonly checkerVersion: string;
180
+ readonly passed: boolean;
181
+ readonly issues: readonly InspectIssue[];
182
+ }
183
+ /** Result of writing a native project. */
184
+ export interface SaveReport {
185
+ readonly path: string;
186
+ readonly revision: number;
187
+ readonly bytes: number;
188
+ }
189
+ /** Options of `OpenWord.save()`. */
190
+ export interface SaveOptions {
191
+ /** Replace the target file when it already exists. Defaults to `false`. */
192
+ readonly overwrite?: boolean;
193
+ }
194
+ /**
195
+ * Deep-copies one block and everything nested under it.
196
+ *
197
+ * Every copied block gets a fresh node id, inline content and structure are kept
198
+ * verbatim, and the copy is inserted directly after the source inside the same
199
+ * container (section/quote children, list item children, table cell children, or
200
+ * the top level when the source is a top-level block). Asset references are
201
+ * shared, never re-registered.
202
+ */
203
+ export interface BlockDuplicateOperation {
204
+ readonly type: 'block.duplicate';
205
+ /** Source block address: `section-N` or `node-N`. */
206
+ readonly id: string;
207
+ }
208
+ /**
209
+ * One atomic edit. Operations are validated as a whole before the first
210
+ * mutation, so a rejected batch never leaves a half-applied revision.
211
+ */
212
+ export type EditOperation = {
213
+ readonly type: 'paragraph.append';
214
+ readonly text: string;
215
+ } | {
216
+ readonly type: 'heading.append';
217
+ readonly level: number;
218
+ readonly text: string;
219
+ } | {
220
+ /** Changes the level of an existing heading without moving or retitling it. */
221
+ readonly type: 'heading.setLevel';
222
+ /** Heading address such as `section-3`. */
223
+ readonly id: string;
224
+ /** New level, `1..6`. */
225
+ readonly level: number;
226
+ } | {
227
+ /** Replaces the title of an existing heading, keeping its level and children. */
228
+ readonly type: 'heading.setText';
229
+ /** Heading address such as `section-3`. */
230
+ readonly id: string;
231
+ /** New title, stored as one plain text run. */
232
+ readonly text: string;
233
+ } | {
234
+ readonly type: 'list.append';
235
+ readonly ordered?: boolean;
236
+ readonly items: readonly string[];
237
+ /** First number of an ordered list. Defaults to 1; invalid for unordered lists. */
238
+ readonly start?: number;
239
+ } | {
240
+ /** Switches an existing list between bullets and numbers, keeping its items. */
241
+ readonly type: 'list.setOrdered';
242
+ /** List address such as `node-4`. */
243
+ readonly id: string;
244
+ /** `true` renders numbers, `false` renders bullets. */
245
+ readonly ordered: boolean;
246
+ } | {
247
+ readonly type: 'taskList.append';
248
+ /** A string item is unchecked; an object may set `checked`. */
249
+ readonly items: readonly (string | {
250
+ readonly text: string;
251
+ readonly checked?: boolean;
252
+ })[];
253
+ } | {
254
+ readonly type: 'quote.append';
255
+ readonly text: string;
256
+ } | {
257
+ readonly type: 'code.append';
258
+ readonly text: string;
259
+ readonly language?: string;
260
+ } | {
261
+ /** Changes the language tag of an existing code block, keeping its source text. */
262
+ readonly type: 'code.setLanguage';
263
+ /** Code block address such as `node-5`. */
264
+ readonly id: string;
265
+ /** New tag; omit or use an empty string to clear it. */
266
+ readonly language?: string;
267
+ } | {
268
+ readonly type: 'table.append';
269
+ readonly rows: readonly (readonly string[])[];
270
+ } | {
271
+ readonly type: 'table.setCaption';
272
+ /** Zero-based table index in document order. */
273
+ readonly table: number;
274
+ /** New caption. Omit or `null` to clear the caption. */
275
+ readonly caption?: string | null;
276
+ } | {
277
+ readonly type: 'metadata.set';
278
+ readonly title?: string;
279
+ readonly author?: string;
280
+ } | {
281
+ readonly type: 'document.replaceText';
282
+ readonly find: string;
283
+ readonly replace: string;
284
+ /** Match case exactly. Defaults to `true`. */
285
+ readonly caseSensitive?: boolean;
286
+ /** Replace only matches with no word character on either side. Defaults to `false`. */
287
+ readonly wholeWord?: boolean;
288
+ /** Treat `find` as a regular expression; `$1` and `$name` expand capture groups. */
289
+ readonly regex?: boolean;
290
+ readonly limit?: number;
291
+ } | {
292
+ readonly type: 'block.remove';
293
+ readonly id: string;
294
+ } | {
295
+ readonly type: 'paragraph.insert';
296
+ readonly index: number;
297
+ readonly text: string;
298
+ } | {
299
+ readonly type: 'table.setCell';
300
+ readonly table: number;
301
+ readonly row: number;
302
+ readonly column: number;
303
+ readonly text: string;
304
+ } | {
305
+ readonly type: 'table.insertRow';
306
+ readonly table: number;
307
+ readonly row: number;
308
+ readonly cells?: readonly string[];
309
+ } | {
310
+ readonly type: 'table.deleteRow';
311
+ readonly table: number;
312
+ readonly row: number;
313
+ } | {
314
+ readonly type: 'table.insertColumn';
315
+ readonly table: number;
316
+ readonly column: number;
317
+ readonly cells?: readonly string[];
318
+ } | {
319
+ readonly type: 'table.deleteColumn';
320
+ readonly table: number;
321
+ readonly column: number;
322
+ } | {
323
+ readonly type: 'paragraph.update';
324
+ readonly id?: string;
325
+ readonly index?: number;
326
+ readonly text: string;
327
+ } | {
328
+ readonly type: 'block.move';
329
+ readonly id: string;
330
+ readonly index: number;
331
+ } | BlockDuplicateOperation | {
332
+ readonly type: 'template.fill';
333
+ readonly values: Readonly<Record<string, string | number | boolean>>;
334
+ };
335
+ /** Options of `OpenWord.edit()`. */
336
+ export interface EditOptions {
337
+ /** Reject the batch when the document is not at this revision. */
338
+ readonly expectedRevision?: number;
339
+ }
340
+ /** Batch submitted to the engine. */
341
+ export interface EditRequest extends EditOptions {
342
+ readonly operations: readonly EditOperation[];
343
+ }
344
+ /** Outcome of one applied edit operation. */
345
+ export interface EditOperationResult {
346
+ /** Operation that produced this report. */
347
+ readonly type: string;
348
+ /** Replaced occurrences of `document.replaceText`. */
349
+ readonly replaced?: number;
350
+ /** Blocks physically removed by `block.remove`. */
351
+ readonly removed?: number;
352
+ /** Address of the block an operation inserted or updated. */
353
+ readonly id?: string;
354
+ /** Address of the fresh block `block.duplicate` created. */
355
+ readonly newId?: string;
356
+ /** Depth-first position the block an operation created now holds. */
357
+ readonly index?: number;
358
+ /** List items created by `list.append` or `taskList.append`. */
359
+ readonly items?: number;
360
+ /** Checked items created by `taskList.append`. */
361
+ readonly checked?: number;
362
+ /** Whether the list appended by `list.append` is ordered. */
363
+ readonly ordered?: boolean;
364
+ /** First number requested by `list.append`; `null` when none was given or the list is unordered. */
365
+ readonly start?: number | null;
366
+ /** Language tag of the code block appended by `code.append`; `null` when none was given. */
367
+ readonly language?: string | null;
368
+ /** Table index addressed by a table operation. */
369
+ readonly table?: number;
370
+ /** Row index addressed by a row operation. */
371
+ readonly row?: number;
372
+ /** Grid column index addressed by a column operation. */
373
+ readonly column?: number;
374
+ /** Caption set or cleared by `table.setCaption`; `null` when cleared. */
375
+ readonly caption?: string | null;
376
+ /** Level applied by `heading.setLevel`. */
377
+ readonly level?: number;
378
+ /** Title applied by `heading.setText`. */
379
+ readonly text?: string;
380
+ }
381
+ /** Result of one edit batch. */
382
+ export interface EditReport {
383
+ readonly document: DocumentSummary;
384
+ readonly revision: number;
385
+ readonly results: readonly EditOperationResult[];
386
+ }
387
+ /** Options of `OpenWord.find()`. */
388
+ export interface FindOptions {
389
+ /** Maximum number of hits to return. Defaults to 100. */
390
+ readonly limit?: number;
391
+ }
392
+ /** One text match inside a block's plain text. */
393
+ export interface FindHit {
394
+ /** Stable block address: `section-N` for sections, `node-N` otherwise. */
395
+ readonly blockId: string;
396
+ /** Depth-first position of the block in document order. */
397
+ readonly blockIndex: number;
398
+ /** Nearest enclosing section id, or `null` at top level. */
399
+ readonly path: string | null;
400
+ /** Character offset of the match start inside the block text. */
401
+ readonly start: number;
402
+ /** Character offset of the match end inside the block text. */
403
+ readonly end: number;
404
+ /** Matched text. */
405
+ readonly text: string;
406
+ }
407
+ /** Options of `OpenWord.replace()`. */
408
+ export interface ReplaceOptions {
409
+ /** Match case exactly. Defaults to `true`. */
410
+ readonly caseSensitive?: boolean;
411
+ /** Replace only matches with no word character on either side. Defaults to `false`. */
412
+ readonly wholeWord?: boolean;
413
+ /**
414
+ * Treat `find` as a regular expression. Capture groups are expanded in the
415
+ * replacement as `$1` or `$name`; `wholeWord` cannot be combined with it.
416
+ */
417
+ readonly regex?: boolean;
418
+ /** Maximum number of replacements across the whole document. */
419
+ readonly limit?: number;
420
+ /** Reject the pass when the document is not at this revision. */
421
+ readonly expectedRevision?: number;
422
+ }
423
+ /** Request of `OpenWord.replace()`. */
424
+ export interface ReplaceRequest extends ReplaceOptions {
425
+ /** Text to find. Must be non-empty. */
426
+ readonly find: string;
427
+ /** Replacement text. An empty string deletes every match. */
428
+ readonly replace: string;
429
+ }
430
+ /** One block a replacement pass changed. */
431
+ export interface ReplaceAffectedBlock {
432
+ /** Stable block address: `section-N` for sections, `node-N` otherwise. */
433
+ readonly blockId: string;
434
+ /** Depth-first position of the block in document order. */
435
+ readonly blockIndex: number;
436
+ /** Occurrences replaced inside this block. */
437
+ readonly replaced: number;
438
+ }
439
+ /** Result of one replacement pass. A pass without matches changes nothing. */
440
+ export interface ReplaceReport {
441
+ /** Committed summary after the pass. */
442
+ readonly document: DocumentSummary;
443
+ /** Revision after the pass. */
444
+ readonly revision: number;
445
+ /** Total occurrences replaced. */
446
+ readonly replaced: number;
447
+ /** Blocks that changed, in document order. */
448
+ readonly affected: readonly ReplaceAffectedBlock[];
449
+ }
450
+ /** One thing an import could not keep. */
451
+ export interface ImportLoss {
452
+ readonly code: string;
453
+ readonly severity: 'warning' | 'error';
454
+ readonly message: string;
455
+ }
456
+ /** Import completeness of one opened document. */
457
+ export interface ImportReport {
458
+ /** False when the importer recorded at least one loss. */
459
+ readonly complete: boolean;
460
+ readonly losses: readonly ImportLoss[];
461
+ }
462
+ /** One thing a projection could not keep. */
463
+ export interface ExportLoss {
464
+ readonly code: string;
465
+ readonly severity: 'warning' | 'error';
466
+ readonly sectionId?: string;
467
+ readonly objectId?: string;
468
+ readonly message: string;
469
+ }
470
+ /** Result of `export()`. Reports what the target actually kept. */
471
+ export interface ExportReport {
472
+ readonly revision: number;
473
+ readonly format: ExportFormat;
474
+ readonly target: string;
475
+ readonly losses: readonly ExportLoss[];
476
+ /** False for projections such as PDF that cannot be reopened for editing. */
477
+ readonly editable: boolean;
478
+ }
479
+ /**
480
+ * Result of `OpenWord.undo()`.
481
+ *
482
+ * History is process-local: it lives on the open handle and is never written to
483
+ * a `.oword` container.
484
+ */
485
+ export interface UndoResult {
486
+ readonly document: DocumentSummary;
487
+ readonly revision: number;
488
+ /** Number of mutations restored. */
489
+ readonly undone: number;
490
+ /** Whether at least one undone mutation can be replayed. */
491
+ readonly redoAvailable: boolean;
492
+ }
493
+ /** Result of `OpenWord.redo()`. */
494
+ export interface RedoResult {
495
+ readonly document: DocumentSummary;
496
+ readonly revision: number;
497
+ /** Number of undone mutations replayed. */
498
+ readonly redone: number;
499
+ /** Whether at least one mutation can still be undone. */
500
+ readonly undoAvailable: boolean;
501
+ }
502
+ /** Options of `OpenWord.merge()`. */
503
+ export interface MergeOptions {
504
+ /** Only `append` is supported today. */
505
+ readonly mode?: 'append';
506
+ }
507
+ /**
508
+ * Result of `OpenWord.merge()`.
509
+ *
510
+ * The donor document is opened through the same routing as `open()`; its blocks
511
+ * are deep-copied to the end of the receiver with fresh node ids.
512
+ */
513
+ export interface MergeResult {
514
+ /** Number of block nodes appended, including nested children. */
515
+ readonly blocksAdded: number;
516
+ /** Committed summary after the merge. */
517
+ readonly summary: DocumentSummary;
518
+ readonly revision: number;
519
+ /** Import losses carried by the merged document, plus the receiver's own. */
520
+ readonly losses: readonly ImportLoss[];
521
+ }
package/dist/types.js ADDED
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Authoring types of `@wae/open-word`.
3
+ *
4
+ * This is the declared shape of the authoring surface: `new OpenWord(options?)`
5
+ * creates a session, `create`/`open` return an opened `Document`, and every
6
+ * summary and report is addressed by a stable identity plus a revision.
7
+ *
8
+ * Geometry and layout in the authoring surface are points. The engine stores
9
+ * twips internally; screen pixels never enter the model.
10
+ */
11
+ export {};
@@ -0,0 +1,55 @@
1
+ {
2
+ "cli": {
3
+ "intro": "OpenWord — create, inspect and export documents on one native model.",
4
+ "cmd": {
5
+ "capabilities": "Print what this build supports, honestly",
6
+ "create": "Create a document and save it to a project file",
7
+ "open": "Open a document and print its committed revision and structure",
8
+ "save": "Save an open document to a project file",
9
+ "inspect": "Run structure and style checks on a document",
10
+ "find": "Search a document and print match positions",
11
+ "stats": "Print block, heading, table, word and reading-time counts",
12
+ "outline": "Print the nested heading outline with levels and block positions",
13
+ "edit": "Apply atomic edits and print the new revision",
14
+ "replace": "Replace text in a document and print the replacement count",
15
+ "template": "Fill {{key}} placeholders from a JSON object and save the result",
16
+ "undo": "Undo recent edits in a document (saved back only for .oword)",
17
+ "redo": "Redo undone edits in a document (saved back only for .oword)",
18
+ "merge": "Append another document's blocks to a document",
19
+ "export": "Write one export target from a document",
20
+ "gui": "Open the OpenWord Studio window"
21
+ },
22
+ "opt": {
23
+ "out": "File to write",
24
+ "title": "Document title",
25
+ "template": "Template file to start from",
26
+ "overwrite": "Replace the output file when it already exists",
27
+ "checks": "Comma-separated checks: styles, fonts, images, sections, tables, links",
28
+ "format": "Export target: docx, dotx, pdf, html, md, txt or rtf",
29
+ "paragraph": "Append a paragraph with this text",
30
+ "heading": "Append a section heading with this text",
31
+ "headingId": "Re-level an existing heading by address, such as section-3",
32
+ "level": "Heading level between 1 and 6",
33
+ "bullet": "Append an unordered list item (repeat the option to add more)",
34
+ "numbered": "Append an ordered list item (repeat the option to add more)",
35
+ "task": "Append an unchecked task item (repeat the option to add more)",
36
+ "taskDone": "Append a checked task item (repeat the option to add more)",
37
+ "numberedStart": "First number of the appended ordered list (default 1)",
38
+ "quote": "Append a block quote with this text",
39
+ "code": "Append a fenced code block with this text",
40
+ "codeLang": "Language tag for the code block, such as rust",
41
+ "table": "Append a table from a JSON array of string rows",
42
+ "duplicateBlock": "Deep-copy a block and its children, inserting the copy right after it by block id such as node-3",
43
+ "author": "Document author",
44
+ "expectedRevision": "Reject the edit unless the document is at this revision",
45
+ "limit": "Maximum number of matches to return",
46
+ "steps": "Number of edits to undo or redo (default 1)",
47
+ "find": "Text to search for",
48
+ "with": "Replacement text",
49
+ "ignoreCase": "Match text without regard to case",
50
+ "wholeWord": "Replace only matches with no word character on either side",
51
+ "regex": "Treat --find as a regular expression and expand $1 or $name in --with",
52
+ "values": "JSON object of placeholder values, such as {\"name\":\"Ada\"}"
53
+ }
54
+ }
55
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "defaultLocale": "en-US",
3
+ "locales": [
4
+ { "id": "en-US", "label": "English" }
5
+ ],
6
+ "fallback": {}
7
+ }
package/package.json CHANGED
@@ -1,6 +1,59 @@
1
1
  {
2
+ "bin": {
3
+ "open-word": "./dist/cli.js"
4
+ },
5
+ "dependencies": {
6
+ "@wae/commander": "0.0.7"
7
+ },
8
+ "description": "Document authoring on one model: create, inspect and export Word-compatible documents",
9
+ "devDependencies": {
10
+ "@types/node": "^22.20.4",
11
+ "typescript": "^5.9.2"
12
+ },
13
+ "engines": {
14
+ "node": ">=18"
15
+ },
16
+ "exports": {
17
+ ".": {
18
+ "import": "./dist/index.js",
19
+ "types": "./dist/index.d.ts"
20
+ }
21
+ },
22
+ "files": [
23
+ "dist",
24
+ "locales"
25
+ ],
26
+ "keywords": [
27
+ "docx",
28
+ "word",
29
+ "document",
30
+ "template",
31
+ "wae"
32
+ ],
33
+ "license": "MPL-2.0",
34
+ "main": "./dist/index.js",
2
35
  "name": "@wae/open-word",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
36
+ "optionalDependencies": {
37
+ "@wae/open-word-darwin-arm64": "0.0.0",
38
+ "@wae/open-word-darwin-x64": "0.0.0",
39
+ "@wae/open-word-linux-arm64": "0.0.0",
40
+ "@wae/open-word-linux-x64": "0.0.0",
41
+ "@wae/open-word-win32-x64": "0.0.0"
42
+ },
43
+ "publishConfig": {
44
+ "access": "public"
45
+ },
46
+ "repository": {
47
+ "directory": "projects/packages/open-word",
48
+ "type": "git",
49
+ "url": "git+https://github.com/nyar-os/OpenWord.git"
50
+ },
51
+ "scripts": {
52
+ "build": "tsc -p tsconfig.json",
53
+ "test": "tsc -p tsconfig.test.json && node --test dist-test/tests/smoke.test.js",
54
+ "typecheck": "tsc -p tsconfig.json --noEmit"
55
+ },
56
+ "type": "module",
57
+ "types": "./dist/index.d.ts",
58
+ "version": "0.0.0"
59
+ }