diff --git a/libs/remix-ui/workspace/src/lib/contexts/index.ts b/libs/remix-ui/workspace/src/lib/contexts/index.ts index 129bd4e120..47fba81fed 100644 --- a/libs/remix-ui/workspace/src/lib/contexts/index.ts +++ b/libs/remix-ui/workspace/src/lib/contexts/index.ts @@ -19,6 +19,7 @@ export const FileSystemContext = createContext<{ dispatchDeleteWorkspace: (workspaceName: string) => Promise, dispatchDeleteAllWorkspaces: () => Promise, dispatchPublishToGist: (path?: string, type?: string) => Promise, + dispatchPublishFilesToGist: (selectedFiles: { key: string, type: 'file' | 'folder', content: string }[]) => void, dispatchUploadFile: (target?: SyntheticEvent, targetFolder?: string) => Promise, dispatchUploadFolder: (target?: SyntheticEvent, targetFolder?: string) => Promise, dispatchCreateNewFile: (path: string, rootDir: string) => Promise, diff --git a/libs/remix-ui/workspace/src/lib/providers/FileSystemProvider.tsx b/libs/remix-ui/workspace/src/lib/providers/FileSystemProvider.tsx index 7e5ede0d7b..12c5dc516f 100644 --- a/libs/remix-ui/workspace/src/lib/providers/FileSystemProvider.tsx +++ b/libs/remix-ui/workspace/src/lib/providers/FileSystemProvider.tsx @@ -14,6 +14,7 @@ import { deleteAllWorkspaces, clearPopUp, publishToGist, + publishFilesToGist, createNewFile, setFocusElement, createNewFolder, @@ -118,6 +119,10 @@ export const FileSystemProvider = (props: WorkspaceProps) => { await publishToGist(path) } + const dispatchPublishFilesToGist = (selectedFiles: { key: string, type: 'file' | 'folder', content: string }[]) => { + publishFilesToGist(selectedFiles) + } + const dispatchUploadFile = async (target?: SyntheticEvent, targetFolder?: string) => { await uploadFile(target, targetFolder) } @@ -340,6 +345,7 @@ export const FileSystemProvider = (props: WorkspaceProps) => { dispatchDeleteWorkspace, dispatchDeleteAllWorkspaces, dispatchPublishToGist, + dispatchPublishFilesToGist, dispatchUploadFile, dispatchUploadFolder, dispatchCreateNewFile,