lite-questionnaire 1.0.6 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # lite-questionnaire
2
2
 
3
+ <p align="center">
4
+ <img src="image/logo.png" alt="lite-questionnaire logo" width="200">
5
+ </p>
6
+
3
7
  通用交互式问卷工具,支持单选、多选、文本输入、确认、评分五种问题类型,提供条件子问题、约束校验、会话持久化等高级特性。
4
8
 
5
9
  ## 目录
Binary file
Binary file
Binary file
Binary file
Binary file
package/input.ts CHANGED
@@ -315,7 +315,10 @@ export function createInputHandler(
315
315
  return;
316
316
  }
317
317
  if (matchesKey(data, Key.enter)) {
318
- advance();
318
+ core.inputMode = false;
319
+ core.inputQuestionId = null;
320
+ saveFn();
321
+ onUpdate();
319
322
  return;
320
323
  }
321
324
  return;
@@ -323,7 +326,12 @@ export function createInputHandler(
323
326
 
324
327
  if (q.type === "text") {
325
328
  if (matchesKey(data, Key.enter)) {
326
- advance();
329
+ saveTextDraft(core, editor);
330
+ core.inputMode = false;
331
+ core.inputQuestionId = null;
332
+ editor.setText("");
333
+ saveFn();
334
+ onUpdate();
327
335
  return;
328
336
  }
329
337
  editor.handleInput(data);
package/modules/text.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * 文本输入问题模块
3
3
  *
4
4
  * 默认显示只读摘要;按 Tab 进入内联编辑。
5
- * 编辑态 Enter 提交并前进,Esc 退出编辑。
5
+ * 编辑态 Enter 保存并返回阅读模式,Esc 退出编辑。
6
6
  */
7
7
 
8
8
  import { truncateToWidth } from "@earendil-works/pi-tui";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lite-questionnaire",
3
- "version": "1.0.6",
3
+ "version": "1.1.2",
4
4
  "description": "轻量级交互式问卷工具 — 单选、多选、文本、确认、评分,带条件子问题和声明式校验",
5
5
  "keywords": [
6
6
  "pi-package",