diff --git a/package-lock.json b/package-lock.json index 8ac504a..e0b64d8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "cn.memocast.app", - "version": "2.1.5", + "version": "2.1.6", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -1147,7 +1147,6 @@ "version": "7.12.5", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.5.tgz", "integrity": "sha512-plcc+hbExy3McchJCEQG3knOsuh3HH+Prx1P6cLIkET/0dLuQDEnrT+s27Axgc9bqfsmNUNHfscgMUdBpC9xfg==", - "dev": true, "requires": { "regenerator-runtime": "^0.13.4" } @@ -1518,6 +1517,228 @@ "integrity": "sha1-6nrd907Ow9dimCegw54smt3HPQQ=", "dev": true }, + "@types/d3": { + "version": "6.7.5", + "resolved": "https://registry.nlark.com/@types/d3/download/@types/d3-6.7.5.tgz", + "integrity": "sha1-augDTqIdsQ+j4x2x9nDFiH2R2KM=", + "requires": { + "@types/d3-array": "^2", + "@types/d3-axis": "^2", + "@types/d3-brush": "^2", + "@types/d3-chord": "^2", + "@types/d3-color": "^2", + "@types/d3-contour": "^2", + "@types/d3-delaunay": "^5", + "@types/d3-dispatch": "^2", + "@types/d3-drag": "^2", + "@types/d3-dsv": "^2", + "@types/d3-ease": "^2", + "@types/d3-fetch": "^2", + "@types/d3-force": "^2", + "@types/d3-format": "^2", + "@types/d3-geo": "^2", + "@types/d3-hierarchy": "^2", + "@types/d3-interpolate": "^2", + "@types/d3-path": "^2", + "@types/d3-polygon": "^2", + "@types/d3-quadtree": "^2", + "@types/d3-random": "^2", + "@types/d3-scale": "^3", + "@types/d3-scale-chromatic": "^2", + "@types/d3-selection": "^2", + "@types/d3-shape": "^2", + "@types/d3-time": "^2", + "@types/d3-time-format": "^3", + "@types/d3-timer": "^2", + "@types/d3-transition": "^2", + "@types/d3-zoom": "^2" + } + }, + "@types/d3-array": { + "version": "2.12.3", + "resolved": "https://registry.nlark.com/@types/d3-array/download/@types/d3-array-2.12.3.tgz", + "integrity": "sha1-jRbVH7BK1aWo6+FOuCY6V58e/dE=" + }, + "@types/d3-axis": { + "version": "2.1.3", + "resolved": "https://registry.nlark.com/@types/d3-axis/download/@types/d3-axis-2.1.3.tgz", + "integrity": "sha1-NIzKh39mQwMKqMhm0IzK4GghoOI=", + "requires": { + "@types/d3-selection": "^2" + } + }, + "@types/d3-brush": { + "version": "2.1.2", + "resolved": "https://registry.nlark.com/@types/d3-brush/download/@types/d3-brush-2.1.2.tgz", + "integrity": "sha1-x1iQ0cyu8k+6GBHarj+JbBgGQYs=", + "requires": { + "@types/d3-selection": "^2" + } + }, + "@types/d3-chord": { + "version": "2.0.3", + "resolved": "https://registry.nlark.com/@types/d3-chord/download/@types/d3-chord-2.0.3.tgz", + "integrity": "sha1-MAm3krdU2pZNiTtCadH+d1fyE3A=" + }, + "@types/d3-color": { + "version": "2.0.3", + "resolved": "https://registry.nlark.com/@types/d3-color/download/@types/d3-color-2.0.3.tgz", + "integrity": "sha1-i8RYkHPIDjPRJjRVQvWIBWUR/oI=" + }, + "@types/d3-contour": { + "version": "2.0.4", + "resolved": "https://registry.nlark.com/@types/d3-contour/download/@types/d3-contour-2.0.4.tgz", + "integrity": "sha1-L8WqiUnBodEtGDYzYDkjAl49FP0=", + "requires": { + "@types/d3-array": "^2", + "@types/geojson": "*" + } + }, + "@types/d3-delaunay": { + "version": "5.3.1", + "resolved": "https://registry.nlark.com/@types/d3-delaunay/download/@types/d3-delaunay-5.3.1.tgz", + "integrity": "sha1-R64Dr2t4yzqjnT08Qspx2spIiu8=" + }, + "@types/d3-dispatch": { + "version": "2.0.1", + "resolved": "https://registry.nlark.com/@types/d3-dispatch/download/@types/d3-dispatch-2.0.1.tgz?cache=0&sync_timestamp=1625155460468&other_urls=https%3A%2F%2Fregistry.nlark.com%2F%40types%2Fd3-dispatch%2Fdownload%2F%40types%2Fd3-dispatch-2.0.1.tgz", + "integrity": "sha1-19xQ+bZ5mWzPcPPHnbv5lQWpMQc=" + }, + "@types/d3-drag": { + "version": "2.0.2", + "resolved": "https://registry.nlark.com/@types/d3-drag/download/@types/d3-drag-2.0.2.tgz", + "integrity": "sha1-7VONJEVsg5lnqax6q14bY7KLrH8=", + "requires": { + "@types/d3-selection": "^2" + } + }, + "@types/d3-dsv": { + "version": "2.0.2", + "resolved": "https://registry.nlark.com/@types/d3-dsv/download/@types/d3-dsv-2.0.2.tgz", + "integrity": "sha1-4Q+ldXa1De0n4mHbmYS5qS7+wvM=" + }, + "@types/d3-ease": { + "version": "2.0.1", + "resolved": "https://registry.nlark.com/@types/d3-ease/download/@types/d3-ease-2.0.1.tgz", + "integrity": "sha1-vgPSmYDtc1m+HVuT/2Zvld3Lz0g=" + }, + "@types/d3-fetch": { + "version": "2.0.2", + "resolved": "https://registry.nlark.com/@types/d3-fetch/download/@types/d3-fetch-2.0.2.tgz", + "integrity": "sha1-Yoxl0Us6DQL+G5wvMJi4GkfjcLw=", + "requires": { + "@types/d3-dsv": "^2" + } + }, + "@types/d3-force": { + "version": "2.1.4", + "resolved": "https://registry.nlark.com/@types/d3-force/download/@types/d3-force-2.1.4.tgz", + "integrity": "sha1-mJGbh9uKDKUBHRicWY1pJR0gNE0=" + }, + "@types/d3-format": { + "version": "2.0.2", + "resolved": "https://registry.nlark.com/@types/d3-format/download/@types/d3-format-2.0.2.tgz", + "integrity": "sha1-l7KsMUQwrp93aMye+6iyO2Ovgu8=" + }, + "@types/d3-geo": { + "version": "2.0.3", + "resolved": "https://registry.nlark.com/@types/d3-geo/download/@types/d3-geo-2.0.3.tgz", + "integrity": "sha1-SvDzPJ55aq1sP8DdjK3amIbR/qk=", + "requires": { + "@types/geojson": "*" + } + }, + "@types/d3-hierarchy": { + "version": "2.0.2", + "resolved": "https://registry.nlark.com/@types/d3-hierarchy/download/@types/d3-hierarchy-2.0.2.tgz", + "integrity": "sha1-r9CdUJw26M1JBzM1Vvi1kfI1iek=" + }, + "@types/d3-interpolate": { + "version": "2.0.2", + "resolved": "https://registry.nlark.com/@types/d3-interpolate/download/@types/d3-interpolate-2.0.2.tgz", + "integrity": "sha1-eO3fcnixnkjoZSYDBFUo1GiXq6A=", + "requires": { + "@types/d3-color": "^2" + } + }, + "@types/d3-path": { + "version": "2.0.1", + "resolved": "https://registry.nlark.com/@types/d3-path/download/@types/d3-path-2.0.1.tgz", + "integrity": "sha1-ygPfqLlNit2XrQzZfpbiAGtHY8s=" + }, + "@types/d3-polygon": { + "version": "2.0.1", + "resolved": "https://registry.nlark.com/@types/d3-polygon/download/@types/d3-polygon-2.0.1.tgz", + "integrity": "sha1-wgVllPhbUSvCtPdByt3UtUSLwRU=" + }, + "@types/d3-quadtree": { + "version": "2.0.2", + "resolved": "https://registry.nlark.com/@types/d3-quadtree/download/@types/d3-quadtree-2.0.2.tgz", + "integrity": "sha1-482StOBTGPmLChbngLqZznsT63c=" + }, + "@types/d3-random": { + "version": "2.2.1", + "resolved": "https://registry.nlark.com/@types/d3-random/download/@types/d3-random-2.2.1.tgz?cache=0&sync_timestamp=1625128551619&other_urls=https%3A%2F%2Fregistry.nlark.com%2F%40types%2Fd3-random%2Fdownload%2F%40types%2Fd3-random-2.2.1.tgz", + "integrity": "sha1-VR7btxyzF96iz5x26+BZ0xHu+ss=" + }, + "@types/d3-scale": { + "version": "3.3.2", + "resolved": "https://registry.nlark.com/@types/d3-scale/download/@types/d3-scale-3.3.2.tgz", + "integrity": "sha1-GMlOkPTxxrHuFKcPFL/KK9HGHQY=", + "requires": { + "@types/d3-time": "^2" + } + }, + "@types/d3-scale-chromatic": { + "version": "2.0.1", + "resolved": "https://registry.nlark.com/@types/d3-scale-chromatic/download/@types/d3-scale-chromatic-2.0.1.tgz", + "integrity": "sha1-SVy7rnJz4ND/VkzcGaptK5ko2oM=" + }, + "@types/d3-selection": { + "version": "2.0.1", + "resolved": "https://registry.nlark.com/@types/d3-selection/download/@types/d3-selection-2.0.1.tgz", + "integrity": "sha1-vCgWyW+v8oXSBN2nK3lzTU831YM=" + }, + "@types/d3-shape": { + "version": "2.1.3", + "resolved": "https://registry.nlark.com/@types/d3-shape/download/@types/d3-shape-2.1.3.tgz", + "integrity": "sha1-NdOXueaHq6oN6CNDslC5iXuMrPM=", + "requires": { + "@types/d3-path": "^2" + } + }, + "@types/d3-time": { + "version": "2.1.1", + "resolved": "https://registry.nlark.com/@types/d3-time/download/@types/d3-time-2.1.1.tgz", + "integrity": "sha1-dD/cghyB+GU3y/7OBwk6w5tLw0I=" + }, + "@types/d3-time-format": { + "version": "3.0.1", + "resolved": "https://registry.nlark.com/@types/d3-time-format/download/@types/d3-time-format-3.0.1.tgz", + "integrity": "sha1-FoD7bEGrOoXbJh7eKWYmZoWSJGo=" + }, + "@types/d3-timer": { + "version": "2.0.1", + "resolved": "https://registry.nlark.com/@types/d3-timer/download/@types/d3-timer-2.0.1.tgz?cache=0&sync_timestamp=1624709661921&other_urls=https%3A%2F%2Fregistry.nlark.com%2F%40types%2Fd3-timer%2Fdownload%2F%40types%2Fd3-timer-2.0.1.tgz", + "integrity": "sha1-/7ZiDSkGJPNyaqNiwMiktEyNcgA=" + }, + "@types/d3-transition": { + "version": "2.0.2", + "resolved": "https://registry.nlark.com/@types/d3-transition/download/@types/d3-transition-2.0.2.tgz", + "integrity": "sha1-1bocJqPa6wxVJ9Vz1EtMXKn64Cc=", + "requires": { + "@types/d3-selection": "^2" + } + }, + "@types/d3-zoom": { + "version": "2.0.3", + "resolved": "https://registry.nlark.com/@types/d3-zoom/download/@types/d3-zoom-2.0.3.tgz", + "integrity": "sha1-nu+HY2APqL4RuMsO2RRKOV323/s=", + "requires": { + "@types/d3-interpolate": "^2", + "@types/d3-selection": "^2" + } + }, "@types/debug": { "version": "4.1.5", "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.5.tgz", @@ -1576,6 +1797,11 @@ "@types/node": "*" } }, + "@types/geojson": { + "version": "7946.0.8", + "resolved": "https://registry.nlark.com/@types/geojson/download/@types/geojson-7946.0.8.tgz", + "integrity": "sha1-MHRK/bOF4pReIvOwM/iX92sfEso=" + }, "@types/glob": { "version": "7.1.3", "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.3.tgz", @@ -3943,6 +4169,14 @@ } } }, + "autolinker": { + "version": "3.14.3", + "resolved": "https://registry.npm.taobao.org/autolinker/download/autolinker-3.14.3.tgz", + "integrity": "sha1-xhxCS8YHe88vxigDgD7C9Y4Vp+w=", + "requires": { + "tslib": "^1.9.3" + } + }, "autoprefixer": { "version": "9.8.6", "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-9.8.6.tgz", @@ -5058,7 +5292,6 @@ "version": "2.0.8", "resolved": "https://registry.npm.taobao.org/clipboard/download/clipboard-2.0.8.tgz", "integrity": "sha1-/8bBA90pZ6gwBfP2GXaqRlWkzbo=", - "dev": true, "optional": true, "requires": { "good-listener": "^1.2.2", @@ -6201,6 +6434,14 @@ "d3-dsv": "1" } }, + "d3-flextree": { + "version": "2.1.1", + "resolved": "https://registry.npm.taobao.org/d3-flextree/download/d3-flextree-2.1.1.tgz", + "integrity": "sha1-DmuLibBgKwc9svSItbgDDOMY3ek=", + "requires": { + "d3-hierarchy": "^1.1.5" + } + }, "d3-force": { "version": "1.2.1", "resolved": "https://registry.nlark.com/d3-force/download/d3-force-1.2.1.tgz", @@ -6585,7 +6826,6 @@ "version": "3.2.0", "resolved": "https://registry.npm.taobao.org/delegate/download/delegate-3.2.0.tgz", "integrity": "sha1-tmtxwxWFIuirV0T3INjKDCr1kWY=", - "dev": true, "optional": true }, "depd": { @@ -9651,7 +9891,6 @@ "version": "1.2.2", "resolved": "https://registry.npm.taobao.org/good-listener/download/good-listener-1.2.2.tgz", "integrity": "sha1-1TswzfkxPf+33JoNR3CWqm0UXFA=", - "dev": true, "optional": true, "requires": { "delegate": "^3.1.2" @@ -11751,6 +11990,314 @@ "integrity": "sha1-PcfOi4/BflmBx3zDmNF4Ixnzf7w=", "dev": true }, + "markmap-common": { + "version": "0.1.5", + "resolved": "https://registry.nlark.com/markmap-common/download/markmap-common-0.1.5.tgz", + "integrity": "sha1-9I56usV5DHLVq1VCmiFKy+FnCSI=", + "requires": { + "@babel/runtime": "^7.12.1" + } + }, + "markmap-lib": { + "version": "0.11.6", + "resolved": "https://registry.nlark.com/markmap-lib/download/markmap-lib-0.11.6.tgz", + "integrity": "sha1-9XiD+bcDUOrZTtLVaSYWa216su8=", + "requires": { + "@babel/runtime": "^7.12.5", + "katex": "^0.12.0", + "markmap-common": "^0.1.5", + "prismjs": "^1.21.0", + "remarkable": "^2.0.0", + "remarkable-katex": "^1.1.6" + }, + "dependencies": { + "katex": { + "version": "0.12.0", + "resolved": "https://registry.nlark.com/katex/download/katex-0.12.0.tgz", + "integrity": "sha1-L7HGZdvSsEPtz4ofXFVfRr6qDLk=", + "requires": { + "commander": "^2.19.0" + } + } + } + }, + "markmap-view": { + "version": "0.2.6", + "resolved": "https://registry.nlark.com/markmap-view/download/markmap-view-0.2.6.tgz", + "integrity": "sha1-7eLGFa0d3m9+BPk+rKS0h3ygDCo=", + "requires": { + "@babel/runtime": "^7.12.5", + "@types/d3": "^6.0.0", + "d3": "^6.2.0", + "d3-flextree": "^2.1.1", + "markmap-common": "^0.1.5" + }, + "dependencies": { + "d3": { + "version": "6.7.0", + "resolved": "https://registry.nlark.com/d3/download/d3-6.7.0.tgz", + "integrity": "sha1-raxFhZe0osr+jgjPMJSK8Mlc1h8=", + "requires": { + "d3-array": "2", + "d3-axis": "2", + "d3-brush": "2", + "d3-chord": "2", + "d3-color": "2", + "d3-contour": "2", + "d3-delaunay": "5", + "d3-dispatch": "2", + "d3-drag": "2", + "d3-dsv": "2", + "d3-ease": "2", + "d3-fetch": "2", + "d3-force": "2", + "d3-format": "2", + "d3-geo": "2", + "d3-hierarchy": "2", + "d3-interpolate": "2", + "d3-path": "2", + "d3-polygon": "2", + "d3-quadtree": "2", + "d3-random": "2", + "d3-scale": "3", + "d3-scale-chromatic": "2", + "d3-selection": "2", + "d3-shape": "2", + "d3-time": "2", + "d3-time-format": "3", + "d3-timer": "2", + "d3-transition": "2", + "d3-zoom": "2" + } + }, + "d3-array": { + "version": "2.12.1", + "resolved": "https://registry.nlark.com/d3-array/download/d3-array-2.12.1.tgz", + "integrity": "sha1-4gtBqvzf/fXVCSgATs7PgVpGXoE=", + "requires": { + "internmap": "^1.0.0" + } + }, + "d3-axis": { + "version": "2.1.0", + "resolved": "https://registry.nlark.com/d3-axis/download/d3-axis-2.1.0.tgz", + "integrity": "sha1-l421NAknERF9Ay+tXXM9IGMH9qA=" + }, + "d3-brush": { + "version": "2.1.0", + "resolved": "https://registry.nlark.com/d3-brush/download/d3-brush-2.1.0.tgz?cache=0&sync_timestamp=1623284272153&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fd3-brush%2Fdownload%2Fd3-brush-2.1.0.tgz", + "integrity": "sha1-ra37sQTok3rxQumm4gKDJvBHEGU=", + "requires": { + "d3-dispatch": "1 - 2", + "d3-drag": "2", + "d3-interpolate": "1 - 2", + "d3-selection": "2", + "d3-transition": "2" + } + }, + "d3-chord": { + "version": "2.0.0", + "resolved": "https://registry.nlark.com/d3-chord/download/d3-chord-2.0.0.tgz", + "integrity": "sha1-MkkbVmU5EYBWD3OOXBzNHjxH664=", + "requires": { + "d3-path": "1 - 2" + } + }, + "d3-color": { + "version": "2.0.0", + "resolved": "https://registry.nlark.com/d3-color/download/d3-color-2.0.0.tgz", + "integrity": "sha1-jWJcq0Ltm49gGhdgo4n36pGJ1i4=" + }, + "d3-contour": { + "version": "2.0.0", + "resolved": "https://registry.nlark.com/d3-contour/download/d3-contour-2.0.0.tgz", + "integrity": "sha1-gO6DSYhWPjvqnZnd3nLA+MCJ6kA=", + "requires": { + "d3-array": "2" + } + }, + "d3-dispatch": { + "version": "2.0.0", + "resolved": "https://registry.nlark.com/d3-dispatch/download/d3-dispatch-2.0.0.tgz", + "integrity": "sha1-ihjhb3bdP8rvQhY8l7kmqptV588=" + }, + "d3-drag": { + "version": "2.0.0", + "resolved": "https://registry.nlark.com/d3-drag/download/d3-drag-2.0.0.tgz", + "integrity": "sha1-nq8EbOntHCXIhmGRHB1aTY636m0=", + "requires": { + "d3-dispatch": "1 - 2", + "d3-selection": "2" + } + }, + "d3-dsv": { + "version": "2.0.0", + "resolved": "https://registry.nlark.com/d3-dsv/download/d3-dsv-2.0.0.tgz", + "integrity": "sha1-s3sZS230LaUToSDZE60b4itf58U=", + "requires": { + "commander": "2", + "iconv-lite": "0.4", + "rw": "1" + } + }, + "d3-ease": { + "version": "2.0.0", + "resolved": "https://registry.nlark.com/d3-ease/download/d3-ease-2.0.0.tgz", + "integrity": "sha1-/Rdiv8oA2uS6zqUEsdYo/ykKxWM=" + }, + "d3-fetch": { + "version": "2.0.0", + "resolved": "https://registry.nlark.com/d3-fetch/download/d3-fetch-2.0.0.tgz", + "integrity": "sha1-7NfvISjZhHo7QbVI/sgJGNZFwGQ=", + "requires": { + "d3-dsv": "1 - 2" + } + }, + "d3-force": { + "version": "2.1.1", + "resolved": "https://registry.nlark.com/d3-force/download/d3-force-2.1.1.tgz", + "integrity": "sha1-8gzL8ebJ6ArdGSbwm1H2hqi8CTc=", + "requires": { + "d3-dispatch": "1 - 2", + "d3-quadtree": "1 - 2", + "d3-timer": "1 - 2" + } + }, + "d3-format": { + "version": "2.0.0", + "resolved": "https://registry.nlark.com/d3-format/download/d3-format-2.0.0.tgz", + "integrity": "sha1-oQvMD5hsNytym6RHOCQTqr9bB2c=" + }, + "d3-geo": { + "version": "2.0.2", + "resolved": "https://registry.nlark.com/d3-geo/download/d3-geo-2.0.2.tgz", + "integrity": "sha1-wGXBtx/oxfG+ZX5fQ9m90BA4PEA=", + "requires": { + "d3-array": "^2.5.0" + } + }, + "d3-hierarchy": { + "version": "2.0.0", + "resolved": "https://registry.nlark.com/d3-hierarchy/download/d3-hierarchy-2.0.0.tgz", + "integrity": "sha1-2riKWMo+ehvGyrOQ6JZn/MbSAhg=" + }, + "d3-interpolate": { + "version": "2.0.1", + "resolved": "https://registry.nlark.com/d3-interpolate/download/d3-interpolate-2.0.1.tgz", + "integrity": "sha1-mL5JnPuKO5TU/2FpAFAaZKvJEWM=", + "requires": { + "d3-color": "1 - 2" + } + }, + "d3-path": { + "version": "2.0.0", + "resolved": "https://registry.nlark.com/d3-path/download/d3-path-2.0.0.tgz", + "integrity": "sha1-VdhqwTGgVIra4kHuv7VrRYLdCdg=" + }, + "d3-polygon": { + "version": "2.0.0", + "resolved": "https://registry.nlark.com/d3-polygon/download/d3-polygon-2.0.0.tgz", + "integrity": "sha1-E2CO8EL77GJboVmDJ1ZPA8A5bY4=" + }, + "d3-quadtree": { + "version": "2.0.0", + "resolved": "https://registry.nlark.com/d3-quadtree/download/d3-quadtree-2.0.0.tgz", + "integrity": "sha1-7brQRc74hwH2/uOu6Ok/szLTD50=" + }, + "d3-random": { + "version": "2.2.2", + "resolved": "https://registry.nlark.com/d3-random/download/d3-random-2.2.2.tgz", + "integrity": "sha1-XuvSCe9ORaKzYrAZwfshwsmMu24=" + }, + "d3-scale": { + "version": "3.3.0", + "resolved": "https://registry.nlark.com/d3-scale/download/d3-scale-3.3.0.tgz", + "integrity": "sha1-KMYAsp9H5bnNLfl0nCBnJ5ZiA/M=", + "requires": { + "d3-array": "^2.3.0", + "d3-format": "1 - 2", + "d3-interpolate": "1.2.0 - 2", + "d3-time": "^2.1.1", + "d3-time-format": "2 - 3" + } + }, + "d3-scale-chromatic": { + "version": "2.0.0", + "resolved": "https://registry.nlark.com/d3-scale-chromatic/download/d3-scale-chromatic-2.0.0.tgz", + "integrity": "sha1-wT86+GaF/5EyPcLw69Lau9cti6s=", + "requires": { + "d3-color": "1 - 2", + "d3-interpolate": "1 - 2" + } + }, + "d3-selection": { + "version": "2.0.0", + "resolved": "https://registry.nlark.com/d3-selection/download/d3-selection-2.0.0.tgz", + "integrity": "sha1-lKEWOOohQbdWX4g3gNq8fvamEGY=" + }, + "d3-shape": { + "version": "2.1.0", + "resolved": "https://registry.nlark.com/d3-shape/download/d3-shape-2.1.0.tgz", + "integrity": "sha1-O2qCzK+8Rd5VtX/PlWxYTe07Zm8=", + "requires": { + "d3-path": "1 - 2" + } + }, + "d3-time": { + "version": "2.1.1", + "resolved": "https://registry.nlark.com/d3-time/download/d3-time-2.1.1.tgz", + "integrity": "sha1-6dioqIaR9FSOaMoIXl/5VnJKZoI=", + "requires": { + "d3-array": "2" + } + }, + "d3-time-format": { + "version": "3.0.0", + "resolved": "https://registry.nlark.com/d3-time-format/download/d3-time-format-3.0.0.tgz", + "integrity": "sha1-34BWyDZZ4B8grF2l/ernwI1fG7Y=", + "requires": { + "d3-time": "1 - 2" + } + }, + "d3-timer": { + "version": "2.0.0", + "resolved": "https://registry.nlark.com/d3-timer/download/d3-timer-2.0.0.tgz", + "integrity": "sha1-BV7bHRcM/jGrLaiWje7pQLVmI+Y=" + }, + "d3-transition": { + "version": "2.0.0", + "resolved": "https://registry.nlark.com/d3-transition/download/d3-transition-2.0.0.tgz", + "integrity": "sha1-Nm73DCLviNHjQQX1B1FpkaKRyUw=", + "requires": { + "d3-color": "1 - 2", + "d3-dispatch": "1 - 2", + "d3-ease": "1 - 2", + "d3-interpolate": "1 - 2", + "d3-timer": "1 - 2" + } + }, + "d3-zoom": { + "version": "2.0.0", + "resolved": "https://registry.nlark.com/d3-zoom/download/d3-zoom-2.0.0.tgz?cache=0&sync_timestamp=1623286451294&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fd3-zoom%2Fdownload%2Fd3-zoom-2.0.0.tgz", + "integrity": "sha1-8E0K/QVRi+zOh50EcJxH7Nk/ulQ=", + "requires": { + "d3-dispatch": "1 - 2", + "d3-drag": "2", + "d3-interpolate": "1 - 2", + "d3-selection": "2", + "d3-transition": "2" + } + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.nlark.com/iconv-lite/download/iconv-lite-0.4.24.tgz", + "integrity": "sha1-ICK0sl+93CHS9SSXSkdKr+czkIs=", + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + } + } + }, "matcher": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/matcher/-/matcher-3.0.0.tgz", @@ -14136,7 +14683,6 @@ "version": "1.23.0", "resolved": "https://registry.npm.taobao.org/prismjs/download/prismjs-1.23.0.tgz", "integrity": "sha1-07OWf31yRAaQSXZSqdQP8EYGfzM=", - "dev": true, "requires": { "clipboard": "^2.0.0" } @@ -14499,8 +15045,7 @@ "regenerator-runtime": { "version": "0.13.7", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz", - "integrity": "sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==", - "dev": true + "integrity": "sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==" }, "regenerator-transform": { "version": "0.14.5", @@ -14640,6 +15185,20 @@ "mdast-util-to-markdown": "^0.6.0" } }, + "remarkable": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/remarkable/download/remarkable-2.0.1.tgz", + "integrity": "sha1-KArmYnOE37E9mO45lWJ8pVChLzE=", + "requires": { + "argparse": "^1.0.10", + "autolinker": "^3.11.0" + } + }, + "remarkable-katex": { + "version": "1.1.8", + "resolved": "https://registry.nlark.com/remarkable-katex/download/remarkable-katex-1.1.8.tgz", + "integrity": "sha1-rOiWyEExSz/h7hpAJfVm0CqSw94=" + }, "remove-trailing-separator": { "version": "1.1.0", "resolved": "https://registry.npm.taobao.org/remove-trailing-separator/download/remove-trailing-separator-1.1.0.tgz", @@ -15176,7 +15735,6 @@ "version": "1.1.2", "resolved": "https://registry.npm.taobao.org/select/download/select-1.1.2.tgz", "integrity": "sha1-DnNQrN7ICxEIUoeG7B1EGNEbOW0=", - "dev": true, "optional": true }, "select-hose": { @@ -16760,7 +17318,6 @@ "version": "2.1.0", "resolved": "https://registry.npm.taobao.org/tiny-emitter/download/tiny-emitter-2.1.0.tgz", "integrity": "sha1-HRpW7fxRxD6GPLtTgqcjMONVVCM=", - "dev": true, "optional": true }, "tmp": { @@ -16982,8 +17539,7 @@ "tslib": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" }, "tty-browserify": { "version": "0.0.0", diff --git a/package.json b/package.json index a141f0d..fbb6b03 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cn.memocast.app", - "version": "2.1.5", + "version": "2.1.6", "description": "An Awesome WizNote Desktop Application", "productName": "Memocast", "author": "tanknee ", @@ -47,6 +47,8 @@ "lodash": "^4.17.21", "markdown-it": "^8.4.2", "markdown-it-pangu": "^1.0.2", + "markmap-lib": "^0.11.6", + "markmap-view": "^0.2.6", "md5": "^2.3.0", "mermaid": "^8.4.8", "monaco-editor": "^0.25.2", diff --git a/share/channels.js b/share/channels.js index 6d78e4f..7f371a8 100644 --- a/share/channels.js +++ b/share/channels.js @@ -1,6 +1,7 @@ export default { exportMarkdownFile: 'export-markdown-file', exportPng: 'export-png', + exportFile: 'export-file', exportMarkdownFiles: 'export-markdown-files', importImage: 'import-image', uploadImages: 'upload-images', diff --git a/src-electron/main-process/api.js b/src-electron/main-process/api.js index 087e4bf..ee25dd4 100644 --- a/src-electron/main-process/api.js +++ b/src-electron/main-process/api.js @@ -79,10 +79,11 @@ export default { }) }).catch(err => throw err) }).catch(err => throw err) + handleApi('export-png', (event, { content, title }) => { return dialog.showSaveDialog({ title: i18n.t('export'), - defaultPath: path.join(app.getPath('documents'), `${title}`), + defaultPath: path.join(app.getPath('pictures'), `${title}`), filters: [ { name: 'Portable Network Graphics', @@ -111,6 +112,37 @@ export default { }).catch(err => throw err) }).catch(err => throw err) + handleApi('export-file', (event, { content, fileName, fileType }) => { + console.log({ fileName, fileType }) + return dialog.showSaveDialog({ + title: i18n.t('export'), + defaultPath: path.join(app.getPath('documents'), `${fileName}`), + filters: [ + { + name: 'Export File', + extensions: [fileType] + } + ] + }).then((result) => { + if (result.canceled) return + fs.writeFile(result.filePath, content).then(() => { + sendNotification({ + msg: 'ExportSuccessfully', + type: 'positive', + icon: 'check', + filePath: result.filePath + }, event).catch(err => throw err) + }) + .catch(err => { + sendNotification({ + msg: err.msg, + type: 'negative', + icon: 'delete' + }, event).catch(err => throw err) + }) + }).catch(err => throw err) + }).catch(err => throw err) + /** * batch export notes */ diff --git a/src-electron/main-process/electron-main.js b/src-electron/main-process/electron-main.js index c58555d..9187f3b 100644 --- a/src-electron/main-process/electron-main.js +++ b/src-electron/main-process/electron-main.js @@ -10,6 +10,7 @@ import { openNewGitHubIssue, debugInfo, enforceMacOSAppLocation } from 'electron import KeyBindings from './keyboard/shortcut' import { registerMemocastProtocol } from './utlis/resource-loader' import Store from 'electron-store' +import i18n from './i18n' const ClientStorage = new Store({ name: 'ClientFileStorage' @@ -132,10 +133,10 @@ function createWindow () { } dialog.showMessageBox(mainWindow, { type: 'question', - title: 'Open link url in your default browser!', - message: 'Open link url in your default browser!', + title: i18n.t('openLinkHint'), + message: i18n.t('openLinkHint'), detail: linkUrl, - buttons: ['Confirm', 'Cancel'] + buttons: [i18n.t('confirm'), i18n.t('cancel')] }).then((res) => { if (!res.response) { shell.openExternal(linkUrl).then() diff --git a/src-electron/main-process/i18n/lib/index.js b/src-electron/main-process/i18n/lib/index.js index 500e419..cea5117 100644 --- a/src-electron/main-process/i18n/lib/index.js +++ b/src-electron/main-process/i18n/lib/index.js @@ -5,7 +5,11 @@ export default class I18n { availableLocales, messages } = options - this._locale = locale + if (!availableLocales.includes(locale)) { + this._locale = availableLocales[0] + } else { + this._locale = locale + } this._availableLocales = availableLocales this._messages = messages } diff --git a/src-electron/main-process/i18n/src/en-us/electron-main.js b/src-electron/main-process/i18n/src/en-us/electron-main.js new file mode 100644 index 0000000..08feb20 --- /dev/null +++ b/src-electron/main-process/i18n/src/en-us/electron-main.js @@ -0,0 +1,5 @@ +export default { + confirm: 'Confirm', + cancel: 'Cancel', + openLinkHint: 'Open link url in your default browser!' +} diff --git a/src-electron/main-process/i18n/src/en-us/index.js b/src-electron/main-process/i18n/src/en-us/index.js index 4904a11..01e5176 100644 --- a/src-electron/main-process/i18n/src/en-us/index.js +++ b/src-electron/main-process/i18n/src/en-us/index.js @@ -1,6 +1,8 @@ import menu from './menu' import api from './api' +import electronMain from './electron-main' export default { ...menu, - ...api + ...api, + ...electronMain } diff --git a/src-electron/main-process/i18n/src/zh-cn/electron-main.js b/src-electron/main-process/i18n/src/zh-cn/electron-main.js new file mode 100644 index 0000000..15076d8 --- /dev/null +++ b/src-electron/main-process/i18n/src/zh-cn/electron-main.js @@ -0,0 +1,5 @@ +export default { + confirm: '确认', + cancel: '取消', + openLinkHint: '使用浏览器打开链接!' +} diff --git a/src-electron/main-process/i18n/src/zh-cn/index.js b/src-electron/main-process/i18n/src/zh-cn/index.js index 4904a11..01e5176 100644 --- a/src-electron/main-process/i18n/src/zh-cn/index.js +++ b/src-electron/main-process/i18n/src/zh-cn/index.js @@ -1,6 +1,8 @@ import menu from './menu' import api from './api' +import electronMain from './electron-main' export default { ...menu, - ...api + ...api, + ...electronMain } diff --git a/src/ApiHandler.js b/src/ApiHandler.js index 03a7f51..ac9674d 100644 --- a/src/ApiHandler.js +++ b/src/ApiHandler.js @@ -3,6 +3,7 @@ import { Notify } from 'quasar' import bus from 'components/bus' import events from 'src/constants/events' import { i18n } from '../src/boot/i18n' +import debugLogger from './utils/debugLogger' /** * 在本地注册对应的事件句柄,用于解决对应的事件 @@ -33,7 +34,7 @@ async function handleApi (channel, api) { export default { RegisterApiHandler () { - console.log('[API Handler] Render Process registers handler successfully!') + debugLogger.Info('[API Handler] Render Process registers handler successfully!') handleApi('show-notification', (event, payload) => { const { msg, type = 'primary', icon = 'check', filePath } = payload @@ -78,7 +79,7 @@ export default { }).catch(err => throw err) handleApi('editor-view-action', (event, { type }) => { - console.log(type) + debugLogger.Log(type) bus.$emit(events.VIEW_SHORTCUT_CALL[type], type) }).catch(err => throw err) @@ -87,32 +88,32 @@ export default { }).catch(err => throw err) handleApi('updater-update-available', (event, info) => { - console.log(info) + debugLogger.Log(info) bus.$emit(events.UPDATE_EVENTS.updateAvailable, info) }).catch(err => throw err) handleApi('updater-update-not-available', (event, info) => { - console.log(info) + debugLogger.Log(info) bus.$emit(events.UPDATE_EVENTS.updateNotAvailable, info) }).catch(err => throw err) handleApi('updater-update-downloading', (event, progress) => { - console.log(progress) + debugLogger.Log(progress) bus.$emit(events.UPDATE_EVENTS.updateDownloading, progress) }).catch(err => throw err) handleApi('updater-update-downloaded', (event, info) => { - console.log(info) + debugLogger.Log(info) bus.$emit(events.UPDATE_EVENTS.updateDownloaded) }).catch(err => throw err) handleApi('updater-update-error', (event, error) => { - console.log(error) + debugLogger.Log(error) bus.$emit(events.UPDATE_EVENTS.updateError, error) }).catch(err => throw err) }, UnregisterApiHandler () { - console.log('[API Handler] Render Process unregisters handler successfully!') + debugLogger.Info('[API Handler] Render Process unregisters handler successfully!') ipcRenderer.removeAllListeners('show-notification') } } diff --git a/src/ApiInvoker.js b/src/ApiInvoker.js index e6a9ab3..90811c7 100644 --- a/src/ApiInvoker.js +++ b/src/ApiInvoker.js @@ -15,6 +15,10 @@ async function exportPng (note) { return ipcRenderer.invoke(channels.exportPng, note) } +async function exportFile (file) { + return ipcRenderer.invoke(channels.exportFile, file) +} + /** * 批量导出markdown文件 * @param notes 笔记列表 @@ -85,6 +89,7 @@ async function saveUploadedImage (buffer, kbGuid, docGuid, name) { export { exportMarkdownFile, exportPng, + exportFile, exportMarkdownFiles, importImage, uploadImages, diff --git a/src/ErrorHandler.js b/src/ErrorHandler.js index 28ecccd..9cf4552 100644 --- a/src/ErrorHandler.js +++ b/src/ErrorHandler.js @@ -2,6 +2,7 @@ import { Notify } from 'quasar' import bus from 'components/bus' import events from 'src/constants/events' import { i18n } from 'boot/i18n' +import debugLogger from './utils/debugLogger' function registerRequestErrorHandler () { bus.$on(events.REQUEST_ERROR, (error) => { @@ -17,6 +18,7 @@ function registerRequestErrorHandler () { export default { RegisterErrorHandler () { + debugLogger.Info('[API Handler] Render Process registers error handler successfully!') registerRequestErrorHandler() } } diff --git a/src/ScheduleHandler.js b/src/ScheduleHandler.js index 3bf3bd4..07f4680 100644 --- a/src/ScheduleHandler.js +++ b/src/ScheduleHandler.js @@ -1,8 +1,9 @@ import schedule from 'node-schedule' import api from 'src/utils/api' +import debugLogger from './utils/debugLogger' import ServerFileStorage from './utils/storage/ServerFileStorage' const refreshWizToken = (app) => { - schedule.scheduleJob('30 * * * * *', async () => { + schedule.scheduleJob('30 */12 * * * *', async () => { if (!ServerFileStorage.isKeyExistsInLocalStorage('token') || !app.isLogin) return try { await api.AccountServerApi.keepTokenAlive() @@ -14,6 +15,7 @@ const refreshWizToken = (app) => { export default { RegisterScheduleJobs (app) { + debugLogger.Info('[API Handler] Render Process registers schedule handler successfully!') refreshWizToken(app) } } diff --git a/src/boot/request.js b/src/boot/request.js index a2012e4..d0a824a 100644 --- a/src/boot/request.js +++ b/src/boot/request.js @@ -9,53 +9,6 @@ axios.defaults.timeout = 50000 // 响应时间 const baseUrl = 'https://ac.wiz.cn' axios.defaults.baseURL = baseUrl -/** - * execute network request - * @param {'GET','POST','DELETE','PUT'} method - * @param {string} url - * @param {Object} body - * @param token - * @param {Object} extraConfig - * @param {boolean} returnFullResult - * @param {boolean} ignoreStatusCode - * @returns {Promise<*>} - */ -// export async function execRequest (method, url, body = {}, token = null, extraConfig = {}, returnFullResult = false, ignoreStatusCode = false) { -// const config = { -// url, -// method, -// data: body -// } -// -// if (token) { -// config.headers = { -// 'X-Wiz-Token': token -// } -// } else if (ServerFileStorage.isKeyExistsInLocalStorage('token')) { -// config.headers = { -// 'X-Wiz-Token': ServerFileStorage.getValueFromLocalStorage('token') -// } -// } -// -// Object.assign(config, extraConfig) -// -// const res = await axios(config) -// const data = res.data -// -// if (data.returnCode !== 200 && data.code !== 200 && !ignoreStatusCode) { -// const { returnMessage, returnCode, externCode } = data -// bus.$emit(events.REQUEST_ERROR, new NeetoError(returnMessage, returnCode, externCode)) -// const err = new Error(returnMessage) -// err.code = returnCode -// err.externCode = data.externCode -// throw err -// } -// -// return typeof data === 'object' && ('result' in data || !returnFullResult) -// ? data.result -// : data -// } - /** * execute network request * @param {'GET','POST','DELETE','PUT'} method @@ -98,7 +51,7 @@ export async function execRequest (method, url, body = {}, token = null, extraCo throw err } - return typeof data === 'object' && ('result' in data || !returnFullResult) + return typeof data === 'object' && ('result' in data && !returnFullResult) ? data.result : data } diff --git a/src/components/Header.vue b/src/components/Header.vue index 5bfab53..dacae9b 100644 --- a/src/components/Header.vue +++ b/src/components/Header.vue @@ -27,6 +27,7 @@ - {{ $t('noteCategory') }} - - {{ $t('tag') }} - - {{ isLogin ? $t('logout') : $t('login') }} - - {{ $t('search') }} -
- {{ $t('switchView') }} - - {{ $t('settings') }} -
@@ -333,7 +311,6 @@ export default { margin-left: 15%; } .header-note-title > span { - font-family: 'Open Sans', 'JetBrains Mono', serif; margin-left: 7px; letter-spacing: 0.3px; font-weight: 600; diff --git a/src/components/NoteList.vue b/src/components/NoteList.vue index 340556f..ce50b0e 100644 --- a/src/components/NoteList.vue +++ b/src/components/NoteList.vue @@ -19,7 +19,7 @@ >
- +
@@ -125,14 +125,14 @@ export default { thumbStyle () { return { backgroundColor: '#E8ECF1', - width: '7px', + width: '5px', opacity: 0.75 } }, barStyle () { return { - width: '7px' + width: '5px' } }, isRootCategory: function () { @@ -163,7 +163,7 @@ export default { }, ...mapServerGetters(['activeNote', 'currentNotes']), ...mapServerState(['isCurrentNotesLoading', 'currentCategory', 'isLogin', 'tags', 'currentNote']), - ...mapClientState(['rightClickCategoryItem', 'rightClickNoteItem']) + ...mapClientState(['rightClickCategoryItem', 'rightClickNoteItem', 'noteListDenseMode']) }, methods: { addNoteHandler: function () { @@ -175,9 +175,11 @@ export default { type: 'text', attrs: { spellcheck: false - } + }, + label: this.$t('title') }, - cancel: true + ok: this.$t('confirm'), + cancel: this.$t('cancel') }) .onOk(data => { this.createNote(data) @@ -194,7 +196,8 @@ export default { spellcheck: false } }, - cancel: true + ok: this.$t('confirm'), + cancel: this.$t('cancel') }) .onOk(data => { this.createCategory({ @@ -208,7 +211,8 @@ export default { this.$q .dialog({ title: this.$t('deleteCategory'), - cancel: true + ok: this.$t('confirm'), + cancel: this.$t('cancel') }) .onOk(() => { this.deleteCategory(this.rightClickCategoryItem) @@ -236,9 +240,11 @@ export default { type: 'text', attrs: { spellcheck: false - } + }, + label: this.$t('title') }, - cancel: true + ok: this.$t('confirm'), + cancel: this.$t('cancel') }).onOk(data => { const info = JSON.parse(JSON.stringify(this.rightClickNoteItem)) info.title = data @@ -249,7 +255,8 @@ export default { deleteNoteHandler: function () { this.$q.dialog({ title: this.$t('deleteNote'), - cancel: true + ok: this.$t('confirm'), + cancel: this.$t('cancel') }).onOk(() => { this.deleteNote(this.rightClickNoteItem) }) diff --git a/src/components/ui/Loading.vue b/src/components/ui/Loading.vue index 4ada9ad..e905de8 100644 --- a/src/components/ui/Loading.vue +++ b/src/components/ui/Loading.vue @@ -1,12 +1,6 @@ @@ -14,7 +8,29 @@ export default { name: 'Loading', props: { - visible: Boolean + visible: Boolean, + delay: { + type: Number, + default: 200 + } + }, + data () { + return { + isLoading: false, + timer: null + } + }, + watch: { + visible (val) { + if (val) { + this.timer = setTimeout(() => { + this.isLoading = true + }, this.delay) + } else { + clearTimeout(this.timer) + this.isLoading = false + } + } } } diff --git a/src/components/ui/NoteItem.vue b/src/components/ui/NoteItem.vue index c468fb1..68b96fd 100644 --- a/src/components/ui/NoteItem.vue +++ b/src/components/ui/NoteItem.vue @@ -5,9 +5,9 @@ :class='`note-card${darkTag} bg-transparent`' @click='noteItemClickHandler' > -
+
-
+
{{ category }} @@ -45,6 +45,10 @@ export default { contextmenuHandler: { type: Function, default: () => {} + }, + dense: { + type: Boolean, + default: true } }, data () { @@ -84,6 +88,9 @@ export default { darkTag () { return this.darkMode ? '-dark' : '' }, + denseTag () { + return this.dense ? 'dense' : '' + }, modifiedDate () { return helper.displayDateElegantly(this.data.dataModified) }, diff --git a/src/components/ui/NoteOutlineDrawer.vue b/src/components/ui/NoteOutlineDrawer.vue index 22938b9..a67b898 100644 --- a/src/components/ui/NoteOutlineDrawer.vue +++ b/src/components/ui/NoteOutlineDrawer.vue @@ -4,7 +4,7 @@ :value='false' :mini-width='200' :breakpoint='700' - content-class='bg-primary text-white hide-scrollbar' + content-class='hide-scrollbar' overlay elevated side='right' @@ -20,7 +20,6 @@ ref='tree' node-key='key' default-expand-all - selected-color='secondary' class='non-selectable z-max' :selected.sync='selected' :expanded.sync='expanded' @@ -99,7 +98,7 @@ export default { mounted () { const that = this document.addEventListener('click', (e) => { - if (e.path[1] && e.path[1].className && e.path[1].className.indexOf('q-tree__node') !== -1) return + if (e.path[1] && e.path[1].className && e.path[1].className.indexOf && e.path[1].className.indexOf('q-tree__node') !== -1) return if (this.$refs.drawer) that.hide() }) }, diff --git a/src/components/ui/SideDrawer.vue b/src/components/ui/SideDrawer.vue index cfacfe2..0197a75 100644 --- a/src/components/ui/SideDrawer.vue +++ b/src/components/ui/SideDrawer.vue @@ -4,7 +4,7 @@ :value="false" :mini-width="200" :breakpoint="700" - content-class="bg-primary text-white hide-scrollbar" + content-class="hide-scrollbar" > @@ -94,6 +95,16 @@ export default { this.$refs.drawer.hide() } }, + nodeIconName: function (node) { + if (this.type !== 'category') return 'local_offer' + if (this.currentCategory === node.key || (this.$refs.tree && this.$refs.tree.isExpanded(node.key))) { + return 'folder_open' + } + return 'folder' + }, + isNodeSelected: function (node) { + return this.currentCategory === node.key + }, contextMenuHandler: function (e, node) { if (this.type !== 'category') return this.setRightClickCategoryItem(node.key) diff --git a/src/components/ui/dialog/MarkMapDialog.vue b/src/components/ui/dialog/MarkMapDialog.vue new file mode 100644 index 0000000..b7a2110 --- /dev/null +++ b/src/components/ui/dialog/MarkMapDialog.vue @@ -0,0 +1,45 @@ + + + + + diff --git a/src/components/ui/dialog/SettingsDialog.vue b/src/components/ui/dialog/SettingsDialog.vue index a69c967..b75039c 100644 --- a/src/components/ui/dialog/SettingsDialog.vue +++ b/src/components/ui/dialog/SettingsDialog.vue @@ -68,7 +68,25 @@ +
+
+ +
+
+ {{ $t('noteListDenseMode') }} +
@@ -226,6 +244,7 @@ export default { ...mapState([ 'language', 'darkMode', + 'noteListDenseMode', 'markdownOnly', 'imageUploadService', 'flomoApiUrl', @@ -274,7 +293,6 @@ export default { }] }) }) - // this.$refs.updateDialog.toggle() }, updateAvailableHandler: function (info) { console.log(info) @@ -350,7 +368,6 @@ export default { // ) }, ...mapActions([ - 'toggleDarkMode', 'toggleChanged', 'updateStateAndStore', 'checkUpdate' diff --git a/src/components/ui/editor/MarkMap.vue b/src/components/ui/editor/MarkMap.vue new file mode 100644 index 0000000..6325d90 --- /dev/null +++ b/src/components/ui/editor/MarkMap.vue @@ -0,0 +1,96 @@ + + + + + diff --git a/src/components/ui/editor/Monaco.vue b/src/components/ui/editor/Monaco.vue index 681ff99..c59c96e 100644 --- a/src/components/ui/editor/Monaco.vue +++ b/src/components/ui/editor/Monaco.vue @@ -133,6 +133,9 @@ export default { this.contentEditor.revealPositionInCenter(position, 0) } }, + getWordCount: function (markdown) { + return this.contentEditor.getWordCount(markdown) + }, ...mapServerActions(['updateNote', 'updateNoteState']) }, mounted () { diff --git a/src/components/ui/editor/Muya.vue b/src/components/ui/editor/Muya.vue index fa77469..2e1bcf1 100644 --- a/src/components/ui/editor/Muya.vue +++ b/src/components/ui/editor/Muya.vue @@ -244,6 +244,8 @@ export default { this.contentEditor.on('change', () => this.updateContentsList(this.contentEditor.getTOC())) + this.contentEditor.on('change', () => bus.$emit(events.UPDATE_WORD_COUNT, this.contentEditor.getWordCount(this.contentEditor.getMarkdown()))) + this.contentEditor.on('contextmenu', (event, selection) => { showEditorContextMenu(event, selection) }) @@ -253,14 +255,12 @@ export default { // Used to fix #628: auto scroll cursor to visible if the cursor is too low. if (container.clientHeight - y < 100) { - // editableHeight is the lowest cursor position(till to top) that editor allowed. const editableHeight = container.clientHeight - 100 if (this.$q.platform.is.mac) { helper.animatedScrollTo(container, container.scrollTop + (y - editableHeight), 100) } else { container.scrollTop = container.scrollTop + (y - editableHeight) } - // helper.animatedScrollTo(container, container.scrollTop + (y - editableHeight), 100) } }) @@ -274,10 +274,6 @@ export default { this.updateNoteState('default') } this.updateContentsList(this.contentEditor.getTOC()) - const cursor = this.contentEditor.getCursor() - if (cursor.anchor.line >= this.contentEditor.getWordCount(curData).line - 2) { - bus.$emit(events.SCROLL_DOWN) - } }) bus.$on(events.SCROLL_TO_HEADER, this.scrollToHeaderHandler) diff --git a/src/components/ui/menu/NoteItemContextMenu.vue b/src/components/ui/menu/NoteItemContextMenu.vue deleted file mode 100644 index bf8e015..0000000 --- a/src/components/ui/menu/NoteItemContextMenu.vue +++ /dev/null @@ -1,85 +0,0 @@ - - - - - diff --git a/src/constants/events.js b/src/constants/events.js index d02a92f..50cc9a8 100644 --- a/src/constants/events.js +++ b/src/constants/events.js @@ -5,6 +5,8 @@ export default { INSERT_TEXT: 'insert.text', SCROLL_TO_HEADER: 'scroll.to.header', SCROLL_DOWN: 'scroll.down', + GENERATE_MINDMAP: 'generate.mindmap', + UPDATE_WORD_COUNT: 'update.word.count', PARAGRAPH_SHORTCUT_CALL: 'paragraph.shortcut.call', EDIT_SHORTCUT_CALL: { undo: 'edit.shortcut.undo.call', @@ -59,5 +61,10 @@ export default { exportCategory: { markdown: 'side.drawer.context.menu.export.markdown' } + }, + MARK_MAP_CONTEXT_MENU: { + saveAsPNG: 'mark.map.context.menu.save.as.png', + saveAsSVG: 'mark.map.context.menu.save.as.svg', + saveAsHTML: 'mark.map.context.menu.save.as.html' } } diff --git a/src/contextMenu/markMap/actions.js b/src/contextMenu/markMap/actions.js new file mode 100644 index 0000000..dafa9b6 --- /dev/null +++ b/src/contextMenu/markMap/actions.js @@ -0,0 +1,14 @@ +import bus from 'src/components/bus' +import events from 'src/constants/events' + +export const saveAsPNG = (menuItem, browserWindow) => { + bus.$emit(events.MARK_MAP_CONTEXT_MENU.saveAsPNG) +} + +export const saveAsSVG = (menuItem, browserWindow) => { + bus.$emit(events.MARK_MAP_CONTEXT_MENU.saveAsSVG) +} + +export const saveAsHTML = (menuItem, browserWindow) => { + bus.$emit(events.MARK_MAP_CONTEXT_MENU.saveAsHTML) +} diff --git a/src/contextMenu/markMap/index.js b/src/contextMenu/markMap/index.js new file mode 100644 index 0000000..5bc0d00 --- /dev/null +++ b/src/contextMenu/markMap/index.js @@ -0,0 +1,40 @@ +import { remote } from 'electron' +import { + // SAVE_AS_PNG, + // SAVE_AS_SVG, + SAVE_AS_HTML + // SEPARATOR +} from './menuItems' +import { i18n } from 'boot/i18n' +const { + Menu, + MenuItem +} = remote + +/** + * Show editor context menu. + * + * @param {MouseEvent} event The native mouse event. + */ +export const showContextMenu = (event) => { + const menu = new Menu() + const win = remote.getCurrentWindow() + const ITEMS = [SAVE_AS_HTML] + + const MENU_ITEM = ITEMS.map(item => { + if (item.type === 'separator') return item + return { + ...item, + label: i18n.t(item.label) + } + }) + + MENU_ITEM.forEach(item => { + menu.append(new MenuItem(item)) + }) + menu.popup([{ + window: win, + x: event.clientX, + y: event.clientY + }]) +} diff --git a/src/contextMenu/markMap/menuItems.js b/src/contextMenu/markMap/menuItems.js new file mode 100644 index 0000000..7bdaea6 --- /dev/null +++ b/src/contextMenu/markMap/menuItems.js @@ -0,0 +1,29 @@ +import * as contextMenu from './actions' + +export const SAVE_AS_PNG = { + label: 'saveAsPNG', + id: 'saveAsPNGMenuItem', + click (menuItem, browserWindow) { + contextMenu.saveAsPNG() + } +} + +export const SAVE_AS_SVG = { + label: 'saveAsSVG', + id: 'saveAsSVGMenuItem', + click (menuItem, browserWindow) { + contextMenu.saveAsSVG() + } +} + +export const SAVE_AS_HTML = { + label: 'saveAsHTML', + id: 'saveAsHTMLMenuItem', + click (menuItem, browserWindow) { + contextMenu.saveAsHTML() + } +} + +export const SEPARATOR = { + type: 'separator' +} diff --git a/src/contextMenu/muya/actions.js b/src/contextMenu/muya/actions.js index 2acf0b4..c246053 100644 --- a/src/contextMenu/muya/actions.js +++ b/src/contextMenu/muya/actions.js @@ -20,3 +20,7 @@ export const insertParagraph = location => { export const formatDocumentByPangu = (menuItem, browserWindow) => { bus.$emit(events.EDIT_SHORTCUT_CALL.formatDocumentByPangu) } + +export const generateMindmap = (menuItem, browserWindow) => { + bus.$emit(events.GENERATE_MINDMAP) +} diff --git a/src/contextMenu/muya/index.js b/src/contextMenu/muya/index.js index ea9da32..af3d92e 100644 --- a/src/contextMenu/muya/index.js +++ b/src/contextMenu/muya/index.js @@ -9,7 +9,8 @@ import { SEPARATOR, INSERT_BEFORE, INSERT_AFTER, - FORMAT_DOCUMENT_BY_PANGU + FORMAT_DOCUMENT_BY_PANGU, + GENERATE_MINDMAP } from './menuItems' import { i18n } from 'boot/i18n' @@ -32,7 +33,7 @@ export const showContextMenu = (event, selection) => { const menu = new Menu() const win = remote.getCurrentWindow() const disableCutAndCopy = start.key === end.key && start.offset === end.offset - const CONTEXT_ITEMS = [INSERT_BEFORE, INSERT_AFTER, SEPARATOR, CUT, COPY, PASTE, SEPARATOR, COPY_AS_MARKDOWN, COPY_AS_HTML, SEPARATOR, PASTE_AS_PLAIN_TEXT, FORMAT_DOCUMENT_BY_PANGU] + const CONTEXT_ITEMS = [INSERT_BEFORE, INSERT_AFTER, SEPARATOR, CUT, COPY, PASTE, SEPARATOR, COPY_AS_MARKDOWN, COPY_AS_HTML, SEPARATOR, PASTE_AS_PLAIN_TEXT, FORMAT_DOCUMENT_BY_PANGU, SEPARATOR, GENERATE_MINDMAP] const editActions = [CUT, COPY, COPY_AS_HTML, COPY_AS_MARKDOWN] editActions.forEach(item => { diff --git a/src/contextMenu/muya/menuItems.js b/src/contextMenu/muya/menuItems.js index 132971d..5c9ddf5 100644 --- a/src/contextMenu/muya/menuItems.js +++ b/src/contextMenu/muya/menuItems.js @@ -66,6 +66,14 @@ export const FORMAT_DOCUMENT_BY_PANGU = { } } +export const GENERATE_MINDMAP = { + label: 'generateMindmap', + id: 'generateMindmapMenuItem', + click (menuItem, browserWindow) { + contextMenu.generateMindmap() + } +} + export const SEPARATOR = { type: 'separator' } diff --git a/src/css/quasar.variables.sass b/src/css/quasar.variables.sass index 0932b9c..426e758 100644 --- a/src/css/quasar.variables.sass +++ b/src/css/quasar.variables.sass @@ -18,7 +18,7 @@ $accent : #9C27B0 $lightTheme: #21b56f -$dark : #1D1D1D +$dark : #35373e $positive : #21BA45 $negative : #C10015 diff --git a/src/css/style.css b/src/css/style.css index 4552396..296a1ad 100644 --- a/src/css/style.css +++ b/src/css/style.css @@ -9,7 +9,7 @@ /*滚动条滑块*/ ::-webkit-scrollbar-thumb { - /* border-radius: 10px; */ + border-radius: 10px; /* -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2); */ background: rgba(225, 231, 237, 0.75); } @@ -17,7 +17,7 @@ /*滚动条轨道*/ ::-webkit-scrollbar-track { -webkit-box-shadow: inset 0 0 1px rgba(0, 0, 0, 0); - /* border-radius: 10px; */ + border-radius: 10px; background: transparent; } @@ -37,7 +37,7 @@ body { /*background: #ffffff !important;*/ background: var(--backgroundColor); font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', - 'Microsoft YaHei', '微软雅黑', Arial, sans-serif; + 'Microsoft YaHei', '微软雅黑', Arial, sans-serif; } body.body { @@ -73,13 +73,13 @@ body.body--dark { font-size: 14px; } -div.ag-show-quick-insert-hint[contenteditable=false] { +div.ag-show-quick-insert-hint[contenteditable='false'] { /*background: green;*/ mso-foreground: #1c1c1c; } /*Note Item CSS*/ -.note-item, +/* .note-item, .note-item-dark { background-color: #ffffff; font-family: 'Open Sans', 'JetBrains Mono', Helvetica, Arial, sans-serif, 黑体; @@ -106,6 +106,11 @@ div.ag-show-quick-insert-hint[contenteditable=false] { .note-list-dark { background-color: #34383e; +} */ + +.active-note-item, +.active-note-item-dark { + background-color: var(--activeItemBgColor); } .note-list, @@ -134,6 +139,11 @@ div.ag-show-quick-insert-hint[contenteditable=false] { margin-bottom: 3px; } +.note-item-title.dense, +.note-item-title-dark.dense { + margin-bottom: 7px; +} + .note-item-summary, .note-item-summary-dark { font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif, Consolas; @@ -196,14 +206,35 @@ div.ag-show-quick-insert-hint[contenteditable=false] { color: #ffffff; } -body > div.q-dialog.fullscreen.no-pointer-events.q-dialog--modal > div.q-dialog__inner.flex.no-pointer-events.q-dialog__inner--minimized.q-dialog__inner--standard.fixed-full.flex-center > div > div.q-uploader.column.no-wrap.q-uploader--flat.no-shadow > div.q-uploader__header > div > div > div.q-uploader__subtitle{ +body + > div.q-dialog.fullscreen.no-pointer-events.q-dialog--modal + > div.q-dialog__inner.flex.no-pointer-events.q-dialog__inner--minimized.q-dialog__inner--standard.fixed-full.flex-center + > div + > div.q-uploader.column.no-wrap.q-uploader--flat.no-shadow + > div.q-uploader__header + > div + > div + > div.q-uploader__subtitle { display: none; } -body > div.q-dialog.fullscreen.no-pointer-events.q-dialog--modal > div.q-dialog__inner.flex.no-pointer-events.q-dialog__inner--minimized.q-dialog__inner--standard.fixed-full.flex-center > div > div.q-uploader.column.no-wrap.q-uploader--flat.no-shadow > div.q-uploader__list.scroll > div > div > div > div.q-uploader__subtitle.row.items-center.no-wrap { +body + > div.q-dialog.fullscreen.no-pointer-events.q-dialog--modal + > div.q-dialog__inner.flex.no-pointer-events.q-dialog__inner--minimized.q-dialog__inner--standard.fixed-full.flex-center + > div + > div.q-uploader.column.no-wrap.q-uploader--flat.no-shadow + > div.q-uploader__list.scroll + > div + > div + > div + > div.q-uploader__subtitle.row.items-center.no-wrap { display: none; } +.q-tree__node--selected { + background-color: var(--themeColor10) +} + .tag-tooltip { max-width: 500px; word-break: normal; @@ -216,7 +247,7 @@ body > div.q-dialog.fullscreen.no-pointer-events.q-dialog--modal > div.q-dialog_ display: inline-block; border-radius: 50%; background: var(--highlightThemeColor); - opacity: .7; + opacity: 0.7; visibility: hidden; } .save-dot.show { @@ -224,9 +255,9 @@ body > div.q-dialog.fullscreen.no-pointer-events.q-dialog--modal > div.q-dialog_ } .bg-light { - background-color: #1976D2; + background-color: #1976d2; } .bg-darkMode { - background-color: #F2c037; -} \ No newline at end of file + background-color: #f2c037; +} diff --git a/src/i18n/en-us/components/ui/SettingsDialog.js b/src/i18n/en-us/components/ui/SettingsDialog.js index 6cd37ea..2f2226a 100644 --- a/src/i18n/en-us/components/ui/SettingsDialog.js +++ b/src/i18n/en-us/components/ui/SettingsDialog.js @@ -17,6 +17,7 @@ export default { none: 'None (Use local file path)', orderByModifiedTime: 'Order by modified time', orderByNoteTitle: 'Order by note name', + noteListDenseMode: 'Note List Dense Mode', currentVersion: 'Current Version: {version}', getNewerVersion: 'New version detected: {version} !', update: 'Update', diff --git a/src/i18n/en-us/contextMenu/index.js b/src/i18n/en-us/contextMenu/index.js index 23d0357..a1ae651 100644 --- a/src/i18n/en-us/contextMenu/index.js +++ b/src/i18n/en-us/contextMenu/index.js @@ -1,6 +1,8 @@ import muya from './muya' import sideDrawer from './sideDrawer' +import markMap from './markMap' export default { ...muya, - ...sideDrawer + ...sideDrawer, + ...markMap } diff --git a/src/i18n/en-us/contextMenu/markMap.js b/src/i18n/en-us/contextMenu/markMap.js new file mode 100644 index 0000000..5f5b983 --- /dev/null +++ b/src/i18n/en-us/contextMenu/markMap.js @@ -0,0 +1,5 @@ +export default { + saveAsPNG: 'Save As PNG', + saveAsSVG: 'Save As SVG', + saveAsHTML: 'Save As HTML' +} diff --git a/src/i18n/en-us/contextMenu/muya.js b/src/i18n/en-us/contextMenu/muya.js index cd91e44..3bf41d0 100644 --- a/src/i18n/en-us/contextMenu/muya.js +++ b/src/i18n/en-us/contextMenu/muya.js @@ -7,5 +7,6 @@ export default { pasteAsPlainText: 'Paste As Plain Text', insertBefore: 'Insert Before', insertAfter: 'Insert After', - formatDocumentByPangu: 'Format Document' + formatDocumentByPangu: 'Format Document', + generateMindmap: 'Generate Mindmap' } diff --git a/src/i18n/en-us/other.js b/src/i18n/en-us/other.js index a6be9c4..93564f5 100644 --- a/src/i18n/en-us/other.js +++ b/src/i18n/en-us/other.js @@ -9,5 +9,12 @@ export default { sourceMode: 'Source Mode', previewMode: 'Preview Mode', lockModeOn: 'Keyboard Locked', - lockModeOff: 'Keyboard Unlocked' + lockModeOff: 'Keyboard Unlocked', + title: 'Title', + confirm: 'Confirm', + mindmap: 'Mindmap', + wordCount: 'Word Count', + 'word:': 'Words: {word}', + 'paragraph:': 'Paragraph: {paragraph}', + 'character:': 'Characters: {character}' } diff --git a/src/i18n/zh-cn/components/ui/SettingsDialog.js b/src/i18n/zh-cn/components/ui/SettingsDialog.js index efb3d83..2d7ab5b 100644 --- a/src/i18n/zh-cn/components/ui/SettingsDialog.js +++ b/src/i18n/zh-cn/components/ui/SettingsDialog.js @@ -19,6 +19,7 @@ export default { orderByNoteTitle: '按照笔记名称排序', currentVersion: '当前版本: {version}', getNewerVersion: '检查到最新版本: {version} !', + noteListDenseMode: '笔记列表简洁模式', update: '更新', checking: '检查更新中', noNewerVersion: '当前已是最新版本 !', diff --git a/src/i18n/zh-cn/contextMenu/index.js b/src/i18n/zh-cn/contextMenu/index.js index 23d0357..a1ae651 100644 --- a/src/i18n/zh-cn/contextMenu/index.js +++ b/src/i18n/zh-cn/contextMenu/index.js @@ -1,6 +1,8 @@ import muya from './muya' import sideDrawer from './sideDrawer' +import markMap from './markMap' export default { ...muya, - ...sideDrawer + ...sideDrawer, + ...markMap } diff --git a/src/i18n/zh-cn/contextMenu/markMap.js b/src/i18n/zh-cn/contextMenu/markMap.js new file mode 100644 index 0000000..fce846d --- /dev/null +++ b/src/i18n/zh-cn/contextMenu/markMap.js @@ -0,0 +1,5 @@ +export default { + saveAsPNG: '保存为 PNG', + saveAsSVG: '保存为 SVG', + saveAsHTML: '保存为 HTML' +} diff --git a/src/i18n/zh-cn/contextMenu/muya.js b/src/i18n/zh-cn/contextMenu/muya.js index 8b0ca5f..7479f52 100644 --- a/src/i18n/zh-cn/contextMenu/muya.js +++ b/src/i18n/zh-cn/contextMenu/muya.js @@ -7,5 +7,6 @@ export default { pasteAsPlainText: '以纯文本形式粘贴', insertBefore: '在此之前插入段落', insertAfter: '在此之后插入段落', - formatDocumentByPangu: '格式化文档' + formatDocumentByPangu: '格式化文档', + generateMindmap: '生成思维导图' } diff --git a/src/i18n/zh-cn/other.js b/src/i18n/zh-cn/other.js index 7be53dc..de3c1e7 100644 --- a/src/i18n/zh-cn/other.js +++ b/src/i18n/zh-cn/other.js @@ -9,5 +9,12 @@ export default { sourceMode: '源代码模式', previewMode: '预览模式', lockModeOn: '键盘输入已被锁定', - lockModeOff: '键盘锁定已被解除' + lockModeOff: '键盘锁定已被解除', + title: '标题', + confirm: '确认', + mindmap: '思维导图', + wordCount: '字数统计', + 'word:': '词: {word}', + 'paragraph:': '段落: {paragraph}', + 'character:': '字符: {character}' } diff --git a/src/libs/muya/lib/assets/styles/index.css b/src/libs/muya/lib/assets/styles/index.css index a002e3d..35b00b8 100644 --- a/src/libs/muya/lib/assets/styles/index.css +++ b/src/libs/muya/lib/assets/styles/index.css @@ -553,7 +553,7 @@ li.ag-task-list-item > input.ag-checkbox-checked::after { li.ag-task-list-item > input.ag-checkbox-checked::before { background: var(--themeColor); border-color: var(--themeColor); - box-shadow: 0 3px 12px 0 var(--selectionColor); + box-shadow: 0 3px 8px 0 var(--themeColor60); } /* li p .ag-hide:first-child { diff --git a/src/libs/muya/themes/default.css b/src/libs/muya/themes/default.css index 14c4959..7d1ed14 100644 --- a/src/libs/muya/themes/default.css +++ b/src/libs/muya/themes/default.css @@ -7,7 +7,7 @@ font-style: normal; font-weight: 300; src: local('Open Sans Light'), local('OpenSans-Light'), - url('./fonts/open-sans-v15-latin_latin-ext-300.woff') format('woff'); + url('./fonts/open-sans-v15-latin_latin-ext-300.woff') format('woff'); } @font-face { @@ -15,7 +15,7 @@ font-style: italic; font-weight: 300; src: local('Open Sans Light Italic'), local('OpenSans-LightItalic'), - url('./fonts/open-sans-v15-latin_latin-ext-300italic.woff') format('woff'); + url('./fonts/open-sans-v15-latin_latin-ext-300italic.woff') format('woff'); } @font-face { @@ -23,7 +23,7 @@ font-style: normal; font-weight: 400; src: local('Open Sans Regular'), local('OpenSans-Regular'), - url('./fonts/open-sans-v15-latin_latin-ext-regular.woff') format('woff'); + url('./fonts/open-sans-v15-latin_latin-ext-regular.woff') format('woff'); } @font-face { @@ -31,7 +31,7 @@ font-style: italic; font-weight: 400; src: local('Open Sans Italic'), local('OpenSans-Italic'), - url('./fonts/open-sans-v15-latin_latin-ext-italic.woff') format('woff'); + url('./fonts/open-sans-v15-latin_latin-ext-italic.woff') format('woff'); } @font-face { @@ -39,7 +39,7 @@ font-style: normal; font-weight: 600; src: local('Open Sans SemiBold'), local('OpenSans-SemiBold'), - url('./fonts/open-sans-v15-latin_latin-ext-600.woff') format('woff'); + url('./fonts/open-sans-v15-latin_latin-ext-600.woff') format('woff'); } @font-face { @@ -47,7 +47,7 @@ font-style: italic; font-weight: 600; src: local('Open Sans SemiBold Italic'), local('OpenSans-SemiBoldItalic'), - url('./fonts/open-sans-v15-latin_latin-ext-600italic.woff') format('woff'); + url('./fonts/open-sans-v15-latin_latin-ext-600italic.woff') format('woff'); } @font-face { @@ -55,7 +55,7 @@ font-style: normal; font-weight: 700; src: local('Open Sans Bold'), local('OpenSans-Bold'), - url('./fonts/open-sans-v15-latin_latin-ext-700.woff') format('woff'); + url('./fonts/open-sans-v15-latin_latin-ext-700.woff') format('woff'); } @font-face { @@ -63,45 +63,45 @@ font-style: italic; font-weight: 700; src: local('Open Sans Bold Italic'), local('OpenSans-BoldItalic'), - url('./fonts/open-sans-v15-latin_latin-ext-700italic.woff') format('woff'); + url('./fonts/open-sans-v15-latin_latin-ext-700italic.woff') format('woff'); } /* * DejaVu Sans Mono */ @font-face { - font-family: "DejaVu Sans Mono"; + font-family: 'DejaVu Sans Mono'; src: local('DejaVu Sans Mono'), url('./fonts/DejaVuSansMono.ttf'); } @font-face { - font-family: "DejaVu Sans Mono"; + font-family: 'DejaVu Sans Mono'; font-weight: bold; src: url('./fonts/DejaVuSansMono-Bold.ttf'); } @font-face { - font-family: "DejaVu Sans Mono"; + font-family: 'DejaVu Sans Mono'; font-style: oblique; font-weight: bold; src: url('./fonts/DejaVuSansMono-BoldOblique.ttf'); } @font-face { - font-family: "DejaVu Sans Mono"; + font-family: 'DejaVu Sans Mono'; font-style: italic; font-weight: bold; src: url('./fonts/DejaVuSansMono-BoldOblique.ttf'); } @font-face { - font-family: "DejaVu Sans Mono"; + font-family: 'DejaVu Sans Mono'; font-style: italic; src: url('./fonts/DejaVuSansMono-Oblique.ttf'); } @font-face { - font-family: "DejaVu Sans Mono"; + font-family: 'DejaVu Sans Mono'; font-style: oblique; src: url('./fonts/DejaVuSansMono-Oblique.ttf'); } @@ -110,35 +110,35 @@ * JetBrains Mono */ @font-face { - font-family: "JetBrains Mono"; + font-family: 'JetBrains Mono'; font-style: normal; font-weight: 300; src: local('JetBrains Mono Light'), - url('./fonts/JetBrainsMono-Light.woff2') format('woff'); + url('./fonts/JetBrainsMono-Light.woff2') format('woff'); } @font-face { - font-family: "JetBrains Mono"; + font-family: 'JetBrains Mono'; font-style: italic; font-weight: 300; src: local('JetBrains Mono Light Italic'), - url('./fonts/JetBrainsMono-LightItalic.woff2') format('woff'); + url('./fonts/JetBrainsMono-LightItalic.woff2') format('woff'); } @font-face { - font-family: "JetBrains Mono"; + font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400; src: local('JetBrains Mono Regular'), - url('./fonts/JetBrainsMono-Regular.woff2') format('woff'); + url('./fonts/JetBrainsMono-Regular.woff2') format('woff'); } @font-face { - font-family: "JetBrains Mono"; + font-family: 'JetBrains Mono'; font-style: italic; font-weight: 300; src: local('JetBrains Mono Regular Italic'), - url('./fonts/JetBrainsMono-Italic.woff2') format('woff'); + url('./fonts/JetBrainsMono-Italic.woff2') format('woff'); } @font-face { @@ -146,15 +146,15 @@ font-style: normal; font-weight: 600; src: local('JetBrains Mono Medium'), - url('./fonts/JetBrainsMono-Medium.woff2') format('woff'); + url('./fonts/JetBrainsMono-Medium.woff2') format('woff'); } @font-face { - font-family: "JetBrains Mono"; + font-family: 'JetBrains Mono'; font-style: italic; font-weight: 300; src: local('JetBrains Mono Medium Italic'), - url('./fonts/JetBrainsMono-MediumItalic.woff2') format('woff'); + url('./fonts/JetBrainsMono-MediumItalic.woff2') format('woff'); } @font-face { @@ -162,20 +162,21 @@ font-style: normal; font-weight: 700; src: local('JetBrains Mono Bold'), - url('./fonts/JetBrainsMono-Bold.woff2') format('woff'); + url('./fonts/JetBrainsMono-Bold.woff2') format('woff'); } @font-face { - font-family: "JetBrains Mono"; + font-family: 'JetBrains Mono'; font-style: italic; font-weight: 300; src: local('JetBrains Mono Bold Italic'), - url('./fonts/JetBrainsMono-BoldItalic.woff2') format('woff'); + url('./fonts/JetBrainsMono-BoldItalic.woff2') format('woff'); } - #ag-editor-id { - font-family: "Open Sans", "JetBrains Mono", "Clear Sans", "Helvetica Neue", Fira Code, Monaco, PingFang SC, Hiragino Sans GB, 微软雅黑, Arial, sans-serif, Microsoft YaHei, Helvetica, Arial, sans-serif; + font-family: 'Open Sans', 'JetBrains Mono', 'Clear Sans', 'Helvetica Neue', + Fira Code, Monaco, PingFang SC, Hiragino Sans GB, 微软雅黑, Arial, + sans-serif, Microsoft YaHei, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 1.6; letter-spacing: 0.2px; @@ -186,10 +187,11 @@ span code, td code, th code, code, -code[class*="language-"], +code[class*='language-'], .CodeMirror, pre.ag-paragraph { - font-family: "JetBrains Mono", "DejaVu Sans Mono", "Source Code Pro", "Droid Sans Mono", Consolas, monospace; + font-family: 'JetBrains Mono', 'DejaVu Sans Mono', 'Source Code Pro', + 'Droid Sans Mono', Consolas, monospace; font-size: 14px; } @@ -199,13 +201,12 @@ kbd { border: 1px solid var(--floatBorderColor); border-radius: 4px; display: inline-block; - font-size: .8em; + font-size: 0.8em; padding: 0px 5px; box-shadow: inset 0 -1px 0 var(--floatBorderColor); } @media not print { - #ag-editor-id { max-width: 80%; min-width: 400px; @@ -215,7 +216,8 @@ kbd { box-sizing: border-box; } - #ag-editor-id, [contenteditable] { + #ag-editor-id, + [contenteditable] { outline: none; } @@ -225,7 +227,7 @@ kbd { } .ag-header-tight-space { - margin-left: -.3em; + margin-left: -0.3em; } .ag-image-src { @@ -465,11 +467,14 @@ kbd { table { padding: 0; word-break: initial; + box-shadow: 0 1px 5px rgb(0 0 0 / 20%), 0 2px 2px rgb(0 0 0 / 14%), + 0 3px 1px -2px rgb(0 0 0 / 12%); } table tr { margin: 0; padding: 0; + border-radius: 4px; } /* table thead tr, @@ -491,6 +496,15 @@ kbd { position: relative; } + table tr th::before { + border: 1px solid var(--tableBorderColor); + } + table tr td::before { + border-bottom: 1px solid var(--tableBorderColor); + border-left: 1px solid var(--tableBorderColor); + border-right: 1px solid var(--tableBorderColor); + } + table tr th::before, table tr td::before { content: ''; @@ -501,7 +515,6 @@ kbd { right: 0; width: calc(100% + 1px); height: calc(100% + 1px); - border: 1px solid var(--tableBorderColor); box-sizing: border-box; pointer-events: none; } @@ -528,7 +541,7 @@ kbd { border: 1px solid var(--iconColor); left: -11px; cursor: pointer; - opacity: .5; + opacity: 0.5; } table tr .ag-drag-handler.left::before, @@ -548,7 +561,6 @@ kbd { top: 10px; } - table tr .ag-drag-handler.bottom { position: absolute; left: 50%; @@ -561,7 +573,7 @@ kbd { border: 1px solid var(--iconColor); bottom: -15px; cursor: pointer; - opacity: .5; + opacity: 0.5; } table tr .ag-drag-handler.bottom::before, @@ -591,10 +603,10 @@ kbd { } table .ag-drag-cell { - opacity: .7; + opacity: 0.7; z-index: 1; background: var(--floatBgColor); - transition: left .3s ease-in-out, bottom .3s ease-in-out; + transition: left 0.3s ease-in-out, bottom 0.3s ease-in-out; } table .ag-drag-cell.ag-drag-left { @@ -606,7 +618,7 @@ kbd { } table .ag-cell-transform { - transition: transform .3s ease-in-out; + transition: transform 0.3s ease-in-out; } table .ag-cell-selected::before { @@ -644,9 +656,9 @@ kbd { color: var(--editorColor); } - :not(pre) > code[class*="language-"], + :not(pre) > code[class*='language-'], pre:not(.CodeMirror-line), - pre[class*="language-"], + pre[class*='language-'], pre.ag-paragraph { overflow: visible; font-size: 90%; @@ -681,7 +693,7 @@ kbd { #ag-editor-id pre.ag-html-block { background: transparent; - padding: 0 .5rem; + padding: 0 0.5rem; margin-top: 0; } @@ -704,7 +716,8 @@ kbd { background-size: cover; } - .ag-inline-image.ag-image-success .ag-image-marked-text.ag-image-fail::before { + .ag-inline-image.ag-image-success + .ag-image-marked-text.ag-image-fail::before { background-image: url(../lib/assets/icons/image_dark_fail.png); background-size: cover; } @@ -750,34 +763,34 @@ kbd { } /* cover default flowchart.js and sequence style */ -figure[data-role] svg rect[fill="#ffffff"] { +figure[data-role] svg rect[fill='#ffffff'] { fill: var(--editorBgColor); } -figure[data-role] svg rect[stroke="#000000"] { +figure[data-role] svg rect[stroke='#000000'] { stroke: var(--editorColor); } -figure[data-role] svg text[fill="#000000"] { +figure[data-role] svg text[fill='#000000'] { fill: var(--editorColor); } -figure[data-role] svg path[stroke="#000000"] { +figure[data-role] svg path[stroke='#000000'] { stroke: var(--editorColor); } -figure[data-role] svg path[fill="#ffffff"] { +figure[data-role] svg path[fill='#ffffff'] { fill: var(--editorBgColor); } -figure[data-role] svg path[fill="#000000"] { +figure[data-role] svg path[fill='#000000'] { fill: var(--editorColor); } -figure[data-role] svg use[fill="black"] { +figure[data-role] svg use[fill='black'] { fill: var(--editorColor); } -figure[data-role] svg use[fill="#000000"] { +figure[data-role] svg use[fill='#000000'] { fill: var(--editorColor); } diff --git a/src/pages/Index.vue b/src/pages/Index.vue index a08dc4b..953cdca 100644 --- a/src/pages/Index.vue +++ b/src/pages/Index.vue @@ -22,7 +22,7 @@
- + + + +
+

+ {{ `${$t('word:', wordCount)}` }} +

+

+ {{ `${$t('character:', wordCount)}` }} +

+

+ {{ `${$t('paragraph:', wordCount)}` }} +

+
+
+
+ @@ -119,6 +153,7 @@ import NoteOutlineDrawer from 'components/ui/NoteOutlineDrawer' import Loading from 'components/ui/Loading' import Monaco from 'components/ui/editor/Monaco' import Muya from 'components/ui/editor/Muya' +import MarkMapDialog from '../components/ui/dialog/MarkMapDialog' const { mapGetters: mapServerGetters, @@ -129,6 +164,7 @@ const { mapState: mapClientState, mapActions: mapClientActions } = createNamespa export default { name: 'PageIndex', components: { + MarkMapDialog, Muya, Monaco, Loading, @@ -139,14 +175,14 @@ export default { thumbStyle () { return { backgroundColor: '#E8ECF1', - width: '7px', + width: '5px', opacity: 0.75 } }, barStyle () { return { - width: '7px' + width: '5px' } }, dataLoaded: function () { @@ -168,7 +204,13 @@ export default { splitterModel: 300, isOutlineShow: false, isSourceMode: false, - tempNoteData: {} + isMindmapMode: false, + tempNoteData: {}, + wordCount: { + word: '0', + paragraph: '0', + character: '0' + } } }, methods: { @@ -181,6 +223,26 @@ export default { sourceModeHandler: function () { this.isSourceMode = !this.isSourceMode }, + getTempValue: function () { + let markdown + if (this.isSourceMode) { + markdown = this.$refs.monaco?.getValue() + } else { + markdown = this.$refs.muya?.getValue() + } + return markdown + }, + generateMindmapHandler: function () { + const markdown = this.getTempValue() + this.$refs.markMapDialog.toggle(markdown) + }, + wordCountUpdateHandler: function (wordCount) { + this.wordCount = Object.assign({ + word: '', + paragraph: '', + character: '' + }, wordCount) + }, editorScrollHandler: function (e) { bus.$emit(events.EDITOR_SCROLL, e) }, @@ -200,10 +262,12 @@ export default { mounted () { bus.$on(events.VIEW_SHORTCUT_CALL.lockMode, this.lockModeHandler) bus.$on(events.VIEW_SHORTCUT_CALL.sourceMode, this.sourceModeHandler) + bus.$on(events.GENERATE_MINDMAP, this.generateMindmapHandler) + bus.$on(events.UPDATE_WORD_COUNT, this.wordCountUpdateHandler) }, watch: { - isSourceMode: function (val, oldVal) { - if (oldVal) { + isSourceMode: function (val) { + if (!val) { this.tempNoteData = { markdown: this.$refs.monaco.getValue(), cursor: this.$refs.monaco.getCursorPosition() diff --git a/src/store/client/actions.js b/src/store/client/actions.js index 2ea1c73..68a727d 100644 --- a/src/store/client/actions.js +++ b/src/store/client/actions.js @@ -13,11 +13,6 @@ export default { commit(types.INIT, localStore) Dark.set(state.darkMode) }, - toggleDarkMode ({ commit }, darkMode) { - commit(types.TOGGLE_DARK_MODE, darkMode) - Dark.set(darkMode) - commit(types.SAVE_TO_LOCAL_STORE_SYNC, ['darkMode', darkMode]) - }, toggleChanged ({ commit }, { key, value }) { commit(types.TOGGLE_CHANGED, { key, value }) commit(types.SAVE_TO_LOCAL_STORE_SYNC, [key, value]) diff --git a/src/store/client/state.js b/src/store/client/state.js index a905f08..be601d0 100644 --- a/src/store/client/state.js +++ b/src/store/client/state.js @@ -4,6 +4,7 @@ export default function () { autoLogin: false, rememberPassword: true, darkMode: false, + noteListDenseMode: false, markdownOnly: false, enableSelfHostServer: false, imageUploadService: 'wizOfficialImageUploadService', diff --git a/src/store/server/actions.js b/src/store/server/actions.js index 98fbd82..83dd197 100644 --- a/src/store/server/actions.js +++ b/src/store/server/actions.js @@ -6,8 +6,16 @@ import { i18n } from 'boot/i18n' import ClientFileStorage from 'src/utils/storage/ClientFileStorage' import ServerFileStorage from 'src/utils/storage/ServerFileStorage' import _ from 'lodash' -import { exportMarkdownFile, exportMarkdownFiles, saveTempImage, uploadImages, exportPng } from 'src/ApiInvoker' +import { + exportMarkdownFile, + exportMarkdownFiles, + saveTempImage, + uploadImages, + exportPng, + exportFile +} from 'src/ApiInvoker' import html2canvas from 'html2canvas' +import debugLogger from 'src/utils/debugLogger' export async function _getContent (kbGuid, docGuid) { const { info } = await api.KnowledgeBaseApi.getNoteContent({ @@ -215,8 +223,9 @@ export default { }) { commit(types.UPDATE_CURRENT_NOTES_LOADING_STATE, true) const { kbGuid } = state - const result = await api.KnowledgeBaseApi.getCategories({ kbGuid }) - commit(types.UPDATE_ALL_CATEGORIES, result) + const res = await api.KnowledgeBaseApi.getCategories({ kbGuid }) + commit(types.UPDATE_ALL_CATEGORIES, res.result) + commit(types.UPDATE_CATEGORIES_POS, res.pos) commit(types.UPDATE_CURRENT_NOTES_LOADING_STATE, false) }, /** @@ -231,10 +240,14 @@ export default { state }, payload) { commit(types.UPDATE_CURRENT_NOTE_LOADING_STATE, true) + // Loading.show({ + // spinner: QSpinner, + // delay: 400 + // }) const { kbGuid } = state const { docGuid } = payload const result = await _getContent(kbGuid, docGuid) - + Loading.hide() commit(types.UPDATE_CURRENT_NOTE_LOADING_STATE, false) commit(types.UPDATE_CURRENT_NOTE, result) }, @@ -834,7 +847,8 @@ export default { } Loading.show({ spinner: QSpinnerGears, - message: i18n.t('prepareExportData') + message: i18n.t('prepareExportData'), + delay: 400 }) const result = await _getContent(kbGuid, docGuid) const title = result.info.title.split('.')[0] @@ -857,9 +871,18 @@ export default { Loading.hide() await exportMarkdownFile({ content, title }) }, + /** + * 导出为png + * @param state + * @param noteField + * @param current + * @param elementId + * @returns {Promise} + */ async exportPng ({ state }, { noteField, - current + current, + elementId = 'ag-editor-id' }) { const { kbGuid, @@ -875,12 +898,14 @@ export default { } const result = await _getContent(kbGuid, docGuid) const title = result.info.title.split('.')[0] + // const title = _.endsWith(result.info.title, '.md') ? result.info.title.replace('.md') : result.info.title if (_.isEmpty(currentNote)) return Loading.show({ spinner: QSpinnerGears, - message: i18n.t('prepareExportData') + message: i18n.t('prepareExportData'), + delay: 400 }) - const canvasID = document.getElementById('ag-editor-id') + const canvasID = document.getElementById(elementId) const color = Dark.isActive html2canvas(canvasID, { useCORS: true, @@ -893,8 +918,24 @@ export default { const content = dom.toDataURL('image/png') Loading.hide() exportPng({ content, title }) + }).catch(e => { + debugLogger.Error(e) + Loading.hide() }) }, + async exportFile ({ state }, { + content, + fileName, + fileType + }) { + fileName = fileName.split('.')[0] + // fileName = _.endsWith(fileName, '.md') ? fileName.replace('.md') : fileName + exportFile({ + content, + fileName, + fileType + }).then() + }, /** * 批量导出markdown笔记到本地 * @param state @@ -909,7 +950,8 @@ export default { const results = [] Loading.show({ spinner: QSpinnerGears, - message: i18n.t('prepareExportData') + message: i18n.t('prepareExportData'), + delay: 400 }) for (const noteField of noteFields) { const { docGuid } = noteField diff --git a/src/store/server/getters.js b/src/store/server/getters.js index ce8e190..06f1477 100644 --- a/src/store/server/getters.js +++ b/src/store/server/getters.js @@ -84,8 +84,8 @@ export default { } = currentNote return `${api.KnowledgeBaseApi.getBaseUrl()}/${kbGuid}/${docGuid}` }, - categories: ({ categories }) => { - return helper.generateCategoryNodeTree(categories) + categories: ({ categories, categoriesPos }) => { + return helper.generateCategoryNodeTree(categories, categoriesPos) }, tags: ({ tags }) => { return helper.generateTagNodeTree(tags) diff --git a/src/store/server/mutations.js b/src/store/server/mutations.js index 29535b9..2f3fcbb 100644 --- a/src/store/server/mutations.js +++ b/src/store/server/mutations.js @@ -67,6 +67,10 @@ export default { state.categories = payload return state }, + [types.UPDATE_CATEGORIES_POS] (state, payload) { + state.categoriesPos = payload + return state + }, [types.UPDATE_CURRENT_CATEGORY] (state, category) { state.currentCategory = category return state diff --git a/src/store/server/state.js b/src/store/server/state.js index eec74b7..b906692 100644 --- a/src/store/server/state.js +++ b/src/store/server/state.js @@ -12,6 +12,7 @@ export default function () { isCurrentNoteLoading: false, // current notes list loading state, isCurrentNotesLoading: false, // current notes loading state, categories: [], + categoriesPos: {}, currentCategory: '', uploadImageUrl: '', contentsList: [], diff --git a/src/store/server/types.js b/src/store/server/types.js index 0a2edc4..20a6e90 100644 --- a/src/store/server/types.js +++ b/src/store/server/types.js @@ -7,6 +7,7 @@ export default { INIT: 'init', SAVE_TO_LOCAL_STORE_SYNC: 'save_to_local_store_sync', UPDATE_ALL_CATEGORIES: 'update_all_categories', + UPDATE_CATEGORIES_POS: 'update_categoies_pos', UPDATE_CURRENT_CATEGORY: 'update_current_category', UPDATE_CURRENT_NOTE_LOADING_STATE: 'update_current_note_loading_state', UPDATE_CURRENT_NOTES_LOADING_STATE: 'update_current_notes_loading_state', diff --git a/src/utils/api.js b/src/utils/api.js index b8881c4..e4017a8 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -98,7 +98,11 @@ const KnowledgeBaseApi = { async getCategories (params) { return await execRequest( 'GET', - `${this.getBaseUrl()}/ks/category/all/${params.kbGuid}` + `${this.getBaseUrl()}/ks/category/all/${params.kbGuid}`, + {}, + null, + {}, + true ) }, @@ -127,8 +131,7 @@ const KnowledgeBaseApi = { `${this.getBaseUrl()}/ks/note/download/${params.kbGuid}/${params.docGuid}`, null, null, - { params: params.data }, - true + { params: params.data } ) }, @@ -255,8 +258,7 @@ const KnowledgeBaseApi = { `${this.getBaseUrl()}/ks/note/search/${params.kbGuid}`, null, null, - { params: params.data }, - true + { params: params.data } ) }, @@ -382,29 +384,6 @@ const ThirdPartApi = { } } -const AnalysisApi = { - async uploadNoteInfo (noteInfo) { - // TODO - }, - async uploadUserInfo (userInfo) { - // TODO - }, - async uploadUserSettings (settings) { - // TODO - }, - async uploadNoteContent (noteContent) { - // TODO - }, - async uploadCategoryInfo (categoryInfo) { - // TODO - }, - async uploadStartTime (startTime) { - // TODO - }, - async uploadRunningDuration (duration) { - // TODO - } -} /** * Upload image to image service * @param type @@ -434,6 +413,5 @@ export default { AccountServerApi, KnowledgeBaseApi, ThirdPartApi, - AnalysisApi, UploadImageApi } diff --git a/src/utils/helper.js b/src/utils/helper.js index 1948361..aef7eee 100644 --- a/src/utils/helper.js +++ b/src/utils/helper.js @@ -176,8 +176,9 @@ function wizIsPredefinedLocation (strLocation) { /** * generate categories tree * @param {string[] | string[][]} categories + * @param {{}} categoriesPos */ -function generateCategoryNodeTree (categories) { +function generateCategoryNodeTree (categories, categoriesPos) { const result = [] categories = categories || [] categories = categories.map(category => { @@ -207,6 +208,13 @@ function generateCategoryNodeTree (categories) { selectable: true, key: `/${category[0]}/` }) + result.sort((c1, c2) => { + if (categoriesPos[c1.key] && categoriesPos[c2.key]) { + return categoriesPos[c1.key] - categoriesPos[c2.key] + } else { + return c1.originLabel.localeCompare(c2.originLabel) + } + }) continue } const rootNodeIndex = result.findIndex(c => c.originLabel === category[0]) @@ -225,6 +233,13 @@ function generateCategoryNodeTree (categories) { selectable: true, key: nodeKey }) + rootNode.children.sort((c1, c2) => { + if (categoriesPos[c1.key] && categoriesPos[c2.key]) { + return categoriesPos[c1.key] - categoriesPos[c2.key] + } else { + return c1.originLabel.localeCompare(c2.originLabel) + } + }) } return result } diff --git a/src/utils/storage/BaseFileStorage.js b/src/utils/storage/BaseFileStorage.js index f340c5d..5aac3a0 100644 --- a/src/utils/storage/BaseFileStorage.js +++ b/src/utils/storage/BaseFileStorage.js @@ -88,11 +88,7 @@ class BaseFileStorage { if (note.info.dataModified === dataModified) { note.info = info this.setCachedNote(note, cacheKey, note.cachedDate) - const now = new Date().getTime() - // 没有资源文件的时候直接返回缓存,如果有资源文件但是缓存时间小于五分钟的也可以使用缓存 - if ((note.resources && note.resources.length === 0) || (note.cachedDate && now - note.cachedDate < 5 * 60 * 1000)) { - return note - } + return note } else { this.removeItemFromStore(cacheKey) } diff --git a/src/utils/themeColor.js b/src/utils/themeColor.js index 494773c..5509cd5 100644 --- a/src/utils/themeColor.js +++ b/src/utils/themeColor.js @@ -5,18 +5,18 @@ const oneDarkTheme = `:root { --backgroundColor: #35373e; --editorAreaWidth: 90%; - + --activeItemBgColor: rgb(41, 42, 44); /*editor*/ - --themeColor: #409eff; - --themeColor90: rgba(64, 158, 255, .9); - --themeColor80: rgba(64, 158, 255, .8); - --themeColor70: rgba(64, 158, 255, .7); - --themeColor60: rgba(64, 158, 255, .6); - --themeColor50: rgba(64, 158, 255, .5); - --themeColor40: rgba(64, 158, 255, .4); - --themeColor30: rgba(64, 158, 255, .3); - --themeColor20: rgba(64, 158, 255, .2); - --themeColor10: rgba(64, 158, 255, .1); + --themeColor: rgb(242, 192, 55); + --themeColor90: rgba(242, 192, 55, .9); + --themeColor80: rgba(242, 192, 55, .8); + --themeColor70: rgba(242, 192, 55, .7); + --themeColor60: rgba(242, 192, 55, .6); + --themeColor50: rgba(242, 192, 55, .5); + --themeColor40: rgba(242, 192, 55, .4); + --themeColor30: rgba(242, 192, 55, .3); + --themeColor20: rgba(242, 192, 55, .2); + --themeColor10: rgba(242, 192, 55, .1); --highlightColor: rgba(102, 177, 255, .6); --selectionColor: rgba(70, 122, 189, .7); @@ -138,6 +138,11 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + #mind code { + color: inherit; + background: transparent; + } + code[class*="language-"], pre.ag-paragraph { color: #ABB2BF; @@ -155,7 +160,6 @@ pre.ag-paragraph { -moz-hyphens: none; -ms-hyphens: none; hyphens: none; - overflow: visible; font-family: JetBrains Mono; } @@ -256,20 +260,21 @@ const lightTheme = `/* Common CSS use by both light and dark themes */ --titleBarHeight: 32px; --editorAreaWidth: 90%; --backgroundColor: #ffffff; + --activeItemBgColor: rgb(204, 207, 214); /*editor*/ /*Theme color cluster*/ - --themeColor: rgba(33, 181, 111, 1); - --themeColor90: rgba(33, 181, 111, .9); - --themeColor80: rgba(33, 181, 111, .8); - --themeColor70: rgba(33, 181, 111, .7); - --themeColor60: rgba(33, 181, 111, .6); - --themeColor50: rgba(33, 181, 111, .5); - --themeColor40: rgba(33, 181, 111, .4); - --themeColor30: rgba(33, 181, 111, .3); - --themeColor20: rgba(33, 181, 111, .2); - --themeColor10: rgba(33, 181, 111, .1); - - --highlightColor: rgba(33, 181, 111, .4); + --themeColor: rgba(25, 118, 210, 1); + --themeColor90: rgba(25, 118, 210, .9); + --themeColor80: rgba(25, 118, 210, .8); + --themeColor70: rgba(25, 118, 210, .7); + --themeColor60: rgba(25, 118, 210, .6); + --themeColor50: rgba(25, 118, 210, .5); + --themeColor40: rgba(25, 118, 210, .4); + --themeColor30: rgba(25, 118, 210, .3); + --themeColor20: rgba(25, 118, 210, .2); + --themeColor10: rgba(25, 118, 210, .1); + + --highlightColor: rgba(25, 118, 210, .4); --selectionColor: #DAE3E9; --editorColor: rgba(0, 0, 0, .7); --editorColor80: rgba(0, 0, 0, .8); @@ -315,6 +320,11 @@ const lightPrismTheme = `/* * Prism.js light theme */ + #mind code { + color: inherit; + background: transparent; + } + code[class*="language-"], pre.ag-paragraph { color: black; @@ -327,7 +337,7 @@ pre.ag-paragraph { -moz-tab-size: 4; -o-tab-size: 4; tab-size: 4; - + text-shadow: none; -webkit-hyphens: none; -moz-hyphens: none; -ms-hyphens: none;