C++ / fmt (pull_request) Failing after 3s
C++ / build (pull_request) Failing after 9s
C++ / clang-tidy (pull_request) Failing after 9s
JS/TS / fmt (pull_request) Successful in 7s
JS/TS / lint (pull_request) Successful in 8s
Python / static (pull_request) Successful in 25s
Rust / build (pull_request) Successful in 50s
Rust / fmt (pull_request) Successful in 30s
Python / verify (pull_request) Successful in 1m44s
Rust / clippy (pull_request) Successful in 45s
91 lines
1.9 KiB
QML
91 lines
1.9 KiB
QML
import QtQuick
|
|
import Quickshell
|
|
import ZShell.Config
|
|
import ZShell.Llm
|
|
import qs.Components
|
|
import qs.Services
|
|
|
|
Column {
|
|
id: root
|
|
|
|
required property var blocks
|
|
|
|
spacing: Tokens.spacing.small
|
|
|
|
Repeater {
|
|
id: blockRep
|
|
|
|
model: ScriptModel {
|
|
values: root.blocks
|
|
objectProp: "id"
|
|
}
|
|
delegate: DelegateChooser {
|
|
role: "type"
|
|
|
|
DelegateChoice {
|
|
roleValue: LlmMarkdown.Type.Code
|
|
|
|
delegate: CodeBlockView {
|
|
required property var modelData
|
|
|
|
language: modelData.language
|
|
code: modelData.code
|
|
anchors.right: parent.right
|
|
anchors.margins: Tokens.spacing.small
|
|
anchors.left: parent.left
|
|
}
|
|
}
|
|
|
|
DelegateChoice {
|
|
roleValue: LlmMarkdown.Type.Math
|
|
|
|
delegate: MathBlockView {
|
|
required property var modelData
|
|
|
|
latex: modelData.latex
|
|
anchors.right: parent.right
|
|
anchors.left: parent.left
|
|
anchors.margins: Tokens.padding.medium
|
|
}
|
|
}
|
|
|
|
DelegateChoice {
|
|
roleValue: LlmMarkdown.Type.Heading
|
|
|
|
delegate: TextEditBase {
|
|
required property var modelData
|
|
|
|
color: Colors.palette.m3onSurface
|
|
anchors.right: parent.right
|
|
anchors.left: parent.left
|
|
anchors.margins: Tokens.padding.medium
|
|
text: modelData.text
|
|
textFormat: Text.MarkdownText
|
|
readOnly: true
|
|
font: {
|
|
if (modelData.level <= 1)
|
|
return Tokens.font.title.builders.large.weight(Font.Bold).build();
|
|
if (modelData.level === 2)
|
|
return Tokens.font.title.builders.medium.weight(Font.Bold).build();
|
|
return Tokens.font.title.builders.small.weight(Font.Bold).build();
|
|
}
|
|
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
|
}
|
|
}
|
|
|
|
DelegateChoice {
|
|
roleValue: LlmMarkdown.Type.Text
|
|
|
|
delegate: BubbleEdit {
|
|
required property var modelData
|
|
|
|
anchors.right: parent.right
|
|
anchors.left: parent.left
|
|
anchors.margins: Tokens.padding.medium
|
|
text: modelData.text
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|