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
6 changes: 6 additions & 0 deletions packages/angular/src/create-envelope.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ export type EmbedCreateEnvelopeProps = {
host?: string;
presignToken: string;
externalId?: string;
user?: {
name?: string;
email?: string;
};
type: "DOCUMENT" | "TEMPLATE";
folderId?: string;
css?: string | undefined;
Expand Down Expand Up @@ -43,6 +47,7 @@ import type { DeepPartial, EnvelopeEditorSettings } from "./features-type";
export default class EmbedCreateEnvelope {
@Input() host!: EmbedCreateEnvelopeProps["host"];
@Input() externalId!: EmbedCreateEnvelopeProps["externalId"];
@Input() user!: EmbedCreateEnvelopeProps["user"];
@Input() type!: EmbedCreateEnvelopeProps["type"];
Comment thread
dguyen marked this conversation as resolved.
@Input() folderId!: EmbedCreateEnvelopeProps["folderId"];
@Input() features!: EmbedCreateEnvelopeProps["features"];
Expand All @@ -62,6 +67,7 @@ export default class EmbedCreateEnvelope {
encodeURIComponent(
JSON.stringify({
externalId: this.externalId,
user: this.user,
type: this.type,
folderId: this.folderId,
features: this.features,
Expand Down
6 changes: 6 additions & 0 deletions packages/angular/src/update-envelope.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ export type EmbedUpdateEnvelopeProps = {
host?: string;
presignToken: string;
externalId?: string;
user?: {
name?: string;
email?: string;
};
envelopeId: string;
css?: string | undefined;
cssVars?: (CssVars & Record<string, string>) | undefined;
Expand Down Expand Up @@ -42,6 +46,7 @@ import type { DeepPartial, EnvelopeEditorSettings } from "./features-type";
export default class EmbedUpdateEnvelope {
@Input() host!: EmbedUpdateEnvelopeProps["host"];
@Input() externalId!: EmbedUpdateEnvelopeProps["externalId"];
@Input() user!: EmbedUpdateEnvelopeProps["user"];
@Input() features!: EmbedUpdateEnvelopeProps["features"];
@Input() css!: EmbedUpdateEnvelopeProps["css"];
Comment thread
dguyen marked this conversation as resolved.
@Input() cssVars!: EmbedUpdateEnvelopeProps["cssVars"];
Expand All @@ -60,6 +65,7 @@ export default class EmbedUpdateEnvelope {
encodeURIComponent(
JSON.stringify({
externalId: this.externalId,
user: this.user,
features: this.features,
css: this.css,
cssVars: this.cssVars,
Expand Down
5 changes: 5 additions & 0 deletions packages/mitosis/src/create-envelope.lite.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ export type EmbedCreateEnvelopeProps = {
host?: string;
presignToken: string;
externalId?: string;
user?: {
name?: string;
email?: string;
};

type: 'DOCUMENT' | 'TEMPLATE';
folderId?: string;
Expand Down Expand Up @@ -35,6 +39,7 @@ export default function EmbedCreateEnvelope(props: EmbedCreateEnvelopeProps) {
encodeURIComponent(
JSON.stringify({
externalId: props.externalId,
user: props.user,
type: props.type,
folderId: props.folderId,
features: props.features,
Expand Down
5 changes: 5 additions & 0 deletions packages/mitosis/src/update-envelope.lite.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ export type EmbedUpdateEnvelopeProps = {
host?: string;
presignToken: string;
externalId?: string;
user?: {
name?: string;
email?: string;
};

envelopeId: string;

Expand All @@ -34,6 +38,7 @@ export default function EmbedUpdateEnvelope(props: EmbedUpdateEnvelopeProps) {
encodeURIComponent(
JSON.stringify({
externalId: props.externalId,
user: props.user,
features: props.features,
css: props.css,
cssVars: props.cssVars,
Expand Down
5 changes: 5 additions & 0 deletions packages/preact/src/create-envelope.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ export type EmbedCreateEnvelopeProps = {
host?: string;
presignToken: string;
externalId?: string;
user?: {
name?: string;
email?: string;
};
type: "DOCUMENT" | "TEMPLATE";
folderId?: string;
css?: string | undefined;
Expand All @@ -31,6 +35,7 @@ function EmbedCreateEnvelope(props: EmbedCreateEnvelopeProps) {
encodeURIComponent(
JSON.stringify({
externalId: props.externalId,
user: props.user,
type: props.type,
folderId: props.folderId,
features: props.features,
Expand Down
5 changes: 5 additions & 0 deletions packages/preact/src/update-envelope.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ export type EmbedUpdateEnvelopeProps = {
host?: string;
presignToken: string;
externalId?: string;
user?: {
name?: string;
email?: string;
};
envelopeId: string;
css?: string | undefined;
cssVars?: (CssVars & Record<string, string>) | undefined;
Expand All @@ -30,6 +34,7 @@ function EmbedUpdateEnvelope(props: EmbedUpdateEnvelopeProps) {
encodeURIComponent(
JSON.stringify({
externalId: props.externalId,
user: props.user,
features: props.features,
css: props.css,
cssVars: props.cssVars,
Expand Down
5 changes: 5 additions & 0 deletions packages/react/src/create-envelope.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ export type EmbedCreateEnvelopeProps = {
host?: string;
presignToken: string;
externalId?: string;
user?: {
name?: string;
email?: string;
};
type: "DOCUMENT" | "TEMPLATE";
folderId?: string;
css?: string | undefined;
Expand All @@ -31,6 +35,7 @@ function EmbedCreateEnvelope(props: EmbedCreateEnvelopeProps) {
encodeURIComponent(
JSON.stringify({
externalId: props.externalId,
user: props.user,
type: props.type,
folderId: props.folderId,
features: props.features,
Expand Down
5 changes: 5 additions & 0 deletions packages/react/src/update-envelope.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ export type EmbedUpdateEnvelopeProps = {
host?: string;
presignToken: string;
externalId?: string;
user?: {
name?: string;
email?: string;
};
envelopeId: string;
css?: string | undefined;
cssVars?: (CssVars & Record<string, string>) | undefined;
Expand All @@ -30,6 +34,7 @@ function EmbedUpdateEnvelope(props: EmbedUpdateEnvelopeProps) {
encodeURIComponent(
JSON.stringify({
externalId: props.externalId,
user: props.user,
features: props.features,
css: props.css,
cssVars: props.cssVars,
Expand Down
5 changes: 5 additions & 0 deletions packages/solid/src/create-envelope.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ export type EmbedCreateEnvelopeProps = {
host?: string;
presignToken: string;
externalId?: string;
user?: {
name?: string;
email?: string;
};
type: "DOCUMENT" | "TEMPLATE";
folderId?: string;
css?: string | undefined;
Expand All @@ -29,6 +33,7 @@ function EmbedCreateEnvelope(props: EmbedCreateEnvelopeProps) {
encodeURIComponent(
JSON.stringify({
externalId: props.externalId,
user: props.user,
type: props.type,
folderId: props.folderId,
features: props.features,
Expand Down
5 changes: 5 additions & 0 deletions packages/solid/src/update-envelope.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ export type EmbedUpdateEnvelopeProps = {
host?: string;
presignToken: string;
externalId?: string;
user?: {
name?: string;
email?: string;
};
envelopeId: string;
css?: string | undefined;
cssVars?: (CssVars & Record<string, string>) | undefined;
Expand All @@ -28,6 +32,7 @@ function EmbedUpdateEnvelope(props: EmbedUpdateEnvelopeProps) {
encodeURIComponent(
JSON.stringify({
externalId: props.externalId,
user: props.user,
features: props.features,
css: props.css,
cssVars: props.cssVars,
Expand Down
6 changes: 6 additions & 0 deletions packages/svelte/src/create-envelope.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
host?: string;
presignToken: string;
externalId?: string;
user?: {
name?: string;
email?: string;
};
type: "DOCUMENT" | "TEMPLATE";
folderId?: string;
css?: string | undefined;
Expand All @@ -27,6 +31,7 @@

export let host: EmbedCreateEnvelopeProps["host"] = undefined;
export let externalId: EmbedCreateEnvelopeProps["externalId"] = undefined;
export let user: EmbedCreateEnvelopeProps["user"] = undefined;
export let type: EmbedCreateEnvelopeProps["type"];
export let folderId: EmbedCreateEnvelopeProps["folderId"] = undefined;
export let features: EmbedCreateEnvelopeProps["features"] = undefined;
Expand Down Expand Up @@ -58,6 +63,7 @@
encodeURIComponent(
JSON.stringify({
externalId: externalId,
user: user,
type: type,
folderId: folderId,
features: features,
Expand Down
6 changes: 6 additions & 0 deletions packages/svelte/src/update-envelope.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
host?: string;
presignToken: string;
externalId?: string;
user?: {
name?: string;
email?: string;
};
envelopeId: string;
css?: string | undefined;
cssVars?: (CssVars & Record<string, string>) | undefined;
Expand All @@ -26,6 +30,7 @@

export let host: EmbedUpdateEnvelopeProps["host"] = undefined;
export let externalId: EmbedUpdateEnvelopeProps["externalId"] = undefined;
export let user: EmbedUpdateEnvelopeProps["user"] = undefined;
export let features: EmbedUpdateEnvelopeProps["features"] = undefined;
export let css: EmbedUpdateEnvelopeProps["css"] = undefined;
export let cssVars: EmbedUpdateEnvelopeProps["cssVars"] = undefined;
Expand Down Expand Up @@ -56,6 +61,7 @@
encodeURIComponent(
JSON.stringify({
externalId: externalId,
user: user,
features: features,
css: css,
cssVars: cssVars,
Expand Down
5 changes: 5 additions & 0 deletions packages/vue/src/create-envelope.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ export type EmbedCreateEnvelopeProps = {
host?: string;
presignToken: string;
externalId?: string;
user?: {
name?: string;
email?: string;
};
type: "DOCUMENT" | "TEMPLATE";
folderId?: string;
css?: string | undefined;
Expand Down Expand Up @@ -43,6 +47,7 @@ const src = computed(() => {
encodeURIComponent(
JSON.stringify({
externalId: props.externalId,
user: props.user,
type: props.type,
folderId: props.folderId,
features: props.features,
Expand Down
5 changes: 5 additions & 0 deletions packages/vue/src/update-envelope.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ export type EmbedUpdateEnvelopeProps = {
host?: string;
presignToken: string;
externalId?: string;
user?: {
name?: string;
email?: string;
};
envelopeId: string;
css?: string | undefined;
cssVars?: (CssVars & Record<string, string>) | undefined;
Expand Down Expand Up @@ -42,6 +46,7 @@ const src = computed(() => {
encodeURIComponent(
JSON.stringify({
externalId: props.externalId,
user: props.user,
features: props.features,
css: props.css,
cssVars: props.cssVars,
Expand Down
54 changes: 54 additions & 0 deletions playground/src/components/embeddings/create-envelope.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ const formSchema = z
apiKey: z.string().optional(),
presignToken: z.string().optional(),
externalId: z.string().optional(),
user: z
.object({
name: z.string().optional(),
email: z.string().email().optional(),
})
.optional(),
type: z.enum(['DOCUMENT', 'TEMPLATE']),
folderId: z.string().optional(),
features: EnvelopeFeaturesSchema,
Expand Down Expand Up @@ -72,6 +78,10 @@ export default function CreateEnvelopeEmbedding() {
apiKey: '',
presignToken: '',
externalId: '',
user: {
name: '',
email: undefined,
},
folderId: '',
type: 'DOCUMENT',
features: DEFAULT_ENVELOPE_FEATURES,
Expand Down Expand Up @@ -337,6 +347,42 @@ export default function CreateEnvelopeEmbedding() {
)}
/>

<div className="grid grid-cols-1 gap-4 sm:grid-cols-2">
<FormField
control={form.control}
name="user.email"
render={({ field }) => (
<FormItem>
<FormLabel>User Email (Optional)</FormLabel>
<FormControl>
<Input
type="email"
placeholder="Enter user email..."
className="font-mono text-sm"
{...field}
/>
</FormControl>
<FormDescription>Email address to prefill for the user</FormDescription>
<FormMessage />
</FormItem>
)}
/>

<FormField
control={form.control}
name="user.name"
render={({ field }) => (
<FormItem>
<FormLabel>User Name (Optional)</FormLabel>
<FormControl>
<Input placeholder="Enter user name..." {...field} />
</FormControl>
<FormDescription>Name to prefill for the user</FormDescription>
<FormMessage />
</FormItem>
)}
/>
</div>
<Separator />

{error && (
Expand Down Expand Up @@ -375,6 +421,14 @@ export default function CreateEnvelopeEmbedding() {
host={host}
presignToken={embedConfig.presignToken}
externalId={embedConfig.externalId}
user={
embedConfig.user?.email || embedConfig.user?.name
? {
email: embedConfig.user.email || undefined,
name: embedConfig.user.name || undefined,
}
: undefined
}
Comment on lines +424 to +431
folderId={embedConfig.folderId || undefined}
type={embedConfig.type}
features={embedConfig.features}
Expand Down
Loading
Loading