1
Fork 0
mirror of https://github.com/Steffo99/bluelib.git synced 2024-12-22 11:34:21 +00:00
This commit is contained in:
Steffo 2020-06-30 22:50:59 +02:00
parent 223ac34dfd
commit ef4ebb8d0d
Signed by: steffo
GPG key ID: 896A80F55F7C97F0
38 changed files with 194 additions and 128 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

File diff suppressed because one or more lines are too long

View file

@ -1 +0,0 @@
/*! showdown v 1.9.1 - 02-11-2019 */

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1 +0,0 @@
/*! For license information please see bundle.49166.esm.js.LICENSE.txt */

View file

@ -1 +0,0 @@
{"version":3,"sources":[],"names":[],"mappings":"","file":"bundle.49166.esm.js","sourceRoot":""}

View file

@ -1 +0,0 @@
<!DOCTYPE html><html lang="it"><head><meta charset="utf-8"><title>bluelib</title><meta name="viewport" content="width=device-width,initial-scale=1"><style>body{background-color:#0d193b;color:#a0ccff}</style><link rel="manifest" href="/manifest.json"><link href="/bundle.2454a.css" rel="preload" as="style" onload="this.rel='stylesheet'"><noscript><link rel="stylesheet" href="/bundle.2454a.css"></noscript></head><body><script type="__PREACT_CLI_DATA__">{"preRenderData":{"url":"/"}}</script><script nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" src="/bundle.49166.esm.js" type="module"></script><script nomodule="" src="/polyfills.ac517.js"></script><script nomodule="" defer="defer" src="/bundle.21947.js"></script></body></html>

View file

@ -1,14 +0,0 @@
{
"name": "preact-cli app",
"start_url": "/",
"display": "standalone",
"background_color": "#fff",
"theme_color": "#673ab8",
"icons": [
{
"src": "/assets/icon.png",
"type": "image/png",
"sizes": "512x512"
}
]
}

File diff suppressed because one or more lines are too long

View file

@ -1 +0,0 @@
{"version":3,"sources":[],"names":[],"mappings":"","file":"polyfills.45ce9.esm.js","sourceRoot":""}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1 +0,0 @@
{"url":"/"}

View file

@ -1 +0,0 @@
{"/":{"bundle.2454a.css":{"type":"style","weight":1},"bundle.49166.esm.js":{"type":"script","weight":1}},"/Sample":{"bundle.2454a.css":{"type":"style","weight":1},"bundle.49166.esm.js":{"type":"script","weight":1},"route-Sample.chunk.4a13c.esm.js":{"type":"script","weight":0.9},"route-Sample.chunk.6e286.css":{"type":"style","weight":0.9}}}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1 +0,0 @@
{"version":3,"sources":[],"names":[],"mappings":"","file":"route-Sample.chunk.4a13c.esm.js","sourceRoot":""}

View file

@ -1 +0,0 @@
@keyframes flipping__2QwVZ{0%{transform:rotateY(0)}to{transform:rotateY(-1turn)}}.flipping__2QwVZ{animation:flipping__2QwVZ 2s cubic-bezier(.65,.05,.36,1) infinite}

View file

@ -1,21 +0,0 @@
self.addEventListener('fetch', function(event) {
var isPostRequest = event.request.method === 'POST';
event.respondWith(
fetch(event.request).catch(function(err) {
if (err instanceof TypeError) {
if (isPostRequest) {
// eslint-disable-next-line
console.log(
'⚛Preact CLI development tip: A POST request just failed. This might fail for your users as well due to a network error. It may be worth exploring the backgroundSync API.'
);
} else {
// eslint-disable-next-line
console.log(
'⚛Preact CLI development tip: A GET request just failed. This might fail for your users as well due to a network error. It may be worth adding runtimeCaching to your Service Worker.'
);
}
}
return err;
})
);
});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,7 +1,7 @@
{ {
"private": false, "private": false,
"name": "bluelib", "name": "bluelib",
"version": "0.13.15", "version": "0.14.0",
"license": "AGPL-3.0-or-later", "license": "AGPL-3.0-or-later",
"source": "src/index.js", "source": "src/index.js",
"main": "dist/index.js", "main": "dist/index.js",

View file

@ -0,0 +1,28 @@
import { concatClass } from 'bluelib';
import style from './BaseLink.less';
import { useContext } from 'preact/hooks';
import CurrentPage from '../../contexts/CurrentPage';
export default function (props) {
const currentPage = useContext(CurrentPage);
// Disabled
if(props.disabled)
{
return (
<span className={concatClass(style.link, style.disabled, props.class)}>{props.children}</span>
);
}
// Current page
if(props.href === currentPage) {
return (
<span className={concatClass(style.link, style.current, props.class)}>{props.children}</span>
);
}
// Others
return (
<a className={concatClass(style.link, style.clickable, props.class)} href={props.href}>{props.children}</a>
);
}

View file

@ -0,0 +1,27 @@
@import "../../styles/constants.less";
.link {
color: @link;
&.clickable {
cursor: pointer;
&:hover {
color: @linkhover;
}
&:active {
color: @linkactive;
}
}
&.disabled {
cursor: not-allowed;
opacity: 0.4;
}
&.current {
color: @accent;
font-weight: bold;
}
}

View file

@ -0,0 +1,9 @@
import style from "./HZero.less";
export default function (props) {
return (
<div class={style.h0}>
{props.children}
</div>
);
}

View file

@ -0,0 +1,9 @@
@import "../../styles/constants.less";
.h0 {
display: block;
text-align: center;
color: @accent;
font-family: @title;
font-size: 48px;
}

View file

@ -0,0 +1,9 @@
import style from "./BasicContainer.less";
export default function (props) {
return (
<div class={style.basiccontainer}>
{props.children}
</div>
);
}

View file

@ -0,0 +1,7 @@
@import "../../styles/constants.less";
.basiccontainer {
max-width: 1280px;
margin-left: auto;
margin-right: auto;
}

View file

@ -0,0 +1,17 @@
import style from "./LeftRight.less";
export default function (props) {
return (
<div class={style.container}>
<div class={style.left}>
{props.left}
</div>
<div class={style.center}>
{props.center}
</div>
<div class={style.right}>
{props.right}
</div>
</div>
);
}

View file

@ -0,0 +1,28 @@
@import "../../styles/constants.less";
.container {
display: flex;
align-items: center;
white-space: nowrap;
overflow-x: auto;
overflow-y: hidden;
}
.left {
width: 100%;
text-align: left;
justify-self: start;
}
.center {
width: 100%;
text-align: center;
justify-self: center;
}
.right {
width: 100%;
text-align: right;
justify-self: end;
}

View file

@ -5,6 +5,7 @@ export default function (props) {
if(Array.isArray(props.children)) { if(Array.isArray(props.children)) {
children = props.children.map(element => { children = props.children.map(element => {
console.log(element);
return ( return (
<div class={style.splitchild}> <div class={style.splitchild}>
{element} {element}

View file

@ -0,0 +1,3 @@
import { createContext } from 'preact';
export default createContext(undefined);

View file

@ -1,45 +1,43 @@
import Box from "./components/Panels/Box"; import BaseLink from "./components/Elements/BaseLink";
import {BoxColors} from "./components/Panels/Box"; import BasicContainer from "./components/Layout/BasicContainer";
import Image from "./components/Elements/Image";
import Panel from "./components/Panels/Panel";
import Section from "./components/Panels/Section";
import TablePanel from "./components/Panels/TablePanel";
import Timer from "./components/Elements/Timer";
import Todo from "./components/Elements/Todo";
import FormRow from "./components/Forms/FormRow";
import FormInput from "./components/Forms/FormInput";
import FormButton from "./components/Forms/FormButton";
import Split from "./components/Layout/Split";
import BLatex from "./components/Rendering/BLatex"; import BLatex from "./components/Rendering/BLatex";
import Box from "./components/Panels/Box";
import Code from "./components/Rendering/Code"; import Code from "./components/Rendering/Code";
import concatClass from "./utils/concatClass";
import CurrentPage from "./contexts/CurrentPage";
import FormButton from "./components/Forms/FormButton";
import FormInput from "./components/Forms/FormInput";
import FormRow from "./components/Forms/FormRow";
import getEventValue from "./utils/getEventValue";
import HZero from "./components/Elements/HZero";
import ILatex from "./components/Rendering/ILatex"; import ILatex from "./components/Rendering/ILatex";
import Image from "./components/Elements/Image";
import isString from "./utils/isString";
import isValidDate from "./utils/isValidDate";
import Latex from "./components/Rendering/Latex"; import Latex from "./components/Rendering/Latex";
import {LatexDisplay} from "./components/Rendering/Latex";
import Markdown from "./components/Rendering/Markdown";
import PLatex from "./components/Rendering/PLatex";
import LatexDefaultDisplay from "./contexts/LatexDefaultDisplay"; import LatexDefaultDisplay from "./contexts/LatexDefaultDisplay";
import LatexDefaultInline from "./contexts/LatexDefaultInline"; import LatexDefaultInline from "./contexts/LatexDefaultInline";
import LatexRenderColor from "./contexts/LatexRenderColor"; import LatexRenderColor from "./contexts/LatexRenderColor";
import LeftRight from "./components/Layout/LeftRight";
import Markdown from "./components/Rendering/Markdown";
import Panel from "./components/Panels/Panel";
import PLatex from "./components/Rendering/PLatex";
import RoyalnetInstanceUrl from "./contexts/RoyalnetInstanceUrl"; import RoyalnetInstanceUrl from "./contexts/RoyalnetInstanceUrl";
import RoyalnetLoginStatus from "./contexts/RoyalnetLoginStatus"; import RoyalnetLoginStatus from "./contexts/RoyalnetLoginStatus";
import Section from "./components/Panels/Section";
import Validity from "./enums/Validity"; import Split from "./components/Layout/Split";
import stripTabs from "./utils/stripTabs";
import TablePanel from "./components/Panels/TablePanel";
import theme from "./styles/theme.less";
import Timer from "./components/Elements/Timer";
import Todo from "./components/Elements/Todo";
import useFormValidator from "./hooks/useFormValidator"; import useFormValidator from "./hooks/useFormValidator";
import useLoginDataStorage from "./hooks/useLoginDataStorage"; import useLoginDataStorage from "./hooks/useLoginDataStorage";
import useRoyalnetData from "./hooks/useRoyalnetData"; import useRoyalnetData from "./hooks/useRoyalnetData";
import useRoyalnetInstanceValidator from "./hooks/useRoyalnetInstanceValidator"; import useRoyalnetInstanceValidator from "./hooks/useRoyalnetInstanceValidator";
import Validity from "./enums/Validity";
import theme from "./styles/theme.less"; import {BoxColors} from "./components/Panels/Box";
import {LatexDisplay} from "./components/Rendering/Latex";
import concatClass from "./utils/concatClass";
import getEventValue from "./utils/getEventValue";
import isString from "./utils/isString";
import isValidDate from "./utils/isValidDate";
import stripTabs from "./utils/stripTabs";
import {royalnetApiRequest, RoyalnetApiError} from "./utils/royalnetApiRequest"; import {royalnetApiRequest, RoyalnetApiError} from "./utils/royalnetApiRequest";
import Sample from "./routes/Sample"; import Sample from "./routes/Sample";
@ -48,48 +46,46 @@ export default function(props) {
} }
export { export {
BaseLink,
BasicContainer,
BLatex,
Box, Box,
BoxColors, BoxColors,
Image,
Panel,
Section,
TablePanel,
Timer,
Todo,
FormRow,
FormInput,
FormButton,
Split,
BLatex,
Code, Code,
concatClass,
CurrentPage,
FormButton,
FormInput,
FormRow,
getEventValue,
HZero,
ILatex, ILatex,
Image,
isString,
isValidDate,
Latex, Latex,
LatexDisplay,
Markdown,
PLatex,
LatexDefaultDisplay, LatexDefaultDisplay,
LatexDefaultInline, LatexDefaultInline,
LatexDisplay,
LatexRenderColor, LatexRenderColor,
LeftRight,
Markdown,
Panel,
PLatex,
RoyalnetApiError,
royalnetApiRequest,
RoyalnetInstanceUrl, RoyalnetInstanceUrl,
RoyalnetLoginStatus, RoyalnetLoginStatus,
Section,
Validity, Split,
stripTabs,
TablePanel,
theme,
Timer,
Todo,
useFormValidator, useFormValidator,
useLoginDataStorage, useLoginDataStorage,
useRoyalnetData, useRoyalnetData,
useRoyalnetInstanceValidator, useRoyalnetInstanceValidator,
Validity,
theme,
concatClass,
getEventValue,
isString,
isValidDate,
stripTabs,
royalnetApiRequest,
RoyalnetApiError,
} }