@docuninja/builder2.0 0.0.70 → 0.0.71
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/dist/builder/builder-store.d.ts +54 -0
- package/dist/builder/cache-store.d.ts +12 -0
- package/dist/builder/component-types.d.ts +149 -0
- package/dist/builder/helpers.d.ts +9 -0
- package/dist/builder/hooks/use-cookie-consent-height.d.ts +1 -0
- package/dist/builder/hooks/use-label-position.d.ts +3 -0
- package/dist/builder/index.d.ts +97 -0
- package/dist/builder/password-files.d.ts +3 -0
- package/dist/builder/pdf-worker.d.ts +2 -0
- package/dist/builder/root.d.ts +2 -0
- package/dist/builder/sensor.d.ts +14 -0
- package/dist/builder/sign/actions.d.ts +21 -0
- package/dist/builder/sign/checkbox-panel.d.ts +5 -0
- package/dist/builder/sign/component-types.d.ts +68 -0
- package/dist/builder/sign/consent.d.ts +7 -0
- package/dist/builder/sign/date-panel.d.ts +5 -0
- package/dist/builder/sign/file.d.ts +10 -0
- package/dist/builder/sign/font-selector.d.ts +6 -0
- package/dist/builder/sign/fonts.d.ts +1 -0
- package/dist/builder/sign/index.d.ts +50 -0
- package/dist/builder/sign/initials-panel.d.ts +5 -0
- package/dist/builder/sign/initials-signature-panel.d.ts +6 -0
- package/dist/builder/sign/multiselect-panel.d.ts +5 -0
- package/dist/builder/sign/number-panel.d.ts +5 -0
- package/dist/builder/sign/radio-panel.d.ts +5 -0
- package/dist/builder/sign/select-panel.d.ts +5 -0
- package/dist/builder/sign/sign-panel.d.ts +5 -0
- package/dist/builder/sign/signature.d.ts +6 -0
- package/dist/builder/sign/success.d.ts +3 -0
- package/dist/builder/sign/text-panel.d.ts +5 -0
- package/dist/builder/sign/voided.d.ts +1 -0
- package/dist/builder/sign-store.d.ts +49 -0
- package/dist/builder/standalone.d.ts +13 -0
- package/dist/builder/types/api.d.ts +352 -0
- package/dist/builder/ui/delete.d.ts +7 -0
- package/dist/builder/ui/document.d.ts +5 -0
- package/dist/builder/ui/editable.d.ts +7 -0
- package/dist/builder/ui/files.d.ts +6 -0
- package/dist/builder/ui/frame.d.ts +1 -0
- package/dist/builder/ui/index.d.ts +124 -0
- package/dist/builder/ui/index.iife.d.ts +2 -0
- package/dist/builder/ui/options-modal.d.ts +11 -0
- package/dist/builder/ui/preview.d.ts +7 -0
- package/dist/builder/ui/rectangles.d.ts +9 -0
- package/dist/builder/ui/save.d.ts +11 -0
- package/dist/builder/ui/send-confirmation.d.ts +9 -0
- package/dist/builder/ui/settings-modal.d.ts +10 -0
- package/dist/builder/ui/signatories.d.ts +23 -0
- package/dist/builder/ui/signatory.d.ts +51 -0
- package/dist/builder/ui/title.d.ts +7 -0
- package/dist/builder/ui/toolbox-context.d.ts +14 -0
- package/dist/builder/ui/toolbox.d.ts +3 -0
- package/dist/builder/ui/upload.d.ts +16 -0
- package/dist/builder/ui/validation-errors.d.ts +5 -0
- package/dist/builder/ui/websockets.d.ts +38 -0
- package/dist/builder/websocket-manager.d.ts +75 -0
- package/dist/builder/websockets-store.d.ts +20 -0
- package/dist/builder.iife.js +294 -0
- package/dist/builder2.0.css +1 -0
- package/package.json +4 -3
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { DraggableAttributes } from '@dnd-kit/core';
|
|
2
|
+
import { SyntheticListenerMap } from '@dnd-kit/core/dist/hooks/utilities';
|
|
3
|
+
import { FieldValues } from 'react-hook-form';
|
|
4
|
+
import { ClientContact, User as TUser } from '../types/api';
|
|
5
|
+
import { TSignatoryType } from '..';
|
|
6
|
+
export declare function SortableSignatory(props: Omit<SignatoryProps, "isSorting" | "setNodeRef" | "style" | "dragHandleListeners" | "dragHandleAttributes">): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
7
|
+
type SignatoryProps = {
|
|
8
|
+
id: string;
|
|
9
|
+
type: TSignatoryType;
|
|
10
|
+
onDelete: (id: string, type: SignatoryProps["type"]) => void;
|
|
11
|
+
isSorting: boolean;
|
|
12
|
+
setNodeRef: (element: HTMLElement | null) => void;
|
|
13
|
+
style: React.CSSProperties;
|
|
14
|
+
dragHandleListeners: SyntheticListenerMap | undefined;
|
|
15
|
+
dragHandleAttributes: DraggableAttributes;
|
|
16
|
+
};
|
|
17
|
+
export declare function Signatory({ id, type, onDelete, isSorting, setNodeRef, style, dragHandleAttributes, dragHandleListeners, }: SignatoryProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
18
|
+
type SignatorySwapProps = {
|
|
19
|
+
current: string;
|
|
20
|
+
currentType: SignatoryProps["type"];
|
|
21
|
+
};
|
|
22
|
+
export declare function SignatorySwap({ current, currentType }: SignatorySwapProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare function useSignatories(): ({
|
|
24
|
+
value: string;
|
|
25
|
+
label: string;
|
|
26
|
+
type: "contact";
|
|
27
|
+
entity: ClientContact;
|
|
28
|
+
} | {
|
|
29
|
+
value: string;
|
|
30
|
+
label: string;
|
|
31
|
+
type: "user";
|
|
32
|
+
entity: TUser;
|
|
33
|
+
})[];
|
|
34
|
+
type NameProps = {
|
|
35
|
+
id: string;
|
|
36
|
+
type: SignatoryProps["type"];
|
|
37
|
+
};
|
|
38
|
+
export declare function Name({ id, type }: NameProps): string | import("@emotion/react/jsx-runtime").JSX.Element | undefined;
|
|
39
|
+
export declare function Create(): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
40
|
+
export type CreateDialogTabProps = {
|
|
41
|
+
setOpen: (open: boolean) => void;
|
|
42
|
+
endpoint: string;
|
|
43
|
+
};
|
|
44
|
+
export type CreateDialogFieldProps<T extends FieldValues> = {
|
|
45
|
+
name: keyof T;
|
|
46
|
+
type: HTMLInputElement["type"];
|
|
47
|
+
onValueChange: (v: unknown) => void;
|
|
48
|
+
};
|
|
49
|
+
export declare function Entity({ setOpen, endpoint }: CreateDialogTabProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
50
|
+
export declare function SignatoryWarning(): null;
|
|
51
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Rectangle } from '..';
|
|
2
|
+
export type ToolboxOption = {
|
|
3
|
+
label: string;
|
|
4
|
+
type: "toggle" | "button";
|
|
5
|
+
children: ToolboxOption[];
|
|
6
|
+
value: unknown;
|
|
7
|
+
onSelect: (value: unknown) => void;
|
|
8
|
+
};
|
|
9
|
+
type ToolboxContextType = {
|
|
10
|
+
rectangle: Rectangle;
|
|
11
|
+
};
|
|
12
|
+
export declare const rectanglesWithAttention: string[];
|
|
13
|
+
export declare function ToolboxContext({ rectangle }: ToolboxContextType): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type InputType = "signature" | "input" | "date" | "checkbox" | "initial" | "select" | "radio" | "multiselect" | "number";
|
|
2
|
+
export declare function Toolbox(): import("@emotion/react/jsx-runtime").JSX.Element | null;
|
|
3
|
+
export declare function Helper(): import("@emotion/react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Document } from '../types/api';
|
|
2
|
+
type FileProps = {
|
|
3
|
+
document: Document;
|
|
4
|
+
isDialogOpen: boolean;
|
|
5
|
+
setIsDialogOpen: (open: boolean) => void;
|
|
6
|
+
};
|
|
7
|
+
export type UploadForm = {
|
|
8
|
+
files: File[];
|
|
9
|
+
};
|
|
10
|
+
export declare function Upload({ document, isDialogOpen, setIsDialogOpen }: FileProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
11
|
+
type UploadWidgetProps = {
|
|
12
|
+
document: Document;
|
|
13
|
+
onComplete?: () => void;
|
|
14
|
+
};
|
|
15
|
+
export declare function UploadWidget({ document, onComplete }: UploadWidgetProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
type Props = {
|
|
2
|
+
children: React.ReactNode;
|
|
3
|
+
context: "builder" | "sign";
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* WebSockets Component (Refactored to use Singleton Manager)
|
|
7
|
+
*
|
|
8
|
+
* This component now acts as a thin wrapper that:
|
|
9
|
+
* 1. Initializes the singleton WebSocket manager
|
|
10
|
+
* 2. Updates the Zustand store with the connection instance
|
|
11
|
+
* 3. Manages component lifecycle (connect/disconnect on mount/unmount)
|
|
12
|
+
*/
|
|
13
|
+
export declare function WebSockets({ children, context }: Props): import("@emotion/react/jsx-runtime").JSX.Element | null;
|
|
14
|
+
export declare const events: readonly ["App\\Events\\DocumentFile\\DocumentFilePreviewGenerated"];
|
|
15
|
+
export type Event = (typeof events)[number];
|
|
16
|
+
export type Callbacks = Record<Event, (data: unknown) => unknown>;
|
|
17
|
+
export type UsePrivateSocketEventsProps = {
|
|
18
|
+
context: "builder" | "sign";
|
|
19
|
+
};
|
|
20
|
+
export declare function usePrivateSocketEvents({ context, }: UsePrivateSocketEventsProps): null;
|
|
21
|
+
export interface CallbackOptions<T> {
|
|
22
|
+
event: Event;
|
|
23
|
+
data: T;
|
|
24
|
+
}
|
|
25
|
+
export interface SocketEventProps<T> {
|
|
26
|
+
on: Event | Event[];
|
|
27
|
+
callback: (options: CallbackOptions<T>) => unknown;
|
|
28
|
+
}
|
|
29
|
+
export type WithSocketId<T> = T & {
|
|
30
|
+
"x-socket-id": string;
|
|
31
|
+
};
|
|
32
|
+
export declare function useSocketEvent<T>({ on, callback }: SocketEventProps<T>): void;
|
|
33
|
+
export declare function socketId(): number | null;
|
|
34
|
+
export interface GenericMessage {
|
|
35
|
+
message: string;
|
|
36
|
+
link: string | null;
|
|
37
|
+
}
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { default as Pusher } from 'pusher-js';
|
|
2
|
+
type PusherError = {
|
|
3
|
+
error?: {
|
|
4
|
+
type: string;
|
|
5
|
+
data: {
|
|
6
|
+
code?: number;
|
|
7
|
+
message?: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
type ConnectionConfig = {
|
|
12
|
+
context: "builder" | "sign";
|
|
13
|
+
token: string;
|
|
14
|
+
onConnected?: () => void;
|
|
15
|
+
onError?: (error: PusherError) => void;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Singleton WebSocket Manager
|
|
19
|
+
*
|
|
20
|
+
* Ensures only one Pusher connection exists across the entire application.
|
|
21
|
+
* Manages connections for both "builder" and "sign" contexts.
|
|
22
|
+
*
|
|
23
|
+
* Handles React StrictMode double-mounting by checking connection state before creating new instances.
|
|
24
|
+
*/
|
|
25
|
+
declare class WebSocketManager {
|
|
26
|
+
private static instance;
|
|
27
|
+
private pusher;
|
|
28
|
+
private activeContexts;
|
|
29
|
+
private connectionConfig;
|
|
30
|
+
private isConnecting;
|
|
31
|
+
private readonly pusherKey;
|
|
32
|
+
private readonly pusherUrl;
|
|
33
|
+
private constructor();
|
|
34
|
+
/**
|
|
35
|
+
* Get the singleton instance
|
|
36
|
+
*/
|
|
37
|
+
static getInstance(): WebSocketManager;
|
|
38
|
+
/**
|
|
39
|
+
* Connect to Pusher for a specific context
|
|
40
|
+
*
|
|
41
|
+
* This method is idempotent - calling it multiple times will reuse the existing connection.
|
|
42
|
+
* Prevents race conditions from StrictMode double-mounting or rapid successive calls.
|
|
43
|
+
*/
|
|
44
|
+
connect(config: ConnectionConfig): Pusher;
|
|
45
|
+
/**
|
|
46
|
+
* Create a new Pusher connection
|
|
47
|
+
*/
|
|
48
|
+
private createPusherConnection;
|
|
49
|
+
/**
|
|
50
|
+
* Disconnect from Pusher
|
|
51
|
+
*/
|
|
52
|
+
disconnect(): void;
|
|
53
|
+
/**
|
|
54
|
+
* Get the current Pusher instance
|
|
55
|
+
*/
|
|
56
|
+
getPusher(): Pusher | null;
|
|
57
|
+
/**
|
|
58
|
+
* Check if connected
|
|
59
|
+
*/
|
|
60
|
+
isConnected(): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Remove a context from active contexts (for feedback/debugging only)
|
|
63
|
+
*
|
|
64
|
+
* NOTE: This method no longer disconnects the connection.
|
|
65
|
+
* The singleton connection should persist across navigation.
|
|
66
|
+
* Use disconnect() explicitly if you need to close the connection.
|
|
67
|
+
*/
|
|
68
|
+
removeContext(context: "builder" | "sign"): void;
|
|
69
|
+
/**
|
|
70
|
+
* Update connection configuration (e.g., when token changes)
|
|
71
|
+
*/
|
|
72
|
+
updateConnection(config: Partial<ConnectionConfig>): void;
|
|
73
|
+
}
|
|
74
|
+
export declare const getWebSocketManager: () => WebSocketManager;
|
|
75
|
+
export type { ConnectionConfig };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { default as Pusher } from 'pusher-js';
|
|
2
|
+
type State = {
|
|
3
|
+
pusher: Pusher | null;
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated connections array is no longer used with singleton pattern.
|
|
6
|
+
* Kept for backwards compatibility but will always be empty.
|
|
7
|
+
*/
|
|
8
|
+
connections: Pusher[];
|
|
9
|
+
};
|
|
10
|
+
type Actions = {
|
|
11
|
+
setPusher: (pusher: Pusher | null) => void;
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated setConnections is no longer needed with singleton pattern.
|
|
14
|
+
* Kept for backwards compatibility but is a no-op.
|
|
15
|
+
*/
|
|
16
|
+
setConnections: (connections: Pusher[]) => void;
|
|
17
|
+
};
|
|
18
|
+
export type WebSocketsStore = State & Actions;
|
|
19
|
+
export declare const useWebSocketStore: import('zustand').UseBoundStore<import('zustand').StoreApi<WebSocketsStore>>;
|
|
20
|
+
export {};
|