Ejemplo n.º 1
0
exports.mutateSourceContentRequest = function (content, contentType, mutation) { return ({
    content: content,
    mutation: mutation,
    contentType: contentType,
    $id: aerial_common2_1.generateDefaultId(),
    type: exports.EDIT_SOURCE_CONTENT,
}); };
Ejemplo n.º 2
0
exports.applyFileMutationsRequest = function () {
    var mutations = [];
    for (var _i = 0; _i < arguments.length; _i++) {
        mutations[_i] = arguments[_i];
    }
    return ({
        mutations: mutations,
        $id: aerial_common2_1.generateDefaultId(),
        type: exports.APPLY_FILE_MUTATIONS,
    });
};
Ejemplo n.º 3
0
 return __generator(this, function (_c) {
     switch (_c.label) {
         case 0:
             documentId = aerial_common2_1.generateDefaultId();
             return [4 /*yield*/, getFetch()];
         case 1:
             fetch = _c.sent();
             return [4 /*yield*/, effects_1.select()];
         case 2:
             apiHost = (_c.sent()).apiHost;
             return [4 /*yield*/, redux_saga_1.eventChannel(function (emit) {
                     var reload = function (bounds) {
                         if (currentWindow) {
                             currentWindow.dispose();
                         }
                         var SEnvWindow = environment_1.getSEnvWindowClass({
                             console: getSEnvWindowConsole(),
                             fetch: fetch,
                             reload: function () { return reload(); },
                             getProxyUrl: function (url) {
                                 return apiHost && url.substr(0, 5) !== "data:" && url.indexOf(window.location.host) === -1 ? apiHost + "/proxy/" + encodeURIComponent(url) : url;
                             },
                             createRenderer: function (window) {
                                 return window.top === window ? new environment_1.SyntheticMirrorRenderer(window) : new environment_1.SyntheticDOMRenderer(window, document);
                             }
                         });
                         var window = currentWindow = new SEnvWindow(location, browserId);
                         // ick. Better to use seed function instead to generate UIDs <- TODO.
                         window.$id = windowId;
                         window.document.$id = documentId;
                         if (bounds) {
                             window.moveTo(bounds.left, bounds.top);
                             if (bounds.right) {
                                 window.resizeTo(bounds.right - bounds.left, bounds.bottom - bounds.top);
                             }
                         }
                         emit(window);
                         return window;
                     };
                     reload(bounds);
                     return function () { };
                 })];
         case 3:
             reloadChan = _c.sent();
             return [4 /*yield*/, effects_1.spawn(function () {
                     var isNew, _a;
                     return __generator(this, function (_b) {
                         switch (_b.label) {
                             case 0:
                                 if (!true) return [3 /*break*/, 5];
                                 return [4 /*yield*/, watchWindowExternalResourceUris(currentWindow, function () { return currentWindow.location.reload(); })];
                             case 1:
                                 _b.sent();
                                 currentWindow.$load();
                                 _a = state_1.getSyntheticWindow;
                                 return [4 /*yield*/, effects_1.select()];
                             case 2:
                                 isNew = !_a.apply(void 0, [_b.sent(), currentWindow.$id]);
                                 return [4 /*yield*/, effects_1.put(actions_1.syntheticWindowOpened(currentWindow, null, isNew))];
                             case 3:
                                 _b.sent();
                                 return [4 /*yield*/, effects_1.take(reloadChan)];
                             case 4:
                                 _b.sent();
                                 return [3 /*break*/, 0];
                             case 5: return [2 /*return*/];
                         }
                     });
                 })];
         case 4:
             _c.sent();
             return [2 /*return*/];
     }
 });
Ejemplo n.º 4
0
 function SEnvCSSBaseObject() {
     this._$id = aerial_common2_1.generateDefaultId();
 }
Ejemplo n.º 5
0
exports.fetchRequest = function (info) { return ({
    info: info,
    type: exports.FETCH_REQUEST,
    $id: aerial_common2_1.generateDefaultId()
}); };
Ejemplo n.º 6
0
exports.mutateSourceContentRequest2 = function (mutations) { return ({
    mutations: mutations.map((function (mutation) { return (__assign({}, mutation, { target: { source: mutation.target.source }, child: mutation.child && { source: mutation.child.source } })); })),
    $id: aerial_common2_1.generateDefaultId(),
    type: exports.MUTATE_SOURCE_CONTENT,
}); };
Ejemplo n.º 7
0
exports.openSyntheticWindowRequest = function (state, syntheticBrowserId, fromSavedState) { return ({
    state: state,
    syntheticBrowserId: syntheticBrowserId,
    type: exports.OPEN_SYNTHETIC_WINDOW,
    $id: aerial_common2_1.generateDefaultId()
}); };