@webiny/app-admin 0.0.0-unstable.496cf268ac → 0.0.0-unstable.606fc9c866
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/base/ui/FileManager.d.ts +1 -1
- package/base/ui/FileManager.js.map +1 -1
- package/components/OverlayLayout/OverlayLayout.js +1 -1
- package/components/OverlayLayout/OverlayLayout.js.map +1 -1
- package/package.json +16 -16
- package/types.d.ts +2 -0
- package/types.js.map +1 -1
- package/ui/views/OverlayView.js +1 -1
- package/ui/views/OverlayView.js.map +1 -1
- package/assets/images/icons.png +0 -0
- package/assets/images/icons_retina.png +0 -0
- package/assets/images/swich.png +0 -0
- package/components/FileManager/BottomInfoBar/SupportedFileTypes.d.ts +0 -6
- package/components/FileManager/BottomInfoBar/SupportedFileTypes.js +0 -55
- package/components/FileManager/BottomInfoBar/SupportedFileTypes.js.map +0 -1
- package/components/FileManager/BottomInfoBar/UploadStatus.d.ts +0 -6
- package/components/FileManager/BottomInfoBar/UploadStatus.js +0 -60
- package/components/FileManager/BottomInfoBar/UploadStatus.js.map +0 -1
- package/components/FileManager/BottomInfoBar.d.ts +0 -5
- package/components/FileManager/BottomInfoBar.js +0 -60
- package/components/FileManager/BottomInfoBar.js.map +0 -1
- package/components/FileManager/DropFilesHere.d.ts +0 -10
- package/components/FileManager/DropFilesHere.js +0 -76
- package/components/FileManager/DropFilesHere.js.map +0 -1
- package/components/FileManager/File.d.ts +0 -17
- package/components/FileManager/File.js +0 -155
- package/components/FileManager/File.js.map +0 -1
- package/components/FileManager/FileDetails/Name.d.ts +0 -8
- package/components/FileManager/FileDetails/Name.js +0 -138
- package/components/FileManager/FileDetails/Name.js.map +0 -1
- package/components/FileManager/FileDetails/Tags.d.ts +0 -10
- package/components/FileManager/FileDetails/Tags.js +0 -339
- package/components/FileManager/FileDetails/Tags.js.map +0 -1
- package/components/FileManager/FileDetails.d.ts +0 -24
- package/components/FileManager/FileDetails.js +0 -474
- package/components/FileManager/FileDetails.js.map +0 -1
- package/components/FileManager/FileManagerContext.d.ts +0 -42
- package/components/FileManager/FileManagerContext.js +0 -224
- package/components/FileManager/FileManagerContext.js.map +0 -1
- package/components/FileManager/FileManagerView.d.ts +0 -18
- package/components/FileManager/FileManagerView.js +0 -721
- package/components/FileManager/FileManagerView.js.map +0 -1
- package/components/FileManager/LeftSidebar.d.ts +0 -10
- package/components/FileManager/LeftSidebar.js +0 -127
- package/components/FileManager/LeftSidebar.js.map +0 -1
- package/components/FileManager/NoPermissionView.d.ts +0 -3
- package/components/FileManager/NoPermissionView.js +0 -87
- package/components/FileManager/NoPermissionView.js.map +0 -1
- package/components/FileManager/NoResults.d.ts +0 -3
- package/components/FileManager/NoResults.js +0 -28
- package/components/FileManager/NoResults.js.map +0 -1
- package/components/FileManager/getFileTypePlugin.d.ts +0 -4
- package/components/FileManager/getFileTypePlugin.js +0 -57
- package/components/FileManager/getFileTypePlugin.js.map +0 -1
- package/components/FileManager/getFileUploader.d.ts +0 -3
- package/components/FileManager/getFileUploader.js +0 -20
- package/components/FileManager/getFileUploader.js.map +0 -1
- package/components/FileManager/graphql.d.ts +0 -96
- package/components/FileManager/graphql.js +0 -58
- package/components/FileManager/graphql.js.map +0 -1
- package/components/FileManager/icons/content_copy-black-24px.svg +0 -1
- package/components/FileManager/icons/delete.svg +0 -12
- package/components/FileManager/icons/privacy_tip-24px.svg +0 -10
- package/components/FileManager/icons/round-check_box-24px.svg +0 -4
- package/components/FileManager/icons/round-check_box_outline_blank-24px.svg +0 -4
- package/components/FileManager/icons/round-cloud_download-24px.svg +0 -4
- package/components/FileManager/icons/round-cloud_upload-24px.svg +0 -4
- package/components/FileManager/icons/round-description-24px.svg +0 -4
- package/components/FileManager/icons/round-edit-24px.svg +0 -4
- package/components/FileManager/icons/round-info-24px.svg +0 -4
- package/components/FileManager/icons/round-label-24px.svg +0 -4
- package/components/FileManager/icons/round-more_vert-24px.svg +0 -4
- package/components/FileManager/icons/round-search-24px.svg +0 -20
- package/components/FileManager/outputFileSelectionError.d.ts +0 -7
- package/components/FileManager/outputFileSelectionError.js +0 -54
- package/components/FileManager/outputFileSelectionError.js.map +0 -1
- package/components/FileManager/types.d.ts +0 -21
- package/components/FileManager/types.js +0 -5
- package/components/FileManager/types.js.map +0 -1
- package/components/FileManager.d.ts +0 -67
- package/components/FileManager.js +0 -144
- package/components/FileManager.js.map +0 -1
- package/plugins/FileManagerFileTypePlugin.d.ts +0 -33
- package/plugins/FileManagerFileTypePlugin.js +0 -63
- package/plugins/FileManagerFileTypePlugin.js.map +0 -1
- package/plugins/fileManager/fileDefault.d.ts +0 -2
- package/plugins/fileManager/fileDefault.js +0 -34
- package/plugins/fileManager/fileDefault.js.map +0 -1
- package/plugins/fileManager/fileImage/DeleteAction.d.ts +0 -7
- package/plugins/fileManager/fileImage/DeleteAction.js +0 -83
- package/plugins/fileManager/fileImage/DeleteAction.js.map +0 -1
- package/plugins/fileManager/fileImage/EditAction.d.ts +0 -10
- package/plugins/fileManager/fileImage/EditAction.js +0 -179
- package/plugins/fileManager/fileImage/EditAction.js.map +0 -1
- package/plugins/fileManager/fileImage/index.d.ts +0 -2
- package/plugins/fileManager/fileImage/index.js +0 -46
- package/plugins/fileManager/fileImage/index.js.map +0 -1
- package/plugins/fileManager/icons/edit.svg +0 -17
- package/plugins/fileManager/icons/round-description-24px.svg +0 -1
- package/plugins/fileManager/index.d.ts +0 -2
- package/plugins/fileManager/index.js +0 -21
- package/plugins/fileManager/index.js.map +0 -1
package/base/ui/FileManager.d.ts
CHANGED
|
@@ -50,7 +50,7 @@ export declare type FileManagerProps = {
|
|
|
50
50
|
* @deprecated This prop is no longer used. The file structure was reduced to a bare minimum so picking is no longer necessary.
|
|
51
51
|
*/
|
|
52
52
|
onChangePick?: string[];
|
|
53
|
-
onClose?:
|
|
53
|
+
onClose?: () => void;
|
|
54
54
|
onUploadCompletion?: (files: FileManagerFileItem[]) => void;
|
|
55
55
|
own?: boolean;
|
|
56
56
|
scope?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getPortalTarget","target","window","document","getElementById","createElement","setAttribute","body","appendChild","FileManagerRenderer","makeComposable","FileManager","children","render","onChange","rest","containerRef","useRef","useState","show","setShow","onChangeRef","useEffect","current","showFileManager","useCallback","ReactDOM","createPortal"],"sources":["FileManager.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef, useState } from \"react\";\nimport ReactDOM from \"react-dom\";\nimport { makeComposable } from \"@webiny/react-composition\";\n\nexport interface FileManagerOnChange<T> {\n (value: T): void;\n}\n\n/**\n * Represents a file object managed by the File Manager.\n */\nexport interface FileManagerFileItem {\n id: string;\n src: string;\n meta?: Array<FileManagerFileItemMetaItem>;\n}\n\n/**\n * With this we allow developers to add any value to file's meta via component composition, thus the `value: any`.\n */\nexport interface FileManagerFileItemMetaItem {\n key: string;\n value: any;\n}\n\nexport type DeprecatedFileManagerRenderPropParams = {\n showFileManager: (\n onChange?: FileManagerOnChange<FileManagerFileItem | FileManagerFileItem[]>\n ) => void;\n};\n\nexport type FileManagerRenderPropParams<TValue> = {\n showFileManager: (onChange?: FileManagerOnChange<TValue>) => void;\n};\n\ninterface SingleFileRenderProp {\n (params: FileManagerRenderPropParams<FileManagerFileItem>): React.ReactNode;\n}\n\ninterface MultiFileRenderProp {\n (params: FileManagerRenderPropParams<FileManagerFileItem[]>): React.ReactNode;\n}\n\nexport type MultipleProps =\n | {\n multiple?: never;\n multipleMaxCount?: never;\n multipleMaxSize?: never;\n onChange?: FileManagerOnChange<FileManagerFileItem>;\n render?: SingleFileRenderProp;\n }\n | {\n multiple: true;\n multipleMaxCount?: number;\n multipleMaxSize?: number | string;\n onChange?: FileManagerOnChange<FileManagerFileItem[]>;\n render?: MultiFileRenderProp;\n };\n\nexport type FileManagerProps = {\n accept?: Array<string>;\n images?: boolean;\n maxSize?: number | string;\n /**\n * @deprecated This prop is no longer used. The file structure was reduced to a bare minimum so picking is no longer necessary.\n */\n onChangePick?: string[];\n onClose?:
|
|
1
|
+
{"version":3,"names":["getPortalTarget","target","window","document","getElementById","createElement","setAttribute","body","appendChild","FileManagerRenderer","makeComposable","FileManager","children","render","onChange","rest","containerRef","useRef","useState","show","setShow","onChangeRef","useEffect","current","showFileManager","useCallback","ReactDOM","createPortal"],"sources":["FileManager.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef, useState } from \"react\";\nimport ReactDOM from \"react-dom\";\nimport { makeComposable } from \"@webiny/react-composition\";\n\nexport interface FileManagerOnChange<T> {\n (value: T): void;\n}\n\n/**\n * Represents a file object managed by the File Manager.\n */\nexport interface FileManagerFileItem {\n id: string;\n src: string;\n meta?: Array<FileManagerFileItemMetaItem>;\n}\n\n/**\n * With this we allow developers to add any value to file's meta via component composition, thus the `value: any`.\n */\nexport interface FileManagerFileItemMetaItem {\n key: string;\n value: any;\n}\n\nexport type DeprecatedFileManagerRenderPropParams = {\n showFileManager: (\n onChange?: FileManagerOnChange<FileManagerFileItem | FileManagerFileItem[]>\n ) => void;\n};\n\nexport type FileManagerRenderPropParams<TValue> = {\n showFileManager: (onChange?: FileManagerOnChange<TValue>) => void;\n};\n\ninterface SingleFileRenderProp {\n (params: FileManagerRenderPropParams<FileManagerFileItem>): React.ReactNode;\n}\n\ninterface MultiFileRenderProp {\n (params: FileManagerRenderPropParams<FileManagerFileItem[]>): React.ReactNode;\n}\n\nexport type MultipleProps =\n | {\n multiple?: never;\n multipleMaxCount?: never;\n multipleMaxSize?: never;\n onChange?: FileManagerOnChange<FileManagerFileItem>;\n render?: SingleFileRenderProp;\n }\n | {\n multiple: true;\n multipleMaxCount?: number;\n multipleMaxSize?: number | string;\n onChange?: FileManagerOnChange<FileManagerFileItem[]>;\n render?: MultiFileRenderProp;\n };\n\nexport type FileManagerProps = {\n accept?: Array<string>;\n images?: boolean;\n maxSize?: number | string;\n /**\n * @deprecated This prop is no longer used. The file structure was reduced to a bare minimum so picking is no longer necessary.\n */\n onChangePick?: string[];\n onClose?: () => void;\n onUploadCompletion?: (files: FileManagerFileItem[]) => void;\n own?: boolean;\n scope?: string;\n tags?: Array<string>;\n /**\n * @deprecated This prop is no longer used. Use the `render` prop to get better TS autocomplete.\n */\n children?: (params: DeprecatedFileManagerRenderPropParams) => React.ReactNode;\n} & MultipleProps;\n\nfunction getPortalTarget() {\n let target = window.document.getElementById(\"file-manager-container\");\n if (!target) {\n target = document.createElement(\"div\");\n target.setAttribute(\"id\", \"file-manager-container\");\n document.body && document.body.appendChild(target);\n }\n return target;\n}\n\n// This jewel was taken from https://davidgomes.com/pick-omit-over-union-types-in-typescript/. Massive thanks, David!\ntype DistributiveOmit<T, K extends keyof T> = T extends unknown ? Omit<T, K> : never;\n\nexport type FileManagerRendererProps = DistributiveOmit<FileManagerProps, \"render\" | \"children\">;\n\nexport const FileManagerRenderer = makeComposable<FileManagerRendererProps>(\"FileManagerRenderer\");\n\nexport const FileManager: React.FC<FileManagerProps> = ({\n children,\n render,\n onChange,\n ...rest\n}) => {\n const containerRef = useRef<HTMLElement>(getPortalTarget());\n const [show, setShow] = useState(false);\n const onChangeRef = useRef(onChange);\n\n useEffect(() => {\n onChangeRef.current = onChange;\n }, [onChange]);\n\n const showFileManager = useCallback(onChange => {\n if (typeof onChange === \"function\") {\n onChangeRef.current = onChange;\n }\n setShow(true);\n }, []);\n\n return (\n <>\n {show &&\n ReactDOM.createPortal(\n <FileManagerRenderer\n onClose={() => setShow(false)}\n onChange={\n /* TODO: figure out how to create a conditional type based on the value of `rest.multiple` */\n onChangeRef.current as any\n }\n {...rest}\n />,\n containerRef.current\n )}\n {children ? children({ showFileManager }) : render ? render({ showFileManager }) : null}\n </>\n );\n};\n"],"mappings":";;;;;;;;;;AAAA;AACA;AACA;AAA2D;AA4E3D,SAASA,eAAe,GAAG;EACvB,IAAIC,MAAM,GAAGC,MAAM,CAACC,QAAQ,CAACC,cAAc,CAAC,wBAAwB,CAAC;EACrE,IAAI,CAACH,MAAM,EAAE;IACTA,MAAM,GAAGE,QAAQ,CAACE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IAAEY,eAAe,EAAfA;EAAgB,CAAC,CAAC,GAAGX,MAAM,GAAGA,MAAM,CAAC;IAAEW,eAAe,EAAfA;EAAgB,CAAC,CAAC,GAAG,IAAI,CACxF;AAEX,CAAC;AAAC"}
|
|
@@ -36,7 +36,7 @@ var OverlayLayoutWrapper = /*#__PURE__*/(0, _styled.default)("div", {
|
|
|
36
36
|
* Has to be higher than 5 so it's above advanced settings dialog,
|
|
37
37
|
* and below 20, so the image editor & Dialogs can be displayed above.
|
|
38
38
|
*/
|
|
39
|
-
zIndex:
|
|
39
|
+
zIndex: 21,
|
|
40
40
|
paddingTop: 65,
|
|
41
41
|
top: 0,
|
|
42
42
|
left: 0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["OverlayLayoutWrapper","styled","position","width","height","backgroundColor","zIndex","paddingTop","top","left","noScroll","css","overflow","defaultStyle","transform","opacity","transitionProperty","transitionTimingFunction","transitionDuration","willChange","transitionStyles","entering","entered","OverlayLayout","props","isVisible","document","body","classList","add","setState","OverlayView","openedViews","remove","onExited","barLeft","barMiddle","barRight","children","style","rest","state","hideComponent","React","Component","noop"],"sources":["OverlayLayout.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Transition } from \"react-transition-group\";\nimport styled from \"@emotion/styled\";\nimport { css } from \"emotion\";\nimport { TopAppBarSecondary, TopAppBarSection } from \"@webiny/ui/TopAppBar\";\nimport { IconButton } from \"@webiny/ui/Button\";\nimport noop from \"lodash/noop\";\n\nimport { ReactComponent as CloseIcon } from \"@material-design-icons/svg/outlined/close.svg\";\nimport { OverlayView } from \"~/ui/views/OverlayView\";\nimport { ExitHandler } from \"react-transition-group/Transition\";\n\nconst OverlayLayoutWrapper = styled(\"div\")({\n position: \"fixed\",\n width: \"100%\",\n height: \"100vh\",\n backgroundColor: \"var(--mdc-theme-background)\",\n /**\n * Has to be higher than 5 so it's above advanced settings dialog,\n * and below 20, so the image editor & Dialogs can be displayed above.\n */\n zIndex:
|
|
1
|
+
{"version":3,"names":["OverlayLayoutWrapper","styled","position","width","height","backgroundColor","zIndex","paddingTop","top","left","noScroll","css","overflow","defaultStyle","transform","opacity","transitionProperty","transitionTimingFunction","transitionDuration","willChange","transitionStyles","entering","entered","OverlayLayout","props","isVisible","document","body","classList","add","setState","OverlayView","openedViews","remove","onExited","barLeft","barMiddle","barRight","children","style","rest","state","hideComponent","React","Component","noop"],"sources":["OverlayLayout.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Transition } from \"react-transition-group\";\nimport styled from \"@emotion/styled\";\nimport { css } from \"emotion\";\nimport { TopAppBarSecondary, TopAppBarSection } from \"@webiny/ui/TopAppBar\";\nimport { IconButton } from \"@webiny/ui/Button\";\nimport noop from \"lodash/noop\";\n\nimport { ReactComponent as CloseIcon } from \"@material-design-icons/svg/outlined/close.svg\";\nimport { OverlayView } from \"~/ui/views/OverlayView\";\nimport { ExitHandler } from \"react-transition-group/Transition\";\n\nconst OverlayLayoutWrapper = styled(\"div\")({\n position: \"fixed\",\n width: \"100%\",\n height: \"100vh\",\n backgroundColor: \"var(--mdc-theme-background)\",\n /**\n * Has to be higher than 5 so it's above advanced settings dialog,\n * and below 20, so the image editor & Dialogs can be displayed above.\n */\n zIndex: 21,\n paddingTop: 65,\n top: 0,\n left: 0\n});\n\nconst noScroll = css({\n overflow: \"hidden\",\n height: \"100vh\"\n});\n\nconst defaultStyle = {\n transform: \"translateY(75vh)\",\n opacity: 0,\n transitionProperty: \"transform, opacity\",\n transitionTimingFunction: \"cubic-bezier(0, 0, .2, 1)\",\n transitionDuration: \"225ms\",\n willChange: \"opacity, transform\"\n};\n\nconst transitionStyles: Record<string, any> = {\n entering: {\n transform: \"translateY(75vh)\",\n opacity: 0\n },\n entered: {\n transform: \"translateY(0px)\",\n opacity: 1\n }\n};\n\nexport interface OverlayLayoutProps {\n barMiddle?: React.ReactNode;\n barLeft?: React.ReactNode;\n barRight?: React.ReactNode;\n children: React.ReactNode;\n onExited?: ExitHandler<HTMLElement>;\n style?: React.CSSProperties;\n}\n\ninterface OverlayLayoutState {\n isVisible: boolean;\n}\n\nexport class OverlayLayout extends React.Component<OverlayLayoutProps, OverlayLayoutState> {\n constructor(props: OverlayLayoutProps) {\n super(props);\n document.body.classList.add(noScroll);\n }\n\n static defaultProps: Partial<OverlayLayoutProps> = {\n onExited: noop\n };\n\n public override state: OverlayLayoutState = {\n isVisible: true\n };\n\n public hideComponent(): void {\n this.setState({ isVisible: false });\n if (OverlayView.openedViews === 0) {\n document.body.classList.remove(noScroll);\n }\n }\n\n public override componentWillUnmount(): void {\n if (OverlayView.openedViews === 0) {\n document.body.classList.remove(noScroll);\n }\n }\n\n public override render() {\n const { onExited, barLeft, barMiddle, barRight, children, style, ...rest } = this.props;\n\n return (\n <Transition in={this.state.isVisible} timeout={100} appear onExited={onExited}>\n {state => (\n <OverlayLayoutWrapper\n {...rest}\n style={{ ...defaultStyle, ...style, ...transitionStyles[state] }}\n >\n <TopAppBarSecondary fixed style={{ top: 0 }}>\n <TopAppBarSection style={{ width: \"33%\" }} alignStart>\n {barLeft}\n </TopAppBarSection>\n <TopAppBarSection style={{ width: \"33%\" }}>\n {barMiddle}\n </TopAppBarSection>\n <TopAppBarSection style={{ width: \"33%\" }} alignEnd>\n {barRight}\n <IconButton\n ripple={false}\n onClick={() => this.hideComponent()}\n icon={<CloseIcon style={{ width: 24, height: 24 }} />}\n />\n </TopAppBarSection>\n </TopAppBarSecondary>\n\n {children}\n </OverlayLayoutWrapper>\n )}\n </Transition>\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAqD;AAGrD,IAAMA,oBAAoB,oBAAGC,eAAM,EAAC,KAAK;EAAA;EAAA;AAAA,GAAE;EACvCC,QAAQ,EAAE,OAAO;EACjBC,KAAK,EAAE,MAAM;EACbC,MAAM,EAAE,OAAO;EACfC,eAAe,EAAE,6BAA6B;EAC9C;AACJ;AACA;AACA;EACIC,MAAM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ACC,SAAS;AAAA;AAAA,8BAArCrB,aAAa,kBAM6B;EAC/CW,QAAQ,EAAEW;AACd,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/app-admin",
|
|
3
|
-
"version": "0.0.0-unstable.
|
|
3
|
+
"version": "0.0.0-unstable.606fc9c866",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"description": "A collection of plugins that together form a complete admin interface, customizable and extensible with Webiny apps and plugins.",
|
|
6
6
|
"repository": {
|
|
@@ -14,23 +14,23 @@
|
|
|
14
14
|
"@apollo/react-hooks": "3.1.5",
|
|
15
15
|
"@babel/runtime": "7.20.13",
|
|
16
16
|
"@editorjs/editorjs": "2.26.5",
|
|
17
|
-
"@emotion/react": "11.10.
|
|
17
|
+
"@emotion/react": "11.10.8",
|
|
18
18
|
"@emotion/styled": "11.10.6",
|
|
19
19
|
"@material-design-icons/svg": "0.14.3",
|
|
20
20
|
"@svgr/webpack": "6.5.1",
|
|
21
21
|
"@types/mime": "2.0.3",
|
|
22
22
|
"@types/react": "17.0.39",
|
|
23
|
-
"@webiny/app": "0.0.0-unstable.
|
|
24
|
-
"@webiny/app-security": "0.0.0-unstable.
|
|
25
|
-
"@webiny/app-wcp": "0.0.0-unstable.
|
|
26
|
-
"@webiny/form": "0.0.0-unstable.
|
|
27
|
-
"@webiny/plugins": "0.0.0-unstable.
|
|
28
|
-
"@webiny/react-composition": "0.0.0-unstable.
|
|
29
|
-
"@webiny/react-router": "0.0.0-unstable.
|
|
30
|
-
"@webiny/telemetry": "0.0.0-unstable.
|
|
31
|
-
"@webiny/ui": "0.0.0-unstable.
|
|
32
|
-
"@webiny/ui-composer": "0.0.0-unstable.
|
|
33
|
-
"@webiny/validation": "0.0.0-unstable.
|
|
23
|
+
"@webiny/app": "0.0.0-unstable.606fc9c866",
|
|
24
|
+
"@webiny/app-security": "0.0.0-unstable.606fc9c866",
|
|
25
|
+
"@webiny/app-wcp": "0.0.0-unstable.606fc9c866",
|
|
26
|
+
"@webiny/form": "0.0.0-unstable.606fc9c866",
|
|
27
|
+
"@webiny/plugins": "0.0.0-unstable.606fc9c866",
|
|
28
|
+
"@webiny/react-composition": "0.0.0-unstable.606fc9c866",
|
|
29
|
+
"@webiny/react-router": "0.0.0-unstable.606fc9c866",
|
|
30
|
+
"@webiny/telemetry": "0.0.0-unstable.606fc9c866",
|
|
31
|
+
"@webiny/ui": "0.0.0-unstable.606fc9c866",
|
|
32
|
+
"@webiny/ui-composer": "0.0.0-unstable.606fc9c866",
|
|
33
|
+
"@webiny/validation": "0.0.0-unstable.606fc9c866",
|
|
34
34
|
"apollo-cache": "1.3.5",
|
|
35
35
|
"apollo-client": "2.6.10",
|
|
36
36
|
"apollo-link": "1.2.14",
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
"@types/bytes": "^3.1.1",
|
|
61
61
|
"@types/graphlib": "^2.1.8",
|
|
62
62
|
"@types/store": "^2.0.2",
|
|
63
|
-
"@webiny/cli": "^0.0.0-unstable.
|
|
64
|
-
"@webiny/project-utils": "^0.0.0-unstable.
|
|
63
|
+
"@webiny/cli": "^0.0.0-unstable.606fc9c866",
|
|
64
|
+
"@webiny/project-utils": "^0.0.0-unstable.606fc9c866",
|
|
65
65
|
"babel-plugin-emotion": "^9.2.8",
|
|
66
66
|
"babel-plugin-lodash": "^3.3.4",
|
|
67
67
|
"rimraf": "^3.0.2",
|
|
@@ -88,5 +88,5 @@
|
|
|
88
88
|
]
|
|
89
89
|
}
|
|
90
90
|
},
|
|
91
|
-
"gitHead": "
|
|
91
|
+
"gitHead": "606fc9c866aec436f24983abc9bdaf02af2b8746"
|
|
92
92
|
}
|
package/types.d.ts
CHANGED
package/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import React, { ReactElement } from \"react\";\nimport { Plugin } from \"@webiny/plugins/types\";\nimport { ApolloClient } from \"apollo-client\";\nimport { ItemProps, MenuProps, SectionProps } from \"~/plugins/MenuPlugin\";\n\nexport type AdminGlobalSearchPlugin = Plugin & {\n type: \"admin-global-search\";\n label: string;\n route: string;\n search?: {\n operator?: \"and\" | \"or\";\n fields?: Array<string>;\n };\n};\n\nexport type AdminGlobalSearchPreventHotkeyPlugin = Plugin & {\n type: \"admin-global-search-prevent-hotkey\";\n preventOpen(e: React.KeyboardEvent): boolean | void;\n};\n\n/**\n * LEGACY TYPE. Only for backwards compatibility.\n */\nexport type AdminMenuLogoPlugin = Plugin & {\n name: \"admin-menu-logo\";\n type: \"admin-menu-logo\";\n render(): React.ReactElement;\n};\n\n/**\n * Enables adding custom menu sections and items in the main menu, located on the left side of the screen.\n * @see https://docs.webiny.com/docs/webiny-apps/admin/development/plugins-reference/app#admin-menu\n */\nexport type AdminMenuPlugin = Plugin & {\n type: \"admin-menu\";\n render(props: {\n Menu: React.ComponentType<MenuProps>;\n Section: React.ComponentType<SectionProps>;\n Item: React.ComponentType<ItemProps>;\n }): React.ReactNode;\n order?: number;\n};\n\nexport interface AdminFileManagerFileTypePluginRenderParams {\n file: FileItem;\n}\nexport type AdminFileManagerFileTypePlugin = Plugin & {\n type: \"admin-file-manager-file-type\";\n types: string[];\n render(params: AdminFileManagerFileTypePluginRenderParams): React.ReactNode;\n fileDetails?: {\n actions: Array<React.FC | React.Component>;\n };\n};\n\nexport interface AdminInstallationPluginRenderParams {\n onInstalled: () => Promise<void>;\n}\nexport type AdminInstallationPlugin = Plugin & {\n type: \"admin-installation\";\n getInstalledVersion(params: { client: ApolloClient<object> }): Promise<string | null>;\n title: string;\n dependencies?: string[];\n secure: boolean;\n render(params: AdminInstallationPluginRenderParams): React.ReactNode;\n};\n\nexport type AdminAppPermissionRendererPlugin = Plugin & {\n type: \"admin-app-permissions-renderer\";\n system?: boolean;\n render(params: any): ReactElement;\n};\n\nimport { SecurityPermission } from \"@webiny/app-security/types\";\n\n/**\n * Represents a file as we receive from the GraphQL API.\n */\nexport interface FileItem {\n id: string;\n name: string;\n key: string;\n src: string;\n size: number;\n type: string;\n tags: string[];\n aliases: string[];\n createdOn: string;\n createdBy: {\n id: string;\n };\n}\n\nexport interface FileManagerSecurityPermission extends SecurityPermission {\n rwd?: string;\n own?: boolean;\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import React, { ReactElement } from \"react\";\nimport { Plugin } from \"@webiny/plugins/types\";\nimport { ApolloClient } from \"apollo-client\";\nimport { ItemProps, MenuProps, SectionProps } from \"~/plugins/MenuPlugin\";\n\nexport type AdminGlobalSearchPlugin = Plugin & {\n type: \"admin-global-search\";\n label: string;\n route: string;\n search?: {\n operator?: \"and\" | \"or\";\n fields?: Array<string>;\n };\n};\n\nexport type AdminGlobalSearchPreventHotkeyPlugin = Plugin & {\n type: \"admin-global-search-prevent-hotkey\";\n preventOpen(e: React.KeyboardEvent): boolean | void;\n};\n\n/**\n * LEGACY TYPE. Only for backwards compatibility.\n */\nexport type AdminMenuLogoPlugin = Plugin & {\n name: \"admin-menu-logo\";\n type: \"admin-menu-logo\";\n render(): React.ReactElement;\n};\n\n/**\n * Enables adding custom menu sections and items in the main menu, located on the left side of the screen.\n * @see https://docs.webiny.com/docs/webiny-apps/admin/development/plugins-reference/app#admin-menu\n */\nexport type AdminMenuPlugin = Plugin & {\n type: \"admin-menu\";\n render(props: {\n Menu: React.ComponentType<MenuProps>;\n Section: React.ComponentType<SectionProps>;\n Item: React.ComponentType<ItemProps>;\n }): React.ReactNode;\n order?: number;\n};\n\nexport interface AdminFileManagerFileTypePluginRenderParams {\n file: FileItem;\n}\nexport type AdminFileManagerFileTypePlugin = Plugin & {\n type: \"admin-file-manager-file-type\";\n types: string[];\n render(params: AdminFileManagerFileTypePluginRenderParams): React.ReactNode;\n fileDetails?: {\n actions: Array<React.FC | React.Component>;\n };\n};\n\nexport interface AdminInstallationPluginRenderParams {\n onInstalled: () => Promise<void>;\n}\nexport type AdminInstallationPlugin = Plugin & {\n type: \"admin-installation\";\n getInstalledVersion(params: { client: ApolloClient<object> }): Promise<string | null>;\n title: string;\n dependencies?: string[];\n secure: boolean;\n render(params: AdminInstallationPluginRenderParams): React.ReactNode;\n};\n\nexport type AdminAppPermissionRendererPlugin = Plugin & {\n type: \"admin-app-permissions-renderer\";\n system?: boolean;\n render(params: any): ReactElement;\n};\n\nimport { SecurityPermission } from \"@webiny/app-security/types\";\n\n/**\n * Represents a file as we receive from the GraphQL API.\n */\nexport interface FileItem {\n id: string;\n name: string;\n key: string;\n src: string;\n size: number;\n type: string;\n tags: string[];\n aliases: string[];\n createdOn: string;\n createdBy: {\n id: string;\n displayName: string;\n };\n meta?: Record<string, any>;\n}\n\nexport interface FileManagerSecurityPermission extends SecurityPermission {\n rwd?: string;\n own?: boolean;\n}\n"],"mappings":""}
|
package/ui/views/OverlayView.js
CHANGED
|
@@ -37,7 +37,7 @@ var OverlayLayoutWrapper = /*#__PURE__*/(0, _styled.default)("div", {
|
|
|
37
37
|
* Has to be higher than 5 so it's above advanced settings dialog,
|
|
38
38
|
* and below 20, so the image editor & Dialogs can be displayed above.
|
|
39
39
|
*/
|
|
40
|
-
zIndex:
|
|
40
|
+
zIndex: 21,
|
|
41
41
|
top: 0,
|
|
42
42
|
left: 0
|
|
43
43
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["OverlayLayoutWrapper","styled","position","width","height","backgroundColor","zIndex","top","left","defaultStyle","transform","opacity","transitionProperty","transitionTimingFunction","transitionDuration","willChange","transitionStyles","entering","entered","OverlayView","id","useGrid","addHookDefinition","useOverlayView","addElement","HeaderElement","onClose","setIsVisible","ContentElement","applyPlugins","title","getHeaderElement","setTitle","_onEntered","reverse","forEach","cb","_onExited","push","getHook","visible","getOverlayHook","getElement","props","isVisible","onExited","onEntered","state","UIView"],"sources":["OverlayView.tsx"],"sourcesContent":["import React from \"react\";\nimport { Transition } from \"react-transition-group\";\nimport styled from \"@emotion/styled\";\nimport { UIView, UIViewProps } from \"~/ui/UIView\";\nimport { UseOverlayView, useOverlayView } from \"./OverlayView/useOverlayView\";\nimport { HeaderElement } from \"./OverlayView/HeaderElement\";\nimport { ContentElement } from \"./OverlayView/ContentElement\";\n\n// !GOOD FIRST ISSUE!\n// Extract rendering and styling into an OverlayViewRenderer class.\n\nconst OverlayLayoutWrapper = styled(\"div\")({\n position: \"fixed\",\n width: \"100%\",\n height: \"100vh\",\n backgroundColor: \"var(--mdc-theme-background)\",\n /**\n * Has to be higher than 5 so it's above advanced settings dialog,\n * and below 20, so the image editor & Dialogs can be displayed above.\n */\n zIndex:
|
|
1
|
+
{"version":3,"names":["OverlayLayoutWrapper","styled","position","width","height","backgroundColor","zIndex","top","left","defaultStyle","transform","opacity","transitionProperty","transitionTimingFunction","transitionDuration","willChange","transitionStyles","entering","entered","OverlayView","id","useGrid","addHookDefinition","useOverlayView","addElement","HeaderElement","onClose","setIsVisible","ContentElement","applyPlugins","title","getHeaderElement","setTitle","_onEntered","reverse","forEach","cb","_onExited","push","getHook","visible","getOverlayHook","getElement","props","isVisible","onExited","onEntered","state","UIView"],"sources":["OverlayView.tsx"],"sourcesContent":["import React from \"react\";\nimport { Transition } from \"react-transition-group\";\nimport styled from \"@emotion/styled\";\nimport { UIView, UIViewProps } from \"~/ui/UIView\";\nimport { UseOverlayView, useOverlayView } from \"./OverlayView/useOverlayView\";\nimport { HeaderElement } from \"./OverlayView/HeaderElement\";\nimport { ContentElement } from \"./OverlayView/ContentElement\";\n\n// !GOOD FIRST ISSUE!\n// Extract rendering and styling into an OverlayViewRenderer class.\n\nconst OverlayLayoutWrapper = styled(\"div\")({\n position: \"fixed\",\n width: \"100%\",\n height: \"100vh\",\n backgroundColor: \"var(--mdc-theme-background)\",\n /**\n * Has to be higher than 5 so it's above advanced settings dialog,\n * and below 20, so the image editor & Dialogs can be displayed above.\n */\n zIndex: 21,\n top: 0,\n left: 0\n});\n\nconst defaultStyle: Record<string, string | number> = {\n transform: \"translateY(75vh)\",\n opacity: 0,\n transitionProperty: \"transform, opacity\",\n transitionTimingFunction: \"cubic-bezier(0, 0, .2, 1)\",\n transitionDuration: \"225ms\",\n willChange: \"opacity, transform\"\n};\n\nconst transitionStyles: Record<string, any> = {\n entering: {\n transform: \"translateY(75vh)\",\n opacity: 0\n },\n entered: {\n transform: \"translateY(0px)\",\n opacity: 1\n }\n};\n\ninterface OnExited {\n (view: OverlayView): void;\n}\n\ninterface OnEntered {\n (view: OverlayView): void;\n}\n\nexport class OverlayView extends UIView {\n /**\n * This property is used to track the amount of opened overlays. Since we're applying a CSS class to disable\n * window scroll, we must make sure we don't remove that CSS class until all the overlays are closed.\n */\n static openedViews = 0;\n private _onEntered: OnEntered[] = [];\n private _onExited: OnExited[] = [];\n\n public constructor(id = \"OverlayView\") {\n super(id);\n this.useGrid(false);\n\n this.addHookDefinition(\"overlay\", useOverlayView);\n\n this.addElement(\n new HeaderElement(\"overlayHeader\", {\n onClose: () => this.setIsVisible(false)\n })\n );\n\n this.addElement(new ContentElement(\"overlayContent\"));\n\n this.applyPlugins(OverlayView);\n }\n\n public setTitle(title: () => string): void {\n this.getHeaderElement().setTitle(title);\n }\n\n public onEntered(): void {\n [...this._onEntered].reverse().forEach(cb => cb(this));\n }\n\n public onExited(): void {\n [...this._onExited].reverse().forEach(cb => cb(this));\n }\n\n public addOnEntered(cb: OnExited): void {\n this._onEntered.push(cb);\n }\n\n public addOnExited(cb: OnExited): void {\n this._onExited.push(cb);\n }\n\n public getOverlayHook(): UseOverlayView {\n return this.getHook<UseOverlayView>(\"overlay\");\n }\n\n public setIsVisible(visible: boolean): void {\n this.getOverlayHook().setIsVisible(visible);\n }\n\n public getHeaderElement(): HeaderElement {\n return this.getElement(\"overlayHeader\") as HeaderElement;\n }\n\n public getContentElement(): ContentElement {\n return this.getElement(\"overlayContent\") as HeaderElement;\n }\n\n public override render(props: UIViewProps): React.ReactNode {\n const { isVisible } = this.getOverlayHook();\n return (\n <Transition\n in={isVisible}\n timeout={100}\n appear\n onExited={() => this.onExited()}\n onEntered={() => this.onEntered()}\n >\n {state => (\n <OverlayLayoutWrapper style={{ ...defaultStyle, ...transitionStyles[state] }}>\n {super.render(props)}\n </OverlayLayoutWrapper>\n )}\n </Transition>\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;;AAEA,IAAMA,oBAAoB,oBAAGC,eAAM,EAAC,KAAK;EAAA;EAAA;AAAA,GAAE;EACvCC,QAAQ,EAAE,OAAO;EACjBC,KAAK,EAAE,MAAM;EACbC,MAAM,EAAE,OAAO;EACfC,eAAe,EAAE,6BAA6B;EAC9C;AACJ;AACA;AACA;EACIC,MAAM,EAAE,EAAE;EACVC,GAAG,EAAE,CAAC;EACNC,IAAI,EAAE;AACV,CAAC,CAAC;AAEF,IAAMC,YAA6C,GAAG;EAClDC,SAAS,EAAE,kBAAkB;EAC7BC,OAAO,EAAE,CAAC;EACVC,kBAAkB,EAAE,oBAAoB;EACxCC,wBAAwB,EAAE,2BAA2B;EACrDC,kBAAkB,EAAE,OAAO;EAC3BC,UAAU,EAAE;AAChB,CAAC;AAED,IAAMC,gBAAqC,GAAG;EAC1CC,QAAQ,EAAE;IACNP,SAAS,EAAE,kBAAkB;IAC7BC,OAAO,EAAE;EACb,CAAC;EACDO,OAAO,EAAE;IACLR,SAAS,EAAE,iBAAiB;IAC5BC,OAAO,EAAE;EACb;AACJ,CAAC;AAAC,IAUWQ,WAAW;EAAA;EAAA;EACpB;AACJ;AACA;AACA;;EAKI,uBAAuC;IAAA;IAAA,IAApBC,EAAE,uEAAG,aAAa;IAAA;IACjC,0BAAMA,EAAE;IAAE,yFAJoB,EAAE;IAAA,wFACJ,EAAE;IAI9B,MAAKC,OAAO,CAAC,KAAK,CAAC;IAEnB,MAAKC,iBAAiB,CAAC,SAAS,EAAEC,8BAAc,CAAC;IAEjD,MAAKC,UAAU,CACX,IAAIC,4BAAa,CAAC,eAAe,EAAE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,UAAU,CAAC,gBAAgB,CAAC;IAC5C;EAAC;IAAA;IAAA,OAED,gBAAuBC,KAAkB,EAAmB;MAAA;MACxD,2BAAsB,IAAI,CAACF,cAAc,EAAE;QAAnCG,SAAS,wBAATA,SAAS;MACjB,oBACI,6BAAC,gCAAU;QACP,EAAE,EAAEA,SAAU;QACd,OAAO,EAAE,GAAI;QACb,MAAM;QACN,QAAQ,EAAE;UAAA,OAAM,MAAI,CAACC,QAAQ,EAAE;QAAA,CAAC;QAChC,SAAS,EAAE;UAAA,OAAM,MAAI,CAACC,SAAS,EAAE;QAAA;MAAC,GAEjC,UAAAC,KAAK;QAAA,oBACF,6BAAC,oBAAoB;UAAC,KAAK,8DAAOtC,YAAY,GAAKO,gBAAgB,CAAC+B,KAAK,CAAC;QAAG,2GAC3DJ,KAAK,EACA;MAAA,CAC1B,CACQ;IAErB;EAAC;EAAA;AAAA,EA/E4BK,eAAM;AAAA;AAAA,8BAA1B7B,WAAW,iBAKC,CAAC"}
|
package/assets/images/icons.png
DELETED
|
Binary file
|
|
Binary file
|
package/assets/images/swich.png
DELETED
|
Binary file
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
|
-
var _lite = _interopRequireDefault(require("mime/lite"));
|
|
13
|
-
|
|
14
|
-
_lite.default.define({
|
|
15
|
-
"image/x-icon": ["ico"]
|
|
16
|
-
}, true);
|
|
17
|
-
|
|
18
|
-
_lite.default.define({
|
|
19
|
-
"image/jpg": ["jpg"]
|
|
20
|
-
}, true);
|
|
21
|
-
|
|
22
|
-
_lite.default.define({
|
|
23
|
-
"image/vnd.microsoft.icon": ["ico"]
|
|
24
|
-
}, true);
|
|
25
|
-
|
|
26
|
-
var getUniqueFilePlugins = function getUniqueFilePlugins(accept) {
|
|
27
|
-
var exts = {};
|
|
28
|
-
accept.forEach(function (item) {
|
|
29
|
-
var ext = _lite.default.getExtension(item);
|
|
30
|
-
|
|
31
|
-
if (!ext) {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
exts[ext] = true;
|
|
36
|
-
});
|
|
37
|
-
return Object.keys(exts);
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
var SupportedFileTypes = function SupportedFileTypes(_ref) {
|
|
41
|
-
var accept = _ref.accept;
|
|
42
|
-
|
|
43
|
-
if (!accept) {
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
if (accept.length === 0) {
|
|
48
|
-
return /*#__PURE__*/_react.default.createElement("span", null, "Showing all file extensions.");
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
return /*#__PURE__*/_react.default.createElement("span", null, "Showing the following file extensions: ", getUniqueFilePlugins(accept).join(", "), ".");
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
var _default = SupportedFileTypes;
|
|
55
|
-
exports.default = _default;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["mime","define","getUniqueFilePlugins","accept","exts","forEach","item","ext","getExtension","Object","keys","SupportedFileTypes","length","join"],"sources":["SupportedFileTypes.tsx"],"sourcesContent":["import React from \"react\";\nimport mime from \"mime/lite\";\n\nmime.define({ \"image/x-icon\": [\"ico\"] }, true);\nmime.define({ \"image/jpg\": [\"jpg\"] }, true);\nmime.define({ \"image/vnd.microsoft.icon\": [\"ico\"] }, true);\n\nconst getUniqueFilePlugins = (accept: string[]): string[] => {\n const exts: Record<string, boolean> = {};\n accept.forEach(item => {\n const ext = mime.getExtension(item);\n if (!ext) {\n return;\n }\n exts[ext] = true;\n });\n\n return Object.keys(exts);\n};\n\nexport interface SupportedFileTypesProps {\n accept: string[];\n}\n\nconst SupportedFileTypes: React.FC<SupportedFileTypesProps> = ({ accept }) => {\n if (!accept) {\n return null;\n }\n\n if (accept.length === 0) {\n return <span>Showing all file extensions.</span>;\n }\n\n return (\n <span>\n Showing the following file extensions: {getUniqueFilePlugins(accept).join(\", \")}.\n </span>\n );\n};\n\nexport default SupportedFileTypes;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AAEAA,aAAA,CAAKC,MAAL,CAAY;EAAE,gBAAgB,CAAC,KAAD;AAAlB,CAAZ,EAAyC,IAAzC;;AACAD,aAAA,CAAKC,MAAL,CAAY;EAAE,aAAa,CAAC,KAAD;AAAf,CAAZ,EAAsC,IAAtC;;AACAD,aAAA,CAAKC,MAAL,CAAY;EAAE,4BAA4B,CAAC,KAAD;AAA9B,CAAZ,EAAqD,IAArD;;AAEA,IAAMC,oBAAoB,GAAG,SAAvBA,oBAAuB,CAACC,MAAD,EAAgC;EACzD,IAAMC,IAA6B,GAAG,EAAtC;EACAD,MAAM,CAACE,OAAP,CAAe,UAAAC,IAAI,EAAI;IACnB,IAAMC,GAAG,GAAGP,aAAA,CAAKQ,YAAL,CAAkBF,IAAlB,CAAZ;;IACA,IAAI,CAACC,GAAL,EAAU;MACN;IACH;;IACDH,IAAI,CAACG,GAAD,CAAJ,GAAY,IAAZ;EACH,CAND;EAQA,OAAOE,MAAM,CAACC,IAAP,CAAYN,IAAZ,CAAP;AACH,CAXD;;AAiBA,IAAMO,kBAAqD,GAAG,SAAxDA,kBAAwD,OAAgB;EAAA,IAAbR,MAAa,QAAbA,MAAa;;EAC1E,IAAI,CAACA,MAAL,EAAa;IACT,OAAO,IAAP;EACH;;EAED,IAAIA,MAAM,CAACS,MAAP,KAAkB,CAAtB,EAAyB;IACrB,oBAAO,2CAAM,8BAAN,CAAP;EACH;;EAED,oBACI,2CAAM,yCAAN,EAC4CV,oBAAoB,CAACC,MAAD,CAApB,CAA6BU,IAA7B,CAAkC,IAAlC,CAD5C,EACoF,GADpF,CADJ;AAKH,CAdD;;eAgBeF,kB"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
|
-
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
13
|
-
|
|
14
|
-
var _Progress = require("@webiny/ui/Progress");
|
|
15
|
-
|
|
16
|
-
var StatusWrapper = /*#__PURE__*/(0, _styled.default)("div", {
|
|
17
|
-
target: "e8hlyp40",
|
|
18
|
-
label: "StatusWrapper"
|
|
19
|
-
})({
|
|
20
|
-
color: "var(--mdc-theme-primary)",
|
|
21
|
-
position: "absolute",
|
|
22
|
-
right: 0,
|
|
23
|
-
bottom: 10,
|
|
24
|
-
marginRight: 10,
|
|
25
|
-
display: "flex",
|
|
26
|
-
alignItems: "center",
|
|
27
|
-
"> div": {
|
|
28
|
-
display: "inline-block"
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
var CircularProgressHolder = /*#__PURE__*/(0, _styled.default)("div", {
|
|
32
|
-
target: "e8hlyp41",
|
|
33
|
-
label: "CircularProgressHolder"
|
|
34
|
-
})({
|
|
35
|
-
position: "relative",
|
|
36
|
-
height: 12,
|
|
37
|
-
width: 12
|
|
38
|
-
});
|
|
39
|
-
var UploadingLabel = /*#__PURE__*/(0, _styled.default)("div", {
|
|
40
|
-
target: "e8hlyp42",
|
|
41
|
-
label: "UploadingLabel"
|
|
42
|
-
})({
|
|
43
|
-
marginRight: 5
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
var UploadStatus = function UploadStatus(_ref) {
|
|
47
|
-
var uploading = _ref.uploading;
|
|
48
|
-
|
|
49
|
-
if (!uploading) {
|
|
50
|
-
return null;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
return /*#__PURE__*/_react.default.createElement(StatusWrapper, null, /*#__PURE__*/_react.default.createElement(UploadingLabel, null, "Uploading..."), /*#__PURE__*/_react.default.createElement(CircularProgressHolder, null, /*#__PURE__*/_react.default.createElement(_Progress.CircularProgress, {
|
|
54
|
-
size: 10,
|
|
55
|
-
spinnerWidth: 1
|
|
56
|
-
})));
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
var _default = UploadStatus;
|
|
60
|
-
exports.default = _default;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["StatusWrapper","styled","color","position","right","bottom","marginRight","display","alignItems","CircularProgressHolder","height","width","UploadingLabel","UploadStatus","uploading"],"sources":["UploadStatus.tsx"],"sourcesContent":["import React from \"react\";\nimport styled from \"@emotion/styled\";\nimport { CircularProgress } from \"@webiny/ui/Progress\";\n\nconst StatusWrapper = styled(\"div\")({\n color: \"var(--mdc-theme-primary)\",\n position: \"absolute\",\n right: 0,\n bottom: 10,\n marginRight: 10,\n display: \"flex\",\n alignItems: \"center\",\n \"> div\": {\n display: \"inline-block\"\n }\n});\n\nconst CircularProgressHolder = styled(\"div\")({\n position: \"relative\",\n height: 12,\n width: 12\n});\n\nconst UploadingLabel = styled(\"div\")({\n marginRight: 5\n});\n\nexport interface UploadStatusProps {\n uploading: boolean;\n}\nconst UploadStatus: React.FC<UploadStatusProps> = ({ uploading }) => {\n if (!uploading) {\n return null;\n }\n\n return (\n <StatusWrapper>\n <UploadingLabel>Uploading...</UploadingLabel>\n <CircularProgressHolder>\n <CircularProgress size={10} spinnerWidth={1} />\n </CircularProgressHolder>\n </StatusWrapper>\n );\n};\n\nexport default UploadStatus;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AAEA,IAAMA,aAAa,oBAAGC,eAAH,EAAU,KAAV;EAAA;EAAA;AAAA,GAAiB;EAChCC,KAAK,EAAE,0BADyB;EAEhCC,QAAQ,EAAE,UAFsB;EAGhCC,KAAK,EAAE,CAHyB;EAIhCC,MAAM,EAAE,EAJwB;EAKhCC,WAAW,EAAE,EALmB;EAMhCC,OAAO,EAAE,MANuB;EAOhCC,UAAU,EAAE,QAPoB;EAQhC,SAAS;IACLD,OAAO,EAAE;EADJ;AARuB,CAAjB,CAAnB;AAaA,IAAME,sBAAsB,oBAAGR,eAAH,EAAU,KAAV;EAAA;EAAA;AAAA,GAAiB;EACzCE,QAAQ,EAAE,UAD+B;EAEzCO,MAAM,EAAE,EAFiC;EAGzCC,KAAK,EAAE;AAHkC,CAAjB,CAA5B;AAMA,IAAMC,cAAc,oBAAGX,eAAH,EAAU,KAAV;EAAA;EAAA;AAAA,GAAiB;EACjCK,WAAW,EAAE;AADoB,CAAjB,CAApB;;AAOA,IAAMO,YAAyC,GAAG,SAA5CA,YAA4C,OAAmB;EAAA,IAAhBC,SAAgB,QAAhBA,SAAgB;;EACjE,IAAI,CAACA,SAAL,EAAgB;IACZ,OAAO,IAAP;EACH;;EAED,oBACI,6BAAC,aAAD,qBACI,6BAAC,cAAD,QAAgB,cAAhB,CADJ,eAEI,6BAAC,sBAAD,qBACI,6BAAC,0BAAD;IAAkB,IAAI,EAAE,EAAxB;IAA4B,YAAY,EAAE;EAA1C,EADJ,CAFJ,CADJ;AAQH,CAbD;;eAeeD,Y"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { SupportedFileTypesProps } from "./BottomInfoBar/SupportedFileTypes";
|
|
3
|
-
import { UploadStatusProps } from "./BottomInfoBar/UploadStatus";
|
|
4
|
-
declare const BottomInfoBar: React.FC<SupportedFileTypesProps & UploadStatusProps>;
|
|
5
|
-
export default BottomInfoBar;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
|
-
var _lite = _interopRequireDefault(require("mime/lite"));
|
|
13
|
-
|
|
14
|
-
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
15
|
-
|
|
16
|
-
var _SupportedFileTypes = _interopRequireDefault(require("./BottomInfoBar/SupportedFileTypes"));
|
|
17
|
-
|
|
18
|
-
var _UploadStatus = _interopRequireDefault(require("./BottomInfoBar/UploadStatus"));
|
|
19
|
-
|
|
20
|
-
_lite.default.define({
|
|
21
|
-
"image/x-icon": ["ico"]
|
|
22
|
-
}, true);
|
|
23
|
-
|
|
24
|
-
_lite.default.define({
|
|
25
|
-
"image/jpg": ["jpg"]
|
|
26
|
-
}, true);
|
|
27
|
-
|
|
28
|
-
_lite.default.define({
|
|
29
|
-
"image/vnd.microsoft.icon": ["ico"]
|
|
30
|
-
}, true);
|
|
31
|
-
|
|
32
|
-
var BottomInfoBarWrapper = /*#__PURE__*/(0, _styled.default)("div", {
|
|
33
|
-
target: "el4b0yq0",
|
|
34
|
-
label: "BottomInfoBarWrapper"
|
|
35
|
-
})({
|
|
36
|
-
fontSize: "0.8rem",
|
|
37
|
-
position: "sticky",
|
|
38
|
-
bottom: 0,
|
|
39
|
-
height: 30,
|
|
40
|
-
color: "var(--mdc-theme-text-secondary-on-background)",
|
|
41
|
-
borderTop: "1px solid var(--mdc-theme-on-background)",
|
|
42
|
-
backgroundColor: "var(--mdc-theme-surface)",
|
|
43
|
-
width: "100%",
|
|
44
|
-
transform: "translateZ(0)",
|
|
45
|
-
overflow: "hidden",
|
|
46
|
-
display: "flex",
|
|
47
|
-
alignItems: "center",
|
|
48
|
-
zIndex: 1,
|
|
49
|
-
"> div": {
|
|
50
|
-
padding: "0 10px",
|
|
51
|
-
width: "100%"
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
var BottomInfoBar = function BottomInfoBar(props) {
|
|
56
|
-
return /*#__PURE__*/_react.default.createElement(BottomInfoBarWrapper, null, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_SupportedFileTypes.default, props), /*#__PURE__*/_react.default.createElement(_UploadStatus.default, props)));
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
var _default = BottomInfoBar;
|
|
60
|
-
exports.default = _default;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["mime","define","BottomInfoBarWrapper","styled","fontSize","position","bottom","height","color","borderTop","backgroundColor","width","transform","overflow","display","alignItems","zIndex","padding","BottomInfoBar","props"],"sources":["BottomInfoBar.tsx"],"sourcesContent":["import React from \"react\";\nimport mime from \"mime/lite\";\nimport styled from \"@emotion/styled\";\nimport SupportedFileTypes, { SupportedFileTypesProps } from \"./BottomInfoBar/SupportedFileTypes\";\nimport UploadStatus, { UploadStatusProps } from \"./BottomInfoBar/UploadStatus\";\n\nmime.define({ \"image/x-icon\": [\"ico\"] }, true);\nmime.define({ \"image/jpg\": [\"jpg\"] }, true);\nmime.define({ \"image/vnd.microsoft.icon\": [\"ico\"] }, true);\n\nconst BottomInfoBarWrapper = styled(\"div\")({\n fontSize: \"0.8rem\",\n position: \"sticky\",\n bottom: 0,\n height: 30,\n color: \"var(--mdc-theme-text-secondary-on-background)\",\n borderTop: \"1px solid var(--mdc-theme-on-background)\",\n backgroundColor: \"var(--mdc-theme-surface)\",\n width: \"100%\",\n transform: \"translateZ(0)\",\n overflow: \"hidden\",\n display: \"flex\",\n alignItems: \"center\",\n zIndex: 1,\n \"> div\": {\n padding: \"0 10px\",\n width: \"100%\"\n }\n});\n\nconst BottomInfoBar: React.FC<SupportedFileTypesProps & UploadStatusProps> = props => {\n return (\n <BottomInfoBarWrapper>\n <div>\n <SupportedFileTypes {...props} />\n <UploadStatus {...props} />\n </div>\n </BottomInfoBarWrapper>\n );\n};\n\nexport default BottomInfoBar;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AAEAA,aAAA,CAAKC,MAAL,CAAY;EAAE,gBAAgB,CAAC,KAAD;AAAlB,CAAZ,EAAyC,IAAzC;;AACAD,aAAA,CAAKC,MAAL,CAAY;EAAE,aAAa,CAAC,KAAD;AAAf,CAAZ,EAAsC,IAAtC;;AACAD,aAAA,CAAKC,MAAL,CAAY;EAAE,4BAA4B,CAAC,KAAD;AAA9B,CAAZ,EAAqD,IAArD;;AAEA,IAAMC,oBAAoB,oBAAGC,eAAH,EAAU,KAAV;EAAA;EAAA;AAAA,GAAiB;EACvCC,QAAQ,EAAE,QAD6B;EAEvCC,QAAQ,EAAE,QAF6B;EAGvCC,MAAM,EAAE,CAH+B;EAIvCC,MAAM,EAAE,EAJ+B;EAKvCC,KAAK,EAAE,+CALgC;EAMvCC,SAAS,EAAE,0CAN4B;EAOvCC,eAAe,EAAE,0BAPsB;EAQvCC,KAAK,EAAE,MARgC;EASvCC,SAAS,EAAE,eAT4B;EAUvCC,QAAQ,EAAE,QAV6B;EAWvCC,OAAO,EAAE,MAX8B;EAYvCC,UAAU,EAAE,QAZ2B;EAavCC,MAAM,EAAE,CAb+B;EAcvC,SAAS;IACLC,OAAO,EAAE,QADJ;IAELN,KAAK,EAAE;EAFF;AAd8B,CAAjB,CAA1B;;AAoBA,IAAMO,aAAoE,GAAG,SAAvEA,aAAuE,CAAAC,KAAK,EAAI;EAClF,oBACI,6BAAC,oBAAD,qBACI,uDACI,6BAAC,2BAAD,EAAwBA,KAAxB,CADJ,eAEI,6BAAC,qBAAD,EAAkBA,KAAlB,CAFJ,CADJ,CADJ;AAQH,CATD;;eAWeD,a"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="web" />
|
|
2
|
-
import React from "react";
|
|
3
|
-
export interface DropFilesHereProps {
|
|
4
|
-
onDragLeave?: (event?: React.DragEvent<HTMLElement>) => void;
|
|
5
|
-
onDrop?: (event?: React.DragEvent<HTMLElement>) => void;
|
|
6
|
-
empty?: boolean;
|
|
7
|
-
onClick?: (event?: React.MouseEvent<HTMLElement>) => void;
|
|
8
|
-
}
|
|
9
|
-
declare const DropFilesHere: React.FC<DropFilesHereProps>;
|
|
10
|
-
export default DropFilesHere;
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
|
-
var _emotion = require("emotion");
|
|
13
|
-
|
|
14
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
|
-
|
|
16
|
-
var _Icon = require("@webiny/ui/Icon");
|
|
17
|
-
|
|
18
|
-
var _roundCloud_upload24px = require("./icons/round-cloud_upload-24px.svg");
|
|
19
|
-
|
|
20
|
-
var styles = /*#__PURE__*/(0, _emotion.css)({
|
|
21
|
-
margin: "0 auto",
|
|
22
|
-
paddingTop: 0,
|
|
23
|
-
height: "100%",
|
|
24
|
-
zIndex: 2,
|
|
25
|
-
width: "100%",
|
|
26
|
-
position: "absolute",
|
|
27
|
-
backgroundColor: "var(--mdc-theme-text-hint-on-light)",
|
|
28
|
-
"&.empty": {
|
|
29
|
-
backgroundColor: "transparent",
|
|
30
|
-
"> div": {
|
|
31
|
-
backgroundColor: "var(--mdc-theme-surface)"
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
"> div": {
|
|
35
|
-
textAlign: "center",
|
|
36
|
-
width: 300,
|
|
37
|
-
height: 300,
|
|
38
|
-
backgroundColor: "var(--mdc-theme-background)",
|
|
39
|
-
borderRadius: "50%",
|
|
40
|
-
position: "absolute",
|
|
41
|
-
left: "50%",
|
|
42
|
-
top: "50%",
|
|
43
|
-
transform: "translateX(-50%) translateY(-100%)",
|
|
44
|
-
"> div": {
|
|
45
|
-
position: "absolute",
|
|
46
|
-
top: 90,
|
|
47
|
-
width: 300,
|
|
48
|
-
color: "var(--mdc-theme-on-surface)",
|
|
49
|
-
"svg.mdc-button__icon": {
|
|
50
|
-
width: 100,
|
|
51
|
-
display: "inline-block",
|
|
52
|
-
color: "var(--mdc-theme-on-surface)"
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}, "label:styles;");
|
|
57
|
-
|
|
58
|
-
var DropFilesHere = function DropFilesHere(_ref) {
|
|
59
|
-
var onDrop = _ref.onDrop,
|
|
60
|
-
onDragLeave = _ref.onDragLeave,
|
|
61
|
-
empty = _ref.empty,
|
|
62
|
-
onClick = _ref.onClick;
|
|
63
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
64
|
-
className: (0, _classnames.default)(styles, {
|
|
65
|
-
empty: empty
|
|
66
|
-
}),
|
|
67
|
-
onDrop: onDrop,
|
|
68
|
-
onClick: onClick,
|
|
69
|
-
onDragLeave: onDragLeave
|
|
70
|
-
}, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Icon.Icon, {
|
|
71
|
-
icon: /*#__PURE__*/_react.default.createElement(_roundCloud_upload24px.ReactComponent, null)
|
|
72
|
-
}), /*#__PURE__*/_react.default.createElement("div", null, "Drop files here"))));
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
var _default = DropFilesHere;
|
|
76
|
-
exports.default = _default;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["styles","css","margin","paddingTop","height","zIndex","width","position","backgroundColor","textAlign","borderRadius","left","top","transform","color","display","DropFilesHere","onDrop","onDragLeave","empty","onClick","classNames"],"sources":["DropFilesHere.tsx"],"sourcesContent":["import React from \"react\";\nimport { css } from \"emotion\";\nimport classNames from \"classnames\";\nimport { Icon } from \"@webiny/ui/Icon\";\n\nimport { ReactComponent as UploadIcon } from \"./icons/round-cloud_upload-24px.svg\";\n\nconst styles = css({\n margin: \"0 auto\",\n paddingTop: 0,\n height: \"100%\",\n zIndex: 2,\n width: \"100%\",\n position: \"absolute\",\n backgroundColor: \"var(--mdc-theme-text-hint-on-light)\",\n \"&.empty\": {\n backgroundColor: \"transparent\",\n \"> div\": {\n backgroundColor: \"var(--mdc-theme-surface)\"\n }\n },\n \"> div\": {\n textAlign: \"center\",\n width: 300,\n height: 300,\n backgroundColor: \"var(--mdc-theme-background)\",\n borderRadius: \"50%\",\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n transform: \"translateX(-50%) translateY(-100%)\",\n \"> div\": {\n position: \"absolute\",\n top: 90,\n width: 300,\n color: \"var(--mdc-theme-on-surface)\",\n \"svg.mdc-button__icon\": {\n width: 100,\n display: \"inline-block\",\n color: \"var(--mdc-theme-on-surface)\"\n }\n }\n }\n});\n\nexport interface DropFilesHereProps {\n onDragLeave?: (event?: React.DragEvent<HTMLElement>) => void;\n onDrop?: (event?: React.DragEvent<HTMLElement>) => void;\n empty?: boolean;\n onClick?: (event?: React.MouseEvent<HTMLElement>) => void;\n}\n\nconst DropFilesHere: React.FC<DropFilesHereProps> = ({ onDrop, onDragLeave, empty, onClick }) => {\n return (\n <div\n className={classNames(styles, { empty })}\n onDrop={onDrop}\n onClick={onClick}\n onDragLeave={onDragLeave}\n >\n <div>\n <div>\n <Icon icon={<UploadIcon />} />\n <div>Drop files here</div>\n </div>\n </div>\n </div>\n );\n};\nexport default DropFilesHere;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAEA;;AAEA,IAAMA,MAAM,gBAAG,IAAAC,YAAA,EAAI;EACfC,MAAM,EAAE,QADO;EAEfC,UAAU,EAAE,CAFG;EAGfC,MAAM,EAAE,MAHO;EAIfC,MAAM,EAAE,CAJO;EAKfC,KAAK,EAAE,MALQ;EAMfC,QA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-
file: FileItem;
|
|
5
|
-
selected: boolean;
|
|
6
|
-
uploadFile: (item: FileItem[] | FileItem) => Promise<number | null>;
|
|
7
|
-
onSelect: (event?: React.MouseEvent) => void;
|
|
8
|
-
onClick?: (event?: React.MouseEvent) => void;
|
|
9
|
-
options?: Array<{
|
|
10
|
-
label: string;
|
|
11
|
-
onClick: (file: Object) => void;
|
|
12
|
-
}>;
|
|
13
|
-
children: React.ReactNode;
|
|
14
|
-
showFileDetails: (event?: React.MouseEvent) => void;
|
|
15
|
-
}
|
|
16
|
-
declare const MemoizedFile: React.NamedExoticComponent<FileProps>;
|
|
17
|
-
export default MemoizedFile;
|