@underpostnet/cyberia 3.2.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dockerignore +14 -0
- package/.env.example +144 -0
- package/.github/workflows/cyberia-client.cd.yml +40 -0
- package/.github/workflows/cyberia-server.cd.yml +40 -0
- package/.github/workflows/docker-image.cyberia-client.ci.yml +71 -0
- package/.github/workflows/docker-image.cyberia-client.dev.ci.yml +70 -0
- package/.github/workflows/docker-image.cyberia-server.ci.yml +71 -0
- package/.github/workflows/docker-image.cyberia-server.dev.ci.yml +71 -0
- package/.github/workflows/docker-image.engine-cyberia.ci.yml +53 -0
- package/.github/workflows/docker-image.engine-cyberia.dev.ci.yml +53 -0
- package/.github/workflows/engine-cyberia.cd.yml +157 -0
- package/.github/workflows/engine-cyberia.ci.yml +125 -0
- package/.github/workflows/ghpkg.ci.yml +160 -0
- package/.github/workflows/gitlab.ci.yml +20 -0
- package/.github/workflows/hardhat.ci.yml +82 -0
- package/.github/workflows/npmpkg.ci.yml +126 -0
- package/.github/workflows/publish.ci.yml +87 -0
- package/.github/workflows/publish.cyberia.ci.yml +79 -0
- package/.github/workflows/pwa-microservices-template-page.cd.yml +65 -0
- package/.github/workflows/pwa-microservices-template-test.ci.yml +33 -0
- package/.github/workflows/release.cd.yml +46 -0
- package/.nycrc +9 -0
- package/.prettierignore +12 -0
- package/.prettierrc +9 -0
- package/.vscode/extensions.json +10 -0
- package/.vscode/settings.json +26 -0
- package/CHANGELOG.md +2516 -0
- package/CLI-HELP.md +1099 -0
- package/Dockerfile +161 -0
- package/Dockerfile.dev +161 -0
- package/Dockerfile.test +165 -0
- package/LICENSE +21 -0
- package/README.md +259 -0
- package/baremetal/commission-workflows.json +211 -0
- package/baremetal/packer-workflows.json +24 -0
- package/bin/build.js +261 -0
- package/bin/build.template.js +33 -0
- package/bin/cyberia.js +5627 -0
- package/bin/deploy.js +1547 -0
- package/bin/index.js +5627 -0
- package/bump.config.js +27 -0
- package/compose.env +144 -0
- package/conf.js +952 -0
- package/deployment.yaml +418 -0
- package/docker-compose.yml +434 -0
- package/examples/static-page/README.md +150 -0
- package/examples/static-page/ssr-components/CustomPage.js +554 -0
- package/examples/static-page/static-config-example.json +57 -0
- package/hardhat/.env.example +31 -0
- package/hardhat/contracts/ObjectLayerToken.sol +391 -0
- package/hardhat/deployments/.gitkeep +0 -0
- package/hardhat/deployments/hardhat-ObjectLayerToken.json +11 -0
- package/hardhat/hardhat.config.js +136 -0
- package/hardhat/ignition/modules/.gitkeep +0 -0
- package/hardhat/ignition/modules/ObjectLayerToken.js +21 -0
- package/hardhat/networks/besu-object-layer.network.json +138 -0
- package/hardhat/package-lock.json +2871 -0
- package/hardhat/package.json +43 -0
- package/hardhat/scripts/deployObjectLayerToken.js +98 -0
- package/hardhat/test/ObjectLayerToken.js +696 -0
- package/hardhat/types/ethers-contracts/ObjectLayerToken.ts +690 -0
- package/hardhat/types/ethers-contracts/common.ts +92 -0
- package/hardhat/types/ethers-contracts/factories/ObjectLayerToken__factory.ts +1055 -0
- package/hardhat/types/ethers-contracts/factories/index.ts +4 -0
- package/hardhat/types/ethers-contracts/hardhat.d.ts +47 -0
- package/hardhat/types/ethers-contracts/index.ts +6 -0
- package/ipfs/configure-ipfs.sh +13 -0
- package/jsconfig.json +9 -0
- package/manifests/cronjobs/dd-cron/dd-cron-backup.yaml +48 -0
- package/manifests/cronjobs/dd-cron/dd-cron-dns.yaml +48 -0
- package/manifests/deployment/adminer/deployment.yaml +32 -0
- package/manifests/deployment/adminer/kustomization.yaml +7 -0
- package/manifests/deployment/adminer/service.yaml +13 -0
- package/manifests/deployment/dd-cyberia-development/deployment.yaml +418 -0
- package/manifests/deployment/dd-cyberia-development/grpc-service.yaml +17 -0
- package/manifests/deployment/dd-cyberia-development/proxy.yaml +189 -0
- package/manifests/deployment/dd-cyberia-development/pv-pvc.yaml +164 -0
- package/manifests/deployment/dd-default-development/deployment.yaml +163 -0
- package/manifests/deployment/dd-default-development/proxy.yaml +46 -0
- package/manifests/deployment/fastapi/backend-deployment.yml +120 -0
- package/manifests/deployment/fastapi/backend-service.yml +19 -0
- package/manifests/deployment/fastapi/frontend-deployment.yml +54 -0
- package/manifests/deployment/fastapi/frontend-service.yml +15 -0
- package/manifests/deployment/fastapi/initial_data.sh +8 -0
- package/manifests/deployment/kafka/deployment.yaml +67 -0
- package/manifests/deployment/mongo-express/deployment.yaml +62 -0
- package/manifests/deployment/phpmyadmin/deployment.yaml +54 -0
- package/manifests/deployment/playwright/deployment.yaml +52 -0
- package/manifests/deployment/spark/spark-pi-py.yaml +20 -0
- package/manifests/deployment/tensorflow/tf-gpu-test.yaml +63 -0
- package/manifests/envoy-service-nodeport.yaml +22 -0
- package/manifests/grafana/deployment.yaml +64 -0
- package/manifests/grafana/kustomization.yaml +7 -0
- package/manifests/grafana/pvc.yaml +12 -0
- package/manifests/grafana/service.yaml +14 -0
- package/manifests/grafana/storage-class.yaml +9 -0
- package/manifests/ipfs/configmap.yaml +64 -0
- package/manifests/ipfs/headless-service.yaml +35 -0
- package/manifests/ipfs/kustomization.yaml +8 -0
- package/manifests/ipfs/statefulset.yaml +149 -0
- package/manifests/ipfs/storage-class.yaml +9 -0
- package/manifests/kind-config-dev.yaml +20 -0
- package/manifests/kind-config.yaml +12 -0
- package/manifests/kubeadm-calico-config.yaml +14 -0
- package/manifests/letsencrypt-prod.yaml +14 -0
- package/manifests/lxd/lxd-admin-profile.yaml +26 -0
- package/manifests/lxd/lxd-preseed.yaml +30 -0
- package/manifests/mariadb/kustomization.yaml +9 -0
- package/manifests/mariadb/pv.yaml +12 -0
- package/manifests/mariadb/pvc.yaml +10 -0
- package/manifests/mariadb/service.yaml +10 -0
- package/manifests/mariadb/statefulset.yaml +56 -0
- package/manifests/mariadb/storage-class.yaml +10 -0
- package/manifests/mongodb/headless-service.yaml +10 -0
- package/manifests/mongodb/kustomization.yaml +11 -0
- package/manifests/mongodb/pv-pvc.yaml +59 -0
- package/manifests/mongodb/statefulset.yaml +113 -0
- package/manifests/mongodb/storage-class.yaml +9 -0
- package/manifests/mongodb-4.4/headless-service.yaml +10 -0
- package/manifests/mongodb-4.4/kustomization.yaml +9 -0
- package/manifests/mongodb-4.4/mongodb-nodeport.yaml +17 -0
- package/manifests/mongodb-4.4/pv-pvc.yaml +19 -0
- package/manifests/mongodb-4.4/service-deployment.yaml +61 -0
- package/manifests/mongodb-4.4/statefulset.yaml +79 -0
- package/manifests/mongodb-4.4/storage-class.yaml +9 -0
- package/manifests/mysql/kustomization.yaml +7 -0
- package/manifests/mysql/pv-pvc.yaml +27 -0
- package/manifests/mysql/statefulset.yaml +55 -0
- package/manifests/postgresql/configmap.yaml +9 -0
- package/manifests/postgresql/kustomization.yaml +10 -0
- package/manifests/postgresql/pv.yaml +15 -0
- package/manifests/postgresql/pvc.yaml +13 -0
- package/manifests/postgresql/service.yaml +10 -0
- package/manifests/postgresql/statefulset.yaml +37 -0
- package/manifests/prometheus/deployment.yaml +82 -0
- package/manifests/pv-pvc-dd.yaml +34 -0
- package/manifests/valkey/kustomization.yaml +7 -0
- package/manifests/valkey/service.yaml +10 -0
- package/manifests/valkey/statefulset.yaml +37 -0
- package/manifests/valkey/valkey-nodeport.yaml +17 -0
- package/mongodb/entrypoint.sh +76 -0
- package/nginx.conf +128 -0
- package/nodemon.json +6 -0
- package/package.json +101 -0
- package/packer/images/Rocky9Amd64/Makefile +62 -0
- package/packer/images/Rocky9Amd64/QUICKSTART.md +113 -0
- package/packer/images/Rocky9Amd64/README.md +122 -0
- package/packer/images/Rocky9Amd64/http/rocky9.ks.pkrtpl.hcl +114 -0
- package/packer/images/Rocky9Amd64/rocky9.pkr.hcl +164 -0
- package/packer/images/Rocky9Arm64/Makefile +69 -0
- package/packer/images/Rocky9Arm64/README.md +122 -0
- package/packer/images/Rocky9Arm64/http/rocky9.ks.pkrtpl.hcl +114 -0
- package/packer/images/Rocky9Arm64/rocky9.pkr.hcl +171 -0
- package/packer/scripts/fuse-nbd +64 -0
- package/packer/scripts/fuse-tar-root +63 -0
- package/proxy.yaml +189 -0
- package/pv-pvc.yaml +164 -0
- package/scripts/device-scan.sh +65 -0
- package/scripts/disk-clean.sh +182 -0
- package/scripts/disk-devices.sh +13 -0
- package/scripts/gen-fqdns.sh +14 -0
- package/scripts/gpu-diag.sh +19 -0
- package/scripts/ip-info.sh +118 -0
- package/scripts/ipxe-setup.sh +200 -0
- package/scripts/k3s-node-setup.sh +124 -0
- package/scripts/kubeadm-node-setup.sh +317 -0
- package/scripts/link-local-underpost-cli.sh +6 -0
- package/scripts/lxd-vm-setup.sh +208 -0
- package/scripts/maas-nat-firewalld.sh +145 -0
- package/scripts/maas-setup.sh +135 -0
- package/scripts/maas-upload-boot-resource.sh +183 -0
- package/scripts/nat-iptables.sh +111 -0
- package/scripts/nvim.sh +91 -0
- package/scripts/packer-init-vars-file.sh +40 -0
- package/scripts/packer-setup.sh +289 -0
- package/scripts/ports-ls.sh +33 -0
- package/scripts/quick-tftp.sh +19 -0
- package/scripts/rhel-grpc-setup.sh +56 -0
- package/scripts/rocky-kickstart.sh +986 -0
- package/scripts/rocky-pwa.sh +200 -0
- package/scripts/rocky-setup.sh +106 -0
- package/scripts/rpmfusion-ffmpeg-setup.sh +32 -0
- package/scripts/ssl.sh +170 -0
- package/scripts/test-monitor.sh +248 -0
- package/src/api/atlas-sprite-sheet/atlas-sprite-sheet.controller.js +30 -0
- package/src/api/atlas-sprite-sheet/atlas-sprite-sheet.model.js +155 -0
- package/src/api/atlas-sprite-sheet/atlas-sprite-sheet.router.js +39 -0
- package/src/api/atlas-sprite-sheet/atlas-sprite-sheet.service.js +382 -0
- package/src/api/core/core.controller.js +8 -0
- package/src/api/core/core.model.js +11 -0
- package/src/api/core/core.router.js +23 -0
- package/src/api/core/core.service.js +30 -0
- package/src/api/crypto/crypto.controller.js +10 -0
- package/src/api/crypto/crypto.model.js +23 -0
- package/src/api/crypto/crypto.router.js +23 -0
- package/src/api/crypto/crypto.service.js +64 -0
- package/src/api/cyberia-action/cyberia-action.controller.js +8 -0
- package/src/api/cyberia-action/cyberia-action.model.js +79 -0
- package/src/api/cyberia-action/cyberia-action.router.js +21 -0
- package/src/api/cyberia-action/cyberia-action.service.js +58 -0
- package/src/api/cyberia-client-hints/cyberia-client-hints.controller.js +27 -0
- package/src/api/cyberia-client-hints/cyberia-client-hints.model.js +100 -0
- package/src/api/cyberia-client-hints/cyberia-client-hints.router.js +70 -0
- package/src/api/cyberia-client-hints/cyberia-client-hints.service.js +152 -0
- package/src/api/cyberia-dialogue/cyberia-dialogue.controller.js +8 -0
- package/src/api/cyberia-dialogue/cyberia-dialogue.model.js +36 -0
- package/src/api/cyberia-dialogue/cyberia-dialogue.router.js +20 -0
- package/src/api/cyberia-dialogue/cyberia-dialogue.service.js +57 -0
- package/src/api/cyberia-entity/cyberia-entity.controller.js +6 -0
- package/src/api/cyberia-entity/cyberia-entity.model.js +25 -0
- package/src/api/cyberia-entity/cyberia-entity.router.js +17 -0
- package/src/api/cyberia-entity/cyberia-entity.service.js +42 -0
- package/src/api/cyberia-entity-type-default/cyberia-entity-type-default.controller.js +6 -0
- package/src/api/cyberia-entity-type-default/cyberia-entity-type-default.model.js +67 -0
- package/src/api/cyberia-entity-type-default/cyberia-entity-type-default.router.js +17 -0
- package/src/api/cyberia-entity-type-default/cyberia-entity-type-default.service.js +46 -0
- package/src/api/cyberia-instance/cyberia-fallback-world.js +337 -0
- package/src/api/cyberia-instance/cyberia-instance-boot.service.js +57 -0
- package/src/api/cyberia-instance/cyberia-instance-map.service.js +583 -0
- package/src/api/cyberia-instance/cyberia-instance.controller.js +42 -0
- package/src/api/cyberia-instance/cyberia-instance.model.js +117 -0
- package/src/api/cyberia-instance/cyberia-instance.router.js +75 -0
- package/src/api/cyberia-instance/cyberia-instance.service.js +190 -0
- package/src/api/cyberia-instance/cyberia-portal-connector.js +260 -0
- package/src/api/cyberia-instance/cyberia-world-generator.js +618 -0
- package/src/api/cyberia-instance-conf/cyberia-instance-conf.controller.js +6 -0
- package/src/api/cyberia-instance-conf/cyberia-instance-conf.model.js +200 -0
- package/src/api/cyberia-instance-conf/cyberia-instance-conf.router.js +17 -0
- package/src/api/cyberia-instance-conf/cyberia-instance-conf.service.js +46 -0
- package/src/api/cyberia-map/cyberia-map.controller.js +6 -0
- package/src/api/cyberia-map/cyberia-map.model.js +33 -0
- package/src/api/cyberia-map/cyberia-map.router.js +19 -0
- package/src/api/cyberia-map/cyberia-map.service.js +76 -0
- package/src/api/cyberia-quest/cyberia-quest.controller.js +9 -0
- package/src/api/cyberia-quest/cyberia-quest.model.js +67 -0
- package/src/api/cyberia-quest/cyberia-quest.router.js +26 -0
- package/src/api/cyberia-quest/cyberia-quest.service.js +97 -0
- package/src/api/cyberia-quest-progress/cyberia-quest-progress.controller.js +6 -0
- package/src/api/cyberia-quest-progress/cyberia-quest-progress.model.js +49 -0
- package/src/api/cyberia-quest-progress/cyberia-quest-progress.router.js +21 -0
- package/src/api/cyberia-quest-progress/cyberia-quest-progress.service.js +42 -0
- package/src/api/cyberia-saga/cyberia-saga.controller.js +6 -0
- package/src/api/cyberia-saga/cyberia-saga.model.js +59 -0
- package/src/api/cyberia-saga/cyberia-saga.router.js +17 -0
- package/src/api/cyberia-saga/cyberia-saga.service.js +42 -0
- package/src/api/cyberia-server-defaults/cyberia-server-defaults.js +1076 -0
- package/src/api/cyberia-skill/cyberia-skill.controller.js +6 -0
- package/src/api/cyberia-skill/cyberia-skill.model.js +50 -0
- package/src/api/cyberia-skill/cyberia-skill.router.js +17 -0
- package/src/api/cyberia-skill/cyberia-skill.service.js +42 -0
- package/src/api/default/default.controller.js +6 -0
- package/src/api/default/default.model.js +20 -0
- package/src/api/default/default.router.js +21 -0
- package/src/api/default/default.service.js +42 -0
- package/src/api/document/document.controller.js +9 -0
- package/src/api/document/document.model.js +95 -0
- package/src/api/document/document.router.js +32 -0
- package/src/api/document/document.service.js +633 -0
- package/src/api/file/file.controller.js +15 -0
- package/src/api/file/file.model.js +127 -0
- package/src/api/file/file.ref.json +39 -0
- package/src/api/file/file.router.js +36 -0
- package/src/api/file/file.service.js +499 -0
- package/src/api/instance/instance.controller.js +8 -0
- package/src/api/instance/instance.model.js +34 -0
- package/src/api/instance/instance.router.js +27 -0
- package/src/api/instance/instance.service.js +75 -0
- package/src/api/ipfs/ipfs.controller.js +8 -0
- package/src/api/ipfs/ipfs.model.js +77 -0
- package/src/api/ipfs/ipfs.router.js +26 -0
- package/src/api/ipfs/ipfs.service.js +145 -0
- package/src/api/object-layer/object-layer.controller.js +18 -0
- package/src/api/object-layer/object-layer.model.js +200 -0
- package/src/api/object-layer/object-layer.router.js +729 -0
- package/src/api/object-layer/object-layer.service.js +894 -0
- package/src/api/object-layer-render-frames/object-layer-render-frames.controller.js +6 -0
- package/src/api/object-layer-render-frames/object-layer-render-frames.model.js +93 -0
- package/src/api/object-layer-render-frames/object-layer-render-frames.router.js +17 -0
- package/src/api/object-layer-render-frames/object-layer-render-frames.service.js +46 -0
- package/src/api/test/test.controller.js +14 -0
- package/src/api/test/test.model.js +14 -0
- package/src/api/test/test.router.js +23 -0
- package/src/api/test/test.service.js +35 -0
- package/src/api/types.js +24 -0
- package/src/api/user/guest.service.js +100 -0
- package/src/api/user/postman_collection.json +216 -0
- package/src/api/user/user.build.js +16 -0
- package/src/api/user/user.controller.js +35 -0
- package/src/api/user/user.model.js +142 -0
- package/src/api/user/user.router.js +367 -0
- package/src/api/user/user.service.js +582 -0
- package/src/api.js +23 -0
- package/src/cli/baremetal.js +3947 -0
- package/src/cli/cloud-init.js +673 -0
- package/src/cli/cluster.js +1395 -0
- package/src/cli/db.js +1533 -0
- package/src/cli/deploy.js +1542 -0
- package/src/cli/docker-compose.js +802 -0
- package/src/cli/env.js +177 -0
- package/src/cli/fs.js +380 -0
- package/src/cli/image.js +389 -0
- package/src/cli/index.js +1059 -0
- package/src/cli/ipfs.js +182 -0
- package/src/cli/kickstart.js +271 -0
- package/src/cli/kubectl.js +214 -0
- package/src/cli/lxd.js +1232 -0
- package/src/cli/monitor.js +659 -0
- package/src/cli/release.js +595 -0
- package/src/cli/repository.js +1969 -0
- package/src/cli/run.js +3326 -0
- package/src/cli/secrets.js +151 -0
- package/src/cli/ssh.js +975 -0
- package/src/cli/static.js +653 -0
- package/src/cli/system.js +332 -0
- package/src/cli/test.js +176 -0
- package/src/client/Cryptokoyn.index.js +30 -0
- package/src/client/CyberiaPortal.index.js +31 -0
- package/src/client/Default.index.js +77 -0
- package/src/client/Itemledger.index.js +35 -0
- package/src/client/Underpost.index.js +31 -0
- package/src/client/components/core/404.js +20 -0
- package/src/client/components/core/500.js +20 -0
- package/src/client/components/core/Account.js +630 -0
- package/src/client/components/core/AgGrid.js +238 -0
- package/src/client/components/core/Alert.js +76 -0
- package/src/client/components/core/AppStore.js +69 -0
- package/src/client/components/core/Auth.js +353 -0
- package/src/client/components/core/Badge.js +26 -0
- package/src/client/components/core/Blockchain.js +41 -0
- package/src/client/components/core/Blog.js +9 -0
- package/src/client/components/core/BtnIcon.js +109 -0
- package/src/client/components/core/CalendarCore.js +437 -0
- package/src/client/components/core/Chat.js +62 -0
- package/src/client/components/core/ClientEvents.js +163 -0
- package/src/client/components/core/ColorPaletteElement.js +309 -0
- package/src/client/components/core/CommonJs.js +1014 -0
- package/src/client/components/core/Content.js +349 -0
- package/src/client/components/core/Css.js +1134 -0
- package/src/client/components/core/CssCore.js +881 -0
- package/src/client/components/core/D3Chart.js +44 -0
- package/src/client/components/core/Docs.js +478 -0
- package/src/client/components/core/DropDown.js +321 -0
- package/src/client/components/core/EventBus.js +96 -0
- package/src/client/components/core/EventsUI.js +130 -0
- package/src/client/components/core/FileExplorer.js +1406 -0
- package/src/client/components/core/FullScreen.js +201 -0
- package/src/client/components/core/Input.js +537 -0
- package/src/client/components/core/Keyboard.js +80 -0
- package/src/client/components/core/KeyboardAvoidance.js +145 -0
- package/src/client/components/core/LoadingAnimation.js +152 -0
- package/src/client/components/core/LogIn.js +212 -0
- package/src/client/components/core/LogOut.js +72 -0
- package/src/client/components/core/Logger.js +22 -0
- package/src/client/components/core/Modal.js +2956 -0
- package/src/client/components/core/NotificationManager.js +80 -0
- package/src/client/components/core/Pagination.js +252 -0
- package/src/client/components/core/Panel.js +1308 -0
- package/src/client/components/core/PanelForm.js +915 -0
- package/src/client/components/core/Polyhedron.js +947 -0
- package/src/client/components/core/PublicProfile.js +895 -0
- package/src/client/components/core/Recover.js +211 -0
- package/src/client/components/core/Responsive.js +146 -0
- package/src/client/components/core/RichText.js +33 -0
- package/src/client/components/core/Router.js +523 -0
- package/src/client/components/core/Scroll.js +76 -0
- package/src/client/components/core/SearchBox.js +1007 -0
- package/src/client/components/core/SignUp.js +153 -0
- package/src/client/components/core/SocketIo.js +163 -0
- package/src/client/components/core/SocketIoHandler.js +75 -0
- package/src/client/components/core/Stream.js +161 -0
- package/src/client/components/core/ToggleSwitch.js +89 -0
- package/src/client/components/core/ToolTip.js +78 -0
- package/src/client/components/core/Translate.js +694 -0
- package/src/client/components/core/Validator.js +140 -0
- package/src/client/components/core/VanillaJs.js +485 -0
- package/src/client/components/core/Wallet.js +95 -0
- package/src/client/components/core/WebComponent.js +44 -0
- package/src/client/components/core/Webhook.js +58 -0
- package/src/client/components/core/Worker.js +313 -0
- package/src/client/components/core/windowGetDimensions.js +269 -0
- package/src/client/components/cryptokoyn/AppShellCryptokoyn.js +352 -0
- package/src/client/components/cryptokoyn/AppStoreCryptokoyn.js +5 -0
- package/src/client/components/cryptokoyn/CssCryptokoyn.js +212 -0
- package/src/client/components/cryptokoyn/LogInCryptokoyn.js +16 -0
- package/src/client/components/cryptokoyn/LogOutCryptokoyn.js +12 -0
- package/src/client/components/cryptokoyn/RouterCryptokoyn.js +37 -0
- package/src/client/components/cryptokoyn/SettingsCryptokoyn.js +16 -0
- package/src/client/components/cryptokoyn/SignUpCryptokoyn.js +11 -0
- package/src/client/components/cryptokoyn/SocketIoCryptokoyn.js +6 -0
- package/src/client/components/cyberia/ActionEngineCyberia.js +1867 -0
- package/src/client/components/cyberia/EntityEngineCyberia.js +585 -0
- package/src/client/components/cyberia/InstanceEngineCyberia.js +1088 -0
- package/src/client/components/cyberia/InstanceSelectionView.js +900 -0
- package/src/client/components/cyberia/MapEngineCyberia.js +1976 -0
- package/src/client/components/cyberia/ObjectLayerEngine.js +1540 -0
- package/src/client/components/cyberia/ObjectLayerEngineModal.js +2420 -0
- package/src/client/components/cyberia/ObjectLayerEngineViewer.js +1522 -0
- package/src/client/components/cyberia/SharedDefaultsCyberia.js +528 -0
- package/src/client/components/cyberia-portal/AppShellCyberiaPortal.js +772 -0
- package/src/client/components/cyberia-portal/AppStoreCyberiaPortal.js +5 -0
- package/src/client/components/cyberia-portal/CssCyberiaPortal.js +254 -0
- package/src/client/components/cyberia-portal/LogInCyberiaPortal.js +21 -0
- package/src/client/components/cyberia-portal/LogOutCyberiaPortal.js +16 -0
- package/src/client/components/cyberia-portal/MainBodyCyberiaPortal.js +518 -0
- package/src/client/components/cyberia-portal/RouterCyberiaPortal.js +72 -0
- package/src/client/components/cyberia-portal/SettingsCyberiaPortal.js +16 -0
- package/src/client/components/cyberia-portal/SignUpCyberiaPortal.js +13 -0
- package/src/client/components/cyberia-portal/SocketIoCyberiaPortal.js +6 -0
- package/src/client/components/cyberia-portal/TranslateCyberiaPortal.js +48 -0
- package/src/client/components/default/AppShellDefault.js +765 -0
- package/src/client/components/default/AppStoreDefault.js +5 -0
- package/src/client/components/default/CommonDefault.js +29 -0
- package/src/client/components/default/CssDefault.js +27 -0
- package/src/client/components/default/LogInDefault.js +16 -0
- package/src/client/components/default/LogOutDefault.js +12 -0
- package/src/client/components/default/RouterDefault.js +47 -0
- package/src/client/components/default/SettingsDefault.js +16 -0
- package/src/client/components/default/SignUpDefault.js +11 -0
- package/src/client/components/default/SocketIoDefault.js +6 -0
- package/src/client/components/default/TranslateDefault.js +7 -0
- package/src/client/components/itemledger/AppShellItemledger.js +353 -0
- package/src/client/components/itemledger/AppStoreItemledger.js +5 -0
- package/src/client/components/itemledger/CssItemledger.js +212 -0
- package/src/client/components/itemledger/LogInItemledger.js +17 -0
- package/src/client/components/itemledger/LogOutItemledger.js +12 -0
- package/src/client/components/itemledger/RouterItemledger.js +38 -0
- package/src/client/components/itemledger/SettingsItemledger.js +16 -0
- package/src/client/components/itemledger/SignUpItemledger.js +11 -0
- package/src/client/components/itemledger/SocketIoItemledger.js +6 -0
- package/src/client/components/itemledger/TranslateItemledger.js +7 -0
- package/src/client/components/underpost/AppShellUnderpost.js +691 -0
- package/src/client/components/underpost/AppStoreUnderpost.js +5 -0
- package/src/client/components/underpost/CssUnderpost.js +281 -0
- package/src/client/components/underpost/CyberpunkBloggerUnderpost.js +879 -0
- package/src/client/components/underpost/DocumentSearchProvider.js +448 -0
- package/src/client/components/underpost/LabGalleryUnderpost.js +79 -0
- package/src/client/components/underpost/LogInUnderpost.js +25 -0
- package/src/client/components/underpost/LogOutUnderpost.js +17 -0
- package/src/client/components/underpost/RouterUnderpost.js +45 -0
- package/src/client/components/underpost/SettingsUnderpost.js +16 -0
- package/src/client/components/underpost/SignUpUnderpost.js +11 -0
- package/src/client/components/underpost/SocketIoUnderpost.js +6 -0
- package/src/client/components/underpost/TranslateUnderpost.js +10 -0
- package/src/client/public/cryptokoyn/assets/banner/koyn-social.png +0 -0
- package/src/client/public/cryptokoyn/assets/logo/base-icon.png +0 -0
- package/src/client/public/cryptokoyn/assets/logo/cryptokoyn.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/android-chrome-144x144.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/android-chrome-192x192.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/android-chrome-256x256.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/android-chrome-36x36.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/android-chrome-48x48.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/android-chrome-72x72.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/android-chrome-96x96.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/apple-touch-icon-114x114-precomposed.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/apple-touch-icon-114x114.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/apple-touch-icon-120x120-precomposed.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/apple-touch-icon-120x120.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/apple-touch-icon-144x144-precomposed.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/apple-touch-icon-144x144.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/apple-touch-icon-152x152-precomposed.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/apple-touch-icon-152x152.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/apple-touch-icon-180x180-precomposed.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/apple-touch-icon-180x180.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/apple-touch-icon-57x57-precomposed.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/apple-touch-icon-57x57.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/apple-touch-icon-60x60-precomposed.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/apple-touch-icon-60x60.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/apple-touch-icon-72x72-precomposed.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/apple-touch-icon-72x72.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/apple-touch-icon-76x76-precomposed.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/apple-touch-icon-76x76.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/apple-touch-icon-precomposed.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/apple-touch-icon.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/favicon-16x16.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/favicon-32x32.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/mstile-144x144.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/mstile-150x150.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/mstile-310x150.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/mstile-310x310.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/mstile-70x70.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/safari-pinned-tab.svg +42 -0
- package/src/client/public/cryptokoyn/browserconfig.xml +12 -0
- package/src/client/public/cryptokoyn/favicon.ico +0 -0
- package/src/client/public/cryptokoyn/microdata.json +85 -0
- package/src/client/public/cryptokoyn/site.webmanifest +57 -0
- package/src/client/public/cryptokoyn/sitemap +148 -0
- package/src/client/public/cyberia-docs/ACTION-SYSTEM.md +307 -0
- package/src/client/public/cyberia-docs/ARCHITECTURE.md +309 -0
- package/src/client/public/cyberia-docs/CYBERIA-CLI.md +204 -0
- package/src/client/public/cyberia-docs/CYBERIA-CLIENT.md +341 -0
- package/src/client/public/cyberia-docs/CYBERIA-LORE.md +84 -0
- package/src/client/public/cyberia-docs/CYBERIA-SAGA.md +394 -0
- package/src/client/public/cyberia-docs/CYBERIA-SERVER.md +294 -0
- package/src/client/public/cyberia-docs/CYBERIA.md +259 -0
- package/src/client/public/cyberia-docs/ENTITY-PROFILE.md +242 -0
- package/src/client/public/cyberia-docs/HARDHAT-MODULE.md +300 -0
- package/src/client/public/cyberia-docs/OFF-CHAIN-ECONOMY.md +309 -0
- package/src/client/public/cyberia-docs/QUEST-SYSTEM.md +228 -0
- package/src/client/public/cyberia-docs/ROADMAP.md +240 -0
- package/src/client/public/cyberia-docs/UNDERPOST-PLATFORM.md +106 -0
- package/src/client/public/cyberia-docs/WHITE-PAPER.md +740 -0
- package/src/client/public/default/android-chrome-144x144.png +0 -0
- package/src/client/public/default/android-chrome-192x192.png +0 -0
- package/src/client/public/default/android-chrome-256x256.png +0 -0
- package/src/client/public/default/android-chrome-36x36.png +0 -0
- package/src/client/public/default/android-chrome-384x384.png +0 -0
- package/src/client/public/default/android-chrome-48x48.png +0 -0
- package/src/client/public/default/android-chrome-512x512.png +0 -0
- package/src/client/public/default/android-chrome-72x72.png +0 -0
- package/src/client/public/default/android-chrome-96x96.png +0 -0
- package/src/client/public/default/apple-touch-icon-1024x1024.png +0 -0
- package/src/client/public/default/apple-touch-icon-114x114-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon-114x114.png +0 -0
- package/src/client/public/default/apple-touch-icon-120x120-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon-120x120.png +0 -0
- package/src/client/public/default/apple-touch-icon-144x144-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon-144x144.png +0 -0
- package/src/client/public/default/apple-touch-icon-152x152-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon-152x152.png +0 -0
- package/src/client/public/default/apple-touch-icon-167x167.png +0 -0
- package/src/client/public/default/apple-touch-icon-180x180-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon-180x180.png +0 -0
- package/src/client/public/default/apple-touch-icon-57x57-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon-57x57.png +0 -0
- package/src/client/public/default/apple-touch-icon-60x60-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon-60x60.png +0 -0
- package/src/client/public/default/apple-touch-icon-72x72-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon-72x72.png +0 -0
- package/src/client/public/default/apple-touch-icon-76x76-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon-76x76.png +0 -0
- package/src/client/public/default/apple-touch-icon-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1125x2436.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1136x640.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1170x2532.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1179x2556.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1242x2208.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1242x2688.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1284x2778.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1290x2796.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1334x750.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1488x2266.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1536x2048.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1620x2160.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1640x2160.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1668x2224.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1668x2388.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1792x828.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2048x1536.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2048x2732.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2160x1620.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2160x1640.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2208x1242.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2224x1668.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2266x1488.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2388x1668.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2436x1125.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2532x1170.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2556x1179.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2688x1242.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2732x2048.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2778x1284.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2796x1290.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-640x1136.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-750x1334.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-828x1792.png +0 -0
- package/src/client/public/default/assets/background/dark.jpg +0 -0
- package/src/client/public/default/assets/background/dark.svg +557 -0
- package/src/client/public/default/assets/background/white.jpg +0 -0
- package/src/client/public/default/assets/background/white0-min.jpg +0 -0
- package/src/client/public/default/assets/background/white0.jpg +0 -0
- package/src/client/public/default/assets/logo/base-icon.png +0 -0
- package/src/client/public/default/assets/logo/underpost.gif +0 -0
- package/src/client/public/default/assets/mailer/api-user-check.png +0 -0
- package/src/client/public/default/assets/mailer/api-user-default-avatar.png +0 -0
- package/src/client/public/default/assets/mailer/api-user-invalid-token.png +0 -0
- package/src/client/public/default/assets/mailer/api-user-recover.png +0 -0
- package/src/client/public/default/browserconfig.xml +12 -0
- package/src/client/public/default/favicon-16x16.png +0 -0
- package/src/client/public/default/favicon-32x32.png +0 -0
- package/src/client/public/default/favicon-48x48.png +0 -0
- package/src/client/public/default/favicon.ico +0 -0
- package/src/client/public/default/manifest.webmanifest +69 -0
- package/src/client/public/default/mstile-144x144.png +0 -0
- package/src/client/public/default/mstile-150x150.png +0 -0
- package/src/client/public/default/mstile-310x150.png +0 -0
- package/src/client/public/default/mstile-310x310.png +0 -0
- package/src/client/public/default/mstile-70x70.png +0 -0
- package/src/client/public/default/safari-pinned-tab.svg +24 -0
- package/src/client/public/default/site.webmanifest +69 -0
- package/src/client/public/default/sitemap +148 -0
- package/src/client/public/default/yandex-browser-50x50.png +0 -0
- package/src/client/public/default/yandex-browser-manifest.json +9 -0
- package/src/client/public/doc/favicon.ico +0 -0
- package/src/client/public/doc/sitemap +148 -0
- package/src/client/public/itemledger/android-chrome-144x144.png +0 -0
- package/src/client/public/itemledger/android-chrome-192x192.png +0 -0
- package/src/client/public/itemledger/android-chrome-256x256.png +0 -0
- package/src/client/public/itemledger/android-chrome-36x36.png +0 -0
- package/src/client/public/itemledger/android-chrome-384x384.png +0 -0
- package/src/client/public/itemledger/android-chrome-48x48.png +0 -0
- package/src/client/public/itemledger/android-chrome-512x512.png +0 -0
- package/src/client/public/itemledger/android-chrome-72x72.png +0 -0
- package/src/client/public/itemledger/android-chrome-96x96.png +0 -0
- package/src/client/public/itemledger/apple-touch-icon-1024x1024.png +0 -0
- package/src/client/public/itemledger/apple-touch-icon-114x114.png +0 -0
- package/src/client/public/itemledger/apple-touch-icon-120x120.png +0 -0
- package/src/client/public/itemledger/apple-touch-icon-144x144.png +0 -0
- package/src/client/public/itemledger/apple-touch-icon-152x152.png +0 -0
- package/src/client/public/itemledger/apple-touch-icon-167x167.png +0 -0
- package/src/client/public/itemledger/apple-touch-icon-180x180.png +0 -0
- package/src/client/public/itemledger/apple-touch-icon-57x57.png +0 -0
- package/src/client/public/itemledger/apple-touch-icon-60x60.png +0 -0
- package/src/client/public/itemledger/apple-touch-icon-72x72.png +0 -0
- package/src/client/public/itemledger/apple-touch-icon-76x76.png +0 -0
- package/src/client/public/itemledger/apple-touch-icon-precomposed.png +0 -0
- package/src/client/public/itemledger/apple-touch-icon.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-1125x2436.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-1136x640.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-1170x2532.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-1179x2556.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-1242x2208.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-1242x2688.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-1284x2778.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-1290x2796.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-1334x750.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-1488x2266.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-1536x2048.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-1620x2160.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-1640x2160.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-1668x2224.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-1668x2388.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-1792x828.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-2048x1536.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-2048x2732.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-2160x1620.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-2160x1640.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-2208x1242.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-2224x1668.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-2266x1488.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-2388x1668.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-2436x1125.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-2532x1170.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-2556x1179.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-2688x1242.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-2732x2048.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-2778x1284.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-2796x1290.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-640x1136.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-750x1334.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-828x1792.png +0 -0
- package/src/client/public/itemledger/assets/logo/base-icon.png +0 -0
- package/src/client/public/itemledger/browserconfig.xml +12 -0
- package/src/client/public/itemledger/favicon-16x16.png +0 -0
- package/src/client/public/itemledger/favicon-32x32.png +0 -0
- package/src/client/public/itemledger/favicon-48x48.png +0 -0
- package/src/client/public/itemledger/favicon.ico +0 -0
- package/src/client/public/itemledger/manifest.webmanifest +69 -0
- package/src/client/public/itemledger/microdata.json +71 -0
- package/src/client/public/itemledger/mstile-144x144.png +0 -0
- package/src/client/public/itemledger/mstile-150x150.png +0 -0
- package/src/client/public/itemledger/mstile-310x150.png +0 -0
- package/src/client/public/itemledger/mstile-310x310.png +0 -0
- package/src/client/public/itemledger/mstile-70x70.png +0 -0
- package/src/client/public/itemledger/sitemap +148 -0
- package/src/client/public/itemledger/yandex-browser-50x50.png +0 -0
- package/src/client/public/itemledger/yandex-browser-manifest.json +9 -0
- package/src/client/public/test/favicon.ico +0 -0
- package/src/client/public/test/sitemap +148 -0
- package/src/client/services/atlas-sprite-sheet/atlas-sprite-sheet.service.js +137 -0
- package/src/client/services/core/core.service.js +309 -0
- package/src/client/services/crypto/crypto.service.js +68 -0
- package/src/client/services/cyberia-action/cyberia-action.service.js +99 -0
- package/src/client/services/cyberia-client-hints/cyberia-client-hints.service.js +99 -0
- package/src/client/services/cyberia-dialogue/cyberia-dialogue.service.js +99 -0
- package/src/client/services/cyberia-entity/cyberia-entity.management.js +57 -0
- package/src/client/services/cyberia-entity/cyberia-entity.service.js +99 -0
- package/src/client/services/cyberia-entity-type-default/cyberia-entity-type-default.service.js +99 -0
- package/src/client/services/cyberia-instance/cyberia-instance.management.js +194 -0
- package/src/client/services/cyberia-instance/cyberia-instance.service.js +137 -0
- package/src/client/services/cyberia-instance-conf/cyberia-instance-conf.service.js +99 -0
- package/src/client/services/cyberia-map/cyberia-map.management.js +193 -0
- package/src/client/services/cyberia-map/cyberia-map.service.js +120 -0
- package/src/client/services/cyberia-quest/cyberia-quest.service.js +99 -0
- package/src/client/services/cyberia-quest-progress/cyberia-quest-progress.service.js +99 -0
- package/src/client/services/cyberia-saga/cyberia-saga.service.js +99 -0
- package/src/client/services/cyberia-skill/cyberia-skill.service.js +99 -0
- package/src/client/services/default/default.management.js +1015 -0
- package/src/client/services/default/default.service.js +99 -0
- package/src/client/services/document/document.service.js +134 -0
- package/src/client/services/file/file.service.js +94 -0
- package/src/client/services/instance/instance.management.js +78 -0
- package/src/client/services/instance/instance.service.js +107 -0
- package/src/client/services/ipfs/ipfs.service.js +118 -0
- package/src/client/services/object-layer/object-layer.management.js +414 -0
- package/src/client/services/object-layer/object-layer.service.js +208 -0
- package/src/client/services/object-layer-render-frames/object-layer-render-frames.service.js +99 -0
- package/src/client/services/test/test.service.js +68 -0
- package/src/client/services/user/guest.service.js +86 -0
- package/src/client/services/user/user.management.js +51 -0
- package/src/client/services/user/user.service.js +106 -0
- package/src/client/ssr/RootDocument.js +237 -0
- package/src/client/ssr/body/404.js +77 -0
- package/src/client/ssr/body/500.js +76 -0
- package/src/client/ssr/body/CacheControl.js +117 -0
- package/src/client/ssr/body/CyberiaDefaultSplashScreen.js +97 -0
- package/src/client/ssr/body/DefaultSplashScreen.js +97 -0
- package/src/client/ssr/body/SwaggerDarkMode.js +285 -0
- package/src/client/ssr/body/UnderpostDefaultSplashScreen.js +90 -0
- package/src/client/ssr/head/CryptokoynScripts.js +4 -0
- package/src/client/ssr/head/Css.js +241 -0
- package/src/client/ssr/head/CyberiaPortalScripts.js +6 -0
- package/src/client/ssr/head/DefaultScripts.js +6 -0
- package/src/client/ssr/head/ItemledgerScripts.js +4 -0
- package/src/client/ssr/head/Microdata.js +11 -0
- package/src/client/ssr/head/Production.js +1 -0
- package/src/client/ssr/head/Pwa.js +146 -0
- package/src/client/ssr/head/PwaItemledger.js +197 -0
- package/src/client/ssr/head/Seo.js +15 -0
- package/src/client/ssr/head/UnderpostScripts.js +6 -0
- package/src/client/ssr/mailer/DefaultRecoverEmail.js +20 -0
- package/src/client/ssr/mailer/DefaultVerifyEmail.js +16 -0
- package/src/client/ssr/views/Cyberia404.js +328 -0
- package/src/client/ssr/views/CyberiaServerMetrics.js +1070 -0
- package/src/client/ssr/views/Maintenance.js +64 -0
- package/src/client/ssr/views/NoNetworkConnection.js +68 -0
- package/src/client/ssr/views/Test.js +199 -0
- package/src/client/sw/core.sw.js +274 -0
- package/src/client-builder/client-build-docs.js +493 -0
- package/src/client-builder/client-build-live.js +100 -0
- package/src/client-builder/client-build.js +1092 -0
- package/src/client-builder/client-dev-server.js +88 -0
- package/src/client-builder/client-formatted.js +170 -0
- package/src/client-builder/client-icons.js +108 -0
- package/src/client-builder/ssr.js +124 -0
- package/src/client.build.js +17 -0
- package/src/client.dev.js +21 -0
- package/src/db/DataBaseProvider.js +213 -0
- package/src/db/mariadb/MariaDB.js +72 -0
- package/src/db/mongo/MongoBootstrap.js +657 -0
- package/src/db/mongo/MongooseDB.js +199 -0
- package/src/grpc/cyberia/grpc-server.js +162 -0
- package/src/index.js +357 -0
- package/src/mailer/EmailRender.js +116 -0
- package/src/mailer/MailerProvider.js +213 -0
- package/src/projects/cyberia/atlas-sprite-sheet-generator.js +413 -0
- package/src/projects/cyberia/besu-genesis-generator.js +1630 -0
- package/src/projects/cyberia/catalog-cyberia.js +90 -0
- package/src/projects/cyberia/gemini-client.js +175 -0
- package/src/projects/cyberia/generate-saga.js +2137 -0
- package/src/projects/cyberia/hot-reload-trigger.js +163 -0
- package/src/projects/cyberia/instance-data.js +719 -0
- package/src/projects/cyberia/ipfs-client.js +599 -0
- package/src/projects/cyberia/map-preview-generator.js +304 -0
- package/src/projects/cyberia/object-layer.js +978 -0
- package/src/projects/cyberia/semantic-layer-generator-floor.js +319 -0
- package/src/projects/cyberia/semantic-layer-generator-resource.js +259 -0
- package/src/projects/cyberia/semantic-layer-generator-skin.js +1164 -0
- package/src/projects/cyberia/semantic-layer-generator.js +753 -0
- package/src/projects/cyberia/shape-generator.js +1060 -0
- package/src/projects/underpost/catalog-underpost.js +60 -0
- package/src/proxy.js +19 -0
- package/src/runtime/cyberia-client/Dockerfile +49 -0
- package/src/runtime/cyberia-client/Dockerfile.dev +75 -0
- package/src/runtime/cyberia-server/Dockerfile +43 -0
- package/src/runtime/cyberia-server/Dockerfile.dev +56 -0
- package/src/runtime/engine-cyberia/Dockerfile +161 -0
- package/src/runtime/engine-cyberia/Dockerfile.dev +161 -0
- package/src/runtime/engine-cyberia/Dockerfile.test +165 -0
- package/src/runtime/engine-cyberia/compose.env +144 -0
- package/src/runtime/engine-cyberia/docker-compose.yml +434 -0
- package/src/runtime/engine-cyberia/ipfs/configure-ipfs.sh +13 -0
- package/src/runtime/engine-cyberia/mongodb/entrypoint.sh +76 -0
- package/src/runtime/engine-cyberia/nginx.conf +128 -0
- package/src/runtime/express/Dockerfile +45 -0
- package/src/runtime/express/Express.js +285 -0
- package/src/runtime/lampp/Dockerfile +62 -0
- package/src/runtime/lampp/Lampp.js +359 -0
- package/src/runtime/nginx/Nginx.js +250 -0
- package/src/runtime/wp/Dockerfile +62 -0
- package/src/runtime/wp/Wp.js +642 -0
- package/src/server/auth.js +713 -0
- package/src/server/backup.js +102 -0
- package/src/server/catalog.js +72 -0
- package/src/server/conf.js +2316 -0
- package/src/server/cron.js +476 -0
- package/src/server/crypto.js +210 -0
- package/src/server/data-query.js +461 -0
- package/src/server/dns.js +553 -0
- package/src/server/downloader.js +73 -0
- package/src/server/logger.js +229 -0
- package/src/server/middlewares.js +152 -0
- package/src/server/peer.js +75 -0
- package/src/server/process.js +299 -0
- package/src/server/proxy.js +139 -0
- package/src/server/runtime-status.js +252 -0
- package/src/server/runtime.js +183 -0
- package/src/server/start.js +272 -0
- package/src/server/tls.js +254 -0
- package/src/server/valkey.js +201 -0
- package/src/server.js +25 -0
- package/src/ws/IoInterface.js +129 -0
- package/src/ws/IoServer.js +68 -0
- package/src/ws/core/channels/core.ws.chat.js +68 -0
- package/src/ws/core/channels/core.ws.mailer.js +116 -0
- package/src/ws/core/channels/core.ws.stream.js +90 -0
- package/src/ws/core/core.ws.connection.js +41 -0
- package/src/ws/core/core.ws.emit.js +37 -0
- package/src/ws/core/core.ws.server.js +44 -0
- package/src/ws/default/channels/default.ws.main.js +57 -0
- package/src/ws/default/default.ws.connection.js +35 -0
- package/src/ws/default/default.ws.emit.js +14 -0
- package/src/ws/default/default.ws.server.js +39 -0
- package/test/api.test.js +53 -0
- package/test/crypto.test.js +117 -0
- package/test/cyberia-instance-conf-defaults.test.js +140 -0
- package/test/deploy-monitor.test.js +267 -0
- package/test/shape-generator.test.js +463 -0
- package/tsconfig.docs.json +15 -0
- package/typedoc.dd-cyberia.json +31 -0
- package/typedoc.json +31 -0
|
@@ -0,0 +1,915 @@
|
|
|
1
|
+
import { getCapVariableName, newInstance, random, range, timer, uniqueArray } from './CommonJs.js';
|
|
2
|
+
import { marked } from 'marked';
|
|
3
|
+
import { append, getBlobFromUint8ArrayFile, getDataFromInputFile, getRawContentFile, htmls, s } from './VanillaJs.js';
|
|
4
|
+
import { Panel } from './Panel.js';
|
|
5
|
+
import { NotificationManager } from './NotificationManager.js';
|
|
6
|
+
import { DocumentService } from '../../services/document/document.service.js';
|
|
7
|
+
import { FileService } from '../../services/file/file.service.js';
|
|
8
|
+
import { getSrcFromFileData } from './Input.js';
|
|
9
|
+
import { imageShimmer, renderCssAttr, darkTheme, ThemeEvents, subThemeManager, lightenHex, darkenHex } from './Css.js';
|
|
10
|
+
import { Translate } from './Translate.js';
|
|
11
|
+
import { Modal } from './Modal.js';
|
|
12
|
+
import { closeModalRouteChangeEvents, listenQueryPathInstance, setQueryPath, getQueryParams } from './Router.js';
|
|
13
|
+
import { Scroll } from './Scroll.js';
|
|
14
|
+
import { LoadingAnimation } from './LoadingAnimation.js';
|
|
15
|
+
import { loggerFactory } from './Logger.js';
|
|
16
|
+
import { getApiBaseUrl } from '../../services/core/core.service.js';
|
|
17
|
+
const logger = loggerFactory(import.meta, { trace: true });
|
|
18
|
+
function sanitizeFilename(title, options = {}) {
|
|
19
|
+
const { replacement = '-', maxLength = 255, preserveExtension = true } = options;
|
|
20
|
+
if (typeof title !== 'string' || title.trim() === '') {
|
|
21
|
+
return 'untitled';
|
|
22
|
+
}
|
|
23
|
+
// 1) Extract extension (optional)
|
|
24
|
+
let name = title;
|
|
25
|
+
let ext = '';
|
|
26
|
+
if (preserveExtension) {
|
|
27
|
+
const match = title.match(/(\.[^.\s]{1,10})$/u);
|
|
28
|
+
if (match) {
|
|
29
|
+
ext = match[1];
|
|
30
|
+
name = title.slice(0, -ext.length);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
// 2) Normalize Unicode and remove diacritics
|
|
34
|
+
name = name.normalize('NFKD').replace(/[\u0300-\u036f]/g, '');
|
|
35
|
+
// 3) Remove control characters and null bytes
|
|
36
|
+
name = name.replace(/[\x00-\x1f\x7f]/g, '');
|
|
37
|
+
// 4) Remove forbidden filename characters (Windows / POSIX)
|
|
38
|
+
name = name.replace(/[<>:"/\\|?*\u0000]/g, '');
|
|
39
|
+
// 5) Collapse whitespace and replace with separator
|
|
40
|
+
name = name.replace(/\s+/g, replacement);
|
|
41
|
+
// 6) Collapse multiple separators
|
|
42
|
+
const escaped = replacement.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&');
|
|
43
|
+
name = name.replace(new RegExp(`${escaped}{2,}`, 'g'), replacement);
|
|
44
|
+
// 7) Trim dots and separators from edges
|
|
45
|
+
name = name.replace(new RegExp(`^[\\.${escaped}]+|[\\.${escaped}]+$`, 'g'), '');
|
|
46
|
+
// 8) Protect against Windows reserved names
|
|
47
|
+
if (/^(con|prn|aux|nul|com[1-9]|lpt[1-9])$/i.test(name)) {
|
|
48
|
+
name = '_' + name;
|
|
49
|
+
}
|
|
50
|
+
// 9) Enforce max length
|
|
51
|
+
const maxNameLength = Math.max(1, maxLength - ext.length);
|
|
52
|
+
if (name.length > maxNameLength) {
|
|
53
|
+
name = name.slice(0, maxNameLength);
|
|
54
|
+
}
|
|
55
|
+
// 10) Fallback
|
|
56
|
+
if (!name) name = 'untitled';
|
|
57
|
+
return name + ext;
|
|
58
|
+
}
|
|
59
|
+
const userInfoFactory = (userDoc) => ({
|
|
60
|
+
username: userDoc.userId.username,
|
|
61
|
+
email: userDoc.userId.email,
|
|
62
|
+
_id: userDoc.userId._id,
|
|
63
|
+
profileImageId: userDoc.userId.profileImageId,
|
|
64
|
+
briefDescription: userDoc.userId.briefDescription,
|
|
65
|
+
});
|
|
66
|
+
class PanelForm {
|
|
67
|
+
static Data = {};
|
|
68
|
+
static async instance(
|
|
69
|
+
options = {
|
|
70
|
+
idPanel: '',
|
|
71
|
+
defaultUrlImage: '',
|
|
72
|
+
appStore: {},
|
|
73
|
+
parentIdModal: undefined,
|
|
74
|
+
route: 'home',
|
|
75
|
+
htmlFormHeader: async () => '',
|
|
76
|
+
firsUpdateEvent: async () => {},
|
|
77
|
+
share: {
|
|
78
|
+
copyLink: false,
|
|
79
|
+
copySourceMd: false,
|
|
80
|
+
},
|
|
81
|
+
showCreatorProfile: false,
|
|
82
|
+
},
|
|
83
|
+
) {
|
|
84
|
+
const { idPanel, defaultUrlImage, appStore } = options;
|
|
85
|
+
// Authenticated users don't need 'public' tag - they see all their own posts
|
|
86
|
+
// Only include 'public' for unauthenticated users (handled by backend)
|
|
87
|
+
let prefixTags = [idPanel];
|
|
88
|
+
PanelForm.Data[idPanel] = {
|
|
89
|
+
originData: [],
|
|
90
|
+
data: [],
|
|
91
|
+
filesData: [],
|
|
92
|
+
skip: 0,
|
|
93
|
+
limit: 3, // Load 5 items per page
|
|
94
|
+
hasMore: true,
|
|
95
|
+
loading: false,
|
|
96
|
+
lasIdAvailable: null,
|
|
97
|
+
};
|
|
98
|
+
const formData = [
|
|
99
|
+
{
|
|
100
|
+
id: 'panel-title',
|
|
101
|
+
model: 'title',
|
|
102
|
+
inputType: 'text',
|
|
103
|
+
rules: [],
|
|
104
|
+
panel: { type: 'title' },
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
id: 'panel-createdAt',
|
|
108
|
+
model: 'createdAt',
|
|
109
|
+
inputType: 'datetime-local',
|
|
110
|
+
panel: { type: 'subtitle' },
|
|
111
|
+
rules: [{ type: 'isEmpty' }],
|
|
112
|
+
disableRender: true,
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
id: 'panel-fileId',
|
|
116
|
+
model: 'fileId',
|
|
117
|
+
inputType: 'file',
|
|
118
|
+
rules: [],
|
|
119
|
+
panel: {},
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
id: 'panel-tags',
|
|
123
|
+
model: 'tags',
|
|
124
|
+
label: {
|
|
125
|
+
disabled: true,
|
|
126
|
+
},
|
|
127
|
+
inputType: 'text',
|
|
128
|
+
panel: { type: 'tags' },
|
|
129
|
+
// panel: {
|
|
130
|
+
// type: 'info-row-pin',
|
|
131
|
+
// icon: {
|
|
132
|
+
// value: html``,
|
|
133
|
+
// },
|
|
134
|
+
// },
|
|
135
|
+
rules: [],
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
id: 'panel-mdFileId',
|
|
139
|
+
model: 'mdFileId',
|
|
140
|
+
inputType: 'md',
|
|
141
|
+
panel: { type: 'info-row' },
|
|
142
|
+
rules: [],
|
|
143
|
+
label: {
|
|
144
|
+
disabled: true,
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
];
|
|
148
|
+
const titleIcon = html`<i class="fa-solid fa-quote-left title-icon-${idPanel}"></i>`;
|
|
149
|
+
const panelRender = async ({ data }) =>
|
|
150
|
+
await Panel.instance({
|
|
151
|
+
idPanel,
|
|
152
|
+
formData,
|
|
153
|
+
data,
|
|
154
|
+
htmlFormHeader: options.htmlFormHeader,
|
|
155
|
+
parentIdModal: options.parentIdModal,
|
|
156
|
+
originData: () => PanelForm.Data[idPanel].originData,
|
|
157
|
+
filesData: () => PanelForm.Data[idPanel].filesData,
|
|
158
|
+
scrollClassContainer: options.scrollClassContainer ? options.scrollClassContainer : 'main-body',
|
|
159
|
+
titleIcon,
|
|
160
|
+
route: options.route,
|
|
161
|
+
formContainerClass: 'session-in-log-in',
|
|
162
|
+
share: options.share,
|
|
163
|
+
showCreatorProfile: options.showCreatorProfile,
|
|
164
|
+
onClick: async function ({ payload }) {
|
|
165
|
+
if (options.route) {
|
|
166
|
+
setQueryPath({ path: options.route, queryPath: payload._id });
|
|
167
|
+
if (options.parentIdModal) Modal.Data[options.parentIdModal].query = `${window.location.search}`;
|
|
168
|
+
if (PanelForm.Data[idPanel].updatePanel) await PanelForm.Data[idPanel].updatePanel();
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
callBackPanelRender: async function (options) {
|
|
172
|
+
if (options.data.ssr) {
|
|
173
|
+
return await options.htmlRender({
|
|
174
|
+
render: imageShimmer(),
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
// Get the filesData for this item
|
|
178
|
+
const filesDataItem = PanelForm.Data[idPanel].filesData.find((f) => f._id === options.data._id);
|
|
179
|
+
// Priority 1: Check if there's an actual file (not markdown content)
|
|
180
|
+
// fileId array defaults to [null] for batch upload logic
|
|
181
|
+
const fileBlob = filesDataItem?.fileId?.fileBlob;
|
|
182
|
+
if (fileBlob) {
|
|
183
|
+
return await options.fileRender({
|
|
184
|
+
file: fileBlob,
|
|
185
|
+
style: {
|
|
186
|
+
overflow: 'auto',
|
|
187
|
+
width: '100%',
|
|
188
|
+
height: 'auto',
|
|
189
|
+
},
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
// Priority 2: If no actual file, show default image
|
|
193
|
+
// (Don't show markdown content in file area - mdFileId stays in content area)
|
|
194
|
+
return await options.htmlRender({
|
|
195
|
+
render: html`
|
|
196
|
+
<img
|
|
197
|
+
class="abs center"
|
|
198
|
+
style="${renderCssAttr({
|
|
199
|
+
style: {
|
|
200
|
+
width: '100px',
|
|
201
|
+
height: '100px',
|
|
202
|
+
opacity: 0.2,
|
|
203
|
+
},
|
|
204
|
+
})}"
|
|
205
|
+
src="${defaultUrlImage}"
|
|
206
|
+
/>
|
|
207
|
+
`,
|
|
208
|
+
});
|
|
209
|
+
},
|
|
210
|
+
on: {
|
|
211
|
+
remove: async function ({ e, data }) {
|
|
212
|
+
e.preventDefault();
|
|
213
|
+
const confirmResult = await Modal.RenderConfirm({
|
|
214
|
+
html: async () => {
|
|
215
|
+
return html`
|
|
216
|
+
<div class="in section-mp" style="text-align: center">
|
|
217
|
+
${Translate.instance('confirm-delete-item')}
|
|
218
|
+
<br />
|
|
219
|
+
"${data.title}"
|
|
220
|
+
</div>
|
|
221
|
+
`;
|
|
222
|
+
},
|
|
223
|
+
id: `delete-${idPanel}`,
|
|
224
|
+
});
|
|
225
|
+
if (confirmResult.status === 'confirm') {
|
|
226
|
+
const { status, message } = await DocumentService.delete({
|
|
227
|
+
id: data._id,
|
|
228
|
+
});
|
|
229
|
+
NotificationManager.Push({
|
|
230
|
+
html: status,
|
|
231
|
+
status,
|
|
232
|
+
});
|
|
233
|
+
// Handle cid query param update (supports comma-separated list)
|
|
234
|
+
if (status === 'success') {
|
|
235
|
+
const currentCid = getQueryParams().cid;
|
|
236
|
+
if (currentCid) {
|
|
237
|
+
// Parse cid as comma-separated list
|
|
238
|
+
const cidList = currentCid
|
|
239
|
+
.split(',')
|
|
240
|
+
.map((id) => id.trim())
|
|
241
|
+
.filter((id) => id);
|
|
242
|
+
// Remove the deleted panel's id from the list
|
|
243
|
+
const updatedCidList = cidList.filter((id) => id !== data.id);
|
|
244
|
+
if (updatedCidList.length !== cidList.length) {
|
|
245
|
+
// Wait for DOM cleanup before updating query
|
|
246
|
+
if (updatedCidList.length === 0) {
|
|
247
|
+
// No cids remain, clear query and reload panels with limit
|
|
248
|
+
logger.warn('All cids removed, clearing query');
|
|
249
|
+
setQueryPath({ path: options.route, queryPath: '' });
|
|
250
|
+
if (options.parentIdModal) Modal.Data[options.parentIdModal].query = window.location.search;
|
|
251
|
+
if (PanelForm.Data[idPanel].updatePanel) await PanelForm.Data[idPanel].updatePanel();
|
|
252
|
+
} else {
|
|
253
|
+
// Update query params with remaining cids only (without ?cid= prefix)
|
|
254
|
+
const cidValue = updatedCidList.join(',');
|
|
255
|
+
setQueryPath({ path: options.route, queryPath: cidValue });
|
|
256
|
+
const actualQuery = window.location.search;
|
|
257
|
+
if (options.parentIdModal) Modal.Data[options.parentIdModal].query = actualQuery;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
// Return early to skip smart deletion logic when cid is present
|
|
261
|
+
return { status };
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
// Smart deletion: remove from arrays and intelligently load more if needed
|
|
265
|
+
if (status === 'success') {
|
|
266
|
+
const panelData = PanelForm.Data[idPanel];
|
|
267
|
+
// Remove the deleted item from all data arrays
|
|
268
|
+
const indexInOrigin = panelData.originData.findIndex((d) => d._id === data._id);
|
|
269
|
+
const indexInData = panelData.data.findIndex((d) => d._id === data._id);
|
|
270
|
+
const indexInFiles = panelData.filesData.findIndex((d) => d._id === data._id);
|
|
271
|
+
if (indexInOrigin > -1) panelData.originData.splice(indexInOrigin, 1);
|
|
272
|
+
if (indexInData > -1) panelData.data.splice(indexInData, 1);
|
|
273
|
+
if (indexInFiles > -1) panelData.filesData.splice(indexInFiles, 1);
|
|
274
|
+
// Adjust skip count since we removed an item
|
|
275
|
+
if (panelData.skip > 0) panelData.skip--;
|
|
276
|
+
// If panels are below limit and there might be more, load them
|
|
277
|
+
if (panelData.data.length < panelData.limit && panelData.hasMore && !panelData.loading) {
|
|
278
|
+
const oldDataCount = panelData.data.length;
|
|
279
|
+
const needed = panelData.limit - panelData.data.length; // Calculate exact number needed
|
|
280
|
+
const originalLimit = panelData.limit;
|
|
281
|
+
// Temporarily set limit to only fetch what's needed (1-to-1 replacement)
|
|
282
|
+
panelData.limit = needed;
|
|
283
|
+
await getPanelData(true); // Load only the needed items
|
|
284
|
+
panelData.limit = originalLimit; // Restore original limit
|
|
285
|
+
const newItems = panelData.data.slice(oldDataCount);
|
|
286
|
+
if (oldDataCount === 0) {
|
|
287
|
+
// List was empty, render all panels
|
|
288
|
+
if (panelData.data.length > 0) {
|
|
289
|
+
const containerSelector = `.${options.parentIdModal ? 'html-' + options.parentIdModal : 'main-body'}`;
|
|
290
|
+
htmls(
|
|
291
|
+
containerSelector,
|
|
292
|
+
html`
|
|
293
|
+
<div class="in">${await panelRender({ data: panelData.data })}</div>
|
|
294
|
+
<div class="in panel-placeholder-bottom panel-placeholder-bottom-${idPanel}"></div>
|
|
295
|
+
`,
|
|
296
|
+
);
|
|
297
|
+
// Show spinner if there's potentially more data
|
|
298
|
+
const lastOriginItem = panelData.originData[panelData.originData.length - 1];
|
|
299
|
+
if (
|
|
300
|
+
!panelData.lasIdAvailable ||
|
|
301
|
+
!lastOriginItem ||
|
|
302
|
+
panelData.lasIdAvailable !== lastOriginItem._id
|
|
303
|
+
)
|
|
304
|
+
LoadingAnimation.spinner.play(`.panel-placeholder-bottom-${idPanel}`, 'dual-ring-mini');
|
|
305
|
+
} else {
|
|
306
|
+
// No more data available, show empty state
|
|
307
|
+
const containerSelector = `.${options.parentIdModal ? 'html-' + options.parentIdModal : 'main-body'}`;
|
|
308
|
+
htmls(
|
|
309
|
+
containerSelector,
|
|
310
|
+
html`
|
|
311
|
+
<div class="in">${await panelRender({ data: [] })}</div>
|
|
312
|
+
<div class="in panel-placeholder-bottom panel-placeholder-bottom-${idPanel}"></div>
|
|
313
|
+
`,
|
|
314
|
+
);
|
|
315
|
+
}
|
|
316
|
+
} else {
|
|
317
|
+
// List had some panels, append new ones
|
|
318
|
+
if (newItems.length > 0) {
|
|
319
|
+
for (const item of newItems)
|
|
320
|
+
append(`.${idPanel}-render`, await Panel.Tokens[idPanel].renderPanel(item));
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
return { status };
|
|
326
|
+
}
|
|
327
|
+
return { status: 'error' };
|
|
328
|
+
},
|
|
329
|
+
initAdd: async function () {
|
|
330
|
+
setTimeout(() => {
|
|
331
|
+
s(`.modal-${options.route}`).scrollTo({ top: 0, behavior: 'smooth' });
|
|
332
|
+
}, 50);
|
|
333
|
+
},
|
|
334
|
+
initEdit: async function ({ data }) {
|
|
335
|
+
// Do NOT clear the file input here - the file should remain as-is when entering edit mode.
|
|
336
|
+
// If user wants to remove the file, they use the "clean file" button.
|
|
337
|
+
// If user wants to replace the file, they select a new file.
|
|
338
|
+
// Unconditionally clearing the file here would cause the server to receive fileId: null on save.
|
|
339
|
+
setTimeout(() => {
|
|
340
|
+
s(`.modal-${options.route}`).scrollTo({ top: 0, behavior: 'smooth' });
|
|
341
|
+
}, 50);
|
|
342
|
+
},
|
|
343
|
+
noResultFound: async function () {
|
|
344
|
+
LoadingAnimation.spinner.stop(`.panel-placeholder-bottom-${idPanel}`);
|
|
345
|
+
},
|
|
346
|
+
add: async function ({ data, editId }) {
|
|
347
|
+
// Validate that either mdFileId has content OR fileId has files
|
|
348
|
+
const hasMdContent = data.mdFileId && data.mdFileId.trim().length > 0;
|
|
349
|
+
const hasFiles = data.fileId && data.fileId.length > 0;
|
|
350
|
+
if (!data.title || (!hasMdContent && !hasFiles)) {
|
|
351
|
+
NotificationManager.Push({
|
|
352
|
+
html: Translate.instance('require-title-and-content-or-file'),
|
|
353
|
+
status: 'error',
|
|
354
|
+
});
|
|
355
|
+
return { data: [], status: 'error', message: 'Must provide either content or attach a file' };
|
|
356
|
+
}
|
|
357
|
+
// Sanitize title for filename - normalize UTF-8 string
|
|
358
|
+
// In browser, strings are already UTF-16, just ensure valid characters
|
|
359
|
+
const sanitizedTitle = sanitizeFilename(data.title);
|
|
360
|
+
let mdFileId;
|
|
361
|
+
const mdFileName = `${getCapVariableName(sanitizedTitle)}.md`;
|
|
362
|
+
const location = `${prefixTags.join('/')}`;
|
|
363
|
+
// Only create markdown file if there's actual content
|
|
364
|
+
let md = null;
|
|
365
|
+
let mdBlob = null;
|
|
366
|
+
let mdPlain = null;
|
|
367
|
+
if (hasMdContent) {
|
|
368
|
+
// Markdown content is already UTF-16 in browser, use as-is
|
|
369
|
+
const blob = new Blob([data.mdFileId], { type: 'text/markdown' });
|
|
370
|
+
md = new File([blob], mdFileName, { type: 'text/markdown' });
|
|
371
|
+
mdBlob = {
|
|
372
|
+
data: {
|
|
373
|
+
data: await getDataFromInputFile(md),
|
|
374
|
+
},
|
|
375
|
+
mimetype: md.type,
|
|
376
|
+
name: md.name,
|
|
377
|
+
};
|
|
378
|
+
mdPlain = await getRawContentFile(getBlobFromUint8ArrayFile(mdBlob.data.data, mdBlob.mimetype));
|
|
379
|
+
}
|
|
380
|
+
// Parse and normalize tags
|
|
381
|
+
// Note: 'public' tag is automatically extracted by the backend and converted to isPublic field
|
|
382
|
+
// It will be filtered from the tags array to keep visibility control separate from content tags
|
|
383
|
+
const tags = data.tags
|
|
384
|
+
? uniqueArray(
|
|
385
|
+
data.tags
|
|
386
|
+
.replaceAll('/', ',')
|
|
387
|
+
.replaceAll('-', ',')
|
|
388
|
+
.replaceAll(' ', ',')
|
|
389
|
+
.split(',')
|
|
390
|
+
.map((t) => t.trim())
|
|
391
|
+
.filter((t) => t)
|
|
392
|
+
.concat(prefixTags),
|
|
393
|
+
)
|
|
394
|
+
: prefixTags;
|
|
395
|
+
let originObj, originFileObj, indexOriginObj;
|
|
396
|
+
if (editId) {
|
|
397
|
+
indexOriginObj = PanelForm.Data[idPanel].originData.findIndex((d) => d._id === editId);
|
|
398
|
+
if (indexOriginObj > -1) {
|
|
399
|
+
originObj = PanelForm.Data[idPanel].originData[indexOriginObj];
|
|
400
|
+
originFileObj = PanelForm.Data[idPanel].filesData.find((d) => d._id === editId);
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
const baseNewDoc = newInstance(data);
|
|
404
|
+
baseNewDoc.tags = tags.filter((t) => !prefixTags.includes(t));
|
|
405
|
+
baseNewDoc.mdFileId = hasMdContent
|
|
406
|
+
? `<div class="markdown-content">${marked.parse(data.mdFileId)}</div>`
|
|
407
|
+
: null;
|
|
408
|
+
baseNewDoc.userId = appStore.Data.user?.main?.model?.user?._id;
|
|
409
|
+
// Ensure profileImageId is properly formatted as object with _id property
|
|
410
|
+
const profileImageIdValue = appStore.Data.user?.main?.model?.user?.profileImageId;
|
|
411
|
+
const formattedProfileImageId = profileImageIdValue
|
|
412
|
+
? typeof profileImageIdValue === 'string'
|
|
413
|
+
? { _id: profileImageIdValue }
|
|
414
|
+
: profileImageIdValue
|
|
415
|
+
: null;
|
|
416
|
+
baseNewDoc.userInfo = {
|
|
417
|
+
username: appStore.Data.user?.main?.model?.user?.username,
|
|
418
|
+
email: appStore.Data.user?.main?.model?.user?.email,
|
|
419
|
+
_id: appStore.Data.user?.main?.model?.user?._id,
|
|
420
|
+
profileImageId: formattedProfileImageId,
|
|
421
|
+
};
|
|
422
|
+
baseNewDoc.tools = true;
|
|
423
|
+
const documents = [];
|
|
424
|
+
let message = '';
|
|
425
|
+
let status = 'success';
|
|
426
|
+
let indexFormDoc = -1;
|
|
427
|
+
const inputFiles = data.fileId ? data.fileId : [null];
|
|
428
|
+
for (const file of inputFiles) {
|
|
429
|
+
indexFormDoc++;
|
|
430
|
+
let fileId = undefined; // Reset for each iteration - only set if user uploaded a file
|
|
431
|
+
// Track whether the file input was explicitly cleared (null) vs never had a file (undefined)
|
|
432
|
+
// In edit mode, null means user cleared the file - we need to tell server to remove it
|
|
433
|
+
const isFileCleared = data.fileId === null && editId;
|
|
434
|
+
await (async () => {
|
|
435
|
+
// When file is null, no markdown content, and not clearing a file, skip upload
|
|
436
|
+
if (!file && !isFileCleared && !hasMdContent) return;
|
|
437
|
+
// When user cleared file in edit mode, set fileId=null so server removes the reference
|
|
438
|
+
if (isFileCleared) {
|
|
439
|
+
fileId = null;
|
|
440
|
+
return;
|
|
441
|
+
}
|
|
442
|
+
const body = new FormData();
|
|
443
|
+
// Only append md file if it was created (has content)
|
|
444
|
+
if (md) body.append('md', md);
|
|
445
|
+
if (file) body.append('file', file);
|
|
446
|
+
const { status, data: uploadedFiles } = await FileService.post({ body });
|
|
447
|
+
// await timer(3000);
|
|
448
|
+
NotificationManager.Push({
|
|
449
|
+
html: Translate.instance(`${status}-upload-file`),
|
|
450
|
+
status,
|
|
451
|
+
});
|
|
452
|
+
if (status === 'success' && uploadedFiles && Array.isArray(uploadedFiles)) {
|
|
453
|
+
// CRITICAL DIFFERENTIATION:
|
|
454
|
+
// - mdFileId: markdown file GENERATED FROM rich text editor content
|
|
455
|
+
// - fileId: file UPLOADED BY USER (could be .md, .pdf, image, etc.)
|
|
456
|
+
//
|
|
457
|
+
// Both can be markdown files, but we must distinguish:
|
|
458
|
+
// Rich text editor content → mdFileId
|
|
459
|
+
// User-uploaded file → fileId
|
|
460
|
+
for (const uploadedFile of uploadedFiles) {
|
|
461
|
+
if (hasMdContent && uploadedFile.name === mdFileName) {
|
|
462
|
+
// This is the markdown file created FROM rich text editor
|
|
463
|
+
mdFileId = uploadedFile._id;
|
|
464
|
+
logger.info(`Assigned rich text markdown to mdFileId: ${mdFileName}`);
|
|
465
|
+
} else if (!hasMdContent || uploadedFile.name !== mdFileName) {
|
|
466
|
+
// This is a file uploaded by user (even if it's an .md file)
|
|
467
|
+
fileId = uploadedFile._id;
|
|
468
|
+
logger.info(`Assigned user-uploaded file to fileId: ${uploadedFile.name}`);
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
// Validation: mdFileId should exist only if rich text content was provided
|
|
472
|
+
if (hasMdContent && !mdFileId) {
|
|
473
|
+
logger.error(
|
|
474
|
+
`ERROR: No markdown content file found. Expected: ${mdFileName}, Got: ${uploadedFiles.map((f) => f.name).join(', ')}`,
|
|
475
|
+
);
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
})();
|
|
479
|
+
// Backend will automatically extract 'public' from tags and set isPublic field
|
|
480
|
+
const body = {
|
|
481
|
+
location,
|
|
482
|
+
tags,
|
|
483
|
+
fileId,
|
|
484
|
+
mdFileId,
|
|
485
|
+
title: data.title,
|
|
486
|
+
};
|
|
487
|
+
const {
|
|
488
|
+
status: documentStatus,
|
|
489
|
+
message: documentMessage,
|
|
490
|
+
data: documentData,
|
|
491
|
+
} = originObj && indexFormDoc === 0
|
|
492
|
+
? await DocumentService.put({ id: originObj._id, body })
|
|
493
|
+
: await DocumentService.post({
|
|
494
|
+
body,
|
|
495
|
+
});
|
|
496
|
+
const newDoc = {
|
|
497
|
+
...baseNewDoc,
|
|
498
|
+
fileId: file ? URL.createObjectURL(file) : undefined,
|
|
499
|
+
_id: documentData._id,
|
|
500
|
+
id: documentData._id,
|
|
501
|
+
createdAt: documentData.createdAt,
|
|
502
|
+
// Use server response data - backend has already processed tags and isPublic
|
|
503
|
+
isPublic: documentData.isPublic || false,
|
|
504
|
+
tags: (documentData.tags || []).filter((t) => !prefixTags.includes(t)),
|
|
505
|
+
// Ensure userInfo is present for profile header rendering
|
|
506
|
+
userInfo:
|
|
507
|
+
baseNewDoc.userInfo ||
|
|
508
|
+
(documentData.userId && typeof documentData.userId === 'object'
|
|
509
|
+
? userInfoFactory(documentData)
|
|
510
|
+
: null),
|
|
511
|
+
};
|
|
512
|
+
if (documentStatus === 'error') status = 'error';
|
|
513
|
+
if (message) message += `${indexFormDoc === 0 ? '' : ', '}${documentMessage}`;
|
|
514
|
+
const filesData = {
|
|
515
|
+
id: documentData._id,
|
|
516
|
+
_id: documentData._id,
|
|
517
|
+
mdFileId: mdBlob && mdPlain ? { mdBlob, mdPlain } : null,
|
|
518
|
+
fileId: {
|
|
519
|
+
fileBlob: file
|
|
520
|
+
? {
|
|
521
|
+
data: {
|
|
522
|
+
data: await getDataFromInputFile(file),
|
|
523
|
+
},
|
|
524
|
+
mimetype: file.type,
|
|
525
|
+
name: file.name,
|
|
526
|
+
}
|
|
527
|
+
: undefined,
|
|
528
|
+
filePlain: undefined,
|
|
529
|
+
},
|
|
530
|
+
};
|
|
531
|
+
if (originObj && indexFormDoc === 0) {
|
|
532
|
+
PanelForm.Data[idPanel].originData[indexOriginObj] = documentData;
|
|
533
|
+
PanelForm.Data[idPanel].data[indexOriginObj] = newDoc;
|
|
534
|
+
PanelForm.Data[idPanel].filesData[indexOriginObj] = filesData;
|
|
535
|
+
} else {
|
|
536
|
+
PanelForm.Data[idPanel].originData.push(documentData);
|
|
537
|
+
PanelForm.Data[idPanel].data.push(newDoc);
|
|
538
|
+
PanelForm.Data[idPanel].filesData.push(filesData);
|
|
539
|
+
}
|
|
540
|
+
documents.push(newDoc);
|
|
541
|
+
}
|
|
542
|
+
NotificationManager.Push({
|
|
543
|
+
html:
|
|
544
|
+
status === 'success'
|
|
545
|
+
? originObj
|
|
546
|
+
? Translate.instance('success-edit-post')
|
|
547
|
+
: Translate.instance('success-add-post')
|
|
548
|
+
: message,
|
|
549
|
+
status: status,
|
|
550
|
+
});
|
|
551
|
+
setQueryPath({ path: options.route, queryPath: documents.map((d) => d._id).join(',') });
|
|
552
|
+
if (options.parentIdModal) Modal.Data[options.parentIdModal].query = `${window.location.search}`;
|
|
553
|
+
return { data: documents, status, message };
|
|
554
|
+
},
|
|
555
|
+
},
|
|
556
|
+
});
|
|
557
|
+
const getPanelData = async (isLoadMore = false) => {
|
|
558
|
+
const panelData = PanelForm.Data[idPanel];
|
|
559
|
+
logger.warn('getPanelData called, isLoadMore:', isLoadMore);
|
|
560
|
+
try {
|
|
561
|
+
const cidQuery = getQueryParams().cid;
|
|
562
|
+
// When cid query exists, bypass pagination and loading checks
|
|
563
|
+
if (!cidQuery) {
|
|
564
|
+
if (panelData.loading || !panelData.hasMore) {
|
|
565
|
+
logger.warn('getPanelData early return - loading:', panelData.loading, 'hasMore:', panelData.hasMore);
|
|
566
|
+
return;
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
panelData.loading = true;
|
|
570
|
+
if (!isLoadMore) {
|
|
571
|
+
// Reset for a fresh load
|
|
572
|
+
panelData.skip = 0;
|
|
573
|
+
panelData.hasMore = true;
|
|
574
|
+
}
|
|
575
|
+
// When cid query exists, don't apply skip/limit pagination
|
|
576
|
+
const params = {
|
|
577
|
+
tags: prefixTags.join(','),
|
|
578
|
+
...(cidQuery && { cid: cidQuery }),
|
|
579
|
+
};
|
|
580
|
+
// Only apply pagination when there's no cid query
|
|
581
|
+
if (!cidQuery) {
|
|
582
|
+
params.skip = panelData.skip;
|
|
583
|
+
params.limit = panelData.limit;
|
|
584
|
+
}
|
|
585
|
+
const result = await DocumentService.get({
|
|
586
|
+
params,
|
|
587
|
+
id: 'public/',
|
|
588
|
+
});
|
|
589
|
+
if (result.status === 'success') {
|
|
590
|
+
if (!isLoadMore) {
|
|
591
|
+
panelData.originData = [];
|
|
592
|
+
panelData.filesData = [];
|
|
593
|
+
panelData.data = [];
|
|
594
|
+
}
|
|
595
|
+
panelData.originData.push(...newInstance(result.data.data));
|
|
596
|
+
panelData.lasIdAvailable = result.data.lastId;
|
|
597
|
+
for (const documentObject of result.data.data) {
|
|
598
|
+
let mdFileId, fileId;
|
|
599
|
+
let mdBlob, fileBlob;
|
|
600
|
+
let mdPlain, filePlain;
|
|
601
|
+
let parsedMarkdown = '';
|
|
602
|
+
try {
|
|
603
|
+
// Fetch markdown content if mdFileId exists
|
|
604
|
+
if (documentObject.mdFileId) {
|
|
605
|
+
const mdFileIdValue = documentObject.mdFileId._id || documentObject.mdFileId;
|
|
606
|
+
try {
|
|
607
|
+
// Get markdown content from blob endpoint using FileService
|
|
608
|
+
const { data: blobArray, status } = await FileService.get({ id: `blob/${mdFileIdValue}` });
|
|
609
|
+
if (status === 'success' && blobArray && blobArray[0]) {
|
|
610
|
+
mdPlain = await blobArray[0].text();
|
|
611
|
+
// Parse markdown with proper error handling
|
|
612
|
+
try {
|
|
613
|
+
parsedMarkdown = mdPlain ? `<div class="markdown-content">${marked.parse(mdPlain)}</div>` : '';
|
|
614
|
+
} catch (parseError) {
|
|
615
|
+
logger.error('Error parsing markdown for document:', documentObject._id, parseError);
|
|
616
|
+
parsedMarkdown = `<p><strong>Error rendering markdown:</strong> ${parseError.message}</p>`;
|
|
617
|
+
}
|
|
618
|
+
} else {
|
|
619
|
+
logger.warn('Failed to fetch markdown blob content');
|
|
620
|
+
parsedMarkdown = '';
|
|
621
|
+
}
|
|
622
|
+
} catch (fetchError) {
|
|
623
|
+
logger.error('Error fetching markdown content:', mdFileIdValue, fetchError);
|
|
624
|
+
parsedMarkdown = '';
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
// Handle optional fileId
|
|
628
|
+
if (documentObject.fileId) {
|
|
629
|
+
const fileIdValue = documentObject.fileId._id || documentObject.fileId;
|
|
630
|
+
try {
|
|
631
|
+
// Get file metadata for display
|
|
632
|
+
const { data: fileArray } = await FileService.get({ id: fileIdValue });
|
|
633
|
+
if (fileArray && fileArray[0]) {
|
|
634
|
+
fileBlob = fileArray[0];
|
|
635
|
+
fileId = getSrcFromFileData(fileArray[0]);
|
|
636
|
+
}
|
|
637
|
+
} catch (fetchError) {
|
|
638
|
+
logger.error('Error fetching file metadata:', fileIdValue, fetchError);
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
// Store file metadata and references
|
|
642
|
+
panelData.filesData.push({
|
|
643
|
+
id: documentObject._id,
|
|
644
|
+
_id: documentObject._id,
|
|
645
|
+
mdFileId: { mdBlob, mdPlain },
|
|
646
|
+
fileId: { fileBlob, filePlain },
|
|
647
|
+
});
|
|
648
|
+
// Add to data array for display - use pre-parsed markdown
|
|
649
|
+
panelData.data.push({
|
|
650
|
+
id: documentObject._id,
|
|
651
|
+
title: documentObject.title,
|
|
652
|
+
createdAt: documentObject.createdAt,
|
|
653
|
+
// Backend filters 'public' tag automatically - it's converted to isPublic field
|
|
654
|
+
tags: documentObject.tags.filter((t) => !prefixTags.includes(t)),
|
|
655
|
+
mdFileId: parsedMarkdown,
|
|
656
|
+
userId:
|
|
657
|
+
documentObject.userId && typeof documentObject.userId === 'object'
|
|
658
|
+
? documentObject.userId._id
|
|
659
|
+
: documentObject.userId,
|
|
660
|
+
userInfo:
|
|
661
|
+
documentObject.userId && typeof documentObject.userId === 'object'
|
|
662
|
+
? userInfoFactory(documentObject)
|
|
663
|
+
: null,
|
|
664
|
+
fileId,
|
|
665
|
+
tools:
|
|
666
|
+
documentObject.userId &&
|
|
667
|
+
typeof documentObject.userId === 'object' &&
|
|
668
|
+
appStore.Data.user?.main?.model?.user?._id &&
|
|
669
|
+
documentObject.userId._id === appStore.Data.user.main.model.user._id,
|
|
670
|
+
_id: documentObject._id,
|
|
671
|
+
totalCopyShareLinkCount: documentObject.totalCopyShareLinkCount || 0,
|
|
672
|
+
isPublic: documentObject.isPublic || false,
|
|
673
|
+
});
|
|
674
|
+
} catch (fileError) {
|
|
675
|
+
logger.error('Error processing files for document:', documentObject._id, fileError);
|
|
676
|
+
// Still add the document to originData even if file fetching fails
|
|
677
|
+
// Add minimal data without file references
|
|
678
|
+
panelData.filesData.push({
|
|
679
|
+
id: documentObject._id,
|
|
680
|
+
_id: documentObject._id,
|
|
681
|
+
mdFileId: { mdBlob: null, mdPlain: '' },
|
|
682
|
+
fileId: { fileBlob: null, filePlain: undefined },
|
|
683
|
+
});
|
|
684
|
+
panelData.data.push({
|
|
685
|
+
id: documentObject._id,
|
|
686
|
+
title: documentObject.title,
|
|
687
|
+
createdAt: documentObject.createdAt,
|
|
688
|
+
tags: documentObject.tags.filter((t) => !prefixTags.includes(t)),
|
|
689
|
+
mdFileId: '',
|
|
690
|
+
userId:
|
|
691
|
+
documentObject.userId && typeof documentObject.userId === 'object'
|
|
692
|
+
? documentObject.userId._id
|
|
693
|
+
: documentObject.userId,
|
|
694
|
+
userInfo:
|
|
695
|
+
documentObject.userId && typeof documentObject.userId === 'object'
|
|
696
|
+
? userInfoFactory(documentObject)
|
|
697
|
+
: null,
|
|
698
|
+
fileId: null,
|
|
699
|
+
tools:
|
|
700
|
+
documentObject.userId &&
|
|
701
|
+
typeof documentObject.userId === 'object' &&
|
|
702
|
+
appStore.Data.user?.main?.model?.user?._id &&
|
|
703
|
+
documentObject.userId._id === appStore.Data.user.main.model.user._id,
|
|
704
|
+
_id: documentObject._id,
|
|
705
|
+
totalCopyShareLinkCount: documentObject.totalCopyShareLinkCount || 0,
|
|
706
|
+
isPublic: documentObject.isPublic || false,
|
|
707
|
+
});
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
// Only update pagination when not using cid query
|
|
711
|
+
if (!cidQuery) {
|
|
712
|
+
panelData.skip += result.data.data.length;
|
|
713
|
+
panelData.hasMore = result.data.data.length === panelData.limit;
|
|
714
|
+
} else {
|
|
715
|
+
// When cid query is used, disable infinite scroll
|
|
716
|
+
panelData.hasMore = false;
|
|
717
|
+
}
|
|
718
|
+
const lastItem = result.data.data[result.data.data.length - 1];
|
|
719
|
+
if (result.data.data.length === 0 || (lastItem && lastItem._id === panelData.lasIdAvailable)) {
|
|
720
|
+
LoadingAnimation.spinner.stop(`.panel-placeholder-bottom-${idPanel}`);
|
|
721
|
+
panelData.hasMore = false;
|
|
722
|
+
}
|
|
723
|
+
} else {
|
|
724
|
+
NotificationManager.Push({
|
|
725
|
+
html: result.message,
|
|
726
|
+
status: result.status,
|
|
727
|
+
});
|
|
728
|
+
panelData.hasMore = false;
|
|
729
|
+
}
|
|
730
|
+
} catch (error) {
|
|
731
|
+
logger.error(error);
|
|
732
|
+
}
|
|
733
|
+
await timer(250);
|
|
734
|
+
panelData.loading = false;
|
|
735
|
+
LoadingAnimation.spinner.stop(`.panel-placeholder-bottom-${idPanel}`);
|
|
736
|
+
};
|
|
737
|
+
const renderSrrPanelData = async () =>
|
|
738
|
+
await panelRender({
|
|
739
|
+
data: range(0, 0).map((i) => ({
|
|
740
|
+
id: i,
|
|
741
|
+
title: html`<div class="fl">
|
|
742
|
+
<div
|
|
743
|
+
class="in fll ssr-shimmer-search-box"
|
|
744
|
+
style="${renderCssAttr({
|
|
745
|
+
style: {
|
|
746
|
+
width: '80%',
|
|
747
|
+
height: '30px',
|
|
748
|
+
top: '-13px',
|
|
749
|
+
left: '10px',
|
|
750
|
+
},
|
|
751
|
+
})}"
|
|
752
|
+
></div>
|
|
753
|
+
</div>`,
|
|
754
|
+
createdAt: html`<div class="fl">
|
|
755
|
+
<div
|
|
756
|
+
class="in fll ssr-shimmer-search-box"
|
|
757
|
+
style="${renderCssAttr({
|
|
758
|
+
style: {
|
|
759
|
+
width: '50%',
|
|
760
|
+
height: '30px',
|
|
761
|
+
left: '-5px',
|
|
762
|
+
},
|
|
763
|
+
})}"
|
|
764
|
+
></div>
|
|
765
|
+
</div>`,
|
|
766
|
+
mdFileId: html`<div class="fl section-mp">
|
|
767
|
+
<div
|
|
768
|
+
class="in fll ssr-shimmer-search-box"
|
|
769
|
+
style="${renderCssAttr({
|
|
770
|
+
style: {
|
|
771
|
+
width: '80%',
|
|
772
|
+
height: '30px',
|
|
773
|
+
},
|
|
774
|
+
})}"
|
|
775
|
+
></div>
|
|
776
|
+
</div>`.repeat(random(2, 4)),
|
|
777
|
+
ssr: true,
|
|
778
|
+
})),
|
|
779
|
+
});
|
|
780
|
+
let firsUpdateEvent = false;
|
|
781
|
+
let lastCid;
|
|
782
|
+
let lastUserId;
|
|
783
|
+
let loadingGetData = false;
|
|
784
|
+
closeModalRouteChangeEvents[idPanel] = () => {
|
|
785
|
+
setTimeout(() => {
|
|
786
|
+
PanelForm.Data[idPanel].updatePanel();
|
|
787
|
+
});
|
|
788
|
+
};
|
|
789
|
+
PanelForm.Data[idPanel].updatePanel = async (...args) => {
|
|
790
|
+
const _updatePanel = async (...args) => {
|
|
791
|
+
try {
|
|
792
|
+
const cid = getQueryParams().cid ? getQueryParams().cid : '';
|
|
793
|
+
const forceUpdate =
|
|
794
|
+
appStore.Data.user.main.model &&
|
|
795
|
+
appStore.Data.user.main.model.user &&
|
|
796
|
+
appStore.Data.user.main.model.user._id &&
|
|
797
|
+
lastUserId !== appStore.Data.user.main.model.user._id;
|
|
798
|
+
logger.warn(
|
|
799
|
+
{
|
|
800
|
+
idPanel,
|
|
801
|
+
cid,
|
|
802
|
+
forceUpdate,
|
|
803
|
+
},
|
|
804
|
+
appStore.Data.user?.main?.model?.user
|
|
805
|
+
? JSON.stringify(appStore.Data.user.main.model.user, null, 4)
|
|
806
|
+
: 'No user data',
|
|
807
|
+
);
|
|
808
|
+
// Normalize empty values for comparison (undefined, null, '' should all be treated as empty)
|
|
809
|
+
const normalizedCid = cid || '';
|
|
810
|
+
const normalizedLastCid = lastCid || '';
|
|
811
|
+
if (loadingGetData || (normalizedLastCid === normalizedCid && !forceUpdate)) return;
|
|
812
|
+
loadingGetData = true;
|
|
813
|
+
lastUserId = appStore.Data.user?.main?.model?.user?._id
|
|
814
|
+
? newInstance(appStore.Data.user.main.model.user._id)
|
|
815
|
+
: null;
|
|
816
|
+
lastCid = cid;
|
|
817
|
+
logger.warn('instance render panel data');
|
|
818
|
+
PanelForm.Data[idPanel] = {
|
|
819
|
+
...PanelForm.Data[idPanel],
|
|
820
|
+
originData: [],
|
|
821
|
+
data: [],
|
|
822
|
+
filesData: [],
|
|
823
|
+
limit: 3, // Load 5 items per page
|
|
824
|
+
hasMore: true,
|
|
825
|
+
loading: false,
|
|
826
|
+
};
|
|
827
|
+
// Always reset skip to 0 when reloading (whether cid exists or not)
|
|
828
|
+
PanelForm.Data[idPanel].skip = 0;
|
|
829
|
+
const containerSelector = `.${options.parentIdModal ? 'html-' + options.parentIdModal : 'main-body'}`;
|
|
830
|
+
htmls(containerSelector, await renderSrrPanelData());
|
|
831
|
+
await getPanelData();
|
|
832
|
+
htmls(
|
|
833
|
+
containerSelector,
|
|
834
|
+
html`
|
|
835
|
+
<div class="in">${await panelRender({ data: PanelForm.Data[idPanel].data })}</div>
|
|
836
|
+
<div class="in panel-placeholder-bottom panel-placeholder-bottom-${idPanel}"></div>
|
|
837
|
+
`,
|
|
838
|
+
);
|
|
839
|
+
const lastOriginItem = PanelForm.Data[idPanel].originData[PanelForm.Data[idPanel].originData.length - 1];
|
|
840
|
+
if (
|
|
841
|
+
!PanelForm.Data[idPanel].lasIdAvailable ||
|
|
842
|
+
!lastOriginItem ||
|
|
843
|
+
PanelForm.Data[idPanel].lasIdAvailable !== lastOriginItem._id
|
|
844
|
+
)
|
|
845
|
+
LoadingAnimation.spinner.play(`.panel-placeholder-bottom-${idPanel}`, 'dual-ring-mini');
|
|
846
|
+
const scrollContainerSelector = `.modal-${options.route}`;
|
|
847
|
+
// Always remove old scroll event before setting new one
|
|
848
|
+
if (PanelForm.Data[idPanel].removeScrollEvent) {
|
|
849
|
+
PanelForm.Data[idPanel].removeScrollEvent();
|
|
850
|
+
}
|
|
851
|
+
if (cid) {
|
|
852
|
+
LoadingAnimation.spinner.stop(`.panel-placeholder-bottom-${idPanel}`);
|
|
853
|
+
return;
|
|
854
|
+
}
|
|
855
|
+
const { removeEvent } = Scroll.setEvent(scrollContainerSelector, async (payload) => {
|
|
856
|
+
const panelData = PanelForm.Data[idPanel];
|
|
857
|
+
if (!panelData) return;
|
|
858
|
+
// Infinite scroll: load more items at bottom
|
|
859
|
+
if (payload.atBottom && panelData.hasMore && !panelData.loading) {
|
|
860
|
+
const oldDataCount = panelData.data.length;
|
|
861
|
+
await getPanelData(true); // isLoadMore = true
|
|
862
|
+
const newItems = panelData.data.slice(oldDataCount);
|
|
863
|
+
if (newItems.length > 0) {
|
|
864
|
+
for (const item of newItems)
|
|
865
|
+
append(`.${idPanel}-render`, await Panel.Tokens[idPanel].renderPanel(item));
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
});
|
|
869
|
+
PanelForm.Data[idPanel].removeScrollEvent = removeEvent;
|
|
870
|
+
if (!firsUpdateEvent && options.firsUpdateEvent) {
|
|
871
|
+
firsUpdateEvent = true;
|
|
872
|
+
await options.firsUpdateEvent();
|
|
873
|
+
}
|
|
874
|
+
} catch (error) {
|
|
875
|
+
logger.error(error);
|
|
876
|
+
}
|
|
877
|
+
};
|
|
878
|
+
await _updatePanel(...args);
|
|
879
|
+
loadingGetData = false;
|
|
880
|
+
};
|
|
881
|
+
if (options.route) {
|
|
882
|
+
listenQueryPathInstance({
|
|
883
|
+
id: options.parentIdModal ? 'html-' + options.parentIdModal : 'main-body',
|
|
884
|
+
routeId: options.route,
|
|
885
|
+
event: async (path) => {
|
|
886
|
+
// Don't manually clear arrays - updatePanel() will handle it if needed
|
|
887
|
+
await PanelForm.Data[idPanel].updatePanel();
|
|
888
|
+
},
|
|
889
|
+
});
|
|
890
|
+
if (!options.parentIdModal)
|
|
891
|
+
Modal.Data['modal-menu'].onHome[idPanel] = async () => {
|
|
892
|
+
lastCid = undefined;
|
|
893
|
+
lastUserId = undefined;
|
|
894
|
+
PanelForm.Data[idPanel] = {
|
|
895
|
+
...PanelForm.Data[idPanel],
|
|
896
|
+
originData: [],
|
|
897
|
+
data: [],
|
|
898
|
+
filesData: [],
|
|
899
|
+
skip: 0,
|
|
900
|
+
limit: 3, // Load 5 items per page
|
|
901
|
+
hasMore: true,
|
|
902
|
+
loading: false,
|
|
903
|
+
};
|
|
904
|
+
setQueryPath({ path: options.route, queryPath: options.route === 'home' ? '?' : '' });
|
|
905
|
+
await PanelForm.Data[idPanel].updatePanel();
|
|
906
|
+
};
|
|
907
|
+
}
|
|
908
|
+
if (options.parentIdModal) {
|
|
909
|
+
htmls(`.html-${options.parentIdModal}`, await renderSrrPanelData());
|
|
910
|
+
return '';
|
|
911
|
+
}
|
|
912
|
+
return await renderSrrPanelData();
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
export { PanelForm };
|