@qti-editor/interaction-associate 0.2.0 → 1.1.0

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.
@@ -1,3 +1,4 @@
1
+ import { createAssociateCorrectResponsePlugin } from './extensions/correct-response.js';
1
2
  export declare const associateInteractionDescriptor: {
2
3
  tagName: string;
3
4
  nodeTypeName: string;
@@ -5,6 +6,7 @@ export declare const associateInteractionDescriptor: {
5
6
  name: string;
6
7
  spec: import("prosemirror-model").NodeSpec;
7
8
  }[];
9
+ pluginFactories: (typeof createAssociateCorrectResponsePlugin)[];
8
10
  insertCommand: import("prosemirror-state").Command;
9
11
  keyboardShortcut: string;
10
12
  enterCommand: import("prosemirror-state").Command;
@@ -1 +1 @@
1
- {"version":3,"file":"descriptor.d.ts","sourceRoot":"","sources":["../src/descriptor.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgBV,CAAC"}
1
+ {"version":3,"file":"descriptor.d.ts","sourceRoot":"","sources":["../src/descriptor.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,oCAAoC,EAAE,MAAM,kCAAkC,CAAC;AAKxF,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiBV,CAAC"}
@@ -3,6 +3,7 @@ import { insertAssociateInteraction, qtiAssociateEnterCommand } from './componen
3
3
  import { qtiAssociateInteractionNodeSpec } from './components/qti-associate-interaction/qti-associate-interaction.schema.js';
4
4
  import { associateInteractionComposerMetadata, associateNodeAttributePanelMetadataByNodeTypeName } from './composer/metadata.js';
5
5
  import { associateComposerHandler } from './composer/handler.js';
6
+ import { createAssociateCorrectResponsePlugin } from './extensions/correct-response.js';
6
7
  export const associateInteractionDescriptor = {
7
8
  tagName: 'qti-associate-interaction',
8
9
  nodeTypeName: 'qtiAssociateInteraction',
@@ -13,6 +14,7 @@ export const associateInteractionDescriptor = {
13
14
  { name: 'qtiSimpleAssociableChoice', spec: qtiSimpleAssociableChoiceNodeSpec },
14
15
  { name: 'qtiSimpleAssociableChoiceParagraph', spec: qtiSimpleAssociableChoiceParagraphNodeSpec },
15
16
  ],
17
+ pluginFactories: [createAssociateCorrectResponsePlugin],
16
18
  insertCommand: insertAssociateInteraction,
17
19
  keyboardShortcut: 'Mod-Shift-a',
18
20
  enterCommand: qtiAssociateEnterCommand,
@@ -1,4 +1,5 @@
1
1
  import { type Extension } from 'prosekit/core';
2
+ import { Plugin } from 'prosekit/pm/state';
2
3
  /**
3
4
  * Event name for associate pair changes.
4
5
  */
@@ -10,4 +11,5 @@ export declare const ASSOCIATE_PAIR_CHANGE_EVENT = "associate-pair-change";
10
11
  * interaction node's correctResponse attribute.
11
12
  */
12
13
  export declare function defineAssociateCorrectResponseExtension(): Extension;
14
+ export declare function createAssociateCorrectResponsePlugin(): Plugin;
13
15
  //# 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,EAAgB,KAAK,SAAS,EAAE,MAAM,eAAe,CAAC;AAQ7D;;GAEG;AACH,eAAO,MAAM,2BAA2B,0BAA0B,CAAC;AAyBnE;;;;;GAKG;AACH,wBAAgB,uCAAuC,IAAI,SAAS,CAmCnE"}
1
+ {"version":3,"file":"correct-response.d.ts","sourceRoot":"","sources":["../../src/extensions/correct-response.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,SAAS,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAa,MAAM,mBAAmB,CAAC;AAOtD;;GAEG;AACH,eAAO,MAAM,2BAA2B,0BAA0B,CAAC;AAyBnE;;;;;GAKG;AACH,wBAAgB,uCAAuC,IAAI,SAAS,CAEnE;AAED,wBAAgB,oCAAoC,IAAI,MAAM,CAgC7D"}
@@ -32,7 +32,10 @@ function findInteractionNodePos(view, interactionElement) {
32
32
  * interaction node's correctResponse attribute.
33
33
  */
34
34
  export function defineAssociateCorrectResponseExtension() {
35
- return definePlugin(() => new Plugin({
35
+ return definePlugin(createAssociateCorrectResponsePlugin);
36
+ }
37
+ export function createAssociateCorrectResponsePlugin() {
38
+ return new Plugin({
36
39
  key: associateCorrectResponsePluginKey,
37
40
  view(view) {
38
41
  const handlePairChange = (event) => {
@@ -58,5 +61,5 @@ export function defineAssociateCorrectResponseExtension() {
58
61
  },
59
62
  };
60
63
  },
61
- }));
64
+ });
62
65
  }
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": "0.2.0",
4
+ "version": "1.1.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/Citolab/qti-editor",
@@ -24,8 +24,8 @@
24
24
  "@qti-components/associate-interaction": "^1.1.3",
25
25
  "@qti-components/interactions": "1.10.1",
26
26
  "@qti-components/utilities": "1.3.2",
27
- "@qti-editor/interaction-shared": "0.2.1",
28
- "@qti-editor/interfaces": "0.3.0"
27
+ "@qti-editor/interaction-shared": "1.1.0",
28
+ "@qti-editor/interfaces": "1.1.0"
29
29
  },
30
30
  "peerDependencies": {
31
31
  "lit": "^3.3.1"