@lvce-editor/extension-detail-view 3.57.0 → 3.58.0
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.
|
@@ -22,7 +22,7 @@ const CopyImageUrl = 'Copy Image Url';
|
|
|
22
22
|
const Details$1 = 'Details';
|
|
23
23
|
const Disable$1 = 'Disable';
|
|
24
24
|
const Elements = 'Elements';
|
|
25
|
-
const EmptyCommandsArray = 'The extension
|
|
25
|
+
const EmptyCommandsArray = 'The extension contributes an empty commands array.';
|
|
26
26
|
const Enable$1 = 'Enable';
|
|
27
27
|
const Features$2 = 'Features';
|
|
28
28
|
const FileMatch = 'File Match';
|
|
@@ -691,9 +691,9 @@ const create$7 = rpcId => {
|
|
|
691
691
|
};
|
|
692
692
|
};
|
|
693
693
|
const ExtensionHostWorker = 44;
|
|
694
|
-
const RendererWorker$1 = 1;
|
|
695
694
|
const FileSystemWorker$1 = 209;
|
|
696
695
|
const MarkdownWorker$1 = 300;
|
|
696
|
+
const RendererWorker$1 = 1;
|
|
697
697
|
const {
|
|
698
698
|
invoke: invoke$9,
|
|
699
699
|
set: set$9} = create$7(ExtensionHostWorker);
|
|
@@ -1937,7 +1937,8 @@ const splitLines = lines => {
|
|
|
1937
1937
|
return lines.split(NewLine);
|
|
1938
1938
|
};
|
|
1939
1939
|
const getCurrentStack = () => {
|
|
1940
|
-
const
|
|
1940
|
+
const stackLinesToSkip = 3;
|
|
1941
|
+
const currentStack = joinLines(splitLines(new Error().stack || '').slice(stackLinesToSkip));
|
|
1941
1942
|
return currentStack;
|
|
1942
1943
|
};
|
|
1943
1944
|
const getNewLineIndex = (string, startIndex = undefined) => {
|
|
@@ -2208,6 +2209,12 @@ const invokeAndTransfer = (ipc, method, ...params) => {
|
|
|
2208
2209
|
return invokeHelper(ipc, method, params, true);
|
|
2209
2210
|
};
|
|
2210
2211
|
|
|
2212
|
+
class CommandNotFoundError extends Error {
|
|
2213
|
+
constructor(command) {
|
|
2214
|
+
super(`Command not found ${command}`);
|
|
2215
|
+
this.name = 'CommandNotFoundError';
|
|
2216
|
+
}
|
|
2217
|
+
}
|
|
2211
2218
|
const commands = Object.create(null);
|
|
2212
2219
|
const register = commandMap => {
|
|
2213
2220
|
Object.assign(commands, commandMap);
|
|
@@ -2218,7 +2225,7 @@ const getCommand = key => {
|
|
|
2218
2225
|
const execute = (command, ...args) => {
|
|
2219
2226
|
const fn = getCommand(command);
|
|
2220
2227
|
if (!fn) {
|
|
2221
|
-
throw new
|
|
2228
|
+
throw new CommandNotFoundError(command);
|
|
2222
2229
|
}
|
|
2223
2230
|
return fn(...args);
|
|
2224
2231
|
};
|
|
@@ -2539,11 +2546,17 @@ const create = (uid, uri, x, y, width, height, platform, assetDir) => {
|
|
|
2539
2546
|
uri,
|
|
2540
2547
|
webViews: [],
|
|
2541
2548
|
width,
|
|
2542
|
-
readmeUrl: ''
|
|
2549
|
+
readmeUrl: '',
|
|
2550
|
+
paddingLeft: 0,
|
|
2551
|
+
paddingRight: 0
|
|
2543
2552
|
};
|
|
2544
2553
|
set(uid, state, state);
|
|
2545
2554
|
};
|
|
2546
2555
|
|
|
2556
|
+
const isEqual$3 = (oldState, newState) => {
|
|
2557
|
+
return oldState.paddingLeft === newState.paddingLeft && oldState.paddingRight === newState.paddingRight;
|
|
2558
|
+
};
|
|
2559
|
+
|
|
2547
2560
|
const isEqual$2 = (oldState, newState) => {
|
|
2548
2561
|
return oldState.focus === newState.focus;
|
|
2549
2562
|
};
|
|
@@ -2562,9 +2575,10 @@ const isEqual = (oldState, newState) => {
|
|
|
2562
2575
|
const RenderFocus = 2;
|
|
2563
2576
|
const RenderItems = 3;
|
|
2564
2577
|
const RenderScrollTop = 4;
|
|
2578
|
+
const RenderCss = 5;
|
|
2565
2579
|
|
|
2566
|
-
const modules = [isEqual$1, isEqual$2, isEqual];
|
|
2567
|
-
const numbers = [RenderItems, RenderFocus, RenderScrollTop];
|
|
2580
|
+
const modules = [isEqual$1, isEqual$2, isEqual, isEqual$3];
|
|
2581
|
+
const numbers = [RenderItems, RenderFocus, RenderScrollTop, RenderCss];
|
|
2568
2582
|
|
|
2569
2583
|
const diff2 = uid => {
|
|
2570
2584
|
const {
|
|
@@ -3336,7 +3350,8 @@ function prettyBytes(number, options) {
|
|
|
3336
3350
|
const exponent = Math.min(Math.floor(options.binary ? log(number) / Math.log(1024) : log10(number) / 3), UNITS.length - 1);
|
|
3337
3351
|
number = divide(number, (options.binary ? 1024 : 1000) ** exponent);
|
|
3338
3352
|
if (!localeOptions) {
|
|
3339
|
-
|
|
3353
|
+
const minPrecision = Math.max(3, Number.parseInt(number, 10).toString().length);
|
|
3354
|
+
number = number.toPrecision(minPrecision);
|
|
3340
3355
|
}
|
|
3341
3356
|
const numberString = toLocaleString(Number(number), options.locale, localeOptions);
|
|
3342
3357
|
const unit = UNITS[exponent];
|
|
@@ -3544,6 +3559,8 @@ const loadContent = async (state, platform, savedState, isTest = false) => {
|
|
|
3544
3559
|
resources,
|
|
3545
3560
|
folderSize
|
|
3546
3561
|
} = await loadSideBarContent(extensionId, extensionVersion, extensionUri, isBuiltin);
|
|
3562
|
+
const paddingLeft = 30;
|
|
3563
|
+
const paddingRight = 30;
|
|
3547
3564
|
return {
|
|
3548
3565
|
...state,
|
|
3549
3566
|
badge,
|
|
@@ -3575,7 +3592,9 @@ const loadContent = async (state, platform, savedState, isTest = false) => {
|
|
|
3575
3592
|
selectedTab,
|
|
3576
3593
|
sizeOnDisk: size,
|
|
3577
3594
|
sizeValue,
|
|
3578
|
-
tabs: enabledTabs
|
|
3595
|
+
tabs: enabledTabs,
|
|
3596
|
+
paddingLeft,
|
|
3597
|
+
paddingRight
|
|
3579
3598
|
};
|
|
3580
3599
|
};
|
|
3581
3600
|
|
|
@@ -3596,6 +3615,27 @@ const openImageInNewTab = async state => {
|
|
|
3596
3615
|
return state;
|
|
3597
3616
|
};
|
|
3598
3617
|
|
|
3618
|
+
/* eslint-disable @typescript-eslint/prefer-readonly-parameter-types */
|
|
3619
|
+
|
|
3620
|
+
const createCss = object => {
|
|
3621
|
+
const inner = Object.entries(object).map(([key, value]) => ` --${key}: ${value}px;`).join('\n');
|
|
3622
|
+
const full = `:root {\n${inner}\n}`;
|
|
3623
|
+
return full;
|
|
3624
|
+
};
|
|
3625
|
+
|
|
3626
|
+
const renderCss = (oldState, newState) => {
|
|
3627
|
+
const {
|
|
3628
|
+
uid,
|
|
3629
|
+
paddingLeft,
|
|
3630
|
+
paddingRight
|
|
3631
|
+
} = newState;
|
|
3632
|
+
const css = createCss({
|
|
3633
|
+
ExtensionDetailPaddingLeft: paddingLeft,
|
|
3634
|
+
ExtensionDetailPaddingRight: paddingRight
|
|
3635
|
+
});
|
|
3636
|
+
return ['Viewlet.setCss', uid, css];
|
|
3637
|
+
};
|
|
3638
|
+
|
|
3599
3639
|
const getChangelogVirtualDom = changelogDom => {
|
|
3600
3640
|
// const notImplemented = ExtensionDetailStrings.notImplemented()
|
|
3601
3641
|
// TODO set tabpanel role
|
|
@@ -4065,6 +4105,8 @@ const getRenderer = diffType => {
|
|
|
4065
4105
|
return renderFocus;
|
|
4066
4106
|
case RenderScrollTop:
|
|
4067
4107
|
return renderScrollTop;
|
|
4108
|
+
case RenderCss:
|
|
4109
|
+
return renderCss;
|
|
4068
4110
|
default:
|
|
4069
4111
|
throw new Error('unknown renderer');
|
|
4070
4112
|
}
|