@citolab/qti-components 8.0.0 → 8.0.1
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/cdn/index.global.js +1 -1
- package/cdn/index.js +591 -217
- package/dist/base.d.ts +135 -9
- package/dist/{chunk-MJVPNN7W.js → chunk-3AJOQCDU.js} +2 -2
- package/dist/chunk-7HC5SMCU.js +102 -0
- package/dist/chunk-7HC5SMCU.js.map +1 -0
- package/dist/{chunk-MGF5F3S2.js → chunk-CAO4JRLY.js} +2 -2
- package/dist/{chunk-5SJS36BI.js → chunk-F4BNJWYN.js} +1 -1
- package/dist/{chunk-5SJS36BI.js.map → chunk-F4BNJWYN.js.map} +1 -1
- package/dist/{chunk-5QYII4OZ.js → chunk-LVBIQDPM.js} +2 -2
- package/dist/{chunk-W4QZPCNC.js → chunk-QECOPVPO.js} +2 -2
- package/dist/{chunk-LZJHHZQ2.js → chunk-RXGDQDOV.js} +177 -173
- package/dist/chunk-RXGDQDOV.js.map +1 -0
- package/dist/{chunk-KYEZRYO6.js → chunk-XU7HNT4F.js} +4 -4
- package/dist/computed-item.types.d-BKZdSLLJ.d.ts +19 -0
- package/dist/computed.types.d-rKLSPvVG.d.ts +42 -0
- package/dist/config.context.d-BvU9r-Mg.d.ts +91 -0
- package/dist/corrections.d.ts +432 -1
- package/dist/corrections.js +5 -5
- package/dist/elements.d.ts +393 -1
- package/dist/index.d.ts +58 -9
- package/dist/index.js +16 -8
- package/dist/interaction.d-D4MstYRz.d.ts +115 -0
- package/dist/interaction.interface.d-CvjHM2bi.d.ts +46 -0
- package/dist/interactions.d.ts +1569 -1
- package/dist/interactions.js +2 -2
- package/dist/item.css +588 -214
- package/dist/item.d.ts +92 -1
- package/dist/item.js +3 -3
- package/dist/item.types.d-QU7LljEK.d.ts +82 -0
- package/dist/loader.d.ts +22 -1
- package/dist/processing.d.ts +730 -1
- package/dist/qti-components-jsx.d.ts +221 -231
- package/dist/qti-components-jsx.js +1 -0
- package/dist/qti-condition-expression.d-aMvBvpc6.d.ts +8 -0
- package/dist/qti-expression.d-BietT_8b.d.ts +31 -0
- package/dist/qti-feedback.d-DZbad0RN.d.ts +21 -0
- package/dist/qti-rule-base.d-ajOnfGXY.d.ts +16 -0
- package/dist/qti-transform-test.d-BL7GGFJj.d.ts +70 -0
- package/dist/qti.context.d-CejJMlfZ.d.ts +50 -0
- package/dist/response.d-_8y4kjGP.d.ts +106 -0
- package/dist/test.d.ts +699 -1
- package/dist/test.js +11 -3
- package/dist/transformers.d.ts +18 -1
- package/package.json +11 -8
- package/dist/chunk-LZJHHZQ2.js.map +0 -1
- package/dist/chunk-WCQ26LV7.js +0 -102
- package/dist/chunk-WCQ26LV7.js.map +0 -1
- /package/dist/{chunk-MJVPNN7W.js.map → chunk-3AJOQCDU.js.map} +0 -0
- /package/dist/{chunk-MGF5F3S2.js.map → chunk-CAO4JRLY.js.map} +0 -0
- /package/dist/{chunk-5QYII4OZ.js.map → chunk-LVBIQDPM.js.map} +0 -0
- /package/dist/{chunk-W4QZPCNC.js.map → chunk-QECOPVPO.js.map} +0 -0
- /package/dist/{chunk-KYEZRYO6.js.map → chunk-XU7HNT4F.js.map} +0 -0
package/dist/base.d.ts
CHANGED
|
@@ -1,9 +1,135 @@
|
|
|
1
|
-
|
|
2
|
-
import '
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import '
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { C as ComputedItemContext } from './computed-item.types.d-BKZdSLLJ.js';
|
|
2
|
+
import { C as ComputedContext } from './computed.types.d-rKLSPvVG.js';
|
|
3
|
+
export { a as ComputedItem, I as INITIAL_SESSION_CONTEXT, S as SessionContext, V as View, s as sessionContext } from './computed.types.d-rKLSPvVG.js';
|
|
4
|
+
export { C as ConfigContext, V as ValidationDisplayMode, c as configContext } from './config.context.d-BvU9r-Mg.js';
|
|
5
|
+
export { C as ChoiceRole, I as Interaction, a as InteractionContext, i as interactionContext } from './interaction.d-D4MstYRz.js';
|
|
6
|
+
import { I as ItemContext, B as BaseType } from './item.types.d-QU7LljEK.js';
|
|
7
|
+
export { C as Calculate, a as Cardinality, M as Multiple, O as Ordered, b as OutcomeVariable, Q as QtiAreaMapEntry, c as QtiAreaMapping, d as QtiMapEntry, e as QtiMapping, R as ResponseInteraction, f as ResponseVariable, T as TemplateVariable, V as VariableDeclaration, g as VariableValue, h as areaShape, i as directedPair, j as float, k as integer, l as itemContextVariables } from './item.types.d-QU7LljEK.js';
|
|
8
|
+
export { Q as QtiContext, a as QtiContextType, S as Seed, b as asSeed, i as isSeed, q as qtiContext } from './qti.context.d-CejJMlfZ.js';
|
|
9
|
+
export { I as INITIAL_TEST_CONTEXT, Q as QtiExpression, a as QtiExpressionBase, T as TestContext, t as testContext } from './qti-expression.d-BietT_8b.js';
|
|
10
|
+
import * as lit from 'lit';
|
|
11
|
+
export { Q as QtiFeedback, a as QtiVariableDeclaration } from './qti-feedback.d-DZbad0RN.js';
|
|
12
|
+
export { Q as QtiConditionExpression } from './qti-condition-expression.d-aMvBvpc6.js';
|
|
13
|
+
export { D as DirectedPair, I as Identifier, P as Point, R as ResponseValue, i as iterResponseValues, p as parsePair, a as parsePoint, b as parseResponseAttribute, r as responseAttributeConverter, s as serializePair, c as serializePoint, d as serializeResponseAttribute } from './response.d-_8y4kjGP.js';
|
|
14
|
+
export { F as FormAssociatedInteraction, I as IInteraction, R as ReadonlyInteraction, a as RegisteredInteraction, b as ResettableInteraction, c as ResponseIdentifiedInteraction, d as ResponseInteractionElement, V as ValidatableInteraction } from './interaction.interface.d-CvjHM2bi.js';
|
|
15
|
+
export { Q as QtiRuleBase, a as QtiRuleElement } from './qti-rule-base.d-ajOnfGXY.js';
|
|
16
|
+
|
|
17
|
+
declare const computedItemContext: {
|
|
18
|
+
__context__: Readonly<ComputedItemContext>;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
declare const computedContext: {
|
|
22
|
+
__context__: Readonly<ComputedContext>;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
declare const itemContext: {
|
|
26
|
+
__context__: ItemContext;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The border-box reset, for shadow trees.
|
|
31
|
+
*
|
|
32
|
+
* `modern-normalize` applies `*, ::before, ::after { box-sizing: border-box }` to the document,
|
|
33
|
+
* but a universal selector never crosses a shadow boundary: every shadow root starts over at
|
|
34
|
+
* the UA default, `content-box`. So each component has to opt in, and until now 15 of them did
|
|
35
|
+
* so ad hoc — one of them with `content-box`, one with `!important`.
|
|
36
|
+
*
|
|
37
|
+
* Why this matters beyond tidiness: under `content-box`, padding and border are *size*. A rule
|
|
38
|
+
* that only means to repaint a chip — `:state(dragging) { border: none }` — silently shrinks it
|
|
39
|
+
* by two pixels per axis, the drag bank rewraps, and a drop target slides out from under the
|
|
40
|
+
* user's pointer mid-drag. Border-box is what makes "a state may repaint but never re-lay-out"
|
|
41
|
+
* a rule the CSS can actually keep.
|
|
42
|
+
*
|
|
43
|
+
* `:host` is set explicitly and descendants inherit, so a component that genuinely needs
|
|
44
|
+
* `content-box` for a subtree (an image map, say) can opt out at one node and have it hold for
|
|
45
|
+
* everything below it.
|
|
46
|
+
*/
|
|
47
|
+
declare const boxSizing: lit.CSSResult;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* The `drop` region of every drop target.
|
|
51
|
+
*
|
|
52
|
+
* One rule: **a drop container hosts a chip, it never sizes one.** No `flex: 1`, no stretch, no
|
|
53
|
+
* centring. The chip's box is decided by the chip — in the drag bank, mid-flight as a clone, and
|
|
54
|
+
* once dropped — and a container that centres or stretches it makes the drop the one place where
|
|
55
|
+
* that stops being true. That is felt as the chip jumping the instant it lands.
|
|
56
|
+
*
|
|
57
|
+
* `flex: 0 1 auto` on the children says "intrinsic size, no growing, shrink if you must".
|
|
58
|
+
* `align-items: flex-start` stops the cross axis stretching them, which is the flex default and
|
|
59
|
+
* the reason a chip in a tall dropzone used to grow to fill it.
|
|
60
|
+
*
|
|
61
|
+
* The shrink half used to be 0 as well, on the reading that a drop must not resize a chip. It does
|
|
62
|
+
* not say that. `flex-shrink: 0` does not preserve the chip's size, it preserves the chip's
|
|
63
|
+
* UNCONSTRAINED max-content size — and those are the same number only while the bank is wide enough
|
|
64
|
+
* to give the chip its full width. Once the bank is narrower, the bank chip (`flex: 0 1 auto`, like
|
|
65
|
+
* any flex item) shrinks and wraps, the placed chip does not, and the two disagree.
|
|
66
|
+
*
|
|
67
|
+
* Measured on the order fixture, bank vs placed: 209x36 / 209x36 at a 480px interaction, but
|
|
68
|
+
* 204x55 / 209x36 at 440px and 154x55 / 209x36 at 340px — the placed chip a fixed 209px wide,
|
|
69
|
+
* overflowing a drop that had correctly reserved 156px for it. It reached CI as a font difference:
|
|
70
|
+
* the same label measures ~227px under the Linux fonts, which puts 480px on the wrong side of the
|
|
71
|
+
* boundary too.
|
|
72
|
+
*
|
|
73
|
+
* Shrinking cannot make a placed chip smaller than the reservation, because the reservation IS the
|
|
74
|
+
* measured chip (`--qti-dropzone-min-*`, applied to this region's content box). So the floor a
|
|
75
|
+
* shrink stops at is the chip's own size, which is the rule above, not an exception to it.
|
|
76
|
+
* `flex-grow: 0` is what actually prevents the stretch this block cares about, and it is untouched.
|
|
77
|
+
*
|
|
78
|
+
* A container that wants a *minimum* size still declares one (see `--qti-dropzone-min-*`). That
|
|
79
|
+
* sizes the container, never its contents.
|
|
80
|
+
*
|
|
81
|
+
* Verified by drag-drop.invariance.spec.ts: "a chip is the same chip wherever it lives" — including
|
|
82
|
+
* the narrow-bank order fixture, which is there because the wide one passes either way.
|
|
83
|
+
*/
|
|
84
|
+
declare const dropRegion: lit.CSSResult;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* The `#validation-message` region every interaction renders, hidden until there is a message.
|
|
88
|
+
*
|
|
89
|
+
* `Interaction` owns showing and hiding it: `reportValidity` sets
|
|
90
|
+
* `display: block !important` inline when `_internals.validationMessage` is non-empty, and clears the
|
|
91
|
+
* text and sets `display: none` inline again when it is not (see interaction.ts). An inline
|
|
92
|
+
* `!important` beats this rule, so the JS still wins whenever it speaks.
|
|
93
|
+
*
|
|
94
|
+
* What it did not own was the *initial* state. Before first validation the div has no inline style,
|
|
95
|
+
* so it needs a stylesheet to start hidden — otherwise it paints as an empty box with the theme's
|
|
96
|
+
* warning border and padding. That hide used to be a `display: none` inside the theme's
|
|
97
|
+
* `validation-message` mixin, which made a document stylesheet responsible for a shadow node's box.
|
|
98
|
+
* Two components had already noticed and worked around it with `style="display:none"` in their
|
|
99
|
+
* template; the other five relied on the theme.
|
|
100
|
+
*
|
|
101
|
+
* The theme still paints the message — colour, border, padding, radius — via `::part(message)`.
|
|
102
|
+
*/
|
|
103
|
+
declare const validationMessage: lit.CSSResult;
|
|
104
|
+
|
|
105
|
+
declare class ScoringHelper {
|
|
106
|
+
/**
|
|
107
|
+
* Checks if a given point is within a specified area.
|
|
108
|
+
* @param point The point to test, represented as a string "x y" (e.g., "102 113").
|
|
109
|
+
* @param areaKey The area definition, including shape and coordinates (e.g., "circle,102,113,16").
|
|
110
|
+
* @param baseType The base type of the response, must be "point" for this method to proceed.
|
|
111
|
+
* @returns True if the point is within the area; false otherwise.
|
|
112
|
+
*/
|
|
113
|
+
static isPointInArea(point: string, areaKey: string, baseType: string): boolean;
|
|
114
|
+
/**
|
|
115
|
+
* Checks if a point is inside a polygon using the ray-casting algorithm.
|
|
116
|
+
* @param point The point to test.
|
|
117
|
+
* @param vertices The vertices of the polygon in order (array of {x, y} objects).
|
|
118
|
+
* @returns True if the point is inside the polygon; false otherwise.
|
|
119
|
+
*/
|
|
120
|
+
static isPointInPolygon(point: {
|
|
121
|
+
x: number;
|
|
122
|
+
y: number;
|
|
123
|
+
}, vertices: {
|
|
124
|
+
x: number;
|
|
125
|
+
y: number;
|
|
126
|
+
}[]): boolean;
|
|
127
|
+
static compareSingleValues(value1: Readonly<string>, value2: Readonly<string>, baseType: BaseType): boolean;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
declare const decimalSeparator: () => string;
|
|
131
|
+
declare const convertNumberToUniversalFormat: (number: number | string) => string;
|
|
132
|
+
declare function IsNullOrUndefined(value: unknown): boolean;
|
|
133
|
+
declare function removeDoubleSlashes(str: string): string;
|
|
134
|
+
|
|
135
|
+
export { BaseType, ComputedContext, ComputedItemContext, IsNullOrUndefined, ItemContext, ScoringHelper, boxSizing, computedContext, computedItemContext, convertNumberToUniversalFormat, decimalSeparator, dropRegion, itemContext, removeDoubleSlashes, validationMessage };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
qtiItemElements
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-QECOPVPO.js";
|
|
4
4
|
|
|
5
5
|
// ../qti-item/dist/register.js
|
|
6
6
|
for (const { tag, ctor } of qtiItemElements) {
|
|
@@ -8,4 +8,4 @@ for (const { tag, ctor } of qtiItemElements) {
|
|
|
8
8
|
customElements.define(tag, ctor);
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
-
//# sourceMappingURL=chunk-
|
|
11
|
+
//# sourceMappingURL=chunk-3AJOQCDU.js.map
|