承接 oberon/quill-delta 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

oberon/quill-delta

Composer 安装命令:

composer require oberon/quill-delta

包简介

Compose the deltas of a quill editor history ops array. Port of npm library quill-delta

README 文档

README

This is a PHP port of the npm library quill-delta. Right now it only ports the compose function to compose the full history including all the retains and deletes to a final version with only the necessary inserts.

installation

Use composer

composer require oberon/quill-delta

usage

use Oberon\Quill\Delta\Composer;
    
$fullOps = [
    [
        "ops" => [
            ["insert" => "hello"],
        ],
    ],
    [
        "ops" => [
            ["retain" => 5],
            ["insert" => " world"],
        ],
    ],
];

$quilComposer = new Composer();
echo $quilComposer->compose($fullOps);

// {"ops":[{"insert":"hello world"}]}

or

use Oberon\Quill\Delta\Delta;

$fullOps = [
    [
        "ops" => [
            ["insert" => "hello"],
        ],
    ],
    [
        "ops" => [
            ["retain" => 5],
            ["insert" => " world"],
        ],
    ],
];

$output = array_reduce($fullOps, function(Delta $delta, $ops){
    $comp = $delta->compose(new Delta($ops));
    return $comp;
}, new Delta());

echo $output;

// {"ops":[{"insert":"hello world"}]}

notes

* only supports the delta compose method, diff and other utilities are not supported

统计信息

  • 总下载量: 77
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-07-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固