@pie-players/pie-tool-answer-eliminator 0.2.9 → 0.2.10
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/adapters/multiple-choice-adapter.ts +62 -14
- package/answer-eliminator-core.ts +7 -50
- package/dist/adapters/multiple-choice-adapter.d.ts +8 -0
- package/dist/adapters/multiple-choice-adapter.d.ts.map +1 -1
- package/dist/answer-eliminator-core.d.ts +2 -0
- package/dist/answer-eliminator-core.d.ts.map +1 -1
- package/dist/strategies/mask-strategy.d.ts +6 -2
- package/dist/strategies/mask-strategy.d.ts.map +1 -1
- package/dist/strategies/strikethrough-strategy.d.ts +9 -2
- package/dist/strategies/strikethrough-strategy.d.ts.map +1 -1
- package/dist/tool-answer-eliminator.js +1436 -1324
- package/package.json +4 -4
- package/strategies/mask-strategy.ts +27 -39
- package/strategies/strikethrough-strategy.ts +47 -66
|
@@ -9,6 +9,14 @@ import type { ChoiceAdapter } from "./choice-adapter.js";
|
|
|
9
9
|
export class MultipleChoiceAdapter implements ChoiceAdapter {
|
|
10
10
|
readonly elementType = "multiple-choice";
|
|
11
11
|
readonly priority = 100;
|
|
12
|
+
private static readonly CHOICE_HOOK_ATTR =
|
|
13
|
+
"data-pie-answer-eliminator-choice";
|
|
14
|
+
private static readonly LABEL_HOOK_ATTR = "data-pie-answer-eliminator-label";
|
|
15
|
+
private static readonly ROOT_HOOK_ATTR = "data-pie-answer-eliminator-root";
|
|
16
|
+
private static readonly FEEDBACK_HOOK_ATTR =
|
|
17
|
+
"data-pie-answer-eliminator-feedback-tick";
|
|
18
|
+
private static readonly CHOICE_SELECTOR =
|
|
19
|
+
`[${MultipleChoiceAdapter.CHOICE_HOOK_ATTR}="true"], .corespring-checkbox, .corespring-radio-button`;
|
|
12
20
|
|
|
13
21
|
canHandle(element: HTMLElement): boolean {
|
|
14
22
|
return (
|
|
@@ -18,22 +26,21 @@ export class MultipleChoiceAdapter implements ChoiceAdapter {
|
|
|
18
26
|
}
|
|
19
27
|
|
|
20
28
|
findChoices(root: HTMLElement): HTMLElement[] {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
root.querySelectorAll<HTMLElement>(
|
|
24
|
-
".corespring-checkbox, .corespring-radio-button",
|
|
25
|
-
),
|
|
29
|
+
root.setAttribute(MultipleChoiceAdapter.ROOT_HOOK_ATTR, "true");
|
|
30
|
+
const choices = Array.from(
|
|
31
|
+
root.querySelectorAll<HTMLElement>(MultipleChoiceAdapter.CHOICE_SELECTOR),
|
|
26
32
|
);
|
|
33
|
+
for (const choice of choices) {
|
|
34
|
+
this.annotateChoice(choice);
|
|
35
|
+
}
|
|
36
|
+
this.annotateFeedbackTicks(root);
|
|
37
|
+
return choices;
|
|
27
38
|
}
|
|
28
39
|
|
|
29
40
|
createChoiceRange(choice: HTMLElement): Range | null {
|
|
30
41
|
// Create range covering the label content
|
|
31
42
|
// Try multiple possible selectors for the label
|
|
32
|
-
const labelElement =
|
|
33
|
-
choice.querySelector(".label") ||
|
|
34
|
-
choice.querySelector("label") ||
|
|
35
|
-
choice.querySelector('[class*="label"]') ||
|
|
36
|
-
choice.querySelector("span");
|
|
43
|
+
const labelElement = this.resolveLabelElement(choice);
|
|
37
44
|
|
|
38
45
|
if (!labelElement) {
|
|
39
46
|
return null;
|
|
@@ -57,7 +64,7 @@ export class MultipleChoiceAdapter implements ChoiceAdapter {
|
|
|
57
64
|
}
|
|
58
65
|
|
|
59
66
|
getChoiceLabel(choice: HTMLElement): string {
|
|
60
|
-
const label =
|
|
67
|
+
const label = this.resolveLabelElement(choice);
|
|
61
68
|
return label?.textContent?.trim() || "Unlabeled choice";
|
|
62
69
|
}
|
|
63
70
|
|
|
@@ -75,7 +82,14 @@ export class MultipleChoiceAdapter implements ChoiceAdapter {
|
|
|
75
82
|
if ((input as HTMLInputElement).disabled) return false;
|
|
76
83
|
|
|
77
84
|
// 3. In evaluate/view mode (has feedback tick)
|
|
78
|
-
|
|
85
|
+
const root =
|
|
86
|
+
choice.closest(`[${MultipleChoiceAdapter.ROOT_HOOK_ATTR}="true"]`) ||
|
|
87
|
+
choice.closest("multiple-choice");
|
|
88
|
+
if (
|
|
89
|
+
root?.querySelector(
|
|
90
|
+
`[${MultipleChoiceAdapter.FEEDBACK_HOOK_ATTR}="true"]`,
|
|
91
|
+
)
|
|
92
|
+
)
|
|
79
93
|
return false;
|
|
80
94
|
|
|
81
95
|
return true;
|
|
@@ -88,9 +102,43 @@ export class MultipleChoiceAdapter implements ChoiceAdapter {
|
|
|
88
102
|
|
|
89
103
|
private generateFallbackId(choice: HTMLElement): string {
|
|
90
104
|
// Generate stable ID based on choice position
|
|
91
|
-
const parent =
|
|
92
|
-
|
|
105
|
+
const parent =
|
|
106
|
+
choice.closest(`[${MultipleChoiceAdapter.ROOT_HOOK_ATTR}="true"]`) ||
|
|
107
|
+
choice.closest("multiple-choice");
|
|
108
|
+
const choices =
|
|
109
|
+
parent?.querySelectorAll(
|
|
110
|
+
`[${MultipleChoiceAdapter.CHOICE_HOOK_ATTR}="true"]`,
|
|
111
|
+
) || [];
|
|
93
112
|
const index = Array.from(choices).indexOf(choice);
|
|
94
113
|
return `choice-${index}`;
|
|
95
114
|
}
|
|
115
|
+
|
|
116
|
+
private annotateChoice(choice: HTMLElement): void {
|
|
117
|
+
choice.setAttribute(MultipleChoiceAdapter.CHOICE_HOOK_ATTR, "true");
|
|
118
|
+
const label = this.resolveLabelElement(choice);
|
|
119
|
+
if (label) {
|
|
120
|
+
label.setAttribute(MultipleChoiceAdapter.LABEL_HOOK_ATTR, "true");
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
private resolveLabelElement(choice: HTMLElement): HTMLElement | null {
|
|
125
|
+
return (
|
|
126
|
+
choice.querySelector<HTMLElement>(
|
|
127
|
+
`[${MultipleChoiceAdapter.LABEL_HOOK_ATTR}="true"]`,
|
|
128
|
+
) ||
|
|
129
|
+
choice.querySelector<HTMLElement>("label") ||
|
|
130
|
+
choice.querySelector<HTMLElement>("span")
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
private annotateFeedbackTicks(root: HTMLElement): void {
|
|
135
|
+
for (const feedbackTick of root.querySelectorAll<HTMLElement>(
|
|
136
|
+
".feedback-tick",
|
|
137
|
+
)) {
|
|
138
|
+
feedbackTick.setAttribute(
|
|
139
|
+
MultipleChoiceAdapter.FEEDBACK_HOOK_ATTR,
|
|
140
|
+
"true",
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
96
144
|
}
|
|
@@ -9,6 +9,9 @@ import { StrikethroughStrategy } from "./strategies/strikethrough-strategy.js";
|
|
|
9
9
|
* Coordinates adapters, strategies, and state management
|
|
10
10
|
*/
|
|
11
11
|
export class AnswerEliminatorCore {
|
|
12
|
+
private static readonly TOGGLE_CLASS = "pie-answer-eliminator-toggle";
|
|
13
|
+
private static readonly TOGGLE_ACTIVE_CLASS =
|
|
14
|
+
"pie-answer-eliminator-toggle--active";
|
|
12
15
|
private registry: AdapterRegistry;
|
|
13
16
|
private strategy: EliminationStrategy;
|
|
14
17
|
private eliminatedChoices = new Set<string>(); // Set<choiceId> for current element
|
|
@@ -103,7 +106,7 @@ export class AnswerEliminatorCore {
|
|
|
103
106
|
|
|
104
107
|
const button = document.createElement("button");
|
|
105
108
|
button.type = "button";
|
|
106
|
-
button.className =
|
|
109
|
+
button.className = AnswerEliminatorCore.TOGGLE_CLASS;
|
|
107
110
|
button.setAttribute("aria-label", `Toggle elimination for ${choiceLabel}`);
|
|
108
111
|
button.setAttribute("data-choice-id", choiceId);
|
|
109
112
|
button.textContent = "⊗"; // Cross mark (use textContent instead of innerHTML for better security)
|
|
@@ -111,40 +114,6 @@ export class AnswerEliminatorCore {
|
|
|
111
114
|
// Apply positioning based on alignment configuration
|
|
112
115
|
this.applyButtonAlignment(button);
|
|
113
116
|
|
|
114
|
-
// Common button styling
|
|
115
|
-
Object.assign(button.style, {
|
|
116
|
-
width: "28px",
|
|
117
|
-
height: "28px",
|
|
118
|
-
padding: "0",
|
|
119
|
-
border: "1px solid #ccc",
|
|
120
|
-
borderRadius: "4px",
|
|
121
|
-
background: "white",
|
|
122
|
-
cursor: "pointer",
|
|
123
|
-
fontSize: "18px",
|
|
124
|
-
lineHeight: "1",
|
|
125
|
-
display: "flex",
|
|
126
|
-
alignItems: "center",
|
|
127
|
-
justifyContent: "center",
|
|
128
|
-
color: "#666",
|
|
129
|
-
transition: "all 0.2s ease",
|
|
130
|
-
zIndex: "10",
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
// Add hover effect
|
|
134
|
-
button.addEventListener("mouseenter", () => {
|
|
135
|
-
button.style.background = "#f0f0f0";
|
|
136
|
-
button.style.borderColor = "#999";
|
|
137
|
-
button.style.color = "#333";
|
|
138
|
-
});
|
|
139
|
-
|
|
140
|
-
button.addEventListener("mouseleave", () => {
|
|
141
|
-
if (!this.strategy.isEliminated(choiceId)) {
|
|
142
|
-
button.style.background = "white";
|
|
143
|
-
button.style.borderColor = "#ccc";
|
|
144
|
-
button.style.color = "#666";
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
|
|
148
117
|
button.addEventListener("click", (e) => {
|
|
149
118
|
e.preventDefault();
|
|
150
119
|
e.stopPropagation();
|
|
@@ -204,12 +173,8 @@ export class AnswerEliminatorCore {
|
|
|
204
173
|
// Update button appearance to show eliminated state
|
|
205
174
|
const button = this.choiceButtons.get(choiceId);
|
|
206
175
|
if (button) {
|
|
207
|
-
button.classList.add(
|
|
176
|
+
button.classList.add(AnswerEliminatorCore.TOGGLE_ACTIVE_CLASS);
|
|
208
177
|
button.setAttribute("aria-pressed", "true");
|
|
209
|
-
// Visual feedback: filled/highlighted when eliminated
|
|
210
|
-
button.style.background = "#ff9800";
|
|
211
|
-
button.style.borderColor = "#ff9800";
|
|
212
|
-
button.style.color = "white";
|
|
213
178
|
}
|
|
214
179
|
|
|
215
180
|
// Save to store
|
|
@@ -229,12 +194,8 @@ export class AnswerEliminatorCore {
|
|
|
229
194
|
// Reset button appearance to default state
|
|
230
195
|
const button = this.choiceButtons.get(choiceId);
|
|
231
196
|
if (button) {
|
|
232
|
-
button.classList.remove(
|
|
197
|
+
button.classList.remove(AnswerEliminatorCore.TOGGLE_ACTIVE_CLASS);
|
|
233
198
|
button.setAttribute("aria-pressed", "false");
|
|
234
|
-
// Reset to default styling
|
|
235
|
-
button.style.background = "white";
|
|
236
|
-
button.style.borderColor = "#ccc";
|
|
237
|
-
button.style.color = "#666";
|
|
238
199
|
}
|
|
239
200
|
|
|
240
201
|
// Save to store
|
|
@@ -328,12 +289,8 @@ export class AnswerEliminatorCore {
|
|
|
328
289
|
// Update button appearance to show eliminated state
|
|
329
290
|
const button = this.choiceButtons.get(choiceId);
|
|
330
291
|
if (button) {
|
|
331
|
-
button.classList.add(
|
|
292
|
+
button.classList.add(AnswerEliminatorCore.TOGGLE_ACTIVE_CLASS);
|
|
332
293
|
button.setAttribute("aria-pressed", "true");
|
|
333
|
-
// Apply eliminated styling
|
|
334
|
-
button.style.background = "#ff9800";
|
|
335
|
-
button.style.borderColor = "#ff9800";
|
|
336
|
-
button.style.color = "white";
|
|
337
294
|
}
|
|
338
295
|
}
|
|
339
296
|
}
|
|
@@ -8,6 +8,11 @@ import { ChoiceAdapter } from './choice-adapter.js';
|
|
|
8
8
|
export declare class MultipleChoiceAdapter implements ChoiceAdapter {
|
|
9
9
|
readonly elementType = "multiple-choice";
|
|
10
10
|
readonly priority = 100;
|
|
11
|
+
private static readonly CHOICE_HOOK_ATTR;
|
|
12
|
+
private static readonly LABEL_HOOK_ATTR;
|
|
13
|
+
private static readonly ROOT_HOOK_ATTR;
|
|
14
|
+
private static readonly FEEDBACK_HOOK_ATTR;
|
|
15
|
+
private static readonly CHOICE_SELECTOR;
|
|
11
16
|
canHandle(element: HTMLElement): boolean;
|
|
12
17
|
findChoices(root: HTMLElement): HTMLElement[];
|
|
13
18
|
createChoiceRange(choice: HTMLElement): Range | null;
|
|
@@ -16,5 +21,8 @@ export declare class MultipleChoiceAdapter implements ChoiceAdapter {
|
|
|
16
21
|
canEliminate(choice: HTMLElement): boolean;
|
|
17
22
|
getButtonContainer(choice: HTMLElement): HTMLElement | null;
|
|
18
23
|
private generateFallbackId;
|
|
24
|
+
private annotateChoice;
|
|
25
|
+
private resolveLabelElement;
|
|
26
|
+
private annotateFeedbackTicks;
|
|
19
27
|
}
|
|
20
28
|
//# sourceMappingURL=multiple-choice-adapter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multiple-choice-adapter.d.ts","sourceRoot":"","sources":["../../adapters/multiple-choice-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD;;;;;GAKG;AACH,qBAAa,qBAAsB,YAAW,aAAa;IAC1D,QAAQ,CAAC,WAAW,qBAAqB;IACzC,QAAQ,CAAC,QAAQ,OAAO;
|
|
1
|
+
{"version":3,"file":"multiple-choice-adapter.d.ts","sourceRoot":"","sources":["../../adapters/multiple-choice-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD;;;;;GAKG;AACH,qBAAa,qBAAsB,YAAW,aAAa;IAC1D,QAAQ,CAAC,WAAW,qBAAqB;IACzC,QAAQ,CAAC,QAAQ,OAAO;IACxB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CACH;IACrC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAsC;IAC7E,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAqC;IAC3E,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CACE;IAC5C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,CAC+D;IAEtG,SAAS,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO;IAOxC,WAAW,CAAC,IAAI,EAAE,WAAW,GAAG,WAAW,EAAE;IAY7C,iBAAiB,CAAC,MAAM,EAAE,WAAW,GAAG,KAAK,GAAG,IAAI;IAcpD,WAAW,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM;IAYxC,cAAc,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM;IAK3C,YAAY,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO;IA2B1C,kBAAkB,CAAC,MAAM,EAAE,WAAW,GAAG,WAAW,GAAG,IAAI;IAK3D,OAAO,CAAC,kBAAkB;IAa1B,OAAO,CAAC,cAAc;IAQtB,OAAO,CAAC,mBAAmB;IAU3B,OAAO,CAAC,qBAAqB;CAU7B"}
|
|
@@ -4,6 +4,8 @@ import { ChoiceAdapter } from './adapters/choice-adapter.js';
|
|
|
4
4
|
* Coordinates adapters, strategies, and state management
|
|
5
5
|
*/
|
|
6
6
|
export declare class AnswerEliminatorCore {
|
|
7
|
+
private static readonly TOGGLE_CLASS;
|
|
8
|
+
private static readonly TOGGLE_ACTIVE_CLASS;
|
|
7
9
|
private registry;
|
|
8
10
|
private strategy;
|
|
9
11
|
private eliminatedChoices;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"answer-eliminator-core.d.ts","sourceRoot":"","sources":["../answer-eliminator-core.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAKlE;;;GAGG;AACH,qBAAa,oBAAoB;IAChC,OAAO,CAAC,QAAQ,CAAkB;IAClC,OAAO,CAAC,QAAQ,CAAsB;IACtC,OAAO,CAAC,iBAAiB,CAAqB;IAC9C,OAAO,CAAC,cAAc,CAAkC;IACxD,OAAO,CAAC,aAAa,CAAwC;IAC7D,OAAO,CAAC,cAAc,CAAoC;IAC1D,OAAO,CAAC,eAAe,CAAwC;IAC/D,OAAO,CAAC,kBAAkB,CAAiB;IAG3C,OAAO,CAAC,gBAAgB,CAGR;gBAGf,YAAY,GAAE,eAAe,GAAG,MAAM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;OAEG;IACH,OAAO,CAAC,aAAa;IAkBrB;;OAEG;IACH,QAAQ,IAAI,IAAI;IAahB;;OAEG;IACH,kBAAkB,IAAI,MAAM;IAI5B;;;;OAIG;IACH,mBAAmB,CAAC,KAAK,EAAE,GAAG,EAAE,eAAe,EAAE,MAAM,GAAG,IAAI;IAI9D;;OAEG;IACH,OAAO,CAAC,SAAS;IAcjB;;OAEG;IACH,OAAO,CAAC,YAAY;IA6CpB;;OAEG;IACH,OAAO,CAAC,cAAc;IAUtB;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAmC5B;;OAEG;IACH,sBAAsB,IAAI,IAAI;IAI9B;;OAEG;IACH,uBAAuB,IAAI,IAAI;IAI/B;;;;OAIG;IACH,OAAO,IAAI,IAAI;IAYf;;OAEG;IACH,OAAO,IAAI,IAAI;CAIf"}
|
|
@@ -4,6 +4,12 @@ import { EliminationStrategy } from './elimination-strategy.js';
|
|
|
4
4
|
* Partially hides/grays eliminated choices
|
|
5
5
|
*/
|
|
6
6
|
export declare class MaskStrategy implements EliminationStrategy {
|
|
7
|
+
private static readonly HIGHLIGHT_STYLE_PREFIX;
|
|
8
|
+
private static readonly HIGHLIGHT_NAME_PREFIX;
|
|
9
|
+
private static readonly FALLBACK_CLASS;
|
|
10
|
+
private static readonly CHOICE_HOOK_ATTR;
|
|
11
|
+
private static readonly ELIMINATED_ATTR;
|
|
12
|
+
private static readonly ELIMINATED_ID_ATTR;
|
|
7
13
|
readonly name = "mask";
|
|
8
14
|
private highlights;
|
|
9
15
|
private ranges;
|
|
@@ -16,10 +22,8 @@ export declare class MaskStrategy implements EliminationStrategy {
|
|
|
16
22
|
clearAll(): void;
|
|
17
23
|
getEliminatedIds(): string[];
|
|
18
24
|
private isSupported;
|
|
19
|
-
private injectCSS;
|
|
20
25
|
private injectHighlightCSS;
|
|
21
26
|
private removeHighlightCSS;
|
|
22
|
-
private removeCSS;
|
|
23
27
|
private addAriaAttributes;
|
|
24
28
|
private removeAriaAttributes;
|
|
25
29
|
private findChoiceContainer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mask-strategy.d.ts","sourceRoot":"","sources":["../../strategies/mask-strategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAErE;;;GAGG;AACH,qBAAa,YAAa,YAAW,mBAAmB;IACvD,QAAQ,CAAC,IAAI,UAAU;IAEvB,OAAO,CAAC,UAAU,CAAgC;IAClD,OAAO,CAAC,MAAM,CAA4B;IAC1C,OAAO,CAAC,kBAAkB,CAAkC;IAE5D,UAAU,IAAI,IAAI;IAIlB,OAAO,IAAI,IAAI;
|
|
1
|
+
{"version":3,"file":"mask-strategy.d.ts","sourceRoot":"","sources":["../../strategies/mask-strategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAErE;;;GAGG;AACH,qBAAa,YAAa,YAAW,mBAAmB;IACvD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,sBAAsB,CACL;IACzC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,qBAAqB,CAAwB;IACrE,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAgC;IACtE,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CACH;IACrC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAgC;IACvE,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAmC;IAE7E,QAAQ,CAAC,IAAI,UAAU;IAEvB,OAAO,CAAC,UAAU,CAAgC;IAClD,OAAO,CAAC,MAAM,CAA4B;IAC1C,OAAO,CAAC,kBAAkB,CAAkC;IAE5D,UAAU,IAAI,IAAI;IAIlB,OAAO,IAAI,IAAI;IAIf,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI;IAqB3C,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAqB9B,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAIvC,QAAQ,IAAI,IAAI;IAOhB,gBAAgB,IAAI,MAAM,EAAE;IAI5B,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,kBAAkB;IAe1B,OAAO,CAAC,kBAAkB;IAM1B,OAAO,CAAC,iBAAiB;IAQzB,OAAO,CAAC,oBAAoB;IAQ5B,OAAO,CAAC,mBAAmB;IAkB3B,OAAO,CAAC,aAAa;IAWrB,OAAO,CAAC,cAAc;CAatB"}
|
|
@@ -7,6 +7,14 @@ import { EliminationStrategy } from './elimination-strategy.js';
|
|
|
7
7
|
* WCAG Compliance: Maintains info structure (1.3.1), no layout shift (2.4.3)
|
|
8
8
|
*/
|
|
9
9
|
export declare class StrikethroughStrategy implements EliminationStrategy {
|
|
10
|
+
private static readonly HIGHLIGHT_STYLE_PREFIX;
|
|
11
|
+
private static readonly HIGHLIGHT_NAME_PREFIX;
|
|
12
|
+
private static readonly FALLBACK_CLASS;
|
|
13
|
+
private static readonly SR_CLASS;
|
|
14
|
+
private static readonly CHOICE_HOOK_ATTR;
|
|
15
|
+
private static readonly LABEL_HOOK_ATTR;
|
|
16
|
+
private static readonly ELIMINATED_ATTR;
|
|
17
|
+
private static readonly ELIMINATED_ID_ATTR;
|
|
10
18
|
readonly name = "strikethrough";
|
|
11
19
|
private highlights;
|
|
12
20
|
private ranges;
|
|
@@ -19,14 +27,13 @@ export declare class StrikethroughStrategy implements EliminationStrategy {
|
|
|
19
27
|
clearAll(): void;
|
|
20
28
|
getEliminatedIds(): string[];
|
|
21
29
|
private isSupported;
|
|
22
|
-
private injectCSS;
|
|
23
30
|
private injectHighlightCSS;
|
|
24
31
|
private removeHighlightCSS;
|
|
25
|
-
private removeCSS;
|
|
26
32
|
private addAriaAttributes;
|
|
27
33
|
private removeAriaAttributes;
|
|
28
34
|
private findChoiceContainer;
|
|
29
35
|
private applyFallback;
|
|
30
36
|
private removeFallback;
|
|
37
|
+
private resolveLabelElement;
|
|
31
38
|
}
|
|
32
39
|
//# sourceMappingURL=strikethrough-strategy.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"strikethrough-strategy.d.ts","sourceRoot":"","sources":["../../strategies/strikethrough-strategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAErE;;;;;;GAMG;AACH,qBAAa,qBAAsB,YAAW,mBAAmB;IAChE,QAAQ,CAAC,IAAI,mBAAmB;IAEhC,OAAO,CAAC,UAAU,CAAgC;IAClD,OAAO,CAAC,MAAM,CAA4B;IAC1C,OAAO,CAAC,kBAAkB,CAAkC;IAE5D,UAAU,IAAI,IAAI;
|
|
1
|
+
{"version":3,"file":"strikethrough-strategy.d.ts","sourceRoot":"","sources":["../../strategies/strikethrough-strategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAErE;;;;;;GAMG;AACH,qBAAa,qBAAsB,YAAW,mBAAmB;IAChE,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,sBAAsB,CACV;IACpC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,qBAAqB,CAA4B;IACzE,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CACO;IAC7C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAA2C;IAC3E,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CACH;IACrC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAsC;IAC7E,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAgC;IACvE,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAmC;IAE7E,QAAQ,CAAC,IAAI,mBAAmB;IAEhC,OAAO,CAAC,UAAU,CAAgC;IAClD,O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