cyberia 3.2.5 → 3.2.9
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/.github/workflows/engine-cyberia.cd.yml +2 -2
- package/.github/workflows/release.cd.yml +1 -2
- package/CHANGELOG.md +351 -1
- package/CLI-HELP.md +40 -13
- package/Dockerfile +0 -4
- package/README.md +242 -497
- package/bin/build.js +19 -5
- package/bin/cyberia.js +1149 -240
- package/bin/deploy.js +570 -1
- package/bin/file.js +6 -0
- package/bin/index.js +1149 -240
- package/bin/vs.js +1 -1
- package/conf.js +67 -89
- package/deployment.yaml +4 -222
- package/hardhat/package-lock.json +32 -32
- package/hardhat/package.json +3 -3
- package/jsconfig.json +1 -1
- package/manifests/cronjobs/dd-cron/dd-cron-backup.yaml +2 -2
- package/manifests/cronjobs/dd-cron/dd-cron-dns.yaml +2 -2
- package/manifests/deployment/dd-cyberia-development/deployment.yaml +4 -222
- package/manifests/deployment/dd-cyberia-development/proxy.yaml +10 -118
- package/manifests/deployment/dd-default-development/deployment.yaml +2 -6
- package/manifests/deployment/dd-test-development/deployment.yaml +136 -66
- package/manifests/deployment/dd-test-development/proxy.yaml +41 -5
- package/package.json +23 -14
- package/proxy.yaml +10 -118
- package/scripts/k3s-node-setup.sh +2 -2
- package/scripts/nat-iptables.sh +103 -18
- package/src/api/atlas-sprite-sheet/atlas-sprite-sheet.controller.js +18 -18
- package/src/api/atlas-sprite-sheet/atlas-sprite-sheet.model.js +7 -14
- package/src/api/atlas-sprite-sheet/atlas-sprite-sheet.service.js +76 -21
- package/src/api/core/core.controller.js +10 -10
- package/src/api/core/core.service.js +10 -10
- package/src/api/crypto/crypto.controller.js +8 -8
- package/src/api/crypto/crypto.service.js +8 -8
- package/src/api/cyberia-action/cyberia-action.controller.js +74 -0
- package/src/api/cyberia-action/cyberia-action.model.js +87 -0
- package/src/api/cyberia-action/cyberia-action.router.js +27 -0
- package/src/api/cyberia-action/cyberia-action.service.js +42 -0
- package/src/api/cyberia-dialogue/cyberia-dialogue.controller.js +13 -13
- package/src/api/cyberia-dialogue/cyberia-dialogue.model.js +11 -11
- package/src/api/cyberia-dialogue/cyberia-dialogue.router.js +2 -2
- package/src/api/cyberia-dialogue/cyberia-dialogue.service.js +16 -16
- package/src/api/cyberia-entity/cyberia-entity.controller.js +10 -10
- package/src/api/cyberia-entity/cyberia-entity.service.js +10 -10
- package/src/api/cyberia-instance/cyberia-fallback-world.js +19 -209
- package/src/api/cyberia-instance/cyberia-instance.controller.js +14 -14
- package/src/api/cyberia-instance/cyberia-instance.model.js +3 -0
- package/src/api/cyberia-instance/cyberia-instance.service.js +22 -57
- package/src/api/cyberia-instance/cyberia-portal-connector.js +20 -246
- package/src/api/cyberia-instance/cyberia-world-generator.js +505 -0
- package/src/api/cyberia-instance-conf/cyberia-instance-conf.controller.js +10 -10
- package/src/api/cyberia-instance-conf/cyberia-instance-conf.defaults.js +216 -55
- package/src/api/cyberia-instance-conf/cyberia-instance-conf.model.js +4 -1
- package/src/api/cyberia-instance-conf/cyberia-instance-conf.service.js +18 -14
- package/src/api/cyberia-map/cyberia-map.controller.js +10 -10
- package/src/api/cyberia-map/cyberia-map.service.js +10 -10
- package/src/api/cyberia-quest/cyberia-quest.controller.js +74 -0
- package/src/api/cyberia-quest/cyberia-quest.model.js +67 -0
- package/src/api/cyberia-quest/cyberia-quest.router.js +27 -0
- package/src/api/cyberia-quest/cyberia-quest.service.js +42 -0
- package/src/api/cyberia-quest-progress/cyberia-quest-progress.controller.js +74 -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 +27 -0
- package/src/api/cyberia-quest-progress/cyberia-quest-progress.service.js +42 -0
- package/src/api/default/default.controller.js +10 -10
- package/src/api/default/default.service.js +10 -10
- package/src/api/document/document.controller.js +12 -12
- package/src/api/document/document.model.js +10 -16
- package/src/api/file/file.controller.js +8 -8
- package/src/api/file/file.model.js +10 -10
- package/src/api/file/file.service.js +36 -36
- package/src/api/instance/instance.controller.js +10 -10
- package/src/api/instance/instance.model.js +4 -10
- package/src/api/instance/instance.service.js +10 -10
- package/src/api/ipfs/ipfs.controller.js +12 -12
- package/src/api/ipfs/ipfs.model.js +4 -13
- package/src/api/ipfs/ipfs.service.js +14 -28
- package/src/api/object-layer/object-layer.controller.js +12 -12
- package/src/api/object-layer/object-layer.model.js +4 -17
- package/src/api/object-layer/object-layer.service.js +12 -12
- package/src/api/object-layer-render-frames/object-layer-render-frames.controller.js +10 -10
- package/src/api/object-layer-render-frames/object-layer-render-frames.model.js +6 -16
- package/src/api/object-layer-render-frames/object-layer-render-frames.service.js +18 -14
- package/src/api/test/test.controller.js +8 -8
- package/src/api/test/test.service.js +8 -8
- package/src/api/user/guest.service.js +99 -0
- package/src/api/user/user.controller.js +6 -6
- package/src/api/user/user.model.js +8 -13
- package/src/api/user/user.service.js +3 -20
- package/src/cli/cluster.js +61 -14
- package/src/cli/db.js +47 -2
- package/src/cli/deploy.js +67 -35
- package/src/cli/fs.js +79 -8
- package/src/cli/image.js +43 -1
- package/src/cli/index.js +26 -1
- package/src/cli/release.js +57 -1
- package/src/cli/repository.js +69 -31
- package/src/cli/run.js +415 -36
- package/src/cli/ssh.js +1 -1
- package/src/cli/static.js +43 -115
- package/src/client/Cryptokoyn.index.js +18 -21
- package/src/client/CyberiaPortal.index.js +19 -23
- package/src/client/Default.index.js +21 -33
- package/src/client/Itemledger.index.js +20 -26
- package/src/client/Underpost.index.js +19 -23
- package/src/client/components/core/404.js +4 -4
- package/src/client/components/core/500.js +4 -4
- package/src/client/components/core/Account.js +73 -60
- package/src/client/components/core/AgGrid.js +23 -33
- package/src/client/components/core/Alert.js +12 -13
- package/src/client/components/core/AppStore.js +1 -1
- package/src/client/components/core/Auth.js +35 -37
- package/src/client/components/core/Badge.js +7 -13
- package/src/client/components/core/BtnIcon.js +15 -17
- package/src/client/components/core/CalendarCore.js +42 -63
- package/src/client/components/core/Chat.js +13 -15
- package/src/client/components/core/ClientEvents.js +87 -0
- package/src/client/components/core/ColorPaletteElement.js +309 -0
- package/src/client/components/core/Content.js +17 -14
- package/src/client/components/core/Css.js +15 -71
- package/src/client/components/core/CssCore.js +12 -16
- package/src/client/components/core/D3Chart.js +4 -4
- package/src/client/components/core/Docs.js +64 -91
- package/src/client/components/core/DropDown.js +69 -91
- package/src/client/components/core/EventBus.js +92 -0
- package/src/client/components/core/EventsUI.js +14 -17
- package/src/client/components/core/FileExplorer.js +96 -228
- package/src/client/components/core/FullScreen.js +47 -75
- package/src/client/components/core/Input.js +24 -69
- package/src/client/components/core/Keyboard.js +25 -18
- package/src/client/components/core/KeyboardAvoidance.js +145 -0
- package/src/client/components/core/LoadingAnimation.js +25 -31
- package/src/client/components/core/LogIn.js +41 -41
- package/src/client/components/core/LogOut.js +23 -14
- package/src/client/components/core/Modal.js +462 -178
- package/src/client/components/core/NotificationManager.js +14 -18
- package/src/client/components/core/Panel.js +54 -50
- package/src/client/components/core/PanelForm.js +25 -125
- package/src/client/components/core/Polyhedron.js +110 -214
- package/src/client/components/core/PublicProfile.js +39 -32
- package/src/client/components/core/Recover.js +48 -44
- package/src/client/components/core/Responsive.js +88 -32
- package/src/client/components/core/RichText.js +9 -18
- package/src/client/components/core/Router.js +24 -3
- package/src/client/components/core/SearchBox.js +37 -37
- package/src/client/components/core/SignUp.js +39 -30
- package/src/client/components/core/SocketIo.js +31 -2
- package/src/client/components/core/SocketIoHandler.js +6 -6
- package/src/client/components/core/ToggleSwitch.js +8 -20
- package/src/client/components/core/ToolTip.js +5 -17
- package/src/client/components/core/Translate.js +56 -59
- package/src/client/components/core/Validator.js +26 -16
- package/src/client/components/core/Wallet.js +15 -26
- package/src/client/components/core/Worker.js +163 -27
- package/src/client/components/core/windowGetDimensions.js +7 -7
- package/src/client/components/cryptokoyn/{MenuCryptokoyn.js → AppShellCryptokoyn.js} +57 -57
- package/src/client/components/cryptokoyn/CssCryptokoyn.js +15 -15
- package/src/client/components/cryptokoyn/LogInCryptokoyn.js +6 -4
- package/src/client/components/cryptokoyn/LogOutCryptokoyn.js +6 -4
- package/src/client/components/cryptokoyn/RouterCryptokoyn.js +37 -0
- package/src/client/components/cryptokoyn/SettingsCryptokoyn.js +4 -4
- package/src/client/components/cryptokoyn/SignUpCryptokoyn.js +6 -4
- package/src/client/components/cyberia/InstanceEngineCyberia.js +141 -60
- package/src/client/components/cyberia/MapEngineCyberia.js +691 -214
- package/src/client/components/cyberia/ObjectLayerEngine.js +19 -0
- package/src/client/components/cyberia/ObjectLayerEngineModal.js +1204 -94
- package/src/client/components/cyberia/ObjectLayerEngineViewer.js +196 -298
- package/src/client/components/cyberia-portal/{MenuCyberiaPortal.js → AppShellCyberiaPortal.js} +102 -102
- package/src/client/components/cyberia-portal/CommonCyberiaPortal.js +305 -61
- package/src/client/components/cyberia-portal/CssCyberiaPortal.js +15 -15
- package/src/client/components/cyberia-portal/LogInCyberiaPortal.js +6 -4
- package/src/client/components/cyberia-portal/LogOutCyberiaPortal.js +6 -4
- package/src/client/components/cyberia-portal/MainBodyCyberiaPortal.js +4 -4
- package/src/client/components/cyberia-portal/RouterCyberiaPortal.js +60 -0
- package/src/client/components/cyberia-portal/SettingsCyberiaPortal.js +4 -4
- package/src/client/components/cyberia-portal/SignUpCyberiaPortal.js +6 -4
- package/src/client/components/cyberia-portal/TranslateCyberiaPortal.js +4 -4
- package/src/client/components/default/{MenuDefault.js → AppShellDefault.js} +87 -87
- package/src/client/components/default/CssDefault.js +12 -12
- package/src/client/components/default/LogInDefault.js +6 -4
- package/src/client/components/default/LogOutDefault.js +6 -4
- package/src/client/components/default/RouterDefault.js +47 -0
- package/src/client/components/default/SettingsDefault.js +4 -4
- package/src/client/components/default/SignUpDefault.js +6 -4
- package/src/client/components/default/TranslateDefault.js +3 -3
- package/src/client/components/itemledger/{MenuItemledger.js → AppShellItemledger.js} +57 -57
- package/src/client/components/itemledger/CssItemledger.js +15 -15
- package/src/client/components/itemledger/LogInItemledger.js +6 -4
- package/src/client/components/itemledger/LogOutItemledger.js +6 -4
- package/src/client/components/itemledger/RouterItemledger.js +38 -0
- package/src/client/components/itemledger/SettingsItemledger.js +4 -4
- package/src/client/components/itemledger/SignUpItemledger.js +6 -4
- package/src/client/components/itemledger/TranslateItemledger.js +3 -3
- package/src/client/components/underpost/{MenuUnderpost.js → AppShellUnderpost.js} +88 -88
- package/src/client/components/underpost/CssUnderpost.js +14 -14
- package/src/client/components/underpost/CyberpunkBloggerUnderpost.js +4 -4
- package/src/client/components/underpost/DocumentSearchProvider.js +1 -1
- package/src/client/components/underpost/LabGalleryUnderpost.js +12 -15
- package/src/client/components/underpost/LogInUnderpost.js +6 -4
- package/src/client/components/underpost/LogOutUnderpost.js +6 -4
- package/src/client/components/underpost/RouterUnderpost.js +45 -0
- package/src/client/components/underpost/SettingsUnderpost.js +4 -4
- package/src/client/components/underpost/SignUpUnderpost.js +6 -4
- package/src/client/components/underpost/TranslateUnderpost.js +4 -4
- package/src/client/public/cyberia-docs/ACTION-SYSTEM.md +235 -0
- package/src/client/public/cyberia-docs/ARCHITECTURE.md +443 -0
- package/src/client/public/cyberia-docs/CYBERIA-CLI.md +417 -0
- package/src/client/public/cyberia-docs/CYBERIA-CLIENT.md +313 -0
- package/src/client/public/cyberia-docs/CYBERIA-SERVER.md +260 -0
- package/src/client/public/cyberia-docs/ENTITY-PROFILE.md +241 -0
- package/src/client/public/cyberia-docs/HARDHAT-MODULE.md +300 -0
- package/src/client/public/cyberia-docs/OFF-CHAIN-ECONOMY.md +279 -0
- package/src/client/public/cyberia-docs/QUEST-SYSTEM.md +206 -0
- package/src/client/public/cyberia-docs/ROADMAP.md +240 -0
- package/src/client/public/cyberia-docs/WHITE-PAPER.md +732 -0
- package/src/client/services/atlas-sprite-sheet/atlas-sprite-sheet.service.js +14 -20
- package/src/client/services/core/core.service.js +17 -49
- package/src/client/services/crypto/crypto.service.js +8 -13
- package/src/client/services/cyberia-action/cyberia-action.service.js +99 -0
- package/src/client/services/cyberia-dialogue/cyberia-dialogue.service.js +10 -16
- package/src/client/services/cyberia-entity/cyberia-entity.management.js +5 -5
- package/src/client/services/cyberia-entity/cyberia-entity.service.js +10 -16
- package/src/client/services/cyberia-instance/cyberia-instance.management.js +6 -6
- package/src/client/services/cyberia-instance/cyberia-instance.service.js +12 -18
- package/src/client/services/cyberia-instance-conf/cyberia-instance-conf.service.js +10 -16
- package/src/client/services/cyberia-map/cyberia-map.management.js +6 -6
- package/src/client/services/cyberia-map/cyberia-map.service.js +12 -18
- 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/default/default.management.js +159 -267
- package/src/client/services/default/default.service.js +10 -16
- package/src/client/services/document/document.service.js +14 -19
- package/src/client/services/file/file.service.js +8 -13
- package/src/client/services/instance/instance.management.js +5 -5
- package/src/client/services/instance/instance.service.js +10 -15
- package/src/client/services/ipfs/ipfs.service.js +12 -18
- package/src/client/services/object-layer/object-layer.management.js +12 -12
- package/src/client/services/object-layer/object-layer.service.js +20 -26
- package/src/client/services/object-layer-render-frames/object-layer-render-frames.service.js +10 -16
- package/src/client/services/test/test.service.js +8 -13
- package/src/client/services/user/guest.service.js +86 -0
- package/src/client/services/user/user.management.js +5 -5
- package/src/client/services/user/user.service.js +14 -20
- package/src/client/ssr/body/404.js +3 -3
- package/src/client/ssr/body/500.js +3 -3
- package/src/client/ssr/body/CacheControl.js +5 -2
- package/src/client/ssr/body/DefaultSplashScreen.js +19 -12
- package/src/client/ssr/body/UnderpostDefaultSplashScreen.js +13 -6
- package/src/client/ssr/head/PwaItemledger.js +197 -60
- package/src/client/ssr/mailer/DefaultRecoverEmail.js +19 -20
- package/src/client/ssr/mailer/DefaultVerifyEmail.js +15 -16
- package/src/client/ssr/offline/Maintenance.js +12 -11
- package/src/client/ssr/offline/NoNetworkConnection.js +3 -3
- package/src/client/ssr/pages/Test.js +2 -2
- package/src/client/sw/core.sw.js +212 -0
- package/src/grpc/cyberia/grpc-server.js +179 -67
- package/src/index.js +1 -1
- package/src/runtime/cyberia-client/Dockerfile +80 -0
- package/src/runtime/cyberia-server/Dockerfile +37 -0
- package/src/runtime/express/Dockerfile +4 -4
- package/src/runtime/lampp/Dockerfile +8 -7
- package/src/runtime/wp/Dockerfile +11 -17
- package/src/server/atlas-sprite-sheet-generator.js +4 -2
- package/src/server/client-build-docs.js +45 -46
- package/src/server/client-build.js +334 -60
- package/src/server/client-formatted.js +47 -16
- package/src/server/conf.js +5 -4
- package/src/server/data-query.js +32 -20
- package/src/server/dns.js +22 -0
- package/src/server/ipfs-client.js +232 -91
- package/src/server/object-layer.js +1 -6
- package/src/server/process.js +13 -27
- package/src/server/semantic-layer-generator-floor.js +11 -51
- package/src/server/semantic-layer-generator-resource.js +259 -0
- package/src/server/semantic-layer-generator-skin.js +41 -171
- package/src/server/semantic-layer-generator.js +122 -14
- package/src/server/shape-generator.js +108 -0
- package/src/server/start.js +17 -3
- package/src/server/valkey.js +141 -235
- package/tsconfig.docs.json +15 -0
- package/typedoc.dd-cyberia.json +29 -0
- package/typedoc.json +29 -0
- package/WHITE-PAPER.md +0 -1540
- package/hardhat/README.md +0 -531
- package/hardhat/WHITE-PAPER.md +0 -1540
- package/jsdoc.dd-cyberia.json +0 -68
- package/jsdoc.json +0 -68
- package/src/api/object-layer/README.md +0 -672
- package/src/client/components/core/ColorPalette.js +0 -5267
- package/src/client/components/core/JoyStick.js +0 -80
- package/src/client/components/cryptokoyn/RoutesCryptokoyn.js +0 -39
- package/src/client/components/cyberia-portal/RoutesCyberiaPortal.js +0 -62
- package/src/client/components/cyberia-portal/ServerCyberiaPortal.js +0 -136
- package/src/client/components/default/RoutesDefault.js +0 -49
- package/src/client/components/itemledger/RoutesItemledger.js +0 -40
- package/src/client/components/underpost/RoutesUnderpost.js +0 -47
- package/src/client/sw/default.sw.js +0 -127
- package/src/client/sw/template.sw.js +0 -84
- package/src/grpc/cyberia/OFF_CHAIN_ECONOMY.md +0 -305
- package/src/grpc/cyberia/README.md +0 -326
|
@@ -12,9 +12,15 @@ import { EventsUI } from './EventsUI.js';
|
|
|
12
12
|
import { LoadingAnimation } from './LoadingAnimation.js';
|
|
13
13
|
import { loggerFactory } from './Logger.js';
|
|
14
14
|
import { LoadRouter } from './Router.js';
|
|
15
|
+
import { registerRoutes } from './Router.js';
|
|
15
16
|
import { Translate } from './Translate.js';
|
|
16
17
|
import { s } from './VanillaJs.js';
|
|
17
18
|
import { getProxyPath } from './Router.js';
|
|
19
|
+
import { Css } from './Css.js';
|
|
20
|
+
import { TranslateCore } from './Translate.js';
|
|
21
|
+
import { Responsive } from './Responsive.js';
|
|
22
|
+
import { SocketIo } from './SocketIo.js';
|
|
23
|
+
import { Keyboard } from './Keyboard.js';
|
|
18
24
|
const logger = loggerFactory(import.meta);
|
|
19
25
|
|
|
20
26
|
/**
|
|
@@ -71,17 +77,39 @@ class PwaWorker {
|
|
|
71
77
|
return window.renderPayload.dev || location.origin.match('localhost') || location.origin.match('127.0.0.1');
|
|
72
78
|
}
|
|
73
79
|
|
|
80
|
+
async runComponentInit(component, options) {
|
|
81
|
+
if (!component) return;
|
|
82
|
+
if (Array.isArray(component)) {
|
|
83
|
+
for (const item of component) await this.runComponentInit(item, options);
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
if (typeof component.instance === 'function') {
|
|
87
|
+
await component.instance(options);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
if (typeof component === 'function') {
|
|
91
|
+
await component(options);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
74
95
|
/**
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
* @param {object} options
|
|
80
|
-
* @param {function(): object}
|
|
81
|
-
* @param {function(): Promise<
|
|
96
|
+
* Bootstraps the app with a declarative options object.
|
|
97
|
+
* Shared core inits (Css, TranslateCore, Responsive, SocketIo, Keyboard) run
|
|
98
|
+
* internally in the correct order so index entrypoints only list app-specific components.
|
|
99
|
+
*
|
|
100
|
+
* @param {object} options
|
|
101
|
+
* @param {function(): object} options.router - Function returning the router instance.
|
|
102
|
+
* @param {function(): Promise<string>} [options.template] - Async function returning the landing HTML body.
|
|
103
|
+
* @param {Array} [options.themes] - CSS theme array passed to Css.loadThemes().
|
|
104
|
+
* @param {object|Array} [options.translate] - App translate class(es) with static instance().
|
|
105
|
+
* @param {object} [options.render] - AppShell class with static instance().
|
|
106
|
+
* @param {string} [options.socketPath] - Socket.IO path override.
|
|
107
|
+
* @param {object} [options.appStore] - AppStore whose .Data is used for socket channels.
|
|
108
|
+
* @param {object} [options.session] - Session components: { socket, login, signout, signup }.
|
|
109
|
+
* @param {function(): Promise<void>} [options.render] - Legacy raw render callback (backward-compat).
|
|
82
110
|
* @returns {Promise<void>}
|
|
83
111
|
*/
|
|
84
|
-
async instance({ router, render }) {
|
|
112
|
+
async instance({ router, template, themes, translate, render, socketPath, appStore, session }) {
|
|
85
113
|
window.ononline = async () => {
|
|
86
114
|
logger.warn('ononline');
|
|
87
115
|
};
|
|
@@ -131,10 +159,36 @@ class PwaWorker {
|
|
|
131
159
|
});
|
|
132
160
|
}
|
|
133
161
|
|
|
134
|
-
this.RouterInstance = router();
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
162
|
+
this.RouterInstance = typeof router?.instance === 'function' ? router.instance() : router();
|
|
163
|
+
if (this.RouterInstance?.Routes) registerRoutes(this.RouterInstance.Routes);
|
|
164
|
+
// Defer SW registration entirely out of the render critical path.
|
|
165
|
+
// Firefox IPC for SW registration is notably slower than Chromium;
|
|
166
|
+
// scheduling after 'load' means the first meaningful paint is not blocked.
|
|
167
|
+
this.registerServiceWorkerDeferred();
|
|
168
|
+
|
|
169
|
+
// ── declarative bootstrap path ──────────────────────────────────────────
|
|
170
|
+
// shared core inits
|
|
171
|
+
if (themes) await Css.loadThemes(themes);
|
|
172
|
+
await this.runComponentInit(TranslateCore);
|
|
173
|
+
await this.runComponentInit(translate);
|
|
174
|
+
await this.runComponentInit(Responsive);
|
|
175
|
+
// app shell render
|
|
176
|
+
if (render && typeof render.instance === 'function') {
|
|
177
|
+
const htmlMainBody = typeof template === 'function' ? template : undefined;
|
|
178
|
+
await this.runComponentInit(render, htmlMainBody ? { htmlMainBody } : undefined);
|
|
179
|
+
}
|
|
180
|
+
// socket init
|
|
181
|
+
const channels = appStore ? appStore.Data : (session && session.socket && session.socket.Data) || undefined;
|
|
182
|
+
await this.runComponentInit(SocketIo, { channels, path: socketPath });
|
|
183
|
+
if (session) {
|
|
184
|
+
await this.runComponentInit(session.socket);
|
|
185
|
+
await this.runComponentInit(session.login);
|
|
186
|
+
await this.runComponentInit(session.logout || session.signout);
|
|
187
|
+
await this.runComponentInit(session.signup);
|
|
188
|
+
await this.runComponentInit(session.account);
|
|
189
|
+
}
|
|
190
|
+
await this.runComponentInit(Keyboard);
|
|
191
|
+
// ────────────────────────────────────────────────────────────────────────
|
|
138
192
|
await LoadRouter(this.RouterInstance);
|
|
139
193
|
LoadingAnimation.removeSplashScreen();
|
|
140
194
|
if (this.devMode()) {
|
|
@@ -178,6 +232,68 @@ class PwaWorker {
|
|
|
178
232
|
});
|
|
179
233
|
}
|
|
180
234
|
|
|
235
|
+
async clearAllCaches() {
|
|
236
|
+
const cacheNames = await caches.keys();
|
|
237
|
+
await Promise.all(cacheNames.map((cacheName) => caches.delete(cacheName)));
|
|
238
|
+
return cacheNames.length;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
async clearWorkboxIndexedDb() {
|
|
242
|
+
if (!('indexedDB' in window) || typeof indexedDB.databases !== 'function') return 0;
|
|
243
|
+
const databases = await indexedDB.databases();
|
|
244
|
+
const workboxDatabases = databases
|
|
245
|
+
.map((database) => database.name)
|
|
246
|
+
.filter(
|
|
247
|
+
(name) =>
|
|
248
|
+
typeof name === 'string' &&
|
|
249
|
+
(name.toLowerCase().includes('workbox') ||
|
|
250
|
+
name.toLowerCase().includes('background-sync') ||
|
|
251
|
+
name.includes('api-mutation-queue')),
|
|
252
|
+
);
|
|
253
|
+
|
|
254
|
+
await Promise.all(
|
|
255
|
+
workboxDatabases.map(
|
|
256
|
+
(name) =>
|
|
257
|
+
new Promise((resolve) => {
|
|
258
|
+
const request = indexedDB.deleteDatabase(name);
|
|
259
|
+
request.onsuccess = () => resolve(true);
|
|
260
|
+
request.onerror = () => resolve(false);
|
|
261
|
+
request.onblocked = () => resolve(false);
|
|
262
|
+
}),
|
|
263
|
+
),
|
|
264
|
+
);
|
|
265
|
+
|
|
266
|
+
return workboxDatabases.length;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
async requestWorkboxReset() {
|
|
270
|
+
if (!(navigator.serviceWorker && navigator.serviceWorker.controller)) return false;
|
|
271
|
+
|
|
272
|
+
return new Promise((resolve) => {
|
|
273
|
+
const channel = new MessageChannel();
|
|
274
|
+
const timeoutId = setTimeout(() => resolve(false), 1500);
|
|
275
|
+
|
|
276
|
+
channel.port1.onmessage = (event) => {
|
|
277
|
+
clearTimeout(timeoutId);
|
|
278
|
+
resolve(event.data?.status === 'workbox-reset-done');
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
navigator.serviceWorker.controller.postMessage({ status: 'workbox-reset' }, [channel.port2]);
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
async resetWorkboxAndRestart() {
|
|
286
|
+
localStorage.clear();
|
|
287
|
+
sessionStorage.clear();
|
|
288
|
+
|
|
289
|
+
await this.requestWorkboxReset();
|
|
290
|
+
await this.uninstall();
|
|
291
|
+
await this.clearAllCaches();
|
|
292
|
+
await this.clearWorkboxIndexedDb();
|
|
293
|
+
await this.install();
|
|
294
|
+
await this.reload(600);
|
|
295
|
+
}
|
|
296
|
+
|
|
181
297
|
/**
|
|
182
298
|
* Updates the application by clearing specific caches and running the service worker update logic.
|
|
183
299
|
* Cache names matching 'components/', 'services/', or '.index.js' are deleted.
|
|
@@ -197,6 +313,30 @@ class PwaWorker {
|
|
|
197
313
|
}
|
|
198
314
|
}
|
|
199
315
|
|
|
316
|
+
/**
|
|
317
|
+
* Schedules SW registration to run after the page 'load' event (or immediately
|
|
318
|
+
* if the page is already loaded). This keeps SW work off the render critical path,
|
|
319
|
+
* which is the primary cause of Firefox being slower than Chromium on first load.
|
|
320
|
+
* @memberof PwaWorker
|
|
321
|
+
* @returns {void}
|
|
322
|
+
*/
|
|
323
|
+
registerServiceWorkerDeferred() {
|
|
324
|
+
if (!('serviceWorker' in navigator)) {
|
|
325
|
+
logger.warn('Service Worker Disabled in browser');
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
const register = () => {
|
|
329
|
+
this.status().then((isInstall) => {
|
|
330
|
+
if (!isInstall) this.install();
|
|
331
|
+
});
|
|
332
|
+
};
|
|
333
|
+
if (document.readyState === 'complete') {
|
|
334
|
+
register();
|
|
335
|
+
} else {
|
|
336
|
+
window.addEventListener('load', register, { once: true });
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
|
|
200
340
|
/**
|
|
201
341
|
* Checks the current status of all service worker registrations and sets the
|
|
202
342
|
* `updateServiceWorker` function reference if an active worker is found.
|
|
@@ -242,9 +382,7 @@ class PwaWorker {
|
|
|
242
382
|
return new Promise((resolve) => {
|
|
243
383
|
if ('serviceWorker' in navigator) {
|
|
244
384
|
navigator.serviceWorker
|
|
245
|
-
.register(`${getProxyPath()}sw.js
|
|
246
|
-
type: 'module',
|
|
247
|
-
})
|
|
385
|
+
.register(`${getProxyPath()}sw.js`)
|
|
248
386
|
.then((...args) => {
|
|
249
387
|
logger.warn('Service Worker Registered', args);
|
|
250
388
|
resolve(args);
|
|
@@ -340,28 +478,26 @@ class PwaWorker {
|
|
|
340
478
|
// Event listener for the clean cache button
|
|
341
479
|
EventsUI.onClick(`.btn-clean-cache`, async (e) => {
|
|
342
480
|
e.preventDefault();
|
|
343
|
-
//
|
|
344
|
-
|
|
345
|
-
await this.uninstall();
|
|
346
|
-
await this.reload();
|
|
481
|
+
// Full reset: workbox runtime state + SW registrations + client storage.
|
|
482
|
+
await this.resetWorkboxAndRestart();
|
|
347
483
|
});
|
|
348
484
|
});
|
|
349
485
|
return html` <div class="in">
|
|
350
|
-
${await BtnIcon.
|
|
486
|
+
${await BtnIcon.instance({
|
|
351
487
|
class: 'inl section-mp btn-custom btn-install-service-controller hide',
|
|
352
|
-
label: html`<i class="fas fa-download"></i> ${Translate.
|
|
488
|
+
label: html`<i class="fas fa-download"></i> ${Translate.instance('Install control service')}`,
|
|
353
489
|
})}
|
|
354
|
-
${await BtnIcon.
|
|
490
|
+
${await BtnIcon.instance({
|
|
355
491
|
class: 'inl section-mp btn-custom btn-uninstall-service-controller hide',
|
|
356
|
-
label: html`<i class="far fa-trash-alt"></i> ${Translate.
|
|
492
|
+
label: html`<i class="far fa-trash-alt"></i> ${Translate.instance('Uninstall control service')}`,
|
|
357
493
|
})}
|
|
358
|
-
${await BtnIcon.
|
|
494
|
+
${await BtnIcon.instance({
|
|
359
495
|
class: 'inl section-mp btn-custom btn-clean-cache',
|
|
360
|
-
label: html`<i class="fa-solid fa-broom"></i> ${Translate.
|
|
496
|
+
label: html`<i class="fa-solid fa-broom"></i> ${Translate.instance('clean-cache')}`,
|
|
361
497
|
})}
|
|
362
|
-
${await BtnIcon.
|
|
498
|
+
${await BtnIcon.instance({
|
|
363
499
|
class: 'inl section-mp btn-custom btn-reload hide',
|
|
364
|
-
label: html`<i class="fas fa-sync-alt"></i> ${Translate.
|
|
500
|
+
label: html`<i class="fas fa-sync-alt"></i> ${Translate.instance('Reload')}`,
|
|
365
501
|
})}
|
|
366
502
|
</div>`;
|
|
367
503
|
}
|
|
@@ -149,23 +149,23 @@ export class PwaWindowDimensions {
|
|
|
149
149
|
* Get the best-available viewport height in pixels.
|
|
150
150
|
*
|
|
151
151
|
* Priority (from most reliable for "visible" to least):
|
|
152
|
-
* 1.
|
|
153
|
-
* 2.
|
|
154
|
-
* 3.
|
|
155
|
-
* 4.
|
|
156
|
-
* 5. window.visualViewport.height (if `preferVisualViewport` is false)
|
|
152
|
+
* 1. document.documentElement.clientHeight (Layout viewport, default — stable against iframe scrolls)
|
|
153
|
+
* 2. window.innerHeight (Window size)
|
|
154
|
+
* 3. document.body.clientHeight (Body size)
|
|
155
|
+
* 4. window.visualViewport.height (if `preferVisualViewport` is true; first priority; or last before screen fallbacks)
|
|
156
|
+
* 5. window.visualViewport.height (if `preferVisualViewport` is false — used as fallback after layout values)
|
|
157
157
|
* 6. window.screen.availHeight / window.screen.height (Physical screen)
|
|
158
158
|
* 7. window.outerHeight (Last resort)
|
|
159
159
|
*
|
|
160
160
|
* @memberof PwaWindowDimensions
|
|
161
161
|
* @static
|
|
162
162
|
* @param {Object} [options]
|
|
163
|
-
* @param {boolean} [options.preferVisualViewport=
|
|
163
|
+
* @param {boolean} [options.preferVisualViewport=false] - When true, visualViewport is checked first (best for visible screen size, e.g., above mobile keyboard). Defaults to false to use stable layout viewport height, preventing Chrome iframe scroll from causing transient visualViewport changes that affect modal sizing.
|
|
164
164
|
* @returns {number|null} Height in px (rounded integer) or null if none found.
|
|
165
165
|
* @memberof PwaWindowDimensions
|
|
166
166
|
*/
|
|
167
167
|
static getH(options = {}) {
|
|
168
|
-
const { preferVisualViewport =
|
|
168
|
+
const { preferVisualViewport = false } = options;
|
|
169
169
|
|
|
170
170
|
const vv = PwaWindowDimensions.#getFromVisualViewport();
|
|
171
171
|
const de = PwaWindowDimensions.#getFromDocumentElement();
|
|
@@ -12,125 +12,125 @@ import { htmls, s } from '../core/VanillaJs.js';
|
|
|
12
12
|
import { getProxyPath } from '../core/Router.js';
|
|
13
13
|
import { AppStoreCryptokoyn } from './AppStoreCryptokoyn.js';
|
|
14
14
|
import Sortable from 'sortablejs';
|
|
15
|
-
import { RouterCryptokoyn, BannerAppTemplate } from './
|
|
15
|
+
import { RouterCryptokoyn, BannerAppTemplate } from './RouterCryptokoyn.js';
|
|
16
16
|
import { Wallet } from '../core/Wallet.js';
|
|
17
17
|
import { Badge } from '../core/Badge.js';
|
|
18
18
|
import { SettingsCryptokoyn } from './SettingsCryptokoyn.js';
|
|
19
19
|
import { Recover } from '../core/Recover.js';
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
Data
|
|
23
|
-
|
|
24
|
-
const id = getId(
|
|
25
|
-
|
|
26
|
-
const RouterInstance = RouterCryptokoyn();
|
|
21
|
+
class AppShellCryptokoyn {
|
|
22
|
+
static Data = {};
|
|
23
|
+
static async instance() {
|
|
24
|
+
const id = getId(AppShellCryptokoyn.Data, 'menu-');
|
|
25
|
+
AppShellCryptokoyn.Data[id] = {};
|
|
26
|
+
const RouterInstance = RouterCryptokoyn.instance();
|
|
27
27
|
|
|
28
28
|
const { barConfig } = await Themes[Css.currentTheme]();
|
|
29
29
|
|
|
30
30
|
const badgeNotificationMenuStyle = { top: '-33px', left: '24px' };
|
|
31
31
|
const barMode = undefined; // 'top-bottom-bar';
|
|
32
|
-
await Modal.
|
|
32
|
+
await Modal.instance({
|
|
33
33
|
id: 'modal-menu',
|
|
34
34
|
html: html`
|
|
35
35
|
<div class="fl menu-btn-container">
|
|
36
|
-
${await BtnIcon.
|
|
36
|
+
${await BtnIcon.instance({
|
|
37
37
|
class: 'in wfa main-btn-menu main-btn-home main-btn-menu-active',
|
|
38
38
|
useMenuBtn: true,
|
|
39
39
|
label: renderMenuLabel({
|
|
40
40
|
icon: html`<img class="inl cryptokoyn-menu-icon" src="${getProxyPath()}assets/ui-icons/home.png" />`,
|
|
41
|
-
text: html`<span class="menu-label-text">${Translate.
|
|
41
|
+
text: html`<span class="menu-label-text">${Translate.instance('home')}</span>`,
|
|
42
42
|
}),
|
|
43
43
|
// style: 'display: none',
|
|
44
44
|
attrs: `data-id="home"`,
|
|
45
45
|
tabHref: `${getProxyPath()}`,
|
|
46
46
|
handleContainerClass: 'handle-btn-container',
|
|
47
|
-
tooltipHtml: await Badge.
|
|
47
|
+
tooltipHtml: await Badge.instance(buildBadgeToolTipMenuOption('home')),
|
|
48
48
|
})}
|
|
49
|
-
${await BtnIcon.
|
|
49
|
+
${await BtnIcon.instance({
|
|
50
50
|
class: 'in wfa main-btn-menu main-btn-log-in',
|
|
51
51
|
useMenuBtn: true,
|
|
52
52
|
label: renderMenuLabel({
|
|
53
53
|
icon: html`<img class="inl cryptokoyn-menu-icon" src="${getProxyPath()}assets/ui-icons/log-in.png" />`,
|
|
54
|
-
text: html`<span class="menu-label-text">${Translate.
|
|
54
|
+
text: html`<span class="menu-label-text">${Translate.instance('log-in')}</span>`,
|
|
55
55
|
}),
|
|
56
56
|
attrs: `data-id="log-in"`,
|
|
57
57
|
tabHref: `${getProxyPath()}log-in`,
|
|
58
58
|
handleContainerClass: 'handle-btn-container',
|
|
59
|
-
tooltipHtml: await Badge.
|
|
59
|
+
tooltipHtml: await Badge.instance(buildBadgeToolTipMenuOption('log-in')),
|
|
60
60
|
})}
|
|
61
|
-
${await BtnIcon.
|
|
61
|
+
${await BtnIcon.instance({
|
|
62
62
|
class: 'in wfa main-btn-menu main-btn-sign-up',
|
|
63
63
|
useMenuBtn: true,
|
|
64
64
|
label: renderMenuLabel({
|
|
65
65
|
icon: html`<img class="inl cryptokoyn-menu-icon" src="${getProxyPath()}assets/ui-icons/sign-up.png" />`,
|
|
66
|
-
text: html`<span class="menu-label-text">${Translate.
|
|
66
|
+
text: html`<span class="menu-label-text">${Translate.instance('sign-up')}</span>`,
|
|
67
67
|
}),
|
|
68
68
|
attrs: `data-id="sign-up"`,
|
|
69
69
|
tabHref: `${getProxyPath()}sign-up`,
|
|
70
70
|
handleContainerClass: 'handle-btn-container',
|
|
71
|
-
tooltipHtml: await Badge.
|
|
71
|
+
tooltipHtml: await Badge.instance(buildBadgeToolTipMenuOption('sign-up')),
|
|
72
72
|
})}
|
|
73
|
-
${await BtnIcon.
|
|
73
|
+
${await BtnIcon.instance({
|
|
74
74
|
class: 'in wfa main-btn-menu main-btn-log-out',
|
|
75
75
|
useMenuBtn: true,
|
|
76
76
|
label: renderMenuLabel({
|
|
77
77
|
icon: html`<img class="inl cryptokoyn-menu-icon" src="${getProxyPath()}assets/ui-icons/log-out.png" />`,
|
|
78
|
-
text: html`<span class="menu-label-text">${Translate.
|
|
78
|
+
text: html`<span class="menu-label-text">${Translate.instance('log-out')}</span>`,
|
|
79
79
|
}),
|
|
80
80
|
attrs: `data-id="log-out"`,
|
|
81
81
|
style: 'display: none',
|
|
82
82
|
tabHref: `${getProxyPath()}log-out`,
|
|
83
83
|
handleContainerClass: 'handle-btn-container',
|
|
84
|
-
tooltipHtml: await Badge.
|
|
84
|
+
tooltipHtml: await Badge.instance(buildBadgeToolTipMenuOption('log-out')),
|
|
85
85
|
})}
|
|
86
|
-
${await BtnIcon.
|
|
86
|
+
${await BtnIcon.instance({
|
|
87
87
|
class: 'in wfa main-btn-menu main-btn-account',
|
|
88
88
|
useMenuBtn: true,
|
|
89
89
|
label: renderMenuLabel({
|
|
90
90
|
icon: html`<img class="inl cryptokoyn-menu-icon" src="${getProxyPath()}assets/ui-icons/account.png" />`,
|
|
91
|
-
text: html`<span class="menu-label-text">${Translate.
|
|
91
|
+
text: html`<span class="menu-label-text">${Translate.instance('account')}</span>`,
|
|
92
92
|
}),
|
|
93
93
|
style: 'display: none',
|
|
94
94
|
attrs: `data-id="account"`,
|
|
95
95
|
tabHref: `${getProxyPath()}account`,
|
|
96
96
|
handleContainerClass: 'handle-btn-container',
|
|
97
|
-
tooltipHtml: await Badge.
|
|
97
|
+
tooltipHtml: await Badge.instance(buildBadgeToolTipMenuOption('account')),
|
|
98
98
|
})}
|
|
99
|
-
${await BtnIcon.
|
|
99
|
+
${await BtnIcon.instance({
|
|
100
100
|
class: 'in wfa main-btn-menu main-btn-wallet',
|
|
101
101
|
useMenuBtn: true,
|
|
102
102
|
label: renderMenuLabel({
|
|
103
103
|
icon: html`<img class="inl cryptokoyn-menu-icon" src="${getProxyPath()}assets/ui-icons/wallet.png" />`,
|
|
104
|
-
text: html`<span class="menu-label-text">${Translate.
|
|
104
|
+
text: html`<span class="menu-label-text">${Translate.instance('wallet')}</span>`,
|
|
105
105
|
}),
|
|
106
106
|
attrs: `data-id="wallet"`,
|
|
107
107
|
tabHref: `${getProxyPath()}wallet`,
|
|
108
108
|
handleContainerClass: 'handle-btn-container',
|
|
109
|
-
tooltipHtml: await Badge.
|
|
109
|
+
tooltipHtml: await Badge.instance(buildBadgeToolTipMenuOption('wallet')),
|
|
110
110
|
})}
|
|
111
|
-
${await BtnIcon.
|
|
111
|
+
${await BtnIcon.instance({
|
|
112
112
|
class: 'in wfa main-btn-menu main-btn-settings',
|
|
113
113
|
useMenuBtn: true,
|
|
114
114
|
label: renderMenuLabel({
|
|
115
115
|
icon: html`<img class="inl cryptokoyn-menu-icon" src="${getProxyPath()}assets/ui-icons/settings.png" />`,
|
|
116
|
-
text: html`<span class="menu-label-text">${Translate.
|
|
116
|
+
text: html`<span class="menu-label-text">${Translate.instance('settings')}</span>`,
|
|
117
117
|
}),
|
|
118
118
|
attrs: `data-id="settings"`,
|
|
119
119
|
tabHref: `${getProxyPath()}settings`,
|
|
120
120
|
handleContainerClass: 'handle-btn-container',
|
|
121
|
-
tooltipHtml: await Badge.
|
|
121
|
+
tooltipHtml: await Badge.instance(buildBadgeToolTipMenuOption('settings')),
|
|
122
122
|
})}
|
|
123
|
-
${await BtnIcon.
|
|
123
|
+
${await BtnIcon.instance({
|
|
124
124
|
class: 'in wfa main-btn-menu main-btn-recover hide',
|
|
125
125
|
useMenuBtn: true,
|
|
126
126
|
label: renderMenuLabel({
|
|
127
127
|
icon: html`<i class="fa-solid fa-arrow-rotate-left"></i>`,
|
|
128
|
-
text: html`<span class="menu-label-text">${Translate.
|
|
128
|
+
text: html`<span class="menu-label-text">${Translate.instance('recover')}</span>`,
|
|
129
129
|
}),
|
|
130
130
|
attrs: `data-id="recover"`,
|
|
131
131
|
tabHref: `${getProxyPath()}recover`,
|
|
132
132
|
handleContainerClass: 'handle-btn-container',
|
|
133
|
-
tooltipHtml: await Badge.
|
|
133
|
+
tooltipHtml: await Badge.instance(buildBadgeToolTipMenuOption('recover')),
|
|
134
134
|
})}
|
|
135
135
|
</div>
|
|
136
136
|
`,
|
|
@@ -155,7 +155,7 @@ const MenuCryptokoyn = {
|
|
|
155
155
|
searchCustomImgClass: 'cryptokoyn-menu-icon',
|
|
156
156
|
});
|
|
157
157
|
|
|
158
|
-
|
|
158
|
+
AppShellCryptokoyn.Data[id].sortable = new Sortable(s(`.menu-btn-container`), {
|
|
159
159
|
animation: 150,
|
|
160
160
|
group: `menu-sortable`,
|
|
161
161
|
forceFallback: true,
|
|
@@ -206,15 +206,15 @@ const MenuCryptokoyn = {
|
|
|
206
206
|
|
|
207
207
|
EventsUI.onClick(`.main-btn-sign-up`, async () => {
|
|
208
208
|
const { barConfig } = await Themes[Css.currentTheme]();
|
|
209
|
-
await Modal.
|
|
209
|
+
await Modal.instance({
|
|
210
210
|
id: 'modal-sign-up',
|
|
211
211
|
route: 'sign-up',
|
|
212
212
|
barConfig,
|
|
213
213
|
title: renderViewTitle({
|
|
214
214
|
icon: html`<img class="inl cryptokoyn-menu-icon-modal" src="${getProxyPath()}assets/ui-icons/sign-up.png" />`,
|
|
215
|
-
text: `<span class='inl cryptokoyn-text-title-modal'>${Translate.
|
|
215
|
+
text: `<span class='inl cryptokoyn-text-title-modal'>${Translate.instance('sign-up')}</span>`,
|
|
216
216
|
}),
|
|
217
|
-
html: async () => await SignUp.
|
|
217
|
+
html: async () => await SignUp.instance({ idModal: 'modal-sign-up' }),
|
|
218
218
|
handleType: 'bar',
|
|
219
219
|
maximize: true,
|
|
220
220
|
mode: 'view',
|
|
@@ -225,15 +225,15 @@ const MenuCryptokoyn = {
|
|
|
225
225
|
|
|
226
226
|
EventsUI.onClick(`.main-btn-log-out`, async () => {
|
|
227
227
|
const { barConfig } = await Themes[Css.currentTheme]();
|
|
228
|
-
await Modal.
|
|
228
|
+
await Modal.instance({
|
|
229
229
|
id: 'modal-log-out',
|
|
230
230
|
route: 'log-out',
|
|
231
231
|
barConfig,
|
|
232
232
|
title: renderViewTitle({
|
|
233
233
|
icon: html`<img class="inl cryptokoyn-menu-icon-modal" src="${getProxyPath()}assets/ui-icons/log-out.png" />`,
|
|
234
|
-
text: `<span class='inl cryptokoyn-text-title-modal'>${Translate.
|
|
234
|
+
text: `<span class='inl cryptokoyn-text-title-modal'>${Translate.instance('log-out')}</span>`,
|
|
235
235
|
}),
|
|
236
|
-
html: async () => await LogOut.
|
|
236
|
+
html: async () => await LogOut.instance(),
|
|
237
237
|
handleType: 'bar',
|
|
238
238
|
maximize: true,
|
|
239
239
|
mode: 'view',
|
|
@@ -244,15 +244,15 @@ const MenuCryptokoyn = {
|
|
|
244
244
|
|
|
245
245
|
EventsUI.onClick(`.main-btn-log-in`, async () => {
|
|
246
246
|
const { barConfig } = await Themes[Css.currentTheme]();
|
|
247
|
-
await Modal.
|
|
247
|
+
await Modal.instance({
|
|
248
248
|
id: 'modal-log-in',
|
|
249
249
|
route: 'log-in',
|
|
250
250
|
barConfig,
|
|
251
251
|
title: renderViewTitle({
|
|
252
252
|
icon: html`<img class="inl cryptokoyn-menu-icon-modal" src="${getProxyPath()}assets/ui-icons/log-in.png" />`,
|
|
253
|
-
text: `<span class='inl cryptokoyn-text-title-modal'>${Translate.
|
|
253
|
+
text: `<span class='inl cryptokoyn-text-title-modal'>${Translate.instance('log-in')}</span>`,
|
|
254
254
|
}),
|
|
255
|
-
html: async () => await LogIn.
|
|
255
|
+
html: async () => await LogIn.instance(),
|
|
256
256
|
handleType: 'bar',
|
|
257
257
|
maximize: true,
|
|
258
258
|
mode: 'view',
|
|
@@ -263,16 +263,16 @@ const MenuCryptokoyn = {
|
|
|
263
263
|
|
|
264
264
|
EventsUI.onClick(`.main-btn-account`, async () => {
|
|
265
265
|
const { barConfig } = await Themes[Css.currentTheme]();
|
|
266
|
-
await Modal.
|
|
266
|
+
await Modal.instance({
|
|
267
267
|
id: 'modal-account',
|
|
268
268
|
route: 'account',
|
|
269
269
|
barConfig,
|
|
270
270
|
title: renderViewTitle({
|
|
271
271
|
icon: html`<img class="inl cryptokoyn-menu-icon-modal" src="${getProxyPath()}assets/ui-icons/account.png" />`,
|
|
272
|
-
text: `<span class='inl cryptokoyn-text-title-modal'>${Translate.
|
|
272
|
+
text: `<span class='inl cryptokoyn-text-title-modal'>${Translate.instance('account')}</span>`,
|
|
273
273
|
}),
|
|
274
274
|
html: async () =>
|
|
275
|
-
await Account.
|
|
275
|
+
await Account.instance({
|
|
276
276
|
idModal: 'modal-account',
|
|
277
277
|
user: AppStoreCryptokoyn.Data.user.main.model.user,
|
|
278
278
|
disabled: [],
|
|
@@ -287,15 +287,15 @@ const MenuCryptokoyn = {
|
|
|
287
287
|
|
|
288
288
|
EventsUI.onClick(`.main-btn-wallet`, async () => {
|
|
289
289
|
const { barConfig } = await Themes[Css.currentTheme]();
|
|
290
|
-
await Modal.
|
|
290
|
+
await Modal.instance({
|
|
291
291
|
id: 'modal-wallet',
|
|
292
292
|
route: 'wallet',
|
|
293
293
|
barConfig,
|
|
294
294
|
title: renderViewTitle({
|
|
295
295
|
icon: html`<img class="inl cryptokoyn-menu-icon-modal" src="${getProxyPath()}assets/ui-icons/wallet.png" />`,
|
|
296
|
-
text: `<span class='inl cryptokoyn-text-title-modal'>${Translate.
|
|
296
|
+
text: `<span class='inl cryptokoyn-text-title-modal'>${Translate.instance('wallet')}</span>`,
|
|
297
297
|
}),
|
|
298
|
-
html: async () => await Wallet.
|
|
298
|
+
html: async () => await Wallet.instance({ idModal: 'modal-wallet' }),
|
|
299
299
|
handleType: 'bar',
|
|
300
300
|
maximize: true,
|
|
301
301
|
mode: 'view',
|
|
@@ -306,7 +306,7 @@ const MenuCryptokoyn = {
|
|
|
306
306
|
|
|
307
307
|
EventsUI.onClick(`.main-btn-settings`, async () => {
|
|
308
308
|
const { barConfig } = await Themes[Css.currentTheme]();
|
|
309
|
-
await Modal.
|
|
309
|
+
await Modal.instance({
|
|
310
310
|
id: 'modal-settings',
|
|
311
311
|
route: 'settings',
|
|
312
312
|
barConfig,
|
|
@@ -315,9 +315,9 @@ const MenuCryptokoyn = {
|
|
|
315
315
|
class="inl cryptokoyn-menu-icon-modal"
|
|
316
316
|
src="${getProxyPath()}assets/ui-icons/settings.png"
|
|
317
317
|
/>`,
|
|
318
|
-
text: `<span class='inl cryptokoyn-text-title-modal'>${Translate.
|
|
318
|
+
text: `<span class='inl cryptokoyn-text-title-modal'>${Translate.instance('settings')}</span>`,
|
|
319
319
|
}),
|
|
320
|
-
html: async () => await SettingsCryptokoyn.
|
|
320
|
+
html: async () => await SettingsCryptokoyn.instance({ idModal: 'modal-settings' }),
|
|
321
321
|
handleType: 'bar',
|
|
322
322
|
maximize: true,
|
|
323
323
|
mode: 'view',
|
|
@@ -329,16 +329,16 @@ const MenuCryptokoyn = {
|
|
|
329
329
|
|
|
330
330
|
EventsUI.onClick(`.main-btn-recover`, async () => {
|
|
331
331
|
const { barConfig } = await Themes[Css.currentTheme]();
|
|
332
|
-
await Modal.
|
|
332
|
+
await Modal.instance({
|
|
333
333
|
id: 'modal-recover',
|
|
334
334
|
route: 'recover',
|
|
335
335
|
barConfig,
|
|
336
336
|
title: renderViewTitle({
|
|
337
337
|
icon: html`<i class="fa-solid fa-arrow-rotate-left"></i>`,
|
|
338
|
-
text: Translate.
|
|
338
|
+
text: Translate.instance('recover'),
|
|
339
339
|
}),
|
|
340
340
|
html: async () =>
|
|
341
|
-
await Recover.
|
|
341
|
+
await Recover.instance({ idModal: 'modal-recover', user: AppStoreCryptokoyn.Data.user.main.model.user }),
|
|
342
342
|
handleType: 'bar',
|
|
343
343
|
maximize: true,
|
|
344
344
|
mode: 'view',
|
|
@@ -346,7 +346,7 @@ const MenuCryptokoyn = {
|
|
|
346
346
|
RouterInstance,
|
|
347
347
|
});
|
|
348
348
|
});
|
|
349
|
-
}
|
|
350
|
-
}
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
351
|
|
|
352
|
-
export {
|
|
352
|
+
export { AppShellCryptokoyn };
|
|
@@ -153,11 +153,11 @@ const CssCommonCryptokoyn = async () => {
|
|
|
153
153
|
<div class="ag-grid-style"></div>`;
|
|
154
154
|
};
|
|
155
155
|
|
|
156
|
-
|
|
157
|
-
theme
|
|
158
|
-
dark
|
|
159
|
-
barButtonsIconTheme
|
|
160
|
-
render
|
|
156
|
+
class CssCryptokoynDark {
|
|
157
|
+
static theme = 'cryptokoyn-dark';
|
|
158
|
+
static dark = true;
|
|
159
|
+
static barButtonsIconTheme = 'img';
|
|
160
|
+
static render = async () => {
|
|
161
161
|
return (
|
|
162
162
|
(await CssCommonCryptokoyn()) +
|
|
163
163
|
html`
|
|
@@ -177,14 +177,14 @@ const CssCryptokoynDark = {
|
|
|
177
177
|
${borderChar(2, `#ff0d0d`, ['.default-slide-menu-top-bar-fix-title-container-text'])}
|
|
178
178
|
`
|
|
179
179
|
);
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
theme
|
|
185
|
-
dark
|
|
186
|
-
barButtonsIconTheme
|
|
187
|
-
render
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
class CssCryptokoynLight {
|
|
184
|
+
static theme = 'cryptokoyn-light';
|
|
185
|
+
static dark = false;
|
|
186
|
+
static barButtonsIconTheme = 'img';
|
|
187
|
+
static render = async () => {
|
|
188
188
|
return (
|
|
189
189
|
(await CssCommonCryptokoyn()) +
|
|
190
190
|
html`
|
|
@@ -206,7 +206,7 @@ const CssCryptokoynLight = {
|
|
|
206
206
|
${borderChar(1, `#010101`, ['button', '.a-btn'], true)}
|
|
207
207
|
`
|
|
208
208
|
);
|
|
209
|
-
}
|
|
210
|
-
}
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
211
|
|
|
212
212
|
export { CssCryptokoynDark, CssCommonCryptokoyn, CssCryptokoynLight };
|