@sanity/assist 1.2.15-lang.1 → 1.2.15-lang.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +171 -35
- package/dist/index.cjs.mjs +1 -0
- package/dist/index.d.ts +92 -17
- package/dist/index.esm.js +643 -536
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +642 -534
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
- package/src/_lib/form/DocumentForm.tsx +2 -1
- package/src/_lib/form/constants.ts +1 -0
- package/src/assistDocument/AssistDocumentInput.tsx +24 -4
- package/src/assistDocument/RequestRunInstructionProvider.tsx +37 -21
- package/src/assistFormComponents/AssistField.tsx +6 -1
- package/src/assistInspector/AssistInspector.tsx +6 -0
- package/src/assistInspector/helpers.ts +3 -3
- package/src/assistLayout/AssistLayout.tsx +0 -3
- package/src/components/ImageContext.tsx +19 -9
- package/src/components/SafeValueInput.tsx +4 -1
- package/src/coverage/.tmp/coverage-0.json +1 -0
- package/src/coverage/base.css +224 -0
- package/src/coverage/block-navigation.js +87 -0
- package/src/coverage/clover.xml +8613 -0
- package/src/coverage/coverage-final.json +107 -0
- package/src/coverage/favicon.png +0 -0
- package/src/coverage/index.html +461 -0
- package/src/coverage/lcov-report/base.css +224 -0
- package/src/coverage/lcov-report/block-navigation.js +87 -0
- package/src/coverage/lcov-report/favicon.png +0 -0
- package/src/coverage/lcov-report/index.html +461 -0
- package/src/coverage/lcov-report/prettify.css +1 -0
- package/src/coverage/lcov-report/prettify.js +2 -0
- package/src/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/src/coverage/lcov-report/sorter.js +196 -0
- package/src/coverage/lcov-report/src/_lib/connector/ConnectFromRegion.tsx.html +157 -0
- package/src/coverage/lcov-report/src/_lib/connector/ConnectToRegion.tsx.html +151 -0
- package/src/coverage/lcov-report/src/_lib/connector/ConnectorRegion.tsx.html +154 -0
- package/src/coverage/lcov-report/src/_lib/connector/ConnectorsProvider.tsx.html +142 -0
- package/src/coverage/lcov-report/src/_lib/connector/ConnectorsStore.ts.html +451 -0
- package/src/coverage/lcov-report/src/_lib/connector/ConnectorsStoreContext.ts.html +97 -0
- package/src/coverage/lcov-report/src/_lib/connector/helpers.ts.html +100 -0
- package/src/coverage/lcov-report/src/_lib/connector/index.html +281 -0
- package/src/coverage/lcov-report/src/_lib/connector/index.ts.html +112 -0
- package/src/coverage/lcov-report/src/_lib/connector/mapConnectorToLine.ts.html +334 -0
- package/src/coverage/lcov-report/src/_lib/connector/types.ts.html +253 -0
- package/src/coverage/lcov-report/src/_lib/connector/useConnectorsStore.ts.html +124 -0
- package/src/coverage/lcov-report/src/_lib/connector/useRegionRects.ts.html +508 -0
- package/src/coverage/lcov-report/src/_lib/fixedListenQuery.ts.html +388 -0
- package/src/coverage/lcov-report/src/_lib/form/DocumentForm.tsx.html +676 -0
- package/src/coverage/lcov-report/src/_lib/form/helpers.ts.html +178 -0
- package/src/coverage/lcov-report/src/_lib/form/index.html +146 -0
- package/src/coverage/lcov-report/src/_lib/form/index.ts.html +88 -0
- package/src/coverage/lcov-report/src/_lib/index.html +161 -0
- package/src/coverage/lcov-report/src/_lib/randomKey.ts.html +172 -0
- package/src/coverage/lcov-report/src/_lib/useListeningQuery.ts.html +268 -0
- package/src/coverage/lcov-report/src/_lib/usePrevious.ts.html +112 -0
- package/src/coverage/lcov-report/src/assistConnectors/AssistConnectorsOverlay.tsx.html +481 -0
- package/src/coverage/lcov-report/src/assistConnectors/ConnectorPath.tsx.html +271 -0
- package/src/coverage/lcov-report/src/assistConnectors/draw/arrowPath.ts.html +112 -0
- package/src/coverage/lcov-report/src/assistConnectors/draw/connectorPath.ts.html +511 -0
- package/src/coverage/lcov-report/src/assistConnectors/draw/index.html +131 -0
- package/src/coverage/lcov-report/src/assistConnectors/index.html +146 -0
- package/src/coverage/lcov-report/src/assistConnectors/index.ts.html +88 -0
- package/src/coverage/lcov-report/src/assistDocument/AssistDocumentContext.tsx.html +178 -0
- package/src/coverage/lcov-report/src/assistDocument/AssistDocumentContextProvider.tsx.html +136 -0
- package/src/coverage/lcov-report/src/assistDocument/AssistDocumentInput.tsx.html +280 -0
- package/src/coverage/lcov-report/src/assistDocument/RequestRunInstructionProvider.tsx.html +283 -0
- package/src/coverage/lcov-report/src/assistDocument/components/AssistDocumentForm.tsx.html +775 -0
- package/src/coverage/lcov-report/src/assistDocument/components/FieldRefPreview.tsx.html +166 -0
- package/src/coverage/lcov-report/src/assistDocument/components/InstructionsArrayField.tsx.html +109 -0
- package/src/coverage/lcov-report/src/assistDocument/components/InstructionsArrayInput.tsx.html +163 -0
- package/src/coverage/lcov-report/src/assistDocument/components/SelectedFieldContext.tsx.html +115 -0
- package/src/coverage/lcov-report/src/assistDocument/components/generic/HiddenFieldTitle.tsx.html +100 -0
- package/src/coverage/lcov-report/src/assistDocument/components/generic/index.html +116 -0
- package/src/coverage/lcov-report/src/assistDocument/components/helpers.ts.html +148 -0
- package/src/coverage/lcov-report/src/assistDocument/components/index.html +191 -0
- package/src/coverage/lcov-report/src/assistDocument/components/instruction/BackToInstructionsLink.tsx.html +178 -0
- package/src/coverage/lcov-report/src/assistDocument/components/instruction/FieldRefInput.tsx.html +244 -0
- package/src/coverage/lcov-report/src/assistDocument/components/instruction/InstructionInput.tsx.html +349 -0
- package/src/coverage/lcov-report/src/assistDocument/components/instruction/InstructionOutputField.tsx.html +220 -0
- package/src/coverage/lcov-report/src/assistDocument/components/instruction/InstructionOutputInput.tsx.html +700 -0
- package/src/coverage/lcov-report/src/assistDocument/components/instruction/PromptInput.tsx.html +241 -0
- package/src/coverage/lcov-report/src/assistDocument/components/instruction/appearance/IconInput.tsx.html +223 -0
- package/src/coverage/lcov-report/src/assistDocument/components/instruction/appearance/InstructionVisibility.tsx.html +196 -0
- package/src/coverage/lcov-report/src/assistDocument/components/instruction/appearance/index.html +131 -0
- package/src/coverage/lcov-report/src/assistDocument/components/instruction/index.html +191 -0
- package/src/coverage/lcov-report/src/assistDocument/hooks/index.html +161 -0
- package/src/coverage/lcov-report/src/assistDocument/hooks/useAssistDocumentContextValue.tsx.html +289 -0
- package/src/coverage/lcov-report/src/assistDocument/hooks/useDocumentState.ts.html +103 -0
- package/src/coverage/lcov-report/src/assistDocument/hooks/useInstructionToaster.tsx.html +307 -0
- package/src/coverage/lcov-report/src/assistDocument/hooks/useStudioAssistDocument.ts.html +379 -0
- package/src/coverage/lcov-report/src/assistDocument/index.html +176 -0
- package/src/coverage/lcov-report/src/assistDocument/index.ts.html +88 -0
- package/src/coverage/lcov-report/src/assistFormComponents/AssistField.tsx.html +301 -0
- package/src/coverage/lcov-report/src/assistFormComponents/AssistFormBlock.tsx.html +175 -0
- package/src/coverage/lcov-report/src/assistFormComponents/AssistInlineFormBlock.tsx.html +124 -0
- package/src/coverage/lcov-report/src/assistFormComponents/AssistItem.tsx.html +145 -0
- package/src/coverage/lcov-report/src/assistFormComponents/index.html +161 -0
- package/src/coverage/lcov-report/src/assistFormComponents/validation/index.html +131 -0
- package/src/coverage/lcov-report/src/assistFormComponents/validation/listItem.tsx.html +274 -0
- package/src/coverage/lcov-report/src/assistFormComponents/validation/validationList.tsx.html +352 -0
- package/src/coverage/lcov-report/src/assistInspector/AssistInspector.tsx.html +1318 -0
- package/src/coverage/lcov-report/src/assistInspector/FieldAutocomplete.tsx.html +505 -0
- package/src/coverage/lcov-report/src/assistInspector/InstructionTaskHistoryButton.tsx.html +865 -0
- package/src/coverage/lcov-report/src/assistInspector/constants.ts.html +88 -0
- package/src/coverage/lcov-report/src/assistInspector/helpers.ts.html +724 -0
- package/src/coverage/lcov-report/src/assistInspector/index.html +191 -0
- package/src/coverage/lcov-report/src/assistInspector/index.ts.html +163 -0
- package/src/coverage/lcov-report/src/assistLayout/AiAssistanceConfigContext.tsx.html +331 -0
- package/src/coverage/lcov-report/src/assistLayout/AssistLayout.tsx.html +199 -0
- package/src/coverage/lcov-report/src/assistLayout/RunInstructionProvider.tsx.html +751 -0
- package/src/coverage/lcov-report/src/assistLayout/index.html +146 -0
- package/src/coverage/lcov-report/src/components/AssistFeatureBadge.tsx.html +112 -0
- package/src/coverage/lcov-report/src/components/FadeInContent.tsx.html +205 -0
- package/src/coverage/lcov-report/src/components/HideReferenceChangedBannerInput.tsx.html +160 -0
- package/src/coverage/lcov-report/src/components/ImageContext.tsx.html +229 -0
- package/src/coverage/lcov-report/src/components/SafeValueInput.tsx.html +313 -0
- package/src/coverage/lcov-report/src/components/TimeAgo.tsx.html +139 -0
- package/src/coverage/lcov-report/src/components/index.html +191 -0
- package/src/coverage/lcov-report/src/constants.ts.html +145 -0
- package/src/coverage/lcov-report/src/fieldActions/PrivateIcon.tsx.html +145 -0
- package/src/coverage/lcov-report/src/fieldActions/assistFieldActions.tsx.html +907 -0
- package/src/coverage/lcov-report/src/fieldActions/generateCaptionActions.tsx.html +259 -0
- package/src/coverage/lcov-report/src/fieldActions/generateImageActions.tsx.html +256 -0
- package/src/coverage/lcov-report/src/fieldActions/index.html +161 -0
- package/src/coverage/lcov-report/src/helpers/assistSupported.ts.html +226 -0
- package/src/coverage/lcov-report/src/helpers/conditionalMembers.ts.html +466 -0
- package/src/coverage/lcov-report/src/helpers/ids.ts.html +142 -0
- package/src/coverage/lcov-report/src/helpers/index.html +191 -0
- package/src/coverage/lcov-report/src/helpers/misc.ts.html +133 -0
- package/src/coverage/lcov-report/src/helpers/typeUtils.ts.html +208 -0
- package/src/coverage/lcov-report/src/helpers/useAssistSupported.ts.html +106 -0
- package/src/coverage/lcov-report/src/index.html +176 -0
- package/src/coverage/lcov-report/src/index.ts.html +112 -0
- package/src/coverage/lcov-report/src/onboarding/FieldActionsOnboarding.tsx.html +286 -0
- package/src/coverage/lcov-report/src/onboarding/FirstAssistedPathProvider.tsx.html +172 -0
- package/src/coverage/lcov-report/src/onboarding/InspectorOnboarding.tsx.html +223 -0
- package/src/coverage/lcov-report/src/onboarding/index.html +161 -0
- package/src/coverage/lcov-report/src/onboarding/onboardingStore.ts.html +184 -0
- package/src/coverage/lcov-report/src/plugin.tsx.html +427 -0
- package/src/coverage/lcov-report/src/presence/AiFieldPresence.tsx.html +163 -0
- package/src/coverage/lcov-report/src/presence/AssistAvatar.tsx.html +373 -0
- package/src/coverage/lcov-report/src/presence/AssistDocumentPresence.tsx.html +259 -0
- package/src/coverage/lcov-report/src/presence/index.html +161 -0
- package/src/coverage/lcov-report/src/presence/useAssistPresence.ts.html +268 -0
- package/src/coverage/lcov-report/src/schemas/assistDocumentSchema.tsx.html +1552 -0
- package/src/coverage/lcov-report/src/schemas/contextDocumentSchema.tsx.html +253 -0
- package/src/coverage/lcov-report/src/schemas/index.html +176 -0
- package/src/coverage/lcov-report/src/schemas/index.ts.html +277 -0
- package/src/coverage/lcov-report/src/schemas/serialize/SchemTypeTool.tsx.html +391 -0
- package/src/coverage/lcov-report/src/schemas/serialize/index.html +146 -0
- package/src/coverage/lcov-report/src/schemas/serialize/schemaUtils.ts.html +196 -0
- package/src/coverage/lcov-report/src/schemas/serialize/serializeSchema.ts.html +754 -0
- package/src/coverage/lcov-report/src/schemas/serializedSchemaTypeSchema.ts.html +262 -0
- package/src/coverage/lcov-report/src/schemas/typeDefExtensions.ts.html +397 -0
- package/src/coverage/lcov-report/src/translate/FieldTranslationProvider.tsx.html +1003 -0
- package/src/coverage/lcov-report/src/translate/getLanguageParams.ts.html +163 -0
- package/src/coverage/lcov-report/src/translate/index.html +191 -0
- package/src/coverage/lcov-report/src/translate/languageStore.ts.html +139 -0
- package/src/coverage/lcov-report/src/translate/paths.ts.html +577 -0
- package/src/coverage/lcov-report/src/translate/translateActions.tsx.html +637 -0
- package/src/coverage/lcov-report/src/translate/types.ts.html +565 -0
- package/src/coverage/lcov-report/src/types.ts.html +649 -0
- package/src/coverage/lcov-report/src/useApiClient.ts.html +1015 -0
- package/src/coverage/lcov.info +9519 -0
- package/src/coverage/prettify.css +1 -0
- package/src/coverage/prettify.js +2 -0
- package/src/coverage/sort-arrow-sprite.png +0 -0
- package/src/coverage/sorter.js +196 -0
- package/src/coverage/src/_lib/connector/ConnectFromRegion.tsx.html +157 -0
- package/src/coverage/src/_lib/connector/ConnectToRegion.tsx.html +151 -0
- package/src/coverage/src/_lib/connector/ConnectorRegion.tsx.html +154 -0
- package/src/coverage/src/_lib/connector/ConnectorsProvider.tsx.html +142 -0
- package/src/coverage/src/_lib/connector/ConnectorsStore.ts.html +451 -0
- package/src/coverage/src/_lib/connector/ConnectorsStoreContext.ts.html +97 -0
- package/src/coverage/src/_lib/connector/helpers.ts.html +100 -0
- package/src/coverage/src/_lib/connector/index.html +281 -0
- package/src/coverage/src/_lib/connector/index.ts.html +112 -0
- package/src/coverage/src/_lib/connector/mapConnectorToLine.ts.html +334 -0
- package/src/coverage/src/_lib/connector/types.ts.html +253 -0
- package/src/coverage/src/_lib/connector/useConnectorsStore.ts.html +124 -0
- package/src/coverage/src/_lib/connector/useRegionRects.ts.html +508 -0
- package/src/coverage/src/_lib/fixedListenQuery.ts.html +388 -0
- package/src/coverage/src/_lib/form/DocumentForm.tsx.html +676 -0
- package/src/coverage/src/_lib/form/helpers.ts.html +178 -0
- package/src/coverage/src/_lib/form/index.html +146 -0
- package/src/coverage/src/_lib/form/index.ts.html +88 -0
- package/src/coverage/src/_lib/index.html +161 -0
- package/src/coverage/src/_lib/randomKey.ts.html +172 -0
- package/src/coverage/src/_lib/useListeningQuery.ts.html +268 -0
- package/src/coverage/src/_lib/usePrevious.ts.html +112 -0
- package/src/coverage/src/assistConnectors/AssistConnectorsOverlay.tsx.html +481 -0
- package/src/coverage/src/assistConnectors/ConnectorPath.tsx.html +271 -0
- package/src/coverage/src/assistConnectors/draw/arrowPath.ts.html +112 -0
- package/src/coverage/src/assistConnectors/draw/connectorPath.ts.html +511 -0
- package/src/coverage/src/assistConnectors/draw/index.html +131 -0
- package/src/coverage/src/assistConnectors/index.html +146 -0
- package/src/coverage/src/assistConnectors/index.ts.html +88 -0
- package/src/coverage/src/assistDocument/AssistDocumentContext.tsx.html +178 -0
- package/src/coverage/src/assistDocument/AssistDocumentContextProvider.tsx.html +136 -0
- package/src/coverage/src/assistDocument/AssistDocumentInput.tsx.html +280 -0
- package/src/coverage/src/assistDocument/RequestRunInstructionProvider.tsx.html +283 -0
- package/src/coverage/src/assistDocument/components/AssistDocumentForm.tsx.html +775 -0
- package/src/coverage/src/assistDocument/components/FieldRefPreview.tsx.html +166 -0
- package/src/coverage/src/assistDocument/components/InstructionsArrayField.tsx.html +109 -0
- package/src/coverage/src/assistDocument/components/InstructionsArrayInput.tsx.html +163 -0
- package/src/coverage/src/assistDocument/components/SelectedFieldContext.tsx.html +115 -0
- package/src/coverage/src/assistDocument/components/generic/HiddenFieldTitle.tsx.html +100 -0
- package/src/coverage/src/assistDocument/components/generic/index.html +116 -0
- package/src/coverage/src/assistDocument/components/helpers.ts.html +148 -0
- package/src/coverage/src/assistDocument/components/index.html +191 -0
- package/src/coverage/src/assistDocument/components/instruction/BackToInstructionsLink.tsx.html +178 -0
- package/src/coverage/src/assistDocument/components/instruction/FieldRefInput.tsx.html +244 -0
- package/src/coverage/src/assistDocument/components/instruction/InstructionInput.tsx.html +349 -0
- package/src/coverage/src/assistDocument/components/instruction/InstructionOutputField.tsx.html +220 -0
- package/src/coverage/src/assistDocument/components/instruction/InstructionOutputInput.tsx.html +700 -0
- package/src/coverage/src/assistDocument/components/instruction/PromptInput.tsx.html +241 -0
- package/src/coverage/src/assistDocument/components/instruction/appearance/IconInput.tsx.html +223 -0
- package/src/coverage/src/assistDocument/components/instruction/appearance/InstructionVisibility.tsx.html +196 -0
- package/src/coverage/src/assistDocument/components/instruction/appearance/index.html +131 -0
- package/src/coverage/src/assistDocument/components/instruction/index.html +191 -0
- package/src/coverage/src/assistDocument/hooks/index.html +161 -0
- package/src/coverage/src/assistDocument/hooks/useAssistDocumentContextValue.tsx.html +289 -0
- package/src/coverage/src/assistDocument/hooks/useDocumentState.ts.html +103 -0
- package/src/coverage/src/assistDocument/hooks/useInstructionToaster.tsx.html +307 -0
- package/src/coverage/src/assistDocument/hooks/useStudioAssistDocument.ts.html +379 -0
- package/src/coverage/src/assistDocument/index.html +176 -0
- package/src/coverage/src/assistDocument/index.ts.html +88 -0
- package/src/coverage/src/assistFormComponents/AssistField.tsx.html +301 -0
- package/src/coverage/src/assistFormComponents/AssistFormBlock.tsx.html +175 -0
- package/src/coverage/src/assistFormComponents/AssistInlineFormBlock.tsx.html +124 -0
- package/src/coverage/src/assistFormComponents/AssistItem.tsx.html +145 -0
- package/src/coverage/src/assistFormComponents/index.html +161 -0
- package/src/coverage/src/assistFormComponents/validation/index.html +131 -0
- package/src/coverage/src/assistFormComponents/validation/listItem.tsx.html +274 -0
- package/src/coverage/src/assistFormComponents/validation/validationList.tsx.html +352 -0
- package/src/coverage/src/assistInspector/AssistInspector.tsx.html +1318 -0
- package/src/coverage/src/assistInspector/FieldAutocomplete.tsx.html +505 -0
- package/src/coverage/src/assistInspector/InstructionTaskHistoryButton.tsx.html +865 -0
- package/src/coverage/src/assistInspector/constants.ts.html +88 -0
- package/src/coverage/src/assistInspector/helpers.ts.html +724 -0
- package/src/coverage/src/assistInspector/index.html +191 -0
- package/src/coverage/src/assistInspector/index.ts.html +163 -0
- package/src/coverage/src/assistLayout/AiAssistanceConfigContext.tsx.html +331 -0
- package/src/coverage/src/assistLayout/AssistLayout.tsx.html +199 -0
- package/src/coverage/src/assistLayout/RunInstructionProvider.tsx.html +751 -0
- package/src/coverage/src/assistLayout/index.html +146 -0
- package/src/coverage/src/components/AssistFeatureBadge.tsx.html +112 -0
- package/src/coverage/src/components/FadeInContent.tsx.html +205 -0
- package/src/coverage/src/components/HideReferenceChangedBannerInput.tsx.html +160 -0
- package/src/coverage/src/components/ImageContext.tsx.html +229 -0
- package/src/coverage/src/components/SafeValueInput.tsx.html +313 -0
- package/src/coverage/src/components/TimeAgo.tsx.html +139 -0
- package/src/coverage/src/components/index.html +191 -0
- package/src/coverage/src/constants.ts.html +145 -0
- package/src/coverage/src/fieldActions/PrivateIcon.tsx.html +145 -0
- package/src/coverage/src/fieldActions/assistFieldActions.tsx.html +907 -0
- package/src/coverage/src/fieldActions/generateCaptionActions.tsx.html +259 -0
- package/src/coverage/src/fieldActions/generateImageActions.tsx.html +256 -0
- package/src/coverage/src/fieldActions/index.html +161 -0
- package/src/coverage/src/helpers/assistSupported.ts.html +226 -0
- package/src/coverage/src/helpers/conditionalMembers.ts.html +466 -0
- package/src/coverage/src/helpers/ids.ts.html +142 -0
- package/src/coverage/src/helpers/index.html +191 -0
- package/src/coverage/src/helpers/misc.ts.html +133 -0
- package/src/coverage/src/helpers/typeUtils.ts.html +208 -0
- package/src/coverage/src/helpers/useAssistSupported.ts.html +106 -0
- package/src/coverage/src/index.html +176 -0
- package/src/coverage/src/index.ts.html +112 -0
- package/src/coverage/src/onboarding/FieldActionsOnboarding.tsx.html +286 -0
- package/src/coverage/src/onboarding/FirstAssistedPathProvider.tsx.html +172 -0
- package/src/coverage/src/onboarding/InspectorOnboarding.tsx.html +223 -0
- package/src/coverage/src/onboarding/index.html +161 -0
- package/src/coverage/src/onboarding/onboardingStore.ts.html +184 -0
- package/src/coverage/src/plugin.tsx.html +427 -0
- package/src/coverage/src/presence/AiFieldPresence.tsx.html +163 -0
- package/src/coverage/src/presence/AssistAvatar.tsx.html +373 -0
- package/src/coverage/src/presence/AssistDocumentPresence.tsx.html +259 -0
- package/src/coverage/src/presence/index.html +161 -0
- package/src/coverage/src/presence/useAssistPresence.ts.html +268 -0
- package/src/coverage/src/schemas/assistDocumentSchema.tsx.html +1552 -0
- package/src/coverage/src/schemas/contextDocumentSchema.tsx.html +253 -0
- package/src/coverage/src/schemas/index.html +176 -0
- package/src/coverage/src/schemas/index.ts.html +277 -0
- package/src/coverage/src/schemas/serialize/SchemTypeTool.tsx.html +391 -0
- package/src/coverage/src/schemas/serialize/index.html +146 -0
- package/src/coverage/src/schemas/serialize/schemaUtils.ts.html +196 -0
- package/src/coverage/src/schemas/serialize/serializeSchema.ts.html +754 -0
- package/src/coverage/src/schemas/serializedSchemaTypeSchema.ts.html +262 -0
- package/src/coverage/src/schemas/typeDefExtensions.ts.html +397 -0
- package/src/coverage/src/translate/FieldTranslationProvider.tsx.html +1003 -0
- package/src/coverage/src/translate/getLanguageParams.ts.html +163 -0
- package/src/coverage/src/translate/index.html +191 -0
- package/src/coverage/src/translate/languageStore.ts.html +139 -0
- package/src/coverage/src/translate/paths.ts.html +577 -0
- package/src/coverage/src/translate/translateActions.tsx.html +637 -0
- package/src/coverage/src/translate/types.ts.html +565 -0
- package/src/coverage/src/types.ts.html +649 -0
- package/src/coverage/src/useApiClient.ts.html +1015 -0
- package/src/fieldActions/assistFieldActions.tsx +34 -11
- package/src/fieldActions/generateCaptionActions.tsx +2 -2
- package/src/fieldActions/generateImageActions.tsx +57 -0
- package/src/helpers/assistSupported.ts +10 -16
- package/src/helpers/conditionalMembers.test.ts +200 -0
- package/src/helpers/conditionalMembers.ts +127 -0
- package/src/helpers/typeUtils.ts +19 -5
- package/src/index.ts +3 -0
- package/src/node_modules/.vitest/deps/_metadata.json +8 -0
- package/src/node_modules/.vitest/deps/package.json +3 -0
- package/src/node_modules/.vitest/results.json +1 -1
- package/src/plugin.tsx +9 -6
- package/src/schemas/assistDocumentSchema.tsx +1 -1
- package/src/schemas/serialize/serializeSchema.test.ts +239 -8
- package/src/schemas/serialize/serializeSchema.ts +74 -7
- package/src/schemas/typeDefExtensions.ts +78 -5
- package/src/translate/FieldTranslationProvider.tsx +128 -76
- package/src/translate/languageStore.ts +18 -0
- package/src/translate/paths.test.ts +57 -11
- package/src/translate/paths.ts +38 -14
- package/src/translate/translateActions.tsx +186 -0
- package/src/translate/types.ts +1 -0
- package/src/types.ts +12 -10
- package/src/useApiClient.ts +73 -8
- package/src/assistLayout/AlphaMigration.tsx +0 -310
- package/src/fieldActions/translateActions.tsx +0 -118
- package/src/legacy-types.ts +0 -72
package/README.md
CHANGED
|
@@ -16,14 +16,20 @@
|
|
|
16
16
|
- [Disable for a field](#disable-for-a-field)
|
|
17
17
|
- [Disable for an array type](#disable-for-an-array-type)
|
|
18
18
|
- [Unsupported types](#unsupported-types)
|
|
19
|
+
- [Hidden and readOnly fields](#hidden-and-readonly-fields)
|
|
19
20
|
- [Reference support](#reference-support)
|
|
20
21
|
- [Troubleshooting](#troubleshooting)
|
|
21
22
|
- [Included document types](#included-document-types)
|
|
22
23
|
- [Field and type filters](#field-and-type-filters)
|
|
23
|
-
- [
|
|
24
|
+
- [Image description generation](#image-description-generation)
|
|
25
|
+
- [Image generation](#image-generation)
|
|
24
26
|
- [Full document translation](#full-document-translation)
|
|
25
27
|
- [What it solves](#what-ai-assist-full-document-translations-solves)
|
|
26
28
|
- [Configure](#configure-document-translations)
|
|
29
|
+
- [Field level translations](#field-level-translations)
|
|
30
|
+
- [What it solves](#what-ai-assist-field-level-translations-solves)
|
|
31
|
+
- [Configure](#configure-field-translations)
|
|
32
|
+
- [Adding translation actions to fields](#adding-translation-actions-to-fields)
|
|
27
33
|
- [License](#license)
|
|
28
34
|
- [Develop \& test](#develop--test)
|
|
29
35
|
- [Release new version](#release-new-version)
|
|
@@ -49,7 +55,7 @@ In your Studio project folder, install the following plugin dependency:
|
|
|
49
55
|
npm install @sanity/assist sanity@latest
|
|
50
56
|
```
|
|
51
57
|
|
|
52
|
-
This plugin requires `sanity` version `3.
|
|
58
|
+
This plugin requires `sanity` version `3.26` or greater.
|
|
53
59
|
|
|
54
60
|
## Setup
|
|
55
61
|
|
|
@@ -123,7 +129,7 @@ defineType({
|
|
|
123
129
|
name: 'policy',
|
|
124
130
|
type: 'document',
|
|
125
131
|
options: {
|
|
126
|
-
|
|
132
|
+
aiAssist: {exclude: true}
|
|
127
133
|
},
|
|
128
134
|
fields: [
|
|
129
135
|
// ...
|
|
@@ -143,7 +149,7 @@ defineType({
|
|
|
143
149
|
name: 'sku',
|
|
144
150
|
type: 'string',
|
|
145
151
|
options: {
|
|
146
|
-
|
|
152
|
+
aiAssist: {exclude: true}
|
|
147
153
|
}
|
|
148
154
|
})
|
|
149
155
|
]
|
|
@@ -162,7 +168,7 @@ defineType({
|
|
|
162
168
|
defineArrayMember({
|
|
163
169
|
type: 'customProduct',
|
|
164
170
|
options: {
|
|
165
|
-
|
|
171
|
+
aiAssist: {exclude: true}
|
|
166
172
|
}
|
|
167
173
|
})
|
|
168
174
|
]
|
|
@@ -181,14 +187,25 @@ The following types are not supported, and behave as excluded types:
|
|
|
181
187
|
* [File](https://www.sanity.io/docs/file-type) (never supported, even when file has custom fields)
|
|
182
188
|
* [Reference](https://www.sanity.io/docs/reference-type) (supported when configured with embeddingsIndex)
|
|
183
189
|
|
|
184
|
-
Types and fields with `hidden` or `readonly` with a truthy value (`true` or `function`) are not supported.
|
|
185
|
-
(Hidden and readOnly fields can be referenced in instructions still)
|
|
186
|
-
|
|
187
190
|
Fields with these types will not be changed by the assistant, do not have AI Assist actions, and cannot be referenced in instructions.
|
|
188
191
|
|
|
189
192
|
Objects where all fields are excluded or unsupported and arrays where all member types are excluded or unsupported
|
|
190
193
|
will also be excluded.
|
|
191
194
|
|
|
195
|
+
### Hidden and readOnly fields
|
|
196
|
+
|
|
197
|
+
In AI Assist 2.0 and later, conditionally `hidden` and `readOnly` fields can have instructions.
|
|
198
|
+
These fields can be written to by an instruction, as long as the field is non-hidden and writable when the instruction is started.
|
|
199
|
+
|
|
200
|
+
Fields with `hidden` or `readOnly` set to literal `true` will be skipped by AI Assist.
|
|
201
|
+
|
|
202
|
+
*Note*: An instruction will not re-evaluate these states during a run.
|
|
203
|
+
Ie, if an instructions writes to a field that will make another field in the studio readonly or hidden,
|
|
204
|
+
the running instruction will still consider these as if in their original state.
|
|
205
|
+
|
|
206
|
+
If it is essential that AI Assist *never* writes to a conditional field,
|
|
207
|
+
it should be marked with `options.aiAssist.exclude: true`.
|
|
208
|
+
|
|
192
209
|
### Reference support
|
|
193
210
|
|
|
194
211
|
#### Create an Embeddings-index
|
|
@@ -198,7 +215,7 @@ with the documents it should be able to reference.
|
|
|
198
215
|
You can manage your indexes directly in the studio using the [Embeddings Index Dashboard plugin](https://github.com/sanity-io/embeddings-index-ui#embeddings-index-api-dashboard-for-sanity-studio).
|
|
199
216
|
|
|
200
217
|
#### Set schema options
|
|
201
|
-
Set `options.
|
|
218
|
+
Set `options.aiAssist.embeddingsIndex` for reference fields/types you want to enable reference instructions for.
|
|
202
219
|
Reference fields with this options set can have instructions attached to them, and will be visited when running instructions for object fields and arrays.
|
|
203
220
|
|
|
204
221
|
AI assist will use the embeddings-index, filtered by the types allowed by the reference to look up contextually relevant references.
|
|
@@ -215,7 +232,7 @@ defineField({
|
|
|
215
232
|
title: 'Article referene',
|
|
216
233
|
to: [ { type: 'article'} ],
|
|
217
234
|
options: {
|
|
218
|
-
|
|
235
|
+
aiAssist: {
|
|
219
236
|
embeddingsIndex: 'article-index'
|
|
220
237
|
},
|
|
221
238
|
},
|
|
@@ -264,14 +281,121 @@ Note that if the schema targeted by the instruction changes, the following behav
|
|
|
264
281
|
* instructions that included all fields or types will automatically also include the new fields or types
|
|
265
282
|
* instructions that have excluded one or more fields or types, will NOT include the new fields or types
|
|
266
283
|
|
|
267
|
-
##
|
|
268
|
-
AI Assist can optionally generate
|
|
269
|
-
by setting the `options.
|
|
284
|
+
## Image description generation
|
|
285
|
+
AI Assist can optionally generate descriptions for images. This has to be enabled on an image-type/field,
|
|
286
|
+
by setting the `options.aiAssist.imageDescriptionField` on the image type, where `imageDescriptionField` is the field name of a
|
|
270
287
|
custom string-field on the image object:
|
|
271
288
|
|
|
289
|
+
```tsx
|
|
290
|
+
defineField({
|
|
291
|
+
type: 'image',
|
|
292
|
+
name: 'inlineImage',
|
|
293
|
+
title: 'Image',
|
|
294
|
+
fields: [
|
|
295
|
+
defineField({
|
|
296
|
+
type: 'string',
|
|
297
|
+
name: 'altText',
|
|
298
|
+
title: 'Alternative text',
|
|
299
|
+
}),
|
|
300
|
+
],
|
|
301
|
+
options: {
|
|
302
|
+
aiAssist: {
|
|
303
|
+
imageDescriptionField: 'altText',
|
|
304
|
+
}
|
|
305
|
+
},
|
|
306
|
+
})
|
|
307
|
+
```
|
|
308
|
+
This will add a "Generate image description" action to the configured field.
|
|
309
|
+
"Generate image description" action will automatically run whenever the image changes.
|
|
310
|
+
|
|
311
|
+
`imageDescriptionField` can be a nested field, if the image has object field, ie `imageDescriptionField: 'wrapper.altText'`.
|
|
312
|
+
Fields within array items are not supported.
|
|
313
|
+
|
|
314
|
+
## Image generation
|
|
315
|
+
<img width="600" alt="image" src="https://github.com/sanity-io/assist/assets/835514/c4de6791-f530-4cd1-b0c2-96ef988bc256">
|
|
316
|
+
|
|
317
|
+
AI Assist can generate assets for images configured with a prompt field.
|
|
318
|
+
|
|
319
|
+
An image is generated directly by using the "Generate image from prompt" instruction on the prompt field,
|
|
320
|
+
or indirectly whenever the image prompt field is written to by an AI Assist instruction.
|
|
321
|
+
|
|
322
|
+
### Configure
|
|
323
|
+
To enable image generation for an image field, the image must:
|
|
324
|
+
- set `options.aiAssist.imageInstructionField` to a child-path relative to the image
|
|
325
|
+
- have a `string` or `text` field that corresponds to the `imageInstructionField` path
|
|
326
|
+
|
|
327
|
+
This will add a "Generate image from prompt" instruction to the image prompt field. Running it will generate and image.
|
|
328
|
+
|
|
329
|
+
Additionally, whenever an AI Assist instruction writes to the image prompt field, the image will be generated.
|
|
330
|
+
|
|
331
|
+
This could be a document instruction, an instruction for the image field or parent object, or directly on the image prompt field.
|
|
332
|
+
|
|
333
|
+
A common styleguide can achieved by adding an instruction to the image prompt field that rewrites whatever value is there, to include a common style.
|
|
334
|
+
Use AI context documents to apply a reusable styleguide to the prompt rewriting as needed.
|
|
335
|
+
|
|
336
|
+
#### Example
|
|
337
|
+
|
|
338
|
+
Given the following document schema
|
|
339
|
+
```ts
|
|
340
|
+
defineType({
|
|
341
|
+
type: 'document',
|
|
342
|
+
name: 'article',
|
|
343
|
+
fields: [
|
|
344
|
+
defineField({
|
|
345
|
+
type: 'image',
|
|
346
|
+
name: 'articleImage',
|
|
347
|
+
fields: [
|
|
348
|
+
defineField({
|
|
349
|
+
type: 'text',
|
|
350
|
+
name: 'imagePrompt',
|
|
351
|
+
title: 'Image prompt',
|
|
352
|
+
rows: 2,
|
|
353
|
+
}),
|
|
354
|
+
],
|
|
355
|
+
options: {
|
|
356
|
+
imagePromptField: 'imagePromptField',
|
|
357
|
+
},
|
|
358
|
+
})
|
|
359
|
+
]
|
|
360
|
+
})
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
To directly generate an image based on the value in the prompt field,
|
|
364
|
+
run the "Generate image from prompt" instruction that is automatically added.
|
|
365
|
+
|
|
366
|
+
For better image results or to ensure a consistent style, rewrite the prompt before generating the image:
|
|
367
|
+
|
|
368
|
+
### Example prompt expansion instruction
|
|
369
|
+
<img width="267" alt="image" src="https://github.com/sanity-io/assist/assets/835514/dabc6910-80d3-4a69-940f-49ac5cae9ade">
|
|
370
|
+
|
|
371
|
+
For better image results, use an instruction that expands the prompt to be more detailed.
|
|
372
|
+
|
|
373
|
+
Example instruction text:
|
|
374
|
+
|
|
375
|
+
```
|
|
376
|
+
Rewrite image prompts for image generation according to the following rules:
|
|
377
|
+
- Be Specific: Include detailed descriptions of the scene, objects, colors, and any characters. Instead of saying "a cat in a garden", say "a fluffy gray cat sitting beside pink tulips in a sunny garden".
|
|
378
|
+
- Set the Scene: Describe the environment or background. Mention if it's indoors or outdoors, the time of day, weather conditions, and any specific setting details like a beach, forest, cityscape, etc.
|
|
379
|
+
- Detail Characters: If your image includes people or animals, specify their appearance, clothing, poses, and expressions. For example, "a smiling young woman with short black hair, wearing a red dress, standing under a tree".
|
|
380
|
+
- Color and Style: Mention specific colors and artistic styles you prefer. For instance, "bright, vivid colors with a watercolor effect".
|
|
381
|
+
- Mood and Atmosphere: Describe the mood or atmosphere of the image. Words like 'peaceful', 'dynamic', 'mysterious', or 'joyful' can guide the AI in capturing the right tone.
|
|
382
|
+
- Avoid Ambiguity: Be clear and direct. Avoid using vague or abstract concepts that the AI might struggle to interpret.
|
|
383
|
+
- Follow the Guidelines: Ensure your prompt doesn't include any content against usage policies, such as depictions of real people, copyrighted characters, or sensitive subjects.
|
|
384
|
+
|
|
385
|
+
Keep it 100 words or less.
|
|
386
|
+
|
|
387
|
+
The prompt to rewrite is:
|
|
388
|
+
{Reference to image-prompt-field}
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
The rules can be extracted into an AI Context document and reused in other instructions as needed. This approach can also be used to inform a reusable styleguide for image generation.
|
|
272
392
|
## Full document translation
|
|
393
|
+
<img width="250" alt="Translate document action" src="https://github.com/sanity-io/assist/assets/835514/932968ee-1a8c-4389-8822-338188f88b40">
|
|
394
|
+
|
|
273
395
|
AI assist offers full document translations, which is ideal for pairing with [@sanity/document-internationalization](https://github.com/sanity-io/document-internationalization).
|
|
274
396
|
|
|
397
|
+
Translations are done deeply; visiting nested objects, arrays and even Portable text annotations.
|
|
398
|
+
|
|
275
399
|
### What AI Assist full document translations solves
|
|
276
400
|
|
|
277
401
|
Given a document written in one language, AI assist can translate the document in place to a language specified by a language field in the document.
|
|
@@ -349,6 +473,9 @@ assist({
|
|
|
349
473
|
```
|
|
350
474
|
|
|
351
475
|
## Field level translations
|
|
476
|
+
<img width="250" alt="Translate fields action" src="https://github.com/sanity-io/assist/assets/835514/99819cd4-578e-43b2-8c70-8e39afff5f09">
|
|
477
|
+
|
|
478
|
+
<img width="250" alt="Translate fields dialog" src="https://github.com/sanity-io/assist/assets/835514/fe3d289c-49b6-46dd-ae2f-cd509a01534a">
|
|
352
479
|
|
|
353
480
|
AI assist offers field-level translations, which is ideal for using alongside with[sanity-plugin-internationalized-array](https://github.com/sanity-io/sanity-plugin-internationalized-array?tab=readme-ov-file#sanity-plugin-internationalized-array) and (@sanity/language-filter)[https://github.com/sanity-io/language-filter]
|
|
354
481
|
|
|
@@ -597,39 +724,48 @@ assist({
|
|
|
597
724
|
})
|
|
598
725
|
```
|
|
599
726
|
|
|
600
|
-
##
|
|
727
|
+
## Adding translation actions to fields
|
|
601
728
|
|
|
602
|
-
|
|
603
|
-
but some common caveats to the field that you may run into using AI Assist are:
|
|
729
|
+
<img width="250" alt="Translate action on field" src="https://github.com/sanity-io/assist/assets/835514/e6dc0860-90a7-4f7a-b3d2-71893b09862f">
|
|
604
730
|
|
|
605
|
-
|
|
606
|
-
* Timeouts: To be able to write structured content, we're using the largest language models - long-running results may time out or intermittently fail
|
|
607
|
-
* Limited capacity: The underlying LLM APIs used by AI Assist are resource constrained
|
|
731
|
+
<img width="250" alt="Translate fields action on field" src="https://github.com/sanity-io/assist/assets/835514/acc5fa23-2022-4eae-922d-5c83dda7379c">
|
|
608
732
|
|
|
733
|
+
By default, “Translate document” and “Translate fields…” instructions are only added to the document instruction dropdown.
|
|
609
734
|
|
|
735
|
+
These instructions can also be added to fields by setting
|
|
736
|
+
`options.aiAssist.translateAction: true` for a field or type.
|
|
610
737
|
|
|
611
|
-
|
|
738
|
+
This allows editors to translate only parts of the document, and can be useful to enable on `internatinalizedArrays` or `locale` wrapper object types.
|
|
739
|
+
|
|
740
|
+
For document types configured for full document translations, a "Translate" action will be added. Running it will translate the field to the language set in the language field
|
|
741
|
+
|
|
742
|
+
For document types configured for field translations, a "Translate fields..." action will be added. Running it will open a dialog with language selectors.
|
|
743
|
+
|
|
744
|
+
|
|
745
|
+
#### Example
|
|
746
|
+
|
|
747
|
+
```ts
|
|
612
748
|
defineField({
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
title: '
|
|
616
|
-
fields: [
|
|
617
|
-
defineField({
|
|
618
|
-
type: 'string',
|
|
619
|
-
name: 'caption',
|
|
620
|
-
title: 'Caption',
|
|
621
|
-
}),
|
|
622
|
-
],
|
|
749
|
+
name: 'subtitle',
|
|
750
|
+
type: 'internationalizedArrayString',
|
|
751
|
+
title: 'Subtitle',
|
|
623
752
|
options: {
|
|
624
|
-
|
|
753
|
+
aiAssist: {
|
|
754
|
+
translateAction: true
|
|
755
|
+
}
|
|
625
756
|
},
|
|
626
757
|
})
|
|
627
758
|
```
|
|
628
|
-
This will add a "Generate caption" action to the configured field.
|
|
629
|
-
"Generate caption" action will automatically run whenever the image changes.
|
|
630
759
|
|
|
631
|
-
|
|
632
|
-
|
|
760
|
+
## Caveats
|
|
761
|
+
|
|
762
|
+
Large Language Models (LLMs) are a new technology. Constraints and limitations are still being explored,
|
|
763
|
+
but some common caveats to the field that you may run into using AI Assist are:
|
|
764
|
+
|
|
765
|
+
* Limits to instruction length: Long instructions on deep content structures may exhaust model context
|
|
766
|
+
* Timeouts: To be able to write structured content, we're using the largest language models - long-running results may time out or intermittently fail
|
|
767
|
+
* Limited capacity: The underlying LLM APIs used by AI Assist are resource constrained
|
|
768
|
+
|
|
633
769
|
|
|
634
770
|
## Third party sub-processors
|
|
635
771
|
|
package/dist/index.cjs.mjs
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -8,18 +8,19 @@ import {SchemaType} from 'sanity'
|
|
|
8
8
|
export declare const assist: Plugin_2<void | AssistPluginConfig>
|
|
9
9
|
|
|
10
10
|
export declare interface AssistOptions {
|
|
11
|
-
|
|
11
|
+
aiAssist?: {
|
|
12
12
|
/** Set to true to disable assistance for this field or type */
|
|
13
13
|
exclude?: boolean
|
|
14
|
+
/**
|
|
15
|
+
* Set to true to add translation field-action to the field.
|
|
16
|
+
* Only has an effect in document types configured for document or field level translations.
|
|
17
|
+
*/
|
|
18
|
+
translateAction?: boolean
|
|
14
19
|
}
|
|
15
20
|
}
|
|
16
21
|
|
|
17
22
|
declare interface AssistPluginConfig {
|
|
18
23
|
translate?: TranslationConfig
|
|
19
|
-
/**
|
|
20
|
-
* Set this to false to disable model migration from the alpha version of this plugin
|
|
21
|
-
*/
|
|
22
|
-
alphaMigration?: boolean
|
|
23
24
|
/**
|
|
24
25
|
* @internal
|
|
25
26
|
*/
|
|
@@ -28,13 +29,21 @@ declare interface AssistPluginConfig {
|
|
|
28
29
|
|
|
29
30
|
export declare const contextDocumentTypeName: 'assist.instruction.context'
|
|
30
31
|
|
|
31
|
-
|
|
32
|
+
/**
|
|
33
|
+
* Default implementation for plugin config `translate.field.translationOutputs`
|
|
34
|
+
*
|
|
35
|
+
* @see FieldTranslationConfig#translationOutputs
|
|
36
|
+
*/
|
|
37
|
+
export declare const defaultLanguageOutputs: TranslationOutputsFunction
|
|
38
|
+
|
|
39
|
+
export declare interface DocumentMember {
|
|
32
40
|
schemaType: SchemaType
|
|
33
41
|
path: Path
|
|
34
42
|
name: string
|
|
43
|
+
value: unknown
|
|
35
44
|
}
|
|
36
45
|
|
|
37
|
-
declare interface DocumentTranslationConfig {
|
|
46
|
+
export declare interface DocumentTranslationConfig {
|
|
38
47
|
/**
|
|
39
48
|
* Path to language field in documents. Can be a hidden field.
|
|
40
49
|
* For instance: 'config.language'
|
|
@@ -56,7 +65,7 @@ declare interface DocumentTranslationConfig {
|
|
|
56
65
|
documentTypes?: string[]
|
|
57
66
|
}
|
|
58
67
|
|
|
59
|
-
declare interface FieldTranslationConfig {
|
|
68
|
+
export declare interface FieldTranslationConfig {
|
|
60
69
|
/**
|
|
61
70
|
* `documentTypes` should be an array of strings where each entry must match a name from your document schemas.
|
|
62
71
|
*
|
|
@@ -147,19 +156,19 @@ declare interface FieldTranslationConfig {
|
|
|
147
156
|
translationOutputs?: TranslationOutputsFunction
|
|
148
157
|
}
|
|
149
158
|
|
|
150
|
-
declare interface Language {
|
|
159
|
+
export declare interface Language {
|
|
151
160
|
id: string
|
|
152
161
|
title?: string
|
|
153
162
|
}
|
|
154
163
|
|
|
155
|
-
declare type LanguageCallback = (
|
|
164
|
+
export declare type LanguageCallback = (
|
|
156
165
|
client: SanityClient,
|
|
157
166
|
selectedLanguageParams: Record<string, unknown>,
|
|
158
167
|
) => Promise<Language[]>
|
|
159
168
|
|
|
160
169
|
export declare function SchemaTypeTool(): JSX_2.Element
|
|
161
170
|
|
|
162
|
-
declare interface TranslationConfig {
|
|
171
|
+
export declare interface TranslationConfig {
|
|
163
172
|
/**
|
|
164
173
|
* Config for document types with fields in multiple languages in the same document.
|
|
165
174
|
*/
|
|
@@ -170,13 +179,13 @@ declare interface TranslationConfig {
|
|
|
170
179
|
document?: DocumentTranslationConfig
|
|
171
180
|
}
|
|
172
181
|
|
|
173
|
-
declare interface TranslationOutput {
|
|
182
|
+
export declare interface TranslationOutput {
|
|
174
183
|
/** Language id */
|
|
175
184
|
id: string
|
|
176
185
|
outputPath: Path
|
|
177
186
|
}
|
|
178
187
|
|
|
179
|
-
declare type TranslationOutputsFunction = (
|
|
188
|
+
export declare type TranslationOutputsFunction = (
|
|
180
189
|
documentMember: DocumentMember,
|
|
181
190
|
enclosingType: SchemaType,
|
|
182
191
|
translateFromLanguageId: string,
|
|
@@ -195,14 +204,80 @@ declare module 'sanity' {
|
|
|
195
204
|
interface DocumentOptions extends AssistOptions {}
|
|
196
205
|
interface FileOptions extends AssistOptions {}
|
|
197
206
|
interface GeopointOptions extends AssistOptions {}
|
|
198
|
-
interface ImageOptions
|
|
199
|
-
|
|
200
|
-
|
|
207
|
+
interface ImageOptions {
|
|
208
|
+
aiAssist?: AssistOptions['aiAssist'] & {
|
|
209
|
+
/**
|
|
210
|
+
* When set, an image will be created whenever the `imageInstructionField` is written to by
|
|
211
|
+
* an AI Assist instruction.
|
|
212
|
+
*
|
|
213
|
+
* The value output by AI Assist will be use as an image prompt for an generative image AI.
|
|
214
|
+
*
|
|
215
|
+
* This means that instructions directly for the field or instructions that visit the field when running,
|
|
216
|
+
* will result in the image being changed.
|
|
217
|
+
*
|
|
218
|
+
* `imageInstructionField` must be a child-path relative to the image field, ie:
|
|
219
|
+
* * field
|
|
220
|
+
* * path.to.field
|
|
221
|
+
*
|
|
222
|
+
* ### Example
|
|
223
|
+
* ```ts
|
|
224
|
+
* defineType({
|
|
225
|
+
* type: 'image',
|
|
226
|
+
* name: 'articleImage',
|
|
227
|
+
* fields: [
|
|
228
|
+
* defineField({
|
|
229
|
+
* type: 'text',
|
|
230
|
+
* name: 'imagePrompt',
|
|
231
|
+
* title: 'Image prompt',
|
|
232
|
+
* rows: 2,
|
|
233
|
+
* }),
|
|
234
|
+
* ],
|
|
235
|
+
* options: {
|
|
236
|
+
* aiAssist: {
|
|
237
|
+
* imageInstructionField: 'imagePrompt',
|
|
238
|
+
* }
|
|
239
|
+
* },
|
|
240
|
+
* })
|
|
241
|
+
* ```
|
|
242
|
+
*/
|
|
243
|
+
imageInstructionField?: string
|
|
244
|
+
/**
|
|
245
|
+
* When set, an image description will be automatically created for the image.
|
|
246
|
+
*
|
|
247
|
+
* `imageDescriptionField` must be a child-path relative to the image field, ie:
|
|
248
|
+
* * field
|
|
249
|
+
* * path.to.field
|
|
250
|
+
*
|
|
251
|
+
* Whenever the image asset for the field is changed in the Studio,
|
|
252
|
+
* an image description is generated and set into the `imageDescriptionField`.
|
|
253
|
+
*
|
|
254
|
+
* ### Example
|
|
255
|
+
* ```ts
|
|
256
|
+
* defineType({
|
|
257
|
+
* type: 'image',
|
|
258
|
+
* name: 'articleImage',
|
|
259
|
+
* fields: [
|
|
260
|
+
* defineField({
|
|
261
|
+
* type: 'string',
|
|
262
|
+
* name: 'altText',
|
|
263
|
+
* title: 'Alt text',
|
|
264
|
+
* }),
|
|
265
|
+
* ],
|
|
266
|
+
* options: {
|
|
267
|
+
* aiAssist: {
|
|
268
|
+
* imageDescriptionField: 'altText',
|
|
269
|
+
* }
|
|
270
|
+
* },
|
|
271
|
+
* })
|
|
272
|
+
* ```
|
|
273
|
+
*/
|
|
274
|
+
imageDescriptionField?: string
|
|
275
|
+
}
|
|
201
276
|
}
|
|
202
277
|
interface NumberOptions extends AssistOptions {}
|
|
203
278
|
interface ObjectOptions extends AssistOptions {}
|
|
204
279
|
interface ReferenceBaseOptions {
|
|
205
|
-
|
|
280
|
+
aiAssist?: {
|
|
206
281
|
/** Set to true to disable assistance for this field or type */
|
|
207
282
|
exclude?: boolean
|
|
208
283
|
/**
|