@chai-ui/vue 0.10.1 → 0.11.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/DESIGN.md +6 -0
- package/README.md +4 -0
- package/dist/Composer.vue.d.ts +17 -1
- package/dist/Composer.vue.d.ts.map +1 -1
- package/dist/composer/AttachMenu.vue.d.ts +2 -1
- package/dist/composer/AttachMenu.vue.d.ts.map +1 -1
- package/dist/icons.d.ts +1 -0
- package/dist/icons.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +96 -31
- package/dist/index.js.map +1 -1
- package/dist/primitives/SearchMenu.vue.d.ts +3 -0
- package/dist/primitives/SearchMenu.vue.d.ts.map +1 -1
- package/dist/style.css +47 -12
- package/package.json +3 -3
- package/src/Composer.vue +54 -0
- package/src/composer/AttachMenu.vue +24 -6
- package/src/icons.ts +1 -0
- package/src/index.ts +6 -0
- package/src/primitives/SearchMenu.vue +9 -3
package/DESIGN.md
CHANGED
|
@@ -60,6 +60,11 @@ use these names: `Results`, `Compare`, `ModelPicker`,
|
|
|
60
60
|
8. **Only show what's real.** Show cost only when the engine reports it.
|
|
61
61
|
Don't show model rankings or leaderboard positions you can't keep up to
|
|
62
62
|
date. Don't show a control the selected model can't honor.
|
|
63
|
+
9. **Say where the bar is docked.** A `Composer` fixed to the bottom of
|
|
64
|
+
the screen gets `menuPlacement="above"`, one fixed to the top
|
|
65
|
+
`menuPlacement="below"`, so its menus always open into the page. Leave
|
|
66
|
+
it out for a bar in the page flow: `"auto"` picks the side with room
|
|
67
|
+
each time a menu opens.
|
|
63
68
|
|
|
64
69
|
### In Vue
|
|
65
70
|
|
|
@@ -155,6 +160,7 @@ Rules:
|
|
|
155
160
|
| No use case picked | The prompt is a text request and gets a text reply | Set `defaultUseCase` if your app's default should be image or video |
|
|
156
161
|
| Voice input | A mic left of submit; while recording, a live waveform replaces the prompt and the mic becomes stop; the transcript is added to the prompt, never sent; submit hides until it's in; inline messages for a blocked or missing mic | Pass `voiceInput={{ model: "fal-ai/wizper" }}` (any Fal speech-to-text model, through your `/api/chai/fal` route) or `voiceInput={{ transcribe }}` for another provider. Chai never picks the model. |
|
|
157
162
|
| Create world | Two prompts, Environment (required) and Character (optional), each with its own Enhance; a frame rate menu from the models' `frameRates`; submit waits for an environment and says so | Add `"create-world"` to `attachMenuActions`, pass your world models, `character` + `onCharacterChange`, and route `engineByKind.world` to your world engine. Show the world in your own viewer. |
|
|
163
|
+
| Create speech, Create music | The attach menu's audio group, under a divider; speech asks for the words to speak, music for a description; Enhance keeps a speech script's words and only makes them read aloud well; once one model is picked, a Voice menu from its `voices` (speech), or a multi-select Genre menu from the picked models' `genres` (music, written into the prompt) | Add `"create-speech"` / `"create-music"` to `attachMenuActions`, set `CREATE_SPEECH_USE_CASE` / `CREATE_MUSIC_USE_CASE` on the pick, pass your audio models (with `voices` or `genres`) and `engineByKind.audio`, and wire `speechVoice` / `genres`. No duration, instrumental or reference-audio controls yet |
|
|
158
164
|
| Result pending | `ResultCard` shows a spinner for `queued` / `running` | Nothing. `useComposer` sets the status. |
|
|
159
165
|
| Long text answer | `ResultCard` keeps line breaks, scrolls past 400px with a visible scrollbar, and follows streaming text unless the person scrolls up | Change the height with `textMaxHeight` if needed |
|
|
160
166
|
| Text streaming in | `ResultCard` renders partial text with a caret, marked `aria-busy` | Use an engine that calls `onText` (OpenRouter does, and so does the mock text engine). `useComposer` wires it. |
|
package/README.md
CHANGED
|
@@ -91,6 +91,10 @@ The props are React's, with Vue's conventions:
|
|
|
91
91
|
Some controls show only with a listener, as in React: the optimize button
|
|
92
92
|
with `@enhance`, stop with `@abort`, the Model menu with `@update:model-id`.
|
|
93
93
|
|
|
94
|
+
Docked the bar? Set `menu-placement="above"` for a bar fixed to the bottom
|
|
95
|
+
of the screen, or `"below"` for one fixed to the top, so every menu opens
|
|
96
|
+
into the page. Left out, it's `"auto"`: each menu goes where it fits.
|
|
97
|
+
|
|
94
98
|
## What's in the package
|
|
95
99
|
|
|
96
100
|
- **`Composer`**: prompt, attachments, use cases, model and aspect-ratio
|
package/dist/Composer.vue.d.ts
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* while submitting) and `@attach-menu-select` (the + menu's use cases).
|
|
15
15
|
*/
|
|
16
16
|
import "@material/web/fab/fab.js";
|
|
17
|
-
import { type ComposerAttachment, type ComposerAttachMenuAction, type ComposerPromptField, type GenerationUseCase, type ComposerSubmitPayload, type ComposerUseCase, type EditRegion, type ModelOption, type OutputKind, type ParameterOption, type VoiceInputConfig } from "@chai-ui/core";
|
|
17
|
+
import { type ComposerAttachment, type ComposerAttachMenuAction, type ComposerPromptField, type GenerationUseCase, type ComposerSubmitPayload, type ComposerUseCase, type EditRegion, type MenuPlacement, type ModelOption, type OutputKind, type ParameterOption, type VoiceInputConfig } from "@chai-ui/core";
|
|
18
18
|
type __VLS_Props = {
|
|
19
19
|
/** The prompt text. Controlled: use `v-model`. */
|
|
20
20
|
modelValue: string;
|
|
@@ -62,6 +62,19 @@ type __VLS_Props = {
|
|
|
62
62
|
/** A world's frame rate menu, from the selected models' `frameRates`. */
|
|
63
63
|
frameRate?: number | null;
|
|
64
64
|
"onUpdate:frameRate"?: (value: number) => void;
|
|
65
|
+
/** Create speech's Voice menu, from the one picked model's `voices` (`v-model:speech-voice`). Not `voiceInput`, which is dictation. */
|
|
66
|
+
speechVoice?: string | null;
|
|
67
|
+
"onUpdate:speechVoice"?: (value: string) => void;
|
|
68
|
+
/** Create music's Genre menu, several at once, from the picked models' `genres` (`v-model:genres`). */
|
|
69
|
+
genres?: string[];
|
|
70
|
+
"onUpdate:genres"?: (values: string[]) => void;
|
|
71
|
+
/**
|
|
72
|
+
* Which way the bar's menus open. "above" for a bar docked to the bottom
|
|
73
|
+
* of the screen, "below" for one docked to the top. "auto" (default)
|
|
74
|
+
* measures when a menu opens: below if it fits, else above if that fits,
|
|
75
|
+
* else toward the side with more room.
|
|
76
|
+
*/
|
|
77
|
+
menuPlacement?: MenuPlacement;
|
|
65
78
|
/** The last submit's failure: submit becomes retry, and the message shows inline. */
|
|
66
79
|
submitError?: string | null;
|
|
67
80
|
/** Overrides the built-in "empty prompt and no attachments" check. Ignored while `submitError` is set. */
|
|
@@ -101,6 +114,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
101
114
|
modelId: string | null;
|
|
102
115
|
aspectRatio: string | null;
|
|
103
116
|
frameRate: number | null;
|
|
117
|
+
speechVoice: string | null;
|
|
118
|
+
genres: string[];
|
|
119
|
+
menuPlacement: MenuPlacement;
|
|
104
120
|
submitError: string | null;
|
|
105
121
|
submitDisabled: boolean;
|
|
106
122
|
regions: EditRegion[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Composer.vue.d.ts","sourceRoot":"","sources":["../src/Composer.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Composer.vue.d.ts","sourceRoot":"","sources":["../src/Composer.vue"],"names":[],"mappings":"AAybA;;;;;;;;;;;;;;GAcG;AACH,OAAO,0BAA0B,CAAC;AAElC,OAAO,EAKL,KAAK,kBAAkB,EACvB,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,UAAU,EAEf,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACtB,MAAM,eAAe,CAAC;AASvB,KAAK,WAAW,GAAG;IACf,kDAAkD;IAClD,UAAU,EAAE,MAAM,CAAC;IACnB,4FAA4F;IAC5F,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6GAA6G;IAC7G,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,kBAAkB,EAAE,CAAC;IACnC,sBAAsB,CAAC,EAAE,CAAC,IAAI,EAAE,kB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CAAC,EAAE,gBAAgB,CAAC;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AA+xBJ,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;6EAIhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ComposerAttachMenuAction, type composerAttachMenuItems, type MenuPlacement } from "@chai-ui/core";
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
items: ReturnType<typeof composerAttachMenuItems>;
|
|
4
4
|
/** Edit mode: one image file at a time. */
|
|
5
5
|
imagesOnly?: boolean;
|
|
6
6
|
disabled?: boolean;
|
|
7
|
+
placement: MenuPlacement;
|
|
7
8
|
};
|
|
8
9
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
9
10
|
select: (action: ComposerAttachMenuAction) => any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttachMenu.vue.d.ts","sourceRoot":"","sources":["../../src/composer/AttachMenu.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AttachMenu.vue.d.ts","sourceRoot":"","sources":["../../src/composer/AttachMenu.vue"],"names":[],"mappings":"AAyFA,OAAO,EAAkB,KAAK,wBAAwB,EAAE,KAAK,uBAAuB,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAIhI,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAC;IAClD,2CAA2C;IAC3C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,aAAa,CAAC;CAC1B,CAAC;AAuKF,QAAA,MAAM,YAAY;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
package/dist/icons.d.ts
CHANGED
|
@@ -43,5 +43,6 @@ export declare const ImageIcon: FunctionalComponent<{}, {}, any, {}>;
|
|
|
43
43
|
export declare const GlobeIcon: FunctionalComponent<{}, {}, any, {}>;
|
|
44
44
|
export declare const VideocamIcon: FunctionalComponent<{}, {}, any, {}>;
|
|
45
45
|
export declare const ContentCutIcon: FunctionalComponent<{}, {}, any, {}>;
|
|
46
|
+
export declare const VolumeUpIcon: FunctionalComponent<{}, {}, any, {}>;
|
|
46
47
|
export declare const MusicNoteIcon: FunctionalComponent<{}, {}, any, {}>;
|
|
47
48
|
//# sourceMappingURL=icons.d.ts.map
|
package/dist/icons.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../src/icons.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAK,KAAK,mBAAmB,EAAE,MAAM,KAAK,CAAC;AAclD,eAAO,MAAM,YAAY,sCAAoR,CAAC;AAC9S,eAAO,MAAM,SAAS,sCAAsT,CAAC;AAC7U,eAAO,MAAM,UAAU,sCAAuL,CAAC;AAC/M,eAAO,MAAM,UAAU,sCAAwb,CAAC;AAChd,eAAO,MAAM,WAAW,sCAAuU,CAAC;AAChW,eAAO,MAAM,OAAO,sCAAyH,CAAC;AAC9I,eAAO,MAAM,UAAU,sCAA6Q,CAAC;AACrS,eAAO,MAAM,cAAc,sCAA8hB,CAAC;AAC1jB,eAAO,MAAM,iBAAiB,sCAAkmB,CAAC;AACjoB,eAAO,MAAM,eAAe,sCAAqH,CAAC;AAClJ,eAAO,MAAM,eAAe,sCAAiK,CAAC;AAC9L,4CAA4C;AAC5C,eAAO,MAAM,OAAO,sCAAse,CAAC;AAC3f,eAAO,MAAM,QAAQ,sCAA0F,CAAC;AAChH,eAAO,MAAM,WAAW,sCAAqW,CAAC;AAC9X,eAAO,MAAM,aAAa,sCAAw4B,CAAC;AACn6B,eAAO,MAAM,WAAW,s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+CAA+C;AAC/C,eAAO,MAAM,SAAS,sCAA+mB,CAAC;AACtoB,eAAO,MAAM,YAAY,sCAA8N,CAAC;AACxP,eAAO,MAAM,cAAc,sCAAkoB,CAAC;AAC9pB,eAAO,MAAM,YAAY,sCAAmU,CAAC;AAC7V,eAAO,MAAM,aAAa,sCAA0M,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -11,6 +11,6 @@ export type { ResultCardMoreAction, ResultCardVote } from "./result-card/types.j
|
|
|
11
11
|
export * from "./reasoning.js";
|
|
12
12
|
export * from "./useComposer.js";
|
|
13
13
|
export * from "./useMediaAnalyzer.js";
|
|
14
|
-
export { createFalEngine, createFalTranscriber, createOpenRouterEngine, createMockEngine, mockEngine, buildRegionEditPrompt, DEFAULT_MAX_ATTACHMENTS_BY_KIND, DEFAULT_MAX_REGIONS, DEFAULT_MODEL_ID, DEFAULT_REASONING_MODEL, DEFAULT_REASONING_MODEL_BY_KIND, EDIT_IMAGE_USE_CASE, TEXT_USE_CASE, PRECISE_EDIT_MODELS, ROUTING_MODEL_ID, GenerationError, isMediaAnalyzerAtCap, nextMediaAnalyzerAttachments, DEFAULT_MEDIA_ANALYSIS_PROMPT_LENGTH, MEDIA_ANALYSIS_PROMPTS, MEDIA_ANALYSIS_PROMPT_LENGTHS, SUGGESTED_IMAGE_MODELS, SUGGESTED_TEXT_TO_VIDEO_MODELS, SUGGESTED_IMAGE_TO_VIDEO_MODELS, SUGGESTED_EDIT_MODELS, SUGGESTED_ANALYSIS_MODELS, reasoningModelFor, suggestedModels, checkSuggestedModels, } from "@chai-ui/core";
|
|
15
|
-
export type { ComposerAttachMenuAction, ComposerPromptField, ComposerAttachment, ComposerSelection, ComposerSubmitPayload, ComposerUseCase, DroppedMedia, EditRegion, EditVersion, Evaluation, GenerationEngine, GenerationUseCase, MediaAnalysisKind, MediaAnalysisPromptLength, MediaAnalyzerAttachment, MediaAnalyzerSubmitPayload, MediaKind, ModelOption, OutputKind, Transcribe, VoiceClip, VoiceInputConfig, ParameterOption, Reasoning, RegionBox, RegionFormat, Request, Result, ResultStatus, Run, SuggestedModelProblem, SuggestedModelsCheck, FalInputFormat, Usage, } from "@chai-ui/core";
|
|
14
|
+
export { createFalEngine, createFalTranscriber, createOpenRouterEngine, createMockEngine, mockEngine, buildRegionEditPrompt, DEFAULT_MAX_ATTACHMENTS_BY_KIND, DEFAULT_MAX_REGIONS, DEFAULT_MODEL_ID, DEFAULT_REASONING_MODEL, DEFAULT_REASONING_MODEL_BY_KIND, CREATE_MUSIC_USE_CASE, CREATE_SPEECH_USE_CASE, EDIT_IMAGE_USE_CASE, TEXT_USE_CASE, PRECISE_EDIT_MODELS, ROUTING_MODEL_ID, GenerationError, isMediaAnalyzerAtCap, nextMediaAnalyzerAttachments, DEFAULT_MEDIA_ANALYSIS_PROMPT_LENGTH, MEDIA_ANALYSIS_PROMPTS, MEDIA_ANALYSIS_PROMPT_LENGTHS, SUGGESTED_IMAGE_MODELS, SUGGESTED_TEXT_TO_VIDEO_MODELS, SUGGESTED_IMAGE_TO_VIDEO_MODELS, SUGGESTED_EDIT_MODELS, SUGGESTED_ANALYSIS_MODELS, reasoningModelFor, suggestedModels, promptWithGenres, checkSuggestedModels, } from "@chai-ui/core";
|
|
15
|
+
export type { AudioUseCase, ComposerAttachMenuAction, ComposerPromptField, ComposerAttachment, ComposerSelection, ComposerSubmitPayload, ComposerUseCase, DroppedMedia, EditRegion, EditVersion, Evaluation, GenerationEngine, GenerationUseCase, MediaAnalysisKind, MediaAnalysisPromptLength, MediaAnalyzerAttachment, MediaAnalyzerSubmitPayload, MediaKind, MenuPlacement, ModelOption, OutputKind, Transcribe, VoiceClip, VoiceInputConfig, VoiceOption, ParameterOption, Reasoning, RegionBox, RegionFormat, Request, Result, ResultStatus, Run, SuggestedModelProblem, SuggestedModelsCheck, FalInputFormat, Usage, } from "@chai-ui/core";
|
|
16
16
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +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B,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AAItC,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,sBAAsB,EACtB,gBAAgB,EAChB,UAAU,EACV,qBAAqB,EACrB,+BAA+B,EAC/B,mBAAmB,EACnB,gBAAgB,EAChB,uBAAuB,EACvB,+BAA+B,EAC/B,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,aAAa,EACb,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACpB,4BAA4B,EAC5B,oCAAoC,EACpC,sBAAsB,EACtB,6BAA6B,EAC7B,sBAAsB,EACtB,8BAA8B,EAC9B,+BAA+B,EAC/B,qBAAqB,EACrB,yBAAyB,EACzB,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,YAAY,EACZ,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,EACf,YAAY,EACZ,UAAU,EACV,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,yBAAyB,EACzB,uBAAuB,EACvB,0BAA0B,EAC1B,SAAS,EACT,aAAa,EACb,WAAW,EACX,UAAU,EACV,UAAU,EACV,SAAS,EACT,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,SAAS,EACT,SAAS,EACT,YAAY,EACZ,OAAO,EACP,MAAM,EACN,YAAY,EACZ,GAAG,EACH,qBAAqB,EACrB,oBAAoB,EACpB,cAAc,EACd,KAAK,GACN,MAAM,eAAe,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { inject, computed, defineComponent, provide, renderSlot, watch, onScopeDispose, h, ref, openBlock, createElementBlock, createElementVNode, normalizeClass, createBlock, unref, Fragment, renderList, resolveDynamicComponent, createTextVNode, toDisplayString, createCommentVNode, normalizeStyle, createVNode, useId,
|
|
2
|
-
import { reasoningEngineFor, createReasoning, regionColor, MAX_ANIMATE_ENHANCE_LENGTH, enhanceRevealDurationMs, VOICE_LEVEL_COUNT, formatVoiceElapsed, composerView, composerAttachMenuItems, createVoiceInput, composerAttachmentsFromFiles, regionBoxStyle, REGION_CORNERS, DEFAULT_MAX_REGIONS, freeRegionNumber, EDIT_ZOOM_STEPS, regionPopoverPosition, editCardWidth, newRegion, panForZoom, clampPan, fitBox, resizeBox, regionBoxForKey, panForKey, downloadMedia, downloadFilename, shareMedia, resultModelLabel, formatTokens, formatCost, formatDuration, formatAspectRatio, SUGGESTED_ANALYSIS_MODELS, DEFAULT_MAX_ATTACHMENTS_BY_KIND, isMediaAnalyzerAtCap, mediaAnalyzerModelSections, PROMPT_LENGTH_HINT, readMediaFiles, nextMediaAnalyzerAttachments, replacedNote, createComposerStore, pickReasoning, createMediaAnalyzerStore } from "@chai-ui/core";
|
|
3
|
-
import { DEFAULT_MAX_ATTACHMENTS_BY_KIND as DEFAULT_MAX_ATTACHMENTS_BY_KIND2, DEFAULT_MAX_REGIONS as DEFAULT_MAX_REGIONS2, DEFAULT_MEDIA_ANALYSIS_PROMPT_LENGTH, DEFAULT_MODEL_ID, DEFAULT_REASONING_MODEL, DEFAULT_REASONING_MODEL_BY_KIND, EDIT_IMAGE_USE_CASE, GenerationError, MEDIA_ANALYSIS_PROMPTS, MEDIA_ANALYSIS_PROMPT_LENGTHS, PRECISE_EDIT_MODELS, ROUTING_MODEL_ID, SUGGESTED_ANALYSIS_MODELS as SUGGESTED_ANALYSIS_MODELS2, SUGGESTED_EDIT_MODELS, SUGGESTED_IMAGE_MODELS, SUGGESTED_IMAGE_TO_VIDEO_MODELS, SUGGESTED_TEXT_TO_VIDEO_MODELS, TEXT_USE_CASE, buildRegionEditPrompt, checkSuggestedModels, createFalEngine, createFalTranscriber, createMockEngine, createOpenRouterEngine, isMediaAnalyzerAtCap as isMediaAnalyzerAtCap2, mockEngine, nextMediaAnalyzerAttachments as nextMediaAnalyzerAttachments2, reasoningModelFor, suggestedModels } from "@chai-ui/core";
|
|
1
|
+
import { inject, computed, defineComponent, provide, renderSlot, watch, onScopeDispose, h, ref, nextTick, openBlock, createElementBlock, createElementVNode, normalizeClass, createBlock, unref, Fragment, renderList, resolveDynamicComponent, createTextVNode, toDisplayString, createCommentVNode, normalizeStyle, createVNode, useId, shallowRef, mergeProps, onMounted, onUnmounted, withModifiers, withCtx, withDirectives, vModelText, reactive, toValue } from "vue";
|
|
2
|
+
import { reasoningEngineFor, createReasoning, menuOpensAbove, regionColor, MAX_ANIMATE_ENHANCE_LENGTH, enhanceRevealDurationMs, VOICE_LEVEL_COUNT, formatVoiceElapsed, composerView, composerAttachMenuItems, createVoiceInput, composerAttachmentsFromFiles, regionBoxStyle, REGION_CORNERS, DEFAULT_MAX_REGIONS, freeRegionNumber, EDIT_ZOOM_STEPS, regionPopoverPosition, editCardWidth, newRegion, panForZoom, clampPan, fitBox, resizeBox, regionBoxForKey, panForKey, downloadMedia, downloadFilename, shareMedia, resultModelLabel, formatTokens, formatCost, formatDuration, formatAspectRatio, SUGGESTED_ANALYSIS_MODELS, DEFAULT_MAX_ATTACHMENTS_BY_KIND, isMediaAnalyzerAtCap, mediaAnalyzerModelSections, PROMPT_LENGTH_HINT, readMediaFiles, nextMediaAnalyzerAttachments, replacedNote, createComposerStore, pickReasoning, createMediaAnalyzerStore } from "@chai-ui/core";
|
|
3
|
+
import { CREATE_MUSIC_USE_CASE, CREATE_SPEECH_USE_CASE, DEFAULT_MAX_ATTACHMENTS_BY_KIND as DEFAULT_MAX_ATTACHMENTS_BY_KIND2, DEFAULT_MAX_REGIONS as DEFAULT_MAX_REGIONS2, DEFAULT_MEDIA_ANALYSIS_PROMPT_LENGTH, DEFAULT_MODEL_ID, DEFAULT_REASONING_MODEL, DEFAULT_REASONING_MODEL_BY_KIND, EDIT_IMAGE_USE_CASE, GenerationError, MEDIA_ANALYSIS_PROMPTS, MEDIA_ANALYSIS_PROMPT_LENGTHS, PRECISE_EDIT_MODELS, ROUTING_MODEL_ID, SUGGESTED_ANALYSIS_MODELS as SUGGESTED_ANALYSIS_MODELS2, SUGGESTED_EDIT_MODELS, SUGGESTED_IMAGE_MODELS, SUGGESTED_IMAGE_TO_VIDEO_MODELS, SUGGESTED_TEXT_TO_VIDEO_MODELS, TEXT_USE_CASE, buildRegionEditPrompt, checkSuggestedModels, createFalEngine, createFalTranscriber, createMockEngine, createOpenRouterEngine, isMediaAnalyzerAtCap as isMediaAnalyzerAtCap2, mockEngine, nextMediaAnalyzerAttachments as nextMediaAnalyzerAttachments2, promptWithGenres, reasoningModelFor, suggestedModels } from "@chai-ui/core";
|
|
4
4
|
import "@material/web/fab/fab.js";
|
|
5
5
|
import "@material/web/checkbox/checkbox.js";
|
|
6
6
|
import "@material/web/textfield/outlined-text-field.js";
|
|
@@ -90,36 +90,49 @@ const ImageIcon = icon("0 -960 960 960", [{ "d": "M180-120q-24 0-42-18t-18-42v-6
|
|
|
90
90
|
const GlobeIcon = icon("0 -960 960 960", [{ "d": "M480.27-80q-82.74 0-155.5-31.5Q252-143 197.5-197.5t-86-127.34Q80-397.68 80-480.5t31.5-155.66Q143-709 197.5-763t127.34-85.5Q397.68-880 480.5-880t155.66 31.5Q709-817 763-763t85.5 127Q880-563 880-480.27q0 82.74-31.5 155.5Q817-252 763-197.68q-54 54.31-127 86Q563-80 480.27-80Zm-.27-60q142.38 0 241.19-99.5T820-480v-13q-6 26-27.41 43.5Q771.19-432 742-432h-80q-33 0-56.5-23.5T582-512v-40H422v-80q0-33 23.5-56.5T502-712h40v-22q0-16 13.5-40t30.5-29q-25-8-51.36-12.5Q508.29-820 480-820q-141 0-240.5 98.81T140-480h150q66 0 113 47t47 113v40H330v105q34 17 71.7 26t78.3 9Z", "fill": "currentColor" }]);
|
|
91
91
|
const VideocamIcon = icon("0 -960 960 960", [{ "d": "M140-160q-24 0-42-18t-18-42v-520q0-24 18-42t42-18h520q24 0 42 18t18 42v215l160-160v410L720-435v215q0 24-18 42t-42 18H140Zm0-60h520v-520H140v520Zm0 0v-520 520Z", "fill": "currentColor" }]);
|
|
92
92
|
const ContentCutIcon = icon("0 -960 960 960", [{ "d": "M782-114 481-415 364-298q11 17 13.5 33t2.5 35q0 64-43 107T230-80q-64 0-107-43T80-230q0-64 43-107t107-43q18 0 35.5 5t36.5 15l116-116-118-118q-17 8-34.5 11t-35.5 3q-64 0-107-43T80-730q0-64 43-107t107-43q64 0 107 43t43 107q0 19-2.5 36T367-662l514 514v34h-99ZM599-527l-66-66 249-249h99v33L599-527ZM294-666q26-26 26-64t-26-64q-26-26-64-26t-64 26q-26 26-26 64t26 64q26 26 64 26t64-26Zm202.5 203.5Q502-468 502-476t-5.5-13.5Q491-495 483-495t-13.5 5.5Q464-484 464-476t5.5 13.5Q475-457 483-457t13.5-5.5ZM294-166q26-26 26-64t-26-64q-26-26-64-26t-64 26q-26 26-26 64t26 64q26 26 64 26t64-26Z", "fill": "currentColor" }]);
|
|
93
|
+
const VolumeUpIcon = icon("0 -960 960 960", [{ "d": "M560-131v-62q97-28 158.5-107.5T780-481q0-101-61-181T560-769v-62q124 28 202 125.5T840-481q0 127-78 224.5T560-131ZM120-360v-240h160l200-200v640L280-360H120Zm420 48v-337q55 17 87.5 64T660-480q0 57-33 104t-87 64ZM420-648 307-540H180v120h127l113 109v-337Zm-94 168Z", "fill": "currentColor" }]);
|
|
93
94
|
const MusicNoteIcon = icon("0 -960 960 960", [{ "d": "M286.5-163.5Q243-207 243-270t43.5-106.5Q330-420 393-420q28 0 50.5 8t39.5 22v-450h234v135H543v435q0 63-43.5 106.5T393-120q-63 0-106.5-43.5Z", "fill": "currentColor" }]);
|
|
94
95
|
const _hoisted_1$j = ["disabled", "aria-expanded", "aria-label"];
|
|
95
|
-
const _hoisted_2$e =
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
role: "menu"
|
|
99
|
-
};
|
|
100
|
-
const _hoisted_3$c = ["onClick"];
|
|
101
|
-
const _hoisted_4$9 = { class: "chai-composer__attach-menu-icon" };
|
|
102
|
-
const _hoisted_5$7 = {
|
|
96
|
+
const _hoisted_2$e = ["onClick"];
|
|
97
|
+
const _hoisted_3$c = { class: "chai-composer__attach-menu-icon" };
|
|
98
|
+
const _hoisted_4$9 = {
|
|
103
99
|
key: 0,
|
|
104
100
|
class: "chai-composer__attach-menu-divider",
|
|
105
101
|
role: "separator"
|
|
106
102
|
};
|
|
107
|
-
const
|
|
103
|
+
const _hoisted_5$7 = ["accept", "multiple", "disabled"];
|
|
108
104
|
const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
109
105
|
__name: "AttachMenu",
|
|
110
106
|
props: {
|
|
111
107
|
items: {},
|
|
112
108
|
imagesOnly: { type: Boolean },
|
|
113
|
-
disabled: { type: Boolean }
|
|
109
|
+
disabled: { type: Boolean },
|
|
110
|
+
placement: {}
|
|
114
111
|
},
|
|
115
112
|
emits: ["select", "files"],
|
|
116
113
|
setup(__props, { emit: __emit }) {
|
|
114
|
+
const props = __props;
|
|
117
115
|
const emit = __emit;
|
|
118
|
-
const ICONS = {
|
|
116
|
+
const ICONS = {
|
|
117
|
+
"add-media": AttachFileIcon,
|
|
118
|
+
"create-image": ImageIcon,
|
|
119
|
+
"create-video": VideocamIcon,
|
|
120
|
+
"create-world": GlobeIcon,
|
|
121
|
+
"edit-image": ContentCutIcon,
|
|
122
|
+
"create-speech": VolumeUpIcon,
|
|
123
|
+
"create-music": MusicNoteIcon
|
|
124
|
+
};
|
|
119
125
|
const open = ref(false);
|
|
126
|
+
const above = ref(false);
|
|
120
127
|
const root = ref();
|
|
128
|
+
const menu = ref();
|
|
121
129
|
const input = ref();
|
|
122
130
|
useDismiss(root, open, () => open.value = false);
|
|
131
|
+
watch(open, async (isOpen) => {
|
|
132
|
+
if (!isOpen) return;
|
|
133
|
+
await nextTick();
|
|
134
|
+
above.value = menuOpensAbove(props.placement, root.value.getBoundingClientRect(), menu.value.offsetHeight, document.documentElement.clientHeight);
|
|
135
|
+
});
|
|
123
136
|
function pick(action) {
|
|
124
137
|
open.value = false;
|
|
125
138
|
if (action === "add-media") input.value?.click();
|
|
@@ -147,7 +160,13 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
147
160
|
}, [
|
|
148
161
|
open.value ? (openBlock(), createBlock(unref(CloseSymbolIcon), { key: 0 })) : (openBlock(), createBlock(unref(PlusIcon), { key: 1 }))
|
|
149
162
|
], 10, _hoisted_1$j),
|
|
150
|
-
open.value ? (openBlock(), createElementBlock("ul",
|
|
163
|
+
open.value ? (openBlock(), createElementBlock("ul", {
|
|
164
|
+
key: 0,
|
|
165
|
+
ref_key: "menu",
|
|
166
|
+
ref: menu,
|
|
167
|
+
class: normalizeClass(["chai-composer__attach-menu", { "chai-composer__attach-menu--above": above.value }]),
|
|
168
|
+
role: "menu"
|
|
169
|
+
}, [
|
|
151
170
|
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (item, i) => {
|
|
152
171
|
return openBlock(), createElementBlock("li", {
|
|
153
172
|
key: item.action,
|
|
@@ -159,15 +178,15 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
159
178
|
class: "chai-composer__attach-menu-item",
|
|
160
179
|
onClick: ($event) => pick(item.action)
|
|
161
180
|
}, [
|
|
162
|
-
createElementVNode("span",
|
|
181
|
+
createElementVNode("span", _hoisted_3$c, [
|
|
163
182
|
(openBlock(), createBlock(resolveDynamicComponent(ICONS[item.action])))
|
|
164
183
|
]),
|
|
165
184
|
createTextVNode(toDisplayString(item.label), 1)
|
|
166
|
-
], 8,
|
|
167
|
-
item.divider && i < __props.items.length - 1 ? (openBlock(), createElementBlock("hr",
|
|
185
|
+
], 8, _hoisted_2$e),
|
|
186
|
+
item.divider && i < __props.items.length - 1 ? (openBlock(), createElementBlock("hr", _hoisted_4$9)) : createCommentVNode("", true)
|
|
168
187
|
]);
|
|
169
188
|
}), 128))
|
|
170
|
-
])) : createCommentVNode("", true),
|
|
189
|
+
], 2)) : createCommentVNode("", true),
|
|
171
190
|
createElementVNode("input", {
|
|
172
191
|
ref_key: "input",
|
|
173
192
|
ref: input,
|
|
@@ -177,7 +196,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
177
196
|
hidden: "",
|
|
178
197
|
disabled: __props.disabled,
|
|
179
198
|
onChange: onFileChange
|
|
180
|
-
}, null, 40,
|
|
199
|
+
}, null, 40, _hoisted_5$7)
|
|
181
200
|
], 512);
|
|
182
201
|
};
|
|
183
202
|
}
|
|
@@ -546,13 +565,15 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
546
565
|
disabled: { type: Boolean },
|
|
547
566
|
searchable: { type: Boolean, default: true },
|
|
548
567
|
triggerVariant: { default: "outlined" },
|
|
549
|
-
panelWidth: { default: 280 }
|
|
568
|
+
panelWidth: { default: 280 },
|
|
569
|
+
placement: { default: "auto" }
|
|
550
570
|
},
|
|
551
571
|
emits: ["select"],
|
|
552
572
|
setup(__props, { emit: __emit }) {
|
|
553
573
|
const props = __props;
|
|
554
574
|
const emit = __emit;
|
|
555
575
|
const open = ref(false);
|
|
576
|
+
const above = ref(false);
|
|
556
577
|
const search = ref("");
|
|
557
578
|
const root = ref();
|
|
558
579
|
const panel = ref();
|
|
@@ -567,6 +588,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
567
588
|
const rect = el.getBoundingClientRect();
|
|
568
589
|
const over = rect.right - (document.documentElement.clientWidth - 16);
|
|
569
590
|
if (over > 0) el.style.left = `${-Math.min(over, Math.max(0, rect.left - 16))}px`;
|
|
591
|
+
above.value = menuOpensAbove(props.placement, root.value.getBoundingClientRect(), el.offsetHeight, document.documentElement.clientHeight);
|
|
570
592
|
});
|
|
571
593
|
useDismiss(root, open, close);
|
|
572
594
|
const groups = computed(() => {
|
|
@@ -617,7 +639,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
617
639
|
key: 0,
|
|
618
640
|
ref_key: "panel",
|
|
619
641
|
ref: panel,
|
|
620
|
-
class: "chai-search-menu__panel",
|
|
642
|
+
class: normalizeClass(["chai-search-menu__panel", { "chai-search-menu__panel--above": above.value }]),
|
|
621
643
|
role: "group",
|
|
622
644
|
"aria-label": __props.menuLabel,
|
|
623
645
|
style: normalizeStyle({ width: `${__props.panelWidth}px` })
|
|
@@ -637,7 +659,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
637
659
|
key: 1,
|
|
638
660
|
class: "chai-search-menu__search",
|
|
639
661
|
label: __props.menuLabel,
|
|
640
|
-
placeholder: "
|
|
662
|
+
placeholder: "Search",
|
|
641
663
|
".value": search.value,
|
|
642
664
|
onInput: _cache[2] || (_cache[2] = ($event) => search.value = $event.target.value)
|
|
643
665
|
}, [
|
|
@@ -734,7 +756,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
734
756
|
}), 128)),
|
|
735
757
|
!hasAnyOption.value ? (openBlock(), createElementBlock("li", _hoisted_16$2, "No matches.")) : createCommentVNode("", true)
|
|
736
758
|
])
|
|
737
|
-
],
|
|
759
|
+
], 14, _hoisted_3$8)) : createCommentVNode("", true)
|
|
738
760
|
], 512);
|
|
739
761
|
};
|
|
740
762
|
}
|
|
@@ -807,6 +829,11 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
807
829
|
"onUpdate:character": {},
|
|
808
830
|
frameRate: { default: null },
|
|
809
831
|
"onUpdate:frameRate": {},
|
|
832
|
+
speechVoice: { default: null },
|
|
833
|
+
"onUpdate:speechVoice": {},
|
|
834
|
+
genres: { default: () => [] },
|
|
835
|
+
"onUpdate:genres": {},
|
|
836
|
+
menuPlacement: { default: "auto" },
|
|
810
837
|
submitError: { default: null },
|
|
811
838
|
submitDisabled: { type: Boolean, default: void 0 },
|
|
812
839
|
submitting: { type: Boolean },
|
|
@@ -839,6 +866,10 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
839
866
|
const modelMenuOptions = computed(
|
|
840
867
|
() => props.multiSelectUseCases ? { sections: view.value.modelSections.map((s) => ({ label: s.label, options: s.options })) } : { options: view.value.modelSections[0]?.options }
|
|
841
868
|
);
|
|
869
|
+
const toMenuOption = (o) => ({ id: o.value, label: o.label });
|
|
870
|
+
const voiceMenuOptions = computed(
|
|
871
|
+
() => view.value.voiceSections ? { sections: view.value.voiceSections.map((s) => ({ label: s.label, options: s.options.map(toMenuOption) })) } : { options: view.value.voiceOptions.map(toMenuOption) }
|
|
872
|
+
);
|
|
842
873
|
watch(
|
|
843
874
|
() => props.autoSelectModel,
|
|
844
875
|
(on, was) => {
|
|
@@ -985,9 +1016,10 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
985
1016
|
items: menuItems.value,
|
|
986
1017
|
"images-only": view.value.editing,
|
|
987
1018
|
disabled: __props.disabled,
|
|
1019
|
+
placement: __props.menuPlacement,
|
|
988
1020
|
onSelect: _cache[3] || (_cache[3] = ($event) => __props.onAttachMenuSelect?.($event)),
|
|
989
1021
|
onFiles
|
|
990
|
-
}, null, 8, ["items", "images-only", "disabled"])) : createCommentVNode("", true),
|
|
1022
|
+
}, null, 8, ["items", "images-only", "disabled", "placement"])) : createCommentVNode("", true),
|
|
991
1023
|
(openBlock(true), createElementBlock(Fragment, null, renderList(view.value.pickedUseCases, (u) => {
|
|
992
1024
|
return openBlock(), createBlock(_sfc_main$i, {
|
|
993
1025
|
key: u.kind,
|
|
@@ -997,7 +1029,10 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
997
1029
|
onRemove: ($event) => removeUseCase(u)
|
|
998
1030
|
}, null, 8, ["label", "removable", "disabled", "onRemove"]);
|
|
999
1031
|
}), 128)),
|
|
1000
|
-
view.value.modelSections.length > 0 && view.value.canPickModel ? (openBlock(), createBlock(_sfc_main$d, mergeProps({
|
|
1032
|
+
view.value.modelSections.length > 0 && view.value.canPickModel ? (openBlock(), createBlock(_sfc_main$d, mergeProps({
|
|
1033
|
+
key: 1,
|
|
1034
|
+
placement: __props.menuPlacement
|
|
1035
|
+
}, modelMenuOptions.value, {
|
|
1001
1036
|
value: view.value.multiModel ? view.value.pickedModelIds : __props.modelId,
|
|
1002
1037
|
multiple: view.value.multiModel,
|
|
1003
1038
|
"toggle-header": __props.showAutoSelectToggle ? { label: "Auto-select model", value: __props.autoSelectModel, onChange: (v) => props["onUpdate:autoSelectModel"]?.(v) } : void 0,
|
|
@@ -1008,9 +1043,10 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
1008
1043
|
disabled: __props.disabled || __props.autoSelectModel && !__props.showAutoSelectToggle,
|
|
1009
1044
|
"panel-width": __props.showAutoSelectToggle ? 320 : void 0,
|
|
1010
1045
|
onSelect: _cache[4] || (_cache[4] = ($event) => toggleModel($event.id))
|
|
1011
|
-
}), null, 16, ["value", "multiple", "toggle-header", "trigger-label", "menu-label", "disabled", "panel-width"])) : createCommentVNode("", true),
|
|
1046
|
+
}), null, 16, ["placement", "value", "multiple", "toggle-header", "trigger-label", "menu-label", "disabled", "panel-width"])) : createCommentVNode("", true),
|
|
1012
1047
|
view.value.showAspectRatio && view.value.aspectOptions.length > 0 && props["onUpdate:aspectRatio"] ? (openBlock(), createBlock(_sfc_main$d, {
|
|
1013
1048
|
key: 2,
|
|
1049
|
+
placement: __props.menuPlacement,
|
|
1014
1050
|
options: view.value.aspectOptions.map((o) => ({ id: o.value, label: o.label })),
|
|
1015
1051
|
value: view.value.offeredAspect,
|
|
1016
1052
|
"trigger-label": view.value.selectedAspect?.label ?? "Aspect ratio",
|
|
@@ -1019,9 +1055,35 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
1019
1055
|
"trigger-variant": "text",
|
|
1020
1056
|
disabled: __props.disabled,
|
|
1021
1057
|
onSelect: _cache[5] || (_cache[5] = ($event) => props["onUpdate:aspectRatio"]?.($event.id))
|
|
1022
|
-
}, null, 8, ["options", "value", "trigger-label", "disabled"])) : createCommentVNode("", true),
|
|
1023
|
-
view.value.
|
|
1058
|
+
}, null, 8, ["placement", "options", "value", "trigger-label", "disabled"])) : createCommentVNode("", true),
|
|
1059
|
+
view.value.voiceOptions.length > 0 && props["onUpdate:speechVoice"] ? (openBlock(), createBlock(_sfc_main$d, mergeProps({
|
|
1024
1060
|
key: 3,
|
|
1061
|
+
placement: __props.menuPlacement
|
|
1062
|
+
}, voiceMenuOptions.value, {
|
|
1063
|
+
value: view.value.offeredVoice,
|
|
1064
|
+
"trigger-label": view.value.voiceTriggerLabel,
|
|
1065
|
+
"menu-label": "Voice",
|
|
1066
|
+
searchable: view.value.voiceOptions.length > view.value.searchableAt,
|
|
1067
|
+
"trigger-variant": "text",
|
|
1068
|
+
disabled: __props.disabled,
|
|
1069
|
+
onSelect: _cache[6] || (_cache[6] = ($event) => props["onUpdate:speechVoice"]?.($event.id))
|
|
1070
|
+
}), null, 16, ["placement", "value", "trigger-label", "searchable", "disabled"])) : createCommentVNode("", true),
|
|
1071
|
+
view.value.genreOptions.length > 0 && props["onUpdate:genres"] ? (openBlock(), createBlock(_sfc_main$d, {
|
|
1072
|
+
key: 4,
|
|
1073
|
+
placement: __props.menuPlacement,
|
|
1074
|
+
options: view.value.genreOptions.map(toMenuOption),
|
|
1075
|
+
value: view.value.offeredGenres,
|
|
1076
|
+
multiple: "",
|
|
1077
|
+
"trigger-label": view.value.genreTriggerLabel,
|
|
1078
|
+
"menu-label": "Genre",
|
|
1079
|
+
searchable: view.value.genreOptions.length > view.value.searchableAt,
|
|
1080
|
+
"trigger-variant": "text",
|
|
1081
|
+
disabled: __props.disabled,
|
|
1082
|
+
onSelect: _cache[7] || (_cache[7] = ($event) => props["onUpdate:genres"]?.(view.value.toggledGenres($event.id)))
|
|
1083
|
+
}, null, 8, ["placement", "options", "value", "trigger-label", "searchable", "disabled"])) : createCommentVNode("", true),
|
|
1084
|
+
view.value.frameRateOptions.length > 0 && props["onUpdate:frameRate"] ? (openBlock(), createBlock(_sfc_main$d, {
|
|
1085
|
+
key: 5,
|
|
1086
|
+
placement: __props.menuPlacement,
|
|
1025
1087
|
options: view.value.frameRateOptions.map((r) => ({ id: String(r), label: `${r}fps` })),
|
|
1026
1088
|
value: view.value.offeredFrameRate == null ? null : String(view.value.offeredFrameRate),
|
|
1027
1089
|
"trigger-label": view.value.offeredFrameRate == null ? "Frame rate" : `${view.value.offeredFrameRate}fps`,
|
|
@@ -1029,8 +1091,8 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
1029
1091
|
searchable: false,
|
|
1030
1092
|
"trigger-variant": "text",
|
|
1031
1093
|
disabled: __props.disabled,
|
|
1032
|
-
onSelect: _cache[
|
|
1033
|
-
}, null, 8, ["options", "value", "trigger-label", "disabled"])) : createCommentVNode("", true)
|
|
1094
|
+
onSelect: _cache[8] || (_cache[8] = ($event) => props["onUpdate:frameRate"]?.(Number($event.id)))
|
|
1095
|
+
}, null, 8, ["placement", "options", "value", "trigger-label", "disabled"])) : createCommentVNode("", true)
|
|
1034
1096
|
]),
|
|
1035
1097
|
createElementVNode("div", _hoisted_12$3, [
|
|
1036
1098
|
__props.voiceInput ? (openBlock(), createBlock(_sfc_main$g, {
|
|
@@ -2748,6 +2810,8 @@ function useMediaAnalyzer(options = {}) {
|
|
|
2748
2810
|
};
|
|
2749
2811
|
}
|
|
2750
2812
|
export {
|
|
2813
|
+
CREATE_MUSIC_USE_CASE,
|
|
2814
|
+
CREATE_SPEECH_USE_CASE,
|
|
2751
2815
|
_sfc_main$k as ChaiProvider,
|
|
2752
2816
|
_sfc_main$c as Composer,
|
|
2753
2817
|
DEFAULT_MAX_ATTACHMENTS_BY_KIND2 as DEFAULT_MAX_ATTACHMENTS_BY_KIND,
|
|
@@ -2783,6 +2847,7 @@ export {
|
|
|
2783
2847
|
isMediaAnalyzerAtCap2 as isMediaAnalyzerAtCap,
|
|
2784
2848
|
mockEngine,
|
|
2785
2849
|
nextMediaAnalyzerAttachments2 as nextMediaAnalyzerAttachments,
|
|
2850
|
+
promptWithGenres,
|
|
2786
2851
|
reasoningKey,
|
|
2787
2852
|
reasoningModelFor,
|
|
2788
2853
|
suggestedModels,
|