Skip to content

Commit

Permalink
Merge pull request #133 from sanity-io/refactor-presentation-import
Browse files Browse the repository at this point in the history
fix: use `sanity/presentation` instead of `@sanity/presentation`
  • Loading branch information
siffogh authored Feb 5, 2025
2 parents bf720c3 + 4b7f06a commit e4941a2
Show file tree
Hide file tree
Showing 13 changed files with 1,024 additions and 1,167 deletions.
6 changes: 6 additions & 0 deletions .changeset/strong-waves-fry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@tinloof/sanity-studio": minor
"@tinloof/sanity-web": minor
---

use `sanity/presentation` instead of `@sanity/presentation`
12 changes: 6 additions & 6 deletions apps/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@
"singleQuote": true
},
"dependencies": {
"@sanity/client": "^6.24.1",
"@sanity/preview-url-secret": "^2.0.5",
"@sanity/react-loader": "^1.10.30",
"@sanity/vision": "^3.68.1",
"@sanity/client": "^6.27.2",
"@sanity/preview-url-secret": "^2.1.4",
"@sanity/react-loader": "^1.10.41",
"@sanity/vision": "^3.74.0",
"@tailwindcss/typography": "0.5.15",
"@tinloof/sanity-studio": "workspace:*",
"@tinloof/sanity-web": "workspace:*",
"classnames": "2.5.1",
"lucide-react": "^0.453.0",
"next": "15.1.1",
"next-sanity": "^9.8.27",
"next-sanity": "^9.8.51",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"sanity": "^3.68.1",
"sanity": "^3.74.0",
"server-only": "0.0.1"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions apps/studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
"sanity"
],
"dependencies": {
"@sanity/vision": "^3.68.1",
"@sanity/vision": "^3.74.0",
"@tinloof/sanity-studio": "workspace:*",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-is": "^18.3.1",
"sanity": "^3.68.1",
"sanity": "^3.74.0",
"styled-components": "^6.1.13"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion apps/studio/sanity.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default defineConfig({
structureTool(),
pages({
previewUrl: {
draftMode: {
previewMode: {
enable: 'http://localhost:9999/api/draft',
},
},
Expand Down
10 changes: 5 additions & 5 deletions examples/hello-world/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@
"singleQuote": true
},
"dependencies": {
"@sanity/client": "^6.24.1",
"@sanity/preview-url-secret": "^2.0.5",
"@sanity/vision": "^3.68.1",
"@sanity/client": "^6.27.2",
"@sanity/preview-url-secret": "^2.1.4",
"@sanity/vision": "^3.74.0",
"@tailwindcss/typography": "0.5.15",
"@tinloof/sanity-studio": "workspace:*",
"classnames": "2.5.1",
"lucide-react": "^0.453.0",
"next": "15.1.1",
"next-sanity": "^9.8.27",
"next-sanity": "^9.8.51",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"sanity": "^3.68.1",
"sanity": "^3.74.0",
"server-only": "0.0.1"
},
"devDependencies": {
Expand Down
10 changes: 5 additions & 5 deletions examples/with-i18n/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@
"singleQuote": true
},
"dependencies": {
"@sanity/client": "^6.24.1",
"@sanity/preview-url-secret": "^2.0.5",
"@sanity/vision": "^3.68.1",
"@sanity/client": "^6.27.2",
"@sanity/preview-url-secret": "^2.1.4",
"@sanity/vision": "^3.74.0",
"@tailwindcss/typography": "0.5.15",
"@tinloof/sanity-studio": "workspace:*",
"classnames": "2.5.1",
"lucide-react": "^0.453.0",
"next": "15.1.1",
"next-sanity": "^9.8.27",
"next-sanity": "^9.8.51",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"sanity": "^3.68.1",
"sanity": "^3.74.0",
"server-only": "0.0.1"
},
"devDependencies": {
Expand Down
10 changes: 5 additions & 5 deletions examples/with-sections/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@
},
"dependencies": {
"@heroicons/react": "^2.1.5",
"@sanity/client": "^6.24.1",
"@sanity/preview-url-secret": "^2.0.5",
"@sanity/vision": "^3.68.1",
"@sanity/client": "^6.27.2",
"@sanity/preview-url-secret": "^2.1.4",
"@sanity/vision": "^3.74.0",
"@tailwindcss/typography": "0.5.15",
"@tinloof/sanity-studio": "workspace:*",
"classnames": "2.5.1",
"lucide-react": "^0.453.0",
"next": "15.1.1",
"next-sanity": "^9.8.27",
"next-sanity": "^9.8.51",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"sanity": "^3.68.1",
"sanity": "^3.74.0",
"server-only": "0.0.1"
},
"devDependencies": {
Expand Down
15 changes: 7 additions & 8 deletions packages/sanity-studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,17 @@
},
"dependencies": {
"@sanity/asset-utils": "^1.3.0",
"@sanity/document-internationalization": "^3.2.0",
"@sanity/icons": "^3.5.3",
"@sanity/document-internationalization": "^3.3.1",
"@sanity/icons": "^3.5.7",
"@sanity/image-url": "^1.1.0",
"@sanity/incompatible-plugin": "^1.0.5",
"@sanity/presentation": "^1.19.13",
"@sanity/ui": "^2.10.11",
"@sanity/util": "^3.68.1",
"@sanity/ui": "^2.11.8",
"@sanity/util": "^3.74.0",
"@tanstack/react-virtual": "^3.10.8",
"@tinloof/sanity-web": "workspace:*",
"lodash": "^4.17.21",
"nanoid": "^5.0.7",
"react-rx": "^4.1.9",
"react-rx": "^4.1.18",
"use-debounce": "^10.0.4"
},
"devDependencies": {
Expand All @@ -85,13 +84,13 @@
"react-dom": "^18.3.1",
"react-is": "^18.3.1",
"rimraf": "^5.0.10",
"sanity": "^3.62.0",
"sanity": "^3.74.0",
"styled-components": "^6.1.13",
"typescript": "^5.6.2"
},
"peerDependencies": {
"react": "^18.3.1 || ^19",
"sanity": "^3.68.1"
"sanity": "^3.74.0"
},
"engines": {
"node": ">=14"
Expand Down
10 changes: 5 additions & 5 deletions packages/sanity-studio/src/components/PathnameFieldComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ import {
LockIcon,
RefreshIcon,
} from "@sanity/icons";
import {
PresentationNavigateContextValue,
usePresentationNavigate,
usePresentationParams,
} from "@sanity/presentation";
import {
Box,
Button,
Expand All @@ -33,6 +28,11 @@ import {
unset,
useFormValue,
} from "sanity";
import {
PresentationNavigateContextValue,
usePresentationNavigate,
usePresentationParams,
} from "sanity/presentation";
import { styled } from "styled-components";
import { useDebounce, useDebouncedCallback } from "use-debounce";

Expand Down
4 changes: 2 additions & 2 deletions packages/sanity-studio/src/plugins/navigator/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { presentationTool } from "@sanity/presentation";
import { definePlugin } from "sanity";
import { presentationTool } from "sanity/presentation";

import { PagesNavigatorPluginOptions } from "../../types";
import { createPagesNavigator } from "./components/DefaultPagesNavigator";
Expand All @@ -18,7 +18,7 @@ import { createPageTemplates, normalizeCreatablePages } from "./utils";
* plugins: [
* pages({
* previewUrl: {
* draftMode: {
* previewMode: {
* enable: '/api/draft',
* },
* },
Expand Down
10 changes: 5 additions & 5 deletions packages/sanity-studio/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import { Language as Locale } from "@sanity/document-internationalization";
import {
NavigatorOptions as PresentationNavigatorOptions,
PresentationPluginOptions,
} from "@sanity/presentation";
import { LocalizePathnameFn } from "@tinloof/sanity-web";
import {
FieldDefinitionBase,
Expand All @@ -16,9 +12,13 @@ import {
SlugOptions,
SlugValue,
StringDefinition,
StringSchemaType,
StringInputProps,
StringSchemaType,
} from "sanity";
import {
NavigatorOptions as PresentationNavigatorOptions,
PresentationPluginOptions,
} from "sanity/presentation";

import { SlugContext } from "./hooks/usePathnameContext";

Expand Down
2 changes: 1 addition & 1 deletion packages/sanity-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@portabletext/react": "^3.2.0",
"@sanity/asset-utils": "^1.3.0",
"@sanity/image-url": "^1.1.0",
"sanity": "^3.68.1",
"sanity": "^3.74.0",
"speakingurl": "^14.0.1"
}
}
Loading

0 comments on commit e4941a2

Please sign in to comment.