@file-viewer/assets-ppt 3.1.2 → 3.2.1
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 +160 -0
- package/README.en.md +5 -1
- package/README.md +5 -1
- package/bin/install.mjs +0 -0
- package/package.json +24 -13
- package/viewer/THIRD_PARTY_LICENSES.assets.json +96 -0
- package/viewer/file-viewer-asset-pack.json +1 -1
- package/viewer/vendor/ppt/index.mjs +87 -7
- package/viewer/vendor/ppt/manifest.json +4 -4
- package/viewer/vendor/ppt/package.json +5 -1
- package/viewer/vendor/ppt/ppt-native.wasm +0 -0
- package/viewer/vendor/ppt/worker.mjs +85 -15
package/LICENSE
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction, and
|
|
10
|
+
distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by the copyright
|
|
13
|
+
owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all other entities
|
|
16
|
+
that control, are controlled by, or are under common control with that entity.
|
|
17
|
+
For the purposes of this definition, "control" means (i) the power, direct or
|
|
18
|
+
indirect, to cause the direction or management of such entity, whether by
|
|
19
|
+
contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
20
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
21
|
+
|
|
22
|
+
"You" (or "Your") shall mean an individual or Legal Entity exercising
|
|
23
|
+
permissions granted by this License.
|
|
24
|
+
|
|
25
|
+
"Source" form shall mean the preferred form for making modifications, including
|
|
26
|
+
but not limited to software source code, documentation source, and configuration
|
|
27
|
+
files.
|
|
28
|
+
|
|
29
|
+
"Object" form shall mean any form resulting from mechanical transformation or
|
|
30
|
+
translation of a Source form, including but not limited to compiled object code,
|
|
31
|
+
generated documentation, and conversions to other media types.
|
|
32
|
+
|
|
33
|
+
"Work" shall mean the work of authorship, whether in Source or Object form,
|
|
34
|
+
made available under the License, as indicated by a copyright notice that is
|
|
35
|
+
included in or attached to the work.
|
|
36
|
+
|
|
37
|
+
"Derivative Works" shall mean any work, whether in Source or Object form, that
|
|
38
|
+
is based on (or derived from) the Work and for which the editorial revisions,
|
|
39
|
+
annotations, elaborations, or other modifications represent, as a whole, an
|
|
40
|
+
original work of authorship. For the purposes of this License, Derivative Works
|
|
41
|
+
shall not include works that remain separable from, or merely link (or bind by
|
|
42
|
+
name) to the interfaces of, the Work and Derivative Works thereof.
|
|
43
|
+
|
|
44
|
+
"Contribution" shall mean any work of authorship, including the original version
|
|
45
|
+
of the Work and any modifications or additions to that Work or Derivative Works
|
|
46
|
+
thereof, that is intentionally submitted to Licensor for inclusion in the Work by
|
|
47
|
+
the copyright owner or by an individual or Legal Entity authorized to submit on
|
|
48
|
+
behalf of the copyright owner. For the purposes of this definition, "submitted"
|
|
49
|
+
means any form of electronic, verbal, or written communication sent to the
|
|
50
|
+
Licensor or its representatives, including but not limited to communication on
|
|
51
|
+
electronic mailing lists, source code control systems, and issue tracking systems
|
|
52
|
+
that are managed by, or on behalf of, the Licensor for the purpose of discussing
|
|
53
|
+
and improving the Work, but excluding communication that is conspicuously marked
|
|
54
|
+
or otherwise designated in writing by the copyright owner as "Not a
|
|
55
|
+
Contribution."
|
|
56
|
+
|
|
57
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
|
|
58
|
+
of whom a Contribution has been received by Licensor and subsequently
|
|
59
|
+
incorporated within the Work.
|
|
60
|
+
|
|
61
|
+
2. Grant of Copyright License. Subject to the terms and conditions of this
|
|
62
|
+
License, each Contributor hereby grants to You a perpetual, worldwide,
|
|
63
|
+
non-exclusive, no-charge, royalty-free, irrevocable copyright license to
|
|
64
|
+
reproduce, prepare Derivative Works of, publicly display, publicly perform,
|
|
65
|
+
sublicense, and distribute the Work and such Derivative Works in Source or
|
|
66
|
+
Object form.
|
|
67
|
+
|
|
68
|
+
3. Grant of Patent License. Subject to the terms and conditions of this License,
|
|
69
|
+
each Contributor hereby grants to You a perpetual, worldwide, non-exclusive,
|
|
70
|
+
no-charge, royalty-free, irrevocable (except as stated in this section) patent
|
|
71
|
+
license to make, have made, use, offer to sell, sell, import, and otherwise
|
|
72
|
+
transfer the Work, where such license applies only to those patent claims
|
|
73
|
+
licensable by such Contributor that are necessarily infringed by their
|
|
74
|
+
Contribution(s) alone or by combination of their Contribution(s) with the Work to
|
|
75
|
+
which such Contribution(s) was submitted. If You institute patent litigation
|
|
76
|
+
against any entity (including a cross-claim or counterclaim in a lawsuit)
|
|
77
|
+
alleging that the Work or a Contribution incorporated within the Work
|
|
78
|
+
constitutes direct or contributory patent infringement, then any patent licenses
|
|
79
|
+
granted to You under this License for that Work shall terminate as of the date
|
|
80
|
+
such litigation is filed.
|
|
81
|
+
|
|
82
|
+
4. Redistribution. You may reproduce and distribute copies of the Work or
|
|
83
|
+
Derivative Works thereof in any medium, with or without modifications, and in
|
|
84
|
+
Source or Object form, provided that You meet the following conditions:
|
|
85
|
+
|
|
86
|
+
(a) You must give any other recipients of the Work or Derivative Works a copy of
|
|
87
|
+
this License; and
|
|
88
|
+
|
|
89
|
+
(b) You must cause any modified files to carry prominent notices stating that
|
|
90
|
+
You changed the files; and
|
|
91
|
+
|
|
92
|
+
(c) You must retain, in the Source form of any Derivative Works that You
|
|
93
|
+
distribute, all copyright, patent, trademark, and attribution notices from the
|
|
94
|
+
Source form of the Work, excluding those notices that do not pertain to any part
|
|
95
|
+
of the Derivative Works; and
|
|
96
|
+
|
|
97
|
+
(d) If the Work includes a "NOTICE" text file as part of its distribution, then
|
|
98
|
+
any Derivative Works that You distribute must include a readable copy of the
|
|
99
|
+
attribution notices contained within such NOTICE file, excluding those notices
|
|
100
|
+
that do not pertain to any part of the Derivative Works, in at least one of the
|
|
101
|
+
following places: within a NOTICE text file distributed as part of the Derivative
|
|
102
|
+
Works; within the Source form or documentation, if provided along with the
|
|
103
|
+
Derivative Works; or, within a display generated by the Derivative Works, if and
|
|
104
|
+
wherever such third-party notices normally appear. The contents of the NOTICE
|
|
105
|
+
file are for informational purposes only and do not modify the License. You may
|
|
106
|
+
add Your own attribution notices within Derivative Works that You distribute,
|
|
107
|
+
alongside or as an addendum to the NOTICE text from the Work, provided that such
|
|
108
|
+
additional attribution notices cannot be construed as modifying the License.
|
|
109
|
+
|
|
110
|
+
You may add Your own copyright statement to Your modifications and may provide
|
|
111
|
+
additional or different license terms and conditions for use, reproduction, or
|
|
112
|
+
distribution of Your modifications, or for any such Derivative Works as a whole,
|
|
113
|
+
provided Your use, reproduction, and distribution of the Work otherwise complies
|
|
114
|
+
with the conditions stated in this License.
|
|
115
|
+
|
|
116
|
+
5. Submission of Contributions. Unless You explicitly state otherwise, any
|
|
117
|
+
Contribution intentionally submitted for inclusion in the Work by You to the
|
|
118
|
+
Licensor shall be under the terms and conditions of this License, without any
|
|
119
|
+
additional terms or conditions. Notwithstanding the above, nothing herein shall
|
|
120
|
+
supersede or modify the terms of any separate license agreement you may have
|
|
121
|
+
executed with Licensor regarding such Contributions.
|
|
122
|
+
|
|
123
|
+
6. Trademarks. This License does not grant permission to use the trade names,
|
|
124
|
+
trademarks, service marks, or product names of the Licensor, except as required
|
|
125
|
+
for reasonable and customary use in describing the origin of the Work and
|
|
126
|
+
reproducing the content of the NOTICE file.
|
|
127
|
+
|
|
128
|
+
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in
|
|
129
|
+
writing, Licensor provides the Work (and each Contributor provides its
|
|
130
|
+
Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
131
|
+
KIND, either express or implied, including, without limitation, any warranties or
|
|
132
|
+
conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
133
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
134
|
+
appropriateness of using or redistributing the Work and assume any risks
|
|
135
|
+
associated with Your exercise of permissions under this License.
|
|
136
|
+
|
|
137
|
+
8. Limitation of Liability. In no event and under no legal theory, whether in
|
|
138
|
+
tort (including negligence), contract, or otherwise, unless required by
|
|
139
|
+
applicable law (such as deliberate and grossly negligent acts) or agreed to in
|
|
140
|
+
writing, shall any Contributor be liable to You for damages, including any
|
|
141
|
+
direct, indirect, special, incidental, or consequential damages of any character
|
|
142
|
+
arising as a result of this License or out of the use or inability to use the
|
|
143
|
+
Work (including but not limited to damages for loss of goodwill, work stoppage,
|
|
144
|
+
computer failure or malfunction, or any and all other commercial damages or
|
|
145
|
+
losses), even if such Contributor has been advised of the possibility of such
|
|
146
|
+
damages.
|
|
147
|
+
|
|
148
|
+
9. Accepting Warranty or Additional Liability. While redistributing the Work or
|
|
149
|
+
Derivative Works thereof, You may choose to offer, and charge a fee for,
|
|
150
|
+
acceptance of support, warranty, indemnity, or other liability obligations and/or
|
|
151
|
+
rights consistent with this License. However, in accepting such obligations, You
|
|
152
|
+
may act only on Your own behalf and on Your sole responsibility, not on behalf of
|
|
153
|
+
any other Contributor, and only if You agree to indemnify, defend, and hold each
|
|
154
|
+
Contributor harmless for any liability incurred by, or claims asserted against,
|
|
155
|
+
such Contributor by reason of your accepting any such warranty or additional
|
|
156
|
+
liability.
|
|
157
|
+
|
|
158
|
+
END OF TERMS AND CONDITIONS
|
|
159
|
+
|
|
160
|
+
Copyright 2026 Flyfish Viewer
|
package/README.en.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
# @file-viewer/assets-ppt
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Runtime package version 3.2.1.
|
|
4
|
+
|
|
5
|
+
Usage and API documentation: https://doc.file-viewer.app/
|
|
6
|
+
|
|
7
|
+
The package's own license is Apache-2.0. Included third-party notices apply to their respective components.
|
package/README.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
# @file-viewer/assets-ppt
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Runtime package version 3.2.1.
|
|
4
|
+
|
|
5
|
+
Usage and API documentation: https://doc.file-viewer.app/
|
|
6
|
+
|
|
7
|
+
The package's own license is Apache-2.0. Included third-party notices apply to their respective components.
|
package/bin/install.mjs
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@file-viewer/assets-ppt",
|
|
3
|
-
"version": "3.1
|
|
3
|
+
"version": "3.2.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Independent self-hosted Legacy binary PowerPoint runtime for opt-in File Viewer integration.",
|
|
@@ -10,17 +10,28 @@
|
|
|
10
10
|
"./package.json": "./package.json"
|
|
11
11
|
},
|
|
12
12
|
"files": [
|
|
13
|
-
"bin",
|
|
14
|
-
"viewer",
|
|
13
|
+
"bin/install.mjs",
|
|
15
14
|
"file-viewer.asset-pack.json",
|
|
15
|
+
"LICENSE",
|
|
16
|
+
"README.en.md",
|
|
16
17
|
"README.md",
|
|
17
|
-
"
|
|
18
|
+
"viewer/file-viewer-asset-pack.json",
|
|
19
|
+
"viewer/THIRD_PARTY_LICENSES.assets.json",
|
|
20
|
+
"viewer/vendor/ppt/frame-cache.mjs",
|
|
21
|
+
"viewer/vendor/ppt/index.mjs",
|
|
22
|
+
"viewer/vendor/ppt/LICENSE",
|
|
23
|
+
"viewer/vendor/ppt/manifest.json",
|
|
24
|
+
"viewer/vendor/ppt/NOTICE",
|
|
25
|
+
"viewer/vendor/ppt/package.json",
|
|
26
|
+
"viewer/vendor/ppt/ppt-font-cjk.otf",
|
|
27
|
+
"viewer/vendor/ppt/ppt-native.wasm",
|
|
28
|
+
"viewer/vendor/ppt/worker.mjs"
|
|
18
29
|
],
|
|
19
30
|
"bin": {
|
|
20
31
|
"file-viewer-assets-ppt": "./bin/install.mjs"
|
|
21
32
|
},
|
|
22
33
|
"dependencies": {
|
|
23
|
-
"@file-viewer/asset-installer": "3.1
|
|
34
|
+
"@file-viewer/asset-installer": "3.2.1"
|
|
24
35
|
},
|
|
25
36
|
"engines": {
|
|
26
37
|
"node": ">=20"
|
|
@@ -31,14 +42,14 @@
|
|
|
31
42
|
},
|
|
32
43
|
"repository": {
|
|
33
44
|
"type": "git",
|
|
34
|
-
"url": "git+https://github.com/flyfish-dev/file-viewer.git"
|
|
35
|
-
"directory": "packages/tools/assets-ppt"
|
|
45
|
+
"url": "git+https://github.com/flyfish-dev/file-viewer.git"
|
|
36
46
|
},
|
|
37
47
|
"fileViewer": {
|
|
38
|
-
"assetPackManifest": "./file-viewer.asset-pack.json"
|
|
48
|
+
"assetPackManifest": "./file-viewer.asset-pack.json",
|
|
49
|
+
"distribution": {
|
|
50
|
+
"schemaVersion": 1,
|
|
51
|
+
"mode": "runtime-only"
|
|
52
|
+
}
|
|
39
53
|
},
|
|
40
|
-
"license": "Apache-2.0"
|
|
41
|
-
|
|
42
|
-
"stage-assets": "node ../../build-support/stage-capability-asset-pack.mjs --package-dir packages/tools/assets-ppt"
|
|
43
|
-
}
|
|
44
|
-
}
|
|
54
|
+
"license": "Apache-2.0"
|
|
55
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"purpose": "shared-runtime-material-attribution",
|
|
4
|
+
"scope": "Material identity and actual copied payloads; not a source-availability or release approval.",
|
|
5
|
+
"registrySha256": "d06cd1dfceaf3da9d1650c3f4f1967b9fb1d8bed734a7309adc700f11ccefbe0",
|
|
6
|
+
"releaseApproval": false,
|
|
7
|
+
"materials": [
|
|
8
|
+
{
|
|
9
|
+
"path": "vendor/ppt/LICENSE",
|
|
10
|
+
"sha256": "fa3378d3e005fc6096e9da42d7fd53ea3a9742315560271369e0d958af2764f6",
|
|
11
|
+
"bytes": 5970,
|
|
12
|
+
"kind": "original-proprietary-runtime-notice",
|
|
13
|
+
"component": "@file-viewer/ppt",
|
|
14
|
+
"declaredLicense": "LicenseRef-Flyfish-Public-Watermarked-Binary-v2",
|
|
15
|
+
"source": "Retained original public watermarked runtime grant",
|
|
16
|
+
"runtimePaths": [
|
|
17
|
+
"vendor/ppt/frame-cache.mjs",
|
|
18
|
+
"vendor/ppt/index.mjs",
|
|
19
|
+
"vendor/ppt/manifest.json",
|
|
20
|
+
"vendor/ppt/package.json",
|
|
21
|
+
"vendor/ppt/ppt-font-cjk.otf",
|
|
22
|
+
"vendor/ppt/ppt-native.wasm",
|
|
23
|
+
"vendor/ppt/worker.mjs"
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"path": "vendor/ppt/NOTICE",
|
|
28
|
+
"sha256": "6b57bc92d0cb360a1aee691a3374ccf722037422cbbec8693607cce5859eb2d4",
|
|
29
|
+
"bytes": 10493,
|
|
30
|
+
"kind": "original-proprietary-runtime-notice",
|
|
31
|
+
"component": "@file-viewer/ppt",
|
|
32
|
+
"declaredLicense": "LicenseRef-Flyfish-Public-Watermarked-Binary-v2",
|
|
33
|
+
"source": "Retained original public watermarked runtime grant",
|
|
34
|
+
"runtimePaths": [
|
|
35
|
+
"vendor/ppt/frame-cache.mjs",
|
|
36
|
+
"vendor/ppt/index.mjs",
|
|
37
|
+
"vendor/ppt/manifest.json",
|
|
38
|
+
"vendor/ppt/package.json",
|
|
39
|
+
"vendor/ppt/ppt-font-cjk.otf",
|
|
40
|
+
"vendor/ppt/ppt-native.wasm",
|
|
41
|
+
"vendor/ppt/worker.mjs"
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"runtimeFiles": [
|
|
46
|
+
{
|
|
47
|
+
"path": "vendor/ppt/frame-cache.mjs",
|
|
48
|
+
"bytes": 22038,
|
|
49
|
+
"sha256": "34fc0e7a5f328d52b55a7b616e45d7967555c6d3609e426b47f73f6d839ae411",
|
|
50
|
+
"sourceSha256": "34fc0e7a5f328d52b55a7b616e45d7967555c6d3609e426b47f73f6d839ae411",
|
|
51
|
+
"sourceTransform": "none"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"path": "vendor/ppt/index.mjs",
|
|
55
|
+
"bytes": 38973,
|
|
56
|
+
"sha256": "a1f52bce577b57546ac9a2f9a96d2d21c65980605f5c2182af1092b07c99e126",
|
|
57
|
+
"sourceSha256": "a1f52bce577b57546ac9a2f9a96d2d21c65980605f5c2182af1092b07c99e126",
|
|
58
|
+
"sourceTransform": "none"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"path": "vendor/ppt/manifest.json",
|
|
62
|
+
"bytes": 1656,
|
|
63
|
+
"sha256": "05193627f01227fc5fa45a15888f27288099dcd49e7b42ed92045225a5cc0dca",
|
|
64
|
+
"sourceSha256": "05193627f01227fc5fa45a15888f27288099dcd49e7b42ed92045225a5cc0dca",
|
|
65
|
+
"sourceTransform": "none"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"path": "vendor/ppt/package.json",
|
|
69
|
+
"bytes": 1348,
|
|
70
|
+
"sha256": "dd62e3e3ea70f05f29ae2e84ba6eb3800a5942356f8330034ef967774e81a3fd",
|
|
71
|
+
"sourceSha256": "dd62e3e3ea70f05f29ae2e84ba6eb3800a5942356f8330034ef967774e81a3fd",
|
|
72
|
+
"sourceTransform": "none"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"path": "vendor/ppt/ppt-font-cjk.otf",
|
|
76
|
+
"bytes": 16437364,
|
|
77
|
+
"sha256": "2c76254f6fc379fddfce0a7e84fb5385bb135d3e399294f6eeb6680d0365b74b",
|
|
78
|
+
"sourceSha256": "2c76254f6fc379fddfce0a7e84fb5385bb135d3e399294f6eeb6680d0365b74b",
|
|
79
|
+
"sourceTransform": "none"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"path": "vendor/ppt/ppt-native.wasm",
|
|
83
|
+
"bytes": 1555542,
|
|
84
|
+
"sha256": "00adf3b25554cb44000c7213eb4a8f86086ecb211dfef5306f524c2f29248c5d",
|
|
85
|
+
"sourceSha256": "00adf3b25554cb44000c7213eb4a8f86086ecb211dfef5306f524c2f29248c5d",
|
|
86
|
+
"sourceTransform": "none"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"path": "vendor/ppt/worker.mjs",
|
|
90
|
+
"bytes": 58449,
|
|
91
|
+
"sha256": "559f91d2727b44532ca99c1fda188fa7eaa365a3437596abe4e1bb0961c39724",
|
|
92
|
+
"sourceSha256": "559f91d2727b44532ca99c1fda188fa7eaa365a3437596abe4e1bb0961c39724",
|
|
93
|
+
"sourceTransform": "none"
|
|
94
|
+
}
|
|
95
|
+
]
|
|
96
|
+
}
|
|
@@ -1,4 +1,89 @@
|
|
|
1
|
-
|
|
1
|
+
// SHA-256 remains mandatory on ordinary HTTP origins, where browsers omit
|
|
2
|
+
// crypto.subtle. The portable path hashes the same bytes with the same digest;
|
|
3
|
+
// it never substitutes a length check or accepts an unverified asset.
|
|
4
|
+
const SHA256_INITIAL = new Uint32Array([
|
|
5
|
+
0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19
|
|
6
|
+
]);
|
|
7
|
+
const SHA256_ROUND = new Uint32Array([
|
|
8
|
+
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98,
|
|
9
|
+
0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786,
|
|
10
|
+
0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152, 0xa831c66d, 0xb00327c8,
|
|
11
|
+
0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,
|
|
12
|
+
0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819,
|
|
13
|
+
0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a,
|
|
14
|
+
0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7,
|
|
15
|
+
0xc67178f2
|
|
16
|
+
]);
|
|
17
|
+
const rotateRight = (value, bits) => (value >>> bits) | (value << (32 - bits));
|
|
18
|
+
|
|
19
|
+
function sha256HexPortable(input) {
|
|
20
|
+
const bytes = ArrayBuffer.isView(input)
|
|
21
|
+
? new Uint8Array(input.buffer, input.byteOffset, input.byteLength)
|
|
22
|
+
: new Uint8Array(input);
|
|
23
|
+
const state = SHA256_INITIAL.slice();
|
|
24
|
+
const words = new Uint32Array(64);
|
|
25
|
+
const block = new Uint8Array(64);
|
|
26
|
+
const view = new DataView(block.buffer);
|
|
27
|
+
const blockCount = Math.ceil((bytes.byteLength + 9) / 64);
|
|
28
|
+
for (let index = 0; index < blockCount; index++) {
|
|
29
|
+
const offset = index * 64;
|
|
30
|
+
block.fill(0);
|
|
31
|
+
block.set(bytes.subarray(offset, offset + 64));
|
|
32
|
+
if (offset <= bytes.byteLength && bytes.byteLength < offset + 64) {
|
|
33
|
+
block[bytes.byteLength - offset] = 0x80;
|
|
34
|
+
}
|
|
35
|
+
if (index === blockCount - 1) {
|
|
36
|
+
// The message length is encoded as an unsigned 64-bit count of bits.
|
|
37
|
+
view.setUint32(56, Math.floor(bytes.byteLength / 0x20000000));
|
|
38
|
+
view.setUint32(60, (bytes.byteLength * 8) >>> 0);
|
|
39
|
+
}
|
|
40
|
+
for (let i = 0; i < 16; i++) words[i] = view.getUint32(i * 4);
|
|
41
|
+
for (let i = 16; i < 64; i++) {
|
|
42
|
+
const x = words[i - 15],
|
|
43
|
+
y = words[i - 2];
|
|
44
|
+
const s0 = rotateRight(x, 7) ^ rotateRight(x, 18) ^ (x >>> 3);
|
|
45
|
+
const s1 = rotateRight(y, 17) ^ rotateRight(y, 19) ^ (y >>> 10);
|
|
46
|
+
words[i] = (words[i - 16] + s0 + words[i - 7] + s1) >>> 0;
|
|
47
|
+
}
|
|
48
|
+
// Keep the mandatory HTTP fallback free of per-block iterator allocations.
|
|
49
|
+
let a = state[0], b = state[1], c = state[2], d = state[3];
|
|
50
|
+
let e = state[4], f = state[5], g = state[6], h = state[7];
|
|
51
|
+
for (let i = 0; i < 64; i++) {
|
|
52
|
+
const s1 = rotateRight(e, 6) ^ rotateRight(e, 11) ^ rotateRight(e, 25);
|
|
53
|
+
const choice = (e & f) ^ (~e & g);
|
|
54
|
+
const t1 = (h + s1 + choice + SHA256_ROUND[i] + words[i]) >>> 0;
|
|
55
|
+
const s0 = rotateRight(a, 2) ^ rotateRight(a, 13) ^ rotateRight(a, 22);
|
|
56
|
+
const majority = (a & b) ^ (a & c) ^ (b & c);
|
|
57
|
+
const t2 = (s0 + majority) >>> 0;
|
|
58
|
+
h = g;
|
|
59
|
+
g = f;
|
|
60
|
+
f = e;
|
|
61
|
+
e = (d + t1) >>> 0;
|
|
62
|
+
d = c;
|
|
63
|
+
c = b;
|
|
64
|
+
b = a;
|
|
65
|
+
a = (t1 + t2) >>> 0;
|
|
66
|
+
}
|
|
67
|
+
state[0] = (state[0] + a) >>> 0;
|
|
68
|
+
state[1] = (state[1] + b) >>> 0;
|
|
69
|
+
state[2] = (state[2] + c) >>> 0;
|
|
70
|
+
state[3] = (state[3] + d) >>> 0;
|
|
71
|
+
state[4] = (state[4] + e) >>> 0;
|
|
72
|
+
state[5] = (state[5] + f) >>> 0;
|
|
73
|
+
state[6] = (state[6] + g) >>> 0;
|
|
74
|
+
state[7] = (state[7] + h) >>> 0;
|
|
75
|
+
}
|
|
76
|
+
return Array.from(state, (word) => word.toString(16).padStart(8, '0')).join('');
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
async function sha256Hex(bytes) {
|
|
80
|
+
const subtle = globalThis.crypto?.subtle;
|
|
81
|
+
if (!subtle || typeof subtle.digest !== 'function') return sha256HexPortable(bytes);
|
|
82
|
+
const digest = new Uint8Array(await subtle.digest('SHA-256', bytes));
|
|
83
|
+
return Array.from(digest, (byte) => byte.toString(16).padStart(2, '0')).join('');
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const MANIFEST = Object.freeze({"kind":"flyfish-ppt-public-native-wasm-v2","product":"Flyfish PPT Viewer","format":"PowerPoint 97-2003 (.ppt)","packageName":"@file-viewer/ppt","packageVersion":"0.3.6","engine":"flyfish-classic-ppt-native-engine","engineBuild":"c8c5f419b9ec85db","id":"FV-PPT-PUBLIC-WATERMARKED-V2","feature":"ppt","edition":"public-watermarked","holder":"Individuals and Organizations","distribution":"proprietary-public-binary","commercialUse":true,"publicAnyOrigin":true,"watermarkRequired":true,"watermarkText":"Flyfish Viewer","usePolicy":"public-watermarked-general-use","licensePolicy":"flyfish-public-watermarked-binary-license-v2","sourceCodeRights":false,"sourceDeliveryRights":false,"apacheLicenseApplies":false,"redistributionAllowed":true,"redistributionPolicy":"unmodified-integrated-bundling-only","standaloneRedistributionAllowed":false,"watermarkRemovalRequiresCommercialAuthorization":true,"runtimeLicenseRequired":false,"renderer":"native-wasm-worker-offscreen-canvas","integrity":"native-wasm-font-sha256-v2","wasmFile":"ppt-native.wasm","wasmBytes":1555542,"workerFile":"worker.mjs","fontPack":{"kind":"flyfish-cjk-font-pack-v1","file":"ppt-font-cjk.otf","bytes":16437364,"sha256":"2c76254f6fc379fddfce0a7e84fb5385bb135d3e399294f6eeb6680d0365b74b"},"workerDefault":true,"virtualScrollDefault":true,"frameCache":"indexeddb-final-watermarked-png-lru","watermarkEnforcement":"native-final-frame","wasmSha256":"00adf3b25554cb44000c7213eb4a8f86086ecb211dfef5306f524c2f29248c5d"});
|
|
2
87
|
const DEFAULT_WASM_URL = new URL('./ppt-native.wasm', import.meta.url);
|
|
3
88
|
// Keep asset paths literal so bundlers do not scan declarations as URL assets.
|
|
4
89
|
const DEFAULT_FONT_URL = new URL('./ppt-font-cjk.otf', import.meta.url);
|
|
@@ -382,12 +467,7 @@ function exactAsset(bytes, expectedBytes, label) {
|
|
|
382
467
|
}
|
|
383
468
|
|
|
384
469
|
async function verifySha256(bytes, expected, code, message) {
|
|
385
|
-
const
|
|
386
|
-
if (!subtle || typeof subtle.digest !== 'function') {
|
|
387
|
-
throw packageError('asset-integrity-unavailable', 'Web Crypto SHA-256 support is required to verify protected viewer assets.');
|
|
388
|
-
}
|
|
389
|
-
const digest = new Uint8Array(await subtle.digest('SHA-256', bytes));
|
|
390
|
-
const actual = Array.from(digest, (byte) => byte.toString(16).padStart(2, '0')).join('');
|
|
470
|
+
const actual = await sha256Hex(bytes);
|
|
391
471
|
if (actual !== expected) throw packageError(code, message);
|
|
392
472
|
}
|
|
393
473
|
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
"product": "Flyfish PPT Viewer",
|
|
4
4
|
"format": "PowerPoint 97-2003 (.ppt)",
|
|
5
5
|
"packageName": "@file-viewer/ppt",
|
|
6
|
-
"packageVersion": "0.3.
|
|
6
|
+
"packageVersion": "0.3.6",
|
|
7
7
|
"engine": "flyfish-classic-ppt-native-engine",
|
|
8
|
-
"engineBuild": "
|
|
8
|
+
"engineBuild": "c8c5f419b9ec85db",
|
|
9
9
|
"id": "FV-PPT-PUBLIC-WATERMARKED-V2",
|
|
10
10
|
"feature": "ppt",
|
|
11
11
|
"edition": "public-watermarked",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"renderer": "native-wasm-worker-offscreen-canvas",
|
|
29
29
|
"integrity": "native-wasm-font-sha256-v2",
|
|
30
30
|
"wasmFile": "ppt-native.wasm",
|
|
31
|
-
"wasmBytes":
|
|
31
|
+
"wasmBytes": 1555542,
|
|
32
32
|
"workerFile": "worker.mjs",
|
|
33
33
|
"fontPack": {
|
|
34
34
|
"kind": "flyfish-cjk-font-pack-v1",
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"virtualScrollDefault": true,
|
|
41
41
|
"frameCache": "indexeddb-final-watermarked-png-lru",
|
|
42
42
|
"watermarkEnforcement": "native-final-frame",
|
|
43
|
-
"wasmSha256": "
|
|
43
|
+
"wasmSha256": "00adf3b25554cb44000c7213eb4a8f86086ecb211dfef5306f524c2f29248c5d"
|
|
44
44
|
}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@file-viewer/ppt",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.6",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "git+https://github.com/flyfish-dev/pptjs.git"
|
|
7
|
+
},
|
|
4
8
|
"description": "Professional native WebAssembly canvas viewer for PowerPoint 97-2003 (.ppt) files.",
|
|
5
9
|
"type": "module",
|
|
6
10
|
"main": "./index.mjs",
|
|
Binary file
|
|
@@ -730,6 +730,91 @@ function createFrameCache(options = {}) {
|
|
|
730
730
|
});
|
|
731
731
|
}
|
|
732
732
|
|
|
733
|
+
// SHA-256 remains mandatory on ordinary HTTP origins, where browsers omit
|
|
734
|
+
// crypto.subtle. The portable path hashes the same bytes with the same digest;
|
|
735
|
+
// it never substitutes a length check or accepts an unverified asset.
|
|
736
|
+
const SHA256_INITIAL = new Uint32Array([
|
|
737
|
+
0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19
|
|
738
|
+
]);
|
|
739
|
+
const SHA256_ROUND = new Uint32Array([
|
|
740
|
+
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98,
|
|
741
|
+
0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786,
|
|
742
|
+
0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152, 0xa831c66d, 0xb00327c8,
|
|
743
|
+
0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,
|
|
744
|
+
0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819,
|
|
745
|
+
0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a,
|
|
746
|
+
0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7,
|
|
747
|
+
0xc67178f2
|
|
748
|
+
]);
|
|
749
|
+
const rotateRight = (value, bits) => (value >>> bits) | (value << (32 - bits));
|
|
750
|
+
|
|
751
|
+
function sha256HexPortable(input) {
|
|
752
|
+
const bytes = ArrayBuffer.isView(input)
|
|
753
|
+
? new Uint8Array(input.buffer, input.byteOffset, input.byteLength)
|
|
754
|
+
: new Uint8Array(input);
|
|
755
|
+
const state = SHA256_INITIAL.slice();
|
|
756
|
+
const words = new Uint32Array(64);
|
|
757
|
+
const block = new Uint8Array(64);
|
|
758
|
+
const view = new DataView(block.buffer);
|
|
759
|
+
const blockCount = Math.ceil((bytes.byteLength + 9) / 64);
|
|
760
|
+
for (let index = 0; index < blockCount; index++) {
|
|
761
|
+
const offset = index * 64;
|
|
762
|
+
block.fill(0);
|
|
763
|
+
block.set(bytes.subarray(offset, offset + 64));
|
|
764
|
+
if (offset <= bytes.byteLength && bytes.byteLength < offset + 64) {
|
|
765
|
+
block[bytes.byteLength - offset] = 0x80;
|
|
766
|
+
}
|
|
767
|
+
if (index === blockCount - 1) {
|
|
768
|
+
// The message length is encoded as an unsigned 64-bit count of bits.
|
|
769
|
+
view.setUint32(56, Math.floor(bytes.byteLength / 0x20000000));
|
|
770
|
+
view.setUint32(60, (bytes.byteLength * 8) >>> 0);
|
|
771
|
+
}
|
|
772
|
+
for (let i = 0; i < 16; i++) words[i] = view.getUint32(i * 4);
|
|
773
|
+
for (let i = 16; i < 64; i++) {
|
|
774
|
+
const x = words[i - 15],
|
|
775
|
+
y = words[i - 2];
|
|
776
|
+
const s0 = rotateRight(x, 7) ^ rotateRight(x, 18) ^ (x >>> 3);
|
|
777
|
+
const s1 = rotateRight(y, 17) ^ rotateRight(y, 19) ^ (y >>> 10);
|
|
778
|
+
words[i] = (words[i - 16] + s0 + words[i - 7] + s1) >>> 0;
|
|
779
|
+
}
|
|
780
|
+
// Keep the mandatory HTTP fallback free of per-block iterator allocations.
|
|
781
|
+
let a = state[0], b = state[1], c = state[2], d = state[3];
|
|
782
|
+
let e = state[4], f = state[5], g = state[6], h = state[7];
|
|
783
|
+
for (let i = 0; i < 64; i++) {
|
|
784
|
+
const s1 = rotateRight(e, 6) ^ rotateRight(e, 11) ^ rotateRight(e, 25);
|
|
785
|
+
const choice = (e & f) ^ (~e & g);
|
|
786
|
+
const t1 = (h + s1 + choice + SHA256_ROUND[i] + words[i]) >>> 0;
|
|
787
|
+
const s0 = rotateRight(a, 2) ^ rotateRight(a, 13) ^ rotateRight(a, 22);
|
|
788
|
+
const majority = (a & b) ^ (a & c) ^ (b & c);
|
|
789
|
+
const t2 = (s0 + majority) >>> 0;
|
|
790
|
+
h = g;
|
|
791
|
+
g = f;
|
|
792
|
+
f = e;
|
|
793
|
+
e = (d + t1) >>> 0;
|
|
794
|
+
d = c;
|
|
795
|
+
c = b;
|
|
796
|
+
b = a;
|
|
797
|
+
a = (t1 + t2) >>> 0;
|
|
798
|
+
}
|
|
799
|
+
state[0] = (state[0] + a) >>> 0;
|
|
800
|
+
state[1] = (state[1] + b) >>> 0;
|
|
801
|
+
state[2] = (state[2] + c) >>> 0;
|
|
802
|
+
state[3] = (state[3] + d) >>> 0;
|
|
803
|
+
state[4] = (state[4] + e) >>> 0;
|
|
804
|
+
state[5] = (state[5] + f) >>> 0;
|
|
805
|
+
state[6] = (state[6] + g) >>> 0;
|
|
806
|
+
state[7] = (state[7] + h) >>> 0;
|
|
807
|
+
}
|
|
808
|
+
return Array.from(state, (word) => word.toString(16).padStart(8, '0')).join('');
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
async function sha256Hex(bytes) {
|
|
812
|
+
const subtle = globalThis.crypto?.subtle;
|
|
813
|
+
if (!subtle || typeof subtle.digest !== 'function') return sha256HexPortable(bytes);
|
|
814
|
+
const digest = new Uint8Array(await subtle.digest('SHA-256', bytes));
|
|
815
|
+
return Array.from(digest, (byte) => byte.toString(16).padStart(2, '0')).join('');
|
|
816
|
+
}
|
|
817
|
+
|
|
733
818
|
const WASM_EXPORTS = Object.freeze([
|
|
734
819
|
'memory',
|
|
735
820
|
'ppt_input_alloc',
|
|
@@ -883,7 +968,6 @@ async function initialize(request) {
|
|
|
883
968
|
const wasmUrl = normalizeAssetUrl(request.message.wasmUrl, 'wasmUrl');
|
|
884
969
|
const fontUrl = normalizeAssetUrl(request.message.fontUrl, 'fontUrl');
|
|
885
970
|
const cacheOptions = normalizeCacheOptions(request.message.cacheOptions);
|
|
886
|
-
requireWebCrypto();
|
|
887
971
|
|
|
888
972
|
const controller = new AbortController();
|
|
889
973
|
activeAbortControllers.add(controller);
|
|
@@ -1585,20 +1669,6 @@ async function safeCacheStats(cache) {
|
|
|
1585
1669
|
}
|
|
1586
1670
|
}
|
|
1587
1671
|
|
|
1588
|
-
async function sha256Hex(bytes) {
|
|
1589
|
-
const subtle = requireWebCrypto();
|
|
1590
|
-
const digest = new Uint8Array(await subtle.digest('SHA-256', bytes));
|
|
1591
|
-
return Array.from(digest, (byte) => byte.toString(16).padStart(2, '0')).join('');
|
|
1592
|
-
}
|
|
1593
|
-
|
|
1594
|
-
function requireWebCrypto() {
|
|
1595
|
-
const subtle = globalThis.crypto?.subtle;
|
|
1596
|
-
if (!subtle || typeof subtle.digest !== 'function') {
|
|
1597
|
-
throw workerError('web-crypto-unavailable', 'Web Crypto SHA-256 support is required in the PPT Worker.');
|
|
1598
|
-
}
|
|
1599
|
-
return subtle;
|
|
1600
|
-
}
|
|
1601
|
-
|
|
1602
1672
|
function engineError(api, fallback) {
|
|
1603
1673
|
const nativeCode = Number(api.ppt_last_error_code()) || 0;
|
|
1604
1674
|
return workerError(`native-${nativeCode || 'unknown'}`, `${fallback} (native error ${nativeCode || 'unknown'})`);
|