@qxs-bns/components-wc 0.0.10 → 0.0.12

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.
@@ -1 +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'\nimport { SubjectError } from './single'\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: String, attribute: 'custom-id' }) customId = ''\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 = true\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 @property({ type: Object })\n uploadImage: (file: File) => Promise<string> = async (file: File) => {\n return new Promise((resolve, reject) => {\n const reader = new FileReader()\n reader.onload = (e) => resolve(e.target?.result as string)\n reader.onerror = reject\n reader.readAsDataURL(file)\n })\n }\n\n @property({ type: Array, attribute: 'answer-list' }) answerList: any[] = []\n\n // 双向绑定支持\n @property({ type: String, attribute: 'model-value' }) modelValue = ''\n @property({ type: Boolean, attribute: 'use-model' }) useModel = false\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 willUpdate(changed: Map<string, unknown>) {\n if (changed.has('isEdit') && this.isEdit) { this._syncProps() }\n // 当外部 modelValue 变化时同步内部状态\n if (changed.has('modelValue') && this.useModel) {\n this._title = this.modelValue\n }\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 if (this.useModel) {\n this.dispatchEvent(new CustomEvent('update:modelValue', {\n bubbles: true,\n composed: true,\n detail: this._title,\n }))\n }\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 async toJSON(): Promise<any> {\n return new Promise((resolve, reject) => {\n const row = { customId: this.customId || undefined, answerType: 'text_fill', orderIndex: this.orderIndex }\n\n const title = this.isEdit ? this._title : this.title || ''\n const answers = this.isEdit ? this._answers : (this.answerList || [])\n const analysis = this.isEdit ? this._analysis : this.analysis || ''\n const correct = this.isEdit ? this._correct : (this as any).examExpand || ''\n const keywordCount = this.isEdit ? this._keywordCount : this.examAnswerSetting?.keywordCount || 1\n const isInOrder = this.isEdit ? this._isInOrder : this.examAnswerSetting?.isInOrder ?? true\n const isIgnoreCase = this.isEdit ? this._isIgnoreCase : this.examAnswerSetting?.isIgnoreCase ?? true\n const showRichText = this.isEdit ? this._showRichText : !!this.richTextContent\n const richText = this.isEdit ? this._richText : this.richTextContent || ''\n\n if (!title) {\n reject(new SubjectError('题目标题不能为空!', 'EMPTY_TITLE', 'title', row))\n return\n }\n if (keywordCount || correct) {\n if (!keywordCount) {\n reject(new SubjectError('请完善答题设置!', 'NO_KEYWORD_COUNT', 'keywordCount', row))\n return\n }\n if (!correct) {\n reject(new SubjectError('请输入问题正确答案!', 'NO_CORRECT_ANSWER', 'correct', row))\n return\n }\n if (answers.length !== keywordCount) {\n reject(new SubjectError('关键词个数设置有误!', 'KEYWORD_COUNT_MISMATCH', 'answers', row))\n return\n }\n const msg: string[] = []\n answers.forEach((item: any, i: number) => {\n if (!item.title) { msg.push(`关键词${i + 1}未设置`) }\n })\n if (msg.length) {\n reject(new SubjectError(msg.join(','), 'KEYWORD_EMPTY', 'answers', row))\n return\n }\n }\n const result: any = {\n answerType: 'text_fill',\n title,\n answers: answers.filter((a: any) => a.title).map((a: any) => ({ title: a.title })),\n analysis,\n isSetCorrectAnswer: !!correct,\n isKey: this.isKey,\n examExpand: correct,\n examAnswerSettingBO: { isIgnoreCase, isInOrder, keywordCount },\n examRichTextContent: showRichText ? richText : '',\n }\n if (this.customId) { result.customId = this.customId }\n resolve(result)\n })\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 async _save(e?: Event) {\n e?.stopImmediatePropagation()\n try {\n const data = await this.toJSON()\n this._emit('save', data)\n }\n catch (err: any) {\n showToast(err.message)\n }\n }\n\n validate(): SubjectError[] {\n const errors: SubjectError[] = []\n const row = { customId: this.customId || undefined, answerType: 'text_fill', orderIndex: this.orderIndex }\n\n const title = this.isEdit ? this._title : this.title || ''\n const answers = this.isEdit ? this._answers : (this.answerList || [])\n const correct = this.isEdit ? this._correct : (this as any).examExpand || ''\n const keywordCount = this.isEdit ? this._keywordCount : this.examAnswerSetting?.keywordCount || 1\n\n if (!title) {\n errors.push(new SubjectError('题目标题不能为空!', 'EMPTY_TITLE', 'title', row))\n }\n if (keywordCount || correct) {\n if (!keywordCount) {\n errors.push(new SubjectError('请完善答题设置!', 'NO_KEYWORD_COUNT', 'keywordCount', row))\n }\n if (!correct) {\n errors.push(new SubjectError('请输入问题正确答案!', 'NO_CORRECT_ANSWER', 'correct', row))\n }\n if (answers.length !== keywordCount) {\n errors.push(new SubjectError('关键词个数设置有误!', 'KEYWORD_COUNT_MISMATCH', 'answers', row))\n }\n answers.forEach((item: any, i: number) => {\n if (!item.title) {\n errors.push(new SubjectError(`关键词${i + 1}未设置`, 'KEYWORD_EMPTY', 'answers', row))\n }\n })\n }\n\n return errors\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 .uploadImage=${this.uploadImage}\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","QxsTextFill","LitElement","constructor","super","arguments","this","_iconPlus","html","_iconRemove","orderIndex","title","customId","isEdit","isSave","isSet","isKey","showAction","showAnalysis","richTextContent","analysis","examAnswerRelationType","examExpand","examAnswerSetting","isInOrder","isIgnoreCase","keywordCount","uploadImage","async","Promise","resolve","reject","reader","FileReader","onload","e","target","result","onerror","readAsDataURL","file","answerList","modelValue","useModel","_answers","tag","showInput","_title","_analysis","_isInOrder","_isIgnoreCase","_keywordCount","_correct","_showRichText","_richText","TITLE_MAX","willUpdate","changed","has","_syncProps","length","map","a","_emit","name","detail","dispatchEvent","CustomEvent","bubbles","composed","_onTitleInput","el","value","slice","_addTag","i","join","x","j","_closeTag","split","filter","t","toJSON","row","answerType","answers","correct","showRichText","richText","SubjectError","msg","forEach","item","push","isSetCorrectAnswer","examAnswerSettingBO","examRichTextContent","_addAnswer","_deleteAnswer","index","_","_save","stopImmediatePropagation","data","err","document","createElement","textContent","Object","assign","style","position","top","left","transform","padding","borderRadius","fontSize","background","zIndex","boxShadow","transition","opacity","body","appendChild","setTimeout","remove","showToast","message","validate","errors","_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":"ygBAOA,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,YAiBhCC,QAAAA,YAAN,cAA0BC,EAAAA,WAA1BC,WAAAA,G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wJ,UAAA,gBAAA,GACAJ,EAAA,CAAhBM,EAAAA,SAnIU1J,QAAAA,YAmIMwJ,UAAA,gBAAA,GACAJ,EAAA,CAAhBM,EAAAA,SApIU1J,QAAAA,YAoIMwJ,UAAA,WAAA,GACAJ,EAAA,CAAhBM,EAAAA,SArIU1J,QAAAA,YAqIMwJ,UAAA,gBAAA,GACAJ,EAAA,CAAhBM,EAAAA,SAtIU1J,QAAAA,YAsIMwJ,UAAA,YAAA,GAtINxJ,QAAAA,YAANoJ,EAAA,CADNO,EAAAA,kBAAkB,kBACN3J,QAAAA"}
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'\nimport { SubjectError } from './single'\nimport { SubjectType } from './types'\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: String, attribute: 'custom-id' }) customId = ''\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 = true\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 @property({ type: Object })\n uploadImage: (file: File) => Promise<string> = async (file: File) => {\n return new Promise((resolve, reject) => {\n const reader = new FileReader()\n reader.onload = (e) => resolve(e.target?.result as string)\n reader.onerror = reject\n reader.readAsDataURL(file)\n })\n }\n\n @property({ type: Array, attribute: 'answer-list' }) answerList: any[] = []\n\n // 双向绑定支持\n @property({ type: String, attribute: 'model-value' }) modelValue = ''\n @property({ type: Boolean, attribute: 'use-model' }) useModel = false\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 willUpdate(changed: Map<string, unknown>) {\n if (changed.has('isEdit') && this.isEdit) { this._syncProps() }\n // 当外部 modelValue 变化时同步内部状态\n if (changed.has('modelValue') && this.useModel) {\n this._title = this.modelValue\n }\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 if (this.useModel) {\n this.dispatchEvent(new CustomEvent('update:modelValue', {\n bubbles: true,\n composed: true,\n detail: this._title,\n }))\n }\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 async toJSON(): Promise<any> {\n return new Promise((resolve, reject) => {\n const row = { customId: this.customId || undefined, answerType: 'text_fill', orderIndex: this.orderIndex }\n\n const title = this.isEdit ? this._title : this.title || ''\n const answers = this.isEdit ? this._answers : (this.answerList || [])\n const analysis = this.isEdit ? this._analysis : this.analysis || ''\n const correct = this.isEdit ? this._correct : (this as any).examExpand || ''\n const keywordCount = this.isEdit ? this._keywordCount : this.examAnswerSetting?.keywordCount || 1\n const isInOrder = this.isEdit ? this._isInOrder : this.examAnswerSetting?.isInOrder ?? true\n const isIgnoreCase = this.isEdit ? this._isIgnoreCase : this.examAnswerSetting?.isIgnoreCase ?? true\n const showRichText = this.isEdit ? this._showRichText : !!this.richTextContent\n const richText = this.isEdit ? this._richText : this.richTextContent || ''\n\n if (!title) {\n reject(new SubjectError('题目标题不能为空!', 'EMPTY_TITLE', 'title', row))\n return\n }\n if (keywordCount || correct) {\n if (!keywordCount) {\n reject(new SubjectError('请完善答题设置!', 'NO_KEYWORD_COUNT', 'keywordCount', row))\n return\n }\n if (!correct) {\n reject(new SubjectError('请输入问题正确答案!', 'NO_CORRECT_ANSWER', 'correct', row))\n return\n }\n if (answers.length !== keywordCount) {\n reject(new SubjectError('关键词个数设置有误!', 'KEYWORD_COUNT_MISMATCH', 'answers', row))\n return\n }\n const msg: string[] = []\n answers.forEach((item: any, i: number) => {\n if (!item.title) { msg.push(`关键词${i + 1}未设置`) }\n })\n if (msg.length) {\n reject(new SubjectError(msg.join(','), 'KEYWORD_EMPTY', 'answers', row))\n return\n }\n }\n const result: any = {\n answerType: SubjectType.TEXT_FILL,\n title,\n answers: answers.filter((a: any) => a.title).map((a: any) => ({ title: a.title })),\n analysis,\n isSetCorrectAnswer: !!correct,\n isKey: this.isKey,\n examExpand: correct,\n examAnswerSettingBO: { isIgnoreCase, isInOrder, keywordCount },\n examRichTextContent: showRichText ? richText : '',\n }\n if (this.customId) { result.customId = this.customId }\n resolve(result)\n })\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 async _save(e?: Event) {\n e?.stopImmediatePropagation()\n try {\n const data = await this.toJSON()\n this._emit('save', data)\n }\n catch (err: any) {\n showToast(err.message)\n }\n }\n\n validate(): SubjectError[] {\n const errors: SubjectError[] = []\n const row = { customId: this.customId || undefined, answerType: 'text_fill', orderIndex: this.orderIndex }\n\n const title = this.isEdit ? this._title : this.title || ''\n const answers = this.isEdit ? this._answers : (this.answerList || [])\n const correct = this.isEdit ? this._correct : (this as any).examExpand || ''\n const keywordCount = this.isEdit ? this._keywordCount : this.examAnswerSetting?.keywordCount || 1\n\n if (!title) {\n errors.push(new SubjectError('题目标题不能为空!', 'EMPTY_TITLE', 'title', row))\n }\n if (keywordCount || correct) {\n if (!keywordCount) {\n errors.push(new SubjectError('请完善答题设置!', 'NO_KEYWORD_COUNT', 'keywordCount', row))\n }\n if (!correct) {\n errors.push(new SubjectError('请输入问题正确答案!', 'NO_CORRECT_ANSWER', 'correct', row))\n }\n if (answers.length !== keywordCount) {\n errors.push(new SubjectError('关键词个数设置有误!', 'KEYWORD_COUNT_MISMATCH', 'answers', row))\n }\n answers.forEach((item: any, i: number) => {\n if (!item.title) {\n errors.push(new SubjectError(`关键词${i + 1}未设置`, 'KEYWORD_EMPTY', 'answers', row))\n }\n })\n }\n\n return errors\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 .uploadImage=${this.uploadImage}\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","QxsTextFill","LitElement","constructor","super","arguments","this","_iconPlus","html","_iconRemove","orderIndex","title","customId","isEdit","isSave","isSet","isKey","showAction","showAnalysis","richTextContent","analysis","examAnswerRelationType","examExpand","examAnswerSetting","isInOrder","isIgnoreCase","keywordCount","uploadImage","async","Promise","resolve","reject","reader","FileReader","onload","e","target","result","onerror","readAsDataURL","file","answerList","modelValue","useModel","_answers","tag","showInput","_title","_analysis","_isInOrder","_isIgnoreCase","_keywordCount","_correct","_showRichText","_richText","TITLE_MAX","willUpdate","changed","has","_syncProps","length","map","a","_emit","name","detail","dispatchEvent","CustomEvent","bubbles","composed","_onTitleInput","el","value","slice","_addTag","i","join","x","j","_closeTag","split","filter","t","toJSON","row","answerType","answers","correct","showRichText","richText","SubjectError","msg","forEach","item","push","SubjectType","TEXT_FILL","isSetCorrectAnswer","examAnswerSettingBO","examRichTextContent","_addAnswer","_deleteAnswer","index","_","_save","stopImmediatePropagation","data","err","document","createElement","textContent","Object","assign","style","position","top","left","transform","padding","borderRadius","fontSize","background","zIndex","boxShadow","transition","opacity","body","appendChild","setTimeout","remove","showToast","message","validate","errors","_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":"kiBAQA,MAAMA,EAAa,CACjB,CAAEC,G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A,YA8HM0J,UAAA,WAAA,GACAJ,EAAA,CAAhBM,EAAAA,SA/HU5J,QAAAA,YA+HM0J,UAAA,SAAA,GACAJ,EAAA,CAAhBM,EAAAA,SAhIU5J,QAAAA,YAgIM0J,UAAA,YAAA,GACAJ,EAAA,CAAhBM,EAAAA,SAjIU5J,QAAAA,YAiIM0J,UAAA,aAAA,GACAJ,EAAA,CAAhBM,EAAAA,SAlIU5J,QAAAA,YAkIM0J,UAAA,gBAAA,GACAJ,EAAA,CAAhBM,EAAAA,SAnIU5J,QAAAA,YAmIM0J,UAAA,gBAAA,GACAJ,EAAA,CAAhBM,EAAAA,SApIU5J,QAAAA,YAoIM0J,UAAA,WAAA,GACAJ,EAAA,CAAhBM,EAAAA,SArIU5J,QAAAA,YAqIM0J,UAAA,gBAAA,GACAJ,EAAA,CAAhBM,EAAAA,SAtIU5J,QAAAA,YAsIM0J,UAAA,YAAA,GAtIN1J,QAAAA,YAANsJ,EAAA,CADNO,EAAAA,kBAAkB,kBACN7J,QAAAA"}
@@ -1,9 +1,9 @@
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`
1
+ "use strict";var e=require("lit"),t=require("../base/define.cjs"),s=require("./types.cjs"),i=Object.getOwnPropertyDescriptor;const l=[{type:s.SubjectType.SINGLE,label:"单选题"},{type:s.SubjectType.MULTIPLE,label:"多选题"},{type:s.SubjectType.BLANK_FILL,label:"填空题"},{type:s.SubjectType.TEXT_FILL,label:"问答题"},{type:s.SubjectType.SCALE,label:"量表题"},{type:s.SubjectType.SORT,label:"排序题"}],p=[{type:"rich_text",label:"富文本"},{type:"page_end",label:"分页器"}],a=[{type:s.SubjectType.SINGLE,label:"单选题"},{type:s.SubjectType.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
2
  <div class="container">
3
3
  <div class="type-item">
4
4
  <div class="section-title">普通题目类型</div>
5
5
  <div class="base-subject">
6
- ${i.map(t=>e.html`
6
+ ${l.map(t=>e.html`
7
7
  <span class="item" @click=${()=>this.emit(t.type)}>${t.label}</span>
8
8
  `)}
9
9
  </div>
@@ -11,7 +11,7 @@
11
11
  <div class="type-item">
12
12
  <div class="section-title">其他</div>
13
13
  <div class="base-subject">
14
- ${l.map(t=>e.html`
14
+ ${p.map(t=>e.html`
15
15
  <span class="item" @click=${()=>this.emit(t.type)}>${t.label}</span>
16
16
  `)}
17
17
  </div>
@@ -38,5 +38,5 @@
38
38
  border: 1px solid #dcdfe6; border-radius: 4px; transition: all 0.15s;
39
39
  }
40
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);
41
+ `,exports.QxsSubjectType=((e,t,s,l)=>{for(var p,a=l>1?void 0:l?i(t,s):t,c=e.length-1;c>=0;c--)(p=e[c])&&(a=p(a)||a);return a})([t.safeCustomElement("qxs-subject-type")],exports.QxsSubjectType);
42
42
  //# sourceMappingURL=type.cjs.map
@@ -1 +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"}
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'\nimport { SubjectType } from './types'\n\nconst subjectOptions = [\n { type: SubjectType.SINGLE, label: '单选题' },\n { type: SubjectType.MULTIPLE, label: '多选题' },\n { type: SubjectType.BLANK_FILL, label: '填空题' },\n { type: SubjectType.TEXT_FILL, label: '问答题' },\n { type: SubjectType.SCALE, label: '量表题' },\n { type: SubjectType.SORT, label: '排序题' },\n]\n\nconst otherOptions = [\n { type: 'rich_text', label: '富文本' },\n { type: 'page_end', label: '分页器' },\n]\n\nconst interactionOptions = [\n { type: SubjectType.SINGLE, label: '单选题' },\n { type: SubjectType.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","SubjectType","SINGLE","label","MULTIPLE","BLANK_FILL","TEXT_FILL","SCALE","SORT","otherOptions","interactionOptions","QxsSubjectType","LitElement","emit","canSet","arguments","length","undefined","this","dispatchEvent","CustomEvent","bubbles","composed","detail","render","html","map","item","styles","css","__decorateClass","safeCustomElement"],"mappings":"6HAKA,MAAMA,EAAiB,CACrB,CAAEC,KAAMC,EAAAA,YAAYC,OAAQC,MAAO,OACnC,CAAEH,KAAMC,EAAAA,YAAYG,SAAUD,MAAO,OACrC,CAAEH,KAAMC,EAAAA,YAAYI,WAAYF,MAAO,OACvC,CAAEH,KAAMC,EAAAA,YAAYK,UAAWH,MAAO,OACtC,CAAEH,KAAMC,EAAAA,YAAYM,MAAOJ,MAAO,OAClC,CAAEH,KAAMC,EAAAA,YAAYO,KAAML,MAAO,QAG7BM,EAAe,CACnB,CAAET,KAAM,YAAaG,MAAO,OAC5B,CAAEH,KAAM,WAAYG,MAAO,QAGvBO,EAAqB,CACzB,CAAEV,KAAMC,EAAAA,YAAYC,OAAQC,MAAO,OACnC,CAAEH,KAAMC,EAAAA,YAAYG,SAAUD,MAAO,QAI1BQ,QAAAA,eAAN,cAA6BC,EAAAA,WAgB1BC,IAAAA,CAAKb,GAA8B,IAAhBc,EAAAC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,IAAAA,UAAA,GACzBG,KAAKC,cAAc,IAAIC,YAAY,SAAU,CAC3CC,SAAS,EAAMC,UAAU,EACzBC,OAAQ,CAAEvB,OAAMc,YAEpB,CAEAU,MAAAA,GACE,OAAOC,EAAAA,IAAA;;;;;cAKG1B,EAAe2B,IAAIC,GAAQF,EAAAA,IAAA;0CACC,IAAMP,KAAKL,KAAKc,EAAK3B,SAAS2B,EAAKxB;;;;;;;cAO/DM,EAAaiB,IAAIC,GAAQF,EAAAA,IAAA;0CACG,IAAMP,KAAKL,KAAKc,EAAK3B,SAAS2B,EAAKxB;;;;;;;cAO/DO,EAAmBgB,IAAIC,GAAQF,EAAAA,IAAA;0CACH,IAAMP,KAAKL,KAAKc,EAAK3B,MAAM,MAAS2B,EAAKxB;;;;;KAMjF,GApDWQ,QAAAA,eACJiB,OAASC,EAAAA,GAAA;;;;;;;;;;;;;IADLlB,QAAAA,oHAANmB,CAAA,CADNC,EAAAA,kBAAkB,qBACNpB,QAAAA"}
@@ -0,0 +1,2 @@
1
+ "use strict";var e=(e=>(e.SINGLE="single",e.MULTIPLE="multiple",e.BLANK_FILL="blank_fill",e.TEXT_FILL="text_fill",e.SORT="sort",e.SCALE="scale",e.RICH_TEXT="rich_text",e.PAGE_END="page_end",e))(e||{});exports.SubjectType=e;
2
+ //# sourceMappingURL=types.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.cjs","sources":["../../../../packages/components-wc/src/subject/types.ts"],"sourcesContent":["export enum SubjectType {\n SINGLE = 'single',\n MULTIPLE = 'multiple',\n BLANK_FILL = 'blank_fill',\n TEXT_FILL = 'text_fill',\n SORT = 'sort',\n SCALE = 'scale',\n RICH_TEXT = 'rich_text',\n PAGE_END = 'page_end',\n}\n\nexport const SubjectTypeLabel: Record<SubjectType, string> = {\n [SubjectType.SINGLE]: '单选题',\n [SubjectType.MULTIPLE]: '多选题',\n [SubjectType.BLANK_FILL]: '填空题',\n [SubjectType.TEXT_FILL]: '问答题',\n [SubjectType.SORT]: '排序题',\n [SubjectType.SCALE]: '量表题',\n [SubjectType.RICH_TEXT]: '富文本块',\n [SubjectType.PAGE_END]: '分页符',\n}\n"],"names":["SubjectType"],"mappings":"iBAAYA,GAAAA,IACVA,EAAA,OAAS,SACTA,EAAA,SAAW,WACXA,EAAA,WAAa,aACbA,EAAA,UAAY,YACZA,EAAA,KAAO,OACPA,EAAA,MAAQ,QACRA,EAAA,UAAY,YACZA,EAAA,SAAW,WARDA,IAAAA,GAAA,CAAA"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@qxs-bns/components-wc",
3
3
  "type": "module",
4
- "version": "0.0.10",
4
+ "version": "0.0.12",
5
5
  "description": "QXS Business Components - Web Components (framework agnostic)",
6
6
  "license": "MIT",
7
7
  "homepage": "https://qxs-bns.pages.dev/guide/components-wc/",
@@ -43,37 +43,35 @@
43
43
  "lib",
44
44
  "types"
45
45
  ],
46
+ "peerDependencies": {
47
+ "@tiptap/core": "^3.20.5",
48
+ "@tiptap/extension-blockquote": "^3.20.5",
49
+ "@tiptap/extension-bold": "^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
+ },
46
72
  "dependencies": {
47
- "@tiptap/core": "^3.19.0",
48
- "@tiptap/extension-blockquote": "^3.19.0",
49
- "@tiptap/extension-bold": "^3.19.0",
50
- "@tiptap/extension-bubble-menu": "^3.19.0",
51
- "@tiptap/extension-bullet-list": "^3.19.0",
52
- "@tiptap/extension-code": "^3.19.0",
53
- "@tiptap/extension-document": "^3.19.0",
54
- "@tiptap/extension-heading": "^3.19.0",
55
- "@tiptap/extension-history": "^3.19.0",
56
- "@tiptap/extension-horizontal-rule": "^3.19.0",
57
- "@tiptap/extension-image": "^3.19.0",
58
- "@tiptap/extension-italic": "^3.19.0",
59
- "@tiptap/extension-link": "^3.19.0",
60
- "@tiptap/extension-list": "3.19.0",
61
- "@tiptap/extension-list-item": "^3.19.0",
62
- "@tiptap/extension-ordered-list": "^3.19.0",
63
- "@tiptap/extension-paragraph": "^3.19.0",
64
- "@tiptap/extension-placeholder": "^3.19.0",
65
- "@tiptap/extension-strike": "^3.19.0",
66
- "@tiptap/extension-table": "^3.19.0",
67
- "@tiptap/extension-table-cell": "^3.19.0",
68
- "@tiptap/extension-table-header": "^3.19.0",
69
- "@tiptap/extension-table-row": "^3.19.0",
70
- "@tiptap/extension-text": "^3.19.0",
71
- "@tiptap/extension-text-align": "^3.19.0",
72
- "@tiptap/extension-underline": "^3.19.0",
73
- "@tiptap/extensions": "3.19.0",
74
73
  "lit": "^3.3.2",
75
74
  "nanoid": "^5.1.5",
76
75
  "sortablejs": "^1.15.7"
77
- },
78
- "peerDependencies": {}
76
+ }
79
77
  }