chirami 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +73 -0
- package/dist/chirami.d.ts +1 -0
- package/dist/chirami.js +507 -0
- package/dist/chirami.umd.cjs +6 -0
- package/dist/vite.svg +1 -0
- package/package.json +42 -0
package/README.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# React + TypeScript + Vite
|
|
2
|
+
|
|
3
|
+
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
|
|
4
|
+
|
|
5
|
+
Currently, two official plugins are available:
|
|
6
|
+
|
|
7
|
+
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) (or [oxc](https://oxc.rs) when used in [rolldown-vite](https://vite.dev/guide/rolldown)) for Fast Refresh
|
|
8
|
+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
|
|
9
|
+
|
|
10
|
+
## React Compiler
|
|
11
|
+
|
|
12
|
+
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).
|
|
13
|
+
|
|
14
|
+
## Expanding the ESLint configuration
|
|
15
|
+
|
|
16
|
+
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
|
|
17
|
+
|
|
18
|
+
```js
|
|
19
|
+
export default defineConfig([
|
|
20
|
+
globalIgnores(['dist']),
|
|
21
|
+
{
|
|
22
|
+
files: ['**/*.{ts,tsx}'],
|
|
23
|
+
extends: [
|
|
24
|
+
// Other configs...
|
|
25
|
+
|
|
26
|
+
// Remove tseslint.configs.recommended and replace with this
|
|
27
|
+
tseslint.configs.recommendedTypeChecked,
|
|
28
|
+
// Alternatively, use this for stricter rules
|
|
29
|
+
tseslint.configs.strictTypeChecked,
|
|
30
|
+
// Optionally, add this for stylistic rules
|
|
31
|
+
tseslint.configs.stylisticTypeChecked,
|
|
32
|
+
|
|
33
|
+
// Other configs...
|
|
34
|
+
],
|
|
35
|
+
languageOptions: {
|
|
36
|
+
parserOptions: {
|
|
37
|
+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
38
|
+
tsconfigRootDir: import.meta.dirname,
|
|
39
|
+
},
|
|
40
|
+
// other options...
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
])
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
|
|
47
|
+
|
|
48
|
+
```js
|
|
49
|
+
// eslint.config.js
|
|
50
|
+
import reactX from 'eslint-plugin-react-x'
|
|
51
|
+
import reactDom from 'eslint-plugin-react-dom'
|
|
52
|
+
|
|
53
|
+
export default defineConfig([
|
|
54
|
+
globalIgnores(['dist']),
|
|
55
|
+
{
|
|
56
|
+
files: ['**/*.{ts,tsx}'],
|
|
57
|
+
extends: [
|
|
58
|
+
// Other configs...
|
|
59
|
+
// Enable lint rules for React
|
|
60
|
+
reactX.configs['recommended-typescript'],
|
|
61
|
+
// Enable lint rules for React DOM
|
|
62
|
+
reactDom.configs.recommended,
|
|
63
|
+
],
|
|
64
|
+
languageOptions: {
|
|
65
|
+
parserOptions: {
|
|
66
|
+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
67
|
+
tsconfigRootDir: import.meta.dirname,
|
|
68
|
+
},
|
|
69
|
+
// other options...
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
])
|
|
73
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
package/dist/chirami.js
ADDED
|
@@ -0,0 +1,507 @@
|
|
|
1
|
+
import ae, { useState as L, useRef as ie, useEffect as D } from "react";
|
|
2
|
+
var y = { exports: {} }, g = {};
|
|
3
|
+
var W;
|
|
4
|
+
function le() {
|
|
5
|
+
if (W) return g;
|
|
6
|
+
W = 1;
|
|
7
|
+
var s = /* @__PURE__ */ Symbol.for("react.transitional.element"), n = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
8
|
+
function u(p, r, i) {
|
|
9
|
+
var f = null;
|
|
10
|
+
if (i !== void 0 && (f = "" + i), r.key !== void 0 && (f = "" + r.key), "key" in r) {
|
|
11
|
+
i = {};
|
|
12
|
+
for (var m in r)
|
|
13
|
+
m !== "key" && (i[m] = r[m]);
|
|
14
|
+
} else i = r;
|
|
15
|
+
return r = i.ref, {
|
|
16
|
+
$$typeof: s,
|
|
17
|
+
type: p,
|
|
18
|
+
key: f,
|
|
19
|
+
ref: r !== void 0 ? r : null,
|
|
20
|
+
props: i
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
return g.Fragment = n, g.jsx = u, g.jsxs = u, g;
|
|
24
|
+
}
|
|
25
|
+
var x = {};
|
|
26
|
+
var z;
|
|
27
|
+
function ce() {
|
|
28
|
+
return z || (z = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
29
|
+
function s(e) {
|
|
30
|
+
if (e == null) return null;
|
|
31
|
+
if (typeof e == "function")
|
|
32
|
+
return e.$$typeof === oe ? null : e.displayName || e.name || null;
|
|
33
|
+
if (typeof e == "string") return e;
|
|
34
|
+
switch (e) {
|
|
35
|
+
case R:
|
|
36
|
+
return "Fragment";
|
|
37
|
+
case G:
|
|
38
|
+
return "Profiler";
|
|
39
|
+
case Z:
|
|
40
|
+
return "StrictMode";
|
|
41
|
+
case K:
|
|
42
|
+
return "Suspense";
|
|
43
|
+
case ee:
|
|
44
|
+
return "SuspenseList";
|
|
45
|
+
case re:
|
|
46
|
+
return "Activity";
|
|
47
|
+
}
|
|
48
|
+
if (typeof e == "object")
|
|
49
|
+
switch (typeof e.tag == "number" && console.error(
|
|
50
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
51
|
+
), e.$$typeof) {
|
|
52
|
+
case q:
|
|
53
|
+
return "Portal";
|
|
54
|
+
case X:
|
|
55
|
+
return e.displayName || "Context";
|
|
56
|
+
case H:
|
|
57
|
+
return (e._context.displayName || "Context") + ".Consumer";
|
|
58
|
+
case Q:
|
|
59
|
+
var t = e.render;
|
|
60
|
+
return e = e.displayName, e || (e = t.displayName || t.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
61
|
+
case te:
|
|
62
|
+
return t = e.displayName || null, t !== null ? t : s(e.type) || "Memo";
|
|
63
|
+
case T:
|
|
64
|
+
t = e._payload, e = e._init;
|
|
65
|
+
try {
|
|
66
|
+
return s(e(t));
|
|
67
|
+
} catch {
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
function n(e) {
|
|
73
|
+
return "" + e;
|
|
74
|
+
}
|
|
75
|
+
function u(e) {
|
|
76
|
+
try {
|
|
77
|
+
n(e);
|
|
78
|
+
var t = !1;
|
|
79
|
+
} catch {
|
|
80
|
+
t = !0;
|
|
81
|
+
}
|
|
82
|
+
if (t) {
|
|
83
|
+
t = console;
|
|
84
|
+
var a = t.error, l = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
85
|
+
return a.call(
|
|
86
|
+
t,
|
|
87
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
88
|
+
l
|
|
89
|
+
), n(e);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
function p(e) {
|
|
93
|
+
if (e === R) return "<>";
|
|
94
|
+
if (typeof e == "object" && e !== null && e.$$typeof === T)
|
|
95
|
+
return "<...>";
|
|
96
|
+
try {
|
|
97
|
+
var t = s(e);
|
|
98
|
+
return t ? "<" + t + ">" : "<...>";
|
|
99
|
+
} catch {
|
|
100
|
+
return "<...>";
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
function r() {
|
|
104
|
+
var e = j.A;
|
|
105
|
+
return e === null ? null : e.getOwner();
|
|
106
|
+
}
|
|
107
|
+
function i() {
|
|
108
|
+
return Error("react-stack-top-frame");
|
|
109
|
+
}
|
|
110
|
+
function f(e) {
|
|
111
|
+
if (N.call(e, "key")) {
|
|
112
|
+
var t = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
113
|
+
if (t && t.isReactWarning) return !1;
|
|
114
|
+
}
|
|
115
|
+
return e.key !== void 0;
|
|
116
|
+
}
|
|
117
|
+
function m(e, t) {
|
|
118
|
+
function a() {
|
|
119
|
+
$ || ($ = !0, console.error(
|
|
120
|
+
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
121
|
+
t
|
|
122
|
+
));
|
|
123
|
+
}
|
|
124
|
+
a.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
125
|
+
get: a,
|
|
126
|
+
configurable: !0
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
function V() {
|
|
130
|
+
var e = s(this.type);
|
|
131
|
+
return I[e] || (I[e] = !0, console.error(
|
|
132
|
+
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
133
|
+
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
134
|
+
}
|
|
135
|
+
function J(e, t, a, l, w, k) {
|
|
136
|
+
var c = a.ref;
|
|
137
|
+
return e = {
|
|
138
|
+
$$typeof: P,
|
|
139
|
+
type: e,
|
|
140
|
+
key: t,
|
|
141
|
+
props: a,
|
|
142
|
+
_owner: l
|
|
143
|
+
}, (c !== void 0 ? c : null) !== null ? Object.defineProperty(e, "ref", {
|
|
144
|
+
enumerable: !1,
|
|
145
|
+
get: V
|
|
146
|
+
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
147
|
+
configurable: !1,
|
|
148
|
+
enumerable: !1,
|
|
149
|
+
writable: !0,
|
|
150
|
+
value: 0
|
|
151
|
+
}), Object.defineProperty(e, "_debugInfo", {
|
|
152
|
+
configurable: !1,
|
|
153
|
+
enumerable: !1,
|
|
154
|
+
writable: !0,
|
|
155
|
+
value: null
|
|
156
|
+
}), Object.defineProperty(e, "_debugStack", {
|
|
157
|
+
configurable: !1,
|
|
158
|
+
enumerable: !1,
|
|
159
|
+
writable: !0,
|
|
160
|
+
value: w
|
|
161
|
+
}), Object.defineProperty(e, "_debugTask", {
|
|
162
|
+
configurable: !1,
|
|
163
|
+
enumerable: !1,
|
|
164
|
+
writable: !0,
|
|
165
|
+
value: k
|
|
166
|
+
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
167
|
+
}
|
|
168
|
+
function C(e, t, a, l, w, k) {
|
|
169
|
+
var c = t.children;
|
|
170
|
+
if (c !== void 0)
|
|
171
|
+
if (l)
|
|
172
|
+
if (ne(c)) {
|
|
173
|
+
for (l = 0; l < c.length; l++)
|
|
174
|
+
O(c[l]);
|
|
175
|
+
Object.freeze && Object.freeze(c);
|
|
176
|
+
} else
|
|
177
|
+
console.error(
|
|
178
|
+
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
179
|
+
);
|
|
180
|
+
else O(c);
|
|
181
|
+
if (N.call(t, "key")) {
|
|
182
|
+
c = s(e);
|
|
183
|
+
var h = Object.keys(t).filter(function(se) {
|
|
184
|
+
return se !== "key";
|
|
185
|
+
});
|
|
186
|
+
l = 0 < h.length ? "{key: someKey, " + h.join(": ..., ") + ": ...}" : "{key: someKey}", F[c + l] || (h = 0 < h.length ? "{" + h.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
187
|
+
`A props object containing a "key" prop is being spread into JSX:
|
|
188
|
+
let props = %s;
|
|
189
|
+
<%s {...props} />
|
|
190
|
+
React keys must be passed directly to JSX without using spread:
|
|
191
|
+
let props = %s;
|
|
192
|
+
<%s key={someKey} {...props} />`,
|
|
193
|
+
l,
|
|
194
|
+
c,
|
|
195
|
+
h,
|
|
196
|
+
c
|
|
197
|
+
), F[c + l] = !0);
|
|
198
|
+
}
|
|
199
|
+
if (c = null, a !== void 0 && (u(a), c = "" + a), f(t) && (u(t.key), c = "" + t.key), "key" in t) {
|
|
200
|
+
a = {};
|
|
201
|
+
for (var S in t)
|
|
202
|
+
S !== "key" && (a[S] = t[S]);
|
|
203
|
+
} else a = t;
|
|
204
|
+
return c && m(
|
|
205
|
+
a,
|
|
206
|
+
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
207
|
+
), J(
|
|
208
|
+
e,
|
|
209
|
+
c,
|
|
210
|
+
a,
|
|
211
|
+
r(),
|
|
212
|
+
w,
|
|
213
|
+
k
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
function O(e) {
|
|
217
|
+
A(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === T && (e._payload.status === "fulfilled" ? A(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
218
|
+
}
|
|
219
|
+
function A(e) {
|
|
220
|
+
return typeof e == "object" && e !== null && e.$$typeof === P;
|
|
221
|
+
}
|
|
222
|
+
var _ = ae, P = /* @__PURE__ */ Symbol.for("react.transitional.element"), q = /* @__PURE__ */ Symbol.for("react.portal"), R = /* @__PURE__ */ Symbol.for("react.fragment"), Z = /* @__PURE__ */ Symbol.for("react.strict_mode"), G = /* @__PURE__ */ Symbol.for("react.profiler"), H = /* @__PURE__ */ Symbol.for("react.consumer"), X = /* @__PURE__ */ Symbol.for("react.context"), Q = /* @__PURE__ */ Symbol.for("react.forward_ref"), K = /* @__PURE__ */ Symbol.for("react.suspense"), ee = /* @__PURE__ */ Symbol.for("react.suspense_list"), te = /* @__PURE__ */ Symbol.for("react.memo"), T = /* @__PURE__ */ Symbol.for("react.lazy"), re = /* @__PURE__ */ Symbol.for("react.activity"), oe = /* @__PURE__ */ Symbol.for("react.client.reference"), j = _.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, N = Object.prototype.hasOwnProperty, ne = Array.isArray, v = console.createTask ? console.createTask : function() {
|
|
223
|
+
return null;
|
|
224
|
+
};
|
|
225
|
+
_ = {
|
|
226
|
+
react_stack_bottom_frame: function(e) {
|
|
227
|
+
return e();
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
var $, I = {}, M = _.react_stack_bottom_frame.bind(
|
|
231
|
+
_,
|
|
232
|
+
i
|
|
233
|
+
)(), Y = v(p(i)), F = {};
|
|
234
|
+
x.Fragment = R, x.jsx = function(e, t, a) {
|
|
235
|
+
var l = 1e4 > j.recentlyCreatedOwnerStacks++;
|
|
236
|
+
return C(
|
|
237
|
+
e,
|
|
238
|
+
t,
|
|
239
|
+
a,
|
|
240
|
+
!1,
|
|
241
|
+
l ? Error("react-stack-top-frame") : M,
|
|
242
|
+
l ? v(p(e)) : Y
|
|
243
|
+
);
|
|
244
|
+
}, x.jsxs = function(e, t, a) {
|
|
245
|
+
var l = 1e4 > j.recentlyCreatedOwnerStacks++;
|
|
246
|
+
return C(
|
|
247
|
+
e,
|
|
248
|
+
t,
|
|
249
|
+
a,
|
|
250
|
+
!0,
|
|
251
|
+
l ? Error("react-stack-top-frame") : M,
|
|
252
|
+
l ? v(p(e)) : Y
|
|
253
|
+
);
|
|
254
|
+
};
|
|
255
|
+
})()), x;
|
|
256
|
+
}
|
|
257
|
+
var B;
|
|
258
|
+
function ue() {
|
|
259
|
+
return B || (B = 1, process.env.NODE_ENV === "production" ? y.exports = le() : y.exports = ce()), y.exports;
|
|
260
|
+
}
|
|
261
|
+
var o = ue();
|
|
262
|
+
const fe = {
|
|
263
|
+
log: "#d4d4d4",
|
|
264
|
+
info: "#66e3f3",
|
|
265
|
+
warn: "#ffe267",
|
|
266
|
+
error: "#ff68ca"
|
|
267
|
+
}, d = {
|
|
268
|
+
container: {
|
|
269
|
+
position: "fixed",
|
|
270
|
+
bottom: 0,
|
|
271
|
+
left: 0,
|
|
272
|
+
width: "100%",
|
|
273
|
+
height: "300px",
|
|
274
|
+
backgroundColor: "#1e1e1e",
|
|
275
|
+
color: "#d4d4d4",
|
|
276
|
+
fontFamily: "monospace",
|
|
277
|
+
fontSize: "12px",
|
|
278
|
+
overflowY: "auto",
|
|
279
|
+
zIndex: 9999,
|
|
280
|
+
borderTop: "1px solid #333",
|
|
281
|
+
boxShadow: "0 -2px 10px rgba(0,0,0,0.3)"
|
|
282
|
+
},
|
|
283
|
+
header: {
|
|
284
|
+
display: "flex",
|
|
285
|
+
justifyContent: "space-between",
|
|
286
|
+
alignItems: "center",
|
|
287
|
+
padding: "4px 8px",
|
|
288
|
+
backgroundColor: "#333",
|
|
289
|
+
fontFamily: "system-ui",
|
|
290
|
+
fontWeight: "700",
|
|
291
|
+
position: "sticky",
|
|
292
|
+
top: 0
|
|
293
|
+
},
|
|
294
|
+
button: {
|
|
295
|
+
marginLeft: 8,
|
|
296
|
+
backgroundColor: "#ffffff11",
|
|
297
|
+
cursor: "pointer",
|
|
298
|
+
padding: 4
|
|
299
|
+
},
|
|
300
|
+
icon: {
|
|
301
|
+
width: "14px",
|
|
302
|
+
height: "14px",
|
|
303
|
+
marginRight: "-4px"
|
|
304
|
+
},
|
|
305
|
+
logo: {
|
|
306
|
+
width: "80px",
|
|
307
|
+
height: "14px"
|
|
308
|
+
},
|
|
309
|
+
logRow: {
|
|
310
|
+
padding: "4px 8px",
|
|
311
|
+
borderBottom: "1px solid #333",
|
|
312
|
+
whiteSpace: "pre-wrap",
|
|
313
|
+
wordBreak: "break-all"
|
|
314
|
+
},
|
|
315
|
+
logTimestamp: {
|
|
316
|
+
color: "#777",
|
|
317
|
+
fontFamily: "monospace",
|
|
318
|
+
marginRight: "1em"
|
|
319
|
+
},
|
|
320
|
+
milliSecond: {
|
|
321
|
+
fontSize: "10px"
|
|
322
|
+
},
|
|
323
|
+
logArgs: {
|
|
324
|
+
marginRight: "8px"
|
|
325
|
+
},
|
|
326
|
+
chiramiButton: {
|
|
327
|
+
position: "fixed",
|
|
328
|
+
bottom: "10px",
|
|
329
|
+
right: "10px",
|
|
330
|
+
zIndex: 9999,
|
|
331
|
+
padding: "0 8px",
|
|
332
|
+
backgroundColor: "#333",
|
|
333
|
+
opacity: "0.5",
|
|
334
|
+
color: "#ccc",
|
|
335
|
+
border: "none",
|
|
336
|
+
borderRadius: "12px",
|
|
337
|
+
boxShadow: "#00000033 1px 1px 2px 2px",
|
|
338
|
+
cursor: "pointer",
|
|
339
|
+
display: "flex",
|
|
340
|
+
alignItems: "center",
|
|
341
|
+
gap: "2px",
|
|
342
|
+
fontWeight: "400"
|
|
343
|
+
},
|
|
344
|
+
buttonIcon: {
|
|
345
|
+
width: "12px"
|
|
346
|
+
},
|
|
347
|
+
chiramiButtonCount: {
|
|
348
|
+
color: "#f40",
|
|
349
|
+
fontFamily: "monospace",
|
|
350
|
+
fontWeight: "700"
|
|
351
|
+
}
|
|
352
|
+
};
|
|
353
|
+
function b(s) {
|
|
354
|
+
return s.toString().padStart(2, "0");
|
|
355
|
+
}
|
|
356
|
+
function de(s) {
|
|
357
|
+
return s.toString().padStart(3, "0");
|
|
358
|
+
}
|
|
359
|
+
function pe(s) {
|
|
360
|
+
const n = new Date(s.getTime());
|
|
361
|
+
return /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
362
|
+
/* @__PURE__ */ o.jsx("span", { children: `${n.getFullYear()}-${b(n.getMonth() + 1)}-${b(n.getDay())} ${b(n.getHours())}:${b(n.getMinutes())}:${b(n.getSeconds())}` }),
|
|
363
|
+
/* @__PURE__ */ o.jsxs("span", { style: d.milliSecond, children: [
|
|
364
|
+
".",
|
|
365
|
+
de(n.getMilliseconds())
|
|
366
|
+
] })
|
|
367
|
+
] });
|
|
368
|
+
}
|
|
369
|
+
const U = (s) => /* @__PURE__ */ o.jsxs(
|
|
370
|
+
"svg",
|
|
371
|
+
{
|
|
372
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
373
|
+
viewBox: "0 0 2000 2000",
|
|
374
|
+
width: "32",
|
|
375
|
+
height: "32",
|
|
376
|
+
...s,
|
|
377
|
+
children: [
|
|
378
|
+
/* @__PURE__ */ o.jsx("rect", { fill: "#d4d4d4", x: ".5", y: ".5", width: "1785.85", height: "294.57" }),
|
|
379
|
+
/* @__PURE__ */ o.jsx("polygon", { fill: "#66e3f3", points: ".5 1743.03 .5 1448.47 1120.74 1448.47 950.67 1743.03 .5 1743.03" }),
|
|
380
|
+
/* @__PURE__ */ o.jsx("polygon", { fill: "#ffe267", points: ".5 1210.04 .5 915.47 1428.46 915.47 1258.39 1210.04 .5 1210.04" }),
|
|
381
|
+
/* @__PURE__ */ o.jsx("polygon", { fill: "#ff68ca", points: ".5 752.55 .5 457.99 1692.59 457.99 1522.52 752.55 .5 752.55" })
|
|
382
|
+
]
|
|
383
|
+
}
|
|
384
|
+
), me = (s) => /* @__PURE__ */ o.jsxs(
|
|
385
|
+
"svg",
|
|
386
|
+
{
|
|
387
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
388
|
+
viewBox: "0 0 1261.05 263.86",
|
|
389
|
+
width: "160",
|
|
390
|
+
height: "33.4781333",
|
|
391
|
+
fill: "currentColor",
|
|
392
|
+
...s,
|
|
393
|
+
children: [
|
|
394
|
+
/* @__PURE__ */ o.jsx("path", { d: "M171.23,173.27c-28.37,42.73-63.1,67.36-90,67.36-17.61,0-36.2-14.63-36.2-47.73,0-23.1,9.29-54.66,30.82-81.99,40.6-51.58,110.06-85.07,121.8-75.06,5.87,5,0,17.32-6.85,30.79-2.93,5.77-6.36,11.93-8.32,17.71-1.96,5-2.94,9.62-2.94,14.24,0,11.16,6.85,19.63,16.63,24.63,9.78,4.62,16.63.77,19.08-5.77,3.42-8.47,10.27-21.56,18.59-34.64,4.89-7.7,6.85-15.4,6.85-22.33,0-15.01-12.72-30.02-29.35-41.57-8.32-5.39-19.57-8.08-31.79-8.08s-25.92,2.69-38.64,6.54C85.63,37.01-1.92,106.68.03,184.43c.98,31.56,21.03,55.81,44.02,65.44,12.23,5.39,26.9,8.08,43.05,8.08,21.03,0,43.05-4.62,63.1-15.78,17.61-10.39,44.02-32.72,44.02-55.04,0-3.85-.98-8.47-3.42-12.7-4.89-8.85-16.14-6.54-19.57-1.15Z" }),
|
|
395
|
+
/* @__PURE__ */ o.jsx("path", { d: "M512.17,105.91c5.87-5.39,10.27-16.94,3.91-27.33-7.83-12.7-25.93-17.71-36.69-8.47-4.89,4.23-7.83,9.62-7.83,15.78,0,4.23,1.47,9.24,4.89,14.24,8.8,13.09,27.39,13.86,35.71,5.77Z" }),
|
|
396
|
+
/* @__PURE__ */ o.jsx("path", { d: "M1234.15,63.95c-11.25,0-21.52,10.01-21.52,20.79,0,11.93,13.21,23.48,28.86,23.48,12.23,0,19.57-8.85,19.57-19.25,0-11.16-13.21-25.02-26.9-25.02Z" }),
|
|
397
|
+
/* @__PURE__ */ o.jsx("path", { d: "M1236.6,192.9c-15.16,26.17-40.6,51.96-60.17,51.96-5.38,0-7.34-3.46-7.34-9.62s2.45-14.24,6.85-23.09c8.32-15.4,30.82-44.27,40.11-60.82,12.72-19.25,8.8-35.8-.49-43.5-6.36-5.77-12.23-5-19.57,2.69-15.88,17.56-41.93,54.09-56.34,80.99-.8.69-1.59,1.53-2.36,2.54-18.1,23.48-42.07,50.42-57.23,50.42-7.83,0-12.72-6.16-12.72-15.01,0-13.47,12.72-30.41,26.41-46.96,20.06-24.25,30.33-41.96,30.33-55.04s-7.83-23.1-22.01-23.48c-15.65-.38-41.58,12.7-63.59,28.1,0-16.17-10.27-30.02-25.92-30.02s-43.04,14.63-64.08,30.79c.98-3.85,1.47-7.31,1.47-10.39,0-6.16-2.45-12.7-6.85-18.48-4.89-6.93-12.23-7.31-18.59,0-26.46,31.75-57.14,77.4-70.91,103.44-15.4,20.49-34.77,38.59-49.42,38.59-4.89,0-6.85-3.46-6.85-9.24,0-25.79,41.09-67.75,53.81-88.92,12.72-20.02,8.32-36.95,0-44.65-5.87-5.39-14.19-5-20.06,2.69l-9.29,11.93c-4.4-10.01-15.16-16.94-32.77-16.94-24.95,0-65.06,18.09-104.19,62.36-9.02,9.85-15.71,20.31-20.11,30.39-.32.48-.64.99-.92,1.56-15.16,26.94-42.56,50.81-59.68,50.81-6.85,0-10.76-6.54-10.76-16.17,0-5.77,1.47-11.55,3.91-17.32,7.83-19.63,31.31-45.81,52.83-65.05,5.38-5.39,8.32-10.78,8.32-15.4,0-10.01-6.36-17.71-14.19-25.79-5.87-5.77-13.21-3.85-22.01.77-17.12,9.24-28.37,13.86-42.56,16.55,6.36-12.7,10.27-25.02,10.27-33.49s-3.91-12.7-14.19-12.7c-17.12,0-49.4,29.25-49.4,48.88,0,6.93,3.42,13.09,13.21,16.94-25.92,56.2-81.69,101.23-102.72,101.23-3.42,0-6.85-3.08-6.85-8.85,0-13.47,16.63-39.65,31.31-59.28,12.72-16.94,23.97-36.95,23.97-49.65,0-8.47-2.93-14.63-7.83-18.86-6.85-5.77-12.72-5-19.57,2.31-8.85,9.75-40.55,48.2-57.36,81.67-.69.63-1.31,1.37-1.82,2.24-14.67,23.48-40.6,50.81-57.72,50.81-6.85,0-9.29-5-9.29-13.09,0-6.16,1.96-14.24,6.36-22.71,5.38-9.24,17.61-25.41,44.51-63.13,3.91-5.39,5.38-10.78,5.38-16.17,0-15.01-14.19-26.94-28.37-26.94-9.29,0-26.41,4.62-41.09,13.09,4.89-5.39,35.22-41.19,45-53.89,11.74-16.17,17.61-30.41,17.61-40.8,0-5.39-1.47-10.39-3.91-14.63-4.4-7.7-11.74-9.24-19.57-1.54-39.62,40.03-136.47,168.98-156.04,209.4-12.23,25.4-5.38,34.64,2.45,41.96,5.87,5.77,13.21,4.62,17.12-2.31,11.74-23.1,29.35-49.65,45.98-71.21,25.93-33.1,72.39-57.35,76.8-57.35,3.42,0-3.91,9.24-13.21,21.94-18.59,22.71-42.56,56.2-42.56,80.45,0,20.02,14.67,32.72,46.96,32.72,20.75,0,41.7-8.46,57.61-20.66,4.68,12.06,16.51,20.27,36.31,20.27,53.81,0,103.7-50.42,138.92-113.55,11.25-.38,24.46-2.31,38.15-7.31-19.57,18.09-37.18,38.49-48.43,61.2-3.42,8.08-4.89,15.01-4.89,21.17,0,22.33,17.12,38.88,47.94,38.88,20.68,0,45.13-8.31,61.83-21.66,6.4,12.72,20.14,20.88,40.4,20.88s41.58-11.93,55.76-22.71c3.91,14.24,18.1,24.25,42.56,24.25,15.57,0,31.54-5.56,45.06-13.89,2.09,4.04,5.34,7.41,9.23,10.04,8.32,5.77,13.7,3.46,17.12-2.69,19.08-35.41,41.58-70.44,68.97-93.54,29.35-25.4,48.43-33.87,52.34-33.87,4.4,0-9.29,14.63-22.5,31.95-13.21,16.17-29.35,36.95-36.2,50.81-4.89,9.62-8.8,21.94-8.8,28.48,0,10.01,3.42,15.4,10.76,21.17,7.83,6.16,14.67,5,19.57-2.31,20.54-35.8,44.02-72.36,82.18-102.39,28.86-22.71,39.13-26.56,43.05-26.56s-7.83,11.55-18.59,24.25c-11.25,13.86-27.39,34.64-35.22,47.73-5.38,9.62-7.34,18.09-7.34,25.02,0,20.79,18.1,35.03,51.36,35.03,20.03,0,41.97-8.4,58.52-20.53,4.91,12.28,17.99,20.14,40.78,20.14,28.86,0,62.61-16.17,77.29-40.42,6.36-10.01,6.85-19.63,2.45-26.17-4.4-6.93-10.76-7.7-14.67-.77ZM709.29,242.94c-4.89,0-6.85-4.62-6.85-11.55,0-12.32,8.32-32.72,22.99-50.81,24.95-31.56,58.7-55.81,68.48-55.81,4.89,0,5.87,2.69,5.87,7.31,0,10.01-8.8,28.87-27.88,55.04-23.97,32.33-46.47,55.81-62.61,55.81Z" })
|
|
398
|
+
]
|
|
399
|
+
}
|
|
400
|
+
);
|
|
401
|
+
class he {
|
|
402
|
+
logs = [];
|
|
403
|
+
totalCount = 0;
|
|
404
|
+
listeners = /* @__PURE__ */ new Set();
|
|
405
|
+
originalConsole = {
|
|
406
|
+
log: console.log,
|
|
407
|
+
info: console.info,
|
|
408
|
+
warn: console.warn,
|
|
409
|
+
error: console.error
|
|
410
|
+
};
|
|
411
|
+
isPatched = !1;
|
|
412
|
+
init() {
|
|
413
|
+
this.isPatched || (["log", "info", "warn", "error"].forEach((n) => {
|
|
414
|
+
console[n] = (...u) => {
|
|
415
|
+
this.originalConsole[n].apply(console, u), this.addLog(n, u);
|
|
416
|
+
};
|
|
417
|
+
}), this.totalCount = 0, this.isPatched = !0);
|
|
418
|
+
}
|
|
419
|
+
addLog(n, u) {
|
|
420
|
+
const p = {
|
|
421
|
+
id: Math.random().toString(36).slice(2),
|
|
422
|
+
type: n,
|
|
423
|
+
args: u,
|
|
424
|
+
timestamp: Date.now()
|
|
425
|
+
};
|
|
426
|
+
this.logs = [...this.logs.slice(-3), p], this.totalCount = this.totalCount + 1, this.notify();
|
|
427
|
+
}
|
|
428
|
+
subscribe(n) {
|
|
429
|
+
return this.listeners.add(n), n(this.logs), () => {
|
|
430
|
+
this.listeners.delete(n);
|
|
431
|
+
};
|
|
432
|
+
}
|
|
433
|
+
notify() {
|
|
434
|
+
this.listeners.forEach((n) => n(this.logs));
|
|
435
|
+
}
|
|
436
|
+
getLogs() {
|
|
437
|
+
return this.logs;
|
|
438
|
+
}
|
|
439
|
+
getTotalCount() {
|
|
440
|
+
return this.totalCount;
|
|
441
|
+
}
|
|
442
|
+
clear() {
|
|
443
|
+
this.logs = [], this.notify();
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
const E = new he();
|
|
447
|
+
function ge(s, n = 2) {
|
|
448
|
+
const u = /* @__PURE__ */ new WeakSet();
|
|
449
|
+
return JSON.stringify(s, (p, r) => {
|
|
450
|
+
if (r === null || typeof r != "object")
|
|
451
|
+
return r;
|
|
452
|
+
if (u.has(r))
|
|
453
|
+
return "[Circular]";
|
|
454
|
+
if (u.add(r), typeof HTMLElement < "u" && r instanceof HTMLElement) {
|
|
455
|
+
const i = r.id ? `#${r.id}` : "", f = r.className ? `.${r.className.split(" ").join(".")}` : "";
|
|
456
|
+
return `<${r.tagName.toLowerCase()}${i}${f}>`;
|
|
457
|
+
}
|
|
458
|
+
return r instanceof Error ? { message: r.message, stack: r.stack } : r;
|
|
459
|
+
}, n);
|
|
460
|
+
}
|
|
461
|
+
const be = () => {
|
|
462
|
+
const [s, n] = L([]), [u, p] = L(!1), r = ie(null);
|
|
463
|
+
return D(() => {
|
|
464
|
+
E.init();
|
|
465
|
+
const i = E.subscribe((f) => {
|
|
466
|
+
n(f);
|
|
467
|
+
});
|
|
468
|
+
return () => i();
|
|
469
|
+
}, []), D(() => {
|
|
470
|
+
u && r.current && r.current.scrollIntoView({ behavior: "smooth" });
|
|
471
|
+
}, [s, u]), u ? /* @__PURE__ */ o.jsxs("div", { style: d.container, children: [
|
|
472
|
+
/* @__PURE__ */ o.jsxs("div", { style: d.header, children: [
|
|
473
|
+
/* @__PURE__ */ o.jsxs("span", { children: [
|
|
474
|
+
/* @__PURE__ */ o.jsx(U, { style: d.icon }),
|
|
475
|
+
/* @__PURE__ */ o.jsx(me, { style: d.logo }),
|
|
476
|
+
" (",
|
|
477
|
+
E.getTotalCount(),
|
|
478
|
+
")"
|
|
479
|
+
] }),
|
|
480
|
+
/* @__PURE__ */ o.jsxs("div", { children: [
|
|
481
|
+
/* @__PURE__ */ o.jsx("button", { onClick: () => E.clear(), style: d.button, children: "Clear" }),
|
|
482
|
+
/* @__PURE__ */ o.jsx("button", { onClick: () => p(!1), style: d.button, children: "Close ▼" })
|
|
483
|
+
] })
|
|
484
|
+
] }),
|
|
485
|
+
/* @__PURE__ */ o.jsxs("div", { children: [
|
|
486
|
+
s.map((i) => /* @__PURE__ */ o.jsxs("div", { style: { ...d.logRow, color: fe[i.type] }, children: [
|
|
487
|
+
/* @__PURE__ */ o.jsx("span", { style: d.logTimestamp, children: pe(new Date(i.timestamp)) }),
|
|
488
|
+
i.args.map((f, m) => /* @__PURE__ */ o.jsx("span", { style: d.logArgs, children: typeof f == "object" ? ge(f) : String(f) }, `log-args-${m}`))
|
|
489
|
+
] }, i.id)),
|
|
490
|
+
/* @__PURE__ */ o.jsx("div", { ref: r })
|
|
491
|
+
] })
|
|
492
|
+
] }) : /* @__PURE__ */ o.jsxs(
|
|
493
|
+
"button",
|
|
494
|
+
{
|
|
495
|
+
style: d.chiramiButton,
|
|
496
|
+
onClick: () => p(!0),
|
|
497
|
+
children: [
|
|
498
|
+
/* @__PURE__ */ o.jsx(U, { style: d.buttonIcon }),
|
|
499
|
+
/* @__PURE__ */ o.jsx("span", { style: d.chiramiButtonCount, children: E.getTotalCount() })
|
|
500
|
+
]
|
|
501
|
+
}
|
|
502
|
+
);
|
|
503
|
+
};
|
|
504
|
+
export {
|
|
505
|
+
be as ChiramiViewer,
|
|
506
|
+
E as chiramiStore
|
|
507
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
(function(h,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],m):(h=typeof globalThis<"u"?globalThis:h||self,m(h.Chirami={},h.React))})(this,(function(h,m){"use strict";var w={exports:{}},E={};var P;function U(){if(P)return E;P=1;var s=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function u(p,r,a){var d=null;if(a!==void 0&&(d=""+a),r.key!==void 0&&(d=""+r.key),"key"in r){a={};for(var g in r)g!=="key"&&(a[g]=r[g])}else a=r;return r=a.ref,{$$typeof:s,type:p,key:d,ref:r!==void 0?r:null,props:a}}return E.Fragment=n,E.jsx=u,E.jsxs=u,E}var y={};var A;function J(){return A||(A=1,process.env.NODE_ENV!=="production"&&(function(){function s(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===pe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case j:return"Fragment";case se:return"Profiler";case ne:return"StrictMode";case ce:return"Suspense";case ue:return"SuspenseList";case de:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case oe:return"Portal";case ae:return e.displayName||"Context";case ie:return(e._context.displayName||"Context")+".Consumer";case le:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case fe:return t=e.displayName||null,t!==null?t:s(e.type)||"Memo";case v:t=e._payload,e=e._init;try{return s(e(t))}catch{}}return null}function n(e){return""+e}function u(e){try{n(e);var t=!1}catch{t=!0}if(t){t=console;var i=t.error,l=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return i.call(t,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",l),n(e)}}function p(e){if(e===j)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===v)return"<...>";try{var t=s(e);return t?"<"+t+">":"<...>"}catch{return"<...>"}}function r(){var e=S.A;return e===null?null:e.getOwner()}function a(){return Error("react-stack-top-frame")}function d(e){if(D.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function g(e,t){function i(){$||($=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",t))}i.isReactWarning=!0,Object.defineProperty(e,"key",{get:i,configurable:!0})}function te(){var e=s(this.type);return W[e]||(W[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function re(e,t,i,l,T,C){var c=i.ref;return e={$$typeof:L,type:e,key:t,props:i,_owner:l},(c!==void 0?c:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:te}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:T}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:C}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function M(e,t,i,l,T,C){var c=t.children;if(c!==void 0)if(l)if(me(c)){for(l=0;l<c.length;l++)Y(c[l]);Object.freeze&&Object.freeze(c)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Y(c);if(D.call(t,"key")){c=s(e);var b=Object.keys(t).filter(function(he){return he!=="key"});l=0<b.length?"{key: someKey, "+b.join(": ..., ")+": ...}":"{key: someKey}",B[c+l]||(b=0<b.length?"{"+b.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
2
|
+
let props = %s;
|
|
3
|
+
<%s {...props} />
|
|
4
|
+
React keys must be passed directly to JSX without using spread:
|
|
5
|
+
let props = %s;
|
|
6
|
+
<%s key={someKey} {...props} />`,l,c,b,c),B[c+l]=!0)}if(c=null,i!==void 0&&(u(i),c=""+i),d(t)&&(u(t.key),c=""+t.key),"key"in t){i={};for(var O in t)O!=="key"&&(i[O]=t[O])}else i=t;return c&&g(i,typeof e=="function"?e.displayName||e.name||"Unknown":e),re(e,c,i,r(),T,C)}function Y(e){F(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===v&&(e._payload.status==="fulfilled"?F(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function F(e){return typeof e=="object"&&e!==null&&e.$$typeof===L}var R=m,L=Symbol.for("react.transitional.element"),oe=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),ne=Symbol.for("react.strict_mode"),se=Symbol.for("react.profiler"),ie=Symbol.for("react.consumer"),ae=Symbol.for("react.context"),le=Symbol.for("react.forward_ref"),ce=Symbol.for("react.suspense"),ue=Symbol.for("react.suspense_list"),fe=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),de=Symbol.for("react.activity"),pe=Symbol.for("react.client.reference"),S=R.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,D=Object.prototype.hasOwnProperty,me=Array.isArray,k=console.createTask?console.createTask:function(){return null};R={react_stack_bottom_frame:function(e){return e()}};var $,W={},z=R.react_stack_bottom_frame.bind(R,a)(),V=k(p(a)),B={};y.Fragment=j,y.jsx=function(e,t,i){var l=1e4>S.recentlyCreatedOwnerStacks++;return M(e,t,i,!1,l?Error("react-stack-top-frame"):z,l?k(p(e)):V)},y.jsxs=function(e,t,i){var l=1e4>S.recentlyCreatedOwnerStacks++;return M(e,t,i,!0,l?Error("react-stack-top-frame"):z,l?k(p(e)):V)}})()),y}var N;function Z(){return N||(N=1,process.env.NODE_ENV==="production"?w.exports=U():w.exports=J()),w.exports}var o=Z();const G={log:"#d4d4d4",info:"#66e3f3",warn:"#ffe267",error:"#ff68ca"},f={container:{position:"fixed",bottom:0,left:0,width:"100%",height:"300px",backgroundColor:"#1e1e1e",color:"#d4d4d4",fontFamily:"monospace",fontSize:"12px",overflowY:"auto",zIndex:9999,borderTop:"1px solid #333",boxShadow:"0 -2px 10px rgba(0,0,0,0.3)"},header:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"4px 8px",backgroundColor:"#333",fontFamily:"system-ui",fontWeight:"700",position:"sticky",top:0},button:{marginLeft:8,backgroundColor:"#ffffff11",cursor:"pointer",padding:4},icon:{width:"14px",height:"14px",marginRight:"-4px"},logo:{width:"80px",height:"14px"},logRow:{padding:"4px 8px",borderBottom:"1px solid #333",whiteSpace:"pre-wrap",wordBreak:"break-all"},logTimestamp:{color:"#777",fontFamily:"monospace",marginRight:"1em"},milliSecond:{fontSize:"10px"},logArgs:{marginRight:"8px"},chiramiButton:{position:"fixed",bottom:"10px",right:"10px",zIndex:9999,padding:"0 8px",backgroundColor:"#333",opacity:"0.5",color:"#ccc",border:"none",borderRadius:"12px",boxShadow:"#00000033 1px 1px 2px 2px",cursor:"pointer",display:"flex",alignItems:"center",gap:"2px",fontWeight:"400"},buttonIcon:{width:"12px"},chiramiButtonCount:{color:"#f40",fontFamily:"monospace",fontWeight:"700"}};function _(s){return s.toString().padStart(2,"0")}function H(s){return s.toString().padStart(3,"0")}function X(s){const n=new Date(s.getTime());return o.jsxs(o.Fragment,{children:[o.jsx("span",{children:`${n.getFullYear()}-${_(n.getMonth()+1)}-${_(n.getDay())} ${_(n.getHours())}:${_(n.getMinutes())}:${_(n.getSeconds())}`}),o.jsxs("span",{style:f.milliSecond,children:[".",H(n.getMilliseconds())]})]})}const I=s=>o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2000 2000",width:"32",height:"32",...s,children:[o.jsx("rect",{fill:"#d4d4d4",x:".5",y:".5",width:"1785.85",height:"294.57"}),o.jsx("polygon",{fill:"#66e3f3",points:".5 1743.03 .5 1448.47 1120.74 1448.47 950.67 1743.03 .5 1743.03"}),o.jsx("polygon",{fill:"#ffe267",points:".5 1210.04 .5 915.47 1428.46 915.47 1258.39 1210.04 .5 1210.04"}),o.jsx("polygon",{fill:"#ff68ca",points:".5 752.55 .5 457.99 1692.59 457.99 1522.52 752.55 .5 752.55"})]}),q=s=>o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1261.05 263.86",width:"160",height:"33.4781333",fill:"currentColor",...s,children:[o.jsx("path",{d:"M171.23,173.27c-28.37,42.73-63.1,67.36-90,67.36-17.61,0-36.2-14.63-36.2-47.73,0-23.1,9.29-54.66,30.82-81.99,40.6-51.58,110.06-85.07,121.8-75.06,5.87,5,0,17.32-6.85,30.79-2.93,5.77-6.36,11.93-8.32,17.71-1.96,5-2.94,9.62-2.94,14.24,0,11.16,6.85,19.63,16.63,24.63,9.78,4.62,16.63.77,19.08-5.77,3.42-8.47,10.27-21.56,18.59-34.64,4.89-7.7,6.85-15.4,6.85-22.33,0-15.01-12.72-30.02-29.35-41.57-8.32-5.39-19.57-8.08-31.79-8.08s-25.92,2.69-38.64,6.54C85.63,37.01-1.92,106.68.03,184.43c.98,31.56,21.03,55.81,44.02,65.44,12.23,5.39,26.9,8.08,43.05,8.08,21.03,0,43.05-4.62,63.1-15.78,17.61-10.39,44.02-32.72,44.02-55.04,0-3.85-.98-8.47-3.42-12.7-4.89-8.85-16.14-6.54-19.57-1.15Z"}),o.jsx("path",{d:"M512.17,105.91c5.87-5.39,10.27-16.94,3.91-27.33-7.83-12.7-25.93-17.71-36.69-8.47-4.89,4.23-7.83,9.62-7.83,15.78,0,4.23,1.47,9.24,4.89,14.24,8.8,13.09,27.39,13.86,35.71,5.77Z"}),o.jsx("path",{d:"M1234.15,63.95c-11.25,0-21.52,10.01-21.52,20.79,0,11.93,13.21,23.48,28.86,23.48,12.23,0,19.57-8.85,19.57-19.25,0-11.16-13.21-25.02-26.9-25.02Z"}),o.jsx("path",{d:"M1236.6,192.9c-15.16,26.17-40.6,51.96-60.17,51.96-5.38,0-7.34-3.46-7.34-9.62s2.45-14.24,6.85-23.09c8.32-15.4,30.82-44.27,40.11-60.82,12.72-19.25,8.8-35.8-.49-43.5-6.36-5.77-12.23-5-19.57,2.69-15.88,17.56-41.93,54.09-56.34,80.99-.8.69-1.59,1.53-2.36,2.54-18.1,23.48-42.07,50.42-57.23,50.42-7.83,0-12.72-6.16-12.72-15.01,0-13.47,12.72-30.41,26.41-46.96,20.06-24.25,30.33-41.96,30.33-55.04s-7.83-23.1-22.01-23.48c-15.65-.38-41.58,12.7-63.59,28.1,0-16.17-10.27-30.02-25.92-30.02s-43.04,14.63-64.08,30.79c.98-3.85,1.47-7.31,1.47-10.39,0-6.16-2.45-12.7-6.85-18.48-4.89-6.93-12.23-7.31-18.59,0-26.46,31.75-57.14,77.4-70.91,103.44-15.4,20.49-34.77,38.59-49.42,38.59-4.89,0-6.85-3.46-6.85-9.24,0-25.79,41.09-67.75,53.81-88.92,12.72-20.02,8.32-36.95,0-44.65-5.87-5.39-14.19-5-20.06,2.69l-9.29,11.93c-4.4-10.01-15.16-16.94-32.77-16.94-24.95,0-65.06,18.09-104.19,62.36-9.02,9.85-15.71,20.31-20.11,30.39-.32.48-.64.99-.92,1.56-15.16,26.94-42.56,50.81-59.68,50.81-6.85,0-10.76-6.54-10.76-16.17,0-5.77,1.47-11.55,3.91-17.32,7.83-19.63,31.31-45.81,52.83-65.05,5.38-5.39,8.32-10.78,8.32-15.4,0-10.01-6.36-17.71-14.19-25.79-5.87-5.77-13.21-3.85-22.01.77-17.12,9.24-28.37,13.86-42.56,16.55,6.36-12.7,10.27-25.02,10.27-33.49s-3.91-12.7-14.19-12.7c-17.12,0-49.4,29.25-49.4,48.88,0,6.93,3.42,13.09,13.21,16.94-25.92,56.2-81.69,101.23-102.72,101.23-3.42,0-6.85-3.08-6.85-8.85,0-13.47,16.63-39.65,31.31-59.28,12.72-16.94,23.97-36.95,23.97-49.65,0-8.47-2.93-14.63-7.83-18.86-6.85-5.77-12.72-5-19.57,2.31-8.85,9.75-40.55,48.2-57.36,81.67-.69.63-1.31,1.37-1.82,2.24-14.67,23.48-40.6,50.81-57.72,50.81-6.85,0-9.29-5-9.29-13.09,0-6.16,1.96-14.24,6.36-22.71,5.38-9.24,17.61-25.41,44.51-63.13,3.91-5.39,5.38-10.78,5.38-16.17,0-15.01-14.19-26.94-28.37-26.94-9.29,0-26.41,4.62-41.09,13.09,4.89-5.39,35.22-41.19,45-53.89,11.74-16.17,17.61-30.41,17.61-40.8,0-5.39-1.47-10.39-3.91-14.63-4.4-7.7-11.74-9.24-19.57-1.54-39.62,40.03-136.47,168.98-156.04,209.4-12.23,25.4-5.38,34.64,2.45,41.96,5.87,5.77,13.21,4.62,17.12-2.31,11.74-23.1,29.35-49.65,45.98-71.21,25.93-33.1,72.39-57.35,76.8-57.35,3.42,0-3.91,9.24-13.21,21.94-18.59,22.71-42.56,56.2-42.56,80.45,0,20.02,14.67,32.72,46.96,32.72,20.75,0,41.7-8.46,57.61-20.66,4.68,12.06,16.51,20.27,36.31,20.27,53.81,0,103.7-50.42,138.92-113.55,11.25-.38,24.46-2.31,38.15-7.31-19.57,18.09-37.18,38.49-48.43,61.2-3.42,8.08-4.89,15.01-4.89,21.17,0,22.33,17.12,38.88,47.94,38.88,20.68,0,45.13-8.31,61.83-21.66,6.4,12.72,20.14,20.88,40.4,20.88s41.58-11.93,55.76-22.71c3.91,14.24,18.1,24.25,42.56,24.25,15.57,0,31.54-5.56,45.06-13.89,2.09,4.04,5.34,7.41,9.23,10.04,8.32,5.77,13.7,3.46,17.12-2.69,19.08-35.41,41.58-70.44,68.97-93.54,29.35-25.4,48.43-33.87,52.34-33.87,4.4,0-9.29,14.63-22.5,31.95-13.21,16.17-29.35,36.95-36.2,50.81-4.89,9.62-8.8,21.94-8.8,28.48,0,10.01,3.42,15.4,10.76,21.17,7.83,6.16,14.67,5,19.57-2.31,20.54-35.8,44.02-72.36,82.18-102.39,28.86-22.71,39.13-26.56,43.05-26.56s-7.83,11.55-18.59,24.25c-11.25,13.86-27.39,34.64-35.22,47.73-5.38,9.62-7.34,18.09-7.34,25.02,0,20.79,18.1,35.03,51.36,35.03,20.03,0,41.97-8.4,58.52-20.53,4.91,12.28,17.99,20.14,40.78,20.14,28.86,0,62.61-16.17,77.29-40.42,6.36-10.01,6.85-19.63,2.45-26.17-4.4-6.93-10.76-7.7-14.67-.77ZM709.29,242.94c-4.89,0-6.85-4.62-6.85-11.55,0-12.32,8.32-32.72,22.99-50.81,24.95-31.56,58.7-55.81,68.48-55.81,4.89,0,5.87,2.69,5.87,7.31,0,10.01-8.8,28.87-27.88,55.04-23.97,32.33-46.47,55.81-62.61,55.81Z"})]});class Q{logs=[];totalCount=0;listeners=new Set;originalConsole={log:console.log,info:console.info,warn:console.warn,error:console.error};isPatched=!1;init(){this.isPatched||(["log","info","warn","error"].forEach(n=>{console[n]=(...u)=>{this.originalConsole[n].apply(console,u),this.addLog(n,u)}}),this.totalCount=0,this.isPatched=!0)}addLog(n,u){const p={id:Math.random().toString(36).slice(2),type:n,args:u,timestamp:Date.now()};this.logs=[...this.logs.slice(-3),p],this.totalCount=this.totalCount+1,this.notify()}subscribe(n){return this.listeners.add(n),n(this.logs),()=>{this.listeners.delete(n)}}notify(){this.listeners.forEach(n=>n(this.logs))}getLogs(){return this.logs}getTotalCount(){return this.totalCount}clear(){this.logs=[],this.notify()}}const x=new Q;function K(s,n=2){const u=new WeakSet;return JSON.stringify(s,(p,r)=>{if(r===null||typeof r!="object")return r;if(u.has(r))return"[Circular]";if(u.add(r),typeof HTMLElement<"u"&&r instanceof HTMLElement){const a=r.id?`#${r.id}`:"",d=r.className?`.${r.className.split(" ").join(".")}`:"";return`<${r.tagName.toLowerCase()}${a}${d}>`}return r instanceof Error?{message:r.message,stack:r.stack}:r},n)}const ee=()=>{const[s,n]=m.useState([]),[u,p]=m.useState(!1),r=m.useRef(null);return m.useEffect(()=>{x.init();const a=x.subscribe(d=>{n(d)});return()=>a()},[]),m.useEffect(()=>{u&&r.current&&r.current.scrollIntoView({behavior:"smooth"})},[s,u]),u?o.jsxs("div",{style:f.container,children:[o.jsxs("div",{style:f.header,children:[o.jsxs("span",{children:[o.jsx(I,{style:f.icon}),o.jsx(q,{style:f.logo})," (",x.getTotalCount(),")"]}),o.jsxs("div",{children:[o.jsx("button",{onClick:()=>x.clear(),style:f.button,children:"Clear"}),o.jsx("button",{onClick:()=>p(!1),style:f.button,children:"Close ▼"})]})]}),o.jsxs("div",{children:[s.map(a=>o.jsxs("div",{style:{...f.logRow,color:G[a.type]},children:[o.jsx("span",{style:f.logTimestamp,children:X(new Date(a.timestamp))}),a.args.map((d,g)=>o.jsx("span",{style:f.logArgs,children:typeof d=="object"?K(d):String(d)},`log-args-${g}`))]},a.id)),o.jsx("div",{ref:r})]})]}):o.jsxs("button",{style:f.chiramiButton,onClick:()=>p(!0),children:[o.jsx(I,{style:f.buttonIcon}),o.jsx("span",{style:f.chiramiButtonCount,children:x.getTotalCount()})]})};h.ChiramiViewer=ee,h.chiramiStore=x,Object.defineProperty(h,Symbol.toStringTag,{value:"Module"})}));
|
package/dist/vite.svg
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "chirami",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"files": [
|
|
6
|
+
"dist"
|
|
7
|
+
],
|
|
8
|
+
"main": "./dist/chirami.umd.cjs",
|
|
9
|
+
"module": "./dist/chirami.js",
|
|
10
|
+
"types": "./dist/chirami.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/chirami.d.ts",
|
|
14
|
+
"import": "./dist/chirami.js",
|
|
15
|
+
"require": "./dist/chirami.umd.cjs"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"dev": "vite --open",
|
|
20
|
+
"build": "tsc && vite build",
|
|
21
|
+
"preview": "vite preview"
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"react": "^19.2.0",
|
|
25
|
+
"react-dom": "^19.2.0"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@eslint/js": "^9.39.1",
|
|
29
|
+
"@types/node": "^24.10.13",
|
|
30
|
+
"@types/react": "^19.2.7",
|
|
31
|
+
"@types/react-dom": "^19.2.3",
|
|
32
|
+
"@vitejs/plugin-react": "^5.1.1",
|
|
33
|
+
"eslint": "^9.39.1",
|
|
34
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
35
|
+
"eslint-plugin-react-refresh": "^0.4.24",
|
|
36
|
+
"globals": "^16.5.0",
|
|
37
|
+
"typescript": "~5.9.3",
|
|
38
|
+
"typescript-eslint": "^8.48.0",
|
|
39
|
+
"vite": "^7.3.1",
|
|
40
|
+
"vite-plugin-dts": "^4.5.4"
|
|
41
|
+
}
|
|
42
|
+
}
|