@ng-doc/builder 15.4.1 → 15.5.1

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.
@@ -12,8 +12,8 @@ const core_1 = require("@ng-doc/core");
12
12
  function demoAction(componentName, options) {
13
13
  return () => {
14
14
  return {
15
- output: `<ng-doc-demo componentName="${componentName}">
16
- <div id="options">${(0, core_1.escapeHtml)(JSON.stringify(options !== null && options !== void 0 ? options : {}))}</div>
15
+ output: `<ng-doc-demo componentName="${componentName}">
16
+ <div id="options">${(0, core_1.escapeHtml)(JSON.stringify(options !== null && options !== void 0 ? options : {}))}</div>
17
17
  </ng-doc-demo>`,
18
18
  };
19
19
  };
@@ -1,2 +1,2 @@
1
- export { accessorPresentation, constructorPresentation, displayType, extractDocs, extractParameterDocs, extractSeeDocs, extractSelectors, filterByScope, filterByStatic, filterUselessMembers, firstNodeWithComment, functionPresentation, getAccessorChain, getClassAccessors, getClassMethods, getClassProperties, getContentForPlayground, getDeclarationType, getImplementedMember, getInheritedParent, getInterfaceAccessors, getInterfaceMethods, getInterfaceProperties, getMemberParent, getMethodChain, getOverriddenMember, getPlaygroundClassProperties, getPropertyChain, getTargetForPlayground, getTemplateForPlayground, groupAccessors, marked, methodPresentation, noEmpty, noLineBreaks, notEmptyAssets, sortByNodesName, typeAliasPresentation, variablePresentation } from '../helpers';
1
+ export { accessorPresentation, constructorPresentation, displayType, extractDocs, extractParameterDocs, extractSeeDocs, extractSelectors, filterByScope, filterByStatic, filterUselessMembers, firstNodeWithComment, functionPresentation, getAccessorChain, getClassAccessors, getClassMethods, getClassProperties, getContentForPlayground, getDeclarationType, getImplementedMember, getInheritedParent, getInterfaceAccessors, getInterfaceMethods, getInterfaceProperties, getMemberParent, getMethodChain, getOverriddenMember, getPlaygroundClassProperties, getPropertyChain, getTargetForPlayground, getTemplateForPlayground, groupAccessors, marked, methodPresentation, noEmpty, noLineBreaks, notEmptyAssets, sortByNodesName, sortNavigationEntities, typeAliasPresentation, variablePresentation, } from '../helpers';
2
2
  export { buildPlaygroundDemoTemplate, objectKeys } from '@ng-doc/core';
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  /* Just export filters from this file, they will be included to the template renderer automatically */
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.objectKeys = exports.buildPlaygroundDemoTemplate = exports.variablePresentation = exports.typeAliasPresentation = exports.sortByNodesName = exports.notEmptyAssets = exports.noLineBreaks = exports.noEmpty = exports.methodPresentation = exports.marked = exports.groupAccessors = exports.getTemplateForPlayground = exports.getTargetForPlayground = exports.getPropertyChain = exports.getPlaygroundClassProperties = exports.getOverriddenMember = exports.getMethodChain = exports.getMemberParent = exports.getInterfaceProperties = exports.getInterfaceMethods = exports.getInterfaceAccessors = exports.getInheritedParent = exports.getImplementedMember = exports.getDeclarationType = exports.getContentForPlayground = exports.getClassProperties = exports.getClassMethods = exports.getClassAccessors = exports.getAccessorChain = exports.functionPresentation = exports.firstNodeWithComment = exports.filterUselessMembers = exports.filterByStatic = exports.filterByScope = exports.extractSelectors = exports.extractSeeDocs = exports.extractParameterDocs = exports.extractDocs = exports.displayType = exports.constructorPresentation = exports.accessorPresentation = void 0;
4
+ exports.objectKeys = exports.buildPlaygroundDemoTemplate = exports.variablePresentation = exports.typeAliasPresentation = exports.sortNavigationEntities = exports.sortByNodesName = exports.notEmptyAssets = exports.noLineBreaks = exports.noEmpty = exports.methodPresentation = exports.marked = exports.groupAccessors = exports.getTemplateForPlayground = exports.getTargetForPlayground = exports.getPropertyChain = exports.getPlaygroundClassProperties = exports.getOverriddenMember = exports.getMethodChain = exports.getMemberParent = exports.getInterfaceProperties = exports.getInterfaceMethods = exports.getInterfaceAccessors = exports.getInheritedParent = exports.getImplementedMember = exports.getDeclarationType = exports.getContentForPlayground = exports.getClassProperties = exports.getClassMethods = exports.getClassAccessors = exports.getAccessorChain = exports.functionPresentation = exports.firstNodeWithComment = exports.filterUselessMembers = exports.filterByStatic = exports.filterByScope = exports.extractSelectors = exports.extractSeeDocs = exports.extractParameterDocs = exports.extractDocs = exports.displayType = exports.constructorPresentation = exports.accessorPresentation = void 0;
5
5
  var helpers_1 = require("../helpers");
6
6
  Object.defineProperty(exports, "accessorPresentation", { enumerable: true, get: function () { return helpers_1.accessorPresentation; } });
7
7
  Object.defineProperty(exports, "constructorPresentation", { enumerable: true, get: function () { return helpers_1.constructorPresentation; } });
@@ -40,6 +40,7 @@ Object.defineProperty(exports, "noEmpty", { enumerable: true, get: function () {
40
40
  Object.defineProperty(exports, "noLineBreaks", { enumerable: true, get: function () { return helpers_1.noLineBreaks; } });
41
41
  Object.defineProperty(exports, "notEmptyAssets", { enumerable: true, get: function () { return helpers_1.notEmptyAssets; } });
42
42
  Object.defineProperty(exports, "sortByNodesName", { enumerable: true, get: function () { return helpers_1.sortByNodesName; } });
43
+ Object.defineProperty(exports, "sortNavigationEntities", { enumerable: true, get: function () { return helpers_1.sortNavigationEntities; } });
43
44
  Object.defineProperty(exports, "typeAliasPresentation", { enumerable: true, get: function () { return helpers_1.typeAliasPresentation; } });
44
45
  Object.defineProperty(exports, "variablePresentation", { enumerable: true, get: function () { return helpers_1.variablePresentation; } });
45
46
  var core_1 = require("@ng-doc/core");
@@ -1 +1 @@
1
- {"version":3,"file":"template-filters.js","sourceRoot":"","sources":["../../../../libs/builder/engine/template-filters.ts"],"names":[],"mappings":";AAAA,sGAAsG;;;AAEtG,sCAuCyC;AAtCxC,+GAAA,oBAAoB,OAAA;AACpB,kHAAA,uBAAuB,OAAA;AACvB,sGAAA,WAAW,OAAA;AACX,sGAAA,WAAW,OAAA;AACX,+GAAA,oBAAoB,OAAA;AACpB,yGAAA,cAAc,OAAA;AACd,2GAAA,gBAAgB,OAAA;AAChB,wGAAA,aAAa,OAAA;AACb,yGAAA,cAAc,OAAA;AACd,+GAAA,oBAAoB,OAAA;AACpB,+GAAA,oBAAoB,OAAA;AACpB,+GAAA,oBAAoB,OAAA;AACpB,2GAAA,gBAAgB,OAAA;AAChB,4GAAA,iBAAiB,OAAA;AACjB,0GAAA,eAAe,OAAA;AACf,6GAAA,kBAAkB,OAAA;AAClB,kHAAA,uBAAuB,OAAA;AACvB,6GAAA,kBAAkB,OAAA;AAClB,+GAAA,oBAAoB,OAAA;AACpB,6GAAA,kBAAkB,OAAA;AAClB,gHAAA,qBAAqB,OAAA;AACrB,8GAAA,mBAAmB,OAAA;AACnB,iHAAA,sBAAsB,OAAA;AACtB,0GAAA,eAAe,OAAA;AACf,yGAAA,cAAc,OAAA;AACd,8GAAA,mBAAmB,OAAA;AACnB,uHAAA,4BAA4B,OAAA;AAC5B,2GAAA,gBAAgB,OAAA;AAChB,iHAAA,sBAAsB,OAAA;AACtB,mHAAA,wBAAwB,OAAA;AACxB,yGAAA,cAAc,OAAA;AACd,iGAAA,MAAM,OAAA;AACN,6GAAA,kBAAkB,OAAA;AAClB,kGAAA,OAAO,OAAA;AACP,uGAAA,YAAY,OAAA;AACZ,yGAAA,cAAc,OAAA;AACd,0GAAA,eAAe,OAAA;AACf,gHAAA,qBAAqB,OAAA;AACrB,+GAAA,oBAAoB,OAAA;AACrB,qCAAmE;AAA3D,mHAAA,2BAA2B,OAAA;AAAC,kGAAA,UAAU,OAAA"}
1
+ {"version":3,"file":"template-filters.js","sourceRoot":"","sources":["../../../../libs/builder/engine/template-filters.ts"],"names":[],"mappings":";AAAA,sGAAsG;;;AAEtG,sCAyCoB;AAxCnB,+GAAA,oBAAoB,OAAA;AACpB,kHAAA,uBAAuB,OAAA;AACvB,sGAAA,WAAW,OAAA;AACX,sGAAA,WAAW,OAAA;AACX,+GAAA,oBAAoB,OAAA;AACpB,yGAAA,cAAc,OAAA;AACd,2GAAA,gBAAgB,OAAA;AAChB,wGAAA,aAAa,OAAA;AACb,yGAAA,cAAc,OAAA;AACd,+GAAA,oBAAoB,OAAA;AACpB,+GAAA,oBAAoB,OAAA;AACpB,+GAAA,oBAAoB,OAAA;AACpB,2GAAA,gBAAgB,OAAA;AAChB,4GAAA,iBAAiB,OAAA;AACjB,0GAAA,eAAe,OAAA;AACf,6GAAA,kBAAkB,OAAA;AAClB,kHAAA,uBAAuB,OAAA;AACvB,6GAAA,kBAAkB,OAAA;AAClB,+GAAA,oBAAoB,OAAA;AACpB,6GAAA,kBAAkB,OAAA;AAClB,gHAAA,qBAAqB,OAAA;AACrB,8GAAA,mBAAmB,OAAA;AACnB,iHAAA,sBAAsB,OAAA;AACtB,0GAAA,eAAe,OAAA;AACf,yGAAA,cAAc,OAAA;AACd,8GAAA,mBAAmB,OAAA;AACnB,uHAAA,4BAA4B,OAAA;AAC5B,2GAAA,gBAAgB,OAAA;AAChB,iHAAA,sBAAsB,OAAA;AACtB,mHAAA,wBAAwB,OAAA;AACxB,yGAAA,cAAc,OAAA;AACd,iGAAA,MAAM,OAAA;AACN,6GAAA,kBAAkB,OAAA;AAClB,kGAAA,OAAO,OAAA;AACP,uGAAA,YAAY,OAAA;AACZ,yGAAA,cAAc,OAAA;AACd,0GAAA,eAAe,OAAA;AACf,iHAAA,sBAAsB,OAAA;AACtB,gHAAA,qBAAqB,OAAA;AACrB,+GAAA,oBAAoB,OAAA;AAErB,qCAAqE;AAA7D,mHAAA,2BAA2B,OAAA;AAAE,kGAAA,UAAU,OAAA"}
@@ -30,5 +30,6 @@ export * from './print-console';
30
30
  export * from './process-snippets';
31
31
  export * from './repo-link';
32
32
  export * from './slash';
33
+ export * from './sort-navigation-entities';
33
34
  export * from './typescript';
34
35
  export * from './unique-name';
package/helpers/index.js CHANGED
@@ -33,6 +33,7 @@ tslib_1.__exportStar(require("./print-console"), exports);
33
33
  tslib_1.__exportStar(require("./process-snippets"), exports);
34
34
  tslib_1.__exportStar(require("./repo-link"), exports);
35
35
  tslib_1.__exportStar(require("./slash"), exports);
36
+ tslib_1.__exportStar(require("./sort-navigation-entities"), exports);
36
37
  tslib_1.__exportStar(require("./typescript"), exports);
37
38
  tslib_1.__exportStar(require("./unique-name"), exports);
38
39
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/builder/helpers/index.ts"],"names":[],"mappings":";;;AAAA,yDAA+B;AAC/B,+DAAqC;AACrC,mEAAyC;AACzC,oEAA0C;AAC1C,8DAAoC;AACpC,wDAA8B;AAC9B,yDAA+B;AAC/B,gEAAsC;AACtC,8DAAoC;AACpC,mEAAyC;AACzC,8DAAoC;AACpC,wDAA8B;AAC9B,kEAAwC;AACxC,gEAAsC;AACtC,iEAAuC;AACvC,wEAA8C;AAC9C,mEAAyC;AACzC,yEAA+C;AAC/C,0DAAgC;AAChC,iEAAuC;AACvC,sEAA4C;AAC5C,iEAAuC;AACvC,qEAA2C;AAC3C,mDAAyB;AACzB,qDAA2B;AAC3B,2DAAiC;AACjC,6DAAmC;AACnC,yDAA+B;AAC/B,0DAAgC;AAChC,6DAAmC;AACnC,sDAA4B;AAC5B,kDAAwB;AACxB,uDAA6B;AAC7B,wDAA8B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/builder/helpers/index.ts"],"names":[],"mappings":";;;AAAA,yDAA+B;AAC/B,+DAAqC;AACrC,mEAAyC;AACzC,oEAA0C;AAC1C,8DAAoC;AACpC,wDAA8B;AAC9B,yDAA+B;AAC/B,gEAAsC;AACtC,8DAAoC;AACpC,mEAAyC;AACzC,8DAAoC;AACpC,wDAA8B;AAC9B,kEAAwC;AACxC,gEAAsC;AACtC,iEAAuC;AACvC,wEAA8C;AAC9C,mEAAyC;AACzC,yEAA+C;AAC/C,0DAAgC;AAChC,iEAAuC;AACvC,sEAA4C;AAC5C,iEAAuC;AACvC,qEAA2C;AAC3C,mDAAyB;AACzB,qDAA2B;AAC3B,2DAAiC;AACjC,6DAAmC;AACnC,yDAA+B;AAC/B,0DAAgC;AAChC,6DAAmC;AACnC,sDAA4B;AAC5B,kDAAwB;AACxB,qEAA2C;AAC3C,uDAA6B;AAC7B,wDAA8B"}
@@ -0,0 +1,6 @@
1
+ import { NgDocNavigationEntity } from '../engine/entities/abstractions/navigation.entity';
2
+ /**
3
+ *
4
+ * @param entities
5
+ */
6
+ export declare function sortNavigationEntities<T>(entities: Array<NgDocNavigationEntity<T>>): Array<NgDocNavigationEntity<T>>;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sortNavigationEntities = void 0;
4
+ const is_present_1 = require("@ng-doc/core/helpers/is-present");
5
+ /**
6
+ *
7
+ * @param entities
8
+ */
9
+ function sortNavigationEntities(entities) {
10
+ return entities.sort((a, b) => {
11
+ if ((0, is_present_1.isPresent)(a.order) && (0, is_present_1.isPresent)(b.order)) {
12
+ return a.order - b.order;
13
+ }
14
+ if ((0, is_present_1.isPresent)(a.order)) {
15
+ return -1;
16
+ }
17
+ if ((0, is_present_1.isPresent)(b.order)) {
18
+ return 1;
19
+ }
20
+ return a.title.localeCompare(b.title);
21
+ });
22
+ }
23
+ exports.sortNavigationEntities = sortNavigationEntities;
24
+ //# sourceMappingURL=sort-navigation-entities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sort-navigation-entities.js","sourceRoot":"","sources":["../../../../libs/builder/helpers/sort-navigation-entities.ts"],"names":[],"mappings":";;;AAAA,gEAA0D;AAI1D;;;GAGG;AACH,SAAgB,sBAAsB,CAAI,QAAyC;IAClF,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,CAA2B,EAAE,CAA2B,EAAE,EAAE;QACjF,IAAI,IAAA,sBAAS,EAAC,CAAC,CAAC,KAAK,CAAC,IAAI,IAAA,sBAAS,EAAC,CAAC,CAAC,KAAK,CAAC,EAAE;YAC7C,OAAO,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC;SACzB;QACD,IAAI,IAAA,sBAAS,EAAC,CAAC,CAAC,KAAK,CAAC,EAAE;YACvB,OAAO,CAAC,CAAC,CAAC;SACV;QACD,IAAI,IAAA,sBAAS,EAAC,CAAC,CAAC,KAAK,CAAC,EAAE;YACvB,OAAO,CAAC,CAAC;SACT;QACD,OAAO,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;AACJ,CAAC;AAbD,wDAaC"}
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@ng-doc/builder",
3
- "version": "15.4.1",
3
+ "version": "15.5.1",
4
4
  "type": "commonjs",
5
5
  "builders": "./builders.json",
6
6
  "schematics": "./schematics/collection.json",
7
7
  "dependencies": {
8
- "@ng-doc/core": "15.4.1",
8
+ "@ng-doc/core": "15.5.1",
9
9
  "@angular-devkit/architect": ">=0.1500.0",
10
10
  "chokidar": "^3.5.3",
11
11
  "minimatch": "^5.1.0",
@@ -3,6 +3,7 @@ import {ChangeDetectionStrategy, Component, NgModule, Type} from "@angular/core"
3
3
  import {RouterModule} from "@angular/router";
4
4
  import {CommonModule} from '@angular/common';
5
5
  import {NgDocDemoAssets, NgDocPageModule, NgDocRootPage} from '@ng-doc/app';
6
+ import {NgDocPageType} from '@ng-doc/core';
6
7
  import pageContent from '!!raw-loader!{{ page.builtPagePath }}';
7
8
 
8
9
  @Component({
@@ -11,6 +12,7 @@ import pageContent from '!!raw-loader!{{ page.builtPagePath }}';
11
12
  providers: [{provide: NgDocRootPage, useExisting: DynamicComponent}],
12
13
  })
13
14
  export class DynamicComponent extends NgDocRootPage {
15
+ readonly pageType: NgDocPageType = 'api';
14
16
  {%- if page.editSourceFileUrl %}
15
17
  readonly editSourceFileUrl: string = '{{ page.editSourceFileUrl }}';
16
18
  {%- endif %}
@@ -19,14 +19,14 @@ export const ngDocContextProvider: Provider = {
19
19
  {%- endif %}
20
20
  {%- if entity.navigationItems.length %}
21
21
  children: [
22
- {%- for child in entity.navigationItems %}
22
+ {%- for child in entity.navigationItems | sortNavigationEntities %}
23
23
  {{ nav(child) }},
24
24
  {%- endfor %}
25
25
  ]
26
26
  {%- endif %}
27
27
  }
28
28
  {%- endmacro %}
29
- {%- for entity in entities %}
29
+ {%- for entity in entities | sortNavigationEntities %}
30
30
  {{ nav(entity) }},
31
31
  {%- endfor %}
32
32
  ],
@@ -7,11 +7,13 @@
7
7
  {% set isStatic = declaration.isStatic and declaration.isStatic() %}
8
8
  {% set isAsync = declaration.isAsync and declaration.isAsync() %}
9
9
  {% set isReadonly = declaration.isReadonly and declaration.isReadonly() %}
10
- {% set tooltip = ["Abstract" if isAbstract, 'Static' if isStatic, 'Async' if isAsync, 'Readonly' if isReadonly] | noEmpty | join(', ') %}
10
+ {% set isProtected = declaration.getScope and declaration.getScope() == 'protected' %}
11
+ {% set tooltip = ["Protected" if isProtected, "Abstract" if isAbstract, 'Static' if isStatic, 'Async' if isAsync, 'Readonly' if isReadonly] | noEmpty | join(', ') %}
11
12
 
12
13
  {%- if type == 'badge' %}
13
- {%- if isAbstract or isStatic or isAsync or isReadonly %}
14
+ {%- if isAbstract or isStatic or isAsync or isReadonly or isProtected %}
14
15
  <span class="ng-doc-badge-wrapper" ngDocTooltip="{{ tooltip }}">
16
+ {{ badgeMacro.render("protected") if isProtected }}
15
17
  {{ badgeMacro.render("abstract") if isAbstract }}
16
18
  {{ badgeMacro.render("static") if isStatic }}
17
19
  {{ badgeMacro.render("async") if isAsync }}
@@ -20,8 +22,9 @@
20
22
  {%- endif %}
21
23
 
22
24
  {%- elseif type == 'modifier' %}
23
- {%- if isAbstract or isStatic or isAsync or isReadonly %}
25
+ {%- if isAbstract or isStatic or isAsync or isReadonly or isProtected %}
24
26
  <div class="ng-doc-modifiers-wrapper">
27
+ {{ modifierMacro.render("protected") if isProtected }}
25
28
  {{ modifierMacro.render("abstract") if isAbstract }}
26
29
  {{ modifierMacro.render("static") if isStatic }}
27
30
  {{ modifierMacro.render("async") if isAsync }}
@@ -29,8 +32,9 @@
29
32
  </div>
30
33
  {%- endif %}
31
34
  {%- else %}
32
- {%- if isAbstract or isStatic or isAsync or isReadonly %}
35
+ {%- if isAbstract or isStatic or isAsync or isReadonly or isProtected %}
33
36
  <span class="ng-doc-tags-wrapper">
37
+ {{ tagMacro.render("protected") if isProtected }}
34
38
  {{ tagMacro.render("abstract") if isAbstract }}
35
39
  {{ tagMacro.render("static") if isStatic }}
36
40
  {{ tagMacro.render("async") if isAsync }}
@@ -3,7 +3,7 @@ import {Component, NgModule, Type, ChangeDetectionStrategy} from '@angular/core'
3
3
  import {RouterModule} from '@angular/router';
4
4
  import {CommonModule} from '@angular/common';
5
5
  import {NgDocPageModule, NgDocRootPage, NgDocDemoAssets} from '@ng-doc/app';
6
- import {NgDocDependencies} from '@ng-doc/core';
6
+ import {NgDocDependencies, NgDocPageType} from '@ng-doc/core';
7
7
  import pageContent from '!!raw-loader!{{ page.builtPagePath }}';
8
8
  {%- if page.pageDependencies %}
9
9
  // noinspection ES6UnusedImports
@@ -22,6 +22,7 @@ import demoAssets from '{{ page.componentsAssets }}';
22
22
  providers: [{provide: NgDocRootPage, useExisting: DynamicComponent}],
23
23
  })
24
24
  export class DynamicComponent extends NgDocRootPage {
25
+ readonly pageType: NgDocPageType = 'guide';
25
26
  readonly pageContent: string = pageContent;
26
27
 
27
28
  {%- if page.editSourceFileUrl %}