zabi-components 4.0.0 → 4.0.2
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/README.md +68 -0
- package/dist/{CodeBlock-Bbv6JfD2.js → CodeBlock-pT5-FgZd.js} +166 -157
- package/dist/ContactForm-CHI_jeFY.js +580 -0
- package/dist/FeatureCard-iBFGbgVE.js +656 -0
- package/dist/Navigation-BOT-UHg0.js +104 -0
- package/dist/ThemeToggle-BlNPkAQy.js +48 -0
- package/dist/atoms/index.js +21 -662
- package/dist/index/index.js +53 -41
- package/dist/molecules/index.js +11 -578
- package/dist/organisms/index.js +3 -102
- package/dist/{props-BKbHJRuR.js → ssr-safe-bsWGK4V4.js} +655 -636
- package/package.json +5 -4
- package/dist/ThemeToggle-Z2Ndc0if.js +0 -42
package/README.md
CHANGED
|
@@ -22,6 +22,8 @@ A clean, minimal Svelte 5 component library built with TypeScript and Tailwind C
|
|
|
22
22
|
- 🚀 **Modern CSS** - CSS-only positioning, animations, and interactions
|
|
23
23
|
- ⚡ **Lightweight** - 60-80% less code than traditional component libraries
|
|
24
24
|
- 🎭 **Emoji Icons** - Simple emoji-based icons instead of complex SVG libraries
|
|
25
|
+
- 🛡️ **SSR Safe** - 100% server-side rendering compatible with zero runtime errors
|
|
26
|
+
- 🔄 **SvelteKit Ready** - Full SvelteKit integration with proper hydration
|
|
25
27
|
|
|
26
28
|
## Installation
|
|
27
29
|
|
|
@@ -748,6 +750,72 @@ interface InputProps {
|
|
|
748
750
|
}
|
|
749
751
|
```
|
|
750
752
|
|
|
753
|
+
## SSR Safety & SvelteKit Integration
|
|
754
|
+
|
|
755
|
+
Zabi Components is **100% SSR-safe** and fully compatible with SvelteKit's server-side rendering. All components have been thoroughly tested to eliminate runtime errors and ensure proper hydration.
|
|
756
|
+
|
|
757
|
+
### ✅ **Zero Runtime Errors**
|
|
758
|
+
|
|
759
|
+
All components are designed to work seamlessly in both server and client environments:
|
|
760
|
+
|
|
761
|
+
- **No "Cannot read properties of null" errors**
|
|
762
|
+
- **Proper hydration without mismatches**
|
|
763
|
+
- **Safe browser API access**
|
|
764
|
+
- **Consistent behavior across SSR and client**
|
|
765
|
+
|
|
766
|
+
### 🛡️ **SSR-Safe Patterns**
|
|
767
|
+
|
|
768
|
+
Components use consistent SSR-safe patterns:
|
|
769
|
+
|
|
770
|
+
```svelte
|
|
771
|
+
<script lang="ts">
|
|
772
|
+
import { onMount } from "svelte";
|
|
773
|
+
import { safeLocalStorage, safeDocument } from "zabi-components/ssr-safe";
|
|
774
|
+
|
|
775
|
+
let mounted = $state(false);
|
|
776
|
+
|
|
777
|
+
onMount(() => {
|
|
778
|
+
mounted = true;
|
|
779
|
+
// Safe browser API access after mount
|
|
780
|
+
const storage = safeLocalStorage();
|
|
781
|
+
if (storage) {
|
|
782
|
+
// Use localStorage safely
|
|
783
|
+
}
|
|
784
|
+
});
|
|
785
|
+
</script>
|
|
786
|
+
```
|
|
787
|
+
|
|
788
|
+
### 🔄 **SvelteKit Integration**
|
|
789
|
+
|
|
790
|
+
Perfect integration with SvelteKit features:
|
|
791
|
+
|
|
792
|
+
```svelte
|
|
793
|
+
<script lang="ts">
|
|
794
|
+
import { goto } from '$app/navigation';
|
|
795
|
+
import { Button } from 'zabi-components';
|
|
796
|
+
</script>
|
|
797
|
+
|
|
798
|
+
<!-- SSR-safe navigation -->
|
|
799
|
+
<Button onclick={() => goto('/about')}>
|
|
800
|
+
Go to About
|
|
801
|
+
</Button>
|
|
802
|
+
```
|
|
803
|
+
|
|
804
|
+
### 🎯 **Key SSR Features**
|
|
805
|
+
|
|
806
|
+
- **Safe ID Generation**: Prevents hydration mismatches
|
|
807
|
+
- **Browser API Guards**: All browser APIs are safely accessed
|
|
808
|
+
- **Consistent State**: Server and client state remain synchronized
|
|
809
|
+
- **Theme Persistence**: Dark mode works correctly on first load
|
|
810
|
+
- **Form Stability**: Input IDs remain consistent across hydration
|
|
811
|
+
|
|
812
|
+
### 📋 **SSR Best Practices**
|
|
813
|
+
|
|
814
|
+
1. **Use SvelteKit Navigation**: Always use `goto()` instead of `window.location.href`
|
|
815
|
+
2. **Safe Browser Access**: Use provided SSR-safe utilities
|
|
816
|
+
3. **Consistent IDs**: Let components handle ID generation internally
|
|
817
|
+
4. **Theme Loading**: Components handle theme loading automatically
|
|
818
|
+
|
|
751
819
|
## Advanced Usage
|
|
752
820
|
|
|
753
821
|
### Custom Styling
|
|
@@ -1,38 +1,39 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { z as P, H as W, I as X, J as Y, K as Z, L as A, M as $, p as t, f as k, c as V, y as ee, d as x, e as F, h as H, r as T, g as n, N as y, B as ae, k as h, s as D, l as K, i as I, j as q, A as N, F as E, O, G, C as J, P as te, x as re, Q } from "./ssr-safe-bsWGK4V4.js";
|
|
2
|
+
import { onMount as R } from "svelte";
|
|
3
|
+
function oe(r, e, a = !1, o = !1, d = !1) {
|
|
4
|
+
var g = r, u = "";
|
|
5
|
+
P(() => {
|
|
5
6
|
var s = (
|
|
6
7
|
/** @type {Effect} */
|
|
7
|
-
|
|
8
|
+
W
|
|
8
9
|
);
|
|
9
|
-
if (
|
|
10
|
+
if (u !== (u = e() ?? "") && (s.nodes_start !== null && (X(
|
|
10
11
|
s.nodes_start,
|
|
11
12
|
/** @type {TemplateNode} */
|
|
12
13
|
s.nodes_end
|
|
13
|
-
), s.nodes_start = s.nodes_end = null),
|
|
14
|
-
var
|
|
15
|
-
a ?
|
|
16
|
-
var l =
|
|
14
|
+
), s.nodes_start = s.nodes_end = null), u !== "")) {
|
|
15
|
+
var i = u + "";
|
|
16
|
+
a ? i = `<svg>${i}</svg>` : o && (i = `<math>${i}</math>`);
|
|
17
|
+
var l = Y(i);
|
|
17
18
|
if ((a || o) && (l = /** @type {Element} */
|
|
18
|
-
|
|
19
|
+
A(l)), Z(
|
|
19
20
|
/** @type {TemplateNode} */
|
|
20
|
-
|
|
21
|
+
A(l),
|
|
21
22
|
/** @type {TemplateNode} */
|
|
22
23
|
l.lastChild
|
|
23
24
|
), a || o)
|
|
24
|
-
for (;
|
|
25
|
-
|
|
25
|
+
for (; A(l); )
|
|
26
|
+
g.before(
|
|
26
27
|
/** @type {Node} */
|
|
27
|
-
|
|
28
|
+
A(l)
|
|
28
29
|
);
|
|
29
30
|
else
|
|
30
|
-
|
|
31
|
+
g.before(l);
|
|
31
32
|
}
|
|
32
33
|
});
|
|
33
34
|
}
|
|
34
|
-
function
|
|
35
|
-
|
|
35
|
+
function se(r, e) {
|
|
36
|
+
$(() => {
|
|
36
37
|
var a = r.getRootNode(), o = (
|
|
37
38
|
/** @type {ShadowRoot} */
|
|
38
39
|
a.host ? (
|
|
@@ -45,15 +46,15 @@ function re(r, e) {
|
|
|
45
46
|
)
|
|
46
47
|
);
|
|
47
48
|
if (!o.querySelector("#" + e.hash)) {
|
|
48
|
-
const
|
|
49
|
-
|
|
49
|
+
const d = document.createElement("style");
|
|
50
|
+
d.id = e.hash, d.textContent = e.code, o.appendChild(d);
|
|
50
51
|
}
|
|
51
52
|
});
|
|
52
53
|
}
|
|
53
|
-
var
|
|
54
|
-
function
|
|
55
|
-
|
|
56
|
-
let a = t(e, "variant", 3, "primary"), o = t(e, "size", 3, "md"),
|
|
54
|
+
var le = k("<button><!></button>");
|
|
55
|
+
function we(r, e) {
|
|
56
|
+
H(e, !0);
|
|
57
|
+
let a = t(e, "variant", 3, "primary"), o = t(e, "size", 3, "md"), d = t(e, "disabled", 3, !1), g = t(e, "type", 3, "button"), u = t(e, "className", 3, ""), s = T(e, [
|
|
57
58
|
"$$slots",
|
|
58
59
|
"$$events",
|
|
59
60
|
"$$legacy",
|
|
@@ -63,7 +64,7 @@ function ye(r, e) {
|
|
|
63
64
|
"type",
|
|
64
65
|
"className",
|
|
65
66
|
"children"
|
|
66
|
-
]),
|
|
67
|
+
]), i = y(() => ({
|
|
67
68
|
sm: "px-3 py-1.5 text-sm font-medium",
|
|
68
69
|
md: "px-4 py-2 text-sm font-medium",
|
|
69
70
|
lg: "px-6 py-3 text-base font-semibold"
|
|
@@ -80,21 +81,21 @@ function ye(r, e) {
|
|
|
80
81
|
"focus:outline-none focus:ring-2 focus:ring-offset-2",
|
|
81
82
|
"active:scale-95 transform-gpu",
|
|
82
83
|
"shadow-sm hover:shadow-md",
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
n(i)[o()],
|
|
85
|
+
n(l)[a()],
|
|
86
|
+
u()
|
|
86
87
|
].filter(Boolean).join(" "));
|
|
87
|
-
var c =
|
|
88
|
-
|
|
89
|
-
type:
|
|
90
|
-
class:
|
|
91
|
-
disabled:
|
|
88
|
+
var c = le();
|
|
89
|
+
V(c, () => ({
|
|
90
|
+
type: g(),
|
|
91
|
+
class: n(p),
|
|
92
|
+
disabled: d(),
|
|
92
93
|
...s
|
|
93
94
|
}));
|
|
94
95
|
var w = h(c);
|
|
95
|
-
|
|
96
|
+
ee(w, () => e.children ?? ae), x(r, c), F();
|
|
96
97
|
}
|
|
97
|
-
function
|
|
98
|
+
function U(r) {
|
|
98
99
|
const e = {
|
|
99
100
|
default: "border-gray-300 focus:border-blue-500 focus:ring-blue-500",
|
|
100
101
|
success: "border-green-300 focus:border-green-500 focus:ring-green-500",
|
|
@@ -104,7 +105,7 @@ function K(r) {
|
|
|
104
105
|
};
|
|
105
106
|
return e[r] || e.default;
|
|
106
107
|
}
|
|
107
|
-
function
|
|
108
|
+
function _e(r) {
|
|
108
109
|
const e = {
|
|
109
110
|
default: "border-gray-200 bg-white",
|
|
110
111
|
success: "border-green-200 bg-green-50",
|
|
@@ -114,7 +115,7 @@ function xe(r) {
|
|
|
114
115
|
};
|
|
115
116
|
return e[r] || e.default;
|
|
116
117
|
}
|
|
117
|
-
function
|
|
118
|
+
function S(r, e) {
|
|
118
119
|
var o;
|
|
119
120
|
const a = {
|
|
120
121
|
default: {
|
|
@@ -145,20 +146,20 @@ function E(r, e) {
|
|
|
145
146
|
};
|
|
146
147
|
return ((o = a[r]) == null ? void 0 : o[e]) || a.default[e];
|
|
147
148
|
}
|
|
148
|
-
function
|
|
149
|
+
function ke(r) {
|
|
149
150
|
return {
|
|
150
|
-
border:
|
|
151
|
-
text:
|
|
152
|
-
bg:
|
|
151
|
+
border: S(r, "border"),
|
|
152
|
+
text: S(r, "text"),
|
|
153
|
+
bg: S(r, "bg")
|
|
153
154
|
};
|
|
154
155
|
}
|
|
155
|
-
function
|
|
156
|
+
function Ce(r, e) {
|
|
156
157
|
return r.reduce((a, o) => (a[o] = `${e}-${o}`, a), {});
|
|
157
158
|
}
|
|
158
|
-
var
|
|
159
|
-
function
|
|
160
|
-
|
|
161
|
-
let a = t(e, "value", 7, ""), o = t(e, "type", 3, "text"),
|
|
159
|
+
var ne = k("<label> </label>"), ie = k("<div><!> <input/></div>");
|
|
160
|
+
function ze(r, e) {
|
|
161
|
+
H(e, !0);
|
|
162
|
+
let a = t(e, "value", 7, ""), o = t(e, "type", 3, "text"), d = t(e, "name", 3, ""), g = t(e, "label", 3, ""), u = t(e, "placeholder", 3, ""), s = t(e, "disabled", 3, !1), i = t(e, "size", 3, "md"), l = t(e, "variant", 3, "default"), p = T(e, [
|
|
162
163
|
"$$slots",
|
|
163
164
|
"$$events",
|
|
164
165
|
"$$legacy",
|
|
@@ -171,46 +172,50 @@ function _e(r, e) {
|
|
|
171
172
|
"size",
|
|
172
173
|
"variant",
|
|
173
174
|
"oninput"
|
|
174
|
-
]), c =
|
|
175
|
+
]), c = q("");
|
|
176
|
+
R(() => {
|
|
177
|
+
D(c, K("input"), !0);
|
|
178
|
+
});
|
|
179
|
+
let w = y(() => ({
|
|
175
180
|
sm: "px-3 py-1.5 text-sm",
|
|
176
181
|
md: "px-4 py-2 text-sm",
|
|
177
182
|
lg: "px-5 py-3 text-base"
|
|
178
|
-
})), C = y(() =>
|
|
183
|
+
})), C = y(() => U(l())), b = y(() => [
|
|
179
184
|
"w-full rounded-md transition-colors duration-200",
|
|
180
185
|
"focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-surface",
|
|
181
186
|
"disabled:opacity-50 disabled:cursor-not-allowed disabled:bg-surface-disabled",
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
].join(" ")),
|
|
185
|
-
function z(
|
|
186
|
-
const
|
|
187
|
-
a(
|
|
187
|
+
n(w)[i()],
|
|
188
|
+
n(C)
|
|
189
|
+
].join(" ")), f = y(() => "block text-sm font-medium text-primary mb-1");
|
|
190
|
+
function z(v) {
|
|
191
|
+
const m = v.target;
|
|
192
|
+
a(m.value), e.oninput && e.oninput(v);
|
|
188
193
|
}
|
|
189
|
-
var M =
|
|
194
|
+
var M = ie(), j = h(M);
|
|
190
195
|
{
|
|
191
|
-
var _ = (
|
|
192
|
-
var
|
|
193
|
-
|
|
194
|
-
var
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
}), x(
|
|
196
|
+
var _ = (v) => {
|
|
197
|
+
var m = ne();
|
|
198
|
+
E(m, 1, O(n(f)));
|
|
199
|
+
var L = h(m);
|
|
200
|
+
P(() => {
|
|
201
|
+
G(m, "for", n(c)), J(L, g());
|
|
202
|
+
}), x(v, m);
|
|
198
203
|
};
|
|
199
|
-
I(j, (
|
|
200
|
-
|
|
204
|
+
I(j, (v) => {
|
|
205
|
+
g() && v(_);
|
|
201
206
|
});
|
|
202
207
|
}
|
|
203
208
|
var B = N(j, 2);
|
|
204
|
-
|
|
209
|
+
V(
|
|
205
210
|
B,
|
|
206
211
|
() => ({
|
|
207
|
-
id: c,
|
|
212
|
+
id: n(c),
|
|
208
213
|
type: o(),
|
|
209
|
-
name:
|
|
214
|
+
name: d(),
|
|
210
215
|
value: a(),
|
|
211
|
-
placeholder:
|
|
216
|
+
placeholder: u(),
|
|
212
217
|
disabled: s(),
|
|
213
|
-
class:
|
|
218
|
+
class: n(b),
|
|
214
219
|
oninput: z,
|
|
215
220
|
...p
|
|
216
221
|
}),
|
|
@@ -218,12 +223,12 @@ function _e(r, e) {
|
|
|
218
223
|
void 0,
|
|
219
224
|
void 0,
|
|
220
225
|
!0
|
|
221
|
-
), x(r, M),
|
|
226
|
+
), x(r, M), F();
|
|
222
227
|
}
|
|
223
|
-
var
|
|
224
|
-
function
|
|
225
|
-
|
|
226
|
-
let a = t(e, "value", 7, ""), o = t(e, "name", 3, ""),
|
|
228
|
+
var de = k("<label> </label>"), ue = k("<div><!> <textarea></textarea></div>");
|
|
229
|
+
function Me(r, e) {
|
|
230
|
+
H(e, !0);
|
|
231
|
+
let a = t(e, "value", 7, ""), o = t(e, "name", 3, ""), d = t(e, "label", 3, ""), g = t(e, "placeholder", 3, ""), u = t(e, "disabled", 3, !1), s = t(e, "rows", 3, 4), i = t(e, "size", 3, "md"), l = t(e, "variant", 3, "default"), p = T(e, [
|
|
227
232
|
"$$slots",
|
|
228
233
|
"$$events",
|
|
229
234
|
"$$legacy",
|
|
@@ -236,53 +241,53 @@ function ke(r, e) {
|
|
|
236
241
|
"size",
|
|
237
242
|
"variant",
|
|
238
243
|
"oninput"
|
|
239
|
-
]), c =
|
|
244
|
+
]), c = te(typeof window < "u" ? `textarea-${Math.random().toString(36).substr(2, 9)}` : `textarea-ssr-${Date.now()}`), w = y(() => ({
|
|
240
245
|
sm: "px-3 py-1.5 text-sm",
|
|
241
246
|
md: "px-4 py-2 text-sm",
|
|
242
247
|
lg: "px-5 py-3 text-base"
|
|
243
|
-
})), C = y(() =>
|
|
248
|
+
})), C = y(() => U(l())), b = y(() => [
|
|
244
249
|
"w-full rounded-md transition-colors duration-200",
|
|
245
250
|
"focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-surface",
|
|
246
251
|
"disabled:opacity-50 disabled:cursor-not-allowed disabled:bg-surface-disabled",
|
|
247
252
|
"resize-y",
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
].join(" ")),
|
|
251
|
-
function z(
|
|
252
|
-
const
|
|
253
|
-
a(
|
|
253
|
+
n(w)[i()],
|
|
254
|
+
n(C)
|
|
255
|
+
].join(" ")), f = y(() => "block text-sm font-medium text-primary mb-1");
|
|
256
|
+
function z(v) {
|
|
257
|
+
const m = v.target;
|
|
258
|
+
a(m.value), e.oninput && e.oninput(v);
|
|
254
259
|
}
|
|
255
|
-
var M =
|
|
260
|
+
var M = ue(), j = h(M);
|
|
256
261
|
{
|
|
257
|
-
var _ = (
|
|
258
|
-
var
|
|
259
|
-
|
|
260
|
-
var
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
}), x(
|
|
262
|
+
var _ = (v) => {
|
|
263
|
+
var m = de();
|
|
264
|
+
E(m, 1, O(n(f)));
|
|
265
|
+
var L = h(m);
|
|
266
|
+
P(() => {
|
|
267
|
+
G(m, "for", c), J(L, d());
|
|
268
|
+
}), x(v, m);
|
|
264
269
|
};
|
|
265
|
-
I(j, (
|
|
266
|
-
|
|
270
|
+
I(j, (v) => {
|
|
271
|
+
d() && v(_);
|
|
267
272
|
});
|
|
268
273
|
}
|
|
269
274
|
var B = N(j, 2);
|
|
270
|
-
|
|
275
|
+
V(B, () => ({
|
|
271
276
|
id: c,
|
|
272
277
|
name: o(),
|
|
273
278
|
value: a(),
|
|
274
|
-
placeholder:
|
|
275
|
-
disabled:
|
|
279
|
+
placeholder: g(),
|
|
280
|
+
disabled: u(),
|
|
276
281
|
rows: s(),
|
|
277
|
-
class:
|
|
282
|
+
class: n(b),
|
|
278
283
|
oninput: z,
|
|
279
284
|
...p
|
|
280
|
-
})), x(r, M),
|
|
285
|
+
})), x(r, M), F();
|
|
281
286
|
}
|
|
282
|
-
var
|
|
283
|
-
function
|
|
284
|
-
|
|
285
|
-
let a = t(e, "checked", 7, !1), o = t(e, "name", 3, ""),
|
|
287
|
+
var ce = k('<label class="text-sm font-medium cursor-pointer"> </label>'), ge = k('<div class="flex items-center gap-2"><input/> <!></div>');
|
|
288
|
+
function je(r, e) {
|
|
289
|
+
H(e, !0);
|
|
290
|
+
let a = t(e, "checked", 7, !1), o = t(e, "name", 3, ""), d = t(e, "disabled", 3, !1), g = t(e, "label", 3, ""), u = T(e, [
|
|
286
291
|
"$$slots",
|
|
287
292
|
"$$events",
|
|
288
293
|
"$$legacy",
|
|
@@ -290,27 +295,31 @@ function Ce(r, e) {
|
|
|
290
295
|
"name",
|
|
291
296
|
"disabled",
|
|
292
297
|
"label"
|
|
293
|
-
]), s =
|
|
298
|
+
]), s = q("");
|
|
299
|
+
R(() => {
|
|
300
|
+
D(s, K("checkbox"), !0);
|
|
301
|
+
});
|
|
302
|
+
let i = y(() => [
|
|
294
303
|
"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded",
|
|
295
304
|
"focus:ring-blue-500 focus:ring-2",
|
|
296
305
|
"disabled:opacity-50 disabled:cursor-not-allowed"
|
|
297
306
|
].join(" "));
|
|
298
|
-
function l(
|
|
299
|
-
const
|
|
300
|
-
a(
|
|
307
|
+
function l(b) {
|
|
308
|
+
const f = b.target;
|
|
309
|
+
a(f.checked);
|
|
301
310
|
}
|
|
302
|
-
var p =
|
|
303
|
-
|
|
311
|
+
var p = ge(), c = h(p);
|
|
312
|
+
V(
|
|
304
313
|
c,
|
|
305
314
|
() => ({
|
|
306
315
|
type: "checkbox",
|
|
307
|
-
id: s,
|
|
316
|
+
id: n(s),
|
|
308
317
|
name: o(),
|
|
309
318
|
checked: a(),
|
|
310
|
-
disabled:
|
|
311
|
-
class:
|
|
319
|
+
disabled: d(),
|
|
320
|
+
class: n(i),
|
|
312
321
|
onchange: l,
|
|
313
|
-
...
|
|
322
|
+
...u
|
|
314
323
|
}),
|
|
315
324
|
void 0,
|
|
316
325
|
void 0,
|
|
@@ -319,23 +328,23 @@ function Ce(r, e) {
|
|
|
319
328
|
);
|
|
320
329
|
var w = N(c, 2);
|
|
321
330
|
{
|
|
322
|
-
var C = (
|
|
323
|
-
var
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
}), x(
|
|
331
|
+
var C = (b) => {
|
|
332
|
+
var f = ce(), z = h(f);
|
|
333
|
+
P(() => {
|
|
334
|
+
G(f, "for", n(s)), J(z, g());
|
|
335
|
+
}), x(b, f);
|
|
327
336
|
};
|
|
328
|
-
I(w, (
|
|
329
|
-
|
|
337
|
+
I(w, (b) => {
|
|
338
|
+
g() && b(C);
|
|
330
339
|
});
|
|
331
340
|
}
|
|
332
|
-
x(r, p),
|
|
341
|
+
x(r, p), F();
|
|
333
342
|
}
|
|
334
|
-
async function
|
|
343
|
+
async function be(r, e, a) {
|
|
335
344
|
try {
|
|
336
|
-
await navigator.clipboard.writeText(e.code),
|
|
345
|
+
await navigator.clipboard.writeText(e.code), D(a, !0), setTimeout(
|
|
337
346
|
() => {
|
|
338
|
-
|
|
347
|
+
D(a, !1);
|
|
339
348
|
},
|
|
340
349
|
2e3
|
|
341
350
|
);
|
|
@@ -343,8 +352,8 @@ async function ce(r, e, a) {
|
|
|
343
352
|
console.error("Failed to copy code:", o);
|
|
344
353
|
}
|
|
345
354
|
}
|
|
346
|
-
var
|
|
347
|
-
const
|
|
355
|
+
var fe = Q('<svg class="w-4 h-4" fill="currentColor" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clip-rule="evenodd"></path></svg> Copied!', 1), ve = Q('<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"></path></svg> Copy', 1), me = k('<button class="flex items-center gap-2 px-3 py-1 text-xs text-gray-300 hover:text-white hover:bg-gray-700 rounded transition-colors duration-200" aria-label="Copy code to clipboard"><!></button>'), he = k('<div><div class="flex items-center justify-between px-4 py-2 bg-gray-800 border-b border-gray-700"><div class="flex items-center gap-2"><div class="w-3 h-3 rounded-full bg-red-500"></div> <div class="w-3 h-3 rounded-full bg-yellow-500"></div> <div class="w-3 h-3 rounded-full bg-green-500"></div></div> <!></div> <pre class="p-4 overflow-x-auto text-sm text-gray-100 leading-relaxed"><code><!></code></pre></div>');
|
|
356
|
+
const ye = {
|
|
348
357
|
hash: "svelte-1dmazsz",
|
|
349
358
|
code: `.code-block.svelte-1dmazsz {font-family:"Monaco", "Menlo", "Ubuntu Mono", monospace;}
|
|
350
359
|
|
|
@@ -356,9 +365,9 @@ const me = {
|
|
|
356
365
|
.language-typescript .token.string {color:#e6db74;}.language-javascript .token.function,
|
|
357
366
|
.language-typescript .token.function {color:#a6e22e;}`
|
|
358
367
|
};
|
|
359
|
-
function
|
|
360
|
-
|
|
361
|
-
let a = t(e, "language", 3, "svelte"), o = t(e, "className", 3, ""),
|
|
368
|
+
function Be(r, e) {
|
|
369
|
+
se(r, ye);
|
|
370
|
+
let a = t(e, "language", 3, "svelte"), o = t(e, "className", 3, ""), d = t(e, "showCopyButton", 3, !0), g = T(e, [
|
|
362
371
|
"$$slots",
|
|
363
372
|
"$$events",
|
|
364
373
|
"$$legacy",
|
|
@@ -366,57 +375,57 @@ function ze(r, e) {
|
|
|
366
375
|
"language",
|
|
367
376
|
"className",
|
|
368
377
|
"showCopyButton"
|
|
369
|
-
]),
|
|
370
|
-
var s =
|
|
371
|
-
|
|
378
|
+
]), u = q(!1);
|
|
379
|
+
var s = he();
|
|
380
|
+
V(
|
|
372
381
|
s,
|
|
373
382
|
() => ({
|
|
374
383
|
class: `code-block relative bg-gray-900 rounded-lg overflow-hidden ${o() ?? ""}`,
|
|
375
|
-
...
|
|
384
|
+
...g
|
|
376
385
|
}),
|
|
377
386
|
void 0,
|
|
378
387
|
void 0,
|
|
379
388
|
"svelte-1dmazsz"
|
|
380
389
|
);
|
|
381
|
-
var
|
|
390
|
+
var i = h(s), l = N(h(i), 2);
|
|
382
391
|
{
|
|
383
|
-
var p = (
|
|
384
|
-
var
|
|
385
|
-
|
|
386
|
-
var z = h(
|
|
392
|
+
var p = (b) => {
|
|
393
|
+
var f = me();
|
|
394
|
+
f.__click = [be, e, u];
|
|
395
|
+
var z = h(f);
|
|
387
396
|
{
|
|
388
397
|
var M = (_) => {
|
|
389
|
-
var B =
|
|
398
|
+
var B = fe();
|
|
390
399
|
x(_, B);
|
|
391
400
|
}, j = (_) => {
|
|
392
|
-
var B =
|
|
401
|
+
var B = ve();
|
|
393
402
|
x(_, B);
|
|
394
403
|
};
|
|
395
404
|
I(z, (_) => {
|
|
396
|
-
|
|
405
|
+
n(u) ? _(M) : _(j, !1);
|
|
397
406
|
});
|
|
398
407
|
}
|
|
399
|
-
x(
|
|
408
|
+
x(b, f);
|
|
400
409
|
};
|
|
401
|
-
I(l, (
|
|
402
|
-
|
|
410
|
+
I(l, (b) => {
|
|
411
|
+
d() && b(p);
|
|
403
412
|
});
|
|
404
413
|
}
|
|
405
|
-
var c = N(
|
|
406
|
-
|
|
414
|
+
var c = N(i, 2), w = h(c), C = h(w);
|
|
415
|
+
oe(C, () => e.code), P(() => E(w, 1, `language-${a() ?? ""}`, "svelte-1dmazsz")), x(r, s);
|
|
407
416
|
}
|
|
408
|
-
|
|
417
|
+
re(["click"]);
|
|
409
418
|
export {
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
419
|
+
we as B,
|
|
420
|
+
je as C,
|
|
421
|
+
ze as I,
|
|
422
|
+
Me as T,
|
|
423
|
+
Be as a,
|
|
424
|
+
_e as b,
|
|
425
|
+
S as c,
|
|
426
|
+
ke as d,
|
|
427
|
+
Ce as e,
|
|
428
|
+
se as f,
|
|
429
|
+
U as g,
|
|
430
|
+
oe as h
|
|
422
431
|
};
|