@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.
- package/es/base/define.mjs +2 -0
- package/es/base/define.mjs.map +1 -0
- package/es/base/uid.mjs +2 -0
- package/es/base/uid.mjs.map +1 -0
- package/es/editor/blocksuite-editor.mjs +931 -0
- package/es/editor/blocksuite-editor.mjs.map +1 -0
- package/es/editor/index.mjs +2 -0
- package/es/editor/index.mjs.map +1 -0
- package/es/index.mjs +2 -0
- package/es/index.mjs.map +1 -0
- package/es/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/css-tag.mjs +7 -0
- package/es/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/css-tag.mjs.map +1 -0
- package/es/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/property.mjs +7 -0
- package/es/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/property.mjs.map +1 -0
- package/es/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/state.mjs +7 -0
- package/es/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/state.mjs.map +1 -0
- package/es/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/reactive-element.mjs +7 -0
- package/es/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/reactive-element.mjs.map +1 -0
- 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
- 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
- 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
- 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
- package/es/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive-helpers.mjs +7 -0
- package/es/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive-helpers.mjs.map +1 -0
- package/es/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive.mjs +7 -0
- package/es/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive.mjs.map +1 -0
- package/es/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/repeat.mjs +7 -0
- package/es/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/repeat.mjs.map +1 -0
- package/es/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/lit-html.mjs +7 -0
- package/es/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/lit-html.mjs.map +1 -0
- package/es/node_modules/.pnpm/prosemirror-dropcursor@1.8.2/node_modules/prosemirror-dropcursor/dist/index.mjs +2 -0
- package/es/node_modules/.pnpm/prosemirror-dropcursor@1.8.2/node_modules/prosemirror-dropcursor/dist/index.mjs.map +1 -0
- package/es/node_modules/.pnpm/prosemirror-gapcursor@1.4.1/node_modules/prosemirror-gapcursor/dist/index.mjs +2 -0
- package/es/node_modules/.pnpm/prosemirror-gapcursor@1.4.1/node_modules/prosemirror-gapcursor/dist/index.mjs.map +1 -0
- package/es/node_modules/.pnpm/prosemirror-history@1.5.0/node_modules/prosemirror-history/dist/index.mjs +2 -0
- package/es/node_modules/.pnpm/prosemirror-history@1.5.0/node_modules/prosemirror-history/dist/index.mjs.map +1 -0
- package/es/node_modules/.pnpm/prosemirror-keymap@1.2.3/node_modules/prosemirror-keymap/dist/index.mjs +2 -0
- package/es/node_modules/.pnpm/prosemirror-keymap@1.2.3/node_modules/prosemirror-keymap/dist/index.mjs.map +1 -0
- package/es/node_modules/.pnpm/prosemirror-model@1.25.4/node_modules/prosemirror-model/dist/index.mjs +2 -0
- package/es/node_modules/.pnpm/prosemirror-model@1.25.4/node_modules/prosemirror-model/dist/index.mjs.map +1 -0
- package/es/node_modules/.pnpm/prosemirror-state@1.4.4/node_modules/prosemirror-state/dist/index.mjs +2 -0
- package/es/node_modules/.pnpm/prosemirror-state@1.4.4/node_modules/prosemirror-state/dist/index.mjs.map +1 -0
- package/es/node_modules/.pnpm/prosemirror-transform@1.11.0/node_modules/prosemirror-transform/dist/index.mjs +2 -0
- package/es/node_modules/.pnpm/prosemirror-transform@1.11.0/node_modules/prosemirror-transform/dist/index.mjs.map +1 -0
- package/es/node_modules/.pnpm/prosemirror-view@1.41.7/node_modules/prosemirror-view/dist/index.mjs +2 -0
- package/es/node_modules/.pnpm/prosemirror-view@1.41.7/node_modules/prosemirror-view/dist/index.mjs.map +1 -0
- package/es/node_modules/.pnpm/rope-sequence@1.3.4/node_modules/rope-sequence/dist/index.mjs +2 -0
- package/es/node_modules/.pnpm/rope-sequence@1.3.4/node_modules/rope-sequence/dist/index.mjs.map +1 -0
- package/es/node_modules/.pnpm/w3c-keyname@2.2.8/node_modules/w3c-keyname/index.mjs +2 -0
- package/es/node_modules/.pnpm/w3c-keyname@2.2.8/node_modules/w3c-keyname/index.mjs.map +1 -0
- package/es/subject/action.mjs +118 -0
- package/es/subject/action.mjs.map +1 -0
- package/es/subject/blank-fill.mjs +204 -0
- package/es/subject/blank-fill.mjs.map +1 -0
- package/es/subject/layout.mjs +18 -0
- package/es/subject/layout.mjs.map +1 -0
- package/es/subject/list.mjs +128 -0
- package/es/subject/list.mjs.map +1 -0
- package/es/subject/page-end.mjs +25 -0
- package/es/subject/page-end.mjs.map +1 -0
- package/es/subject/rich-text.mjs +27 -0
- package/es/subject/rich-text.mjs.map +1 -0
- package/es/subject/scale.mjs +162 -0
- package/es/subject/scale.mjs.map +1 -0
- package/es/subject/single.mjs +318 -0
- package/es/subject/single.mjs.map +1 -0
- package/es/subject/text-fill.mjs +229 -0
- package/es/subject/text-fill.mjs.map +1 -0
- package/es/subject/type.mjs +42 -0
- package/es/subject/type.mjs.map +1 -0
- package/lib/base/define.cjs +2 -0
- package/lib/base/define.cjs.map +1 -0
- package/lib/base/uid.cjs +2 -0
- package/lib/base/uid.cjs.map +1 -0
- package/lib/editor/blocksuite-editor.cjs +931 -0
- package/lib/editor/blocksuite-editor.cjs.map +1 -0
- package/lib/editor/index.cjs +2 -0
- package/lib/editor/index.cjs.map +1 -0
- package/lib/index.cjs +2 -0
- package/lib/index.cjs.map +1 -0
- package/lib/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/css-tag.cjs +7 -0
- package/lib/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/css-tag.cjs.map +1 -0
- package/lib/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/property.cjs +7 -0
- package/lib/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/property.cjs.map +1 -0
- package/lib/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/state.cjs +7 -0
- package/lib/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/state.cjs.map +1 -0
- package/lib/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/reactive-element.cjs +7 -0
- package/lib/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/reactive-element.cjs.map +1 -0
- 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
- 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
- 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
- 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
- package/lib/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive-helpers.cjs +7 -0
- package/lib/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive-helpers.cjs.map +1 -0
- package/lib/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive.cjs +7 -0
- package/lib/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive.cjs.map +1 -0
- package/lib/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/repeat.cjs +8 -0
- package/lib/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/repeat.cjs.map +1 -0
- package/lib/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/lit-html.cjs +7 -0
- package/lib/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/lit-html.cjs.map +1 -0
- package/lib/node_modules/.pnpm/prosemirror-dropcursor@1.8.2/node_modules/prosemirror-dropcursor/dist/index.cjs +2 -0
- package/lib/node_modules/.pnpm/prosemirror-dropcursor@1.8.2/node_modules/prosemirror-dropcursor/dist/index.cjs.map +1 -0
- package/lib/node_modules/.pnpm/prosemirror-gapcursor@1.4.1/node_modules/prosemirror-gapcursor/dist/index.cjs +2 -0
- package/lib/node_modules/.pnpm/prosemirror-gapcursor@1.4.1/node_modules/prosemirror-gapcursor/dist/index.cjs.map +1 -0
- package/lib/node_modules/.pnpm/prosemirror-history@1.5.0/node_modules/prosemirror-history/dist/index.cjs +2 -0
- package/lib/node_modules/.pnpm/prosemirror-history@1.5.0/node_modules/prosemirror-history/dist/index.cjs.map +1 -0
- package/lib/node_modules/.pnpm/prosemirror-keymap@1.2.3/node_modules/prosemirror-keymap/dist/index.cjs +2 -0
- package/lib/node_modules/.pnpm/prosemirror-keymap@1.2.3/node_modules/prosemirror-keymap/dist/index.cjs.map +1 -0
- package/lib/node_modules/.pnpm/prosemirror-model@1.25.4/node_modules/prosemirror-model/dist/index.cjs +2 -0
- package/lib/node_modules/.pnpm/prosemirror-model@1.25.4/node_modules/prosemirror-model/dist/index.cjs.map +1 -0
- package/lib/node_modules/.pnpm/prosemirror-state@1.4.4/node_modules/prosemirror-state/dist/index.cjs +2 -0
- package/lib/node_modules/.pnpm/prosemirror-state@1.4.4/node_modules/prosemirror-state/dist/index.cjs.map +1 -0
- package/lib/node_modules/.pnpm/prosemirror-transform@1.11.0/node_modules/prosemirror-transform/dist/index.cjs +2 -0
- package/lib/node_modules/.pnpm/prosemirror-transform@1.11.0/node_modules/prosemirror-transform/dist/index.cjs.map +1 -0
- package/lib/node_modules/.pnpm/prosemirror-view@1.41.7/node_modules/prosemirror-view/dist/index.cjs +2 -0
- package/lib/node_modules/.pnpm/prosemirror-view@1.41.7/node_modules/prosemirror-view/dist/index.cjs.map +1 -0
- package/lib/node_modules/.pnpm/rope-sequence@1.3.4/node_modules/rope-sequence/dist/index.cjs +2 -0
- package/lib/node_modules/.pnpm/rope-sequence@1.3.4/node_modules/rope-sequence/dist/index.cjs.map +1 -0
- package/lib/node_modules/.pnpm/w3c-keyname@2.2.8/node_modules/w3c-keyname/index.cjs +2 -0
- package/lib/node_modules/.pnpm/w3c-keyname@2.2.8/node_modules/w3c-keyname/index.cjs.map +1 -0
- package/lib/subject/action.cjs +118 -0
- package/lib/subject/action.cjs.map +1 -0
- package/lib/subject/blank-fill.cjs +204 -0
- package/lib/subject/blank-fill.cjs.map +1 -0
- package/lib/subject/layout.cjs +18 -0
- package/lib/subject/layout.cjs.map +1 -0
- package/lib/subject/list.cjs +128 -0
- package/lib/subject/list.cjs.map +1 -0
- package/lib/subject/page-end.cjs +25 -0
- package/lib/subject/page-end.cjs.map +1 -0
- package/lib/subject/rich-text.cjs +27 -0
- package/lib/subject/rich-text.cjs.map +1 -0
- package/lib/subject/scale.cjs +162 -0
- package/lib/subject/scale.cjs.map +1 -0
- package/lib/subject/single.cjs +318 -0
- package/lib/subject/single.cjs.map +1 -0
- package/lib/subject/text-fill.cjs +229 -0
- package/lib/subject/text-fill.cjs.map +1 -0
- package/lib/subject/type.cjs +42 -0
- package/lib/subject/type.cjs.map +1 -0
- package/package.json +77 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=200,e=function(){};e.prototype.append=function(n){return n.length?(n=e.from(n),!this.length&&n||n.length<t&&this.leafAppend(n)||this.length<t&&n.leafPrepend(this)||this.appendInner(n)):this},e.prototype.prepend=function(t){return t.length?e.from(t).append(this):this},e.prototype.appendInner=function(t){return new r(this,t)},e.prototype.slice=function(t,n){return void 0===t&&(t=0),void 0===n&&(n=this.length),t>=n?e.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))},e.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},e.prototype.forEach=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)},e.prototype.map=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length);var r=[];return this.forEach(function(e,n){return r.push(t(e,n))},e,n),r},e.from=function(t){return t instanceof e?t:t&&t.length?new n(t):e.empty};var n=function(e){function n(t){e.call(this),this.values=t}e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n;var r={length:{configurable:!0},depth:{configurable:!0}};return n.prototype.flatten=function(){return this.values},n.prototype.sliceInner=function(t,e){return 0==t&&e==this.length?this:new n(this.values.slice(t,e))},n.prototype.getInner=function(t){return this.values[t]},n.prototype.forEachInner=function(t,e,n,r){for(var i=e;i<n;i++)if(!1===t(this.values[i],r+i))return!1},n.prototype.forEachInvertedInner=function(t,e,n,r){for(var i=e-1;i>=n;i--)if(!1===t(this.values[i],r+i))return!1},n.prototype.leafAppend=function(e){if(this.length+e.length<=t)return new n(this.values.concat(e.flatten()))},n.prototype.leafPrepend=function(e){if(this.length+e.length<=t)return new n(e.flatten().concat(this.values))},r.length.get=function(){return this.values.length},r.depth.get=function(){return 0},Object.defineProperties(n.prototype,r),n}(e);e.empty=new n([]);var r=function(t){function e(e,n){t.call(this),this.left=e,this.right=n,this.length=e.length+n.length,this.depth=Math.max(e.depth,n.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(t){return t<this.left.length?this.left.get(t):this.right.get(t-this.left.length)},e.prototype.forEachInner=function(t,e,n,r){var i=this.left.length;return!(e<i&&!1===this.left.forEachInner(t,e,Math.min(n,i),r))&&(!(n>i&&!1===this.right.forEachInner(t,Math.max(e-i,0),Math.min(this.length,n)-i,r+i))&&void 0)},e.prototype.forEachInvertedInner=function(t,e,n,r){var i=this.left.length;return!(e>i&&!1===this.right.forEachInvertedInner(t,e-i,Math.max(n,i)-i,r+i))&&(!(n<i&&!1===this.left.forEachInvertedInner(t,Math.min(e,i),n,r))&&void 0)},e.prototype.sliceInner=function(t,e){if(0==t&&e==this.length)return this;var n=this.left.length;return e<=n?this.left.slice(t,e):t>=n?this.right.slice(t-n,e-n):this.left.slice(t,n).append(this.right.slice(0,e-n))},e.prototype.leafAppend=function(t){var n=this.right.leafAppend(t);if(n)return new e(this.left,n)},e.prototype.leafPrepend=function(t){var n=this.left.leafPrepend(t);if(n)return new e(n,this.right)},e.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new e(this.left,new e(this.right,t)):new e(this,t)},e}(e);exports.default=e;
|
|
2
|
+
//# sourceMappingURL=index.cjs.map
|
package/lib/node_modules/.pnpm/rope-sequence@1.3.4/node_modules/rope-sequence/dist/index.cjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../../../../../../node_modules/.pnpm/rope-sequence@1.3.4/node_modules/rope-sequence/dist/index.js"],"sourcesContent":["var GOOD_LEAF_SIZE = 200;\n\n// :: class<T> A rope sequence is a persistent sequence data structure\n// that supports appending, prepending, and slicing without doing a\n// full copy. It is represented as a mostly-balanced tree.\nvar RopeSequence = function RopeSequence () {};\n\nRopeSequence.prototype.append = function append (other) {\n if (!other.length) { return this }\n other = RopeSequence.from(other);\n\n return (!this.length && other) ||\n (other.length < GOOD_LEAF_SIZE && this.leafAppend(other)) ||\n (this.length < GOOD_LEAF_SIZE && other.leafPrepend(this)) ||\n this.appendInner(other)\n};\n\n// :: (union<[T], RopeSequence<T>>) → RopeSequence<T>\n// Prepend an array or other rope to this one, returning a new rope.\nRopeSequence.prototype.prepend = function prepend (other) {\n if (!other.length) { return this }\n return RopeSequence.from(other).append(this)\n};\n\nRopeSequence.prototype.appendInner = function appendInner (other) {\n return new Append(this, other)\n};\n\n// :: (?number, ?number) → RopeSequence<T>\n// Create a rope repesenting a sub-sequence of this rope.\nRopeSequence.prototype.slice = function slice (from, to) {\n if ( from === void 0 ) from = 0;\n if ( to === void 0 ) to = this.length;\n\n if (from >= to) { return RopeSequence.empty }\n return this.sliceInner(Math.max(0, from), Math.min(this.length, to))\n};\n\n// :: (number) → T\n// Retrieve the element at the given position from this rope.\nRopeSequence.prototype.get = function get (i) {\n if (i < 0 || i >= this.length) { return undefined }\n return this.getInner(i)\n};\n\n// :: ((element: T, index: number) → ?bool, ?number, ?number)\n// Call the given function for each element between the given\n// indices. This tends to be more efficient than looping over the\n// indices and calling `get`, because it doesn't have to descend the\n// tree for every element.\nRopeSequence.prototype.forEach = function forEach (f, from, to) {\n if ( from === void 0 ) from = 0;\n if ( to === void 0 ) to = this.length;\n\n if (from <= to)\n { this.forEachInner(f, from, to, 0); }\n else\n { this.forEachInvertedInner(f, from, to, 0); }\n};\n\n// :: ((element: T, index: number) → U, ?number, ?number) → [U]\n// Map the given functions over the elements of the rope, producing\n// a flat array.\nRopeSequence.prototype.map = function map (f, from, to) {\n if ( from === void 0 ) from = 0;\n if ( to === void 0 ) to = this.length;\n\n var result = [];\n this.forEach(function (elt, i) { return result.push(f(elt, i)); }, from, to);\n return result\n};\n\n// :: (?union<[T], RopeSequence<T>>) → RopeSequence<T>\n// Create a rope representing the given array, or return the rope\n// itself if a rope was given.\nRopeSequence.from = function from (values) {\n if (values instanceof RopeSequence) { return values }\n return values && values.length ? new Leaf(values) : RopeSequence.empty\n};\n\nvar Leaf = /*@__PURE__*/(function (RopeSequence) {\n function Leaf(values) {\n RopeSequence.call(this);\n this.values = values;\n }\n\n if ( RopeSequence ) Leaf.__proto__ = RopeSequence;\n Leaf.prototype = Object.create( RopeSequence && RopeSequence.prototype );\n Leaf.prototype.constructor = Leaf;\n\n var prototypeAccessors = { length: { configurable: true },depth: { configurable: true } };\n\n Leaf.prototype.flatten = function flatten () {\n return this.values\n };\n\n Leaf.prototype.sliceInner = function sliceInner (from, to) {\n if (from == 0 && to == this.length) { return this }\n return new Leaf(this.values.slice(from, to))\n };\n\n Leaf.prototype.getInner = function getInner (i) {\n return this.values[i]\n };\n\n Leaf.prototype.forEachInner = function forEachInner (f, from, to, start) {\n for (var i = from; i < to; i++)\n { if (f(this.values[i], start + i) === false) { return false } }\n };\n\n Leaf.prototype.forEachInvertedInner = function forEachInvertedInner (f, from, to, start) {\n for (var i = from - 1; i >= to; i--)\n { if (f(this.values[i], start + i) === false) { return false } }\n };\n\n Leaf.prototype.leafAppend = function leafAppend (other) {\n if (this.length + other.length <= GOOD_LEAF_SIZE)\n { return new Leaf(this.values.concat(other.flatten())) }\n };\n\n Leaf.prototype.leafPrepend = function leafPrepend (other) {\n if (this.length + other.length <= GOOD_LEAF_SIZE)\n { return new Leaf(other.flatten().concat(this.values)) }\n };\n\n prototypeAccessors.length.get = function () { return this.values.length };\n\n prototypeAccessors.depth.get = function () { return 0 };\n\n Object.defineProperties( Leaf.prototype, prototypeAccessors );\n\n return Leaf;\n}(RopeSequence));\n\n// :: RopeSequence\n// The empty rope sequence.\nRopeSequence.empty = new Leaf([]);\n\nvar Append = /*@__PURE__*/(function (RopeSequence) {\n function Append(left, right) {\n RopeSequence.call(this);\n this.left = left;\n this.right = right;\n this.length = left.length + right.length;\n this.depth = Math.max(left.depth, right.depth) + 1;\n }\n\n if ( RopeSequence ) Append.__proto__ = RopeSequence;\n Append.prototype = Object.create( RopeSequence && RopeSequence.prototype );\n Append.prototype.constructor = Append;\n\n Append.prototype.flatten = function flatten () {\n return this.left.flatten().concat(this.right.flatten())\n };\n\n Append.prototype.getInner = function getInner (i) {\n return i < this.left.length ? this.left.get(i) : this.right.get(i - this.left.length)\n };\n\n Append.prototype.forEachInner = function forEachInner (f, from, to, start) {\n var leftLen = this.left.length;\n if (from < leftLen &&\n this.left.forEachInner(f, from, Math.min(to, leftLen), start) === false)\n { return false }\n if (to > leftLen &&\n this.right.forEachInner(f, Math.max(from - leftLen, 0), Math.min(this.length, to) - leftLen, start + leftLen) === false)\n { return false }\n };\n\n Append.prototype.forEachInvertedInner = function forEachInvertedInner (f, from, to, start) {\n var leftLen = this.left.length;\n if (from > leftLen &&\n this.right.forEachInvertedInner(f, from - leftLen, Math.max(to, leftLen) - leftLen, start + leftLen) === false)\n { return false }\n if (to < leftLen &&\n this.left.forEachInvertedInner(f, Math.min(from, leftLen), to, start) === false)\n { return false }\n };\n\n Append.prototype.sliceInner = function sliceInner (from, to) {\n if (from == 0 && to == this.length) { return this }\n var leftLen = this.left.length;\n if (to <= leftLen) { return this.left.slice(from, to) }\n if (from >= leftLen) { return this.right.slice(from - leftLen, to - leftLen) }\n return this.left.slice(from, leftLen).append(this.right.slice(0, to - leftLen))\n };\n\n Append.prototype.leafAppend = function leafAppend (other) {\n var inner = this.right.leafAppend(other);\n if (inner) { return new Append(this.left, inner) }\n };\n\n Append.prototype.leafPrepend = function leafPrepend (other) {\n var inner = this.left.leafPrepend(other);\n if (inner) { return new Append(inner, this.right) }\n };\n\n Append.prototype.appendInner = function appendInner (other) {\n if (this.left.depth >= Math.max(this.right.depth, other.depth) + 1)\n { return new Append(this.left, new Append(this.right, other)) }\n return new Append(this, other)\n };\n\n return Append;\n}(RopeSequence));\n\nexport default RopeSequence;\n"],"names":["GOOD_LEAF_SIZE","RopeSequence","prototype","append","other","length","from","this","leafAppend","leafPrepend","appendInner","prepend","Append","slice","to","empty","sliceInner","Math","max","min","get","i","getInner","forEach","f","forEachInner","forEachInvertedInner","map","result","elt","push","values","Leaf","call","__proto__","Object","create","constructor","prototypeAccessors","configurable","depth","flatten","start","concat","defineProperties","left","right","leftLen","inner"],"mappings":"oEAAA,IAAIA,EAAiB,IAKjBC,EAAe,WAA0B,EAE7CA,EAAaC,UAAUC,OAAS,SAAiBC,GAC/C,OAAKA,EAAMC,QACXD,EAAQH,EAAaK,KAAKF,IAEjBG,KAAKF,QAAUD,GACrBA,EAAMC,OAASL,GAAkBO,KAAKC,WAAWJ,IACjDG,KAAKF,OAASL,GAAkBI,EAAMK,YAAYF,OACnDA,KAAKG,YAAYN,IANSG,IAO9B,EAIAN,EAAaC,UAAUS,QAAU,SAAkBP,GACjD,OAAKA,EAAMC,OACJJ,EAAaK,KAAKF,GAAOD,OAAOI,MADXA,IAE9B,EAEAN,EAAaC,UAAUQ,YAAc,SAAsBN,GACzD,OAAO,IAAIQ,EAAOL,KAAMH,EAC1B,EAIAH,EAAaC,UAAUW,MAAQ,SAAgBP,EAAMQ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:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},r={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},t="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),o="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),n=0;n<10;n++)e[48+n]=e[96+n]=String(n);for(n=1;n<=24;n++)e[n+111]="F"+n;for(n=65;n<=90;n++)e[n]=String.fromCharCode(n+32),r[n]=String.fromCharCode(n);for(var a in e)r.hasOwnProperty(a)||(r[a]=e[a]);exports.base=e,exports.keyName=function(n){var a=!(t&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||o&&n.shiftKey&&n.key&&1==n.key.length||"Unidentified"==n.key)&&n.key||(n.shiftKey?r:e)[n.keyCode]||n.key||"Unidentified";return"Esc"==a&&(a="Escape"),"Del"==a&&(a="Delete"),"Left"==a&&(a="ArrowLeft"),"Up"==a&&(a="ArrowUp"),"Right"==a&&(a="ArrowRight"),"Down"==a&&(a="ArrowDown"),a},exports.shift=r;
|
|
2
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../../../../../node_modules/.pnpm/w3c-keyname@2.2.8/node_modules/w3c-keyname/index.js"],"sourcesContent":["export var base = {\n 8: \"Backspace\",\n 9: \"Tab\",\n 10: \"Enter\",\n 12: \"NumLock\",\n 13: \"Enter\",\n 16: \"Shift\",\n 17: \"Control\",\n 18: \"Alt\",\n 20: \"CapsLock\",\n 27: \"Escape\",\n 32: \" \",\n 33: \"PageUp\",\n 34: \"PageDown\",\n 35: \"End\",\n 36: \"Home\",\n 37: \"ArrowLeft\",\n 38: \"ArrowUp\",\n 39: \"ArrowRight\",\n 40: \"ArrowDown\",\n 44: \"PrintScreen\",\n 45: \"Insert\",\n 46: \"Delete\",\n 59: \";\",\n 61: \"=\",\n 91: \"Meta\",\n 92: \"Meta\",\n 106: \"*\",\n 107: \"+\",\n 108: \",\",\n 109: \"-\",\n 110: \".\",\n 111: \"/\",\n 144: \"NumLock\",\n 145: \"ScrollLock\",\n 160: \"Shift\",\n 161: \"Shift\",\n 162: \"Control\",\n 163: \"Control\",\n 164: \"Alt\",\n 165: \"Alt\",\n 173: \"-\",\n 186: \";\",\n 187: \"=\",\n 188: \",\",\n 189: \"-\",\n 190: \".\",\n 191: \"/\",\n 192: \"`\",\n 219: \"[\",\n 220: \"\\\\\",\n 221: \"]\",\n 222: \"'\"\n}\n\nexport var shift = {\n 48: \")\",\n 49: \"!\",\n 50: \"@\",\n 51: \"#\",\n 52: \"$\",\n 53: \"%\",\n 54: \"^\",\n 55: \"&\",\n 56: \"*\",\n 57: \"(\",\n 59: \":\",\n 61: \"+\",\n 173: \"_\",\n 186: \":\",\n 187: \"+\",\n 188: \"<\",\n 189: \"_\",\n 190: \">\",\n 191: \"?\",\n 192: \"~\",\n 219: \"{\",\n 220: \"|\",\n 221: \"}\",\n 222: \"\\\"\"\n}\n\nvar mac = typeof navigator != \"undefined\" && /Mac/.test(navigator.platform)\nvar ie = typeof navigator != \"undefined\" && /MSIE \\d|Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(navigator.userAgent)\n\n// Fill in the digit keys\nfor (var i = 0; i < 10; i++) base[48 + i] = base[96 + i] = String(i)\n\n// The function keys\nfor (var i = 1; i <= 24; i++) base[i + 111] = \"F\" + i\n\n// And the alphabetic keys\nfor (var i = 65; i <= 90; i++) {\n base[i] = String.fromCharCode(i + 32)\n shift[i] = String.fromCharCode(i)\n}\n\n// For each code that doesn't have a shift-equivalent, copy the base name\nfor (var code in base) if (!shift.hasOwnProperty(code)) shift[code] = base[code]\n\nexport function keyName(event) {\n // On macOS, keys held with Shift and Cmd don't reflect the effect of Shift in `.key`.\n // On IE, shift effect is never included in `.key`.\n var ignoreKey = mac && event.metaKey && event.shiftKey && !event.ctrlKey && !event.altKey ||\n ie && event.shiftKey && event.key && event.key.length == 1 ||\n event.key == \"Unidentified\"\n var name = (!ignoreKey && event.key) ||\n (event.shiftKey ? shift : base)[event.keyCode] ||\n event.key || \"Unidentified\"\n // Edge sometimes produces wrong names (Issue #3)\n if (name == \"Esc\") name = \"Escape\"\n if (name == \"Del\") name = \"Delete\"\n // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/8860571/\n if (name == \"Left\") name = \"ArrowLeft\"\n if (name == \"Up\") name = \"ArrowUp\"\n if (name == \"Right\") name = \"ArrowRight\"\n if (name == \"Down\") name = \"ArrowDown\"\n return name\n}\n"],"names":["base","shift","mac","navigator","test","platform","ie","exec","userAgent","i","String","fromCharCode","code","hasOwnProperty","event","name","metaKey","shiftKey","ctrlKey","altKey","key","length","keyCode"],"mappings":"aAsFA,IAtFO,IAAIA,EAAO,CAChB,EAAG,YACH,EAAG,MACH,GAAI,QACJ,GAAI,UACJ,GAAI,QACJ,GAAI,QACJ,GAAI,UACJ,GAAI,MACJ,GAAI,WACJ,GAAI,SACJ,GAAI,IACJ,GAAI,SACJ,GAAI,WACJ,GAAI,MACJ,GAAI,OACJ,GAAI,YACJ,GAAI,UACJ,GAAI,aACJ,GAAI,YACJ,GAAI,cACJ,GAAI,SACJ,GAAI,SACJ,GAAI,IACJ,GAAI,IACJ,GAAI,OACJ,GAAI,OACJ,IAAK,IACL,IAAK,IACL,IAAK,IACL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EAAQD,GAAMc,EAAMQ,UACtCR,EAAMM,KAAO,eASf,MAPY,OAARL,IAAeA,EAAO,UACd,OAARA,IAAeA,EAAO,UAEd,QAARA,IAAgBA,EAAO,aACf,MAARA,IAAcA,EAAO,WACb,SAARA,IAAiBA,EAAO,cAChB,QAARA,IAAgBA,EAAO,aACpBA,CACT","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,118 @@
|
|
|
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"),o=require("../node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/state.cjs"),r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,n=(e,t,o,n)=>{for(var s,a=n>1?void 0:n?i(t,o):t,l=e.length-1;l>=0;l--)(s=e[l])&&(a=(n?s(t,o,a):s(a))||a);return n&&a&&r(t,o,a),a};const s=[{value:2,label:"必须全部都是支持选项,方可下一步"},{value:1,label:"无需判断是否是支持选项"},{value:3,label:"包含全部支持选项,即可下一步"}];var a;e.html`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"/></svg>`,e.html`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="3 6 5 6 21 6"/><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/></svg>`,e.html`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>`,e.html`<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="currentColor"><path d="M3 18h6v-2H3v2zM3 6v2h18V6H3zm0 7h12v-2H3v2z"/></svg>`,exports.QxsSubjectAction=class extends e.LitElement{constructor(){super(...arguments),this.isEdit=!1,this.isSet=!1,this.isKey=!1,this.answerCheckType=1,this.showOtherOption=!1,this.showRichText=!0,this.hideAddRichText=!1,this.pageEnd=!1,this.examAnswerRelationType=0,this._modalOpen=!1,this._currentCheckType=1}updated(e){e.has("answerCheckType")&&(this._currentCheckType=this.answerCheckType)}_emit(e,t){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:t??null}))}get _answerText(){return s.find(e=>e.value===this.answerCheckType)?.label??""}_renderEditMode(){return e.html`
|
|
2
|
+
<div class="left">
|
|
3
|
+
${this.hideAddRichText?"":e.html`
|
|
4
|
+
<span class="link-btn" @click=${()=>this._emit("on-show-rich-text")}>+添加题目描述(图文)</span>
|
|
5
|
+
`}
|
|
6
|
+
${this.showOtherOption?e.html`
|
|
7
|
+
<span class="link-btn" @click=${()=>{this._modalOpen=!0}}>答题设置</span>
|
|
8
|
+
<label class="checkbox-label">
|
|
9
|
+
<input type="checkbox" .checked=${this.isKey} @change=${e=>this._emit("set-key",{value:e.target.checked})} />
|
|
10
|
+
核心题
|
|
11
|
+
</label>
|
|
12
|
+
`:""}
|
|
13
|
+
</div>
|
|
14
|
+
<div class="right">
|
|
15
|
+
<button class="text-btn text-btn--danger btn-margin" @click=${()=>this._emit("delete")}>删除</button>
|
|
16
|
+
<button class="text-btn text-btn--primary" @click=${()=>this._emit("save")}>完成编辑</button>
|
|
17
|
+
</div>
|
|
18
|
+
`}_renderViewMode(){return e.html`
|
|
19
|
+
<div class="left">
|
|
20
|
+
${this.showOtherOption?e.html`
|
|
21
|
+
<label class="checkbox-label disabled">
|
|
22
|
+
<input type="checkbox" disabled .checked=${this.isKey} /> 核心题
|
|
23
|
+
</label>
|
|
24
|
+
<span class="answer-text">${this._answerText}</span>
|
|
25
|
+
`:""}
|
|
26
|
+
</div>
|
|
27
|
+
<div class="right">
|
|
28
|
+
${this.pageEnd?"":e.html`
|
|
29
|
+
<button class="text-btn text-btn--default btn-margin" @click=${()=>this._emit("edit")}>编辑</button>
|
|
30
|
+
`}
|
|
31
|
+
<button class="text-btn text-btn--danger" @click=${()=>this._emit("delete")}>删除</button>
|
|
32
|
+
</div>
|
|
33
|
+
`}_renderModal(){return this._modalOpen?e.html`
|
|
34
|
+
<div class="modal-backdrop" @click=${()=>{this._modalOpen=!1}}>
|
|
35
|
+
<div class="modal" @click=${e=>e.stopPropagation()}>
|
|
36
|
+
<div class="modal-header">
|
|
37
|
+
<span class="modal-title">答题设置</span>
|
|
38
|
+
<button class="modal-close" @click=${()=>{this._modalOpen=!1}}>✕</button>
|
|
39
|
+
</div>
|
|
40
|
+
<div class="modal-body">
|
|
41
|
+
${s.map(t=>e.html`
|
|
42
|
+
<label class="radio-item">
|
|
43
|
+
<input type="radio" name="answer-check-type" .value=${String(t.value)}
|
|
44
|
+
.checked=${this._currentCheckType===t.value}
|
|
45
|
+
@change=${()=>{this._currentCheckType=t.value}} />
|
|
46
|
+
${t.label}
|
|
47
|
+
</label>
|
|
48
|
+
`)}
|
|
49
|
+
</div>
|
|
50
|
+
<div class="modal-footer">
|
|
51
|
+
<button @click=${()=>{this._modalOpen=!1}}>取消</button>
|
|
52
|
+
<button class="primary" @click=${()=>{this._emit("set-answer-setting",{value:this._currentCheckType}),this._modalOpen=!1}}>保存</button>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
`:""}render(){return e.html`
|
|
57
|
+
<div class="action ${this.isEdit?"active":""}">
|
|
58
|
+
${this.isSet?e.html`<div class="has-set">*此题设置了跳题逻辑</div>`:this.isEdit?this._renderEditMode():this._renderViewMode()}
|
|
59
|
+
</div>
|
|
60
|
+
${this._renderModal()}
|
|
61
|
+
`}},exports.QxsSubjectAction.styles=e.css`
|
|
62
|
+
:host { display: block; font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 12px; }
|
|
63
|
+
*, ::before, ::after { box-sizing: border-box; }
|
|
64
|
+
|
|
65
|
+
.action { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; flex-wrap: wrap; gap: 8px; }
|
|
66
|
+
.action.active { background-color: #f6f7fb; }
|
|
67
|
+
.left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
|
|
68
|
+
.right { display: flex; align-items: center; gap: 4px; }
|
|
69
|
+
|
|
70
|
+
.action-icon {
|
|
71
|
+
display: inline-flex; align-items: center; justify-content: center;
|
|
72
|
+
width: 32px; height: 32px; font-size: 18px; color: #303133;
|
|
73
|
+
cursor: pointer; border-radius: 6px; border: 1px solid #dcdfe6;
|
|
74
|
+
background: #fff; transition: all 0.2s;
|
|
75
|
+
}
|
|
76
|
+
.action-icon:hover { color: #3D61E3; border-color: #3D61E3; background: #ecf5ff; }
|
|
77
|
+
.action-icon--danger:hover { color: #f56c6c; border-color: #f56c6c; background: #fef0f0; }
|
|
78
|
+
.action-icon:disabled { color: #c0c4cc; cursor: not-allowed; opacity: 0.6; }
|
|
79
|
+
|
|
80
|
+
.text-btn {
|
|
81
|
+
display: inline-flex; align-items: center; gap: 4px;
|
|
82
|
+
padding: 6px 12px; font-size: 12px; border-radius: 3px;
|
|
83
|
+
cursor: pointer; border: 1px solid; transition: all 0.2s;
|
|
84
|
+
}
|
|
85
|
+
.text-btn--primary { background: #3D61E3; border-color: #3D61E3; color: #fff; }
|
|
86
|
+
.text-btn--primary:hover { background: #2D4CB8; border-color: #2D4CB8; }
|
|
87
|
+
.text-btn--default { background: #fff; border-color: #dcdfe6; color: #606266; }
|
|
88
|
+
.text-btn--default:hover { color: #3D61E3; border-color: #a0cfff; }
|
|
89
|
+
.text-btn--danger { background: #f56c6c; border-color: #f56c6c; color: #fff; }
|
|
90
|
+
.text-btn--danger:hover { background: #e05252; border-color: #e05252; }
|
|
91
|
+
|
|
92
|
+
.link-btn { background: none; border: none; color: #3D61E3; cursor: pointer; font-size: 12px; }
|
|
93
|
+
.link-btn:hover { color: #2D4CB8; }
|
|
94
|
+
|
|
95
|
+
.checkbox-label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; color: #606266; user-select: none; font-size: 12px; }
|
|
96
|
+
.checkbox-label.disabled { cursor: not-allowed; opacity: 0.6; }
|
|
97
|
+
.has-set { display: flex; align-items: center; font-size: 12px; color: #bbb; }
|
|
98
|
+
.answer-text { font-size: 11px; color: #909399; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
99
|
+
|
|
100
|
+
.btn-margin { margin-right: 10px; }
|
|
101
|
+
|
|
102
|
+
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 2000; display: flex; align-items: center; justify-content: center; }
|
|
103
|
+
.modal { background: #fff; border-radius: 4px; min-width: 360px; max-width: 460px; box-shadow: 0 12px 32px rgba(0,0,0,.1); }
|
|
104
|
+
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px 12px; border-bottom: 1px solid #e4e7ed; }
|
|
105
|
+
.modal-title { font-size: 14px; font-weight: 600; color: #303133; }
|
|
106
|
+
.modal-close { background: none; border: none; font-size: 16px; cursor: pointer; color: #909399; padding: 0; line-height: 1; }
|
|
107
|
+
.modal-close:hover { color: #3D61E3; }
|
|
108
|
+
.modal-body { padding: 20px; }
|
|
109
|
+
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid #e4e7ed; }
|
|
110
|
+
.modal-footer button { padding: 6px 16px; font-size: 12px; border-radius: 3px; cursor: pointer; border: 1px solid #dcdfe6; background: #fff; color: #606266; }
|
|
111
|
+
.modal-footer button:hover { color: #3D61E3; border-color: #a0cfff; }
|
|
112
|
+
.modal-footer button.primary { background: #3D61E3; border-color: #3D61E3; color: #fff; }
|
|
113
|
+
.modal-footer button.primary:hover { background: #2D4CB8; border-color: #2D4CB8; }
|
|
114
|
+
|
|
115
|
+
.radio-item { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; cursor: pointer; font-size: 13px; color: #606266; }
|
|
116
|
+
.radio-item:last-child { margin-bottom: 0; }
|
|
117
|
+
`,n([t.property({type:Boolean,attribute:"is-edit"})],exports.QxsSubjectAction.prototype,"isEdit",2),n([t.property({type:Boolean,attribute:"is-set"})],exports.QxsSubjectAction.prototype,"isSet",2),n([t.property({type:Boolean,attribute:"is-key"})],exports.QxsSubjectAction.prototype,"isKey",2),n([t.property({type:Number,attribute:"answer-check-type"})],exports.QxsSubjectAction.prototype,"answerCheckType",2),n([t.property({type:Boolean,attribute:"show-other-option"})],exports.QxsSubjectAction.prototype,"showOtherOption",2),n([t.property({type:Boolean,attribute:"show-rich-text"})],exports.QxsSubjectAction.prototype,"showRichText",2),n([t.property({type:Boolean,attribute:"hide-add-rich-text"})],exports.QxsSubjectAction.prototype,"hideAddRichText",2),n([t.property({type:Boolean,attribute:"page-end"})],exports.QxsSubjectAction.prototype,"pageEnd",2),n([t.property({type:Number,attribute:"exam-answer-relation-type"})],exports.QxsSubjectAction.prototype,"examAnswerRelationType",2),n([o.state()],exports.QxsSubjectAction.prototype,"_modalOpen",2),n([o.state()],exports.QxsSubjectAction.prototype,"_currentCheckType",2),exports.QxsSubjectAction=n([(a="qxs-subject-action",function(e){return customElements.get(a)||customElements.define(a,e),e})],exports.QxsSubjectAction);
|
|
118
|
+
//# sourceMappingURL=action.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action.cjs","sources":["../../../../packages/components-wc/src/subject/action.ts"],"sourcesContent":["import { css, html, LitElement } from 'lit'\nimport { property, state } from 'lit/decorators.js'\n\nfunction safeCustomElement(tagName: string) {\n return function (target: any) {\n if (!customElements.get(tagName)) {\n customElements.define(tagName, target)\n }\n return target\n }\n}\n\nconst answerTextList = [\n { value: 2, label: '必须全部都是支持选项,方可下一步' },\n { value: 1, label: '无需判断是否是支持选项' },\n { value: 3, label: '包含全部支持选项,即可下一步' },\n]\n\nconst iconEdit = html`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"/><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"/></svg>`\nconst iconDelete = html`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polyline points=\"3 6 5 6 21 6\"/><path d=\"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2\"/></svg>`\nconst iconCheck = html`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polyline points=\"20 6 9 17 4 12\"/></svg>`\nconst iconSort = html`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M3 18h6v-2H3v2zM3 6v2h18V6H3zm0 7h12v-2H3v2z\"/></svg>`\n\n@safeCustomElement('qxs-subject-action')\nexport class QxsSubjectAction extends LitElement {\n static styles = css`\n :host { display: block; font-family: system-ui, -apple-system, \"PingFang SC\", \"Microsoft YaHei\", sans-serif; font-size: 12px; }\n *, ::before, ::after { box-sizing: border-box; }\n\n .action { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; flex-wrap: wrap; gap: 8px; }\n .action.active { background-color: #f6f7fb; }\n .left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }\n .right { display: flex; align-items: center; gap: 4px; }\n\n .action-icon {\n display: inline-flex; align-items: center; justify-content: center;\n width: 32px; height: 32px; font-size: 18px; color: #303133;\n cursor: pointer; border-radius: 6px; border: 1px solid #dcdfe6;\n background: #fff; transition: all 0.2s;\n }\n .action-icon:hover { color: #3D61E3; border-color: #3D61E3; background: #ecf5ff; }\n .action-icon--danger:hover { color: #f56c6c; border-color: #f56c6c; background: #fef0f0; }\n .action-icon:disabled { color: #c0c4cc; cursor: not-allowed; opacity: 0.6; }\n\n .text-btn {\n display: inline-flex; align-items: center; gap: 4px;\n padding: 6px 12px; font-size: 12px; border-radius: 3px;\n cursor: pointer; border: 1px solid; transition: all 0.2s;\n }\n .text-btn--primary { background: #3D61E3; border-color: #3D61E3; color: #fff; }\n .text-btn--primary:hover { background: #2D4CB8; border-color: #2D4CB8; }\n .text-btn--default { background: #fff; border-color: #dcdfe6; color: #606266; }\n .text-btn--default:hover { color: #3D61E3; border-color: #a0cfff; }\n .text-btn--danger { background: #f56c6c; border-color: #f56c6c; color: #fff; }\n .text-btn--danger:hover { background: #e05252; border-color: #e05252; }\n\n .link-btn { background: none; border: none; color: #3D61E3; cursor: pointer; font-size: 12px; }\n .link-btn:hover { color: #2D4CB8; }\n\n .checkbox-label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; color: #606266; user-select: none; font-size: 12px; }\n .checkbox-label.disabled { cursor: not-allowed; opacity: 0.6; }\n .has-set { display: flex; align-items: center; font-size: 12px; color: #bbb; }\n .answer-text { font-size: 11px; color: #909399; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n\n .btn-margin { margin-right: 10px; }\n\n .modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 2000; display: flex; align-items: center; justify-content: center; }\n .modal { background: #fff; border-radius: 4px; min-width: 360px; max-width: 460px; box-shadow: 0 12px 32px rgba(0,0,0,.1); }\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: 16px; cursor: pointer; color: #909399; padding: 0; line-height: 1; }\n .modal-close:hover { color: #3D61E3; }\n .modal-body { padding: 20px; }\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 .radio-item { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; cursor: pointer; font-size: 13px; color: #606266; }\n .radio-item:last-child { margin-bottom: 0; }\n `\n\n @property({ type: Boolean, attribute: 'is-edit' }) isEdit = false\n @property({ type: Boolean, attribute: 'is-set' }) isSet = false\n @property({ type: Boolean, attribute: 'is-key' }) isKey = false\n @property({ type: Number, attribute: 'answer-check-type' }) answerCheckType = 1\n @property({ type: Boolean, attribute: 'show-other-option' }) showOtherOption = false\n @property({ type: Boolean, attribute: 'show-rich-text' }) showRichText = true\n @property({ type: Boolean, attribute: 'hide-add-rich-text' }) hideAddRichText = false\n @property({ type: Boolean, attribute: 'page-end' }) pageEnd = false\n @property({ type: Number, attribute: 'exam-answer-relation-type' }) examAnswerRelationType = 0\n\n @state() private _modalOpen = false\n @state() private _currentCheckType = 1\n\n updated(changed: Map<string, unknown>) {\n if (changed.has('answerCheckType')) {\n this._currentCheckType = this.answerCheckType\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 get _answerText() {\n return answerTextList.find(i => i.value === this.answerCheckType)?.label ?? ''\n }\n\n private _renderEditMode() {\n return html`\n <div class=\"left\">\n ${!this.hideAddRichText\n ? html`\n <span class=\"link-btn\" @click=${() => this._emit('on-show-rich-text')}>+添加题目描述(图文)</span>\n `\n : ''}\n ${this.showOtherOption\n ? html`\n <span class=\"link-btn\" @click=${() => { this._modalOpen = true }}>答题设置</span>\n <label class=\"checkbox-label\">\n <input type=\"checkbox\" .checked=${this.isKey} @change=${(e: Event) => this._emit('set-key', { value: (e.target as HTMLInputElement).checked })} />\n 核心题\n </label>\n `\n : ''}\n </div>\n <div class=\"right\">\n <button class=\"text-btn text-btn--danger btn-margin\" @click=${() => this._emit('delete')}>删除</button>\n <button class=\"text-btn text-btn--primary\" @click=${() => this._emit('save')}>完成编辑</button>\n </div>\n `\n }\n\n private _renderViewMode() {\n return html`\n <div class=\"left\">\n ${this.showOtherOption\n ? html`\n <label class=\"checkbox-label disabled\">\n <input type=\"checkbox\" disabled .checked=${this.isKey} /> 核心题\n </label>\n <span class=\"answer-text\">${this._answerText}</span>\n `\n : ''}\n </div>\n <div class=\"right\">\n ${!this.pageEnd\n ? html`\n <button class=\"text-btn text-btn--default btn-margin\" @click=${() => this._emit('edit')}>编辑</button>\n `\n : ''}\n <button class=\"text-btn text-btn--danger\" @click=${() => this._emit('delete')}>删除</button>\n </div>\n `\n }\n\n private _renderModal() {\n if (!this._modalOpen) { return '' }\n return html`\n <div class=\"modal-backdrop\" @click=${() => { this._modalOpen = false }}>\n <div class=\"modal\" @click=${(e: Event) => e.stopPropagation()}>\n <div class=\"modal-header\">\n <span class=\"modal-title\">答题设置</span>\n <button class=\"modal-close\" @click=${() => { this._modalOpen = false }}>✕</button>\n </div>\n <div class=\"modal-body\">\n ${answerTextList.map(item => html`\n <label class=\"radio-item\">\n <input type=\"radio\" name=\"answer-check-type\" .value=${String(item.value)}\n .checked=${this._currentCheckType === item.value}\n @change=${() => { this._currentCheckType = item.value }} />\n ${item.label}\n </label>\n `)}\n </div>\n <div class=\"modal-footer\">\n <button @click=${() => { this._modalOpen = false }}>取消</button>\n <button class=\"primary\" @click=${() => {\n this._emit('set-answer-setting', { value: this._currentCheckType })\n this._modalOpen = false\n }}>保存</button>\n </div>\n </div>\n </div>\n `\n }\n\n render() {\n return html`\n <div class=\"action ${this.isEdit ? 'active' : ''}\">\n ${this.isSet\n ? html`<div class=\"has-set\">*此题设置了跳题逻辑</div>`\n : (this.isEdit ? this._renderEditMode() : this._renderViewMode())\n }\n </div>\n ${this._renderModal()}\n `\n }\n}\n\nexport function register() {}\n"],"names":["answerTextList","value","label","tagName","html","QxsSubjectAction","LitElement","constructor","super","arguments","this","isEdit","isSet","isKey","answerCheckType","showOtherOption","showRichText","hideAddRichText","pageEnd","examAnswerRelationType","_modalOpen","_currentCheckType","updated","changed","has","_emit","name","detail","dispatchEvent","CustomEvent","bubbles","composed","_answerText","find","i","_renderEditMode","e","target","checked","_renderViewMode","_renderModal","stopPropagation","map","item","String","render","styles","css","__decorateClass","property","type","Boolean","attribute","prototype","Number","state","customElements","get","define"],"mappings":"+cAYA,MAAMA,EAAiB,CACrB,CAAEC,MAAO,EAAGC,MAAO,oBACnB,CAAED,MAAO,EAAGC,MAAO,eACnB,CAAED,MAAO,EAAGC,MAAO,mBAZrB,IAA2BC,EAeVC,EAAAA,IAAA,uUACEA,EAAAA,IAAA,yTACDA,EAAAA,IAAA,iOACDA,EAAAA,IAAA,wKAGJC,QAAAA,iBAAN,cAA+BC,EAAAA,WAA/BC,WAAAA,GAAAC,SAAAC,WA2D8CC,KAAAC,QAAS,EACVD,KAAAE,OAAQ,EACRF,KAAAG,OAAQ,EACEH,KAAAI,gBAAkB,EACjBJ,KAAAK,iBAAkB,EACrBL,KAAAM,cAAe,EACXN,KAAAO,iBAAkB,EAC5BP,KAAAQ,SAAU,EACMR,KAAAS,uBAAyB,EAEpFT,K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AAAA,iBAkEyCgD,UAAA,UAAA,GACgBL,EAAA,CAAnEC,EAAAA,SAAS,CAAEC,KAAMI,OAAQF,UAAW,+BAnE1B/C,QAAAA,iBAmEyDgD,UAAA,yBAAA,GAEnDL,EAAA,CAAhBO,EAAAA,SArEUlD,QAAAA,iBAqEMgD,UAAA,aAAA,GACAL,EAAA,CAAhBO,EAAAA,SAtEUlD,QAAAA,iBAsEMgD,UAAA,oBAAA,GAtENhD,QAAAA,iBAAN2C,EAAA,EArBoB7C,EAoBR,qBAnBV,SAAUkC,GAIf,OAHKmB,eAAeC,IAAItD,IACtBqD,eAAeE,OAAOvD,EAASkC,GAE1BA,CACT,IAeWhC,QAAAA"}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
"use strict";var t=require("lit"),e=require("../node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/property.cjs"),s=require("../node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/state.cjs"),i=require("../base/define.cjs"),l=Object.defineProperty,a=Object.getOwnPropertyDescriptor,r=(t,e,s,i)=>{for(var r,n=i>1?void 0:i?a(e,s):e,o=t.length-1;o>=0;o--)(r=t[o])&&(n=(i?r(e,s,n):r(n))||n);return i&&n&&l(e,s,n),n};const n=t.html`
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none"
|
|
3
|
+
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
4
|
+
<line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/>
|
|
5
|
+
</svg>`;function o(t){const e=document.createElement("div");e.textContent=t,Object.assign(e.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(e),setTimeout(()=>{e.style.opacity="0",setTimeout(()=>e.remove(),300)},2500)}exports.QxsBlankFill=class extends t.LitElement{constructor(){super(...arguments),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:!1,isIgnoreCase:!0},this.answerList=[],this._title="",this._analysis="",this._answers=[{title:"",tag:"",showInput:!1}],this._isInOrder=!1,this._isIgnoreCase=!0,this._showRichText=!1,this._richText="",this.TITLE_MAX=400}updated(t){t.has("isEdit")&&this.isEdit&&this._syncProps()}_syncProps(){if(this._title=(this.title||"").replaceAll(/<filter><\/filter>/g," ______"),this._analysis=this.analysis||"",this.answerList?.length)this._answers=this.answerList.map(t=>({title:t.title||"",tag:"",showInput:!1}));else{const t=(this._title.match(/ ______/g)||[]).length||1;this._answers=Array.from({length:t},()=>({title:"",tag:"",showInput:!1}))}this.examAnswerSetting&&(this._isInOrder=!!this.examAnswerSetting.isInOrder,this._isIgnoreCase=!!this.examAnswerSetting.isIgnoreCase),this.richTextContent&&(this._richText=this.richTextContent,this._showRichText=!0)}_emit(t,e){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e??null}))}_addBlank(){this._title+=" ______",this._answers=[...this._answers,{title:"",tag:"",showInput:!1}],this.requestUpdate()}_onTitleInput(t){const e=t.target;e.value.length>this.TITLE_MAX&&(e.value=e.value.slice(0,this.TITLE_MAX)),this._title=e.value;const s=(this._title.match(/ ______/g)||[]).length;if(s!==this._answers.length)if(s>this._answers.length)for(let t=this._answers.length;t<s;t++)this._answers=[...this._answers,{title:"",tag:"",showInput:!1}];else this._answers=this._answers.slice(0,s)}_handleAddTag(t){t.showInput=!1,t.tag&&(t.title=t.title?[t.title,t.tag].join(","):t.tag,t.tag=""),this.requestUpdate()}_closeTag(t,e){if(t){const s=e.title.split(","),i=s.findIndex(e=>e===t);i>-1&&(s.splice(i,1),e.title=s.join(",")),this.requestUpdate()}}_save(t){t?.stopImmediatePropagation(),this._title?this._answers.length<1?o("至少添加一个填空符!"):this._emit("save",{title:this._title.replaceAll(/ ______/g,"<filter></filter>"),answers:this._answers.map(t=>({title:t.title,isCorrect:!0})),analysis:this._analysis,isSetCorrectAnswer:!0,isKey:this.isKey,examAnswerSettingBO:{isIgnoreCase:this._isIgnoreCase,isInOrder:this._isInOrder},examRichTextContent:this._showRichText?this._richText:""}):o("题目标题不能为空!")}_renderPreview(){const e=this.title.replaceAll(/<filter><\/filter>/g," ______");return t.html`
|
|
6
|
+
<div class="preview">
|
|
7
|
+
<span class="title">${this.orderIndex+1}.${e}(填空题)</span>
|
|
8
|
+
${this.richTextContent?t.html`<div class="rich-text" .innerHTML=${this.richTextContent}></div>`:""}
|
|
9
|
+
${this._answers.some(t=>t.title)?t.html`
|
|
10
|
+
<div class="content flex flex-wrap">
|
|
11
|
+
<span>正确答案:</span>
|
|
12
|
+
${this._answers.map((e,s)=>e.title?t.html`
|
|
13
|
+
<span style="margin-right:10px">填空${s+1}: ${e.title}</span>
|
|
14
|
+
`:"")}
|
|
15
|
+
</div>
|
|
16
|
+
`:""}
|
|
17
|
+
${this.analysis?t.html`<div style="color:#909399;font-size:12px;margin-top:8px">解析: ${this.analysis}</div>`:""}
|
|
18
|
+
</div>
|
|
19
|
+
`}_renderEdit(){return t.html`
|
|
20
|
+
<div class="flex flex-items-start">
|
|
21
|
+
<div class="label"><span>题目:</span></div>
|
|
22
|
+
<div style="flex:1">
|
|
23
|
+
<div class="el-input">
|
|
24
|
+
<textarea rows="3" .value=${this._title} ?disabled=${this.isSave}
|
|
25
|
+
maxlength=${this.TITLE_MAX}
|
|
26
|
+
@input=${t=>this._onTitleInput(t)}
|
|
27
|
+
placeholder="【填空题】请输入问题"></textarea>
|
|
28
|
+
<span class="char-counter">${this._title.length}/${this.TITLE_MAX}</span>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
|
|
33
|
+
<div class="flex flex-justify-end">
|
|
34
|
+
<span class="el-link ${this.isSave?"is-disabled":""}"
|
|
35
|
+
@click=${()=>{this.isSave||this._addBlank()}}>插入填空符</span>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
<div class="flex flex-items-center" style="margin-top:12px">
|
|
39
|
+
<div class="label"><span>答题设置:</span></div>
|
|
40
|
+
<label class="el-checkbox">
|
|
41
|
+
<input type="checkbox" .checked=${this._isInOrder}
|
|
42
|
+
@change=${t=>{this._isInOrder=t.target.checked}} />
|
|
43
|
+
答案不分顺序
|
|
44
|
+
</label>
|
|
45
|
+
<label class="el-checkbox">
|
|
46
|
+
<input type="checkbox" .checked=${this._isIgnoreCase}
|
|
47
|
+
@change=${t=>{this._isIgnoreCase=t.target.checked}} />
|
|
48
|
+
忽略大小写
|
|
49
|
+
</label>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
${this._answers.map((e,s)=>t.html`
|
|
53
|
+
<div class="answer-item" style="margin-top:12px">
|
|
54
|
+
<div class="label"><span>第${s+1}空答案:</span></div>
|
|
55
|
+
<div class="answer-tags">
|
|
56
|
+
${e.title.split(",").filter(Boolean).map(s=>t.html`
|
|
57
|
+
<span class="el-tag">
|
|
58
|
+
${s}
|
|
59
|
+
${this.isSave?"":t.html`<span class="el-tag__close" @click=${()=>this._closeTag(s,e)}>×</span>`}
|
|
60
|
+
</span>
|
|
61
|
+
`)}
|
|
62
|
+
${this.isSave?"":t.html`
|
|
63
|
+
${e.showInput?t.html`
|
|
64
|
+
<input type="text" class="el-input--small"
|
|
65
|
+
@keydown=${t=>{"Enter"===t.key&&this._handleAddTag(e)}}
|
|
66
|
+
@input=${t=>{e.tag=t.target.value}}
|
|
67
|
+
@blur=${()=>this._handleAddTag(e)} />
|
|
68
|
+
`:t.html`
|
|
69
|
+
<span class="el-button--small" @click=${()=>{e.showInput=!0,this.requestUpdate(),this.updateComplete.then(()=>{this.shadowRoot?.querySelector(".el-input--small")?.focus()})}}>
|
|
70
|
+
${n}
|
|
71
|
+
<span>${e.title?"添加同义词":"添加答案"}</span>
|
|
72
|
+
</span>
|
|
73
|
+
`}
|
|
74
|
+
`}
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
`)}
|
|
78
|
+
|
|
79
|
+
${this._showRichText?t.html`
|
|
80
|
+
<div class="flex flex-items-start" style="margin-top:12px">
|
|
81
|
+
<div class="label"><span>富文本:</span></div>
|
|
82
|
+
<div style="flex:1">
|
|
83
|
+
<qxs-blocksuite-editor
|
|
84
|
+
content=${this._richText}
|
|
85
|
+
?is-edit=${!0}
|
|
86
|
+
></qxs-blocksuite-editor>
|
|
87
|
+
<div class="flex flex-justify-end" style="margin-top:8px">
|
|
88
|
+
<span class="el-link" style="color:#f56c6c" @click=${()=>{this._showRichText=!1,this._richText=""}}>删除富文本</span>
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
`:""}
|
|
93
|
+
|
|
94
|
+
${this.showAnalysis?t.html`
|
|
95
|
+
<div class="flex flex-items-start" style="margin-top:12px">
|
|
96
|
+
<div class="label"><span>解析:</span></div>
|
|
97
|
+
<div style="flex:1">
|
|
98
|
+
<div class="el-input">
|
|
99
|
+
<textarea rows="2" .value=${this._analysis}
|
|
100
|
+
@input=${t=>{this._analysis=t.target.value}}
|
|
101
|
+
placeholder="请输入题目解析"></textarea>
|
|
102
|
+
</div>
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
`:""}
|
|
106
|
+
`}render(){return t.html`
|
|
107
|
+
<qxs-subject-layout ?show-edit=${this.isEdit}>
|
|
108
|
+
<div slot="preview">${this._renderPreview()}</div>
|
|
109
|
+
<div slot="edit">${this._renderEdit()}</div>
|
|
110
|
+
${this.showAction?t.html`
|
|
111
|
+
<qxs-subject-action
|
|
112
|
+
?is-edit=${this.isEdit}
|
|
113
|
+
?is-set=${this.isSet}
|
|
114
|
+
?show-other-option=${!1}
|
|
115
|
+
exam-answer-relation-type=${this.examAnswerRelationType}
|
|
116
|
+
@delete=${()=>this._emit("delete")}
|
|
117
|
+
@save=${this._save}
|
|
118
|
+
@edit=${()=>this._emit("edit")}
|
|
119
|
+
@add=${t=>this._emit("add",t.detail)}
|
|
120
|
+
@set-key=${t=>{this._emit("set-key",t.detail)}}
|
|
121
|
+
@on-show-rich-text=${()=>{this._showRichText=!0}}
|
|
122
|
+
></qxs-subject-action>
|
|
123
|
+
`:""}
|
|
124
|
+
</qxs-subject-layout>
|
|
125
|
+
`}},exports.QxsBlankFill.styles=t.css`
|
|
126
|
+
:host { display: block; font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 12px; color: #5a5a5a; }
|
|
127
|
+
*, ::before, ::after { box-sizing: border-box; }
|
|
128
|
+
|
|
129
|
+
.preview { padding: 12px 0; }
|
|
130
|
+
.preview .title { font-size: 14px; color: #303133; }
|
|
131
|
+
.preview .rich-text { margin-top: 8px; }
|
|
132
|
+
.preview .rich-text img { max-width: 100%; }
|
|
133
|
+
.preview .content { color: #a8abb2; margin-top: 10px; }
|
|
134
|
+
|
|
135
|
+
.flex { display: flex; }
|
|
136
|
+
.flex-wrap { flex-wrap: wrap; }
|
|
137
|
+
.flex-items-center { display: flex; align-items: center; }
|
|
138
|
+
.flex-items-start { display: flex; align-items: flex-start; }
|
|
139
|
+
.flex-justify-end { display: flex; justify-content: flex-end; }
|
|
140
|
+
.label { min-width: 70px; font-size: 13px; color: #606266; }
|
|
141
|
+
|
|
142
|
+
textarea {
|
|
143
|
+
border: 1px solid #dcdfe6; border-radius: 3px; padding: 5px 11px;
|
|
144
|
+
font-size: 13px; font-family: inherit; width: 100%; resize: none; transition: border-color .2s;
|
|
145
|
+
line-height: 1.5; display: block; box-sizing: border-box;
|
|
146
|
+
}
|
|
147
|
+
textarea:focus { border-color: #3D61E3; outline: none; }
|
|
148
|
+
textarea:disabled { background: #f5f7fa; color: #c0c4cc; cursor: not-allowed; }
|
|
149
|
+
.el-input { position: relative; display: block; }
|
|
150
|
+
.el-input textarea { padding-bottom: 24px; }
|
|
151
|
+
.el-input .char-counter {
|
|
152
|
+
position: absolute; right: 12px; bottom: 8px;
|
|
153
|
+
font-size: 12px; color: #909399; line-height: 1; pointer-events: none;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/* Tag style */
|
|
157
|
+
.el-tag {
|
|
158
|
+
display: inline-flex; align-items: center; height: 24px; padding: 0 9px;
|
|
159
|
+
font-size: 12px; line-height: 1; color: #3D61E3; background: #ecf5ff;
|
|
160
|
+
border: 1px solid #d9ecff; border-radius: 4px; white-space: nowrap;
|
|
161
|
+
}
|
|
162
|
+
.el-tag .el-tag__close {
|
|
163
|
+
display: inline-flex; align-items: center; justify-content: center;
|
|
164
|
+
margin-left: 4px; width: 16px; height: 16px; border-radius: 50%;
|
|
165
|
+
font-size: 12px; color: #909399; cursor: pointer; transition: all .2s;
|
|
166
|
+
}
|
|
167
|
+
.el-tag .el-tag__close:hover { background: #909399; color: #fff; }
|
|
168
|
+
|
|
169
|
+
/* Button small style */
|
|
170
|
+
.el-button--small {
|
|
171
|
+
display: inline-flex; align-items: center; gap: 4px;
|
|
172
|
+
height: 24px; padding: 0 10px; font-size: 12px; line-height: 1;
|
|
173
|
+
border: 1px solid #dcdfe6; border-radius: 3px; background: #fff; color: #606266;
|
|
174
|
+
cursor: pointer; transition: all .2s; white-space: nowrap;
|
|
175
|
+
}
|
|
176
|
+
.el-button--small:hover { color: #3D61E3; border-color: #c6e2ff; background-color: #ecf5ff; }
|
|
177
|
+
|
|
178
|
+
/* Link style */
|
|
179
|
+
.el-link { color: #3D61E3; cursor: pointer; font-size: 12px; text-decoration: none; }
|
|
180
|
+
.el-link:hover { color: #2D4CB8; }
|
|
181
|
+
.el-link.is-disabled { color: #c0c4cc; cursor: not-allowed; }
|
|
182
|
+
|
|
183
|
+
/* Input small for tag */
|
|
184
|
+
.el-input--small { width: 80px; }
|
|
185
|
+
.el-input--small input {
|
|
186
|
+
height: 24px; padding: 0 8px; font-size: 12px; line-height: 24px;
|
|
187
|
+
border: 1px solid #dcdfe6; border-radius: 3px; width: 100%;
|
|
188
|
+
}
|
|
189
|
+
.el-input--small input:focus { border-color: #3D61E3; outline: none; }
|
|
190
|
+
|
|
191
|
+
/* Checkbox style */
|
|
192
|
+
.el-checkbox {
|
|
193
|
+
display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
|
|
194
|
+
font-size: 13px; color: #606266; user-select: none; margin-right: 16px;
|
|
195
|
+
}
|
|
196
|
+
.el-checkbox input[type="checkbox"] {
|
|
197
|
+
width: 14px; height: 14px; cursor: pointer; accent-color: #3D61E3;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.answer-item { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
|
|
201
|
+
.answer-item .label { min-width: 70px; padding-top: 0; color: #909399; }
|
|
202
|
+
.answer-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: 1; }
|
|
203
|
+
`,r([e.property({type:Number,attribute:"order-index"})],exports.QxsBlankFill.prototype,"orderIndex",2),r([e.property({type:String})],exports.QxsBlankFill.prototype,"title",2),r([e.property({type:Boolean,attribute:"is-edit"})],exports.QxsBlankFill.prototype,"isEdit",2),r([e.property({type:Boolean,attribute:"is-save"})],exports.QxsBlankFill.prototype,"isSave",2),r([e.property({type:Boolean,attribute:"is-set"})],exports.QxsBlankFill.prototype,"isSet",2),r([e.property({type:Boolean,attribute:"is-key"})],exports.QxsBlankFill.prototype,"isKey",2),r([e.property({type:Boolean,attribute:"show-action"})],exports.QxsBlankFill.prototype,"showAction",2),r([e.property({type:Boolean,attribute:"show-analysis"})],exports.QxsBlankFill.prototype,"showAnalysis",2),r([e.property({type:String,attribute:"rich-text-content"})],exports.QxsBlankFill.prototype,"richTextContent",2),r([e.property({type:String})],exports.QxsBlankFill.prototype,"analysis",2),r([e.property({type:Number,attribute:"exam-answer-relation-type"})],exports.QxsBlankFill.prototype,"examAnswerRelationType",2),r([e.property({type:String,attribute:"exam-expand"})],exports.QxsBlankFill.prototype,"examExpand",2),r([e.property({type:Object,attribute:"exam-answer-setting"})],exports.QxsBlankFill.prototype,"examAnswerSetting",2),r([e.property({type:Array,attribute:"answer-list"})],exports.QxsBlankFill.prototype,"answerList",2),r([s.state()],exports.QxsBlankFill.prototype,"_title",2),r([s.state()],exports.QxsBlankFill.prototype,"_analysis",2),r([s.state()],exports.QxsBlankFill.prototype,"_answers",2),r([s.state()],exports.QxsBlankFill.prototype,"_isInOrder",2),r([s.state()],exports.QxsBlankFill.prototype,"_isIgnoreCase",2),r([s.state()],exports.QxsBlankFill.prototype,"_showRichText",2),r([s.state()],exports.QxsBlankFill.prototype,"_richText",2),exports.QxsBlankFill=r([i.safeCustomElement("qxs-blank-fill")],exports.QxsBlankFill);
|
|
204
|
+
//# sourceMappingURL=blank-fill.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blank-fill.cjs","sources":["../../../../packages/components-wc/src/subject/blank-fill.ts"],"sourcesContent":["import { css, html, LitElement } from 'lit'\nimport { property, state } from 'lit/decorators.js'\nimport { safeCustomElement } from '../base/define'\n\ninterface BlankAnswer { title: string, tag: string, showInput: boolean }\n\nconst iconPlus = html`\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\"\n stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <line x1=\"12\" y1=\"5\" x2=\"12\" y2=\"19\"/><line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\"/>\n </svg>`\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-blank-fill')\nexport class QxsBlankFill extends LitElement {\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 .content { color: #a8abb2; margin-top: 10px; }\n\n .flex { display: flex; }\n .flex-wrap { flex-wrap: wrap; }\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: 70px; 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 /* Tag style */\n .el-tag {\n display: inline-flex; align-items: center; height: 24px; padding: 0 9px;\n font-size: 12px; line-height: 1; color: #3D61E3; background: #ecf5ff;\n border: 1px solid #d9ecff; border-radius: 4px; white-space: nowrap;\n }\n .el-tag .el-tag__close {\n display: inline-flex; align-items: center; justify-content: center;\n margin-left: 4px; width: 16px; height: 16px; border-radius: 50%;\n font-size: 12px; color: #909399; cursor: pointer; transition: all .2s;\n }\n .el-tag .el-tag__close:hover { background: #909399; color: #fff; }\n\n /* Button small style */\n .el-button--small {\n display: inline-flex; align-items: center; gap: 4px;\n height: 24px; padding: 0 10px; font-size: 12px; line-height: 1;\n border: 1px solid #dcdfe6; border-radius: 3px; background: #fff; color: #606266;\n cursor: pointer; transition: all .2s; white-space: nowrap;\n }\n .el-button--small:hover { color: #3D61E3; border-color: #c6e2ff; background-color: #ecf5ff; }\n\n /* Link style */\n .el-link { color: #3D61E3; cursor: pointer; font-size: 12px; text-decoration: none; }\n .el-link:hover { color: #2D4CB8; }\n .el-link.is-disabled { color: #c0c4cc; cursor: not-allowed; }\n\n /* Input small for tag */\n .el-input--small { width: 80px; }\n .el-input--small input {\n height: 24px; padding: 0 8px; font-size: 12px; line-height: 24px;\n border: 1px solid #dcdfe6; border-radius: 3px; width: 100%;\n }\n .el-input--small input:focus { border-color: #3D61E3; outline: none; }\n\n /* Checkbox style */\n .el-checkbox {\n display: inline-flex; align-items: center; gap: 6px; cursor: pointer;\n font-size: 13px; color: #606266; user-select: none; margin-right: 16px;\n }\n .el-checkbox input[type=\"checkbox\"] {\n width: 14px; height: 14px; cursor: pointer; accent-color: #3D61E3;\n }\n\n .answer-item { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }\n .answer-item .label { min-width: 70px; padding-top: 0; color: #909399; }\n .answer-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: 1; }\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 } = { isInOrder: false, isIgnoreCase: true }\n\n @property({ type: Array, attribute: 'answer-list' }) answerList: any[] = []\n\n @state() private _title = ''\n @state() private _analysis = ''\n @state() private _answers: BlankAnswer[] = [{ title: '', tag: '', showInput: false }]\n @state() private _isInOrder = false\n @state() private _isIgnoreCase = true\n @state() private _showRichText = false\n @state() private _richText = ''\n\n private readonly TITLE_MAX = 400\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 || '').replaceAll(/<filter><\\/filter>/g, ' ______')\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 else {\n const blankCount = (this._title.match(/ ______/g) || []).length || 1\n this._answers = Array.from({ length: blankCount }, () => ({ title: '', tag: '', showInput: false }))\n }\n if (this.examAnswerSetting) {\n this._isInOrder = !!this.examAnswerSetting.isInOrder\n this._isIgnoreCase = !!this.examAnswerSetting.isIgnoreCase\n }\n if (this.richTextContent) { this._richText = this.richTextContent; this._showRichText = true }\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 _addBlank() {\n this._title += ' ______'\n this._answers = [...this._answers, { title: '', tag: '', showInput: false }]\n this.requestUpdate()\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 const blankCount = (this._title.match(/ ______/g) || []).length\n if (blankCount !== this._answers.length) {\n if (blankCount > this._answers.length) {\n for (let i = this._answers.length; i < blankCount; i++) {\n this._answers = [...this._answers, { title: '', tag: '', showInput: false }]\n }\n }\n else {\n this._answers = this._answers.slice(0, blankCount)\n }\n }\n }\n\n private _handleAddTag(item: BlankAnswer) {\n item.showInput = false\n if (item.tag) {\n item.title = item.title ? [item.title, item.tag].join(',') : item.tag\n item.tag = ''\n }\n this.requestUpdate()\n }\n\n private _closeTag(tag: string, item: BlankAnswer) {\n if (tag) {\n const tags = item.title.split(',')\n const idx = tags.findIndex((t: string) => t === tag)\n if (idx > -1) { tags.splice(idx, 1); item.title = tags.join(',') }\n this.requestUpdate()\n }\n }\n\n private _save(e?: Event) {\n e?.stopImmediatePropagation()\n if (!this._title) { showToast('题目标题不能为空!'); return }\n if (this._answers.length < 1) { showToast('至少添加一个填空符!'); return }\n this._emit('save', {\n title: this._title.replaceAll(/ ______/g, '<filter></filter>'),\n answers: this._answers.map(a => ({ title: a.title, isCorrect: true })),\n analysis: this._analysis,\n isSetCorrectAnswer: true,\n isKey: this.isKey,\n examAnswerSettingBO: { isIgnoreCase: this._isIgnoreCase, isInOrder: this._isInOrder },\n examRichTextContent: this._showRichText ? this._richText : '',\n })\n }\n\n private _renderPreview() {\n const displayTitle = this.title.replaceAll(/<filter><\\/filter>/g, ' ______')\n return html`\n <div class=\"preview\">\n <span class=\"title\">${this.orderIndex + 1}.${displayTitle}(填空题)</span>\n ${this.richTextContent ? html`<div class=\"rich-text\" .innerHTML=${this.richTextContent}></div>` : ''}\n ${this._answers.some(a => a.title)\n ? html`\n <div class=\"content flex flex-wrap\">\n <span>正确答案:</span>\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.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 flex-items-start\">\n <div class=\"label\"><span>题目:</span></div>\n <div style=\"flex:1\">\n <div class=\"el-input\">\n <textarea rows=\"3\" .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 flex-justify-end\">\n <span class=\"el-link ${this.isSave ? 'is-disabled' : ''}\"\n @click=${() => {\n if (!this.isSave) { this._addBlank() }\n }}>插入填空符</span>\n </div>\n\n <div class=\"flex flex-items-center\" style=\"margin-top:12px\">\n <div class=\"label\"><span>答题设置:</span></div>\n <label class=\"el-checkbox\">\n <input type=\"checkbox\" .checked=${this._isInOrder}\n @change=${(e: Event) => { this._isInOrder = (e.target as HTMLInputElement).checked }} />\n 答案不分顺序\n </label>\n <label class=\"el-checkbox\">\n <input type=\"checkbox\" .checked=${this._isIgnoreCase}\n @change=${(e: Event) => { this._isIgnoreCase = (e.target as HTMLInputElement).checked }} />\n 忽略大小写\n </label>\n </div>\n\n ${this._answers.map((a, i) => html`\n <div class=\"answer-item\" style=\"margin-top:12px\">\n <div class=\"label\"><span>第${i + 1}空答案:</span></div>\n <div class=\"answer-tags\">\n ${a.title.split(',').filter(Boolean).map(tag => html`\n <span class=\"el-tag\">\n ${tag}\n ${!this.isSave ? html`<span class=\"el-tag__close\" @click=${() => this._closeTag(tag, a)}>×</span>` : ''}\n </span>\n `)}\n ${!this.isSave\n ? html`\n ${a.showInput\n ? html`\n <input type=\"text\" class=\"el-input--small\"\n @keydown=${(e: KeyboardEvent) => {\n if (e.key === 'Enter') { this._handleAddTag(a) }\n }}\n @input=${(e: Event) => { a.tag = (e.target as HTMLInputElement).value }}\n @blur=${() => this._handleAddTag(a)} />\n `\n : html`\n <span class=\"el-button--small\" @click=${() => { a.showInput = true; this.requestUpdate(); this.updateComplete.then(() => { (this.shadowRoot?.querySelector('.el-input--small') as HTMLInputElement)?.focus() }) }}>\n ${iconPlus}\n <span>${a.title ? '添加同义词' : '添加答案'}</span>\n </span>\n `}\n `\n : ''}\n </div>\n </div>\n `)}\n\n ${this._showRichText\n ? html`\n <div class=\"flex 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 flex-justify-end\" style=\"margin-top:8px\">\n <span class=\"el-link\" style=\"color:#f56c6c\" @click=${() => { this._showRichText = false; this._richText = '' }}>删除富文本</span>\n </div>\n </div>\n </div>\n `\n : ''}\n\n ${this.showAnalysis\n ? html`\n <div class=\"flex 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":["iconPlus","html","showToast","msg","el","document","createElement","textContent","Object","assign","style","position","top","left","transform","padding","borderRadius","fontSize","color","background","zIndex","boxShadow","transition","opacity","body","appendChild","setTimeout","remove","QxsBlankFill","LitElement","constructor","super","arguments","this","orderIndex","title","isEdit","isSave","isSet","isKey","showAction","showAnalysis","richTextContent","analysis","examAnswerRelationType","examExpand","examAnswerSetting","isInOrder","isIgnoreCase","answerList","_title","_analysis","_answers","tag","showInput","_isInOrder","_isIgnoreCase","_showRichText","_richText","TITLE_MAX","updated","changed","has","_syncProps","replaceAll","length","map","a","blankCount","match","Array","from","_emit","name","detail","dispatchEvent","CustomEvent","bubbles","composed","_addBlank","requestUpdate","_onTitleInput","e","target","value","slice","i","_handleAddTag","item","join","_closeTag","tags","split","idx","findIndex","t","splice","_save","stopImmediatePropagation","answers","isCorrect","isSetCorrectAnswer","examAnswerSettingBO","examRichTextContent","_renderPreview","displayTitle","some","_renderEdit","checked","filter","Boolean","key","updateComplete","then","shadowRoot","querySelector","focus","render","styles","css","__decorateClass","property","type","Number","attribute","prototype","String","state","safeCustomElement"],"mappings":"+eAMA,MAAMA,EAAWC,EAAAA,IAAA;;;;UAMjB,SAASC,EAAUC,GACjB,MAAMC,EAAKC,SAASC,cAAc,OAClCF,EAAGG,YAAcJ,EACjBK,OAAOC,OAAOL,EAAGM,MAAO,CACtBC,SAAU,QAASC,IAAK,OAAQC,KAAM,MAAOC,UAAW,mBACxDC,QAAS,YAAaC,aAAc,MAAOC,SAAU,OAAQC,MAAO,OACpEC,WAAY,UAAWC,OAAQ,QAASC,UAAW,6BACnDC,WAAY,cAAeC,QAAS,MAEtClB,SAASmB,KAAKC,YAAYrB,GAC1BsB,WAAW,KAAQtB,EAAGM,MAAMa,QAAU,IAAKG,WAAW,IAAMtB,EAAGuB,SAAU,MAAQ,KACnF,CAGaC,QAAAA,aAAN,cAA2BC,EAAAA,WAA3BC,WAAAA,GAAAC,SAAAC,WAiFiDC,KAAAC,WAAa,EACvCD,KAAAE,MAAQ,GACeF,KAAAG,QAAS,EACTH,KAAAI,QAAS,EACVJ,KAAAK,OAAQ,EACRL,KAAAM,OAAQ,EACHN,KAAAO,YAAa,EACXP,KAAAQ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iG,UAAA,WAAA,GACwCL,EAAA,CAAnEC,EAAAA,SAAS,CAAEC,KAAMC,OAAQC,UAAW,+BA3F1BhG,QAAAA,aA2FyDiG,UAAA,yBAAA,GACdL,EAAA,CAArDC,EAAAA,SAAS,CAAEC,KAAMI,OAAQF,UAAW,iBA5F1BhG,QAAAA,aA4F2CiG,UAAA,aAAA,GAEtDL,EAAA,CADCC,EAAAA,SAAS,CAAEC,KAAMlH,OAAQoH,UAAW,yBA7F1BhG,QAAAA,aA8FXiG,UAAA,oBAAA,GAEqDL,EAAA,CAApDC,EAAAA,SAAS,CAAEC,KAAMpD,MAAOsD,UAAW,iBAhGzBhG,QAAAA,aAgG0CiG,UAAA,aAAA,GAEpCL,EAAA,CAAhBO,EAAAA,SAlGUnG,QAAAA,aAkGMiG,UAAA,SAAA,GACAL,EAAA,CAAhBO,EAAAA,SAnGUnG,QAAAA,aAmGMiG,UAAA,YAAA,GACAL,EAAA,CAAhBO,EAAAA,SApGUnG,QAAAA,aAoGMiG,UAAA,WAAA,GACAL,EAAA,CAAhBO,EAAAA,SArGUnG,QAAAA,aAqGMiG,UAAA,aAAA,GACAL,EAAA,CAAhBO,EAAAA,SAtGUnG,QAAAA,aAsGMiG,UAAA,gBAAA,GACAL,EAAA,CAAhBO,EAAAA,SAvGUnG,QAAAA,aAuGMiG,UAAA,gBAAA,GACAL,EAAA,CAAhBO,EAAAA,SAxGUnG,QAAAA,aAwGMiG,UAAA,YAAA,GAxGNjG,QAAAA,aAAN4F,EAAA,CADNQ,EAAAA,kBAAkB,mBACNpG,QAAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";var t=require("lit"),e=require("../node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/property.cjs"),s=require("../base/define.cjs"),o=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=(t,e,s,i)=>{for(var a,l=i>1?void 0:i?r(e,s):e,d=t.length-1;d>=0;d--)(a=t[d])&&(l=(i?a(e,s,l):a(l))||l);return i&&l&&o(e,s,l),l};exports.QxsSubjectLayout=class extends t.LitElement{constructor(){super(...arguments),this.showEdit=!1}render(){return this.showEdit?t.html`
|
|
2
|
+
<div class="layout">
|
|
3
|
+
<div class="edit">
|
|
4
|
+
<slot name="edit"></slot>
|
|
5
|
+
<slot></slot>
|
|
6
|
+
</div>
|
|
7
|
+
</div>
|
|
8
|
+
`:t.html`
|
|
9
|
+
<div class="layout">
|
|
10
|
+
<slot name="preview"></slot>
|
|
11
|
+
<slot></slot>
|
|
12
|
+
</div>
|
|
13
|
+
`}},exports.QxsSubjectLayout.styles=t.css`
|
|
14
|
+
:host { display: block; width: 100%; font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 12px; color: #5a5a5a; }
|
|
15
|
+
.layout { padding: 10px; }
|
|
16
|
+
.edit { position: relative; padding: 12px 10px 10px; background-color: #f6f7fb; border-radius: 8px; }
|
|
17
|
+
`,i([e.property({type:Boolean,attribute:"show-edit"})],exports.QxsSubjectLayout.prototype,"showEdit",2),exports.QxsSubjectLayout=i([s.safeCustomElement("qxs-subject-layout")],exports.QxsSubjectLayout);
|
|
18
|
+
//# sourceMappingURL=layout.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.cjs","sources":["../../../../packages/components-wc/src/subject/layout.ts"],"sourcesContent":["import { css, html, LitElement } from 'lit'\nimport { property } from 'lit/decorators.js'\nimport { safeCustomElement } from '../base/define'\n\n@safeCustomElement('qxs-subject-layout')\nexport class QxsSubjectLayout extends LitElement {\n static styles = css`\n :host { display: block; width: 100%; font-family: system-ui, -apple-system, \"PingFang SC\", \"Microsoft YaHei\", sans-serif; font-size: 12px; color: #5a5a5a; }\n .layout { padding: 10px; }\n .edit { position: relative; padding: 12px 10px 10px; background-color: #f6f7fb; border-radius: 8px; }\n `\n\n @property({ type: Boolean, attribute: 'show-edit' }) showEdit = false\n\n render() {\n if (this.showEdit) {\n return html`\n <div class=\"layout\">\n <div class=\"edit\">\n <slot name=\"edit\"></slot>\n <slot></slot>\n </div>\n </div>\n `\n }\n return html`\n <div class=\"layout\">\n <slot name=\"preview\"></slot>\n <slot></slot>\n </div>\n `\n }\n}\n\nexport function register() {}\n"],"names":["QxsSubjectLayout","LitElement","constructor","super","arguments","this","showEdit","render","html","styles","css","__decorateClass","property","type","Boolean","attribute","prototype","safeCustomElement"],"mappings":"wXAKaA,QAAAA,iBAAN,cAA+BC,EAAAA,WAA/BC,WAAAA,GAAAC,SAAAC,WAOgDC,KAAAC,UAAW,CAAA,CAEhEC,MAAAA,GACE,OAAIF,KAAKC,SACAE,EAAAA,IAAA;;;;;;;QASFA,EAAAA,IAAA;;;;;KAMT,GA1BWR,QAAAA,iBACJS,OAASC,EAAAA,GAAA;;;;IAMqCC,EAAA,CAApDC,EAAAA,SAAS,CAAEC,KAAMC,QAASC,UAAW,eAP3Bf,QAAAA,iBAO0CgB,UAAA,WAAA,GAP1ChB,QAAAA,iBAANW,EAAA,CADNM,EAAAA,kBAAkB,uBACNjB,QAAAA"}
|