bumps deps, moves monaco-editor to dev deps
This commit is contained in:
parent
9afbf24de6
commit
277654edff
4 changed files with 720 additions and 706 deletions
|
@ -55,9 +55,8 @@
|
||||||
"idb-keyval": "^5.0.6",
|
"idb-keyval": "^5.0.6",
|
||||||
"immer": "^9.0.5",
|
"immer": "^9.0.5",
|
||||||
"ismobilejs": "^1.1.1",
|
"ismobilejs": "^1.1.1",
|
||||||
"monaco-editor": "^0.25.2",
|
|
||||||
"next": "^11.0.1",
|
"next": "^11.0.1",
|
||||||
"next-auth": "^3.27.0",
|
"next-auth": "^3.27.3",
|
||||||
"next-pwa": "^5.2.23",
|
"next-pwa": "^5.2.23",
|
||||||
"perfect-freehand": "^0.4.91",
|
"perfect-freehand": "^0.4.91",
|
||||||
"react": "^17.0.2",
|
"react": "^17.0.2",
|
||||||
|
@ -66,8 +65,7 @@
|
||||||
"react-feather": "^2.0.9",
|
"react-feather": "^2.0.9",
|
||||||
"react-markdown": "^6.0.2",
|
"react-markdown": "^6.0.2",
|
||||||
"react-use-gesture": "^9.1.3",
|
"react-use-gesture": "^9.1.3",
|
||||||
"sucrase": "^3.19.0",
|
"sucrase": "^3.19.0"
|
||||||
"uuid": "^8.3.2"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.14.6",
|
"@babel/core": "^7.14.6",
|
||||||
|
@ -87,6 +85,7 @@
|
||||||
"jest-esm-transformer": "^1.0.0",
|
"jest-esm-transformer": "^1.0.0",
|
||||||
"jest-watch-typeahead": "^0.6.1",
|
"jest-watch-typeahead": "^0.6.1",
|
||||||
"lint-staged": "^10.0.10",
|
"lint-staged": "^10.0.10",
|
||||||
|
"monaco-editor": "^0.25.2",
|
||||||
"prettier": "^2.3.1",
|
"prettier": "^2.3.1",
|
||||||
"typescript": "^4.1.3"
|
"typescript": "^4.1.3"
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { GetServerSideProps } from 'next'
|
import { GetServerSideProps } from 'next'
|
||||||
import { getSession } from 'next-auth/client'
|
import { getSession } from 'next-auth/client'
|
||||||
import { v4 as uuid } from 'uuid'
|
import { uniqueId } from 'utils'
|
||||||
|
|
||||||
export default function CreateNewRoom(): JSX.Element {
|
export default function CreateNewRoom(): JSX.Element {
|
||||||
return <div>You should not see this one</div>
|
return <div>You should not see this one</div>
|
||||||
|
@ -14,7 +14,7 @@ export const getServerSideProps: GetServerSideProps = async (context) => {
|
||||||
context.res.statusCode = 307
|
context.res.statusCode = 307
|
||||||
}
|
}
|
||||||
|
|
||||||
context.res.setHeader('Location', `/room/${uuid()}`)
|
context.res.setHeader('Location', `/room/${uniqueId()}`)
|
||||||
context.res.statusCode = 307
|
context.res.statusCode = 307
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { Bounds, Edge, Corner, BezierCurveSegment, DashStyle } from 'types'
|
import { Bounds, Edge, Corner, BezierCurveSegment, DashStyle } from 'types'
|
||||||
import { v4 as uuid } from 'uuid'
|
|
||||||
import vec from './vec'
|
import vec from './vec'
|
||||||
import _isMobile from 'ismobilejs'
|
import _isMobile from 'ismobilejs'
|
||||||
import { intersectPolygonBounds } from './intersections'
|
import { intersectPolygonBounds } from './intersections'
|
||||||
|
@ -1591,7 +1590,13 @@ export function getFromCache<V, I extends object>(
|
||||||
* Get a unique string id.
|
* Get a unique string id.
|
||||||
*/
|
*/
|
||||||
export function uniqueId(): string {
|
export function uniqueId(): string {
|
||||||
return uuid()
|
const array = new Uint32Array(8)
|
||||||
|
window.crypto.getRandomValues(array)
|
||||||
|
let str = ''
|
||||||
|
for (let i = 0; i < array.length; i++) {
|
||||||
|
str += (i < 2 || i > 5 ? '' : '-') + array[i].toString(16).slice(-4)
|
||||||
|
}
|
||||||
|
return str
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue