@websolutespa/llm-plugin-maxmeyer 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/CHANGELOG.md +7 -0
- package/README.md +159 -0
- package/dist/esm/__tests/example.test.js +9 -0
- package/dist/esm/__tests/example.test.js.map +1 -0
- package/dist/esm/blocks/Action/action.js +32 -0
- package/dist/esm/blocks/Action/action.js.map +1 -0
- package/dist/esm/blocks/Action/action.module.scss +5 -0
- package/dist/esm/blocks/ActionGroup/action-group.js +17 -0
- package/dist/esm/blocks/ActionGroup/action-group.js.map +1 -0
- package/dist/esm/blocks/ActionGroup/action-group.module.scss +8 -0
- package/dist/esm/blocks/AssistantMessage/assistant-message.js +18 -0
- package/dist/esm/blocks/AssistantMessage/assistant-message.js.map +1 -0
- package/dist/esm/blocks/CustomCard/custom-card.js +68 -0
- package/dist/esm/blocks/CustomCard/custom-card.js.map +1 -0
- package/dist/esm/blocks/CustomCard/custom-card.module.scss +64 -0
- package/dist/esm/blocks/CustomCardGroup/custom-card-group.js +65 -0
- package/dist/esm/blocks/CustomCardGroup/custom-card-group.js.map +1 -0
- package/dist/esm/blocks/CustomCardGroup/custom-card-group.module.scss +58 -0
- package/dist/esm/blocks/FormRecap/FormRecap.js +250 -0
- package/dist/esm/blocks/FormRecap/FormRecap.js.map +1 -0
- package/dist/esm/blocks/FormRecap/form-recap.module.scss +103 -0
- package/dist/esm/blocks/FormRecapError/FormRecapError.js +19 -0
- package/dist/esm/blocks/FormRecapError/FormRecapError.js.map +1 -0
- package/dist/esm/blocks/FormRecapError/form-recap-error.module.scss +7 -0
- package/dist/esm/blocks/FormRecapSuccess/FormRecapSuccess.js +19 -0
- package/dist/esm/blocks/FormRecapSuccess/FormRecapSuccess.js.map +1 -0
- package/dist/esm/blocks/FormRecapSuccess/form-recap-success.module.scss +7 -0
- package/dist/esm/blocks/FormRequest/FormRequest.js +36 -0
- package/dist/esm/blocks/FormRequest/FormRequest.js.map +1 -0
- package/dist/esm/blocks/FormRequest/form-request.module.scss +17 -0
- package/dist/esm/blocks/NotFound/not-found.js +15 -0
- package/dist/esm/blocks/NotFound/not-found.js.map +1 -0
- package/dist/esm/blocks/NotFound/not-found.module.scss +5 -0
- package/dist/esm/blocks/StreamError/StreamError.js +46 -0
- package/dist/esm/blocks/StreamError/StreamError.js.map +1 -0
- package/dist/esm/blocks/StreamError/_style.scss +34 -0
- package/dist/esm/blocks/UserMessage/user-message.js +22 -0
- package/dist/esm/blocks/UserMessage/user-message.js.map +1 -0
- package/dist/esm/blocks/UserMessage/user-message.module.scss +13 -0
- package/dist/esm/blocks/index.js +28 -0
- package/dist/esm/blocks/index.js.map +1 -0
- package/dist/esm/components/chat/Root/root.js +36 -0
- package/dist/esm/components/chat/Root/root.js.map +1 -0
- package/dist/esm/components/chat/Root/root.module.scss +58 -0
- package/dist/esm/components/chat/Thread/thread.js +40 -0
- package/dist/esm/components/chat/Thread/thread.js.map +1 -0
- package/dist/esm/components/chat/Thread/thread.module.scss +30 -0
- package/dist/esm/components/chat/index.js +8 -0
- package/dist/esm/components/chat/index.js.map +1 -0
- package/dist/esm/components/index.js +3 -0
- package/dist/esm/components/index.js.map +1 -0
- package/dist/esm/components/page/PageLoading/page-loading.js +32 -0
- package/dist/esm/components/page/PageLoading/page-loading.js.map +1 -0
- package/dist/esm/components/page/PageLoading/page-loading.module.scss +302 -0
- package/dist/esm/components/page/PageRoot/page-root.js +31 -0
- package/dist/esm/components/page/PageRoot/page-root.js.map +1 -0
- package/dist/esm/components/page/PageRoot/page-root.module.scss +24 -0
- package/dist/esm/components/page/PageStreamingIndicator/page-streaming-indicator.js +18 -0
- package/dist/esm/components/page/PageStreamingIndicator/page-streaming-indicator.js.map +1 -0
- package/dist/esm/components/page/PageStreamingIndicator/page-streaming-indicator.module.scss +38 -0
- package/dist/esm/components/page/PageTrigger/page-trigger.js +20 -0
- package/dist/esm/components/page/PageTrigger/page-trigger.js.map +1 -0
- package/dist/esm/components/page/PageTrigger/page-trigger.module.scss +16 -0
- package/dist/esm/components/page/index.js +12 -0
- package/dist/esm/components/page/index.js.map +1 -0
- package/dist/esm/global.d.js +2 -0
- package/dist/esm/global.d.js.map +1 -0
- package/dist/esm/index.js +12 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/llm.js +42 -0
- package/dist/esm/llm.js.map +1 -0
- package/dist/esm/mock/chat/app.js +76 -0
- package/dist/esm/mock/chat/app.js.map +1 -0
- package/dist/esm/mock/chat/theme.js +337 -0
- package/dist/esm/mock/chat/theme.js.map +1 -0
- package/dist/esm/mock/chat/thread.js +450 -0
- package/dist/esm/mock/chat/thread.js.map +1 -0
- package/dist/esm/mock/index.js +8 -0
- package/dist/esm/mock/index.js.map +1 -0
- package/dist/esm/mock/page/app.js +74 -0
- package/dist/esm/mock/page/app.js.map +1 -0
- package/dist/esm/mock/page/theme.js +337 -0
- package/dist/esm/mock/page/theme.js.map +1 -0
- package/dist/esm/mock/page/thread.js +756 -0
- package/dist/esm/mock/page/thread.js.map +1 -0
- package/dist/esm/plugin.js +21 -0
- package/dist/esm/plugin.js.map +1 -0
- package/dist/esm/scss/_base.scss +63 -0
- package/dist/esm/scss/_mixin.scss +10 -0
- package/dist/esm/scss/_reset.scss +63 -0
- package/dist/esm/scss/_thread.scss +35 -0
- package/dist/esm/scss/_typography.scss +19 -0
- package/dist/esm/scss/mixin/_breakpoint.scss +7 -0
- package/dist/esm/scss/mixin/_button.scss +64 -0
- package/dist/esm/scss/mixin/_container.scss +14 -0
- package/dist/esm/scss/mixin/_markdown.scss +180 -0
- package/dist/esm/scss/mixin/_scrollbar.scss +50 -0
- package/dist/esm/scss/mixin/_shadow.scss +19 -0
- package/dist/esm/scss/mixin/_size.scss +42 -0
- package/dist/esm/scss/mixin/_typography.scss +129 -0
- package/dist/esm/scss/mixin/_utils.scss +103 -0
- package/dist/esm/scss/mixin/_vars.scss +4 -0
- package/dist/esm/scss/style.scss +14 -0
- package/dist/index.css +5460 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.ts +78 -0
- package/dist/umd/index.js +48828 -0
- package/dist/umd/index.js.map +1 -0
- package/dist/umd/index.min.js +20 -0
- package/package.json +119 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/blocks/UserMessage/user-message.tsx"],"sourcesContent":["import { LlmTextBlock } from '@websolutespa/bom-mixer-llm';\nimport style from './user-message.module.scss';\n\nexport type UserMessageProps = LlmTextBlock<'user'>;\n\nexport const UserMessage: React.FC<UserMessageProps> = (props) => {\n const { text } = props;\n return (\n <div className=\"llm__row\">\n <div className=\"llm__col --end-xs-12 --xs-10 --sm-9 --md-8 --lg-7 --xl-6\">\n <div className={style.UserMessage}>\n <h2 className=\"llm__text-body\" dangerouslySetInnerHTML={{ __html: text }} />\n </div>\n </div>\n </div>\n );\n};\n\n"],"names":["style","UserMessage","props","text","div","className","h2","dangerouslySetInnerHTML","__html"],"mappings":";AACA,OAAOA,WAAW,6BAA6B;AAI/C,OAAO,MAAMC,cAA0C,CAACC;IACtD,MAAM,EAAEC,IAAI,EAAE,GAAGD;IACjB,qBACE,KAACE;QAAIC,WAAU;kBACb,cAAA,KAACD;YAAIC,WAAU;sBACb,cAAA,KAACD;gBAAIC,WAAWL,MAAMC,WAAW;0BAC/B,cAAA,KAACK;oBAAGD,WAAU;oBAAiBE,yBAAyB;wBAAEC,QAAQL;oBAAK;;;;;AAKjF,EAAE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
@import '../../scss/mixin';
|
|
2
|
+
|
|
3
|
+
.UserMessage {
|
|
4
|
+
@include text(body3);
|
|
5
|
+
padding: size(3) size(4);
|
|
6
|
+
color: var(--llm-color-neutral-100);
|
|
7
|
+
border-radius: 6px;
|
|
8
|
+
border: 1px solid var(--llm-color-neutral-900);
|
|
9
|
+
background: linear-gradient(91deg, var(--llm-color-neutral-900) 18.52%, var(--llm-color-neutral-800) 95%);
|
|
10
|
+
width: fit-content;
|
|
11
|
+
margin-left: auto;
|
|
12
|
+
min-width: 200px;
|
|
13
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Action } from './Action/action';
|
|
2
|
+
import { ActionGroup } from './ActionGroup/action-group';
|
|
3
|
+
import { AssistantMessage } from './AssistantMessage/assistant-message';
|
|
4
|
+
import { CustomCard } from './CustomCard/custom-card';
|
|
5
|
+
import { CustomCardGroup } from './CustomCardGroup/custom-card-group';
|
|
6
|
+
import { FormRecap } from './FormRecap/FormRecap';
|
|
7
|
+
import { FormRecapError } from './FormRecapError/FormRecapError';
|
|
8
|
+
import { FormRecapSuccess } from './FormRecapSuccess/FormRecapSuccess';
|
|
9
|
+
import { FormRequest } from './FormRequest/FormRequest';
|
|
10
|
+
import { NotFound } from './NotFound/not-found';
|
|
11
|
+
import { StreamError } from './StreamError/StreamError';
|
|
12
|
+
import { UserMessage } from './UserMessage/user-message';
|
|
13
|
+
export const blocks = {
|
|
14
|
+
action: Action,
|
|
15
|
+
actionGroup: ActionGroup,
|
|
16
|
+
assistantMessage: AssistantMessage,
|
|
17
|
+
customCard: CustomCard,
|
|
18
|
+
customCardGroup: CustomCardGroup,
|
|
19
|
+
formRecap: FormRecap,
|
|
20
|
+
formRecapError: FormRecapError,
|
|
21
|
+
formRecapSuccess: FormRecapSuccess,
|
|
22
|
+
formRequest: FormRequest,
|
|
23
|
+
notFound: NotFound,
|
|
24
|
+
error: StreamError,
|
|
25
|
+
userMessage: UserMessage
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/blocks/index.ts"],"sourcesContent":["import { Action } from './Action/action';\nimport { ActionGroup } from './ActionGroup/action-group';\nimport { AssistantMessage } from './AssistantMessage/assistant-message';\nimport { CustomCard } from './CustomCard/custom-card';\nimport { CustomCardGroup } from './CustomCardGroup/custom-card-group';\nimport { FormRecap } from './FormRecap/FormRecap';\nimport { FormRecapError } from './FormRecapError/FormRecapError';\nimport { FormRecapSuccess } from './FormRecapSuccess/FormRecapSuccess';\nimport { FormRequest } from './FormRequest/FormRequest';\nimport { NotFound } from './NotFound/not-found';\nimport { StreamError } from './StreamError/StreamError';\nimport { UserMessage } from './UserMessage/user-message';\n\nexport const blocks = {\n action: Action,\n actionGroup: ActionGroup,\n assistantMessage: AssistantMessage,\n customCard: CustomCard,\n customCardGroup: CustomCardGroup,\n formRecap: FormRecap,\n formRecapError: FormRecapError,\n formRecapSuccess: FormRecapSuccess,\n formRequest: FormRequest,\n notFound: NotFound,\n error: StreamError,\n userMessage: UserMessage,\n};\n"],"names":["Action","ActionGroup","AssistantMessage","CustomCard","CustomCardGroup","FormRecap","FormRecapError","FormRecapSuccess","FormRequest","NotFound","StreamError","UserMessage","blocks","action","actionGroup","assistantMessage","customCard","customCardGroup","formRecap","formRecapError","formRecapSuccess","formRequest","notFound","error","userMessage"],"mappings":"AAAA,SAASA,MAAM,QAAQ,kBAAkB;AACzC,SAASC,WAAW,QAAQ,6BAA6B;AACzD,SAASC,gBAAgB,QAAQ,uCAAuC;AACxE,SAASC,UAAU,QAAQ,2BAA2B;AACtD,SAASC,eAAe,QAAQ,sCAAsC;AACtE,SAASC,SAAS,QAAQ,wBAAwB;AAClD,SAASC,cAAc,QAAQ,kCAAkC;AACjE,SAASC,gBAAgB,QAAQ,sCAAsC;AACvE,SAASC,WAAW,QAAQ,4BAA4B;AACxD,SAASC,QAAQ,QAAQ,uBAAuB;AAChD,SAASC,WAAW,QAAQ,4BAA4B;AACxD,SAASC,WAAW,QAAQ,6BAA6B;AAEzD,OAAO,MAAMC,SAAS;IACpBC,QAAQb;IACRc,aAAab;IACbc,kBAAkBb;IAClBc,YAAYb;IACZc,iBAAiBb;IACjBc,WAAWb;IACXc,gBAAgBb;IAChBc,kBAAkBb;IAClBc,aAAab;IACbc,UAAUb;IACVc,OAAOb;IACPc,aAAab;AACf,EAAE"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { getClassNames } from '@websolutespa/bom-core';
|
|
3
|
+
import { CanvasOffscreenProvider, Font, Main, Trigger } from '@websolutespa/bom-mixer-llm';
|
|
4
|
+
import { AnimatePresence } from 'framer-motion';
|
|
5
|
+
import { forwardRef } from 'react';
|
|
6
|
+
import '../../../scss/style.scss';
|
|
7
|
+
import style from './root.module.scss';
|
|
8
|
+
export const Root = /*#__PURE__*/ forwardRef(function Root({ opened, embedded, customIntro, shouldShowTrigger, mode }, ref) {
|
|
9
|
+
const classNames = getClassNames('llm', style.root, {
|
|
10
|
+
'-open': opened,
|
|
11
|
+
'-embedded': embedded,
|
|
12
|
+
'-custom-intro': customIntro,
|
|
13
|
+
[style['-' + mode]]: true
|
|
14
|
+
});
|
|
15
|
+
return /*#__PURE__*/ _jsx("section", {
|
|
16
|
+
ref: ref,
|
|
17
|
+
className: classNames,
|
|
18
|
+
children: /*#__PURE__*/ _jsxs(CanvasOffscreenProvider, {
|
|
19
|
+
children: [
|
|
20
|
+
/*#__PURE__*/ _jsx(Font, {}),
|
|
21
|
+
/*#__PURE__*/ _jsx(AnimatePresence, {
|
|
22
|
+
mode: "wait",
|
|
23
|
+
initial: false,
|
|
24
|
+
children: opened && /*#__PURE__*/ _jsx(Main, {}, "main")
|
|
25
|
+
}),
|
|
26
|
+
/*#__PURE__*/ _jsx(AnimatePresence, {
|
|
27
|
+
mode: "wait",
|
|
28
|
+
initial: false,
|
|
29
|
+
children: shouldShowTrigger && /*#__PURE__*/ _jsx(Trigger, {}, "trigger")
|
|
30
|
+
})
|
|
31
|
+
]
|
|
32
|
+
})
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=root.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/chat/Root/root.tsx"],"sourcesContent":["import { getClassNames } from '@websolutespa/bom-core';\nimport { CanvasOffscreenProvider, Font, Main, Trigger } from '@websolutespa/bom-mixer-llm';\nimport { AnimatePresence } from 'framer-motion';\nimport { forwardRef } from 'react';\nimport '../../../scss/style.scss';\nimport style from './root.module.scss';\n\nexport type RootProps = {\n mode: string;\n opened?: boolean;\n embedded?: boolean;\n customIntro?: boolean;\n shouldShowTrigger?: boolean;\n};\n\nexport const Root = forwardRef<HTMLDivElement, RootProps>(\n function Root({\n opened,\n embedded,\n customIntro,\n shouldShowTrigger,\n mode,\n }, ref) {\n\n const classNames = getClassNames('llm', style.root, {\n '-open': opened,\n '-embedded': embedded,\n '-custom-intro': customIntro,\n [style['-' + mode]]: true,\n });\n\n return (\n <section ref={ref} className={classNames}>\n <CanvasOffscreenProvider>\n <Font />\n <AnimatePresence mode=\"wait\" initial={false}>\n {opened && (\n <Main key=\"main\" />\n )}\n </AnimatePresence>\n <AnimatePresence mode=\"wait\" initial={false}>\n {shouldShowTrigger && (\n <Trigger key=\"trigger\" />\n )}\n </AnimatePresence>\n </CanvasOffscreenProvider>\n </section>\n );\n }\n);\n"],"names":["getClassNames","CanvasOffscreenProvider","Font","Main","Trigger","AnimatePresence","forwardRef","style","Root","opened","embedded","customIntro","shouldShowTrigger","mode","ref","classNames","root","section","className","initial"],"mappings":";AAAA,SAASA,aAAa,QAAQ,yBAAyB;AACvD,SAASC,uBAAuB,EAAEC,IAAI,EAAEC,IAAI,EAAEC,OAAO,QAAQ,8BAA8B;AAC3F,SAASC,eAAe,QAAQ,gBAAgB;AAChD,SAASC,UAAU,QAAQ,QAAQ;AACnC,OAAO,2BAA2B;AAClC,OAAOC,WAAW,qBAAqB;AAUvC,OAAO,MAAMC,qBAAOF,WAClB,SAASE,KAAK,EACZC,MAAM,EACNC,QAAQ,EACRC,WAAW,EACXC,iBAAiB,EACjBC,IAAI,EACL,EAAEC,GAAG;IAEJ,MAAMC,aAAaf,cAAc,OAAOO,MAAMS,IAAI,EAAE;QAClD,SAASP;QACT,aAAaC;QACb,iBAAiBC;QACjB,CAACJ,KAAK,CAAC,MAAMM,KAAK,CAAC,EAAE;IACvB;IAEA,qBACE,KAACI;QAAQH,KAAKA;QAAKI,WAAWH;kBAC5B,cAAA,MAACd;;8BACC,KAACC;8BACD,KAACG;oBAAgBQ,MAAK;oBAAOM,SAAS;8BACnCV,wBACC,KAACN,UAAS;;8BAGd,KAACE;oBAAgBQ,MAAK;oBAAOM,SAAS;8BACnCP,mCACC,KAACR,aAAY;;;;;AAMzB,GACA"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
@import '../../../scss/mixin';
|
|
2
|
+
|
|
3
|
+
.root {
|
|
4
|
+
--s: 1;
|
|
5
|
+
--u: 1vw;
|
|
6
|
+
--rem: 16px;
|
|
7
|
+
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
align-items: center;
|
|
11
|
+
justify-content: flex-end;
|
|
12
|
+
width: 100%;
|
|
13
|
+
height: 100%;
|
|
14
|
+
|
|
15
|
+
:global {
|
|
16
|
+
[data-main=true] {
|
|
17
|
+
container-type: inline-size;
|
|
18
|
+
--u: 1cqw;
|
|
19
|
+
--rem: 16px;
|
|
20
|
+
--margin: #{clampUnit(20, 110)};
|
|
21
|
+
--negative-margin: calc(var(--margin) * -1);
|
|
22
|
+
--gap: #{clampUnit(16, 32)};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.llm__container {
|
|
26
|
+
padding: 0 clampUnit(20, 110);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&:not([data-embedded=true]) {
|
|
31
|
+
position: fixed;
|
|
32
|
+
top: 0;
|
|
33
|
+
left: 0;
|
|
34
|
+
pointer-events: none;
|
|
35
|
+
z-index: 9999;
|
|
36
|
+
|
|
37
|
+
&[data-mode=chat] {
|
|
38
|
+
@include bp(sm) {
|
|
39
|
+
:global {
|
|
40
|
+
[data-main=true] {
|
|
41
|
+
position: absolute;
|
|
42
|
+
width: 100%;
|
|
43
|
+
height: 100%;
|
|
44
|
+
overflow: hidden;
|
|
45
|
+
top: var(--llm-chat-top);
|
|
46
|
+
right: var(--llm-chat-right);
|
|
47
|
+
bottom: var(--llm-chat-bottom);
|
|
48
|
+
left: var(--llm-chat-left);
|
|
49
|
+
max-width: var(--llm-chat-max-width);
|
|
50
|
+
max-height: var(--llm-chat-max-height);
|
|
51
|
+
border-radius: var(--llm-chat-border-radius);
|
|
52
|
+
box-shadow: var(--llm-chat-box-shadow);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { getClassNames } from '@websolutespa/bom-core';
|
|
3
|
+
import { useLabel } from '@websolutespa/bom-mixer-hooks';
|
|
4
|
+
import { ChunkWrapper, Disclaimer, Feedback, Stream, useLlm } from '@websolutespa/bom-mixer-llm';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import style from './thread.module.scss';
|
|
7
|
+
export const Thread = ()=>{
|
|
8
|
+
const label = useLabel();
|
|
9
|
+
const enableFeedback = useLlm((state)=>state.app?.contents.enableFeedback);
|
|
10
|
+
const messages = useLlm((state)=>state.messages);
|
|
11
|
+
const hasChunks = useLlm((state)=>state.chunks !== undefined);
|
|
12
|
+
return /*#__PURE__*/ _jsxs("section", {
|
|
13
|
+
className: getClassNames(style.thread, 'llm__container'),
|
|
14
|
+
children: [
|
|
15
|
+
messages.map((message, m)=>/*#__PURE__*/ _jsxs("div", {
|
|
16
|
+
className: getClassNames(style.threadMessage, message.role === 'user' ? style.threadMessageUser : style.threadMessageAssistant),
|
|
17
|
+
role: "region",
|
|
18
|
+
"aria-label": message.role === 'user' ? label('llm.question') : label('llm.answer'),
|
|
19
|
+
children: [
|
|
20
|
+
message.chunks.map((chunk, c)=>/*#__PURE__*/ _jsx(ChunkWrapper, {
|
|
21
|
+
className: getClassNames(style.threadInner, style[chunk.type]),
|
|
22
|
+
item: chunk,
|
|
23
|
+
chunkIndex: c,
|
|
24
|
+
index: m,
|
|
25
|
+
total: messages.length,
|
|
26
|
+
role: message.role
|
|
27
|
+
}, `llm-message-${m}-chunk-${c}`)),
|
|
28
|
+
message.role === 'user' ? m === 0 && /*#__PURE__*/ _jsx(Disclaimer, {}) : m === messages.length - 1 && enableFeedback && /*#__PURE__*/ _jsx(Feedback, {
|
|
29
|
+
message: message
|
|
30
|
+
})
|
|
31
|
+
]
|
|
32
|
+
}, `llm-message-${m}`)),
|
|
33
|
+
hasChunks && /*#__PURE__*/ _jsx(Stream, {
|
|
34
|
+
index: messages.length
|
|
35
|
+
})
|
|
36
|
+
]
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
//# sourceMappingURL=thread.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/chat/Thread/thread.tsx"],"sourcesContent":["import { getClassNames } from '@websolutespa/bom-core';\nimport { useLabel } from '@websolutespa/bom-mixer-hooks';\nimport { ChunkWrapper, Disclaimer, Feedback, Stream, useLlm } from '@websolutespa/bom-mixer-llm';\nimport React from 'react';\nimport style from './thread.module.scss';\n\nexport type ThreadProps = {\n};\n\nexport const Thread: React.FC<ThreadProps> = () => {\n const label = useLabel();\n const enableFeedback = useLlm(state => state.app?.contents.enableFeedback);\n const messages = useLlm(state => state.messages);\n const hasChunks = useLlm(state => state.chunks !== undefined);\n return (\n <section className={getClassNames(style.thread, 'llm__container')}>\n {messages.map((message, m) => (\n <div\n key={`llm-message-${m}`}\n className={getClassNames(style.threadMessage, message.role === 'user' ? style.threadMessageUser : style.threadMessageAssistant)}\n role=\"region\"\n aria-label={message.role === 'user' ? label('llm.question') : label('llm.answer')}>\n {message.chunks.map((chunk, c) => (\n <ChunkWrapper\n key={`llm-message-${m}-chunk-${c}`}\n className={getClassNames(style.threadInner, style[chunk.type as string])}\n item={chunk} chunkIndex={c} index={m} total={messages.length} role={message.role}\n />\n ))}\n {message.role === 'user' ? (\n m === 0 && <Disclaimer />\n ) : (\n m === messages.length - 1 && enableFeedback && <Feedback message={message} />\n )}\n </div>\n ))}\n {hasChunks && (\n <Stream index={messages.length} />\n )}\n </section>\n );\n};\n"],"names":["getClassNames","useLabel","ChunkWrapper","Disclaimer","Feedback","Stream","useLlm","React","style","Thread","label","enableFeedback","state","app","contents","messages","hasChunks","chunks","undefined","section","className","thread","map","message","m","div","threadMessage","role","threadMessageUser","threadMessageAssistant","aria-label","chunk","c","threadInner","type","item","chunkIndex","index","total","length"],"mappings":";AAAA,SAASA,aAAa,QAAQ,yBAAyB;AACvD,SAASC,QAAQ,QAAQ,gCAAgC;AACzD,SAASC,YAAY,EAAEC,UAAU,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,MAAM,QAAQ,8BAA8B;AACjG,OAAOC,WAAW,QAAQ;AAC1B,OAAOC,WAAW,uBAAuB;AAKzC,OAAO,MAAMC,SAAgC;IAC3C,MAAMC,QAAQT;IACd,MAAMU,iBAAiBL,OAAOM,CAAAA,QAASA,MAAMC,GAAG,EAAEC,SAASH;IAC3D,MAAMI,WAAWT,OAAOM,CAAAA,QAASA,MAAMG,QAAQ;IAC/C,MAAMC,YAAYV,OAAOM,CAAAA,QAASA,MAAMK,MAAM,KAAKC;IACnD,qBACE,MAACC;QAAQC,WAAWpB,cAAcQ,MAAMa,MAAM,EAAE;;YAC7CN,SAASO,GAAG,CAAC,CAACC,SAASC,kBACtB,MAACC;oBAECL,WAAWpB,cAAcQ,MAAMkB,aAAa,EAAEH,QAAQI,IAAI,KAAK,SAASnB,MAAMoB,iBAAiB,GAAGpB,MAAMqB,sBAAsB;oBAC9HF,MAAK;oBACLG,cAAYP,QAAQI,IAAI,KAAK,SAASjB,MAAM,kBAAkBA,MAAM;;wBACnEa,QAAQN,MAAM,CAACK,GAAG,CAAC,CAACS,OAAOC,kBAC1B,KAAC9B;gCAECkB,WAAWpB,cAAcQ,MAAMyB,WAAW,EAAEzB,KAAK,CAACuB,MAAMG,IAAI,CAAW;gCACvEC,MAAMJ;gCAAOK,YAAYJ;gCAAGK,OAAOb;gCAAGc,OAAOvB,SAASwB,MAAM;gCAAEZ,MAAMJ,QAAQI,IAAI;+BAF3E,CAAC,YAAY,EAAEH,EAAE,OAAO,EAAEQ,EAAE,CAAC;wBAKrCT,QAAQI,IAAI,KAAK,SAChBH,MAAM,mBAAK,KAACrB,kBAEZqB,MAAMT,SAASwB,MAAM,GAAG,KAAK5B,gCAAkB,KAACP;4BAASmB,SAASA;;;mBAd/D,CAAC,YAAY,EAAEC,EAAE,CAAC;YAkB1BR,2BACC,KAACX;gBAAOgC,OAAOtB,SAASwB,MAAM;;;;AAItC,EAAE"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
@import '../../../scss/mixin';
|
|
2
|
+
|
|
3
|
+
.thread {
|
|
4
|
+
margin-top: size(15);
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
row-gap: size(15);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.threadMessage {
|
|
11
|
+
position: relative;
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
row-gap: size(2);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.threadMessageUser {}
|
|
18
|
+
|
|
19
|
+
.threadMessageAssistant {}
|
|
20
|
+
|
|
21
|
+
.threadInner {
|
|
22
|
+
&:empty {
|
|
23
|
+
display: none;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.threadEnd {
|
|
28
|
+
height: 0;
|
|
29
|
+
margin-top: -33px;
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/chat/index.ts"],"sourcesContent":["import { Root } from './Root/root';\nimport { Thread } from './Thread/thread';\n\nexport const components = {\n Root,\n Thread,\n};\n"],"names":["Root","Thread","components"],"mappings":"AAAA,SAASA,IAAI,QAAQ,cAAc;AACnC,SAASC,MAAM,QAAQ,kBAAkB;AAEzC,OAAO,MAAMC,aAAa;IACxBF;IACAC;AACF,EAAE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/index.ts"],"sourcesContent":["export * from './chat';\n"],"names":[],"mappings":"AAAA,cAAc,SAAS"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { getClassNames } from '@websolutespa/bom-core';
|
|
3
|
+
import { useLabel } from '@websolutespa/bom-mixer-hooks';
|
|
4
|
+
import style from './page-loading.module.scss';
|
|
5
|
+
export const PageLoading = ()=>{
|
|
6
|
+
const label = useLabel();
|
|
7
|
+
return /*#__PURE__*/ _jsxs("div", {
|
|
8
|
+
className: getClassNames(style.container),
|
|
9
|
+
children: [
|
|
10
|
+
/*#__PURE__*/ _jsx("div", {
|
|
11
|
+
className: style.title,
|
|
12
|
+
children: label('llm.thinking')
|
|
13
|
+
}),
|
|
14
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
15
|
+
className: style.loading,
|
|
16
|
+
children: [
|
|
17
|
+
/*#__PURE__*/ _jsx("span", {
|
|
18
|
+
children: " "
|
|
19
|
+
}),
|
|
20
|
+
/*#__PURE__*/ _jsx("span", {
|
|
21
|
+
children: " "
|
|
22
|
+
}),
|
|
23
|
+
/*#__PURE__*/ _jsx("span", {
|
|
24
|
+
children: " "
|
|
25
|
+
})
|
|
26
|
+
]
|
|
27
|
+
})
|
|
28
|
+
]
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=page-loading.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/page/PageLoading/page-loading.tsx"],"sourcesContent":["import { getClassNames } from '@websolutespa/bom-core';\nimport { useLabel } from '@websolutespa/bom-mixer-hooks';\nimport style from './page-loading.module.scss';\n\nexport const PageLoading: React.FC = () => {\n const label = useLabel();\n return (\n <div className={getClassNames(style.container)}>\n <div className={style.title}>{label('llm.thinking')}</div>\n <div className={style.loading}>\n <span> </span>\n <span> </span>\n <span> </span>\n </div>\n </div>\n );\n};\n"],"names":["getClassNames","useLabel","style","PageLoading","label","div","className","container","title","loading","span"],"mappings":";AAAA,SAASA,aAAa,QAAQ,yBAAyB;AACvD,SAASC,QAAQ,QAAQ,gCAAgC;AACzD,OAAOC,WAAW,6BAA6B;AAE/C,OAAO,MAAMC,cAAwB;IACnC,MAAMC,QAAQH;IACd,qBACE,MAACI;QAAIC,WAAWN,cAAcE,MAAMK,SAAS;;0BAC3C,KAACF;gBAAIC,WAAWJ,MAAMM,KAAK;0BAAGJ,MAAM;;0BACpC,MAACC;gBAAIC,WAAWJ,MAAMO,OAAO;;kCAC3B,KAACC;kCAAK;;kCACN,KAACA;kCAAK;;kCACN,KAACA;kCAAK;;;;;;AAId,EAAE"}
|
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
@import '../../../scss/mixin';
|
|
2
|
+
|
|
3
|
+
.container {
|
|
4
|
+
min-height: calc(100vh - 100px);
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
align-items: center;
|
|
9
|
+
background: var(--llm-color-background);
|
|
10
|
+
color: var(--llm-color-foreground);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.title {
|
|
14
|
+
align-self: stretch;
|
|
15
|
+
font-family: var(--llm-font-primary);
|
|
16
|
+
font-size: 40px;
|
|
17
|
+
font-style: normal;
|
|
18
|
+
font-weight: 400;
|
|
19
|
+
line-height: 1.45;
|
|
20
|
+
letter-spacing: -0.02em;
|
|
21
|
+
text-align: center;
|
|
22
|
+
color: #3E3F41;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.loading {
|
|
26
|
+
flex-shrink: 0;
|
|
27
|
+
position: relative;
|
|
28
|
+
margin-top: 0.12vh;
|
|
29
|
+
width: 100px;
|
|
30
|
+
height: 100px;
|
|
31
|
+
|
|
32
|
+
span {
|
|
33
|
+
position: absolute;
|
|
34
|
+
display: block;
|
|
35
|
+
top: 0;
|
|
36
|
+
left: 0;
|
|
37
|
+
width: 100%;
|
|
38
|
+
height: 100%;
|
|
39
|
+
background-color: #D2CCC2;
|
|
40
|
+
|
|
41
|
+
&:nth-child(1) {
|
|
42
|
+
left: 0;
|
|
43
|
+
width: calc(50% - 2px);
|
|
44
|
+
top: 0;
|
|
45
|
+
height: 100%;
|
|
46
|
+
animation: loading-1 10s infinite;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&:nth-child(2) {
|
|
50
|
+
left: calc(50% + 2px);
|
|
51
|
+
width: calc(50% - 2px);
|
|
52
|
+
top: 0;
|
|
53
|
+
height: calc(30% - 2px);
|
|
54
|
+
animation: loading-2 10s infinite;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&:nth-child(3) {
|
|
58
|
+
left: calc(50% + 2px);
|
|
59
|
+
width: calc(50% - 2px);
|
|
60
|
+
top: calc(30% + 2px);
|
|
61
|
+
height: calc(70% - 2px);
|
|
62
|
+
animation: loading-3 10s infinite;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@keyframes loading-1 {
|
|
68
|
+
0% {
|
|
69
|
+
left: 0;
|
|
70
|
+
width: calc(50% - 2px);
|
|
71
|
+
top: 0;
|
|
72
|
+
height: 100%;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
10% {
|
|
76
|
+
left: 0;
|
|
77
|
+
width: calc(50% - 2px);
|
|
78
|
+
top: 0;
|
|
79
|
+
height: 100%;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
15% {
|
|
83
|
+
left: 0;
|
|
84
|
+
width: calc(50% - 2px);
|
|
85
|
+
top: 0;
|
|
86
|
+
height: calc(70% - 2px);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
30% {
|
|
90
|
+
left: 0;
|
|
91
|
+
width: calc(50% - 2px);
|
|
92
|
+
top: 0;
|
|
93
|
+
height: calc(70% - 2px);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
35% {
|
|
97
|
+
left: calc(50% + 2px);
|
|
98
|
+
width: calc(50% - 2px);
|
|
99
|
+
top: 0;
|
|
100
|
+
height: calc(70% - 2px);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
50% {
|
|
104
|
+
left: calc(50% + 2px);
|
|
105
|
+
width: calc(50% - 2px);
|
|
106
|
+
top: 0;
|
|
107
|
+
height: calc(70% - 2px);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
55% {
|
|
111
|
+
left: calc(50% + 2px);
|
|
112
|
+
width: calc(50% - 2px);
|
|
113
|
+
top: calc(70% + 2px);
|
|
114
|
+
height: calc(30% - 2px);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
70% {
|
|
118
|
+
left: calc(50% + 2px);
|
|
119
|
+
width: calc(50% - 2px);
|
|
120
|
+
top: calc(70% + 2px);
|
|
121
|
+
height: calc(30% - 2px);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
75% {
|
|
125
|
+
left: 0;
|
|
126
|
+
width: calc(50% - 2px);
|
|
127
|
+
top: calc(70% + 2px);
|
|
128
|
+
height: calc(30% - 2px);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
90% {
|
|
132
|
+
left: 0;
|
|
133
|
+
width: calc(50% - 2px);
|
|
134
|
+
top: calc(70% + 2px);
|
|
135
|
+
height: calc(30% - 2px);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
100% {
|
|
139
|
+
left: 0;
|
|
140
|
+
width: calc(50% - 2px);
|
|
141
|
+
top: 0;
|
|
142
|
+
height: 100%;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
@keyframes loading-2 {
|
|
147
|
+
0% {
|
|
148
|
+
left: calc(50% + 2px);
|
|
149
|
+
width: calc(50% - 2px);
|
|
150
|
+
top: 0;
|
|
151
|
+
height: calc(30% - 2px);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
15% {
|
|
155
|
+
left: calc(50% + 2px);
|
|
156
|
+
width: calc(50% - 2px);
|
|
157
|
+
top: 0;
|
|
158
|
+
height: calc(30% - 2px);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
20% {
|
|
162
|
+
left: calc(50% + 2px);
|
|
163
|
+
width: calc(50% - 2px);
|
|
164
|
+
top: 0;
|
|
165
|
+
height: calc(70% - 2px);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
35% {
|
|
169
|
+
left: calc(50% + 2px);
|
|
170
|
+
width: calc(50% - 2px);
|
|
171
|
+
top: 0;
|
|
172
|
+
height: calc(70% - 2px);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
40% {
|
|
176
|
+
left: calc(50% + 2px);
|
|
177
|
+
width: calc(50% - 2px);
|
|
178
|
+
top: calc(70% + 2px);
|
|
179
|
+
height: calc(30% - 2px);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
55% {
|
|
183
|
+
left: calc(50% + 2px);
|
|
184
|
+
width: calc(50% - 2px);
|
|
185
|
+
top: calc(70% + 2px);
|
|
186
|
+
height: calc(30% - 2px);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
60% {
|
|
190
|
+
left: 0;
|
|
191
|
+
width: calc(50% - 2px);
|
|
192
|
+
top: calc(30% + 2px);
|
|
193
|
+
height: calc(70% - 2px);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
75% {
|
|
197
|
+
left: 0;
|
|
198
|
+
width: calc(50% - 2px);
|
|
199
|
+
top: calc(30% + 2px);
|
|
200
|
+
height: calc(70% - 2px);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
80% {
|
|
204
|
+
left: 0;
|
|
205
|
+
width: calc(50% - 2px);
|
|
206
|
+
top: 0;
|
|
207
|
+
height: calc(70% - 2px);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
95% {
|
|
211
|
+
left: 0;
|
|
212
|
+
width: calc(50% - 2px);
|
|
213
|
+
top: 0;
|
|
214
|
+
height: calc(70% - 2px);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
100% {
|
|
218
|
+
left: calc(50% + 2px);
|
|
219
|
+
width: calc(50% - 2px);
|
|
220
|
+
top: 0;
|
|
221
|
+
height: calc(30% - 2px);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
@keyframes loading-3 {
|
|
226
|
+
0% {
|
|
227
|
+
left: calc(50% + 2px);
|
|
228
|
+
width: calc(50% - 2px);
|
|
229
|
+
top: calc(30% + 2px);
|
|
230
|
+
height: calc(70% - 2px);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
15% {
|
|
234
|
+
left: calc(50% + 2px);
|
|
235
|
+
width: calc(50% - 2px);
|
|
236
|
+
top: calc(30% + 2px);
|
|
237
|
+
height: calc(70% - 2px);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
20% {
|
|
241
|
+
left: 0;
|
|
242
|
+
width: calc(50% - 2px);
|
|
243
|
+
top: calc(70% + 2px);
|
|
244
|
+
height: calc(30% - 2px);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
35% {
|
|
248
|
+
left: 0;
|
|
249
|
+
width: calc(50% - 2px);
|
|
250
|
+
top: calc(70% + 2px);
|
|
251
|
+
height: calc(30% - 2px);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
40% {
|
|
255
|
+
left: 0;
|
|
256
|
+
width: calc(50% - 2px);
|
|
257
|
+
top: 0;
|
|
258
|
+
height: calc(70% - 2px);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
55% {
|
|
262
|
+
left: 0;
|
|
263
|
+
width: calc(50% - 2px);
|
|
264
|
+
top: 0;
|
|
265
|
+
height: calc(70% - 2px);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
60% {
|
|
269
|
+
left: calc(50% + 2px);
|
|
270
|
+
width: calc(50% - 2px);
|
|
271
|
+
top: 0;
|
|
272
|
+
height: calc(30% - 2px);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
75% {
|
|
276
|
+
left: calc(50% + 2px);
|
|
277
|
+
width: calc(50% - 2px);
|
|
278
|
+
top: 0;
|
|
279
|
+
height: calc(30% - 2px);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
80% {
|
|
283
|
+
left: calc(50% + 2px);
|
|
284
|
+
width: calc(50% - 2px);
|
|
285
|
+
top: 0;
|
|
286
|
+
height: calc(30% - 2px);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
95% {
|
|
290
|
+
left: calc(50% + 2px);
|
|
291
|
+
width: calc(50% - 2px);
|
|
292
|
+
top: 0;
|
|
293
|
+
height: calc(30% - 2px);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
100% {
|
|
297
|
+
left: calc(50% + 2px);
|
|
298
|
+
width: calc(50% - 2px);
|
|
299
|
+
top: calc(30% + 2px);
|
|
300
|
+
height: calc(70% - 2px);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { getClassNames } from '@websolutespa/bom-core';
|
|
3
|
+
import { CanvasOffscreenProvider, useLlm } from '@websolutespa/bom-mixer-llm';
|
|
4
|
+
import { forwardRef } from 'react';
|
|
5
|
+
import '../../../scss/style.scss';
|
|
6
|
+
import style from './page-root.module.scss';
|
|
7
|
+
export const PageRoot = /*#__PURE__*/ forwardRef(function PageRoot({ opened, embedded, customIntro, mode }, ref) {
|
|
8
|
+
const { Font, PageMain } = useLlm((state)=>state.components);
|
|
9
|
+
const classNames = getClassNames(style.root, 'llm', {
|
|
10
|
+
'-open': opened,
|
|
11
|
+
'-embedded': embedded,
|
|
12
|
+
'-custom-intro': customIntro,
|
|
13
|
+
['-' + mode]: true
|
|
14
|
+
});
|
|
15
|
+
return /*#__PURE__*/ _jsx("section", {
|
|
16
|
+
ref: ref,
|
|
17
|
+
className: classNames,
|
|
18
|
+
"data-opened": opened,
|
|
19
|
+
"data-embedded": embedded,
|
|
20
|
+
"data-custom-intro": customIntro,
|
|
21
|
+
"data-mode": mode,
|
|
22
|
+
children: /*#__PURE__*/ _jsxs(CanvasOffscreenProvider, {
|
|
23
|
+
children: [
|
|
24
|
+
/*#__PURE__*/ _jsx(Font, {}),
|
|
25
|
+
/*#__PURE__*/ _jsx(PageMain, {}, "main")
|
|
26
|
+
]
|
|
27
|
+
})
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=page-root.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/page/PageRoot/page-root.tsx"],"sourcesContent":["import { getClassNames } from '@websolutespa/bom-core';\nimport { CanvasOffscreenProvider, useLlm } from '@websolutespa/bom-mixer-llm';\nimport { forwardRef } from 'react';\nimport '../../../scss/style.scss';\nimport style from './page-root.module.scss';\n\nexport type PageRootProps = {\n mode: string;\n opened?: boolean;\n embedded?: boolean;\n customIntro?: boolean;\n};\n\nexport const PageRoot = forwardRef<HTMLDivElement, PageRootProps>(\n function PageRoot({\n opened,\n embedded,\n customIntro,\n mode,\n }, ref) {\n const {\n Font,\n PageMain,\n } = useLlm(state => state.components);\n\n const classNames = getClassNames(style.root, 'llm', {\n '-open': opened,\n '-embedded': embedded,\n '-custom-intro': customIntro,\n ['-' + mode]: true,\n });\n\n return (\n <section\n ref={ref}\n className={classNames}\n data-opened={opened}\n data-embedded={embedded}\n data-custom-intro={customIntro}\n data-mode={mode}\n >\n <CanvasOffscreenProvider>\n <Font />\n <PageMain key=\"main\" />\n </CanvasOffscreenProvider>\n </section>\n );\n }\n);\n"],"names":["getClassNames","CanvasOffscreenProvider","useLlm","forwardRef","style","PageRoot","opened","embedded","customIntro","mode","ref","Font","PageMain","state","components","classNames","root","section","className","data-opened","data-embedded","data-custom-intro","data-mode"],"mappings":";AAAA,SAASA,aAAa,QAAQ,yBAAyB;AACvD,SAASC,uBAAuB,EAAEC,MAAM,QAAQ,8BAA8B;AAC9E,SAASC,UAAU,QAAQ,QAAQ;AACnC,OAAO,2BAA2B;AAClC,OAAOC,WAAW,0BAA0B;AAS5C,OAAO,MAAMC,yBAAWF,WACtB,SAASE,SAAS,EAChBC,MAAM,EACNC,QAAQ,EACRC,WAAW,EACXC,IAAI,EACL,EAAEC,GAAG;IACJ,MAAM,EACJC,IAAI,EACJC,QAAQ,EACT,GAAGV,OAAOW,CAAAA,QAASA,MAAMC,UAAU;IAEpC,MAAMC,aAAaf,cAAcI,MAAMY,IAAI,EAAE,OAAO;QAClD,SAASV;QACT,aAAaC;QACb,iBAAiBC;QACjB,CAAC,MAAMC,KAAK,EAAE;IAChB;IAEA,qBACE,KAACQ;QACCP,KAAKA;QACLQ,WAAWH;QACXI,eAAab;QACbc,iBAAeb;QACfc,qBAAmBb;QACnBc,aAAWb;kBAEX,cAAA,MAACR;;8BACC,KAACU;8BACD,KAACC,cAAa;;;;AAItB,GACA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
@import '../../../scss/mixin';
|
|
2
|
+
|
|
3
|
+
.root {
|
|
4
|
+
--s: 1;
|
|
5
|
+
--u: 1vw;
|
|
6
|
+
--rem: 16px;
|
|
7
|
+
|
|
8
|
+
pointer-events: none;
|
|
9
|
+
position: fixed;
|
|
10
|
+
bottom: 0;
|
|
11
|
+
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
align-items: center;
|
|
15
|
+
justify-content: flex-end;
|
|
16
|
+
width: 100%;
|
|
17
|
+
height: 100%;
|
|
18
|
+
|
|
19
|
+
z-index: 10000;
|
|
20
|
+
|
|
21
|
+
:global(.llm__container) {
|
|
22
|
+
padding: 0 clampUnit(20, 110);
|
|
23
|
+
}
|
|
24
|
+
}
|