├── .gitignore ├── LICENSE ├── README.md ├── bower.json ├── deploy-to-pages.sh ├── elements.json ├── images ├── fav.png ├── fav2.png ├── logo100.png ├── logo512.png └── sshot.png ├── index.html ├── manifest.json ├── polymer.json ├── src ├── action-history.html ├── app-controls.html ├── app-icons.html ├── app.js ├── canvas │ ├── canvas-controls.html │ └── canvas-view.html ├── components │ ├── designer-tab.html │ ├── designer-tabs.html │ ├── icon-picker.html │ └── tree-view.html ├── element-view │ ├── element-properties.html │ ├── element-property.html │ ├── element-stuff-base.html │ ├── element-stuff-flex.html │ ├── element-stuff-shared-styles.html │ ├── element-stuff-styles.html │ └── element-view.html ├── palette │ ├── palette-list.html │ ├── palette-shared-styles.html │ └── palette-view.html └── the-app.html └── test └── the-app └── the-app_test.html /.gitignore: -------------------------------------------------------------------------------- 1 | bower_components 2 | designer 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2017, Preet Shihn 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | * Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Wired Designer 2 | 3 | This is a very simple wysiwyg style designer for createing mockups and wireframes. 4 | 5 | [Launch designer](https://wiredjs.github.io/designer) 6 | 7 | The sketchy, hand-drawn looking components used by the designer are stand alone functional webcomponents, and can be used by anyone in their web app.
8 | [Wired elements on webcomponents.org](https://www.webcomponents.org/collection/wiredjs/wired-elements) 9 | 10 | The designer app is adapted from [Polymer's wizzywid](https://github.com/PolymerLabs/wizzywid) 11 | 12 | Built with webcomponents and Polymer. 13 | 14 | License: [BSD-3-Clause](https://github.com/wiredjs/designer/blob/master/LICENSE)
15 | Author: [Preet Shihn](https://twitter.com/preetster) 16 | 17 | ![Wired Designer](https://wiredjs.github.io/designer/images/sshot.png) 18 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "wired-designer", 3 | "description": "Mockups and wireframing tool built using web components, and is open source.", 4 | "main": "index.html", 5 | "authors": [ 6 | "Preet Shihn " 7 | ], 8 | "dependencies": { 9 | "polymer": "Polymer/polymer#^2.0.0", 10 | "iron-flex-layout": "PolymerElements/iron-flex-layout#^2.0.0", 11 | "iron-pages": "PolymerElements/iron-pages#^2.0.0", 12 | "iron-ajax": "^2.0.5", 13 | "wired-elements": "^0.2.3", 14 | "paper-toggle-button": "PolymerElements/paper-toggle-button#^2.0.0", 15 | "iron-icons": "^2.0.1" 16 | }, 17 | "license": "BSD-3", 18 | "private": true 19 | } 20 | -------------------------------------------------------------------------------- /deploy-to-pages.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | # Based on https://github.com/Polymer/tools/blob/master/bin/gp.sh 4 | 5 | # This script pushes a demo-friendly version of your element and its 6 | # dependencies to gh-pages. 7 | 8 | # Run in a clean directory passing in a GitHub org and repo name 9 | org="wiredjs" 10 | repo="designer" 11 | #branch="master" # default to master when branch isn't specified 12 | 13 | # make folder (same as input, no checking!) 14 | rm -rf $repo 15 | mkdir $repo 16 | git clone https://github.com/$org/$repo.git --single-branch 17 | 18 | # switch to gh-pages branch 19 | pushd $repo >/dev/null 20 | git checkout --orphan gh-pages 21 | 22 | # remove the .gitignore since we're going to be pushing deps 23 | git rm -rf ./.gitignore 24 | git rm -rf ./bower_components 25 | 26 | # use bower to install runtime deployment 27 | bower cache clean # ensure we're getting the latest from the desired branch. 28 | # install the bower deps 29 | bower install 30 | 31 | # send it all to github 32 | git add -A . 33 | git commit -am 'seed gh-pages' 34 | git push -u origin gh-pages --force 35 | 36 | popd >/dev/null -------------------------------------------------------------------------------- /elements.json: -------------------------------------------------------------------------------- 1 | { 2 | "elements": [ 3 | { 4 | "name": "wired-card", 5 | "label": "Card (Container)", 6 | "styles": [ 7 | { 8 | "name": "width", 9 | "value": "150px" 10 | }, 11 | { 12 | "name": "height", 13 | "value": "150px" 14 | } 15 | ] 16 | }, 17 | { 18 | "name": "wired-item", 19 | "label": "Combo/List item", 20 | "disableSizing": true, 21 | "properties": [ 22 | { 23 | "name": "text", 24 | "value": "item" 25 | }, 26 | { 27 | "name": "value", 28 | "value": "item" 29 | } 30 | ] 31 | }, 32 | { 33 | "name": "wired-button", 34 | "label": "Button", 35 | "properties": [ 36 | { 37 | "name": "text", 38 | "value": "Button" 39 | } 40 | ] 41 | }, 42 | { 43 | "name": "wired-checkbox", 44 | "label": "Checkbox", 45 | "disableSizing": true, 46 | "properties": [ 47 | { 48 | "name": "text", 49 | "value": "Checkbox text" 50 | } 51 | ] 52 | }, 53 | { 54 | "name": "wired-combo", 55 | "label": "Combo box", 56 | "disableSizing": true 57 | }, 58 | { 59 | "name": "wired-input", 60 | "label": "Text input", 61 | "properties": [ 62 | { 63 | "name": "placeholder", 64 | "value": "Placeholder" 65 | } 66 | ] 67 | }, 68 | { 69 | "name": "wired-listbox", 70 | "label": "List box", 71 | "styles": [ 72 | { 73 | "name": "width", 74 | "value": "80px" 75 | }, 76 | { 77 | "name": "height", 78 | "value": "100px" 79 | } 80 | ] 81 | }, 82 | { 83 | "name": "wired-progress", 84 | "label": "Progress bar" 85 | }, 86 | { 87 | "name": "wired-radio", 88 | "label": "Radio", 89 | "disableSizing": true, 90 | "properties": [ 91 | { 92 | "name": "text", 93 | "value": "Radio_text" 94 | } 95 | ] 96 | }, 97 | { 98 | "name": "wired-radio-group", 99 | "label": "Radio group", 100 | "styles": [ 101 | { 102 | "name": "width", 103 | "value": "80px" 104 | }, 105 | { 106 | "name": "height", 107 | "value": "100px" 108 | } 109 | ] 110 | }, 111 | { 112 | "name": "wired-textarea", 113 | "label": "Multiline text input", 114 | "properties": [ 115 | { 116 | "name": "placeholder", 117 | "value": "Placeholder" 118 | } 119 | ] 120 | }, 121 | { 122 | "name": "wired-toggle", 123 | "label": "Toggle switch", 124 | "disableSizing": true 125 | }, 126 | { 127 | "name": "wired-icon-button", 128 | "label": "Icon button" 129 | }, 130 | { 131 | "name": "wired-slider", 132 | "label": "Slider" 133 | }, 134 | { 135 | "name": "wired-spinner", 136 | "label": "Spinner" 137 | }, 138 | { 139 | "name": "a", 140 | "native": true, 141 | "label": "Link", 142 | "textContent": "Link text" 143 | }, 144 | { 145 | "name": "p", 146 | "native": true, 147 | "label": "Text", 148 | "textContent": "Lorem ipsum dolor sit amet..." 149 | }, 150 | { 151 | "name": "img", 152 | "native": true, 153 | "noCloseTag": true, 154 | "label": "Image", 155 | "styles": [ 156 | { 157 | "name": "minWidth", 158 | "value": "20px" 159 | }, 160 | { 161 | "name": "minHeight", 162 | "value": "20px" 163 | } 164 | ] 165 | }, 166 | { 167 | "name": "h1", 168 | "native": true, 169 | "label": "Title", 170 | "textContent": "Title" 171 | }, 172 | { 173 | "name": "h2", 174 | "native": true, 175 | "label": "Title 2", 176 | "textContent": "Smaller title" 177 | } 178 | ] 179 | } -------------------------------------------------------------------------------- /images/fav.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiredjs/designer/9e8d3381a869ff9163177e9c38aae89fe2475edd/images/fav.png -------------------------------------------------------------------------------- /images/fav2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiredjs/designer/9e8d3381a869ff9163177e9c38aae89fe2475edd/images/fav2.png -------------------------------------------------------------------------------- /images/logo100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiredjs/designer/9e8d3381a869ff9163177e9c38aae89fe2475edd/images/logo100.png -------------------------------------------------------------------------------- /images/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiredjs/designer/9e8d3381a869ff9163177e9c38aae89fe2475edd/images/logo512.png -------------------------------------------------------------------------------- /images/sshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiredjs/designer/9e8d3381a869ff9163177e9c38aae89fe2475edd/images/sshot.png -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Wired Designer 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "wywiwyg", 3 | "short_name": "wywiwyg", 4 | "description": "What you wire is what you get", 5 | "start_url": "/", 6 | "display": "standalone" 7 | } 8 | -------------------------------------------------------------------------------- /polymer.json: -------------------------------------------------------------------------------- 1 | { 2 | "lint": { 3 | "rules": [ 4 | "polymer-2" 5 | ] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/action-history.html: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 | 20 | 206 | -------------------------------------------------------------------------------- /src/app-controls.html: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 | 14 | 15 | 65 | 86 | -------------------------------------------------------------------------------- /src/app-icons.html: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /src/app.js: -------------------------------------------------------------------------------- 1 | /* 2 | @license 3 | Copyright (c) 2017 The Polymer Project Authors. All rights reserved. 4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt 5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt 6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt 7 | Code distributed by Google as part of the polymer project is also 8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt 9 | */ 10 | 11 | // window.addEventListener('WebComponentsReady', function () { 12 | // document.addEventListener('update-code', function (event) { 13 | // codeView.dump(event.detail.target); 14 | // }, true); 15 | // }); 16 | 17 | function getProtoProperties(target) { 18 | // If this is a custom element, you need to go up the prototype 19 | // chain until you get proper HTMLElement, since everything under it 20 | // is generated prototypes and will have propeties that are dupes (like: 21 | // every observedAttribute is also mirrored as a property) 22 | const isCustomElement = target.tagName.indexOf('-') !== -1; 23 | let proto = target.__proto__; 24 | if (isCustomElement) { 25 | while (proto.constructor !== window.HTMLElement.prototype.constructor) { 26 | proto = proto.__proto__; 27 | } 28 | } 29 | 30 | let protoProps = {}; 31 | // We literally want nothing other than 'href' and 'target' from HTMLAnchorElement. 32 | if (proto.constructor.name === 'HTMLAnchorElement') { 33 | protoProps['href'] = Object.getOwnPropertyDescriptors(proto).href; 34 | protoProps['target'] = Object.getOwnPropertyDescriptors(proto).target; 35 | proto = proto.__proto__; 36 | } 37 | while (proto.constructor.name !== 'Element') { 38 | Object.assign(protoProps, Object.getOwnPropertyDescriptors(proto)); 39 | proto = proto.__proto__; 40 | } 41 | 42 | let propNames = Object.keys(protoProps).sort(); 43 | 44 | // Skip some very specific Polymer/element properties. 45 | let blacklist = [ 46 | // Polymer specific 47 | 'isAttached', 48 | 'constructor', 'created', 'ready', 'attached', 'detached', 49 | 'attributeChanged', 'is', 'listeners', 'observers', 'properties', 50 | // Native elements ones we don't care about 51 | 'validity', 'useMap', 'innerText', 'outerText', 'style', 'accessKey', 52 | 'draggable', 'lang', 'spellcheck', 'tabIndex', 'translate', 'align', 'dir', 53 | 'isMap', 'useMap', 'hspace', 'vspace', 'referrerPolicy', 'crossOrigin', 54 | 'lowsrc', 'longDesc', "contentEditable", "hidden", "title", 55 | // Specific elements stuff 56 | 'receivedFocusFromKeyboard', 'pointerDown', 'valueAsNumber', 57 | 'selectionDirection', 'selectionStart', 'selectionEnd' 58 | ]; 59 | 60 | let i = 0; 61 | while (i < propNames.length) { 62 | let name = propNames[i]; 63 | 64 | // Skip everything that starts with a _ which is a Polymer private/protected 65 | // and you probably don't care about it. 66 | // Also anything in the blacklist. Or that starts with webkit. 67 | if (name.charAt(0) === '_' || 68 | name === 'keyEventTarget' || 69 | blacklist.indexOf(name) !== -1 || 70 | name.indexOf('webkit') === 0 || 71 | name.indexOf('on') === 0) { 72 | propNames.splice(i, 1); 73 | continue; 74 | } 75 | 76 | // Skip everything that doesn't have a setter. 77 | if (!protoProps[name].set) { 78 | propNames.splice(i, 1); 79 | continue; 80 | } 81 | i++; 82 | } 83 | return propNames || []; 84 | } 85 | 86 | function getAttributesIfCustomElement(target) { 87 | if (target.tagName.indexOf('-') !== -1) { 88 | return target.constructor.observedAttributes; 89 | } else { 90 | return []; 91 | } 92 | } 93 | 94 | function getCustomProperties(target) { 95 | let list = []; 96 | if (target.tagName.indexOf('-') !== -1) { 97 | let attrs = target.constructor.observedAttributes || []; 98 | if (attrs.length) { 99 | var props = target.constructor.properties; 100 | if (props) { 101 | var keys = Object.keys(props); 102 | for (var i = 0; i < keys.length; i++) { 103 | var pname = keys[i]; 104 | var p = props[pname]; 105 | var typeFn = null; 106 | if (typeof p === 'function') { 107 | typeFn = p; 108 | } else { 109 | typeFn = p.type; 110 | } 111 | list.push({ 112 | name: pname, 113 | type: typeFn ? (typeFn.name || "String") : "String", 114 | value: target[pname] 115 | }); 116 | } 117 | } 118 | } 119 | } 120 | return list; 121 | } 122 | 123 | function rewire(el) { 124 | setTimeout(() => { 125 | if (el._relayout) { 126 | try { el._relayout(); } catch (ex) { console.error(ex); } 127 | } else if (el.relayout) { 128 | try { el.relayout(); } catch (ex) { console.error(ex); } 129 | } else if (el._refresh) { 130 | try { el._refresh(); } catch (ex) { console.error(ex); } 131 | } 132 | }, 1); 133 | } -------------------------------------------------------------------------------- /src/canvas/canvas-controls.html: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 108 | 360 | -------------------------------------------------------------------------------- /src/canvas/canvas-view.html: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 | 14 | 15 | 104 | 469 | -------------------------------------------------------------------------------- /src/components/designer-tab.html: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 | 14 | 57 | 63 | -------------------------------------------------------------------------------- /src/components/designer-tabs.html: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 | 14 | 15 | 33 | 40 | -------------------------------------------------------------------------------- /src/components/icon-picker.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 71 | 116 | -------------------------------------------------------------------------------- /src/components/tree-view.html: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 | 14 | 91 | 202 | -------------------------------------------------------------------------------- /src/element-view/element-properties.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 19 | 121 | -------------------------------------------------------------------------------- /src/element-view/element-property.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 26 | 89 | -------------------------------------------------------------------------------- /src/element-view/element-stuff-base.html: -------------------------------------------------------------------------------- 1 | 10 | 11 | -------------------------------------------------------------------------------- /src/element-view/element-stuff-flex.html: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 86 | 104 | -------------------------------------------------------------------------------- /src/element-view/element-stuff-shared-styles.html: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 77 | -------------------------------------------------------------------------------- /src/element-view/element-stuff-styles.html: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 56 | 98 | -------------------------------------------------------------------------------- /src/element-view/element-view.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 36 | 63 | -------------------------------------------------------------------------------- /src/palette/palette-list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 23 | 96 | -------------------------------------------------------------------------------- /src/palette/palette-shared-styles.html: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 80 | -------------------------------------------------------------------------------- /src/palette/palette-view.html: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 46 | 65 | -------------------------------------------------------------------------------- /src/the-app.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 228 | 229 | 458 | -------------------------------------------------------------------------------- /test/the-app/the-app_test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | the-app test 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 22 | 23 | 24 | 25 | 28 | 29 | 30 | 52 | 53 | 54 | 55 | 56 | --------------------------------------------------------------------------------