@citolab/qti-components 3.0.36

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.
Files changed (115) hide show
  1. package/index.cjs +341 -0
  2. package/index.css +16965 -0
  3. package/index.d.ts +47 -0
  4. package/index.js +341 -0
  5. package/lab/qti-api/qti-api.stories.d.ts +7 -0
  6. package/lab/qti-custom/qti-custom-operator/qti-custom-operator-levenshtein.d.ts +11 -0
  7. package/lab/qti-custom/qti-custom-operator/qti-custom-operator-numeric-parse-nl.d.ts +11 -0
  8. package/lab/qti-custom/qti-custom-operator/qti-custom-operator-numeric.d.ts +6 -0
  9. package/lab/qti-custom/qti-custom-operator/qti-custom-operator-remove-spaces.d.ts +6 -0
  10. package/lab/qti-custom/qti-custom-operator/qti-custom-operator-trim.d.ts +6 -0
  11. package/lab/qti-custom/qti-custom-operator/qti-custom-operator.stories.d.ts +12 -0
  12. package/lab/qti-dashboard/qti-item-dashboard.stories.d.ts +8 -0
  13. package/lab/qti-item/qti-item.d.ts +30 -0
  14. package/lab/qti-item/qti-item.stories.d.ts +8 -0
  15. package/lab/qti-test/qti-test-buttons.d.ts +1 -0
  16. package/lab/qti-test/qti-test.d.ts +40 -0
  17. package/lab/qti-test/qti-test.stories.d.ts +9 -0
  18. package/lib/qti-base/qti-assessment-item/qti-assessment-item.d.ts +43 -0
  19. package/lib/qti-base/qti-choice/qti-choice.d.ts +34 -0
  20. package/lib/qti-base/qti-choice/qti-hottext/qti-hottext.d.ts +9 -0
  21. package/lib/qti-base/qti-choice/qti-simple-choice/qti-simple-choice.d.ts +9 -0
  22. package/lib/qti-base/qti-feedback/qti-feedback-inline/qti-feedback-inline.d.ts +5 -0
  23. package/lib/qti-base/qti-feedback/qti-feedback.d.ts +30 -0
  24. package/lib/qti-base/qti-feedback/qti-feedback.stories.d.ts +8 -0
  25. package/lib/qti-base/qti-feedback/qti-modal-feedback/qti-modal-feedback.d.ts +5 -0
  26. package/lib/qti-base/qti-interaction/qti-choice-interaction/qti-choice-interaction.d.ts +11 -0
  27. package/lib/qti-base/qti-interaction/qti-choice-interaction/qti-choice-interaction.stories.d.ts +45 -0
  28. package/lib/qti-base/qti-interaction/qti-extended-text-interaction/qti-extended-text-interaction.d.ts +41 -0
  29. package/lib/qti-base/qti-interaction/qti-extended-text-interaction/qti-extended-text-interaction.stories.d.ts +9 -0
  30. package/lib/qti-base/qti-interaction/qti-hottext-interaction/qti-hottext-interaction.d.ts +6 -0
  31. package/lib/qti-base/qti-interaction/qti-hottext-interaction/qti-hottext-interaction.stories.d.ts +20 -0
  32. package/lib/qti-base/qti-interaction/qti-inline-choice-interaction/qti-inline-choice-interaction.d.ts +27 -0
  33. package/lib/qti-base/qti-interaction/qti-inline-choice-interaction/qti-inline-choice-interaction.stories.d.ts +43 -0
  34. package/lib/qti-base/qti-interaction/qti-text-entry-interaction/qti-text-entry-interaction.d.ts +34 -0
  35. package/lib/qti-base/qti-interaction/qti-text-entry-interaction/qti-text-entry-interaction.stories.d.ts +31 -0
  36. package/lib/qti-base/qti-item-body/qti-item-body.d.ts +4 -0
  37. package/lib/qti-base/qti-preview/qti-associable-hotspot.d.ts +6 -0
  38. package/lib/qti-base/qti-preview/qti-associate-interaction/qti-associate-interaction.d.ts +11 -0
  39. package/lib/qti-base/qti-preview/qti-associate-interaction/qti-associate-interaction.stories.d.ts +7 -0
  40. package/lib/qti-base/qti-preview/qti-associate-interaction/qti-simple-associable-choice.d.ts +4 -0
  41. package/lib/qti-base/qti-preview/qti-custom-interaction/qti-portable-custom-interaction.d.ts +34 -0
  42. package/lib/qti-base/qti-preview/qti-custom-interaction/qti-portable-custom-interaction.stories.d.ts +7 -0
  43. package/lib/qti-base/qti-preview/qti-gap-match-interaction/qti-gap-match-interaction.d.ts +8 -0
  44. package/lib/qti-base/qti-preview/qti-gap-match-interaction/qti-gap-match-interaction.stories.d.ts +31 -0
  45. package/lib/qti-base/qti-preview/qti-gap-match-interaction/qti-gap-text.d.ts +2 -0
  46. package/lib/qti-base/qti-preview/qti-gap-match-interaction/qti-gap.d.ts +2 -0
  47. package/lib/qti-base/qti-preview/qti-graphic-associate-interaction/qti-graphic-associate-interaction.d.ts +10 -0
  48. package/lib/qti-base/qti-preview/qti-graphic-associate-interaction/qti-graphic-associate-interaction.stories.d.ts +7 -0
  49. package/lib/qti-base/qti-preview/qti-graphic-gap-match-interaction/qti-gap-img.d.ts +3 -0
  50. package/lib/qti-base/qti-preview/qti-graphic-gap-match-interaction/qti-graphic-gap-match-interaction.d.ts +11 -0
  51. package/lib/qti-base/qti-preview/qti-graphic-gap-match-interaction/qti-graphic-gap-match-interaction.stories.d.ts +26 -0
  52. package/lib/qti-base/qti-preview/qti-graphic-order-interaction/qti-graphic-order-interaction.d.ts +11 -0
  53. package/lib/qti-base/qti-preview/qti-graphic-order-interaction/qti-graphic-order-interaction.stories.d.ts +7 -0
  54. package/lib/qti-base/qti-preview/qti-hotspot-choice.d.ts +5 -0
  55. package/lib/qti-base/qti-preview/qti-hotspot-interaction/qti-hotspot-interaction.d.ts +9 -0
  56. package/lib/qti-base/qti-preview/qti-hotspot-interaction/qti-hotspot-interaction.stories.d.ts +9 -0
  57. package/lib/qti-base/qti-preview/qti-match-interaction/qti-match-interaction.d.ts +8 -0
  58. package/lib/qti-base/qti-preview/qti-match-interaction/qti-match-interaction.stories.d.ts +8 -0
  59. package/lib/qti-base/qti-preview/qti-media-interaction/qti-media-interaction.d.ts +19 -0
  60. package/lib/qti-base/qti-preview/qti-media-interaction/qti-media-interaction.stories.d.ts +25 -0
  61. package/lib/qti-base/qti-preview/qti-order-interaction/qti-order-interaction.d.ts +23 -0
  62. package/lib/qti-base/qti-preview/qti-order-interaction/qti-order-interaction.stories.d.ts +21 -0
  63. package/lib/qti-base/qti-preview/qti-preview-badge.d.ts +1 -0
  64. package/lib/qti-base/qti-preview/qti-select-point-interaction/qti-select-point-interaction.d.ts +10 -0
  65. package/lib/qti-base/qti-preview/qti-select-point-interaction/qti-select-point-interaction.stories.d.ts +7 -0
  66. package/lib/qti-base/qti-preview/qti-slider-interaction/qti-slider-interaction.d.ts +26 -0
  67. package/lib/qti-base/qti-preview/qti-slider-interaction/qti-slider-interaction.stories.d.ts +48 -0
  68. package/lib/qti-base/qti-prompt/qti-prompt.d.ts +6 -0
  69. package/lib/qti-base/qti-responseprocessing/index.d.ts +18 -0
  70. package/lib/qti-base/qti-responseprocessing/qti-expression/qti-and/qti-and.d.ts +7 -0
  71. package/lib/qti-base/qti-responseprocessing/qti-expression/qti-basevalue/qti-basevalue.d.ts +6 -0
  72. package/lib/qti-base/qti-responseprocessing/qti-expression/qti-contains/qti-contains.d.ts +6 -0
  73. package/lib/qti-base/qti-responseprocessing/qti-expression/qti-correct/qti-correct.d.ts +6 -0
  74. package/lib/qti-base/qti-responseprocessing/qti-expression/qti-expression.d.ts +6 -0
  75. package/lib/qti-base/qti-responseprocessing/qti-expression/qti-gte/qti-gte.d.ts +6 -0
  76. package/lib/qti-base/qti-responseprocessing/qti-expression/qti-is-null/qti-is-null.d.ts +6 -0
  77. package/lib/qti-base/qti-responseprocessing/qti-expression/qti-mapresponse/qti-mapresponse.d.ts +4 -0
  78. package/lib/qti-base/qti-responseprocessing/qti-expression/qti-match/qti-match.d.ts +4 -0
  79. package/lib/qti-base/qti-responseprocessing/qti-expression/qti-multiple/qti-multiple.d.ts +4 -0
  80. package/lib/qti-base/qti-responseprocessing/qti-expression/qti-or/qti-or.d.ts +7 -0
  81. package/lib/qti-base/qti-responseprocessing/qti-expression/qti-variable/qti-variable.d.ts +6 -0
  82. package/lib/qti-base/qti-responseprocessing/qti-responseelse/qti-responseelse.d.ts +15 -0
  83. package/lib/qti-base/qti-responseprocessing/qti-responseelse/qti-responseif/qti-responseelseif/qti-responseelseif.d.ts +4 -0
  84. package/lib/qti-base/qti-responseprocessing/qti-responseelse/qti-responseif/qti-responseif.d.ts +7 -0
  85. package/lib/qti-base/qti-responseprocessing/qti-responseprocessing/qti-responseprocessing.d.ts +7 -0
  86. package/lib/qti-base/qti-responseprocessing/qti-rule/qti-responsecondition/qti-responsecondition.d.ts +5 -0
  87. package/lib/qti-base/qti-responseprocessing/qti-rule/qti-rule.d.ts +5 -0
  88. package/lib/qti-base/qti-responseprocessing/qti-rule/qti-setoutcomevalue/qti-setoutcomevalue.d.ts +4 -0
  89. package/lib/qti-base/qti-stylesheet/qti-stylesheet.d.ts +7 -0
  90. package/lib/qti-base/qti-variabledeclaration/qti-outcomedeclaration/qti-outcomedeclaration.d.ts +5 -0
  91. package/lib/qti-base/qti-variabledeclaration/qti-responsedeclaration/qti-responsedeclaration.d.ts +24 -0
  92. package/lib/qti-base/qti-variabledeclaration/qti-variabledeclaration.d.ts +4 -0
  93. package/lib/qti-utilities/EventStrings.d.ts +18 -0
  94. package/lib/qti-utilities/EventTypes.d.ts +7 -0
  95. package/lib/qti-utilities/ExpressionResult.d.ts +43 -0
  96. package/lib/qti-utilities/OutcomeVariable.d.ts +8 -0
  97. package/lib/qti-utilities/ResponseVariable.d.ts +28 -0
  98. package/lib/qti-utilities/TemplateStrings.d.ts +3 -0
  99. package/lib/qti-utilities/VariableDeclaration.d.ts +7 -0
  100. package/lib/utilities/choice/choices.d.ts +23 -0
  101. package/lib/utilities/drag-drop/drag-drop-interaction-mixin.d.ts +5 -0
  102. package/lib/utilities/drag-drop/draggables-mixin.d.ts +6 -0
  103. package/lib/utilities/drag-drop/droppables-mixin.d.ts +6 -0
  104. package/lib/utilities/drag-drop/flippables-mixin.d.ts +8 -0
  105. package/lib/utilities/element/qti-element.d.ts +6 -0
  106. package/lib/utilities/hotspots/hotspot.d.ts +2 -0
  107. package/lib/utilities/interaction/interaction.d.ts +14 -0
  108. package/lib/utilities/interaction/interaction.interface.d.ts +8 -0
  109. package/lib/utilities/reset-styles/reset-shadowroot-styles.d.ts +1 -0
  110. package/lib/utilities/scale-to-fit/scale-to-fit.mixin.d.ts +6 -0
  111. package/lib/utilities/watch/watch.d.ts +14 -0
  112. package/package.json +20 -0
  113. package/styles/qti-classes.stories.d.ts +5 -0
  114. package/styles/qti-layout-styles.stories.d.ts +6 -0
  115. package/styles/qti-styles.stories.d.ts +5 -0
@@ -0,0 +1,7 @@
1
+ import { BaseType, Cardinality, ResponseType } from './ExpressionResult';
2
+ export interface VariableDeclaration {
3
+ identifier: string;
4
+ cardinality: Cardinality;
5
+ baseType: BaseType;
6
+ value: ResponseType;
7
+ }
@@ -0,0 +1,23 @@
1
+ import { ResponseType } from '../../qti-utilities/ExpressionResult';
2
+ import { QtiChoice } from '../../qti-base/qti-choice/qti-choice';
3
+ import { Interaction } from '../interaction/interaction';
4
+ export declare class Choices extends Interaction {
5
+ protected _choiceElements: QtiChoice[];
6
+ private _minChoices;
7
+ private _maxChoices;
8
+ _handleDisabledChange: (old: any, disabled: any) => void;
9
+ _handleReadonlyChange: (old: any, readonly: any) => void;
10
+ _handleMaxChoicesChange: () => void;
11
+ constructor();
12
+ reset(): void;
13
+ validate(): boolean;
14
+ set response(myResponse: ResponseType);
15
+ connectedCallback(): void;
16
+ disconnectedCallback(): void;
17
+ private _registerChoiceElement;
18
+ private _looseChoiceElement;
19
+ private _determineInputType;
20
+ private _setInputType;
21
+ private _choiceElementSelectedHandler;
22
+ private _choiceElementSelected;
23
+ }
@@ -0,0 +1,5 @@
1
+ import { LitElement } from 'lit';
2
+ import { IInteraction } from '../interaction/interaction.interface';
3
+ declare type Constructor<T> = new (...args: any[]) => T;
4
+ export declare const DragDropInteractionMixin: <T extends Constructor<LitElement>>(superClass: T, draggablesSelector: string, droppablesSelector: string) => Constructor<IInteraction> & T;
5
+ export {};
@@ -0,0 +1,6 @@
1
+ import { LitElement } from 'lit';
2
+ declare type Constructor<T> = new (...args: any[]) => T;
3
+ declare class DraggablesInterface {
4
+ }
5
+ export declare const DraggablesMixin: <T extends Constructor<LitElement>>(superClass: T, draggablesSelector: string) => Constructor<DraggablesInterface> & T;
6
+ export {};
@@ -0,0 +1,6 @@
1
+ import { LitElement } from 'lit';
2
+ declare type Constructor<T> = new (...args: any[]) => T;
3
+ declare class DroppablesInterface {
4
+ }
5
+ export declare const DroppablesMixin: <T extends Constructor<LitElement>>(superClass: T, droppablesSelector: string) => Constructor<DroppablesInterface> & T;
6
+ export {};
@@ -0,0 +1,8 @@
1
+ import { LitElement } from 'lit';
2
+ declare type Constructor<T> = new (...args: any[]) => T;
3
+ export declare class FlippablesInterface {
4
+ connectedCallback(): void;
5
+ disconnectedCallback(): void;
6
+ }
7
+ export declare const FlippablesMixin: <T extends Constructor<LitElement>>(superClass: T, droppablesSel: string, draggablesSel: string) => Constructor<FlippablesInterface> & T;
8
+ export {};
@@ -0,0 +1,6 @@
1
+ import { LitElement } from 'lit';
2
+ export default class QtiElement extends LitElement {
3
+ /** Emits a custom event with more convenient defaults. */
4
+ emit(name: string, options?: CustomEventInit): CustomEvent<any>;
5
+ err(value: string): void;
6
+ }
@@ -0,0 +1,2 @@
1
+ import { QtiHotspotChoice } from "@citolab/qti-components";
2
+ export declare function positionHotspots(shape: string, coordsNumber: number[], img: HTMLImageElement, hotspot: QtiHotspotChoice): void;
@@ -0,0 +1,14 @@
1
+ import QtiElement from '../element/qti-element';
2
+ import { QtiVariableJSON } from '../../qti-utilities/ExpressionResult';
3
+ export declare abstract class Interaction extends QtiElement {
4
+ responseIdentifier: string;
5
+ /** disabled should be exposed to the attributes and accessible as property */
6
+ disabled: boolean;
7
+ /** readonly should be exposed to the attributes and accessible as property */
8
+ readonly: boolean;
9
+ abstract reset(): any;
10
+ abstract validate(): boolean;
11
+ abstract set response(val: any);
12
+ connectedCallback(): void;
13
+ saveResponse(value: QtiVariableJSON): void;
14
+ }
@@ -0,0 +1,8 @@
1
+ import { ResponseType } from '../../qti-utilities/ExpressionResult';
2
+ export interface IInteraction {
3
+ disabled: boolean;
4
+ readonly: boolean;
5
+ response: ResponseType;
6
+ reset(): any;
7
+ validate(): boolean;
8
+ }
@@ -0,0 +1 @@
1
+ export declare const resetCss: import("lit").CSSResult;
@@ -0,0 +1,6 @@
1
+ import { LitElement } from 'lit';
2
+ declare type Constructor<T> = new (...args: any[]) => T;
3
+ export declare class ScaleToFitInterface {
4
+ }
5
+ export declare const ScaleToFitMixin: <T extends Constructor<LitElement>>(superClass: T, scaleSelector: string) => Constructor<ScaleToFitInterface> & T;
6
+ export {};
@@ -0,0 +1,14 @@
1
+ import type { LitElement } from 'lit';
2
+ declare type UpdateHandler = (prev?: unknown, next?: unknown) => void;
3
+ declare type NonUndefined<A> = A extends undefined ? never : A;
4
+ declare type UpdateHandlerFunctionKeys<T extends object> = {
5
+ [K in keyof T]-?: NonUndefined<T[K]> extends UpdateHandler ? K : never;
6
+ }[keyof T];
7
+ interface WatchOptions {
8
+ /**
9
+ * If true, will only start watching after the initial update/render
10
+ */
11
+ waitUntilFirstUpdate?: boolean;
12
+ }
13
+ export declare function watch(propName: string, options?: WatchOptions): <ElemClass extends LitElement>(proto: ElemClass, decoratedFnName: UpdateHandlerFunctionKeys<ElemClass>) => void;
14
+ export {};
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@citolab/qti-components",
3
+ "version": "3.0.36",
4
+ "repository": "@citolab/qti-components",
5
+ "author": "Patrick de Klein",
6
+ "license": "MIT",
7
+ "description": "QTI webcomponents",
8
+ "module": "./index.js",
9
+ "main": "./index.cjs",
10
+ "type": "module",
11
+ "types": "./index.d.ts",
12
+ "dependencies": {},
13
+ "peerDependencies": {
14
+ "lit": "2.4.1",
15
+ "@storybook/addon-actions": "6.5.13",
16
+ "lit-html": "2.4.0",
17
+ "@citolab/qti-transform": "0.0.1",
18
+ "haunted": "5.0.0"
19
+ }
20
+ }
@@ -0,0 +1,5 @@
1
+ declare const _default: {
2
+ title: string;
3
+ };
4
+ export default _default;
5
+ export declare const QtiInteractions: () => import("lit-html").TemplateResult<1>;
@@ -0,0 +1,6 @@
1
+ declare const _default: {
2
+ title: string;
3
+ };
4
+ export default _default;
5
+ export declare const FixedContainer: () => import("lit-html").TemplateResult<1>;
6
+ export declare const FluidContainer: () => import("lit-html").TemplateResult<1>;
@@ -0,0 +1,5 @@
1
+ declare const _default: {
2
+ title: string;
3
+ };
4
+ export default _default;
5
+ export declare const QtiUtilities: () => import("lit-html").TemplateResult<1>;