@singlebase/elements 0.3.0 → 0.6.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/README.md +2 -0
- package/dist/{display-8HEcKYR4.js → authui-display-CKfGK5va.js} +519 -502
- package/dist/authui-display-CKfGK5va.js.map +1 -0
- package/dist/{display-CLDNNZQy.cjs → authui-display-aWNht0cW.cjs} +38 -58
- package/dist/authui-display-aWNht0cW.cjs.map +1 -0
- package/dist/authui.cjs +1 -1
- package/dist/authui.d.ts +9 -9
- package/dist/authui.js +2 -2
- package/dist/chat-C-gsskho.cjs +3258 -0
- package/dist/chat-C-gsskho.cjs.map +1 -0
- package/dist/chat-CEh6RygY.js +5746 -0
- package/dist/chat-CEh6RygY.js.map +1 -0
- package/dist/chat-messages.d.ts +115 -0
- package/dist/chat.cjs +2 -0
- package/dist/chat.cjs.map +1 -0
- package/dist/chat.d.ts +11 -0
- package/dist/chat.js +15 -0
- package/dist/chat.js.map +1 -0
- package/dist/elements/{account-screen.d.ts → authui-account.d.ts} +1 -1
- package/dist/elements/{base.d.ts → authui-base.d.ts} +2 -0
- package/dist/elements/{buttons.d.ts → authui-buttons.d.ts} +2 -2
- package/dist/elements/{display.d.ts → authui-display.d.ts} +2 -2
- package/dist/elements/{form-base.d.ts → authui-form-base.d.ts} +1 -1
- package/dist/elements/{guard.d.ts → authui-guard.d.ts} +1 -1
- package/dist/elements/{auth-screen.d.ts → authui.d.ts} +8 -4
- package/dist/elements/chat.d.ts +455 -0
- package/dist/elements/uploader.d.ts +14 -0
- package/dist/files-DDJWPzZW.js +215 -0
- package/dist/files-DDJWPzZW.js.map +1 -0
- package/dist/files-DyxcjZsx.cjs +75 -0
- package/dist/files-DyxcjZsx.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +34 -21
- package/dist/index.js.map +1 -1
- package/dist/singlebase-elements.min.js +8044 -2120
- package/dist/singlebase-elements.min.js.map +1 -1
- package/dist/styles/branding.d.ts +5 -0
- package/dist/styles/chat.d.ts +6 -0
- package/dist/styles/tokens.d.ts +3 -1
- package/dist/{uploader-eFYKpk8b.cjs → uploader-660JIgIN.cjs} +55 -114
- package/dist/uploader-660JIgIN.cjs.map +1 -0
- package/dist/{uploader-D-Da1trc.js → uploader-vfczkX51.js} +376 -507
- package/dist/uploader-vfczkX51.js.map +1 -0
- package/dist/uploader.cjs +1 -1
- package/dist/uploader.js +5 -4
- package/dist/uploader.js.map +1 -1
- package/dist/utils/branding.d.ts +8 -0
- package/dist/utils/markdown.d.ts +165 -0
- package/dist/utils/svg.d.ts +10 -0
- package/package.json +13 -5
- package/dist/display-8HEcKYR4.js.map +0 -1
- package/dist/display-CLDNNZQy.cjs.map +0 -1
- package/dist/uploader-D-Da1trc.js.map +0 -1
- package/dist/uploader-eFYKpk8b.cjs.map +0 -1
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default copy for <singlebase-chat>. Same contract as the auth and upload
|
|
3
|
+
* bags: flat strings, overridable in whole or in part through `.messages`.
|
|
4
|
+
*
|
|
5
|
+
* `{name}`, `{n}` and `{query}` are filled in by `fill()` from upload-messages.
|
|
6
|
+
*/
|
|
7
|
+
export interface SinglebaseChatMessages {
|
|
8
|
+
eyebrowChat: string;
|
|
9
|
+
eyebrowRag: string;
|
|
10
|
+
headingChat: string;
|
|
11
|
+
headingRag: string;
|
|
12
|
+
descriptionChat: string;
|
|
13
|
+
descriptionRag: string;
|
|
14
|
+
placeholderChat: string;
|
|
15
|
+
placeholderRag: string;
|
|
16
|
+
footnote: string;
|
|
17
|
+
attach: string;
|
|
18
|
+
send: string;
|
|
19
|
+
stop: string;
|
|
20
|
+
removeFile: string;
|
|
21
|
+
dropTitle: string;
|
|
22
|
+
dropSub: string;
|
|
23
|
+
thinking: string;
|
|
24
|
+
searching: string;
|
|
25
|
+
chats: string;
|
|
26
|
+
newChat: string;
|
|
27
|
+
searchChats: string;
|
|
28
|
+
groupBookmarked: string;
|
|
29
|
+
groupToday: string;
|
|
30
|
+
groupYesterday: string;
|
|
31
|
+
groupWeek: string;
|
|
32
|
+
groupOlder: string;
|
|
33
|
+
noChats: string;
|
|
34
|
+
noMatch: string;
|
|
35
|
+
loadingChats: string;
|
|
36
|
+
showChats: string;
|
|
37
|
+
hideSidebar: string;
|
|
38
|
+
untitled: string;
|
|
39
|
+
renameChat: string;
|
|
40
|
+
bookmarkChat: string;
|
|
41
|
+
unbookmarkChat: string;
|
|
42
|
+
exportChat: string;
|
|
43
|
+
deleteChat: string;
|
|
44
|
+
expand: string;
|
|
45
|
+
restore: string;
|
|
46
|
+
minimize: string;
|
|
47
|
+
exportHeading: string;
|
|
48
|
+
exportMarkdown: string;
|
|
49
|
+
exportJson: string;
|
|
50
|
+
exportText: string;
|
|
51
|
+
exportCopy: string;
|
|
52
|
+
copy: string;
|
|
53
|
+
copied: string;
|
|
54
|
+
edit: string;
|
|
55
|
+
saveResend: string;
|
|
56
|
+
cancel: string;
|
|
57
|
+
regenerate: string;
|
|
58
|
+
helpful: string;
|
|
59
|
+
notHelpful: string;
|
|
60
|
+
markedHelpful: string;
|
|
61
|
+
thanksFeedback: string;
|
|
62
|
+
bookmarkMessage: string;
|
|
63
|
+
unbookmarkMessage: string;
|
|
64
|
+
deleteMessage: string;
|
|
65
|
+
saved: string;
|
|
66
|
+
stopped: string;
|
|
67
|
+
emptyReply: string;
|
|
68
|
+
newReply: string;
|
|
69
|
+
you: string;
|
|
70
|
+
sourcesCited: string;
|
|
71
|
+
sourcesRetrieved: string;
|
|
72
|
+
searchedSources: string;
|
|
73
|
+
sourceLabel: string;
|
|
74
|
+
openSource: string;
|
|
75
|
+
citedPassage: string;
|
|
76
|
+
copyReference: string;
|
|
77
|
+
alsoCited: string;
|
|
78
|
+
close: string;
|
|
79
|
+
renderingChart: string;
|
|
80
|
+
renderingSvg: string;
|
|
81
|
+
copySvg: string;
|
|
82
|
+
showRaw: string;
|
|
83
|
+
showFormatted: string;
|
|
84
|
+
showingRows: string;
|
|
85
|
+
calloutNote: string;
|
|
86
|
+
calloutTip: string;
|
|
87
|
+
calloutImportant: string;
|
|
88
|
+
calloutWarning: string;
|
|
89
|
+
calloutCaution: string;
|
|
90
|
+
undo: string;
|
|
91
|
+
chatDeleted: string;
|
|
92
|
+
messageDeleted: string;
|
|
93
|
+
messageBookmarked: string;
|
|
94
|
+
bookmarkRemoved: string;
|
|
95
|
+
chatBookmarked: string;
|
|
96
|
+
chatUnbookmarked: string;
|
|
97
|
+
exported: string;
|
|
98
|
+
copiedMarkdown: string;
|
|
99
|
+
fileTooLarge: string;
|
|
100
|
+
fileType: string;
|
|
101
|
+
tooManyFiles: string;
|
|
102
|
+
errGeneric: string;
|
|
103
|
+
errNotFound: string;
|
|
104
|
+
errNoClient: string;
|
|
105
|
+
errLoad: string;
|
|
106
|
+
retry: string;
|
|
107
|
+
offline: string;
|
|
108
|
+
bubbleText: string;
|
|
109
|
+
openChat: string;
|
|
110
|
+
closeChat: string;
|
|
111
|
+
dismiss: string;
|
|
112
|
+
brandingLabel: string;
|
|
113
|
+
}
|
|
114
|
+
export declare const defaultChatMessages: SinglebaseChatMessages;
|
|
115
|
+
export declare function resolveChatMessages(overrides: Partial<SinglebaseChatMessages> | undefined): SinglebaseChatMessages;
|
package/dist/chat.cjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chat-C-gsskho.cjs");Object.defineProperty(exports,"SinglebaseChat",{enumerable:!0,get:()=>e.SinglebaseChat});exports.adaptBlocks=e.adaptBlocks;exports.citedNumbers=e.citedNumbers;exports.defaultChatMessages=e.defaultChatMessages;exports.describeSource=e.describeSource;exports.parseInline=e.parseInline;exports.parseMarkdown=e.parseMarkdown;exports.resolveChatMessages=e.resolveChatMessages;exports.settleStreaming=e.settleStreaming;exports.splitFollowups=e.splitFollowups;exports.svgDataUrl=e.svgDataUrl;
|
|
2
|
+
//# sourceMappingURL=chat.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/chat.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@singlebase/elements/chat` — <singlebase-chat> on its own, without the
|
|
3
|
+
* authentication elements or the uploader. Importing it registers the tag.
|
|
4
|
+
*/
|
|
5
|
+
export { SinglebaseChat, describeSource } from "./elements/chat.js";
|
|
6
|
+
export type { ChatAfterParse, ChatAttachment, ChatBeforeSend, ChatBlockRenderer, ChatClient, ChatConfig, ChatEmbed, ChatExportFormat, ChatGlow, ChatMessage, ChatMode, ChatPrompt, ChatSidebar, ChatSummary } from "./elements/chat.js";
|
|
7
|
+
export { adaptBlocks, citedNumbers, parseInline, parseMarkdown, settleStreaming, splitFollowups } from "./utils/markdown.js";
|
|
8
|
+
export { svgDataUrl } from "./utils/svg.js";
|
|
9
|
+
export type { Block, ChartSpec, ChatFormat, Segment } from "./utils/markdown.js";
|
|
10
|
+
export { defaultChatMessages, resolveChatMessages } from "./chat-messages.js";
|
|
11
|
+
export type { SinglebaseChatMessages } from "./chat-messages.js";
|
package/dist/chat.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { S as e, a as r, c as t, d as l, b as o, p, e as d, r as g, s as i, f as c, g as n } from "./chat-CEh6RygY.js";
|
|
2
|
+
export {
|
|
3
|
+
e as SinglebaseChat,
|
|
4
|
+
r as adaptBlocks,
|
|
5
|
+
t as citedNumbers,
|
|
6
|
+
l as defaultChatMessages,
|
|
7
|
+
o as describeSource,
|
|
8
|
+
p as parseInline,
|
|
9
|
+
d as parseMarkdown,
|
|
10
|
+
g as resolveChatMessages,
|
|
11
|
+
i as settleStreaming,
|
|
12
|
+
c as splitFollowups,
|
|
13
|
+
n as svgDataUrl
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=chat.js.map
|
package/dist/chat.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type PropertyValues } from "lit";
|
|
2
2
|
import { type AuthSettings } from "@singlebase/singlebase-sdk";
|
|
3
|
-
import { SinglebaseFormBase } from "./form-base.js";
|
|
3
|
+
import { SinglebaseFormBase } from "./authui-form-base.js";
|
|
4
4
|
import "./uploader.js";
|
|
5
5
|
/**
|
|
6
6
|
* The authenticated account view, laid out exactly as the design mock's
|
|
@@ -27,6 +27,8 @@ export declare abstract class SinglebaseElementBase extends LitElement {
|
|
|
27
27
|
* same reason as theme/density — the CSS is an attribute selector.
|
|
28
28
|
*/
|
|
29
29
|
accessor fieldStyle: "outline" | "underline" | undefined;
|
|
30
|
+
/** Corner preset for this element: `sharp`, `default` or `round`. */
|
|
31
|
+
accessor radius: "sharp" | "default" | "round" | undefined;
|
|
30
32
|
protected auth: AuthController;
|
|
31
33
|
/**
|
|
32
34
|
* Resolution order: an explicit `.client`, then the page's default
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { nothing, type PropertyValues } from "lit";
|
|
2
2
|
import type { AuthSettings, OAuthIntent } from "@singlebase/singlebase-sdk";
|
|
3
|
-
import { SinglebaseFormBase } from "./form-base.js";
|
|
3
|
+
import { SinglebaseFormBase } from "./authui-form-base.js";
|
|
4
4
|
export type ButtonsType = "signout" | "oauth" | "link";
|
|
5
5
|
/**
|
|
6
6
|
* The widget's action buttons, selected with `type`:
|
|
@@ -36,7 +36,7 @@ export declare class SinglebaseAuthButtons extends SinglebaseFormBase {
|
|
|
36
36
|
private renderLink;
|
|
37
37
|
private onSignOut;
|
|
38
38
|
private renderSignOut;
|
|
39
|
-
protected render(): import("lit").TemplateResult<1
|
|
39
|
+
protected render(): typeof nothing | import("lit").TemplateResult<1>;
|
|
40
40
|
}
|
|
41
41
|
declare global {
|
|
42
42
|
interface HTMLElementTagNameMap {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { nothing, type PropertyValues } from "lit";
|
|
2
|
-
import { SinglebaseElementBase } from "./base.js";
|
|
2
|
+
import { SinglebaseElementBase } from "./authui-base.js";
|
|
3
3
|
/**
|
|
4
4
|
* Displays one value from the signed-in profile, as text or as an avatar.
|
|
5
5
|
*
|
|
@@ -41,7 +41,7 @@ export declare class SinglebaseAuthDisplay extends SinglebaseElementBase {
|
|
|
41
41
|
/** The resolved value as a string, or "" when there is nothing to show. */
|
|
42
42
|
private get textValue();
|
|
43
43
|
private get avatarSrc();
|
|
44
|
-
protected render(): import("lit").TemplateResult<1
|
|
44
|
+
protected render(): typeof nothing | import("lit").TemplateResult<1>;
|
|
45
45
|
private renderAvatar;
|
|
46
46
|
}
|
|
47
47
|
declare global {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Predicate } from "@singlebase/core";
|
|
2
|
-
import { SinglebaseElementBase } from "./base.js";
|
|
2
|
+
import { SinglebaseElementBase } from "./authui-base.js";
|
|
3
3
|
export type GuardState = "loading" | "authenticated" | "unauthenticated";
|
|
4
4
|
/**
|
|
5
5
|
* Renders content conditionally on auth state, and optionally on a predicate
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { nothing, type PropertyValues } from "lit";
|
|
2
2
|
import { type AuthSettings } from "@singlebase/singlebase-sdk";
|
|
3
|
-
import { SinglebaseElementBase } from "./base.js";
|
|
4
|
-
import "./account
|
|
5
|
-
import "./buttons.js";
|
|
3
|
+
import { SinglebaseElementBase } from "./authui-base.js";
|
|
4
|
+
import "./authui-account.js";
|
|
5
|
+
import "./authui-buttons.js";
|
|
6
6
|
/** Screens a signed-out visitor may reach. */
|
|
7
7
|
export type GuestScreen = "signin" | "signup" | "forgot" | "verify" | "otp" | "newpass" | "invite";
|
|
8
8
|
/** Screens that require a live session. */
|
|
@@ -70,6 +70,10 @@ export declare class SinglebaseAuthScreen extends SinglebaseElementBase {
|
|
|
70
70
|
* thing that fails a security review, and deservedly.
|
|
71
71
|
*/
|
|
72
72
|
accessor branding: boolean;
|
|
73
|
+
/** The credit's text. Empty uses the element's default ("… by Singlebase"). */
|
|
74
|
+
accessor brandingText: string;
|
|
75
|
+
/** Where the credit links to. Only http(s); anything else uses singlebase.cloud. */
|
|
76
|
+
accessor brandingUrl: string;
|
|
73
77
|
/**
|
|
74
78
|
* Where to send the user once a session exists. Same-origin only — an
|
|
75
79
|
* absolute URL pointing anywhere else is refused, because a login widget
|
|
@@ -206,7 +210,7 @@ export declare class SinglebaseAuthScreen extends SinglebaseElementBase {
|
|
|
206
210
|
private onInterstitialSignOut;
|
|
207
211
|
/** The Terms/Privacy consent line, rendered only when the host supplies a link. */
|
|
208
212
|
private renderConsent;
|
|
209
|
-
protected render(): import("lit").TemplateResult<1
|
|
213
|
+
protected render(): typeof nothing | import("lit").TemplateResult<1>;
|
|
210
214
|
}
|
|
211
215
|
declare global {
|
|
212
216
|
interface HTMLElementTagNameMap {
|