@lvce-editor/extension-detail-view 3.10.0 → 3.11.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.
|
@@ -2378,6 +2378,13 @@ const getExtensionDetailVirtualDom = (extensionDetail, sanitizedReadmeHtml, sele
|
|
|
2378
2378
|
return dom;
|
|
2379
2379
|
};
|
|
2380
2380
|
|
|
2381
|
+
const getExtensionDetailVirtualDom2 = uid => {
|
|
2382
|
+
const {
|
|
2383
|
+
newState
|
|
2384
|
+
} = get$1(uid);
|
|
2385
|
+
return getExtensionDetailVirtualDom(newState, newState.sanitizedReadmeHtml, newState.selectedTab, newState);
|
|
2386
|
+
};
|
|
2387
|
+
|
|
2381
2388
|
const None = 0;
|
|
2382
2389
|
|
|
2383
2390
|
const getCopyMenuEntry = () => ({
|
|
@@ -5305,11 +5312,21 @@ const loadContent = async (state, platform, savedState) => {
|
|
|
5305
5312
|
};
|
|
5306
5313
|
};
|
|
5307
5314
|
|
|
5308
|
-
const
|
|
5315
|
+
const resize = (state, dimensions) => {
|
|
5316
|
+
return {
|
|
5317
|
+
...state,
|
|
5318
|
+
...dimensions
|
|
5319
|
+
};
|
|
5320
|
+
};
|
|
5321
|
+
|
|
5322
|
+
const saveState = uid => {
|
|
5323
|
+
const {
|
|
5324
|
+
newState
|
|
5325
|
+
} = get$1(uid);
|
|
5309
5326
|
const {
|
|
5310
5327
|
selectedTab,
|
|
5311
5328
|
selectedFeature
|
|
5312
|
-
} =
|
|
5329
|
+
} = newState;
|
|
5313
5330
|
return {
|
|
5314
5331
|
selectedTab,
|
|
5315
5332
|
selectedFeature
|
|
@@ -5320,21 +5337,40 @@ const terminate = () => {
|
|
|
5320
5337
|
globalThis.close();
|
|
5321
5338
|
};
|
|
5322
5339
|
|
|
5340
|
+
const wrapCommand = fn => {
|
|
5341
|
+
const wrapped = async (uid, ...args) => {
|
|
5342
|
+
if (typeof uid === 'number') {
|
|
5343
|
+
const {
|
|
5344
|
+
newState
|
|
5345
|
+
} = get$1(uid);
|
|
5346
|
+
const newerState = await fn(newState, ...args);
|
|
5347
|
+
set$1(uid, newState, newerState);
|
|
5348
|
+
} else {
|
|
5349
|
+
// deprecated
|
|
5350
|
+
const newerState = await fn(uid, ...args);
|
|
5351
|
+
return newerState;
|
|
5352
|
+
}
|
|
5353
|
+
};
|
|
5354
|
+
return wrapped;
|
|
5355
|
+
};
|
|
5356
|
+
|
|
5323
5357
|
const commandMap = {
|
|
5324
5358
|
'ExtensionDetail.create': create,
|
|
5325
5359
|
'ExtensionDetail.getMenuEntries': getMenuEntries,
|
|
5326
|
-
'ExtensionDetail.
|
|
5327
|
-
'ExtensionDetail.handleClickDisable': handleClickDisable,
|
|
5328
|
-
'ExtensionDetail.handleClickSize': handleClickSize,
|
|
5329
|
-
'ExtensionDetail.handleClickUninstall': handleClickUninstall,
|
|
5330
|
-
'ExtensionDetail.handleFeaturesClick': handleClickFeatures,
|
|
5331
|
-
'ExtensionDetail.handleIconError': handleIconError,
|
|
5332
|
-
'ExtensionDetail.handleTabsClick': handleTabsClick,
|
|
5333
|
-
'ExtensionDetail.loadContent': loadContent,
|
|
5360
|
+
'ExtensionDetail.getVirtualDom2': getExtensionDetailVirtualDom2,
|
|
5361
|
+
'ExtensionDetail.handleClickDisable': wrapCommand(handleClickDisable),
|
|
5362
|
+
'ExtensionDetail.handleClickSize': wrapCommand(handleClickSize),
|
|
5363
|
+
'ExtensionDetail.handleClickUninstall': wrapCommand(handleClickUninstall),
|
|
5364
|
+
'ExtensionDetail.handleFeaturesClick': wrapCommand(handleClickFeatures),
|
|
5365
|
+
'ExtensionDetail.handleIconError': wrapCommand(handleIconError),
|
|
5366
|
+
'ExtensionDetail.handleTabsClick': wrapCommand(handleTabsClick),
|
|
5367
|
+
'ExtensionDetail.loadContent': wrapCommand(loadContent),
|
|
5368
|
+
'ExtensionDetail.resize': resize,
|
|
5334
5369
|
'ExtensionDetail.saveState': saveState,
|
|
5335
|
-
'ExtensionDetail.selectTab': selectTab,
|
|
5370
|
+
'ExtensionDetail.selectTab': wrapCommand(selectTab),
|
|
5336
5371
|
'ExtensionDetail.terminate': terminate,
|
|
5337
5372
|
// deprecated
|
|
5373
|
+
'ExtensionDetail.getVirtualDom': wrapCommand(getExtensionDetailVirtualDom),
|
|
5338
5374
|
'HandleIconError.handleIconError': handleIconError,
|
|
5339
5375
|
'RenderMarkdown.renderMarkdown': renderMarkdown
|
|
5340
5376
|
};
|