@sqsoffice/slide 0.0.0-stage → 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/LICENSE +202 -0
- package/README.md +81 -2
- package/dist/THIRD-PARTY-NOTICES.txt +19871 -0
- package/dist/api-CLyi4j4N.js +4030 -0
- package/dist/api.js +1 -0
- package/dist/assets/engine/files-worker.js +1 -0
- package/dist/assets/engine/host-artifact-jgAXg8CH.js +1 -0
- package/dist/assets/engine/host-load-wasm-DyYR5qIL.js +1 -0
- package/dist/assets/engine/host-manifest.json +42 -0
- package/dist/assets/engine/host-pdf-import-BOPMPpUS.js +1 -0
- package/dist/assets/engine/host.js +1 -0
- package/dist/assets/engine/manifest.json +66 -0
- package/dist/assets/engine/office_web.js +1491 -0
- package/dist/assets/engine/office_web_bg.wasm +4 -0
- package/dist/assets/engine/worker.js +1 -0
- package/dist/assets/fonts/source-han-sans/2.005/LICENSE.txt +96 -0
- package/dist/assets/fonts/source-han-sans/2.005/SourceHanSansCN-Bold.otf +0 -0
- package/dist/assets/fonts/source-han-sans/2.005/SourceHanSansCN-Regular.otf +0 -0
- package/dist/assets/fonts/source-han-sans/2.005/manifest.json +20 -0
- package/dist/index.js +835 -0
- package/dist/package-manifest.json +181 -0
- package/dist/style.css +2 -0
- package/dist/types/app/lib/automation/protocol.d.ts +25 -0
- package/dist/types/app/lib/engine/client.d.ts +129 -0
- package/dist/types/app/lib/engine/docx.d.ts +67 -0
- package/dist/types/app/lib/engine/grid.d.ts +330 -0
- package/dist/types/app/lib/engine/image.d.ts +15 -0
- package/dist/types/app/lib/engine/markdown.d.ts +220 -0
- package/dist/types/app/lib/engine/pdf-import.d.ts +18 -0
- package/dist/types/app/lib/engine/pdf-ocr.d.ts +70 -0
- package/dist/types/app/lib/engine/pdf-output.d.ts +22 -0
- package/dist/types/app/lib/engine/pdf.d.ts +191 -0
- package/dist/types/app/lib/engine/presentation-clipboard.d.ts +26 -0
- package/dist/types/app/lib/engine/presentation-media.d.ts +156 -0
- package/dist/types/app/lib/engine/presentation.d.ts +145 -0
- package/dist/types/app/lib/engine/printing.d.ts +91 -0
- package/dist/types/app/lib/engine/protocol.d.ts +233 -0
- package/dist/types/app/lib/engine/script.d.ts +46 -0
- package/dist/types/app/lib/engine/sheet-clipboard.d.ts +42 -0
- package/dist/types/app/lib/engine/sheet-validation.d.ts +19 -0
- package/dist/types/app/lib/engine/view.d.ts +186 -0
- package/dist/types/app/lib/files/session.d.ts +114 -0
- package/dist/types/app/lib/files/storage.d.ts +20 -0
- package/dist/types/packages/slide/api.d.ts +4 -0
- package/dist/types/packages/slide/index.d.ts +5 -0
- package/dist/types/sdk/types.d.ts +59 -0
- package/package.json +40 -3
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sqsoffice/slide",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"sourceRevision": "b9acd6c69df2ad490ef5baa4ce3302fc4e1752ed",
|
|
5
|
+
"sourceDirty": true,
|
|
6
|
+
"engine": "c182d83d10da462eff8724414923687db14338d0adf1c9f2161fa2e7e7747caa",
|
|
7
|
+
"files": [
|
|
8
|
+
{
|
|
9
|
+
"file": "api-CLyi4j4N.js",
|
|
10
|
+
"sha256": "872ad0d17568038d57e7714a8814a41b1f04ba55b1b905474952fce4876f4f7d"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"file": "api.js",
|
|
14
|
+
"sha256": "65ed78ac87594446a89a6f102847b1eebe270510f49fa1ce2ee3549a71c04ecf"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"file": "assets/engine/files-worker.js",
|
|
18
|
+
"sha256": "300b2dc530ccff98aae0d84a6738ee69760a1bfdd364b5f824227cfd137c014b"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"file": "assets/engine/host-artifact-jgAXg8CH.js",
|
|
22
|
+
"sha256": "2fb78e3d16c3e99a7e5c966d99414961f0a6703521bbbf6a88bc504497ea841a"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"file": "assets/engine/host-load-wasm-DyYR5qIL.js",
|
|
26
|
+
"sha256": "ba13a72ba42b390d87c1b8696e11fe5adb78daf22d3b5ff7b9c89ac0c9088e90"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"file": "assets/engine/host-manifest.json",
|
|
30
|
+
"sha256": "1694a4c8831d359d540cb6479be4ad77c2e0c557619fce2858863ddf2d4ba87c"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"file": "assets/engine/host-pdf-import-BOPMPpUS.js",
|
|
34
|
+
"sha256": "5ad81514525f55ec4ad7e9edca011dd2006b327e873c4aa317f92898b507accf"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"file": "assets/engine/host.js",
|
|
38
|
+
"sha256": "be7bc31d207e0bfa81a28ad924a150c3880f8a60a77f5a5221031b12735a622f"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"file": "assets/engine/manifest.json",
|
|
42
|
+
"sha256": "4846a2977a7b68551846b506e1cd3f02ee4488adc69cc4e200d6541c480f3345"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"file": "assets/engine/office_web.js",
|
|
46
|
+
"sha256": "e3a0c0a7608615e2faeaf582bd0b6c6273fb23130a104e7e248dd55d011898de"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"file": "assets/engine/office_web_bg.wasm",
|
|
50
|
+
"sha256": "c182d83d10da462eff8724414923687db14338d0adf1c9f2161fa2e7e7747caa"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"file": "assets/engine/worker.js",
|
|
54
|
+
"sha256": "4205db8d72d960896567ff1beaf8ccef484f21bfdb2f09e5c671c319fba5c3b5"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"file": "assets/fonts/source-han-sans/2.005/LICENSE.txt",
|
|
58
|
+
"sha256": "fcac737e761ec63dbfbdce11030a1780161920d80315edba9c8beff1c2bac5a2"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"file": "assets/fonts/source-han-sans/2.005/manifest.json",
|
|
62
|
+
"sha256": "888013aaaaed165b6b7e39f504b5cd278f486f0a83e9a1841e015991edbf9625"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"file": "assets/fonts/source-han-sans/2.005/SourceHanSansCN-Bold.otf",
|
|
66
|
+
"sha256": "62383707c086a32f3afd5e293f34c7eff64c7fea31f579fdc6cbe34d920519a6"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"file": "assets/fonts/source-han-sans/2.005/SourceHanSansCN-Regular.otf",
|
|
70
|
+
"sha256": "e2bc8a2e7f37474b774fff8db758681ece40bb6947a90d571bce9dd60671a8e4"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"file": "index.js",
|
|
74
|
+
"sha256": "4e2f1a03bd8cfe267ff899e56a0fd9d07f0b95e54629f328d25250d057c1ec77"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"file": "style.css",
|
|
78
|
+
"sha256": "09a2d44771cf968c70596ff3f088f0d56d0dbb2e8011a5afbb6dc0e98febab45"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"file": "THIRD-PARTY-NOTICES.txt",
|
|
82
|
+
"sha256": "48b3e6060e05bd2f9305eab37ac431a53bff2dfe9400732789bfe7a60dc8f984"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"file": "types/app/lib/automation/protocol.d.ts",
|
|
86
|
+
"sha256": "2f547b3b9744fcb5636d02e54d79789ac8edbb1c2150693c1c998571ef13dff5"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"file": "types/app/lib/engine/client.d.ts",
|
|
90
|
+
"sha256": "2c0e892afb77f7f43130173ad630324076789251776571aca3452d6d0399239a"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"file": "types/app/lib/engine/docx.d.ts",
|
|
94
|
+
"sha256": "e94c343799f5d43ef77489685e8f773616bb7c8012fbce9bc85a51238cd9c119"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"file": "types/app/lib/engine/grid.d.ts",
|
|
98
|
+
"sha256": "fdad56110e5a31d9dcad8a065a68391d1475e142207ed7d2816d5834499cb54a"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"file": "types/app/lib/engine/image.d.ts",
|
|
102
|
+
"sha256": "d3091be6be86f83f63220a6eb5525d602bc4c30e1c52bf43df7b70328c058e7c"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"file": "types/app/lib/engine/markdown.d.ts",
|
|
106
|
+
"sha256": "d697720edfcf2d533871120e12f4096aea47954b9e6ade64380541622b7b778f"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"file": "types/app/lib/engine/pdf-import.d.ts",
|
|
110
|
+
"sha256": "89ab3f9ed2609cb138cf5f20a1f07ab42a27117c1697bc640e67bd77c4c73a5c"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"file": "types/app/lib/engine/pdf-ocr.d.ts",
|
|
114
|
+
"sha256": "87934803aab898ab158b7924429328a9bafee0f91b97091bf2ba6213c1fe815d"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"file": "types/app/lib/engine/pdf-output.d.ts",
|
|
118
|
+
"sha256": "7c06ccc3ef1feadeacbbf60503c34bd92600e43ca7abff72d01c0c2b0d102d5b"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"file": "types/app/lib/engine/pdf.d.ts",
|
|
122
|
+
"sha256": "ce322074435acb1fff68985ff3b38518fc7b643ca52b5cbe29b9be32437a6151"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"file": "types/app/lib/engine/presentation-clipboard.d.ts",
|
|
126
|
+
"sha256": "623eebadee4cacf77ba5da2ec0469b401b01b3e9585b16017cc9ef057841dd20"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"file": "types/app/lib/engine/presentation-media.d.ts",
|
|
130
|
+
"sha256": "0d689a76b8ece073ca347891cb8c989585c6997914e7fec2b1552691e7b7564b"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"file": "types/app/lib/engine/presentation.d.ts",
|
|
134
|
+
"sha256": "31189316d08a9d1ac16d9d3f0aec102224a863dff8a3cce203ea1d601a340f74"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"file": "types/app/lib/engine/printing.d.ts",
|
|
138
|
+
"sha256": "0b38c74c2854b63bb37ce681bc3725b447d8b5399c1f8e521e3a18dddb87cd42"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"file": "types/app/lib/engine/protocol.d.ts",
|
|
142
|
+
"sha256": "e16b34d31421ac67ed4608c57ba665e1a01f8fb27a52b647afc92bc0e33f5414"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"file": "types/app/lib/engine/script.d.ts",
|
|
146
|
+
"sha256": "359218b55d73adfd4c24ea03ade8901b88aa1a22705274858aaf414c4f326e6d"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"file": "types/app/lib/engine/sheet-clipboard.d.ts",
|
|
150
|
+
"sha256": "9164194c613648d5f1db9d311c10d35e748ea5b7e20bcf2c2ff8355868e7839e"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"file": "types/app/lib/engine/sheet-validation.d.ts",
|
|
154
|
+
"sha256": "36981b1fefee5b85c6242fcdcf6446be75b297a612d67e21e24abe10d65a7f4e"
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"file": "types/app/lib/engine/view.d.ts",
|
|
158
|
+
"sha256": "82f852ea87b24e011c5d2267f4e2c42663e945cc8d5e48d74ac731ca52801ec3"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"file": "types/app/lib/files/session.d.ts",
|
|
162
|
+
"sha256": "4819263c9e0436739b6e7e5ff2cb701bb7c70e8896b5f1e24eaf76e4a453393c"
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"file": "types/app/lib/files/storage.d.ts",
|
|
166
|
+
"sha256": "0ef5fb8448987a2e45dd5596ad685b0bf6a4964162fc473e979158bf49aa6c4b"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"file": "types/packages/slide/api.d.ts",
|
|
170
|
+
"sha256": "f6ca78bc490287e52e370fec34cb2a92c6f8128618ef84c13a20fb390f9eccc0"
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"file": "types/packages/slide/index.d.ts",
|
|
174
|
+
"sha256": "c6244a3f7fbb58d4f5508ab6d95b3daf9b0953900b6fd36c9b41404b64b0ae90"
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
"file": "types/sdk/types.d.ts",
|
|
178
|
+
"sha256": "c6f240eb95ac7186acfe2abd78398f2fa25ac3e7d05632a2ef20dc387e2ef6d7"
|
|
179
|
+
}
|
|
180
|
+
]
|
|
181
|
+
}
|
package/dist/style.css
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
.office-viewer[data-v-6d5a4ba8]{color:#293b33;background:#eef1ee;flex-direction:column;width:100%;min-width:280px;height:100%;min-height:320px;font:14px/1.5 Segoe UI,PingFang SC,Microsoft YaHei,sans-serif;display:flex;position:relative;overflow:hidden}.office-viewer[data-v-6d5a4ba8] *,.office-viewer[data-v-6d5a4ba8] :before,.office-viewer[data-v-6d5a4ba8] :after{box-sizing:border-box}button[data-v-6d5a4ba8],input[data-v-6d5a4ba8],select[data-v-6d5a4ba8]{font:inherit;color:inherit}button[data-v-6d5a4ba8]{cursor:pointer;background:0 0;border:1px solid #0000;border-radius:5px;justify-content:center;align-items:center;min-height:32px;padding:6px;display:inline-flex}button[data-v-6d5a4ba8]:hover:not(:disabled){background:#e7ede8}button[data-v-6d5a4ba8]:focus-visible,input[data-v-6d5a4ba8]:focus-visible,select[data-v-6d5a4ba8]:focus-visible{outline-offset:2px;outline:2px solid #2563eb}button[data-v-6d5a4ba8]:disabled{opacity:.4;cursor:default}.viewer-toolbar[data-v-6d5a4ba8]{background:#fff;border-bottom:1px solid #d9e2dc;flex-wrap:wrap;align-items:center;gap:5px;padding:7px 10px;display:flex}.file-input[data-v-6d5a4ba8]{display:none}.file-name[data-v-6d5a4ba8]{white-space:nowrap;text-overflow:ellipsis;flex:100px;font-weight:500;overflow:hidden}.readonly-label[data-v-6d5a4ba8]{color:#577060;background:#edf3ee;border-radius:4px;padding:1px 6px;font-size:12px}.page-count[data-v-6d5a4ba8]{text-align:center;white-space:nowrap;min-width:48px}.zoom[data-v-6d5a4ba8]{text-align:center;width:42px}.viewer-error[data-v-6d5a4ba8]{color:#a63d2f;background:#fff0e9;justify-content:space-between;align-items:center;padding:5px 12px;display:flex}.viewer-viewport[data-v-6d5a4ba8]{overscroll-behavior:contain;flex:1;min-height:0;overflow:auto}.viewer-stage[data-v-6d5a4ba8]{position:relative}.viewer-page[data-v-6d5a4ba8]{background:#fff;outline:1px solid #d9e2dc;position:absolute;box-shadow:0 3px 16px #1b302211}.viewer-grid[data-v-6d5a4ba8]{box-shadow:none;outline:none}.viewer-page[data-v-6d5a4ba8] canvas{pointer-events:none;position:absolute}.viewer-empty[data-v-6d5a4ba8]{color:#718176;place-content:center;min-height:100%;padding:32px;display:grid}.viewer-footer[data-v-6d5a4ba8]{color:#65786c;background:#fff;border-top:1px solid #d9e2dc;justify-content:space-between;align-items:center;gap:12px;padding:5px 12px;font-size:12px;display:flex}.viewer-footer label[data-v-6d5a4ba8]{align-items:center;gap:8px;display:flex}.viewer-footer select[data-v-6d5a4ba8]{background:#fff;border:1px solid #d0d9d2;border-radius:4px;max-width:240px;padding:3px 6px}.viewer-prompt-backdrop[data-v-6d5a4ba8]{z-index:10;background:#162c2459;place-items:center;padding:20px;display:grid;position:absolute;inset:0}.viewer-prompt[data-v-6d5a4ba8]{background:#fff;border-radius:9px;width:min(360px,100%);padding:20px;box-shadow:0 12px 60px #18352530}.viewer-prompt strong[data-v-6d5a4ba8]{align-items:center;gap:8px;display:flex}.viewer-prompt p[data-v-6d5a4ba8]{overflow-wrap:anywhere}.viewer-prompt input[data-v-6d5a4ba8]{border:1px solid #cbd6cc;border-radius:4px;width:100%;padding:8px}.prompt-actions[data-v-6d5a4ba8]{justify-content:flex-end;gap:8px;margin-top:18px;display:flex}.prompt-actions button[data-v-6d5a4ba8]{border-color:#cbd6cc;padding:5px 12px}.sqsoffice{--blue:#2563eb;--blue-dark:#1d4ed8;--forest:#1f4036;--forest-light:#496b59;--sage:#8da68f;--ink:#293b33;--muted:#66736a;--line:#d9ded5;--canvas:#f5f3ed;--gold:#b09a70;--font:"Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;width:100%;min-width:0;height:100%;min-height:240px;font-family:var(--font);color:var(--ink);--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;background:var(--canvas);font-size:14px;line-height:1.5;position:relative;overflow:hidden}.sqsoffice *,.sqsoffice :before,.sqsoffice :after{box-sizing:border-box}.sqsoffice button,.sqsoffice input,.sqsoffice textarea,.sqsoffice select{font:inherit}.sqsoffice button{cursor:pointer;color:inherit}.sqsoffice button:disabled{cursor:not-allowed;opacity:.5}.sqsoffice svg{flex-shrink:0}.sqsoffice a{color:inherit}.office-menu-trigger{color:#38513f;white-space:nowrap;background:#fffef9;border:1px solid #dce3d6;border-radius:6px;flex:none;align-items:center;gap:7px;min-height:32px;padding:5px 9px;font-size:12px;display:inline-flex}.office-menu-trigger[aria-expanded=true]{background:#e7eedf}.office-action-menu[role=menu]{background:#fffefb;border:1px solid #d8e0d3;border-radius:9px;min-width:190px;max-width:calc(100vw - 20px);padding:5px;box-shadow:0 10px 32px #1c2f2229}.office-action-menu [data-slot=item]{color:#334e3c;cursor:pointer;background:0 0;border:0;border-radius:5px;gap:9px;min-height:36px;padding:7px 10px;font-size:13px}.office-action-menu [data-slot=item][data-highlighted]{background:#e7eedf}.office-action-menu [data-slot=item-description]{color:#72806c;font-size:11px}.office-modal-overlay{-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);background:#182a205c}.office-modal[role=dialog]{color:#293b33;background:#fffefb;border:1px solid #d8e0d5;border-radius:14px;max-height:calc(100dvh - 32px);box-shadow:0 24px 80px #182a203d}.office-modal[role=dialog]>[data-slot=header]{border-bottom:1px solid #e5e9df;flex:none;min-height:0;padding:22px 60px 18px 24px}.office-modal[role=dialog] [data-slot=title]{margin:0;font-size:19px;font-weight:600;line-height:1.4}.office-modal[role=dialog] [data-slot=description]{color:#68766b;margin:7px 0 0;font-size:13px;line-height:1.65}.office-modal[role=dialog]>[data-slot=body]{overscroll-behavior:contain;min-height:0;padding:20px 24px 22px;overflow-y:auto}.office-modal-close{color:#52664f;background:#f7f9f2;border:1px solid #e0e6dc;border-radius:7px;place-items:center;width:34px;height:34px;display:grid;position:absolute;top:16px;right:16px}.office-modal-close:hover{background:#e8eee2}.office-modal[role=dialog] :is(input,select,textarea){color:#293b33;min-width:0}.office-modal[role=dialog] textarea{resize:vertical}.office-modal[role=dialog] .tool-form{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;max-height:none;padding:0;overflow:visible}.office-modal[role=dialog] .tool-form>:is(.form-actions,.error,.form-error,.hint,.wide-field,.checkbox,.check),.office-modal[role=dialog] .tool-form>label:only-of-type{grid-column:1/-1}.office-modal[role=dialog] .tool-form>label:has(textarea){grid-column:1/-1}.office-modal[role=dialog] .tool-form>label:has(input[type=text],input:not([type])){grid-column:1/-1}.office-modal[role=dialog] .form-actions{z-index:1;background:#fffefb;border-top:1px solid #e5e9df;margin-top:4px;padding:16px 0 2px;position:sticky;bottom:-22px}.office-modal[role=dialog] :is(button,input,select,textarea):focus-visible,:is(.docx-tools,.sheet-tools,.markdown-toolbar,.pdf-toolbar,.presentation-toolbar)[class] :is(button,input,select):focus-visible{outline-offset:2px;outline:2px solid #3e7455}:is(.docx-tools,.sheet-tools,.markdown-toolbar,.pdf-toolbar,.presentation-toolbar)[class] :is(.tool-tabs,.ribbon-tabs){scrollbar-width:thin;flex-wrap:nowrap;overflow-x:auto}:is(.docx-tools,.sheet-tools,.markdown-toolbar,.pdf-toolbar,.presentation-toolbar)[class] :is(.tool-tabs,.ribbon-tabs)>button{white-space:nowrap;flex:none}:is(.docx-tools,.sheet-tools,.markdown-toolbar,.pdf-toolbar,.presentation-toolbar)[class] :is(.tool-row,.ribbon-actions){scrollbar-width:thin;flex-wrap:nowrap;align-items:stretch;gap:5px;padding:8px 14px;overflow-x:auto}.tool-group{border-right:1px solid #dfe5d8;flex-direction:column;flex:none;justify-content:space-between;gap:3px;margin-right:7px;padding-right:12px;display:flex}.tool-group:last-child{border-right:0;margin-right:0;padding-right:0}.tool-group-controls{flex:none;align-items:center;gap:3px;min-height:32px;display:flex}.tool-group-controls>:is(button,label,select,input){flex-shrink:0}.presentation-toolbar .tool-group-controls{flex-wrap:nowrap}.docx-tools .style-group{flex:0 578px;min-width:288px;max-width:578px}.docx-tools .style-gallery{flex:1;gap:6px;min-width:0;min-height:67px}.docx-tools .style-gallery-list{overscroll-behavior-x:contain;scrollbar-width:thin;scrollbar-color:#c6d2c1 transparent;scroll-snap-type:x proximity;flex:1;align-items:center;gap:6px;min-width:0;padding:3px;scroll-padding-inline:3px;display:flex;overflow-x:auto}.docx-tools .style-gallery .style-card{white-space:nowrap;scroll-snap-align:start;background:#fffef9;border:1px solid #dde4d8;border-radius:7px;flex-direction:column;flex:0 0 80px;gap:3px;height:60px;padding:6px 8px;position:relative}.docx-tools .style-card-preview{justify-content:center;align-items:center;height:27px;line-height:1;display:flex}.docx-tools .style-card-label{color:#677562;font-size:11px;font-weight:400;line-height:15px}.docx-tools .style-gallery .style-card:hover:not(:disabled){background:#f0f5eb;border-color:#a2b89a}.docx-tools .style-gallery .style-card[aria-pressed=true]{background:#eaf1e3;border-color:#5c805c;box-shadow:inset 0 0 0 1px #5c805c}.docx-tools .style-card[aria-pressed=true] .style-card-label{color:#28583d;font-weight:600}.docx-tools .style-card-check{color:#356243;position:absolute;top:4px;right:4px}.docx-tools .style-gallery-more{flex:none}.docx-tools .style-gallery .office-menu-trigger{background:#f3f6ed;border:1px solid #dde4d8;border-radius:7px;flex-direction:column;justify-content:center;gap:4px;width:56px;height:60px;padding:4px}.docx-tools .style-gallery .office-menu-trigger:hover:not(:disabled),.docx-tools .style-gallery .office-menu-trigger[aria-expanded=true]{background:#e7eedf;border-color:#a2b89a}.docx-tools .style-gallery .office-menu-trigger>span{white-space:nowrap;font-size:11px;line-height:1.2}.tool-group-controls:has(input.font-size){align-items:center}.sheet-tools .tool-group-controls>input{color:#38513f;background:#fffef9;border:1px solid #dce3d6;border-radius:5px;height:32px;padding:5px 8px;font-size:12px}.tool-group-caption{text-align:center;letter-spacing:.06em;color:#798472;-webkit-user-select:none;user-select:none;font-size:10px;line-height:1.5}:is(.docx-tools,.sheet-tools,.markdown-toolbar,.pdf-toolbar,.presentation-toolbar)[class] :is(.tool-row,.ribbon-actions) select{appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%2367775e' stroke-width='1.5'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");background-position:right 5px center;background-repeat:no-repeat;background-size:14px;min-height:32px;padding:3px 24px 3px 8px}@media (max-width:900px){:is(.docx-tools,.sheet-tools,.markdown-toolbar,.pdf-toolbar,.presentation-toolbar)[class] :is(.tool-row,.ribbon-actions){scrollbar-width:thin;overscroll-behavior-x:contain;flex-wrap:nowrap;max-height:none;padding:7px 10px;overflow:auto hidden}:is(.tool-row,.ribbon-actions)>:is(button,label,select,input,.separator){flex-shrink:0}:is(.tool-row,.ribbon-actions) button{white-space:nowrap}}@media (max-width:480px){.office-modal[role=dialog]>[data-slot=header]{padding:18px 52px 14px 16px}.office-modal[role=dialog]>[data-slot=body]{padding:16px}.office-modal[role=dialog] .form-actions{bottom:-16px}.office-modal[role=dialog] .tool-form{column-gap:12px}.office-modal[role=dialog] input,.office-modal[role=dialog] select,.office-modal[role=dialog] textarea{font-size:16px}}.sheet-tool-form{color:#38513f;gap:14px;font-size:13px;display:grid}.sheet-tool-form p{margin:0;line-height:1.65}.sheet-tool-form .muted{color:#6f7e67;font-size:12px}.sheet-tool-form .error{color:#a3362c}.sheet-tool-form label{gap:6px;min-width:0;display:grid}.sheet-tool-form input,.sheet-tool-form select,.sheet-tool-form textarea{width:100%;min-width:0;color:inherit;font:inherit;background:#fffef9;border:1px solid #dce3d6;border-radius:5px;padding:7px 9px}.sheet-tool-form input[type=color]{min-height:34px;padding:3px}.sheet-tool-form input[type=checkbox],.sheet-tool-form input[type=radio]{width:auto}.sheet-tool-form textarea{resize:vertical;min-height:72px}.sheet-tool-form button{min-height:32px;color:inherit;cursor:pointer;font:inherit;background:#fffef9;border:1px solid #dce3d6;border-radius:5px;justify-content:center;align-items:center;gap:6px;padding:6px 9px;display:inline-flex}.sheet-tool-form button.primary{color:#fff;background:#34765b;border-color:#34765b}.sheet-tool-form button:disabled,.sheet-tool-form fieldset:disabled{opacity:.5;cursor:default}.sheet-tool-form :is(button,input,select,textarea):focus-visible{outline-offset:2px;outline:2px solid #34765b}.sheet-tool-form .check{align-items:center;gap:7px;line-height:1.6;display:flex}.sheet-tool-form fieldset{border:1px solid #dce3d6;border-radius:6px;gap:12px;min-width:0;padding:12px;display:grid}.sheet-tool-form legend{padding:0 5px;font-weight:600}.sheet-tool-form .fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;display:grid}.sheet-tool-form .actions{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.sheet-tool-form .actions.end{justify-content:flex-end}.sheet-tool-form .list{gap:7px;max-height:270px;padding:3px;display:grid;overflow:auto}.sheet-tool-form .entry{border:1px solid #dce3d6;border-radius:5px;align-items:center;gap:8px;padding:8px;display:flex}.sheet-tool-form .entry>.grow{flex:1;min-width:0}.sheet-tool-form .entry .actions{flex-wrap:nowrap}.sheet-tool-form .entry .actions button{padding:6px}.sheet-tool-form .segmented{flex-wrap:wrap;gap:6px;display:flex}.sheet-tool-form .segmented button[aria-selected=true]{background:#e4efe0;border-color:#86a778}@media (max-width:520px){.sheet-tool-form .fields{grid-template-columns:1fr}.sheet-tool-form .entry{flex-wrap:wrap}}
|
|
2
|
+
/*$vite$:1*/
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { CommandResponse, Json } from '../engine/protocol';
|
|
2
|
+
import type { ScriptPermissions, ScriptReplay } from '../engine/script';
|
|
3
|
+
export interface McpRequest {
|
|
4
|
+
name: string;
|
|
5
|
+
arguments: Record<string, Json>;
|
|
6
|
+
permissions: ScriptPermissions;
|
|
7
|
+
}
|
|
8
|
+
export interface McpResult {
|
|
9
|
+
response: CommandResponse;
|
|
10
|
+
content: {
|
|
11
|
+
type: 'text';
|
|
12
|
+
text: string;
|
|
13
|
+
}[];
|
|
14
|
+
isError: boolean;
|
|
15
|
+
replay: ScriptReplay | null;
|
|
16
|
+
}
|
|
17
|
+
export type McpEvent = {
|
|
18
|
+
kind: 'call';
|
|
19
|
+
id: string;
|
|
20
|
+
name: string;
|
|
21
|
+
arguments: Record<string, Json>;
|
|
22
|
+
} | {
|
|
23
|
+
kind: 'cancel';
|
|
24
|
+
id: string;
|
|
25
|
+
};
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { type CalculationEnvironment, type Command, type CommandResponse, type HistoryAction, type PreparedSave, type CopyExport, type ExportFormat, type SaveReceipt } from './protocol';
|
|
2
|
+
import { type PdfImportRequest, type PdfImportResult } from './pdf-import';
|
|
3
|
+
import type { TextInput, TextSelection, ViewRequest, ViewResult } from './view';
|
|
4
|
+
import type { ScriptRequest, ScriptResult } from './script';
|
|
5
|
+
import type { McpRequest, McpResult } from '../automation/protocol';
|
|
6
|
+
import type { SheetClipboardRequest, SheetClipboardResult } from './sheet-clipboard';
|
|
7
|
+
import type { PresentationClipboardRequest, PresentationClipboardResult } from './presentation-clipboard';
|
|
8
|
+
import type { SheetValidationHandler, SheetValidationPolicy } from './sheet-validation';
|
|
9
|
+
import type { SourceInput, SourceSelection } from './markdown';
|
|
10
|
+
export { ENGINE_LIMITS } from './protocol';
|
|
11
|
+
export declare class EngineError extends Error {
|
|
12
|
+
readonly code: string;
|
|
13
|
+
constructor(code: string, message: string);
|
|
14
|
+
}
|
|
15
|
+
export interface TaskOptions {
|
|
16
|
+
signal?: AbortSignal;
|
|
17
|
+
expectedRevision?: number;
|
|
18
|
+
/** Only reads may replace an earlier queued/running viewport request. */
|
|
19
|
+
replaceKey?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface BrowserEngineOptions {
|
|
22
|
+
/** Same-origin directory containing engine/ and fonts/ resources. */
|
|
23
|
+
assetBase?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface EngineResult<T> {
|
|
26
|
+
requestId: number;
|
|
27
|
+
generation: number;
|
|
28
|
+
revision: number;
|
|
29
|
+
value: T;
|
|
30
|
+
notices?: string[];
|
|
31
|
+
}
|
|
32
|
+
export interface EngineTask<T> {
|
|
33
|
+
id: number;
|
|
34
|
+
result: Promise<EngineResult<T>>;
|
|
35
|
+
cancel(): boolean;
|
|
36
|
+
}
|
|
37
|
+
export type EnginePhase = 'queued' | 'running' | 'confirming' | 'cancelling' | 'committing' | 'completed' | 'cancelled' | 'recovering' | 'ready' | 'failed' | 'closed';
|
|
38
|
+
export interface EngineEvent {
|
|
39
|
+
phase: EnginePhase;
|
|
40
|
+
requestId?: number;
|
|
41
|
+
generation: number;
|
|
42
|
+
revision: number;
|
|
43
|
+
queued: number;
|
|
44
|
+
}
|
|
45
|
+
/** One document, one bounded queue, one Worker. UI receives only requested projections. */
|
|
46
|
+
export declare class BrowserEngine {
|
|
47
|
+
private worker;
|
|
48
|
+
private workerEpoch;
|
|
49
|
+
private ready;
|
|
50
|
+
private closed;
|
|
51
|
+
private recovering;
|
|
52
|
+
private failed;
|
|
53
|
+
private allowRecovery;
|
|
54
|
+
private recoveryWaiters;
|
|
55
|
+
private listeners;
|
|
56
|
+
private queue;
|
|
57
|
+
private active?;
|
|
58
|
+
private counter;
|
|
59
|
+
private cancelTimer?;
|
|
60
|
+
private source?;
|
|
61
|
+
private currentName;
|
|
62
|
+
private saving?;
|
|
63
|
+
private replay;
|
|
64
|
+
private replayBytes;
|
|
65
|
+
private calculated;
|
|
66
|
+
private inputLocale;
|
|
67
|
+
private currentValidationPolicy;
|
|
68
|
+
private validationHandler?;
|
|
69
|
+
private currentGeneration;
|
|
70
|
+
private currentRevision;
|
|
71
|
+
private activeCell?;
|
|
72
|
+
private engineIdentity;
|
|
73
|
+
private readonly resourceBase;
|
|
74
|
+
constructor(options?: BrowserEngineOptions);
|
|
75
|
+
get generation(): number;
|
|
76
|
+
get revision(): number;
|
|
77
|
+
get name(): string;
|
|
78
|
+
get savePending(): boolean;
|
|
79
|
+
get preparedSaveReceipt(): SaveReceipt | undefined;
|
|
80
|
+
get identity(): string;
|
|
81
|
+
get recoveryAllowed(): boolean;
|
|
82
|
+
whenReady(): Promise<void>;
|
|
83
|
+
/** Wait for a cancelled request to be discarded, including a Worker restart if needed. */
|
|
84
|
+
whenIdle(): Promise<void>;
|
|
85
|
+
history(action: HistoryAction, options?: TaskOptions): EngineTask<CommandResponse>;
|
|
86
|
+
sheetClipboard(request: SheetClipboardRequest, options?: TaskOptions): EngineTask<SheetClipboardResult>;
|
|
87
|
+
get locale(): NonNullable<CalculationEnvironment['locale']>;
|
|
88
|
+
presentationClipboard(request: PresentationClipboardRequest, options?: TaskOptions): EngineTask<PresentationClipboardResult>;
|
|
89
|
+
importPdfPages(request: PdfImportRequest, options?: TaskOptions): EngineTask<PdfImportResult>;
|
|
90
|
+
setInputLocale(locale: NonNullable<CalculationEnvironment['locale']>): void;
|
|
91
|
+
get validationPolicy(): SheetValidationPolicy;
|
|
92
|
+
setValidationPolicy(policy: SheetValidationPolicy): void;
|
|
93
|
+
setValidationHandler(handler?: SheetValidationHandler): void;
|
|
94
|
+
prepareSave(name?: string, options?: TaskOptions): EngineTask<PreparedSave>;
|
|
95
|
+
/** Call only after the external publisher has verified successful completion. */
|
|
96
|
+
commitSave(id: string): EngineTask<CommandResponse>;
|
|
97
|
+
discardSave(id: string): EngineTask<void>;
|
|
98
|
+
readPreparedSave(): EngineTask<PreparedSave>;
|
|
99
|
+
get cancellationMode(): 'cooperative' | 'restart';
|
|
100
|
+
subscribe(listener: (event: EngineEvent) => void): () => void;
|
|
101
|
+
open(name: string, bytes: ArrayBuffer, options?: TaskOptions, password?: string): EngineTask<void>;
|
|
102
|
+
command(command: Command, options?: TaskOptions): EngineTask<CommandResponse>;
|
|
103
|
+
exportBytes(options?: TaskOptions): EngineTask<ArrayBuffer>;
|
|
104
|
+
exportCopy(format: ExportFormat, options?: TaskOptions): EngineTask<CopyExport>;
|
|
105
|
+
view<T extends ViewResult>(request: ViewRequest, options?: TaskOptions): EngineTask<T>;
|
|
106
|
+
input<T extends TextSelection | SourceSelection = TextSelection>(input: TextInput | SourceInput, options?: TaskOptions): EngineTask<T>;
|
|
107
|
+
runScript(request: ScriptRequest, options?: TaskOptions): EngineTask<ScriptResult>;
|
|
108
|
+
runMcp(request: McpRequest, options?: TaskOptions): EngineTask<McpResult>;
|
|
109
|
+
/** Restart an unresponsive Worker from the exact source and confirmed calculation log. */
|
|
110
|
+
recover(): Promise<void>;
|
|
111
|
+
close(): void;
|
|
112
|
+
private emit;
|
|
113
|
+
private enqueue;
|
|
114
|
+
private checkAvailable;
|
|
115
|
+
private checkMutable;
|
|
116
|
+
private cancel;
|
|
117
|
+
private cancelPending;
|
|
118
|
+
private settle;
|
|
119
|
+
private pump;
|
|
120
|
+
private post;
|
|
121
|
+
private spawn;
|
|
122
|
+
private receive;
|
|
123
|
+
private failPending;
|
|
124
|
+
private acknowledge;
|
|
125
|
+
private confirmValidation;
|
|
126
|
+
private sendRestore;
|
|
127
|
+
private restart;
|
|
128
|
+
private workerFailed;
|
|
129
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { Json } from './protocol';
|
|
2
|
+
/** Native editor command names and payloads; Rust validates and plans the operations. */
|
|
3
|
+
export interface DocxCommand {
|
|
4
|
+
op: string;
|
|
5
|
+
args?: Json;
|
|
6
|
+
}
|
|
7
|
+
export interface DocxRunFormat {
|
|
8
|
+
bold?: boolean | null;
|
|
9
|
+
italic?: boolean | null;
|
|
10
|
+
underline?: boolean | null;
|
|
11
|
+
strike?: boolean | null;
|
|
12
|
+
font?: string | null;
|
|
13
|
+
font_east_asia?: string | null;
|
|
14
|
+
font_size_half_points?: number | null;
|
|
15
|
+
color?: string | null;
|
|
16
|
+
highlight?: string | null;
|
|
17
|
+
shading?: string | null;
|
|
18
|
+
underline_color?: string | null;
|
|
19
|
+
vertical_alignment?: string | null;
|
|
20
|
+
character_spacing_twips?: number | null;
|
|
21
|
+
}
|
|
22
|
+
export interface DocxContext {
|
|
23
|
+
run: DocxRunFormat;
|
|
24
|
+
paragraph: Record<string, Json>;
|
|
25
|
+
style?: string | null;
|
|
26
|
+
mixed_style?: boolean;
|
|
27
|
+
mixed_run?: Record<string, boolean>;
|
|
28
|
+
page: {
|
|
29
|
+
width_twips: number;
|
|
30
|
+
height_twips: number;
|
|
31
|
+
margins_twips: number[];
|
|
32
|
+
[key: string]: Json;
|
|
33
|
+
};
|
|
34
|
+
page_section?: number | null;
|
|
35
|
+
section?: Record<string, Json> | null;
|
|
36
|
+
section_break_after?: boolean;
|
|
37
|
+
table?: {
|
|
38
|
+
table: string;
|
|
39
|
+
cell: string;
|
|
40
|
+
row: number;
|
|
41
|
+
col: number;
|
|
42
|
+
rows: number;
|
|
43
|
+
cols: number;
|
|
44
|
+
merged: boolean;
|
|
45
|
+
[key: string]: Json;
|
|
46
|
+
} | null;
|
|
47
|
+
table_selection?: Record<string, Json> | null;
|
|
48
|
+
inline_image?: {
|
|
49
|
+
id: string;
|
|
50
|
+
width_emu: number;
|
|
51
|
+
height_emu: number;
|
|
52
|
+
alt?: string | null;
|
|
53
|
+
[key: string]: Json | undefined;
|
|
54
|
+
} | null;
|
|
55
|
+
formula?: {
|
|
56
|
+
id: string;
|
|
57
|
+
latex: string;
|
|
58
|
+
display: boolean;
|
|
59
|
+
} | null;
|
|
60
|
+
hyperlink?: string | null;
|
|
61
|
+
image?: boolean;
|
|
62
|
+
}
|
|
63
|
+
export interface DocxStyle {
|
|
64
|
+
id: string;
|
|
65
|
+
name?: string;
|
|
66
|
+
type: string;
|
|
67
|
+
}
|