@mulmochat-plugin/quiz 0.2.1 → 0.3.0
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.ja.md +4 -4
- package/README.md +4 -4
- package/dist/core/definition.d.ts +6 -0
- package/dist/core/index.d.ts +4 -2
- package/dist/core/plugin.d.ts +2 -4
- package/dist/core/samples.d.ts +5 -0
- package/dist/core/types.d.ts +3 -222
- package/dist/react/Preview.d.ts +3 -4
- package/dist/react/View.d.ts +3 -6
- package/dist/react/index.d.ts +8 -6
- package/dist/react.cjs +4 -4
- package/dist/react.js +70 -71
- package/dist/style.css +1 -1
- package/dist/vue/Preview.vue.d.ts +1 -1
- package/dist/vue/View.vue.d.ts +1 -1
- package/dist/vue/index.d.ts +7 -5
- package/package.json +5 -2
- package/dist/react/types.d.ts +0 -18
- package/dist/vue/types.d.ts +0 -32
package/README.ja.md
CHANGED
|
@@ -118,16 +118,16 @@ MulmoChatPluginQuiz/
|
|
|
118
118
|
│ ├── style.css # Tailwind CSSエントリー
|
|
119
119
|
│ ├── core/ # フレームワーク非依存(Vue/React依存なし)
|
|
120
120
|
│ │ ├── index.ts # Coreエクスポート
|
|
121
|
-
│ │ ├── types.ts #
|
|
122
|
-
│ │
|
|
121
|
+
│ │ ├── types.ts # Quiz固有の型(QuizData, QuizArgs)
|
|
122
|
+
│ │ ├── definition.ts # ツール定義(スキーマ)
|
|
123
|
+
│ │ ├── samples.ts # サンプルデータ
|
|
124
|
+
│ │ └── plugin.ts # Execute関数
|
|
123
125
|
│ ├── vue/ # Vue固有の実装
|
|
124
126
|
│ │ ├── index.ts # Vueプラグイン(core + コンポーネント)
|
|
125
|
-
│ │ ├── types.ts # ToolPlugin(ToolPluginCoreを拡張)
|
|
126
127
|
│ │ ├── View.vue # メインビューコンポーネント
|
|
127
128
|
│ │ └── Preview.vue # サイドバープレビュー
|
|
128
129
|
│ └── react/ # React固有の実装
|
|
129
130
|
│ ├── index.ts # Reactプラグイン(core + コンポーネント)
|
|
130
|
-
│ ├── types.ts # ToolPlugin(ToolPluginCoreを拡張)
|
|
131
131
|
│ ├── View.tsx # メインビューコンポーネント
|
|
132
132
|
│ └── Preview.tsx # サイドバープレビュー
|
|
133
133
|
├── demo/ # Vueデモ
|
package/README.md
CHANGED
|
@@ -118,16 +118,16 @@ MulmoChatPluginQuiz/
|
|
|
118
118
|
│ ├── style.css # Tailwind CSS entry
|
|
119
119
|
│ ├── core/ # Framework-agnostic (no Vue/React dependencies)
|
|
120
120
|
│ │ ├── index.ts # Core exports
|
|
121
|
-
│ │ ├── types.ts #
|
|
122
|
-
│ │
|
|
121
|
+
│ │ ├── types.ts # Quiz-specific types (QuizData, QuizArgs)
|
|
122
|
+
│ │ ├── definition.ts # Tool definition (schema)
|
|
123
|
+
│ │ ├── samples.ts # Sample data
|
|
124
|
+
│ │ └── plugin.ts # Execute function
|
|
123
125
|
│ ├── vue/ # Vue-specific implementation
|
|
124
126
|
│ │ ├── index.ts # Vue plugin (combines core + components)
|
|
125
|
-
│ │ ├── types.ts # ToolPlugin (extends ToolPluginCore)
|
|
126
127
|
│ │ ├── View.vue # Main view component
|
|
127
128
|
│ │ └── Preview.vue # Sidebar preview component
|
|
128
129
|
│ └── react/ # React-specific implementation
|
|
129
130
|
│ ├── index.ts # React plugin (combines core + components)
|
|
130
|
-
│ ├── types.ts # ToolPlugin (extends ToolPluginCore)
|
|
131
131
|
│ ├── View.tsx # Main view component
|
|
132
132
|
│ └── Preview.tsx # Sidebar preview component
|
|
133
133
|
├── demo/ # Vue demo
|
package/dist/core/index.d.ts
CHANGED
|
@@ -4,5 +4,7 @@
|
|
|
4
4
|
* Framework-agnostic types and plugin logic.
|
|
5
5
|
* Import from "@mulmochat-plugin/quiz/core"
|
|
6
6
|
*/
|
|
7
|
-
export type {
|
|
8
|
-
export { pluginCore,
|
|
7
|
+
export type { QuizQuestion, QuizData, QuizArgs } from "./types";
|
|
8
|
+
export { pluginCore, executeQuiz } from "./plugin";
|
|
9
|
+
export { TOOL_NAME, TOOL_DEFINITION } from "./definition";
|
|
10
|
+
export { SAMPLES } from "./samples";
|
package/dist/core/plugin.d.ts
CHANGED
|
@@ -4,9 +4,7 @@
|
|
|
4
4
|
* Contains the plugin logic without UI components.
|
|
5
5
|
* Can be used by any framework (Vue, React, etc.)
|
|
6
6
|
*/
|
|
7
|
-
import type { ToolPluginCore, ToolContext, ToolResult
|
|
8
|
-
|
|
9
|
-
export declare const TOOL_DEFINITION: ToolDefinition;
|
|
10
|
-
export declare const SAMPLES: ToolSample[];
|
|
7
|
+
import type { ToolPluginCore, ToolContext, ToolResult } from "gui-chat-protocol";
|
|
8
|
+
import type { QuizData, QuizArgs } from "./types";
|
|
11
9
|
export declare const executeQuiz: (_context: ToolContext, args: QuizArgs) => Promise<ToolResult<never, QuizData>>;
|
|
12
10
|
export declare const pluginCore: ToolPluginCore<never, QuizData, QuizArgs>;
|
package/dist/core/types.d.ts
CHANGED
|
@@ -1,227 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Quiz Plugin Types
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Quiz-specific type definitions only.
|
|
5
|
+
* Common types should be imported directly from gui-chat-protocol.
|
|
5
6
|
*/
|
|
6
|
-
/**
|
|
7
|
-
* Backend types that plugins can declare they use.
|
|
8
|
-
* App layer manages actual provider/model settings for each type.
|
|
9
|
-
*/
|
|
10
|
-
export type BackendType = "textLLM" | "imageGen" | "audio" | "search" | "browse" | "map" | "mulmocast";
|
|
11
|
-
/**
|
|
12
|
-
* App interface provided to plugins via context.app
|
|
13
|
-
* Contains backend functions and config accessors
|
|
14
|
-
*/
|
|
15
|
-
export interface ToolContextApp extends Record<string, (...args: any[]) => any> {
|
|
16
|
-
getConfig: <T = unknown>(key: string) => T | undefined;
|
|
17
|
-
setConfig: (key: string, value: unknown) => void;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Context passed to plugin execute function
|
|
21
|
-
*/
|
|
22
|
-
export interface ToolContext {
|
|
23
|
-
currentResult?: ToolResult<unknown> | null;
|
|
24
|
-
app?: ToolContextApp;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Result returned from plugin execution
|
|
28
|
-
*/
|
|
29
|
-
export interface ToolResult<T = unknown, J = unknown> {
|
|
30
|
-
toolName?: string;
|
|
31
|
-
uuid?: string;
|
|
32
|
-
message: string;
|
|
33
|
-
title?: string;
|
|
34
|
-
jsonData?: J;
|
|
35
|
-
instructions?: string;
|
|
36
|
-
instructionsRequired?: boolean;
|
|
37
|
-
updating?: boolean;
|
|
38
|
-
cancelled?: boolean;
|
|
39
|
-
data?: T;
|
|
40
|
-
viewState?: Record<string, unknown>;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Complete tool result with required fields
|
|
44
|
-
*/
|
|
45
|
-
export interface ToolResultComplete<T = unknown, J = unknown> extends ToolResult<T, J> {
|
|
46
|
-
toolName: string;
|
|
47
|
-
uuid: string;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* JSON Schema property definition for tool parameters
|
|
51
|
-
*/
|
|
52
|
-
export interface JsonSchemaProperty {
|
|
53
|
-
type?: string;
|
|
54
|
-
description?: string;
|
|
55
|
-
enum?: string[];
|
|
56
|
-
items?: JsonSchemaProperty;
|
|
57
|
-
minimum?: number;
|
|
58
|
-
maximum?: number;
|
|
59
|
-
minItems?: number;
|
|
60
|
-
maxItems?: number;
|
|
61
|
-
properties?: Record<string, JsonSchemaProperty>;
|
|
62
|
-
required?: string[];
|
|
63
|
-
additionalProperties?: boolean;
|
|
64
|
-
oneOf?: JsonSchemaProperty[];
|
|
65
|
-
[key: string]: unknown;
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Tool definition for OpenAI-compatible function calling
|
|
69
|
-
*/
|
|
70
|
-
export interface ToolDefinition {
|
|
71
|
-
type: "function";
|
|
72
|
-
name: string;
|
|
73
|
-
description: string;
|
|
74
|
-
parameters?: {
|
|
75
|
-
type: "object";
|
|
76
|
-
properties: Record<string, JsonSchemaProperty>;
|
|
77
|
-
required: string[];
|
|
78
|
-
additionalProperties?: boolean;
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* API response from server start endpoint
|
|
83
|
-
*/
|
|
84
|
-
export interface StartApiResponse {
|
|
85
|
-
hasOpenAIApiKey?: boolean;
|
|
86
|
-
hasAnthropicApiKey?: boolean;
|
|
87
|
-
hasGoogleApiKey?: boolean;
|
|
88
|
-
[key: string]: unknown;
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Sample arguments for testing
|
|
92
|
-
*/
|
|
93
|
-
export interface ToolSample {
|
|
94
|
-
name: string;
|
|
95
|
-
args: Record<string, unknown>;
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* File input handler
|
|
99
|
-
*/
|
|
100
|
-
export interface FileInputHandler {
|
|
101
|
-
type: "file";
|
|
102
|
-
acceptedTypes: string[];
|
|
103
|
-
handleInput: (fileData: string, fileName: string) => ToolResult<unknown, unknown>;
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* Clipboard image input handler
|
|
107
|
-
*/
|
|
108
|
-
export interface ClipboardImageInputHandler {
|
|
109
|
-
type: "clipboard-image";
|
|
110
|
-
handleInput: (imageData: string) => ToolResult<unknown, unknown>;
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* URL input handler
|
|
114
|
-
*/
|
|
115
|
-
export interface UrlInputHandler {
|
|
116
|
-
type: "url";
|
|
117
|
-
patterns?: string[];
|
|
118
|
-
handleInput: (url: string) => ToolResult<unknown, unknown>;
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Text input handler
|
|
122
|
-
*/
|
|
123
|
-
export interface TextInputHandler {
|
|
124
|
-
type: "text";
|
|
125
|
-
patterns?: string[];
|
|
126
|
-
handleInput: (text: string) => ToolResult<unknown, unknown>;
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Union of all input handler types
|
|
130
|
-
*/
|
|
131
|
-
export type InputHandler = FileInputHandler | ClipboardImageInputHandler | UrlInputHandler | TextInputHandler;
|
|
132
|
-
/**
|
|
133
|
-
* Legacy file upload config (for backward compatibility)
|
|
134
|
-
* @deprecated Use InputHandler instead
|
|
135
|
-
*/
|
|
136
|
-
export interface FileUploadConfig {
|
|
137
|
-
acceptedTypes: string[];
|
|
138
|
-
handleUpload: (fileData: string, fileName: string, ...args: unknown[]) => ToolResult<unknown, unknown>;
|
|
139
|
-
}
|
|
140
|
-
export type ConfigValue = string | number | boolean | string[];
|
|
141
|
-
interface BaseFieldSchema {
|
|
142
|
-
label: string;
|
|
143
|
-
description?: string;
|
|
144
|
-
required?: boolean;
|
|
145
|
-
}
|
|
146
|
-
export interface StringFieldSchema extends BaseFieldSchema {
|
|
147
|
-
type: "string";
|
|
148
|
-
placeholder?: string;
|
|
149
|
-
minLength?: number;
|
|
150
|
-
maxLength?: number;
|
|
151
|
-
pattern?: string;
|
|
152
|
-
}
|
|
153
|
-
export interface NumberFieldSchema extends BaseFieldSchema {
|
|
154
|
-
type: "number";
|
|
155
|
-
min?: number;
|
|
156
|
-
max?: number;
|
|
157
|
-
step?: number;
|
|
158
|
-
}
|
|
159
|
-
export interface BooleanFieldSchema extends BaseFieldSchema {
|
|
160
|
-
type: "boolean";
|
|
161
|
-
}
|
|
162
|
-
export interface SelectOption {
|
|
163
|
-
value: string;
|
|
164
|
-
label: string;
|
|
165
|
-
description?: string;
|
|
166
|
-
disabled?: boolean;
|
|
167
|
-
}
|
|
168
|
-
export interface SelectFieldSchema extends BaseFieldSchema {
|
|
169
|
-
type: "select";
|
|
170
|
-
options: SelectOption[];
|
|
171
|
-
}
|
|
172
|
-
export interface MultiSelectFieldSchema extends BaseFieldSchema {
|
|
173
|
-
type: "multiselect";
|
|
174
|
-
options: SelectOption[];
|
|
175
|
-
minItems?: number;
|
|
176
|
-
maxItems?: number;
|
|
177
|
-
}
|
|
178
|
-
export type ConfigFieldSchema = StringFieldSchema | NumberFieldSchema | BooleanFieldSchema | SelectFieldSchema | MultiSelectFieldSchema;
|
|
179
|
-
/**
|
|
180
|
-
* Plugin configuration schema (JSON Schema based)
|
|
181
|
-
*/
|
|
182
|
-
export interface PluginConfigSchema {
|
|
183
|
-
key: string;
|
|
184
|
-
defaultValue: ConfigValue;
|
|
185
|
-
schema: ConfigFieldSchema;
|
|
186
|
-
}
|
|
187
|
-
/**
|
|
188
|
-
* Standard props for View components
|
|
189
|
-
*/
|
|
190
|
-
export interface ViewComponentProps<T = unknown, J = unknown> {
|
|
191
|
-
selectedResult: ToolResultComplete<T, J>;
|
|
192
|
-
sendTextMessage: (text?: string) => void;
|
|
193
|
-
onUpdateResult?: (result: Partial<ToolResult<T, J>>) => void;
|
|
194
|
-
pluginConfigs?: Record<string, unknown>;
|
|
195
|
-
}
|
|
196
|
-
/**
|
|
197
|
-
* Standard props for Preview components
|
|
198
|
-
*/
|
|
199
|
-
export interface PreviewComponentProps<T = unknown, J = unknown> {
|
|
200
|
-
result: ToolResultComplete<T, J>;
|
|
201
|
-
isSelected?: boolean;
|
|
202
|
-
onSelect?: () => void;
|
|
203
|
-
}
|
|
204
|
-
/**
|
|
205
|
-
* Core plugin interface - framework agnostic
|
|
206
|
-
* Does not include UI components
|
|
207
|
-
*/
|
|
208
|
-
export interface ToolPluginCore<T = unknown, J = unknown, A extends object = object> {
|
|
209
|
-
toolDefinition: ToolDefinition;
|
|
210
|
-
execute: (context: ToolContext, args: A) => Promise<ToolResult<T, J>>;
|
|
211
|
-
generatingMessage: string;
|
|
212
|
-
waitingMessage?: string;
|
|
213
|
-
uploadMessage?: string;
|
|
214
|
-
isEnabled: (startResponse?: StartApiResponse | null) => boolean;
|
|
215
|
-
delayAfterExecution?: number;
|
|
216
|
-
systemPrompt?: string;
|
|
217
|
-
inputHandlers?: InputHandler[];
|
|
218
|
-
/** @deprecated Use inputHandlers instead */
|
|
219
|
-
fileUpload?: FileUploadConfig;
|
|
220
|
-
/** New JSON Schema based config (framework-agnostic) */
|
|
221
|
-
configSchema?: PluginConfigSchema;
|
|
222
|
-
samples?: ToolSample[];
|
|
223
|
-
backends?: BackendType[];
|
|
224
|
-
}
|
|
225
7
|
/** Single quiz question */
|
|
226
8
|
export interface QuizQuestion {
|
|
227
9
|
question: string;
|
|
@@ -239,4 +21,3 @@ export interface QuizArgs {
|
|
|
239
21
|
title?: string;
|
|
240
22
|
questions: QuizQuestion[];
|
|
241
23
|
}
|
|
242
|
-
export {};
|
package/dist/react/Preview.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Quiz Preview Component (React)
|
|
3
3
|
*/
|
|
4
|
-
import type {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
4
|
+
import type { PreviewComponentProps } from "gui-chat-protocol";
|
|
5
|
+
import type { QuizData } from "../core/types";
|
|
6
|
+
type PreviewProps = PreviewComponentProps<never, QuizData>;
|
|
8
7
|
export declare function Preview({ result }: PreviewProps): import("react/jsx-runtime").JSX.Element | null;
|
|
9
8
|
export default Preview;
|
package/dist/react/View.d.ts
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Quiz View Component (React)
|
|
3
3
|
*/
|
|
4
|
-
import type {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
sendTextMessage: (text?: string) => void;
|
|
8
|
-
onUpdateResult?: (result: ToolResult) => void;
|
|
9
|
-
}
|
|
4
|
+
import type { ViewComponentProps } from "gui-chat-protocol";
|
|
5
|
+
import type { QuizData } from "../core/types";
|
|
6
|
+
type ViewProps = ViewComponentProps<never, QuizData>;
|
|
10
7
|
export declare function View({ selectedResult, sendTextMessage, onUpdateResult }: ViewProps): import("react/jsx-runtime").JSX.Element | null;
|
|
11
8
|
export default View;
|
package/dist/react/index.d.ts
CHANGED
|
@@ -5,18 +5,20 @@
|
|
|
5
5
|
* Import from "@mulmochat-plugin/quiz/react"
|
|
6
6
|
*/
|
|
7
7
|
import "../style.css";
|
|
8
|
-
import type {
|
|
8
|
+
import type { ToolPluginReact } from "gui-chat-protocol/react";
|
|
9
|
+
import type { QuizData, QuizArgs } from "../core/types";
|
|
9
10
|
import { View } from "./View";
|
|
10
11
|
import { Preview } from "./Preview";
|
|
11
12
|
/**
|
|
12
13
|
* Quiz plugin instance with React components
|
|
13
14
|
*/
|
|
14
|
-
export declare const plugin:
|
|
15
|
-
export type {
|
|
16
|
-
export
|
|
17
|
-
export { TOOL_NAME, TOOL_DEFINITION
|
|
15
|
+
export declare const plugin: ToolPluginReact<never, QuizData, QuizArgs>;
|
|
16
|
+
export type { QuizQuestion, QuizData, QuizArgs } from "../core/types";
|
|
17
|
+
export { pluginCore, executeQuiz } from "../core/plugin";
|
|
18
|
+
export { TOOL_NAME, TOOL_DEFINITION } from "../core/definition";
|
|
19
|
+
export { SAMPLES } from "../core/samples";
|
|
18
20
|
export { View, Preview };
|
|
19
21
|
declare const _default: {
|
|
20
|
-
plugin:
|
|
22
|
+
plugin: ToolPluginReact<never, QuizData, QuizArgs, import("gui-chat-protocol/react").InputHandler, Record<string, unknown>>;
|
|
21
23
|
};
|
|
22
24
|
export default _default;
|
package/dist/react.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});;/* empty css */const h=require("./core.cjs"),w=require("react");var S={exports:{}},g={};var
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});;/* empty css */const h=require("./core.cjs"),w=require("react");var S={exports:{}},g={};var W;function ae(){if(W)return g;W=1;var i=Symbol.for("react.transitional.element"),c=Symbol.for("react.fragment");function x(l,d,u){var p=null;if(u!==void 0&&(p=""+u),d.key!==void 0&&(p=""+d.key),"key"in d){u={};for(var v in d)v!=="key"&&(u[v]=d[v])}else u=d;return d=u.ref,{$$typeof:i,type:l,key:p,ref:d!==void 0?d:null,props:u}}return g.Fragment=c,g.jsx=x,g.jsxs=x,g}var T={};var Q;function oe(){return Q||(Q=1,process.env.NODE_ENV!=="production"&&(function(){function i(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===te?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case b:return"Fragment";case k:return"Profiler";case y:return"StrictMode";case Z:return"Suspense";case K:return"SuspenseList";case re:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case m:return"Portal";case H:return e.displayName||"Context";case P:return(e._context.displayName||"Context")+".Consumer";case B:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ee:return r=e.displayName||null,r!==null?r:i(e.type)||"Memo";case C:r=e._payload,e=e._init;try{return i(e(r))}catch{}}return null}function c(e){return""+e}function x(e){try{c(e);var r=!1}catch{r=!0}if(r){r=console;var n=r.error,a=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return n.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",a),c(e)}}function l(e){if(e===b)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===C)return"<...>";try{var r=i(e);return r?"<"+r+">":"<...>"}catch{return"<...>"}}function d(){var e=$.A;return e===null?null:e.getOwner()}function u(){return Error("react-stack-top-frame")}function p(e){if(L.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function v(e,r){function n(){M||(M=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",r))}n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}function O(){var e=i(this.type);return F[e]||(F[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function j(e,r,n,a,A,D){var o=n.ref;return e={$$typeof:f,type:e,key:r,props:n,_owner:a},(o!==void 0?o:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:O}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:A}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:D}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function _(e,r,n,a,A,D){var o=r.children;if(o!==void 0)if(a)if(ne(o)){for(a=0;a<o.length;a++)N(o[a]);Object.freeze&&Object.freeze(o)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else N(o);if(L.call(r,"key")){o=i(e);var E=Object.keys(r).filter(function(se){return se!=="key"});a=0<E.length?"{key: someKey, "+E.join(": ..., ")+": ...}":"{key: someKey}",V[o+a]||(E=0<E.length?"{"+E.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
2
2
|
let props = %s;
|
|
3
3
|
<%s {...props} />
|
|
4
4
|
React keys must be passed directly to JSX without using spread:
|
|
5
5
|
let props = %s;
|
|
6
|
-
<%s key={someKey} {...props} />`,o,
|
|
7
|
-
${u.map((m,b)=>{if(m===null)return null;const y=b+1,k=String.fromCharCode(65+m),P=
|
|
8
|
-
`)}`;c(f)};return
|
|
6
|
+
<%s key={someKey} {...props} />`,a,o,E,o),V[o+a]=!0)}if(o=null,n!==void 0&&(x(n),o=""+n),p(r)&&(x(r.key),o=""+r.key),"key"in r){n={};for(var Y in r)Y!=="key"&&(n[Y]=r[Y])}else n=r;return o&&v(n,typeof e=="function"?e.displayName||e.name||"Unknown":e),j(e,o,n,d(),A,D)}function N(e){R(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===C&&(e._payload.status==="fulfilled"?R(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function R(e){return typeof e=="object"&&e!==null&&e.$$typeof===f}var s=w,f=Symbol.for("react.transitional.element"),m=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),P=Symbol.for("react.consumer"),H=Symbol.for("react.context"),B=Symbol.for("react.forward_ref"),Z=Symbol.for("react.suspense"),K=Symbol.for("react.suspense_list"),ee=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),re=Symbol.for("react.activity"),te=Symbol.for("react.client.reference"),$=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=Object.prototype.hasOwnProperty,ne=Array.isArray,q=console.createTask?console.createTask:function(){return null};s={react_stack_bottom_frame:function(e){return e()}};var M,F={},z=s.react_stack_bottom_frame.bind(s,u)(),I=q(l(u)),V={};T.Fragment=b,T.jsx=function(e,r,n){var a=1e4>$.recentlyCreatedOwnerStacks++;return _(e,r,n,!1,a?Error("react-stack-top-frame"):z,a?q(l(e)):I)},T.jsxs=function(e,r,n){var a=1e4>$.recentlyCreatedOwnerStacks++;return _(e,r,n,!0,a?Error("react-stack-top-frame"):z,a?q(l(e)):I)}})()),T}var U;function le(){return U||(U=1,process.env.NODE_ENV==="production"?S.exports=ae():S.exports=oe()),S.exports}var t=le();function J({selectedResult:i,sendTextMessage:c,onUpdateResult:x}){const[l,d]=w.useState(null),[u,p]=w.useState([]);w.useEffect(()=>{if(i?.toolName===h.TOOL_NAME&&i.jsonData){const s=i.jsonData;d(s),i.viewState?.userAnswers?p(i.viewState.userAnswers):p(new Array(s.questions.length).fill(null))}},[i]);const v=w.useCallback(s=>{p(s),x&&x({viewState:{userAnswers:s}})},[x]),O=(s,f)=>{const m=[...u];m[s]=f,v(m)},j=u.filter(s=>s!==null).length,_=l&&j===l.questions.length,N=(s,f)=>u[s]===f?"border-blue-500 bg-blue-500/20":"border-[#4b4b6b] hover:border-[#6b6b8b] hover:bg-[#6b6b8b]/20",R=()=>{if(!l||!_)return;const f=`Here are my answers:
|
|
7
|
+
${u.map((m,b)=>{if(m===null)return null;const y=b+1,k=String.fromCharCode(65+m),P=l.questions[b].choices[m];return`Q${y}: ${k} - ${P}`}).filter(m=>m!==null).join(`
|
|
8
|
+
`)}`;c(f)};return l?t.jsx("div",{className:"w-full min-h-[400px] overflow-y-auto p-8 bg-[#1a1a2e] rounded-lg",children:t.jsxs("div",{className:"max-w-3xl mx-auto",children:[l.title&&t.jsx("h2",{className:"text-[#f0f0f0] text-3xl font-bold mb-8 text-center",children:l.title}),t.jsx("div",{className:"flex flex-col gap-6",children:l.questions.map((s,f)=>t.jsxs("div",{className:"bg-[#2d2d44] rounded-lg p-6 border-2 border-[#3d3d5c]",children:[t.jsxs("div",{className:"text-white text-lg font-semibold mb-4",children:[t.jsxs("span",{className:"text-blue-400 mr-2",children:[f+1,"."]}),s.question]}),t.jsx("div",{className:"flex flex-col gap-3",children:s.choices.map((m,b)=>t.jsxs("label",{className:`flex items-start p-4 rounded-lg cursor-pointer transition-all duration-200 border-2 ${N(f,b)}`,children:[t.jsx("input",{type:"radio",name:`question-${f}`,value:b,checked:u[f]===b,onChange:()=>O(f,b),className:"mt-1 mr-3 size-4 shrink-0"}),t.jsxs("span",{className:"text-white flex-1",children:[t.jsxs("span",{className:"font-semibold mr-2",children:[String.fromCharCode(65+b),"."]}),m]})]},b))})]},f))}),t.jsx("div",{className:"mt-8 flex justify-center",children:t.jsx("button",{onClick:R,disabled:!_,className:`py-3 px-8 rounded-lg text-white font-semibold text-lg transition-colors border-none cursor-pointer ${_?"bg-blue-600 hover:bg-blue-700":"bg-gray-600 cursor-not-allowed opacity-50"}`,children:"Submit Answers"})}),t.jsxs("div",{className:"mt-4 text-center text-gray-400 text-sm",children:[j," / ",l.questions.length," questions answered"]})]})}):null}function G({result:i}){const c=i.jsonData;return c?t.jsx("div",{className:"p-3 bg-blue-50 rounded-md",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("div",{className:"text-sm font-semibold text-gray-800 text-center",children:c.title||"Quiz"}),t.jsx("div",{className:"text-center",children:t.jsxs("span",{className:"inline-block bg-blue-600 text-white text-xs font-bold py-1 px-3 rounded-full",children:[c.questions.length," ",c.questions.length===1?"Question":"Questions"]})}),t.jsx("div",{className:"text-xs text-gray-600 overflow-hidden line-clamp-2",children:c.questions[0]?.question}),t.jsxs("div",{className:"flex justify-center gap-1",children:[Array.from({length:Math.min(c.questions[0]?.choices.length||0,4)}).map((x,l)=>t.jsx("div",{className:"size-2 bg-gray-400 rounded-full"},l)),(c.questions[0]?.choices.length||0)>4&&t.jsxs("span",{className:"text-xs text-gray-500",children:["+",c.questions[0].choices.length-4]})]})]})}):null}const X={...h.pluginCore,ViewComponent:J,PreviewComponent:G},ie={plugin:X};exports.SAMPLES=h.SAMPLES;exports.TOOL_DEFINITION=h.TOOL_DEFINITION;exports.TOOL_NAME=h.TOOL_NAME;exports.executeQuiz=h.executeQuiz;exports.pluginCore=h.pluginCore;exports.Preview=G;exports.View=J;exports.default=ie;exports.plugin=X;
|
package/dist/react.js
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
import { TOOL_NAME as re, pluginCore as te } from "./core.js";
|
|
3
3
|
import { SAMPLES as ve, TOOL_DEFINITION as Ee, executeQuiz as _e } from "./core.js";
|
|
4
4
|
import ne, { useState as W, useEffect as se, useCallback as ae } from "react";
|
|
5
|
-
var
|
|
6
|
-
var
|
|
5
|
+
var N = { exports: {} }, _ = {};
|
|
6
|
+
var V;
|
|
7
7
|
function oe() {
|
|
8
|
-
if (
|
|
9
|
-
|
|
10
|
-
var
|
|
11
|
-
function x(
|
|
8
|
+
if (V) return _;
|
|
9
|
+
V = 1;
|
|
10
|
+
var i = /* @__PURE__ */ Symbol.for("react.transitional.element"), u = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
11
|
+
function x(l, d, c) {
|
|
12
12
|
var p = null;
|
|
13
13
|
if (c !== void 0 && (p = "" + c), d.key !== void 0 && (p = "" + d.key), "key" in d) {
|
|
14
14
|
c = {};
|
|
@@ -16,8 +16,8 @@ function oe() {
|
|
|
16
16
|
h !== "key" && (c[h] = d[h]);
|
|
17
17
|
} else c = d;
|
|
18
18
|
return d = c.ref, {
|
|
19
|
-
$$typeof:
|
|
20
|
-
type:
|
|
19
|
+
$$typeof: i,
|
|
20
|
+
type: l,
|
|
21
21
|
key: p,
|
|
22
22
|
ref: d !== void 0 ? d : null,
|
|
23
23
|
props: c
|
|
@@ -26,10 +26,10 @@ function oe() {
|
|
|
26
26
|
return _.Fragment = u, _.jsx = x, _.jsxs = x, _;
|
|
27
27
|
}
|
|
28
28
|
var g = {};
|
|
29
|
-
var
|
|
29
|
+
var U;
|
|
30
30
|
function le() {
|
|
31
|
-
return
|
|
32
|
-
function
|
|
31
|
+
return U || (U = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
32
|
+
function i(e) {
|
|
33
33
|
if (e == null) return null;
|
|
34
34
|
if (typeof e == "function")
|
|
35
35
|
return e.$$typeof === Z ? null : e.displayName || e.name || null;
|
|
@@ -62,11 +62,11 @@ function le() {
|
|
|
62
62
|
var r = e.render;
|
|
63
63
|
return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
64
64
|
case H:
|
|
65
|
-
return r = e.displayName || null, r !== null ? r :
|
|
65
|
+
return r = e.displayName || null, r !== null ? r : i(e.type) || "Memo";
|
|
66
66
|
case O:
|
|
67
67
|
r = e._payload, e = e._init;
|
|
68
68
|
try {
|
|
69
|
-
return
|
|
69
|
+
return i(e(r));
|
|
70
70
|
} catch {
|
|
71
71
|
}
|
|
72
72
|
}
|
|
@@ -84,20 +84,20 @@ function le() {
|
|
|
84
84
|
}
|
|
85
85
|
if (r) {
|
|
86
86
|
r = console;
|
|
87
|
-
var n = r.error,
|
|
87
|
+
var n = r.error, a = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
88
88
|
return n.call(
|
|
89
89
|
r,
|
|
90
90
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
91
|
-
|
|
91
|
+
a
|
|
92
92
|
), u(e);
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function l(e) {
|
|
96
96
|
if (e === b) return "<>";
|
|
97
97
|
if (typeof e == "object" && e !== null && e.$$typeof === O)
|
|
98
98
|
return "<...>";
|
|
99
99
|
try {
|
|
100
|
-
var r =
|
|
100
|
+
var r = i(e);
|
|
101
101
|
return r ? "<" + r + ">" : "<...>";
|
|
102
102
|
} catch {
|
|
103
103
|
return "<...>";
|
|
@@ -130,20 +130,20 @@ function le() {
|
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
132
|
function A() {
|
|
133
|
-
var e =
|
|
133
|
+
var e = i(this.type);
|
|
134
134
|
return F[e] || (F[e] = !0, console.error(
|
|
135
135
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
136
136
|
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
137
137
|
}
|
|
138
|
-
function w(e, r, n,
|
|
139
|
-
var
|
|
138
|
+
function w(e, r, n, a, R, $) {
|
|
139
|
+
var o = n.ref;
|
|
140
140
|
return e = {
|
|
141
141
|
$$typeof: f,
|
|
142
142
|
type: e,
|
|
143
143
|
key: r,
|
|
144
144
|
props: n,
|
|
145
|
-
_owner:
|
|
146
|
-
}, (
|
|
145
|
+
_owner: a
|
|
146
|
+
}, (o !== void 0 ? o : null) !== null ? Object.defineProperty(e, "ref", {
|
|
147
147
|
enumerable: !1,
|
|
148
148
|
get: A
|
|
149
149
|
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
@@ -160,7 +160,7 @@ function le() {
|
|
|
160
160
|
configurable: !1,
|
|
161
161
|
enumerable: !1,
|
|
162
162
|
writable: !0,
|
|
163
|
-
value:
|
|
163
|
+
value: R
|
|
164
164
|
}), Object.defineProperty(e, "_debugTask", {
|
|
165
165
|
configurable: !1,
|
|
166
166
|
enumerable: !1,
|
|
@@ -168,51 +168,51 @@ function le() {
|
|
|
168
168
|
value: $
|
|
169
169
|
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
170
170
|
}
|
|
171
|
-
function v(e, r, n,
|
|
172
|
-
var
|
|
173
|
-
if (
|
|
174
|
-
if (
|
|
175
|
-
if (K(
|
|
176
|
-
for (
|
|
177
|
-
j(
|
|
178
|
-
Object.freeze && Object.freeze(
|
|
171
|
+
function v(e, r, n, a, R, $) {
|
|
172
|
+
var o = r.children;
|
|
173
|
+
if (o !== void 0)
|
|
174
|
+
if (a)
|
|
175
|
+
if (K(o)) {
|
|
176
|
+
for (a = 0; a < o.length; a++)
|
|
177
|
+
j(o[a]);
|
|
178
|
+
Object.freeze && Object.freeze(o);
|
|
179
179
|
} else
|
|
180
180
|
console.error(
|
|
181
181
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
182
182
|
);
|
|
183
|
-
else j(
|
|
183
|
+
else j(o);
|
|
184
184
|
if (D.call(r, "key")) {
|
|
185
|
-
|
|
185
|
+
o = i(e);
|
|
186
186
|
var E = Object.keys(r).filter(function(ee) {
|
|
187
187
|
return ee !== "key";
|
|
188
188
|
});
|
|
189
|
-
|
|
189
|
+
a = 0 < E.length ? "{key: someKey, " + E.join(": ..., ") + ": ...}" : "{key: someKey}", M[o + a] || (E = 0 < E.length ? "{" + E.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
190
190
|
`A props object containing a "key" prop is being spread into JSX:
|
|
191
191
|
let props = %s;
|
|
192
192
|
<%s {...props} />
|
|
193
193
|
React keys must be passed directly to JSX without using spread:
|
|
194
194
|
let props = %s;
|
|
195
195
|
<%s key={someKey} {...props} />`,
|
|
196
|
+
a,
|
|
196
197
|
o,
|
|
197
|
-
l,
|
|
198
198
|
E,
|
|
199
|
-
|
|
200
|
-
), M[
|
|
199
|
+
o
|
|
200
|
+
), M[o + a] = !0);
|
|
201
201
|
}
|
|
202
|
-
if (
|
|
202
|
+
if (o = null, n !== void 0 && (x(n), o = "" + n), p(r) && (x(r.key), o = "" + r.key), "key" in r) {
|
|
203
203
|
n = {};
|
|
204
204
|
for (var q in r)
|
|
205
205
|
q !== "key" && (n[q] = r[q]);
|
|
206
206
|
} else n = r;
|
|
207
|
-
return
|
|
207
|
+
return o && h(
|
|
208
208
|
n,
|
|
209
209
|
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
210
210
|
), w(
|
|
211
211
|
e,
|
|
212
|
-
|
|
212
|
+
o,
|
|
213
213
|
n,
|
|
214
214
|
d(),
|
|
215
|
-
|
|
215
|
+
R,
|
|
216
216
|
$
|
|
217
217
|
);
|
|
218
218
|
}
|
|
@@ -233,68 +233,67 @@ React keys must be passed directly to JSX without using spread:
|
|
|
233
233
|
var Y, F = {}, L = s.react_stack_bottom_frame.bind(
|
|
234
234
|
s,
|
|
235
235
|
c
|
|
236
|
-
)(), z = C(
|
|
236
|
+
)(), z = C(l(c)), M = {};
|
|
237
237
|
g.Fragment = b, g.jsx = function(e, r, n) {
|
|
238
|
-
var
|
|
238
|
+
var a = 1e4 > P.recentlyCreatedOwnerStacks++;
|
|
239
239
|
return v(
|
|
240
240
|
e,
|
|
241
241
|
r,
|
|
242
242
|
n,
|
|
243
243
|
!1,
|
|
244
|
-
|
|
245
|
-
|
|
244
|
+
a ? Error("react-stack-top-frame") : L,
|
|
245
|
+
a ? C(l(e)) : z
|
|
246
246
|
);
|
|
247
247
|
}, g.jsxs = function(e, r, n) {
|
|
248
|
-
var
|
|
248
|
+
var a = 1e4 > P.recentlyCreatedOwnerStacks++;
|
|
249
249
|
return v(
|
|
250
250
|
e,
|
|
251
251
|
r,
|
|
252
252
|
n,
|
|
253
253
|
!0,
|
|
254
|
-
|
|
255
|
-
|
|
254
|
+
a ? Error("react-stack-top-frame") : L,
|
|
255
|
+
a ? C(l(e)) : z
|
|
256
256
|
);
|
|
257
257
|
};
|
|
258
258
|
})()), g;
|
|
259
259
|
}
|
|
260
260
|
var I;
|
|
261
261
|
function ie() {
|
|
262
|
-
return I || (I = 1, process.env.NODE_ENV === "production" ?
|
|
262
|
+
return I || (I = 1, process.env.NODE_ENV === "production" ? N.exports = oe() : N.exports = le()), N.exports;
|
|
263
263
|
}
|
|
264
264
|
var t = ie();
|
|
265
|
-
function ce({ selectedResult:
|
|
266
|
-
const [
|
|
265
|
+
function ce({ selectedResult: i, sendTextMessage: u, onUpdateResult: x }) {
|
|
266
|
+
const [l, d] = W(null), [c, p] = W([]);
|
|
267
267
|
se(() => {
|
|
268
|
-
if (
|
|
269
|
-
const s =
|
|
270
|
-
d(s),
|
|
268
|
+
if (i?.toolName === re && i.jsonData) {
|
|
269
|
+
const s = i.jsonData;
|
|
270
|
+
d(s), i.viewState?.userAnswers ? p(i.viewState.userAnswers) : p(new Array(s.questions.length).fill(null));
|
|
271
271
|
}
|
|
272
|
-
}, [
|
|
272
|
+
}, [i]);
|
|
273
273
|
const h = ae(
|
|
274
274
|
(s) => {
|
|
275
|
-
p(s), x &&
|
|
276
|
-
...a,
|
|
275
|
+
p(s), x && x({
|
|
277
276
|
viewState: { userAnswers: s }
|
|
278
277
|
});
|
|
279
278
|
},
|
|
280
|
-
[x
|
|
279
|
+
[x]
|
|
281
280
|
), A = (s, f) => {
|
|
282
281
|
const m = [...c];
|
|
283
282
|
m[s] = f, h(m);
|
|
284
|
-
}, w = c.filter((s) => s !== null).length, v =
|
|
285
|
-
if (!
|
|
283
|
+
}, w = c.filter((s) => s !== null).length, v = l && w === l.questions.length, j = (s, f) => c[s] === f ? "border-blue-500 bg-blue-500/20" : "border-[#4b4b6b] hover:border-[#6b6b8b] hover:bg-[#6b6b8b]/20", T = () => {
|
|
284
|
+
if (!l || !v) return;
|
|
286
285
|
const f = `Here are my answers:
|
|
287
286
|
${c.map((m, b) => {
|
|
288
287
|
if (m === null) return null;
|
|
289
|
-
const y = b + 1, k = String.fromCharCode(65 + m), S =
|
|
288
|
+
const y = b + 1, k = String.fromCharCode(65 + m), S = l.questions[b].choices[m];
|
|
290
289
|
return `Q${y}: ${k} - ${S}`;
|
|
291
290
|
}).filter((m) => m !== null).join(`
|
|
292
291
|
`)}`;
|
|
293
292
|
u(f);
|
|
294
293
|
};
|
|
295
|
-
return
|
|
296
|
-
|
|
297
|
-
/* @__PURE__ */ t.jsx("div", { className: "flex flex-col gap-6", children:
|
|
294
|
+
return l ? /* @__PURE__ */ t.jsx("div", { className: "w-full min-h-[400px] overflow-y-auto p-8 bg-[#1a1a2e] rounded-lg", children: /* @__PURE__ */ t.jsxs("div", { className: "max-w-3xl mx-auto", children: [
|
|
295
|
+
l.title && /* @__PURE__ */ t.jsx("h2", { className: "text-[#f0f0f0] text-3xl font-bold mb-8 text-center", children: l.title }),
|
|
296
|
+
/* @__PURE__ */ t.jsx("div", { className: "flex flex-col gap-6", children: l.questions.map((s, f) => /* @__PURE__ */ t.jsxs(
|
|
298
297
|
"div",
|
|
299
298
|
{
|
|
300
299
|
className: "bg-[#2d2d44] rounded-lg p-6 border-2 border-[#3d3d5c]",
|
|
@@ -349,13 +348,13 @@ ${c.map((m, b) => {
|
|
|
349
348
|
/* @__PURE__ */ t.jsxs("div", { className: "mt-4 text-center text-gray-400 text-sm", children: [
|
|
350
349
|
w,
|
|
351
350
|
" / ",
|
|
352
|
-
|
|
351
|
+
l.questions.length,
|
|
353
352
|
" questions answered"
|
|
354
353
|
] })
|
|
355
354
|
] }) }) : null;
|
|
356
355
|
}
|
|
357
|
-
function ue({ result:
|
|
358
|
-
const u =
|
|
356
|
+
function ue({ result: i }) {
|
|
357
|
+
const u = i.jsonData;
|
|
359
358
|
return u ? /* @__PURE__ */ t.jsx("div", { className: "p-3 bg-blue-50 rounded-md", children: /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
360
359
|
/* @__PURE__ */ t.jsx("div", { className: "text-sm font-semibold text-gray-800 text-center", children: u.title || "Quiz" }),
|
|
361
360
|
/* @__PURE__ */ t.jsx("div", { className: "text-center", children: /* @__PURE__ */ t.jsxs("span", { className: "inline-block bg-blue-600 text-white text-xs font-bold py-1 px-3 rounded-full", children: [
|
|
@@ -367,12 +366,12 @@ function ue({ result: a }) {
|
|
|
367
366
|
/* @__PURE__ */ t.jsxs("div", { className: "flex justify-center gap-1", children: [
|
|
368
367
|
Array.from({
|
|
369
368
|
length: Math.min(u.questions[0]?.choices.length || 0, 4)
|
|
370
|
-
}).map((x,
|
|
369
|
+
}).map((x, l) => /* @__PURE__ */ t.jsx(
|
|
371
370
|
"div",
|
|
372
371
|
{
|
|
373
372
|
className: "size-2 bg-gray-400 rounded-full"
|
|
374
373
|
},
|
|
375
|
-
|
|
374
|
+
l
|
|
376
375
|
)),
|
|
377
376
|
(u.questions[0]?.choices.length || 0) > 4 && /* @__PURE__ */ t.jsxs("span", { className: "text-xs text-gray-500", children: [
|
|
378
377
|
"+",
|
|
@@ -383,8 +382,8 @@ function ue({ result: a }) {
|
|
|
383
382
|
}
|
|
384
383
|
const fe = {
|
|
385
384
|
...te,
|
|
386
|
-
|
|
387
|
-
|
|
385
|
+
ViewComponent: ce,
|
|
386
|
+
PreviewComponent: ue
|
|
388
387
|
}, xe = { plugin: fe };
|
|
389
388
|
export {
|
|
390
389
|
ue as Preview,
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-600:oklch(57.7% .245 27.325);--color-emerald-50:oklch(97.9% .021 166.113);--color-emerald-100:oklch(95% .052 163.051);--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-800:oklch(43.2% .095 166.913);--color-blue-50:oklch(97% .014 254.604);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-indigo-100:oklch(93% .034 272.788);--color-indigo-200:oklch(87% .065 274.039);--color-indigo-300:oklch(78.5% .115 274.713);--color-indigo-500:oklch(58.5% .233 277.117);--color-indigo-600:oklch(51.1% .262 276.966);--color-indigo-700:oklch(45.7% .24 277.023);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-800:oklch(27.8% .033 256.848);--color-white:#fff;--spacing:.25rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--radius-md:.375rem;--radius-lg:.5rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.static{position:static}.m-0{margin:calc(var(--spacing)*0)}.mx-auto{margin-inline:auto}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-8{margin-top:calc(var(--spacing)*8)}.mr-2{margin-right:calc(var(--spacing)*2)}.mr-3{margin-right:calc(var(--spacing)*3)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-5{margin-bottom:calc(var(--spacing)*5)}.mb-8{margin-bottom:calc(var(--spacing)*8)}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.inline-block{display:inline-block}.size-2{width:calc(var(--spacing)*2);height:calc(var(--spacing)*2)}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.size-full{width:100%;height:100%}.h-32{height:calc(var(--spacing)*32)}.h-full{height:100%}.min-h-\[400px\]{min-height:400px}.w-full{width:100%}.max-w-3xl{max-width:var(--container-3xl)}.max-w-\[200px\]{max-width:200px}.flex-1{flex:1}.shrink-0{flex-shrink:0}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.resize-y{resize:vertical}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-center{justify-content:center}.gap-1{gap:calc(var(--spacing)*1)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-6{gap:calc(var(--spacing)*6)}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-none{--tw-border-style:none;border-style:none}.border-\[\#3d3d5c\]{border-color:#3d3d5c}.border-\[\#4b4b6b\]{border-color:#4b4b6b}.border-blue-500{border-color:var(--color-blue-500)}.border-emerald-200{border-color:var(--color-emerald-200)}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.border-indigo-200{border-color:var(--color-indigo-200)}.bg-\[\#1a1a2e\]{background-color:#1a1a2e}.bg-\[\#2d2d44\]{background-color:#2d2d44}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-500\/20{background-color:#3080ff33}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/20{background-color:color-mix(in oklab,var(--color-blue-500)20%,transparent)}}.bg-blue-600{background-color:var(--color-blue-600)}.bg-emerald-50{background-color:var(--color-emerald-50)}.bg-emerald-100{background-color:var(--color-emerald-100)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-200{background-color:var(--color-gray-200)}.bg-gray-400{background-color:var(--color-gray-400)}.bg-gray-600{background-color:var(--color-gray-600)}.bg-indigo-100{background-color:var(--color-indigo-100)}.bg-indigo-600{background-color:var(--color-indigo-600)}.bg-white{background-color:var(--color-white)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-5{padding:calc(var(--spacing)*5)}.p-6{padding:calc(var(--spacing)*6)}.p-8{padding:calc(var(--spacing)*8)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-6{padding-inline:calc(var(--spacing)*6)}.px-8{padding-inline:calc(var(--spacing)*8)}.py-1{padding-block:calc(var(--spacing)*1)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.text-center{text-align:center}.font-mono{font-family:var(--font-mono)}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[\#f0f0f0\]{color:#f0f0f0}.text-blue-400{color:var(--color-blue-400)}.text-emerald-800{color:var(--color-emerald-800)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-800{color:var(--color-gray-800)}.text-indigo-700{color:var(--color-indigo-700)}.text-red-600{color:var(--color-red-600)}.text-white{color:var(--color-white)}.opacity-50{opacity:.5}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}@media(hover:hover){.hover\:border-\[\#6b6b8b\]:hover{border-color:#6b6b8b}.hover\:border-indigo-300:hover{border-color:var(--color-indigo-300)}.hover\:bg-\[\#6b6b8b\]\/20:hover{background-color:#6b6b8b33}.hover\:bg-blue-700:hover{background-color:var(--color-blue-700)}.hover\:bg-indigo-200:hover{background-color:var(--color-indigo-200)}.hover\:bg-indigo-700:hover{background-color:var(--color-indigo-700)}}.focus\:border-indigo-500:focus{border-color:var(--color-indigo-500)}.focus\:ring-\[3px\]:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-indigo-500\/10:focus{--tw-ring-color:#625fff1a}@supports (color:color-mix(in lab,red,red)){.focus\:ring-indigo-500\/10:focus{--tw-ring-color:color-mix(in oklab,var(--color-indigo-500)10%,transparent)}}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}}body{margin:calc(var(--spacing)*0);background-color:var(--color-gray-100);padding:calc(var(--spacing)*5);font-family:var(--font-sans)}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-duration{syntax:"*";inherits:false}
|
|
1
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-600:oklch(57.7% .245 27.325);--color-emerald-50:oklch(97.9% .021 166.113);--color-emerald-100:oklch(95% .052 163.051);--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-800:oklch(43.2% .095 166.913);--color-blue-50:oklch(97% .014 254.604);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-indigo-100:oklch(93% .034 272.788);--color-indigo-200:oklch(87% .065 274.039);--color-indigo-300:oklch(78.5% .115 274.713);--color-indigo-500:oklch(58.5% .233 277.117);--color-indigo-600:oklch(51.1% .262 276.966);--color-indigo-700:oklch(45.7% .24 277.023);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-800:oklch(27.8% .033 256.848);--color-white:#fff;--spacing:.25rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--radius-md:.375rem;--radius-lg:.5rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.visible{visibility:visible}.static{position:static}.m-0{margin:calc(var(--spacing)*0)}.mx-auto{margin-inline:auto}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-8{margin-top:calc(var(--spacing)*8)}.mr-2{margin-right:calc(var(--spacing)*2)}.mr-3{margin-right:calc(var(--spacing)*3)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-5{margin-bottom:calc(var(--spacing)*5)}.mb-8{margin-bottom:calc(var(--spacing)*8)}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.inline-block{display:inline-block}.size-2{width:calc(var(--spacing)*2);height:calc(var(--spacing)*2)}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.size-full{width:100%;height:100%}.h-32{height:calc(var(--spacing)*32)}.h-full{height:100%}.min-h-\[400px\]{min-height:400px}.w-full{width:100%}.max-w-3xl{max-width:var(--container-3xl)}.max-w-\[200px\]{max-width:200px}.flex-1{flex:1}.shrink-0{flex-shrink:0}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.resize-y{resize:vertical}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-center{justify-content:center}.gap-1{gap:calc(var(--spacing)*1)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-6{gap:calc(var(--spacing)*6)}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-none{--tw-border-style:none;border-style:none}.border-\[\#3d3d5c\]{border-color:#3d3d5c}.border-\[\#4b4b6b\]{border-color:#4b4b6b}.border-blue-500{border-color:var(--color-blue-500)}.border-emerald-200{border-color:var(--color-emerald-200)}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.border-indigo-200{border-color:var(--color-indigo-200)}.bg-\[\#1a1a2e\]{background-color:#1a1a2e}.bg-\[\#2d2d44\]{background-color:#2d2d44}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-500\/20{background-color:#3080ff33}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/20{background-color:color-mix(in oklab,var(--color-blue-500)20%,transparent)}}.bg-blue-600{background-color:var(--color-blue-600)}.bg-emerald-50{background-color:var(--color-emerald-50)}.bg-emerald-100{background-color:var(--color-emerald-100)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-200{background-color:var(--color-gray-200)}.bg-gray-400{background-color:var(--color-gray-400)}.bg-gray-600{background-color:var(--color-gray-600)}.bg-indigo-100{background-color:var(--color-indigo-100)}.bg-indigo-600{background-color:var(--color-indigo-600)}.bg-white{background-color:var(--color-white)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-5{padding:calc(var(--spacing)*5)}.p-6{padding:calc(var(--spacing)*6)}.p-8{padding:calc(var(--spacing)*8)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-6{padding-inline:calc(var(--spacing)*6)}.px-8{padding-inline:calc(var(--spacing)*8)}.py-1{padding-block:calc(var(--spacing)*1)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.text-center{text-align:center}.font-mono{font-family:var(--font-mono)}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[\#f0f0f0\]{color:#f0f0f0}.text-blue-400{color:var(--color-blue-400)}.text-emerald-800{color:var(--color-emerald-800)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-800{color:var(--color-gray-800)}.text-indigo-700{color:var(--color-indigo-700)}.text-red-600{color:var(--color-red-600)}.text-white{color:var(--color-white)}.opacity-50{opacity:.5}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}@media(hover:hover){.hover\:border-\[\#6b6b8b\]:hover{border-color:#6b6b8b}.hover\:border-indigo-300:hover{border-color:var(--color-indigo-300)}.hover\:bg-\[\#6b6b8b\]\/20:hover{background-color:#6b6b8b33}.hover\:bg-blue-700:hover{background-color:var(--color-blue-700)}.hover\:bg-indigo-200:hover{background-color:var(--color-indigo-200)}.hover\:bg-indigo-700:hover{background-color:var(--color-indigo-700)}}.focus\:border-indigo-500:focus{border-color:var(--color-indigo-500)}.focus\:ring-\[3px\]:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-indigo-500\/10:focus{--tw-ring-color:#625fff1a}@supports (color:color-mix(in lab,red,red)){.focus\:ring-indigo-500\/10:focus{--tw-ring-color:color-mix(in oklab,var(--color-indigo-500)10%,transparent)}}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}}body{margin:calc(var(--spacing)*0);background-color:var(--color-gray-100);padding:calc(var(--spacing)*5);font-family:var(--font-sans)}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-duration{syntax:"*";inherits:false}
|
package/dist/vue/View.vue.d.ts
CHANGED
package/dist/vue/index.d.ts
CHANGED
|
@@ -5,18 +5,20 @@
|
|
|
5
5
|
* Import from "@mulmochat-plugin/quiz/vue"
|
|
6
6
|
*/
|
|
7
7
|
import "../style.css";
|
|
8
|
-
import type { ToolPlugin
|
|
8
|
+
import type { ToolPlugin } from "gui-chat-protocol/vue";
|
|
9
|
+
import type { QuizData, QuizArgs } from "../core/types";
|
|
9
10
|
import View from "./View.vue";
|
|
10
11
|
import Preview from "./Preview.vue";
|
|
11
12
|
/**
|
|
12
13
|
* Quiz plugin instance with Vue components
|
|
13
14
|
*/
|
|
14
15
|
export declare const plugin: ToolPlugin<never, QuizData, QuizArgs>;
|
|
15
|
-
export type {
|
|
16
|
-
export
|
|
17
|
-
export { TOOL_NAME, TOOL_DEFINITION
|
|
16
|
+
export type { QuizQuestion, QuizData, QuizArgs } from "../core/types";
|
|
17
|
+
export { pluginCore, executeQuiz } from "../core/plugin";
|
|
18
|
+
export { TOOL_NAME, TOOL_DEFINITION } from "../core/definition";
|
|
19
|
+
export { SAMPLES } from "../core/samples";
|
|
18
20
|
export { View, Preview };
|
|
19
21
|
declare const _default: {
|
|
20
|
-
plugin: ToolPlugin<never, QuizData, QuizArgs
|
|
22
|
+
plugin: ToolPlugin<never, QuizData, QuizArgs, import("gui-chat-protocol/vue").InputHandler, Record<string, unknown>>;
|
|
21
23
|
};
|
|
22
24
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mulmochat-plugin/quiz",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Quiz plugin for MulmoChat",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -82,5 +82,8 @@
|
|
|
82
82
|
"react",
|
|
83
83
|
"vue"
|
|
84
84
|
],
|
|
85
|
-
"license": "MIT"
|
|
85
|
+
"license": "MIT",
|
|
86
|
+
"dependencies": {
|
|
87
|
+
"gui-chat-protocol": "^0.0.1"
|
|
88
|
+
}
|
|
86
89
|
}
|
package/dist/react/types.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MulmoChat Plugin React Types
|
|
3
|
-
*
|
|
4
|
-
* React-specific types that extend the core plugin interface.
|
|
5
|
-
*/
|
|
6
|
-
import type { ComponentType } from "react";
|
|
7
|
-
import type { ToolPluginCore } from "../core/types";
|
|
8
|
-
type ReactComponent = ComponentType<any>;
|
|
9
|
-
/**
|
|
10
|
-
* React plugin interface - extends core with React components
|
|
11
|
-
*/
|
|
12
|
-
export interface ToolPlugin<T = unknown, J = unknown, A extends object = object> extends ToolPluginCore<T, J, A> {
|
|
13
|
-
/** React component for full view */
|
|
14
|
-
viewComponent?: ReactComponent;
|
|
15
|
-
/** React component for preview/thumbnail */
|
|
16
|
-
previewComponent?: ReactComponent;
|
|
17
|
-
}
|
|
18
|
-
export type { BackendType, ToolContextApp, ToolContext, ToolResult, ToolResultComplete, JsonSchemaProperty, ToolDefinition, StartApiResponse, ToolSample, InputHandler, FileInputHandler, ClipboardImageInputHandler, UrlInputHandler, TextInputHandler, FileUploadConfig, ConfigValue, ConfigFieldSchema, PluginConfigSchema, ViewComponentProps, PreviewComponentProps, ToolPluginCore, QuizQuestion, QuizData, QuizArgs, } from "../core/types";
|
package/dist/vue/types.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MulmoChat Plugin Vue Types
|
|
3
|
-
*
|
|
4
|
-
* Vue-specific types that extend the core plugin interface.
|
|
5
|
-
*/
|
|
6
|
-
import type { Component } from "vue";
|
|
7
|
-
import type { ToolPluginCore } from "../core/types";
|
|
8
|
-
type VueComponent = Component<any>;
|
|
9
|
-
/**
|
|
10
|
-
* Legacy Vue component-based config
|
|
11
|
-
* @deprecated Use PluginConfigSchema instead
|
|
12
|
-
*/
|
|
13
|
-
export interface ToolPluginConfig {
|
|
14
|
-
key: string;
|
|
15
|
-
defaultValue: unknown;
|
|
16
|
-
component: VueComponent;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Vue plugin interface - extends core with Vue components
|
|
20
|
-
*/
|
|
21
|
-
export interface ToolPlugin<T = unknown, J = unknown, A extends object = object> extends ToolPluginCore<T, J, A> {
|
|
22
|
-
/** Vue component for full view */
|
|
23
|
-
viewComponent?: VueComponent;
|
|
24
|
-
/** Vue component for preview/thumbnail */
|
|
25
|
-
previewComponent?: VueComponent;
|
|
26
|
-
/**
|
|
27
|
-
* Legacy Vue component-based config (for backward compatibility)
|
|
28
|
-
* @deprecated Use configSchema instead
|
|
29
|
-
*/
|
|
30
|
-
config?: ToolPluginConfig;
|
|
31
|
-
}
|
|
32
|
-
export type { BackendType, ToolContextApp, ToolContext, ToolResult, ToolResultComplete, JsonSchemaProperty, ToolDefinition, StartApiResponse, ToolSample, InputHandler, FileInputHandler, ClipboardImageInputHandler, UrlInputHandler, TextInputHandler, FileUploadConfig, ConfigValue, ConfigFieldSchema, PluginConfigSchema, ViewComponentProps, PreviewComponentProps, ToolPluginCore, QuizQuestion, QuizData, QuizArgs, } from "../core/types";
|