@xxmachina/components 19.50.0 → 19.80.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.
- package/fesm2022/xxmachina-components-extras-flow.mjs +73 -140
- package/fesm2022/xxmachina-components-extras-flow.mjs.map +1 -1
- package/fesm2022/xxmachina-components-features-query.mjs +3 -29
- package/fesm2022/xxmachina-components-features-query.mjs.map +1 -1
- package/fesm2022/xxmachina-components-groups-query-form.mjs +0 -54
- package/fesm2022/xxmachina-components-groups-query-form.mjs.map +1 -1
- package/fesm2022/xxmachina-components-molecules-inline-edit-field.mjs +0 -1
- package/fesm2022/xxmachina-components-molecules-inline-edit-field.mjs.map +1 -1
- package/fesm2022/xxmachina-components-molecules-user-avatar-menu.mjs +96 -0
- package/fesm2022/xxmachina-components-molecules-user-avatar-menu.mjs.map +1 -0
- package/fesm2022/xxmachina-components-molecules-weekly-header.mjs +2 -2
- package/fesm2022/xxmachina-components-molecules-workspace-selector.mjs +123 -0
- package/fesm2022/xxmachina-components-molecules-workspace-selector.mjs.map +1 -0
- package/fesm2022/xxmachina-components-organisms-calendar-section.mjs +2 -2
- package/fesm2022/xxmachina-components-organisms-calendar-section.mjs.map +1 -1
- package/fesm2022/xxmachina-components-organisms-event-input-section.mjs +0 -1
- package/fesm2022/xxmachina-components-organisms-event-input-section.mjs.map +1 -1
- package/fesm2022/xxmachina-components-organisms-terminal-input-section.mjs +2 -18
- package/fesm2022/xxmachina-components-organisms-terminal-input-section.mjs.map +1 -1
- package/fesm2022/xxmachina-components-organisms-video-trimmer-section.mjs +0 -3
- package/fesm2022/xxmachina-components-organisms-video-trimmer-section.mjs.map +1 -1
- package/fesm2022/xxmachina-components-organisms-xterm.mjs +283 -261
- package/fesm2022/xxmachina-components-organisms-xterm.mjs.map +1 -1
- package/fesm2022/xxmachina-components-pages-command.mjs +3 -9
- package/fesm2022/xxmachina-components-pages-command.mjs.map +1 -1
- package/fesm2022/xxmachina-components-pages-query-v2.mjs +0 -13
- package/fesm2022/xxmachina-components-pages-query-v2.mjs.map +1 -1
- package/fesm2022/xxmachina-components-pages-query.mjs +3 -67
- package/fesm2022/xxmachina-components-pages-query.mjs.map +1 -1
- package/fesm2022/xxmachina-components-pages-thread.mjs +2 -18
- package/fesm2022/xxmachina-components-pages-thread.mjs.map +1 -1
- package/fesm2022/{xxmachina-components-routes-commands-command.routes-CSwIdXZg.mjs → xxmachina-components-routes-commands-command.routes-Ca2yVrwL.mjs} +1 -2
- package/fesm2022/xxmachina-components-routes-commands-command.routes-Ca2yVrwL.mjs.map +1 -0
- package/fesm2022/{xxmachina-components-routes-commands-pages.routes-j2xVop4W.mjs → xxmachina-components-routes-commands-pages.routes-COpFeEsz.mjs} +2 -2
- package/fesm2022/{xxmachina-components-routes-commands-pages.routes-j2xVop4W.mjs.map → xxmachina-components-routes-commands-pages.routes-COpFeEsz.mjs.map} +1 -1
- package/fesm2022/xxmachina-components-routes-commands.mjs +1 -2
- package/fesm2022/xxmachina-components-routes-commands.mjs.map +1 -1
- package/fesm2022/xxmachina-components-routes-pages.mjs +0 -1
- package/fesm2022/xxmachina-components-routes-pages.mjs.map +1 -1
- package/fesm2022/xxmachina-components-routes-queries.mjs +0 -2
- package/fesm2022/xxmachina-components-routes-queries.mjs.map +1 -1
- package/fesm2022/{xxmachina-components-routes-query-pages.routes-CxTbOJDQ.mjs → xxmachina-components-routes-query-pages.routes-BNuONo3g.mjs} +1 -5
- package/fesm2022/xxmachina-components-routes-query-pages.routes-BNuONo3g.mjs.map +1 -0
- package/fesm2022/xxmachina-components-routes-query.mjs +1 -1
- package/fesm2022/{xxmachina-components-routes-resources-pages.routes-CRXxavHb.mjs → xxmachina-components-routes-resources-pages.routes-DEu2qpeu.mjs} +2 -2
- package/fesm2022/{xxmachina-components-routes-resources-pages.routes-CRXxavHb.mjs.map → xxmachina-components-routes-resources-pages.routes-DEu2qpeu.mjs.map} +1 -1
- package/fesm2022/{xxmachina-components-routes-resources-resource.routes-CkkmqB2_.mjs → xxmachina-components-routes-resources-resource.routes-CWxi2agj.mjs} +1 -2
- package/fesm2022/xxmachina-components-routes-resources-resource.routes-CWxi2agj.mjs.map +1 -0
- package/fesm2022/xxmachina-components-routes-resources.mjs +1 -1
- package/fesm2022/xxmachina-components-routes-transformer.mjs +0 -1
- package/fesm2022/xxmachina-components-routes-transformer.mjs.map +1 -1
- package/fesm2022/xxmachina-components-services-forms-query.mjs +1 -1
- package/fesm2022/xxmachina-components-services-forms-query.mjs.map +1 -1
- package/fesm2022/xxmachina-components-services-graphql.mjs +0 -4
- package/fesm2022/xxmachina-components-services-graphql.mjs.map +1 -1
- package/fesm2022/xxmachina-components-services-json-schema.mjs +6 -12
- package/fesm2022/xxmachina-components-services-json-schema.mjs.map +1 -1
- package/fesm2022/xxmachina-components-services-query.mjs +0 -7
- package/fesm2022/xxmachina-components-services-query.mjs.map +1 -1
- package/fesm2022/xxmachina-components-services-recording.mjs +0 -13
- package/fesm2022/xxmachina-components-services-recording.mjs.map +1 -1
- package/fesm2022/xxmachina-components-services-thread.mjs +0 -2
- package/fesm2022/xxmachina-components-services-thread.mjs.map +1 -1
- package/fesm2022/xxmachina-components-services-version.mjs +171 -0
- package/fesm2022/xxmachina-components-services-version.mjs.map +1 -0
- package/fesm2022/xxmachina-components-services-workspace-switcher.mjs +9 -0
- package/fesm2022/xxmachina-components-services-workspace-switcher.mjs.map +1 -0
- package/fesm2022/xxmachina-components-templates-agent.mjs +98 -146
- package/fesm2022/xxmachina-components-templates-agent.mjs.map +1 -1
- package/fesm2022/xxmachina-components-templates-background.mjs +10 -30
- package/fesm2022/xxmachina-components-templates-background.mjs.map +1 -1
- package/fesm2022/xxmachina-components-templates-env.mjs +295 -0
- package/fesm2022/xxmachina-components-templates-env.mjs.map +1 -0
- package/fesm2022/xxmachina-components-templates-flow-nodes-issue.mjs.map +1 -1
- package/fesm2022/xxmachina-components-templates-flow.mjs +1 -1
- package/fesm2022/xxmachina-components-templates-flow.mjs.map +1 -1
- package/fesm2022/xxmachina-components-templates-machina-icon-button-menu.mjs +78 -0
- package/fesm2022/xxmachina-components-templates-machina-icon-button-menu.mjs.map +1 -0
- package/fesm2022/xxmachina-components.mjs +9 -10
- package/fesm2022/xxmachina-components.mjs.map +1 -1
- package/package.json +25 -1
- package/types/xxmachina-components-extras-flow.d.ts +8 -43
- package/types/xxmachina-components-extras-flow.d.ts.map +1 -1
- package/types/xxmachina-components-features-query.d.ts +3 -24
- package/types/xxmachina-components-features-query.d.ts.map +1 -1
- package/types/xxmachina-components-groups-query-form.d.ts +2 -2
- package/types/xxmachina-components-molecules-user-avatar-menu.d.ts +19 -0
- package/types/xxmachina-components-molecules-user-avatar-menu.d.ts.map +1 -0
- package/types/xxmachina-components-molecules-workspace-selector.d.ts +25 -0
- package/types/xxmachina-components-molecules-workspace-selector.d.ts.map +1 -0
- package/types/xxmachina-components-organisms-xterm.d.ts +130 -111
- package/types/xxmachina-components-organisms-xterm.d.ts.map +1 -1
- package/types/xxmachina-components-pages-query-v2.d.ts +0 -3
- package/types/xxmachina-components-pages-query-v2.d.ts.map +1 -1
- package/types/xxmachina-components-pages-query.d.ts +0 -19
- package/types/xxmachina-components-pages-query.d.ts.map +1 -1
- package/types/xxmachina-components-services-forms-query.d.ts +1 -1
- package/types/xxmachina-components-services-graphql.d.ts +0 -3
- package/types/xxmachina-components-services-graphql.d.ts.map +1 -1
- package/types/xxmachina-components-services-query.d.ts +0 -7
- package/types/xxmachina-components-services-query.d.ts.map +1 -1
- package/types/xxmachina-components-services-version.d.ts +32 -0
- package/types/xxmachina-components-services-version.d.ts.map +1 -0
- package/types/xxmachina-components-services-workspace-switcher.d.ts +17 -0
- package/types/xxmachina-components-services-workspace-switcher.d.ts.map +1 -0
- package/types/xxmachina-components-templates-agent.d.ts +2 -1
- package/types/xxmachina-components-templates-agent.d.ts.map +1 -1
- package/types/xxmachina-components-templates-env.d.ts +43 -0
- package/types/xxmachina-components-templates-env.d.ts.map +1 -0
- package/types/xxmachina-components-templates-flow-nodes-issue.d.ts +0 -2
- package/types/xxmachina-components-templates-flow-nodes-issue.d.ts.map +1 -1
- package/types/xxmachina-components-templates-machina-icon-button-menu.d.ts +18 -0
- package/types/xxmachina-components-templates-machina-icon-button-menu.d.ts.map +1 -0
- package/types/xxmachina-components.d.ts +2 -0
- package/types/xxmachina-components.d.ts.map +1 -1
- package/fesm2022/xxmachina-components-routes-commands-command.routes-CSwIdXZg.mjs.map +0 -1
- package/fesm2022/xxmachina-components-routes-query-pages.routes-CxTbOJDQ.mjs.map +0 -1
- package/fesm2022/xxmachina-components-routes-resources-resource.routes-CkkmqB2_.mjs.map +0 -1
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, DestroyRef, signal, computed, Injectable } from '@angular/core';
|
|
3
|
+
import { DOCUMENT } from '@angular/common';
|
|
4
|
+
import { FirebaseApp } from '@angular/fire/app';
|
|
5
|
+
import { getRemoteConfig, fetchAndActivate, getString, fetchConfig, activate } from 'firebase/remote-config';
|
|
6
|
+
|
|
7
|
+
function readConfigFromIdb(key) {
|
|
8
|
+
return new Promise((resolve) => {
|
|
9
|
+
try {
|
|
10
|
+
const req = indexedDB.open('firebase_remote_config');
|
|
11
|
+
req.onsuccess = (e) => {
|
|
12
|
+
const db = e.target.result;
|
|
13
|
+
const tx = db.transaction('app_namespace_store', 'readonly');
|
|
14
|
+
const store = tx.objectStore('app_namespace_store');
|
|
15
|
+
const getAll = store.getAll();
|
|
16
|
+
getAll.onsuccess = () => {
|
|
17
|
+
const resp = getAll.result.find((item) => item.compositeKey.endsWith('last_successful_fetch_response'));
|
|
18
|
+
db.close();
|
|
19
|
+
resolve(resp?.value?.config?.[key] ?? '');
|
|
20
|
+
};
|
|
21
|
+
getAll.onerror = () => { db.close(); resolve(''); };
|
|
22
|
+
};
|
|
23
|
+
req.onerror = () => resolve('');
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
resolve('');
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const DEFAULT_VERSIONS = [
|
|
32
|
+
{ key: 'stable', label: 'stable (本番)' },
|
|
33
|
+
{ key: 'dev', label: 'dev (開発)' },
|
|
34
|
+
];
|
|
35
|
+
const POLLING_INTERVAL_MS = 60_000;
|
|
36
|
+
class VersionService {
|
|
37
|
+
document = inject(DOCUMENT);
|
|
38
|
+
destroyRef = inject(DestroyRef);
|
|
39
|
+
firebaseApp = inject(FirebaseApp, { optional: true });
|
|
40
|
+
remoteConfig;
|
|
41
|
+
unsubscribe;
|
|
42
|
+
pollingInterval;
|
|
43
|
+
initialized = false;
|
|
44
|
+
versions = signal(DEFAULT_VERSIONS, ...(ngDevMode ? [{ debugName: "versions" }] : []));
|
|
45
|
+
isLoading = signal(true, ...(ngDevMode ? [{ debugName: "isLoading" }] : []));
|
|
46
|
+
isVersionedHost(hostname) {
|
|
47
|
+
return hostname === 'machina.at' || hostname === 'planx.machina.at';
|
|
48
|
+
}
|
|
49
|
+
currentVersion = computed(() => {
|
|
50
|
+
const hostname = this.document.location.hostname;
|
|
51
|
+
if (this.isVersionedHost(hostname)) {
|
|
52
|
+
const pathParts = this.document.location.pathname.split('/').filter(Boolean);
|
|
53
|
+
if (pathParts.length > 0) {
|
|
54
|
+
return pathParts[0];
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return null;
|
|
58
|
+
}, ...(ngDevMode ? [{ debugName: "currentVersion" }] : []));
|
|
59
|
+
isCloudflareEnv = computed(() => {
|
|
60
|
+
const hostname = this.document.location.hostname;
|
|
61
|
+
return this.isVersionedHost(hostname) || hostname === 'localhost';
|
|
62
|
+
}, ...(ngDevMode ? [{ debugName: "isCloudflareEnv" }] : []));
|
|
63
|
+
async initialize() {
|
|
64
|
+
if (this.initialized)
|
|
65
|
+
return;
|
|
66
|
+
this.initialized = true;
|
|
67
|
+
await this.initRemoteConfig();
|
|
68
|
+
}
|
|
69
|
+
switchVersion(versionKey) {
|
|
70
|
+
const currentPath = this.document.location.pathname;
|
|
71
|
+
const currentVersion = this.currentVersion();
|
|
72
|
+
let newPath;
|
|
73
|
+
if (currentVersion) {
|
|
74
|
+
newPath = currentPath.replace(`/${currentVersion}`, `/${versionKey}`);
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
newPath = `/${versionKey}${currentPath}`;
|
|
78
|
+
}
|
|
79
|
+
this.document.location.href = `${this.document.location.origin}${newPath}`;
|
|
80
|
+
}
|
|
81
|
+
async initRemoteConfig() {
|
|
82
|
+
if (!this.firebaseApp) {
|
|
83
|
+
console.warn('[VersionService] FirebaseApp not available, using defaults');
|
|
84
|
+
this.isLoading.set(false);
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
try {
|
|
88
|
+
this.remoteConfig = getRemoteConfig(this.firebaseApp);
|
|
89
|
+
this.remoteConfig.settings.minimumFetchIntervalMillis = 0;
|
|
90
|
+
}
|
|
91
|
+
catch (e) {
|
|
92
|
+
console.warn('[VersionService] Failed to get RemoteConfig:', e);
|
|
93
|
+
this.isLoading.set(false);
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
try {
|
|
97
|
+
await fetchAndActivate(this.remoteConfig);
|
|
98
|
+
let initialValue = getString(this.remoteConfig, 'available_versions');
|
|
99
|
+
if (!initialValue) {
|
|
100
|
+
initialValue = await readConfigFromIdb('available_versions');
|
|
101
|
+
}
|
|
102
|
+
console.log('[VersionService] Initial Remote Config value:', initialValue);
|
|
103
|
+
this.updateVersions(initialValue);
|
|
104
|
+
this.remoteConfig.settings.minimumFetchIntervalMillis = 60_000;
|
|
105
|
+
}
|
|
106
|
+
catch (e) {
|
|
107
|
+
console.warn('[VersionService] Failed to fetch Remote Config:', e);
|
|
108
|
+
this.isLoading.set(false);
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
this.setupRealtimeListenerWithFallback();
|
|
112
|
+
}
|
|
113
|
+
setupRealtimeListenerWithFallback() {
|
|
114
|
+
if (!this.remoteConfig)
|
|
115
|
+
return;
|
|
116
|
+
this.setupPollingFallback();
|
|
117
|
+
this.destroyRef.onDestroy(() => {
|
|
118
|
+
this.unsubscribe?.();
|
|
119
|
+
if (this.pollingInterval) {
|
|
120
|
+
clearInterval(this.pollingInterval);
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
setupPollingFallback() {
|
|
125
|
+
if (!this.remoteConfig)
|
|
126
|
+
return;
|
|
127
|
+
console.log('[VersionService] Setting up polling fallback');
|
|
128
|
+
this.pollingInterval = setInterval(async () => {
|
|
129
|
+
try {
|
|
130
|
+
await fetchConfig(this.remoteConfig);
|
|
131
|
+
await activate(this.remoteConfig);
|
|
132
|
+
let newValue = getString(this.remoteConfig, 'available_versions');
|
|
133
|
+
if (!newValue) {
|
|
134
|
+
newValue = await readConfigFromIdb('available_versions');
|
|
135
|
+
}
|
|
136
|
+
console.log('[VersionService] Polling: Remote Config value:', newValue);
|
|
137
|
+
this.updateVersions(newValue);
|
|
138
|
+
}
|
|
139
|
+
catch (e) {
|
|
140
|
+
console.warn('[VersionService] Polling fetch failed:', e);
|
|
141
|
+
}
|
|
142
|
+
}, POLLING_INTERVAL_MS);
|
|
143
|
+
}
|
|
144
|
+
updateVersions(jsonString) {
|
|
145
|
+
if (jsonString) {
|
|
146
|
+
try {
|
|
147
|
+
const parsed = JSON.parse(jsonString);
|
|
148
|
+
if (parsed.length > 0) {
|
|
149
|
+
this.versions.set(parsed);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
catch (e) {
|
|
153
|
+
console.warn('[VersionService] Failed to parse available_versions:', e);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
this.isLoading.set(false);
|
|
157
|
+
}
|
|
158
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: VersionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
159
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: VersionService, providedIn: 'root' });
|
|
160
|
+
}
|
|
161
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: VersionService, decorators: [{
|
|
162
|
+
type: Injectable,
|
|
163
|
+
args: [{ providedIn: 'root' }]
|
|
164
|
+
}] });
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Generated bundle index. Do not edit.
|
|
168
|
+
*/
|
|
169
|
+
|
|
170
|
+
export { VersionService };
|
|
171
|
+
//# sourceMappingURL=xxmachina-components-services-version.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xxmachina-components-services-version.mjs","sources":["../../../../../packages/@xxmachina/components/src/lib/services/version/read-config-from-idb.ts","../../../../../packages/@xxmachina/components/src/lib/services/version/version.service.ts","../../../../../packages/@xxmachina/components/src/lib/services/version/xxmachina-components-services-version.ts"],"sourcesContent":["\nexport function readConfigFromIdb(key: string): Promise<string> {\n return new Promise((resolve) => {\n try {\n const req = indexedDB.open('firebase_remote_config');\n req.onsuccess = (e) => {\n const db = (e.target as IDBOpenDBRequest).result;\n const tx = db.transaction('app_namespace_store', 'readonly');\n const store = tx.objectStore('app_namespace_store');\n const getAll = store.getAll();\n getAll.onsuccess = () => {\n const resp = getAll.result.find(\n (item: { compositeKey: string }) =>\n item.compositeKey.endsWith('last_successful_fetch_response'),\n );\n db.close();\n resolve(resp?.value?.config?.[key] ?? '');\n };\n getAll.onerror = () => { db.close(); resolve(''); };\n };\n req.onerror = () => resolve('');\n } catch {\n resolve('');\n }\n });\n}\n","import { Injectable, signal, computed, inject, DestroyRef } from '@angular/core';\nimport { DOCUMENT } from '@angular/common';\nimport { FirebaseApp } from '@angular/fire/app';\nimport {\n getRemoteConfig,\n fetchAndActivate,\n fetchConfig,\n getString,\n activate,\n} from 'firebase/remote-config';\nimport type { RemoteConfig } from 'firebase/remote-config';\nimport { readConfigFromIdb } from './read-config-from-idb';\n\nexport interface Version {\n key: string;\n label: string;\n}\n\n\nconst DEFAULT_VERSIONS: Version[] = [\n { key: 'stable', label: 'stable (本番)' },\n { key: 'dev', label: 'dev (開発)' },\n];\n\n\nconst POLLING_INTERVAL_MS = 60_000; \n\n@Injectable({ providedIn: 'root' })\nexport class VersionService {\n private readonly document = inject(DOCUMENT);\n private readonly destroyRef = inject(DestroyRef);\n \n private readonly firebaseApp = inject(FirebaseApp, { optional: true });\n private remoteConfig?: RemoteConfig;\n private unsubscribe?: () => void;\n private pollingInterval?: ReturnType<typeof setInterval>;\n private initialized = false;\n\n \n readonly versions = signal<Version[]>(DEFAULT_VERSIONS);\n\n \n readonly isLoading = signal(true);\n\n \n private isVersionedHost(hostname: string): boolean {\n return hostname === 'machina.at' || hostname === 'planx.machina.at';\n }\n\n \n readonly currentVersion = computed(() => {\n const hostname = this.document.location.hostname;\n\n \n if (this.isVersionedHost(hostname)) {\n const pathParts = this.document.location.pathname.split('/').filter(Boolean);\n if (pathParts.length > 0) {\n return pathParts[0];\n }\n }\n\n \n return null;\n });\n\n \n readonly isCloudflareEnv = computed(() => {\n const hostname = this.document.location.hostname;\n return this.isVersionedHost(hostname) || hostname === 'localhost';\n });\n\n \n async initialize(): Promise<void> {\n if (this.initialized) return;\n this.initialized = true;\n await this.initRemoteConfig();\n }\n\n \n switchVersion(versionKey: string): void {\n const currentPath = this.document.location.pathname;\n const currentVersion = this.currentVersion();\n\n let newPath: string;\n if (currentVersion) {\n \n newPath = currentPath.replace(`/${currentVersion}`, `/${versionKey}`);\n } else {\n \n newPath = `/${versionKey}${currentPath}`;\n }\n\n this.document.location.href = `${this.document.location.origin}${newPath}`;\n }\n\n \n private async initRemoteConfig(): Promise<void> {\n \n if (!this.firebaseApp) {\n console.warn('[VersionService] FirebaseApp not available, using defaults');\n this.isLoading.set(false);\n return;\n }\n\n try {\n this.remoteConfig = getRemoteConfig(this.firebaseApp);\n \n \n \n \n this.remoteConfig.settings.minimumFetchIntervalMillis = 0;\n } catch (e) {\n console.warn('[VersionService] Failed to get RemoteConfig:', e);\n this.isLoading.set(false);\n return;\n }\n\n \n try {\n await fetchAndActivate(this.remoteConfig);\n\n \n \n let initialValue = getString(this.remoteConfig, 'available_versions');\n if (!initialValue) {\n initialValue = await readConfigFromIdb('available_versions');\n }\n console.log('[VersionService] Initial Remote Config value:', initialValue);\n this.updateVersions(initialValue);\n\n \n this.remoteConfig.settings.minimumFetchIntervalMillis = 60_000;\n } catch (e) {\n console.warn('[VersionService] Failed to fetch Remote Config:', e);\n this.isLoading.set(false);\n return;\n }\n\n \n this.setupRealtimeListenerWithFallback();\n }\n\n \n private setupRealtimeListenerWithFallback(): void {\n if (!this.remoteConfig) return;\n\n \n \n this.setupPollingFallback();\n\n this.destroyRef.onDestroy(() => {\n this.unsubscribe?.();\n if (this.pollingInterval) {\n clearInterval(this.pollingInterval);\n }\n });\n }\n\n \n private setupPollingFallback(): void {\n if (!this.remoteConfig) return;\n\n console.log('[VersionService] Setting up polling fallback');\n\n this.pollingInterval = setInterval(async () => {\n try {\n await fetchConfig(this.remoteConfig!);\n await activate(this.remoteConfig!);\n let newValue = getString(this.remoteConfig!, 'available_versions');\n if (!newValue) {\n newValue = await readConfigFromIdb('available_versions');\n }\n console.log('[VersionService] Polling: Remote Config value:', newValue);\n this.updateVersions(newValue);\n } catch (e) {\n console.warn('[VersionService] Polling fetch failed:', e);\n }\n }, POLLING_INTERVAL_MS);\n }\n\n \n private updateVersions(jsonString: string): void {\n if (jsonString) {\n try {\n const parsed = JSON.parse(jsonString) as Version[];\n if (parsed.length > 0) {\n this.versions.set(parsed);\n }\n } catch (e) {\n console.warn('[VersionService] Failed to parse available_versions:', e);\n }\n }\n this.isLoading.set(false);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AACM,SAAU,iBAAiB,CAAC,GAAW,EAAA;AAC3C,IAAA,OAAO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BlC;;AAEG;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xxmachina-components-services-workspace-switcher.mjs","sources":["../../../../../packages/@xxmachina/components/src/lib/services/workspace-switcher/workspace-switcher.service.ts","../../../../../packages/@xxmachina/components/src/lib/services/workspace-switcher/xxmachina-components-services-workspace-switcher.ts"],"sourcesContent":["import { Signal } from '@angular/core';\n\nexport interface WorkspaceOption {\n id: string;\n kind: string;\n name: string;\n}\n\n\nexport abstract class WorkspaceSwitcherService {\n \n abstract readonly workspaces: Signal<WorkspaceOption[] | null>;\n abstract readonly currentWorkspaceId: Signal<string | null>;\n abstract readonly currentWorkspaceName: Signal<string | null>;\n \n abstract switchTo(workspaceId: string): void;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"MASsB,wBAAwB,CAAA;AAO7C;;AChBD;;AAEG;;;;"}
|