Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions packages/angular/src/direct-template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ export type EmbedDirectTemplateProps = {
name?: string | undefined;
lockName?: boolean | undefined;

/**
* Whether to show the "Download PDF" action. Defaults to `true`.
*
* This only hides the button, it does not prevent the recipient from downloading
* the document.
*/
allowDownloadPDF?: boolean | undefined;

// Additional props to be passed to the iframe, used for testing out features
// prior to being added to the main props
additionalProps?: Record<string, string | number | boolean> | undefined;
Expand All @@ -32,6 +40,7 @@ export type EmbedDirectTemplateProps = {
onFieldSigned?: () => void;
onFieldUnsigned?: () => void;
};
const defaultProps: any = { allowDownloadPDF: true };

import { CssVars } from "./css-vars";

Expand Down Expand Up @@ -65,6 +74,8 @@ export default class EmbedDirectTemplate {
@Input() cssVars!: EmbedDirectTemplateProps["cssVars"];
@Input() darkModeDisabled!: EmbedDirectTemplateProps["darkModeDisabled"];
@Input() language!: EmbedDirectTemplateProps["language"];
@Input() allowDownloadPDF: EmbedDirectTemplateProps["allowDownloadPDF"] =
defaultProps["allowDownloadPDF"];
@Input() additionalProps!: EmbedDirectTemplateProps["additionalProps"];
@Input() token!: EmbedDirectTemplateProps["token"];
@Input() externalId!: EmbedDirectTemplateProps["externalId"];
Expand All @@ -91,6 +102,7 @@ export default class EmbedDirectTemplate {
cssVars: this.cssVars,
darkModeDisabled: this.darkModeDisabled,
language: this.language,
allowDownloadPDF: this.allowDownloadPDF,
...this.additionalProps,
})
)
Expand Down
12 changes: 12 additions & 0 deletions packages/angular/src/sign-document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ export type EmbedSignDocumentProps = {
lockEmail?: boolean | undefined;
allowDocumentRejection?: boolean | undefined;

/**
* Whether to show the "Download PDF" action. Defaults to `true`.
*
* This only hides the button, it does not prevent the recipient from downloading
* the document.
*/
allowDownloadPDF?: boolean | undefined;

// Additional props to be passed to the iframe, used for testing out features
// prior to being added to the main props
additionalProps?: Record<string, string | number | boolean> | undefined;
Expand All @@ -45,6 +53,7 @@ export type EmbedSignDocumentProps = {
reason: string;
}) => void;
};
const defaultProps: any = { allowDownloadPDF: true };

import { CssVars } from "./css-vars";

Expand Down Expand Up @@ -80,6 +89,8 @@ export default class EmbedSignDocument {
@Input() language!: EmbedSignDocumentProps["language"];
@Input()
allowDocumentRejection!: EmbedSignDocumentProps["allowDocumentRejection"];
@Input() allowDownloadPDF: EmbedSignDocumentProps["allowDownloadPDF"] =
defaultProps["allowDownloadPDF"];
@Input() additionalProps!: EmbedSignDocumentProps["additionalProps"];
@Input() token!: EmbedSignDocumentProps["token"];
@Input() clientUserId!: EmbedSignDocumentProps["clientUserId"];
Expand All @@ -105,6 +116,7 @@ export default class EmbedSignDocument {
darkModeDisabled: this.darkModeDisabled,
language: this.language,
allowDocumentRejection: this.allowDocumentRejection,
allowDownloadPDF: this.allowDownloadPDF,
...this.additionalProps,
})
)
Expand Down
17 changes: 16 additions & 1 deletion packages/mitosis/src/direct-template.lite.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { onMount, onUnMount, useRef, useStore } from '@builder.io/mitosis';
import { onMount, onUnMount, useDefaultProps, useRef, useStore } from '@builder.io/mitosis';

import { CssVars } from './css-vars';

Expand All @@ -20,6 +20,14 @@ export type EmbedDirectTemplateProps = {
name?: string | undefined;
lockName?: boolean | undefined;

/**
* Whether to show the "Download PDF" action. Defaults to `true`.
*
* This only hides the button, it does not prevent the recipient from downloading
* the document.
*/
allowDownloadPDF?: boolean | undefined;

// Additional props to be passed to the iframe, used for testing out features
// prior to being added to the main props
additionalProps?: Record<string, string | number | boolean> | undefined;
Expand All @@ -31,6 +39,12 @@ export type EmbedDirectTemplateProps = {
onFieldUnsigned?: () => void;
};

useDefaultProps<EmbedDirectTemplateProps>({
// Vue casts absent boolean props to `false`, which would hide the download
// button for anyone not passing the prop, so the default has to be explicit.
allowDownloadPDF: true,
});

export default function EmbedDirectTemplate(props: EmbedDirectTemplateProps) {
const __iframe = useRef<HTMLIFrameElement>(null);

Expand All @@ -50,6 +64,7 @@ export default function EmbedDirectTemplate(props: EmbedDirectTemplateProps) {
cssVars: props.cssVars,
darkModeDisabled: props.darkModeDisabled,
language: props.language,
allowDownloadPDF: props.allowDownloadPDF,
...props.additionalProps,
}),
),
Expand Down
17 changes: 16 additions & 1 deletion packages/mitosis/src/sign-document.lite.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { onMount, onUnMount, useRef, useStore } from '@builder.io/mitosis';
import { onMount, onUnMount, useDefaultProps, useRef, useStore } from '@builder.io/mitosis';

import { CssVars } from './css-vars';

Expand Down Expand Up @@ -29,6 +29,14 @@ export type EmbedSignDocumentProps = {
lockEmail?: boolean | undefined;
allowDocumentRejection?: boolean | undefined;

/**
* Whether to show the "Download PDF" action. Defaults to `true`.
*
* This only hides the button, it does not prevent the recipient from downloading
* the document.
*/
allowDownloadPDF?: boolean | undefined;

// Additional props to be passed to the iframe, used for testing out features
// prior to being added to the main props
additionalProps?: Record<string, string | number | boolean> | undefined;
Expand All @@ -44,6 +52,12 @@ export type EmbedSignDocumentProps = {
}) => void;
};

useDefaultProps<EmbedSignDocumentProps>({
// Vue casts absent boolean props to `false`, which would hide the download
// button for anyone not passing the prop, so the default has to be explicit.
allowDownloadPDF: true,
});

export default function EmbedSignDocument(props: EmbedSignDocumentProps) {
const __iframe = useRef<HTMLIFrameElement>(null);

Expand All @@ -64,6 +78,7 @@ export default function EmbedSignDocument(props: EmbedSignDocumentProps) {
darkModeDisabled: props.darkModeDisabled,
language: props.language,
allowDocumentRejection: props.allowDocumentRejection,
allowDownloadPDF: props.allowDownloadPDF,
...props.additionalProps,
}),
),
Expand Down
10 changes: 10 additions & 0 deletions packages/preact/src/direct-template.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ export type EmbedDirectTemplateProps = {
name?: string | undefined;
lockName?: boolean | undefined;

/**
* Whether to show the "Download PDF" action. Defaults to `true`.
*
* This only hides the button, it does not prevent the recipient from downloading
* the document.
*/
allowDownloadPDF?: boolean | undefined;

// Additional props to be passed to the iframe, used for testing out features
// prior to being added to the main props
additionalProps?: Record<string, string | number | boolean> | undefined;
Expand All @@ -34,6 +42,7 @@ export type EmbedDirectTemplateProps = {
import { CssVars } from "./css-vars";

function EmbedDirectTemplate(props: EmbedDirectTemplateProps) {
props = { allowDownloadPDF: true, ...props };
const __iframe = useRef<HTMLIFrameElement>(null);
function src() {
const appHost = props.host || "https://app.documenso.com";
Expand All @@ -48,6 +57,7 @@ function EmbedDirectTemplate(props: EmbedDirectTemplateProps) {
cssVars: props.cssVars,
darkModeDisabled: props.darkModeDisabled,
language: props.language,
allowDownloadPDF: props.allowDownloadPDF,
...props.additionalProps,
})
)
Expand Down
10 changes: 10 additions & 0 deletions packages/preact/src/sign-document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ export type EmbedSignDocumentProps = {
lockEmail?: boolean | undefined;
allowDocumentRejection?: boolean | undefined;

/**
* Whether to show the "Download PDF" action. Defaults to `true`.
*
* This only hides the button, it does not prevent the recipient from downloading
* the document.
*/
allowDownloadPDF?: boolean | undefined;

// Additional props to be passed to the iframe, used for testing out features
// prior to being added to the main props
additionalProps?: Record<string, string | number | boolean> | undefined;
Expand All @@ -47,6 +55,7 @@ export type EmbedSignDocumentProps = {
import { CssVars } from "./css-vars";

function EmbedSignDocument(props: EmbedSignDocumentProps) {
props = { allowDownloadPDF: true, ...props };
const __iframe = useRef<HTMLIFrameElement>(null);
function src() {
const appHost = props.host || "https://app.documenso.com";
Expand All @@ -62,6 +71,7 @@ function EmbedSignDocument(props: EmbedSignDocumentProps) {
darkModeDisabled: props.darkModeDisabled,
language: props.language,
allowDocumentRejection: props.allowDocumentRejection,
allowDownloadPDF: props.allowDownloadPDF,
...props.additionalProps,
})
)
Expand Down
10 changes: 10 additions & 0 deletions packages/react/src/direct-template.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ export type EmbedDirectTemplateProps = {
name?: string | undefined;
lockName?: boolean | undefined;

/**
* Whether to show the "Download PDF" action. Defaults to `true`.
*
* This only hides the button, it does not prevent the recipient from downloading
* the document.
*/
allowDownloadPDF?: boolean | undefined;

// Additional props to be passed to the iframe, used for testing out features
// prior to being added to the main props
additionalProps?: Record<string, string | number | boolean> | undefined;
Expand All @@ -34,6 +42,7 @@ export type EmbedDirectTemplateProps = {
import { CssVars } from "./css-vars";

function EmbedDirectTemplate(props: EmbedDirectTemplateProps) {
props = { allowDownloadPDF: true, ...props };
const __iframe = useRef<HTMLIFrameElement>(null);
function src() {
const appHost = props.host || "https://app.documenso.com";
Expand All @@ -48,6 +57,7 @@ function EmbedDirectTemplate(props: EmbedDirectTemplateProps) {
cssVars: props.cssVars,
darkModeDisabled: props.darkModeDisabled,
language: props.language,
allowDownloadPDF: props.allowDownloadPDF,
...props.additionalProps,
})
)
Expand Down
10 changes: 10 additions & 0 deletions packages/react/src/sign-document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ export type EmbedSignDocumentProps = {
lockEmail?: boolean | undefined;
allowDocumentRejection?: boolean | undefined;

/**
* Whether to show the "Download PDF" action. Defaults to `true`.
*
* This only hides the button, it does not prevent the recipient from downloading
* the document.
*/
allowDownloadPDF?: boolean | undefined;

// Additional props to be passed to the iframe, used for testing out features
// prior to being added to the main props
additionalProps?: Record<string, string | number | boolean> | undefined;
Expand All @@ -47,6 +55,7 @@ export type EmbedSignDocumentProps = {
import { CssVars } from "./css-vars";

function EmbedSignDocument(props: EmbedSignDocumentProps) {
props = { allowDownloadPDF: true, ...props };
const __iframe = useRef<HTMLIFrameElement>(null);
function src() {
const appHost = props.host || "https://app.documenso.com";
Expand All @@ -62,6 +71,7 @@ function EmbedSignDocument(props: EmbedSignDocumentProps) {
darkModeDisabled: props.darkModeDisabled,
language: props.language,
allowDocumentRejection: props.allowDocumentRejection,
allowDownloadPDF: props.allowDownloadPDF,
...props.additionalProps,
})
)
Expand Down
9 changes: 9 additions & 0 deletions packages/solid/src/direct-template.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ export type EmbedDirectTemplateProps = {
name?: string | undefined;
lockName?: boolean | undefined;

/**
* Whether to show the "Download PDF" action. Defaults to `true`.
*
* This only hides the button, it does not prevent the recipient from downloading
* the document.
*/
allowDownloadPDF?: boolean | undefined;

// Additional props to be passed to the iframe, used for testing out features
// prior to being added to the main props
additionalProps?: Record<string, string | number | boolean> | undefined;
Expand Down Expand Up @@ -46,6 +54,7 @@ function EmbedDirectTemplate(props: EmbedDirectTemplateProps) {
cssVars: props.cssVars,
darkModeDisabled: props.darkModeDisabled,
language: props.language,
allowDownloadPDF: props.allowDownloadPDF,
...props.additionalProps,
})
)
Expand Down
9 changes: 9 additions & 0 deletions packages/solid/src/sign-document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ export type EmbedSignDocumentProps = {
lockEmail?: boolean | undefined;
allowDocumentRejection?: boolean | undefined;

/**
* Whether to show the "Download PDF" action. Defaults to `true`.
*
* This only hides the button, it does not prevent the recipient from downloading
* the document.
*/
allowDownloadPDF?: boolean | undefined;

// Additional props to be passed to the iframe, used for testing out features
// prior to being added to the main props
additionalProps?: Record<string, string | number | boolean> | undefined;
Expand Down Expand Up @@ -60,6 +68,7 @@ function EmbedSignDocument(props: EmbedSignDocumentProps) {
darkModeDisabled: props.darkModeDisabled,
language: props.language,
allowDocumentRejection: props.allowDocumentRejection,
allowDownloadPDF: props.allowDownloadPDF,
...props.additionalProps,
})
)
Expand Down
11 changes: 11 additions & 0 deletions packages/svelte/src/direct-template.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@
name?: string | undefined;
lockName?: boolean | undefined;

/**
* Whether to show the "Download PDF" action. Defaults to `true`.
*
* This only hides the button, it does not prevent the recipient from downloading
* the document.
*/
allowDownloadPDF?: boolean | undefined;

// Additional props to be passed to the iframe, used for testing out features
// prior to being added to the main props
additionalProps?: Record<string, string | number | boolean> | undefined;
Expand Down Expand Up @@ -45,6 +53,8 @@
export let darkModeDisabled: EmbedDirectTemplateProps["darkModeDisabled"] =
undefined;
export let language: EmbedDirectTemplateProps["language"] = undefined;
export let allowDownloadPDF: EmbedDirectTemplateProps["allowDownloadPDF"] =
true;
export let additionalProps: EmbedDirectTemplateProps["additionalProps"] =
undefined;
export let token: EmbedDirectTemplateProps["token"];
Expand Down Expand Up @@ -95,6 +105,7 @@
cssVars: cssVars,
darkModeDisabled: darkModeDisabled,
language: language,
allowDownloadPDF: allowDownloadPDF,
...additionalProps,
})
)
Expand Down
11 changes: 11 additions & 0 deletions packages/svelte/src/sign-document.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@
lockEmail?: boolean | undefined;
allowDocumentRejection?: boolean | undefined;

/**
* Whether to show the "Download PDF" action. Defaults to `true`.
*
* This only hides the button, it does not prevent the recipient from downloading
* the document.
*/
allowDownloadPDF?: boolean | undefined;

// Additional props to be passed to the iframe, used for testing out features
// prior to being added to the main props
additionalProps?: Record<string, string | number | boolean> | undefined;
Expand Down Expand Up @@ -60,6 +68,8 @@
export let language: EmbedSignDocumentProps["language"] = undefined;
export let allowDocumentRejection: EmbedSignDocumentProps["allowDocumentRejection"] =
undefined;
export let allowDownloadPDF: EmbedSignDocumentProps["allowDownloadPDF"] =
true;
export let additionalProps: EmbedSignDocumentProps["additionalProps"] =
undefined;
export let token: EmbedSignDocumentProps["token"];
Expand Down Expand Up @@ -106,6 +116,7 @@
darkModeDisabled: darkModeDisabled,
language: language,
allowDocumentRejection: allowDocumentRejection,
allowDownloadPDF: allowDownloadPDF,
...additionalProps,
})
)
Expand Down
Loading
Loading