@haklex/rich-plugin-image-editor 0.43.1 → 0.43.2
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageEditModalPlugin.d.ts","sourceRoot":"","sources":["../src/ImageEditModalPlugin.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAMhC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"ImageEditModalPlugin.d.ts","sourceRoot":"","sources":["../src/ImageEditModalPlugin.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAMhC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAK7D,MAAM,WAAW,yBAAyB;IACxC,OAAO,CAAC,EAAE,gBAAgB,CAAC;CAC5B;AAED,eAAO,MAAM,oBAAoB,EAAE,EAAE,CAAC,yBAAyB,CAoF9D,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ImagePreprocessSource } from '@haklex/rich-editor/plugins';
|
|
1
2
|
import { FC } from 'react';
|
|
2
3
|
import { ImageEditResult } from './ImageEditModal';
|
|
3
4
|
import { ImageEditPrivacy } from './insert-sheet-model';
|
|
@@ -7,6 +8,7 @@ export interface ImageInsertSheetProps {
|
|
|
7
8
|
onEdit: (file: File) => Promise<ImageEditResult | null>;
|
|
8
9
|
onInsert: (files: File[]) => void;
|
|
9
10
|
privacy?: ImageEditPrivacy;
|
|
11
|
+
source?: ImagePreprocessSource;
|
|
10
12
|
}
|
|
11
13
|
export declare const ImageInsertSheet: FC<ImageInsertSheetProps>;
|
|
12
14
|
//# sourceMappingURL=ImageInsertSheet.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageInsertSheet.d.ts","sourceRoot":"","sources":["../src/ImageInsertSheet.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ImageInsertSheet.d.ts","sourceRoot":"","sources":["../src/ImageInsertSheet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEzE,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAGhC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EAAW,gBAAgB,EAAY,MAAM,sBAAsB,CAAC;AAOhF,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAAC;IACxD,QAAQ,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC;IAClC,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,MAAM,CAAC,EAAE,qBAAqB,CAAC;CAChC;AAaD,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CAgJtD,CAAC"}
|
package/dist/index.mjs
CHANGED
|
@@ -1103,6 +1103,16 @@ async function finalizeRows(rows, removeGps, stripGps) {
|
|
|
1103
1103
|
}))).filter((file) => file !== null)
|
|
1104
1104
|
};
|
|
1105
1105
|
}
|
|
1106
|
+
function sheetCopy(source, count) {
|
|
1107
|
+
if (source === "replace") return {
|
|
1108
|
+
action: "Replace",
|
|
1109
|
+
title: "Replace image"
|
|
1110
|
+
};
|
|
1111
|
+
return {
|
|
1112
|
+
action: count > 1 ? `Insert ${count} images` : "Insert",
|
|
1113
|
+
title: count > 1 ? "Insert images" : "Insert image"
|
|
1114
|
+
};
|
|
1115
|
+
}
|
|
1106
1116
|
//#endregion
|
|
1107
1117
|
//#region src/sheet.css.ts
|
|
1108
1118
|
var sheetPopup = "_1us6jj40";
|
|
@@ -1245,7 +1255,7 @@ function withDetectedGps(rows, files, found) {
|
|
|
1245
1255
|
};
|
|
1246
1256
|
});
|
|
1247
1257
|
}
|
|
1248
|
-
var ImageInsertSheet = ({ files, onCancel, onEdit, onInsert, privacy }) => {
|
|
1258
|
+
var ImageInsertSheet = ({ files, onCancel, onEdit, onInsert, privacy, source = "paste" }) => {
|
|
1249
1259
|
const [rows$1, setRows] = useState(() => files.map((file, index) => ({
|
|
1250
1260
|
current: file,
|
|
1251
1261
|
gps: null,
|
|
@@ -1366,7 +1376,7 @@ var ImageInsertSheet = ({ files, onCancel, onEdit, onInsert, privacy }) => {
|
|
|
1366
1376
|
disabled: inserting || blocked,
|
|
1367
1377
|
type: "button",
|
|
1368
1378
|
onClick: () => void handleInsert(),
|
|
1369
|
-
children: rows$1.length
|
|
1379
|
+
children: sheetCopy(source, rows$1.length).action
|
|
1370
1380
|
})
|
|
1371
1381
|
]
|
|
1372
1382
|
})
|
|
@@ -1410,7 +1420,7 @@ var ImageEditModalPlugin = ({ privacy }) => {
|
|
|
1410
1420
|
theme: portalThemeRef.current.theme
|
|
1411
1421
|
});
|
|
1412
1422
|
});
|
|
1413
|
-
const fn = (files) => new Promise((resolve) => {
|
|
1423
|
+
const fn = (files, { source }) => new Promise((resolve) => {
|
|
1414
1424
|
let settled = false;
|
|
1415
1425
|
const settle = (result) => {
|
|
1416
1426
|
if (settled) return;
|
|
@@ -1423,6 +1433,7 @@ var ImageEditModalPlugin = ({ privacy }) => {
|
|
|
1423
1433
|
content: () => /* @__PURE__ */ jsx(ImageInsertSheet, {
|
|
1424
1434
|
files,
|
|
1425
1435
|
privacy: privacyRef.current,
|
|
1436
|
+
source,
|
|
1426
1437
|
onEdit: openEditor,
|
|
1427
1438
|
onCancel: () => {
|
|
1428
1439
|
settle(null);
|
|
@@ -1438,7 +1449,7 @@ var ImageEditModalPlugin = ({ privacy }) => {
|
|
|
1438
1449
|
portalClassName: portalThemeRef.current.className,
|
|
1439
1450
|
showCloseButton: false,
|
|
1440
1451
|
theme: portalThemeRef.current.theme,
|
|
1441
|
-
title: files.length
|
|
1452
|
+
title: sheetCopy(source, files.length).title
|
|
1442
1453
|
});
|
|
1443
1454
|
});
|
|
1444
1455
|
return preprocess.register(fn);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ImagePreprocessSource } from '@haklex/rich-editor/plugins';
|
|
1
2
|
export interface GpsInfo {
|
|
2
3
|
latitude: number;
|
|
3
4
|
longitude: number;
|
|
@@ -19,4 +20,8 @@ export declare function finalizeRows(rows: SheetRow[], removeGps: boolean, strip
|
|
|
19
20
|
failedIds: string[];
|
|
20
21
|
files: File[];
|
|
21
22
|
}>;
|
|
23
|
+
export declare function sheetCopy(source: ImagePreprocessSource, count: number): {
|
|
24
|
+
action: string;
|
|
25
|
+
title: string;
|
|
26
|
+
};
|
|
22
27
|
//# sourceMappingURL=insert-sheet-model.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insert-sheet-model.d.ts","sourceRoot":"","sources":["../src/insert-sheet-model.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;IACnD,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACzC;AAED,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,IAAI,CAAC;IACd,GAAG,EAAE,OAAO,GAAG,IAAI,CAAC;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,IAAI,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAID,wBAAgB,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AC,GAAG,SAAS,GACjD,OAAO,CAAC;IAAE,SAAS,EAAE,MAAM,EAAE,CAAC;IAAC,KAAK,EAAE,IAAI,EAAE,CAAA;CAAE,CAAC,CAgBjD;AAED,wBAAgB,SAAS,CACvB,MAAM,EAAE,qBAAqB,EAC7B,KAAK,EAAE,MAAM,GACZ;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAMnC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haklex/rich-plugin-image-editor",
|
|
3
|
-
"version": "0.43.
|
|
3
|
+
"version": "0.43.2",
|
|
4
4
|
"description": "Pre-upload image edit modal plugin (crop + annotate)",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"lucide-react": "^1.0.0",
|
|
41
41
|
"react": ">=19",
|
|
42
42
|
"react-dom": ">=19",
|
|
43
|
-
"@haklex/rich-
|
|
44
|
-
"@haklex/rich-editor-ui": "^0.43.
|
|
45
|
-
"@haklex/rich-
|
|
43
|
+
"@haklex/rich-editor": "^0.43.2",
|
|
44
|
+
"@haklex/rich-editor-ui": "^0.43.2",
|
|
45
|
+
"@haklex/rich-style-token": "^0.43.2"
|
|
46
46
|
},
|
|
47
47
|
"publishConfig": {
|
|
48
48
|
"access": "public"
|