@foblex/m-render 2.8.7 → 2.8.9

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.
@@ -1725,12 +1725,12 @@ class ExternalComponent {
1725
1725
  this._mediatr.execute(new RenderExternalComponentRequest(this.data().value, this._viewContainerRef()));
1726
1726
  }
1727
1727
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: ExternalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1728
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.1.8", type: ExternalComponent, isStandalone: true, selector: "external-component", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "style.height": "data().height" }, classAttribute: "external-component" }, viewQueries: [{ propertyName: "_viewContainerRef", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef, isSignal: true }], ngImport: i0, template: "<ng-container #container />\n\n", changeDetection: i0.ChangeDetectionStrategy.OnPush });
1728
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.1.8", type: ExternalComponent, isStandalone: true, selector: "external-component", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "style.height": "data().height" }, classAttribute: "f-example-view" }, viewQueries: [{ propertyName: "_viewContainerRef", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef, isSignal: true }], ngImport: i0, template: "<ng-container #container />\n\n", changeDetection: i0.ChangeDetectionStrategy.OnPush });
1729
1729
  }
1730
1730
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: ExternalComponent, decorators: [{
1731
1731
  type: Component,
1732
1732
  args: [{ selector: 'external-component', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: {
1733
- class: 'external-component',
1733
+ class: 'f-example-view',
1734
1734
  '[style.height]': 'data().height',
1735
1735
  }, template: "<ng-container #container />\n\n" }]
1736
1736
  }] });
@@ -2590,6 +2590,68 @@ class TableOfContentData {
2590
2590
  }
2591
2591
  }
2592
2592
 
2593
+ let CalculateTableOfContent = class CalculateTableOfContent {
2594
+ _dataProvider = inject(DocumentationStore);
2595
+ _mediatr = inject(Mediatr);
2596
+ handle(request) {
2597
+ const flat = [];
2598
+ const tree = [];
2599
+ const stack = [];
2600
+ this._getNavigationSelectors(request.hostElement, this._dataProvider.getTableOfContent()?.range).forEach((element) => {
2601
+ const tocItem = this._createItem(element);
2602
+ this._insertItemIntoTree(tocItem, tree, stack);
2603
+ flat.push(tocItem);
2604
+ });
2605
+ this._dataProvider.tocData.set(new TableOfContentData(flat, tree));
2606
+ //this._mediatr.execute(new CalculateHashFromScrollPositionRequest());
2607
+ }
2608
+ _getNavigationSelectors(fMarkdownPage, tocRange) {
2609
+ if (!tocRange || tocRange.start < 1 || tocRange.end > 6) {
2610
+ tocRange = { start: 2, end: 6 };
2611
+ }
2612
+ const selectors = [];
2613
+ for (let i = tocRange.start; i <= tocRange.end; i++) {
2614
+ selectors.push(`h${i}`);
2615
+ }
2616
+ return Array.from(fMarkdownPage.querySelectorAll(selectors.join(', ')));
2617
+ }
2618
+ _createItem(element) {
2619
+ element.id = this._createNavigationId(element);
2620
+ return {
2621
+ hash: `#${CSS.escape(element.id)}`,
2622
+ title: element.innerHTML,
2623
+ element,
2624
+ children: [],
2625
+ };
2626
+ }
2627
+ _createNavigationId(element) {
2628
+ return element.innerHTML.toLowerCase().replaceAll(' ', '-');
2629
+ }
2630
+ _getLevel(element) {
2631
+ return parseInt(element.tagName.substring(1));
2632
+ }
2633
+ _insertItemIntoTree(tocItem, tree, stack) {
2634
+ while (stack.length > 0 && this._getLevel(stack[stack.length - 1].element) >= this._getLevel(tocItem.element)) {
2635
+ stack.pop();
2636
+ }
2637
+ if (stack.length === 0) {
2638
+ tree.push(tocItem);
2639
+ }
2640
+ else {
2641
+ stack[stack.length - 1].children.push(tocItem);
2642
+ }
2643
+ stack.push(tocItem);
2644
+ }
2645
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: CalculateTableOfContent, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2646
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: CalculateTableOfContent });
2647
+ };
2648
+ CalculateTableOfContent = __decorate([
2649
+ MExecution(CalculateTableOfContentRequest)
2650
+ ], CalculateTableOfContent);
2651
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: CalculateTableOfContent, decorators: [{
2652
+ type: Injectable
2653
+ }] });
2654
+
2593
2655
  class CalculateAbsoluteTopToContainerRequest {
2594
2656
  element;
2595
2657
  static requestToken = Symbol('CalculateAbsoluteTopToContainerRequest');
@@ -2621,14 +2683,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImpor
2621
2683
  type: Injectable
2622
2684
  }] });
2623
2685
 
2624
- let CalculateHashFromScrollPosition = class CalculateHashFromScrollPosition {
2686
+ // @MExecution(CalculateHashFromScrollPositionRequest)
2687
+ class CalculateHashFromScrollPosition {
2625
2688
  _docElement = inject(DOCUMENT_ELEMENT);
2626
2689
  _window = inject(WINDOW);
2627
2690
  _provider = inject(DocumentationStore);
2628
2691
  _scrollableContainer = inject(SCROLLABLE_CONTAINER);
2629
2692
  _mediatr = inject(Mediatr);
2630
2693
  handle(payload) {
2631
- const _payload = payload;
2632
2694
  let result;
2633
2695
  const containerScrollTop = this._getContainerScrollTop();
2634
2696
  const elementsWithTopPosition = this._calculateElementsTopPositions();
@@ -2675,84 +2737,17 @@ let CalculateHashFromScrollPosition = class CalculateHashFromScrollPosition {
2675
2737
  }
2676
2738
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: CalculateHashFromScrollPosition, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2677
2739
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: CalculateHashFromScrollPosition });
2678
- };
2679
- CalculateHashFromScrollPosition = __decorate([
2680
- MExecution(CalculateHashFromScrollPositionRequest)
2681
- ], CalculateHashFromScrollPosition);
2740
+ }
2682
2741
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: CalculateHashFromScrollPosition, decorators: [{
2683
2742
  type: Injectable
2684
2743
  }] });
2685
2744
 
2686
2745
  class CalculateHashFromScrollPositionRequest {
2687
- empty;
2688
2746
  static requestToken = Symbol('CalculateHashFromScrollPositionRequest');
2689
- constructor(empty = '') {
2690
- this.empty = empty;
2747
+ constructor() {
2691
2748
  }
2692
2749
  }
2693
2750
 
2694
- let CalculateTableOfContent = class CalculateTableOfContent {
2695
- _dataProvider = inject(DocumentationStore);
2696
- _mediatr = inject(Mediatr);
2697
- handle(request) {
2698
- const flat = [];
2699
- const tree = [];
2700
- const stack = [];
2701
- this._getNavigationSelectors(request.hostElement, this._dataProvider.getTableOfContent()?.range).forEach((element) => {
2702
- const tocItem = this._createItem(element);
2703
- this._insertItemIntoTree(tocItem, tree, stack);
2704
- flat.push(tocItem);
2705
- });
2706
- this._dataProvider.tocData.set(new TableOfContentData(flat, tree));
2707
- this._mediatr.execute(new CalculateHashFromScrollPositionRequest());
2708
- }
2709
- _getNavigationSelectors(fMarkdownPage, tocRange) {
2710
- if (!tocRange || tocRange.start < 1 || tocRange.end > 6) {
2711
- tocRange = { start: 2, end: 6 };
2712
- }
2713
- const selectors = [];
2714
- for (let i = tocRange.start; i <= tocRange.end; i++) {
2715
- selectors.push(`h${i}`);
2716
- }
2717
- return Array.from(fMarkdownPage.querySelectorAll(selectors.join(', ')));
2718
- }
2719
- _createItem(element) {
2720
- element.id = this._createNavigationId(element);
2721
- return {
2722
- hash: `#${CSS.escape(element.id)}`,
2723
- title: element.innerHTML,
2724
- element,
2725
- children: [],
2726
- };
2727
- }
2728
- _createNavigationId(element) {
2729
- return element.innerHTML.toLowerCase().replaceAll(' ', '-');
2730
- }
2731
- _getLevel(element) {
2732
- return parseInt(element.tagName.substring(1));
2733
- }
2734
- _insertItemIntoTree(tocItem, tree, stack) {
2735
- while (stack.length > 0 && this._getLevel(stack[stack.length - 1].element) >= this._getLevel(tocItem.element)) {
2736
- stack.pop();
2737
- }
2738
- if (stack.length === 0) {
2739
- tree.push(tocItem);
2740
- }
2741
- else {
2742
- stack[stack.length - 1].children.push(tocItem);
2743
- }
2744
- stack.push(tocItem);
2745
- }
2746
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: CalculateTableOfContent, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2747
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: CalculateTableOfContent });
2748
- };
2749
- CalculateTableOfContent = __decorate([
2750
- MExecution(CalculateTableOfContentRequest)
2751
- ], CalculateTableOfContent);
2752
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: CalculateTableOfContent, decorators: [{
2753
- type: Injectable
2754
- }] });
2755
-
2756
2751
  class ScrollToElementInContainerRequest {
2757
2752
  hash;
2758
2753
  static requestToken = Symbol('ScrollToElementInContainerRequest');
@@ -2885,7 +2880,7 @@ class ScrollableContainer {
2885
2880
  .subscribe(() => this._calculateHashAndActivate());
2886
2881
  }
2887
2882
  _calculateHashAndActivate() {
2888
- this._mediatr.execute(new CalculateHashFromScrollPositionRequest());
2883
+ //this._mediatr.execute(new CalculateHashFromScrollPositionRequest());
2889
2884
  }
2890
2885
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: ScrollableContainer, deps: [], target: i0.ɵɵFactoryTarget.Component });
2891
2886
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.8", type: ScrollableContainer, isStandalone: true, selector: "scrollable-container", providers: [
@@ -3127,7 +3122,7 @@ var index$1 = /*#__PURE__*/Object.freeze({
3127
3122
  ActivateTocByHashRequest: ActivateTocByHashRequest,
3128
3123
  get CalculateAbsoluteTopToContainer () { return CalculateAbsoluteTopToContainer; },
3129
3124
  CalculateAbsoluteTopToContainerRequest: CalculateAbsoluteTopToContainerRequest,
3130
- get CalculateHashFromScrollPosition () { return CalculateHashFromScrollPosition; },
3125
+ CalculateHashFromScrollPosition: CalculateHashFromScrollPosition,
3131
3126
  CalculateHashFromScrollPositionRequest: CalculateHashFromScrollPositionRequest,
3132
3127
  get CalculateTableOfContent () { return CalculateTableOfContent; },
3133
3128
  CalculateTableOfContentRequest: CalculateTableOfContentRequest,