@qti-components/test 1.10.0-next.0 → 1.10.0-next.2

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 +1 @@
1
- {"version":3,"file":"public-events.js","sourceRoot":"","sources":["../src/public-events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAiD1F,MAAM,CAAC,MAAM,aAAa,GAAoD;IAC5E,oBAAoB,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,wBAAwB,EAAE;IAC9F,uBAAuB,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,kBAAkB,EAAE;IAC3F,0BAA0B,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,8BAA8B,EAAE;IAC1G,uBAAuB,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,qBAAqB,EAAE;IAC9F,qBAAqB,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE;IAC9D,8BAA8B,EAAE;QAC9B,IAAI,EAAE,cAAc;QACpB,KAAK,EAAE,MAAM;QACb,UAAU,EAAE,gCAAgC;KAC7C;IACD,6BAA6B,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,sBAAsB,EAAE;IAC1G,oBAAoB,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,iBAAiB,EAAE;IAC5F,kBAAkB,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,+BAA+B,EAAE;IACxG,yBAAyB,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,mBAAmB,EAAE;IACnG,yBAAyB,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,mCAAmC,EAAE;CACpH,CAAC;AAMF;;;GAGG;AACH,MAAM,UAAU,cAAc,CAC5B,MAAmB,EACnB,IAAO,EACP,MAAkE;IAElE,gBAAgB,CAAC,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AACxD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,YAAY,CAC1B,MAAmB,EACnB,IAAO,EACP,OAAuC;IAEvC,cAAc,CAAC,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,OAA6B,CAAC,CAAC;AAC7E,CAAC","sourcesContent":["import { dispatchDeclared, listenDeclared } from '@qti-components/elements/public-events';\n\nimport type { View } from '@qti-components/base';\nimport type { PublicEventDeclaration } from '@qti-components/elements/public-events';\nimport type { QtiTestState } from './types/qti-test-state';\n\n/**\n * The public events of the test. The name tells you it is public: everything here starts with\n * `cito-`; every other event is internal plumbing and may change in any release.\n *\n * Requests are verbs (a host or plugin dispatches them at the test), notifications are past tense\n * (the test dispatches them). All bubble and are composed.\n *\n * `deprecated` is the name this event had before it became public. One helper (`dispatchPublic`,\n * `listenPublic`) sends or handles both names until the next major, then the field goes.\n */\nexport interface NavigationTarget {\n type: 'item' | 'section';\n id: string;\n}\n\nexport interface NavigationFailure {\n message: string;\n details?: unknown;\n itemId?: string;\n sectionId?: string;\n}\n\nexport interface PublicEventMap {\n 'cito-test-navigate': CustomEvent<NavigationTarget>;\n 'cito-test-end-attempt': CustomEvent<unknown>;\n 'cito-test-update-outcome': CustomEvent<{\n assessmentItemRefId: string;\n outcomeVariableId: string;\n value: number | string;\n }>;\n 'cito-test-switch-view': CustomEvent<View>;\n 'cito-test-navigated': CustomEvent<NavigationTarget>;\n 'cito-test-navigation-started': CustomEvent<NavigationTarget>;\n 'cito-test-navigation-failed': CustomEvent<NavigationFailure>;\n 'cito-test-rendered': CustomEvent<{ identifier: string; element: Element }[]>;\n // `cito-test-loaded` (detail: the `QtiAssessmentTest`) is added by qti-assessment-test.ts, so this\n // module imports no element: that import would be a cycle.\n 'cito-test-state-changed': CustomEvent<QtiTestState>;\n 'cito-item-ref-connected': CustomEvent<{ identifier: string; href: string; category: string }>;\n}\n\nexport type PublicEventName = keyof PublicEventMap;\n\nexport const PUBLIC_EVENTS: Record<PublicEventName, PublicEventDeclaration> = {\n 'cito-test-navigate': { kind: 'request', scope: 'test', deprecated: 'qti-request-navigation' },\n 'cito-test-end-attempt': { kind: 'request', scope: 'test', deprecated: 'test-end-attempt' },\n 'cito-test-update-outcome': { kind: 'request', scope: 'test', deprecated: 'test-update-outcome-variable' },\n 'cito-test-switch-view': { kind: 'request', scope: 'test', deprecated: 'on-test-switch-view' },\n 'cito-test-navigated': { kind: 'notification', scope: 'test' },\n 'cito-test-navigation-started': {\n kind: 'notification',\n scope: 'test',\n deprecated: 'qti-navigation-loading-started'\n },\n 'cito-test-navigation-failed': { kind: 'notification', scope: 'test', deprecated: 'qti-navigation-error' },\n 'cito-test-rendered': { kind: 'notification', scope: 'test', deprecated: 'qti-test-loaded' },\n 'cito-test-loaded': { kind: 'notification', scope: 'test', deprecated: 'qti-assessment-test-connected' },\n 'cito-test-state-changed': { kind: 'notification', scope: 'test', deprecated: 'qti-state-changed' },\n 'cito-item-ref-connected': { kind: 'notification', scope: 'item', deprecated: 'qti-assessment-item-ref-connected' }\n};\n\ndeclare global {\n interface HTMLElementEventMap extends PublicEventMap {}\n}\n\n/**\n * Dispatch a public event, and its deprecated name with the same `detail` object. The detail is\n * always an object so `listenPublic` can tell the two apart from one dispatch.\n */\nexport function dispatchPublic<K extends PublicEventName>(\n target: EventTarget,\n name: K,\n detail: PublicEventMap[K] extends CustomEvent<infer D> ? D : never\n): void {\n dispatchDeclared(target, PUBLIC_EVENTS, name, detail);\n}\n\n/**\n * Listen for a public event and its deprecated name; the handler runs once for a sender that\n * dispatched both. See `listenDeclared`.\n */\nexport function listenPublic<K extends PublicEventName>(\n target: EventTarget,\n name: K,\n handler: (e: PublicEventMap[K]) => void\n): void {\n listenDeclared(target, PUBLIC_EVENTS, name, handler as (e: Event) => void);\n}\n"]}
1
+ {"version":3,"file":"public-events.js","sourceRoot":"","sources":["../src/public-events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAmD1F,MAAM,CAAC,MAAM,aAAa,GAAoD;IAC5E,oBAAoB,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,wBAAwB,EAAE;IAC9F,uBAAuB,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,kBAAkB,EAAE;IAC3F,0BAA0B,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,8BAA8B,EAAE;IAC1G,uBAAuB,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,qBAAqB,EAAE;IAC9F,qBAAqB,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE;IAC9D,8BAA8B,EAAE;QAC9B,IAAI,EAAE,cAAc;QACpB,KAAK,EAAE,MAAM;QACb,UAAU,EAAE,gCAAgC;KAC7C;IACD,6BAA6B,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,sBAAsB,EAAE;IAC1G,oBAAoB,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,iBAAiB,EAAE;IAC5F,kBAAkB,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,+BAA+B,EAAE;IACxG,yBAAyB,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,mBAAmB,EAAE;IACnG,yBAAyB,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE;IAClE,uBAAuB,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE;IAChE,yBAAyB,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,mCAAmC,EAAE;CACpH,CAAC;AAMF;;;GAGG;AACH,MAAM,UAAU,cAAc,CAC5B,MAAmB,EACnB,IAAO,EACP,MAAkE;IAElE,gBAAgB,CAAC,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AACxD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,YAAY,CAC1B,MAAmB,EACnB,IAAO,EACP,OAAuC;IAEvC,cAAc,CAAC,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,OAA6B,CAAC,CAAC;AAC7E,CAAC","sourcesContent":["import { dispatchDeclared, listenDeclared } from '@qti-components/elements/public-events';\n\nimport type { View } from '@qti-components/base';\nimport type { PublicEventDeclaration } from '@qti-components/elements/public-events';\nimport type { QtiTestState } from './types/qti-test-state';\n\n/**\n * The public events of the test. The name tells you it is public: everything here starts with\n * `cito-`; every other event is internal plumbing and may change in any release.\n *\n * Requests are verbs (a host or plugin dispatches them at the test), notifications are past tense\n * (the test dispatches them). All bubble and are composed.\n *\n * `deprecated` is the name this event had before it became public. One helper (`dispatchPublic`,\n * `listenPublic`) sends or handles both names until the next major, then the field goes.\n */\nexport interface NavigationTarget {\n type: 'item' | 'section';\n id: string;\n}\n\nexport interface NavigationFailure {\n message: string;\n details?: unknown;\n itemId?: string;\n sectionId?: string;\n}\n\nexport interface PublicEventMap {\n 'cito-test-navigate': CustomEvent<NavigationTarget>;\n 'cito-test-end-attempt': CustomEvent<unknown>;\n 'cito-test-update-outcome': CustomEvent<{\n assessmentItemRefId: string;\n outcomeVariableId: string;\n value: number | string;\n }>;\n 'cito-test-switch-view': CustomEvent<View>;\n 'cito-test-navigated': CustomEvent<NavigationTarget>;\n 'cito-test-navigation-started': CustomEvent<NavigationTarget>;\n 'cito-test-navigation-failed': CustomEvent<NavigationFailure>;\n 'cito-test-rendered': CustomEvent<{ identifier: string; element: Element }[]>;\n // `cito-test-loaded` (detail: the `QtiAssessmentTest`) is added by qti-assessment-test.ts, so this\n // module imports no element: that import would be a cycle.\n 'cito-test-state-changed': CustomEvent<QtiTestState>;\n 'cito-test-items-skipped': CustomEvent<{ ids: string[] }>;\n 'cito-test-end-reached': CustomEvent<Record<string, never>>;\n 'cito-item-ref-connected': CustomEvent<{ identifier: string; href: string; category: string }>;\n}\n\nexport type PublicEventName = keyof PublicEventMap;\n\nexport const PUBLIC_EVENTS: Record<PublicEventName, PublicEventDeclaration> = {\n 'cito-test-navigate': { kind: 'request', scope: 'test', deprecated: 'qti-request-navigation' },\n 'cito-test-end-attempt': { kind: 'request', scope: 'test', deprecated: 'test-end-attempt' },\n 'cito-test-update-outcome': { kind: 'request', scope: 'test', deprecated: 'test-update-outcome-variable' },\n 'cito-test-switch-view': { kind: 'request', scope: 'test', deprecated: 'on-test-switch-view' },\n 'cito-test-navigated': { kind: 'notification', scope: 'test' },\n 'cito-test-navigation-started': {\n kind: 'notification',\n scope: 'test',\n deprecated: 'qti-navigation-loading-started'\n },\n 'cito-test-navigation-failed': { kind: 'notification', scope: 'test', deprecated: 'qti-navigation-error' },\n 'cito-test-rendered': { kind: 'notification', scope: 'test', deprecated: 'qti-test-loaded' },\n 'cito-test-loaded': { kind: 'notification', scope: 'test', deprecated: 'qti-assessment-test-connected' },\n 'cito-test-state-changed': { kind: 'notification', scope: 'test', deprecated: 'qti-state-changed' },\n 'cito-test-items-skipped': { kind: 'notification', scope: 'test' },\n 'cito-test-end-reached': { kind: 'notification', scope: 'test' },\n 'cito-item-ref-connected': { kind: 'notification', scope: 'item', deprecated: 'qti-assessment-item-ref-connected' }\n};\n\ndeclare global {\n interface HTMLElementEventMap extends PublicEventMap {}\n}\n\n/**\n * Dispatch a public event, and its deprecated name with the same `detail` object. The detail is\n * always an object so `listenPublic` can tell the two apart from one dispatch.\n */\nexport function dispatchPublic<K extends PublicEventName>(\n target: EventTarget,\n name: K,\n detail: PublicEventMap[K] extends CustomEvent<infer D> ? D : never\n): void {\n dispatchDeclared(target, PUBLIC_EVENTS, name, detail);\n}\n\n/**\n * Listen for a public event and its deprecated name; the handler runs once for a sender that\n * dispatched both. See `listenDeclared`.\n */\nexport function listenPublic<K extends PublicEventName>(\n target: EventTarget,\n name: K,\n handler: (e: PublicEventMap[K]) => void\n): void {\n listenDeclared(target, PUBLIC_EVENTS, name, handler as (e: Event) => void);\n}\n"]}
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@qti-components/test",
3
3
  "description": "QTI test utilities",
4
- "version": "1.10.0-next.0",
4
+ "version": "1.10.0-next.2",
5
5
  "author": "",
6
6
  "dependencies": {
7
7
  "@heximal/templates": "^0.1.5",
8
- "@qti-components/base": "^2.4.0",
9
- "@qti-components/elements": "^1.10.0-next.0",
10
- "@qti-components/interactions": "^1.10.5-next.0",
11
- "@qti-components/processing": "^1.6.0",
8
+ "@qti-components/base": "^2.4.1-next.0",
9
+ "@qti-components/elements": "^1.10.0-next.1",
10
+ "@qti-components/interactions": "^1.10.5-next.1",
11
+ "@qti-components/processing": "^1.6.1-next.0",
12
12
  "@qti-components/theme": "^2.2.2-next.0",
13
13
  "@qti-components/transformers": "^1.7.3",
14
14
  "@qti-components/utilities": "^1.3.3"