diff --git a/package-lock.json b/package-lock.json index b7b26f5..c480eae 100644 --- a/package-lock.json +++ b/package-lock.json @@ -735,6 +735,12 @@ "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true }, + "is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", + "dev": true + }, "is-reference": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", @@ -745,9 +751,9 @@ } }, "is-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.0.tgz", - "integrity": "sha512-iI97M8KTWID2la5uYXlkbSDQIg4F6o1sYboZKKTDpnDQMLtUL86zxhgDet3Q2SriaYsyGqZ6Mn2SjbRKeLHdqw==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz", + "integrity": "sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==", "dev": true, "requires": { "has-symbols": "^1.0.1" @@ -802,6 +808,11 @@ "iterate-iterator": "^1.0.1" } }, + "javascript-natural-sort": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/javascript-natural-sort/-/javascript-natural-sort-0.7.1.tgz", + "integrity": "sha1-+eIwPUUH9tdDVac2ZNFED7Wg71k=" + }, "jest-worker": { "version": "26.0.0", "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.0.0.tgz", @@ -889,12 +900,6 @@ "p-locate": "^4.1.0" } }, - "lodash": { - "version": "4.17.19", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", - "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==", - "dev": true - }, "lodash-es": { "version": "4.17.15", "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.15.tgz", @@ -952,9 +957,9 @@ "dev": true }, "mocha": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.0.1.tgz", - "integrity": "sha512-vefaXfdYI8+Yo8nPZQQi0QO2o+5q9UIMX1jZ1XMmK3+4+CQjc7+B0hPdUeglXiTlr8IHMVRo63IhO9Mzt6fxOg==", + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.1.1.tgz", + "integrity": "sha512-p7FuGlYH8t7gaiodlFreseLxEmxTgvyG9RgPHODFPySNhwUehu8NIb0vdSt3WFckSneswZ0Un5typYcWElk7HQ==", "dev": true, "requires": { "ansi-colors": "4.1.1", @@ -973,7 +978,7 @@ "ms": "2.1.2", "object.assign": "4.1.0", "promise.allsettled": "1.0.2", - "serialize-javascript": "3.0.0", + "serialize-javascript": "4.0.0", "strip-json-comments": "3.0.1", "supports-color": "7.1.0", "which": "2.0.2", @@ -981,7 +986,7 @@ "workerpool": "6.0.0", "yargs": "13.3.2", "yargs-parser": "13.1.2", - "yargs-unparser": "1.6.0" + "yargs-unparser": "1.6.1" }, "dependencies": { "chokidar": { @@ -1010,10 +1015,13 @@ } }, "serialize-javascript": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-3.0.0.tgz", - "integrity": "sha512-skZcHYw2vEX4bw90nAr2iTTsz6x2SrHEnfxgKYmZlvJYBEZrvbKtobJWlQ20zczKb3bsHHXXTYt48zBA7ni9cw==", - "dev": true + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz", + "integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==", + "dev": true, + "requires": { + "randombytes": "^2.1.0" + } } } }, @@ -1447,6 +1455,11 @@ "strip-indent": "^3.0.0" } }, + "svelte-select": { + "version": "3.11.1", + "resolved": "https://registry.npmjs.org/svelte-select/-/svelte-select-3.11.1.tgz", + "integrity": "sha512-fva5VRmZT/MnqTMXOlwkEnX+ultdTKdMyguTOngzt77NsXjvPxA7+/M8cUlxyQkAJEqI1RdxCq2RRAAxaJxNBg==" + }, "svelte-simple-modal": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/svelte-simple-modal/-/svelte-simple-modal-0.6.0.tgz", @@ -1673,14 +1686,107 @@ } }, "yargs-unparser": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.6.0.tgz", - "integrity": "sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.6.1.tgz", + "integrity": "sha512-qZV14lK9MWsGCmcr7u5oXGH0dbGqZAIxTDrWXZDo5zUr6b6iUmelNKO6x6R1dQT24AH3LgRxJpr8meWy2unolA==", "dev": true, "requires": { + "camelcase": "^5.3.1", + "decamelize": "^1.2.0", "flat": "^4.1.0", - "lodash": "^4.17.15", - "yargs": "^13.3.0" + "is-plain-obj": "^1.1.0", + "yargs": "^14.2.3" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + }, + "yargs": { + "version": "14.2.3", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-14.2.3.tgz", + "integrity": "sha512-ZbotRWhF+lkjijC/VhmOT9wSgyBQ7+zr13+YLkhfsSiTriYsMzkTUFP18pFhWwBeMa5gUc1MzbhrO6/VB7c9Xg==", + "dev": true, + "requires": { + "cliui": "^5.0.0", + "decamelize": "^1.2.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^15.0.1" + } + }, + "yargs-parser": { + "version": "15.0.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-15.0.1.tgz", + "integrity": "sha512-0OAMV2mAZQrs3FkNpDQcBk1x5HXb8X4twADss4S0Iuk+2dGnLOE/fRHrsYm542GduMveyA77OF4wrNJuanRCWw==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } } } } diff --git a/package.json b/package.json index 7a362f2..442f05c 100644 --- a/package.json +++ b/package.json @@ -21,8 +21,10 @@ "ace-builds": "1.4.12", "ajv": "6.12.3", "classnames": "2.2.6", + "javascript-natural-sort": "0.7.1", "lodash-es": "4.17.15", "svelte-awesome": "2.3.0", + "svelte-select": "3.11.1", "svelte-simple-modal": "0.6.0" }, "devDependencies": { @@ -31,7 +33,7 @@ "@rollup/plugin-node-resolve": "8.4.0", "btoa": "1.2.1", "mkdirp": "1.0.4", - "mocha": "8.0.1", + "mocha": "8.1.1", "rollup": "2.23.0", "rollup-plugin-livereload": "1.3.0", "rollup-plugin-svelte": "5.2.3", diff --git a/src/components/JSONEditor.svelte b/src/components/JSONEditor.svelte index 3513b2b..42e0717 100644 --- a/src/components/JSONEditor.svelte +++ b/src/components/JSONEditor.svelte @@ -1,3 +1,5 @@ + + - + + diff --git a/src/components/modals/Header.scss b/src/components/modals/Header.scss new file mode 100644 index 0000000..9d9345f --- /dev/null +++ b/src/components/modals/Header.scss @@ -0,0 +1,21 @@ +@import '../../styles.scss'; + +.header { + display: flex; + background: $theme-color; + color: $white; + + .title { + flex: 1; + padding: $input-padding; + vertical-align: middle; + } + + button.close { + min-width: 32px; + + &:hover { + background: rgba(255, 255, 255, 0.1); + } + } +} \ No newline at end of file diff --git a/src/components/modals/Header.svelte b/src/components/modals/Header.svelte new file mode 100644 index 0000000..1c96858 --- /dev/null +++ b/src/components/modals/Header.svelte @@ -0,0 +1,20 @@ + + +
+
+ {title} +
+ +
+ + diff --git a/src/components/modals/Modal.scss b/src/components/modals/Modal.scss new file mode 100644 index 0000000..8f2faa1 --- /dev/null +++ b/src/components/modals/Modal.scss @@ -0,0 +1,13 @@ +@import '../../styles.scss'; + +.contents { + padding: 20px; + + .actions { + display: flex; + flex-direction: row; + justify-content: flex-end; + + padding-top: $padding; + } +} diff --git a/src/components/modals/SortModal.scss b/src/components/modals/SortModal.scss index 24855ce..ed6f8ab 100644 --- a/src/components/modals/SortModal.scss +++ b/src/components/modals/SortModal.scss @@ -1 +1,17 @@ @import '../../styles.scss'; +@import './Modal.scss'; + +.sort-modal { + table { + width: 100%; + border-collapse: collapse; + border-spacing: none; + + th, td { + text-align: left; + vertical-align: middle; + font-weight: normal; + padding-bottom: $padding; + } + } +} \ No newline at end of file diff --git a/src/components/modals/SortModal.svelte b/src/components/modals/SortModal.svelte index 9b95d62..574e3c2 100644 --- a/src/components/modals/SortModal.svelte +++ b/src/components/modals/SortModal.svelte @@ -1,10 +1,138 @@ + + -
- Sort Modal... +
+
+ +
+ + + + + + + {#if path.length > 0} + + + + + {/if} + {#if isArray} + + + + + {/if} + + + + + +
Path{path.join('.')}
Property +
Direction +
+ +
+ +
+
diff --git a/src/components/modals/TransformModal.scss b/src/components/modals/TransformModal.scss index 24855ce..d551557 100644 --- a/src/components/modals/TransformModal.scss +++ b/src/components/modals/TransformModal.scss @@ -1 +1,2 @@ @import '../../styles.scss'; +@import './Modal.scss'; diff --git a/src/components/modals/TransformModal.svelte b/src/components/modals/TransformModal.svelte index f570d43..10a2b42 100644 --- a/src/components/modals/TransformModal.svelte +++ b/src/components/modals/TransformModal.svelte @@ -1,10 +1,17 @@ + + -
- Transform Modal... +
+
+
+ TODO... +
diff --git a/src/components/treemode/JSONNode.svelte b/src/components/treemode/JSONNode.svelte index 2a5c013..c4f2693 100644 --- a/src/components/treemode/JSONNode.svelte +++ b/src/components/treemode/JSONNode.svelte @@ -1,3 +1,5 @@ + +