diff --git a/package-lock.json b/package-lock.json index 05d91b5..b0fcfc6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "chai", - "version": "0.1.13", + "version": "0.1.14", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "chai", - "version": "0.1.13", + "version": "0.1.14", "dependencies": { "@ant-design/charts": "^2.1.1", "@ant-design/colors": "^7.0.2", @@ -31,7 +31,7 @@ "jotai-optics": "^0.4.0", "js-md5": "^0.8.3", "js-yaml": "4.1.0", - "libchai": "^0.1.13", + "libchai": "^0.1.14", "lodash-es": "^4.17.21", "mathjs": "^13.0.1", "nanoid": "^5.0.7", @@ -8163,9 +8163,9 @@ } }, "node_modules/libchai": { - "version": "0.1.13", - "resolved": "https://registry.npmjs.org/libchai/-/libchai-0.1.13.tgz", - "integrity": "sha512-O1tbmRH+OKFpfigiydDZ956GcZA83SO/TDtWHX7y9ht8eUBx51ujB6wqXQ/APOUIilhEVsyrCDB3s6J+BUot0Q==" + "version": "0.1.14", + "resolved": "https://registry.npmmirror.com/libchai/-/libchai-0.1.14.tgz", + "integrity": "sha512-QM7Yud0179PYWfwRZVa39qBu/DmsYpo6C00KqX6e/i1H4cMC/jBLZgrDvHJLf87dI6XXYzuRF+aFSpYLNhQENA==" }, "node_modules/lilconfig": { "version": "2.1.0", diff --git a/package.json b/package.json index 1d3b708..07fedb7 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "chai", "private": true, - "version": "0.1.13", + "version": "0.1.14", "type": "module", "scripts": { "start": "vite --mode CF", @@ -45,7 +45,7 @@ "jotai-optics": "^0.4.0", "js-md5": "^0.8.3", "js-yaml": "4.1.0", - "libchai": "^0.1.13", + "libchai": "^0.1.14", "lodash-es": "^4.17.21", "mathjs": "^13.0.1", "nanoid": "^5.0.7", diff --git a/src/components/Algebra.tsx b/src/components/Algebra.tsx index 4891f5a..28cf29c 100644 --- a/src/components/Algebra.tsx +++ b/src/components/Algebra.tsx @@ -6,10 +6,10 @@ import { ProFormText, } from "@ant-design/pro-components"; import { Button, Form, Space, notification } from "antd"; -import { CloseCircleOutlined, CopyOutlined } from "@ant-design/icons"; import type { Rule } from "~/lib"; import { algebraAtom, useAddAtom } from "~/atoms"; import { defaultAlgebra } from "~/lib"; +import { ArrowDownOutlined, ArrowUpOutlined } from "@ant-design/icons"; interface AlgebraForm { name: string; @@ -69,10 +69,32 @@ export default function Algebra({ { + return [ + ...defaultActionDom, + { + if (field.name === 0) { + action.move(field.name, count - 1); + } else { + action.move(field.name, field.name - 1); + } + }} + />, + { + if (field.name === count - 1) { + action.move(field.name, 0); + } else { + action.move(field.name, field.name + 1); + } + }} + />, + ]; }} > diff --git a/src/lib/assembly.ts b/src/lib/assembly.ts index 228a591..f3d36c4 100644 --- a/src/lib/assembly.ts +++ b/src/lib/assembly.ts @@ -337,8 +337,8 @@ export const assemble = ( const priorityMap = getPriorityMap(config.priority); return result.map((x) => { const hash = `${x.name}-${x.pinyin_list.join(",")}`; - const level = priorityMap.get(hash) ?? -1; - return { ...x, level }; + const level = priorityMap.get(hash); + return level !== undefined ? { ...x, level } : x; }); };