sales-frontend-bridge 0.0.28 → 0.0.30
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/index.cjs +60 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +84 -8
- package/dist/index.d.ts +84 -8
- package/dist/index.js +53 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2213,6 +2213,14 @@ var commonPdfExportParam = [
|
|
|
2213
2213
|
// 폰트를 포함시킬때 사용하는 글자만 포함시킨다
|
|
2214
2214
|
`pdf.fontembedding_subset=true`
|
|
2215
2215
|
];
|
|
2216
|
+
var commentPenDefaultParam = [
|
|
2217
|
+
`comment.selectedpen=highlightpen`,
|
|
2218
|
+
`comment.highlightpen_thick=15`
|
|
2219
|
+
];
|
|
2220
|
+
var commentPenYellow = [...commentPenDefaultParam, `comment.highlightpen_color=ffcc00`];
|
|
2221
|
+
var commentPenPink = [...commentPenDefaultParam, `comment.highlightpen_color=ff29a2`];
|
|
2222
|
+
var commentPenGreen = [...commentPenDefaultParam, `comment.highlightpen_color=00e536`];
|
|
2223
|
+
var commentPenEraser = [`comment.selectedpen=eraser`];
|
|
2216
2224
|
var wrapperStyle = { display: "flex", flexFlow: "column", gap: "10px" };
|
|
2217
2225
|
var btnStyle = { border: "1px solid red", minHeight: "40px" };
|
|
2218
2226
|
|
|
@@ -2366,6 +2374,42 @@ async function getCurrentPage() {
|
|
|
2366
2374
|
const { data } = await Bridge.nativeOz.getInformation({ command: `CURRENT_PAGE` });
|
|
2367
2375
|
return Number(data);
|
|
2368
2376
|
}
|
|
2377
|
+
async function isCommentMode() {
|
|
2378
|
+
const { data } = await Bridge.nativeOz.getInformation({
|
|
2379
|
+
command: `COMMENT_MODE`
|
|
2380
|
+
});
|
|
2381
|
+
return data === "comment";
|
|
2382
|
+
}
|
|
2383
|
+
async function setCommentMode(penConfig) {
|
|
2384
|
+
const command = `mode_comment_all`;
|
|
2385
|
+
const commentEnabled = await isCommentMode();
|
|
2386
|
+
const param = [
|
|
2387
|
+
...commentEnabled ? [] : [`viewer.screentool=comment`],
|
|
2388
|
+
...penConfig
|
|
2389
|
+
].join("\n");
|
|
2390
|
+
await sleep();
|
|
2391
|
+
return await Bridge.nativeOz.scriptEx({ command, param });
|
|
2392
|
+
}
|
|
2393
|
+
async function setEnableCommentMode(type = "yellow") {
|
|
2394
|
+
let param;
|
|
2395
|
+
if (type === "yellow") {
|
|
2396
|
+
param = commentPenYellow;
|
|
2397
|
+
} else if (type === "pink") {
|
|
2398
|
+
param = commentPenPink;
|
|
2399
|
+
} else if (type === "green") {
|
|
2400
|
+
param = commentPenGreen;
|
|
2401
|
+
} else {
|
|
2402
|
+
param = commentPenEraser;
|
|
2403
|
+
}
|
|
2404
|
+
return await setCommentMode(param);
|
|
2405
|
+
}
|
|
2406
|
+
async function setDisableCommentMode() {
|
|
2407
|
+
const command = `mode_input_all`;
|
|
2408
|
+
return await Bridge.nativeOz.script({ command });
|
|
2409
|
+
}
|
|
2410
|
+
function rangeArray(X, Y) {
|
|
2411
|
+
return Array.from({ length: Y - X + 1 }, (_, i) => X + i);
|
|
2412
|
+
}
|
|
2369
2413
|
|
|
2370
2414
|
// src/oz/use-create-report.ts
|
|
2371
2415
|
function useCreateReport({ documentList, extraData = {} }) {
|
|
@@ -2434,6 +2478,11 @@ function useDocumentInfo(initialValue) {
|
|
|
2434
2478
|
});
|
|
2435
2479
|
return acc;
|
|
2436
2480
|
}, []), [documentIndexMap, documentInfo]);
|
|
2481
|
+
const globalIndexPerTemplate = (0, import_react2.useMemo)(() => documentList.reduce((acc, cur, idx) => {
|
|
2482
|
+
acc[idx] = documentTemplateMap[cur];
|
|
2483
|
+
return acc;
|
|
2484
|
+
}, {}), [documentList, documentTemplateMap]);
|
|
2485
|
+
const isAllComplete = (0, import_react2.useMemo)(() => documentInfo.every((i) => i.complete), [documentInfo]);
|
|
2437
2486
|
return {
|
|
2438
2487
|
setDocumentInfo,
|
|
2439
2488
|
documentInfo,
|
|
@@ -2441,7 +2490,9 @@ function useDocumentInfo(initialValue) {
|
|
|
2441
2490
|
documentTemplateMap,
|
|
2442
2491
|
documentIndexMap,
|
|
2443
2492
|
nameTemplateMap,
|
|
2444
|
-
groupIndexes
|
|
2493
|
+
groupIndexes,
|
|
2494
|
+
globalIndexPerTemplate,
|
|
2495
|
+
isAllComplete
|
|
2445
2496
|
};
|
|
2446
2497
|
}
|
|
2447
2498
|
|
|
@@ -2492,6 +2543,10 @@ exports.OZViewerEvent = OZViewerEvent;
|
|
|
2492
2543
|
exports.btnStyle = btnStyle;
|
|
2493
2544
|
exports.categorizeByPageRange = categorizeByPageRange;
|
|
2494
2545
|
exports.checkDocumentsValidityByIndex = checkDocumentsValidityByIndex;
|
|
2546
|
+
exports.commentPenEraser = commentPenEraser;
|
|
2547
|
+
exports.commentPenGreen = commentPenGreen;
|
|
2548
|
+
exports.commentPenPink = commentPenPink;
|
|
2549
|
+
exports.commentPenYellow = commentPenYellow;
|
|
2495
2550
|
exports.commonOzParam = commonOzParam;
|
|
2496
2551
|
exports.commonPdfExportParam = commonPdfExportParam;
|
|
2497
2552
|
exports.disableFocusOnValidation = disableFocusOnValidation;
|
|
@@ -2504,6 +2559,10 @@ exports.getFileListByGlobalIndex = getFileListByGlobalIndex;
|
|
|
2504
2559
|
exports.getReportCount = getReportCount;
|
|
2505
2560
|
exports.getTotalPage = getTotalPage;
|
|
2506
2561
|
exports.getTotalPageOnAllDocuments = getTotalPageOnAllDocuments;
|
|
2562
|
+
exports.isCommentMode = isCommentMode;
|
|
2563
|
+
exports.rangeArray = rangeArray;
|
|
2564
|
+
exports.setDisableCommentMode = setDisableCommentMode;
|
|
2565
|
+
exports.setEnableCommentMode = setEnableCommentMode;
|
|
2507
2566
|
exports.sleep = sleep;
|
|
2508
2567
|
exports.triggerClickOnAllDocuments = triggerClickOnAllDocuments;
|
|
2509
2568
|
exports.triggerCropImageOnAllDocuments = triggerCropImageOnAllDocuments;
|