Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
@gaoding/editor-sdk
Advanced tools
Chrome >= 60
Firefox >= 55
Safari >= 14
Edge >= 16
yarn add @gaoding/editor-sdk
#or
npm install @gaoding/editor-sdk
打开指定模板
import { createTemplateEditor } from '@gaoding/editor-sdk';
const editor = createTemplateEditor({
appId: '在稿定开放平台应用详情里查看',
});
const res = await editor.openTemplate({ id: '模板ID', }); // 如果 res 为 false 表示没有进行导出操作 if (res) { // files 为导出的文件数组, urls 为导出的文件 url 地址 const { files, urls } = res; // ...do something }
导入文件, 比如 PSD,PPTX,AI
import { createTemplateEditor } from '@gaoding/editor-sdk';
const editor = createTemplateEditor({
appId: '在稿定开放平台应用详情里查看',
});
const res = await editor.importFile();
// 如果 res 为 false 表示没有进行导出操作
if (res) {
// files 为导出的文件数组, urls 为导出的文件 url 地址
const { files, urls } = res;
// ...do something
}
创建空白画布
import { createTemplateEditor } from '@gaoding/editor-sdk';
const editor = createTemplateEditor({
appId: '在稿定开放平台应用详情里查看',
});
const res = await editor.create({ width: 500, height: 500, categoryId: 1 });
// 如果 res 为 false 表示没有进行导出操作
if (res) {
// files 为导出的文件数组, urls 为导出的文件 url 地址
const { files, urls } = res;
// ...do something
}
导入文件
import { createImageEditor } from '@gaoding/editor-sdk';
const editor = createImageEditor({
appId: '在稿定开放平台应用详情里查看',
});
// editor.importFile(file: string | Blob) 支持 Blob 文件 和 url
// 如果如果传的是 url 需要保证支持跨域
const res = await editor.importFile(
'https://st0.dancf.com/static/02/202104280445-9936.png',
);
// 如果 res 为 false 表示没有进行导出操作
if (res) {
// files 为导出的文件数组, urls 为导出的文件 url 地址
const { files, urls } = res;
// ...do something
}
导入文件
import { createKoutuEditor } from '@gaoding/editor-sdk';
const editor = createKoutuEditor({
appId: '在稿定开放平台应用详情里查看',
});
// editor.importFile(file: string | Blob) 支持 Blob 文件 和 url
// 如果如果传的是 url 需要保证支持跨域
const res = await editor.importFile(
'https://st0.dancf.com/static/02/202104280445-9936.png',
);
// 如果 res 为 false 表示没有进行导出操作
if (res) {
// urls 为导出的文件 url 地址
const { urls } = res;
// ...do something
}
高级版
import { createKoutuEditor } from '@gaoding/editor-sdk';
const editor = createKoutuEditor({
appId: '在稿定开放平台应用详情里查看',
version: 'KE002',
async getUseRightToken(info) {
// 使用权益的API
return request
.post('/demo-api/use-certs', {
app_id: info.appId,
ability_code: info.abilityCode,
})
.then(res => res.data);
},
getUserCode() {
// 获取用户授权码的API
return request
.get('/demo-api/authorized/code', {
params: { app_id: formData.appId },
})
.then(res => res.data);
},
});
// editor.importFile(file: string | Blob) 支持 Blob 文件 和 url
// 如果如果传的是 url 需要保证支持跨域
const res = await editor.importFile(
'https://st0.dancf.com/static/02/202104280445-9936.png',
);
// 如果 res 为 false 表示没有进行导出操作
if (res) {
// urls 为导出的文件 url 地址
const { urls } = res;
// ...do something
}
FAQs
稿定编辑器对外 SDK
The npm package @gaoding/editor-sdk receives a total of 1 weekly downloads. As such, @gaoding/editor-sdk popularity was classified as not popular.
We found that @gaoding/editor-sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 15 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.