Repository: wiredjs/designer
Branch: master
Commit: 9e8d3381a869
Files: 31
Total size: 104.8 KB
Directory structure:
gitextract_kz5tdmj3/
├── .gitignore
├── LICENSE
├── README.md
├── bower.json
├── deploy-to-pages.sh
├── elements.json
├── 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
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
bower_components
designer
================================================
FILE: LICENSE
================================================
BSD 3-Clause License
Copyright (c) 2017, Preet Shihn
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
================================================
FILE: README.md
================================================
# Wired Designer
This is a very simple wysiwyg style designer for createing mockups and wireframes.
[Launch designer](https://wiredjs.github.io/designer)
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.
[Wired elements on webcomponents.org](https://www.webcomponents.org/collection/wiredjs/wired-elements)
The designer app is adapted from [Polymer's wizzywid](https://github.com/PolymerLabs/wizzywid)
Built with webcomponents and Polymer.
License: [BSD-3-Clause](https://github.com/wiredjs/designer/blob/master/LICENSE)
Author: [Preet Shihn](https://twitter.com/preetster)

================================================
FILE: bower.json
================================================
{
"name": "wired-designer",
"description": "Mockups and wireframing tool built using web components, and is open source.",
"main": "index.html",
"authors": [
"Preet Shihn "
],
"dependencies": {
"polymer": "Polymer/polymer#^2.0.0",
"iron-flex-layout": "PolymerElements/iron-flex-layout#^2.0.0",
"iron-pages": "PolymerElements/iron-pages#^2.0.0",
"iron-ajax": "^2.0.5",
"wired-elements": "^0.2.3",
"paper-toggle-button": "PolymerElements/paper-toggle-button#^2.0.0",
"iron-icons": "^2.0.1"
},
"license": "BSD-3",
"private": true
}
================================================
FILE: deploy-to-pages.sh
================================================
#!/bin/bash -e
# Based on https://github.com/Polymer/tools/blob/master/bin/gp.sh
# This script pushes a demo-friendly version of your element and its
# dependencies to gh-pages.
# Run in a clean directory passing in a GitHub org and repo name
org="wiredjs"
repo="designer"
#branch="master" # default to master when branch isn't specified
# make folder (same as input, no checking!)
rm -rf $repo
mkdir $repo
git clone https://github.com/$org/$repo.git --single-branch
# switch to gh-pages branch
pushd $repo >/dev/null
git checkout --orphan gh-pages
# remove the .gitignore since we're going to be pushing deps
git rm -rf ./.gitignore
git rm -rf ./bower_components
# use bower to install runtime deployment
bower cache clean # ensure we're getting the latest from the desired branch.
# install the bower deps
bower install
# send it all to github
git add -A .
git commit -am 'seed gh-pages'
git push -u origin gh-pages --force
popd >/dev/null
================================================
FILE: elements.json
================================================
{
"elements": [
{
"name": "wired-card",
"label": "Card (Container)",
"styles": [
{
"name": "width",
"value": "150px"
},
{
"name": "height",
"value": "150px"
}
]
},
{
"name": "wired-item",
"label": "Combo/List item",
"disableSizing": true,
"properties": [
{
"name": "text",
"value": "item"
},
{
"name": "value",
"value": "item"
}
]
},
{
"name": "wired-button",
"label": "Button",
"properties": [
{
"name": "text",
"value": "Button"
}
]
},
{
"name": "wired-checkbox",
"label": "Checkbox",
"disableSizing": true,
"properties": [
{
"name": "text",
"value": "Checkbox text"
}
]
},
{
"name": "wired-combo",
"label": "Combo box",
"disableSizing": true
},
{
"name": "wired-input",
"label": "Text input",
"properties": [
{
"name": "placeholder",
"value": "Placeholder"
}
]
},
{
"name": "wired-listbox",
"label": "List box",
"styles": [
{
"name": "width",
"value": "80px"
},
{
"name": "height",
"value": "100px"
}
]
},
{
"name": "wired-progress",
"label": "Progress bar"
},
{
"name": "wired-radio",
"label": "Radio",
"disableSizing": true,
"properties": [
{
"name": "text",
"value": "Radio_text"
}
]
},
{
"name": "wired-radio-group",
"label": "Radio group",
"styles": [
{
"name": "width",
"value": "80px"
},
{
"name": "height",
"value": "100px"
}
]
},
{
"name": "wired-textarea",
"label": "Multiline text input",
"properties": [
{
"name": "placeholder",
"value": "Placeholder"
}
]
},
{
"name": "wired-toggle",
"label": "Toggle switch",
"disableSizing": true
},
{
"name": "wired-icon-button",
"label": "Icon button"
},
{
"name": "wired-slider",
"label": "Slider"
},
{
"name": "wired-spinner",
"label": "Spinner"
},
{
"name": "a",
"native": true,
"label": "Link",
"textContent": "Link text"
},
{
"name": "p",
"native": true,
"label": "Text",
"textContent": "Lorem ipsum dolor sit amet..."
},
{
"name": "img",
"native": true,
"noCloseTag": true,
"label": "Image",
"styles": [
{
"name": "minWidth",
"value": "20px"
},
{
"name": "minHeight",
"value": "20px"
}
]
},
{
"name": "h1",
"native": true,
"label": "Title",
"textContent": "Title"
},
{
"name": "h2",
"native": true,
"label": "Title 2",
"textContent": "Smaller title"
}
]
}
================================================
FILE: index.html
================================================
Wired Designer
================================================
FILE: manifest.json
================================================
{
"name": "wywiwyg",
"short_name": "wywiwyg",
"description": "What you wire is what you get",
"start_url": "/",
"display": "standalone"
}
================================================
FILE: polymer.json
================================================
{
"lint": {
"rules": [
"polymer-2"
]
}
}
================================================
FILE: src/action-history.html
================================================
================================================
FILE: src/app-controls.html
================================================
================================================
FILE: src/app-icons.html
================================================
================================================
FILE: src/app.js
================================================
/*
@license
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/
// window.addEventListener('WebComponentsReady', function () {
// document.addEventListener('update-code', function (event) {
// codeView.dump(event.detail.target);
// }, true);
// });
function getProtoProperties(target) {
// If this is a custom element, you need to go up the prototype
// chain until you get proper HTMLElement, since everything under it
// is generated prototypes and will have propeties that are dupes (like:
// every observedAttribute is also mirrored as a property)
const isCustomElement = target.tagName.indexOf('-') !== -1;
let proto = target.__proto__;
if (isCustomElement) {
while (proto.constructor !== window.HTMLElement.prototype.constructor) {
proto = proto.__proto__;
}
}
let protoProps = {};
// We literally want nothing other than 'href' and 'target' from HTMLAnchorElement.
if (proto.constructor.name === 'HTMLAnchorElement') {
protoProps['href'] = Object.getOwnPropertyDescriptors(proto).href;
protoProps['target'] = Object.getOwnPropertyDescriptors(proto).target;
proto = proto.__proto__;
}
while (proto.constructor.name !== 'Element') {
Object.assign(protoProps, Object.getOwnPropertyDescriptors(proto));
proto = proto.__proto__;
}
let propNames = Object.keys(protoProps).sort();
// Skip some very specific Polymer/element properties.
let blacklist = [
// Polymer specific
'isAttached',
'constructor', 'created', 'ready', 'attached', 'detached',
'attributeChanged', 'is', 'listeners', 'observers', 'properties',
// Native elements ones we don't care about
'validity', 'useMap', 'innerText', 'outerText', 'style', 'accessKey',
'draggable', 'lang', 'spellcheck', 'tabIndex', 'translate', 'align', 'dir',
'isMap', 'useMap', 'hspace', 'vspace', 'referrerPolicy', 'crossOrigin',
'lowsrc', 'longDesc', "contentEditable", "hidden", "title",
// Specific elements stuff
'receivedFocusFromKeyboard', 'pointerDown', 'valueAsNumber',
'selectionDirection', 'selectionStart', 'selectionEnd'
];
let i = 0;
while (i < propNames.length) {
let name = propNames[i];
// Skip everything that starts with a _ which is a Polymer private/protected
// and you probably don't care about it.
// Also anything in the blacklist. Or that starts with webkit.
if (name.charAt(0) === '_' ||
name === 'keyEventTarget' ||
blacklist.indexOf(name) !== -1 ||
name.indexOf('webkit') === 0 ||
name.indexOf('on') === 0) {
propNames.splice(i, 1);
continue;
}
// Skip everything that doesn't have a setter.
if (!protoProps[name].set) {
propNames.splice(i, 1);
continue;
}
i++;
}
return propNames || [];
}
function getAttributesIfCustomElement(target) {
if (target.tagName.indexOf('-') !== -1) {
return target.constructor.observedAttributes;
} else {
return [];
}
}
function getCustomProperties(target) {
let list = [];
if (target.tagName.indexOf('-') !== -1) {
let attrs = target.constructor.observedAttributes || [];
if (attrs.length) {
var props = target.constructor.properties;
if (props) {
var keys = Object.keys(props);
for (var i = 0; i < keys.length; i++) {
var pname = keys[i];
var p = props[pname];
var typeFn = null;
if (typeof p === 'function') {
typeFn = p;
} else {
typeFn = p.type;
}
list.push({
name: pname,
type: typeFn ? (typeFn.name || "String") : "String",
value: target[pname]
});
}
}
}
}
return list;
}
function rewire(el) {
setTimeout(() => {
if (el._relayout) {
try { el._relayout(); } catch (ex) { console.error(ex); }
} else if (el.relayout) {
try { el.relayout(); } catch (ex) { console.error(ex); }
} else if (el._refresh) {
try { el._refresh(); } catch (ex) { console.error(ex); }
}
}, 1);
}
================================================
FILE: src/canvas/canvas-controls.html
================================================
================================================
FILE: src/canvas/canvas-view.html
================================================
================================================
FILE: src/components/designer-tab.html
================================================
================================================
FILE: src/components/designer-tabs.html
================================================