@webwriter/quiz 1.0.4 → 1.0.5
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/package.json
CHANGED
|
@@ -5,17 +5,9 @@ import {customElement, property, query} from "lit/decorators.js"
|
|
|
5
5
|
|
|
6
6
|
import SlIconButton from "@shoelace-style/shoelace/dist/components/icon-button/icon-button.component.js"
|
|
7
7
|
|
|
8
|
-
import IconArrowsMove from "bootstrap-icons/icons/arrows-move.svg"
|
|
9
8
|
import IconArrowUp from "bootstrap-icons/icons/arrow-up.svg"
|
|
10
9
|
import IconArrowDown from "bootstrap-icons/icons/arrow-down.svg"
|
|
11
|
-
import IconTrash from "bootstrap-icons/icons/trash.svg"
|
|
12
10
|
import "@shoelace-style/shoelace/dist/themes/light.css"
|
|
13
|
-
import { keyed } from "lit/directives/keyed.js"
|
|
14
|
-
import { ifDefined } from "lit/directives/if-defined.js"
|
|
15
|
-
|
|
16
|
-
import IconX from "bootstrap-icons/icons/x.svg"
|
|
17
|
-
import IconCheck from "bootstrap-icons/icons/check.svg"
|
|
18
|
-
import { shuffle } from "./webwriter-choice"
|
|
19
11
|
|
|
20
12
|
declare global {interface HTMLElementTagNameMap {
|
|
21
13
|
"webwriter-order-item": WebwriterOrderItem;
|
|
@@ -10,7 +10,14 @@ import IconPlus from "bootstrap-icons/icons/plus.svg"
|
|
|
10
10
|
|
|
11
11
|
import { WebwriterOrderItem } from "./webwriter-order-item"
|
|
12
12
|
import { ifDefined } from "lit/directives/if-defined.js"
|
|
13
|
-
|
|
13
|
+
|
|
14
|
+
export function shuffle<T>(a: T[]) {
|
|
15
|
+
for (let i = a.length - 1; i > 0; i--) {
|
|
16
|
+
const j = Math.floor(Math.random() * (i + 1));
|
|
17
|
+
[a[i], a[j]] = [a[j], a[i]];
|
|
18
|
+
}
|
|
19
|
+
return a;
|
|
20
|
+
}
|
|
14
21
|
|
|
15
22
|
declare global {interface HTMLElementTagNameMap {
|
|
16
23
|
"webwriter-order": WebwriterOrder;
|
|
@@ -6,7 +6,7 @@ import "@shoelace-style/shoelace/dist/themes/light.css"
|
|
|
6
6
|
import IconPlus from "bootstrap-icons/icons/plus.svg"
|
|
7
7
|
import SlButton from "@shoelace-style/shoelace/dist/components/button/button.component.js"
|
|
8
8
|
import SlIcon from "@shoelace-style/shoelace/dist/components/icon/icon.component.js"
|
|
9
|
-
import { WebwriterPairingItem } from "./webwriter-pairing-item"
|
|
9
|
+
import type { WebwriterPairingItem } from "./webwriter-pairing-item"
|
|
10
10
|
|
|
11
11
|
declare global {interface HTMLElementTagNameMap {
|
|
12
12
|
"webwriter-pairing": WebwriterPairing;
|
|
@@ -20,7 +20,7 @@ import IconSearch from "bootstrap-icons/icons/search.svg"
|
|
|
20
20
|
import IconGrid3x3Gap from "bootstrap-icons/icons/grid-3x3-gap.svg"
|
|
21
21
|
|
|
22
22
|
import "@shoelace-style/shoelace/dist/themes/light.css"
|
|
23
|
-
import { WebwriterTask } from "./webwriter-task.js"
|
|
23
|
+
import type { WebwriterTask } from "./webwriter-task.js"
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
function shuffle<T>(a: T[]) {
|