cloudcmd 19.20.5 → 19.20.6
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 +5 -0
- package/HELP.md +2 -1
- package/README.md +1 -1
- package/dist/cloudcmd.common.js +750 -60
- 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.js +27 -9
- 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 +1 -1
package/dist/cloudcmd.common.js
CHANGED
|
@@ -2790,6 +2790,541 @@ 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
|
+
|
|
2793
3328
|
},
|
|
2794
3329
|
6578(module) {
|
|
2795
3330
|
"use strict";
|
|
@@ -7904,10 +8439,10 @@ const FILES_JSON = 'config|modules';
|
|
|
7904
8439
|
const FILES_HTML = 'file|path|link|pathLink|media';
|
|
7905
8440
|
const FILES_HTML_ROOT = 'view/media-tmpl|config-tmpl|upload';
|
|
7906
8441
|
const DIR_HTML = '/tmpl/';
|
|
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);
|
|
8442
|
+
const DIR_HTML_FS = (/* runtime-dependent pure expression or super */ /^(127|145|392|791|816|968|985)$/.test(__webpack_require__.j) ? (`${DIR_HTML}fs/`) : null);
|
|
7908
8443
|
const DIR_JSON = '/json/';
|
|
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);
|
|
8444
|
+
const timeout = (/* runtime-dependent pure expression or super */ /^(127|145|392|791|816|968|985)$/.test(__webpack_require__.j) ? (getTimeoutOnce(2000)) : null);
|
|
8445
|
+
const get = (/* runtime-dependent pure expression or super */ /^(127|145|392|791|816|968|985)$/.test(__webpack_require__.j) ? (getFile) : null);
|
|
7911
8446
|
function getFile(name) {
|
|
7912
8447
|
const type = itype__rspack_import_0(name);
|
|
7913
8448
|
check(name);
|
|
@@ -9378,12 +9913,12 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
9378
9913
|
691(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
9379
9914
|
"use strict";
|
|
9380
9915
|
/* import */ var execon__rspack_import_0 = __webpack_require__(9168);
|
|
9381
|
-
/* import */ var
|
|
9382
|
-
/* import */ var
|
|
9383
|
-
/* import */ var
|
|
9384
|
-
/* import */ var
|
|
9385
|
-
/* import */ var
|
|
9386
|
-
/* import */ var
|
|
9916
|
+
/* import */ var wraptile__rspack_import_6 = __webpack_require__(9317);
|
|
9917
|
+
/* import */ var _dom_load__rspack_import_1 = __webpack_require__(8576);
|
|
9918
|
+
/* import */ var _dom_dialog__rspack_import_2 = __webpack_require__(6462);
|
|
9919
|
+
/* import */ var _common_cloudfunc__rspack_import_3 = __webpack_require__(5700);
|
|
9920
|
+
/* import */ var _dom_images__rspack_import_4 = __webpack_require__(6226);
|
|
9921
|
+
/* import */ var _current_file_js__rspack_import_5 = __webpack_require__(4958);
|
|
9387
9922
|
/* global CloudCmd */
|
|
9388
9923
|
|
|
9389
9924
|
|
|
@@ -9391,12 +9926,12 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
9391
9926
|
|
|
9392
9927
|
|
|
9393
9928
|
|
|
9394
|
-
const loadFile =
|
|
9395
|
-
const onEnd =
|
|
9929
|
+
const loadFile = wraptile__rspack_import_6(_loadFile);
|
|
9930
|
+
const onEnd = wraptile__rspack_import_6(_onEnd);
|
|
9396
9931
|
const uploadFiles = (dir, files)=>{
|
|
9397
9932
|
if (!files) {
|
|
9398
9933
|
files = dir;
|
|
9399
|
-
dir = (0,
|
|
9934
|
+
dir = (0,_current_file_js__rspack_import_5.getCurrentDirPath)();
|
|
9400
9935
|
}
|
|
9401
9936
|
const n = files.length;
|
|
9402
9937
|
if (!n) return;
|
|
@@ -9414,21 +9949,21 @@ function _loadFile(dir, n, file, callback) {
|
|
|
9414
9949
|
const { name } = file;
|
|
9415
9950
|
const path = dir + name;
|
|
9416
9951
|
const { prefixURL } = CloudCmd;
|
|
9417
|
-
const api = prefixURL +
|
|
9952
|
+
const api = prefixURL + _common_cloudfunc__rspack_import_3.FS;
|
|
9418
9953
|
const percent = (i, n, per = 100)=>{
|
|
9419
9954
|
return Math.round(i * per / n);
|
|
9420
9955
|
};
|
|
9421
9956
|
const step = (n)=>100 / n;
|
|
9422
9957
|
++i;
|
|
9423
|
-
|
|
9958
|
+
_dom_load__rspack_import_1.put(api + path, file).on('error', showError).on('end', callback).on('progress', (count)=>{
|
|
9424
9959
|
const max = step(n);
|
|
9425
9960
|
const value = (i - 1) * max + percent(count, 100, max);
|
|
9426
|
-
|
|
9427
|
-
|
|
9961
|
+
_dom_images__rspack_import_4.show.load('top');
|
|
9962
|
+
_dom_images__rspack_import_4.setProgress(Math.round(value));
|
|
9428
9963
|
});
|
|
9429
9964
|
}
|
|
9430
9965
|
function showError({ message }) {
|
|
9431
|
-
(0,
|
|
9966
|
+
(0,_dom_dialog__rspack_import_2.alert)(message);
|
|
9432
9967
|
}
|
|
9433
9968
|
|
|
9434
9969
|
__webpack_require__.d(__webpack_exports__, {
|
|
@@ -9748,11 +10283,11 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
9748
10283
|
2690(__unused_rspack___webpack_module__, __unused_rspack___webpack_exports__, __webpack_require__) {
|
|
9749
10284
|
"use strict";
|
|
9750
10285
|
/* import */ var execon__rspack_import_0 = __webpack_require__(9168);
|
|
9751
|
-
/* import */ var
|
|
9752
|
-
/* import */ var
|
|
9753
|
-
/* import */ var
|
|
9754
|
-
/* import */ var
|
|
9755
|
-
/* import */ var
|
|
10286
|
+
/* import */ var currify__rspack_import_5 = __webpack_require__(4299);
|
|
10287
|
+
/* import */ var load_js__rspack_import_1 = __webpack_require__(1256);
|
|
10288
|
+
/* import */ var _dom_load__rspack_import_2 = __webpack_require__(8576);
|
|
10289
|
+
/* import */ var _dom_files__rspack_import_3 = __webpack_require__(4701);
|
|
10290
|
+
/* import */ var _dom_images__rspack_import_4 = __webpack_require__(6226);
|
|
9756
10291
|
/* global CloudCmd, filepicker */
|
|
9757
10292
|
|
|
9758
10293
|
|
|
@@ -9760,7 +10295,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
9760
10295
|
|
|
9761
10296
|
|
|
9762
10297
|
const { log } = CloudCmd;
|
|
9763
|
-
const upload =
|
|
10298
|
+
const upload = currify__rspack_import_5(_upload);
|
|
9764
10299
|
const Name = 'Cloud';
|
|
9765
10300
|
CloudCmd[Name] = {
|
|
9766
10301
|
init,
|
|
@@ -9771,7 +10306,7 @@ async function init() {
|
|
|
9771
10306
|
const [modules] = await loadFiles();
|
|
9772
10307
|
const { key } = modules.data.FilePicker;
|
|
9773
10308
|
filepicker.setKey(key);
|
|
9774
|
-
|
|
10309
|
+
_dom_images__rspack_import_4.hide();
|
|
9775
10310
|
}
|
|
9776
10311
|
function uploadFile(filename, data) {
|
|
9777
10312
|
const mimetype = '';
|
|
@@ -9789,7 +10324,7 @@ function _upload(callback, file) {
|
|
|
9789
10324
|
const { url, filename } = file;
|
|
9790
10325
|
const responseType = 'arraybuffer';
|
|
9791
10326
|
const success = execon__rspack_import_0["with"](callback, filename);
|
|
9792
|
-
(0,
|
|
10327
|
+
(0,_dom_load__rspack_import_2.ajax)({
|
|
9793
10328
|
url,
|
|
9794
10329
|
responseType,
|
|
9795
10330
|
success
|
|
@@ -9798,8 +10333,8 @@ function _upload(callback, file) {
|
|
|
9798
10333
|
function loadFiles() {
|
|
9799
10334
|
const js = '//api.filepicker.io/v2/filepicker.js';
|
|
9800
10335
|
return Promise.all([
|
|
9801
|
-
|
|
9802
|
-
|
|
10336
|
+
_dom_files__rspack_import_3.get('modules'),
|
|
10337
|
+
load_js__rspack_import_1.js(js)
|
|
9803
10338
|
]);
|
|
9804
10339
|
}
|
|
9805
10340
|
|
|
@@ -10754,11 +11289,11 @@ function hide() {
|
|
|
10754
11289
|
634(__unused_rspack___webpack_module__, __unused_rspack___webpack_exports__, __webpack_require__) {
|
|
10755
11290
|
"use strict";
|
|
10756
11291
|
/* import */ var execon__rspack_import_0 = __webpack_require__(9168);
|
|
10757
|
-
/* import */ var
|
|
11292
|
+
/* import */ var currify__rspack_import_4 = __webpack_require__(4299);
|
|
10758
11293
|
/* import */ var try_to_catch__rspack_import_5 = __webpack_require__(980);
|
|
10759
|
-
/* import */ var
|
|
10760
|
-
/* import */ var
|
|
10761
|
-
/* import */ var
|
|
11294
|
+
/* import */ var load_js__rspack_import_1 = __webpack_require__(1256);
|
|
11295
|
+
/* import */ var _cloudcmd_create_element__rspack_import_2 = __webpack_require__(407);
|
|
11296
|
+
/* import */ var _dom_images__rspack_import_3 = __webpack_require__(6226);
|
|
10762
11297
|
/* global CloudCmd */ /* global Util */ /* global DOM */ /* global Console */
|
|
10763
11298
|
|
|
10764
11299
|
|
|
@@ -10774,13 +11309,13 @@ const { Dialog, CurrentInfo: Info } = DOM;
|
|
|
10774
11309
|
const rmLastSlash = (a)=>a.replace(/\/$/, '') || '/';
|
|
10775
11310
|
let konsole;
|
|
10776
11311
|
const { config } = CloudCmd;
|
|
10777
|
-
const cd =
|
|
11312
|
+
const cd = currify__rspack_import_4((fn, dir)=>fn(`cd ${rmLastSlash(dir)}`));
|
|
10778
11313
|
const Name = 'Konsole';
|
|
10779
11314
|
let Element;
|
|
10780
11315
|
let Loaded;
|
|
10781
11316
|
async function init() {
|
|
10782
11317
|
if (!config('console')) return;
|
|
10783
|
-
|
|
11318
|
+
_dom_images__rspack_import_3.show.load('top');
|
|
10784
11319
|
await CloudCmd.View();
|
|
10785
11320
|
await load();
|
|
10786
11321
|
await create();
|
|
@@ -10816,7 +11351,7 @@ const create = async ()=>{
|
|
|
10816
11351
|
prefixSocket: getPrefixSocket(),
|
|
10817
11352
|
socketPath: CloudCmd.prefix
|
|
10818
11353
|
};
|
|
10819
|
-
Element =
|
|
11354
|
+
Element = _cloudcmd_create_element__rspack_import_2('div', {
|
|
10820
11355
|
className: 'console'
|
|
10821
11356
|
});
|
|
10822
11357
|
konsole = await Console(Element, options);
|
|
@@ -10851,7 +11386,7 @@ const load = async ()=>{
|
|
|
10851
11386
|
Util.time(`${Name} load`);
|
|
10852
11387
|
const prefix = getPrefix();
|
|
10853
11388
|
const url = `${prefix}/console.js`;
|
|
10854
|
-
const [error] = await (0,try_to_catch__rspack_import_5/* .tryToCatch */.Y)(
|
|
11389
|
+
const [error] = await (0,try_to_catch__rspack_import_5/* .tryToCatch */.Y)(load_js__rspack_import_1.js, url);
|
|
10855
11390
|
Loaded = true;
|
|
10856
11391
|
Util.timeEnd(`${Name} load`);
|
|
10857
11392
|
if (error) return Dialog.alert(error.message, {
|
|
@@ -10940,11 +11475,11 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
10940
11475
|
347(__unused_rspack___webpack_module__, __unused_rspack___webpack_exports__, __webpack_require__) {
|
|
10941
11476
|
"use strict";
|
|
10942
11477
|
/* import */ var execon__rspack_import_0 = __webpack_require__(9168);
|
|
10943
|
-
/* import */ var
|
|
10944
|
-
/* import */ var
|
|
10945
|
-
/* import */ var
|
|
10946
|
-
/* import */ var
|
|
10947
|
-
/* import */ var
|
|
11478
|
+
/* import */ var wraptile__rspack_import_5 = __webpack_require__(9317);
|
|
11479
|
+
/* import */ var _cloudcmd_create_element__rspack_import_1 = __webpack_require__(407);
|
|
11480
|
+
/* import */ var _dom_load__rspack_import_2 = __webpack_require__(8576);
|
|
11481
|
+
/* import */ var _dom_rest__rspack_import_3 = __webpack_require__(6550);
|
|
11482
|
+
/* import */ var _common_cloudfunc__rspack_import_4 = __webpack_require__(5700);
|
|
10948
11483
|
|
|
10949
11484
|
|
|
10950
11485
|
|
|
@@ -10956,7 +11491,7 @@ const { config, Key } = CloudCmd;
|
|
|
10956
11491
|
const { Buffer, Events, Dialog, Images } = DOM;
|
|
10957
11492
|
const Info = DOM.CurrentInfo;
|
|
10958
11493
|
const alertNoFiles = Dialog.alert.noFiles;
|
|
10959
|
-
const uploadTo =
|
|
11494
|
+
const uploadTo = wraptile__rspack_import_5(_uploadTo);
|
|
10960
11495
|
let MenuShowedName;
|
|
10961
11496
|
let MenuContext;
|
|
10962
11497
|
let MenuContextFile;
|
|
@@ -11128,7 +11663,7 @@ function uploadFromCloud() {
|
|
|
11128
11663
|
Images.show.load('top');
|
|
11129
11664
|
CloudCmd.execFromModule('Cloud', 'saveFile', async (currentName, data)=>{
|
|
11130
11665
|
const path = DOM.getCurrentDirPath() + currentName;
|
|
11131
|
-
const [e] = await
|
|
11666
|
+
const [e] = await _dom_rest__rspack_import_3.write(path, data);
|
|
11132
11667
|
if (e) return;
|
|
11133
11668
|
await CloudCmd.refresh({
|
|
11134
11669
|
currentName
|
|
@@ -11155,11 +11690,11 @@ function download(type) {
|
|
|
11155
11690
|
* no need in hash so we escape #
|
|
11156
11691
|
* and all other characters, like "%"
|
|
11157
11692
|
*/ const encodedPath = encodeURI(path).replace(/#/g, '#');
|
|
11158
|
-
const id = (0,
|
|
11693
|
+
const id = (0,_dom_load__rspack_import_2.getIdBySrc)(path);
|
|
11159
11694
|
let src;
|
|
11160
11695
|
if (isDir) src = prefixURL + PACK + encodedPath + DOM.getPackerExt(type);
|
|
11161
|
-
else src = prefixURL +
|
|
11162
|
-
const element =
|
|
11696
|
+
else src = prefixURL + _common_cloudfunc__rspack_import_4.FS + encodedPath + '?download';
|
|
11697
|
+
const element = _cloudcmd_create_element__rspack_import_1('iframe', {
|
|
11163
11698
|
id: id + '-' + date,
|
|
11164
11699
|
async: false,
|
|
11165
11700
|
className: 'hidden',
|
|
@@ -12229,15 +12764,28 @@ function getCodeFrame({ error, source }) {
|
|
|
12229
12764
|
|
|
12230
12765
|
|
|
12231
12766
|
},
|
|
12232
|
-
|
|
12767
|
+
2418(__unused_rspack___webpack_module__, __unused_rspack___webpack_exports__, __webpack_require__) {
|
|
12233
12768
|
"use strict";
|
|
12234
12769
|
|
|
12235
12770
|
// UNUSED EXPORTS: _Config, _createIframe, _initConfig, _viewHtml, hide, init, show
|
|
12771
|
+
// NAMESPACE OBJECT: ./node_modules/@cloudcmd/modal/lib/modal.js
|
|
12772
|
+
var modal_namespaceObject = {};
|
|
12773
|
+
__webpack_require__.r(modal_namespaceObject);
|
|
12774
|
+
__webpack_require__.d(modal_namespaceObject, {
|
|
12775
|
+
_onMainClick: () => (_onMainClick),
|
|
12776
|
+
_optionsStore: () => (_optionsStore),
|
|
12777
|
+
close: () => (modal_close),
|
|
12778
|
+
open: () => (modal_open) });
|
|
12236
12779
|
|
|
12780
|
+
|
|
12781
|
+
// EXTERNAL MODULE: ./node_modules/rendy/lib/rendy.js
|
|
12782
|
+
var rendy = __webpack_require__(4492);
|
|
12237
12783
|
// EXTERNAL MODULE: ./node_modules/currify/lib/currify.js
|
|
12238
12784
|
var currify = __webpack_require__(4299);
|
|
12239
12785
|
// EXTERNAL MODULE: ./node_modules/wraptile/lib/wraptile.js
|
|
12240
12786
|
var wraptile = __webpack_require__(9317);
|
|
12787
|
+
// EXTERNAL MODULE: ./node_modules/try-to-catch/lib/try-to-catch.js
|
|
12788
|
+
var try_to_catch = __webpack_require__(980);
|
|
12241
12789
|
// EXTERNAL MODULE: ./node_modules/load.js/lib/load.js
|
|
12242
12790
|
var load = __webpack_require__(1256);
|
|
12243
12791
|
// EXTERNAL MODULE: ./node_modules/fullstore/lib/fullstore.js
|
|
@@ -12431,7 +12979,7 @@ const noop = () => {};
|
|
|
12431
12979
|
|
|
12432
12980
|
const optionsStore = (0,fullstore/* .fullstore */.p)({});
|
|
12433
12981
|
|
|
12434
|
-
const
|
|
12982
|
+
const modal_innerHTML = `
|
|
12435
12983
|
<div class="modal-child" data-name="modal-child">
|
|
12436
12984
|
<div class="modal-close" data-name="modal-close"></div>
|
|
12437
12985
|
</div>
|
|
@@ -12480,7 +13028,7 @@ const modal_open = (inner, options = {}) => {
|
|
|
12480
13028
|
});
|
|
12481
13029
|
|
|
12482
13030
|
const el = create_element('div', {
|
|
12483
|
-
innerHTML,
|
|
13031
|
+
innerHTML: modal_innerHTML,
|
|
12484
13032
|
className,
|
|
12485
13033
|
dataName: 'modal-main',
|
|
12486
13034
|
});
|
|
@@ -12541,8 +13089,8 @@ const modal_close = (event, overrides = {}) => {
|
|
|
12541
13089
|
afterClose();
|
|
12542
13090
|
};
|
|
12543
13091
|
|
|
12544
|
-
const _optionsStore =
|
|
12545
|
-
const _onMainClick =
|
|
13092
|
+
const _optionsStore = optionsStore;
|
|
13093
|
+
const _onMainClick = onMainClick;
|
|
12546
13094
|
|
|
12547
13095
|
function check(inner) {
|
|
12548
13096
|
if (!inner)
|
|
@@ -12551,10 +13099,65 @@ function check(inner) {
|
|
|
12551
13099
|
|
|
12552
13100
|
// EXTERNAL MODULE: ./common/util.js
|
|
12553
13101
|
var util = __webpack_require__(2007);
|
|
13102
|
+
// EXTERNAL MODULE: ./client/dom/files.js
|
|
13103
|
+
var dom_files = __webpack_require__(4701);
|
|
12554
13104
|
// EXTERNAL MODULE: ./client/dom/events/index.js
|
|
12555
13105
|
var dom_events = __webpack_require__(3410);
|
|
13106
|
+
// EXTERNAL MODULE: ./common/cloudfunc.js
|
|
13107
|
+
var cloudfunc = __webpack_require__(5700);
|
|
12556
13108
|
// EXTERNAL MODULE: ./client/dom/images.js
|
|
12557
13109
|
var dom_images = __webpack_require__(6226);
|
|
13110
|
+
// EXTERNAL MODULE: ./common/entity.js
|
|
13111
|
+
var entity = __webpack_require__(9460);
|
|
13112
|
+
// EXTERNAL MODULE: ./node_modules/path-browserify/index.js
|
|
13113
|
+
var path_browserify = __webpack_require__(7975);
|
|
13114
|
+
;// CONCATENATED MODULE: ./client/modules/view/types.js
|
|
13115
|
+
|
|
13116
|
+
|
|
13117
|
+
const isAudio = (name)=>/\.(mp3|ogg|m4a|flac)$/i.test(name);
|
|
13118
|
+
const testRegExp = currify((name, reg)=>reg.test(name));
|
|
13119
|
+
const getRegExp = (ext)=>RegExp(`\\.${ext}$`, 'i');
|
|
13120
|
+
const isPDF = (a)=>/\.pdf$/i.test(a);
|
|
13121
|
+
const isHTML = (a)=>a.endsWith('.html');
|
|
13122
|
+
const isMarkdown = (a)=>/.\.md$/.test(a);
|
|
13123
|
+
const getType = async (path)=>{
|
|
13124
|
+
const ext = (0,path_browserify.extname)(path);
|
|
13125
|
+
if (!ext) path = await detectType(path);
|
|
13126
|
+
if (isPDF(path)) return 'pdf';
|
|
13127
|
+
if (types_isImage(path)) return 'image';
|
|
13128
|
+
if (isMedia(path)) return 'media';
|
|
13129
|
+
if (isHTML(path)) return 'html';
|
|
13130
|
+
if (isMarkdown(path)) return 'markdown';
|
|
13131
|
+
};
|
|
13132
|
+
function types_isImage(name) {
|
|
13133
|
+
const images = [
|
|
13134
|
+
'jp(e|g|eg)',
|
|
13135
|
+
'gif',
|
|
13136
|
+
'png',
|
|
13137
|
+
'bmp',
|
|
13138
|
+
'webp',
|
|
13139
|
+
'svg',
|
|
13140
|
+
'ico'
|
|
13141
|
+
];
|
|
13142
|
+
return images.map(getRegExp).some(testRegExp(name));
|
|
13143
|
+
}
|
|
13144
|
+
function isMedia(name) {
|
|
13145
|
+
return isAudio(name) || isVideo(name);
|
|
13146
|
+
}
|
|
13147
|
+
function isVideo(name) {
|
|
13148
|
+
return /\.(mp4|avi|webm)$/i.test(name);
|
|
13149
|
+
}
|
|
13150
|
+
const _detectType = (/* unused pure expression or super */ null && (detectType));
|
|
13151
|
+
async function detectType(path) {
|
|
13152
|
+
const { headers } = await fetch(path, {
|
|
13153
|
+
method: 'HEAD'
|
|
13154
|
+
});
|
|
13155
|
+
for (const [name, value] of headers){
|
|
13156
|
+
if (name === 'content-type') return `.${value.split('/').pop()}`;
|
|
13157
|
+
}
|
|
13158
|
+
return '';
|
|
13159
|
+
}
|
|
13160
|
+
|
|
12558
13161
|
;// CONCATENATED MODULE: ./client/modules/view/index.js
|
|
12559
13162
|
|
|
12560
13163
|
|
|
@@ -12565,8 +13168,15 @@ var dom_images = __webpack_require__(6226);
|
|
|
12565
13168
|
|
|
12566
13169
|
|
|
12567
13170
|
|
|
13171
|
+
|
|
13172
|
+
|
|
13173
|
+
|
|
13174
|
+
|
|
13175
|
+
|
|
13176
|
+
|
|
12568
13177
|
const CloudCmd = globalThis.CloudCmd || {};
|
|
12569
13178
|
const DOM = globalThis.DOM || {};
|
|
13179
|
+
const isString = (a)=>typeof a === 'string';
|
|
12570
13180
|
const { assign: view_assign } = Object;
|
|
12571
13181
|
const { isArray: view_isArray } = Array;
|
|
12572
13182
|
const lifo = currify((fn, el, cb, name)=>fn(name, el, cb));
|
|
@@ -12586,7 +13196,9 @@ CloudCmd[Name] = {
|
|
|
12586
13196
|
};
|
|
12587
13197
|
const Info = DOM.CurrentInfo;
|
|
12588
13198
|
const { Key } = CloudCmd;
|
|
13199
|
+
const basename = (a)=>a.split('/').pop();
|
|
12589
13200
|
let El;
|
|
13201
|
+
let TemplateAudio;
|
|
12590
13202
|
let Overlay;
|
|
12591
13203
|
const Config = {
|
|
12592
13204
|
beforeShow: ()=>{
|
|
@@ -12617,6 +13229,7 @@ async function init() {
|
|
|
12617
13229
|
events.forEach(view_addEvent(Overlay, view_onOverlayClick));
|
|
12618
13230
|
}
|
|
12619
13231
|
async function show(data, options = {}) {
|
|
13232
|
+
const prefixURL = CloudCmd.prefixURL + cloudfunc.FS;
|
|
12620
13233
|
if (Loading) return;
|
|
12621
13234
|
if (!options || options.bindKeys !== false) dom_events.addKey(listener);
|
|
12622
13235
|
El = create_element('div', {
|
|
@@ -12631,11 +13244,18 @@ async function show(data, options = {}) {
|
|
|
12631
13244
|
return;
|
|
12632
13245
|
}
|
|
12633
13246
|
dom_images.show.load();
|
|
13247
|
+
const path = prefixURL + Info.path;
|
|
13248
|
+
const type = options.raw ? '' : await getType(path);
|
|
13249
|
+
if (type === 'markdown') return await CloudCmd.Markdown.show(Info.path);
|
|
13250
|
+
if (type === 'html') return viewHtml(path);
|
|
13251
|
+
if (type === 'image') return viewImage(Info.path, prefixURL);
|
|
13252
|
+
if (type === 'media') return await viewMedia(path);
|
|
13253
|
+
if (type === 'pdf') return viewPDF(path);
|
|
12634
13254
|
return await viewFile();
|
|
12635
13255
|
}
|
|
12636
13256
|
const _createIframe = (/* unused pure expression or super */ null && (createIframe));
|
|
12637
13257
|
function createIframe(src, overrides = {}) {
|
|
12638
|
-
const { createElement =
|
|
13258
|
+
const { createElement = create_element } = overrides;
|
|
12639
13259
|
const element = createElement('iframe', {
|
|
12640
13260
|
src,
|
|
12641
13261
|
width: '100%',
|
|
@@ -12648,9 +13268,29 @@ function createIframe(src, overrides = {}) {
|
|
|
12648
13268
|
}
|
|
12649
13269
|
const _viewHtml = (/* unused pure expression or super */ null && (viewHtml));
|
|
12650
13270
|
function viewHtml(src, overrides = {}) {
|
|
12651
|
-
const { modal =
|
|
13271
|
+
const { modal = modal_namespaceObject } = overrides;
|
|
12652
13272
|
modal.open(createIframe(src), Config);
|
|
12653
13273
|
}
|
|
13274
|
+
function viewPDF(src) {
|
|
13275
|
+
const element = createIframe(src);
|
|
13276
|
+
const options = view_assign({}, Config);
|
|
13277
|
+
if (CloudCmd.config('showFileName')) options.title = Info.name;
|
|
13278
|
+
modal_open(element, options);
|
|
13279
|
+
}
|
|
13280
|
+
async function viewMedia(path) {
|
|
13281
|
+
const [e, element] = await getMediaElement(path);
|
|
13282
|
+
if (e) return alert(e);
|
|
13283
|
+
const allConfig = {
|
|
13284
|
+
...Config,
|
|
13285
|
+
...{
|
|
13286
|
+
autoSize: true,
|
|
13287
|
+
afterShow: ()=>{
|
|
13288
|
+
element.querySelector('audio, video').focus();
|
|
13289
|
+
}
|
|
13290
|
+
}
|
|
13291
|
+
};
|
|
13292
|
+
modal_open(element, allConfig);
|
|
13293
|
+
}
|
|
12654
13294
|
async function viewFile() {
|
|
12655
13295
|
const [error, data] = await Info.getData();
|
|
12656
13296
|
if (error) return dom_images.hide();
|
|
@@ -12681,6 +13321,56 @@ function initConfig(options) {
|
|
|
12681
13321
|
function hide() {
|
|
12682
13322
|
modal_close();
|
|
12683
13323
|
}
|
|
13324
|
+
function viewImage(path, prefixURL) {
|
|
13325
|
+
const isSupportedImage = (a)=>types_isImage(a) || a === path;
|
|
13326
|
+
const makeTitle = (path)=>({
|
|
13327
|
+
href: `${prefixURL}${path}`,
|
|
13328
|
+
title: (0,entity/* .encode */.l)(basename(path))
|
|
13329
|
+
});
|
|
13330
|
+
const names = Info.files.map(DOM.getCurrentPath).filter(isSupportedImage);
|
|
13331
|
+
const titles = names.map(makeTitle);
|
|
13332
|
+
const index = names.indexOf(Info.path);
|
|
13333
|
+
const imageConfig = {
|
|
13334
|
+
index,
|
|
13335
|
+
autoSize: true,
|
|
13336
|
+
arrows: true,
|
|
13337
|
+
keys: true,
|
|
13338
|
+
helpers: {
|
|
13339
|
+
title: {}
|
|
13340
|
+
}
|
|
13341
|
+
};
|
|
13342
|
+
const config = {
|
|
13343
|
+
...Config,
|
|
13344
|
+
...imageConfig
|
|
13345
|
+
};
|
|
13346
|
+
modal_open(titles, config);
|
|
13347
|
+
}
|
|
13348
|
+
async function getMediaElement(src) {
|
|
13349
|
+
view_check(src);
|
|
13350
|
+
const [error, template] = await (0,try_to_catch/* .tryToCatch */.Y)(dom_files.get, 'view/media-tmpl');
|
|
13351
|
+
if (error) return [
|
|
13352
|
+
error
|
|
13353
|
+
];
|
|
13354
|
+
const { name } = Info;
|
|
13355
|
+
if (!TemplateAudio) TemplateAudio = template;
|
|
13356
|
+
const is = isAudio(name);
|
|
13357
|
+
const type = is ? 'audio' : 'video';
|
|
13358
|
+
const innerHTML = (0,rendy/* .rendy */.n)(TemplateAudio, {
|
|
13359
|
+
src,
|
|
13360
|
+
type,
|
|
13361
|
+
name
|
|
13362
|
+
});
|
|
13363
|
+
const element = create_element('div', {
|
|
13364
|
+
innerHTML
|
|
13365
|
+
});
|
|
13366
|
+
return [
|
|
13367
|
+
null,
|
|
13368
|
+
element
|
|
13369
|
+
];
|
|
13370
|
+
}
|
|
13371
|
+
function view_check(src) {
|
|
13372
|
+
if (!isString(src)) throw Error('src should be a string!');
|
|
13373
|
+
}
|
|
12684
13374
|
async function loadAll() {
|
|
12685
13375
|
const { DIR_DIST } = CloudCmd;
|
|
12686
13376
|
(0,util.time)(`${Name} load`);
|
|
@@ -12718,19 +13408,19 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
12718
13408
|
if (791 == __webpack_require__.j) {
|
|
12719
13409
|
/* import */ var rendy__rspack_import_3 = __webpack_require__(4492);
|
|
12720
13410
|
|
|
12721
|
-
}/* import */ var
|
|
12722
|
-
/* import */ var
|
|
12723
|
-
/* import */ var
|
|
13411
|
+
}/* import */ var currify__rspack_import_2 = __webpack_require__(4299);
|
|
13412
|
+
/* import */ var fullstore__rspack_import_1 = __webpack_require__(8328);
|
|
13413
|
+
/* import */ var _common_entity__rspack_import_0 = __webpack_require__(9460);
|
|
12724
13414
|
|
|
12725
13415
|
|
|
12726
13416
|
|
|
12727
13417
|
|
|
12728
13418
|
const id = (a)=>a;
|
|
12729
13419
|
const NAME = 'Cloud Commander';
|
|
12730
|
-
const dateFormatter = (/* runtime-dependent pure expression or super */ 791 == __webpack_require__.j ? ((0,
|
|
12731
|
-
const getHeaderField =
|
|
13420
|
+
const dateFormatter = (/* runtime-dependent pure expression or super */ 791 == __webpack_require__.j ? ((0,fullstore__rspack_import_1/* .fullstore */.p)(id)) : null);
|
|
13421
|
+
const getHeaderField = currify__rspack_import_2(_getHeaderField);
|
|
12732
13422
|
const FS = '/fs';
|
|
12733
|
-
const Path = (0,
|
|
13423
|
+
const Path = (0,fullstore__rspack_import_1/* .fullstore */.p)();
|
|
12734
13424
|
Path('/');
|
|
12735
13425
|
const filterOutDotFiles = ({ showDotFiles })=>({ name })=>{
|
|
12736
13426
|
if (showDotFiles) return true;
|
|
@@ -12802,7 +13492,7 @@ function _getDataName(name) {
|
|
|
12802
13492
|
const templateFile = template.file;
|
|
12803
13493
|
const templateLink = template.link;
|
|
12804
13494
|
const json = params.data;
|
|
12805
|
-
const path = (0,
|
|
13495
|
+
const path = (0,_common_entity__rspack_import_0/* .encode */.l)(json.path);
|
|
12806
13496
|
const { files } = json;
|
|
12807
13497
|
/*
|
|
12808
13498
|
* Строим путь каталога в котором мы находимся
|
|
@@ -12860,7 +13550,7 @@ function _getDataName(name) {
|
|
|
12860
13550
|
fileTable += files.filter(filterOutDotFiles({
|
|
12861
13551
|
showDotFiles
|
|
12862
13552
|
})).map(updateField).map((file)=>{
|
|
12863
|
-
const name = (0,
|
|
13553
|
+
const name = (0,_common_entity__rspack_import_0/* .encode */.l)(file.name);
|
|
12864
13554
|
const link = prefix + FS + path + name;
|
|
12865
13555
|
const { type, mode, date, time, owner, size } = file;
|
|
12866
13556
|
const linkResult = (0,rendy__rspack_import_3/* .rendy */.n)(templateLink, {
|