-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* router tweaks * fetching ccfg as org * adding client id to ms settings * making optional * fixing file-picker ts build * importing svgs as urls * adding file picker to connect * lint * lints * lint * lint * upgrading connect' * renaming apis * lint * lint * lint * lint * fixing messaging * adding container embedd * adding listener function * renaming function * style tweaks * lints
- Loading branch information
1 parent
b190f35
commit 819aaa8
Showing
109 changed files
with
8,890 additions
and
166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
'use client' | ||
|
||
import {useCallback, useEffect, useState} from 'react' | ||
import {UnifiedFilePicker} from '@openint/open-file-picker' | ||
|
||
export function FilePickerClient() { | ||
const [magicLink, setMagicLink] = useState<string>('') | ||
|
||
useEffect(() => { | ||
setMagicLink(window.location.href) | ||
}, []) | ||
|
||
const onSelect = useCallback((files: any[]) => { | ||
window.parent.postMessage({type: 'onFilePickerSelect', files}, '*') | ||
}, []) | ||
|
||
const onClose = useCallback(() => { | ||
window.parent.postMessage({type: 'onFilePickerClose'}, '*') | ||
}, []) | ||
|
||
if (!magicLink) { | ||
return null | ||
} | ||
|
||
return ( | ||
<UnifiedFilePicker | ||
auth={{ | ||
openIntFilePickerMagicLink: magicLink, | ||
}} | ||
options={{ | ||
// do we need this in the magic link renderer? | ||
// isOpen: true, | ||
onClose, | ||
onSelect, | ||
}} | ||
/> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
--- | ||
openapi: get /unified/file-storage/files/{id}/download | ||
openapi: get /unified/file-storage/file/{id}/download | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
--- | ||
openapi: get /unified/file-storage/files/{id}/export | ||
openapi: get /unified/file-storage/file/{id}/export | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
--- | ||
openapi: get /unified/file-storage/files/{id} | ||
openapi: get /unified/file-storage/file/{id} | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
--- | ||
openapi: get /unified/file-storage/drive-groups | ||
openapi: get /unified/file-storage/drive-group | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
--- | ||
openapi: get /unified/file-storage/drives | ||
openapi: get /unified/file-storage/drive | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
--- | ||
openapi: get /unified/file-storage/files | ||
openapi: get /unified/file-storage/file | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
--- | ||
openapi: get /unified/file-storage/folders | ||
openapi: get /unified/file-storage/folder | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Open File Picker | ||
|
||
A unified file picker component for SharePoint and Google Drive. | ||
|
||
Powered by [OpenInt](https://openint.dev) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
'use client' | ||
|
||
import {UnifiedFilePicker} from '../src/UnifiedFilePicker' | ||
|
||
interface FilePickerProps { | ||
magicLink: string | ||
} | ||
|
||
export function Client({magicLink}: FilePickerProps) { | ||
return ( | ||
<UnifiedFilePicker | ||
auth={{ | ||
openIntFilePickerMagicLink: magicLink, | ||
}} | ||
options={{ | ||
isOpen: true, | ||
onClose: () => console.log('File picker closed'), | ||
onSelect: (files) => console.log('Selected files:', files), | ||
theme: 'light', | ||
multiselect: true, | ||
folderSelect: false, | ||
}} | ||
/> | ||
) | ||
} |
Oops, something went wrong.