Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ToolOptionsProvider in the Studio layout component #223

Merged
merged 1 commit into from
Jul 19, 2024

Conversation

azaxarov
Copy link
Collaborator

@azaxarov azaxarov commented Jul 18, 2024

Addresses an issue introduced in #221, where some custom asset source components for files and images did not have access to the tool options context.

Copy link
Contributor

@snorrees snorrees left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this is to fix issues with the context not being available everywhere?
It would be nice to have at least line or two in the PR description 😅

src/contexts/ToolOptionsContext.tsx Outdated Show resolved Hide resolved
@azaxarov azaxarov changed the title Wrap asset source and tool components with a withToolOptions HOC Add ToolOptionsProvider in the Studio layout component Jul 19, 2024
@azaxarov azaxarov requested a review from snorrees July 19, 2024 10:42
src/index.ts Outdated
]
}
}))
export {media} from './plugin'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As is, this is a breaking change (no longer exporting the asset source).

You could do

Suggested change
export {media} from './plugin'
export * from './plugin'

But I prefer us being explicit

Suggested change
export {media} from './plugin'
export {media, mediaAssetSource} from './plugin'

Looking at it now, we probably should export MediaToolOptions too, since its used in userland

Suggested change
export {media} from './plugin'
export {media, mediaAssetSource} from './plugin'
export {MediaToolOptions} from '@types'

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good suggestions! Added now 👍

Copy link
Contributor

@snorrees snorrees left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's go!

@azaxarov azaxarov merged commit 1512fba into main Jul 19, 2024
12 checks passed
@azaxarov azaxarov deleted the fix/az/media-tool-options branch July 19, 2024 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants