From fe3329e62090d2b0b1b7fed5742208e1464a357a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marti=CC=81n?= Date: Tue, 17 Dec 2024 13:15:16 +0100 Subject: [PATCH 1/2] Upgrade types internal --- package.json | 2 +- packages/adapter-next/package.json | 2 +- packages/adapter-nuxt/package.json | 2 +- packages/adapter-nuxt2/package.json | 2 +- packages/adapter-sveltekit/package.json | 2 +- packages/manager/package.json | 2 +- packages/plugin-kit/package.json | 2 +- packages/slice-machine/package.json | 2 +- packages/start-slicemachine/package.json | 2 +- playwright/package.json | 2 +- yarn.lock | 26 ++++++++++++------------ 11 files changed, 23 insertions(+), 23 deletions(-) diff --git a/package.json b/package.json index cb9ad4edc4..c9375ca286 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ "resolutions": { "connected-next-router/react-redux": "8.0.7", "react-beautiful-dnd/react-redux": "8.0.7", - "@prismicio/types-internal": "3.3.0-alpha.2", + "@prismicio/types-internal": "3.3.0", "express": "4.20.0" }, "workspaces": [ diff --git a/packages/adapter-next/package.json b/packages/adapter-next/package.json index 67b86be458..c79ec7a80e 100644 --- a/packages/adapter-next/package.json +++ b/packages/adapter-next/package.json @@ -67,7 +67,7 @@ }, "dependencies": { "@prismicio/simulator": "^0.1.4", - "@prismicio/types-internal": "3.3.0-alpha.2", + "@prismicio/types-internal": "3.3.0", "@slicemachine/plugin-kit": "workspace:*", "common-tags": "^1.8.2", "fp-ts": "^2.13.1", diff --git a/packages/adapter-nuxt/package.json b/packages/adapter-nuxt/package.json index c7b85b296c..aeaaec5908 100644 --- a/packages/adapter-nuxt/package.json +++ b/packages/adapter-nuxt/package.json @@ -60,7 +60,7 @@ }, "dependencies": { "@prismicio/simulator": "^0.1.4", - "@prismicio/types-internal": "3.3.0-alpha.2", + "@prismicio/types-internal": "3.3.0", "@slicemachine/plugin-kit": "workspace:*", "common-tags": "^1.8.2", "fp-ts": "^2.13.1", diff --git a/packages/adapter-nuxt2/package.json b/packages/adapter-nuxt2/package.json index c1a6dd35fc..cc30fd1a0f 100644 --- a/packages/adapter-nuxt2/package.json +++ b/packages/adapter-nuxt2/package.json @@ -60,7 +60,7 @@ }, "dependencies": { "@prismicio/simulator": "^0.1.4", - "@prismicio/types-internal": "3.3.0-alpha.2", + "@prismicio/types-internal": "3.3.0", "@slicemachine/plugin-kit": "workspace:*", "common-tags": "^1.8.2", "fp-ts": "^2.13.1", diff --git a/packages/adapter-sveltekit/package.json b/packages/adapter-sveltekit/package.json index 5dd7d1d547..6924f7761f 100644 --- a/packages/adapter-sveltekit/package.json +++ b/packages/adapter-sveltekit/package.json @@ -63,7 +63,7 @@ }, "dependencies": { "@prismicio/simulator": "^0.1.4", - "@prismicio/types-internal": "3.3.0-alpha.2", + "@prismicio/types-internal": "3.3.0", "@slicemachine/plugin-kit": "workspace:*", "common-tags": "^1.8.2", "fp-ts": "^2.13.1", diff --git a/packages/manager/package.json b/packages/manager/package.json index 05ffc169ee..46187b622d 100644 --- a/packages/manager/package.json +++ b/packages/manager/package.json @@ -68,7 +68,7 @@ "@prismicio/client": "^7.11.0", "@prismicio/custom-types-client": "2.1.0", "@prismicio/mocks": "2.5.0", - "@prismicio/types-internal": "3.3.0-alpha.2", + "@prismicio/types-internal": "3.3.0", "@segment/analytics-node": "^2.1.2", "@slicemachine/plugin-kit": "workspace:*", "cookie": "^1.0.1", diff --git a/packages/plugin-kit/package.json b/packages/plugin-kit/package.json index e223c0f2e4..cf63ab9c4a 100644 --- a/packages/plugin-kit/package.json +++ b/packages/plugin-kit/package.json @@ -76,7 +76,7 @@ }, "devDependencies": { "@prismicio/mock": "0.3.7", - "@prismicio/types-internal": "3.3.0-alpha.2", + "@prismicio/types-internal": "3.3.0", "@size-limit/preset-small-lib": "8.2.4", "@types/common-tags": "1.8.1", "@types/fs-extra": "11.0.1", diff --git a/packages/slice-machine/package.json b/packages/slice-machine/package.json index da1f39f42b..65d72308f5 100644 --- a/packages/slice-machine/package.json +++ b/packages/slice-machine/package.json @@ -49,7 +49,7 @@ "@prismicio/mock": "0.3.3", "@prismicio/mocks": "2.5.0", "@prismicio/simulator": "0.1.4", - "@prismicio/types-internal": "3.3.0-alpha.2", + "@prismicio/types-internal": "3.3.0", "@radix-ui/react-hover-card": "1.0.6", "@radix-ui/react-tabs": "1.0.4", "@reach/menu-button": "0.18.0", diff --git a/packages/start-slicemachine/package.json b/packages/start-slicemachine/package.json index ef8b4bfc44..466d5b123e 100644 --- a/packages/start-slicemachine/package.json +++ b/packages/start-slicemachine/package.json @@ -56,7 +56,7 @@ "bin": "./bin/start-slicemachine.js", "dependencies": { "@prismicio/mocks": "2.5.0", - "@prismicio/types-internal": "3.3.0-alpha.2", + "@prismicio/types-internal": "3.3.0", "@slicemachine/manager": "workspace:*", "body-parser": "^1.20.3", "chalk": "^4.1.2", diff --git a/playwright/package.json b/playwright/package.json index da4714c668..c5867652e8 100644 --- a/playwright/package.json +++ b/playwright/package.json @@ -15,7 +15,7 @@ "devDependencies": { "@msgpack/msgpack": "2.8.0", "@playwright/test": "1.39.0", - "@prismicio/types-internal": "3.3.0-alpha.2", + "@prismicio/types-internal": "3.3.0", "@slicemachine/manager": "workspace:*", "@typescript-eslint/eslint-plugin": "7.17.0", "@typescript-eslint/parser": "7.17.0", diff --git a/yarn.lock b/yarn.lock index 9d5f2f0211..2b9ce97a54 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6236,9 +6236,9 @@ __metadata: languageName: node linkType: hard -"@prismicio/types-internal@npm:3.3.0-alpha.2": - version: 3.3.0-alpha.2 - resolution: "@prismicio/types-internal@npm:3.3.0-alpha.2" +"@prismicio/types-internal@npm:3.3.0": + version: 3.3.0 + resolution: "@prismicio/types-internal@npm:3.3.0" dependencies: monocle-ts: ^2.3.11 newtype-ts: ^0.3.5 @@ -6248,7 +6248,7 @@ __metadata: fp-ts: ^2.11.8 io-ts: ^2.2.16 io-ts-types: ^0.5.16 - checksum: 7439e4bdd456059fae8cd0759a7abb64b14ee35876bfbb84609e0bbacfb396eb23141a88fcf7c340ffe03f0367b2f01e76df8d39133961f921f0950c1267961a + checksum: 898dba5cfd61e428d117f12ec59aa7146920593068222d7d0b0f67f95e0a822ff52b930353ca194c4aee887762e8edad8a11460994479bfb193956104dabe9ff languageName: node linkType: hard @@ -8980,7 +8980,7 @@ __metadata: dependencies: "@prismicio/mock": 0.2.0 "@prismicio/simulator": ^0.1.4 - "@prismicio/types-internal": 3.3.0-alpha.2 + "@prismicio/types-internal": 3.3.0 "@size-limit/preset-small-lib": 8.2.4 "@slicemachine/plugin-kit": "workspace:*" "@types/common-tags": 1.8.1 @@ -9025,7 +9025,7 @@ __metadata: dependencies: "@prismicio/mock": 0.2.0 "@prismicio/simulator": ^0.1.4 - "@prismicio/types-internal": 3.3.0-alpha.2 + "@prismicio/types-internal": 3.3.0 "@size-limit/preset-small-lib": 8.2.4 "@slicemachine/plugin-kit": "workspace:*" "@typescript-eslint/eslint-plugin": 5.55.0 @@ -9066,7 +9066,7 @@ __metadata: dependencies: "@prismicio/mock": 0.2.0 "@prismicio/simulator": ^0.1.4 - "@prismicio/types-internal": 3.3.0-alpha.2 + "@prismicio/types-internal": 3.3.0 "@size-limit/preset-small-lib": 8.2.4 "@slicemachine/plugin-kit": "workspace:*" "@types/common-tags": 1.8.1 @@ -9108,7 +9108,7 @@ __metadata: dependencies: "@prismicio/mock": 0.2.0 "@prismicio/simulator": ^0.1.4 - "@prismicio/types-internal": 3.3.0-alpha.2 + "@prismicio/types-internal": 3.3.0 "@size-limit/preset-small-lib": 8.2.4 "@slicemachine/plugin-kit": "workspace:*" "@sveltejs/kit": 2.0.0 @@ -9161,7 +9161,7 @@ __metadata: dependencies: "@msgpack/msgpack": 2.8.0 "@playwright/test": 1.39.0 - "@prismicio/types-internal": 3.3.0-alpha.2 + "@prismicio/types-internal": 3.3.0 "@slicemachine/manager": "workspace:*" "@typescript-eslint/eslint-plugin": 7.17.0 "@typescript-eslint/parser": 7.17.0 @@ -9231,7 +9231,7 @@ __metadata: "@prismicio/custom-types-client": 2.1.0 "@prismicio/mock": 0.2.0 "@prismicio/mocks": 2.5.0 - "@prismicio/types-internal": 3.3.0-alpha.2 + "@prismicio/types-internal": 3.3.0 "@segment/analytics-node": ^2.1.2 "@size-limit/preset-small-lib": 8.2.4 "@slicemachine/plugin-kit": "workspace:*" @@ -9289,7 +9289,7 @@ __metadata: dependencies: "@prismicio/client": ^7.11.0 "@prismicio/mock": 0.3.7 - "@prismicio/types-internal": 3.3.0-alpha.2 + "@prismicio/types-internal": 3.3.0 "@size-limit/preset-small-lib": 8.2.4 "@types/common-tags": 1.8.1 "@types/fs-extra": 11.0.1 @@ -31227,7 +31227,7 @@ __metadata: "@prismicio/mock": 0.3.3 "@prismicio/mocks": 2.5.0 "@prismicio/simulator": 0.1.4 - "@prismicio/types-internal": 3.3.0-alpha.2 + "@prismicio/types-internal": 3.3.0 "@radix-ui/react-hover-card": 1.0.6 "@radix-ui/react-tabs": 1.0.4 "@radix-ui/react-visually-hidden": 1.0.3 @@ -31705,7 +31705,7 @@ __metadata: resolution: "start-slicemachine@workspace:packages/start-slicemachine" dependencies: "@prismicio/mocks": 2.5.0 - "@prismicio/types-internal": 3.3.0-alpha.2 + "@prismicio/types-internal": 3.3.0 "@size-limit/preset-small-lib": 8.2.4 "@slicemachine/manager": "workspace:*" "@types/body-parser": 1.19.2 From 84d2279d4f7dd2d64736e8821e812896a219711e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marti=CC=81n?= Date: Tue, 17 Dec 2024 14:05:20 +0100 Subject: [PATCH 2/2] Focus newly added link variant option --- .../lib/models/common/widgets/Link/components.tsx | 13 ++++++++++++- .../legacy/lib/models/common/widgets/Link/index.ts | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/packages/slice-machine/src/legacy/lib/models/common/widgets/Link/components.tsx b/packages/slice-machine/src/legacy/lib/models/common/widgets/Link/components.tsx index cb697be2ab..c68f8b1c17 100644 --- a/packages/slice-machine/src/legacy/lib/models/common/widgets/Link/components.tsx +++ b/packages/slice-machine/src/legacy/lib/models/common/widgets/Link/components.tsx @@ -8,6 +8,7 @@ import { TextInput, Tooltip, } from "@prismicio/editor-ui"; +import { useRef } from "react"; import { Checkbox, Flex, Label } from "theme-ui"; import { Col } from "@/legacy/components/Flex"; @@ -122,6 +123,8 @@ export function Variants({ const deleteButtonShown = (variants?.length ?? 0) > 2; + const focusableInputIndex = useRef(); + return ( { + if (focusableInputIndex.current !== position) return; + focusableInputIndex.current = undefined; + ref?.focus(); + }} placeholder="Variant option (e.g. Primary)" value={variant} onValueChange={(newVariant) => @@ -194,7 +202,10 @@ export function Variants({ diff --git a/packages/slice-machine/src/legacy/lib/models/common/widgets/Link/index.ts b/packages/slice-machine/src/legacy/lib/models/common/widgets/Link/index.ts index 98ff95308f..2760bf1a57 100644 --- a/packages/slice-machine/src/legacy/lib/models/common/widgets/Link/index.ts +++ b/packages/slice-machine/src/legacy/lib/models/common/widgets/Link/index.ts @@ -79,7 +79,7 @@ export const linkConfigSchema = yup allowText: yup.boolean().strict().optional(), repeat: yup.boolean().strict().optional(), variants: yup - .array(yup.string().trim().required("values can't be empty")) + .array(yup.string().trim().required("Values can't be empty")) .optional(), }) .required()