diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b74ec6..2e95725 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,10 +4,18 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 2.0.1 - 2022-12-02 +### Changed +- Updated to use craft-code-editor instead of craft-twigfield ([#87](https://github.com/besteadfast/craft-preparse-field/pull/87) - thanks @khalwat) + ## 2.0.0 - 2022-08-08 ### Added - Initial Craft 4 release +## 1.4.1 - 2022-12-02 +### Changed +- Updated to use craft-code-editor instead of craft-twigfield ([#86](https://github.com/besteadfast/craft-preparse-field/pull/86) - thanks @khalwat) + ## 1.4.0 - 2022-08-08 ### Added - Added support for craft-twigfield ([#81](https://github.com/besteadfast/craft-preparse-field/pull/81) - thanks @khalwat) diff --git a/composer.json b/composer.json index 9d529a9..dcf9382 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "besteadfast/craft-preparse-field", "description": "A fieldtype that parses Twig when an element is saved and saves the result as plain text.", "type": "craft-plugin", - "version": "2.0.0", + "version": "2.0.1", "keywords": [ "craft", "cms", @@ -29,7 +29,7 @@ ], "require": { "craftcms/cms": "^4.0.0", - "nystudio107/craft-twigfield": "^1.0.0", + "nystudio107/craft-code-editor": "^1.0.0", "php": "^8.0.2" }, "autoload": { diff --git a/src/templates/_components/fields/_settings.twig b/src/templates/_components/fields/_settings.twig index 65a2268..6ddf777 100644 --- a/src/templates/_components/fields/_settings.twig +++ b/src/templates/_components/fields/_settings.twig @@ -13,8 +13,13 @@ #} {% import "_includes/forms" as forms %} -{% import "twigfield/twigfield" as twigfield %} +{% import "codeeditor/codeEditor" as codeEditor %} +{% set monacoOptions = { +} %} +{% set codeEditorOptions = { + wrapperClass:"monaco-editor-background-frame" +} %} {{ twigfield.textareaField( { label: "Twig code to parse"|t, instructions: "Enter the twig code that you want to parse after the entry has been saved.\nIf the column type is set to Date (datetime), the parsed Twig should output a date formatted as `Y-m-d H:i:s`."|t, @@ -23,7 +28,7 @@ value: field['fieldTwig'], class: 'code', rows: 10, -}, "Twigfield", "monaco-editor-background-frame") }} +}, "CodeField", monacoOptions, codeEditorOptions) }} {% set columnType %} {{ forms.select({