desktop-tool-pl-qrcode 1.0.3 → 1.0.4

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.js CHANGED
@@ -1,6 +1,6 @@
1
- import ke, { useState as L, useEffect as dr } from "react";
2
- import vr from "qrcode";
3
- var ne = { exports: {} }, W = {};
1
+ import ke, { useState as I, useMemo as dr, useEffect as vr } from "react";
2
+ import pr from "qrcode";
3
+ var ne = { exports: {} }, L = {};
4
4
  /**
5
5
  * @license React
6
6
  * react-jsx-runtime.production.min.js
@@ -11,24 +11,24 @@ var ne = { exports: {} }, W = {};
11
11
  * LICENSE file in the root directory of this source tree.
12
12
  */
13
13
  var Oe;
14
- function pr() {
14
+ function hr() {
15
15
  if (Oe)
16
- return W;
16
+ return L;
17
17
  Oe = 1;
18
- var E = ke, C = Symbol.for("react.element"), y = Symbol.for("react.fragment"), g = Object.prototype.hasOwnProperty, S = E.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, _ = { key: !0, ref: !0, __self: !0, __source: !0 };
19
- function k(x, f, T) {
20
- var p, l = {}, R = null, D = null;
21
- T !== void 0 && (R = "" + T), f.key !== void 0 && (R = "" + f.key), f.ref !== void 0 && (D = f.ref);
22
- for (p in f)
23
- g.call(f, p) && !_.hasOwnProperty(p) && (l[p] = f[p]);
24
- if (x && x.defaultProps)
25
- for (p in f = x.defaultProps, f)
26
- l[p] === void 0 && (l[p] = f[p]);
27
- return { $$typeof: C, type: x, key: R, ref: D, props: l, _owner: S.current };
18
+ var R = ke, j = Symbol.for("react.element"), y = Symbol.for("react.fragment"), m = Object.prototype.hasOwnProperty, S = R.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, E = { key: !0, ref: !0, __self: !0, __source: !0 };
19
+ function k(_, d, O) {
20
+ var h, w = {}, l = null, C = null;
21
+ O !== void 0 && (l = "" + O), d.key !== void 0 && (l = "" + d.key), d.ref !== void 0 && (C = d.ref);
22
+ for (h in d)
23
+ m.call(d, h) && !E.hasOwnProperty(h) && (w[h] = d[h]);
24
+ if (_ && _.defaultProps)
25
+ for (h in d = _.defaultProps, d)
26
+ w[h] === void 0 && (w[h] = d[h]);
27
+ return { $$typeof: j, type: _, key: l, ref: C, props: w, _owner: S.current };
28
28
  }
29
- return W.Fragment = y, W.jsx = k, W.jsxs = k, W;
29
+ return L.Fragment = y, L.jsx = k, L.jsxs = k, L;
30
30
  }
31
- var Y = {};
31
+ var W = {};
32
32
  /**
33
33
  * @license React
34
34
  * react-jsx-runtime.development.js
@@ -39,17 +39,17 @@ var Y = {};
39
39
  * LICENSE file in the root directory of this source tree.
40
40
  */
41
41
  var Se;
42
- function hr() {
42
+ function mr() {
43
43
  return Se || (Se = 1, process.env.NODE_ENV !== "production" && function() {
44
- var E = ke, C = Symbol.for("react.element"), y = Symbol.for("react.portal"), g = Symbol.for("react.fragment"), S = Symbol.for("react.strict_mode"), _ = Symbol.for("react.profiler"), k = Symbol.for("react.provider"), x = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), T = Symbol.for("react.suspense"), p = Symbol.for("react.suspense_list"), l = Symbol.for("react.memo"), R = Symbol.for("react.lazy"), D = Symbol.for("react.offscreen"), M = Symbol.iterator, Q = "@@iterator";
45
- function v(e) {
44
+ var R = ke, j = Symbol.for("react.element"), y = Symbol.for("react.portal"), m = Symbol.for("react.fragment"), S = Symbol.for("react.strict_mode"), E = Symbol.for("react.profiler"), k = Symbol.for("react.provider"), _ = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), O = Symbol.for("react.suspense"), h = Symbol.for("react.suspense_list"), w = Symbol.for("react.memo"), l = Symbol.for("react.lazy"), C = Symbol.for("react.offscreen"), Y = Symbol.iterator, J = "@@iterator";
45
+ function Q(e) {
46
46
  if (e === null || typeof e != "object")
47
47
  return null;
48
- var r = M && e[M] || e[Q];
48
+ var r = Y && e[Y] || e[J];
49
49
  return typeof r == "function" ? r : null;
50
50
  }
51
- var O = E.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
52
- function h(e) {
51
+ var u = R.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
52
+ function p(e) {
53
53
  {
54
54
  for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
55
55
  t[n - 1] = arguments[n];
@@ -58,7 +58,7 @@ function hr() {
58
58
  }
59
59
  function Pe(e, r, t) {
60
60
  {
61
- var n = O.ReactDebugCurrentFrame, s = n.getStackAddendum();
61
+ var n = u.ReactDebugCurrentFrame, s = n.getStackAddendum();
62
62
  s !== "" && (r += "%s", t = t.concat([s]));
63
63
  var c = t.map(function(i) {
64
64
  return String(i);
@@ -69,7 +69,7 @@ function hr() {
69
69
  var Ne = !1, De = !1, qe = !1, Fe = !1, Ae = !1, ae;
70
70
  ae = Symbol.for("react.module.reference");
71
71
  function $e(e) {
72
- return !!(typeof e == "string" || typeof e == "function" || e === g || e === _ || Ae || e === S || e === T || e === p || Fe || e === D || Ne || De || qe || typeof e == "object" && e !== null && (e.$$typeof === R || e.$$typeof === l || e.$$typeof === k || e.$$typeof === x || e.$$typeof === f || // This needs to include all possible module reference object
72
+ return !!(typeof e == "string" || typeof e == "function" || e === m || e === E || Ae || e === S || e === O || e === h || Fe || e === C || Ne || De || qe || typeof e == "object" && e !== null && (e.$$typeof === l || e.$$typeof === w || e.$$typeof === k || e.$$typeof === _ || e.$$typeof === d || // This needs to include all possible module reference object
73
73
  // types supported by any Flight configuration anywhere since
74
74
  // we don't know which Flight build this will end up being used
75
75
  // with.
@@ -85,44 +85,44 @@ function hr() {
85
85
  function oe(e) {
86
86
  return e.displayName || "Context";
87
87
  }
88
- function w(e) {
88
+ function T(e) {
89
89
  if (e == null)
90
90
  return null;
91
- if (typeof e.tag == "number" && h("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
91
+ if (typeof e.tag == "number" && p("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
92
92
  return e.displayName || e.name || null;
93
93
  if (typeof e == "string")
94
94
  return e;
95
95
  switch (e) {
96
- case g:
96
+ case m:
97
97
  return "Fragment";
98
98
  case y:
99
99
  return "Portal";
100
- case _:
100
+ case E:
101
101
  return "Profiler";
102
102
  case S:
103
103
  return "StrictMode";
104
- case T:
104
+ case O:
105
105
  return "Suspense";
106
- case p:
106
+ case h:
107
107
  return "SuspenseList";
108
108
  }
109
109
  if (typeof e == "object")
110
110
  switch (e.$$typeof) {
111
- case x:
111
+ case _:
112
112
  var r = e;
113
113
  return oe(r) + ".Consumer";
114
114
  case k:
115
115
  var t = e;
116
116
  return oe(t._context) + ".Provider";
117
- case f:
117
+ case d:
118
118
  return Ie(e, e.render, "ForwardRef");
119
- case l:
119
+ case w:
120
120
  var n = e.displayName || null;
121
- return n !== null ? n : w(e.type) || "Memo";
122
- case R: {
121
+ return n !== null ? n : T(e.type) || "Memo";
122
+ case l: {
123
123
  var s = e, c = s._payload, i = s._init;
124
124
  try {
125
- return w(i(c));
125
+ return T(i(c));
126
126
  } catch {
127
127
  return null;
128
128
  }
@@ -130,13 +130,13 @@ function hr() {
130
130
  }
131
131
  return null;
132
132
  }
133
- var P = Object.assign, A = 0, ie, se, le, ce, ue, fe, de;
133
+ var P = Object.assign, F = 0, ie, se, le, ce, ue, fe, de;
134
134
  function ve() {
135
135
  }
136
136
  ve.__reactDisabledLog = !0;
137
137
  function Le() {
138
138
  {
139
- if (A === 0) {
139
+ if (F === 0) {
140
140
  ie = console.log, se = console.info, le = console.warn, ce = console.error, ue = console.group, fe = console.groupCollapsed, de = console.groupEnd;
141
141
  var e = {
142
142
  configurable: !0,
@@ -154,12 +154,12 @@ function hr() {
154
154
  groupEnd: e
155
155
  });
156
156
  }
157
- A++;
157
+ F++;
158
158
  }
159
159
  }
160
160
  function We() {
161
161
  {
162
- if (A--, A === 0) {
162
+ if (F--, F === 0) {
163
163
  var e = {
164
164
  configurable: !0,
165
165
  enumerable: !0,
@@ -189,11 +189,11 @@ function hr() {
189
189
  })
190
190
  });
191
191
  }
192
- A < 0 && h("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
192
+ F < 0 && p("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
193
193
  }
194
194
  }
195
- var K = O.ReactCurrentDispatcher, G;
196
- function U(e, r, t) {
195
+ var K = u.ReactCurrentDispatcher, G;
196
+ function M(e, r, t) {
197
197
  {
198
198
  if (G === void 0)
199
199
  try {
@@ -206,16 +206,16 @@ function hr() {
206
206
  ` + G + e;
207
207
  }
208
208
  }
209
- var z = !1, V;
209
+ var z = !1, U;
210
210
  {
211
211
  var Ye = typeof WeakMap == "function" ? WeakMap : Map;
212
- V = new Ye();
212
+ U = new Ye();
213
213
  }
214
214
  function pe(e, r) {
215
215
  if (!e || z)
216
216
  return "";
217
217
  {
218
- var t = V.get(e);
218
+ var t = U.get(e);
219
219
  if (t !== void 0)
220
220
  return t;
221
221
  }
@@ -260,27 +260,27 @@ function hr() {
260
260
  } catch (b) {
261
261
  if (b && n && typeof b.stack == "string") {
262
262
  for (var o = b.stack.split(`
263
- `), m = n.stack.split(`
264
- `), u = o.length - 1, d = m.length - 1; u >= 1 && d >= 0 && o[u] !== m[d]; )
265
- d--;
266
- for (; u >= 1 && d >= 0; u--, d--)
267
- if (o[u] !== m[d]) {
268
- if (u !== 1 || d !== 1)
263
+ `), g = n.stack.split(`
264
+ `), f = o.length - 1, v = g.length - 1; f >= 1 && v >= 0 && o[f] !== g[v]; )
265
+ v--;
266
+ for (; f >= 1 && v >= 0; f--, v--)
267
+ if (o[f] !== g[v]) {
268
+ if (f !== 1 || v !== 1)
269
269
  do
270
- if (u--, d--, d < 0 || o[u] !== m[d]) {
271
- var j = `
272
- ` + o[u].replace(" at new ", " at ");
273
- return e.displayName && j.includes("<anonymous>") && (j = j.replace("<anonymous>", e.displayName)), typeof e == "function" && V.set(e, j), j;
270
+ if (f--, v--, v < 0 || o[f] !== g[v]) {
271
+ var x = `
272
+ ` + o[f].replace(" at new ", " at ");
273
+ return e.displayName && x.includes("<anonymous>") && (x = x.replace("<anonymous>", e.displayName)), typeof e == "function" && U.set(e, x), x;
274
274
  }
275
- while (u >= 1 && d >= 0);
275
+ while (f >= 1 && v >= 0);
276
276
  break;
277
277
  }
278
278
  }
279
279
  } finally {
280
280
  z = !1, K.current = c, We(), Error.prepareStackTrace = s;
281
281
  }
282
- var F = e ? e.displayName || e.name : "", N = F ? U(F) : "";
283
- return typeof e == "function" && V.set(e, N), N;
282
+ var q = e ? e.displayName || e.name : "", N = q ? M(q) : "";
283
+ return typeof e == "function" && U.set(e, N), N;
284
284
  }
285
285
  function Me(e, r, t) {
286
286
  return pe(e, !1);
@@ -289,59 +289,59 @@ function hr() {
289
289
  var r = e.prototype;
290
290
  return !!(r && r.isReactComponent);
291
291
  }
292
- function B(e, r, t) {
292
+ function V(e, r, t) {
293
293
  if (e == null)
294
294
  return "";
295
295
  if (typeof e == "function")
296
296
  return pe(e, Ue(e));
297
297
  if (typeof e == "string")
298
- return U(e);
298
+ return M(e);
299
299
  switch (e) {
300
- case T:
301
- return U("Suspense");
302
- case p:
303
- return U("SuspenseList");
300
+ case O:
301
+ return M("Suspense");
302
+ case h:
303
+ return M("SuspenseList");
304
304
  }
305
305
  if (typeof e == "object")
306
306
  switch (e.$$typeof) {
307
- case f:
307
+ case d:
308
308
  return Me(e.render);
309
- case l:
310
- return B(e.type, r, t);
311
- case R: {
309
+ case w:
310
+ return V(e.type, r, t);
311
+ case l: {
312
312
  var n = e, s = n._payload, c = n._init;
313
313
  try {
314
- return B(c(s), r, t);
314
+ return V(c(s), r, t);
315
315
  } catch {
316
316
  }
317
317
  }
318
318
  }
319
319
  return "";
320
320
  }
321
- var $ = Object.prototype.hasOwnProperty, he = {}, ge = O.ReactDebugCurrentFrame;
322
- function J(e) {
321
+ var A = Object.prototype.hasOwnProperty, he = {}, me = u.ReactDebugCurrentFrame;
322
+ function B(e) {
323
323
  if (e) {
324
- var r = e._owner, t = B(e.type, e._source, r ? r.type : null);
325
- ge.setExtraStackFrame(t);
324
+ var r = e._owner, t = V(e.type, e._source, r ? r.type : null);
325
+ me.setExtraStackFrame(t);
326
326
  } else
327
- ge.setExtraStackFrame(null);
327
+ me.setExtraStackFrame(null);
328
328
  }
329
329
  function Ve(e, r, t, n, s) {
330
330
  {
331
- var c = Function.call.bind($);
331
+ var c = Function.call.bind(A);
332
332
  for (var i in e)
333
333
  if (c(e, i)) {
334
334
  var o = void 0;
335
335
  try {
336
336
  if (typeof e[i] != "function") {
337
- var m = Error((n || "React class") + ": " + t + " type `" + i + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[i] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
338
- throw m.name = "Invariant Violation", m;
337
+ var g = Error((n || "React class") + ": " + t + " type `" + i + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[i] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
338
+ throw g.name = "Invariant Violation", g;
339
339
  }
340
340
  o = e[i](r, i, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
341
- } catch (u) {
342
- o = u;
341
+ } catch (f) {
342
+ o = f;
343
343
  }
344
- o && !(o instanceof Error) && (J(s), h("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, i, typeof o), J(null)), o instanceof Error && !(o.message in he) && (he[o.message] = !0, J(s), h("Failed %s type: %s", t, o.message), J(null));
344
+ o && !(o instanceof Error) && (B(s), p("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, i, typeof o), B(null)), o instanceof Error && !(o.message in he) && (he[o.message] = !0, B(s), p("Failed %s type: %s", t, o.message), B(null));
345
345
  }
346
346
  }
347
347
  }
@@ -357,19 +357,19 @@ function hr() {
357
357
  }
358
358
  function Qe(e) {
359
359
  try {
360
- return me(e), !1;
360
+ return ge(e), !1;
361
361
  } catch {
362
362
  return !0;
363
363
  }
364
364
  }
365
- function me(e) {
365
+ function ge(e) {
366
366
  return "" + e;
367
367
  }
368
368
  function be(e) {
369
369
  if (Qe(e))
370
- return h("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Je(e)), me(e);
370
+ return p("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Je(e)), ge(e);
371
371
  }
372
- var I = O.ReactCurrentOwner, Ke = {
372
+ var $ = u.ReactCurrentOwner, Ke = {
373
373
  key: !0,
374
374
  ref: !0,
375
375
  __self: !0,
@@ -377,7 +377,7 @@ function hr() {
377
377
  }, ye, Re, X;
378
378
  X = {};
379
379
  function Ge(e) {
380
- if ($.call(e, "ref")) {
380
+ if (A.call(e, "ref")) {
381
381
  var r = Object.getOwnPropertyDescriptor(e, "ref").get;
382
382
  if (r && r.isReactWarning)
383
383
  return !1;
@@ -385,7 +385,7 @@ function hr() {
385
385
  return e.ref !== void 0;
386
386
  }
387
387
  function ze(e) {
388
- if ($.call(e, "key")) {
388
+ if (A.call(e, "key")) {
389
389
  var r = Object.getOwnPropertyDescriptor(e, "key").get;
390
390
  if (r && r.isReactWarning)
391
391
  return !1;
@@ -393,15 +393,15 @@ function hr() {
393
393
  return e.key !== void 0;
394
394
  }
395
395
  function He(e, r) {
396
- if (typeof e.ref == "string" && I.current && r && I.current.stateNode !== r) {
397
- var t = w(I.current.type);
398
- X[t] || (h('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', w(I.current.type), e.ref), X[t] = !0);
396
+ if (typeof e.ref == "string" && $.current && r && $.current.stateNode !== r) {
397
+ var t = T($.current.type);
398
+ X[t] || (p('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', T($.current.type), e.ref), X[t] = !0);
399
399
  }
400
400
  }
401
401
  function Xe(e, r) {
402
402
  {
403
403
  var t = function() {
404
- ye || (ye = !0, h("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
404
+ ye || (ye = !0, p("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
405
405
  };
406
406
  t.isReactWarning = !0, Object.defineProperty(e, "key", {
407
407
  get: t,
@@ -412,7 +412,7 @@ function hr() {
412
412
  function Ze(e, r) {
413
413
  {
414
414
  var t = function() {
415
- Re || (Re = !0, h("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
415
+ Re || (Re = !0, p("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
416
416
  };
417
417
  t.isReactWarning = !0, Object.defineProperty(e, "ref", {
418
418
  get: t,
@@ -423,7 +423,7 @@ function hr() {
423
423
  var er = function(e, r, t, n, s, c, i) {
424
424
  var o = {
425
425
  // This tag allows us to uniquely identify this as a React Element
426
- $$typeof: C,
426
+ $$typeof: j,
427
427
  // Built-in properties that belong on the element
428
428
  type: e,
429
429
  key: r,
@@ -451,26 +451,26 @@ function hr() {
451
451
  };
452
452
  function rr(e, r, t, n, s) {
453
453
  {
454
- var c, i = {}, o = null, m = null;
455
- t !== void 0 && (be(t), o = "" + t), ze(r) && (be(r.key), o = "" + r.key), Ge(r) && (m = r.ref, He(r, s));
454
+ var c, i = {}, o = null, g = null;
455
+ t !== void 0 && (be(t), o = "" + t), ze(r) && (be(r.key), o = "" + r.key), Ge(r) && (g = r.ref, He(r, s));
456
456
  for (c in r)
457
- $.call(r, c) && !Ke.hasOwnProperty(c) && (i[c] = r[c]);
457
+ A.call(r, c) && !Ke.hasOwnProperty(c) && (i[c] = r[c]);
458
458
  if (e && e.defaultProps) {
459
- var u = e.defaultProps;
460
- for (c in u)
461
- i[c] === void 0 && (i[c] = u[c]);
459
+ var f = e.defaultProps;
460
+ for (c in f)
461
+ i[c] === void 0 && (i[c] = f[c]);
462
462
  }
463
- if (o || m) {
464
- var d = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
465
- o && Xe(i, d), m && Ze(i, d);
463
+ if (o || g) {
464
+ var v = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
465
+ o && Xe(i, v), g && Ze(i, v);
466
466
  }
467
- return er(e, o, m, s, n, I.current, i);
467
+ return er(e, o, g, s, n, $.current, i);
468
468
  }
469
469
  }
470
- var Z = O.ReactCurrentOwner, Ee = O.ReactDebugCurrentFrame;
471
- function q(e) {
470
+ var Z = u.ReactCurrentOwner, Ee = u.ReactDebugCurrentFrame;
471
+ function D(e) {
472
472
  if (e) {
473
- var r = e._owner, t = B(e.type, e._source, r ? r.type : null);
473
+ var r = e._owner, t = V(e.type, e._source, r ? r.type : null);
474
474
  Ee.setExtraStackFrame(t);
475
475
  } else
476
476
  Ee.setExtraStackFrame(null);
@@ -478,12 +478,12 @@ function hr() {
478
478
  var ee;
479
479
  ee = !1;
480
480
  function re(e) {
481
- return typeof e == "object" && e !== null && e.$$typeof === C;
481
+ return typeof e == "object" && e !== null && e.$$typeof === j;
482
482
  }
483
483
  function _e() {
484
484
  {
485
485
  if (Z.current) {
486
- var e = w(Z.current.type);
486
+ var e = T(Z.current.type);
487
487
  if (e)
488
488
  return `
489
489
 
@@ -526,10 +526,10 @@ Check the top-level render call using <` + t + ">.");
526
526
  return;
527
527
  xe[t] = !0;
528
528
  var n = "";
529
- e && e._owner && e._owner !== Z.current && (n = " It was passed a child from " + w(e._owner.type) + "."), q(e), h('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), q(null);
529
+ e && e._owner && e._owner !== Z.current && (n = " It was passed a child from " + T(e._owner.type) + "."), D(e), p('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), D(null);
530
530
  }
531
531
  }
532
- function Ce(e, r) {
532
+ function we(e, r) {
533
533
  {
534
534
  if (typeof e != "object")
535
535
  return;
@@ -541,7 +541,7 @@ Check the top-level render call using <` + t + ">.");
541
541
  else if (re(e))
542
542
  e._store && (e._store.validated = !0);
543
543
  else if (e) {
544
- var s = v(e);
544
+ var s = Q(e);
545
545
  if (typeof s == "function" && s !== e.entries)
546
546
  for (var c = s.call(e), i; !(i = c.next()).done; )
547
547
  re(i.value) && je(i.value, r);
@@ -556,21 +556,21 @@ Check the top-level render call using <` + t + ">.");
556
556
  var t;
557
557
  if (typeof r == "function")
558
558
  t = r.propTypes;
559
- else if (typeof r == "object" && (r.$$typeof === f || // Note: Memo only checks outer props here.
559
+ else if (typeof r == "object" && (r.$$typeof === d || // Note: Memo only checks outer props here.
560
560
  // Inner props are checked in the reconciler.
561
- r.$$typeof === l))
561
+ r.$$typeof === w))
562
562
  t = r.propTypes;
563
563
  else
564
564
  return;
565
565
  if (t) {
566
- var n = w(r);
566
+ var n = T(r);
567
567
  Ve(t, e.props, "prop", n, e);
568
568
  } else if (r.PropTypes !== void 0 && !ee) {
569
569
  ee = !0;
570
- var s = w(r);
571
- h("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", s || "Unknown");
570
+ var s = T(r);
571
+ p("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", s || "Unknown");
572
572
  }
573
- typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && h("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
573
+ typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && p("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
574
574
  }
575
575
  }
576
576
  function or(e) {
@@ -578,56 +578,56 @@ Check the top-level render call using <` + t + ">.");
578
578
  for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
579
579
  var n = r[t];
580
580
  if (n !== "children" && n !== "key") {
581
- q(e), h("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), q(null);
581
+ D(e), p("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), D(null);
582
582
  break;
583
583
  }
584
584
  }
585
- e.ref !== null && (q(e), h("Invalid attribute `ref` supplied to `React.Fragment`."), q(null));
585
+ e.ref !== null && (D(e), p("Invalid attribute `ref` supplied to `React.Fragment`."), D(null));
586
586
  }
587
587
  }
588
- var we = {};
588
+ var Ce = {};
589
589
  function Te(e, r, t, n, s, c) {
590
590
  {
591
591
  var i = $e(e);
592
592
  if (!i) {
593
593
  var o = "";
594
594
  (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (o += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
595
- var m = tr(s);
596
- m ? o += m : o += _e();
597
- var u;
598
- e === null ? u = "null" : H(e) ? u = "array" : e !== void 0 && e.$$typeof === C ? (u = "<" + (w(e.type) || "Unknown") + " />", o = " Did you accidentally export a JSX literal instead of a component?") : u = typeof e, h("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", u, o);
595
+ var g = tr(s);
596
+ g ? o += g : o += _e();
597
+ var f;
598
+ e === null ? f = "null" : H(e) ? f = "array" : e !== void 0 && e.$$typeof === j ? (f = "<" + (T(e.type) || "Unknown") + " />", o = " Did you accidentally export a JSX literal instead of a component?") : f = typeof e, p("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", f, o);
599
599
  }
600
- var d = rr(e, r, t, s, c);
601
- if (d == null)
602
- return d;
600
+ var v = rr(e, r, t, s, c);
601
+ if (v == null)
602
+ return v;
603
603
  if (i) {
604
- var j = r.children;
605
- if (j !== void 0)
604
+ var x = r.children;
605
+ if (x !== void 0)
606
606
  if (n)
607
- if (H(j)) {
608
- for (var F = 0; F < j.length; F++)
609
- Ce(j[F], e);
610
- Object.freeze && Object.freeze(j);
607
+ if (H(x)) {
608
+ for (var q = 0; q < x.length; q++)
609
+ we(x[q], e);
610
+ Object.freeze && Object.freeze(x);
611
611
  } else
612
- h("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
612
+ p("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
613
613
  else
614
- Ce(j, e);
614
+ we(x, e);
615
615
  }
616
- if ($.call(r, "key")) {
617
- var N = w(e), b = Object.keys(r).filter(function(fr) {
616
+ if (A.call(r, "key")) {
617
+ var N = T(e), b = Object.keys(r).filter(function(fr) {
618
618
  return fr !== "key";
619
619
  }), te = b.length > 0 ? "{key: someKey, " + b.join(": ..., ") + ": ...}" : "{key: someKey}";
620
- if (!we[N + te]) {
620
+ if (!Ce[N + te]) {
621
621
  var ur = b.length > 0 ? "{" + b.join(": ..., ") + ": ...}" : "{}";
622
- h(`A props object containing a "key" prop is being spread into JSX:
622
+ p(`A props object containing a "key" prop is being spread into JSX:
623
623
  let props = %s;
624
624
  <%s {...props} />
625
625
  React keys must be passed directly to JSX without using spread:
626
626
  let props = %s;
627
- <%s key={someKey} {...props} />`, te, N, ur, N), we[N + te] = !0;
627
+ <%s key={someKey} {...props} />`, te, N, ur, N), Ce[N + te] = !0;
628
628
  }
629
629
  }
630
- return e === g ? or(d) : ar(d), d;
630
+ return e === m ? or(v) : ar(v), v;
631
631
  }
632
632
  }
633
633
  function ir(e, r, t) {
@@ -637,81 +637,87 @@ React keys must be passed directly to JSX without using spread:
637
637
  return Te(e, r, t, !1);
638
638
  }
639
639
  var lr = sr, cr = ir;
640
- Y.Fragment = g, Y.jsx = lr, Y.jsxs = cr;
641
- }()), Y;
640
+ W.Fragment = m, W.jsx = lr, W.jsxs = cr;
641
+ }()), W;
642
642
  }
643
- process.env.NODE_ENV === "production" ? ne.exports = pr() : ne.exports = hr();
643
+ process.env.NODE_ENV === "production" ? ne.exports = hr() : ne.exports = mr();
644
644
  var a = ne.exports;
645
- async function gr(E, C = {}) {
645
+ async function gr(R, j = {}) {
646
646
  const y = {
647
647
  width: 300,
648
648
  margin: 2,
649
649
  color: { dark: "#000000", light: "#ffffff" },
650
650
  errorCorrectionLevel: "M",
651
- ...C
651
+ ...j
652
652
  };
653
- if (!E || E.trim() === "")
653
+ if (!R || R.trim() === "")
654
654
  throw new Error("输入内容不能为空");
655
655
  try {
656
- return await vr.toDataURL(E, y);
657
- } catch (g) {
658
- throw new Error(`生成二维码失败: ${g.message}`);
656
+ return await pr.toDataURL(R, y);
657
+ } catch (m) {
658
+ throw new Error(`生成二维码失败: ${m.message}`);
659
659
  }
660
660
  }
661
- function mr(E, C = "qrcode.png") {
661
+ function br(R, j = "qrcode.png") {
662
662
  const y = document.createElement("a");
663
- y.href = E, y.download = C, document.body.appendChild(y), y.click(), document.body.removeChild(y);
663
+ y.href = R, y.download = j, document.body.appendChild(y), y.click(), document.body.removeChild(y);
664
664
  }
665
- function Rr({ onClose: E, onMinimize: C, onMaximize: y }) {
666
- const [g, S] = L("text"), [_, k] = L(""), [x, f] = L(""), [T, p] = L(""), [l, R] = L({
665
+ function Er({ onClose: R, onMinimize: j, onMaximize: y }) {
666
+ const [m, S] = I("text"), [E, k] = I(""), [_, d] = I(""), [O, h] = I(""), w = dr(() => {
667
+ try {
668
+ return window.self !== window.top;
669
+ } catch {
670
+ return !0;
671
+ }
672
+ }, []), [l, C] = I({
667
673
  width: 300,
668
674
  margin: 2,
669
675
  color: "#000000",
670
676
  bgColor: "#ffffff",
671
677
  errorLevel: "M"
672
678
  });
673
- dr(() => {
674
- _.trim() ? D() : f("");
675
- }, [_, l, g]);
676
- const D = async () => {
677
- if (!_.trim()) {
678
- f("");
679
+ vr(() => {
680
+ E.trim() ? Y() : d("");
681
+ }, [E, l, m]);
682
+ const Y = async () => {
683
+ if (!E.trim()) {
684
+ d("");
679
685
  return;
680
686
  }
681
- p("");
687
+ h("");
682
688
  try {
683
- const v = g === "url" && !_.match(/^https?:\/\//) ? `https://${_}` : _, O = await gr(v, {
689
+ const u = m === "url" && !E.match(/^https?:\/\//) ? `https://${E}` : E, p = await gr(u, {
684
690
  width: l.width,
685
691
  margin: l.margin,
686
692
  color: { dark: l.color, light: l.bgColor },
687
693
  errorCorrectionLevel: l.errorLevel
688
694
  });
689
- f(O);
690
- } catch (v) {
691
- p(v.message), f("");
695
+ d(p);
696
+ } catch (u) {
697
+ h(u.message), d("");
692
698
  }
693
- }, M = () => {
694
- if (x) {
695
- const v = (/* @__PURE__ */ new Date()).getTime();
696
- mr(x, `qrcode-${v}.png`);
699
+ }, J = () => {
700
+ if (_) {
701
+ const u = (/* @__PURE__ */ new Date()).getTime();
702
+ br(_, `qrcode-${u}.png`);
697
703
  }
698
- }, Q = (v) => {
699
- k(v.target.value);
704
+ }, Q = (u) => {
705
+ k(u.target.value);
700
706
  };
701
707
  return /* @__PURE__ */ a.jsxs("div", { className: "qrcode-plugin", children: [
702
708
  /* @__PURE__ */ a.jsxs("div", { className: "qrcode-header", children: [
703
709
  /* @__PURE__ */ a.jsx("h2", { children: "📱 二维码生成器" }),
704
- E && /* @__PURE__ */ a.jsxs("div", { className: "qrcode-window-controls", children: [
705
- /* @__PURE__ */ a.jsx("button", { onClick: C, title: "最小化", children: "─" }),
710
+ R && !w && /* @__PURE__ */ a.jsxs("div", { className: "qrcode-window-controls", children: [
711
+ /* @__PURE__ */ a.jsx("button", { onClick: j, title: "最小化", children: "─" }),
706
712
  /* @__PURE__ */ a.jsx("button", { onClick: y, title: "最大化", children: "□" }),
707
- /* @__PURE__ */ a.jsx("button", { onClick: E, title: "关闭", children: "✕" })
713
+ /* @__PURE__ */ a.jsx("button", { onClick: R, title: "关闭", children: "✕" })
708
714
  ] })
709
715
  ] }),
710
716
  /* @__PURE__ */ a.jsxs("div", { className: "qrcode-tabs", children: [
711
717
  /* @__PURE__ */ a.jsx(
712
718
  "button",
713
719
  {
714
- className: `qrcode-tab ${g === "text" ? "active" : ""}`,
720
+ className: `qrcode-tab ${m === "text" ? "active" : ""}`,
715
721
  onClick: () => S("text"),
716
722
  children: "文本"
717
723
  }
@@ -719,7 +725,7 @@ function Rr({ onClose: E, onMinimize: C, onMaximize: y }) {
719
725
  /* @__PURE__ */ a.jsx(
720
726
  "button",
721
727
  {
722
- className: `qrcode-tab ${g === "url" ? "active" : ""}`,
728
+ className: `qrcode-tab ${m === "url" ? "active" : ""}`,
723
729
  onClick: () => S("url"),
724
730
  children: "链接"
725
731
  }
@@ -727,27 +733,27 @@ function Rr({ onClose: E, onMinimize: C, onMaximize: y }) {
727
733
  ] }),
728
734
  /* @__PURE__ */ a.jsxs("div", { className: "qrcode-content", children: [
729
735
  /* @__PURE__ */ a.jsxs("div", { className: "qrcode-input-section", children: [
730
- /* @__PURE__ */ a.jsx("label", { children: g === "text" ? "输入文本内容" : "输入链接地址" }),
736
+ /* @__PURE__ */ a.jsx("label", { children: m === "text" ? "输入文本内容" : "输入链接地址" }),
731
737
  /* @__PURE__ */ a.jsx(
732
738
  "textarea",
733
739
  {
734
- value: _,
740
+ value: E,
735
741
  onChange: Q,
736
- placeholder: g === "text" ? "请输入要生成二维码的文本内容..." : "请输入 URL 地址...",
742
+ placeholder: m === "text" ? "请输入要生成二维码的文本内容..." : "请输入 URL 地址...",
737
743
  className: "qrcode-textarea",
738
744
  rows: 4
739
745
  }
740
746
  )
741
747
  ] }),
742
- T && /* @__PURE__ */ a.jsxs("div", { className: "qrcode-error", children: [
748
+ O && /* @__PURE__ */ a.jsxs("div", { className: "qrcode-error", children: [
743
749
  "⚠️ ",
744
- T
750
+ O
745
751
  ] }),
746
- x && /* @__PURE__ */ a.jsx("div", { className: "qrcode-preview-section", children: /* @__PURE__ */ a.jsxs("div", { className: "qrcode-preview-card", children: [
752
+ _ && /* @__PURE__ */ a.jsx("div", { className: "qrcode-preview-section", children: /* @__PURE__ */ a.jsxs("div", { className: "qrcode-preview-card", children: [
747
753
  /* @__PURE__ */ a.jsx(
748
754
  "img",
749
755
  {
750
- src: x,
756
+ src: _,
751
757
  alt: "二维码",
752
758
  className: "qrcode-image",
753
759
  style: { width: `${l.width}px` }
@@ -757,7 +763,7 @@ function Rr({ onClose: E, onMinimize: C, onMaximize: y }) {
757
763
  "button",
758
764
  {
759
765
  className: "qrcode-download-btn",
760
- onClick: M,
766
+ onClick: J,
761
767
  children: "📥 下载二维码"
762
768
  }
763
769
  )
@@ -779,7 +785,7 @@ function Rr({ onClose: E, onMinimize: C, onMaximize: y }) {
779
785
  max: "600",
780
786
  step: "50",
781
787
  value: l.width,
782
- onChange: (v) => R({ ...l, width: Number(v.target.value) }),
788
+ onChange: (u) => C({ ...l, width: Number(u.target.value) }),
783
789
  className: "qrcode-slider"
784
790
  }
785
791
  )
@@ -797,7 +803,7 @@ function Rr({ onClose: E, onMinimize: C, onMaximize: y }) {
797
803
  max: "4",
798
804
  step: "1",
799
805
  value: l.margin,
800
- onChange: (v) => R({ ...l, margin: Number(v.target.value) }),
806
+ onChange: (u) => C({ ...l, margin: Number(u.target.value) }),
801
807
  className: "qrcode-slider"
802
808
  }
803
809
  )
@@ -809,7 +815,7 @@ function Rr({ onClose: E, onMinimize: C, onMaximize: y }) {
809
815
  {
810
816
  type: "color",
811
817
  value: l.color,
812
- onChange: (v) => R({ ...l, color: v.target.value }),
818
+ onChange: (u) => C({ ...l, color: u.target.value }),
813
819
  className: "qrcode-color-picker"
814
820
  }
815
821
  )
@@ -821,7 +827,7 @@ function Rr({ onClose: E, onMinimize: C, onMaximize: y }) {
821
827
  {
822
828
  type: "color",
823
829
  value: l.bgColor,
824
- onChange: (v) => R({ ...l, bgColor: v.target.value }),
830
+ onChange: (u) => C({ ...l, bgColor: u.target.value }),
825
831
  className: "qrcode-color-picker"
826
832
  }
827
833
  )
@@ -832,7 +838,7 @@ function Rr({ onClose: E, onMinimize: C, onMaximize: y }) {
832
838
  "select",
833
839
  {
834
840
  value: l.errorLevel,
835
- onChange: (v) => R({ ...l, errorLevel: v.target.value }),
841
+ onChange: (u) => C({ ...l, errorLevel: u.target.value }),
836
842
  className: "qrcode-select",
837
843
  children: [
838
844
  /* @__PURE__ */ a.jsx("option", { value: "L", children: "L (7%)" }),
@@ -848,7 +854,7 @@ function Rr({ onClose: E, onMinimize: C, onMaximize: y }) {
848
854
  ] })
849
855
  ] });
850
856
  }
851
- const Er = {
857
+ const _r = {
852
858
  id: "com.desktop-tool.plugin.qrcode",
853
859
  name: "二维码生成器",
854
860
  version: "1.0.0",
@@ -859,6 +865,6 @@ const Er = {
859
865
  permissions: []
860
866
  };
861
867
  export {
862
- Rr as default,
863
- Er as manifest
868
+ Er as default,
869
+ _r as manifest
864
870
  };
package/manifest.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "id": "com.desktop-tool.plugin.qrcode",
3
+ "name": "二维码生成器",
4
+ "version": "1.0.4",
5
+ "description": "强大的二维码生成工具,支持文本、链接等多种格式",
6
+ "author": "Desktop Tool",
7
+ "icon": "📱",
8
+ "category": "工具",
9
+ "permissions": [],
10
+ "entry": "dist/index.js",
11
+ "style": "dist/style.css"
12
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "desktop-tool-pl-qrcode",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "强大的二维码生成工具",
5
5
  "keywords": [
6
6
  "desktop-tool-plugin",
@@ -1,4 +1,4 @@
1
- import React, { useState, useEffect } from 'react';
1
+ import React, { useState, useEffect, useMemo } from 'react';
2
2
  import { generateQRCode, downloadQRCode } from './utils/qrcode-generator';
3
3
  import './QRCodePlugin.css';
4
4
 
@@ -19,6 +19,17 @@ function QRCodePlugin({ onClose, onMinimize, onMaximize }: QRCodePluginProps) {
19
19
  const [qrCodeUrl, setQrCodeUrl] = useState<string>('');
20
20
  const [error, setError] = useState<string>('');
21
21
 
22
+ // 检测是否在iframe中运行
23
+ // 在iframe中时,隐藏内部窗口控制按钮(使用外层Modal的按钮)
24
+ const isInIframe = useMemo(() => {
25
+ try {
26
+ return window.self !== window.top;
27
+ } catch (e) {
28
+ // 跨域限制时,默认为iframe环境
29
+ return true;
30
+ }
31
+ }, []);
32
+
22
33
  const [settings, setSettings] = useState({
23
34
  width: 300,
24
35
  margin: 2,
@@ -78,7 +89,7 @@ function QRCodePlugin({ onClose, onMinimize, onMaximize }: QRCodePluginProps) {
78
89
  <div className="qrcode-plugin">
79
90
  <div className="qrcode-header">
80
91
  <h2>📱 二维码生成器</h2>
81
- {onClose && (
92
+ {onClose && !isInIframe && (
82
93
  <div className="qrcode-window-controls">
83
94
  <button onClick={onMinimize} title="最小化">─</button>
84
95
  <button onClick={onMaximize} title="最大化">□</button>