Skip to content

Commit

Permalink
Merge pull request #81 from datapartyjs/ncc-upgrade
Browse files Browse the repository at this point in the history
update sandbox compiler, ncc.
  • Loading branch information
sevenbitbyte authored Feb 4, 2024
2 parents fc7be3f + 750dab2 commit cf50fa6
Show file tree
Hide file tree
Showing 156 changed files with 1,099 additions and 383 deletions.
2 changes: 1 addition & 1 deletion docs/CloudDocument.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/LokiQuery.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/MongoQuery.html

Large diffs are not rendered by default.

39 changes: 30 additions & 9 deletions docs/bouncer_db_loki-db.js.html

Large diffs are not rendered by default.

29 changes: 23 additions & 6 deletions docs/bouncer_db_tingo-db.js.html

Large diffs are not rendered by default.

18 changes: 13 additions & 5 deletions docs/bouncer_db_zango-db.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/bouncer_icrufler.js.html

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions docs/bouncer_idb.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/bouncer_index.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/bouncer_ischema.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/bouncer_mongo-query.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/comms_ble-socket.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/comms_i2p-socket-comms.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/comms_index.js.html

Large diffs are not rendered by default.

18 changes: 14 additions & 4 deletions docs/comms_isocket-comms.js.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/comms_loopback-channel.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/comms_loopback-comms.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/comms_loopback-socket.js.html

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions docs/comms_peer-comms.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/comms_rest-comms.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/comms_rtc-socket-comms.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/comms_websocket-comms.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/config_iconfig.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/config_index.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/config_json-file.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/config_local-storage.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/config_memory.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/config_nconf.js.html

Large diffs are not rendered by default.

8 changes: 2 additions & 6 deletions docs/config_secure-config.js.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/data/search.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/global.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-Comms.BLEPeerClient.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-Comms.I2pSocketComms.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-Comms.ISocketComms.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-Comms.LoopbackChannel.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-Comms.LoopbackComms.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-Comms.LoopbackSocket.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-Comms.PeerComms.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-Comms.RTCSocketComms.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-Comms.RestComms.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-Comms.WebsocketComms.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-Comms.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-Config.IConfig.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-Config.JsonFileConfig.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-Config.LocalStorageConfig.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-Config.MemoryConfig.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-Config.NconfConfig.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-Config.SecureConfig.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-Config.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-Db.IDb.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-Db.ISchema.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-Db.LokiDb.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-Db.TingoDb.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-Db.ZangoDb.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-Db.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-Party.CloudParty.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-Party.DocumentFactory.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-Party.IDocument.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-Party.IParty.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-Party.LokiCache.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-Party.LokiParty.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-Party.MongoParty.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-Party.PeerParty.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-Party.Query.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-Party.TingoParty.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-Party.ZangoParty.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-Party.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-Service.EndpointContext.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-Service.IEndpoint.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-Service.IMiddleware.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-Service.ISandboxRunner.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-Service.IService.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-Service.ITask.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-Service.RunnerRouter.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-Service.ServiceHost.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-Service.ServiceRunner.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-Service.ServiceRunnerNode.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-Service.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-Topics.LocalTopicHost.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-Topics.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/party_cloud_cloud-document.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/party_cloud_cloud-party.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/party_document-factory.js.html

Large diffs are not rendered by default.

27 changes: 21 additions & 6 deletions docs/party_idocument.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/party_index.js.html

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions docs/party_iparty.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/party_local_loki-party.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/party_local_loki-query.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/party_local_tingo-party.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/party_local_zango-party.js.html

Large diffs are not rendered by default.

12 changes: 9 additions & 3 deletions docs/party_loki-cache.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/party_mongo_mongo-party.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/party_peer_peer-party.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/party_query.js.html

Large diffs are not rendered by default.

111 changes: 79 additions & 32 deletions docs/scripts/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,46 @@ var MIN_FONT_SIZE = 10;
var localStorage = window.localStorage;

function getTheme() {
var body = document.body;
var theme = localStorage.getItem(themeLocalStorageKey);

if (theme) return theme;

theme = document.body.getAttribute('data-theme');

switch (theme) {
case 'dark':
case 'light':
return theme;
case 'fallback-dark':
if (
// eslint-disable-next-line no-undef
window.matchMedia('(prefers-color-scheme)').matches &&
// eslint-disable-next-line no-undef
window.matchMedia('(prefers-color-scheme: light)').matches
) {
return 'light';
}

return 'dark';

return body.getAttribute('data-theme');
case 'fallback-light':
if (
// eslint-disable-next-line no-undef
window.matchMedia('(prefers-color-scheme)').matches &&
// eslint-disable-next-line no-undef
window.matchMedia('(prefers-color-scheme: dark)').matches
) {
return 'dark';
}

return 'light';

default:
return 'dark';
}
}

function updateTheme(theme) {
function localUpdateTheme(theme) {
var body = document.body;
var svgUse = document.querySelectorAll('.theme-svg-use');
var iconID = theme === 'dark' ? '#light-theme-icon' : '#dark-theme-icon';
Expand All @@ -28,7 +62,10 @@ function updateTheme(theme) {
svgUse.forEach(function (svg) {
svg.setAttribute('xlink:href', iconID);
});
}

function updateTheme(theme) {
localUpdateTheme(theme);
localStorage.setItem(themeLocalStorageKey, theme);
}

Expand All @@ -44,17 +81,7 @@ function toggleTheme() {
(function () {
var theme = getTheme();

var themeStoredInLocalStorage = localStorage.getItem(themeLocalStorageKey);

if (themeStoredInLocalStorage) {
if (theme === themeStoredInLocalStorage) {
return;
}

updateTheme(themeStoredInLocalStorage);
} else {
localStorage.setItem(themeLocalStorageKey, theme);
}
updateTheme(theme);
})();

/**
Expand Down Expand Up @@ -145,12 +172,15 @@ function bringElementIntoView(element, updateHistory = true) {
/**
* tocbotInstance is defined in layout.tmpl
* It is defined when we are initializing tocbot.
*
*
*/
// eslint-disable-next-line no-undef
if (tocbotInstance) {
// eslint-disable-next-line no-undef
setTimeout(() => tocbotInstance.updateTocListActiveElement(element), 60)
setTimeout(
// eslint-disable-next-line no-undef
() => tocbotInstance.updateTocListActiveElement(element),
60
);
}
var navbar = document.querySelector('.navbar-container');
var body = document.querySelector('.main-content');
Expand Down Expand Up @@ -249,7 +279,6 @@ function addAnchor() {
* @param {string} value
*/
function copy(value) {
console.log(value);
const el = document.createElement('textarea');

el.value = value;
Expand Down Expand Up @@ -401,9 +430,9 @@ function getFontSize() {
return currentFontSize;
}

function updateFontSize(fontSize) {
function localUpdateFontSize(fontSize) {
html.style.fontSize = fontSize + 'px';
localStorage.setItem(fontSizeLocalStorageKey, fontSize);

var fontSizeText = document.querySelector(
'#b77a68a492f343baabea06fad81f651e'
);
Expand All @@ -413,6 +442,11 @@ function updateFontSize(fontSize) {
}
}

function updateFontSize(fontSize) {
localUpdateFontSize(fontSize);
localStorage.setItem(fontSizeLocalStorageKey, fontSize);
}

(function () {
var fontSize = getFontSize();
var fontSizeInLocalStorage = localStorage.getItem(fontSizeLocalStorageKey);
Expand Down Expand Up @@ -452,17 +486,19 @@ function fontSizeTooltip() {

return `
<div class="font-size-tooltip">
<button aria-label="decrease-font-size" class="icon-button ${fontSize >= MAX_FONT_SIZE ? 'disabled' : ''
}" onclick="decrementFont(event)">
<button aria-label="decrease-font-size" class="icon-button ${
fontSize >= MAX_FONT_SIZE ? 'disabled' : ''
}" onclick="decrementFont(event)">
<svg>
<use xlink:href="#minus-icon"></use>
</svg>
</button>
<div class="font-size-text" id="b77a68a492f343baabea06fad81f651e">
${fontSize}
</div>
<button aria-label="increase-font-size" class="icon-button ${fontSize <= MIN_FONT_SIZE ? 'disabled' : ''
}" onclick="incrementFont(event)">
<button aria-label="increase-font-size" class="icon-button ${
fontSize <= MIN_FONT_SIZE ? 'disabled' : ''
}" onclick="incrementFont(event)">
<svg>
<use xlink:href="#add-icon"></use>
</svg>
Expand All @@ -482,31 +518,31 @@ function initTooltip() {
// eslint-disable-next-line no-undef
tippy('.theme-toggle', {
content: 'Toggle Theme',
delay: 500
delay: 500,
});

// eslint-disable-next-line no-undef
tippy('.search-button', {
content: 'Search',
delay: 500
delay: 500,
});

// eslint-disable-next-line no-undef
tippy('.font-size', {
content: 'Change font size',
delay: 500
delay: 500,
});

// eslint-disable-next-line no-undef
tippy('.codepen-button', {
content: 'Open code in CodePen',
placement: 'left'
placement: 'left',
});

// eslint-disable-next-line no-undef
tippy('.copy-code', {
content: 'Copy this code',
placement: 'left'
placement: 'left',
});

// eslint-disable-next-line no-undef
Expand All @@ -515,7 +551,7 @@ function initTooltip() {
trigger: 'click',
interactive: true,
allowHTML: true,
placement: 'left'
placement: 'left',
});
}

Expand Down Expand Up @@ -616,13 +652,13 @@ function onDomContentLoaded() {
// we are able to cross-check the correctness of
// result.
obj.el.parentNode.setAttribute('data-lang', 'code');
}
},
});
// eslint-disable-next-line no-undef
hljs.highlightAll();
// eslint-disable-next-line no-undef
hljs.initLineNumbersOnLoad({
singleLine: true
singleLine: true,
});

// Highlight complete
Expand Down Expand Up @@ -653,3 +689,14 @@ window.addEventListener('hashchange', (event) => {
bringIdToViewOnMount(url.hash);
}
});

// eslint-disable-next-line no-undef
window.addEventListener('storage', (event) => {
if (event.newValue === 'undefined') return;

initTooltip();

if (event.key === themeLocalStorageKey) localUpdateTheme(event.newValue);
if (event.key === fontSizeLocalStorageKey)
localUpdateFontSize(event.newValue);
});
Loading

0 comments on commit cf50fa6

Please sign in to comment.