@wsxjs/wsx-base-components 0.0.6 → 0.0.8
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/LICENSE +21 -0
- package/dist/index.cjs +2 -2
- package/dist/index.js +1289 -708
- package/package.json +55 -55
- package/src/ColorPicker.wsx +0 -2
- package/src/ReactiveCounter.wsx +19 -32
- package/src/SimpleReactiveDemo.wsx +6 -5
- package/src/ThemeSwitcher.wsx +0 -2
- package/src/XyButton.wsx +0 -2
- package/src/XyButtonGroup.wsx +0 -2
package/dist/index.js
CHANGED
|
@@ -1,110 +1,164 @@
|
|
|
1
|
-
import { autoRegister as
|
|
1
|
+
import { autoRegister as V, WebComponent as J, jsx as d, createLogger as et } from "@wsxjs/wsx-core";
|
|
2
2
|
const Qt = ':host{position:relative;display:inline-flex;padding:.25em .625em;box-sizing:border-box;vertical-align:middle;line-height:1.8;overflow:hidden;align-items:center;justify-content:center;font-size:14px;color:var(--fontColor, #333);border-radius:var(--borderRadius, .25em);background:var(--fontColor, #333);transition:background .3s,box-shadow .3s,border-color .3s,color .3s}:host([size="xxxs"]){padding:.03125em .0625em;font-size:6px;line-height:1;min-width:10px;min-height:8px;border-radius:1px}:host([size="xxs"]){padding:.0625em .125em;font-size:8px;line-height:1.1;min-width:14px;min-height:12px;border-radius:2px}:host([size="xs"]){padding:.125em .25em;font-size:10px;line-height:1.2;min-width:18px;min-height:16px;border-radius:3px}:host([size="sm"]){padding:.25em .5em;font-size:12px;line-height:1.4;min-width:24px;min-height:20px;border-radius:4px}:host([size="md"]){padding:.375em .75em;font-size:14px;line-height:1.5;min-width:32px;min-height:28px;border-radius:6px}:host([size="lg"]){padding:.5em 1em;font-size:14px;line-height:1.6;min-width:40px;min-height:32px;border-radius:6px}:host([size="xl"]){padding:.625em 1.25em;font-size:16px;line-height:1.6;min-width:48px;min-height:40px;border-radius:8px}:host([shape="circle"]){border-radius:50%}:host([disabled]),:host([loading]){pointer-events:none;opacity:.6}:host([block]){display:flex}:host([disabled]:not([variant])){background:#0000001a}:host([disabled]) .btn,:host([loading]) .btn{cursor:not-allowed;pointer-events:all}:host(:not([variant="primary"]):not([variant="danger"]):not([disabled]):hover),:host(:not([variant="primary"]):not([variant="danger"]):focus-within),:host([variant="flat"][focus]){color:var(--themeColor, #42b983);border-color:var(--themeColor, #42b983)}:host(:not([variant="primary"]):not([variant="danger"])) .btn:after{background-image:radial-gradient(circle,var(--themeColor, #42b983) 10%,transparent 10.01%)}:host([variant="primary"]){color:#fff;background:var(--themeBackground, var(--themeColor, #42b983))}:host([variant="danger"]){color:#fff;background:var(--themeBackground, var(--dangerColor, #ff7875))}:host([variant="dashed"]){border-style:dashed}:host([variant="flat"]),:host([variant="primary"]),:host([variant="danger"]){border:0;padding:calc(.25em + 1px) calc(.625em + 1px)}:host([variant="flat"]) .btn:before{content:"";position:absolute;background:var(--themeColor, #42b983);pointer-events:none;left:0;right:0;top:0;bottom:0;opacity:0;transition:.3s}:host([variant="flat"]:not([disabled]):hover) .btn:before{opacity:.1}:host(:not([disabled]):hover){z-index:1}:host([variant="flat"]:focus-within) .btn:before,:host([variant="flat"][focus]) .btn:before{opacity:.2}.btn{background:none;outline:0;border:0;position:absolute;left:0;top:0;width:100%;height:100%;padding:0;-webkit-user-select:none;user-select:none;cursor:unset}.loading{margin-right:.35em}::-moz-focus-inner{border:0}.btn:before{content:"";display:block;position:absolute;width:100%;height:100%;left:0;top:0;transition:.2s;background:#fff;opacity:0}:host(:not([disabled]):active) .btn:before{opacity:.2}.btn:after{content:"";display:block;position:absolute;width:100%;height:100%;left:var(--x, 0);top:var(--y, 0);pointer-events:none;background-image:radial-gradient(circle,#fff 10%,transparent 10.01%);background-repeat:no-repeat;background-position:50%;transform:translate(-50%,-50%) scale(10);opacity:0;transition:transform .3s,opacity .8s}.btn:not([disabled]):active:after{transform:translate(-50%,-50%) scale(0);opacity:.3;transition:0s}.icon{margin-right:.35em;transition:none}:host(:empty) .icon{margin:auto}:host(:empty){padding:.65em}:host([type="flat"]:empty),:host([type="primary"]:empty){padding:calc(.65em + 1px)}::slotted(.icon){transition:none}:host([href]){cursor:pointer}';
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
3
|
+
var vt;
|
|
4
|
+
let xt, kt;
|
|
5
|
+
function Y(e, t, r) {
|
|
6
|
+
return (t = Ct(t)) in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
|
|
7
|
+
}
|
|
8
|
+
function Vt(e, t, r, b, B, L) {
|
|
9
|
+
function E(o, a, c) {
|
|
10
|
+
return function(n, s) {
|
|
11
|
+
return c && c(n), o[a].call(n, s);
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
function P(o, a) {
|
|
15
|
+
for (var c = 0; c < o.length; c++) o[c].call(a);
|
|
16
|
+
return a;
|
|
17
|
+
}
|
|
18
|
+
function S(o, a, c, n) {
|
|
19
|
+
if (typeof o != "function" && (n || o !== void 0)) throw new TypeError(a + " must " + (c || "be") + " a function" + (n ? "" : " or undefined"));
|
|
20
|
+
return o;
|
|
21
|
+
}
|
|
22
|
+
function N(o, a, c, n, s, z, A, T, O, y, g, f, p) {
|
|
23
|
+
function v(l) {
|
|
24
|
+
if (!p(l)) throw new TypeError("Attempted to access private element on non-instance");
|
|
25
|
+
}
|
|
26
|
+
var u, x = a[0], k = a[3], _ = !T;
|
|
27
|
+
if (!_) {
|
|
28
|
+
c || Array.isArray(x) || (x = [x]);
|
|
29
|
+
var i = {}, C = [], m = s === 3 ? "get" : s === 4 || f ? "set" : "value";
|
|
30
|
+
y ? (g || f ? i = { get: ut(function() {
|
|
31
|
+
return k(this);
|
|
32
|
+
}, n, "get"), set: function(l) {
|
|
33
|
+
a[4](this, l);
|
|
34
|
+
} } : i[m] = k, g || ut(i[m], n, s === 2 ? "" : m)) : g || (i = Object.getOwnPropertyDescriptor(o, n));
|
|
35
|
+
}
|
|
36
|
+
for (var h = o, I = x.length - 1; I >= 0; I -= c ? 2 : 1) {
|
|
37
|
+
var G = x[I], K = c ? x[I - 1] : void 0, W = {}, $ = { kind: ["field", "accessor", "method", "getter", "setter", "class"][s], name: n, metadata: z, addInitializer: (function(l, w) {
|
|
38
|
+
if (l.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
39
|
+
S(w, "An initializer", "be", !0), A.push(w);
|
|
40
|
+
}).bind(null, W) };
|
|
41
|
+
try {
|
|
42
|
+
if (_) (u = S(G.call(K, h, $), "class decorators", "return")) && (h = u);
|
|
43
|
+
else {
|
|
44
|
+
var D, R;
|
|
45
|
+
$.static = O, $.private = y, y ? s === 2 ? D = function(l) {
|
|
46
|
+
return v(l), i.value;
|
|
47
|
+
} : (s < 4 && (D = E(i, "get", v)), s !== 3 && (R = E(i, "set", v))) : (D = function(l) {
|
|
48
|
+
return l[n];
|
|
49
|
+
}, (s < 2 || s === 4) && (R = function(l, w) {
|
|
50
|
+
l[n] = w;
|
|
51
|
+
}));
|
|
52
|
+
var X = $.access = { has: y ? p.bind() : function(l) {
|
|
53
|
+
return n in l;
|
|
54
|
+
} };
|
|
55
|
+
if (D && (X.get = D), R && (X.set = R), h = G.call(K, f ? { get: i.get, set: i.set } : i[m], $), f) {
|
|
56
|
+
if (typeof h == "object" && h) (u = S(h.get, "accessor.get")) && (i.get = u), (u = S(h.set, "accessor.set")) && (i.set = u), (u = S(h.init, "accessor.init")) && C.push(u);
|
|
57
|
+
else if (h !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
58
|
+
} else S(h, (g ? "field" : "method") + " decorators", "return") && (g ? C.push(h) : i[m] = h);
|
|
59
|
+
}
|
|
60
|
+
} finally {
|
|
61
|
+
W.v = !0;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return (g || f) && T.push(function(l, w) {
|
|
65
|
+
for (var M = C.length - 1; M >= 0; M--) w = C[M].call(l, w);
|
|
66
|
+
return w;
|
|
67
|
+
}), g || _ || (y ? f ? T.push(E(i, "get"), E(i, "set")) : T.push(s === 2 ? i[m] : E.call.bind(i[m])) : Object.defineProperty(o, n, i)), h;
|
|
68
|
+
}
|
|
69
|
+
function H(o, a) {
|
|
70
|
+
return Object.defineProperty(o, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: a });
|
|
71
|
+
}
|
|
72
|
+
if (arguments.length >= 6) var F = L[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
73
|
+
var j = Object.create(F ?? null), U = function(o, a, c, n) {
|
|
74
|
+
var s, z, A = [], T = function(m) {
|
|
75
|
+
return te(m) === o;
|
|
76
|
+
}, O = /* @__PURE__ */ new Map();
|
|
77
|
+
function y(m) {
|
|
78
|
+
m && A.push(P.bind(null, m));
|
|
79
|
+
}
|
|
80
|
+
for (var g = 0; g < a.length; g++) {
|
|
81
|
+
var f = a[g];
|
|
82
|
+
if (Array.isArray(f)) {
|
|
83
|
+
var p = f[1], v = f[2], u = f.length > 3, x = 16 & p, k = !!(8 & p), _ = (p &= 7) == 0, i = v + "/" + k;
|
|
84
|
+
if (!_ && !u) {
|
|
85
|
+
var C = O.get(i);
|
|
86
|
+
if (C === !0 || C === 3 && p !== 4 || C === 4 && p !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + v);
|
|
87
|
+
O.set(i, !(p > 2) || p);
|
|
88
|
+
}
|
|
89
|
+
N(k ? o : o.prototype, f, x, u ? "#" + v : Ct(v), p, n, k ? z = z || [] : s = s || [], A, k, u, _, p === 1, k && u ? T : c);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return y(s), y(z), A;
|
|
93
|
+
}(e, t, B, j);
|
|
94
|
+
return r.length || H(e, j), { e: U, get c() {
|
|
95
|
+
var o = [];
|
|
96
|
+
return r.length && [H(N(e, [r], b, e.name, 5, j, o), j), P.bind(null, o, e)];
|
|
97
|
+
} };
|
|
98
|
+
}
|
|
99
|
+
function Ct(e) {
|
|
100
|
+
var t = Zt(e, "string");
|
|
101
|
+
return typeof t == "symbol" ? t : t + "";
|
|
102
|
+
}
|
|
103
|
+
function Zt(e, t) {
|
|
104
|
+
if (typeof e != "object" || !e) return e;
|
|
105
|
+
var r = e[Symbol.toPrimitive];
|
|
106
|
+
if (r !== void 0) {
|
|
107
|
+
var b = r.call(e, t);
|
|
108
|
+
if (typeof b != "object") return b;
|
|
109
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
110
|
+
}
|
|
111
|
+
return String(e);
|
|
112
|
+
}
|
|
113
|
+
function ut(e, t, r) {
|
|
114
|
+
typeof t == "symbol" && (t = (t = t.description) ? "[" + t + "]" : "");
|
|
115
|
+
try {
|
|
116
|
+
Object.defineProperty(e, "name", { configurable: !0, value: r ? r + " " + t : t });
|
|
117
|
+
} catch {
|
|
118
|
+
}
|
|
119
|
+
return e;
|
|
120
|
+
}
|
|
121
|
+
function te(e) {
|
|
122
|
+
if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (e !== null ? typeof e : "null"));
|
|
123
|
+
return e;
|
|
124
|
+
}
|
|
125
|
+
kt = [V({
|
|
126
|
+
tagName: "xy-button"
|
|
127
|
+
})];
|
|
128
|
+
let ee;
|
|
129
|
+
class re extends J {
|
|
130
|
+
static get observedAttributes() {
|
|
131
|
+
return ["disabled", "icon", "loading", "href", "type", "target", "rel", "download", "toggle", "checked", "variant", "shape", "block", "size"];
|
|
132
|
+
}
|
|
17
133
|
constructor(t = {}) {
|
|
18
134
|
super({
|
|
19
|
-
styles: Qt,
|
|
20
135
|
styleName: "xy-button",
|
|
21
136
|
...t
|
|
22
|
-
}),
|
|
137
|
+
}), Y(this, "_autoStyles", Qt), Y(this, "disabled", !1), Y(this, "loading", !1), Y(this, "toggle", !1), Y(this, "checked", !1), Y(this, "icon", null), Y(this, "href", null), Y(this, "type", null), Y(this, "target", "_blank"), Y(this, "rel", null), Y(this, "download", null), Y(this, "variant", "flat"), Y(this, "size", "md"), Y(this, "btnElement", void 0), Y(this, "iconElement", void 0), Y(this, "loadingElement", void 0), Y(this, "handleMouseDown", (r) => {
|
|
23
138
|
if (this.disabled) return;
|
|
24
|
-
const
|
|
25
|
-
this.style.setProperty("--x", `${
|
|
26
|
-
}),
|
|
27
|
-
(
|
|
28
|
-
}),
|
|
139
|
+
const b = this.getBoundingClientRect(), B = r.clientX - b.left, L = r.clientY - b.top;
|
|
140
|
+
this.style.setProperty("--x", `${B}px`), this.style.setProperty("--y", `${L}px`);
|
|
141
|
+
}), Y(this, "handleKeyDown", (r) => {
|
|
142
|
+
(r.code === "Enter" || r.code === "Space") && r.stopPropagation();
|
|
143
|
+
}), Y(this, "handleClick", () => {
|
|
29
144
|
this.toggle && !this.disabled && (this.checked = !this.checked, this.checked ? this.setAttr("checked", "") : this.removeAttr("checked"));
|
|
30
145
|
}), this.disabled = t.disabled || !1, this.loading = t.loading || !1, this.toggle = t.toggle || !1, this.checked = t.checked || !1, this.icon = t.icon || null, this.href = t.href || null, this.type = t.type || null, this.target = t.target || "_blank", this.rel = t.rel || null, this.download = t.download || null, this.variant = t.variant || "flat", this.size = t.size || "md";
|
|
31
146
|
}
|
|
32
|
-
static get observedAttributes() {
|
|
33
|
-
return [
|
|
34
|
-
"disabled",
|
|
35
|
-
"icon",
|
|
36
|
-
"loading",
|
|
37
|
-
"href",
|
|
38
|
-
"type",
|
|
39
|
-
"target",
|
|
40
|
-
"rel",
|
|
41
|
-
"download",
|
|
42
|
-
"toggle",
|
|
43
|
-
"checked",
|
|
44
|
-
"variant",
|
|
45
|
-
"shape",
|
|
46
|
-
"block",
|
|
47
|
-
"size"
|
|
48
|
-
];
|
|
49
|
-
}
|
|
50
147
|
render() {
|
|
51
|
-
const t = !!this.href,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
download: this.download || void 0,
|
|
58
|
-
className: "btn",
|
|
59
|
-
onMouseDown: this.handleMouseDown,
|
|
60
|
-
onKeyDown: this.handleKeyDown,
|
|
61
|
-
ref: (r) => {
|
|
62
|
-
this.btnElement = r;
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
this.renderContent()
|
|
66
|
-
), s = /* @__PURE__ */ i(
|
|
67
|
-
"button",
|
|
68
|
-
{
|
|
69
|
-
type: this.type || "button",
|
|
70
|
-
disabled: this.disabled,
|
|
71
|
-
className: "btn",
|
|
72
|
-
onMouseDown: this.handleMouseDown,
|
|
73
|
-
onKeyDown: this.handleKeyDown,
|
|
74
|
-
ref: (r) => {
|
|
75
|
-
this.btnElement = r;
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
this.renderContent()
|
|
79
|
-
);
|
|
80
|
-
return /* @__PURE__ */ i("div", { className: "xy-button-container" }, t ? o : s);
|
|
148
|
+
const t = !!this.href, r = /* @__PURE__ */ d("a", { href: this.href, target: this.target, rel: this.rel || void 0, download: this.download || void 0, className: "btn", onMouseDown: this.handleMouseDown, onKeyDown: this.handleKeyDown, ref: (B) => {
|
|
149
|
+
this.btnElement = B;
|
|
150
|
+
} }, this.renderContent()), b = /* @__PURE__ */ d("button", { type: this.type || "button", disabled: this.disabled, className: "btn", onMouseDown: this.handleMouseDown, onKeyDown: this.handleKeyDown, ref: (B) => {
|
|
151
|
+
this.btnElement = B;
|
|
152
|
+
} }, this.renderContent());
|
|
153
|
+
return /* @__PURE__ */ d("div", { className: "xy-button-container" }, t ? r : b);
|
|
81
154
|
}
|
|
82
155
|
renderContent() {
|
|
83
156
|
const t = [];
|
|
84
|
-
return this.loading && t.push(
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
ref: (o) => {
|
|
90
|
-
this.loadingElement = o;
|
|
91
|
-
}
|
|
92
|
-
},
|
|
93
|
-
"Loading..."
|
|
94
|
-
)
|
|
95
|
-
), !this.loading && this.icon && this.icon !== "null" && t.push(
|
|
96
|
-
/* @__PURE__ */ i(
|
|
97
|
-
"div",
|
|
98
|
-
{
|
|
99
|
-
className: "icon",
|
|
100
|
-
"data-icon": this.icon,
|
|
101
|
-
ref: (o) => {
|
|
102
|
-
this.iconElement = o;
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
this.icon
|
|
106
|
-
)
|
|
107
|
-
), t.push(/* @__PURE__ */ i("slot", null)), t;
|
|
157
|
+
return this.loading && t.push(/* @__PURE__ */ d("div", { className: "loading", ref: (r) => {
|
|
158
|
+
this.loadingElement = r;
|
|
159
|
+
} }, "Loading...")), !this.loading && this.icon && this.icon !== "null" && t.push(/* @__PURE__ */ d("div", { className: "icon", "data-icon": this.icon, ref: (r) => {
|
|
160
|
+
this.iconElement = r;
|
|
161
|
+
} }, this.icon)), t.push(/* @__PURE__ */ d("slot", null)), t;
|
|
108
162
|
}
|
|
109
163
|
/**
|
|
110
164
|
* 组件连接到DOM后的初始化
|
|
@@ -121,43 +175,43 @@ class D extends (lt = y) {
|
|
|
121
175
|
/**
|
|
122
176
|
* 属性变化处理
|
|
123
177
|
*/
|
|
124
|
-
onAttributeChanged(t,
|
|
178
|
+
onAttributeChanged(t, r, b) {
|
|
125
179
|
switch (t) {
|
|
126
180
|
case "disabled":
|
|
127
|
-
this.disabled =
|
|
181
|
+
this.disabled = b !== null, this.updateButtonState();
|
|
128
182
|
break;
|
|
129
183
|
case "loading":
|
|
130
|
-
this.loading =
|
|
184
|
+
this.loading = b !== null, this.updateButtonState(), this.rerender();
|
|
131
185
|
break;
|
|
132
186
|
case "icon":
|
|
133
|
-
this.icon =
|
|
187
|
+
this.icon = b, this.rerender();
|
|
134
188
|
break;
|
|
135
189
|
case "href":
|
|
136
|
-
this.href =
|
|
190
|
+
this.href = b, this.rerender();
|
|
137
191
|
break;
|
|
138
192
|
case "type":
|
|
139
|
-
this.type =
|
|
193
|
+
this.type = b, this.updateButtonState();
|
|
140
194
|
break;
|
|
141
195
|
case "target":
|
|
142
|
-
this.target =
|
|
196
|
+
this.target = b || "_blank";
|
|
143
197
|
break;
|
|
144
198
|
case "rel":
|
|
145
|
-
this.rel =
|
|
199
|
+
this.rel = b;
|
|
146
200
|
break;
|
|
147
201
|
case "download":
|
|
148
|
-
this.download =
|
|
202
|
+
this.download = b;
|
|
149
203
|
break;
|
|
150
204
|
case "toggle":
|
|
151
|
-
this.toggle =
|
|
205
|
+
this.toggle = b !== null;
|
|
152
206
|
break;
|
|
153
207
|
case "checked":
|
|
154
|
-
this.checked =
|
|
208
|
+
this.checked = b !== null;
|
|
155
209
|
break;
|
|
156
210
|
case "variant":
|
|
157
|
-
this.variant =
|
|
211
|
+
this.variant = b || "flat";
|
|
158
212
|
break;
|
|
159
213
|
case "size":
|
|
160
|
-
this.size =
|
|
214
|
+
this.size = b || "md";
|
|
161
215
|
break;
|
|
162
216
|
}
|
|
163
217
|
}
|
|
@@ -202,44 +256,156 @@ class D extends (lt = y) {
|
|
|
202
256
|
t ? this.setAttr("icon", t) : this.removeAttr("icon");
|
|
203
257
|
}
|
|
204
258
|
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
const
|
|
209
|
-
var
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
259
|
+
vt = re;
|
|
260
|
+
[ee, xt] = Vt(vt, [], kt, 0, void 0, J).c;
|
|
261
|
+
xt();
|
|
262
|
+
const oe = ':host{display:inline-flex}::slotted(xy-button:not(:first-of-type):not(:last-of-type)){border-radius:0}::slotted(xy-button){margin:0!important}::slotted(xy-button:not(:first-of-type)){margin-left:-1px!important}::slotted(xy-button[type]:not([type="dashed"]):not(:first-of-type)){margin-left:1px!important}::slotted(xy-button:first-of-type){border-top-right-radius:0;border-bottom-right-radius:0}::slotted(xy-button:last-of-type){border-top-left-radius:0;border-bottom-left-radius:0}';
|
|
263
|
+
var wt;
|
|
264
|
+
let St, Et;
|
|
265
|
+
function ht(e, t, r) {
|
|
266
|
+
return (t = Tt(t)) in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
|
|
267
|
+
}
|
|
268
|
+
function ie(e, t, r, b, B, L) {
|
|
269
|
+
function E(o, a, c) {
|
|
270
|
+
return function(n, s) {
|
|
271
|
+
return c && c(n), o[a].call(n, s);
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
function P(o, a) {
|
|
275
|
+
for (var c = 0; c < o.length; c++) o[c].call(a);
|
|
276
|
+
return a;
|
|
277
|
+
}
|
|
278
|
+
function S(o, a, c, n) {
|
|
279
|
+
if (typeof o != "function" && (n || o !== void 0)) throw new TypeError(a + " must " + (c || "be") + " a function" + (n ? "" : " or undefined"));
|
|
280
|
+
return o;
|
|
281
|
+
}
|
|
282
|
+
function N(o, a, c, n, s, z, A, T, O, y, g, f, p) {
|
|
283
|
+
function v(l) {
|
|
284
|
+
if (!p(l)) throw new TypeError("Attempted to access private element on non-instance");
|
|
285
|
+
}
|
|
286
|
+
var u, x = a[0], k = a[3], _ = !T;
|
|
287
|
+
if (!_) {
|
|
288
|
+
c || Array.isArray(x) || (x = [x]);
|
|
289
|
+
var i = {}, C = [], m = s === 3 ? "get" : s === 4 || f ? "set" : "value";
|
|
290
|
+
y ? (g || f ? i = { get: dt(function() {
|
|
291
|
+
return k(this);
|
|
292
|
+
}, n, "get"), set: function(l) {
|
|
293
|
+
a[4](this, l);
|
|
294
|
+
} } : i[m] = k, g || dt(i[m], n, s === 2 ? "" : m)) : g || (i = Object.getOwnPropertyDescriptor(o, n));
|
|
295
|
+
}
|
|
296
|
+
for (var h = o, I = x.length - 1; I >= 0; I -= c ? 2 : 1) {
|
|
297
|
+
var G = x[I], K = c ? x[I - 1] : void 0, W = {}, $ = { kind: ["field", "accessor", "method", "getter", "setter", "class"][s], name: n, metadata: z, addInitializer: (function(l, w) {
|
|
298
|
+
if (l.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
299
|
+
S(w, "An initializer", "be", !0), A.push(w);
|
|
300
|
+
}).bind(null, W) };
|
|
301
|
+
try {
|
|
302
|
+
if (_) (u = S(G.call(K, h, $), "class decorators", "return")) && (h = u);
|
|
303
|
+
else {
|
|
304
|
+
var D, R;
|
|
305
|
+
$.static = O, $.private = y, y ? s === 2 ? D = function(l) {
|
|
306
|
+
return v(l), i.value;
|
|
307
|
+
} : (s < 4 && (D = E(i, "get", v)), s !== 3 && (R = E(i, "set", v))) : (D = function(l) {
|
|
308
|
+
return l[n];
|
|
309
|
+
}, (s < 2 || s === 4) && (R = function(l, w) {
|
|
310
|
+
l[n] = w;
|
|
311
|
+
}));
|
|
312
|
+
var X = $.access = { has: y ? p.bind() : function(l) {
|
|
313
|
+
return n in l;
|
|
314
|
+
} };
|
|
315
|
+
if (D && (X.get = D), R && (X.set = R), h = G.call(K, f ? { get: i.get, set: i.set } : i[m], $), f) {
|
|
316
|
+
if (typeof h == "object" && h) (u = S(h.get, "accessor.get")) && (i.get = u), (u = S(h.set, "accessor.set")) && (i.set = u), (u = S(h.init, "accessor.init")) && C.push(u);
|
|
317
|
+
else if (h !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
318
|
+
} else S(h, (g ? "field" : "method") + " decorators", "return") && (g ? C.push(h) : i[m] = h);
|
|
319
|
+
}
|
|
320
|
+
} finally {
|
|
321
|
+
W.v = !0;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
return (g || f) && T.push(function(l, w) {
|
|
325
|
+
for (var M = C.length - 1; M >= 0; M--) w = C[M].call(l, w);
|
|
326
|
+
return w;
|
|
327
|
+
}), g || _ || (y ? f ? T.push(E(i, "get"), E(i, "set")) : T.push(s === 2 ? i[m] : E.call.bind(i[m])) : Object.defineProperty(o, n, i)), h;
|
|
328
|
+
}
|
|
329
|
+
function H(o, a) {
|
|
330
|
+
return Object.defineProperty(o, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: a });
|
|
331
|
+
}
|
|
332
|
+
if (arguments.length >= 6) var F = L[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
333
|
+
var j = Object.create(F ?? null), U = function(o, a, c, n) {
|
|
334
|
+
var s, z, A = [], T = function(m) {
|
|
335
|
+
return se(m) === o;
|
|
336
|
+
}, O = /* @__PURE__ */ new Map();
|
|
337
|
+
function y(m) {
|
|
338
|
+
m && A.push(P.bind(null, m));
|
|
339
|
+
}
|
|
340
|
+
for (var g = 0; g < a.length; g++) {
|
|
341
|
+
var f = a[g];
|
|
342
|
+
if (Array.isArray(f)) {
|
|
343
|
+
var p = f[1], v = f[2], u = f.length > 3, x = 16 & p, k = !!(8 & p), _ = (p &= 7) == 0, i = v + "/" + k;
|
|
344
|
+
if (!_ && !u) {
|
|
345
|
+
var C = O.get(i);
|
|
346
|
+
if (C === !0 || C === 3 && p !== 4 || C === 4 && p !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + v);
|
|
347
|
+
O.set(i, !(p > 2) || p);
|
|
348
|
+
}
|
|
349
|
+
N(k ? o : o.prototype, f, x, u ? "#" + v : Tt(v), p, n, k ? z = z || [] : s = s || [], A, k, u, _, p === 1, k && u ? T : c);
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
return y(s), y(z), A;
|
|
353
|
+
}(e, t, B, j);
|
|
354
|
+
return r.length || H(e, j), { e: U, get c() {
|
|
355
|
+
var o = [];
|
|
356
|
+
return r.length && [H(N(e, [r], b, e.name, 5, j, o), j), P.bind(null, o, e)];
|
|
357
|
+
} };
|
|
358
|
+
}
|
|
359
|
+
function Tt(e) {
|
|
360
|
+
var t = ne(e, "string");
|
|
361
|
+
return typeof t == "symbol" ? t : t + "";
|
|
362
|
+
}
|
|
363
|
+
function ne(e, t) {
|
|
364
|
+
if (typeof e != "object" || !e) return e;
|
|
365
|
+
var r = e[Symbol.toPrimitive];
|
|
366
|
+
if (r !== void 0) {
|
|
367
|
+
var b = r.call(e, t);
|
|
368
|
+
if (typeof b != "object") return b;
|
|
369
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
370
|
+
}
|
|
371
|
+
return String(e);
|
|
372
|
+
}
|
|
373
|
+
function dt(e, t, r) {
|
|
374
|
+
typeof t == "symbol" && (t = (t = t.description) ? "[" + t + "]" : "");
|
|
375
|
+
try {
|
|
376
|
+
Object.defineProperty(e, "name", { configurable: !0, value: r ? r + " " + t : t });
|
|
377
|
+
} catch {
|
|
378
|
+
}
|
|
379
|
+
return e;
|
|
380
|
+
}
|
|
381
|
+
function se(e) {
|
|
382
|
+
if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (e !== null ? typeof e : "null"));
|
|
383
|
+
return e;
|
|
384
|
+
}
|
|
385
|
+
Et = [V({
|
|
386
|
+
tagName: "xy-button-group"
|
|
387
|
+
})];
|
|
388
|
+
let ae;
|
|
389
|
+
class le extends J {
|
|
390
|
+
static get observedAttributes() {
|
|
391
|
+
return ["disabled"];
|
|
392
|
+
}
|
|
223
393
|
constructor(t = {}) {
|
|
224
394
|
super({
|
|
225
|
-
styles: ae,
|
|
226
395
|
styleName: "xy-button-group",
|
|
227
396
|
...t
|
|
228
|
-
}),
|
|
229
|
-
}
|
|
230
|
-
static get observedAttributes() {
|
|
231
|
-
return ["disabled"];
|
|
397
|
+
}), ht(this, "_autoStyles", oe), ht(this, "disabled", !1), this.disabled = t.disabled || !1;
|
|
232
398
|
}
|
|
233
399
|
render() {
|
|
234
|
-
return /* @__PURE__ */
|
|
400
|
+
return /* @__PURE__ */ d("div", { class: "button-group-container" }, /* @__PURE__ */ d("slot", null));
|
|
235
401
|
}
|
|
236
402
|
/**
|
|
237
403
|
* 属性变化处理
|
|
238
404
|
*/
|
|
239
|
-
onAttributeChanged(t,
|
|
405
|
+
onAttributeChanged(t, r, b) {
|
|
240
406
|
switch (t) {
|
|
241
407
|
case "disabled":
|
|
242
|
-
this.disabled =
|
|
408
|
+
this.disabled = b !== null, this.updateChildrenDisabledState();
|
|
243
409
|
break;
|
|
244
410
|
}
|
|
245
411
|
}
|
|
@@ -254,8 +420,8 @@ class T extends (mt = y) {
|
|
|
254
420
|
*/
|
|
255
421
|
updateChildrenDisabledState() {
|
|
256
422
|
if (!this.disabled) return;
|
|
257
|
-
this.querySelectorAll("xy-button").forEach((
|
|
258
|
-
this.disabled ?
|
|
423
|
+
this.querySelectorAll("xy-button").forEach((r) => {
|
|
424
|
+
this.disabled ? r.setAttribute("disabled", "") : r.removeAttribute("disabled");
|
|
259
425
|
});
|
|
260
426
|
}
|
|
261
427
|
/**
|
|
@@ -277,221 +443,281 @@ class T extends (mt = y) {
|
|
|
277
443
|
* 公共API:启用所有按钮
|
|
278
444
|
*/
|
|
279
445
|
enableAll() {
|
|
280
|
-
this.getButtons().forEach((
|
|
281
|
-
|
|
446
|
+
this.getButtons().forEach((r) => {
|
|
447
|
+
r.removeAttribute("disabled");
|
|
282
448
|
});
|
|
283
449
|
}
|
|
284
450
|
/**
|
|
285
451
|
* 公共API:禁用所有按钮
|
|
286
452
|
*/
|
|
287
453
|
disableAll() {
|
|
288
|
-
this.getButtons().forEach((
|
|
289
|
-
|
|
454
|
+
this.getButtons().forEach((r) => {
|
|
455
|
+
r.setAttribute("disabled", "");
|
|
290
456
|
});
|
|
291
457
|
}
|
|
292
458
|
}
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
const
|
|
297
|
-
function
|
|
459
|
+
wt = le;
|
|
460
|
+
[ae, St] = ie(wt, [], Et, 0, void 0, J).c;
|
|
461
|
+
St();
|
|
462
|
+
const it = "editor-js-text-color-cache";
|
|
463
|
+
function ce(e) {
|
|
298
464
|
return e.startsWith("var(") && e.endsWith(")");
|
|
299
465
|
}
|
|
300
|
-
function
|
|
466
|
+
function ue(e) {
|
|
301
467
|
return e.slice(4, -1).trim();
|
|
302
468
|
}
|
|
303
|
-
function
|
|
469
|
+
function he(e) {
|
|
304
470
|
return getComputedStyle(document.documentElement).getPropertyValue(e).trim() || e;
|
|
305
471
|
}
|
|
306
|
-
function
|
|
307
|
-
if (
|
|
308
|
-
const t =
|
|
309
|
-
return
|
|
472
|
+
function rt(e) {
|
|
473
|
+
if (ce(e)) {
|
|
474
|
+
const t = ue(e);
|
|
475
|
+
return he(t);
|
|
310
476
|
}
|
|
311
477
|
return e;
|
|
312
478
|
}
|
|
313
|
-
function
|
|
314
|
-
return sessionStorage.setItem(`${
|
|
479
|
+
function de(e, t) {
|
|
480
|
+
return sessionStorage.setItem(`${it}-${t}`, JSON.stringify(e)), e;
|
|
315
481
|
}
|
|
316
|
-
function
|
|
317
|
-
sessionStorage.setItem(`${
|
|
482
|
+
function fe(e, t) {
|
|
483
|
+
sessionStorage.setItem(`${it}-${t}-custom`, JSON.stringify(e));
|
|
318
484
|
}
|
|
319
|
-
function
|
|
320
|
-
const t = sessionStorage.getItem(`${
|
|
485
|
+
function pe(e) {
|
|
486
|
+
const t = sessionStorage.getItem(`${it}-${e}-custom`);
|
|
321
487
|
return t ? JSON.parse(t) : null;
|
|
322
488
|
}
|
|
323
|
-
function
|
|
324
|
-
let
|
|
325
|
-
return (...
|
|
326
|
-
|
|
327
|
-
e(...
|
|
489
|
+
function me(e, t) {
|
|
490
|
+
let r = null;
|
|
491
|
+
return (...b) => {
|
|
492
|
+
r || (r = setTimeout(() => {
|
|
493
|
+
e(...b), r = null;
|
|
328
494
|
}, t));
|
|
329
495
|
};
|
|
330
496
|
}
|
|
331
|
-
function
|
|
332
|
-
const
|
|
333
|
-
return
|
|
334
|
-
}
|
|
335
|
-
const
|
|
336
|
-
var
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
];
|
|
368
|
-
|
|
369
|
-
|
|
497
|
+
function Ve(e, t) {
|
|
498
|
+
const r = sessionStorage.getItem(`${it}-${t}`);
|
|
499
|
+
return r ? JSON.parse(r) : e;
|
|
500
|
+
}
|
|
501
|
+
const Ze = "ce-inline-toolbar__dropdown", tr = "ce-conversion-toolbar--showed", be = '.color-section{display:inline-block;position:relative}.color-popover{display:inline-block;position:relative;overflow:visible}.color-btn{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;border:1px solid #e1e5e9;border-radius:3px;background:var(--theme-color, #000);color:transparent;cursor:pointer;transition:all .2s ease;box-sizing:border-box}.color-btn:hover:not(.disabled){border-color:#3f51b5;box-shadow:0 2px 8px #3f51b54d}.color-btn.disabled{opacity:.5;cursor:not-allowed}.color-indicator{font-size:12px;line-height:1;-webkit-user-select:none;user-select:none}.color-panel{position:absolute;top:100%;left:0;z-index:10000;background:#fff;border:1px solid #e1e5e9;border-radius:6px;box-shadow:0 4px 20px #00000026;padding:8px;margin-top:4px;box-sizing:border-box;transform-origin:top left;animation:colorPanelShow .2s ease-out}@keyframes colorPanelShow{0%{opacity:0;transform:scale(.9) translateY(-4px)}to{opacity:1;transform:scale(1) translateY(0)}}.color-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:4px;min-width:160px}.color-cube{width:20px;height:20px;border:1px solid #e1e5e9;border-radius:3px;cursor:pointer;transition:all .2s ease;box-sizing:border-box;background-color:var(--cube-color, #000)}.color-cube:hover{border-color:#3f51b5;transform:scale(1.1);box-shadow:0 2px 8px #3f51b566;z-index:1}.color-cube:active{transform:scale(.95)}.color-cube.custom-picker{background:linear-gradient(45deg,red,#ff8000,#ff0,#80ff00 42%,#0f0 57%,#00ff80,#0ff 85%,#0080ff);position:relative}.color-cube.custom-picker:after{content:"+";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);color:#fff;font-size:12px;font-weight:700;text-shadow:0 0 2px rgba(0,0,0,.8);pointer-events:none}:host([disabled]) .color-btn{opacity:.5;cursor:not-allowed}:host([open]) .color-panel{display:block}:host(:not([open])) .color-panel{display:none}@media (max-width: 768px){.color-panel{position:fixed;top:auto;left:50%;bottom:10px;transform:translate(-50%);width:90vw;max-width:300px}.color-grid{grid-template-columns:repeat(8,1fr);gap:6px}.color-cube{width:24px;height:24px}}@media (prefers-color-scheme: dark){.color-panel{background:#2d2d2d;border-color:#404040;color:#fff}.color-btn,.color-cube{border-color:#404040}}';
|
|
502
|
+
var _t;
|
|
503
|
+
let zt, At;
|
|
504
|
+
function q(e, t, r) {
|
|
505
|
+
return (t = $t(t)) in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
|
|
506
|
+
}
|
|
507
|
+
function ge(e, t, r, b, B, L) {
|
|
508
|
+
function E(o, a, c) {
|
|
509
|
+
return function(n, s) {
|
|
510
|
+
return c && c(n), o[a].call(n, s);
|
|
511
|
+
};
|
|
512
|
+
}
|
|
513
|
+
function P(o, a) {
|
|
514
|
+
for (var c = 0; c < o.length; c++) o[c].call(a);
|
|
515
|
+
return a;
|
|
516
|
+
}
|
|
517
|
+
function S(o, a, c, n) {
|
|
518
|
+
if (typeof o != "function" && (n || o !== void 0)) throw new TypeError(a + " must " + (c || "be") + " a function" + (n ? "" : " or undefined"));
|
|
519
|
+
return o;
|
|
520
|
+
}
|
|
521
|
+
function N(o, a, c, n, s, z, A, T, O, y, g, f, p) {
|
|
522
|
+
function v(l) {
|
|
523
|
+
if (!p(l)) throw new TypeError("Attempted to access private element on non-instance");
|
|
524
|
+
}
|
|
525
|
+
var u, x = a[0], k = a[3], _ = !T;
|
|
526
|
+
if (!_) {
|
|
527
|
+
c || Array.isArray(x) || (x = [x]);
|
|
528
|
+
var i = {}, C = [], m = s === 3 ? "get" : s === 4 || f ? "set" : "value";
|
|
529
|
+
y ? (g || f ? i = { get: ft(function() {
|
|
530
|
+
return k(this);
|
|
531
|
+
}, n, "get"), set: function(l) {
|
|
532
|
+
a[4](this, l);
|
|
533
|
+
} } : i[m] = k, g || ft(i[m], n, s === 2 ? "" : m)) : g || (i = Object.getOwnPropertyDescriptor(o, n));
|
|
534
|
+
}
|
|
535
|
+
for (var h = o, I = x.length - 1; I >= 0; I -= c ? 2 : 1) {
|
|
536
|
+
var G = x[I], K = c ? x[I - 1] : void 0, W = {}, $ = { kind: ["field", "accessor", "method", "getter", "setter", "class"][s], name: n, metadata: z, addInitializer: (function(l, w) {
|
|
537
|
+
if (l.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
538
|
+
S(w, "An initializer", "be", !0), A.push(w);
|
|
539
|
+
}).bind(null, W) };
|
|
540
|
+
try {
|
|
541
|
+
if (_) (u = S(G.call(K, h, $), "class decorators", "return")) && (h = u);
|
|
542
|
+
else {
|
|
543
|
+
var D, R;
|
|
544
|
+
$.static = O, $.private = y, y ? s === 2 ? D = function(l) {
|
|
545
|
+
return v(l), i.value;
|
|
546
|
+
} : (s < 4 && (D = E(i, "get", v)), s !== 3 && (R = E(i, "set", v))) : (D = function(l) {
|
|
547
|
+
return l[n];
|
|
548
|
+
}, (s < 2 || s === 4) && (R = function(l, w) {
|
|
549
|
+
l[n] = w;
|
|
550
|
+
}));
|
|
551
|
+
var X = $.access = { has: y ? p.bind() : function(l) {
|
|
552
|
+
return n in l;
|
|
553
|
+
} };
|
|
554
|
+
if (D && (X.get = D), R && (X.set = R), h = G.call(K, f ? { get: i.get, set: i.set } : i[m], $), f) {
|
|
555
|
+
if (typeof h == "object" && h) (u = S(h.get, "accessor.get")) && (i.get = u), (u = S(h.set, "accessor.set")) && (i.set = u), (u = S(h.init, "accessor.init")) && C.push(u);
|
|
556
|
+
else if (h !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
557
|
+
} else S(h, (g ? "field" : "method") + " decorators", "return") && (g ? C.push(h) : i[m] = h);
|
|
558
|
+
}
|
|
559
|
+
} finally {
|
|
560
|
+
W.v = !0;
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
return (g || f) && T.push(function(l, w) {
|
|
564
|
+
for (var M = C.length - 1; M >= 0; M--) w = C[M].call(l, w);
|
|
565
|
+
return w;
|
|
566
|
+
}), g || _ || (y ? f ? T.push(E(i, "get"), E(i, "set")) : T.push(s === 2 ? i[m] : E.call.bind(i[m])) : Object.defineProperty(o, n, i)), h;
|
|
567
|
+
}
|
|
568
|
+
function H(o, a) {
|
|
569
|
+
return Object.defineProperty(o, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: a });
|
|
570
|
+
}
|
|
571
|
+
if (arguments.length >= 6) var F = L[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
572
|
+
var j = Object.create(F ?? null), U = function(o, a, c, n) {
|
|
573
|
+
var s, z, A = [], T = function(m) {
|
|
574
|
+
return ve(m) === o;
|
|
575
|
+
}, O = /* @__PURE__ */ new Map();
|
|
576
|
+
function y(m) {
|
|
577
|
+
m && A.push(P.bind(null, m));
|
|
578
|
+
}
|
|
579
|
+
for (var g = 0; g < a.length; g++) {
|
|
580
|
+
var f = a[g];
|
|
581
|
+
if (Array.isArray(f)) {
|
|
582
|
+
var p = f[1], v = f[2], u = f.length > 3, x = 16 & p, k = !!(8 & p), _ = (p &= 7) == 0, i = v + "/" + k;
|
|
583
|
+
if (!_ && !u) {
|
|
584
|
+
var C = O.get(i);
|
|
585
|
+
if (C === !0 || C === 3 && p !== 4 || C === 4 && p !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + v);
|
|
586
|
+
O.set(i, !(p > 2) || p);
|
|
587
|
+
}
|
|
588
|
+
N(k ? o : o.prototype, f, x, u ? "#" + v : $t(v), p, n, k ? z = z || [] : s = s || [], A, k, u, _, p === 1, k && u ? T : c);
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
return y(s), y(z), A;
|
|
592
|
+
}(e, t, B, j);
|
|
593
|
+
return r.length || H(e, j), { e: U, get c() {
|
|
594
|
+
var o = [];
|
|
595
|
+
return r.length && [H(N(e, [r], b, e.name, 5, j, o), j), P.bind(null, o, e)];
|
|
596
|
+
} };
|
|
597
|
+
}
|
|
598
|
+
function $t(e) {
|
|
599
|
+
var t = ye(e, "string");
|
|
600
|
+
return typeof t == "symbol" ? t : t + "";
|
|
601
|
+
}
|
|
602
|
+
function ye(e, t) {
|
|
603
|
+
if (typeof e != "object" || !e) return e;
|
|
604
|
+
var r = e[Symbol.toPrimitive];
|
|
605
|
+
if (r !== void 0) {
|
|
606
|
+
var b = r.call(e, t);
|
|
607
|
+
if (typeof b != "object") return b;
|
|
608
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
609
|
+
}
|
|
610
|
+
return String(e);
|
|
611
|
+
}
|
|
612
|
+
function ft(e, t, r) {
|
|
613
|
+
typeof t == "symbol" && (t = (t = t.description) ? "[" + t + "]" : "");
|
|
614
|
+
try {
|
|
615
|
+
Object.defineProperty(e, "name", { configurable: !0, value: r ? r + " " + t : t });
|
|
616
|
+
} catch {
|
|
617
|
+
}
|
|
618
|
+
return e;
|
|
619
|
+
}
|
|
620
|
+
function ve(e) {
|
|
621
|
+
if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (e !== null ? typeof e : "null"));
|
|
622
|
+
return e;
|
|
623
|
+
}
|
|
624
|
+
const tt = et("ColorPicker"), xe = ["#ff1300", "#EC7878", "#9C27B0", "#673AB7", "#3F51B5", "#0070FF", "#03A9F4", "#00BCD4", "#4CAF50", "#8BC34A", "#CDDC39", "#FFE500", "#FFBF00", "#FF9800", "#795548", "#9E9E9E", "#5A5A5A", "#FFF"];
|
|
625
|
+
At = [V({
|
|
626
|
+
tagName: "color-picker"
|
|
627
|
+
})];
|
|
628
|
+
let ke;
|
|
629
|
+
class Ce extends J {
|
|
630
|
+
static get observedAttributes() {
|
|
631
|
+
return ["disabled", "selected-color", "open"];
|
|
632
|
+
}
|
|
370
633
|
constructor(t = {}) {
|
|
371
634
|
super({
|
|
372
|
-
styles: ve,
|
|
373
635
|
styleName: "base-color-picker",
|
|
374
636
|
...t
|
|
375
|
-
}),
|
|
376
|
-
|
|
377
|
-
}),
|
|
378
|
-
|
|
379
|
-
}),
|
|
380
|
-
var
|
|
381
|
-
const
|
|
382
|
-
this.setSelectedColor(
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
),
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
637
|
+
}), q(this, "_autoStyles", be), q(this, "colorCollections", void 0), q(this, "onColorPicked", void 0), q(this, "hasCustomPicker", void 0), q(this, "defaultColor", void 0), q(this, "pluginType", void 0), q(this, "disabled", void 0), q(this, "selectedColor", void 0), q(this, "customColor", void 0), q(this, "isOpen", void 0), q(this, "colorBtn", void 0), q(this, "colorPanel", void 0), q(this, "handleButtonClick", (r) => {
|
|
638
|
+
r.stopPropagation(), this.togglePanel();
|
|
639
|
+
}), q(this, "handlePanelClick", (r) => {
|
|
640
|
+
r.stopPropagation();
|
|
641
|
+
}), q(this, "handleColorSelect", (r) => {
|
|
642
|
+
var B;
|
|
643
|
+
const b = rt(r);
|
|
644
|
+
this.setSelectedColor(b), this.closePanel(), de(b, this.pluginType), (B = this.onColorPicked) == null || B.call(this, b), this.dispatchEvent(new CustomEvent("colorchange", {
|
|
645
|
+
detail: {
|
|
646
|
+
color: b
|
|
647
|
+
},
|
|
648
|
+
bubbles: !0,
|
|
649
|
+
composed: !0
|
|
650
|
+
})), tt.debug("Color selected", {
|
|
651
|
+
color: b
|
|
652
|
+
});
|
|
653
|
+
}), q(this, "handleCustomPickerClick", () => {
|
|
654
|
+
const r = document.createElement("input");
|
|
655
|
+
r.type = "color", r.value = this.customColor, r.style.cssText = `
|
|
392
656
|
position: fixed;
|
|
393
657
|
left: -9999px;
|
|
394
658
|
opacity: 0;
|
|
395
659
|
pointer-events: none;
|
|
396
660
|
`;
|
|
397
|
-
const
|
|
398
|
-
var
|
|
399
|
-
const
|
|
400
|
-
this.setSelectedColor(
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
),
|
|
661
|
+
const b = me((B) => {
|
|
662
|
+
var P;
|
|
663
|
+
const L = B.target, E = rt(L.value);
|
|
664
|
+
this.setSelectedColor(E), this.setCustomColor(E), document.body.removeChild(r), (P = this.onColorPicked) == null || P.call(this, E), this.dispatchEvent(new CustomEvent("colorchange", {
|
|
665
|
+
detail: {
|
|
666
|
+
color: E
|
|
667
|
+
},
|
|
668
|
+
bubbles: !0,
|
|
669
|
+
composed: !0
|
|
670
|
+
})), tt.debug("Custom color selected", {
|
|
671
|
+
color: E
|
|
672
|
+
});
|
|
407
673
|
}, 30);
|
|
408
|
-
|
|
409
|
-
|
|
674
|
+
r.addEventListener("input", b), document.body.appendChild(r), requestAnimationFrame(() => {
|
|
675
|
+
r.focus(), r.click();
|
|
410
676
|
});
|
|
411
|
-
}),
|
|
412
|
-
this.isOpen && !this.contains(
|
|
413
|
-
}), this.colorCollections = t.colorCollections ||
|
|
677
|
+
}), q(this, "handleDocumentClick", (r) => {
|
|
678
|
+
this.isOpen && !this.contains(r.target) && this.closePanel();
|
|
679
|
+
}), this.colorCollections = t.colorCollections || xe, this.onColorPicked = t.onColorPicked, this.hasCustomPicker = t.hasCustomPicker || !1, this.pluginType = t.pluginType || "text", this.disabled = t.disabled || !1, this.defaultColor = rt(t.defaultColor || this.colorCollections[0]), this.selectedColor = this.defaultColor, this.customColor = pe(this.pluginType) || "", this.isOpen = !1, tt.debug("ColorPicker initialized", {
|
|
414
680
|
colorCollections: this.colorCollections.length,
|
|
415
681
|
hasCustomPicker: this.hasCustomPicker,
|
|
416
682
|
pluginType: this.pluginType
|
|
417
683
|
});
|
|
418
684
|
}
|
|
419
|
-
static get observedAttributes() {
|
|
420
|
-
return ["disabled", "selected-color", "open"];
|
|
421
|
-
}
|
|
422
685
|
/**
|
|
423
686
|
* 实现抽象方法:真正的JSX渲染!🎉
|
|
424
687
|
*/
|
|
425
688
|
render() {
|
|
426
|
-
const t = this.renderColorButton(),
|
|
427
|
-
return /* @__PURE__ */
|
|
689
|
+
const t = this.renderColorButton(), r = this.isOpen ? this.renderColorPanel() : null;
|
|
690
|
+
return /* @__PURE__ */ d("section", { class: "color-section" }, /* @__PURE__ */ d("div", { class: "color-popover" }, t, r));
|
|
428
691
|
}
|
|
429
692
|
/**
|
|
430
693
|
* 渲染颜色按钮 - 真正的JSX!
|
|
431
694
|
*/
|
|
432
695
|
renderColorButton() {
|
|
433
|
-
return /* @__PURE__ */
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
type: "button",
|
|
437
|
-
class: `color-btn ${this.disabled ? "disabled" : ""}`,
|
|
438
|
-
style: `--theme-color: ${this.selectedColor}`,
|
|
439
|
-
disabled: this.disabled,
|
|
440
|
-
onClick: this.handleButtonClick,
|
|
441
|
-
ref: (t) => {
|
|
442
|
-
this.colorBtn = t;
|
|
443
|
-
}
|
|
444
|
-
},
|
|
445
|
-
/* @__PURE__ */ i("span", { class: "color-indicator" }, "_")
|
|
446
|
-
);
|
|
696
|
+
return /* @__PURE__ */ d("xy-button", { type: "button", class: `color-btn ${this.disabled ? "disabled" : ""}`, style: `--theme-color: ${this.selectedColor}`, disabled: this.disabled, onClick: this.handleButtonClick, ref: (t) => {
|
|
697
|
+
this.colorBtn = t;
|
|
698
|
+
} }, /* @__PURE__ */ d("span", { class: "color-indicator" }, "_"));
|
|
447
699
|
}
|
|
448
700
|
/**
|
|
449
701
|
* 渲染颜色面板 - 真正的JSX!
|
|
450
702
|
*/
|
|
451
703
|
renderColorPanel() {
|
|
452
|
-
return /* @__PURE__ */
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
class: "color-panel",
|
|
456
|
-
onClick: this.handlePanelClick,
|
|
457
|
-
ref: (t) => {
|
|
458
|
-
this.colorPanel = t;
|
|
459
|
-
}
|
|
460
|
-
},
|
|
461
|
-
/* @__PURE__ */ i("div", { class: "color-grid" }, this.hasCustomPicker ? this.renderCustomPicker() : null, this.renderColorButtons())
|
|
462
|
-
);
|
|
704
|
+
return /* @__PURE__ */ d("div", { class: "color-panel", onClick: this.handlePanelClick, ref: (t) => {
|
|
705
|
+
this.colorPanel = t;
|
|
706
|
+
} }, /* @__PURE__ */ d("div", { class: "color-grid" }, this.hasCustomPicker ? this.renderCustomPicker() : null, this.renderColorButtons()));
|
|
463
707
|
}
|
|
464
708
|
/**
|
|
465
709
|
* 渲染自定义颜色选择器 - 真正的JSX!
|
|
466
710
|
*/
|
|
467
711
|
renderCustomPicker() {
|
|
468
|
-
return /* @__PURE__ */
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
type: "button",
|
|
472
|
-
class: "color-cube custom-picker",
|
|
473
|
-
style: { backgroundColor: this.customColor },
|
|
474
|
-
onClick: this.handleCustomPickerClick,
|
|
475
|
-
title: "自定义颜色"
|
|
476
|
-
}
|
|
477
|
-
);
|
|
712
|
+
return /* @__PURE__ */ d("xy-button", { type: "button", class: "color-cube custom-picker", style: {
|
|
713
|
+
backgroundColor: this.customColor
|
|
714
|
+
}, onClick: this.handleCustomPickerClick, title: "自定义颜色" });
|
|
478
715
|
}
|
|
479
716
|
/**
|
|
480
717
|
* 渲染颜色按钮组 - 真正的JSX!
|
|
481
718
|
*/
|
|
482
719
|
renderColorButtons() {
|
|
483
|
-
return this.colorCollections.map((t) => /* @__PURE__ */
|
|
484
|
-
"xy-button",
|
|
485
|
-
{
|
|
486
|
-
key: t,
|
|
487
|
-
type: "button",
|
|
488
|
-
class: "color-cube",
|
|
489
|
-
style: `background-color: ${t}`,
|
|
490
|
-
"data-color": t,
|
|
491
|
-
title: t,
|
|
492
|
-
onClick: () => this.handleColorSelect(t)
|
|
493
|
-
}
|
|
494
|
-
));
|
|
720
|
+
return this.colorCollections.map((t) => /* @__PURE__ */ d("xy-button", { key: t, type: "button", class: "color-cube", style: `background-color: ${t}`, "data-color": t, title: t, onClick: () => this.handleColorSelect(t) }));
|
|
495
721
|
}
|
|
496
722
|
/**
|
|
497
723
|
* 切换面板显示状态
|
|
@@ -515,7 +741,7 @@ class O extends (_t = y) {
|
|
|
515
741
|
* 设置自定义颜色
|
|
516
742
|
*/
|
|
517
743
|
setCustomColor(t) {
|
|
518
|
-
this.customColor = t,
|
|
744
|
+
this.customColor = t, fe(t, this.pluginType);
|
|
519
745
|
}
|
|
520
746
|
/**
|
|
521
747
|
* 设置面板开关状态
|
|
@@ -533,27 +759,27 @@ class O extends (_t = y) {
|
|
|
533
759
|
* 组件连接到DOM后的初始化
|
|
534
760
|
*/
|
|
535
761
|
onConnected() {
|
|
536
|
-
document.addEventListener("click", this.handleDocumentClick),
|
|
762
|
+
document.addEventListener("click", this.handleDocumentClick), tt.info("ColorPicker connected to DOM");
|
|
537
763
|
}
|
|
538
764
|
/**
|
|
539
765
|
* 组件从DOM断开时的清理
|
|
540
766
|
*/
|
|
541
767
|
onDisconnected() {
|
|
542
|
-
document.removeEventListener("click", this.handleDocumentClick),
|
|
768
|
+
document.removeEventListener("click", this.handleDocumentClick), tt.info("ColorPicker disconnected from DOM");
|
|
543
769
|
}
|
|
544
770
|
/**
|
|
545
771
|
* 属性变化处理
|
|
546
772
|
*/
|
|
547
|
-
onAttributeChanged(t,
|
|
773
|
+
onAttributeChanged(t, r, b) {
|
|
548
774
|
switch (t) {
|
|
549
775
|
case "disabled":
|
|
550
|
-
this.disabled =
|
|
776
|
+
this.disabled = b !== null, this.rerender();
|
|
551
777
|
break;
|
|
552
778
|
case "selected-color":
|
|
553
|
-
|
|
779
|
+
b && b !== this.selectedColor && (this.selectedColor = b, this.updateColorButton());
|
|
554
780
|
break;
|
|
555
781
|
case "open":
|
|
556
|
-
this.isOpen =
|
|
782
|
+
this.isOpen = b !== null;
|
|
557
783
|
break;
|
|
558
784
|
}
|
|
559
785
|
}
|
|
@@ -567,7 +793,7 @@ class O extends (_t = y) {
|
|
|
567
793
|
* 公共API:设置颜色
|
|
568
794
|
*/
|
|
569
795
|
setColor(t) {
|
|
570
|
-
this.setSelectedColor(
|
|
796
|
+
this.setSelectedColor(rt(t));
|
|
571
797
|
}
|
|
572
798
|
/**
|
|
573
799
|
* 公共API:聚焦组件
|
|
@@ -577,119 +803,178 @@ class O extends (_t = y) {
|
|
|
577
803
|
(t = this.colorBtn) == null || t.focus();
|
|
578
804
|
}
|
|
579
805
|
}
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
const
|
|
584
|
-
var
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
806
|
+
_t = Ce;
|
|
807
|
+
[ke, zt] = ge(_t, [], At, 0, void 0, J).c;
|
|
808
|
+
zt();
|
|
809
|
+
const we = ".reactive-counter{max-width:500px;margin:20px auto;padding:24px;border-radius:12px;box-shadow:0 4px 12px #0000001a;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;transition:all .3s ease}.theme-light{background:#fff;color:#333;border:1px solid #e1e5e9}.theme-dark{background:#1a1a1a;color:#fff;border:1px solid #333333}.theme-blue{background:linear-gradient(135deg,#667eea,#764ba2);color:#fff;border:1px solid #5a67d8}.header{text-align:center;margin-bottom:24px}.header h3{margin:0 0 8px;font-size:24px;font-weight:600}.subtitle{margin:0;opacity:.8;font-size:14px}.counter-display{text-align:center;margin-bottom:32px}.count-value{font-size:48px;font-weight:700;line-height:1;margin-bottom:8px;font-variant-numeric:tabular-nums}.step-info{font-size:14px;opacity:.7}.controls{display:flex;gap:12px;justify-content:center;margin-bottom:24px;flex-wrap:wrap}.btn{padding:10px 20px;border:none;border-radius:8px;font-size:16px;font-weight:500;cursor:pointer;transition:all .2s ease;min-width:60px}.btn:disabled{opacity:.5;cursor:not-allowed}.btn-primary{background:#4299e1;color:#fff}.btn-primary:hover:not(:disabled){background:#3182ce;transform:translateY(-1px)}.btn-secondary{background:#718096;color:#fff}.btn-secondary:hover:not(:disabled){background:#4a5568;transform:translateY(-1px)}.btn-warning{background:#ed8936;color:#fff}.btn-warning:hover:not(:disabled){background:#dd6b20;transform:translateY(-1px)}.btn-success{background:#48bb78;color:#fff}.btn-success:hover:not(:disabled){background:#38a169;transform:translateY(-1px)}.btn-danger{background:#f56565;color:#fff}.btn-danger:hover:not(:disabled){background:#e53e3e;transform:translateY(-1px)}.btn-sm{padding:6px 12px;font-size:14px;min-width:auto}.step-controls,.auto-controls,.theme-controls,.message-controls{margin-bottom:20px;text-align:center}.step-controls label{display:flex;align-items:center;justify-content:center;gap:12px;font-size:14px}.step-controls input[type=range]{flex:0 0 150px}.step-controls span{font-weight:700;min-width:20px}.theme-controls select,.message-controls input{padding:8px 12px;border:1px solid #cbd5e0;border-radius:6px;font-size:14px;margin-left:8px}.theme-dark .theme-controls select,.theme-dark .message-controls input{background:#2d3748;border-color:#4a5568;color:#fff}.theme-blue .theme-controls select,.theme-blue .message-controls input{background:#ffffff1a;border-color:#fff3;color:#fff}.message-controls input{width:250px;max-width:100%}.history{margin-top:24px;padding:16px;background:#0000000d;border-radius:8px}.theme-dark .history{background:#ffffff0d}.theme-blue .history{background:#ffffff1a}.history h4{margin:0 0 12px;font-size:16px}.history-list{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:12px}.history-item{padding:4px 8px;background:#4299e11a;border:1px solid rgba(66,153,225,.2);border-radius:4px;font-size:12px;font-weight:500}.debug-info{margin-top:24px;font-size:12px}.debug-info details{border:1px solid #e2e8f0;border-radius:6px;padding:8px}.theme-dark .debug-info details{border-color:#4a5568}.theme-blue .debug-info details{border-color:#fff3}.debug-info summary{cursor:pointer;font-weight:500;margin-bottom:8px}.debug-info pre{margin:0;padding:8px;background:#0000000d;border-radius:4px;overflow-x:auto;font-size:11px;line-height:1.4}.theme-dark .debug-info pre{background:#ffffff0d}.theme-blue .debug-info pre{background:#ffffff1a}@media (max-width: 600px){.reactive-counter{margin:10px;padding:16px}.count-value{font-size:36px}.controls{flex-direction:column;align-items:center}.btn{width:200px}.step-controls label{flex-direction:column;gap:8px}.message-controls input{width:100%}}";
|
|
810
|
+
var Dt;
|
|
811
|
+
let jt, Ot;
|
|
812
|
+
function Q(e, t, r) {
|
|
813
|
+
return (t = It(t)) in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
|
|
814
|
+
}
|
|
815
|
+
function Se(e, t, r, b, B, L) {
|
|
816
|
+
function E(o, a, c) {
|
|
817
|
+
return function(n, s) {
|
|
818
|
+
return c && c(n), o[a].call(n, s);
|
|
819
|
+
};
|
|
820
|
+
}
|
|
821
|
+
function P(o, a) {
|
|
822
|
+
for (var c = 0; c < o.length; c++) o[c].call(a);
|
|
823
|
+
return a;
|
|
824
|
+
}
|
|
825
|
+
function S(o, a, c, n) {
|
|
826
|
+
if (typeof o != "function" && (n || o !== void 0)) throw new TypeError(a + " must " + (c || "be") + " a function" + (n ? "" : " or undefined"));
|
|
827
|
+
return o;
|
|
828
|
+
}
|
|
829
|
+
function N(o, a, c, n, s, z, A, T, O, y, g, f, p) {
|
|
830
|
+
function v(l) {
|
|
831
|
+
if (!p(l)) throw new TypeError("Attempted to access private element on non-instance");
|
|
832
|
+
}
|
|
833
|
+
var u, x = a[0], k = a[3], _ = !T;
|
|
834
|
+
if (!_) {
|
|
835
|
+
c || Array.isArray(x) || (x = [x]);
|
|
836
|
+
var i = {}, C = [], m = s === 3 ? "get" : s === 4 || f ? "set" : "value";
|
|
837
|
+
y ? (g || f ? i = { get: pt(function() {
|
|
838
|
+
return k(this);
|
|
839
|
+
}, n, "get"), set: function(l) {
|
|
840
|
+
a[4](this, l);
|
|
841
|
+
} } : i[m] = k, g || pt(i[m], n, s === 2 ? "" : m)) : g || (i = Object.getOwnPropertyDescriptor(o, n));
|
|
842
|
+
}
|
|
843
|
+
for (var h = o, I = x.length - 1; I >= 0; I -= c ? 2 : 1) {
|
|
844
|
+
var G = x[I], K = c ? x[I - 1] : void 0, W = {}, $ = { kind: ["field", "accessor", "method", "getter", "setter", "class"][s], name: n, metadata: z, addInitializer: (function(l, w) {
|
|
845
|
+
if (l.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
846
|
+
S(w, "An initializer", "be", !0), A.push(w);
|
|
847
|
+
}).bind(null, W) };
|
|
848
|
+
try {
|
|
849
|
+
if (_) (u = S(G.call(K, h, $), "class decorators", "return")) && (h = u);
|
|
850
|
+
else {
|
|
851
|
+
var D, R;
|
|
852
|
+
$.static = O, $.private = y, y ? s === 2 ? D = function(l) {
|
|
853
|
+
return v(l), i.value;
|
|
854
|
+
} : (s < 4 && (D = E(i, "get", v)), s !== 3 && (R = E(i, "set", v))) : (D = function(l) {
|
|
855
|
+
return l[n];
|
|
856
|
+
}, (s < 2 || s === 4) && (R = function(l, w) {
|
|
857
|
+
l[n] = w;
|
|
858
|
+
}));
|
|
859
|
+
var X = $.access = { has: y ? p.bind() : function(l) {
|
|
860
|
+
return n in l;
|
|
861
|
+
} };
|
|
862
|
+
if (D && (X.get = D), R && (X.set = R), h = G.call(K, f ? { get: i.get, set: i.set } : i[m], $), f) {
|
|
863
|
+
if (typeof h == "object" && h) (u = S(h.get, "accessor.get")) && (i.get = u), (u = S(h.set, "accessor.set")) && (i.set = u), (u = S(h.init, "accessor.init")) && C.push(u);
|
|
864
|
+
else if (h !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
865
|
+
} else S(h, (g ? "field" : "method") + " decorators", "return") && (g ? C.push(h) : i[m] = h);
|
|
866
|
+
}
|
|
867
|
+
} finally {
|
|
868
|
+
W.v = !0;
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
return (g || f) && T.push(function(l, w) {
|
|
872
|
+
for (var M = C.length - 1; M >= 0; M--) w = C[M].call(l, w);
|
|
873
|
+
return w;
|
|
874
|
+
}), g || _ || (y ? f ? T.push(E(i, "get"), E(i, "set")) : T.push(s === 2 ? i[m] : E.call.bind(i[m])) : Object.defineProperty(o, n, i)), h;
|
|
875
|
+
}
|
|
876
|
+
function H(o, a) {
|
|
877
|
+
return Object.defineProperty(o, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: a });
|
|
878
|
+
}
|
|
879
|
+
if (arguments.length >= 6) var F = L[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
880
|
+
var j = Object.create(F ?? null), U = function(o, a, c, n) {
|
|
881
|
+
var s, z, A = [], T = function(m) {
|
|
882
|
+
return Te(m) === o;
|
|
883
|
+
}, O = /* @__PURE__ */ new Map();
|
|
884
|
+
function y(m) {
|
|
885
|
+
m && A.push(P.bind(null, m));
|
|
886
|
+
}
|
|
887
|
+
for (var g = 0; g < a.length; g++) {
|
|
888
|
+
var f = a[g];
|
|
889
|
+
if (Array.isArray(f)) {
|
|
890
|
+
var p = f[1], v = f[2], u = f.length > 3, x = 16 & p, k = !!(8 & p), _ = (p &= 7) == 0, i = v + "/" + k;
|
|
891
|
+
if (!_ && !u) {
|
|
892
|
+
var C = O.get(i);
|
|
893
|
+
if (C === !0 || C === 3 && p !== 4 || C === 4 && p !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + v);
|
|
894
|
+
O.set(i, !(p > 2) || p);
|
|
895
|
+
}
|
|
896
|
+
N(k ? o : o.prototype, f, x, u ? "#" + v : It(v), p, n, k ? z = z || [] : s = s || [], A, k, u, _, p === 1, k && u ? T : c);
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
return y(s), y(z), A;
|
|
900
|
+
}(e, t, B, j);
|
|
901
|
+
return r.length || H(e, j), { e: U, get c() {
|
|
902
|
+
var o = [];
|
|
903
|
+
return r.length && [H(N(e, [r], b, e.name, 5, j, o), j), P.bind(null, o, e)];
|
|
904
|
+
} };
|
|
905
|
+
}
|
|
906
|
+
function It(e) {
|
|
907
|
+
var t = Ee(e, "string");
|
|
908
|
+
return typeof t == "symbol" ? t : t + "";
|
|
909
|
+
}
|
|
910
|
+
function Ee(e, t) {
|
|
911
|
+
if (typeof e != "object" || !e) return e;
|
|
912
|
+
var r = e[Symbol.toPrimitive];
|
|
913
|
+
if (r !== void 0) {
|
|
914
|
+
var b = r.call(e, t);
|
|
915
|
+
if (typeof b != "object") return b;
|
|
916
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
917
|
+
}
|
|
918
|
+
return String(e);
|
|
919
|
+
}
|
|
920
|
+
function pt(e, t, r) {
|
|
921
|
+
typeof t == "symbol" && (t = (t = t.description) ? "[" + t + "]" : "");
|
|
922
|
+
try {
|
|
923
|
+
Object.defineProperty(e, "name", { configurable: !0, value: r ? r + " " + t : t });
|
|
924
|
+
} catch {
|
|
925
|
+
}
|
|
926
|
+
return e;
|
|
927
|
+
}
|
|
928
|
+
function Te(e) {
|
|
929
|
+
if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (e !== null ? typeof e : "null"));
|
|
930
|
+
return e;
|
|
931
|
+
}
|
|
932
|
+
const nt = et("ReactiveCounter");
|
|
933
|
+
Ot = [V({
|
|
934
|
+
tagName: "reactive-counter"
|
|
935
|
+
})];
|
|
936
|
+
let _e;
|
|
937
|
+
class ze extends J {
|
|
599
938
|
constructor() {
|
|
600
|
-
super({
|
|
601
|
-
styles: Be,
|
|
602
|
-
debug: !0
|
|
603
|
-
// 启用调试模式
|
|
604
|
-
}), v(this, "state", this.reactive({
|
|
605
|
-
count: 0,
|
|
606
|
-
step: 1,
|
|
607
|
-
message: "Hello WSX Reactive!",
|
|
608
|
-
isRunning: !1
|
|
609
|
-
})), v(this, "themeState", this.useState("theme", "light")), v(this, "historyState", this.useState("history", [])), v(this, "getTheme", this.themeState[0]), v(this, "setTheme", this.themeState[1]), v(this, "getHistory", this.historyState[0]), v(this, "setHistory", this.historyState[1]), v(this, "increment", () => {
|
|
939
|
+
super(), Q(this, "_autoStyles", we), Q(this, "state", void 0), Q(this, "theme", void 0), Q(this, "history", void 0), Q(this, "increment", () => {
|
|
610
940
|
this.state.count += this.state.step, this.addToHistory(this.state.count);
|
|
611
|
-
}),
|
|
941
|
+
}), Q(this, "decrement", () => {
|
|
612
942
|
this.state.count -= this.state.step, this.addToHistory(this.state.count);
|
|
613
|
-
}),
|
|
943
|
+
}), Q(this, "reset", () => {
|
|
614
944
|
this.state.count = 0, this.addToHistory(0);
|
|
615
|
-
}),
|
|
616
|
-
const
|
|
617
|
-
this.state.step = parseInt(
|
|
618
|
-
}),
|
|
619
|
-
const
|
|
620
|
-
this.
|
|
621
|
-
}),
|
|
622
|
-
const
|
|
623
|
-
this.state.message =
|
|
624
|
-
}),
|
|
945
|
+
}), Q(this, "handleStepChange", (b) => {
|
|
946
|
+
const B = b.target;
|
|
947
|
+
this.state.step = parseInt(B.value);
|
|
948
|
+
}), Q(this, "handleThemeChange", (b) => {
|
|
949
|
+
const B = b.target;
|
|
950
|
+
this.theme = B.value;
|
|
951
|
+
}), Q(this, "handleMessageChange", (b) => {
|
|
952
|
+
const B = b.target;
|
|
953
|
+
this.state.message = B.value;
|
|
954
|
+
}), Q(this, "toggleAutoIncrement", () => {
|
|
625
955
|
this.state.isRunning = !this.state.isRunning, this.state.isRunning && this.startAutoIncrement();
|
|
626
|
-
}),
|
|
627
|
-
this.
|
|
628
|
-
}),
|
|
956
|
+
}), Q(this, "clearHistory", () => {
|
|
957
|
+
this.history = [];
|
|
958
|
+
}), nt.info("ReactiveCounter initialized"), this.state = this.reactive({
|
|
959
|
+
count: 0,
|
|
960
|
+
step: 1,
|
|
961
|
+
message: "Hello WSX Reactive!",
|
|
962
|
+
isRunning: !1
|
|
963
|
+
});
|
|
964
|
+
const [t, r] = this.useState("theme", "light");
|
|
965
|
+
Object.defineProperty(this, "theme", {
|
|
966
|
+
get: t,
|
|
967
|
+
set: r,
|
|
968
|
+
enumerable: !0,
|
|
969
|
+
configurable: !0
|
|
970
|
+
}), this.history = this.reactive([]);
|
|
629
971
|
}
|
|
630
972
|
render() {
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
onClick: this.increment,
|
|
637
|
-
disabled: this.state.isRunning
|
|
638
|
-
},
|
|
639
|
-
"+",
|
|
640
|
-
this.state.step
|
|
641
|
-
), /* @__PURE__ */ i(
|
|
642
|
-
"button",
|
|
643
|
-
{
|
|
644
|
-
class: "btn btn-secondary",
|
|
645
|
-
onClick: this.decrement,
|
|
646
|
-
disabled: this.state.isRunning
|
|
647
|
-
},
|
|
648
|
-
"-",
|
|
649
|
-
this.state.step
|
|
650
|
-
), /* @__PURE__ */ i(
|
|
651
|
-
"button",
|
|
652
|
-
{
|
|
653
|
-
class: "btn btn-warning",
|
|
654
|
-
onClick: this.reset,
|
|
655
|
-
disabled: this.state.isRunning
|
|
656
|
-
},
|
|
657
|
-
"Reset"
|
|
658
|
-
)), /* @__PURE__ */ i("div", { class: "step-controls" }, /* @__PURE__ */ i("label", null, "Step Size:", /* @__PURE__ */ i(
|
|
659
|
-
"input",
|
|
660
|
-
{
|
|
661
|
-
type: "range",
|
|
662
|
-
min: "1",
|
|
663
|
-
max: "10",
|
|
664
|
-
value: this.state.step,
|
|
665
|
-
onInput: this.handleStepChange
|
|
666
|
-
}
|
|
667
|
-
), /* @__PURE__ */ i("span", null, this.state.step))), /* @__PURE__ */ i("div", { class: "auto-controls" }, /* @__PURE__ */ i(
|
|
668
|
-
"button",
|
|
669
|
-
{
|
|
670
|
-
class: `btn ${this.state.isRunning ? "btn-danger" : "btn-success"}`,
|
|
671
|
-
onClick: this.toggleAutoIncrement
|
|
672
|
-
},
|
|
673
|
-
this.state.isRunning ? "Stop" : "Start",
|
|
674
|
-
" Auto Increment"
|
|
675
|
-
)), /* @__PURE__ */ i("div", { class: "theme-controls" }, /* @__PURE__ */ i("label", null, "Theme:", /* @__PURE__ */ i("select", { value: t, onChange: this.handleThemeChange }, /* @__PURE__ */ i("option", { value: "light" }, "Light"), /* @__PURE__ */ i("option", { value: "dark" }, "Dark"), /* @__PURE__ */ i("option", { value: "blue" }, "Blue")))), /* @__PURE__ */ i("div", { class: "message-controls" }, /* @__PURE__ */ i(
|
|
676
|
-
"input",
|
|
677
|
-
{
|
|
678
|
-
type: "text",
|
|
679
|
-
value: this.state.message,
|
|
680
|
-
onInput: this.handleMessageChange,
|
|
681
|
-
placeholder: "Enter a message..."
|
|
682
|
-
}
|
|
683
|
-
)), o.length > 0 && /* @__PURE__ */ i("div", { class: "history" }, /* @__PURE__ */ i("h4", null, "History (last 10):"), /* @__PURE__ */ i("div", { class: "history-list" }, o.slice(-10).map((s, r) => /* @__PURE__ */ i("span", { key: r, class: "history-item" }, s))), /* @__PURE__ */ i("button", { class: "btn btn-sm", onClick: this.clearHistory }, "Clear History")), /* @__PURE__ */ i("div", { class: "debug-info" }, /* @__PURE__ */ i("details", null, /* @__PURE__ */ i("summary", null, "Debug Info"), /* @__PURE__ */ i("pre", null, JSON.stringify(
|
|
684
|
-
{
|
|
685
|
-
state: this.state,
|
|
686
|
-
theme: this.getTheme(),
|
|
687
|
-
historyLength: this.getHistory().length,
|
|
688
|
-
stateSnapshot: this.getStateSnapshot()
|
|
689
|
-
},
|
|
690
|
-
null,
|
|
691
|
-
2
|
|
692
|
-
)))));
|
|
973
|
+
return /* @__PURE__ */ d("div", { class: `reactive-counter theme-${this.theme}` }, /* @__PURE__ */ d("div", { class: "header" }, /* @__PURE__ */ d("h3", null, "🔄 Reactive Counter"), /* @__PURE__ */ d("p", { class: "subtitle" }, this.state.message)), /* @__PURE__ */ d("div", { class: "counter-display" }, /* @__PURE__ */ d("div", { class: "count-value" }, this.state.count), /* @__PURE__ */ d("div", { class: "step-info" }, "Step: ", this.state.step)), /* @__PURE__ */ d("div", { class: "controls" }, /* @__PURE__ */ d("button", { class: "btn btn-primary", onClick: this.increment, disabled: this.state.isRunning }, "+", this.state.step), /* @__PURE__ */ d("button", { class: "btn btn-secondary", onClick: this.decrement, disabled: this.state.isRunning }, "-", this.state.step), /* @__PURE__ */ d("button", { class: "btn btn-warning", onClick: this.reset, disabled: this.state.isRunning }, "Reset")), /* @__PURE__ */ d("div", { class: "step-controls" }, /* @__PURE__ */ d("label", null, "Step Size:", /* @__PURE__ */ d("input", { type: "range", min: "1", max: "10", value: this.state.step, onInput: this.handleStepChange }), /* @__PURE__ */ d("span", null, this.state.step))), /* @__PURE__ */ d("div", { class: "auto-controls" }, /* @__PURE__ */ d("button", { class: `btn ${this.state.isRunning ? "btn-danger" : "btn-success"}`, onClick: this.toggleAutoIncrement }, this.state.isRunning ? "Stop" : "Start", " Auto Increment")), /* @__PURE__ */ d("div", { class: "theme-controls" }, /* @__PURE__ */ d("label", null, "Theme:", /* @__PURE__ */ d("select", { value: this.theme, onChange: this.handleThemeChange }, /* @__PURE__ */ d("option", { value: "light" }, "Light"), /* @__PURE__ */ d("option", { value: "dark" }, "Dark"), /* @__PURE__ */ d("option", { value: "blue" }, "Blue")))), /* @__PURE__ */ d("div", { class: "message-controls" }, /* @__PURE__ */ d("input", { type: "text", value: this.state.message, onInput: this.handleMessageChange, placeholder: "Enter a message..." })), this.history.length > 0 && /* @__PURE__ */ d("div", { class: "history" }, /* @__PURE__ */ d("h4", null, "History (last 10):"), /* @__PURE__ */ d("div", { class: "history-list" }, this.history.slice(-10).map((t, r) => /* @__PURE__ */ d("span", { key: r, class: "history-item" }, t))), /* @__PURE__ */ d("button", { class: "btn btn-sm", onClick: this.clearHistory }, "Clear History")), /* @__PURE__ */ d("div", { class: "debug-info" }, /* @__PURE__ */ d("details", null, /* @__PURE__ */ d("summary", null, "Debug Info"), /* @__PURE__ */ d("pre", null, JSON.stringify({
|
|
974
|
+
state: this.state,
|
|
975
|
+
theme: this.theme,
|
|
976
|
+
historyLength: this.history.length
|
|
977
|
+
}, null, 2)))));
|
|
693
978
|
}
|
|
694
979
|
startAutoIncrement() {
|
|
695
980
|
const t = setInterval(() => {
|
|
@@ -701,60 +986,162 @@ class I extends (St = ot) {
|
|
|
701
986
|
}, 200);
|
|
702
987
|
}
|
|
703
988
|
addToHistory(t) {
|
|
704
|
-
|
|
705
|
-
this.setHistory([...o, t]);
|
|
989
|
+
this.history = [...this.history, t];
|
|
706
990
|
}
|
|
707
991
|
onConnected() {
|
|
708
|
-
|
|
992
|
+
nt.info("ReactiveCounter connected to DOM"), setTimeout(() => {
|
|
709
993
|
this.state.message = "Ready to count! 🚀";
|
|
710
994
|
}, 500);
|
|
711
995
|
}
|
|
712
996
|
onDisconnected() {
|
|
713
|
-
|
|
714
|
-
}
|
|
715
|
-
}
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
const
|
|
720
|
-
var
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
997
|
+
nt.info("ReactiveCounter disconnected from DOM"), this.state.isRunning = !1;
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
Dt = ze;
|
|
1001
|
+
[_e, jt] = Se(Dt, [], Ot, 0, void 0, J).c;
|
|
1002
|
+
jt();
|
|
1003
|
+
const Ae = ":host{display:block}.theme-switcher-container{position:relative;display:flex;align-items:center}.theme-switcher-btn{width:var(--theme-switcher-width, 2.5rem);height:var(--theme-switcher-height, 2.5rem);padding:var(--theme-switcher-padding, .5rem);border-radius:var(--theme-switcher-border-radius, 8px);background:var(--theme-switcher-bg, #dc2626);border:var(--theme-switcher-border, none);color:var(--theme-switcher-color, white);cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all var(--theme-switcher-transition, .3s ease);box-shadow:var(--theme-switcher-shadow, 0 4px 15px rgba(220, 38, 38, .4));font-weight:var(--theme-switcher-font-weight, 600);font-family:var(--theme-switcher-font-family, inherit)}.theme-switcher-btn:hover{background:var(--theme-switcher-hover-bg, #b91c1c);transform:var(--theme-switcher-hover-transform, translateY(-2px));box-shadow:var(--theme-switcher-hover-shadow, 0 8px 25px rgba(220, 38, 38, .5))}.theme-switcher-btn:active{transform:var(--theme-switcher-active-transform, translateY(0))}.theme-switcher-icon{font-size:var(--theme-switcher-icon-size, 1rem);line-height:1;transition:transform var(--theme-switcher-icon-transition, .3s ease)}.theme-switcher-btn:hover .theme-switcher-icon{transform:var(--theme-switcher-icon-hover-transform, rotate(360deg))}.theme-switcher-btn[data-theme=light]{background:var(--theme-switcher-light-bg, #dc2626);color:var(--theme-switcher-light-color, white)}.theme-switcher-btn[data-theme=light]:hover{background:var(--theme-switcher-light-hover-bg, #b91c1c)}.theme-switcher-btn[data-theme=dark]{background:var(--theme-switcher-dark-bg, #dc2626);color:var(--theme-switcher-dark-color, white)}.theme-switcher-btn[data-theme=dark]:hover{background:var(--theme-switcher-dark-hover-bg, #b91c1c)}.theme-switcher-btn[data-theme=auto]{background:var(--theme-switcher-auto-bg, linear-gradient(135deg, #dc2626, #b91c1c));color:var(--theme-switcher-auto-color, white)}.theme-switcher-btn[data-theme=auto]:hover{background:var(--theme-switcher-auto-hover-bg, linear-gradient(135deg, #b91c1c, #991b1b))}@media (max-width: 768px){.theme-switcher-btn{width:var(--theme-switcher-mobile-width, 2rem);height:var(--theme-switcher-mobile-height, 2rem)}.theme-switcher-icon{font-size:var(--theme-switcher-mobile-icon-size, .9rem)}}";
|
|
1004
|
+
var Rt;
|
|
1005
|
+
let Bt, Mt;
|
|
1006
|
+
function st(e, t, r) {
|
|
1007
|
+
return (t = Pt(t)) in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
|
|
1008
|
+
}
|
|
1009
|
+
function $e(e, t, r, b, B, L) {
|
|
1010
|
+
function E(o, a, c) {
|
|
1011
|
+
return function(n, s) {
|
|
1012
|
+
return c && c(n), o[a].call(n, s);
|
|
1013
|
+
};
|
|
1014
|
+
}
|
|
1015
|
+
function P(o, a) {
|
|
1016
|
+
for (var c = 0; c < o.length; c++) o[c].call(a);
|
|
1017
|
+
return a;
|
|
1018
|
+
}
|
|
1019
|
+
function S(o, a, c, n) {
|
|
1020
|
+
if (typeof o != "function" && (n || o !== void 0)) throw new TypeError(a + " must " + (c || "be") + " a function" + (n ? "" : " or undefined"));
|
|
1021
|
+
return o;
|
|
1022
|
+
}
|
|
1023
|
+
function N(o, a, c, n, s, z, A, T, O, y, g, f, p) {
|
|
1024
|
+
function v(l) {
|
|
1025
|
+
if (!p(l)) throw new TypeError("Attempted to access private element on non-instance");
|
|
1026
|
+
}
|
|
1027
|
+
var u, x = a[0], k = a[3], _ = !T;
|
|
1028
|
+
if (!_) {
|
|
1029
|
+
c || Array.isArray(x) || (x = [x]);
|
|
1030
|
+
var i = {}, C = [], m = s === 3 ? "get" : s === 4 || f ? "set" : "value";
|
|
1031
|
+
y ? (g || f ? i = { get: mt(function() {
|
|
1032
|
+
return k(this);
|
|
1033
|
+
}, n, "get"), set: function(l) {
|
|
1034
|
+
a[4](this, l);
|
|
1035
|
+
} } : i[m] = k, g || mt(i[m], n, s === 2 ? "" : m)) : g || (i = Object.getOwnPropertyDescriptor(o, n));
|
|
1036
|
+
}
|
|
1037
|
+
for (var h = o, I = x.length - 1; I >= 0; I -= c ? 2 : 1) {
|
|
1038
|
+
var G = x[I], K = c ? x[I - 1] : void 0, W = {}, $ = { kind: ["field", "accessor", "method", "getter", "setter", "class"][s], name: n, metadata: z, addInitializer: (function(l, w) {
|
|
1039
|
+
if (l.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
1040
|
+
S(w, "An initializer", "be", !0), A.push(w);
|
|
1041
|
+
}).bind(null, W) };
|
|
1042
|
+
try {
|
|
1043
|
+
if (_) (u = S(G.call(K, h, $), "class decorators", "return")) && (h = u);
|
|
1044
|
+
else {
|
|
1045
|
+
var D, R;
|
|
1046
|
+
$.static = O, $.private = y, y ? s === 2 ? D = function(l) {
|
|
1047
|
+
return v(l), i.value;
|
|
1048
|
+
} : (s < 4 && (D = E(i, "get", v)), s !== 3 && (R = E(i, "set", v))) : (D = function(l) {
|
|
1049
|
+
return l[n];
|
|
1050
|
+
}, (s < 2 || s === 4) && (R = function(l, w) {
|
|
1051
|
+
l[n] = w;
|
|
1052
|
+
}));
|
|
1053
|
+
var X = $.access = { has: y ? p.bind() : function(l) {
|
|
1054
|
+
return n in l;
|
|
1055
|
+
} };
|
|
1056
|
+
if (D && (X.get = D), R && (X.set = R), h = G.call(K, f ? { get: i.get, set: i.set } : i[m], $), f) {
|
|
1057
|
+
if (typeof h == "object" && h) (u = S(h.get, "accessor.get")) && (i.get = u), (u = S(h.set, "accessor.set")) && (i.set = u), (u = S(h.init, "accessor.init")) && C.push(u);
|
|
1058
|
+
else if (h !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
1059
|
+
} else S(h, (g ? "field" : "method") + " decorators", "return") && (g ? C.push(h) : i[m] = h);
|
|
1060
|
+
}
|
|
1061
|
+
} finally {
|
|
1062
|
+
W.v = !0;
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
return (g || f) && T.push(function(l, w) {
|
|
1066
|
+
for (var M = C.length - 1; M >= 0; M--) w = C[M].call(l, w);
|
|
1067
|
+
return w;
|
|
1068
|
+
}), g || _ || (y ? f ? T.push(E(i, "get"), E(i, "set")) : T.push(s === 2 ? i[m] : E.call.bind(i[m])) : Object.defineProperty(o, n, i)), h;
|
|
1069
|
+
}
|
|
1070
|
+
function H(o, a) {
|
|
1071
|
+
return Object.defineProperty(o, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: a });
|
|
1072
|
+
}
|
|
1073
|
+
if (arguments.length >= 6) var F = L[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
1074
|
+
var j = Object.create(F ?? null), U = function(o, a, c, n) {
|
|
1075
|
+
var s, z, A = [], T = function(m) {
|
|
1076
|
+
return je(m) === o;
|
|
1077
|
+
}, O = /* @__PURE__ */ new Map();
|
|
1078
|
+
function y(m) {
|
|
1079
|
+
m && A.push(P.bind(null, m));
|
|
1080
|
+
}
|
|
1081
|
+
for (var g = 0; g < a.length; g++) {
|
|
1082
|
+
var f = a[g];
|
|
1083
|
+
if (Array.isArray(f)) {
|
|
1084
|
+
var p = f[1], v = f[2], u = f.length > 3, x = 16 & p, k = !!(8 & p), _ = (p &= 7) == 0, i = v + "/" + k;
|
|
1085
|
+
if (!_ && !u) {
|
|
1086
|
+
var C = O.get(i);
|
|
1087
|
+
if (C === !0 || C === 3 && p !== 4 || C === 4 && p !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + v);
|
|
1088
|
+
O.set(i, !(p > 2) || p);
|
|
1089
|
+
}
|
|
1090
|
+
N(k ? o : o.prototype, f, x, u ? "#" + v : Pt(v), p, n, k ? z = z || [] : s = s || [], A, k, u, _, p === 1, k && u ? T : c);
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
return y(s), y(z), A;
|
|
1094
|
+
}(e, t, B, j);
|
|
1095
|
+
return r.length || H(e, j), { e: U, get c() {
|
|
1096
|
+
var o = [];
|
|
1097
|
+
return r.length && [H(N(e, [r], b, e.name, 5, j, o), j), P.bind(null, o, e)];
|
|
1098
|
+
} };
|
|
1099
|
+
}
|
|
1100
|
+
function Pt(e) {
|
|
1101
|
+
var t = De(e, "string");
|
|
1102
|
+
return typeof t == "symbol" ? t : t + "";
|
|
1103
|
+
}
|
|
1104
|
+
function De(e, t) {
|
|
1105
|
+
if (typeof e != "object" || !e) return e;
|
|
1106
|
+
var r = e[Symbol.toPrimitive];
|
|
1107
|
+
if (r !== void 0) {
|
|
1108
|
+
var b = r.call(e, t);
|
|
1109
|
+
if (typeof b != "object") return b;
|
|
1110
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1111
|
+
}
|
|
1112
|
+
return String(e);
|
|
1113
|
+
}
|
|
1114
|
+
function mt(e, t, r) {
|
|
1115
|
+
typeof t == "symbol" && (t = (t = t.description) ? "[" + t + "]" : "");
|
|
1116
|
+
try {
|
|
1117
|
+
Object.defineProperty(e, "name", { configurable: !0, value: r ? r + " " + t : t });
|
|
1118
|
+
} catch {
|
|
1119
|
+
}
|
|
1120
|
+
return e;
|
|
1121
|
+
}
|
|
1122
|
+
function je(e) {
|
|
1123
|
+
if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (e !== null ? typeof e : "null"));
|
|
1124
|
+
return e;
|
|
1125
|
+
}
|
|
1126
|
+
Mt = [V({
|
|
1127
|
+
tagName: "theme-switcher"
|
|
1128
|
+
})];
|
|
1129
|
+
let Oe;
|
|
1130
|
+
class Ie extends J {
|
|
734
1131
|
constructor() {
|
|
735
1132
|
super({
|
|
736
|
-
styles: Xe,
|
|
737
1133
|
styleName: "theme-switcher"
|
|
738
|
-
}),
|
|
739
|
-
const t = ["auto", "light", "dark"],
|
|
740
|
-
this.setTheme(t[
|
|
1134
|
+
}), st(this, "_autoStyles", Ae), st(this, "currentTheme", "auto"), st(this, "toggleTheme", () => {
|
|
1135
|
+
const t = ["auto", "light", "dark"], b = (t.indexOf(this.currentTheme) + 1) % t.length;
|
|
1136
|
+
this.setTheme(t[b]);
|
|
741
1137
|
}), this.initTheme();
|
|
742
1138
|
}
|
|
743
1139
|
render() {
|
|
744
|
-
return /* @__PURE__ */
|
|
745
|
-
"button",
|
|
746
|
-
{
|
|
747
|
-
class: "theme-switcher-btn",
|
|
748
|
-
"data-theme": this.currentTheme,
|
|
749
|
-
onClick: this.toggleTheme,
|
|
750
|
-
title: `当前主题: ${this.getThemeLabel()}`
|
|
751
|
-
},
|
|
752
|
-
/* @__PURE__ */ i("span", { class: "theme-switcher-icon" }, this.getThemeIcon())
|
|
753
|
-
));
|
|
1140
|
+
return /* @__PURE__ */ d("div", { class: "theme-switcher-container" }, /* @__PURE__ */ d("button", { class: "theme-switcher-btn", "data-theme": this.currentTheme, onClick: this.toggleTheme, title: `当前主题: ${this.getThemeLabel()}` }, /* @__PURE__ */ d("span", { class: "theme-switcher-icon" }, this.getThemeIcon())));
|
|
754
1141
|
}
|
|
755
1142
|
getThemeIcon() {
|
|
756
|
-
const
|
|
757
|
-
return this.currentTheme === "auto" ?
|
|
1143
|
+
const r = document.documentElement.classList.contains("dark");
|
|
1144
|
+
return this.currentTheme === "auto" ? r ? "🌙" : "☀️" : this.currentTheme === "light" ? "☀️" : "🌙";
|
|
758
1145
|
}
|
|
759
1146
|
getThemeLabel() {
|
|
760
1147
|
return {
|
|
@@ -765,8 +1152,8 @@ class F extends (Tt = y) {
|
|
|
765
1152
|
}
|
|
766
1153
|
setTheme(t) {
|
|
767
1154
|
this.currentTheme = t;
|
|
768
|
-
const
|
|
769
|
-
t === "auto" ? (
|
|
1155
|
+
const r = document.documentElement;
|
|
1156
|
+
t === "auto" ? (r.removeAttribute("class"), this.checkSystemTheme()) : r.className = t, localStorage.setItem("wsx-theme", t), this.rerender();
|
|
770
1157
|
}
|
|
771
1158
|
checkSystemTheme() {
|
|
772
1159
|
const t = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
@@ -774,50 +1161,163 @@ class F extends (Tt = y) {
|
|
|
774
1161
|
}
|
|
775
1162
|
initTheme() {
|
|
776
1163
|
const t = localStorage.getItem("wsx-theme") || "auto";
|
|
777
|
-
this.setTheme(t), window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", (
|
|
778
|
-
this.currentTheme === "auto" && (document.documentElement.className =
|
|
1164
|
+
this.setTheme(t), window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", (r) => {
|
|
1165
|
+
this.currentTheme === "auto" && (document.documentElement.className = r.matches ? "dark" : "");
|
|
779
1166
|
});
|
|
780
1167
|
}
|
|
781
1168
|
}
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
var
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
1169
|
+
Rt = Ie;
|
|
1170
|
+
[Oe, Bt] = $e(Rt, [], Mt, 0, void 0, J).c;
|
|
1171
|
+
Bt();
|
|
1172
|
+
var Lt;
|
|
1173
|
+
let Nt, Ht;
|
|
1174
|
+
function at(e, t, r) {
|
|
1175
|
+
return (t = Ft(t)) in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
|
|
1176
|
+
}
|
|
1177
|
+
function Re(e, t, r, b, B, L) {
|
|
1178
|
+
function E(o, a, c) {
|
|
1179
|
+
return function(n, s) {
|
|
1180
|
+
return c && c(n), o[a].call(n, s);
|
|
1181
|
+
};
|
|
1182
|
+
}
|
|
1183
|
+
function P(o, a) {
|
|
1184
|
+
for (var c = 0; c < o.length; c++) o[c].call(a);
|
|
1185
|
+
return a;
|
|
1186
|
+
}
|
|
1187
|
+
function S(o, a, c, n) {
|
|
1188
|
+
if (typeof o != "function" && (n || o !== void 0)) throw new TypeError(a + " must " + (c || "be") + " a function" + (n ? "" : " or undefined"));
|
|
1189
|
+
return o;
|
|
1190
|
+
}
|
|
1191
|
+
function N(o, a, c, n, s, z, A, T, O, y, g, f, p) {
|
|
1192
|
+
function v(l) {
|
|
1193
|
+
if (!p(l)) throw new TypeError("Attempted to access private element on non-instance");
|
|
1194
|
+
}
|
|
1195
|
+
var u, x = a[0], k = a[3], _ = !T;
|
|
1196
|
+
if (!_) {
|
|
1197
|
+
c || Array.isArray(x) || (x = [x]);
|
|
1198
|
+
var i = {}, C = [], m = s === 3 ? "get" : s === 4 || f ? "set" : "value";
|
|
1199
|
+
y ? (g || f ? i = { get: bt(function() {
|
|
1200
|
+
return k(this);
|
|
1201
|
+
}, n, "get"), set: function(l) {
|
|
1202
|
+
a[4](this, l);
|
|
1203
|
+
} } : i[m] = k, g || bt(i[m], n, s === 2 ? "" : m)) : g || (i = Object.getOwnPropertyDescriptor(o, n));
|
|
1204
|
+
}
|
|
1205
|
+
for (var h = o, I = x.length - 1; I >= 0; I -= c ? 2 : 1) {
|
|
1206
|
+
var G = x[I], K = c ? x[I - 1] : void 0, W = {}, $ = { kind: ["field", "accessor", "method", "getter", "setter", "class"][s], name: n, metadata: z, addInitializer: (function(l, w) {
|
|
1207
|
+
if (l.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
1208
|
+
S(w, "An initializer", "be", !0), A.push(w);
|
|
1209
|
+
}).bind(null, W) };
|
|
1210
|
+
try {
|
|
1211
|
+
if (_) (u = S(G.call(K, h, $), "class decorators", "return")) && (h = u);
|
|
1212
|
+
else {
|
|
1213
|
+
var D, R;
|
|
1214
|
+
$.static = O, $.private = y, y ? s === 2 ? D = function(l) {
|
|
1215
|
+
return v(l), i.value;
|
|
1216
|
+
} : (s < 4 && (D = E(i, "get", v)), s !== 3 && (R = E(i, "set", v))) : (D = function(l) {
|
|
1217
|
+
return l[n];
|
|
1218
|
+
}, (s < 2 || s === 4) && (R = function(l, w) {
|
|
1219
|
+
l[n] = w;
|
|
1220
|
+
}));
|
|
1221
|
+
var X = $.access = { has: y ? p.bind() : function(l) {
|
|
1222
|
+
return n in l;
|
|
1223
|
+
} };
|
|
1224
|
+
if (D && (X.get = D), R && (X.set = R), h = G.call(K, f ? { get: i.get, set: i.set } : i[m], $), f) {
|
|
1225
|
+
if (typeof h == "object" && h) (u = S(h.get, "accessor.get")) && (i.get = u), (u = S(h.set, "accessor.set")) && (i.set = u), (u = S(h.init, "accessor.init")) && C.push(u);
|
|
1226
|
+
else if (h !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
1227
|
+
} else S(h, (g ? "field" : "method") + " decorators", "return") && (g ? C.push(h) : i[m] = h);
|
|
1228
|
+
}
|
|
1229
|
+
} finally {
|
|
1230
|
+
W.v = !0;
|
|
1231
|
+
}
|
|
1232
|
+
}
|
|
1233
|
+
return (g || f) && T.push(function(l, w) {
|
|
1234
|
+
for (var M = C.length - 1; M >= 0; M--) w = C[M].call(l, w);
|
|
1235
|
+
return w;
|
|
1236
|
+
}), g || _ || (y ? f ? T.push(E(i, "get"), E(i, "set")) : T.push(s === 2 ? i[m] : E.call.bind(i[m])) : Object.defineProperty(o, n, i)), h;
|
|
1237
|
+
}
|
|
1238
|
+
function H(o, a) {
|
|
1239
|
+
return Object.defineProperty(o, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: a });
|
|
1240
|
+
}
|
|
1241
|
+
if (arguments.length >= 6) var F = L[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
1242
|
+
var j = Object.create(F ?? null), U = function(o, a, c, n) {
|
|
1243
|
+
var s, z, A = [], T = function(m) {
|
|
1244
|
+
return Me(m) === o;
|
|
1245
|
+
}, O = /* @__PURE__ */ new Map();
|
|
1246
|
+
function y(m) {
|
|
1247
|
+
m && A.push(P.bind(null, m));
|
|
1248
|
+
}
|
|
1249
|
+
for (var g = 0; g < a.length; g++) {
|
|
1250
|
+
var f = a[g];
|
|
1251
|
+
if (Array.isArray(f)) {
|
|
1252
|
+
var p = f[1], v = f[2], u = f.length > 3, x = 16 & p, k = !!(8 & p), _ = (p &= 7) == 0, i = v + "/" + k;
|
|
1253
|
+
if (!_ && !u) {
|
|
1254
|
+
var C = O.get(i);
|
|
1255
|
+
if (C === !0 || C === 3 && p !== 4 || C === 4 && p !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + v);
|
|
1256
|
+
O.set(i, !(p > 2) || p);
|
|
1257
|
+
}
|
|
1258
|
+
N(k ? o : o.prototype, f, x, u ? "#" + v : Ft(v), p, n, k ? z = z || [] : s = s || [], A, k, u, _, p === 1, k && u ? T : c);
|
|
1259
|
+
}
|
|
1260
|
+
}
|
|
1261
|
+
return y(s), y(z), A;
|
|
1262
|
+
}(e, t, B, j);
|
|
1263
|
+
return r.length || H(e, j), { e: U, get c() {
|
|
1264
|
+
var o = [];
|
|
1265
|
+
return r.length && [H(N(e, [r], b, e.name, 5, j, o), j), P.bind(null, o, e)];
|
|
1266
|
+
} };
|
|
1267
|
+
}
|
|
1268
|
+
function Ft(e) {
|
|
1269
|
+
var t = Be(e, "string");
|
|
1270
|
+
return typeof t == "symbol" ? t : t + "";
|
|
1271
|
+
}
|
|
1272
|
+
function Be(e, t) {
|
|
1273
|
+
if (typeof e != "object" || !e) return e;
|
|
1274
|
+
var r = e[Symbol.toPrimitive];
|
|
1275
|
+
if (r !== void 0) {
|
|
1276
|
+
var b = r.call(e, t);
|
|
1277
|
+
if (typeof b != "object") return b;
|
|
1278
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1279
|
+
}
|
|
1280
|
+
return String(e);
|
|
1281
|
+
}
|
|
1282
|
+
function bt(e, t, r) {
|
|
1283
|
+
typeof t == "symbol" && (t = (t = t.description) ? "[" + t + "]" : "");
|
|
1284
|
+
try {
|
|
1285
|
+
Object.defineProperty(e, "name", { configurable: !0, value: r ? r + " " + t : t });
|
|
1286
|
+
} catch {
|
|
1287
|
+
}
|
|
1288
|
+
return e;
|
|
1289
|
+
}
|
|
1290
|
+
function Me(e) {
|
|
1291
|
+
if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (e !== null ? typeof e : "null"));
|
|
1292
|
+
return e;
|
|
1293
|
+
}
|
|
1294
|
+
const lt = et("SvgIcon");
|
|
1295
|
+
Ht = [V({
|
|
1296
|
+
tagName: "svg-icon"
|
|
1297
|
+
})];
|
|
1298
|
+
let Pe;
|
|
1299
|
+
class Le extends J {
|
|
800
1300
|
constructor() {
|
|
801
|
-
super(),
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
);
|
|
811
|
-
}),
|
|
812
|
-
const
|
|
813
|
-
|
|
814
|
-
}),
|
|
815
|
-
const
|
|
816
|
-
|
|
817
|
-
}),
|
|
1301
|
+
super(), at(this, "handleClick", (t) => {
|
|
1302
|
+
lt.debug("SVG icon clicked", {
|
|
1303
|
+
name: this.getAttribute("name")
|
|
1304
|
+
}), this.dispatchEvent(new CustomEvent("icon-click", {
|
|
1305
|
+
detail: {
|
|
1306
|
+
name: this.getAttribute("name"),
|
|
1307
|
+
originalEvent: t
|
|
1308
|
+
},
|
|
1309
|
+
bubbles: !0
|
|
1310
|
+
}));
|
|
1311
|
+
}), at(this, "handleMouseEnter", (t) => {
|
|
1312
|
+
const r = t.target;
|
|
1313
|
+
r.style.transform = "scale(1.1)";
|
|
1314
|
+
}), at(this, "handleMouseLeave", (t) => {
|
|
1315
|
+
const r = t.target;
|
|
1316
|
+
r.style.transform = "scale(1)";
|
|
1317
|
+
}), lt.info("SvgIcon component initialized");
|
|
818
1318
|
}
|
|
819
1319
|
render() {
|
|
820
|
-
const t = this.getAttribute("size") || "24",
|
|
1320
|
+
const t = this.getAttribute("size") || "24", r = this.getAttribute("color") || "currentColor", b = this.getAttribute("name") || "star", B = {
|
|
821
1321
|
star: "M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z",
|
|
822
1322
|
heart: "M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z",
|
|
823
1323
|
check: "M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z",
|
|
@@ -825,261 +1325,342 @@ class B extends (Rt = y) {
|
|
|
825
1325
|
github: "M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22",
|
|
826
1326
|
play: "M8 5v14l11-7z",
|
|
827
1327
|
settings: "M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1 1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"
|
|
828
|
-
},
|
|
829
|
-
return /* @__PURE__ */
|
|
830
|
-
"svg",
|
|
831
|
-
{
|
|
832
|
-
width: t,
|
|
833
|
-
height: t,
|
|
834
|
-
viewBox: "0 0 24 24",
|
|
835
|
-
fill: "none",
|
|
836
|
-
stroke: o,
|
|
837
|
-
strokeWidth: "2",
|
|
838
|
-
strokeLinecap: "round",
|
|
839
|
-
strokeLinejoin: "round",
|
|
840
|
-
className: "svg-icon",
|
|
841
|
-
onClick: this.handleClick,
|
|
842
|
-
style: "cursor: pointer; transition: transform 0.2s ease; display: inline-block;",
|
|
843
|
-
onMouseEnter: this.handleMouseEnter,
|
|
844
|
-
onMouseLeave: this.handleMouseLeave
|
|
845
|
-
},
|
|
846
|
-
/* @__PURE__ */ i("path", { d: n, fill: o })
|
|
847
|
-
);
|
|
1328
|
+
}, L = B[b] || B.star;
|
|
1329
|
+
return /* @__PURE__ */ d("svg", { width: t, height: t, viewBox: "0 0 24 24", fill: "none", stroke: r, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "svg-icon", onClick: this.handleClick, style: "cursor: pointer; transition: transform 0.2s ease; display: inline-block;", onMouseEnter: this.handleMouseEnter, onMouseLeave: this.handleMouseLeave }, /* @__PURE__ */ d("path", { d: L, fill: r }));
|
|
848
1330
|
}
|
|
849
1331
|
static get observedAttributes() {
|
|
850
1332
|
return ["name", "size", "color"];
|
|
851
1333
|
}
|
|
852
|
-
onAttributeChanged(t,
|
|
853
|
-
|
|
854
|
-
}
|
|
855
|
-
}
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
var
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
1334
|
+
onAttributeChanged(t, r, b) {
|
|
1335
|
+
lt.debug(`Attribute ${t} changed from ${r} to ${b}`), this.connected && this.rerender();
|
|
1336
|
+
}
|
|
1337
|
+
}
|
|
1338
|
+
Lt = Le;
|
|
1339
|
+
[Pe, Nt] = Re(Lt, [], Ht, 0, void 0, J).c;
|
|
1340
|
+
Nt();
|
|
1341
|
+
var Gt;
|
|
1342
|
+
let Kt, Wt;
|
|
1343
|
+
function Z(e, t, r) {
|
|
1344
|
+
return (t = Xt(t)) in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
|
|
1345
|
+
}
|
|
1346
|
+
function Ne(e, t, r, b, B, L) {
|
|
1347
|
+
function E(o, a, c) {
|
|
1348
|
+
return function(n, s) {
|
|
1349
|
+
return c && c(n), o[a].call(n, s);
|
|
1350
|
+
};
|
|
1351
|
+
}
|
|
1352
|
+
function P(o, a) {
|
|
1353
|
+
for (var c = 0; c < o.length; c++) o[c].call(a);
|
|
1354
|
+
return a;
|
|
1355
|
+
}
|
|
1356
|
+
function S(o, a, c, n) {
|
|
1357
|
+
if (typeof o != "function" && (n || o !== void 0)) throw new TypeError(a + " must " + (c || "be") + " a function" + (n ? "" : " or undefined"));
|
|
1358
|
+
return o;
|
|
1359
|
+
}
|
|
1360
|
+
function N(o, a, c, n, s, z, A, T, O, y, g, f, p) {
|
|
1361
|
+
function v(l) {
|
|
1362
|
+
if (!p(l)) throw new TypeError("Attempted to access private element on non-instance");
|
|
1363
|
+
}
|
|
1364
|
+
var u, x = a[0], k = a[3], _ = !T;
|
|
1365
|
+
if (!_) {
|
|
1366
|
+
c || Array.isArray(x) || (x = [x]);
|
|
1367
|
+
var i = {}, C = [], m = s === 3 ? "get" : s === 4 || f ? "set" : "value";
|
|
1368
|
+
y ? (g || f ? i = { get: gt(function() {
|
|
1369
|
+
return k(this);
|
|
1370
|
+
}, n, "get"), set: function(l) {
|
|
1371
|
+
a[4](this, l);
|
|
1372
|
+
} } : i[m] = k, g || gt(i[m], n, s === 2 ? "" : m)) : g || (i = Object.getOwnPropertyDescriptor(o, n));
|
|
1373
|
+
}
|
|
1374
|
+
for (var h = o, I = x.length - 1; I >= 0; I -= c ? 2 : 1) {
|
|
1375
|
+
var G = x[I], K = c ? x[I - 1] : void 0, W = {}, $ = { kind: ["field", "accessor", "method", "getter", "setter", "class"][s], name: n, metadata: z, addInitializer: (function(l, w) {
|
|
1376
|
+
if (l.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
1377
|
+
S(w, "An initializer", "be", !0), A.push(w);
|
|
1378
|
+
}).bind(null, W) };
|
|
1379
|
+
try {
|
|
1380
|
+
if (_) (u = S(G.call(K, h, $), "class decorators", "return")) && (h = u);
|
|
1381
|
+
else {
|
|
1382
|
+
var D, R;
|
|
1383
|
+
$.static = O, $.private = y, y ? s === 2 ? D = function(l) {
|
|
1384
|
+
return v(l), i.value;
|
|
1385
|
+
} : (s < 4 && (D = E(i, "get", v)), s !== 3 && (R = E(i, "set", v))) : (D = function(l) {
|
|
1386
|
+
return l[n];
|
|
1387
|
+
}, (s < 2 || s === 4) && (R = function(l, w) {
|
|
1388
|
+
l[n] = w;
|
|
1389
|
+
}));
|
|
1390
|
+
var X = $.access = { has: y ? p.bind() : function(l) {
|
|
1391
|
+
return n in l;
|
|
1392
|
+
} };
|
|
1393
|
+
if (D && (X.get = D), R && (X.set = R), h = G.call(K, f ? { get: i.get, set: i.set } : i[m], $), f) {
|
|
1394
|
+
if (typeof h == "object" && h) (u = S(h.get, "accessor.get")) && (i.get = u), (u = S(h.set, "accessor.set")) && (i.set = u), (u = S(h.init, "accessor.init")) && C.push(u);
|
|
1395
|
+
else if (h !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
1396
|
+
} else S(h, (g ? "field" : "method") + " decorators", "return") && (g ? C.push(h) : i[m] = h);
|
|
1397
|
+
}
|
|
1398
|
+
} finally {
|
|
1399
|
+
W.v = !0;
|
|
1400
|
+
}
|
|
1401
|
+
}
|
|
1402
|
+
return (g || f) && T.push(function(l, w) {
|
|
1403
|
+
for (var M = C.length - 1; M >= 0; M--) w = C[M].call(l, w);
|
|
1404
|
+
return w;
|
|
1405
|
+
}), g || _ || (y ? f ? T.push(E(i, "get"), E(i, "set")) : T.push(s === 2 ? i[m] : E.call.bind(i[m])) : Object.defineProperty(o, n, i)), h;
|
|
1406
|
+
}
|
|
1407
|
+
function H(o, a) {
|
|
1408
|
+
return Object.defineProperty(o, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: a });
|
|
1409
|
+
}
|
|
1410
|
+
if (arguments.length >= 6) var F = L[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
1411
|
+
var j = Object.create(F ?? null), U = function(o, a, c, n) {
|
|
1412
|
+
var s, z, A = [], T = function(m) {
|
|
1413
|
+
return Fe(m) === o;
|
|
1414
|
+
}, O = /* @__PURE__ */ new Map();
|
|
1415
|
+
function y(m) {
|
|
1416
|
+
m && A.push(P.bind(null, m));
|
|
1417
|
+
}
|
|
1418
|
+
for (var g = 0; g < a.length; g++) {
|
|
1419
|
+
var f = a[g];
|
|
1420
|
+
if (Array.isArray(f)) {
|
|
1421
|
+
var p = f[1], v = f[2], u = f.length > 3, x = 16 & p, k = !!(8 & p), _ = (p &= 7) == 0, i = v + "/" + k;
|
|
1422
|
+
if (!_ && !u) {
|
|
1423
|
+
var C = O.get(i);
|
|
1424
|
+
if (C === !0 || C === 3 && p !== 4 || C === 4 && p !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + v);
|
|
1425
|
+
O.set(i, !(p > 2) || p);
|
|
1426
|
+
}
|
|
1427
|
+
N(k ? o : o.prototype, f, x, u ? "#" + v : Xt(v), p, n, k ? z = z || [] : s = s || [], A, k, u, _, p === 1, k && u ? T : c);
|
|
1428
|
+
}
|
|
1429
|
+
}
|
|
1430
|
+
return y(s), y(z), A;
|
|
1431
|
+
}(e, t, B, j);
|
|
1432
|
+
return r.length || H(e, j), { e: U, get c() {
|
|
1433
|
+
var o = [];
|
|
1434
|
+
return r.length && [H(N(e, [r], b, e.name, 5, j, o), j), P.bind(null, o, e)];
|
|
1435
|
+
} };
|
|
1436
|
+
}
|
|
1437
|
+
function Xt(e) {
|
|
1438
|
+
var t = He(e, "string");
|
|
1439
|
+
return typeof t == "symbol" ? t : t + "";
|
|
1440
|
+
}
|
|
1441
|
+
function He(e, t) {
|
|
1442
|
+
if (typeof e != "object" || !e) return e;
|
|
1443
|
+
var r = e[Symbol.toPrimitive];
|
|
1444
|
+
if (r !== void 0) {
|
|
1445
|
+
var b = r.call(e, t);
|
|
1446
|
+
if (typeof b != "object") return b;
|
|
1447
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1448
|
+
}
|
|
1449
|
+
return String(e);
|
|
1450
|
+
}
|
|
1451
|
+
function gt(e, t, r) {
|
|
1452
|
+
typeof t == "symbol" && (t = (t = t.description) ? "[" + t + "]" : "");
|
|
1453
|
+
try {
|
|
1454
|
+
Object.defineProperty(e, "name", { configurable: !0, value: r ? r + " " + t : t });
|
|
1455
|
+
} catch {
|
|
1456
|
+
}
|
|
1457
|
+
return e;
|
|
1458
|
+
}
|
|
1459
|
+
function Fe(e) {
|
|
1460
|
+
if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (e !== null ? typeof e : "null"));
|
|
1461
|
+
return e;
|
|
1462
|
+
}
|
|
1463
|
+
const ot = et("SvgDemo");
|
|
1464
|
+
Wt = [V({
|
|
1465
|
+
tagName: "svg-demo"
|
|
1466
|
+
})];
|
|
1467
|
+
let Ge;
|
|
1468
|
+
class Ke extends J {
|
|
874
1469
|
constructor() {
|
|
875
|
-
super(),
|
|
876
|
-
t.target.setAttribute("fill", "#e74c3c"),
|
|
877
|
-
}),
|
|
1470
|
+
super(), Z(this, "animationId", null), Z(this, "rotationAngle", 0), Z(this, "showTooltip", (t, r) => {
|
|
1471
|
+
t.target.setAttribute("fill", "#e74c3c"), ot.debug(`Tooltip value: ${r}`);
|
|
1472
|
+
}), Z(this, "hideTooltip", (t) => {
|
|
878
1473
|
t.target.setAttribute("fill", "#3498db");
|
|
879
|
-
}),
|
|
1474
|
+
}), Z(this, "startAnimation", () => {
|
|
880
1475
|
if (this.animationId) return;
|
|
881
1476
|
const t = () => {
|
|
882
1477
|
this.rotationAngle += 2, this.rotationAngle >= 360 && (this.rotationAngle = 0), this.rerender(), this.animationId = requestAnimationFrame(t);
|
|
883
1478
|
};
|
|
884
1479
|
this.animationId = requestAnimationFrame(t);
|
|
885
|
-
}),
|
|
1480
|
+
}), Z(this, "stopAnimation", () => {
|
|
886
1481
|
this.animationId && (cancelAnimationFrame(this.animationId), this.animationId = null);
|
|
887
|
-
}),
|
|
1482
|
+
}), ot.info("SvgDemo component initialized");
|
|
888
1483
|
}
|
|
889
1484
|
render() {
|
|
890
|
-
return /* @__PURE__ */
|
|
891
|
-
"svg",
|
|
892
|
-
{
|
|
893
|
-
width: "300",
|
|
894
|
-
height: "100",
|
|
895
|
-
style: "border: 1px solid #ddd; background: white;"
|
|
896
|
-
},
|
|
897
|
-
/* @__PURE__ */ i(
|
|
898
|
-
"circle",
|
|
899
|
-
{
|
|
900
|
-
cx: "50",
|
|
901
|
-
cy: "50",
|
|
902
|
-
r: "30",
|
|
903
|
-
fill: "#e74c3c",
|
|
904
|
-
stroke: "#c0392b",
|
|
905
|
-
strokeWidth: "2"
|
|
906
|
-
}
|
|
907
|
-
),
|
|
908
|
-
/* @__PURE__ */ i(
|
|
909
|
-
"rect",
|
|
910
|
-
{
|
|
911
|
-
x: "100",
|
|
912
|
-
y: "20",
|
|
913
|
-
width: "60",
|
|
914
|
-
height: "60",
|
|
915
|
-
fill: "#3498db",
|
|
916
|
-
stroke: "#2980b9",
|
|
917
|
-
strokeWidth: "2",
|
|
918
|
-
rx: "5"
|
|
919
|
-
}
|
|
920
|
-
),
|
|
921
|
-
/* @__PURE__ */ i(
|
|
922
|
-
"polygon",
|
|
923
|
-
{
|
|
924
|
-
points: "200,20 230,80 170,80",
|
|
925
|
-
fill: "#2ecc71",
|
|
926
|
-
stroke: "#27ae60",
|
|
927
|
-
strokeWidth: "2"
|
|
928
|
-
}
|
|
929
|
-
),
|
|
930
|
-
/* @__PURE__ */ i(
|
|
931
|
-
"line",
|
|
932
|
-
{
|
|
933
|
-
x1: "250",
|
|
934
|
-
y1: "20",
|
|
935
|
-
x2: "290",
|
|
936
|
-
y2: "80",
|
|
937
|
-
stroke: "#9b59b6",
|
|
938
|
-
strokeWidth: "3",
|
|
939
|
-
strokeLinecap: "round"
|
|
940
|
-
}
|
|
941
|
-
)
|
|
942
|
-
)), /* @__PURE__ */ i("div", { style: "margin-bottom: 20px;" }, /* @__PURE__ */ i("h4", { style: "margin: 10px 0; color: #666;" }, "Gradients & Effects"), /* @__PURE__ */ i(
|
|
943
|
-
"svg",
|
|
944
|
-
{
|
|
945
|
-
width: "300",
|
|
946
|
-
height: "100",
|
|
947
|
-
style: "border: 1px solid #ddd; background: white;"
|
|
948
|
-
},
|
|
949
|
-
/* @__PURE__ */ i("defs", null, /* @__PURE__ */ i("linearGradient", { id: "blueGradient", x1: "0%", y1: "0%", x2: "100%", y2: "0%" }, /* @__PURE__ */ i("stop", { offset: "0%", stopColor: "#3498db" }), /* @__PURE__ */ i("stop", { offset: "100%", stopColor: "#9b59b6" })), /* @__PURE__ */ i("radialGradient", { id: "redGradient", cx: "50%", cy: "50%", r: "50%" }, /* @__PURE__ */ i("stop", { offset: "0%", stopColor: "#e74c3c" }), /* @__PURE__ */ i("stop", { offset: "100%", stopColor: "#c0392b" }))),
|
|
950
|
-
/* @__PURE__ */ i(
|
|
951
|
-
"rect",
|
|
952
|
-
{
|
|
953
|
-
x: "20",
|
|
954
|
-
y: "20",
|
|
955
|
-
width: "120",
|
|
956
|
-
height: "60",
|
|
957
|
-
fill: "url(#blueGradient)",
|
|
958
|
-
rx: "10"
|
|
959
|
-
}
|
|
960
|
-
),
|
|
961
|
-
/* @__PURE__ */ i("circle", { cx: "200", cy: "50", r: "35", fill: "url(#redGradient)" })
|
|
962
|
-
)), /* @__PURE__ */ i("div", { style: "margin-bottom: 20px;" }, /* @__PURE__ */ i("h4", { style: "margin: 10px 0; color: #666;" }, "Animation"), /* @__PURE__ */ i(
|
|
963
|
-
"svg",
|
|
964
|
-
{
|
|
965
|
-
width: "300",
|
|
966
|
-
height: "100",
|
|
967
|
-
style: "border: 1px solid #ddd; background: white;"
|
|
968
|
-
},
|
|
969
|
-
/* @__PURE__ */ i("g", { transform: `translate(150, 50) rotate(${this.rotationAngle})` }, /* @__PURE__ */ i(
|
|
970
|
-
"polygon",
|
|
971
|
-
{
|
|
972
|
-
points: "-30,0 0,-40 30,0 0,40",
|
|
973
|
-
fill: "#f39c12",
|
|
974
|
-
stroke: "#e67e22",
|
|
975
|
-
strokeWidth: "2"
|
|
976
|
-
}
|
|
977
|
-
), /* @__PURE__ */ i("circle", { cx: "0", cy: "0", r: "8", fill: "#2c3e50" }))
|
|
978
|
-
), /* @__PURE__ */ i("div", { style: "margin-top: 10px;" }, /* @__PURE__ */ i(
|
|
979
|
-
"button",
|
|
980
|
-
{
|
|
981
|
-
onClick: this.startAnimation,
|
|
982
|
-
style: "margin-right: 10px; padding: 5px 10px;"
|
|
983
|
-
},
|
|
984
|
-
"Start Animation"
|
|
985
|
-
), /* @__PURE__ */ i("button", { onClick: this.stopAnimation, style: "padding: 5px 10px;" }, "Stop Animation"))), /* @__PURE__ */ i("div", { style: "margin-bottom: 20px;" }, /* @__PURE__ */ i("h4", { style: "margin: 10px 0; color: #666;" }, "Interactive Chart"), this.renderChart()), /* @__PURE__ */ i("div", null, /* @__PURE__ */ i("h4", { style: "margin: 10px 0; color: #666;" }, "Icon Components"), /* @__PURE__ */ i("div", { style: "display: flex; gap: 15px; align-items: center;" }, /* @__PURE__ */ i("svg-icon", { name: "star", size: "32", color: "#f39c12" }), /* @__PURE__ */ i("svg-icon", { name: "heart", size: "32", color: "#e74c3c" }), /* @__PURE__ */ i("svg-icon", { name: "check", size: "32", color: "#27ae60" }), /* @__PURE__ */ i("svg-icon", { name: "github", size: "32", color: "#333" }), /* @__PURE__ */ i("svg-icon", { name: "play", size: "32", color: "#3498db" }), /* @__PURE__ */ i("svg-icon", { name: "settings", size: "32", color: "#9b59b6" }))));
|
|
1485
|
+
return /* @__PURE__ */ d("div", { style: "padding: 20px; background: #f5f5f5; border-radius: 8px; margin: 10px 0;" }, /* @__PURE__ */ d("h3", { style: "margin-top: 0; color: #333;" }, "SVG Showcase"), /* @__PURE__ */ d("div", { style: "margin-bottom: 20px;" }, /* @__PURE__ */ d("h4", { style: "margin: 10px 0; color: #666;" }, "Basic Shapes"), /* @__PURE__ */ d("svg", { width: "300", height: "100", style: "border: 1px solid #ddd; background: white;" }, /* @__PURE__ */ d("circle", { cx: "50", cy: "50", r: "30", fill: "#e74c3c", stroke: "#c0392b", strokeWidth: "2" }), /* @__PURE__ */ d("rect", { x: "100", y: "20", width: "60", height: "60", fill: "#3498db", stroke: "#2980b9", strokeWidth: "2", rx: "5" }), /* @__PURE__ */ d("polygon", { points: "200,20 230,80 170,80", fill: "#2ecc71", stroke: "#27ae60", strokeWidth: "2" }), /* @__PURE__ */ d("line", { x1: "250", y1: "20", x2: "290", y2: "80", stroke: "#9b59b6", strokeWidth: "3", strokeLinecap: "round" }))), /* @__PURE__ */ d("div", { style: "margin-bottom: 20px;" }, /* @__PURE__ */ d("h4", { style: "margin: 10px 0; color: #666;" }, "Gradients & Effects"), /* @__PURE__ */ d("svg", { width: "300", height: "100", style: "border: 1px solid #ddd; background: white;" }, /* @__PURE__ */ d("defs", null, /* @__PURE__ */ d("linearGradient", { id: "blueGradient", x1: "0%", y1: "0%", x2: "100%", y2: "0%" }, /* @__PURE__ */ d("stop", { offset: "0%", stopColor: "#3498db" }), /* @__PURE__ */ d("stop", { offset: "100%", stopColor: "#9b59b6" })), /* @__PURE__ */ d("radialGradient", { id: "redGradient", cx: "50%", cy: "50%", r: "50%" }, /* @__PURE__ */ d("stop", { offset: "0%", stopColor: "#e74c3c" }), /* @__PURE__ */ d("stop", { offset: "100%", stopColor: "#c0392b" }))), /* @__PURE__ */ d("rect", { x: "20", y: "20", width: "120", height: "60", fill: "url(#blueGradient)", rx: "10" }), /* @__PURE__ */ d("circle", { cx: "200", cy: "50", r: "35", fill: "url(#redGradient)" }))), /* @__PURE__ */ d("div", { style: "margin-bottom: 20px;" }, /* @__PURE__ */ d("h4", { style: "margin: 10px 0; color: #666;" }, "Animation"), /* @__PURE__ */ d("svg", { width: "300", height: "100", style: "border: 1px solid #ddd; background: white;" }, /* @__PURE__ */ d("g", { transform: `translate(150, 50) rotate(${this.rotationAngle})` }, /* @__PURE__ */ d("polygon", { points: "-30,0 0,-40 30,0 0,40", fill: "#f39c12", stroke: "#e67e22", strokeWidth: "2" }), /* @__PURE__ */ d("circle", { cx: "0", cy: "0", r: "8", fill: "#2c3e50" }))), /* @__PURE__ */ d("div", { style: "margin-top: 10px;" }, /* @__PURE__ */ d("button", { onClick: this.startAnimation, style: "margin-right: 10px; padding: 5px 10px;" }, "Start Animation"), /* @__PURE__ */ d("button", { onClick: this.stopAnimation, style: "padding: 5px 10px;" }, "Stop Animation"))), /* @__PURE__ */ d("div", { style: "margin-bottom: 20px;" }, /* @__PURE__ */ d("h4", { style: "margin: 10px 0; color: #666;" }, "Interactive Chart"), this.renderChart()), /* @__PURE__ */ d("div", null, /* @__PURE__ */ d("h4", { style: "margin: 10px 0; color: #666;" }, "Icon Components"), /* @__PURE__ */ d("div", { style: "display: flex; gap: 15px; align-items: center;" }, /* @__PURE__ */ d("svg-icon", { name: "star", size: "32", color: "#f39c12" }), /* @__PURE__ */ d("svg-icon", { name: "heart", size: "32", color: "#e74c3c" }), /* @__PURE__ */ d("svg-icon", { name: "check", size: "32", color: "#27ae60" }), /* @__PURE__ */ d("svg-icon", { name: "github", size: "32", color: "#333" }), /* @__PURE__ */ d("svg-icon", { name: "play", size: "32", color: "#3498db" }), /* @__PURE__ */ d("svg-icon", { name: "settings", size: "32", color: "#9b59b6" }))));
|
|
986
1486
|
}
|
|
987
1487
|
renderChart() {
|
|
988
|
-
const t = [30, 80, 45, 60, 20, 90, 55],
|
|
989
|
-
return /* @__PURE__ */
|
|
990
|
-
|
|
991
|
-
{
|
|
992
|
-
|
|
993
|
-
height: n + 40,
|
|
994
|
-
style: "border: 1px solid #ddd; background: white;"
|
|
995
|
-
},
|
|
996
|
-
t.map((h, u) => {
|
|
997
|
-
const l = h / o * n, p = u * r + 20, m = n - l + 20;
|
|
998
|
-
return /* @__PURE__ */ i("g", { key: u }, /* @__PURE__ */ i(
|
|
999
|
-
"rect",
|
|
1000
|
-
{
|
|
1001
|
-
x: p,
|
|
1002
|
-
y: m,
|
|
1003
|
-
width: s,
|
|
1004
|
-
height: l,
|
|
1005
|
-
fill: "#3498db",
|
|
1006
|
-
stroke: "#2980b9",
|
|
1007
|
-
strokeWidth: "1",
|
|
1008
|
-
onMouseEnter: (g) => this.showTooltip(g, h),
|
|
1009
|
-
onMouseLeave: this.hideTooltip,
|
|
1010
|
-
style: "cursor: pointer; transition: fill 0.2s;"
|
|
1011
|
-
}
|
|
1012
|
-
), /* @__PURE__ */ i(
|
|
1013
|
-
"text",
|
|
1014
|
-
{
|
|
1015
|
-
x: p + s / 2,
|
|
1016
|
-
y: n + 35,
|
|
1017
|
-
textAnchor: "middle",
|
|
1018
|
-
fontSize: "12",
|
|
1019
|
-
fill: "#666"
|
|
1020
|
-
},
|
|
1021
|
-
u + 1
|
|
1022
|
-
));
|
|
1023
|
-
})
|
|
1024
|
-
);
|
|
1488
|
+
const t = [30, 80, 45, 60, 20, 90, 55], r = Math.max(...t), b = 30, B = 40, L = 120, E = t.length * B + 40;
|
|
1489
|
+
return /* @__PURE__ */ d("svg", { width: E, height: L + 40, style: "border: 1px solid #ddd; background: white;" }, t.map((P, S) => {
|
|
1490
|
+
const N = P / r * L, H = S * B + 20, F = L - N + 20;
|
|
1491
|
+
return /* @__PURE__ */ d("g", { key: S }, /* @__PURE__ */ d("rect", { x: H, y: F, width: b, height: N, fill: "#3498db", stroke: "#2980b9", strokeWidth: "1", onMouseEnter: (j) => this.showTooltip(j, P), onMouseLeave: this.hideTooltip, style: "cursor: pointer; transition: fill 0.2s;" }), /* @__PURE__ */ d("text", { x: H + b / 2, y: L + 35, textAnchor: "middle", fontSize: "12", fill: "#666" }, S + 1));
|
|
1492
|
+
}));
|
|
1025
1493
|
}
|
|
1026
1494
|
onConnected() {
|
|
1027
|
-
|
|
1495
|
+
ot.info("SvgDemo connected to DOM");
|
|
1028
1496
|
}
|
|
1029
1497
|
onDisconnected() {
|
|
1030
|
-
|
|
1031
|
-
}
|
|
1032
|
-
}
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
var
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1498
|
+
ot.info("SvgDemo disconnected from DOM"), this.stopAnimation();
|
|
1499
|
+
}
|
|
1500
|
+
}
|
|
1501
|
+
Gt = Ke;
|
|
1502
|
+
[Ge, Kt] = Ne(Gt, [], Wt, 0, void 0, J).c;
|
|
1503
|
+
Kt();
|
|
1504
|
+
var Yt;
|
|
1505
|
+
let qt, Jt;
|
|
1506
|
+
function ct(e, t, r) {
|
|
1507
|
+
return (t = Ut(t)) in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
|
|
1508
|
+
}
|
|
1509
|
+
function We(e, t, r, b, B, L) {
|
|
1510
|
+
function E(o, a, c) {
|
|
1511
|
+
return function(n, s) {
|
|
1512
|
+
return c && c(n), o[a].call(n, s);
|
|
1513
|
+
};
|
|
1514
|
+
}
|
|
1515
|
+
function P(o, a) {
|
|
1516
|
+
for (var c = 0; c < o.length; c++) o[c].call(a);
|
|
1517
|
+
return a;
|
|
1518
|
+
}
|
|
1519
|
+
function S(o, a, c, n) {
|
|
1520
|
+
if (typeof o != "function" && (n || o !== void 0)) throw new TypeError(a + " must " + (c || "be") + " a function" + (n ? "" : " or undefined"));
|
|
1521
|
+
return o;
|
|
1522
|
+
}
|
|
1523
|
+
function N(o, a, c, n, s, z, A, T, O, y, g, f, p) {
|
|
1524
|
+
function v(l) {
|
|
1525
|
+
if (!p(l)) throw new TypeError("Attempted to access private element on non-instance");
|
|
1526
|
+
}
|
|
1527
|
+
var u, x = a[0], k = a[3], _ = !T;
|
|
1528
|
+
if (!_) {
|
|
1529
|
+
c || Array.isArray(x) || (x = [x]);
|
|
1530
|
+
var i = {}, C = [], m = s === 3 ? "get" : s === 4 || f ? "set" : "value";
|
|
1531
|
+
y ? (g || f ? i = { get: yt(function() {
|
|
1532
|
+
return k(this);
|
|
1533
|
+
}, n, "get"), set: function(l) {
|
|
1534
|
+
a[4](this, l);
|
|
1535
|
+
} } : i[m] = k, g || yt(i[m], n, s === 2 ? "" : m)) : g || (i = Object.getOwnPropertyDescriptor(o, n));
|
|
1536
|
+
}
|
|
1537
|
+
for (var h = o, I = x.length - 1; I >= 0; I -= c ? 2 : 1) {
|
|
1538
|
+
var G = x[I], K = c ? x[I - 1] : void 0, W = {}, $ = { kind: ["field", "accessor", "method", "getter", "setter", "class"][s], name: n, metadata: z, addInitializer: (function(l, w) {
|
|
1539
|
+
if (l.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
1540
|
+
S(w, "An initializer", "be", !0), A.push(w);
|
|
1541
|
+
}).bind(null, W) };
|
|
1542
|
+
try {
|
|
1543
|
+
if (_) (u = S(G.call(K, h, $), "class decorators", "return")) && (h = u);
|
|
1544
|
+
else {
|
|
1545
|
+
var D, R;
|
|
1546
|
+
$.static = O, $.private = y, y ? s === 2 ? D = function(l) {
|
|
1547
|
+
return v(l), i.value;
|
|
1548
|
+
} : (s < 4 && (D = E(i, "get", v)), s !== 3 && (R = E(i, "set", v))) : (D = function(l) {
|
|
1549
|
+
return l[n];
|
|
1550
|
+
}, (s < 2 || s === 4) && (R = function(l, w) {
|
|
1551
|
+
l[n] = w;
|
|
1552
|
+
}));
|
|
1553
|
+
var X = $.access = { has: y ? p.bind() : function(l) {
|
|
1554
|
+
return n in l;
|
|
1555
|
+
} };
|
|
1556
|
+
if (D && (X.get = D), R && (X.set = R), h = G.call(K, f ? { get: i.get, set: i.set } : i[m], $), f) {
|
|
1557
|
+
if (typeof h == "object" && h) (u = S(h.get, "accessor.get")) && (i.get = u), (u = S(h.set, "accessor.set")) && (i.set = u), (u = S(h.init, "accessor.init")) && C.push(u);
|
|
1558
|
+
else if (h !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
1559
|
+
} else S(h, (g ? "field" : "method") + " decorators", "return") && (g ? C.push(h) : i[m] = h);
|
|
1560
|
+
}
|
|
1561
|
+
} finally {
|
|
1562
|
+
W.v = !0;
|
|
1563
|
+
}
|
|
1564
|
+
}
|
|
1565
|
+
return (g || f) && T.push(function(l, w) {
|
|
1566
|
+
for (var M = C.length - 1; M >= 0; M--) w = C[M].call(l, w);
|
|
1567
|
+
return w;
|
|
1568
|
+
}), g || _ || (y ? f ? T.push(E(i, "get"), E(i, "set")) : T.push(s === 2 ? i[m] : E.call.bind(i[m])) : Object.defineProperty(o, n, i)), h;
|
|
1569
|
+
}
|
|
1570
|
+
function H(o, a) {
|
|
1571
|
+
return Object.defineProperty(o, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: a });
|
|
1572
|
+
}
|
|
1573
|
+
if (arguments.length >= 6) var F = L[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
1574
|
+
var j = Object.create(F ?? null), U = function(o, a, c, n) {
|
|
1575
|
+
var s, z, A = [], T = function(m) {
|
|
1576
|
+
return Ye(m) === o;
|
|
1577
|
+
}, O = /* @__PURE__ */ new Map();
|
|
1578
|
+
function y(m) {
|
|
1579
|
+
m && A.push(P.bind(null, m));
|
|
1580
|
+
}
|
|
1581
|
+
for (var g = 0; g < a.length; g++) {
|
|
1582
|
+
var f = a[g];
|
|
1583
|
+
if (Array.isArray(f)) {
|
|
1584
|
+
var p = f[1], v = f[2], u = f.length > 3, x = 16 & p, k = !!(8 & p), _ = (p &= 7) == 0, i = v + "/" + k;
|
|
1585
|
+
if (!_ && !u) {
|
|
1586
|
+
var C = O.get(i);
|
|
1587
|
+
if (C === !0 || C === 3 && p !== 4 || C === 4 && p !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + v);
|
|
1588
|
+
O.set(i, !(p > 2) || p);
|
|
1589
|
+
}
|
|
1590
|
+
N(k ? o : o.prototype, f, x, u ? "#" + v : Ut(v), p, n, k ? z = z || [] : s = s || [], A, k, u, _, p === 1, k && u ? T : c);
|
|
1591
|
+
}
|
|
1592
|
+
}
|
|
1593
|
+
return y(s), y(z), A;
|
|
1594
|
+
}(e, t, B, j);
|
|
1595
|
+
return r.length || H(e, j), { e: U, get c() {
|
|
1596
|
+
var o = [];
|
|
1597
|
+
return r.length && [H(N(e, [r], b, e.name, 5, j, o), j), P.bind(null, o, e)];
|
|
1598
|
+
} };
|
|
1599
|
+
}
|
|
1600
|
+
function Ut(e) {
|
|
1601
|
+
var t = Xe(e, "string");
|
|
1602
|
+
return typeof t == "symbol" ? t : t + "";
|
|
1603
|
+
}
|
|
1604
|
+
function Xe(e, t) {
|
|
1605
|
+
if (typeof e != "object" || !e) return e;
|
|
1606
|
+
var r = e[Symbol.toPrimitive];
|
|
1607
|
+
if (r !== void 0) {
|
|
1608
|
+
var b = r.call(e, t);
|
|
1609
|
+
if (typeof b != "object") return b;
|
|
1610
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1611
|
+
}
|
|
1612
|
+
return String(e);
|
|
1613
|
+
}
|
|
1614
|
+
function yt(e, t, r) {
|
|
1615
|
+
typeof t == "symbol" && (t = (t = t.description) ? "[" + t + "]" : "");
|
|
1616
|
+
try {
|
|
1617
|
+
Object.defineProperty(e, "name", { configurable: !0, value: r ? r + " " + t : t });
|
|
1618
|
+
} catch {
|
|
1619
|
+
}
|
|
1620
|
+
return e;
|
|
1621
|
+
}
|
|
1622
|
+
function Ye(e) {
|
|
1623
|
+
if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (e !== null ? typeof e : "null"));
|
|
1624
|
+
return e;
|
|
1625
|
+
}
|
|
1626
|
+
const qe = et("SimpleReactiveDemo");
|
|
1627
|
+
Jt = [V({
|
|
1628
|
+
tagName: "simple-reactive-demo"
|
|
1629
|
+
})];
|
|
1630
|
+
let Je;
|
|
1631
|
+
class Ue extends J {
|
|
1051
1632
|
constructor() {
|
|
1052
|
-
super(),
|
|
1053
|
-
count: 0,
|
|
1054
|
-
message: "Click the button!"
|
|
1055
|
-
})), P(this, "increment", () => {
|
|
1633
|
+
super(), ct(this, "state", void 0), ct(this, "increment", () => {
|
|
1056
1634
|
this.state.count++, this.state.message = `Clicked ${this.state.count} time${this.state.count === 1 ? "" : "s"}!`;
|
|
1057
|
-
}),
|
|
1635
|
+
}), ct(this, "reset", () => {
|
|
1058
1636
|
this.state.count = 0, this.state.message = "Reset! Click again!";
|
|
1059
|
-
}),
|
|
1637
|
+
}), qe.info("SimpleReactiveDemo initialized"), this.state = this.reactive({
|
|
1638
|
+
count: 0,
|
|
1639
|
+
message: "Click the button!"
|
|
1640
|
+
});
|
|
1060
1641
|
}
|
|
1061
1642
|
render() {
|
|
1062
|
-
return /* @__PURE__ */
|
|
1643
|
+
return /* @__PURE__ */ d("div", { style: "padding: 20px; border: 1px solid #ccc; border-radius: 8px; margin: 20px;" }, /* @__PURE__ */ d("h3", null, "📱 Simple Reactive Demo"), /* @__PURE__ */ d("p", null, this.state.message), /* @__PURE__ */ d("div", { style: "font-size: 24px; margin: 16px 0;" }, "Count: ", /* @__PURE__ */ d("strong", null, this.state.count)), /* @__PURE__ */ d("div", null, /* @__PURE__ */ d("button", { onClick: this.increment, style: "margin-right: 8px; padding: 8px 16px;" }, "+ Increment"), /* @__PURE__ */ d("button", { onClick: this.reset, style: "padding: 8px 16px;" }, "🔄 Reset")), /* @__PURE__ */ d("div", { style: "margin-top: 16px; font-size: 12px; color: #666;" }, "💡 State changes automatically trigger re-renders!"));
|
|
1063
1644
|
}
|
|
1064
1645
|
}
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1646
|
+
Yt = Ue;
|
|
1647
|
+
[Je, qt] = We(Yt, [], Jt, 0, void 0, J).c;
|
|
1648
|
+
qt();
|
|
1068
1649
|
export {
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1650
|
+
Ze as CONVERTER_BTN,
|
|
1651
|
+
tr as CONVERTER_PANEL,
|
|
1652
|
+
ke as ColorPicker,
|
|
1653
|
+
_e as ReactiveCounter,
|
|
1654
|
+
Je as SimpleReactiveDemo,
|
|
1655
|
+
Ge as SvgDemo,
|
|
1656
|
+
Pe as SvgIcon,
|
|
1657
|
+
Oe as ThemeSwitcher,
|
|
1658
|
+
ee as XyButton,
|
|
1659
|
+
ae as XyButtonGroup,
|
|
1660
|
+
pe as getCustomColorCache,
|
|
1661
|
+
Ve as getDefaultColorCache,
|
|
1662
|
+
rt as handleCSSVariables,
|
|
1663
|
+
fe as setCustomColorCache,
|
|
1664
|
+
de as setDefaultColorCache,
|
|
1665
|
+
me as throttle
|
|
1085
1666
|
};
|