Security News
Research
Supply Chain Attack on Rspack npm Packages Injects Cryptojacking Malware
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
lucid-extension-sdk
Advanced tools
TypeScript SDK for building in-editor extensions for the products of Lucid Software.
To get started building an extension for Lucid products, follow the instructions in
the lucid-package
CLI.
import {EditorClient, Menu, MenuType} from 'lucid-extension-sdk';
const client = new EditorClient();
const menu = new Menu(client);
client.registerAction('my-new-action', () => {
console.log('Hello world');
});
menu.addMenuItem({
label: 'Hello world',
action: 'my-new-action',
menuType: MenuType.Main,
});
import {DocumentProxy, EditorClient, Menu, MenuType, Viewport} from 'lucid-extension-sdk';
const client = new EditorClient();
const menu = new Menu(client);
const viewport = new Viewport(client);
const document = new DocumentProxy(client);
client.registerAction('create-content', async () => {
const page = document.addPage({title: 'Hello world'});
viewport.setCurrentPage(page);
//Before creating any blocks, you must make sure the code
//for that kind of block is loaded.
await client.loadBlockClasses(['ProcessBlock']);
let y = 0;
for (const char of 'Hello world') {
const block = page.addBlock({
className: 'ProcessBlock',
boundingBox: {
x: 0,
y,
w: 60,
h: 60,
},
});
const textAreaName = block.textAreas.keys()[0];
block.textAreas.set(textAreaName, char);
y += 80;
}
});
menu.addMenuItem({
label: 'Hello world',
action: 'create-content',
menuType: MenuType.Main,
});
import {EditorClient, Menu, MenuLocation, MenuType, Viewport} from 'lucid-extension-sdk';
const client = new EditorClient();
const menu = new Menu(client);
const viewport = new Viewport(client);
client.registerAction('download', async () => {
const page = viewport.getCurrentPage();
if (!page) {
return;
}
const csv: string[][] = [['Type', 'ID', 'Text', 'DataValue']];
for (const [id, block] of page?.allBlocks) {
csv.push([
block.getClassName(),
block.id,
block.textAreas.first() ?? '',
JSON.stringify(block.allShapeData.get('DataValue')),
]);
}
client.download('data.csv', csv.map((line) => line.join(',')).join('\n'), 'text/plain', false);
});
menu.addMenuItem({
label: 'Download CSV',
action: 'download',
menuType: MenuType.Main,
location: MenuLocation.Export, //Near File -> Export
});
This project is distributed under the Apache License, Version 2.0, see LICENSE for more information.
FAQs
Utility classes for writing Lucid Software editor extensions
The npm package lucid-extension-sdk receives a total of 11,627 weekly downloads. As such, lucid-extension-sdk popularity was classified as popular.
We found that lucid-extension-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.
Security News
Sonar’s acquisition of Tidelift highlights a growing industry shift toward sustainable open source funding, addressing maintainer burnout and critical software dependencies.