Skip to content

Commit 90331e6

Browse files
committed
Merge branch 'next' into corel
* next: fix: create integration copy + layout updates (#7787)
2 parents 3e3e17c + 4807d52 commit 90331e6

File tree

8 files changed

+79
-73
lines changed

8 files changed

+79
-73
lines changed

packages/sanity/src/core/create/components/CreateLinkedDocumentBannerContent.tsx

+14-13
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
import {useCallback, useRef, useState} from 'react'
1414

1515
import {Button, Popover} from '../../../ui-components'
16-
import {Translate, useTranslation} from '../../i18n'
16+
import {useTranslation} from '../../i18n'
1717
import {createLocaleNamespace} from '../i18n'
1818
import {type CreateLinkedDocumentBannerContentProps} from '../types'
1919
import {CreateLearnMoreButton} from './CreateLearnMoreButton'
@@ -61,9 +61,7 @@ export function CreateLinkedDocumentBannerContent(props: CreateLinkedDocumentBan
6161
</Flex>
6262
<Stack space={4}>
6363
<Heading size={2}>{t('create-link-info-popover.header')}</Heading>
64-
<Text size={1}>
65-
<Translate t={t} i18nKey={'create-link-info-popover.text'} />
66-
</Text>
64+
<Text size={1}>{t('create-link-info-popover.text')}</Text>
6765
<Flex flex={1} justify="flex-end">
6866
<CreateLearnMoreButton />
6967
</Flex>
@@ -73,15 +71,17 @@ export function CreateLinkedDocumentBannerContent(props: CreateLinkedDocumentBan
7371
)
7472

7573
return (
76-
<Flex gap={2} align="center">
77-
<Text size={0} weight="medium">
78-
<ReadOnlyIcon />
79-
</Text>
80-
<Box>
81-
<Text size={1} weight="medium">
82-
{t('studio-create-link-banner.text')}
74+
<Flex gap={1} align="center">
75+
<Flex gap={2} align="center">
76+
<Text size={0} weight="medium">
77+
<ReadOnlyIcon />
8378
</Text>
84-
</Box>
79+
<Box>
80+
<Text size={1} weight="medium">
81+
{t('studio-create-link-banner.text')}
82+
</Text>
83+
</Box>
84+
</Flex>
8585
<Popover
8686
content={popoverContent}
8787
open={infoOpen}
@@ -96,7 +96,8 @@ export function CreateLinkedDocumentBannerContent(props: CreateLinkedDocumentBan
9696
icon={InfoOutlineIcon}
9797
mode="bleed"
9898
onClick={toggleOpen}
99-
style={{marginBottom: '-1em', marginTop: '-1em'}}
99+
// Negative margins added to prevent the button from blowing out banner height
100+
style={{marginBottom: '-0.5em', marginTop: '-0.5em'}}
100101
tooltipProps={{content: t('create-link-info.tooltip')}}
101102
/>
102103
</Popover>

packages/sanity/src/core/create/components/CreateUnlinkConfirmDialog.tsx

+20-18
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import {Flex, Stack, Text} from '@sanity/ui'
1+
import {Stack, Text} from '@sanity/ui'
22
import {useCallback, useId, useState} from 'react'
33

4-
import {Button, Dialog} from '../../../ui-components'
4+
import {Dialog} from '../../../ui-components'
55
import {PatchEvent, unset} from '../../form'
66
import {Translate, useTranslation} from '../../i18n'
77
import {createLocaleNamespace} from '../i18n'
@@ -30,8 +30,24 @@ export function CreateUnlinkConfirmDialog(props: CreateUnlinkConfirmDialogProps)
3030
}, [onDocumentChange, telemetry])
3131

3232
return (
33-
<Dialog id={id} header={t('unlink-from-create-dialog.header')} onClose={onClose}>
34-
<Stack space={5}>
33+
<Dialog
34+
footer={{
35+
cancelButton: {
36+
onClick: onClose,
37+
text: t('unlink-from-create-dialog.cancel.text'),
38+
},
39+
confirmButton: {
40+
disabled: unlinking,
41+
onClick: unlink,
42+
text: t('unlink-from-create-dialog.unlink.text'),
43+
tone: 'primary',
44+
},
45+
}}
46+
id={id}
47+
header={t('unlink-from-create-dialog.header')}
48+
onClose={onClose}
49+
>
50+
<Stack space={4}>
3551
<Text size={1}>
3652
<Translate
3753
t={t}
@@ -41,20 +57,6 @@ export function CreateUnlinkConfirmDialog(props: CreateUnlinkConfirmDialogProps)
4157
</Text>
4258

4359
<Text size={1}>{t('unlink-from-create-dialog.second-paragraph')}</Text>
44-
45-
<Flex flex={1} justify="flex-end" gap={2}>
46-
<Button
47-
mode="bleed"
48-
text={t('unlink-from-create-dialog.cancel.text')}
49-
onClick={onClose}
50-
/>
51-
<Button
52-
tone="primary"
53-
text={t('unlink-from-create-dialog.unlink.text')}
54-
onClick={unlink}
55-
disabled={unlinking}
56-
/>
57-
</Flex>
5860
</Stack>
5961
</Dialog>
6062
)

packages/sanity/src/core/create/i18n/resources.ts

+11-10
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ const createLocaleStrings = defineLocalesResources('create', {
1010
'start-in-create-action.label': 'Start in Sanity Create',
1111

1212
/** Header of the "Start writing in Create" dialog */
13-
'start-in-create-dialog.header': 'Start authoring with Sanity Create',
13+
'start-in-create-dialog.header': 'Start authoring in Sanity Create',
1414
/** The lede text in the "Start writing in Create" dialog */
1515
'start-in-create-dialog.lede':
16-
'Map your free-form ideas back to the studio as structured content whilst you write.',
16+
'Author in a free-form editor and have it mapped back to the Studio as structured content, as you type.',
1717
/** The details on what "Start writing in Create" implies */
1818
'start-in-create-dialog.details':
19-
'This will open Sanity Create in a new window and automatically link this document.',
19+
'This will open Sanity Create in a new window and automatically link it to this document.',
2020
/** CTA in "Start writing in Create" dialog: Continue to create */
2121
'start-in-create-dialog.cta.continue': 'Continue',
2222
/** CTA in "Start writing in Create" dialog: Learn more */
@@ -29,29 +29,30 @@ const createLocaleStrings = defineLocalesResources('create', {
2929
/** Header of the "Linking in progress" dialog */
3030
'linking-in-progress-dialog.header': 'Linking in progress',
3131
/** Lede text for the "Linking in progress" dialog */
32-
'linking-in-progress-dialog.lede': 'Please continue in the newly opened Sanity Create window.',
32+
'linking-in-progress-dialog.lede':
33+
'Please return to Sanity Create. Linking the document should only take a few seconds.',
3334
/** Details for the "Linking in progress" dialog */
3435
'linking-in-progress-dialog.details':
35-
'On completion, this dialog will automatically close and changes from Sanity Create will appear in this document in real-time.',
36+
'When complete, this dialog will close and edits made in Sanity Create will start appearing here as they happen.',
3637
/** "Linking in progress" troubleshooting button title */
37-
'linking-in-progress-dialog.troubleshooting.button.title': 'Link failed?',
38+
'linking-in-progress-dialog.troubleshooting.button.title': 'Linking taking a while?',
3839
/** "Linking in progress" troubleshooting content */
3940
'linking-in-progress-dialog.troubleshooting.content':
40-
"If you're unable to link to Sanity Create, please confirm that your deployed studio is up to date and you are logged in to both Sanity Studio and Create with the same user account.",
41+
'Did you close the Sanity Create window? Does the process appear to be stuck? Please reload this page and try again.',
4142
/** Text for the document pane banner informing users that the document is linked to Sanity Create */
4243
'studio-create-link-banner.text': 'This document is linked to Sanity Create',
4344

4445
/** Tooltip for Create Link button */
45-
'create-link-info.tooltip': 'Sanity Create information',
46+
'create-link-info.tooltip': 'Learn more',
4647
/** Text above header in Create Link info popover */
4748
'create-link-info-popover.eyebrow-title': 'Sanity Create',
4849
/** Text in badge above header in Create Link info popover */
4950
'create-link-info-popover.eyebrow-badge': 'Beta',
5051
/** Header in Create Link info popover */
51-
'create-link-info-popover.header': 'Gather. Contextualize. Realize.',
52+
'create-link-info-popover.header': 'Idea first authoring',
5253
/** Informational text in Create Link info popover */
5354
'create-link-info-popover.text':
54-
'Map your free-form ideas back to the studio as <em>structured content</em> whilst you write.',
55+
'Sanity Create lets you author in a free-form editor that automatically maps back to the Studio as structured content - as you type.',
5556

5657
/** Edit in Create button text */
5758
'edit-in-create-button.text': 'Edit in Sanity Create',

packages/sanity/src/core/create/start-in-create/StartInCreateAction.tsx

+7-5
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ import {useStudioAppIdStore} from '../studio-app/useStudioAppIdStore'
1616
import {type CreateLinkedSanityDocument} from '../types'
1717
import {useSanityCreateTelemetry} from '../useSanityCreateTelemetry'
1818
import {CreateLinkingDialog} from './CreateLinkingDialog'
19-
import {StartInCreateDialog} from './StartInCreateDialog'
19+
import {StartInCreateActionContent} from './StartInCreateActionContent'
20+
import {StartInCreateActionFooter} from './StartInCreateActionFooter'
2021

2122
export function createStartInCreateAction(appIdCache: AppIdCache): DocumentActionComponent {
2223
const StartInCreateActionWrapper: DocumentActionComponent = function StartInCreateActionWrapper(
@@ -69,17 +70,18 @@ export function StartInCreateAction(
6970
: isDialogOpen && {
7071
type: 'dialog',
7172
onClose: closeDialog,
72-
header: t('start-in-create-dialog.header'),
73-
width: 'small',
74-
content: (
75-
<StartInCreateDialog
73+
content: <StartInCreateActionContent />,
74+
footer: (
75+
<StartInCreateActionFooter
7676
onLinkingStarted={linkingStarted}
7777
createLinkId={createLinkId}
7878
appId={appId}
7979
type={type}
8080
autoConfirm={autoConfirm}
8181
/>
8282
),
83+
header: t('start-in-create-dialog.header'),
84+
width: 'small',
8385
},
8486
onHandle: () => {
8587
if (!isDialogOpen) {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import {Stack, Text} from '@sanity/ui'
2+
3+
import {useTranslation} from '../../i18n'
4+
import {CreateSvg} from '../components/media/CreateSvg'
5+
import {createLocaleNamespace} from '../i18n'
6+
7+
export function StartInCreateActionContent() {
8+
const {t} = useTranslation(createLocaleNamespace)
9+
10+
return (
11+
<Stack space={4}>
12+
<CreateSvg />
13+
<Text size={1} weight="semibold">
14+
{t('start-in-create-dialog.lede')}
15+
</Text>
16+
<Text muted size={1}>
17+
{t('start-in-create-dialog.details')}
18+
</Text>
19+
</Stack>
20+
)
21+
}

packages/sanity/src/core/create/start-in-create/StartInCreateDialog.tsx renamed to packages/sanity/src/core/create/start-in-create/StartInCreateActionFooter.tsx

+3-11
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
11
import {LaunchIcon} from '@sanity/icons'
22
import {Checkbox, Flex, Stack, Text, useToast} from '@sanity/ui'
33
import {useCallback, useEffect, useId, useState} from 'react'
4+
import {useTranslation} from 'react-i18next'
45

56
import {Button} from '../../../ui-components'
6-
import {useTranslation} from '../../i18n'
77
import {useWorkspace} from '../../studio'
88
import {CreateLearnMoreButton} from '../components/CreateLearnMoreButton'
9-
import {CreateSvg} from '../components/media/CreateSvg'
109
import {getCreateLinkUrl} from '../createDocumentUrls'
1110
import {createLocaleNamespace} from '../i18n'
1211
import {useSanityCreateTelemetry} from '../useSanityCreateTelemetry'
1312

14-
export interface StartInCreateDialogProps {
13+
interface StartInCreateActionFooterProps {
1514
createLinkId: string
1615
appId: string
1716
type: string
1817
onLinkingStarted: (autoConfirm: boolean) => void
1918
autoConfirm: boolean
2019
}
2120

22-
export function StartInCreateDialog(props: StartInCreateDialogProps) {
21+
export function StartInCreateActionFooter(props: StartInCreateActionFooterProps) {
2322
const {createLinkId, appId, type, onLinkingStarted, autoConfirm} = props
2423
const {t} = useTranslation(createLocaleNamespace)
2524
const checkboxId = useId()
@@ -61,13 +60,6 @@ export function StartInCreateDialog(props: StartInCreateDialogProps) {
6160

6261
return (
6362
<Stack space={4}>
64-
<CreateSvg />
65-
<Text size={1} weight="semibold">
66-
{t('start-in-create-dialog.lede')}
67-
</Text>
68-
<Text muted size={1}>
69-
{t('start-in-create-dialog.details')}
70-
</Text>
7163
<Flex gap={2} align="center">
7264
<Checkbox id={checkboxId} checked={dontShowAgain} onChange={toggleDontShowAgain} />
7365
<Text as="label" htmlFor={checkboxId} muted size={1}>

packages/sanity/src/core/form/inputs/PortableText/object/BlockObject.tsx

+2-10
Original file line numberDiff line numberDiff line change
@@ -280,16 +280,8 @@ export function BlockObject(props: BlockObjectProps) {
280280
ref={memberItem?.elementRef as RefObject<HTMLDivElement> | undefined}
281281
contentEditable={false}
282282
>
283-
<Flex
284-
data-object-block="" // used by create
285-
paddingBottom={1}
286-
marginY={3}
287-
style={debugRender()}
288-
>
289-
<PreviewContainer
290-
data-object-block-inner="" // used by create
291-
{...innerPaddingProps}
292-
>
283+
<Flex paddingBottom={1} marginY={3} style={debugRender()}>
284+
<PreviewContainer {...innerPaddingProps}>
293285
<Box flex={1}>
294286
<Tooltip
295287
placement="top"

packages/sanity/src/core/form/inputs/PortableText/text/TextBlock.tsx

+1-6
Original file line numberDiff line numberDiff line change
@@ -266,16 +266,11 @@ export function TextBlock(props: TextBlockProps) {
266266
<Box
267267
{...outerPaddingProps}
268268
data-testid="text-block"
269-
data-text-block="" // used by create
270269
ref={memberItem?.elementRef as RefObject<HTMLDivElement>}
271270
style={debugRender()}
272271
>
273272
<TextBlockFlexWrapper data-testid="text-block__wrapper">
274-
<Flex
275-
data-text-block-inner="" // used by create
276-
flex={1}
277-
{...innerPaddingProps}
278-
>
273+
<Flex flex={1} {...innerPaddingProps}>
279274
<Box flex={1}>
280275
<Tooltip
281276
content={toolTipContent}

0 commit comments

Comments
 (0)