2
0

build: 📦️ Update packages

This commit is contained in:
Baptiste Arnaud
2022-02-14 18:04:23 +01:00
parent bdfd7ac1bc
commit e7d1f5d674
15 changed files with 312 additions and 119 deletions

View File

@ -95,6 +95,7 @@ export const ItemNodesList = ({
item: ButtonItem
) => {
if (!typebot || isReadOnly) return
placeholderRefs.current.splice(itemIndex + 1, 1)
deleteItem({ blockIndex, stepIndex, itemIndex })
setPosition(absolute)
setRelativeCoordinates(relative)

View File

@ -62,7 +62,6 @@ export const StepNodesList = ({
y: clientY - mousePositionInElement.y,
})
}
useEventListener('mousemove', handleMouseMoveGlobal)
const handleMouseMoveOnBlock = (event: MouseEvent) => {
if (!isDraggingOnCurrentBlock) return
@ -70,7 +69,6 @@ export const StepNodesList = ({
computeNearestPlaceholderIndex(event.pageY, placeholderRefs)
)
}
useEventListener('mousemove', handleMouseMoveOnBlock, blockRef.current)
const handleMouseUpOnBlock = (e: MouseEvent) => {
setExpandedPlaceholderIndex(undefined)
@ -87,14 +85,6 @@ export const StepNodesList = ({
setDraggedStep(undefined)
setDraggedStepType(undefined)
}
useEventListener(
'mouseup',
handleMouseUpOnBlock,
mouseOverBlock?.ref.current,
{
capture: true,
}
)
const handleStepMouseDown =
(stepIndex: number) =>
@ -103,6 +93,7 @@ export const StepNodesList = ({
step: DraggableStep
) => {
if (isReadOnly) return
placeholderRefs.current.splice(stepIndex + 1, 1)
detachStepFromBlock({ blockIndex, stepIndex })
setPosition(absolute)
setMousePositionInElement(relative)
@ -114,6 +105,16 @@ export const StepNodesList = ({
elem && (placeholderRefs.current[idx] = elem)
}
useEventListener('mousemove', handleMouseMoveGlobal)
useEventListener('mousemove', handleMouseMoveOnBlock, blockRef.current)
useEventListener(
'mouseup',
handleMouseUpOnBlock,
mouseOverBlock?.ref.current,
{
capture: true,
}
)
return (
<Stack
spacing={1}

View File

@ -117,7 +117,7 @@ export const computeNearestPlaceholderIndex = (
? { closestIndex: index, value: mouseDistanceFromPlaceholder }
: prev
},
{ closestIndex: 0, value: 100 }
{ closestIndex: 0, value: 999999999999 }
)
return closestIndex
}

View File

@ -14,8 +14,8 @@
"workerDirectory": "public"
},
"dependencies": {
"@chakra-ui/css-reset": "^1.1.1",
"@chakra-ui/react": "^1.8.1",
"@chakra-ui/css-reset": "^1.1.2",
"@chakra-ui/react": "^1.8.3",
"@codemirror/basic-setup": "^0.19.1",
"@codemirror/lang-css": "^0.19.3",
"@codemirror/lang-html": "^0.19.4",
@ -27,7 +27,7 @@
"@giphy/js-fetch-api": "^4.1.2",
"@giphy/js-types": "^4.1.0",
"@giphy/react-components": "^5.4.0",
"@googleapis/drive": "^2.1.0",
"@googleapis/drive": "^2.2.0",
"@next-auth/prisma-adapter": "1.0.1",
"@sentry/nextjs": "^6.17.7",
"@stripe/stripe-js": "^1.22.0",
@ -37,29 +37,29 @@
"@udecode/plate-link": "^10.0.0",
"@udecode/plate-ui-link": "^10.0.0",
"@udecode/plate-ui-toolbar": "^10.0.0",
"aws-sdk": "^2.1065.0",
"aws-sdk": "^2.1073.0",
"bot-engine": "*",
"browser-image-compression": "^1.0.17",
"db": "*",
"deep-object-diff": "^1.1.7",
"fast-equals": "^2.0.4",
"fast-equals": "^3.0.0",
"focus-visible": "^5.2.0",
"form-data": "^4.0.0",
"framer-motion": "^4",
"google-auth-library": "^7.11.0",
"google-auth-library": "^7.12.0",
"google-spreadsheet": "^3.2.0",
"got": "^12.0.1",
"htmlparser2": "^7.2.0",
"immer": "^9.0.12",
"js-video-url-parser": "^0.5.1",
"kbar": "^0.1.0-beta.24",
"kbar": "^0.1.0-beta.27",
"mailgun.js": "^4.2.1",
"micro": "^9.3.4",
"micro-cors": "^0.1.1",
"models": "*",
"msw": "^0.36.8",
"next": "^12.0.9",
"next-auth": "4.1.2",
"next": "^12.0.10",
"next-auth": "4.2.1",
"nodemailer": "^6.7.2",
"nprogress": "^0.2.0",
"papaparse": "^5.3.1",
@ -69,36 +69,36 @@
"react-frame-component": "^5.2.1",
"react-table": "^7.7.0",
"short-uuid": "^4.2.0",
"slate": "^0.72.3",
"slate": "^0.72.8",
"slate-history": "^0.66.0",
"slate-hyperscript": "^0.67.0",
"slate-react": "^0.72.7",
"stripe": "^8.200.0",
"slate-react": "^0.72.9",
"stripe": "^8.202.0",
"styled-components": "^5.3.3",
"svg-round-corners": "^0.3.0",
"swr": "^1.2.0",
"swr": "^1.2.1",
"typebot-js": "^2.1.0",
"use-debounce": "^7.0.1",
"use-immer": "^0.6.0",
"utils": "*"
},
"devDependencies": {
"@playwright/test": "^1.18.1",
"@playwright/test": "^1.19.0",
"@testing-library/cypress": "^8.0.2",
"@types/google-spreadsheet": "^3.1.5",
"@types/micro-cors": "^0.1.2",
"@types/node": "^16.11.9",
"@types/node": "^17.0.17",
"@types/nprogress": "^0.2.0",
"@types/papaparse": "^5.3.1",
"@types/papaparse": "^5.3.2",
"@types/prettier": "^2.4.4",
"@types/qs": "^6.9.7",
"@types/react": "^17.0.38",
"@types/react": "^17.0.39",
"@types/react-table": "^7.7.9",
"@types/testing-library__cypress": "^5.0.9",
"@typescript-eslint/eslint-plugin": "^5.10.1",
"dotenv": "^14.3.2",
"@typescript-eslint/eslint-plugin": "^5.11.0",
"dotenv": "^16.0.0",
"eslint": "<8.0.0",
"eslint-config-next": "12.0.9",
"eslint-config-next": "12.0.10",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-cypress": "^2.12.1",
"eslint-plugin-prettier": "^4.0.0",

View File

@ -8,7 +8,13 @@ const SignInPage = () => {
return (
<VStack spacing={4} h="100vh" justifyContent="center">
<Seo title="Sign in" />
<Heading>Sign in</Heading>
<Heading
onClick={() => {
throw new Error('Sentry is working')
}}
>
Sign in
</Heading>
<AuthSwitcher type="signin" />
<SignInForm />
</VStack>

View File

@ -1,4 +1,4 @@
import test, { expect, Page } from '@playwright/test'
import test, { expect } from '@playwright/test'
import {
createTypebots,
importTypebotInDatabase,
@ -65,7 +65,9 @@ test.describe.parallel('Editor', () => {
await expect(page.locator('[data-testid="step"] >> nth=1')).toHaveText(
'Hello!'
)
await page.dragAndDrop('text=Hello', 'text=Item 1')
await page.dragAndDrop('text=Hello', '[data-testid="step"] >> nth=3', {
targetPosition: { x: 100, y: 0 },
})
await expect(page.locator('[data-testid="step"] >> nth=2')).toHaveText(
'Hello!'
)

View File

@ -24,7 +24,7 @@
},
"devDependencies": {
"@next/bundle-analyzer": "^12.0.10",
"@types/node": "^17.0.16",
"@types/node": "^17.0.17",
"@types/react": "^17.0.39",
"autoprefixer": "^10.4.2",
"cross-env": "^7.0.3",

View File

@ -14,7 +14,7 @@
"db": "*",
"google-spreadsheet": "^3.2.0",
"models": "*",
"next": "^12.0.7",
"next": "^12.0.10",
"nodemailer": "^6.7.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
@ -23,17 +23,17 @@
"devDependencies": {
"@types/cors": "^2.8.12",
"@types/google-spreadsheet": "^3.1.5",
"@types/node": "^17.0.4",
"@types/node": "^17.0.17",
"@types/nodemailer": "^6.4.4",
"@types/react": "^17.0.38",
"@typescript-eslint/eslint-plugin": "^5.9.0",
"@types/react": "^17.0.39",
"@typescript-eslint/eslint-plugin": "^5.11.0",
"eslint": "<8.0.0",
"eslint-config-next": "12.0.7",
"eslint-config-next": "12.0.10",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-cypress": "^2.12.1",
"eslint-plugin-prettier": "^4.0.0",
"next-transpile-modules": "^9.0.0",
"prettier": "^2.5.1",
"typescript": "^4.5.4"
"typescript": "^4.5.5"
}
}