@beeintel/batch-image 1.0.1 → 1.1.1

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.
Files changed (60) hide show
  1. package/README.md +188 -184
  2. package/dist/chunks/{AdjustToolPanel-BELqYSUR.js → AdjustToolPanel-BEqQFYEO.js} +30 -29
  3. package/dist/chunks/BackgroundToolPanel-Dw3uT7S-.js +43 -0
  4. package/dist/chunks/{BatchMaterials-niGKrga3.js → BatchMaterials-HiK3VQc3.js} +1 -1
  5. package/dist/chunks/BatchModeChoices-BAslK92y.js +118 -0
  6. package/dist/chunks/{BatchOutputColorPicker-CCvmIF-b.js → BatchOutputColorPicker-CgtnQBA3.js} +1 -1
  7. package/dist/chunks/BatchReferenceFields-DbjXtKC4.js +308 -0
  8. package/dist/chunks/BeautifyToolPanel-imF6jnTG.js +220 -0
  9. package/dist/chunks/{BrandMarkToolPanel-FKxXth_3.js → BrandMarkToolPanel-C-gouhaT.js} +319 -333
  10. package/dist/chunks/{ContentTrimControl-BQfigZPq.js → ContentTrimControl-LgNIZbXa.js} +2 -2
  11. package/dist/chunks/{CropToolPanel-BhSuHkYm.js → CropToolPanel-DsPgFUWI.js} +60 -56
  12. package/dist/chunks/CutoutToolPanel-BhJngz89.js +78 -0
  13. package/dist/chunks/DisclosureToolPanel-DOaWm-im.js +72 -0
  14. package/dist/chunks/ExpandToolPanel-CuufFNiC.js +69 -0
  15. package/dist/chunks/{ImageEffectsToolPanel-BRLPIt4q.js → ImageEffectsToolPanel-BsfBZdYp.js} +63 -52
  16. package/dist/chunks/{IpAuditToolPanel-DfY-mBSe.js → IpAuditToolPanel-DOB7TEoI.js} +15 -13
  17. package/dist/chunks/{ListingToolPanel-B9Yh3LBK.js → ListingToolPanel-Dapetiw-.js} +170 -184
  18. package/dist/chunks/{MaterialSelectionPlate-DhioUjdW.js → MaterialSelectionPlate-BjNttUh8.js} +4 -4
  19. package/dist/chunks/MetadataToolPanel-G56L-VTi.js +116 -0
  20. package/dist/chunks/{OrientToolPanel-BTrwaWBm.js → OrientToolPanel-BJHfMixX.js} +3 -3
  21. package/dist/chunks/PluginActionFooter.vue_vue_type_script_setup_true_lang-DI8W37RA.js +122 -0
  22. package/dist/chunks/ResizeToolPanel-HDDArzWx.js +1171 -0
  23. package/dist/chunks/RetouchToolPanel-Drei3Dj7.js +358 -0
  24. package/dist/chunks/ShadowToolPanel-BM5MRfYB.js +258 -0
  25. package/dist/chunks/SvgExportToolPanel-D3KNi5AS.js +208 -0
  26. package/dist/chunks/TranslationToolPanel-DbNO3IKA.js +104 -0
  27. package/dist/chunks/{UpscaleToolPanel-D0H-j2Tr.js → UpscaleToolPanel-5kT1uUl0.js} +44 -39
  28. package/dist/chunks/arrow-up-DT1zSe8a.js +18 -0
  29. package/dist/chunks/{engine-D-T-1RSx.js → engine-BZ0nkcqj.js} +1 -1
  30. package/dist/chunks/{entry-DK9FjQZ_.js → entry-FNjvjYxd.js} +7512 -7395
  31. package/dist/chunks/{hosted-resources-COzZ7nZY.js → hosted-resources-C3iu_zn4.js} +2 -2
  32. package/dist/chunks/{loader-circle-UFoEem2a.js → loader-circle-pki8gM3_.js} +1 -1
  33. package/dist/chunks/{motionFeatures-D4miwXxc.js → motionFeatures-Cp11tdeb.js} +1 -1
  34. package/dist/chunks/{search-BjTSm1KS.js → search-BNwQCPna.js} +1 -1
  35. package/dist/chunks/{standard-cutout-vPpP6xBc.js → standard-cutout-iIOMfl6q.js} +1 -1
  36. package/dist/chunks/{static-logo-2F9ORZWc.js → static-logo-7HK4ubmZ.js} +1 -1
  37. package/dist/config.d.ts +6 -0
  38. package/dist/index.d.ts +1 -0
  39. package/dist/index.js +6 -5
  40. package/dist/processing.js +3 -3
  41. package/dist/resources.json +113 -103
  42. package/dist/slots.d.ts +2 -0
  43. package/dist/style.css +1 -1
  44. package/dist/tool-links.d.ts +10 -0
  45. package/dist/types/batch/public/config.d.ts +6 -0
  46. package/package.json +95 -95
  47. package/dist/chunks/BackgroundToolPanel-Dy_l8KFl.js +0 -41
  48. package/dist/chunks/BatchModeChoices-BRqn6zNI.js +0 -111
  49. package/dist/chunks/BatchReferenceFields-C4t7OSTw.js +0 -316
  50. package/dist/chunks/BeautifyToolPanel-Dc-ddaBC.js +0 -215
  51. package/dist/chunks/CutoutToolPanel-BfaZZSE_.js +0 -73
  52. package/dist/chunks/DisclosureToolPanel-B_oc5fld.js +0 -76
  53. package/dist/chunks/ExpandToolPanel-D_ZODTUZ.js +0 -67
  54. package/dist/chunks/MetadataToolPanel-KVrtb3K0.js +0 -104
  55. package/dist/chunks/PluginActionFooter.vue_vue_type_script_setup_true_lang-C2kJCYeA.js +0 -102
  56. package/dist/chunks/ResizeToolPanel-Ch_-WR74.js +0 -1178
  57. package/dist/chunks/RetouchToolPanel-BTS33Dsd.js +0 -350
  58. package/dist/chunks/ShadowToolPanel-DxJE4eyV.js +0 -254
  59. package/dist/chunks/SvgExportToolPanel-RHmuQARH.js +0 -219
  60. package/dist/chunks/TranslationToolPanel-B_qTA1hM.js +0 -125
@@ -1,6 +1,6 @@
1
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-DK9FjQZ_.js";
3
- import { aq as K, e as Q } from "./hosted-resources-COzZ7nZY.js";
2
+ import { _ as H, F as Y, P as j, as as J } from "./entry-FNjvjYxd.js";
3
+ import { aq as K, e as Q } from "./hosted-resources-C3iu_zn4.js";
4
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
5
  __name: "ContentTrimIllustration",
6
6
  props: {
@@ -1,15 +1,15 @@
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-DK9FjQZ_.js";
3
- import { ar as A, h as P } from "./hosted-resources-COzZ7nZY.js";
4
- import { C as E } from "./ContentTrimControl-BQfigZPq.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-C2kJCYeA.js";
6
- const G = ["disabled", "aria-label"], O = ["aria-label", "value"], Y = ["value"], q = {
1
+ import { defineComponent as B, computed as V, openBlock as c, createElementBlock as u, unref as t, createElementVNode as i, createTextVNode as k, toDisplayString as b, createVNode as v, Fragment as _, renderList as C, createBlock as j, createCommentVNode as R, ref as D, withCtx as P } from "vue";
2
+ import { F as z, P as F, R as T, _ as U, G as A } from "./entry-FNjvjYxd.js";
3
+ import { ar as E, h as w } from "./hosted-resources-C3iu_zn4.js";
4
+ import { C as N } from "./ContentTrimControl-LgNIZbXa.js";
5
+ import { u as S, a as I, c as L, _ as Z, n as G } from "./PluginActionFooter.vue_vue_type_script_setup_true_lang-DI8W37RA.js";
6
+ const H = ["disabled", "aria-label"], O = ["aria-label", "value"], Y = ["value"], q = {
7
7
  key: 1,
8
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 = {
9
+ }, J = { class: "basic-crop-keep" }, K = ["aria-label"], Q = ["aria-label", "title", "aria-pressed", "disabled", "onClick"], W = { class: "basic-crop-examples" }, X = ["viewBox", "aria-label"], ee = ["width", "height"], te = ["points"], ae = ["cx", "cy", "r"], le = ["d"], oe = ["x", "y", "width", "height"], ie = {
10
10
  class: "basic-crop-position-description",
11
11
  role: "status"
12
- }, ie = { class: "hint" }, se = ["aria-label"], ne = /* @__PURE__ */ B({
12
+ }, se = ["aria-label"], ne = /* @__PURE__ */ B({
13
13
  __name: "BasicCropPanel",
14
14
  props: {
15
15
  modelValue: {},
@@ -18,8 +18,8 @@ const G = ["disabled", "aria-label"], O = ["aria-label", "value"], Y = ["value"]
18
18
  trimPreviewSource: {}
19
19
  },
20
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 = [
21
+ setup(a, { emit: g }) {
22
+ const { ui: l, uiText: d } = z(), s = a, r = g, h = ["original", "alpha-bounds", "1:1", "4:3", "3:4", "16:9", "9:16"], m = [
23
23
  { value: "top-left", label: "左上", symbol: "↖" },
24
24
  { value: "top", label: "顶部", symbol: "↑" },
25
25
  { value: "top-right", label: "右上", symbol: "↗" },
@@ -29,7 +29,7 @@ const G = ["disabled", "aria-label"], O = ["aria-label", "value"], Y = ["value"]
29
29
  { value: "bottom-left", label: "左下", symbol: "↙" },
30
30
  { value: "bottom", label: "底部", symbol: "↓" },
31
31
  { value: "bottom-right", label: "右下", symbol: "↘" }
32
- ], g = V(
32
+ ], f = V(
33
33
  () => s.modelValue.ratio === "alpha-bounds" ? d("按所有非透明像素裁切,不缩放;保留阴影和分离主体") : s.modelValue.ratio === "original" ? l("tools.adjust.basicCropPanel_2f513c08") : l("tools.adjust.basicCropPanel_cb44129d", {
34
34
  p0: d(m.find((n) => n.value === s.modelValue.anchor)?.label) || l("tools.resize.sizeCropPanel_4cc3885c")
35
35
  })
@@ -38,17 +38,17 @@ const G = ["disabled", "aria-label"], O = ["aria-label", "value"], Y = ["value"]
38
38
  { label: l("tools.resize.sizeCropPanel_86ab646d"), width: 400, height: 300 },
39
39
  { label: l("tools.resize.sizeCropPanel_577124ca"), width: 300, height: 400 }
40
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`;
41
+ const o = E(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
42
  return { ...n, rect: o, mask: e };
43
43
  })
44
44
  );
45
- function f(n) {
45
+ function y(n) {
46
46
  if (s.disabled) return;
47
47
  const o = n.target.value;
48
48
  if (h.includes(o)) {
49
- const { padding: e, ...k } = s.modelValue;
49
+ const { padding: e, ...$ } = s.modelValue;
50
50
  r("validity", !0), r("update:modelValue", {
51
- ...k,
51
+ ...$,
52
52
  ratio: o,
53
53
  ...o === "alpha-bounds" && e ? { padding: e } : {}
54
54
  });
@@ -57,8 +57,8 @@ const G = ["disabled", "aria-label"], O = ["aria-label", "value"], Y = ["value"]
57
57
  function M(n) {
58
58
  !s.disabled && s.modelValue.ratio !== "original" && r("update:modelValue", { ...s.modelValue, anchor: n });
59
59
  }
60
- function $() {
61
- s.disabled || (r("validity", !0), r("update:modelValue", { ...P }));
60
+ function x() {
61
+ s.disabled || (r("validity", !0), r("update:modelValue", { ...w }));
62
62
  }
63
63
  return (n, o) => (c(), u("fieldset", {
64
64
  class: "basic-crop-panel",
@@ -66,47 +66,52 @@ const G = ["disabled", "aria-label"], O = ["aria-label", "value"], Y = ["value"]
66
66
  "aria-label": t(l)("tools.adjust.basicCropPanel_1b5d2a12")
67
67
  }, [
68
68
  i("label", null, [
69
- x(b(t(l)("common.toolPanel_16e195aa")), 1),
69
+ i("span", null, [
70
+ k(b(t(l)("common.toolPanel_16e195aa")), 1),
71
+ v(F, {
72
+ text: t(l)("tools.adjust.basicCropPanel_df91d838")
73
+ }, null, 8, ["text"])
74
+ ]),
70
75
  i("select", {
71
76
  "aria-label": t(l)("common.toolPanel_16e195aa"),
72
77
  value: a.modelValue.ratio,
73
- onChange: f
78
+ onChange: y
74
79
  }, [
75
- (c(), u(y, null, _(h, (e) => i("option", {
80
+ (c(), u(_, null, C(h, (e) => i("option", {
76
81
  key: e,
77
82
  value: e
78
83
  }, b(e === "original" ? t(l)("tools.adjust.basicCropPanel_2d3a3ea7") : e === "alpha-bounds" ? t(d)("按内容裁边") : e), 9, Y)), 64))
79
84
  ], 40, O)
80
85
  ]),
81
- a.modelValue.ratio === "alpha-bounds" ? (c(), j(E, {
86
+ a.modelValue.ratio === "alpha-bounds" ? (c(), j(N, {
82
87
  key: 0,
83
88
  enabled: !0,
84
89
  padding: a.modelValue.padding ?? 0,
85
90
  disabled: a.disabled,
86
91
  source: a.trimPreviewSource,
87
- onEnabled: o[0] || (o[0] = (e) => !e && $()),
92
+ onEnabled: o[0] || (o[0] = (e) => !e && x()),
88
93
  onPadding: o[1] || (o[1] = (e) => r("update:modelValue", { ...a.modelValue, padding: e })),
89
94
  onValidity: o[2] || (o[2] = (e) => r("validity", e))
90
95
  }, null, 8, ["padding", "disabled", "source"])) : (c(), u("div", q, [
91
96
  i("span", null, b(t(l)("tools.adjust.basicCropPanel_3968f6fd")), 1),
92
- i("div", H, [
97
+ i("div", J, [
93
98
  i("div", {
94
99
  class: "basic-crop-anchors",
95
100
  role: "group",
96
101
  "aria-label": t(l)("tools.adjust.basicCropPanel_215f5ddc")
97
102
  }, [
98
- (c(), u(y, null, _(m, (e) => i("button", {
103
+ (c(), u(_, null, C(m, (e) => i("button", {
99
104
  key: e.value,
100
105
  type: "button",
101
106
  "aria-label": t(d)(e.label),
102
107
  title: t(d)(e.label),
103
108
  "aria-pressed": a.modelValue.anchor === e.value,
104
109
  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
+ onClick: ($) => M(e.value)
111
+ }, b(e.symbol), 9, Q)), 64))
112
+ ], 8, K),
113
+ i("div", W, [
114
+ (c(!0), u(_, null, C(p.value, (e) => (c(), u("figure", {
110
115
  key: e.label,
111
116
  class: "basic-crop-example"
112
117
  }, [
@@ -114,7 +119,7 @@ const G = ["disabled", "aria-label"], O = ["aria-label", "value"], Y = ["value"]
114
119
  viewBox: `0 0 ${e.width} ${e.height}`,
115
120
  preserveAspectRatio: "xMidYMax meet",
116
121
  role: "img",
117
- "aria-label": t(d)(`${e.label},${g.value}`)
122
+ "aria-label": t(d)(`${e.label},${f.value}`)
118
123
  }, [
119
124
  i("rect", {
120
125
  class: "basic-crop-example-source",
@@ -123,22 +128,22 @@ const G = ["disabled", "aria-label"], O = ["aria-label", "value"], Y = ["value"]
123
128
  width: e.width,
124
129
  height: e.height,
125
130
  "vector-effect": "non-scaling-stroke"
126
- }, null, 8, X),
131
+ }, null, 8, ee),
127
132
  i("polygon", {
128
133
  class: "basic-crop-example-mountain",
129
134
  points: `0,${e.height} ${e.width * 0.4},${e.height * 0.44} ${e.width * 0.77},${e.height}`
130
- }, null, 8, ee),
135
+ }, null, 8, te),
131
136
  i("circle", {
132
137
  class: "basic-crop-example-sun",
133
138
  cx: e.width * 0.76,
134
139
  cy: e.height * 0.25,
135
140
  r: Math.min(e.width, e.height) * 0.08
136
- }, null, 8, te),
141
+ }, null, 8, ae),
137
142
  i("path", {
138
143
  class: "basic-crop-example-mask",
139
144
  d: e.mask,
140
145
  "fill-rule": "evenodd"
141
- }, null, 8, ae),
146
+ }, null, 8, le),
142
147
  i("rect", {
143
148
  class: "basic-crop-example-frame",
144
149
  x: e.rect.x,
@@ -146,28 +151,27 @@ const G = ["disabled", "aria-label"], O = ["aria-label", "value"], Y = ["value"]
146
151
  width: e.rect.width,
147
152
  height: e.rect.height,
148
153
  "vector-effect": "non-scaling-stroke"
149
- }, null, 8, le)
150
- ], 8, W)),
154
+ }, null, 8, oe)
155
+ ], 8, X)),
151
156
  i("figcaption", null, b(t(d)(e.label)), 1)
152
157
  ]))), 128))
153
158
  ])
154
159
  ]),
155
- i("p", oe, b(g.value), 1)
160
+ i("p", ie, b(f.value), 1)
156
161
  ])),
157
- i("p", ie, b(t(l)("tools.adjust.basicCropPanel_df91d838")), 1),
158
162
  a.hideReset ? R("", !0) : (c(), u("button", {
159
163
  key: 2,
160
164
  type: "button",
161
165
  class: "basic-crop-reset",
162
166
  "aria-label": t(l)("tools.adjust.basicCropPanel_0ca833d8"),
163
- onClick: $
167
+ onClick: x
164
168
  }, [
165
- w(t(F), { size: 14 }),
166
- x(b(t(l)("tools.adjust.basicCropPanel_0ca833d8")), 1)
169
+ v(t(T), { size: 14 }),
170
+ k(b(t(l)("tools.adjust.basicCropPanel_0ca833d8")), 1)
167
171
  ], 8, se))
168
- ], 8, G));
172
+ ], 8, H));
169
173
  }
170
- }), de = /* @__PURE__ */ T(ne, [["__scopeId", "data-v-f88135cb"]]), ce = {
174
+ }), de = /* @__PURE__ */ U(ne, [["__scopeId", "data-v-3923b761"]]), ce = {
171
175
  key: 0,
172
176
  class: "hint"
173
177
  }, pe = /* @__PURE__ */ B({
@@ -176,37 +180,37 @@ const G = ["disabled", "aria-label"], O = ["aria-label", "value"], Y = ["value"]
176
180
  context: {}
177
181
  },
178
182
  setup(a) {
179
- const { ui: v } = z(), l = a, d = N(() => l.context), s = V(() => d.value.crop.ratio === "original"), r = D(!0);
183
+ const { ui: g } = z(), l = a, d = S(() => l.context), s = V(() => d.value.crop.ratio === "original"), r = D(!0);
180
184
  function h() {
181
- l.context.resetDraft({ crop: { ...P } });
185
+ l.context.resetDraft({ crop: { ...w } });
182
186
  }
183
- const m = S(() => l.context, "crop");
184
- return (g, p) => (c(), j(U, {
187
+ const m = I(() => l.context, "crop");
188
+ return (f, p) => (c(), j(A, {
185
189
  context: a.context,
186
190
  layout: "contained",
187
- changed: t(I)(t(d).crop, t(P)),
191
+ changed: t(L)(t(d).crop, t(w)),
188
192
  onReset: h
189
193
  }, {
190
- actions: C(() => [
191
- w(L, {
194
+ actions: P(() => [
195
+ v(Z, {
192
196
  context: a.context,
193
- available: t(Z)(a.context),
197
+ available: t(G)(a.context),
194
198
  ready: !s.value && r.value
195
199
  }, {
196
- default: C(() => [
197
- s.value ? (c(), u("p", ce, b(t(v)("common.toolPanel_2ff98de1")), 1)) : R("", !0)
200
+ default: P(() => [
201
+ s.value ? (c(), u("p", ce, b(t(g)("common.toolPanel_2ff98de1")), 1)) : R("", !0)
198
202
  ]),
199
203
  _: 1
200
204
  }, 8, ["context", "available", "ready"])
201
205
  ]),
202
- default: C(() => [
203
- w(de, {
206
+ default: P(() => [
207
+ v(de, {
204
208
  "model-value": t(d).crop,
205
209
  disabled: a.context.readonly,
206
210
  "hide-reset": !0,
207
211
  "trim-preview-source": a.context.view.currentImageSource,
208
212
  "onUpdate:modelValue": t(m),
209
- onValidity: p[0] || (p[0] = (f) => r.value = f)
213
+ onValidity: p[0] || (p[0] = (y) => r.value = y)
210
214
  }, null, 8, ["model-value", "disabled", "trim-preview-source", "onUpdate:modelValue"])
211
215
  ]),
212
216
  _: 1
@@ -0,0 +1,78 @@
1
+ import { defineComponent as g, useId as k, ref as C, computed as P, openBlock as c, createBlock as y, withCtx as b, createElementVNode as n, unref as o, createElementBlock as v, Fragment as T, renderList as h, toDisplayString as r, createVNode as s } from "vue";
2
+ import { F as D, G as w, a3 as B, _ as M } from "./entry-FNjvjYxd.js";
3
+ import { u as I, _ as V } from "./PluginActionFooter.vue_vue_type_script_setup_true_lang-DI8W37RA.js";
4
+ import { B as E } from "./BatchOutputColorPicker-CgtnQBA3.js";
5
+ import { C as U } from "./ContentTrimControl-LgNIZbXa.js";
6
+ const F = ["disabled"], O = ["aria-label"], S = ["title"], $ = ["name", "value", "checked", "disabled", "onChange"], q = { class: "output-color-field" }, A = /* @__PURE__ */ g({
7
+ __name: "CutoutToolPanel",
8
+ props: {
9
+ context: {}
10
+ },
11
+ setup(t) {
12
+ const { ui: l } = D(), x = k(), m = t, d = I(() => m.context), f = C(!0), i = P(() => m.context.view.availableCutoutModes ?? ["isnet_fp16"]);
13
+ function p(u) {
14
+ const a = u === "isnet_fp16" ? "quick" : u === "birefnet_quality" ? "standard" : "precision", e = u === "picwish" ? " · PicWish" : u === "ideogram" ? " · Ideogram" : "";
15
+ return l(`tools.feedback.cutout.${a}`) + e;
16
+ }
17
+ return (u, a) => (c(), y(w, { context: t.context }, {
18
+ actions: b(() => [
19
+ s(V, {
20
+ context: t.context,
21
+ available: i.value.includes(o(d).cutoutModel),
22
+ ready: f.value,
23
+ "unavailable-reason": t.context.view.aiAvailable === !1 ? void 0 : o(l)("common.toolPanel_d6b2b599")
24
+ }, null, 8, ["context", "available", "ready", "unavailable-reason"])
25
+ ]),
26
+ default: b(() => [
27
+ n("fieldset", {
28
+ class: "tool-fields plugin-fields",
29
+ disabled: t.context.readonly
30
+ }, [
31
+ n("div", {
32
+ class: "mode-cards",
33
+ role: "radiogroup",
34
+ "aria-label": o(l)("common.toolPanel_4fcda57d")
35
+ }, [
36
+ (c(!0), v(T, null, h(o(B).filter((e) => t.context.modeAllowed?.(e.model) !== !1), (e) => (c(), v("label", {
37
+ class: "mode-card",
38
+ key: e.model,
39
+ title: e.label.split(" · ")[1]
40
+ }, [
41
+ n("input", {
42
+ type: "radio",
43
+ name: o(x),
44
+ value: e.model,
45
+ checked: o(d).cutoutModel === e.model,
46
+ disabled: !i.value.includes(e.model),
47
+ onChange: (G) => t.context.updateDraft({ cutoutModel: e.model })
48
+ }, null, 40, $),
49
+ n("span", null, r(p(e.model)) + r(i.value.includes(e.model) ? "" : " · " + o(l)("tools.feedback.cutout.unavailable")), 1)
50
+ ], 8, S))), 128))
51
+ ], 8, O),
52
+ n("div", q, [
53
+ n("span", null, r(o(l)("tools.feedback.cutout.background")), 1),
54
+ s(E, {
55
+ "model-value": o(d).outputColor,
56
+ disabled: t.context.readonly,
57
+ "onUpdate:modelValue": a[0] || (a[0] = (e) => t.context.updateDraft({ outputColor: e }))
58
+ }, null, 8, ["model-value", "disabled"])
59
+ ]),
60
+ s(U, {
61
+ enabled: o(d).cutoutTrimTransparent === !0,
62
+ padding: o(d).cutoutTrimPadding ?? 0,
63
+ disabled: t.context.readonly,
64
+ source: t.context.view.currentImageSource,
65
+ help: o(l)("tools.feedback.cutout.trimHelp"),
66
+ onEnabled: a[1] || (a[1] = (e) => t.context.updateDraft({ cutoutTrimTransparent: e })),
67
+ onPadding: a[2] || (a[2] = (e) => t.context.updateDraft({ cutoutTrimPadding: e })),
68
+ onValidity: a[3] || (a[3] = (e) => f.value = e)
69
+ }, null, 8, ["enabled", "padding", "disabled", "source", "help"])
70
+ ], 8, F)
71
+ ]),
72
+ _: 1
73
+ }, 8, ["context"]));
74
+ }
75
+ }), z = /* @__PURE__ */ M(A, [["__scopeId", "data-v-01c21f89"]]);
76
+ export {
77
+ z as default
78
+ };
@@ -0,0 +1,72 @@
1
+ import { defineComponent as p, computed as d, useId as P, openBlock as n, createBlock as g, unref as e, withCtx as _, createElementVNode as c, createElementBlock as u, toDisplayString as i, createCommentVNode as m, Fragment as k, renderList as w, createTextVNode as D, createVNode as y } from "vue";
2
+ import { F as N, G as V, _ as C } from "./entry-FNjvjYxd.js";
3
+ import { u as M, b as B, _ as I } from "./PluginActionFooter.vue_vue_type_script_setup_true_lang-DI8W37RA.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"], $ = { key: 1 }, L = ["value"], S = /* @__PURE__ */ p({
9
+ __name: "DisclosureToolPanel",
10
+ props: {
11
+ context: {}
12
+ },
13
+ setup(a) {
14
+ const { ui: o, uiText: x } = N(), r = a, s = M(() => r.context), f = d(() => r.context.view.currentName), l = d(() => r.context.view.currentDisclosure), b = P(), h = d(() => s.value.disclosureMode === "manual" || B(r.context));
15
+ return (U, v) => (n(), g(V, {
16
+ context: a.context,
17
+ help: e(o)(e(s).disclosureMode === "manual" ? "common.toolPanel_290eab0a" : "common.toolPanel_2c0993e5")
18
+ }, {
19
+ actions: _(() => [
20
+ y(I, {
21
+ context: a.context,
22
+ available: h.value
23
+ }, null, 8, ["context", "available"])
24
+ ]),
25
+ default: _(() => [
26
+ c("fieldset", {
27
+ class: "tool-fields plugin-fields",
28
+ disabled: a.context.readonly
29
+ }, [
30
+ l.value ? (n(), u("div", F, [
31
+ c("p", null, i(l.value?.status === "verified" ? l.value.method === "manual" ? e(o)("common.toolPanel_30447085") : e(o)("common.imageViewer_91b98855") : l.value?.status === "review" ? e(o)("common.imageViewer_7d383a32") : l.value?.status === "unchanged" ? e(o)("common.toolPanel_f9be9593") : f.value ? e(o)("common.toolPanel_3ec579b3") : e(o)("common.toolPanel_cb6df471")), 1),
32
+ l.value ? (n(), u("small", A, i(e(x)(l.value.reason)), 1)) : m("", !0)
33
+ ])) : m("", !0),
34
+ c("div", {
35
+ class: "mode-cards",
36
+ role: "radiogroup",
37
+ "aria-label": e(o)("common.toolPanel_171d09fa")
38
+ }, [
39
+ (n(!0), u(k, null, w(["manual", "ai"].filter(
40
+ (t) => a.context.modeAllowed?.(t) !== !1
41
+ ), (t) => (n(), u("label", {
42
+ key: t,
43
+ class: "mode-card"
44
+ }, [
45
+ c("input", {
46
+ type: "radio",
47
+ name: e(b),
48
+ value: t,
49
+ checked: e(s).disclosureMode === t,
50
+ onChange: (j) => a.context.updateDraft({ disclosureMode: t })
51
+ }, null, 40, G),
52
+ c("span", null, i(e(o)(t === "manual" ? "common.toolPanel_a88eb6b9" : "common.toolPanel_09794da0")), 1)
53
+ ]))), 128))
54
+ ], 8, E),
55
+ e(s).disclosureMode === "ai" ? (n(), u("label", $, [
56
+ D(i(e(o)("common.toolPanel_6d793364")), 1),
57
+ c("textarea", {
58
+ value: e(s).context,
59
+ maxlength: "2000",
60
+ rows: "3",
61
+ onInput: v[0] || (v[0] = (t) => a.context.updateDraft({ context: t.target.value }))
62
+ }, null, 40, L)
63
+ ])) : m("", !0)
64
+ ], 8, T)
65
+ ]),
66
+ _: 1
67
+ }, 8, ["context", "help"]));
68
+ }
69
+ }), J = /* @__PURE__ */ C(S, [["__scopeId", "data-v-67c8a2d3"]]);
70
+ export {
71
+ J as default
72
+ };
@@ -0,0 +1,69 @@
1
+ import { defineComponent as b, computed as m, watch as h, openBlock as l, createBlock as g, unref as e, withCtx as x, createElementVNode as c, createTextVNode as f, toDisplayString as u, createVNode as v, createElementBlock as i, Fragment as k, renderList as y, createCommentVNode as P } from "vue";
2
+ import { F as C, H as D, G as I, P as w, I as B, _ as E } from "./entry-FNjvjYxd.js";
3
+ import { u as N, _ as T, b as V } from "./PluginActionFooter.vue_vue_type_script_setup_true_lang-DI8W37RA.js";
4
+ const F = ["disabled"], R = ["aria-label", "value"], A = { key: 0 }, H = ["value", "placeholder"], O = {
5
+ key: 1,
6
+ class: "tool-note"
7
+ }, S = /* @__PURE__ */ b({
8
+ __name: "ExpandToolPanel",
9
+ props: {
10
+ context: {}
11
+ },
12
+ setup(t) {
13
+ const { ui: o } = C(), n = t, s = N(() => n.context), _ = D(), r = m(() => _?.config.value.toolOptions?.expand), p = m(() => n.context.view.skippedCount);
14
+ return h(
15
+ () => [r.value, s.value.expandPrompt, n.context.readonly],
16
+ () => {
17
+ r.value?.prompt === !1 && s.value.expandPrompt && !n.context.readonly && n.context.updateDraft({ expandPrompt: "" });
18
+ },
19
+ { immediate: !0 }
20
+ ), (G, d) => (l(), g(I, {
21
+ context: t.context,
22
+ help: e(o)("common.toolPanel_f3ddc1b3")
23
+ }, {
24
+ actions: x(() => [
25
+ v(T, {
26
+ context: t.context,
27
+ available: e(V)(t.context)
28
+ }, null, 8, ["context", "available"])
29
+ ]),
30
+ default: x(() => [
31
+ c("fieldset", {
32
+ class: "tool-fields plugin-fields",
33
+ disabled: t.context.readonly
34
+ }, [
35
+ c("label", null, [
36
+ c("span", null, [
37
+ f(u(e(o)("common.toolPanel_16e195aa")), 1),
38
+ v(w, {
39
+ text: e(o)("common.toolPanel_c3c522b1")
40
+ }, null, 8, ["text"])
41
+ ]),
42
+ c("select", {
43
+ "aria-label": e(o)("common.toolPanel_16e195aa"),
44
+ value: e(s).aspectRatio,
45
+ onChange: d[0] || (d[0] = (a) => t.context.updateDraft({ aspectRatio: a.target.value }))
46
+ }, [
47
+ (l(!0), i(k, null, y(r.value?.ratios ?? e(B), (a) => (l(), i("option", { key: a }, u(a), 1))), 128))
48
+ ], 40, R)
49
+ ]),
50
+ r.value?.prompt !== !1 ? (l(), i("label", A, [
51
+ f(u(e(o)("common.toolPanel_40c2f529")), 1),
52
+ c("textarea", {
53
+ value: e(s).expandPrompt,
54
+ maxlength: "2000",
55
+ rows: "3",
56
+ placeholder: e(o)("common.toolPanel_7ab546ce"),
57
+ onInput: d[1] || (d[1] = (a) => t.context.updateDraft({ expandPrompt: a.target.value }))
58
+ }, null, 40, H)
59
+ ])) : P("", !0),
60
+ p.value ? (l(), i("p", O, u(e(o)("common.toolPanel_e9af8109", { p0: p.value })), 1)) : P("", !0)
61
+ ], 8, F)
62
+ ]),
63
+ _: 1
64
+ }, 8, ["context", "help"]));
65
+ }
66
+ }), $ = /* @__PURE__ */ E(S, [["__scopeId", "data-v-6c7b4d1b"]]);
67
+ export {
68
+ $ as default
69
+ };