diff --git a/package-lock.json b/package-lock.json index c58e633f3..a3f9fc256 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,13 +14,14 @@ "@sanity/preview-url-secret": "^1.6.11", "@sanity/react-loader": "^1.9.15", "@sanity/vision": "^3.39.1", - "next": "14.2.3", + "next": "^14.2.13", "next-sanity": "^7.1.4", "next-sanity-image": "^6.1.1", "react": "^18.3.1", "react-dom": "^18.3.1", "react-focus-on": "^3.9.3", "sanity": "^3.57.3", + "sanity-plugin-internationalized-array": "^3.0.1", "sanity-plugin-media": "^2.3.2" }, "devDependencies": { @@ -4416,9 +4417,9 @@ } }, "node_modules/@next/env": { - "version": "14.2.3", - "resolved": "https://registry.npmjs.org/@next/env/-/env-14.2.3.tgz", - "integrity": "sha512-W7fd7IbkfmeeY2gXrzJYDx8D2lWKbVoTIj1o1ScPHNzvp30s1AuoEFSdr39bC5sjxJaxTtq3OTCZboNp0lNWHA==", + "version": "14.2.13", + "resolved": "https://registry.npmjs.org/@next/env/-/env-14.2.13.tgz", + "integrity": "sha512-s3lh6K8cbW1h5Nga7NNeXrbe0+2jIIYK9YaA9T7IufDWnZpozdFUp6Hf0d5rNWUKu4fEuSX2rCKlGjCrtylfDw==", "license": "MIT" }, "node_modules/@next/eslint-plugin-next": { @@ -4432,9 +4433,9 @@ } }, "node_modules/@next/swc-darwin-arm64": { - "version": "14.2.3", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.2.3.tgz", - "integrity": "sha512-3pEYo/RaGqPP0YzwnlmPN2puaF2WMLM3apt5jLW2fFdXD9+pqcoTzRk+iZsf8ta7+quAe4Q6Ms0nR0SFGFdS1A==", + "version": "14.2.13", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.2.13.tgz", + "integrity": "sha512-IkAmQEa2Htq+wHACBxOsslt+jMoV3msvxCn0WFSfJSkv/scy+i/EukBKNad36grRxywaXUYJc9mxEGkeIs8Bzg==", "cpu": [ "arm64" ], @@ -4448,9 +4449,9 @@ } }, "node_modules/@next/swc-darwin-x64": { - "version": "14.2.3", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.2.3.tgz", - "integrity": "sha512-6adp7waE6P1TYFSXpY366xwsOnEXM+y1kgRpjSRVI2CBDOcbRjsJ67Z6EgKIqWIue52d2q/Mx8g9MszARj8IEA==", + "version": "14.2.13", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.2.13.tgz", + "integrity": "sha512-Dv1RBGs2TTjkwEnFMVL5XIfJEavnLqqwYSD6LXgTPdEy/u6FlSrLBSSfe1pcfqhFEXRAgVL3Wpjibe5wXJzWog==", "cpu": [ "x64" ], @@ -4464,9 +4465,9 @@ } }, "node_modules/@next/swc-linux-arm64-gnu": { - "version": "14.2.3", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.2.3.tgz", - "integrity": "sha512-cuzCE/1G0ZSnTAHJPUT1rPgQx1w5tzSX7POXSLaS7w2nIUJUD+e25QoXD/hMfxbsT9rslEXugWypJMILBj/QsA==", + "version": "14.2.13", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.2.13.tgz", + "integrity": "sha512-yB1tYEFFqo4ZNWkwrJultbsw7NPAAxlPXURXioRl9SdW6aIefOLS+0TEsKrWBtbJ9moTDgU3HRILL6QBQnMevg==", "cpu": [ "arm64" ], @@ -4480,9 +4481,9 @@ } }, "node_modules/@next/swc-linux-arm64-musl": { - "version": "14.2.3", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.2.3.tgz", - "integrity": "sha512-0D4/oMM2Y9Ta3nGuCcQN8jjJjmDPYpHX9OJzqk42NZGJocU2MqhBq5tWkJrUQOQY9N+In9xOdymzapM09GeiZw==", + "version": "14.2.13", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.2.13.tgz", + "integrity": "sha512-v5jZ/FV/eHGoWhMKYrsAweQ7CWb8xsWGM/8m1mwwZQ/sutJjoFaXchwK4pX8NqwImILEvQmZWyb8pPTcP7htWg==", "cpu": [ "arm64" ], @@ -4496,9 +4497,9 @@ } }, "node_modules/@next/swc-linux-x64-gnu": { - "version": "14.2.3", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.2.3.tgz", - "integrity": "sha512-ENPiNnBNDInBLyUU5ii8PMQh+4XLr4pG51tOp6aJ9xqFQ2iRI6IH0Ds2yJkAzNV1CfyagcyzPfROMViS2wOZ9w==", + "version": "14.2.13", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.2.13.tgz", + "integrity": "sha512-aVc7m4YL7ViiRv7SOXK3RplXzOEe/qQzRA5R2vpXboHABs3w8vtFslGTz+5tKiQzWUmTmBNVW0UQdhkKRORmGA==", "cpu": [ "x64" ], @@ -4512,9 +4513,9 @@ } }, "node_modules/@next/swc-linux-x64-musl": { - "version": "14.2.3", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.2.3.tgz", - "integrity": "sha512-BTAbq0LnCbF5MtoM7I/9UeUu/8ZBY0i8SFjUMCbPDOLv+un67e2JgyN4pmgfXBwy/I+RHu8q+k+MCkDN6P9ViQ==", + "version": "14.2.13", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.2.13.tgz", + "integrity": "sha512-4wWY7/OsSaJOOKvMsu1Teylku7vKyTuocvDLTZQq0TYv9OjiYYWt63PiE1nTuZnqQ4RPvME7Xai+9enoiN0Wrg==", "cpu": [ "x64" ], @@ -4528,9 +4529,9 @@ } }, "node_modules/@next/swc-win32-arm64-msvc": { - "version": "14.2.3", - "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.2.3.tgz", - "integrity": "sha512-AEHIw/dhAMLNFJFJIJIyOFDzrzI5bAjI9J26gbO5xhAKHYTZ9Or04BesFPXiAYXDNdrwTP2dQceYA4dL1geu8A==", + "version": "14.2.13", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.2.13.tgz", + "integrity": "sha512-uP1XkqCqV2NVH9+g2sC7qIw+w2tRbcMiXFEbMihkQ8B1+V6m28sshBwAB0SDmOe0u44ne1vFU66+gx/28RsBVQ==", "cpu": [ "arm64" ], @@ -4544,9 +4545,9 @@ } }, "node_modules/@next/swc-win32-ia32-msvc": { - "version": "14.2.3", - "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.2.3.tgz", - "integrity": "sha512-vga40n1q6aYb0CLrM+eEmisfKCR45ixQYXuBXxOOmmoV8sYST9k7E3US32FsY+CkkF7NtzdcebiFT4CHuMSyZw==", + "version": "14.2.13", + "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.2.13.tgz", + "integrity": "sha512-V26ezyjPqQpDBV4lcWIh8B/QICQ4v+M5Bo9ykLN+sqeKKBxJVDpEc6biDVyluTXTC40f5IqCU0ttth7Es2ZuMw==", "cpu": [ "ia32" ], @@ -4560,9 +4561,9 @@ } }, "node_modules/@next/swc-win32-x64-msvc": { - "version": "14.2.3", - "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.2.3.tgz", - "integrity": "sha512-Q1/zm43RWynxrO7lW4ehciQVj+5ePBhOK+/K2P7pLFX3JaJ/IZVC69SHidrmZSOkqz7ECIOhhy7XhAFG4JYyHA==", + "version": "14.2.13", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.2.13.tgz", + "integrity": "sha512-WwzOEAFBGhlDHE5Z73mNU8CO8mqMNLqaG+AO9ETmzdCQlJhVtWZnOl2+rqgVQS+YHunjOWptdFmNfbpwcUuEsw==", "cpu": [ "x64" ], @@ -5213,6 +5214,31 @@ "styled-components": "^6.1" } }, + "node_modules/@sanity/document-internationalization/node_modules/sanity-plugin-internationalized-array": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/sanity-plugin-internationalized-array/-/sanity-plugin-internationalized-array-2.1.0.tgz", + "integrity": "sha512-YpG8O3wdNbewsPNhSHZ13MYTPDqsf0Iz8eC6fB5hhDwttxcM6ftD40R1qXT73Ccl68X4DrbHi3bQzXC60E7D7g==", + "license": "MIT", + "dependencies": { + "@sanity/icons": "^2.11.7", + "@sanity/incompatible-plugin": "^1.0.4", + "@sanity/language-filter": "^4.0.2", + "@sanity/ui": "^2.1.0", + "fast-deep-equal": "^3.1.3", + "lodash": "^4.17.21", + "suspend-react": "0.1.3" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@sanity/ui": "^2.1.0", + "react": "^18", + "react-dom": "^18", + "sanity": "^3.36.4", + "styled-components": "^6.1" + } + }, "node_modules/@sanity/eventsource": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/@sanity/eventsource/-/eventsource-5.0.2.tgz", @@ -20375,12 +20401,12 @@ "license": "MIT" }, "node_modules/next": { - "version": "14.2.3", - "resolved": "https://registry.npmjs.org/next/-/next-14.2.3.tgz", - "integrity": "sha512-dowFkFTR8v79NPJO4QsBUtxv0g9BrS/phluVpMAt2ku7H+cbcBJlopXjkWlwxrk/xGqMemr7JkGPGemPrLLX7A==", + "version": "14.2.13", + "resolved": "https://registry.npmjs.org/next/-/next-14.2.13.tgz", + "integrity": "sha512-BseY9YNw8QJSwLYD7hlZzl6QVDoSFHL/URN5K64kVEVpCsSOWeyjbIGK+dZUaRViHTaMQX8aqmnn0PHBbGZezg==", "license": "MIT", "dependencies": { - "@next/env": "14.2.3", + "@next/env": "14.2.13", "@swc/helpers": "0.5.5", "busboy": "1.6.0", "caniuse-lite": "^1.0.30001579", @@ -20395,15 +20421,15 @@ "node": ">=18.17.0" }, "optionalDependencies": { - "@next/swc-darwin-arm64": "14.2.3", - "@next/swc-darwin-x64": "14.2.3", - "@next/swc-linux-arm64-gnu": "14.2.3", - "@next/swc-linux-arm64-musl": "14.2.3", - "@next/swc-linux-x64-gnu": "14.2.3", - "@next/swc-linux-x64-musl": "14.2.3", - "@next/swc-win32-arm64-msvc": "14.2.3", - "@next/swc-win32-ia32-msvc": "14.2.3", - "@next/swc-win32-x64-msvc": "14.2.3" + "@next/swc-darwin-arm64": "14.2.13", + "@next/swc-darwin-x64": "14.2.13", + "@next/swc-linux-arm64-gnu": "14.2.13", + "@next/swc-linux-arm64-musl": "14.2.13", + "@next/swc-linux-x64-gnu": "14.2.13", + "@next/swc-linux-x64-musl": "14.2.13", + "@next/swc-win32-arm64-msvc": "14.2.13", + "@next/swc-win32-ia32-msvc": "14.2.13", + "@next/swc-win32-x64-msvc": "14.2.13" }, "peerDependencies": { "@opentelemetry/api": "^1.1.0", @@ -24292,9 +24318,9 @@ } }, "node_modules/rollup": { - "version": "3.29.4", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.29.4.tgz", - "integrity": "sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw==", + "version": "3.29.5", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.29.5.tgz", + "integrity": "sha512-GVsDdsbJzzy4S/v3dqWPJ7EfvZJfCHiDqe80IyrF59LYuP+e6U1LJoUqeuqRbwAWoMNoXivMNeNAOf5E22VA1w==", "license": "MIT", "bin": { "rollup": "dist/bin/rollup" @@ -24562,15 +24588,15 @@ } }, "node_modules/sanity-plugin-internationalized-array": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/sanity-plugin-internationalized-array/-/sanity-plugin-internationalized-array-2.1.0.tgz", - "integrity": "sha512-YpG8O3wdNbewsPNhSHZ13MYTPDqsf0Iz8eC6fB5hhDwttxcM6ftD40R1qXT73Ccl68X4DrbHi3bQzXC60E7D7g==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/sanity-plugin-internationalized-array/-/sanity-plugin-internationalized-array-3.0.1.tgz", + "integrity": "sha512-Z5mvNQUFJkLVVRD8LKxYhMo4t4SxdASdeKWSQmcmx1Mi3QoyRsJb9zRWPuWhZkq3x+92W56tP0tc1GaV2Jj/RQ==", "license": "MIT", "dependencies": { - "@sanity/icons": "^2.11.7", + "@sanity/icons": "^3.3.1", "@sanity/incompatible-plugin": "^1.0.4", "@sanity/language-filter": "^4.0.2", - "@sanity/ui": "^2.1.0", + "@sanity/ui": "^2.8.8", "fast-deep-equal": "^3.1.3", "lodash": "^4.17.21", "suspend-react": "0.1.3" @@ -24579,13 +24605,25 @@ "node": ">=14" }, "peerDependencies": { - "@sanity/ui": "^2.1.0", - "react": "^18", - "react-dom": "^18", - "sanity": "^3.36.4", + "@sanity/ui": "^2.8.8", + "react": "^18.3", + "react-dom": "^18.3", + "sanity": "^3.52.4", "styled-components": "^6.1" } }, + "node_modules/sanity-plugin-internationalized-array/node_modules/@sanity/icons": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@sanity/icons/-/icons-3.4.0.tgz", + "integrity": "sha512-X8BMM68w3y5cuCLpPwV7jGhVNGgAL/FA3UI6JaRCsyVOahA6aBOeKdjFs5MHtKi8cmrKwq1a98h/HbrK56kszA==", + "license": "MIT", + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "react": "^18.3 || >=19.0.0-rc" + } + }, "node_modules/sanity-plugin-media": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/sanity-plugin-media/-/sanity-plugin-media-2.3.2.tgz", @@ -27656,9 +27694,9 @@ } }, "node_modules/vite": { - "version": "4.5.3", - "resolved": "https://registry.npmjs.org/vite/-/vite-4.5.3.tgz", - "integrity": "sha512-kQL23kMeX92v3ph7IauVkXkikdDRsYMGTVl5KY2E9OY4ONLvkHf04MDTbnfo6NKxZiDLWzVpP5oTa8hQD8U3dg==", + "version": "4.5.5", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.5.5.tgz", + "integrity": "sha512-ifW3Lb2sMdX+WU91s3R0FyQlAyLxOzCSCP37ujw0+r5POeHPwe6udWVIElKQq8gk3t7b8rkmvqC6IHBpCff4GQ==", "license": "MIT", "dependencies": { "esbuild": "^0.18.10", diff --git a/package.json b/package.json index 2239aa70e..0529d71e6 100644 --- a/package.json +++ b/package.json @@ -20,13 +20,14 @@ "@sanity/preview-url-secret": "^1.6.11", "@sanity/react-loader": "^1.9.15", "@sanity/vision": "^3.39.1", - "next": "14.2.3", + "next": "^14.2.13", "next-sanity": "^7.1.4", "next-sanity-image": "^6.1.1", "react": "^18.3.1", "react-dom": "^18.3.1", "react-focus-on": "^3.9.3", "sanity": "^3.57.3", + "sanity-plugin-internationalized-array": "^3.0.1", "sanity-plugin-media": "^2.3.2" }, "devDependencies": { diff --git a/studio/schemas/objects/link.ts b/studio/schemas/objects/link.ts index 51e966a8e..b68294b9b 100644 --- a/studio/schemas/objects/link.ts +++ b/studio/schemas/objects/link.ts @@ -1,9 +1,8 @@ -import { StringInputProps, defineField } from "sanity"; +import { defineField } from "sanity"; import AnchorSelect from "studio/components/AnchorSelect"; import LinkTypeSelector from "studio/components/LinkTypeSelector"; import NewTabSelector from "studio/components/NewTabSelector"; -import { StringInputWithCharacterCount } from "studio/components/stringInputWithCharacterCount/StringInputWithCharacterCount"; export const linkID = "link"; @@ -27,22 +26,25 @@ const lazyBlogID = () => "blog"; const lazyCompensationsID = () => "compensations"; const lazyCustomerCasesPageID = () => "customerCasesPage"; +const linkTitle = defineField({ + name: "linkTitle", + title: "Provide a link title", + type: "string", + description: "Enter the link text that will be displayed on the website.", + validation: (rule) => rule.max(60), + // adding custom components changes the internationalizedArrayString UI + // components: { + // input: (props: StringInputProps) => + // StringInputWithCharacterCount({ ...props, maxCount: 60 }), + // }, +}); + export const link = defineField({ name: linkID, title: "Link", type: "object", fields: [ - { - name: "linkTitle", - title: "Provide a link title", - type: "string", - description: "Enter the link text that will be displayed on the website.", - validation: (rule) => rule.max(60), - components: { - input: (props: StringInputProps) => - StringInputWithCharacterCount({ ...props, maxCount: 60 }), - }, - }, + { ...linkTitle, type: "internationalizedArrayString" }, { name: "linkType", title: "What type of link is this?", @@ -191,7 +193,7 @@ export const link = defineField({ prepare(selection) { const { title, type } = selection; return { - title: title, + title: title[0].value, subtitle: type ? type.charAt(0).toUpperCase() + type.slice(1) : "", }; },