Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
@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 6 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
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.