@clickview/player 0.0.3 → 0.0.4-rc.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.
Files changed (86) hide show
  1. package/.storybook/main.js +1 -0
  2. package/.storybook/stories/Base.stories.tsx +6 -5
  3. package/.storybook/stories/Interactives.stories.tsx +45 -49
  4. package/.storybook/stories/utils/mock-playerapi.ts +44 -12
  5. package/dist/en.json +1 -393
  6. package/dist/libs/analytics/src/interfaces/AnalyticsTypes.d.ts +5 -1
  7. package/dist/libs/common/src/backbone/utils/LocalStorageHelper.d.ts +58 -0
  8. package/dist/libs/common/src/react/flight/FlightHelpers.d.ts +2 -1
  9. package/dist/libs/common/src/react/utils/ArrayHelper.d.ts +17 -1
  10. package/dist/libs/shared/src/components/actions/ActionButton.d.ts +2 -0
  11. package/dist/libs/shared/src/components/actions/ActionsDropdown.d.ts +1 -1
  12. package/dist/libs/shared/src/components/icon-button/IconButton.d.ts +2 -0
  13. package/dist/libs/shared/src/components/interactive-questions/InteractionLabel.d.ts +20 -0
  14. package/dist/libs/shared/src/components/popup/Popup.d.ts +2 -0
  15. package/dist/libs/shared/src/enums/ObjectStatus.d.ts +3 -3
  16. package/dist/libs/shared/src/enums/UserGroup.d.ts +3 -3
  17. package/dist/libs/shared/src/enums/UserRole.d.ts +4 -4
  18. package/dist/libs/shared/src/hooks/UseGrabCursorProps.d.ts +15 -0
  19. package/dist/libs/shared/src/images/svg/ImportedSvgs.d.ts +3 -1
  20. package/dist/libs/shared/src/images/svg/objects/index.d.ts +3 -1
  21. package/dist/libs/shared/src/interfaces/models/Classroom.d.ts +2 -1
  22. package/dist/libs/shared/src/interfaces/models/Clip.d.ts +4 -1
  23. package/dist/libs/shared/src/interfaces/models/Config.d.ts +1 -7
  24. package/dist/libs/shared/src/interfaces/models/Customer.d.ts +1 -2
  25. package/dist/libs/shared/src/interfaces/models/InteractiveMetadata.d.ts +4 -0
  26. package/dist/libs/shared/src/interfaces/models/Series.d.ts +3 -0
  27. package/dist/libs/shared/src/interfaces/models/User.d.ts +12 -37
  28. package/dist/libs/shared/src/interfaces/models/Video.d.ts +5 -0
  29. package/dist/libs/shared/src/interfaces/models/interactive-results/StudentAttempt.d.ts +1 -1
  30. package/dist/libs/shared/src/utils/InteractiveCorrectnessHelper.d.ts +16 -0
  31. package/dist/player-app.css +45 -2391
  32. package/dist/player-app.js +122 -5657
  33. package/dist/projects/player/src/components/collapserator/collapserator.d.ts +2 -0
  34. package/dist/projects/player/src/components/landing-splash/landing-splash.d.ts +65 -0
  35. package/dist/projects/player/src/components/landing-splash/metadata/splash-metadata.d.ts +63 -0
  36. package/dist/projects/player/src/components/landing-splash/metadata/splash-title/splash-title.d.ts +62 -0
  37. package/dist/projects/player/src/components/landing-splash/metadata/splash-warning/splash-warning.d.ts +60 -0
  38. package/dist/projects/player/src/components/logo/clickview-logo.d.ts +1 -0
  39. package/dist/projects/player/src/components/menu/menu.d.ts +16 -0
  40. package/dist/projects/player/src/components/menu-button/menu-button.d.ts +1 -0
  41. package/dist/projects/player/src/components/player/player.d.ts +2 -0
  42. package/dist/projects/player/src/components/subs-caps-button/SubCapsMenuItem.d.ts +52 -0
  43. package/dist/projects/player/src/components/subs-caps-button/subtitle-search-menu-item.d.ts +54 -0
  44. package/dist/projects/player/src/components/subs-caps-button/subtitle-size-menu-item.d.ts +53 -0
  45. package/dist/projects/player/src/components/subtitle-search-button/subtitle-result-menu-item.d.ts +15 -0
  46. package/dist/projects/player/src/components/subtitle-search-button/subtitle-search-button.d.ts +30 -0
  47. package/dist/projects/player/src/components/subtitle-search-button/subtitle-search-input.d.ts +27 -0
  48. package/dist/projects/player/src/components/subtitle-size-button/subtitle-size-button.d.ts +1 -0
  49. package/dist/projects/player/src/components/text-track-settings/text-track-settings.d.ts +56 -0
  50. package/dist/projects/player/src/components/thumbnail-display/thumbnail-display.d.ts +1 -0
  51. package/dist/projects/player/src/interfaces/models/PlaybackObject.d.ts +13 -0
  52. package/dist/projects/player/src/players/base-player.d.ts +9 -0
  53. package/dist/projects/player/src/players/interactive-player.d.ts +2 -0
  54. package/dist/projects/player/src/plugins/chromecast-plugin/chromecast-plugin.d.ts +11 -0
  55. package/dist/projects/player/src/plugins/chromecast-plugin/components/chromecast-button.d.ts +1 -0
  56. package/dist/projects/player/src/plugins/chromecast-plugin/session-manager.d.ts +73 -0
  57. package/dist/projects/player/src/plugins/chromecast-plugin/tech/chromecast-tech-ui/chromecast-tech-ui.d.ts +67 -0
  58. package/dist/projects/player/src/plugins/chromecast-plugin/tech/chromecast-tech.d.ts +1 -0
  59. package/dist/projects/player/src/plugins/interactive-plugin/components/seek-bar/interactive-bar-items.d.ts +4 -4
  60. package/dist/projects/player/src/plugins/interactive-plugin/components/sliding-timepoint/sliding-timepoints.d.ts +1 -0
  61. package/dist/projects/player/src/plugins/interactive-plugin/components/timepoint/timepoint-component.d.ts +1 -0
  62. package/dist/projects/player/src/plugins/interactive-plugin/hooks/useInteractiveTrack.d.ts +4 -2
  63. package/dist/projects/player/src/plugins/interactive-plugin/interactive-plugin.d.ts +1 -0
  64. package/dist/projects/player/src/plugins/interactive-plugin/utils/helpers.d.ts +1 -1
  65. package/dist/projects/player/src/plugins/persist-quality-settings-plugin/persist-quality-settings-plugin.d.ts +33 -0
  66. package/dist/projects/player/src/plugins/persist-subtitle-settings-plugin/persist-subtitle-settings-plugin.d.ts +38 -0
  67. package/dist/projects/player/src/plugins/whiteboard-mode-plugin/components/drag-handle/drag-handle.d.ts +53 -0
  68. package/dist/projects/player/src/plugins/whiteboard-mode-plugin/components/drag-targets/drag-targets.d.ts +54 -0
  69. package/dist/projects/player/src/plugins/whiteboard-mode-plugin/components/whiteboard-mode-button/whiteboard-mode-button.d.ts +23 -0
  70. package/dist/projects/player/src/plugins/whiteboard-mode-plugin/components/whiteboard-mode-button/whiteboard-mode-menu-item.d.ts +15 -0
  71. package/dist/projects/player/src/plugins/whiteboard-mode-plugin/contants/WhiteboardSides.d.ts +5 -0
  72. package/dist/projects/player/src/plugins/whiteboard-mode-plugin/interfaces/WhiteboardSide.d.ts +1 -0
  73. package/dist/projects/player/src/plugins/whiteboard-mode-plugin/whiteboard-mode-plugin.d.ts +34 -0
  74. package/dist/projects/player/src/utils/fn.d.ts +30 -0
  75. package/dist/projects/player/src/utils/local-storage-helper.d.ts +6 -0
  76. package/dist/projects/player/src/utils/track-helper.d.ts +1 -0
  77. package/package.json +70 -66
  78. package/typings/utils/imports.d.ts +1 -1
  79. package/dist/libs/shared/src/enums/CustomerType.d.ts +0 -11
  80. package/dist/projects/player/src/plugins/interactive-plugin/components/create-components/create-short-answer.ts/create-short-answer.d.ts +0 -12
  81. package/dist/projects/player/src/plugins/interactive-plugin/components/incomplete-alert/incomplete-alert.d.ts +0 -2
  82. package/dist/projects/player/src/plugins/interactive-plugin/components/interactive/create-interaction-buttons.d.ts +0 -13
  83. package/dist/projects/player/src/plugins/interactive-plugin/components/interactive/useInteractiveTrack.d.ts +0 -20
  84. package/dist/projects/player/src/plugins/interactive-plugin/components/interactive/view-iteraction-buttons.d.ts +0 -13
  85. package/dist/projects/player/src/plugins/interactive-plugin/interfaces/CreateInteractionState.d.ts +0 -4
  86. package/dist/projects/player/src/plugins/interactive-plugin/interfaces/ViewInteractionState.d.ts +0 -3
@@ -0,0 +1,20 @@
1
+ /// <reference types="react" />
2
+ import { Interaction } from 'libs/shared/interfaces';
3
+ interface InteractionLabelProps {
4
+ interaction: Interaction;
5
+ smallIcon?: boolean;
6
+ showIcon?: boolean;
7
+ showTypeName?: boolean;
8
+ showQuestion?: boolean;
9
+ iconClassName?: string;
10
+ typeNameClassName?: string;
11
+ questionClassName?: string;
12
+ }
13
+ export declare function InteractionLabel(props: InteractionLabelProps): JSX.Element;
14
+ export declare namespace InteractionLabel {
15
+ var defaultProps: {
16
+ showIcon: boolean;
17
+ showQuestion: boolean;
18
+ };
19
+ }
20
+ export {};
@@ -2,10 +2,12 @@ import * as React from 'react';
2
2
  import { HashObject } from 'libs/common/react/interfaces';
3
3
  import { Core } from 'libs/common/core';
4
4
  import { AnalyticsOptions } from 'libs/analytics/interfaces';
5
+ import { SvgContainerSize } from 'libs/shared/components/svg-container/SvgContainer';
5
6
  export interface HeaderButton {
6
7
  appLink?: Core.AppLink;
7
8
  onClick?: (e: React.MouseEvent) => void;
8
9
  svgName?: string;
10
+ svgSize?: SvgContainerSize;
9
11
  className?: string;
10
12
  tooltip?: string;
11
13
  showSpinner?: boolean;
@@ -1,5 +1,5 @@
1
1
  export declare enum ObjectStatus {
2
- Disabled = 0,
3
- Active = 1,
4
- Inactive = 2
2
+ Disabled = "Disabled",
3
+ Active = "Active",
4
+ Inactive = "Inactive"
5
5
  }
@@ -1,5 +1,5 @@
1
1
  export declare enum UserGroup {
2
- Unknown = 0,
3
- Staff = 1,
4
- Learner = 2
2
+ Unknown = "unknown",
3
+ Staff = "staff",
4
+ Learner = "learner"
5
5
  }
@@ -8,8 +8,8 @@ export declare enum OnlineUserRole {
8
8
  ReadOnly = 8
9
9
  }
10
10
  export declare enum UserRole {
11
- Guest = 16,
12
- User = 32,
13
- Admin = 48,
14
- SuperAdmin = 64
11
+ Guest = "Guest",
12
+ User = "User",
13
+ Admin = "Admin",
14
+ SuperAdmin = "SuperAdmin"
15
15
  }
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ /**
3
+ * This is a bit of a dumpster fire but it's the only sane solution
4
+ * I could find for implementing proper cursors while using
5
+ * react-sortable-hoc
6
+ * https://github.com/clauderic/react-sortable-hoc/issues/328
7
+ */
8
+ export declare const useGrabCursorProps: () => {
9
+ ref: React.MutableRefObject<HTMLDivElement>;
10
+ style: {
11
+ cursor: string;
12
+ };
13
+ onMouseDown: () => void;
14
+ onMouseUp: () => void;
15
+ };
@@ -87,5 +87,7 @@ export declare enum localSvgs {
87
87
  Print = "print",
88
88
  CreateInteractive = "create-interactive",
89
89
  Twitter = "twitter",
90
- Facebook = "facebook"
90
+ Facebook = "facebook",
91
+ Classrooms = "classrooms",
92
+ Group = "group"
91
93
  }
@@ -26,6 +26,8 @@ import History from './history.svg';
26
26
  import Email from './email.svg';
27
27
  import YearLevel from './year-level.svg';
28
28
  import Subjects from './subjects.svg';
29
+ import Classrooms from './classrooms.svg';
30
+ import Group from './group.svg';
29
31
  import File from './file.svg';
30
32
  import FilePDF from './file-pdf.svg';
31
33
  import FileImg from './file-img.svg';
@@ -35,4 +37,4 @@ import FileZip from './file-zip.svg';
35
37
  import FileExcel from './file-excel.svg';
36
38
  import Twitter from './twitter.svg';
37
39
  import Facebook from './facebook.svg';
38
- export { Archive, Bell, Bookmark, Broadcast, Calendar, Cog, Folder, Handle, Interactive, Link, Playlist, PublisherArchive, Resources, StarOutline, Star, Tag, Time, Video, Subject, Series, File, FilePDF, FileImg, FilePowerpoint, FileWord, FileZip, FileExcel, Heart, HeartOutline, WhiteWave, Compass, History, Email, YearLevel, Subjects, Twitter, Facebook };
40
+ export { Archive, Bell, Bookmark, Broadcast, Calendar, Cog, Folder, Handle, Interactive, Link, Playlist, PublisherArchive, Resources, StarOutline, Star, Tag, Time, Video, Subject, Series, File, FilePDF, FileImg, FilePowerpoint, FileWord, FileZip, FileExcel, Heart, HeartOutline, WhiteWave, Compass, History, Email, YearLevel, Subjects, Twitter, Facebook, Classrooms, Group };
@@ -1,5 +1,6 @@
1
- import { BaseObject, UserCollection } from 'libs/shared/interfaces';
1
+ import { BaseObject, UserCollection, User } from 'libs/shared/interfaces';
2
2
  export interface Classroom extends BaseObject {
3
3
  users?: UserCollection;
4
4
  favouritedBy?: UserCollection;
5
+ owner?: User;
5
6
  }
@@ -1,12 +1,15 @@
1
- import { BaseObject, User, Video } from 'libs/shared/interfaces';
1
+ import { BaseObject, InteractiveCollection, User, Video } from 'libs/shared/interfaces';
2
2
  import { VirtualObject } from './primitives';
3
+ import { CanUpdate } from './Video';
3
4
  export interface Clip extends BaseObject {
4
5
  description?: string;
5
6
  startTime: number;
6
7
  endTime: number;
7
8
  owner?: User;
8
9
  video?: Video;
10
+ interactives?: InteractiveCollection;
9
11
  _isClickViewContent?: IsClickViewContent;
12
+ _canUpdate?: CanUpdate;
10
13
  }
11
14
  interface IsClickViewContent extends VirtualObject {
12
15
  value: boolean;
@@ -3,6 +3,7 @@ import { CountryCode } from 'libs/shared/enums/CountryCode';
3
3
  export interface Config extends BaseObject {
4
4
  supportSiteUrl: string;
5
5
  imageCdnUrl: string;
6
+ countryCode: CountryCode;
6
7
  webPlayerUrl: string;
7
8
  gatewayApiUrl: string;
8
9
  notificationServiceUrl?: string;
@@ -12,11 +13,4 @@ export interface Config extends BaseObject {
12
13
  downloadProxy?: string;
13
14
  primaryUrl?: string;
14
15
  marketingSiteUrl?: string;
15
- /**
16
- * Instance CountryCode
17
- *
18
- * This is NOT the same as the customer/user CountryCode.
19
- * This should only be used for legacy reasons where InstanceRegion is not supported.
20
- */
21
- countryCode: CountryCode;
22
16
  }
@@ -1,8 +1,7 @@
1
1
  import { BaseObject, Country } from 'libs/shared/interfaces';
2
2
  import { Organisation } from './Organisation';
3
3
  export interface Customer extends BaseObject {
4
- crmId: string;
5
- instanceRegion: string;
6
4
  organisation?: Organisation;
5
+ crmId: string;
7
6
  country?: Country;
8
7
  }
@@ -2,7 +2,9 @@ import { CurationStatus } from 'libs/shared/enums/CurationStatus';
2
2
  import { InteractiveOriginType } from 'libs/shared/enums/InteractiveOriginType';
3
3
  import { BaseObject, VirtualObject } from 'libs/shared/interfaces';
4
4
  import { User, Thumbnail, Video } from 'libs/shared/interfaces/models';
5
+ import { Clip } from './Clip';
5
6
  import { Timepoint } from './interactive';
7
+ import { CanUpdate } from './Video';
6
8
  export interface InteractiveMetadata extends BaseObject {
7
9
  status: CurationStatus;
8
10
  interactiveId: string;
@@ -10,10 +12,12 @@ export interface InteractiveMetadata extends BaseObject {
10
12
  description?: string;
11
13
  thumbnail?: Thumbnail;
12
14
  video?: Video;
15
+ clip?: Clip;
13
16
  duration?: number;
14
17
  originType: InteractiveOriginType;
15
18
  _isClickViewContent?: IsClickViewContent;
16
19
  _timepoints?: VirtualTimepoints;
20
+ _canUpdate?: CanUpdate;
17
21
  }
18
22
  export interface HasInteractive extends VirtualObject {
19
23
  value: boolean;
@@ -7,4 +7,7 @@ export interface Series extends BaseObject {
7
7
  videos: VideoCollection;
8
8
  rating?: Rating;
9
9
  subjectPresentationAudiences?: PresentationAudienceCollection;
10
+ metadata?: {
11
+ year?: number;
12
+ };
10
13
  }
@@ -1,8 +1,9 @@
1
- import { BaseObject, Group, Avatar, YearGroup, CustomerCollection, YearGroupCollection } from 'libs/shared/interfaces';
1
+ import { BaseObject, Group, Avatar, YearGroup, CustomerCollection } from 'libs/shared/interfaces';
2
2
  import { UserRole } from 'libs/shared/enums/UserRole';
3
3
  import { OnlineUserRole } from 'libs/shared/enums/UserRole';
4
4
  import { UserGroup } from 'libs/shared/enums/UserGroup';
5
5
  import { ObjectStatus } from 'libs/shared/enums/ObjectStatus';
6
+ import { VirtualObject } from './primitives';
6
7
  export declare type OnlineYearGroup = 'Kindergarten' | 'Year 1' | 'Year 2' | 'Year 3' | 'Year 4' | 'Year 5' | 'Year 6' | 'Year 7' | 'Year 8' | 'Year 9' | 'Year 10' | 'Year 11' | 'Year 12' | 'Year 13' | 'Staff';
7
8
  /**
8
9
  * Master User
@@ -17,14 +18,16 @@ export interface User extends BaseObject {
17
18
  status: ObjectStatus;
18
19
  role: UserRole;
19
20
  customers: CustomerCollection;
20
- yearGroup: OnlineYearGroup;
21
- yearGroups: YearGroupCollection;
22
- masterYearGroup: YearGroup;
23
21
  userType: UserGroup;
24
22
  avatar?: Avatar;
25
23
  isPrimaryContact: boolean;
24
+ isEmailVerified: boolean;
26
25
  roleId: OnlineUserRole;
27
26
  lastSignInDate?: string;
27
+ metadata?: {
28
+ lastSignInTime?: string;
29
+ };
30
+ _yearGroup: VirtualYearGroup;
28
31
  }
29
32
  export interface CuratorUser extends User {
30
33
  userId: string;
@@ -48,40 +51,8 @@ export interface CurrentUser extends BaseObject {
48
51
  emailVerified: boolean;
49
52
  customerId: string;
50
53
  customerName: string;
51
- customerLogo: string;
52
- /**
53
- * Regional instance the user (and their cusomter) belong to.
54
- *
55
- * @remarks
56
- * This effectively dictates which region the user and their customer reside in and should be used
57
- * in any scenario where data needs to be collected, controlled or mapped within that same region.
58
- *
59
- * Examples:
60
- * 1. Any logic that relies on OnlineDB
61
- * 2. Analytics data should all be logged in the same region, irrespective of where they're logged in.
62
- * 3. Uploaded files and videos should all be targeted to the same region.
63
- *
64
- * This is not the same as CountryCode or ContentRegion.
65
- */
66
- instanceRegion: string;
67
- /**
68
- * The content set the user should have access to.
69
- *
70
- * @remarks
71
- * Content is not tied to a country or instance region.
72
- */
73
- contentRegion: string;
74
- /**
75
- * User's Country in Master
76
- *
77
- * @remarks
78
- * In most circumstances you'll want to use the user's InstanceRegion or ContentRegion over this.
79
- * This is also different to the instance CountryCode used in the Config.
80
- *
81
- * Example:
82
- * Scottish User/Customer will have their CountryCode set to GBR, not the UK.
83
- */
84
54
  countryCode: string;
55
+ customerLogo: string;
85
56
  }
86
57
  /**
87
58
  * Current User for Online
@@ -93,3 +64,7 @@ export interface OnlineCurrentUser extends CurrentUser {
93
64
  onlineRole: OnlineUserRole;
94
65
  maxAllowedRating: number;
95
66
  }
67
+ interface VirtualYearGroup extends VirtualObject {
68
+ value: YearGroup;
69
+ }
70
+ export {};
@@ -2,6 +2,7 @@ import { BaseObject, CompanyCollection, PersonCollection, CategoryCollection, Ch
2
2
  import { HasCurriculumLinks } from './Curriculum';
3
3
  import { User } from './User';
4
4
  import { SubtitleCollection } from '../collections';
5
+ import { VirtualObject } from './primitives';
5
6
  export interface Video extends BaseObject {
6
7
  categories?: CategoryCollection;
7
8
  channel?: Channel;
@@ -36,5 +37,9 @@ export interface Video extends BaseObject {
36
37
  _videoProgress?: VideoProgress;
37
38
  _hasCurriculumLinks?: HasCurriculumLinks;
38
39
  _curriculumLinks?: CurriculumLinks;
40
+ _canUpdate?: CanUpdate;
39
41
  hasInteractives?: boolean;
40
42
  }
43
+ export interface CanUpdate extends VirtualObject {
44
+ value: boolean;
45
+ }
@@ -2,5 +2,5 @@ import { StudentAnswer } from 'libs/shared/interfaces';
2
2
  export interface StudentAttempt {
3
3
  id: string;
4
4
  answeredAt: number;
5
- answers: StudentAnswer;
5
+ answers: StudentAnswer[];
6
6
  }
@@ -0,0 +1,16 @@
1
+ import { Interaction, StudentAnswer } from 'libs/shared/interfaces';
2
+ import { InteractionCorrectness } from 'libs/shared/enums/InteractionCorrectness';
3
+ declare type GetStudentAnswerByActionableItemId = (id: string) => string;
4
+ declare function notApplicable(): InteractionCorrectness;
5
+ declare function awaitingMarking(): InteractionCorrectness;
6
+ declare function isMissingWordCorrect(interaction: Interaction, getStudentAnswer: GetStudentAnswerByActionableItemId): InteractionCorrectness;
7
+ declare function isMultipleChoiceCorrect(interaction: Interaction, getStudentAnswer: GetStudentAnswerByActionableItemId): InteractionCorrectness;
8
+ declare function isShortAnswerMarkedCorrect(interaction: Interaction, getStudentAnswer: (id: string) => StudentAnswer): InteractionCorrectness;
9
+ export declare const InteractiveCorrectnessHelper: {
10
+ notApplicable: typeof notApplicable;
11
+ awaitingMarking: typeof awaitingMarking;
12
+ isMissingWordCorrect: typeof isMissingWordCorrect;
13
+ isMultipleChoiceCorrect: typeof isMultipleChoiceCorrect;
14
+ isShortAnswerMarkedCorrect: typeof isShortAnswerMarkedCorrect;
15
+ };
16
+ export {};