From 5bf71a7225af03f223ab0ec2109c035e9ff18a2e Mon Sep 17 00:00:00 2001 From: Johannes Lindgren <14206504+johannes-lindgren@users.noreply.github.com> Date: Wed, 9 Oct 2024 16:17:06 +0200 Subject: [PATCH] feat: enable by default in templates --- packages/cli/templates/js/src/main.js | 1 + packages/cli/templates/react/src/components/FieldPlugin.tsx | 1 + packages/cli/templates/vue2/src/fieldPlugin.js | 1 + .../templates/vue3/src/components/FieldPluginExample/index.vue | 1 + 4 files changed, 4 insertions(+) diff --git a/packages/cli/templates/js/src/main.js b/packages/cli/templates/js/src/main.js index e8ddd8e4..5d54b82a 100644 --- a/packages/cli/templates/js/src/main.js +++ b/packages/cli/templates/js/src/main.js @@ -15,6 +15,7 @@ let previousType = 'loading' // Establish communication with the Visual Editor createFieldPlugin({ + enablePortalModal: true, validateContent: (content) => ({ content: typeof content === 'number' ? content : 0, }), diff --git a/packages/cli/templates/react/src/components/FieldPlugin.tsx b/packages/cli/templates/react/src/components/FieldPlugin.tsx index 66c07911..0e11db4b 100644 --- a/packages/cli/templates/react/src/components/FieldPlugin.tsx +++ b/packages/cli/templates/react/src/components/FieldPlugin.tsx @@ -3,6 +3,7 @@ import { useFieldPlugin } from '@storyblok/field-plugin/react' const FieldPlugin: FunctionComponent = () => { const plugin = useFieldPlugin({ + enablePortalModal: true, /* The `validateContent` parameter is optional. It allows you to - validate the content diff --git a/packages/cli/templates/vue2/src/fieldPlugin.js b/packages/cli/templates/vue2/src/fieldPlugin.js index 5ce69db0..f4cf2c24 100644 --- a/packages/cli/templates/vue2/src/fieldPlugin.js +++ b/packages/cli/templates/vue2/src/fieldPlugin.js @@ -4,6 +4,7 @@ import { createFieldPlugin } from '@storyblok/field-plugin' export const fieldPluginMixin = { created() { createFieldPlugin({ + enablePortalModal: true, validateContent: (content) => ({ content: typeof content === 'number' ? content : 0, }), diff --git a/packages/cli/templates/vue3/src/components/FieldPluginExample/index.vue b/packages/cli/templates/vue3/src/components/FieldPluginExample/index.vue index 324efd51..63df6e61 100644 --- a/packages/cli/templates/vue3/src/components/FieldPluginExample/index.vue +++ b/packages/cli/templates/vue3/src/components/FieldPluginExample/index.vue @@ -6,6 +6,7 @@ import AssetSelector from './AssetSelector.vue' import { useFieldPlugin } from '@storyblok/field-plugin/vue3' const plugin = useFieldPlugin({ + enablePortalModal: true, validateContent: (content: unknown) => ({ content: typeof content === 'number' ? content : 0, }),