highmark-cli 0.0.174 → 0.0.175
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/README.md +20 -2
- package/bin/abbreviations.js +6 -9
- package/bin/action/help.js +3 -3
- package/bin/action/publish.js +3 -4
- package/bin/action/server.js +2 -2
- package/bin/constants.js +2 -6
- package/bin/defaults.js +4 -6
- package/bin/main.js +7 -9
- package/bin/operation/copyFonts.js +5 -23
- package/bin/operation/html.js +5 -71
- package/bin/options.js +4 -6
- package/package.json +2 -26
- package/.swcrc +0 -11
- package/bin/utilities/client.js +0 -38
- package/checkmark.svg +0 -12
- package/client.js +0 -39623
- package/css/loading.css +0 -59
- package/lib/client.js +0 -74
- package/lib/constants.js +0 -70
- package/lib/createMethods.js +0 -84
- package/lib/customEventTypes.js +0 -74
- package/lib/localStorage.js +0 -41
- package/lib/migrate.js +0 -34
- package/lib/selectors.js +0 -26
- package/lib/state/version_1.js +0 -39
- package/lib/state.js +0 -153
- package/lib/styles.js +0 -82
- package/lib/utilities/element.js +0 -62
- package/lib/utilities/orientation.js +0 -39
- package/lib/versions.js +0 -13
- package/lib/view/button/closeMenu.js +0 -121
- package/lib/view/button/zoomMenuIn.js +0 -121
- package/lib/view/button/zoomMenuOut.js +0 -121
- package/lib/view/button.js +0 -160
- package/lib/view/checkbox.js +0 -193
- package/lib/view/div/buttons.js +0 -213
- package/lib/view/div/checkbox/fullScreen.js +0 -155
- package/lib/view/div/checkbox/invertColours.js +0 -154
- package/lib/view/div/checkbox/nativeGestures.js +0 -154
- package/lib/view/div/checkbox.js +0 -220
- package/lib/view/div/checkboxes.js +0 -213
- package/lib/view/div/menu.js +0 -301
- package/lib/view/div/overlay.js +0 -685
- package/lib/view/div/preloader.js +0 -204
- package/lib/view/div.js +0 -227
- package/lib/view/element.js +0 -164
- package/lib/view/span.js +0 -182
- package/lib/view/svg/closeMenu.js +0 -138
- package/lib/view/svg/zoomMenuIn.js +0 -146
- package/lib/view/svg/zoomMenuOut.js +0 -141
- package/lib/view/svg.js +0 -184
- package/lib/view.js +0 -247
- package/src/client.js +0 -70
- package/src/constants.js +0 -16
- package/src/createMethods.js +0 -105
- package/src/customEventTypes.js +0 -17
- package/src/localStorage.js +0 -40
- package/src/migrate.js +0 -19
- package/src/selectors.js +0 -5
- package/src/state/version_1.js +0 -32
- package/src/state.js +0 -152
- package/src/styles.js +0 -19
- package/src/utilities/element.js +0 -66
- package/src/utilities/orientation.js +0 -34
- package/src/versions.js +0 -3
- package/src/view/button/closeMenu.js +0 -16
- package/src/view/button/zoomMenuIn.js +0 -16
- package/src/view/button/zoomMenuOut.js +0 -16
- package/src/view/button.js +0 -38
- package/src/view/checkbox.js +0 -68
- package/src/view/div/buttons.js +0 -37
- package/src/view/div/checkbox/fullScreen.js +0 -40
- package/src/view/div/checkbox/invertColours.js +0 -37
- package/src/view/div/checkbox/nativeGestures.js +0 -38
- package/src/view/div/checkbox.js +0 -45
- package/src/view/div/checkboxes.js +0 -38
- package/src/view/div/menu.js +0 -88
- package/src/view/div/overlay.js +0 -602
- package/src/view/div/preloader.js +0 -25
- package/src/view/div.js +0 -47
- package/src/view/element.js +0 -16
- package/src/view/span.js +0 -20
- package/src/view/svg/closeMenu.js +0 -19
- package/src/view/svg/zoomMenuIn.js +0 -20
- package/src/view/svg/zoomMenuOut.js +0 -19
- package/src/view/svg.js +0 -24
- package/src/view.js +0 -64
- package/template/client.html +0 -4
- package/template/default.html +0 -71
- package/template/loading.html +0 -17
package/src/migrate.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { versionUtilities } from "necessary";
|
|
4
|
-
|
|
5
|
-
import { VERSION_1 } from "./versions";
|
|
6
|
-
import { migrateStateToVersion_1 } from "./state/version_1";
|
|
7
|
-
|
|
8
|
-
const { migrate } = versionUtilities;
|
|
9
|
-
|
|
10
|
-
export function migrateState(state) {
|
|
11
|
-
const migrationMap = {
|
|
12
|
-
[VERSION_1]: migrateStateToVersion_1
|
|
13
|
-
},
|
|
14
|
-
latestVersion = VERSION_1;
|
|
15
|
-
|
|
16
|
-
state = migrate(state, migrationMap, latestVersion);
|
|
17
|
-
|
|
18
|
-
return state;
|
|
19
|
-
}
|
package/src/selectors.js
DELETED
package/src/state/version_1.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { VERSION_1 } from "../versions";
|
|
4
|
-
import { PORTRAIT_ORIENTATION, LANDSCAPE_ORIENTATION } from "../constants";
|
|
5
|
-
|
|
6
|
-
export function createState() {
|
|
7
|
-
const version = VERSION_1,
|
|
8
|
-
menuZoom = {
|
|
9
|
-
[PORTRAIT_ORIENTATION]: 1,
|
|
10
|
-
[LANDSCAPE_ORIENTATION]: 0.5
|
|
11
|
-
},
|
|
12
|
-
overlayZoom = {
|
|
13
|
-
[PORTRAIT_ORIENTATION]: 1,
|
|
14
|
-
[LANDSCAPE_ORIENTATION]: 1
|
|
15
|
-
},
|
|
16
|
-
fullScreenOverlayZoom = {
|
|
17
|
-
[PORTRAIT_ORIENTATION]: 1,
|
|
18
|
-
[LANDSCAPE_ORIENTATION]: 1
|
|
19
|
-
},
|
|
20
|
-
coloursInverted = false,
|
|
21
|
-
nativeGesturesRestored = false,
|
|
22
|
-
state = {
|
|
23
|
-
version,
|
|
24
|
-
menuZoom,
|
|
25
|
-
overlayZoom,
|
|
26
|
-
fullScreenOverlayZoom,
|
|
27
|
-
nativeGesturesRestored,
|
|
28
|
-
coloursInverted
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
return state;
|
|
32
|
-
}
|
package/src/state.js
DELETED
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { fullScreenUtilities } from "easy-mobile";
|
|
4
|
-
|
|
5
|
-
import { getPersistentState, setPersistentState } from "./localStorage";
|
|
6
|
-
|
|
7
|
-
const { isFullScreen } = fullScreenUtilities;
|
|
8
|
-
|
|
9
|
-
const orientation = null,
|
|
10
|
-
state = {
|
|
11
|
-
orientation
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export function getOrientation() {
|
|
15
|
-
const { orientation } = state;
|
|
16
|
-
|
|
17
|
-
return orientation;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export function setOrientation(orientation) {
|
|
21
|
-
Object.assign(state, {
|
|
22
|
-
orientation
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export function getMenuZoom() {
|
|
27
|
-
stateFromPersistentState();
|
|
28
|
-
|
|
29
|
-
let menuZoom;
|
|
30
|
-
|
|
31
|
-
({ menuZoom } = state);
|
|
32
|
-
|
|
33
|
-
const { orientation } = state,
|
|
34
|
-
orientedMenuZoom = menuZoom[orientation]; ///
|
|
35
|
-
|
|
36
|
-
menuZoom = orientedMenuZoom; ///
|
|
37
|
-
|
|
38
|
-
return menuZoom;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export function setMenuZoom(menuZoom) {
|
|
42
|
-
stateFromPersistentState();
|
|
43
|
-
|
|
44
|
-
const { orientation } = state,
|
|
45
|
-
orientedMenuZoom = menuZoom; ///
|
|
46
|
-
|
|
47
|
-
({ menuZoom } = state);
|
|
48
|
-
|
|
49
|
-
Object.assign(menuZoom, {
|
|
50
|
-
[orientation]: orientedMenuZoom
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
stateToPersistentState();
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export function getOverlayZoom() {
|
|
57
|
-
stateFromPersistentState();
|
|
58
|
-
|
|
59
|
-
const fullScreen = isFullScreen(),
|
|
60
|
-
orientation = getOrientation();
|
|
61
|
-
|
|
62
|
-
let overlayZoom;
|
|
63
|
-
|
|
64
|
-
if (fullScreen) {
|
|
65
|
-
({ fullScreenOverlayZoom: overlayZoom } = state);
|
|
66
|
-
} else {
|
|
67
|
-
({ overlayZoom } = state);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
const orientedOverlayZoom = overlayZoom[orientation]; ///
|
|
71
|
-
|
|
72
|
-
overlayZoom = orientedOverlayZoom; ///
|
|
73
|
-
|
|
74
|
-
return overlayZoom;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export function setOverlayZoom(overlayZoom) {
|
|
78
|
-
stateFromPersistentState();
|
|
79
|
-
|
|
80
|
-
const fullScreen = isFullScreen(),
|
|
81
|
-
orientation = getOrientation();
|
|
82
|
-
|
|
83
|
-
const orientedOverlayZoom = overlayZoom; ///
|
|
84
|
-
|
|
85
|
-
if (fullScreen) {
|
|
86
|
-
({ fullScreenOverlayZoom: overlayZoom } = state);
|
|
87
|
-
} else {
|
|
88
|
-
({ overlayZoom } = state);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
Object.assign(overlayZoom, {
|
|
92
|
-
[orientation]: orientedOverlayZoom
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
stateToPersistentState();
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
export function areNativeGesturesRestored() {
|
|
99
|
-
stateFromPersistentState();
|
|
100
|
-
|
|
101
|
-
const { nativeGesturesRestored } = state;
|
|
102
|
-
|
|
103
|
-
return nativeGesturesRestored;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
export function setNativeGesturesRestored(nativeGesturesRestored) {
|
|
107
|
-
stateFromPersistentState();
|
|
108
|
-
|
|
109
|
-
Object.assign(state, {
|
|
110
|
-
nativeGesturesRestored
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
stateToPersistentState();
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
export function areColoursInverted() {
|
|
117
|
-
stateFromPersistentState();
|
|
118
|
-
|
|
119
|
-
const { coloursInverted } = state;
|
|
120
|
-
|
|
121
|
-
return coloursInverted;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
export function setColoursInverted(coloursInverted) {
|
|
125
|
-
stateFromPersistentState();
|
|
126
|
-
|
|
127
|
-
Object.assign(state, {
|
|
128
|
-
coloursInverted
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
stateToPersistentState();
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
function stateToPersistentState() {
|
|
135
|
-
const { version, menuZoom, overlayZoom, fullScreenOverlayZoom, nativeGesturesRestored, coloursInverted } = state,
|
|
136
|
-
persistentState = {
|
|
137
|
-
version,
|
|
138
|
-
menuZoom,
|
|
139
|
-
overlayZoom,
|
|
140
|
-
fullScreenOverlayZoom,
|
|
141
|
-
nativeGesturesRestored,
|
|
142
|
-
coloursInverted
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
setPersistentState(persistentState);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
function stateFromPersistentState() {
|
|
149
|
-
const persistentState = getPersistentState();
|
|
150
|
-
|
|
151
|
-
Object.assign(state, persistentState);
|
|
152
|
-
}
|
package/src/styles.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
export const svgFill = "#fff";
|
|
4
|
-
export const buttonSize = "64px";
|
|
5
|
-
export const spanColour = "#fff";
|
|
6
|
-
export const menuDivGap = "32px";
|
|
7
|
-
export const borderWidth = "4px";
|
|
8
|
-
export const borderRadius = "8px"
|
|
9
|
-
export const borderColour = "#fff";
|
|
10
|
-
export const checkboxSize = "48px";
|
|
11
|
-
export const spanFontSize = checkboxSize; ///
|
|
12
|
-
export const buttonPadding = "8px";
|
|
13
|
-
export const buttonsDivGap = "32px";
|
|
14
|
-
export const menuDivPadding = "64px";
|
|
15
|
-
export const checkboxDivGap = "32px";
|
|
16
|
-
export const checkboxesDivGap = "48px";
|
|
17
|
-
export const backgroundColour = "#222";
|
|
18
|
-
export const checkboxBackgroundColour = "#000";
|
|
19
|
-
export const fontSizeButtonBorderColour = "#fff";
|
package/src/utilities/element.js
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { DIV_SELECTOR } from "../selectors";
|
|
4
|
-
|
|
5
|
-
export function elementsFromDOMElements(domElements, Element) {
|
|
6
|
-
const elements = domElements.map((domElement) => {
|
|
7
|
-
const element = elementFromDOMElement(domElement, Element);
|
|
8
|
-
|
|
9
|
-
return element;
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
return elements;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export function elementFromDOMElement(domElement, Element) {
|
|
16
|
-
const element =
|
|
17
|
-
|
|
18
|
-
<Element/>
|
|
19
|
-
|
|
20
|
-
,
|
|
21
|
-
className = classNameFromElement(element);
|
|
22
|
-
|
|
23
|
-
addClassNameToDOMElement(domElement, className)
|
|
24
|
-
|
|
25
|
-
element.domElement = domElement; ///
|
|
26
|
-
|
|
27
|
-
domElement.__element__ = element; ///
|
|
28
|
-
|
|
29
|
-
return element;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export function findDivByAnchorId(anchorId) {
|
|
33
|
-
const selector = DIV_SELECTOR,
|
|
34
|
-
anchorDOMElement = findAnchorDOMElement(anchorId),
|
|
35
|
-
divDOMElement = anchorDOMElement.closest(selector);
|
|
36
|
-
|
|
37
|
-
const { __element__: div } = divDOMElement;
|
|
38
|
-
|
|
39
|
-
return div;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export function scrollToAnchor(anchorId) {
|
|
43
|
-
const anchorDOMElement = findAnchorDOMElement(anchorId);
|
|
44
|
-
|
|
45
|
-
anchorDOMElement.scrollIntoView();
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function findAnchorDOMElement(anchorId) {
|
|
49
|
-
const selector = `a#${anchorId}`,
|
|
50
|
-
anchorDOMElement = document.querySelector(selector);
|
|
51
|
-
|
|
52
|
-
return anchorDOMElement;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function classNameFromElement(element) {
|
|
56
|
-
const domElement = element.getDOMElement(),
|
|
57
|
-
{ className } = domElement;
|
|
58
|
-
|
|
59
|
-
return className;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function addClassNameToDOMElement(domElement, className) {
|
|
63
|
-
const { classList } = domElement;
|
|
64
|
-
|
|
65
|
-
classList.add(className);
|
|
66
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { eventTypes } from "easy";
|
|
4
|
-
|
|
5
|
-
import { PORTRAIT_ORIENTATION, LANDSCAPE_ORIENTATION, ORIENTATION_PORTRAIT_QUERY } from "../constants";
|
|
6
|
-
|
|
7
|
-
const { CHANGE_EVENT_TYPE } = eventTypes;
|
|
8
|
-
|
|
9
|
-
var mediaQueryList = matchMedia(ORIENTATION_PORTRAIT_QUERY);
|
|
10
|
-
|
|
11
|
-
export function getOrientation(callback) {
|
|
12
|
-
const orientation = orientationFromMediaQueryList(mediaQueryList);
|
|
13
|
-
|
|
14
|
-
callback(orientation);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export function onOrientationChange(handler) {
|
|
18
|
-
const eventType = CHANGE_EVENT_TYPE;
|
|
19
|
-
|
|
20
|
-
mediaQueryList.addEventListener(eventType, (mediaQueryList) => {
|
|
21
|
-
const orientation = orientationFromMediaQueryList(mediaQueryList);
|
|
22
|
-
|
|
23
|
-
handler(orientation);
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function orientationFromMediaQueryList(mediaQueryList) {
|
|
28
|
-
const { matches = false } = mediaQueryList,
|
|
29
|
-
orientation = matches ?
|
|
30
|
-
PORTRAIT_ORIENTATION :
|
|
31
|
-
LANDSCAPE_ORIENTATION;
|
|
32
|
-
|
|
33
|
-
return orientation;
|
|
34
|
-
}
|
package/src/versions.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import Button from "../button";
|
|
4
|
-
import CloseMenuSVG from "../svg/closeMenu";
|
|
5
|
-
|
|
6
|
-
export default class CloseMenuButton extends Button {
|
|
7
|
-
clickHandler = (event, element) => {
|
|
8
|
-
controller.closeMenu();
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
static SVG = CloseMenuSVG;
|
|
12
|
-
|
|
13
|
-
static defaultProperties = {
|
|
14
|
-
className: "close-menu"
|
|
15
|
-
};
|
|
16
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import Button from "../button";
|
|
4
|
-
import ZoomMenuInSVG from "../svg/zoomMenuIn";
|
|
5
|
-
|
|
6
|
-
export default class ZoomMenuInButton extends Button {
|
|
7
|
-
clickHandler = (event, element) => {
|
|
8
|
-
controller.zoomMenuIn();
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
static SVG = ZoomMenuInSVG;
|
|
12
|
-
|
|
13
|
-
static defaultProperties = {
|
|
14
|
-
className: "zoom-menu-in"
|
|
15
|
-
};
|
|
16
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import Button from "../button";
|
|
4
|
-
import ZoomMenuOutSVG from "../svg/zoomMenuOut";
|
|
5
|
-
|
|
6
|
-
export default class ZoomMenuOutButton extends Button {
|
|
7
|
-
clickHandler = (event, element) => {
|
|
8
|
-
controller.zoomMenuOut();
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
static SVG = ZoomMenuOutSVG;
|
|
12
|
-
|
|
13
|
-
static defaultProperties = {
|
|
14
|
-
className: "zoom-menu-out"
|
|
15
|
-
};
|
|
16
|
-
}
|
package/src/view/button.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import withStyle from "easy-with-style"; ///
|
|
4
|
-
|
|
5
|
-
import { Button } from "easy";
|
|
6
|
-
|
|
7
|
-
import { buttonSize, borderWidth, borderRadius, borderColour, buttonPadding } from "../styles";
|
|
8
|
-
|
|
9
|
-
export default withStyle(class extends Button {
|
|
10
|
-
didMount() {
|
|
11
|
-
this.onClick(this.clickHandler);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
willUnmount() {
|
|
15
|
-
this.offClick(this.clickHandler);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
childElements() {
|
|
19
|
-
const { SVG } = this.constructor;
|
|
20
|
-
|
|
21
|
-
return (
|
|
22
|
-
|
|
23
|
-
<SVG/>
|
|
24
|
-
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
|
-
})`
|
|
28
|
-
|
|
29
|
-
width: ${buttonSize};
|
|
30
|
-
height: ${buttonSize};
|
|
31
|
-
cursor: pointer;
|
|
32
|
-
border: ${borderWidth} solid ${borderColour};
|
|
33
|
-
margin: 0;
|
|
34
|
-
padding: ${buttonPadding};
|
|
35
|
-
background: transparent;
|
|
36
|
-
border-radius: ${borderRadius};
|
|
37
|
-
|
|
38
|
-
`;
|
package/src/view/checkbox.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import withStyle from "easy-with-style"; ///
|
|
4
|
-
|
|
5
|
-
import { Checkbox } from "easy";
|
|
6
|
-
|
|
7
|
-
import { borderWidth, borderRadius, borderColour, checkboxSize, checkboxBackgroundColour } from "../styles";
|
|
8
|
-
|
|
9
|
-
export default withStyle(class extends Checkbox {
|
|
10
|
-
check() {
|
|
11
|
-
const checked = true;
|
|
12
|
-
|
|
13
|
-
super.check(checked);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
uncheck() {
|
|
17
|
-
const checked = false;
|
|
18
|
-
|
|
19
|
-
super.check(checked);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
parentContext() {
|
|
23
|
-
const checkCheckbox = this.check.bind(this), ///
|
|
24
|
-
uncheckCheckbox = this.uncheck.bind(this), ///
|
|
25
|
-
isCheckboxChecked = this.isChecked.bind(this); ///
|
|
26
|
-
|
|
27
|
-
return ({
|
|
28
|
-
checkCheckbox,
|
|
29
|
-
uncheckCheckbox,
|
|
30
|
-
isCheckboxChecked
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
})`
|
|
34
|
-
|
|
35
|
-
width: ${checkboxSize};
|
|
36
|
-
height: ${checkboxSize};
|
|
37
|
-
cursor: pointer;
|
|
38
|
-
display: block;
|
|
39
|
-
outline: none;
|
|
40
|
-
position: relative;
|
|
41
|
-
appearance: none;
|
|
42
|
-
|
|
43
|
-
::before {
|
|
44
|
-
width: ${checkboxSize};
|
|
45
|
-
height: ${checkboxSize};
|
|
46
|
-
border: ${borderWidth} solid ${borderColour};
|
|
47
|
-
content: " ";
|
|
48
|
-
position: absolute;
|
|
49
|
-
border-radius: ${borderRadius};
|
|
50
|
-
background-color: ${checkboxBackgroundColour};
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
::after {
|
|
54
|
-
top: 0;
|
|
55
|
-
left: 0;
|
|
56
|
-
width: ${checkboxSize};
|
|
57
|
-
height: ${checkboxSize};
|
|
58
|
-
content: " ";
|
|
59
|
-
position: absolute;
|
|
60
|
-
background-size: 0;
|
|
61
|
-
background-image: url("checkmark.svg");
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
:checked::after {
|
|
65
|
-
background-size: 100%;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
`;
|
package/src/view/div/buttons.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
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 ZoomMenuInButton from "../button/zoomMenuIn";
|
|
8
|
-
import ZoomMenuOutButton from "../button/zoomMenuOut";
|
|
9
|
-
|
|
10
|
-
import { buttonsDivGap } from "../../styles";
|
|
11
|
-
|
|
12
|
-
class ButtonsDiv extends Element {
|
|
13
|
-
childElements() {
|
|
14
|
-
return ([
|
|
15
|
-
|
|
16
|
-
<ZoomMenuOutButton/>,
|
|
17
|
-
<ZoomMenuInButton/>,
|
|
18
|
-
<CloseMenuButton/>
|
|
19
|
-
|
|
20
|
-
]);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
static tagName = "div";
|
|
24
|
-
|
|
25
|
-
static defaultProperties = {
|
|
26
|
-
className: "buttons"
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export default withStyle(ButtonsDiv)`
|
|
31
|
-
|
|
32
|
-
gap: ${buttonsDivGap};
|
|
33
|
-
display: grid;
|
|
34
|
-
grid-template-rows: min-content;
|
|
35
|
-
grid-template-columns: min-content min-content min-content;
|
|
36
|
-
|
|
37
|
-
`;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { fullScreenUtilities } from "easy-mobile";
|
|
4
|
-
|
|
5
|
-
import CheckboxDiv from "../../div/checkbox";
|
|
6
|
-
|
|
7
|
-
const { isFullScreen } = fullScreenUtilities;
|
|
8
|
-
|
|
9
|
-
export default class FullScreenCheckboxDiv extends CheckboxDiv {
|
|
10
|
-
changeHandler = (event, element) => {
|
|
11
|
-
const checkboxChecked = this.isCheckboxChecked();
|
|
12
|
-
|
|
13
|
-
checkboxChecked ?
|
|
14
|
-
controller.enterFullScreen() :
|
|
15
|
-
controller.exitFullScreen();
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
update() {
|
|
19
|
-
const fullScreen = isFullScreen();
|
|
20
|
-
|
|
21
|
-
fullScreen ?
|
|
22
|
-
this.checkCheckbox() :
|
|
23
|
-
this.uncheckCheckbox();
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
parentContext() {
|
|
27
|
-
const updateFullScreenCheckboxDiv = this.update.bind(this); ///
|
|
28
|
-
|
|
29
|
-
return ({
|
|
30
|
-
updateFullScreenCheckboxDiv
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
static message = `Full screen
|
|
35
|
-
(double tap to exit)`;
|
|
36
|
-
|
|
37
|
-
static defaultProperties = {
|
|
38
|
-
className: "full-screen"
|
|
39
|
-
};
|
|
40
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
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
|
-
update() {
|
|
17
|
-
const coloursInverted = areColoursInverted();
|
|
18
|
-
|
|
19
|
-
coloursInverted ?
|
|
20
|
-
this.checkCheckbox() :
|
|
21
|
-
this.uncheckCheckbox();
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
parentContext() {
|
|
25
|
-
const updateInvertColoursCheckboxDiv = this.update.bind(this);
|
|
26
|
-
|
|
27
|
-
return ({
|
|
28
|
-
updateInvertColoursCheckboxDiv
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
static message = "Invert colours";
|
|
33
|
-
|
|
34
|
-
static defaultProperties = {
|
|
35
|
-
className: "invert-colours"
|
|
36
|
-
};
|
|
37
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
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
|
-
(double tap to toggle)`;
|
|
34
|
-
|
|
35
|
-
static defaultProperties = {
|
|
36
|
-
className: "native-gestures"
|
|
37
|
-
};
|
|
38
|
-
}
|
package/src/view/div/checkbox.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
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
|
-
`;
|