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.
Files changed (47) hide show
  1. package/bin/constants.js +4 -2
  2. package/bin/importer.js +7 -4
  3. package/bin/operation/markdownHTML.js +31 -9
  4. package/bin/operation/markdownStylesCSS.js +17 -10
  5. package/client.js +549 -710
  6. package/lib/client.js +32 -5
  7. package/lib/constants.js +5 -9
  8. package/lib/createMethods.js +35 -17
  9. package/lib/localStorage.js +6 -5
  10. package/lib/mixins/fullsrean.js +3 -5
  11. package/lib/selectors.js +2 -6
  12. package/lib/state.js +62 -44
  13. package/lib/utilities/element.js +11 -11
  14. package/lib/view/div/buttons.js +4 -6
  15. package/lib/view/div/checkbox/{restoreNativeGestures.js → fullScreen.js} +23 -16
  16. package/lib/view/div/checkbox/invertColours.js +9 -6
  17. package/lib/view/div/checkbox/nativeGestures.js +154 -0
  18. package/lib/view/div/checkboxes.js +5 -3
  19. package/lib/view/div/menu.js +11 -43
  20. package/lib/view/div/overlay.js +115 -157
  21. package/lib/view/{div/leaf.js → div.js} +21 -16
  22. package/lib/view.js +24 -6
  23. package/package.json +3 -2
  24. package/src/client.js +10 -5
  25. package/src/constants.js +1 -2
  26. package/src/createMethods.js +52 -16
  27. package/src/localStorage.js +9 -6
  28. package/src/mixins/fullsrean.js +3 -4
  29. package/src/selectors.js +1 -2
  30. package/src/state.js +66 -48
  31. package/src/utilities/element.js +18 -15
  32. package/src/view/div/buttons.js +4 -6
  33. package/src/view/div/checkbox/fullScreen.js +38 -0
  34. package/src/view/div/checkbox/invertColours.js +7 -3
  35. package/src/view/div/checkbox/nativeGestures.js +38 -0
  36. package/src/view/div/checkboxes.js +4 -2
  37. package/src/view/div/menu.js +13 -45
  38. package/src/view/div/overlay.js +132 -186
  39. package/src/view/{div/leaf.js → div.js} +15 -10
  40. package/src/view.js +19 -5
  41. package/lib/utilities/tree.js +0 -55
  42. package/lib/view/button/fullScreen.js +0 -121
  43. package/lib/view/svg/fullScreen.js +0 -138
  44. package/src/utilities/tree.js +0 -29
  45. package/src/view/button/fullScreen.js +0 -16
  46. package/src/view/div/checkbox/restoreNativeGestures.js +0 -29
  47. 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
- didMount() {
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
- willUnmount() {
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 RestoreNativeGesturesCheckboxDiv from "./checkbox/restoreNativeGestures";
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
- <RestoreNativeGesturesCheckboxDiv/>
17
+ <NativeGesturesCheckboxDiv/>,
18
+ <FullScreenCheckboxDiv/>
17
19
 
18
20
  ]);
19
21
  }
@@ -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, ZOOM_RATIO } from "../../constants";
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
- didMount() {
61
- this.updateZoom();
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
- willUnmount() {
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
- zoomMenuIn = this.zoomMenuIn.bind(this),
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
- zoomMenuIn,
90
- zoomMenuOut,
91
- updateMenuDivZoom
59
+ updateMenuZoom
92
60
  });
93
61
  }
94
62