highmark-cli 0.0.138 → 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 +6216 -1574
- package/css/loading.css +32 -32
- package/lib/client.js +21 -6
- package/lib/constants.js +29 -9
- package/lib/createMethods.js +64 -0
- package/lib/customEventTypes.js +9 -1
- package/lib/eventTypes.js +5 -1
- package/lib/localStorage.js +56 -0
- package/lib/mixins/fullsrean.js +63 -0
- package/lib/mixins/touch.js +101 -32
- package/lib/selectors.js +9 -9
- package/lib/state.js +133 -0
- package/lib/styles.js +78 -0
- package/lib/utilities/fullScreen.js +16 -0
- package/lib/utilities/orientation.js +39 -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 +12 -20
- package/lib/view/div/menu.js +122 -28
- 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 +23 -396
- package/package.json +3 -2
- package/src/client.js +32 -8
- package/src/constants.js +7 -2
- package/src/createMethods.js +66 -0
- package/src/customEventTypes.js +2 -0
- package/src/eventTypes.js +1 -0
- package/src/localStorage.js +48 -0
- package/src/mixins/fullsrean.js +75 -0
- package/src/mixins/touch.js +98 -39
- package/src/selectors.js +2 -2
- package/src/state.js +130 -0
- package/src/styles.js +18 -0
- package/src/utilities/fullScreen.js +8 -0
- package/src/utilities/orientation.js +34 -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 +10 -15
- package/src/view/div/menu.js +83 -26
- 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 +20 -482
- package/lib/style.js +0 -13
- package/src/style.js +0 -3
package/bin/action/publish.js
CHANGED
|
@@ -5,6 +5,7 @@ const htmlOperation = require("../operation/html"),
|
|
|
5
5
|
copyFontsOperation = require("../operation/copyFonts"),
|
|
6
6
|
copyClientOperation = require("../operation/copyClient"),
|
|
7
7
|
markdownHTMLOperation = require("../operation/markdownHTML"),
|
|
8
|
+
copyCheckmarkOperation = require("../operation/copyCheckmark"),
|
|
8
9
|
markdownStylesCSSOperation = require("../operation/markdownStylesCSS");
|
|
9
10
|
|
|
10
11
|
const { executeOperations } = require("../utilities/operation"),
|
|
@@ -14,6 +15,7 @@ function publishAction(port, watch, server, quietly, copyFonts, copyClient, inpu
|
|
|
14
15
|
const operations = [
|
|
15
16
|
markdownStylesCSSOperation,
|
|
16
17
|
markdownHTMLOperation,
|
|
18
|
+
copyCheckmarkOperation,
|
|
17
19
|
copyClientOperation,
|
|
18
20
|
copyFontsOperation,
|
|
19
21
|
htmlOperation,
|
package/bin/constants.js
CHANGED
|
@@ -8,8 +8,9 @@ const FONT = "font",
|
|
|
8
8
|
HIGHMARK_CLI = "Highmark-CLI",
|
|
9
9
|
CLIENT_FILE_NAME = "client.js",
|
|
10
10
|
LIVE_RELOAD_PATH = "/live-reload",
|
|
11
|
+
CHECKMARK_FILE_NAME = "checkmark.svg",
|
|
11
12
|
LOADING_CSS_FILE_PATH = "css/loading.css",
|
|
12
|
-
DEFAULT_SELECTOR_STRING = "div",
|
|
13
|
+
DEFAULT_SELECTOR_STRING = "div.overlay div",
|
|
13
14
|
CLIENT_TEMPLATE_FILE_PATH = "template/client.html",
|
|
14
15
|
DEFAULT_TEMPLATE_FILE_PATH = "template/default.html",
|
|
15
16
|
LOADING_TEMPLATE_FILE_PATH = "template/loading.html",
|
|
@@ -24,6 +25,7 @@ module.exports = {
|
|
|
24
25
|
HIGHMARK_CLI,
|
|
25
26
|
CLIENT_FILE_NAME,
|
|
26
27
|
LIVE_RELOAD_PATH,
|
|
28
|
+
CHECKMARK_FILE_NAME,
|
|
27
29
|
LOADING_CSS_FILE_PATH,
|
|
28
30
|
DEFAULT_SELECTOR_STRING,
|
|
29
31
|
CLIENT_TEMPLATE_FILE_PATH,
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const { createLiveReloadHandler: createLiveReloadHandlerEx } = require("lively-cli");
|
|
4
|
+
|
|
5
|
+
const { directoryPathFromFilePath } = require("../utilities/path");
|
|
6
|
+
|
|
7
|
+
function createLiveReloadHandler(context) {
|
|
8
|
+
const { quietly, outputFilePath } = context,
|
|
9
|
+
outputDirectoryPath = directoryPathFromFilePath(outputFilePath),
|
|
10
|
+
watchPattern = outputDirectoryPath, ///
|
|
11
|
+
liveReloadHandler = createLiveReloadHandlerEx(watchPattern, quietly);
|
|
12
|
+
|
|
13
|
+
return liveReloadHandler;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
module.exports = {
|
|
17
|
+
createLiveReloadHandler
|
|
18
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const { pathUtilities, packageUtilities } = require("necessary");
|
|
4
|
+
|
|
5
|
+
const { copyFile } = require("../utilities/fileSystem"),
|
|
6
|
+
{ CHECKMARK_FILE_NAME } = require("../constants"),
|
|
7
|
+
{ directoryPathFromFilePath } = require("../utilities/path");
|
|
8
|
+
|
|
9
|
+
const { getPackagePath } = packageUtilities,
|
|
10
|
+
{ concatenatePaths } = pathUtilities;
|
|
11
|
+
|
|
12
|
+
function copyCheckmarkOperation(proceed, abort, context) {
|
|
13
|
+
const { copyClient } = context;
|
|
14
|
+
|
|
15
|
+
if (!copyClient) {
|
|
16
|
+
proceed();
|
|
17
|
+
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const { outputFilePath } = context,
|
|
22
|
+
packagePath = getPackagePath(),
|
|
23
|
+
outputDirectoryPath = directoryPathFromFilePath(outputFilePath),
|
|
24
|
+
sourceFilePath = concatenatePaths(packagePath, CHECKMARK_FILE_NAME), ///
|
|
25
|
+
targetFilePath = concatenatePaths(outputDirectoryPath, CHECKMARK_FILE_NAME); ///
|
|
26
|
+
|
|
27
|
+
copyFile(sourceFilePath, targetFilePath);
|
|
28
|
+
|
|
29
|
+
proceed();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
module.exports = copyCheckmarkOperation;
|
|
@@ -22,10 +22,10 @@ function copyClientOperation(proceed, abort, context) {
|
|
|
22
22
|
const { outputFilePath } = context,
|
|
23
23
|
packagePath = getPackagePath(),
|
|
24
24
|
outputDirectoryPath = directoryPathFromFilePath(outputFilePath),
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
sourceFilePath = concatenatePaths(packagePath, CLIENT_FILE_NAME),
|
|
26
|
+
targetFilePath = concatenatePaths(outputDirectoryPath, CLIENT_FILE_NAME);
|
|
27
27
|
|
|
28
|
-
copyFile(
|
|
28
|
+
copyFile(sourceFilePath, targetFilePath);
|
|
29
29
|
|
|
30
30
|
const { watch } = context;
|
|
31
31
|
|
|
@@ -35,7 +35,7 @@ function copyClientOperation(proceed, abort, context) {
|
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
const watchPattern =
|
|
38
|
+
const watchPattern = sourceFilePath, ///
|
|
39
39
|
registerHandler = watchFile(watchPattern);
|
|
40
40
|
|
|
41
41
|
registerHandler(copyClientFile);
|
|
@@ -43,7 +43,7 @@ function copyClientOperation(proceed, abort, context) {
|
|
|
43
43
|
proceed();
|
|
44
44
|
|
|
45
45
|
function copyClientFile() {
|
|
46
|
-
copyFile(
|
|
46
|
+
copyFile(sourceFilePath, targetFilePath);
|
|
47
47
|
|
|
48
48
|
defer(() => {
|
|
49
49
|
registerHandler(copyClientFile);
|
|
@@ -67,8 +67,8 @@ function selectorStringFromMarkdownStyleFilePath(markdownStyleFilePath) {
|
|
|
67
67
|
const filePath = markdownStyleFilePath, ///
|
|
68
68
|
className = classNameFromFilePath(filePath),
|
|
69
69
|
selectorString = (className !== null) ?
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
`${DEFAULT_SELECTOR_STRING}.${className}` :
|
|
71
|
+
`${DEFAULT_SELECTOR_STRING}`;
|
|
72
72
|
|
|
73
73
|
return selectorString;
|
|
74
74
|
}
|
package/bin/operation/server.js
CHANGED
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
const express = require("express");
|
|
4
4
|
|
|
5
|
-
const {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
{ directoryPathFromFilePath } = require("../utilities/path"),
|
|
5
|
+
const { createStaticRouter } = require("../router/static"),
|
|
6
|
+
{ createLiveReloadHandler } = require("../handler/liveReload"),
|
|
7
|
+
{ ERROR, LIVE_RELOAD_PATH } = require("../constants"),
|
|
9
8
|
{ UNABLE_TO_START_SERVER_MESSAGE } = require("../messages");
|
|
10
9
|
|
|
11
10
|
function serverOperation(proceed, abort, context) {
|
|
@@ -17,17 +16,15 @@ function serverOperation(proceed, abort, context) {
|
|
|
17
16
|
return;
|
|
18
17
|
}
|
|
19
18
|
|
|
20
|
-
const { port, watch, quietly, outputFilePath } = context,
|
|
21
|
-
outputDirectoryPath = directoryPathFromFilePath(outputFilePath),
|
|
22
|
-
staticRouter = express.static(outputDirectoryPath);
|
|
23
|
-
|
|
24
19
|
server = express(); ///
|
|
25
20
|
|
|
21
|
+
const { port, watch } = context,
|
|
22
|
+
staticRouter = createStaticRouter(context);
|
|
23
|
+
|
|
26
24
|
server.use(staticRouter);
|
|
27
25
|
|
|
28
26
|
if (watch) {
|
|
29
|
-
const
|
|
30
|
-
liveReloadHandler = createLiveReloadHandler(watchPattern, quietly);
|
|
27
|
+
const liveReloadHandler = createLiveReloadHandler(context);
|
|
31
28
|
|
|
32
29
|
server.get(LIVE_RELOAD_PATH, liveReloadHandler);
|
|
33
30
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const express = require("express");
|
|
4
|
+
|
|
5
|
+
const { directoryPathFromFilePath } = require("../utilities/path");
|
|
6
|
+
|
|
7
|
+
function createStaticRouter(context) {
|
|
8
|
+
const { outputFilePath } = context,
|
|
9
|
+
outputDirectoryPath = directoryPathFromFilePath(outputFilePath),
|
|
10
|
+
staticRouter = express.static(outputDirectoryPath);
|
|
11
|
+
|
|
12
|
+
return staticRouter;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
module.exports = {
|
|
16
|
+
createStaticRouter
|
|
17
|
+
};
|
package/checkmark.svg
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
|
|
3
|
+
<svg width="20mm"
|
|
4
|
+
height="20mm"
|
|
5
|
+
viewBox="0 0 20 20"
|
|
6
|
+
version="1.1"
|
|
7
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
8
|
+
>
|
|
9
|
+
<g transform="matrix(0.70580178,0,0,0.69424702,3.0000007,2.999987)">
|
|
10
|
+
<path style="fill:#ffffff" d="M 6.0799812,16.1216 Q 7.3454978,13.232921 8.7898374,10.605598 10.247933,7.9645203 11.788561,5.7361107 13.604303,3.1225438 14.649729,1.9670722 15.323754,1.224269 15.915246,0.74282245 16.259136,0.46771016 17.001939,0.33015401 18.803925,1.9250438e-5 19.519217,1.9250438e-5 q 0.316379,0 0.316379,0.220089839562 0,0.20633422 -0.316379,0.49520213 -2.751123,2.44849948 -5.777358,7.00160798 -3.01248,4.5531088 -5.0895778,9.6701968 -0.78407,1.912031 -1.1004492,2.352211 -0.3026235,0.426424 -1.925786,0.426424 -1.0591824,0 -1.3342947,-0.206335 Q 4.0303946,19.753082 3.3288583,18.652633 2.1183642,16.823136 0.72904706,15.351285 -5.2992254e-7,14.580971 -5.2992254e-7,14.168303 q 0,-0.577736 0.81158127992254,-1.127961 0.81158125,-0.56398 1.33429465,-0.56398 0.7290476,0 1.7469631,0.825337 1.0316711,0.811581 2.1871427,2.819901 z" />
|
|
11
|
+
</g>
|
|
12
|
+
</svg>
|