@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.
- package/.storybook/main.js +1 -0
- package/.storybook/stories/Base.stories.tsx +6 -5
- package/.storybook/stories/Interactives.stories.tsx +45 -49
- package/.storybook/stories/utils/mock-playerapi.ts +38 -12
- package/dist/en.json +733 -0
- package/dist/libs/analytics/src/constants/CountryRegionMapping.d.ts +1 -0
- package/dist/libs/analytics/src/constants/Regions.d.ts +1 -0
- package/dist/libs/analytics/src/enums/CountryCode.d.ts +2 -1
- package/dist/libs/analytics/src/enums/RegionName.d.ts +2 -1
- package/dist/libs/analytics/src/interfaces/AnalyticsTypes.d.ts +16 -7
- package/dist/libs/analytics/src/interfaces/Region.d.ts +0 -1
- package/dist/libs/common/src/backbone/core/AppLink.d.ts +1 -0
- package/dist/libs/common/src/backbone/core/LocationUtils.d.ts +1 -0
- package/dist/libs/common/src/backbone/enums/HttpStatus.d.ts +10 -0
- package/dist/libs/common/src/backbone/utils/LocalStorageHelper.d.ts +58 -0
- package/dist/libs/common/src/react/flight/FlightHelpers.d.ts +15 -0
- package/dist/libs/common/src/react/flight/FlightMiddleware.d.ts +11 -0
- package/dist/libs/common/src/react/flight/FlightReducer.d.ts +2 -0
- package/dist/libs/common/src/react/flight/FlightSimulator.d.ts +24 -0
- package/dist/libs/common/src/react/flight/constants/Actions.d.ts +7 -0
- package/dist/libs/common/src/react/flight/constants/index.d.ts +1 -0
- package/dist/libs/common/src/react/flight/data-layers/AjaxRequest.d.ts +2 -0
- package/dist/libs/common/src/react/flight/data-layers/index.d.ts +1 -0
- package/dist/libs/common/src/react/flight/index.d.ts +9 -0
- package/dist/libs/common/src/react/flight/interfaces/Action.d.ts +28 -0
- package/dist/libs/common/src/react/flight/interfaces/Dispatch.d.ts +3 -0
- package/dist/libs/common/src/react/flight/interfaces/HttpRequest.d.ts +27 -0
- package/dist/libs/common/src/react/flight/interfaces/NormalizedData.d.ts +7 -0
- package/dist/libs/common/src/react/flight/interfaces/Response.d.ts +9 -0
- package/dist/libs/common/src/react/flight/interfaces/index.d.ts +9 -0
- package/dist/libs/common/src/react/flight/normalizer/Denormalizer.d.ts +3 -0
- package/dist/libs/common/src/react/flight/normalizer/Normalizer.d.ts +8 -0
- package/dist/libs/common/src/react/flight/normalizer/index.d.ts +2 -0
- package/dist/libs/common/src/react/flight/utils/SimulatorHelper.d.ts +5 -0
- package/dist/libs/common/src/react/flight/utils/StateHelper.d.ts +11 -0
- package/dist/libs/common/src/react/flight/utils/index.d.ts +2 -0
- package/dist/libs/common/src/react/utils/ArrayHelper.d.ts +17 -1
- package/dist/libs/common/src/react/utils/ObjectHelper.d.ts +1 -0
- package/dist/libs/common/src/react/utils/TimeHelper.d.ts +8 -0
- package/dist/libs/shared/src/components/actions/Actions.d.ts +2 -2
- package/dist/libs/shared/src/components/actions/ActionsDropdown.d.ts +1 -1
- package/dist/libs/shared/src/components/app-link/AppLink.d.ts +8 -0
- package/dist/libs/shared/src/components/immersive-reader/ImmersiveReader.d.ts +14 -0
- package/dist/libs/shared/src/components/interactive-questions/InteractiveQuestions.d.ts +3 -1
- package/dist/libs/shared/src/components/text/Text.d.ts +13 -0
- package/dist/libs/shared/src/enums/CountryCode.d.ts +2 -1
- package/dist/libs/shared/src/enums/CurationStatus.d.ts +12 -0
- package/dist/libs/shared/src/enums/InteractionCorrectness.d.ts +8 -0
- package/dist/libs/shared/src/enums/InteractiveAnswerStatus.d.ts +5 -0
- package/dist/libs/shared/src/enums/ObjectStatus.d.ts +3 -3
- package/dist/libs/shared/src/enums/UserGroup.d.ts +3 -3
- package/dist/libs/shared/src/enums/UserRole.d.ts +4 -4
- package/dist/libs/shared/src/enums/WidgetContents.d.ts +3 -1
- package/dist/libs/shared/src/images/svg/ImportedSvgs.d.ts +4 -1
- package/dist/libs/shared/src/images/svg/objects/index.d.ts +3 -1
- package/dist/libs/shared/src/interfaces/VideoTypes.d.ts +2 -0
- package/dist/libs/shared/src/interfaces/app-variables/BaseSearchAppVariables.d.ts +1 -0
- package/dist/libs/shared/src/interfaces/index.d.ts +1 -0
- package/dist/libs/shared/src/interfaces/models/Classification.d.ts +0 -1
- package/dist/libs/shared/src/interfaces/models/Config.d.ts +8 -1
- package/dist/libs/shared/src/interfaces/models/Curriculum.d.ts +3 -1
- package/dist/libs/shared/src/interfaces/models/Customer.d.ts +2 -1
- package/dist/libs/shared/src/interfaces/models/InteractiveMetadata.d.ts +11 -3
- package/dist/libs/shared/src/interfaces/models/Library.d.ts +3 -0
- package/dist/libs/shared/src/interfaces/models/User.d.ts +38 -3
- package/dist/libs/shared/src/interfaces/models/Video.d.ts +2 -0
- package/dist/libs/shared/src/interfaces/models/index.d.ts +1 -0
- package/dist/libs/shared/src/interfaces/models/interactive-results/InteractiveResult.d.ts +5 -0
- package/dist/libs/shared/src/interfaces/models/interactive-results/InteractiveResultSet.d.ts +6 -0
- package/dist/libs/shared/src/interfaces/models/interactive-results/StudentAnswer.d.ts +9 -0
- package/dist/libs/shared/src/interfaces/models/interactive-results/StudentAttempt.d.ts +6 -0
- package/dist/libs/shared/src/interfaces/models/interactive-results/StudentResult.d.ts +6 -0
- package/dist/libs/shared/src/interfaces/models/interactive-results/index.d.ts +5 -0
- package/dist/libs/shared/src/interfaces/requests/CreateInteractiveMetadataRequest.d.ts +2 -0
- package/dist/libs/shared/src/interfaces/requests/CreateInteractiveRequest.d.ts +1 -0
- package/dist/libs/shared/src/interfaces/requests/EditInteractiveMetadataOriginRequest.d.ts +5 -0
- package/dist/libs/shared/src/interfaces/requests/EditInteractiveMetadataRequest.d.ts +2 -0
- package/dist/libs/shared/src/interfaces/requests/index.d.ts +1 -0
- package/dist/libs/shared/src/utils/interaction-type-helper/InteractionTypeHelper.d.ts +4 -0
- package/dist/player-app.css +387 -1694
- package/dist/player-app.js +1208 -5568
- package/dist/projects/player/src/components/chapter-bar-items/chapter-bar-item.d.ts +1 -1
- package/dist/projects/player/src/components/chapter-bar-items/chapter-bar-items.d.ts +1 -1
- package/dist/projects/player/src/components/chapter-bar-items/chapter-bar-load-progress.d.ts +1 -1
- package/dist/projects/player/src/components/chapter-bar-items/chapter-bar-play-progress.d.ts +1 -1
- package/dist/projects/player/src/components/chapters-button/chapter-menu-item.d.ts +1 -1
- package/dist/projects/player/src/components/collapserator/collapserator.d.ts +1 -0
- package/dist/projects/player/src/components/player/player.d.ts +1 -1
- package/dist/projects/player/src/components/subs-caps-button/SubCapsMenuItem.d.ts +52 -0
- package/dist/projects/player/src/components/subs-caps-button/subtitle-size-menu-item.d.ts +53 -0
- package/dist/projects/player/src/components/subtitle-size-button/subtitle-size-button.d.ts +1 -0
- package/dist/projects/player/src/components/text-track-settings/text-track-settings.d.ts +56 -0
- package/dist/projects/player/src/components/thumbnail-display/thumbnail-display.d.ts +2 -1
- package/dist/projects/player/src/index.d.ts +0 -2
- package/dist/projects/player/src/interfaces/models/PlaybackObject.d.ts +8 -0
- package/dist/projects/player/src/players/base-player.d.ts +10 -0
- package/dist/projects/player/src/players/interactive-player.d.ts +6 -1
- package/dist/projects/player/src/players/player.d.ts +2 -1
- package/dist/projects/player/src/plugins/create-clip-plugin/components/clip-timepoint-selector/clip-timepoint-selector-handle.d.ts +1 -1
- package/dist/projects/player/src/plugins/create-clip-plugin/components/clip-timepoint-selector/clip-timepoint-selector.d.ts +1 -1
- package/dist/projects/player/src/plugins/interactive-plugin/components/continue-session/continue-session.d.ts +8 -0
- package/dist/projects/player/src/plugins/interactive-plugin/components/interaction-actions/interaction-actions.d.ts +4 -1
- package/dist/projects/player/src/plugins/interactive-plugin/components/interaction-footer/interaction-footer.d.ts +2 -2
- package/dist/projects/player/src/plugins/interactive-plugin/components/interactive-summary/InteractiveSummaryWrapper.d.ts +18 -0
- package/dist/projects/player/src/plugins/interactive-plugin/components/interactive-summary/interactions-bar/interactions-bar.d.ts +9 -0
- package/dist/projects/player/src/plugins/interactive-plugin/components/interactive-summary/interactive-summary.d.ts +20 -0
- package/dist/projects/player/src/plugins/interactive-plugin/components/interactive-summary/progress-summary/progress-summary.d.ts +12 -0
- package/dist/projects/player/src/plugins/interactive-plugin/components/interactive-summary/show-summary-button/show-summary-button.d.ts +13 -0
- package/dist/projects/player/src/plugins/interactive-plugin/components/move-timepoint/move-timepoint.d.ts +12 -0
- package/dist/projects/player/src/plugins/interactive-plugin/components/reorder-interactions/reorder-interactions.d.ts +9 -0
- package/dist/projects/player/src/plugins/interactive-plugin/components/seek-bar/interactive-bar-items.d.ts +1 -1
- package/dist/projects/player/src/plugins/interactive-plugin/components/sliding-timepoint/sliding-timepoints.d.ts +11 -0
- package/dist/projects/player/src/plugins/interactive-plugin/components/timepoint/timepoint-component.d.ts +28 -9
- package/dist/projects/player/src/plugins/interactive-plugin/components/view-components/interactive-immersive-reader/interactive-immersive-reader.d.ts +8 -0
- package/dist/projects/player/src/plugins/interactive-plugin/components/view-components/missing-word/missing-word-interaction.d.ts +2 -0
- package/dist/projects/player/src/plugins/interactive-plugin/components/view-components/multiple-choice/multiple-choice-interaction.d.ts +3 -0
- package/dist/projects/player/src/plugins/interactive-plugin/components/view-components/true-or-false/true-or-false-interaction.d.ts +3 -0
- package/dist/projects/player/src/plugins/interactive-plugin/components/view-components/view-components.d.ts +3 -0
- package/dist/projects/player/src/plugins/interactive-plugin/hooks/useInteractiveState.d.ts +10 -4
- package/dist/projects/player/src/plugins/interactive-plugin/hooks/useInteractiveTrack.d.ts +1 -0
- package/dist/projects/player/src/plugins/interactive-plugin/hooks/useLockPlayer.d.ts +2 -2
- package/dist/projects/player/src/plugins/interactive-plugin/hooks/useStateManager.d.ts +12 -4
- package/dist/projects/player/src/plugins/interactive-plugin/interactive-plugin.d.ts +47 -0
- package/dist/projects/player/src/plugins/interactive-plugin/interfaces/InteractionProps.d.ts +1 -1
- package/dist/projects/player/src/plugins/interactive-plugin/interfaces/InteractiveState.d.ts +5 -1
- package/dist/projects/player/src/plugins/interactive-plugin/interfaces/LatestSession.d.ts +11 -0
- package/dist/projects/player/src/plugins/interactive-plugin/interfaces/index.d.ts +1 -0
- package/dist/projects/player/src/plugins/interactive-plugin/utils/InteractiveReducer.d.ts +2 -2
- package/dist/projects/player/src/plugins/interactive-plugin/utils/ResultsService.d.ts +4 -1
- package/dist/projects/player/src/plugins/interactive-plugin/utils/helpers.d.ts +1 -0
- package/dist/projects/player/src/plugins/interactive-plugin/utils/interactive-ajax.d.ts +1 -0
- package/dist/projects/player/src/plugins/next-video-plugin/next-video-plugin.d.ts +0 -8
- package/dist/projects/player/src/plugins/persist-quality-settings-plugin/persist-quality-settings-plugin.d.ts +33 -0
- package/dist/projects/player/src/plugins/persist-subtitle-settings-plugin/persist-subtitle-settings-plugin.d.ts +38 -0
- package/dist/projects/player/src/plugins/picture-in-picture-plugin/picture-in-picture-plugin.d.ts +5 -1
- package/dist/projects/player/src/plugins/progress-reporter-plugin/progress-reporter-plugin.d.ts +59 -0
- package/dist/projects/player/src/plugins/touch-controls-plugin/components/touch-controls/touch-controls.d.ts +1 -1
- package/dist/projects/player/src/plugins/whiteboard-mode-plugin/components/drag-handle/drag-handle.d.ts +53 -0
- package/dist/projects/player/src/plugins/whiteboard-mode-plugin/components/drag-targets/drag-targets.d.ts +54 -0
- package/dist/projects/player/src/plugins/whiteboard-mode-plugin/components/whiteboard-mode-button/whiteboard-mode-button.d.ts +23 -0
- package/dist/projects/player/src/plugins/whiteboard-mode-plugin/components/whiteboard-mode-button/whiteboard-mode-menu-item.d.ts +15 -0
- package/dist/projects/player/src/plugins/whiteboard-mode-plugin/contants/WhiteboardSides.d.ts +5 -0
- package/dist/projects/player/src/plugins/whiteboard-mode-plugin/interfaces/WhiteboardSide.d.ts +1 -0
- package/dist/projects/player/src/plugins/whiteboard-mode-plugin/whiteboard-mode-plugin.d.ts +34 -0
- package/dist/projects/player/src/react/InteractivePlayer.d.ts +1 -0
- package/dist/projects/player/src/react/Player.d.ts +1 -1
- package/dist/projects/player/src/utils/local-storage-helper.d.ts +6 -0
- package/package.json +8 -4
- package/typings/utils/imports.d.ts +1 -1
|
@@ -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
|
-
|
|
179
|
-
|
|
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",
|
|
@@ -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,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 @@
|
|
|
1
|
+
export * from './Actions';
|
|
@@ -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,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
|
+
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,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,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
|
+
};
|
|
@@ -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 {};
|
|
@@ -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
|
-
|
|
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?: (
|
|
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 {};
|
|
@@ -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
|
+
}
|