-
Notifications
You must be signed in to change notification settings - Fork 438
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
packages/sanity/src/core/diffView/plugin/DiffViewStudioLayout.tsx
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 @@ | ||
import {type LayoutProps} from '../../config' | ||
|
||
export function DiffViewStudioLayout(props: LayoutProps) { | ||
return props.renderDefault(props) | ||
} |
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,58 @@ | ||
import {route} from 'sanity/router' | ||
|
||
import {definePlugin} from '../../config' | ||
// import {ReleasesStudioNavbar} from '../navbar/ReleasesStudioNavbar' | ||
// import {ReleasesTool} from '../tool/ReleasesTool' | ||
// import resolveDocumentActions from './documentActions' | ||
// import {ReleasesStudioLayout} from './ReleasesStudioLayout' | ||
|
||
// TODO: DiffView may not be the best name? DiffTool? DocumentDiffTool? VersionDiffTool? | ||
|
||
/** | ||
* @internal | ||
*/ | ||
export const DIFF_VIEW_NAME = 'sanity/diffView' | ||
|
||
/** | ||
* @internal | ||
*/ | ||
export const DIFF_VIEW_TOOL_NAME = 'diffView' | ||
|
||
/** | ||
* @internal | ||
*/ | ||
export const DIFF_VIEW_INTENT = 'diffView' | ||
|
||
/** | ||
* @internal | ||
*/ | ||
export const releases = definePlugin({ | ||
name: DIFF_VIEW_NAME, | ||
studio: { | ||
components: { | ||
layout: ReleasesStudioLayout, | ||
navbar: ReleasesStudioNavbar, | ||
}, | ||
}, | ||
tools: [ | ||
{ | ||
name: DIFF_VIEW_TOOL_NAME, | ||
title: 'Releases', | ||
// component: ReleasesTool, | ||
router: route.create('/', [route.create('/:releaseId')]), | ||
canHandleIntent: (intent) => intent === DIFF_VIEW_INTENT, | ||
getIntentState(intent, params) { | ||
if (intent === DIFF_VIEW_INTENT) { | ||
// return {releaseId: params.id} | ||
} | ||
return null | ||
}, | ||
}, | ||
], | ||
// i18n: { | ||
// bundles: [releasesUsEnglishLocaleBundle], | ||
// }, | ||
// document: { | ||
// actions: (actions, context) => resolveDocumentActions(actions, context), | ||
// }, | ||
}) |