-
-
-
- { setFilterText(event.target.value); }}
- />
-
-
-
+ width: '65px',
+ maxWidth: '65px',
+ conditionalCellStyles: [
+ {
+ when: (cst: IConstituenta) => cst.id <= 0,
+ classNames: ['bg-[#ffc9c9]', 'dark:bg-[#592b2b]']
+ }
+ ]
+ },
+ {
+ name: 'Описание',
+ id: 'description',
+ selector: (cst: IConstituenta) => getCstDescription(cst),
+ minWidth: '350px',
+ wrap: true,
+ conditionalCellStyles: [
+ {
+ when: (cst: IConstituenta) => cst.id <= 0,
+ classNames: ['bg-[#ffc9c9]', 'dark:bg-[#592b2b]']
+ }
+ ]
+ },
+ {
+ name: 'Выражение',
+ id: 'expression',
+ selector: (cst: IConstituenta) => cst.definition?.formal ?? '',
+ minWidth: '200px',
+ hide: 1600,
+ grow: 2,
+ wrap: true,
+ conditionalCellStyles: [
+ {
+ when: (cst: IConstituenta) => cst.id <= 0,
+ classNames: ['bg-[#ffc9c9]', 'dark:bg-[#592b2b]']
+ }
+ ]
+ }
+ ], []);
+
+ const maxHeight = useMemo(
+ () => {
+ const siblingHeight = `${baseHeight} - ${LOCAL_NAVIGATION_H}`
+ return (noNavigation ?
+ `calc(min(100vh - 5.2rem, ${siblingHeight}))`
+ : `calc(min(100vh - 8.7rem, ${siblingHeight}))`);
+ }, [noNavigation, baseHeight]);
+
+ return (<>
+
+
+ setFilterText(event.target.value)}
+ />
+
+
+
- Список конституент пуст
- Измените параметры фильтра
- }
+ conditionalRowStyles={conditionalRowStyles}
+ noDataComponent={
+
+ Список конституент пуст
+ Измените параметры фильтра
+
+ }
striped
highlightOnHover
@@ -173,7 +187,7 @@ function ViewSideConstituents({ expression, activeID, onOpenEdit }: ViewSideCons
dense
/>
-);
+ >);
}
export default ViewSideConstituents;
diff --git a/rsconcept/frontend/src/utils/print-lezer-tree.ts b/rsconcept/frontend/src/utils/print-lezer-tree.ts
new file mode 100644
index 00000000..c47b5801
--- /dev/null
+++ b/rsconcept/frontend/src/utils/print-lezer-tree.ts
@@ -0,0 +1,60 @@
+import { NodeType, Tree, TreeCursor } from "@lezer/common"
+
+export type CursorNode = {
+ type: NodeType
+ from: number
+ to: number
+ isLeaf: boolean
+}
+
+function cursorNode({ type, from, to }: TreeCursor, isLeaf = false): CursorNode {
+ return { type, from, to, isLeaf }
+}
+
+type TreeTraversalOptions = {
+ beforeEnter?: (cursor: TreeCursor) => void
+ onEnter: (node: CursorNode) => false | void
+ onLeave?: (node: CursorNode) => false | void
+}
+
+export function traverseTree(tree: Tree, { beforeEnter, onEnter, onLeave, }: TreeTraversalOptions) {
+ const cursor = tree.cursor();
+ for (;;) {
+ let node = cursorNode(cursor)
+ let leave = false
+ const enter = !node.type.isAnonymous
+ if (enter && beforeEnter) beforeEnter(cursor)
+ node.isLeaf = !cursor.firstChild()
+ if (enter) {
+ leave = true
+ if (onEnter(node) === false) return
+ }
+ if (!node.isLeaf) continue
+ for (;;) {
+ node = cursorNode(cursor, node.isLeaf)
+ if (leave && onLeave) if (onLeave(node) === false) return;
+ leave = cursor.type.isAnonymous
+ node.isLeaf = false
+ if (cursor.nextSibling()) break;
+ if (!cursor.parent()) return;
+ leave = true
+ }
+ }
+}
+
+export function printTree(tree: Tree): string {
+ const state = {
+ output: "",
+ prefixes: [] as string[]
+ }
+ traverseTree(tree, {
+ onEnter: node => {
+ state.output += "[";
+ state.output += node.type.name;
+ },
+ onLeave: () => {
+ state.output += "]";
+ },
+ })
+ return state.output;
+}
diff --git a/rsconcept/frontend/tsconfig.node.json b/rsconcept/frontend/tsconfig.node.json
index 42872c59..364bc0ea 100644
--- a/rsconcept/frontend/tsconfig.node.json
+++ b/rsconcept/frontend/tsconfig.node.json
@@ -6,5 +6,5 @@
"moduleResolution": "bundler",
"allowSyntheticDefaultImports": true
},
- "include": ["vite.config.ts"]
+ "include": ["vite.config.ts", "package.json"]
}
diff --git a/rsconcept/frontend/vite.config.ts b/rsconcept/frontend/vite.config.ts
index aa93ddaa..8cc2b4a1 100644
--- a/rsconcept/frontend/vite.config.ts
+++ b/rsconcept/frontend/vite.config.ts
@@ -1,10 +1,33 @@
import react from '@vitejs/plugin-react';
import { defineConfig } from 'vite';
+import { dependencies } from './package.json'
+
+const exclVendors = ['react', 'react-router-dom', 'react-dom']
+function renderChunks(deps: Record
) {
+ const chunks = {}
+ Object.keys(deps).forEach((key) => {
+ if (exclVendors.includes(key)) return
+ chunks[key] = [key]
+ })
+ return chunks
+}
+
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
server: {
port: 3000
+ },
+ build: {
+ chunkSizeWarningLimit: 4000, // KB
+ sourcemap: false,
+ rollupOptions: {
+ output: {
+ manualChunks: {
+ ...renderChunks(dependencies),
+ },
+ },
+ },
}
})
diff --git a/updateProd.sh b/updateProd.sh
new file mode 100644
index 00000000..e7a4693e
--- /dev/null
+++ b/updateProd.sh
@@ -0,0 +1,3 @@
+git pull
+docker compose -f "docker-compose-prod.yml" up --build -d
+docker image prune -f
\ No newline at end of file