taon-ui 19.0.32 → 21.0.2

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taon-ui/websql",
3
- "version": "19.0.32",
3
+ "version": "21.0.2",
4
4
  "module": "fesm2022/taon-ui.mjs",
5
5
  "typings": "index.d.ts",
6
6
  "exports": {
@@ -1,24 +0,0 @@
1
- import { OnInit, OnDestroy, ElementRef, AfterViewInit } from '@angular/core';
2
- import { ActivatedRoute, Router } from '@angular/router';
3
- export declare class IframeSyncComponent implements OnInit, AfterViewInit, OnDestroy {
4
- private route;
5
- private router;
6
- private destroy$;
7
- private iframeWindow;
8
- /** Base URL of the iframe content (e.g. https://docs.taon.dev) */
9
- iframeSrc: string;
10
- /** Query param name in parent URL (default: internalIframePath) */
11
- queryParamKey: string;
12
- /** Optional initial path if you don't want to read from URL on first load */
13
- initialPath: string | null;
14
- /** Target origin for postMessage – security! (defaults to iframeSrc origin) */
15
- targetOrigin?: string;
16
- iframeRef: ElementRef<HTMLIFrameElement>;
17
- constructor(route: ActivatedRoute, router: Router);
18
- ngOnInit(): void;
19
- ngAfterViewInit(): void;
20
- onIframeLoad(): void;
21
- private syncParentToIframe;
22
- private handleMessageFromIframe;
23
- ngOnDestroy(): void;
24
- }
@@ -1,118 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.IframeSyncComponent = void 0;
10
- // iframe-sync.component.ts
11
- const core_1 = require("@angular/core");
12
- const router_1 = require("@angular/router");
13
- const rxjs_1 = require("rxjs");
14
- const operators_1 = require("rxjs/operators");
15
- let IframeSyncComponent = class IframeSyncComponent {
16
- route;
17
- router;
18
- destroy$ = new rxjs_1.Subject();
19
- iframeWindow;
20
- // ────── Inputs ──────
21
- /** Base URL of the iframe content (e.g. https://docs.taon.dev) */
22
- iframeSrc;
23
- /** Query param name in parent URL (default: internalIframePath) */
24
- queryParamKey = 'internalIframePath';
25
- /** Optional initial path if you don't want to read from URL on first load */
26
- initialPath = null;
27
- /** Target origin for postMessage – security! (defaults to iframeSrc origin) */
28
- targetOrigin;
29
- // ────── ViewChild ──────
30
- iframeRef;
31
- constructor(route, router) {
32
- this.route = route;
33
- this.router = router;
34
- }
35
- ngOnInit() {
36
- // Listen to Angular router changes (including query param updates)
37
- this.router.events
38
- .pipe((0, operators_1.filter)((e) => e instanceof router_1.NavigationEnd), (0, operators_1.takeUntil)(this.destroy$))
39
- .subscribe(() => this.syncParentToIframe());
40
- // Listen to direct query param changes (e.g. back/forward)
41
- this.route.queryParamMap
42
- .pipe((0, operators_1.takeUntil)(this.destroy$), (0, operators_1.distinctUntilChanged)((a, b) => a.get(this.queryParamKey) === b.get(this.queryParamKey)))
43
- .subscribe(() => this.syncParentToIframe());
44
- // Listen to messages coming FROM the iframe
45
- window.addEventListener('message', this.handleMessageFromIframe);
46
- }
47
- ngAfterViewInit() {
48
- this.iframeWindow = this.iframeRef.nativeElement.contentWindow;
49
- // Initial sync after everything is ready
50
- setTimeout(() => this.syncParentToIframe(), 100);
51
- }
52
- onIframeLoad() {
53
- this.iframeWindow = this.iframeRef.nativeElement.contentWindow;
54
- this.syncParentToIframe();
55
- }
56
- // ────── Parent → Iframe ──────
57
- syncParentToIframe() {
58
- if (!this.iframeWindow)
59
- return;
60
- let path = this.initialPath ??
61
- this.route.snapshot.queryParamMap.get(this.queryParamKey);
62
- if (path === null || path === undefined)
63
- path = '/';
64
- const origin = this.targetOrigin || new URL(this.iframeSrc).origin;
65
- this.iframeWindow.postMessage({ type: 'NAVIGATE', path }, origin);
66
- }
67
- // ────── Iframe → Parent ──────
68
- handleMessageFromIframe = (event) => {
69
- const expectedOrigin = this.targetOrigin || new URL(this.iframeSrc).origin;
70
- if (event.origin !== expectedOrigin)
71
- return;
72
- if (event.data?.type === 'IFRAME_PATH_UPDATE') {
73
- const newPath = event.data.path || '/';
74
- this.router.navigate([], {
75
- queryParams: { [this.queryParamKey]: newPath === '/' ? null : newPath },
76
- queryParamsHandling: 'merge',
77
- replaceUrl: true,
78
- });
79
- }
80
- };
81
- ngOnDestroy() {
82
- this.destroy$.next();
83
- this.destroy$.complete();
84
- window.removeEventListener('message', this.handleMessageFromIframe);
85
- }
86
- };
87
- exports.IframeSyncComponent = IframeSyncComponent;
88
- __decorate([
89
- (0, core_1.Input)({ required: true })
90
- ], IframeSyncComponent.prototype, "iframeSrc", void 0);
91
- __decorate([
92
- (0, core_1.Input)()
93
- ], IframeSyncComponent.prototype, "queryParamKey", void 0);
94
- __decorate([
95
- (0, core_1.Input)()
96
- ], IframeSyncComponent.prototype, "initialPath", void 0);
97
- __decorate([
98
- (0, core_1.Input)()
99
- ], IframeSyncComponent.prototype, "targetOrigin", void 0);
100
- __decorate([
101
- (0, core_1.ViewChild)('iframe', { static: true })
102
- ], IframeSyncComponent.prototype, "iframeRef", void 0);
103
- exports.IframeSyncComponent = IframeSyncComponent = __decorate([
104
- (0, core_1.Component)({
105
- selector: 'app-iframe-sync',
106
- template: `
107
- <iframe
108
- #iframe
109
- [src]="iframeSrc"
110
- frameborder="0"
111
- style="width:100%; height:100%; border:none; display:block;"
112
- (load)="onIframeLoad()"></iframe>
113
- `,
114
- standalone: true,
115
- changeDetection: core_1.ChangeDetectionStrategy.OnPush,
116
- })
117
- ], IframeSyncComponent);
118
- //# sourceMappingURL=taon-iframe-sync.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"taon-iframe-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