highmark-cli 0.0.139 → 0.0.141
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/constants.js +4 -2
- package/bin/importer.js +7 -4
- package/bin/operation/markdownHTML.js +31 -9
- package/bin/operation/markdownStylesCSS.js +17 -10
- package/client.js +549 -710
- package/lib/client.js +32 -5
- package/lib/constants.js +5 -9
- package/lib/createMethods.js +35 -17
- package/lib/localStorage.js +6 -5
- package/lib/mixins/fullsrean.js +3 -5
- package/lib/selectors.js +2 -6
- package/lib/state.js +62 -44
- package/lib/utilities/element.js +11 -11
- package/lib/view/div/buttons.js +4 -6
- package/lib/view/div/checkbox/{restoreNativeGestures.js → fullScreen.js} +23 -16
- package/lib/view/div/checkbox/invertColours.js +9 -6
- package/lib/view/div/checkbox/nativeGestures.js +154 -0
- package/lib/view/div/checkboxes.js +5 -3
- package/lib/view/div/menu.js +11 -43
- package/lib/view/div/overlay.js +115 -157
- package/lib/view/{div/leaf.js → div.js} +21 -16
- package/lib/view.js +24 -6
- package/package.json +3 -2
- package/src/client.js +10 -5
- package/src/constants.js +1 -2
- package/src/createMethods.js +52 -16
- package/src/localStorage.js +9 -6
- package/src/mixins/fullsrean.js +3 -4
- package/src/selectors.js +1 -2
- package/src/state.js +66 -48
- package/src/utilities/element.js +18 -15
- package/src/view/div/buttons.js +4 -6
- package/src/view/div/checkbox/fullScreen.js +38 -0
- package/src/view/div/checkbox/invertColours.js +7 -3
- package/src/view/div/checkbox/nativeGestures.js +38 -0
- package/src/view/div/checkboxes.js +4 -2
- package/src/view/div/menu.js +13 -45
- package/src/view/div/overlay.js +132 -186
- package/src/view/{div/leaf.js → div.js} +15 -10
- package/src/view.js +19 -5
- package/lib/utilities/tree.js +0 -55
- package/lib/view/button/fullScreen.js +0 -121
- package/lib/view/svg/fullScreen.js +0 -138
- package/src/utilities/tree.js +0 -29
- package/src/view/button/fullScreen.js +0 -16
- package/src/view/div/checkbox/restoreNativeGestures.js +0 -29
- package/src/view/svg/fullScreen.js +0 -19
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import CheckboxDiv from "../../div/checkbox";
|
|
4
|
+
|
|
5
|
+
import { isFullScreen } from "../../../utilities/fullScreen";
|
|
6
|
+
|
|
7
|
+
export default class FullScreenCheckboxDiv extends CheckboxDiv {
|
|
8
|
+
changeHandler = (event, element) => {
|
|
9
|
+
const checkboxChecked = this.isCheckboxChecked();
|
|
10
|
+
|
|
11
|
+
checkboxChecked ?
|
|
12
|
+
controller.enterFullScreen() :
|
|
13
|
+
controller.exitFullScreen();
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
update() {
|
|
17
|
+
const fullScreen = isFullScreen();
|
|
18
|
+
|
|
19
|
+
fullScreen ?
|
|
20
|
+
this.checkCheckbox() :
|
|
21
|
+
this.uncheckCheckbox();
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
parentContext() {
|
|
25
|
+
const updateFullScreenCheckboxDiv = this.update.bind(this); ///
|
|
26
|
+
|
|
27
|
+
return ({
|
|
28
|
+
updateFullScreenCheckboxDiv
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
static message = `Full screen
|
|
33
|
+
(double tap to toggle)`;
|
|
34
|
+
|
|
35
|
+
static defaultProperties = {
|
|
36
|
+
className: "full-screen"
|
|
37
|
+
};
|
|
38
|
+
}
|
|
@@ -13,7 +13,7 @@ export default class InvertColoursCheckboxDiv extends CheckboxDiv {
|
|
|
13
13
|
controller.revertColours();
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
update() {
|
|
17
17
|
const coloursInverted = areColoursInverted();
|
|
18
18
|
|
|
19
19
|
coloursInverted ?
|
|
@@ -21,8 +21,12 @@ export default class InvertColoursCheckboxDiv extends CheckboxDiv {
|
|
|
21
21
|
this.uncheckCheckbox();
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
parentContext() {
|
|
25
|
+
const updateInvertColoursCheckboxDiv = this.update.bind(this);
|
|
26
|
+
|
|
27
|
+
return ({
|
|
28
|
+
updateInvertColoursCheckboxDiv
|
|
29
|
+
});
|
|
26
30
|
}
|
|
27
31
|
|
|
28
32
|
static message = "Invert colours";
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import CheckboxDiv from "../../div/checkbox";
|
|
4
|
+
|
|
5
|
+
import { areNativeGesturesRestored } from "../../../state";
|
|
6
|
+
|
|
7
|
+
export default class NativeGesturesCheckboxDiv extends CheckboxDiv {
|
|
8
|
+
changeHandler = (event, element) => {
|
|
9
|
+
const checkboxChecked = this.isCheckboxChecked();
|
|
10
|
+
|
|
11
|
+
checkboxChecked ?
|
|
12
|
+
controller.restoreNativeGestures() :
|
|
13
|
+
controller.suppressNativeGestures();
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
update() {
|
|
17
|
+
const nativeGesturesRestored = areNativeGesturesRestored();
|
|
18
|
+
|
|
19
|
+
nativeGesturesRestored ?
|
|
20
|
+
this.checkCheckbox() :
|
|
21
|
+
this.uncheckCheckbox();
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
parentContext() {
|
|
25
|
+
const updateNativeGesturesCheckboxDiv = this.update.bind(this); ///
|
|
26
|
+
|
|
27
|
+
return ({
|
|
28
|
+
updateNativeGesturesCheckboxDiv
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
static message = `Native gestures
|
|
33
|
+
(tap to toggle)`;
|
|
34
|
+
|
|
35
|
+
static defaultProperties = {
|
|
36
|
+
className: "native-gestures"
|
|
37
|
+
};
|
|
38
|
+
}
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
import withStyle from "easy-with-style"; ///
|
|
4
4
|
|
|
5
5
|
import Element from "../element";
|
|
6
|
+
import FullScreenCheckboxDiv from "./checkbox/fullScreen";
|
|
6
7
|
import InvertColoursCheckboxDiv from "./checkbox/invertColours";
|
|
7
|
-
import
|
|
8
|
+
import NativeGesturesCheckboxDiv from "./checkbox/nativeGestures";
|
|
8
9
|
|
|
9
10
|
import { checkboxesDivGap } from "../../styles";
|
|
10
11
|
|
|
@@ -13,7 +14,8 @@ class CheckboxesDiv extends Element {
|
|
|
13
14
|
return ([
|
|
14
15
|
|
|
15
16
|
<InvertColoursCheckboxDiv/>,
|
|
16
|
-
<
|
|
17
|
+
<NativeGesturesCheckboxDiv/>,
|
|
18
|
+
<FullScreenCheckboxDiv/>
|
|
17
19
|
|
|
18
20
|
]);
|
|
19
21
|
}
|
package/src/view/div/menu.js
CHANGED
|
@@ -6,43 +6,11 @@ import Element from "../element";
|
|
|
6
6
|
import ButtonsDiv from "../div/buttons";
|
|
7
7
|
import CheckboxesDiv from "../div/checkboxes";
|
|
8
8
|
|
|
9
|
-
import { GRID
|
|
9
|
+
import { GRID } from "../../constants";
|
|
10
|
+
import { getMenuZoom as getZoom } from "../../state";
|
|
10
11
|
import { borderColour, menuDivPadding, backgroundColour } from "../../styles";
|
|
11
|
-
import { getMenuDivZoom as getZoom, setMenuDivZoom as setZoom } from "../../state";
|
|
12
12
|
|
|
13
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
14
|
show() {
|
|
47
15
|
const display = GRID;
|
|
48
16
|
|
|
@@ -57,12 +25,16 @@ class MenuDiv extends Element {
|
|
|
57
25
|
this.hide();
|
|
58
26
|
}
|
|
59
27
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
28
|
+
updateMenuZoom() {
|
|
29
|
+
const zoom = getZoom(),
|
|
30
|
+
width = `${100/zoom}%`,
|
|
31
|
+
transform = `scale(${zoom})`,
|
|
32
|
+
css = {
|
|
33
|
+
width,
|
|
34
|
+
transform
|
|
35
|
+
};
|
|
63
36
|
|
|
64
|
-
|
|
65
|
-
///
|
|
37
|
+
this.css(css);
|
|
66
38
|
}
|
|
67
39
|
|
|
68
40
|
childElements() {
|
|
@@ -78,17 +50,13 @@ class MenuDiv extends Element {
|
|
|
78
50
|
const context = this.getContext(),
|
|
79
51
|
openMenu = this.openMenu.bind(this),
|
|
80
52
|
closeMenu = this.closeMenu.bind(this),
|
|
81
|
-
|
|
82
|
-
zoomMenuOut = this.zoomMenuOut.bind(this),
|
|
83
|
-
updateMenuDivZoom = this.updateZoom.bind(this); ///
|
|
53
|
+
updateMenuZoom = this.updateMenuZoom.bind(this);
|
|
84
54
|
|
|
85
55
|
return ({
|
|
86
56
|
...context,
|
|
87
57
|
openMenu,
|
|
88
58
|
closeMenu,
|
|
89
|
-
|
|
90
|
-
zoomMenuOut,
|
|
91
|
-
updateMenuDivZoom
|
|
59
|
+
updateMenuZoom
|
|
92
60
|
});
|
|
93
61
|
}
|
|
94
62
|
|