diff --git a/.htaccess b/.htaccess new file mode 100644 index 00000000..67635880 --- /dev/null +++ b/.htaccess @@ -0,0 +1,3 @@ +Options +FollowSymLinks +RewriteEngine On +RewriteRule ^components/(.*)$ ../components/$1 \ No newline at end of file diff --git a/assets/code.png b/elements/designer-element/assets/code.png similarity index 100% rename from assets/code.png rename to elements/designer-element/assets/code.png diff --git a/assets/design.png b/elements/designer-element/assets/design.png similarity index 100% rename from assets/design.png rename to elements/designer-element/assets/design.png diff --git a/elements/designer-element/designer-element.html b/elements/designer-element/designer-element.html new file mode 100644 index 00000000..7ec06b2d --- /dev/null +++ b/elements/designer-element/designer-element.html @@ -0,0 +1,259 @@ + + + + + + + + + + + + + + + + diff --git a/designer.html b/elements/designer-element/designer.html similarity index 74% rename from designer.html rename to elements/designer-element/designer.html index 075bd05e..438ab38f 100644 --- a/designer.html +++ b/elements/designer-element/designer.html @@ -4,8 +4,8 @@ Polymer Designer - - + + + + + + \ No newline at end of file diff --git a/elements/x-designer/x-designer.html b/elements/x-designer/x-designer.html new file mode 100644 index 00000000..e5ec742a --- /dev/null +++ b/elements/x-designer/x-designer.html @@ -0,0 +1,161 @@ + + + + + + + + + + + diff --git a/elements/x-dom-serializer/x-dom-serializer.html b/elements/x-dom-serializer/x-dom-serializer.html new file mode 100644 index 00000000..8eca285e --- /dev/null +++ b/elements/x-dom-serializer/x-dom-serializer.html @@ -0,0 +1,281 @@ + + + + + + + + + + + + + diff --git a/elements/x-editors/x-editors.html b/elements/x-editors/x-editors.html new file mode 100644 index 00000000..26bff970 --- /dev/null +++ b/elements/x-editors/x-editors.html @@ -0,0 +1,317 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/elements/x-file-document/x-file-document.html b/elements/x-file-document/x-file-document.html new file mode 100644 index 00000000..b28b9beb --- /dev/null +++ b/elements/x-file-document/x-file-document.html @@ -0,0 +1,47 @@ + + + + + + + diff --git a/elements/x-inspector/assets/ic_chevron_left_darkreg.png b/elements/x-inspector/assets/ic_chevron_left_darkreg.png new file mode 100644 index 00000000..9e6d70f3 Binary files /dev/null and b/elements/x-inspector/assets/ic_chevron_left_darkreg.png differ diff --git a/elements/x-inspector/assets/ic_delete_darkreg.png b/elements/x-inspector/assets/ic_delete_darkreg.png new file mode 100644 index 00000000..f173a054 Binary files /dev/null and b/elements/x-inspector/assets/ic_delete_darkreg.png differ diff --git a/elements/x-inspector/assets/ic_home_darkreg.png b/elements/x-inspector/assets/ic_home_darkreg.png new file mode 100644 index 00000000..fce00f38 Binary files /dev/null and b/elements/x-inspector/assets/ic_home_darkreg.png differ diff --git a/elements/x-inspector/assets/ic_refresh_darkreg.png b/elements/x-inspector/assets/ic_refresh_darkreg.png new file mode 100644 index 00000000..5eb96c8c Binary files /dev/null and b/elements/x-inspector/assets/ic_refresh_darkreg.png differ diff --git a/elements/x-inspector/demo.html b/elements/x-inspector/demo.html new file mode 100644 index 00000000..43a00071 --- /dev/null +++ b/elements/x-inspector/demo.html @@ -0,0 +1,33 @@ + + + + + list + + + + + + +
Hi
+

+ + + + diff --git a/elements/x-inspector/reflection.js b/elements/x-inspector/reflection.js new file mode 100644 index 00000000..39e0453e --- /dev/null +++ b/elements/x-inspector/reflection.js @@ -0,0 +1,125 @@ +/* + * Copyright 2013 The Polymer Authors. All rights reserved. + * Use of this source code is governed by a BSD-style + * license that can be found in the LICENSE file. + */ + +(function() { + +function reflect(element, name, meta) { + return { + obj: element, + name: name, + value: element[name], + meta: meta && meta[name] + }; +} + +function reflectProperty(element, name, meta) { + try { + if (name[0] === '_' || name[name.length-1] === '_') { + return; + } + if (element.publish && element.publish[name] === undefined) { + return; + } + var v = element[name]; + if (v !== null + && v !== undefined + && typeof v !== 'function' + && typeof v !== 'object' + //&& element.propertyIsEnumerable(k) + && !reflectProperty.blacklist[name]) { + var prop = reflect(element, name, meta); + } + } catch(x) { + // squelch + } + return prop; +} + +reflectProperty.blacklist = { + EVENT_PREFIX: 1, + DELEGATES: 1, + PUBLISHED: 1, + INSTANCE_ATTRIBUTES: 1, + PolymerBase: 1, + STYLE_SCOPE_ATTRIBUTE: 1 +}; + +if (!window.designWindow) { + designWindow = window; +} + +function reflectProperties(element) { + var props = []; + if (element) { + var found = {}; + var meta = element.meta && element.meta.properties; + var hep = designWindow.HTMLElement.prototype; + var hiep = designWindow.HTMLInputElement.prototype; + // TODO(sjmiles): beware alternate-window `p` that will != window.HTMLElement.prototype + var p = element.__proto__; + while (p && !p.hasOwnProperty('PolymerBase') && p != hep && p != hiep) { + var k = Object.keys(p); + k.forEach(function(k) { + if (found[k]) { + return; + } + var prop = reflectProperty(element, k, meta); + if (prop) { + props.push(prop); + found[k] = true; + } + }); + p = p.__proto__; + } + // + var more = []; + if (!element.firstElementChild) { + more.push('textContent'); + } + more.push('id'); + var whitelist = {}; + // + meta && Object.keys(meta).forEach(function(n) { + if (!found[n] && more.indexOf(n) === -1) { + more.push(n); + whitelist[n] = true; + } + }); + // + more.forEach(function(k) { + var v = element[k]; + if ((typeof v !== 'function' && typeof v !== 'object') || whitelist[k]) { + props.push(reflect(element, k, meta)); + } + }); + } + return props; +} + +function reflectObject(obj, meta) { + var props = []; + if (obj && meta) { + Object.keys(meta).forEach(function(name) { + props.push(reflect(obj, name, meta)); + }); + } + return props; +} + +function reflectStyles(element, meta) { + if (element) { + //return reflectObject(element.style, meta); + return reflectObject(element.__styleRule.style, meta); + } +} + +window.Reflection = { + properties: reflectProperties, + styles: reflectStyles, + object: reflectObject +}; + +})(); diff --git a/elements/x-inspector/x-inspector.css b/elements/x-inspector/x-inspector.css new file mode 100644 index 00000000..21efa62b --- /dev/null +++ b/elements/x-inspector/x-inspector.css @@ -0,0 +1,57 @@ +/* +Copyright 2013 The Polymer Authors. All rights reserved. +Use of this source code is governed by a BSD-style +license that can be found in the LICENSE file. +*/ + +:host { + Xborder: 1px solid silver; +} + +#header { + background-color: #E0E0E0; + border-bottom: 1px solid silver; + padding: 4px; + height: 44px; + white-space: nowrap; + overflow: hidden; +} + +#crumbList { + display: inline-block; + width: 80%; + vertical-align: middle; + overflow: hidden; + float: left; + font-size: 0.8em; +} + +#deleteIcon { + float: right; +} + +#interior { + position: absolute; + top: 62px; + right: 0; + bottom: 0; + left: 0; + padding: 8px; + overflow-x: hidden; + overflow-y: auto; + -webkit-overflow-scrolling: touch; +} + +g-icon-button { + vertical-align: middle; +} + +tk-property-inspector[hidden=true] { + display: none !important; +} + +g-icon-button[hidden=true] { + width: 0 !important; + padding: 0 !important; + visibility: hidden !important; +} diff --git a/elements/x-inspector/x-inspector.html b/elements/x-inspector/x-inspector.html new file mode 100644 index 00000000..410fb633 --- /dev/null +++ b/elements/x-inspector/x-inspector.html @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/elements/x-meta/x-meta.html b/elements/x-meta/x-meta.html new file mode 100644 index 00000000..e281f443 --- /dev/null +++ b/elements/x-meta/x-meta.html @@ -0,0 +1,150 @@ + + + + + diff --git a/elements/x-palette/x-palette.html b/elements/x-palette/x-palette.html new file mode 100644 index 00000000..ae6200c4 --- /dev/null +++ b/elements/x-palette/x-palette.html @@ -0,0 +1,155 @@ + + + + + + + + + + + + diff --git a/elements/x-property-inspector/assets/link_dark.png b/elements/x-property-inspector/assets/link_dark.png new file mode 100644 index 00000000..cf521cf2 Binary files /dev/null and b/elements/x-property-inspector/assets/link_dark.png differ diff --git a/elements/x-property-inspector/demo.html b/elements/x-property-inspector/demo.html new file mode 100644 index 00000000..aa4f0f1b --- /dev/null +++ b/elements/x-property-inspector/demo.html @@ -0,0 +1,130 @@ + + + + polymer-flex-layout + + + + + + + + + + + + + + + + + + + +

polymer-flex-layout.css

+ +
+

polymer-flex-panel element

+ +
+

polymer-flex-layout element

+ + + diff --git a/elements/x-property-inspector/x-property-editor.html b/elements/x-property-inspector/x-property-editor.html new file mode 100644 index 00000000..8ca7bf3c --- /dev/null +++ b/elements/x-property-inspector/x-property-editor.html @@ -0,0 +1,177 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/elements/x-property-inspector/x-property-inspector.html b/elements/x-property-inspector/x-property-inspector.html new file mode 100644 index 00000000..dc3e3133 --- /dev/null +++ b/elements/x-property-inspector/x-property-inspector.html @@ -0,0 +1,214 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/elements/x-tree/x-tree.html b/elements/x-tree/x-tree.html new file mode 100644 index 00000000..9e9f2b3a --- /dev/null +++ b/elements/x-tree/x-tree.html @@ -0,0 +1,106 @@ + + + + + + diff --git a/index.html b/index.html index 0b1c1f63..6d36b14a 100644 --- a/index.html +++ b/index.html @@ -1,26 +1,27 @@ + Designer - - - - - - - - + + + + + + + - - - - -