@qxs-bns/components-wc 0.0.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.
Files changed (141) hide show
  1. package/es/base/define.mjs +2 -0
  2. package/es/base/define.mjs.map +1 -0
  3. package/es/base/uid.mjs +2 -0
  4. package/es/base/uid.mjs.map +1 -0
  5. package/es/editor/blocksuite-editor.mjs +931 -0
  6. package/es/editor/blocksuite-editor.mjs.map +1 -0
  7. package/es/editor/index.mjs +2 -0
  8. package/es/editor/index.mjs.map +1 -0
  9. package/es/index.mjs +2 -0
  10. package/es/index.mjs.map +1 -0
  11. package/es/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/css-tag.mjs +7 -0
  12. package/es/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/css-tag.mjs.map +1 -0
  13. package/es/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/property.mjs +7 -0
  14. package/es/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/property.mjs.map +1 -0
  15. package/es/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/state.mjs +7 -0
  16. package/es/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/state.mjs.map +1 -0
  17. package/es/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/reactive-element.mjs +7 -0
  18. package/es/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/reactive-element.mjs.map +1 -0
  19. package/es/node_modules/.pnpm/@tiptap_extension-placeholder@3.20.5_@tiptap_extensions@3.20.5_@tiptap_core@3.20.5_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5_/node_modules/@tiptap/extension-placeholder/dist/index.mjs +2 -0
  20. package/es/node_modules/.pnpm/@tiptap_extension-placeholder@3.20.5_@tiptap_extensions@3.20.5_@tiptap_core@3.20.5_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5_/node_modules/@tiptap/extension-placeholder/dist/index.mjs.map +1 -0
  21. package/es/node_modules/.pnpm/@tiptap_extensions@3.20.5_@tiptap_core@3.20.5_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5/node_modules/@tiptap/extensions/dist/index.mjs +2 -0
  22. package/es/node_modules/.pnpm/@tiptap_extensions@3.20.5_@tiptap_core@3.20.5_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5/node_modules/@tiptap/extensions/dist/index.mjs.map +1 -0
  23. package/es/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive-helpers.mjs +7 -0
  24. package/es/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive-helpers.mjs.map +1 -0
  25. package/es/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive.mjs +7 -0
  26. package/es/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive.mjs.map +1 -0
  27. package/es/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/repeat.mjs +7 -0
  28. package/es/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/repeat.mjs.map +1 -0
  29. package/es/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/lit-html.mjs +7 -0
  30. package/es/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/lit-html.mjs.map +1 -0
  31. package/es/node_modules/.pnpm/prosemirror-dropcursor@1.8.2/node_modules/prosemirror-dropcursor/dist/index.mjs +2 -0
  32. package/es/node_modules/.pnpm/prosemirror-dropcursor@1.8.2/node_modules/prosemirror-dropcursor/dist/index.mjs.map +1 -0
  33. package/es/node_modules/.pnpm/prosemirror-gapcursor@1.4.1/node_modules/prosemirror-gapcursor/dist/index.mjs +2 -0
  34. package/es/node_modules/.pnpm/prosemirror-gapcursor@1.4.1/node_modules/prosemirror-gapcursor/dist/index.mjs.map +1 -0
  35. package/es/node_modules/.pnpm/prosemirror-history@1.5.0/node_modules/prosemirror-history/dist/index.mjs +2 -0
  36. package/es/node_modules/.pnpm/prosemirror-history@1.5.0/node_modules/prosemirror-history/dist/index.mjs.map +1 -0
  37. package/es/node_modules/.pnpm/prosemirror-keymap@1.2.3/node_modules/prosemirror-keymap/dist/index.mjs +2 -0
  38. package/es/node_modules/.pnpm/prosemirror-keymap@1.2.3/node_modules/prosemirror-keymap/dist/index.mjs.map +1 -0
  39. package/es/node_modules/.pnpm/prosemirror-model@1.25.4/node_modules/prosemirror-model/dist/index.mjs +2 -0
  40. package/es/node_modules/.pnpm/prosemirror-model@1.25.4/node_modules/prosemirror-model/dist/index.mjs.map +1 -0
  41. package/es/node_modules/.pnpm/prosemirror-state@1.4.4/node_modules/prosemirror-state/dist/index.mjs +2 -0
  42. package/es/node_modules/.pnpm/prosemirror-state@1.4.4/node_modules/prosemirror-state/dist/index.mjs.map +1 -0
  43. package/es/node_modules/.pnpm/prosemirror-transform@1.11.0/node_modules/prosemirror-transform/dist/index.mjs +2 -0
  44. package/es/node_modules/.pnpm/prosemirror-transform@1.11.0/node_modules/prosemirror-transform/dist/index.mjs.map +1 -0
  45. package/es/node_modules/.pnpm/prosemirror-view@1.41.7/node_modules/prosemirror-view/dist/index.mjs +2 -0
  46. package/es/node_modules/.pnpm/prosemirror-view@1.41.7/node_modules/prosemirror-view/dist/index.mjs.map +1 -0
  47. package/es/node_modules/.pnpm/rope-sequence@1.3.4/node_modules/rope-sequence/dist/index.mjs +2 -0
  48. package/es/node_modules/.pnpm/rope-sequence@1.3.4/node_modules/rope-sequence/dist/index.mjs.map +1 -0
  49. package/es/node_modules/.pnpm/w3c-keyname@2.2.8/node_modules/w3c-keyname/index.mjs +2 -0
  50. package/es/node_modules/.pnpm/w3c-keyname@2.2.8/node_modules/w3c-keyname/index.mjs.map +1 -0
  51. package/es/subject/action.mjs +118 -0
  52. package/es/subject/action.mjs.map +1 -0
  53. package/es/subject/blank-fill.mjs +204 -0
  54. package/es/subject/blank-fill.mjs.map +1 -0
  55. package/es/subject/layout.mjs +18 -0
  56. package/es/subject/layout.mjs.map +1 -0
  57. package/es/subject/list.mjs +128 -0
  58. package/es/subject/list.mjs.map +1 -0
  59. package/es/subject/page-end.mjs +25 -0
  60. package/es/subject/page-end.mjs.map +1 -0
  61. package/es/subject/rich-text.mjs +27 -0
  62. package/es/subject/rich-text.mjs.map +1 -0
  63. package/es/subject/scale.mjs +162 -0
  64. package/es/subject/scale.mjs.map +1 -0
  65. package/es/subject/single.mjs +318 -0
  66. package/es/subject/single.mjs.map +1 -0
  67. package/es/subject/text-fill.mjs +229 -0
  68. package/es/subject/text-fill.mjs.map +1 -0
  69. package/es/subject/type.mjs +42 -0
  70. package/es/subject/type.mjs.map +1 -0
  71. package/lib/base/define.cjs +2 -0
  72. package/lib/base/define.cjs.map +1 -0
  73. package/lib/base/uid.cjs +2 -0
  74. package/lib/base/uid.cjs.map +1 -0
  75. package/lib/editor/blocksuite-editor.cjs +931 -0
  76. package/lib/editor/blocksuite-editor.cjs.map +1 -0
  77. package/lib/editor/index.cjs +2 -0
  78. package/lib/editor/index.cjs.map +1 -0
  79. package/lib/index.cjs +2 -0
  80. package/lib/index.cjs.map +1 -0
  81. package/lib/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/css-tag.cjs +7 -0
  82. package/lib/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/css-tag.cjs.map +1 -0
  83. package/lib/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/property.cjs +7 -0
  84. package/lib/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/property.cjs.map +1 -0
  85. package/lib/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/state.cjs +7 -0
  86. package/lib/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/state.cjs.map +1 -0
  87. package/lib/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/reactive-element.cjs +7 -0
  88. package/lib/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/reactive-element.cjs.map +1 -0
  89. package/lib/node_modules/.pnpm/@tiptap_extension-placeholder@3.20.5_@tiptap_extensions@3.20.5_@tiptap_core@3.20.5_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5_/node_modules/@tiptap/extension-placeholder/dist/index.cjs +2 -0
  90. package/lib/node_modules/.pnpm/@tiptap_extension-placeholder@3.20.5_@tiptap_extensions@3.20.5_@tiptap_core@3.20.5_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5_/node_modules/@tiptap/extension-placeholder/dist/index.cjs.map +1 -0
  91. package/lib/node_modules/.pnpm/@tiptap_extensions@3.20.5_@tiptap_core@3.20.5_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5/node_modules/@tiptap/extensions/dist/index.cjs +2 -0
  92. package/lib/node_modules/.pnpm/@tiptap_extensions@3.20.5_@tiptap_core@3.20.5_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5/node_modules/@tiptap/extensions/dist/index.cjs.map +1 -0
  93. package/lib/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive-helpers.cjs +7 -0
  94. package/lib/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive-helpers.cjs.map +1 -0
  95. package/lib/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive.cjs +7 -0
  96. package/lib/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive.cjs.map +1 -0
  97. package/lib/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/repeat.cjs +8 -0
  98. package/lib/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/repeat.cjs.map +1 -0
  99. package/lib/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/lit-html.cjs +7 -0
  100. package/lib/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/lit-html.cjs.map +1 -0
  101. package/lib/node_modules/.pnpm/prosemirror-dropcursor@1.8.2/node_modules/prosemirror-dropcursor/dist/index.cjs +2 -0
  102. package/lib/node_modules/.pnpm/prosemirror-dropcursor@1.8.2/node_modules/prosemirror-dropcursor/dist/index.cjs.map +1 -0
  103. package/lib/node_modules/.pnpm/prosemirror-gapcursor@1.4.1/node_modules/prosemirror-gapcursor/dist/index.cjs +2 -0
  104. package/lib/node_modules/.pnpm/prosemirror-gapcursor@1.4.1/node_modules/prosemirror-gapcursor/dist/index.cjs.map +1 -0
  105. package/lib/node_modules/.pnpm/prosemirror-history@1.5.0/node_modules/prosemirror-history/dist/index.cjs +2 -0
  106. package/lib/node_modules/.pnpm/prosemirror-history@1.5.0/node_modules/prosemirror-history/dist/index.cjs.map +1 -0
  107. package/lib/node_modules/.pnpm/prosemirror-keymap@1.2.3/node_modules/prosemirror-keymap/dist/index.cjs +2 -0
  108. package/lib/node_modules/.pnpm/prosemirror-keymap@1.2.3/node_modules/prosemirror-keymap/dist/index.cjs.map +1 -0
  109. package/lib/node_modules/.pnpm/prosemirror-model@1.25.4/node_modules/prosemirror-model/dist/index.cjs +2 -0
  110. package/lib/node_modules/.pnpm/prosemirror-model@1.25.4/node_modules/prosemirror-model/dist/index.cjs.map +1 -0
  111. package/lib/node_modules/.pnpm/prosemirror-state@1.4.4/node_modules/prosemirror-state/dist/index.cjs +2 -0
  112. package/lib/node_modules/.pnpm/prosemirror-state@1.4.4/node_modules/prosemirror-state/dist/index.cjs.map +1 -0
  113. package/lib/node_modules/.pnpm/prosemirror-transform@1.11.0/node_modules/prosemirror-transform/dist/index.cjs +2 -0
  114. package/lib/node_modules/.pnpm/prosemirror-transform@1.11.0/node_modules/prosemirror-transform/dist/index.cjs.map +1 -0
  115. package/lib/node_modules/.pnpm/prosemirror-view@1.41.7/node_modules/prosemirror-view/dist/index.cjs +2 -0
  116. package/lib/node_modules/.pnpm/prosemirror-view@1.41.7/node_modules/prosemirror-view/dist/index.cjs.map +1 -0
  117. package/lib/node_modules/.pnpm/rope-sequence@1.3.4/node_modules/rope-sequence/dist/index.cjs +2 -0
  118. package/lib/node_modules/.pnpm/rope-sequence@1.3.4/node_modules/rope-sequence/dist/index.cjs.map +1 -0
  119. package/lib/node_modules/.pnpm/w3c-keyname@2.2.8/node_modules/w3c-keyname/index.cjs +2 -0
  120. package/lib/node_modules/.pnpm/w3c-keyname@2.2.8/node_modules/w3c-keyname/index.cjs.map +1 -0
  121. package/lib/subject/action.cjs +118 -0
  122. package/lib/subject/action.cjs.map +1 -0
  123. package/lib/subject/blank-fill.cjs +204 -0
  124. package/lib/subject/blank-fill.cjs.map +1 -0
  125. package/lib/subject/layout.cjs +18 -0
  126. package/lib/subject/layout.cjs.map +1 -0
  127. package/lib/subject/list.cjs +128 -0
  128. package/lib/subject/list.cjs.map +1 -0
  129. package/lib/subject/page-end.cjs +25 -0
  130. package/lib/subject/page-end.cjs.map +1 -0
  131. package/lib/subject/rich-text.cjs +27 -0
  132. package/lib/subject/rich-text.cjs.map +1 -0
  133. package/lib/subject/scale.cjs +162 -0
  134. package/lib/subject/scale.cjs.map +1 -0
  135. package/lib/subject/single.cjs +318 -0
  136. package/lib/subject/single.cjs.map +1 -0
  137. package/lib/subject/text-fill.cjs +229 -0
  138. package/lib/subject/text-fill.cjs.map +1 -0
  139. package/lib/subject/type.cjs +42 -0
  140. package/lib/subject/type.cjs.map +1 -0
  141. package/package.json +77 -0
@@ -0,0 +1,229 @@
1
+ "use strict";var e=require("lit"),t=require("../node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/property.cjs"),i=require("../node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/state.cjs"),s=require("../base/define.cjs"),r=Object.defineProperty,o=Object.getOwnPropertyDescriptor,n=(e,t,i,s)=>{for(var n,a=s>1?void 0:s?o(t,i):t,l=e.length-1;l>=0;l--)(n=e[l])&&(a=(s?n(t,i,a):n(a))||a);return s&&a&&r(t,i,a),a};const a=[{bg:"#ecf5ff",color:"#3D61E3",border:"#d9ecff"},{bg:"#f0f9eb",color:"#67c23a",border:"#c2e7b0"},{bg:"#fdf6ec",color:"#e6a23c",border:"#faecd8"},{bg:"#fef0f0",color:"#f56c6c",border:"#fde2e2"},{bg:"#f4f4f5",color:"#909399",border:"#e9e9eb"}];function l(e){const t=document.createElement("div");t.textContent=e,Object.assign(t.style,{position:"fixed",top:"20px",left:"50%",transform:"translateX(-50%)",padding:"10px 20px",borderRadius:"4px",fontSize:"13px",color:"#fff",background:"#f56c6c",zIndex:"99999",boxShadow:"0 4px 12px rgba(0,0,0,.15)",transition:"opacity .3s",opacity:"1"}),document.body.appendChild(t),setTimeout(()=>{t.style.opacity="0",setTimeout(()=>t.remove(),300)},2500)}exports.QxsTextFill=class extends e.LitElement{constructor(){super(...arguments),this._iconPlus=e.html`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>`,this._iconRemove=e.html`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="5" y1="12" x2="19" y2="12"/></svg>`,this.orderIndex=0,this.title="",this.isEdit=!1,this.isSave=!1,this.isSet=!1,this.isKey=!1,this.showAction=!0,this.showAnalysis=!1,this.richTextContent="",this.analysis="",this.examAnswerRelationType=0,this.examExpand="",this.examAnswerSetting={isInOrder:!0,isIgnoreCase:!0,keywordCount:1},this.answerList=[],this._answers=[{title:"",tag:"",showInput:!1}],this._title="",this._analysis="",this._isInOrder=!0,this._isIgnoreCase=!0,this._keywordCount=1,this._correct="",this._showRichText=!1,this._richText="",this.TITLE_MAX=200}updated(e){e.has("isEdit")&&this.isEdit&&this._syncProps()}_syncProps(){this._title=this.title||"",this._analysis=this.analysis||"",this.answerList?.length&&(this._answers=this.answerList.map(e=>({title:e.title||"",tag:"",showInput:!1}))),this.examAnswerSetting&&(this._isInOrder=!!this.examAnswerSetting.isInOrder,this._isIgnoreCase=!!this.examAnswerSetting.isIgnoreCase,this._keywordCount=this.examAnswerSetting.keywordCount||1),this.richTextContent&&(this._richText=this.richTextContent,this._showRichText=!0),this.examExpand&&(this._correct=this.examExpand)}_emit(e,t){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:t??null}))}_onTitleInput(e){const t=e.target;t.value.length>this.TITLE_MAX&&(t.value=t.value.slice(0,this.TITLE_MAX)),this._title=t.value}_addTag(e){const t={...this._answers[e]};t.tag&&(t.title=t.title?[t.title,t.tag].join(","):t.tag,t.tag=""),t.showInput=!1,this._answers=this._answers.map((i,s)=>s===e?t:i)}_closeTag(e,t){const i={...this._answers[t]};i.title=i.title.split(",").filter(t=>t!==e).join(","),this._answers=this._answers.map((e,s)=>s===t?i:e)}_addAnswer(){this.isSave||(this._answers=[...this._answers,{title:"",tag:"",showInput:!1}])}_deleteAnswer(e){this._answers.length<2||this.isSave||(this._answers=this._answers.filter((t,i)=>i!==e))}_save(e){if(e?.stopImmediatePropagation(),this._title){if(this._keywordCount||this._correct){if(!this._keywordCount)return void l("请完善答题设置!");if(!this._correct)return void l("请输入问题正确答案!");if(this._answers.length!==this._keywordCount)return void l("关键词个数设置有误!");const e=[];if(this._answers.forEach((t,i)=>{t.title||e.push(`关键词${i+1}未设置`)}),e.length)return void l(e.join(","))}this._emit("save",{title:this._title,answers:this._answers.filter(e=>e.title).map(e=>({title:e.title})),analysis:this._analysis,isSetCorrectAnswer:!!this._correct,isKey:this.isKey,examExpand:this._correct,examAnswerSettingBO:{isIgnoreCase:this._isIgnoreCase,isInOrder:this._isInOrder,keywordCount:this._keywordCount},examRichTextContent:this._showRichText?this._richText:""})}else l("题目标题不能为空!")}_renderPreview(){return e.html`
2
+ <div class="preview">
3
+ <span class="title">${this.orderIndex+1}.${this.title}(问答题)</span>
4
+ ${this.richTextContent?e.html`<div class="rich-text" .innerHTML=${this.richTextContent}></div>`:""}
5
+ ${this._answers.some(e=>e.title)?e.html`
6
+ <div style="margin-top:8px;color:#a8abb2">
7
+ ${this._answers.map((t,i)=>t.title?e.html`
8
+ <span style="margin-right:10px">关键词${i+1}: ${t.title}</span>
9
+ `:"")}
10
+ </div>
11
+ `:""}
12
+ ${this._correct?e.html`<div style="margin-top:8px;color:#a8abb2">正确答案:${this._correct}</div>`:""}
13
+ ${this.analysis?e.html`<div style="color:#909399;font-size:12px;margin-top:8px">解析: ${this.analysis}</div>`:""}
14
+ </div>
15
+ `}_renderEdit(){return e.html`
16
+ <div class="flex-items-start">
17
+ <div class="label"><span>题目:</span></div>
18
+ <div style="flex:1">
19
+ <div class="el-input">
20
+ <textarea rows="2" .value=${this._title} ?disabled=${this.isSave}
21
+ maxlength=${this.TITLE_MAX}
22
+ @input=${e=>this._onTitleInput(e)}
23
+ placeholder="【问答题】请输入问题"></textarea>
24
+ <span class="char-counter">${this._title.length}/${this.TITLE_MAX}</span>
25
+ </div>
26
+ </div>
27
+ </div>
28
+
29
+ <div class="flex-items-start" style="margin-top:12px">
30
+ <div class="label"><span>答题设置:</span></div>
31
+ <div style="flex:1;display:flex;align-items:center;flex-wrap:wrap;gap:8px">
32
+ <span style="font-size:13px;color:#606266">共答对</span>
33
+ <input type="number" style="width:60px;height:24px;border:1px solid #dcdfe6;border-radius:3px;padding:0 8px;font-size:13px"
34
+ .value=${String(this._keywordCount)} min="1"
35
+ @change=${e=>{this._keywordCount=Number(e.target.value)}} />
36
+ <span style="font-size:13px;color:#606266">个关键词,算是正确的</span>
37
+ <label style="display:inline-flex;align-items:center;gap:4px;cursor:pointer;font-size:12px;color:#606266">
38
+ <input type="checkbox" .checked=${this._isInOrder}
39
+ @change=${e=>{this._isInOrder=e.target.checked}} />
40
+ 答案不分顺序
41
+ </label>
42
+ <label style="display:inline-flex;align-items:center;gap:4px;cursor:pointer;font-size:12px;color:#606266">
43
+ <input type="checkbox" .checked=${this._isIgnoreCase}
44
+ @change=${e=>{this._isIgnoreCase=e.target.checked}} />
45
+ 忽略大小写
46
+ </label>
47
+ </div>
48
+ </div>
49
+
50
+ <div class="flex-items-start" style="margin-top:12px">
51
+ <div class="label"><span>答案:</span></div>
52
+ <div style="flex:1">
53
+ <div class="el-input">
54
+ <textarea rows="2" .value=${this._correct} ?disabled=${this.isSave}
55
+ maxlength="200"
56
+ @input=${e=>{this._correct=e.target.value}}
57
+ placeholder="请输入正确答案"></textarea>
58
+ <span class="char-counter">${this._correct.length}/200</span>
59
+ </div>
60
+ </div>
61
+ </div>
62
+
63
+ <div class="answer-list" style="margin-top:12px">
64
+ <span style="padding-left:60px;font-size:12px;color:#909399">*如遇包含特殊字符的关键词,需添加多个同义词,例:'CO₂'需添加同义词'CO2'</span>
65
+ ${this._answers.map((t,i)=>e.html`
66
+ <div class="answer-item">
67
+ <span class="label">关键词${i+1}:</span>
68
+ <div class="answer-tags" style="display:flex;flex-wrap:wrap;gap:5px;align-items:center;flex:1;max-width:360px">
69
+ ${t.title.split(",").filter(Boolean).map(t=>{const s=a[i%a.length];return e.html`
70
+ <span style="display:inline-flex;align-items:center;background:${s.bg};color:${s.color};border:1px solid ${s.border};border-radius:3px;padding:2px 8px;font-size:12px;line-height:16px">
71
+ ${t}
72
+ ${this.isSave?"":e.html`<span style="cursor:pointer;margin-left:4px;color:#909399" @click=${()=>this._closeTag(t,i)}>×</span>`}
73
+ </span>
74
+ `})}
75
+ ${this.isSave?"":e.html`
76
+ ${t.showInput?e.html`
77
+ <input type="text" style="width:80px;height:24px;border:1px solid #dcdfe6;border-radius:3px;padding:0 8px;font-size:12px"
78
+ @keydown=${e=>{"Enter"===e.key&&this._addTag(i)}}
79
+ @input=${e=>{t.tag=e.target.value}}
80
+ @blur=${()=>this._addTag(i)} />
81
+ <button class="el-link" @click=${()=>this._addTag(i)}>确认</button>
82
+ `:e.html`
83
+ <button class="link" @click=${()=>{this._answers=this._answers.map((e,t)=>t===i?{...e,showInput:!0}:e),this.updateComplete.then(()=>{this.shadowRoot?.querySelector('input[style*="width:80px"]')?.focus()})}}>
84
+ ${t.title?"添加同义词":"添加关键词"}
85
+ </button>
86
+ `}
87
+ `}
88
+ </div>
89
+ <span class="icon ${this.isSave?"disabled":""}" @click=${()=>this._addAnswer()}>${this._iconPlus}</span>
90
+ <span class="icon ${this.isSave||this._answers.length<2?"disabled":""}" @click=${()=>this._deleteAnswer(i)}>${this._iconRemove}</span>
91
+ </div>
92
+ `)}
93
+ </div>
94
+
95
+ ${this._showRichText?e.html`
96
+ <div class="flex-items-start" style="margin-top:12px">
97
+ <div class="label"><span>富文本:</span></div>
98
+ <div style="flex:1">
99
+ <qxs-blocksuite-editor
100
+ content=${this._richText}
101
+ ?is-edit=${!0}
102
+ ></qxs-blocksuite-editor>
103
+ <div class="flex-justify-end" style="margin-top:8px"><span class="el-link danger" @click=${()=>{this._showRichText=!1,this._richText=""}}>删除富文本</span></div>
104
+ </div>
105
+ </div>
106
+ `:""}
107
+
108
+ ${this.showAnalysis?e.html`
109
+ <div class="flex-items-start" style="margin-top:12px">
110
+ <div class="label"><span>解析:</span></div>
111
+ <div style="flex:1">
112
+ <div class="el-input">
113
+ <textarea rows="2" .value=${this._analysis}
114
+ @input=${e=>{this._analysis=e.target.value}}
115
+ placeholder="请输入题目解析"></textarea>
116
+ </div>
117
+ </div>
118
+ </div>
119
+ `:""}
120
+ `}render(){return e.html`
121
+ <qxs-subject-layout ?show-edit=${this.isEdit}>
122
+ <div slot="preview">${this._renderPreview()}</div>
123
+ <div slot="edit">${this._renderEdit()}</div>
124
+ ${this.showAction?e.html`
125
+ <qxs-subject-action
126
+ ?is-edit=${this.isEdit}
127
+ ?is-set=${this.isSet}
128
+ ?show-other-option=${!1}
129
+ exam-answer-relation-type=${this.examAnswerRelationType}
130
+ @delete=${()=>this._emit("delete")}
131
+ @save=${this._save}
132
+ @edit=${()=>this._emit("edit")}
133
+ @add=${e=>this._emit("add",e.detail)}
134
+ @set-key=${e=>{this._emit("set-key",e.detail)}}
135
+ @on-show-rich-text=${()=>{this._showRichText=!0}}
136
+ ></qxs-subject-action>
137
+ `:""}
138
+ </qxs-subject-layout>
139
+ `}},exports.QxsTextFill.styles=e.css`
140
+ :host { display: block; font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 12px; color: #5a5a5a; }
141
+ *, ::before, ::after { box-sizing: border-box; }
142
+
143
+ .preview { padding: 12px 0; }
144
+ .preview .title { font-size: 14px; color: #303133; }
145
+ .preview .rich-text { margin-top: 8px; }
146
+ .preview .rich-text img { max-width: 100%; }
147
+ .preview-answer { display: flex; flex-direction: column; margin-top: 12px; }
148
+ .preview-answer .radio { margin-top: 8px; padding-left: 8px; display: flex; align-items: center; gap: 6px; }
149
+ .preview-answer .order { color: #909399; }
150
+ .preview-answer .correct { color: #67c23a; }
151
+ .preview-answer .result-info { color: #909399; }
152
+
153
+ .flex { display: flex; }
154
+ .flex-items-center { display: flex; align-items: center; }
155
+ .flex-items-start { display: flex; align-items: flex-start; }
156
+ .flex-justify-end { display: flex; justify-content: flex-end; }
157
+ .label { min-width: 60px; font-size: 13px; color: #606266; }
158
+
159
+ textarea {
160
+ border: 1px solid #dcdfe6; border-radius: 3px; padding: 5px 11px;
161
+ font-size: 13px; font-family: inherit; width: 100%; resize: none; transition: border-color .2s;
162
+ line-height: 1.5; display: block; box-sizing: border-box;
163
+ }
164
+ textarea:focus { border-color: #3D61E3; outline: none; }
165
+ textarea:disabled { background: #f5f7fa; color: #c0c4cc; cursor: not-allowed; }
166
+ .el-input { position: relative; display: block; }
167
+ .el-input textarea { padding-bottom: 24px; }
168
+ .el-input .char-counter {
169
+ position: absolute; right: 12px; bottom: 8px;
170
+ font-size: 12px; color: #909399; line-height: 1; pointer-events: none;
171
+ }
172
+
173
+ .answer-list { margin-top: 12px; }
174
+ .answer-item { display: flex; align-items: center; margin-top: 6px; border-radius: 4px; }
175
+ .answer-item .label { min-width: 60px; font-size: 13px; color: #909399; }
176
+ .answer-item .input { flex: 1; max-width: 360px; position: relative; display: block; }
177
+ .answer-item .input input {
178
+ height: 32px; padding: 0 50px 0 8px;
179
+ font-size: 13px; line-height: 32px;
180
+ border: 1px solid #dcdfe6; border-radius: 3px; width: 100%;
181
+ transition: border-color .2s; box-sizing: border-box;
182
+ }
183
+ .answer-item .input input:focus { border-color: #3D61E3; outline: none; }
184
+ .answer-item .input input:disabled { background: #f5f7fa; color: #c0c4cc; cursor: not-allowed; }
185
+ .answer-item .input .char-counter {
186
+ position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
187
+ font-size: 12px; color: #909399; line-height: 1; pointer-events: none;
188
+ }
189
+
190
+ .answer-item .correct { margin: 0 10px; color: #909399; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
191
+ .answer-item .correct:hover { color: #3D61E3; }
192
+ .answer-item .correct.is-correct { color: #67c23a; }
193
+ .answer-item .correct input { width: 14px; height: 14px; cursor: pointer; accent-color: #3D61E3; }
194
+
195
+ .answer-item .icon {
196
+ margin-left: 6px; cursor: pointer; display: inline-flex;
197
+ align-items: center; justify-content: center;
198
+ width: 24px; height: 24px; border-radius: 4px;
199
+ border: 1px solid #dcdfe6; background: #fff; color: #909399;
200
+ transition: all 0.2s;
201
+ }
202
+ .answer-item .icon:hover { color: #3D61E3; border-color: #3D61E3; background: #ecf5ff; }
203
+ .answer-item .icon.disabled { color: #e4e7ed; border-color: #e4e7ed; cursor: not-allowed; }
204
+
205
+ .answer-item .link { margin-left: 8px; color: #3D61E3; cursor: pointer; font-size: 12px; white-space: nowrap; }
206
+ .answer-item .link:hover { color: #2D4CB8; }
207
+
208
+ .answer-item .link { color: #3D61E3; cursor: pointer; font-size: 12px; white-space: nowrap; background: none; border: none; padding: 0; margin: 0; font-family: inherit; }
209
+ .answer-item .link:hover { color: #2D4CB8; }
210
+
211
+ .el-link { color: #3D61E3; cursor: pointer; font-size: 12px; background: none; border: none; padding: 0; margin: 0; font-family: inherit; line-height: 1; }
212
+ .el-link:hover { color: #2D4CB8; }
213
+ .el-link.danger { color: #f56c6c; }
214
+
215
+ .modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 9000; display: flex; align-items: center; justify-content: center; }
216
+ .modal { background: #fff; border-radius: 6px; width: 520px; max-width: 90vw; box-shadow: 0 12px 32px rgba(0,0,0,.12); display: flex; flex-direction: column; }
217
+ .modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px 12px; border-bottom: 1px solid #e4e7ed; }
218
+ .modal-title { font-size: 14px; font-weight: 600; color: #303133; }
219
+ .modal-close { background: none; border: none; font-size: 18px; cursor: pointer; color: #909399; padding: 0; line-height: 1; }
220
+ .modal-close:hover { color: #3D61E3; }
221
+ .modal-body { padding: 20px; }
222
+ .modal-body textarea { min-height: 120px; }
223
+ .modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid #e4e7ed; }
224
+ .modal-footer button { padding: 6px 16px; font-size: 12px; border-radius: 3px; cursor: pointer; border: 1px solid #dcdfe6; background: #fff; color: #606266; }
225
+ .modal-footer button:hover { color: #3D61E3; border-color: #a0cfff; }
226
+ .modal-footer button.primary { background: #3D61E3; border-color: #3D61E3; color: #fff; }
227
+ .modal-footer button.primary:hover { background: #2D4CB8; border-color: #2D4CB8; }
228
+ `,n([t.property({type:Number,attribute:"order-index"})],exports.QxsTextFill.prototype,"orderIndex",2),n([t.property({type:String})],exports.QxsTextFill.prototype,"title",2),n([t.property({type:Boolean,attribute:"is-edit"})],exports.QxsTextFill.prototype,"isEdit",2),n([t.property({type:Boolean,attribute:"is-save"})],exports.QxsTextFill.prototype,"isSave",2),n([t.property({type:Boolean,attribute:"is-set"})],exports.QxsTextFill.prototype,"isSet",2),n([t.property({type:Boolean,attribute:"is-key"})],exports.QxsTextFill.prototype,"isKey",2),n([t.property({type:Boolean,attribute:"show-action"})],exports.QxsTextFill.prototype,"showAction",2),n([t.property({type:Boolean,attribute:"show-analysis"})],exports.QxsTextFill.prototype,"showAnalysis",2),n([t.property({type:String,attribute:"rich-text-content"})],exports.QxsTextFill.prototype,"richTextContent",2),n([t.property({type:String})],exports.QxsTextFill.prototype,"analysis",2),n([t.property({type:Number,attribute:"exam-answer-relation-type"})],exports.QxsTextFill.prototype,"examAnswerRelationType",2),n([t.property({type:String,attribute:"exam-expand"})],exports.QxsTextFill.prototype,"examExpand",2),n([t.property({type:Object,attribute:"exam-answer-setting"})],exports.QxsTextFill.prototype,"examAnswerSetting",2),n([t.property({type:Array,attribute:"answer-list"})],exports.QxsTextFill.prototype,"answerList",2),n([i.state()],exports.QxsTextFill.prototype,"_answers",2),n([i.state()],exports.QxsTextFill.prototype,"_title",2),n([i.state()],exports.QxsTextFill.prototype,"_analysis",2),n([i.state()],exports.QxsTextFill.prototype,"_isInOrder",2),n([i.state()],exports.QxsTextFill.prototype,"_isIgnoreCase",2),n([i.state()],exports.QxsTextFill.prototype,"_keywordCount",2),n([i.state()],exports.QxsTextFill.prototype,"_correct",2),n([i.state()],exports.QxsTextFill.prototype,"_showRichText",2),n([i.state()],exports.QxsTextFill.prototype,"_richText",2),exports.QxsTextFill=n([s.safeCustomElement("qxs-text-fill")],exports.QxsTextFill);
229
+ //# sourceMappingURL=text-fill.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text-fill.cjs","sources":["../../../../packages/components-wc/src/subject/text-fill.ts"],"sourcesContent":["import { css, html, LitElement } from 'lit'\nimport { property, state } from 'lit/decorators.js'\nimport { safeCustomElement } from '../base/define'\n\ninterface TextAnswer { title: string, tag: string, showInput: boolean }\n\nconst TAG_COLORS = [\n { bg: '#ecf5ff', color: '#3D61E3', border: '#d9ecff' }, // primary\n { bg: '#f0f9eb', color: '#67c23a', border: '#c2e7b0' }, // success\n { bg: '#fdf6ec', color: '#e6a23c', border: '#faecd8' }, // warning\n { bg: '#fef0f0', color: '#f56c6c', border: '#fde2e2' }, // danger\n { bg: '#f4f4f5', color: '#909399', border: '#e9e9eb' }, // info\n]\n\nfunction showToast(msg: string) {\n const el = document.createElement('div')\n el.textContent = msg\n Object.assign(el.style, {\n position: 'fixed', top: '20px', left: '50%', transform: 'translateX(-50%)',\n padding: '10px 20px', borderRadius: '4px', fontSize: '13px', color: '#fff',\n background: '#f56c6c', zIndex: '99999', boxShadow: '0 4px 12px rgba(0,0,0,.15)',\n transition: 'opacity .3s', opacity: '1',\n })\n document.body.appendChild(el)\n setTimeout(() => { el.style.opacity = '0'; setTimeout(() => el.remove(), 300) }, 2500)\n}\n\n@safeCustomElement('qxs-text-fill')\nexport class QxsTextFill extends LitElement {\n private readonly _iconPlus = html`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><line x1=\"12\" y1=\"5\" x2=\"12\" y2=\"19\"/><line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\"/></svg>`\n private readonly _iconRemove = html`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\"/></svg>`\n\n static styles = css`\n :host { display: block; font-family: system-ui, -apple-system, \"PingFang SC\", \"Microsoft YaHei\", sans-serif; font-size: 12px; color: #5a5a5a; }\n *, ::before, ::after { box-sizing: border-box; }\n\n .preview { padding: 12px 0; }\n .preview .title { font-size: 14px; color: #303133; }\n .preview .rich-text { margin-top: 8px; }\n .preview .rich-text img { max-width: 100%; }\n .preview-answer { display: flex; flex-direction: column; margin-top: 12px; }\n .preview-answer .radio { margin-top: 8px; padding-left: 8px; display: flex; align-items: center; gap: 6px; }\n .preview-answer .order { color: #909399; }\n .preview-answer .correct { color: #67c23a; }\n .preview-answer .result-info { color: #909399; }\n\n .flex { display: flex; }\n .flex-items-center { display: flex; align-items: center; }\n .flex-items-start { display: flex; align-items: flex-start; }\n .flex-justify-end { display: flex; justify-content: flex-end; }\n .label { min-width: 60px; font-size: 13px; color: #606266; }\n\n textarea {\n border: 1px solid #dcdfe6; border-radius: 3px; padding: 5px 11px;\n font-size: 13px; font-family: inherit; width: 100%; resize: none; transition: border-color .2s;\n line-height: 1.5; display: block; box-sizing: border-box;\n }\n textarea:focus { border-color: #3D61E3; outline: none; }\n textarea:disabled { background: #f5f7fa; color: #c0c4cc; cursor: not-allowed; }\n .el-input { position: relative; display: block; }\n .el-input textarea { padding-bottom: 24px; }\n .el-input .char-counter {\n position: absolute; right: 12px; bottom: 8px;\n font-size: 12px; color: #909399; line-height: 1; pointer-events: none;\n }\n\n .answer-list { margin-top: 12px; }\n .answer-item { display: flex; align-items: center; margin-top: 6px; border-radius: 4px; }\n .answer-item .label { min-width: 60px; font-size: 13px; color: #909399; }\n .answer-item .input { flex: 1; max-width: 360px; position: relative; display: block; }\n .answer-item .input input {\n height: 32px; padding: 0 50px 0 8px;\n font-size: 13px; line-height: 32px;\n border: 1px solid #dcdfe6; border-radius: 3px; width: 100%;\n transition: border-color .2s; box-sizing: border-box;\n }\n .answer-item .input input:focus { border-color: #3D61E3; outline: none; }\n .answer-item .input input:disabled { background: #f5f7fa; color: #c0c4cc; cursor: not-allowed; }\n .answer-item .input .char-counter {\n position: absolute; right: 8px; top: 50%; transform: translateY(-50%);\n font-size: 12px; color: #909399; line-height: 1; pointer-events: none;\n }\n\n .answer-item .correct { margin: 0 10px; color: #909399; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }\n .answer-item .correct:hover { color: #3D61E3; }\n .answer-item .correct.is-correct { color: #67c23a; }\n .answer-item .correct input { width: 14px; height: 14px; cursor: pointer; accent-color: #3D61E3; }\n\n .answer-item .icon {\n margin-left: 6px; cursor: pointer; display: inline-flex;\n align-items: center; justify-content: center;\n width: 24px; height: 24px; border-radius: 4px;\n border: 1px solid #dcdfe6; background: #fff; color: #909399;\n transition: all 0.2s;\n }\n .answer-item .icon:hover { color: #3D61E3; border-color: #3D61E3; background: #ecf5ff; }\n .answer-item .icon.disabled { color: #e4e7ed; border-color: #e4e7ed; cursor: not-allowed; }\n\n .answer-item .link { margin-left: 8px; color: #3D61E3; cursor: pointer; font-size: 12px; white-space: nowrap; }\n .answer-item .link:hover { color: #2D4CB8; }\n\n .answer-item .link { color: #3D61E3; cursor: pointer; font-size: 12px; white-space: nowrap; background: none; border: none; padding: 0; margin: 0; font-family: inherit; }\n .answer-item .link:hover { color: #2D4CB8; }\n\n .el-link { color: #3D61E3; cursor: pointer; font-size: 12px; background: none; border: none; padding: 0; margin: 0; font-family: inherit; line-height: 1; }\n .el-link:hover { color: #2D4CB8; }\n .el-link.danger { color: #f56c6c; }\n\n .modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 9000; display: flex; align-items: center; justify-content: center; }\n .modal { background: #fff; border-radius: 6px; width: 520px; max-width: 90vw; box-shadow: 0 12px 32px rgba(0,0,0,.12); display: flex; flex-direction: column; }\n .modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px 12px; border-bottom: 1px solid #e4e7ed; }\n .modal-title { font-size: 14px; font-weight: 600; color: #303133; }\n .modal-close { background: none; border: none; font-size: 18px; cursor: pointer; color: #909399; padding: 0; line-height: 1; }\n .modal-close:hover { color: #3D61E3; }\n .modal-body { padding: 20px; }\n .modal-body textarea { min-height: 120px; }\n .modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid #e4e7ed; }\n .modal-footer button { padding: 6px 16px; font-size: 12px; border-radius: 3px; cursor: pointer; border: 1px solid #dcdfe6; background: #fff; color: #606266; }\n .modal-footer button:hover { color: #3D61E3; border-color: #a0cfff; }\n .modal-footer button.primary { background: #3D61E3; border-color: #3D61E3; color: #fff; }\n .modal-footer button.primary:hover { background: #2D4CB8; border-color: #2D4CB8; }\n `\n\n @property({ type: Number, attribute: 'order-index' }) orderIndex = 0\n @property({ type: String }) title = ''\n @property({ type: Boolean, attribute: 'is-edit' }) isEdit = false\n @property({ type: Boolean, attribute: 'is-save' }) isSave = false\n @property({ type: Boolean, attribute: 'is-set' }) isSet = false\n @property({ type: Boolean, attribute: 'is-key' }) isKey = false\n @property({ type: Boolean, attribute: 'show-action' }) showAction = true\n @property({ type: Boolean, attribute: 'show-analysis' }) showAnalysis = false\n @property({ type: String, attribute: 'rich-text-content' }) richTextContent = ''\n @property({ type: String }) analysis = ''\n @property({ type: Number, attribute: 'exam-answer-relation-type' }) examAnswerRelationType = 0\n @property({ type: String, attribute: 'exam-expand' }) examExpand = ''\n @property({ type: Object, attribute: 'exam-answer-setting' })\n examAnswerSetting: { isInOrder: boolean, isIgnoreCase: boolean, keywordCount: number } = { isInOrder: true, isIgnoreCase: true, keywordCount: 1 }\n\n @property({ type: Array, attribute: 'answer-list' }) answerList: any[] = []\n\n @state() private _answers: TextAnswer[] = [{ title: '', tag: '', showInput: false }]\n @state() private _title = ''\n @state() private _analysis = ''\n @state() private _isInOrder = true\n @state() private _isIgnoreCase = true\n @state() private _keywordCount = 1\n @state() private _correct = ''\n @state() private _showRichText = false\n @state() private _richText = ''\n\n private readonly TITLE_MAX = 200\n\n updated(changed: Map<string, unknown>) {\n if (changed.has('isEdit') && this.isEdit) { this._syncProps() }\n }\n\n private _syncProps() {\n this._title = this.title || ''\n this._analysis = this.analysis || ''\n if (this.answerList?.length) {\n this._answers = this.answerList.map((a: any) => ({ title: a.title || '', tag: '', showInput: false }))\n }\n if (this.examAnswerSetting) {\n this._isInOrder = !!this.examAnswerSetting.isInOrder\n this._isIgnoreCase = !!this.examAnswerSetting.isIgnoreCase\n this._keywordCount = this.examAnswerSetting.keywordCount || 1\n }\n if (this.richTextContent) {\n this._richText = this.richTextContent\n this._showRichText = true\n }\n if (this.examExpand) {\n this._correct = this.examExpand\n }\n }\n\n private _emit(name: string, detail?: unknown) {\n this.dispatchEvent(new CustomEvent(name, { bubbles: true, composed: true, detail: detail ?? null }))\n }\n\n private _onTitleInput(e: Event) {\n const el = e.target as HTMLTextAreaElement\n if (el.value.length > this.TITLE_MAX) { el.value = el.value.slice(0, this.TITLE_MAX) }\n this._title = el.value\n }\n\n private _addTag(i: number) {\n const a = { ...this._answers[i] }\n if (a.tag) {\n a.title = a.title ? [a.title, a.tag].join(',') : a.tag\n a.tag = ''\n }\n a.showInput = false\n this._answers = this._answers.map((x, j) => j === i ? a : x)\n }\n\n private _closeTag(tag: string, i: number) {\n const a = { ...this._answers[i] }\n a.title = a.title.split(',').filter(t => t !== tag).join(',')\n this._answers = this._answers.map((x, j) => j === i ? a : x)\n }\n\n private _addAnswer() {\n if (this.isSave) { return }\n this._answers = [...this._answers, { title: '', tag: '', showInput: false }]\n }\n\n private _deleteAnswer(index: number) {\n if (this._answers.length < 2 || this.isSave) { return }\n this._answers = this._answers.filter((_, i) => i !== index)\n }\n\n private _save(e?: Event) {\n e?.stopImmediatePropagation()\n if (!this._title) { showToast('题目标题不能为空!'); return }\n if (this._keywordCount || this._correct) {\n if (!this._keywordCount) { showToast('请完善答题设置!'); return }\n if (!this._correct) { showToast('请输入问题正确答案!'); return }\n if (this._answers.length !== this._keywordCount) { showToast('关键词个数设置有误!'); return }\n const msg: string[] = []\n this._answers.forEach((item, i) => {\n if (!item.title) { msg.push(`关键词${i + 1}未设置`) }\n })\n if (msg.length) { showToast(msg.join(',')); return }\n }\n this._emit('save', {\n title: this._title,\n answers: this._answers.filter(a => a.title).map(a => ({ title: a.title })),\n analysis: this._analysis,\n isSetCorrectAnswer: !!this._correct,\n isKey: this.isKey,\n examExpand: this._correct,\n examAnswerSettingBO: { isIgnoreCase: this._isIgnoreCase, isInOrder: this._isInOrder, keywordCount: this._keywordCount },\n examRichTextContent: this._showRichText ? this._richText : '',\n })\n }\n\n private _renderPreview() {\n return html`\n <div class=\"preview\">\n <span class=\"title\">${this.orderIndex + 1}.${this.title}(问答题)</span>\n ${this.richTextContent ? html`<div class=\"rich-text\" .innerHTML=${this.richTextContent}></div>` : ''}\n ${this._answers.some(a => a.title)\n ? html`\n <div style=\"margin-top:8px;color:#a8abb2\">\n ${this._answers.map((a, i) => a.title\n ? html`\n <span style=\"margin-right:10px\">关键词${i + 1}: ${a.title}</span>\n `\n : '')}\n </div>\n `\n : ''}\n ${this._correct ? html`<div style=\"margin-top:8px;color:#a8abb2\">正确答案:${this._correct}</div>` : ''}\n ${this.analysis ? html`<div style=\"color:#909399;font-size:12px;margin-top:8px\">解析: ${this.analysis}</div>` : ''}\n </div>\n `\n }\n\n private _renderEdit() {\n return html`\n <div class=\"flex-items-start\">\n <div class=\"label\"><span>题目:</span></div>\n <div style=\"flex:1\">\n <div class=\"el-input\">\n <textarea rows=\"2\" .value=${this._title} ?disabled=${this.isSave}\n maxlength=${this.TITLE_MAX}\n @input=${(e: Event) => this._onTitleInput(e)}\n placeholder=\"【问答题】请输入问题\"></textarea>\n <span class=\"char-counter\">${this._title.length}/${this.TITLE_MAX}</span>\n </div>\n </div>\n </div>\n\n <div class=\"flex-items-start\" style=\"margin-top:12px\">\n <div class=\"label\"><span>答题设置:</span></div>\n <div style=\"flex:1;display:flex;align-items:center;flex-wrap:wrap;gap:8px\">\n <span style=\"font-size:13px;color:#606266\">共答对</span>\n <input type=\"number\" style=\"width:60px;height:24px;border:1px solid #dcdfe6;border-radius:3px;padding:0 8px;font-size:13px\"\n .value=${String(this._keywordCount)} min=\"1\"\n @change=${(e: Event) => { this._keywordCount = Number((e.target as HTMLInputElement).value) }} />\n <span style=\"font-size:13px;color:#606266\">个关键词,算是正确的</span>\n <label style=\"display:inline-flex;align-items:center;gap:4px;cursor:pointer;font-size:12px;color:#606266\">\n <input type=\"checkbox\" .checked=${this._isInOrder}\n @change=${(e: Event) => { this._isInOrder = (e.target as HTMLInputElement).checked }} />\n 答案不分顺序\n </label>\n <label style=\"display:inline-flex;align-items:center;gap:4px;cursor:pointer;font-size:12px;color:#606266\">\n <input type=\"checkbox\" .checked=${this._isIgnoreCase}\n @change=${(e: Event) => { this._isIgnoreCase = (e.target as HTMLInputElement).checked }} />\n 忽略大小写\n </label>\n </div>\n </div>\n\n <div class=\"flex-items-start\" style=\"margin-top:12px\">\n <div class=\"label\"><span>答案:</span></div>\n <div style=\"flex:1\">\n <div class=\"el-input\">\n <textarea rows=\"2\" .value=${this._correct} ?disabled=${this.isSave}\n maxlength=\"200\"\n @input=${(e: Event) => { this._correct = (e.target as HTMLTextAreaElement).value }}\n placeholder=\"请输入正确答案\"></textarea>\n <span class=\"char-counter\">${this._correct.length}/200</span>\n </div>\n </div>\n </div>\n\n <div class=\"answer-list\" style=\"margin-top:12px\">\n <span style=\"padding-left:60px;font-size:12px;color:#909399\">*如遇包含特殊字符的关键词,需添加多个同义词,例:'CO₂'需添加同义词'CO2'</span>\n ${this._answers.map((a, i) => html`\n <div class=\"answer-item\">\n <span class=\"label\">关键词${i + 1}:</span>\n <div class=\"answer-tags\" style=\"display:flex;flex-wrap:wrap;gap:5px;align-items:center;flex:1;max-width:360px\">\n ${a.title.split(',').filter(Boolean).map((tag) => {\n const c = TAG_COLORS[i % TAG_COLORS.length]; return html`\n <span style=\"display:inline-flex;align-items:center;background:${c.bg};color:${c.color};border:1px solid ${c.border};border-radius:3px;padding:2px 8px;font-size:12px;line-height:16px\">\n ${tag}\n ${!this.isSave ? html`<span style=\"cursor:pointer;margin-left:4px;color:#909399\" @click=${() => this._closeTag(tag, i)}>×</span>` : ''}\n </span>\n `\n })}\n ${!this.isSave\n ? html`\n ${a.showInput\n ? html`\n <input type=\"text\" style=\"width:80px;height:24px;border:1px solid #dcdfe6;border-radius:3px;padding:0 8px;font-size:12px\"\n @keydown=${(e: KeyboardEvent) => {\n if (e.key === 'Enter') { this._addTag(i) }\n }}\n @input=${(e: Event) => { a.tag = (e.target as HTMLInputElement).value }}\n @blur=${() => this._addTag(i)} />\n <button class=\"el-link\" @click=${() => this._addTag(i)}>确认</button>\n `\n : html`\n <button class=\"link\" @click=${() => { this._answers = this._answers.map((x, j) => j === i ? { ...x, showInput: true } : x); this.updateComplete.then(() => { (this.shadowRoot?.querySelector(`input[style*=\"width:80px\"]`) as HTMLInputElement)?.focus() }) }}>\n ${a.title ? '添加同义词' : '添加关键词'}\n </button>\n `}\n `\n : ''}\n </div>\n <span class=\"icon ${this.isSave ? 'disabled' : ''}\" @click=${() => this._addAnswer()}>${this._iconPlus}</span>\n <span class=\"icon ${this.isSave || this._answers.length < 2 ? 'disabled' : ''}\" @click=${() => this._deleteAnswer(i)}>${this._iconRemove}</span>\n </div>\n `)}\n </div>\n\n ${this._showRichText\n ? html`\n <div class=\"flex-items-start\" style=\"margin-top:12px\">\n <div class=\"label\"><span>富文本:</span></div>\n <div style=\"flex:1\">\n <qxs-blocksuite-editor\n content=${this._richText}\n ?is-edit=${true}\n ></qxs-blocksuite-editor>\n <div class=\"flex-justify-end\" style=\"margin-top:8px\"><span class=\"el-link danger\" @click=${() => { this._showRichText = false; this._richText = '' }}>删除富文本</span></div>\n </div>\n </div>\n `\n : ''}\n\n ${this.showAnalysis\n ? html`\n <div class=\"flex-items-start\" style=\"margin-top:12px\">\n <div class=\"label\"><span>解析:</span></div>\n <div style=\"flex:1\">\n <div class=\"el-input\">\n <textarea rows=\"2\" .value=${this._analysis}\n @input=${(e: Event) => { this._analysis = (e.target as HTMLTextAreaElement).value }}\n placeholder=\"请输入题目解析\"></textarea>\n </div>\n </div>\n </div>\n `\n : ''}\n `\n }\n\n render() {\n return html`\n <qxs-subject-layout ?show-edit=${this.isEdit}>\n <div slot=\"preview\">${this._renderPreview()}</div>\n <div slot=\"edit\">${this._renderEdit()}</div>\n ${this.showAction\n ? html`\n <qxs-subject-action\n ?is-edit=${this.isEdit}\n ?is-set=${this.isSet}\n ?show-other-option=${false}\n exam-answer-relation-type=${this.examAnswerRelationType}\n @delete=${() => this._emit('delete')}\n @save=${this._save}\n @edit=${() => this._emit('edit')}\n @add=${(e: CustomEvent) => this._emit('add', e.detail)}\n @set-key=${(e: CustomEvent) => { this._emit('set-key', e.detail) }}\n @on-show-rich-text=${() => { this._showRichText = true }}\n ></qxs-subject-action>\n `\n : ''}\n </qxs-subject-layout>\n `\n }\n}\n\nexport function register() {}\n"],"names":["TAG_COLORS","bg","color","border","showToast","msg","el","document","createElement","textContent","Object","assign","style","position","top","left","transform","padding","borderRadius","fontSize","background","zIndex","boxShadow","transition","opacity","body","appendChild","setTimeout","remove","QxsTextFill","LitElement","constructor","super","arguments","this","_iconPlus","html","_iconRemove","orderIndex","title","isEdit","isSave","isSet","isKey","showAction","showAnalysis","richTextContent","analysis","examAnswerRelationType","examExpand","examAnswerSetting","isInOrder","isIgnoreCase","keywordCount","answerList","_answers","tag","showInput","_title","_analysis","_isInOrder","_isIgnoreCase","_keywordCount","_correct","_showRichText","_richText","TITLE_MAX","updated","changed","has","_syncProps","length","map","a","_emit","name","detail","dispatchEvent","CustomEvent","bubbles","composed","_onTitleInput","e","target","value","slice","_addTag","i","join","x","j","_closeTag","split","filter","t","_addAnswer","_deleteAnswer","index","_","_save","stopImmediatePropagation","forEach","item","push","answers","isSetCorrectAnswer","examAnswerSettingBO","examRichTextContent","_renderPreview","some","_renderEdit","String","Number","checked","Boolean","c","key","updateComplete","then","shadowRoot","querySelector","focus","render","styles","css","__decorateClass","property","type","attribute","prototype","Array","state","safeCustomElement"],"mappings":"+eAMA,MAAMA,EAAa,CACjB,CAAEC,GAAI,UAAWC,MAAO,UAAWC,OAAQ,WAC3C,CAAEF,GAAI,UAAWC,MAAO,UAAWC,OAAQ,WAC3C,CAAEF,GAAI,UAAWC,MAAO,UAAWC,OAAQ,WAC3C,CAAEF,GAAI,UAAWC,MAAO,UAAWC,OAAQ,WAC3C,CAAEF,GAAI,UAAWC,MAAO,UAAWC,OAAQ,YAG7C,SAASC,EAAUC,GACjB,MAAMC,EAAKC,SAASC,cAAc,OAClCF,EAAGG,YAAcJ,EACjBK,OAAOC,OAAOL,EAAGM,MAAO,CACtBC,SAAU,QAASC,IAAK,OAAQC,KAAM,MAAOC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A,CADNO,EAAAA,kBAAkB,kBACNvG,QAAAA"}
@@ -0,0 +1,42 @@
1
+ "use strict";var e=require("lit"),t=require("../base/define.cjs"),s=Object.getOwnPropertyDescriptor;const i=[{type:"single",label:"单选题"},{type:"multiple",label:"多选题"},{type:"blank_fill",label:"填空题"},{type:"text_fill",label:"问答题"},{type:"scale",label:"量表题"},{type:"sort",label:"排序题"}],l=[{type:"rich_text",label:"富文本"},{type:"page_end",label:"分页器"}],a=[{type:"single",label:"单选题"},{type:"multiple",label:"多选题"}];exports.QxsSubjectType=class extends e.LitElement{emit(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.dispatchEvent(new CustomEvent("select",{bubbles:!0,composed:!0,detail:{type:e,canSet:t}}))}render(){return e.html`
2
+ <div class="container">
3
+ <div class="type-item">
4
+ <div class="section-title">普通题目类型</div>
5
+ <div class="base-subject">
6
+ ${i.map(t=>e.html`
7
+ <span class="item" @click=${()=>this.emit(t.type)}>${t.label}</span>
8
+ `)}
9
+ </div>
10
+ </div>
11
+ <div class="type-item">
12
+ <div class="section-title">其他</div>
13
+ <div class="base-subject">
14
+ ${l.map(t=>e.html`
15
+ <span class="item" @click=${()=>this.emit(t.type)}>${t.label}</span>
16
+ `)}
17
+ </div>
18
+ </div>
19
+ <div class="type-item">
20
+ <div class="section-title">互动问答类型(支持设置结果项)</div>
21
+ <div class="base-subject">
22
+ ${a.map(t=>e.html`
23
+ <span class="item" @click=${()=>this.emit(t.type,!0)}>${t.label}</span>
24
+ `)}
25
+ </div>
26
+ </div>
27
+ </div>
28
+ `}},exports.QxsSubjectType.styles=e.css`
29
+ :host { display: block; font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 13px; }
30
+ .container { padding: 16px; }
31
+ .type-item { margin-bottom: 20px; }
32
+ .section-title { margin-bottom: 10px; font-size: 13px; color: #909399; }
33
+ .base-subject { display: flex; flex-wrap: wrap; gap: 8px; }
34
+ .item {
35
+ display: inline-flex; align-items: center; justify-content: center;
36
+ min-width: 64px; height: 28px; padding: 0 12px; font-size: 13px;
37
+ color: #606266; cursor: pointer; background: #fff;
38
+ border: 1px solid #dcdfe6; border-radius: 4px; transition: all 0.15s;
39
+ }
40
+ .item:hover { color: #409eff; border-color: #409eff; }
41
+ `,exports.QxsSubjectType=((e,t,i,l)=>{for(var a,p=l>1?void 0:l?s(t,i):t,c=e.length-1;c>=0;c--)(a=e[c])&&(p=a(p)||p);return p})([t.safeCustomElement("qxs-subject-type")],exports.QxsSubjectType);
42
+ //# sourceMappingURL=type.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.cjs","sources":["../../../../packages/components-wc/src/subject/type.ts"],"sourcesContent":["import { css, html, LitElement } from 'lit'\nimport { } from 'lit/decorators.js'\nimport { safeCustomElement } from '../base/define'\n\nconst subjectOptions = [\n { type: 'single', label: '单选题' },\n { type: 'multiple', label: '多选题' },\n { type: 'blank_fill', label: '填空题' },\n { type: 'text_fill', label: '问答题' },\n { type: 'scale', label: '量表题' },\n { type: 'sort', label: '排序题' },\n]\n\nconst otherOptions = [\n { type: 'rich_text', label: '富文本' },\n { type: 'page_end', label: '分页器' },\n]\n\nconst interactionOptions = [\n { type: 'single', label: '单选题' },\n { type: 'multiple', label: '多选题' },\n]\n\n@safeCustomElement('qxs-subject-type')\nexport class QxsSubjectType extends LitElement {\n static styles = css`\n :host { display: block; font-family: system-ui, -apple-system, \"PingFang SC\", \"Microsoft YaHei\", sans-serif; font-size: 13px; }\n .container { padding: 16px; }\n .type-item { margin-bottom: 20px; }\n .section-title { margin-bottom: 10px; font-size: 13px; color: #909399; }\n .base-subject { display: flex; flex-wrap: wrap; gap: 8px; }\n .item {\n display: inline-flex; align-items: center; justify-content: center;\n min-width: 64px; height: 28px; padding: 0 12px; font-size: 13px;\n color: #606266; cursor: pointer; background: #fff;\n border: 1px solid #dcdfe6; border-radius: 4px; transition: all 0.15s;\n }\n .item:hover { color: #409eff; border-color: #409eff; }\n `\n\n private emit(type: string, canSet = false) {\n this.dispatchEvent(new CustomEvent('select', {\n bubbles: true, composed: true,\n detail: { type, canSet },\n }))\n }\n\n render() {\n return html`\n <div class=\"container\">\n <div class=\"type-item\">\n <div class=\"section-title\">普通题目类型</div>\n <div class=\"base-subject\">\n ${subjectOptions.map(item => html`\n <span class=\"item\" @click=${() => this.emit(item.type)}>${item.label}</span>\n `)}\n </div>\n </div>\n <div class=\"type-item\">\n <div class=\"section-title\">其他</div>\n <div class=\"base-subject\">\n ${otherOptions.map(item => html`\n <span class=\"item\" @click=${() => this.emit(item.type)}>${item.label}</span>\n `)}\n </div>\n </div>\n <div class=\"type-item\">\n <div class=\"section-title\">互动问答类型(支持设置结果项)</div>\n <div class=\"base-subject\">\n ${interactionOptions.map(item => html`\n <span class=\"item\" @click=${() => this.emit(item.type, true)}>${item.label}</span>\n `)}\n </div>\n </div>\n </div>\n `\n }\n}\n\nexport function register() {\n // auto-registered via @safeCustomElement\n}\n"],"names":["subjectOptions","type","label","otherOptions","interactionOptions","QxsSubjectType","LitElement","emit","canSet","arguments","length","undefined","this","dispatchEvent","CustomEvent","bubbles","composed","detail","render","html","map","item","styles","css","__decorateClass","safeCustomElement"],"mappings":"oGAIA,MAAMA,EAAiB,CACrB,CAAEC,KAAM,SAAUC,MAAO,OACzB,CAAED,KAAM,WAAYC,MAAO,OAC3B,CAAED,KAAM,aAAcC,MAAO,OAC7B,CAAED,KAAM,YAAaC,MAAO,OAC5B,CAAED,KAAM,QAASC,MAAO,OACxB,CAAED,KAAM,OAAQC,MAAO,QAGnBC,EAAe,CACnB,CAAEF,KAAM,YAAaC,MAAO,OAC5B,CAAED,KAAM,WAAYC,MAAO,QAGvBE,EAAqB,CACzB,CAAEH,KAAM,SAAUC,MAAO,OACzB,CAAED,KAAM,WAAYC,MAAO,QAIhBG,QAAAA,eAAN,cAA6BC,EAAAA,WAgB1BC,IAAAA,CAAKN,GAA8B,IAAhBO,EAAAC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,IAAAA,UAAA,GACzBG,KAAKC,cAAc,IAAIC,YAAY,SAAU,CAC3CC,SAAS,EAAMC,UAAU,EACzBC,OAAQ,CAAEhB,OAAMO,YAEpB,CAEAU,MAAAA,GACE,OAAOC,EAAAA,IAAA;;;;;cAKGnB,EAAeoB,IAAIC,GAAQF,EAAAA,IAAA;0CACC,IAAMP,KAAKL,KAAKc,EAAKpB,SAASoB,EAAKnB;;;;;;;cAO/DC,EAAaiB,IAAIC,GAAQF,EAAAA,IAAA;0CACG,IAAMP,KAAKL,KAAKc,EAAKpB,SAASoB,EAAKnB;;;;;;;cAO/DE,EAAmBgB,IAAIC,GAAQF,EAAAA,IAAA;0CACH,IAAMP,KAAKL,KAAKc,EAAKpB,MAAM,MAASoB,EAAKnB;;;;;KAMjF,GApDWG,QAAAA,eACJiB,OAASC,EAAAA,GAAA;;;;;;;;;;;;;IADLlB,QAAAA,oHAANmB,CAAA,CADNC,EAAAA,kBAAkB,qBACNpB,QAAAA"}
package/package.json ADDED
@@ -0,0 +1,77 @@
1
+ {
2
+ "name": "@qxs-bns/components-wc",
3
+ "type": "module",
4
+ "version": "0.0.2",
5
+ "description": "QXS Business Components - Web Components (framework agnostic)",
6
+ "license": "MIT",
7
+ "homepage": "https://qxs-bns.pages.dev/guide/components-wc/",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/trry-hub/qxs-bns.git"
11
+ },
12
+ "bugs": {
13
+ "url": "https://github.com/trry-hub/qxs-bns/issues"
14
+ },
15
+ "keywords": [
16
+ "web-components",
17
+ "lit",
18
+ "vue",
19
+ "react"
20
+ ],
21
+ "sideEffects": false,
22
+ "main": "./lib/index.cjs",
23
+ "module": "./es/index.mjs",
24
+ "exports": {
25
+ ".": {
26
+ "types": "./types/index.d.ts",
27
+ "import": "./es/index.mjs",
28
+ "require": "./lib/index.cjs"
29
+ },
30
+ "./es/*": {
31
+ "types": "./types/*.d.ts",
32
+ "import": "./es/*.mjs"
33
+ },
34
+ "./lib/*": {
35
+ "types": "./types/*.d.ts",
36
+ "require": "./lib/*.cjs"
37
+ },
38
+ "./package.json": "./package.json"
39
+ },
40
+ "files": [
41
+ "es",
42
+ "lib",
43
+ "types"
44
+ ],
45
+ "dependencies": {
46
+ "@tiptap/core": "^3.20.5",
47
+ "@tiptap/extension-blockquote": "^3.20.5",
48
+ "@tiptap/extension-bold": "^3.20.5",
49
+ "@tiptap/extension-bubble-menu": "^3.20.5",
50
+ "@tiptap/extension-bullet-list": "^3.20.5",
51
+ "@tiptap/extension-code": "^3.20.5",
52
+ "@tiptap/extension-document": "^3.20.5",
53
+ "@tiptap/extension-heading": "^3.20.5",
54
+ "@tiptap/extension-history": "^3.20.5",
55
+ "@tiptap/extension-horizontal-rule": "^3.20.5",
56
+ "@tiptap/extension-image": "^3.20.5",
57
+ "@tiptap/extension-italic": "^3.20.5",
58
+ "@tiptap/extension-link": "^3.20.5",
59
+ "@tiptap/extension-list-item": "^3.20.5",
60
+ "@tiptap/extension-ordered-list": "^3.20.5",
61
+ "@tiptap/extension-paragraph": "^3.20.5",
62
+ "@tiptap/extension-placeholder": "^3.20.5",
63
+ "@tiptap/extension-strike": "^3.20.5",
64
+ "@tiptap/extension-table": "^3.20.5",
65
+ "@tiptap/extension-table-cell": "^3.20.5",
66
+ "@tiptap/extension-table-header": "^3.20.5",
67
+ "@tiptap/extension-table-row": "^3.20.5",
68
+ "@tiptap/extension-text": "^3.20.5",
69
+ "@tiptap/extension-text-align": "^3.20.5",
70
+ "@tiptap/extension-underline": "^3.20.5",
71
+ "lit": "^3.3.2",
72
+ "nanoid": "^5.1.5",
73
+ "sortablejs": "^1.15.7"
74
+ },
75
+ "types": "./types/index.d.ts",
76
+ "peerDependencies": {}
77
+ }