Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ddev/config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: simple-text
type: php
docroot: ""
php_version: "8.0"
php_version: "8.5"
webserver_type: nginx-fpm
router_http_port: "80"
router_https_port: "443"
Expand Down
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
/SECURITY.md export-ignore
/codeception.yml export-ignore
/composer.lock export-ignore
/ecs.php export-ignore
/pint.json export-ignore
/phpstan.neon export-ignore
/phpunit.xml export-ignore
/.prettierrc.json export-ignore
/.prettierignore export-ignore
/gruntfile.js export-ignore
Expand Down
20 changes: 18 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,26 @@ jobs:
name: ci
uses: craftcms/.github/.github/workflows/ci.yml@v3
with:
craft_version: '4'
jobs: '["ecs", "phpstan", "prettier"]'
craft_version: '6'
jobs: '["phpstan", "prettier"]'
notify_slack: true
slack_subteam: <!subteam^SGFL9NKNZ>
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
slack_webhook_url: ${{ secrets.SLACK_PLUGIN_WEBHOOK_URL }}
tests:
name: Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: '8.5'
extensions: bcmath, intl, pdo_sqlite, zip
coverage: none
- name: Install dependencies
run: composer install --no-interaction --no-progress --prefer-dist
- name: Check code style
run: composer check-cs
- name: Run tests
run: composer test
5 changes: 1 addition & 4 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
{
"**/*.php": [
"./vendor/bin/ecs check --ansi --fix",
"./vendor/bin/phpstan analyse"
],
"**/*.php": ["./vendor/bin/pint", "./vendor/bin/phpstan analyse"],
"*": "prettier --ignore-unknown --write"
}
6 changes: 1 addition & 5 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
*.md
*.php
composer.lock
cpresources/*
lib/*
src/templates/*
src/web/assets/**/dist/*
tests/_craft/*
vendor/*
.ddev/*
resources/js/behave.min.js
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Release Notes for Simple Text

## 4.0.0 - 2026-11-12

- Simple Text now requires Craft CMS 6.0 or later and PHP 8.5 or later, and runs natively on Craft 6 without the `craftcms/yii2-adapter` package.
- The plugin’s classes moved to the `CraftCms\SimpleText` namespace. Existing Simple Text fields are updated when you run `php artisan craft:up`. See [UPGRADE.md](UPGRADE.md).
- The field input is now Craft’s own monospaced textarea, which grows as you type, with Behave.js editing on top.
- With nothing selected, pressing <kbd>Tab</kbd> in the field now moves focus to the next control instead of inserting an indent. <kbd>Tab</kbd> and <kbd>Shift</kbd>+<kbd>Tab</kbd> still indent and outdent selected lines, and <kbd>Ctrl</kbd>/<kbd>Cmd</kbd>+<kbd>]</kbd> and <kbd>Ctrl</kbd>/<kbd>Cmd</kbd>+<kbd>[</kbd> indent and outdent the current line.
- The “Initial Rows” setting must now be 1 or more.

## 3.2.1 - 2026-11-10

- Simple Text now suggests the `craftcms/yii2-adapter` package, so the Plugin Store installs it alongside the plugin on Craft 6.

## 3.2.0 - 2026-11-10

- Added Craft 6 compatibility. Craft 6 sites need the `craftcms/yii2-adapter` package.

## 3.1.0 - 2024-03-19

- Added Craft 5 compatibility.
Expand Down
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,20 @@ This plugin adds a new “Simple Text” field type to Craft, which provides a t

- Uses a fixed-width font
- Automatically resizes
- Uses [Behave.js](http://jakiestfu.github.io/Behave.js/)
- Uses [Behave.js](https://github.com/iamso/Behave.js) to close brackets and quotes, indent new lines inside brackets, and continue lists when you press <kbd>Enter</kbd>

### Indenting

Indenting works the same way as in Craft’s Markdown fields, so you can still leave the field with the keyboard:

- <kbd>Tab</kbd> and <kbd>Shift</kbd>+<kbd>Tab</kbd> indent and outdent the selected lines. With nothing selected, they move focus to the next or previous control.
- <kbd>Ctrl</kbd>/<kbd>Cmd</kbd>+<kbd>]</kbd> and <kbd>Ctrl</kbd>/<kbd>Cmd</kbd>+<kbd>[</kbd> indent and outdent the current line or the selected lines.

## Requirements

This plugin requires Craft CMS 4.0.0+ or 5.0.0+.
This plugin requires Craft CMS 6.0 or later and PHP 8.5 or later.

For Craft 4 and 5, use Simple Text 3.x. If you’re upgrading from Simple Text 3.x, see [UPGRADE.md](UPGRADE.md).

## Installation

Expand All @@ -32,5 +41,5 @@ cd /path/to/my-project.test
composer require craftcms/simple-text

# tell Craft to install the plugin
./craft install/plugin simple-text
php artisan craft:plugin:install simple-text
```
59 changes: 59 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Upgrading to Simple Text 4.0 (Craft 6)

Simple Text 4.0 is a native Craft 6 plugin. This guide lists what changed from 3.x and what to update in your project.

## Requirements

- Craft CMS 6.0 or later
- PHP 8.5 or later
- The `craftcms/yii2-adapter` package is not needed.

## Upgrade steps

1. Upgrade your project to Craft 6 first.
2. Update the plugin: `composer require craftcms/simple-text:^4.0`.
3. Run `php artisan craft:up`. This points your existing Simple Text fields at the new field class, in the database and in project config.
4. Publish the plugin’s control panel scripts: `php artisan vendor:publish --tag=simple-text --force`. Craft only publishes them when a plugin is installed or enabled, so without this step Simple Text fields fail to load with a “component is not registered” error. Run it in every environment, and again after each Simple Text update.
5. If you use project config, commit the updated YAML files.

Field settings and saved values are kept, and templates keep working without changes: `{{ entry.myField }}` still outputs the saved text as a string.

## Breaking changes

### Classes and namespaces

| Before | After |
| --- | --- |
| `craft\simpletext\Plugin` | `CraftCms\SimpleText\Plugin` |
| `craft\simpletext\Field` | `CraftCms\SimpleText\Field` |
| `craft\simpletext\BehaveAsset` | Removed. Behave.js is loaded by the plugin’s control panel script. |

Update any code that refers to the old class names, such as type checks:

```php
// Before
if ($field instanceof \craft\simpletext\Field) {
// ...
}

// After
if ($field instanceof \CraftCms\SimpleText\Field) {
// ...
}
```

### Field input

The field input is now Craft’s monospaced textarea, which grows as you type. Behave.js still closes brackets and quotes, indents new lines inside brackets and continues lists, but <kbd>Tab</kbd> works the way it does in Craft’s Markdown fields, so keyboard users can leave the field:

- With nothing selected, <kbd>Tab</kbd> and <kbd>Shift</kbd>+<kbd>Tab</kbd> move focus to the next or previous control instead of inserting or removing an indent.
- With text selected, <kbd>Tab</kbd> and <kbd>Shift</kbd>+<kbd>Tab</kbd> indent and outdent the selected lines, as before.
- <kbd>Ctrl</kbd>/<kbd>Cmd</kbd>+<kbd>]</kbd> and <kbd>Ctrl</kbd>/<kbd>Cmd</kbd>+<kbd>[</kbd> indent and outdent the current line or the selected lines.

### Field settings

“Initial Rows” must now be 1 or more. Saving a field with a lower value, or an empty one, shows a validation error. Decimals are rounded down, as with Craft’s other whole-number settings.

## Need help?

Open an issue at https://github.com/craftcms/simple-text/issues.
11 changes: 0 additions & 11 deletions bower.json

This file was deleted.

49 changes: 31 additions & 18 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"html",
"cms",
"craftcms",
"yii2"
"laravel"
],
"license": "MIT",
"authors": [
Expand All @@ -19,41 +19,54 @@
"email": "support@craftcms.com",
"issues": "https://github.com/craftcms/simple-text/issues?state=open",
"source": "https://github.com/craftcms/simple-text",
"docs": "https://github.com/craftcms/simple-text/blob/main/README.md",
"rss": "https://github.com/craftcms/simple-text/commits/main.atom"
"docs": "https://github.com/craftcms/simple-text/blob/4.x/README.md",
"rss": "https://github.com/craftcms/simple-text/commits/4.x.atom"
},
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"craftcms/cms": "^4.0.0-RC3|^5.0.0-beta.1"
"php": "^8.5",
"craftcms/cms": "^6.0.0-beta.1"
},
"require-dev": {
"craftcms/ecs": "dev-main",
"craftcms/phpstan": "dev-main",
"craftcms/rector": "dev-main"
"larastan/larastan": "^3.13",
"laravel/pint": "^1.22",
"orchestra/testbench": "^11.0",
"pestphp/pest": "^5.0",
"pestphp/pest-plugin-laravel": "^5.0",
"phpstan/phpstan": "^2.1"
},
"autoload": {
"psr-4": {
"craft\\simpletext\\": "src/"
"CraftCms\\SimpleText\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"CraftCms\\SimpleText\\Tests\\": "tests/",
"CraftCms\\Cms\\Database\\Factories\\": "vendor/craftcms/cms/database/Factories/"
}
},
"scripts": {
"check-cs": "ecs check --ansi",
"fix-cs": "ecs check --ansi --fix",
"phpstan": "phpstan --memory-limit=1G"
"check-cs": "pint --test",
"fix-cs": "pint",
"phpstan": "phpstan --memory-limit=1G",
"test": "pest"
},
"extra": {
"class": "CraftCms\\SimpleText\\Plugin",
"name": "Simple Text",
"handle": "simple-text",
"documentationUrl": "https://github.com/craftcms/simple-text/blob/main/README.md"
"description": "A textarea that’s optimized for entering documentation",
"documentationUrl": "https://github.com/craftcms/simple-text/blob/4.x/README.md"
},
"config": {
"platform": {
"php": "8.0.2"
"php": "8.5"
},
"allow-plugins": {
"yiisoft/yii2-composer": true,
"craftcms/plugin-installer": true
"craftcms/plugin-installer": true,
"pestphp/pest-plugin": true
}
}
},
"minimum-stability": "dev",
"prefer-stable": true
}
Loading
Loading