-
Notifications
You must be signed in to change notification settings - Fork 182
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
f56df8d
commit a41c296
Showing
21 changed files
with
113 additions
and
64 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
13 changes: 11 additions & 2 deletions
13
cypress/projects/vite/FrameComponent.jsx → cypress/projects/vite/FrameComponent.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 |
---|---|---|
@@ -1,13 +1,22 @@ | ||
import type { ReactNode } from 'react'; | ||
import type { Theme } from './themes'; | ||
|
||
const parent = { | ||
border: '1px solid currentColor', | ||
padding: '10px 10px 10px 15px', | ||
}; | ||
|
||
const FrameComponent = ({ theme, children }) => ( | ||
const FrameComponent = ({ | ||
theme, | ||
children, | ||
}: { | ||
theme: Theme; | ||
children: ReactNode; | ||
}) => ( | ||
<div> | ||
FrameComponent (theme: "{theme.name}") | ||
{children ? <div style={parent}>{children}</div> : null} | ||
</div> | ||
); | ||
|
||
export default FrameComponent | ||
export default FrameComponent; |
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 |
---|---|---|
@@ -1,2 +1,6 @@ | ||
export const themeOne = { name: 'one' }; | ||
export const themeTwo = { name: 'two' }; | ||
export type Theme = { | ||
name: string; | ||
}; | ||
|
||
export const themeOne = { name: 'one' } satisfies Theme; | ||
export const themeTwo = { name: 'two' } satisfies Theme; |
File renamed without changes.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// file with types that are not meant to be exposed as part of the public API | ||
|
||
import type { PlayroomConfig } from './types'; | ||
|
||
export interface InternalPlayroomConfig extends PlayroomConfig { | ||
cwd: string; | ||
storageKey: string; | ||
port: number; | ||
openBrowser: boolean; | ||
} | ||
|
||
declare global { | ||
declare const __PLAYROOM_GLOBAL__CONFIG__: InternalPlayroomConfig; | ||
declare const __PLAYROOM_GLOBAL__STATIC_TYPES__: any; | ||
|
||
interface Window { | ||
__playroomConfig__: InternalPlayroomConfig; | ||
} | ||
} | ||
|
||
export interface InternalPlayroomConfig extends PlayroomConfig { | ||
cwd: string; | ||
storageKey: string; | ||
port: number; | ||
openBrowser: boolean; | ||
} | ||
|
||
export interface FrameParams { | ||
code: string; | ||
themeName: string; | ||
} | ||
|
||
export type FrameSrcHandler = ( | ||
frameParams: FrameParams, | ||
config: InternalPlayroomConfig | ||
) => string; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,12 @@ | ||
type AcceptHandler = (relativePath: string, handler: () => void) => void; | ||
|
||
export function hmrAccept(handler: (accept: AcceptHandler) => void) { | ||
// @ts-ignore | ||
const viteAccept = import.meta.hot?.accept; | ||
|
||
if ( | ||
typeof module !== 'undefined' && | ||
// @ts-ignore | ||
typeof module?.hot?.accept === 'function' | ||
) { | ||
// @ts-ignore | ||
handler(module.hot.accept); | ||
} else if (typeof viteAccept === 'function') { | ||
handler(viteAccept); | ||
} else if (typeof import.meta.hot?.accept === 'function') { | ||
handler(import.meta.hot?.accept); | ||
} | ||
} |
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,2 @@ | ||
/* eslint-disable spaced-comment */ | ||
/// <reference types="vite/client" /> |