riley19280/miro-clipboard
Composer 安装命令:
composer require riley19280/miro-clipboard
包简介
Interact with the miro clipboard
README 文档
README
Introduction
miro-clipboard allows you to generate and parse Miro clipboard data,
allowing custom functionality to be built into existing applications with a simple Copy and Paste.
This package also serves to document the various properties and identifiers that are utilized in the clipboard data.
Creating Clipboard Data
Clipboard data is created using the MiroClipboardData class, and consists of multiple objects that can be added to it.
MiroClipboardData::make() ->addObject(MiroWidget::make()->shape(ShapeType::Circle)) ->toHtml();
The following object types are available:
Finally, the toHtml method is used to retrieve the Miro data string that can be pasted.
See Pasting clipboard data on how to properly paste into Miro.
Various methods are available on the Widget Objects to configure their position, size, style, and many other attributes. See below for a more complete example of what properties are available.
MiroShape Example
MiroWidget::make() ->shape(ShapeType::Star) ->text('Hello!') ->scale(.5) ->relativeScale(.5) ->rotation(90) ->relativeRotation(90) ->offsetPosition(50, 50) ->position(50, 50) ->size(50, 50) ->style(fn(MiroShapeStyle $style) => $style ->backgroundColor(16711680)->backgroundColor('#FF0000') ->backgroundOpacity(.5) ->borderColor(16711680)->borderColor('#FF0000') ->borderThickness(5) ->borderOpacity(.5) ->borderStyle(BorderStyle::DashLong) ->fontFamily('Arial') ->textColor(16711680)->textColor('#FF0000') ->textAlign(TextAlign::Left, VerticalTextAlign::Top) ->fontSize(11) ->bold() ->italic() ->underline() ->strikethrough() );
MiroLine Example
MiroWidget::make() ->line() ->addText( MiroLineText::make('Hello', .5, .5) ->color('#FF0000') ->color(16711680) ->rotated() ->fontSize(11) ->width(50) ) ->setPoints([ ['x' => 111.0, 'y' => 111.0], ['x' => 123.0, 'y' => 123.0], ['x' => 456.0, 'y' => 456.0], ['x' => 500.0, 'y' => 500.0], ]) ->style(fn(MiroLineStyle $style) => $style ->jump() ->type(LineType::Square) ->strokeWeight(4) ->color('#FF0000') ->color(16711680) ->startingLinecap(LineCap::Circle) ->endingLinecap(LineCap::CircleFilled) ->pattern(LinePattern::Dotted) );
Pasting clipboard data
In order to paste the data into Miro, the resulting string needs to be copied as the text/html content type,
which may or may not get applied depending on your computer. To combat this, a file called clipboardLoader.html
is included in this repository. It provides a way to load the copied string into the clipboard as the correct content type
so that it can be pasted into Miro.
If you are using this package to integrate into an existing application, then you will want to do something similar to load the data directly.
Parsing Clipboard Data
Existing clipboard data can also be parsed into objects. This is done using the MiroParser class.
$clipboardData = MiroClipboardData::parse('<your clipboard string>');
This results in a MiroClipboardData object.
riley19280/miro-clipboard 适用场景与选型建议
riley19280/miro-clipboard 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 8 次下载、GitHub Stars 达 2, 最近一次更新时间为 2023 年 12 月 19 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 riley19280/miro-clipboard 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 riley19280/miro-clipboard 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 8
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 11
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-12-19