Skip to content

Commit

Permalink
Merge pull request #8 from chemmedia/7-provide-context-where-asset-is…
Browse files Browse the repository at this point in the history
…-embedded

add context
  • Loading branch information
martinkutter authored Apr 19, 2023
2 parents 528060e + 652348c commit ad03e8e
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 2 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,13 +219,29 @@ interface LMSData {
learnerName: string;
}
export enum ContextType {
MEDIUM = 'medium',
QUESTION = 'question',
SECTION = 'section',
CONTENT = 'content',
CHAPTER = 'chapter',
SITE = 'site',
}
export interface Context {
uid: string;
type: ContextType;
title?: string; // HTML string
}
interface Configuration {
suspendData: string;
sharedData: string;
assetType: AssetType;
isEvaluated: boolean;
lmsData: LMSData;
design: Design; // see https://github.com/chemmedia/knowledgeworker-embedded-asset-api-ui
context: Context[];
}
```

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "knowledgeworker-embedded-asset-api",
"version": "2.0.0",
"version": "2.1.0",
"author": "chemmedia AG",
"description": "A javascript library to integrate rich content packages into responsive Knowledgeworker Create contents.",
"keywords": [
Expand Down
18 changes: 17 additions & 1 deletion src/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,29 @@ export interface LMSData {
learnerName: string;
}

export enum ContextType {
MEDIUM = 'medium',
QUESTION = 'question',
SECTION = 'section',
CONTENT = 'content',
CHAPTER = 'chapter',
SITE = 'site',
}

export interface Context {
uid: string;
type: ContextType;
title?: string; // HTML string
}

export interface Configuration {
suspendData: string;
sharedData: string;
assetType: AssetType;
isEvaluated: boolean;
lmsData: LMSData;
design: Design;
context: Context[];
}

export interface InternalConfiguration extends Configuration {
Expand All @@ -78,4 +94,4 @@ export interface Listeners {
reset?: () => void;
setDesign?: (design: Design) => void;
setSharedData?: (sharedData: string) => void;
}
}

0 comments on commit ad03e8e

Please sign in to comment.