@clickview/curator 1.0.20-rc.1 → 1.0.20-rc.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 (27) hide show
  1. package/dist/curator-app.css.map +1 -0
  2. package/dist/curator-app.js +3 -3
  3. package/dist/curator-app.js.map +1 -0
  4. package/dist/libs/shared/src/components/image-cropper/ImageCropper.d.ts +10 -0
  5. package/dist/libs/shared/src/context/ImageStorageContext.d.ts +45 -0
  6. package/dist/libs/shared/src/flight-requests/ImageRequests.d.ts +7 -0
  7. package/dist/libs/shared/src/interfaces/models/Classification.d.ts +1 -1
  8. package/dist/libs/shared/src/interfaces/models/PresentationAudience.d.ts +1 -1
  9. package/dist/libs/shared/src/interfaces/models/Subject.d.ts +1 -1
  10. package/dist/libs/shared/src/interfaces/requests/UpdateObjectRating.d.ts +3 -0
  11. package/dist/libs/shared/src/views/image-upload/ImageUploadView.d.ts +8 -0
  12. package/dist/projects/curator/src/apps/subjects/components/audiences/edit-object-audiences/EditObjectAudiences.d.ts +1 -1
  13. package/dist/projects/curator/src/apps/subjects/components/levels/select-levels/SelectLevels.d.ts +2 -2
  14. package/dist/projects/curator/src/apps/subjects/components/subjects/add-subject-members/AddSubjectMembers.d.ts +1 -1
  15. package/dist/projects/curator/src/apps/subjects/components/subjects/edit-object-subjects/EditObjectSubjects.d.ts +1 -1
  16. package/dist/projects/curator/src/apps/subjects/components/subjects/select-subjects/SelectSubjects.d.ts +2 -2
  17. package/dist/projects/curator/src/apps/subjects/context/PresentationContext.d.ts +6 -0
  18. package/dist/projects/curator/src/apps/subjects/context/SubjectsAppContext.d.ts +4 -0
  19. package/dist/projects/curator/src/apps/subjects/context/index.d.ts +2 -0
  20. package/dist/projects/curator/src/apps/subjects/interfaces/data-requests/Audience.d.ts +1 -1
  21. package/dist/projects/curator/src/apps/subjects/interfaces/data-requests/Classification.d.ts +1 -1
  22. package/dist/projects/curator/src/apps/subjects/utils/validation/AudienceValidation.d.ts +1 -1
  23. package/dist/projects/curator/src/apps/themes/flight-requests/ThemeRequests.d.ts +11 -0
  24. package/dist/projects/curator/src/apps/themes/interfaces/CreateOrUpdateThemeRequest.d.ts +7 -0
  25. package/dist/projects/curator/src/apps/themes/interfaces/index.d.ts +1 -0
  26. package/dist/projects/curator/src/shared/constants/ViewModelKeys.d.ts +3 -0
  27. package/package.json +47 -47
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ interface ImageCropperProps {
3
+ dataUrl: string;
4
+ minHeight: number;
5
+ minWidth: number;
6
+ onCrop: (dataUrl: string) => void;
7
+ onCancel: () => void;
8
+ }
9
+ export declare function ImageCropper(props: ImageCropperProps): React.ReactElement;
10
+ export {};
@@ -0,0 +1,45 @@
1
+ import * as React from 'react';
2
+ import { Image } from "../interfaces";
3
+ /**
4
+ * This context is used for transferring image
5
+ * data between different areas of the application.
6
+ *
7
+ * It stores base64 image files that have been read
8
+ * in from ImageSelect component for the purpose of
9
+ * being cropped and uploaded in ImageUploadView.
10
+ *
11
+ * Image objects uploaded in ImageUploadView can then be
12
+ * stored in the context for use in the component
13
+ * that initially requested the upload.
14
+ */
15
+ interface IImageStorageContext {
16
+ /**
17
+ * Retrieve the stored base64 dataUrl. This will
18
+ * reset the stored value after it is read.
19
+ */
20
+ getDataUrl: () => string;
21
+ /**
22
+ * Set the stored dataUrl.
23
+ */
24
+ setDataUrl: (dataUrl: string) => void;
25
+ /**
26
+ * Retrieve the stored image object. This will
27
+ * reset the stored image object.
28
+ */
29
+ getImage: () => Image;
30
+ /**
31
+ * Store an image after it has been successfully
32
+ * uploaded.
33
+ */
34
+ setImage: (image: Image) => void;
35
+ /**
36
+ * Flag to notify anything using this context
37
+ * that an image has been uploaded.
38
+ */
39
+ imageUploaded: boolean;
40
+ }
41
+ export declare const ImageStorageContext: React.Context<IImageStorageContext>;
42
+ export declare const ImageStorageContextProvider: ({ children }: {
43
+ children?: React.ReactNode;
44
+ }) => JSX.Element;
45
+ export {};
@@ -0,0 +1,7 @@
1
+ import { Flight } from "../../../common/src/react";
2
+ import { Xhr } from "../../../common/src/backbone/interfaces/Xhr";
3
+ import { HashObject } from "../../../common/src/react/interfaces";
4
+ import { ImageType } from "../enums/Images";
5
+ export declare const ImageRequests: {
6
+ uploadBase64Image(dataUrl: string, type: ImageType, success?: (data: HashObject<any>) => void, error?: (xhr: Xhr) => void, always?: () => void): Flight.Request;
7
+ };
@@ -3,7 +3,7 @@ import { ClassificationType } from "../../enums/ClassificationType";
3
3
  export interface Classification extends BaseObject {
4
4
  presentationId: string;
5
5
  parentIds: string[];
6
- subjectIds: string[];
6
+ backboneClassificationIds: string[];
7
7
  type: ClassificationType;
8
8
  emphasize?: boolean;
9
9
  slug: string;
@@ -1,5 +1,5 @@
1
1
  export interface PresentationAudience {
2
- levelIds: string[];
2
+ backboneAudienceIds: string[];
3
3
  masterId: string;
4
4
  name: string;
5
5
  presentationId: string;
@@ -4,7 +4,7 @@ export interface Subject extends BaseObject {
4
4
  banner?: Banner;
5
5
  thumbnail?: Thumbnail;
6
6
  children?: Subject[];
7
- subjectIds: string[];
7
+ backboneClassificationIds: string[];
8
8
  playlists?: PlaylistCollection;
9
9
  videos?: VideoCollection;
10
10
  series?: SeriesCollection;
@@ -0,0 +1,3 @@
1
+ export interface UpdateObjectRating {
2
+ id: string;
3
+ }
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ import { PopupViewProps } from "../../interfaces";
3
+ import { ImageType } from "../../enums/Images";
4
+ interface ImageUploadViewProps extends PopupViewProps {
5
+ imageType: ImageType;
6
+ }
7
+ export declare function ImageUploadView(props: ImageUploadViewProps): React.ReactElement;
8
+ export {};
@@ -11,7 +11,7 @@ interface EditObjectAudiencesProps {
11
11
  levels: Level[];
12
12
  presentationAudiences: PresentationAudience[];
13
13
  memberType: SubjectMemberType;
14
- saveLevels: (levelIds: string[], addToAudiences: boolean, setSubmittingFalse: () => void) => void;
14
+ saveLevels: (backboneAudienceIds: string[], addToAudiences: boolean, setSubmittingFalse: () => void) => void;
15
15
  saveAudiences: (audienceIds: string[], setSubmittingFalse: () => void) => void;
16
16
  }
17
17
  export declare function EditObjectAudiences(props: EditObjectAudiencesProps): JSX.Element;
@@ -2,14 +2,14 @@
2
2
  import { Level } from "../../../interfaces";
3
3
  import { SubjectMemberType } from "../../../enums";
4
4
  interface SelectLevelsFormValues {
5
- levelIds: string[];
5
+ backboneAudienceIds: string[];
6
6
  addToAudiences: boolean;
7
7
  }
8
8
  interface SelectLevelsProps {
9
9
  initialValues: SelectLevelsFormValues;
10
10
  levels: Level[];
11
11
  memberType: SubjectMemberType;
12
- saveLevels: (levelIds: string[], addToAudiences: boolean, setSubmittingFalse: () => void) => void;
12
+ saveLevels: (backboneAudienceIds: string[], addToAudiences: boolean, setSubmittingFalse: () => void) => void;
13
13
  }
14
14
  export declare function SelectLevels(props: SelectLevelsProps): JSX.Element;
15
15
  export {};
@@ -6,7 +6,7 @@ interface AddSubjectMembersProps {
6
6
  memberType: SubjectMemberType;
7
7
  subjectTree: SubjectTree;
8
8
  objects: BaseObject[];
9
- onClickAddToSubject: (subjectIds: string[], addToClassifications: boolean, setSubmittingFalse: () => void) => void;
9
+ onClickAddToSubject: (backboneClassificationIds: string[], addToClassifications: boolean, setSubmittingFalse: () => void) => void;
10
10
  }
11
11
  export declare function AddSubjectMembers(props: AddSubjectMembersProps): React.ReactElement;
12
12
  export {};
@@ -5,7 +5,7 @@ import { SubjectTree, Presentation, ClassificationTree } from "../../../interfac
5
5
  interface EditObjectSubjectsProps {
6
6
  objectSubjects: Subject[];
7
7
  subjectTree: SubjectTree;
8
- saveSubjects: (subjectIds: string[], addToClassifications: boolean, setSubmittingFalse: () => void) => void;
8
+ saveSubjects: (backboneClassificationIds: string[], addToClassifications: boolean, setSubmittingFalse: () => void) => void;
9
9
  memberType: SubjectMemberType;
10
10
  presentations: Presentation[];
11
11
  currentPresentation: Presentation;
@@ -2,12 +2,12 @@
2
2
  import { SubjectTree } from "../../../interfaces";
3
3
  import { SubjectMemberType } from "../../../enums";
4
4
  interface SelectSubjectsFormValues {
5
- subjectIds: string[];
5
+ backboneClassificationIds: string[];
6
6
  addToClassifications?: boolean;
7
7
  }
8
8
  interface SelectSubjectsProps {
9
9
  initialValues: SelectSubjectsFormValues;
10
- saveSubjects: (subjectIds: string[], addToClassifications: boolean, onDone: () => void) => void;
10
+ saveSubjects: (backboneClassificationIds: string[], addToClassifications: boolean, onDone: () => void) => void;
11
11
  subjectTree: SubjectTree;
12
12
  memberType: SubjectMemberType;
13
13
  subjectRequired?: boolean;
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ import { Presentation } from "../interfaces";
3
+ declare type IPresentationContent = [Presentation, React.Dispatch<React.SetStateAction<Presentation>>];
4
+ export declare const PresentationContext: React.Context<IPresentationContent>;
5
+ export declare function PresentationContextProvider({ children }: React.PropsWithChildren<{}>): React.ReactElement;
6
+ export {};
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ export declare const SubjectsAppContextProvider: ({ children }: {
3
+ children?: React.ReactNode;
4
+ }) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)>) | (new (props: any) => React.Component<any, any, any>)>;
@@ -0,0 +1,2 @@
1
+ export * from './PresentationContext';
2
+ export * from './SubjectsAppContext';
@@ -1,5 +1,5 @@
1
1
  export interface CreateOrUpdateAudienceRequest {
2
2
  name: string;
3
- levelIds: string[];
3
+ backboneAudienceIds: string[];
4
4
  presentationId: string;
5
5
  }
@@ -4,7 +4,7 @@ export interface UpdateClassificationRequest {
4
4
  type: ClassificationType;
5
5
  name?: string;
6
6
  parentIds?: string[];
7
- subjectIds: string[];
7
+ backboneClassificationIds: string[];
8
8
  emphasize?: boolean;
9
9
  pinnedVideoMasterId?: string;
10
10
  cover?: Cover;
@@ -1,3 +1,3 @@
1
1
  import * as Yup from 'yup';
2
2
  import { CreateOrUpdateAudienceRequest } from "../../interfaces";
3
- export declare const AudienceValidationSchema: Yup.ObjectSchema<Yup.Shape<object, Pick<CreateOrUpdateAudienceRequest, "name" | "levelIds">>>;
3
+ export declare const AudienceValidationSchema: Yup.ObjectSchema<Yup.Shape<object, Pick<CreateOrUpdateAudienceRequest, "name" | "backboneAudienceIds">>>;
@@ -0,0 +1,11 @@
1
+ import { Flight } from "../../../../../../libs/common/src/react";
2
+ import { HashObject } from "../../../../../../libs/common/src/react/interfaces/HashObject";
3
+ import { Xhr } from "../../../../../../libs/common/src/backbone/interfaces";
4
+ import { CreateOrUpdateThemeRequest } from "../interfaces";
5
+ export declare const ThemeRequests: {
6
+ theme(id: string): Flight.Request;
7
+ themes(type?: string): Flight.Request;
8
+ createTheme(data: CreateOrUpdateThemeRequest, success?: (data: HashObject<any>) => void, error?: (xhr: Xhr) => void, always?: () => void): Flight.Request;
9
+ updateTheme(id: string, data: CreateOrUpdateThemeRequest, success?: (data: HashObject<any>) => void, error?: (xhr: Xhr) => void, always?: () => void): Flight.Request;
10
+ deleteTheme(id: string, success?: (data: HashObject<any>) => void, error?: (xhr: Xhr) => void, always?: () => void): Flight.Request;
11
+ };
@@ -0,0 +1,7 @@
1
+ import { ThemeType } from "../../../../../../libs/shared/src/enums/ThemeType";
2
+ import { ThemeData } from "../../../../../../libs/shared/src/interfaces";
3
+ export interface CreateOrUpdateThemeRequest {
4
+ name: string;
5
+ type: ThemeType;
6
+ data: ThemeData;
7
+ }
@@ -0,0 +1 @@
1
+ export * from './CreateOrUpdateThemeRequest';
@@ -0,0 +1,3 @@
1
+ export declare const ViewModelKeys: {
2
+ RELEASE_NOTES_CONFIG: string;
3
+ };
package/package.json CHANGED
@@ -1,47 +1,47 @@
1
- {
2
- "name": "@clickview/curator",
3
- "version": "1.0.20-rc.1",
4
- "description": "curator",
5
- "main": "dist/curator-app.js",
6
- "types": "dist/index.d.ts",
7
- "scripts": {
8
- "start": "set NODE_ENV=development&& webpack -w --config ./tooling/webpack.config.js",
9
- "build": "set NODE_ENV=production&& webpack --config ./tooling/webpack.config.js",
10
- "dev-build": "set NODE_ENV=development&& webpack --config ./tooling/webpack.config.js"
11
- },
12
- "repository": {
13
- "type": "git",
14
- "url": "http://gitlab.cvinternal.net/front-end/curator.git"
15
- },
16
- "cv": {
17
- "publishable": true,
18
- "rebuildable": true
19
- },
20
- "author": "Matt Trengrove",
21
- "license": "ISC",
22
- "devDependencies": {
23
- "@clickview/tooling": "0.0.18",
24
- "@types/cropperjs": "1.3.0",
25
- "@types/react-copy-to-clipboard": "4.3.0",
26
- "@types/react-transition-group": "4.2.3",
27
- "@types/yup": "0.26.24"
28
- },
29
- "dependencies": {
30
- "@clickview/styles": "1.0.9-rc.1",
31
- "cropperjs": "1.5.6",
32
- "marked": "0.8.0",
33
- "react-copy-to-clipboard": "5.0.2",
34
- "yup": "0.27.0"
35
- },
36
- "babel": {
37
- "presets": [
38
- [
39
- "@babel/preset-env",
40
- {
41
- "corejs": 2,
42
- "useBuiltIns": "entry"
43
- }
44
- ]
45
- ]
46
- }
47
- }
1
+ {
2
+ "name": "@clickview/curator",
3
+ "version": "1.0.20-rc.2",
4
+ "description": "curator",
5
+ "main": "dist/curator-app.js",
6
+ "types": "dist/index.d.ts",
7
+ "scripts": {
8
+ "start": "set NODE_ENV=development&& webpack -w --config ./tooling/webpack.config.js",
9
+ "build": "set NODE_ENV=production&& webpack --config ./tooling/webpack.config.js",
10
+ "dev-build": "set NODE_ENV=development&& webpack --config ./tooling/webpack.config.js"
11
+ },
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "http://gitlab.cvinternal.net/front-end/curator.git"
15
+ },
16
+ "cv": {
17
+ "publishable": true,
18
+ "rebuildable": true
19
+ },
20
+ "author": "Matt Trengrove",
21
+ "license": "ISC",
22
+ "devDependencies": {
23
+ "@clickview/tooling": "0.0.18",
24
+ "@types/cropperjs": "1.3.0",
25
+ "@types/react-copy-to-clipboard": "4.3.0",
26
+ "@types/react-transition-group": "4.2.3",
27
+ "@types/yup": "0.26.24"
28
+ },
29
+ "dependencies": {
30
+ "@clickview/styles": "1.0.9-rc.1",
31
+ "cropperjs": "1.5.6",
32
+ "marked": "0.8.0",
33
+ "react-copy-to-clipboard": "5.0.2",
34
+ "yup": "0.27.0"
35
+ },
36
+ "babel": {
37
+ "presets": [
38
+ [
39
+ "@babel/preset-env",
40
+ {
41
+ "corejs": 2,
42
+ "useBuiltIns": "entry"
43
+ }
44
+ ]
45
+ ]
46
+ }
47
+ }