diff --git a/packages/form-js-playground/src/Playground.js b/packages/form-js-playground/src/Playground.js index 97190b88c..57d861f8c 100644 --- a/packages/form-js-playground/src/Playground.js +++ b/packages/form-js-playground/src/Playground.js @@ -29,7 +29,7 @@ import { PlaygroundRoot } from './components/PlaygroundRoot'; /** * @param {FormPlaygroundOptions} options */ -export default function Playground(options) { +export function Playground(options) { const { container: parent, diff --git a/packages/form-js-playground/src/components/JSONEditor.js b/packages/form-js-playground/src/components/JSONEditor.js index 664cbc46e..36d1e7646 100644 --- a/packages/form-js-playground/src/components/JSONEditor.js +++ b/packages/form-js-playground/src/components/JSONEditor.js @@ -6,8 +6,7 @@ import { EditorState, Compartment } from '@codemirror/state'; import { lintGutter, linter } from '@codemirror/lint'; import { json, jsonParseLinter } from '@codemirror/lang-json'; import { indentWithTab } from '@codemirror/commands'; - -import autocompletion from './autocompletion/index'; +import { autocompletionExtension } from './autocompletion/index'; import { variablesFacet } from './autocompletion/VariablesFacet'; import { @@ -70,7 +69,7 @@ export function JSONEditor(options = {}) { placeholderLinterExtension, lintGutter(), autocompletionConf.of(variablesFacet.of(variables)), - autocompletion(), + autocompletionExtension(), keymap.of([ indentWithTab ]), editorPlaceholder ? placeholder(editorPlaceholder) : [], ...extensions diff --git a/packages/form-js-playground/src/components/autocompletion/index.js b/packages/form-js-playground/src/components/autocompletion/index.js index f042ef034..377c77c73 100644 --- a/packages/form-js-playground/src/components/autocompletion/index.js +++ b/packages/form-js-playground/src/components/autocompletion/index.js @@ -1,10 +1,9 @@ import { autocompletion } from '@codemirror/autocomplete'; +import { variablesFacet } from './VariablesFacet'; import { syntaxTree } from '@codemirror/language'; -import { variablesFacet } from './VariablesFacet'; - -export default function() { +export function autocompletionExtension() { return [ autocompletion({ override: [ diff --git a/packages/form-js-playground/src/index.js b/packages/form-js-playground/src/index.js index a36d7ef16..78b5d2ba0 100644 --- a/packages/form-js-playground/src/index.js +++ b/packages/form-js-playground/src/index.js @@ -1 +1 @@ -export { default as Playground } from './Playground'; \ No newline at end of file +export { Playground } from './Playground'; \ No newline at end of file diff --git a/packages/form-js-playground/test/custom/editor.js b/packages/form-js-playground/test/custom/editor.js index c913a77b4..f659dd821 100644 --- a/packages/form-js-playground/test/custom/editor.js +++ b/packages/form-js-playground/test/custom/editor.js @@ -140,7 +140,7 @@ function Step(props) { } -export default { +export const CustomPropertiesProviderModule = { __init__: [ 'customPropertiesProvider' ], customPropertiesProvider: [ 'type', CustomPropertiesProvider ] }; diff --git a/packages/form-js-playground/test/custom/viewer.js b/packages/form-js-playground/test/custom/viewer.js index 8b31f5199..8ffc4b1ef 100644 --- a/packages/form-js-playground/test/custom/viewer.js +++ b/packages/form-js-playground/test/custom/viewer.js @@ -1,4 +1,3 @@ - import { Errors, FormContext, @@ -93,7 +92,7 @@ class CustomFormFields { } } -export default { +export const CustomFormFieldsModule = { __init__: [ 'customFormFields' ], customFormFields: [ 'type', CustomFormFields ] }; diff --git a/packages/form-js-playground/test/spec/Playground.spec.js b/packages/form-js-playground/test/spec/Playground.spec.js index c9c8cb888..d8a4bfdba 100644 --- a/packages/form-js-playground/test/spec/Playground.spec.js +++ b/packages/form-js-playground/test/spec/Playground.spec.js @@ -19,8 +19,8 @@ import otherSchema from './other-form.json'; import rowsSchema from './rows-form.json'; import customSchema from './custom.json'; -import customViewerModule from '../custom/viewer'; -import customEditorModule from '../custom/editor'; +import { CustomFormFieldsModule } from '../custom/viewer'; +import { CustomPropertiesProviderModule } from '../custom/editor'; import customStyles from '../custom/styles.css'; import { @@ -152,10 +152,10 @@ describe('playground', function() { schema: customSchema, data, additionalModules: [ - customViewerModule + CustomFormFieldsModule ], editorAdditionalModules: [ - customEditorModule + CustomPropertiesProviderModule ] });