Skip to content

Commit

Permalink
feat: enable by default in templates
Browse files Browse the repository at this point in the history
  • Loading branch information
johannes-lindgren committed Oct 9, 2024
1 parent 381fd16 commit 5bf71a7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/cli/templates/js/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ let previousType = 'loading'

// Establish communication with the Visual Editor
createFieldPlugin({
enablePortalModal: true,
validateContent: (content) => ({
content: typeof content === 'number' ? content : 0,
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions packages/cli/templates/vue2/src/fieldPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}),
Expand Down

0 comments on commit 5bf71a7

Please sign in to comment.