Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
juice49 committed Nov 29, 2024
1 parent cca9390 commit 43a180d
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
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)
}
58 changes: 58 additions & 0 deletions packages/sanity/src/core/diffView/plugin/index.ts
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),
// },
})

0 comments on commit 43a180d

Please sign in to comment.