TagSpaces is an offline, open source, document manager with tagging support
merging master branch
Stanimir53e6f33e7988
diff --cc app/perspectives/grid-perspective/components/GridPagination.tsxindex 8dba5320e,149ec578a..7f6bbbec1--- a/app/perspectives/grid-perspective/components/GridPagination.tsx+++ b/app/perspectives/grid-perspective/components/GridPagination.tsx@@@ -16,8 -16,9 +16,8 @@@**/- import React, { useEffect, useRef } from 'react';+ import React, { useEffect, useReducer, useRef } from 'react';import { connect } from 'react-redux';-import { alpha } from '@mui/material/styles';import Typography from '@mui/material/Typography';import Tooltip from '-/components/Tooltip';import Grid from '@mui/material/Grid';@@@ -104,28 -93,7 +105,29 @@@ interface PropsselectedEntries; // cache only// setMetaForCurrentDir: (metaFiles: Array<any>) => void;lastBackgroundImageChange: number;+ lastThumbnailImageChange: number;+ setSelectedEntries: (selectedEntries: Array<TS.FileSystemEntry>) => void;+ singleClickAction: string;+ currentLocation: TS.Location;+ lastSelectedEntry: any;+ directoryContent: Array<TS.FileSystemEntry>;+ supportedFileTypes: Array<any>;+ openFsEntry: (fsEntry?: TS.FileSystemEntry) => void;+ openFileNatively: (path?: string) => void;+ loadDirectoryContent: (+ path: string,+ generateThumbnails: boolean,+ loadDirMeta?: boolean+ ) => void;+ setFileContextMenuAnchorEl: (HTMLElement) => void;+ setDirContextMenuAnchorEl: (HTMLElement) => void;+ showNotification: (+ text: string,+ notificationType: string,+ autohide: boolean+ ) => void;+ moveFiles: (files: Array<string>, destination: string) => Promise<boolean>;+ clearSelection: () => void;}function GridPagination(props: Props) {@@@ -342,32 -337,47 +371,34 @@@PlatformIO.getDirSeparator());- let folderTmbPath = getThumbFileLocationForDirectory(- currentDirectoryPath,- PlatformIO.getDirSeparator()- );- if (PlatformIO.haveObjectStoreSupport() || PlatformIO.haveWebDavSupport()) {- folderTmbPath = PlatformIO.getURLforPath(folderTmbPath);- } else {- folderTmbPath =- normalizeUrl(folderTmbPath) +- (props.lastBackgroundImageChange- ? '?' + props.lastBackgroundImageChange- : '');- /**- * normalize path for URL is always '/'- * TODO move this in common module- */- function normalizeUrl(url: string) {- if (PlatformIO.getDirSeparator() !== '/') {- if (url) {- return url.replaceAll(PlatformIO.getDirSeparator(), '/');- }- }- return url;- }-+ function getFolderThumbPath(path: string, lastThumbnailImageChange: number) {+ let tmbPath = getThumbFileLocationForDirectory(+ path,+ PlatformIO.getDirSeparator()+ );+ if (PlatformIO.haveObjectStoreSupport() || PlatformIO.haveWebDavSupport()) {+ tmbPath = PlatformIO.getURLforPath(tmbPath);+ } else {+ tmbPath =+ normalizeUrl(tmbPath) ++ (lastThumbnailImageChange ? '?' + lastThumbnailImageChange : '');+ }+ return tmbPath;}- let folderBgndPath = getBgndFileLocationForDirectory(- currentDirectoryPath,- PlatformIO.getDirSeparator()- );- if (PlatformIO.haveObjectStoreSupport() || PlatformIO.haveWebDavSupport()) {- folderBgndPath = PlatformIO.getURLforPath(folderBgndPath);- } else {- folderBgndPath =- normalizeUrl(folderBgndPath) +- (props.lastBackgroundImageChange- ? '?' + props.lastBackgroundImageChange- : '');+ function getFolderBgndPath(path: string, lastBackgroundImageChange: number) {+ let bgndPath = getBgndFileLocationForDirectory(+ path,+ PlatformIO.getDirSeparator()+ );+ if (PlatformIO.haveObjectStoreSupport() || PlatformIO.haveWebDavSupport()) {+ bgndPath = PlatformIO.getURLforPath(bgndPath);+ } else {+ bgndPath =+ normalizeUrl(bgndPath) ++ (lastBackgroundImageChange ? '?' + lastBackgroundImageChange : '');+ }+ return bgndPath;}const dirColor = currentDirectoryColor || 'transparent';@@@ -378,18 -388,18 +409,17 @@@if (showDescription && currentDirectoryDescription) {descriptionHTML = convertMarkDown(currentDirectoryDescription,- currentDirectoryPath+ props.currentDirectoryPath);}-+ */let descriptionPreview = '';if (currentDirectoryDescription) {- descriptionPreview = removeMarkDown(currentDirectoryDescription);- if (descriptionPreview && descriptionPreview.length > 200) {- descriptionPreview = descriptionPreview.substring(0, 200) + '...';- }+ descriptionPreview = getDescriptionPreview(+ currentDirectoryDescription,+ 200+ );}--return (// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-noninteractive-element-interactions,jsx-a11y/no-static-element-interactions<divdiff --cc app/services/utils-io.tsindex 91f334afb,5b366915a..70e95a26a--- a/app/services/utils-io.ts+++ b/app/services/utils-io.ts@@@ -1231,14 -1218,16 +1231,28 @@@ export function fileNameValidation(filereturn true;}+/**+ * normalize path for URL is always '/'+ */+export function normalizeUrl(url: string) {+ if (PlatformIO.getDirSeparator() !== '/') {+ if (url) {+ return url.replaceAll(PlatformIO.getDirSeparator(), '/');+ }+ }+ return url;+}+++ /**+ * https://stackoverflow.com/a/71981197/2285631+ * TODO this not merge with "b" properties that missing in "a"+ * @param a+ * @param b+ */+ export const merge = (a, b) =>+ Object.fromEntries(+ Object.entries(a).map(([k, v]) => [+ k,+ v && Array.isArray(v) ? [...v, ...b[k]] : v || b[k]+ ])+ );diff --cc app/third-party.txtindex 3b68d8a48,e7e516096..7814369a6--- a/app/third-party.txt+++ b/app/third-party.txt@@@ -3537,8 -3486,8 +3486,8 @@@ The following NPM package may be includThis package contains the following license and notice below:--Copyright (c) 2011-2020, Sideway Inc, and project contributors--Copyright (c) 2011-2014, Walmart++Copyright (c) 2011-2020, Sideway Inc, and project contributors++Copyright (c) 2011-2014, WalmartCopyright (c) 2011, Yahoo Inc.All rights reserved.@@@ -3558,8 -3507,8 +3507,8 @@@ The following NPM package may be includThis package contains the following license and notice below:--Copyright (c) 2012-2020, Sideway Inc, and project contributors--Copyright (c) 2012-2014, Walmart.++Copyright (c) 2012-2020, Sideway Inc, and project contributors++Copyright (c) 2012-2014, Walmart.All rights reserved.Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:@@@ -6266,7 -6217,7 +6217,7 @@@ The following NPM package may be includThis package contains the following license and notice below:--Copyright (c) 2019-2020, Sideway. Inc, and project contributors++Copyright (c) 2019-2020, Sideway. Inc, and project contributorsAll rights reserved.@@@ -6616,7 -6567,7 +6567,7 @@@ This package contains the following lic# ansi-fragments--[![Version][version]][package]++[![Version][version]][package][![PRs Welcome][prs-welcome-badge]][prs-welcome][![MIT License][license-badge]][license]@@@ -9100,7 -9019,7 +9021,7 @@@ exhaustive, and do not form part of ousuch as asking that all changes be marked or described.Although not required by our licenses, you are encouraged torespect those requests where reasonable. More_considerations-- for the public:++ for the public:wiki.creativecommons.org/Considerations_for_licensees=======================================================================@@@ -9837,25 -9756,25 +9758,25 @@@ The MIT LicensCopyright (c) 2013 James Halliday ([email protected])--Permission is hereby granted, free of charge,--to any person obtaining a copy of this software and--associated documentation files (the "Software"), to--deal in the Software without restriction, including--without limitation the rights to use, copy, modify,--merge, publish, distribute, sublicense, and/or sell--copies of the Software, and to permit persons to whom--the Software is furnished to do so,++Permission is hereby granted, free of charge,++to any person obtaining a copy of this software and++associated documentation files (the "Software"), to++deal in the Software without restriction, including++without limitation the rights to use, copy, modify,++merge, publish, distribute, sublicense, and/or sell++copies of the Software, and to permit persons to whom++the Software is furnished to do so,subject to the following conditions:--The above copyright notice and this permission notice++The above copyright notice and this permission noticeshall be included in all copies or substantial portions of the Software.--THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,--EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES--OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.--IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR--ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,--TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,++EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES++OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.++IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR++ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,++TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THESOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.-----------@@@ -10028,7 -9947,7 +9949,7 @@@ The following NPM package may be includThis package contains the following license and notice below:--Copyright 2013 Thorsten Lorenz.++Copyright 2013 Thorsten Lorenz.All rights reserved.Permission is hereby granted, free of charge, to any person@@@ -10352,7 -10271,7 +10273,7 @@@ This package contains the following lic[The MIT License (MIT)](http://opensource.org/licenses/MIT)--Copyright (c) 2009-2013 Jeff Mott++Copyright (c) 2009-2013 Jeff MottCopyright (c) 2013-2016 Evan VosbergPermission is hereby granted, free of charge, to any person obtaining a copy@@@ -10581,19 -10500,19 +10502,19 @@@ This package contains the following licCopyright (c) 2014 TJ Holowaychuk <[email protected]>--Permission is hereby granted, free of charge, to any person obtaining a copy of this software--and associated documentation files (the 'Software'), to deal in the Software without restriction,--including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,++Permission is hereby granted, free of charge, to any person obtaining a copy of this software++and associated documentation files (the 'Software'), to deal in the Software without restriction,++including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,subject to the following conditions:--The above copyright notice and this permission notice shall be included in all copies or substantial++The above copyright notice and this permission notice shall be included in all copies or substantialportions of the Software.--THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT--LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.--IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,--WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE++THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT++LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.++IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,++WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THESOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.-----------@@@ -10799,7 -10718,7 +10720,7 @@@ If you're running the code on a browse- [ES6 Shim](https://github.com/es-shims/es6-shim) - `require('es6-shim');`- [Calvin Metcalf](https://twitter.com/CWMma)'s [Lie](https://github.com/calvinmetcalf/lie) - `global.Promise = global.Promise || require('lie');`--Note: as of v1.2.0 you can use **denodeify** in the front end. Pull it in via CommonJS, AMD or simply add to your webpage and it'll be available on `window.denodeify`.++Note: as of v1.2.0 you can use **denodeify** in the front end. Pull it in via CommonJS, AMD or simply add to your webpage and it'll be available on `window.denodeify`.## Installation@@@ -11473,69 -11392,9 +11394,69 @@@ THE SOFTWARE-----------+The following NPM package may be included in this product:+++This package contains the following license and notice below:++MIT License++Copyright (c) 2016 Thomas Brouard++Permission is hereby granted, free of charge, to any person obtaining a copy+of this software and associated documentation files (the "Software"), to deal+in the Software without restriction, including without limitation the rights+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell+copies of the Software, and to permit persons to whom the Software is+furnished to do so, subject to the following conditions:++The above copyright notice and this permission notice shall be included in all+copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE+SOFTWARE.++-----------++The following NPM package may be included in this product:+++This package contains the following license and notice below:++The MIT License (MIT)+Copyright (c) 2017 Andrea Parodi+++Permission is hereby granted, free of charge, to any person obtaining a copy+of this software and associated documentation files (the "Software"), to deal+in the Software without restriction, including without limitation the rights+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell+copies of the Software, and to permit persons to whom the Software is+furnished to do so, subject to the following conditions:++The above copyright notice and this permission notice shall be included in all+copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE+OR OTHER DEALINGS IN THE SOFTWARE.++-----------+The following NPM package may be included in this product:This package contains the following license and notice below:@@@ -14044,8 -13862,8 +13965,8 @@@ The following NPM package may be includThis package contains the following license and notice below:--# IP--[](https://www.npmjs.com/package/ip)++# IP++[](https://www.npmjs.com/package/ip)IP address utilities for node.js@@@ -14061,7 -13879,7 +13982,7 @@@ npm install i```shellgit clone https://github.com/indutny/node-ip.git```--++## UsageGet your ip address, compare ip addresses, validate ip addresses, etc.@@@ -17027,7 -16574,7 +16948,7 @@@ WITH THE SOFTWARE OR THE USE OR OTHER D== dependency license: adm-zip ==--Copyright (c) 2012 Another-D-Mention Software and other contributors,++Copyright (c) 2012 Another-D-Mention Software and other contributors,http://www.another-d-mention.ro/Permission is hereby granted, free of charge, to any person obtaining@@@ -18361,12 -18091,12 +18282,12 @@@ furnished to do so, subject to the follThe above copyright notice and this permission notice shall be included inall copies or substantial portions of the Software.--THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS--OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF--MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.--IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY--CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,--TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS++OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF++MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.++IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY++CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,++TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THESOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.-----------@@@ -18488,7 -18218,7 +18409,7 @@@ const { connectToDevTools } = require("connectToDevTools(config);```--Run `connectToDevTools()` in the same context as React to set up a connection to DevTools.++Run `connectToDevTools()` in the same context as React to set up a connection to DevTools.Be sure to run this function *before* importing e.g. `react`, `react-dom`, `react-native`.The `config` object may contain:@@@ -18586,23 -18316,23 +18507,23 @@@ This package contains the following lic(MIT License)Copyright (c) 2014-2016 Matt Zabriskie. All rights reserved.--++Permission is hereby granted, free of charge, to any person obtaining a--copy of this software and associated documentation files (the "Software"),--to deal in the Software without restriction, including without limitation--the rights to use, copy, modify, merge, publish, distribute, sublicense,--and/or sell copies of the Software, and to permit persons to whom the++copy of this software and associated documentation files (the "Software"),++to deal in the Software without restriction, including without limitation++the rights to use, copy, modify, merge, publish, distribute, sublicense,++and/or sell copies of the Software, and to permit persons to whom theSoftware is furnished to do so, subject to the following conditions:--++The above copyright notice and this permission notice shall be included inall copies or substantial portions of the Software.--++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR--IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,++IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE--AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER--LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING--FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER++AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER++LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING++FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHERDEALINGS IN THE SOFTWARE.-----------@@@ -19144,7 -18874,7 +19065,7 @@@ As the underlying `fs.createReadStream```jsvar readline = require('linebyline'),rl = readline('./file-in-win1251.txt', {-- retainBuffer: true //tell readline to retain buffer++ retainBuffer: true //tell readline to retain buffer});rl.on("line", function (data,linecount){var line = iconv.decode(data, 'win1251');@@@ -19162,7 -18892,7 +19083,7 @@@### Return:--* **EventEmitter**++* **EventEmitter**## License@@@ -20630,7 -20360,7 +20551,7 @@@ This package contains the following licCopyright (c) 1988-1997 Sam LefflerCopyright (c) 1991-1997 Silicon Graphics, Inc.-- Permission to use, copy, modify, distribute, and sell this software and++ Permission to use, copy, modify, distribute, and sell this software andits documentation for any purpose is hereby granted without fee, providedthat (i) the above copyright notices and this permission notice appear inall copies of the software and related documentation, and (ii) the names of@@@ -20638,15 -20368,15 +20559,15 @@@publicity relating to the software without the specific, prior writtenpermission of Sam Leffler and Silicon Graphics.-- THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,-- EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY-- WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.++ THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,++ EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY++ WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FORANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,-- WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF-- LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE++ WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF++ LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCEOF THIS SOFTWARE.*/@@@ -21256,12 -20986,11 +21177,12 @@@ OTHER DEALINGS IN THE SOFTWARE------------The following NPM package may be included in this product:+The following NPM packages may be included in this product:-This package contains the following license and notice below:+These packages each contain the following license and notice below:Copyright Joyent, Inc. and other Node contributors. All rights reserved.Permission is hereby granted, free of charge, to any person obtaining a copy