@lvce-editor/extension-detail-view 4.7.0 → 4.8.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.
@@ -57,6 +57,7 @@ const Selector = 'Selector';
57
57
  const SetColorTheme$1 = 'Set Color Theme';
58
58
  const Settings$1 = 'Settings';
59
59
  const Size = 'Size';
60
+ const StringMustNotBeEmpty = 'String must not be empty';
60
61
  const Theme$1 = 'Theme';
61
62
  const Uninstall$1 = 'Uninstall';
62
63
  const UnsupportedFeature = 'Unsupported Feature';
@@ -213,6 +214,9 @@ const license = () => {
213
214
  const propertyMustBeOfTypeString = () => {
214
215
  return i18nString(PropertyMustBeOfTypeString);
215
216
  };
217
+ const stringMustNotBeEmpty = () => {
218
+ return i18nString(StringMustNotBeEmpty);
219
+ };
216
220
  const schemaNotFound = () => {
217
221
  return i18nString(SchemaNotFound);
218
222
  };
@@ -220,10 +224,37 @@ const invalidLink = () => {
220
224
  return i18nString(InvalidLink);
221
225
  };
222
226
 
227
+ const getActivationEntry = value => {
228
+ if (typeof value !== 'string') {
229
+ return {
230
+ isValid: false,
231
+ stringValue: JSON.stringify(value),
232
+ errorMessage: propertyMustBeOfTypeString()
233
+ };
234
+ }
235
+ if (!value) {
236
+ return {
237
+ isValid: false,
238
+ stringValue: '',
239
+ errorMessage: stringMustNotBeEmpty()
240
+ };
241
+ }
242
+ return {
243
+ isValid: true,
244
+ stringValue: value,
245
+ errorMessage: ''
246
+ };
247
+ };
248
+ const getActivationEntries = activation => {
249
+ return activation.map(getActivationEntry);
250
+ };
251
+
223
252
  const getActivationEventsDetails = async extension => {
224
253
  const activationEvents = extension.activation || [];
254
+ const activationEntries = getActivationEntries(activationEvents);
225
255
  return {
226
- activationEvents
256
+ activationEvents,
257
+ activationEntries
227
258
  };
228
259
  };
229
260
 
@@ -348,7 +379,20 @@ const code = {
348
379
  childCount: 1
349
380
  };
350
381
  const getActivationEventVirtualDom = event => {
351
- return [li, code, text(event)];
382
+ const {
383
+ stringValue,
384
+ errorMessage,
385
+ isValid
386
+ } = event;
387
+ if (!isValid) {
388
+ return [{
389
+ type: Li,
390
+ childCount: 1,
391
+ title: errorMessage,
392
+ className: 'ListItem ListItemInvalid'
393
+ }, code, text(stringValue)];
394
+ }
395
+ return [li, code, text(stringValue)];
352
396
  };
353
397
 
354
398
  const getFeatureContentHeadingVirtualDom = heading => {
@@ -371,7 +415,7 @@ const getFeatureActivationEventsVirtualDom = activationEvents$1 => {
371
415
  };
372
416
 
373
417
  const getActivationEventsVirtualDom = state => {
374
- return getFeatureActivationEventsVirtualDom(state.activationEvents);
418
+ return getFeatureActivationEventsVirtualDom(state.activationEntries);
375
419
  };
376
420
 
377
421
  const Text = 1;
@@ -3220,7 +3264,8 @@ const create = (uid, uri, x, y, width, height, platform, assetDir) => {
3220
3264
  paddingRight: 0,
3221
3265
  showSideBar: true,
3222
3266
  sideBarWidth: 0,
3223
- locationProtocol: ''
3267
+ locationProtocol: '',
3268
+ activationEntries: []
3224
3269
  };
3225
3270
  set(uid, state, state);
3226
3271
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/extension-detail-view",
3
- "version": "4.7.0",
3
+ "version": "4.8.0",
4
4
  "description": "Extension Detail View Worker",
5
5
  "repository": {
6
6
  "type": "git",