fable-editor 1.2.7 → 1.3.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/dist/angular/core/editor.d.ts +51 -1
- package/dist/angular/core/word-image-paste.d.ts +27 -0
- package/dist/angular/esm2022/core/editor.mjs +266 -20
- package/dist/angular/esm2022/core/word-image-paste.mjs +189 -0
- package/dist/angular/fesm2022/fable-editor.mjs +453 -19
- package/dist/angular/fesm2022/fable-editor.mjs.map +1 -1
- package/dist/core/editor.css +28 -1
- package/dist/core/editor.d.ts +51 -1
- package/dist/core/editor.d.ts.map +1 -1
- package/dist/core/index.cjs +4 -4
- package/dist/core/index.mjs +1008 -765
- package/dist/core/word-image-paste.d.ts +28 -0
- package/dist/core/word-image-paste.d.ts.map +1 -0
- package/dist/react/index.cjs +11 -11
- package/dist/react/index.mjs +1146 -903
- package/package.json +1 -1
- package/style.css +28 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** Decoded pictures in document order. A slot is null when the picture exists but
|
|
2
|
+
* cannot be turned into something the browser can show (a true vector metafile). */
|
|
3
|
+
export type RtfImages = (string | null)[];
|
|
4
|
+
/** Every picture in the RTF flavor, in document order. */
|
|
5
|
+
export declare function extractRtfImages(rtf: string): RtfImages;
|
|
6
|
+
export interface InjectResult {
|
|
7
|
+
html: string;
|
|
8
|
+
/** The data URIs this call put into the HTML, in the order they were used. Only
|
|
9
|
+
* these are candidates for the host's imageUploadHandler — data URIs that were
|
|
10
|
+
* already in the pasted HTML are left alone, so existing paste behaviour is
|
|
11
|
+
* unchanged. */
|
|
12
|
+
injected: string[];
|
|
13
|
+
}
|
|
14
|
+
/** Rewrites unusable <img src> values in raw pasted HTML with the pictures given, in
|
|
15
|
+
* document order. Images that already have a usable src are left alone and do not
|
|
16
|
+
* consume a slot, so a mixed paste (webmail image + Word image) stays aligned.
|
|
17
|
+
* Anything without a matching picture keeps its original tag. */
|
|
18
|
+
export declare function injectImages(html: string, imgs: RtfImages): InjectResult;
|
|
19
|
+
/** Pairs the HTML flavor of a Word paste with the pictures in its RTF flavor. */
|
|
20
|
+
export declare function injectRtfImages(html: string, rtf: string): InjectResult;
|
|
21
|
+
/** True when the cleaned HTML still holds images the engine could not resolve — used
|
|
22
|
+
* to decide whether a bitmap sitting in the clipboard is worth falling back to. */
|
|
23
|
+
export declare function countUnresolvedImages(html: string): number;
|
|
24
|
+
/** data: URI -> File, so recovered pictures can go through the host's
|
|
25
|
+
* imageUploadHandler exactly like a picked file does. `baseName` gets the extension
|
|
26
|
+
* that matches the URI's MIME type. */
|
|
27
|
+
export declare function dataUrlToFile(dataUrl: string, baseName: string): File | null;
|
|
28
|
+
//# sourceMappingURL=word-image-paste.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"word-image-paste.d.ts","sourceRoot":"","sources":["../../src/core/word-image-paste.ts"],"names":[],"mappings":"AAWA;qFACqF;AACrF,MAAM,MAAM,SAAS,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;AA8F1C,0DAA0D;AAC1D,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAmBvD;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb;;;qBAGiB;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;;kEAGkE;AAClE,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,YAAY,CAexE;AAED,iFAAiF;AACjF,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,YAAY,CAGvE;AAED;oFACoF;AACpF,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAO1D;AAED;;wCAEwC;AACxC,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAY5E"}
|