@skyux/docs-tools 4.9.3 → 4.9.7

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.
@@ -145,7 +145,20 @@ var SkyDocsSourceCodeService = /** @class */ (function () {
145
145
  return sourceCode
146
146
  .filter(function (file) { return file.filePath.indexOf(path) === 0; })
147
147
  .map(function (file) {
148
- file.rawContents = decodeURIComponent(file.rawContents);
148
+ // TODO: Remove decoding after migrating to Angular CLI. Code examples will not be encoded for SKY UX 5 libraries.
149
+ // SKY UX 4 libraries will return rawContents encoded, while later libraries will
150
+ // return rawContents decoded. Check if the contents need decoded before returning them.
151
+ var decodedContents;
152
+ try {
153
+ decodedContents = decodeURIComponent(file.rawContents);
154
+ if (decodedContents !== file.rawContents) {
155
+ file.rawContents = decodedContents;
156
+ }
157
+ }
158
+ catch (error) {
159
+ // Pre-decoded contents may contain characters like '%' that would throw errors.
160
+ // In these cases, pass along the original rawContents.
161
+ }
149
162
  return file;
150
163
  });
151
164
  };
@@ -261,7 +274,7 @@ var SkyDocsCodeExamplesEditorService = /** @class */ (function () {
261
274
  };
262
275
  SkyDocsCodeExamplesEditorService.prototype.getPayload = function (codeExample) {
263
276
  var angularVersion = '^9.0.0';
264
- var skyuxVersion = '*';
277
+ var skyuxVersion = '^4';
265
278
  var defaultDependencies = {
266
279
  '@angular/animations': angularVersion,
267
280
  '@angular/common': angularVersion,
@@ -292,6 +305,16 @@ var SkyDocsCodeExamplesEditorService = /** @class */ (function () {
292
305
  'zone.js': '~0.11.4'
293
306
  };
294
307
  var mergedDependencies = Object.assign({}, defaultDependencies, codeExample.packageDependencies);
308
+ // Ensure any @skyux dependencies list the correct version of SKY UX.
309
+ // e.g. `"@skyux/core": "*"` --> `"@skyux/core": "4.0.0"`
310
+ for (var packageName in mergedDependencies) {
311
+ if (mergedDependencies.hasOwnProperty(packageName)) {
312
+ var version = mergedDependencies[packageName];
313
+ if (version === '*' && /^(@blackbaud\/skyux-lib-|@skyux)/.test(packageName)) {
314
+ mergedDependencies[packageName] = skyuxVersion;
315
+ }
316
+ }
317
+ }
295
318
  var files = this.parseStackBlitzFiles(codeExample.sourceCode, mergedDependencies, codeExample.theme);
296
319
  return {
297
320
  files: files,
@@ -2378,7 +2401,16 @@ var SkyDocsTypeDocAdapterService = /** @class */ (function () {
2378
2401
  : property.name;
2379
2402
  };
2380
2403
  SkyDocsTypeDocAdapterService.prototype.getDefaultValue = function (child, tags) {
2381
- return tags.defaultValue || child.defaultValue || undefined;
2404
+ if (tags.defaultValue) {
2405
+ return tags.defaultValue;
2406
+ }
2407
+ // TypeDoc version 0.20.x stopped auto-generating initializers for the default value
2408
+ // (and replaced them with "...") due to the complicated logic it required.
2409
+ // See: https://github.com/TypeStrong/typedoc/issues/1552
2410
+ if (child.defaultValue === '...') {
2411
+ return;
2412
+ }
2413
+ return child.defaultValue;
2382
2414
  };
2383
2415
  SkyDocsTypeDocAdapterService.prototype.getAnchorId = function (entry) {
2384
2416
  var _a;