aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--packages/forms/package.json6
-rw-r--r--packages/forms/src/button/index.tsx8
-rw-r--r--packages/forms/src/input/index.tsx4
-rw-r--r--packages/forms/src/typings/generic.ts1
-rw-r--r--packages/forms/src/wrapper/index.tsx9
-rw-r--r--packages/forms/src/wrapper/styles.ts5
-rw-r--r--packages/theme/package.json4
-rw-r--r--packages/ui/package.json6
-rw-r--r--src/index.js10
-rw-r--r--src/models/Service.js1
-rw-r--r--src/webview/recipe.js3
-rw-r--r--uidev/src/app.tsx2
-rw-r--r--uidev/src/stories/button.stories.tsx40
13 files changed, 72 insertions, 27 deletions
diff --git a/packages/forms/package.json b/packages/forms/package.json
index 0ac9a846f..d50f4c756 100644
--- a/packages/forms/package.json
+++ b/packages/forms/package.json
@@ -1,6 +1,6 @@
1{ 1{
2 "name": "@meetfranz/forms", 2 "name": "@meetfranz/forms",
3 "version": "1.0.15", 3 "version": "1.0.16",
4 "description": "React form components for Franz", 4 "description": "React form components for Franz",
5 "main": "lib/index.js", 5 "main": "lib/index.js",
6 "scripts": { 6 "scripts": {
@@ -25,7 +25,7 @@
25 "dependencies": { 25 "dependencies": {
26 "@mdi/js": "^3.3.92", 26 "@mdi/js": "^3.3.92",
27 "@mdi/react": "^1.1.0", 27 "@mdi/react": "^1.1.0",
28 "@meetfranz/theme": "^1.0.13", 28 "@meetfranz/theme": "^1.0.14",
29 "react-html-attributes": "^1.4.3", 29 "react-html-attributes": "^1.4.3",
30 "react-loader": "^2.4.5" 30 "react-loader": "^2.4.5"
31 }, 31 },
@@ -35,5 +35,5 @@
35 "react-dom": "16.7.0", 35 "react-dom": "16.7.0",
36 "react-jss": "^8.6.1" 36 "react-jss": "^8.6.1"
37 }, 37 },
38 "gitHead": "e9b9079dc921e85961954727a7b2a8eabe5b9798" 38 "gitHead": "9f2ab40b7602bc3df26ebb093b484b9917768f69"
39} 39}
diff --git a/packages/forms/src/button/index.tsx b/packages/forms/src/button/index.tsx
index 6959cde73..9faedc8f1 100644
--- a/packages/forms/src/button/index.tsx
+++ b/packages/forms/src/button/index.tsx
@@ -44,7 +44,7 @@ const styles = (theme: Theme) => ({
44 width: (props: IProps) => (props.stretch ? '100%' : 'auto') as CSS.WidthProperty<string>, 44 width: (props: IProps) => (props.stretch ? '100%' : 'auto') as CSS.WidthProperty<string>,
45 fontSize: theme.uiFontSize, 45 fontSize: theme.uiFontSize,
46 textDecoration: 'none', 46 textDecoration: 'none',
47 height: theme.buttonHeight, 47 // height: theme.buttonHeight,
48 48
49 '&:hover': { 49 '&:hover': {
50 opacity: 0.8, 50 opacity: 0.8,
@@ -129,8 +129,7 @@ const styles = (theme: Theme) => ({
129 position: (props: IProps): CSS.PositionProperty => props.stretch ? 'absolute' : 'inherit', 129 position: (props: IProps): CSS.PositionProperty => props.stretch ? 'absolute' : 'inherit',
130 }, 130 },
131 icon: { 131 icon: {
132 marginLeft: -5, 132 margin: [1, 10, 0, -5],
133 marginRight: 10,
134 }, 133 },
135}); 134});
136 135
@@ -142,7 +141,6 @@ class ButtonComponent extends Component<IProps> {
142 buttonType: 'primary' as ButtonType, 141 buttonType: 'primary' as ButtonType,
143 stretch: false, 142 stretch: false,
144 busy: false, 143 busy: false,
145 // target: '_self'
146 }; 144 };
147 145
148 state = { 146 state = {
@@ -220,7 +218,7 @@ class ButtonComponent extends Component<IProps> {
220 {icon && ( 218 {icon && (
221 <Icon 219 <Icon
222 path={icon} 220 path={icon}
223 size={1} 221 size={0.8}
224 className={classes.icon} 222 className={classes.icon}
225 /> 223 />
226 )} 224 )}
diff --git a/packages/forms/src/input/index.tsx b/packages/forms/src/input/index.tsx
index a2d7c62d5..b96dbc12d 100644
--- a/packages/forms/src/input/index.tsx
+++ b/packages/forms/src/input/index.tsx
@@ -83,7 +83,7 @@ class InputComponent extends Component<IProps, IState> {
83 } 83 }
84 84
85 onInputKeyPress(e: React.KeyboardEvent) { 85 onInputKeyPress(e: React.KeyboardEvent) {
86 if (e.key === "Enter") { 86 if (e.key === 'Enter') {
87 const { onEnterKey } = this.props; 87 const { onEnterKey } = this.props;
88 onEnterKey && onEnterKey(); 88 onEnterKey && onEnterKey();
89 } 89 }
@@ -114,6 +114,7 @@ class InputComponent extends Component<IProps, IState> {
114 max, 114 max,
115 step, 115 step,
116 required, 116 required,
117 noMargin,
117 } = this.props; 118 } = this.props;
118 119
119 const { 120 const {
@@ -127,6 +128,7 @@ class InputComponent extends Component<IProps, IState> {
127 <Wrapper 128 <Wrapper
128 className={className} 129 className={className}
129 identifier="franz-input" 130 identifier="franz-input"
131 noMargin={noMargin}
130 > 132 >
131 <Label 133 <Label
132 title={label} 134 title={label}
diff --git a/packages/forms/src/typings/generic.ts b/packages/forms/src/typings/generic.ts
index 9688ce2c7..29136dfed 100644
--- a/packages/forms/src/typings/generic.ts
+++ b/packages/forms/src/typings/generic.ts
@@ -6,6 +6,7 @@ export interface IFormField {
6 label?: string; 6 label?: string;
7 error?: string; 7 error?: string;
8 required?: boolean; 8 required?: boolean;
9 noMargin?: boolean;
9} 10}
10 11
11export interface IWithStyle { 12export interface IWithStyle {
diff --git a/packages/forms/src/wrapper/index.tsx b/packages/forms/src/wrapper/index.tsx
index d9c61381d..cf179bc5e 100644
--- a/packages/forms/src/wrapper/index.tsx
+++ b/packages/forms/src/wrapper/index.tsx
@@ -3,14 +3,19 @@ import React, { Component } from 'react';
3import injectStyle from 'react-jss'; 3import injectStyle from 'react-jss';
4import { IWithStyle } from '../typings/generic'; 4import { IWithStyle } from '../typings/generic';
5 5
6import styles from './styles';
7
8interface IProps extends IWithStyle { 6interface IProps extends IWithStyle {
9 children: React.ReactNode; 7 children: React.ReactNode;
10 className?: string; 8 className?: string;
11 identifier: string; 9 identifier: string;
10 noMargin?: boolean;
12} 11}
13 12
13const styles = {
14 container: {
15 marginBottom: (props: IProps) => props.noMargin ? 0 : 20,
16 },
17};
18
14class WrapperComponent extends Component<IProps> { 19class WrapperComponent extends Component<IProps> {
15 render() { 20 render() {
16 const { 21 const {
diff --git a/packages/forms/src/wrapper/styles.ts b/packages/forms/src/wrapper/styles.ts
deleted file mode 100644
index 72306b252..000000000
--- a/packages/forms/src/wrapper/styles.ts
+++ /dev/null
@@ -1,5 +0,0 @@
1export default {
2 container: {
3 marginBottom: 20,
4 },
5};
diff --git a/packages/theme/package.json b/packages/theme/package.json
index 642904089..fa12c8a30 100644
--- a/packages/theme/package.json
+++ b/packages/theme/package.json
@@ -1,6 +1,6 @@
1{ 1{
2 "name": "@meetfranz/theme", 2 "name": "@meetfranz/theme",
3 "version": "1.0.13", 3 "version": "1.0.14",
4 "description": "Theme configuration for Franz", 4 "description": "Theme configuration for Franz",
5 "author": "Stefan Malzner <stefan@adlk.io>", 5 "author": "Stefan Malzner <stefan@adlk.io>",
6 "homepage": "https://github.com/meetfranz/franz", 6 "homepage": "https://github.com/meetfranz/franz",
@@ -25,5 +25,5 @@
25 "dependencies": { 25 "dependencies": {
26 "color": "^3.1.0" 26 "color": "^3.1.0"
27 }, 27 },
28 "gitHead": "e9b9079dc921e85961954727a7b2a8eabe5b9798" 28 "gitHead": "9f2ab40b7602bc3df26ebb093b484b9917768f69"
29} 29}
diff --git a/packages/ui/package.json b/packages/ui/package.json
index 514b2cc7c..a851ed9cf 100644
--- a/packages/ui/package.json
+++ b/packages/ui/package.json
@@ -1,6 +1,6 @@
1{ 1{
2 "name": "@meetfranz/ui", 2 "name": "@meetfranz/ui",
3 "version": "0.0.8", 3 "version": "0.0.9",
4 "description": "React UI components for Franz", 4 "description": "React UI components for Franz",
5 "main": "lib/index.js", 5 "main": "lib/index.js",
6 "scripts": { 6 "scripts": {
@@ -25,7 +25,7 @@
25 "dependencies": { 25 "dependencies": {
26 "@mdi/js": "^3.3.92", 26 "@mdi/js": "^3.3.92",
27 "@mdi/react": "^1.1.0", 27 "@mdi/react": "^1.1.0",
28 "@meetfranz/theme": "^1.0.13", 28 "@meetfranz/theme": "^1.0.14",
29 "react-loader": "^2.4.5" 29 "react-loader": "^2.4.5"
30 }, 30 },
31 "peerDependencies": { 31 "peerDependencies": {
@@ -34,5 +34,5 @@
34 "react-dom": "16.7.0", 34 "react-dom": "16.7.0",
35 "react-jss": "^8.6.1" 35 "react-jss": "^8.6.1"
36 }, 36 },
37 "gitHead": "e9b9079dc921e85961954727a7b2a8eabe5b9798" 37 "gitHead": "9f2ab40b7602bc3df26ebb093b484b9917768f69"
38} 38}
diff --git a/src/index.js b/src/index.js
index 49cf07618..55592c328 100644
--- a/src/index.js
+++ b/src/index.js
@@ -354,18 +354,26 @@ app.on('ready', () => {
354// TODO: rewrite to handle multiple login calls 354// TODO: rewrite to handle multiple login calls
355const noop = () => null; 355const noop = () => null;
356let authCallback = noop; 356let authCallback = noop;
357
357app.on('login', (event, webContents, request, authInfo, callback) => { 358app.on('login', (event, webContents, request, authInfo, callback) => {
358 authCallback = callback; 359 authCallback = callback;
359 debug('browser login event', authInfo); 360 debug('browser login event', authInfo);
360 event.preventDefault(); 361 event.preventDefault();
362
361 if (authInfo.isProxy && authInfo.scheme === 'basic') { 363 if (authInfo.isProxy && authInfo.scheme === 'basic') {
364 debug('Sending service echo ping');
362 webContents.send('get-service-id'); 365 webContents.send('get-service-id');
363 366
364 ipcMain.once('service-id', (e, id) => { 367 ipcMain.once('service-id', (e, id) => {
365 debug('Received service id', id); 368 debug('Received service id', id);
366 369
367 const ps = proxySettings.get(id); 370 const ps = proxySettings.get(id);
368 callback(ps.user, ps.password); 371 if (ps) {
372 debug('Sending proxy auth callback for service', id);
373 callback(ps.user, ps.password);
374 } else {
375 debug('No proxy auth config found for', id);
376 }
369 }); 377 });
370 } else if (authInfo.scheme === 'basic') { 378 } else if (authInfo.scheme === 'basic') {
371 debug('basic auth handler', authInfo); 379 debug('basic auth handler', authInfo);
diff --git a/src/models/Service.js b/src/models/Service.js
index a118c093e..88bce3360 100644
--- a/src/models/Service.js
+++ b/src/models/Service.js
@@ -116,6 +116,7 @@ export default class Service {
116 116
117 @computed get shareWithWebview() { 117 @computed get shareWithWebview() {
118 return { 118 return {
119 id: this.id,
119 spellcheckerLanguage: this.spellcheckerLanguage, 120 spellcheckerLanguage: this.spellcheckerLanguage,
120 isDarkModeEnabled: this.isDarkModeEnabled, 121 isDarkModeEnabled: this.isDarkModeEnabled,
121 }; 122 };
diff --git a/src/webview/recipe.js b/src/webview/recipe.js
index 1e5d74b1f..c223b73de 100644
--- a/src/webview/recipe.js
+++ b/src/webview/recipe.js
@@ -127,6 +127,7 @@ class RecipeController {
127 } 127 }
128 128
129 serviceIdEcho(event) { 129 serviceIdEcho(event) {
130 debug('Received a service echo ping');
130 event.sender.send('service-id', this.settings.service.id); 131 event.sender.send('service-id', this.settings.service.id);
131 } 132 }
132 133
@@ -137,8 +138,6 @@ class RecipeController {
137 window.addEventListener('keyup', debounce((e) => { 138 window.addEventListener('keyup', debounce((e) => {
138 const element = e.target; 139 const element = e.target;
139 140
140 console.log(element);
141
142 if (!element) return; 141 if (!element) return;
143 142
144 let value = ''; 143 let value = '';
diff --git a/uidev/src/app.tsx b/uidev/src/app.tsx
index 870911c2f..cef22e7a7 100644
--- a/uidev/src/app.tsx
+++ b/uidev/src/app.tsx
@@ -2,7 +2,7 @@ import CSS from 'csstype';
2import { Classes } from 'jss'; 2import { Classes } from 'jss';
3import { observer } from 'mobx-react'; 3import { observer } from 'mobx-react';
4import DevTools from 'mobx-react-devtools'; 4import DevTools from 'mobx-react-devtools';
5import React, { Component } from 'react'; 5import React from 'react';
6import injectSheet from 'react-jss'; 6import injectSheet from 'react-jss';
7 7
8import { WithTheme } from './withTheme'; 8import { WithTheme } from './withTheme';
diff --git a/uidev/src/stories/button.stories.tsx b/uidev/src/stories/button.stories.tsx
index c8e9bcbf3..f7537895c 100644
--- a/uidev/src/stories/button.stories.tsx
+++ b/uidev/src/stories/button.stories.tsx
@@ -1,8 +1,11 @@
1import { observable } from 'mobx'; 1import { observable } from 'mobx';
2import { observer } from 'mobx-react'; 2import { observer } from 'mobx-react';
3import React from 'react'; 3import React from 'react';
4import injectSheet from 'react-jss';
4 5
5import { Button } from '@meetfranz/forms'; 6import { Button, Input } from '@meetfranz/forms';
7import { classes } from 'istanbul-lib-coverage';
8import { Classes } from 'jss';
6import { storiesOf } from '../stores/stories'; 9import { storiesOf } from '../stores/stories';
7 10
8const defaultProps = { 11const defaultProps = {
@@ -13,6 +16,17 @@ const defaultProps = {
13 disabled: false, 16 disabled: false,
14}; 17};
15 18
19const styles = {
20 combinedElements: {
21 display: 'flex',
22 justifyContent: 'space-between',
23 },
24 input: {
25 flex: 1,
26 marginRight: 20,
27 },
28};
29
16const createStore = (args?: any) => { 30const createStore = (args?: any) => {
17 return observable(Object.assign({}, defaultProps, args)); 31 return observable(Object.assign({}, defaultProps, args));
18}; 32};
@@ -99,4 +113,26 @@ storiesOf('Button')
99 e.preventDefault(); 113 e.preventDefault();
100 alert('Click event'); 114 alert('Click event');
101 }, 115 },
102 })} />)); 116 })}/>
117 ))
118 .add('Long multi-line button', () => (
119 <WithStoreButton store={createStore({
120 label: 'But there is something that I must say to my people, who stand on the warm threshold which leads into the palace of justice: In the process of gaining our rightful place, we must not be guilty of wrongful deeds. Let us not seek to satisfy our thirst for freedom by drinking from the cup of bitterness and hatred. We must forever conduct our struggle on the high plane of dignity and discipline. We must not allow our creative protest to degenerate into physical violence. Again and again, we must rise to the majestic heights of meeting physical force with soul force.',
121 })} />
122 ))
123 .add('Button with Input', injectSheet(styles)(observer(({ classes }: { classes: Classes }) => (
124 <div className={classes.combinedElements}>
125 <Input showLabel={false} className={classes.input} noMargin />
126 <WithStoreButton store={createStore({})} />
127 </div>
128 )),
129 ))
130 .add('Icon Button with Input', injectSheet(styles)(observer(({ classes }: { classes: Classes }) => (
131 <div className={classes.combinedElements}>
132 <Input showLabel={false} className={classes.input} noMargin />
133 <WithStoreButton store={createStore({
134 icon: 'mdiInformation',
135 })} />
136 </div>
137 )),
138 ));