Code Monkey home page Code Monkey logo

postit-js's Introduction

postit-js

Netlify Status Build Status

Create post-it brainstorming boards - built with diagram-js.

Screencast

Checkout the Demo or the Experiments Page to get some inspiration.

Features

  • Create resizable Post-its on the Canvas (squared and circled) via
    • Palette
    • Double Click (latest element type will be respected)
  • Change the color of Post-its
  • Create simple Text Boxes on the Canvas
  • Create grouping frame elements on the Canvas
  • Add external image resources on the Canvas

Installation

Install the package to include it into your web application

$ npm install postit-js-core --save

Usage

To get started, create a postit-js instance and render a post-it board into your web application

import 'postit-js-core/assets/postit-js.css';

import PostItModeler from 'postit-js-core/lib/Modeler';

let xml; // my post-it xml 

const modeler = new PostItModeler({
  container: '#canvas',
  keyboard: {
    bindTo: window,
  }
});

modeler.importXML(xml).then(function() {
  console.log('board rendered');
}).catch(function(error) {
  console.error('could not import postit board', err);
});

For using postit-js inside your web application you'll need a source code bundler, e.g. webpack. Checkout the example for getting inspiration.

Development Setup

Spin up the application for development, all strings attached:

$ npm install
$ cd  example
$ npm install
$ npm run dev

Extensions

Since diagram-js and also this project is extendable by design, there exist a couple of great community maintained extensions

License

MIT

Contains parts of (bpmn-io) released under the bpmn.io license.

postit-js's People

Contributors

dependabot[bot] avatar renovate[bot] avatar xanpj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

postit-js's Issues

Integrating Drag Drop

Let's think of a Drag n Drop Image Feature. What is the best place to integrate it in the lib? PostitEditorActions, PostitRules...?
With Base64 encoded upload for now.

Screen Shot 2020-06-05 at 6 02 41 PM

postinstall / .npmignore issue

Hej,

using npm install results in an FileNotFound error when running the postinstall script, since it can't find the directory ./example/ since it is an entry within .npmignore.

I'm not sure, what the expected behaviour would be, hence no PR. I tested it in my fork with both workarounds - seemingly working fine.

Cheers, qloikp

Grid Align Feature

Grid Align Feature

This will make elements in a group align into a grid and resize the group element to wrap around them.
How should this feature be activated?

  • Key command
  • Dedicated button in pallete
  • Button appearing in floating menu or top right menu when multiple elements are selected.

Screen Shot 2020-06-10 at 8 09 06 PM

Screen Shot 2020-06-10 at 8 08 50 PM

Need help

Hi,
I tried to understand the meta model implemented in the postit.json and postitDi.json and I've got some questions

  • I didn't find any reference on attributs isReadOnly, isVirtual and subsettedProperty in moddle doc, are they implemented or just unused attributs ?
  • whats the difference between PostitRootBoard and PostitPlane, why using this to elements for encapsulate drawing elements ? can we mix them into a unique element ?

Thanks a lot for your help and congratulation for your work.

css loader

Hello,
thank you for your help because I think it is a beginner mistake:

I have created a directory and installed postit-js-core: $ npm install postit-js-core --save
then I copied the example files in a subdirectory example and
followed ;
$ cd example
$ npm install
$ npm run dev
I have installed css-loader and style-loader in the main and subdirectoriy (in case of)

but I keep having this error:

ERROR in ../node_modules/postit-js-core/assets/postit-js.css (./node_modules/css-loader/dist/cjs.js!../node_modules/postit-js-core/assets/postit-js.css)
Module build failed (from ./node_modules/css-loader/dist/cjs.js):
Error: Can't resolve '../node_modules/diagram-js/assets/diagram-js.css' in 'C:\Users\thoma\OneDrive\SONEAR 2023\postit-js-scratch\node_modules\postit-js-core\assets'
at finishWithoutResolve (C:\Users\thoma\OneDrive\SONEAR 2023\postit-js-scratch\example\node_modules\enhanced-resolve\lib\Resolver.js:309:18)
at C:\Users\thoma\OneDrive\SONEAR 2023\postit-js-scratch\example\node_modules\enhanced-resolve\lib\Resolver.js:386:15
at C:\Users\thoma\OneDrive\SONEAR 2023\postit-js-scratch\example\node_modules\enhanced-resolve\lib\Resolver.js:435:5
at eval (eval at create (C:\Users\thoma\OneDrive\SONEAR 2023\postit-js-scratch\example\node_modules\tapable\lib\HookCodeFactory.js:33:10), :16:1)
at C:\Users\thoma\OneDrive\SONEAR 2023\postit-js-scratch\example\node_modules\enhanced-resolve\lib\Resolver.js:435:5
at eval (eval at create (C:\Users\thoma\OneDrive\SONEAR 2023\postit-js-scratch\example\node_modules\tapable\lib\HookCodeFactory.js:33:10), :27:1)
at C:\Users\thoma\OneDrive\SONEAR 2023\postit-js-scratch\example\node_modules\enhanced-resolve\lib\DescriptionFilePlugin.js:87:43
at C:\Users\thoma\OneDrive\SONEAR 2023\postit-js-scratch\example\node_modules\enhanced-resolve\lib\Resolver.js:435:5
at eval (eval at create (C:\Users\thoma\OneDrive\SONEAR 2023\postit-js-scratch\example\node_modules\tapable\lib\HookCodeFactory.js:33:10), :15:1)
at C:\Users\thoma\OneDrive\SONEAR 2023\postit-js-scratch\example\node_modules\enhanced-resolve\lib\Resolver.js:435:5
@ ../node_modules/postit-js-core/assets/postit-js.css 8:6-117 22:17-24 26:0-87 26:0-87 27:22-29 27:33-47 27:50-64
@ ./app/app.js 3:0-45

webpack 5.78.0 compiled with 1 error in 1905 ms

Ibm/iplex

Describe the Bug

I am trying to run a example you provided But getting an issue: Can't resolve '../node_modules/@ibm/plex/css/ibm-plex.min.css' in 'G:\postit-js\node_modules\postit-js-core\assets'
I tried to uninstall and install it again but same issue.
Steps to Reproduce

  1. do this
  2. do that
  3. now this happens

Expected Behavior

Environment

  • OS: [e.g. MacOS 10.2, Windows 10]
  • Library version: [e.g. 2.0.0]

Improve image selection

Currently, the component for setting the source of postit:Image elements is very rudimental

image

It is based on the browser native prompt feature, cf. ImageSelection module. This can be improved, e.g. by having a proper modal.

Follow up of #16

How to set businessObject attributes at creation time

Hi @pinussilvestrus
this time it's a question from my side.

I understand that attributes set in the xml are loaded as attributes ($attrs) inside the businessObject of an element. From then on they are meant to be read only.

What would be the best way to set the $attrs manually at creation time? (i.e. here)

const shape = _elementFactory.createShape({
      type: type,
      ...options,
  });

I am thinking of a scenario where I undo the history in the panel and need to recreate some elements. However, I want to set them as $attrs instead of object properties so that elements stay consistent with the way they'd look if they'd be loaded fresh from an xml.

I hope that makes sense.

Add support for custom svg or image elements

The Palette and Context Pad are offering a finite set of available elements to store on the board. Besides that different Tools offers a custom image possibility.

For example, Miro offers something like this

image

What has to be considered is how to store the custom element information (URL, svg data, ...). The best solution would be inside the XML.

Remove bpmn-moddle dependency

Currently, the moddle is built on top of the bpmn-moddle dependency. This should be removed to work independently.

This comes along with a major refactoring of some other components as well (importer, viewer, modeler, copy-paste)

Netlify experiments demo

Hi, how about netlifying the extension-experiments in the experiments branch instead of the live branch. The v2 extensions require a modified lib and less so they don't work on the master branch.

We could probably also remove extension-experiments/ in the master branch.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.