cloudcmd 19.20.4 → 19.20.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ChangeLog +8 -0
- package/HELP.md +2 -1
- package/README.md +1 -1
- package/dist/cloudcmd.common.css.map +1 -1
- package/dist/cloudcmd.common.js +14 -717
- package/dist/cloudcmd.common.js.map +1 -1
- package/dist/modules/view.js +1 -1
- package/dist/sw.js +1 -1
- package/dist-dev/cloudcmd.common.css +7 -7
- package/dist-dev/cloudcmd.common.js +10 -28
- package/dist-dev/columns/name-size.js +1 -1
- package/dist-dev/config.js +1 -1
- package/dist-dev/nojs.js +1 -1
- package/dist-dev/sw.js +1 -1
- package/dist-dev/terminal.js +1 -1
- package/dist-dev/user-menu.js +1 -1
- package/package.json +2 -2
- package/server/route.js +4 -3
package/dist/cloudcmd.common.js
CHANGED
|
@@ -2790,541 +2790,6 @@ module.exports = function sign(number) {
|
|
|
2790
2790
|
};
|
|
2791
2791
|
|
|
2792
2792
|
|
|
2793
|
-
},
|
|
2794
|
-
7975(module, __unused_rspack_exports, __webpack_require__) {
|
|
2795
|
-
"use strict";
|
|
2796
|
-
/* provided dependency */ var process = __webpack_require__(5606);
|
|
2797
|
-
// 'path' module extracted from Node.js v8.11.1 (only the posix part)
|
|
2798
|
-
// transplited with Babel
|
|
2799
|
-
|
|
2800
|
-
// Copyright Joyent, Inc. and other Node contributors.
|
|
2801
|
-
//
|
|
2802
|
-
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
2803
|
-
// copy of this software and associated documentation files (the
|
|
2804
|
-
// "Software"), to deal in the Software without restriction, including
|
|
2805
|
-
// without limitation the rights to use, copy, modify, merge, publish,
|
|
2806
|
-
// distribute, sublicense, and/or sell copies of the Software, and to permit
|
|
2807
|
-
// persons to whom the Software is furnished to do so, subject to the
|
|
2808
|
-
// following conditions:
|
|
2809
|
-
//
|
|
2810
|
-
// The above copyright notice and this permission notice shall be included
|
|
2811
|
-
// in all copies or substantial portions of the Software.
|
|
2812
|
-
//
|
|
2813
|
-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
2814
|
-
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
2815
|
-
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
|
2816
|
-
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
2817
|
-
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
2818
|
-
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
2819
|
-
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
function assertPath(path) {
|
|
2824
|
-
if (typeof path !== 'string') {
|
|
2825
|
-
throw new TypeError('Path must be a string. Received ' + JSON.stringify(path));
|
|
2826
|
-
}
|
|
2827
|
-
}
|
|
2828
|
-
|
|
2829
|
-
// Resolves . and .. elements in a path with directory names
|
|
2830
|
-
function normalizeStringPosix(path, allowAboveRoot) {
|
|
2831
|
-
var res = '';
|
|
2832
|
-
var lastSegmentLength = 0;
|
|
2833
|
-
var lastSlash = -1;
|
|
2834
|
-
var dots = 0;
|
|
2835
|
-
var code;
|
|
2836
|
-
for (var i = 0; i <= path.length; ++i) {
|
|
2837
|
-
if (i < path.length)
|
|
2838
|
-
code = path.charCodeAt(i);
|
|
2839
|
-
else if (code === 47 /*/*/)
|
|
2840
|
-
break;
|
|
2841
|
-
else
|
|
2842
|
-
code = 47 /*/*/;
|
|
2843
|
-
if (code === 47 /*/*/) {
|
|
2844
|
-
if (lastSlash === i - 1 || dots === 1) {
|
|
2845
|
-
// NOOP
|
|
2846
|
-
} else if (lastSlash !== i - 1 && dots === 2) {
|
|
2847
|
-
if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 /*.*/ || res.charCodeAt(res.length - 2) !== 46 /*.*/) {
|
|
2848
|
-
if (res.length > 2) {
|
|
2849
|
-
var lastSlashIndex = res.lastIndexOf('/');
|
|
2850
|
-
if (lastSlashIndex !== res.length - 1) {
|
|
2851
|
-
if (lastSlashIndex === -1) {
|
|
2852
|
-
res = '';
|
|
2853
|
-
lastSegmentLength = 0;
|
|
2854
|
-
} else {
|
|
2855
|
-
res = res.slice(0, lastSlashIndex);
|
|
2856
|
-
lastSegmentLength = res.length - 1 - res.lastIndexOf('/');
|
|
2857
|
-
}
|
|
2858
|
-
lastSlash = i;
|
|
2859
|
-
dots = 0;
|
|
2860
|
-
continue;
|
|
2861
|
-
}
|
|
2862
|
-
} else if (res.length === 2 || res.length === 1) {
|
|
2863
|
-
res = '';
|
|
2864
|
-
lastSegmentLength = 0;
|
|
2865
|
-
lastSlash = i;
|
|
2866
|
-
dots = 0;
|
|
2867
|
-
continue;
|
|
2868
|
-
}
|
|
2869
|
-
}
|
|
2870
|
-
if (allowAboveRoot) {
|
|
2871
|
-
if (res.length > 0)
|
|
2872
|
-
res += '/..';
|
|
2873
|
-
else
|
|
2874
|
-
res = '..';
|
|
2875
|
-
lastSegmentLength = 2;
|
|
2876
|
-
}
|
|
2877
|
-
} else {
|
|
2878
|
-
if (res.length > 0)
|
|
2879
|
-
res += '/' + path.slice(lastSlash + 1, i);
|
|
2880
|
-
else
|
|
2881
|
-
res = path.slice(lastSlash + 1, i);
|
|
2882
|
-
lastSegmentLength = i - lastSlash - 1;
|
|
2883
|
-
}
|
|
2884
|
-
lastSlash = i;
|
|
2885
|
-
dots = 0;
|
|
2886
|
-
} else if (code === 46 /*.*/ && dots !== -1) {
|
|
2887
|
-
++dots;
|
|
2888
|
-
} else {
|
|
2889
|
-
dots = -1;
|
|
2890
|
-
}
|
|
2891
|
-
}
|
|
2892
|
-
return res;
|
|
2893
|
-
}
|
|
2894
|
-
|
|
2895
|
-
function _format(sep, pathObject) {
|
|
2896
|
-
var dir = pathObject.dir || pathObject.root;
|
|
2897
|
-
var base = pathObject.base || (pathObject.name || '') + (pathObject.ext || '');
|
|
2898
|
-
if (!dir) {
|
|
2899
|
-
return base;
|
|
2900
|
-
}
|
|
2901
|
-
if (dir === pathObject.root) {
|
|
2902
|
-
return dir + base;
|
|
2903
|
-
}
|
|
2904
|
-
return dir + sep + base;
|
|
2905
|
-
}
|
|
2906
|
-
|
|
2907
|
-
var posix = {
|
|
2908
|
-
// path.resolve([from ...], to)
|
|
2909
|
-
resolve: function resolve() {
|
|
2910
|
-
var resolvedPath = '';
|
|
2911
|
-
var resolvedAbsolute = false;
|
|
2912
|
-
var cwd;
|
|
2913
|
-
|
|
2914
|
-
for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
|
|
2915
|
-
var path;
|
|
2916
|
-
if (i >= 0)
|
|
2917
|
-
path = arguments[i];
|
|
2918
|
-
else {
|
|
2919
|
-
if (cwd === undefined)
|
|
2920
|
-
cwd = process.cwd();
|
|
2921
|
-
path = cwd;
|
|
2922
|
-
}
|
|
2923
|
-
|
|
2924
|
-
assertPath(path);
|
|
2925
|
-
|
|
2926
|
-
// Skip empty entries
|
|
2927
|
-
if (path.length === 0) {
|
|
2928
|
-
continue;
|
|
2929
|
-
}
|
|
2930
|
-
|
|
2931
|
-
resolvedPath = path + '/' + resolvedPath;
|
|
2932
|
-
resolvedAbsolute = path.charCodeAt(0) === 47 /*/*/;
|
|
2933
|
-
}
|
|
2934
|
-
|
|
2935
|
-
// At this point the path should be resolved to a full absolute path, but
|
|
2936
|
-
// handle relative paths to be safe (might happen when process.cwd() fails)
|
|
2937
|
-
|
|
2938
|
-
// Normalize the path
|
|
2939
|
-
resolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute);
|
|
2940
|
-
|
|
2941
|
-
if (resolvedAbsolute) {
|
|
2942
|
-
if (resolvedPath.length > 0)
|
|
2943
|
-
return '/' + resolvedPath;
|
|
2944
|
-
else
|
|
2945
|
-
return '/';
|
|
2946
|
-
} else if (resolvedPath.length > 0) {
|
|
2947
|
-
return resolvedPath;
|
|
2948
|
-
} else {
|
|
2949
|
-
return '.';
|
|
2950
|
-
}
|
|
2951
|
-
},
|
|
2952
|
-
|
|
2953
|
-
normalize: function normalize(path) {
|
|
2954
|
-
assertPath(path);
|
|
2955
|
-
|
|
2956
|
-
if (path.length === 0) return '.';
|
|
2957
|
-
|
|
2958
|
-
var isAbsolute = path.charCodeAt(0) === 47 /*/*/;
|
|
2959
|
-
var trailingSeparator = path.charCodeAt(path.length - 1) === 47 /*/*/;
|
|
2960
|
-
|
|
2961
|
-
// Normalize the path
|
|
2962
|
-
path = normalizeStringPosix(path, !isAbsolute);
|
|
2963
|
-
|
|
2964
|
-
if (path.length === 0 && !isAbsolute) path = '.';
|
|
2965
|
-
if (path.length > 0 && trailingSeparator) path += '/';
|
|
2966
|
-
|
|
2967
|
-
if (isAbsolute) return '/' + path;
|
|
2968
|
-
return path;
|
|
2969
|
-
},
|
|
2970
|
-
|
|
2971
|
-
isAbsolute: function isAbsolute(path) {
|
|
2972
|
-
assertPath(path);
|
|
2973
|
-
return path.length > 0 && path.charCodeAt(0) === 47 /*/*/;
|
|
2974
|
-
},
|
|
2975
|
-
|
|
2976
|
-
join: function join() {
|
|
2977
|
-
if (arguments.length === 0)
|
|
2978
|
-
return '.';
|
|
2979
|
-
var joined;
|
|
2980
|
-
for (var i = 0; i < arguments.length; ++i) {
|
|
2981
|
-
var arg = arguments[i];
|
|
2982
|
-
assertPath(arg);
|
|
2983
|
-
if (arg.length > 0) {
|
|
2984
|
-
if (joined === undefined)
|
|
2985
|
-
joined = arg;
|
|
2986
|
-
else
|
|
2987
|
-
joined += '/' + arg;
|
|
2988
|
-
}
|
|
2989
|
-
}
|
|
2990
|
-
if (joined === undefined)
|
|
2991
|
-
return '.';
|
|
2992
|
-
return posix.normalize(joined);
|
|
2993
|
-
},
|
|
2994
|
-
|
|
2995
|
-
relative: function relative(from, to) {
|
|
2996
|
-
assertPath(from);
|
|
2997
|
-
assertPath(to);
|
|
2998
|
-
|
|
2999
|
-
if (from === to) return '';
|
|
3000
|
-
|
|
3001
|
-
from = posix.resolve(from);
|
|
3002
|
-
to = posix.resolve(to);
|
|
3003
|
-
|
|
3004
|
-
if (from === to) return '';
|
|
3005
|
-
|
|
3006
|
-
// Trim any leading backslashes
|
|
3007
|
-
var fromStart = 1;
|
|
3008
|
-
for (; fromStart < from.length; ++fromStart) {
|
|
3009
|
-
if (from.charCodeAt(fromStart) !== 47 /*/*/)
|
|
3010
|
-
break;
|
|
3011
|
-
}
|
|
3012
|
-
var fromEnd = from.length;
|
|
3013
|
-
var fromLen = fromEnd - fromStart;
|
|
3014
|
-
|
|
3015
|
-
// Trim any leading backslashes
|
|
3016
|
-
var toStart = 1;
|
|
3017
|
-
for (; toStart < to.length; ++toStart) {
|
|
3018
|
-
if (to.charCodeAt(toStart) !== 47 /*/*/)
|
|
3019
|
-
break;
|
|
3020
|
-
}
|
|
3021
|
-
var toEnd = to.length;
|
|
3022
|
-
var toLen = toEnd - toStart;
|
|
3023
|
-
|
|
3024
|
-
// Compare paths to find the longest common path from root
|
|
3025
|
-
var length = fromLen < toLen ? fromLen : toLen;
|
|
3026
|
-
var lastCommonSep = -1;
|
|
3027
|
-
var i = 0;
|
|
3028
|
-
for (; i <= length; ++i) {
|
|
3029
|
-
if (i === length) {
|
|
3030
|
-
if (toLen > length) {
|
|
3031
|
-
if (to.charCodeAt(toStart + i) === 47 /*/*/) {
|
|
3032
|
-
// We get here if `from` is the exact base path for `to`.
|
|
3033
|
-
// For example: from='/foo/bar'; to='/foo/bar/baz'
|
|
3034
|
-
return to.slice(toStart + i + 1);
|
|
3035
|
-
} else if (i === 0) {
|
|
3036
|
-
// We get here if `from` is the root
|
|
3037
|
-
// For example: from='/'; to='/foo'
|
|
3038
|
-
return to.slice(toStart + i);
|
|
3039
|
-
}
|
|
3040
|
-
} else if (fromLen > length) {
|
|
3041
|
-
if (from.charCodeAt(fromStart + i) === 47 /*/*/) {
|
|
3042
|
-
// We get here if `to` is the exact base path for `from`.
|
|
3043
|
-
// For example: from='/foo/bar/baz'; to='/foo/bar'
|
|
3044
|
-
lastCommonSep = i;
|
|
3045
|
-
} else if (i === 0) {
|
|
3046
|
-
// We get here if `to` is the root.
|
|
3047
|
-
// For example: from='/foo'; to='/'
|
|
3048
|
-
lastCommonSep = 0;
|
|
3049
|
-
}
|
|
3050
|
-
}
|
|
3051
|
-
break;
|
|
3052
|
-
}
|
|
3053
|
-
var fromCode = from.charCodeAt(fromStart + i);
|
|
3054
|
-
var toCode = to.charCodeAt(toStart + i);
|
|
3055
|
-
if (fromCode !== toCode)
|
|
3056
|
-
break;
|
|
3057
|
-
else if (fromCode === 47 /*/*/)
|
|
3058
|
-
lastCommonSep = i;
|
|
3059
|
-
}
|
|
3060
|
-
|
|
3061
|
-
var out = '';
|
|
3062
|
-
// Generate the relative path based on the path difference between `to`
|
|
3063
|
-
// and `from`
|
|
3064
|
-
for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {
|
|
3065
|
-
if (i === fromEnd || from.charCodeAt(i) === 47 /*/*/) {
|
|
3066
|
-
if (out.length === 0)
|
|
3067
|
-
out += '..';
|
|
3068
|
-
else
|
|
3069
|
-
out += '/..';
|
|
3070
|
-
}
|
|
3071
|
-
}
|
|
3072
|
-
|
|
3073
|
-
// Lastly, append the rest of the destination (`to`) path that comes after
|
|
3074
|
-
// the common path parts
|
|
3075
|
-
if (out.length > 0)
|
|
3076
|
-
return out + to.slice(toStart + lastCommonSep);
|
|
3077
|
-
else {
|
|
3078
|
-
toStart += lastCommonSep;
|
|
3079
|
-
if (to.charCodeAt(toStart) === 47 /*/*/)
|
|
3080
|
-
++toStart;
|
|
3081
|
-
return to.slice(toStart);
|
|
3082
|
-
}
|
|
3083
|
-
},
|
|
3084
|
-
|
|
3085
|
-
_makeLong: function _makeLong(path) {
|
|
3086
|
-
return path;
|
|
3087
|
-
},
|
|
3088
|
-
|
|
3089
|
-
dirname: function dirname(path) {
|
|
3090
|
-
assertPath(path);
|
|
3091
|
-
if (path.length === 0) return '.';
|
|
3092
|
-
var code = path.charCodeAt(0);
|
|
3093
|
-
var hasRoot = code === 47 /*/*/;
|
|
3094
|
-
var end = -1;
|
|
3095
|
-
var matchedSlash = true;
|
|
3096
|
-
for (var i = path.length - 1; i >= 1; --i) {
|
|
3097
|
-
code = path.charCodeAt(i);
|
|
3098
|
-
if (code === 47 /*/*/) {
|
|
3099
|
-
if (!matchedSlash) {
|
|
3100
|
-
end = i;
|
|
3101
|
-
break;
|
|
3102
|
-
}
|
|
3103
|
-
} else {
|
|
3104
|
-
// We saw the first non-path separator
|
|
3105
|
-
matchedSlash = false;
|
|
3106
|
-
}
|
|
3107
|
-
}
|
|
3108
|
-
|
|
3109
|
-
if (end === -1) return hasRoot ? '/' : '.';
|
|
3110
|
-
if (hasRoot && end === 1) return '//';
|
|
3111
|
-
return path.slice(0, end);
|
|
3112
|
-
},
|
|
3113
|
-
|
|
3114
|
-
basename: function basename(path, ext) {
|
|
3115
|
-
if (ext !== undefined && typeof ext !== 'string') throw new TypeError('"ext" argument must be a string');
|
|
3116
|
-
assertPath(path);
|
|
3117
|
-
|
|
3118
|
-
var start = 0;
|
|
3119
|
-
var end = -1;
|
|
3120
|
-
var matchedSlash = true;
|
|
3121
|
-
var i;
|
|
3122
|
-
|
|
3123
|
-
if (ext !== undefined && ext.length > 0 && ext.length <= path.length) {
|
|
3124
|
-
if (ext.length === path.length && ext === path) return '';
|
|
3125
|
-
var extIdx = ext.length - 1;
|
|
3126
|
-
var firstNonSlashEnd = -1;
|
|
3127
|
-
for (i = path.length - 1; i >= 0; --i) {
|
|
3128
|
-
var code = path.charCodeAt(i);
|
|
3129
|
-
if (code === 47 /*/*/) {
|
|
3130
|
-
// If we reached a path separator that was not part of a set of path
|
|
3131
|
-
// separators at the end of the string, stop now
|
|
3132
|
-
if (!matchedSlash) {
|
|
3133
|
-
start = i + 1;
|
|
3134
|
-
break;
|
|
3135
|
-
}
|
|
3136
|
-
} else {
|
|
3137
|
-
if (firstNonSlashEnd === -1) {
|
|
3138
|
-
// We saw the first non-path separator, remember this index in case
|
|
3139
|
-
// we need it if the extension ends up not matching
|
|
3140
|
-
matchedSlash = false;
|
|
3141
|
-
firstNonSlashEnd = i + 1;
|
|
3142
|
-
}
|
|
3143
|
-
if (extIdx >= 0) {
|
|
3144
|
-
// Try to match the explicit extension
|
|
3145
|
-
if (code === ext.charCodeAt(extIdx)) {
|
|
3146
|
-
if (--extIdx === -1) {
|
|
3147
|
-
// We matched the extension, so mark this as the end of our path
|
|
3148
|
-
// component
|
|
3149
|
-
end = i;
|
|
3150
|
-
}
|
|
3151
|
-
} else {
|
|
3152
|
-
// Extension does not match, so our result is the entire path
|
|
3153
|
-
// component
|
|
3154
|
-
extIdx = -1;
|
|
3155
|
-
end = firstNonSlashEnd;
|
|
3156
|
-
}
|
|
3157
|
-
}
|
|
3158
|
-
}
|
|
3159
|
-
}
|
|
3160
|
-
|
|
3161
|
-
if (start === end) end = firstNonSlashEnd;else if (end === -1) end = path.length;
|
|
3162
|
-
return path.slice(start, end);
|
|
3163
|
-
} else {
|
|
3164
|
-
for (i = path.length - 1; i >= 0; --i) {
|
|
3165
|
-
if (path.charCodeAt(i) === 47 /*/*/) {
|
|
3166
|
-
// If we reached a path separator that was not part of a set of path
|
|
3167
|
-
// separators at the end of the string, stop now
|
|
3168
|
-
if (!matchedSlash) {
|
|
3169
|
-
start = i + 1;
|
|
3170
|
-
break;
|
|
3171
|
-
}
|
|
3172
|
-
} else if (end === -1) {
|
|
3173
|
-
// We saw the first non-path separator, mark this as the end of our
|
|
3174
|
-
// path component
|
|
3175
|
-
matchedSlash = false;
|
|
3176
|
-
end = i + 1;
|
|
3177
|
-
}
|
|
3178
|
-
}
|
|
3179
|
-
|
|
3180
|
-
if (end === -1) return '';
|
|
3181
|
-
return path.slice(start, end);
|
|
3182
|
-
}
|
|
3183
|
-
},
|
|
3184
|
-
|
|
3185
|
-
extname: function extname(path) {
|
|
3186
|
-
assertPath(path);
|
|
3187
|
-
var startDot = -1;
|
|
3188
|
-
var startPart = 0;
|
|
3189
|
-
var end = -1;
|
|
3190
|
-
var matchedSlash = true;
|
|
3191
|
-
// Track the state of characters (if any) we see before our first dot and
|
|
3192
|
-
// after any path separator we find
|
|
3193
|
-
var preDotState = 0;
|
|
3194
|
-
for (var i = path.length - 1; i >= 0; --i) {
|
|
3195
|
-
var code = path.charCodeAt(i);
|
|
3196
|
-
if (code === 47 /*/*/) {
|
|
3197
|
-
// If we reached a path separator that was not part of a set of path
|
|
3198
|
-
// separators at the end of the string, stop now
|
|
3199
|
-
if (!matchedSlash) {
|
|
3200
|
-
startPart = i + 1;
|
|
3201
|
-
break;
|
|
3202
|
-
}
|
|
3203
|
-
continue;
|
|
3204
|
-
}
|
|
3205
|
-
if (end === -1) {
|
|
3206
|
-
// We saw the first non-path separator, mark this as the end of our
|
|
3207
|
-
// extension
|
|
3208
|
-
matchedSlash = false;
|
|
3209
|
-
end = i + 1;
|
|
3210
|
-
}
|
|
3211
|
-
if (code === 46 /*.*/) {
|
|
3212
|
-
// If this is our first dot, mark it as the start of our extension
|
|
3213
|
-
if (startDot === -1)
|
|
3214
|
-
startDot = i;
|
|
3215
|
-
else if (preDotState !== 1)
|
|
3216
|
-
preDotState = 1;
|
|
3217
|
-
} else if (startDot !== -1) {
|
|
3218
|
-
// We saw a non-dot and non-path separator before our dot, so we should
|
|
3219
|
-
// have a good chance at having a non-empty extension
|
|
3220
|
-
preDotState = -1;
|
|
3221
|
-
}
|
|
3222
|
-
}
|
|
3223
|
-
|
|
3224
|
-
if (startDot === -1 || end === -1 ||
|
|
3225
|
-
// We saw a non-dot character immediately before the dot
|
|
3226
|
-
preDotState === 0 ||
|
|
3227
|
-
// The (right-most) trimmed path component is exactly '..'
|
|
3228
|
-
preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
|
|
3229
|
-
return '';
|
|
3230
|
-
}
|
|
3231
|
-
return path.slice(startDot, end);
|
|
3232
|
-
},
|
|
3233
|
-
|
|
3234
|
-
format: function format(pathObject) {
|
|
3235
|
-
if (pathObject === null || typeof pathObject !== 'object') {
|
|
3236
|
-
throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof pathObject);
|
|
3237
|
-
}
|
|
3238
|
-
return _format('/', pathObject);
|
|
3239
|
-
},
|
|
3240
|
-
|
|
3241
|
-
parse: function parse(path) {
|
|
3242
|
-
assertPath(path);
|
|
3243
|
-
|
|
3244
|
-
var ret = { root: '', dir: '', base: '', ext: '', name: '' };
|
|
3245
|
-
if (path.length === 0) return ret;
|
|
3246
|
-
var code = path.charCodeAt(0);
|
|
3247
|
-
var isAbsolute = code === 47 /*/*/;
|
|
3248
|
-
var start;
|
|
3249
|
-
if (isAbsolute) {
|
|
3250
|
-
ret.root = '/';
|
|
3251
|
-
start = 1;
|
|
3252
|
-
} else {
|
|
3253
|
-
start = 0;
|
|
3254
|
-
}
|
|
3255
|
-
var startDot = -1;
|
|
3256
|
-
var startPart = 0;
|
|
3257
|
-
var end = -1;
|
|
3258
|
-
var matchedSlash = true;
|
|
3259
|
-
var i = path.length - 1;
|
|
3260
|
-
|
|
3261
|
-
// Track the state of characters (if any) we see before our first dot and
|
|
3262
|
-
// after any path separator we find
|
|
3263
|
-
var preDotState = 0;
|
|
3264
|
-
|
|
3265
|
-
// Get non-dir info
|
|
3266
|
-
for (; i >= start; --i) {
|
|
3267
|
-
code = path.charCodeAt(i);
|
|
3268
|
-
if (code === 47 /*/*/) {
|
|
3269
|
-
// If we reached a path separator that was not part of a set of path
|
|
3270
|
-
// separators at the end of the string, stop now
|
|
3271
|
-
if (!matchedSlash) {
|
|
3272
|
-
startPart = i + 1;
|
|
3273
|
-
break;
|
|
3274
|
-
}
|
|
3275
|
-
continue;
|
|
3276
|
-
}
|
|
3277
|
-
if (end === -1) {
|
|
3278
|
-
// We saw the first non-path separator, mark this as the end of our
|
|
3279
|
-
// extension
|
|
3280
|
-
matchedSlash = false;
|
|
3281
|
-
end = i + 1;
|
|
3282
|
-
}
|
|
3283
|
-
if (code === 46 /*.*/) {
|
|
3284
|
-
// If this is our first dot, mark it as the start of our extension
|
|
3285
|
-
if (startDot === -1) startDot = i;else if (preDotState !== 1) preDotState = 1;
|
|
3286
|
-
} else if (startDot !== -1) {
|
|
3287
|
-
// We saw a non-dot and non-path separator before our dot, so we should
|
|
3288
|
-
// have a good chance at having a non-empty extension
|
|
3289
|
-
preDotState = -1;
|
|
3290
|
-
}
|
|
3291
|
-
}
|
|
3292
|
-
|
|
3293
|
-
if (startDot === -1 || end === -1 ||
|
|
3294
|
-
// We saw a non-dot character immediately before the dot
|
|
3295
|
-
preDotState === 0 ||
|
|
3296
|
-
// The (right-most) trimmed path component is exactly '..'
|
|
3297
|
-
preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
|
|
3298
|
-
if (end !== -1) {
|
|
3299
|
-
if (startPart === 0 && isAbsolute) ret.base = ret.name = path.slice(1, end);else ret.base = ret.name = path.slice(startPart, end);
|
|
3300
|
-
}
|
|
3301
|
-
} else {
|
|
3302
|
-
if (startPart === 0 && isAbsolute) {
|
|
3303
|
-
ret.name = path.slice(1, startDot);
|
|
3304
|
-
ret.base = path.slice(1, end);
|
|
3305
|
-
} else {
|
|
3306
|
-
ret.name = path.slice(startPart, startDot);
|
|
3307
|
-
ret.base = path.slice(startPart, end);
|
|
3308
|
-
}
|
|
3309
|
-
ret.ext = path.slice(startDot, end);
|
|
3310
|
-
}
|
|
3311
|
-
|
|
3312
|
-
if (startPart > 0) ret.dir = path.slice(0, startPart - 1);else if (isAbsolute) ret.dir = '/';
|
|
3313
|
-
|
|
3314
|
-
return ret;
|
|
3315
|
-
},
|
|
3316
|
-
|
|
3317
|
-
sep: '/',
|
|
3318
|
-
delimiter: ':',
|
|
3319
|
-
win32: null,
|
|
3320
|
-
posix: null
|
|
3321
|
-
};
|
|
3322
|
-
|
|
3323
|
-
posix.posix = posix;
|
|
3324
|
-
|
|
3325
|
-
module.exports = posix;
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
2793
|
},
|
|
3329
2794
|
6578(module) {
|
|
3330
2795
|
"use strict";
|
|
@@ -8439,10 +7904,10 @@ const FILES_JSON = 'config|modules';
|
|
|
8439
7904
|
const FILES_HTML = 'file|path|link|pathLink|media';
|
|
8440
7905
|
const FILES_HTML_ROOT = 'view/media-tmpl|config-tmpl|upload';
|
|
8441
7906
|
const DIR_HTML = '/tmpl/';
|
|
8442
|
-
const DIR_HTML_FS = (/* runtime-dependent pure expression or super */ /^(127|145|
|
|
7907
|
+
const DIR_HTML_FS = (/* runtime-dependent pure expression or super */ /^(127|145|791|816|968|985)$/.test(__webpack_require__.j) ? (`${DIR_HTML}fs/`) : null);
|
|
8443
7908
|
const DIR_JSON = '/json/';
|
|
8444
|
-
const timeout = (/* runtime-dependent pure expression or super */ /^(127|145|
|
|
8445
|
-
const get = (/* runtime-dependent pure expression or super */ /^(127|145|
|
|
7909
|
+
const timeout = (/* runtime-dependent pure expression or super */ /^(127|145|791|816|968|985)$/.test(__webpack_require__.j) ? (getTimeoutOnce(2000)) : null);
|
|
7910
|
+
const get = (/* runtime-dependent pure expression or super */ /^(127|145|791|816|968|985)$/.test(__webpack_require__.j) ? (getFile) : null);
|
|
8446
7911
|
function getFile(name) {
|
|
8447
7912
|
const type = itype__rspack_import_0(name);
|
|
8448
7913
|
check(name);
|
|
@@ -10433,14 +9898,9 @@ function setState(state) {
|
|
|
10433
9898
|
const getValue = (name, element)=>{
|
|
10434
9899
|
const el = getElementByName(name, element);
|
|
10435
9900
|
const { type } = el;
|
|
10436
|
-
|
|
10437
|
-
|
|
10438
|
-
|
|
10439
|
-
case 'number':
|
|
10440
|
-
return Number(el.value);
|
|
10441
|
-
default:
|
|
10442
|
-
return el.value;
|
|
10443
|
-
}
|
|
9901
|
+
if (type === 'checkbox') return el.checked;
|
|
9902
|
+
if (type === 'number') return Number(el.value);
|
|
9903
|
+
return el.value;
|
|
10444
9904
|
};
|
|
10445
9905
|
const setValue = (name, value, element)=>{
|
|
10446
9906
|
const el = getElementByName(name, element);
|
|
@@ -12769,28 +12229,15 @@ function getCodeFrame({ error, source }) {
|
|
|
12769
12229
|
|
|
12770
12230
|
|
|
12771
12231
|
},
|
|
12772
|
-
|
|
12232
|
+
1613(__unused_rspack___webpack_module__, __unused_rspack___webpack_exports__, __webpack_require__) {
|
|
12773
12233
|
"use strict";
|
|
12774
12234
|
|
|
12775
12235
|
// UNUSED EXPORTS: _Config, _createIframe, _initConfig, _viewHtml, hide, init, show
|
|
12776
|
-
// NAMESPACE OBJECT: ./node_modules/@cloudcmd/modal/lib/modal.js
|
|
12777
|
-
var modal_namespaceObject = {};
|
|
12778
|
-
__webpack_require__.r(modal_namespaceObject);
|
|
12779
|
-
__webpack_require__.d(modal_namespaceObject, {
|
|
12780
|
-
_onMainClick: () => (_onMainClick),
|
|
12781
|
-
_optionsStore: () => (_optionsStore),
|
|
12782
|
-
close: () => (modal_close),
|
|
12783
|
-
open: () => (modal_open) });
|
|
12784
12236
|
|
|
12785
|
-
|
|
12786
|
-
// EXTERNAL MODULE: ./node_modules/rendy/lib/rendy.js
|
|
12787
|
-
var rendy = __webpack_require__(4492);
|
|
12788
12237
|
// EXTERNAL MODULE: ./node_modules/currify/lib/currify.js
|
|
12789
12238
|
var currify = __webpack_require__(4299);
|
|
12790
12239
|
// EXTERNAL MODULE: ./node_modules/wraptile/lib/wraptile.js
|
|
12791
12240
|
var wraptile = __webpack_require__(9317);
|
|
12792
|
-
// EXTERNAL MODULE: ./node_modules/try-to-catch/lib/try-to-catch.js
|
|
12793
|
-
var try_to_catch = __webpack_require__(980);
|
|
12794
12241
|
// EXTERNAL MODULE: ./node_modules/load.js/lib/load.js
|
|
12795
12242
|
var load = __webpack_require__(1256);
|
|
12796
12243
|
// EXTERNAL MODULE: ./node_modules/fullstore/lib/fullstore.js
|
|
@@ -12984,7 +12431,7 @@ const noop = () => {};
|
|
|
12984
12431
|
|
|
12985
12432
|
const optionsStore = (0,fullstore/* .fullstore */.p)({});
|
|
12986
12433
|
|
|
12987
|
-
const
|
|
12434
|
+
const innerHTML = `
|
|
12988
12435
|
<div class="modal-child" data-name="modal-child">
|
|
12989
12436
|
<div class="modal-close" data-name="modal-close"></div>
|
|
12990
12437
|
</div>
|
|
@@ -13033,7 +12480,7 @@ const modal_open = (inner, options = {}) => {
|
|
|
13033
12480
|
});
|
|
13034
12481
|
|
|
13035
12482
|
const el = create_element('div', {
|
|
13036
|
-
innerHTML
|
|
12483
|
+
innerHTML,
|
|
13037
12484
|
className,
|
|
13038
12485
|
dataName: 'modal-main',
|
|
13039
12486
|
});
|
|
@@ -13094,8 +12541,8 @@ const modal_close = (event, overrides = {}) => {
|
|
|
13094
12541
|
afterClose();
|
|
13095
12542
|
};
|
|
13096
12543
|
|
|
13097
|
-
const _optionsStore = optionsStore;
|
|
13098
|
-
const _onMainClick = onMainClick;
|
|
12544
|
+
const _optionsStore = (/* unused pure expression or super */ null && (optionsStore));
|
|
12545
|
+
const _onMainClick = (/* unused pure expression or super */ null && (onMainClick));
|
|
13099
12546
|
|
|
13100
12547
|
function check(inner) {
|
|
13101
12548
|
if (!inner)
|
|
@@ -13104,65 +12551,10 @@ function check(inner) {
|
|
|
13104
12551
|
|
|
13105
12552
|
// EXTERNAL MODULE: ./common/util.js
|
|
13106
12553
|
var util = __webpack_require__(2007);
|
|
13107
|
-
// EXTERNAL MODULE: ./client/dom/files.js
|
|
13108
|
-
var dom_files = __webpack_require__(4701);
|
|
13109
12554
|
// EXTERNAL MODULE: ./client/dom/events/index.js
|
|
13110
12555
|
var dom_events = __webpack_require__(3410);
|
|
13111
|
-
// EXTERNAL MODULE: ./common/cloudfunc.js
|
|
13112
|
-
var cloudfunc = __webpack_require__(5700);
|
|
13113
12556
|
// EXTERNAL MODULE: ./client/dom/images.js
|
|
13114
12557
|
var dom_images = __webpack_require__(6226);
|
|
13115
|
-
// EXTERNAL MODULE: ./common/entity.js
|
|
13116
|
-
var entity = __webpack_require__(9460);
|
|
13117
|
-
// EXTERNAL MODULE: ./node_modules/path-browserify/index.js
|
|
13118
|
-
var path_browserify = __webpack_require__(7975);
|
|
13119
|
-
;// CONCATENATED MODULE: ./client/modules/view/types.js
|
|
13120
|
-
|
|
13121
|
-
|
|
13122
|
-
const isAudio = (name)=>/\.(mp3|ogg|m4a|flac)$/i.test(name);
|
|
13123
|
-
const testRegExp = currify((name, reg)=>reg.test(name));
|
|
13124
|
-
const getRegExp = (ext)=>RegExp(`\\.${ext}$`, 'i');
|
|
13125
|
-
const isPDF = (a)=>/\.pdf$/i.test(a);
|
|
13126
|
-
const isHTML = (a)=>a.endsWith('.html');
|
|
13127
|
-
const isMarkdown = (a)=>/.\.md$/.test(a);
|
|
13128
|
-
const getType = async (path)=>{
|
|
13129
|
-
const ext = (0,path_browserify.extname)(path);
|
|
13130
|
-
if (!ext) path = await detectType(path);
|
|
13131
|
-
if (isPDF(path)) return 'pdf';
|
|
13132
|
-
if (types_isImage(path)) return 'image';
|
|
13133
|
-
if (isMedia(path)) return 'media';
|
|
13134
|
-
if (isHTML(path)) return 'html';
|
|
13135
|
-
if (isMarkdown(path)) return 'markdown';
|
|
13136
|
-
};
|
|
13137
|
-
function types_isImage(name) {
|
|
13138
|
-
const images = [
|
|
13139
|
-
'jp(e|g|eg)',
|
|
13140
|
-
'gif',
|
|
13141
|
-
'png',
|
|
13142
|
-
'bmp',
|
|
13143
|
-
'webp',
|
|
13144
|
-
'svg',
|
|
13145
|
-
'ico'
|
|
13146
|
-
];
|
|
13147
|
-
return images.map(getRegExp).some(testRegExp(name));
|
|
13148
|
-
}
|
|
13149
|
-
function isMedia(name) {
|
|
13150
|
-
return isAudio(name) || isVideo(name);
|
|
13151
|
-
}
|
|
13152
|
-
function isVideo(name) {
|
|
13153
|
-
return /\.(mp4|avi|webm)$/i.test(name);
|
|
13154
|
-
}
|
|
13155
|
-
const _detectType = (/* unused pure expression or super */ null && (detectType));
|
|
13156
|
-
async function detectType(path) {
|
|
13157
|
-
const { headers } = await fetch(path, {
|
|
13158
|
-
method: 'HEAD'
|
|
13159
|
-
});
|
|
13160
|
-
for (const [name, value] of headers){
|
|
13161
|
-
if (name === 'content-type') return `.${value.split('/').pop()}`;
|
|
13162
|
-
}
|
|
13163
|
-
return '';
|
|
13164
|
-
}
|
|
13165
|
-
|
|
13166
12558
|
;// CONCATENATED MODULE: ./client/modules/view/index.js
|
|
13167
12559
|
|
|
13168
12560
|
|
|
@@ -13173,15 +12565,8 @@ async function detectType(path) {
|
|
|
13173
12565
|
|
|
13174
12566
|
|
|
13175
12567
|
|
|
13176
|
-
|
|
13177
|
-
|
|
13178
|
-
|
|
13179
|
-
|
|
13180
|
-
|
|
13181
|
-
|
|
13182
12568
|
const CloudCmd = globalThis.CloudCmd || {};
|
|
13183
12569
|
const DOM = globalThis.DOM || {};
|
|
13184
|
-
const isString = (a)=>typeof a === 'string';
|
|
13185
12570
|
const { assign: view_assign } = Object;
|
|
13186
12571
|
const { isArray: view_isArray } = Array;
|
|
13187
12572
|
const lifo = currify((fn, el, cb, name)=>fn(name, el, cb));
|
|
@@ -13201,9 +12586,7 @@ CloudCmd[Name] = {
|
|
|
13201
12586
|
};
|
|
13202
12587
|
const Info = DOM.CurrentInfo;
|
|
13203
12588
|
const { Key } = CloudCmd;
|
|
13204
|
-
const basename = (a)=>a.split('/').pop();
|
|
13205
12589
|
let El;
|
|
13206
|
-
let TemplateAudio;
|
|
13207
12590
|
let Overlay;
|
|
13208
12591
|
const Config = {
|
|
13209
12592
|
beforeShow: ()=>{
|
|
@@ -13234,7 +12617,6 @@ async function init() {
|
|
|
13234
12617
|
events.forEach(view_addEvent(Overlay, view_onOverlayClick));
|
|
13235
12618
|
}
|
|
13236
12619
|
async function show(data, options = {}) {
|
|
13237
|
-
const prefixURL = CloudCmd.prefixURL + cloudfunc.FS;
|
|
13238
12620
|
if (Loading) return;
|
|
13239
12621
|
if (!options || options.bindKeys !== false) dom_events.addKey(listener);
|
|
13240
12622
|
El = create_element('div', {
|
|
@@ -13249,26 +12631,11 @@ async function show(data, options = {}) {
|
|
|
13249
12631
|
return;
|
|
13250
12632
|
}
|
|
13251
12633
|
dom_images.show.load();
|
|
13252
|
-
|
|
13253
|
-
const type = options.raw ? '' : await getType(path);
|
|
13254
|
-
switch(type){
|
|
13255
|
-
default:
|
|
13256
|
-
return await viewFile();
|
|
13257
|
-
case 'markdown':
|
|
13258
|
-
return await CloudCmd.Markdown.show(Info.path);
|
|
13259
|
-
case 'html':
|
|
13260
|
-
return viewHtml(path);
|
|
13261
|
-
case 'image':
|
|
13262
|
-
return viewImage(Info.path, prefixURL);
|
|
13263
|
-
case 'media':
|
|
13264
|
-
return await viewMedia(path);
|
|
13265
|
-
case 'pdf':
|
|
13266
|
-
return viewPDF(path);
|
|
13267
|
-
}
|
|
12634
|
+
return await viewFile();
|
|
13268
12635
|
}
|
|
13269
12636
|
const _createIframe = (/* unused pure expression or super */ null && (createIframe));
|
|
13270
12637
|
function createIframe(src, overrides = {}) {
|
|
13271
|
-
const { createElement =
|
|
12638
|
+
const { createElement = _createElement } = overrides;
|
|
13272
12639
|
const element = createElement('iframe', {
|
|
13273
12640
|
src,
|
|
13274
12641
|
width: '100%',
|
|
@@ -13281,29 +12648,9 @@ function createIframe(src, overrides = {}) {
|
|
|
13281
12648
|
}
|
|
13282
12649
|
const _viewHtml = (/* unused pure expression or super */ null && (viewHtml));
|
|
13283
12650
|
function viewHtml(src, overrides = {}) {
|
|
13284
|
-
const { modal =
|
|
12651
|
+
const { modal = _modal } = overrides;
|
|
13285
12652
|
modal.open(createIframe(src), Config);
|
|
13286
12653
|
}
|
|
13287
|
-
function viewPDF(src) {
|
|
13288
|
-
const element = createIframe(src);
|
|
13289
|
-
const options = view_assign({}, Config);
|
|
13290
|
-
if (CloudCmd.config('showFileName')) options.title = Info.name;
|
|
13291
|
-
modal_open(element, options);
|
|
13292
|
-
}
|
|
13293
|
-
async function viewMedia(path) {
|
|
13294
|
-
const [e, element] = await getMediaElement(path);
|
|
13295
|
-
if (e) return alert(e);
|
|
13296
|
-
const allConfig = {
|
|
13297
|
-
...Config,
|
|
13298
|
-
...{
|
|
13299
|
-
autoSize: true,
|
|
13300
|
-
afterShow: ()=>{
|
|
13301
|
-
element.querySelector('audio, video').focus();
|
|
13302
|
-
}
|
|
13303
|
-
}
|
|
13304
|
-
};
|
|
13305
|
-
modal_open(element, allConfig);
|
|
13306
|
-
}
|
|
13307
12654
|
async function viewFile() {
|
|
13308
12655
|
const [error, data] = await Info.getData();
|
|
13309
12656
|
if (error) return dom_images.hide();
|
|
@@ -13334,56 +12681,6 @@ function initConfig(options) {
|
|
|
13334
12681
|
function hide() {
|
|
13335
12682
|
modal_close();
|
|
13336
12683
|
}
|
|
13337
|
-
function viewImage(path, prefixURL) {
|
|
13338
|
-
const isSupportedImage = (a)=>types_isImage(a) || a === path;
|
|
13339
|
-
const makeTitle = (path)=>({
|
|
13340
|
-
href: `${prefixURL}${path}`,
|
|
13341
|
-
title: (0,entity/* .encode */.l)(basename(path))
|
|
13342
|
-
});
|
|
13343
|
-
const names = Info.files.map(DOM.getCurrentPath).filter(isSupportedImage);
|
|
13344
|
-
const titles = names.map(makeTitle);
|
|
13345
|
-
const index = names.indexOf(Info.path);
|
|
13346
|
-
const imageConfig = {
|
|
13347
|
-
index,
|
|
13348
|
-
autoSize: true,
|
|
13349
|
-
arrows: true,
|
|
13350
|
-
keys: true,
|
|
13351
|
-
helpers: {
|
|
13352
|
-
title: {}
|
|
13353
|
-
}
|
|
13354
|
-
};
|
|
13355
|
-
const config = {
|
|
13356
|
-
...Config,
|
|
13357
|
-
...imageConfig
|
|
13358
|
-
};
|
|
13359
|
-
modal_open(titles, config);
|
|
13360
|
-
}
|
|
13361
|
-
async function getMediaElement(src) {
|
|
13362
|
-
view_check(src);
|
|
13363
|
-
const [error, template] = await (0,try_to_catch/* .tryToCatch */.Y)(dom_files.get, 'view/media-tmpl');
|
|
13364
|
-
if (error) return [
|
|
13365
|
-
error
|
|
13366
|
-
];
|
|
13367
|
-
const { name } = Info;
|
|
13368
|
-
if (!TemplateAudio) TemplateAudio = template;
|
|
13369
|
-
const is = isAudio(name);
|
|
13370
|
-
const type = is ? 'audio' : 'video';
|
|
13371
|
-
const innerHTML = (0,rendy/* .rendy */.n)(TemplateAudio, {
|
|
13372
|
-
src,
|
|
13373
|
-
type,
|
|
13374
|
-
name
|
|
13375
|
-
});
|
|
13376
|
-
const element = create_element('div', {
|
|
13377
|
-
innerHTML
|
|
13378
|
-
});
|
|
13379
|
-
return [
|
|
13380
|
-
null,
|
|
13381
|
-
element
|
|
13382
|
-
];
|
|
13383
|
-
}
|
|
13384
|
-
function view_check(src) {
|
|
13385
|
-
if (!isString(src)) throw Error('src should be a string!');
|
|
13386
|
-
}
|
|
13387
12684
|
async function loadAll() {
|
|
13388
12685
|
const { DIR_DIST } = CloudCmd;
|
|
13389
12686
|
(0,util.time)(`${Name} load`);
|