@betteroffice/pptx-react 0.5.1 → 0.6.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/README.md +41 -7
- package/dist/chunk-3RN73K5U.js +1 -0
- package/dist/chunk-3WH2K5EA.js +1 -0
- package/dist/chunk-4TRQLEZF.js +1 -0
- package/dist/chunk-52U7UPKN.js +1 -0
- package/dist/chunk-7DAM3J5E.js +1 -0
- package/dist/chunk-7NYXRM44.js +1 -0
- package/dist/chunk-ABH6B26J.js +1 -0
- package/dist/chunk-BNLMNYZQ.js +1 -0
- package/dist/chunk-EC75NVX7.js +4 -0
- package/dist/chunk-HJN2B5PX.js +1 -0
- package/dist/chunk-HOGGA6FO.js +1 -0
- package/dist/chunk-KQVHWYQB.js +2 -0
- package/dist/chunk-LEWN3FCH.js +1 -0
- package/dist/chunk-LFHLWZA4.js +1 -0
- package/dist/chunk-NEDOIGPO.js +1 -0
- package/dist/chunk-OUJVNLXT.js +1 -0
- package/dist/chunk-PS7ULZVL.js +1 -0
- package/dist/chunk-PSW72ZJN.js +1 -0
- package/dist/chunk-TVOFTLAK.js +1 -0
- package/dist/chunk-TZYGGEUO.js +1 -0
- package/dist/chunk-UNTN7FU5.js +1 -0
- package/dist/chunk-ZGEHLLWI.js +1 -0
- package/dist/index.d.ts +203 -15
- package/dist/index.js +1 -1
- package/dist/shortcuts.d.ts +234 -0
- package/dist/shortcuts.js +1 -0
- package/package.json +12 -5
- package/dist/chunk-BYOMNVCR.js +0 -1
- package/dist/chunk-ET3Q4APZ.js +0 -1
- package/dist/chunk-J3YQUJUG.js +0 -1
- package/dist/chunk-MCMFIO5A.js +0 -4
- package/dist/chunk-R3GGSKUL.js +0 -1
- package/dist/chunk-V62S3LXB.js +0 -1
- package/dist/chunk-WACLVTOY.js +0 -1
- package/dist/chunk-X2M23RXQ.js +0 -1
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import { ParagraphAlignment } from '@betteroffice/pptx';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A chord such as `Mod+Shift+V`. `Mod` is Cmd on macOS and Ctrl elsewhere; `Ctrl` is the physical
|
|
5
|
+
* Control key on macOS and the same as `Mod` elsewhere.
|
|
6
|
+
* @experimental
|
|
7
|
+
*/
|
|
8
|
+
type ShortcutChord = string;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* What a host sets for one shortcut id: chords that replace the defaults, `null` to disable it,
|
|
12
|
+
* or a per-platform form where an absent platform keeps its default.
|
|
13
|
+
* @experimental
|
|
14
|
+
*/
|
|
15
|
+
type ShortcutBinding = ShortcutChord | readonly ShortcutChord[] | null | {
|
|
16
|
+
mac?: ShortcutChord | readonly ShortcutChord[] | null;
|
|
17
|
+
other?: ShortcutChord | readonly ShortcutChord[] | null;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* A host binding the editor changed or refused. `displaced-default` is informational: the host
|
|
21
|
+
* chord `chord` of `id` took over the default of `displaced`.
|
|
22
|
+
* @experimental
|
|
23
|
+
*/
|
|
24
|
+
interface ShortcutIssue {
|
|
25
|
+
code: 'unknown-id' | 'invalid-chord' | 'reserved-chord' | 'duplicate-chord' | 'displaced-default';
|
|
26
|
+
id: string;
|
|
27
|
+
chord?: string;
|
|
28
|
+
/** The other shortcut id involved, for `duplicate-chord` and `displaced-default`. */
|
|
29
|
+
other?: string;
|
|
30
|
+
}
|
|
31
|
+
interface ResolvedShortcuts {
|
|
32
|
+
/** Effective canonical chords by id; an id without chords is absent or empty. */
|
|
33
|
+
chords: ReadonlyMap<string, readonly string[]>;
|
|
34
|
+
/** The id each effective canonical chord runs. */
|
|
35
|
+
owners: ReadonlyMap<string, string>;
|
|
36
|
+
issues: readonly ShortcutIssue[];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
declare const SHAPE_PRESETS: readonly [{
|
|
40
|
+
readonly geometry: "rect";
|
|
41
|
+
readonly labelKey: "toolbar.shapes.rect";
|
|
42
|
+
}, {
|
|
43
|
+
readonly geometry: "roundRect";
|
|
44
|
+
readonly labelKey: "toolbar.shapes.roundRect";
|
|
45
|
+
}, {
|
|
46
|
+
readonly geometry: "ellipse";
|
|
47
|
+
readonly labelKey: "toolbar.shapes.ellipse";
|
|
48
|
+
}, {
|
|
49
|
+
readonly geometry: "triangle";
|
|
50
|
+
readonly labelKey: "toolbar.shapes.triangle";
|
|
51
|
+
}, {
|
|
52
|
+
readonly geometry: "rtTriangle";
|
|
53
|
+
readonly labelKey: "toolbar.shapes.rtTriangle";
|
|
54
|
+
}, {
|
|
55
|
+
readonly geometry: "diamond";
|
|
56
|
+
readonly labelKey: "toolbar.shapes.diamond";
|
|
57
|
+
}, {
|
|
58
|
+
readonly geometry: "parallelogram";
|
|
59
|
+
readonly labelKey: "toolbar.shapes.parallelogram";
|
|
60
|
+
}, {
|
|
61
|
+
readonly geometry: "trapezoid";
|
|
62
|
+
readonly labelKey: "toolbar.shapes.trapezoid";
|
|
63
|
+
}, {
|
|
64
|
+
readonly geometry: "pentagon";
|
|
65
|
+
readonly labelKey: "toolbar.shapes.pentagon";
|
|
66
|
+
}, {
|
|
67
|
+
readonly geometry: "hexagon";
|
|
68
|
+
readonly labelKey: "toolbar.shapes.hexagon";
|
|
69
|
+
}, {
|
|
70
|
+
readonly geometry: "octagon";
|
|
71
|
+
readonly labelKey: "toolbar.shapes.octagon";
|
|
72
|
+
}, {
|
|
73
|
+
readonly geometry: "star5";
|
|
74
|
+
readonly labelKey: "toolbar.shapes.star5";
|
|
75
|
+
}, {
|
|
76
|
+
readonly geometry: "rightArrow";
|
|
77
|
+
readonly labelKey: "toolbar.shapes.rightArrow";
|
|
78
|
+
}, {
|
|
79
|
+
readonly geometry: "leftArrow";
|
|
80
|
+
readonly labelKey: "toolbar.shapes.leftArrow";
|
|
81
|
+
}, {
|
|
82
|
+
readonly geometry: "upArrow";
|
|
83
|
+
readonly labelKey: "toolbar.shapes.upArrow";
|
|
84
|
+
}, {
|
|
85
|
+
readonly geometry: "downArrow";
|
|
86
|
+
readonly labelKey: "toolbar.shapes.downArrow";
|
|
87
|
+
}, {
|
|
88
|
+
readonly geometry: "chevron";
|
|
89
|
+
readonly labelKey: "toolbar.shapes.chevron";
|
|
90
|
+
}];
|
|
91
|
+
type PptxShapePreset = (typeof SHAPE_PRESETS)[number]['geometry'];
|
|
92
|
+
type PptxEditorTool = 'select' | 'textBox' | `shape:${PptxShapePreset}`;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* A paint-order move of the selected object among its siblings.
|
|
96
|
+
* @experimental
|
|
97
|
+
*/
|
|
98
|
+
type PptxZOrderMove = 'front' | 'forward' | 'backward' | 'back';
|
|
99
|
+
/**
|
|
100
|
+
* Arguments of every PPTX editor command, keyed by command id.
|
|
101
|
+
* @experimental
|
|
102
|
+
*/
|
|
103
|
+
interface PptxCommandArgs {
|
|
104
|
+
cut: null;
|
|
105
|
+
copy: null;
|
|
106
|
+
paste: null;
|
|
107
|
+
/** Pastes the clipboard's text without formatting. */
|
|
108
|
+
pasteAsPlainText: null;
|
|
109
|
+
deleteObject: null;
|
|
110
|
+
deleteSlide: null;
|
|
111
|
+
duplicateSlide: null;
|
|
112
|
+
tableInsert: {
|
|
113
|
+
kind: 'row' | 'column';
|
|
114
|
+
position: 'before' | 'after';
|
|
115
|
+
};
|
|
116
|
+
tableDelete: {
|
|
117
|
+
kind: 'row' | 'column' | 'table';
|
|
118
|
+
};
|
|
119
|
+
bold: null;
|
|
120
|
+
italic: null;
|
|
121
|
+
underline: null;
|
|
122
|
+
strikethrough: null;
|
|
123
|
+
fontFamily: {
|
|
124
|
+
family: string;
|
|
125
|
+
};
|
|
126
|
+
/** Size in points, 1 to 400. */
|
|
127
|
+
fontSize: {
|
|
128
|
+
points: number;
|
|
129
|
+
};
|
|
130
|
+
fontSizeStep: {
|
|
131
|
+
direction: 'increase' | 'decrease';
|
|
132
|
+
};
|
|
133
|
+
/** `#rrggbb`. */
|
|
134
|
+
textColor: {
|
|
135
|
+
color: string;
|
|
136
|
+
};
|
|
137
|
+
alignment: {
|
|
138
|
+
value: ParagraphAlignment;
|
|
139
|
+
};
|
|
140
|
+
/** Omit the layout to reuse the current slide's; `null` inserts without one. */
|
|
141
|
+
insertSlide: {
|
|
142
|
+
layoutPartPath?: string | null;
|
|
143
|
+
};
|
|
144
|
+
insertImage: null;
|
|
145
|
+
/** Selects, or arms text-box or `shape:<preset>` placement on the canvas. */
|
|
146
|
+
tool: {
|
|
147
|
+
value: PptxEditorTool;
|
|
148
|
+
};
|
|
149
|
+
/** `#rrggbb`; `null` removes the fill. */
|
|
150
|
+
shapeFill: {
|
|
151
|
+
color: string | null;
|
|
152
|
+
};
|
|
153
|
+
/** `#rrggbb`; `null` removes the outline. */
|
|
154
|
+
shapeStrokeColor: {
|
|
155
|
+
color: string | null;
|
|
156
|
+
};
|
|
157
|
+
/** Outline width in points; `null` removes the outline. */
|
|
158
|
+
shapeStrokeWidth: {
|
|
159
|
+
points: number | null;
|
|
160
|
+
};
|
|
161
|
+
/** An adjustment of the selected shape, as a fraction of its range. */
|
|
162
|
+
shapeAdjustment: {
|
|
163
|
+
name: string;
|
|
164
|
+
value: number;
|
|
165
|
+
};
|
|
166
|
+
zOrder: {
|
|
167
|
+
value: PptxZOrderMove;
|
|
168
|
+
};
|
|
169
|
+
save: null;
|
|
170
|
+
exportPng: null;
|
|
171
|
+
slideshow: null;
|
|
172
|
+
undo: null;
|
|
173
|
+
redo: null;
|
|
174
|
+
/** 1 is 100%, from 0.1 to 5; `'fit'` fits the slide to the window. */
|
|
175
|
+
zoom: {
|
|
176
|
+
scale: number | 'fit';
|
|
177
|
+
};
|
|
178
|
+
/** `null` toggles the panel. */
|
|
179
|
+
proposalsPanel: {
|
|
180
|
+
open: boolean;
|
|
181
|
+
} | null;
|
|
182
|
+
proposalSelect: {
|
|
183
|
+
proposalId: string;
|
|
184
|
+
};
|
|
185
|
+
/** Shows the selected proposal's changes on the canvas, or the editable slide. */
|
|
186
|
+
proposalDiff: {
|
|
187
|
+
enabled: boolean;
|
|
188
|
+
};
|
|
189
|
+
/** `force` applies a proposal whose targets changed after it was made. */
|
|
190
|
+
proposalAccept: {
|
|
191
|
+
proposalId: string;
|
|
192
|
+
force?: boolean;
|
|
193
|
+
};
|
|
194
|
+
proposalReject: {
|
|
195
|
+
proposalId: string;
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
/** @experimental */
|
|
199
|
+
type PptxCommandId = keyof PptxCommandArgs;
|
|
200
|
+
/**
|
|
201
|
+
* A command a plugin contributes, registered as `plugin:<pluginId>/<localId>`.
|
|
202
|
+
* @experimental
|
|
203
|
+
*/
|
|
204
|
+
type PptxPluginCommandId = `plugin:${string}/${string}`;
|
|
205
|
+
|
|
206
|
+
type PptxNullArgsCommandId = {
|
|
207
|
+
[K in PptxCommandId]: null extends PptxCommandArgs[K] ? K : never;
|
|
208
|
+
}[PptxCommandId];
|
|
209
|
+
/**
|
|
210
|
+
* Every id a host can bind: commands that run without arguments and plugin commands.
|
|
211
|
+
* @experimental
|
|
212
|
+
*/
|
|
213
|
+
type PptxShortcutId = PptxNullArgsCommandId | PptxPluginCommandId;
|
|
214
|
+
/**
|
|
215
|
+
* Host changes to the editor's shortcuts. An omitted id keeps its default; chords replace all of
|
|
216
|
+
* its defaults; `null` disables it and leaves the keystroke to the host or browser. A chord taken
|
|
217
|
+
* from another command's default wins over it. `cut`, `copy`, `paste` and `pasteAsPlainText` on a
|
|
218
|
+
* chord other than their default use the async Clipboard API, which browsers may gate behind a
|
|
219
|
+
* prompt; the non-worker editor and the viewer have no clipboard and report them as `unknown-id`.
|
|
220
|
+
* Text navigation and editing keys, select all and the context menu key cannot be bound.
|
|
221
|
+
* @experimental
|
|
222
|
+
*/
|
|
223
|
+
type PptxShortcuts = Readonly<Partial<Record<PptxShortcutId, ShortcutBinding>>>;
|
|
224
|
+
/**
|
|
225
|
+
* The effective bindings a host map produces and what was wrong with it, for checking a map
|
|
226
|
+
* outside the editor.
|
|
227
|
+
* @experimental
|
|
228
|
+
*/
|
|
229
|
+
declare function resolvePptxShortcuts(shortcuts: PptxShortcuts | undefined, options?: {
|
|
230
|
+
mac?: boolean;
|
|
231
|
+
unsupported?: ReadonlySet<string>;
|
|
232
|
+
}): ResolvedShortcuts;
|
|
233
|
+
|
|
234
|
+
export { type PptxShortcutId, type PptxShortcuts, type ResolvedShortcuts, type ShortcutBinding, type ShortcutChord, type ShortcutIssue, resolvePptxShortcuts };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var B=new Set(["Ctrl","Mod","Shift","Alt"]),R="Space Enter Tab Escape Backspace Delete Home End PageUp PageDown ArrowUp ArrowDown ArrowLeft ArrowRight".split(" "),_={escape:"Esc",delete:"Del",pageup:"Page Up",pagedown:"Page Down",arrowup:"\u2191",arrowdown:"\u2193",arrowleft:"\u2190",arrowright:"\u2192"};Object.fromEntries(R.map(t=>[t.toLowerCase(),t]));var O=Object.fromEntries(R.map(t=>[t.toLowerCase(),_[t.toLowerCase()]??t])),A=/^f([1-9]|1[0-2])$/;function P(){return typeof navigator<"u"&&/Mac|iPod|iPhone|iPad/.test(navigator.platform)}function h(t){let e=t.split("+"),s=e.length>1&&e[e.length-1]===""?"+":e[e.length-1],n=new Set(e.slice(0,-1));return {ctrl:n.has("Ctrl"),mod:n.has("Mod"),shift:n.has("Shift"),alt:n.has("Alt"),key:s.toLowerCase()}}function S(t){if(typeof t!="string"||t.length===0)return null;let e=t.split("+");if(!(e.length>1&&e[e.length-1]===""?e.slice(0,-2):e.slice(0,-1)).every(f=>B.has(f)))return null;let n=h(t);if(n.key.length===0)return null;let C=n.key==="+"?"=":n.key;return [n.ctrl&&"Ctrl",n.mod&&"Mod",n.alt&&"Alt",n.shift&&"Shift",C].filter(Boolean).join("+")}var v=new Set(["arrowup","arrowdown","arrowleft","arrowright","home","end","pageup","pagedown","backspace","delete","enter","tab","escape"]);function K(t){let e=h(t),s=e.mod||e.ctrl||e.alt;return v.has(e.key)||(e.mod||e.ctrl)&&e.key==="a"||!s&&e.shift&&e.key==="f10"}new Set(["Mod+A","Mod+C","Mod+V","Mod+X","Mod+Shift+V"].map(t=>S(t)));function M(t,e){let s=S(t);if(!s||e)return s;let n=h(s);return S([(n.ctrl||n.mod)&&"Mod",n.alt&&"Alt",n.shift&&"Shift",n.key].filter(Boolean).join("+"))}function D(t){return [...t].length===1||Object.hasOwn(O,t)||A.test(t)}function k(t){let e=h(t);return e.ctrl||e.mod||e.alt||A.test(e.key)}function T(t,e){if(t===null||typeof t=="string"||Array.isArray(t))return typeof t=="string"?[t]:t;let s=t[e?"mac":"other"];return typeof s=="string"?[s]:s}function z(t,e,s){let{mac:n,isBindable:C,isReserved:f}=s,i=[],I=new Map(t.map(r=>[r.id,r])),m=new Map,w=new Set;for(let[r,l]of Object.entries(e??{})){if(l===void 0)continue;if(!I.has(r)&&!C(r)){i.push({code:"unknown-id",id:r});continue}let a=T(l,n);if(a===void 0)continue;if(a===null||a.length===0){w.add(r);continue}let u=[];for(let c of a){let d=typeof c=="string"?M(c,n):null;!d||!D(h(d).key)||!k(d)?i.push({code:"invalid-chord",id:r,chord:String(c)}):f?.(d,r)?i.push({code:"reserved-chord",id:r,chord:c}):u.includes(d)||u.push(d);}u.length>0&&m.set(r,u);}let y=new Map;for(let[r,l]of m)for(let a of l)y.set(a,[...y.get(a)??[],r]);for(let[r,l]of y)l.length<2||(l.forEach((a,u)=>{i.push({code:"duplicate-chord",id:a,chord:r,other:l[(u+1)%l.length]});let c=m.get(a).filter(d=>d!==r);c.length>0?m.set(a,c):m.delete(a);}),y.delete(r));let g=new Map,x=new Map;for(let[r,l]of m){g.set(r,Object.freeze(l));for(let a of l)x.set(a,r);}for(let{id:r,chords:l}of t){if(m.has(r))continue;if(w.has(r)){g.set(r,Object.freeze([]));continue}let a=[];for(let u of l){let c=M(u,n),d=x.get(c);d===void 0?a.push(c):d!==r&&i.push({code:"displaced-default",id:d,chord:c,other:r});}g.set(r,Object.freeze(a));for(let u of a)x.set(u,r);}for(let r of w)g.has(r)||g.set(r,Object.freeze([]));return {chords:g,owners:x,issues:Object.freeze(i)}}function o(t,e,s,n=[]){return Object.freeze({id:t,labelKey:e,mutatesDocument:s,shortcuts:Object.freeze(n)})}var p=t=>({chord:t,args:null}),b=Object.freeze({cut:o("cut","commands.cut",true,[p("Mod+X")]),copy:o("copy","commands.copy",false,[p("Mod+C")]),paste:o("paste","commands.paste",true,[p("Mod+V")]),pasteAsPlainText:o("pasteAsPlainText","commands.pastePlainText",true,[p("Mod+Shift+V")]),deleteObject:o("deleteObject","commands.delete",true),deleteSlide:o("deleteSlide","toolbar.deleteSlide",true),duplicateSlide:o("duplicateSlide","commands.duplicateSlide",true),tableInsert:o("tableInsert","commands.insert",true),tableDelete:o("tableDelete","commands.delete",true),bold:o("bold","toolbar.bold",true,[p("Mod+B")]),italic:o("italic","toolbar.italic",true,[p("Mod+I")]),underline:o("underline","toolbar.underline",true,[p("Mod+U")]),strikethrough:o("strikethrough","toolbar.strikethrough",true),fontFamily:o("fontFamily","toolbar.fontFamily",true),fontSize:o("fontSize","toolbar.fontSize",true),fontSizeStep:o("fontSizeStep","commands.fontSizeStep",true),textColor:o("textColor","toolbar.textColor",true),alignment:o("alignment","toolbar.groups.alignment",true),insertSlide:o("insertSlide","toolbar.newSlide",true),insertImage:o("insertImage","toolbar.insertImage",true),tool:o("tool","toolbar.groups.tools",false),shapeFill:o("shapeFill","toolbar.fillColor",true),shapeStrokeColor:o("shapeStrokeColor","toolbar.borderColor",true),shapeStrokeWidth:o("shapeStrokeWidth","toolbar.borderWidth",true),shapeAdjustment:o("shapeAdjustment","toolbar.shapeAdjustment",true),zOrder:o("zOrder","toolbar.arrange",true),save:o("save","toolbar.save",false,[p("Mod+S")]),exportPng:o("exportPng","toolbar.exportPng",false),slideshow:o("slideshow","toolbar.present",false),undo:o("undo","toolbar.undo",true,[p("Mod+Z")]),redo:o("redo","toolbar.redo",true,[p("Mod+Shift+Z"),p("Mod+Y")]),zoom:o("zoom","toolbar.groups.zoom",false),proposalsPanel:o("proposalsPanel","proposals.title",false),proposalSelect:o("proposalSelect","proposals.canvasTitle",false),proposalDiff:o("proposalDiff","proposals.showDiff",false),proposalAccept:o("proposalAccept","proposals.accept",true),proposalReject:o("proposalReject","proposals.reject",true)});Object.freeze(Object.keys(b));function j(t){return typeof t=="string"&&Object.prototype.hasOwnProperty.call(b,t)}var N=/^plugin:[A-Za-z0-9](?:[A-Za-z0-9._-]*[A-Za-z0-9])?\/[A-Za-z0-9](?:[A-Za-z0-9._-]*[A-Za-z0-9])?$/;function E(t){return typeof t=="string"&&N.test(t)}function L(){return Object.values(b).flatMap(t=>{let e=t.shortcuts;return e.length===0?[]:[{id:t.id,chords:e.map(({chord:s})=>s)}]})}var U={cut:true,copy:true,paste:true,pasteAsPlainText:true,deleteObject:true,deleteSlide:true,duplicateSlide:true,bold:true,italic:true,underline:true,strikethrough:true,insertImage:true,save:true,exportPng:true,slideshow:true,undo:true,redo:true,proposalsPanel:true};function $(t){return E(t)||j(t)&&Object.hasOwn(U,t)}function F(t,e={}){let{unsupported:s}=e,n=[],C=t&&s?Object.fromEntries(Object.entries(t).filter(([i,I])=>I===void 0||!s.has(i)?true:(n.push({code:"unknown-id",id:i}),false))):t,f=z(L(),C,{mac:e.mac??P(),isBindable:$,isReserved:i=>K(i)});return n.length?{...f,issues:Object.freeze([...n,...f.issues])}:f}export{F as resolvePptxShortcuts};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@betteroffice/pptx-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "PowerPoint-faithful React PPTX editor and viewer: full OOXML fidelity, real-time human + AI agent collaboration.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pptx",
|
|
@@ -29,19 +29,26 @@
|
|
|
29
29
|
"exports": {
|
|
30
30
|
".": {
|
|
31
31
|
"types": "./dist/index.d.ts",
|
|
32
|
-
"import": "./dist/index.js"
|
|
32
|
+
"import": "./dist/index.js",
|
|
33
|
+
"default": "./dist/index.js"
|
|
34
|
+
},
|
|
35
|
+
"./shortcuts": {
|
|
36
|
+
"types": "./dist/shortcuts.d.ts",
|
|
37
|
+
"import": "./dist/shortcuts.js",
|
|
38
|
+
"default": "./dist/shortcuts.js"
|
|
33
39
|
}
|
|
34
40
|
},
|
|
35
41
|
"files": [
|
|
36
42
|
"dist"
|
|
37
43
|
],
|
|
38
44
|
"scripts": {
|
|
39
|
-
"build": "tsup",
|
|
45
|
+
"build": "tsup && tsup --config tsup.shortcuts.config.ts",
|
|
40
46
|
"typecheck": "tsc --noEmit -p ."
|
|
41
47
|
},
|
|
42
48
|
"dependencies": {
|
|
43
|
-
"@betteroffice/
|
|
44
|
-
"@betteroffice/pptx
|
|
49
|
+
"@betteroffice/fonts": "^0.5.0",
|
|
50
|
+
"@betteroffice/pptx": "0.6.0",
|
|
51
|
+
"@betteroffice/pptx-i18n": "0.6.0"
|
|
45
52
|
},
|
|
46
53
|
"peerDependencies": {
|
|
47
54
|
"react": "^18.0.0 || ^19.0.0",
|
package/dist/chunk-BYOMNVCR.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import'./chunk-O2XFH626.js';function c(o){try{let t=new DataView(o.buffer,o.byteOffset,o.byteLength);if(t.byteLength<12)return;let n=0;if(t.getUint32(0)===1953784678){let e=t.getUint32(4),r=t.getUint32(8);if(e!==65536&&e!==131072||r===0||12+r*4+(e===131072?12:0)>t.byteLength)return;n=t.getUint32(12);}if(n+12>t.byteLength)return;let u=t.getUint32(n);if(u!==65536&&u!==1953658213&&u!==1330926671)return;let l=t.getUint16(n+4);if(n+12+l*16>t.byteLength)return;let i,f;for(let e=0;e<l;e++){let r=n+12+e*16,a=t.getUint32(r),g=t.getUint32(r+8),s=t.getUint32(r+12);if(g+s>t.byteLength)return;if(a===1330851634){if(i)return;i={offset:g,length:s};}else if(a===1751474532){if(f)return;f={offset:g,length:s};}}if(i){if(i.length<64)return;let e=t.getUint16(i.offset+62);return {weight:Math.max(1,Math.min(1e3,t.getUint16(i.offset+4))),bold:(e&32)!==0,italic:(e&1)!==0,oblique:(e&512)!==0}}if(f){if(f.length<46)return;let e=t.getUint16(f.offset+44);return {weight:e&1?700:400,bold:(e&1)!==0,italic:(e&2)!==0,oblique:!1}}}catch{return}}export{c as readFontTraits};
|