Giter VIP home page Giter VIP logo

web-component-designer's Introduction

web-component-designer

A HTML web component for designing web components and HTML pages based on PolymerLabs wizzywid which can easily be integrated in your own software. Meanwhile polymer is not used anymore.

image

There is also a Preview VS-Code Addon using the Designer: https://github.com/node-projects/vs-code-designer-addon

NPM Package

https://www.npmjs.com/package/@node-projects/web-component-designer

 npm i @node-projects/web-component-designer

Additional NPM Packages

All Modules wich need an external dependency are now extracted to extra NPM packges. So the designer now should work with bundlers.

Name Description
web-component-designer-codeview-ace
web-component-designer-codeview-codemirror
web-component-designer-codeview-codemirror5
web-component-designer-codeview-monaco
web-component-designer-htmlparserservice-base-custom-webcomponent
web-component-designer-htmlparserservice-lit-element
web-component-designer-htmlparserservice-nodehtmlparser
web-component-designer-miniatureview-html2canvas
web-component-designer-stylesheetservice-css-tools
web-component-designer-stylesheetservice-css-tree
web-component-designer-visualization-addons
web-component-designer-texteditextension-stylo deprecated - stylo is deprecated
web-component-designer-widgets-fancytree deprecated - replaced by widgets-wunderbaum
web-component-designer-widgets-wunderbaum

Browser support

  • At the moment Chrome, and Firefox Nightly with Experimental Import Assertions enabled. But when import Assertions are landing in Safari and Firefox they will work again. And you could transpile them away in the meantime.

Projects using it

A ZPL-Label Designer: (https://github.com/node-projects/web-component-designer-zpl-demo)

image

A Materialflow Layout Editor in a comercial Application: image

Demo

look at: https://node-projects.github.io/web-component-designer-demo/index.html repository: https://github.com/node-projects/web-component-designer-demo

or a simple one: https://node-projects.github.io/web-component-designer-simple-demo/index.html repository: https://github.com/node-projects/web-component-designer-simple-demo

What is needed

  • @node-projects/base-custom-webcomponent a very small basic webcomponent library (maybe this will be included directly later, to be dependecy free)
  • optional - ace code editor
  • optional - monaco code editor (if you use code-view-monaco)
  • optional - code mirror code editor (if you use code-view-codemirror) (workin but buggy)
  • optional - fancytree (if you use tree-view-extended, palette-tree-view or bindable-objects-browser)

Features we are workin on

https://github.com/node-projects/web-component-designer/issues

Developing

  • Install dependencies
  $ npm install
  • Compile typescript after doing changes
  $ npm run build (if you use Visual Studio Code, you can also run the build task via Ctrl + Shift + B > tsc:build - tsconfig.json)
  • Link node module
  $ npm link 

Using

At first you have to setup a service container providing services for history, properties, elements, ...

Code Editor

You can select to use one of 3 code editors available (ACE, CodeMirrow, Monaco). If you use one of the widgets, you need to include the JS lib in your index.html and then use the specific widget.

TreeView

We have 2 tree components. One independent and one feature rich which uses FancyTree (and cause of this it needs JQuery and JqueryUI).

DragDrop

If you'd like to use the designer on mobile, you need the mobile-drag-drop npm library. Your index.html should be extended as follows:

<link rel="stylesheet" href="/node_modules/mobile-drag-drop/default.css">
<script src="/node_modules/mobile-drag-drop/index.js"></script>

Copyright notice

The Library uses Images from the Chrome Dev Tools, see https://github.com/ChromeDevTools/devtools-frontend/tree/main/front_end/Images/src and https://github.com/ChromeDevTools/devtools-frontend/blob/main/LICENSE

web-component-designer's People

Contributors

7evenk avatar arrowp343 avatar cedricfranke28 avatar cristianiacobanu avatar dependabot[bot] avatar dfreedm avatar jogibear9988 avatar jrstanley avatar jzeyer avatar kkranich97 avatar lschirmbrand avatar notwaldorf avatar syu93 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

web-component-designer's Issues

Gulp Build Task

  • typescript build
  • polymer build (atm)
  • copy assets folder (dockspawn)

Miniature View

Like in WpfDesigner or SvgEdit

  • Clone complete designer Surface and display in miniature
  • respect Zoom factors

Planed Work on Designer in oct / nov

  • Fix Drag Items arround and resizieing (also when zoomed, snaplines, ...) (4days)

  • resize of element in all directions and mouse pointers for this (2 days)

  • possibility to recreate elemnt on property change (not all look for property changes) (1 day)

  • editors for invisible elements (script & style) (2 days)

  • drag into other layer (3 days)

  • basic treeview implementation (3 days)

  • copy/cut/paste workin (2 days)

Properties Abstraction

Create a Handler that can read out properties of different Frameworks
(lit-elements, polymer-elements, ...) it should also be able to support enums and provide values for them

XSS protection

I noticed that your preview canvas doesn't include the sandbox attribute. This would introduce Cross-Site Scripting (XSS) vulnerabilities. A malicious web component would be able to make requests as the user.

If you use sandbox="allow-scripts" then you'll close that vulnerability, but it also means redesigning your previous solution to use postMessage for cross-domain communication.

Selection Features

  • Possibility to select elements in the backgroun (like in iobroker.vis with context menu)
  • if background elment is selected, move it out of the background while selection active (look how this could be achived)

Work to do for RC1

  • Fix Click Overlay _lastTool handling, sometimes it is wrong. Needs to be reworked
  • Switch Containers with all selected elements
  • Switch of containers should be undoable
  • Resizeing has Problems with offset in control, so we alwas resize to a different point
  • Fixes when zoomed
  • Fixes when Designer canvas is not full size
  • Resize in all Directions
  • Bindings View and Parseing (sample for polymer)
  • Paste should paste with an offset
  • Draw new item into current container
  • Paste into current container
  • SVG Path should be modifyable
  • SVG Path Drawing
  • Flexbox Placement Service
  • Grid Placement Service
  • Grid Editor

Nice to have

  • Propertygrid work (special editor for grid, flexbox, like in dev tools)
  • Propertygrid Id editor

Add support for CSS Grid

We need real support for CSS Grid in the Designer:

  • Posssibility to Create Grids, define Columns, Rows, Areas, ...
  • Positioning in Grid so Components could be moved in Grid
  • Resizeing in Grid so Components could span more Grid Rows or Columns

Also basic Container Tasks need to be fixed:

  • Paste into container
  • Drag Elemnt directly into Container
  • How to position inside of the Container? (There are multiple possibilities in CSS like absolute via top/left/bottom/right, via transform, via margin, additional in grid: via order, via areaNames, ...)

Property Editors

  • Enum (Nullable)
  • Boolean (Nullable??)
  • String (Nullable)
  • Color (Nullable) (also support gradients)

In a far futire...

  • css - Animations

IFrame for Designer Canvas

Should wemaybe use an IFrame for our main designer Canvas? So most libs are not loaded into it?

We then need communication for selection, mouse events, ... and so on...

Abstraction for writing components...

We need a Abstraction to for writing the component to an output.

So we can realize different writers: Polymer3 writer, React, Page,...

Maybe the writer should directly implement property changes? Maybe we need this, or bindings could get lost?

Adding Custom Elements

Adding new custom elements with the format(element-element.js) not working. The element was built with polymer/[email protected]
Also, the property editor for the native elements is not functional.

Extend Path Drawing Tool

  • Move Path Points Arround
  • Bugfix for Move Path Points Arround (When pointer is moved to quickly the point will be lost)
  • Change Path Point To Bezier, Quadric Bezire (look at WPF Designer), Arc Segment
  • Close Path via Addon
  • Change Stroke Color when clicked
  • Change Fill Color When Clicked
  • Change Stroke Brush Size

Implement of a Side Toolbar

We should implement a Sidebar, wich is a UI for all the Design tools.

For this we also create a special Button wich shows a poppup, with different Tools to select on of it.

NPM Component Specification

Check what will be in the NPM Component, and how the component could be used in own application.
How will the TreeView, the Designer be connected?
Will the SourceEditor be part of the Designer (atm. I think not)
How could we define the component panels?

Add support for transformations and transformed resizing

As a user of the designer I want be able to transform the elements.
I'd like to be able to rotate & skew the elements. During rotation the current angle should be displayed. Maybe also resizing and movement via transform should be possible, but we need to decide how we differentiate it from the normal resize and move.

Also a transformed element should be resizable and movable after a transformation has been applied via the standard logic (which is not possible at the moment).
Also the resizing in all directions should work, at the moment only east south and south-east is working.

When an element is transformed, it would be nice if in the selection overlay the border of the element is drawn in it's transformend shape, and not only a rectangular completely around.

  • #146
  • Use elements transform origin for rotation instead of hard coded center.
  • Resizing of rotated element
  • Implement resizing in all directions
  • Pointer move event is wrongly triggered on a rotated element after pointer down
  • A rotated element changes width undesirably at the start of resizing
  • #153
  • #181
  • Automatically adjust overlay when margin/padding is set on element.
  • Make snaplines work even with transformed elements > it works
  • #180
  • #90
  • #101
  • #105
  • Placement jumps after west and north resizing
  • Show the transform origin correctly after a transformation
  • #147
  • #149
  • South west resize circle must be in the foreground. Try to resize new div. > 0bd83f1
  • #151
  • #152
  • #155
  • #160
  • #174
  • #187
  • #188
  • #192

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.