Skip to content

Commit

Permalink
wip ui updates
Browse files Browse the repository at this point in the history
  • Loading branch information
heapwolf committed May 27, 2024
1 parent cd5fe02 commit 044e07e
Show file tree
Hide file tree
Showing 17 changed files with 165 additions and 59 deletions.
Binary file modified icons/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion importmap.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"@socketsupply/tonic": "npm:@socketsupply/tonic",
"@socketsupply/components": "npm:@socketsupply/components",
"@socketsupply/components/dialog": "npm:@socketsupply/components/dialog",
"@socketsupply/indexed": "npm:@socketsupply/indexed"
"@socketsupply/indexed": "npm:@socketsupply/indexed",
"marked": "file://node_modules/marked/marked.min.js"
}
}
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
"type": "git"
},
"devDependencies": {
"esbuild": "^0.20.0",
"monaco-editor": "^0.46.0",
"standard": "^17.1.0",
"xterm": "^5.3.0",
"xterm-addon-fit": "^0.8.0",
"xterm-addon-search": "^0.13.0",
"esbuild": "^0.20.0",
"standard": "^17.1.0"
"xterm-addon-search": "^0.13.0"
},
"scripts": {
"build": "ssc build -r -o",
Expand All @@ -24,9 +24,10 @@
"author": "Socket Supply Co. <[email protected]>",
"license": "MIT",
"dependencies": {
"@socketsupply/components": "^14.1.0",
"@socketsupply/indexed": "^1.0.3",
"@socketsupply/socket": "^0.5.4",
"@socketsupply/tonic": "^15.1.2",
"@socketsupply/components": "^14.1.0",
"@socketsupply/socket": "^0.5.4"
"marked": "^12.0.2"
}
}
1 change: 1 addition & 0 deletions socket.ini
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ node_modules/@socketsupply/components = node_modules/@socketsupply/components
node_modules/@socketsupply/indexed = node_modules/@socketsupply/indexed
node_modules/@socketsupply/tonic = node_modules/@socketsupply/tonic
node_modules/@socketsupply/socket = node_modules/@socketsupply/socket
node_modules/marked = node_modules/marked
node_modules/@socketsupply/socket-darwin-arm64 = node_modules/@socketsupply/socket-darwin-arm64


Expand Down
2 changes: 2 additions & 0 deletions src/components/account.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class DialogAccount extends TonicDialog {

async handleResponse (event) {
const iframe = this.querySelector('iframe')

// if this isnt a message from the iframe, ignore it
if (event.source !== iframe.contentWindow) return

const app = this.props.app
Expand Down
2 changes: 1 addition & 1 deletion src/components/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ class AppEditor extends Tonic {
}
}

coTabs.state.editingTabId = coTabs.tab.id
coTabs.state.editingTabId = coTabs.tab?.id
})

window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', event => {
Expand Down
10 changes: 5 additions & 5 deletions src/components/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -481,11 +481,11 @@ class AppProject extends Tonic {
const projectNode = this.getProjectNode(node)
const coImagePreview = document.querySelector('view-image-preview')
const coProjectSummary = document.querySelector('view-project-summary')
const coHome = document.querySelector('view-home')
// const coHome = document.querySelector('view-home')

coImagePreview.hide()
coProjectSummary.hide()
coHome.hide()
// coHome.hide()

// Check if the project has changed, refresh the props component
if (this.state.currentProjectId !== projectNode.id) {
Expand All @@ -507,7 +507,7 @@ class AppProject extends Tonic {
if (node.isDirectory) return

if (projectNode.id === 'home') {
coHome.show()
// coHome.show()
return
}

Expand Down Expand Up @@ -616,7 +616,7 @@ class AppProject extends Tonic {
children: []
}

tree.children.push({
/* tree.children.push({
id: 'home',
parent: tree,
selected: oldChild?.selected ?? 0,
Expand All @@ -626,7 +626,7 @@ class AppProject extends Tonic {
label: 'Home',
nonMovable: true,
children: []
})
}) */

const readDir = async (dirPath, parent) => {
let entries = []
Expand Down
1 change: 0 additions & 1 deletion src/css/component-project.css
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ app-project .item .node-data .label {
line-height: 22px;
letter-spacing: 0.8px;
font-family: var(--tonic-body);
font-weight: 100;
}

app-project[dragging] {
Expand Down
61 changes: 60 additions & 1 deletion src/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ tonic-accordion h3 {
margin: 16px 14px 6px;
color: var(--tonic-primary);
font-family: var(--tonic-body);
font-weight: 100;
font-size: 14px;
font-weight: 400;
}

#inputs {
Expand Down Expand Up @@ -206,3 +206,62 @@ header.component#header-project {
#split-main tonic-split-right {
overflow: auto;
}

/* Tables */

table {
width: 100%;
text-align: left;
border-collapse: collapse;
border: 1px solid var(--tonic-border);
margin: 20px 0;
}

table code {
padding: 2px 4px;
border-radius: 4px;
background-color: var(--tonic-background) !important;
color: var(--tonic-primary) !important;
border: 1px solid var(--tonic-border);
}

th {
font: 13px/16px var(--tonic-subheader);
font-weight: 400;
text-transform: uppercase;
letter-spacing: 1px;
padding: 12px 10px;
background-color: var(--tonic-background);
border-bottom: 1px solid var(--tonic-border);
border-right: 1px solid var(--tonic-border);
color: var(--tonic-info);
}

td {
line-height: 22px;
padding: 10px;
border-bottom: 1px solid var(--tonic-border);
}

td:not(:first-of-type) {
border-left: 1px solid var(--tonic-border);
}

tr:last-of-type td {
border-bottom: 0;
}

td:last-of-type {
border-right: 0;
}

@media (max-width: 699px) {
body table {
display: block;
max-width: -moz-fit-content;
max-width: fit-content;
margin: 20px 0;
overflow-x: auto;
white-space: nowrap;
}
}
2 changes: 1 addition & 1 deletion src/css/tonic-overrides.css
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ tonic-accordion-section .tonic--accordion-header button .tonic--label {
font-family: var(--tonic-body);
padding: 14px;
color: var(--tonic-info);
font-weight: 100;
font-weight: 400;
}

tonic-accordion-section .tonic--accordion-header button[aria-expanded="true"] .tonic--label {
Expand Down
44 changes: 26 additions & 18 deletions src/css/view-home.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,31 +40,13 @@ view-home .content {
overflow: scroll;
}

view-home h1 {
font-family: var(--tonic-body);
text-transform: uppercase;
font-size: 38px;
margin-top: 0;
font-weight: 100;
white-space: nowrap;
}

view-home h1 b {
font-family: var(--tonic-header);
text-transform: uppercase;
font-size: 38px;
font-weight: 900;
}


view-home h2 {
text-transform: uppercase;
border-bottom: 1px solid;
color: var(--tonic-info);
margin-bottom: 4px;
padding: 2px 0;
font-family: var(--tonic-body);
font-weight: 100;
}

view-home .panel-label {
Expand Down Expand Up @@ -117,3 +99,29 @@ view-home tonic-profile-image {
border: 1px solid var(--tonic-border);
border-radius: 4px;
}

/* Docs */

#docs-content {
a {
color: var(--tonic-primary);
text-decoration: none;
border: none;
}

h1, h2, h3 {
text-transform: uppercase;
}

h1 {
font-size: 32px;
font-weight: 400;
}

pre {
padding: 8px;
border: 1px solid var(--tonic-border);
background-color: var(--tonic-dark);
border-radius: 6px;
}
}
1 change: 0 additions & 1 deletion src/css/view-image-preview.css
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ view-image-preview .bottom h2 {
border-bottom: 1px solid var(--tonic-info);
font-size: 14px;
text-transform: uppercase;
font-weight: 100;
color: var(--tonic-info);
}

Expand Down
1 change: 0 additions & 1 deletion src/css/view-project-summary.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ view-project-summary h2 {
font-size: 20px;
text-transform: uppercase;
color: var(--tonic-info);
font-weight: 100;
}

view-project-summary header span {
Expand Down
4 changes: 2 additions & 2 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<meta
http-equiv="Content-Security-Policy"
content="
connect-src socket: npm: https: http: blob: ipc: wss: ws: ws://localhost:*;
script-src socket: npm: node: https: http: blob: http://localhost:* 'unsafe-eval' 'unsafe-inline';
connect-src socket: npm: https: http: file: blob: ipc: wss: ws: ws://localhost:*;
script-src socket: npm: node: https: file: http: blob: http://localhost:* 'unsafe-eval' 'unsafe-inline';
worker-src socket: https: http: blob: 'unsafe-eval' 'unsafe-inline';
frame-src socket: https: http: blob: http://localhost:*;
img-src socket: https: http: blob: data: http://localhost:*;
Expand Down
Loading

0 comments on commit 044e07e

Please sign in to comment.