Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Richer devtools integration (WIP) #133

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
6307c5e
design tab and simulated selection
argyleink Sep 6, 2018
e4908d8
Merge branch 'master' into feature/facade-devtools-integration
argyleink Sep 23, 2018
9edea43
adding more inspirational prototype areas
argyleink Sep 23, 2018
d68dd77
Merge branch 'master' into feature/facade-devtools-integration
argyleink Oct 6, 2018
15b00f1
context menu and some refactor
argyleink Oct 6, 2018
aa3361c
data passing
argyleink Oct 6, 2018
c9c1d7f
inspecting launches with inspector preselected
argyleink Oct 6, 2018
aff09aa
fixes toggle regression
argyleink Oct 6, 2018
b2519f8
port messages passing between panel and pixelbug
argyleink Oct 6, 2018
7a4d65c
data passing between pixelbug and panel
argyleink Oct 7, 2018
7cf0cdc
selection data passing from pixelbug to extension panel
argyleink Oct 7, 2018
d74c61c
pass meaningful data to panel from artboard
argyleink Oct 7, 2018
3dbb6c2
healthy refactor, all working well
argyleink Oct 7, 2018
5277d27
surma helped refine the node recursion fn!
argyleink Oct 7, 2018
071c253
payload is passed with action, remove sourcemaps, sends to proper con…
argyleink Oct 7, 2018
4245870
prepare to use postcss for panel styles
argyleink Oct 8, 2018
cad5dec
css builds properly for panel styles
argyleink Oct 8, 2018
aa779b7
layers rendering and tool dark mode is obeyed
argyleink Oct 10, 2018
3c61c29
Merge branch 'master' into feature/facade-devtools-integration
argyleink Oct 10, 2018
33af511
Merge branch 'master' into feature/facade-devtools-integration
argyleink Oct 10, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 15 additions & 11 deletions app/components/tool-pallete/toolpallete.element.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ export default class ToolPallete extends HTMLElement {
this.$shadow = this.attachShadow({mode: 'open'})
this.$shadow.innerHTML = this.render()

this.selectorEngine = Selectable()
this.colorPicker = ColorPicker(this.$shadow, this.selectorEngine)
provideSelectorEngine(this.selectorEngine)
this._selectorEngine = Selectable()
this.colorPicker = ColorPicker(this.$shadow, this._selectorEngine)
provideSelectorEngine(this._selectorEngine)
}

connectedCallback() {
Expand All @@ -62,7 +62,7 @@ export default class ToolPallete extends HTMLElement {

disconnectedCallback() {
this.deactivate_feature()
this.selectorEngine.disconnect()
this._selectorEngine.disconnect()
hotkeys.unbind(
Object.keys(this.toolbar_model).reduce((events, key) =>
events += ',' + key, ''))
Expand Down Expand Up @@ -135,9 +135,9 @@ export default class ToolPallete extends HTMLElement {
}

text() {
this.selectorEngine.onSelectedUpdate(EditText)
this._selectorEngine.onSelectedUpdate(EditText)
this.deactivate_feature = () =>
this.selectorEngine.removeSelectedCallback(EditText)
this._selectorEngine.removeSelectedCallback(EditText)
}

align() {
Expand All @@ -154,15 +154,15 @@ export default class ToolPallete extends HTMLElement {

hueshift() {
let feature = HueShift(this.colorPicker)
this.selectorEngine.onSelectedUpdate(feature.onNodesSelected)
this._selectorEngine.onSelectedUpdate(feature.onNodesSelected)
this.deactivate_feature = () => {
this.selectorEngine.removeSelectedCallback(feature.onNodesSelected)
this._selectorEngine.removeSelectedCallback(feature.onNodesSelected)
feature.disconnect()
}
}

inspector() {
this.deactivate_feature = MetaTip(this.selectorEngine)
this.deactivate_feature = MetaTip(this._selectorEngine)
}

accessibility() {
Expand All @@ -179,16 +179,20 @@ export default class ToolPallete extends HTMLElement {

position() {
let feature = Position()
this.selectorEngine.onSelectedUpdate(feature.onNodesSelected)
this._selectorEngine.onSelectedUpdate(feature.onNodesSelected)
this.deactivate_feature = () => {
this.selectorEngine.removeSelectedCallback(feature.onNodesSelected)
this._selectorEngine.removeSelectedCallback(feature.onNodesSelected)
feature.disconnect()
}
}

get activeTool() {
return this.active_tool.dataset.tool
}

get selectorEngine() {
return this._selectorEngine
}
}

customElements.define('tool-pallete', ToolPallete)
6 changes: 4 additions & 2 deletions extension/manifest.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"name": "PixelBug",
"version": "0.1.5",
"version": "0.1.51",
"description": "Hacking for Designers",
"manifest_version": 2,
"icons": { "128": "icons/128.png" },
"devtools_page": "panel/index.html",
"permissions": [
"activeTab"
"activeTab",
"contextMenus"
],
"background": {
"persistent": true,
Expand Down
13 changes: 13 additions & 0 deletions extension/pane/pixelbug/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html>
<head>
<style>
body {
margin: 0;
}
</style>
</head>
<body>
<p>Hello from PixelBug</p>
</body>
</html>
13 changes: 13 additions & 0 deletions extension/pane/sizing/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html>
<head>
<style>
body {
margin: 0;
}
</style>
</head>
<body>
<p>Calculated/authored/natural/responsive</p>
</body>
</html>
13 changes: 13 additions & 0 deletions extension/pane/styleguide/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html>
<head>
<style>
body {
margin: 0;
}
</style>
</head>
<body>
<p>fonts/colors/spacing/etc</p>
</body>
</html>
Binary file added extension/panel/demo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions extension/panel/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<html>
<head></head>
<body>
<script src="index.js" type="module"></script>
</body>
</html>
20 changes: 20 additions & 0 deletions extension/panel/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// init panels
chrome.devtools.panels.create('Design', null, 'panel/panel.html', design_panel => {
// design_panel.onShown.addListener(e =>
// post({action: 'show-toolbar'}))
})

chrome.devtools.panels.elements.createSidebarPane('PixelBug', sidebar => {
sidebar.setPage('../pane/pixelbug/index.html')
sidebar.setHeight('8ex')
})

chrome.devtools.panels.elements.createSidebarPane('Style Guide', sidebar => {
sidebar.setPage('../pane/styleguide/index.html')
sidebar.setHeight('8ex')
})

chrome.devtools.panels.elements.createSidebarPane('Sizing', sidebar => {
sidebar.setPage('../pane/sizing/index.html')
sidebar.setHeight('8ex')
})
89 changes: 89 additions & 0 deletions extension/panel/panel.bundle.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
:root {
--bg: hsl(0,0%,100%);
--bg-hover: hsl(0,0%,95%);
--dot: hsl(0,0%,90%);
--text: hsl(0,0%,10%);
}

body {
margin: 0;
background-color: hsl(0,0%,100%);
background-color: var(--bg);
color: hsl(0,0%,10%);
color: var(--text);
background-image: -webkit-repeating-radial-gradient(
center center,
rgba(0,0,0,.05),
rgba(0,0,0,.05) 1px,
transparent 1px,
transparent 100%
);
background-size: 0.5rem 0.5rem
}

body.dark {
--bg: hsl(0,0%,15%);
--bg-hover: hsl(0,0%,20%);
--dot: hsl(0,0%,25%);
--text: hsl(0,0%,80%);
}

img {
width: 100%;
height: 100%;
object-fit: cover;
}

#layers {
background-color: hsl(0,0%,100%);
background-color: var(--bg);
color: hsl(0,0%,10%);
color: var(--text);
padding: 0.5rem;
}

ol {
padding: 0;
margin: 0;
list-style-type: none
}

ol > li,
ol li > .layer {
margin-left: 0.8rem;
}

details > summary:focus {
/*outline-color: hotpink;*/
outline: none;
}

details > summary::-webkit-details-marker {
color: hotpink;
}

details .layer {
padding: 0.5rem 1rem;
border-radius: 1rem
}

details .layer:hover {
background: hsl(0,0%,95%);
background: var(--bg-hover);
cursor: pointer;
}

.layer {
display: inline-flex;
align-items: center;
}

details [icon] {
width: 0.5rem;
height: 0.5rem;
border-radius: 50%;
background-color: hsl(0,0%,90%);
background-color: var(--dot);
display: inline-block;
margin-right: 0.5rem;
}
85 changes: 85 additions & 0 deletions extension/panel/panel.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
:root {
--bg: hsl(0,0%,100%);
--bg-hover: hsl(0,0%,95%);
--dot: hsl(0,0%,90%);
--text: hsl(0,0%,10%);
}

body {
margin: 0;
background-color: var(--bg);
color: var(--text);
background-image: -webkit-repeating-radial-gradient(
center center,
rgba(0,0,0,.05),
rgba(0,0,0,.05) 1px,
transparent 1px,
transparent 100%
);
background-size: 0.5rem 0.5rem;

&.dark {
--bg: hsl(0,0%,15%);
--bg-hover: hsl(0,0%,20%);
--dot: hsl(0,0%,25%);
--text: hsl(0,0%,80%);
}
}

img {
width: 100%;
height: 100%;
object-fit: cover;
}

#layers {
background-color: var(--bg);
color: var(--text);
padding: 0.5rem;
}

ol {
padding: 0;
margin: 0;
list-style-type: none;

& > li,
& li > .layer {
margin-left: 0.8rem;
}
}

details > summary {
&:focus {
/*outline-color: hotpink;*/
outline: none;
}

&::-webkit-details-marker {
color: hotpink;
}
}

details .layer {
padding: 0.5rem 1rem;
border-radius: 1rem;

&:hover {
background: var(--bg-hover);
cursor: pointer;
}
}

.layer {
display: inline-flex;
align-items: center;
}

details [icon] {
width: 0.5rem;
height: 0.5rem;
border-radius: 50%;
background-color: var(--dot);
display: inline-block;
margin-right: 0.5rem;
}
12 changes: 12 additions & 0 deletions extension/panel/panel.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<html>
<head>
<link rel="stylesheet" href="panel.bundle.css">
</head>
<body>
<!-- <img src="demo.png"> -->

<div id="layers"></div>

<script src="panel.js" type="module"></script>
</body>
</html>
Loading