From 5327fba8640399316694daae4e5f4ea93c3c7e0d Mon Sep 17 00:00:00 2001 From: Andrew Welch Date: Tue, 1 Nov 2022 14:34:35 -0400 Subject: [PATCH 1/2] refactor: Use Code Editor instead of Twigfield --- composer.json | 2 +- src/templates/_components/fields/_settings.twig | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 9d529a9..e6563a4 100644 --- a/composer.json +++ b/composer.json @@ -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({ From 207a353d81637dd96ed7a9fc57a63013b3ea8e28 Mon Sep 17 00:00:00 2001 From: Jalen Davenport Date: Fri, 2 Dec 2022 18:46:21 -0500 Subject: [PATCH 2/2] Prepare 2.0.1 release --- CHANGELOG.md | 8 ++++++++ composer.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) 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 e6563a4..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",