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
|
@@ -10,49 +10,42 @@ import { Responsive } from './Responsive.js';
|
|
|
10
10
|
import { listenQueryPathInstance, RouterEvents, setQueryPath, getQueryParams } from './Router.js';
|
|
11
11
|
import { Translate } from './Translate.js';
|
|
12
12
|
import { append, getTimeZone, htmls, s, sa } from './VanillaJs.js';
|
|
13
|
-
|
|
14
13
|
// https://fullcalendar.io/docs/event-object
|
|
15
|
-
|
|
16
14
|
const daysOfWeekOptions = ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'];
|
|
17
|
-
|
|
18
15
|
const eventDateFactory = (event) =>
|
|
19
16
|
newInstance({
|
|
20
17
|
event: { ...event.extendedProps, title: event._def.title },
|
|
21
18
|
start: event.start,
|
|
22
19
|
end: event.end,
|
|
23
20
|
});
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
this.Data[options.idModal] = {
|
|
21
|
+
class CalendarCore {
|
|
22
|
+
static async RenderStyle() {}
|
|
23
|
+
static Data = {};
|
|
24
|
+
static async instance(options = { idModal: '', appStore: {}, hiddenDates: [] }) {
|
|
25
|
+
CalendarCore.Data[options.idModal] = {
|
|
30
26
|
data: [],
|
|
31
27
|
originData: [],
|
|
32
28
|
filesData: [],
|
|
33
29
|
calendar: {},
|
|
34
30
|
hiddenDates: options.hiddenDates ? options.hiddenDates : [],
|
|
35
31
|
};
|
|
36
|
-
|
|
37
32
|
const titleIcon = html`<i class="fas fa-calendar-alt"></i>`;
|
|
38
|
-
|
|
39
33
|
const getPanelData = async () => {
|
|
40
34
|
const result = await EventSchedulerService.get({
|
|
41
35
|
id: `${getQueryParams().cid ? getQueryParams().cid : Auth.getToken() ? 'creatorUser' : ''}`,
|
|
42
36
|
});
|
|
43
37
|
NotificationManager.Push({
|
|
44
|
-
html: result.status === 'success' ? Translate.
|
|
38
|
+
html: result.status === 'success' ? Translate.instance('success-get-events-scheduler') : result.message,
|
|
45
39
|
status: result.status,
|
|
46
40
|
});
|
|
47
41
|
if (result.status === 'success') {
|
|
48
42
|
const resultData = Array.isArray(result.data) ? result.data : result.data ? [result.data] : [];
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
43
|
+
CalendarCore.Data[options.idModal].filesData = [];
|
|
44
|
+
CalendarCore.Data[options.idModal].originData = newInstance(resultData);
|
|
45
|
+
CalendarCore.Data[options.idModal].data = resultData.map((o) => {
|
|
52
46
|
if (o.creatorUserId && options.appStore.Data.user.main.model.user._id === o.creatorUserId) o.tools = true;
|
|
53
47
|
o.id = o._id;
|
|
54
|
-
|
|
55
|
-
this.Data[options.idModal].filesData.push({});
|
|
48
|
+
CalendarCore.Data[options.idModal].filesData.push({});
|
|
56
49
|
return o;
|
|
57
50
|
});
|
|
58
51
|
setTimeout(() => {
|
|
@@ -69,17 +62,15 @@ const CalendarCore = {
|
|
|
69
62
|
// o.exdate = ['2024-04-02'];
|
|
70
63
|
// delete o.end;
|
|
71
64
|
// delete o.start;
|
|
72
|
-
|
|
73
65
|
return o;
|
|
74
66
|
}),
|
|
75
67
|
);
|
|
76
68
|
});
|
|
77
69
|
}
|
|
78
70
|
};
|
|
79
|
-
|
|
80
71
|
const renderCalendar = (events) => {
|
|
81
72
|
const calendarEl = s(`.calendar-${idPanel}`);
|
|
82
|
-
|
|
73
|
+
CalendarCore.Data[options.idModal].calendar = new FullCalendar.Calendar(calendarEl, {
|
|
83
74
|
allDaySlot: false,
|
|
84
75
|
plugins: [
|
|
85
76
|
FullCalendar.DayGrid.default,
|
|
@@ -120,44 +111,42 @@ const CalendarCore = {
|
|
|
120
111
|
return ['hide'];
|
|
121
112
|
},
|
|
122
113
|
});
|
|
123
|
-
|
|
124
|
-
this.Data[options.idModal].calendar.render();
|
|
114
|
+
CalendarCore.Data[options.idModal].calendar.render();
|
|
125
115
|
};
|
|
126
116
|
setTimeout(() => {
|
|
127
117
|
renderCalendar();
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
if (s(`.fc-timegrid-axis-cushion`)) htmls(`.fc-timegrid-axis-cushion`, Translate.
|
|
131
|
-
if (s(`.fc-dayGridMonth-button`)) htmls(`.fc-dayGridMonth-button`, Translate.
|
|
132
|
-
if (s(`.fc-timeGridWeek-button`)) htmls(`.fc-timeGridWeek-button`, Translate.
|
|
133
|
-
if (s(`.fc-listWeek-button`)) htmls(`.fc-listWeek-button`, Translate.
|
|
134
|
-
if (s(`.fc-today-button`)) htmls(`.fc-today-button`, Translate.
|
|
118
|
+
const applyFullCalendarLang = () => {
|
|
119
|
+
CalendarCore.Data[options.idModal].calendar.setOption('locale', s(`html`).lang);
|
|
120
|
+
if (s(`.fc-timegrid-axis-cushion`)) htmls(`.fc-timegrid-axis-cushion`, Translate.instance('all-day'));
|
|
121
|
+
if (s(`.fc-dayGridMonth-button`)) htmls(`.fc-dayGridMonth-button`, Translate.instance('month'));
|
|
122
|
+
if (s(`.fc-timeGridWeek-button`)) htmls(`.fc-timeGridWeek-button`, Translate.instance('week'));
|
|
123
|
+
if (s(`.fc-listWeek-button`)) htmls(`.fc-listWeek-button`, Translate.instance('summary'));
|
|
124
|
+
if (s(`.fc-today-button`)) htmls(`.fc-today-button`, Translate.instance('today'));
|
|
135
125
|
};
|
|
126
|
+
Translate.onChanged(applyFullCalendarLang, { key: 'fullcalendar-lang' });
|
|
136
127
|
setTimeout(() => {
|
|
137
|
-
|
|
128
|
+
applyFullCalendarLang();
|
|
138
129
|
s(`.fc-dayGridMonth-button`).onclick = () => {
|
|
139
|
-
|
|
130
|
+
applyFullCalendarLang();
|
|
140
131
|
};
|
|
141
132
|
s(`.fc-listWeek-button`).onclick = () => {
|
|
142
|
-
|
|
133
|
+
applyFullCalendarLang();
|
|
143
134
|
};
|
|
144
135
|
s(`.fc-timeGridWeek-button`).onclick = () => {
|
|
145
|
-
|
|
136
|
+
applyFullCalendarLang();
|
|
146
137
|
};
|
|
147
138
|
s(`.fc-next-button`).onclick = () => {
|
|
148
|
-
|
|
139
|
+
applyFullCalendarLang();
|
|
149
140
|
};
|
|
150
141
|
s(`.fc-prev-button`).onclick = () => {
|
|
151
|
-
|
|
142
|
+
applyFullCalendarLang();
|
|
152
143
|
};
|
|
153
144
|
s(`.fc-today-button`).onclick = () => {
|
|
154
|
-
|
|
145
|
+
applyFullCalendarLang();
|
|
155
146
|
};
|
|
156
147
|
});
|
|
157
|
-
|
|
158
148
|
sa(`.fc-button-group`)[1].style.float = 'right';
|
|
159
149
|
});
|
|
160
|
-
|
|
161
150
|
const idPanel = `calendar-panel-${options.idModal}`;
|
|
162
151
|
const formData = [
|
|
163
152
|
{
|
|
@@ -217,25 +206,23 @@ const CalendarCore = {
|
|
|
217
206
|
panel: { type: 'info-row' },
|
|
218
207
|
},
|
|
219
208
|
];
|
|
220
|
-
|
|
221
209
|
setTimeout(() => {
|
|
222
210
|
s(`.close-calendar-container`).onclick = () => {
|
|
223
211
|
s(`.calendar-container`).classList.add('hide');
|
|
224
212
|
s(`.main-body-calendar-${options.idModal}`).classList.remove('hide');
|
|
225
213
|
};
|
|
226
214
|
});
|
|
227
|
-
|
|
228
215
|
const panelRender = async () => {
|
|
229
|
-
return html`${await Panel.
|
|
216
|
+
return html`${await Panel.instance({
|
|
230
217
|
idPanel,
|
|
231
218
|
parentIdModal: options.idModal,
|
|
232
219
|
formData,
|
|
233
|
-
data:
|
|
220
|
+
data: CalendarCore.Data[options.idModal].data,
|
|
234
221
|
formContainerClass: '',
|
|
235
222
|
scrollClassContainer: `main-body-calendar-${options.idModal}`,
|
|
236
223
|
role: options.role,
|
|
237
|
-
originData: () =>
|
|
238
|
-
filesData: () =>
|
|
224
|
+
originData: () => CalendarCore.Data[options.idModal].originData,
|
|
225
|
+
filesData: () => CalendarCore.Data[options.idModal].filesData,
|
|
239
226
|
onClick: async function ({ payload }) {
|
|
240
227
|
if (options.route) {
|
|
241
228
|
setQueryPath({ path: options.route, queryPath: payload._id });
|
|
@@ -254,13 +241,13 @@ const CalendarCore = {
|
|
|
254
241
|
},
|
|
255
242
|
customButtons: [
|
|
256
243
|
{
|
|
257
|
-
label: html`<i class="fa-regular fa-calendar-days"></i> ${Translate.
|
|
244
|
+
label: html`<i class="fa-regular fa-calendar-days"></i> ${Translate.instance('calendar')}`,
|
|
258
245
|
onClick: function () {
|
|
259
246
|
s(`.calendar-container`).classList.remove('hide');
|
|
260
247
|
s(`.main-body-calendar-${options.idModal}`).classList.add('hide');
|
|
261
248
|
// renderCalendar();
|
|
262
249
|
CalendarCore.Data[options.idModal].calendar.setOption('height', 700);
|
|
263
|
-
Translate.
|
|
250
|
+
Translate.emitChanged({ lang: s('html').lang });
|
|
264
251
|
},
|
|
265
252
|
},
|
|
266
253
|
],
|
|
@@ -284,17 +271,15 @@ const CalendarCore = {
|
|
|
284
271
|
html:
|
|
285
272
|
status === 'success'
|
|
286
273
|
? editId
|
|
287
|
-
? Translate.
|
|
288
|
-
: Translate.
|
|
274
|
+
? Translate.instance('success-edit-event-scheduler')
|
|
275
|
+
: Translate.instance('success-add-event-scheduler')
|
|
289
276
|
: message,
|
|
290
277
|
status: status,
|
|
291
278
|
});
|
|
292
|
-
|
|
293
279
|
if (status === 'success') {
|
|
294
280
|
documentData.tools = true;
|
|
295
281
|
// data._id = documentData._id;
|
|
296
282
|
data = documentData;
|
|
297
|
-
|
|
298
283
|
let originObj, indexOriginObj;
|
|
299
284
|
let filesData = {};
|
|
300
285
|
if (editId) {
|
|
@@ -310,7 +295,6 @@ const CalendarCore = {
|
|
|
310
295
|
CalendarCore.Data[options.idModal].data.push(data);
|
|
311
296
|
CalendarCore.Data[options.idModal].filesData.push(filesData);
|
|
312
297
|
}
|
|
313
|
-
|
|
314
298
|
setQueryPath({ path: options.route, queryPath: documentData._id });
|
|
315
299
|
if (options.parentIdModal) Modal.Data[options.parentIdModal].query = `${window.location.search}`;
|
|
316
300
|
await CalendarCore.Data[options.idModal].updatePanel();
|
|
@@ -323,7 +307,7 @@ const CalendarCore = {
|
|
|
323
307
|
html: async () => {
|
|
324
308
|
return html`
|
|
325
309
|
<div class="in section-mp" style="text-align: center">
|
|
326
|
-
${Translate.
|
|
310
|
+
${Translate.instance('confirm-delete-item')}
|
|
327
311
|
<br />
|
|
328
312
|
"${data.description}"
|
|
329
313
|
</div>
|
|
@@ -339,10 +323,8 @@ const CalendarCore = {
|
|
|
339
323
|
html: status,
|
|
340
324
|
status,
|
|
341
325
|
});
|
|
342
|
-
|
|
343
326
|
setQueryPath({ path: options.route, queryPath: '' });
|
|
344
327
|
await CalendarCore.Data[options.idModal].updatePanel();
|
|
345
|
-
|
|
346
328
|
return { status };
|
|
347
329
|
}
|
|
348
330
|
return { status: 'error' };
|
|
@@ -351,9 +333,8 @@ const CalendarCore = {
|
|
|
351
333
|
})}
|
|
352
334
|
<div class="in" style="margin-bottom: 100px"></div>`;
|
|
353
335
|
};
|
|
354
|
-
|
|
355
336
|
let lastCid;
|
|
356
|
-
|
|
337
|
+
CalendarCore.Data[options.idModal].updatePanel = async () => {
|
|
357
338
|
const cid = getQueryParams().cid ? getQueryParams().cid : '';
|
|
358
339
|
if (lastCid === cid) return;
|
|
359
340
|
lastCid = cid;
|
|
@@ -364,7 +345,6 @@ const CalendarCore = {
|
|
|
364
345
|
htmls(`.main-body-calendar-${options.idModal}`, await panelRender());
|
|
365
346
|
}
|
|
366
347
|
};
|
|
367
|
-
|
|
368
348
|
if (options.route) {
|
|
369
349
|
listenQueryPathInstance({
|
|
370
350
|
id: options.parentIdModal ? 'html-' + options.parentIdModal : 'main-body',
|
|
@@ -377,7 +357,7 @@ const CalendarCore = {
|
|
|
377
357
|
Modal.Data['modal-menu'].onHome[idPanel] = async () => {
|
|
378
358
|
lastCid = undefined;
|
|
379
359
|
setQueryPath({ path: options.route, queryPath: '' });
|
|
380
|
-
await
|
|
360
|
+
await CalendarCore.Data[idPanel].updatePanel();
|
|
381
361
|
};
|
|
382
362
|
}
|
|
383
363
|
return html`
|
|
@@ -443,16 +423,15 @@ const CalendarCore = {
|
|
|
443
423
|
</style>
|
|
444
424
|
<div class="in calendar-container hide">
|
|
445
425
|
<div class="in modal calendar-buttons-container">
|
|
446
|
-
${await BtnIcon.
|
|
426
|
+
${await BtnIcon.instance({
|
|
447
427
|
class: `inl section-mp btn-custom close-calendar-container flr`,
|
|
448
|
-
label: html`<i class="fa-solid fa-xmark"></i> ${Translate.
|
|
428
|
+
label: html`<i class="fa-solid fa-xmark"></i> ${Translate.instance('close')}`,
|
|
449
429
|
type: 'button',
|
|
450
430
|
})}
|
|
451
431
|
</div>
|
|
452
432
|
<div class="in"><div class="calendar-${idPanel}"></div></div>
|
|
453
433
|
</div>
|
|
454
434
|
`;
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
|
|
435
|
+
}
|
|
436
|
+
}
|
|
458
437
|
export { CalendarCore };
|
|
@@ -5,12 +5,11 @@ import { Modal } from './Modal.js';
|
|
|
5
5
|
import { SocketIo } from './SocketIo.js';
|
|
6
6
|
import { Translate } from './Translate.js';
|
|
7
7
|
import { s, append } from './VanillaJs.js';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
Render: async function (options) {
|
|
8
|
+
class Chat {
|
|
9
|
+
static Data = {};
|
|
10
|
+
static async instance(options) {
|
|
12
11
|
const { idModal } = options;
|
|
13
|
-
|
|
12
|
+
Chat.Data[idModal] = {};
|
|
14
13
|
setTimeout(() => {
|
|
15
14
|
Modal.Data[idModal].onObserverListener[`chat-${idModal}`] = (options) => {
|
|
16
15
|
const { height } = options;
|
|
@@ -19,7 +18,7 @@ const Chat = {
|
|
|
19
18
|
s(`.btn-send-chat-${idModal}`).onclick = (e) => {
|
|
20
19
|
e.preventDefault();
|
|
21
20
|
if (!s(`.input-chat-${idModal}`).value) return;
|
|
22
|
-
|
|
21
|
+
Chat.appendChatBox({ id: SocketIo.socket.id, idModal, message: s(`.input-chat-${idModal}`).value });
|
|
23
22
|
SocketIo.Emit('chat', {
|
|
24
23
|
message: s(`.input-chat-${idModal}`).value,
|
|
25
24
|
});
|
|
@@ -29,23 +28,23 @@ const Chat = {
|
|
|
29
28
|
return html`
|
|
30
29
|
<form>
|
|
31
30
|
<div class="in section-mp chat-box ${idModal}-chat-box"></div>
|
|
32
|
-
${await Input.
|
|
31
|
+
${await Input.instance({
|
|
33
32
|
id: `input-chat-${idModal}`,
|
|
34
|
-
label: html`<i class="fa-solid fa-pen-to-square"></i> ${Translate.
|
|
33
|
+
label: html`<i class="fa-solid fa-pen-to-square"></i> ${Translate.instance('write')}`,
|
|
35
34
|
containerClass: 'in section-mp width-mini-box-hover input-container-width',
|
|
36
35
|
placeholder: true,
|
|
37
36
|
})}
|
|
38
37
|
<div class="in">
|
|
39
|
-
${await BtnIcon.
|
|
38
|
+
${await BtnIcon.instance({
|
|
40
39
|
class: `btn-send-chat-${idModal}`,
|
|
41
|
-
label: Translate.
|
|
40
|
+
label: Translate.instance('send'),
|
|
42
41
|
type: 'submit',
|
|
43
42
|
})}
|
|
44
43
|
</div>
|
|
45
44
|
</form>
|
|
46
45
|
`;
|
|
47
|
-
}
|
|
48
|
-
appendChatBox
|
|
46
|
+
}
|
|
47
|
+
static appendChatBox(options) {
|
|
49
48
|
const { idModal, id, message } = options;
|
|
50
49
|
if (!s(`.${idModal}-chat-box`)) return;
|
|
51
50
|
append(
|
|
@@ -58,7 +57,6 @@ const Chat = {
|
|
|
58
57
|
`,
|
|
59
58
|
);
|
|
60
59
|
s(`.${idModal}-chat-box`).scrollTop = s(`.${idModal}-chat-box`).scrollHeight;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
60
|
+
}
|
|
61
|
+
}
|
|
64
62
|
export { Chat };
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { EventBus } from './EventBus.js';
|
|
2
|
+
|
|
3
|
+
const AuthEventType = {
|
|
4
|
+
login: 'auth:login',
|
|
5
|
+
logout: 'auth:logout',
|
|
6
|
+
signup: 'auth:signup',
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const SessionEventType = {
|
|
10
|
+
updated: 'session:updated',
|
|
11
|
+
cleared: 'session:cleared',
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const SocketEventType = {
|
|
15
|
+
connect: 'socket:connect',
|
|
16
|
+
connectError: 'socket:connect-error',
|
|
17
|
+
disconnect: 'socket:disconnect',
|
|
18
|
+
channel: (channel) => `socket:channel:${channel}`,
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const TranslateEventType = {
|
|
22
|
+
changed: 'translate:changed',
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const ResponsiveEventType = {
|
|
26
|
+
changed: 'responsive:changed',
|
|
27
|
+
settled: 'responsive:settled',
|
|
28
|
+
orientationChanged: 'responsive:orientation:changed',
|
|
29
|
+
orientationSettled: 'responsive:orientation:settled',
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const RecoverEventType = {
|
|
33
|
+
triggered: 'recover:triggered',
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const KeyboardEventType = {
|
|
37
|
+
pressed: 'keyboard:pressed',
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const AccountEventType = {
|
|
41
|
+
updated: 'account:updated',
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const AppointmentEventType = {
|
|
45
|
+
submitted: 'appointment:submitted',
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const authLoginEvents = new EventBus();
|
|
49
|
+
const authLogoutEvents = new EventBus();
|
|
50
|
+
const authSignupEvents = new EventBus();
|
|
51
|
+
const sessionEvents = new EventBus();
|
|
52
|
+
const socketEvents = new EventBus();
|
|
53
|
+
const translateEvents = new EventBus();
|
|
54
|
+
const responsiveChangeEvents = new EventBus();
|
|
55
|
+
const responsiveSettledEvents = new EventBus();
|
|
56
|
+
const responsiveOrientationEvents = new EventBus();
|
|
57
|
+
const responsiveOrientationSettledEvents = new EventBus();
|
|
58
|
+
const recoverEvents = new EventBus();
|
|
59
|
+
const keyboardEvents = new EventBus();
|
|
60
|
+
const accountEvents = new EventBus();
|
|
61
|
+
const appointmentEvents = new EventBus();
|
|
62
|
+
|
|
63
|
+
export {
|
|
64
|
+
AuthEventType,
|
|
65
|
+
SessionEventType,
|
|
66
|
+
SocketEventType,
|
|
67
|
+
TranslateEventType,
|
|
68
|
+
ResponsiveEventType,
|
|
69
|
+
RecoverEventType,
|
|
70
|
+
KeyboardEventType,
|
|
71
|
+
AccountEventType,
|
|
72
|
+
AppointmentEventType,
|
|
73
|
+
authLoginEvents,
|
|
74
|
+
authLogoutEvents,
|
|
75
|
+
authSignupEvents,
|
|
76
|
+
sessionEvents,
|
|
77
|
+
socketEvents,
|
|
78
|
+
translateEvents,
|
|
79
|
+
responsiveChangeEvents,
|
|
80
|
+
responsiveSettledEvents,
|
|
81
|
+
responsiveOrientationEvents,
|
|
82
|
+
responsiveOrientationSettledEvents,
|
|
83
|
+
recoverEvents,
|
|
84
|
+
keyboardEvents,
|
|
85
|
+
accountEvents,
|
|
86
|
+
appointmentEvents,
|
|
87
|
+
};
|