Compare commits

..

7 Commits

Author SHA1 Message Date
Ivan
07c2f1da2f B: Fix renaming folders in user location
Some checks failed
Backend CI / build (3.12) (push) Has been cancelled
Frontend CI / build (22.x) (push) Has been cancelled
2024-08-22 10:45:24 +03:00
Ivan
4c68462039 npm update 2024-08-21 21:58:04 +03:00
Ivan
87bdf9f2e6 M: Improve LibraryItem editor 2024-08-21 21:48:47 +03:00
Ivan
96db927c71 R: Remove redundant font option 2024-08-21 20:32:04 +03:00
Ivan
2083c11ff5 M: Improve graph UI 2024-08-21 20:20:48 +03:00
Ivan
c97dae223b B: Fix empty constituenta tooltip bug 2024-08-21 17:32:35 +03:00
Ivan
37d022a030 F: Implement location editing + showSubfolders 2024-08-21 16:49:04 +03:00
44 changed files with 811 additions and 448 deletions

View File

@ -200,6 +200,7 @@
"Пакулина",
"пересинтез",
"Персиц",
"подпапках",
"Присакарь",
"ПРОКСИМА",
"Родоструктурная",

View File

@ -1,6 +1,6 @@
''' REST API: Serializers. '''
from .basics import AccessPolicySerializer, LocationSerializer
from .basics import AccessPolicySerializer, LocationSerializer, RenameLocationSerializer
from .data_access import (
LibraryItemBaseSerializer,
LibraryItemCloneSerializer,

View File

@ -19,6 +19,24 @@ class LocationSerializer(serializers.Serializer):
return attrs
class RenameLocationSerializer(serializers.Serializer):
''' Serializer: rename location. '''
target = serializers.CharField(max_length=500)
new_location = serializers.CharField(max_length=500)
def validate(self, attrs):
attrs = super().validate(attrs)
if not validate_location(attrs['target']):
raise serializers.ValidationError({
'target': msg.invalidLocation()
})
if not validate_location(attrs['target']):
raise serializers.ValidationError({
'new_location': msg.invalidLocation()
})
return attrs
class AccessPolicySerializer(serializers.Serializer):
''' Serializer: Constituenta renaming. '''
access_policy = serializers.CharField()

View File

@ -181,6 +181,61 @@ class TestLibraryViewset(EndpointTester):
self.unowned.refresh_from_db()
self.assertEqual(self.unowned.location, data['location'])
@decl_endpoint('/api/library/rename-location', method='patch')
def test_rename_location(self):
self.owned.location = '/S/temp'
self.owned.save()
self.unowned.location = '/S/temp'
self.unowned.save()
owned2 = LibraryItem.objects.create(
title='Test3',
alias='T3',
owner=self.user,
location='/S/temp/123'
)
data = {
'target': '/S/temp',
'new_location': '/S/temp2'
}
self.executeBadData(data={})
self.executeBadData(data={'target:': '/S/temp'})
self.executeBadData(data={'new_location:': '/S/temp'})
self.executeBadData(data={'target:': 'invalid', 'new_location': '/S/temp'})
self.executeBadData(data={'target:': '/S/temp', 'new_location': 'invalid'})
self.executeOK(data=data)
self.owned.refresh_from_db()
self.unowned.refresh_from_db()
owned2.refresh_from_db()
self.assertEqual(self.owned.location, '/S/temp2')
self.assertEqual(self.unowned.location, '/S/temp')
self.assertEqual(owned2.location, '/S/temp2/123')
self.toggle_admin(True)
self.executeOK(data=data)
self.unowned.refresh_from_db()
self.assertEqual(self.unowned.location, '/S/temp2')
@decl_endpoint('/api/library/rename-location', method='patch')
def test_rename_location_user(self):
self.owned.location = '/U/temp'
self.owned.save()
self.unowned.location = '/U/temp'
self.unowned.save()
data = {
'target': '/U/temp',
'new_location': '/U/temp2'
}
self.toggle_admin(True)
self.executeOK(data=data)
self.owned.refresh_from_db()
self.unowned.refresh_from_db()
self.assertEqual(self.owned.location, '/U/temp2')
self.assertEqual(self.unowned.location, '/U/temp')
@decl_endpoint('/api/library/{item}/set-editors', method='patch')
def test_set_editors(self):
time_update = self.owned.time_update

View File

@ -82,7 +82,8 @@ class LibraryViewSet(viewsets.ModelViewSet):
access_level = permissions.ItemOwner
elif self.action in [
'create',
'clone'
'clone',
'rename_location'
]:
access_level = permissions.GlobalUser
else:
@ -92,6 +93,44 @@ class LibraryViewSet(viewsets.ModelViewSet):
def _get_item(self) -> m.LibraryItem:
return cast(m.LibraryItem, self.get_object())
@extend_schema(
summary='rename location',
tags=['Library'],
request=s.RenameLocationSerializer,
responses={
c.HTTP_200_OK: None,
c.HTTP_403_FORBIDDEN: None,
c.HTTP_404_NOT_FOUND: None
}
)
@action(detail=False, methods=['patch'], url_path='rename-location')
def rename_location(self, request: Request) -> HttpResponse:
''' Endpoint: Rename location. '''
serializer = s.RenameLocationSerializer(data=request.data)
serializer.is_valid(raise_exception=True)
target = serializer.validated_data['target']
new_location = serializer.validated_data['new_location']
if target == new_location:
return Response(status=c.HTTP_200_OK)
if new_location.startswith(m.LocationHead.LIBRARY) and not self.request.user.is_staff:
return Response(status=c.HTTP_403_FORBIDDEN)
user_involved = new_location.startswith(m.LocationHead.USER) or target.startswith(m.LocationHead.USER)
with transaction.atomic():
changed: list[m.LibraryItem] = []
items = m.LibraryItem.objects \
.filter(Q(location=target) | Q(location__startswith=f'{target}/')) \
.only('location', 'owner_id')
for item in items:
if item.owner_id == self.request.user.pk or (self.request.user.is_staff and not user_involved):
item.location = item.location.replace(target, new_location)
changed.append(item)
if changed:
m.LibraryItem.objects.bulk_update(changed, ['location'])
return Response(status=c.HTTP_200_OK)
@extend_schema(
summary='clone item including contents',
tags=['Library'],

View File

@ -39,7 +39,7 @@ def can_edit_item(user, obj: Any) -> bool:
return True
item = _extract_item(obj)
if item.owner == user:
if item.owner_id == user.pk:
return True
if Editor.objects.filter(

View File

@ -11,7 +11,15 @@ export default [
...typescriptPlugin.configs.recommendedTypeChecked,
...typescriptPlugin.configs.stylisticTypeChecked,
{
ignores: ['**/parser.ts', '**/node_modules/**', '**/public/**', 'eslint.config.js']
ignores: [
'**/parser.ts',
'**/node_modules/**',
'**/public/**',
'**/dist/**',
'eslint.config.js',
'tailwind.config.js',
'postcss.config.js'
]
},
{
languageOptions: {

View File

@ -14,7 +14,7 @@
"@uiw/react-codemirror": "^4.23.0",
"axios": "^1.7.4",
"clsx": "^2.1.1",
"framer-motion": "^11.3.24",
"framer-motion": "^11.3.29",
"html-to-image": "^1.11.11",
"js-file-download": "^0.4.12",
"react": "^18.3.1",
@ -23,21 +23,21 @@
"react-icons": "^5.3.0",
"react-intl": "^6.6.8",
"react-loader-spinner": "^6.1.6",
"react-router-dom": "^6.26.0",
"react-router-dom": "^6.26.1",
"react-select": "^5.8.0",
"react-tabs": "^6.0.2",
"react-toastify": "^10.0.5",
"react-tooltip": "^5.28.0",
"react-zoom-pan-pinch": "^3.6.1",
"reactflow": "^11.11.4",
"reagraph": "^4.19.2",
"use-debounce": "^10.0.2"
"reagraph": "^4.19.3",
"use-debounce": "^10.0.3"
},
"devDependencies": {
"@lezer/generator": "^1.7.1",
"@types/jest": "^29.5.12",
"@types/node": "^22.2.0",
"@types/react": "^18.3.3",
"@types/node": "^22.5.0",
"@types/react": "^18.3.4",
"@types/react-dom": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^8.0.1",
"@typescript-eslint/parser": "^8.0.1",
@ -49,11 +49,11 @@
"globals": "^15.9.0",
"jest": "^29.7.0",
"postcss": "^8.4.41",
"tailwindcss": "^3.4.9",
"tailwindcss": "^3.4.10",
"ts-jest": "^29.2.4",
"typescript": "^5.5.4",
"typescript-eslint": "^8.1.0",
"vite": "^5.4.0"
"typescript-eslint": "^8.2.0",
"vite": "^5.4.2"
}
},
"node_modules/@alloc/quick-lru": {
@ -844,15 +844,15 @@
"license": "MIT"
},
"node_modules/@emotion/react": {
"version": "11.13.0",
"resolved": "https://registry.npmjs.org/@emotion/react/-/react-11.13.0.tgz",
"integrity": "sha512-WkL+bw1REC2VNV1goQyfxjx1GYJkcc23CRQkXX+vZNLINyfI7o+uUn/rTGPt/xJ3bJHd5GcljgnxHf4wRw5VWQ==",
"version": "11.13.3",
"resolved": "https://registry.npmjs.org/@emotion/react/-/react-11.13.3.tgz",
"integrity": "sha512-lIsdU6JNrmYfJ5EbUCf4xW1ovy5wKQ2CkPRM4xogziOxH1nXxBSjpC9YqbFAP7circxMfYp+6x676BqWcEiixg==",
"license": "MIT",
"dependencies": {
"@babel/runtime": "^7.18.3",
"@emotion/babel-plugin": "^11.12.0",
"@emotion/cache": "^11.13.0",
"@emotion/serialize": "^1.3.0",
"@emotion/serialize": "^1.3.1",
"@emotion/use-insertion-effect-with-fallbacks": "^1.1.0",
"@emotion/utils": "^1.4.0",
"@emotion/weak-memoize": "^0.4.0",
@ -868,14 +868,14 @@
}
},
"node_modules/@emotion/serialize": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/@emotion/serialize/-/serialize-1.3.0.tgz",
"integrity": "sha512-jACuBa9SlYajnpIVXB+XOXnfJHyckDfe6fOpORIM6yhBDlqGuExvDdZYHDQGoDf3bZXGv7tNr+LpLjJqiEQ6EA==",
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/@emotion/serialize/-/serialize-1.3.1.tgz",
"integrity": "sha512-dEPNKzBPU+vFPGa+z3axPRn8XVDetYORmDC0wAiej+TNcOZE70ZMJa0X7JdeoM6q/nWTMZeLpN/fTnD9o8MQBA==",
"license": "MIT",
"dependencies": {
"@emotion/hash": "^0.9.2",
"@emotion/memoize": "^0.9.0",
"@emotion/unitless": "^0.9.0",
"@emotion/unitless": "^0.10.0",
"@emotion/utils": "^1.4.0",
"csstype": "^3.0.2"
}
@ -887,9 +887,9 @@
"license": "MIT"
},
"node_modules/@emotion/unitless": {
"version": "0.9.0",
"resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.9.0.tgz",
"integrity": "sha512-TP6GgNZtmtFaFcsOgExdnfxLLpRDla4Q66tnenA9CktvVSdNKDvMVuUah4QvWPIpNjrWsGg3qeGo9a43QooGZQ==",
"version": "0.10.0",
"resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.10.0.tgz",
"integrity": "sha512-dFoMUuQA20zvtVTuxZww6OHoJYgrzfKM1t52mVySDJnMSEa08ruEvdYQbhvyu6soU+NeLVd3yKfTfT0NeV6qGg==",
"license": "MIT"
},
"node_modules/@emotion/use-insertion-effect-with-fallbacks": {
@ -2558,9 +2558,9 @@
}
},
"node_modules/@lezer/highlight": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/@lezer/highlight/-/highlight-1.2.0.tgz",
"integrity": "sha512-WrS5Mw51sGrpqjlh3d4/fOwpEV2Hd3YOkp9DBt4k8XZQcoTHZFB7sx030A6OcahF4J1nDQAa3jXlTVVYH50IFA==",
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/@lezer/highlight/-/highlight-1.2.1.tgz",
"integrity": "sha512-Z5duk4RN/3zuVO7Jq0pGLJ3qynpxUVsh7IbUbGj88+uV2ApSAn6kWg2au3iJb+0Zi7kKtqffIESgNcRXWZWmSA==",
"license": "MIT",
"dependencies": {
"@lezer/common": "^1.0.0"
@ -2875,18 +2875,18 @@
}
},
"node_modules/@remix-run/router": {
"version": "1.19.0",
"resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.19.0.tgz",
"integrity": "sha512-zDICCLKEwbVYTS6TjYaWtHXxkdoUvD/QXvyVZjGCsWz5vyH7aFeONlPffPdW+Y/t6KT0MgXb2Mfjun9YpWN1dA==",
"version": "1.19.1",
"resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.19.1.tgz",
"integrity": "sha512-S45oynt/WH19bHbIXjtli6QmwNYvaz+vtnubvNpNDvUOoA/OWh6j1OikIP3G+v5GHdxyC6EXoChG3HgYGEUfcg==",
"license": "MIT",
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/@rollup/rollup-android-arm-eabi": {
"version": "4.20.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.20.0.tgz",
"integrity": "sha512-TSpWzflCc4VGAUJZlPpgAJE1+V60MePDQnBd7PPkpuEmOy8i87aL6tinFGKBFKuEDikYpig72QzdT3QPYIi+oA==",
"version": "4.21.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.21.0.tgz",
"integrity": "sha512-WTWD8PfoSAJ+qL87lE7votj3syLavxunWhzCnx3XFxFiI/BA/r3X7MUM8dVrH8rb2r4AiO8jJsr3ZjdaftmnfA==",
"cpu": [
"arm"
],
@ -2898,9 +2898,9 @@
]
},
"node_modules/@rollup/rollup-android-arm64": {
"version": "4.20.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.20.0.tgz",
"integrity": "sha512-u00Ro/nok7oGzVuh/FMYfNoGqxU5CPWz1mxV85S2w9LxHR8OoMQBuSk+3BKVIDYgkpeOET5yXkx90OYFc+ytpQ==",
"version": "4.21.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.21.0.tgz",
"integrity": "sha512-a1sR2zSK1B4eYkiZu17ZUZhmUQcKjk2/j9Me2IDjk1GHW7LB5Z35LEzj9iJch6gtUfsnvZs1ZNyDW2oZSThrkA==",
"cpu": [
"arm64"
],
@ -2912,9 +2912,9 @@
]
},
"node_modules/@rollup/rollup-darwin-arm64": {
"version": "4.20.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.20.0.tgz",
"integrity": "sha512-uFVfvzvsdGtlSLuL0ZlvPJvl6ZmrH4CBwLGEFPe7hUmf7htGAN+aXo43R/V6LATyxlKVC/m6UsLb7jbG+LG39Q==",
"version": "4.21.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.21.0.tgz",
"integrity": "sha512-zOnKWLgDld/svhKO5PD9ozmL6roy5OQ5T4ThvdYZLpiOhEGY+dp2NwUmxK0Ld91LrbjrvtNAE0ERBwjqhZTRAA==",
"cpu": [
"arm64"
],
@ -2926,9 +2926,9 @@
]
},
"node_modules/@rollup/rollup-darwin-x64": {
"version": "4.20.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.20.0.tgz",
"integrity": "sha512-xbrMDdlev53vNXexEa6l0LffojxhqDTBeL+VUxuuIXys4x6xyvbKq5XqTXBCEUA8ty8iEJblHvFaWRJTk/icAQ==",
"version": "4.21.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.21.0.tgz",
"integrity": "sha512-7doS8br0xAkg48SKE2QNtMSFPFUlRdw9+votl27MvT46vo44ATBmdZdGysOevNELmZlfd+NEa0UYOA8f01WSrg==",
"cpu": [
"x64"
],
@ -2940,9 +2940,9 @@
]
},
"node_modules/@rollup/rollup-linux-arm-gnueabihf": {
"version": "4.20.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.20.0.tgz",
"integrity": "sha512-jMYvxZwGmoHFBTbr12Xc6wOdc2xA5tF5F2q6t7Rcfab68TT0n+r7dgawD4qhPEvasDsVpQi+MgDzj2faOLsZjA==",
"version": "4.21.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.21.0.tgz",
"integrity": "sha512-pWJsfQjNWNGsoCq53KjMtwdJDmh/6NubwQcz52aEwLEuvx08bzcy6tOUuawAOncPnxz/3siRtd8hiQ32G1y8VA==",
"cpu": [
"arm"
],
@ -2954,9 +2954,9 @@
]
},
"node_modules/@rollup/rollup-linux-arm-musleabihf": {
"version": "4.20.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.20.0.tgz",
"integrity": "sha512-1asSTl4HKuIHIB1GcdFHNNZhxAYEdqML/MW4QmPS4G0ivbEcBr1JKlFLKsIRqjSwOBkdItn3/ZDlyvZ/N6KPlw==",
"version": "4.21.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.21.0.tgz",
"integrity": "sha512-efRIANsz3UHZrnZXuEvxS9LoCOWMGD1rweciD6uJQIx2myN3a8Im1FafZBzh7zk1RJ6oKcR16dU3UPldaKd83w==",
"cpu": [
"arm"
],
@ -2968,9 +2968,9 @@
]
},
"node_modules/@rollup/rollup-linux-arm64-gnu": {
"version": "4.20.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.20.0.tgz",
"integrity": "sha512-COBb8Bkx56KldOYJfMf6wKeYJrtJ9vEgBRAOkfw6Ens0tnmzPqvlpjZiLgkhg6cA3DGzCmLmmd319pmHvKWWlQ==",
"version": "4.21.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.21.0.tgz",
"integrity": "sha512-ZrPhydkTVhyeGTW94WJ8pnl1uroqVHM3j3hjdquwAcWnmivjAwOYjTEAuEDeJvGX7xv3Z9GAvrBkEzCgHq9U1w==",
"cpu": [
"arm64"
],
@ -2982,9 +2982,9 @@
]
},
"node_modules/@rollup/rollup-linux-arm64-musl": {
"version": "4.20.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.20.0.tgz",
"integrity": "sha512-+it+mBSyMslVQa8wSPvBx53fYuZK/oLTu5RJoXogjk6x7Q7sz1GNRsXWjn6SwyJm8E/oMjNVwPhmNdIjwP135Q==",
"version": "4.21.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.21.0.tgz",
"integrity": "sha512-cfaupqd+UEFeURmqNP2eEvXqgbSox/LHOyN9/d2pSdV8xTrjdg3NgOFJCtc1vQ/jEke1qD0IejbBfxleBPHnPw==",
"cpu": [
"arm64"
],
@ -2996,9 +2996,9 @@
]
},
"node_modules/@rollup/rollup-linux-powerpc64le-gnu": {
"version": "4.20.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.20.0.tgz",
"integrity": "sha512-yAMvqhPfGKsAxHN8I4+jE0CpLWD8cv4z7CK7BMmhjDuz606Q2tFKkWRY8bHR9JQXYcoLfopo5TTqzxgPUjUMfw==",
"version": "4.21.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.21.0.tgz",
"integrity": "sha512-ZKPan1/RvAhrUylwBXC9t7B2hXdpb/ufeu22pG2psV7RN8roOfGurEghw1ySmX/CmDDHNTDDjY3lo9hRlgtaHg==",
"cpu": [
"ppc64"
],
@ -3010,9 +3010,9 @@
]
},
"node_modules/@rollup/rollup-linux-riscv64-gnu": {
"version": "4.20.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.20.0.tgz",
"integrity": "sha512-qmuxFpfmi/2SUkAw95TtNq/w/I7Gpjurx609OOOV7U4vhvUhBcftcmXwl3rqAek+ADBwSjIC4IVNLiszoj3dPA==",
"version": "4.21.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.21.0.tgz",
"integrity": "sha512-H1eRaCwd5E8eS8leiS+o/NqMdljkcb1d6r2h4fKSsCXQilLKArq6WS7XBLDu80Yz+nMqHVFDquwcVrQmGr28rg==",
"cpu": [
"riscv64"
],
@ -3024,9 +3024,9 @@
]
},
"node_modules/@rollup/rollup-linux-s390x-gnu": {
"version": "4.20.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.20.0.tgz",
"integrity": "sha512-I0BtGXddHSHjV1mqTNkgUZLnS3WtsqebAXv11D5BZE/gfw5KoyXSAXVqyJximQXNvNzUo4GKlCK/dIwXlz+jlg==",
"version": "4.21.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.21.0.tgz",
"integrity": "sha512-zJ4hA+3b5tu8u7L58CCSI0A9N1vkfwPhWd/puGXwtZlsB5bTkwDNW/+JCU84+3QYmKpLi+XvHdmrlwUwDA6kqw==",
"cpu": [
"s390x"
],
@ -3038,9 +3038,9 @@
]
},
"node_modules/@rollup/rollup-linux-x64-gnu": {
"version": "4.20.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.20.0.tgz",
"integrity": "sha512-y+eoL2I3iphUg9tN9GB6ku1FA8kOfmF4oUEWhztDJ4KXJy1agk/9+pejOuZkNFhRwHAOxMsBPLbXPd6mJiCwew==",
"version": "4.21.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.21.0.tgz",
"integrity": "sha512-e2hrvElFIh6kW/UNBQK/kzqMNY5mO+67YtEh9OA65RM5IJXYTWiXjX6fjIiPaqOkBthYF1EqgiZ6OXKcQsM0hg==",
"cpu": [
"x64"
],
@ -3052,9 +3052,9 @@
]
},
"node_modules/@rollup/rollup-linux-x64-musl": {
"version": "4.20.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.20.0.tgz",
"integrity": "sha512-hM3nhW40kBNYUkZb/r9k2FKK+/MnKglX7UYd4ZUy5DJs8/sMsIbqWK2piZtVGE3kcXVNj3B2IrUYROJMMCikNg==",
"version": "4.21.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.21.0.tgz",
"integrity": "sha512-1vvmgDdUSebVGXWX2lIcgRebqfQSff0hMEkLJyakQ9JQUbLDkEaMsPTLOmyccyC6IJ/l3FZuJbmrBw/u0A0uCQ==",
"cpu": [
"x64"
],
@ -3066,9 +3066,9 @@
]
},
"node_modules/@rollup/rollup-win32-arm64-msvc": {
"version": "4.20.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.20.0.tgz",
"integrity": "sha512-psegMvP+Ik/Bg7QRJbv8w8PAytPA7Uo8fpFjXyCRHWm6Nt42L+JtoqH8eDQ5hRP7/XW2UiIriy1Z46jf0Oa1kA==",
"version": "4.21.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.21.0.tgz",
"integrity": "sha512-s5oFkZ/hFcrlAyBTONFY1TWndfyre1wOMwU+6KCpm/iatybvrRgmZVM+vCFwxmC5ZhdlgfE0N4XorsDpi7/4XQ==",
"cpu": [
"arm64"
],
@ -3080,9 +3080,9 @@
]
},
"node_modules/@rollup/rollup-win32-ia32-msvc": {
"version": "4.20.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.20.0.tgz",
"integrity": "sha512-GabekH3w4lgAJpVxkk7hUzUf2hICSQO0a/BLFA11/RMxQT92MabKAqyubzDZmMOC/hcJNlc+rrypzNzYl4Dx7A==",
"version": "4.21.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.21.0.tgz",
"integrity": "sha512-G9+TEqRnAA6nbpqyUqgTiopmnfgnMkR3kMukFBDsiyy23LZvUCpiUwjTRx6ezYCjJODXrh52rBR9oXvm+Fp5wg==",
"cpu": [
"ia32"
],
@ -3094,9 +3094,9 @@
]
},
"node_modules/@rollup/rollup-win32-x64-msvc": {
"version": "4.20.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.20.0.tgz",
"integrity": "sha512-aJ1EJSuTdGnM6qbVC4B5DSmozPTqIag9fSzXRNNo+humQLG89XpPgdt16Ia56ORD7s+H8Pmyx44uczDQ0yDzpg==",
"version": "4.21.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.21.0.tgz",
"integrity": "sha512-2jsCDZwtQvRhejHLfZ1JY6w6kEuEtfF9nzYsZxzSlNVKDX+DpsDJ+Rbjkm74nvg2rdx0gwBS+IMdvwJuq3S9pQ==",
"cpu": [
"x64"
],
@ -3549,13 +3549,13 @@
}
},
"node_modules/@types/node": {
"version": "22.2.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.2.0.tgz",
"integrity": "sha512-bm6EG6/pCpkxDf/0gDNDdtDILMOHgaQBVOJGdwsqClnxA3xL6jtMv76rLBc006RVMWbmaf0xbmom4Z/5o2nRkQ==",
"version": "22.5.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.5.0.tgz",
"integrity": "sha512-DkFrJOe+rfdHTqqMg0bSNlGlQ85hSoh2TPzZyhHsXnMtligRWpxUySiyw8FY14ITt24HVCiQPWxS3KO/QlGmWg==",
"dev": true,
"license": "MIT",
"dependencies": {
"undici-types": "~6.13.0"
"undici-types": "~6.19.2"
}
},
"node_modules/@types/offscreencanvas": {
@ -3577,9 +3577,9 @@
"license": "MIT"
},
"node_modules/@types/react": {
"version": "18.3.3",
"resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.3.tgz",
"integrity": "sha512-hti/R0pS0q1/xx+TsI73XIqk26eBsISZ2R0wUijXIngRK9R/e7Xw/cXVxQK7R5JjW+SV4zGcn5hXjudkN/pLIw==",
"version": "18.3.4",
"resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.4.tgz",
"integrity": "sha512-J7W30FTdfCxDDjmfRM+/JqLHBIyl7xUIp9kwK637FGmY7+mkSFSe6L4jpZzhj5QMfLssSDP4/i75AKkrdC7/Jw==",
"license": "MIT",
"dependencies": {
"@types/prop-types": "*",
@ -3634,9 +3634,9 @@
"license": "MIT"
},
"node_modules/@types/three": {
"version": "0.167.1",
"resolved": "https://registry.npmjs.org/@types/three/-/three-0.167.1.tgz",
"integrity": "sha512-OCd2Uv/8/4TbmSaIRFawrCOnDMLdpaa+QGJdhlUBmdfbHjLY8k6uFc0tde2/UvcaHQ6NtLl28onj/vJfofV+Tg==",
"version": "0.167.2",
"resolved": "https://registry.npmjs.org/@types/three/-/three-0.167.2.tgz",
"integrity": "sha512-onxnIUNYpXcZJ5DTiIsxfnr4F9kAWkkxAUWx5yqzz/u0a4IygCLCjMuOl2DEeCxyJdJ2nOJZvKpu48sBMqfmkQ==",
"license": "MIT",
"peer": true,
"dependencies": {
@ -3671,17 +3671,17 @@
"license": "MIT"
},
"node_modules/@typescript-eslint/eslint-plugin": {
"version": "8.1.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.1.0.tgz",
"integrity": "sha512-LlNBaHFCEBPHyD4pZXb35mzjGkuGKXU5eeCA1SxvHfiRES0E82dOounfVpL4DCqYvJEKab0bZIA0gCRpdLKkCw==",
"version": "8.2.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.2.0.tgz",
"integrity": "sha512-02tJIs655em7fvt9gps/+4k4OsKULYGtLBPJfOsmOq1+3cdClYiF0+d6mHu6qDnTcg88wJBkcPLpQhq7FyDz0A==",
"dev": true,
"license": "MIT",
"dependencies": {
"@eslint-community/regexpp": "^4.10.0",
"@typescript-eslint/scope-manager": "8.1.0",
"@typescript-eslint/type-utils": "8.1.0",
"@typescript-eslint/utils": "8.1.0",
"@typescript-eslint/visitor-keys": "8.1.0",
"@typescript-eslint/scope-manager": "8.2.0",
"@typescript-eslint/type-utils": "8.2.0",
"@typescript-eslint/utils": "8.2.0",
"@typescript-eslint/visitor-keys": "8.2.0",
"graphemer": "^1.4.0",
"ignore": "^5.3.1",
"natural-compare": "^1.4.0",
@ -3705,16 +3705,16 @@
}
},
"node_modules/@typescript-eslint/parser": {
"version": "8.1.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.1.0.tgz",
"integrity": "sha512-U7iTAtGgJk6DPX9wIWPPOlt1gO57097G06gIcl0N0EEnNw8RGD62c+2/DiP/zL7KrkqnnqF7gtFGR7YgzPllTA==",
"version": "8.2.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.2.0.tgz",
"integrity": "sha512-j3Di+o0lHgPrb7FxL3fdEy6LJ/j2NE8u+AP/5cQ9SKb+JLH6V6UHDqJ+e0hXBkHP1wn1YDFjYCS9LBQsZDlDEg==",
"dev": true,
"license": "BSD-2-Clause",
"dependencies": {
"@typescript-eslint/scope-manager": "8.1.0",
"@typescript-eslint/types": "8.1.0",
"@typescript-eslint/typescript-estree": "8.1.0",
"@typescript-eslint/visitor-keys": "8.1.0",
"@typescript-eslint/scope-manager": "8.2.0",
"@typescript-eslint/types": "8.2.0",
"@typescript-eslint/typescript-estree": "8.2.0",
"@typescript-eslint/visitor-keys": "8.2.0",
"debug": "^4.3.4"
},
"engines": {
@ -3734,14 +3734,14 @@
}
},
"node_modules/@typescript-eslint/scope-manager": {
"version": "8.1.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.1.0.tgz",
"integrity": "sha512-DsuOZQji687sQUjm4N6c9xABJa7fjvfIdjqpSIIVOgaENf2jFXiM9hIBZOL3hb6DHK9Nvd2d7zZnoMLf9e0OtQ==",
"version": "8.2.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.2.0.tgz",
"integrity": "sha512-OFn80B38yD6WwpoHU2Tz/fTz7CgFqInllBoC3WP+/jLbTb4gGPTy9HBSTsbDWkMdN55XlVU0mMDYAtgvlUspGw==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/types": "8.1.0",
"@typescript-eslint/visitor-keys": "8.1.0"
"@typescript-eslint/types": "8.2.0",
"@typescript-eslint/visitor-keys": "8.2.0"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@ -3752,14 +3752,14 @@
}
},
"node_modules/@typescript-eslint/type-utils": {
"version": "8.1.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.1.0.tgz",
"integrity": "sha512-oLYvTxljVvsMnldfl6jIKxTaU7ok7km0KDrwOt1RHYu6nxlhN3TIx8k5Q52L6wR33nOwDgM7VwW1fT1qMNfFIA==",
"version": "8.2.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.2.0.tgz",
"integrity": "sha512-g1CfXGFMQdT5S+0PSO0fvGXUaiSkl73U1n9LTK5aRAFnPlJ8dLKkXr4AaLFvPedW8lVDoMgLLE3JN98ZZfsj0w==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/typescript-estree": "8.1.0",
"@typescript-eslint/utils": "8.1.0",
"@typescript-eslint/typescript-estree": "8.2.0",
"@typescript-eslint/utils": "8.2.0",
"debug": "^4.3.4",
"ts-api-utils": "^1.3.0"
},
@ -3777,9 +3777,9 @@
}
},
"node_modules/@typescript-eslint/types": {
"version": "8.1.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.1.0.tgz",
"integrity": "sha512-q2/Bxa0gMOu/2/AKALI0tCKbG2zppccnRIRCW6BaaTlRVaPKft4oVYPp7WOPpcnsgbr0qROAVCVKCvIQ0tbWog==",
"version": "8.2.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.2.0.tgz",
"integrity": "sha512-6a9QSK396YqmiBKPkJtxsgZZZVjYQ6wQ/TlI0C65z7vInaETuC6HAHD98AGLC8DyIPqHytvNuS8bBVvNLKyqvQ==",
"dev": true,
"license": "MIT",
"engines": {
@ -3791,14 +3791,14 @@
}
},
"node_modules/@typescript-eslint/typescript-estree": {
"version": "8.1.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.1.0.tgz",
"integrity": "sha512-NTHhmufocEkMiAord/g++gWKb0Fr34e9AExBRdqgWdVBaKoei2dIyYKD9Q0jBnvfbEA5zaf8plUFMUH6kQ0vGg==",
"version": "8.2.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.2.0.tgz",
"integrity": "sha512-kiG4EDUT4dImplOsbh47B1QnNmXSoUqOjWDvCJw/o8LgfD0yr7k2uy54D5Wm0j4t71Ge1NkynGhpWdS0dEIAUA==",
"dev": true,
"license": "BSD-2-Clause",
"dependencies": {
"@typescript-eslint/types": "8.1.0",
"@typescript-eslint/visitor-keys": "8.1.0",
"@typescript-eslint/types": "8.2.0",
"@typescript-eslint/visitor-keys": "8.2.0",
"debug": "^4.3.4",
"globby": "^11.1.0",
"is-glob": "^4.0.3",
@ -3820,16 +3820,16 @@
}
},
"node_modules/@typescript-eslint/utils": {
"version": "8.1.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.1.0.tgz",
"integrity": "sha512-ypRueFNKTIFwqPeJBfeIpxZ895PQhNyH4YID6js0UoBImWYoSjBsahUn9KMiJXh94uOjVBgHD9AmkyPsPnFwJA==",
"version": "8.2.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.2.0.tgz",
"integrity": "sha512-O46eaYKDlV3TvAVDNcoDzd5N550ckSe8G4phko++OCSC1dYIb9LTc3HDGYdWqWIAT5qDUKphO6sd9RrpIJJPfg==",
"dev": true,
"license": "MIT",
"dependencies": {
"@eslint-community/eslint-utils": "^4.4.0",
"@typescript-eslint/scope-manager": "8.1.0",
"@typescript-eslint/types": "8.1.0",
"@typescript-eslint/typescript-estree": "8.1.0"
"@typescript-eslint/scope-manager": "8.2.0",
"@typescript-eslint/types": "8.2.0",
"@typescript-eslint/typescript-estree": "8.2.0"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@ -3843,13 +3843,13 @@
}
},
"node_modules/@typescript-eslint/visitor-keys": {
"version": "8.1.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.1.0.tgz",
"integrity": "sha512-ba0lNI19awqZ5ZNKh6wCModMwoZs457StTebQ0q1NP58zSi2F6MOZRXwfKZy+jB78JNJ/WH8GSh2IQNzXX8Nag==",
"version": "8.2.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.2.0.tgz",
"integrity": "sha512-sbgsPMW9yLvS7IhCi8IpuK1oBmtbWUNP+hBdwl/I9nzqVsszGnNGti5r9dUtF5RLivHUFFIdRvLiTsPhzSyJ3Q==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/types": "8.1.0",
"@typescript-eslint/types": "8.2.0",
"eslint-visitor-keys": "^3.4.3"
},
"engines": {
@ -4237,9 +4237,9 @@
}
},
"node_modules/async": {
"version": "3.2.5",
"resolved": "https://registry.npmjs.org/async/-/async-3.2.5.tgz",
"integrity": "sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==",
"version": "3.2.6",
"resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz",
"integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==",
"dev": true,
"license": "MIT"
},
@ -4722,9 +4722,9 @@
}
},
"node_modules/camera-controls": {
"version": "2.8.5",
"resolved": "https://registry.npmjs.org/camera-controls/-/camera-controls-2.8.5.tgz",
"integrity": "sha512-7VTwRk7Nu1nRKsY7bEt9HVBfKt8DETvzyYhLN4OW26OByBayMDB5fUaNcPI+z++vG23RH5yqn6ZRhZcgLQy2rA==",
"version": "2.9.0",
"resolved": "https://registry.npmjs.org/camera-controls/-/camera-controls-2.9.0.tgz",
"integrity": "sha512-TpCujnP0vqPppTXXJRYpvIy0xq9Tro6jQf2iYUxlDpPCNxkvE/XGaTuwIxnhINOkVP/ob2CRYXtY3iVYXeMEzA==",
"license": "MIT",
"peerDependencies": {
"three": ">=0.126.1"
@ -5523,9 +5523,9 @@
}
},
"node_modules/detect-gpu": {
"version": "5.0.43",
"resolved": "https://registry.npmjs.org/detect-gpu/-/detect-gpu-5.0.43.tgz",
"integrity": "sha512-KVcUS/YzsZIBIACz6p2xpuBpAjaY4wiELImJ7M8rb9i16NE6frnVpSV/UBpkK6DYj4Wd3NJeE4sghcaypuM8bg==",
"version": "5.0.44",
"resolved": "https://registry.npmjs.org/detect-gpu/-/detect-gpu-5.0.44.tgz",
"integrity": "sha512-R4lA6vEmd4IxMQgDEp74e80MDKXkNXz5FpA0/LvuXt7qVWF0faBj7xhJTC8DDWjxFWdMWLyJJSK9JGpMEBX8RA==",
"license": "MIT",
"dependencies": {
"webgl-constants": "^1.1.1"
@ -5631,9 +5631,9 @@
}
},
"node_modules/electron-to-chromium": {
"version": "1.5.6",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.6.tgz",
"integrity": "sha512-jwXWsM5RPf6j9dPYzaorcBSUg6AiqocPEyMpkchkvntaH9HGfOOMZwxMJjDY/XEs3T5dM7uyH1VhRMkqUU9qVw==",
"version": "1.5.13",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.13.tgz",
"integrity": "sha512-lbBcvtIJ4J6sS4tb5TLp1b4LyfCdMkwStzXPyAgVgTRAsep4bvrAGaBOP7ZJtQMNJpSQ9SqG4brWOroNaQtm7Q==",
"dev": true,
"license": "ISC"
},
@ -6598,9 +6598,9 @@
}
},
"node_modules/framer-motion": {
"version": "11.3.24",
"resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-11.3.24.tgz",
"integrity": "sha512-kl0YI7HwAtyV0VOAWuU/rXoOS8+z5qSkMN6rZS+a9oe6fIha6SC3vjJN6u/hBpvjrg5MQNdSnqnjYxm0WYTX9g==",
"version": "11.3.29",
"resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-11.3.29.tgz",
"integrity": "sha512-uyDuUOeOElJEA3kbkbyoTNEf75Jih1EUg0ouLKYMlGDdt/LaJPmO+FyOGAGxM2HwKhHcAoKFNveR5A8peb7yhw==",
"license": "MIT",
"dependencies": {
"tslib": "^2.4.0"
@ -10050,13 +10050,13 @@
}
},
"node_modules/minipass": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz",
"integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==",
"version": "7.1.2",
"resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz",
"integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==",
"dev": true,
"license": "ISC",
"engines": {
"node": ">=8"
"node": ">=16 || 14 >=14.17"
}
},
"node_modules/mnemonist": {
@ -11071,12 +11071,12 @@
}
},
"node_modules/react-router": {
"version": "6.26.0",
"resolved": "https://registry.npmjs.org/react-router/-/react-router-6.26.0.tgz",
"integrity": "sha512-wVQq0/iFYd3iZ9H2l3N3k4PL8EEHcb0XlU2Na8nEwmiXgIUElEH6gaJDtUQxJ+JFzmIXaQjfdpcGWaM6IoQGxg==",
"version": "6.26.1",
"resolved": "https://registry.npmjs.org/react-router/-/react-router-6.26.1.tgz",
"integrity": "sha512-kIwJveZNwp7teQRI5QmwWo39A5bXRyqpH0COKKmPnyD2vBvDwgFXSqDUYtt1h+FEyfnE8eXr7oe0MxRzVwCcvQ==",
"license": "MIT",
"dependencies": {
"@remix-run/router": "1.19.0"
"@remix-run/router": "1.19.1"
},
"engines": {
"node": ">=14.0.0"
@ -11086,13 +11086,13 @@
}
},
"node_modules/react-router-dom": {
"version": "6.26.0",
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.26.0.tgz",
"integrity": "sha512-RRGUIiDtLrkX3uYcFiCIxKFWMcWQGMojpYZfcstc63A1+sSnVgILGIm9gNUA6na3Fm1QuPGSBQH2EMbAZOnMsQ==",
"version": "6.26.1",
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.26.1.tgz",
"integrity": "sha512-veut7m41S1fLql4pLhxeSW3jlqs+4MtjRLj0xvuCEXsxusJCbs6I8yn9BxzzDX2XDgafrccY6hwjmd/bL54tFw==",
"license": "MIT",
"dependencies": {
"@remix-run/router": "1.19.0",
"react-router": "6.26.0"
"@remix-run/router": "1.19.1",
"react-router": "6.26.1"
},
"engines": {
"node": ">=14.0.0"
@ -11179,16 +11179,6 @@
"react-dom": ">=16.6.0"
}
},
"node_modules/react-use-gesture": {
"version": "9.1.3",
"resolved": "https://registry.npmjs.org/react-use-gesture/-/react-use-gesture-9.1.3.tgz",
"integrity": "sha512-CdqA2SmS/fj3kkS2W8ZU8wjTbVBAIwDWaRprX7OKaj7HlGwBasGEFggmk5qNklknqk9zK/h8D355bEJFTpqEMg==",
"deprecated": "This package is no longer maintained. Please use @use-gesture/react instead",
"license": "MIT",
"peerDependencies": {
"react": ">= 16.8.0"
}
},
"node_modules/react-use-measure": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/react-use-measure/-/react-use-measure-2.1.1.tgz",
@ -11258,13 +11248,14 @@
}
},
"node_modules/reagraph": {
"version": "4.19.2",
"resolved": "https://registry.npmjs.org/reagraph/-/reagraph-4.19.2.tgz",
"integrity": "sha512-SfEaXGRR/kWwG6Hq8Q6WropdhMAFgszWG174/j4rsZQNMYTEiwwK+47iQLW9qxwVO1YJAloktfihN7QsWZmLaw==",
"version": "4.19.3",
"resolved": "https://registry.npmjs.org/reagraph/-/reagraph-4.19.3.tgz",
"integrity": "sha512-EkIyo6I6PhZo9zJUDIZSZL1eVDvvPk+ng0BkMPNJ+vPCP3yBKuD2Bq/LAMat29Q7+8Sbi3rrtSVlQZZaqxsMsQ==",
"license": "Apache-2.0",
"dependencies": {
"@react-spring/three": "9.6.1",
"@react-three/fiber": "8.13.5",
"@use-gesture/react": "^10.3.1",
"camera-controls": "^2.8.3",
"classnames": "^2.5.1",
"d3-array": "^3.2.4",
@ -11280,7 +11271,6 @@
"graphology-metrics": "^2.1.0",
"graphology-shortest-path": "^2.0.2",
"hold-event": "^0.2.0",
"react-use-gesture": "^9.1.3",
"reakeys": "^2.0.3",
"three": "^0.154.0",
"three-stdlib": "^2.23.13",
@ -11291,6 +11281,15 @@
"react-dom": ">=16"
}
},
"node_modules/reagraph/node_modules/use-sync-external-store": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz",
"integrity": "sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==",
"license": "MIT",
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
}
},
"node_modules/reagraph/node_modules/zustand": {
"version": "4.3.9",
"resolved": "https://registry.npmjs.org/zustand/-/zustand-4.3.9.tgz",
@ -11466,9 +11465,9 @@
}
},
"node_modules/rollup": {
"version": "4.20.0",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-4.20.0.tgz",
"integrity": "sha512-6rbWBChcnSGzIlXeIdNIZTopKYad8ZG8ajhl78lGRLsI2rX8IkaotQhVas2Ma+GPxJav19wrSzvRvuiv0YKzWw==",
"version": "4.21.0",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-4.21.0.tgz",
"integrity": "sha512-vo+S/lfA2lMS7rZ2Qoubi6I5hwZwzXeUIctILZLbHI+laNtvhhOIon2S1JksA5UEDQ7l3vberd0fxK44lTYjbQ==",
"dev": true,
"license": "MIT",
"dependencies": {
@ -11482,22 +11481,22 @@
"npm": ">=8.0.0"
},
"optionalDependencies": {
"@rollup/rollup-android-arm-eabi": "4.20.0",
"@rollup/rollup-android-arm64": "4.20.0",
"@rollup/rollup-darwin-arm64": "4.20.0",
"@rollup/rollup-darwin-x64": "4.20.0",
"@rollup/rollup-linux-arm-gnueabihf": "4.20.0",
"@rollup/rollup-linux-arm-musleabihf": "4.20.0",
"@rollup/rollup-linux-arm64-gnu": "4.20.0",
"@rollup/rollup-linux-arm64-musl": "4.20.0",
"@rollup/rollup-linux-powerpc64le-gnu": "4.20.0",
"@rollup/rollup-linux-riscv64-gnu": "4.20.0",
"@rollup/rollup-linux-s390x-gnu": "4.20.0",
"@rollup/rollup-linux-x64-gnu": "4.20.0",
"@rollup/rollup-linux-x64-musl": "4.20.0",
"@rollup/rollup-win32-arm64-msvc": "4.20.0",
"@rollup/rollup-win32-ia32-msvc": "4.20.0",
"@rollup/rollup-win32-x64-msvc": "4.20.0",
"@rollup/rollup-android-arm-eabi": "4.21.0",
"@rollup/rollup-android-arm64": "4.21.0",
"@rollup/rollup-darwin-arm64": "4.21.0",
"@rollup/rollup-darwin-x64": "4.21.0",
"@rollup/rollup-linux-arm-gnueabihf": "4.21.0",
"@rollup/rollup-linux-arm-musleabihf": "4.21.0",
"@rollup/rollup-linux-arm64-gnu": "4.21.0",
"@rollup/rollup-linux-arm64-musl": "4.21.0",
"@rollup/rollup-linux-powerpc64le-gnu": "4.21.0",
"@rollup/rollup-linux-riscv64-gnu": "4.21.0",
"@rollup/rollup-linux-s390x-gnu": "4.21.0",
"@rollup/rollup-linux-x64-gnu": "4.21.0",
"@rollup/rollup-linux-x64-musl": "4.21.0",
"@rollup/rollup-win32-arm64-msvc": "4.21.0",
"@rollup/rollup-win32-ia32-msvc": "4.21.0",
"@rollup/rollup-win32-x64-msvc": "4.21.0",
"fsevents": "~2.3.2"
}
},
@ -12101,16 +12100,6 @@
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/sucrase/node_modules/minipass": {
"version": "7.1.2",
"resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz",
"integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==",
"dev": true,
"license": "ISC",
"engines": {
"node": ">=16 || 14 >=14.17"
}
},
"node_modules/supports-color": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
@ -12145,9 +12134,9 @@
}
},
"node_modules/tailwindcss": {
"version": "3.4.9",
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.9.tgz",
"integrity": "sha512-1SEOvRr6sSdV5IDf9iC+NU4dhwdqzF4zKKq3sAbasUWHEM6lsMhX+eNN5gkPx1BvLFEnZQEUFbXnGj8Qlp83Pg==",
"version": "3.4.10",
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.10.tgz",
"integrity": "sha512-KWZkVPm7yJRhdu4SRSl9d4AK2wM3a50UsvgHZO7xY77NQr2V+fIrEuoDGQcbvswWvFGbS2f6e+jC/6WJm1Dl0w==",
"dev": true,
"license": "MIT",
"dependencies": {
@ -12578,15 +12567,15 @@
}
},
"node_modules/typescript-eslint": {
"version": "8.1.0",
"resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.1.0.tgz",
"integrity": "sha512-prB2U3jXPJLpo1iVLN338Lvolh6OrcCZO+9Yv6AR+tvegPPptYCDBIHiEEUdqRi8gAv2bXNKfMUrgAd2ejn/ow==",
"version": "8.2.0",
"resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.2.0.tgz",
"integrity": "sha512-DmnqaPcML0xYwUzgNbM1XaKXpEb7BShYf2P1tkUmmcl8hyeG7Pj08Er7R9bNy6AufabywzJcOybQAtnD/c9DGw==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/eslint-plugin": "8.1.0",
"@typescript-eslint/parser": "8.1.0",
"@typescript-eslint/utils": "8.1.0"
"@typescript-eslint/eslint-plugin": "8.2.0",
"@typescript-eslint/parser": "8.2.0",
"@typescript-eslint/utils": "8.2.0"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@ -12618,9 +12607,9 @@
}
},
"node_modules/undici-types": {
"version": "6.13.0",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.13.0.tgz",
"integrity": "sha512-xtFJHudx8S2DSoujjMd1WeWvn7KKWFRESZTMeL1RptAYERu29D6jphMjjY+vn96jvN3kVPDNxU/E13VTaXj6jg==",
"version": "6.19.8",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz",
"integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==",
"dev": true,
"license": "MIT"
},
@ -12666,15 +12655,15 @@
}
},
"node_modules/use-debounce": {
"version": "10.0.2",
"resolved": "https://registry.npmjs.org/use-debounce/-/use-debounce-10.0.2.tgz",
"integrity": "sha512-MwBiJK2dk+2qhMDVDCPRPeLuIekKfH2t1UYMnrW9pwcJJGFDbTLliSMBz2UKGmE1PJs8l3XoMqbIU1MemMAJ8g==",
"version": "10.0.3",
"resolved": "https://registry.npmjs.org/use-debounce/-/use-debounce-10.0.3.tgz",
"integrity": "sha512-DxQSI9ZKso689WM1mjgGU3ozcxU1TJElBJ3X6S4SMzMNcm2lVH0AHmyXB+K7ewjz2BSUKJTDqTcwtSMRfB89dg==",
"license": "MIT",
"engines": {
"node": ">= 16.0.0"
},
"peerDependencies": {
"react": ">=16.8.0"
"react": "*"
}
},
"node_modules/use-isomorphic-layout-effect": {
@ -12692,9 +12681,9 @@
}
},
"node_modules/use-sync-external-store": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz",
"integrity": "sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==",
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.2.tgz",
"integrity": "sha512-PElTlVMwpblvbNqQ82d2n6RjStvdSoNe9FG28kNfz3WiXilJm4DdNkEzRhCZuIDwY8U08WVihhGR5iRqAwfDiw==",
"license": "MIT",
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
@ -12745,15 +12734,15 @@
}
},
"node_modules/vite": {
"version": "5.4.0",
"resolved": "https://registry.npmjs.org/vite/-/vite-5.4.0.tgz",
"integrity": "sha512-5xokfMX0PIiwCMCMb9ZJcMyh5wbBun0zUzKib+L65vAZ8GY9ePZMXxFrHbr/Kyll2+LSCY7xtERPpxkBDKngwg==",
"version": "5.4.2",
"resolved": "https://registry.npmjs.org/vite/-/vite-5.4.2.tgz",
"integrity": "sha512-dDrQTRHp5C1fTFzcSaMxjk6vdpKvT+2/mIdE07Gw2ykehT49O0z/VHS3zZ8iV/Gh8BJJKHWOe5RjaNrW5xf/GA==",
"dev": true,
"license": "MIT",
"dependencies": {
"esbuild": "^0.21.3",
"postcss": "^8.4.40",
"rollup": "^4.13.0"
"postcss": "^8.4.41",
"rollup": "^4.20.0"
},
"bin": {
"vite": "bin/vite.js"
@ -13138,12 +13127,12 @@
}
},
"node_modules/zustand": {
"version": "4.5.4",
"resolved": "https://registry.npmjs.org/zustand/-/zustand-4.5.4.tgz",
"integrity": "sha512-/BPMyLKJPtFEvVL0E9E9BTUM63MNyhPGlvxk1XjrfWTUlV+BR8jufjsovHzrtR6YNcBEcL7cMHovL1n9xHawEg==",
"version": "4.5.5",
"resolved": "https://registry.npmjs.org/zustand/-/zustand-4.5.5.tgz",
"integrity": "sha512-+0PALYNJNgK6hldkgDq2vLrw5f6g/jCInz52n9RTpropGgeAf/ioFUCdtsjCqu4gNhW9D01rUQBROoRjdzyn2Q==",
"license": "MIT",
"dependencies": {
"use-sync-external-store": "1.2.0"
"use-sync-external-store": "1.2.2"
},
"engines": {
"node": ">=12.7.0"

View File

@ -18,7 +18,7 @@
"@uiw/react-codemirror": "^4.23.0",
"axios": "^1.7.4",
"clsx": "^2.1.1",
"framer-motion": "^11.3.24",
"framer-motion": "^11.3.29",
"html-to-image": "^1.11.11",
"js-file-download": "^0.4.12",
"react": "^18.3.1",
@ -27,21 +27,21 @@
"react-icons": "^5.3.0",
"react-intl": "^6.6.8",
"react-loader-spinner": "^6.1.6",
"react-router-dom": "^6.26.0",
"react-router-dom": "^6.26.1",
"react-select": "^5.8.0",
"react-tabs": "^6.0.2",
"react-toastify": "^10.0.5",
"react-tooltip": "^5.28.0",
"react-zoom-pan-pinch": "^3.6.1",
"reactflow": "^11.11.4",
"reagraph": "^4.19.2",
"use-debounce": "^10.0.2"
"reagraph": "^4.19.3",
"use-debounce": "^10.0.3"
},
"devDependencies": {
"@lezer/generator": "^1.7.1",
"@types/jest": "^29.5.12",
"@types/node": "^22.2.0",
"@types/react": "^18.3.3",
"@types/node": "^22.5.0",
"@types/react": "^18.3.4",
"@types/react-dom": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^8.0.1",
"@typescript-eslint/parser": "^8.0.1",
@ -53,11 +53,11 @@
"globals": "^15.9.0",
"jest": "^29.7.0",
"postcss": "^8.4.41",
"tailwindcss": "^3.4.9",
"tailwindcss": "^3.4.10",
"ts-jest": "^29.2.4",
"typescript": "^5.5.4",
"typescript-eslint": "^8.1.0",
"vite": "^5.4.0"
"typescript-eslint": "^8.2.0",
"vite": "^5.4.2"
},
"jest": {
"preset": "ts-jest",

View File

@ -6,6 +6,7 @@ import {
ILibraryCreateData,
ILibraryItem,
ILibraryUpdateData,
IRenameLocationData,
ITargetAccessPolicy,
ITargetLocation,
IVersionData
@ -94,6 +95,13 @@ export function patchSetLocation(target: string, request: FrontPush<ITargetLocat
});
}
export function patchRenameLocation(request: FrontPush<IRenameLocationData>) {
AxiosPatch({
endpoint: `/api/library/rename-location`,
request: request
});
}
export function patchSetEditors(target: string, request: FrontPush<ITargetUsers>) {
AxiosPatch({
endpoint: `/api/library/${target}/set-editors`,

View File

@ -24,6 +24,7 @@ import {
IconStatusIncalculable,
IconStatusOK,
IconStatusUnknown,
IconSubfolders,
IconTemplates,
IconTerm,
IconText,
@ -62,6 +63,14 @@ export function VisibilityIcon({ value, size = '1.25rem', className }: DomIconPr
}
}
export function SubfoldersIcon({ value, size = '1.25rem', className }: DomIconProps<boolean>) {
if (value) {
return <IconSubfolders size={size} className={className ?? 'clr-text-green'} />;
} else {
return <IconSubfolders size={size} className={className ?? 'clr-text-controls'} />;
}
}
export function LocationIcon({ value, size = '1.25rem', className }: DomIconProps<string>) {
switch (value.substring(0, 2) as LocationHead) {
case LocationHead.COMMON:

View File

@ -34,6 +34,8 @@ export { LuMoon as IconDarkTheme } from 'react-icons/lu';
export { LuSun as IconLightTheme } from 'react-icons/lu';
export { LuFolderTree as IconFolderTree } from 'react-icons/lu';
export { LuFolder as IconFolder } from 'react-icons/lu';
export { LuFolders as IconSubfolders } from 'react-icons/lu';
export { LuFolderEdit as IconFolderEdit } from 'react-icons/lu';
export { LuFolderOpen as IconFolderOpened } from 'react-icons/lu';
export { LuFolderClosed as IconFolderClosed } from 'react-icons/lu';
export { LuFolderDot as IconFolderEmpty } from 'react-icons/lu';
@ -47,6 +49,8 @@ export { BiChevronLeft as IconPageLeft } from 'react-icons/bi';
export { BiChevronRight as IconPageRight } from 'react-icons/bi';
export { BiFirstPage as IconPageFirst } from 'react-icons/bi';
export { BiLastPage as IconPageLast } from 'react-icons/bi';
export { TbCalendarPlus as IconDateCreate } from 'react-icons/tb';
export { TbCalendarRepeat as IconDateUpdate } from 'react-icons/tb';
// ==== User status =======
export { LuUserCircle2 as IconUser } from 'react-icons/lu';
@ -117,6 +121,7 @@ export { BiCollapse as IconGraphCollapse } from 'react-icons/bi';
export { BiExpand as IconGraphExpand } from 'react-icons/bi';
export { LuMaximize as IconGraphMaximize } from 'react-icons/lu';
export { BiGitBranch as IconGraphInputs } from 'react-icons/bi';
export { TbEarScan as IconGraphInverse } from 'react-icons/tb';
export { BiGitMerge as IconGraphOutputs } from 'react-icons/bi';
export { LuAtom as IconGraphCore } from 'react-icons/lu';
export { LuRotate3D as IconRotate3D } from 'react-icons/lu';

View File

@ -10,7 +10,6 @@ import { forwardRef, useCallback, useMemo, useRef } from 'react';
import Label from '@/components/ui/Label';
import { useConceptOptions } from '@/context/ConceptOptionsContext';
import { getFontClassName } from '@/models/miscellaneousAPI';
import { ConstituentaID, IRSForm } from '@/models/rsform';
import { generateAlias, getCstTypePrefix, guessCstType } from '@/models/rsformAPI';
import { extractGlobals } from '@/models/rslangAPI';
@ -64,7 +63,7 @@ const RSInput = forwardRef<ReactCodeMirrorRef, RSInputProps>(
},
ref
) => {
const { darkMode, colors, mathFont } = useConceptOptions();
const { darkMode, colors } = useConceptOptions();
const internalRef = useRef<ReactCodeMirrorRef>(null);
const thisRef = useMemo(() => (!ref || typeof ref === 'function' ? internalRef : ref), [internalRef, ref]);
@ -152,7 +151,7 @@ const RSInput = forwardRef<ReactCodeMirrorRef, RSInputProps>(
<div className={clsx('flex flex-col gap-2', className, cursor)} style={style}>
<Label text={label} />
<CodeMirror
className={getFontClassName(mathFont)}
className={'font-math'}
id={id}
ref={thisRef}
basicSetup={editorSetup}

View File

@ -18,6 +18,7 @@ function InfoUsers({ items, className, prefix, ...restProps }: InfoUsersProps) {
{items.map((user, index) => (
<div key={`${prefix}${index}`}>{getUserLabel(user)}</div>
))}
{items.length === 0 ? <div className='text-center'>Пользователи не выбраны</div> : null}
</div>
);
}

View File

@ -82,7 +82,8 @@ function PickMultiConstituenta({ id, schema, prefixID, rows, selected, setSelect
{schema ? (
<ToolbarGraphSelection
graph={schema.graph}
core={schema.items.filter(cst => isBasicConcept(cst.cst_type)).map(cst => cst.id)}
isCore={cstID => isBasicConcept(schema.cstByID.get(cstID)?.cst_type)}
isOwned={cstID => !schema.cstByID.get(cstID)?.is_inherited}
setSelected={setSelected}
emptySelection={selected.length === 0}
className='w-full ml-8'

View File

@ -1,4 +1,5 @@
import clsx from 'clsx';
import { useCallback } from 'react';
import { Graph } from '@/models/Graph';
@ -7,8 +8,10 @@ import {
IconGraphCore,
IconGraphExpand,
IconGraphInputs,
IconGraphInverse,
IconGraphMaximize,
IconGraphOutputs,
IconPredecessor,
IconReset
} from '../Icons';
import { CProps } from '../props';
@ -16,7 +19,8 @@ import MiniButton from '../ui/MiniButton';
interface ToolbarGraphSelectionProps extends CProps.Styling {
graph: Graph;
core: number[];
isCore: (item: number) => boolean;
isOwned: (item: number) => boolean;
setSelected: React.Dispatch<React.SetStateAction<number[]>>;
emptySelection?: boolean;
}
@ -24,11 +28,27 @@ interface ToolbarGraphSelectionProps extends CProps.Styling {
function ToolbarGraphSelection({
className,
graph,
core,
isCore,
isOwned,
setSelected,
emptySelection,
...restProps
}: ToolbarGraphSelectionProps) {
const handleSelectCore = useCallback(() => {
const core = [...graph.nodes.keys()].filter(isCore);
setSelected([...core, ...graph.expandInputs(core)]);
}, [setSelected, graph, isCore]);
const handleSelectOwned = useCallback(
() => setSelected([...graph.nodes.keys()].filter(isOwned)),
[setSelected, graph, isOwned]
);
const handleInvertSelection = useCallback(
() => setSelected(prev => [...graph.nodes.keys()].filter(item => !prev.includes(item))),
[setSelected, graph]
);
return (
<div className={clsx('cc-icons', className)} {...restProps}>
<MiniButton
@ -67,10 +87,20 @@ function ToolbarGraphSelection({
onClick={() => setSelected(prev => [...prev, ...graph.expandOutputs(prev)])}
disabled={emptySelection}
/>
<MiniButton
titleHtml='Инвертировать'
icon={<IconGraphInverse size='1.25rem' className='icon-primary' />}
onClick={handleInvertSelection}
/>
<MiniButton
titleHtml='Выделить ядро'
icon={<IconGraphCore size='1.25rem' className='icon-primary' />}
onClick={() => setSelected([...core, ...graph.expandInputs(core)])}
onClick={handleSelectCore}
/>
<MiniButton
titleHtml='Выделить собственные'
icon={<IconPredecessor size='1.25rem' className='icon-primary' />}
onClick={handleSelectOwned}
/>
</div>
);

View File

@ -0,0 +1,48 @@
import clsx from 'clsx';
import { CProps } from '../props';
import MiniButton from './MiniButton';
interface IconValueProps extends CProps.Styling, CProps.Titled {
id?: string;
icon: React.ReactNode;
value: string | number;
onClick?: (event: CProps.EventMouse) => void;
dense?: boolean;
disabled?: boolean;
}
function IconValue({
id,
dense,
value,
icon,
disabled = true,
title,
titleHtml,
hideTitle,
className,
onClick,
...restProps
}: IconValueProps) {
return (
<div
className={clsx('flex items-center', { 'justify-between gap-6 text-right': !dense, 'gap-2': dense }, className)}
{...restProps}
>
<MiniButton
noHover
noPadding
title={title}
titleHtml={titleHtml}
hideTitle={hideTitle}
icon={icon}
disabled={disabled}
onClick={onClick}
/>
<span id={id}>{value}</span>
</div>
);
}
export default IconValue;

View File

@ -5,7 +5,6 @@ import { createContext, useCallback, useContext, useLayoutEffect, useMemo, useSt
import Tooltip from '@/components/ui/Tooltip';
import useLocalStorage from '@/hooks/useLocalStorage';
import { FontStyle } from '@/models/miscellaneous';
import { animationDuration } from '@/styling/animations';
import { darkT, IColorTheme, lightT } from '@/styling/color';
import { globals, storage } from '@/utils/constants';
@ -23,9 +22,6 @@ interface IOptionsContext {
adminMode: boolean;
toggleAdminMode: () => void;
mathFont: FontStyle;
setMathFont: (value: FontStyle) => void;
noNavigationAnimation: boolean;
noNavigation: boolean;
toggleNoNavigation: () => void;
@ -58,7 +54,6 @@ interface OptionsStateProps {
export const OptionsState = ({ children }: OptionsStateProps) => {
const [darkMode, setDarkMode] = useLocalStorage(storage.themeDark, false);
const [adminMode, setAdminMode] = useLocalStorage(storage.optionsAdmin, false);
const [mathFont, setMathFont] = useLocalStorage<FontStyle>(storage.rseditFont, 'math');
const [showHelp, setShowHelp] = useLocalStorage(storage.optionsHelp, true);
const [noNavigation, setNoNavigation] = useState(false);
@ -128,8 +123,6 @@ export const OptionsState = ({ children }: OptionsStateProps) => {
darkMode,
adminMode,
colors,
mathFont,
setMathFont,
noNavigationAnimation,
noNavigation,
noFooter,

View File

@ -8,13 +8,14 @@ import {
getAdminLibrary,
getLibrary,
getTemplates,
patchRenameLocation,
postCloneLibraryItem,
postCreateLibraryItem
} from '@/backend/library';
import { getRSFormDetails, postRSFormFromFile } from '@/backend/rsforms';
import { ErrorData } from '@/components/info/InfoError';
import { FolderTree } from '@/models/FolderTree';
import { ILibraryItem, LibraryItemID, LocationHead } from '@/models/library';
import { ILibraryItem, IRenameLocationData, LibraryItemID, LocationHead } from '@/models/library';
import { ILibraryCreateData } from '@/models/library';
import { matchLibraryItem, matchLibraryItemLocation } from '@/models/libraryAPI';
import { ILibraryFilter } from '@/models/miscellaneous';
@ -45,6 +46,7 @@ interface ILibraryContext {
createItem: (data: ILibraryCreateData, callback?: DataCallback<ILibraryItem>) => void;
cloneItem: (target: LibraryItemID, data: IRSFormCloneData, callback: DataCallback<IRSFormData>) => void;
destroyItem: (target: LibraryItemID, callback?: () => void) => void;
renameLocation: (data: IRenameLocationData, callback?: () => void) => void;
localUpdateItem: (data: ILibraryItem) => void;
localUpdateTimestamp: (target: LibraryItemID) => void;
@ -92,7 +94,13 @@ export const LibraryState = ({ children }: LibraryStateProps) => {
result = result.filter(item => item.location.startsWith(filter.head!));
}
if (filter.folderMode && filter.location) {
result = result.filter(item => item.location == filter.location);
if (filter.subfolders) {
result = result.filter(
item => item.location == filter.location || item.location.startsWith(filter.location! + '/')
);
} else {
result = result.filter(item => item.location == filter.location);
}
}
if (filter.type) {
result = result.filter(item => item.item_type === filter.type);
@ -270,6 +278,23 @@ export const LibraryState = ({ children }: LibraryStateProps) => {
[reloadItems, user]
);
const renameLocation = useCallback(
(data: IRenameLocationData, callback?: () => void) => {
setProcessingError(undefined);
patchRenameLocation({
data: data,
showError: true,
setLoading: setProcessing,
onError: setProcessingError,
onSuccess: () =>
reloadItems(() => {
if (callback) callback();
})
});
},
[reloadItems, user]
);
return (
<LibraryContext.Provider
value={{
@ -290,6 +315,8 @@ export const LibraryState = ({ children }: LibraryStateProps) => {
createItem,
cloneItem,
destroyItem,
renameLocation,
retrieveTemplate,
localUpdateItem,
localUpdateTimestamp

View File

@ -45,7 +45,7 @@ function DlgChangeLocation({ hideWindow, initial, onChangeLocation }: DlgChangeL
onSubmit={() => onChangeLocation(location)}
className={clsx('w-[35rem]', 'pb-3 px-6 flex gap-3')}
>
<div className='flex flex-col gap-2 w-[7rem] h-min'>
<div className='flex flex-col gap-2 min-w-[7rem] h-min'>
<Label className='select-none' text='Корень' />
<SelectLocationHead
value={head} // prettier: split-lines

View File

@ -132,6 +132,14 @@ export interface ITargetLocation {
location: string;
}
/**
* Represents update data for renaming Location.
*/
export interface IRenameLocationData {
target: string;
new_location: string;
}
/**
* Represents data, used for creating {@link IRSForm}.
*/

View File

@ -55,11 +55,6 @@ export type GraphColoring = 'none' | 'status' | 'type';
*/
export type GraphSizing = 'none' | 'complex' | 'derived';
/**
* Represents font styles.
*/
export type FontStyle = 'controls' | 'main' | 'math' | 'math2';
/**
* Represents manuals topic.
*/
@ -180,6 +175,7 @@ export interface ILibraryFilter {
query?: string;
folderMode?: boolean;
subfolders?: boolean;
path?: string;
head?: LocationHead;
location?: string;

View File

@ -1,16 +1,9 @@
/**
* Module: API for miscellaneous frontend model types. Future targets for refactoring aimed at extracting modules.
*/
import { DependencyMode, FontStyle, GraphSizing } from './miscellaneous';
import { DependencyMode, GraphSizing } from './miscellaneous';
import { IConstituenta, IRSForm } from './rsform';
/**
* Create style name from {@link FontStyle}.
*/
export function getFontClassName(style: FontStyle): string {
return `font-${style}`;
}
/**
* Filter list of {@link ILibraryItem} to a given graph query.
*/

View File

@ -202,7 +202,7 @@ export function guessCstType(hint: string, defaultType: CstType = CstType.TERM):
/**
* Evaluate if {@link CstType} is basic concept.
*/
export function isBasicConcept(type: CstType): boolean {
export function isBasicConcept(type?: CstType): boolean {
// prettier-ignore
switch (type) {
case CstType.BASE: return true;
@ -213,6 +213,7 @@ export function isBasicConcept(type: CstType): boolean {
case CstType.FUNCTION: return false;
case CstType.PREDICATE: return false;
case CstType.THEOREM: return false;
case undefined: return false;
}
}

View File

@ -2,14 +2,17 @@
import { AnimatePresence } from 'framer-motion';
import { useCallback, useLayoutEffect, useMemo, useState } from 'react';
import { toast } from 'react-toastify';
import DataLoader from '@/components/wrap/DataLoader';
import { useAuth } from '@/context/AuthContext';
import { useLibrary } from '@/context/LibraryContext';
import DlgChangeLocation from '@/dialogs/DlgChangeLocation';
import useLocalStorage from '@/hooks/useLocalStorage';
import { ILibraryItem, LocationHead } from '@/models/library';
import { ILibraryItem, IRenameLocationData, LocationHead } from '@/models/library';
import { ILibraryFilter } from '@/models/miscellaneous';
import { storage } from '@/utils/constants';
import { information } from '@/utils/labels';
import { toggleTristateFlag } from '@/utils/utils';
import TableLibraryItems from './TableLibraryItems';
@ -26,14 +29,12 @@ function LibraryPage() {
const [head, setHead] = useLocalStorage<LocationHead | undefined>(storage.librarySearchHead, undefined);
const [folderMode, setFolderMode] = useLocalStorage<boolean>(storage.librarySearchFolderMode, true);
const [subfolders, setSubfolders] = useLocalStorage<boolean>(storage.librarySearchSubfolders, false);
const [location, setLocation] = useLocalStorage<string>(storage.librarySearchLocation, '');
const [isVisible, setIsVisible] = useLocalStorage<boolean | undefined>(storage.librarySearchVisible, true);
const [isSubscribed, setIsSubscribed] = useLocalStorage<boolean | undefined>(
storage.librarySearchSubscribed,
undefined
);
const [isOwned, setIsOwned] = useLocalStorage<boolean | undefined>(storage.librarySearchEditor, undefined);
const [isEditor, setIsEditor] = useLocalStorage<boolean | undefined>(storage.librarySearchEditor, undefined);
const [showRenameLocation, setShowRenameLocation] = useState(false);
const filter: ILibraryFilter = useMemo(
() => ({
@ -42,12 +43,12 @@ function LibraryPage() {
query: query,
isEditor: user ? isEditor : undefined,
isOwned: user ? isOwned : undefined,
isSubscribed: user ? isSubscribed : undefined,
isVisible: user ? isVisible : true,
folderMode: folderMode,
subfolders: subfolders,
location: location
}),
[head, path, query, isEditor, isOwned, isSubscribed, isVisible, user, folderMode, location]
[head, path, query, isEditor, isOwned, isVisible, user, folderMode, location, subfolders]
);
const hasCustomFilter = useMemo(
@ -70,17 +71,35 @@ function LibraryPage() {
const toggleOwned = useCallback(() => setIsOwned(prev => toggleTristateFlag(prev)), [setIsOwned]);
const toggleEditor = useCallback(() => setIsEditor(prev => toggleTristateFlag(prev)), [setIsEditor]);
const toggleFolderMode = useCallback(() => setFolderMode(prev => !prev), [setFolderMode]);
const toggleSubfolders = useCallback(() => setSubfolders(prev => !prev), [setSubfolders]);
const resetFilter = useCallback(() => {
setQuery('');
setPath('');
setHead(undefined);
setIsVisible(true);
setIsSubscribed(undefined);
setIsOwned(undefined);
setIsEditor(undefined);
setLocation('');
}, [setHead, setIsVisible, setIsSubscribed, setIsOwned, setIsEditor, setLocation]);
}, [setHead, setIsVisible, setIsOwned, setIsEditor, setLocation]);
const promptRenameLocation = useCallback(() => {
setShowRenameLocation(true);
}, []);
const handleRenameLocation = useCallback(
(newLocation: string) => {
const data: IRenameLocationData = {
target: location,
new_location: newLocation
};
library.renameLocation(data, () => {
setLocation(newLocation);
toast.success(information.locationRenamed);
});
},
[location, library]
);
const viewLibrary = useMemo(
() => (
@ -99,11 +118,14 @@ function LibraryPage() {
<ViewSideLocation
active={location}
setActive={setLocation}
subfolders={subfolders}
folderTree={library.folders}
toggleFolderMode={toggleFolderMode}
toggleSubfolders={toggleSubfolders}
onRenameLocation={promptRenameLocation}
/>
),
[location, library.folders, setLocation, toggleFolderMode]
[location, library.folders, setLocation, toggleFolderMode, subfolders]
);
return (
@ -113,6 +135,13 @@ function LibraryPage() {
error={library.loadingError}
hasNoData={library.items.length === 0}
>
{showRenameLocation ? (
<DlgChangeLocation
initial={location}
onChangeLocation={handleRenameLocation}
hideWindow={() => setShowRenameLocation(false)}
/>
) : null}
<ToolbarSearch
total={library.items.length ?? 0}
filtered={items.length}

View File

@ -103,7 +103,9 @@ function ToolbarSearch({
'clr-input'
)}
>
<div className={clsx('px-3 pt-1 self-center', 'min-w-[5.5rem]', 'select-none', 'whitespace-nowrap')}>
<div
className={clsx('px-3 pt-1 self-center', 'min-w-[6rem] sm:min-w-[7rem]', 'select-none', 'whitespace-nowrap')}
>
{filtered} из {total}
</div>

View File

@ -3,11 +3,14 @@ import { motion } from 'framer-motion';
import { useCallback, useMemo } from 'react';
import { toast } from 'react-toastify';
import { IconFolderTree } from '@/components/Icons';
import { SubfoldersIcon } from '@/components/DomainIcons';
import { IconFolderEdit, IconFolderTree } from '@/components/Icons';
import BadgeHelp from '@/components/info/BadgeHelp';
import { CProps } from '@/components/props';
import SelectLocation from '@/components/select/SelectLocation';
import MiniButton from '@/components/ui/MiniButton';
import { useAuth } from '@/context/AuthContext';
import { useLibrary } from '@/context/LibraryContext';
import useWindowSize from '@/hooks/useWindowSize';
import { FolderNode, FolderTree } from '@/models/FolderTree';
import { HelpTopic } from '@/models/miscellaneous';
@ -17,12 +20,25 @@ import { information } from '@/utils/labels';
interface ViewSideLocationProps {
folderTree: FolderTree;
subfolders: boolean;
active: string;
setActive: React.Dispatch<React.SetStateAction<string>>;
toggleFolderMode: () => void;
toggleSubfolders: () => void;
onRenameLocation: () => void;
}
function ViewSideLocation({ folderTree, active, setActive: setActive, toggleFolderMode }: ViewSideLocationProps) {
function ViewSideLocation({
folderTree,
active,
subfolders,
setActive: setActive,
toggleFolderMode,
toggleSubfolders,
onRenameLocation
}: ViewSideLocationProps) {
const { user } = useAuth();
const { items } = useLibrary();
const windowSize = useWindowSize();
const handleClickFolder = useCallback(
(event: CProps.EventMouse, target: FolderNode) => {
@ -40,6 +56,18 @@ function ViewSideLocation({ folderTree, active, setActive: setActive, toggleFold
[setActive]
);
const canRename = useMemo(() => {
if (active.length <= 3 || !user) {
return false;
}
if (user.is_staff) {
return true;
}
const owned = items.filter(item => item.owner == user.id);
const located = owned.filter(item => item.location == active || item.location.startsWith(`${active}/`));
return located.length !== 0;
}, [active, user, items]);
const animations = useMemo(() => animateSideMinWidth(windowSize.isSmall ? '10rem' : '15rem'), [windowSize]);
return (
@ -56,11 +84,20 @@ function ViewSideLocation({ folderTree, active, setActive: setActive, toggleFold
offset={5}
place='right-start'
/>
<MiniButton
icon={<IconFolderTree size='1.25rem' className='icon-green' />}
title='Переключение в режим Поиск'
onClick={toggleFolderMode}
/>
<div className='cc-icons'>
<MiniButton
icon={<IconFolderEdit size='1.25rem' className='icon-primary' />}
titleHtml='<b>Редактирование пути</b><br/>Перемещаются только Ваши схемы<br/>в указанной папке (и подпапках)'
onClick={onRenameLocation}
disabled={!canRename}
/>
<MiniButton title='Вложенные папки' icon={<SubfoldersIcon value={subfolders} />} onClick={toggleSubfolders} />
<MiniButton
icon={<IconFolderTree size='1.25rem' className='icon-green' />}
title='Переключение в режим Поиск'
onClick={toggleFolderMode}
/>
</div>
</div>
<SelectLocation
value={active}

View File

@ -1,4 +1,4 @@
import { IconRSForm } from '@/components/Icons';
import { IconChild, IconPredecessor, IconRSForm } from '@/components/Icons';
import LinkTopic from '@/components/ui/LinkTopic';
import { HelpTopic } from '@/models/miscellaneous';
@ -17,8 +17,8 @@ function HelpThesaurus() {
<h2>Концептуальная схема</h2>
<p>
<IconRSForm size='1rem' className='inline-icon' />{' '}
<LinkTopic text='Концептуальная схема' topic={HelpTopic.CC_SYSTEM} /> (система определений, КС) совокупность
отдельных понятий и утверждений, а также связей между ними, задаваемых определениями.
<LinkTopic text='Концептуальная схема' topic={HelpTopic.CC_SYSTEM} /> (<i>система определений, КС</i>)
совокупность отдельных понятий и утверждений, а также связей между ними, задаваемых определениями.
</p>
<p>
Экспликация КС изложение (процесс и результат) концептуальной схемы с помощью заданного языка описания
@ -30,7 +30,82 @@ function HelpThesaurus() {
</p>
<h2>Конституента</h2>
<p>Раздел в разработке...</p>
<p>
Конституента это выделенная часть КС, являющаяся отдельным понятием, схемой построения понятия, либо
утверждением, связывающим введенные понятия.{' '}
<LinkTopic text='Аттрибутами конституенты' topic={HelpTopic.CC_CONSTITUENTA} /> в родоструктурной экспликации
являются Термин, Конвенция, Типизация (Структура), Формальное определение, Текстовое определение, Комментарий.
</p>
<ul>
По <b>наличию формального определения в рамках КС</b> выделены:
<li>
базовое понятие (<i>неопределяемое понятие</i>) не имеет определения и задано конвенцией и аксиомами;
</li>
<li>
производное понятие (<i>выводимое понятие</i>) имеет определение.
</li>
</ul>
<br />
<ul>
Для описания <b>тесно связанных понятий</b> введены следующие термины:
<li>
порождающее выражение формальное определение, основанное на одной внешней конституенте и использующее только
формальное разворачивание (не вводит нового предметного содержания);
</li>
<li>основа данного понятия понятие, на котором основано порождающее выражение данной конституенты;</li>
<li>
порожденное понятие данным понятием понятие, определение которого является порождающим выражением,
основанным на данном понятии.
</li>
</ul>
<br />
<ul>
Для описания <b>отождествления</b> введены:
<li>отождествляемые конституенты конституенты, состоящие в отождествлении;</li>
<li>удаляемая конституента конституента, удаляемая в ходе отождествления;</li>
<li>
замещающая конституента конституента, обозначение которой замещает обозначение удаляемой конституенты в
формальных выражениях иных конституент в ходе отождествления;
</li>
</ul>
<br />
<ul>
Для описания <b>наследования</b> конституент в рамках ОСС введены:
<li>
<IconChild size='1rem' className='inline-icon' /> наследованная конституента конституента, перенесенная из
другой КС в рамках операции синтеза;
</li>
<li>собственная конституента конституента, не являющаяся наследником других конституент;</li>
<li>
<IconPredecessor size='1rem' className='inline-icon' /> исходная конституента для данной конституенты
собственная конституента, прямым или опосредованным наследником которой является данная конституента.
</li>
</ul>
<br />
<ul>
По <b>назначению</b> выделены:
<li>
базисное множество (X1) задает неопределяемое понятие, представленное структурой множества, чьи элементы
различимы и не сравнимы с элементами других базисных множеств;
</li>
<li>
константное множество (C1) задает неопределяемое понятие, моделируемое термом теории множеств, который
поддерживает ряд формальных операций над его элементами;
</li>
<li>
родовая структура (S1) задает неопределяемое понятие, имеющее определенную структуру, построенную на базисных
множествах и константных множеств. Содержание родовой структуры формируется{' '}
<LinkTopic text='отношением типизации' topic={HelpTopic.RSL_TYPES} />, аксиомами и конвенцией;
</li>
</ul>
<h2>Операционная схема синтеза</h2>
<p>Раздел в разработке...</p>

View File

@ -2,6 +2,7 @@ import {
IconFilterReset,
IconFolder,
IconFolderClosed,
IconFolderEdit,
IconFolderEmpty,
IconFolderOpened,
IconFolderTree,
@ -10,9 +11,12 @@ import {
IconSearch,
IconShow,
IconSortAsc,
IconSortDesc
IconSortDesc,
IconSubfolders
} from '@/components/Icons';
import LinkTopic from '@/components/ui/LinkTopic';
import { useConceptOptions } from '@/context/ConceptOptionsContext';
import { HelpTopic } from '@/models/miscellaneous';
function HelpLibrary() {
const { colors } = useConceptOptions();
@ -20,8 +24,10 @@ function HelpLibrary() {
<div>
<h1>Библиотека схем</h1>
<p>
В библиотеке собраны <IconRSForm size='1rem' className='inline-icon' /> системы определений (КС) <br />и
<IconOSS size='1rem' className='inline-icon' /> операционные схемы синтеза (ОСС).
В библиотеке собраны <IconRSForm size='1rem' className='inline-icon' />{' '}
<LinkTopic text='концептуальные схемы' topic={HelpTopic.CC_SYSTEM} /> (КС) <br />и
<IconOSS size='1rem' className='inline-icon' />{' '}
<LinkTopic text='операционные схемы синтеза' topic={HelpTopic.CC_OSS} /> (ОСС).
</p>
<li>
@ -51,20 +57,26 @@ function HelpLibrary() {
</li>
<h2>Режим: Проводник</h2>
<li>клик по папке отображает справа файлы в ней</li>
<li>
<IconFolderEdit size='1rem' className='inline-icon' /> переименовать выбранную
</li>
<li>
<IconSubfolders size='1rem' className='inline-icon icon-green' /> схемы во вложенных папках
</li>
<li>клик по папке отображает справа схемы в ней</li>
<li>Ctrl + клик по папке копирует путь в буфер обмена</li>
<li>клик по иконке сворачивает/разворачивает вложенные</li>
<li>
<IconFolderEmpty size='1rem' className='inline-icon clr-text-default' /> папка без файлов
<IconFolderEmpty size='1rem' className='inline-icon clr-text-default' /> папка без схем
</li>
<li>
<IconFolderEmpty size='1rem' className='inline-icon' /> папка с вложенными без файлов
<IconFolderEmpty size='1rem' className='inline-icon' /> папка с вложенными без схем
</li>
<li>
<IconFolder size='1rem' className='inline-icon' /> папка без вложенных
</li>
<li>
<IconFolderClosed size='1rem' className='inline-icon' /> папка с вложенными и файлами
<IconFolderClosed size='1rem' className='inline-icon' /> папка с вложенными и схемами
</li>
<li>
<IconFolderOpened size='1rem' className='inline-icon icon-green' /> развернутая папка

View File

@ -15,7 +15,6 @@ import {
IconSave,
IconSettings,
IconStatusOK,
IconText,
IconTree
} from '@/components/Icons';
import LinkTopic from '@/components/ui/LinkTopic';
@ -88,9 +87,6 @@ function HelpRSEditor() {
<li>
<IconStatusOK className='inline-icon' /> индикатор статуса определения сверху
</li>
<li>
<IconText className='inline-icon' /> переключение шрифта
</li>
<li>
<IconControls className='inline-icon' /> специальная клавиатура и горячие клавиши
</li>

View File

@ -7,7 +7,7 @@ import { IConstituenta } from '@/models/rsform';
import { tooltips } from '@/utils/labels';
interface ControlsOverlayProps {
constituenta?: IConstituenta;
constituenta: IConstituenta;
disabled: boolean;
modified: boolean;
processing: boolean;

View File

@ -134,14 +134,16 @@ function FormConstituenta({
return (
<AnimateFade className='mx-0 md:mx-auto'>
<ControlsOverlay
disabled={disabled}
modified={isModified}
processing={processing}
constituenta={state}
onEditTerm={onEditTerm}
onRename={onRename}
/>
{state ? (
<ControlsOverlay
disabled={disabled}
modified={isModified}
processing={processing}
constituenta={state}
onEditTerm={onEditTerm}
onRename={onRename}
/>
) : null}
<form
id={id}
className={clsx('cc-column', 'mt-1 w-full md:w-[48.8rem] shrink-0', 'px-6 py-1')}
@ -157,23 +159,25 @@ function FormConstituenta({
onOpenEdit={onOpenEdit}
value={term}
initialValue={state?.term_raw ?? ''}
resolved={state?.term_resolved ?? ''}
resolved={state?.term_resolved ?? 'Конституента не выбрана'}
disabled={disabled}
onChange={newValue => setTerm(newValue)}
/>
<TextArea
id='cst_typification'
rows={typification.length > ROW_SIZE_IN_CHARACTERS ? 2 : 1}
dense
noResize
noBorder
disabled={true}
label='Типизация'
value={typification}
colors='clr-app clr-text-default'
/>
{state ? (
<TextArea
id='cst_typification'
rows={typification.length > ROW_SIZE_IN_CHARACTERS ? 2 : 1}
dense
noResize
noBorder
disabled={true}
label='Типизация'
value={typification}
colors='clr-app clr-text-default'
/>
) : null}
<AnimatePresence>
<AnimateFade key='cst_expression_fade' hideContent={!!state && !state?.definition_formal && isElementary}>
<AnimateFade key='cst_expression_fade' hideContent={!state || (!state?.definition_formal && isElementary)}>
<EditorRSExpression
id='cst_expression'
label={
@ -197,7 +201,7 @@ function FormConstituenta({
onOpenEdit={onOpenEdit}
/>
</AnimateFade>
<AnimateFade key='cst_definition_fade' hideContent={!!state && !state?.definition_raw && isElementary}>
<AnimateFade key='cst_definition_fade' hideContent={!state || (!state?.definition_raw && isElementary)}>
<RefsInput
id='cst_definition'
label='Текстовое определение'
@ -213,7 +217,7 @@ function FormConstituenta({
onChange={newValue => setTextDefinition(newValue)}
/>
</AnimateFade>
<AnimateFade key='cst_convention_fade' hideContent={!showConvention}>
<AnimateFade key='cst_convention_fade' hideContent={!showConvention || !state}>
<TextArea
id='cst_convention'
spellCheck

View File

@ -1,7 +1,6 @@
import { IconControls, IconText, IconTextOff, IconTree } from '@/components/Icons';
import { IconControls, IconTree } from '@/components/Icons';
import MiniButton from '@/components/ui/MiniButton';
import Overlay from '@/components/ui/Overlay';
import { useConceptOptions } from '@/context/ConceptOptionsContext';
import { useRSForm } from '@/context/RSFormContext';
interface ToolbarRSExpressionProps {
@ -14,21 +13,9 @@ interface ToolbarRSExpressionProps {
function ToolbarRSExpression({ disabled, showControls, toggleControls, showAST }: ToolbarRSExpressionProps) {
const model = useRSForm();
const { mathFont, setMathFont } = useConceptOptions();
function toggleFont() {
setMathFont(mathFont === 'math' ? 'math2' : 'math');
}
return (
<Overlay position='top-[-0.5rem] right-0' className='cc-icons'>
<MiniButton
title='Изменить шрифт'
onClick={toggleFont}
icon={
mathFont === 'math' ? <IconText size='1.25rem' className='icon-primary' /> : <IconTextOff size='1.25rem' />
}
/>
{!disabled || model.processing ? (
<MiniButton
title='Отображение специальной клавиатуры'

View File

@ -1,11 +1,10 @@
import { useCallback } from 'react';
import { useIntl } from 'react-intl';
import { IconEdit } from '@/components/Icons';
import { IconDateCreate, IconDateUpdate, IconEditor, IconFolder, IconOwner } from '@/components/Icons';
import InfoUsers from '@/components/info/InfoUsers';
import SelectUser from '@/components/select/SelectUser';
import LabeledValue from '@/components/ui/LabeledValue';
import MiniButton from '@/components/ui/MiniButton';
import IconValue from '@/components/ui/IconValue';
import Overlay from '@/components/ui/Overlay';
import Tooltip from '@/components/ui/Tooltip';
import { useAccessMode } from '@/context/AccessModeContext';
@ -42,79 +41,76 @@ function EditorLibraryItem({ item, isModified, controller }: EditorLibraryItemPr
[controller, item?.owner, ownerSelector]
);
if (!item) {
return null;
}
return (
<div className='flex flex-col'>
{accessLevel >= UserLevel.OWNER ? (
<Overlay position='top-[-0.5rem] left-[2.3rem] cc-icons'>
<MiniButton
title={controller.isAttachedToOSS ? 'Путь наследуется от ОСС' : 'Изменить путь'}
noHover
onClick={() => controller.promptLocation()}
icon={<IconEdit size='1rem' className='mt-1 icon-primary' />}
disabled={isModified || controller.isProcessing || controller.isAttachedToOSS}
/>
</Overlay>
) : null}
<LabeledValue
className='max-w-[30rem] sm:mb-1 text-ellipsis' //
label='Путь'
text={item?.location ?? ''}
<IconValue
className='sm:mb-1 text-ellipsis max-w-[30rem]'
icon={<IconFolder size='1.25rem' className='icon-primary' />}
value={item.location}
title={controller.isAttachedToOSS ? 'Путь наследуется от ОСС' : 'Путь'}
onClick={controller.promptLocation}
disabled={isModified || controller.isProcessing || controller.isAttachedToOSS || accessLevel < UserLevel.OWNER}
/>
{accessLevel >= UserLevel.OWNER ? (
<Overlay position='top-[-0.5rem] left-[5.5rem] cc-icons'>
<div className='flex items-start'>
<MiniButton
title={controller.isAttachedToOSS ? 'Владелец наследуется от ОСС' : 'Изменить владельца'}
noHover
onClick={() => ownerSelector.toggle()}
icon={<IconEdit size='1rem' className='mt-1 icon-primary' />}
disabled={isModified || controller.isProcessing || controller.isAttachedToOSS}
{ownerSelector.isOpen ? (
<Overlay position='top-[-0.5rem] left-[2.5rem] cc-icons'>
{ownerSelector.isOpen ? (
<SelectUser
className='w-[26.5rem] sm:w-[27.5rem] text-sm'
items={users}
value={item.owner ?? undefined}
onSelectValue={onSelectUser}
/>
{ownerSelector.isOpen ? (
<SelectUser
className='w-[21rem] sm:w-[23rem] text-sm'
items={users}
value={item?.owner ?? undefined}
onSelectValue={onSelectUser}
/>
) : null}
</div>
) : null}
</Overlay>
) : null}
<LabeledValue
className='sm:mb-1' //
label='Владелец'
text={getUserLabel(item?.owner ?? null)}
<IconValue
className='sm:mb-1'
icon={<IconOwner size='1.25rem' className='icon-primary' />}
value={getUserLabel(item.owner)}
title={controller.isAttachedToOSS ? 'Владелец наследуется от ОСС' : 'Владелец'}
onClick={ownerSelector.toggle}
disabled={isModified || controller.isProcessing || controller.isAttachedToOSS || accessLevel < UserLevel.OWNER}
/>
{accessLevel >= UserLevel.OWNER ? (
<Overlay position='top-[-0.5rem] left-[5.5rem]' className='cc-icons'>
<MiniButton
title='Изменить редакторов'
noHover
onClick={() => controller.promptEditors()}
icon={<IconEdit size='1rem' className='mt-1 icon-primary' />}
disabled={isModified || controller.isProcessing}
/>
</Overlay>
) : null}
<LabeledValue
id='editor_stats' //
className='sm:mb-1'
label='Редакторы'
text={item?.editors.length ?? 0}
/>
<Tooltip anchorSelect='#editor_stats' layer='z-modalTooltip'>
<InfoUsers items={item?.editors ?? []} prefix={prefixes.user_editors} />
</Tooltip>
<div className='sm:mb-1 flex justify-between items-center'>
<IconValue
id='editor_stats'
dense
icon={<IconEditor size='1.25rem' className='icon-primary' />}
value={item.editors.length}
title='Редакторы'
onClick={controller.promptEditors}
disabled={isModified || controller.isProcessing || accessLevel < UserLevel.OWNER}
/>
<Tooltip anchorSelect='#editor_stats' layer='z-modalTooltip'>
<InfoUsers items={item?.editors ?? []} prefix={prefixes.user_editors} />
</Tooltip>
<LabeledValue
className='sm:mb-1'
label='Дата обновления'
text={item ? new Date(item?.time_update).toLocaleString(intl.locale) : ''}
/>
<LabeledValue label='Дата создания' text={item ? new Date(item?.time_create).toLocaleString(intl.locale) : ''} />
<IconValue
dense
disabled
icon={<IconDateUpdate size='1.25rem' className='clr-text-green' />}
value={new Date(item.time_update).toLocaleString(intl.locale)}
title='Дата обновления'
/>
<IconValue
dense
disabled
icon={<IconDateCreate size='1.25rem' className='clr-text-green' />}
value={new Date(item.time_create).toLocaleString(intl.locale, {
year: '2-digit',
month: '2-digit',
day: '2-digit'
})}
title='Дата создания'
/>
</div>
</div>
);
}

View File

@ -324,7 +324,8 @@ function EditorTermGraph({ onOpenEdit }: EditorTermGraphProps) {
{!focusCst ? (
<ToolbarGraphSelection
graph={controller.schema!.graph}
core={controller.schema!.items.filter(cst => isBasicConcept(cst.cst_type)).map(cst => cst.id)}
isCore={cstID => isBasicConcept(controller.schema?.cstByID.get(cstID)?.cst_type)}
isOwned={cstID => !controller.schema?.cstByID.get(cstID)?.is_inherited}
setSelected={controller.setSelected}
emptySelection={controller.selected.length === 0}
/>

View File

@ -114,30 +114,28 @@ function TermGraph({
const canvasHeight = useMemo(() => calculateHeight('1.75rem + 4px'), [calculateHeight]);
return (
<div className='outline-none'>
<div className='relative' style={{ width: canvasWidth, height: canvasHeight }}>
<GraphUI
nodes={nodes}
edges={edges}
ref={graphRef}
animated={false}
draggable
layoutType={layout}
selections={selections}
onNodeDoubleClick={handleNodeDoubleClick}
onNodeClick={handleNodeClick}
onNodePointerOver={handleHoverIn}
onNodePointerOut={handleHoverOut}
minNodeSize={4}
maxNodeSize={8}
cameraMode={orbit ? 'orbit' : is3D ? 'rotate' : 'pan'}
layoutOverrides={
layout.includes('tree') ? { nodeLevelRatio: nodes.length < PARAMETER.smallTreeNodes ? 3 : 1 } : undefined
}
labelFontUrl={resources.graph_font}
theme={darkMode ? graphDarkT : graphLightT}
/>
</div>
<div className='relative outline-none' style={{ width: canvasWidth, height: canvasHeight }}>
<GraphUI
nodes={nodes}
edges={edges}
ref={graphRef}
animated={false}
draggable
layoutType={layout}
selections={selections}
onNodeDoubleClick={handleNodeDoubleClick}
onNodeClick={handleNodeClick}
onNodePointerOver={handleHoverIn}
onNodePointerOut={handleHoverOut}
minNodeSize={4}
maxNodeSize={8}
cameraMode={orbit ? 'orbit' : is3D ? 'rotate' : 'pan'}
layoutOverrides={
layout.includes('tree') ? { nodeLevelRatio: nodes.length < PARAMETER.smallTreeNodes ? 3 : 1 } : undefined
}
labelFontUrl={resources.graph_font}
theme={darkMode ? graphDarkT : graphLightT}
/>
</div>
);
}

View File

@ -79,8 +79,6 @@ function RSTabs() {
const cstID = Number(cstQuery);
if (cstID && schema?.cstByID.has(cstID)) {
setSelected([cstID]);
} else if (schema && schema?.items.length > 0) {
setSelected([schema.items[0].id]);
} else {
setSelected([]);
}

View File

@ -126,13 +126,13 @@ function TableSideConstituents({
const conditionalRowStyles = useMemo(
(): IConditionalStyle<IConstituenta>[] => [
{
when: (cst: IConstituenta) => cst.id === activeCst?.id,
when: (cst: IConstituenta) => !!activeCst && cst.id === activeCst?.id,
style: {
backgroundColor: colors.bgSelected
}
},
{
when: (cst: IConstituenta) => cst.parent === activeCst?.id && cst.id !== activeCst?.id,
when: (cst: IConstituenta) => !!activeCst && cst.parent === activeCst?.id && cst.id !== activeCst?.id,
style: {
backgroundColor: colors.bgOrange50
}

View File

@ -7,7 +7,6 @@
--font-ui: 'Alegreya Sans SC', 'Rubik', 'Segoe UI Symbol', sans-serif;
--font-main: 'Rubik', 'Fira Code', 'Noto Sans Math', 'Noto Sans Symbols 2', 'Segoe UI Symbol', sans-serif;
--font-math: 'Fira Code', 'Noto Sans Math', 'Noto Sans Symbols 2', 'Rubik', 'Segoe UI Symbol', sans-serif;
--font-math2: 'Noto Sans Math', 'Noto Sans Symbols 2', 'Rubik', 'Segoe UI Symbol', sans-serif;
/* Light Theme */
--cl-bg-120: hsl(000, 000%, 100%);

View File

@ -9,6 +9,10 @@
--toastify-color-dark: var(--cd-bg-60);
}
.cm-tooltip {
z-index: 100;
}
.cm-editor {
resize: vertical;
overflow-y: auto;

View File

@ -18,9 +18,6 @@
.font-math {
font-family: var(--font-math);
}
.font-math2 {
font-family: var(--font-math2);
}
}
@layer components {

View File

@ -3,7 +3,7 @@
*/
import { syntaxTree } from '@codemirror/language';
import { NodeType, Tree, TreeCursor } from '@lezer/common';
import { EditorState, ReactCodeMirrorRef, SelectionRange } from '@uiw/react-codemirror';
import { EditorState, ReactCodeMirrorRef, SelectionRange, TooltipView } from '@uiw/react-codemirror';
import clsx from 'clsx';
import { ReferenceTokens } from '@/components/RefsInput/parse';
@ -165,10 +165,9 @@ export function findReferenceAt(pos: number, state: EditorState) {
/**
* Create DOM tooltip for {@link Constituenta}.
*/
export function domTooltipConstituenta(cst?: IConstituenta, canClick?: boolean) {
export function domTooltipConstituenta(cst?: IConstituenta, canClick?: boolean): TooltipView {
const dom = document.createElement('div');
dom.className = clsx(
'z-topmost',
'max-h-[25rem] max-w-[25rem] min-w-[10rem]',
'dense',
'p-2',
@ -183,6 +182,8 @@ export function domTooltipConstituenta(cst?: IConstituenta, canClick?: boolean)
dom.appendChild(text);
} else {
const alias = document.createElement('p');
alias.className = 'font-math';
alias.style.overflowWrap = 'anywhere';
alias.innerHTML = `<b>${cst.alias}:</b> ${labelCstTypification(cst)}`;
dom.appendChild(alias);
@ -244,10 +245,9 @@ export function domTooltipEntityReference(
cst: IConstituenta | undefined,
colors: IColorTheme,
canClick?: boolean
) {
): TooltipView {
const dom = document.createElement('div');
dom.className = clsx(
'z-topmost',
'max-h-[25rem] max-w-[25rem] min-w-[10rem]',
'dense',
'p-2 flex flex-col',
@ -303,10 +303,9 @@ export function domTooltipSyntacticReference(
ref: ISyntacticReference,
masterRef: string | undefined,
canClick?: boolean
) {
): TooltipView {
const dom = document.createElement('div');
dom.className = clsx(
'z-topmost',
'max-h-[25rem] max-w-[25rem] min-w-[10rem]',
'dense',
'p-2 flex flex-col',

View File

@ -102,16 +102,15 @@ export const storage = {
optionsAdmin: 'options.admin',
optionsHelp: 'options.help',
rseditFont: 'rsedit.font',
rseditShowList: 'rsedit.show_list',
rseditShowControls: 'rsedit.show_controls',
librarySearchHead: 'library.search.head',
librarySearchFolderMode: 'library.search.folder_mode',
librarySearchSubfolders: 'library.search.subfolders',
librarySearchLocation: 'library.search.location',
librarySearchVisible: 'library.search.visible',
librarySearchOwned: 'library.search.owned',
librarySearchSubscribed: 'library.search.subscribed',
librarySearchEditor: 'library.search.editor',
libraryPagination: 'library.pagination',

View File

@ -931,6 +931,7 @@ export const information = {
moveComplete: 'Перемещение завершено',
linkReady: 'Ссылка скопирована',
versionRestored: 'Загрузка версии завершена',
locationRenamed: 'Ваши схемы перемещены',
cloneComplete: (alias: string) => `Копия создана: ${alias}`,
addedConstituents: (count: number) => `Добавлены конституенты: ${count}`,