@unieai/libreoffice-kit-wasm 0.0.0-stage → 0.2.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.
Files changed (51) hide show
  1. package/README.md +7 -2
  2. package/assets/dsoffice.cjs +26 -0
  3. package/assets/dsoffice.data +0 -0
  4. package/assets/dsoffice.data.js.metadata +1 -0
  5. package/assets/dsoffice.wasm +4 -0
  6. package/assets/manifest.json +1888 -0
  7. package/licenses/LICENSE +4666 -0
  8. package/licenses/NOTICE +63 -0
  9. package/licenses/Rabi-Harness-MIT.txt +28 -0
  10. package/package.json +22 -4
  11. package/prebuilds.json +128 -0
  12. package/sources/build-autogen.input +35 -0
  13. package/sources/core-source.json +4 -0
  14. package/sources/docs/ui-resources.md +123 -0
  15. package/sources/engine/build-identity.mjs +49 -0
  16. package/sources/engine/core-source.mjs +27 -0
  17. package/sources/engine/document-operations.hxx +51 -0
  18. package/sources/engine/ui-resource-policy.mjs +33 -0
  19. package/sources/engine/wasm-source/autogen.input +33 -0
  20. package/sources/engine/wasm-source/build.mjs +300 -0
  21. package/sources/engine/wasm-source/lok.cxx +428 -0
  22. package/sources/engine/wasm-source/patches/0001-macos-build-tools.patch +87 -0
  23. package/sources/engine/wasm-source/patches/0002-system-font-demand.patch +322 -0
  24. package/sources/engine/wasm-source/patches/0003-node-runtime.patch +99 -0
  25. package/sources/engine/wasm-source/patches/0004-system-fonts-only.patch +10 -0
  26. package/sources/engine/wasm-source/patches/0005-cross-build-rules.patch +46 -0
  27. package/sources/engine/wasm-source/patches/0006-wasm-external-platforms.patch +55 -0
  28. package/sources/engine/wasm-source/patches/0008-disable-link-updates.patch +30 -0
  29. package/sources/engine/wasm-source/patches/0009-disable-optional-curl.patch +11 -0
  30. package/sources/engine/wasm-source/patches/0010-refresh-component-registry.patch +11 -0
  31. package/sources/engine/wasm-source/patches/0011-preserve-optimization-with-prefix-maps.patch +21 -0
  32. package/sources/engine/wasm-source/patches/0012-anonymize-explicit-source-paths.patch +39 -0
  33. package/sources/engine/wasm-source/patches/0023-pdfium-for-embedded-graphics.patch +14 -0
  34. package/sources/engine/wasm-source/patches/0024-pdfium-emscripten-platform.patch +11 -0
  35. package/sources/engine/wasm-source/patches/0025-browser-editing.patch +18 -0
  36. package/sources/engine/wasm-source/patches/0028-synchronous-workbook-calculation.patch +64 -0
  37. package/sources/engine/wasm-source/patches/0029-unloaded-external-blip.patch +21 -0
  38. package/sources/engine/wasm-source/patches/0030-no-password-strength-ui.patch +117 -0
  39. package/sources/engine/wasm-source/patches/0031-size-optimization-lto.patch +26 -0
  40. package/sources/engine/wasm-source/patches/0047-defer-offscreen-canvas-output.patch +59 -0
  41. package/sources/engine/wasm-source/slim.mjs +74 -0
  42. package/sources/engine/wasm-source/source.json +16 -0
  43. package/sources/engine/wasm-source/source.mjs +12 -0
  44. package/sources/engine/wasm-source/stage.mjs +91 -0
  45. package/sources/scripts/checkout-wasm.mjs +24 -0
  46. package/sources/scripts/core-checkout.mjs +39 -0
  47. package/sources/scripts/minimize-ui-resources.py +198 -0
  48. package/sources/scripts/pack-utils.mjs +69 -0
  49. package/sources/scripts/platform-matrix.mjs +122 -0
  50. package/sources/scripts/verify-artifacts.mjs +261 -0
  51. package/sources/source-changes.patch +1081 -0
@@ -0,0 +1,63 @@
1
+ Portions of LibreOffice may include work under the Apache License v2.0
2
+ requiring this NOTICE file to be provided.
3
+
4
+ For a more complete license statement please see the associated
5
+ documentation
6
+ ____
7
+
8
+ Apache OpenOffice (http://www.openoffice.org)
9
+ Copyright 2011, 2014 The Apache Software Foundation
10
+
11
+ This product includes software developed at
12
+ The Apache Software Foundation (http://www.apache.org/).
13
+
14
+ ____
15
+
16
+
17
+ Portions of this software copyright (c) 2000-2011, Oracle and/or its affiliates <http://www.oracle.com/>.
18
+
19
+ Portions of this software (C) Copyright IBM Corporation 2003, 2012. All Rights Reserved.
20
+
21
+ ____
22
+
23
+ As part of the base system this product also includes code from the following
24
+ Apache projects:
25
+ - Apache Lucene
26
+
27
+ The notices from these projects are following:
28
+
29
+ Apache Lucene
30
+ Copyright 2006 The Apache Software Foundation
31
+
32
+ This product includes software developed by
33
+ The Apache Software Foundation (http://www.apache.org/).
34
+
35
+ The snowball stemmers in
36
+ contrib/snowball/src/java/net/sf/snowball
37
+ were developed by Martin Porter and Richard Boulton.
38
+ The full snowball package is available from
39
+ http://snowball.tartarus.org/
40
+
41
+ ____
42
+
43
+ As part of the base system this product may also includes code from the following
44
+ projects which are licensed under the Apache license:
45
+ - redland
46
+ - Apache BeanShell Scripting for Java
47
+
48
+ The notices from these projects are following:
49
+
50
+ redland
51
+ This product includes Redland software (http://librdf.org/)
52
+ developed at the Institute for Learning and Research Technology,
53
+ University of Bristol, UK (http://www.bristol.ac.uk/).
54
+
55
+ Apache BeanShell Scripting for Java
56
+ Copyright 1997-2012 Patrick Niemeyer
57
+ Granted to the Apache Software Foundation 2012
58
+ Licensed under the Apache License, Version 2.0.
59
+ ____
60
+
61
+ This product includes software developed by the OpenSSL Project
62
+ for use in the OpenSSL Toolkit. (http://www.openssl.org/)
63
+
@@ -0,0 +1,28 @@
1
+ Browser presentation, Electron texture transfer and adapter detection, and GPU diagnostic examples originate from MIT-licensed Rabi Harness commit 21261bee8b9a820c62c9e42cade3ff644b747a29. They retain the frame-forwarding/LICENSE notice. See packages/frame-forwarding/README.md for source locations and API ownership.
2
+
3
+ LibreOffice Kit incorporates font handling and conversion integration derived from Rabi Harness. These portions retain the following notice. LibreOffice engine sources and their separate third-party notices are distributed in the engine packages.
4
+
5
+ The entry package's src/native-font-names.js contains font-name data derived from LibreOffice Core's unotools/source/misc/fontdefs.cxx at commit bce0998afefdbc355585ca324285661a2170ba77. That file retains the upstream Mozilla Public License 2.0 notice and the Apache Software Foundation notice for incorporated work licensed under the Apache License 2.0.
6
+ Source: https://github.com/LibreOffice/core/blob/bce0998afefdbc355585ca324285661a2170ba77/unotools/source/misc/fontdefs.cxx
7
+
8
+ MIT License
9
+
10
+ Copyright (c) 2026 DeepSeek
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ of this software and associated documentation files (the "Software"), to deal
14
+ in the Software without restriction, including without limitation the rights
15
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ copies of the Software, and to permit persons to whom the Software is
17
+ furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all
20
+ copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ SOFTWARE.
package/package.json CHANGED
@@ -1,6 +1,24 @@
1
1
  {
2
2
  "name": "@unieai/libreoffice-kit-wasm",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.2.3",
4
+ "type": "module",
5
+ "license": "MPL-2.0",
6
+ "engines": {
7
+ "node": ">=22.19.0"
8
+ },
9
+ "publishConfig": {
10
+ "access": "public"
11
+ },
12
+ "description": "Portable Node WebAssembly Office-to-PDF engine assets",
13
+ "exports": {
14
+ "./prebuilds.json": "./prebuilds.json",
15
+ "./package.json": "./package.json"
16
+ },
17
+ "files": [
18
+ "prebuilds.json",
19
+ "assets/",
20
+ "sources/",
21
+ "licenses/",
22
+ "README.md"
23
+ ]
24
+ }
package/prebuilds.json ADDED
@@ -0,0 +1,128 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "version": "0.2.3",
4
+ "platform": "wasm",
5
+ "status": "built",
6
+ "engine": {
7
+ "kind": "wasm",
8
+ "loader": "assets/dsoffice.cjs",
9
+ "wasm": "assets/dsoffice.wasm",
10
+ "data": "assets/dsoffice.data",
11
+ "metadata": "assets/dsoffice.data.js.metadata",
12
+ "programDirectory": "/instdir/program"
13
+ },
14
+ "files": {
15
+ "assets/dsoffice.cjs": "c9248ef54385015475b15ae2baca41d9f7a8bd0b8538904da6a1fcd16c5305a1",
16
+ "assets/dsoffice.data": "0bea03629341de18dc90bdfc1e67a2f3b791e31ef9fe22888c288226e8bd5b15",
17
+ "assets/dsoffice.data.js.metadata": "ffab1d431c3ecdac3f2438f5e229b2e9a83364fed02b1732e5c327ab43d6b04d",
18
+ "assets/dsoffice.wasm": "bb7d1121c7200020f0b6219e37655719cde0c63f905f9826c43c40bf5a7c17c8",
19
+ "assets/manifest.json": "3be04821d18b6a9bd8e5c570173ddc124abb72af3c6df6561492bff4d95a9af9",
20
+ "sources/build-autogen.input": "faca029e22789782244ec291b83f33f7c8f540f4f79e6e0d87b3ca66dbd016eb",
21
+ "sources/core-source.json": "39340edab26fd8f702380a0b9fedcfcc6a181793b46dd6d7dee01fa80a2458f0",
22
+ "sources/docs/ui-resources.md": "9610e6ca8919d0b6638d8d445172c5a1679bdae4bbbeeec35be8b3d7faad36e6",
23
+ "sources/engine/build-identity.mjs": "d8e3032f1a589b0877a3822fe9e4a4363427352e0a024a6824791887cf8644cc",
24
+ "sources/engine/core-source.mjs": "7978aec9b96adb6c98d1804fbccdfdffac16a6387d781e4b5950998b47726bd0",
25
+ "sources/engine/document-operations.hxx": "d1762ee80b195f984e9c57372090d14c33d98698dd23fcbf2e94210ac65e7b8b",
26
+ "sources/engine/ui-resource-policy.mjs": "6001042ff41a7e098ae52b857115586e908e7b1d03668ada7f6e3674e4160868",
27
+ "sources/engine/wasm-source/autogen.input": "d2bc5b3f084653e6cce13b79c88eed5f7bba0ba1f5088027fc94c95edafbb0e8",
28
+ "sources/engine/wasm-source/build.mjs": "290a5681d98b1ea1c1f0c6bdf9a9d79defb1b06708c41404dd7c389b02bc311f",
29
+ "sources/engine/wasm-source/lok.cxx": "160878b31c5bd4304e257fba0c1e1ce3205896cb692a135369cf6f0510c5789f",
30
+ "sources/engine/wasm-source/patches/0001-macos-build-tools.patch": "eeb6258c0dbc386160d904be7001a0bf7d279c9e5d2f91964c4578e26f649374",
31
+ "sources/engine/wasm-source/patches/0002-system-font-demand.patch": "641952185d8801d5de61cb995337a6833f19f1248a89b07835a7b9f55aaa44cf",
32
+ "sources/engine/wasm-source/patches/0003-node-runtime.patch": "eab28d72335db04e1f0056c24103ba3975ef8c9984008db30e38774393ee8f54",
33
+ "sources/engine/wasm-source/patches/0004-system-fonts-only.patch": "3d6e23df5a61c26a18dee7909109c25115b52c0ac0ea04719245adffe3083cde",
34
+ "sources/engine/wasm-source/patches/0005-cross-build-rules.patch": "a9ad0814ec48b15cde6db008e45fded10cef87a518abf566ff6748c7a3c6757e",
35
+ "sources/engine/wasm-source/patches/0006-wasm-external-platforms.patch": "8cbef6be577728a68d8b62dcdc973b51d9fcc5342089cf02d5e0aab8586d38af",
36
+ "sources/engine/wasm-source/patches/0008-disable-link-updates.patch": "cf91a360d4b8ec068a5ab928d823b2adf24ec23e63e68f5ce6a9f5957d49fba9",
37
+ "sources/engine/wasm-source/patches/0009-disable-optional-curl.patch": "3f69f41557cc997ac8a98fad528e05c81163358879f4e01ea5ccdab6660dcc17",
38
+ "sources/engine/wasm-source/patches/0010-refresh-component-registry.patch": "c3eeb466deca20c85f60ee9985532e53340e6fea1cc72a26c21de0def0279804",
39
+ "sources/engine/wasm-source/patches/0011-preserve-optimization-with-prefix-maps.patch": "6649d571003b237488692724b147dbc97087c5514c0964847755c492349fc2db",
40
+ "sources/engine/wasm-source/patches/0012-anonymize-explicit-source-paths.patch": "2cefd27573199e8387f97272239819d6a845607b55b7159e2793d03075cab2a0",
41
+ "sources/engine/wasm-source/patches/0023-pdfium-for-embedded-graphics.patch": "edc871a761e64b3e68afd6ee30dcc5cad0953e5278ade72da24ef7d21e9b98f8",
42
+ "sources/engine/wasm-source/patches/0024-pdfium-emscripten-platform.patch": "ff2596df7507fa19c41c1c524722c7a45e535194cafbef208a7818bd7a953fb5",
43
+ "sources/engine/wasm-source/patches/0025-browser-editing.patch": "82affcd48ca021dfa2abf7c5645091c559204697c8c500cfd5363463e5aa889c",
44
+ "sources/engine/wasm-source/patches/0028-synchronous-workbook-calculation.patch": "811a5d68a31f5ae451b0753953bac24d5831efbf1f106d8832d4854be32ebc72",
45
+ "sources/engine/wasm-source/patches/0029-unloaded-external-blip.patch": "fe1f0f46cafefef9688dfa086cb3aab89b5deff5d0a0876c2329aad90189ef2e",
46
+ "sources/engine/wasm-source/patches/0030-no-password-strength-ui.patch": "41ef274bf30ba69fa77df364c30171cd593d958a54f5e394edcfc65ec9cb1fe7",
47
+ "sources/engine/wasm-source/patches/0031-size-optimization-lto.patch": "6a358c30d2047ee34bf04e54421dc9e1f1f29d553f17b63f60c22e8eb142c782",
48
+ "sources/engine/wasm-source/patches/0047-defer-offscreen-canvas-output.patch": "b29a3645b238505be0dd6f8c0df487900796a7de410a66ee77bc5717a4dba120",
49
+ "sources/engine/wasm-source/slim.mjs": "9b8d8482a78f578f625117e62fd6f162c418b86a492ab8bc553d406f5cb4a821",
50
+ "sources/engine/wasm-source/source.json": "5cbd80154f0d6a83442335ffec195021709d0ba26319758f9ad9e24c083e1709",
51
+ "sources/engine/wasm-source/source.mjs": "826d22ddff565452db235dd5a574eda666d712fb6f4f9aea12f5352a9f4e9a70",
52
+ "sources/engine/wasm-source/stage.mjs": "06743684076898c2587baea4d9b6b0c1831dc2c6997e7c2f031748880bf30386",
53
+ "sources/scripts/checkout-wasm.mjs": "c11e32ab1720f510c9265d23e9addf2f0679ca581b8c45299094b26cca256278",
54
+ "sources/scripts/core-checkout.mjs": "12dc726a3fe712b77aea1a4ddf2b8a482b984774e2a88f3576fe3eac58effff4",
55
+ "sources/scripts/minimize-ui-resources.py": "91f5f21b8ea240c2dfddd0811e52135526d4542d2375be05f5d2ab2046ebf502",
56
+ "sources/scripts/pack-utils.mjs": "aa5368e0dd38d90459f0ef14e1d4b27740aef2f4e46617aca6d6fafed0577a44",
57
+ "sources/scripts/platform-matrix.mjs": "7e55ab51759e3be7ca4333ff7f10620ef89c9548843ddf690f90fe18a8ed3b29",
58
+ "sources/scripts/verify-artifacts.mjs": "09a7c2803108922060437ef331c291c6db0b23805497356b7ff71cd0fd2d4911",
59
+ "sources/source-changes.patch": "8f94553fe894d02f783f441c21a92b2d0751be15269dd9cd3f2a4d930a7913a4",
60
+ "licenses/Rabi-Harness-MIT.txt": "637f43ba3b0193253cd80de6ce6ed4ed4d8a34eac84f6aaa7cc14f532e36318f",
61
+ "licenses/LICENSE": "31c915ae5b7eafe51f06fc2537d2e7fefdee08e40d6b0d761d03d9f0fd58d660",
62
+ "licenses/NOTICE": "8d34210ebbfaee4ba258ef7b30c3044170f356ab82c8259c81b53860bcdeef7b"
63
+ },
64
+ "source": {
65
+ "repository": "https://github.com/LibreOffice/core.git",
66
+ "revision": "bce0998afefdbc355585ca324285661a2170ba77",
67
+ "version": "26.8.0.3",
68
+ "files": [
69
+ "sources/build-autogen.input",
70
+ "sources/core-source.json",
71
+ "sources/docs/ui-resources.md",
72
+ "sources/engine/build-identity.mjs",
73
+ "sources/engine/core-source.mjs",
74
+ "sources/engine/document-operations.hxx",
75
+ "sources/engine/ui-resource-policy.mjs",
76
+ "sources/engine/wasm-source/autogen.input",
77
+ "sources/engine/wasm-source/build.mjs",
78
+ "sources/engine/wasm-source/lok.cxx",
79
+ "sources/engine/wasm-source/patches/0001-macos-build-tools.patch",
80
+ "sources/engine/wasm-source/patches/0002-system-font-demand.patch",
81
+ "sources/engine/wasm-source/patches/0003-node-runtime.patch",
82
+ "sources/engine/wasm-source/patches/0004-system-fonts-only.patch",
83
+ "sources/engine/wasm-source/patches/0005-cross-build-rules.patch",
84
+ "sources/engine/wasm-source/patches/0006-wasm-external-platforms.patch",
85
+ "sources/engine/wasm-source/patches/0008-disable-link-updates.patch",
86
+ "sources/engine/wasm-source/patches/0009-disable-optional-curl.patch",
87
+ "sources/engine/wasm-source/patches/0010-refresh-component-registry.patch",
88
+ "sources/engine/wasm-source/patches/0011-preserve-optimization-with-prefix-maps.patch",
89
+ "sources/engine/wasm-source/patches/0012-anonymize-explicit-source-paths.patch",
90
+ "sources/engine/wasm-source/patches/0023-pdfium-for-embedded-graphics.patch",
91
+ "sources/engine/wasm-source/patches/0024-pdfium-emscripten-platform.patch",
92
+ "sources/engine/wasm-source/patches/0025-browser-editing.patch",
93
+ "sources/engine/wasm-source/patches/0028-synchronous-workbook-calculation.patch",
94
+ "sources/engine/wasm-source/patches/0029-unloaded-external-blip.patch",
95
+ "sources/engine/wasm-source/patches/0030-no-password-strength-ui.patch",
96
+ "sources/engine/wasm-source/patches/0031-size-optimization-lto.patch",
97
+ "sources/engine/wasm-source/patches/0047-defer-offscreen-canvas-output.patch",
98
+ "sources/engine/wasm-source/slim.mjs",
99
+ "sources/engine/wasm-source/source.json",
100
+ "sources/engine/wasm-source/source.mjs",
101
+ "sources/engine/wasm-source/stage.mjs",
102
+ "sources/scripts/checkout-wasm.mjs",
103
+ "sources/scripts/core-checkout.mjs",
104
+ "sources/scripts/minimize-ui-resources.py",
105
+ "sources/scripts/pack-utils.mjs",
106
+ "sources/scripts/platform-matrix.mjs",
107
+ "sources/scripts/verify-artifacts.mjs",
108
+ "sources/source-changes.patch"
109
+ ]
110
+ },
111
+ "licenses": [
112
+ {
113
+ "component": "LibreOffice",
114
+ "spdx": "MPL-2.0",
115
+ "path": "licenses/LICENSE"
116
+ },
117
+ {
118
+ "component": "Rabi Harness portions",
119
+ "spdx": "MIT",
120
+ "path": "licenses/Rabi-Harness-MIT.txt"
121
+ },
122
+ {
123
+ "component": "LibreOffice third-party notices",
124
+ "spdx": "LicenseRef-LibreOffice-Notices",
125
+ "path": "licenses/NOTICE"
126
+ }
127
+ ]
128
+ }
@@ -0,0 +1,35 @@
1
+ --host=wasm32-local-emscripten
2
+ --disable-gui
3
+ --disable-qt5
4
+ --disable-qt6
5
+ --disable-gen
6
+ --with-wasm-module=writer calc impress
7
+ --with-package-format=emscripten
8
+ --with-vendor=DeepSeek
9
+ --disable-debug
10
+ --disable-dbgutil
11
+ --disable-symbols
12
+ --disable-pch
13
+ --disable-werror
14
+ --without-java
15
+ --enable-python=no
16
+ --without-fonts
17
+ --disable-opencl
18
+ --disable-opengl
19
+ --disable-skia
20
+ --enable-pdfium
21
+ --without-doxygen
22
+ --without-help
23
+ --without-myspell-dicts
24
+ --disable-emscripten-proxy-to-pthread
25
+ --with-build-platform-configure-options=--enable-bogus-pkg-config
26
+ --disable-xmlhelp
27
+ --disable-curl
28
+ --without-webdav
29
+ --disable-libcmis
30
+ --disable-breakpad
31
+ --enable-lto
32
+ --with-galleries=no
33
+ --with-templates=no
34
+ --with-external-tar=/build/libreoffice-kit/tarballs
35
+ --with-parallelism=16
@@ -0,0 +1,4 @@
1
+ {
2
+ "repository": "https://github.com/LibreOffice/core.git",
3
+ "revision": "bce0998afefdbc355585ca324285661a2170ba77"
4
+ }
@@ -0,0 +1,123 @@
1
+ # Headless UI resource qualification
2
+
3
+ Native headless installations retain these `.ui` layouts under `share/config/soffice.cfg` (`Contents/Resources/config/soffice.cfg` on macOS), as declared by [the shared policy](../engine/ui-resource-policy.mjs):
4
+
5
+ | Path | Consumer |
6
+ | --- | --- |
7
+ | `modules/scalc/ui/inputbar.ui` | Calc formula bar |
8
+ | `modules/scalc/ui/posbox.ui` | Calc name box |
9
+ | `modules/simpress/ui/tabviewbar.ui` | Impress slide view tabs |
10
+ | `modules/swriter/ui/annotation.ui` | Writer comments |
11
+ | `sfx/ui/extrabutton.ui` | Information-bar action buttons |
12
+ | `sfx/ui/infobar.ui` | Document information bars |
13
+ | `svx/ui/selectionmenu.ui` | Native selection controls |
14
+ | `svt/ui/scrollbars.ui` | Scrollbar adaptor |
15
+ | `svt/ui/tabbuttons.ui` | Tab bar buttons |
16
+ | `svt/ui/tabbuttonsmirrored.ui` | Right-to-left Calc sheet tabs |
17
+
18
+ Conversion and editing construct document views and dispatch VCL events even when no desktop window is shown. Headless Calc and Impress use their shell views, Writer loads `annotation.ui` for comments, and RTL Calc sheets construct mirrored tab controls during conversion and recalculation. Missing required layouts can fail document loading or abort an event callback. The shared [policy](../engine/ui-resource-policy.mjs) checks their presence. Native packaging removes every other `.ui` file below this root; it does not remove other file types or layouts outside the root. Toolbar, menubar and image policies apply separately.
19
+
20
+ The shared WASM image retains ordinary `.ui` layouts beyond this native allowlist. Conversion-only minimization does not establish that a layout is unused by document event dispatch. Validate the operations that consume a resource before removing it; the native editor and commented-DOCX conversion checks exercise different dependencies.
21
+
22
+ The initial five-layout policy omitted Writer comments. A real-engine test on
23
+ 2026-09-17 confirmed that a standard commented DOCX loaded with the baseline WASM
24
+ image, failed with the five-layout image, and loaded again after restoring only
25
+ `annotation.ui` (11,021 bytes). The baseline and restored PDF rendered identically.
26
+ The policy additionally retains mirrored tab controls: a seeded RTL XLSX failed
27
+ to open with the published native engine and succeeded after restoring only
28
+ `tabbuttonsmirrored.ui`. `test/runtime-cli-fuzz.test.mjs` covers RTL workbooks in
29
+ conversion, rendering and recalculation. `test/runtime-engine.test.mjs` includes a generated commented DOCX
30
+ in installed-engine checks; it runs when `LIBREOFFICE_RUNTIME_ENTRY` is set.
31
+
32
+ The conversion-only six-layout policy was checked locally on 2026-09-17 against
33
+ existing Core `bce0998afefdbc355585ca324285661a2170ba77` builds. Counts and sizes depend on the
34
+ input build and earlier packaging exclusions; the minimizer records exact bytes
35
+ for each run instead of enforcing these totals.
36
+
37
+ | Measurement | Result |
38
+ | --- | --- |
39
+ | Native, incremental to the existing `main` exclusions | 1,021 → 6 layouts; 14,232,992 bytes removed |
40
+ | WASM, incremental to the existing repacked data image | 1,030 → 6 layouts; 14,359,775 bytes removed |
41
+ | WASM data image | 24,073,052 → 9,713,277 bytes |
42
+ | Six retained layouts in these builds | 26,097 bytes; retained bytes unchanged |
43
+ | Annotation restoration relative to the five-layout image | One file, 11,021 bytes; all other payload bytes unchanged |
44
+ | WASM conversion | 127/128 inputs converted, including the commented DOCX |
45
+ | macOS ARM64 native smoke across all six formats | 9/10 representative inputs converted, including the commented DOCX |
46
+
47
+ The WASM corpus contained 126 distinct user inputs and two supplementary fixtures
48
+ (commented DOCX and XLS). The sole failing input in both backends also failed with
49
+ the unpruned baseline: its ZIP container uses unencrypted STORED entries with data
50
+ descriptors, rejected by the pinned Core. Restoring annotation.ui introduced no new
51
+ conversion failure. User documents and diagnostic outputs remain outside tracked
52
+ source and release payloads.
53
+
54
+ WASM used the same `convertWithWasm` implementation, module, host font catalog and
55
+ 192-DPI export setting. Of 127 successful results, 126 matched the earlier baseline's
56
+ ordered word text, coordinates and page sizes. One legacy DOC differed on one line;
57
+ two alternating repeats of the unchanged baseline and restored image all matched
58
+ the new result, including the 93-page count. The commented DOCX also produced an
59
+ identical rendered PNG to baseline.
60
+
61
+ Native coordinate equivalence was **not requalified**: untouched baseline runs
62
+ changed font metrics, word segmentation and sometimes pagination. The strict
63
+ minimizer correctly rejected that unstable baseline before trying deletions.
64
+ These macOS ARM64 native and direct-WASM tests do not replace matching-host native
65
+ release qualification or Linux installation checks.
66
+
67
+ `test/runtime-engine.test.mjs` includes a generated commented DOCX. The native editor suites cover document open, input, selection, layout, export and process disposal. Engine-backed tests require the built adapter and `LIBREOFFICE_RUNTIME_ENTRY`; source metadata or a skipped runtime test is not qualification evidence.
68
+
69
+ ## Requalify after every Core upgrade
70
+
71
+ Use a complete installation from the new Core build and a matching-host native
72
+ engine package. A previously pruned package alone cannot reveal new dependencies.
73
+ The package's helper, installation and `--ui-source` must come from the same build.
74
+ Use text-bearing fixtures covering all six formats, standard DOCX comments,
75
+ multilingual text, right-to-left worksheets and large reports. Install Python 3, Node and Poppler (`pdftotext`)
76
+ on the qualification host.
77
+
78
+ ```sh
79
+ python3 scripts/minimize-ui-resources.py \
80
+ --package /absolute/native-engine-package \
81
+ --ui-source /absolute/unpruned-install/share/config/soffice.cfg \
82
+ --fixtures /absolute/office-corpus \
83
+ --output .build/ui-minimization
84
+ ```
85
+
86
+ On macOS `--ui-source` ends in
87
+ `LibreOfficeDev.app/Contents/Resources/config/soffice.cfg`. Pass repeatable
88
+ `--font-file /absolute/font.ttf` arguments to register the same fonts in every
89
+ helper process. Stabilize missing-font substitution before measuring: the script
90
+ rejects a baseline whose page geometry, text or word boxes change between two runs.
91
+ Use static document fields; volatile dates or external data cannot qualify exact
92
+ equivalence. The script strips credentials and loader overrides from child environments.
93
+
94
+ The script copies the engine and complete UI tree into a new output directory. It
95
+ deletes only from that copy, tries directories before individual files, restores
96
+ each rejected trial, and repeats file trials until no more removals pass. Every
97
+ trial and the final check run the corpus in fresh helper processes with separate
98
+ profiles and PDFs. Nonzero exits (including aborts), deadlines, missing words and
99
+ changed page/word geometry reject a deletion. It checks ordered word text and
100
+ coordinates, excluding PDF metadata such as creation time. This is a greedy,
101
+ corpus-specific minimum, not a proof for every document or rendering feature.
102
+
103
+ `report.json` records input/UI/font/helper hashes, Core revision, Poppler version,
104
+ all deletion decisions and failures, final retained paths and byte counts. Baseline
105
+ XML and failure logs remain local for diagnosis. The candidate copy has a changed
106
+ payload and is not a releasable package; stage it again with the normal recipe.
107
+
108
+ Review the result and update `requiredUiResources` and `reviewedUiCoreRevision`.
109
+ The mandatory allowlist must cover both backends: a resource removable by native
110
+ minimization may still be required by WASM conversion. Ordinary WASM layouts are
111
+ retained separately and require reading-runtime qualification before any further pruning.
112
+ A smaller native result does not justify removing Writer's annotation layout without a WASM comment conversion check.
113
+ The reviewed revision is evidence scope; `engine/core` remains the only source
114
+ pin. Stage freshly qualified native packages on each release host and repackage
115
+ WASM from its verified compilation. Use `--mode verify` with another new output
116
+ directory to compare the checked-in allowlist directly against the complete UI
117
+ tree. Qualify the repacked WASM engine and installed native packages with the same
118
+ corpus and fonts before release; native minimization alone does not qualify WASM.
119
+
120
+ Run `pnpm verify:metadata`, `pnpm test` and `pnpm test:packaging`. Packaging hashes
121
+ and ships the shared policy; native reuse, prepared-engine validation and both
122
+ engine caches reject an old policy. WASM repacking preserves every retained byte,
123
+ rebuilds offsets/size and records original and final hashes without recompilation.
@@ -0,0 +1,49 @@
1
+ /** Reproducible public build identity; private paths remain only in the build tree. */
2
+ import { createHash } from 'node:crypto';
3
+ import { readFileSync } from 'node:fs';
4
+
5
+ export const buildVendor = 'DeepSeek';
6
+ const compilerFlagKeys = ['CFLAGS', 'CXXFLAGS', 'OBJCFLAGS', 'OBJCXXFLAGS', 'ENVCFLAGS', 'ENVCFLAGSCXX'];
7
+
8
+ /** Map the most specific paths first, including external build directories. */
9
+ export function buildPathMap(paths) {
10
+ return Object.entries(paths).filter(([, value]) => value).map(([name, value]) => {
11
+ if (!/^[A-Za-z0-9_./:\\-]+$/.test(value)) throw new Error('Build paths must not contain whitespace or shell metacharacters');
12
+ return [value.replaceAll('\\', '/').replace(/\/$/, ''), `/build/libreoffice-kit/${name}`];
13
+ }).sort((a, b) => b[0].length - a[0].length);
14
+ }
15
+
16
+ export function publicBuildValue(value, paths) {
17
+ const mappings = buildPathMap(paths);
18
+ const replace = text => {
19
+ for (const [from, to] of mappings) text = text.replaceAll(from, to).replaceAll(from.replaceAll('/', '\\'), to);
20
+ return text;
21
+ };
22
+ const visit = item => typeof item === 'string' ? replace(item) : Array.isArray(item) ? item.map(visit)
23
+ : item && typeof item === 'object' ? Object.fromEntries(Object.entries(item).map(([key, child]) => [key, visit(child)])) : item;
24
+ return visit(value);
25
+ }
26
+
27
+ export function buildPathFlags(platform, paths) {
28
+ const mappings = buildPathMap(paths);
29
+ if (platform.startsWith('win32-')) return ['/experimental:deterministic', ...mappings.map(([from, to]) => `/pathmap:${from}=${to}`)];
30
+ const flags = mappings.reverse().flatMap(([from, to]) => [`-ffile-prefix-map=${from}=${to}`, `-fdebug-prefix-map=${from}=${to}`]);
31
+ return platform === 'clang-cl' ? flags.map(flag => `/clang:${flag}`) : flags;
32
+ }
33
+
34
+ /** Both gbuild and external configure projects receive the prefix mappings. */
35
+ export function buildEnvironment(environment, platform, paths) {
36
+ const result = Object.fromEntries(Object.entries(environment).filter(([key]) => !/KEY|TOKEN|SECRET|PASSWORD/i.test(key)));
37
+ const flags = buildPathFlags(platform, paths).join(' ');
38
+ for (const key of compilerFlagKeys) result[key] = `${result[key] ?? ''} ${flags}`.trim();
39
+ return result;
40
+ }
41
+
42
+ /** Hashed private receipt prevents resuming a tree configured without these flags. */
43
+ export function buildIdentity(platform, paths, environment) {
44
+ const flags = Object.fromEntries(compilerFlagKeys.map(key => [key, environment[key] ?? '']));
45
+ return { schemaVersion: 1, vendor: buildVendor,
46
+ recipe: createHash('sha256').update(readFileSync(new URL(import.meta.url))).digest('hex'),
47
+ configuration: createHash('sha256').update(JSON.stringify({ platform, paths, flags })).digest('hex'),
48
+ compilerFlags: publicBuildValue(flags, paths) };
49
+ }
@@ -0,0 +1,27 @@
1
+ /** The submodule gitlink and .gitmodules are the workspace's only Core pin. */
2
+ import { execFileSync } from 'node:child_process';
3
+ import { existsSync, readFileSync } from 'node:fs';
4
+ import { join } from 'node:path';
5
+ import { fileURLToPath } from 'node:url';
6
+
7
+ const root = fileURLToPath(new URL('../', import.meta.url));
8
+ export const coreSubmodule = 'engine/core';
9
+
10
+ export function readCoreSource(repo = root) {
11
+ let source;
12
+ if (existsSync(join(repo, '.git'))) {
13
+ const git = args => execFileSync('git', args, { cwd: repo, encoding: 'utf8' }).trim();
14
+ const path = git(['config', '--file', '.gitmodules', '--get', 'submodule.libreoffice.path']);
15
+ if (path !== coreSubmodule) throw new Error(`LibreOffice submodule must be at ${coreSubmodule}`);
16
+ const entry = git(['ls-files', '--stage', '--', coreSubmodule]);
17
+ const match = entry.match(/^160000 ([a-f0-9]{40}) 0\tengine\/core$/);
18
+ if (!match) throw new Error('LibreOffice requires a single staged submodule gitlink; resolve conflicts and git add engine/core');
19
+ source = { repository: git(['config', '--file', '.gitmodules', '--get', 'submodule.libreoffice.url']), revision: match[1] };
20
+ } else {
21
+ // Engine tarballs have no Git metadata. Staging exports the resolved pin here.
22
+ source = JSON.parse(readFileSync(join(repo, 'core-source.json'), 'utf8'));
23
+ }
24
+ if (!/^https:\/\//.test(source.repository) || !/^[a-f0-9]{40}$/.test(source.revision))
25
+ throw new Error('Core source requires an HTTPS repository and full commit');
26
+ return Object.freeze({ repository: source.repository, revision: source.revision });
27
+ }
@@ -0,0 +1,51 @@
1
+ // Operations shared by the native helper and the Node WASM shim.
2
+ #pragma once
3
+ #ifndef LOK_USE_UNSTABLE_API
4
+ #define LOK_USE_UNSTABLE_API
5
+ #endif
6
+ #include <LibreOfficeKit/LibreOfficeKit.h>
7
+ #include <LibreOfficeKit/LibreOfficeKitEnums.h>
8
+ #include <cstdlib>
9
+ #include <memory>
10
+ #include <stdexcept>
11
+ #include <string>
12
+
13
+ namespace rabi {
14
+ inline void checkError(LibreOfficeKit* office)
15
+ {
16
+ std::unique_ptr<char, decltype(&std::free)> error(office->pClass->getError(office), std::free);
17
+ if (error && error.get()[0]) throw std::runtime_error(error.get());
18
+ }
19
+
20
+ // The model API returns after the full calculation, before any output is saved.
21
+ inline void recalculate(LibreOfficeKit* office, LibreOfficeKitDocument* document)
22
+ {
23
+ if (document->pClass->getDocumentType(document) != LOK_DOCTYPE_SPREADSHEET)
24
+ throw std::runtime_error("Recalculation requires a spreadsheet");
25
+ if (!LIBREOFFICEKIT_DOCUMENT_HAS(document, calculateAll))
26
+ throw std::runtime_error("Installed engine does not support synchronous workbook calculation");
27
+ if (!document->pClass->calculateAll(document)) {
28
+ checkError(office);
29
+ throw std::runtime_error("Workbook calculation did not complete");
30
+ }
31
+ }
32
+
33
+ inline void selectCsvSheet(LibreOfficeKit* office, LibreOfficeKitDocument* document, const char* sheet)
34
+ {
35
+ if (document->pClass->getDocumentType(document) != LOK_DOCTYPE_SPREADSHEET)
36
+ throw std::runtime_error("CSV export requires a spreadsheet");
37
+ const int count = document->pClass->getParts(document);
38
+ if (!sheet && count != 1) throw std::runtime_error("CSV export of a multi-sheet workbook requires --sheet with an exact worksheet name");
39
+ int selected = sheet ? -1 : 0;
40
+ if (sheet) {
41
+ for (int i = 0; i < count; ++i) {
42
+ std::unique_ptr<char, decltype(&std::free)> name(document->pClass->getPartName(document, i), std::free);
43
+ if (name && std::string(name.get()) == sheet) { selected = i; break; }
44
+ }
45
+ }
46
+ if (selected < 0) throw std::runtime_error("CSV worksheet was not found");
47
+ document->pClass->setPart(document, selected);
48
+ checkError(office);
49
+ if (document->pClass->getPart(document) != selected) throw std::runtime_error("Could not select the CSV worksheet");
50
+ }
51
+ }
@@ -0,0 +1,33 @@
1
+ /** Layouts required by headless conversion and native document event dispatch, relative to share/config/soffice.cfg. */
2
+ export const requiredUiResources = Object.freeze([
3
+ 'modules/scalc/ui/inputbar.ui',
4
+ 'modules/scalc/ui/posbox.ui',
5
+ 'modules/simpress/ui/tabviewbar.ui',
6
+ 'modules/swriter/ui/annotation.ui',
7
+ 'sfx/ui/extrabutton.ui',
8
+ 'sfx/ui/infobar.ui',
9
+ 'svx/ui/selectionmenu.ui',
10
+ 'svt/ui/scrollbars.ui',
11
+ 'svt/ui/tabbuttons.ui',
12
+ 'svt/ui/tabbuttonsmirrored.ui',
13
+ ]);
14
+
15
+ // Evidence scope, not a source pin: engine/core remains the only source pin.
16
+ // Rerun scripts/minimize-ui-resources.py on a complete installation when Core changes.
17
+ export const reviewedUiCoreRevision = 'bce0998afefdbc355585ca324285661a2170ba77';
18
+
19
+ export function assertUiCoreRevision(revision) {
20
+ if (revision !== reviewedUiCoreRevision)
21
+ throw new Error('Core changed: rerun scripts/minimize-ui-resources.py and review the UI allowlist before packaging');
22
+ }
23
+
24
+ export function assertRequiredUiResources(paths) {
25
+ const present = new Set(paths);
26
+ for (const file of requiredUiResources)
27
+ if (!present.has(file)) throw new Error(`Missing required headless UI resource: ${file}`);
28
+ }
29
+
30
+ /** Remove only .ui layouts; adjacent configuration and other resources keep their own policies. */
31
+ export function unusedUiResource(path) {
32
+ return path.endsWith('.ui') && !requiredUiResources.includes(path);
33
+ }
@@ -0,0 +1,33 @@
1
+ --host=wasm32-local-emscripten
2
+ --disable-gui
3
+ --disable-qt5
4
+ --disable-qt6
5
+ --disable-gen
6
+ --with-wasm-module=writer calc impress
7
+ --with-package-format=emscripten
8
+ --with-vendor=DeepSeek
9
+ --disable-debug
10
+ --disable-dbgutil
11
+ --disable-symbols
12
+ --disable-pch
13
+ --disable-werror
14
+ --without-java
15
+ --enable-python=no
16
+ --without-fonts
17
+ --disable-opencl
18
+ --disable-opengl
19
+ --disable-skia
20
+ --enable-pdfium
21
+ --without-doxygen
22
+ --without-help
23
+ --without-myspell-dicts
24
+ --disable-emscripten-proxy-to-pthread
25
+ --with-build-platform-configure-options=--enable-bogus-pkg-config
26
+ --disable-xmlhelp
27
+ --disable-curl
28
+ --without-webdav
29
+ --disable-libcmis
30
+ --disable-breakpad
31
+ --enable-lto
32
+ --with-galleries=no
33
+ --with-templates=no