jamespot-react-components 1.0.136 → 1.0.138

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 (81) hide show
  1. package/build/assets/ai.0bd1828cb6ec10ad92d900c710079cac.png +0 -0
  2. package/build/assets/default.2ca3180f8cdd6f14c4184439f06173cb.png +0 -0
  3. package/build/assets/docx.d99aeeb833c328dc360bb2dc1d99126f.png +0 -0
  4. package/build/assets/mp3.c4f6cf8e048c8d1fd70ea5676f9e35bb.png +0 -0
  5. package/build/assets/mp4.c631e40ab77a5009bec629505396f88b.png +0 -0
  6. package/build/assets/pdf.25c19fbb11dacc87994bdce830d7e5ed.png +0 -0
  7. package/build/assets/pptx.fc266e95afba9abd862da4d909e1ad68.png +0 -0
  8. package/build/assets/psd.cca4c1ac52e6e24770486bf5bc6d6ff9.png +0 -0
  9. package/build/assets/svg.21a77099744d94b9214c52043ef39d95.png +0 -0
  10. package/build/assets/ttf.28668a6c059779e01fe7dc66dd70ef40.png +0 -0
  11. package/build/assets/txt.d0b32e515641b99e8e31165279361eb4.png +0 -0
  12. package/build/assets/xlsx.a3b00a8cd84f504b94d1cfc617b4080f.png +0 -0
  13. package/build/assets/zip.b8f8ab347fc92f763a2d44617a82b66e.png +0 -0
  14. package/build/jamespot-react-components.js +1167 -927
  15. package/build/jamespot-react-components.js.map +1 -1
  16. package/build/src/components/Common/FastCss.d.ts +1 -0
  17. package/build/src/components/Form/Input/Common/JRCFormFieldRenderer.types.d.ts +2 -0
  18. package/build/src/components/Form/Input/JRCFormCheckbox/JRCCheckbox.d.ts +3 -3
  19. package/build/src/components/Form/Input/JRCFormCheckbox/JRCRadio.d.ts +3 -3
  20. package/build/src/components/Form/Input/JRCFormCheckbox/JRCToggle.d.ts +0 -3
  21. package/build/src/components/Form/Input/JRCFormFieldRender.d.ts +1 -0
  22. package/build/src/components/Form/Input/JRCFormFile/JRCFormFile.d.ts +1 -1
  23. package/build/src/components/Form/Input/JRCFormRichText/JRCFormRichEditorField.styles.d.ts +1 -0
  24. package/build/src/components/Form/Input/JRCFormRichText/JRCFormRichTextField.d.ts +2 -0
  25. package/build/src/components/Form/Input/JRCFormTextarea/JRCFormTextarea.d.ts +1 -0
  26. package/build/src/components/Form/Input/JRCInputCheckbox/JRCInputCheckbox.d.ts +4 -1
  27. package/build/src/components/Form/Input/JRCInputCheckbox/JRCInputCheckbox.utils.d.ts +1 -0
  28. package/build/src/components/Form/Input/JRCInputCheckbox/JRCInputReorderCheckbox.d.ts +21 -0
  29. package/build/src/components/Form/Input/JRCInputCheckbox/JRCInputReorderCheckbox.stories.d.ts +5 -0
  30. package/build/src/components/Form/Input/JRCInputImage/JRCInputImage.d.ts +5 -1
  31. package/build/src/components/Form/Input/JRCInputImage/JRCInputImage.styles.d.ts +1 -0
  32. package/build/src/components/Form/Input/JRCInputText/JRCInputText.d.ts +3 -0
  33. package/build/src/components/Form/Input/JRCInputText/JRCInputText.stories.d.ts +2 -0
  34. package/build/src/components/Form/Input/JRCInputText/JRCInputText.style.d.ts +2 -0
  35. package/build/src/components/Form/Input/JRCInputTextarea/JRCInputTextarea.d.ts +1 -0
  36. package/build/src/components/Form/Input/JRCInputUrl/JRCInputUrl.d.ts +19 -0
  37. package/build/src/components/Form/Input/JRCInputUrl/JRCInputUrl.stories.d.ts +7 -0
  38. package/build/src/components/Form/Input/JRCSelect/JRCInputSelect.style.d.ts +8 -5
  39. package/build/src/components/Form/Input/JRCSelect/JRCInputSelect.types.d.ts +2 -0
  40. package/build/src/components/Form/Input/JRCSelect/JRCInputSelectHierarchicalTree.d.ts +3 -0
  41. package/build/src/components/Form/Input/JRCStyledInput.d.ts +3 -0
  42. package/build/src/components/JRCAvatar/JRCAvatar.d.ts +1 -0
  43. package/build/src/components/JRCButtonDownload/JRCButtonDownload.d.ts +2 -2
  44. package/build/src/components/JRCFile/JRCFile.d.ts +3 -0
  45. package/build/src/components/JRCFile/JRCFile.stories.d.ts +4 -0
  46. package/build/src/components/JRCFile/JRCFileApplication.d.ts +2 -0
  47. package/build/src/components/JRCFile/JRCFileAudio.d.ts +2 -0
  48. package/build/src/components/JRCFile/JRCFileAvatar.d.ts +7 -0
  49. package/build/src/components/JRCFile/JRCFileImage.d.ts +13 -0
  50. package/build/src/components/JRCFile/JRCFileVideo.d.ts +2 -0
  51. package/build/src/components/JRCFile/types.d.ts +6 -0
  52. package/build/src/components/JRCFileViewer/JRCFileViewer.d.ts +2 -0
  53. package/build/src/components/JRCFileViewer/JRCFileViewer.stories.d.ts +4 -0
  54. package/build/src/components/JRCFileViewer/JRCFileViewer.styles.d.ts +16 -0
  55. package/build/src/components/JRCFileViewer/JRCFileViewerArrows.d.ts +3 -0
  56. package/build/src/components/JRCFileViewer/JRCFileViewerContent.d.ts +8 -0
  57. package/build/src/components/JRCFileViewer/JRCFileViewerContentApplication.d.ts +9 -0
  58. package/build/src/components/JRCFileViewer/JRCFileViewerContentAudio.d.ts +4 -0
  59. package/build/src/components/JRCFileViewer/JRCFileViewerContentImage.d.ts +4 -0
  60. package/build/src/components/JRCFileViewer/JRCFileViewerContentVideo.d.ts +4 -0
  61. package/build/src/components/JRCFileViewer/JRCFileViewerOpenWithOptions.d.ts +7 -0
  62. package/build/src/components/JRCFileViewer/types.d.ts +19 -0
  63. package/build/src/components/JRCFileViewer/utils.d.ts +4 -0
  64. package/build/src/components/JRCFlex/JRCFlexBox.d.ts +4 -4
  65. package/build/src/components/JRCImg/JRCImg.d.ts +2 -0
  66. package/build/src/components/JRCModal/JRCModal.d.ts +1 -0
  67. package/build/src/components/JRCModal/JRCModal.styles.d.ts +3 -1
  68. package/build/src/components/Widgets/components/Attachment.d.ts +1 -1
  69. package/build/src/hooks/UseImageLoader.d.ts +6 -0
  70. package/build/src/hooks/UseKeyPress.d.ts +5 -0
  71. package/build/src/index.d.ts +5 -0
  72. package/build/src/styles/theme.d.ts +2 -2
  73. package/build/src/types.d.ts +1 -0
  74. package/build/src/utils/test-utils.d.ts +2 -2
  75. package/build/src/utils/utils.array.d.ts +13 -1
  76. package/build/src/utils/utils.document.d.ts +3 -0
  77. package/build/src/utils/utils.files.d.ts +10 -0
  78. package/build/src/utils/utils.image.d.ts +1 -0
  79. package/build/src/utils/utils.object.d.ts +8 -1
  80. package/package.json +17 -12
  81. package/pnpm-lock.yaml +20783 -0
@@ -0,0 +1,6 @@
1
+ export declare const useImageLoader: (url: string, maxWidth?: number | undefined) => {
2
+ loading: boolean;
3
+ error: boolean;
4
+ width: number;
5
+ height: number;
6
+ };
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ export declare const useKeyPress: (targetKey: string, initialValue?: boolean | undefined) => {
3
+ keyPressed: boolean | undefined;
4
+ setKeyPressed: React.Dispatch<React.SetStateAction<boolean | undefined>>;
5
+ };
@@ -57,6 +57,7 @@ export { JRCDropDown } from './components/JRCDropDown/JRCDropDown';
57
57
  export { JRCEllipsis } from './components/JRCEllipsis/JRCEllipsis';
58
58
  export { JRCFadeStepper } from './components/Stepper/JRCFadeStepper';
59
59
  export { JRCFileOpen } from './components/JRCFileOpen/JRCFileOpen';
60
+ export { JRCFileViewer } from './components/JRCFileViewer/JRCFileViewer';
60
61
  export { JRCFlexBox } from './components/JRCFlex/JRCFlexBox';
61
62
  export { JRCFolders } from './components/JRCFolders/JRCFolders';
62
63
  export { JRCFormCheckbox } from './components/Form/Input/JRCFormCheckbox/JRCFormCheckbox';
@@ -90,6 +91,7 @@ export { JRCInputDate } from './components/Form/Input/JRCInputDate/JRCInputDate'
90
91
  export { JRCInputEmail } from './components/Form/Input/JRCFormEmail/JRCInputEmail';
91
92
  export { JRCInputFile } from './components/Form/Input/JRCInputFile/JRCInputFile';
92
93
  export { JRCInputImage } from './components/Form/Input/JRCInputImage/JRCInputImage';
94
+ export { JRCInputReorderCheckbox } from './components/Form/Input/JRCInputCheckbox/JRCInputReorderCheckbox';
93
95
  export { JRCInputRichText } from './components/Form/Input/JRCInputRichText/JRCInputRichText';
94
96
  export { JRCInputSelect } from './components/Form/Input/JRCSelect/JRCInputSelect';
95
97
  export { JRCInputSelectHierarchicalTree } from './components/Form/Input/JRCSelect/JRCInputSelectHierarchicalTree';
@@ -98,6 +100,7 @@ export { JRCInputText } from './components/Form/Input/JRCInputText/JRCInputText'
98
100
  export { JRCInputTextIconButton } from './components/Form/Input/JRCInputText/JRCInputTextIconButton';
99
101
  export { JRCInputTextarea } from './components/Form/Input/JRCInputTextarea/JRCInputTextarea';
100
102
  export { JRCInputTime } from './components/Form/Input/JRCInputTime/JRCInputTime';
103
+ export { JRCInputUrl } from './components/Form/Input/JRCInputUrl/JRCInputUrl';
101
104
  export { JRCList } from './components/JRCList/JRCList';
102
105
  export { JRCLoader } from './components/JRCLoader/JRCLoader';
103
106
  export { JRCMainColumn } from './components/Templates/JRCMainColumn';
@@ -137,6 +140,8 @@ export { LabelDescriptionOption } from './components/Form/Input/JRCSelect/JRCInp
137
140
  export { StyledInput } from './components/Form/Input/JRCStyledInput';
138
141
  export { useDebounce } from './hooks/UseDebounce';
139
142
  export { useDidMountEffect } from './hooks/UseDidMountEffect';
143
+ export { useImageLoader } from './hooks/UseImageLoader';
144
+ export { useKeyPress } from './hooks/UseKeyPress';
140
145
  export { useTimeout } from './hooks/UseTimeout';
141
146
  /****
142
147
  *
@@ -18,7 +18,7 @@ export declare type ThemeConfigOptions = {
18
18
  navTextColor: string;
19
19
  bgColorNotLogged: string;
20
20
  };
21
- export declare type Colors = 'primary' | 'secondary' | 'headerColor' | 'headerTextColor' | 'headerUserBackground' | 'headerUserTextColor' | 'headerSearchBarTextColor' | 'headerSearchBarBackgroundColor' | 'lavender' | 'orange' | 'yellow' | 'green' | 'navy' | 'overseas' | 'sandLight' | 'sand' | 'grey0' | 'grey1' | 'grey2' | 'grey3' | 'grey4' | 'grey5' | 'grey6' | 'black' | 'black10' | 'black15' | 'black20' | 'white';
21
+ export declare type Colors = 'primary' | 'secondary' | 'headerColor' | 'headerTextColor' | 'headerUserBackground' | 'headerUserTextColor' | 'headerSearchBarTextColor' | 'headerSearchBarBackgroundColor' | 'lavender' | 'orange' | 'yellow' | 'green' | 'navy' | 'overseas' | 'night2' | 'sandLight' | 'sand' | 'grey0' | 'grey1' | 'grey2' | 'grey3' | 'grey4' | 'grey5' | 'grey6' | 'black' | 'black10' | 'black15' | 'black20' | 'white';
22
22
  declare type ThemeConfigColorType = {
23
23
  [color in Colors]: string;
24
24
  };
@@ -28,7 +28,7 @@ declare type ThemeConfigShadeType = {
28
28
  };
29
29
  export declare type ColorsOrShades = Colors | Shades;
30
30
  export declare const NATIVE_COLORS: readonly ["currentColor", "inherit", "transparent"];
31
- export declare type NativeColor = typeof NATIVE_COLORS[number];
31
+ export declare type NativeColor = (typeof NATIVE_COLORS)[number];
32
32
  export declare type FontWeight = {
33
33
  light: number;
34
34
  normal: number;
@@ -55,6 +55,7 @@ export { JRCInputTextareaProps } from './components/Form/Input/JRCInputTextarea/
55
55
  export { JRCInputTextProps } from './components/Form/Input/JRCInputText/JRCInputText';
56
56
  export { JRCInputTextIconButtonProps } from './components/Form/Input/JRCInputText/JRCInputTextIconButton';
57
57
  export { JRCInputTimeProps } from './components/Form/Input/JRCInputTime/JRCInputTime';
58
+ export { JRCInputUrlProps } from './components/Form/Input/JRCInputUrl/JRCInputUrl';
58
59
  export { JRCLinkToProps, JRCStyledHrefProps } from './components/JRCHref/JRCHref';
59
60
  export { JRCListProps, PaginationPagination } from './components/JRCList/JRCList';
60
61
  export { JRCLoaderProps } from './components/JRCLoader/JRCLoader';
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
- import { RenderOptions } from '@testing-library/react';
2
+ import { RenderOptions, RenderResult } from '@testing-library/react';
3
3
  export interface RenderWrapperProps {
4
4
  children: React.ReactNode;
5
5
  }
6
- declare const renderWithWrapper: (ui: React.ReactElement, options?: Omit<RenderOptions<typeof import("@testing-library/dom/types/queries"), HTMLElement>, "queries"> | undefined) => import("@testing-library/react").RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement>;
6
+ declare const renderWithWrapper: (ui: React.ReactElement, options?: Omit<RenderOptions<typeof import("@testing-library/dom/types/queries"), HTMLElement>, "queries"> | undefined) => RenderResult;
7
7
  export { renderWithWrapper };
@@ -2,9 +2,21 @@ declare type Uri = {
2
2
  uri: string;
3
3
  };
4
4
  export declare const inArray: <T extends Uri>(arr: T[], value: T) => boolean;
5
+ /**
6
+ * If the element exists, removes it, otherwise adds it
7
+ * @param arr array of objects with a uri
8
+ * @param value object with a uri
9
+ * @returns
10
+ */
5
11
  export declare const updateArray: <T extends Uri>(arr: T[], value: T) => T[];
12
+ /**
13
+ * Merge and dedupe objects based on their uri
14
+ * @param arr1 array of objects with a uri
15
+ * @param arr2 array of objects with a uri
16
+ * @returns
17
+ */
6
18
  export declare const arrayUniqueByUri: <T extends {
7
19
  uri: string;
8
20
  }>(arr1: T[], arr2: T[]) => T[];
9
- export declare const arraySwapElements: (arr: any[], index1: number, index2: number) => any[];
21
+ export declare const arraySwapElements: <T>(arr: T[], index1: number, index2: number) => T[];
10
22
  export {};
@@ -1,4 +1,7 @@
1
1
  export declare function isDocumentElement(el: HTMLElement | typeof window): el is typeof window;
2
+ /**
3
+ * Quick fix (type error with npm but not with pnpm. Dunno why)
4
+ */
2
5
  export declare function scrollTo(el: HTMLElement | typeof window, top: number): void;
3
6
  export declare function getScrollParent(element: HTMLElement): HTMLElement;
4
7
  export declare function scrollIntoView(menuEl: HTMLElement, focusedEl: HTMLElement): void;
@@ -0,0 +1,10 @@
1
+ export declare function fileExtension(mimetype: string): string;
2
+ export declare function fileAvatar(mimetype: string): {
3
+ ext: string;
4
+ path: string;
5
+ colors: {
6
+ primary: string;
7
+ light: string;
8
+ dark: string;
9
+ };
10
+ };
@@ -1,3 +1,4 @@
1
+ export declare const getExtensionFromName: (name: string) => string;
1
2
  export declare function getIconExtensionFile(fileName: string, basePath: string): {
2
3
  path: string;
3
4
  colors: {
@@ -1,2 +1,9 @@
1
- export declare function deepEqual(a: any, b: any): boolean;
1
+ export { deepEqual } from 'jamespot-user-api';
2
2
  export declare function objectRemoveProperty(obj: Record<string, unknown>, prop: string): Record<string, unknown>;
3
+ /**
4
+ * parse and catch the JSON.parse
5
+ * @param str value to parse
6
+ * @param defaultValue default value in case of the JSON.parse fails
7
+ * @returns
8
+ */
9
+ export declare function parse<T>(str: string, defaultValue: T): T;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jamespot-react-components",
3
- "version": "1.0.136",
3
+ "version": "1.0.138",
4
4
  "description": "",
5
5
  "main": "./build/jamespot-react-components.js",
6
6
  "types": "./build/src/index.d.ts",
@@ -46,6 +46,7 @@
46
46
  "@types/chroma-js": "^2.1.3",
47
47
  "@types/classnames": "^2.2.10",
48
48
  "@types/jest": "^27.0.2",
49
+ "@types/node": "^20.3.1",
49
50
  "@types/react": "^17.0.2",
50
51
  "@types/react-dom": "^17.0.2",
51
52
  "@types/react-redux": "^7.1.24",
@@ -56,6 +57,7 @@
56
57
  "@types/react-test-renderer": "^17.0.1",
57
58
  "@types/redux-form": "^8.3.5",
58
59
  "@types/styled-components": "^5.1.4",
60
+ "@types/testing-library__jest-dom": "^5.12.0",
59
61
  "@types/uuid": "^8.3.1",
60
62
  "@typescript-eslint/eslint-plugin": "^5.4.0",
61
63
  "@typescript-eslint/parser": "^5.4.0",
@@ -89,19 +91,21 @@
89
91
  "webpack-dev-server": "^4.4.0"
90
92
  },
91
93
  "dependencies": {
92
- "@tiptap/extension-character-count": "^2.0.0-beta.203",
93
- "@tiptap/extension-color": "^2.0.0-beta.203",
94
- "@tiptap/extension-link": "^2.0.0-beta.203",
95
- "@tiptap/extension-mention": "^2.0.0-beta.204",
96
- "@tiptap/extension-placeholder": "^2.0.1",
97
- "@tiptap/extension-text-align": "^2.0.0-beta.203",
98
- "@tiptap/extension-text-style": "^2.0.0-beta.203",
99
- "@tiptap/extension-underline": "^2.0.0-beta.203",
100
- "@tiptap/react": "^2.0.0-beta.203",
101
- "@tiptap/starter-kit": "^2.0.0-beta.203",
94
+ "@tiptap/core": "^2.0.3",
95
+ "@tiptap/extension-character-count": "^2.0.3",
96
+ "@tiptap/extension-color": "^2.0.3",
97
+ "@tiptap/extension-link": "^2.0.3",
98
+ "@tiptap/extension-mention": "^2.0.3",
99
+ "@tiptap/extension-placeholder": "^2.0.3",
100
+ "@tiptap/extension-text-align": "^2.0.3",
101
+ "@tiptap/extension-text-style": "^2.0.3",
102
+ "@tiptap/extension-underline": "^2.0.3",
103
+ "@tiptap/react": "^2.0.3",
104
+ "@tiptap/starter-kit": "^2.0.3",
105
+ "@tiptap/suggestion": "^2.0.3",
102
106
  "chroma-js": "^2.1.1",
103
107
  "classnames": "^2.3.1",
104
- "jamespot-user-api": "^1.0.106",
108
+ "jamespot-user-api": "^1.0.108",
105
109
  "moment": "^2.29.1",
106
110
  "react": "^17.x",
107
111
  "react-beautiful-dnd": "^13.1.1",
@@ -122,6 +126,7 @@
122
126
  "slick-carousel": "^1.8.1",
123
127
  "styled-components": "^5.2.1",
124
128
  "styled-reset": "^4.2.3",
129
+ "tippy.js": "^6.3.7",
125
130
  "uuid": "^8.3.2"
126
131
  },
127
132
  "peerDependencies": {