-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
98107ee
commit 8283179
Showing
8 changed files
with
199 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
apps/builder/src/features/publish/components/embeds/logos/FramerLogo.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Icon, IconProps } from '@chakra-ui/react' | ||
|
||
export const FramerLogo = (props: IconProps) => ( | ||
<Icon | ||
fill="#000000" | ||
viewBox="0 0 24 24" | ||
xmlns="http://www.w3.org/2000/svg" | ||
{...props} | ||
> | ||
<path d="M4 0h16v8h-8zM4 8h8l8 8H4zM4 16h8v8z" /> | ||
</Icon> | ||
) |
26 changes: 26 additions & 0 deletions
26
apps/builder/src/features/publish/components/embeds/modals/FramerModal/FramerModal.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import React, { useState } from 'react' | ||
import { ModalProps } from '../../EmbedButton' | ||
import { EmbedModal } from '../../EmbedModal' | ||
import { isDefined } from '@udecode/plate-common' | ||
import { FramerInstructions } from './instructions/FramerInstructions' | ||
|
||
export const FramerModal = ({ isOpen, onClose, isPublished }: ModalProps) => { | ||
const [selectedEmbedType, setSelectedEmbedType] = useState< | ||
'standard' | 'popup' | 'bubble' | undefined | ||
>() | ||
|
||
return ( | ||
<EmbedModal | ||
titlePrefix="Framer" | ||
isOpen={isOpen} | ||
onClose={onClose} | ||
isPublished={isPublished} | ||
onSelectEmbedType={setSelectedEmbedType} | ||
selectedEmbedType={selectedEmbedType} | ||
> | ||
{isDefined(selectedEmbedType) && ( | ||
<FramerInstructions type={selectedEmbedType} /> | ||
)} | ||
</EmbedModal> | ||
) | ||
} |
1 change: 1 addition & 0 deletions
1
apps/builder/src/features/publish/components/embeds/modals/FramerModal/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './FramerModal' |
63 changes: 63 additions & 0 deletions
63
...es/publish/components/embeds/modals/FramerModal/instructions/FramerBubbleInstructions.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import { useTypebot } from '@/features/editor/providers/TypebotProvider' | ||
import { OrderedList, ListItem, Code, Stack, Text } from '@chakra-ui/react' | ||
import { BubbleProps } from '@typebot.io/nextjs' | ||
import { useState } from 'react' | ||
import { BubbleSettings } from '../../../settings/BubbleSettings/BubbleSettings' | ||
import { parseDefaultBubbleTheme } from '../../Javascript/instructions/JavascriptBubbleInstructions' | ||
import { JavascriptBubbleSnippet } from '../../Javascript/JavascriptBubbleSnippet' | ||
import { TextLink } from '@/components/TextLink' | ||
|
||
export const FramerBubbleInstructions = () => { | ||
const { typebot } = useTypebot() | ||
|
||
const [theme, setTheme] = useState<BubbleProps['theme']>( | ||
parseDefaultBubbleTheme(typebot) | ||
) | ||
const [previewMessage, setPreviewMessage] = | ||
useState<BubbleProps['previewMessage']>() | ||
|
||
return ( | ||
<> | ||
<OrderedList spacing={4} pl={5}> | ||
<ListItem> | ||
Head over to the <Code>Site Settings</Code> {'>'} <Code>General</Code>{' '} | ||
{'>'} <Code>Custom Code</Code> section | ||
</ListItem> | ||
<ListItem> | ||
<Stack spacing={4}> | ||
<BubbleSettings | ||
previewMessage={previewMessage} | ||
defaultPreviewMessageAvatar={ | ||
typebot?.theme.chat?.hostAvatar?.url ?? '' | ||
} | ||
theme={theme} | ||
onPreviewMessageChange={setPreviewMessage} | ||
onThemeChange={setTheme} | ||
/> | ||
<Text> | ||
Paste this in the{' '} | ||
<Code> | ||
End of {'<'}body{'>'} tag | ||
</Code>{' '} | ||
input: | ||
</Text> | ||
<JavascriptBubbleSnippet | ||
theme={theme} | ||
previewMessage={previewMessage} | ||
/> | ||
</Stack> | ||
</ListItem> | ||
</OrderedList> | ||
<Text fontSize="sm" colorScheme="gray" pl="5"> | ||
Check out the{' '} | ||
<TextLink | ||
href="https://www.framer.com/academy/lessons/custom-code" | ||
isExternal | ||
> | ||
Custom Code Framer doc | ||
</TextLink>{' '} | ||
for more information. | ||
</Text> | ||
</> | ||
) | ||
} |
21 changes: 21 additions & 0 deletions
21
...features/publish/components/embeds/modals/FramerModal/instructions/FramerInstructions.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { FramerBubbleInstructions } from './FramerBubbleInstructions' | ||
import { FramerPopupInstructions } from './FramerPopupInstructions' | ||
import { FramerStandardInstructions } from './FramerStandardInstructions' | ||
|
||
type Props = { | ||
type: 'standard' | 'popup' | 'bubble' | ||
} | ||
|
||
export const FramerInstructions = ({ type }: Props) => { | ||
switch (type) { | ||
case 'standard': { | ||
return <FramerStandardInstructions /> | ||
} | ||
case 'popup': { | ||
return <FramerPopupInstructions /> | ||
} | ||
case 'bubble': { | ||
return <FramerBubbleInstructions /> | ||
} | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
...res/publish/components/embeds/modals/FramerModal/instructions/FramerPopupInstructions.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { OrderedList, ListItem, Code, Stack, Text } from '@chakra-ui/react' | ||
import { useState } from 'react' | ||
import { PopupSettings } from '../../../settings/PopupSettings' | ||
import { JavascriptPopupSnippet } from '../../Javascript/JavascriptPopupSnippet' | ||
import { TextLink } from '@/components/TextLink' | ||
|
||
export const FramerPopupInstructions = () => { | ||
const [inputValue, setInputValue] = useState<number>() | ||
|
||
return ( | ||
<> | ||
<OrderedList spacing={4} pl={5}> | ||
<ListItem> | ||
Head over to the <Code>Site Settings</Code> {'>'} <Code>General</Code>{' '} | ||
{'>'} <Code>Custom Code</Code> section | ||
</ListItem> | ||
<ListItem> | ||
<Stack spacing={4}> | ||
<PopupSettings | ||
onUpdateSettings={(settings) => | ||
setInputValue(settings.autoShowDelay) | ||
} | ||
/> | ||
<Text> | ||
Paste this in the{' '} | ||
<Code> | ||
End of {'<'}body{'>'} tag | ||
</Code>{' '} | ||
input: | ||
</Text> | ||
<JavascriptPopupSnippet autoShowDelay={inputValue} /> | ||
</Stack> | ||
</ListItem> | ||
</OrderedList> | ||
<Text fontSize="sm" colorScheme="gray" pl="5"> | ||
Check out the{' '} | ||
<TextLink | ||
href="https://www.framer.com/academy/lessons/custom-code" | ||
isExternal | ||
> | ||
Custom Code Framer doc | ||
</TextLink>{' '} | ||
for more information. | ||
</Text> | ||
</> | ||
) | ||
} |
19 changes: 19 additions & 0 deletions
19
.../publish/components/embeds/modals/FramerModal/instructions/FramerStandardInstructions.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { OrderedList, ListItem, Code, Stack, Text } from '@chakra-ui/react' | ||
import { JavascriptStandardSnippet } from '../../Javascript/JavascriptStandardSnippet' | ||
|
||
export const FramerStandardInstructions = () => ( | ||
<OrderedList spacing={4} pl={5}> | ||
<ListItem> | ||
Press <Code>A</Code> to open the <Code>Add elements</Code> panel | ||
</ListItem> | ||
<ListItem> | ||
<Stack spacing={4}> | ||
<Text> | ||
Add an <Code>Embed</Code> element from the <Code>components</Code>{' '} | ||
section and paste this code: | ||
</Text> | ||
<JavascriptStandardSnippet /> | ||
</Stack> | ||
</ListItem> | ||
</OrderedList> | ||
) |
8283179
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
builder-v2 – ./apps/builder
builder-v2-git-main-typebot-io.vercel.app
builder-v2-typebot-io.vercel.app
app.typebot.io