From 124d33fd86b773777d0defe52b1d6807b06a596f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9?= <583546+oandregal@users.noreply.github.com> Date: Fri, 14 Apr 2023 14:14:06 +0200 Subject: [PATCH 1/3] API for register/unregister variations from theme.json --- lib/theme.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/theme.json b/lib/theme.json index 88befe6dff2ed..8809a0690e389 100644 --- a/lib/theme.json +++ b/lib/theme.json @@ -450,6 +450,18 @@ "style": true, "width": true } + }, + "core/quote": { + "variations": { + "plain": false, + "large": { + "name": "large", + "label": "Large", + "inlineStyle": "", + "styleHandle": "", + "isDefault": true + } + } } } }, From 67cdd8eab39679f2914a7b81a49cdf9f88fed0cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9?= <583546+oandregal@users.noreply.github.com> Date: Fri, 14 Apr 2023 16:46:33 +0200 Subject: [PATCH 2/3] Add i18n schema --- lib/theme-i18n.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/theme-i18n.json b/lib/theme-i18n.json index 469783409c891..f3c4a5021eb8c 100644 --- a/lib/theme-i18n.json +++ b/lib/theme-i18n.json @@ -69,6 +69,11 @@ "name": "Space size name" } ] + }, + "variations": { + "*": { + "label": "Name of style variation" + } } } } From f38202950dbe9ba7e8408ef5757d7b33658e064c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9?= <583546+oandregal@users.noreply.github.com> Date: Fri, 14 Apr 2023 17:49:27 +0200 Subject: [PATCH 3/3] More tests --- lib/theme-i18n.json | 2 +- lib/theme.json | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/lib/theme-i18n.json b/lib/theme-i18n.json index f3c4a5021eb8c..85b3bca157eae 100644 --- a/lib/theme-i18n.json +++ b/lib/theme-i18n.json @@ -72,7 +72,7 @@ }, "variations": { "*": { - "label": "Name of style variation" + "label": "Style variation name" } } } diff --git a/lib/theme.json b/lib/theme.json index 8809a0690e389..bab912bdce184 100644 --- a/lib/theme.json +++ b/lib/theme.json @@ -452,15 +452,25 @@ } }, "core/quote": { - "variations": { - "plain": false, - "large": { + "variations": [ + { "name": "large", - "label": "Large", + "label": "Large using array", "inlineStyle": "", "styleHandle": "", "isDefault": true } + ] + }, + "core/paragraph": { + "variations": { + "large": { + "label": "Large using object", + "inlineStyle": "", + "styleHandle": "", + "isDefault": true + }, + "toUnregister": false } } }