@krak-stack/registry 0.11.1 → 0.11.3
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/CHANGELOG.md +14 -0
- package/README.md +22 -0
- package/dist/components/agent/react.js +29 -183
- package/dist/components/animated-list/html.js +1 -105
- package/dist/components/animated-list/react.js +16 -168
- package/dist/components/animated-number/react.js +8 -162
- package/dist/components/app-switcher/html.js +1 -103
- package/dist/components/async-action-button/html.js +1 -101
- package/dist/components/async-action-button/react.js +10 -164
- package/dist/components/audit-log-table/react.js +59 -213
- package/dist/components/bulk-list-input/html.js +2 -102
- package/dist/components/choice-cards/html.js +1 -101
- package/dist/components/code-block/html.js +1 -101
- package/dist/components/code-block/react.js +10 -164
- package/dist/components/copy-button/html.d.ts +2 -2
- package/dist/components/copy-button/html.js +1 -101
- package/dist/components/copy-button/react.js +10 -164
- package/dist/components/copy-value/html.js +6 -105
- package/dist/components/copy-value/react.js +20 -172
- package/dist/components/danger-confirmation/react.js +13 -167
- package/dist/components/data-table/html.d.ts +51 -51
- package/dist/components/data-table/html.js +28 -101
- package/dist/components/data-table/react.js +59 -213
- package/dist/components/date-input/html.js +2 -105
- package/dist/components/editable-text/html.d.ts +2 -2
- package/dist/components/editable-text/html.js +4 -102
- package/dist/components/editable-text/react.js +14 -168
- package/dist/components/editing-locale-switcher/html.js +2 -102
- package/dist/components/email-composer/react.js +25 -174
- package/dist/components/email-editor/html.js +8 -107
- package/dist/components/email-editor/react.js +34 -186
- package/dist/components/error-component/html.d.ts +4 -4
- package/dist/components/error-component/html.js +10 -107
- package/dist/components/error-component/react.js +15 -169
- package/dist/components/file-input/html.js +6 -106
- package/dist/components/icon-input/html.js +3 -103
- package/dist/components/icon-input/react.js +7 -161
- package/dist/components/image-crop-editor/html.js +1 -101
- package/dist/components/image-crop-editor/react.js +19 -173
- package/dist/components/loading/html.js +1 -101
- package/dist/components/locale-switcher/html.js +1 -103
- package/dist/components/map-menu/html.d.ts +8 -8
- package/dist/components/map-menu/html.js +7 -106
- package/dist/components/markdown/html.js +1 -101
- package/dist/components/markdown/react.js +10 -164
- package/dist/components/notification-menu/html.js +7 -114
- package/dist/components/pagination/html.js +5 -100
- package/dist/components/presence-transition/react.js +9 -163
- package/dist/components/registry-previews/component-example.js +10 -164
- package/dist/components/rich-text-editor/html.js +14 -108
- package/dist/components/rich-text-editor/react.js +9 -161
- package/dist/components/search-menu/html.js +1 -103
- package/dist/components/search-menu/react.js +11 -165
- package/dist/components/sidebar-layout/html.js +2 -102
- package/dist/components/sidebar-layout/react.js +3 -157
- package/dist/components/stepper/html.js +4 -102
- package/dist/components/support/html.js +1 -101
- package/dist/components/support/react.js +14 -168
- package/dist/components/theme-switcher/html.js +4 -105
- package/dist/components/time-input/html.d.ts +2 -2
- package/dist/components/time-input/html.js +1 -103
- package/dist/components/timezone-input/react.js +9 -163
- package/dist/components/toast/html.js +11 -104
- package/dist/components/upload-attachment/html.d.ts +4 -4
- package/dist/components/upload-attachment/html.js +7 -102
- package/dist/components/webhook-delivery-table/html.js +28 -101
- package/dist/components/webhook-delivery-table/react.js +74 -226
- package/dist/lib/docs.integrations.server.js +16 -35
- package/dist/lib/docs.js +31 -183
- package/dist/lib/docs.server.js +16 -35
- package/dist/lib/documentation-toolkit.js +19 -38
- package/dist/lib/effect-ui-adapter/use-model.js +158 -0
- package/dist/lib/lucide-effect.d.ts +2432 -0
- package/dist/lib/lucide-effect.js +7428 -0
- package/dist/services/agent/client/index.js +29 -183
- package/package.json +10 -2
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// ../../src/components/animated-list/react.tsx
|
|
2
2
|
import {
|
|
3
|
-
useEffect as
|
|
3
|
+
useEffect as useEffect2,
|
|
4
4
|
useEffectEvent as useEffectEvent2,
|
|
5
5
|
useId,
|
|
6
|
-
useRef as
|
|
7
|
-
useState as
|
|
6
|
+
useRef as useRef2,
|
|
7
|
+
useState as useState2
|
|
8
8
|
} from "react";
|
|
9
9
|
import { GripVertical } from "lucide-react";
|
|
10
|
-
import { Component as Component2, View
|
|
10
|
+
import { Component as Component2, View } from "effect/ui";
|
|
11
11
|
import { cn } from "cn";
|
|
12
12
|
import { useKrakstackLocale } from "@krak-stack/registry/krakstack-provider/react";
|
|
13
13
|
|
|
@@ -208,160 +208,8 @@ var useVerticalDrag = ({
|
|
|
208
208
|
};
|
|
209
209
|
};
|
|
210
210
|
|
|
211
|
-
// ../../src/
|
|
212
|
-
import {
|
|
213
|
-
import {
|
|
214
|
-
createContext,
|
|
215
|
-
useCallback,
|
|
216
|
-
useContext,
|
|
217
|
-
useEffect as useEffect2,
|
|
218
|
-
useLayoutEffect as useLayoutEffect2,
|
|
219
|
-
useRef as useRef2,
|
|
220
|
-
useState as useState2,
|
|
221
|
-
useSyncExternalStore as useSyncExternalStore2
|
|
222
|
-
} from "react";
|
|
223
|
-
|
|
224
|
-
// ../../src/lib/effect-ui-adapter/model-runtime.ts
|
|
225
|
-
import { MessageLog, Renderer, View } from "effect/ui";
|
|
226
|
-
import { BrowserHost, Html } from "effect/ui/html";
|
|
227
|
-
import { Cause, Effect, Fiber } from "effect";
|
|
228
|
-
var node = () => ({ children: [] });
|
|
229
|
-
var modelHost = (commit) => {
|
|
230
|
-
const remove = (child) => {
|
|
231
|
-
if (!child.parent)
|
|
232
|
-
return;
|
|
233
|
-
child.parent.children.splice(child.parent.children.indexOf(child), 1);
|
|
234
|
-
delete child.parent;
|
|
235
|
-
};
|
|
236
|
-
return {
|
|
237
|
-
createElement: node,
|
|
238
|
-
createText: node,
|
|
239
|
-
setText: () => {},
|
|
240
|
-
setAttr: () => {},
|
|
241
|
-
setProp: () => {},
|
|
242
|
-
setEvents: () => {},
|
|
243
|
-
insertBefore: (parent, child, before) => {
|
|
244
|
-
if (child === before)
|
|
245
|
-
return;
|
|
246
|
-
remove(child);
|
|
247
|
-
const index = before ? parent.children.indexOf(before) : parent.children.length;
|
|
248
|
-
parent.children.splice(index, 0, child);
|
|
249
|
-
child.parent = parent;
|
|
250
|
-
},
|
|
251
|
-
remove,
|
|
252
|
-
parentOf: (child) => child.parent,
|
|
253
|
-
nextOf: (child) => child.parent?.children[child.parent.children.indexOf(child) + 1],
|
|
254
|
-
elements: ["html"],
|
|
255
|
-
controlled: new Set,
|
|
256
|
-
runsMounts: false,
|
|
257
|
-
commit
|
|
258
|
-
};
|
|
259
|
-
};
|
|
260
|
-
var mountModel = (component, props, publishSnapshot, messageLog, onEmit) => {
|
|
261
|
-
let currentProps = props;
|
|
262
|
-
let root;
|
|
263
|
-
let active = true;
|
|
264
|
-
let failure;
|
|
265
|
-
const publish = () => {
|
|
266
|
-
if (!active)
|
|
267
|
-
return;
|
|
268
|
-
if (failure) {
|
|
269
|
-
publishSnapshot({ error: failure });
|
|
270
|
-
return;
|
|
271
|
-
}
|
|
272
|
-
const current = root?.model();
|
|
273
|
-
if (current !== undefined)
|
|
274
|
-
publishSnapshot({ model: current });
|
|
275
|
-
};
|
|
276
|
-
const fiber = Effect.runFork(Effect.scoped(Effect.gen(function* () {
|
|
277
|
-
const mounted = yield* Renderer.mount(component, Effect.succeed(props), node(), {
|
|
278
|
-
head: false,
|
|
279
|
-
onEmit,
|
|
280
|
-
fallback: ({ cause }) => {
|
|
281
|
-
failure = new Error("Effect UI root failed", {
|
|
282
|
-
cause: Cause.squash(cause)
|
|
283
|
-
});
|
|
284
|
-
return View.text("");
|
|
285
|
-
}
|
|
286
|
-
});
|
|
287
|
-
if (!active)
|
|
288
|
-
return;
|
|
289
|
-
root = mounted;
|
|
290
|
-
if (props !== currentProps)
|
|
291
|
-
mounted.setProps(currentProps);
|
|
292
|
-
publish();
|
|
293
|
-
return yield* Effect.never;
|
|
294
|
-
}).pipe(Effect.provide(Renderer.layer(modelHost(publish))), Effect.provideService(Html.Host, BrowserHost.htmlHost), Effect.provideService(MessageLog.MessageLog, messageLog))));
|
|
295
|
-
return {
|
|
296
|
-
send: (message) => {
|
|
297
|
-
root?.send(message);
|
|
298
|
-
publish();
|
|
299
|
-
},
|
|
300
|
-
setProps: (next) => {
|
|
301
|
-
currentProps = next;
|
|
302
|
-
root?.setProps(next);
|
|
303
|
-
},
|
|
304
|
-
dispose: () => {
|
|
305
|
-
active = false;
|
|
306
|
-
root = undefined;
|
|
307
|
-
Effect.runFork(Fiber.interrupt(fiber));
|
|
308
|
-
}
|
|
309
|
-
};
|
|
310
|
-
};
|
|
311
|
-
|
|
312
|
-
// ../../src/lib/effect-ui-adapter/use-model.ts
|
|
313
|
-
"use client";
|
|
314
|
-
var ModelMessageLogContext = createContext(undefined);
|
|
315
|
-
var useModel = (component, props, options = {}) => {
|
|
316
|
-
const contextLog = useContext(ModelMessageLogContext);
|
|
317
|
-
const messageLog = options.messageLog ?? (contextLog === undefined ? MessageLog2.noop : contextLog);
|
|
318
|
-
const [store] = useState2(() => {
|
|
319
|
-
const initial = { model: component.init(props).model };
|
|
320
|
-
let snapshot = initial;
|
|
321
|
-
const listeners = new Set;
|
|
322
|
-
return {
|
|
323
|
-
subscribe: (listener) => {
|
|
324
|
-
listeners.add(listener);
|
|
325
|
-
return () => {
|
|
326
|
-
listeners.delete(listener);
|
|
327
|
-
};
|
|
328
|
-
},
|
|
329
|
-
getSnapshot: () => snapshot,
|
|
330
|
-
getServerSnapshot: () => initial,
|
|
331
|
-
publish: (next) => {
|
|
332
|
-
if ("model" in snapshot && "model" in next && Object.is(snapshot.model, next.model))
|
|
333
|
-
return;
|
|
334
|
-
if ("error" in snapshot && "error" in next && snapshot.error === next.error)
|
|
335
|
-
return;
|
|
336
|
-
snapshot = next;
|
|
337
|
-
listeners.forEach((listener) => listener());
|
|
338
|
-
}
|
|
339
|
-
};
|
|
340
|
-
});
|
|
341
|
-
const snapshot = useSyncExternalStore2(store.subscribe, store.getSnapshot, store.getServerSnapshot);
|
|
342
|
-
const committed = useRef2(props);
|
|
343
|
-
const onEmit = useRef2(options.onEmit);
|
|
344
|
-
const runtime = useRef2(undefined);
|
|
345
|
-
const send = useCallback((message) => runtime.current?.send(message), []);
|
|
346
|
-
useLayoutEffect2(() => {
|
|
347
|
-
onEmit.current = options.onEmit;
|
|
348
|
-
committed.current = props;
|
|
349
|
-
runtime.current?.setProps(props);
|
|
350
|
-
}, [props, options.onEmit]);
|
|
351
|
-
useEffect2(() => {
|
|
352
|
-
if (messageLog === null)
|
|
353
|
-
return;
|
|
354
|
-
const mounted = mountModel(component, committed.current, store.publish, messageLog, (event) => onEmit.current?.(event));
|
|
355
|
-
runtime.current = mounted;
|
|
356
|
-
return () => {
|
|
357
|
-
runtime.current = undefined;
|
|
358
|
-
mounted.dispose();
|
|
359
|
-
};
|
|
360
|
-
}, [component, messageLog, store]);
|
|
361
|
-
if ("error" in snapshot)
|
|
362
|
-
throw snapshot.error;
|
|
363
|
-
return { model: snapshot.model, send };
|
|
364
|
-
};
|
|
211
|
+
// ../../src/components/animated-list/react.tsx
|
|
212
|
+
import { useModel } from "@krak-stack/registry/effect-ui-adapter/react";
|
|
365
213
|
|
|
366
214
|
// ../../src/components/animated-list/classes.ts
|
|
367
215
|
var animatedListClasses = {
|
|
@@ -516,7 +364,7 @@ var animatedListBehaviours = {
|
|
|
516
364
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
517
365
|
var Model = Component2.define(animatedListOptions).make({
|
|
518
366
|
...animatedListBehaviours,
|
|
519
|
-
view: () =>
|
|
367
|
+
view: () => View.text("")
|
|
520
368
|
});
|
|
521
369
|
var AnimatedList = ({
|
|
522
370
|
classes: classOverrides,
|
|
@@ -537,7 +385,7 @@ var AnimatedList = ({
|
|
|
537
385
|
const locale = useKrakstackLocale(override);
|
|
538
386
|
const copy = animatedListCopy(locale, messages);
|
|
539
387
|
const instructions = useId();
|
|
540
|
-
const container =
|
|
388
|
+
const container = useRef2(null);
|
|
541
389
|
const descriptors = items.map((item) => ({
|
|
542
390
|
key: getKey(item),
|
|
543
391
|
label: getItemLabel?.(item)
|
|
@@ -548,7 +396,7 @@ var AnimatedList = ({
|
|
|
548
396
|
});
|
|
549
397
|
const retained = retainedRows(descriptors, model.rows);
|
|
550
398
|
const current = new Map(items.map((item) => [getKey(item), { item }]));
|
|
551
|
-
const [previous, setPrevious] =
|
|
399
|
+
const [previous, setPrevious] = useState2(() => ({
|
|
552
400
|
items,
|
|
553
401
|
rows: model.rows,
|
|
554
402
|
rendered: current
|
|
@@ -560,8 +408,8 @@ var AnimatedList = ({
|
|
|
560
408
|
if (previous.items !== items || previous.rows !== model.rows) {
|
|
561
409
|
setPrevious({ items, rows: model.rows, rendered });
|
|
562
410
|
}
|
|
563
|
-
const committed =
|
|
564
|
-
|
|
411
|
+
const committed = useRef2(false);
|
|
412
|
+
useEffect2(() => {
|
|
565
413
|
committed.current = true;
|
|
566
414
|
}, []);
|
|
567
415
|
useListLayout(container, duration);
|
|
@@ -643,10 +491,10 @@ var ListItem = ({
|
|
|
643
491
|
onKeyMove,
|
|
644
492
|
children
|
|
645
493
|
}) => {
|
|
646
|
-
const ref =
|
|
647
|
-
const mounted =
|
|
648
|
-
const lastPresent =
|
|
649
|
-
const transitioning =
|
|
494
|
+
const ref = useRef2(null);
|
|
495
|
+
const mounted = useRef2(false);
|
|
496
|
+
const lastPresent = useRef2(present);
|
|
497
|
+
const transitioning = useRef2(false);
|
|
650
498
|
const exit = useEffectEvent2(onExit);
|
|
651
499
|
const reduced = useReducedMotion();
|
|
652
500
|
const drag = useVerticalDrag({
|
|
@@ -656,7 +504,7 @@ var ListItem = ({
|
|
|
656
504
|
overflow: dragOverflow,
|
|
657
505
|
onMove
|
|
658
506
|
});
|
|
659
|
-
|
|
507
|
+
useEffect2(() => {
|
|
660
508
|
const element = ref.current;
|
|
661
509
|
const first = !mounted.current;
|
|
662
510
|
mounted.current = true;
|
|
@@ -1,165 +1,11 @@
|
|
|
1
1
|
// ../../src/components/animated-number/react.tsx
|
|
2
|
-
import { Component as Component2, View
|
|
2
|
+
import { Component as Component2, View } from "effect/ui";
|
|
3
3
|
import { useMemo } from "react";
|
|
4
4
|
import { useKrakstackLocale } from "@krak-stack/registry/krakstack-provider/react";
|
|
5
|
-
|
|
6
|
-
// ../../src/lib/effect-ui-adapter/use-model.ts
|
|
7
|
-
import { MessageLog as MessageLog2 } from "effect/ui";
|
|
8
|
-
import {
|
|
9
|
-
createContext,
|
|
10
|
-
useCallback,
|
|
11
|
-
useContext,
|
|
12
|
-
useEffect,
|
|
13
|
-
useLayoutEffect,
|
|
14
|
-
useRef,
|
|
15
|
-
useState,
|
|
16
|
-
useSyncExternalStore
|
|
17
|
-
} from "react";
|
|
18
|
-
|
|
19
|
-
// ../../src/lib/effect-ui-adapter/model-runtime.ts
|
|
20
|
-
import { MessageLog, Renderer, View } from "effect/ui";
|
|
21
|
-
import { BrowserHost, Html } from "effect/ui/html";
|
|
22
|
-
import { Cause, Effect, Fiber } from "effect";
|
|
23
|
-
var node = () => ({ children: [] });
|
|
24
|
-
var modelHost = (commit) => {
|
|
25
|
-
const remove = (child) => {
|
|
26
|
-
if (!child.parent)
|
|
27
|
-
return;
|
|
28
|
-
child.parent.children.splice(child.parent.children.indexOf(child), 1);
|
|
29
|
-
delete child.parent;
|
|
30
|
-
};
|
|
31
|
-
return {
|
|
32
|
-
createElement: node,
|
|
33
|
-
createText: node,
|
|
34
|
-
setText: () => {},
|
|
35
|
-
setAttr: () => {},
|
|
36
|
-
setProp: () => {},
|
|
37
|
-
setEvents: () => {},
|
|
38
|
-
insertBefore: (parent, child, before) => {
|
|
39
|
-
if (child === before)
|
|
40
|
-
return;
|
|
41
|
-
remove(child);
|
|
42
|
-
const index = before ? parent.children.indexOf(before) : parent.children.length;
|
|
43
|
-
parent.children.splice(index, 0, child);
|
|
44
|
-
child.parent = parent;
|
|
45
|
-
},
|
|
46
|
-
remove,
|
|
47
|
-
parentOf: (child) => child.parent,
|
|
48
|
-
nextOf: (child) => child.parent?.children[child.parent.children.indexOf(child) + 1],
|
|
49
|
-
elements: ["html"],
|
|
50
|
-
controlled: new Set,
|
|
51
|
-
runsMounts: false,
|
|
52
|
-
commit
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
var mountModel = (component, props, publishSnapshot, messageLog, onEmit) => {
|
|
56
|
-
let currentProps = props;
|
|
57
|
-
let root;
|
|
58
|
-
let active = true;
|
|
59
|
-
let failure;
|
|
60
|
-
const publish = () => {
|
|
61
|
-
if (!active)
|
|
62
|
-
return;
|
|
63
|
-
if (failure) {
|
|
64
|
-
publishSnapshot({ error: failure });
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
const current = root?.model();
|
|
68
|
-
if (current !== undefined)
|
|
69
|
-
publishSnapshot({ model: current });
|
|
70
|
-
};
|
|
71
|
-
const fiber = Effect.runFork(Effect.scoped(Effect.gen(function* () {
|
|
72
|
-
const mounted = yield* Renderer.mount(component, Effect.succeed(props), node(), {
|
|
73
|
-
head: false,
|
|
74
|
-
onEmit,
|
|
75
|
-
fallback: ({ cause }) => {
|
|
76
|
-
failure = new Error("Effect UI root failed", {
|
|
77
|
-
cause: Cause.squash(cause)
|
|
78
|
-
});
|
|
79
|
-
return View.text("");
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
if (!active)
|
|
83
|
-
return;
|
|
84
|
-
root = mounted;
|
|
85
|
-
if (props !== currentProps)
|
|
86
|
-
mounted.setProps(currentProps);
|
|
87
|
-
publish();
|
|
88
|
-
return yield* Effect.never;
|
|
89
|
-
}).pipe(Effect.provide(Renderer.layer(modelHost(publish))), Effect.provideService(Html.Host, BrowserHost.htmlHost), Effect.provideService(MessageLog.MessageLog, messageLog))));
|
|
90
|
-
return {
|
|
91
|
-
send: (message) => {
|
|
92
|
-
root?.send(message);
|
|
93
|
-
publish();
|
|
94
|
-
},
|
|
95
|
-
setProps: (next) => {
|
|
96
|
-
currentProps = next;
|
|
97
|
-
root?.setProps(next);
|
|
98
|
-
},
|
|
99
|
-
dispose: () => {
|
|
100
|
-
active = false;
|
|
101
|
-
root = undefined;
|
|
102
|
-
Effect.runFork(Fiber.interrupt(fiber));
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
// ../../src/lib/effect-ui-adapter/use-model.ts
|
|
108
|
-
"use client";
|
|
109
|
-
var ModelMessageLogContext = createContext(undefined);
|
|
110
|
-
var useModel = (component, props, options = {}) => {
|
|
111
|
-
const contextLog = useContext(ModelMessageLogContext);
|
|
112
|
-
const messageLog = options.messageLog ?? (contextLog === undefined ? MessageLog2.noop : contextLog);
|
|
113
|
-
const [store] = useState(() => {
|
|
114
|
-
const initial = { model: component.init(props).model };
|
|
115
|
-
let snapshot = initial;
|
|
116
|
-
const listeners = new Set;
|
|
117
|
-
return {
|
|
118
|
-
subscribe: (listener) => {
|
|
119
|
-
listeners.add(listener);
|
|
120
|
-
return () => {
|
|
121
|
-
listeners.delete(listener);
|
|
122
|
-
};
|
|
123
|
-
},
|
|
124
|
-
getSnapshot: () => snapshot,
|
|
125
|
-
getServerSnapshot: () => initial,
|
|
126
|
-
publish: (next) => {
|
|
127
|
-
if ("model" in snapshot && "model" in next && Object.is(snapshot.model, next.model))
|
|
128
|
-
return;
|
|
129
|
-
if ("error" in snapshot && "error" in next && snapshot.error === next.error)
|
|
130
|
-
return;
|
|
131
|
-
snapshot = next;
|
|
132
|
-
listeners.forEach((listener) => listener());
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
});
|
|
136
|
-
const snapshot = useSyncExternalStore(store.subscribe, store.getSnapshot, store.getServerSnapshot);
|
|
137
|
-
const committed = useRef(props);
|
|
138
|
-
const onEmit = useRef(options.onEmit);
|
|
139
|
-
const runtime = useRef(undefined);
|
|
140
|
-
const send = useCallback((message) => runtime.current?.send(message), []);
|
|
141
|
-
useLayoutEffect(() => {
|
|
142
|
-
onEmit.current = options.onEmit;
|
|
143
|
-
committed.current = props;
|
|
144
|
-
runtime.current?.setProps(props);
|
|
145
|
-
}, [props, options.onEmit]);
|
|
146
|
-
useEffect(() => {
|
|
147
|
-
if (messageLog === null)
|
|
148
|
-
return;
|
|
149
|
-
const mounted = mountModel(component, committed.current, store.publish, messageLog, (event) => onEmit.current?.(event));
|
|
150
|
-
runtime.current = mounted;
|
|
151
|
-
return () => {
|
|
152
|
-
runtime.current = undefined;
|
|
153
|
-
mounted.dispose();
|
|
154
|
-
};
|
|
155
|
-
}, [component, messageLog, store]);
|
|
156
|
-
if ("error" in snapshot)
|
|
157
|
-
throw snapshot.error;
|
|
158
|
-
return { model: snapshot.model, send };
|
|
159
|
-
};
|
|
5
|
+
import { useModel } from "@krak-stack/registry/effect-ui-adapter/react";
|
|
160
6
|
|
|
161
7
|
// ../../src/components/animated-number/index.ts
|
|
162
|
-
import { Effect
|
|
8
|
+
import { Effect, Schema as Schema2, Stream } from "effect";
|
|
163
9
|
import { Component, Subscription, UiSchema } from "effect/ui";
|
|
164
10
|
|
|
165
11
|
// ../../src/components/animated-number/schema.ts
|
|
@@ -194,16 +40,16 @@ var animatedNumberOptions = {
|
|
|
194
40
|
};
|
|
195
41
|
var Definition = Component.define(animatedNumberOptions);
|
|
196
42
|
var durationOf = (duration = 350) => Number.isFinite(duration) ? Math.max(0, duration) : 0;
|
|
197
|
-
var frame =
|
|
43
|
+
var frame = Effect.callback((resume) => {
|
|
198
44
|
if (!globalThis.requestAnimationFrame || globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches) {
|
|
199
|
-
resume(
|
|
45
|
+
resume(Effect.succeed(Message.Frame({ now: 0, instant: true })));
|
|
200
46
|
return;
|
|
201
47
|
}
|
|
202
|
-
const id = requestAnimationFrame((now) => resume(
|
|
48
|
+
const id = requestAnimationFrame((now) => resume(Effect.succeed(Message.Frame({
|
|
203
49
|
now,
|
|
204
50
|
instant: globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches ?? false
|
|
205
51
|
}))));
|
|
206
|
-
return
|
|
52
|
+
return Effect.sync(() => cancelAnimationFrame(id));
|
|
207
53
|
});
|
|
208
54
|
var frames = Subscription.make("animated-number/frames", Stream.forever(Stream.fromEffect(frame)));
|
|
209
55
|
var update = Definition.update({
|
|
@@ -244,7 +90,7 @@ var animatedNumberBehaviours = {
|
|
|
244
90
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
245
91
|
var Model = Component2.define(animatedNumberOptions).make({
|
|
246
92
|
...animatedNumberBehaviours,
|
|
247
|
-
view: () =>
|
|
93
|
+
view: () => View.text("")
|
|
248
94
|
});
|
|
249
95
|
var AnimatedNumber = ({
|
|
250
96
|
value,
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { Schema as Schema3 } from "effect";
|
|
3
3
|
import { Html } from "effect/ui/html";
|
|
4
4
|
import { Menu } from "effect/ui/kit";
|
|
5
|
-
import { Grip } from "lucide";
|
|
6
5
|
|
|
7
6
|
// ../../src/lib/utils.ts
|
|
8
7
|
import { cn } from "cn";
|
|
@@ -58,107 +57,7 @@ var MenuLabel = (h, menu, options) => menu.groupLabel({
|
|
|
58
57
|
|
|
59
58
|
// ../../src/components/app-switcher/html.ts
|
|
60
59
|
import { krakstackLocaleRead } from "@krak-stack/registry/krakstack-provider/html";
|
|
61
|
-
|
|
62
|
-
// ../../src/lib/lucide-effect.ts
|
|
63
|
-
import {
|
|
64
|
-
ArrowDown as arrowDown,
|
|
65
|
-
ArrowUp as arrowUp,
|
|
66
|
-
ListFilter as listFilter,
|
|
67
|
-
Check as check,
|
|
68
|
-
ChevronLeft as chevronLeft,
|
|
69
|
-
ChevronDown as chevronDown,
|
|
70
|
-
ChevronRight as chevronRight,
|
|
71
|
-
ChevronsLeft as chevronsLeft,
|
|
72
|
-
ChevronsRight as chevronsRight,
|
|
73
|
-
ChevronsUpDown as chevronsUpDown,
|
|
74
|
-
Copy as copy,
|
|
75
|
-
Download as download,
|
|
76
|
-
Eye as eye,
|
|
77
|
-
EyeOff as eyeOff,
|
|
78
|
-
Ellipsis as ellipsis,
|
|
79
|
-
FileJson as fileJson,
|
|
80
|
-
FileText as fileText,
|
|
81
|
-
GripVertical as gripVertical,
|
|
82
|
-
Image as image,
|
|
83
|
-
LayoutGrid as layoutGrid,
|
|
84
|
-
LoaderCircle as loaderCircle,
|
|
85
|
-
Mail as mail,
|
|
86
|
-
Paperclip as paperclip,
|
|
87
|
-
RefreshCw as refreshCw,
|
|
88
|
-
RotateCcw as rotateCcw,
|
|
89
|
-
Rows3 as rows3,
|
|
90
|
-
Search as search,
|
|
91
|
-
Settings2 as settings2,
|
|
92
|
-
TriangleAlert as triangleAlert,
|
|
93
|
-
X as x
|
|
94
|
-
} from "lucide";
|
|
95
|
-
var createLucideIcon = (icon) => (h, {
|
|
96
|
-
size = 24,
|
|
97
|
-
color = "currentColor",
|
|
98
|
-
strokeWidth = 2,
|
|
99
|
-
className
|
|
100
|
-
} = {}) => h.svg.attrs({
|
|
101
|
-
class: className,
|
|
102
|
-
width: String(size),
|
|
103
|
-
height: String(size),
|
|
104
|
-
viewBox: "0 0 24 24",
|
|
105
|
-
fill: "none",
|
|
106
|
-
stroke: color,
|
|
107
|
-
"stroke-width": String(strokeWidth),
|
|
108
|
-
"stroke-linecap": "round",
|
|
109
|
-
"stroke-linejoin": "round",
|
|
110
|
-
"aria-hidden": "true"
|
|
111
|
-
}).children(...icon.map(([tag, attributes]) => {
|
|
112
|
-
const attrs = Object.fromEntries(Object.entries(attributes).flatMap(([name, value]) => value === undefined ? [] : [[name, String(value)]]));
|
|
113
|
-
switch (tag) {
|
|
114
|
-
case "path":
|
|
115
|
-
return h.path.attrs(attrs);
|
|
116
|
-
case "circle":
|
|
117
|
-
return h.circle.attrs(attrs);
|
|
118
|
-
case "ellipse":
|
|
119
|
-
return h.ellipse.attrs(attrs);
|
|
120
|
-
case "line":
|
|
121
|
-
return h.line.attrs(attrs);
|
|
122
|
-
case "polyline":
|
|
123
|
-
return h.polyline.attrs(attrs);
|
|
124
|
-
case "polygon":
|
|
125
|
-
return h.polygon.attrs(attrs);
|
|
126
|
-
case "rect":
|
|
127
|
-
return h.rect.attrs(attrs);
|
|
128
|
-
default:
|
|
129
|
-
throw new Error(`Unsupported Lucide SVG element: ${tag}`);
|
|
130
|
-
}
|
|
131
|
-
}));
|
|
132
|
-
var Check = createLucideIcon(check);
|
|
133
|
-
var ArrowDown = createLucideIcon(arrowDown);
|
|
134
|
-
var ArrowUp = createLucideIcon(arrowUp);
|
|
135
|
-
var ListFilter = createLucideIcon(listFilter);
|
|
136
|
-
var ChevronLeft = createLucideIcon(chevronLeft);
|
|
137
|
-
var ChevronDown = createLucideIcon(chevronDown);
|
|
138
|
-
var ChevronRight = createLucideIcon(chevronRight);
|
|
139
|
-
var ChevronsLeft = createLucideIcon(chevronsLeft);
|
|
140
|
-
var ChevronsRight = createLucideIcon(chevronsRight);
|
|
141
|
-
var ChevronsUpDown = createLucideIcon(chevronsUpDown);
|
|
142
|
-
var Copy = createLucideIcon(copy);
|
|
143
|
-
var Download = createLucideIcon(download);
|
|
144
|
-
var Eye = createLucideIcon(eye);
|
|
145
|
-
var EyeOff = createLucideIcon(eyeOff);
|
|
146
|
-
var Ellipsis = createLucideIcon(ellipsis);
|
|
147
|
-
var FileJson = createLucideIcon(fileJson);
|
|
148
|
-
var FileText = createLucideIcon(fileText);
|
|
149
|
-
var GripVertical = createLucideIcon(gripVertical);
|
|
150
|
-
var Image = createLucideIcon(image);
|
|
151
|
-
var LayoutGrid = createLucideIcon(layoutGrid);
|
|
152
|
-
var LoaderCircle = createLucideIcon(loaderCircle);
|
|
153
|
-
var Mail = createLucideIcon(mail);
|
|
154
|
-
var Paperclip = createLucideIcon(paperclip);
|
|
155
|
-
var RefreshCw = createLucideIcon(refreshCw);
|
|
156
|
-
var RotateCcw = createLucideIcon(rotateCcw);
|
|
157
|
-
var Rows3 = createLucideIcon(rows3);
|
|
158
|
-
var Search = createLucideIcon(search);
|
|
159
|
-
var Settings2 = createLucideIcon(settings2);
|
|
160
|
-
var TriangleAlert = createLucideIcon(triangleAlert);
|
|
161
|
-
var X = createLucideIcon(x);
|
|
60
|
+
import { Check, Grip as GripIcon, createLucideIcon } from "@krak-stack/registry/lucide-effect";
|
|
162
61
|
|
|
163
62
|
// ../../src/components/app-switcher/classes.ts
|
|
164
63
|
var appSwitcherClasses = {
|
|
@@ -246,7 +145,6 @@ var appSwitcherBehaviours = {
|
|
|
246
145
|
};
|
|
247
146
|
|
|
248
147
|
// ../../src/components/app-switcher/html.ts
|
|
249
|
-
var GripIcon = createLucideIcon(Grip);
|
|
250
148
|
var IconNode = Schema3.mutable(Schema3.Array(Schema3.mutable(Schema3.Tuple([
|
|
251
149
|
Schema3.String,
|
|
252
150
|
Schema3.Record(Schema3.String, Schema3.UndefinedOr(Schema3.Union([Schema3.String, Schema3.Number])))
|
|
@@ -37,107 +37,7 @@ var Button = (h, options = {}) => KitButton(h, {
|
|
|
37
37
|
|
|
38
38
|
// ../../src/components/async-action-button/html.ts
|
|
39
39
|
import { krakstackLocaleRead } from "@krak-stack/registry/krakstack-provider/html";
|
|
40
|
-
|
|
41
|
-
// ../../src/lib/lucide-effect.ts
|
|
42
|
-
import {
|
|
43
|
-
ArrowDown as arrowDown,
|
|
44
|
-
ArrowUp as arrowUp,
|
|
45
|
-
ListFilter as listFilter,
|
|
46
|
-
Check as check,
|
|
47
|
-
ChevronLeft as chevronLeft,
|
|
48
|
-
ChevronDown as chevronDown,
|
|
49
|
-
ChevronRight as chevronRight,
|
|
50
|
-
ChevronsLeft as chevronsLeft,
|
|
51
|
-
ChevronsRight as chevronsRight,
|
|
52
|
-
ChevronsUpDown as chevronsUpDown,
|
|
53
|
-
Copy as copy,
|
|
54
|
-
Download as download,
|
|
55
|
-
Eye as eye,
|
|
56
|
-
EyeOff as eyeOff,
|
|
57
|
-
Ellipsis as ellipsis,
|
|
58
|
-
FileJson as fileJson,
|
|
59
|
-
FileText as fileText,
|
|
60
|
-
GripVertical as gripVertical,
|
|
61
|
-
Image as image,
|
|
62
|
-
LayoutGrid as layoutGrid,
|
|
63
|
-
LoaderCircle as loaderCircle,
|
|
64
|
-
Mail as mail,
|
|
65
|
-
Paperclip as paperclip,
|
|
66
|
-
RefreshCw as refreshCw,
|
|
67
|
-
RotateCcw as rotateCcw,
|
|
68
|
-
Rows3 as rows3,
|
|
69
|
-
Search as search,
|
|
70
|
-
Settings2 as settings2,
|
|
71
|
-
TriangleAlert as triangleAlert,
|
|
72
|
-
X as x
|
|
73
|
-
} from "lucide";
|
|
74
|
-
var createLucideIcon = (icon) => (h, {
|
|
75
|
-
size = 24,
|
|
76
|
-
color = "currentColor",
|
|
77
|
-
strokeWidth = 2,
|
|
78
|
-
className
|
|
79
|
-
} = {}) => h.svg.attrs({
|
|
80
|
-
class: className,
|
|
81
|
-
width: String(size),
|
|
82
|
-
height: String(size),
|
|
83
|
-
viewBox: "0 0 24 24",
|
|
84
|
-
fill: "none",
|
|
85
|
-
stroke: color,
|
|
86
|
-
"stroke-width": String(strokeWidth),
|
|
87
|
-
"stroke-linecap": "round",
|
|
88
|
-
"stroke-linejoin": "round",
|
|
89
|
-
"aria-hidden": "true"
|
|
90
|
-
}).children(...icon.map(([tag, attributes]) => {
|
|
91
|
-
const attrs = Object.fromEntries(Object.entries(attributes).flatMap(([name, value]) => value === undefined ? [] : [[name, String(value)]]));
|
|
92
|
-
switch (tag) {
|
|
93
|
-
case "path":
|
|
94
|
-
return h.path.attrs(attrs);
|
|
95
|
-
case "circle":
|
|
96
|
-
return h.circle.attrs(attrs);
|
|
97
|
-
case "ellipse":
|
|
98
|
-
return h.ellipse.attrs(attrs);
|
|
99
|
-
case "line":
|
|
100
|
-
return h.line.attrs(attrs);
|
|
101
|
-
case "polyline":
|
|
102
|
-
return h.polyline.attrs(attrs);
|
|
103
|
-
case "polygon":
|
|
104
|
-
return h.polygon.attrs(attrs);
|
|
105
|
-
case "rect":
|
|
106
|
-
return h.rect.attrs(attrs);
|
|
107
|
-
default:
|
|
108
|
-
throw new Error(`Unsupported Lucide SVG element: ${tag}`);
|
|
109
|
-
}
|
|
110
|
-
}));
|
|
111
|
-
var Check = createLucideIcon(check);
|
|
112
|
-
var ArrowDown = createLucideIcon(arrowDown);
|
|
113
|
-
var ArrowUp = createLucideIcon(arrowUp);
|
|
114
|
-
var ListFilter = createLucideIcon(listFilter);
|
|
115
|
-
var ChevronLeft = createLucideIcon(chevronLeft);
|
|
116
|
-
var ChevronDown = createLucideIcon(chevronDown);
|
|
117
|
-
var ChevronRight = createLucideIcon(chevronRight);
|
|
118
|
-
var ChevronsLeft = createLucideIcon(chevronsLeft);
|
|
119
|
-
var ChevronsRight = createLucideIcon(chevronsRight);
|
|
120
|
-
var ChevronsUpDown = createLucideIcon(chevronsUpDown);
|
|
121
|
-
var Copy = createLucideIcon(copy);
|
|
122
|
-
var Download = createLucideIcon(download);
|
|
123
|
-
var Eye = createLucideIcon(eye);
|
|
124
|
-
var EyeOff = createLucideIcon(eyeOff);
|
|
125
|
-
var Ellipsis = createLucideIcon(ellipsis);
|
|
126
|
-
var FileJson = createLucideIcon(fileJson);
|
|
127
|
-
var FileText = createLucideIcon(fileText);
|
|
128
|
-
var GripVertical = createLucideIcon(gripVertical);
|
|
129
|
-
var Image = createLucideIcon(image);
|
|
130
|
-
var LayoutGrid = createLucideIcon(layoutGrid);
|
|
131
|
-
var LoaderCircle = createLucideIcon(loaderCircle);
|
|
132
|
-
var Mail = createLucideIcon(mail);
|
|
133
|
-
var Paperclip = createLucideIcon(paperclip);
|
|
134
|
-
var RefreshCw = createLucideIcon(refreshCw);
|
|
135
|
-
var RotateCcw = createLucideIcon(rotateCcw);
|
|
136
|
-
var Rows3 = createLucideIcon(rows3);
|
|
137
|
-
var Search = createLucideIcon(search);
|
|
138
|
-
var Settings2 = createLucideIcon(settings2);
|
|
139
|
-
var TriangleAlert = createLucideIcon(triangleAlert);
|
|
140
|
-
var X = createLucideIcon(x);
|
|
40
|
+
import { Check, LoaderCircle, RotateCcw } from "@krak-stack/registry/lucide-effect";
|
|
141
41
|
|
|
142
42
|
// ../../src/components/async-action-button/classes.ts
|
|
143
43
|
var asyncActionButtonClasses = {
|