@casual-simulation/aux-common 3.1.16 → 3.1.19
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/bots/Bot.d.ts +13 -1
- package/bots/Bot.js +8 -0
- package/bots/Bot.js.map +1 -1
- package/bots/BotCalculations.d.ts +7 -5
- package/bots/BotCalculations.js +14 -11
- package/bots/BotCalculations.js.map +1 -1
- package/bots/BotEvents.d.ts +126 -22
- package/bots/BotEvents.js +22 -1
- package/bots/BotEvents.js.map +1 -1
- package/bots/StoredAux.d.ts +52 -0
- package/bots/StoredAux.js +49 -0
- package/bots/StoredAux.js.map +1 -0
- package/bots/index.d.ts +1 -0
- package/bots/index.js +1 -0
- package/bots/index.js.map +1 -1
- package/bots/test/BotCalculationContextTests.js +2 -0
- package/bots/test/BotCalculationContextTests.js.map +1 -1
- package/package.json +4 -4
- package/partitions/PartitionUtils.d.ts +11 -0
- package/partitions/PartitionUtils.js +37 -0
- package/partitions/PartitionUtils.js.map +1 -0
- package/partitions/RemoteYjsPartition.js +7 -4
- package/partitions/RemoteYjsPartition.js.map +1 -1
- package/runtime/AuxCompiler.d.ts +4 -0
- package/runtime/AuxCompiler.js +16 -1
- package/runtime/AuxCompiler.js.map +1 -1
- package/runtime/AuxGlobalContext.js +2 -0
- package/runtime/AuxGlobalContext.js.map +1 -1
- package/runtime/AuxLibrary.d.ts +4 -2
- package/runtime/AuxLibrary.js +102 -15
- package/runtime/AuxLibrary.js.map +1 -1
- package/runtime/AuxLibraryDefinitions.def +156 -2
- package/runtime/AuxResults.d.ts +1 -0
- package/runtime/AuxRuntime.d.ts +7 -1
- package/runtime/AuxRuntime.js +348 -123
- package/runtime/AuxRuntime.js.map +1 -1
- package/runtime/RuntimeBot.d.ts +5 -1
- package/runtime/RuntimeBot.js +109 -7
- package/runtime/RuntimeBot.js.map +1 -1
- package/runtime/test/TestScriptBotFactory.js +1 -0
- package/runtime/test/TestScriptBotFactory.js.map +1 -1
package/runtime/AuxLibrary.js
CHANGED
|
@@ -8,10 +8,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { DEBUG_STRING, debugStringifyFunction, } from './AuxGlobalContext';
|
|
11
|
-
import { hasValue, trimTag, isBot, BOT_SPACE_TAG, toast as toastMessage, tip as tipMessage, hideTips as hideTipMessages, showJoinCode as calcShowJoinCode, requestFullscreen, exitFullscreen, html as htmlMessage, hideHtml as hideHtmlMessage, setClipboard as calcSetClipboard, tweenTo as calcTweenTo, showChat as calcShowChat, hideChat as calcHideChat, runScript, getMediaPermission as calcGetMediaPermission, getAverageFrameRate as calcGetAverageFrameRate, enableAR as calcEnableAR, disableAR as calcDisableAR, enableVR as calcEnableVR, disableVR as calcDisableVR, arSupported as calcARSupported, vrSupported as calcVRSupported, showUploadAuxFile as calcShowUploadAuxFile, openQRCodeScanner as calcOpenQRCodeScanner, showQRCode as calcShowQRCode, openBarcodeScanner as calcOpenBarcodeScanner, showBarcode as calcShowBarcode, importAUX as calcImportAUX, showInputForTag as calcShowInputForTag, showInput as calcShowInput, replaceDragBot as calcReplaceDragBot, goToDimension as calcGoToDimension, goToURL as calcGoToURL, openURL as calcOpenURL, checkout as calcCheckout, playSound as calcPlaySound, bufferSound as calcBufferSound, cancelSound as calcCancelSound, setupServer as calcSetupServer, shell as calcShell, backupToGithub as calcBackupToGithub, backupAsDownload as calcBackupAsDownload, finishCheckout as calcFinishCheckout, markHistory as calcMarkHistory, browseHistory as calcBrowseHistory, restoreHistoryMark as calcRestoreHistoryMark, loadFile as calcLoadFile, saveFile as calcSaveFile, reject as calcReject, localFormAnimation as calcLocalFormAnimation, webhook as calcWebhook, superShout as calcSuperShout, share as calcShare, registerPrefix as calcRegisterPrefix, createCertificate as calcCreateCertificate, signTag as calcSignTag, revokeCertificate as calcRevokeCertificate, localPositionTween as calcLocalPositionTween, localRotationTween as calcLocalRotationTween, showUploadFiles as calcShowUploadFiles, download, loadSimulation, unloadSimulation, getUploadState, addState, getPortalTag, KNOWN_PORTALS, openConsole, tagsOnBot, getOriginalObject, getBotSpace, trimEvent, CREATE_ACTION_NAME, CREATE_ANY_ACTION_NAME, DESTROY_ACTION_NAME, ORIGINAL_OBJECT, unlockSpace, getRemoteCount, getServers, getRemotes, listInstUpdates as calcListInstUpdates, getInstStateFromUpdates as calcGetInstStateFromUpdates, action, getServerStatuses, setSpacePassword, rpioInitPin, rpioExitPin, rpioOpenPin, rpioModePin, rpioReadPin, rpioReadSequencePin, rpioWritePin, rpioWriteSequencePin, rpioReadpadPin, rpioWritepadPin, rpioPudPin, rpioPollPin, rpioClosePin, rpioI2CBeginPin, rpioI2CSetSlaveAddressPin, rpioI2CSetBaudRatePin, rpioI2CSetClockDividerPin, rpioI2CReadPin, rpioI2CWritePin,
|
|
11
|
+
import { hasValue, trimTag, isBot, BOT_SPACE_TAG, toast as toastMessage, tip as tipMessage, hideTips as hideTipMessages, showJoinCode as calcShowJoinCode, requestFullscreen, exitFullscreen, html as htmlMessage, hideHtml as hideHtmlMessage, setClipboard as calcSetClipboard, tweenTo as calcTweenTo, showChat as calcShowChat, hideChat as calcHideChat, runScript, getMediaPermission as calcGetMediaPermission, getAverageFrameRate as calcGetAverageFrameRate, enableAR as calcEnableAR, disableAR as calcDisableAR, enableVR as calcEnableVR, disableVR as calcDisableVR, arSupported as calcARSupported, vrSupported as calcVRSupported, showUploadAuxFile as calcShowUploadAuxFile, openQRCodeScanner as calcOpenQRCodeScanner, showQRCode as calcShowQRCode, openBarcodeScanner as calcOpenBarcodeScanner, showBarcode as calcShowBarcode, importAUX as calcImportAUX, showInputForTag as calcShowInputForTag, showInput as calcShowInput, showConfirm as calcShowConfirm, replaceDragBot as calcReplaceDragBot, goToDimension as calcGoToDimension, goToURL as calcGoToURL, openURL as calcOpenURL, checkout as calcCheckout, playSound as calcPlaySound, bufferSound as calcBufferSound, cancelSound as calcCancelSound, setupServer as calcSetupServer, shell as calcShell, backupToGithub as calcBackupToGithub, backupAsDownload as calcBackupAsDownload, finishCheckout as calcFinishCheckout, markHistory as calcMarkHistory, browseHistory as calcBrowseHistory, restoreHistoryMark as calcRestoreHistoryMark, loadFile as calcLoadFile, saveFile as calcSaveFile, reject as calcReject, localFormAnimation as calcLocalFormAnimation, webhook as calcWebhook, superShout as calcSuperShout, share as calcShare, registerPrefix as calcRegisterPrefix, createCertificate as calcCreateCertificate, signTag as calcSignTag, revokeCertificate as calcRevokeCertificate, localPositionTween as calcLocalPositionTween, localRotationTween as calcLocalRotationTween, showUploadFiles as calcShowUploadFiles, download, loadSimulation, unloadSimulation, getUploadState, addState, getPortalTag, KNOWN_PORTALS, openConsole, tagsOnBot, getOriginalObject, getBotSpace, trimEvent, CREATE_ACTION_NAME, CREATE_ANY_ACTION_NAME, DESTROY_ACTION_NAME, ORIGINAL_OBJECT, unlockSpace, getRemoteCount, getServers, getRemotes, listInstUpdates as calcListInstUpdates, getInstStateFromUpdates as calcGetInstStateFromUpdates, action, getServerStatuses, setSpacePassword, rpioInitPin, rpioExitPin, rpioOpenPin, rpioModePin, rpioReadPin, rpioReadSequencePin, rpioWritePin, rpioWriteSequencePin, rpioReadpadPin, rpioWritepadPin, rpioPudPin, rpioPollPin, rpioClosePin, rpioI2CBeginPin, rpioI2CSetSlaveAddressPin, rpioI2CSetBaudRatePin, rpioI2CSetClockDividerPin, rpioI2CReadPin, rpioI2CWritePin,
|
|
12
12
|
// rpioI2CReadRegisterRestartPin,
|
|
13
13
|
// rpioI2CWriteReadRestartPin,
|
|
14
|
-
rpioI2CEndPin, rpioPWMSetClockDividerPin, rpioPWMSetRangePin, rpioPWMSetDataPin, rpioSPIBeginPin, rpioSPIChipSelectPin, rpioSPISetCSPolarityPin, rpioSPISetClockDividerPin, rpioSPISetDataModePin, rpioSPITransferPin, rpioSPIWritePin, rpioSPIEndPin, serialConnectPin, serialOpenPin, serialStreamPin, serialUpdatePin, serialWritePin, serialReadPin, serialClosePin, serialFlushPin, serialDrainPin, serialPausePin, serialResumePin, calculateAnchorPoint, calculateAnchorPointOffset, getBotPosition as calcGetBotPosition, getBotRotation as calcGetBotRotation, isRuntimeBot, SET_TAG_MASK_SYMBOL, CLEAR_TAG_MASKS_SYMBOL, getBotScale, EDIT_TAG_SYMBOL, EDIT_TAG_MASK_SYMBOL, circleWipe, addDropSnap as calcAddDropSnap, addDropGrid as calcAddDropGrid, animateToPosition, beginAudioRecording as calcBeginAudioRecording, endAudioRecording as calcEndAudioRecording, beginRecording as calcBeginRecording, endRecording as calcEndRecording, speakText as calcSpeakText, getVoices as calcGetVoices, getGeolocation as calcGetGeolocation, cancelAnimation, disablePOV, enablePOV, enableCustomDragging as calcEnableCustomDragging, MINI_PORTAL, registerCustomApp, setAppOutput, unregisterCustomApp, requestAuthData as calcRequestAuthData, createBot, defineGlobalBot as calcDefineGlobalBot, TEMPORARY_BOT_PARTITION_ID, convertToString, GET_TAG_MASKS_SYMBOL, isBotLink, parseBotLink, createBotLink, convertGeolocationToWhat3Words as calcConvertGeolocationToWhat3Words, getPublicRecordKey as calcGetPublicRecordKey, recordData as calcRecordData, getRecordData, eraseRecordData, recordFile as calcRecordFile, eraseFile as calcEraseFile, meetCommand as calcMeetCommand, meetFunction as calcMeetFunction, listDataRecord, recordEvent as calcRecordEvent, getEventCount as calcGetEventCount, openImageClassifier as calcOpenImageClassifier, isBotDate, DATE_TAG_PREFIX, parseBotDate, realNumberOrDefault, joinRoom as calcJoinRoom, leaveRoom as calcLeaveRoom, setRoomOptions as calcSetRoomOptions, getRoomOptions as calcGetRoomOptions, getRoomTrackOptions as calcGetRoomTrackOptions, setRoomTrackOptions as calcSetRoomTrackOptions, getRoomRemoteOptions as calcGetRoomRemoteOptions, raycastFromCamera as calcRaycastFromCamera, raycastInPortal as calcRaycastInPortal, calculateRayFromCamera as calcCalculateRayFromCamera, bufferFormAddressGltf, startFormAnimation as calcStartFormAnimation, stopFormAnimation as calcStopFormAnimation, listFormAnimations as calcListFormAnimations, calculateStringTagValue, createInitializationUpdate as calcCreateInitalizationUpdate, applyUpdatesToInst as calcApplyUpdatesToInst, configureWakeLock, getWakeLockConfiguration as calcGetWakeLockConfiguration, analyticsRecordEvent as calcAnalyticsRecordEvent, attachRuntime, detachRuntime, KNOWN_TAGS, } from '../bots';
|
|
14
|
+
rpioI2CEndPin, rpioPWMSetClockDividerPin, rpioPWMSetRangePin, rpioPWMSetDataPin, rpioSPIBeginPin, rpioSPIChipSelectPin, rpioSPISetCSPolarityPin, rpioSPISetClockDividerPin, rpioSPISetDataModePin, rpioSPITransferPin, rpioSPIWritePin, rpioSPIEndPin, serialConnectPin, serialOpenPin, serialStreamPin, serialUpdatePin, serialWritePin, serialReadPin, serialClosePin, serialFlushPin, serialDrainPin, serialPausePin, serialResumePin, calculateAnchorPoint, calculateAnchorPointOffset, getBotPosition as calcGetBotPosition, getBotRotation as calcGetBotRotation, isRuntimeBot, SET_TAG_MASK_SYMBOL, CLEAR_TAG_MASKS_SYMBOL, getBotScale, EDIT_TAG_SYMBOL, EDIT_TAG_MASK_SYMBOL, circleWipe, addDropSnap as calcAddDropSnap, addDropGrid as calcAddDropGrid, animateToPosition, beginAudioRecording as calcBeginAudioRecording, endAudioRecording as calcEndAudioRecording, beginRecording as calcBeginRecording, endRecording as calcEndRecording, speakText as calcSpeakText, getVoices as calcGetVoices, getGeolocation as calcGetGeolocation, cancelAnimation, disablePOV, enablePOV, enableCustomDragging as calcEnableCustomDragging, MINI_PORTAL, registerCustomApp, setAppOutput, unregisterCustomApp, requestAuthData as calcRequestAuthData, createBot, defineGlobalBot as calcDefineGlobalBot, TEMPORARY_BOT_PARTITION_ID, convertToString, GET_TAG_MASKS_SYMBOL, isBotLink, parseBotLink, createBotLink, convertGeolocationToWhat3Words as calcConvertGeolocationToWhat3Words, getPublicRecordKey as calcGetPublicRecordKey, recordData as calcRecordData, getRecordData, eraseRecordData, recordFile as calcRecordFile, eraseFile as calcEraseFile, meetCommand as calcMeetCommand, meetFunction as calcMeetFunction, listDataRecord, recordEvent as calcRecordEvent, getEventCount as calcGetEventCount, openImageClassifier as calcOpenImageClassifier, isBotDate, DATE_TAG_PREFIX, parseBotDate, realNumberOrDefault, joinRoom as calcJoinRoom, leaveRoom as calcLeaveRoom, setRoomOptions as calcSetRoomOptions, getRoomOptions as calcGetRoomOptions, getRoomTrackOptions as calcGetRoomTrackOptions, setRoomTrackOptions as calcSetRoomTrackOptions, getRoomRemoteOptions as calcGetRoomRemoteOptions, raycastFromCamera as calcRaycastFromCamera, raycastInPortal as calcRaycastInPortal, calculateRayFromCamera as calcCalculateRayFromCamera, bufferFormAddressGltf, startFormAnimation as calcStartFormAnimation, stopFormAnimation as calcStopFormAnimation, listFormAnimations as calcListFormAnimations, calculateStringTagValue, createInitializationUpdate as calcCreateInitalizationUpdate, applyUpdatesToInst as calcApplyUpdatesToInst, configureWakeLock, getWakeLockConfiguration as calcGetWakeLockConfiguration, analyticsRecordEvent as calcAnalyticsRecordEvent, attachRuntime, detachRuntime, KNOWN_TAGS, isStoredVersion2, } from '../bots';
|
|
15
15
|
import { sortBy, every, cloneDeep, union, isEqual, flatMap } from 'lodash';
|
|
16
16
|
import { remote as calcRemote, } from '@casual-simulation/causal-trees';
|
|
17
17
|
import { RanOutOfEnergyError } from './AuxResults';
|
|
@@ -40,6 +40,7 @@ import * as hooks from 'preact/hooks';
|
|
|
40
40
|
import { render } from 'preact';
|
|
41
41
|
import { isGenerator, UNCOPIABLE, unwind, } from '@casual-simulation/js-interpreter/InterpreterUtils';
|
|
42
42
|
import { INTERPRETABLE_FUNCTION } from './AuxCompiler';
|
|
43
|
+
import { constructInitializationUpdate } from '../partitions/PartitionUtils';
|
|
43
44
|
const _html = htm.bind(h);
|
|
44
45
|
const html = ((...args) => {
|
|
45
46
|
return _html(...args);
|
|
@@ -290,6 +291,7 @@ export function createDefaultLibrary(context) {
|
|
|
290
291
|
getWakeLockConfiguration,
|
|
291
292
|
download: downloadData,
|
|
292
293
|
downloadBots,
|
|
294
|
+
downloadBotsAsInitialzationUpdate,
|
|
293
295
|
downloadServer,
|
|
294
296
|
downloadInst: downloadServer,
|
|
295
297
|
showUploadAuxFile,
|
|
@@ -361,6 +363,7 @@ export function createDefaultLibrary(context) {
|
|
|
361
363
|
getDimensionalDepth,
|
|
362
364
|
showInputForTag,
|
|
363
365
|
showInput: makeMockableFunction(showInput, 'os.showInput'),
|
|
366
|
+
showConfirm,
|
|
364
367
|
goToDimension,
|
|
365
368
|
goToURL,
|
|
366
369
|
openURL,
|
|
@@ -1738,7 +1741,24 @@ export function createDefaultLibrary(context) {
|
|
|
1738
1741
|
for (let bot of bots) {
|
|
1739
1742
|
state[bot.id] = bot;
|
|
1740
1743
|
}
|
|
1741
|
-
let data = JSON.stringify(
|
|
1744
|
+
let data = JSON.stringify(getVersion1DownloadState(state));
|
|
1745
|
+
if (isPdf(filename)) {
|
|
1746
|
+
const encoder = new TextEncoder();
|
|
1747
|
+
const bytes = encoder.encode(data);
|
|
1748
|
+
const base64 = fromByteArray(bytes);
|
|
1749
|
+
data = embedBase64InPdf(base64);
|
|
1750
|
+
}
|
|
1751
|
+
const downloadedFilename = formatAuxFilename(filename);
|
|
1752
|
+
return addAction(download(data, downloadedFilename, mime.getType(downloadedFilename) || 'application/json'));
|
|
1753
|
+
}
|
|
1754
|
+
/**
|
|
1755
|
+
* Downloads the given list of bots.
|
|
1756
|
+
* @param bots The bots that should be downloaded.
|
|
1757
|
+
* @param filename The name of the file that the bots should be downloaded as.
|
|
1758
|
+
*/
|
|
1759
|
+
function downloadBotsAsInitialzationUpdate(bots, filename) {
|
|
1760
|
+
const update = constructInitializationUpdate(calcCreateInitalizationUpdate(bots));
|
|
1761
|
+
let data = JSON.stringify(getVersion2DownloadState(update));
|
|
1742
1762
|
if (isPdf(filename)) {
|
|
1743
1763
|
const encoder = new TextEncoder();
|
|
1744
1764
|
const bytes = encoder.encode(data);
|
|
@@ -1872,20 +1892,27 @@ export function createDefaultLibrary(context) {
|
|
|
1872
1892
|
*/
|
|
1873
1893
|
function importAUX(urlOrJSON) {
|
|
1874
1894
|
try {
|
|
1875
|
-
const
|
|
1876
|
-
if (
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1895
|
+
const aux = parseStoredAuxFromData(urlOrJSON);
|
|
1896
|
+
if (aux) {
|
|
1897
|
+
if (isStoredVersion2(aux)) {
|
|
1898
|
+
return applyUpdatesToInst(aux.updates);
|
|
1899
|
+
}
|
|
1900
|
+
else {
|
|
1901
|
+
const state = getUploadState(aux);
|
|
1902
|
+
if (state) {
|
|
1903
|
+
const event = addState(state);
|
|
1904
|
+
addAction(event);
|
|
1905
|
+
let promise = Promise.resolve();
|
|
1906
|
+
promise[ORIGINAL_OBJECT] = event;
|
|
1907
|
+
return promise;
|
|
1908
|
+
}
|
|
1880
1909
|
}
|
|
1881
|
-
const uploaded = getUploadState(state);
|
|
1882
|
-
const event = addState(uploaded);
|
|
1883
|
-
return addAction(event);
|
|
1884
1910
|
}
|
|
1885
1911
|
}
|
|
1886
1912
|
catch (_a) { }
|
|
1887
|
-
const
|
|
1888
|
-
|
|
1913
|
+
const task = context.createTask();
|
|
1914
|
+
const event = calcImportAUX(urlOrJSON, task.taskId);
|
|
1915
|
+
return addAsyncAction(task, event);
|
|
1889
1916
|
}
|
|
1890
1917
|
/**
|
|
1891
1918
|
* Parses the given JSON or PDF data and returns the list of bots that were contained in it.
|
|
@@ -1936,6 +1963,47 @@ export function createDefaultLibrary(context) {
|
|
|
1936
1963
|
}
|
|
1937
1964
|
return bots;
|
|
1938
1965
|
}
|
|
1966
|
+
/**
|
|
1967
|
+
* Parses the given JSON or PDF data and returns the list of bots that were contained in it.
|
|
1968
|
+
* @param jsonOrPdf The JSON or PDF data to parse.
|
|
1969
|
+
*/
|
|
1970
|
+
function parseStoredAuxFromData(jsonOrPdf) {
|
|
1971
|
+
let data;
|
|
1972
|
+
if (typeof jsonOrPdf === 'string') {
|
|
1973
|
+
try {
|
|
1974
|
+
data = JSON.parse(jsonOrPdf);
|
|
1975
|
+
}
|
|
1976
|
+
catch (e) {
|
|
1977
|
+
try {
|
|
1978
|
+
data = getEmbeddedBase64FromPdf(jsonOrPdf);
|
|
1979
|
+
const bytes = toByteArray(data);
|
|
1980
|
+
const decoder = new TextDecoder();
|
|
1981
|
+
const text = decoder.decode(bytes);
|
|
1982
|
+
data = JSON.parse(text);
|
|
1983
|
+
}
|
|
1984
|
+
catch (err) {
|
|
1985
|
+
data = null;
|
|
1986
|
+
}
|
|
1987
|
+
}
|
|
1988
|
+
}
|
|
1989
|
+
else {
|
|
1990
|
+
try {
|
|
1991
|
+
const str = new TextDecoder().decode(jsonOrPdf);
|
|
1992
|
+
data = getEmbeddedBase64FromPdf(str);
|
|
1993
|
+
const bytes = toByteArray(data);
|
|
1994
|
+
const decoder = new TextDecoder();
|
|
1995
|
+
const text = decoder.decode(bytes);
|
|
1996
|
+
data = JSON.parse(text);
|
|
1997
|
+
}
|
|
1998
|
+
catch (err) {
|
|
1999
|
+
data = null;
|
|
2000
|
+
}
|
|
2001
|
+
}
|
|
2002
|
+
if (!hasValue(data)) {
|
|
2003
|
+
return null;
|
|
2004
|
+
}
|
|
2005
|
+
return data;
|
|
2006
|
+
}
|
|
1939
2007
|
/**
|
|
1940
2008
|
* Replaces the bot that the user is beginning to drag.
|
|
1941
2009
|
* Only works from inside a onDrag() or onAnyBotDrag() listen tag.
|
|
@@ -2092,6 +2160,18 @@ export function createDefaultLibrary(context) {
|
|
|
2092
2160
|
const event = calcShowInput(currentValue, options, task.taskId);
|
|
2093
2161
|
return addAsyncAction(task, event);
|
|
2094
2162
|
}
|
|
2163
|
+
/**
|
|
2164
|
+
* Shows a confirmation dialog. Returns a promise that resolves with true if the "Confirm" button is clicked and false if the "Cancel" button is clicked or the dialog is closed.
|
|
2165
|
+
* @param options The options that indicate how the confirmation dialog shold be customized.
|
|
2166
|
+
*/
|
|
2167
|
+
function showConfirm(options) {
|
|
2168
|
+
if (!options) {
|
|
2169
|
+
throw new Error('You must provide an options object for os.showConfirm()');
|
|
2170
|
+
}
|
|
2171
|
+
const task = context.createTask();
|
|
2172
|
+
const event = calcShowConfirm(options, task.taskId);
|
|
2173
|
+
return addAsyncAction(task, event);
|
|
2174
|
+
}
|
|
2095
2175
|
/**
|
|
2096
2176
|
* Redirects the user to the given dimension.
|
|
2097
2177
|
* @param dimension The dimension to go to.
|
|
@@ -3549,10 +3629,11 @@ export function createDefaultLibrary(context) {
|
|
|
3549
3629
|
if (!event) {
|
|
3550
3630
|
return;
|
|
3551
3631
|
}
|
|
3632
|
+
const original = getOriginalObject(event);
|
|
3552
3633
|
let actions = [];
|
|
3553
3634
|
let selectors = Array.isArray(selector) ? selector : [selector];
|
|
3554
3635
|
for (let s of selectors) {
|
|
3555
|
-
const r = calcRemote(
|
|
3636
|
+
const r = calcRemote(original, convertSessionSelector(s), allowBatching);
|
|
3556
3637
|
actions.push(addAction(r));
|
|
3557
3638
|
}
|
|
3558
3639
|
if (Array.isArray(selector)) {
|
|
@@ -5963,12 +6044,18 @@ export function createDefaultLibrary(context) {
|
|
|
5963
6044
|
promise[ORIGINAL_OBJECT] = action;
|
|
5964
6045
|
return promise;
|
|
5965
6046
|
}
|
|
5966
|
-
function
|
|
6047
|
+
function getVersion1DownloadState(state) {
|
|
5967
6048
|
return {
|
|
5968
6049
|
version: 1,
|
|
5969
6050
|
state,
|
|
5970
6051
|
};
|
|
5971
6052
|
}
|
|
6053
|
+
function getVersion2DownloadState(update) {
|
|
6054
|
+
return {
|
|
6055
|
+
version: 2,
|
|
6056
|
+
updates: [update],
|
|
6057
|
+
};
|
|
6058
|
+
}
|
|
5972
6059
|
function isPdf(filename) {
|
|
5973
6060
|
return filename.endsWith('.pdf');
|
|
5974
6061
|
}
|