@vibes.diy/use-vibes-base 0.16.2 → 0.17.1-dev-next
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/components/BrutalistCard/BrutalistCard.d.ts +1 -0
- package/components/BrutalistCard/BrutalistCard.js +2 -2
- package/components/BrutalistCard/BrutalistCard.js.map +1 -1
- package/components/BrutalistCard/BrutalistCard.styles.d.ts +1 -1
- package/components/BrutalistCard/BrutalistCard.styles.js +12 -2
- package/components/BrutalistCard/BrutalistCard.styles.js.map +1 -1
- package/contexts/VibeContext.d.ts +31 -0
- package/contexts/VibeContext.js +65 -0
- package/contexts/VibeContext.js.map +1 -0
- package/hooks/vibes-gen/IframeVibesComponent.js +1 -1
- package/hooks/vibes-gen/IframeVibesComponent.js.map +1 -1
- package/index.d.ts +8 -6
- package/index.js +88 -17
- package/index.js.map +1 -1
- package/mounting/index.d.ts +4 -0
- package/mounting/index.js +4 -0
- package/mounting/index.js.map +1 -0
- package/mounting/mountVibeCode.d.ts +1 -0
- package/mounting/mountVibeCode.js +53 -0
- package/mounting/mountVibeCode.js.map +1 -0
- package/mounting/mountVibeWithCleanup.d.ts +1 -0
- package/mounting/mountVibeWithCleanup.js +56 -0
- package/mounting/mountVibeWithCleanup.js.map +1 -0
- package/mounting/types.d.ts +10 -0
- package/mounting/types.js +7 -0
- package/mounting/types.js.map +1 -0
- package/package.json +12 -9
- package/vibe-app-mount.d.ts +4 -5
- package/vibe-app-mount.js +20 -105
- package/vibe-app-mount.js.map +1 -1
- package/ManualRedirectStrategy.d.ts +0 -24
- package/ManualRedirectStrategy.js +0 -289
- package/ManualRedirectStrategy.js.map +0 -1
- package/components/AuthWall/AuthWall.d.ts +0 -8
- package/components/AuthWall/AuthWall.js +0 -161
- package/components/AuthWall/AuthWall.js.map +0 -1
- package/components/AuthWall/AuthWall.styles.d.ts +0 -24
- package/components/AuthWall/AuthWall.styles.js +0 -82
- package/components/AuthWall/AuthWall.styles.js.map +0 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface VibesMountReadyDetail {
|
|
2
|
+
unmount: () => void;
|
|
3
|
+
containerId: string;
|
|
4
|
+
}
|
|
5
|
+
export interface VibesMountErrorDetail {
|
|
6
|
+
error: string;
|
|
7
|
+
containerId: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function isVibesMountReadyEvent(event: Event): event is CustomEvent<VibesMountReadyDetail>;
|
|
10
|
+
export declare function isVibesMountErrorEvent(event: Event): event is CustomEvent<VibesMountErrorDetail>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../jsr/mounting/types.ts"],"names":[],"mappings":"AAaA,MAAM,UAAU,sBAAsB,CAAC,KAAY,EAA+C;IAChG,OAAO,KAAK,CAAC,IAAI,KAAK,mBAAmB,CAAC;AAAA,CAC3C;AAED,MAAM,UAAU,sBAAsB,CAAC,KAAY,EAA+C;IAChG,OAAO,KAAK,CAAC,IAAI,KAAK,mBAAmB,CAAC;AAAA,CAC3C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibes.diy/use-vibes-base",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.1-dev-next",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Core components and utilities for use-vibes (internal workspace package)",
|
|
6
6
|
"exports": {
|
|
@@ -11,30 +11,33 @@
|
|
|
11
11
|
},
|
|
12
12
|
"license": "Apache-2.0",
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@adviser/cement": "^0.4.
|
|
14
|
+
"@adviser/cement": "^0.4.66",
|
|
15
|
+
"@babel/standalone": "^7.28.5",
|
|
15
16
|
"@fireproof/core-runtime": "^0.23.15",
|
|
16
17
|
"@fireproof/core-types-base": "^0.23.15",
|
|
17
18
|
"@fireproof/core-types-protocols-cloud": "^0.23.15",
|
|
18
|
-
"@vibes.diy/prompts": "^0.
|
|
19
|
-
"@vibes.diy/use-vibes-types": "^0.
|
|
20
|
-
"call-ai": "^0.
|
|
19
|
+
"@vibes.diy/prompts": "^0.17.1-dev-next",
|
|
20
|
+
"@vibes.diy/use-vibes-types": "^0.17.1-dev-next",
|
|
21
|
+
"call-ai": "^0.17.1-dev-next",
|
|
21
22
|
"react-dom": "^19.2.0",
|
|
22
23
|
"use-fireproof": "^0.23.15",
|
|
23
|
-
"uuid": "^11.1.0"
|
|
24
|
+
"uuid": "^11.1.0",
|
|
25
|
+
"zod": "^3.25.76"
|
|
24
26
|
},
|
|
25
27
|
"peerDependencies": {
|
|
26
28
|
"react": ">=19.1.0"
|
|
27
29
|
},
|
|
28
30
|
"devDependencies": {
|
|
29
|
-
"@chromatic-com/storybook": "^4.1.
|
|
31
|
+
"@chromatic-com/storybook": "^4.1.3",
|
|
30
32
|
"@fireproof/core-cli": "^0.23.15",
|
|
31
33
|
"@storybook/addon-a11y": "^9.1.13",
|
|
32
34
|
"@storybook/addon-docs": "^10.0.0",
|
|
33
35
|
"@storybook/react": "^10.0.7",
|
|
34
|
-
"@storybook/react-vite": "^10.0.
|
|
36
|
+
"@storybook/react-vite": "^10.0.8",
|
|
37
|
+
"@types/babel__standalone": "^7.1.9",
|
|
35
38
|
"@types/react": "~19.2.2",
|
|
36
39
|
"@types/react-dom": "~19.2.2",
|
|
37
|
-
"@vitest/browser-playwright": "^4.0.
|
|
40
|
+
"@vitest/browser-playwright": "^4.0.10",
|
|
38
41
|
"storybook": "^10.0.6",
|
|
39
42
|
"typescript": "^5.9.3",
|
|
40
43
|
"vite": "^7.2.2"
|
package/vibe-app-mount.d.ts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { type VibeMetadata } from './contexts/VibeContext.js';
|
|
2
3
|
export interface MountVibesAppOptions {
|
|
3
|
-
readonly container
|
|
4
|
-
readonly title?: string;
|
|
5
|
-
readonly imageUrl?: string;
|
|
4
|
+
readonly container: HTMLElement;
|
|
6
5
|
readonly appComponent?: React.ComponentType;
|
|
7
6
|
readonly showVibesSwitch?: boolean;
|
|
7
|
+
readonly vibeMetadata?: VibeMetadata;
|
|
8
8
|
}
|
|
9
9
|
export interface MountVibesAppResult {
|
|
10
10
|
unmount: () => void;
|
|
11
11
|
getContainer: () => HTMLElement;
|
|
12
12
|
}
|
|
13
|
-
export declare function mountVibesApp(options
|
|
14
|
-
export declare function mountVibesAppToBody(): MountVibesAppResult;
|
|
13
|
+
export declare function mountVibesApp(options: MountVibesAppOptions): MountVibesAppResult;
|
package/vibe-app-mount.js
CHANGED
|
@@ -1,124 +1,39 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import * as ReactDOM from 'react-dom/client';
|
|
3
|
-
import { AuthWall } from './components/AuthWall/AuthWall.js';
|
|
4
|
-
import { VIBES_SYNC_ENABLE_EVENT, VIBES_SYNC_ENABLED_CLASS } from './constants.js';
|
|
5
3
|
import { HiddenMenuWrapper } from './components/HiddenMenuWrapper/HiddenMenuWrapper.js';
|
|
6
4
|
import { VibesPanel } from './components/VibesPanel/VibesPanel.js';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
import { VibeContextProvider, validateVibeMetadata, VibeMetadataValidationError, } from './contexts/VibeContext.js';
|
|
6
|
+
function VibesApp({ showVibesSwitch = true, vibeMetadata, children, }) {
|
|
7
|
+
const content = showVibesSwitch ? (React.createElement(HiddenMenuWrapper, { menuContent: React.createElement(VibesPanel, null), showVibesSwitch: true }, children)) : (React.createElement(React.Fragment, null, children));
|
|
8
|
+
if (vibeMetadata) {
|
|
9
|
+
return React.createElement(VibeContextProvider, { metadata: vibeMetadata }, content);
|
|
10
10
|
}
|
|
11
|
-
|
|
12
|
-
return null;
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
function VibesApp({ title = 'Vibes App', imageUrl = '/screenshot.png', showVibesSwitch = true, children, }) {
|
|
16
|
-
const syncEnabled = typeof window !== 'undefined' && document.body.classList.contains(VIBES_SYNC_ENABLED_CLASS);
|
|
17
|
-
const wasSyncEnabled = typeof window !== 'undefined' && safeGetLocalStorage('fireproof-sync-enabled') === 'true';
|
|
18
|
-
const mockLogin = typeof window !== 'undefined' &&
|
|
19
|
-
new URLSearchParams(window.location.search).get('mock_login') === 'true';
|
|
20
|
-
const [showAuthWall, setShowAuthWall] = React.useState(!syncEnabled && !mockLogin && !wasSyncEnabled);
|
|
21
|
-
React.useEffect(() => {
|
|
22
|
-
const observer = new MutationObserver(() => {
|
|
23
|
-
const isConnected = document.body.classList.contains(VIBES_SYNC_ENABLED_CLASS);
|
|
24
|
-
setShowAuthWall(!isConnected && !mockLogin && !wasSyncEnabled);
|
|
25
|
-
});
|
|
26
|
-
observer.observe(document.body, {
|
|
27
|
-
attributes: true,
|
|
28
|
-
attributeFilter: ['class'],
|
|
29
|
-
});
|
|
30
|
-
return () => observer.disconnect();
|
|
31
|
-
}, [mockLogin, wasSyncEnabled]);
|
|
32
|
-
const handleLogin = () => {
|
|
33
|
-
document.dispatchEvent(new CustomEvent(VIBES_SYNC_ENABLE_EVENT));
|
|
34
|
-
};
|
|
35
|
-
return (React.createElement(React.Fragment, null,
|
|
36
|
-
React.createElement("div", { style: showAuthWall ? { display: 'none' } : undefined },
|
|
37
|
-
React.createElement(HiddenMenuWrapper, { menuContent: React.createElement(VibesPanel, null), showVibesSwitch: showVibesSwitch }, children)),
|
|
38
|
-
React.createElement(AuthWall, { onLogin: handleLogin, imageUrl: imageUrl, title: title, open: showAuthWall })));
|
|
11
|
+
return content;
|
|
39
12
|
}
|
|
40
|
-
export function mountVibesApp(options
|
|
41
|
-
const { container
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
if (!found) {
|
|
46
|
-
throw new Error(`VibesApp container not found: ${containerOption}`);
|
|
13
|
+
export function mountVibesApp(options) {
|
|
14
|
+
const { container, appComponent, showVibesSwitch, vibeMetadata } = options;
|
|
15
|
+
if (vibeMetadata) {
|
|
16
|
+
try {
|
|
17
|
+
validateVibeMetadata(vibeMetadata);
|
|
47
18
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
containerElement = document.body;
|
|
55
|
-
}
|
|
56
|
-
let contentWrapper = null;
|
|
57
|
-
let originalChildren = [];
|
|
58
|
-
if (containerElement === document.body && !appComponent) {
|
|
59
|
-
const existingWrapper = document.getElementById('vibes-original-content');
|
|
60
|
-
if (!existingWrapper) {
|
|
61
|
-
originalChildren = Array.from(document.body.childNodes);
|
|
62
|
-
contentWrapper = document.createElement('div');
|
|
63
|
-
contentWrapper.id = 'vibes-original-content';
|
|
64
|
-
contentWrapper.style.height = '100%';
|
|
65
|
-
contentWrapper.style.width = '100%';
|
|
66
|
-
contentWrapper.style.position = 'relative';
|
|
67
|
-
originalChildren.forEach((child) => {
|
|
68
|
-
if (contentWrapper) {
|
|
69
|
-
contentWrapper.appendChild(child);
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
document.body.appendChild(contentWrapper);
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
contentWrapper = existingWrapper;
|
|
19
|
+
catch (error) {
|
|
20
|
+
if (error instanceof VibeMetadataValidationError) {
|
|
21
|
+
throw new Error(`Failed to mount Vibes app: ${error.message} (code: ${error.code}). ` +
|
|
22
|
+
`Received vibeMetadata: ${JSON.stringify(vibeMetadata)}`);
|
|
23
|
+
}
|
|
24
|
+
throw error;
|
|
76
25
|
}
|
|
77
26
|
}
|
|
78
|
-
const root = ReactDOM.createRoot(
|
|
27
|
+
const root = ReactDOM.createRoot(container);
|
|
79
28
|
const AppComponent = appComponent;
|
|
80
|
-
root.render(React.createElement(VibesApp, { ...(
|
|
81
|
-
if (node && contentWrapper && node.children.length === 0) {
|
|
82
|
-
node.appendChild(contentWrapper);
|
|
83
|
-
}
|
|
84
|
-
}, style: { height: '100%', width: '100%' } })) : null));
|
|
29
|
+
root.render(React.createElement(VibesApp, { ...(showVibesSwitch !== undefined && { showVibesSwitch }), ...(vibeMetadata !== undefined && { vibeMetadata }) }, AppComponent && React.createElement(AppComponent, null)));
|
|
85
30
|
return {
|
|
86
31
|
unmount: () => {
|
|
87
32
|
setTimeout(() => {
|
|
88
33
|
root.unmount();
|
|
89
|
-
if (contentWrapper && containerElement === document.body) {
|
|
90
|
-
const children = Array.from(contentWrapper.childNodes);
|
|
91
|
-
const wrapperInDom = document.body.contains(contentWrapper);
|
|
92
|
-
for (const child of children) {
|
|
93
|
-
if (wrapperInDom) {
|
|
94
|
-
document.body.insertBefore(child, contentWrapper);
|
|
95
|
-
}
|
|
96
|
-
else {
|
|
97
|
-
document.body.appendChild(child);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
if (wrapperInDom) {
|
|
101
|
-
contentWrapper.remove();
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
const targets = [];
|
|
105
|
-
if (containerElement instanceof HTMLElement)
|
|
106
|
-
targets.push(containerElement);
|
|
107
|
-
if (contentWrapper instanceof HTMLElement)
|
|
108
|
-
targets.push(contentWrapper);
|
|
109
|
-
for (const el of targets) {
|
|
110
|
-
el.style.filter = '';
|
|
111
|
-
el.style.pointerEvents = '';
|
|
112
|
-
el.style.transform = '';
|
|
113
|
-
el.style.transition = '';
|
|
114
|
-
el.style.backgroundColor = '';
|
|
115
|
-
}
|
|
116
34
|
}, 0);
|
|
117
35
|
},
|
|
118
|
-
getContainer: () =>
|
|
36
|
+
getContainer: () => container,
|
|
119
37
|
};
|
|
120
38
|
}
|
|
121
|
-
export function mountVibesAppToBody() {
|
|
122
|
-
return mountVibesApp();
|
|
123
|
-
}
|
|
124
39
|
//# sourceMappingURL=vibe-app-mount.js.map
|
package/vibe-app-mount.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vibe-app-mount.js","sourceRoot":"","sources":["../jsr/vibe-app-mount.tsx"],"names":[],"mappings":"AAAA,OA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,IAAI,KAAK,CACb,8BAA8B,KAAK,CAAC,OAAO,WAAW,KAAK,CAAC,IAAI,KAAK;oBACnE,0BAA0B,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,CAC3D,CAAC;YACJ,CAAC;YACD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;IAED,MAAM,IAAI,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IAE5C,MAAM,YAAY,GAAG,YAAY,CAAC;IAElC,IAAI,CAAC,MAAM,CACT,oBAAC,QAAQ,OACH,CAAC,eAAe,KAAK,SAAS,IAAI,EAAE,eAAe,EAAE,CAAC,KACtD,CAAC,YAAY,KAAK,SAAS,IAAI,EAAE,YAAY,EAAE,CAAC,IAEnD,YAAY,IAAI,oBAAC,YAAY,OAAG,CACxB,CACZ,CAAC;IAEF,OAAO;QACL,OAAO,EAAE,GAAG,EAAE,CAAC;YACb,UAAU,CAAC,GAAG,EAAE,CAAC;gBACf,IAAI,CAAC,OAAO,EAAE,CAAC;YAAA,CAChB,EAAE,CAAC,CAAC,CAAC;QAAA,CACP;QAED,YAAY,EAAE,GAAG,EAAE,CAAC,SAAS;KAC9B,CAAC;AAAA,CACH"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { Logger } from '@adviser/cement';
|
|
2
|
-
import type { SuperThis } from '@fireproof/core-types-base';
|
|
3
|
-
import type { ToCloudOpts, TokenAndClaims } from '@fireproof/core-types-protocols-cloud';
|
|
4
|
-
import { RedirectStrategy } from 'use-fireproof';
|
|
5
|
-
declare global {
|
|
6
|
-
var VIBE_UUID: string | undefined;
|
|
7
|
-
var VIBE_TITLE_ID: string | undefined;
|
|
8
|
-
}
|
|
9
|
-
export declare function isJWTExpired(token: string): boolean;
|
|
10
|
-
export declare class ManualRedirectStrategy extends RedirectStrategy {
|
|
11
|
-
private authOpened;
|
|
12
|
-
private pollingStarted;
|
|
13
|
-
private resolveToken?;
|
|
14
|
-
readonly hash: () => string;
|
|
15
|
-
setToken(token: string): void;
|
|
16
|
-
constructor(opts?: {
|
|
17
|
-
overlayHtml?: (url: string) => string;
|
|
18
|
-
overlayCss?: string;
|
|
19
|
-
});
|
|
20
|
-
open(sthis: SuperThis, logger: Logger, deviceId: string, opts: ToCloudOpts): void;
|
|
21
|
-
waitForToken(sthis: SuperThis, logger: Logger, deviceId: string, opts: ToCloudOpts): Promise<TokenAndClaims | undefined>;
|
|
22
|
-
private setupManualTrigger;
|
|
23
|
-
stop(): void;
|
|
24
|
-
}
|
|
@@ -1,289 +0,0 @@
|
|
|
1
|
-
import { RedirectStrategy } from 'use-fireproof';
|
|
2
|
-
import { AUTH_OVERLAY_READY_EVENT, AUTH_OVERLAY_HIDDEN_CLASS } from './events.js';
|
|
3
|
-
function generateLedgerName(dbName) {
|
|
4
|
-
if (typeof globalThis !== 'undefined' && globalThis.VIBE_UUID) {
|
|
5
|
-
const safeUuid = String(globalThis.VIBE_UUID).replace(/[^a-z0-9-]/gi, '-');
|
|
6
|
-
const safeDb = String(dbName).replace(/[^a-z0-9-]/gi, '-');
|
|
7
|
-
return `${safeUuid}-${safeDb}`;
|
|
8
|
-
}
|
|
9
|
-
const origin = typeof window !== 'undefined'
|
|
10
|
-
? window.location.origin.replace(/[^a-z0-9]/gi, '-')
|
|
11
|
-
: 'unknown-origin';
|
|
12
|
-
const safeDb = String(dbName).replace(/[^a-z0-9-]/gi, '-');
|
|
13
|
-
return `${origin}-${safeDb}`;
|
|
14
|
-
}
|
|
15
|
-
function parseJWT(token) {
|
|
16
|
-
try {
|
|
17
|
-
const parts = token.split('.');
|
|
18
|
-
if (parts.length !== 3) {
|
|
19
|
-
return undefined;
|
|
20
|
-
}
|
|
21
|
-
const payload = parts[1];
|
|
22
|
-
const base64 = payload.replace(/-/g, '+').replace(/_/g, '/');
|
|
23
|
-
const paddedBase64 = base64 + '='.repeat((4 - (base64.length % 4)) % 4);
|
|
24
|
-
const jsonString = atob(paddedBase64);
|
|
25
|
-
return JSON.parse(jsonString);
|
|
26
|
-
}
|
|
27
|
-
catch {
|
|
28
|
-
return undefined;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
export function isJWTExpired(token) {
|
|
32
|
-
try {
|
|
33
|
-
const claims = parseJWT(token);
|
|
34
|
-
if (!claims || typeof claims.exp !== 'number') {
|
|
35
|
-
return true;
|
|
36
|
-
}
|
|
37
|
-
const expirationTime = claims.exp * 1000;
|
|
38
|
-
const currentTime = Date.now();
|
|
39
|
-
return currentTime >= expirationTime - 60000;
|
|
40
|
-
}
|
|
41
|
-
catch {
|
|
42
|
-
return true;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
export class ManualRedirectStrategy extends RedirectStrategy {
|
|
46
|
-
authOpened = false;
|
|
47
|
-
pollingStarted = false;
|
|
48
|
-
resolveToken;
|
|
49
|
-
hash = () => {
|
|
50
|
-
return 'manual-redirect-strategy';
|
|
51
|
-
};
|
|
52
|
-
setToken(token) {
|
|
53
|
-
const claims = parseJWT(token);
|
|
54
|
-
this.currentToken = {
|
|
55
|
-
token,
|
|
56
|
-
claims,
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
constructor(opts = {}) {
|
|
60
|
-
const customCss = opts.overlayCss ||
|
|
61
|
-
`
|
|
62
|
-
.fpOverlay {
|
|
63
|
-
display: none;
|
|
64
|
-
position: fixed;
|
|
65
|
-
bottom: 20px;
|
|
66
|
-
right: 20px;
|
|
67
|
-
width: auto;
|
|
68
|
-
height: auto;
|
|
69
|
-
background-color: transparent;
|
|
70
|
-
z-index: 9999;
|
|
71
|
-
animation: slideUp 0.3s ease-out;
|
|
72
|
-
pointer-events: none; /* Allow clicking through the overlay container */
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/* Hidden/minimized state toggled from outside */
|
|
76
|
-
.fpOverlay.${AUTH_OVERLAY_HIDDEN_CLASS} {
|
|
77
|
-
display: none !important;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.fpOverlay[style*="block"] {
|
|
81
|
-
display: block !important;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.fpOverlayContent {
|
|
85
|
-
pointer-events: auto; /* But allow interaction with the content */
|
|
86
|
-
background-color: white;
|
|
87
|
-
color: black;
|
|
88
|
-
padding: 16px 20px;
|
|
89
|
-
border-radius: 12px;
|
|
90
|
-
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
|
|
91
|
-
max-width: 320px;
|
|
92
|
-
display: flex;
|
|
93
|
-
align-items: center;
|
|
94
|
-
gap: 12px;
|
|
95
|
-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
96
|
-
font-size: 14px;
|
|
97
|
-
line-height: 1.5;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
.fpCloseButton {
|
|
101
|
-
position: absolute;
|
|
102
|
-
top: 8px;
|
|
103
|
-
right: 8px;
|
|
104
|
-
font-size: 18px;
|
|
105
|
-
cursor: pointer;
|
|
106
|
-
color: #999;
|
|
107
|
-
background: none;
|
|
108
|
-
border: none;
|
|
109
|
-
padding: 4px;
|
|
110
|
-
line-height: 1;
|
|
111
|
-
opacity: 0.7;
|
|
112
|
-
transition: opacity 0.2s;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.fpCloseButton:hover {
|
|
116
|
-
opacity: 1;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
@keyframes slideUp {
|
|
120
|
-
from {
|
|
121
|
-
transform: translateY(100px);
|
|
122
|
-
opacity: 0;
|
|
123
|
-
}
|
|
124
|
-
to {
|
|
125
|
-
transform: translateY(0);
|
|
126
|
-
opacity: 1;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
`;
|
|
130
|
-
const customHtml = opts.overlayHtml ||
|
|
131
|
-
((url) => `
|
|
132
|
-
<div class="fpOverlayContent">
|
|
133
|
-
<div class="fpCloseButton">×</div>
|
|
134
|
-
<div style="
|
|
135
|
-
width: 32px;
|
|
136
|
-
height: 32px;
|
|
137
|
-
min-width: 32px;
|
|
138
|
-
background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
|
|
139
|
-
border-radius: 8px;
|
|
140
|
-
display: flex;
|
|
141
|
-
align-items: center;
|
|
142
|
-
justify-content: center;
|
|
143
|
-
color: white;
|
|
144
|
-
font-size: 16px;
|
|
145
|
-
">🔥</div>
|
|
146
|
-
|
|
147
|
-
<div style="flex: 1;">
|
|
148
|
-
<div style="
|
|
149
|
-
font-weight: 600;
|
|
150
|
-
color: #333;
|
|
151
|
-
margin-bottom: 4px;
|
|
152
|
-
">Enable Sync</div>
|
|
153
|
-
|
|
154
|
-
<div style="
|
|
155
|
-
color: #666;
|
|
156
|
-
font-size: 13px;
|
|
157
|
-
margin-bottom: 8px;
|
|
158
|
-
">Sign in to sync across devices</div>
|
|
159
|
-
|
|
160
|
-
<a href="${url}" style="
|
|
161
|
-
display: inline-block;
|
|
162
|
-
background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
|
|
163
|
-
color: white;
|
|
164
|
-
text-decoration: none;
|
|
165
|
-
padding: 6px 14px;
|
|
166
|
-
border-radius: 6px;
|
|
167
|
-
font-weight: 500;
|
|
168
|
-
font-size: 13px;
|
|
169
|
-
cursor: pointer;
|
|
170
|
-
transition: transform 0.2s ease, box-shadow 0.2s ease;
|
|
171
|
-
" onmouseover="this.style.transform='translateY(-1px)'; this.style.boxShadow='0 2px 8px rgba(255, 107, 53, 0.3)'" onmouseout="this.style.transform='translateY(0)'; this.style.boxShadow='none'">
|
|
172
|
-
Sign In
|
|
173
|
-
</a>
|
|
174
|
-
</div>
|
|
175
|
-
</div>
|
|
176
|
-
`);
|
|
177
|
-
super({ overlayCss: customCss, overlayHtml: customHtml });
|
|
178
|
-
}
|
|
179
|
-
open(sthis, logger, deviceId, opts) {
|
|
180
|
-
const originalWindowOpen = window.open;
|
|
181
|
-
window.open = () => null;
|
|
182
|
-
super.open(sthis, logger, deviceId, opts);
|
|
183
|
-
window.open = originalWindowOpen;
|
|
184
|
-
super.tryToken(sthis, logger, opts).then((existingToken) => {
|
|
185
|
-
if (existingToken && this.overlayNode) {
|
|
186
|
-
this.overlayNode.style.display = 'none';
|
|
187
|
-
}
|
|
188
|
-
else {
|
|
189
|
-
this.setupManualTrigger(sthis, logger, deviceId, opts);
|
|
190
|
-
}
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
async waitForToken(sthis, logger, deviceId, opts) {
|
|
194
|
-
const existingToken = await super.tryToken(sthis, logger, opts);
|
|
195
|
-
if (existingToken) {
|
|
196
|
-
return existingToken;
|
|
197
|
-
}
|
|
198
|
-
if (!this.pollingStarted) {
|
|
199
|
-
return new Promise((resolve) => {
|
|
200
|
-
this.resolveToken = resolve;
|
|
201
|
-
});
|
|
202
|
-
}
|
|
203
|
-
return super.waitForToken(sthis, logger, deviceId, opts);
|
|
204
|
-
}
|
|
205
|
-
setupManualTrigger(sthis, logger, deviceId, opts) {
|
|
206
|
-
if (!this.overlayNode)
|
|
207
|
-
return;
|
|
208
|
-
const redirectCtx = opts.context?.get?.('WebCtx') || {
|
|
209
|
-
dashboardURI: opts.dashboardURI,
|
|
210
|
-
};
|
|
211
|
-
const dashboardURI = redirectCtx.dashboardURI;
|
|
212
|
-
if (!dashboardURI)
|
|
213
|
-
return;
|
|
214
|
-
const BuildURI = globalThis.BuildURI || {
|
|
215
|
-
from: (uri) => {
|
|
216
|
-
const urlObj = new URL(uri);
|
|
217
|
-
return {
|
|
218
|
-
_url: urlObj,
|
|
219
|
-
setParam: function (key, value) {
|
|
220
|
-
this._url.searchParams.set(key, value);
|
|
221
|
-
return this;
|
|
222
|
-
},
|
|
223
|
-
asURL: function () {
|
|
224
|
-
return this._url;
|
|
225
|
-
},
|
|
226
|
-
toString: function () {
|
|
227
|
-
return this._url.toString();
|
|
228
|
-
},
|
|
229
|
-
};
|
|
230
|
-
},
|
|
231
|
-
};
|
|
232
|
-
const url = BuildURI
|
|
233
|
-
.from(dashboardURI)
|
|
234
|
-
.setParam('back_url', window.location.href)
|
|
235
|
-
.setParam('result_id', this.resultId || '')
|
|
236
|
-
.setParam('local_ledger_name', generateLedgerName(deviceId));
|
|
237
|
-
if (opts.ledger) {
|
|
238
|
-
url.setParam('ledger', String(opts.ledger));
|
|
239
|
-
}
|
|
240
|
-
if (opts.tenant) {
|
|
241
|
-
url.setParam('tenant', String(opts.tenant));
|
|
242
|
-
}
|
|
243
|
-
const authLink = this.overlayNode.querySelector('a[href]');
|
|
244
|
-
if (authLink) {
|
|
245
|
-
authLink.addEventListener('click', async (e) => {
|
|
246
|
-
e.preventDefault();
|
|
247
|
-
if (!this.authOpened) {
|
|
248
|
-
const width = 800;
|
|
249
|
-
const height = 600;
|
|
250
|
-
const parentScreenX = window.screenX || window.screenLeft;
|
|
251
|
-
const parentScreenY = window.screenY || window.screenTop;
|
|
252
|
-
const parentOuterWidth = window.outerWidth;
|
|
253
|
-
const parentOuterHeight = window.outerHeight;
|
|
254
|
-
const left = parentScreenX + parentOuterWidth / 2 - width / 2;
|
|
255
|
-
const top = parentScreenY + parentOuterHeight / 2 - height / 2;
|
|
256
|
-
window.open(url.toString(), 'Fireproof Login', `left=${left},top=${top},width=${width},height=${height},scrollbars=yes,resizable=yes,popup=yes`);
|
|
257
|
-
this.authOpened = true;
|
|
258
|
-
if (!this.pollingStarted) {
|
|
259
|
-
this.pollingStarted = true;
|
|
260
|
-
const token = await super.waitForToken(sthis, logger, deviceId, opts);
|
|
261
|
-
if (this.resolveToken) {
|
|
262
|
-
this.resolveToken(token);
|
|
263
|
-
this.resolveToken = undefined;
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
if (this.overlayNode) {
|
|
267
|
-
this.overlayNode.style.opacity = '0.7';
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
});
|
|
271
|
-
}
|
|
272
|
-
if (this.overlayNode) {
|
|
273
|
-
const overlayEl = this.overlayNode;
|
|
274
|
-
const linkEl = overlayEl.querySelector('a[href]');
|
|
275
|
-
requestAnimationFrame(() => {
|
|
276
|
-
document.dispatchEvent(new CustomEvent(AUTH_OVERLAY_READY_EVENT, {
|
|
277
|
-
detail: { overlay: overlayEl, authLink: linkEl },
|
|
278
|
-
}));
|
|
279
|
-
});
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
stop() {
|
|
283
|
-
super.stop();
|
|
284
|
-
this.authOpened = false;
|
|
285
|
-
this.pollingStarted = false;
|
|
286
|
-
this.resolveToken = undefined;
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
//# sourceMappingURL=ManualRedirectStrategy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ManualRedirectStrategy.js","sourceRoot":"","sources":["../jsr/ManualRedirectStrategy.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAmBlF,SAAS,kBAAkB,CAAC,MAAc,EAAU;IAGlD,IAAI,OAAO,UAAU,KAAK,WAAW,IAAI,UAAU,CAAC,SAAS,EAAE,CAAC;QAE9D,MAAM,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC;QAC3E,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC;QAC3D,OAAO,GAAG,QAAQ,IAAI,MAAM,EAAE,CAAC;IACjC,CAAC;IAGD,MAAM,MAAM,GACV,OAAO,MAAM,KAAK,WAAW;QAC3B,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC;QACpD,CAAC,CAAC,gBAAgB,CAAC;IACvB,MAAM,MAAM,GAAG,MAAM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