@meistrari/chat-nuxt 4.10.0-rc.2 → 4.10.0-rc.21
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 +8 -6
- package/dist/module.json +1 -1
- package/dist/module.mjs +2 -0
- package/dist/runtime/conversations/components/chat-conversation-export-modal.d.vue.ts +10 -0
- package/dist/runtime/conversations/components/chat-conversation-export-modal.vue +126 -0
- package/dist/runtime/conversations/components/chat-conversation-export-modal.vue.d.ts +10 -0
- package/dist/runtime/conversations/components/chat-conversation-list.vue +8 -1
- package/dist/runtime/{rendering/components/openui/bar-chart.d.vue.ts → conversations/components/chat-export-document.d.vue.ts} +2 -5
- package/dist/runtime/conversations/components/chat-export-document.vue +26 -0
- package/dist/runtime/{rendering/components/openui/bar-chart.vue.d.ts → conversations/components/chat-export-document.vue.d.ts} +2 -5
- package/dist/runtime/{rendering/components/openui/checkbox.d.vue.ts → conversations/components/chat-export-file.d.vue.ts} +1 -1
- package/dist/runtime/conversations/components/chat-export-file.vue +12 -0
- package/dist/runtime/{rendering/components/openui/checkbox.vue.d.ts → conversations/components/chat-export-file.vue.d.ts} +1 -1
- package/dist/runtime/{rendering/components/openui/buttons.d.vue.ts → conversations/components/chat-export-message.d.vue.ts} +2 -3
- package/dist/runtime/conversations/components/chat-export-message.vue +84 -0
- package/dist/runtime/{rendering/components/openui/bar.vue.d.ts → conversations/components/chat-export-message.vue.d.ts} +2 -5
- package/dist/runtime/{rendering/components/openui/bar.d.vue.ts → conversations/components/chat-export-openui.d.vue.ts} +3 -4
- package/dist/runtime/conversations/components/chat-export-openui.vue +19 -0
- package/dist/runtime/conversations/components/chat-export-openui.vue.d.ts +9 -0
- package/dist/runtime/{rendering/components/openui/callout.d.vue.ts → conversations/components/chat-export-questions.d.vue.ts} +12 -4
- package/dist/runtime/conversations/components/chat-export-questions.vue +22 -0
- package/dist/runtime/{rendering/components/openui/callout.vue.d.ts → conversations/components/chat-export-questions.vue.d.ts} +12 -4
- package/dist/runtime/conversations/composables/conversation-list.d.ts +2 -1
- package/dist/runtime/conversations/composables/conversation-list.js +4 -13
- package/dist/runtime/conversations/export-document.d.ts +1 -0
- package/dist/runtime/conversations/export-document.js +154 -0
- package/dist/runtime/conversations/export.d.ts +4 -0
- package/dist/runtime/conversations/export.js +69 -4
- package/dist/runtime/embed/components/chat-embed-inner.vue +81 -7
- package/dist/runtime/embed/components/mobile/chat-mobile-shell.d.vue.ts +3 -2
- package/dist/runtime/embed/components/mobile/chat-mobile-shell.vue +2 -0
- package/dist/runtime/embed/components/mobile/chat-mobile-shell.vue.d.ts +3 -2
- package/dist/runtime/embed/execution-controls.d.ts +2 -1
- package/dist/runtime/embed/execution-controls.js +2 -2
- package/dist/runtime/messages/components/chat-execution-mode-selector.vue +10 -6
- package/dist/runtime/messages/components/chat-message-bubble.vue +7 -0
- package/dist/runtime/messages/components/chat-message-input.d.vue.ts +2 -0
- package/dist/runtime/messages/components/chat-message-input.vue +18 -1
- package/dist/runtime/messages/components/chat-message-input.vue.d.ts +2 -0
- package/dist/runtime/messages/composables/chat.d.ts +15 -0
- package/dist/runtime/messages/composables/chat.js +49 -5
- package/dist/runtime/messages/composer-draft.d.ts +16 -0
- package/dist/runtime/messages/composer-draft.js +61 -0
- package/dist/runtime/messages/composer-pending-send.d.ts +8 -0
- package/dist/runtime/messages/composer-pending-send.js +34 -0
- package/dist/runtime/messages/conversation-timeline.js +1 -1
- 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/dist/runtime/server/utils/chat-api-proxy.d.ts +1 -1
- package/dist/runtime/server/utils/chat-api-proxy.js +3 -2
- package/dist/runtime/types/composer.d.ts +6 -0
- package/dist/runtime/types/schemas/chat/chat-config.d.ts +6 -2
- package/dist/runtime/types/schemas/chat/chat-config.js +1 -0
- package/dist/runtime/types/schemas/chat/conversation-runtime.d.ts +8 -0
- package/dist/runtime/types/schemas/chat/conversations.d.ts +8 -0
- package/dist/runtime/types/schemas/chat/messages.d.ts +12 -0
- package/dist/runtime/types/schemas/chat/ui-language.d.ts +19 -2
- package/dist/runtime/types/schemas/chat/ui-language.js +8 -3
- package/dist/runtime/types/schemas/chat/v3.d.ts +160 -2
- package/dist/runtime/types/schemas/chat/v3.js +91 -5
- package/dist/runtime/types/schemas/integrations/slack-apps.d.ts +53 -0
- package/dist/runtime/types/schemas/integrations/slack-apps.js +6 -0
- package/dist/runtime/types/schemas/integrations/slack-identity.d.ts +26 -0
- package/dist/runtime/types/schemas/integrations/slack-identity.js +23 -0
- package/dist/runtime/types/schemas/integrations/tela-agent-api.d.ts +40 -0
- package/dist/runtime/types/schemas/integrations/tela-agent-api.js +3 -0
- package/dist/runtime/types/schemas/integrations/tela-api.d.ts +11 -0
- package/dist/runtime/types/schemas/integrations/tela-api.js +8 -0
- package/dist/runtime/types/schemas/integrations/tela-auth.d.ts +39 -0
- package/dist/runtime/types/schemas/integrations/tela-auth.js +12 -0
- package/dist/runtime/types/schemas/slack/apps.d.ts +144 -0
- package/dist/runtime/types/schemas/slack/apps.js +53 -0
- package/dist/runtime/types/schemas/slack/identities.d.ts +58 -0
- package/dist/runtime/types/schemas/slack/identities.js +19 -0
- package/dist/runtime/types/schemas/slack/installations.d.ts +39 -0
- package/dist/runtime/types/schemas/slack/installations.js +18 -0
- package/package.json +2 -2
- package/dist/runtime/rendering/components/openui/bar-chart.vue +0 -39
- package/dist/runtime/rendering/components/openui/bar.vue +0 -12
- 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.vue +0 -14
- package/dist/runtime/rendering/components/openui/buttons.vue.d.ts +0 -8
- package/dist/runtime/rendering/components/openui/callout.vue +0 -27
- 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.vue +0 -26
- 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
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { OPENUI_ERROR_REPORTER_KEY, OPENUI_FORM_KEY } from "../../openui/context";
|
|
3
|
-
import { collectFormFields } from "../../openui/form-fields";
|
|
4
|
-
import { useOpenuiContext } from "../../openui/use-openui-context";
|
|
5
|
-
const props = defineProps({
|
|
6
|
-
props: { type: Object, required: true }
|
|
7
|
-
});
|
|
8
|
-
const { renderNode, interactive, triggerAction } = useOpenuiContext();
|
|
9
|
-
const reportErrors = inject(OPENUI_ERROR_REPORTER_KEY, null);
|
|
10
|
-
const values = reactive(/* @__PURE__ */ Object.create(null));
|
|
11
|
-
const sending = ref(false);
|
|
12
|
-
const refused = ref(false);
|
|
13
|
-
provide(OPENUI_FORM_KEY, {
|
|
14
|
-
get: (name) => values[name],
|
|
15
|
-
set: (name, value) => {
|
|
16
|
-
values[name] = value;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
const collected = computed(() => collectFormFields(props.props.fields));
|
|
20
|
-
const fields = computed(() => collected.value.fields);
|
|
21
|
-
watch(() => collected.value.duplicates.join(","), (duplicates) => {
|
|
22
|
-
if (duplicates)
|
|
23
|
-
reportErrors?.([{ source: "runtime", code: "duplicate-field", message: `Form ${props.props.name} repeats field names: ${duplicates}` }], "");
|
|
24
|
-
}, { immediate: true });
|
|
25
|
-
const Fields = () => renderNode(props.props.fields);
|
|
26
|
-
function formatValue(field, value) {
|
|
27
|
-
if (field.type === "Checkbox")
|
|
28
|
-
return value === true ? "sim" : "n\xE3o";
|
|
29
|
-
const text = typeof value === "string" ? value.trim() : "";
|
|
30
|
-
return text || "n\xE3o informado";
|
|
31
|
-
}
|
|
32
|
-
async function submit() {
|
|
33
|
-
if (!interactive.value || sending.value)
|
|
34
|
-
return;
|
|
35
|
-
sending.value = true;
|
|
36
|
-
refused.value = false;
|
|
37
|
-
try {
|
|
38
|
-
const lines = fields.value.map((field) => `${field.label}: ${formatValue(field, values[field.name])}`);
|
|
39
|
-
const accepted = await triggerAction(props.props.submitLabel ?? "Enviar", {
|
|
40
|
-
steps: [{ type: "continue_conversation", message: `Dados (${props.props.name}):
|
|
41
|
-
${lines.join("\n")}` }]
|
|
42
|
-
});
|
|
43
|
-
refused.value = !accepted && interactive.value;
|
|
44
|
-
} finally {
|
|
45
|
-
sending.value = false;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
</script>
|
|
49
|
-
|
|
50
|
-
<template>
|
|
51
|
-
<form flex flex-col gap-12px rounded-12px border-0.5px border p-16px data-openui="form" @submit.prevent="submit">
|
|
52
|
-
<Fields />
|
|
53
|
-
<div flex items-center justify-end gap-12px>
|
|
54
|
-
<span v-if="refused" body-12-regular text-error role="alert">Não foi possível enviar. Tente novamente.</span>
|
|
55
|
-
<TelaButton type="submit" :disabled="!interactive" :loading="sending">
|
|
56
|
-
{{ props.props.submitLabel ?? "Enviar" }}
|
|
57
|
-
</TelaButton>
|
|
58
|
-
</div>
|
|
59
|
-
</form>
|
|
60
|
-
</template>
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
props: {
|
|
3
|
-
name: string;
|
|
4
|
-
fields: unknown[];
|
|
5
|
-
submitLabel?: 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,10 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
props: {
|
|
3
|
-
name: string;
|
|
4
|
-
label: string;
|
|
5
|
-
placeholder?: 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,23 +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("");
|
|
9
|
-
const { interactive } = useOpenuiContext();
|
|
10
|
-
const value = computed({
|
|
11
|
-
get: () => String((form ? form.get(props.props.name) : local.value) ?? ""),
|
|
12
|
-
set: (next) => {
|
|
13
|
-
if (form)
|
|
14
|
-
form.set(props.props.name, next);
|
|
15
|
-
else
|
|
16
|
-
local.value = next;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
</script>
|
|
20
|
-
|
|
21
|
-
<template>
|
|
22
|
-
<TelaInput v-model="value" :label="props.props.label" :placeholder="props.props.placeholder" :disabled="!interactive" w-full data-openui="input" />
|
|
23
|
-
</template>
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
props: {
|
|
3
|
-
name: string;
|
|
4
|
-
label: string;
|
|
5
|
-
placeholder?: 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
|
-
type __VLS_Props = {
|
|
2
|
-
props: {
|
|
3
|
-
label: string;
|
|
4
|
-
value: string;
|
|
5
|
-
delta?: string;
|
|
6
|
-
tone?: 'neutral' | 'positive' | 'negative';
|
|
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,20 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
const props = defineProps({
|
|
3
|
-
props: { type: Object, required: true }
|
|
4
|
-
});
|
|
5
|
-
const deltaClass = computed(() => ({
|
|
6
|
-
neutral: "text-secondary",
|
|
7
|
-
positive: "text-success",
|
|
8
|
-
negative: "text-error"
|
|
9
|
-
})[props.props.tone ?? "neutral"]);
|
|
10
|
-
</script>
|
|
11
|
-
|
|
12
|
-
<template>
|
|
13
|
-
<div flex flex-col gap-12px rounded-12px border-0.5px border p-16px bg-subtle data-openui="metric">
|
|
14
|
-
<span body-12-medium text-secondary>{{ props.props.label }}</span>
|
|
15
|
-
<div flex items-baseline gap-8px>
|
|
16
|
-
<span heading-h3-semibold text-contrast>{{ props.props.value }}</span>
|
|
17
|
-
<span v-if="props.props.delta" body-12-medium :class="deltaClass">{{ props.props.delta }}</span>
|
|
18
|
-
</div>
|
|
19
|
-
</div>
|
|
20
|
-
</template>
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
props: {
|
|
3
|
-
label: string;
|
|
4
|
-
value: string;
|
|
5
|
-
delta?: string;
|
|
6
|
-
tone?: 'neutral' | 'positive' | 'negative';
|
|
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,10 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
props: {
|
|
3
|
-
id: string;
|
|
4
|
-
label: string;
|
|
5
|
-
description?: 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 flex-col data-openui="option">
|
|
9
|
-
<span body-14-regular text-primary>{{ props.props.label }}</span>
|
|
10
|
-
<span v-if="props.props.description" body-12-regular text-secondary>{{ props.props.description }}</span>
|
|
11
|
-
</div>
|
|
12
|
-
</template>
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
props: {
|
|
3
|
-
id: string;
|
|
4
|
-
label: string;
|
|
5
|
-
description?: 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
|
-
type __VLS_Props = {
|
|
2
|
-
props: {
|
|
3
|
-
id: string;
|
|
4
|
-
title: string;
|
|
5
|
-
options: unknown[];
|
|
6
|
-
multiple?: boolean;
|
|
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,15 +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 Options = () => renderNode(props.props.options);
|
|
8
|
-
</script>
|
|
9
|
-
|
|
10
|
-
<template>
|
|
11
|
-
<div flex flex-col gap-8px data-openui="question">
|
|
12
|
-
<span body-14-medium text-primary>{{ props.props.title }}</span>
|
|
13
|
-
<Options />
|
|
14
|
-
</div>
|
|
15
|
-
</template>
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
props: {
|
|
3
|
-
id: string;
|
|
4
|
-
title: string;
|
|
5
|
-
options: unknown[];
|
|
6
|
-
multiple?: boolean;
|
|
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,9 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
props: {
|
|
3
|
-
requestId: string;
|
|
4
|
-
questions: unknown[];
|
|
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,91 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { formatQuestionAnswers } from "@meistrari/chat-ui-lang";
|
|
3
|
-
import { OPENUI_ERROR_REPORTER_KEY } from "../../openui/context";
|
|
4
|
-
import { useOpenuiContext } from "../../openui/use-openui-context";
|
|
5
|
-
const props = defineProps({
|
|
6
|
-
props: { type: Object, required: true }
|
|
7
|
-
});
|
|
8
|
-
const { interactive, triggerAction } = useOpenuiContext();
|
|
9
|
-
const reportErrors = inject(OPENUI_ERROR_REPORTER_KEY, null);
|
|
10
|
-
function toQuestion(node) {
|
|
11
|
-
const question = node;
|
|
12
|
-
if (question?.typeName !== "Question" || !question.props || typeof question.props.id !== "string" || typeof question.props.title !== "string")
|
|
13
|
-
return null;
|
|
14
|
-
const options = (Array.isArray(question.props.options) ? question.props.options : []).map((option) => option).filter((option) => option?.typeName === "Option" && typeof option.props?.id === "string" && typeof option.props.label === "string").map((option) => ({
|
|
15
|
-
id: option.props.id,
|
|
16
|
-
label: option.props.label,
|
|
17
|
-
...typeof option.props.description === "string" ? { description: option.props.description } : {}
|
|
18
|
-
}));
|
|
19
|
-
if (options.length === 0)
|
|
20
|
-
return null;
|
|
21
|
-
return {
|
|
22
|
-
id: question.props.id,
|
|
23
|
-
title: question.props.title,
|
|
24
|
-
type: question.props.multiple === true ? "multiple" : "single",
|
|
25
|
-
options
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
const parsedQuestions = computed(() => (Array.isArray(props.props.questions) ? props.props.questions : []).map(toQuestion).filter((question) => question !== null));
|
|
29
|
-
const hasRepeatedIds = computed(() => new Set(parsedQuestions.value.map((question) => question.id)).size !== parsedQuestions.value.length || parsedQuestions.value.some((question) => new Set(question.options.map((option) => option.id)).size !== question.options.length));
|
|
30
|
-
const questions = computed(() => hasRepeatedIds.value ? [] : parsedQuestions.value);
|
|
31
|
-
watch(hasRepeatedIds, (repeated) => {
|
|
32
|
-
if (repeated)
|
|
33
|
-
reportErrors?.([{ source: "runtime", code: "duplicate-id", message: `Questions ${props.props.requestId} repeats question or option IDs` }], "");
|
|
34
|
-
}, { immediate: true });
|
|
35
|
-
const answers = reactive(/* @__PURE__ */ new Map());
|
|
36
|
-
const sending = ref(false);
|
|
37
|
-
watch(questions, (list) => {
|
|
38
|
-
for (const question of list) {
|
|
39
|
-
if (!answers.has(question.id))
|
|
40
|
-
answers.set(question.id, { selected: [] });
|
|
41
|
-
}
|
|
42
|
-
}, { immediate: true });
|
|
43
|
-
function toggle(question, optionId) {
|
|
44
|
-
if (!interactive.value)
|
|
45
|
-
return;
|
|
46
|
-
if (!answers.has(question.id))
|
|
47
|
-
answers.set(question.id, { selected: [] });
|
|
48
|
-
const answer = answers.get(question.id);
|
|
49
|
-
if (question.type === "single") {
|
|
50
|
-
answer.selected = [optionId];
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
answer.selected = answer.selected.includes(optionId) ? answer.selected.filter((id) => id !== optionId) : [...answer.selected, optionId];
|
|
54
|
-
}
|
|
55
|
-
const message = computed(() => formatQuestionAnswers(props.props.requestId, questions.value, Object.fromEntries(answers)));
|
|
56
|
-
async function submit() {
|
|
57
|
-
if (!interactive.value || !message.value || sending.value)
|
|
58
|
-
return;
|
|
59
|
-
sending.value = true;
|
|
60
|
-
try {
|
|
61
|
-
await triggerAction("Enviar respostas", { steps: [{ type: "continue_conversation", message: message.value }] });
|
|
62
|
-
} finally {
|
|
63
|
-
sending.value = false;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
</script>
|
|
67
|
-
|
|
68
|
-
<template>
|
|
69
|
-
<div v-if="questions.length" flex flex-col gap-16px rounded-12px border-0.5px border p-16px data-openui="questions">
|
|
70
|
-
<div v-for="question in questions" :key="question.id" flex flex-col gap-8px>
|
|
71
|
-
<span body-14-medium text-primary>{{ question.title }}</span>
|
|
72
|
-
<div flex flex-wrap gap-8px>
|
|
73
|
-
<TelaButton
|
|
74
|
-
v-for="option in question.options"
|
|
75
|
-
:key="option.id"
|
|
76
|
-
:variant="answers.get(question.id)?.selected.includes(option.id) ? 'primary' : 'secondary'"
|
|
77
|
-
:disabled="!interactive"
|
|
78
|
-
:title="option.description"
|
|
79
|
-
@click="toggle(question, option.id)"
|
|
80
|
-
>
|
|
81
|
-
{{ option.label }}
|
|
82
|
-
</TelaButton>
|
|
83
|
-
</div>
|
|
84
|
-
</div>
|
|
85
|
-
<div flex justify-end>
|
|
86
|
-
<TelaButton :disabled="!interactive || !message" :loading="sending" @click="submit">
|
|
87
|
-
Enviar respostas
|
|
88
|
-
</TelaButton>
|
|
89
|
-
</div>
|
|
90
|
-
</div>
|
|
91
|
-
</template>
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
props: {
|
|
3
|
-
requestId: string;
|
|
4
|
-
questions: unknown[];
|
|
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
|
-
name: string;
|
|
4
|
-
label: string;
|
|
5
|
-
options: 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,27 +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("");
|
|
9
|
-
const { interactive } = useOpenuiContext();
|
|
10
|
-
const options = computed(() => (Array.isArray(props.props.options) ? props.props.options : []).filter((option) => typeof option === "string").map((option) => ({ value: option, label: option })));
|
|
11
|
-
const value = computed({
|
|
12
|
-
get: () => String((form ? form.get(props.props.name) : local.value) ?? ""),
|
|
13
|
-
set: (next) => {
|
|
14
|
-
if (form)
|
|
15
|
-
form.set(props.props.name, next);
|
|
16
|
-
else
|
|
17
|
-
local.value = next;
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
</script>
|
|
21
|
-
|
|
22
|
-
<template>
|
|
23
|
-
<div flex flex-col gap-4px data-openui="select">
|
|
24
|
-
<span body-12-medium text-secondary>{{ props.props.label }}</span>
|
|
25
|
-
<TelaSelectMenu v-model="value" :options="options" :disabled="!interactive" trigger-class="w-full" />
|
|
26
|
-
</div>
|
|
27
|
-
</template>
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
props: {
|
|
3
|
-
name: string;
|
|
4
|
-
label: string;
|
|
5
|
-
options: 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,9 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
props: {
|
|
3
|
-
children: unknown[];
|
|
4
|
-
direction?: 'column' | 'row';
|
|
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,18 +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
|
-
<div
|
|
12
|
-
flex gap-12px w-full
|
|
13
|
-
:class="props.props.direction === 'row' ? 'flex-row flex-wrap items-stretch [&>*]:flex-1 [&>*]:min-w-160px' : 'flex-col'"
|
|
14
|
-
data-openui="stack"
|
|
15
|
-
>
|
|
16
|
-
<Children />
|
|
17
|
-
</div>
|
|
18
|
-
</template>
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
props: {
|
|
3
|
-
children: unknown[];
|
|
4
|
-
direction?: 'column' | 'row';
|
|
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
|
-
columns: unknown[];
|
|
4
|
-
caption?: 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,41 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
const props = defineProps({
|
|
3
|
-
props: { type: Object, required: true }
|
|
4
|
-
});
|
|
5
|
-
function toColumn(node) {
|
|
6
|
-
const column = node;
|
|
7
|
-
if (column?.typeName !== "Col" || !column.props)
|
|
8
|
-
return null;
|
|
9
|
-
return {
|
|
10
|
-
label: typeof column.props.label === "string" ? column.props.label : "",
|
|
11
|
-
values: Array.isArray(column.props.values) ? column.props.values.filter((value) => typeof value === "string" || typeof value === "number") : [],
|
|
12
|
-
align: column.props.align === "right" ? "right" : "left"
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
const columns = computed(() => (Array.isArray(props.props.columns) ? props.props.columns : []).map(toColumn).filter((column) => column !== null));
|
|
16
|
-
const rowCount = computed(() => columns.value.reduce((max, column) => Math.max(max, column.values.length), 0));
|
|
17
|
-
</script>
|
|
18
|
-
|
|
19
|
-
<template>
|
|
20
|
-
<div data-openui="table">
|
|
21
|
-
<TelaTable>
|
|
22
|
-
<TelaTableCaption v-if="props.props.caption">
|
|
23
|
-
{{ props.props.caption }}
|
|
24
|
-
</TelaTableCaption>
|
|
25
|
-
<TelaTableHeader>
|
|
26
|
-
<TelaTableRow>
|
|
27
|
-
<TelaTableHead v-for="(column, index) in columns" :key="index" :class="column.align === 'right' ? 'text-right' : ''">
|
|
28
|
-
{{ column.label }}
|
|
29
|
-
</TelaTableHead>
|
|
30
|
-
</TelaTableRow>
|
|
31
|
-
</TelaTableHeader>
|
|
32
|
-
<TelaTableBody>
|
|
33
|
-
<TelaTableRow v-for="row in rowCount" :key="row">
|
|
34
|
-
<TelaTableCell v-for="(column, index) in columns" :key="index" :class="column.align === 'right' ? 'text-right' : ''">
|
|
35
|
-
{{ column.values[row - 1] ?? "" }}
|
|
36
|
-
</TelaTableCell>
|
|
37
|
-
</TelaTableRow>
|
|
38
|
-
</TelaTableBody>
|
|
39
|
-
</TelaTable>
|
|
40
|
-
</div>
|
|
41
|
-
</template>
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
props: {
|
|
3
|
-
columns: unknown[];
|
|
4
|
-
caption?: 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,15 +0,0 @@
|
|
|
1
|
-
import type { ActionPlan, Store } from '@openuidev/lang-core';
|
|
2
|
-
export type OpenuiActionHandlers = {
|
|
3
|
-
send: (message: string, context?: unknown) => Promise<boolean>;
|
|
4
|
-
openUrl: (url: string) => void;
|
|
5
|
-
custom: (name: string, params: Record<string, unknown>) => Promise<boolean>;
|
|
6
|
-
store: Store;
|
|
7
|
-
stateDefaults: Record<string, unknown>;
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* Executes an action plan step by step and stops at the first rejected send,
|
|
11
|
-
* so later state changes never outrun what the user actually did. A plain
|
|
12
|
-
* label without a plan behaves like `@ToAssistant(label)`, as the prompt says.
|
|
13
|
-
*/
|
|
14
|
-
export declare function runActionPlan(label: string, plan: ActionPlan | undefined, handlers: OpenuiActionHandlers): Promise<boolean>;
|
|
15
|
-
export declare function copyWidgetText(text: string, writeText: (text: string) => Promise<void>): Promise<boolean>;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { ACTION_STEPS, evaluate } from "@openuidev/lang-core";
|
|
2
|
-
export async function runActionPlan(label, plan, handlers) {
|
|
3
|
-
const steps = plan?.steps ?? [];
|
|
4
|
-
if (steps.length === 0)
|
|
5
|
-
return handlers.send(label);
|
|
6
|
-
for (const step of steps) {
|
|
7
|
-
switch (step.type) {
|
|
8
|
-
case ACTION_STEPS.ToAssistant:
|
|
9
|
-
if (!await handlers.send(step.message, step.context))
|
|
10
|
-
return false;
|
|
11
|
-
break;
|
|
12
|
-
case ACTION_STEPS.OpenUrl:
|
|
13
|
-
handlers.openUrl(step.url);
|
|
14
|
-
break;
|
|
15
|
-
case ACTION_STEPS.Set:
|
|
16
|
-
handlers.store.set(step.target, step.valueAST ? evaluate(step.valueAST, { getState: (name) => handlers.store.get(name), resolveRef: () => null }) : null);
|
|
17
|
-
break;
|
|
18
|
-
case ACTION_STEPS.Reset:
|
|
19
|
-
for (const target of step.targets)
|
|
20
|
-
handlers.store.set(target, handlers.stateDefaults[target] ?? null);
|
|
21
|
-
break;
|
|
22
|
-
case "custom_action":
|
|
23
|
-
if (!await handlers.custom(step.name, step.params))
|
|
24
|
-
return false;
|
|
25
|
-
break;
|
|
26
|
-
default:
|
|
27
|
-
break;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
return true;
|
|
31
|
-
}
|
|
32
|
-
export async function copyWidgetText(text, writeText) {
|
|
33
|
-
try {
|
|
34
|
-
await writeText(text);
|
|
35
|
-
return true;
|
|
36
|
-
} catch (error) {
|
|
37
|
-
console.warn("[chat-nuxt] widget copy failed", { error: error instanceof Error ? error.message : String(error) });
|
|
38
|
-
return false;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export type FormField = {
|
|
2
|
-
name: string;
|
|
3
|
-
label: string;
|
|
4
|
-
type: string;
|
|
5
|
-
};
|
|
6
|
-
/** Fields share state by name, so a repeated name keeps its first field and is reported. */
|
|
7
|
-
export declare function collectFormFields(value: unknown): {
|
|
8
|
-
fields: FormField[];
|
|
9
|
-
duplicates: string[];
|
|
10
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
const FIELD_TYPES = /* @__PURE__ */ new Set(["Input", "Select", "Checkbox"]);
|
|
2
|
-
function collect(value, into) {
|
|
3
|
-
if (Array.isArray(value)) {
|
|
4
|
-
for (const item of value)
|
|
5
|
-
collect(item, into);
|
|
6
|
-
return;
|
|
7
|
-
}
|
|
8
|
-
const node = value;
|
|
9
|
-
if (!node || typeof node !== "object" || !node.props)
|
|
10
|
-
return;
|
|
11
|
-
if (node.typeName && FIELD_TYPES.has(node.typeName) && typeof node.props.name === "string") {
|
|
12
|
-
into.push({ name: node.props.name, label: typeof node.props.label === "string" ? node.props.label : node.props.name, type: node.typeName });
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
for (const child of Object.values(node.props))
|
|
16
|
-
collect(child, into);
|
|
17
|
-
}
|
|
18
|
-
export function collectFormFields(value) {
|
|
19
|
-
const found = [];
|
|
20
|
-
collect(value, found);
|
|
21
|
-
const fields = [];
|
|
22
|
-
const duplicates = /* @__PURE__ */ new Set();
|
|
23
|
-
for (const field of found) {
|
|
24
|
-
if (fields.some((existing) => existing.name === field.name))
|
|
25
|
-
duplicates.add(field.name);
|
|
26
|
-
else
|
|
27
|
-
fields.push(field);
|
|
28
|
-
}
|
|
29
|
-
return { fields, duplicates: [...duplicates] };
|
|
30
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { createStore } from '@openuidev/lang-core';
|
|
2
|
-
import type { ElementNode, OpenUIError } from '@openuidev/lang-core';
|
|
3
|
-
import type { ComputedRef, Ref } from 'vue';
|
|
4
|
-
export type OpenuiProgram = {
|
|
5
|
-
root: ComputedRef<ElementNode | null>;
|
|
6
|
-
errors: ComputedRef<OpenUIError[]>;
|
|
7
|
-
incomplete: ComputedRef<boolean>;
|
|
8
|
-
stateDefaults: ComputedRef<Record<string, unknown>>;
|
|
9
|
-
store: ReturnType<typeof createStore>;
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* Parses a streamed OpenUI Lang program. `code` may grow while `complete` is
|
|
13
|
-
* false; the parser diffs against its buffer so each chunk is parsed once.
|
|
14
|
-
*/
|
|
15
|
-
export declare function useOpenuiProgram(code: Ref<string>, complete: Ref<boolean>): OpenuiProgram;
|