-
Notifications
You must be signed in to change notification settings - Fork 388
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ENG-1315] Generated Snippets in non-SDK languages in API portal (#310)
* save * cleanup * refactor * export prism languages * fix layered border * TODO: add tailwind * remove unused css file * add tailwindcss * stop jumpy effect on execute output * remove unused imports * support dark class in tailwind * stop from tailwind styled components from flashing white * reuse generateMantineThemeColors * integrate headless ui for tabs * fix some styles * TODO: configure brand coloring in tailwind * brand colors from tailwind * polish * polish * make request/response sticky only * make code font size smaller * polish * yarn add httpsnippet * TODO: ensure curl output is correct * fix SSR warning * fix styling in light mode * support security requirements in curl * TODO: fixed nested values * use version 18 * remove unexpected input * fix nested values not being pruned * responsive text size for generated code * masked security * match radius * fix deeply nested values from having empty properties * add content-type to curl generation * 10x faster * form data working * remove empty values in requestBodyValue * clearing file input actually removes file * replace prism copy button with custom copy button * fix bug where going to curl tab modifies form values * stylle operation request * remove console.log * fix typescript generation * add c# + java * all language support * add padding to RHS of last language * fix padding * polish styling * only text-sm for code * hideNonSdkSnippets * docs(changeset): add hideNonSdkSnippets configuration to API portal --------- Co-authored-by: konfig-bot <[email protected]>
- Loading branch information
dphuang2
and
konfig-bot
authored
Oct 30, 2023
1 parent
787daba
commit ce10a4a
Showing
44 changed files
with
1,911 additions
and
477 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
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,5 @@ | ||
--- | ||
'konfig-lib': minor | ||
--- | ||
|
||
add hideNonSdkSnippets configuration to API portal |
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
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 |
---|---|---|
|
@@ -11,6 +11,7 @@ module.exports = { | |
'ts-jest', | ||
{ | ||
tsconfig: './tsconfig.jest.json', | ||
isolatedModules: true, | ||
}, | ||
], | ||
}, | ||
|
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
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,6 @@ | ||
module.exports = { | ||
plugins: { | ||
tailwindcss: {}, | ||
autoprefixer: {}, | ||
}, | ||
} |
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,8 @@ | ||
import { linkColor } from '@/utils/link-color' | ||
import { useMantineTheme } from '@mantine/core' | ||
import { IconCode } from '@tabler/icons-react' | ||
|
||
export function CodeIcon() { | ||
const theme = useMantineTheme() | ||
return <IconCode stroke={1.5} size="1.3rem" color={linkColor({ theme })} /> | ||
} |
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,77 @@ | ||
import { CopyButton as MantineCopyButton, clsx } from '@mantine/core' | ||
import { notifications } from '@mantine/notifications' | ||
import { CodeIcon } from './CodeIcon' | ||
export function CopyButton({ value }: { value: string }) { | ||
return ( | ||
<MantineCopyButton value={value}> | ||
{({ copied, copy }) => ( | ||
<button | ||
onClick={() => { | ||
copy() | ||
notifications.show({ | ||
id: 'code-copied-to-your-clipboard', | ||
radius: 'md', | ||
withBorder: true, | ||
styles: { | ||
body: { | ||
fontWeight: 500, | ||
}, | ||
icon: { | ||
backgroundColor: 'transparent', | ||
}, | ||
}, | ||
message: 'Code copied to your clipboard', | ||
icon: <CodeIcon />, | ||
}) | ||
}} | ||
type="button" | ||
className={clsx( | ||
'group/button absolute right-4 top-3.5 overflow-hidden rounded-full py-1 pl-2 pr-3 text-xs font-medium opacity-0 backdrop-blur transition focus:opacity-100 group-hover:opacity-100 outline-brand-500 dark:outline-brand-700', | ||
{ | ||
['bg-white/5 hover:bg-white/7.5 dark:bg-white/2.5 shadow dark:shadow-none dark:hover:bg-white/5']: | ||
!copied, | ||
['bg-brand-600/20 ring-1 ring-inset dark:ring-brand-400/20 ring-brand-600/40']: | ||
copied, | ||
} | ||
)} | ||
> | ||
<span | ||
aria-hidden={!copied ? 'false' : 'true'} | ||
className={clsx( | ||
'pointer-events-none flex items-center gap-0.5 dark:text-zinc-400 text-zinc-500 transition duration-300', | ||
{ ['-translate-y-1.5 opacity-0']: copied } | ||
)} | ||
> | ||
<svg | ||
viewBox="0 0 20 20" | ||
aria-hidden="true" | ||
className="h-5 w-5 fill-zinc-500/20 stroke-zinc-500 transition-colors group-hover/button:stroke-zinc-700 dark:group-hover/button:stroke-zinc-400" | ||
> | ||
<path | ||
strokeWidth="0" | ||
d="M5.5 13.5v-5a2 2 0 0 1 2-2l.447-.894A2 2 0 0 1 9.737 4.5h.527a2 2 0 0 1 1.789 1.106l.447.894a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-5a2 2 0 0 1-2-2Z" | ||
></path> | ||
<path | ||
fill="none" | ||
strokeLinejoin="round" | ||
d="M12.5 6.5a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-5a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2m5 0-.447-.894a2 2 0 0 0-1.79-1.106h-.527a2 2 0 0 0-1.789 1.106L7.5 6.5m5 0-1 1h-3l-1-1" | ||
></path> | ||
</svg> | ||
Copy | ||
</span> | ||
<span | ||
aria-hidden={!copied ? 'true' : 'false'} | ||
className={clsx( | ||
'pointer-events-none absolute inset-0 flex items-center justify-center text-brand-800 dark:text-brand-400 transition duration-300', | ||
{ | ||
['translate-y-1.5 opacity-0']: !copied, | ||
} | ||
)} | ||
> | ||
Copied! | ||
</span> | ||
</button> | ||
)} | ||
</MantineCopyButton> | ||
) | ||
} |
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
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
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
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
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
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
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
Oops, something went wrong.