mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 15:32:25 -05:00
🐸restructure frontend stuff, include admin and future user panel in main repo, properly deduplicate bundles for css+js across uses
This commit is contained in:
parent
f3b44426f4
commit
f971763743
36 changed files with 8978 additions and 1252 deletions
|
|
@ -103,8 +103,7 @@ func (m *Module) profileTemplateHandler(c *gin.Context) {
|
||||||
"statuses": statuses,
|
"statuses": statuses,
|
||||||
"stylesheets": []string{
|
"stylesheets": []string{
|
||||||
"/assets/Fork-Awesome/css/fork-awesome.min.css",
|
"/assets/Fork-Awesome/css/fork-awesome.min.css",
|
||||||
"/assets/status.css",
|
"/assets/bundled/profile.css",
|
||||||
"/assets/profile.css",
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -82,9 +82,12 @@ func (m *Module) threadTemplateHandler(c *gin.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
c.HTML(http.StatusOK, "thread.tmpl", gin.H{
|
c.HTML(http.StatusOK, "thread.tmpl", gin.H{
|
||||||
"instance": instance,
|
"instance": instance,
|
||||||
"status": status,
|
"status": status,
|
||||||
"context": context,
|
"context": context,
|
||||||
"stylesheets": []string{"/assets/Fork-Awesome/css/fork-awesome.min.css", "/assets/status.css"},
|
"stylesheets": []string{
|
||||||
|
"/assets/Fork-Awesome/css/fork-awesome.min.css",
|
||||||
|
"/assets/bundled/status.css",
|
||||||
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
11
web/assets/bundled/_colors.css
Normal file
11
web/assets/bundled/_colors.css
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
|
||||||
|
:root {
|
||||||
|
--bg: #525c66;
|
||||||
|
--fg: #fafaff;
|
||||||
|
--fg_dark: #b0b0b5;
|
||||||
|
--bg_accent: hsl(210, 10.8695652174%, 31.0784313725%);
|
||||||
|
--acc1: #de8957;
|
||||||
|
--acc2: #c76d33;
|
||||||
|
--blue: #5897df
|
||||||
|
}
|
||||||
|
|
||||||
1115
web/assets/bundled/admin-panel.js
Normal file
1115
web/assets/bundled/admin-panel.js
Normal file
File diff suppressed because one or more lines are too long
|
|
@ -1,8 +1,9 @@
|
||||||
|
|
||||||
html, body {
|
html, body {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
background: rgb(70, 79, 88);
|
background: var(--bg_accent);
|
||||||
color: #fafaff;
|
color: var(--fg);
|
||||||
font-family: sans-serif;
|
font-family: sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -15,7 +16,7 @@ body {
|
||||||
}
|
}
|
||||||
|
|
||||||
main {
|
main {
|
||||||
background: #525c66;
|
background: var(--bg);
|
||||||
display: grid;
|
display: grid;
|
||||||
padding-top: 2rem;
|
padding-top: 2rem;
|
||||||
padding-bottom: 2rem;
|
padding-bottom: 2rem;
|
||||||
|
|
@ -32,7 +33,7 @@ main .right {
|
||||||
}
|
}
|
||||||
|
|
||||||
main.lightgray {
|
main.lightgray {
|
||||||
background: #525c66;
|
background: var(--bg);
|
||||||
}
|
}
|
||||||
|
|
||||||
main > * {
|
main > * {
|
||||||
|
|
@ -41,7 +42,7 @@ main > * {
|
||||||
}
|
}
|
||||||
|
|
||||||
header {
|
header {
|
||||||
background: rgb(70, 79, 88);
|
background: var(--bg_accent);
|
||||||
padding: 2rem 0;
|
padding: 2rem 0;
|
||||||
padding-bottom: 0;
|
padding-bottom: 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
@ -74,13 +75,13 @@ h1 {
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
color: #de8957;
|
color: var(--acc1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.button, button {
|
.button, button {
|
||||||
border-radius: 0.2rem;
|
border-radius: 0.2rem;
|
||||||
background: #de8957;
|
background: var(--acc1);
|
||||||
color: #fafaff;
|
color: var(--fg);
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
font-size: 1.2rem;
|
font-size: 1.2rem;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
|
@ -90,11 +91,11 @@ a {
|
||||||
}
|
}
|
||||||
|
|
||||||
.button:hover, button:hover {
|
.button:hover, button:hover {
|
||||||
background: #c76d33;
|
background: var(--acc2);
|
||||||
}
|
}
|
||||||
|
|
||||||
.count {
|
.count {
|
||||||
background: rgb(70, 79, 88);
|
background: var(--bg_accent);
|
||||||
border-radius: 0.3rem;
|
border-radius: 0.3rem;
|
||||||
padding: 0.2rem;
|
padding: 0.2rem;
|
||||||
}
|
}
|
||||||
|
|
@ -104,7 +105,7 @@ a {
|
||||||
}
|
}
|
||||||
|
|
||||||
.accent {
|
.accent {
|
||||||
color: #de8957;
|
color: var(--acc1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.logo {
|
.logo {
|
||||||
|
|
@ -131,20 +132,21 @@ section.apps .applist .entry {
|
||||||
grid-template-columns: 30% 1fr;
|
grid-template-columns: 30% 1fr;
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
padding: 0.5rem;
|
padding: 0.5rem;
|
||||||
background: rgb(70, 79, 88);
|
background: var(--bg_accent);
|
||||||
border-radius: 0.5rem;
|
border-radius: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
section.apps .applist .entry .logo {
|
section.apps .applist .entry .logo {
|
||||||
align-self: center;
|
align-self: center;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
object-fit: contain;
|
-o-object-fit: contain;
|
||||||
|
object-fit: contain;
|
||||||
flex: 1 1 auto;
|
flex: 1 1 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
section.apps .applist .entry .logo.redraw {
|
section.apps .applist .entry .logo.redraw {
|
||||||
fill: #fafaff;
|
fill: var(--fg);
|
||||||
stroke: #fafaff;
|
stroke: var(--fg);
|
||||||
}
|
}
|
||||||
|
|
||||||
section.apps .applist .entry div {
|
section.apps .applist .entry div {
|
||||||
|
|
@ -187,9 +189,9 @@ section.error pre {
|
||||||
}
|
}
|
||||||
|
|
||||||
input, select, textarea {
|
input, select, textarea {
|
||||||
border: 1px solid #fafaff;
|
border: 1px solid var(--fg);
|
||||||
color: #fafaff;
|
color: var(--fg);
|
||||||
background: #525c66;
|
background: var(--bg);
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -227,3 +229,4 @@ footer a {
|
||||||
grid-template-columns: 1fr;
|
grid-template-columns: 1fr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
126
web/assets/bundled/panels-admin-style.css
Normal file
126
web/assets/bundled/panels-admin-style.css
Normal file
|
|
@ -0,0 +1,126 @@
|
||||||
|
|
||||||
|
body {
|
||||||
|
grid-template-rows: auto 1fr;
|
||||||
|
}
|
||||||
|
|
||||||
|
.capitalize {
|
||||||
|
text-transform: capitalize;
|
||||||
|
}
|
||||||
|
|
||||||
|
section {
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
input, select, textarea {
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
section.info form {
|
||||||
|
grid-template-columns: auto 1fr;
|
||||||
|
width: calc(100% - 0.35rem);
|
||||||
|
}
|
||||||
|
|
||||||
|
section.info form input {
|
||||||
|
width: 100%;
|
||||||
|
line-height: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
section.info form label, section.info form input {
|
||||||
|
padding: 0.2rem 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
section.info form input[type=checkbox] {
|
||||||
|
justify-self: start;
|
||||||
|
width: initial;
|
||||||
|
}
|
||||||
|
|
||||||
|
section.info form input:-moz-read-only {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
section.info form input:read-only {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
section.info form input:invalid {
|
||||||
|
border-color: red;
|
||||||
|
}
|
||||||
|
|
||||||
|
section.info textarea {
|
||||||
|
width: 100%;
|
||||||
|
height: 8rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
section.info h1 {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
section.blocks .overflow {
|
||||||
|
max-height: 80vh;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
section.blocks .blocklist {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: auto 1fr auto;
|
||||||
|
grid-gap: 0.35rem 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
section.blocks .blocklist div {
|
||||||
|
background: rgb(70, 79, 88);
|
||||||
|
padding: 0.2rem 0.4rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
section.blocks .addblock {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr auto auto;
|
||||||
|
grid-gap: 0.35rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
section.blocks .addblock input, section.blocks .addblock select {
|
||||||
|
font-size: 1.2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
section.blocks .addblock input, section.blocks .addblock select, section.blocks .addblock textarea {
|
||||||
|
padding: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
section.blocks .addblock div {
|
||||||
|
grid-column: 1/4;
|
||||||
|
}
|
||||||
|
|
||||||
|
section.blocks .addblock div.single input {
|
||||||
|
width: initial;
|
||||||
|
}
|
||||||
|
|
||||||
|
section.blocks h3 {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
section.blocks .controls {
|
||||||
|
display: flex;
|
||||||
|
gap: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.error {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hidden {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.notImplemented {
|
||||||
|
border: 2px solid rgb(70, 79, 88);
|
||||||
|
background: repeating-linear-gradient(
|
||||||
|
-45deg,
|
||||||
|
#525c66,
|
||||||
|
#525c66 10px,
|
||||||
|
rgb(70, 79, 88) 10px,
|
||||||
|
rgb(70, 79, 88) 20px
|
||||||
|
) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
|
||||||
main {
|
main {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
}
|
}
|
||||||
|
|
@ -5,13 +6,14 @@ main {
|
||||||
.headerimage img {
|
.headerimage img {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 15em;
|
height: 15em;
|
||||||
object-fit: cover;
|
-o-object-fit: cover;
|
||||||
|
object-fit: cover;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.profile {
|
.profile {
|
||||||
position: relative;
|
position: relative;
|
||||||
background: rgb(75, 84, 93);
|
background: color(var(--bg) lightness(-3%));
|
||||||
padding: 2rem;
|
padding: 2rem;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
|
@ -49,7 +51,8 @@ main {
|
||||||
}
|
}
|
||||||
|
|
||||||
.profile .basic .avatar-container .avatar img {
|
.profile .basic .avatar-container .avatar img {
|
||||||
object-fit: cover;
|
-o-object-fit: cover;
|
||||||
|
object-fit: cover;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
@ -82,13 +85,13 @@ main {
|
||||||
}
|
}
|
||||||
|
|
||||||
.profile .detailed .bio a {
|
.profile .detailed .bio a {
|
||||||
color: #de8957;
|
color: var(--acc1);
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
.accountstats {
|
.accountstats {
|
||||||
position: relative;
|
position: relative;
|
||||||
background: rgb(75, 84, 93);
|
background: color(var(--bg) lightness(-3%));
|
||||||
padding: 0.5rem;
|
padding: 0.5rem;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
|
@ -98,7 +101,7 @@ main {
|
||||||
}
|
}
|
||||||
|
|
||||||
.accountstats .entry {
|
.accountstats .entry {
|
||||||
background: rgb(89, 99, 110);
|
background: color(var(--bg) lightness(+3%));
|
||||||
padding: 0.5rem;
|
padding: 0.5rem;
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
@ -108,3 +111,4 @@ footer + div {
|
||||||
/* something weird from the devstack.. */
|
/* something weird from the devstack.. */
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
|
||||||
main {
|
main {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
grid-auto-rows: auto;
|
grid-auto-rows: auto;
|
||||||
|
|
@ -10,12 +11,13 @@ main {
|
||||||
|
|
||||||
.toot {
|
.toot {
|
||||||
position: relative;
|
position: relative;
|
||||||
background: rgb(75, 84, 93);
|
background: color(var(--bg) lightness(-3%));
|
||||||
padding: 2rem;
|
padding: 2rem;
|
||||||
/* padding-bottom: 0; */
|
/* padding-bottom: 0; */
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 3.2rem auto 1fr;
|
grid-template-columns: 3.2rem auto 1fr;
|
||||||
column-gap: 0.5rem;
|
-moz-column-gap: 0.5rem;
|
||||||
|
column-gap: 0.5rem;
|
||||||
margin-bottom: 0.2rem;
|
margin-bottom: 0.2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -33,7 +35,8 @@ main {
|
||||||
.toot .avatar img {
|
.toot .avatar img {
|
||||||
height: 3.2rem;
|
height: 3.2rem;
|
||||||
width: 3.2rem;
|
width: 3.2rem;
|
||||||
object-fit: cover;
|
-o-object-fit: cover;
|
||||||
|
object-fit: cover;
|
||||||
}
|
}
|
||||||
|
|
||||||
.toot .displayname {
|
.toot .displayname {
|
||||||
|
|
@ -43,7 +46,7 @@ main {
|
||||||
}
|
}
|
||||||
|
|
||||||
.toot .username {
|
.toot .username {
|
||||||
color: #b0b0b5;
|
color: var(--fg_dark);
|
||||||
justify-self: start;
|
justify-self: start;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -52,7 +55,7 @@ main {
|
||||||
}
|
}
|
||||||
|
|
||||||
.toot .spoiler label {
|
.toot .spoiler label {
|
||||||
background: #de8957;
|
background: var(--acc1);
|
||||||
border-radius: 0.3rem;
|
border-radius: 0.3rem;
|
||||||
padding: 0.3rem;
|
padding: 0.3rem;
|
||||||
margin-left: 0.4rem;
|
margin-left: 0.4rem;
|
||||||
|
|
@ -67,7 +70,7 @@ main {
|
||||||
}
|
}
|
||||||
|
|
||||||
.toot .text a {
|
.toot .text a {
|
||||||
color: #de8957;
|
color: var(--acc1);
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -92,7 +95,7 @@ main {
|
||||||
bottom: 0.1rem;
|
bottom: 0.1rem;
|
||||||
right: 0.4rem;
|
right: 0.4rem;
|
||||||
color: white;
|
color: white;
|
||||||
background: #5897df;
|
background: var(--blue);
|
||||||
padding: 0.2rem 0.4rem;
|
padding: 0.2rem 0.4rem;
|
||||||
border-radius: 100%;
|
border-radius: 100%;
|
||||||
z-index: 3;
|
z-index: 3;
|
||||||
|
|
@ -119,7 +122,8 @@ main {
|
||||||
.toot .media img {
|
.toot .media img {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
object-fit: cover;
|
-o-object-fit: cover;
|
||||||
|
object-fit: cover;
|
||||||
}
|
}
|
||||||
|
|
||||||
.toot .media.single a {
|
.toot .media.single a {
|
||||||
|
|
@ -156,13 +160,14 @@ main {
|
||||||
}
|
}
|
||||||
|
|
||||||
.toot .info div::after {
|
.toot .info div::after {
|
||||||
|
--size: 0.25rem;
|
||||||
display: block;
|
display: block;
|
||||||
background: #b0b0b5;
|
background: var(--fg_dark);
|
||||||
height: 0.25rem;
|
height: var(--size);
|
||||||
width: 0.25rem;
|
width: var(--size);
|
||||||
content: "";
|
content: "";
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: calc((1.5rem - 0.25rem) / 2);
|
top: calc((1.5rem - var(--size)) / 2);
|
||||||
right: 0.55rem;
|
right: 0.55rem;
|
||||||
border-radius: 1rem;
|
border-radius: 1rem;
|
||||||
}
|
}
|
||||||
|
|
@ -188,21 +193,24 @@ main {
|
||||||
z-index: 0;
|
z-index: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.toot {}
|
.toot {
|
||||||
|
|
||||||
|
--border-radius: 0.3rem;
|
||||||
|
}
|
||||||
|
|
||||||
.toot:first-child {
|
.toot:first-child {
|
||||||
/* top left, top right */
|
/* top left, top right */
|
||||||
border-radius: 0.3rem 0.3rem 0 0;
|
border-radius: var(--border)-radius var(--border)-radius 0 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.toot:last-child {
|
.toot:last-child {
|
||||||
/* bottom left, bottom right */
|
/* bottom left, bottom right */
|
||||||
border-radius: 0 0 0.3rem 0.3rem;
|
border-radius: 0 0 var(--border)-radius var(--border)-radius;
|
||||||
padding-bottom: 1.5rem;
|
padding-bottom: 1.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.toot.expanded {
|
.toot.expanded {
|
||||||
background: #525c66;
|
background: var(--bg);
|
||||||
padding-bottom: 1.5rem;
|
padding-bottom: 1.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -227,4 +235,4 @@ main {
|
||||||
|
|
||||||
footer + div { /* something weird from the devstack.. */
|
footer + div { /* something weird from the devstack.. */
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
18
web/assets/bundled/user-panel.js
Normal file
18
web/assets/bundled/user-panel.js
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({30:[function(require,module,exports){
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
var Promise = require("bluebird");
|
||||||
|
|
||||||
|
var React = require("react");
|
||||||
|
|
||||||
|
var ReactDom = require("react-dom"); // require("./style.css");
|
||||||
|
|
||||||
|
|
||||||
|
function App() {
|
||||||
|
return "hello world - user panel";
|
||||||
|
}
|
||||||
|
|
||||||
|
ReactDom.render( /*#__PURE__*/React.createElement(App, null), document.getElementById("root"));
|
||||||
|
|
||||||
|
},{"bluebird":15,"react":23,"react-dom":20}]},{},[30])
|
||||||
|
//# sourceMappingURL=data:application/json;charset:utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9mYWN0b3ItYnVuZGxlL25vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJwYW5lbHMvdXNlci9pbmRleC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQ0FBOztBQUVBLElBQU0sT0FBTyxHQUFHLE9BQU8sQ0FBQyxVQUFELENBQXZCOztBQUNBLElBQU0sS0FBSyxHQUFHLE9BQU8sQ0FBQyxPQUFELENBQXJCOztBQUNBLElBQU0sUUFBUSxHQUFHLE9BQU8sQ0FBQyxXQUFELENBQXhCLEMsQ0FFQTs7O0FBRUEsU0FBUyxHQUFULEdBQWU7QUFDZCxTQUFPLDBCQUFQO0FBQ0E7O0FBRUQsUUFBUSxDQUFDLE1BQVQsZUFBZ0Isb0JBQUMsR0FBRCxPQUFoQixFQUF3QixRQUFRLENBQUMsY0FBVCxDQUF3QixNQUF4QixDQUF4QiIsImZpbGUiOiJnZW5lcmF0ZWQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlc0NvbnRlbnQiOlsiKGZ1bmN0aW9uIGUodCxuLHIpe2Z1bmN0aW9uIHMobyx1KXtpZighbltvXSl7aWYoIXRbb10pe3ZhciBhPXR5cGVvZiByZXF1aXJlPT1cImZ1bmN0aW9uXCImJnJlcXVpcmU7aWYoIXUmJmEpcmV0dXJuIGEobywhMCk7aWYoaSlyZXR1cm4gaShvLCEwKTt2YXIgZj1uZXcgRXJyb3IoXCJDYW5ub3QgZmluZCBtb2R1bGUgJ1wiK28rXCInXCIpO3Rocm93IGYuY29kZT1cIk1PRFVMRV9OT1RfRk9VTkRcIixmfXZhciBsPW5bb109e2V4cG9ydHM6e319O3Rbb11bMF0uY2FsbChsLmV4cG9ydHMsZnVuY3Rpb24oZSl7dmFyIG49dFtvXVsxXVtlXTtyZXR1cm4gcyhuP246ZSl9LGwsbC5leHBvcnRzLGUsdCxuLHIpfXJldHVybiBuW29dLmV4cG9ydHN9dmFyIGk9dHlwZW9mIHJlcXVpcmU9PVwiZnVuY3Rpb25cIiYmcmVxdWlyZTtmb3IodmFyIG89MDtvPHIubGVuZ3RoO28rKylzKHJbb10pO3JldHVybiBzfSkiLCJcInVzZSBzdHJpY3RcIjtcblxuY29uc3QgUHJvbWlzZSA9IHJlcXVpcmUoXCJibHVlYmlyZFwiKTtcbmNvbnN0IFJlYWN0ID0gcmVxdWlyZShcInJlYWN0XCIpO1xuY29uc3QgUmVhY3REb20gPSByZXF1aXJlKFwicmVhY3QtZG9tXCIpO1xuXG4vLyByZXF1aXJlKFwiLi9zdHlsZS5jc3NcIik7XG5cbmZ1bmN0aW9uIEFwcCgpIHtcblx0cmV0dXJuIFwiaGVsbG8gd29ybGQgLSB1c2VyIHBhbmVsXCI7XG59XG5cblJlYWN0RG9tLnJlbmRlcig8QXBwLz4sIGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKFwicm9vdFwiKSk7Il19
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
"use strict";
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
"extends": "@f0x52/eslint-config"
|
|
||||||
};
|
|
||||||
3
web/gotosocial-styling/.gitignore
vendored
3
web/gotosocial-styling/.gitignore
vendored
|
|
@ -1,3 +0,0 @@
|
||||||
node_modules
|
|
||||||
yarn-error.log
|
|
||||||
build/*
|
|
||||||
|
|
@ -1,661 +0,0 @@
|
||||||
GNU AFFERO GENERAL PUBLIC LICENSE
|
|
||||||
Version 3, 19 November 2007
|
|
||||||
|
|
||||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
|
||||||
of this license document, but changing it is not allowed.
|
|
||||||
|
|
||||||
Preamble
|
|
||||||
|
|
||||||
The GNU Affero General Public License is a free, copyleft license for
|
|
||||||
software and other kinds of works, specifically designed to ensure
|
|
||||||
cooperation with the community in the case of network server software.
|
|
||||||
|
|
||||||
The licenses for most software and other practical works are designed
|
|
||||||
to take away your freedom to share and change the works. By contrast,
|
|
||||||
our General Public Licenses are intended to guarantee your freedom to
|
|
||||||
share and change all versions of a program--to make sure it remains free
|
|
||||||
software for all its users.
|
|
||||||
|
|
||||||
When we speak of free software, we are referring to freedom, not
|
|
||||||
price. Our General Public Licenses are designed to make sure that you
|
|
||||||
have the freedom to distribute copies of free software (and charge for
|
|
||||||
them if you wish), that you receive source code or can get it if you
|
|
||||||
want it, that you can change the software or use pieces of it in new
|
|
||||||
free programs, and that you know you can do these things.
|
|
||||||
|
|
||||||
Developers that use our General Public Licenses protect your rights
|
|
||||||
with two steps: (1) assert copyright on the software, and (2) offer
|
|
||||||
you this License which gives you legal permission to copy, distribute
|
|
||||||
and/or modify the software.
|
|
||||||
|
|
||||||
A secondary benefit of defending all users' freedom is that
|
|
||||||
improvements made in alternate versions of the program, if they
|
|
||||||
receive widespread use, become available for other developers to
|
|
||||||
incorporate. Many developers of free software are heartened and
|
|
||||||
encouraged by the resulting cooperation. However, in the case of
|
|
||||||
software used on network servers, this result may fail to come about.
|
|
||||||
The GNU General Public License permits making a modified version and
|
|
||||||
letting the public access it on a server without ever releasing its
|
|
||||||
source code to the public.
|
|
||||||
|
|
||||||
The GNU Affero General Public License is designed specifically to
|
|
||||||
ensure that, in such cases, the modified source code becomes available
|
|
||||||
to the community. It requires the operator of a network server to
|
|
||||||
provide the source code of the modified version running there to the
|
|
||||||
users of that server. Therefore, public use of a modified version, on
|
|
||||||
a publicly accessible server, gives the public access to the source
|
|
||||||
code of the modified version.
|
|
||||||
|
|
||||||
An older license, called the Affero General Public License and
|
|
||||||
published by Affero, was designed to accomplish similar goals. This is
|
|
||||||
a different license, not a version of the Affero GPL, but Affero has
|
|
||||||
released a new version of the Affero GPL which permits relicensing under
|
|
||||||
this license.
|
|
||||||
|
|
||||||
The precise terms and conditions for copying, distribution and
|
|
||||||
modification follow.
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
0. Definitions.
|
|
||||||
|
|
||||||
"This License" refers to version 3 of the GNU Affero General Public License.
|
|
||||||
|
|
||||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
|
||||||
works, such as semiconductor masks.
|
|
||||||
|
|
||||||
"The Program" refers to any copyrightable work licensed under this
|
|
||||||
License. Each licensee is addressed as "you". "Licensees" and
|
|
||||||
"recipients" may be individuals or organizations.
|
|
||||||
|
|
||||||
To "modify" a work means to copy from or adapt all or part of the work
|
|
||||||
in a fashion requiring copyright permission, other than the making of an
|
|
||||||
exact copy. The resulting work is called a "modified version" of the
|
|
||||||
earlier work or a work "based on" the earlier work.
|
|
||||||
|
|
||||||
A "covered work" means either the unmodified Program or a work based
|
|
||||||
on the Program.
|
|
||||||
|
|
||||||
To "propagate" a work means to do anything with it that, without
|
|
||||||
permission, would make you directly or secondarily liable for
|
|
||||||
infringement under applicable copyright law, except executing it on a
|
|
||||||
computer or modifying a private copy. Propagation includes copying,
|
|
||||||
distribution (with or without modification), making available to the
|
|
||||||
public, and in some countries other activities as well.
|
|
||||||
|
|
||||||
To "convey" a work means any kind of propagation that enables other
|
|
||||||
parties to make or receive copies. Mere interaction with a user through
|
|
||||||
a computer network, with no transfer of a copy, is not conveying.
|
|
||||||
|
|
||||||
An interactive user interface displays "Appropriate Legal Notices"
|
|
||||||
to the extent that it includes a convenient and prominently visible
|
|
||||||
feature that (1) displays an appropriate copyright notice, and (2)
|
|
||||||
tells the user that there is no warranty for the work (except to the
|
|
||||||
extent that warranties are provided), that licensees may convey the
|
|
||||||
work under this License, and how to view a copy of this License. If
|
|
||||||
the interface presents a list of user commands or options, such as a
|
|
||||||
menu, a prominent item in the list meets this criterion.
|
|
||||||
|
|
||||||
1. Source Code.
|
|
||||||
|
|
||||||
The "source code" for a work means the preferred form of the work
|
|
||||||
for making modifications to it. "Object code" means any non-source
|
|
||||||
form of a work.
|
|
||||||
|
|
||||||
A "Standard Interface" means an interface that either is an official
|
|
||||||
standard defined by a recognized standards body, or, in the case of
|
|
||||||
interfaces specified for a particular programming language, one that
|
|
||||||
is widely used among developers working in that language.
|
|
||||||
|
|
||||||
The "System Libraries" of an executable work include anything, other
|
|
||||||
than the work as a whole, that (a) is included in the normal form of
|
|
||||||
packaging a Major Component, but which is not part of that Major
|
|
||||||
Component, and (b) serves only to enable use of the work with that
|
|
||||||
Major Component, or to implement a Standard Interface for which an
|
|
||||||
implementation is available to the public in source code form. A
|
|
||||||
"Major Component", in this context, means a major essential component
|
|
||||||
(kernel, window system, and so on) of the specific operating system
|
|
||||||
(if any) on which the executable work runs, or a compiler used to
|
|
||||||
produce the work, or an object code interpreter used to run it.
|
|
||||||
|
|
||||||
The "Corresponding Source" for a work in object code form means all
|
|
||||||
the source code needed to generate, install, and (for an executable
|
|
||||||
work) run the object code and to modify the work, including scripts to
|
|
||||||
control those activities. However, it does not include the work's
|
|
||||||
System Libraries, or general-purpose tools or generally available free
|
|
||||||
programs which are used unmodified in performing those activities but
|
|
||||||
which are not part of the work. For example, Corresponding Source
|
|
||||||
includes interface definition files associated with source files for
|
|
||||||
the work, and the source code for shared libraries and dynamically
|
|
||||||
linked subprograms that the work is specifically designed to require,
|
|
||||||
such as by intimate data communication or control flow between those
|
|
||||||
subprograms and other parts of the work.
|
|
||||||
|
|
||||||
The Corresponding Source need not include anything that users
|
|
||||||
can regenerate automatically from other parts of the Corresponding
|
|
||||||
Source.
|
|
||||||
|
|
||||||
The Corresponding Source for a work in source code form is that
|
|
||||||
same work.
|
|
||||||
|
|
||||||
2. Basic Permissions.
|
|
||||||
|
|
||||||
All rights granted under this License are granted for the term of
|
|
||||||
copyright on the Program, and are irrevocable provided the stated
|
|
||||||
conditions are met. This License explicitly affirms your unlimited
|
|
||||||
permission to run the unmodified Program. The output from running a
|
|
||||||
covered work is covered by this License only if the output, given its
|
|
||||||
content, constitutes a covered work. This License acknowledges your
|
|
||||||
rights of fair use or other equivalent, as provided by copyright law.
|
|
||||||
|
|
||||||
You may make, run and propagate covered works that you do not
|
|
||||||
convey, without conditions so long as your license otherwise remains
|
|
||||||
in force. You may convey covered works to others for the sole purpose
|
|
||||||
of having them make modifications exclusively for you, or provide you
|
|
||||||
with facilities for running those works, provided that you comply with
|
|
||||||
the terms of this License in conveying all material for which you do
|
|
||||||
not control copyright. Those thus making or running the covered works
|
|
||||||
for you must do so exclusively on your behalf, under your direction
|
|
||||||
and control, on terms that prohibit them from making any copies of
|
|
||||||
your copyrighted material outside their relationship with you.
|
|
||||||
|
|
||||||
Conveying under any other circumstances is permitted solely under
|
|
||||||
the conditions stated below. Sublicensing is not allowed; section 10
|
|
||||||
makes it unnecessary.
|
|
||||||
|
|
||||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
|
||||||
|
|
||||||
No covered work shall be deemed part of an effective technological
|
|
||||||
measure under any applicable law fulfilling obligations under article
|
|
||||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
|
||||||
similar laws prohibiting or restricting circumvention of such
|
|
||||||
measures.
|
|
||||||
|
|
||||||
When you convey a covered work, you waive any legal power to forbid
|
|
||||||
circumvention of technological measures to the extent such circumvention
|
|
||||||
is effected by exercising rights under this License with respect to
|
|
||||||
the covered work, and you disclaim any intention to limit operation or
|
|
||||||
modification of the work as a means of enforcing, against the work's
|
|
||||||
users, your or third parties' legal rights to forbid circumvention of
|
|
||||||
technological measures.
|
|
||||||
|
|
||||||
4. Conveying Verbatim Copies.
|
|
||||||
|
|
||||||
You may convey verbatim copies of the Program's source code as you
|
|
||||||
receive it, in any medium, provided that you conspicuously and
|
|
||||||
appropriately publish on each copy an appropriate copyright notice;
|
|
||||||
keep intact all notices stating that this License and any
|
|
||||||
non-permissive terms added in accord with section 7 apply to the code;
|
|
||||||
keep intact all notices of the absence of any warranty; and give all
|
|
||||||
recipients a copy of this License along with the Program.
|
|
||||||
|
|
||||||
You may charge any price or no price for each copy that you convey,
|
|
||||||
and you may offer support or warranty protection for a fee.
|
|
||||||
|
|
||||||
5. Conveying Modified Source Versions.
|
|
||||||
|
|
||||||
You may convey a work based on the Program, or the modifications to
|
|
||||||
produce it from the Program, in the form of source code under the
|
|
||||||
terms of section 4, provided that you also meet all of these conditions:
|
|
||||||
|
|
||||||
a) The work must carry prominent notices stating that you modified
|
|
||||||
it, and giving a relevant date.
|
|
||||||
|
|
||||||
b) The work must carry prominent notices stating that it is
|
|
||||||
released under this License and any conditions added under section
|
|
||||||
7. This requirement modifies the requirement in section 4 to
|
|
||||||
"keep intact all notices".
|
|
||||||
|
|
||||||
c) You must license the entire work, as a whole, under this
|
|
||||||
License to anyone who comes into possession of a copy. This
|
|
||||||
License will therefore apply, along with any applicable section 7
|
|
||||||
additional terms, to the whole of the work, and all its parts,
|
|
||||||
regardless of how they are packaged. This License gives no
|
|
||||||
permission to license the work in any other way, but it does not
|
|
||||||
invalidate such permission if you have separately received it.
|
|
||||||
|
|
||||||
d) If the work has interactive user interfaces, each must display
|
|
||||||
Appropriate Legal Notices; however, if the Program has interactive
|
|
||||||
interfaces that do not display Appropriate Legal Notices, your
|
|
||||||
work need not make them do so.
|
|
||||||
|
|
||||||
A compilation of a covered work with other separate and independent
|
|
||||||
works, which are not by their nature extensions of the covered work,
|
|
||||||
and which are not combined with it such as to form a larger program,
|
|
||||||
in or on a volume of a storage or distribution medium, is called an
|
|
||||||
"aggregate" if the compilation and its resulting copyright are not
|
|
||||||
used to limit the access or legal rights of the compilation's users
|
|
||||||
beyond what the individual works permit. Inclusion of a covered work
|
|
||||||
in an aggregate does not cause this License to apply to the other
|
|
||||||
parts of the aggregate.
|
|
||||||
|
|
||||||
6. Conveying Non-Source Forms.
|
|
||||||
|
|
||||||
You may convey a covered work in object code form under the terms
|
|
||||||
of sections 4 and 5, provided that you also convey the
|
|
||||||
machine-readable Corresponding Source under the terms of this License,
|
|
||||||
in one of these ways:
|
|
||||||
|
|
||||||
a) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by the
|
|
||||||
Corresponding Source fixed on a durable physical medium
|
|
||||||
customarily used for software interchange.
|
|
||||||
|
|
||||||
b) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by a
|
|
||||||
written offer, valid for at least three years and valid for as
|
|
||||||
long as you offer spare parts or customer support for that product
|
|
||||||
model, to give anyone who possesses the object code either (1) a
|
|
||||||
copy of the Corresponding Source for all the software in the
|
|
||||||
product that is covered by this License, on a durable physical
|
|
||||||
medium customarily used for software interchange, for a price no
|
|
||||||
more than your reasonable cost of physically performing this
|
|
||||||
conveying of source, or (2) access to copy the
|
|
||||||
Corresponding Source from a network server at no charge.
|
|
||||||
|
|
||||||
c) Convey individual copies of the object code with a copy of the
|
|
||||||
written offer to provide the Corresponding Source. This
|
|
||||||
alternative is allowed only occasionally and noncommercially, and
|
|
||||||
only if you received the object code with such an offer, in accord
|
|
||||||
with subsection 6b.
|
|
||||||
|
|
||||||
d) Convey the object code by offering access from a designated
|
|
||||||
place (gratis or for a charge), and offer equivalent access to the
|
|
||||||
Corresponding Source in the same way through the same place at no
|
|
||||||
further charge. You need not require recipients to copy the
|
|
||||||
Corresponding Source along with the object code. If the place to
|
|
||||||
copy the object code is a network server, the Corresponding Source
|
|
||||||
may be on a different server (operated by you or a third party)
|
|
||||||
that supports equivalent copying facilities, provided you maintain
|
|
||||||
clear directions next to the object code saying where to find the
|
|
||||||
Corresponding Source. Regardless of what server hosts the
|
|
||||||
Corresponding Source, you remain obligated to ensure that it is
|
|
||||||
available for as long as needed to satisfy these requirements.
|
|
||||||
|
|
||||||
e) Convey the object code using peer-to-peer transmission, provided
|
|
||||||
you inform other peers where the object code and Corresponding
|
|
||||||
Source of the work are being offered to the general public at no
|
|
||||||
charge under subsection 6d.
|
|
||||||
|
|
||||||
A separable portion of the object code, whose source code is excluded
|
|
||||||
from the Corresponding Source as a System Library, need not be
|
|
||||||
included in conveying the object code work.
|
|
||||||
|
|
||||||
A "User Product" is either (1) a "consumer product", which means any
|
|
||||||
tangible personal property which is normally used for personal, family,
|
|
||||||
or household purposes, or (2) anything designed or sold for incorporation
|
|
||||||
into a dwelling. In determining whether a product is a consumer product,
|
|
||||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
|
||||||
product received by a particular user, "normally used" refers to a
|
|
||||||
typical or common use of that class of product, regardless of the status
|
|
||||||
of the particular user or of the way in which the particular user
|
|
||||||
actually uses, or expects or is expected to use, the product. A product
|
|
||||||
is a consumer product regardless of whether the product has substantial
|
|
||||||
commercial, industrial or non-consumer uses, unless such uses represent
|
|
||||||
the only significant mode of use of the product.
|
|
||||||
|
|
||||||
"Installation Information" for a User Product means any methods,
|
|
||||||
procedures, authorization keys, or other information required to install
|
|
||||||
and execute modified versions of a covered work in that User Product from
|
|
||||||
a modified version of its Corresponding Source. The information must
|
|
||||||
suffice to ensure that the continued functioning of the modified object
|
|
||||||
code is in no case prevented or interfered with solely because
|
|
||||||
modification has been made.
|
|
||||||
|
|
||||||
If you convey an object code work under this section in, or with, or
|
|
||||||
specifically for use in, a User Product, and the conveying occurs as
|
|
||||||
part of a transaction in which the right of possession and use of the
|
|
||||||
User Product is transferred to the recipient in perpetuity or for a
|
|
||||||
fixed term (regardless of how the transaction is characterized), the
|
|
||||||
Corresponding Source conveyed under this section must be accompanied
|
|
||||||
by the Installation Information. But this requirement does not apply
|
|
||||||
if neither you nor any third party retains the ability to install
|
|
||||||
modified object code on the User Product (for example, the work has
|
|
||||||
been installed in ROM).
|
|
||||||
|
|
||||||
The requirement to provide Installation Information does not include a
|
|
||||||
requirement to continue to provide support service, warranty, or updates
|
|
||||||
for a work that has been modified or installed by the recipient, or for
|
|
||||||
the User Product in which it has been modified or installed. Access to a
|
|
||||||
network may be denied when the modification itself materially and
|
|
||||||
adversely affects the operation of the network or violates the rules and
|
|
||||||
protocols for communication across the network.
|
|
||||||
|
|
||||||
Corresponding Source conveyed, and Installation Information provided,
|
|
||||||
in accord with this section must be in a format that is publicly
|
|
||||||
documented (and with an implementation available to the public in
|
|
||||||
source code form), and must require no special password or key for
|
|
||||||
unpacking, reading or copying.
|
|
||||||
|
|
||||||
7. Additional Terms.
|
|
||||||
|
|
||||||
"Additional permissions" are terms that supplement the terms of this
|
|
||||||
License by making exceptions from one or more of its conditions.
|
|
||||||
Additional permissions that are applicable to the entire Program shall
|
|
||||||
be treated as though they were included in this License, to the extent
|
|
||||||
that they are valid under applicable law. If additional permissions
|
|
||||||
apply only to part of the Program, that part may be used separately
|
|
||||||
under those permissions, but the entire Program remains governed by
|
|
||||||
this License without regard to the additional permissions.
|
|
||||||
|
|
||||||
When you convey a copy of a covered work, you may at your option
|
|
||||||
remove any additional permissions from that copy, or from any part of
|
|
||||||
it. (Additional permissions may be written to require their own
|
|
||||||
removal in certain cases when you modify the work.) You may place
|
|
||||||
additional permissions on material, added by you to a covered work,
|
|
||||||
for which you have or can give appropriate copyright permission.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, for material you
|
|
||||||
add to a covered work, you may (if authorized by the copyright holders of
|
|
||||||
that material) supplement the terms of this License with terms:
|
|
||||||
|
|
||||||
a) Disclaiming warranty or limiting liability differently from the
|
|
||||||
terms of sections 15 and 16 of this License; or
|
|
||||||
|
|
||||||
b) Requiring preservation of specified reasonable legal notices or
|
|
||||||
author attributions in that material or in the Appropriate Legal
|
|
||||||
Notices displayed by works containing it; or
|
|
||||||
|
|
||||||
c) Prohibiting misrepresentation of the origin of that material, or
|
|
||||||
requiring that modified versions of such material be marked in
|
|
||||||
reasonable ways as different from the original version; or
|
|
||||||
|
|
||||||
d) Limiting the use for publicity purposes of names of licensors or
|
|
||||||
authors of the material; or
|
|
||||||
|
|
||||||
e) Declining to grant rights under trademark law for use of some
|
|
||||||
trade names, trademarks, or service marks; or
|
|
||||||
|
|
||||||
f) Requiring indemnification of licensors and authors of that
|
|
||||||
material by anyone who conveys the material (or modified versions of
|
|
||||||
it) with contractual assumptions of liability to the recipient, for
|
|
||||||
any liability that these contractual assumptions directly impose on
|
|
||||||
those licensors and authors.
|
|
||||||
|
|
||||||
All other non-permissive additional terms are considered "further
|
|
||||||
restrictions" within the meaning of section 10. If the Program as you
|
|
||||||
received it, or any part of it, contains a notice stating that it is
|
|
||||||
governed by this License along with a term that is a further
|
|
||||||
restriction, you may remove that term. If a license document contains
|
|
||||||
a further restriction but permits relicensing or conveying under this
|
|
||||||
License, you may add to a covered work material governed by the terms
|
|
||||||
of that license document, provided that the further restriction does
|
|
||||||
not survive such relicensing or conveying.
|
|
||||||
|
|
||||||
If you add terms to a covered work in accord with this section, you
|
|
||||||
must place, in the relevant source files, a statement of the
|
|
||||||
additional terms that apply to those files, or a notice indicating
|
|
||||||
where to find the applicable terms.
|
|
||||||
|
|
||||||
Additional terms, permissive or non-permissive, may be stated in the
|
|
||||||
form of a separately written license, or stated as exceptions;
|
|
||||||
the above requirements apply either way.
|
|
||||||
|
|
||||||
8. Termination.
|
|
||||||
|
|
||||||
You may not propagate or modify a covered work except as expressly
|
|
||||||
provided under this License. Any attempt otherwise to propagate or
|
|
||||||
modify it is void, and will automatically terminate your rights under
|
|
||||||
this License (including any patent licenses granted under the third
|
|
||||||
paragraph of section 11).
|
|
||||||
|
|
||||||
However, if you cease all violation of this License, then your
|
|
||||||
license from a particular copyright holder is reinstated (a)
|
|
||||||
provisionally, unless and until the copyright holder explicitly and
|
|
||||||
finally terminates your license, and (b) permanently, if the copyright
|
|
||||||
holder fails to notify you of the violation by some reasonable means
|
|
||||||
prior to 60 days after the cessation.
|
|
||||||
|
|
||||||
Moreover, your license from a particular copyright holder is
|
|
||||||
reinstated permanently if the copyright holder notifies you of the
|
|
||||||
violation by some reasonable means, this is the first time you have
|
|
||||||
received notice of violation of this License (for any work) from that
|
|
||||||
copyright holder, and you cure the violation prior to 30 days after
|
|
||||||
your receipt of the notice.
|
|
||||||
|
|
||||||
Termination of your rights under this section does not terminate the
|
|
||||||
licenses of parties who have received copies or rights from you under
|
|
||||||
this License. If your rights have been terminated and not permanently
|
|
||||||
reinstated, you do not qualify to receive new licenses for the same
|
|
||||||
material under section 10.
|
|
||||||
|
|
||||||
9. Acceptance Not Required for Having Copies.
|
|
||||||
|
|
||||||
You are not required to accept this License in order to receive or
|
|
||||||
run a copy of the Program. Ancillary propagation of a covered work
|
|
||||||
occurring solely as a consequence of using peer-to-peer transmission
|
|
||||||
to receive a copy likewise does not require acceptance. However,
|
|
||||||
nothing other than this License grants you permission to propagate or
|
|
||||||
modify any covered work. These actions infringe copyright if you do
|
|
||||||
not accept this License. Therefore, by modifying or propagating a
|
|
||||||
covered work, you indicate your acceptance of this License to do so.
|
|
||||||
|
|
||||||
10. Automatic Licensing of Downstream Recipients.
|
|
||||||
|
|
||||||
Each time you convey a covered work, the recipient automatically
|
|
||||||
receives a license from the original licensors, to run, modify and
|
|
||||||
propagate that work, subject to this License. You are not responsible
|
|
||||||
for enforcing compliance by third parties with this License.
|
|
||||||
|
|
||||||
An "entity transaction" is a transaction transferring control of an
|
|
||||||
organization, or substantially all assets of one, or subdividing an
|
|
||||||
organization, or merging organizations. If propagation of a covered
|
|
||||||
work results from an entity transaction, each party to that
|
|
||||||
transaction who receives a copy of the work also receives whatever
|
|
||||||
licenses to the work the party's predecessor in interest had or could
|
|
||||||
give under the previous paragraph, plus a right to possession of the
|
|
||||||
Corresponding Source of the work from the predecessor in interest, if
|
|
||||||
the predecessor has it or can get it with reasonable efforts.
|
|
||||||
|
|
||||||
You may not impose any further restrictions on the exercise of the
|
|
||||||
rights granted or affirmed under this License. For example, you may
|
|
||||||
not impose a license fee, royalty, or other charge for exercise of
|
|
||||||
rights granted under this License, and you may not initiate litigation
|
|
||||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
|
||||||
any patent claim is infringed by making, using, selling, offering for
|
|
||||||
sale, or importing the Program or any portion of it.
|
|
||||||
|
|
||||||
11. Patents.
|
|
||||||
|
|
||||||
A "contributor" is a copyright holder who authorizes use under this
|
|
||||||
License of the Program or a work on which the Program is based. The
|
|
||||||
work thus licensed is called the contributor's "contributor version".
|
|
||||||
|
|
||||||
A contributor's "essential patent claims" are all patent claims
|
|
||||||
owned or controlled by the contributor, whether already acquired or
|
|
||||||
hereafter acquired, that would be infringed by some manner, permitted
|
|
||||||
by this License, of making, using, or selling its contributor version,
|
|
||||||
but do not include claims that would be infringed only as a
|
|
||||||
consequence of further modification of the contributor version. For
|
|
||||||
purposes of this definition, "control" includes the right to grant
|
|
||||||
patent sublicenses in a manner consistent with the requirements of
|
|
||||||
this License.
|
|
||||||
|
|
||||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
|
||||||
patent license under the contributor's essential patent claims, to
|
|
||||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
|
||||||
propagate the contents of its contributor version.
|
|
||||||
|
|
||||||
In the following three paragraphs, a "patent license" is any express
|
|
||||||
agreement or commitment, however denominated, not to enforce a patent
|
|
||||||
(such as an express permission to practice a patent or covenant not to
|
|
||||||
sue for patent infringement). To "grant" such a patent license to a
|
|
||||||
party means to make such an agreement or commitment not to enforce a
|
|
||||||
patent against the party.
|
|
||||||
|
|
||||||
If you convey a covered work, knowingly relying on a patent license,
|
|
||||||
and the Corresponding Source of the work is not available for anyone
|
|
||||||
to copy, free of charge and under the terms of this License, through a
|
|
||||||
publicly available network server or other readily accessible means,
|
|
||||||
then you must either (1) cause the Corresponding Source to be so
|
|
||||||
available, or (2) arrange to deprive yourself of the benefit of the
|
|
||||||
patent license for this particular work, or (3) arrange, in a manner
|
|
||||||
consistent with the requirements of this License, to extend the patent
|
|
||||||
license to downstream recipients. "Knowingly relying" means you have
|
|
||||||
actual knowledge that, but for the patent license, your conveying the
|
|
||||||
covered work in a country, or your recipient's use of the covered work
|
|
||||||
in a country, would infringe one or more identifiable patents in that
|
|
||||||
country that you have reason to believe are valid.
|
|
||||||
|
|
||||||
If, pursuant to or in connection with a single transaction or
|
|
||||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
|
||||||
covered work, and grant a patent license to some of the parties
|
|
||||||
receiving the covered work authorizing them to use, propagate, modify
|
|
||||||
or convey a specific copy of the covered work, then the patent license
|
|
||||||
you grant is automatically extended to all recipients of the covered
|
|
||||||
work and works based on it.
|
|
||||||
|
|
||||||
A patent license is "discriminatory" if it does not include within
|
|
||||||
the scope of its coverage, prohibits the exercise of, or is
|
|
||||||
conditioned on the non-exercise of one or more of the rights that are
|
|
||||||
specifically granted under this License. You may not convey a covered
|
|
||||||
work if you are a party to an arrangement with a third party that is
|
|
||||||
in the business of distributing software, under which you make payment
|
|
||||||
to the third party based on the extent of your activity of conveying
|
|
||||||
the work, and under which the third party grants, to any of the
|
|
||||||
parties who would receive the covered work from you, a discriminatory
|
|
||||||
patent license (a) in connection with copies of the covered work
|
|
||||||
conveyed by you (or copies made from those copies), or (b) primarily
|
|
||||||
for and in connection with specific products or compilations that
|
|
||||||
contain the covered work, unless you entered into that arrangement,
|
|
||||||
or that patent license was granted, prior to 28 March 2007.
|
|
||||||
|
|
||||||
Nothing in this License shall be construed as excluding or limiting
|
|
||||||
any implied license or other defenses to infringement that may
|
|
||||||
otherwise be available to you under applicable patent law.
|
|
||||||
|
|
||||||
12. No Surrender of Others' Freedom.
|
|
||||||
|
|
||||||
If conditions are imposed on you (whether by court order, agreement or
|
|
||||||
otherwise) that contradict the conditions of this License, they do not
|
|
||||||
excuse you from the conditions of this License. If you cannot convey a
|
|
||||||
covered work so as to satisfy simultaneously your obligations under this
|
|
||||||
License and any other pertinent obligations, then as a consequence you may
|
|
||||||
not convey it at all. For example, if you agree to terms that obligate you
|
|
||||||
to collect a royalty for further conveying from those to whom you convey
|
|
||||||
the Program, the only way you could satisfy both those terms and this
|
|
||||||
License would be to refrain entirely from conveying the Program.
|
|
||||||
|
|
||||||
13. Remote Network Interaction; Use with the GNU General Public License.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, if you modify the
|
|
||||||
Program, your modified version must prominently offer all users
|
|
||||||
interacting with it remotely through a computer network (if your version
|
|
||||||
supports such interaction) an opportunity to receive the Corresponding
|
|
||||||
Source of your version by providing access to the Corresponding Source
|
|
||||||
from a network server at no charge, through some standard or customary
|
|
||||||
means of facilitating copying of software. This Corresponding Source
|
|
||||||
shall include the Corresponding Source for any work covered by version 3
|
|
||||||
of the GNU General Public License that is incorporated pursuant to the
|
|
||||||
following paragraph.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, you have
|
|
||||||
permission to link or combine any covered work with a work licensed
|
|
||||||
under version 3 of the GNU General Public License into a single
|
|
||||||
combined work, and to convey the resulting work. The terms of this
|
|
||||||
License will continue to apply to the part which is the covered work,
|
|
||||||
but the work with which it is combined will remain governed by version
|
|
||||||
3 of the GNU General Public License.
|
|
||||||
|
|
||||||
14. Revised Versions of this License.
|
|
||||||
|
|
||||||
The Free Software Foundation may publish revised and/or new versions of
|
|
||||||
the GNU Affero General Public License from time to time. Such new versions
|
|
||||||
will be similar in spirit to the present version, but may differ in detail to
|
|
||||||
address new problems or concerns.
|
|
||||||
|
|
||||||
Each version is given a distinguishing version number. If the
|
|
||||||
Program specifies that a certain numbered version of the GNU Affero General
|
|
||||||
Public License "or any later version" applies to it, you have the
|
|
||||||
option of following the terms and conditions either of that numbered
|
|
||||||
version or of any later version published by the Free Software
|
|
||||||
Foundation. If the Program does not specify a version number of the
|
|
||||||
GNU Affero General Public License, you may choose any version ever published
|
|
||||||
by the Free Software Foundation.
|
|
||||||
|
|
||||||
If the Program specifies that a proxy can decide which future
|
|
||||||
versions of the GNU Affero General Public License can be used, that proxy's
|
|
||||||
public statement of acceptance of a version permanently authorizes you
|
|
||||||
to choose that version for the Program.
|
|
||||||
|
|
||||||
Later license versions may give you additional or different
|
|
||||||
permissions. However, no additional obligations are imposed on any
|
|
||||||
author or copyright holder as a result of your choosing to follow a
|
|
||||||
later version.
|
|
||||||
|
|
||||||
15. Disclaimer of Warranty.
|
|
||||||
|
|
||||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
|
||||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
|
||||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
|
||||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
|
||||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
|
||||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
|
||||||
|
|
||||||
16. Limitation of Liability.
|
|
||||||
|
|
||||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
|
||||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
|
||||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
|
||||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
|
||||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
|
||||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
|
||||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
|
||||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
|
||||||
SUCH DAMAGES.
|
|
||||||
|
|
||||||
17. Interpretation of Sections 15 and 16.
|
|
||||||
|
|
||||||
If the disclaimer of warranty and limitation of liability provided
|
|
||||||
above cannot be given local legal effect according to their terms,
|
|
||||||
reviewing courts shall apply local law that most closely approximates
|
|
||||||
an absolute waiver of all civil liability in connection with the
|
|
||||||
Program, unless a warranty or assumption of liability accompanies a
|
|
||||||
copy of the Program in return for a fee.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
How to Apply These Terms to Your New Programs
|
|
||||||
|
|
||||||
If you develop a new program, and you want it to be of the greatest
|
|
||||||
possible use to the public, the best way to achieve this is to make it
|
|
||||||
free software which everyone can redistribute and change under these terms.
|
|
||||||
|
|
||||||
To do so, attach the following notices to the program. It is safest
|
|
||||||
to attach them to the start of each source file to most effectively
|
|
||||||
state the exclusion of warranty; and each file should have at least
|
|
||||||
the "copyright" line and a pointer to where the full notice is found.
|
|
||||||
|
|
||||||
<one line to give the program's name and a brief idea of what it does.>
|
|
||||||
Copyright (C) <year> <name of author>
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Affero General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Affero General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Affero General Public License
|
|
||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
|
||||||
|
|
||||||
If your software can interact with users remotely through a computer
|
|
||||||
network, you should also make sure that it provides a way for users to
|
|
||||||
get its source. For example, if your program is a web application, its
|
|
||||||
interface could display a "Source" link that leads users to an archive
|
|
||||||
of the code. There are many ways you could offer source, and different
|
|
||||||
solutions will be better for different programs; see section 13 for the
|
|
||||||
specific requirements.
|
|
||||||
|
|
||||||
You should also get your employer (if you work as a programmer) or school,
|
|
||||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
|
||||||
For more information on this, and how to apply and follow the GNU AGPL, see
|
|
||||||
<https://www.gnu.org/licenses/>.
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
# GoToSocial Styling
|
|
||||||
|
|
||||||
Common package for the PostCSS styling of GoToSocial (related) pages.
|
|
||||||
|
|
||||||
## Bundle
|
|
||||||
Source in `src/style.css` is bundled by running `node index.js`. Output appears in `build/bundle.css`, and can be required from other packages with `require("gotosocial-styling/build/bundle.css")`.
|
|
||||||
|
|
||||||
## Development
|
|
||||||
You can run `NODE_ENV=development node index.js` to start a livereloading setup that automatically re-bundles on file changes in `src/`.
|
|
||||||
|
|
||||||
## License, donations
|
|
||||||
[AGPL-3.0](https://www.gnu.org/licenses/agpl-3.0.html). If you want to support my work, you can:
|
|
||||||
<a href="https://liberapay.com/f0x/donate"><img alt="Donate using Liberapay" src="https://liberapay.com/assets/widgets/donate.svg"></a>
|
|
||||||
|
|
||||||
|
|
||||||
## Changelog
|
|
||||||
### v0.0.1 (August 29th, 2021)
|
|
||||||
initial release
|
|
||||||
|
|
@ -1,85 +0,0 @@
|
||||||
"use strict";
|
|
||||||
|
|
||||||
const Promise = require("bluebird");
|
|
||||||
const fs = require("fs").promises;
|
|
||||||
const postcss = require('postcss');
|
|
||||||
const {parse} = require("postcss-scss");
|
|
||||||
const argv = require('minimist')(process.argv.slice(2));
|
|
||||||
|
|
||||||
/*
|
|
||||||
Bundle all postCSS files under the `templates/` directory separately, each prepended with the (variable) contents of ./colors.css
|
|
||||||
Outputs in plain CSS are in `build/`, split by template
|
|
||||||
*/
|
|
||||||
|
|
||||||
const postcssPlugins = ["postcss-strip-inline-comments", "postcss-nested", "postcss-simple-vars", "postcss-color-function"].map((plugin) => require(plugin)());
|
|
||||||
|
|
||||||
function getTemplates() {
|
|
||||||
return fs.readdir(`${__dirname}/templates`).then((templates) => {
|
|
||||||
return templates.map((a) => {
|
|
||||||
return [a, `${__dirname}/templates/${a}`];
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
getTemplates();
|
|
||||||
|
|
||||||
function bundle([template, path]) {
|
|
||||||
return Promise.try(() => {
|
|
||||||
return Promise.all([
|
|
||||||
fs.readFile(`${__dirname}/colors.css`, "utf-8"),
|
|
||||||
fs.readFile(path, "utf-8")
|
|
||||||
]);
|
|
||||||
}).then(([colors, style]) => {
|
|
||||||
return parse(colors + "\n" + style);
|
|
||||||
}).then((ast) => {
|
|
||||||
return postcss(postcssPlugins).process(ast, {
|
|
||||||
from: template,
|
|
||||||
to: template
|
|
||||||
});
|
|
||||||
}).then((bundle) => {
|
|
||||||
return fs.writeFile(`${buildDir}/${template}`, bundle.css);
|
|
||||||
}).then(() => {
|
|
||||||
console.log(`Finished writing CSS to ${buildDir}/${template}`);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
let buildDir
|
|
||||||
|
|
||||||
// try reading from arguments first
|
|
||||||
if (argv["build-dir"] != undefined) {
|
|
||||||
buildDir = argv["build-dir"]
|
|
||||||
}
|
|
||||||
|
|
||||||
// then try reading from environment variable
|
|
||||||
if (buildDir == undefined) {
|
|
||||||
buildDir = process.env.BUILD_DIR;
|
|
||||||
}
|
|
||||||
|
|
||||||
// then take default
|
|
||||||
if (buildDir == undefined) {
|
|
||||||
buildDir = `${__dirname}/build`;
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log("bundling to", buildDir);
|
|
||||||
|
|
||||||
function bundleAll() {
|
|
||||||
return getTemplates().then((templates) => {
|
|
||||||
return Promise.map(templates, bundle);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (process.env.NODE_ENV != "development") {
|
|
||||||
bundleAll();
|
|
||||||
} else {
|
|
||||||
const chokidar = require("chokidar");
|
|
||||||
console.log("Watching for changes");
|
|
||||||
chokidar.watch(`${__dirname}/templates`).on("all", (_, path) => {
|
|
||||||
if (path.endsWith(".css")) {
|
|
||||||
bundle([path.split("/").slice(-1)[0], path]);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
chokidar.watch(`${__dirname}/colors.css`).on("all", () => {
|
|
||||||
console.log("colors.css updated, rebuilding all templates");
|
|
||||||
bundleAll();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
{
|
|
||||||
"name": "gotosocial-styling",
|
|
||||||
"version": "0.0.1",
|
|
||||||
"description": "PostCSS source for the https://github.com/superseriousbusiness/gotosocial common styling",
|
|
||||||
"repository": "https://github.com/superseriousbusiness/gotosocial-styling",
|
|
||||||
"author": "f0x",
|
|
||||||
"license": "AGPL-3.0",
|
|
||||||
"dependencies": {
|
|
||||||
"bluebird": "^3.7.2",
|
|
||||||
"minimist": "^1.2.5",
|
|
||||||
"postcss": "^8.3.5",
|
|
||||||
"postcss-color-function": "^4.1.0",
|
|
||||||
"postcss-nested": "^4.2.1",
|
|
||||||
"postcss-scss": "^4.0.0",
|
|
||||||
"postcss-simple-vars": "^5.0.2",
|
|
||||||
"postcss-strip-inline-comments": "^0.1.5"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"chokidar": "^3.5.2"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,409 +0,0 @@
|
||||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
||||||
# yarn lockfile v1
|
|
||||||
|
|
||||||
|
|
||||||
ansi-regex@^2.0.0:
|
|
||||||
version "2.1.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df"
|
|
||||||
integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8=
|
|
||||||
|
|
||||||
ansi-styles@^2.2.1:
|
|
||||||
version "2.2.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe"
|
|
||||||
integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=
|
|
||||||
|
|
||||||
ansi-styles@^3.2.1:
|
|
||||||
version "3.2.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d"
|
|
||||||
integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==
|
|
||||||
dependencies:
|
|
||||||
color-convert "^1.9.0"
|
|
||||||
|
|
||||||
anymatch@~3.1.2:
|
|
||||||
version "3.1.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716"
|
|
||||||
integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==
|
|
||||||
dependencies:
|
|
||||||
normalize-path "^3.0.0"
|
|
||||||
picomatch "^2.0.4"
|
|
||||||
|
|
||||||
balanced-match@0.1.0:
|
|
||||||
version "0.1.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.1.0.tgz#b504bd05869b39259dd0c5efc35d843176dccc4a"
|
|
||||||
integrity sha1-tQS9BYabOSWd0MXvw12EMXbczEo=
|
|
||||||
|
|
||||||
binary-extensions@^2.0.0:
|
|
||||||
version "2.2.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d"
|
|
||||||
integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==
|
|
||||||
|
|
||||||
bluebird@^3.7.2:
|
|
||||||
version "3.7.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f"
|
|
||||||
integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==
|
|
||||||
|
|
||||||
braces@~3.0.2:
|
|
||||||
version "3.0.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107"
|
|
||||||
integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==
|
|
||||||
dependencies:
|
|
||||||
fill-range "^7.0.1"
|
|
||||||
|
|
||||||
chalk@^1.1.3:
|
|
||||||
version "1.1.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98"
|
|
||||||
integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=
|
|
||||||
dependencies:
|
|
||||||
ansi-styles "^2.2.1"
|
|
||||||
escape-string-regexp "^1.0.2"
|
|
||||||
has-ansi "^2.0.0"
|
|
||||||
strip-ansi "^3.0.0"
|
|
||||||
supports-color "^2.0.0"
|
|
||||||
|
|
||||||
chalk@^2.4.1, chalk@^2.4.2:
|
|
||||||
version "2.4.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424"
|
|
||||||
integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==
|
|
||||||
dependencies:
|
|
||||||
ansi-styles "^3.2.1"
|
|
||||||
escape-string-regexp "^1.0.5"
|
|
||||||
supports-color "^5.3.0"
|
|
||||||
|
|
||||||
chokidar@^3.5.2:
|
|
||||||
version "3.5.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.2.tgz#dba3976fcadb016f66fd365021d91600d01c1e75"
|
|
||||||
integrity sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==
|
|
||||||
dependencies:
|
|
||||||
anymatch "~3.1.2"
|
|
||||||
braces "~3.0.2"
|
|
||||||
glob-parent "~5.1.2"
|
|
||||||
is-binary-path "~2.1.0"
|
|
||||||
is-glob "~4.0.1"
|
|
||||||
normalize-path "~3.0.0"
|
|
||||||
readdirp "~3.6.0"
|
|
||||||
optionalDependencies:
|
|
||||||
fsevents "~2.3.2"
|
|
||||||
|
|
||||||
clone@^1.0.2:
|
|
||||||
version "1.0.4"
|
|
||||||
resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e"
|
|
||||||
integrity sha1-2jCcwmPfFZlMaIypAheco8fNfH4=
|
|
||||||
|
|
||||||
color-convert@^1.3.0, color-convert@^1.9.0:
|
|
||||||
version "1.9.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8"
|
|
||||||
integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==
|
|
||||||
dependencies:
|
|
||||||
color-name "1.1.3"
|
|
||||||
|
|
||||||
color-name@1.1.3:
|
|
||||||
version "1.1.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25"
|
|
||||||
integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=
|
|
||||||
|
|
||||||
color-name@^1.0.0:
|
|
||||||
version "1.1.4"
|
|
||||||
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
|
|
||||||
integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
|
|
||||||
|
|
||||||
color-string@^0.3.0:
|
|
||||||
version "0.3.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/color-string/-/color-string-0.3.0.tgz#27d46fb67025c5c2fa25993bfbf579e47841b991"
|
|
||||||
integrity sha1-J9RvtnAlxcL6JZk7+/V55HhBuZE=
|
|
||||||
dependencies:
|
|
||||||
color-name "^1.0.0"
|
|
||||||
|
|
||||||
color@^0.11.0:
|
|
||||||
version "0.11.4"
|
|
||||||
resolved "https://registry.yarnpkg.com/color/-/color-0.11.4.tgz#6d7b5c74fb65e841cd48792ad1ed5e07b904d764"
|
|
||||||
integrity sha1-bXtcdPtl6EHNSHkq0e1eB7kE12Q=
|
|
||||||
dependencies:
|
|
||||||
clone "^1.0.2"
|
|
||||||
color-convert "^1.3.0"
|
|
||||||
color-string "^0.3.0"
|
|
||||||
|
|
||||||
colorette@^1.2.2:
|
|
||||||
version "1.4.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.4.0.tgz#5190fbb87276259a86ad700bff2c6d6faa3fca40"
|
|
||||||
integrity sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==
|
|
||||||
|
|
||||||
css-color-function@~1.3.3:
|
|
||||||
version "1.3.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/css-color-function/-/css-color-function-1.3.3.tgz#8ed24c2c0205073339fafa004bc8c141fccb282e"
|
|
||||||
integrity sha1-jtJMLAIFBzM5+voAS8jBQfzLKC4=
|
|
||||||
dependencies:
|
|
||||||
balanced-match "0.1.0"
|
|
||||||
color "^0.11.0"
|
|
||||||
debug "^3.1.0"
|
|
||||||
rgb "~0.1.0"
|
|
||||||
|
|
||||||
cssesc@^3.0.0:
|
|
||||||
version "3.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-3.0.0.tgz#37741919903b868565e1c09ea747445cd18983ee"
|
|
||||||
integrity sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==
|
|
||||||
|
|
||||||
debug@^3.1.0:
|
|
||||||
version "3.2.7"
|
|
||||||
resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a"
|
|
||||||
integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==
|
|
||||||
dependencies:
|
|
||||||
ms "^2.1.1"
|
|
||||||
|
|
||||||
escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5:
|
|
||||||
version "1.0.5"
|
|
||||||
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
|
|
||||||
integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=
|
|
||||||
|
|
||||||
fill-range@^7.0.1:
|
|
||||||
version "7.0.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40"
|
|
||||||
integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==
|
|
||||||
dependencies:
|
|
||||||
to-regex-range "^5.0.1"
|
|
||||||
|
|
||||||
fsevents@~2.3.2:
|
|
||||||
version "2.3.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a"
|
|
||||||
integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==
|
|
||||||
|
|
||||||
glob-parent@~5.1.2:
|
|
||||||
version "5.1.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4"
|
|
||||||
integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==
|
|
||||||
dependencies:
|
|
||||||
is-glob "^4.0.1"
|
|
||||||
|
|
||||||
has-ansi@^2.0.0:
|
|
||||||
version "2.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91"
|
|
||||||
integrity sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=
|
|
||||||
dependencies:
|
|
||||||
ansi-regex "^2.0.0"
|
|
||||||
|
|
||||||
has-flag@^1.0.0:
|
|
||||||
version "1.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa"
|
|
||||||
integrity sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=
|
|
||||||
|
|
||||||
has-flag@^3.0.0:
|
|
||||||
version "3.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd"
|
|
||||||
integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0=
|
|
||||||
|
|
||||||
is-binary-path@~2.1.0:
|
|
||||||
version "2.1.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09"
|
|
||||||
integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==
|
|
||||||
dependencies:
|
|
||||||
binary-extensions "^2.0.0"
|
|
||||||
|
|
||||||
is-extglob@^2.1.1:
|
|
||||||
version "2.1.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2"
|
|
||||||
integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=
|
|
||||||
|
|
||||||
is-glob@^4.0.1, is-glob@~4.0.1:
|
|
||||||
version "4.0.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc"
|
|
||||||
integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==
|
|
||||||
dependencies:
|
|
||||||
is-extglob "^2.1.1"
|
|
||||||
|
|
||||||
is-number@^7.0.0:
|
|
||||||
version "7.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b"
|
|
||||||
integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==
|
|
||||||
|
|
||||||
js-base64@^2.1.9:
|
|
||||||
version "2.6.4"
|
|
||||||
resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.6.4.tgz#f4e686c5de1ea1f867dbcad3d46d969428df98c4"
|
|
||||||
integrity sha512-pZe//GGmwJndub7ZghVHz7vjb2LgC1m8B07Au3eYqeqv9emhESByMXxaEgkUkEqJe87oBbSniGYoQNIBklc7IQ==
|
|
||||||
|
|
||||||
minimist@^1.2.5:
|
|
||||||
version "1.2.5"
|
|
||||||
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
|
|
||||||
integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==
|
|
||||||
|
|
||||||
ms@^2.1.1:
|
|
||||||
version "2.1.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2"
|
|
||||||
integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==
|
|
||||||
|
|
||||||
nanoid@^3.1.23:
|
|
||||||
version "3.2.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.2.0.tgz#62667522da6673971cca916a6d3eff3f415ff80c"
|
|
||||||
integrity sha512-fmsZYa9lpn69Ad5eDn7FMcnnSR+8R34W9qJEijxYhTbfOWzr22n1QxCMzXLK+ODyW2973V3Fux959iQoUxzUIA==
|
|
||||||
|
|
||||||
normalize-path@^3.0.0, normalize-path@~3.0.0:
|
|
||||||
version "3.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65"
|
|
||||||
integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==
|
|
||||||
|
|
||||||
picomatch@^2.0.4, picomatch@^2.2.1:
|
|
||||||
version "2.3.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972"
|
|
||||||
integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==
|
|
||||||
|
|
||||||
postcss-color-function@^4.1.0:
|
|
||||||
version "4.1.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/postcss-color-function/-/postcss-color-function-4.1.0.tgz#b6f9355e07b12fcc5c34dab957834769b03d8f57"
|
|
||||||
integrity sha512-2/fuv6mP5Lt03XbRpVfMdGC8lRP1sykme+H1bR4ARyOmSMB8LPSjcL6EAI1iX6dqUF+jNEvKIVVXhan1w/oFDQ==
|
|
||||||
dependencies:
|
|
||||||
css-color-function "~1.3.3"
|
|
||||||
postcss "^6.0.23"
|
|
||||||
postcss-message-helpers "^2.0.0"
|
|
||||||
postcss-value-parser "^3.3.1"
|
|
||||||
|
|
||||||
postcss-message-helpers@^2.0.0:
|
|
||||||
version "2.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/postcss-message-helpers/-/postcss-message-helpers-2.0.0.tgz#a4f2f4fab6e4fe002f0aed000478cdf52f9ba60e"
|
|
||||||
integrity sha1-pPL0+rbk/gAvCu0ABHjN9S+bpg4=
|
|
||||||
|
|
||||||
postcss-nested@^4.2.1:
|
|
||||||
version "4.2.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/postcss-nested/-/postcss-nested-4.2.3.tgz#c6f255b0a720549776d220d00c4b70cd244136f6"
|
|
||||||
integrity sha512-rOv0W1HquRCamWy2kFl3QazJMMe1ku6rCFoAAH+9AcxdbpDeBr6k968MLWuLjvjMcGEip01ak09hKOEgpK9hvw==
|
|
||||||
dependencies:
|
|
||||||
postcss "^7.0.32"
|
|
||||||
postcss-selector-parser "^6.0.2"
|
|
||||||
|
|
||||||
postcss-scss@^4.0.0:
|
|
||||||
version "4.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/postcss-scss/-/postcss-scss-4.0.0.tgz#6cfe09040f01e3345c9c226894c5913ac5fa9381"
|
|
||||||
integrity sha512-xakgIr5ukOEyXFcsnADKjQtrk8nQyqn5VIEAA+PmPP4kBOpknmjpJMxBNqCR1/x20AS0aSfZkWsSdbMx2Ozm5A==
|
|
||||||
|
|
||||||
postcss-selector-parser@^6.0.2:
|
|
||||||
version "6.0.6"
|
|
||||||
resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.6.tgz#2c5bba8174ac2f6981ab631a42ab0ee54af332ea"
|
|
||||||
integrity sha512-9LXrvaaX3+mcv5xkg5kFwqSzSH1JIObIx51PrndZwlmznwXRfxMddDvo9gve3gVR8ZTKgoFDdWkbRFmEhT4PMg==
|
|
||||||
dependencies:
|
|
||||||
cssesc "^3.0.0"
|
|
||||||
util-deprecate "^1.0.2"
|
|
||||||
|
|
||||||
postcss-simple-vars@^5.0.2:
|
|
||||||
version "5.0.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/postcss-simple-vars/-/postcss-simple-vars-5.0.2.tgz#e2f81b3d0847ddd4169816b6d141b91d51e6e22e"
|
|
||||||
integrity sha512-xWIufxBoINJv6JiLb7jl5oElgp+6puJwvT5zZHliUSydoLz4DADRB3NDDsYgfKVwojn4TDLiseoC65MuS8oGGg==
|
|
||||||
dependencies:
|
|
||||||
postcss "^7.0.14"
|
|
||||||
|
|
||||||
postcss-strip-inline-comments@^0.1.5:
|
|
||||||
version "0.1.5"
|
|
||||||
resolved "https://registry.yarnpkg.com/postcss-strip-inline-comments/-/postcss-strip-inline-comments-0.1.5.tgz#7ff6bcdc14e633ed4cdfa020bae3eddad4f84b90"
|
|
||||||
integrity sha1-f/a83BTmM+1M36AguuPt2tT4S5A=
|
|
||||||
dependencies:
|
|
||||||
postcss "^5.0.18"
|
|
||||||
|
|
||||||
postcss-value-parser@^3.3.1:
|
|
||||||
version "3.3.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz#9ff822547e2893213cf1c30efa51ac5fd1ba8281"
|
|
||||||
integrity sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==
|
|
||||||
|
|
||||||
postcss@^5.0.18:
|
|
||||||
version "5.2.18"
|
|
||||||
resolved "https://registry.yarnpkg.com/postcss/-/postcss-5.2.18.tgz#badfa1497d46244f6390f58b319830d9107853c5"
|
|
||||||
integrity sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==
|
|
||||||
dependencies:
|
|
||||||
chalk "^1.1.3"
|
|
||||||
js-base64 "^2.1.9"
|
|
||||||
source-map "^0.5.6"
|
|
||||||
supports-color "^3.2.3"
|
|
||||||
|
|
||||||
postcss@^6.0.23:
|
|
||||||
version "6.0.23"
|
|
||||||
resolved "https://registry.yarnpkg.com/postcss/-/postcss-6.0.23.tgz#61c82cc328ac60e677645f979054eb98bc0e3324"
|
|
||||||
integrity sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==
|
|
||||||
dependencies:
|
|
||||||
chalk "^2.4.1"
|
|
||||||
source-map "^0.6.1"
|
|
||||||
supports-color "^5.4.0"
|
|
||||||
|
|
||||||
postcss@^7.0.14, postcss@^7.0.32:
|
|
||||||
version "7.0.36"
|
|
||||||
resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.36.tgz#056f8cffa939662a8f5905950c07d5285644dfcb"
|
|
||||||
integrity sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==
|
|
||||||
dependencies:
|
|
||||||
chalk "^2.4.2"
|
|
||||||
source-map "^0.6.1"
|
|
||||||
supports-color "^6.1.0"
|
|
||||||
|
|
||||||
postcss@^8.3.5:
|
|
||||||
version "8.3.6"
|
|
||||||
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.3.6.tgz#2730dd76a97969f37f53b9a6096197be311cc4ea"
|
|
||||||
integrity sha512-wG1cc/JhRgdqB6WHEuyLTedf3KIRuD0hG6ldkFEZNCjRxiC+3i6kkWUUbiJQayP28iwG35cEmAbe98585BYV0A==
|
|
||||||
dependencies:
|
|
||||||
colorette "^1.2.2"
|
|
||||||
nanoid "^3.1.23"
|
|
||||||
source-map-js "^0.6.2"
|
|
||||||
|
|
||||||
readdirp@~3.6.0:
|
|
||||||
version "3.6.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7"
|
|
||||||
integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==
|
|
||||||
dependencies:
|
|
||||||
picomatch "^2.2.1"
|
|
||||||
|
|
||||||
rgb@~0.1.0:
|
|
||||||
version "0.1.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/rgb/-/rgb-0.1.0.tgz#be27b291e8feffeac1bd99729721bfa40fc037b5"
|
|
||||||
integrity sha1-vieykej+/+rBvZlylyG/pA/AN7U=
|
|
||||||
|
|
||||||
source-map-js@^0.6.2:
|
|
||||||
version "0.6.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-0.6.2.tgz#0bb5de631b41cfbda6cfba8bd05a80efdfd2385e"
|
|
||||||
integrity sha512-/3GptzWzu0+0MBQFrDKzw/DvvMTUORvgY6k6jd/VS6iCR4RDTKWH6v6WPwQoUO8667uQEf9Oe38DxAYWY5F/Ug==
|
|
||||||
|
|
||||||
source-map@^0.5.6:
|
|
||||||
version "0.5.7"
|
|
||||||
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc"
|
|
||||||
integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=
|
|
||||||
|
|
||||||
source-map@^0.6.1:
|
|
||||||
version "0.6.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
|
|
||||||
integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==
|
|
||||||
|
|
||||||
strip-ansi@^3.0.0:
|
|
||||||
version "3.0.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf"
|
|
||||||
integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=
|
|
||||||
dependencies:
|
|
||||||
ansi-regex "^2.0.0"
|
|
||||||
|
|
||||||
supports-color@^2.0.0:
|
|
||||||
version "2.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7"
|
|
||||||
integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=
|
|
||||||
|
|
||||||
supports-color@^3.2.3:
|
|
||||||
version "3.2.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6"
|
|
||||||
integrity sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=
|
|
||||||
dependencies:
|
|
||||||
has-flag "^1.0.0"
|
|
||||||
|
|
||||||
supports-color@^5.3.0, supports-color@^5.4.0:
|
|
||||||
version "5.5.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f"
|
|
||||||
integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==
|
|
||||||
dependencies:
|
|
||||||
has-flag "^3.0.0"
|
|
||||||
|
|
||||||
supports-color@^6.1.0:
|
|
||||||
version "6.1.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.1.0.tgz#0764abc69c63d5ac842dd4867e8d025e880df8f3"
|
|
||||||
integrity sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==
|
|
||||||
dependencies:
|
|
||||||
has-flag "^3.0.0"
|
|
||||||
|
|
||||||
to-regex-range@^5.0.1:
|
|
||||||
version "5.0.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4"
|
|
||||||
integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==
|
|
||||||
dependencies:
|
|
||||||
is-number "^7.0.0"
|
|
||||||
|
|
||||||
util-deprecate@^1.0.2:
|
|
||||||
version "1.0.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
|
|
||||||
integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=
|
|
||||||
3
web/source/.eslintrc.js
Normal file
3
web/source/.eslintrc.js
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
module.exports = {
|
||||||
|
"extends": ["@f0x52/eslint-config-react"]
|
||||||
|
};
|
||||||
2
web/source/.gitignore
vendored
Normal file
2
web/source/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
node_modules
|
||||||
|
public/bundle.*
|
||||||
|
|
@ -2,7 +2,7 @@ $bg: #525c66;
|
||||||
$fg: #fafaff;
|
$fg: #fafaff;
|
||||||
$fg_dark: #b0b0b5;
|
$fg_dark: #b0b0b5;
|
||||||
|
|
||||||
$bg_accent: color($bg lightness(-5%));
|
$bg_accent: color-mod(var(--bg) lightness(-5%));
|
||||||
|
|
||||||
$acc1: #de8957; // sloth light orange
|
$acc1: #de8957; // sloth light orange
|
||||||
$acc2: #c76d33; // sloth dark orange
|
$acc2: #c76d33; // sloth dark orange
|
||||||
55
web/source/dev-server.js
Normal file
55
web/source/dev-server.js
Normal file
|
|
@ -0,0 +1,55 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
const express = require("express");
|
||||||
|
|
||||||
|
const app = express();
|
||||||
|
|
||||||
|
function html(title, css, js) {
|
||||||
|
return `
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
${["_colors.css", "base.css", ...css].map((file) => {
|
||||||
|
return `<link rel="stylesheet" href="/${file}"></link>`;
|
||||||
|
}).join("\n")}
|
||||||
|
<title>GoToSocial ${title} Panel</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<header>
|
||||||
|
<img src="/assets/logo.png" alt="Instance Logo">
|
||||||
|
<div>
|
||||||
|
<h1>
|
||||||
|
GoToSocial ${title} Panel
|
||||||
|
</h1>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
<main class="lightgray">
|
||||||
|
<div id="root"></div>
|
||||||
|
</main>
|
||||||
|
${["bundle.js", ...js].map((file) => {
|
||||||
|
return `<script src="/${file}"></script>`;
|
||||||
|
}).join("\n")}
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
|
||||||
|
app.get("/admin", (req, res) => {
|
||||||
|
res.send(html("Admin", ["panels-admin-style.css"], ["admin-panel.js"]));
|
||||||
|
});
|
||||||
|
|
||||||
|
app.get("/user", (req, res) => {
|
||||||
|
res.send(html("Settings", ["panels-user-style.css"], ["user-panel.js"]));
|
||||||
|
});
|
||||||
|
|
||||||
|
app.use("/assets", express.static("../assets/"));
|
||||||
|
|
||||||
|
if (process.env.NODE_ENV != "development") {
|
||||||
|
console.log("adding static asset route");
|
||||||
|
app.use(express.static("../assets/bundled"));
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = app;
|
||||||
108
web/source/index.js
Normal file
108
web/source/index.js
Normal file
|
|
@ -0,0 +1,108 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
/*
|
||||||
|
Bundle the frontend panels for admin and user settings
|
||||||
|
*/
|
||||||
|
|
||||||
|
const path = require('path');
|
||||||
|
const budoExpress = require('budo-express');
|
||||||
|
const babelify = require('babelify');
|
||||||
|
const icssify = require("icssify");
|
||||||
|
const fs = require("fs");
|
||||||
|
|
||||||
|
const {Writable} = require("stream");
|
||||||
|
|
||||||
|
function out(name = "") {
|
||||||
|
return path.join(__dirname, "../assets/bundled/", name);
|
||||||
|
}
|
||||||
|
|
||||||
|
const postcssPlugins = [
|
||||||
|
"postcss-import",
|
||||||
|
"postcss-strip-inline-comments",
|
||||||
|
"postcss-nested",
|
||||||
|
"autoprefixer",
|
||||||
|
"postcss-custom-prop-vars",
|
||||||
|
"postcss-color-mod-function"
|
||||||
|
].map((plugin) => require(plugin)());
|
||||||
|
|
||||||
|
const fromRegex = /\/\* from (.+?) \*\//;
|
||||||
|
function splitCSS() {
|
||||||
|
let chunks = [];
|
||||||
|
return new Writable({
|
||||||
|
write: function(chunk, encoding, next) {
|
||||||
|
chunks.push(chunk);
|
||||||
|
next();
|
||||||
|
},
|
||||||
|
final: function() {
|
||||||
|
let stream = chunks.join("");
|
||||||
|
let input;
|
||||||
|
let content = [];
|
||||||
|
|
||||||
|
function write() {
|
||||||
|
if (content.length != 0) {
|
||||||
|
if (input == undefined) {
|
||||||
|
throw new Error("Got CSS content without filename, can't output: ", content);
|
||||||
|
} else {
|
||||||
|
console.log("writing to", out(input));
|
||||||
|
fs.writeFileSync(out(input), content.join("\n"));
|
||||||
|
}
|
||||||
|
content = [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stream.split("\n").forEach((line) => {
|
||||||
|
if (line.startsWith("/* from")) {
|
||||||
|
let found = fromRegex.exec(line);
|
||||||
|
if (found != null) {
|
||||||
|
write();
|
||||||
|
|
||||||
|
let parts = path.parse(found[1]);
|
||||||
|
if (parts.dir == "css") {
|
||||||
|
input = parts.base;
|
||||||
|
} else {
|
||||||
|
input = found[1].replace(/\//g, "-");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
content.push(line);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
write();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const browserifyConfig = {
|
||||||
|
transform: babelify.configure({ presets: ["@babel/preset-env", "@babel/preset-react"] }),
|
||||||
|
plugin: [
|
||||||
|
[icssify, {
|
||||||
|
parser: require('postcss-scss'),
|
||||||
|
before: postcssPlugins,
|
||||||
|
mode: 'global'
|
||||||
|
}],
|
||||||
|
[require("css-extract"), { out: splitCSS }],
|
||||||
|
[require("factor-bundle"), { outputs: [out("/admin-panel.js"), out("user-panel.js")] }]
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
const entryFiles = [
|
||||||
|
'./panels/admin/index.js',
|
||||||
|
'./panels/user/index.js',
|
||||||
|
];
|
||||||
|
|
||||||
|
fs.readdirSync(path.join(__dirname, "./css")).forEach((file) => {
|
||||||
|
entryFiles.push(path.join(__dirname, "./css", file));
|
||||||
|
});
|
||||||
|
|
||||||
|
budoExpress({
|
||||||
|
port: 8080,
|
||||||
|
host: "10.0.1.1",
|
||||||
|
allowUnsafeHost: true, // FIXME: don't do that by default lol
|
||||||
|
entryFiles: entryFiles,
|
||||||
|
basePath: __dirname,
|
||||||
|
bundlePath: "bundle.js",
|
||||||
|
staticPath: out(),
|
||||||
|
expressApp: require("./dev-server.js"),
|
||||||
|
browserify: browserifyConfig,
|
||||||
|
livereloadPattern: "**/*.{html,js,svg}"
|
||||||
|
});
|
||||||
46
web/source/package.json
Normal file
46
web/source/package.json
Normal file
|
|
@ -0,0 +1,46 @@
|
||||||
|
{
|
||||||
|
"name": "gotosocial-admin",
|
||||||
|
"version": "0.0.1",
|
||||||
|
"description": "GoToSocial Admin Panel",
|
||||||
|
"main": "index.js",
|
||||||
|
"author": "f0x",
|
||||||
|
"license": "AGPL-3.0",
|
||||||
|
"dependencies": {
|
||||||
|
"@babel/core": "^7.12.13",
|
||||||
|
"@babel/preset-env": "^7.12.13",
|
||||||
|
"@babel/preset-react": "^7.12.13",
|
||||||
|
"autoprefixer": "^9.8.0",
|
||||||
|
"babelify": "^10.0.0",
|
||||||
|
"bluebird": "^3.7.2",
|
||||||
|
"browserify": "^17.0.0",
|
||||||
|
"browserlist": "^1.0.1",
|
||||||
|
"budo-express": "^1.0.8",
|
||||||
|
"css-extract": "^2.0.0",
|
||||||
|
"eslint-plugin-react": "^7.24.0",
|
||||||
|
"express": "^4.18.1",
|
||||||
|
"factor-bundle": "^2.5.0",
|
||||||
|
"from2-string": "^1.1.0",
|
||||||
|
"icssify": "^1.2.1",
|
||||||
|
"js-file-download": "^0.4.12",
|
||||||
|
"postcss": "^8.3.5",
|
||||||
|
"postcss-color-function": "^4.1.0",
|
||||||
|
"postcss-color-mod-function": "3.0.0",
|
||||||
|
"postcss-comment": "^2.0.0",
|
||||||
|
"postcss-custom-prop-vars": "0.0.3",
|
||||||
|
"postcss-import": "12",
|
||||||
|
"postcss-mixins": "^6.2.3",
|
||||||
|
"postcss-nested": "^4.2.1",
|
||||||
|
"postcss-scss": "^4.0.0",
|
||||||
|
"postcss-simple-vars": "^5.0.2",
|
||||||
|
"postcss-strip-inline-comments": "^0.1.5",
|
||||||
|
"pretty-bytes": "^5.6.0",
|
||||||
|
"react": "^17.0.1",
|
||||||
|
"react-dom": "^17.0.1",
|
||||||
|
"reactify": "^1.1.1"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@f0x52/eslint-config-react": "^1.1.0",
|
||||||
|
"eslint": "^7.30.0",
|
||||||
|
"eslint-plugin-react-hooks": "^4.2.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
21
web/source/panels/admin/README.md
Normal file
21
web/source/panels/admin/README.md
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
# GoToSocial Admin Panel
|
||||||
|
|
||||||
|
Standalone web admin panel for [GoToSocial](https://github.com/superseriousbusiness/gotosocial).
|
||||||
|
|
||||||
|
A public hosted instance is also available at https://gts.superseriousbusiness.org/admin/, so you can fill your own instance URL in there.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
Build requirements: some version of Node.js with npm,
|
||||||
|
```
|
||||||
|
git clone https://github.com/superseriousbusiness/gotosocial-admin.git && cd gotosocial-admin
|
||||||
|
npm install
|
||||||
|
node index.js
|
||||||
|
```
|
||||||
|
All processed build output will now be in `public/`, which you can copy over to a folder in your GoToSocial installation like `web/assets/admin`, or serve elsewhere.
|
||||||
|
No further configuration is required, authentication happens through normal OAUTH flow.
|
||||||
|
|
||||||
|
## Development
|
||||||
|
Follow the installation steps, but run `NODE_ENV=development node index.js` to start the livereloading dev server instead.
|
||||||
|
|
||||||
|
## License, donations
|
||||||
|
[AGPL-3.0](https://www.gnu.org/licenses/agpl-3.0.html). If you want to support my work, you can: <a href="https://liberapay.com/f0x/donate"><img alt="Donate using Liberapay" src="https://liberapay.com/assets/widgets/donate.svg"></a>
|
||||||
68
web/source/panels/admin/auth.js
Normal file
68
web/source/panels/admin/auth.js
Normal file
|
|
@ -0,0 +1,68 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
const Promise = require("bluebird");
|
||||||
|
const React = require("react");
|
||||||
|
const oauthLib = require("./oauth");
|
||||||
|
|
||||||
|
module.exports = function Auth({setOauth}) {
|
||||||
|
const [ instance, setInstance ] = React.useState("");
|
||||||
|
|
||||||
|
React.useEffect(() => {
|
||||||
|
let isStillMounted = true;
|
||||||
|
// check if current domain runs an instance
|
||||||
|
let thisUrl = new URL(window.location.origin);
|
||||||
|
thisUrl.pathname = "/api/v1/instance";
|
||||||
|
fetch(thisUrl.href)
|
||||||
|
.then((res) => res.json())
|
||||||
|
.then((json) => {
|
||||||
|
if (json && json.uri) {
|
||||||
|
if (isStillMounted) {
|
||||||
|
setInstance(json.uri);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
console.error("caught", e);
|
||||||
|
// no instance here
|
||||||
|
});
|
||||||
|
return () => {
|
||||||
|
// cleanup function
|
||||||
|
isStillMounted = false;
|
||||||
|
};
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
function doAuth() {
|
||||||
|
let oauth = oauthLib({
|
||||||
|
instance: instance,
|
||||||
|
client_name: "GoToSocial Admin Panel",
|
||||||
|
scope: ["admin"],
|
||||||
|
website: window.location.href
|
||||||
|
});
|
||||||
|
setOauth(oauth);
|
||||||
|
|
||||||
|
return Promise.try(() => {
|
||||||
|
return oauth.register();
|
||||||
|
}).then(() => {
|
||||||
|
return oauth.authorize();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateInstance(e) {
|
||||||
|
if (e.key == "Enter") {
|
||||||
|
doAuth();
|
||||||
|
} else {
|
||||||
|
setInstance(e.target.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<section className="login">
|
||||||
|
<h1>OAUTH Login:</h1>
|
||||||
|
<form onSubmit={(e) => e.preventDefault()}>
|
||||||
|
<label htmlFor="instance">Instance: </label>
|
||||||
|
<input value={instance} onChange={updateInstance} id="instance"/>
|
||||||
|
<button onClick={doAuth}>Authenticate</button>
|
||||||
|
</form>
|
||||||
|
</section>
|
||||||
|
);
|
||||||
|
};
|
||||||
300
web/source/panels/admin/blocks.js
Normal file
300
web/source/panels/admin/blocks.js
Normal file
|
|
@ -0,0 +1,300 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
const Promise = require("bluebird");
|
||||||
|
const React = require("react");
|
||||||
|
const fileDownload = require("js-file-download");
|
||||||
|
|
||||||
|
function sortBlocks(blocks) {
|
||||||
|
return blocks.sort((a, b) => { // alphabetical sort
|
||||||
|
return a.domain.localeCompare(b.domain);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function deduplicateBlocks(blocks) {
|
||||||
|
let a = new Map();
|
||||||
|
blocks.forEach((block) => {
|
||||||
|
a.set(block.id, block);
|
||||||
|
});
|
||||||
|
return Array.from(a.values());
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = function Blocks({oauth}) {
|
||||||
|
const [blocks, setBlocks] = React.useState([]);
|
||||||
|
const [info, setInfo] = React.useState("Fetching blocks");
|
||||||
|
const [errorMsg, setError] = React.useState("");
|
||||||
|
const [checked, setChecked] = React.useState(new Set());
|
||||||
|
|
||||||
|
React.useEffect(() => {
|
||||||
|
Promise.try(() => {
|
||||||
|
return oauth.apiRequest("/api/v1/admin/domain_blocks", undefined, undefined, "GET");
|
||||||
|
}).then((json) => {
|
||||||
|
setInfo("");
|
||||||
|
setError("");
|
||||||
|
setBlocks(sortBlocks(json));
|
||||||
|
}).catch((e) => {
|
||||||
|
setError(e.message);
|
||||||
|
setInfo("");
|
||||||
|
});
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
let blockList = blocks.map((block) => {
|
||||||
|
function update(e) {
|
||||||
|
let newChecked = new Set(checked.values());
|
||||||
|
if (e.target.checked) {
|
||||||
|
newChecked.add(block.id);
|
||||||
|
} else {
|
||||||
|
newChecked.delete(block.id);
|
||||||
|
}
|
||||||
|
setChecked(newChecked);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<React.Fragment key={block.id}>
|
||||||
|
<div><input type="checkbox" onChange={update} checked={checked.has(block.id)}></input></div>
|
||||||
|
<div>{block.domain}</div>
|
||||||
|
<div>{(new Date(block.created_at)).toLocaleString()}</div>
|
||||||
|
</React.Fragment>
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
function clearChecked() {
|
||||||
|
setChecked(new Set());
|
||||||
|
}
|
||||||
|
|
||||||
|
function undoChecked() {
|
||||||
|
let amount = checked.size;
|
||||||
|
if(confirm(`Are you sure you want to remove ${amount} block(s)?`)) {
|
||||||
|
setInfo("");
|
||||||
|
Promise.map(Array.from(checked.values()), (block) => {
|
||||||
|
console.log("deleting", block);
|
||||||
|
return oauth.apiRequest(`/api/v1/admin/domain_blocks/${block}`, "DELETE");
|
||||||
|
}).then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
setInfo(`Deleted ${amount} blocks: ${res.map((a) => a.domain).join(", ")}`);
|
||||||
|
}).catch((e) => {
|
||||||
|
setError(e);
|
||||||
|
});
|
||||||
|
|
||||||
|
let newBlocks = blocks.filter((block) => {
|
||||||
|
if (checked.size > 0 && checked.has(block.id)) {
|
||||||
|
checked.delete(block.id);
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
setBlocks(newBlocks);
|
||||||
|
clearChecked();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<section className="blocks">
|
||||||
|
<h1>Blocks</h1>
|
||||||
|
<div className="error accent">{errorMsg}</div>
|
||||||
|
<div>{info}</div>
|
||||||
|
<AddBlock oauth={oauth} blocks={blocks} setBlocks={setBlocks} />
|
||||||
|
<h3>Blocks:</h3>
|
||||||
|
<div style={{display: "grid", gridTemplateColumns: "1fr auto"}}>
|
||||||
|
<span onClick={clearChecked} className="accent" style={{alignSelf: "end"}}>uncheck all</span>
|
||||||
|
<button onClick={undoChecked}>Unblock selected</button>
|
||||||
|
</div>
|
||||||
|
<div className="blocklist overflow">
|
||||||
|
{blockList}
|
||||||
|
</div>
|
||||||
|
<BulkBlocking oauth={oauth} blocks={blocks} setBlocks={setBlocks}/>
|
||||||
|
</section>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
function BulkBlocking({oauth, blocks, setBlocks}) {
|
||||||
|
const [bulk, setBulk] = React.useState("");
|
||||||
|
const [blockMap, setBlockMap] = React.useState(new Map());
|
||||||
|
const [output, setOutput] = React.useState();
|
||||||
|
|
||||||
|
React.useEffect(() => {
|
||||||
|
let newBlockMap = new Map();
|
||||||
|
blocks.forEach((block) => {
|
||||||
|
newBlockMap.set(block.domain, block);
|
||||||
|
});
|
||||||
|
setBlockMap(newBlockMap);
|
||||||
|
}, [blocks]);
|
||||||
|
|
||||||
|
const fileRef = React.useRef();
|
||||||
|
|
||||||
|
function error(e) {
|
||||||
|
setOutput(<div className="error accent">{e}</div>);
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
|
||||||
|
function fileUpload() {
|
||||||
|
let reader = new FileReader();
|
||||||
|
reader.addEventListener("load", (e) => {
|
||||||
|
try {
|
||||||
|
// TODO: use validatem?
|
||||||
|
let json = JSON.parse(e.target.result);
|
||||||
|
json.forEach((block) => {
|
||||||
|
console.log("block:", block);
|
||||||
|
});
|
||||||
|
} catch(e) {
|
||||||
|
error(e.message);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
reader.readAsText(fileRef.current.files[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
React.useEffect(() => {
|
||||||
|
if (fileRef && fileRef.current) {
|
||||||
|
fileRef.current.addEventListener("change", fileUpload);
|
||||||
|
}
|
||||||
|
return function cleanup() {
|
||||||
|
fileRef.current.removeEventListener("change", fileUpload);
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
function textImport() {
|
||||||
|
Promise.try(() => {
|
||||||
|
if (bulk[0] == "[") {
|
||||||
|
// assume it's json
|
||||||
|
return JSON.parse(bulk);
|
||||||
|
} else {
|
||||||
|
return bulk.split("\n").map((val) => {
|
||||||
|
return {
|
||||||
|
domain: val.trim()
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}).then((domains) => {
|
||||||
|
console.log(domains);
|
||||||
|
let before = domains.length;
|
||||||
|
setOutput(`Importing ${before} domain(s)`);
|
||||||
|
domains = domains.filter(({domain}) => {
|
||||||
|
return (domain != "" && !blockMap.has(domain));
|
||||||
|
});
|
||||||
|
setOutput(<span>{output}<br/>{`Deduplicated ${before - domains.length}/${before} with existing blocks, adding ${domains.length} block(s)`}</span>);
|
||||||
|
if (domains.length > 0) {
|
||||||
|
let data = new FormData();
|
||||||
|
data.append("domains", new Blob([JSON.stringify(domains)], {type: "application/json"}), "import.json");
|
||||||
|
return oauth.apiRequest("/api/v1/admin/domain_blocks?import=true", "POST", data, "form");
|
||||||
|
}
|
||||||
|
}).then((json) => {
|
||||||
|
console.log("bulk import result:", json);
|
||||||
|
setBlocks(sortBlocks(deduplicateBlocks([...json, ...blocks])));
|
||||||
|
}).catch((e) => {
|
||||||
|
error(e.message);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function textExport() {
|
||||||
|
setBulk(blocks.reduce((str, val) => {
|
||||||
|
if (typeof str == "object") {
|
||||||
|
return str.domain;
|
||||||
|
} else {
|
||||||
|
return str + "\n" + val.domain;
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
function jsonExport() {
|
||||||
|
Promise.try(() => {
|
||||||
|
return oauth.apiRequest("/api/v1/admin/domain_blocks?export=true", "GET");
|
||||||
|
}).then((json) => {
|
||||||
|
fileDownload(JSON.stringify(json), "block-export.json");
|
||||||
|
}).catch((e) => {
|
||||||
|
error(e);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function textAreaUpdate(e) {
|
||||||
|
setBulk(e.target.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<React.Fragment>
|
||||||
|
<h3>Bulk import/export</h3>
|
||||||
|
<label htmlFor="bulk">Domains, one per line:</label>
|
||||||
|
<textarea value={bulk} rows={20} onChange={textAreaUpdate}></textarea>
|
||||||
|
<div className="controls">
|
||||||
|
<button onClick={textImport}>Import All From Field</button>
|
||||||
|
<button onClick={textExport}>Export To Field</button>
|
||||||
|
<label className="button" htmlFor="upload">Upload .json</label>
|
||||||
|
<button onClick={jsonExport}>Download .json</button>
|
||||||
|
</div>
|
||||||
|
{output}
|
||||||
|
<input type="file" id="upload" className="hidden" ref={fileRef}></input>
|
||||||
|
</React.Fragment>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function AddBlock({oauth, blocks, setBlocks}) {
|
||||||
|
const [domain, setDomain] = React.useState("");
|
||||||
|
const [type, setType] = React.useState("suspend");
|
||||||
|
const [obfuscated, setObfuscated] = React.useState(false);
|
||||||
|
const [privateDescription, setPrivateDescription] = React.useState("");
|
||||||
|
const [publicDescription, setPublicDescription] = React.useState("");
|
||||||
|
|
||||||
|
function addBlock() {
|
||||||
|
console.log(`${type}ing`, domain);
|
||||||
|
Promise.try(() => {
|
||||||
|
return oauth.apiRequest("/api/v1/admin/domain_blocks", "POST", {
|
||||||
|
domain: domain,
|
||||||
|
obfuscate: obfuscated,
|
||||||
|
private_comment: privateDescription,
|
||||||
|
public_comment: publicDescription
|
||||||
|
}, "json");
|
||||||
|
}).then((json) => {
|
||||||
|
setDomain("");
|
||||||
|
setPrivateDescription("");
|
||||||
|
setPublicDescription("");
|
||||||
|
setBlocks([json, ...blocks]);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function onDomainChange(e) {
|
||||||
|
setDomain(e.target.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
function onTypeChange(e) {
|
||||||
|
setType(e.target.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
function onKeyDown(e) {
|
||||||
|
if (e.key == "Enter") {
|
||||||
|
addBlock();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<React.Fragment>
|
||||||
|
<h3>Add Block:</h3>
|
||||||
|
<div className="addblock">
|
||||||
|
<input id="domain" placeholder="instance" onChange={onDomainChange} value={domain} onKeyDown={onKeyDown} />
|
||||||
|
<select value={type} onChange={onTypeChange}>
|
||||||
|
<option id="suspend">Suspend</option>
|
||||||
|
<option id="silence">Silence</option>
|
||||||
|
</select>
|
||||||
|
<button onClick={addBlock}>Add</button>
|
||||||
|
<div>
|
||||||
|
<label htmlFor="private">Private description:</label><br/>
|
||||||
|
<textarea id="private" value={privateDescription} onChange={(e) => setPrivateDescription(e.target.value)}></textarea>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label htmlFor="public">Public description:</label><br/>
|
||||||
|
<textarea id="public" value={publicDescription} onChange={(e) => setPublicDescription(e.target.value)}></textarea>
|
||||||
|
</div>
|
||||||
|
<div className="single">
|
||||||
|
<label htmlFor="obfuscate">Obfuscate:</label>
|
||||||
|
<input id="obfuscate" type="checkbox" value={obfuscated} onChange={(e) => setObfuscated(e.target.checked)}/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</React.Fragment>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// function Blocklist() {
|
||||||
|
// return (
|
||||||
|
// <section className="blocklists">
|
||||||
|
// <h1>Blocklists</h1>
|
||||||
|
// </section>
|
||||||
|
// );
|
||||||
|
// }
|
||||||
77
web/source/panels/admin/index.js
Normal file
77
web/source/panels/admin/index.js
Normal file
|
|
@ -0,0 +1,77 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
const Promise = require("bluebird");
|
||||||
|
const React = require("react");
|
||||||
|
const ReactDom = require("react-dom");
|
||||||
|
|
||||||
|
const oauthLib = require("./oauth.js");
|
||||||
|
const Auth = require("./auth");
|
||||||
|
const Settings = require("./settings");
|
||||||
|
const Blocks = require("./blocks");
|
||||||
|
|
||||||
|
require("./style.css");
|
||||||
|
|
||||||
|
function App() {
|
||||||
|
const [oauth, setOauth] = React.useState();
|
||||||
|
const [hasAuth, setAuth] = React.useState(false);
|
||||||
|
const [oauthState, setOauthState] = React.useState(localStorage.getItem("oauth"));
|
||||||
|
|
||||||
|
React.useEffect(() => {
|
||||||
|
let state = localStorage.getItem("oauth");
|
||||||
|
if (state != undefined) {
|
||||||
|
state = JSON.parse(state);
|
||||||
|
let restoredOauth = oauthLib(state.config, state);
|
||||||
|
Promise.try(() => {
|
||||||
|
return restoredOauth.callback();
|
||||||
|
}).then(() => {
|
||||||
|
setAuth(true);
|
||||||
|
});
|
||||||
|
setOauth(restoredOauth);
|
||||||
|
}
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
if (!hasAuth && oauth && oauth.isAuthorized()) {
|
||||||
|
setAuth(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (oauth && oauth.isAuthorized()) {
|
||||||
|
return <AdminPanel oauth={oauth} />;
|
||||||
|
} else if (oauthState != undefined) {
|
||||||
|
return "processing oauth...";
|
||||||
|
} else {
|
||||||
|
return <Auth setOauth={setOauth} />;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function AdminPanel({oauth}) {
|
||||||
|
/*
|
||||||
|
Features: (issue #78)
|
||||||
|
- [ ] Instance information updating
|
||||||
|
GET /api/v1/instance PATCH /api/v1/instance
|
||||||
|
- [ ] Domain block creation, viewing, and deletion
|
||||||
|
GET /api/v1/admin/domain_blocks
|
||||||
|
POST /api/v1/admin/domain_blocks
|
||||||
|
GET /api/v1/admin/domain_blocks/DOMAIN_BLOCK_ID, DELETE /api/v1/admin/domain_blocks/DOMAIN_BLOCK_ID
|
||||||
|
- [ ] Blocklist import/export
|
||||||
|
GET /api/v1/admin/domain_blocks?export=true
|
||||||
|
POST json file as form field domains to /api/v1/admin/domain_blocks
|
||||||
|
*/
|
||||||
|
|
||||||
|
return (
|
||||||
|
<React.Fragment>
|
||||||
|
<Logout oauth={oauth}/>
|
||||||
|
<Settings oauth={oauth} />
|
||||||
|
<Blocks oauth={oauth}/>
|
||||||
|
</React.Fragment>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function Logout({oauth}) {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<button onClick={oauth.logout}>Logout</button>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
ReactDom.render(<App/>, document.getElementById("root"));
|
||||||
200
web/source/panels/admin/oauth.js
Normal file
200
web/source/panels/admin/oauth.js
Normal file
|
|
@ -0,0 +1,200 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
const Promise = require("bluebird");
|
||||||
|
|
||||||
|
function getCurrentUrl() {
|
||||||
|
return window.location.origin + window.location.pathname; // strips ?query=string and #hash
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = function oauthClient(config, initState) {
|
||||||
|
/* config:
|
||||||
|
instance: instance domain (https://testingtesting123.xyz)
|
||||||
|
client_name: "GoToSocial Admin Panel"
|
||||||
|
scope: []
|
||||||
|
website:
|
||||||
|
*/
|
||||||
|
|
||||||
|
let state = initState;
|
||||||
|
if (initState == undefined) {
|
||||||
|
state = localStorage.getItem("oauth");
|
||||||
|
if (state == undefined) {
|
||||||
|
state = {
|
||||||
|
config
|
||||||
|
};
|
||||||
|
storeState();
|
||||||
|
} else {
|
||||||
|
state = JSON.parse(state);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function storeState() {
|
||||||
|
localStorage.setItem("oauth", JSON.stringify(state));
|
||||||
|
}
|
||||||
|
|
||||||
|
/* register app
|
||||||
|
/api/v1/apps
|
||||||
|
*/
|
||||||
|
function register() {
|
||||||
|
if (state.client_id != undefined) {
|
||||||
|
return true; // we already have a registration
|
||||||
|
}
|
||||||
|
let url = new URL(config.instance);
|
||||||
|
url.pathname = "/api/v1/apps";
|
||||||
|
|
||||||
|
return fetch(url.href, {
|
||||||
|
method: "POST",
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
},
|
||||||
|
body: JSON.stringify({
|
||||||
|
client_name: config.client_name,
|
||||||
|
redirect_uris: getCurrentUrl(),
|
||||||
|
scopes: config.scope.join(" "),
|
||||||
|
website: getCurrentUrl()
|
||||||
|
})
|
||||||
|
}).then((res) => {
|
||||||
|
if (res.status != 200) {
|
||||||
|
throw res;
|
||||||
|
}
|
||||||
|
return res.json();
|
||||||
|
}).then((json) => {
|
||||||
|
state.client_id = json.client_id;
|
||||||
|
state.client_secret = json.client_secret;
|
||||||
|
storeState();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/* authorize:
|
||||||
|
/oauth/authorize
|
||||||
|
?client_id=CLIENT_ID
|
||||||
|
&redirect_uri=window.location.href
|
||||||
|
&response_type=code
|
||||||
|
&scope=admin
|
||||||
|
*/
|
||||||
|
function authorize() {
|
||||||
|
let url = new URL(config.instance);
|
||||||
|
url.pathname = "/oauth/authorize";
|
||||||
|
url.searchParams.set("client_id", state.client_id);
|
||||||
|
url.searchParams.set("redirect_uri", getCurrentUrl());
|
||||||
|
url.searchParams.set("response_type", "code");
|
||||||
|
url.searchParams.set("scope", config.scope.join(" "));
|
||||||
|
|
||||||
|
window.location.assign(url.href);
|
||||||
|
}
|
||||||
|
|
||||||
|
function callback() {
|
||||||
|
if (state.access_token != undefined) {
|
||||||
|
return; // we're already done :)
|
||||||
|
}
|
||||||
|
let params = (new URL(window.location)).searchParams;
|
||||||
|
|
||||||
|
let token = params.get("code");
|
||||||
|
if (token != null) {
|
||||||
|
console.log("got token callback:", token);
|
||||||
|
}
|
||||||
|
|
||||||
|
return authorizeToken(token)
|
||||||
|
.catch((e) => {
|
||||||
|
console.log("Error processing oauth callback:", e);
|
||||||
|
logout(); // just to be sure
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function authorizeToken(token) {
|
||||||
|
let url = new URL(config.instance);
|
||||||
|
url.pathname = "/oauth/token";
|
||||||
|
return fetch(url.href, {
|
||||||
|
method: "POST",
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
},
|
||||||
|
body: JSON.stringify({
|
||||||
|
client_id: state.client_id,
|
||||||
|
client_secret: state.client_secret,
|
||||||
|
redirect_uri: getCurrentUrl(),
|
||||||
|
grant_type: "authorization_code",
|
||||||
|
code: token
|
||||||
|
})
|
||||||
|
}).then((res) => {
|
||||||
|
if (res.status != 200) {
|
||||||
|
throw res;
|
||||||
|
}
|
||||||
|
return res.json();
|
||||||
|
}).then((json) => {
|
||||||
|
state.access_token = json.access_token;
|
||||||
|
storeState();
|
||||||
|
window.location = getCurrentUrl(); // clear ?token=
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function isAuthorized() {
|
||||||
|
return (state.access_token != undefined);
|
||||||
|
}
|
||||||
|
|
||||||
|
function apiRequest(path, method, data, type="json") {
|
||||||
|
if (!isAuthorized()) {
|
||||||
|
throw new Error("Not Authenticated");
|
||||||
|
}
|
||||||
|
let url = new URL(config.instance);
|
||||||
|
let [p, s] = path.split("?");
|
||||||
|
url.pathname = p;
|
||||||
|
url.search = s;
|
||||||
|
let headers = {
|
||||||
|
"Authorization": `Bearer ${state.access_token}`
|
||||||
|
};
|
||||||
|
let body = data;
|
||||||
|
if (type == "json" && body != undefined) {
|
||||||
|
headers["Content-Type"] = "application/json";
|
||||||
|
body = JSON.stringify(data);
|
||||||
|
}
|
||||||
|
return fetch(url.href, {
|
||||||
|
method,
|
||||||
|
headers,
|
||||||
|
body
|
||||||
|
}).then((res) => {
|
||||||
|
return Promise.all([res.json(), res]);
|
||||||
|
}).then(([json, res]) => {
|
||||||
|
if (res.status != 200) {
|
||||||
|
if (json.error) {
|
||||||
|
throw new Error(json.error);
|
||||||
|
} else {
|
||||||
|
throw new Error(`${res.status}: ${res.statusText}`);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function logout() {
|
||||||
|
let url = new URL(config.instance);
|
||||||
|
url.pathname = "/oauth/revoke";
|
||||||
|
return fetch(url.href, {
|
||||||
|
method: "POST",
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
},
|
||||||
|
body: JSON.stringify({
|
||||||
|
client_id: state.client_id,
|
||||||
|
client_secret: state.client_secret,
|
||||||
|
token: state.access_token,
|
||||||
|
})
|
||||||
|
}).then((res) => {
|
||||||
|
if (res.status != 200) {
|
||||||
|
// GoToSocial doesn't actually implement this route yet,
|
||||||
|
// so error is to be expected
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
return res.json();
|
||||||
|
}).catch(() => {
|
||||||
|
// see above
|
||||||
|
}).then(() => {
|
||||||
|
localStorage.removeItem("oauth");
|
||||||
|
window.location = getCurrentUrl();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
register, authorize, callback, isAuthorized, apiRequest, logout
|
||||||
|
};
|
||||||
|
};
|
||||||
157
web/source/panels/admin/settings.js
Normal file
157
web/source/panels/admin/settings.js
Normal file
|
|
@ -0,0 +1,157 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
const Promise = require("bluebird");
|
||||||
|
const React = require("react");
|
||||||
|
|
||||||
|
module.exports = function Settings({oauth}) {
|
||||||
|
const [info, setInfo] = React.useState({});
|
||||||
|
const [errorMsg, setError] = React.useState("");
|
||||||
|
const [statusMsg, setStatus] = React.useState("Fetching instance info");
|
||||||
|
|
||||||
|
React.useEffect(() => {
|
||||||
|
Promise.try(() => {
|
||||||
|
return oauth.apiRequest("/api/v1/instance", "GET");
|
||||||
|
}).then((json) => {
|
||||||
|
setInfo(json);
|
||||||
|
}).catch((e) => {
|
||||||
|
setError(e.message);
|
||||||
|
setStatus("");
|
||||||
|
});
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
function submit() {
|
||||||
|
setStatus("PATCHing");
|
||||||
|
setError("");
|
||||||
|
return Promise.try(() => {
|
||||||
|
let formDataInfo = new FormData();
|
||||||
|
Object.entries(info).forEach(([key, val]) => {
|
||||||
|
if (key == "contact_account") {
|
||||||
|
key = "contact_username";
|
||||||
|
val = val.username;
|
||||||
|
}
|
||||||
|
if (key == "email") {
|
||||||
|
key = "contact_email";
|
||||||
|
}
|
||||||
|
if (typeof val != "object") {
|
||||||
|
formDataInfo.append(key, val);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return oauth.apiRequest("/api/v1/instance", "PATCH", formDataInfo, "form");
|
||||||
|
}).then((json) => {
|
||||||
|
setStatus("Config saved");
|
||||||
|
console.log(json);
|
||||||
|
}).catch((e) => {
|
||||||
|
setError(e.message);
|
||||||
|
setStatus("");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<section className="info login">
|
||||||
|
<h1>Instance Information <button onClick={submit}>Save</button></h1>
|
||||||
|
<div className="error accent">
|
||||||
|
{errorMsg}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
{statusMsg}
|
||||||
|
</div>
|
||||||
|
<form onSubmit={(e) => e.preventDefault()}>
|
||||||
|
{editableObject(info)}
|
||||||
|
</form>
|
||||||
|
</section>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
function editableObject(obj, path=[]) {
|
||||||
|
const readOnlyKeys = ["uri", "version", "urls_streaming_api", "stats"];
|
||||||
|
const hiddenKeys = ["contact_account_", "urls"];
|
||||||
|
const explicitShownKeys = ["contact_account_username"];
|
||||||
|
const implementedKeys = "title, contact_account_username, email, short_description, description, terms, avatar, header".split(", ");
|
||||||
|
|
||||||
|
let listing = Object.entries(obj).map(([key, val]) => {
|
||||||
|
let fullkey = [...path, key].join("_");
|
||||||
|
|
||||||
|
if (
|
||||||
|
hiddenKeys.includes(fullkey) ||
|
||||||
|
hiddenKeys.includes(path.join("_")+"_") // also match just parent path
|
||||||
|
) {
|
||||||
|
if (!explicitShownKeys.includes(fullkey)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Array.isArray(val)) {
|
||||||
|
// FIXME: handle this
|
||||||
|
} else if (typeof val == "object") {
|
||||||
|
return (<React.Fragment key={fullkey}>
|
||||||
|
{editableObject(val, [...path, key])}
|
||||||
|
</React.Fragment>);
|
||||||
|
}
|
||||||
|
|
||||||
|
let isImplemented = "";
|
||||||
|
if (!implementedKeys.includes(fullkey)) {
|
||||||
|
isImplemented = " notImplemented";
|
||||||
|
}
|
||||||
|
|
||||||
|
let isReadOnly = (
|
||||||
|
readOnlyKeys.includes(fullkey) ||
|
||||||
|
readOnlyKeys.includes(path.join("_")) ||
|
||||||
|
isImplemented != ""
|
||||||
|
);
|
||||||
|
|
||||||
|
let label = key.replace(/_/g, " ");
|
||||||
|
if (path.length > 0) {
|
||||||
|
label = `\u00A0`.repeat(4 * path.length) + label;
|
||||||
|
}
|
||||||
|
|
||||||
|
let inputProps;
|
||||||
|
let changeFunc;
|
||||||
|
if (val === true || val === false) {
|
||||||
|
inputProps = {
|
||||||
|
type: "checkbox",
|
||||||
|
defaultChecked: val,
|
||||||
|
disabled: isReadOnly
|
||||||
|
};
|
||||||
|
changeFunc = (e) => e.target.checked;
|
||||||
|
} else if (val.length != 0 && !isNaN(val)) {
|
||||||
|
inputProps = {
|
||||||
|
type: "number",
|
||||||
|
defaultValue: val,
|
||||||
|
readOnly: isReadOnly
|
||||||
|
};
|
||||||
|
changeFunc = (e) => e.target.value;
|
||||||
|
} else {
|
||||||
|
inputProps = {
|
||||||
|
type: "text",
|
||||||
|
defaultValue: val,
|
||||||
|
readOnly: isReadOnly
|
||||||
|
};
|
||||||
|
changeFunc = (e) => e.target.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
function setRef(element) {
|
||||||
|
if (element != null) {
|
||||||
|
element.addEventListener("change", (e) => {
|
||||||
|
obj[key] = changeFunc(e);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<React.Fragment key={fullkey}>
|
||||||
|
<label htmlFor={key} className="capitalize">{label}</label>
|
||||||
|
<div className={isImplemented}>
|
||||||
|
<input className={isImplemented} ref={setRef} {...inputProps} />
|
||||||
|
</div>
|
||||||
|
</React.Fragment>
|
||||||
|
);
|
||||||
|
});
|
||||||
|
return (
|
||||||
|
<React.Fragment>
|
||||||
|
{path != "" &&
|
||||||
|
<><b>{path}:</b> <span id="filler"></span></>
|
||||||
|
}
|
||||||
|
{listing}
|
||||||
|
</React.Fragment>
|
||||||
|
);
|
||||||
|
}
|
||||||
123
web/source/panels/admin/style.css
Normal file
123
web/source/panels/admin/style.css
Normal file
|
|
@ -0,0 +1,123 @@
|
||||||
|
body {
|
||||||
|
grid-template-rows: auto 1fr;
|
||||||
|
}
|
||||||
|
|
||||||
|
.capitalize {
|
||||||
|
text-transform: capitalize;
|
||||||
|
}
|
||||||
|
|
||||||
|
section {
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
input, select, textarea {
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
section.info {
|
||||||
|
form {
|
||||||
|
grid-template-columns: auto 1fr;
|
||||||
|
width: calc(100% - 0.35rem);
|
||||||
|
|
||||||
|
input {
|
||||||
|
width: 100%;
|
||||||
|
line-height: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
label, input {
|
||||||
|
padding: 0.2rem 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type=checkbox] {
|
||||||
|
justify-self: start;
|
||||||
|
width: initial;
|
||||||
|
}
|
||||||
|
|
||||||
|
input:read-only {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
input:invalid {
|
||||||
|
border-color: red;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
textarea {
|
||||||
|
width: 100%;
|
||||||
|
height: 8rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
section.blocks {
|
||||||
|
.overflow {
|
||||||
|
max-height: 80vh;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.blocklist {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: auto 1fr auto;
|
||||||
|
grid-gap: 0.35rem 0;
|
||||||
|
|
||||||
|
div {
|
||||||
|
background: rgb(70, 79, 88);
|
||||||
|
padding: 0.2rem 0.4rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.addblock {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr auto auto;
|
||||||
|
grid-gap: 0.35rem;
|
||||||
|
|
||||||
|
input, select {
|
||||||
|
font-size: 1.2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
input, select, textarea {
|
||||||
|
padding: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
div {
|
||||||
|
grid-column: 1/4;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.single input {
|
||||||
|
width: initial;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
h3 {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.controls {
|
||||||
|
display: flex;
|
||||||
|
gap: 0.5rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.error {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hidden {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.notImplemented {
|
||||||
|
border: 2px solid rgb(70, 79, 88);
|
||||||
|
background: repeating-linear-gradient(
|
||||||
|
-45deg,
|
||||||
|
#525c66,
|
||||||
|
#525c66 10px,
|
||||||
|
rgb(70, 79, 88) 10px,
|
||||||
|
rgb(70, 79, 88) 20px
|
||||||
|
) !important;
|
||||||
|
}
|
||||||
13
web/source/panels/user/index.js
Normal file
13
web/source/panels/user/index.js
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
const Promise = require("bluebird");
|
||||||
|
const React = require("react");
|
||||||
|
const ReactDom = require("react-dom");
|
||||||
|
|
||||||
|
// require("./style.css");
|
||||||
|
|
||||||
|
function App() {
|
||||||
|
return "hello world - user panel";
|
||||||
|
}
|
||||||
|
|
||||||
|
ReactDom.render(<App/>, document.getElementById("root"));
|
||||||
6468
web/source/yarn.lock
Normal file
6468
web/source/yarn.lock
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -9,7 +9,8 @@
|
||||||
<meta name="og:title" content="GoToSocial Testing Instance">
|
<meta name="og:title" content="GoToSocial Testing Instance">
|
||||||
<meta name="og:description" content="">
|
<meta name="og:description" content="">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<link rel="stylesheet" href="/assets/base.css">
|
<link rel="stylesheet" href="/assets/bundled/_colors.css">
|
||||||
|
<link rel="stylesheet" href="/assets/bundled/base.css">
|
||||||
{{range .stylesheets}}<link rel="stylesheet" href="{{.}}">
|
{{range .stylesheets}}<link rel="stylesheet" href="{{.}}">
|
||||||
{{end}}
|
{{end}}
|
||||||
<link rel="shortcut icon" href="/assets/logo.png" type="image/png">
|
<link rel="shortcut icon" href="/assets/logo.png" type="image/png">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue