Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dvwd/paper-wysiwyg

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dvwd/paper-wysiwyg

A minimalistic yet powerful VueJs WYSIWYG built on Tiptap 2, inspired by Outline Wiki

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Paper Wysiwyg

A minimalistic yet powerful VueJS 2 WYSIWYG, built on TipTap 2 and inspired by Outline wiki

Install

npm install @dvwd/paper-wysiwyg

Dependencies

  • VueJS 2.X
  • Axios (for image uploads) @todo make optional

Usage

In a component.

<template>
  <paper-wysiwyg v-model="content"></paper-wysiwyg>
</template>
<script>
  import PaperWysiwyg from "@dvwd/paper-wysiwyg"

  export default {
    components: { PaperWysiwyg },
    data() {
      return {
        content: '<p>Hello world</p>',
      }
   }
}
</script>

Building

Docker

If node is not installed but docker is, just use the helper scripts to run npm.

Install dependencies
./node-docker.sh npm install
Build package (dist)
./node-docker.sh npm run build
Build demo
./node-docker.sh npm run build && ./node-docker.sh npm run build:demo

Image uploads

To enable uploads, you just have to add a upload-url prop. Eg

   <paper-wysiwyg upload-url="/post/backend/route"></paper-wysiwyg>

The upload route should return JSON array of saved file paths.

Once uploading is enabled, you can

  • Drag and drop an image
  • Paste an image from the clipboard
  • Click + and browse for an image

Example of a basic laravel backend route

<?php
Route::post('/upload/image', function(Request $request) {
    $files = [];
    
    if ($request->hasFile('images')) {
        $uploadedFiles = $request->file('images');
      
        foreach ($uploadedFiles as $file) {
            if (! $file->isValid()) {
              continue;
            }
            
            $name = uniqid().'_'.trim($file->getClientOriginalName());           
            $file->move(Storage::path('public/'.$path), $name);            
            $files[] = Storage::url($path.'/'.$name);
        }
    }
    
    return $files;
});

FAQs

Package last updated on 28 Jul 2022

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc