Merge branch 'feature/mongo-test' into feature/hj

This commit is contained in:
yoosangwook 2024-07-22 11:48:40 +09:00
commit b321f75e6f
10 changed files with 419 additions and 382 deletions

12
.env Normal file
View File

@ -0,0 +1,12 @@
# Environment variables declared in this file are automatically made available to Prisma.
# See the documentation for more detail: https://pris.ly/d/prisma-schema#accessing-environment-variables-from-the-schema
# Prisma supports the native connection string format for PostgreSQL, MySQL, SQLite, SQL Server, MongoDB and CockroachDB.
# See the documentation for all the connection string options: https://pris.ly/d/connection-strings
# DATABASE_URL="postgresql://johndoe:randompassword@localhost:5432/mydb?schema=public"
# DATABASE_URL="mongodb://yoo32767:GuCtswjLGqUaNL0G@cluster0.vsdtcnb.mongodb.net/sample_mflix?retryWrites=true&w=majority"
#DATABASE_URL = "mongodb%2Bsrv%3A%2F%2Fyoo32767%3AGuCtswjLGqUaNL0G%40cluster0.vsdtcnb.mongodb.net%2F%3FretryWrites%3Dtrue%26w%3Dmajority%26appName%3DCluster0"
# DATABASE_URL = "mongodb+srv://yoo32767:GuCtswjLGqUaNL0G@cluster0.vsdtcnb.mongodb.net/Cluster0?retryWrites=true&w=majority"
# DATABASE_URL="mongodb://yoo32767:GuCtswjLGqUaNL0G@cluster0.vsdtcnb.mongodb.net/sample_mflix?retryWrites=true&w=majority"
DATABASE_URL="mongodb+srv://yoo32767:GuCtswjLGqUaNL0G@cluster0.vsdtcnb.mongodb.net/mytest"

View File

@ -10,9 +10,11 @@
},
"dependencies": {
"@nextui-org/react": "^2.4.2",
"@prisma/client": "^5.17.0",
"fabric": "^5.3.0",
"framer-motion": "^11.2.13",
"mathjs": "^13.0.2",
"mongodb": "^6.8.0",
"next": "14.2.3",
"react": "^18",
"react-dom": "^18",
@ -21,6 +23,7 @@
},
"devDependencies": {
"postcss": "^8",
"prisma": "^5.17.0",
"tailwindcss": "^3.4.1"
}
}

19
prisma/schema.prisma Normal file
View File

@ -0,0 +1,19 @@
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "mongodb"
url = env("DATABASE_URL")
}
model test {
id String @id @default(auto()) @map("_id") @db.ObjectId
content String
}
model canvas {
id String @id @default(auto()) @map("_id") @db.ObjectId
loginId String
canvas Json
}

View File

@ -7,8 +7,9 @@ import QPolygon from '@/components/fabric/QPolygon'
import RangeSlider from './ui/RangeSlider'
import { useRecoilState, useRecoilValue } from 'recoil'
import { canvasListState, canvasSizeState, fontSizeState, sortedPolygonArray } from '@/store/canvasAtom'
import { canvasAtom, canvasSizeState, fontSizeState, sortedPolygonArray } from '@/store/canvasAtom'
import { QLine } from '@/components/fabric/QLine'
import { getTests, getCanvasState, insertCanvasState } from '@/lib/canvas'
export default function Roof2() {
const { canvas, handleRedo, handleUndo, setCanvasBackgroundWithDots, saveImage, addCanvas, changeCanvas } = useCanvas('canvas')
@ -35,6 +36,8 @@ export default function Roof2() {
const { mode, changeMode, handleClear, fillCellInPolygon, zoomIn, zoomOut, zoom, togglePolygonLine, handleOuterlinesTest2, applyTemplateB } =
useMode()
// const [canvasState, setCanvasState] = useRecoilState(canvasAtom)
useEffect(() => {
if (!canvas) {
return
@ -242,6 +245,36 @@ export default function Roof2() {
const lines = togglePolygonLine(polygon)
}
/**
* canvas 내용 저장하기
*/
const handleSaveCanvas = async () => {
// const jsonStr = JSON.stringify(canvas?.toDatalessJSON(['type', 'fontSize']))
const jsonObj = JSON.stringify(canvas?.toDatalessJSON(['type', 'fontSize', 'lines']))
console.log(jsonObj)
const param = {
loginId: 'test',
canvas: jsonObj,
}
console.log(param)
await insertCanvasState(param)
handleClear()
}
/**
* canvas 내용 불러오기
*/
const handleLoadCanvas = async () => {
const canvasStates = await getCanvasState()
console.log(JSON.parse(canvasStates.canvas))
canvas?.loadFromJSON(JSON.parse(canvasStates.canvas))
}
/**
* 컨트롤러 보이기/숨기기
*/
const handleShowController = () => {
setShowControl(!showControl)
}
@ -345,11 +378,11 @@ export default function Roof2() {
<Button className="m-1 p-2" onClick={PolygonToLine}>
PolygonToLine
</Button>
<Button className="m-1 p-2" onClick={addCanvas}>
캔버스 추가
<Button className="m-1 p-2" onClick={handleSaveCanvas}>
canvas 내용 저장하기
</Button>
<Button className="m-1 p-2" onClick={nextCanvas}>
다음 캔버스
<Button className="m-1 p-2" onClick={handleLoadCanvas}>
canvas 내용 불러오기
</Button>
<Button className="m-1 p-2" color={`${showControl ? 'primary' : 'default'}`} onClick={handleShowController}>
canvas 컨트롤러 {`${showControl ? '숨기기' : '보이기'}`}

View File

@ -1,9 +1,9 @@
import { useEffect, useRef, useState } from 'react'
import { useRef, useState } from 'react'
import QRect from '@/components/fabric/QRect'
import QPolygon from '@/components/fabric/QPolygon'
import { getStartIndex, rearrangeArray, findTopTwoIndexesByDistance, getDirection, getCenterPoint } from '@/util/canvas-util'
import { useRecoilState, useSetRecoilState } from 'recoil'
import { fontSizeState, roofState, sortedPolygonArray, wallState } from '@/store/canvasAtom'
import { findTopTwoIndexesByDistance, getCenterPoint, getDirection, getStartIndex, rearrangeArray } from '@/util/canvas-util'
import { useRecoilState } from 'recoil'
import { fontSizeState, roofState, sortedPolygonArray, templatePolygonArrayState, wallState } from '@/store/canvasAtom'
import { QLine } from '@/components/fabric/QLine'
export const Mode = {
@ -29,6 +29,7 @@ export function useMode() {
const [sortedArray, setSortedArray] = useRecoilState(sortedPolygonArray)
const [roof, setRoof] = useRecoilState(roofState)
const [wall, setWall] = useRecoilState(wallState)
const [templatePolygonState, setTemplatePolygonState] = useRecoilState(templatePolygonArrayState)
const addEvent = (mode) => {
switch (mode) {
@ -921,13 +922,12 @@ export function useMode() {
return line
})
const edgeIndexArray = []
const normalIndexArray = []
let edgeIndexArray = []
let normalIndexArray = []
lines.forEach((line, i) => {
if (i % 2 === 0) {
line.set('stroke', 'skyblue')
line.set('property', 'edge')
line.set('stroke', 'skyblue').set('property', 'edge')
edgeIndexArray.push(i)
} else {
normalIndexArray.push(i)
@ -1017,6 +1017,23 @@ export function useMode() {
let lines = []
let outLines = []
let halfLength = 0
const dashedCenterLineOpt = {
stroke: 'black',
strokeWidth: 4,
property: 'centerLine',
strokeDashArray: [5, 5],
fontSize: 14,
}
const centerLineOpt = {
stroke: 'blue',
strokeWidth: 5,
property: 'bigHoriCenter',
fontSize: 14,
}
// 폴리곤의 각 변을 선으로 생성
for (let i = 0; i < polygon.points.length; i++) {
const start = polygon.points[i]
@ -1051,8 +1068,7 @@ export function useMode() {
if (!(i % 2) == 0) {
//홀수일떄
line.line.set('stroke', 'skyblue')
line.line.set('property', 'egde')
line.line.set('stroke', 'skyblue').set('property', 'egde')
let length = Math.abs(line.get('x1') - line.get('x2')) + Math.abs(line.get('y1') - line.get('y2'))
if (length > prevHighLength) {
@ -1062,16 +1078,10 @@ export function useMode() {
highLineLength = length
}
if (prevLowLength === 0) {
if (prevLowLength === 0 || length <= prevLowLength) {
//최초에는 없어서 한번 넣음
prevLowIndex = i
prevLowLength = length
}
if (length <= prevLowLength) {
//그뒤부터는 짧은거 대로 넣음
prevLowIndex = i
prevLowLength = length
lowLineLength = length
}
@ -1110,6 +1120,7 @@ export function useMode() {
let lastLine = lines[5]
let vertCenterLine
let secondVertCenterLine
let templatePolygonObj = {}
if (prevHighIndex === 1) {
if (horizontalDirection === 'left') {
@ -1127,27 +1138,18 @@ export function useMode() {
vertCenterPoint,
firstSubLine.y2 - edge, //다음 선의 높이만큼 가져옴 edge길이를 합함
],
{
stroke: 'blue',
strokeWidth: 5,
property: 'bigHoriCenter',
fontSize: 14,
},
centerLineOpt,
)
canvas.add(vertCenterLine)
outLines.push(vertCenterLine)
//긴면 가로선 그리기
let horiCenterPoint = (firstSubLine.y1 + firstSubLine.y2) / 2
let horiCenterLine1 = new QLine(
[firstLine.x1 - eaves, horiCenterPoint, firstLine.x1 - eaves + firstLine.length / 2 + eaves, horiCenterPoint],
{
stroke: 'black',
strokeWidth: 4,
property: 'centerLine',
strokeDashArray: [5, 5],
fontSize: 14,
},
dashedCenterLineOpt,
)
canvas.add(horiCenterLine1)
let horiCenterLine2 = new QLine(
@ -1157,26 +1159,15 @@ export function useMode() {
firstLine.x1 - eaves + firstLine.length / 2 + eaves + firstLine.length / 2 + eaves,
horiCenterPoint,
],
{
stroke: 'black',
strokeWidth: 4,
property: 'centerLine',
strokeDashArray: [5, 5],
fontSize: 14,
},
dashedCenterLineOpt,
)
canvas.add(horiCenterLine2)
//작은 지붕쪽 높이 길이를 구하는 로직
let secondVertCenterPoint = (lastLine.x1 + lastLine.x2) / 2
secondVertCenterLine = new QLine([secondVertCenterPoint, middleSubLine.y1, secondVertCenterPoint, middleSubLine.y2 - edge], {
stroke: 'blue',
strokeWidth: 4,
property: 'centerLine',
fontSize: 14,
})
secondVertCenterLine = new QLine([secondVertCenterPoint, middleSubLine.y1, secondVertCenterPoint, middleSubLine.y2 - edge], centerLineOpt)
canvas.add(secondVertCenterLine)
outLines.push(secondVertCenterLine)
//작은 지붕쪽 너비 길이를 구한는 로직
let secondHoriCenterLength = (Math.abs(lastLine.get('x1') - lastLine.get('x2')) + Math.abs(lastLine.get('y1') - lastLine.get('y2'))) / 2
@ -1184,37 +1175,23 @@ export function useMode() {
let secondHoriCenterLine = new QLine(
[secondVertCenterLine.x1, secondHoriCenterPoint, secondVertCenterLine.x1 + secondHoriCenterLength + eaves, secondHoriCenterPoint],
{
stroke: 'black',
strokeWidth: 4,
property: 'centerLine',
strokeDashArray: [5, 5],
fontSize: 14,
},
dashedCenterLineOpt,
)
canvas.add(secondHoriCenterLine)
//일반라인 외각선 그리기
normalIndexArray.forEach((index) => {
const line = lines[index]
let points = []
if (index === 0) {
let drawline = new QLine([line.x1 - eaves, line.y1 - edge, line.x2 - eaves, line.y2 + edge], {
stroke: 'blue',
strokeWidth: 4,
property: 'centerLine',
fontSize: 14,
})
canvas.add(drawline)
points.push(line.x1 - eaves, line.y1 - edge, line.x2 - eaves, line.y2 + edge)
} else {
let tmpEdge = index === 2 ? edge : 0
let drawline = new QLine([line.x1 + eaves, line.y1 + tmpEdge, line.x2 + eaves, line.y2 - edge], {
stroke: 'blue',
strokeWidth: 4,
property: 'centerLine',
fontSize: 14,
})
canvas.add(drawline)
points.push(line.x1 + eaves, line.y1 + tmpEdge, line.x2 + eaves, line.y2 - edge)
}
let drawline = new QLine(points, centerLineOpt)
canvas.add(drawline)
outLines.push(drawline)
})
//케라바 라인 외각선 그리기
@ -1223,71 +1200,79 @@ export function useMode() {
const lastOuterLine = lines[5]
//첫번째 외곽선 1번
let halfLength = firstOuterLine.length / 2
halfLength = firstOuterLine.length / 2
let drawFirstLine1 = new QLine(
[firstOuterLine.x1 - eaves, firstOuterLine.y1 + edge, firstOuterLine.x1 + halfLength, firstOuterLine.y2 + edge],
{
stroke: 'blue',
strokeWidth: 4,
property: 'centerLine',
fontSize: 14,
},
centerLineOpt,
)
canvas.add(drawFirstLine1)
outLines.push(drawFirstLine1)
//첫번째 외곽선 2번
let drawFirstLine2 = new QLine([drawFirstLine1.x2, firstOuterLine.y1 + edge, firstOuterLine.x2 + eaves, firstOuterLine.y2 + edge], {
stroke: 'blue',
strokeWidth: 4,
property: 'centerLine',
fontSize: 14,
})
let drawFirstLine2 = new QLine(
[drawFirstLine1.x2, firstOuterLine.y1 + edge, firstOuterLine.x2 + eaves, firstOuterLine.y2 + edge],
centerLineOpt,
)
canvas.add(drawFirstLine2)
outLines.push(drawFirstLine2)
//중간라인 외각선
let drawMiddleLine = new QLine([drawFirstLine2.x2, middleOuterLine.y1 - edge, drawFirstLine2.x1, middleOuterLine.y2 - edge], {
stroke: 'blue',
strokeWidth: 4,
property: 'centerLine',
fontSize: 14,
})
let drawMiddleLine = new QLine([drawFirstLine2.x2, middleOuterLine.y1 - edge, drawFirstLine2.x1, middleOuterLine.y2 - edge], centerLineOpt)
canvas.add(drawMiddleLine)
outLines.push(drawMiddleLine)
//마지막 외각선
halfLength = lastLine.length / 2
let drawLastLine1 = new QLine([lastOuterLine.x2 + halfLength, lastOuterLine.y1 - edge, lastOuterLine.x2 - eaves, lastOuterLine.y2 - edge], {
stroke: 'blue',
strokeWidth: 4,
property: 'centerLine',
fontSize: 14,
})
let drawLastLine1 = new QLine(
[lastOuterLine.x2 + halfLength, lastOuterLine.y1 - edge, lastOuterLine.x2 - eaves, lastOuterLine.y2 - edge],
centerLineOpt,
)
canvas.add(drawLastLine1)
outLines.push(drawLastLine1)
let drawLastLine2 = new QLine([drawLastLine1.x1, lastOuterLine.y1 - edge, lastOuterLine.x1 + length + eaves, lastOuterLine.y2 - edge], {
stroke: 'blue',
strokeWidth: 4,
property: 'centerLine',
fontSize: 14,
})
let drawLastLine2 = new QLine(
[drawLastLine1.x1, lastOuterLine.y1 - edge, lastOuterLine.x1 + length + eaves, lastOuterLine.y2 - edge],
centerLineOpt,
)
canvas.add(drawLastLine2)
outLines.push(drawLastLine2)
let drawLastInLine1 = new QLine(
[secondVertCenterLine.x1, secondVertCenterLine.y1, secondVertCenterLine.x1 + halfLength + eaves, secondVertCenterLine.y1],
{
stroke: 'blue',
strokeWidth: 4,
property: 'centerLine',
fontSize: 14,
},
centerLineOpt,
)
canvas.add(drawLastInLine1)
outLines.push(drawLastInLine1)
let drawLastInLine2 = new QLine([secondVertCenterLine.x1, vertCenterLine.y2, vertCenterLine.x2, vertCenterLine.y2], {
stroke: 'blue',
strokeWidth: 4,
property: 'centerLine',
fontSize: 14,
})
let drawLastInLine2 = new QLine([secondVertCenterLine.x1, vertCenterLine.y2, vertCenterLine.x2, vertCenterLine.y2], centerLineOpt)
canvas.add(drawLastInLine2)
outLines.push(drawLastInLine2)
console.log('outLines', outLines)
const bigPolygonArray = [
{ x: outLines[2].x1, y: outLines[2].y1 },
{ x: outLines[5].x1, y: outLines[5].y1 },
{ x: outLines[0].x1, y: outLines[0].y1 },
{ x: outLines[0].x2, y: outLines[0].y2 },
{ x: outLines[11].x1, y: outLines[11].y1 },
{ x: outLines[1].x2, y: outLines[1].y2 },
]
// 점 배열을 사용하여 새로운 다각형 객체를 생성합니다.
const bigPolygon = new QPolygon(
bigPolygonArray,
{
stroke: 'black',
fill: 'red',
viewLengthText: true,
selectable: true,
fontSize: fontSize,
},
canvas,
)
canvas.add(bigPolygon)
} else {
//아래쪽 길게 오른쪽 방향
//배열 순서대로 뒤에꺼를 찾아서 계산한다
@ -1309,12 +1294,7 @@ export function useMode() {
vertCenterPoint,
firstSubLine.y2 + edge, //다음 선의 높이만큼 가져옴 edge길이를 합함
],
{
stroke: 'blue',
strokeWidth: 5,
property: 'bigHoriCenter',
fontSize: 14,
},
centerLineOpt,
)
canvas.add(vertCenterLine)
@ -1322,13 +1302,7 @@ export function useMode() {
let horiCenterPoint = (firstSubLine.y1 + firstSubLine.y2) / 2
let horiCenterLine1 = new QLine(
[firstLine.x1 - eaves, horiCenterPoint, firstLine.x1 - eaves + firstLine.length / 2 + eaves, horiCenterPoint],
{
stroke: 'black',
strokeWidth: 4,
property: 'centerLine',
strokeDashArray: [5, 5],
fontSize: 14,
},
dashedCenterLineOpt,
)
canvas.add(horiCenterLine1)
@ -1339,24 +1313,13 @@ export function useMode() {
firstLine.x1 - eaves + firstLine.length / 2 + eaves + firstLine.length / 2 + eaves,
horiCenterPoint,
],
{
stroke: 'black',
strokeWidth: 4,
property: 'centerLine',
strokeDashArray: [5, 5],
fontSize: 14,
},
dashedCenterLineOpt,
)
canvas.add(horiCenterLine2)
//작은 지붕쪽 높이 길이를 구하는 로직
let secondVertCenterPoint = (lastLine.x1 + lastLine.x2) / 2
secondVertCenterLine = new QLine([secondVertCenterPoint, middleSubLine.y1 - edge, secondVertCenterPoint, middleSubLine.y2], {
stroke: 'blue',
strokeWidth: 4,
property: 'centerLine',
fontSize: 14,
})
secondVertCenterLine = new QLine([secondVertCenterPoint, middleSubLine.y1 - edge, secondVertCenterPoint, middleSubLine.y2], centerLineOpt)
canvas.add(secondVertCenterLine)
@ -1366,37 +1329,22 @@ export function useMode() {
let secondHoriCenterLine = new QLine(
[secondVertCenterLine.x1 - secondHoriCenterLength - eaves, secondHoriCenterPoint, secondVertCenterLine.x1, secondHoriCenterPoint],
{
stroke: 'black',
strokeWidth: 4,
property: 'centerLine',
strokeDashArray: [5, 5],
fontSize: 14,
},
dashedCenterLineOpt,
)
canvas.add(secondHoriCenterLine)
//일반라인 외각선 그리기
normalIndexArray.forEach((index) => {
const line = lines[index]
let points = []
if (index === 0 || index === 4) {
let tmpEdge = index === 4 ? 0 : edge
let drawline = new QLine([line.x1 - eaves, line.y1 - edge, line.x2 - eaves, line.y2 + tmpEdge], {
stroke: 'blue',
strokeWidth: 4,
property: 'centerLine',
fontSize: 14,
})
canvas.add(drawline)
points = [line.x1 - eaves, line.y1 - edge, line.x2 - eaves, line.y2 + tmpEdge]
} else {
let drawline = new QLine([line.x1 + eaves, line.y1 + edge, line.x2 + eaves, line.y2 - edge], {
stroke: 'blue',
strokeWidth: 4,
property: 'centerLine',
fontSize: 14,
})
canvas.add(drawline)
points = [line.x1 + eaves, line.y1 + edge, line.x2 + eaves, line.y2 - edge]
}
let drawline = new QLine(points, centerLineOpt)
canvas.add(drawline)
})
//케라바 라인 외각선 그리기
@ -1405,34 +1353,22 @@ export function useMode() {
const lastOuterLine = lines[3]
//첫번째 외곽선 1번
let halfLength = firstOuterLine.length / 2
halfLength = firstOuterLine.length / 2
let drawFirstLine1 = new QLine(
[firstOuterLine.x1 - eaves, firstOuterLine.y1 + edge, firstOuterLine.x1 + halfLength, firstOuterLine.y2 + edge],
{
stroke: 'blue',
strokeWidth: 4,
property: 'centerLine',
fontSize: 14,
},
centerLineOpt,
)
canvas.add(drawFirstLine1)
//첫번째 외곽선 2번
let drawFirstLine2 = new QLine([drawFirstLine1.x2, firstOuterLine.y1 + edge, firstOuterLine.x2 + eaves, firstOuterLine.y2 + edge], {
stroke: 'blue',
strokeWidth: 4,
property: 'centerLine',
fontSize: 14,
})
let drawFirstLine2 = new QLine(
[drawFirstLine1.x2, firstOuterLine.y1 + edge, firstOuterLine.x2 + eaves, firstOuterLine.y2 + edge],
centerLineOpt,
)
canvas.add(drawFirstLine2)
//중간라인 외각선
let drawMiddleLine = new QLine([drawFirstLine1.x1, middleOuterLine.y1 - edge, drawFirstLine1.x2, middleOuterLine.y2 - edge], {
stroke: 'blue',
strokeWidth: 4,
property: 'centerLine',
fontSize: 14,
})
let drawMiddleLine = new QLine([drawFirstLine1.x1, middleOuterLine.y1 - edge, drawFirstLine1.x2, middleOuterLine.y2 - edge], centerLineOpt)
canvas.add(drawMiddleLine)
//마지막 외각선
@ -1440,39 +1376,25 @@ export function useMode() {
console.log(lastOuterLine)
let drawLastLine1 = new QLine([lastOuterLine.x2 - eaves, lastOuterLine.y1 - edge, lastOuterLine.x1 - halfLength, lastOuterLine.y2 - edge], {
stroke: 'blue',
strokeWidth: 4,
property: 'centerLine',
fontSize: 14,
})
let drawLastLine1 = new QLine(
[lastOuterLine.x2 - eaves, lastOuterLine.y1 - edge, lastOuterLine.x1 - halfLength, lastOuterLine.y2 - edge],
centerLineOpt,
)
canvas.add(drawLastLine1)
let drawLastLine2 = new QLine([drawLastLine1.x1, lastOuterLine.y1 - edge, lastOuterLine.x1 + length + eaves, lastOuterLine.y2 - edge], {
stroke: 'blue',
strokeWidth: 4,
property: 'centerLine',
fontSize: 14,
})
let drawLastLine2 = new QLine(
[drawLastLine1.x1, lastOuterLine.y1 - edge, lastOuterLine.x1 + length + eaves, lastOuterLine.y2 - edge],
centerLineOpt,
)
canvas.add(drawLastLine2)
let drawLastInLine1 = new QLine(
[secondVertCenterLine.x1, secondVertCenterLine.y2, secondVertCenterLine.x1 - halfLength - eaves, secondVertCenterLine.y2],
{
stroke: 'blue',
strokeWidth: 4,
property: 'centerLine',
fontSize: 14,
},
centerLineOpt,
)
canvas.add(drawLastInLine1)
let drawLastInLine2 = new QLine([secondVertCenterLine.x2, vertCenterLine.y1, vertCenterLine.x1, vertCenterLine.y1], {
stroke: 'blue',
strokeWidth: 4,
property: 'centerLine',
fontSize: 14,
})
let drawLastInLine2 = new QLine([secondVertCenterLine.x2, vertCenterLine.y1, vertCenterLine.x1, vertCenterLine.y1], centerLineOpt)
canvas.add(drawLastInLine2)
}
} else {
@ -1496,12 +1418,7 @@ export function useMode() {
vertCenterPoint,
firstSubLine.y1 + edge, //다음 선의 높이만큼 가져옴 edge길이를 합함
],
{
stroke: 'blue',
strokeWidth: 5,
property: 'bigHoriCenter',
fontSize: 14,
},
centerLineOpt,
)
canvas.add(vertCenterLine)
@ -1509,13 +1426,7 @@ export function useMode() {
let horiCenterPoint = (firstSubLine.y1 + firstSubLine.y2) / 2
let horiCenterLine1 = new QLine(
[firstLine.x2 - eaves, horiCenterPoint, firstLine.x2 - eaves + firstLine.length / 2 + eaves, horiCenterPoint],
{
stroke: 'black',
strokeWidth: 4,
property: 'centerLine',
strokeDashArray: [5, 5],
fontSize: 14,
},
dashedCenterLineOpt,
)
canvas.add(horiCenterLine1)
@ -1526,64 +1437,37 @@ export function useMode() {
firstLine.x2 - eaves + firstLine.length / 2 + eaves + firstLine.length / 2 + eaves,
horiCenterPoint,
],
{
stroke: 'black',
strokeWidth: 4,
property: 'centerLine',
strokeDashArray: [5, 5],
fontSize: 14,
},
dashedCenterLineOpt,
)
canvas.add(horiCenterLine2)
//작은 지붕쪽 높이 길이를 구하는 로직
let secondVertCenterPoint = (lastLine.x1 + lastLine.x2) / 2
secondVertCenterLine = new QLine([secondVertCenterPoint, middleSubLine.y1 + edge, secondVertCenterPoint, middleSubLine.y2], {
stroke: 'blue',
strokeWidth: 4,
property: 'centerLine',
fontSize: 14,
})
secondVertCenterLine = new QLine([secondVertCenterPoint, middleSubLine.y1 + edge, secondVertCenterPoint, middleSubLine.y2], centerLineOpt)
canvas.add(secondVertCenterLine)
//작은 지붕쪽 너비 길이를 구한는 로직
let secondHoriCenterLength = (Math.abs(lastLine.get('x1') - lastLine.get('x2')) + Math.abs(lastLine.get('y1') - lastLine.get('y2'))) / 2
let secondHoriCenterPoint = (secondVertCenterLine.y1 + secondVertCenterLine.y2) / 2
let secondHoriCenterLine = new QLine(
[secondVertCenterLine.x1 + secondHoriCenterLength + eaves, secondHoriCenterPoint, secondVertCenterLine.x1, secondHoriCenterPoint],
{
stroke: 'black',
strokeWidth: 4,
property: 'centerLine',
strokeDashArray: [5, 5],
fontSize: 14,
},
dashedCenterLineOpt,
)
canvas.add(secondHoriCenterLine)
//일반라인 외각선 그리기
normalIndexArray.forEach((index) => {
const line = lines[index]
let points = []
if (index === 0) {
let drawline = new QLine([line.x1 - eaves, line.y1 - edge, line.x2 - eaves, line.y2 + edge], {
stroke: 'blue',
strokeWidth: 4,
property: 'centerLine',
fontSize: 14,
})
canvas.add(drawline)
points = [line.x1 - eaves, line.y1 - edge, line.x2 - eaves, line.y2 + edge]
} else {
let tmpEdge = index === 2 ? 0 : edge
let drawline = new QLine([line.x1 + eaves, line.y1 + edge, line.x2 + eaves, line.y2 - tmpEdge], {
stroke: 'blue',
strokeWidth: 4,
property: 'centerLine',
fontSize: 14,
})
canvas.add(drawline)
points = [line.x1 + eaves, line.y1 + edge, line.x2 + eaves, line.y2 - tmpEdge]
}
let drawline = new QLine(points, centerLineOpt)
canvas.add(drawline)
})
//케라바 라인 외각선 그리기
@ -1592,34 +1476,22 @@ export function useMode() {
const lastOuterLine = lines[1]
//첫번째 외곽선 1번
let halfLength = firstOuterLine.length / 2
halfLength = firstOuterLine.length / 2
let drawFirstLine1 = new QLine(
[firstOuterLine.x2 - eaves, firstOuterLine.y1 - edge, firstOuterLine.x2 + halfLength, firstOuterLine.y2 - edge],
{
stroke: 'blue',
strokeWidth: 4,
property: 'centerLine',
fontSize: 14,
},
centerLineOpt,
)
canvas.add(drawFirstLine1)
//첫번째 외곽선 2번
let drawFirstLine2 = new QLine([drawFirstLine1.x2, drawFirstLine1.y1, drawFirstLine1.x2 + halfLength + eaves, drawFirstLine1.y2], {
stroke: 'blue',
strokeWidth: 4,
property: 'centerLine',
fontSize: 14,
})
let drawFirstLine2 = new QLine(
[drawFirstLine1.x2, drawFirstLine1.y1, drawFirstLine1.x2 + halfLength + eaves, drawFirstLine1.y2],
centerLineOpt,
)
canvas.add(drawFirstLine2)
//중간라인 외각선
let drawMiddleLine = new QLine([drawFirstLine2.x1, middleOuterLine.y1 + edge, drawFirstLine2.x2, middleOuterLine.y2 + edge], {
stroke: 'blue',
strokeWidth: 4,
property: 'centerLine',
fontSize: 14,
})
let drawMiddleLine = new QLine([drawFirstLine2.x1, middleOuterLine.y1 + edge, drawFirstLine2.x2, middleOuterLine.y2 + edge], centerLineOpt)
canvas.add(drawMiddleLine)
//마지막 외각선
@ -1627,39 +1499,22 @@ export function useMode() {
console.log(lastOuterLine)
let drawLastLine1 = new QLine([lastOuterLine.x1 - eaves, lastOuterLine.y1 + edge, lastOuterLine.x1 + halfLength, lastOuterLine.y2 + edge], {
stroke: 'blue',
strokeWidth: 4,
property: 'centerLine',
fontSize: 14,
})
let drawLastLine1 = new QLine(
[lastOuterLine.x1 - eaves, lastOuterLine.y1 + edge, lastOuterLine.x1 + halfLength, lastOuterLine.y2 + edge],
centerLineOpt,
)
canvas.add(drawLastLine1)
let drawLastLine2 = new QLine([drawLastLine1.x2, drawLastLine1.y1, drawLastLine1.x2 + halfLength + eaves, drawLastLine1.y1], {
stroke: 'blue',
strokeWidth: 4,
property: 'centerLine',
fontSize: 14,
})
let drawLastLine2 = new QLine([drawLastLine1.x2, drawLastLine1.y1, drawLastLine1.x2 + halfLength + eaves, drawLastLine1.y1], centerLineOpt)
canvas.add(drawLastLine2)
let drawLastInLine1 = new QLine(
[secondVertCenterLine.x1, secondVertCenterLine.y2, secondVertCenterLine.x1 + halfLength + eaves, secondVertCenterLine.y2],
{
stroke: 'blue',
strokeWidth: 4,
property: 'centerLine',
fontSize: 14,
},
centerLineOpt,
)
canvas.add(drawLastInLine1)
let drawLastInLine2 = new QLine([vertCenterLine.x1, vertCenterLine.y2, secondVertCenterLine.x2, vertCenterLine.y2], {
stroke: 'blue',
strokeWidth: 4,
property: 'centerLine',
fontSize: 14,
})
let drawLastInLine2 = new QLine([vertCenterLine.x1, vertCenterLine.y2, secondVertCenterLine.x2, vertCenterLine.y2], centerLineOpt)
canvas.add(drawLastInLine2)
} else {
//윗쪽 길게 오른쪽 방향
@ -1681,12 +1536,7 @@ export function useMode() {
vertCenterPoint,
firstSubLine.y2 + edge, //다음 선의 높이만큼 가져옴 edge길이를 합함
],
{
stroke: 'blue',
strokeWidth: 5,
property: 'bigHoriCenter',
fontSize: 14,
},
centerLineOpt,
)
canvas.add(vertCenterLine)
@ -1694,13 +1544,7 @@ export function useMode() {
let horiCenterPoint = (firstSubLine.y1 + firstSubLine.y2) / 2
let horiCenterLine1 = new QLine(
[firstLine.x2 - eaves, horiCenterPoint, firstLine.x2 - eaves + firstLine.length / 2 + eaves, horiCenterPoint],
{
stroke: 'black',
strokeWidth: 4,
property: 'centerLine',
strokeDashArray: [5, 5],
fontSize: 14,
},
dashedCenterLineOpt,
)
canvas.add(horiCenterLine1)
@ -1711,13 +1555,7 @@ export function useMode() {
firstLine.x2 - eaves + firstLine.length / 2 + eaves + firstLine.length / 2 + eaves,
horiCenterPoint,
],
{
stroke: 'black',
strokeWidth: 4,
property: 'centerLine',
strokeDashArray: [5, 5],
fontSize: 14,
},
dashedCenterLineOpt,
)
canvas.add(horiCenterLine2)
@ -1738,13 +1576,7 @@ export function useMode() {
let secondHoriCenterLine = new QLine(
[secondVertCenterLine.x1, secondHoriCenterPoint, secondVertCenterLine.x1 - secondHoriCenterLength - eaves, secondHoriCenterPoint],
{
stroke: 'black',
strokeWidth: 4,
property: 'centerLine',
strokeDashArray: [5, 5],
fontSize: 14,
},
dashedCenterLineOpt,
)
canvas.add(secondHoriCenterLine)
@ -1753,20 +1585,10 @@ export function useMode() {
const line = lines[index]
if (index === 0 || index === 2) {
let tmpEdge = index === 2 ? 0 : edge
let drawline = new QLine([line.x1 - eaves, line.y1 - tmpEdge, line.x2 - eaves, line.y2 + edge], {
stroke: 'blue',
strokeWidth: 4,
property: 'centerLine',
fontSize: 14,
})
let drawline = new QLine([line.x1 - eaves, line.y1 - tmpEdge, line.x2 - eaves, line.y2 + edge], centerLineOpt)
canvas.add(drawline)
} else {
let drawline = new QLine([line.x1 + eaves, line.y1 + edge, line.x2 + eaves, line.y2 - edge], {
stroke: 'blue',
strokeWidth: 4,
property: 'centerLine',
fontSize: 14,
})
let drawline = new QLine([line.x1 + eaves, line.y1 + edge, line.x2 + eaves, line.y2 - edge], centerLineOpt)
canvas.add(drawline)
}
})
@ -1777,69 +1599,39 @@ export function useMode() {
const lastOuterLine = lines[3]
//첫번째 외곽선 1번
let halfLength = firstOuterLine.length / 2
halfLength = firstOuterLine.length / 2
let drawFirstLine1 = new QLine(
[firstOuterLine.x2 - eaves, firstOuterLine.y1 - edge, firstOuterLine.x2 + halfLength, firstOuterLine.y2 - edge],
{
stroke: 'blue',
strokeWidth: 4,
property: 'centerLine',
fontSize: 14,
},
centerLineOpt,
)
canvas.add(drawFirstLine1)
//첫번째 외곽선 2번
let drawFirstLine2 = new QLine([drawFirstLine1.x2, drawFirstLine1.y1, drawFirstLine1.x2 + halfLength + eaves, drawFirstLine1.y2], {
stroke: 'blue',
strokeWidth: 4,
property: 'centerLine',
fontSize: 14,
})
let drawFirstLine2 = new QLine(
[drawFirstLine1.x2, drawFirstLine1.y1, drawFirstLine1.x2 + halfLength + eaves, drawFirstLine1.y2],
centerLineOpt,
)
canvas.add(drawFirstLine2)
//중간라인 외각선
let drawMiddleLine = new QLine([drawFirstLine1.x1, middleOuterLine.y1 + edge, drawFirstLine1.x2, middleOuterLine.y2 + edge], {
stroke: 'blue',
strokeWidth: 4,
property: 'centerLine',
fontSize: 14,
})
let drawMiddleLine = new QLine([drawFirstLine1.x1, middleOuterLine.y1 + edge, drawFirstLine1.x2, middleOuterLine.y2 + edge], centerLineOpt)
canvas.add(drawMiddleLine)
//마지막 외각선
halfLength = lastLine.length / 2
let drawLastLine1 = new QLine([lastOuterLine.x1 - eaves, lastOuterLine.y1 + edge, lastOuterLine.x1 + halfLength, lastOuterLine.y2 + edge], {
stroke: 'blue',
strokeWidth: 4,
property: 'centerLine',
fontSize: 14,
})
let drawLastLine1 = new QLine(
[lastOuterLine.x1 - eaves, lastOuterLine.y1 + edge, lastOuterLine.x1 + halfLength, lastOuterLine.y2 + edge],
centerLineOpt,
)
canvas.add(drawLastLine1)
let drawLastLine2 = new QLine([drawLastLine1.x2, drawLastLine1.y1, drawLastLine1.x2 + halfLength + eaves, drawLastLine1.y1], {
stroke: 'blue',
strokeWidth: 4,
property: 'centerLine',
fontSize: 14,
})
let drawLastLine2 = new QLine([drawLastLine1.x2, drawLastLine1.y1, drawLastLine1.x2 + halfLength + eaves, drawLastLine1.y1], centerLineOpt)
canvas.add(drawLastLine2)
let drawLastInLine1 = new QLine([vertCenterLine.x2, vertCenterLine.y2, secondVertCenterLine.x1, vertCenterLine.y2], {
stroke: 'blue',
strokeWidth: 4,
property: 'centerLine',
fontSize: 14,
})
let drawLastInLine1 = new QLine([vertCenterLine.x2, vertCenterLine.y2, secondVertCenterLine.x1, vertCenterLine.y2], centerLineOpt)
canvas.add(drawLastInLine1)
let drawLastInLine2 = new QLine([secondLine.x2 - eaves, secondLine.y1, drawLastLine1.x2, secondLine.y1], {
stroke: 'blue',
strokeWidth: 4,
property: 'centerLine',
fontSize: 14,
})
let drawLastInLine2 = new QLine([secondLine.x2 - eaves, secondLine.y1, drawLastLine1.x2, secondLine.y1], centerLineOpt)
canvas.add(drawLastInLine2)
}
}

38
src/lib/canvas.js Normal file
View File

@ -0,0 +1,38 @@
'use server'
import { PrismaClient } from '@prisma/client'
const prisma = new PrismaClient()
export const getTests = () => {
return prisma.test.findMany()
}
export const insertTest = async (param) => {
return prisma.test.create({
data: {
content: param,
},
})
}
export const getCanvasStateAll = () => {
return prisma.canvas.findMany()
}
export const getCanvasState = () => {
return prisma.canvas.findFirst({
where: {
loginId: 'test',
},
orderBy: {
id: 'desc',
},
})
}
export const insertCanvasState = (param) => {
return prisma.canvas.create({
data: param,
})
}

14
src/lib/prisma.js Normal file
View File

@ -0,0 +1,14 @@
import { PrismaClient } from '@prisma/client'
let prisma
if (process.env.NODE_ENV === 'production') {
prisma = new PrismaClient()
} else {
if (!global.prisma) {
global.prisma = new PrismaClient()
}
prisma = global.prisma
}
export default prisma

View File

@ -36,8 +36,18 @@ export const wallState = atom({
dangerouslyAllowMutability: true,
})
<<<<<<< HEAD
export const canvasListState = atom({
key: 'canvas',
=======
export const templatePolygonArrayState = atom({
key: 'templatePolygon',
default: {}, //object ex) big, mid, sht = {point : [{x1, y1}, {x2, y1}], direction : left or right or top or bottom}
})
export const canvasAtom = atom({
key: 'canvasState',
>>>>>>> feature/mongo-test
default: [],
dangerouslyAllowMutability: true,
})

View File

@ -1,4 +1,4 @@
import { atan2, chain, derivative, e, evaluate, log, pi, pow, round, sqrt, intersect } from 'mathjs'
import { intersect } from 'mathjs'
/**
* Collection of function to use on canvas
@ -38,7 +38,7 @@ export function actionHandler(eventData, transform, x, y) {
// define a function that can keep the polygon in the same position when we change its width/height/top/left
export function anchorWrapper(anchorIndex, fn) {
return function (eventData, transform, x, y) {
return function(eventData, transform, x, y) {
let fabricObject = transform.target
let originX = fabricObject?.points[anchorIndex].x - fabricObject.pathOffset.x
let originY = fabricObject.points[anchorIndex].y - fabricObject.pathOffset.y
@ -447,4 +447,4 @@ export function calculateDistance(point, line) {
const numerator = Math.abs((y2 - y1) * x0 - (x2 - x1) * y0 + x2 * y1 - y2 * x1)
const denominator = Math.sqrt(Math.pow(y2 - y1, 2) + Math.pow(x2 - x1, 2))
return numerator / denominator
}
}

118
yarn.lock
View File

@ -148,6 +148,13 @@
semver "^7.3.5"
tar "^6.1.11"
"@mongodb-js/saslprep@^1.1.5":
version "1.1.8"
resolved "https://registry.yarnpkg.com/@mongodb-js/saslprep/-/saslprep-1.1.8.tgz#d39744540be8800d17749990b0da95b4271840d1"
integrity sha512-qKwC/M/nNNaKUBMQ0nuzm47b7ZYWQHN3pcXq4IIcoSBc2hOIrflAxJduIvvqmhoz3gR2TacTAs8vlsCVPkiEdQ==
dependencies:
sparse-bitfield "^3.0.3"
"@next/env@14.2.3":
version "14.2.3"
resolved "https://registry.npmjs.org/@next/env/-/env-14.2.3.tgz"
@ -1143,6 +1150,47 @@
resolved "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz"
integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==
"@prisma/client@^5.17.0":
version "5.17.0"
resolved "https://registry.yarnpkg.com/@prisma/client/-/client-5.17.0.tgz#9079947bd749689c2dabfb9ecc70a24ebefb1f43"
integrity sha512-N2tnyKayT0Zf7mHjwEyE8iG7FwTmXDHFZ1GnNhQp0pJUObsuel4ZZ1XwfuAYkq5mRIiC/Kot0kt0tGCfLJ70Jw==
"@prisma/debug@5.17.0":
version "5.17.0"
resolved "https://registry.yarnpkg.com/@prisma/debug/-/debug-5.17.0.tgz#a765105848993984535b6066f8ebc6e6ead26533"
integrity sha512-l7+AteR3P8FXiYyo496zkuoiJ5r9jLQEdUuxIxNCN1ud8rdbH3GTxm+f+dCyaSv9l9WY+29L9czaVRXz9mULfg==
"@prisma/engines-version@5.17.0-31.393aa359c9ad4a4bb28630fb5613f9c281cde053":
version "5.17.0-31.393aa359c9ad4a4bb28630fb5613f9c281cde053"
resolved "https://registry.yarnpkg.com/@prisma/engines-version/-/engines-version-5.17.0-31.393aa359c9ad4a4bb28630fb5613f9c281cde053.tgz#3c7cc1ef3ebc34cbd069e5873b9982f2aabf5acd"
integrity sha512-tUuxZZysZDcrk5oaNOdrBnnkoTtmNQPkzINFDjz7eG6vcs9AVDmA/F6K5Plsb2aQc/l5M2EnFqn3htng9FA4hg==
"@prisma/engines@5.17.0":
version "5.17.0"
resolved "https://registry.yarnpkg.com/@prisma/engines/-/engines-5.17.0.tgz#74dd1aabb22675892760b3cf69a448e3aef4616b"
integrity sha512-+r+Nf+JP210Jur+/X8SIPLtz+uW9YA4QO5IXA+KcSOBe/shT47bCcRMTYCbOESw3FFYFTwe7vU6KTWHKPiwvtg==
dependencies:
"@prisma/debug" "5.17.0"
"@prisma/engines-version" "5.17.0-31.393aa359c9ad4a4bb28630fb5613f9c281cde053"
"@prisma/fetch-engine" "5.17.0"
"@prisma/get-platform" "5.17.0"
"@prisma/fetch-engine@5.17.0":
version "5.17.0"
resolved "https://registry.yarnpkg.com/@prisma/fetch-engine/-/fetch-engine-5.17.0.tgz#f718dc7426411d1ebeeee53e2d0d38652387f87c"
integrity sha512-ESxiOaHuC488ilLPnrv/tM2KrPhQB5TRris/IeIV4ZvUuKeaicCl4Xj/JCQeG9IlxqOgf1cCg5h5vAzlewN91Q==
dependencies:
"@prisma/debug" "5.17.0"
"@prisma/engines-version" "5.17.0-31.393aa359c9ad4a4bb28630fb5613f9c281cde053"
"@prisma/get-platform" "5.17.0"
"@prisma/get-platform@5.17.0":
version "5.17.0"
resolved "https://registry.yarnpkg.com/@prisma/get-platform/-/get-platform-5.17.0.tgz#89fdcae2adddebbbf0e7bd0474a6c49d6023519b"
integrity sha512-UlDgbRozCP1rfJ5Tlkf3Cnftb6srGrEQ4Nm3og+1Se2gWmCZ0hmPIi+tQikGDUVLlvOWx3Gyi9LzgRP+HTXV9w==
dependencies:
"@prisma/debug" "5.17.0"
"@react-aria/breadcrumbs@3.5.13":
version "3.5.13"
resolved "https://registry.yarnpkg.com/@react-aria/breadcrumbs/-/breadcrumbs-3.5.13.tgz#2686f7f460f20d67fe5cdfe185e32e3e78186962"
@ -2023,6 +2071,18 @@
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.17.6.tgz#193ced6a40c8006cfc1ca3f4553444fb38f0e543"
integrity sha512-OpXEVoCKSS3lQqjx9GGGOapBeuW5eUboYHRlHP9urXPX25IKZ6AnP5ZRxtVf63iieUbsHxLn8NQ5Nlftc6yzAA==
"@types/webidl-conversions@*":
version "7.0.3"
resolved "https://registry.yarnpkg.com/@types/webidl-conversions/-/webidl-conversions-7.0.3.tgz#1306dbfa53768bcbcfc95a1c8cde367975581859"
integrity sha512-CiJJvcRtIgzadHCYXw7dqEnMNRjhGZlYK05Mj9OyktqV8uVT8fD2BFOB7S1uwBE3Kj2Z+4UyPmFw/Ixgw/LAlA==
"@types/whatwg-url@^11.0.2":
version "11.0.5"
resolved "https://registry.yarnpkg.com/@types/whatwg-url/-/whatwg-url-11.0.5.tgz#aaa2546e60f0c99209ca13360c32c78caf2c409f"
integrity sha512-coYR071JRaHa+xoEvvYqvnIHaVqaYrLPbsufM9BF63HkwI5Lgmy2QR8Q5K/lYDYo5AK82wOvSOS0UsLTpTG7uQ==
dependencies:
"@types/webidl-conversions" "*"
abab@^2.0.5, abab@^2.0.6:
version "2.0.6"
resolved "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz"
@ -2158,6 +2218,11 @@ browser-process-hrtime@^1.0.0:
resolved "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz"
integrity sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==
bson@^6.7.0:
version "6.8.0"
resolved "https://registry.yarnpkg.com/bson/-/bson-6.8.0.tgz#5063c41ba2437c2b8ff851b50d9e36cb7aaa7525"
integrity sha512-iOJg8pr7wq2tg/zSlCCHMi3hMm5JTOxLTagf3zxhcenHsFp+c6uOs6K7W5UE7A4QIJGtqh/ZovFNMP4mOPJynQ==
busboy@1.6.0:
version "1.6.0"
resolved "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz"
@ -2852,6 +2917,11 @@ mathjs@^13.0.2:
tiny-emitter "^2.1.0"
typed-function "^4.2.1"
memory-pager@^1.0.2:
version "1.5.0"
resolved "https://registry.yarnpkg.com/memory-pager/-/memory-pager-1.5.0.tgz#d8751655d22d384682741c972f2c3d6dfa3e66b5"
integrity sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==
merge2@^1.3.0:
version "1.4.1"
resolved "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz"
@ -2926,6 +2996,23 @@ mkdirp@^1.0.3:
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e"
integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==
mongodb-connection-string-url@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/mongodb-connection-string-url/-/mongodb-connection-string-url-3.0.1.tgz#c13e6ac284ae401752ebafdb8cd7f16c6723b141"
integrity sha512-XqMGwRX0Lgn05TDB4PyG2h2kKO/FfWJyCzYQbIhXUxz7ETt0I/FqHjUeqj37irJ+Dl1ZtU82uYyj14u2XsZKfg==
dependencies:
"@types/whatwg-url" "^11.0.2"
whatwg-url "^13.0.0"
mongodb@^6.8.0:
version "6.8.0"
resolved "https://registry.yarnpkg.com/mongodb/-/mongodb-6.8.0.tgz#680450f113cdea6d2d9f7121fe57cd29111fd2ce"
integrity sha512-HGQ9NWDle5WvwMnrvUxsFYPd3JEbqD3RgABHBQRuoCEND0qzhsd0iH5ypHsf1eJ+sXmvmyKpP+FLOKY8Il7jMw==
dependencies:
"@mongodb-js/saslprep" "^1.1.5"
bson "^6.7.0"
mongodb-connection-string-url "^3.0.0"
ms@2.1.2:
version "2.1.2"
resolved "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz"
@ -3134,12 +3221,19 @@ postcss@^8, postcss@^8.4.23:
picocolors "^1.0.0"
source-map-js "^1.2.0"
prisma@^5.17.0:
version "5.17.0"
resolved "https://registry.yarnpkg.com/prisma/-/prisma-5.17.0.tgz#267b43921ab94805b010537cffa5ccaf530fa066"
integrity sha512-m4UWkN5lBE6yevqeOxEvmepnL5cNPEjzMw2IqDB59AcEV6w7D8vGljDLd1gPFH+W6gUxw9x7/RmN5dCS/WTPxA==
dependencies:
"@prisma/engines" "5.17.0"
psl@^1.1.33:
version "1.9.0"
resolved "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz"
integrity sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==
punycode@^2.1.1:
punycode@^2.1.1, punycode@^2.3.0:
version "2.3.1"
resolved "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz"
integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==
@ -3378,6 +3472,13 @@ source-map@~0.6.1:
resolved "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz"
integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==
sparse-bitfield@^3.0.3:
version "3.0.3"
resolved "https://registry.yarnpkg.com/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz#ff4ae6e68656056ba4b3e792ab3334d38273ca11"
integrity sha512-kvzhi7vqKTfkh0PZU+2D2PIllw2ymqJKujUcyPMd9Y75Nv4nPbGJZXNhxsgdQab2BmlDct1YnfQCguEvHr7VsQ==
dependencies:
memory-pager "^1.0.2"
streamsearch@^1.1.0:
version "1.1.0"
resolved "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz"
@ -3563,6 +3664,13 @@ tr46@^3.0.0:
dependencies:
punycode "^2.1.1"
tr46@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/tr46/-/tr46-4.1.1.tgz#281a758dcc82aeb4fe38c7dfe4d11a395aac8469"
integrity sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==
dependencies:
punycode "^2.3.0"
tr46@~0.0.3:
version "0.0.3"
resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a"
@ -3690,6 +3798,14 @@ whatwg-url@^11.0.0:
tr46 "^3.0.0"
webidl-conversions "^7.0.0"
whatwg-url@^13.0.0:
version "13.0.0"
resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-13.0.0.tgz#b7b536aca48306394a34e44bda8e99f332410f8f"
integrity sha512-9WWbymnqj57+XEuqADHrCJ2eSXzn8WXIW/YSGaZtb2WKAInQ6CHfaUUcTyyver0p8BDg5StLQq8h1vtZuwmOig==
dependencies:
tr46 "^4.1.1"
webidl-conversions "^7.0.0"
whatwg-url@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d"