Product
Socket Now Supports uv.lock Files
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
@the-grid/ed
Advanced tools
npm start
:warning: WIP; not in production yet. :warning:
Using ProseMirror with data from the Grid API
Demo: the-grid.github.io/ed/
The demo shows translating from ProseMirror to the the Grid API JSON and back.
ProseMirror provides a high-level schema-based interface for interacting with contenteditable
, taking care of that pain. This project is focused on:
ed = new Ed({
// Where ed will mount
container: document.querySelector('#ed'),
// Content array from post
initialContent: [],
menutip: true,
menubar: false,
// Every change
onChange: function () {
/* App can show "unsaved changes" in UI */
/* Don't call ed.getContent() here */
},
// Optional imgflo image proxy config
imgfloConfig: {
server: 'https://imgflo.herokuapp.com/',
key: 'key',
secret: 'secret'
},
// Debounced changes
autosaveInterval: 100,
onAutosave: function () {
/* App chooses when to call ed.getContent() and save to API */
},
onShareFile: function (index) {
/* App makes placeholder block(s) and calls ed.insertBlocks(index, blocks) */
/* App uploads files and sets status on placeholder blocks with ed.setContent */
/* On upload / measurement finishing, app replaces placeholder blocks with ed.setContent */
},
onShareUrl: function ({block, url}) {
/* Ed made the placeholder with block id */
/* App shares url with given block id */
/* On share / measurement finishing, app replaces placeholder blocks with ed.setContent */
}
})
ed.setContent()
with full content once (or as constructor initialContent
option).
new Ed
.ed.setContent()
with only the blocks you want to update.ed.getContent()
takes some processing and should not be done on every change.Demo: ./demo/demo.js
npm start
and open http://localhost:8080/
In development mode, webpack builds and serves the targets in memory from /webpack/
Changes will trigger a browser refresh.
Plugins are ES2015 classes with 2 required methods:
constructor (ed) {}
gets a reference to the main ed
, where you can
ed.pm.on('draw', ...)
ed.pluginContainer.appendChild(...)
teardown () {}
where all listeners and UI should be removedWidgets are mini-editors built to edit specific media types
Run in iframe and communicate via postMessage
Example: ced - widget for code editing
Example: WIP
Feross standard checked by ESLint with npm test
or npm run lint
npm test
npm run build
Outputs minified dist/ed.js and copies widgets defined in package.json.
Travis will publish tags to npm and build the demo to publish to gh-pages.
0.3.0 - 2016-02-16
ed.insertBlocks
for file share flow (demo).
(Convenience method: app can still getContent
, splice blocks, setContent
.)FAQs
the grid api with prosemirror
The npm package @the-grid/ed receives a total of 9 weekly downloads. As such, @the-grid/ed popularity was classified as not popular.
We found that @the-grid/ed demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 19 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.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.