@oneblink/apps-react 5.5.0-beta.7 → 5.5.1-beta.1
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/dist/components/renderer/attachments/DropdownMenu.js +3 -3
- package/dist/components/renderer/attachments/DropdownMenu.js.map +1 -1
- package/dist/components/renderer/attachments/FileCard.js +1 -1
- package/dist/components/renderer/attachments/FileCard.js.map +1 -1
- package/dist/components/renderer/attachments/FileCardContent.d.ts +2 -1
- package/dist/components/renderer/attachments/FileCardContent.js +2 -2
- package/dist/components/renderer/attachments/FileCardContent.js.map +1 -1
- package/package.json +1 -1
@@ -21,17 +21,17 @@ const DropdownMenu = ({ element, onRemove, onDownload, onRetry }) => {
|
|
21
21
|
onRetry && (React.createElement("a", { className: "dropdown-item cypress-file-retry-button", onClick: () => {
|
22
22
|
hideMore();
|
23
23
|
onRetry();
|
24
|
-
} }, "Retry")),
|
24
|
+
}, role: "menuitem" }, "Retry")),
|
25
25
|
onDownload && (React.createElement("a", { className: "dropdown-item cypress-file-download-button", onClick: () => {
|
26
26
|
hideMore();
|
27
27
|
onDownload();
|
28
|
-
} }, "Download")),
|
28
|
+
}, role: "menuitem" }, "Download")),
|
29
29
|
React.createElement("a", { className: clsx('dropdown-item cypress-file-remove-button', {
|
30
30
|
'ob-files__menu-remove-hidden': element.readOnly,
|
31
31
|
}), onClick: () => {
|
32
32
|
hideMore();
|
33
33
|
onRemove();
|
34
|
-
} }, "Remove")))));
|
34
|
+
}, role: "menuitem" }, "Remove")))));
|
35
35
|
};
|
36
36
|
export default React.memo(DropdownMenu);
|
37
37
|
//# sourceMappingURL=DropdownMenu.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"DropdownMenu.js","sourceRoot":"","sources":["../../../../src/components/renderer/attachments/DropdownMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,IAAI,MAAM,MAAM,CAAA;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L;gBACA,UAAU,IAAI,CACb,2BACE,SAAS,EAAC,4CAA4C,EACtD,OAAO,EAAE,GAAG,EAAE;wBACZ,QAAQ,EAAE,CAAA;wBACV,UAAU,EAAE,CAAA;oBACd,CAAC,EACD,IAAI,EAAC,UAAU,eAGb,CACL;gBACD,2BACE,SAAS,EAAE,IAAI,CAAC,0CAA0C,EAAE;wBAC1D,8BAA8B,EAAE,OAAO,CAAC,QAAQ;qBACjD,CAAC,EACF,OAAO,EAAE,GAAG,EAAE;wBACZ,QAAQ,EAAE,CAAA;wBACV,QAAQ,EAAE,CAAA;oBACZ,CAAC,EACD,IAAI,EAAC,UAAU,aAGb,CACA,CACF,CACF,CACP,CAAA;AACH,CAAC,CAAA;AAED,eAAe,KAAK,CAAC,IAAI,CAAQ,YAAY,CAAC,CAAA","sourcesContent":["import * as React from 'react'\nimport clsx from 'clsx'\nimport useBooleanState from '../../../hooks/useBooleanState'\nimport useClickOutsideElement from '../../../hooks/useClickOutsideElement'\nimport { FormTypes } from '@oneblink/types'\n\ninterface Props {\n element: FormTypes.FilesElement\n onRemove: () => void\n onDownload?: () => void\n onRetry?: () => void\n}\n\nconst DropdownMenu = ({ element, onRemove, onDownload, onRetry }: Props) => {\n const dropDownRef = React.useRef(null)\n const [isShowingMore, showMore, hideMore] = useBooleanState(false)\n\n useClickOutsideElement(\n dropDownRef,\n React.useCallback(() => {\n if (isShowingMore) {\n hideMore()\n }\n }, [hideMore, isShowingMore]),\n )\n\n return (\n <div\n className={clsx('dropdown is-right ob-files__menu', {\n 'is-active': isShowingMore,\n })}\n ref={dropDownRef}\n >\n <div className=\"dropdown-trigger\">\n <button\n type=\"button\"\n className=\"button ob-files__menu-button cypress-file-menu-button\"\n aria-haspopup=\"true\"\n aria-controls=\"dropdown-menu\"\n onClick={isShowingMore ? hideMore : showMore}\n >\n <i className=\"material-icons ob-files__menu-icon\">more_vert</i>\n </button>\n </div>\n <div className=\"dropdown-menu\" role=\"menu\">\n <div className=\"dropdown-content\">\n {onRetry && (\n <a\n className=\"dropdown-item cypress-file-retry-button\"\n onClick={() => {\n hideMore()\n onRetry()\n }}\n role=\"menuitem\"\n >\n Retry\n </a>\n )}\n {onDownload && (\n <a\n className=\"dropdown-item cypress-file-download-button\"\n onClick={() => {\n hideMore()\n onDownload()\n }}\n role=\"menuitem\"\n >\n Download\n </a>\n )}\n <a\n className={clsx('dropdown-item cypress-file-remove-button', {\n 'ob-files__menu-remove-hidden': element.readOnly,\n })}\n onClick={() => {\n hideMore()\n onRemove()\n }}\n role=\"menuitem\"\n >\n Remove\n </a>\n </div>\n </div>\n </div>\n )\n}\n\nexport default React.memo<Props>(DropdownMenu)\n"]}
|
@@ -19,7 +19,7 @@ function FileCard({ element, isUploading, isUploadPaused, uploadErrorMessage, lo
|
|
19
19
|
return (React.createElement("div", { className: "column is-one-quarter" },
|
20
20
|
React.createElement("div", { className: "ob-files__box" },
|
21
21
|
React.createElement("div", { className: "ob-files__content" },
|
22
|
-
React.createElement(FileCardContent, { imageUrl: imageUrl })),
|
22
|
+
React.createElement(FileCardContent, { imageUrl: imageUrl, fileName: fileName })),
|
23
23
|
React.createElement(DropdownMenu, { element: element, onDownload: onDownload, onRetry: onRetry, onRemove: onRemove }),
|
24
24
|
React.createElement("div", { className: "ob-files__file-name is-size-6" },
|
25
25
|
React.createElement("span", { className: "ob-files__file-name-inner" }, fileName),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"FileCard.js","sourceRoot":"","sources":["../../../../src/components/renderer/attachments/FileCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,eAAe,MAAM,mBAAmB,CAAA;AAC/C,OAAO,gBAAgB,MAAM,oBAAoB,CAAA;AACjD,OAAO,EACL,oBAAoB,EACpB,6BAA6B,GAC9B,MAAM,mCAAmC,CAAA;AAC1C,OAAO,WAAW,MAAM,eAAe,CAAA;AACvC,OAAO,YAAY,MAAM,gBAAgB,CAAA;AAiBz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BAAiB,EACpC,iBAAiB,EAAE,iBAAiB,EACpC,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,GAClB;gBACF,oBAAC,WAAW,IAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC,WAAW,GAAI,CACzD,CACF,CACF,CACP,CAAA;AACH,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA","sourcesContent":["import * as React from 'react'\nimport { FormTypes } from '@oneblink/types'\nimport FileCardContent from './FileCardContent'\nimport AttachmentStatus from './AttachmentStatus'\nimport {\n checkFileNameIsValid,\n checkFileNameExtensionIsValid,\n} from '../../../services/form-validation'\nimport ProgressBar from './ProgressBar'\nimport DropdownMenu from './DropdownMenu'\n\ntype Props = {\n element: FormTypes.FilesElement\n isUploading?: boolean\n isUploadPaused?: boolean\n uploadErrorMessage?: string\n loadImageUrlError?: Error\n isLoadingImageUrl?: boolean\n fileName: string\n imageUrl: string | undefined | null\n onRemove: () => void\n onDownload?: () => void\n onRetry?: () => void\n progress: undefined | number\n}\n\nfunction FileCard({\n element,\n isUploading,\n isUploadPaused,\n uploadErrorMessage,\n loadImageUrlError,\n isLoadingImageUrl,\n imageUrl,\n fileName,\n onDownload,\n onRemove,\n onRetry,\n progress,\n}: Props) {\n const uploadError = React.useMemo(() => {\n if (!checkFileNameIsValid(element, fileName)) {\n return new Error(`${fileName.split('.').pop()} files are not allowed`)\n }\n if (!checkFileNameExtensionIsValid(element, fileName)) {\n return new Error(`${fileName} must have an extension`)\n }\n if (uploadErrorMessage) {\n return new Error(uploadErrorMessage)\n }\n }, [element, fileName, uploadErrorMessage])\n\n return (\n <div className=\"column is-one-quarter\">\n <div className=\"ob-files__box\">\n <div className=\"ob-files__content\">\n <FileCardContent imageUrl={imageUrl} fileName={fileName} />\n </div>\n <DropdownMenu\n element={element}\n onDownload={onDownload}\n onRetry={onRetry}\n onRemove={onRemove}\n />\n\n <div className=\"ob-files__file-name is-size-6\">\n <span className=\"ob-files__file-name-inner\">{fileName}</span>\n <AttachmentStatus\n isUploading={isUploading}\n isUploadPaused={isUploadPaused}\n uploadError={uploadError}\n loadImageUrlError={loadImageUrlError}\n isLoadingImageUrl={isLoadingImageUrl}\n imageUrl={imageUrl}\n progress={progress}\n />\n <ProgressBar progress={progress} isShowing={!!isUploading} />\n </div>\n </div>\n </div>\n )\n}\n\nexport default React.memo(FileCard)\n"]}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
-
declare const _default: React.MemoExoticComponent<({ imageUrl, }: {
|
2
|
+
declare const _default: React.MemoExoticComponent<({ imageUrl, fileName, }: {
|
3
3
|
imageUrl: string | null | undefined;
|
4
|
+
fileName: string;
|
4
5
|
}) => JSX.Element>;
|
5
6
|
export default _default;
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
-
const FileCardContent = ({ imageUrl, }) => {
|
2
|
+
const FileCardContent = ({ imageUrl, fileName, }) => {
|
3
3
|
if (imageUrl) {
|
4
4
|
return (React.createElement("div", { className: "ob-files__content-image" },
|
5
|
-
React.createElement("img", { className: "ob-files__image", src: imageUrl })));
|
5
|
+
React.createElement("img", { className: "ob-files__image", src: imageUrl, alt: fileName })));
|
6
6
|
}
|
7
7
|
return (React.createElement("div", { className: "ob-files__content-file has-text-centered" },
|
8
8
|
React.createElement("i", { className: "material-icons icon-large ob-files__attach-icon has-text-grey" }, "attach_file")));
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"FileCardContent.js","sourceRoot":"","sources":["../../../../src/components/renderer/attachments/FileCardContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,MAAM,eAAe,GAAG,CAAC,EACvB,QAAQ,
|
1
|
+
{"version":3,"file":"FileCardContent.js","sourceRoot":"","sources":["../../../../src/components/renderer/attachments/FileCardContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,MAAM,eAAe,GAAG,CAAC,EACvB,QAAQ,EACR,QAAQ,GAIT,EAAE,EAAE;IACH,IAAI,QAAQ,EAAE;QACZ,OAAO,CACL,6BAAK,SAAS,EAAC,yBAAyB;YACtC,6BAAK,SAAS,EAAC,iBAAiB,EAAC,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,GAAI,CAC7D,CACP,CAAA;KACF;IAED,OAAO,CACL,6BAAK,SAAS,EAAC,0CAA0C;QACvD,2BAAG,SAAS,EAAC,+DAA+D,kBAExE,CACA,CACP,CAAA;AACH,CAAC,CAAA;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA","sourcesContent":["import * as React from 'react'\n\nconst FileCardContent = ({\n imageUrl,\n fileName,\n}: {\n imageUrl: string | undefined | null\n fileName: string\n}) => {\n if (imageUrl) {\n return (\n <div className=\"ob-files__content-image\">\n <img className=\"ob-files__image\" src={imageUrl} alt={fileName} />\n </div>\n )\n }\n\n return (\n <div className=\"ob-files__content-file has-text-centered\">\n <i className=\"material-icons icon-large ob-files__attach-icon has-text-grey\">\n attach_file\n </i>\n </div>\n )\n}\n\nexport default React.memo(FileCardContent)\n"]}
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@oneblink/apps-react",
|
3
3
|
"description": "Helper functions for OneBlink apps in ReactJS.",
|
4
|
-
"version": "5.5.
|
4
|
+
"version": "5.5.1-beta.1",
|
5
5
|
"author": "OneBlink <developers@oneblink.io> (https://oneblink.io)",
|
6
6
|
"bugs": {
|
7
7
|
"url": "https://github.com/oneblink/apps-react/issues"
|