@files-stack/client-redux
Advanced tools
Comparing version 0.0.25 to 0.0.26-1
@@ -19,2 +19,5 @@ import * as actionTypes from './types'; | ||
}) | ({ | ||
type: actionTypes.UPDATE_CONTENT; | ||
newValue: string; | ||
}) | ({ | ||
type: actionTypes.ACTIVATE_EDITOR; | ||
@@ -38,2 +41,3 @@ editorId: number; | ||
export declare const changeEditAction: (newValue: string) => EditAction; | ||
export declare const updateContentAction: (newValue: string) => EditAction; | ||
export declare const activateEditorAction: (editorId: number) => EditAction; | ||
@@ -40,0 +44,0 @@ export declare const updateEditorsHeightAction: (editorsHeight: any[]) => EditAction; |
@@ -29,2 +29,4 @@ export declare type SET_ROOTPATH = '@@files-stack/SET_ROOTPATH'; | ||
export declare const CHANGE_EDIT: CHANGE_EDIT; | ||
export declare type UPDATE_CONTENT = '@@files-stack/UPDATE_CONTENT'; | ||
export declare const UPDATE_CONTENT: UPDATE_CONTENT; | ||
export declare type COLLAPSE_ALL = '@@files-stack/COLLAPSE_ALL'; | ||
@@ -31,0 +33,0 @@ export declare const COLLAPSE_ALL: COLLAPSE_ALL; |
@@ -88,2 +88,3 @@ module.exports = | ||
exports.CHANGE_EDIT = '@@files-stack/CHANGE_EDIT'; | ||
exports.UPDATE_CONTENT = '@@files-stack/UPDATE_CONTENT'; | ||
exports.COLLAPSE_ALL = '@@files-stack/COLLAPSE_ALL'; | ||
@@ -476,2 +477,20 @@ exports.NEW_FILE = '@@files-stack/NEW_FILE'; | ||
} | ||
case actionTypes.UPDATE_CONTENT: | ||
openingFiles = state.openingFiles; | ||
editingFiles = state.editingFiles; | ||
index = ramda_1.findIndex(ramda_1.whereEq({ editorId: state.activeEditorId }))(editingFiles); | ||
if (index !== -1) { | ||
const activeEditorFile = state.editingFiles[index]; | ||
let items = lodash_1.filter(openingFiles, item => item.resource === activeEditorFile.resource && !item.deleted); | ||
items.forEach(item => { | ||
const itemIndex = openingFiles.indexOf(item); | ||
if (itemIndex !== -1) { | ||
openingFiles[itemIndex] = Object.assign({}, openingFiles[itemIndex], { newValue: action.newValue, value: action.newValue }); | ||
} | ||
}); | ||
return Object.assign({}, state, { openingFiles: [...openingFiles] }); | ||
} | ||
else { | ||
return state; | ||
} | ||
case actionTypes.ACTIVATE_EDITOR: | ||
@@ -620,2 +639,5 @@ index = state.editors.indexOf(action.editorId); | ||
}); | ||
exports.updateContentAction = (newValue) => ({ | ||
type: actionTypes.UPDATE_CONTENT, newValue, | ||
}); | ||
exports.activateEditorAction = (editorId) => ({ | ||
@@ -622,0 +644,0 @@ type: actionTypes.ACTIVATE_EDITOR, editorId, |
@@ -20,2 +20,5 @@ export { Store } from './Store'; | ||
} | { | ||
type: "@@files-stack/UPDATE_CONTENT"; | ||
newValue: string; | ||
} | { | ||
type: "@@files-stack/ACTIVATE_EDITOR"; | ||
@@ -50,2 +53,5 @@ editorId: number; | ||
} | { | ||
type: "@@files-stack/UPDATE_CONTENT"; | ||
newValue: string; | ||
} | { | ||
type: "@@files-stack/ACTIVATE_EDITOR"; | ||
@@ -52,0 +58,0 @@ editorId: number; |
{ | ||
"name": "@files-stack/client-redux", | ||
"version": "0.0.25", | ||
"version": "0.0.26-1", | ||
"description": "Files Redux consists of reducers and actions", | ||
@@ -56,4 +56,4 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@files-stack/client-core": "^0.0.25", | ||
"@files-stack/core": "^0.0.25" | ||
"@files-stack/client-core": "^0.0.26-1", | ||
"@files-stack/core": "^0.0.26-1" | ||
}, | ||
@@ -60,0 +60,0 @@ "peerDependencies": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
96414
1203
+ Added@files-stack/client-core@0.0.26(transitive)
+ Added@files-stack/core@0.0.26(transitive)
- Removed@files-stack/client-core@0.0.25(transitive)
- Removed@files-stack/core@0.0.25(transitive)
Updated@files-stack/core@^0.0.26-1