Skip to content

Commit

Permalink
Merge branch 'main' into beta
Browse files Browse the repository at this point in the history
  • Loading branch information
vtnorton committed Jun 12, 2024
2 parents e104597 + 945b240 commit db0c57d
Show file tree
Hide file tree
Showing 94 changed files with 5,117 additions and 3,965 deletions.
3 changes: 2 additions & 1 deletion js/cdn/autodesk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
"live-server": "^1.2.2"
},
"author": "",
"license": "ISC"
"license": "ISC",
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
File renamed without changes.
3 changes: 2 additions & 1 deletion js/cdn/contextual-comments-autodesk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
"live-server": "^1.2.2"
},
"author": "",
"license": "ISC"
"license": "ISC",
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
2 changes: 1 addition & 1 deletion js/cdn/contextual-comments-canvas/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
},
"author": "",
"license": "ISC"
}
}
3 changes: 2 additions & 1 deletion js/cdn/contextual-comments-html/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
"live-server": "^1.2.2"
},
"author": "",
"license": "ISC"
"license": "ISC",
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
3 changes: 2 additions & 1 deletion js/cdn/contextual-comments-matterport/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
"live-server": "^1.2.2"
},
"author": "",
"license": "ISC"
"license": "ISC",
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
3 changes: 2 additions & 1 deletion js/cdn/contextual-comments-threejs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
"live-server": "^1.2.2"
},
"author": "",
"license": "ISC"
"license": "ISC",
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
3 changes: 2 additions & 1 deletion js/cdn/matterport/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
"live-server": "^1.2.2"
},
"author": "",
"license": "ISC"
"license": "ISC",
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
3 changes: 2 additions & 1 deletion js/cdn/mouse-pointers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
"live-server": "^1.2.2"
},
"author": "",
"license": "ISC"
"license": "ISC",
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
3 changes: 2 additions & 1 deletion js/cdn/real-time-data-engine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
"live-server": "^1.2.2"
},
"author": "",
"license": "ISC"
"license": "ISC",
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
76 changes: 38 additions & 38 deletions js/cdn/real-time-data-engine/public/index.html
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/svg+xml" href="favicon.svg" />
<title>SuperViz SDK</title>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/svg+xml" href="favicon.svg" />
<title>SuperViz SDK</title>

<!-- SuperViz SDK -->
<script type="module" src="https://unpkg.com/@superviz/sdk@6.2.0-beta.1"></script>
<!-- SuperViz SDK -->
<script type="module" src="https://unpkg.com/@superviz/sdk@6.2.0-beta.1"></script>

<!-- Main script, after SDK -->
<script type="module" src="/scripts/main.js"></script>
<link rel="stylesheet" href="/styles/main.css" />
</head>
<body>
<section>
<div class="events-info">
<div class="container">
<h2>Subscription Manager</h2>
<button id="subscribe">Subscribe to events</button>
</div>
<!-- Main script, after SDK -->
<script type="module" src="/scripts/main.js"></script>
<link rel="stylesheet" href="/styles/main.css" />
</head>
<body>
<section>
<div class="events-info">
<div class="container">
<h2>Subscription Manager</h2>
<button id="subscribe">Subscribe to events</button>
</div>

<div class="container" id="subscribedTo">
<h2>Not subscribed to any event</h2>
</div>
</div>
<div class="container" id="subscribedTo">
<h2>Not subscribed to any event</h2>
</div>
</div>

<hr />
<hr />

<div class="container">
<h2>Publising events</h2>
<div class="subscribe-options">
<select id="eventName" disabled>
<option value="one">one</option>
<option value="two">two</option>
<option value="three">three</option>
</select>
<input placeholder="Event message" id="eventMessage" />
<button id="publishButton">Publish</button>
</div>
</div>
<div class="container">
<h2>Publising events</h2>
<div class="subscribe-options">
<select id="eventName" disabled>
<option value="one">one</option>
<option value="two">two</option>
<option value="three">three</option>
</select>
<input placeholder="Event message" id="eventMessage" />
<button id="publishButton">Publish</button>
</div>
</div>

<div class="last-message container" id="lastElement"></div>
</section>
</body>
<div class="last-message container" id="lastElement"></div>
</section>
</body>
</html>
102 changes: 51 additions & 51 deletions js/cdn/real-time-data-engine/public/scripts/main.js
Original file line number Diff line number Diff line change
@@ -1,81 +1,81 @@
import { DEVELOPER_KEY } from "../env.js";
import { sampleInfo } from "../projectInfo.js";
import { DEVELOPER_KEY } from '../env.js'
import { sampleInfo } from '../projectInfo.js'

let room;
let realtime;
let channel;
let room
let realtime
let channel

const participant = Math.floor(Math.random() * 100);
const groupId = sampleInfo.id;
const groupName = sampleInfo.name;
const participant = Math.floor(Math.random() * 100)
const groupId = sampleInfo.id
const groupName = sampleInfo.name

document.getElementById("subscribe").addEventListener("click", subscribeToEvents);
document.getElementById("publishButton").addEventListener("click", publishEvent);
document.getElementById('subscribe').addEventListener('click', subscribeToEvents)
document.getElementById('publishButton').addEventListener('click', publishEvent)

function setLastPublishedMessage(message) {
document.getElementById("lastElement").innerHTML = `
document.getElementById('lastElement').innerHTML = `
<p><strong>Last message:</strong> <span>${message.data?.toString()}</span></p>
<p><strong>Published via:</strong> <span>${message.name}</span></p>
<p><strong>Published by:</strong> <span>${message.participantId}</span></p>
`;
`
}

function callbackFunctionForWhenTheEventIsDispatched(message) {
if (message.participantId === participant.toString()) return;
if (message.participantId === participant.toString()) return

setLastPublishedMessage(message);
setLastPublishedMessage(message)
}

function subscribeToEvents() {
channel.subscribe("one", callbackFunctionForWhenTheEventIsDispatched);
channel.subscribe("two", callbackFunctionForWhenTheEventIsDispatched);
channel.subscribe("three", callbackFunctionForWhenTheEventIsDispatched);
channel.subscribe('one', callbackFunctionForWhenTheEventIsDispatched)
channel.subscribe('two', callbackFunctionForWhenTheEventIsDispatched)
channel.subscribe('three', callbackFunctionForWhenTheEventIsDispatched)

document.getElementById("subscribedTo").innerHTML = `<h2>Subscribed to:</h2>
document.getElementById('subscribedTo').innerHTML = `<h2>Subscribed to:</h2>
<code>one</code>
<code>two</code>
<code>three</code>`;
<code>three</code>`

document.getElementById("eventName").disabled = false;
document.getElementById('eventName').disabled = false
}

function publishEvent() {
const eventDropdown = document.getElementById("eventName");
const messageInput = document.getElementById("eventMessage");
const eventDropdown = document.getElementById('eventName')
const messageInput = document.getElementById('eventMessage')

const eventName = eventDropdown.value;
const messageToPublish = messageInput.value;
const eventName = eventDropdown.value
const messageToPublish = messageInput.value

if (!eventName || !messageToPublish) return;
if (!eventName || !messageToPublish) return

channel.publish(eventName, messageToPublish);
channel.publish(eventName, messageToPublish)
}

async function initializeSuperVizRoom() {
room = await window.SuperVizRoom.init(DEVELOPER_KEY, {
roomId: groupId,
group: {
id: groupId,
name: groupName,
},
participant: {
id: participant.toString(),
name: "John " + participant,
},
});

realtime = new window.SuperVizRoom.Realtime();

realtime.subscribe("realtime-component.state-changed", (state) => {
if (state === "STARTED") {
channel = realtime.connect("your_channel_name");
console.log("Realtime component started", channel);
}
});

room.addComponent(realtime);

return room;
room = await window.SuperVizRoom.init(DEVELOPER_KEY, {
roomId: groupId,
group: {
id: groupId,
name: groupName,
},
participant: {
id: participant.toString(),
name: 'John ' + participant,
},
})

realtime = new window.SuperVizRoom.Realtime()

realtime.subscribe('realtime-component.state-changed', (state) => {
if (state === 'STARTED') {
channel = realtime.connect('your_channel_name')
console.log('Realtime component started', channel)
}
})

room.addComponent(realtime)

return room
}

initializeSuperVizRoom();
initializeSuperVizRoom()
3 changes: 2 additions & 1 deletion js/cdn/threejs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
"live-server": "^1.2.2"
},
"author": "",
"license": "ISC"
"license": "ISC",
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
3 changes: 2 additions & 1 deletion js/cdn/video-conference/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
"live-server": "^1.2.2"
},
"author": "",
"license": "ISC"
"license": "ISC",
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
3 changes: 2 additions & 1 deletion js/cdn/who-is-online/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
"live-server": "^1.2.2"
},
"author": "",
"license": "ISC"
"license": "ISC",
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
3 changes: 2 additions & 1 deletion js/react/autodesk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@
"devDependencies": {
"@vitejs/plugin-react": "^4.2.0",
"vite": "^5.0.0"
}
},
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
Loading

0 comments on commit db0c57d

Please sign in to comment.