@meistrari/chat-nuxt 4.10.0-rc.3 → 4.10.0-rc.5
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/module.json +1 -1
- package/dist/module.mjs +2 -0
- package/dist/runtime/embed/components/mobile/chat-mobile-shell.d.vue.ts +2 -2
- package/dist/runtime/embed/components/mobile/chat-mobile-shell.vue.d.ts +2 -2
- package/dist/runtime/rendering/components/openui/{markdown.d.vue.ts → markdown-prose.d.vue.ts} +1 -3
- package/dist/runtime/rendering/components/openui/{markdown.vue → markdown-prose.vue} +3 -3
- package/dist/runtime/rendering/components/openui/{markdown.vue.d.ts → markdown-prose.vue.d.ts} +1 -3
- package/dist/runtime/rendering/components/openui-block.vue +26 -52
- package/dist/runtime/rendering/openui/context.d.ts +2 -17
- package/dist/runtime/rendering/openui/context.js +0 -2
- package/package.json +1 -1
- package/dist/runtime/rendering/components/openui/bar-chart.d.vue.ts +0 -10
- package/dist/runtime/rendering/components/openui/bar-chart.vue +0 -39
- package/dist/runtime/rendering/components/openui/bar-chart.vue.d.ts +0 -10
- package/dist/runtime/rendering/components/openui/bar.d.vue.ts +0 -10
- package/dist/runtime/rendering/components/openui/bar.vue +0 -12
- package/dist/runtime/rendering/components/openui/bar.vue.d.ts +0 -10
- package/dist/runtime/rendering/components/openui/button.d.vue.ts +0 -11
- package/dist/runtime/rendering/components/openui/button.vue +0 -30
- package/dist/runtime/rendering/components/openui/button.vue.d.ts +0 -11
- package/dist/runtime/rendering/components/openui/buttons.d.vue.ts +0 -8
- package/dist/runtime/rendering/components/openui/buttons.vue +0 -14
- package/dist/runtime/rendering/components/openui/buttons.vue.d.ts +0 -8
- package/dist/runtime/rendering/components/openui/callout.d.vue.ts +0 -11
- package/dist/runtime/rendering/components/openui/callout.vue +0 -27
- package/dist/runtime/rendering/components/openui/callout.vue.d.ts +0 -11
- package/dist/runtime/rendering/components/openui/card.d.vue.ts +0 -9
- package/dist/runtime/rendering/components/openui/card.vue +0 -19
- package/dist/runtime/rendering/components/openui/card.vue.d.ts +0 -9
- package/dist/runtime/rendering/components/openui/checkbox.d.vue.ts +0 -9
- package/dist/runtime/rendering/components/openui/checkbox.vue +0 -26
- package/dist/runtime/rendering/components/openui/checkbox.vue.d.ts +0 -9
- package/dist/runtime/rendering/components/openui/col.d.vue.ts +0 -10
- package/dist/runtime/rendering/components/openui/col.vue +0 -16
- package/dist/runtime/rendering/components/openui/col.vue.d.ts +0 -10
- package/dist/runtime/rendering/components/openui/form.d.vue.ts +0 -10
- package/dist/runtime/rendering/components/openui/form.vue +0 -60
- package/dist/runtime/rendering/components/openui/form.vue.d.ts +0 -10
- package/dist/runtime/rendering/components/openui/input.d.vue.ts +0 -10
- package/dist/runtime/rendering/components/openui/input.vue +0 -23
- package/dist/runtime/rendering/components/openui/input.vue.d.ts +0 -10
- package/dist/runtime/rendering/components/openui/metric.d.vue.ts +0 -11
- package/dist/runtime/rendering/components/openui/metric.vue +0 -20
- package/dist/runtime/rendering/components/openui/metric.vue.d.ts +0 -11
- package/dist/runtime/rendering/components/openui/option.d.vue.ts +0 -10
- package/dist/runtime/rendering/components/openui/option.vue +0 -12
- package/dist/runtime/rendering/components/openui/option.vue.d.ts +0 -10
- package/dist/runtime/rendering/components/openui/question.d.vue.ts +0 -11
- package/dist/runtime/rendering/components/openui/question.vue +0 -15
- package/dist/runtime/rendering/components/openui/question.vue.d.ts +0 -11
- package/dist/runtime/rendering/components/openui/questions.d.vue.ts +0 -9
- package/dist/runtime/rendering/components/openui/questions.vue +0 -91
- package/dist/runtime/rendering/components/openui/questions.vue.d.ts +0 -9
- package/dist/runtime/rendering/components/openui/select.d.vue.ts +0 -10
- package/dist/runtime/rendering/components/openui/select.vue +0 -27
- package/dist/runtime/rendering/components/openui/select.vue.d.ts +0 -10
- package/dist/runtime/rendering/components/openui/stack.d.vue.ts +0 -9
- package/dist/runtime/rendering/components/openui/stack.vue +0 -18
- package/dist/runtime/rendering/components/openui/stack.vue.d.ts +0 -9
- package/dist/runtime/rendering/components/openui/table.d.vue.ts +0 -9
- package/dist/runtime/rendering/components/openui/table.vue +0 -41
- package/dist/runtime/rendering/components/openui/table.vue.d.ts +0 -9
- package/dist/runtime/rendering/openui/actions.d.ts +0 -15
- package/dist/runtime/rendering/openui/actions.js +0 -40
- package/dist/runtime/rendering/openui/form-fields.d.ts +0 -10
- package/dist/runtime/rendering/openui/form-fields.js +0 -30
- package/dist/runtime/rendering/openui/program.d.ts +0 -15
- package/dist/runtime/rendering/openui/program.js +0 -74
- package/dist/runtime/rendering/openui/registry.d.ts +0 -5
- package/dist/runtime/rendering/openui/registry.js +0 -44
- package/dist/runtime/rendering/openui/render.d.ts +0 -21
- package/dist/runtime/rendering/openui/render.js +0 -45
- package/dist/runtime/rendering/openui/use-openui-context.d.ts +0 -2
- package/dist/runtime/rendering/openui/use-openui-context.js +0 -8
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -2,6 +2,7 @@ import { existsSync, readFileSync, mkdirSync, symlinkSync } from 'node:fs';
|
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { join, dirname, isAbsolute } from 'node:path';
|
|
4
4
|
import { defineNuxtModule, createResolver, addTemplate, addTypeTemplate, addPlugin, addImportsDir, addComponent, addComponentsDir } from 'nuxt/kit';
|
|
5
|
+
import { registerOpenuiWidget } from '@meistrari/chat-ui-lang/nuxt';
|
|
5
6
|
import { TOOL_ICON_SAFELIST } from '../dist/runtime/messages/tool-registry.js';
|
|
6
7
|
export { ChatMessageStatus } from '../dist/runtime/types/message-status.js';
|
|
7
8
|
|
|
@@ -454,6 +455,7 @@ const module$1 = defineNuxtModule({
|
|
|
454
455
|
const runtimeDirRegExp = new RegExp(runtimeDir.replace(/\\/g, "/").replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
|
|
455
456
|
normalizedImports.transform.include.push(runtimeDirRegExp);
|
|
456
457
|
}
|
|
458
|
+
registerOpenuiWidget(nuxt);
|
|
457
459
|
const rc = nuxt.options.runtimeConfig;
|
|
458
460
|
rc.chatApiUrl = options.chatApiUrl || rc.chatApiUrl || process.env.CHAT_API_URL || "";
|
|
459
461
|
rc.public = rc.public || {};
|
|
@@ -71,8 +71,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
71
71
|
copyLink: () => any;
|
|
72
72
|
debug: () => any;
|
|
73
73
|
selectConversation: (id: string) => any;
|
|
74
|
-
send: (content: string, files: FileUploadInput[], agentInputs?: TelaAgentExecutionInput[] | undefined) => any;
|
|
75
74
|
settings: () => any;
|
|
75
|
+
send: (content: string, files: FileUploadInput[], agentInputs?: TelaAgentExecutionInput[] | undefined) => any;
|
|
76
76
|
selectExecutionProfile: (profile: ChatExecutionProfile) => any;
|
|
77
77
|
tabChange: (tab: TopbarTab) => any;
|
|
78
78
|
newConversation: (groupId?: string | null | undefined) => any;
|
|
@@ -93,8 +93,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
93
93
|
onCopyLink?: (() => any) | undefined;
|
|
94
94
|
onDebug?: (() => any) | undefined;
|
|
95
95
|
onSelectConversation?: ((id: string) => any) | undefined;
|
|
96
|
-
onSend?: ((content: string, files: FileUploadInput[], agentInputs?: TelaAgentExecutionInput[] | undefined) => any) | undefined;
|
|
97
96
|
onSettings?: (() => any) | undefined;
|
|
97
|
+
onSend?: ((content: string, files: FileUploadInput[], agentInputs?: TelaAgentExecutionInput[] | undefined) => any) | undefined;
|
|
98
98
|
onSelectExecutionProfile?: ((profile: ChatExecutionProfile) => any) | undefined;
|
|
99
99
|
"onUpdate:selectedModel"?: ((value: string | null) => any) | undefined;
|
|
100
100
|
"onUpdate:selectedReasoningEffort"?: ((value: any) => any) | undefined;
|
|
@@ -71,8 +71,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
71
71
|
copyLink: () => any;
|
|
72
72
|
debug: () => any;
|
|
73
73
|
selectConversation: (id: string) => any;
|
|
74
|
-
send: (content: string, files: FileUploadInput[], agentInputs?: TelaAgentExecutionInput[] | undefined) => any;
|
|
75
74
|
settings: () => any;
|
|
75
|
+
send: (content: string, files: FileUploadInput[], agentInputs?: TelaAgentExecutionInput[] | undefined) => any;
|
|
76
76
|
selectExecutionProfile: (profile: ChatExecutionProfile) => any;
|
|
77
77
|
tabChange: (tab: TopbarTab) => any;
|
|
78
78
|
newConversation: (groupId?: string | null | undefined) => any;
|
|
@@ -93,8 +93,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
93
93
|
onCopyLink?: (() => any) | undefined;
|
|
94
94
|
onDebug?: (() => any) | undefined;
|
|
95
95
|
onSelectConversation?: ((id: string) => any) | undefined;
|
|
96
|
-
onSend?: ((content: string, files: FileUploadInput[], agentInputs?: TelaAgentExecutionInput[] | undefined) => any) | undefined;
|
|
97
96
|
onSettings?: (() => any) | undefined;
|
|
97
|
+
onSend?: ((content: string, files: FileUploadInput[], agentInputs?: TelaAgentExecutionInput[] | undefined) => any) | undefined;
|
|
98
98
|
onSelectExecutionProfile?: ((profile: ChatExecutionProfile) => any) | undefined;
|
|
99
99
|
"onUpdate:selectedModel"?: ((value: string | null) => any) | undefined;
|
|
100
100
|
"onUpdate:selectedReasoningEffort"?: ((value: any) => any) | undefined;
|
package/dist/runtime/rendering/components/openui/{markdown.d.vue.ts → markdown-prose.d.vue.ts}
RENAMED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
type __VLS_Props = {
|
|
2
|
-
|
|
3
|
-
text: string;
|
|
4
|
-
};
|
|
2
|
+
text: string;
|
|
5
3
|
partial?: boolean;
|
|
6
4
|
};
|
|
7
5
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
import { OPENUI_MARKDOWN_COMPONENTS_KEY } from "../../openui/context";
|
|
3
3
|
import { useWidgetProse } from "../../openui/use-widget-prose";
|
|
4
4
|
const props = defineProps({
|
|
5
|
-
|
|
5
|
+
text: { type: String, required: true },
|
|
6
6
|
partial: { type: Boolean, required: false }
|
|
7
7
|
});
|
|
8
8
|
const customComponents = inject(OPENUI_MARKDOWN_COMPONENTS_KEY, ref({}));
|
|
9
|
-
const content = useWidgetProse(() => props.
|
|
9
|
+
const content = useWidgetProse(() => props.text);
|
|
10
10
|
</script>
|
|
11
11
|
|
|
12
12
|
<template>
|
|
13
|
-
<AppMarkdownRender :content="content" :final="!partial" :typewriter="false" :custom-components="customComponents"
|
|
13
|
+
<AppMarkdownRender :content="content" :final="!partial" :typewriter="false" :custom-components="customComponents" />
|
|
14
14
|
</template>
|
package/dist/runtime/rendering/components/openui/{markdown.vue.d.ts → markdown-prose.vue.d.ts}
RENAMED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
type __VLS_Props = {
|
|
2
|
-
|
|
3
|
-
text: string;
|
|
4
|
-
};
|
|
2
|
+
text: string;
|
|
5
3
|
partial?: boolean;
|
|
6
4
|
};
|
|
7
5
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -1,73 +1,47 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { formatWidgetContext, isSafeUrl } from "@meistrari/chat-ui-lang";
|
|
3
2
|
import { CHAT_MESSAGE_CONTEXT_KEY, CHAT_MESSAGE_SEND_KEY } from "../../types/messages";
|
|
4
3
|
import { useStatusToast } from "../../shared/composables/status-toast";
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
4
|
+
import { OPENUI_ERROR_REPORTER_KEY } from "../openui/context";
|
|
5
|
+
import OpenuiCitation from "./openui/citation.vue";
|
|
6
|
+
import OpenuiFileCard from "./openui/file-card.vue";
|
|
7
|
+
import OpenuiImage from "./openui/image.vue";
|
|
8
|
+
import OpenuiMarkdownProse from "./openui/markdown-prose.vue";
|
|
9
9
|
const props = defineProps({
|
|
10
10
|
node: { type: Object, required: true },
|
|
11
11
|
loading: { type: Boolean, required: false }
|
|
12
12
|
});
|
|
13
13
|
const code = computed(() => props.node.code ?? props.node.content ?? "");
|
|
14
14
|
const complete = computed(() => !props.loading && !props.node.loading);
|
|
15
|
-
const program = useOpenuiProgram(code, complete);
|
|
16
15
|
const send = inject(CHAT_MESSAGE_SEND_KEY, null);
|
|
17
16
|
const message = inject(CHAT_MESSAGE_CONTEXT_KEY, null);
|
|
18
17
|
const reportErrors = inject(OPENUI_ERROR_REPORTER_KEY, null);
|
|
19
|
-
const answered = ref(false);
|
|
20
18
|
const statusToast = useStatusToast();
|
|
21
19
|
const interactive = computed(() => Boolean(
|
|
22
|
-
send &&
|
|
20
|
+
send && (!message || message.role === "assistant" && message.isLatestMessage.value && !message.streaming.value)
|
|
23
21
|
));
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
const ok = await send(`${text}${formatWidgetContext(context, { onDrop: (drop) => console.warn("[chat-nuxt] widget context dropped", drop) })}`);
|
|
31
|
-
sent = sent || ok;
|
|
32
|
-
return ok;
|
|
33
|
-
},
|
|
34
|
-
openUrl: (url) => {
|
|
35
|
-
if (isSafeUrl(url))
|
|
36
|
-
window.open(url, "_blank", "noopener");
|
|
37
|
-
},
|
|
38
|
-
custom: runCustomAction,
|
|
39
|
-
store: program.store,
|
|
40
|
-
stateDefaults: program.stateDefaults.value
|
|
41
|
-
});
|
|
42
|
-
if (sent)
|
|
43
|
-
answered.value = true;
|
|
44
|
-
return accepted;
|
|
22
|
+
const host = {
|
|
23
|
+
prose: OpenuiMarkdownProse,
|
|
24
|
+
components: { FileCard: OpenuiFileCard, Image: OpenuiImage, Citation: OpenuiCitation }
|
|
25
|
+
};
|
|
26
|
+
async function sendMessage(text) {
|
|
27
|
+
return send ? await send(text) : false;
|
|
45
28
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
return copied;
|
|
52
|
-
}
|
|
53
|
-
console.warn("[chat-nuxt] unsupported widget action", { name });
|
|
54
|
-
return false;
|
|
29
|
+
function onErrors(errors, source) {
|
|
30
|
+
reportErrors?.(errors, source);
|
|
31
|
+
}
|
|
32
|
+
function onCopyFailed() {
|
|
33
|
+
statusToast.update({ text: "N\xE3o foi poss\xEDvel copiar", icon: "i-ph-warning" });
|
|
55
34
|
}
|
|
56
|
-
provide(OPENUI_CONTEXT_KEY, { renderNode, interactive, triggerAction });
|
|
57
|
-
watch([program.errors, complete], ([errors, done]) => {
|
|
58
|
-
if (done && errors.length)
|
|
59
|
-
reportErrors?.(errors, code.value);
|
|
60
|
-
}, { immediate: true });
|
|
61
|
-
const Root = () => renderNode(program.root.value);
|
|
62
35
|
</script>
|
|
63
36
|
|
|
64
37
|
<template>
|
|
65
|
-
<
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
38
|
+
<OpenuiWidget
|
|
39
|
+
:code="code"
|
|
40
|
+
:complete="complete"
|
|
41
|
+
:interactive="interactive"
|
|
42
|
+
:send="sendMessage"
|
|
43
|
+
:host="host"
|
|
44
|
+
@errors="onErrors"
|
|
45
|
+
@copy-failed="onCopyFailed"
|
|
46
|
+
/>
|
|
73
47
|
</template>
|
|
@@ -1,22 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { Component, InjectionKey, Ref
|
|
3
|
-
export type RenderedNode = VNode | string | null | Array<VNode | string | null>;
|
|
4
|
-
export interface OpenuiContext {
|
|
5
|
-
renderNode: (value: unknown) => RenderedNode;
|
|
6
|
-
/** Clicks are honoured only on the latest assistant message, after streaming ends. */
|
|
7
|
-
interactive: Ref<boolean>;
|
|
8
|
-
/** Resolves once the action finished; returns false when it was rejected. A widget answers once: after an accepted send, `interactive` turns false. */
|
|
9
|
-
triggerAction: (label: string, plan?: ActionPlan) => Promise<boolean>;
|
|
10
|
-
}
|
|
11
|
-
export declare const OPENUI_CONTEXT_KEY: InjectionKey<OpenuiContext>;
|
|
1
|
+
import type { OpenUIError } from '@openuidev/lang-core';
|
|
2
|
+
import type { Component, InjectionKey, Ref } from 'vue';
|
|
12
3
|
export type OpenuiErrorReporter = (errors: OpenUIError[], code: string) => void;
|
|
13
4
|
/** Optional: hosts inject this to collect parse and runtime errors per widget. */
|
|
14
5
|
export declare const OPENUI_ERROR_REPORTER_KEY: InjectionKey<OpenuiErrorReporter>;
|
|
15
6
|
/** Markdown node overrides of the surrounding message (vault links, citations), so prose inside widgets renders the same way. */
|
|
16
7
|
export declare const OPENUI_MARKDOWN_COMPONENTS_KEY: InjectionKey<Ref<Record<string, Component>>>;
|
|
17
|
-
export interface OpenuiFormState {
|
|
18
|
-
get: (name: string) => unknown;
|
|
19
|
-
set: (name: string, value: unknown) => void;
|
|
20
|
-
}
|
|
21
|
-
/** Provided by Form so its fields share one state bag. */
|
|
22
|
-
export declare const OPENUI_FORM_KEY: InjectionKey<OpenuiFormState>;
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
export const OPENUI_CONTEXT_KEY = Symbol("openui-context");
|
|
2
1
|
export const OPENUI_ERROR_REPORTER_KEY = Symbol("openui-error-reporter");
|
|
3
2
|
export const OPENUI_MARKDOWN_COMPONENTS_KEY = Symbol("openui-markdown-components");
|
|
4
|
-
export const OPENUI_FORM_KEY = Symbol("openui-form");
|
package/package.json
CHANGED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
props: {
|
|
3
|
-
title: string;
|
|
4
|
-
bars: unknown[];
|
|
5
|
-
tone?: 'neutral' | 'positive' | 'negative';
|
|
6
|
-
};
|
|
7
|
-
};
|
|
8
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
|
-
declare const _default: typeof __VLS_export;
|
|
10
|
-
export default _default;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
const props = defineProps({
|
|
3
|
-
props: { type: Object, required: true }
|
|
4
|
-
});
|
|
5
|
-
const bars = computed(() => (Array.isArray(props.props.bars) ? props.props.bars : []).map((node) => {
|
|
6
|
-
const bar = node;
|
|
7
|
-
if (bar?.typeName !== "Bar" || !bar.props || typeof bar.props.value !== "number" || !Number.isFinite(bar.props.value))
|
|
8
|
-
return null;
|
|
9
|
-
return {
|
|
10
|
-
label: typeof bar.props.label === "string" ? bar.props.label : "",
|
|
11
|
-
value: bar.props.value,
|
|
12
|
-
display: typeof bar.props.display === "string" ? bar.props.display : String(bar.props.value)
|
|
13
|
-
};
|
|
14
|
-
}).filter((bar) => bar !== null));
|
|
15
|
-
const max = computed(() => Math.max(0, ...bars.value.map((bar) => Math.abs(bar.value))));
|
|
16
|
-
const fillClass = computed(() => ({
|
|
17
|
-
neutral: "bg-gray-800",
|
|
18
|
-
positive: "bg-green-600",
|
|
19
|
-
negative: "bg-red-600"
|
|
20
|
-
})[props.props.tone ?? "neutral"]);
|
|
21
|
-
function width(bar) {
|
|
22
|
-
return bar.value === 0 || max.value === 0 ? "0%" : `${Math.max(2, Math.round(Math.abs(bar.value) / max.value * 100))}%`;
|
|
23
|
-
}
|
|
24
|
-
</script>
|
|
25
|
-
|
|
26
|
-
<template>
|
|
27
|
-
<div flex flex-col gap-12px rounded-12px border-0.5px border p-16px data-openui="bar-chart">
|
|
28
|
-
<span body-12-medium text-secondary>{{ props.props.title }}</span>
|
|
29
|
-
<div flex flex-col gap-8px>
|
|
30
|
-
<div v-for="(bar, index) in bars" :key="index" grid grid-cols="[minmax(96px,1fr)_3fr_auto]" items-center gap-12px>
|
|
31
|
-
<span body-14-regular text-primary truncate>{{ bar.label }}</span>
|
|
32
|
-
<div h-8px rounded-4px bg-muted overflow-hidden>
|
|
33
|
-
<div h-full rounded-4px :class="bar.value < 0 ? 'bg-red-600' : fillClass" :style="{ width: width(bar) }" />
|
|
34
|
-
</div>
|
|
35
|
-
<span body-12-medium text-secondary tabular-nums>{{ bar.display }}</span>
|
|
36
|
-
</div>
|
|
37
|
-
</div>
|
|
38
|
-
</div>
|
|
39
|
-
</template>
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
props: {
|
|
3
|
-
title: string;
|
|
4
|
-
bars: unknown[];
|
|
5
|
-
tone?: 'neutral' | 'positive' | 'negative';
|
|
6
|
-
};
|
|
7
|
-
};
|
|
8
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
|
-
declare const _default: typeof __VLS_export;
|
|
10
|
-
export default _default;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
props: {
|
|
3
|
-
label: string;
|
|
4
|
-
value: number;
|
|
5
|
-
display?: string;
|
|
6
|
-
};
|
|
7
|
-
};
|
|
8
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
|
-
declare const _default: typeof __VLS_export;
|
|
10
|
-
export default _default;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
const props = defineProps({
|
|
3
|
-
props: { type: Object, required: true }
|
|
4
|
-
});
|
|
5
|
-
</script>
|
|
6
|
-
|
|
7
|
-
<template>
|
|
8
|
-
<div flex justify-between gap-12px body-14-regular text-primary data-openui="bar">
|
|
9
|
-
<span>{{ props.props.label }}</span>
|
|
10
|
-
<span text-secondary>{{ props.props.display ?? props.props.value }}</span>
|
|
11
|
-
</div>
|
|
12
|
-
</template>
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
props: {
|
|
3
|
-
label: string;
|
|
4
|
-
value: number;
|
|
5
|
-
display?: string;
|
|
6
|
-
};
|
|
7
|
-
};
|
|
8
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
|
-
declare const _default: typeof __VLS_export;
|
|
10
|
-
export default _default;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { ActionPlan } from '@openuidev/lang-core';
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
props: {
|
|
4
|
-
label: string;
|
|
5
|
-
action?: ActionPlan;
|
|
6
|
-
variant?: 'primary' | 'secondary';
|
|
7
|
-
};
|
|
8
|
-
};
|
|
9
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
|
-
declare const _default: typeof __VLS_export;
|
|
11
|
-
export default _default;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { useOpenuiContext } from "../../openui/use-openui-context";
|
|
3
|
-
const props = defineProps({
|
|
4
|
-
props: { type: Object, required: true }
|
|
5
|
-
});
|
|
6
|
-
const { interactive, triggerAction } = useOpenuiContext();
|
|
7
|
-
const sending = ref(false);
|
|
8
|
-
async function click() {
|
|
9
|
-
if (!interactive.value || sending.value)
|
|
10
|
-
return;
|
|
11
|
-
sending.value = true;
|
|
12
|
-
try {
|
|
13
|
-
await triggerAction(props.props.label, props.props.action);
|
|
14
|
-
} finally {
|
|
15
|
-
sending.value = false;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
</script>
|
|
19
|
-
|
|
20
|
-
<template>
|
|
21
|
-
<TelaButton
|
|
22
|
-
:variant="props.props.variant === 'primary' ? 'primary' : 'secondary'"
|
|
23
|
-
:disabled="!interactive"
|
|
24
|
-
:loading="sending"
|
|
25
|
-
data-openui="button"
|
|
26
|
-
@click="click"
|
|
27
|
-
>
|
|
28
|
-
{{ props.props.label }}
|
|
29
|
-
</TelaButton>
|
|
30
|
-
</template>
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { ActionPlan } from '@openuidev/lang-core';
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
props: {
|
|
4
|
-
label: string;
|
|
5
|
-
action?: ActionPlan;
|
|
6
|
-
variant?: 'primary' | 'secondary';
|
|
7
|
-
};
|
|
8
|
-
};
|
|
9
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
|
-
declare const _default: typeof __VLS_export;
|
|
11
|
-
export default _default;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
props: {
|
|
3
|
-
buttons: unknown[];
|
|
4
|
-
};
|
|
5
|
-
};
|
|
6
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
-
declare const _default: typeof __VLS_export;
|
|
8
|
-
export default _default;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { useOpenuiContext } from "../../openui/use-openui-context";
|
|
3
|
-
const props = defineProps({
|
|
4
|
-
props: { type: Object, required: true }
|
|
5
|
-
});
|
|
6
|
-
const { renderNode } = useOpenuiContext();
|
|
7
|
-
const Children = () => renderNode(props.props.buttons);
|
|
8
|
-
</script>
|
|
9
|
-
|
|
10
|
-
<template>
|
|
11
|
-
<div flex flex-wrap gap-8px data-openui="buttons">
|
|
12
|
-
<Children />
|
|
13
|
-
</div>
|
|
14
|
-
</template>
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
props: {
|
|
3
|
-
buttons: unknown[];
|
|
4
|
-
};
|
|
5
|
-
};
|
|
6
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
-
declare const _default: typeof __VLS_export;
|
|
8
|
-
export default _default;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
props: {
|
|
3
|
-
text: string;
|
|
4
|
-
tone?: 'info' | 'success' | 'warning' | 'error';
|
|
5
|
-
title?: string;
|
|
6
|
-
};
|
|
7
|
-
partial?: boolean;
|
|
8
|
-
};
|
|
9
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
|
-
declare const _default: typeof __VLS_export;
|
|
11
|
-
export default _default;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { OPENUI_MARKDOWN_COMPONENTS_KEY } from "../../openui/context";
|
|
3
|
-
import { useWidgetProse } from "../../openui/use-widget-prose";
|
|
4
|
-
const props = defineProps({
|
|
5
|
-
props: { type: Object, required: true },
|
|
6
|
-
partial: { type: Boolean, required: false }
|
|
7
|
-
});
|
|
8
|
-
const customComponents = inject(OPENUI_MARKDOWN_COMPONENTS_KEY, ref({}));
|
|
9
|
-
const content = useWidgetProse(() => props.props.text);
|
|
10
|
-
const TONES = {
|
|
11
|
-
info: { icon: "i-ph-info", color: "text-secondary" },
|
|
12
|
-
success: { icon: "i-ph-check-circle", color: "text-success" },
|
|
13
|
-
warning: { icon: "i-ph-warning", color: "text-warning" },
|
|
14
|
-
error: { icon: "i-ph-warning-octagon", color: "text-error" }
|
|
15
|
-
};
|
|
16
|
-
const tone = computed(() => TONES[props.props.tone ?? "info"]);
|
|
17
|
-
</script>
|
|
18
|
-
|
|
19
|
-
<template>
|
|
20
|
-
<div flex gap-10px rounded-12px border-0.5px border bg-subtle px-14px py-12px data-openui="callout">
|
|
21
|
-
<TelaIcon :name="tone.icon" size="16px" shrink-0 mt-2px :class="tone.color" />
|
|
22
|
-
<div flex flex-col gap-4px min-w-0>
|
|
23
|
-
<span v-if="props.props.title" body-14-medium text-primary>{{ props.props.title }}</span>
|
|
24
|
-
<AppMarkdownRender :content="content" :final="!partial" :typewriter="false" :custom-components="customComponents" body-14-regular text-primary />
|
|
25
|
-
</div>
|
|
26
|
-
</div>
|
|
27
|
-
</template>
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
props: {
|
|
3
|
-
text: string;
|
|
4
|
-
tone?: 'info' | 'success' | 'warning' | 'error';
|
|
5
|
-
title?: string;
|
|
6
|
-
};
|
|
7
|
-
partial?: boolean;
|
|
8
|
-
};
|
|
9
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
|
-
declare const _default: typeof __VLS_export;
|
|
11
|
-
export default _default;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
props: {
|
|
3
|
-
children: unknown[];
|
|
4
|
-
title?: string;
|
|
5
|
-
};
|
|
6
|
-
};
|
|
7
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
8
|
-
declare const _default: typeof __VLS_export;
|
|
9
|
-
export default _default;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { useOpenuiContext } from "../../openui/use-openui-context";
|
|
3
|
-
const props = defineProps({
|
|
4
|
-
props: { type: Object, required: true }
|
|
5
|
-
});
|
|
6
|
-
const { renderNode } = useOpenuiContext();
|
|
7
|
-
const Children = () => renderNode(props.props.children);
|
|
8
|
-
</script>
|
|
9
|
-
|
|
10
|
-
<template>
|
|
11
|
-
<TelaCard size="sm" h-full data-openui="card">
|
|
12
|
-
<div flex flex-col gap-12px>
|
|
13
|
-
<h4 v-if="props.props.title" heading-h5-semibold text-contrast>
|
|
14
|
-
{{ props.props.title }}
|
|
15
|
-
</h4>
|
|
16
|
-
<Children />
|
|
17
|
-
</div>
|
|
18
|
-
</TelaCard>
|
|
19
|
-
</template>
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
props: {
|
|
3
|
-
children: unknown[];
|
|
4
|
-
title?: string;
|
|
5
|
-
};
|
|
6
|
-
};
|
|
7
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
8
|
-
declare const _default: typeof __VLS_export;
|
|
9
|
-
export default _default;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
props: {
|
|
3
|
-
name: string;
|
|
4
|
-
label: string;
|
|
5
|
-
};
|
|
6
|
-
};
|
|
7
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
8
|
-
declare const _default: typeof __VLS_export;
|
|
9
|
-
export default _default;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { OPENUI_FORM_KEY } from "../../openui/context";
|
|
3
|
-
import { useOpenuiContext } from "../../openui/use-openui-context";
|
|
4
|
-
const props = defineProps({
|
|
5
|
-
props: { type: Object, required: true }
|
|
6
|
-
});
|
|
7
|
-
const form = inject(OPENUI_FORM_KEY, null);
|
|
8
|
-
const local = ref(false);
|
|
9
|
-
const { interactive } = useOpenuiContext();
|
|
10
|
-
const checked = computed({
|
|
11
|
-
get: () => (form ? form.get(props.props.name) : local.value) === true,
|
|
12
|
-
set: (next) => {
|
|
13
|
-
if (form)
|
|
14
|
-
form.set(props.props.name, next === true);
|
|
15
|
-
else
|
|
16
|
-
local.value = next === true;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
</script>
|
|
20
|
-
|
|
21
|
-
<template>
|
|
22
|
-
<label flex items-center gap-8px body-14-regular text-primary cursor-pointer data-openui="checkbox">
|
|
23
|
-
<TelaCheckbox v-model="checked" :disabled="!interactive" />
|
|
24
|
-
{{ props.props.label }}
|
|
25
|
-
</label>
|
|
26
|
-
</template>
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
props: {
|
|
3
|
-
name: string;
|
|
4
|
-
label: string;
|
|
5
|
-
};
|
|
6
|
-
};
|
|
7
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
8
|
-
declare const _default: typeof __VLS_export;
|
|
9
|
-
export default _default;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
props: {
|
|
3
|
-
label: string;
|
|
4
|
-
values: Array<string | number>;
|
|
5
|
-
align?: 'left' | 'right';
|
|
6
|
-
};
|
|
7
|
-
};
|
|
8
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
|
-
declare const _default: typeof __VLS_export;
|
|
10
|
-
export default _default;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
const props = defineProps({
|
|
3
|
-
props: { type: Object, required: true }
|
|
4
|
-
});
|
|
5
|
-
</script>
|
|
6
|
-
|
|
7
|
-
<template>
|
|
8
|
-
<dl flex flex-col gap-4px data-openui="col">
|
|
9
|
-
<dt body-12-medium text-secondary>
|
|
10
|
-
{{ props.props.label }}
|
|
11
|
-
</dt>
|
|
12
|
-
<dd v-for="(value, index) in props.props.values" :key="index" body-14-regular text-primary>
|
|
13
|
-
{{ value }}
|
|
14
|
-
</dd>
|
|
15
|
-
</dl>
|
|
16
|
-
</template>
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
props: {
|
|
3
|
-
label: string;
|
|
4
|
-
values: Array<string | number>;
|
|
5
|
-
align?: 'left' | 'right';
|
|
6
|
-
};
|
|
7
|
-
};
|
|
8
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
|
-
declare const _default: typeof __VLS_export;
|
|
10
|
-
export default _default;
|