@clickview/curator 1.0.23 → 1.0.24-rc.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.
Files changed (37) hide show
  1. package/dist/curator-app.css.map +1 -1
  2. package/dist/curator-app.js +1 -1
  3. package/dist/curator-app.js.map +1 -1
  4. package/dist/libs/shared/src/apps/upload/utils/FileExtensionsHelper.d.ts +9 -0
  5. package/dist/libs/shared/src/components/image-cropper/ImageCropper.d.ts +10 -0
  6. package/dist/libs/shared/src/context/ImageStorageContext.d.ts +45 -0
  7. package/dist/libs/shared/src/enums/PermissionName.d.ts +23 -0
  8. package/dist/libs/shared/src/enums/PlayerMediaType.d.ts +5 -0
  9. package/dist/libs/shared/src/enums/ResourceFileType.d.ts +9 -0
  10. package/dist/libs/shared/src/enums/UserGroup.d.ts +5 -0
  11. package/dist/libs/shared/src/flight-requests/ImageRequests.d.ts +7 -0
  12. package/dist/libs/shared/src/flight-requests/RatingRequests.d.ts +4 -0
  13. package/dist/libs/shared/src/interfaces/collections/SubtitleCollection.d.ts +3 -0
  14. package/dist/libs/shared/src/interfaces/models/FileUpload.d.ts +20 -0
  15. package/dist/libs/shared/src/interfaces/models/InteractiveMetadata.d.ts +11 -0
  16. package/dist/libs/shared/src/interfaces/models/Language.d.ts +4 -0
  17. package/dist/libs/shared/src/interfaces/models/Pdf.d.ts +4 -0
  18. package/dist/libs/shared/src/interfaces/models/PlayerViewKey.d.ts +3 -0
  19. package/dist/libs/shared/src/interfaces/models/Subtitle.d.ts +7 -0
  20. package/dist/libs/shared/src/interfaces/models/interactive/ActionableItem.d.ts +6 -0
  21. package/dist/libs/shared/src/interfaces/models/interactive/Interaction.d.ts +16 -0
  22. package/dist/libs/shared/src/interfaces/models/interactive/InteractionType.d.ts +7 -0
  23. package/dist/libs/shared/src/interfaces/models/interactive/InteractionTypeId.d.ts +8 -0
  24. package/dist/libs/shared/src/interfaces/models/interactive/Interactive.d.ts +7 -0
  25. package/dist/libs/shared/src/interfaces/models/interactive/Timepoint.d.ts +9 -0
  26. package/dist/libs/shared/src/interfaces/models/interactive/index.d.ts +6 -0
  27. package/dist/libs/shared/src/interfaces/requests/CreateOrUpdateClipRequest.d.ts +6 -0
  28. package/dist/libs/shared/src/interfaces/requests/CreateViewKeyRequest.d.ts +5 -0
  29. package/dist/libs/shared/src/interfaces/requests/UpdateObjectChannel.d.ts +3 -0
  30. package/dist/libs/shared/src/interfaces/requests/UpdateObjectRating.d.ts +3 -0
  31. package/dist/libs/shared/src/interfaces/requests/UpdateResourceRequest.d.ts +3 -0
  32. package/dist/libs/shared/src/interfaces/services/BaseConfigDataService.d.ts +5 -0
  33. package/dist/libs/shared/src/utils/ImageSelectHelper.d.ts +6 -0
  34. package/dist/libs/shared/src/views/image-upload/ImageUploadView.d.ts +9 -0
  35. package/dist/projects/curator/src/apps/subjects/components/levels/select-levels/SelectLevels.d.ts +0 -1
  36. package/dist/projects/curator/src/apps/subjects/components/subjects/select-subjects/SelectSubjects.d.ts +0 -1
  37. package/package.json +47 -47
@@ -0,0 +1,9 @@
1
+ declare const FileExtensions: {
2
+ IMAGES: string;
3
+ RESOURCES: string;
4
+ SUBTITLES: string;
5
+ };
6
+ declare const FileExtensionHelper: {
7
+ getResourceType(extension: string): string;
8
+ };
9
+ export { FileExtensions, FileExtensionHelper };
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ interface ImageCropperProps {
3
+ dataUrl: string;
4
+ minHeight: number;
5
+ minWidth: number;
6
+ onCrop: (dataUrl: string) => void;
7
+ onCancel: () => void;
8
+ }
9
+ export declare function ImageCropper(props: ImageCropperProps): React.ReactElement;
10
+ export {};
@@ -0,0 +1,45 @@
1
+ import * as React from 'react';
2
+ import { Image } from "../interfaces";
3
+ /**
4
+ * This context is used for transferring image
5
+ * data between different areas of the application.
6
+ *
7
+ * It stores base64 image files that have been read
8
+ * in from ImageSelect component for the purpose of
9
+ * being cropped and uploaded in ImageUploadView.
10
+ *
11
+ * Image objects uploaded in ImageUploadView can then be
12
+ * stored in the context for use in the component
13
+ * that initially requested the upload.
14
+ */
15
+ interface IImageStorageContext {
16
+ /**
17
+ * Retrieve the stored base64 dataUrl. This will
18
+ * reset the stored value after it is read.
19
+ */
20
+ getDataUrl: () => string;
21
+ /**
22
+ * Set the stored dataUrl.
23
+ */
24
+ setDataUrl: (dataUrl: string) => void;
25
+ /**
26
+ * Retrieve the stored image object. This will
27
+ * reset the stored image object.
28
+ */
29
+ getImage: () => Image;
30
+ /**
31
+ * Store an image after it has been successfully
32
+ * uploaded.
33
+ */
34
+ setImage: (image: Image) => void;
35
+ /**
36
+ * Flag to notify anything using this context
37
+ * that an image has been uploaded.
38
+ */
39
+ imageUploaded: boolean;
40
+ }
41
+ export declare const ImageStorageContext: React.Context<IImageStorageContext>;
42
+ export declare const ImageStorageContextProvider: ({ children }: {
43
+ children?: React.ReactNode;
44
+ }) => JSX.Element;
45
+ export {};
@@ -0,0 +1,23 @@
1
+ export declare type PermissionsLookup = {
2
+ [key in PermissionName]: boolean;
3
+ };
4
+ export declare enum PermissionName {
5
+ ManageUsers = "users.manage",
6
+ FollowSubjects = "subjects.follow",
7
+ ManageSubjectPreferences = "subjects.preferences.manage",
8
+ CreateClassrooms = "classrooms.create",
9
+ ViewClassrooms = "classrooms.view",
10
+ SharePlaylists = "playlists.share",
11
+ CreatePlaylists = "playlists.create",
12
+ ViewPlaylists = "playlists.view",
13
+ FollowPlaylists = "playlists.follow",
14
+ ViewVideos = "videos.view",
15
+ ShareVideos = "videos.share",
16
+ UploadVideos = "videos.upload",
17
+ FavouriteVideos = "videos.favourite",
18
+ CreateInteractives = "interactives.create",
19
+ ViewInteractives = "interactives.view",
20
+ CreateClips = "clips.create",
21
+ ViewClips = "clips.view",
22
+ EditProfile = "settings.editprofile"
23
+ }
@@ -0,0 +1,5 @@
1
+ export declare enum PlayerMediaType {
2
+ MasterClip = "MasterClip",
3
+ MasterInteractive = "MasterInteractive",
4
+ MasterVideo = "MasterVideo"
5
+ }
@@ -0,0 +1,9 @@
1
+ export declare enum ResourceFileType {
2
+ Pdf = "pdf",
3
+ Image = "image",
4
+ PowerPoint = "powerpoint",
5
+ Document = "document",
6
+ Excel = "excel",
7
+ Zip = "archive",
8
+ File = "text"
9
+ }
@@ -0,0 +1,5 @@
1
+ export declare enum UserGroup {
2
+ Unknown = 0,
3
+ Staff = 1,
4
+ Learner = 2
5
+ }
@@ -0,0 +1,7 @@
1
+ import { Flight } from "../../../common/src/react";
2
+ import { Xhr } from "../../../common/src/backbone/interfaces/Xhr";
3
+ import { HashObject } from "../../../common/src/react/interfaces";
4
+ import { ImageType } from "../enums/Images";
5
+ export declare const ImageRequests: {
6
+ uploadBase64Image(dataUrl: string, type: ImageType, success?: (data: HashObject<any>) => void, error?: (xhr: Xhr) => void, always?: () => void): Flight.Request;
7
+ };
@@ -0,0 +1,4 @@
1
+ import { Flight } from "../../../common/src/react";
2
+ export declare const RatingRequests: {
3
+ ratings(): Flight.Request;
4
+ };
@@ -0,0 +1,3 @@
1
+ import { BasePaginatedCollection, Subtitle } from "./..";
2
+ export interface SubtitleCollection extends BasePaginatedCollection<Subtitle> {
3
+ }
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Interface for a file uploaded
3
+ * to FileApi
4
+ */
5
+ export interface FileUpload {
6
+ id: string;
7
+ file: {
8
+ cvUpload: {
9
+ uploadId: string;
10
+ ingestUrl: string;
11
+ };
12
+ };
13
+ fileInfo: {
14
+ id: string;
15
+ name: string;
16
+ extension: string;
17
+ size: number;
18
+ url: string;
19
+ };
20
+ }
@@ -0,0 +1,11 @@
1
+ import { BaseObject } from "./..";
2
+ import { User } from './User';
3
+ import { Thumbnail } from './Thumbnail';
4
+ import { Video } from './Video';
5
+ export interface InteractiveMetadata extends BaseObject {
6
+ interactiveId: string;
7
+ owner: User;
8
+ description?: string;
9
+ thumbnail?: Thumbnail;
10
+ video?: Video;
11
+ }
@@ -0,0 +1,4 @@
1
+ export interface Language {
2
+ code: string;
3
+ name: string;
4
+ }
@@ -0,0 +1,4 @@
1
+ import { BaseObject } from './primitives';
2
+ export interface Pdf extends BaseObject {
3
+ url: string;
4
+ }
@@ -0,0 +1,3 @@
1
+ export interface PlayerViewKey {
2
+ viewKey: string;
3
+ }
@@ -0,0 +1,7 @@
1
+ import { BaseObject } from './primitives';
2
+ export interface Subtitle extends BaseObject {
3
+ language: string;
4
+ metadata: {
5
+ autoGenerated?: boolean;
6
+ };
7
+ }
@@ -0,0 +1,6 @@
1
+ import { BaseObject } from "../primitives/BaseObject";
2
+ export interface ActionableItem extends BaseObject {
3
+ order: number;
4
+ isCorrect?: boolean;
5
+ interactionId: string;
6
+ }
@@ -0,0 +1,16 @@
1
+ import { HashObject } from "../../../../../common/src/react/interfaces/HashObject";
2
+ import { BaseObject } from "../primitives/BaseObject";
3
+ import { ActionableItem } from './ActionableItem';
4
+ import { InteractionType } from './InteractionType';
5
+ import { InteractionTypeId } from './InteractionTypeId';
6
+ export interface Interaction extends BaseObject {
7
+ typeId: InteractionTypeId;
8
+ type: InteractionType;
9
+ timepointId: string;
10
+ order: number;
11
+ interactiveId: string;
12
+ errorMessage?: string;
13
+ description?: string;
14
+ data: HashObject;
15
+ actionableItems?: ActionableItem[];
16
+ }
@@ -0,0 +1,7 @@
1
+ import { InteractionTypeId } from './InteractionTypeId';
2
+ export interface InteractionType {
3
+ id: InteractionTypeId;
4
+ name: string;
5
+ colour: string;
6
+ icon: string;
7
+ }
@@ -0,0 +1,8 @@
1
+ export declare enum InteractionTypeId {
2
+ MultipleChoice = 1,
3
+ ShortAnswer = 2,
4
+ TrueOrFalse = 3,
5
+ Annotation = 4,
6
+ Image = 5,
7
+ MissingWord = 6
8
+ }
@@ -0,0 +1,7 @@
1
+ import { BaseObject } from "../primitives/BaseObject";
2
+ import { Timepoint } from './Timepoint';
3
+ export interface Interactive extends BaseObject {
4
+ immediateFeedback: boolean;
5
+ posterImage?: string;
6
+ timepoints?: Timepoint[];
7
+ }
@@ -0,0 +1,9 @@
1
+ import { BaseObject } from "../primitives/BaseObject";
2
+ import { Interaction } from './Interaction';
3
+ export interface Timepoint extends BaseObject {
4
+ interactiveId: string;
5
+ shouldPause: number;
6
+ visibleAt: number;
7
+ visibleFor?: number;
8
+ interactions?: Interaction[];
9
+ }
@@ -0,0 +1,6 @@
1
+ export * from './ActionableItem';
2
+ export * from './Interaction';
3
+ export * from './InteractionType';
4
+ export * from './InteractionTypeId';
5
+ export * from './Interactive';
6
+ export * from './Timepoint';
@@ -0,0 +1,6 @@
1
+ export interface CreateOrUpdateClipRequest {
2
+ name: string;
3
+ description?: string;
4
+ startTime: number;
5
+ endTime: number;
6
+ }
@@ -0,0 +1,5 @@
1
+ import { PlayerMediaType } from "../../enums/PlayerMediaType";
2
+ export interface CreateViewKeyRequest {
3
+ mediaId: string;
4
+ mediaType: PlayerMediaType;
5
+ }
@@ -0,0 +1,3 @@
1
+ export interface UpdateObjectChannel {
2
+ id: string;
3
+ }
@@ -0,0 +1,3 @@
1
+ export interface UpdateObjectRating {
2
+ id: string;
3
+ }
@@ -0,0 +1,3 @@
1
+ export interface UpdateResourceRequest {
2
+ name: string;
3
+ }
@@ -0,0 +1,5 @@
1
+ import { Config } from "./..";
2
+ export interface BaseConfigDataService {
3
+ getConfig(success?: (config: Config) => void, error?: () => void): void;
4
+ getVersion(success?: (version: string) => void, error?: () => void): void;
5
+ }
@@ -0,0 +1,6 @@
1
+ import { ImageType } from "../enums/Images";
2
+ export declare const ImageSelectHelper: {
3
+ onFileSelect(imageType: ImageType, files: FileList, onImageLoad: (image: HTMLImageElement) => void): void;
4
+ onReaderLoad(reader: FileReader, imageType: ImageType, onImageLoad: (image: HTMLImageElement) => void): void;
5
+ isImageValid(imageType: ImageType, image: HTMLImageElement): boolean;
6
+ };
@@ -0,0 +1,9 @@
1
+ import * as React from 'react';
2
+ import { PopupViewProps } from "../../interfaces";
3
+ import { ImageType } from "../../enums/Images";
4
+ interface ImageUploadViewProps extends PopupViewProps {
5
+ imageType: ImageType;
6
+ popupSize?: 'sm' | 'lg' | 'xl';
7
+ }
8
+ export declare function ImageUploadView(props: ImageUploadViewProps): React.ReactElement;
9
+ export {};
@@ -3,7 +3,6 @@ import { Level } from "../../../interfaces";
3
3
  import { SubjectMemberType } from "../../../enums";
4
4
  interface SelectLevelsFormValues {
5
5
  backboneAudienceIds: string[];
6
- addToAudiences: boolean;
7
6
  }
8
7
  interface SelectLevelsProps {
9
8
  initialValues: SelectLevelsFormValues;
@@ -3,7 +3,6 @@ import { SubjectTree } from "../../../interfaces";
3
3
  import { SubjectMemberType } from "../../../enums";
4
4
  interface SelectSubjectsFormValues {
5
5
  backboneClassificationIds: string[];
6
- addToClassifications?: boolean;
7
6
  }
8
7
  interface SelectSubjectsProps {
9
8
  initialValues: SelectSubjectsFormValues;
package/package.json CHANGED
@@ -1,47 +1,47 @@
1
- {
2
- "name": "@clickview/curator",
3
- "version": "1.0.23",
4
- "description": "curator",
5
- "main": "dist/curator-app.js",
6
- "types": "dist/index.d.ts",
7
- "scripts": {
8
- "start": "set NODE_ENV=development&& webpack -w --config ./tooling/webpack.config.js",
9
- "build": "set NODE_ENV=production&& webpack --config ./tooling/webpack.config.js",
10
- "dev-build": "set NODE_ENV=development&& webpack --config ./tooling/webpack.config.js"
11
- },
12
- "repository": {
13
- "type": "git",
14
- "url": "http://gitlab.cvinternal.net/front-end/curator.git"
15
- },
16
- "cv": {
17
- "publishable": true,
18
- "rebuildable": true
19
- },
20
- "author": "Matt Trengrove",
21
- "license": "ISC",
22
- "devDependencies": {
23
- "@clickview/tooling": "0.0.18",
24
- "@types/cropperjs": "1.3.0",
25
- "@types/react-copy-to-clipboard": "4.3.0",
26
- "@types/react-transition-group": "4.2.3",
27
- "@types/yup": "0.26.24"
28
- },
29
- "dependencies": {
30
- "@clickview/styles": "1.0.11",
31
- "cropperjs": "1.5.6",
32
- "marked": "0.8.0",
33
- "react-copy-to-clipboard": "5.0.2",
34
- "yup": "0.27.0"
35
- },
36
- "babel": {
37
- "presets": [
38
- [
39
- "@babel/preset-env",
40
- {
41
- "corejs": 2,
42
- "useBuiltIns": "entry"
43
- }
44
- ]
45
- ]
46
- }
47
- }
1
+ {
2
+ "name": "@clickview/curator",
3
+ "version": "1.0.24-rc.0",
4
+ "description": "curator",
5
+ "main": "dist/curator-app.js",
6
+ "types": "dist/index.d.ts",
7
+ "scripts": {
8
+ "start": "set NODE_ENV=development&& webpack -w --config ./tooling/webpack.config.js",
9
+ "build": "set NODE_ENV=production&& webpack --config ./tooling/webpack.config.js",
10
+ "dev-build": "set NODE_ENV=development&& webpack --config ./tooling/webpack.config.js"
11
+ },
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "http://gitlab.cvinternal.net/front-end/curator.git"
15
+ },
16
+ "cv": {
17
+ "publishable": true,
18
+ "rebuildable": true
19
+ },
20
+ "author": "Matt Trengrove",
21
+ "license": "ISC",
22
+ "devDependencies": {
23
+ "@clickview/tooling": "0.0.18",
24
+ "@types/cropperjs": "1.3.0",
25
+ "@types/react-copy-to-clipboard": "4.3.0",
26
+ "@types/react-transition-group": "4.2.3",
27
+ "@types/yup": "0.26.24"
28
+ },
29
+ "dependencies": {
30
+ "@clickview/styles": "1.0.11",
31
+ "cropperjs": "1.5.6",
32
+ "marked": "0.8.0",
33
+ "react-copy-to-clipboard": "5.0.2",
34
+ "yup": "0.27.0"
35
+ },
36
+ "babel": {
37
+ "presets": [
38
+ [
39
+ "@babel/preset-env",
40
+ {
41
+ "corejs": 2,
42
+ "useBuiltIns": "entry"
43
+ }
44
+ ]
45
+ ]
46
+ }
47
+ }