@lvce-editor/extension-detail-view 5.11.0 → 5.12.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.
@@ -19,6 +19,7 @@ const ContentSecurityPolicy = 'ContentSecurityPolicy';
19
19
  const Copy = 'Copy';
20
20
  const CopyImage = 'Copy Image';
21
21
  const CopyImageUrl = 'Copy Image Url';
22
+ const CopyLink = 'Copy Link';
22
23
  const Details$1 = 'Details';
23
24
  const Disable$1 = 'Disable';
24
25
  const Elements = 'Elements';
@@ -78,6 +79,9 @@ const marketplace = () => {
78
79
  const categories = () => {
79
80
  return i18nString(Categories$1);
80
81
  };
82
+ const copyLink = () => {
83
+ return i18nString(CopyLink);
84
+ };
81
85
  const resources = () => {
82
86
  return i18nString(Resources$1);
83
87
  };
@@ -1150,6 +1154,12 @@ const getType = value => {
1150
1154
  return Unknown;
1151
1155
  }
1152
1156
  };
1157
+ const number = value => {
1158
+ const type = getType(value);
1159
+ if (type !== Number$1) {
1160
+ throw new AssertionError('expected value to be of type number');
1161
+ }
1162
+ };
1153
1163
  const string = value => {
1154
1164
  const type = getType(value);
1155
1165
  if (type !== String) {
@@ -2250,6 +2260,14 @@ const {
2250
2260
  invoke: invoke$1,
2251
2261
  invokeAndTransfer,
2252
2262
  set: set$5} = create$7(RendererWorker);
2263
+ const showContextMenu2 = async (uid, menuId, x, y, args) => {
2264
+ number(uid);
2265
+ number(menuId);
2266
+ number(x);
2267
+ number(y);
2268
+ // @ts-ignore
2269
+ await invoke$1('ContextMenu.show2', uid, menuId, x, y, args);
2270
+ };
2253
2271
  const setColorTheme$1 = async id => {
2254
2272
  // @ts-ignore
2255
2273
  return invoke$1(/* ColorTheme.setColorTheme */'ColorTheme.setColorTheme', /* colorThemeId */id);
@@ -3214,6 +3232,21 @@ const getMenuEntries2 = (state, props) => {
3214
3232
  if (props.menuId === ExtensionDetailIconContextMenu$3) {
3215
3233
  return getMenuEntriesImage();
3216
3234
  }
3235
+ if (props.menuId === ExtensionDetailReadme && props.href) {
3236
+ return [{
3237
+ args: [],
3238
+ command: 'ExtensionDetail.copyLink',
3239
+ flags: None$2,
3240
+ id: 'copyLink',
3241
+ label: copyLink()
3242
+ }, {
3243
+ args: [],
3244
+ command: 'ExtensionDetail.executeCopy',
3245
+ flags: None$2,
3246
+ id: 'copy',
3247
+ label: copy$1()
3248
+ }];
3249
+ }
3217
3250
  return [{
3218
3251
  args: [],
3219
3252
  command: 'ExtensionDetail.executeCopy',
@@ -3308,7 +3341,19 @@ const getMenus = () => {
3308
3341
  }];
3309
3342
  };
3310
3343
 
3311
- const handleAdditionalDetailContextMenu = state => {
3344
+ const show2 = async (uid, menuId, x, y, args) => {
3345
+ await showContextMenu2(uid, menuId, x, y, args);
3346
+ };
3347
+
3348
+ const handleAdditionalDetailContextMenu = async (state, x, y, nodeName, href) => {
3349
+ const {
3350
+ uid
3351
+ } = state;
3352
+ await show2(uid, ExtensionDetailReadme, x, y, {
3353
+ href,
3354
+ menuId: ExtensionDetailReadme,
3355
+ nodeName
3356
+ });
3312
3357
  return state;
3313
3358
  };
3314
3359
 
@@ -3553,11 +3598,6 @@ const handleIconError = state => {
3553
3598
  };
3554
3599
  };
3555
3600
 
3556
- const show2 = async (uid, menuId, x, y, args) => {
3557
- // @ts-ignore
3558
- await invoke$1('ContextMenu.show2', uid, menuId, x, y, args);
3559
- };
3560
-
3561
3601
  const ExtensionDetailIconContextMenu = 4091;
3562
3602
 
3563
3603
  const handleImageContextMenu = async (state, eventX, eventY) => {
@@ -5137,7 +5177,7 @@ const render2 = (uid, diffResult) => {
5137
5177
  const renderEventListeners = () => {
5138
5178
  return [{
5139
5179
  name: HandleAdditionalDetailContextMenu,
5140
- params: ['handleAdditionalDetailsContextMenu'],
5180
+ params: ['handleAdditionalDetailsContextMenu', ClientX, ClientY, 'event.target.nodeName', 'event.target.href'],
5141
5181
  preventDefault: true
5142
5182
  }, {
5143
5183
  name: HandleClickCategory,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/extension-detail-view",
3
- "version": "5.11.0",
3
+ "version": "5.12.0",
4
4
  "description": "Extension Detail View Worker",
5
5
  "repository": {
6
6
  "type": "git",