@qti-editor/interaction-associate 1.0.0 → 1.1.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/dist/extensions/correct-response.d.ts +3 -5
- package/dist/extensions/correct-response.d.ts.map +1 -1
- package/dist/extensions/correct-response.js +3 -7
- package/dist/extensions/index.d.ts +2 -1
- package/dist/extensions/index.d.ts.map +1 -1
- package/dist/extensions/index.js +3 -1
- package/dist/extensions/prosekit.d.ts +11 -0
- package/dist/extensions/prosekit.d.ts.map +1 -0
- package/dist/extensions/prosekit.js +13 -0
- package/package.json +10 -8
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Plugin } from 'prosekit/pm/state';
|
|
1
|
+
import { Plugin } from 'prosemirror-state';
|
|
3
2
|
/**
|
|
4
3
|
* Event name for associate pair changes.
|
|
5
4
|
*/
|
|
6
5
|
export declare const ASSOCIATE_PAIR_CHANGE_EVENT = "associate-pair-change";
|
|
7
6
|
/**
|
|
8
|
-
* Creates a ProseMirror
|
|
7
|
+
* Creates a ProseMirror plugin that persists associate interaction correct responses.
|
|
9
8
|
*
|
|
10
|
-
* When pairs change, this
|
|
9
|
+
* When pairs change, this plugin serializes them to JSON and updates the
|
|
11
10
|
* interaction node's correctResponse attribute.
|
|
12
11
|
*/
|
|
13
|
-
export declare function defineAssociateCorrectResponseExtension(): Extension;
|
|
14
12
|
export declare function createAssociateCorrectResponsePlugin(): Plugin;
|
|
15
13
|
//# sourceMappingURL=correct-response.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"correct-response.d.ts","sourceRoot":"","sources":["../../src/extensions/correct-response.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"correct-response.d.ts","sourceRoot":"","sources":["../../src/extensions/correct-response.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAa,MAAM,mBAAmB,CAAC;AAOtD;;GAEG;AACH,eAAO,MAAM,2BAA2B,0BAA0B,CAAC;AAyBnE;;;;;GAKG;AACH,wBAAgB,oCAAoC,IAAI,MAAM,CAgC7D"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Plugin, PluginKey } from 'prosekit/pm/state';
|
|
1
|
+
import { Plugin, PluginKey } from 'prosemirror-state';
|
|
3
2
|
const associateCorrectResponsePluginKey = new PluginKey('associate-correct-response');
|
|
4
3
|
/**
|
|
5
4
|
* Event name for associate pair changes.
|
|
@@ -26,14 +25,11 @@ function findInteractionNodePos(view, interactionElement) {
|
|
|
26
25
|
return foundPos;
|
|
27
26
|
}
|
|
28
27
|
/**
|
|
29
|
-
* Creates a ProseMirror
|
|
28
|
+
* Creates a ProseMirror plugin that persists associate interaction correct responses.
|
|
30
29
|
*
|
|
31
|
-
* When pairs change, this
|
|
30
|
+
* When pairs change, this plugin serializes them to JSON and updates the
|
|
32
31
|
* interaction node's correctResponse attribute.
|
|
33
32
|
*/
|
|
34
|
-
export function defineAssociateCorrectResponseExtension() {
|
|
35
|
-
return definePlugin(createAssociateCorrectResponsePlugin);
|
|
36
|
-
}
|
|
37
33
|
export function createAssociateCorrectResponsePlugin() {
|
|
38
34
|
return new Plugin({
|
|
39
35
|
key: associateCorrectResponsePluginKey,
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { createAssociateCorrectResponsePlugin, ASSOCIATE_PAIR_CHANGE_EVENT, } from './correct-response.js';
|
|
2
|
+
export { defineAssociateCorrectResponseExtension } from './prosekit.js';
|
|
2
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/extensions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/extensions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oCAAoC,EACpC,2BAA2B,GAC5B,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,uCAAuC,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/extensions/index.js
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { createAssociateCorrectResponsePlugin, ASSOCIATE_PAIR_CHANGE_EVENT, } from './correct-response.js';
|
|
2
|
+
// ProseKit extension wrapper (optional - requires prosekit)
|
|
3
|
+
export { defineAssociateCorrectResponseExtension } from './prosekit.js';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ProseKit extension wrappers for associate interaction plugins.
|
|
3
|
+
* Only import this file when using ProseKit.
|
|
4
|
+
*/
|
|
5
|
+
import { type Extension } from 'prosekit/core';
|
|
6
|
+
/**
|
|
7
|
+
* ProseKit extension that wraps the associate correct response plugin.
|
|
8
|
+
* Use this when integrating with ProseKit.
|
|
9
|
+
*/
|
|
10
|
+
export declare function defineAssociateCorrectResponseExtension(): Extension;
|
|
11
|
+
//# sourceMappingURL=prosekit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prosekit.d.ts","sourceRoot":"","sources":["../../src/extensions/prosekit.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAgB,KAAK,SAAS,EAAE,MAAM,eAAe,CAAC;AAI7D;;;GAGG;AACH,wBAAgB,uCAAuC,IAAI,SAAS,CAEnE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ProseKit extension wrappers for associate interaction plugins.
|
|
3
|
+
* Only import this file when using ProseKit.
|
|
4
|
+
*/
|
|
5
|
+
import { definePlugin } from 'prosekit/core';
|
|
6
|
+
import { createAssociateCorrectResponsePlugin } from './correct-response.js';
|
|
7
|
+
/**
|
|
8
|
+
* ProseKit extension that wraps the associate correct response plugin.
|
|
9
|
+
* Use this when integrating with ProseKit.
|
|
10
|
+
*/
|
|
11
|
+
export function defineAssociateCorrectResponseExtension() {
|
|
12
|
+
return definePlugin(createAssociateCorrectResponsePlugin);
|
|
13
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qti-editor/interaction-associate",
|
|
3
3
|
"description": "QTI associate interaction schemas, components, commands, and composer",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.1.1",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/Citolab/qti-editor",
|
|
@@ -22,19 +22,21 @@
|
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@qti-components/associate-interaction": "^1.1.3",
|
|
25
|
-
"@qti-components/interactions": "1.10.
|
|
25
|
+
"@qti-components/interactions": "1.10.2",
|
|
26
26
|
"@qti-components/utilities": "1.3.2",
|
|
27
|
-
"@qti-editor/interaction-shared": "1.
|
|
28
|
-
"@qti-editor/interfaces": "1.
|
|
29
|
-
},
|
|
30
|
-
"peerDependencies": {
|
|
31
|
-
"lit": "^3.3.1"
|
|
27
|
+
"@qti-editor/interaction-shared": "1.1.0",
|
|
28
|
+
"@qti-editor/interfaces": "1.1.0"
|
|
32
29
|
},
|
|
33
30
|
"devDependencies": {
|
|
34
31
|
"lit": "^3.3.2",
|
|
35
32
|
"prosemirror-commands": "^1.7.1",
|
|
36
33
|
"prosemirror-model": "^1.25.4",
|
|
37
|
-
"prosemirror-state": "^1.4.4"
|
|
34
|
+
"prosemirror-state": "^1.4.4",
|
|
35
|
+
"prosemirror-view": "^1.31.0"
|
|
36
|
+
},
|
|
37
|
+
"peerDependencies": {
|
|
38
|
+
"lit": "^3.3.1",
|
|
39
|
+
"prosekit": "^0.18.4"
|
|
38
40
|
},
|
|
39
41
|
"files": [
|
|
40
42
|
"dist"
|