@clickview/player 0.0.2-rc.2 → 0.0.2-rc.3

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 (47) hide show
  1. package/dist/libs/analytics/src/interfaces/AnalyticsTypes.d.ts +4 -8
  2. package/dist/libs/common/src/backbone/core/LocationUtils.d.ts +0 -1
  3. package/dist/libs/shared/src/components/app-link/AppLink.d.ts +0 -1
  4. package/dist/libs/shared/src/enums/CustomerType.d.ts +11 -0
  5. package/dist/libs/shared/src/enums/WidgetContents.d.ts +1 -3
  6. package/dist/libs/shared/src/images/svg/ImportedSvgs.d.ts +1 -3
  7. package/dist/libs/shared/src/images/svg/objects/index.d.ts +1 -3
  8. package/dist/libs/shared/src/interfaces/app-variables/BaseSearchAppVariables.d.ts +0 -1
  9. package/dist/libs/shared/src/interfaces/models/Classification.d.ts +1 -0
  10. package/dist/libs/shared/src/interfaces/models/Config.d.ts +0 -1
  11. package/dist/libs/shared/src/interfaces/models/Curriculum.d.ts +1 -3
  12. package/dist/libs/shared/src/interfaces/models/Library.d.ts +0 -3
  13. package/dist/libs/shared/src/interfaces/models/User.d.ts +2 -1
  14. package/dist/player-app.css +117 -162
  15. package/dist/player-app.js +126 -106
  16. package/dist/projects/player/src/players/player.d.ts +0 -2
  17. package/dist/projects/player/src/plugins/interactive-plugin/components/add-question-button/add-question-button.d.ts +8 -0
  18. package/dist/projects/player/src/plugins/interactive-plugin/components/create-components/create-components.d.ts +2 -2
  19. package/dist/projects/player/src/plugins/interactive-plugin/components/create-components/create-image/create-image.d.ts +1 -2
  20. package/dist/projects/player/src/plugins/interactive-plugin/components/create-components/create-interaction-buttons/create-interaction-buttons.d.ts +14 -0
  21. package/dist/projects/player/src/plugins/interactive-plugin/components/create-components/create-interaction-heading/create-interaction-heading.d.ts +1 -1
  22. package/dist/projects/player/src/plugins/interactive-plugin/components/create-components/create-missing-word/create-missing-word.d.ts +1 -2
  23. package/dist/projects/player/src/plugins/interactive-plugin/components/create-components/create-multiple-choice/create-multiple-choice.d.ts +1 -2
  24. package/dist/projects/player/src/plugins/interactive-plugin/components/create-components/create-short-answer/create-short-answer.d.ts +11 -0
  25. package/dist/projects/player/src/plugins/interactive-plugin/components/create-components/create-type-selector/create-type-selector.d.ts +8 -6
  26. package/dist/projects/player/src/plugins/interactive-plugin/components/interaction-actions/interaction-actions.d.ts +10 -0
  27. package/dist/projects/player/src/plugins/interactive-plugin/components/interaction-footer/interaction-footer.d.ts +20 -0
  28. package/dist/projects/player/src/plugins/interactive-plugin/components/interaction-header/interaction-header.d.ts +14 -0
  29. package/dist/projects/player/src/plugins/interactive-plugin/components/interactive/interactive-component.d.ts +0 -2
  30. package/dist/projects/player/src/plugins/interactive-plugin/components/question-list/question-list-empty-state.d.ts +2 -0
  31. package/dist/projects/player/src/plugins/interactive-plugin/components/question-list/question-list.d.ts +13 -0
  32. package/dist/projects/player/src/plugins/interactive-plugin/components/seek-bar/interactive-bar-items.d.ts +3 -3
  33. package/dist/projects/player/src/plugins/interactive-plugin/components/timepoint/timepoint-component.d.ts +3 -5
  34. package/dist/projects/player/src/plugins/interactive-plugin/components/view-components/short-answer/short-answer-interaction.d.ts +1 -1
  35. package/dist/projects/player/src/plugins/interactive-plugin/components/view-components/view-components.d.ts +2 -2
  36. package/dist/projects/player/src/plugins/interactive-plugin/components/view-components/view-interaction-buttons/view-iteraction-buttons.d.ts +14 -0
  37. package/dist/projects/player/src/plugins/interactive-plugin/hooks/useInteractiveState.d.ts +20 -0
  38. package/dist/projects/player/src/plugins/interactive-plugin/hooks/useInteractiveTrack.d.ts +20 -0
  39. package/dist/projects/player/src/plugins/interactive-plugin/hooks/useLockPlayer.d.ts +15 -0
  40. package/dist/projects/player/src/plugins/interactive-plugin/hooks/useStateManager.d.ts +37 -0
  41. package/dist/projects/player/src/plugins/interactive-plugin/interfaces/InteractionComponent.d.ts +2 -2
  42. package/dist/projects/player/src/plugins/interactive-plugin/interfaces/InteractiveState.d.ts +26 -0
  43. package/dist/projects/player/src/plugins/interactive-plugin/interfaces/ResultSubmission.d.ts +1 -1
  44. package/dist/projects/player/src/plugins/interactive-plugin/interfaces/SubmissionFunction.d.ts +3 -3
  45. package/dist/projects/player/src/plugins/interactive-plugin/interfaces/index.d.ts +1 -2
  46. package/dist/projects/player/src/plugins/interactive-plugin/utils/InteractiveReducer.d.ts +14 -0
  47. package/package.json +3 -3
@@ -10,7 +10,6 @@ import 'projects/player/plugins/next-video-plugin/next-video-plugin';
10
10
  import 'projects/player/plugins/create-clip-button-plugin/create-clip-button-plugin';
11
11
  import 'projects/player/plugins/resources-plugin/resources-plugin';
12
12
  import 'projects/player/plugins/picture-in-picture-plugin/picture-in-picture-plugin';
13
- import 'projects/player/plugins/favourite-plugin/favourite-plugin';
14
13
  import { PlaybackObject } from 'projects/player/interfaces/models/PlaybackObject';
15
14
  import { NextVideo } from 'projects/player/interfaces/NextVideo';
16
15
  export interface PlayerOptions extends BasePlayerOptions {
@@ -19,7 +18,6 @@ export declare class Player extends BasePlayer {
19
18
  protected options: PlayerOptions;
20
19
  constructor(id: string | Element, options: PlayerOptions);
21
20
  protected configurePlugins(): void;
22
- setFavourite(isFavourited: boolean, onClickFavourite: () => void): void;
23
21
  setNextVideo(nextVideo: NextVideo, onPlayNext: () => void): void;
24
22
  enablePictureInPicture(): void;
25
23
  disablePictureInPicture(): void;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ interface AddQuestionButtonProps {
3
+ isCreate: boolean;
4
+ open: boolean;
5
+ showTypeSelector: () => void;
6
+ }
7
+ export declare function AddQuestionButton(props: AddQuestionButtonProps): React.ReactElement;
8
+ export {};
@@ -1,7 +1,7 @@
1
1
  import { Interaction, InteractionTypeId } from 'libs/shared/interfaces';
2
- import { CreateSubmissionFunction, InteractionComponent } from 'projects/player/plugins/interactive-plugin/interfaces';
2
+ import { CreateInteractionState, CreateSubmissionFunction, InteractionComponent } from 'projects/player/plugins/interactive-plugin/interfaces';
3
3
  export declare function getCreateComponent(typeId: InteractionTypeId): InteractionComponent;
4
- declare type CreateValidationFunction = (state: any, interaction: Interaction) => string;
4
+ declare type CreateValidationFunction = (state: CreateInteractionState, interaction: Interaction) => string;
5
5
  export declare function getCreateValidation(typeId: InteractionTypeId): CreateValidationFunction;
6
6
  export declare function getCreateSubmit(typeId: InteractionTypeId): CreateSubmissionFunction;
7
7
  export {};
@@ -1,8 +1,7 @@
1
1
  import React from 'react';
2
2
  import { Interaction } from 'libs/shared/interfaces';
3
- import { InteractionProps } from 'projects/player/plugins/interactive-plugin/interfaces';
3
+ import { InteractionProps, CreateInteractionState } from 'projects/player/plugins/interactive-plugin/interfaces';
4
4
  import './create-image.scss';
5
- import { CreateInteractionState } from '../../../interfaces/CreateInteractionState';
6
5
  interface CreateImageState extends CreateInteractionState {
7
6
  url: string;
8
7
  caption?: string;
@@ -0,0 +1,14 @@
1
+ import * as React from 'react';
2
+ import { Interaction } from 'libs/shared/interfaces';
3
+ import { InteractionState } from 'projects/player/plugins/interactive-plugin/interfaces';
4
+ interface CreateInteractionButtonsProps {
5
+ interaction: Interaction;
6
+ interactionState: InteractionState;
7
+ onClickContinue: () => void;
8
+ onClickSave: () => void;
9
+ onClickCancel: () => void;
10
+ onClickAddAnother: () => void;
11
+ onClickDiscard: () => void;
12
+ }
13
+ export declare function CreateInteractionButtons(props: CreateInteractionButtonsProps): React.ReactElement;
14
+ export {};
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { InteractionTypeId } from 'libs/shared/interfaces';
3
2
  import { VideoJsPlayer } from 'video.js';
3
+ import { InteractionTypeId } from 'libs/shared/interfaces';
4
4
  interface CreateInteractionHeadingProps {
5
5
  typeId: InteractionTypeId;
6
6
  currentIndex: number;
@@ -1,7 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { InteractionProps } from 'projects/player/plugins/interactive-plugin/interfaces';
3
2
  import { Interaction } from 'libs/shared/interfaces';
4
- import { CreateInteractionState } from '../../../interfaces/CreateInteractionState';
3
+ import { InteractionProps, CreateInteractionState } from 'projects/player/plugins/interactive-plugin/interfaces';
5
4
  interface Word {
6
5
  text: string;
7
6
  order: number;
@@ -1,8 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { Interaction } from 'libs/shared/interfaces';
3
- import { InteractionProps } from 'projects/player/plugins/interactive-plugin/interfaces';
3
+ import { InteractionProps, CreateInteractionState } from 'projects/player/plugins/interactive-plugin/interfaces';
4
4
  import './create-multiple-choice.scss';
5
- import { CreateInteractionState } from '../../../interfaces/CreateInteractionState';
6
5
  export interface MultipleChoiceAnswer {
7
6
  order: number;
8
7
  name: string;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { Interaction } from 'libs/shared/interfaces';
3
+ import { InteractionProps, CreateInteractionState } from 'projects/player/plugins/interactive-plugin/interfaces';
4
+ interface CreateShortAnswerState extends CreateInteractionState {
5
+ question: string;
6
+ suggestedResponse?: string;
7
+ }
8
+ export declare function ValidateShortAnswer(state: CreateShortAnswerState): string;
9
+ export declare function SubmitShortAnswer(state: CreateShortAnswerState, interaction: Interaction): Promise<void>;
10
+ export declare function CreateShortAnswer(props: InteractionProps<CreateShortAnswerState>): React.ReactElement;
11
+ export {};
@@ -1,13 +1,15 @@
1
1
  import React from 'react';
2
- import { InteractionTypeId } from 'libs/shared/interfaces';
3
- import './create-type-selector.scss';
4
2
  import { VideoJsPlayer } from 'video.js';
3
+ import { Interaction, InteractionTypeId, Timepoint } from 'libs/shared/interfaces';
4
+ import './create-type-selector.scss';
5
5
  interface CreateTypeSelectorProps {
6
- onTypeSelected: (typeId: InteractionTypeId) => void;
7
- onClickCancel: () => void;
6
+ addInteraction: (typeId: InteractionTypeId) => void;
7
+ cancelTypeSelector: () => void;
8
8
  player: VideoJsPlayer;
9
- addingAnother: boolean;
10
- showCancel: boolean;
9
+ timepoint: Timepoint;
10
+ interaction: Interaction;
11
+ open: boolean;
12
+ isCreate: boolean;
11
13
  }
12
14
  export declare function CreateTypeSelector(props: CreateTypeSelectorProps): React.ReactElement;
13
15
  export {};
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { HtmlPortalNode } from 'react-reverse-portal';
3
+ import { Interaction } from 'libs/shared/interfaces';
4
+ interface InteractionActionsProps {
5
+ interaction: Interaction;
6
+ promptDelete: (id: string) => void;
7
+ optionsPortalNode: HtmlPortalNode;
8
+ }
9
+ export declare function InteractionActions(props: InteractionActionsProps): React.ReactElement;
10
+ export {};
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import { Interaction, Timepoint } from 'libs/shared/interfaces';
3
+ import { InteractionState, TimepointState } from 'projects/player/plugins/interactive-plugin/interfaces';
4
+ interface InteractionFooterProps {
5
+ isCreate: boolean;
6
+ interaction: Interaction;
7
+ timepoint: Timepoint;
8
+ interactionState: InteractionState;
9
+ timepointState: TimepointState;
10
+ continueInteractive: () => void;
11
+ saveInteraction: () => void;
12
+ cancel: () => void;
13
+ addAnotherQuestion: () => void;
14
+ discardChanges: (after?: () => void) => void;
15
+ submitInteractionAnswer: () => void;
16
+ skip: () => void;
17
+ changeIndex: (index: number) => void;
18
+ }
19
+ export declare function InteractionFooter(props: InteractionFooterProps): React.ReactElement;
20
+ export {};
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import { VideoJsPlayer } from 'video.js';
3
+ import { Interaction, Timepoint } from 'libs/shared/interfaces';
4
+ import { TimepointState } from 'projects/player/plugins/interactive-plugin/interfaces';
5
+ interface InteractionHeaderProps {
6
+ isCreate: boolean;
7
+ interaction: Interaction;
8
+ timepointState: TimepointState;
9
+ timepoint: Timepoint;
10
+ player: VideoJsPlayer;
11
+ changeIndex: (index: number) => void;
12
+ }
13
+ export declare function InteractionHeader(props: InteractionHeaderProps): React.ReactElement;
14
+ export {};
@@ -1,3 +1 @@
1
- import { TimepointState } from 'projects/player/plugins/interactive-plugin/components/timepoint/timepoint-component';
2
1
  import './interactive-component.scss';
3
- export declare const initialTimepointState: TimepointState;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare function QuestionListEmptyState(): React.ReactElement;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { HtmlPortalNode } from 'react-reverse-portal';
3
+ import { Interaction, Interactive } from 'libs/shared/interfaces';
4
+ interface QuestionListProps {
5
+ isCreate: boolean;
6
+ interactive: Interactive;
7
+ interaction: Interaction;
8
+ portalNode: HtmlPortalNode;
9
+ goToTimepoint: (timepointId: string, interactionId: string) => void;
10
+ promptDelete: (interactionId: string) => void;
11
+ }
12
+ export declare function QuestionList(props: QuestionListProps): React.ReactElement;
13
+ export {};
@@ -4,7 +4,7 @@ import './interactive-bar-items.scss';
4
4
  declare const Component: {
5
5
  new (player: VideoJsPlayer, options?: videojs.ComponentOptions, ready?: videojs.Component.ReadyCallback): videojs.Component;
6
6
  prototype: videojs.Component;
7
- getComponent(name: "button" | "Button"): {
7
+ getComponent(name: "Button" | "button"): {
8
8
  new (player: VideoJsPlayer, options?: videojs.ComponentOptions): videojs.Button;
9
9
  prototype: videojs.Button;
10
10
  };
@@ -16,7 +16,7 @@ declare const Component: {
16
16
  new (player: VideoJsPlayer, options?: videojs.ModalDialogOptions): videojs.ModalDialog;
17
17
  prototype: videojs.ModalDialog;
18
18
  };
19
- getComponent(name: "menu" | "Menu"): {
19
+ getComponent(name: "Menu" | "menu"): {
20
20
  new (player: VideoJsPlayer, options?: videojs.MenuOptions): videojs.Menu;
21
21
  prototype: videojs.Menu;
22
22
  };
@@ -24,7 +24,7 @@ declare const Component: {
24
24
  new (player: VideoJsPlayer, options?: videojs.MenuButtonOptions): videojs.MenuButton;
25
25
  prototype: videojs.MenuButton;
26
26
  };
27
- getComponent(name: "menuitem" | "MenuItem"): {
27
+ getComponent(name: "MenuItem" | "menuitem"): {
28
28
  new (player: VideoJsPlayer, options?: videojs.MenuItemOptions): videojs.MenuItem;
29
29
  prototype: videojs.MenuItem;
30
30
  };
@@ -2,21 +2,19 @@ import React from 'react';
2
2
  import { HtmlPortalNode } from 'react-reverse-portal';
3
3
  import { CurrentUser, Interaction } from 'libs/shared/interfaces';
4
4
  import { InteractiveMode } from 'projects/player/plugins/interactive-plugin/interfaces';
5
+ import { InteractionState, TimepointState } from 'projects/player/plugins/interactive-plugin/interfaces/InteractiveState';
5
6
  import './timepoint-component.scss';
6
- export interface TimepointState {
7
- interactionIndex: number;
8
- }
9
7
  interface TimepointProps {
10
8
  interaction: Interaction;
11
9
  mode: InteractiveMode;
12
- state: any;
13
- dispatch: React.Dispatch<any>;
14
10
  recalculateScroll: () => void;
15
11
  timepointState: TimepointState;
16
12
  imageApi: URL;
17
13
  optionsPortalNode?: HtmlPortalNode;
18
14
  immediateFeedback: boolean;
19
15
  currentUser?: CurrentUser;
16
+ interactionState: InteractionState;
17
+ userUpdateInteractionState: (value: InteractionState) => void;
20
18
  }
21
19
  export declare function TimepointComponent(props: TimepointProps): React.ReactElement;
22
20
  export {};
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { InteractionProps, ViewInteractionState, ViewSubmissionFunction } from 'projects/player/plugins/interactive-plugin/interfaces';
3
2
  import { Interaction } from 'libs/shared/interfaces';
3
+ import { InteractionProps, ViewInteractionState, ViewSubmissionFunction } from 'projects/player/plugins/interactive-plugin/interfaces';
4
4
  interface ShortAnswerState extends ViewInteractionState {
5
5
  [id: string]: string;
6
6
  }
@@ -1,9 +1,9 @@
1
1
  import { Interaction, InteractionTypeId } from 'libs/shared/interfaces';
2
- import { InteractionComponent, ViewSubmissionFunction } from 'projects/player/plugins/interactive-plugin/interfaces';
2
+ import { InteractionComponent, ViewInteractionState, ViewSubmissionFunction } from 'projects/player/plugins/interactive-plugin/interfaces';
3
3
  declare type ShowFeedbackFunction = (interaction: Interaction) => boolean;
4
4
  export declare function getShouldShowFeedback(typeId: InteractionTypeId): ShowFeedbackFunction;
5
5
  export declare function getViewComponent(typeId: InteractionTypeId): InteractionComponent;
6
- declare type ViewValidationFunction = (state: any, interaction: Interaction) => string;
6
+ declare type ViewValidationFunction = (state: ViewInteractionState, interaction: Interaction) => string;
7
7
  export declare function getViewValidation(typeId: InteractionTypeId): ViewValidationFunction;
8
8
  export declare function getViewSubmit(typeId: InteractionTypeId): ViewSubmissionFunction;
9
9
  export {};
@@ -0,0 +1,14 @@
1
+ import * as React from 'react';
2
+ import { InteractionTypeId } from 'libs/shared/interfaces';
3
+ import { InteractionState } from 'projects/player/plugins/interactive-plugin/interfaces';
4
+ interface ViewInteractionButtonsProps {
5
+ typeId: InteractionTypeId;
6
+ interactionState: InteractionState;
7
+ onClickSubmit: () => void;
8
+ onClickSkip: () => void;
9
+ currentIndex: number;
10
+ numberOfInteractions: number;
11
+ changeIndex: (index: number) => void;
12
+ }
13
+ export declare function ViewInteractionButtons(props: ViewInteractionButtonsProps): React.ReactElement;
14
+ export {};
@@ -0,0 +1,20 @@
1
+ import { Timepoint } from 'libs/shared/interfaces';
2
+ import { InteractionState, InteractiveMode, TimepointState } from 'projects/player/plugins/interactive-plugin/interfaces';
3
+ interface UseInteractiveStateProps {
4
+ mode: InteractiveMode;
5
+ timepoint: Timepoint;
6
+ }
7
+ export declare const useInteractiveState: (props: UseInteractiveStateProps) => {
8
+ _doNotUse: import("../interfaces").InteractiveState;
9
+ interaction: import("../../../../../../libs/shared/src/interfaces").Interaction;
10
+ interactionState: InteractionState;
11
+ timepointState: TimepointState;
12
+ getTimepointState: (id: string) => TimepointState;
13
+ getInteractionState: (id: string) => InteractionState;
14
+ updateTimepointState: (id: string, value: TimepointState) => void;
15
+ updateInteractionState: (id: string, value: InteractionState) => void;
16
+ clearTimepointState: (id: string) => void;
17
+ clearInteractionState: (id: string) => void;
18
+ userUpdateInteractionState: (value: InteractionState) => void;
19
+ };
20
+ export {};
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import { VideoJsPlayer } from 'video.js';
3
+ import { Interactive, Timepoint } from 'libs/shared/interfaces';
4
+ import { InteractiveMode } from 'projects/player/plugins/interactive-plugin/interfaces';
5
+ interface useInteractiveOptions {
6
+ player: VideoJsPlayer;
7
+ track: TextTrack;
8
+ interactive: Interactive;
9
+ mode: InteractiveMode;
10
+ }
11
+ export declare const useInteractiveTrack: (options: useInteractiveOptions) => {
12
+ open: boolean;
13
+ setOpen: React.Dispatch<React.SetStateAction<boolean>>;
14
+ timepoint: Timepoint;
15
+ continueInteractive: () => void;
16
+ updateCue: (oldTimepointId: string, timepointId: string) => void;
17
+ addCue: (timepointId: string) => void;
18
+ removeCue: (visibleAt: number) => void;
19
+ };
20
+ export {};
@@ -0,0 +1,15 @@
1
+ import { VideoJsPlayer } from 'video.js';
2
+ import { Interaction, Timepoint } from 'libs/shared/interfaces';
3
+ import { InteractiveMode } from 'projects/player/plugins/interactive-plugin/interfaces';
4
+ import { InteractionState, InteractiveState } from 'projects/player/plugins/interactive-plugin/interfaces/InteractiveState';
5
+ interface UseLockNavProps {
6
+ mode: InteractiveMode;
7
+ state: InteractiveState;
8
+ player: VideoJsPlayer;
9
+ timepoint: Timepoint;
10
+ interaction: Interaction;
11
+ interactionState: InteractionState;
12
+ discardChanges: (after?: () => void) => void;
13
+ }
14
+ export declare function useLockPlayer(props: UseLockNavProps): void;
15
+ export {};
@@ -0,0 +1,37 @@
1
+ import { VideoJsPlayer } from 'video.js';
2
+ import { Interaction, InteractionTypeId, Interactive, Timepoint } from 'libs/shared/interfaces';
3
+ import { InteractiveMode } from 'projects/player/plugins/interactive-plugin/interfaces';
4
+ import { ResultsService } from 'projects/player/plugins/interactive-plugin/utils/ResultsService';
5
+ interface UseStateManagerProps {
6
+ mode: InteractiveMode;
7
+ timepoint: Timepoint;
8
+ interactive: Interactive;
9
+ player: VideoJsPlayer;
10
+ resultsService?: ResultsService;
11
+ setOpen: (open: boolean) => void;
12
+ addCue: (timepointId: string) => void;
13
+ updateCue: (oldTimepointId: string, timepointId: string) => void;
14
+ removeCue: (visibleAt: number) => void;
15
+ continueInteractive: () => void;
16
+ }
17
+ export declare const useStateManager: (props: UseStateManagerProps) => {
18
+ _doNotUse: import("../interfaces").InteractiveState;
19
+ interaction: Interaction;
20
+ interactionState: import("../interfaces").InteractionState;
21
+ timepointState: import("../interfaces").TimepointState;
22
+ skip: () => void;
23
+ cancel: () => Promise<void>;
24
+ addAnotherQuestion: () => void;
25
+ goToTimepoint: (timepointId: string, interactionId: string) => void;
26
+ discardChanges: (afterDiscard?: () => void) => void;
27
+ changeIndex: (interactionIndex: number) => void;
28
+ promptDelete: (interactionId: string) => void;
29
+ showTypeSelector: () => void;
30
+ cancelTypeSelector: () => void;
31
+ deleteInteraction: (interactionId: string) => Promise<void>;
32
+ saveInteraction: () => Promise<void>;
33
+ addInteraction: (typeId: InteractionTypeId) => void;
34
+ submitInteractionAnswer: () => Promise<void>;
35
+ userUpdateInteractionState: (value: import("../interfaces").InteractionState) => void;
36
+ };
37
+ export {};
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
- import { InteractionProps } from 'projects/player/plugins/interactive-plugin/interfaces';
3
- export declare type InteractionComponent = (props: InteractionProps<any>) => React.ReactElement;
2
+ import { InteractionProps, InteractionState } from 'projects/player/plugins/interactive-plugin/interfaces';
3
+ export declare type InteractionComponent = (props: InteractionProps<InteractionState>) => React.ReactElement;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * When adding properties to InteractionState
3
+ * please make sure to omit them from ViewInteractionState below
4
+ * and submitInteractionAnswer() in useStateManager.tsx
5
+ */
6
+ export interface InteractionState {
7
+ error?: string;
8
+ hasChanges?: boolean;
9
+ spinner?: boolean;
10
+ submitted?: boolean;
11
+ }
12
+ export interface ViewInteractionState extends Omit<InteractionState, 'hasChanges' | 'spinner' | 'submitted'> {
13
+ }
14
+ export interface CreateInteractionState extends Omit<InteractionState, 'hasChanges' | 'spinner' | 'submitted'> {
15
+ }
16
+ export interface TimepointState {
17
+ interactionIndex: number;
18
+ }
19
+ export interface InteractiveState {
20
+ interactions: {
21
+ [key: string]: InteractionState;
22
+ };
23
+ timepoints: {
24
+ [key: string]: TimepointState;
25
+ };
26
+ }
@@ -1,2 +1,2 @@
1
- import { InteractionResult } from '.';
1
+ import { InteractionResult } from 'projects/player/plugins/interactive-plugin/interfaces';
2
2
  export declare type ResultSubmission = (interactionId: string, results: InteractionResult[]) => Promise<void>;
@@ -1,4 +1,4 @@
1
1
  import { Interaction } from 'libs/shared/interfaces';
2
- import { ResultSubmission } from './ResultSubmission';
3
- export declare type CreateSubmissionFunction = (state: any, interaction: Interaction) => Promise<void>;
4
- export declare type ViewSubmissionFunction = (state: any, interaction: Interaction, save: ResultSubmission) => Promise<void>;
2
+ import { CreateInteractionState, ViewInteractionState, ResultSubmission } from 'projects/player/plugins/interactive-plugin/interfaces';
3
+ export declare type CreateSubmissionFunction = (state: CreateInteractionState, interaction: Interaction) => Promise<void>;
4
+ export declare type ViewSubmissionFunction = (state: ViewInteractionState, interaction: Interaction, save: ResultSubmission) => Promise<void>;
@@ -2,7 +2,6 @@ export * from './InteractiveMode';
2
2
  export * from './InteractionProps';
3
3
  export * from './InteractionComponent';
4
4
  export * from './SubmissionFunction';
5
- export * from './CreateInteractionState';
6
5
  export * from './InteractionResult';
7
6
  export * from './ResultSubmission';
8
- export * from './ViewInteractionState';
7
+ export * from './InteractiveState';
@@ -0,0 +1,14 @@
1
+ import { InteractionState, InteractiveState, TimepointState } from 'projects/player/plugins/interactive-plugin/interfaces';
2
+ interface InteractionAction {
3
+ type: 'interaction';
4
+ id: string;
5
+ value: InteractionState;
6
+ }
7
+ interface TimepointAction {
8
+ type: 'timepoint';
9
+ id: string;
10
+ value: TimepointState;
11
+ }
12
+ export declare const initialState: InteractiveState;
13
+ export declare function interactiveReducer(state: InteractiveState, action: InteractionAction | TimepointAction): InteractiveState;
14
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clickview/player",
3
- "version": "0.0.2-rc.2",
3
+ "version": "0.0.2-rc.3",
4
4
  "description": "ClickView Player",
5
5
  "main": "dist/player-app.js",
6
6
  "scripts": {
@@ -28,7 +28,7 @@
28
28
  "@babel/core": "7.11.6",
29
29
  "@clickview/eslint-config": "1.0.0",
30
30
  "@clickview/player-font": "0.0.6",
31
- "@clickview/tooling": "0.0.21-rc.2",
31
+ "@clickview/tooling": "0.0.21-rc.3",
32
32
  "@storybook/react": "6.0.26",
33
33
  "@types/cropperjs": "1.3.0",
34
34
  "@types/draft-js": "0.10.44",
@@ -40,7 +40,7 @@
40
40
  "webpack-dev-server": "3.11.0"
41
41
  },
42
42
  "dependencies": {
43
- "@clickview/styles": "1.0.14-rc.2",
43
+ "@clickview/styles": "1.0.14-rc.3",
44
44
  "@microsoft/signalr": "5.0.2",
45
45
  "cropperjs": "1.5.6",
46
46
  "draft-convert": "2.1.10",