Skip to content

✨ Innovative and open-source visualization application that transforms various data formats, such as JSON, YAML, XML and CSV into interactive graphs.

feat: UI & QoL improvements

AykutSarac7dfbb9f40a92
diff --git a/package.json b/package.json
index 1bc0799f..50fdd097 100644
--- a/package.json
+++ b/package.json
@@ -14,40 +14,40 @@
"analyze": "ANALYZE=true npm run build"
},
"dependencies": {
- "@mantine/carousel": "^7.6.2",
- "@mantine/code-highlight": "^7.6.2",
- "@mantine/core": "^7.6.2",
- "@mantine/dropzone": "^7.6.2",
- "@mantine/hooks": "^7.6.2",
+ "@mantine/carousel": "^7.9.0",
+ "@mantine/code-highlight": "^7.9.0",
+ "@mantine/core": "^7.9.0",
+ "@mantine/dropzone": "^7.9.0",
+ "@mantine/hooks": "^7.9.0",
"@monaco-editor/react": "^4.6.0",
"@sentry/nextjs": "^7.107.0",
- "@supabase/supabase-js": "^2.39.8",
+ "@supabase/supabase-js": "^2.43.1",
"@tanstack/react-query": "^4.36.1",
"allotment": "^1.20.0",
- "axios": "^1.6.7",
- "dayjs": "^1.11.10",
+ "axios": "^1.6.8",
+ "dayjs": "^1.11.11",
"gofmt.js": "^0.0.2",
"html-to-image": "^1.11.11",
"jq-web": "^0.5.1",
"js-yaml": "^4.1.0",
- "json-2-csv": "^5.5.0",
+ "json-2-csv": "^5.5.1",
"json_typegen_wasm": "^0.7.0",
"jsonc-parser": "^3.2.1",
"jsonwebtoken": "^9.0.2",
"jxon": "2.0.0-beta.5",
"lodash.debounce": "^4.0.8",
"million": "^3.0.6",
- "next": "14.1.0",
+ "next": "14.2.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-ga4": "^2.1.0",
"react-hot-toast": "^2.4.1",
- "react-icons": "^5.0.1",
+ "react-icons": "^5.2.0",
"react-json-tree": "^0.18.0",
"react-linkify-it": "^1.0.8",
"react-zoomable-ui": "^0.11.0",
"reaflow": "5.2.8",
- "styled-components": "^6.1.8",
+ "styled-components": "^6.1.9",
"toml": "^3.0.0",
"use-bg-cursor-pos": "^1.0.1",
"use-long-press": "^3.2.0",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 5cada5ab..fc228edc 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -6,29 +6,29 @@ settings:
dependencies:
'@mantine/carousel':
- specifier: ^7.6.2
+ specifier: ^7.9.0
'@mantine/code-highlight':
- specifier: ^7.6.2
+ specifier: ^7.9.0
'@mantine/core':
- specifier: ^7.6.2
+ specifier: ^7.9.0
'@mantine/dropzone':
- specifier: ^7.6.2
+ specifier: ^7.9.0
'@mantine/hooks':
- specifier: ^7.6.2
- version: 7.6.2([email protected])
+ specifier: ^7.9.0
+ version: 7.9.0([email protected])
'@monaco-editor/react':
specifier: ^4.6.0
'@sentry/nextjs':
specifier: ^7.107.0
'@supabase/supabase-js':
- specifier: ^2.39.8
- version: 2.39.8
+ specifier: ^2.43.1
+ version: 2.43.1
'@tanstack/react-query':
specifier: ^4.36.1
@@ -36,11 +36,11 @@ dependencies:
specifier: ^1.20.0
axios:
- specifier: ^1.6.7
- version: 1.6.7
+ specifier: ^1.6.8
+ version: 1.6.8
dayjs:
- specifier: ^1.11.10
- version: 1.11.10
+ specifier: ^1.11.11
+ version: 1.11.11
gofmt.js:
specifier: ^0.0.2
version: 0.0.2
@@ -54,8 +54,8 @@ dependencies:
specifier: ^4.1.0
version: 4.1.0
json-2-csv:
- specifier: ^5.5.0
- version: 5.5.0
+ specifier: ^5.5.1
+ version: 5.5.1
json_typegen_wasm:
specifier: ^0.7.0
version: 0.7.0
@@ -75,8 +75,8 @@ dependencies:
specifier: ^3.0.6
version: 3.0.6
next:
- specifier: 14.1.0
+ specifier: 14.2.3
react:
specifier: ^18.2.0
version: 18.2.0
@@ -90,8 +90,8 @@ dependencies:
specifier: ^2.4.1
react-icons:
- specifier: ^5.0.1
- version: 5.0.1([email protected])
+ specifier: ^5.2.0
+ version: 5.2.0([email protected])
react-json-tree:
specifier: ^0.18.0
version: 0.18.0(@types/[email protected])([email protected])
@@ -105,8 +105,8 @@ dependencies:
specifier: 5.2.8
styled-components:
- specifier: ^6.1.8
+ specifier: ^6.1.9
toml:
specifier: ^3.0.0
version: 3.0.0
@@ -345,6 +345,13 @@ packages:
dependencies:
regenerator-runtime: 0.14.1
+ resolution: {integrity: sha512-Nms86NXrsaeU9vbBJKni6gXiEXZ4CVpYVzEjDH9Sb8vmZ3UljyA1GSOJl/6LGPO8EHLuSF9H+IxNXHPX8QHJ4g==}
+ engines: {node: '>=6.9.0'}
+ dependencies:
+ regenerator-runtime: 0.14.1
+ dev: false
+
resolution: {integrity: sha512-Bkf2q8lMB0AFpX0NFEqSbx1OkTHf0f+0j82mkw+ZpzBnkk7e9Ql0891vlfgi+kHwOk8tQjiQHpqh4LaSa0fKEA==}
engines: {node: '>=6.9.0'}
@@ -440,8 +447,8 @@ packages:
resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==}
dev: false
- /@emotion/[email protected]:
- resolution: {integrity: sha512-VINS5vEYAscRl2ZUDiT3uMPlrFQupiKgHz5AA4bCH1miKBg4qtwkim1qPmJj/4WG6TreYMY111rEFsjupcOKHw==}
+ /@emotion/[email protected]:
+ resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==}
dev: false
@@ -481,45 +488,45 @@ packages:
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dev: true
- /@floating-ui/[email protected]:
- resolution: {integrity: sha512-PcF++MykgmTj3CIyOQbKA/hDzOAiqI3mhuoN44WRCopIs1sgoDoU4oty4Jtqaj/y3oDU6fnVSm4QG0a3t5i0+g==}
+ /@floating-ui/[email protected]:
+ resolution: {integrity: sha512-42UH54oPZHPdRHdw6BgoBD6cg/eVTmVrFcgeRDM3jbO7uxSoipVcmcIGFcA5jmOHO5apcyvBhkSKES3fQJnu7A==}
dependencies:
- '@floating-ui/utils': 0.2.1
+ '@floating-ui/utils': 0.2.2
dev: false
- /@floating-ui/[email protected]:
- resolution: {integrity: sha512-RnDthu3mzPlQ31Ss/BTwQ1zjzIhr3lk1gZB1OC56h/1vEtaXkESrOqL5fQVMfXpwGtRwX+YsZBdyHtJMQnkArw==}
+ /@floating-ui/[email protected]:
+ resolution: {integrity: sha512-Nsdud2X65Dz+1RHjAIP0t8z5e2ff/IRbei6BqFrl1urT8sDVzM1HMQ+R0XcU5ceRfyO3I6ayeqIfh+6Wb8LGTw==}
dependencies:
- '@floating-ui/core': 1.6.0
- '@floating-ui/utils': 0.2.1
+ '@floating-ui/core': 1.6.1
+ '@floating-ui/utils': 0.2.2
dev: false
- resolution: {integrity: sha512-HOdqOt3R3OGeTKidaLvJKcgg75S6tibQ3Tif4eyd91QnIJWr0NLvoXFpJA/j8HqkFSL68GDca9AuyWEHlhyClw==}
+ resolution: {integrity: sha512-q0umO0+LQK4+p6aGyvzASqKbKOJcAHJ7ycE9CuUvfx3s9zTHWmGJTPOIlM/hmSBfUfg/XfY5YhLBLR/LHwShQQ==}
peerDependencies:
react: '>=16.8.0'
react-dom: '>=16.8.0'
dependencies:
- '@floating-ui/dom': 1.6.3
+ '@floating-ui/dom': 1.6.5
react: 18.2.0
react-dom: 18.2.0([email protected])
dev: false
- resolution: {integrity: sha512-p86wynZJVEkEq2BBjY/8p2g3biQ6TlgT4o/3KgFKyTWoJLU1GZ8wpctwRqtkEl2tseYA+kw7dBAIDFcednfI5w==}
+ resolution: {integrity: sha512-kBa9wntpugzrZ8t/4yWelvSmEKZdeTXTJzrxqyrLmcU/n1SM4nvse8yQh2e1b37rJGvtu0EplV9+IkBrCJ1vkw==}
peerDependencies:
react: '>=16.8.0'
react-dom: '>=16.8.0'
dependencies:
- '@floating-ui/react-dom': 2.0.8([email protected])([email protected])
- '@floating-ui/utils': 0.2.1
+ '@floating-ui/react-dom': 2.0.9([email protected])([email protected])
+ '@floating-ui/utils': 0.2.2
react: 18.2.0
react-dom: 18.2.0([email protected])
tabbable: 6.2.0
dev: false
- /@floating-ui/[email protected]:
- resolution: {integrity: sha512-9TANp6GPoMtYzQdt54kfAyMmz1+osLlXdg2ENroU7zzrtflTLrrC/lgrIfaSe+Wu0b89GKccT7vxXA0MoAIO+Q==}
+ /@floating-ui/[email protected]:
+ resolution: {integrity: sha512-J4yDIIthosAsRZ5CPYP/jQvUAQtlZTTD/4suA08/FEnlxqW3sKS9iAhgsa9VYLZ6vDHn/ixJgIqRQPotoBjxIw==}
dev: false
/@humanwhocodes/[email protected]:
@@ -604,99 +611,99 @@ packages:
call-bind: 1.0.7
dev: false
- resolution: {integrity: sha512-Iy0ffVyJz+5zNhiNhVALhXne0reQ/PhF7BFmyLDj/LKBrJG9aPNDiYZehOUeBOuXHsdhX5yIb/kuEKxd+3fMlA==}
+ resolution: {integrity: sha512-ElSgAlYAE2Er0ukv4CeOcqx47VD4+UIBAual62lmzSfKprLykqtdykYDFJTus3qNB30I27fqB9eu66dNTCfFow==}
peerDependencies:
- '@mantine/core': 7.6.2
- '@mantine/hooks': 7.6.2
+ '@mantine/core': 7.9.0
+ '@mantine/hooks': 7.9.0
embla-carousel-react: '>=7.0.0'
react: ^18.2.0
react-dom: ^18.2.0
dependencies:
- '@mantine/core': 7.6.2(@mantine/[email protected])(@types/[email protected])([email protected])([email protected])
- '@mantine/hooks': 7.6.2([email protected])
- embla-carousel-react: 8.0.2([email protected])
+ '@mantine/core': 7.9.0(@mantine/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@mantine/hooks': 7.9.0([email protected])
+ embla-carousel-react: 8.0.4([email protected])
react: 18.2.0
react-dom: 18.2.0([email protected])
dev: false
- resolution: {integrity: sha512-5JrCpONCdgrBfASQS5a7ZFrLD9e4uvjJDET10UX6ZS4dMPRqZZCYweJFUwaxhvRoIctpQeN5+Fuh95PVcZ5NXw==}
+ resolution: {integrity: sha512-UvrzRQhp2S/l3J9f0HTNRao5S+WObxsQa37hiWQE/dT5qckZdC3zONbcIVim7EhnhC0saKBEJBThBVMhJhn29w==}
peerDependencies:
- '@mantine/core': 7.6.2
- '@mantine/hooks': 7.6.2
+ '@mantine/core': 7.9.0
+ '@mantine/hooks': 7.9.0
react: ^18.2.0
react-dom: ^18.2.0
dependencies:
- '@mantine/core': 7.6.2(@mantine/[email protected])(@types/[email protected])([email protected])([email protected])
- '@mantine/hooks': 7.6.2([email protected])
+ '@mantine/core': 7.9.0(@mantine/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@mantine/hooks': 7.9.0([email protected])
clsx: 2.1.0
highlight.js: 11.9.0
react: 18.2.0
react-dom: 18.2.0([email protected])
dev: false
- resolution: {integrity: sha512-qmZhmQVc7ZZ8EKKhPkGuZbfBnLXR0xE45ikxfx+1E6/8hLY5Ypr4nWqh5Pk6p3b+K71yYnBqlbNXbtHLQH0h3g==}
+ resolution: {integrity: sha512-EhELO1uYq2s08H69h4BCcvE26mNLPaXUi6RAjApqBIynMcyJlmdluFtvGKFxjpgFZy3moeSYNrjEW//T0uTMZg==}
peerDependencies:
- '@mantine/hooks': 7.6.2
+ '@mantine/hooks': 7.9.0
react: ^18.2.0
react-dom: ^18.2.0
dependencies:
- '@floating-ui/react': 0.26.9([email protected])([email protected])
- '@mantine/hooks': 7.6.2([email protected])
+ '@floating-ui/react': 0.26.13([email protected])([email protected])
+ '@mantine/hooks': 7.9.0([email protected])
clsx: 2.1.0
react: 18.2.0
react-dom: 18.2.0([email protected])
- react-number-format: 5.3.3([email protected])([email protected])
- react-remove-scroll: 2.5.7(@types/[email protected])([email protected])
+ react-number-format: 5.3.4([email protected])([email protected])
+ react-remove-scroll: 2.5.9(@types/[email protected])([email protected])
react-textarea-autosize: 8.5.3(@types/[email protected])([email protected])
- type-fest: 4.12.0
+ type-fest: 4.18.2
transitivePeerDependencies:
- '@types/react'
dev: false
- resolution: {integrity: sha512-xhbUKWGzLkZfZu5rEqUQsVhLvfEkDtR8zxyCnMI9UgXcJ+xbzk9aqfwTd4c3+MogqINv5EHlyTcJR1SXGN592w==}
+ resolution: {integrity: sha512-PYZnm/jGfSq3hQ5xgiz9G3fdgnpNg+ZY7nv1NlpvNn2a0XAeYnCCoZ87h6U7k6YHFU11ikc0w7b8ObhWPCyBtA==}
peerDependencies:
- '@mantine/core': 7.6.2
- '@mantine/hooks': 7.6.2
+ '@mantine/core': 7.9.0
+ '@mantine/hooks': 7.9.0
react: ^18.2.0
react-dom: ^18.2.0
dependencies:
- '@mantine/core': 7.6.2(@mantine/[email protected])(@types/[email protected])([email protected])([email protected])
- '@mantine/hooks': 7.6.2([email protected])
+ '@mantine/core': 7.9.0(@mantine/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@mantine/hooks': 7.9.0([email protected])
react: 18.2.0
react-dom: 18.2.0([email protected])
react-dropzone-esm: 15.0.1([email protected])
dev: false
- resolution: {integrity: sha512-ZrOgrZHoIGCDKrr2/9njDgK0al+jjusYQFlmR0YyEFyRtgY6eNSI4zuYLcAPx1haHmUm5RsLBrqY6Iy/TLdGXA==}
+ resolution: {integrity: sha512-LKgyrlaIK0S/gcn/VDbhqLBZOYjvhXfVcH7rMs4MIBVD+wuRo2LvvAYe3cUfQbBCfmlpRjqvewwvsIYYsjSofQ==}
peerDependencies:
react: ^18.2.0
dependencies:
react: 18.2.0
dev: false
resolution: {integrity: sha512-00ioBig0x642hytVspPl7DbQyaSWRaolYie/UFNjoTdvoKPzo6xrXLhTk9ixgIKcLH5b5vDOjVNiGyY+uDCUlg==}
peerDependencies:
monaco-editor: '>= 0.21.0 < 1'
dependencies:
- monaco-editor: 0.47.0
+ monaco-editor: 0.48.0
state-local: 1.0.7
dev: false
resolution: {integrity: sha512-RFkU9/i7cN2bsq/iTkurMWOEErmYcY6JiQI3Jn+WeR/FGISH8JbHERjpS9oRuSOPvDMJI0Z8nJeKkbOs9sBYQw==}
peerDependencies:
monaco-editor: '>= 0.25.0 < 1'
react: ^16.8.0 || ^17.0.0 || ^18.0.0
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
dependencies:
- '@monaco-editor/loader': 1.4.0([email protected])
- monaco-editor: 0.47.0
+ '@monaco-editor/loader': 1.4.0([email protected])
+ monaco-editor: 0.48.0
react: 18.2.0
react-dom: 18.2.0([email protected])
dev: false
@@ -710,8 +717,8 @@ packages:
- utf-8-validate
dev: true
- resolution: {integrity: sha512-Py8zIo+02ht82brwwhTg36iogzFqGLPXlRGKQw5s+qP/kMNc4MAyDeEwBKDijk6zTIbegEgu8Qy7C1LboslQAw==}
+ resolution: {integrity: sha512-W7fd7IbkfmeeY2gXrzJYDx8D2lWKbVoTIj1o1ScPHNzvp30s1AuoEFSdr39bC5sjxJaxTtq3OTCZboNp0lNWHA==}
dev: false
@@ -720,8 +727,8 @@ packages:
glob: 10.3.10
dev: true
- resolution: {integrity: sha512-nUDn7TOGcIeyQni6lZHfzNoo9S0euXnu0jhsbMOmMJUBfgsnESdjN97kM7cBqQxZa8L/bM9om/S5/1dzCrW6wQ==}
+ resolution: {integrity: sha512-3pEYo/RaGqPP0YzwnlmPN2puaF2WMLM3apt5jLW2fFdXD9+pqcoTzRk+iZsf8ta7+quAe4Q6Ms0nR0SFGFdS1A==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [darwin]
@@ -729,8 +736,8 @@ packages:
dev: false
optional: true
- resolution: {integrity: sha512-1jgudN5haWxiAl3O1ljUS2GfupPmcftu2RYJqZiMJmmbBT5M1XDffjUtRUzP4W3cBHsrvkfOFdQ71hAreNQP6g==}
+ resolution: {integrity: sha512-6adp7waE6P1TYFSXpY366xwsOnEXM+y1kgRpjSRVI2CBDOcbRjsJ67Z6EgKIqWIue52d2q/Mx8g9MszARj8IEA==}
engines: {node: '>= 10'}
cpu: [x64]
os: [darwin]
@@ -738,8 +745,8 @@ packages:
dev: false
optional: true
- resolution: {integrity: sha512-RHo7Tcj+jllXUbK7xk2NyIDod3YcCPDZxj1WLIYxd709BQ7WuRYl3OWUNG+WUfqeQBds6kvZYlc42NJJTNi4tQ==}
+ resolution: {integrity: sha512-cuzCE/1G0ZSnTAHJPUT1rPgQx1w5tzSX7POXSLaS7w2nIUJUD+e25QoXD/hMfxbsT9rslEXugWypJMILBj/QsA==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [linux]
@@ -747,8 +754,8 @@ packages:
dev: false
optional: true
- resolution: {integrity: sha512-v6kP8sHYxjO8RwHmWMJSq7VZP2nYCkRVQ0qolh2l6xroe9QjbgV8siTbduED4u0hlk0+tjS6/Tuy4n5XCp+l6g==}
+ resolution: {integrity: sha512-0D4/oMM2Y9Ta3nGuCcQN8jjJjmDPYpHX9OJzqk42NZGJocU2MqhBq5tWkJrUQOQY9N+In9xOdymzapM09GeiZw==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [linux]
@@ -756,8 +763,8 @@ packages:
dev: false
optional: true
- resolution: {integrity: sha512-zJ2pnoFYB1F4vmEVlb/eSe+VH679zT1VdXlZKX+pE66grOgjmKJHKacf82g/sWE4MQ4Rk2FMBCRnX+l6/TVYzQ==}
+ resolution: {integrity: sha512-ENPiNnBNDInBLyUU5ii8PMQh+4XLr4pG51tOp6aJ9xqFQ2iRI6IH0Ds2yJkAzNV1CfyagcyzPfROMViS2wOZ9w==}
engines: {node: '>= 10'}
cpu: [x64]
os: [linux]
@@ -765,8 +772,8 @@ packages:
dev: false
optional: true
- resolution: {integrity: sha512-rbaIYFt2X9YZBSbH/CwGAjbBG2/MrACCVu2X0+kSykHzHnYH5FjHxwXLkcoJ10cX0aWCEynpu+rP76x0914atg==}
+ resolution: {integrity: sha512-BTAbq0LnCbF5MtoM7I/9UeUu/8ZBY0i8SFjUMCbPDOLv+un67e2JgyN4pmgfXBwy/I+RHu8q+k+MCkDN6P9ViQ==}
engines: {node: '>= 10'}
cpu: [x64]
os: [linux]
@@ -774,8 +781,8 @@ packages:
dev: false
optional: true
- resolution: {integrity: sha512-o1N5TsYc8f/HpGt39OUQpQ9AKIGApd3QLueu7hXk//2xq5Z9OxmV6sQfNp8C7qYmiOlHYODOGqNNa0e9jvchGQ==}
+ resolution: {integrity: sha512-AEHIw/dhAMLNFJFJIJIyOFDzrzI5bAjI9J26gbO5xhAKHYTZ9Or04BesFPXiAYXDNdrwTP2dQceYA4dL1geu8A==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [win32]
@@ -783,8 +790,8 @@ packages:
dev: false
optional: true
- resolution: {integrity: sha512-XXIuB1DBRCFwNO6EEzCTMHT5pauwaSj4SWs7CYnME57eaReAKBXCnkUE80p/pAZcewm7hs+vGvNqDPacEXHVkw==}
+ resolution: {integrity: sha512-vga40n1q6aYb0CLrM+eEmisfKCR45ixQYXuBXxOOmmoV8sYST9k7E3US32FsY+CkkF7NtzdcebiFT4CHuMSyZw==}
engines: {node: '>= 10'}
cpu: [ia32]
os: [win32]
@@ -792,8 +799,8 @@ packages:
dev: false
optional: true
- resolution: {integrity: sha512-9WEbVRRAqJ3YFVqEZIxUqkiO8l1nool1LmNxygr5HWF8AcSYsEpneUDhmjUVJEzO2A04+oPtZdombzzPPkTtgg==}
+ resolution: {integrity: sha512-Q1/zm43RWynxrO7lW4ehciQVj+5ePBhOK+/K2P7pLFX3JaJ/IZVC69SHidrmZSOkqz7ECIOhhy7XhAFG4JYyHA==}
engines: {node: '>= 10'}
cpu: [x64]
os: [win32]
@@ -951,7 +958,7 @@ packages:
localforage: 1.10.0
dev: false
resolution: {integrity: sha512-cGKntMb/svjHx5xWuLEh4sYMPA75c9gXegVeGeibpLUuD9b+LNeL7GaqxQ9dm2CX+Vza7QvHGBO/u+08abpEQA==}
engines: {node: '>=8'}
peerDependencies:
@@ -972,7 +979,7 @@ packages:
'@sentry/vercel-edge': 7.107.0
'@sentry/webpack-plugin': 1.21.0
chalk: 3.0.0
react: 18.2.0
resolve: 1.22.8
rollup: 2.78.0
@@ -1049,14 +1056,14 @@ packages:
- supports-color
dev: false
- /@supabase/[email protected]:
- resolution: {integrity: sha512-BNzC5XhCzzCaggJ8s53DP+WeHHGT/NfTsx2wUSSGKR2/ikLFQTBCDzMvGz/PxYMqRko/LwncQtKXGOYp1PkPaw==}
+ /@supabase/[email protected]:
+ resolution: {integrity: sha512-s+lkHEdGiczDrzXJ1YWt2y3bxRi+qIUnXcgkpLSrId7yjBeaXBFygNjTaoZLG02KNcYwbuZ9qkEIqmj2hF7svw==}
dependencies:
'@supabase/node-fetch': 2.6.15
dev: false
- /@supabase/[email protected]:
- resolution: {integrity: sha512-AP6e6W9rQXFTEJ7sTTNYQrNf0LCcnt1hUW+RIgUK+Uh3jbWvcIST7wAlYyNZiMlS9+PYyymWQ+Ykz/rOYSO0+A==}
+ /@supabase/[email protected]:
+ resolution: {integrity: sha512-QyzNle/rVzlOi4BbVqxLSH828VdGY1RElqGFAj+XeVypj6+PVtMlD21G8SDnsPQDtlqqTtoGRgdMlQZih5hTuw==}
dependencies:
'@supabase/node-fetch': 2.6.15
dev: false
@@ -1068,19 +1075,19 @@ packages:
whatwg-url: 5.0.0
dev: false
- /@supabase/[email protected]:
- resolution: {integrity: sha512-I6yHo8CC9cxhOo6DouDMy9uOfW7hjdsnCxZiaJuIVZm1dBGTFiQPgfMa9zXCamEWzNyWRjZvupAUuX+tqcl5Sw==}
+ /@supabase/[email protected]:
+ resolution: {integrity: sha512-9/7pUmXExvGuEK1yZhVYXPZnLEkDTwxgMQHXLrN5BwPZZm4iUCL1YEyep/Z2lIZah8d8M433mVAUEGsihUj5KQ==}
dependencies:
'@supabase/node-fetch': 2.6.15
dev: false
- /@supabase/[email protected]:
- resolution: {integrity: sha512-lAp50s2n3FhGJFq+wTSXLNIDPw5Y0Wxrgt44eM5nLSA3jZNUUP3Oq2Ccd1CbZdVntPCWLZvJaU//pAd2NE+QnQ==}
+ /@supabase/[email protected]:
+ resolution: {integrity: sha512-TEHlGwNGGmKPdeMtca1lFTYCedrhTAv3nZVoSjrKQ+wkMmaERuCe57zkC5KSWFzLYkb5FVHW8Hrr+PX1DDwplQ==}
dependencies:
'@supabase/node-fetch': 2.6.15
'@types/phoenix': 1.6.4
'@types/ws': 8.5.10
- ws: 8.16.0
+ ws: 8.17.0
transitivePeerDependencies:
- bufferutil
- utf-8-validate
@@ -1092,23 +1099,28 @@ packages:
'@supabase/node-fetch': 2.6.15
dev: false
- /@supabase/[email protected]:
- resolution: {integrity: sha512-WpiawHjseIRcCQTZbMJtHUSOepz5+M9qE1jP9BDmg8X7ehALFwgEkiKyHAu59qm/pKP2ryyQXLtu2XZNRbUarw==}
+ /@supabase/[email protected]:
+ resolution: {integrity: sha512-A+RV50mWNtyKo6M0u4G6AOqEifQD+MoOjZcpRkPMPpEAFgMsc2dt3kBlBlR/MgZizWQgUKhsvrwKk0efc8g6Ug==}
dependencies:
- '@supabase/functions-js': 2.1.5
- '@supabase/gotrue-js': 2.62.2
+ '@supabase/auth-js': 2.64.2
+ '@supabase/functions-js': 2.3.1
'@supabase/node-fetch': 2.6.15
- '@supabase/postgrest-js': 1.9.2
- '@supabase/realtime-js': 2.9.3
+ '@supabase/postgrest-js': 1.15.2
+ '@supabase/realtime-js': 2.9.5
'@supabase/storage-js': 2.5.5
transitivePeerDependencies:
- bufferutil
- utf-8-validate
dev: false
- resolution: {integrity: sha512-E4KcWTpoLHqwPHLxidpOqQbcrZVgi0rsmmZXUle1jXmJfuIf/UWpczUJ7MZZ5tlxytgJXyp0w4PGkkeLiuIdZw==}
+ resolution: {integrity: sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==}
+ dev: false
+
+ resolution: {integrity: sha512-KGYxvIOXcceOAbEk4bi/dVLEK9z8sZ0uBB3Il5b1rhfClSpcX0yfRO0KmTkqR2cnQDymwLB+25ZyMzICg/cm/A==}
dependencies:
+ '@swc/counter': 0.1.3
tslib: 2.6.2
dev: false
@@ -1539,8 +1551,8 @@ packages:
engines: {node: '>=4'}
dev: true
- resolution: {integrity: sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==}
+ resolution: {integrity: sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==}
dependencies:
follow-redirects: 1.15.6
form-data: 4.0.0
@@ -1637,6 +1649,10 @@ packages:
resolution: {integrity: sha512-7LjJvmQU6Sj7bL0j5b5WY/3n7utXUJvAe1lxhsHDbLmwX9mdL86Yjtr+5SRCyf8qME4M7pU2hswj0FpyBVCv9w==}
dev: false
+ resolution: {integrity: sha512-RHVYKov7IcdNjVHJFNY/78RdG4oGVjbayxv8u5IO74Wv7Hlq4PnJE6mo/OjFijjVFNy5ijnCt6H3IIo4t+wfEw==}
+ dev: false
+
resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==}
engines: {node: '>=4'}
@@ -1792,8 +1808,8 @@ packages:
resolution: {integrity: sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==}
dev: true
- resolution: {integrity: sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==}
+ resolution: {integrity: sha512-okzr3f11N6WuqYtZSvm+F776mB41wRZMhKP+hc34YdW+KmtYYK9iqvHSwo2k9FEH3fhGXvOPV6yz2IcSrfRUDg==}
dev: false
@@ -1900,8 +1916,8 @@ packages:
path-type: 4.0.0
dev: true
- resolution: {integrity: sha512-i+hXn5HFwpPOwe8JcvjjQYuUVt0p46Ybi+73g9L43zQUKR6zMyaUAKFwGBMH3NWQDugRWIwxg2+FvvxCv0IG7Q==}
+ resolution: {integrity: sha512-h1ErTglQAVv2gCnOpD3sFS6uolDbOKHDU1BZq+Kl3npPqroU3dYL42lUgMfd5UimlwtRgp7C9dLGwqQ5D2HYgQ==}
engines: {node: '>=16'}
dev: false
@@ -1954,26 +1970,26 @@ packages:
tape: 4.17.0
dev: false
- resolution: {integrity: sha512-RHe1GKLulOW8EDN+cJgbFbVVfRXcaLT2/89dyVw3ONGgVpZjD19wB87I1LUZ1aCzOSrTccx0PFSQanK4OOfGPA==}
+ resolution: {integrity: sha512-3NlOmBmRhaGhtI0It9243yg9fz2wPRML5gGLDIE69Oyb/CuGsJnxpcgG74j905NQBDgReTEfFJwzOtIFAjeBfg==}
peerDependencies:
react: ^16.8.0 || ^17.0.1 || ^18.0.0
dependencies:
- embla-carousel: 8.0.2
- embla-carousel-reactive-utils: 8.0.2([email protected])
+ embla-carousel: 8.0.4
+ embla-carousel-reactive-utils: 8.0.4([email protected])
react: 18.2.0
dev: false
- resolution: {integrity: sha512-nLZqDkQdO0hvOP49/dUwjkkepMnUXgIzhyRuDjwGqswpB4Ibnc5M+w7rSQQAM+uMj0cPaXnYOTlv8XD7I/zVNw==}
+ resolution: {integrity: sha512-7lWM+8hanIF2roTAjxwfqfr0+VTbr9rYVlAs0r5PwPOVpz1G3/+bRelgAYvwcfWVm5Vydo2pKXVfFOPQjznF7w==}
peerDependencies:
- embla-carousel: 8.0.2
+ embla-carousel: 8.0.4
dependencies:
- embla-carousel: 8.0.2
+ embla-carousel: 8.0.4
dev: false
- resolution: {integrity: sha512-bogsDO8xosuh/l3PxIvA5AMl3+BnRVAse9sDW/60amzj4MbGS5re4WH5eVEXiuH8G1/3G7QUAX2QNr3Yx8z5rA==}
+ resolution: {integrity: sha512-INndmilrV9KY4Wnb4F2tI55DuQnFjf3GPOaPDT2LGYiKhIWVNUhv1nz/RI7CZ6WoIZ8MYHP4t6Qm/cqpcGHknA==}
dev: false
@@ -3093,12 +3109,12 @@ packages:
engines: {node: '>=4'}
hasBin: true
- resolution: {integrity: sha512-1Y4upYpzhoweEMkFDogMU8fKLCs+ciNKviTotrrMZ8duqlycERcB38GYXpu4xcwm6YBn86cTXd7za2yUl0GAkg==}
+ resolution: {integrity: sha512-KgAtAXTQopRwe90gh8SgjRSxgt9bUWbGAPMo9W0TZLA8SqiQH7khtagFfeEUjG3NBPwJu/+9uX5pMvunKaPvrQ==}
engines: {node: '>= 16'}
dependencies:
deeks: 3.1.0
- doc-path: 4.1.0
+ doc-path: 4.1.1
dev: false
@@ -3426,8 +3442,8 @@ packages:
isarray: 2.0.5
dev: false
- resolution: {integrity: sha512-VabVvHvQ9QmMwXu4du008ZDuyLnHs9j7ThVFsiJoXSOQk18+LF89N4ADzPbFenm0W4V2bGHnFBztIRQTgBfxzw==}
+ resolution: {integrity: sha512-goSDElNqFfw7iDHMg8WDATkfcyeLTNpBHQpO8incK6p5qZt5G/1j41X0xdGzpIkGojGXM+QiRQyLjnfDVvrpwA==}
dev: false
@@ -3455,40 +3471,43 @@ packages:
resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==}
dev: true
- resolution: {integrity: sha512-wlzrsbfeSU48YQBjZhDzOwhWhGsy+uQycR8bHAOt1LY1bn3zZEcDyHQOEoN3aWzQ8LHCAJ1nqrWCc9XF2+O45Q==}
+ resolution: {integrity: sha512-dowFkFTR8v79NPJO4QsBUtxv0g9BrS/phluVpMAt2ku7H+cbcBJlopXjkWlwxrk/xGqMemr7JkGPGemPrLLX7A==}
engines: {node: '>=18.17.0'}
hasBin: true
peerDependencies:
'@opentelemetry/api': ^1.1.0
+ '@playwright/test': ^1.41.2
react: ^18.2.0
react-dom: ^18.2.0
sass: ^1.3.0
peerDependenciesMeta:
'@opentelemetry/api':
optional: true
+ '@playwright/test':
+ optional: true
sass:
optional: true
dependencies:
- '@next/env': 14.1.0
- '@swc/helpers': 0.5.2
+ '@next/env': 14.2.3
+ '@swc/helpers': 0.5.5
busboy: 1.6.0
- caniuse-lite: 1.0.30001597
+ caniuse-lite: 1.0.30001616
graceful-fs: 4.2.11
postcss: 8.4.31
react: 18.2.0
react-dom: 18.2.0([email protected])
styled-jsx: 5.1.1(@babel/[email protected])([email protected])
optionalDependencies:
- '@next/swc-darwin-arm64': 14.1.0
- '@next/swc-darwin-x64': 14.1.0
- '@next/swc-linux-arm64-gnu': 14.1.0
- '@next/swc-linux-arm64-musl': 14.1.0
- '@next/swc-linux-x64-gnu': 14.1.0
- '@next/swc-linux-x64-musl': 14.1.0
- '@next/swc-win32-arm64-msvc': 14.1.0
- '@next/swc-win32-ia32-msvc': 14.1.0
- '@next/swc-win32-x64-msvc': 14.1.0
+ '@next/swc-darwin-arm64': 14.2.3
+ '@next/swc-darwin-x64': 14.2.3
+ '@next/swc-linux-arm64-gnu': 14.2.3
+ '@next/swc-linux-arm64-musl': 14.2.3
+ '@next/swc-linux-x64-gnu': 14.2.3
+ '@next/swc-linux-x64-musl': 14.2.3
+ '@next/swc-win32-arm64-msvc': 14.2.3
+ '@next/swc-win32-ia32-msvc': 14.2.3
+ '@next/swc-win32-x64-msvc': 14.2.3
transitivePeerDependencies:
- '@babel/core'
- babel-plugin-macros
@@ -3695,7 +3714,7 @@ packages:
dependencies:
nanoid: 3.3.7
picocolors: 1.0.0
- source-map-js: 1.0.2
+ source-map-js: 1.2.0
dev: false
@@ -3819,8 +3838,8 @@ packages:
- csstype
dev: false
- resolution: {integrity: sha512-WqLZJ4bLzlhmsvme6iFdgO8gfZP17rfjYEJ2m9RsZjZ+cc4k1hTzknEz63YS1MeT50kVzoa1Nz36f4BEx+Wigw==}
+ resolution: {integrity: sha512-n52Y7Eb4MgQZHsSZOhSXv1zs2668/hBYKfSRIvKh42yExjyhZu0d1IK2CLLZ3BZB1oo13lDfwx2vOh2z9FTV6Q==}
peerDependencies:
react: '*'
dependencies:
@@ -3851,8 +3870,8 @@ packages:
react: 18.2.0
dev: false
- resolution: {integrity: sha512-maGHWmOvwYzyeRIpL0YC6drWqYaX6iFqjisdJXpZ+HzEtSEJsL6nqw4azTpF5Sm6SAvwUeAr7JY924Ebqq8EdA==}
+ resolution: {integrity: sha512-2hHN5mbLuCDUx19bv0Q8wet67QqYK6xmtLQeY5xx+h7UXiMmRtaCwqko4mMPoKXLc6xAzwRrutg8XbTRlsfjRg==}
peerDependencies:
react: ^0.14 || ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0
react-dom: ^0.14 || ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0
@@ -3878,8 +3897,8 @@ packages:
tslib: 2.6.2
dev: false
- resolution: {integrity: sha512-FnrTWO4L7/Bhhf3CYBNArEG/yROV0tKmTv7/3h9QCFvH6sndeFf1wPqOcbFVu5VAulS5dV1wGT3GZZ/1GawqiA==}
+ resolution: {integrity: sha512-bvHCLBrFfM2OgcrpPY2YW84sPdS2o2HKWJUf1xGyGLnSoEnOTOBpahIarjRuYtN0ryahCeP242yf+5TrBX/pZA==}
engines: {node: '>=10'}
peerDependencies:
'@types/react': ^16.8.0 || ^17.0.0 || ^18.0.0
@@ -3893,7 +3912,7 @@ packages:
react-remove-scroll-bar: 2.3.6(@types/[email protected])([email protected])
react-style-singleton: 2.2.1(@types/[email protected])([email protected])
tslib: 2.6.2
- use-callback-ref: 1.3.1(@types/[email protected])([email protected])
+ use-callback-ref: 1.3.2(@types/[email protected])([email protected])
use-sidecar: 1.1.2(@types/[email protected])([email protected])
dev: false
@@ -3920,7 +3939,7 @@ packages:
peerDependencies:
react: ^16.8.0 || ^17.0.0 || ^18.0.0
dependencies:
- '@babel/runtime': 7.24.0
+ '@babel/runtime': 7.24.5
react: 18.2.0
use-composed-ref: 1.3.0([email protected])
use-latest: 1.2.1(@types/[email protected])([email protected])
@@ -4185,8 +4204,8 @@ packages:
engines: {node: '>=8'}
dev: true
- resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==}
+ resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==}
engines: {node: '>=0.10.0'}
dev: false
@@ -4289,15 +4308,15 @@ packages:
engines: {node: '>=8'}
dev: true
- resolution: {integrity: sha512-PQ6Dn+QxlWyEGCKDS71NGsXoVLKfE1c3vApkvDYS5KAK+V8fNWGhbSUEo9Gg2iaID2tjLXegEW3bZDUGpofRWw==}
+ resolution: {integrity: sha512-aBOqs0uMsYufFXSE4q6cA6Ty1fwZuMk4BJRHfiGSna59F1otnxiDelwhN4fEwmBtIymmF0ZqXHnpSigr2ps9Cg==}
engines: {node: '>= 16'}
peerDependencies:
react: '>= 16.8.0'
react-dom: '>= 16.8.0'
dependencies:
'@emotion/is-prop-valid': 1.2.1
- '@emotion/unitless': 0.8.0
+ '@emotion/unitless': 0.8.1
'@types/stylis': 4.2.0
css-to-react-native: 3.2.0
csstype: 3.1.2
@@ -4493,8 +4512,8 @@ packages:
engines: {node: '>=8'}
dev: false
- resolution: {integrity: sha512-5Y2/pp2wtJk8o08G0CMkuFPCO354FGwk/vbidxrdhRGZfd0tFnb4Qb8anp9XxXriwBgVPjdWbKpGl4J9lJY2jQ==}
+ resolution: {integrity: sha512-+suCYpfJLAe4OXS6+PPXjW3urOS4IoP9waSiLuXfLgqZODKw/aWwASvzqE886wA0kQgGy0mIWyhd87VpqIy6Xg==}
engines: {node: '>=16'}
dev: false
@@ -4602,8 +4621,8 @@ packages:
react: 18.2.0
dev: false
- resolution: {integrity: sha512-Lg4Vx1XZQauB42Hw3kK7JM6yjVjgFmFC5/Ab797s79aARomD2nEErc4mCgM8EZrARLmmbWpi5DGCadmK50DcAQ==}
+ resolution: {integrity: sha512-elOQwe6Q8gqZgDA8mrh44qRTQqpIHDcZ3hXTLjBe1i4ph8XpNJnO+aQf3NaG+lriLopI4HMx9VjQLfPQ6vhnoA==}
engines: {node: '>=10'}
peerDependencies:
'@types/react': ^16.8.0 || ^17.0.0 || ^18.0.0
@@ -4830,8 +4849,8 @@ packages:
optional: true
dev: true
- resolution: {integrity: sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==}
+ resolution: {integrity: sha512-uJq6108EgZMAl20KagGkzCKfMEjxmKvZHG7Tlq0Z6nOky7YF7aq4mOx6xK8TJ/i1LeK4Qus7INktacctDgY8Ow==}
engines: {node: '>=10.0.0'}
peerDependencies:
bufferutil: ^4.0.1
diff --git a/src/containers/Modals/CloudModal/index.tsx b/src/containers/Modals/CloudModal/index.tsx
index b13654ec..4bc368d4 100644
--- a/src/containers/Modals/CloudModal/index.tsx
+++ b/src/containers/Modals/CloudModal/index.tsx
@@ -1,10 +1,8 @@
import React from "react";
-import Link from "next/link";
import { useRouter } from "next/router";
import {
Modal,
Text,
- Divider,
ScrollArea,
ModalProps,
Table,
@@ -13,23 +11,24 @@ import {
Paper,
Flex,
DefaultMantineColor,
- Input,
Button,
Group,
Stack,
RingProgress,
- UnstyledButton,
Drawer,
LoadingOverlay,
+ Menu,
+ TextInput,
} from "@mantine/core";
+import { useDebouncedValue } from "@mantine/hooks";
import { useQuery } from "@tanstack/react-query";
import dayjs from "dayjs";
import relativeTime from "dayjs/plugin/relativeTime";
import toast from "react-hot-toast";
-import { AiOutlineLink } from "react-icons/ai";
+import { BiSearch, BiSolidFolderOpen, BiText } from "react-icons/bi";
import { FaTrash } from "react-icons/fa";
-import { MdFileOpen } from "react-icons/md";
-import { VscAdd, VscEdit, VscLock, VscUnlock } from "react-icons/vsc";
+import { SlOptionsVertical } from "react-icons/sl";
+import { VscAdd } from "react-icons/vsc";
import { FileFormat } from "src/enums/file.enum";
import { documentSvc } from "src/services/document.service";
import useFile, { File } from "src/store/useFile";
@@ -50,29 +49,37 @@ const UpdateNameModal: React.FC<{
refetch: () => void;
}> = ({ file, onClose, refetch }) => {
const [name, setName] = React.useState("");
- const onSubmit = () => {
- if (!file) return;
- toast
- .promise(documentSvc.update(file.id, { name }), {
- loading: "Updating document...",
- error: "Error occurred while updating document!",
- success: `Renamed document to ${name}`,
- })
- .then(() => {
- refetch();
- setName("");
- });
- onClose();
+ React.useEffect(() => {
+ if (file?.name) setName(file.name);
+ }, [file?.name]);
+
+ const onSubmit = async () => {
+ try {
+ if (!file) return;
+
+ toast.loading("Updating document...", { id: "update-document" });
+ await documentSvc.update(file.id, { name });
+
+ refetch();
+ setName("");
+ toast.dismiss("update-document");
+ } catch (error) {
+ toast.error("An error occurred while updating the document!", { id: "update-document" });
+ } finally {
+ onClose();
+ }
};
return (
- <Modal title="Update Document name" opened={!!file} onClose={onClose} centered zIndex={202}>
+ <Modal title="Update document name" opened={!!file} onClose={onClose} centered zIndex={202}>
<Stack>
- <Input
+ <TextInput
value={name}
- placeholder={file?.name}
+ placeholder="File name"
onChange={e => setName(e.currentTarget.value)}
+ autoFocus
+ data-autofocus
/>
<Group justify="right">
<Button variant="outline" onClick={onClose}>
@@ -88,15 +95,17 @@ const UpdateNameModal: React.FC<{
const TOTAL_QUOTA = 25;
export const CloudModal: React.FC<ModalProps> = ({ opened, onClose }) => {
- const getContents = useFile(state => state.getContents);
- const setHasChanges = useFile(state => state.setHasChanges);
- const getFormat = useFile(state => state.getFormat);
+ const setFile = useFile(state => state.setFile);
const [currentFile, setCurrentFile] = React.useState<File | null>(null);
- const { isReady, query, replace } = useRouter();
+ const [searchValue, setSearchValue] = React.useState("");
+ const [debouncedSearchValue] = useDebouncedValue(searchValue, 1000);
+ const { isReady, replace } = useRouter();
- const { data, isLoading, refetch } = useQuery(["allJson", query], () => documentSvc.getAll(), {
- enabled: isReady && opened,
- });
+ const { data, isLoading, refetch } = useQuery(
+ ["allJson", debouncedSearchValue],
+ () => documentSvc.getAll(debouncedSearchValue),
+ { enabled: isReady && opened }
+ );
const isCreateDisabled = React.useMemo(() => {
if (!data?.length) return false;
@@ -104,24 +113,25 @@ export const CloudModal: React.FC<ModalProps> = ({ opened, onClose }) => {
}, [data?.length]);
const onCreate = async () => {
- try {
- toast.loading("Saving document...", { id: "fileSave" });
- const { data, error } = await documentSvc.upsert({
- contents: getContents(),
- format: getFormat(),
- });
+ replace({ query: undefined });
+ onClose();
+ };
- if (error) throw error;
+ const openFile = React.useCallback(
+ async (id: string) => {
+ try {
+ const { data, error } = await documentSvc.getById(id);
+ if (error) throw new Error(error.message);
- toast.success("Document saved to cloud", { id: "fileSave" });
- setHasChanges(false);
- replace({ query: { json: data } });
- onClose();
- } catch (error: any) {
- toast.error("Failed to save document!", { id: "fileSave" });
- console.error(error);
- }
- };
+ if (data[0]) setFile(data[0]);
+ } catch (error) {
+ if (error instanceof Error) toast.error(error.message);
+ } finally {
+ onClose();
+ }
+ },
+ [onClose, setFile]
+ );
const onDeleteClick = React.useCallback(
(file: File) => {
@@ -136,74 +146,64 @@ export const CloudModal: React.FC<ModalProps> = ({ opened, onClose }) => {
[refetch]
);
- const copyShareLink = React.useCallback((fileId: string) => {
- const shareLink = `${window.location.origin}/editor?json=${fileId}`;
- navigator.clipboard.writeText(shareLink);
- toast.success("Copied share link to clipboard!");
- }, []);
-
const rows = React.useMemo(
() =>
data?.map(element => (
- <Table.Tr key={element.id}>
- <Table.Td>
- <Flex align="center" gap="xs">
- {element.private ? <VscLock /> : <VscUnlock />}
- {element.id}
- </Flex>
- </Table.Td>
- <Table.Td>
- <Flex align="center" justify="space-between">
- {element.name}
- <ActionIcon
- variant="transparent"
- color="cyan"
- onClick={() => setCurrentFile(element)}
- >
- <VscEdit />
- </ActionIcon>
- </Flex>
- </Table.Td>
- <Table.Td>{dayjs(element.created_at).format("DD.MM.YYYY")}</Table.Td>
+ <Table.Tr
+ key={element.id}
+ onClick={() => openFile(element.id)}
+ style={{ cursor: "pointer" }}
+ >
<Table.Td>
- <Badge variant="light" color={colorByFormat[element.format]} size="sm">
+ <Badge
+ variant="transparent"
+ color={colorByFormat[element.format]}
+ size="sm"
+ radius="xs"
+ >
{element.format.toUpperCase()}
</Badge>
</Table.Td>
- <Table.Td>{element.views.toLocaleString("en-US")}</Table.Td>
- <Table.Td>
+ <Table.Td>{element.name}</Table.Td>
+ <Table.Td>{dayjs(element.updated_at).format("DD MMM YYYY")}</Table.Td>
+ <Table.Td onClick={e => e.stopPropagation()}>
<Flex gap="xs">
- <ActionIcon.Group>
- <ActionIcon
- variant="transparent"
- component={Link}
- href={`?json=${element.id}`}
- prefetch={false}
- color="blue"
- onClick={onClose}
- >
- <MdFileOpen size="18" />
- </ActionIcon>
- <ActionIcon
- variant="transparent"
- color="red"
- onClick={() => onDeleteClick(element)}
- >
- <FaTrash size="18" />
- </ActionIcon>
- <ActionIcon
- variant="transparent"
- color="green"
- onClick={() => copyShareLink(element.id)}
- >
- <AiOutlineLink />
- </ActionIcon>
- </ActionIcon.Group>
+ <Menu width={150} position="bottom" withArrow shadow="md">
+ <Menu.Target>
+ <ActionIcon variant="subtle" color="gray">
+ <SlOptionsVertical />
+ </ActionIcon>
+ </Menu.Target>
+ <Menu.Dropdown>
+ <Menu.Item
+ fz="xs"
+ onClick={() => openFile(element.id)}
+ leftSection={<BiSolidFolderOpen />}
+ >
+ Open
+ </Menu.Item>
+ <Menu.Item
+ fz="xs"
+ leftSection={<BiText />}
+ onClick={() => setCurrentFile(element)}
+ >
+ Rename File
+ </Menu.Item>
+ <Menu.Divider />
+ <Menu.Item
+ fz="xs"
+ onClick={() => onDeleteClick(element)}
+ leftSection={<FaTrash />}
+ >
+ Delete
+ </Menu.Item>
+ </Menu.Dropdown>
+ </Menu>
</Flex>
</Table.Td>
</Table.Tr>
)),
- [data, copyShareLink, onClose, onDeleteClick]
+ [data, onDeleteClick, openFile]
);
return (
@@ -212,82 +212,67 @@ export const CloudModal: React.FC<ModalProps> = ({ opened, onClose }) => {
opened={opened}
size="xl"
onClose={onClose}
- transitionProps={{ duration: 300, timingFunction: "ease", transition: "slide-right" }}
+ transitionProps={{ duration: 300, timingFunction: "ease", transition: "slide-left" }}
pos="relative"
+ position="right"
>
- <LoadingOverlay visible={isLoading} />
- {data && (
- <Flex gap="md">
- <Paper my="lg" withBorder radius="md" p="xs" w="100%">
- <Group>
- <RingProgress
- size={40}
- roundCaps
- thickness={6}
- sections={[
- {
- value: (data.length * 100) / TOTAL_QUOTA,
- color: data.length > TOTAL_QUOTA / 1.5 ? "red" : "blue",
- },
- ]}
- />
- <div>
- <Text c="dimmed" fz="xs" fw={700} style={{ textTransform: "uppercase" }}>
- Total Quota
- </Text>
- <Text fw={700} size="lg">
- {data.length} / {TOTAL_QUOTA}
- </Text>
- </div>
- </Group>
- </Paper>
- <Paper my="lg" withBorder radius="md" p="xs" w={250}>
- <UnstyledButton
- fw="bold"
- w="100%"
- h="100%"
- onClick={onCreate}
- disabled={isCreateDisabled}
- >
- <Text
- fz="sm"
- fw="bold"
- c="blue"
- style={{
- display: "flex",
- alignItems: "center",
- justifyContent: "space-between",
- textAlign: "center",
- }}
- >
- <VscAdd size="18" strokeWidth={1} />
- Create New Document
- </Text>
- </UnstyledButton>
- </Paper>
- </Flex>
- )}
<Text fz="xs" pb="lg">
The Cloud Save feature is primarily designed for convenient access and is not advisable for
storing sensitive data.
</Text>
- <Divider py="xs" />
<Paper>
- <ScrollArea h="100%" offsetScrollbars>
- <Table fz="xs" verticalSpacing="xs" striped withTableBorder>
+ <TextInput
+ value={searchValue}
+ onChange={e => setSearchValue(e.currentTarget.value)}
+ size="xs"
+ mb="sm"
+ placeholder="Search"
+ leftSection={<BiSearch />}
+ />
+ <ScrollArea h="calc(100vh - 220px)" offsetScrollbars>
+ <LoadingOverlay visible={isLoading} />
+ <Table fz="xs" verticalSpacing="xs" highlightOnHover>
<Table.Thead>
<Table.Tr>
- <Table.Th>ID</Table.Th>
- <Table.Th>Name</Table.Th>
- <Table.Th>Create Date</Table.Th>
<Table.Th>Format</Table.Th>
- <Table.Th>Views</Table.Th>
- <Table.Th>Actions</Table.Th>
+ <Table.Th>Name</Table.Th>
+ <Table.Th>Last opened date</Table.Th>
</Table.Tr>
</Table.Thead>
<Table.Tbody>{rows}</Table.Tbody>
</Table>
</ScrollArea>
+ {data && (
+ <Flex py="lg" gap="md">
+ <Button
+ size="compact-xs"
+ leftSection={<VscAdd />}
+ disabled={isCreateDisabled}
+ onClick={onCreate}
+ variant="outline"
+ >
+ Open New
+ </Button>
+ <Flex align="center" gap="xs">
+ <RingProgress
+ size={20}
+ roundCaps
+ thickness={3}
+ sections={[
+ {
+ value: (data.length * 100) / TOTAL_QUOTA,
+ color: data.length > TOTAL_QUOTA / 1.5 ? "red" : "blue",
+ },
+ ]}
+ />
+ <div>
+ <Text fw={700} size="xs">
+ {data.length} / {TOTAL_QUOTA}
+ </Text>
+ </div>
+ </Flex>
+ </Flex>
+ )}
</Paper>
<UpdateNameModal file={currentFile} onClose={() => setCurrentFile(null)} refetch={refetch} />
</Drawer>
diff --git a/src/containers/Modals/ImportModal/index.tsx b/src/containers/Modals/ImportModal/index.tsx
index 8dc8764d..bd4b85e6 100644
--- a/src/containers/Modals/ImportModal/index.tsx
+++ b/src/containers/Modals/ImportModal/index.tsx
@@ -88,7 +88,7 @@ export const ImportModal: React.FC<ModalProps> = ({ opened, onClose }) => {
<AiOutlineUpload size={48} />
<Text fw="bold">Drop here or click to upload files</Text>
<Text c="dimmed" fz="xs">
- (Max 500 Kb)
+ (Max 500 KB)
</Text>
<Text c="dimmed" fz="sm">
{file?.name ?? "None"}
diff --git a/src/containers/Modals/TypeModal/index.tsx b/src/containers/Modals/TypeModal/index.tsx
index 64ca6f3c..baa14795 100644
--- a/src/containers/Modals/TypeModal/index.tsx
+++ b/src/containers/Modals/TypeModal/index.tsx
@@ -1,5 +1,5 @@
import React from "react";
-import { Stack, Modal, ModalProps, Select, LoadingOverlay } from "@mantine/core";
+import { Stack, Modal, ModalProps, Select, ScrollArea } from "@mantine/core";
import { CodeHighlight } from "@mantine/code-highlight";
import useJson from "src/store/useJson";
@@ -49,56 +49,62 @@ export const TypeModal: React.FC<ModalProps> = ({ opened, onClose }) => {
const getJson = useJson(state => state.getJson);
const [type, setType] = React.useState("");
const [selectedType, setSelectedType] = React.useState<Language>(Language.TypeScript);
- const [loading, setLoading] = React.useState(false);
const editorLanguage = React.useMemo(() => {
return typeOptions[typeOptions.findIndex(o => o.value === selectedType)]?.lang;
}, [selectedType]);
+ const transformer = React.useCallback(
+ async ({ value }) => {
+ const { run } = await import("json_typegen_wasm");
+ return run(
+ "Root",
+ value,
+ JSON.stringify({
+ output_mode: selectedType,
+ })
+ );
+ },
+ [selectedType]
+ );
+
React.useEffect(() => {
if (opened) {
- (async () => {
- try {
- setLoading(true);
- const json = getJson();
-
- if (selectedType === Language.Go) {
- const jtg = await import("src/lib/utils/json2go");
- const gofmt = await import("gofmt.js");
-
- const types = jtg.default(json);
- setType(gofmt.default(types.go));
- } else {
- const { run } = await import("json_typegen_wasm");
- const output_mode = selectedType;
- const types = run("Root", json, JSON.stringify({ output_mode }));
-
- setType(types);
- }
- } catch (error) {
- console.error(error);
- } finally {
- setLoading(false);
+ try {
+ if (selectedType === Language.Go) {
+ import("src/lib/utils/json2go").then(jtg => {
+ import("gofmt.js").then(gofmt => {
+ const types = jtg.default(getJson());
+ setType(gofmt.default(types.go));
+ });
+ });
+ } else {
+ transformer({ value: getJson() }).then(setType);
}
- })();
+ } catch (error) {
+ console.error(error);
+ }
}
- }, [getJson, opened, selectedType]);
+ }, [getJson, opened, selectedType, transformer]);
return (
- <Modal title="Generate Types" size="md" opened={opened} onClose={onClose} centered>
+ <Modal title="Generate Types" size="lg" opened={opened} onClose={onClose} centered>
<Stack pos="relative">
<Select
value={selectedType}
data={typeOptions}
onChange={e => setSelectedType(e as Language)}
+ allowDeselect={false}
/>
- <LoadingOverlay visible={loading} />
- <CodeHighlight
- language={editorLanguage}
- copyLabel="Copy to clipboard"
- copiedLabel="Copied to clipboard"
- code={type}
- />
+ <ScrollArea.Autosize mah={400} maw={700}>
+ <CodeHighlight
+ language={editorLanguage}
+ copyLabel="Copy to clipboard"
+ copiedLabel="Copied to clipboard"
+ code={type}
+ styles={{ root: { borderRadius: 6 } }}
+ />
+ </ScrollArea.Autosize>
</Stack>
</Modal>
);
diff --git a/src/services/document.service.ts b/src/services/document.service.ts
index 076a948b..78cd8979 100644
--- a/src/services/document.service.ts
+++ b/src/services/document.service.ts
@@ -23,7 +23,7 @@ export const documentSvc = {
getById: async (doc_id: string): Promise<PostgrestSingleResponse<File[]>> => {
return await supabase.rpc("get_document_by_id", { doc_id });
},
- getAll: async (): Promise<File[]> => {
+ getAll: async (searchText?: string): Promise<File[]> => {
const userEmail = useUser.getState().user?.email;
if (!userEmail) return [];
@@ -31,6 +31,7 @@ export const documentSvc = {
.from("document")
.select()
.eq("owner_email", userEmail)
+ .ilike("name", `%${searchText}%`)
.order("created_at", { ascending: false });
if (error) {