diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 37ccbbae9..bb50d6b67 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -91,6 +91,6 @@ jobs: done_state_id: "5a35b7bf-6d37-4cc2-854a-2f18d160e2e5" - name: Trigger CircleCI Pipeline - uses: CircleCI-Public/trigger-circleci-pipeline-action@v1.0.5 + uses: CircleCI-Public/trigger-circleci-pipeline-action@ef1944e67053c1923ad772d2377575f2fd962169 # v1.0.5 env: CCI_TOKEN: ${{ secrets.CCI_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b703a3629..4a339b853 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -74,4 +74,4 @@ jobs: pnpm vitest run --merge-reports --coverage - name: Report coverage - uses: davelosert/vitest-coverage-report-action@7bf7d3c1b17a0e27c7e0d14190fb39168584bed2 # v2 + uses: davelosert/vitest-coverage-report-action@8ab049ff5a2c6e78f78af446329379b318544a1a # v2 diff --git a/.github/workflows/validate-pr-title.yml b/.github/workflows/validate-pr-title.yml index 2c4b2c853..43e86771b 100644 --- a/.github/workflows/validate-pr-title.yml +++ b/.github/workflows/validate-pr-title.yml @@ -16,6 +16,6 @@ jobs: name: Validate PR title runs-on: ubuntu-latest steps: - - uses: amannn/action-semantic-pull-request@0723387faaf9b38adef4775cd42cfd5155ed6017 # v5 + - uses: amannn/action-semantic-pull-request@e32d7e603df1aa1ba07e981f2a23455dee596825 # v5 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 985e8ad0b..28270c704 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,4 +1,4 @@ { - "packages/core": "2.2.0", - "packages/react": "2.2.0" + "packages/core": "2.3.1", + "packages/react": "2.3.1" } diff --git a/apps/intent-disambiguation-app/package.json b/apps/intent-disambiguation-app/package.json index e533a5917..8e2fb182a 100644 --- a/apps/intent-disambiguation-app/package.json +++ b/apps/intent-disambiguation-app/package.json @@ -18,6 +18,7 @@ "prettier": "@sanity/prettier-config", "dependencies": { "@sanity/sdk-react": "workspace:*", + "@sanity/ui": "^3.1.11", "react": "^19", "react-dom": "^19", "react-router": "^7.5.2", diff --git a/apps/intent-disambiguation-app/src/App.tsx b/apps/intent-disambiguation-app/src/App.tsx index e652ab56c..c5edb28d4 100644 --- a/apps/intent-disambiguation-app/src/App.tsx +++ b/apps/intent-disambiguation-app/src/App.tsx @@ -2,12 +2,16 @@ import './App.css' import {type SanityConfig} from '@sanity/sdk' import {SanityApp} from '@sanity/sdk-react' +import {ThemeProvider} from '@sanity/ui' +import {buildTheme} from '@sanity/ui/theme' import React from 'react' import {BrowserRouter} from 'react-router' import {IntentDisambiguation} from './components/IntentDisambiguation' import {LoadingFallback} from './components/LoadingFallback' +const theme = buildTheme() + function AppWithRouter(): React.JSX.Element { const sanityConfigs: SanityConfig[] = [ { @@ -18,10 +22,11 @@ function AppWithRouter(): React.JSX.Element { }, }, ] - return ( }> - + + + ) } diff --git a/apps/intent-disambiguation-app/src/components/IntentDisambiguation.tsx b/apps/intent-disambiguation-app/src/components/IntentDisambiguation.tsx index bac74e73b..72fd25baa 100644 --- a/apps/intent-disambiguation-app/src/components/IntentDisambiguation.tsx +++ b/apps/intent-disambiguation-app/src/components/IntentDisambiguation.tsx @@ -1,42 +1,168 @@ -import {useSendIntent} from '@sanity/sdk-react' +import {canvasSource, type DocumentHandleWithSource, useDispatchIntent} from '@sanity/sdk-react' +import {Button, Card, Container, Flex, Heading, Stack, Text} from '@sanity/ui' import React, {Suspense} from 'react' -function SendIntentButton(): React.JSX.Element { - const {sendIntent} = useSendIntent({ - documentHandle: { - documentId: 'maintenance-schedule-123', - documentType: 'maintenanceSchedule', - projectId: '9wmez61s', - dataset: 'production', - }, +function SendIntentButton({ + action, + intentId, + documentHandle, + parameters, + cta, +}: { + action?: 'edit' + intentId?: string + documentHandle: DocumentHandleWithSource + parameters?: Record + cta: string +}): React.JSX.Element { + const {dispatchIntent} = useDispatchIntent({ + ...(action && {action}), + ...(intentId && {intentId}), + ...(parameters && {parameters}), + documentHandle, }) - const handleMaintenanceScheduleClick = () => { - console.log('Sending maintenanceSchedule intent - this should trigger disambiguation') - sendIntent() + const handleClick = () => { + console.log(`Sending ${action || intentId} intent`) + dispatchIntent() } return ( - +