@beeintel/batch-image 0.0.0-stage → 1.0.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/FONT-LICENSE.txt +93 -0
- package/README.md +181 -2
- package/dist/assets/11st-D7qGO5e4.webp +0 -0
- package/dist/assets/UPNG-CPfdwFSy.js +2298 -0
- package/dist/assets/adjust-card-B63b81iV.webp +0 -0
- package/dist/assets/adjust-final.worker-C2JbTvv5.js +6945 -0
- package/dist/assets/amazon-CjTtpZTq.webp +0 -0
- package/dist/assets/ascii_art-B4UGbtGs.webp +0 -0
- package/dist/assets/auction-j26eVUQO.webp +0 -0
- package/dist/assets/background-DGdZUdkL.webp +0 -0
- package/dist/assets/background-card-wK7DRpvM.png +0 -0
- package/dist/assets/body-CUFdRg8w.webp +0 -0
- package/dist/assets/bounded-cutout.worker-BZR6mbaI.js +9615 -0
- package/dist/assets/brand-mark-card-cFUeDeO2.webp +0 -0
- package/dist/assets/buyma-dAxYNjow.webp +0 -0
- package/dist/assets/codec.worker-7W6hmsm6.js +7349 -0
- package/dist/assets/contour_lines-C_CqrgV1.webp +0 -0
- package/dist/assets/creema-B1tWyCPx.webp +0 -0
- package/dist/assets/crop-final.worker-Owin7TvX.js +7035 -0
- package/dist/assets/cutout-CzMvV5An.webp +0 -0
- package/dist/assets/cutout-card-CN4gNFBz.png +0 -0
- package/dist/assets/cutout.worker-DyH6Prbn.js +3894 -0
- package/dist/assets/depop-CkVC5Fn1.webp +0 -0
- package/dist/assets/dewrinkle-kFzP6LqD.webp +0 -0
- package/dist/assets/dither-CcxmO2e6.webp +0 -0
- package/dist/assets/douyin-CP_HwBDF.webp +0 -0
- package/dist/assets/download.worker-DnGSB6P_.js +17779 -0
- package/dist/assets/duotone-Cdg_3fQf.webp +0 -0
- package/dist/assets/ebay-CxLfrRAf.webp +0 -0
- package/dist/assets/edit-Cv-txfZm.webp +0 -0
- package/dist/assets/effect.worker-qu1eCcII.js +9227 -0
- package/dist/assets/engraving-BENh1O2O.webp +0 -0
- package/dist/assets/etsy-CSvz9GpY.webp +0 -0
- package/dist/assets/expand-C60VE9nK.webp +0 -0
- package/dist/assets/facebook-Ca2nJJiQ.webp +0 -0
- package/dist/assets/film_stock-Bqauwcq4.webp +0 -0
- package/dist/assets/final.worker-BnzJ3N5C.js +7035 -0
- package/dist/assets/final.worker-Csc1zoYS.js +7054 -0
- package/dist/assets/final.worker-DzBFT9xk.js +6922 -0
- package/dist/assets/final.worker-XpgKnlaz.js +7217 -0
- package/dist/assets/flatlay-CPiVmlAa.webp +0 -0
- package/dist/assets/flatlay-fold-B-CRYy87.webp +0 -0
- package/dist/assets/flatlay-open-Dzas8okC.webp +0 -0
- package/dist/assets/g-market-DXuYK_JH.webp +0 -0
- package/dist/assets/ghost-BCEAx_Zx.webp +0 -0
- package/dist/assets/ghost-front-WFgA4sUo.webp +0 -0
- package/dist/assets/ghost-three-quarter-Rt8cXj34.webp +0 -0
- package/dist/assets/gif-CObOIITx.js +303 -0
- package/dist/assets/glass_tiles-3IXP-Hmg.webp +0 -0
- package/dist/assets/glitch_art-D1i3qben.webp +0 -0
- package/dist/assets/glitch_blur-C4q_9zyq.webp +0 -0
- package/dist/assets/glow-Bv9EHBU5.webp +0 -0
- package/dist/assets/gradient_map-BR-UVYMP.webp +0 -0
- package/dist/assets/halftone-CWdKu2_6.webp +0 -0
- package/dist/assets/holo_sticker-BQDikLg2.webp +0 -0
- package/dist/assets/idus-7diqRNPs.webp +0 -0
- package/dist/assets/imagetracer.worker-CgunQTPG.js +7096 -0
- package/dist/assets/instagram-Bf0IVidT.webp +0 -0
- package/dist/assets/kakao-talk-Df79L_Mv.webp +0 -0
- package/dist/assets/kaleidoscope-BxqMZuWo.webp +0 -0
- package/dist/assets/karrot-BXFPhDwt.webp +0 -0
- package/dist/assets/kaufland-BDDy6e0C.webp +0 -0
- package/dist/assets/lazada-ConR4e1O.webp +0 -0
- package/dist/assets/lens_flare-DgyiAv_j.webp +0 -0
- package/dist/assets/light_leak-kUdpoFuC.webp +0 -0
- package/dist/assets/line-Dr1j___B.webp +0 -0
- package/dist/assets/linkedin-4s_9Wh03.webp +0 -0
- package/dist/assets/lo_fi-DSdl3yY_.webp +0 -0
- package/dist/assets/logo-preparation.worker-D9oa7SME.js +420 -0
- package/dist/assets/mercado-libre-C8CskEiS.webp +0 -0
- package/dist/assets/mercari-jp-DHj7nz4O.webp +0 -0
- package/dist/assets/metadata.worker-B_9_BgN1.js +6456 -0
- package/dist/assets/mirror_collage-JtSKCeSh.webp +0 -0
- package/dist/assets/model-BbeF-fsf.webp +0 -0
- package/dist/assets/model-BjWhieit.webp +0 -0
- package/dist/assets/momo-BWXO_8Df.webp +0 -0
- package/dist/assets/motion_blur-B8YUHeSg.webp +0 -0
- package/dist/assets/naver-xQKL8lWg.webp +0 -0
- package/dist/assets/nuvemshop-DPt6rnA-.webp +0 -0
- package/dist/assets/olx-B87gp-Il.webp +0 -0
- package/dist/assets/orient-card-Da0ii6mX.webp +0 -0
- package/dist/assets/orient-final.worker-CdF5Y5zD.js +6909 -0
- package/dist/assets/orientation-preview.worker-B7uFzz3J.js +6865 -0
- package/dist/assets/ort.bundle.min-CreFV8V1.js +9311 -0
- package/dist/assets/ort.webgpu.bundle.min-CAudaHZO.js +9311 -0
- package/dist/assets/otto-market-DWZyNKJn.webp +0 -0
- package/dist/assets/paper_texture-CXphyIrs.webp +0 -0
- package/dist/assets/pinterest-ByZqih2J.webp +0 -0
- package/dist/assets/polish-DFy6LNG7.webp +0 -0
- package/dist/assets/poshmark-DnZi2vA1.webp +0 -0
- package/dist/assets/posterize-SpLVGq1s.webp +0 -0
- package/dist/assets/preview.worker-DcrCKKWl.js +380 -0
- package/dist/assets/qoo10-C1pq81Jx.webp +0 -0
- package/dist/assets/rakuten-ulYog1hL.webp +0 -0
- package/dist/assets/recolor-mBX7vdFT.webp +0 -0
- package/dist/assets/resize-DVEAl0Um.webp +0 -0
- package/dist/assets/runtime-0663b902fb3937883a34.wasm +0 -0
- package/dist/assets/runtime-355a5c80c7bfdf8737de.mjs +2817 -0
- package/dist/assets/runtime-49871f5a4409519797e1.wasm +0 -0
- package/dist/assets/runtime-74cf72f9a2b7befc115a.mjs +2817 -0
- package/dist/assets/shadow-card-DTZEH60r.png +0 -0
- package/dist/assets/shopee-Bxfei6sj.webp +0 -0
- package/dist/assets/shopify-wVaBafcF.webp +0 -0
- package/dist/assets/shopline-DMoaJ7Bh.webp +0 -0
- package/dist/assets/sparkle-CD5GSGip.webp +0 -0
- package/dist/assets/ssg-DQoFx5u5.webp +0 -0
- package/dist/assets/staging-CIc8pQJ6.webp +0 -0
- package/dist/assets/standard-cutout.worker-BYLzdpR-.js +1261 -0
- package/dist/assets/text-DQW2mBGp.webp +0 -0
- package/dist/assets/textured_glass-D2coxp7n.webp +0 -0
- package/dist/assets/tga-VGxWDes0.js +752 -0
- package/dist/assets/tilt_shift-BKs46yeX.webp +0 -0
- package/dist/assets/transformers.web-DB57cIO5.js +28891 -0
- package/dist/assets/tritone-CcR4qizk.webp +0 -0
- package/dist/assets/upscale-BrLadyUk.webp +0 -0
- package/dist/assets/upscale-creative-DnZnQufJ.webp +0 -0
- package/dist/assets/upscale-crisp-Ckdmbsnn.webp +0 -0
- package/dist/assets/vinted-1QDsxvC6.webp +0 -0
- package/dist/assets/watercolor-CV67zYNE.webp +0 -0
- package/dist/assets/watermark-CpPrxaT5.webp +0 -0
- package/dist/assets/wave_distortion-CV5jVfK4.webp +0 -0
- package/dist/assets/whatsapp-CWJxqzR6.webp +0 -0
- package/dist/assets/worker-DfrCFP3O.js +55 -0
- package/dist/assets/xerox_noise-CbbHY1S1.webp +0 -0
- package/dist/assets/youtube-DS12d5mi.webp +0 -0
- package/dist/assets/zalando-CenfWOwz.webp +0 -0
- package/dist/browser-adapter.d.ts +4 -0
- package/dist/browser-cutout-capability.d.ts +4 -0
- package/dist/browser-cutout-resources.d.ts +3 -0
- package/dist/browser-local-capabilities.d.ts +5 -0
- package/dist/capabilities.d.ts +18 -0
- package/dist/chunks/AdjustToolPanel-B6dtlFlj.js +195 -0
- package/dist/chunks/BackgroundToolPanel-C3Rr9d4S.js +41 -0
- package/dist/chunks/BatchMaterials-DDoJTaS5.js +806 -0
- package/dist/chunks/BatchModeChoices-DeBARgvY.js +111 -0
- package/dist/chunks/BatchOutputColorPicker-D7WIDS4_.js +75 -0
- package/dist/chunks/BatchReferenceFields-Cr5WgFRJ.js +316 -0
- package/dist/chunks/BeautifyToolPanel-DDZXDQKM.js +215 -0
- package/dist/chunks/BrandMarkToolPanel-vKobk_R3.js +1179 -0
- package/dist/chunks/ContentTrimControl-BKCJEst5.js +297 -0
- package/dist/chunks/CropToolPanel-C_sW5tWL.js +218 -0
- package/dist/chunks/CutoutToolPanel-B7ObmiWd.js +73 -0
- package/dist/chunks/DisclosureToolPanel-F3ccFJIF.js +76 -0
- package/dist/chunks/ExpandToolPanel-BKjj5UJA.js +67 -0
- package/dist/chunks/ImageEffectsToolPanel-CsDIBpT6.js +966 -0
- package/dist/chunks/IpAuditToolPanel-CduDfFh-.js +96 -0
- package/dist/chunks/ListingToolPanel-8pJ2_zvI.js +783 -0
- package/dist/chunks/MaterialSelectionPlate-CW7HaS6v.js +30 -0
- package/dist/chunks/MetadataToolPanel-C8XJOamN.js +104 -0
- package/dist/chunks/OrientToolPanel-C1AzQchm.js +161 -0
- package/dist/chunks/PluginActionFooter.vue_vue_type_script_setup_true_lang-BGe419qz.js +102 -0
- package/dist/chunks/ResizeToolPanel-DWikcj2G.js +1178 -0
- package/dist/chunks/RetouchToolPanel-B4eQKk2W.js +350 -0
- package/dist/chunks/ShadowToolPanel-Bbj76hQd.js +254 -0
- package/dist/chunks/SvgExportToolPanel-BRxpzd7q.js +219 -0
- package/dist/chunks/TranslationToolPanel-Bxv8U2WY.js +125 -0
- package/dist/chunks/UpscaleToolPanel-BRIgpszs.js +127 -0
- package/dist/chunks/engine-D-T-1RSx.js +69 -0
- package/dist/chunks/entry-CboOSe2r.js +42945 -0
- package/dist/chunks/gpu-CScw5MNG.js +231 -0
- package/dist/chunks/hosted-resources-COzZ7nZY.js +8196 -0
- package/dist/chunks/loader-circle-CylCgDqP.js +16 -0
- package/dist/chunks/motionFeatures-D67ghPG1.js +4405 -0
- package/dist/chunks/search-BwsDnulU.js +18 -0
- package/dist/chunks/standard-cutout-vPpP6xBc.js +45 -0
- package/dist/chunks/static-logo-2F9ORZWc.js +34 -0
- package/dist/config.d.ts +66 -0
- package/dist/contracts.d.ts +272 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +13 -0
- package/dist/node/catalog.mjs +45 -0
- package/dist/node/cli.mjs +11 -0
- package/dist/node/index.d.mts +20 -0
- package/dist/node/index.mjs +2 -0
- package/dist/node/prepare.mjs +114 -0
- package/dist/node/vite.mjs +46 -0
- package/dist/processing.d.ts +1 -0
- package/dist/processing.js +12105 -0
- package/dist/remote-contracts.d.ts +114 -0
- package/dist/resource-contracts.d.ts +40 -0
- package/dist/resources/cutout/9ae2e5375a34fa413530954dc20d085d175faffc86108c13619220d0557f80bf.json +1 -0
- package/dist/resources/cutout/f119dabecc64bc436d3d08425dde96ec2598fd40541eba97d8d53a4e8bbdcaea.json +1 -0
- package/dist/resources/cutout/resources.json +195 -0
- package/dist/resources/cutout/sources.json +294 -0
- package/dist/resources.json +1191 -0
- package/dist/service-contracts.d.ts +43 -0
- package/dist/slots.d.ts +21 -0
- package/dist/style.css +1 -0
- package/dist/types/batch/api.d.ts +89 -0
- package/dist/types/batch/cutout-output.d.ts +2 -0
- package/dist/types/batch/features/background/engine.d.mts +12 -0
- package/dist/types/batch/features/basic-edit/contracts.d.ts +87 -0
- package/dist/types/batch/features/basic-edit/engine.d.mts +96 -0
- package/dist/types/batch/features/brand-mark/contracts.d.ts +84 -0
- package/dist/types/batch/features/brand-mark/engine.d.mts +68 -0
- package/dist/types/batch/features/export-compression/contracts.d.ts +44 -0
- package/dist/types/batch/features/export-compression/gifenc.d.ts +33 -0
- package/dist/types/batch/features/export-compression/plan.d.ts +45 -0
- package/dist/types/batch/features/export-compression/presentation.d.ts +70 -0
- package/dist/types/batch/features/export-compression/upng.d.ts +6 -0
- package/dist/types/batch/features/final-image/resize.d.mts +15 -0
- package/dist/types/batch/features/image-effects/contracts.d.ts +58 -0
- package/dist/types/batch/features/image-effects/gpu-pixel-runtime.d.ts +15 -0
- package/dist/types/batch/features/image-effects/photo-audit.d.ts +21 -0
- package/dist/types/batch/features/image-effects/photo-v7-cpu.d.ts +9 -0
- package/dist/types/batch/features/image-effects/profiles-v4.d.ts +157 -0
- package/dist/types/batch/features/image-effects/profiles-v5.d.ts +20 -0
- package/dist/types/batch/features/image-effects/profiles-v6.d.ts +14 -0
- package/dist/types/batch/features/image-effects/profiles-v7.d.ts +53 -0
- package/dist/types/batch/features/image-effects/profiles-v8.d.ts +113 -0
- package/dist/types/batch/features/image-effects/profiles-v9.d.ts +20 -0
- package/dist/types/batch/features/image-translation/params.d.ts +257 -0
- package/dist/types/batch/features/listing-remake/transport.d.ts +21 -0
- package/dist/types/batch/features/metadata/bytes.d.mts +13 -0
- package/dist/types/batch/features/metadata/containers.d.mts +20 -0
- package/dist/types/batch/features/metadata/declaration.d.mts +5 -0
- package/dist/types/batch/features/metadata/engine.d.mts +9 -0
- package/dist/types/batch/features/metadata/exchange.d.mts +48 -0
- package/dist/types/batch/features/shadow/contracts.d.ts +43 -0
- package/dist/types/batch/features/shadow/engine.d.mts +33 -0
- package/dist/types/batch/features/svg-export/download-contract.d.ts +33 -0
- package/dist/types/batch/features/svg-export/download-prepare.d.ts +2 -0
- package/dist/types/batch/features/svg-export/download.d.ts +7 -0
- package/dist/types/batch/features/svg-export/imagetracer.d.ts +6 -0
- package/dist/types/batch/features/svg-export/optimizer.d.ts +2 -0
- package/dist/types/batch/ids.d.ts +1 -0
- package/dist/types/batch/model.d.ts +317 -0
- package/dist/types/batch/public/config.d.ts +66 -0
- package/dist/types/batch/public/contracts.d.ts +272 -0
- package/dist/types/batch/public/remote-contracts.d.ts +114 -0
- package/dist/types/batch/public/resource-contracts.d.ts +40 -0
- package/dist/types/batch/public/service-contracts.d.ts +43 -0
- package/dist/types/batch/queue.d.ts +34 -0
- package/dist/types/batch/receipts.d.ts +85 -0
- package/dist/types/batch/retention.d.ts +13 -0
- package/dist/types/onnxruntime-web.d.ts +5 -0
- package/dist/types/plugins/cutout/core/hosted-resources.d.ts +11 -0
- package/dist/types/processing.d.ts +18 -0
- package/dist/types/shared/svg-security.d.mts +4 -0
- package/dist/types/workspace-worker.d.ts +2 -0
- package/package.json +91 -3
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
import { defineComponent as R, useId as q, computed as g, openBlock as c, createElementBlock as w, createElementVNode as l, unref as o, ref as M, watch as S, onUnmounted as F, normalizeClass as G, createTextVNode as T, toDisplayString as m, createBlock as L, createCommentVNode as p, createVNode as O } from "vue";
|
|
2
|
+
import { _ as H, F as Y, P as j, at as J } from "./entry-CboOSe2r.js";
|
|
3
|
+
import { aq as K, e as Q } from "./hosted-resources-COzZ7nZY.js";
|
|
4
|
+
const Z = ["viewBox"], _ = ["id", "width", "height"], ee = ["width", "height"], te = ["width", "height"], ie = ["x", "y", "width", "height"], ae = ["width", "height", "fill"], ne = ["transform"], le = ["width", "height"], re = ["cx", "cy", "r"], de = ["points"], oe = ["width", "height"], se = ["width", "height"], ue = /* @__PURE__ */ R({
|
|
5
|
+
__name: "ContentTrimIllustration",
|
|
6
|
+
props: {
|
|
7
|
+
padding: {},
|
|
8
|
+
width: { default: 240 },
|
|
9
|
+
height: { default: 180 },
|
|
10
|
+
paddingColor: { default: "transparent" }
|
|
11
|
+
},
|
|
12
|
+
setup(e) {
|
|
13
|
+
const f = e, $ = q(), n = g(() => ({
|
|
14
|
+
width: f.width + 2 * f.padding,
|
|
15
|
+
height: f.height + 2 * f.padding
|
|
16
|
+
})), i = g(() => Math.max(4, Math.max(n.value.width, n.value.height) / 22));
|
|
17
|
+
return (b, E) => (c(), w("svg", {
|
|
18
|
+
class: "trim-illustration",
|
|
19
|
+
viewBox: `0 0 ${n.value.width} ${n.value.height}`,
|
|
20
|
+
preserveAspectRatio: "xMidYMid meet",
|
|
21
|
+
"aria-hidden": "true"
|
|
22
|
+
}, [
|
|
23
|
+
l("defs", null, [
|
|
24
|
+
l("pattern", {
|
|
25
|
+
id: o($),
|
|
26
|
+
width: i.value * 2,
|
|
27
|
+
height: i.value * 2,
|
|
28
|
+
patternUnits: "userSpaceOnUse"
|
|
29
|
+
}, [
|
|
30
|
+
l("rect", {
|
|
31
|
+
width: i.value * 2,
|
|
32
|
+
height: i.value * 2,
|
|
33
|
+
fill: "#ffffff"
|
|
34
|
+
}, null, 8, ee),
|
|
35
|
+
l("rect", {
|
|
36
|
+
width: i.value,
|
|
37
|
+
height: i.value,
|
|
38
|
+
fill: "#e4e4e7"
|
|
39
|
+
}, null, 8, te),
|
|
40
|
+
l("rect", {
|
|
41
|
+
x: i.value,
|
|
42
|
+
y: i.value,
|
|
43
|
+
width: i.value,
|
|
44
|
+
height: i.value,
|
|
45
|
+
fill: "#e4e4e7"
|
|
46
|
+
}, null, 8, ie)
|
|
47
|
+
], 8, _)
|
|
48
|
+
]),
|
|
49
|
+
l("rect", {
|
|
50
|
+
width: n.value.width,
|
|
51
|
+
height: n.value.height,
|
|
52
|
+
fill: e.paddingColor === "transparent" ? `url(#${o($)})` : e.paddingColor
|
|
53
|
+
}, null, 8, ae),
|
|
54
|
+
l("g", {
|
|
55
|
+
transform: `translate(${e.padding} ${e.padding})`
|
|
56
|
+
}, [
|
|
57
|
+
l("rect", {
|
|
58
|
+
class: "illustration-content",
|
|
59
|
+
width: e.width,
|
|
60
|
+
height: e.height
|
|
61
|
+
}, null, 8, le),
|
|
62
|
+
l("circle", {
|
|
63
|
+
class: "illustration-sun",
|
|
64
|
+
cx: e.width * 0.76,
|
|
65
|
+
cy: e.height * 0.26,
|
|
66
|
+
r: Math.min(e.width, e.height) * 0.105
|
|
67
|
+
}, null, 8, re),
|
|
68
|
+
l("polygon", {
|
|
69
|
+
class: "illustration-mountain",
|
|
70
|
+
points: `${e.width * 0.08},${e.height * 0.87} ${e.width * 0.4},${e.height * 0.35} ${e.width * 0.62},${e.height * 0.69} ${e.width * 0.76},${e.height * 0.51} ${e.width * 0.94},${e.height * 0.87}`
|
|
71
|
+
}, null, 8, de),
|
|
72
|
+
l("rect", {
|
|
73
|
+
width: e.width,
|
|
74
|
+
height: e.height,
|
|
75
|
+
fill: "none",
|
|
76
|
+
stroke: "#5a6b3b",
|
|
77
|
+
"stroke-dasharray": "3 2",
|
|
78
|
+
"vector-effect": "non-scaling-stroke"
|
|
79
|
+
}, null, 8, oe)
|
|
80
|
+
], 8, ne),
|
|
81
|
+
l("rect", {
|
|
82
|
+
width: n.value.width,
|
|
83
|
+
height: n.value.height,
|
|
84
|
+
fill: "none",
|
|
85
|
+
stroke: "#8ba328",
|
|
86
|
+
"vector-effect": "non-scaling-stroke"
|
|
87
|
+
}, null, 8, se)
|
|
88
|
+
], 8, Z));
|
|
89
|
+
}
|
|
90
|
+
}), he = /* @__PURE__ */ H(ue, [["__scopeId", "data-v-be18d6f4"]]), ce = {
|
|
91
|
+
key: 0,
|
|
92
|
+
class: "trim-switch-row"
|
|
93
|
+
}, ge = ["title"], ve = ["title", "aria-label", "aria-checked", "disabled"], me = {
|
|
94
|
+
key: 1,
|
|
95
|
+
class: "trim-options"
|
|
96
|
+
}, we = { class: "trim-fields" }, fe = ["title"], pe = ["max", "aria-label", "value", "disabled", "aria-invalid"], be = ["aria-label"], ke = {
|
|
97
|
+
key: 0,
|
|
98
|
+
class: "trim-output",
|
|
99
|
+
role: "status"
|
|
100
|
+
}, xe = { dir: "ltr" }, ye = {
|
|
101
|
+
key: 1,
|
|
102
|
+
class: "trim-message",
|
|
103
|
+
role: "status"
|
|
104
|
+
}, $e = /* @__PURE__ */ R({
|
|
105
|
+
__name: "ContentTrimControl",
|
|
106
|
+
props: {
|
|
107
|
+
enabled: { type: Boolean },
|
|
108
|
+
hint: {},
|
|
109
|
+
padding: { default: 0 },
|
|
110
|
+
maxPadding: { default: 4096 },
|
|
111
|
+
paddingColor: { default: "transparent" },
|
|
112
|
+
disabled: { type: Boolean },
|
|
113
|
+
showSwitch: { type: Boolean, default: !0 },
|
|
114
|
+
source: {},
|
|
115
|
+
estimateApplied: { type: Boolean, default: !1 },
|
|
116
|
+
help: {}
|
|
117
|
+
},
|
|
118
|
+
emits: ["enabled", "padding", "validity"],
|
|
119
|
+
setup(e, { emit: f }) {
|
|
120
|
+
const { ui: $, uiText: n } = Y(), i = e, b = f, E = g(
|
|
121
|
+
() => $("tools.crop.contentTrim.paddingRange", { p0: String(i.maxPadding) })
|
|
122
|
+
), v = M(String(i.padding)), d = M(""), s = M({ kind: "empty" });
|
|
123
|
+
let r, k = !1;
|
|
124
|
+
const x = g(() => s.value.kind === "ready" ? s.value.result : void 0);
|
|
125
|
+
let C = 0, I, P;
|
|
126
|
+
const u = g(() => {
|
|
127
|
+
const t = x.value;
|
|
128
|
+
if (t?.alphaBounds)
|
|
129
|
+
try {
|
|
130
|
+
return K(t.alphaBounds, t.sourceWidth, t.sourceHeight, i.padding);
|
|
131
|
+
} catch (a) {
|
|
132
|
+
return { kind: "error", message: a.message };
|
|
133
|
+
}
|
|
134
|
+
}), U = g(() => {
|
|
135
|
+
const t = u.value, a = x.value;
|
|
136
|
+
return !i.showSwitch && (i.padding === 0 || i.paddingColor === "transparent") && t?.kind === "render" && !!a && t.width === a.sourceWidth && t.height === a.sourceHeight && t.sourceRect.x === t.padding && t.sourceRect.y === t.padding;
|
|
137
|
+
}), A = g(
|
|
138
|
+
() => (d.value === "padding-range" ? E.value : n(d.value)) || (s.value.kind === "loading" ? n("读取原图内容…") : s.value.kind === "error" ? n(s.value.message) : "") || (u.value?.kind === "error" ? n(u.value.message) : u.value?.kind === "skip" ? n("图片全透明,保留原版本") : "")
|
|
139
|
+
), N = g(() => {
|
|
140
|
+
const t = x.value?.alphaBounds;
|
|
141
|
+
return t?.kind === "crop" ? { width: t.rect.width, height: t.rect.height } : { width: x.value?.sourceWidth ?? 240, height: x.value?.sourceHeight ?? 180 };
|
|
142
|
+
});
|
|
143
|
+
function V(t) {
|
|
144
|
+
i.disabled || t.button !== 0 || (r = { pointerId: t.pointerId, x: t.clientX, value: i.padding, phase: "pressed" }, k = !1, t.currentTarget.setPointerCapture(t.pointerId));
|
|
145
|
+
}
|
|
146
|
+
function W(t) {
|
|
147
|
+
if (!r || r.pointerId !== t.pointerId || i.disabled) return;
|
|
148
|
+
const a = Math.round(t.clientX - r.x);
|
|
149
|
+
if (r.phase === "pressed" && Math.abs(a) < 3) return;
|
|
150
|
+
r.phase = "dragging", t.preventDefault(), window.getSelection()?.removeAllRanges();
|
|
151
|
+
const h = Math.max(0, Math.min(i.maxPadding, r.value + a));
|
|
152
|
+
v.value = String(h), d.value = "", b("padding", h);
|
|
153
|
+
}
|
|
154
|
+
function B(t) {
|
|
155
|
+
if (!r || r.pointerId !== t.pointerId) return;
|
|
156
|
+
k = r.phase === "dragging";
|
|
157
|
+
const a = t.currentTarget;
|
|
158
|
+
a.hasPointerCapture(t.pointerId) && a.releasePointerCapture(t.pointerId), r = void 0;
|
|
159
|
+
}
|
|
160
|
+
function D(t) {
|
|
161
|
+
k && (t.preventDefault(), t.stopPropagation(), k = !1);
|
|
162
|
+
}
|
|
163
|
+
function z(t) {
|
|
164
|
+
if (!i.disabled) {
|
|
165
|
+
v.value = t.target.value;
|
|
166
|
+
try {
|
|
167
|
+
if (!v.value.trim()) throw new Error("请输入透明边距");
|
|
168
|
+
const a = Number(v.value);
|
|
169
|
+
if (!Number.isInteger(a) || a < 0 || a > i.maxPadding)
|
|
170
|
+
throw new Error("padding-range");
|
|
171
|
+
const h = Q(a);
|
|
172
|
+
d.value = "", b("padding", h);
|
|
173
|
+
} catch (a) {
|
|
174
|
+
d.value = a.message;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
return S(
|
|
179
|
+
() => i.padding,
|
|
180
|
+
(t) => {
|
|
181
|
+
v.value = String(t), d.value = "";
|
|
182
|
+
}
|
|
183
|
+
), S(
|
|
184
|
+
() => i.enabled,
|
|
185
|
+
() => {
|
|
186
|
+
v.value = String(i.padding), d.value = "";
|
|
187
|
+
}
|
|
188
|
+
), S(
|
|
189
|
+
() => `${i.enabled}/${i.source?.versionId}/${i.source?.url}`,
|
|
190
|
+
async () => {
|
|
191
|
+
const t = ++C;
|
|
192
|
+
if (r = void 0, k = !1, I?.abort(), P?.dispose(), P = void 0, s.value = { kind: "empty" }, !i.enabled || !i.source) return;
|
|
193
|
+
I = new AbortController();
|
|
194
|
+
const a = I.signal, h = P = J();
|
|
195
|
+
s.value = { kind: "loading" };
|
|
196
|
+
try {
|
|
197
|
+
if (!i.source.url.startsWith("blob:")) throw Error("预览来源须由工作台读取");
|
|
198
|
+
const y = await fetch(i.source.url, { signal: a });
|
|
199
|
+
if (!y.ok) throw new Error("无法读取预览来源");
|
|
200
|
+
const X = await h.render(
|
|
201
|
+
await y.blob(),
|
|
202
|
+
{ tool: "crop", params: { version: 1, ratio: "alpha-bounds", anchor: "center" } },
|
|
203
|
+
a,
|
|
204
|
+
160
|
|
205
|
+
);
|
|
206
|
+
t === C && (s.value = { kind: "ready", result: X });
|
|
207
|
+
} catch (y) {
|
|
208
|
+
t === C && y.name !== "AbortError" && (s.value = { kind: "error", message: y.message });
|
|
209
|
+
} finally {
|
|
210
|
+
h.dispose();
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
{ immediate: !0 }
|
|
214
|
+
), S(
|
|
215
|
+
[d, u, () => i.enabled],
|
|
216
|
+
() => b("validity", !i.enabled || !d.value && u.value?.kind !== "error"),
|
|
217
|
+
{ immediate: !0 }
|
|
218
|
+
), F(() => {
|
|
219
|
+
C++, I?.abort(), P?.dispose();
|
|
220
|
+
}), (t, a) => (c(), w("div", {
|
|
221
|
+
class: G(["content-trim-control", { "trim-control-page": !e.showSwitch }])
|
|
222
|
+
}, [
|
|
223
|
+
e.showSwitch || e.help ? (c(), w("div", ce, [
|
|
224
|
+
l("span", { title: e.hint }, [
|
|
225
|
+
T(m(o(n)("按内容裁边")), 1),
|
|
226
|
+
e.help ? (c(), L(j, {
|
|
227
|
+
key: 0,
|
|
228
|
+
text: e.help
|
|
229
|
+
}, null, 8, ["text"])) : p("", !0)
|
|
230
|
+
], 8, ge),
|
|
231
|
+
e.showSwitch ? (c(), w("button", {
|
|
232
|
+
key: 0,
|
|
233
|
+
type: "button",
|
|
234
|
+
class: "batch-switch trim-switch",
|
|
235
|
+
role: "switch",
|
|
236
|
+
title: e.hint,
|
|
237
|
+
"aria-label": o(n)("按内容裁边"),
|
|
238
|
+
"aria-checked": e.enabled,
|
|
239
|
+
disabled: e.disabled,
|
|
240
|
+
onClick: a[0] || (a[0] = (h) => b("enabled", !e.enabled))
|
|
241
|
+
}, [...a[1] || (a[1] = [
|
|
242
|
+
l("span", null, null, -1)
|
|
243
|
+
])], 8, ve)) : p("", !0)
|
|
244
|
+
])) : p("", !0),
|
|
245
|
+
e.enabled ? (c(), w("div", me, [
|
|
246
|
+
l("div", we, [
|
|
247
|
+
l("label", null, [
|
|
248
|
+
T(m(o(n)("透明边距")), 1),
|
|
249
|
+
l("span", {
|
|
250
|
+
class: "trim-number",
|
|
251
|
+
title: o(n)("按住左右拖动调整,点击可输入数字"),
|
|
252
|
+
onPointerdown: V,
|
|
253
|
+
onPointermove: W,
|
|
254
|
+
onPointerup: B,
|
|
255
|
+
onPointercancel: B,
|
|
256
|
+
onLostpointercapture: B,
|
|
257
|
+
onClickCapture: D
|
|
258
|
+
}, [
|
|
259
|
+
l("input", {
|
|
260
|
+
type: "number",
|
|
261
|
+
min: "0",
|
|
262
|
+
max: e.maxPadding,
|
|
263
|
+
step: "1",
|
|
264
|
+
"aria-label": o(n)("透明边距(px)"),
|
|
265
|
+
value: v.value,
|
|
266
|
+
disabled: e.disabled,
|
|
267
|
+
"aria-invalid": !!d.value,
|
|
268
|
+
onInput: z
|
|
269
|
+
}, null, 40, pe),
|
|
270
|
+
a[2] || (a[2] = l("span", null, "px", -1))
|
|
271
|
+
], 40, fe)
|
|
272
|
+
]),
|
|
273
|
+
l("small", null, m(o(n)("四边相同 · 不缩放")), 1)
|
|
274
|
+
]),
|
|
275
|
+
l("figure", {
|
|
276
|
+
class: "trim-mini",
|
|
277
|
+
"aria-label": o(n)("透明边距抽象示意")
|
|
278
|
+
}, [
|
|
279
|
+
O(he, {
|
|
280
|
+
padding: e.padding,
|
|
281
|
+
"padding-color": e.paddingColor,
|
|
282
|
+
width: N.value.width,
|
|
283
|
+
height: N.value.height
|
|
284
|
+
}, null, 8, ["padding", "padding-color", "width", "height"])
|
|
285
|
+
], 8, be),
|
|
286
|
+
!e.estimateApplied && u.value?.kind === "render" && !d.value ? (c(), w("p", ke, [
|
|
287
|
+
l("bdi", xe, m(u.value.width) + " × " + m(u.value.height) + " px", 1),
|
|
288
|
+
T(" · " + m(o(n)(U.value ? "当前图边距已符合" : "未提交")), 1)
|
|
289
|
+
])) : p("", !0),
|
|
290
|
+
A.value ? (c(), w("p", ye, m(A.value), 1)) : p("", !0)
|
|
291
|
+
])) : p("", !0)
|
|
292
|
+
], 2));
|
|
293
|
+
}
|
|
294
|
+
}), Se = /* @__PURE__ */ H($e, [["__scopeId", "data-v-2888b532"]]);
|
|
295
|
+
export {
|
|
296
|
+
Se as C
|
|
297
|
+
};
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import { defineComponent as B, computed as V, openBlock as c, createElementBlock as u, unref as t, createElementVNode as i, createTextVNode as x, toDisplayString as b, Fragment as y, renderList as _, createBlock as j, createVNode as w, createCommentVNode as R, ref as D, withCtx as C } from "vue";
|
|
2
|
+
import { F as z, R as F, _ as T, G as U } from "./entry-CboOSe2r.js";
|
|
3
|
+
import { ar as A, h as P } from "./hosted-resources-COzZ7nZY.js";
|
|
4
|
+
import { C as E } from "./ContentTrimControl-BKCJEst5.js";
|
|
5
|
+
import { u as N, a as S, c as I, _ as L, n as Z } from "./PluginActionFooter.vue_vue_type_script_setup_true_lang-BGe419qz.js";
|
|
6
|
+
const G = ["disabled", "aria-label"], O = ["aria-label", "value"], Y = ["value"], q = {
|
|
7
|
+
key: 1,
|
|
8
|
+
class: "basic-crop-position"
|
|
9
|
+
}, H = { class: "basic-crop-keep" }, J = ["aria-label"], K = ["aria-label", "title", "aria-pressed", "disabled", "onClick"], Q = { class: "basic-crop-examples" }, W = ["viewBox", "aria-label"], X = ["width", "height"], ee = ["points"], te = ["cx", "cy", "r"], ae = ["d"], le = ["x", "y", "width", "height"], oe = {
|
|
10
|
+
class: "basic-crop-position-description",
|
|
11
|
+
role: "status"
|
|
12
|
+
}, ie = { class: "hint" }, se = ["aria-label"], ne = /* @__PURE__ */ B({
|
|
13
|
+
__name: "BasicCropPanel",
|
|
14
|
+
props: {
|
|
15
|
+
modelValue: {},
|
|
16
|
+
disabled: { type: Boolean },
|
|
17
|
+
hideReset: { type: Boolean },
|
|
18
|
+
trimPreviewSource: {}
|
|
19
|
+
},
|
|
20
|
+
emits: ["update:modelValue", "validity"],
|
|
21
|
+
setup(a, { emit: v }) {
|
|
22
|
+
const { ui: l, uiText: d } = z(), s = a, r = v, h = ["original", "alpha-bounds", "1:1", "4:3", "3:4", "16:9", "9:16"], m = [
|
|
23
|
+
{ value: "top-left", label: "左上", symbol: "↖" },
|
|
24
|
+
{ value: "top", label: "顶部", symbol: "↑" },
|
|
25
|
+
{ value: "top-right", label: "右上", symbol: "↗" },
|
|
26
|
+
{ value: "left", label: "左侧", symbol: "←" },
|
|
27
|
+
{ value: "center", label: "居中", symbol: "·" },
|
|
28
|
+
{ value: "right", label: "右侧", symbol: "→" },
|
|
29
|
+
{ value: "bottom-left", label: "左下", symbol: "↙" },
|
|
30
|
+
{ value: "bottom", label: "底部", symbol: "↓" },
|
|
31
|
+
{ value: "bottom-right", label: "右下", symbol: "↘" }
|
|
32
|
+
], g = V(
|
|
33
|
+
() => s.modelValue.ratio === "alpha-bounds" ? d("按所有非透明像素裁切,不缩放;保留阴影和分离主体") : s.modelValue.ratio === "original" ? l("tools.adjust.basicCropPanel_2f513c08") : l("tools.adjust.basicCropPanel_cb44129d", {
|
|
34
|
+
p0: d(m.find((n) => n.value === s.modelValue.anchor)?.label) || l("tools.resize.sizeCropPanel_4cc3885c")
|
|
35
|
+
})
|
|
36
|
+
), p = V(
|
|
37
|
+
() => [
|
|
38
|
+
{ label: l("tools.resize.sizeCropPanel_86ab646d"), width: 400, height: 300 },
|
|
39
|
+
{ label: l("tools.resize.sizeCropPanel_577124ca"), width: 300, height: 400 }
|
|
40
|
+
].filter(() => s.modelValue.ratio !== "alpha-bounds").map((n) => {
|
|
41
|
+
const o = A(n.width, n.height, s.modelValue), e = `M0 0h${n.width}v${n.height}h-${n.width}Z M${o.x} ${o.y}h${o.width}v${o.height}h-${o.width}Z`;
|
|
42
|
+
return { ...n, rect: o, mask: e };
|
|
43
|
+
})
|
|
44
|
+
);
|
|
45
|
+
function f(n) {
|
|
46
|
+
if (s.disabled) return;
|
|
47
|
+
const o = n.target.value;
|
|
48
|
+
if (h.includes(o)) {
|
|
49
|
+
const { padding: e, ...k } = s.modelValue;
|
|
50
|
+
r("validity", !0), r("update:modelValue", {
|
|
51
|
+
...k,
|
|
52
|
+
ratio: o,
|
|
53
|
+
...o === "alpha-bounds" && e ? { padding: e } : {}
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
function M(n) {
|
|
58
|
+
!s.disabled && s.modelValue.ratio !== "original" && r("update:modelValue", { ...s.modelValue, anchor: n });
|
|
59
|
+
}
|
|
60
|
+
function $() {
|
|
61
|
+
s.disabled || (r("validity", !0), r("update:modelValue", { ...P }));
|
|
62
|
+
}
|
|
63
|
+
return (n, o) => (c(), u("fieldset", {
|
|
64
|
+
class: "basic-crop-panel",
|
|
65
|
+
disabled: a.disabled,
|
|
66
|
+
"aria-label": t(l)("tools.adjust.basicCropPanel_1b5d2a12")
|
|
67
|
+
}, [
|
|
68
|
+
i("label", null, [
|
|
69
|
+
x(b(t(l)("common.toolPanel_16e195aa")), 1),
|
|
70
|
+
i("select", {
|
|
71
|
+
"aria-label": t(l)("common.toolPanel_16e195aa"),
|
|
72
|
+
value: a.modelValue.ratio,
|
|
73
|
+
onChange: f
|
|
74
|
+
}, [
|
|
75
|
+
(c(), u(y, null, _(h, (e) => i("option", {
|
|
76
|
+
key: e,
|
|
77
|
+
value: e
|
|
78
|
+
}, b(e === "original" ? t(l)("tools.adjust.basicCropPanel_2d3a3ea7") : e === "alpha-bounds" ? t(d)("按内容裁边") : e), 9, Y)), 64))
|
|
79
|
+
], 40, O)
|
|
80
|
+
]),
|
|
81
|
+
a.modelValue.ratio === "alpha-bounds" ? (c(), j(E, {
|
|
82
|
+
key: 0,
|
|
83
|
+
enabled: !0,
|
|
84
|
+
padding: a.modelValue.padding ?? 0,
|
|
85
|
+
disabled: a.disabled,
|
|
86
|
+
source: a.trimPreviewSource,
|
|
87
|
+
onEnabled: o[0] || (o[0] = (e) => !e && $()),
|
|
88
|
+
onPadding: o[1] || (o[1] = (e) => r("update:modelValue", { ...a.modelValue, padding: e })),
|
|
89
|
+
onValidity: o[2] || (o[2] = (e) => r("validity", e))
|
|
90
|
+
}, null, 8, ["padding", "disabled", "source"])) : (c(), u("div", q, [
|
|
91
|
+
i("span", null, b(t(l)("tools.adjust.basicCropPanel_3968f6fd")), 1),
|
|
92
|
+
i("div", H, [
|
|
93
|
+
i("div", {
|
|
94
|
+
class: "basic-crop-anchors",
|
|
95
|
+
role: "group",
|
|
96
|
+
"aria-label": t(l)("tools.adjust.basicCropPanel_215f5ddc")
|
|
97
|
+
}, [
|
|
98
|
+
(c(), u(y, null, _(m, (e) => i("button", {
|
|
99
|
+
key: e.value,
|
|
100
|
+
type: "button",
|
|
101
|
+
"aria-label": t(d)(e.label),
|
|
102
|
+
title: t(d)(e.label),
|
|
103
|
+
"aria-pressed": a.modelValue.anchor === e.value,
|
|
104
|
+
disabled: a.disabled || a.modelValue.ratio === "original",
|
|
105
|
+
onClick: (k) => M(e.value)
|
|
106
|
+
}, b(e.symbol), 9, K)), 64))
|
|
107
|
+
], 8, J),
|
|
108
|
+
i("div", Q, [
|
|
109
|
+
(c(!0), u(y, null, _(p.value, (e) => (c(), u("figure", {
|
|
110
|
+
key: e.label,
|
|
111
|
+
class: "basic-crop-example"
|
|
112
|
+
}, [
|
|
113
|
+
(c(), u("svg", {
|
|
114
|
+
viewBox: `0 0 ${e.width} ${e.height}`,
|
|
115
|
+
preserveAspectRatio: "xMidYMax meet",
|
|
116
|
+
role: "img",
|
|
117
|
+
"aria-label": t(d)(`${e.label},${g.value}`)
|
|
118
|
+
}, [
|
|
119
|
+
i("rect", {
|
|
120
|
+
class: "basic-crop-example-source",
|
|
121
|
+
x: "0",
|
|
122
|
+
y: "0",
|
|
123
|
+
width: e.width,
|
|
124
|
+
height: e.height,
|
|
125
|
+
"vector-effect": "non-scaling-stroke"
|
|
126
|
+
}, null, 8, X),
|
|
127
|
+
i("polygon", {
|
|
128
|
+
class: "basic-crop-example-mountain",
|
|
129
|
+
points: `0,${e.height} ${e.width * 0.4},${e.height * 0.44} ${e.width * 0.77},${e.height}`
|
|
130
|
+
}, null, 8, ee),
|
|
131
|
+
i("circle", {
|
|
132
|
+
class: "basic-crop-example-sun",
|
|
133
|
+
cx: e.width * 0.76,
|
|
134
|
+
cy: e.height * 0.25,
|
|
135
|
+
r: Math.min(e.width, e.height) * 0.08
|
|
136
|
+
}, null, 8, te),
|
|
137
|
+
i("path", {
|
|
138
|
+
class: "basic-crop-example-mask",
|
|
139
|
+
d: e.mask,
|
|
140
|
+
"fill-rule": "evenodd"
|
|
141
|
+
}, null, 8, ae),
|
|
142
|
+
i("rect", {
|
|
143
|
+
class: "basic-crop-example-frame",
|
|
144
|
+
x: e.rect.x,
|
|
145
|
+
y: e.rect.y,
|
|
146
|
+
width: e.rect.width,
|
|
147
|
+
height: e.rect.height,
|
|
148
|
+
"vector-effect": "non-scaling-stroke"
|
|
149
|
+
}, null, 8, le)
|
|
150
|
+
], 8, W)),
|
|
151
|
+
i("figcaption", null, b(t(d)(e.label)), 1)
|
|
152
|
+
]))), 128))
|
|
153
|
+
])
|
|
154
|
+
]),
|
|
155
|
+
i("p", oe, b(g.value), 1)
|
|
156
|
+
])),
|
|
157
|
+
i("p", ie, b(t(l)("tools.adjust.basicCropPanel_df91d838")), 1),
|
|
158
|
+
a.hideReset ? R("", !0) : (c(), u("button", {
|
|
159
|
+
key: 2,
|
|
160
|
+
type: "button",
|
|
161
|
+
class: "basic-crop-reset",
|
|
162
|
+
"aria-label": t(l)("tools.adjust.basicCropPanel_0ca833d8"),
|
|
163
|
+
onClick: $
|
|
164
|
+
}, [
|
|
165
|
+
w(t(F), { size: 14 }),
|
|
166
|
+
x(b(t(l)("tools.adjust.basicCropPanel_0ca833d8")), 1)
|
|
167
|
+
], 8, se))
|
|
168
|
+
], 8, G));
|
|
169
|
+
}
|
|
170
|
+
}), de = /* @__PURE__ */ T(ne, [["__scopeId", "data-v-f88135cb"]]), ce = {
|
|
171
|
+
key: 0,
|
|
172
|
+
class: "hint"
|
|
173
|
+
}, pe = /* @__PURE__ */ B({
|
|
174
|
+
__name: "CropToolPanel",
|
|
175
|
+
props: {
|
|
176
|
+
context: {}
|
|
177
|
+
},
|
|
178
|
+
setup(a) {
|
|
179
|
+
const { ui: v } = z(), l = a, d = N(() => l.context), s = V(() => d.value.crop.ratio === "original"), r = D(!0);
|
|
180
|
+
function h() {
|
|
181
|
+
l.context.resetDraft({ crop: { ...P } });
|
|
182
|
+
}
|
|
183
|
+
const m = S(() => l.context, "crop");
|
|
184
|
+
return (g, p) => (c(), j(U, {
|
|
185
|
+
context: a.context,
|
|
186
|
+
layout: "contained",
|
|
187
|
+
changed: t(I)(t(d).crop, t(P)),
|
|
188
|
+
onReset: h
|
|
189
|
+
}, {
|
|
190
|
+
actions: C(() => [
|
|
191
|
+
w(L, {
|
|
192
|
+
context: a.context,
|
|
193
|
+
available: t(Z)(a.context),
|
|
194
|
+
ready: !s.value && r.value
|
|
195
|
+
}, {
|
|
196
|
+
default: C(() => [
|
|
197
|
+
s.value ? (c(), u("p", ce, b(t(v)("common.toolPanel_2ff98de1")), 1)) : R("", !0)
|
|
198
|
+
]),
|
|
199
|
+
_: 1
|
|
200
|
+
}, 8, ["context", "available", "ready"])
|
|
201
|
+
]),
|
|
202
|
+
default: C(() => [
|
|
203
|
+
w(de, {
|
|
204
|
+
"model-value": t(d).crop,
|
|
205
|
+
disabled: a.context.readonly,
|
|
206
|
+
"hide-reset": !0,
|
|
207
|
+
"trim-preview-source": a.context.view.currentImageSource,
|
|
208
|
+
"onUpdate:modelValue": t(m),
|
|
209
|
+
onValidity: p[0] || (p[0] = (f) => r.value = f)
|
|
210
|
+
}, null, 8, ["model-value", "disabled", "trim-preview-source", "onUpdate:modelValue"])
|
|
211
|
+
]),
|
|
212
|
+
_: 1
|
|
213
|
+
}, 8, ["context", "changed"]));
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
export {
|
|
217
|
+
pe as default
|
|
218
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { defineComponent as p, useId as C, ref as g, computed as P, openBlock as c, createBlock as T, withCtx as x, createElementVNode as l, unref as t, createElementBlock as b, Fragment as y, renderList as k, toDisplayString as r, createVNode as s } from "vue";
|
|
2
|
+
import { F as D, G as h, a3 as B, _ as M } from "./entry-CboOSe2r.js";
|
|
3
|
+
import { u as w, _ as V } from "./PluginActionFooter.vue_vue_type_script_setup_true_lang-BGe419qz.js";
|
|
4
|
+
import { B as E } from "./BatchOutputColorPicker-D7WIDS4_.js";
|
|
5
|
+
import { C as I } from "./ContentTrimControl-BKCJEst5.js";
|
|
6
|
+
const U = ["disabled"], F = ["aria-label"], O = ["name", "value", "checked", "disabled", "onChange"], S = { class: "output-color-field" }, A = /* @__PURE__ */ p({
|
|
7
|
+
__name: "CutoutToolPanel",
|
|
8
|
+
props: {
|
|
9
|
+
context: {}
|
|
10
|
+
},
|
|
11
|
+
setup(o) {
|
|
12
|
+
const { ui: d, uiText: u } = D(), v = C(), m = o, n = w(() => m.context), f = g(!0), i = P(() => m.context.view.availableCutoutModes ?? ["isnet_fp16"]);
|
|
13
|
+
return (G, a) => (c(), T(h, { context: o.context }, {
|
|
14
|
+
actions: x(() => [
|
|
15
|
+
s(V, {
|
|
16
|
+
context: o.context,
|
|
17
|
+
available: i.value.includes(t(n).cutoutModel),
|
|
18
|
+
ready: f.value,
|
|
19
|
+
"unavailable-reason": o.context.view.aiAvailable === !1 ? void 0 : t(d)("common.toolPanel_d6b2b599")
|
|
20
|
+
}, null, 8, ["context", "available", "ready", "unavailable-reason"])
|
|
21
|
+
]),
|
|
22
|
+
default: x(() => [
|
|
23
|
+
l("fieldset", {
|
|
24
|
+
class: "tool-fields plugin-fields",
|
|
25
|
+
disabled: o.context.readonly
|
|
26
|
+
}, [
|
|
27
|
+
l("div", {
|
|
28
|
+
class: "mode-cards",
|
|
29
|
+
role: "radiogroup",
|
|
30
|
+
"aria-label": t(d)("common.toolPanel_4fcda57d")
|
|
31
|
+
}, [
|
|
32
|
+
(c(!0), b(y, null, k(t(B).filter((e) => o.context.modeAllowed?.(e.model) !== !1), (e) => (c(), b("label", {
|
|
33
|
+
class: "mode-card",
|
|
34
|
+
key: e.model
|
|
35
|
+
}, [
|
|
36
|
+
l("input", {
|
|
37
|
+
type: "radio",
|
|
38
|
+
name: t(v),
|
|
39
|
+
value: e.model,
|
|
40
|
+
checked: t(n).cutoutModel === e.model,
|
|
41
|
+
disabled: !i.value.includes(e.model),
|
|
42
|
+
onChange: (N) => o.context.updateDraft({ cutoutModel: e.model })
|
|
43
|
+
}, null, 40, O),
|
|
44
|
+
l("span", null, r(t(u)(e.label)) + r(i.value.includes(e.model) ? "" : t(d)("common.toolPanel_14a718cd")), 1)
|
|
45
|
+
]))), 128))
|
|
46
|
+
], 8, F),
|
|
47
|
+
l("div", S, [
|
|
48
|
+
l("span", null, r(t(d)("common.toolPanel_243779ee")), 1),
|
|
49
|
+
s(E, {
|
|
50
|
+
"model-value": t(n).outputColor,
|
|
51
|
+
disabled: o.context.readonly,
|
|
52
|
+
"onUpdate:modelValue": a[0] || (a[0] = (e) => o.context.updateDraft({ outputColor: e }))
|
|
53
|
+
}, null, 8, ["model-value", "disabled"])
|
|
54
|
+
]),
|
|
55
|
+
s(I, {
|
|
56
|
+
enabled: t(n).cutoutTrimTransparent === !0,
|
|
57
|
+
padding: t(n).cutoutTrimPadding ?? 0,
|
|
58
|
+
disabled: o.context.readonly,
|
|
59
|
+
source: o.context.view.currentImageSource,
|
|
60
|
+
help: t(u)("默认保留画布;开启后先裁透明边,再填底色,新增边距保持透明。") + " " + t(u)("预览当前图边距;抠图后的内容范围以实际结果为准。新增边距保持透明。"),
|
|
61
|
+
onEnabled: a[1] || (a[1] = (e) => o.context.updateDraft({ cutoutTrimTransparent: e })),
|
|
62
|
+
onPadding: a[2] || (a[2] = (e) => o.context.updateDraft({ cutoutTrimPadding: e })),
|
|
63
|
+
onValidity: a[3] || (a[3] = (e) => f.value = e)
|
|
64
|
+
}, null, 8, ["enabled", "padding", "disabled", "source", "help"])
|
|
65
|
+
], 8, U)
|
|
66
|
+
]),
|
|
67
|
+
_: 1
|
|
68
|
+
}, 8, ["context"]));
|
|
69
|
+
}
|
|
70
|
+
}), H = /* @__PURE__ */ M(A, [["__scopeId", "data-v-40a534d4"]]);
|
|
71
|
+
export {
|
|
72
|
+
H as default
|
|
73
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { defineComponent as p, computed as d, useId as P, openBlock as a, createBlock as g, withCtx as v, createElementVNode as c, createElementBlock as s, toDisplayString as u, unref as e, createCommentVNode as m, Fragment as k, renderList as y, createTextVNode as w, createVNode as D } from "vue";
|
|
2
|
+
import { F as N, G as V, _ as C } from "./entry-CboOSe2r.js";
|
|
3
|
+
import { u as M, b as B, _ as I } from "./PluginActionFooter.vue_vue_type_script_setup_true_lang-BGe419qz.js";
|
|
4
|
+
const T = ["disabled"], F = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "disclosure-state",
|
|
7
|
+
role: "status"
|
|
8
|
+
}, A = { key: 0 }, E = ["aria-label"], G = ["name", "value", "checked", "onChange"], $ = {
|
|
9
|
+
key: 1,
|
|
10
|
+
class: "hint"
|
|
11
|
+
}, L = {
|
|
12
|
+
key: 2,
|
|
13
|
+
class: "hint"
|
|
14
|
+
}, S = { key: 3 }, U = ["value"], j = /* @__PURE__ */ p({
|
|
15
|
+
__name: "DisclosureToolPanel",
|
|
16
|
+
props: {
|
|
17
|
+
context: {}
|
|
18
|
+
},
|
|
19
|
+
setup(l) {
|
|
20
|
+
const { ui: t, uiText: x } = N(), i = l, r = M(() => i.context), f = d(() => i.context.view.currentName), n = d(() => i.context.view.currentDisclosure), h = P(), b = d(() => r.value.disclosureMode === "manual" || B(i.context));
|
|
21
|
+
return (q, _) => (a(), g(V, { context: l.context }, {
|
|
22
|
+
actions: v(() => [
|
|
23
|
+
D(I, {
|
|
24
|
+
context: l.context,
|
|
25
|
+
available: b.value
|
|
26
|
+
}, null, 8, ["context", "available"])
|
|
27
|
+
]),
|
|
28
|
+
default: v(() => [
|
|
29
|
+
c("fieldset", {
|
|
30
|
+
class: "tool-fields plugin-fields",
|
|
31
|
+
disabled: l.context.readonly
|
|
32
|
+
}, [
|
|
33
|
+
n.value ? (a(), s("div", F, [
|
|
34
|
+
c("p", null, u(n.value?.status === "verified" ? n.value.method === "manual" ? e(t)("common.toolPanel_30447085") : e(t)("common.imageViewer_91b98855") : n.value?.status === "review" ? e(t)("common.imageViewer_7d383a32") : n.value?.status === "unchanged" ? e(t)("common.toolPanel_f9be9593") : f.value ? e(t)("common.toolPanel_3ec579b3") : e(t)("common.toolPanel_cb6df471")), 1),
|
|
35
|
+
n.value ? (a(), s("small", A, u(e(x)(n.value.reason)), 1)) : m("", !0)
|
|
36
|
+
])) : m("", !0),
|
|
37
|
+
c("div", {
|
|
38
|
+
class: "mode-cards",
|
|
39
|
+
role: "radiogroup",
|
|
40
|
+
"aria-label": e(t)("common.toolPanel_171d09fa")
|
|
41
|
+
}, [
|
|
42
|
+
(a(!0), s(k, null, y(["manual", "ai"].filter(
|
|
43
|
+
(o) => l.context.modeAllowed?.(o) !== !1
|
|
44
|
+
), (o) => (a(), s("label", {
|
|
45
|
+
key: o,
|
|
46
|
+
class: "mode-card"
|
|
47
|
+
}, [
|
|
48
|
+
c("input", {
|
|
49
|
+
type: "radio",
|
|
50
|
+
name: e(h),
|
|
51
|
+
value: o,
|
|
52
|
+
checked: e(r).disclosureMode === o,
|
|
53
|
+
onChange: (z) => l.context.updateDraft({ disclosureMode: o })
|
|
54
|
+
}, null, 40, G),
|
|
55
|
+
c("span", null, u(e(t)(o === "manual" ? "common.toolPanel_a88eb6b9" : "common.toolPanel_09794da0")), 1)
|
|
56
|
+
]))), 128))
|
|
57
|
+
], 8, E),
|
|
58
|
+
e(r).disclosureMode === "manual" ? (a(), s("p", $, u(e(t)("common.toolPanel_290eab0a")), 1)) : (a(), s("p", L, u(e(t)("common.toolPanel_2c0993e5")), 1)),
|
|
59
|
+
e(r).disclosureMode === "ai" ? (a(), s("label", S, [
|
|
60
|
+
w(u(e(t)("common.toolPanel_6d793364")), 1),
|
|
61
|
+
c("textarea", {
|
|
62
|
+
value: e(r).context,
|
|
63
|
+
maxlength: "2000",
|
|
64
|
+
rows: "3",
|
|
65
|
+
onInput: _[0] || (_[0] = (o) => l.context.updateDraft({ context: o.target.value }))
|
|
66
|
+
}, null, 40, U)
|
|
67
|
+
])) : m("", !0)
|
|
68
|
+
], 8, T)
|
|
69
|
+
]),
|
|
70
|
+
_: 1
|
|
71
|
+
}, 8, ["context"]));
|
|
72
|
+
}
|
|
73
|
+
}), O = /* @__PURE__ */ C(j, [["__scopeId", "data-v-e564a010"]]);
|
|
74
|
+
export {
|
|
75
|
+
O as default
|
|
76
|
+
};
|