@soron-ai/next 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +3679 -0
- package/dist/doors.d.ts +35 -0
- package/dist/protocol.d.ts +53 -0
- package/dist/routes.d.ts +6 -0
- package/dist/routes.js +283 -0
- package/dist/styles.css +2210 -0
- package/dist/version.d.ts +1 -0
- package/dist/widget/answer.d.ts +19 -0
- package/dist/widget/badge.d.ts +2 -0
- package/dist/widget/composer-keys.d.ts +11 -0
- package/dist/widget/composer.d.ts +14 -0
- package/dist/widget/core/cards.d.ts +17 -0
- package/dist/widget/core/contract.d.ts +209 -0
- package/dist/widget/core/ending.d.ts +26 -0
- package/dist/widget/core/markdown.d.ts +40 -0
- package/dist/widget/core/run-view.d.ts +33 -0
- package/dist/widget/core/service-link.d.ts +58 -0
- package/dist/widget/core/session.d.ts +55 -0
- package/dist/widget/core/sse.d.ts +8 -0
- package/dist/widget/discussion-list.d.ts +11 -0
- package/dist/widget/discussions.d.ts +26 -0
- package/dist/widget/exchange.d.ts +27 -0
- package/dist/widget/eye.d.ts +5 -0
- package/dist/widget/floor.d.ts +5 -0
- package/dist/widget/panel.d.ts +2 -0
- package/dist/widget/provider.d.ts +73 -0
- package/dist/widget/self-test.d.ts +31 -0
- package/dist/widget/ui.d.ts +54 -0
- package/dist/widget/use-discussions.d.ts +39 -0
- package/dist/widget/viewport.d.ts +12 -0
- package/dist/widget.d.ts +6 -0
- package/dist/widget.js +117 -0
- package/package.json +31 -4
- package/README.md +0 -3
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
declare const reply: z.ZodObject<{
|
|
3
|
+
staff: z.ZodEnum<{
|
|
4
|
+
forbidden: "forbidden";
|
|
5
|
+
ok: "ok";
|
|
6
|
+
refused: "refused";
|
|
7
|
+
unavailable: "unavailable";
|
|
8
|
+
}>;
|
|
9
|
+
reads: z.ZodArray<z.ZodObject<{
|
|
10
|
+
table: z.ZodString;
|
|
11
|
+
ok: z.ZodBoolean;
|
|
12
|
+
error: z.ZodOptional<z.ZodString>;
|
|
13
|
+
}, z.core.$strip>>;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
export type SelfTest = {
|
|
16
|
+
badge: 'ok' | 'refused' | 'unavailable';
|
|
17
|
+
staff: z.infer<typeof reply>['staff'] | 'not_run' | 'limited' | 'down';
|
|
18
|
+
reads: z.infer<typeof reply>['reads'];
|
|
19
|
+
};
|
|
20
|
+
export declare function selfTest(o: {
|
|
21
|
+
service: string;
|
|
22
|
+
badge: () => Promise<string>;
|
|
23
|
+
fetch?: typeof fetch;
|
|
24
|
+
}): Promise<SelfTest>;
|
|
25
|
+
export type SelfTestLine = {
|
|
26
|
+
ok: boolean;
|
|
27
|
+
text: string;
|
|
28
|
+
};
|
|
29
|
+
export declare function selfTestLines(t: SelfTest): SelfTestLine[];
|
|
30
|
+
export declare const passed: (t: SelfTest) => boolean;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
declare const PATHS: {
|
|
3
|
+
alert: string;
|
|
4
|
+
arrowLeft: string;
|
|
5
|
+
arrowUp: string;
|
|
6
|
+
ban: string;
|
|
7
|
+
check: string;
|
|
8
|
+
chevronRight: string;
|
|
9
|
+
chevronsUpDown: string;
|
|
10
|
+
code: string;
|
|
11
|
+
copy: string;
|
|
12
|
+
data: string;
|
|
13
|
+
file: string;
|
|
14
|
+
gauge: string;
|
|
15
|
+
minus: string;
|
|
16
|
+
plus: string;
|
|
17
|
+
retry: string;
|
|
18
|
+
search: string;
|
|
19
|
+
square: string;
|
|
20
|
+
textSize: string;
|
|
21
|
+
trash: string;
|
|
22
|
+
x: string;
|
|
23
|
+
};
|
|
24
|
+
export type IconName = keyof typeof PATHS;
|
|
25
|
+
export declare function Icon({ name, small, filled }: {
|
|
26
|
+
name: IconName;
|
|
27
|
+
small?: boolean;
|
|
28
|
+
filled?: boolean;
|
|
29
|
+
}): import("react").JSX.Element;
|
|
30
|
+
export declare function mod(key: string): string;
|
|
31
|
+
export declare function Hint({ label, keys, note, side, children, }: {
|
|
32
|
+
label: string;
|
|
33
|
+
keys?: string;
|
|
34
|
+
note?: string | readonly string[];
|
|
35
|
+
side?: 'top' | 'bottom';
|
|
36
|
+
children: ReactNode;
|
|
37
|
+
}): import("react").JSX.Element;
|
|
38
|
+
export type TriggerProps = {
|
|
39
|
+
'aria-expanded': boolean;
|
|
40
|
+
'aria-haspopup': 'dialog';
|
|
41
|
+
'aria-controls': string;
|
|
42
|
+
onClick: () => void;
|
|
43
|
+
};
|
|
44
|
+
export declare function Popover({ open, onOpenChange, label, side, align, className, trigger, children, }: {
|
|
45
|
+
open: boolean;
|
|
46
|
+
onOpenChange: (open: boolean) => void;
|
|
47
|
+
label: string;
|
|
48
|
+
side?: 'top' | 'bottom';
|
|
49
|
+
align?: 'start' | 'end';
|
|
50
|
+
className?: string;
|
|
51
|
+
trigger: (props: TriggerProps) => ReactNode;
|
|
52
|
+
children: ReactNode;
|
|
53
|
+
}): import("react").JSX.Element;
|
|
54
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { Effort, PageRef } from './core/contract.ts';
|
|
2
|
+
import type { Ending } from './core/ending.ts';
|
|
3
|
+
import type { RunView } from './core/run-view.ts';
|
|
4
|
+
import { type DiscussionRecord } from './discussions.ts';
|
|
5
|
+
export type Exchange = {
|
|
6
|
+
key: number;
|
|
7
|
+
question: string;
|
|
8
|
+
page: Omit<PageRef, 'visibleText'>;
|
|
9
|
+
pageLabel: string;
|
|
10
|
+
askedAt: string;
|
|
11
|
+
effort: Effort;
|
|
12
|
+
following: boolean;
|
|
13
|
+
view: RunView;
|
|
14
|
+
ending: Ending;
|
|
15
|
+
};
|
|
16
|
+
export type Running = {
|
|
17
|
+
runId: string;
|
|
18
|
+
question: string;
|
|
19
|
+
effort: Effort;
|
|
20
|
+
askedAt: string;
|
|
21
|
+
page: Omit<PageRef, 'visibleText'>;
|
|
22
|
+
label: string;
|
|
23
|
+
};
|
|
24
|
+
export type Discussion = DiscussionRecord<Exchange, Running>;
|
|
25
|
+
export declare function mergeDiscussions(stored: Discussion, incoming: Discussion): Discussion;
|
|
26
|
+
export declare function titleOf(exchanges: readonly Exchange[], running: Running | null): string;
|
|
27
|
+
export declare function useDiscussions(account: string | null): {
|
|
28
|
+
list: readonly Discussion[];
|
|
29
|
+
current: Discussion;
|
|
30
|
+
loaded: Discussion | null;
|
|
31
|
+
save: (d: Discussion) => undefined;
|
|
32
|
+
saveNow: (d: Discussion) => Promise<void>;
|
|
33
|
+
startNew: () => void;
|
|
34
|
+
open: import("react").Dispatch<import("react").SetStateAction<Discussion>>;
|
|
35
|
+
remove: (id: string) => void;
|
|
36
|
+
restore: (reopen: boolean) => Discussion | null;
|
|
37
|
+
undo: Discussion | null;
|
|
38
|
+
clearAll: () => void;
|
|
39
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
export declare const PHONE = "(max-width: 767px), (pointer: coarse) and (max-height: 500px) and (max-width: 1000px)";
|
|
3
|
+
export declare const TOUCH = "(hover: none) and (pointer: coarse)";
|
|
4
|
+
export declare function isTextEntry(el: Element | null): boolean;
|
|
5
|
+
export declare function useMatches(query: string): boolean;
|
|
6
|
+
export declare function useSoftKeyboardOpen(): boolean;
|
|
7
|
+
export type Fit = 'short' | 'tiny' | null;
|
|
8
|
+
export declare function useVisibleViewport(panel: RefObject<HTMLElement | null>, open: boolean): {
|
|
9
|
+
fit: Fit;
|
|
10
|
+
keyboard: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare function useInertPage(panel: RefObject<HTMLElement | null>, active: boolean): void;
|
package/dist/widget.d.ts
ADDED