fluxfiles 0.2.7 → 0.2.9
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/fluxfiles.d.ts +2 -0
- package/fluxfiles.js +6 -0
- package/package.json +1 -1
package/fluxfiles.d.ts
CHANGED
|
@@ -85,6 +85,8 @@ interface FluxFilesSDK {
|
|
|
85
85
|
aiTag(): void;
|
|
86
86
|
/** Switch locale/language at runtime. */
|
|
87
87
|
setLocale(locale: string): void;
|
|
88
|
+
/** Crops the currently open detail file. savePath omitted/'' = overwrite in place, otherwise saves as a new file (must keep the same extension). */
|
|
89
|
+
crop(x: number, y: number, width: number, height: number, savePath?: string): void;
|
|
88
90
|
/** Build an on-demand WebP URL for a selected image from its `img_base`. Returns '' if unavailable. */
|
|
89
91
|
imgUrl(file: FluxFile, opts?: { width?: number; quality?: number; format?: 'webp' | 'auto' }): string;
|
|
90
92
|
/** Push a new token (e.g. after background refresh). */
|
package/fluxfiles.js
CHANGED
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
function handleMessage(e) {
|
|
32
|
+
if (!iframe || !iframe.contentWindow || e.source !== iframe.contentWindow) return;
|
|
32
33
|
if (iframeOrigin && e.origin !== iframeOrigin) return;
|
|
33
34
|
var msg = e.data;
|
|
34
35
|
if (!msg || msg.source !== SOURCE) return;
|
|
@@ -261,6 +262,11 @@
|
|
|
261
262
|
crossMove: function(dstDisk, dstPath) { this.command('crossMove', { dst_disk: dstDisk, dst_path: dstPath || '' }); },
|
|
262
263
|
aiTag: function() { this.command('aiTag'); },
|
|
263
264
|
setLocale: function(locale) { this.command('setLocale', { locale: locale }); },
|
|
265
|
+
// Crops the currently open detail file. savePath omitted/'' = overwrite in place,
|
|
266
|
+
// otherwise saves as a new file (must keep the same extension).
|
|
267
|
+
crop: function(x, y, width, height, savePath) {
|
|
268
|
+
this.command('crop', { x: x, y: y, width: width, height: height, save_path: savePath || '' });
|
|
269
|
+
},
|
|
264
270
|
|
|
265
271
|
// Build an on-demand WebP URL for a selected image file, from its
|
|
266
272
|
// `img_base` (present on image entries when the webp feature is enabled).
|