@files-stack/client-redux
Advanced tools
Comparing version 0.0.27-3 to 0.0.27-4
@@ -42,2 +42,11 @@ import * as actionTypes from './types'; | ||
content: IContent; | ||
}) | ({ | ||
type: actionTypes.CHANGE_READING_STATUS; | ||
readingFile: IContent; | ||
}) | ({ | ||
type: actionTypes.ADD_STREAM_CONTENT; | ||
content: IContent; | ||
}) | ({ | ||
type: actionTypes.ADD_SUBSCRIBE; | ||
subscribe: any; | ||
}); | ||
@@ -57,1 +66,4 @@ export declare const openFileAction: (payload: any) => EditAction; | ||
export declare const keepOpenAction: (content: IContent) => EditAction; | ||
export declare const changeReadingStatusAction: (readingFile: IContent) => EditAction; | ||
export declare const addEditStreamContentAction: (content: IContent) => EditAction; | ||
export declare const addSubscribeAction: (subscribe: any) => EditAction; |
@@ -55,1 +55,7 @@ export declare type SET_ROOTPATH = '@@files-stack/SET_ROOTPATH'; | ||
export declare const KEEP_OPEN_EDITOR: KEEP_OPEN_EDITOR; | ||
export declare type CHANGE_READING_STATUS = '@@files-stack/CHANGE_READING_STATUS'; | ||
export declare const CHANGE_READING_STATUS: CHANGE_READING_STATUS; | ||
export declare type ADD_STREAM_CONTENT = '@@files-stack/ADD_STREAM_CONTENT'; | ||
export declare const ADD_STREAM_CONTENT: ADD_STREAM_CONTENT; | ||
export declare type ADD_SUBSCRIBE = '@@files-stack/ADD_SUBSCRIBE'; | ||
export declare const ADD_SUBSCRIBE: ADD_SUBSCRIBE; |
@@ -101,2 +101,5 @@ module.exports = | ||
exports.KEEP_OPEN_EDITOR = '@@files-stack/KEEP_OPEN_EDITOR'; | ||
exports.CHANGE_READING_STATUS = '@@files-stack/CHANGE_READING_STATUS'; | ||
exports.ADD_STREAM_CONTENT = '@@files-stack/ADD_STREAM_CONTENT'; | ||
exports.ADD_SUBSCRIBE = '@@files-stack/ADD_SUBSCRIBE'; | ||
@@ -312,2 +315,3 @@ | ||
allSave: false, | ||
subscribe: null, | ||
}; | ||
@@ -330,3 +334,3 @@ function edit(state = initialEditState, action) { | ||
index = ramda_1.findIndex(ramda_1.whereEq({ | ||
resource: 'file://' + action.payload.resource, | ||
resource: action.payload.resource, | ||
editorId: activeEditorId, | ||
@@ -338,3 +342,3 @@ }))(openingFiles); | ||
editingFiles.push(Object.assign({}, openingFiles[index])); | ||
return Object.assign({}, state, { openingFiles: [...openingFiles], editingFiles: [...editingFiles], editorWrappers: client_core_1.addEditorHistory(editorWrappers, activeEditorId, 'file://' + action.payload.resource) }); | ||
return Object.assign({}, state, { openingFiles: [...openingFiles], editingFiles: [...editingFiles], editorWrappers: client_core_1.addEditorHistory(editorWrappers, activeEditorId, action.payload.resource) }); | ||
} | ||
@@ -347,3 +351,3 @@ else { | ||
height: client_core_1.EDITOR_DEFAULT_HEIGHT, | ||
history: ['file://' + action.payload.resource], | ||
history: [action.payload.resource], | ||
}]; | ||
@@ -358,3 +362,7 @@ activeEditorId = 1; | ||
editors.push(action.payload.editorId); | ||
editorWrappers.push({ editorId: action.payload.editorId, height: client_core_1.EDITOR_DEFAULT_HEIGHT }); | ||
editorWrappers.push({ | ||
editorId: action.payload.editorId, | ||
height: client_core_1.EDITOR_DEFAULT_HEIGHT, | ||
history: [action.payload.resource], | ||
}); | ||
} | ||
@@ -367,8 +375,9 @@ else { | ||
readingFile = { | ||
resource: action.payload.resource, | ||
resource: core_1.getPath(action.payload.resource), | ||
name: action.payload.name, | ||
editorId: activeEditorId, | ||
oversize: action.payload.size >= client_core_1.CONTENT_SIZE_LIMIT, | ||
}; | ||
return Object.assign({}, state, { readingFile, | ||
activeEditorId, editors: [...editors], editorWrappers: client_core_1.addEditorHistory(editorWrappers, activeEditorId, 'file://' + action.payload.resource), oldValue: action.payload ? action.payload.oldValue : null, deleted: action.payload ? action.payload.deleted : null, addIgnore: action.payload ? action.payload.addIgnore : null }); | ||
activeEditorId, editors: [...editors], editorWrappers: client_core_1.addEditorHistory(editorWrappers, activeEditorId, action.payload.resource), oldValue: action.payload ? action.payload.oldValue : null, deleted: action.payload ? action.payload.deleted : null, addIgnore: action.payload ? action.payload.addIgnore : null }); | ||
} | ||
@@ -386,3 +395,3 @@ case actionTypes.ADD_EDIT: | ||
editors = [editorId]; | ||
editorWrappers = [{ editorId: 1, height: client_core_1.EDITOR_DEFAULT_HEIGHT, history: [] }]; | ||
editorWrappers = [{ editorId: 1, height: client_core_1.EDITOR_DEFAULT_HEIGHT, history: [action.content.resource] }]; | ||
} | ||
@@ -394,3 +403,3 @@ activeEditorId = editorId; | ||
editors.push(editorId); | ||
editorWrappers.push({ editorId, height: client_core_1.EDITOR_DEFAULT_HEIGHT, history: [] }); | ||
editorWrappers.push({ editorId, height: client_core_1.EDITOR_DEFAULT_HEIGHT, history: [action.content.resource] }); | ||
} | ||
@@ -533,3 +542,3 @@ else { | ||
editors = [1]; | ||
editorWrappers = [{ editorId: 1, height: client_core_1.EDITOR_DEFAULT_HEIGHT, history: [] }]; | ||
editorWrappers = [{ editorId: 1, height: client_core_1.EDITOR_DEFAULT_HEIGHT, history: [action.content.resource] }]; | ||
activeEditorId = 1; | ||
@@ -543,3 +552,3 @@ } | ||
editors.push(action.content.editorId); | ||
editorWrappers.push({ editorId: action.content.editorId, height: client_core_1.EDITOR_DEFAULT_HEIGHT, history: [] }); | ||
editorWrappers.push({ editorId: action.content.editorId, height: client_core_1.EDITOR_DEFAULT_HEIGHT, history: [action.content.resource] }); | ||
} | ||
@@ -556,5 +565,6 @@ else { | ||
preopen: true, | ||
oversize: action.content.size >= client_core_1.CONTENT_SIZE_LIMIT, | ||
}; | ||
return Object.assign({}, state, { readingFile, | ||
activeEditorId, editors: [...editors], editorWrappers: client_core_1.addEditorHistory(editorWrappers, action.content.editorId, action.content.resource), openingFiles: [...openingFiles] }); | ||
activeEditorId, editors: [...editors], editorWrappers: client_core_1.addEditorHistory(editorWrappers, action.content.editorId ? action.content.editorId : activeEditorId, action.content.resource), openingFiles: [...openingFiles] }); | ||
} | ||
@@ -643,3 +653,27 @@ case actionTypes.CHANGE_EDIT: | ||
editingFiles.push(Object.assign({}, action.content, { name: `Preview ${action.content.name}`, preview: true, editorId })); | ||
return Object.assign({}, state, { openingFiles: [...openingFiles], editingFiles: [...editingFiles], activeEditorId, editors: [...editors], editorWrappers: client_core_1.addEditorHistory(editorWrappers, action.content.editorId, action.content.resource) }); | ||
return Object.assign({}, state, { openingFiles: [...openingFiles], editingFiles: [...editingFiles], activeEditorId, editors: [...editors], editorWrappers: client_core_1.addEditorHistory(editorWrappers, editorId, action.content.resource) }); | ||
case actionTypes.CHANGE_READING_STATUS: | ||
return Object.assign({}, state, { readingFile: Object.assign({}, action.readingFile) }); | ||
case actionTypes.ADD_STREAM_CONTENT: | ||
if (action.content.status === client_core_1.FILE_CONTENT_STATUS.END) { | ||
return Object.assign({}, state, { readingFile: { resource: '' } }); | ||
} | ||
else if (action.content.status === client_core_1.FILE_CONTENT_STATUS.IN_PROGRESS) { | ||
openingFiles = state.openingFiles.map((content) => { | ||
if (content.resource === action.content.resource) { | ||
let value = content.value || ''; | ||
value = value + action.content.value; | ||
return Object.assign({}, content, { value, newValue: value }); | ||
} | ||
else { | ||
return content; | ||
} | ||
}); | ||
return Object.assign({}, state, { openingFiles: [...openingFiles] }); | ||
} | ||
else { | ||
return state; | ||
} | ||
case actionTypes.ADD_SUBSCRIBE: | ||
return Object.assign({}, state, { subscribe: action.subscribe }); | ||
case actionTypes.CLOSE_ALL_EDITORS: | ||
@@ -791,2 +825,11 @@ return initialEditState; | ||
}); | ||
exports.changeReadingStatusAction = (readingFile) => ({ | ||
type: actionTypes.CHANGE_READING_STATUS, readingFile, | ||
}); | ||
exports.addEditStreamContentAction = (content) => ({ | ||
type: actionTypes.ADD_STREAM_CONTENT, content, | ||
}); | ||
exports.addSubscribeAction = (subscribe) => ({ | ||
type: actionTypes.ADD_SUBSCRIBE, subscribe, | ||
}); | ||
@@ -793,0 +836,0 @@ |
@@ -43,2 +43,11 @@ export { Store } from './Store'; | ||
content: IContent; | ||
} | { | ||
type: "@@files-stack/CHANGE_READING_STATUS"; | ||
readingFile: IContent; | ||
} | { | ||
type: "@@files-stack/ADD_STREAM_CONTENT"; | ||
content: IContent; | ||
} | { | ||
type: "@@files-stack/ADD_SUBSCRIBE"; | ||
subscribe: any; | ||
}) => IEdit; | ||
@@ -84,2 +93,11 @@ '@files/finderOptions': (state: IFinderOptions, action: { | ||
content: IContent; | ||
} | { | ||
type: "@@files-stack/CHANGE_READING_STATUS"; | ||
readingFile: IContent; | ||
} | { | ||
type: "@@files-stack/ADD_STREAM_CONTENT"; | ||
content: IContent; | ||
} | { | ||
type: "@@files-stack/ADD_SUBSCRIBE"; | ||
subscribe: any; | ||
}) => IFinderOptions; | ||
@@ -86,0 +104,0 @@ '@files/expand': (state: IFileExpand[], action: { |
{ | ||
"name": "@files-stack/client-redux", | ||
"version": "0.0.27-3", | ||
"version": "0.0.27-4", | ||
"description": "Files Redux consists of reducers and actions", | ||
@@ -56,4 +56,4 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@files-stack/client-core": "^0.0.27-3", | ||
"@files-stack/core": "^0.0.27-3" | ||
"@files-stack/client-core": "^0.0.27-4", | ||
"@files-stack/core": "^0.0.27-4" | ||
}, | ||
@@ -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
126859
1439