1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | const neweb_browser_1 = require("neweb-browser");
|
4 | const neweb_core_1 = require("neweb-core");
|
5 | const client_1 = require("neweb-react/client");
|
6 | const React = require("react");
|
7 | const ReactDOM = require("react-dom");
|
8 | const SocketIOClient = require("socket.io-client");
|
9 | const initial = window[neweb_core_1.INITIAL_VAR];
|
10 | const socket = SocketIOClient(window.location.protocol + "//" + window.location.host);
|
11 | const modulesManager = new neweb_browser_1.ModulesManager({
|
12 | address: window.location.protocol + "//" + window.location.host + "/modules",
|
13 | modules: [{
|
14 | name: "react",
|
15 | version: undefined,
|
16 | type: "npm",
|
17 | content: "",
|
18 | exports: React,
|
19 | },
|
20 | {
|
21 | name: "react-dom",
|
22 | version: undefined,
|
23 | type: "npm",
|
24 | content: "",
|
25 | exports: ReactDOM,
|
26 | }],
|
27 | });
|
28 | const app = new neweb_browser_1.Application({
|
29 | modulesManager,
|
30 | });
|
31 | const pageRenderer = new client_1.ClientPageRenderer({
|
32 | app,
|
33 | rootHtmlElement: document.getElementById("root"),
|
34 | });
|
35 | const pageMetaManager = new neweb_browser_1.PageMetaManager();
|
36 | const seance = new neweb_browser_1.Seance({
|
37 | app,
|
38 | seanceId: initial.seanceId,
|
39 | socket,
|
40 | pageRenderer,
|
41 | pageMetaManager,
|
42 | });
|
43 | const logger = console;
|
44 | seance.initialize(initial).then(() => {
|
45 | window.dispatchEvent(new Event("neweb-seans-initialized"));
|
46 | logger.log("Initialized");
|
47 | });
|
48 | window.global = window;
|