riodwanto/filament-ace-editor 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

riodwanto/filament-ace-editor

Composer 安装命令:

composer require riodwanto/filament-ace-editor

包简介

An ACE editor field for Filament forms with syntax highlighting, themes, and autocompletion.

README 文档

README

Latest Version on Packagist Total Downloads

Ace Editor implementation for Filament Form.

Requirements

  • PHP 8.2+
  • Laravel 11.28+

Version Compatibility

Package Version Filament Version Status
4.1.0 4.x Latest ✨
1.x 3.x Stable ✅

Choose the package version that matches your Filament installation. We recommend using the latest compatible version for the best features and security updates.

Installation

You can install the package via composer:

composer require riodwanto/filament-ace-editor

The package will automatically detect your Filament version and install the compatible release.

Usage

use Riodwanto\FilamentAceEditor\AceEditor;

public function form(Form $form): Form
{
    return $form
        ->schema([
            ...
            AceEditor::make('code_editor')
                ->label('Code Editor')
                ->mode('php')
                ->theme('github')
                ->darkTheme('dracula')
                ->fontSize('14px')
                ->cursorStyle('smooth')
                ->softWrap('free')
                ->tabSize(4)
                ->useSoftTabs(true)
                ->addExtensions(['language_tools', 'beautify'])
                ->customCompletions([
                    'php' => [
                        ['caption' => 'dd()', 'value' => 'dd(${1:variable});', 'meta' => 'Laravel debug helper'],
                        ['caption' => 'collect()', 'value' => 'collect(${1:array});', 'meta' => 'Laravel collection'],
                    ]
                ]),
        ]);
}
Available methods
Method Info
mode change editor programming language
theme default theme in light mode
darkTheme default theme in dark mode
height set editor height
disableDarkTheme disable darkTheme, theme will be used as default
editorConfig editor config will be initialize after ace loaded. (it is config that used in ace.config)
editorOptions editor options used in ace.editor.options, you can set additional ace option here.
addExtensions by default, not all options available in editorOptions. you must enable extension first with this method.
headerTitle Editor tittle
fontSize Set font size using string (px, rem, em) or integer
cursorStyle Set cursor style: ace, slim, smooth, wide, smooth-slim
softWrap Control text wrapping behavior: off, free, printMargin, textWidth
showGutter Show/hide line numbers and breakpoints
showPrintMargin Show/hide vertical print margin line
foldStyle Set code folding style: manual, markbegin, markbeginend
tabSize Set tab size for indentation
useSoftTabs Use spaces instead of tabs for indentation

All default values can be found in the Configuration section below.

Publishing

You can publish the views using:

php artisan vendor:publish --tag="filament-ace-editor-views"

You can publish the config file with:

php artisan vendor:publish --tag="filament-ace-editor-config"

Configuration

This is the contents of the published config file:

return [
    ...

    'base_url' => 'https://cdnjs.cloudflare.com/ajax/libs/ace/1.43.3',
    'file' => 'ace.js',

    'editor_config' => [
        'useWorker' => false
    ],

    'editor_options' => [
        'mode' => 'ace/mode/php',
        'theme' => 'ace/theme/eclipse',
        'enableBasicAutocompletion' => true,
        'enableLiveAutocompletion' => true,
        'liveAutocompletionDelay' => 0,
        'liveAutocompletionThreshold' => 0,
        'enableSnippets' => true,
        'enableInlineAutocompletion' => true,
        'showPrintMargin' => true,
        'wrap' => 'off',
        'animatedScroll' => false,
        'fadeFoldWidgets' => false,
        'displayIndentGuides' => false,
        'highlightGutterLine' => false,
        'showInvisibles' => false,
    ],

    'dark_mode' => [
        'enable' => true,
        'theme' => 'ace/theme/dracula',
    ],

    'enabled_extensions' => [
        'beautify',
        'language_tools',
        'inline_autocomplete',
        'rtl',
        'statusbar',
        'whitespace',
        'searchbox',
    ],

    ...
];

Supported Features

This package supports most of the powerful features from Ace Editor:

Feature Support
Syntax highlighting themes ✅ Full
Automatic indent/outdent ✅ Full
Huge document handling ✅ Full
Search and replace ✅ Full
Line wrapping ✅ Full
Multiple cursors and selections ✅ Full
Autocompletion ✅ Full
Snippets ✅ Full
Custom key bindings ⚠️ Limited
Command line interface ❌ Not supported

Limited: Custom key bindings require additional configuration.

Buy Me A Coffee

Credits

License

The MIT License (MIT). Please see License File for more information.

riodwanto/filament-ace-editor 适用场景与选型建议

riodwanto/filament-ace-editor 是一款 基于 JavaScript 开发的 Composer 扩展包,目前已累计 74.3k 次下载、GitHub Stars 达 21, 最近一次更新时间为 2024 年 03 月 03 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「php」 「themes」 「autocomplete」 「laravel」 「admin-panel」 「ace-editor」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 riodwanto/filament-ace-editor 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 riodwanto/filament-ace-editor 我们能提供哪些服务?
定制开发 / 二次开发

基于 riodwanto/filament-ace-editor 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 74.3k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 21
  • 点击次数: 41
  • 依赖项目数: 5
  • 推荐数: 1

GitHub 信息

  • Stars: 21
  • Watchers: 1
  • Forks: 15
  • 开发语言: JavaScript

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-03-03