@clickview/player 0.0.2 → 0.0.3-dev-us.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.
Files changed (149) 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 +38 -12
  5. package/dist/en.json +733 -0
  6. package/dist/libs/analytics/src/constants/CountryRegionMapping.d.ts +1 -0
  7. package/dist/libs/analytics/src/constants/Regions.d.ts +1 -0
  8. package/dist/libs/analytics/src/enums/CountryCode.d.ts +2 -1
  9. package/dist/libs/analytics/src/enums/RegionName.d.ts +2 -1
  10. package/dist/libs/analytics/src/interfaces/AnalyticsTypes.d.ts +16 -7
  11. package/dist/libs/analytics/src/interfaces/Region.d.ts +0 -1
  12. package/dist/libs/common/src/backbone/core/AppLink.d.ts +1 -0
  13. package/dist/libs/common/src/backbone/core/LocationUtils.d.ts +1 -0
  14. package/dist/libs/common/src/backbone/enums/HttpStatus.d.ts +10 -0
  15. package/dist/libs/common/src/backbone/utils/LocalStorageHelper.d.ts +58 -0
  16. package/dist/libs/common/src/react/flight/FlightHelpers.d.ts +15 -0
  17. package/dist/libs/common/src/react/flight/FlightMiddleware.d.ts +11 -0
  18. package/dist/libs/common/src/react/flight/FlightReducer.d.ts +2 -0
  19. package/dist/libs/common/src/react/flight/FlightSimulator.d.ts +24 -0
  20. package/dist/libs/common/src/react/flight/constants/Actions.d.ts +7 -0
  21. package/dist/libs/common/src/react/flight/constants/index.d.ts +1 -0
  22. package/dist/libs/common/src/react/flight/data-layers/AjaxRequest.d.ts +2 -0
  23. package/dist/libs/common/src/react/flight/data-layers/index.d.ts +1 -0
  24. package/dist/libs/common/src/react/flight/index.d.ts +9 -0
  25. package/dist/libs/common/src/react/flight/interfaces/Action.d.ts +28 -0
  26. package/dist/libs/common/src/react/flight/interfaces/Dispatch.d.ts +3 -0
  27. package/dist/libs/common/src/react/flight/interfaces/HttpRequest.d.ts +27 -0
  28. package/dist/libs/common/src/react/flight/interfaces/NormalizedData.d.ts +7 -0
  29. package/dist/libs/common/src/react/flight/interfaces/Response.d.ts +9 -0
  30. package/dist/libs/common/src/react/flight/interfaces/index.d.ts +9 -0
  31. package/dist/libs/common/src/react/flight/normalizer/Denormalizer.d.ts +3 -0
  32. package/dist/libs/common/src/react/flight/normalizer/Normalizer.d.ts +8 -0
  33. package/dist/libs/common/src/react/flight/normalizer/index.d.ts +2 -0
  34. package/dist/libs/common/src/react/flight/utils/SimulatorHelper.d.ts +5 -0
  35. package/dist/libs/common/src/react/flight/utils/StateHelper.d.ts +11 -0
  36. package/dist/libs/common/src/react/flight/utils/index.d.ts +2 -0
  37. package/dist/libs/common/src/react/utils/ArrayHelper.d.ts +17 -1
  38. package/dist/libs/common/src/react/utils/ObjectHelper.d.ts +1 -0
  39. package/dist/libs/common/src/react/utils/TimeHelper.d.ts +8 -0
  40. package/dist/libs/shared/src/components/actions/Actions.d.ts +2 -2
  41. package/dist/libs/shared/src/components/actions/ActionsDropdown.d.ts +1 -1
  42. package/dist/libs/shared/src/components/app-link/AppLink.d.ts +8 -0
  43. package/dist/libs/shared/src/components/immersive-reader/ImmersiveReader.d.ts +14 -0
  44. package/dist/libs/shared/src/components/interactive-questions/InteractiveQuestions.d.ts +3 -1
  45. package/dist/libs/shared/src/components/text/Text.d.ts +13 -0
  46. package/dist/libs/shared/src/enums/CountryCode.d.ts +2 -1
  47. package/dist/libs/shared/src/enums/CurationStatus.d.ts +12 -0
  48. package/dist/libs/shared/src/enums/InteractionCorrectness.d.ts +8 -0
  49. package/dist/libs/shared/src/enums/InteractiveAnswerStatus.d.ts +5 -0
  50. package/dist/libs/shared/src/enums/ObjectStatus.d.ts +3 -3
  51. package/dist/libs/shared/src/enums/UserGroup.d.ts +3 -3
  52. package/dist/libs/shared/src/enums/UserRole.d.ts +4 -4
  53. package/dist/libs/shared/src/enums/WidgetContents.d.ts +3 -1
  54. package/dist/libs/shared/src/images/svg/ImportedSvgs.d.ts +4 -1
  55. package/dist/libs/shared/src/images/svg/objects/index.d.ts +3 -1
  56. package/dist/libs/shared/src/interfaces/VideoTypes.d.ts +2 -0
  57. package/dist/libs/shared/src/interfaces/app-variables/BaseSearchAppVariables.d.ts +1 -0
  58. package/dist/libs/shared/src/interfaces/index.d.ts +1 -0
  59. package/dist/libs/shared/src/interfaces/models/Classification.d.ts +0 -1
  60. package/dist/libs/shared/src/interfaces/models/Config.d.ts +8 -1
  61. package/dist/libs/shared/src/interfaces/models/Curriculum.d.ts +3 -1
  62. package/dist/libs/shared/src/interfaces/models/Customer.d.ts +2 -1
  63. package/dist/libs/shared/src/interfaces/models/InteractiveMetadata.d.ts +11 -3
  64. package/dist/libs/shared/src/interfaces/models/Library.d.ts +3 -0
  65. package/dist/libs/shared/src/interfaces/models/User.d.ts +38 -3
  66. package/dist/libs/shared/src/interfaces/models/Video.d.ts +2 -0
  67. package/dist/libs/shared/src/interfaces/models/index.d.ts +1 -0
  68. package/dist/libs/shared/src/interfaces/models/interactive-results/InteractiveResult.d.ts +5 -0
  69. package/dist/libs/shared/src/interfaces/models/interactive-results/InteractiveResultSet.d.ts +6 -0
  70. package/dist/libs/shared/src/interfaces/models/interactive-results/StudentAnswer.d.ts +9 -0
  71. package/dist/libs/shared/src/interfaces/models/interactive-results/StudentAttempt.d.ts +6 -0
  72. package/dist/libs/shared/src/interfaces/models/interactive-results/StudentResult.d.ts +6 -0
  73. package/dist/libs/shared/src/interfaces/models/interactive-results/index.d.ts +5 -0
  74. package/dist/libs/shared/src/interfaces/requests/CreateInteractiveMetadataRequest.d.ts +2 -0
  75. package/dist/libs/shared/src/interfaces/requests/CreateInteractiveRequest.d.ts +1 -0
  76. package/dist/libs/shared/src/interfaces/requests/EditInteractiveMetadataOriginRequest.d.ts +5 -0
  77. package/dist/libs/shared/src/interfaces/requests/EditInteractiveMetadataRequest.d.ts +2 -0
  78. package/dist/libs/shared/src/interfaces/requests/index.d.ts +1 -0
  79. package/dist/libs/shared/src/utils/interaction-type-helper/InteractionTypeHelper.d.ts +4 -0
  80. package/dist/player-app.css +387 -1694
  81. package/dist/player-app.js +1208 -5568
  82. package/dist/projects/player/src/components/chapter-bar-items/chapter-bar-item.d.ts +1 -1
  83. package/dist/projects/player/src/components/chapter-bar-items/chapter-bar-items.d.ts +1 -1
  84. package/dist/projects/player/src/components/chapter-bar-items/chapter-bar-load-progress.d.ts +1 -1
  85. package/dist/projects/player/src/components/chapter-bar-items/chapter-bar-play-progress.d.ts +1 -1
  86. package/dist/projects/player/src/components/chapters-button/chapter-menu-item.d.ts +1 -1
  87. package/dist/projects/player/src/components/collapserator/collapserator.d.ts +1 -0
  88. package/dist/projects/player/src/components/player/player.d.ts +1 -1
  89. package/dist/projects/player/src/components/subs-caps-button/SubCapsMenuItem.d.ts +52 -0
  90. package/dist/projects/player/src/components/subs-caps-button/subtitle-size-menu-item.d.ts +53 -0
  91. package/dist/projects/player/src/components/subtitle-size-button/subtitle-size-button.d.ts +1 -0
  92. package/dist/projects/player/src/components/text-track-settings/text-track-settings.d.ts +56 -0
  93. package/dist/projects/player/src/components/thumbnail-display/thumbnail-display.d.ts +2 -1
  94. package/dist/projects/player/src/index.d.ts +0 -2
  95. package/dist/projects/player/src/interfaces/models/PlaybackObject.d.ts +8 -0
  96. package/dist/projects/player/src/players/base-player.d.ts +10 -0
  97. package/dist/projects/player/src/players/interactive-player.d.ts +6 -1
  98. package/dist/projects/player/src/players/player.d.ts +2 -1
  99. package/dist/projects/player/src/plugins/create-clip-plugin/components/clip-timepoint-selector/clip-timepoint-selector-handle.d.ts +1 -1
  100. package/dist/projects/player/src/plugins/create-clip-plugin/components/clip-timepoint-selector/clip-timepoint-selector.d.ts +1 -1
  101. package/dist/projects/player/src/plugins/interactive-plugin/components/continue-session/continue-session.d.ts +8 -0
  102. package/dist/projects/player/src/plugins/interactive-plugin/components/interaction-actions/interaction-actions.d.ts +4 -1
  103. package/dist/projects/player/src/plugins/interactive-plugin/components/interaction-footer/interaction-footer.d.ts +2 -2
  104. package/dist/projects/player/src/plugins/interactive-plugin/components/interactive-summary/InteractiveSummaryWrapper.d.ts +18 -0
  105. package/dist/projects/player/src/plugins/interactive-plugin/components/interactive-summary/interactions-bar/interactions-bar.d.ts +9 -0
  106. package/dist/projects/player/src/plugins/interactive-plugin/components/interactive-summary/interactive-summary.d.ts +20 -0
  107. package/dist/projects/player/src/plugins/interactive-plugin/components/interactive-summary/progress-summary/progress-summary.d.ts +12 -0
  108. package/dist/projects/player/src/plugins/interactive-plugin/components/interactive-summary/show-summary-button/show-summary-button.d.ts +13 -0
  109. package/dist/projects/player/src/plugins/interactive-plugin/components/move-timepoint/move-timepoint.d.ts +12 -0
  110. package/dist/projects/player/src/plugins/interactive-plugin/components/reorder-interactions/reorder-interactions.d.ts +9 -0
  111. package/dist/projects/player/src/plugins/interactive-plugin/components/seek-bar/interactive-bar-items.d.ts +1 -1
  112. package/dist/projects/player/src/plugins/interactive-plugin/components/sliding-timepoint/sliding-timepoints.d.ts +11 -0
  113. package/dist/projects/player/src/plugins/interactive-plugin/components/timepoint/timepoint-component.d.ts +28 -9
  114. package/dist/projects/player/src/plugins/interactive-plugin/components/view-components/interactive-immersive-reader/interactive-immersive-reader.d.ts +8 -0
  115. package/dist/projects/player/src/plugins/interactive-plugin/components/view-components/missing-word/missing-word-interaction.d.ts +2 -0
  116. package/dist/projects/player/src/plugins/interactive-plugin/components/view-components/multiple-choice/multiple-choice-interaction.d.ts +3 -0
  117. package/dist/projects/player/src/plugins/interactive-plugin/components/view-components/true-or-false/true-or-false-interaction.d.ts +3 -0
  118. package/dist/projects/player/src/plugins/interactive-plugin/components/view-components/view-components.d.ts +3 -0
  119. package/dist/projects/player/src/plugins/interactive-plugin/hooks/useInteractiveState.d.ts +10 -4
  120. package/dist/projects/player/src/plugins/interactive-plugin/hooks/useInteractiveTrack.d.ts +1 -0
  121. package/dist/projects/player/src/plugins/interactive-plugin/hooks/useLockPlayer.d.ts +2 -2
  122. package/dist/projects/player/src/plugins/interactive-plugin/hooks/useStateManager.d.ts +12 -4
  123. package/dist/projects/player/src/plugins/interactive-plugin/interactive-plugin.d.ts +47 -0
  124. package/dist/projects/player/src/plugins/interactive-plugin/interfaces/InteractionProps.d.ts +1 -1
  125. package/dist/projects/player/src/plugins/interactive-plugin/interfaces/InteractiveState.d.ts +5 -1
  126. package/dist/projects/player/src/plugins/interactive-plugin/interfaces/LatestSession.d.ts +11 -0
  127. package/dist/projects/player/src/plugins/interactive-plugin/interfaces/index.d.ts +1 -0
  128. package/dist/projects/player/src/plugins/interactive-plugin/utils/InteractiveReducer.d.ts +2 -2
  129. package/dist/projects/player/src/plugins/interactive-plugin/utils/ResultsService.d.ts +4 -1
  130. package/dist/projects/player/src/plugins/interactive-plugin/utils/helpers.d.ts +1 -0
  131. package/dist/projects/player/src/plugins/interactive-plugin/utils/interactive-ajax.d.ts +1 -0
  132. package/dist/projects/player/src/plugins/next-video-plugin/next-video-plugin.d.ts +0 -8
  133. package/dist/projects/player/src/plugins/persist-quality-settings-plugin/persist-quality-settings-plugin.d.ts +33 -0
  134. package/dist/projects/player/src/plugins/persist-subtitle-settings-plugin/persist-subtitle-settings-plugin.d.ts +38 -0
  135. package/dist/projects/player/src/plugins/picture-in-picture-plugin/picture-in-picture-plugin.d.ts +5 -1
  136. package/dist/projects/player/src/plugins/progress-reporter-plugin/progress-reporter-plugin.d.ts +59 -0
  137. package/dist/projects/player/src/plugins/touch-controls-plugin/components/touch-controls/touch-controls.d.ts +1 -1
  138. package/dist/projects/player/src/plugins/whiteboard-mode-plugin/components/drag-handle/drag-handle.d.ts +53 -0
  139. package/dist/projects/player/src/plugins/whiteboard-mode-plugin/components/drag-targets/drag-targets.d.ts +54 -0
  140. package/dist/projects/player/src/plugins/whiteboard-mode-plugin/components/whiteboard-mode-button/whiteboard-mode-button.d.ts +23 -0
  141. package/dist/projects/player/src/plugins/whiteboard-mode-plugin/components/whiteboard-mode-button/whiteboard-mode-menu-item.d.ts +15 -0
  142. package/dist/projects/player/src/plugins/whiteboard-mode-plugin/contants/WhiteboardSides.d.ts +5 -0
  143. package/dist/projects/player/src/plugins/whiteboard-mode-plugin/interfaces/WhiteboardSide.d.ts +1 -0
  144. package/dist/projects/player/src/plugins/whiteboard-mode-plugin/whiteboard-mode-plugin.d.ts +34 -0
  145. package/dist/projects/player/src/react/InteractivePlayer.d.ts +1 -0
  146. package/dist/projects/player/src/react/Player.d.ts +1 -1
  147. package/dist/projects/player/src/utils/local-storage-helper.d.ts +6 -0
  148. package/package.json +8 -4
  149. package/typings/utils/imports.d.ts +1 -1
@@ -4,4 +4,5 @@ export declare const CountryRegionMapping: {
4
4
  au: RegionName;
5
5
  nz: RegionName;
6
6
  uk: RegionName;
7
+ us: RegionName;
7
8
  };
@@ -3,4 +3,5 @@ export declare const Regions: {
3
3
  CvApSoutheast1: Region;
4
4
  CvApSoutheast2: Region;
5
5
  CvEuWest1: Region;
6
+ CvNaWest1: Region;
6
7
  };
@@ -1,5 +1,6 @@
1
1
  export declare enum CountryCode {
2
2
  AU = "au",
3
3
  NZ = "nz",
4
- UK = "uk"
4
+ UK = "uk",
5
+ US = "us"
5
6
  }
@@ -1,5 +1,6 @@
1
1
  export declare enum RegionName {
2
2
  CvApSoutheast1 = "cv-ap-southeast-1",
3
3
  CvApSoutheast2 = "cv-ap-southeast-2",
4
- CvEuWest1 = "cv-eu-west-1"
4
+ CvEuWest1 = "cv-eu-west-1",
5
+ CvNaWest1 = "cv-na-west-1"
5
6
  }
@@ -112,7 +112,8 @@ export declare enum EntityType {
112
112
  Clip = "clip",
113
113
  UserChannel = "user_channel",
114
114
  Widget = "widget",
115
- Url = "url"
115
+ Url = "url",
116
+ SocialShare = "social_share"
116
117
  }
117
118
  export declare enum LocationContext {
118
119
  TopNav = "top_nav",
@@ -133,9 +134,6 @@ export declare enum LocationContext {
133
134
  VideoUpload = "video_upload",
134
135
  VideoRequest = "video_request",
135
136
  Pagination = "pagination",
136
- SearchBar = "search_bar",
137
- InstantSearch = "instant_search",
138
- SearchFilters = "search_filters",
139
137
  LibraryHeader = "library_header",
140
138
  LibraryTiles = "library_tiles",
141
139
  StaffRequestDetails = "staff_request_details",
@@ -146,6 +144,10 @@ export declare enum LocationContext {
146
144
  MigrationWarnings = "migration_warnings",
147
145
  PlaylistListHeader = "playlist_list_header",
148
146
  PlaylistListItem = "playlist_list_item",
147
+ SearchBar = "search_bar",
148
+ InstantSearch = "instant_search",
149
+ SearchFilters = "search_filters",
150
+ FeaturedSeriesSearchResult = "featured_series_search_result",
149
151
  StaffManager = "staff_manager",
150
152
  StaffManagerListItem = "staff_manager_list_item",
151
153
  StudentManager = "student_manager",
@@ -159,13 +161,18 @@ export declare enum LocationContext {
159
161
  ManageClassroomGroups = "manage_classroom_groups",
160
162
  ManageClassroomGroupListItem = "manage_classroom_group_list_item",
161
163
  PreviewInteractive = "preview_interactive",
164
+ PreviewInteractiveQuestions = "preview_interactive_questions",
162
165
  EditInteractive = "edit_interactive",
166
+ PlaySharedInteractive = "play_shared_interactive",
167
+ InteractiveListItem = "interactive_list_item",
163
168
  PlayPage = "play_page",
164
169
  Player = "player",
165
170
  FloatingPlayer = "floating_player",
166
171
  InteractivePlayer = "interactive_player",
167
172
  EmbeddedPlayer = "embedded_player",
168
173
  CreateClipPlayer = "create_clip_player",
174
+ PlaySharedClip = "play_shared_clip",
175
+ ClipListItem = "clip_list_item",
169
176
  ContentUpdatesClassificationBanner = "content_updates_classification_banner",
170
177
  PreferencesSettings = "preferences_settings",
171
178
  MyUploads = "my_uploads",
@@ -175,8 +182,9 @@ export declare enum LocationContext {
175
182
  ClassificationListItem = "classification_list_item",
176
183
  ClassificationComingSoon = "classification_coming_soon",
177
184
  ClassificationHero = "classification_hero",
178
- Settings = "settings",
179
- Dashboard = "dashboard"
185
+ Dashboard = "dashboard",
186
+ ProductBanner = "product_banner",
187
+ Settings = "settings"
180
188
  }
181
189
  export declare enum WorkflowPhase {
182
190
  Start = "start",
@@ -242,7 +250,8 @@ export declare enum ClickDescriptor {
242
250
  Thumbnail = "thumbnail",
243
251
  Cover = "cover",
244
252
  TallPoster = "tall_poster",
245
- Slide = "slide"
253
+ Slide = "slide",
254
+ ExternalLink = "external_link"
246
255
  }
247
256
  export declare enum VideoActionDescriptor {
248
257
  FeatureUserChannelVideo = "feature_user_channel_video",
@@ -1,5 +1,4 @@
1
1
  import { RegionName } from 'libs/analytics/enums/RegionName';
2
2
  export interface Region {
3
- displayName: string;
4
3
  systemName: RegionName;
5
4
  }
@@ -33,5 +33,6 @@ export declare const AppLinkHelper: {
33
33
  * @param appLink
34
34
  */
35
35
  trigger(appLink: AppLink, options?: AppLinkOptions): void;
36
+ updateParams(params: ObjectHash, options?: AppLinkOptions): void;
36
37
  getCurrentAppLink(): AppLink;
37
38
  };
@@ -18,6 +18,7 @@ declare const LocationUtils: {
18
18
  GetCurrentQueryString(): string;
19
19
  GetCurrentUrl(): string;
20
20
  GetCurrentReferrer(): string;
21
+ GetCurrentOrigin(): string;
21
22
  SetPageTitle(title: string): void;
22
23
  };
23
24
  export { LocationUtils };
@@ -0,0 +1,10 @@
1
+ export declare enum HttpStatus {
2
+ Ok = 200,
3
+ NoContent = 204,
4
+ BadRequest = 400,
5
+ Unauthorized = 401,
6
+ Forbidden = 403,
7
+ NotFound = 404,
8
+ Conflict = 409,
9
+ InternalServer = 500
10
+ }
@@ -0,0 +1,58 @@
1
+ export declare enum StorageType {
2
+ LocalStorage = "localStorage",
3
+ SessionStorage = "sessionStorage"
4
+ }
5
+ export interface StorageHelper {
6
+ get(key: string): any;
7
+ set(key: string, data: any): boolean;
8
+ remove(key: string): any;
9
+ length(): number;
10
+ clear(): any;
11
+ cacheSet(key: string, data: any, expire?: number): any;
12
+ cacheGet(key: string): any;
13
+ cacheExists(key: string): boolean;
14
+ cacheRemove(key: string): any;
15
+ cacheFlush(): void;
16
+ }
17
+ interface StaticBaseStorageHelperOptions {
18
+ type: StorageType;
19
+ }
20
+ declare abstract class StaticBaseStorageHelper implements StorageHelper {
21
+ private cachePrefix;
22
+ private expireTime;
23
+ private hasSupport;
24
+ private storage;
25
+ protected type: StorageType;
26
+ protected constructor(options: StaticBaseStorageHelperOptions);
27
+ get(key: string): any;
28
+ set(key: string, data: any): boolean;
29
+ remove(key: string): void;
30
+ length(): number;
31
+ clear(): void;
32
+ /**
33
+ * Caching Ops
34
+ */
35
+ cacheSet(key: string, data: any, expire?: number): boolean;
36
+ cacheGet(key: string): any;
37
+ cacheExists(key: string): boolean;
38
+ cacheRemove(key: string): void;
39
+ cacheFlush(): void;
40
+ /**
41
+ * Privates
42
+ */
43
+ private cacheClean;
44
+ private isExpired;
45
+ private getCurrentTime;
46
+ private hasBrowserSupport;
47
+ }
48
+ declare class StaticLocalStorageHelper extends StaticBaseStorageHelper {
49
+ protected static instance: StaticLocalStorageHelper;
50
+ static get Instance(): StaticLocalStorageHelper;
51
+ }
52
+ declare class StaticSessionStorageHelper extends StaticBaseStorageHelper {
53
+ protected static instance: StaticSessionStorageHelper;
54
+ static get Instance(): StaticSessionStorageHelper;
55
+ }
56
+ export declare const LocalStorageHelper: StaticLocalStorageHelper;
57
+ export declare const SessionStorageHelper: StaticSessionStorageHelper;
58
+ export {};
@@ -0,0 +1,15 @@
1
+ import { Store } from 'redux';
2
+ import { ApplicationState } from 'libs/common/react/interfaces/ApplicationState';
3
+ import { Request, Response, Dispatch } from './interfaces';
4
+ export declare function emptyResponse<T>(): Response<T>;
5
+ export declare function getResponse<T>(state: ApplicationState, key: string): Response<T>;
6
+ export declare function getFetch(dispatch: Dispatch, request: Request): () => void;
7
+ export declare function fetch(dispatch: Dispatch, request: Request): void;
8
+ export declare function hooklessFetch(store: Store, request: Request): void;
9
+ export declare function useGetFetch(request: Request): () => void;
10
+ interface GetResponseOptions {
11
+ optimize: boolean;
12
+ }
13
+ export declare function useGetResponse<T>(key: string, options?: GetResponseOptions): Response<T>;
14
+ export declare function useBasicFetch<T>(request: Request, options?: GetResponseOptions): Response<T>;
15
+ export {};
@@ -0,0 +1,11 @@
1
+ import { Dispatch, Middleware, AnyAction } from 'redux';
2
+ import { HashObject } from 'libs/common/react/interfaces/HashObject';
3
+ import { ApplicationState } from 'libs/common/react/interfaces/ApplicationState';
4
+ import { HttpRequest } from './interfaces';
5
+ interface MiddlewareOptions {
6
+ fetchData: HttpRequest;
7
+ bootstrappedData?: HashObject;
8
+ defaultExpiryTime?: number;
9
+ }
10
+ export declare function createMiddleware(options: MiddlewareOptions): Middleware<HashObject, ApplicationState, Dispatch<AnyAction>>;
11
+ export {};
@@ -0,0 +1,2 @@
1
+ import { FlightState, Action } from './interfaces';
2
+ export declare function FlightReducer(state: FlightState, action: Action): FlightState;
@@ -0,0 +1,24 @@
1
+ import { HashObject } from 'libs/common/react/interfaces/HashObject';
2
+ /**
3
+ * This is a very basic implementation and we almost definitely will
4
+ * need to extend upon this, so please don't be afraid to add to it.
5
+ */
6
+ export declare const Simulator: {
7
+ getAll(name: string, init?: HashObject[]): HashObject[];
8
+ get(name: string, id: string): HashObject;
9
+ create(name: string, item: HashObject): HashObject;
10
+ update(name: string, item: HashObject): HashObject;
11
+ delete(name: string, ids: string | string[]): void;
12
+ /**
13
+ *
14
+ * @param objectName - the name your object can be found under in local storage (e.g. `classrooms`).
15
+ * @param objectId - the id of the object you want to associate something to.
16
+ * @param assocName - the field name of your assoc, which will go on your object (e.g. `students`).
17
+ * @param flightSimName - the name your assoc objects will be created under (e.g. `school:students`).
18
+ * @param assocObject - the object you're creating and associating.
19
+ *
20
+ * Having a difficult time coming up with good param names here. Feel free to update, ty
21
+ */
22
+ assoc(objectName: string, objectId: string, assocName: string, flightSimName: string, assocObjects: any | any[]): any | any[];
23
+ dissoc(objectName: string, objectId: string, assocName: string, ids: string | string[]): HashObject[];
24
+ };
@@ -0,0 +1,7 @@
1
+ export declare const Actions: {
2
+ API_REQUEST: string;
3
+ API_REPONSE: string;
4
+ API_ERROR: string;
5
+ INVALIDATE: string;
6
+ UPDATE: string;
7
+ };
@@ -0,0 +1 @@
1
+ export * from './Actions';
@@ -0,0 +1,2 @@
1
+ import { HttpRequestOptions } from '../interfaces';
2
+ export declare function ajaxRequest(options: HttpRequestOptions): void;
@@ -0,0 +1 @@
1
+ export * from './AjaxRequest';
@@ -0,0 +1,9 @@
1
+ export * from './constants';
2
+ export * from './enums';
3
+ export * from './interfaces';
4
+ export * from './data-layers';
5
+ export * from './normalizer';
6
+ export * from './FlightHelpers';
7
+ export * from './FlightMiddleware';
8
+ export * from './FlightReducer';
9
+ export * from './FlightSimulator';
@@ -0,0 +1,28 @@
1
+ import { NormalizedEntities, Request, Normalized } from '..';
2
+ import { Xhr } from 'libs/common/backbone/interfaces/Xhr';
3
+ interface BaseAction {
4
+ type: string;
5
+ request: Request;
6
+ }
7
+ export interface RequestAction extends BaseAction {
8
+ }
9
+ interface BaseResponseAction extends BaseAction {
10
+ timestamp: number;
11
+ xhr?: Xhr;
12
+ }
13
+ export interface ResponseAction extends BaseResponseAction {
14
+ result: Normalized;
15
+ entities: NormalizedEntities;
16
+ }
17
+ export interface ErrorAction extends BaseResponseAction {
18
+ errorResponse?: any;
19
+ }
20
+ export interface InvalidateAction extends BaseAction {
21
+ keys?: string | string[];
22
+ }
23
+ export interface UpdateAction extends BaseAction {
24
+ result: Normalized;
25
+ entities: NormalizedEntities;
26
+ }
27
+ export declare type Action = RequestAction | ResponseAction | ErrorAction | InvalidateAction;
28
+ export {};
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { RequestAction } from './Action';
3
+ export declare type Dispatch = React.Dispatch<RequestAction>;
@@ -0,0 +1,27 @@
1
+ import { HttpVerbs } from 'libs/common/backbone/enums/HttpVerbs';
2
+ import { HashObject } from 'libs/common/react/interfaces/HashObject';
3
+ import { Xhr } from 'libs/common/backbone/interfaces/Xhr';
4
+ interface SuccessFunction {
5
+ (data: HashObject, xhr: Xhr): void;
6
+ }
7
+ interface ErrorFunction {
8
+ (xhr: Xhr): void;
9
+ }
10
+ interface AlwaysFunction {
11
+ (): void;
12
+ }
13
+ export interface HttpRequestOptions {
14
+ resource: string;
15
+ type: HttpVerbs;
16
+ data?: HashObject;
17
+ success: SuccessFunction;
18
+ error: ErrorFunction;
19
+ always?: AlwaysFunction;
20
+ headers?: {
21
+ authorization?: string;
22
+ };
23
+ }
24
+ export interface HttpRequest {
25
+ (options: HttpRequestOptions): void;
26
+ }
27
+ export {};
@@ -0,0 +1,7 @@
1
+ import { NormalizedEntities } from './FlightState';
2
+ import { HashObject } from 'libs/common/react/interfaces/HashObject';
3
+ export declare type Normalized = string | string[] | HashObject | HashObject[];
4
+ export interface NormalizedData {
5
+ result: Normalized;
6
+ entities: NormalizedEntities;
7
+ }
@@ -0,0 +1,9 @@
1
+ import { HttpStatus } from 'libs/common/backbone/enums/HttpStatus';
2
+ export interface Response<T> {
3
+ data?: T;
4
+ statusCode?: HttpStatus;
5
+ shouldFetch: boolean;
6
+ isFetching: boolean;
7
+ hasError: boolean;
8
+ isComplete: boolean;
9
+ }
@@ -0,0 +1,9 @@
1
+ export * from './Request';
2
+ export * from './Action';
3
+ export * from './FlightState';
4
+ export * from './HttpRequest';
5
+ export * from './NormalizedData';
6
+ export * from './Response';
7
+ export * from './NormalizeOptions';
8
+ export * from './Dispatch';
9
+ export * from './UpdateStateOptions';
@@ -0,0 +1,3 @@
1
+ import { HashObject } from 'libs/common/react/interfaces/HashObject';
2
+ import { NormalizedEntities, Normalized } from '../interfaces';
3
+ export declare function denormalize(ids: Normalized, collection: NormalizedEntities): HashObject | HashObject[];
@@ -0,0 +1,8 @@
1
+ import { HashObject } from 'libs/common/react/interfaces/HashObject';
2
+ import { NormalizeOptions, NormalizedData } from '../interfaces';
3
+ /**
4
+ * This is a pure function, while normalize() above is not.
5
+ * normalize() manipulates it's parameters. If we ever write unit tests for this
6
+ * only test this function, not the above ones.
7
+ */
8
+ export declare function normalize(data: HashObject | HashObject[], options?: NormalizeOptions): NormalizedData;
@@ -0,0 +1,2 @@
1
+ export * from './Normalizer';
2
+ export * from './Denormalizer';
@@ -0,0 +1,5 @@
1
+ import { Request, HttpRequestOptions } from '../interfaces';
2
+ export declare const SimulatorHelper: {
3
+ isSimulated(request: Request): boolean;
4
+ simulateFetchData(options: HttpRequestOptions, request: Request): void;
5
+ };
@@ -0,0 +1,11 @@
1
+ import { FlightState } from '../interfaces';
2
+ export declare const StateHelper: {
3
+ /**
4
+ * Returns a map of keys state.resources which match the keys param.
5
+ *
6
+ * @param state FlightState.
7
+ * @param keys a key or array of keys to match on.
8
+ * @param requestKey optionally include the current request key to exclude it from the map.
9
+ */
10
+ getMatchingKeyMap(state: FlightState, keys: string | string[], requestKey?: string): any;
11
+ };
@@ -0,0 +1,2 @@
1
+ export * from './StateHelper';
2
+ export * from './SimulatorHelper';
@@ -16,7 +16,7 @@ export declare const ArrayHelper: {
16
16
  groupBy<T_11>(arr: T_11[], property: string): {
17
17
  [index: string]: T_11[];
18
18
  };
19
- flatten<T_12>(arr: T_12[], shallow?: boolean): T_12[];
19
+ flatten<T_12>(arr: T_12[][], shallow?: boolean): T_12[];
20
20
  intersection<T_13>(...arrays: T_13[][]): T_13[];
21
21
  /**
22
22
  * Add a value to an array, or if it is already in the array, remove it.
@@ -40,5 +40,21 @@ export declare const ArrayHelper: {
40
40
  sortBy<T_16 extends HashObject<any>, TSort = T_16>(arr: T_16[], iteratee?: Iterator<T_16, TSort> | keyof T_16): T_16[];
41
41
  chunk<T_17>(array: _.Collection<T_17>, count: number): T_17[][];
42
42
  uniq<T_18 extends string | number | HashObject<any>, TSort_1 = T_18>(array: T_18[], iteratee?: Iterator<T_18, TSort_1> | keyof T_18): T_18[];
43
+ /**
44
+ * Transform array to an object.
45
+ *
46
+ * Where an array of objects is passed:
47
+ * - PropAsKey must match a property within the objects. This property will be used as the key.
48
+ * - Value will be the object from the array
49
+ *
50
+ * Where an array of primitives is passed:
51
+ * - propAsKey will be used as the key
52
+ * - Value will be the primitive
53
+ *
54
+ * @param arr
55
+ * @param propAsKey
56
+ * @returns object
57
+ */
58
+ toObject(arr: any[], propAsKey: string): any;
43
59
  };
44
60
  export {};
@@ -7,4 +7,5 @@ export declare const ObjectHelper: {
7
7
  isObject(obj: any): boolean;
8
8
  isEqual(obj1: any, obj2: any): boolean;
9
9
  omit(obj: any, keys: string[]): any;
10
+ removeEmptyKeys(obj: any): any;
10
11
  };
@@ -0,0 +1,8 @@
1
+ declare type TimeOfDay = 'morning' | 'afternoon' | 'evening';
2
+ export declare const TimeHelper: {
3
+ currentTimestamp(): number;
4
+ isExpired(timestamp: number, cacheDuration: number): boolean;
5
+ currentTimeOfDay(currentTime?: Date): TimeOfDay;
6
+ convertDurationToSeconds(time: string): number;
7
+ };
8
+ export {};
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ /// <reference types="react" />
2
2
  import { Core } from 'libs/common/core';
3
3
  import { HashObject } from 'libs/common/react/interfaces';
4
4
  import { AnalyticsOptions } from 'libs/analytics/interfaces';
@@ -7,7 +7,7 @@ export interface ActionOptions {
7
7
  order?: number;
8
8
  label?: string;
9
9
  appLink?: Core.AppLink;
10
- onClick?: (e: React.MouseEvent) => void;
10
+ onClick?: () => void;
11
11
  svgName?: string;
12
12
  className?: string;
13
13
  button?: boolean;
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { ActionOptions } from './Actions';
3
- declare type DropdownActionOptions = Omit<ActionOptions, 'button' | 'tooltip'>;
3
+ export declare type DropdownActionOptions = Omit<ActionOptions, 'button' | 'tooltip'>;
4
4
  interface ActionsDropdownProps {
5
5
  actions: DropdownActionOptions[];
6
6
  className?: string;
@@ -4,10 +4,18 @@ import { HashObject } from 'libs/common/react/interfaces/HashObject';
4
4
  import { AnalyticsOptions } from 'libs/analytics/interfaces';
5
5
  export interface AppLinkProps {
6
6
  appLink: Core.AppLink;
7
+ appLinkOptions?: Core.AppLinkOptions;
7
8
  className?: string;
9
+ style?: React.CSSProperties;
8
10
  tag?: 'a' | 'button';
9
11
  onClick?: (e: React.MouseEvent) => void;
10
12
  analyticsData?: HashObject;
11
13
  analyticsOptions?: AnalyticsOptions;
14
+ title?: string;
12
15
  }
13
16
  export declare function AppLink(props: React.PropsWithChildren<AppLinkProps>): React.ReactElement;
17
+ export declare namespace AppLink {
18
+ var defaultProps: {
19
+ appLinkOptions: {};
20
+ };
21
+ }
@@ -0,0 +1,14 @@
1
+ /// <reference types="react" />
2
+ import { PropsWithAnalyticsOptions } from 'libs/shared/interfaces';
3
+ declare type ImmersiveReaderProps = PropsWithAnalyticsOptions<{
4
+ text: string;
5
+ title?: string;
6
+ className?: string;
7
+ analyticsData: {
8
+ id: string;
9
+ type: string;
10
+ };
11
+ html?: boolean;
12
+ }>;
13
+ export declare function ImmersiveReader(props: ImmersiveReaderProps): JSX.Element;
14
+ export {};
@@ -1,10 +1,12 @@
1
1
  import React from 'react';
2
- import { Interactive } from 'libs/shared/interfaces';
2
+ import { Interactive, Interaction } from 'libs/shared/interfaces';
3
+ import { InteractionCorrectness } from 'libs/shared/enums/InteractionCorrectness';
3
4
  export interface InteractiveQuestionProps {
4
5
  interactive: Interactive;
5
6
  goToTimepoint?: (timepointId: string, interactionId: string) => void;
6
7
  selectedInteractionId?: string;
7
8
  maxHeight: number;
8
9
  onClickDelete?: (interactionId: string) => void;
10
+ getCorrectness?: (interaction: Interaction) => InteractionCorrectness;
9
11
  }
10
12
  export declare function InteractiveQuestions(props: InteractiveQuestionProps): React.ReactElement;
@@ -0,0 +1,13 @@
1
+ import * as React from 'react';
2
+ interface LanguageInterpolationOptions {
3
+ smartCount?: number;
4
+ [propName: string]: any;
5
+ }
6
+ interface TextProps {
7
+ phrase: string;
8
+ namespace?: string;
9
+ options?: LanguageInterpolationOptions;
10
+ }
11
+ export declare const LanguageNamespaceContext: React.Context<string>;
12
+ export declare const Text: React.NamedExoticComponent<TextProps>;
13
+ export {};
@@ -1,5 +1,6 @@
1
1
  export declare enum CountryCode {
2
2
  AU = "au",
3
3
  NZ = "nz",
4
- UK = "uk"
4
+ UK = "uk",
5
+ US = "us"
5
6
  }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This enum maps directly to the CurationStatus enum in the
3
+ * NuGet package ClickView.Models from master.
4
+ */
5
+ export declare enum CurationStatus {
6
+ Draft = 0,
7
+ Published = 1,
8
+ Archive = 2,
9
+ Pending = 3,
10
+ Rejected = 4,
11
+ Processing = 5
12
+ }
@@ -0,0 +1,8 @@
1
+ export declare enum InteractionCorrectness {
2
+ Correct = 0,
3
+ Incorrect = 1,
4
+ AwaitingMarking = 2,
5
+ Answered = 3,
6
+ UnAnswered = 4,
7
+ NotApplicable = 5
8
+ }
@@ -0,0 +1,5 @@
1
+ export declare enum InteractiveAnswerStatus {
2
+ Incorrect = 0,
3
+ Correct = 1,
4
+ PendingReview = 2
5
+ }
@@ -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
  }
@@ -6,5 +6,7 @@ export declare enum WidgetContents {
6
6
  UserChannels = "user channels",
7
7
  Interactives = "interactives",
8
8
  Clips = "clips",
9
- Resources = "resources"
9
+ Resources = "resources",
10
+ Libraries = "Libraries",
11
+ Folders = "Folders"
10
12
  }