Skip to content

Commit

Permalink
fix: 화살표 로직 일부 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Ludovico7 committed Nov 12, 2024
1 parent 6b1fb9b commit 6c8fa35
Show file tree
Hide file tree
Showing 19 changed files with 90 additions and 2 deletions.
1 change: 1 addition & 0 deletions @noctaCrdt/dist/Crdt.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//# sourceMappingURL=Crdt.d.ts.map
1 change: 1 addition & 0 deletions @noctaCrdt/dist/Crdt.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions @noctaCrdt/dist/Crdt.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions @noctaCrdt/dist/Crdt.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions @noctaCrdt/dist/Interfaces.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//# sourceMappingURL=Interfaces.d.ts.map
1 change: 1 addition & 0 deletions @noctaCrdt/dist/Interfaces.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions @noctaCrdt/dist/Interfaces.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions @noctaCrdt/dist/Interfaces.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions @noctaCrdt/dist/LinkedList.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//# sourceMappingURL=LinkedList.d.ts.map
1 change: 1 addition & 0 deletions @noctaCrdt/dist/LinkedList.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions @noctaCrdt/dist/LinkedList.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions @noctaCrdt/dist/LinkedList.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions @noctaCrdt/dist/Node.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//# sourceMappingURL=Node.d.ts.map
1 change: 1 addition & 0 deletions @noctaCrdt/dist/Node.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions @noctaCrdt/dist/Node.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions @noctaCrdt/dist/Node.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions @noctaCrdt/dist/tsconfig.tsbuildinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"program":{"fileNames":["../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.dom.iterable.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.scripthost.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2017.date.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.decorators.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2021.full.d.ts","../crdt.ts","../interfaces.ts","../linkedlist.ts","../node.ts"],"fileInfos":[{"version":"f33e5332b24c3773e930e212cbb8b6867c8ba3ec4492064ea78e55a524d57450","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","26f2f787e82c4222710f3b676b4d83eb5ad0a72fa7b746f03449e7a026ce5073","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569",{"version":"21e41a76098aa7a191028256e52a726baafd45a925ea5cf0222eb430c96c1d83","affectsGlobalScope":true},{"version":"35299ae4a62086698444a5aaee27fc7aa377c68cbb90b441c9ace246ffd05c97","affectsGlobalScope":true},{"version":"80e18897e5884b6723488d4f5652167e7bb5024f946743134ecc4aa4ee731f89","affectsGlobalScope":true},{"version":"cd034f499c6cdca722b60c04b5b1b78e058487a7085a8e0d6fb50809947ee573","affectsGlobalScope":true},{"version":"138fb588d26538783b78d1e3b2c2cc12d55840b97bf5e08bca7f7a174fbe2f17","affectsGlobalScope":true},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"bc47685641087c015972a3f072480889f0d6c65515f12bd85222f49a98952ed7","affectsGlobalScope":true},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"6fc23bb8c3965964be8c597310a2878b53a0306edb71d4b5a4dfe760186bcc01","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"bb42a7797d996412ecdc5b2787720de477103a0b2e53058569069a0e2bae6c7e","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"b541a838a13f9234aba650a825393ffc2292dc0fc87681a5d81ef0c96d281e7a","affectsGlobalScope":true},{"version":"e0275cd0e42990dc3a16f0b7c8bca3efe87f1c8ad404f80c6db1c7c0b828c59f","affectsGlobalScope":true},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"49ed889be54031e1044af0ad2c603d627b8bda8b50c1a68435fe85583901d072","affectsGlobalScope":true},{"version":"e93d098658ce4f0c8a0779e6cab91d0259efb88a318137f686ad76f8410ca270","affectsGlobalScope":true},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"acae90d417bee324b1372813b5a00829d31c7eb670d299cd7f8f9a648ac05688","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"51e547984877a62227042850456de71a5c45e7fe86b7c975c6e68896c86fa23b","affectsGlobalScope":true},{"version":"62a4966981264d1f04c44eb0f4b5bdc3d81c1a54725608861e44755aa24ad6a5","affectsGlobalScope":true},{"version":"33358442698bb565130f52ba79bfd3d4d484ac85fe33f3cb1759c54d18201393","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},"c1e8d979afc15d66e2bd5a58c732d5a2ba3ccaae41ac7d5a2c539e6de66a8e51","e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"],"root":[[54,57]],"options":{"allowSyntheticDefaultImports":true,"composite":true,"declaration":true,"declarationMap":true,"emitDecoratorMetadata":true,"experimentalDecorators":true,"module":99,"outDir":"./","removeComments":true,"rootDir":"..","skipLibCheck":true,"sourceMap":true,"strict":true,"target":8},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[54,55,56,57,51,52,9,10,14,13,2,15,16,17,18,19,20,21,22,3,4,23,27,24,25,26,28,29,30,5,31,32,33,34,6,38,35,36,37,39,7,40,45,46,41,42,43,44,8,53,50,47,48,49,1,12,11],"latestChangedDtsFile":"./Node.d.ts"},"version":"5.3.3"}
69 changes: 68 additions & 1 deletion client/src/hooks/useMarkdownGrammer/handlers/arrow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,72 @@ export const useArrowKeyHandler = ({
if (!currentNode) return;

let targetNode: EditorNode | null = null;

switch (e.key) {
case "ArrowUp":
if (currentNode.parentNode?.type === "checkbox") {
if (currentNode.parentNode.prevNode) {
if (currentNode.parentNode.prevNode.type === "checkbox") {
targetNode = currentNode.parentNode.prevNode.firstChild;
} else {
targetNode = currentNode.parentNode.prevNode;
}
}
} else if (currentNode.prevNode?.type === "ul" || currentNode.prevNode?.type === "ol") {
targetNode = editorList.getLastChild(currentNode.prevNode);
} else if (currentNode.type === "li") {
if (currentNode.prevSibling?.id) {
targetNode = currentNode.prevSibling;
} else {
if (currentNode.parentNode?.prevNode) {
if (currentNode.parentNode.prevNode.type === "checkbox") {
// 이전 블록이 체크박스인 경우 처리
targetNode = currentNode.parentNode.prevNode.firstChild;
} else {
targetNode = currentNode.parentNode.prevNode;
}
} else {
return;
}
}
} else {
targetNode = currentNode.prevNode;
}
break;

case "ArrowDown":
if (currentNode.parentNode?.type === "checkbox") {
if (currentNode.parentNode.nextNode) {
if (currentNode.parentNode.nextNode.type === "checkbox") {
targetNode = currentNode.parentNode.nextNode.firstChild;
} else {
targetNode = currentNode.parentNode.nextNode;
}
}
} else if (currentNode.nextNode?.type === "ul" || currentNode.nextNode?.type === "ol") {
targetNode = currentNode.nextNode.firstChild;
} else if (currentNode.type === "li") {
if (currentNode.nextSibling?.id) {
targetNode = currentNode.nextSibling;
} else {
if (currentNode.parentNode?.nextNode) {
if (currentNode.parentNode.nextNode.type === "checkbox") {
// 다음 블록이 체크박스인 경우 처리
targetNode = currentNode.parentNode.nextNode.firstChild;
} else {
targetNode = currentNode.parentNode.nextNode;
}
} else {
return;
}
}
} else {
targetNode = currentNode.nextNode;
}
break;
}

/*
switch (e.key) {
case "ArrowUp":
if (currentNode.parentNode?.type === "checkbox") {
Expand Down Expand Up @@ -47,6 +113,7 @@ export const useArrowKeyHandler = ({
targetNode = currentNode.parentNode.nextNode;
}
}
} else if (currentNode.nextNode?.type === "ul" || currentNode.nextNode?.type === "ol") {
targetNode = currentNode.nextNode!.firstChild;
} else if (currentNode.type === "li") {
Expand All @@ -62,7 +129,7 @@ export const useArrowKeyHandler = ({
}
break;
}

*/
if (targetNode) {
setEditorState((prev) => ({
...prev,
Expand Down
2 changes: 1 addition & 1 deletion client/tsconfig.tsbuildinfo

Large diffs are not rendered by default.

0 comments on commit 6c8fa35

Please sign in to comment.