Eject from preact-cli

This commit is contained in:
2020-04-22 22:07:52 +02:00
parent b0339d2ce0
commit 5f0cad970e
52 changed files with 2276 additions and 13925 deletions

View File

@ -1,5 +0,0 @@
{
"presets": [
["preact-cli/babel", { "modules": "commonjs" }]
]
}

View File

@ -1,16 +1,10 @@
import { FunctionalComponent, h } from "preact";
import { Route, Router, RouterOnChangeArgs } from "preact-router";
import Home from "../routes/home";
import Project from "../routes/project";
import NotFoundPage from '../routes/notfound';
import Header from "./header";
// eslint-disable-next-line @typescript-eslint/no-explicit-any
if ((module as any).hot) {
// tslint:disable-next-line:no-var-requires
require("preact/debug");
}
import Home from "../routes/home/index";
import Project from "../routes/project/index";
import NotFoundPage from '../routes/notfound/index';
import Header from "./header/index";
const App: FunctionalComponent = () => {
let currentUrl: string;

View File

@ -1,6 +1,5 @@
import { FunctionalComponent, h, Component, ComponentChild, Fragment } from "preact";
import { Link } from "preact-router/match";
import * as style from "./style.css";
import * as style from "./style.module.css";
import { useState, useEffect } from "preact/hooks";
export interface EditableTextProps {

View File

@ -1,3 +0,0 @@
// This file is automatically generated from your CSS. Any edits will be overwritten.
export const editableText: string;
export const editIcon: string;

View File

@ -0,0 +1,13 @@
declare namespace StyleModuleCssModule {
export interface IStyleModuleCss {
editIcon: string;
editableText: string;
}
}
declare const StyleModuleCssModule: StyleModuleCssModule.IStyleModuleCss & {
/** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */
locals: StyleModuleCssModule.IStyleModuleCss;
};
export = StyleModuleCssModule;

View File

@ -1,5 +1,8 @@
import ProjectTimeUnit from "./project-time-unit";
import { defaults, getRoundUpEstimations } from "../models/params";
import { Project } from "../models/project";
import { FunctionalComponent, Fragment, h } from "preact";
import { Estimation } from "../hooks/use-project-estimations";
export interface EstimationRangeProps {
project: Project,
@ -9,8 +12,8 @@ export interface EstimationRangeProps {
export const EstimationRange: FunctionalComponent<EstimationRangeProps> = ({ project, estimation, sdFactor }) => {
const roundUp = getRoundUpEstimations(project);
let e = roundUp ? Math.ceil(estimation.e) : estimation.e;
let sd = roundUp ? Math.ceil(estimation.sd * sdFactor) : (estimation.sd * sdFactor);
let e: number|string = roundUp ? Math.ceil(estimation.e) : estimation.e;
let sd: number|string = roundUp ? Math.ceil(estimation.sd * sdFactor) : (estimation.sd * sdFactor);
const max = e+sd;
const min = Math.max(e-sd, 0);
if (!roundUp) {

View File

@ -1,6 +1,5 @@
import { FunctionalComponent, h } from "preact";
import { Link } from "preact-router/match";
import * as style from "./style.css";
import style from "./style.module.css";
export interface HeaderProps {
class?: string
@ -8,7 +7,7 @@ export interface HeaderProps {
const Header: FunctionalComponent<HeaderProps> = ({ ...props}) => {
return (
<div class={`container ${props.class ? props.class : ''}`}>
<div class={`container ${style.header} ${props.class ? props.class : ''}`}>
<div class="columns">
<div class="column">
<nav class="navbar" role="navigation" aria-label="main navigation">

View File

@ -1,3 +0,0 @@
// This file is automatically generated from your CSS. Any edits will be overwritten.
export const header: string;
export const active: string;

View File

@ -0,0 +1,3 @@
.header {
display: inherit;
}

View File

@ -0,0 +1,12 @@
declare namespace StyleModuleCssModule {
export interface IStyleModuleCss {
header: string;
}
}
declare const StyleModuleCssModule: StyleModuleCssModule.IStyleModuleCss & {
/** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */
locals: StyleModuleCssModule.IStyleModuleCss;
};
export = StyleModuleCssModule;

View File

@ -1,5 +1,5 @@
import { FunctionalComponent, h, ComponentChild } from "preact";
import * as style from "./style.css";
import style from "./style.module.css";
import { useState } from "preact/hooks";
export interface TabItem {

View File

@ -1,3 +0,0 @@
// This file is automatically generated from your CSS. Any edits will be overwritten.
export const tabs: string;
export const tabContent: string;

View File

@ -0,0 +1,13 @@
declare namespace StyleModuleCssModule {
export interface IStyleModuleCss {
tabContent: string;
tabs: string;
}
}
declare const StyleModuleCssModule: StyleModuleCssModule.IStyleModuleCss & {
/** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */
locals: StyleModuleCssModule.IStyleModuleCss;
};
export = StyleModuleCssModule;

View File

@ -1,4 +0,0 @@
import { JSX } from "preact";
export = JSX;
export as namespace JSX;

14
src/index.html Normal file
View File

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><%= htmlWebpackPlugin.options.title %></title>
<% for (var css in htmlWebpackPlugin.files.css) { %>
<link href="<%= htmlWebpackPlugin.files.css[css] %>" rel="stylesheet">
<% } %>
</head>
<body>
<div id="app"></div>
</body>
</html>

View File

@ -2,6 +2,13 @@ import "./style/index.css";
import "bulma/css/bulma.css";
import "bulma-switch/dist/css/bulma-switch.min.css";
import App from "./components/app.tsx";
import { h, render } from 'preact'
import App from "./components/app";
export default App;
render(h(App, {}), document.getElementById('app'));
// Hot Module Replacement
if (module.hot) {
require("preact/debug");
module.hot.accept();
}

View File

@ -1,21 +0,0 @@
{
"name": "Guesstimate",
"short_name": "Guesstimate",
"start_url": "/",
"display": "standalone",
"orientation": "portrait",
"background_color": "#fff",
"theme_color": "#673ab8",
"icons": [
{
"src": "/assets/icons/android-chrome-192x192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "/assets/icons/android-chrome-512x512.png",
"type": "image/png",
"sizes": "512x512"
}
]
}

View File

@ -1,5 +1,5 @@
import { FunctionalComponent, h } from "preact";
import * as style from "./style.css";
import style from "./style.module.css";
import { route } from 'preact-router';
import { base58UUID } from '../../util/uuid';
import { useStoredProjectList } from "../../hooks/use-stored-project-list";

View File

@ -1,3 +0,0 @@
// This file is automatically generated from your CSS. Any edits will be overwritten.
export const home: string;
export const noProjects: string;

13
src/routes/home/style.module.css.d.ts vendored Normal file
View File

@ -0,0 +1,13 @@
declare namespace StyleModuleCssModule {
export interface IStyleModuleCss {
home: string;
noProjects: string;
}
}
declare const StyleModuleCssModule: StyleModuleCssModule.IStyleModuleCss & {
/** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */
locals: StyleModuleCssModule.IStyleModuleCss;
};
export = StyleModuleCssModule;

View File

@ -1,6 +1,6 @@
import { FunctionalComponent, h } from "preact";
import { Link } from 'preact-router/match';
import * as style from "./style.css";
import style from "./style.module.css";
const Notfound: FunctionalComponent = () => {
return (

View File

@ -1,2 +0,0 @@
// This file is automatically generated from your CSS. Any edits will be overwritten.
export const notFound: string;

View File

@ -0,0 +1,12 @@
declare namespace StyleModuleCssModule {
export interface IStyleModuleCss {
notFound: string;
}
}
declare const StyleModuleCssModule: StyleModuleCssModule.IStyleModuleCss & {
/** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */
locals: StyleModuleCssModule.IStyleModuleCss;
};
export = StyleModuleCssModule;

View File

@ -1,5 +1,4 @@
import { FunctionalComponent, h } from "preact";
import * as style from "./style.css";
import { Project } from "../../models/project";
import { useProjectEstimations } from "../../hooks/use-project-estimations";
import { getCurrency } from "../../models/params";

View File

@ -1,6 +1,6 @@
import { FunctionalComponent, h } from "preact";
import { useEffect } from "preact/hooks";
import * as style from "./style.css";
import style from "./style.module.css";
import { newProject } from "../../models/project";
import { useProjectReducer, updateProjectLabel } from "../../hooks/use-project-reducer";
import { getProjectStorageKey } from "../../util/storage";

View File

@ -1,9 +1,6 @@
import { FunctionalComponent, h, Fragment } from "preact";
import { Project } from "../../models/project";
import TaskTable from "./tasks-table";
import TimePreview from "./time-preview";
import FinancialPreview from "./financial-preview";
import { addTask, updateTaskEstimation, removeTask, updateProjectLabel, updateTaskLabel, ProjectReducerActions, updateParam } from "../../hooks/use-project-reducer";
import { ProjectReducerActions, updateParam } from "../../hooks/use-project-reducer";
import { getRoundUpEstimations, getCurrency, getTimeUnit } from "../../models/params";
import TaskCategoriesTable from "./task-categories-table";

View File

@ -1,7 +0,0 @@
// This file is automatically generated from your CSS. Any edits will be overwritten.
export const estimation: string;
export const noTasks: string;
export const noBorder: string;
export const mainColumn: string;
export const middleTable: string;
export const tabContainer: string;

View File

@ -0,0 +1,17 @@
declare namespace StyleModuleCssModule {
export interface IStyleModuleCss {
estimation: string;
mainColumn: string;
middleTable: string;
noBorder: string;
noTasks: string;
tabContainer: string;
}
}
declare const StyleModuleCssModule: StyleModuleCssModule.IStyleModuleCss & {
/** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */
locals: StyleModuleCssModule.IStyleModuleCss;
};
export = StyleModuleCssModule;

View File

@ -1,6 +1,6 @@
import { FunctionalComponent, h } from "preact";
import { Project } from "../../models/project";
import * as style from './style.css';
import style from './style.module.css';
import { projectReducer, ProjectReducerActions, updateTaskCategoryCost, updateTaskCategoryLabel, removeTaskCategory } from "../../hooks/use-project-reducer";
import EditableText from "../../components/editable-text";
import { TaskCategoryID } from "../../models/task";

View File

@ -1,6 +1,6 @@
import { FunctionalComponent, h } from "preact";
import { useState, useEffect } from "preact/hooks";
import * as style from "./style.css";
import style from "./style.module.css";
import { Project } from "../../models/project";
import { newTask, Task, TaskID, EstimationConfidence } from "../../models/task";
import EditableText from "../../components/editable-text";

View File

@ -1 +1,13 @@
export const app: string;
declare namespace IndexCssModule {
export interface IIndexCss {
app: string;
noPrint: string;
}
}
declare const IndexCssModule: IndexCssModule.IIndexCss & {
/** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */
locals: IndexCssModule.IIndexCss;
};
export = IndexCssModule;