@quario/docx 0.1.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.
package/lib/xml.js ADDED
@@ -0,0 +1,30 @@
1
+ /**
2
+ * The XML edge of this target: the declaration every part opens with, the two
3
+ * namespaces its elements live in, and the escape every host or author string
4
+ * goes through on the way out. Nothing here knows what a report is — it is the
5
+ * one place the package's other modules reach for so that no second escape
6
+ * rule can grow beside the first (root CLAUDE.md, hard constraint 4).
7
+ */
8
+
9
+ /** The declaration every part opens with. No BOM: a reader may refuse one. */
10
+ export const XML = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n';
11
+
12
+ /** The WordprocessingML namespace, on the root of every content part. */
13
+ export const W = 'xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"';
14
+
15
+ /** The relationship namespace, for the `r:id` a part reference carries. */
16
+ export const R = 'xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"';
17
+
18
+ /**
19
+ * XML text, escaped. Every string this target writes that it did not write
20
+ * itself — a host's document property, an author's cell text — goes through
21
+ * it, with no exception to carry.
22
+ *
23
+ * @type {(value: string) => string}
24
+ */
25
+ export let esc = (value) =>
26
+ value
27
+ .replaceAll("&", "&amp;")
28
+ .replaceAll("<", "&lt;")
29
+ .replaceAll(">", "&gt;")
30
+ .replaceAll('"', "&quot;");
package/package.json ADDED
@@ -0,0 +1,64 @@
1
+ {
2
+ "name": "@quario/docx",
3
+ "version": "0.1.0",
4
+ "description": "The Word render target for quario — a flow target: real Word tables, a navigable outline, live page-number fields",
5
+ "homepage": "https://getquario.com",
6
+ "license": "SEE LICENSE IN LICENSE",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/getquario/quario.git",
10
+ "directory": "packages/docx"
11
+ },
12
+ "files": [
13
+ "CHANGELOG.md",
14
+ "lib"
15
+ ],
16
+ "type": "module",
17
+ "types": "lib/index.d.ts",
18
+ "exports": {
19
+ ".": {
20
+ "types": "./lib/index.d.ts",
21
+ "default": "./lib/index.js"
22
+ },
23
+ "./package.json": "./package.json"
24
+ },
25
+ "publishConfig": {
26
+ "access": "public"
27
+ },
28
+ "scripts": {
29
+ "check": "npm run size && npm test && npm run test:browser",
30
+ "size": "size-limit",
31
+ "test": "npm run test:unit && npm run test:types",
32
+ "test:browser": "node test/browser/setup.js",
33
+ "test:types": "tsc && attw --pack . --profile esm-only",
34
+ "test:unit": "node --disallow-code-generation-from-strings --test --test-concurrency=1 test/*.test.js",
35
+ "prepack": "node -e \"require('fs').copyFileSync('../../LICENSE','LICENSE')\"",
36
+ "postpack": "node -e \"require('fs').rmSync('LICENSE',{force:true})\""
37
+ },
38
+ "dependencies": {
39
+ "fflate": "^0.8.3"
40
+ },
41
+ "devDependencies": {
42
+ "@arethetypeswrong/cli": "^0.18.3",
43
+ "@size-limit/preset-small-lib": "^13.0.3",
44
+ "quario": "^0.8.0",
45
+ "size-limit": "^13.0.3",
46
+ "typescript": "^7.0.2"
47
+ },
48
+ "peerDependencies": {
49
+ "quario": "^0.8.0"
50
+ },
51
+ "size-limit": [
52
+ {
53
+ "path": "lib/index.js",
54
+ "ignore": [
55
+ "quario",
56
+ "fflate"
57
+ ],
58
+ "limit": "7 kB"
59
+ }
60
+ ],
61
+ "engines": {
62
+ "node": ">=22.0.0"
63
+ }
64
+ }