-
Notifications
You must be signed in to change notification settings - Fork 30
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
99631fa
commit 8de7e88
Showing
48 changed files
with
712 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
// @see https://github.com/mui-org/material-ui/blob/master/examples/nextjs/src/Link.js | ||
// /* eslint-disable jsx-a11y/anchor-has-content */ | ||
import React, { Ref } from "react"; | ||
import PropTypes from "prop-types"; | ||
import clsx from "clsx"; | ||
import { useRouter } from "next/router"; | ||
import NextLink, { LinkProps as NextLinkProps } from "next/link"; | ||
import MuiLink, { LinkProps as MuiLinkProps } from "@material-ui/core/Link"; | ||
|
||
type LinkProps = NextLinkProps & | ||
MuiLinkProps & { | ||
activeClassName?: string; | ||
naked?: boolean; | ||
}; | ||
|
||
const NextComposed = React.forwardRef(function NextComposed( | ||
props: LinkProps, | ||
ref: Ref<HTMLAnchorElement> | ||
) { | ||
const { as, href, ...other } = props; | ||
|
||
return ( | ||
<NextLink href={href} as={as}> | ||
<a ref={ref} {...other} /> | ||
</NextLink> | ||
); | ||
}); | ||
|
||
NextComposed.propTypes = { | ||
as: PropTypes.oneOfType([PropTypes.string, PropTypes.object]), | ||
// href: PropTypes.oneOfType([PropTypes.string, PropTypes.object]), // FIXME: provokes a TS error | ||
prefetch: PropTypes.bool, | ||
}; | ||
|
||
// A styled version of the Next.js Link component: | ||
// https://nextjs.org/docs/#with-link | ||
function Link(props: LinkProps) { | ||
const { | ||
href, | ||
activeClassName = "active", | ||
className: classNameProps, | ||
innerRef, | ||
naked, | ||
...other | ||
} = props; | ||
|
||
const router = useRouter(); | ||
const pathname = typeof href === "string" ? href : href.pathname; | ||
const className = clsx(classNameProps, { | ||
[activeClassName]: router.pathname === pathname && activeClassName, | ||
}); | ||
|
||
if (naked) { | ||
return ( | ||
<NextComposed | ||
className={className} | ||
ref={innerRef} | ||
href={href} | ||
{...other} | ||
/> | ||
); | ||
} | ||
|
||
return ( | ||
<MuiLink | ||
component={NextComposed} | ||
className={className} | ||
ref={innerRef} | ||
href={href} | ||
{...other} | ||
/> | ||
); | ||
} | ||
|
||
Link.propTypes = { | ||
activeClassName: PropTypes.string, | ||
as: PropTypes.oneOfType([PropTypes.string, PropTypes.object]), | ||
className: PropTypes.string, | ||
href: PropTypes.oneOfType([PropTypes.string, PropTypes.object]), | ||
innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]), | ||
naked: PropTypes.bool, | ||
onClick: PropTypes.func, | ||
prefetch: PropTypes.bool, | ||
}; | ||
|
||
export default React.forwardRef((props: LinkProps, ref) => ( | ||
<Link {...props} innerRef={ref} /> | ||
)); |
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,9 @@ | ||
import React from "react"; | ||
import { LinkProps as NextLinkProps } from "next/link"; | ||
import { LinkProps as MuiLinkProps } from "@material-ui/core/Link"; | ||
declare type LinkProps = NextLinkProps & MuiLinkProps & { | ||
activeClassName?: string; | ||
naked?: boolean; | ||
}; | ||
declare const _default: React.ForwardRefExoticComponent<Pick<LinkProps, "dir" | "slot" | "style" | "title" | "className" | "classes" | "innerRef" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "noWrap" | "gutterBottom" | "paragraph" | "align" | "display" | "variant" | "variantMapping" | "download" | "href" | "hrefLang" | "media" | "ping" | "rel" | "target" | "type" | "referrerPolicy" | "as" | "replace" | "scroll" | "shallow" | "passHref" | "prefetch" | "TypographyClasses" | "underline" | "activeClassName" | "naked"> & React.RefAttributes<unknown>>; | ||
export default _default; |
2 changes: 2 additions & 0 deletions
2
packages/@vulcan/next-material-ui/dist/getMuiDocumentInitialProps.d.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,2 @@ | ||
import { AppSheetsCollector } from "@vulcan/next-style-collector"; | ||
export declare const getAppEnhancer: () => AppSheetsCollector; |
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,3 @@ | ||
export { default as useMuiApp } from "./useMuiApp"; | ||
export * from "./getMuiDocumentInitialProps"; | ||
export { default as Link } from "./components/Link"; |
Large diffs are not rendered by default.
Oops, something went wrong.
9 changes: 9 additions & 0 deletions
9
packages/@vulcan/next-material-ui/dist/next-material-ui/components/Link.d.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,9 @@ | ||
import React from "react"; | ||
import { LinkProps as NextLinkProps } from "next/link"; | ||
import { LinkProps as MuiLinkProps } from "@material-ui/core/Link"; | ||
declare type LinkProps = NextLinkProps & MuiLinkProps & { | ||
activeClassName?: string; | ||
naked?: boolean; | ||
}; | ||
declare const _default: React.ForwardRefExoticComponent<Pick<LinkProps, "dir" | "slot" | "style" | "title" | "className" | "classes" | "innerRef" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "noWrap" | "gutterBottom" | "paragraph" | "align" | "display" | "variant" | "variantMapping" | "download" | "href" | "hrefLang" | "media" | "ping" | "rel" | "target" | "type" | "referrerPolicy" | "as" | "replace" | "scroll" | "shallow" | "passHref" | "prefetch" | "TypographyClasses" | "underline" | "activeClassName" | "naked"> & React.RefAttributes<unknown>>; | ||
export default _default; |
2 changes: 2 additions & 0 deletions
2
packages/@vulcan/next-material-ui/dist/next-material-ui/getMuiDocumentInitialProps.d.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,2 @@ | ||
import { AppSheetsCollector } from "@vulcan/next-style-collector"; | ||
export declare const getAppEnhancer: () => AppSheetsCollector; |
3 changes: 3 additions & 0 deletions
3
packages/@vulcan/next-material-ui/dist/next-material-ui/index.d.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,3 @@ | ||
export { default as useMuiApp } from "./useMuiApp"; | ||
export * from "./getMuiDocumentInitialProps"; | ||
export { default as Link } from "./components/Link"; |
2 changes: 2 additions & 0 deletions
2
packages/@vulcan/next-material-ui/dist/next-material-ui/useMuiApp.d.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,2 @@ | ||
declare const useMuiApp: () => void; | ||
export default useMuiApp; |
7 changes: 7 additions & 0 deletions
7
packages/@vulcan/next-material-ui/dist/next-style-collector/index.d.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,7 @@ | ||
export interface AppSheetsCollector { | ||
sheets: { | ||
getStyleElement: Function; | ||
}; | ||
enhanceApp: Function; | ||
finally?: Function; | ||
} |
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 @@ | ||
declare const useMuiApp: () => void; | ||
export default useMuiApp; |
63 changes: 63 additions & 0 deletions
63
packages/@vulcan/next-material-ui/getMuiDocumentInitialProps.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 React from "react"; | ||
import { ServerStyleSheets } from "@material-ui/core/styles"; | ||
import { AppSheetsCollector } from "@vulcan/next-style-collector"; | ||
|
||
export const getAppEnhancer = (): AppSheetsCollector => { | ||
const sheets = new ServerStyleSheets(); | ||
const enhanceApp = (App) => (props) => sheets.collect(<App {...props} />); | ||
return { | ||
sheets, | ||
enhanceApp, | ||
}; | ||
}; | ||
|
||
// @see https://github.com/mui-org/material-ui/blob/master/examples/nextjs/pages/_document.js | ||
// This function do not generalize when you have another lib collecting stylesheets (eg Styled Components) | ||
/* | ||
const getMuiDocumentInitialProps = async (ctx: DocumentContext) => { | ||
// Resolution order | ||
// | ||
// On the server: | ||
// 1. app.getInitialProps | ||
// 2. page.getInitialProps | ||
// 3. document.getInitialProps | ||
// 4. app.render | ||
// 5. page.render | ||
// 6. document.render | ||
// | ||
// On the server with error: | ||
// 1. document.getInitialProps | ||
// 2. app.render | ||
// 3. page.render | ||
// 4. document.render | ||
// | ||
// On the client | ||
// 1. app.getInitialProps | ||
// 2. page.getInitialProps | ||
// 3. app.render | ||
// 4. page.render | ||
// Render app and page and get the context of the page with collected side effects. | ||
const sheets = new ServerStyleSheets(); | ||
const originalRenderPage = ctx.renderPage; | ||
ctx.renderPage = () => | ||
originalRenderPage({ | ||
enhanceApp: (App) => (props) => sheets.collect(<App {...props} />), | ||
}); | ||
// get parent props | ||
// NOTE: we need to have already enhanced ctx, so it has to be done here | ||
const initialProps = await Document.getInitialProps(ctx); | ||
return { | ||
// Styles fragment is rendered after the app and page rendering finish. | ||
...initialProps, | ||
styles: [ | ||
...React.Children.toArray(initialProps.styles), | ||
sheets.getStyleElement(), | ||
], | ||
}; | ||
}; | ||
export default getMuiDocumentInitialProps; | ||
*/ |
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 @@ | ||
export { default as useMuiApp } from "./useMuiApp"; | ||
|
||
export * from "./getMuiDocumentInitialProps"; | ||
|
||
export { default as Link } from "./components/Link"; |
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 @@ | ||
{ | ||
"name": "@vulcan/next-material-ui", | ||
"version": "0.0.1", | ||
"description": "Vulcan Next Material UI binding", | ||
"main": "./dist/index.js", | ||
"author": "eric-burel <[email protected]>", | ||
"homepage": "https://github.com/VulcanJS/vulcan-npm#readme", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/VulcanJS/vulcan-npm.git" | ||
}, | ||
"scripts": { | ||
"test": "echo \"Error: run tests from root\" && exit 1", | ||
"build": "webpack --config ./webpack.config.js" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/VulcanJS/vulcan-npm/issues" | ||
}, | ||
"dependencies": { | ||
"@material-ui/core": "^4.11.0", | ||
"clsx": "^1.1.1", | ||
"next": "^9.5.3", | ||
"react-dom": "^16.13.1" | ||
} | ||
} |
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 @@ | ||
{ | ||
"extends": "../../tsconfig.json", | ||
"compilerOptions": { | ||
"outDir": "./dist", | ||
"lib": ["es6", "dom"] | ||
}, | ||
"include": ["*.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,13 @@ | ||
// @see https://github.com/mui-org/material-ui/blob/master/examples/nextjs/pages/_app.js | ||
import { useEffect } from "react"; | ||
|
||
const useMuiApp = () => { | ||
useEffect(() => { | ||
// Remove the server-side injected CSS on each render | ||
const jssStyles = document.querySelector("#jss-server-side"); | ||
if (jssStyles) { | ||
jssStyles.parentElement.removeChild(jssStyles); | ||
} | ||
}, []); | ||
}; | ||
export default useMuiApp; |
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 @@ | ||
const merge = require("webpack-merge"); | ||
const path = require("path"); | ||
const baseConfig = require("../../webpack/webpack.config.base.common.prod"); | ||
// @see https://stackoverflow.com/questions/46010926/how-to-use-webpack-with-a-monorepo-yarnpkg-workspaces | ||
|
||
//const merge = require('webpack-merge') | ||
module.exports = merge(baseConfig, { | ||
entry: path.resolve(__dirname, "./index.ts"), | ||
output: { | ||
path: path.resolve(__dirname, "dist"), | ||
}, | ||
}); |
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,7 @@ | ||
export interface AppSheetsCollector { | ||
sheets: { | ||
getStyleElement: Function; | ||
}; | ||
enhanceApp: Function; | ||
finally?: Function; | ||
} |
Oops, something went wrong.