@inploi/plugin-kin 2.0.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/cdn/index.js +121 -0
- package/dist/code-block-37QAKDTI-b5c12d79.js +26 -0
- package/dist/code-block-37QAKDTI-ca6c9b98.cjs +2 -0
- package/dist/components/chat-panel.d.ts +8 -0
- package/dist/components/icons.d.ts +28 -0
- package/dist/components/launcher-input.d.ts +17 -0
- package/dist/components/markdown.d.ts +7 -0
- package/dist/components/messages.d.ts +1 -0
- package/dist/components/widget.d.ts +17 -0
- package/dist/index-ac748070.cjs +120 -0
- package/dist/index-e5dbdc11.js +26635 -0
- package/dist/index.cdn.d.ts +9 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.dev.d.ts +1 -0
- package/dist/kin.client.d.ts +59 -0
- package/dist/kin.d.ts +39 -0
- package/dist/kin.state.d.ts +58 -0
- package/dist/kin.theme.d.ts +39 -0
- package/dist/mermaid-4DMBBIKO-807d8577.js +5 -0
- package/dist/mermaid-4DMBBIKO-c9e92f22.cjs +1 -0
- package/dist/plugin-kin.cjs +1 -0
- package/dist/plugin-kin.js +6 -0
- package/package.json +48 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { b as m, x as h, F as u, o as r, q as f, N as k, c as p, h as x, p as N, a as v } from "./index-e5dbdc11.js";
|
|
2
|
+
import "@inploi/sdk";
|
|
3
|
+
var y = m("block", "before:content-[counter(line)]", "before:inline-block", "before:[counter-increment:line]", "before:w-6", "before:mr-4", "before:text-[13px]", "before:text-right", "before:text-muted-foreground/50", "before:font-mono", "before:select-none"), w = h(({ children: a, result: e, language: o, className: s, ...g }) => {
|
|
4
|
+
let d = u(() => ({ backgroundColor: e.bg, color: e.fg }), [e.bg, e.fg]);
|
|
5
|
+
return r("pre", { className: m(s, "p-4 text-sm dark:bg-(--shiki-dark-bg)!"), "data-language": o, "data-streamdown": "code-block-body", style: d, ...g, children: r("code", { className: "[counter-increment:line_0] [counter-reset:line]", children: e.tokens.map((c, l) => r("span", { className: y, children: c.map((t, n) => r("span", { className: "dark:bg-(--shiki-dark-bg)! dark:text-(--shiki-dark)!", style: { color: t.color, backgroundColor: t.bgColor, ...t.htmlStyle }, ...t.htmlAttrs, children: t.content }, n)) }, l)) }) });
|
|
6
|
+
}, (a, e) => a.result === e.result && a.language === e.language && a.className === e.className), C = ({ className: a, language: e, style: o, ...s }) => r("div", { className: m("my-4 w-full overflow-hidden rounded-xl border border-border", a), "data-language": e, "data-streamdown": "code-block", style: { contentVisibility: "auto", containIntrinsicSize: "auto 200px", ...o }, ...s }), S = ({ language: a, children: e }) => r("div", { className: "flex items-center justify-between bg-muted/80 p-3 text-muted-foreground text-xs", "data-language": a, "data-streamdown": "code-block-header", children: [r("span", { className: "ml-1 font-mono lowercase", children: a }), r("div", { className: "flex items-center gap-2", children: e })] }), z = ({ code: a, language: e, className: o, children: s, ...g }) => {
|
|
7
|
+
let { shikiTheme: d } = f(k), c = p(), l = u(() => ({ bg: "transparent", fg: "inherit", tokens: a.split(`
|
|
8
|
+
`).map((i) => [{ content: i, color: "inherit", bgColor: "transparent", htmlStyle: {}, offset: 0 }]) }), [a]), [t, n] = x(l);
|
|
9
|
+
return N(() => {
|
|
10
|
+
if (!c) {
|
|
11
|
+
n(l);
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
let i = c.highlight({ code: a, language: e, themes: d }, (b) => {
|
|
15
|
+
n(b);
|
|
16
|
+
});
|
|
17
|
+
if (i) {
|
|
18
|
+
n(i);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
n(l);
|
|
22
|
+
}, [a, e, d, c, l]), r(v.Provider, { value: { code: a }, children: r(C, { language: e, children: [r(S, { language: e, children: s }), r(w, { className: o, language: e, result: t, ...g })] }) });
|
|
23
|
+
};
|
|
24
|
+
export {
|
|
25
|
+
z as CodeBlock
|
|
26
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-ac748070.cjs");require("@inploi/sdk");var m=e.b("block","before:content-[counter(line)]","before:inline-block","before:[counter-increment:line]","before:w-6","before:mr-4","before:text-[13px]","before:text-right","before:text-muted-foreground/50","before:font-mono","before:select-none"),b=e.x(({children:a,result:r,language:n,className:c,...g})=>{let d=e.F(()=>({backgroundColor:r.bg,color:r.fg}),[r.bg,r.fg]);return e.o("pre",{className:e.b(c,"p-4 text-sm dark:bg-(--shiki-dark-bg)!"),"data-language":n,"data-streamdown":"code-block-body",style:d,...g,children:e.o("code",{className:"[counter-increment:line_0] [counter-reset:line]",children:r.tokens.map((s,l)=>e.o("span",{className:m,children:s.map((t,o)=>e.o("span",{className:"dark:bg-(--shiki-dark-bg)! dark:text-(--shiki-dark)!",style:{color:t.color,backgroundColor:t.bgColor,...t.htmlStyle},...t.htmlAttrs,children:t.content},o))},l))})})},(a,r)=>a.result===r.result&&a.language===r.language&&a.className===r.className),h=({className:a,language:r,style:n,...c})=>e.o("div",{className:e.b("my-4 w-full overflow-hidden rounded-xl border border-border",a),"data-language":r,"data-streamdown":"code-block",style:{contentVisibility:"auto",containIntrinsicSize:"auto 200px",...n},...c}),f=({language:a,children:r})=>e.o("div",{className:"flex items-center justify-between bg-muted/80 p-3 text-muted-foreground text-xs","data-language":a,"data-streamdown":"code-block-header",children:[e.o("span",{className:"ml-1 font-mono lowercase",children:a}),e.o("div",{className:"flex items-center gap-2",children:r})]}),k=({code:a,language:r,className:n,children:c,...g})=>{let{shikiTheme:d}=e.q(e.N),s=e.cr(),l=e.F(()=>({bg:"transparent",fg:"inherit",tokens:a.split(`
|
|
2
|
+
`).map(i=>[{content:i,color:"inherit",bgColor:"transparent",htmlStyle:{},offset:0}])}),[a]),[t,o]=e.h(l);return e.p(()=>{if(!s){o(l);return}let i=s.highlight({code:a,language:r,themes:d},u=>{o(u)});if(i){o(i);return}o(l)},[a,r,d,s,l]),e.o(e.ao.Provider,{value:{code:a},children:e.o(h,{language:r,children:[e.o(f,{language:r,children:c}),e.o(b,{className:n,language:r,result:t,...g})]})})};exports.CodeBlock=k;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type ChatPanelProps = {
|
|
2
|
+
onClose: () => void;
|
|
3
|
+
onClearData: () => void;
|
|
4
|
+
/** Called when skip link is clicked to focus the input (hash links don't work in Shadow DOM) */
|
|
5
|
+
onSkipToInput: () => void;
|
|
6
|
+
};
|
|
7
|
+
export declare function ChatPanel({ onClose, onClearData, onSkipToInput }: ChatPanelProps): import("preact").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SVG Icons for Kin Plugin
|
|
3
|
+
*
|
|
4
|
+
* All icons are decorative and include aria-hidden="true"
|
|
5
|
+
* When using icons with interactive elements, ensure the parent
|
|
6
|
+
* has appropriate aria-label for accessibility.
|
|
7
|
+
*/
|
|
8
|
+
type IconProps = {
|
|
9
|
+
class?: string;
|
|
10
|
+
/** Override aria-hidden for non-decorative uses */
|
|
11
|
+
'aria-hidden'?: boolean | 'true' | 'false';
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Kin Logo - Official inploi logomark
|
|
15
|
+
* Source: /kin/public/inploi-logomark-white.svg
|
|
16
|
+
*/
|
|
17
|
+
export declare function KinIcon({ class: className, 'aria-hidden': ariaHidden }: IconProps): import("preact").JSX.Element;
|
|
18
|
+
/** Arrow up icon for send button */
|
|
19
|
+
export declare function ArrowUpIcon({ class: className, 'aria-hidden': ariaHidden }: IconProps): import("preact").JSX.Element;
|
|
20
|
+
/** Close X icon */
|
|
21
|
+
export declare function CloseIcon({ class: className, 'aria-hidden': ariaHidden }: IconProps): import("preact").JSX.Element;
|
|
22
|
+
/** Trash icon for clear data button */
|
|
23
|
+
export declare function TrashIcon({ class: className, 'aria-hidden': ariaHidden }: IconProps): import("preact").JSX.Element;
|
|
24
|
+
/** Attachment/paperclip icon for file upload */
|
|
25
|
+
export declare function AttachmentIcon({ class: className, 'aria-hidden': ariaHidden }: IconProps): import("preact").JSX.Element;
|
|
26
|
+
/** Loading spinner icon */
|
|
27
|
+
export declare function SpinnerIcon({ class: className, 'aria-hidden': ariaHidden }: IconProps): import("preact").JSX.Element;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { StarterPrompt } from '../kin';
|
|
2
|
+
|
|
3
|
+
type LauncherInputProps = {
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
starterPrompts: StarterPrompt[];
|
|
6
|
+
onOpen: () => void;
|
|
7
|
+
onClose: () => void;
|
|
8
|
+
onSendMessage: (content: string) => void;
|
|
9
|
+
/** Called on focus to initiate connection early */
|
|
10
|
+
onConnect: () => void;
|
|
11
|
+
/** Called when user selects a file to upload */
|
|
12
|
+
onUploadFile: (file: File, fileType: string) => void;
|
|
13
|
+
/** External ref for the input element (used by skip link in Shadow DOM) */
|
|
14
|
+
inputRef?: preact.RefObject<HTMLInputElement>;
|
|
15
|
+
};
|
|
16
|
+
export declare function LauncherInput({ isOpen, starterPrompts, onOpen, onClose, onSendMessage, onConnect, onUploadFile, inputRef: externalInputRef }: LauncherInputProps): import("preact").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Messages(): import("preact").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { StarterPrompt } from '../kin';
|
|
2
|
+
|
|
3
|
+
type WidgetProps = {
|
|
4
|
+
/** Starter prompts shown in empty state */
|
|
5
|
+
starterPrompts: StarterPrompt[];
|
|
6
|
+
onSendMessage: (content: string) => void;
|
|
7
|
+
onOpen: () => void;
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
/** Called when input is focused to initiate connection early */
|
|
10
|
+
onConnect: () => void;
|
|
11
|
+
/** Called when user requests to clear their data */
|
|
12
|
+
onClearData: () => void;
|
|
13
|
+
/** Called when user selects a file to upload */
|
|
14
|
+
onUploadFile: (file: File, fileType: string) => void;
|
|
15
|
+
};
|
|
16
|
+
export declare function Widget({ starterPrompts, onSendMessage, onOpen, onClose, onConnect, onClearData, onUploadFile }: WidgetProps): import("preact").JSX.Element;
|
|
17
|
+
export {};
|