highmark-cli 0.0.135 → 0.0.139
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/action/publish.js +2 -0
- package/bin/constants.js +3 -1
- package/bin/handler/liveReload.js +18 -0
- package/bin/operation/copyCheckmark.js +32 -0
- package/bin/operation/copyClient.js +5 -5
- package/bin/operation/markdownStylesCSS.js +2 -2
- package/bin/operation/server.js +7 -10
- package/bin/router/static.js +17 -0
- package/checkmark.svg +12 -0
- package/client.js +6342 -773
- package/css/loading.css +32 -32
- package/lib/client.js +22 -9
- package/lib/constants.js +55 -23
- package/lib/createMethods.js +64 -0
- package/lib/customEventTypes.js +48 -4
- package/lib/eventTypes.js +5 -1
- package/lib/localStorage.js +56 -0
- package/lib/mixins/fullsrean.js +63 -0
- package/lib/mixins/touch.js +414 -70
- package/lib/position/relative.js +97 -0
- package/lib/position.js +8 -36
- package/lib/selectors.js +26 -0
- package/lib/state.js +133 -0
- package/lib/styles.js +78 -0
- package/lib/utilities/element.js +6 -3
- package/lib/utilities/fullScreen.js +16 -0
- package/lib/utilities/orientation.js +39 -0
- package/lib/utilities/positions.js +143 -0
- package/lib/view/button/closeMenu.js +121 -0
- package/lib/view/button/fullScreen.js +121 -0
- package/lib/view/button/zoomMenuIn.js +121 -0
- package/lib/view/button/zoomMenuOut.js +121 -0
- package/lib/view/button.js +160 -0
- package/lib/view/checkbox.js +193 -0
- package/lib/view/div/buttons.js +215 -0
- package/lib/view/div/checkbox/invertColours.js +151 -0
- package/lib/view/div/checkbox/restoreNativeGestures.js +147 -0
- package/lib/view/div/checkbox.js +220 -0
- package/lib/view/div/checkboxes.js +211 -0
- package/lib/view/div/leaf.js +16 -20
- package/lib/view/div/menu.js +332 -0
- package/lib/view/div/overlay.js +650 -0
- package/lib/view/div/preloader.js +204 -0
- package/lib/view/element.js +164 -0
- package/lib/view/span.js +182 -0
- package/lib/view/svg/closeMenu.js +138 -0
- package/lib/view/svg/fullScreen.js +138 -0
- package/lib/view/svg/zoomMenuIn.js +146 -0
- package/lib/view/svg/zoomMenuOut.js +141 -0
- package/lib/view/svg.js +184 -0
- package/lib/view.js +48 -221
- package/package.json +7 -6
- package/src/client.js +30 -10
- package/src/constants.js +16 -8
- package/src/createMethods.js +66 -0
- package/src/customEventTypes.js +12 -1
- package/src/eventTypes.js +1 -0
- package/src/localStorage.js +48 -0
- package/src/mixins/fullsrean.js +75 -0
- package/src/mixins/touch.js +614 -77
- package/src/position/relative.js +63 -0
- package/src/position.js +10 -48
- package/src/selectors.js +5 -0
- package/src/state.js +130 -0
- package/src/styles.js +18 -0
- package/src/utilities/element.js +7 -2
- package/src/utilities/fullScreen.js +8 -0
- package/src/utilities/orientation.js +34 -0
- package/src/utilities/positions.js +127 -0
- package/src/view/button/closeMenu.js +16 -0
- package/src/view/button/fullScreen.js +16 -0
- package/src/view/button/zoomMenuIn.js +16 -0
- package/src/view/button/zoomMenuOut.js +16 -0
- package/src/view/button.js +38 -0
- package/src/view/checkbox.js +68 -0
- package/src/view/div/buttons.js +39 -0
- package/src/view/div/checkbox/invertColours.js +33 -0
- package/src/view/div/checkbox/restoreNativeGestures.js +29 -0
- package/src/view/div/checkbox.js +45 -0
- package/src/view/div/checkboxes.js +36 -0
- package/src/view/div/leaf.js +20 -28
- package/src/view/div/menu.js +119 -0
- package/src/view/div/overlay.js +578 -0
- package/src/view/div/preloader.js +25 -0
- package/src/view/element.js +16 -0
- package/src/view/span.js +22 -0
- package/src/view/svg/closeMenu.js +19 -0
- package/src/view/svg/fullScreen.js +19 -0
- package/src/view/svg/zoomMenuIn.js +20 -0
- package/src/view/svg/zoomMenuOut.js +19 -0
- package/src/view/svg.js +24 -0
- package/src/view.js +31 -254
- package/template/default.html +10 -4
- package/lib/mixins/event.js +0 -46
- package/lib/velocity.js +0 -82
- package/src/mixins/event.js +0 -56
- package/src/velocity.js +0 -45
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import withStyle from "easy-with-style"; ///
|
|
4
|
+
|
|
5
|
+
import Element from "../element";
|
|
6
|
+
import CloseMenuButton from "../button/closeMenu";
|
|
7
|
+
import FullScreenButton from "../button/fullScreen";
|
|
8
|
+
import ZoomMenuInButton from "../button/zoomMenuIn";
|
|
9
|
+
import ZoomMenuOutButton from "../button/zoomMenuOut";
|
|
10
|
+
|
|
11
|
+
import { buttonsDivGap } from "../../styles";
|
|
12
|
+
|
|
13
|
+
class ButtonsDiv extends Element {
|
|
14
|
+
childElements() {
|
|
15
|
+
return ([
|
|
16
|
+
|
|
17
|
+
<ZoomMenuInButton/>,
|
|
18
|
+
<CloseMenuButton/>,
|
|
19
|
+
<ZoomMenuOutButton/>,
|
|
20
|
+
<FullScreenButton/>
|
|
21
|
+
|
|
22
|
+
]);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
static tagName = "div";
|
|
26
|
+
|
|
27
|
+
static defaultProperties = {
|
|
28
|
+
className: "buttons"
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export default withStyle(ButtonsDiv)`
|
|
33
|
+
|
|
34
|
+
gap: ${buttonsDivGap};
|
|
35
|
+
display: grid;
|
|
36
|
+
grid-template-rows: min-content min-content;
|
|
37
|
+
grid-template-columns: min-content min-content;
|
|
38
|
+
|
|
39
|
+
`;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import CheckboxDiv from "../../div/checkbox";
|
|
4
|
+
|
|
5
|
+
import { areColoursInverted } from "../../../state";
|
|
6
|
+
|
|
7
|
+
export default class InvertColoursCheckboxDiv extends CheckboxDiv {
|
|
8
|
+
changeHandler = (event, element) => {
|
|
9
|
+
const checkboxChecked = this.isCheckboxChecked();
|
|
10
|
+
|
|
11
|
+
checkboxChecked ?
|
|
12
|
+
controller.invertColours() :
|
|
13
|
+
controller.revertColours();
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
didMount() {
|
|
17
|
+
const coloursInverted = areColoursInverted();
|
|
18
|
+
|
|
19
|
+
coloursInverted ?
|
|
20
|
+
this.checkCheckbox() :
|
|
21
|
+
this.uncheckCheckbox();
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
willUnmount() {
|
|
25
|
+
///
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
static message = "Invert colours";
|
|
29
|
+
|
|
30
|
+
static defaultProperties = {
|
|
31
|
+
className: "invert-colours"
|
|
32
|
+
};
|
|
33
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import CheckboxDiv from "../../div/checkbox";
|
|
4
|
+
|
|
5
|
+
export default class RestoreNativeGesturesCheckboxDiv extends CheckboxDiv {
|
|
6
|
+
changeHandler = (event, element) => {
|
|
7
|
+
const checkboxChecked = this.isCheckboxChecked();
|
|
8
|
+
|
|
9
|
+
checkboxChecked ?
|
|
10
|
+
controller.restoreNativeGestures() :
|
|
11
|
+
controller.suppressNativeGestures();
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
parentContext() {
|
|
15
|
+
const checkRestoreNativeGesturesCheckbox = this.checkCheckbox.bind(this), ///
|
|
16
|
+
uncheckRestoreNativeGesturesCheckbox = this.uncheckCheckbox.bind(this); ///
|
|
17
|
+
|
|
18
|
+
return ({
|
|
19
|
+
checkRestoreNativeGesturesCheckbox,
|
|
20
|
+
uncheckRestoreNativeGesturesCheckbox
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
static message = "Restore native gestures";
|
|
25
|
+
|
|
26
|
+
static defaultProperties = {
|
|
27
|
+
className: "restore-native-gestures"
|
|
28
|
+
};
|
|
29
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import withStyle from "easy-with-style"; ///
|
|
4
|
+
|
|
5
|
+
import Element from "../element";
|
|
6
|
+
|
|
7
|
+
import Span from "../span";
|
|
8
|
+
import Checkbox from "../checkbox";
|
|
9
|
+
|
|
10
|
+
import { checkboxDivGap } from "../../styles";
|
|
11
|
+
|
|
12
|
+
class CheckboxDiv extends Element {
|
|
13
|
+
childElements() {
|
|
14
|
+
const { message } = this.constructor;
|
|
15
|
+
|
|
16
|
+
return ([
|
|
17
|
+
|
|
18
|
+
<Checkbox onChange={this.changeHandler} />,
|
|
19
|
+
<Span>
|
|
20
|
+
{message}
|
|
21
|
+
</Span>
|
|
22
|
+
|
|
23
|
+
]);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
initialise() {
|
|
27
|
+
this.assignContext();
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
static tagName = "div";
|
|
31
|
+
|
|
32
|
+
static defaultProperties = {
|
|
33
|
+
className: "checkbox"
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export default withStyle(CheckboxDiv)`
|
|
38
|
+
|
|
39
|
+
gap: ${checkboxDivGap};
|
|
40
|
+
display: flex;
|
|
41
|
+
align-items: flex-start;
|
|
42
|
+
flex-direction: row;
|
|
43
|
+
justify-content: flex-start;
|
|
44
|
+
|
|
45
|
+
`;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import withStyle from "easy-with-style"; ///
|
|
4
|
+
|
|
5
|
+
import Element from "../element";
|
|
6
|
+
import InvertColoursCheckboxDiv from "./checkbox/invertColours";
|
|
7
|
+
import RestoreNativeGesturesCheckboxDiv from "./checkbox/restoreNativeGestures";
|
|
8
|
+
|
|
9
|
+
import { checkboxesDivGap } from "../../styles";
|
|
10
|
+
|
|
11
|
+
class CheckboxesDiv extends Element {
|
|
12
|
+
childElements() {
|
|
13
|
+
return ([
|
|
14
|
+
|
|
15
|
+
<InvertColoursCheckboxDiv/>,
|
|
16
|
+
<RestoreNativeGesturesCheckboxDiv/>
|
|
17
|
+
|
|
18
|
+
]);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
static tagName = "div";
|
|
22
|
+
|
|
23
|
+
static defaultProperties = {
|
|
24
|
+
className: "checkboxes"
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default withStyle(CheckboxesDiv)`
|
|
29
|
+
|
|
30
|
+
gap: ${checkboxesDivGap};
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-wrap: wrap;
|
|
33
|
+
flex-direction: row;
|
|
34
|
+
justify-content: flex-start;
|
|
35
|
+
|
|
36
|
+
`;
|
package/src/view/div/leaf.js
CHANGED
|
@@ -1,24 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { Element } from "easy";
|
|
4
|
-
|
|
5
3
|
import withStyle from "easy-with-style"; ///
|
|
6
4
|
|
|
7
|
-
import
|
|
8
|
-
|
|
5
|
+
import { Element } from "easy";
|
|
6
|
+
|
|
7
|
+
import { BACKGROUND_COLOUR } from "../../constants";
|
|
9
8
|
|
|
10
9
|
class LeafDiv extends Element {
|
|
11
|
-
|
|
12
|
-
this.
|
|
13
|
-
this.addClass("wiggle");
|
|
14
|
-
}
|
|
10
|
+
getBackgroundColour() {
|
|
11
|
+
const backgroundColour = this.css(BACKGROUND_COLOUR) || null;
|
|
15
12
|
|
|
16
|
-
|
|
17
|
-
this.enableTouch();
|
|
13
|
+
return backgroundColour;
|
|
18
14
|
}
|
|
19
15
|
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
zoom(zoom) {
|
|
17
|
+
const width = `${100/zoom}%`,
|
|
18
|
+
transform = `scale(${zoom})`;
|
|
19
|
+
|
|
20
|
+
const css = {
|
|
21
|
+
width,
|
|
22
|
+
transform
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
this.css(css);
|
|
22
26
|
}
|
|
23
27
|
|
|
24
28
|
static tagName = "div";
|
|
@@ -28,23 +32,11 @@ class LeafDiv extends Element {
|
|
|
28
32
|
};
|
|
29
33
|
}
|
|
30
34
|
|
|
31
|
-
Object.assign(LeafDiv.prototype, eventMixins);
|
|
32
|
-
Object.assign(LeafDiv.prototype, touchMixins);
|
|
33
|
-
|
|
34
35
|
export default withStyle(LeafDiv)`
|
|
35
36
|
|
|
36
|
-
width:
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
@keyframes wiggle {
|
|
41
|
-
0% { transform: translateX(-5px); }
|
|
42
|
-
50% { transform: translateX(5px); }
|
|
43
|
-
100% { transform: translateX(-5px); }
|
|
44
|
-
}
|
|
37
|
+
width: 100%;
|
|
38
|
+
min-height: 100%;
|
|
39
|
+
pointer-events: none;
|
|
40
|
+
transform-origin: top left;
|
|
45
41
|
|
|
46
|
-
.wiggle {
|
|
47
|
-
animation: wiggle 0.5s ease-in-out 1;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
42
|
`;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import withStyle from "easy-with-style"; ///
|
|
4
|
+
|
|
5
|
+
import Element from "../element";
|
|
6
|
+
import ButtonsDiv from "../div/buttons";
|
|
7
|
+
import CheckboxesDiv from "../div/checkboxes";
|
|
8
|
+
|
|
9
|
+
import { GRID, ZOOM_RATIO } from "../../constants";
|
|
10
|
+
import { borderColour, menuDivPadding, backgroundColour } from "../../styles";
|
|
11
|
+
import { getMenuDivZoom as getZoom, setMenuDivZoom as setZoom } from "../../state";
|
|
12
|
+
|
|
13
|
+
class MenuDiv extends Element {
|
|
14
|
+
zoomMenuOut() {
|
|
15
|
+
let zoom = getZoom();
|
|
16
|
+
|
|
17
|
+
zoom /= ZOOM_RATIO;
|
|
18
|
+
|
|
19
|
+
setZoom(zoom);
|
|
20
|
+
|
|
21
|
+
this.updateZoom();
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
zoomMenuIn() {
|
|
25
|
+
let zoom = getZoom();
|
|
26
|
+
|
|
27
|
+
zoom *= ZOOM_RATIO;
|
|
28
|
+
|
|
29
|
+
setZoom(zoom);
|
|
30
|
+
|
|
31
|
+
this.updateZoom();
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
updateZoom() {
|
|
35
|
+
const zoom = getZoom(),
|
|
36
|
+
width = `${100/zoom}%`,
|
|
37
|
+
transform = `scale(${zoom})`,
|
|
38
|
+
css = {
|
|
39
|
+
width,
|
|
40
|
+
transform
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
this.css(css);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
show() {
|
|
47
|
+
const display = GRID;
|
|
48
|
+
|
|
49
|
+
this.display(display);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
openMenu() {
|
|
53
|
+
this.show();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
closeMenu() {
|
|
57
|
+
this.hide();
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
didMount() {
|
|
61
|
+
this.updateZoom();
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
willUnmount() {
|
|
65
|
+
///
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
childElements() {
|
|
69
|
+
return ([
|
|
70
|
+
|
|
71
|
+
<CheckboxesDiv/>,
|
|
72
|
+
<ButtonsDiv/>
|
|
73
|
+
|
|
74
|
+
]);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
parentContext() {
|
|
78
|
+
const context = this.getContext(),
|
|
79
|
+
openMenu = this.openMenu.bind(this),
|
|
80
|
+
closeMenu = this.closeMenu.bind(this),
|
|
81
|
+
zoomMenuIn = this.zoomMenuIn.bind(this),
|
|
82
|
+
zoomMenuOut = this.zoomMenuOut.bind(this),
|
|
83
|
+
updateMenuDivZoom = this.updateZoom.bind(this); ///
|
|
84
|
+
|
|
85
|
+
return ({
|
|
86
|
+
...context,
|
|
87
|
+
openMenu,
|
|
88
|
+
closeMenu,
|
|
89
|
+
zoomMenuIn,
|
|
90
|
+
zoomMenuOut,
|
|
91
|
+
updateMenuDivZoom
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
initialise() {
|
|
96
|
+
this.hide();
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
static tagName = "div";
|
|
100
|
+
|
|
101
|
+
static defaultProperties = {
|
|
102
|
+
className: "menu"
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export default withStyle(MenuDiv)`
|
|
107
|
+
|
|
108
|
+
left: 0;
|
|
109
|
+
bottom: 0;
|
|
110
|
+
display: grid;
|
|
111
|
+
padding: ${menuDivPadding};
|
|
112
|
+
position: fixed;
|
|
113
|
+
border-top: 1px solid ${borderColour};
|
|
114
|
+
background-color: ${backgroundColour};
|
|
115
|
+
transform-origin: bottom left;
|
|
116
|
+
grid-template-rows: auto;
|
|
117
|
+
grid-template-columns: auto min-content;
|
|
118
|
+
|
|
119
|
+
`;
|