@webwriter/quiz 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +7 -0
- package/custom.d.ts +176 -0
- package/dist/widgets/webwriter-choice-item.css +444 -0
- package/dist/widgets/webwriter-choice-item.js +288 -0
- package/dist/widgets/webwriter-choice.css +444 -0
- package/dist/widgets/webwriter-choice.js +327 -0
- package/dist/widgets/webwriter-cloze-gap.css +444 -0
- package/dist/widgets/webwriter-cloze-gap.js +722 -0
- package/dist/widgets/webwriter-cloze.css +444 -0
- package/dist/widgets/webwriter-cloze.js +177 -0
- package/dist/widgets/webwriter-mark.css +444 -0
- package/dist/widgets/webwriter-mark.js +410 -0
- package/dist/widgets/webwriter-order-item.css +444 -0
- package/dist/widgets/webwriter-order-item.js +464 -0
- package/dist/widgets/webwriter-order.css +444 -0
- package/dist/widgets/webwriter-order.js +560 -0
- package/dist/widgets/webwriter-pairing-item.css +444 -0
- package/dist/widgets/webwriter-pairing-item.js +203 -0
- package/dist/widgets/webwriter-pairing.css +444 -0
- package/dist/widgets/webwriter-pairing.js +224 -0
- package/dist/widgets/webwriter-quiz.css +444 -0
- package/dist/widgets/webwriter-quiz.js +323 -0
- package/dist/widgets/webwriter-speech.css +444 -0
- package/dist/widgets/webwriter-speech.js +320 -0
- package/dist/widgets/webwriter-task-explainer.css +444 -0
- package/dist/widgets/webwriter-task-explainer.js +90 -0
- package/dist/widgets/webwriter-task-hint.css +444 -0
- package/dist/widgets/webwriter-task-hint.js +67 -0
- package/dist/widgets/webwriter-task-prompt.css +444 -0
- package/dist/widgets/webwriter-task-prompt.js +68 -0
- package/dist/widgets/webwriter-task.css +444 -0
- package/dist/widgets/webwriter-task.js +546 -0
- package/dist/widgets/webwriter-text.css +444 -0
- package/dist/widgets/webwriter-text.js +174 -0
- package/package.json +199 -0
- package/src/lib/combobox.ts +456 -0
- package/src/lib/highlighter-fill.svg +6 -0
- package/src/snippets/choice.html +8 -0
- package/src/snippets/cloze.html +4 -0
- package/src/snippets/mark.html +4 -0
- package/src/snippets/order.html +8 -0
- package/src/snippets/pairing.html +10 -0
- package/src/snippets/speech.html +4 -0
- package/src/snippets/text.html +4 -0
- package/src/snippets/wordsearch.html +4 -0
- package/src/widgets/webwriter-choice-item.ts +251 -0
- package/src/widgets/webwriter-choice.ts +310 -0
- package/src/widgets/webwriter-cloze-gap.ts +217 -0
- package/src/widgets/webwriter-cloze.ts +136 -0
- package/src/widgets/webwriter-mark.ts +435 -0
- package/src/widgets/webwriter-order-item.ts +445 -0
- package/src/widgets/webwriter-order.ts +273 -0
- package/src/widgets/webwriter-pairing-item.ts +156 -0
- package/src/widgets/webwriter-pairing.ts +188 -0
- package/src/widgets/webwriter-quiz.ts +281 -0
- package/src/widgets/webwriter-speech.ts +268 -0
- package/src/widgets/webwriter-task-explainer.ts +38 -0
- package/src/widgets/webwriter-task-hint.ts +17 -0
- package/src/widgets/webwriter-task-prompt.ts +18 -0
- package/src/widgets/webwriter-task.ts +544 -0
- package/src/widgets/webwriter-text.ts +131 -0
- package/tsconfig.json +7 -0
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
|
|
5
|
+
var __typeError = (msg) => {
|
|
6
|
+
throw TypeError(msg);
|
|
7
|
+
};
|
|
8
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
10
|
+
var __decoratorStart = (base) => [, , , __create(base?.[__knownSymbol("metadata")] ?? null)];
|
|
11
|
+
var __decoratorStrings = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"];
|
|
12
|
+
var __expectFn = (fn) => fn !== void 0 && typeof fn !== "function" ? __typeError("Function expected") : fn;
|
|
13
|
+
var __decoratorContext = (kind, name, done, metadata, fns) => ({ kind: __decoratorStrings[kind], name, metadata, addInitializer: (fn) => done._ ? __typeError("Already initialized") : fns.push(__expectFn(fn || null)) });
|
|
14
|
+
var __decoratorMetadata = (array, target) => __defNormalProp(target, __knownSymbol("metadata"), array[3]);
|
|
15
|
+
var __runInitializers = (array, flags, self, value) => {
|
|
16
|
+
for (var i = 0, fns = array[flags >> 1], n = fns && fns.length; i < n; i++) flags & 1 ? fns[i].call(self) : value = fns[i].call(self, value);
|
|
17
|
+
return value;
|
|
18
|
+
};
|
|
19
|
+
var __decorateElement = (array, flags, name, decorators, target, extra) => {
|
|
20
|
+
var fn, it, done, ctx, access, k = flags & 7, s = !!(flags & 8), p = !!(flags & 16);
|
|
21
|
+
var j = k > 3 ? array.length + 1 : k ? s ? 1 : 2 : 0, key = __decoratorStrings[k + 5];
|
|
22
|
+
var initializers = k > 3 && (array[j - 1] = []), extraInitializers = array[j] || (array[j] = []);
|
|
23
|
+
var desc = k && (!p && !s && (target = target.prototype), k < 5 && (k > 3 || !p) && __getOwnPropDesc(k < 4 ? target : { get [name]() {
|
|
24
|
+
return __privateGet(this, extra);
|
|
25
|
+
}, set [name](x) {
|
|
26
|
+
return __privateSet(this, extra, x);
|
|
27
|
+
} }, name));
|
|
28
|
+
k ? p && k < 4 && __name(extra, (k > 2 ? "set " : k > 1 ? "get " : "") + name) : __name(target, name);
|
|
29
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
30
|
+
ctx = __decoratorContext(k, name, done = {}, array[3], extraInitializers);
|
|
31
|
+
if (k) {
|
|
32
|
+
ctx.static = s, ctx.private = p, access = ctx.access = { has: p ? (x) => __privateIn(target, x) : (x) => name in x };
|
|
33
|
+
if (k ^ 3) access.get = p ? (x) => (k ^ 1 ? __privateGet : __privateMethod)(x, target, k ^ 4 ? extra : desc.get) : (x) => x[name];
|
|
34
|
+
if (k > 2) access.set = p ? (x, y) => __privateSet(x, target, y, k ^ 4 ? extra : desc.set) : (x, y) => x[name] = y;
|
|
35
|
+
}
|
|
36
|
+
it = (0, decorators[i])(k ? k < 4 ? p ? extra : desc[key] : k > 4 ? void 0 : { get: desc.get, set: desc.set } : target, ctx), done._ = 1;
|
|
37
|
+
if (k ^ 4 || it === void 0) __expectFn(it) && (k > 4 ? initializers.unshift(it) : k ? p ? extra = it : desc[key] = it : target = it);
|
|
38
|
+
else if (typeof it !== "object" || it === null) __typeError("Object expected");
|
|
39
|
+
else __expectFn(fn = it.get) && (desc.get = fn), __expectFn(fn = it.set) && (desc.set = fn), __expectFn(fn = it.init) && initializers.unshift(fn);
|
|
40
|
+
}
|
|
41
|
+
return k || __decoratorMetadata(array, target), desc && __defProp(target, name, desc), p ? k ^ 4 ? extra : desc : target;
|
|
42
|
+
};
|
|
43
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
44
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
45
|
+
var __privateIn = (member, obj) => Object(obj) !== obj ? __typeError('Cannot use the "in" operator on this value') : member.has(obj);
|
|
46
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
47
|
+
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
48
|
+
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
49
|
+
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
50
|
+
|
|
51
|
+
// src/widgets/webwriter-choice.ts
|
|
52
|
+
import { html, css } from "lit";
|
|
53
|
+
import { LitElementWw, option, action } from "@webwriter/lit";
|
|
54
|
+
import { customElement, property, queryAssignedElements, query } from "lit/decorators.js";
|
|
55
|
+
import SlButton from "@shoelace-style/shoelace/dist/components/button/button.component.js";
|
|
56
|
+
import SlIcon from "@shoelace-style/shoelace/dist/components/icon/icon.component.js";
|
|
57
|
+
import SlRadio from "@shoelace-style/shoelace/dist/components/radio/radio.component.js";
|
|
58
|
+
import SlCheckbox from "@shoelace-style/shoelace/dist/components/checkbox/checkbox.component.js";
|
|
59
|
+
import SlRadioButton from "@shoelace-style/shoelace/dist/components/radio-button/radio-button.component.js";
|
|
60
|
+
import SlRadioGroup from "@shoelace-style/shoelace/dist/components/radio-group/radio-group.component.js";
|
|
61
|
+
|
|
62
|
+
// ../../node_modules/bootstrap-icons/icons/plus-square.svg
|
|
63
|
+
var plus_square_default = 'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-plus-square" viewBox="0 0 16 16">%0A <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z"/>%0A <path d="M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4"/>%0A</svg>';
|
|
64
|
+
|
|
65
|
+
// ../../node_modules/bootstrap-icons/icons/plus-circle.svg
|
|
66
|
+
var plus_circle_default = 'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-plus-circle" viewBox="0 0 16 16">%0A <path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16"/>%0A <path d="M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4"/>%0A</svg>';
|
|
67
|
+
|
|
68
|
+
// src/widgets/webwriter-choice.ts
|
|
69
|
+
function shuffle(a) {
|
|
70
|
+
for (let i = a.length - 1; i > 0; i--) {
|
|
71
|
+
const j = Math.floor(Math.random() * (i + 1));
|
|
72
|
+
[a[i], a[j]] = [a[j], a[i]];
|
|
73
|
+
}
|
|
74
|
+
return a;
|
|
75
|
+
}
|
|
76
|
+
var _itemsSlotEl_dec, _value_dec, _items_dec, _addItem_dec, _slotEl_dec, _randomOrder_dec, _layout_dec, _mode_dec, _a, _WebwriterChoice_decorators, _init, _mode, _randomOrder, _slotEl, _items, _value, _itemsSlotEl;
|
|
77
|
+
_WebwriterChoice_decorators = [customElement("webwriter-choice")];
|
|
78
|
+
var WebwriterChoice = class extends (_a = LitElementWw, _mode_dec = [property({ type: String, attribute: true, reflect: true }), option({
|
|
79
|
+
type: "select",
|
|
80
|
+
options: [
|
|
81
|
+
{ value: "truefalse", label: { "en": "True/False" } },
|
|
82
|
+
{ value: "single", label: { "en": "Single Choice" } },
|
|
83
|
+
{ value: "multiple", label: { "en": "Multiple Choice" } }
|
|
84
|
+
]
|
|
85
|
+
})], _layout_dec = [property({ type: String, attribute: true, reflect: true }), option({
|
|
86
|
+
type: "select",
|
|
87
|
+
options: [
|
|
88
|
+
{ value: "list", label: { "en": "List" } },
|
|
89
|
+
{ value: "tiles", label: { "en": "Tiles" } }
|
|
90
|
+
]
|
|
91
|
+
})], _randomOrder_dec = [property({ type: Boolean, attribute: true, reflect: true }), option({
|
|
92
|
+
type: Boolean,
|
|
93
|
+
label: { "en": "Random Choice Order" }
|
|
94
|
+
})], _slotEl_dec = [query("slot")], _addItem_dec = [action()], _items_dec = [queryAssignedElements()], _value_dec = [property({ type: Array, attribute: false })], _itemsSlotEl_dec = [query("#items-slot")], _a) {
|
|
95
|
+
constructor() {
|
|
96
|
+
super(...arguments);
|
|
97
|
+
__runInitializers(_init, 5, this);
|
|
98
|
+
__privateAdd(this, _mode, __runInitializers(_init, 8, this, "single")), __runInitializers(_init, 11, this);
|
|
99
|
+
__privateAdd(this, _randomOrder, __runInitializers(_init, 12, this, false)), __runInitializers(_init, 15, this);
|
|
100
|
+
__privateAdd(this, _slotEl, __runInitializers(_init, 16, this)), __runInitializers(_init, 19, this);
|
|
101
|
+
__privateAdd(this, _items, __runInitializers(_init, 20, this)), __runInitializers(_init, 23, this);
|
|
102
|
+
__privateAdd(this, _value, []);
|
|
103
|
+
__publicField(this, "handleControlChange", (e) => {
|
|
104
|
+
if (this.mode === "single") {
|
|
105
|
+
const item = e.target;
|
|
106
|
+
const otherItems = this.items.filter((el) => el !== item);
|
|
107
|
+
otherItems.forEach((el) => this.isContentEditable ? el.valid = false : el.active = false);
|
|
108
|
+
}
|
|
109
|
+
this.applyValue();
|
|
110
|
+
this.dispatchEvent(new CustomEvent("ww-answer-change", {
|
|
111
|
+
detail: { value: this.value },
|
|
112
|
+
bubbles: true,
|
|
113
|
+
composed: true
|
|
114
|
+
}));
|
|
115
|
+
});
|
|
116
|
+
__privateAdd(this, _itemsSlotEl, __runInitializers(_init, 24, this)), __runInitializers(_init, 27, this);
|
|
117
|
+
}
|
|
118
|
+
get layout() {
|
|
119
|
+
return this.children?.item(0)?.getAttribute("layout") ?? "list";
|
|
120
|
+
}
|
|
121
|
+
set layout(value) {
|
|
122
|
+
this.querySelectorAll("webwriter-choice-item").forEach((el) => el.setAttribute("layout", value));
|
|
123
|
+
this.requestUpdate("layout");
|
|
124
|
+
}
|
|
125
|
+
get solution() {
|
|
126
|
+
const validIDs = this.items.filter((item) => item.valid).map((item) => item.id);
|
|
127
|
+
return validIDs.length ? validIDs : void 0;
|
|
128
|
+
}
|
|
129
|
+
set solution(value) {
|
|
130
|
+
this.items.forEach((item) => value.includes(item.id) ? item.valid = true : null);
|
|
131
|
+
}
|
|
132
|
+
reportSolution() {
|
|
133
|
+
if (!this.solution) {
|
|
134
|
+
this.items.forEach((item) => item.valid = true);
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
this.items.forEach((item) => item.valid = (this.solution ?? []).includes(item.id));
|
|
138
|
+
}
|
|
139
|
+
reset() {
|
|
140
|
+
this.items.forEach((item) => {
|
|
141
|
+
item.valid = void 0;
|
|
142
|
+
item.active = false;
|
|
143
|
+
});
|
|
144
|
+
this.shuffleItems();
|
|
145
|
+
}
|
|
146
|
+
addItem() {
|
|
147
|
+
const choiceItem = this.ownerDocument.createElement("webwriter-choice-item");
|
|
148
|
+
const p = this.ownerDocument.createElement("p");
|
|
149
|
+
choiceItem.appendChild(p);
|
|
150
|
+
choiceItem.setAttribute("layout", this.layout);
|
|
151
|
+
this.appendChild(choiceItem);
|
|
152
|
+
this.ownerDocument.getSelection().setBaseAndExtent(p, 0, p, 0);
|
|
153
|
+
}
|
|
154
|
+
shuffleItems() {
|
|
155
|
+
const items = this.slotEl.assignedElements();
|
|
156
|
+
const n = items.length;
|
|
157
|
+
const nums = shuffle([...new Array(n).keys()]);
|
|
158
|
+
items.forEach((el, i) => el.style.order = String(nums[i]));
|
|
159
|
+
}
|
|
160
|
+
connectedCallback() {
|
|
161
|
+
super.connectedCallback();
|
|
162
|
+
const observer = new MutationObserver(() => {
|
|
163
|
+
if (!this.contentEditable && this.randomOrder) {
|
|
164
|
+
this.shuffleItems();
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
observer.observe(this, { childList: true });
|
|
168
|
+
}
|
|
169
|
+
firstUpdated(_changedProperties) {
|
|
170
|
+
if (!this.contentEditable && this.randomOrder) {
|
|
171
|
+
this.shuffleItems();
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
get value() {
|
|
175
|
+
return __privateGet(this, _value);
|
|
176
|
+
}
|
|
177
|
+
set value(value) {
|
|
178
|
+
__privateSet(this, _value, value);
|
|
179
|
+
this.items.forEach((item, i) => {
|
|
180
|
+
this.isContentEditable ? item.valid = __privateGet(this, _value).includes(i) : item.active = __privateGet(this, _value).includes(i);
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
applyValue() {
|
|
184
|
+
__privateSet(this, _value, this.items.map((item, i) => [item.valid, i]).filter(([valid]) => valid).map(([_, i]) => i));
|
|
185
|
+
}
|
|
186
|
+
handleSlotChange(e) {
|
|
187
|
+
this.requestUpdate();
|
|
188
|
+
}
|
|
189
|
+
willUpdate(changed) {
|
|
190
|
+
if (changed.has("mode") && this.mode === "single") {
|
|
191
|
+
this.items.filter((el) => this.isContentEditable ? el.valid : el.active).slice(1).forEach((el) => this.isContentEditable ? el.valid = false : el.active = false);
|
|
192
|
+
}
|
|
193
|
+
if (changed.has("mode") && this.mode === "truefalse") {
|
|
194
|
+
this.items.forEach((el) => el.remove());
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
render() {
|
|
198
|
+
return html`
|
|
199
|
+
${this.mode === "truefalse" ? html`
|
|
200
|
+
<sl-radio-group>
|
|
201
|
+
<sl-radio-button value="true">True</sl-radio-button>
|
|
202
|
+
<sl-radio-button value="false">False</sl-radio-button>
|
|
203
|
+
</sl-radio-group>
|
|
204
|
+
` : html`
|
|
205
|
+
<slot id="items-slot" @sl-change=${this.handleControlChange} @slotchange=${this.handleSlotChange}></slot>
|
|
206
|
+
`}
|
|
207
|
+
<sl-button size="small" id="add-option" class="author-only" @click=${() => this.addItem()}>
|
|
208
|
+
<sl-icon src=${this.mode === "multiple" ? plus_square_default : plus_circle_default}></sl-icon><span>Add Option</span>
|
|
209
|
+
</sl-button>
|
|
210
|
+
`;
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
_init = __decoratorStart(_a);
|
|
214
|
+
_mode = new WeakMap();
|
|
215
|
+
_randomOrder = new WeakMap();
|
|
216
|
+
_slotEl = new WeakMap();
|
|
217
|
+
_items = new WeakMap();
|
|
218
|
+
_value = new WeakMap();
|
|
219
|
+
_itemsSlotEl = new WeakMap();
|
|
220
|
+
__decorateElement(_init, 4, "mode", _mode_dec, WebwriterChoice, _mode);
|
|
221
|
+
__decorateElement(_init, 3, "layout", _layout_dec, WebwriterChoice);
|
|
222
|
+
__decorateElement(_init, 4, "randomOrder", _randomOrder_dec, WebwriterChoice, _randomOrder);
|
|
223
|
+
__decorateElement(_init, 4, "slotEl", _slotEl_dec, WebwriterChoice, _slotEl);
|
|
224
|
+
__decorateElement(_init, 1, "addItem", _addItem_dec, WebwriterChoice);
|
|
225
|
+
__decorateElement(_init, 4, "items", _items_dec, WebwriterChoice, _items);
|
|
226
|
+
__decorateElement(_init, 3, "value", _value_dec, WebwriterChoice);
|
|
227
|
+
__decorateElement(_init, 4, "itemsSlotEl", _itemsSlotEl_dec, WebwriterChoice, _itemsSlotEl);
|
|
228
|
+
WebwriterChoice = __decorateElement(_init, 0, "WebwriterChoice", _WebwriterChoice_decorators, WebwriterChoice);
|
|
229
|
+
__publicField(WebwriterChoice, "scopedElements", {
|
|
230
|
+
"sl-button": SlButton,
|
|
231
|
+
"sl-icon": SlIcon,
|
|
232
|
+
"sl-radio": SlRadio,
|
|
233
|
+
"sl-checkbox": SlCheckbox,
|
|
234
|
+
"sl-radio-button": SlRadioButton,
|
|
235
|
+
"sl-radio-group": SlRadioGroup
|
|
236
|
+
});
|
|
237
|
+
__publicField(WebwriterChoice, "styles", css`
|
|
238
|
+
:host {
|
|
239
|
+
display: flex !important;
|
|
240
|
+
flex-direction: column;
|
|
241
|
+
align-items: flex-start;
|
|
242
|
+
gap: 0.5rem;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
:host([layout=tiles]) {
|
|
246
|
+
|
|
247
|
+
flex-direction: row;
|
|
248
|
+
flex-wrap: wrap;
|
|
249
|
+
gap: 15px;
|
|
250
|
+
|
|
251
|
+
& ::slotted(*) {
|
|
252
|
+
aspect-ratio: 1;
|
|
253
|
+
min-width: 125px;
|
|
254
|
+
width: 125px;
|
|
255
|
+
max-width: 350px;
|
|
256
|
+
min-height: 125px;
|
|
257
|
+
height: 125px;
|
|
258
|
+
max-height: 350px;
|
|
259
|
+
overflow: hidden;
|
|
260
|
+
resize: both;
|
|
261
|
+
border: 2px solid var(--sl-color-gray-500);
|
|
262
|
+
border-radius: 5px;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
sl-button::part(label) {
|
|
267
|
+
padding: 0;
|
|
268
|
+
display: flex;
|
|
269
|
+
flex-direction: row;
|
|
270
|
+
align-items: center;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
sl-button::part(base) {
|
|
274
|
+
border: none;
|
|
275
|
+
background: transparent;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
sl-icon {
|
|
279
|
+
width: 19px;
|
|
280
|
+
height: 19px;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
sl-icon::part(svg) {
|
|
284
|
+
overflow: visible;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
:host(:not([contenteditable=true]):not([contenteditable=""])) .author-only {
|
|
288
|
+
display: none !important;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
#add-option span {
|
|
292
|
+
margin-inline-start: 0.5em;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
:host(:is([contenteditable=true], [contenteditable=""])) ::slotted(*) {
|
|
296
|
+
order: unset !important;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
:host(:not([mode=multiple])) {
|
|
300
|
+
--webwriter-choice-radius: 100%;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
#add-option:not(:hover)::part(base) {
|
|
304
|
+
color: darkgray;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
:host([layout=tiles]) #add-option {
|
|
308
|
+
width: 125px;
|
|
309
|
+
height: 125px;
|
|
310
|
+
overflow: hidden;
|
|
311
|
+
border: 2px solid var(--sl-color-gray-300);
|
|
312
|
+
border-radius: 5px;
|
|
313
|
+
padding: 5px;
|
|
314
|
+
display: flex;
|
|
315
|
+
align-items: center;
|
|
316
|
+
justify-content: center;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
:host([mode=truefalse]) #add-option {
|
|
320
|
+
display: none;
|
|
321
|
+
}
|
|
322
|
+
`);
|
|
323
|
+
__runInitializers(_init, 1, WebwriterChoice);
|
|
324
|
+
export {
|
|
325
|
+
WebwriterChoice,
|
|
326
|
+
shuffle
|
|
327
|
+
};
|